24{
25 wxFileDialog saveFileDialog(this,
26 _("Export CSV"),
27 "",
28 _("results.csv"),
29 _("CSV files (*.csv)|*.csv"),
30 wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
31
32 if (saveFileDialog.ShowModal() == wxID_CANCEL)
33 return;
34
35 wxString fileAddName[10] = { _("_PowerFlow"), _("_PFBuses"), _("_PFBranches"), _("_Fault"), _("_FaultBuses"), _("_FaultBranches"),
36 _("_FaultGenerators"), _("_HarmSources"), _("_HarmVoltages"), _("_HarmCurrents") };
37 std::vector<wxString> filesSaved;
38 int i = 0;
39 for (auto& checkBox : m_checkBoxList)
40 {
41 if (checkBox->GetValue())
42 {
43 wxString path = saveFileDialog.GetPath();
44 path.insert(path.Length() - 4, fileAddName[i]);
45 ExportGridToCSV(m_gridList[i], path);
46
47 wxFileName fn(path);
48 filesSaved.push_back(fn.GetFullName());
49 }
50 i++;
51 }
52
53 wxString message = _("The following files have been successfully exported:\n");
54 for (const auto& file : filesSaved)
55 message += file + "\n";
56
57 wxMessageDialog msgDialog(this, message, _("Information"), wxOK | wxCENTRE | wxICON_INFORMATION);
58 msgDialog.ShowModal();
59
60 EndModal(wxID_OK);
61}