Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ftomei committed May 26, 2022
1 parent f641418 commit 8cacb01
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions bin/CRITERIA1D/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,22 @@

// uncomment to execute test
//#define TEST
//#define TEST_GEO
//#define TEST_FIRSTRUN
//#define TEST_RESTART


void usage()
{
std::cout << "CRITERIA-1D soil water balance" << std::endl
std::cout << "CRITERIA-1D agro-hydrological model" << std::endl
<< "\nUsage:" << std::endl
<< "CRITERIA1D <project.ini> [lastDate]" << std::endl
<< "CRITERIA1D <project.ini> [firstDate] [lastDate]" << std::endl
<< "CRITERIA1D <project.ini> [firstDate lastDate]" << std::endl
<< "\nNotes:" << std::endl
<< "date must be in YYYY-MM-DD format" << std::endl
<< "firstDate and lastDate can be also defined in the project.ini" << std::endl
<< "default dates in the projects with meteoPoints data (SQLite) are the first and last date of the data tables" << std::endl
<< "default lastDate in the projects with meteoGrid projects (MySQL) is yesterday" << std::endl;
<< "- dates must be in YYYY-MM-DD format;" << std::endl
<< "- firstDate and lastDate can be defined in the project.ini;" << std::endl
<< "- default dates are the first and last date of the data tables in the db_meteo (SQLite);" << std::endl
<< "- in the projects with MySQL meteoGrid data, default lastDate is yesterday." << std::endl;

std::cout << std::flush;
}
Expand All @@ -45,13 +46,20 @@ int main(int argc, char *argv[])
}
else
{
QString path;
if (! searchDataPath(&path)) return -1;
QString dataPath;
if (! searchDataPath(&dataPath))
return -1;
QString projectPath = dataPath + PATH_PROJECT;

#ifdef TEST
settingsFileName = path + "PROJECT/kiwifruit/kiwifruit.ini";
settingsFileName = projectPath + "kiwifruit/kiwifruit.ini";
#else
usage();
return 1;
#ifdef TEST_GEO
settingsFileName = projectPath + "INCOLTO/incolto.ini";
#else
usage();
return 1;
#endif
#endif

#ifdef TEST_FIRSTRUN
Expand Down

0 comments on commit 8cacb01

Please sign in to comment.