FACT++  1.0
int main ( void  )

Definition at line 100 of file pvss_dim_server.cxx.

References COMPLEXDATA::bitset, COMPLEXDATA::boolval, RecvCommand::clearReset(), COMPLEXDATA1::farr, COMPLEXDATA::floatval, COMPLEXDATA1::iarr, COMPLEXDATA::intval, COMPLEXDATA1::intval, COMPLEXDATA1::intval1, RecvCommand::isReset(), DimService::setQuality(), sprintf(), DimServer::start(), COMPLEXDATA1::str, COMPLEXDATA::stringval, and DimService::updateService().

101 {
102  COMPLEXDATA complexData;
103  COMPLEXDATA1 cData;
104  float simpleData;
105 
106  int index = 0;
107  complexData.bitset = 0x1;
108  complexData.boolval = 1;
109  complexData.intval = index;
110  complexData.floatval = (float)3.4;
111  strcpy(complexData.stringval,"IDLE");
112 
113 
114  cData.farr[0] = (float)1.2;
115  cData.farr[1] = (float)2.2;
116  cData.farr[2] = (float)3.2;
117  cData.farr[3] = 0;
118  cData.farr[4] = 0;
119  cData.farr[5] = 0;
120  cData.farr[6] = 0;
121  cData.farr[7] = 0;
122  cData.farr[8] = 0;
123  cData.farr[9] = 0;
124  cData.intval = 123;
125  cData.iarr[0] = 12;
126  cData.iarr[1] = 13;
127  cData.iarr[2] = 14;
128  cData.intval1 = 456;
129  strcpy(cData.str,"hello");
130 
131  DimService cTestService("COMPLEX_SERVICE_TEST","F:10;I:1;I:3;C:20;I:1",
132  (void *)&cData, sizeof(cData));
133 
134  DimService complexService("COMPLEX_SERVICE","I:1;C:1;I:1;F:1;C",
135  (void *)&complexData, sizeof(complexData));
136 
137  simpleData = (float)1.23;
138 
139  DimService simpleService("SIMPLE_SERVICE", simpleData);
140  simpleService.setQuality(1);
141 
142  RecvCommand recvCommand("SIMPLE_COMMAND");
143  RecvCommandComplex recvCommandComplex("COMPLEX_COMMAND");
144 /*
145  {
146  char tstr[128];
147  int i;
148  RecvCommandMem *rmem;
149 // TestMem = new DimService("TEST_MEM", "I:1;F", (void *)&TestMemData, sizeof(TestMemData));
150 // RecvCommandMem recvCommandMem("TEST_MEM_CMND");
151 
152  for(i = 1; i <= 1000; i++)
153  {
154  sprintf(tstr,"TEST_MEM%04d",i);
155  TestMem[i] = new DimService(tstr, "I:1;F", (void *)&TestMemData, sizeof(TestMemData));
156  sprintf(tstr,"TEST_MEM_CMND%04d",i);
157  rmem = new RecvCommandMem(tstr, i);
158  }
159  }
160 */
161  RpcService rpc("RPC");
162 
163  DimServer::start("PVSS_DIM_TEST");
164 
165  while(1)
166  {
167  sleep(5);
168 
169  if( recvCommand.isReset() )
170  {
171 
172  index = 0;
173  complexData.bitset = 0x1;
174  complexData.boolval = 1;
175  complexData.intval = index;
176  complexData.floatval = (float)3.4;
177  strcpy(complexData.stringval,"IDLE");
178  simpleData = (float)1.23;
179  recvCommand.clearReset();
180  }
181  else
182  {
183  index++;
184  complexData.bitset <<= 1;
185  complexData.boolval = index;
186  complexData.intval = index;
187  complexData.floatval = index * (float)1.1;
188  sprintf(complexData.stringval,"State %d", index);
189  simpleData += (float)1.1;
190  }
191 
192  complexService.updateService();
193 
194 // simpleService.setQuality(complexData.bitset);
195 /*
196  {
197  int secs;
198  time_t tsecs;
199 
200  tsecs = time((time_t)NULL);
201  secs = (int)tsecs;
202  secs -=60;
203  simpleService.setTimestamp(secs, 123);
204  simpleService.setQuality(index);
205  tsecs = (time_t)secs;
206  cout << "quality "<< index << " time "<< ctime(&tsecs) << endl;
207  }
208 */
209  simpleService.updateService();
210 // simpleData += (float)1;
211 // simpleService.updateService();
212 // simpleData += (float)1;
213 // simpleService.updateService();
214 // simpleData += (float)1;
215 // simpleService.updateService();
216 // simpleData += (float)1;
217 // simpleService.updateService();
218 // simpleData += (float)1;
219 // simpleService.updateService();
220 // simpleData += (float)1;
221 // simpleService.updateService();
222 // simpleData += (float)1;
223 // simpleService.updateService();
224 // simpleData += (float)1;
225 // simpleService.updateService();
226 // simpleData += (float)1;
227 // simpleService.updateService();
228 
229  if((int)strlen(cData.str) < 16)
230  strcat(cData.str," abc");
231  cTestService.updateService();
232  }
233  return 0;
234 }
static void start()
Definition: discpp.cxx:512
sprintf(name1,"NewService%d", i)
char stringval[128]

+ Here is the call graph for this function: