Attention une mise à jour du serveur va être effectuée le lundi 17 mai entre 13h et 13h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit 3d742256 authored by EYRAUD-DUBOIS Lionel's avatar EYRAUD-DUBOIS Lionel

Support for saving multiple schedules in one file

parent be8f47ac
......@@ -21,12 +21,25 @@ int ActionSequence::chooseType(int t, int nr) {
return -1;
}
ExportToFile::ExportToFile(string filename, Instance* ins, bool header)
: output(filename), instance(ins) {
ExportToFile::ExportToFile(string filename, Instance* ins, bool header, string name)
: output(filename), instance(ins), name(name) {
if(name != "")
output << "sched ";
if(header)
output << "Tid worker taskType start duration end" << endl;
}
void ExportToFile::changeName(string newName) {
if((name == "" && newName != "")) {
cerr << "EtF: Warning, adding a name after the start breaks the header" << endl;
}
if(name != "" && newName == "") newName = "NA";
name = newName;
}
void ExportToFile::onSchedule(int i, int w, double s, double f) {
if(name != "")
this->output << name << " ";
this->output << i << " " << w << " " << instance->taskTypes[i] << " "
<< s << " " << (f - s) << " " << f << endl;
}
......
......@@ -24,11 +24,13 @@ class ActionSequence : public SchedAction {
};
class ExportToFile : public SchedAction {
ofstream output;
std::ofstream output;
Instance* instance;
std::string name;
public:
ExportToFile(string filename, Instance* ins, bool header = false);
ExportToFile(std::string filename, Instance* ins, bool header = false, std::string name ="");
void onSchedule(int i, int w, double s, double f);
void changeName(std::string newName);
~ExportToFile();
};
......
Markdown is supported
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