Exemplo n.º 1
0
 /// <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));
     }
 }
Exemplo n.º 2
0
        // 单击菜单"项目"-"编辑当前项目"
        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);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 绘制钻孔柱状图函数
        /// </summary>
        /// <param name="_path">输出文件的路径</param>
        /// <param name="_checkedZkList">选中的钻孔列表</param>
        /// <param name="_checkedScaleList">选中的比例尺列表</param>
        public static void OutputToCad(string _path, List <Borehole> _checkedZkList, List <double> _checkedScaleList)
        {
            // 实例化CAD对象
            CAD cad = new CAD();

            // 添加文字样式
            DxfTextStyle style1 = cad.AddStyle("GB2312", "仿宋_GB2312.ttf", 1);
            DxfTextStyle style2 = cad.AddStyle("GB2312_08", "仿宋_GB2312.ttf", 0.8);

            // 循环绘图
            for (int i = 0; i < _checkedZkList.Count; i++)
            {
                cad.DrawZk(i, Program.currentProject, ProjectDataBase.ReadProjectCompany(Program.currentProject), _checkedZkList[i], _checkedScaleList, style1, style2);
            }

            // 保存CAD文件
            cad.SaveAsDwg(_path, 195 * _checkedZkList.Count / 8, 280, 195 * _checkedZkList.Count);
        }