public class CmdGeneration extends WriteCmds
Constructor and Description |
---|
CmdGeneration(java.lang.String cmdFileName,
java.lang.String logFileName,
java.net.URL iconPathURL)
Supportmethods of cmds-file-generation.
|
Modifier and Type | Method and Description |
---|---|
void |
checkAndLog(Command c)
The Method checkAndLog makes a syntax and semantic check of the generated animation commands.
|
void |
close()
close cmds- and log-file
|
java.lang.String |
createInternId(java.lang.String name)
create an internal Id based on name.
|
void |
experimentStart(Experiment exp,
double initSpeed)
sets begin and end time of experiment,
create cmds command "createSimTimeBounds" and
starts experiment
|
long |
getAnimationRunTime(TimeInstant t)
distance between actual simTime and initTime as UnixTimeStamp
|
long |
getAnimationTime(TimeInstant t)
get Unix TimeStamp of Time t, shown in viewer
|
long |
getAnimationTimeInit()
get Unix TimeStamp of animation begin
|
java.lang.String |
getCmdFileName() |
java.net.URL |
getCmdFileURL()
get CmdFileName as File-URL
|
java.net.URL |
getIconPathURL() |
TimeInstant |
getInitTime() |
java.lang.String |
getLogFileName() |
java.util.TimeZone |
getTimeZone() |
boolean |
isInitPhase()
say true when simulation isn't started
|
void |
setCheckAndLog()
Only when checkAndLog is set the Method CheckAndLog is active.
|
void |
setFlushSeq(int flushSeq)
sets the number of comands, when CommandFrame.writeCmdBuffer
is flushed in cmdFile.
|
void |
setStartStopTime(TimeInstant begin,
TimeInstant end,
java.util.TimeZone timezone)
Defines simulation start- and stop-time.
|
void |
setTimeZone(java.util.TimeZone timezone) |
void |
write(Command c)
write a command in CommandFrame.writeCmdBuffer.
|
public CmdGeneration(java.lang.String cmdFileName, java.lang.String logFileName, java.net.URL iconPathURL)
cmdFileName
- logFileName
- iconPathURL
- java.io.UnsupportedEncodingException
public void setStartStopTime(TimeInstant begin, TimeInstant end, java.util.TimeZone timezone)
begin
- Begin of simulationend
- End of simulationtimezone
- Timezone of simulation, UTC when nullpublic void close()
public java.lang.String getCmdFileName()
public java.lang.String getLogFileName()
public void setCheckAndLog()
public void setFlushSeq(int flushSeq)
flushSeq
- public java.net.URL getCmdFileURL()
public java.net.URL getIconPathURL()
public void write(Command c)
public void checkAndLog(Command c)
c
- Command to writepublic boolean isInitPhase()
public TimeInstant getInitTime()
public void experimentStart(Experiment exp, double initSpeed)
exp
- begin
- end
- timezone
- initSpeed
- public long getAnimationTimeInit()
public long getAnimationTime(TimeInstant t)
t
- TimeInstant, used in desmojpublic long getAnimationRunTime(TimeInstant t)
t
- SimTime distancepublic void setTimeZone(java.util.TimeZone timezone)
public java.util.TimeZone getTimeZone()
public java.lang.String createInternId(java.lang.String name)
name
-