Example #1
0
 public IOPH_EZLinkDongle(ADTRecord adtRec, IAppMainWindow mainWin)
 {
     this._adtRec = adtRec;
     this._mainWin = mainWin;
     this._teleFromWin = new Telegram(0x3e8);
     this._teleToWin = new Telegram(0x3e8);
     this._replyData = new DataBuffer(0x3e8);
     this._isSeries = false;
     this._seriesExecStat = SeriesExecutionState.Stop;
     this._taskEvent = new AutoResetEvent(false);
     this._taskState = TaskState.TaskReady_OK;
     if (adtRec.isUsbEZLinkDevice())
     {
         this._ddi = DDI_EZLinkDongle.instance();
     }
     else if (adtRec.isTESTDevice())
     {
         this._ddi = DDI_TEST.instance();
     }
     else
     {
         GlobalServices.ErrMsg("FATAL ERROR: IOPH_EZLinkDongle", "I/O port type not supported, exit WDS!");
         Application.Exit();
     }
     this._iot = new Thread(new ThreadStart(this.doDeviceIO));
     this._iot.IsBackground = true;
     this._iot.Name = "IOPH_EZLink thread";
     this._isTelegramRequest = false;
     this._isRxTimerRequest = false;
     this._isReadRxPacketEnabled = false;
     this._iot.Start();
 }
Example #2
0
 public IOPH_LoadBoard(ADTRecord adtRec, IAppMainWindow mainWin)
 {
     this._adtRec = adtRec;
     this._mainWin = mainWin;
     this._teleFromWin = new Telegram(GlobalServices.maxCommandDataLen);
     this._teleToWin = new Telegram(GlobalServices.maxReplyDataLen);
     this._replyData = new DataBuffer(GlobalServices.maxReplyDataLen, Data_Type.ASCII);
     this._isSeries = false;
     this._seriesExecStat = SeriesExecutionState.Stop;
     this._taskEvent = new AutoResetEvent(false);
     this._taskState = TaskState.TaskReady_OK;
     if (adtRec.isUsbFtdiDevice())
     {
         this._ddi = DDI_USB.instance();
         this._isTestDevice = false;
     }
     else if (adtRec.isRS232Device())
     {
         this._ddi = DDI_RS232.instance();
         this._isTestDevice = false;
     }
     else if (adtRec.isTESTDevice())
     {
         this._ddi = DDI_TEST.instance();
         this._isTestDevice = true;
     }
     else if (adtRec.isHIDDevice())
     {
         this._ddi = DDI_HID.instance();
         this._isTestDevice = false;
     }
     else
     {
         GlobalServices.ErrMsg("IOPH_LoadBoard.IOPH_LoadBoard()", "FATAL ERROR: Unknown I/O port type, exit WDS!");
         GlobalServices.msgBox("FATAL ERROR: Unknown I/O port type, exit WDS!", "IOPH_LoadBoard.IOPH_LoadBoard()");
         Application.Exit();
     }
     this.ReadReplytimerDelegate = new TimerCallback(this.rxReadReplyTimerTickHandler);
     this._iot = new Thread(new ThreadStart(this.doDeviceIO));
     this._iot.IsBackground = true;
     this._iot.Name = "IOPH_LoadBoard thread";
     this._iot.Start();
 }
Example #3
0
File: IOPH_DCP.cs Project: x893/WDS
 public IOPH_DCP(ADTRecord adtRec, IAppMainWindow mainWin)
 {
     _adtRec = adtRec;
     _mainWin = mainWin;
     _teleFromWin = new Telegram(GlobalServices.maxCommandDataLen);
     _teleToWin = new Telegram(GlobalServices.maxReplyDataLen);
     _replyData = new DataBuffer(GlobalServices.maxReplyDataLen);
     _isSeries = false;
     _seriesExecStat = SeriesExecutionState.Stop;
     _taskState = TaskState.TaskReady_OK;
     int num = int.Parse(ConfigurationManager.AppSettings["DCPMaxDataLen"]);
     int num2 = int.Parse(ConfigurationManager.AppSettings["DCPMsgRepeatNr"]);
     int num3 = int.Parse(ConfigurationManager.AppSettings["DCPRecTimeout"]);
     byte num4 = byte.Parse(ConfigurationManager.AppSettings["DCPSOFByte"]);
     _dcpProtocolEngine = new DCPProtocol(this, num, num2, num3, 10, num4);
     _DCPRXMsg = new DCPFrame(num, num4);
     _DCPAnswerMsg = new DCPFrame(num, num4);
     _DCPTXMsg = new DCPFrame(num, num4);
     _DCPTXBuf = new DCPFrame(num, num4);
     if (adtRec.isUsbFtdiDevice())
     {
         _ddi = DDI_USB.instance();
     }
     else if (adtRec.isRS232Device())
     {
         _ddi = DDI_RS232.instance();
     }
     else if (adtRec.isTESTDevice())
     {
         _ddi = DDI_TEST.instance();
     }
     else if (adtRec.isHIDDevice())
     {
         _ddi = DDI_HID.instance();
     }
     else
     {
         GlobalServices.ErrMsg("IOPH_DCP.IOPH_DCP()", "FATAL ERROR: Unknown I/O port type, exit WDS!");
         Application.Exit();
     }
     _iot = new Thread(new ThreadStart(doDeviceIO));
     _iot.IsBackground = true;
     _iot.Name = "IOPH_DCP thread";
     _isTelegramRequest = false;
     _iot.Start();
 }
Example #4
0
File: DDI_TEST.cs Project: x893/WDS
 public DeviceHandle open(ADTRecord adtRecord)
 {
     if (adtRecord.isTESTDevice())
     {
         return new DeviceHandle(new TestDeviceHandle(new DataBuffer(GlobalServices.maxCommandDataLen + GlobalServices.maxReplyDataLen), 0));
     }
     GlobalServices.ErrMsg("DDI_TEST.open()", "Not implemented for physical devices!");
     return new DeviceHandle();
 }