Skip to content

Commit 86742e5

Browse files
author
benny.saxen
committed
new conf
1 parent de7a7e9 commit 86742e5

File tree

5 files changed

+52
-46
lines changed

5 files changed

+52
-46
lines changed

help.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ Window:
2727
w toggles window layout mode.
2828

2929
Information:
30-
c show current configuration
3130
d show scenario delay overview
3231
l show loop information
3332
s show debug sketch
33+
e show runtime error log
3434
------------------------------------
3535
q quit Run Mode, enter Admin Mode.
3636
h show this information

help_command.txt

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
exit Exit Simuino
22

3-
load <steps> Load current configuration and
4-
create scenario of length <steps>
5-
if no parameters, <steps> are as configured
3+
load Load selected sketch
64

7-
list List available configurations (max 10).
5+
list List available sketches (max 100).
86
Selected is marked with '>'
97

10-
<n> Select configuration according to number in list
8+
<n> Select sketch according to number in list
119

1210
run <steps> Step until step=<steps>
1311
If no steps given - enter Run Mode
@@ -16,33 +14,24 @@ loop <loop> Step until loop <loop>
1614

1715
reset Reset simulation. Current step set to 0
1816

19-
save <name> Save current configuration as <name>
20-
If no <name>, saved to current configuration
21-
22-
del <name> Delete configuration. If no parameter,
23-
current configuration will be deleted.
24-
Default configuration cannot be deleted.
25-
2617
add <...> Add pin-value-point in scenario
2718
Ex. add a 3 100 650
2819
Analog Pin 3 will read values 650
2920
from step 100 and forward.
3021

31-
rem <...> Remove pin-value-point in scenario
22+
rem <...> Remove pin-value-point in scenario
3223
Ex. rem d 7 50
3324
Digital Pin 7 will no longer read values
3425
specified at step 50
3526

36-
info <area> Show info about <area>
27+
info <par> Show info about <par>
3728
- scen Show scenario data
3829
- conf Display configuration
3930
- loop Show loop information
4031
- error Show Servuino errors
4132
- g++ Show compilation errors
4233
- help Show command information
4334

44-
conf Show current configuration
45-
conf <par> <val> Edit configuration with commands below:
46-
- win Set Window layout mode to <val> (0,1,2,3,4)
47-
- sketch Set sketch source file
48-
- sim <steps> Total steps in simulation
35+
sketch Show current sketch
36+
37+
help Show this information

settings.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# Simuino Setting Sun Oct 27 22:11:49 2013
1+
# Simuino Setting Mon Oct 28 21:23:20 2013
22
SKETCH: helloWorld_UNO.ino

simuino.c

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ int x_pinRW[MAX_TOTAL_PINS][SCEN_MAX];
5959
#define WIN_MODES 5
6060

6161
// Sketch Status
62-
#define SO_VOID 1
63-
#define SO_SELECTED 2
64-
#define SO_LOADED 3
65-
#define SO_ERROR 4
66-
62+
#define SO_VOID 1
63+
#define SO_SELECTED 2
64+
#define SO_LOADED 3
65+
#define SO_COMP_ERROR 4
66+
#define SO_RUN_ERROR 5
6767

6868
// Current data
6969
int currentStep = 0;
@@ -332,7 +332,9 @@ void loadCurrentSketch()
332332
unoInfo();
333333
sprintf(temp,"Sketch load ready: %s",confSketchFile);
334334
putMsg(msg_h-2,temp);
335+
g_currentSketchStatus = SO_LOADED;
335336
}
337+
if(res != 0)g_currentSketchStatus = SO_COMP_ERROR;
336338
}
337339

338340
//====================================
@@ -506,7 +508,7 @@ void openCommand()
506508
strcpy(currentConf,command[1]);
507509
strcat(currentConf,".ino");
508510
readConfig(currentConf);
509-
g_warning = S_YES;
511+
g_warning = S_YES;
510512
unoInfo();
511513
}
512514
readMsg(currentConf);
@@ -638,6 +640,7 @@ void openCommand()
638640
selectProj(projNo,g_currentSketch);
639641
readConfig(g_currentSketch);
640642
g_warning = S_YES;
643+
g_currentSketchStatus = SO_SELECTED;
641644
setRange(confBoardType);
642645
init(confWinMode);
643646
unoInfo();
@@ -721,23 +724,27 @@ void runMode(int stop)
721724
return;
722725
}
723726

