/// <summary> /// 赋值项目数据 /// </summary> private void InitialProjectBasicInfo() { if (Program.currentProject != null) { dt.Clear(); this.DrawerComboBox.ItemsSource = SettingDataBase.ReadCompanyPeople(); this.WriterComboBox.ItemsSource = SettingDataBase.ReadCompanyPeople(); this.CheckerComboBox.ItemsSource = SettingDataBase.ReadCompanyPeople(); this.InspectorComboBox.ItemsSource = SettingDataBase.ReadCompanyPeople(); this.ApproverComboBox.ItemsSource = SettingDataBase.ReadCompanyPeople(); this.FinalApproverComboBox.ItemsSource = SettingDataBase.ReadCompanyPeople(); string prj = Program.currentProject; this.ProjectNameTextBox.Text = prj; this.ProjectProvinceTextBox.Text = ProjectDataBase.ReadProjectProvince(prj); this.ProjectCityTextBox.Text = ProjectDataBase.ReadProjectCity(prj); string[] company = ProjectDataBase.ReadProjectCompany(prj); this.CompanyNameTextBox.Text = company[0]; this.CompanyCodeTextBox.Text = company[1]; this.DrawerComboBox.Text = company[2]; this.WriterComboBox.Text = company[3]; this.CheckerComboBox.Text = company[4]; this.InspectorComboBox.Text = company[5]; this.ApproverComboBox.Text = company[6]; this.FinalApproverComboBox.Text = company[7]; InitialDataTable(ProjectDataBase.ReadLayerNumberList(prj), ProjectDataBase.ReadLayerNameList(prj), ProjectDataBase.ReadLayerGeoList(prj), ProjectDataBase.ReadLayerDescriptionList(prj)); } }
/// <summary> /// 筛选统计数据 /// </summary> /// <param name="_layerNumber">分层编号</param> /// <returns></returns> public static List <StatisticGAT> SelectStatisticData(string _layerNumber) { // 定义统计数据列表 List <StatisticGAT> _statisticList = new List <StatisticGAT>(); // 定义分层分层编号列表、分层岩土名称列表 List <string> layerNumberList = ProjectDataBase.ReadLayerNumberList(Program.currentProject); List <string> layerNameList = ProjectDataBase.ReadLayerNameList(Program.currentProject); // 提取分层岩土名称 string _layerName = ""; for (int i = 0; i < layerNumberList.Count; i++) { if (layerNumberList[i] == _layerNumber) { _layerName = layerNameList[i]; } } // 赋值统计数据列表 List <GrainAnalysisTest> gatList = GrainAnalysisTestDataBase.SelectByZkAndLayer(Program.currentProject, "", _layerNumber); if (gatList.Count > 0) { StatisticGAT statistic = new StatisticGAT(_layerNumber, _layerName, gatList); _statisticList.Add(statistic); } // 返回 return(_statisticList); }
/// <summary> /// 读取统计数据 /// </summary> /// <returns></returns> public static List <StatisticCPT> SelectStatisticData() { // 定义统计数据列表 List <StatisticCPT> statisticList = new List <StatisticCPT>(); // 定义分层分层编号列表、分层岩土名称列表、试验类型列表 List <string> layerNumberList = ProjectDataBase.ReadLayerNumberList(Program.currentProject); List <string> layerNameList = ProjectDataBase.ReadLayerNameList(Program.currentProject); // 在分层编号列表中循环,赋值统计数据列表 for (int i = 0; i < layerNumberList.Count; i++) { // 检查当前的分层编号下,数据库中是否有内容 List <double> psList = CPTDataBase.ReadLayerPs(Program.currentProject, layerNumberList[i]); if (psList.Count > 0) { // 添加一组符合筛选条件的统计数据 StatisticCPT statePs = new StatisticCPT(layerNumberList[i], layerNameList[i], psList, 6); statisticList.Add(statePs); } } // 返回 return(statisticList); }
// 单击菜单"项目"-"编辑当前项目" private void EditProjectMenu_Click(object sender, RoutedEventArgs e) { // 隐藏项目基本信息窗口 foreach (TreeViewItem item in this.ProjectTreeView.Items) { item.IsSelected = false; } // 赋值要传递的参数 string name = Program.currentProject; string province = ProjectDataBase.ReadProjectProvince(name); string city = ProjectDataBase.ReadProjectCity(name); List <string> layerNumberList = ProjectDataBase.ReadLayerNumberList(name); List <string> layerNameList = ProjectDataBase.ReadLayerNameList(name); List <string> layerGeoList = ProjectDataBase.ReadLayerGeoList(name); List <string> layerDescriptionList = ProjectDataBase.ReadLayerDescriptionList(name); string[] company = ProjectDataBase.ReadProjectCompany(name); // 实例化窗口 NewProject editProject = new NewProject(name, province, city, layerNumberList, layerNameList, layerGeoList, layerDescriptionList, company); editProject.ShowDialog(); // 更新项目数据文件 if (editProject.DialogResult == true) { GC.Collect(); GC.WaitForPendingFinalizers(); File.Move(editProject.oldFile, editProject.newFile); } // 重命名窗口 SetProgramText(Program.currentProject); }
/// <summary> /// 初始化各下拉选框 /// </summary> private void InitialComboBox() { List <string> layerNumberlist = ProjectDataBase.ReadLayerNumberList(Program.currentProject); List <string> layerNamelist = ProjectDataBase.ReadLayerNameList(Program.currentProject); List <string> layerlist = new List <string>(); for (int i = 0; i < layerNumberlist.Count; i++) { layerlist.Add(layerNumberlist[i] + " " + layerNamelist[i]); } this.LayerNumberComboBox.ItemsSource = layerlist; }
/// <summary> /// 填充分层选框 /// </summary> private void InitialLayerComboBox() { List <string> layerNumberList = ProjectDataBase.ReadLayerNumberList(Program.currentProject); List <string> layerNameList = ProjectDataBase.ReadLayerNameList(Program.currentProject); List <string> items = new List <string>(); for (int i = 0; i < layerNumberList.Count; i++) { items.Add(layerNumberList[i] + " " + layerNameList[i]); } this.LayerComboBox.ItemsSource = items; this.LayerComboBox.SelectedIndex = 0; }
/// <summary> /// 带1个参数的构造函数,用于新建分层 /// </summary> /// <param name="_lastDepth">上一层层底深度</param> public ZkLayerDetail(double _lastDepth) { InitializeComponent(); // 赋值上一层层底深度 LastDepth = _lastDepth; // 赋值各选框的候选项 this.LayerNumberComboBox.ItemsSource = ProjectDataBase.ReadLayerNumberList(Program.currentProject); this.LayerNameComboBox.ItemsSource = ProjectDataBase.ReadLayerNameList(Program.currentProject); this.LayerGeoComboBox.ItemsSource = ProjectDataBase.ReadLayerGeoList(Program.currentProject); // 定义层底深度输入框的工具提示 DefineToolTip(); }
/// <summary> /// 填充筛选ComboBox函数 /// </summary> private void InitialComboBox() { List <string> zklist = BoreholeDataBase.ReadZkList(Program.currentProject); zklist.Insert(0, "全部钻孔"); List <string> layerNumberlist = ProjectDataBase.ReadLayerNumberList(Program.currentProject); List <string> layerNamelist = ProjectDataBase.ReadLayerNameList(Program.currentProject); List <string> layerlist = new List <string>(); for (int i = 0; i < layerNumberlist.Count; i++) { layerlist.Add(layerNumberlist[i] + " " + layerNamelist[i]); } layerlist.Insert(0, "全部分层"); this.SelectByZkComboBox.ItemsSource = zklist; this.SelectByLayerComboBox.ItemsSource = layerlist; this.SelectByZkComboBox.SelectedIndex = 0; this.SelectByLayerComboBox.SelectedIndex = 0; }
/// <summary> /// 筛选统计数据 /// </summary> /// <returns></returns> public static List <StatisticNTest> SelectStatisticData() { // 定义统计数据列表 List <StatisticNTest> statisticList = new List <StatisticNTest>(); // 定义分层分层编号列表、分层岩土名称列表、试验类型列表 List <string> layerNumberList = ProjectDataBase.ReadLayerNumberList(Program.currentProject); List <string> layerNameList = ProjectDataBase.ReadLayerNameList(Program.currentProject); ZkNTest.ntype[] typeList = new ZkNTest.ntype[] { ZkNTest.ntype.N, ZkNTest.ntype.N10, ZkNTest.ntype.N635, ZkNTest.ntype.N120 }; // 在分层编号列表中循环,赋值统计数据列表 for (int i = 0; i < layerNumberList.Count; i++) { // 在试验类型列表中循环 for (int j = 0; j < typeList.Length; j++) { // 检查当前的分层编号和试验类型的组合下在数据库中是否有内容 List <ZkNTest> nTestList = BoreholeDataBase.ReadLayerNTest(Program.currentProject, layerNumberList[i], typeList[j]); if (nTestList.Count > 0) { // 提取符合条件的标贯/动探列表中的试验数据值 List <double> dataList = new List <double>(); foreach (ZkNTest nTest in nTestList) { dataList.Add(nTest.Value); } // 添加一组符合筛选条件的统计数据 StatisticNTest stateNTest = new StatisticNTest(layerNumberList[i], layerNameList[i], typeList[j], dataList, 6); statisticList.Add(stateNTest); } } } // 返回 return(statisticList); }
/// <summary> /// 带4个参数的构造函数,用于编辑分层 /// </summary> /// <param name="_lastDepth">上一层层底深度</param> /// <param name="_number">分层编号</param> /// <param name="_depth">层底深度</param> /// <param name="_description">分层描述</param> public ZkLayerDetail(double _lastDepth, string _number, double _depth, string _description) { InitializeComponent(); // 重新赋值窗体标题 this.Title = "编辑钻孔分层"; // 赋值上一层层底深度 LastDepth = _lastDepth; // 赋值各选框的候选项 this.LayerNumberComboBox.ItemsSource = ProjectDataBase.ReadLayerNumberList(Program.currentProject); this.LayerNameComboBox.ItemsSource = ProjectDataBase.ReadLayerNameList(Program.currentProject); this.LayerGeoComboBox.ItemsSource = ProjectDataBase.ReadLayerGeoList(Program.currentProject); // 定义层底深度输入框的工具提示 DefineToolTip(); // 赋值 this.LayerNumberComboBox.SelectedValue = _number; this.LayerDepthTextBox.Text = _depth.ToString(); this.LayerDescriptionTextBox.Text = _description; }
/// <summary> /// 读取统计数据 /// </summary> /// <returns></returns> public static List <StatisticGAT> SelectStatisticData() { // 定义统计数据列表 List <StatisticGAT> _statisticList = new List <StatisticGAT>(); // 定义分层分层编号列表、分层岩土名称列表 List <string> layerNumberList = ProjectDataBase.ReadLayerNumberList(Program.currentProject); List <string> layerNameList = ProjectDataBase.ReadLayerNameList(Program.currentProject); // 在分层编号列表中循环,赋值统计数据列表 for (int i = 0; i < layerNumberList.Count; i++) { // 检查当前的分层编号下在数据库中是否有内容,并添加数据到统计列表 List <GrainAnalysisTest> gatList = GrainAnalysisTestDataBase.SelectByZkAndLayer(Program.currentProject, "", layerNumberList[i]); if (gatList.Count > 0) { StatisticGAT statistic = new StatisticGAT(layerNumberList[i], layerNameList[i], gatList); _statisticList.Add(statistic); } } // 返回 return(_statisticList); }
/// <summary> /// 计算统计结果 /// </summary> /// <param name="_dt">从土质类型窗口获取的DataTable</param> /// <param name="_rstStaList">试验指标统计列表</param> /// <param name="_cptStaList">静力触探摩阻力统计列表</param> /// <param name="_ntestStaList">标贯/动探统计列表</param> public static void CalcuOutput(DataTable _dt, List <StatisticRST> _rstStaList, List <StatisticCPT> _cptStaList, List <StatisticNTest> _ntestStaList) { // 清空统计列表结构体 statisticListOutput.Clear(); // 赋值统计结构体列表 for (int i = 0; i < _dt.Rows.Count; i++) { // 更新当前的分层编号和分层名称 LayerNumber = ProjectDataBase.ReadLayerNumberList(Program.currentProject)[i]; LayerName = ProjectDataBase.ReadLayerNameList(Program.currentProject)[i]; // 获取传递的土质参数 StatisticResult.layerInfo = _dt.Rows[i]["layerInfo"].ToString(); StatisticResult.CptType = _dt.Rows[i]["currentCptType"].ToString(); StatisticResult.NTestType = _dt.Rows[i]["currentNTestType"].ToString(); // 根据传递的土质类型重新计算参数 CalcuByRst(_rstStaList); CalcuByCpt(_cptStaList, StatisticResult.CptType); CalcuByNTest(_ntestStaList, StatisticResult.NTestType); // 赋值其他参数 StatisticResult.CptParameter = StatisticResult.CptParameter == "/" ? "/" : StatisticResult.CptParameter.Substring(StatisticResult.CptParameter.IndexOf("=") + 1); StatisticResult.NTestParameter = StatisticResult.NTestParameter == "/" ? "/" : StatisticResult.NTestParameter.Substring(StatisticResult.NTestParameter.IndexOf("=") + 1); double[] tmp = new double[3] { 9999, 9999, 9999 }; double num; if (double.TryParse(StatisticResult.FrictionByRst, out num)) { tmp[0] = num; } if (double.TryParse(StatisticResult.FrictionByCpt, out num)) { tmp[1] = num; } if (double.TryParse(StatisticResult.FrictionByNTest, out num)) { tmp[2] = num; } StatisticResult.FrictionFinal = tmp.Min() < 9999 ? tmp.Min().ToString("0") : "/"; for (int k = 0; k < 3; k++) { tmp[k] = 9999; } if (double.TryParse(StatisticResult.CohesionByRst, out num)) { tmp[0] = num; } if (double.TryParse(StatisticResult.CohesionByCpt, out num)) { tmp[1] = num; } if (double.TryParse(StatisticResult.CohesionByNTest, out num)) { tmp[2] = num; } StatisticResult.CohesionFinal = tmp.Min() < 9999 ? tmp.Min().ToString("0") : "/"; // 添加到列表 statisticListOutput.Add(StatisticResult); } }
/// <summary> /// 筛选统计数据 /// </summary> /// <returns></returns> public static List <StatisticRST> SelectStatisticData() { // 定义统计数据列表 List <StatisticRST> statisticList = new List <StatisticRST>(); // 定义分层编号列表、分层岩土名称列表、试验类型列表 List <string> layerNumberList = ProjectDataBase.ReadLayerNumberList(Program.currentProject); List <string> layerNameList = ProjectDataBase.ReadLayerNameList(Program.currentProject); // 在分层编号列表中循环,赋值统计数据列表 for (int i = 0; i < layerNumberList.Count; i++) { // 层号、岩土名称 string layerNumber = layerNumberList[i]; string layerName = layerNameList[i]; // 读取分层试验数据 List <RoutineSoilTest> rsts = RoutineSoilTestDataBase.SelectByZkAndLayer(Program.currentProject, "", layerNumber); List <double> datalist_waterLevel = new List <double>(); List <double> datalist_density = new List <double>(); List <double> datalist_specificGravity = new List <double>(); List <double> datalist_voidRatio = new List <double>(); List <double> datalist_saturation = new List <double>(); List <double> datalist_liquidLimit = new List <double>(); List <double> datalist_plasticLimit = new List <double>(); List <double> datalist_plasticIndex = new List <double>(); List <double> datalist_liquidityIndex = new List <double>(); List <double> datalist_compressibility = new List <double>(); List <double> datalist_modulus = new List <double>(); List <double> datalist_frictionAngle = new List <double>(); List <double> datalist_cohesion = new List <double>(); List <double> datalist_permeability = new List <double>(); for (int j = 0; j < rsts.Count; j++) { datalist_waterLevel.Add(rsts[j].waterLevel); datalist_density.Add(rsts[j].density); datalist_specificGravity.Add(rsts[j].specificGravity); datalist_voidRatio.Add(rsts[j].voidRatio); datalist_saturation.Add(rsts[j].saturation); datalist_liquidLimit.Add(rsts[j].liquidLimit); datalist_plasticLimit.Add(rsts[j].plasticLimit); datalist_plasticIndex.Add(rsts[j].plasticIndex); datalist_liquidityIndex.Add(rsts[j].liquidityIndex); datalist_compressibility.Add(rsts[j].compressibility); datalist_modulus.Add(rsts[j].modulus); datalist_frictionAngle.Add(rsts[j].frictionAngle); datalist_cohesion.Add(rsts[j].cohesion); datalist_permeability.Add(rsts[j].permeability); } // 赋值统计数据列表 statisticList.Add(new StatisticRST(layerNumber, layerName, typeList[0], datalist_waterLevel, 6)); statisticList.Add(new StatisticRST(layerNumber, layerName, typeList[1], datalist_density, 6)); statisticList.Add(new StatisticRST(layerNumber, layerName, typeList[2], datalist_specificGravity, 6)); statisticList.Add(new StatisticRST(layerNumber, layerName, typeList[3], datalist_voidRatio, 6)); statisticList.Add(new StatisticRST(layerNumber, layerName, typeList[4], datalist_saturation, 6)); statisticList.Add(new StatisticRST(layerNumber, layerName, typeList[5], datalist_liquidLimit, 6)); statisticList.Add(new StatisticRST(layerNumber, layerName, typeList[6], datalist_plasticLimit, 6)); statisticList.Add(new StatisticRST(layerNumber, layerName, typeList[7], datalist_plasticIndex, 6)); statisticList.Add(new StatisticRST(layerNumber, layerName, typeList[8], datalist_liquidityIndex, 6)); statisticList.Add(new StatisticRST(layerNumber, layerName, typeList[9], datalist_compressibility, 6)); statisticList.Add(new StatisticRST(layerNumber, layerName, typeList[10], datalist_modulus, 6)); statisticList.Add(new StatisticRST(layerNumber, layerName, typeList[11], datalist_frictionAngle, 6)); statisticList.Add(new StatisticRST(layerNumber, layerName, typeList[12], datalist_cohesion, 6)); statisticList.Add(new StatisticRST(layerNumber, layerName, typeList[13], datalist_permeability, 6)); } // 返回 return(statisticList); }