|
40 | 40 | #define SIMULATIONDIALOG_H |
41 | 41 |
|
42 | 42 | #include "MainWindow.h" |
| 43 | +#include "SimulationOptions.h" |
43 | 44 |
|
44 | 45 | class SimulationOutputWidget; |
45 | 46 |
|
46 | | -class SimulationOptions |
47 | | -{ |
48 | | -public: |
49 | | - SimulationOptions() |
50 | | - { |
51 | | - setClassName(""); |
52 | | - setStartTime(""); |
53 | | - setStopTime(""); |
54 | | - setMethod(""); |
55 | | - setTolerance(""); |
56 | | - setDasslJacobian(""); |
57 | | - setDasslRootFinding(true); |
58 | | - setDasslRestart(true); |
59 | | - setDasslInitialStepSize(""); |
60 | | - setDasslMaxStepSize(""); |
61 | | - setDasslMaxIntegration(5); |
62 | | - setCflags(""); |
63 | | - setNumberOfProcessors(1); |
64 | | - setBuildOnly(false); |
65 | | - setLaunchTransformationalDebugger(false); |
66 | | - setLaunchAlgorithmicDebugger(false); |
67 | | - setNumberofIntervals(500); |
68 | | - setOutputFormat("mat"); |
69 | | - setFileNamePrefix(""); |
70 | | - setVariableFilter(""); |
71 | | - setProtectedVariables(false); |
72 | | - setEquidistantTimeGrid(true); |
73 | | - setStoreVariablesAtEvents(true); |
74 | | - setShowGeneratedFiles(false); |
75 | | - setModelSetupFile(""); |
76 | | - setInitializationMethod(""); |
77 | | - setOptimizationMethod(""); |
78 | | - setEquationSystemInitializationFile(""); |
79 | | - setEquationSystemInitializationTime(""); |
80 | | - setClock(""); |
81 | | - setLinearSolver(""); |
82 | | - setNonLinearSolver(""); |
83 | | - setLinearizationTime(""); |
84 | | - setOutputVariables(""); |
85 | | - setProfiling("none"); |
86 | | - setCPUTime(false); |
87 | | - setEnableAllWarnings(true); |
88 | | - setLogDasslSolver(false); |
89 | | - setLogDebug(false); |
90 | | - setLogDynamicStateSelection(false); |
91 | | - setLogJacobianDynamicStateSelection(false); |
92 | | - setLogEvents(false); |
93 | | - setLogVerboseEvents(false); |
94 | | - setLogInitialization(false); |
95 | | - setLogJacobian(false); |
96 | | - setLogNonLinearSystems(false); |
97 | | - setLogVerboseNonLinearSystems(false); |
98 | | - setLogJacobianNonLinearSystems(false); |
99 | | - setLogResidualsInitialization(false); |
100 | | - setLogSimulation(false); |
101 | | - setLogSolver(false); |
102 | | - setLogFinalSolutionOfInitialization(false); |
103 | | - setLogStats(true); |
104 | | - setLogUtil(false); |
105 | | - setLogZeroCrossings(false); |
106 | | - setAdditionalSimulationFlags(""); |
107 | | - setIsValid(false); |
108 | | - setReSimulate(false); |
109 | | - mWorkingDirectory = ""; |
110 | | - } |
111 | | - |
112 | | - operator QVariant() const |
113 | | - { |
114 | | - return QVariant::fromValue(*this); |
115 | | - } |
116 | | - |
117 | | - void setClassName(QString className) {mClassName = className;} |
118 | | - QString getClassName() {return mClassName;} |
119 | | - void setStartTime(QString startTime) {mStartTime = startTime;} |
120 | | - QString getStartTime() {return mStartTime;} |
121 | | - void setStopTime(QString stopTime) {mStopTime = stopTime;} |
122 | | - QString getStopTime() {return mStopTime;} |
123 | | - void setMethod(QString method) {mMethod = method;} |
124 | | - QString getMethod() {return mMethod;} |
125 | | - void setTolerance(QString tolerance) {mTolerance = tolerance;} |
126 | | - QString getTolerance() {return mTolerance;} |
127 | | - void setDasslJacobian(QString dasslJacobian) {mDasslJacobian = dasslJacobian;} |
128 | | - QString getDasslJacobian() {return mDasslJacobian;} |
129 | | - void setDasslRootFinding(bool dasslRootFinding) {mDasslRootFinding = dasslRootFinding;} |
130 | | - bool getDasslRootFinding() {return mDasslRootFinding;} |
131 | | - void setDasslRestart(bool dasslRestart) {mDasslRestart = dasslRestart;} |
132 | | - bool getDasslRestart() {return mDasslRestart;} |
133 | | - void setDasslInitialStepSize(QString dasslInitialStepSize) {mDasslInitialStepSize = dasslInitialStepSize;} |
134 | | - QString getDasslInitialStepSize() {return mDasslInitialStepSize;} |
135 | | - void setDasslMaxStepSize(QString dasslMaxStepSize) {mDasslMaxStepSize = dasslMaxStepSize;} |
136 | | - QString getDasslMaxStepSize() {return mDasslMaxStepSize;} |
137 | | - void setDasslMaxIntegration(int dasslMaxIntegration) {mDasslMaxIntegration = dasslMaxIntegration;} |
138 | | - int getDasslMaxIntegration() {return mDasslMaxIntegration;} |
139 | | - void setCflags(QString cflags) {mCflags = cflags;} |
140 | | - QString getCflags() {return mCflags;} |
141 | | - void setNumberOfProcessors(int numberOfProcessors) {mNumberOfProcessors = numberOfProcessors;} |
142 | | - int getNumberOfProcessors() {return mNumberOfProcessors;} |
143 | | - void setBuildOnly(bool buildOnly) {mBuildOnly = buildOnly;} |
144 | | - bool getBuildOnly() {return mBuildOnly;} |
145 | | - void setLaunchTransformationalDebugger(bool launchTransformationalDebugger) {mLaunchTransformationalDebugger = launchTransformationalDebugger;} |
146 | | - bool getLaunchTransformationalDebugger() {return mLaunchTransformationalDebugger;} |
147 | | - void setLaunchAlgorithmicDebugger(bool launchAlgorithmicDebugger) {mLaunchAlgorithmicDebugger = launchAlgorithmicDebugger;} |
148 | | - bool getLaunchAlgorithmicDebugger() {return mLaunchAlgorithmicDebugger;} |
149 | | - void setNumberofIntervals(int numberofIntervals) {mNumberofIntervals = numberofIntervals;} |
150 | | - void setOutputFormat(QString outputFormat) {mOutputFormat = outputFormat;} |
151 | | - QString getOutputFormat() {return mOutputFormat;} |
152 | | - void setFileNamePrefix(QString fileNamePrefix) {mFileNamePrefix = fileNamePrefix;} |
153 | | - QString getFileNamePrefix() {return mFileNamePrefix;} |
154 | | - QString getOutputFileName() const {return mFileNamePrefix.isEmpty() ? mClassName : mFileNamePrefix;} |
155 | | - QString getResultFileName() {return getOutputFileName() + "_res." + mOutputFormat;} |
156 | | - void setVariableFilter(QString variableFilter) {mVariableFilter = variableFilter;} |
157 | | - QString getVariableFilter() {return mVariableFilter.isEmpty() ? ".*" : mVariableFilter;} |
158 | | - void setProtectedVariables(bool protectedVariables) {mProtectedVariables = protectedVariables;} |
159 | | - bool getProtectedVariables() {return mProtectedVariables;} |
160 | | - void setEquidistantTimeGrid(bool equidistantTimeGrid) {mEquidistantTimeGrid = equidistantTimeGrid;} |
161 | | - bool getEquidistantTimeGrid() {return mEquidistantTimeGrid;} |
162 | | - void setStoreVariablesAtEvents(bool storeVariablesAtEvents) {mStoreVariablesAtEvents = storeVariablesAtEvents;} |
163 | | - bool getStoreVariablesAtEvents() {return mStoreVariablesAtEvents;} |
164 | | - void setShowGeneratedFiles(bool showGeneratedFiles) {mShowGeneratedFiles = showGeneratedFiles;} |
165 | | - bool getShowGeneratedFiles() {return mShowGeneratedFiles;} |
166 | | - void setModelSetupFile(QString modelSetupFile) {mModelSetupFile = modelSetupFile;} |
167 | | - QString getModelSetupFile() {return mModelSetupFile;} |
168 | | - void setInitializationMethod(QString initializationMethod) {mInitializationMethod = initializationMethod;} |
169 | | - QString getInitializationMethod() {return mInitializationMethod;} |
170 | | - void setOptimizationMethod(QString optimizationMethod) {mOptimizationMethod = optimizationMethod;} |
171 | | - QString getOptimizationMethod() {return mOptimizationMethod;} |
172 | | - void setEquationSystemInitializationFile(QString equationSystemInitializationFile) {mEquationSystemInitializationFile = equationSystemInitializationFile;} |
173 | | - QString getEquationSystemInitializationFile() {return mEquationSystemInitializationFile;} |
174 | | - void setEquationSystemInitializationTime(QString equationSystemInitializationTime) {mEquationSystemInitializationTime = equationSystemInitializationTime;} |
175 | | - QString getEquationSystemInitializationTime() {return mEquationSystemInitializationTime;} |
176 | | - void setClock(QString clock) {mClock = clock;} |
177 | | - QString getClock() {return mClock;} |
178 | | - void setLinearSolver(QString linearSolver) {mLinearSolver = linearSolver;} |
179 | | - QString getLinearSolver() {return mLinearSolver;} |
180 | | - void setNonLinearSolver(QString nonLinearSolver) {mNonLinearSolver = nonLinearSolver;} |
181 | | - QString getNonLinearSolver() {return mNonLinearSolver;} |
182 | | - void setLinearizationTime(QString linearizationTime) {mLinearizationTime = linearizationTime;} |
183 | | - QString getLinearizationTime() {return mLinearizationTime;} |
184 | | - void setOutputVariables(QString outputVariables) {mOutputVariables = outputVariables;} |
185 | | - QString getOutputVariables() {return mOutputVariables;} |
186 | | - void setProfiling(QString profiling) {mProfiling = profiling;} |
187 | | - QString getProfiling() {return mProfiling;} |
188 | | - void setCPUTime(bool cpuTime) {mCPUTime = cpuTime;} |
189 | | - bool getCPUTime() {return mCPUTime;} |
190 | | - void setEnableAllWarnings(bool enableAllWarnings) {mEnableAllWarnings = enableAllWarnings;} |
191 | | - bool getEnableAllWarnings() {return mEnableAllWarnings;} |
192 | | - void setLogDasslSolver(bool logDasslSolver) {mLogDasslSolver = logDasslSolver;} |
193 | | - bool getLogDasslSolver() {return mLogDasslSolver;} |
194 | | - void setLogDebug(bool logDebug) {mLogDebug = logDebug;} |
195 | | - bool getLogDebug() {return mLogDebug;} |
196 | | - void setLogDynamicStateSelection(bool logDynamicStateSelection) {mLogDynamicStateSelection = logDynamicStateSelection;} |
197 | | - bool getLogDynamicStateSelection() {return mLogDynamicStateSelection;} |
198 | | - void setLogJacobianDynamicStateSelection(bool logJacobianDynamicStateSelection) {mLogJacobianDynamicStateSelection = logJacobianDynamicStateSelection;} |
199 | | - bool getLogJacobianDynamicStateSelection() {return mLogJacobianDynamicStateSelection;} |
200 | | - void setLogEvents(bool logEvents) {mLogEvents = logEvents;} |
201 | | - bool getLogEvents() {return mLogEvents;} |
202 | | - void setLogVerboseEvents(bool logVerboseEvents) {mLogVerboseEvents = logVerboseEvents;} |
203 | | - bool getLogVerboseEvents() {return mLogVerboseEvents;} |
204 | | - void setLogInitialization(bool logInitialization) {mLogInitialization = logInitialization;} |
205 | | - bool getLogInitialization() {return mLogInitialization;} |
206 | | - void setLogJacobian(bool logJacobian) {mLogJacobian = logJacobian;} |
207 | | - bool getLogJacobian() {return mLogJacobian;} |
208 | | - void setLogNonLinearSystems(bool logNonLinearSystems) {mLogNonLinearSystems = logNonLinearSystems;} |
209 | | - bool getLogNonLinearSystems() {return mLogNonLinearSystems;} |
210 | | - void setLogVerboseNonLinearSystems(bool logVerboseNonLinearSystems) {mLogVerboseNonLinearSystems = logVerboseNonLinearSystems;} |
211 | | - bool getLogVerboseNonLinearSystems() {return mLogVerboseNonLinearSystems;} |
212 | | - void setLogJacobianNonLinearSystems(bool logJacobianNonLinearSystems) {mLogJacobianNonLinearSystems = logJacobianNonLinearSystems;} |
213 | | - bool getLogJacobianNonLinearSystems() {return mLogJacobianNonLinearSystems;} |
214 | | - void setLogResidualsInitialization(bool logResidualsInitialization) {mLogResidualsInitialization = logResidualsInitialization;} |
215 | | - bool getLogResidualsInitialization() {return mLogResidualsInitialization;} |
216 | | - void setLogSimulation(bool logSimulation) {mLogSimulation = logSimulation;} |
217 | | - bool getLogSimulation() {return mLogSimulation;} |
218 | | - void setLogSolver(bool logSolver) {mLogSolver = logSolver;} |
219 | | - bool getLogSolver() {return mLogSolver;} |
220 | | - void setLogFinalSolutionOfInitialization(bool logFinalSolutionOfInitialization) {mLogFinalSolutionOfInitialization = logFinalSolutionOfInitialization;} |
221 | | - bool getLogFinalSolutionOfInitialization() {return mLogFinalSolutionOfInitialization;} |
222 | | - void setLogStats(bool logStats) {mLogStats = logStats;} |
223 | | - bool getLogStats() {return mLogStats;} |
224 | | - void setLogUtil(bool logUtil) {mLogUtil = logUtil;} |
225 | | - bool getLogUtil() {return mLogUtil;} |
226 | | - void setLogZeroCrossings(bool logZeroCrossings) {mLogZeroCrossings = logZeroCrossings;} |
227 | | - bool getLogZeroCrossings() {return mLogZeroCrossings;} |
228 | | - void setAdditionalSimulationFlags(QString additionalSimulationFlags) {mAdditionalSimulationFlags = additionalSimulationFlags;} |
229 | | - QString getAdditionalSimulationFlags() {return mAdditionalSimulationFlags;} |
230 | | - |
231 | | - void setSimulationFlags(QStringList simulationFlags) {mSimulationFlags = simulationFlags;} |
232 | | - QStringList getSimulationFlags() {return mSimulationFlags;} |
233 | | - void setIsValid(bool isValid) {mValid = isValid;} |
234 | | - bool isValid() {return mValid;} |
235 | | - void setReSimulate(bool reSimulate) {mReSimulate = reSimulate;} |
236 | | - bool isReSimulate() {return mReSimulate;} |
237 | | - void setWorkingDirectory(QString workingDirectory) {mWorkingDirectory = workingDirectory;} |
238 | | - QString getWorkingDirectory() const {return mWorkingDirectory;} |
239 | | -private: |
240 | | - QString mClassName; |
241 | | - QString mStartTime; |
242 | | - QString mStopTime; |
243 | | - QString mMethod; |
244 | | - QString mTolerance; |
245 | | - QString mDasslJacobian; |
246 | | - bool mDasslRootFinding; |
247 | | - bool mDasslRestart; |
248 | | - QString mDasslInitialStepSize; |
249 | | - QString mDasslMaxStepSize; |
250 | | - int mDasslMaxIntegration; |
251 | | - QString mCflags; |
252 | | - int mNumberOfProcessors; |
253 | | - bool mBuildOnly; |
254 | | - bool mLaunchTransformationalDebugger; |
255 | | - bool mLaunchAlgorithmicDebugger; |
256 | | - int mNumberofIntervals; |
257 | | - QString mOutputFormat; |
258 | | - QString mFileNamePrefix; |
259 | | - QString mVariableFilter; |
260 | | - bool mProtectedVariables; |
261 | | - bool mEquidistantTimeGrid; |
262 | | - bool mStoreVariablesAtEvents; |
263 | | - bool mShowGeneratedFiles; |
264 | | - QString mModelSetupFile; |
265 | | - QString mInitializationMethod; |
266 | | - QString mOptimizationMethod; |
267 | | - QString mEquationSystemInitializationFile; |
268 | | - QString mEquationSystemInitializationTime; |
269 | | - QString mClock; |
270 | | - QString mLinearSolver; |
271 | | - QString mNonLinearSolver; |
272 | | - QString mLinearizationTime; |
273 | | - QString mOutputVariables; |
274 | | - QString mProfiling; |
275 | | - bool mCPUTime; |
276 | | - bool mEnableAllWarnings; |
277 | | - bool mLogDasslSolver; |
278 | | - bool mLogDebug; |
279 | | - bool mLogDynamicStateSelection; |
280 | | - bool mLogJacobianDynamicStateSelection; |
281 | | - bool mLogEvents; |
282 | | - bool mLogVerboseEvents; |
283 | | - bool mLogInitialization; |
284 | | - bool mLogJacobian; |
285 | | - bool mLogNonLinearSystems; |
286 | | - bool mLogVerboseNonLinearSystems; |
287 | | - bool mLogJacobianNonLinearSystems; |
288 | | - bool mLogResidualsInitialization; |
289 | | - bool mLogSimulation; |
290 | | - bool mLogSolver; |
291 | | - bool mLogFinalSolutionOfInitialization; |
292 | | - bool mLogStats; |
293 | | - bool mLogUtil; |
294 | | - bool mLogZeroCrossings; |
295 | | - QString mAdditionalSimulationFlags; |
296 | | - |
297 | | - QStringList mSimulationFlags; |
298 | | - bool mValid; |
299 | | - bool mReSimulate; |
300 | | - QString mWorkingDirectory; |
301 | | -}; |
302 | | -Q_DECLARE_METATYPE(SimulationOptions) |
303 | | - |
304 | 47 | class ArchivedSimulationItem : public QListWidgetItem |
305 | 48 | { |
306 | 49 | public: |
@@ -444,6 +187,8 @@ class SimulationDialog : public QDialog |
444 | 187 | void saveSimulationOptions(); |
445 | 188 | public: |
446 | 189 | void reSimulate(SimulationOptions simulationOptions); |
| 190 | + void showAlgorithmicDebugger(SimulationOptions simulationOptions); |
| 191 | + void simulationProcessFinished(SimulationOptions simulationOptions, QDateTime resultFileLastModifiedDateTime); |
447 | 192 | public slots: |
448 | 193 | void enableDasslOptions(QString method); |
449 | 194 | void showIntegrationHelp(); |
|
0 commit comments