Просмотр исходного кода

处理bug:测量时间不准确
打开文件报错
系统菜单栏-已有样品打开文件时否保存样品提示时取消或关闭窗口会继续打开文件

CXS 4 лет назад
Родитель
Сommit
ecf8ed54f8

+ 6 - 1
OTSIncAMeasureApp/0-OTSModel/DTLBase/CSQLiteQuery.cs

@@ -63,7 +63,12 @@ namespace OTSModelSharp.DTLBase
 
         public string GetColValue(int a_nColIndex)
         {
-            return (string)reader.GetValue(a_nColIndex);
+            string readerValue = "";
+            while (reader.Read())
+            {
+                readerValue = (string)reader.GetValue(a_nColIndex);
+            }
+            return readerValue;
         }
 
         public bool IsColNull(int a_nColIndex)

+ 17 - 4
OTSIncAMeasureApp/0-OTSModel/Measure/GetParamData/COTSMsrPrjResultData.cs

@@ -385,9 +385,16 @@ namespace OTSModelSharp
                 status.SetCompletedFieldsCenter(completedflds);
                 status.SetCompletedFields(completedflds.Count);
                 DateTime timeStart, timeEnd;
-
-                timeStart = Convert.ToDateTime(strTimeStart);
-                timeEnd = Convert.ToDateTime(strTimeEnd);
+                try
+                {
+                    timeStart = Convert.ToDateTime(ConvertFormatOfDateString(strTimeStart)); //此处为兼容之前得测量得结果可以打开,故在此进行数据格式变换
+                    timeEnd = Convert.ToDateTime(ConvertFormatOfDateString(strTimeEnd));
+                }
+                catch
+                {
+                    timeStart = Convert.ToDateTime(strTimeStart); //此处为兼容之前得测量得结果可以打开,故在此进行数据格式变换
+                    timeEnd = Convert.ToDateTime(strTimeEnd);
+                }
                 status.SetStartTime(timeStart);
                 status.SetEndTime(timeEnd);
                 status.SetUsedTime(timeEnd - timeStart);
@@ -420,6 +427,12 @@ namespace OTSModelSharp
             return false;
         }
 
+        string ConvertFormatOfDateString(string Time)
+        {
+            string[] str1 = Time.Split(' ');
+            string[] str2 = str1[0].Split('/');
+            return str2[2] + "/" + str2[1] + "/" + str2[0] +" "+ str1[1];
+        }
 
         public bool Save()
         {
@@ -476,7 +489,7 @@ namespace OTSModelSharp
 
             }
             // get file pathname
-            strPathName = m_strPathName;
+            strPathName = saveFileDialog.FileName;
 
             //保存测量项目文件 .prj
             XmlDocument doc = new XmlDocument();

+ 1 - 1
OTSIncAMeasureApp/0-OTSModel/Measure/GetParticleData/GenInfoDB.cs

@@ -254,7 +254,7 @@ namespace OTSModelSharp
 
             var sNameColumnName = tableInfoPtr.GetColumnName((int)CGenInfoTable.ColumnID.ITEM - (int)CGenInfoTable.ColumnID.MIN);
             String sSQLCommand = "";
-            string.Format("SELECT * FROM \'{0}\' WHERE {1} = \'{2}\'",
+            sSQLCommand=string.Format("SELECT * FROM \'{0}\' WHERE {1} = \'{2}\'",
                 (string)tableInfoPtr.GetTableName(),
                 sNameColumnName,
                 a_sItemName);

+ 2 - 1
OTSIncAMeasureApp/1-OTSMeasure/MeasureCheckResultInfoWindow.cs

@@ -39,7 +39,8 @@ namespace OTSMeasureApp
             //设置颗粒数量
             lblParticleCount.Text = particleCount.ToString();
             //开始与截至时间 相差时间
-            TimeSpan tsSub = MsrUsedTime;
+            //TimeSpan tsSub = MsrUsedTime;   
+            TimeSpan tsSub = TimeSpans(Convert.ToDateTime(beginTime), Convert.ToDateTime(endTime)); //为差值显示例准确,于此计算但数值不一定为真实值并且与domeasure中差值会出现不一致
             //设置测量时间
             string measureTime = string.Empty;
             if (tsSub.Days > 0)

+ 12 - 14
OTSIncAMeasureApp/OTSIncAMeasureAppForm.Designer.cs

@@ -158,7 +158,6 @@
             this.rbMenu.BorderMode = System.Windows.Forms.RibbonWindowMode.InsideWindow;
             this.rbMenu.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F);
             this.rbMenu.Location = new System.Drawing.Point(0, 0);
-            this.rbMenu.Margin = new System.Windows.Forms.Padding(2);
             this.rbMenu.Minimized = true;
             this.rbMenu.Name = "rbMenu";
             // 
@@ -189,7 +188,7 @@
             this.rbMenu.QuickAcessToolbar.Image = null;
             this.rbMenu.QuickAcessToolbar.Tag = null;
             this.rbMenu.QuickAcessToolbar.ToolTipImage = null;
-            this.rbMenu.Size = new System.Drawing.Size(1283, 130);
+            this.rbMenu.Size = new System.Drawing.Size(1924, 130);
             this.rbMenu.TabIndex = 0;
             this.rbMenu.Tabs.Add(this.rbTabHome);
             this.rbMenu.Tabs.Add(this.rbTabView);
@@ -687,11 +686,11 @@
             this.TSGrayVal,
             this.STSemCoordinate,
             this.toolStripStatusLabel1});
-            this.statusStrip1.Location = new System.Drawing.Point(0, 731);
+            this.statusStrip1.Location = new System.Drawing.Point(0, 1010);
             this.statusStrip1.Name = "statusStrip1";
-            this.statusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 9, 0);
+            this.statusStrip1.Padding = new System.Windows.Forms.Padding(2, 0, 14, 0);
             this.statusStrip1.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
-            this.statusStrip1.Size = new System.Drawing.Size(1283, 24);
+            this.statusStrip1.Size = new System.Drawing.Size(1924, 35);
             this.statusStrip1.TabIndex = 2;
             this.statusStrip1.Text = "statusStrip1";
             // 
@@ -699,20 +698,20 @@
             // 
             this.TSGrayVal.BorderSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.Right;
             this.TSGrayVal.Name = "TSGrayVal";
-            this.TSGrayVal.Size = new System.Drawing.Size(50, 19);
+            this.TSGrayVal.Size = new System.Drawing.Size(68, 28);
             this.TSGrayVal.Text = "灰度值";
             // 
             // STSemCoordinate
             // 
             this.STSemCoordinate.BorderSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.Right;
             this.STSemCoordinate.Name = "STSemCoordinate";
-            this.STSemCoordinate.Size = new System.Drawing.Size(60, 19);
+            this.STSemCoordinate.Size = new System.Drawing.Size(88, 28);
             this.STSemCoordinate.Text = "SEM坐标";
             // 
             // toolStripStatusLabel1
             // 
             this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
-            this.toolStripStatusLabel1.Size = new System.Drawing.Size(47, 19);
+            this.toolStripStatusLabel1.Size = new System.Drawing.Size(77, 28);
             this.toolStripStatusLabel1.Text = "IsReady";
             this.toolStripStatusLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
             this.toolStripStatusLabel1.Visible = false;
@@ -725,9 +724,9 @@
             this.dockPanel.Dock = System.Windows.Forms.DockStyle.Fill;
             this.dockPanel.DockBackColor = System.Drawing.SystemColors.Control;
             this.dockPanel.Location = new System.Drawing.Point(0, 130);
-            this.dockPanel.Margin = new System.Windows.Forms.Padding(4);
+            this.dockPanel.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
             this.dockPanel.Name = "dockPanel";
-            this.dockPanel.Size = new System.Drawing.Size(1283, 601);
+            this.dockPanel.Size = new System.Drawing.Size(1924, 880);
             dockPanelGradient1.EndColor = System.Drawing.SystemColors.ControlLight;
             dockPanelGradient1.StartColor = System.Drawing.SystemColors.ControlLight;
             autoHideStripSkin1.DockStripGradient = dockPanelGradient1;
@@ -804,9 +803,9 @@
             // 
             // OTSIncAMeasureAppForm
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1283, 755);
+            this.ClientSize = new System.Drawing.Size(1924, 1045);
             this.Controls.Add(this.dockPanel);
             this.Controls.Add(this.statusStrip1);
             this.Controls.Add(this.rbMenu);
@@ -814,8 +813,7 @@
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
             this.IsMdiContainer = true;
             this.KeyPreview = true;
-            this.Margin = new System.Windows.Forms.Padding(2);
-            this.MinimumSize = new System.Drawing.Size(684, 553);
+            this.MinimumSize = new System.Drawing.Size(1015, 744);
             this.Name = "OTSIncAMeasureAppForm";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
             this.Text = "样品测量程序";

+ 4 - 0
OTSIncAMeasureApp/OTSIncAMeasureAppForm.cs

@@ -1189,6 +1189,10 @@ namespace OTSMeasureApp
                         return;
                     }
                 }
+                else if((int)MessageBoxRev.DIALOG_CANCEL== iRev)
+                {
+                    return;
+                }
             }
 
             bool bOpenFlag=false;