예제 #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();
 }
예제 #2
0
파일: IO_FD_HID_DCP2.cs 프로젝트: x893/WDS
 public IO_FD_HID_DCP2(ADTRecord adtRecord)
 {
     _adtRecord = adtRecord;
     if (adtRecord.PortAddress.portType == PortType.RS232)
         _ddi = DDI_RS232.instance();
     else if (adtRecord.PortAddress.portType == PortType.HID)
         _ddi = DDI_HID.instance();
     else
     {
         _log.Error("IO_FD_HID.IO_FD_HID() FATAL ERROR: Unknown I/O port type, exit WDS!");
         Application.Exit();
     }
 }
예제 #3
0
 public IO_FD_HID_ToolStick(ADTRecord adtRecord)
 {
     this._adtRecord = adtRecord;
     if (adtRecord.PortAddress.portType == PortType.TOOLSTICK)
     {
         this._ddi = DDI_TOOLSTICK.instance();
     }
     else
     {
         _log.Error("IO_FD_HID.IO_FD_HID() FATAL ERROR: Unknown I/O port type, exit WDS!");
         Application.Exit();
     }
 }
예제 #4
0
파일: IO_FD_SUB8051.cs 프로젝트: x893/WDS
 public IO_FD_SUB8051(ADTRecord adtRecord)
 {
     _adtRecord = adtRecord;
     if (adtRecord.PortAddress.portType == PortType.RS232)
     {
         _ddi = DDI_RS232.instance();
     }
     else
     {
         GlobalServices.ErrMsg("IO_FD_SUB8051.IO_FD_SUB8051()", "FATAL ERROR: Unknown I/O port type, exit WDS!");
         GlobalServices.msgBox("FATAL ERROR: Unknown I/O port type, exit WDS!", "IO_FD_SUB8051.IO_FD_SUB8051()");
         Application.Exit();
     }
 }
예제 #5
0
파일: IOPH_DCP.cs 프로젝트: 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();
 }
예제 #6
0
파일: IOPH_LoadBoard.cs 프로젝트: x893/WDS
 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();
 }
예제 #7
0
파일: IO_FD_Main.cs 프로젝트: x893/WDS
 public IO_FD_Main(ADTRecord adtRecord)
 {
     this._adtRecord = adtRecord;
     if (adtRecord.PortAddress.portType == PortType.USB_FTDI)
         this._ddi = DDI_USB.instance();
     else if (adtRecord.PortAddress.portType == PortType.RS232)
         this._ddi = DDI_RS232.instance();
     else if (adtRecord.PortAddress.portType == PortType.HID)
         this._ddi = DDI_HID.instance();
     else if (adtRecord.PortAddress.portType == PortType.TOOLSTICK)
         this._ddi = DDI_TOOLSTICK.instance();
     else if (adtRecord.PortAddress.portType == PortType.SIMULATION)
         this._ddi = DDI_TEST.instance();
     else
     {
         GlobalServices.ErrMsg("IO_FD_Main.IO_FD_Main()", "FATAL ERROR: Unknown I/O port type, exit WDS!");
         GlobalServices.msgBox("FATAL ERROR: Unknown I/O port type, exit WDS!", "IO_FD_Main.IO_FD_Main()");
         Application.Exit();
     }
 }
예제 #8
0
파일: IOPH_DATA.cs 프로젝트: x893/WDS
 public int initialize()
 {
     Interlocked.Increment(ref _adtRec.NumUsers);
     int num = int.Parse(ConfigurationManager.AppSettings["DCPMaxDataLen"]);
     int num2 = int.Parse(ConfigurationManager.AppSettings["DCP2MsgRepeatNr"]);
     int num3 = int.Parse(ConfigurationManager.AppSettings["DCPRecTimeout"]);
     byte num4 = byte.Parse(ConfigurationManager.AppSettings["DCPSOFByte"]);
     _dcpProtocolEngine = new DCPProtocol(this, num, num2, num3, 10, num4, DCPVersion.DCP2);
     _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.isHIDDevice())
     {
         _ddi = DDI_HID.instance();
     }
     else if (_adtRec.isTOOLSTICKDevice())
     {
         _ddi = DDI_TOOLSTICK.instance();
     }
     else if (_adtRec.isTESTDevice())
     {
         _ddi = DDI_TEST.instance();
     }
     else
     {
         _log.Error("IOPH_DATA.initialize() - Unknown I/O port type!");
         return -1;
     }
     _iot = new Thread(new ThreadStart(doDeviceIO));
     _iot.IsBackground = true;
     _iot.Name = "IOPH_DATA thread";
     _isRequestAvailible = false;
     _iot.Start();
     return 0;
 }
예제 #9
0
파일: AppWin_FTDITest.cs 프로젝트: x893/WDS
 public IIOPortHandler[] createPortHandlers(ADTRecord[] devices)
 {
     int num = 2;
     if (devices.Length != num)
     {
         GlobalServices.ErrMsg(this._appId, "AppWin_FTDITest.createPortHandlers(): Number of devices not equals to ADCR (expected " + num.ToString() + "): " + devices.Length.ToString());
     }
     else
     {
         string text = this.Text;
         this.Text = text + "   [Devices: " + devices[0].PortAddress.objectInfo() + ";   " + devices[1].PortAddress.objectInfo() + "]";
     }
     if (devices[0].isUsbFtdiDevice())
     {
         this._ddi = DDI_USB.instance();
     }
     else if (devices[0].isRS232Device())
     {
         this._ddi = DDI_RS232.instance();
     }
     else if (devices[0].isTESTDevice())
     {
         this._ddi = DDI_TEST.instance();
     }
     else
     {
         GlobalServices.ErrMsg(this._appId, "AppWin_FTDITest.createPortHandlers(): FATAL ERROR: Unknown I/O port type!");
         Application.Exit();
     }
     this._ioph = new IOPH_LoadBoard(devices[1], this);
     this._adtRecordArray = devices;
     return new IIOPortHandler[] { this._ioph };
 }