Beispiel #1
0
        public static void UpdateWaterLevelGroup(string name, WaterLevelGroupSettings settings)
        {
            if (!CheckWaterLevelGroupKeyNoThrow(name))
            {
                RemoveWaterLevelGroup(name);
            }

            AddWaterLevelGroup(settings);
        }
Beispiel #2
0
        /***Settings***************************************************************************************************/
        public static WaterLevelGroupSettings GetWaterLevelGroupSettings(string name)
        {
            CheckWaterLevelGroupKey(name);
            var settings = new WaterLevelGroupSettings();

            settings.name = name;
            settings.highAnalogAlarmSetpoint = GetWaterLevelGroupHighAnalogAlarmSetpoint(name);
            settings.enableHighAnalogAlarm   = GetWaterLevelGroupHighAnalogAlarmEnable(name);
            settings.lowAnalogAlarmSetpoint  = GetWaterLevelGroupLowAnalogAlarmSetpoint(name);
            settings.enableLowAnalogAlarm    = GetWaterLevelGroupLowAnalogAlarmEnable(name);
            settings.floatSwitches           = GetAllFloatSwitchesForWaterLevelGroup(name);
            settings.waterLevelSensors       = GetAllWaterLevelSensorsForWaterLevelGroup(name);
            return(settings);
        }
Beispiel #3
0
        /**************************************************************************************************************/
        /* Water Level Groups                                                                                         */
        /**************************************************************************************************************/
        public static void AddWaterLevelGroup(WaterLevelGroupSettings settings, bool saveToFile = true)
        {
            if (WaterLevelGroupNameExists(settings.name))
            {
                throw new Exception(string.Format("Water Level Group {0} already exists", settings.name));
            }

            waterLevelGroups[settings.name] = new WaterLevelGroup(
                settings.name,
                settings.highAnalogAlarmSetpoint,
                settings.enableHighAnalogAlarm,
                settings.lowAnalogAlarmSetpoint,
                settings.enableLowAnalogAlarm,
                settings.floatSwitches,
                settings.waterLevelSensors);

            if (saveToFile)
            {
                AddWaterLevelGroupSettingsToFile(settings.name);
            }
        }