Commit d011c755 authored by Bruno Meyer's avatar Bruno Meyer 😢

ensalamento-back#15: Add Schedule, Room and Current classes to js api & Change...

ensalamento-back#15: Add Schedule, Room and Current classes to js api & Change parameters accepted on ensalador
parent ab01c16d
......@@ -7,4 +7,5 @@ CMakeFiles
ensalador
schedules.yaml
rooms.yaml
Makefile
\ No newline at end of file
Makefile
munkres-cpp
\ No newline at end of file
This diff is collapsed.
......@@ -55,7 +55,6 @@ bool Database::loadSchedules(std::string filename){
YAML::Node schedules = yaml_schedules["schedules"];//YAML node, the "schedules" section of the input file
if (schedules.IsNull()) return false;
for (size_t i=0; i<schedules.size(); i++){
Turma* sched = new Turma(schedules[i]);
if( schedules[i]["assigned"] ){
......@@ -66,7 +65,6 @@ bool Database::loadSchedules(std::string filename){
}
this->schedules.push_back(sched);
}
return true;
}
......
......@@ -458,16 +458,16 @@ void statisticasTotal(Database& db) {
/*====================================== MAIN =======================================*/
int main(int argc, char *argv[]) {
if ( argc < 2 ){
if ( argc < 5 ){
printf("Syntax error: ensalador [open|close|accept|statRoom|statCourse|statTotal|exec|check]\n");
printf("1) ensalador exec\n");
printf("2) ensalador exec '{courses: [96A,98B], blocks: pf}'\n");
return 1;
}
string cmd = argv[1];
string cmd = argv[4];
cerr << "Carregando o arquivo rooms.yaml\n";
Database database("rooms.yaml", "schedules.yaml", "current.yaml");
Database database((string)argv[1], (string)argv[2], (string)argv[3]);
if ( cmd == "open" ){
cerr << "Carregando o arquivo schedules.yaml\n";
......@@ -477,7 +477,6 @@ int main(int argc, char *argv[]) {
cerr << "Carregando o arquivo current.yaml\n";
database.loadCurrent();
}
if ( cmd == "close" ) {
main_close(database, "output.txt");
main_close2(database, "binario.txt");
......@@ -502,7 +501,7 @@ int main(int argc, char *argv[]) {
} else if ( cmd == "exec" ) {
database.setFactors(10.0,1.0,500.0);
string args = ( argc > 2 ) ? argv[2] : "";
string args = ( argc > 5 ) ? argv[5] : "";
main_exec(database, args);
} else if ( cmd == "latex" ){
......
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