فهرست منبع

Group ID is sorted according to the sequence.

cxs 4 هفته پیش
والد
کامیت
9990b6e65c

+ 0 - 38
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/OTSSamplespaceWindow.cs

@@ -562,44 +562,6 @@ namespace OTSMeasureApp
                 PrepareVisualMeasureField(GetWorkingVisualSample());
             }
         }
-        public void DrawRectangleByLengthAndWidth()
-        {
-            frmInitializeLengthAndWidthRectangle frmInput = new frmInitializeLengthAndWidthRectangle();
-            DialogResult result = frmInput.ShowDialog();
-            if (result == DialogResult.OK)
-            {
-                double length = frmInput.length;
-                double wide = frmInput.width;
-                var sam = GetWorkingVisualSample();
-                CMeasureArea area= sam.GetMeasureGDIObject();
-                PointF center = new PointF(area.GetZoomedRegionF().Left + area.GetZoomedRegionF().Width / 2, area.GetZoomedRegionF().Top + area.GetZoomedRegionF().Height / 2);
-                PointF otslt = new PointF(), otsrb = new PointF();
-                PointF lt = new PointF((float)(center.X - m_visualStage.MicronConvertToPixel(length) / 2), (float)(center.Y - m_visualStage.MicronConvertToPixel(wide) / 2));
-                PointF rb = new PointF((float)(center.X + m_visualStage.MicronConvertToPixel(length) / 2), (float)(center.Y + m_visualStage.MicronConvertToPixel(wide) / 2));
-
-                m_visualStage.m_SEMStageData.ConvertSEMToOTSCoord(lt, ref otslt);
-                m_visualStage.m_SEMStageData.ConvertSEMToOTSCoord(rb, ref otsrb);
-
-                var visualRec = m_visualStage.GetCtrlCoordRectF(otslt, otsrb);
-                Color MeasureColor = Color.Red;
-                CMeasureArea newGDI = new CMeasureArea(visualRec, ShapeType.RECTANGLE, "", sam.GetSampleName(), MeasureColor);
-
-                newGDI.SetZoomNumber(m_visualStage.GetZoomNum());
-                newGDI.SetDisplayRefPoint(m_visualStage.GetDisplayRefPoint());
-                newGDI.IsWorkSample = true;
-                sam.SetMeasureGDIObject(newGDI);
-                m_DrawPolygonFinishGDIObject = null;
-                m_DrawMeasureGDIObject = null;
-                var para = m_visualStage.GetSampleMeasurePara(sam.GetMeasureGDIObject());
-
-
-
-
-
-                SetWorkSampleMeasureArea(para);
-                PrepareVisualMeasureField(GetWorkingVisualSample());
-            }
-        }
         public void SetWorkSampleMeasureArea(SampleMeasurePara SMeasurePara)
         {
             COTSSample WSample = m_MeasureAppForm.m_ProjParam.GetResultData().GetWorkingSample();

+ 4 - 4
OTSPartA_STDEditor/BaseClass/STDInfo.cs

@@ -131,11 +131,11 @@ namespace OTSPartA_STDEditor.BaseClass
                     new_data.name = "Default";
                     new_data.color = "#C9C9C9";
                     new_data.iorder = 10000;
-                    GroupDictionary.Add(0, new_data);
-                    if (dt.Select("id='0'").Length == 0)
+                    GroupDictionary.Add(10000, new_data);
+                    if (dt.Select("id='10000'").Length == 0)
                     {
-                        GroupIdDictionaryFromId.Add(0, "Default");
-                        GroupIdDictionaryFromName.Add("Default", 0);
+                        GroupIdDictionaryFromId.Add(10000, "Default");
+                        GroupIdDictionaryFromName.Add("Default", 10000);
                     }
 
                     if (dt.Rows.Count > 0)

+ 13 - 1
OTSPartA_STDEditor/UI/STDRuleslist.cs

@@ -147,18 +147,30 @@ namespace OTSPartA_STDEditor
             m_MainForm._sTDEditor.GroupIdDictionaryFromId.Clear();
             m_MainForm._sTDEditor.GroupIdDictionaryFromName.Clear();
             m_MainForm._sTDEditor.STDDictionary.Clear();
+            m_MainForm._sTDEditor.GroupDictionary.Clear();
             foreach (TreeNode treeNode in treeView_G.Nodes)
             {
                 STDGroups tDGroups = (STDGroups)treeNode.Tag;
-                GroupViewDic[tDGroups.id].iorder = treeNode.Index;
+                if (tDGroups.name != "Default")
+                {
+                    tDGroups.id = treeNode.Index + 1;
+                    tDGroups.iorder = treeNode.Index + 1;
+                }
+                else
+                {
+                    tDGroups.id = 10000;
+                    tDGroups.iorder = 10000;
+                }
                 foreach (TreeNode treeNode1 in treeNode.Nodes)
                 {
                     STDdata Ddata = (STDdata)treeNode1.Tag;
                     Ddata.ListNum = treeNode1.Index.ToString();
+                    Ddata.GroupId = tDGroups.id;
                     m_MainForm._sTDEditor.STDDictionary.Add(Ddata.STDId, Ddata);
                 }
                 m_MainForm._sTDEditor.GroupIdDictionaryFromName.Add(tDGroups.name.ToString(), int.Parse(tDGroups.id.ToString()));
                 m_MainForm._sTDEditor.GroupIdDictionaryFromId.Add(int.Parse(tDGroups.id.ToString()), tDGroups.name.ToString());
+                m_MainForm._sTDEditor.GroupDictionary.Add(tDGroups.id, tDGroups);
             }
         }
         private void ToolStripMenuItem_NewGroup_Click(object sender, EventArgs e)