/// <summary> /// 通过串口获取LED屏 /// </summary> /// <param name="comPort"></param> /// <returns></returns> private VehicleLed GetVehicleLed(byte comPort) { if (!_VehicleLeds.ContainsKey(comPort)) { VehicleLed led = new VehicleLed(comPort); led.Open(); _VehicleLeds.Add(comPort, led); } return(_VehicleLeds[comPort]); }
/// <summary> /// 子屏显示信息 /// </summary> /// <param name="comPort">串口号</param> /// <param name="address">地址</param> /// <param name="interval">显示时长</param> /// <param name="msg">显示信息</param> private void DisplayMsg(byte comPort, byte address, int interval, string msg) { if (AppSettings.CurrentSetting.Debug) { string str = string.Format("【Port {0} @ Address {1}】发送数据【{2}】", comPort, address, msg); Ralid.GeneralLibrary.LOG.FileLog.Log("VehicleLed", str); } VehicleLed led = GetVehicleLed(comPort); if (!led.DisplayMsg(address, msg, 500)) { string str = string.Format("【Port {0} @ Address {1}】发送【{2}】失败", comPort, address, msg); Ralid.GeneralLibrary.LOG.FileLog.Log("VehicleLed", str); } }
private void ReportRender(CardEventReport report) { try { if (_VehicleLed == null) { if (AppSettings.CurrentSetting.VehicleLedCOMPort > 0) { _VehicleLed = new VehicleLed(AppSettings.CurrentSetting.VehicleLedCOMPort); _VehicleLed.Open(); } } if (_VehicleLed != null) { _VehicleLed.DisplayVehicleInfo(report.Department, report.OwnerName, report.CardCarPlate, report.IsExitEvent); } } catch (Exception ex) { ExceptionPolicy.HandleException(ex); } }