コード例 #1
0
ファイル: MainView.cs プロジェクト: zimnismoboy34/YmsBms
        private void CreateParallel(List <string> selectedBatteriesGroup1, List <string> selectedBatteriesGroup2)
        {
            IEnumerable <BatteryStatViewModel> vmGroup;
            SeriesStatViewModel group;

            if (selectedBatteriesGroup1.Count > 0)
            {
                vmGroup = SharedData.Default.BatteryPackContainer.Values.Where((vm) => selectedBatteriesGroup1.Contains(vm.Address));
                group   = new SeriesStatViewModel(WindowsFormsSynchronizationContext.Current, "Group1",
                                                  vmGroup);
            }
            else
            {
                vmGroup = SharedData.Default.BatteryPackContainer.Values.Where((vm) => selectedBatteriesGroup2.Contains(vm.Address));
                group   = new SeriesStatViewModel(WindowsFormsSynchronizationContext.Current, "Group2",
                                                  vmGroup);
            }

            group.IsSeries = true;
            group.Address  = "cluster";

            logic.AddCluster(group);
            //SharedData.Default.BatteryPackContainer.TryAdd("cluster", group);

            //var clusterStatisticsView = new ClusterStatistics(group);

            ShowBatteryStat(group.Address, true);
            //this.flowLayoutPanel1.Controls.Clear();
            //this.batteryAddressCtrlMap.Clear();
            //this.flowLayoutPanel1.Controls.Add(clusterStatisticsView);

            AddToTreeView(group.Address, "Cluster", 1);
        }