724-
if (ch=='h')
725-
{
727+
if (ch=='h')
728+
{
726729
readMsg(fileInfoRun);
727-
}
728-
else if (ch=='c')
729-
{
730+
}
731+
else if (ch=='c')
732+
{
730733
readMsg(currentConf);
731-
}
732-
else if (ch=='d')
733-
{
734+
}
735+
else if (ch=='e')
736+
{
737+
readMsg(fileServError);
738+
}
739+
else if (ch=='d')
740+
{
734741
readMsg(fileServTime);
735-
}
736-
else if(ch=='y' ) // scenario
742+
}
743+
else if(ch=='y' ) // scenario
737744
{
738745
readMsg(fileServScen);
739746
}
740-
else if (ch=='x')
747+
else if (ch=='x')
741748
{
742749
readMsg(fileServScenario);
743750
}

simuino_lib.c

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,11 @@ void show(WINDOW *win)
9494
wmove(win,1,2);
9595
wprintw(uno,"Selected Sketch: %s ",g_currentSketch);
9696
wmove(win,2,2);
97-
if(g_currentSketchStatus == SO_VOID)wprintw(uno,"Status.........: -");
98-
if(g_currentSketchStatus == SO_SELECTED)wprintw(uno,"Status.........: selected");
99-
if(g_currentSketchStatus == SO_LOADED)wprintw(uno,"Status.........: loaded");
100-
if(g_currentSketchStatus == SO_ERROR)wprintw(uno,"Status.........: error");
97+
if(g_currentSketchStatus == SO_VOID) wprintw(uno,"Status.........: -");
98+
if(g_currentSketchStatus == SO_SELECTED) wprintw(uno,"Status.........: selected");
99+
if(g_currentSketchStatus == SO_LOADED) wprintw(uno,"Status.........: loaded");
100+
if(g_currentSketchStatus == SO_RUN_ERROR) wprintw(uno,"Status.........: runtime error");
101+
if(g_currentSketchStatus == SO_COMP_ERROR)wprintw(uno,"Status.........: compile error");
101102
}
102103
if(win == ser)
103104
{
@@ -298,9 +299,14 @@ void unoInfo()
298299
wmove(uno,ap+2,3);
299300

300301
if(g_existError == S_YES)
301-
wprintw(uno," [Errors - err] ");
302+
{
303+
wprintw(uno," [More details - type: err (or r in run-mode)]");
304+
}
302305
else if(g_warning == S_YES)
303-
wprintw(uno," [Possible Mismatch - load]");
306+
{
307+
wprintw(uno," [Load status unknown - load]");
308+
// g_currentSketchStatus = SO_SELECTED;
309+
}
304310
else
305311
wprintw(uno," ");
306312

@@ -1502,7 +1508,11 @@ void anyErrors()
15021508
sprintf(syscom,"cat %s %s %s> %s",fileError,fileServError,fileCopyError,fileTemp);
15031509
x = system(syscom);
15041510
x = countRowsInFile(fileTemp);
1505-
if(x > 0 && x != 999)g_existError = S_YES;
1511+
if(x > 0 && x != 999)
1512+
{
1513+
g_existError = S_YES;
1514+
g_currentSketchStatus = SO_RUN_ERROR;
1515+
}
15061516
if(x == 999)putMsg(2,"Unable to read error file");
15071517
show(uno);
15081518
}
@@ -1532,7 +1542,7 @@ int loadSketch(char sketch[])
15321542
wprintw(msg,"press any key to continue >>");
15331543
wrefresh(msg);
15341544
ch = getchar();
1535-
putMsg(2,"Check your sketch or report an Issue to Simuino");
1545+
putMsg(2,"Check your sketch or report an issue to Simuino");
15361546
return(1);
15371547
}
15381548
readSketchInfo();

0 commit comments

Comments
 (0)