Rev 90 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
90 | gunterl | 1 | //------------------------------------------------------------------------------ |
2 | // <auto-generated> |
||
3 | // This code was generated by a tool. |
||
4 | // Runtime Version:2.0.50727.312 |
||
5 | // |
||
6 | // Changes to this file may cause incorrect behavior and will be lost if |
||
7 | // the code is regenerated. |
||
8 | // </auto-generated> |
||
9 | //------------------------------------------------------------------------------ |
||
10 | |||
11 | using Microsoft.Ccr.Core; |
||
12 | using Microsoft.Dss.Core; |
||
13 | using Microsoft.Dss.Core.Attributes; |
||
14 | using Microsoft.Dss.ServiceModel.Dssp; |
||
15 | using Microsoft.Dss.ServiceModel.DsspServiceBase; |
||
16 | using Microsoft.Dss.Core.DsspHttp; |
||
17 | using System; |
||
18 | using System.Collections.Generic; |
||
19 | using System.Security.Permissions; |
||
20 | using System.ComponentModel; |
||
21 | using System.Xml; |
||
22 | using roboboard = Robotics.RoboBoard; |
||
23 | using submgr = Microsoft.Dss.Services.SubscriptionManager; |
||
24 | using Roboboard = Robotics.Serial; |
||
25 | using Microsoft.Ccr.Adapters.WinForms; |
||
26 | using soap = W3C.Soap; |
||
27 | using dssp = Microsoft.Dss.ServiceModel.Dssp; |
||
28 | using xml = System.Xml; |
||
29 | using W3C.Soap; |
||
30 | |||
31 | |||
32 | namespace Robotics.RoboBoard |
||
33 | { |
||
34 | /// <summary> |
||
35 | /// Implementation class for RoboBoard |
||
36 | /// </summary> |
||
37 | [DisplayName("RoboBoard")] |
||
38 | [Description("The RoboBoard Service")] |
||
39 | [Contract(Contract.Identifier)] |
||
40 | public class RoboBoardService : DsspServiceBase |
||
41 | { |
||
42 | RoboBoardForm _rbForm; |
||
43 | RoboBoardEvents _eventsPort = new RoboBoardEvents(); |
||
44 | |||
97 | gunterl | 45 | bool subs = false; |
46 | bool isloaded = false; |
||
47 | |||
90 | gunterl | 48 | private Roboboard.SerialCom sc = new Robotics.Serial.SerialCom(); |
49 | /// <summary> |
||
50 | /// _state |
||
51 | /// </summary> |
||
52 | private RoboBoardState _state = new RoboBoardState(); |
||
53 | /// <summary> |
||
54 | /// _main Port |
||
55 | /// </summary> |
||
56 | [ServicePort("/roboboard", AllowMultipleInstances=false)] |
||
57 | private RoboBoardOperations _mainPort = new RoboBoardOperations(); |
||
58 | |||
59 | [Partner("SubMgr", Contract = submgr.Contract.Identifier, CreationPolicy = PartnerCreationPolicy.CreateAlways)] |
||
60 | private submgr.SubscriptionManagerPort _submgrPort = new submgr.SubscriptionManagerPort(); |
||
61 | |||
62 | //--------------------------------------------------------------------- |
||
63 | /// <summary> |
||
64 | /// Default Service Constructor |
||
65 | /// </summary> |
||
66 | public RoboBoardService(DsspServiceCreationPort creationPort) : |
||
67 | base(creationPort) |
||
68 | { |
||
69 | } |
||
70 | |||
71 | /// <summary> |
||
72 | /// Service Start |
||
73 | /// </summary> |
||
74 | protected override void Start() |
||
75 | { |
||
76 | Activate(Arbiter.Interleave( |
||
77 | new TeardownReceiverGroup |
||
78 | ( |
||
79 | ), |
||
80 | new ExclusiveReceiverGroup |
||
81 | ( |
||
82 | Arbiter.ReceiveWithIterator<OnLoad>(true, _eventsPort, OnLoadHandler) |
||
83 | ), |
||
84 | new ConcurrentReceiverGroup |
||
85 | ( |
||
86 | ) |
||
87 | )); |
||
88 | |||
89 | base.Start(); |
||
90 | LogInfo("Init Service.."); |
||
91 | // Add service specific initialization here. |
||
92 | |||
93 | // Open Status and Debug Dialog |
||
94 | WinFormsServicePort.Post(new RunForm(CreateForm)); |
||
95 | |||
96 | Roboboard.SerialCom.BotEvent +=new Robotics.Serial.SerialCom.BotEventHandler(sc_BotEvent); |
||
97 | } |
||
98 | |||
99 | System.Windows.Forms.Form CreateForm() |
||
100 | { |
||
101 | return new RoboBoardForm(_eventsPort); |
||
102 | } |
||
103 | |||
104 | |||
105 | //--------------------------------------------------------------------- |
||
106 | /// <summary> |
||
107 | /// Get Handler |
||
108 | /// </summary> |
||
109 | /// <param name="get"></param> |
||
110 | /// <returns></returns> |
||
111 | [ServiceHandler(ServiceHandlerBehavior.Concurrent)] |
||
112 | public virtual IEnumerator<ITask> GetHandler(Get get) |
||
113 | { |
||
114 | get.ResponsePort.Post(_state); |
||
115 | yield break; |
||
116 | } |
||
117 | |||
118 | //--------------------------------------------------------------------- |
||
119 | /// <summary> |
||
120 | /// Http Get Handler |
||
121 | /// </summary> |
||
122 | [ServiceHandler(ServiceHandlerBehavior.Concurrent)] |
||
123 | public IEnumerator<ITask> HttpGetHandler(HttpGet httpGet) |
||
124 | { |
||
125 | httpGet.ResponsePort.Post(new HttpResponseType(_state)); |
||
126 | yield break; |
||
127 | } |
||
128 | |||
129 | //--------------------------------------------------------------------- |
||
130 | /// <summary> |
||
131 | /// Replace Handler |
||
132 | /// </summary> |
||
133 | [ServiceHandler(ServiceHandlerBehavior.Exclusive)] |
||
134 | public IEnumerator<ITask> ReplaceHandler(Replace replace) |
||
135 | { |
||
136 | _state = replace.Body; |
||
137 | |||
138 | // #region CODECLIP 04-1 |
||
139 | // base.SendNotification(_submgrPort, replace); |
||
140 | // #endregion |
||
141 | |||
142 | replace.ResponsePort.Post(DefaultReplaceResponseType.Instance); |
||
143 | yield break; |
||
144 | } |
||
145 | |||
146 | //--------------------------------------------------------------------- |
||
147 | [ServiceHandler(ServiceHandlerBehavior.Exclusive)] |
||
97 | gunterl | 148 | public IEnumerator<ITask> InitComplete(InitComplete initComplete) |
149 | { |
||
150 | LogInfo("Init"); |
||
151 | LogInfo("Command:" + initComplete.Body.Command); |
||
152 | yield break; |
||
153 | } |
||
154 | |||
155 | //--------------------------------------------------------------------- |
||
156 | [ServiceHandler(ServiceHandlerBehavior.Exclusive)] |
||
90 | gunterl | 157 | public IEnumerator<ITask> SetComPortHandler(SetComPort setComPort) |
158 | { |
||
159 | LogInfo("Set Port Name ("+setComPort.Body.PortName+")"); |
||
160 | if ((setComPort.Body.PortName == sc.ComPort)&&(sc.isOpen==true)) |
||
161 | { |
||
162 | LogInfo("no need to change com port"); |
||
163 | // port name equals the old port name - no action |
||
164 | } |
||
165 | else |
||
166 | { |
||
167 | // port name is different, close the old port and open the new one |
||
168 | if(sc.isOpen==true) { |
||
169 | LogInfo("closing Port"); |
||
170 | sc.ClosePort(); |
||
171 | } |
||
172 | sc.ComPort = setComPort.Body.PortName; |
||
173 | if (_rbForm != null) |
||
174 | { |
||
175 | if (sc.InitPort() == 0) |
||
176 | { |
||
177 | LogInfo("Init Port succseeded"); |
||
97 | gunterl | 178 | WinFormsServicePort.FormInvoke(delegate() |
179 | { _rbForm.UpdateStatus("Port Open (" + sc.ComPort + ")"); }); |
||
90 | gunterl | 180 | } |
181 | else |
||
182 | { |
||
183 | LogInfo("Init Port failed"); |
||
184 | WinFormsServicePort.FormInvoke(delegate() |
||
97 | gunterl | 185 | { _rbForm.UpdateStatus("Can't open communication port (" + sc.ComPort + ")"); }); |
90 | gunterl | 186 | } |
187 | } |
||
97 | gunterl | 188 | else |
189 | { |
||
190 | LogInfo("Board communication not ready! Setport Ignored"); |
||
191 | } |
||
90 | gunterl | 192 | } |
97 | gunterl | 193 | LogInfo("Exit Set Comport"); |
90 | gunterl | 194 | yield break; |
195 | } |
||
196 | |||
197 | //--------------------------------------------------------------------- |
||
198 | [ServiceHandler(ServiceHandlerBehavior.Exclusive)] |
||
199 | public IEnumerator<ITask> IncrementTickHandler(IncrementTick incrementTick) |
||
200 | { |
||
201 | LogInfo("Tick: "); |
||
202 | LogInfo("Command:" + incrementTick.Body.Command); |
||
203 | |||
204 | base.SendNotification(_submgrPort, incrementTick); |
||
205 | |||
206 | incrementTick.ResponsePort.Post(DefaultUpdateResponseType.Instance); |
||
207 | yield break; |
||
208 | } |
||
209 | |||
210 | //--------------------------------------------------------------------- |
||
211 | [ServiceHandler(ServiceHandlerBehavior.Exclusive)] |
||
212 | public IEnumerator<ITask> ReceiveCommandHandler(ReceiveCommand receiveCommand) |
||
213 | { |
||
214 | LogInfo("Receive "); |
||
215 | LogInfo("Command:" + receiveCommand.Body.Command); |
||
216 | |||
217 | base.SendNotification(_submgrPort, receiveCommand); |
||
218 | |||
219 | receiveCommand.ResponsePort.Post(DefaultUpdateResponseType.Instance); |
||
220 | yield break; |
||
221 | } |
||
222 | |||
223 | //--------------------------------------------------------------------- |
||
224 | [ServiceHandler(ServiceHandlerBehavior.Exclusive)] |
||
225 | public IEnumerator<ITask> SendCommandHandler(SendCommand sendCommand) |
||
226 | { |
||
227 | LogInfo("Send "); |
||
228 | LogInfo("Command:" + sendCommand.Body.Command); |
||
229 | |||
230 | MKRequestTunnelMessage(sendCommand.Body.Command); |
||
231 | |||
232 | base.SendNotification(_submgrPort, sendCommand); |
||
233 | sendCommand.ResponsePort.Post(DefaultUpdateResponseType.Instance); |
||
234 | yield break; |
||
235 | } |
||
236 | |||
237 | //--------------------------------------------------------------------- |
||
238 | [ServiceHandler(ServiceHandlerBehavior.Exclusive)] |
||
239 | public IEnumerator<ITask> LevelHandler(Level level) |
||
240 | { |
||
241 | LogInfo("Level "); |
||
242 | LogInfo("Nick:"+level.Body.Nick+"Roll:"+level.Body.Roll); |
||
243 | base.SendNotification(_submgrPort, level); |
||
244 | level.ResponsePort.Post(DefaultUpdateResponseType.Instance); |
||
245 | yield break; |
||
246 | } |
||
247 | |||
248 | //--------------------------------------------------------------------- |
||
249 | [ServiceHandler(ServiceHandlerBehavior.Exclusive)] |
||
250 | public IEnumerator<ITask> SetAltituteHandler(SetAltitute setaltitute) |
||
251 | { |
||
252 | LogInfo("SetAltitute "); |
||
253 | LogInfo("Altitute:" + setaltitute.Body.Altitute); |
||
254 | if (_rbForm != null) |
||
255 | { |
||
256 | _rbForm.Control_alt = (Int16)setaltitute.Body.Altitute; |
||
257 | } |
||
258 | //TODO: send alt control to MK |
||
259 | base.SendNotification(_submgrPort, setaltitute); |
||
260 | setaltitute.ResponsePort.Post(DefaultUpdateResponseType.Instance); |
||
261 | yield break; |
||
262 | } |
||
263 | |||
264 | //--------------------------------------------------------------------- |
||
265 | [ServiceHandler(ServiceHandlerBehavior.Exclusive)] |
||
266 | public IEnumerator<ITask> SetGierHandler(SetGier setgier) |
||
267 | { |
||
268 | LogInfo("SetGier "); |
||
269 | LogInfo("SetGier:" + setgier.Body.Gier); |
||
270 | Int16 igier = (Int16)(((float)128 * setgier.Body.Gier) / (float)1000); |
||
271 | if (_rbForm != null) |
||
272 | { |
||
273 | _rbForm.Control_gier = igier; |
||
274 | } |
||
275 | |||
97 | gunterl | 276 | if (MK_latest_gier != igier) |
277 | { |
||
278 | MK_latest_gier = igier; |
||
279 | MKRequestControl(MK_latest_nick, MK_latest_roll, MK_latest_gier, MK_latest_gas); |
||
280 | } |
||
90 | gunterl | 281 | base.SendNotification(_submgrPort, setgier); |
282 | setgier.ResponsePort.Post(DefaultUpdateResponseType.Instance); |
||
283 | yield break; |
||
284 | } |
||
285 | |||
286 | //--------------------------------------------------------------------- |
||
287 | [ServiceHandler(ServiceHandlerBehavior.Exclusive)] |
||
288 | public IEnumerator<ITask> SetGasHandler(SetGas setgas) |
||
289 | { |
||
290 | LogInfo("SetGas "); |
||
291 | LogInfo("SetGas:" + setgas.Body.Gas); |
||
292 | Int16 igas = (Int16)(((float)128 * setgas.Body.Gas) / (float)1000); |
||
293 | if (_rbForm != null) |
||
294 | { |
||
295 | _rbForm.Control_gas = igas; |
||
296 | } |
||
297 | |||
97 | gunterl | 298 | if (MK_latest_gas != igas) |
299 | { |
||
300 | MK_latest_gas = igas; |
||
301 | MKRequestControl(MK_latest_nick, MK_latest_roll, MK_latest_gier, MK_latest_gas); |
||
302 | } |
||
90 | gunterl | 303 | |
304 | base.SendNotification(_submgrPort, setgas); |
||
305 | setgas.ResponsePort.Post(DefaultUpdateResponseType.Instance); |
||
306 | yield break; |
||
307 | } |
||
308 | |||
309 | //--------------------------------------------------------------------- |
||
310 | [ServiceHandler(ServiceHandlerBehavior.Exclusive)] |
||
311 | |||
312 | public IEnumerator<ITask> ControlHandler(Control control) |
||
313 | { |
||
314 | LogInfo("Control "); |
||
315 | LogInfo("Nick:" + control.Body.Nick + " Roll:" +control.Body.Roll); |
||
316 | |||
317 | Int16 inick = (Int16)(((float)128 * control.Body.Nick) / (float)(-1000)); |
||
318 | Int16 iroll = (Int16)(((float)128 * control.Body.Roll) / (float)(-1000)); |
||
319 | |||
320 | if (_rbForm != null) |
||
321 | { |
||
322 | _rbForm.Control_nick = inick; |
||
323 | _rbForm.Control_roll = iroll; |
||
324 | } |
||
325 | |||
97 | gunterl | 326 | if ((MK_latest_roll != iroll) || (MK_latest_nick != inick)) |
327 | { |
||
328 | MK_latest_nick = inick; |
||
329 | MK_latest_roll = iroll; |
||
330 | MKRequestControl(MK_latest_nick, MK_latest_roll, MK_latest_gier, MK_latest_gas); |
||
331 | } |
||
90 | gunterl | 332 | |
333 | base.SendNotification(_submgrPort, control); |
||
334 | control.ResponsePort.Post(DefaultUpdateResponseType.Instance); |
||
335 | yield break; |
||
336 | } |
||
337 | |||
338 | //--------------------------------------------------------------------- |
||
339 | [ServiceHandler(ServiceHandlerBehavior.Concurrent)] |
||
340 | public IEnumerator<ITask> SubscribeHandler(Subscribe subscribe) |
||
341 | { |
||
342 | SubscribeRequestType request = subscribe.Body; |
||
343 | LogInfo("Subscribe request from: " + request.Subscriber); |
||
344 | |||
345 | yield return Arbiter.Choice( |
||
346 | SubscribeHelper(_submgrPort, request, subscribe.ResponsePort), |
||
347 | delegate(SuccessResult success) |
||
348 | { |
||
349 | base.SendNotification<Replace>(_submgrPort, request.Subscriber, _state); |
||
350 | }, |
||
351 | delegate(Exception e) |
||
352 | { |
||
353 | LogError(null, "Subscribe failed", e); |
||
354 | } |
||
355 | ); |
||
97 | gunterl | 356 | if (isloaded) |
357 | { |
||
358 | base.SendNotification(_submgrPort, new InitComplete("OK")); |
||
359 | } |
||
360 | subs = true; |
||
90 | gunterl | 361 | yield break; |
362 | } |
||
363 | |||
364 | //--------------------------------------------------------------------- |
||
365 | IEnumerator<ITask> OnLoadHandler(OnLoad onLoad) |
||
366 | { |
||
367 | _rbForm = onLoad.RoboBoardForm; |
||
368 | LogInfo("Loaded Form"); |
||
97 | gunterl | 369 | sc.ComPort = "COM7"; |
90 | gunterl | 370 | if (_rbForm != null) |
371 | { |
||
372 | if (sc.InitPort() == 0) |
||
373 | { |
||
97 | gunterl | 374 | LogInfo("Port Open"); |
90 | gunterl | 375 | WinFormsServicePort.FormInvoke(delegate() |
376 | {_rbForm.UpdateStatus("Port Open (" + sc.ComPort + ")");}); |
||
377 | } |
||
378 | else |
||
379 | { |
||
97 | gunterl | 380 | LogInfo("Port failed to Open"); |
90 | gunterl | 381 | WinFormsServicePort.FormInvoke(delegate() |
382 | {_rbForm.UpdateStatus("Can't open communication port (" + sc.ComPort + ")");}); |
||
383 | } |
||
384 | } |
||
385 | //request version |
||
386 | MKRequestVersion(); |
||
97 | gunterl | 387 | if (subs) |
388 | { |
||
389 | base.SendNotification(_submgrPort, new InitComplete("OK")); |
||
390 | } |
||
391 | isloaded = true; |
||
90 | gunterl | 392 | yield break; |
393 | } |
||
394 | |||
395 | //--------------------------------------------------------------------- |
||
396 | void MKRequestTunnelMessage(string message) |
||
397 | { |
||
398 | message = sc.CreateMessage((char)'X', (char)0, message); |
||
399 | sc.SerialWrite(message); |
||
400 | } |
||
401 | |||
402 | //--------------------------------------------------------------------- |
||
403 | bool MKRequestSend = false; |
||
404 | Int16 MK_old_roll = 0; |
||
405 | Int16 MK_old_nick = 0; |
||
406 | Int16 MK_old_gier = 0; |
||
407 | Int16 MK_old_gas = 0; |
||
408 | |||
409 | Int16 MK_latest_roll = 0; |
||
410 | Int16 MK_latest_nick = 0; |
||
411 | Int16 MK_latest_gier = 0; |
||
412 | Int16 MK_latest_gas = 0; |
||
413 | |||
414 | void MKRequestControl(Int16 nick, Int16 roll, Int16 gier, Int16 gas) |
||
415 | { |
||
416 | string message = ""; |
||
417 | if ((MK_old_gas == gas) && |
||
418 | (MK_old_gier == gier) && |
||
419 | (MK_old_nick == nick) && |
||
420 | (MK_old_roll == roll)) |
||
421 | { |
||
422 | LogInfo("no update"); |
||
423 | return; |
||
424 | } |
||
425 | if (MKRequestSend == true) return; |
||
426 | LogInfo("Send"); |
||
427 | if (_rbForm != null) |
||
428 | { |
||
429 | WinFormsServicePort.FormInvoke(delegate() |
||
430 | { _rbForm.MonitorMKSensorUpdate(); }); |
||
431 | } |
||
432 | message = sc.MessageAddInt16(roll, message); |
||
433 | MK_old_roll = roll; |
||
434 | message = sc.MessageAddInt16(nick, message); |
||
435 | MK_old_nick = nick; |
||
436 | message = sc.MessageAddInt16(gier, message); |
||
437 | MK_old_gier = gier; |
||
438 | message = sc.MessageAddInt16(gas, message); |
||
439 | MK_old_gas = gas; |
||
440 | message = sc.CreateMessage((char)'C', (char)0, message); |
||
441 | MKRequestSend = true; |
||
442 | sc.SerialWrite(message); |
||
443 | } |
||
444 | |||
445 | void MKDecodeControl() |
||
446 | { |
||
447 | LogInfo("Control OK"); |
||
448 | MKRequestSend = false; |
||
449 | MKRequestControl(MK_latest_nick, MK_latest_roll, MK_latest_gier, MK_latest_gas); |
||
450 | } |
||
451 | |||
452 | //--------------------------------------------------------------------- |
||
453 | void MKRequestVersion() |
||
454 | { |
||
97 | gunterl | 455 | LogInfo("MK RequestVersion"); |
90 | gunterl | 456 | string message = ""; |
457 | message=sc.CreateMessage((char)'v', (char)0, message); |
||
97 | gunterl | 458 | if (sc.isOpen) |
459 | { |
||
460 | LogInfo("Version Send"); |
||
461 | sc.SerialWrite(message); |
||
462 | } |
||
90 | gunterl | 463 | } |
464 | |||
465 | string MKDecodeVersion(string message) |
||
466 | { |
||
467 | string Versionstring = ""; |
||
468 | Versionstring += "Version: "+sc.MessageReadByte(message).ToString(); |
||
469 | message=message.Substring(1); |
||
470 | sc.MessageReadByte(message); |
||
471 | Versionstring += "." + sc.MessageReadByte(message).ToString(); |
||
472 | message = message.Substring(1); |
||
473 | sc.MessageReadByte(message); |
||
474 | Versionstring += " (STEP:" + sc.MessageReadByte(message).ToString()+")"; |
||
475 | if (_rbForm != null) |
||
476 | { |
||
477 | WinFormsServicePort.FormInvoke(delegate() |
||
478 | { _rbForm.UpdateStatus(Versionstring); }); |
||
479 | } |
||
480 | return Versionstring; |
||
481 | } |
||
482 | |||
483 | //--------------------------------------------------------------------- |
||
484 | void MKDecodeDebugData(string message) |
||
485 | { |
||
486 | Int16[] analog = new Int16[32]; |
||
487 | byte[] digital = new byte[2]; |
||
488 | int i = 0; |
||
489 | for (i = 0; i < 2; i++) |
||
490 | { |
||
491 | digital[i]=sc.MessageReadByte(message); |
||
492 | message = message.Substring(1); |
||
493 | } |
||
494 | for (i = 0; i < 32; i++) |
||
495 | { |
||
496 | analog[i] = sc.MessageReadInt16(message); |
||
497 | |||
498 | Int16 analogx = (Int16)analog[i]; |
||
499 | if (_rbForm != null) |
||
500 | { |
||
501 | _rbForm.MK_analog[i]= analog[i]; |
||
502 | _rbForm.Mk_analog_name[i] = "Analog" + i.ToString(); |
||
503 | //WinFormsServicePort.FormInvoke(delegate() |
||
504 | //{ _rbForm.MonitorMKSensor(i,analogx,"Analog"+i.ToString()); }); |
||
505 | } |
||
506 | message = message.Substring(2); |
||
507 | } |
||
508 | if (_rbForm != null) |
||
509 | { |
||
510 | WinFormsServicePort.FormInvoke(delegate() |
||
511 | { _rbForm.MonitorMKSensorUpdate(); }); |
||
512 | } |
||
513 | base.SendNotification(_submgrPort, new Level((int)analog[0], (int)analog[1])); |
||
514 | } |
||
515 | |||
516 | //--------------------------------------------------------------------- |
||
517 | void sc_BotEvent(object sender, EventArgs ev) |
||
518 | { |
||
519 | |||
520 | string message = ""; |
||
521 | char cmd = (char)0; |
||
522 | char adr = (char)0; |
||
523 | if (sc.IsMessageValid() == true) |
||
524 | { |
||
525 | message = sc.GetLastMessage(); |
||
526 | cmd = sc.GetMessageCmd(); |
||
527 | adr = sc.GetMessageAdr(); |
||
528 | if (cmd.CompareTo((char)'V')==0) |
||
529 | { |
||
530 | MKDecodeVersion(message); |
||
531 | base.SendNotification(_submgrPort, new ReceiveCommand("V"+message)); |
||
532 | } |
||
533 | else |
||
534 | if (cmd.CompareTo((char)'D') == 0) |
||
535 | { |
||
536 | MKDecodeDebugData(message); |
||
537 | //base.SendNotification(_submgrPort, new ReceiveCommand("D"+message)); |
||
538 | } |
||
539 | else |
||
540 | if (cmd.CompareTo((char)'X') == 0) |
||
541 | { |
||
542 | base.SendNotification(_submgrPort, new ReceiveCommand(message)); |
||
543 | } |
||
544 | else |
||
545 | if (cmd.CompareTo((char)'C') == 0) |
||
546 | { |
||
547 | MKDecodeControl(); |
||
548 | } |
||
549 | |||
550 | sc.InvalidateMessage(); |
||
551 | } |
||
552 | |||
553 | if (_rbForm != null) |
||
554 | { |
||
555 | WinFormsServicePort.FormInvoke(delegate() |
||
556 | { _rbForm.MonitorCommand(message); }); |
||
557 | } |
||
558 | } |
||
559 | } |
||
560 | } |