| 447 | } |
| 448 | |
| 449 | void SimulationParametersMainWindow::onOpenParameters() |
| 450 | { |
| 451 | GenericFileDialog::get().showOpenFileDialog( |
| 452 | "Open simulation parameters", "Simulation parameters (*.parameters){.parameters},.*", _fileDialogPath, [&](std::filesystem::path const& path) { |
| 453 | auto firstFilename = ifd::FileDialog::Instance().GetResult(); |
| 454 | auto firstFilenameCopy = firstFilename; |
| 455 | _fileDialogPath = firstFilenameCopy.remove_filename().string(); |
| 456 | |
| 457 | SimulationParameters parameters; |
| 458 | if (!SerializerService::get().deserializeSimulationParametersFromFile(parameters, firstFilename.string())) { |
| 459 | GenericMessageDialog::get().information("Open simulation parameters", "The selected file could not be opened."); |
| 460 | } else { |
| 461 | _simulationFacade->setSimulationParameters(parameters); |
| 462 | _simulationFacade->setOriginalSimulationParameters(parameters); |
| 463 | } |
| 464 | }); |
| 465 | } |
| 466 | |
| 467 | void SimulationParametersMainWindow::onSaveParameters() |
| 468 | { |
nothing calls this directly
no test coverage detected