Skip to content

Commit

Permalink
real time simulation+
Browse files Browse the repository at this point in the history
  • Loading branch information
bsaxen committed Jan 4, 2012
1 parent 869fd09 commit cce8ad1
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 46 deletions.
8 changes: 4 additions & 4 deletions help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ Goto:
z goto last step
t step to next analogRead/digitalRead

Animation:
Animation(realtime time delay):
R loop forward
P loop backward
G step through scenario
+ Increase Animation Delay +10
- Decrease Animation Delay -10

Scenario breakpoints:
y View Scenario Breakpoints
Expand All @@ -28,7 +26,9 @@ Scenario breakpoints:
Window:
w toggles window layout mode.

Loop Information:
Information:
c show current configuration
d show scenario delay overview
l show loop information
------------------------------------
q quit Run Mode, enter Admin Mode.
Expand Down
23 changes: 10 additions & 13 deletions help_command.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
exit Exit Simuino

proj <name> Read project configuration
Do enter "load" to load project

load <steps> Load current project and
load <steps> Load current configuration and
create scenario of length <steps>
if no parameters, <steps> are as configured

list List available projects (max 10).
list List available configurations (max 10).
Selected is marked with '>'

<n> Select project according to number in list
<n> Select configuration according to number in list

run <steps> Step until step=<steps>
If no steps given - enter Run Mode
Expand All @@ -19,12 +16,12 @@ loop <loop> Step until loop <loop>

reset Reset simulation. Current step set to 0

save <name> Save current project as <name>
If no <name>, saved to current project
save <name> Save current configuration as <name>
If no <name>, saved to current configuration

del <name> Delete project. If no parameter,
current project will be deleted.
Default project cannot be deleted.
del <name> Delete configuration. If no parameter,
current configuration will be deleted.
Default configuration cannot be deleted.

add <...> Add pin-value-point in scenario
Ex. add a 3 100 650
Expand All @@ -44,8 +41,8 @@ info <area> Show info about <area>
- g++ Show compilation errors
- help Show command information

conf <par> <val> Edit project configuration with commands below:
conf Show current configuration
conf <par> <val> Edit configuration with commands below:
- win Set Window layout mode to <val> (0,1,2,3,4)
- sketch Set sketch source file
- delay Set delay to <val> (ms)
- sim <steps> Total steps in simulation
2 changes: 1 addition & 1 deletion settings.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Simuino Setting Wed Jan 4 10:49:05 2012
# Simuino Setting Wed Jan 4 11:07:37 2012
PROJECT: test_uno.conf
23 changes: 4 additions & 19 deletions simuino.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ int scenInterrupt = 0;
// Configuration default values
int confSteps = 1000;
int confWinMode = 2;
int confDelay = 100;
int confLogLev = 1;
int confLogFile = 0;
char confSketchFile[200];
Expand Down Expand Up @@ -504,10 +503,6 @@ void openCommand()
{
confSteps = atoi(command[2]);
}
if(strstr(command[1],"delay"))
{
confDelay = atoi(command[2]);
}
else if(strstr(command[1],"win"))
{
confWinMode = atoi(command[2]);
Expand Down Expand Up @@ -687,6 +682,10 @@ void runMode(int stop)
{
readMsg(currentConf);
}
else if (ch=='d')
{
readMsg(fileServTime);
}
else if(ch=='y' ) // scenario
{
readMsg(fileServScen);
Expand Down Expand Up @@ -836,20 +835,6 @@ void runMode(int stop)
else
putMsg(2,"Next step is not a Read event");
}
else if (ch=='+')
{
confDelay = confDelay + 10;
if(confDelay > 1000)confDelay = 1000;
sprintf(temp,"Animation Delay: %d",confDelay);
putMsg(4,temp);
}
else if (ch=='-')
{
confDelay = confDelay - 10;
if(confDelay < 0)confDelay = 0;
sprintf(temp,"Animation Delay: %d",confDelay);
putMsg(4,temp);
}
else
{
sprintf(temp,"Unknown command: %c",ch);
Expand Down
9 changes: 0 additions & 9 deletions simuino_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,6 @@ void saveConfig(char *cf)
fprintf(out,"WIN_LAYOUT %d\n",confWinMode);
else
confWinMode = 0;
if(confDelay >=0 && confDelay < 1000)
fprintf(out,"DELAY %d\n",confDelay);
else
confDelay = 50;

fprintf(out,"SKETCH %s\n",confSketchFile);
}
Expand Down Expand Up @@ -544,7 +540,6 @@ void readConfig(char *cf)
showError("No config file",-1);
confSteps = 444;
confWinMode = 2;
confDelay = 100;
strcpy(confSketchFile,"helloWorld_UNO.c");
return;
}
Expand All @@ -562,10 +557,6 @@ void readConfig(char *cf)
{
sscanf(p,"%s%d",temp,&confWinMode);
}
if(p=strstr(row,"DELAY"))
{
sscanf(p,"%s%d",temp,&confDelay);
}
if(p=strstr(row,"SKETCH"))
{
sscanf(p,"%s%s",temp,confSketchFile);
Expand Down

0 comments on commit cce8ad1

Please sign in to comment.