source: UH/SAMGAR/SAMGAR LIB/Trunk/TesterFiles/Test.cpp @ 1706

Revision 121, 927 bytes checked in by KDucasse, 11 years ago (diff)

Folder and files for the to compile samgar modules

Line 
1
2
3#include <SamgarMainClass.h>
4using namespace std;
5
6// types of module
7//#define interupt 0
8//#define run      1
9// current mode
10//#define running 0
11//#define paused 1
12//#define stoped 2
13//#define fullstop 3
14
15
16int main() {
17
18Network yarp;
19int myint;
20
21myint = 0;
22
23SamgarModule MyFirstTest("Module1","behaviour","happy",interupt); // Cant have spaces or underscores
24MyFirstTest.AddPortS("num10");
25MyFirstTest.AddPortS("num20");
26
27
28while( 1 )
29  {
30         if(MyFirstTest.GetIntData("num10",&myint)==true)
31         {
32                printf("got data %d \n",myint);
33       
34                if(myint%5==0){MyFirstTest.SendToLog("this has come from a port",3);}
35        //      if(myint>50)
36        //      {
37                               
38                //      MyFirstTest.SendAllModulesCommand(0);           
39                //      MyFirstTest.SendModuleCommand("Module2",3);
40        //              myint=0;
41               
42        //      }
43         }
44         else
45         {
46                printf("got no data \n");
47         }
48         MyFirstTest.SucceedFail(true,myint);
49  }
50
51  return 0;
52}
53
54
55
56
57
58
59
60
61
Note: See TracBrowser for help on using the repository browser.