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 { } }
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); } }