[Dfsm-devel] dFSM/src/test test1.cpp,1.19,1.20 test1.ini,1.2,1.3 test2.cpp,1.12,1.13 test3.cpp,1.9,1
Status: Beta
Brought to you by:
amoreno
|
From: Andreu M. <am...@us...> - 2004-04-03 06:44:18
|
Update of /cvsroot/dfsm/dFSM/src/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1816/src/test Modified Files: test1.cpp test1.ini test2.cpp test3.cpp test4.ini test4_1.cpp test4_2.cpp test5.cpp Log Message: Add support for manual and automatic state machine identification Index: test1.ini =================================================================== RCS file: /cvsroot/dfsm/dFSM/src/test/test1.ini,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test1.ini 24 Dec 2003 05:36:52 -0000 1.2 --- test1.ini 3 Apr 2004 06:32:01 -0000 1.3 *************** *** 1,4 **** [Automata 1] #Comentari ! command = ./test1 -d 3 -l 3 #Comentari delay = 2 syncevent = 10 --- 1,4 ---- [Automata 1] #Comentari ! command = ./test1 -i 1 -d 3 -l 3 #Comentari delay = 2 syncevent = 10 *************** *** 10,14 **** [Automata 2] #Comentari ! command = ./test1 -d 3 -l 3 #Comentari delay = 2 syncevent = 10 --- 10,14 ---- [Automata 2] #Comentari ! command = ./test1 -i 2 -d 3 -l 3 #Comentari delay = 2 syncevent = 10 Index: test4_2.cpp =================================================================== RCS file: /cvsroot/dfsm/dFSM/src/test/test4_2.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** test4_2.cpp 29 Aug 2003 22:22:28 -0000 1.9 --- test4_2.cpp 3 Apr 2004 06:32:01 -0000 1.10 *************** *** 26,29 **** --- 26,32 ---- * $Revision$ * $Log$ + * Revision 1.10 2004/04/03 06:32:01 amoreno + * Add support for manual and automatic state machine identification + * * Revision 1.9 2003/08/29 22:22:28 amoreno * Solved bug with more that 8 machines, add Test5 to create a automate chain and some includes staff *************** *** 51,54 **** --- 54,59 ---- #include "libdfsm/ttransition.h" + #define TEST4_2_MACHINE_ID 2 + #define S1_MSG "State_S1 data" #define S2_MSG "State_S2 data" *************** *** 288,291 **** --- 293,297 ---- cout << " -l : Internal log level of dFSM" << endl; cout << " -d : log level of user states" << endl; + cout << " -i : Machine identification" << endl; cout << endl; } *************** *** 294,298 **** int main (int argc, char* argv[]) { ! int i=0, l=0, d=0; tFSM *fsm; tState *s0, *s1, *s2, *s3, *s4, *s5, *s6, *s7, *s8, *s9; // State pointers. One for each state. --- 300,304 ---- int main (int argc, char* argv[]) { ! int i=0, l=0, d=0, ident=TEST4_2_MACHINE_ID; tFSM *fsm; tState *s0, *s1, *s2, *s3, *s4, *s5, *s6, *s7, *s8, *s9; // State pointers. One for each state. *************** *** 328,331 **** --- 334,344 ---- } + if (argv[i][1] == 'i') + { + sscanf(argv[i+1], "%d", &ident); + i++; + continue; + } + cerr << "Bad parameter: " << argv[i][1] << endl; return -1; *************** *** 334,338 **** ! fsm = new tFSM("Test machine 4_2", l); // We need one tFSM object for each FSM :) LOGINIT; --- 347,351 ---- ! fsm = new tFSM(ident, "Test machine 4_2", l); // We need one tFSM object for each FSM :) LOGINIT; *************** *** 480,482 **** // is invoked state execution does not begin. } - --- 493,494 ---- Index: test4.ini =================================================================== RCS file: /cvsroot/dfsm/dFSM/src/test/test4.ini,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test4.ini 6 Dec 2003 06:04:14 -0000 1.1 --- test4.ini 3 Apr 2004 06:32:01 -0000 1.2 *************** *** 1,6 **** [Automata 1] #Comentari ! command = ./test4_1 -d 3 -l 3 #Comentari delay = 2 [Automata 2] ! command = ./test4_2 -d 3 -l 3 #Comentari delay = 2 --- 1,6 ---- [Automata 1] #Comentari ! command = ./test4_1 -i 1 -d 3 -l 3 #Comentari delay = 2 [Automata 2] ! command = ./test4_2 -i 2 -d 3 -l 3 #Comentari delay = 2 Index: test2.cpp =================================================================== RCS file: /cvsroot/dfsm/dFSM/src/test/test2.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** test2.cpp 26 Dec 2003 07:13:05 -0000 1.12 --- test2.cpp 3 Apr 2004 06:32:01 -0000 1.13 *************** *** 24,27 **** --- 24,30 ---- * $Revision$ * $Log$ + * Revision 1.13 2004/04/03 06:32:01 amoreno + * Add support for manual and automatic state machine identification + * * Revision 1.12 2003/12/26 07:13:05 amoreno * Add clear history command *************** *** 60,63 **** --- 63,68 ---- #include "libdfsm/ttransition.h" + #define TEST2_MACHINE_ID 1 + struct tState_ROOT :public tState { void entry_func() *************** *** 272,275 **** --- 277,281 ---- cout << " -l : Internal log level of dFSM" << endl; cout << " -d : log level of user states" << endl; + cout << " -i : Machine identification" << endl; cout << endl; } *************** *** 278,282 **** int main (int argc, char* argv[]) { ! int i=0, l=0, d=0; tFSM *fsm; tState *root,*s0, *s1, *s2, *s3,*s4,*s5,*s6,*s7,*s8,*s9,*s10,*s11,*s12,*s13,*s14; // State pointers. One for each state. --- 284,288 ---- int main (int argc, char* argv[]) { ! int i=0, l=0, d=0, ident=TEST2_MACHINE_ID; tFSM *fsm; tState *root,*s0, *s1, *s2, *s3,*s4,*s5,*s6,*s7,*s8,*s9,*s10,*s11,*s12,*s13,*s14; // State pointers. One for each state. *************** *** 309,312 **** --- 315,325 ---- } + if (argv[i][1] == 'i') + { + sscanf(argv[i+1], "%d", &ident); + i++; + continue; + } + cerr << "Bad parameter: " << argv[i][1] << endl; return -1; *************** *** 315,319 **** ! fsm = new tFSM("Test machine", l); // We need one tFSM object for each FSM :) LOGINIT; --- 328,332 ---- ! fsm = new tFSM(TEST2_MACHINE_ID, "Test machine", l); // We need one tFSM object for each FSM :) LOGINIT; Index: test1.cpp =================================================================== RCS file: /cvsroot/dfsm/dFSM/src/test/test1.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** test1.cpp 17 Mar 2004 14:43:52 -0000 1.19 --- test1.cpp 3 Apr 2004 06:32:01 -0000 1.20 *************** *** 24,27 **** --- 24,30 ---- * $Revision$ * $Log$ + * Revision 1.20 2004/04/03 06:32:01 amoreno + * Add support for manual and automatic state machine identification + * * Revision 1.19 2004/03/17 14:43:52 amoreno * Add tInput interface to tInput_service, replace calls to tInput with calls to tInput_service and add sending events to timer. *************** *** 92,95 **** --- 95,99 ---- #include "libdfsm/ttimer_service.h" + #define TEST1_MACHINE_ID 1 struct tState_ROOT :public tState { *************** *** 240,243 **** --- 244,248 ---- cout << " -l : Internal log level of dFSM (default: 3)" << endl; cout << " -d : log level of user states (default: 3)" << endl; + cout << " -i : Machine identification" << endl; cout << endl; } *************** *** 245,249 **** int main (int argc, char* argv[]) { ! int i=0, l=3, d=3; tFSM *fsm; tState *root,*s0, *s1, *s2, *s3, *s4; // State pointers. One for each state. --- 250,254 ---- int main (int argc, char* argv[]) { ! int i=0, l=3, d=3, ident=TEST1_MACHINE_ID; tFSM *fsm; tState *root,*s0, *s1, *s2, *s3, *s4; // State pointers. One for each state. *************** *** 276,279 **** --- 281,291 ---- } + if (argv[i][1] == 'i') + { + sscanf(argv[i+1], "%d", &ident); + i++; + continue; + } + cerr << "Bad parameter: " << argv[i][1] << endl; return -1; *************** *** 282,286 **** ! fsm = new tFSM("Test machine", l); // We need one tFSM object for each FSM :) LOGINIT; --- 294,298 ---- ! fsm = new tFSM(ident, "Test machine", l); // We need one tFSM object for each FSM :) LOGINIT; Index: test3.cpp =================================================================== RCS file: /cvsroot/dfsm/dFSM/src/test/test3.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** test3.cpp 12 Sep 2003 16:29:13 -0000 1.9 --- test3.cpp 3 Apr 2004 06:32:01 -0000 1.10 *************** *** 25,28 **** --- 25,31 ---- * $Revision$ * $Log$ + * Revision 1.10 2004/04/03 06:32:01 amoreno + * Add support for manual and automatic state machine identification + * * Revision 1.9 2003/09/12 16:29:13 jvalduvieco * Worked on several aspects: *************** *** 58,61 **** --- 61,66 ---- #include "libdfsm/ttransition.h" + #define TEST3_MACHINE_ID 1 + struct tState_S1 :public tState { void entry_func() *************** *** 208,211 **** --- 213,217 ---- cout << " -l : Internal log level of dFSM" << endl; cout << " -d : log level of user states" << endl; + cout << " -i : Machine identification" << endl; cout << endl; } *************** *** 214,218 **** int main (int argc, char* argv[]) { ! int i=0, l=0, d=0; tFSM *fsm; tState *s1, *s11, *s12, *s111, *s112, *s1121, *s1122; // State pointers. One for each state. --- 220,224 ---- int main (int argc, char* argv[]) { ! int i=0, l=0, d=0, ident=TEST3_MACHINE_ID; tFSM *fsm; tState *s1, *s11, *s12, *s111, *s112, *s1121, *s1122; // State pointers. One for each state. *************** *** 246,249 **** --- 252,262 ---- } + if (argv[i][1] == 'i') + { + sscanf(argv[i+1], "%d", &ident); + i++; + continue; + } + cerr << "Bad parameter: " << argv[i][1] << endl; return -1; *************** *** 252,256 **** ! fsm = new tFSM("Test machine", l); // We need one tFSM object for each FSM :) LOGINIT; --- 265,269 ---- ! fsm = new tFSM(TEST3_MACHINE_ID, "Test machine", l); // We need one tFSM object for each FSM :) LOGINIT; *************** *** 370,374 **** fsm->add_transition(t9); ! clog << "Transition added"<<endl; --- 383,387 ---- fsm->add_transition(t9); ! //clog << "Transition added"<<endl; *************** *** 392,394 **** // is invoked state execution does not begin. } - --- 405,406 ---- Index: test5.cpp =================================================================== RCS file: /cvsroot/dfsm/dFSM/src/test/test5.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test5.cpp 29 Aug 2003 22:22:28 -0000 1.1 --- test5.cpp 3 Apr 2004 06:32:01 -0000 1.2 *************** *** 24,27 **** --- 24,30 ---- * $Revision$ * $Log$ + * Revision 1.2 2004/04/03 06:32:01 amoreno + * Add support for manual and automatic state machine identification + * * Revision 1.1 2003/08/29 22:22:28 amoreno * Solved bug with more that 8 machines, add Test5 to create a automate chain and some includes staff *************** *** 90,93 **** --- 93,97 ---- cout << " -n : Event to send in transition action" << endl; cout << " -f : Event to send in first transition" << endl; + cout << " -i : Machine identification" << endl; cout << endl; } *************** *** 95,99 **** int main (int argc, char* argv[]) { ! int i=0, l=3, d=3; tFSM *fsm; tState *root,*s0; // State pointers. One for each state. --- 99,103 ---- int main (int argc, char* argv[]) { ! int i=0, l=3, d=3, ident=-1; tFSM *fsm; tState *root,*s0; // State pointers. One for each state. *************** *** 145,149 **** continue; } ! cerr << "Bad parameter: " << argv[i][1] << endl; return -1; --- 149,159 ---- continue; } ! if (argv[i][1] == 'i') ! { ! sscanf(argv[i+1], "%d", &ident); ! i++; ! continue; ! } ! cerr << "Bad parameter: " << argv[i][1] << endl; return -1; *************** *** 157,162 **** } ! fsm = new tFSM("Test machine", l); // We need one tFSM object for each FSM :) LOGINIT; --- 167,173 ---- } + if (ident == -1) ident = event; ! fsm = new tFSM(ident, "Test machine", l); // We need one tFSM object for each FSM :) LOGINIT; *************** *** 211,213 **** // is invoked state execution does not begin. } - --- 222,223 ---- Index: test4_1.cpp =================================================================== RCS file: /cvsroot/dfsm/dFSM/src/test/test4_1.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** test4_1.cpp 11 Mar 2004 13:59:33 -0000 1.10 --- test4_1.cpp 3 Apr 2004 06:32:01 -0000 1.11 *************** *** 26,29 **** --- 26,32 ---- * $Revision$ * $Log$ + * Revision 1.11 2004/04/03 06:32:01 amoreno + * Add support for manual and automatic state machine identification + * * Revision 1.10 2004/03/11 13:59:33 amoreno * Initialize data pointer and bug cleaning data_run management *************** *** 57,60 **** --- 60,66 ---- * $Revision$ * $Log$ + * Revision 1.11 2004/04/03 06:32:01 amoreno + * Add support for manual and automatic state machine identification + * * Revision 1.10 2004/03/11 13:59:33 amoreno * Initialize data pointer and bug cleaning data_run management *************** *** 88,91 **** --- 94,99 ---- #include "libdfsm/ttransition.h" + #define TEST4_1_MACHINE_ID 1 + struct tState_S0 :public tState { void entry_func() *************** *** 189,192 **** --- 197,201 ---- cout << " -l : Internal log level of dFSM" << endl; cout << " -d : log level of user states" << endl; + cout << " -i : Machine identification" << endl; cout << endl; } *************** *** 194,198 **** int main (int argc, char* argv[]) { ! int i=0, l=0, d=0; tFSM *fsm; tState *s0, *s1, *s2, *s3, *s4; // State pointers. One for each state. --- 203,207 ---- int main (int argc, char* argv[]) { ! int i=0, l=0, d=0, ident=TEST4_1_MACHINE_ID; tFSM *fsm; tState *s0, *s1, *s2, *s3, *s4; // State pointers. One for each state. *************** *** 226,229 **** --- 235,246 ---- } + if (argv[i][1] == 'i') + { + sscanf(argv[i+1], "%d", &ident); + i++; + continue; + } + + cerr << "Bad parameter: " << argv[i][1] << endl; return -1; *************** *** 231,235 **** } ! fsm = new tFSM("Test machine 4_1", l); // We need one tFSM object for each FSM :) LOGINIT; --- 248,252 ---- } ! fsm = new tFSM(ident, "Test machine 4_1", l); // We need one tFSM object for each FSM :) LOGINIT; |