public ConsolidationDevice(DeviceControl.DeviceManagerBase deviceManager, DeviceManagerDeviceSettings settings, PeriodType periodType = PeriodType.Day) : base(deviceManager, settings) { Manufacturer = settings.Manufacturer; Model = settings.Model; //DeviceIdentifier = settings.SerialNo; SourceDevices = new List<DeviceLink>(); PeriodType = periodType; }
public ActiveDevice_Generic(DeviceControl.DeviceManager_ActiveController<Device.ActiveDevice_Generic> deviceManager, DeviceManagerDeviceSettings deviceSettings) : base(deviceManager, deviceSettings, new InverterAlgorithm(deviceSettings, deviceManager.Protocol, deviceManager.ErrorLogger)) { DeviceParams.DeviceType = deviceSettings.DeviceType; DeviceParams.QueryInterval = deviceSettings.QueryIntervalInt; DeviceParams.RecordingInterval = deviceSettings.DBIntervalInt; UseEnergyTotal = true; UseEnergyTotalSet = false; HasStartOfDayEnergyDefect = DeviceSettings.HasStartOfDayEnergyDefect; EstEnergy = new Device.EstimateEnergy(this); ResetDevice(); }
public DeviceAlgorithm(DeviceManagerDeviceSettings deviceSettings, Protocol protocol, ErrorLogger errorLogger) { //DeviceManager = deviceManager; Protocol = protocol; AlgorithmParams aParams; aParams.EndianConverter16Bit = protocol.EndianConverter16Bit; aParams.EndianConverter32Bit = protocol.EndianConverter32Bit; aParams.Protocol = Protocol; aParams.AlgorithmList = deviceSettings.DeviceSettings.AlgorithmList; aParams.BlockList = deviceSettings.DeviceSettings.BlockList; aParams.DeviceName = deviceSettings.Name; aParams.ErrorLogger = errorLogger; DoInitialise(aParams); }
public ActiveDevice_Growatt(DeviceControl.DeviceManager_ActiveController<Device.ActiveDevice_Generic> deviceManager, DeviceManagerDeviceSettings deviceSettings) : base(deviceManager, deviceSettings) { }
public EnergyConsolidationDevice(DeviceControl.DeviceManagerBase deviceManager, DeviceManagerDeviceSettings settings, PeriodType periodType = PeriodType.Day) : base(deviceManager, settings, periodType) { int interval; if (settings.ConsolidationType == ConsolidationType.PVOutput) { PvOutputSiteSettings pvo = GlobalSettings.ApplicationSettings.FindPVOutputBySystemId(settings.PVOutputSystem); if (pvo == null) throw new Exception("EnergyConsolidationDevice - Cannot find PVOutput system - " + settings.PVOutputSystem); interval = pvo.DataIntervalSeconds; } else interval = settings.DBIntervalInt; DeviceParams = new EnergyConsolidationParams(interval); }
public InverterAlgorithm(DeviceManagerDeviceSettings deviceSettings, Protocol protocol, ErrorLogger errorLogger) : base(deviceSettings, protocol, errorLogger) { EnergyMargin = 0.01; HaveErrorRegisters = false; }
private void LoadDetails() { LoadSerialPort(); XmlElement devices = GetElement("devices"); if (devices == null) devices = AddElement(settings, "devices"); deviceList = new ObservableCollection<DeviceManagerDeviceSettings>(); foreach (XmlElement e in devices.ChildNodes) { if (e.Name == "device") { DeviceManagerDeviceSettings device = new DeviceManagerDeviceSettings(ApplicationSettings, e, this); deviceList.Add(device); } } }
public void DeleteDevice(DeviceManagerDeviceSettings delDev) { deviceList.Remove(delDev); XmlElement devices = GetElement("devices"); if (devices == null || delDev == null) return; foreach (XmlNode child in devices.ChildNodes) { if (child.Name == "device") { if (ElementHasChild(child, "address", delDev.Address.ToString()) && ElementHasChild(child, "id", delDev.Id.ToString())) { devices.RemoveChild(child); ApplicationSettings.RefreshAllDevices(); SettingChangedEventHandler(""); return; } } } }
public DeviceManagerDeviceSettings AddDevice() { XmlElement inverters = GetElement("devices"); if (inverters == null) return null; XmlElement e = AddElement(inverters, "device"); DeviceManagerDeviceSettings dev = new DeviceManagerDeviceSettings(ApplicationSettings, e, this); dev.Address = 0; dev.Name = ""; dev.Id = DeviceListItems[0].Id; deviceList.Add(dev); ApplicationSettings.RefreshAllDevices(); return dev; }
public ConsolidateDeviceSettings(ApplicationSettings root, XmlElement element, DeviceManagerDeviceSettings fromDevice) : base(root, element) { ApplicationSettings = root; ConsolidateFromDevice = fromDevice; }
public DeviceEventSettings(ApplicationSettings root, XmlElement element, DeviceManagerDeviceSettings device) : base(root, element) { ApplicationSettings = root; Device = device; if (_EventTypeList == null) { LoadEventTypeNameLists(); DoPropertyChanged("EventTypeList"); } }
internal bool CheckDeviceRecursion(DeviceManagerDeviceSettings device) { if (device == null) return false; if (device.Name == Name) return true; foreach (ConsolidateDeviceSettings consolSettings in device.ConsolidateToDevices) { DeviceManagerDeviceSettings listDevice = consolSettings.ConsolidateFromDevice; if (listDevice != null && listDevice.CheckDeviceRecursion(listDevice)) return true; } return false; }