Commit 6f9bd692 authored by Maxime POULAIN's avatar Maxime POULAIN
Browse files

add csv export

parent 3355451b
......@@ -17,7 +17,7 @@ bierwirth_t global_v;
bool fileLoaded;
bool stopRequested;
char szFile[1024];
vector<string> history;
void MainForm::InitializeComponent(void)
......@@ -497,6 +497,9 @@ System::Void MainForm::buttonStart_Click(System::Object^ sender, System::EventAr
item->SubItems->Add(charToString(to_string(global_sol.cost)));
listView->Items->Add(item);
char tmp[256];
sprintf_s(tmp, "%s, %d, %d", stringToChar(textBoxFile->Text), nb_it, global_sol.cost);
history.push_back(tmp);
}
......@@ -511,20 +514,14 @@ System::Void MainForm::buttonExport_Click(System::Object^ sender, System::EventA
{
ofstream myfile;
char filename[100];
sprintf(filename, "out_%d.txt", time(NULL));
sprintf_s(filename, "out_%d.csv", (int)time(NULL));
myfile.open(filename);
std::cout << "Now" << std::endl;
for (int i = 0; i < listView->Items->Count; i++)
myfile << "fichier, nb_iteration, meilleur_cout" << std::endl;
for each (string s in history)
{
for (int j = 0; j < listView->Items[i]->SubItems->Count; j++)
{
std::cout << stringToChar(listView->Items[i]->SubItems[j]->Text) << "\t";
std::cout << stringToChar(listView->Items[i]->SubItems[j]->Text) << std::endl;
}
myfile << std::endl;
myfile << s << std::endl;
}
myfile.close();
}
......
cours.txt 1 25
cours.txt 1 25
cours.txt 1 25
cours.txt 1 25
cours.txt 1 25
la01.txt 54 666
la02.txt 1000 704
la10.txt 12 958
la17.txt 1000 835
cours.txt,1,25
cours.txt,1,25
cours.txt,1,25
cours.txt,1,25
cours.txt,1,25
cours.txt,1,25
cours.txt,1,25
fichier, nombre_itération, meilleur_cout

,66,926
fichier, nombre_itération, meilleur_cout

 1 25
cours.txt 1 25
cours.txt 1 25
la04.txt 1000 608
fichier, nb_iteration, meilleur_cout
cours.txt, 1, 25
cours.txt, 1, 25
cours.txt, 1, 25
cours.txt, 1, 25
cours.txt, 1, 25
cours.txt, 1, 25
fichier, nb_iteration, meilleur_cout
cours.txt, 1, 25
cours.txt, 1, 25
cours.txt, 1, 25
cours.txt, 1, 25
cours.txt, 1, 25
cours.txt, 1, 25
la01.txt, 144, 666
 bierwirthManager.cpp
 MainForm.cpp
C:\Users\poula\Downloads\oad-tp2\Code\View\utils.h(15,2): warning C4091: 'static ': ignored on left of 'utils' when no variable is declared
Entry.cpp
gestion_graphe.cpp
MainForm.cpp
C:\Users\poula\Downloads\oad-tp2\Code\View\utils.h(15,2): warning C4091: 'static ': ignored on left of 'utils' when no variable is declared
C:\Users\poula\Downloads\oad-tp2\Code\View\MainForm.cpp(514,20): warning C4477: 'sprintf' : format string '%d' requires an argument of type 'int', but variadic argument 1 has type 'time_t'
C:\Users\poula\Downloads\oad-tp2\Code\View\MainForm.cpp(514,20): message : consider using '%lld' in the format string
C:\Users\poula\Downloads\oad-tp2\Code\View\MainForm.cpp(514,20): message : consider using '%Id' in the format string
C:\Users\poula\Downloads\oad-tp2\Code\View\MainForm.cpp(514,20): message : consider using '%I64d' in the format string
C:\Users\poula\Downloads\oad-tp2\Code\View\MainForm.cpp(514,2): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
solution.cpp
utils.cpp
C:\Users\poula\Downloads\oad-tp2\Code\View\utils.h(15,2): warning C4091: 'static ': ignored on left of 'utils' when no variable is declared
.NETFramework,Version=v4.7.2.AssemblyAttributes.cpp
Generating Code...
C:\Users\poula\Downloads\oad-tp2\Code\View\bierwirthManager.cpp(67): warning C4715: 'bierwirthManager::prToIndex': not all control paths return a value
bierwirthManager.obj : MSIL module encountered; incremental linking is disabled for MSIL; performing full link
View.vcxproj -> C:\Users\poula\Downloads\oad-tp2\Code\x64\Debug\View.exe
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment