Browse Source

处理 bug:程序管理-默认样品台配置编辑不点应用也会保存修改信息
系统菜单栏-保存文件后再另存为文件名处会显示文件路径

CXS 4 years ago
parent
commit
71072832a0

+ 2 - 2
OTSIncAMeasureApp/0-OTSModel/Measure/GetParamData/COTSMsrPrjResultData.cs

@@ -468,7 +468,7 @@ namespace OTSModelSharp
             String strPathName = "";
             // file open dialog
             SaveFileDialog saveFileDialog = new SaveFileDialog();
-            saveFileDialog.FileName = m_strPathName;
+            saveFileDialog.FileName = m_strPathName.Split('\\')[m_strPathName.Split('\\').Length-1];
             saveFileDialog.Filter = "Probject Files (*.prj)|*.prj|All files (*.*)|*.*";
             if (saveFileDialog.ShowDialog() != DialogResult.OK)
             {
@@ -476,7 +476,7 @@ namespace OTSModelSharp
 
             }
             // get file pathname
-            strPathName = saveFileDialog.FileName;
+            strPathName = m_strPathName;
 
             //保存测量项目文件 .prj
             XmlDocument doc = new XmlDocument();

+ 31 - 21
OTSIncAMeasureApp/0-OTSModel/Measure/GetStageInfo/DlgStageMgr.Designer.cs

@@ -49,17 +49,20 @@
             this.groupBox1.Controls.Add(this.m_ctrlBtnApply);
             this.groupBox1.Controls.Add(this.m_ctrlStagePicture);
             this.groupBox1.Controls.Add(this.m_ctrlListBoxStageList);
-            this.groupBox1.Location = new System.Drawing.Point(2, 1);
+            this.groupBox1.Location = new System.Drawing.Point(3, 2);
+            this.groupBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.groupBox1.Name = "groupBox1";
-            this.groupBox1.Size = new System.Drawing.Size(697, 317);
+            this.groupBox1.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.groupBox1.Size = new System.Drawing.Size(1046, 476);
             this.groupBox1.TabIndex = 0;
             this.groupBox1.TabStop = false;
             // 
             // m_ctrlBtnExport
             // 
-            this.m_ctrlBtnExport.Location = new System.Drawing.Point(619, 291);
+            this.m_ctrlBtnExport.Location = new System.Drawing.Point(928, 436);
+            this.m_ctrlBtnExport.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.m_ctrlBtnExport.Name = "m_ctrlBtnExport";
-            this.m_ctrlBtnExport.Size = new System.Drawing.Size(75, 23);
+            this.m_ctrlBtnExport.Size = new System.Drawing.Size(112, 34);
             this.m_ctrlBtnExport.TabIndex = 6;
             this.m_ctrlBtnExport.Text = "导出";
             this.m_ctrlBtnExport.UseVisualStyleBackColor = true;
@@ -67,9 +70,10 @@
             // 
             // IDC_BTN_IMPORT
             // 
-            this.IDC_BTN_IMPORT.Location = new System.Drawing.Point(525, 291);
+            this.IDC_BTN_IMPORT.Location = new System.Drawing.Point(788, 436);
+            this.IDC_BTN_IMPORT.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.IDC_BTN_IMPORT.Name = "IDC_BTN_IMPORT";
-            this.IDC_BTN_IMPORT.Size = new System.Drawing.Size(75, 23);
+            this.IDC_BTN_IMPORT.Size = new System.Drawing.Size(112, 34);
             this.IDC_BTN_IMPORT.TabIndex = 5;
             this.IDC_BTN_IMPORT.Text = "导入";
             this.IDC_BTN_IMPORT.UseVisualStyleBackColor = true;
@@ -77,9 +81,10 @@
             // 
             // m_ctrlBtnRename
             // 
-            this.m_ctrlBtnRename.Location = new System.Drawing.Point(169, 291);
+            this.m_ctrlBtnRename.Location = new System.Drawing.Point(254, 436);
+            this.m_ctrlBtnRename.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.m_ctrlBtnRename.Name = "m_ctrlBtnRename";
-            this.m_ctrlBtnRename.Size = new System.Drawing.Size(75, 23);
+            this.m_ctrlBtnRename.Size = new System.Drawing.Size(112, 34);
             this.m_ctrlBtnRename.TabIndex = 4;
             this.m_ctrlBtnRename.Text = "重命名";
             this.m_ctrlBtnRename.UseVisualStyleBackColor = true;
@@ -87,9 +92,10 @@
             // 
             // m_ctrlBtnDelete
             // 
-            this.m_ctrlBtnDelete.Location = new System.Drawing.Point(87, 291);
+            this.m_ctrlBtnDelete.Location = new System.Drawing.Point(130, 436);
+            this.m_ctrlBtnDelete.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.m_ctrlBtnDelete.Name = "m_ctrlBtnDelete";
-            this.m_ctrlBtnDelete.Size = new System.Drawing.Size(75, 23);
+            this.m_ctrlBtnDelete.Size = new System.Drawing.Size(112, 34);
             this.m_ctrlBtnDelete.TabIndex = 3;
             this.m_ctrlBtnDelete.Text = "删除";
             this.m_ctrlBtnDelete.UseVisualStyleBackColor = true;
@@ -97,9 +103,10 @@
             // 
             // m_ctrlBtnApply
             // 
