@@ -159,6 +159,12 @@ export const ExportFmu: CommandModule<{}, ExportFmuArgs> = {
159159 const simulator = new ModelicaSimulator ( dae ) ;
160160 simulator . prepare ( ) ;
161161
162+ // Extract experiment annotation from the DAE as fallback for CLI flags
163+ const exp = dae . experiment ;
164+ const startTime = args . startTime ?? args [ "start-time" ] ?? exp . startTime ;
165+ const stopTime = args . stopTime ?? args [ "stop-time" ] ?? exp . stopTime ;
166+ const stepSize = args . stepSize ?? args [ "step-size" ] ?? exp . interval ;
167+
162168 // FMU type flags
163169 const fmuType = {
164170 modelExchange : args . type === "me" || args . type === "both" ,
@@ -175,9 +181,9 @@ export const ExportFmu: CommandModule<{}, ExportFmuArgs> = {
175181 modelIdentifier,
176182 description : args . description ,
177183 generationTool : "ModelScript CLI" ,
178- startTime : args . startTime ?? args [ "start-time" ] ,
179- stopTime : args . stopTime ?? args [ "stop-time" ] ,
180- stepSize : args . stepSize ?? args [ "step-size" ] ,
184+ startTime,
185+ stopTime,
186+ stepSize,
181187 fmuType,
182188 } ,
183189 simulator . stateVars ,
@@ -197,9 +203,9 @@ export const ExportFmu: CommandModule<{}, ExportFmuArgs> = {
197203 modelIdentifier,
198204 description : args . description ,
199205 generationTool : "ModelScript CLI" ,
200- startTime : args . startTime ?? args [ "start-time" ] ,
201- stopTime : args . stopTime ?? args [ "stop-time" ] ,
202- stepSize : args . stepSize ?? args [ "step-size" ] ,
206+ startTime,
207+ stopTime,
208+ stepSize,
203209 fmuType,
204210 includeSources : args . source !== false ,
205211 includeModelJson : true ,
0 commit comments