/// <summary>
        /// 确定事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnConfirm_Click(object sender, EventArgs e)
        {
            string strErroInfo = PageVerification();
            if (strErroInfo != string.Empty)
            {
                XLog.Write(strErroInfo);
                return;
            }

            if (strOperType == "new")
            {
                DesignProjectData projectData = new DesignProjectData();

                projectData.projectName = txtProjectName.Text;
                projectData.projectCreator = txtCreator.Text;
                projectData.strRemark = txtRemark.Text;

                mainForm.BindProjectTreeData(projectData);

                XLog.Write("新建工程成功");
                mainForm.InitializePage("new");
            }
            if (strOperType == "edit")
            {
                mainForm.designProjectData.projectName = txtProjectName.Text;
                mainForm.designProjectData.projectCreator = txtCreator.Text;
                mainForm.designProjectData.strRemark = txtRemark.Text;

                mainForm.BindProjectTreeData(mainForm.designProjectData);

                XLog.Write("编辑工程成功");
                mainForm.InitializePage("edit");
            }
            this.Close();
        }
        public ImportWeightDataListForm(ComputeCorrectionFactorFrm _form, DesignProjectData _designProject, string str_ImportType)
        {
            InitializeComponent();

            form = _form;
            designProject = _designProject;
            strImportType = str_ImportType;
        }
        public ImportWeightDataListForm(ComputeCorrectionFactorFrm _form, DesignProjectData _designProject, string str_ImportType)
        {
            InitializeComponent();

            form          = _form;
            designProject = _designProject;
            strImportType = str_ImportType;
        }
        private void WeightArithmeticManageForm_Load(object sender, EventArgs e)
        {
            treeViewArithmeticList.ImageList = imageListTreeView;

            if (!System.IO.Directory.Exists("weightCategory"))
            {
                MessageBox.Show("不存在 weightCategory 目录!");
                Close();
                return;
            }

            List <Dictionary <string, string> > waItems = GetArithmeticItems();

            TreeNode rootnode1 = treeViewArithmeticList.Nodes.Add("weightCategory", "重量分类", 0, 1);

            List <WeightSortData> wsDataList = WeightSortManageForm.GetListWeightSortData();

            if (wsDataList.Count > 0)
            {
                for (int i = 0; i < wsDataList.Count; ++i)
                {
                    TreeNode subnode = rootnode1.Nodes.Add("weightCategory\\" + wsDataList[i].sortName, wsDataList[i].sortName, 2, 3);

                    foreach (KeyValuePair <string, string> pair in waItems[i])
                    {
                        subnode.Nodes.Add(pair.Value, pair.Key, 4, 5);
                    }
                }
            }
            else
            {
                btnNew.Enabled = false;
            }

            rootnode1.ExpandAll();

            if (mainForm == null)
            {
                return;
            }
            DesignProjectData dpData = mainForm.designProjectData;

            if (dpData == null)
            {
                return;
            }
            if (dpData.lstWeightArithmetic != null)
            {
                TreeNode rootnode2 = treeViewArithmeticList.Nodes.Add("设计结果列表", "设计结果列表", 0, 1);
                foreach (WeightArithmetic wa in dpData.lstWeightArithmetic)
                {
                    TreeNode node = rootnode2.Nodes.Add(wa.DataName, wa.DataName, 4, 5);
                    node.Tag = wa;
                }
                rootnode2.Expand();
            }
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="_form"></param>
        /// <param name="_designProject"></param>
        /// <param name="_grpText"></param>
        /// <param name="btnRefresh">是否显示刷新按钮</param>
        public SelectWeightDataForm(WeightAdjustmentForm _form, DesignProjectData _designProject, string _grpText, bool btnRefresh)
        {
            InitializeComponent();

            this.grpBx_WeightDataList.Text = grpText;
            this.btn_Refresh.Visible = btnRefresh;
            designProject = _designProject;
            grpText = _grpText;
            form = _form;
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="_form"></param>
        /// <param name="_designProject"></param>
        /// <param name="_grpText"></param>
        /// <param name="btnRefresh">是否显示刷新按钮</param>
        public SelectWeightDataForm(WeightAdjustmentForm _form, DesignProjectData _designProject, string _grpText, bool btnRefresh)
        {
            InitializeComponent();

            this.grpBx_WeightDataList.Text = grpText;
            this.btn_Refresh.Visible       = btnRefresh;
            designProject = _designProject;
            grpText       = _grpText;
            form          = _form;
        }
示例#7
0
        /// <summary>
        /// 绑定重量分类数据
        /// </summary>
        public void BindWeightSortData()
        {
            treeViewWeightSort.Nodes.Clear();
            lstWeightSort = GetListWeightSortData();

            TreeNode rootnode1 = treeViewWeightSort.Nodes.Add("重量分类列表", "重量分类列表");

            if (lstWeightSort != null && lstWeightSort.Count > 0)
            {
                foreach (WeightSortData ws in lstWeightSort)
                {
                    TreeNode node = rootnode1.Nodes.Add(ws.sortName, ws.sortName);
                    node.Tag = ws;
                }
                rootnode1.Expand();
            }

            if (mainForm == null)
            {
                return;
            }
            DesignProjectData dpData = mainForm.designProjectData;

            if (dpData == null)
            {
                return;
            }
            if (dpData.lstWeightArithmetic != null)
            {
                TreeNode rootnode2 = treeViewWeightSort.Nodes.Add("设计结果列表", "设计结果列表");
                foreach (WeightArithmetic wa in dpData.lstWeightArithmetic)
                {
                    WeightSortData ws = wa.MakeNewWeightSort(false);
                    lstWeightSortDesignResult.Add(ws);

                    TreeNode node = rootnode2.Nodes.Add(wa.DataName, wa.DataName);
                    node.Tag = ws;
                }
                rootnode2.Expand();
            }
            if (dpData.lstAdjustmentResultData != null)
            {
                TreeNode rootnode3 = treeViewWeightSort.Nodes.Add("调整结果列表", "调整结果列表");
                foreach (WeightAdjustmentResultData wa in dpData.lstAdjustmentResultData)
                {
                    lstWeightSortDesignResult.Add(wa.basicWeightData);

                    TreeNode node = rootnode3.Nodes.Add(wa.WeightAdjustName, wa.WeightAdjustName);
                    node.Tag = wa.basicWeightData;
                }
                rootnode3.Expand();
            }
        }
        public CoreEnvelopeAtithmeticManageForm(MainForm form)
        {
            InitializeComponent();
            mainForm = form;
            WeightParameter.ResetWeightParameterList();

            treeViewArithmeticList.ImageList = imageListTreeView;

            //if (!System.IO.Directory.Exists("CenterofGravityEnvelopeMethod"))
            //{
            //    MessageBox.Show("不存在 CenterofGravityEnvelopeMethod 目录!");
            //    Close();
            //    return;
            //}

            Dictionary <string, string> waItems = GetArithmeticItems();

            TreeNode rootnode1 = treeViewArithmeticList.Nodes.Add("CenterofGravityEnvelopeMethod", "重心包线算法", 0, 1);

            foreach (KeyValuePair <string, string> pair in waItems)
            {
                rootnode1.Nodes.Add(pair.Value, pair.Key, 4, 5);
            }

            rootnode1.ExpandAll();

            if (mainForm == null)
            {
                return;
            }
            DesignProjectData dpData = mainForm.designProjectData;

            if (dpData == null)
            {
                return;
            }
            if (dpData.lstCoreEnvelopeDesign != null)
            {
                TreeNode rootnode2 = treeViewArithmeticList.Nodes.Add("设计结果列表", "设计结果列表", 0, 1);
                foreach (CoreEnvelopeArithmetic wa in dpData.lstCoreEnvelopeDesign)
                {
                    TreeNode node = rootnode2.Nodes.Add(wa.DataName, wa.DataName, 4, 5);
                    node.Tag = wa;
                }
                rootnode2.Expand();
            }
        }
        /// <summary>
        /// 确定事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnConfirm_Click(object sender, EventArgs e)
        {
            string strErroInfo = PageVerification();

            if (strErroInfo != string.Empty)
            {
                XLog.Write(strErroInfo);
                return;
            }

            if (strOperType == "new")
            {
                DesignProjectData projectData = new DesignProjectData();

                projectData.projectName    = txtProjectName.Text;
                projectData.projectCreator = txtCreator.Text;
                projectData.strRemark      = txtRemark.Text;

                mainForm.BindProjectTreeData(projectData);

                XLog.Write("新建工程成功");
                mainForm.InitializePage("new");
            }
            if (strOperType == "edit")
            {
                mainForm.designProjectData.projectName    = txtProjectName.Text;
                mainForm.designProjectData.projectCreator = txtCreator.Text;
                mainForm.designProjectData.strRemark      = txtRemark.Text;

                mainForm.BindProjectTreeData(mainForm.designProjectData);

                XLog.Write("编辑工程成功");
                mainForm.InitializePage("edit");
            }
            this.Close();
        }