public void Run() { try { LineNameS = LineName; StationNameS = LineName; myAdam = new MyAdamBusiness(); myAdam.m_iCom = Convert.ToInt32(ClsCommon.adamm_iCom); myAdam.m_iAddr = Convert.ToInt32(ClsCommon.adamm_iAddr); myAdam.m_iCount = Convert.ToInt32(ClsCommon.adamm_iCount); myAdam.AdamType = ClsCommon.AdamType; myAdam.m_PlloingTime = Convert.ToInt32(ClsCommon.adamm_PlloingTime); myAdam.recodeMessage += new MyAdamBusiness.recodeLog(RecordInfoMessage); myAdam.alarmType += new MyAdamBusiness.Alarm(ReturnAdamType); myAdam.DIRevice += new MyAdamBusiness.ChangeDI(AdamBusiness); Thread workThread = new Thread(new ThreadStart(myAdam.Run)); workThread.Start(); AlarmMark = true; #region >>>>初始化灯 Thread.Sleep(100); Write(Convert.ToInt32(Function_BLL.getAdamAddressByStation(LineName, StationName, "AlarmGreen")), true);//绿灯亮起 #endregion } catch (Exception ex) { recodeAdamMessage("初始化板卡失败,请检查连接" + ex.Message, 1); } }
public void CloseAdam() { #region >>>>初始化灯 Write(Convert.ToInt32(Function_BLL.getAdamAddressByStation(LineName, StationName, "AlarmRed")), false); //红灯熄灭 Write(Convert.ToInt32(Function_BLL.getAdamAddressByStation(LineName, StationName, "AlarmVoice")), false); //声音熄灭 Write(Convert.ToInt32(Function_BLL.getAdamAddressByStation(LineName, StationName, "AlarmGreen")), false); //绿灯亮起 #endregion myAdam.CloseAdam(); }
public static void Alarm() { try { Write(Convert.ToInt32(Function_BLL.getAdamAddressByStation(LineNameS, StationNameS, "AlarmRed")), true); //报警灯亮 Write(Convert.ToInt32(Function_BLL.getAdamAddressByStation(LineNameS, StationNameS, "AlarmVoice")), true); //声音 Write(Convert.ToInt32(Function_BLL.getAdamAddressByStation(LineNameS, StationNameS, "AlarmGreen")), false); //绿灯熄灭 } catch (Exception ex) { new Adam_BLL().ReturnAdamType(32);//ADAM写值错误 new Adam_BLL().recodeAdamMessage("调用报警方法出差:" + ex.Message, 1); } }
public void AdamBusiness(int channel, bool value) { try { #region >>>>>报警复位 if (!String.IsNullOrEmpty(Function_BLL.getAdamAddressByStation(LineName, StationName, "AlarmReset")) && Convert.ToInt32(Function_BLL.getAdamAddressByStation("1", "0", "AlarmReset")) == channel && value == false) { if (!String.IsNullOrEmpty(Function_BLL.getAdamAddressByStation(LineName, StationName, "AlarmRed"))) { Write(Convert.ToInt32(Function_BLL.getAdamAddressByStation(LineName, StationName, "AlarmRed")), false); //红灯熄灭 Write(Convert.ToInt32(Function_BLL.getAdamAddressByStation(LineName, StationName, "AlarmVoice")), false); //声音熄灭 Write(Convert.ToInt32(Function_BLL.getAdamAddressByStation(LineName, StationName, "AlarmGreen")), true); //绿灯亮起 ReturnAdamType(0); } } #endregion } catch (Exception ex) { ReturnAdamType(30);//监控ADAM控制字错误 recodeAdamMessage("监控ADAM控制字错误" + ex.Message, 1); } }