static QueryCacheDataToGateway() { _DeviceDefineService = ServiceFactory.Create <IDeviceDefineService>(); _PointDefineService = ServiceFactory.Create <IAllSystemPointDefineService>(); _NetworkModuleService = ServiceFactory.Create <INetworkModuleService>(); _ManualCrossControlService = ServiceFactory.Create <IManualCrossControlService>(); }
private void Frm_AddressTypeDefine_Load(object sender, EventArgs e) { deviceDefineService = ServiceFactory.Create <IDeviceDefineService>(); addressTypeService = ServiceFactory.Create <IKJ_AddresstypeService>(); addresstyperuleService = ServiceFactory.Create <IKJ_AddresstyperuleService>(); AddressTypeRuleList = new DataTable(); AddressTypeRuleList.Columns.Add("ID"); AddressTypeRuleList.Columns.Add("Addresstypeid"); AddressTypeRuleList.Columns.Add("Devid"); AddressTypeRuleList.Columns.Add("Devname"); AddressTypeRuleList.Columns.Add("UpAlarmValue"); AddressTypeRuleList.Columns.Add("UpPoweroffValue"); AddressTypeRuleList.Columns.Add("LowAlarmValue"); AddressTypeRuleList.Columns.Add("LowPoweroffValue"); gridControl1.DataSource = AddressTypeRuleList; //加载人员报警设置 20171128 if (type == 1) { AddressType = GetAddressTypeByAddressTypeID(AddressTypeid); if (AddressType != null) { txt_AddressTypeName.Text = AddressType.Addresstypename; List <KJ_AddresstyperuleInfo> AddressTypeRuleItems = addresstyperuleService.GetKJ_AddresstyperuleListByAddressTypeId(new Request.KJ_Addresstyperule.KJ_AddresstyperuleGetListRequest() { Id = AddressTypeid }).Data; Jc_DevInfo devInfo; //加载已有规则信息 devItems = deviceDefineService.GetAllDeviceDefineCache().Data.OrderBy(a => a.Devid).ToList(); foreach (KJ_AddresstyperuleInfo item in AddressTypeRuleItems) { devInfo = devItems.FirstOrDefault(a => a.Devid.ToString() == item.Devid); AddGridData(item.ID, item.Addresstypeid, item.Devid, devInfo == null ? "未知" : devInfo.Name, Math.Round(item.UpAlarmLowValue, 2) + "~" + Math.Round(item.UpAlarmHighValue, 2), Math.Round(item.UpPoweroffLowValue, 2) + "~" + Math.Round(item.UpPoweroffHighValue, 2), Math.Round(item.LowAlarmLowValue, 2) + "~" + Math.Round(item.LowAlarmHighValue, 2), Math.Round(item.LowPoweroffLowValue, 2) + "~" + Math.Round(item.LowPoweroffHighValue, 2)); } } } else { AddressType = null; } LoadDev(); }
private DeviceDefineCache() { deviceDefineService = ServiceFactory.Create <IDeviceDefineService>(); }
private void Frm_AreaDefine_Load(object sender, EventArgs e) { deviceDefineService = ServiceFactory.Create <IDeviceDefineService>(); areaService = ServiceFactory.Create <IAreaService>(); areaRuleList = new DataTable(); areaRuleList.Columns.Add("id"); areaRuleList.Columns.Add("devid"); areaRuleList.Columns.Add("devname"); areaRuleList.Columns.Add("deviceCount"); areaRuleList.Columns.Add("maxVal"); areaRuleList.Columns.Add("minVal"); gridControl1.DataSource = areaRuleList; //加载人员报警设置 20171128 //加载默认报警时间 AlarmTime.Text = "08:00"; //加载默认报警类型 AlarmType.SelectedIndex = 0; //加载默认超员报警人数 RatedPersonCount.Value = 0; if (type == 1) { area = GetAreaByAreaID(areaid); if (area != null) { position = area.AreaBound; txt_areaPosition.Text = position; txt_areaPosition.ReadOnly = true; txt_areaName.Text = area.Areaname; List <AreaRuleInfo> areaRuleItems = area.AreaRuleInfoList; Jc_DevInfo devInfo; //加载已有规则信息 devItems = deviceDefineService.GetAllDeviceDefineCache().Data.OrderBy(a => a.Devid).ToList(); foreach (AreaRuleInfo item in areaRuleItems) { devInfo = devItems.FirstOrDefault(a => a.Devid.ToString() == item.Devid); AddGridData(item.Devid, devInfo == null ? "未知" : devInfo.Name, item.DeviceCount.ToString(), item.MaxValue.ToString(), item.MinValue.ToString()); } //加载已有区域人员报警信息 20171128 if (area.Bz1 != null) { AlarmTime.Text = area.Bz1.ToString(); } if (area.Bz2 != null) { RatedPersonCount.Value = int.Parse(area.Bz2); } if (area.RestrictedpersonInfoList != null) { if (area.RestrictedpersonInfoList.Count > 0) { restrictedpersonInfoList = area.RestrictedpersonInfoList; AlarmType.SelectedIndex = area.RestrictedpersonInfoList[0].Type; } } } } else { area = null; } LoadDev(); }