private void btnConfirm_Click(object sender, EventArgs e) { TreeNode node = this.WDMTree.SelectedNode; if (node == null || node.Level != 1) { MessageBox.Show("请选择机型"); return; } WDMIntegrationModule.Air air = airs[Convert.ToInt32(node.Tag)]; WDMIntegrationModule.TOper[] topers = WDMIntegrationModule.GetOpers(node.Name); //Random r = new Random(); List <WeightData> lstWeightData = new List <WeightData>(); WeightData parentWD = new WeightData(); parentWD.weightName = air.MC; parentWD.nID = 0; parentWD.nParentID = -1; lstWeightData.Add(parentWD); //int i = r.Next(10); double weightValueSum = 0; for (int i = 0; i < topers.Length; i++) { WDMIntegrationModule.TOper toper = topers[i]; if (node.Name == air.ID) { WeightData wd = new WeightData(); wd.weightName = toper.MC; wd.nID = i + 1;// Convert.ToInt32(toper.ID); wd.weightValue = this.actualDataRadio.Checked ? (toper.SCW == 0 && this.useTestData.Checked ? toper.ZTW : toper.SCW) : toper.ZTW; wd.nParentID = 0; // 添加重量数据至重量数据列表 lstWeightData.Add(wd); weightValueSum += wd.weightValue; } } parentWD.weightValue = weightValueSum; WeightSortData wsd = new WeightSortData(); wsd.lstWeightData = lstWeightData; ((WeightAssessmentForm)this.Owner).saveWeightDataGridView(wsd, 2); this.Close(); }
private void btnConfirm_Click(object sender, EventArgs e) { TreeNode node = this.WDMTree.SelectedNode; if (node == null || node.Level != 1) { MessageBox.Show("请选择机型"); return; } WDMIntegrationModule.Air air = airs[Convert.ToInt32(node.Tag)]; WDMIntegrationModule.TStmc[] tstmcs = WDMIntegrationModule.GetStmcs(node.Name); Random r = new Random(); List <CorePointExt> cpdList = new List <CorePointExt>(); //List<WeightData> lstWeightData = new List<WeightData>(); //CorePointExt parentWD = new CorePointExt(); //parentWD.pointName = air.MC; //parentWD. = 0; //parentWD.nParentID = -1; //lstWeightData.Add(parentWD); //int i = r.Next(10); //double weightValueSum = 0; foreach (WDMIntegrationModule.TStmc tstmc in tstmcs) { if (node.Name == air.ID) { CorePointExt cpe = new CorePointExt(); // gridView.Rows[i].Cells[0].Value = cpe.pointName; //gridView.Rows[i].Cells[1].Value = Math.Round(cpe.pointXValue, 6); //gridView.Rows[i].Cells[2].Value = Math.Round(cpe.pointYValue, 6); //WeightData wd = new WeightData(); cpe.pointName = tstmc.MC; cpe.pointYValue = tstmc.ZTW; cpe.pointXValue = (this.actualDataRadio.Checked?tstmc.XCG:tstmc.YCG) * 1000; //wd.nID = r.Next(10);// Convert.ToInt32(toper.ID); //wd.weightValue = this.actualDataRadio.Checked ? // (tstmc.SCW == 0 && this.useTestData.Checked ? // tstmc.ZTW : tstmc.SCW) : tstmc.ZTW; //wd.nParentID = 0; // 添加重量数据至重量数据列表 cpdList.Add(cpe); // weightValueSum += wd.weightValue; } } //parentWD.weightValue = weightValueSum; ((CoreEnvelopeAssessForm)this.Owner).saveCoreGridView(cpdList, "1"); this.Close(); }