-            this.m_ctrlBtnApply.Location = new System.Drawing.Point(6, 291);
+            this.m_ctrlBtnApply.Location = new System.Drawing.Point(9, 436);
+            this.m_ctrlBtnApply.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.m_ctrlBtnApply.Name = "m_ctrlBtnApply";
-            this.m_ctrlBtnApply.Size = new System.Drawing.Size(75, 23);
+            this.m_ctrlBtnApply.Size = new System.Drawing.Size(112, 34);
             this.m_ctrlBtnApply.TabIndex = 2;
             this.m_ctrlBtnApply.Text = "应用";
             this.m_ctrlBtnApply.UseVisualStyleBackColor = true;
@@ -108,33 +115,36 @@
             // m_ctrlStagePicture
             // 
             this.m_ctrlStagePicture.BackColor = System.Drawing.Color.White;
-            this.m_ctrlStagePicture.Location = new System.Drawing.Point(316, 17);
+            this.m_ctrlStagePicture.Location = new System.Drawing.Point(474, 26);
+            this.m_ctrlStagePicture.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.m_ctrlStagePicture.Name = "m_ctrlStagePicture";
-            this.m_ctrlStagePicture.Size = new System.Drawing.Size(378, 267);
+            this.m_ctrlStagePicture.Size = new System.Drawing.Size(567, 400);
             this.m_ctrlStagePicture.TabIndex = 1;
             this.m_ctrlStagePicture.TabStop = false;
             // 
             // m_ctrlListBoxStageList
             // 
             this.m_ctrlListBoxStageList.FormattingEnabled = true;
-            this.m_ctrlListBoxStageList.ItemHeight = 12;
-            this.m_ctrlListBoxStageList.Location = new System.Drawing.Point(6, 17);
+            this.m_ctrlListBoxStageList.ItemHeight = 18;
+            this.m_ctrlListBoxStageList.Location = new System.Drawing.Point(9, 26);
+            this.m_ctrlListBoxStageList.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.m_ctrlListBoxStageList.Name = "m_ctrlListBoxStageList";
-            this.m_ctrlListBoxStageList.Size = new System.Drawing.Size(294, 268);
+            this.m_ctrlListBoxStageList.Size = new System.Drawing.Size(439, 400);
             this.m_ctrlListBoxStageList.TabIndex = 0;
             this.m_ctrlListBoxStageList.SelectedValueChanged += new System.EventHandler(this.OnSelchangeListStage);
             // 
             // DlgStageMgr
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(699, 320);
+            this.ClientSize = new System.Drawing.Size(1040, 454);
             this.Controls.Add(this.groupBox1);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
+            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.MaximizeBox = false;
-            this.MaximumSize = new System.Drawing.Size(715, 359);
+            this.MaximumSize = new System.Drawing.Size(1062, 510);
             this.MinimizeBox = false;
-            this.MinimumSize = new System.Drawing.Size(715, 359);
+            this.MinimumSize = new System.Drawing.Size(1062, 510);
             this.Name = "DlgStageMgr";
             this.ShowIcon = false;
             this.ShowInTaskbar = false;

+ 1 - 1
OTSIncAMeasureApp/0-OTSModel/Measure/GetStageInfo/DlgStageMgr.cs

@@ -241,7 +241,7 @@ namespace OTSModelSharp.Measure.GetStageInfo
         void OnSelchangeListStage(object sender, EventArgs e)
         {
             m_nListBoxStageListIndex = m_ctrlListBoxStageList.SelectedIndex;
-            UpdateStageFileData(true);
+            //UpdateStageFileData(true);   为避免关闭界面仍然保存当前选择的样品台,此处注销了
             m_ctrlStagePicture.Refresh();
             DrawStage();
         }

+ 9 - 5
OTSIncAMeasureApp/2-OTSMeasureParamManage/OTSMeasureParam.cs

@@ -173,8 +173,8 @@ namespace OTSMeasureApp
 
        
 
-        //新建样品工作文件
-        public bool CreateNewFile()
+        //新建样品工作文件 0:报错 1:正常 2:取消
+        public int CreateNewFile()
         {
             if (m_ResultData.IsModified())    // 文件被修改
             {
@@ -184,9 +184,13 @@ namespace OTSMeasureApp
                     if (!m_ResultData.Save())
                     {
 
-                        return false;
+                        return 0;
                     }
                 }
+                else if((int)MessageBoxRev.DIALOG_CANCEL == iRev)
+                {
+                    return 2;
+                }
             }
 
             //新建新的工作文件
@@ -200,10 +204,10 @@ namespace OTSMeasureApp
             //m_ProgMgr.SetPackId((int)OTS_SOFT_PACKAGE_ID.OTSIncA);
             if (!this.InitResultData())
             {
-                return false;
+                return 0;
             }
 
-            return true;
+            return 1;
         }
 
 

+ 7 - 1
OTSIncAMeasureApp/OTSIncAMeasureAppForm.cs

@@ -449,12 +449,18 @@ namespace OTSMeasureApp
         //新建样品工作文件
         private void ribbonOrbMenuItem3_CreateWorkspace_Click(object sender, EventArgs e)
         {
+            int iCreateNewFileResult = m_ProjParam.CreateNewFile();
 
-            if (!m_ProjParam.CreateNewFile())
+            if (iCreateNewFileResult == 0)
             {
                 log.Error("(OTSIncAMeasureAppForm.rbNew_CreateWorkspace_Click)  m_DataMgrFun.CreateNewFile() Failed !");
                 return;
             }
+            else if(iCreateNewFileResult == 2)
+            {
+                log.Info("(OTSIncAMeasureAppForm.rbNew_CreateWorkspace_Click)  m_DataMgrFun.CreateNewFile() Cancel !");
+                return;
+            }
             m_RibbonFun.SetAllRibbonButnStatus(true);
             //清除TREEVIEW和GRID上的显示的已经保存的样品信息
             m_SolutionWindows.m_TreeViewBase.DeleteAllTreeNode();