public void GetDetector2Temp() { if (GlobalFunc.getTemp == true) { bool retry = true; int retryCount = 0; axUDROP1.SelIndex = 2; while (retry) { try { if (axUCONN21.IsOpen) { axUCONN21.Close(); } axUCONN21.Address = axUDROP1.SelAddress; axUCONN21.Open(); axUCONN21.Comm("SHOW_VERSION"); axUCONN21.Comm("ENAB_HV"); if (axUCONN21.ID == 2) { string thisTemp = GlobalFunc.tc.axUCONN21.Comm("SHOW_DET_TEMP"); thisTemp = thisTemp.Replace("DET_TEMP ", ""); GlobalFunc.det2_temp = GlobalFunc.Math45Pt1(Convert.ToDouble(thisTemp)); retry = false; } else { retry = true; retryCount++; } axUCONN21.Close(); } catch (Exception ex) { retryCount++; } if (retryCount == 5) { try { axUDROP1.SelIndex = 1; axUCONN21.Address = axUDROP1.SelAddress; } catch { } } if (retryCount == 10) { break; } } } }
public void GetDetector1Temp() { if (GlobalFunc.getTemp == true) { bool retry = true; int retryCount = 0; while (retry) { try { if (GlobalFunc.axUCONN21.IsOpen) { GlobalFunc.axUCONN21.Close(); } GlobalFunc.axUCONN21.Open(); if (GlobalFunc.axUCONN21.ID == 1) { string thisTemp = GlobalFunc.axUCONN21.Comm("SHOW_DET_TEMP"); thisTemp = thisTemp.Replace("DET_TEMP ", ""); GlobalFunc.det1_temp = GlobalFunc.Math45Pt1(Convert.ToDouble(thisTemp)); } else { retry = true; retryCount++; } retry = false; } catch (Exception ex) { retryCount++; } if (retryCount == 10) { break; } } } }