public BaseAUPropertyViewModel(GKDriverProperty driverProperty, GKDevice device) { DriverProperty = driverProperty; Device = device; if (!Device.Properties.Any(x => x.Name == driverProperty.Name)) { Save(driverProperty.Default, false); } if (Device.DeviceProperties == null) { Device.DeviceProperties = new List<GKProperty>(); } var deviceProperty = Device.DeviceProperties.FirstOrDefault(x => x.Name == driverProperty.Name); if (deviceProperty != null) { DeviceAUParameterValue = deviceProperty.Value.ToString(); //if ((deviceProperty.DriverProperty != null) && (deviceProperty.DriverProperty.DriverPropertyType == XDriverPropertyTypeEnum.EnumType)) //DeviceAUParameterValue = deviceProperty.DriverProperty.Parameters.FirstOrDefault(x => x.Value == deviceProperty.Value).Name; } else DeviceAUParameterValue = "Неизвестно"; UpdateDeviceParameterMissmatchType(); }
public BasePropertyViewModel(GKDriverProperty driverProperty, GKDevice device) { DriverProperty = driverProperty; IsAUParameter = driverProperty.IsAUParameter; Device = device; if (!Device.Properties.Any(x => x.Name == driverProperty.Name)) { Save(driverProperty.Default, false); } if (Device.DeviceProperties == null) { Device.DeviceProperties = new List<GKProperty>(); } var deviceProperty = Device.DeviceProperties.FirstOrDefault(x => x.Name == driverProperty.Name); if (deviceProperty != null) { double value = deviceProperty.Value; if (DriverProperty.Multiplier != 0) value /= DriverProperty.Multiplier; DeviceAUParameterValue = value.ToString(); } else DeviceAUParameterValue = "Неизвестно"; UpdateDeviceParameterMissmatchType(); }
public static GKDriverProperty AddPlainEnumProprety(GKDriver driver, byte no, byte offset, string propertyName, string parameter1Name, string parameter2Name) { var property = new GKDriverProperty() { No = no, Name = propertyName, Caption = propertyName, Default = (ushort)(1 << offset), Mask = (short)((1 << offset) + (1 << (offset + 1))) }; var parameter1 = new GKDriverPropertyParameter() { Name = parameter1Name, Value = (ushort)(1 << offset) }; var parameter2 = new GKDriverPropertyParameter() { Name = parameter2Name, Value = (ushort)(2 << offset) }; property.Parameters.Add(parameter1); property.Parameters.Add(parameter2); driver.Properties.Add(property); return property; }
public static GKDriverProperty AddPlainEnumProprety2(GKDriver driver, byte no, string propertyName, byte offset, string parameter1Name, string parameter2Name, int mask) { var property = new GKDriverProperty() { No = no, Name = propertyName, Caption = propertyName, Default = 0, Mask = (byte)mask }; var parameter1 = new GKDriverPropertyParameter() { Name = parameter1Name, Value = (ushort)0 }; var parameter2 = new GKDriverPropertyParameter() { Name = parameter2Name, Value = (ushort)mask }; property.Parameters.Add(parameter1); property.Parameters.Add(parameter2); driver.Properties.Add(property); return property; }
public ShortPropertyViewModel(GKDriverProperty driverProperty, GKDevice device) : base(driverProperty, device) { var property = device.Properties.FirstOrDefault(x => x.Name == driverProperty.Name); if (property != null) _text = property.Value; else _text = driverProperty.Default; }
public StringAUPropertyViewModel(GKDriverProperty driverProperty, GKDevice device) : base(driverProperty, device) { var property = device.Properties.FirstOrDefault(x => x.Name == driverProperty.Name); if (property != null) _text = Convert.ToString(property.Value); else _text = Convert.ToString(driverProperty.Default); }
public static void AddPropertyParameter(GKDriverProperty property, string name, int value) { var parameter = new GKDriverPropertyParameter() { Name = name, Value = (ushort)value }; property.Parameters.Add(parameter); }
public BoolPropertyViewModel(GKDriverProperty driverProperty, GKDevice device) : base(driverProperty, device) { var property = device.Properties.FirstOrDefault(x => x.Name == driverProperty.Name); if (property != null) IsChecked = property.Value > 0; else IsChecked = (driverProperty.Default == (ushort)1) ? true : false; }
public BasePropertyViewModel(GKDriverProperty driverProperty, GKDevice device) { DriverProperty = driverProperty; Device = device; if (!Device.Properties.Any(x => x.Name == driverProperty.Name)) { Save(driverProperty.Default); } }
public static GKDriver Create() { var driver = new GKDriver() { DriverTypeNo = 0x15, DriverType = GKDriverType.RSR2_MRK, UID = new Guid("1EF2C05C-B86A-44E5-8F4C-662AF92DAF20"), Name = "Модуль радиоканальный", ShortName = "МРК", IsPlaceable = true, DriverClassification = GKDriver.DriverClassifications.RadioChannel }; driver.Children.Add(GKDriverType.RK_HandDetector); driver.Children.Add(GKDriverType.RK_SmokeDetector); driver.Children.Add(GKDriverType.RK_HeatDetector); driver.Children.Add(GKDriverType.RK_RM); driver.Children.Add(GKDriverType.RK_AM); driver.Children.Add(GKDriverType.RK_OPK); driver.Children.Add(GKDriverType.RK_OPZ); GKDriversHelper.AddAvailableStateBits(driver, GKStateBit.Test); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.Test); GKDriversHelper.AddIntProprety(driver, 0, "Число радиоканальных устройств", 0, 0, 32); GKDriversHelper.AddIntProprety(driver, 1, "Период опроса, с", 4, 4, 120); GKDriversHelper.AddIntProprety(driver, 2, "Повторы/неответы в количестве периодов", 3, 3, 32); var property3 = new GKDriverProperty() { No = 3, Name = "№ Канала", Caption = "№ Канала", Default = 0, Min = 0, Max = 15, IsLowByte = true, DriverPropertyType = GKDriverPropertyTypeEnum.IntType }; driver.Properties.Add(property3); var property4 = new GKDriverProperty() { No = 3, Name = "Режим выбора канала", Caption = "Режим выбора канала", Default = 0, IsHieghByte = true, }; GKDriversHelper.AddPropertyParameter(property4, "Ручной", 0); GKDriversHelper.AddPropertyParameter(property4, "Автоматический", 1); driver.Properties.Add(property4); GKDriversHelper.AddIntProprety(driver, 4, "Порог питания, В", 120, 0, 280).Multiplier = 10; return driver; }
public ShortPropertyViewModel(GKDriverProperty driverProperty, GKDevice device) : base(driverProperty, device) { var property = device.Properties.FirstOrDefault(x => x.Name == driverProperty.Name); if (property != null) { Text = DriverProperty.Multiplier != 0 ? (property.Value / DriverProperty.Multiplier).ToString() : property.Value.ToString(); } else Text = driverProperty.Default.ToString(); }
public static void AddBoolProprety(GKDriver driver, byte no, string propertyName) { var property = new GKDriverProperty() { No = no, Name = propertyName, Caption = propertyName, DriverPropertyType = GKDriverPropertyTypeEnum.BoolType }; driver.Properties.Add(property); }
public static GKDriver Create() { var driver = new GKDriver() { DriverTypeNo = 0xF2, DriverType = GKDriverType.RSR2_SCOPA, UID = new Guid("4F9DFCDD-B98B-4D2B-BD7E-635BB5728DCE"), Name = "Взрывозащищенный оповещатель - табло", ShortName = "СКОПА", IsControlDevice = true, HasLogic = true, IsPlaceable = true, DriverClassification = GKDriver.DriverClassifications.Announcers }; GKDriversHelper.AddControlAvailableStates(driver); driver.AvailableStateBits.Add(GKStateBit.Off); driver.AvailableStateBits.Add(GKStateBit.TurningOn); driver.AvailableStateBits.Add(GKStateBit.TurningOff); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.AutoOff); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.On); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.TurningOn); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.Off); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.Test); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.TurningOff); driver.AvailableCommandBits.Add(GKStateBit.TurnOn_InManual); driver.AvailableCommandBits.Add(GKStateBit.TurnOnNow_InManual); driver.AvailableCommandBits.Add(GKStateBit.TurnOff_InManual); driver.AvailableCommandBits.Add(GKStateBit.TurnOffNow_InManual); GKDriversHelper.AddIntProprety(driver, 0, "Задержка на включение, с", 0, 0, 65535); GKDriversHelper.AddIntProprety(driver, 1, "Время удержания, с", 0, 0, 65535); GKDriversHelper.AddIntProprety(driver, 2, "Задержка на выключение, с", 0, 0, 65535); var property1 = new GKDriverProperty() { No = 3, Name = "Состояние контакта для режима Удержание", Caption = "Состояние контакта для режима Удержание", Default = 0, IsLowByte = true, Mask = 0x03 }; GKDriversHelper.AddPropertyParameter(property1, "Выключено", 0); GKDriversHelper.AddPropertyParameter(property1, "Включено", 1); driver.Properties.Add(property1); driver.MeasureParameters.Add(new GKMeasureParameter { No = 1, Name = "Отсчет задержки на включение, с", IsDelay = true, IsNotVisible = true }); driver.MeasureParameters.Add(new GKMeasureParameter { No = 2, Name = "Отсчет удержания, с", IsDelay = true, IsNotVisible = true }); driver.MeasureParameters.Add(new GKMeasureParameter { No = 3, Name = "Отсчет задержки на выключение, с", IsDelay = true, IsNotVisible = true }); return driver; }
public static GKDriver Create() { var driver = new GKDriver() { DriverTypeNo = 0xF1, DriverType = GKDriverType.RSR2_ZOV, UID = new Guid("58795922-F023-4A90-BCEC-ACDB3CD0725F"), Name = "Оповещатель свето-звуковой взрывозащищенный", ShortName = "ЗОВ", IsControlDevice = true, HasLogic = true, IsPlaceable = true, DriverClassification = GKDriver.DriverClassifications.Announcers }; GKDriversHelper.AddControlAvailableStates(driver); driver.AvailableStateBits.Add(GKStateBit.Off); driver.AvailableStateBits.Add(GKStateBit.TurningOn); driver.AvailableStateBits.Add(GKStateBit.TurningOff); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.AutoOff); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.On); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.TurningOn); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.Off); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.Test); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.TurningOff); driver.AvailableCommandBits.Add(GKStateBit.TurnOn_InManual); driver.AvailableCommandBits.Add(GKStateBit.TurnOnNow_InManual); driver.AvailableCommandBits.Add(GKStateBit.TurnOff_InManual); driver.AvailableCommandBits.Add(GKStateBit.TurnOffNow_InManual); GKDriversHelper.AddIntProprety(driver, 0, "Задержка на включение, с", 0, 0, 65535); GKDriversHelper.AddIntProprety(driver, 1, "Время удержания, с", 0, 0, 65535); GKDriversHelper.AddIntProprety(driver, 2, "Задержка на выключение, с", 0, 0, 65535); var property1 = new GKDriverProperty() { No = 3, Name = "Состояние контакта для режима Удержание", Caption = "Состояние контакта для режима Удержание", Default = 0, IsLowByte = true, Mask = 0x03 }; GKDriversHelper.AddPropertyParameter(property1, "Выключено", 0); GKDriversHelper.AddPropertyParameter(property1, "Включено", 1); driver.Properties.Add(property1); driver.MeasureParameters.Add(new GKMeasureParameter { No = 1, Name = "Отсчет задержки на включение, с", IsDelay = true, IsNotVisible = true }); driver.MeasureParameters.Add(new GKMeasureParameter { No = 2, Name = "Отсчет удержания, с", IsDelay = true, IsNotVisible = true }); driver.MeasureParameters.Add(new GKMeasureParameter { No = 3, Name = "Отсчет задержки на выключение, с", IsDelay = true, IsNotVisible = true }); return driver; }
public static GKDriver Create() { var driver = new GKDriver() { DriverTypeNo = 0x12, DriverType = GKDriverType.RSR2_ABPC, UID = new Guid("6260F52C-D047-4F64-BFE8-B9D0547A39B4"), Name = "Адресный барьер пусковой цепи", ShortName = "АБПЦ", IsControlDevice = true, HasLogic = true, IsPlaceable = true, DriverClassification = GKDriver.DriverClassifications.ActuatingDevice }; GKDriversHelper.AddControlAvailableStates(driver); driver.AvailableStateBits.Add(GKStateBit.Off); driver.AvailableStateBits.Add(GKStateBit.TurningOn); driver.AvailableStateBits.Add(GKStateBit.TurningOff); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.AutoOff); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.On); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.TurningOn); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.Off); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.Test); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.TurningOff); driver.AvailableCommandBits.Add(GKStateBit.TurnOn_InManual); driver.AvailableCommandBits.Add(GKStateBit.TurnOnNow_InManual); driver.AvailableCommandBits.Add(GKStateBit.TurnOff_InManual); driver.AvailableCommandBits.Add(GKStateBit.TurnOffNow_InManual); GKDriversHelper.AddIntProprety(driver, 0, "Задержка на включение, с", 0, 0, 65535); GKDriversHelper.AddIntProprety(driver, 1, "Время удержания, с", 0, 0, 65535); GKDriversHelper.AddIntProprety(driver, 2, "Задержка на выключение, с", 0, 0, 65535); var property1 = new GKDriverProperty() { No = 3, Name = "Состояние контакта для режима Удержание", Caption = "Состояние контакта для режима Удержание", Default = 0, IsLowByte = true, Mask = 0x03 }; GKDriversHelper.AddPropertyParameter(property1, "Выключено", 0); GKDriversHelper.AddPropertyParameter(property1, "Включено", 1); driver.Properties.Add(property1); driver.MeasureParameters.Add(new GKMeasureParameter { No = 1, Name = "Отсчет задержки на включение, с", IsDelay = true, IsNotVisible = true }); driver.MeasureParameters.Add(new GKMeasureParameter { No = 2, Name = "Отсчет удержания, с", IsDelay = true, IsNotVisible = true }); driver.MeasureParameters.Add(new GKMeasureParameter { No = 3, Name = "Отсчет задержки на выключение, с", IsDelay = true, IsNotVisible = true }); return driver; }
public static GKDriver Create() { var driver = new GKDriver() { DriverTypeNo = 0x20, DriverType = GKDriverType.RSR2_IOLIT, UID = new Guid("10DCA010-257E-4D81-B090-72903E0CB029"), Name = "ИОЛИТ", ShortName = "ИОЛИТ", HasZone = true, IsPlaceable = true, DriverClassification = GKDriver.DriverClassifications.FireDetector }; GKDriversHelper.AddAvailableStateBits(driver, GKStateBit.Test); GKDriversHelper.AddAvailableStateBits(driver, GKStateBit.Fire1); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.Test); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.Fire1); var property1 = new GKDriverProperty() { No = 0, Name = "Чуствительность", Caption = "Чуствительность", Default = 0, IsLowByte = true, Mask = 0x0F }; GKDriversHelper.AddPropertyParameter(property1, "100%", 0); GKDriversHelper.AddPropertyParameter(property1, "75%", 1); GKDriversHelper.AddPropertyParameter(property1, "50%", 2); GKDriversHelper.AddPropertyParameter(property1, "25%", 3); driver.Properties.Add(property1); var property11 = new GKDriverProperty() { No = 0, Name = "Режим", Caption = "Режим", Default = 0, IsLowByte = true, Mask = 0xF0 }; GKDriversHelper.AddPropertyParameter(property11, "Основной Т1 с фиксац. тревоги", 0); GKDriversHelper.AddPropertyParameter(property11, "Основной Т1 без фиксац. тревоги", 16); GKDriversHelper.AddPropertyParameter(property11, "Основной Т2 с фиксац. тревоги", 32); GKDriversHelper.AddPropertyParameter(property11, "Основной Т2 без фиксац. тревоги", 48); GKDriversHelper.AddPropertyParameter(property11, "Вспышка с интер. 0.1 с", 64); GKDriversHelper.AddPropertyParameter(property11, "Вспышка с интер. 0.5 с", 80); driver.Properties.Add(property11); return driver; }
public static GKDriver Create() { var driver = new GKDriver() { DriverTypeNo = 0x26, DriverType = GKDriverType.RK_OPZ, UID = new Guid("A816B11B-67B9-450D-814E-C5DA393F41C6"), Name = "Оповещатель охранно-пожарный звуковой радиоканальный", ShortName = "ОПЗ-РК", IsControlDevice = true, HasLogic = true, IsPlaceable = true }; driver.AvailableStateBits.Add(GKStateBit.Norm); driver.AvailableStateBits.Add(GKStateBit.Off); driver.AvailableStateBits.Add(GKStateBit.TurningOn); driver.AvailableStateBits.Add(GKStateBit.TurningOff); GKDriversHelper.AddControlAvailableStates(driver); GKDriversHelper.AddAvailableStateBits(driver, GKStateBit.Test); GKDriversHelper.AddAvailableStateBits(driver, GKStateBit.Failure); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.AutoOff); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.On); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.TurningOn); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.Test); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.Failure); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.Off); driver.AvailableCommandBits.Add(GKStateBit.TurnOn_InManual); driver.AvailableCommandBits.Add(GKStateBit.TurnOnNow_InManual); driver.AvailableCommandBits.Add(GKStateBit.TurnOff_InManual); GKDriversHelper.AddRadioChanelProperties(driver); GKDriversHelper.AddIntProprety(driver, 3, "Задержка на включение, с", 0, 0, 65535); GKDriversHelper.AddIntProprety(driver, 4, "Время удержания, с", 0, 0, 65535); var property1 = new GKDriverProperty() { No = 5, Name = "Режим после удержания", Caption = "Режим после удержания", Default = 1, IsLowByte = true, Mask = 0x01 }; GKDriversHelper.AddPropertyParameter(property1, "Выключается", 0); GKDriversHelper.AddPropertyParameter(property1, "Остаётся включённым", 1); driver.Properties.Add(property1); return driver; }
public static GKDriver Create() { var driver = new GKDriver() { DriverTypeNo = 0xE6, DriverType = GKDriverType.RSR2_OPZ, UID = new Guid("24A6FC19-0428-43A9-8B1C-35B748BD202B"), Name = "Оповещатель охранно-пожарный звуковой адресный", ShortName = "ОПЗ", IsControlDevice = true, HasLogic = true, IsPlaceable = true, DriverClassification = GKDriver.DriverClassifications.Announcers }; driver.AvailableStateBits.Add(GKStateBit.Norm); driver.AvailableStateBits.Add(GKStateBit.Off); driver.AvailableStateBits.Add(GKStateBit.TurningOn); driver.AvailableStateBits.Add(GKStateBit.TurningOff); GKDriversHelper.AddControlAvailableStates(driver); GKDriversHelper.AddAvailableStateBits(driver, GKStateBit.Test); GKDriversHelper.AddAvailableStateBits(driver, GKStateBit.Failure); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.AutoOff); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.On); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.TurningOn); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.Test); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.Failure); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.Off); driver.AvailableCommandBits.Add(GKStateBit.TurnOn_InManual); driver.AvailableCommandBits.Add(GKStateBit.TurnOnNow_InManual); driver.AvailableCommandBits.Add(GKStateBit.TurnOff_InManual); GKDriversHelper.AddIntProprety(driver, 0, "Задержка на включение, с", 0, 0, 65535); GKDriversHelper.AddIntProprety(driver, 1, "Время удержания, с", 0, 0, 65535); var property1 = new GKDriverProperty() { No = 2, Name = "Режим после удержания", Caption = "Режим после удержания", Default = 1, IsLowByte = true, Mask = 0x01 }; GKDriversHelper.AddPropertyParameter(property1, "Выключается", 0); GKDriversHelper.AddPropertyParameter(property1, "Остаётся включённым", 1); driver.Properties.Add(property1); return driver; }
public static GKDriverProperty AddIntProprety(GKDriver driver, byte no, string propertyName, int defaultValue, int min, int max) { var property = new GKDriverProperty() { No = no, Name = propertyName, Caption = propertyName, DriverPropertyType = GKDriverPropertyTypeEnum.IntType, Default = (ushort)defaultValue, Min = (ushort)min, Max = (ushort)max, }; driver.Properties.Add(property); return property; }
public static GKDriver Create() { var driver = new GKDriver() { DriverTypeNo = 0x105, DriverType = GKDriverType.GKRele, UID = new Guid("1AC85436-61BC-441B-B6BF-C6A0FA62748B"), Name = "Реле ГК", ShortName = "Реле ГК", IsControlDevice = true, HasLogic = true, HasAddress = false, IsAutoCreate = true, MinAddress = 12, MaxAddress = 16, IsDeviceOnShleif = false, IsPlaceable = true }; driver.AvailableStateBits.Add(GKStateBit.On); driver.AvailableStateBits.Add(GKStateBit.Off); driver.AvailableStateClasses.Add(XStateClass.Norm); driver.AvailableStateClasses.Add(XStateClass.Unknown); driver.AvailableStateClasses.Add(XStateClass.On); driver.AvailableStateClasses.Add(XStateClass.Ignore); driver.AvailableCommandBits.Add(GKStateBit.TurnOn_InManual); driver.AvailableCommandBits.Add(GKStateBit.TurnOff_InManual); var modeProperty = new GKDriverProperty() { No = 0, Name = "Mode", Caption = "Режим работы", ToolTip = "Режим работы реле", Default = 15, DriverPropertyType = GKDriverPropertyTypeEnum.EnumType, IsAUParameter = true }; modeProperty.Parameters.Add(new GKDriverPropertyParameter() { Name = "Выключено", Value = 0 }); modeProperty.Parameters.Add(new GKDriverPropertyParameter() { Name = "Мерцает 0.25 с", Value = 1 }); modeProperty.Parameters.Add(new GKDriverPropertyParameter() { Name = "Мерцает 0.5 с", Value = 3 }); modeProperty.Parameters.Add(new GKDriverPropertyParameter() { Name = "Мерцает 0.75 с", Value = 7 }); modeProperty.Parameters.Add(new GKDriverPropertyParameter() { Name = "Включено", Value = 15 }); driver.Properties.Add(modeProperty); return driver; }
public static GKDriver Create() { var driver = new GKDriver() { DriverTypeNo = 0xEC, DriverType = GKDriverType.RSR2_OPKZ, UID = new Guid("8a277079-341b-4933-beb7-4e34b58199d7"), Name = "Оповещатель звуковой адресный комбинированный", ShortName = "ОПКЗ", IsControlDevice = true, HasLogic = true, IsPlaceable = true, DriverClassification = GKDriver.DriverClassifications.Announcers }; driver.AvailableStateBits.Add(GKStateBit.Norm); driver.AvailableStateBits.Add(GKStateBit.Off); GKDriversHelper.AddControlAvailableStates(driver); GKDriversHelper.AddAvailableStateBits(driver, GKStateBit.Test); GKDriversHelper.AddAvailableStateBits(driver, GKStateBit.Failure); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.AutoOff); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.On); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.Test); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.Failure); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.Off); driver.AvailableCommandBits.Add(GKStateBit.TurnOn_InManual); driver.AvailableCommandBits.Add(GKStateBit.TurnOff_InManual); GKDriversHelper.AddIntProprety(driver, 0, "Время удержания, с", 0, 0, 65535); var property1 = new GKDriverProperty() { No = 1, Name = "Режим после удержания", Caption = "Режим после удержания", Default = 1, IsLowByte = true, Mask = 0x01 }; GKDriversHelper.AddPropertyParameter(property1, "Выключается", 0); GKDriversHelper.AddPropertyParameter(property1, "Остаётся включённым", 1); driver.Properties.Add(property1); return driver; }
public static GKDriver Create() { var driver = new GKDriver() { DriverTypeNo = 0x13, DriverType = GKDriverType.RSR2_ABShS, UID = new Guid("7C464C3A-DDC5-496A-9747-4CA93B774DCA"), Name = "Адресный барьер шлейфа сигнализации", ShortName = "АБШС", HasZone = true, IsPlaceable = true, DriverClassification =GKDriver.DriverClassifications.Other }; GKDriversHelper.AddAvailableStateBits(driver, GKStateBit.Test); GKDriversHelper.AddAvailableStateBits(driver, GKStateBit.Failure); GKDriversHelper.AddAvailableStateBits(driver, GKStateBit.Fire1); GKDriversHelper.AddAvailableStateBits(driver, GKStateBit.Fire2); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.Fire1); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.Fire2); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.Test); var property1 = new GKDriverProperty() { No = 0, Name = "Нагрузка", Caption = "Нагрузка", Default = 0 }; var property1Parameter1 = new GKDriverPropertyParameter() { Name = "Пассивная", Value = 0 }; var property1Parameter2 = new GKDriverPropertyParameter() { Name = "Активная", Value = 1 }; property1.Parameters.Add(property1Parameter1); property1.Parameters.Add(property1Parameter2); driver.Properties.Add(property1); return driver; }
public static GKDriver Create() { var driver = new GKDriver() { DriverTypeNo = 0x103, DriverType = GKDriverType.GKIndicator, UID = new Guid("200EED4B-3402-45B4-8122-AE51A4841E18"), Name = "Индикатор ГК", ShortName = "Индикатор ГК", HasAddress = false, IsAutoCreate = true, MinAddress = 2, MaxAddress = 11, MinAddress2 = 17, MaxAddress2 = 22, IsDeviceOnShleif = false, IsPlaceable = true, }; driver.AvailableStateClasses.Add(XStateClass.Norm); driver.AvailableStateClasses.Add(XStateClass.Unknown); driver.AvailableStateClasses.Add(XStateClass.On); driver.AvailableStateBits.Add(GKStateBit.On); driver.AvailableStateBits.Add(GKStateBit.Off); var modeProperty = new GKDriverProperty() { No = 0, Name = "Mode", Caption = "Режим работы", ToolTip = "Режим работы индикатора", Default = 15, DriverPropertyType = GKDriverPropertyTypeEnum.EnumType, IsAUParameter = true }; modeProperty.Parameters.Add(new GKDriverPropertyParameter() { Name = "Выключено", Value = 0 }); modeProperty.Parameters.Add(new GKDriverPropertyParameter() { Name = "Мерцает 0.25 с", Value = 1 }); modeProperty.Parameters.Add(new GKDriverPropertyParameter() { Name = "Мерцает 0.5 с", Value = 3 }); modeProperty.Parameters.Add(new GKDriverPropertyParameter() { Name = "Мерцает 0.75 с", Value = 7 }); modeProperty.Parameters.Add(new GKDriverPropertyParameter() { Name = "Включено", Value = 15 }); driver.Properties.Add(modeProperty); return driver; }
public EnumPropertyViewModel(GKDriverProperty driverProperty, GKDevice device) : base(driverProperty, device) { var property = device.Properties.FirstOrDefault(x => x.Name == driverProperty.Name); if (property != null) { var driverPropertyParameter = driverProperty.Parameters.FirstOrDefault(x => x.Value == property.Value); if (driverPropertyParameter != null) { SelectedParameter = driverPropertyParameter; } } else { var enumdriverProperty = driverProperty.Parameters.FirstOrDefault(x => x.Value == driverProperty.Default); if (enumdriverProperty != null) SelectedParameter = enumdriverProperty; } }
public static GKDriver Create() { var driver = new GKDriver() { DriverTypeNo = 0xF5, DriverType = GKDriverType.KD_KDK, UID = new Guid("FD24E2EA-B3CF-4F7F-B73A-D60F8749D685"), Name = "Концевик(кнопка) КД", ShortName = "КДК", IsPlaceable = true, IsAutoCreate = true, MinAddress = 2, MaxAddress = 3, }; GKDriversHelper.AddAvailableStateBits(driver, GKStateBit.Fire1); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.Fire1); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.Test); var property1 = new GKDriverProperty() { No = 0, Name = "Конфигурация", Caption = "Конфигурация", Default = 1 }; var property1Parameter1 = new GKDriverPropertyParameter() { Name = "Нормально замкнутый", Value = 0 }; var property1Parameter2 = new GKDriverPropertyParameter() { Name = "Нормально разомкнутый", Value = 1 }; property1.Parameters.Add(property1Parameter1); property1.Parameters.Add(property1Parameter2); driver.Properties.Add(property1); return driver; }
public static GKDriver Create() { var driver = new GKDriver() { DriverTypeNo = 0xE5, DriverType = GKDriverType.RSR2_MVP, UID = new Guid("0B1BD00D-680B-4A80-AC9A-659FD7F85BB4"), Name = "Модель ветвления и подпитки", ShortName = "МВП", IsPlaceable = true, AutoCreateChildren = new List<GKDriverType>() { GKDriverType.RSR2_MVP_Part }, DriverClassification = GKDriver.DriverClassifications.Other }; GKDriversHelper.AddAvailableStateBits(driver, GKStateBit.Test); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.Test); GKDriversHelper.AddIntProprety(driver, 0, "Число АУ на АЛС3 МВП", 0, 0, 250).CanNotEdit = true; GKDriversHelper.AddIntProprety(driver, 1, "Число АУ на АЛС4 МВП", 0, 0, 250).CanNotEdit = true; var property = new GKDriverProperty() { No = 2, Name = "Порог КЗ, В", Caption = "Порог КЗ, В", DriverPropertyType = GKDriverPropertyTypeEnum.IntType, Default = (ushort)330, Min = (ushort)300, Max = (ushort)700, Multiplier = 10 }; driver.Properties.Add(property); driver.MeasureParameters.Add(new GKMeasureParameter() { No = 1, Name = "Напряжение на АЛC1, В", InternalName = "Voltage_1", Multiplier = 10 }); driver.MeasureParameters.Add(new GKMeasureParameter() { No = 2, Name = "Напряжение на АЛС2, В", InternalName = "Voltage_2", Multiplier = 10 }); driver.MeasureParameters.Add(new GKMeasureParameter() { No = 3, Name = "Напряжение на АЛС3, В", InternalName = "Voltage_3", Multiplier = 10 }); driver.MeasureParameters.Add(new GKMeasureParameter() { No = 4, Name = "Напряжение на АЛС4, В", InternalName = "Voltage_4", Multiplier = 10 }); return driver; }
public static GKDriver Create() { var driver = new GKDriver() { DriverTypeNo = 0x03, DriverType = GKDriverType.RSR2_Bush_Fire, UID = new Guid("6C9192C9-2841-46b6-B653-7834EFA41041"), Name = "Прибор пожарный управления Пожарным Насосом", ShortName = "ППУ ПН", IsControlDevice = true, HasLogic = true, IgnoreHasLogic = true, IsPlaceable = true, DriverClassification = GKDriver.DriverClassifications.ControlCabinet }; GKDriversHelper.AddAvailableStateBits(driver, GKStateBit.Off); driver.AvailableStateBits.Add(GKStateBit.TurningOn); driver.AvailableStateBits.Add(GKStateBit.TurningOff); GKDriversHelper.AddControlAvailableStates(driver); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.AutoOff); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.On); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.Off); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.Test); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.TurningOn); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.TurningOff); driver.AvailableCommandBits.Add(GKStateBit.TurnOn_InManual); driver.AvailableCommandBits.Add(GKStateBit.TurnOnNow_InManual); driver.AvailableCommandBits.Add(GKStateBit.TurnOff_InManual); driver.AvailableCommandBits.Add(GKStateBit.TurnOffNow_InManual); GKDriversHelper.AddIntProprety(driver, 0, "Задержка на включение, с", 0, 0, 65535); GKDriversHelper.AddIntProprety(driver, 1, "Задержка на выключение, с", 0, 0, 65535); GKDriversHelper.AddIntProprety(driver, 2, "Питание, В", 80, 0, 100).Multiplier = 10; GKDriversHelper.AddIntProprety(driver, 3, "Порог 1, Ом", 340, 0, 65535); GKDriversHelper.AddIntProprety(driver, 4, "Порог 2, Ом", 1000, 0, 65535); GKDriversHelper.AddIntProprety(driver, 5, "Порог 3, Ом", 2350, 0, 65535); GKDriversHelper.AddIntProprety(driver, 6, "Порог 4, Ом", 3350, 0, 65535); GKDriversHelper.AddIntProprety(driver, 7, "Порог 5, Ом", 4500, 0, 65535); GKDriversHelper.AddIntProprety(driver, 8, "Время выхода на режим, с", 60, 1, 65535); var property90 = new GKDriverProperty() { No = 9, Name = "Состояние давления на выходе", Caption = "Состояние давления на выходе", Default = 0, IsLowByte = true, Mask = 0x01 }; GKDriversHelper.AddPropertyParameter(property90, "Контакт НР", 0); GKDriversHelper.AddPropertyParameter(property90, "Контакт НЗ", 1); driver.Properties.Add(property90); var property91 = new GKDriverProperty() { No = 9, Name = "Состояние ДУ ПУСК", Caption = "Состояние ДУ ПУСК", Default = 0, IsLowByte = true, Mask = 0x02 }; GKDriversHelper.AddPropertyParameter(property91, "Контакт НР", 0); GKDriversHelper.AddPropertyParameter(property91, "Контакт НЗ", 2); driver.Properties.Add(property91); var property92 = new GKDriverProperty() { No = 9, Name = "Состояние ДУ СТОП", Caption = "Состояние ДУ СТОП", Default = 0, IsLowByte = true, Mask = 0x04 }; GKDriversHelper.AddPropertyParameter(property92, "Контакт НР", 0); GKDriversHelper.AddPropertyParameter(property92, "Контакт НЗ", 4); driver.Properties.Add(property92); var property911 = new GKDriverProperty() { No = 9, Name = "Наличие ДУ", Caption = "Наличие ДУ", Default = 0, IsHieghByte = true, Mask = 0x01 }; GKDriversHelper.AddPropertyParameter(property911, "Нет", 0); GKDriversHelper.AddPropertyParameter(property911, "Есть", 0x01); driver.Properties.Add(property911); driver.MeasureParameters.Add(new GKMeasureParameter { No = 1, Name = "Отсчет задержки на включение, с", IsDelay = true, IsNotVisible = true }); driver.MeasureParameters.Add(new GKMeasureParameter { No = 2, Name = "Отсчет задержки на выключение, с", IsDelay = true, IsNotVisible = true }); return driver; }
public StringPropertyViewModel(GKDriverProperty driverProperty, GKDevice device) : base(driverProperty, device) { var property = device.Properties.FirstOrDefault(x => x.Name == driverProperty.Name); _text = property != null ? property.StringValue : driverProperty.StringDefault; }
public static GKDriver Create() { var driver = new GKDriver() { DriverTypeNo = 0xE9, DriverType = GKDriverType.RSR2_CodeCardReader, UID = new Guid("D296DEBC-8993-4798-A2BC-0410FB79E366"), Name = "Наборник кодовый со считывателем", ShortName = "НСЧ", IsControlDevice = true, HasGuardZone = true, HasZone = false, IsPlaceable = true, DriverClassification = GKDriver.DriverClassifications.AccessControl }; driver.AvailableStateBits.Add(GKStateBit.Norm); driver.AvailableStateBits.Add(GKStateBit.Off); driver.AvailableStateBits.Add(GKStateBit.TurningOn); driver.AvailableStateBits.Add(GKStateBit.TurningOff); driver.AvailableStateBits.Add(GKStateBit.Failure); GKDriversHelper.AddControlAvailableStates(driver); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.AutoOff); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.On); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.TurningOn); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.Off); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.Test); GKDriversHelper.AddAvailableStateBits(driver, GKStateBit.Attention); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.Attention); GKDriversHelper.AddAvailableStateBits(driver, GKStateBit.Fire1); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.Fire1); GKDriversHelper.AddAvailableStateBits(driver, GKStateBit.Fire2); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.Fire2); driver.AvailableCommandBits.Add(GKStateBit.TurnOn_InManual); driver.AvailableCommandBits.Add(GKStateBit.TurnOnNow_InManual); driver.AvailableCommandBits.Add(GKStateBit.TurnOff_InManual); driver.AvailableCommandBits.Add(GKStateBit.TurnOffNow_InManual); GKDriversHelper.AddIntProprety(driver, 0, "Задержка на включение, с", 0, 0, 65535); GKDriversHelper.AddIntProprety(driver, 1, "Время удержания на включение, с", 0, 0, 65535); GKDriversHelper.AddIntProprety(driver, 2, "Задержка на выключение, с", 0, 0, 65535); GKDriversHelper.AddIntProprety(driver, 3, "Время удержания на выключение, с", 0, 0, 65535); var property1 = new GKDriverProperty() { No = 4, Name = "Режим после удержания включенного состояния", Caption = "Режим после удержания включенного состояния", Default = 0, IsLowByte = true, Mask = 0x01 }; GKDriversHelper.AddPropertyParameter(property1, "Выключено", 0); GKDriversHelper.AddPropertyParameter(property1, "Включено", 1); driver.Properties.Add(property1); var property2 = new GKDriverProperty() { No = 4, Name = "Наличие реле", Caption = "Наличие реле", Default = 2, IsLowByte = true, Mask = 0x02 }; GKDriversHelper.AddPropertyParameter(property2, "Нет", 0); GKDriversHelper.AddPropertyParameter(property2, "Есть", 2); driver.Properties.Add(property2); var property3 = new GKDriverProperty() { No = 4, Name = "Состояние контакта для режима Выключено", Caption = "Состояние контакта для режима Выключено", Default = 0, IsHieghByte = true, Mask = 0x03 }; GKDriversHelper.AddPropertyParameter(property3, "Контакт НР", 0x00); GKDriversHelper.AddPropertyParameter(property3, "Контакт НЗ", 0x01); GKDriversHelper.AddPropertyParameter(property3, "Контакт переключается", 0x02); driver.Properties.Add(property3); var property4 = new GKDriverProperty() { No = 4, Name = "Состояние контакта для режима Удержания", Caption = "Состояние контакта для режима Удержания", Default = 4, IsHieghByte = true, Mask = 0x0C }; GKDriversHelper.AddPropertyParameter(property4, "Контакт НР", 0x00); GKDriversHelper.AddPropertyParameter(property4, "Контакт НЗ", 0x04); GKDriversHelper.AddPropertyParameter(property4, "Контакт переключается", 0x08); driver.Properties.Add(property4); var property5 = new GKDriverProperty() { No = 4, Name = "Состояние контакта для режима Включено", Caption = "Состояние контакта для режима Включено", Default = 0x10, IsHieghByte = true, Mask = 0x30 }; GKDriversHelper.AddPropertyParameter(property5, "Контакт НР", 0x00); GKDriversHelper.AddPropertyParameter(property5, "Контакт НЗ", 0x10); GKDriversHelper.AddPropertyParameter(property5, "Контакт переключается", 0x20); driver.Properties.Add(property5); GKDriversHelper.AddIntProprety(driver, 5, "Длительность удержания сработки, с", 3, 3, 65535); return driver; }
public static GKDriver Create() { var driver = new GKDriver() { DriverTypeNo = 0xDC, DriverType = GKDriverType.RSR2_MDU, UID = new Guid("1BD3CDB3-7427-4FE8-9B56-22C14C9F5435"), Name = "Модуль автоматики дымоудаления", ShortName = "МДУ220", IsControlDevice = true, HasLogic = true, IsPlaceable = true, DriverClassification = GKDriver.DriverClassifications.ActuatingDevice }; driver.AvailableStateBits.Add(GKStateBit.Norm); driver.AvailableStateBits.Add(GKStateBit.Off); driver.AvailableStateBits.Add(GKStateBit.TurningOn); driver.AvailableStateBits.Add(GKStateBit.TurningOff); driver.AvailableStateBits.Add(GKStateBit.Failure); GKDriversHelper.AddControlAvailableStates(driver); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.AutoOff); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.On); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.Off); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.TurningOn); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.TurningOff); GKDriversHelper.AddAvailableStateBits(driver, GKStateBit.Test); GKDriversHelper.AddAvailableStateClasses(driver, XStateClass.Test); driver.AvailableCommandBits.Add(GKStateBit.TurnOn_InManual); driver.AvailableCommandBits.Add(GKStateBit.TurnOnNow_InManual); driver.AvailableCommandBits.Add(GKStateBit.TurnOff_InManual); driver.AvailableCommandBits.Add(GKStateBit.Stop_InManual); var property1 = new GKDriverProperty() { No = 0, Name = "Задержка на включение, с", Caption = "Задержка на включение, с", Default = 0, DriverPropertyType = GKDriverPropertyTypeEnum.IntType, Min = 0, Max = 65535 }; driver.Properties.Add(property1); var property2 = new GKDriverProperty() { No = 1, Name = "Время включения, с", Caption = "Время включения, с", Default = 128, DriverPropertyType = GKDriverPropertyTypeEnum.IntType, Min = 1, Max = 65535 }; driver.Properties.Add(property2); var property3 = new GKDriverProperty() { No = 2, Name = "Время выключения, с", Caption = "Время выключения, с", Default = 128, DriverPropertyType = GKDriverPropertyTypeEnum.IntType, Min = 1, Max = 65535 }; driver.Properties.Add(property3); var property4 = new GKDriverProperty() { No = 3, Name = "Тип привода", Caption = "Тип привода", Default = 0 }; var property4Parameter1 = new GKDriverPropertyParameter() { Name = "Реверсивный", Value = 0 }; var property4Parameter2 = new GKDriverPropertyParameter() { Name = "Пружинный", Value = 1 }; property4.Parameters.Add(property4Parameter1); property4.Parameters.Add(property4Parameter2); driver.Properties.Add(property4); return driver; }