public SHES(BatteryViewModel bt, UtilityViewModel ut, SolarPanelViewModel sp, ConsumerViewModel cs, eVehicleChargerViewModel ev, ChartViewModel ch) { battery = bt; utility = ut; solar = sp; consumer = cs; vehicle = ev; chart = ch; BatteryManagement(); eVehicleManagement(); }
public SHES(BatteryViewModel batteryViewModel, UtilityViewModel utilityViewModel, SolarPanelViewModel solarPanelViewModel, ConsumersViewModel consumersViewModel) { battery = batteryViewModel; utility = utilityViewModel; solar = solarPanelViewModel; consumers = consumersViewModel; LoadDevices(); BatteryManagement(); createListener(); MakeLog(); }
private void BtnApply_Click(object sender, RoutedEventArgs e) { if (string.IsNullOrEmpty(textBoxSunPower.Text)) { SHES.sunPower = 0; } if (Validate(textBoxSunPower)) { double result = 0; bool uspelo = false; uspelo = double.TryParse(textBoxSunPower.Text, out result); if (uspelo && result >= 0) { //SHES.sunPower = double.Parse(textBoxSunPower.Text); SHES.sunPower = result; new Thread(() => { //while(true) //{ try { SolarPanelViewModel.Refresh(); } catch { } // } }).Start(); } else { MessageBox.Show("Incorrect input", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } } else { MessageBox.Show("Incorrect input", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }