Пример #1
0
 public static void UpdateAtoGroup(string name, AutoTopOffGroupSettings settings)
 {
     if (CheckAtoGroupKeyNoThrow(name))
     {
         RemoveAtoGroup(name);
     }
     AddAtoGroup(settings);
 }
Пример #2
0
        /***Settings***************************************************************************************************/
        public static AutoTopOffGroupSettings GetAutoTopOffGroupSettings(string name)
        {
            CheckAtoGroupKey(name);
            var settings = new AutoTopOffGroupSettings();

            settings.name                = name;
            settings.enable              = GetAtoGroupEnable(name);
            settings.requestBitName      = GetAtoGroupRequestBitName(name);
            settings.waterLevelGroupName = GetAtoGroupWaterLevelGroupName(name);
            settings.maximumRuntime      = GetAtoGroupMaximumRuntime(name);
            settings.minimumCooldown     = GetAtoGroupMinimumCooldown(name);
            settings.useAnalogSensors    = GetAtoGroupUseAnalogSensor(name);
            settings.analogOnSetpoint    = GetAtoGroupAnalogOnSetpoint(name);
            settings.analogOffSetpoint   = GetAtoGroupAnalogOffSetpoint(name);
            settings.useFloatSwitches    = GetAtoGroupUseFloatSwitches(name);
            return(settings);
        }
Пример #3
0
        /**************************************************************************************************************/
        /* Auto Top Off Groups                                                                                        */
        /**************************************************************************************************************/
        public static void AddAtoGroup(AutoTopOffGroupSettings settings, bool saveToFile = true)
        {
            if (!AtoGroupNameOk(settings.name))
            {
                throw new Exception(string.Format("ATO Group: {0} already exists", settings.name));
            }

            atoGroups[settings.name] = new AutoTopOffGroup(
                settings.name,
                settings.enable,
                settings.requestBitName,
                settings.waterLevelGroupName,
                settings.maximumRuntime,
                settings.minimumCooldown,
                settings.useAnalogSensors,
                settings.analogOnSetpoint,
                settings.analogOffSetpoint,
                settings.useFloatSwitches);

            if (saveToFile)
            {
                AddAutoTopOffGroupSettingsToFile(settings);
            }
        }
Пример #4
0
 protected static void AddAutoTopOffGroupSettingsToFile(AutoTopOffGroupSettings settings)
 {
     SettingsHelper.AddSettingsToArray(settingsFile, settingsArrayName, settings);
 }