Antares Simulator
Power System Simulator
output.h
1 /*
2  * Copyright 2007-2025, RTE (https://www.rte-france.com)
3  * See AUTHORS.txt
4  * SPDX-License-Identifier: MPL-2.0
5  * This file is part of Antares-Simulator,
6  * Adequacy and Performance assessment for interconnected energy networks.
7  *
8  * Antares_Simulator is free software: you can redistribute it and/or modify
9  * it under the terms of the Mozilla Public Licence 2.0 as published by
10  * the Mozilla Foundation, either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * Antares_Simulator is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * Mozilla Public Licence 2.0 for more details.
17  *
18  * You should have received a copy of the Mozilla Public Licence 2.0
19  * along with Antares_Simulator. If not, see <https://opensource.org/license/mpl-2-0/>.
20  */
21 #ifndef __ANTARES_LIBS_STUDY_OUTPUT_H__
22 #define __ANTARES_LIBS_STUDY_OUTPUT_H__
23 
24 #include <functional>
25 #include <map>
26 #include <memory>
27 
28 #include <yuni/yuni.h>
29 #include <yuni/core/string.h>
30 
31 #include "antares/study/study.h"
32 
33 namespace Antares::Data
34 {
35 
36 // TODO VP: remove with GUI
37 class Output final
38 {
39 public:
41  using Ptr = std::shared_ptr<Output>;
43  using List = std::list<Ptr>;
45  using Title = Yuni::CString<128, false>;
47  using Name = Yuni::CString<128, false>;
48 
50  using MapByTimestamp = std::map<int64_t, Ptr>;
52  using MapByTimestampDesc = std::map<int64_t, Ptr, std::greater<int64_t>>;
53 
54 public:
58  static void RetrieveListFromStudy(List& out, const Study& study);
59 
60 public:
62 
63 
66  explicit Output(const AnyString& folder);
68 
72  bool loadFromFolder(const AnyString& folder);
73 
75  bool valid() const;
76 
78  bool operator<(const Output& rhs) const;
79 
80 public:
84  int64_t timestamp;
86  Data::SimulationMode mode;
88  int menuID;
93 
99  YString path;
100 
101 }; // class Output
102 
103 } // namespace Antares::Data
104 
105 #include "output.hxx"
106 
107 #endif // __ANTARES_STUDY_LIBS_OUTPUT_H__
Definition: output.h:38
Yuni::CString< 128, false > Name
Name.
Definition: output.h:47
int viewMenuID
Tag for storing a wx menu id (from the menu output)
Definition: output.h:90
Data::SimulationMode mode
Mode (economy/adequacy/other)
Definition: output.h:86
Title title
Title to use for visual representation of the output.
Definition: output.h:95
std::map< int64_t, Ptr, std::greater< int64_t > > MapByTimestampDesc
Map of study output info, ordered by their timestamp (desc)
Definition: output.h:52
std::list< Ptr > List
List.
Definition: output.h:43
Yuni::CString< 128, false > Title
Title.
Definition: output.h:45
int64_t timestamp
Date/time when the simulation has been launched.
Definition: output.h:84
bool operator<(const Output &rhs) const
Operator <.
Definition: output.hxx:26
StudyVersion version
Version of the solver used for the simulation.
Definition: output.h:82
bool valid() const
Get if the output folder previously loaded is valid.
Definition: output.cpp:104
Output(const AnyString &folder)
Constructor, with an output folder.
Definition: output.cpp:94
bool loadFromFolder(const AnyString &folder)
Load data from an output folder.
Definition: output.cpp:110
std::shared_ptr< Output > Ptr
Smartptr.
Definition: output.h:41
Name name
Name.
Definition: output.h:97
int outputViewerID
Tag for storing a wx menu id (for the output viewer)
Definition: output.h:92
static void RetrieveListFromStudy(List &out, const Study &study)
Retrieve the list of all available outputs.
Definition: output.cpp:195
std::map< int64_t, Ptr > MapByTimestamp
Map of study output info, ordered by their timestamp.
Definition: output.h:50
YString path
Output folder.
Definition: output.h:99
int menuID
Tag for storing a wx menu id.
Definition: output.h:88
Version of a study.
Definition: version.h:36
Definition: study.h:57