private void HandleDevice(TDevice data) { Device = new DevModel() { addrRes = new AddResource(), dvBrandid = "", dvIsid = Uuid.Create16Token(), managerIsid = cfg.AppSettings["managerIsid"], nodeIsid = NodeIsid, dvTypeCode = "37", dvName = data.Name, }; DbData = new SqlTDevice() { beginRunTime = SuperBTagBase.Transfer(data.BeginRunTime), devTypeId = (int)data.DeviceType, objDesc = data.Des, objId = data.ID, parentId = data.ParentID, objName = data.Name, objTypeId = (int)data.Type, productor = data.Productor, version = data.Version, }; }
protected override void HandleTag(BStruBase data, string tagIsid) { if (!(data is TDOC tdoc)) { return; } TagRes tag = new TagRes() { tagIsid = tagIsid ?? Uuid.Create16Token(), tagName = data.Name, tagTypeCode = "21", //B接口读写 dataType = "5", //5-float ioType = "3", //'读写类型(0不可读写/1只读/2只写/3可读可写)' addition = 0, // bias multiplier = 1, // 倍数 ruleIsid = cfg.AppSettings["ruleIsid"], // saved tagAddr = "1", // 1 }; DbData = new SqlTdoc() { objDesc = tdoc.Des, objId = tdoc.ID, objName = tdoc.Name, objTypeId = (int)tdoc.Type, parentId = tdoc.ParentID, saved = (int)tdoc.Saved, controlEnable = (int)tdoc.ControlEnable, desc0 = tdoc.Desc0, desc1 = tdoc.Desc1, }; }
private SqlAlarmRes StruAlarm(TDSC data, SqlAlarmMap armMap) { SqlAlarmRes alarm = new SqlAlarmRes() { tagIsid = Tag.tagIsid, alarmEnable = data.AlarmEnable == EnumEnable.ENABLE ? 1 : 0, alarmIsid = armMap.alarmIsid ?? Uuid.Create16Token(), alarmType = 1, }; alarm.alarmName = alarm.alarmIsid; return(alarm); }
protected override void HandleTag(BStruBase data, string tagIsid) { if (!(data is TAIC taic)) { return; } TagRes tag = new TagRes() { tagIsid = tagIsid ?? Uuid.Create16Token(), tagName = data.Name, tagTypeCode = "21", //B接口读写 dataType = "5", //5-float ioType = "1", //'读写类型(0不可读写/1只读/2只写/3可读可写)' addition = 0, // bias multiplier = 1, // 倍数 ruleIsid = cfg.AppSettings["ruleIsid"], // saved tagAddr = "1", // 1 }; DbData = new SqlTaic() { alarmEnable = (int)taic.AlarmEnable, alarmLevel = (int)taic.AlarmLevel, hiLimit1 = taic.HiLimit1, hiLimit2 = taic.HiLimit2, hiLimit3 = taic.HiLimit3, loLimit1 = taic.LoLimit1, loLimit2 = taic.LoLimit2, loLimit3 = taic.LoLimit3, maxVal = taic.MaxVal, minVal = taic.MinVal, objDesc = taic.Des, objId = taic.ID, objName = taic.Name, objTypeId = (int)taic.Type, parentId = taic.ParentID, percision = taic.Percision, saved = (int)taic.Saved, stander = taic.Stander, unit = taic.Unit, }; }
public SuperBStation(TStation data, string nodeIsid) { OrgiData = data; NodeIsid = nodeIsid != null? nodeIsid:Uuid.Create16Token(); HandleStation(data); }