public Form1() { InitializeComponent(); // MyWSIM = new WaterSimManager_DB(".", "."); SQLServer ServerType = SQLServer.stText; string TheDefaultDatabase = Path.GetDirectoryName(Application.ExecutablePath); MyWSIM = new WaterSimManager_DB(ServerType, ".", ".", TheDefaultDatabase, "", "", "", ""); // MyWSIM = new WaterSimManager_SIO(".", "."); //UnitData TheData = null; //TheData = MyWSIM.TheCRFNetwork.CRFUnitData; // This add some groups for the west data WaterSimDCDC.WestTools.AddWestParameterGroups(MyWSIM); SetupPhrasesAndColors(); foreach (string name in MyWSIM.WaterSimWestModel.UnitModelNames) { DisplaySankeyMenuItem.DropDownItems.Add(name); SanKeyGraphcomboBox.Items.Add(name); } parameterTreeView1.ParameterManager = MyWSIM.ParamManager; // Set al;l Industry to purple, default is red foreach (WaterSimCRFModel WSM in MyWSIM.WaterSimWestModel.WaterSimCRFModels) { WSM.TheCRFNetwork.Industrial.Color = Color.Purple; } // Reset Size of Sankey Graph sankeyGraphUnit.Width = SankeyGraphPanel.Width - 2; sankeyGraphUnit.Invalidate(); Application.DoEvents(); // Ok, reset the graph ResetSanKeyGraphUnit(ModelUnitName); // Create the chart manager MyCM = new ChartManager(chart1, "MyCHart"); // Setup Input Tree treeViewInput.CheckBoxes = true; foreach (int emp in MyWSIM.ParamManager.eModelParameters()) { ModelParameterClass MP = MyWSIM.ParamManager.Model_Parameter(emp); if (MP.isInputParam) { treeViewInput.Nodes.Add(new ParameterTreeNode(MP)); } } // Setup MultiSankey Window MyMultiSankey = new ShowMultipleSankeyV1(MyWSIM); MyMultiSankey.Hide(); //regionTreeViewClass1.WaterSim = MyWSIM; regionTreeViewClass1.WaterSim = MyWSIM; regionTreeViewClass1.CallBackHandler = RegionTreeViewCallback; // LoadParameterDropDown(); }
private void toolStripButton3_Click(object sender, EventArgs e) { if (MyMultiSankey.IsDisposed) { MyMultiSankey = new ShowMultipleSankeyV1(MyWSIM); MyMultiSankey.Show(); } else { MyMultiSankey.Show(); } //MyWSIM.Simulation_Initialize(); //WaterSimModel WSM = MyWSIM.WaterSimWestModel; //WSM.SetUnitValue(4, ref WSM.UrbanWaterConservation, 50); //MyWSIM.Simulation_AllYears(); //MyWSIM.Simulation_Stop(); //sankeyGraphUnit.ResetGraph(); //foreach (WaterSimSankeyForm TF in SankeyForms) //{ // TF.RedrawSankey(); //} }