private void Optimization()
        {
            DeviceOptimizationController.Save(_deviceFile, DeviceOptimizations);
            Device2ZoneOptController.DevicesForOptimization = DeviceOptimizations;
            Device2ZoneOptController.StartOptimization(OptimizationType.TwoZone);
            For2ZonesView.Init(Device2ZoneOptController);

            Device3ZoneOptController.DevicesForOptimization = DeviceOptimizations;
            Device3ZoneOptController.StartOptimization(OptimizationType.ThreeZone);
            For3ZonesView.Init(Device3ZoneOptController);
        }
        public void Init(DeviceController deviceController)
        {
            _deviceController = deviceController;
            //DeviceOptimizations = _deviceController.GetDeviceOptimizations();
            DeviceOptimizations =
                DeviceOptimizationController.Read(_deviceFile, _deviceController.Devices);
            _deviceController.DevicesForOptimization = DeviceOptimizations;
            DevicesListBox.ItemsSource = null;
            DevicesListBox.ItemsSource = DeviceOptimizations;
            //DevicesListBox.UpdateLayout();

            Device2ZoneOptController = _deviceController.Copy();
            For2ZonesView.Init(Device2ZoneOptController);

            Device3ZoneOptController = _deviceController.Copy();
            For3ZonesView.Init(Device3ZoneOptController);

            Optimization();
            OptTabControl.SelectedIndex = 1;
        }