Skip to content

Commit

Permalink
Update log in case of upgrade needed because of study input update (#128
Browse files Browse the repository at this point in the history
)
  • Loading branch information
jmkerloch authored Jan 26, 2021
1 parent 747969a commit 708ada0
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
26 changes: 14 additions & 12 deletions src/libs/antares/study/load.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,18 +138,20 @@ namespace Data
parameters.timeSeriesToRefresh = 0;

// We can not run the simulation if the study folder is not in the latest
// version and that we would like to re-importe the generated timeseries
if (usedByTheSolver)
{
// We have time-series to import
if (parameters.timeSeriesToImport and (uint)header.version != (uint)versionLatest)
{
logs.error() << "The study must be upgraded to store the generated timeseries into the input folder";
gotFatalError = true;
// it is useless to continue at this point
return false;
}
}
// version and that we would like to re-importe the generated timeseries
if (usedByTheSolver)
{
// We have time-series to import
if (parameters.timeSeriesToImport
and (uint) header.version != (uint)versionLatest)
{
logs.error() << "Stochastic TS stored in input : study must be upgraded to "
<< Data::VersionToCStr((Data::Version)Data::versionLatest);
gotFatalError = true;
// it is useless to continue at this point
return false;
}
}


// This settings can only be enabled from the solver
Expand Down
2 changes: 1 addition & 1 deletion src/libs/antares/study/version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ using namespace Yuni;
// Checking version between CMakeLists.txt and Antares'versions
enum
{
versionFromCMake = (ANTARES_VERSION_HI * 100 + ANTARES_VERSION_LO * 10),
versionFromCMake = (ANTARES_VERSION_HI * 100 + ANTARES_VERSION_LO * 10 + ANTARES_VERSION_BUILD),
};

YUNI_STATIC_ASSERT((uint) versionFromCMake == (uint) Antares::Data::versionLatest,
Expand Down
3 changes: 0 additions & 3 deletions src/libs/antares/study/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,6 @@ namespace Data
versionLatest = version800,
};




/*!
** \brief Try to determine the version of a study
** \ingroup study
Expand Down
2 changes: 1 addition & 1 deletion src/tests/data/free_data_sample/Desktop.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[.shellclassinfo]
iconfile = settings/resources/study.ico
iconindex = 0
infotip = Antares Study7.3: 000 Free Data Sample
infotip = Antares Study8.0: 000 Free Data Sample
5 changes: 3 additions & 2 deletions src/tests/data/free_data_sample/settings/generaldata.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ first.weekday = Monday
leapyear = false
year-by-year = false
derated = false
custom-ts-numbers = false
custom-scenario = false
user-playlist = false
thematic-trimming = false
geographic-trimming = false
Expand All @@ -32,7 +32,7 @@ refreshintervalsolar = 2
readonly = false

[input]
import =
import =

[output]
synthesis = false
Expand All @@ -52,6 +52,7 @@ include-strategicreserve = true
include-spinningreserve = true
include-primaryreserve = true
include-exportmps = false
include-exportstructure = false
include-unfeasible-problem-behavior = warning-dry

[other preferences]
Expand Down
4 changes: 2 additions & 2 deletions src/tests/data/free_data_sample/study.antares
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[antares]
version = 720
version = 800
caption = 000 Free Data Sample
created = 1525354818
lastsave = 1603355915
lastsave = 1611572616
author = Unknown

0 comments on commit 708ada0

Please sign in to comment.