public IIOPortHandler[] createPortHandlers(ADTRecord[] adtRecs) { if (adtRecs.Length != 1) { GlobalServices.ErrMsg(this._appId, "Error: unexpected number of I/O devices (ADT records)"); GlobalServices.msgBox("Error: unexpected number of I/O devices (ADT records)", "Error!"); return null; } this._chipType = adtRecs[0].DeviceInfo.ShowChipName; this._chipRev = adtRecs[0].DeviceInfo.ShowChipRevision; string str = this._appId.Substring(this._appId.Length - 3); string[] strArray = this._appId.Split(new char[] { '_' }); this.sbDeviceTypePane.Text = " Device: " + adtRecs[0].DeviceInfo.ShowChipName + adtRecs[0].PortAddress.objectInfo(); this.sbChipRevPane.Text = "Chip Revision: " + adtRecs[0].DeviceInfo.ShowChipRevision; this.Text = strArray[0] + " Radio Control Panel"; if (adtRecs[0].PortAddress.Nickname != null) { this.tsrMainToolStrip.Nickname = adtRecs[0].PortAddress.Nickname; } else { this.tsrMainToolStrip.Nickname = "Device" + str; } this._WdsChipRevForConfigFiles = "WDS3_" + strArray[0] + "_" + adtRecs[0].DeviceInfo.ShowChipRevision; this._ioph = new IOPH_LoadBoard(adtRecs[0], this); this._portHandlerTerminated = false; return new IIOPortHandler[] { this._ioph }; }
public IIOPortHandler[] createPortHandlers(ADTRecord[] devices) { this._adtRec = devices[0]; this._ioph = new IOPH_LoadBoard(this._adtRec, this); return new IIOPortHandler[] { this._ioph }; }
public IIOPortHandler[] createPortHandlers(ADTRecord[] adtRecs) { if (adtRecs.Length != 1) { GlobalServices.ErrMsg("createPortHandlers()", "IOPH Test Application: unexpected number of I/O devices (ADT records)"); return null; } this.Text = this.Text + " [Device: " + adtRecs[0].PortAddress.objectInfo() + "]"; this._ioph = new IOPH_LoadBoard(adtRecs[0], this); this._ioph2 = new IOPH_LoadBoard(adtRecs[0], this); return new IIOPortHandler[] { this._ioph, this._ioph2 }; }
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 }; }
public void DevicePlugged(ADTRecord adtRec) { if (adtRec.DeviceInfo.DeviceType.TypeID == DeviceTypeID.SRW006) { this._ioph = new IOPH_LoadBoard(adtRec, this); WDS_MainProg.frameWin().ShortcutPlugAndPlay(false, new WDSFrameWindow.DevicePluggedCallback(this.DevicePlugged), new WDSFrameWindow.DeviceUnPluggedCallback(this.DeviceUnPlugged)); this._waitForReconnect = false; } else { this._additionalDevicePlugged = true; this._WirelessNodeAdtRec = adtRec; this.btnStep3Skip.Enabled = true; if (adtRec.DeviceInfo.DeviceType.TypeID != DeviceTypeID.EZLink) { this.txtStep3.Text = this.getStringResource("txtStep3Text_3"); this.btnStep3Next.Enabled = false; } string fwType = this.getStringResource("SlaveFirmwareIDForDownload"); bool flag = IO_FD_Main.NewFirmwareExists(Path.Combine(Application.StartupPath, "Firmware"), adtRec.DeviceInfo, true, fwType, out this._latestNodeFirmware, new FirmwareTargetEnvironment[] { FirmwareTargetEnvironment.System }); if (flag && (this._latestNodeFirmware != null)) { this.txtStep3.Text = this.getStringResource("txtStep3Text_4"); this.btnStep3Next.Enabled = true; this.btnStep3Skip.Enabled = false; this.btnStep3Next.Text = "Download Firmware"; } else if (!flag && (this._latestNodeFirmware != null)) { this.txtStep3.Text = this.getStringResource("txtStep3Text_5"); this.btnStep3Skip.Text = "Next"; this.btnStep3Next.Enabled = false; } else { this.txtStep3.Text = this.getStringResource("txtStep3Text_6"); this.btnStep3Next.Enabled = false; } } }
public IIOPortHandler[] createPortHandlers(ADTRecord[] adtRecs) { if (adtRecs.Length != 1) { _log.Warn("Error: unexpected number of I/O devices (ADT records)"); return null; } this._appId.Substring(this._appId.Length - 3); string[] strArray = this._appId.Split(new char[] { '_' }); string nickname = adtRecs[0].PortAddress.Nickname; this._WdsChipRevForConfigFiles = "WDS3_" + strArray[0] + "_" + adtRecs[0].DeviceInfo.ShowChipRevision; this._ioph = new IOPH_LoadBoard(adtRecs[0], this); this._portHandlerTerminated = false; return new IIOPortHandler[] { this._ioph }; }