void InitFDX3543RP() { try { // Prepare delegate for other thread this.cLog_OutputLog_Delegate = new CLog.OutputLogHandler(cLog_OutputLog_Exec); this.CallbackFromFPD_Delegate = new EVENT_CALLBACK_t(CallbackFromFPD_Exec); // Create log class this.cLog = new CLog(); // Attach output to Log text box handler this.cLog.OutputLog = new CLog.OutputLogHandler(this.cLog_OutputLog); // Display PC information // DisplayPCInfo(); // Create lower API interface class IntPtr ptr = Marshal.AllocHGlobal(1024); // 1024 byte for debug this.cIfLower = new CInterfaceLower(this.cLog, ptr); this.cIfLower.ActiveDetector = 0; // Setup ActiveDetector combo box for (int i = 0; i < this.cIfLower.ConnectFPDs; i++) { dicFPDNo.Add(i, "FPD" + i.ToString()); } if (0 < cIfLower.ConnectFPDs) { CurrentToshibaFPDNo = dicFPDNo[0]; } // Register user callback function (for debug) cIfLower.TetdFpdRegisterCallback(new CInterfaceLower.TETD_CALLBACK_t(this.CallbackFromFPD)); // Show DLL version information UInt32 version; if (CInterfaceLower.E_ERR_TETD_CONTROLLER_ENUM.TETD_OK == this.cIfLower.TetdDllVer(out version)) { this.cLog.WriteLine("DLL version " + (version / 100).ToString("D1") + "." + (version % 100).ToString("D2")); } // Initialize FPD State as "Not Init" Connect_ToshibaNew(); //this.rbt_FPDStateNotInit.Checked = true; //this.rbt_FPDStateStandby.Checked = false; //this.rbt_FPDStateWork.Checked = false; //this.rbt_FPDStateCalibration.Checked = false; // Disable Exposure button //this.btn_Exposure.Enabled = false; // Disable Calibration button //this.btn_Calibration.Enabled = false; // Disable To Double button //this.btn_ToDouble.Enabled = false; } catch (Exception ex) { AppLogger.LogAction.LogActions("==>InitFDX3543RP().Exception occurred at " + DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss") + "." + ex.ToString()); Utility.ShowMsg(ex.Message); } }
void try2FreeToshiba_New() { try { if (_AppMode == AppType.AppEnum.AppMode.License) { if (modName.ToUpper().Contains("FDX3543RP") || modName2.ToUpper().Contains("FDX3543RP")) { Try2StandBy(); this.cIfLower.Dispose(); CallbackFromFPD_Delegate = null; cIfLower = null; GC.Collect(); GC.WaitForPendingFinalizers(); } } } catch { } }
//*************************************************************************************************** /*! * @brief Constructor. * * @author TJ * @date 2012/03/30(Fri) * * @param[in] FPD_CONDITION fpdCondition FPD status information. * * @return none */ //*************************************************************************************************** public CCondition(CInterfaceLower.FPD_CONDITION fpdCondition) { // Initialize this.fpdStatus = FPDSTATUS.STATE_NULL; this.shotReq = SHOTREQ.None; this.microSD = MICROSD.OK; this.shotMode = SHOTMODE.Single; this.eeprom = EEPROM.Normal; this.powerSave = POWERSAVE.OFF; this.port = PORT.NOTBUSY; this.pictBufNo = 0; this.pwrbdTmp1 = TEMPERATURE.Normal; this.pwrbdTmp2 = TEMPERATURE.Normal; this.dtbdTmp1 = TEMPERATURE.Normal; this.dtbdTmp2 = TEMPERATURE.Normal; this.tftOn = VOLTAGE.Normal; this.tftOff = VOLTAGE.Normal; this.pd = VOLTAGE.Normal; // Convert status information to enum try { // Status this.fpdStatus = (FPDSTATUS)Enum.Parse(typeof(FPDSTATUS), this.GetValidByte(fpdCondition.nSys, FPDSTATUS_BIT).ToString()); this.shotReq = (SHOTREQ)Enum.Parse(typeof(SHOTREQ), this.GetValidByte(fpdCondition.nSys, SHOTREQ_BIT).ToString()); this.microSD = (MICROSD)Enum.Parse(typeof(MICROSD), this.GetValidByte(fpdCondition.nSys, MICROSD_BIT).ToString()); this.shotMode = (SHOTMODE)Enum.Parse(typeof(SHOTMODE), this.GetValidByte(fpdCondition.nSys, SHOTMODE_BIT).ToString()); this.eeprom = (EEPROM)Enum.Parse(typeof(EEPROM), this.GetValidByte(fpdCondition.nSys, EEPROM_BIT).ToString()); this.powerSave = (POWERSAVE)Enum.Parse(typeof(POWERSAVE), this.GetValidByte(fpdCondition.nSys, POWERSAVE_BIT).ToString()); this.port = (PORT)Enum.Parse(typeof(PORT), this.GetValidByte(fpdCondition.nSys, PORT_BIT).ToString()); this.pictBufNo = (UInt32) this.GetValidByte(fpdCondition.nSys, PICTBUFNO_BIT); // Temperature this.pwrbdTmp1 = (TEMPERATURE)Enum.Parse(typeof(TEMPERATURE), this.GetValidByte(fpdCondition.nTemp, PWRBDTMP1_BIT).ToString()); this.pwrbdTmp2 = (TEMPERATURE)Enum.Parse(typeof(TEMPERATURE), this.GetValidByte(fpdCondition.nTemp, PWRBDTMP2_BIT).ToString()); this.dtbdTmp1 = (TEMPERATURE)Enum.Parse(typeof(TEMPERATURE), this.GetValidByte(fpdCondition.nTemp, DTBDTMP1_BIT).ToString()); this.dtbdTmp2 = (TEMPERATURE)Enum.Parse(typeof(TEMPERATURE), this.GetValidByte(fpdCondition.nTemp, DTBDTMP2_BIT).ToString()); // Voltage this.tftOn = (VOLTAGE)Enum.Parse(typeof(VOLTAGE), this.GetValidByte(fpdCondition.nVolt, TFTON_BIT).ToString()); this.tftOff = (VOLTAGE)Enum.Parse(typeof(VOLTAGE), this.GetValidByte(fpdCondition.nVolt, TFTOFF_BIT).ToString()); this.pd = (VOLTAGE)Enum.Parse(typeof(VOLTAGE), this.GetValidByte(fpdCondition.nVolt, PD_BIT).ToString()); } catch (Exception) { // Error process (none) } }