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

根据初始化配置,添加流程中的信息

wb_han 5 лет назад
Родитель
Сommit
c5971e4977

+ 27 - 16
HOZProject/UserControls/UCTimeLine.cs

@@ -51,7 +51,6 @@ namespace HOZProject
             set
             {
                 titleFont = value;
-                ReloadItems();
             }
         }
 
@@ -71,7 +70,6 @@ namespace HOZProject
             set
             {
                 titleForcolor = value;
-                ReloadItems();
             }
         }
 
@@ -91,7 +89,6 @@ namespace HOZProject
             set
             {
                 detailsFont = value;
-                ReloadItems();
             }
         }
 
@@ -111,7 +108,6 @@ namespace HOZProject
             set
             {
                 detailsForcolor = value;
-                ReloadItems();
             }
         }
 
@@ -131,13 +127,12 @@ namespace HOZProject
             set
             {
                 items = value;
-                ReloadItems();
             }
         }
         /// <summary>
         /// Initializes a new instance of the <see cref="UCTimeLine"/> class.
         /// </summary>
-        public UCTimeLine(TimeLineItem[] tlItem)
+        public UCTimeLine(TimeLineItem[] tlItem,int measureType)
         {
             this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
             this.SetStyle(ControlStyles.DoubleBuffer, true);
@@ -147,22 +142,15 @@ namespace HOZProject
             this.SetStyle(ControlStyles.UserPaint, true);
             InitializeComponent();
             items = tlItem;
-            //for (int i = 0; i < 4; i++)
-            //{
-            //    items[i] = new TimeLineItem()
-            //    {
-            //        Title = DateTime.Now.AddMonths(-1 * (3 - i)).ToString("yyyy年MM月"),
-            //        Details = DateTime.Now.AddMonths(-1 * (3 - i)).ToString("yyyy年MM月")
-            //    };
-            //}
-            ReloadItems();
+            //加载节点信息
+            ReloadItems(measureType);
 
         }
 
         /// <summary>
         /// Reloads the items.
         /// </summary>
-        public void ReloadItems()
+        public void ReloadItems(int measureType)
         {
             try
             {
@@ -172,6 +160,24 @@ namespace HOZProject
                 {
                     foreach (var item in items)
                     {
+                        switch (measureType)
+                        {
+                            case (int)MeasureMsgManage.measureType.Photo:
+                                if (item.Type.ToUpper() == "PT" || item.Type.ToLower() == "FIB")
+                                {
+                                    continue;
+                                }
+                                break;
+                            case (int)MeasureMsgManage.measureType.Cut:
+                                if (item.Type == "PT")
+                                {
+                                    continue;
+                                }
+                                break;
+                            case (int)MeasureMsgManage.measureType.PT:
+
+                                break;
+                        }
                         FlowLayoutPanel panelTitle = new FlowLayoutPanel();
                         panelTitle.Dock = DockStyle.Top;
                         panelTitle.AutoScroll = false;
@@ -305,5 +311,10 @@ namespace HOZProject
         /// </summary>
         /// <value>The IsData.</value>
         public bool IsData { get; set; }
+        /// <summary>
+        /// Gets or sets the Type.
+        /// </summary>
+        /// <value>The Type.</value>
+        public string Type { get; set; }
     }
 }

+ 1 - 0
HOZProject/UserControls/UControl_Init.Designer.cs

@@ -442,6 +442,7 @@
             this.chkWPT.TabIndex = 77;
             this.chkWPT.Text = "是否使用PT";
             this.chkWPT.UseVisualStyleBackColor = true;
+            this.chkWPT.CheckedChanged += new System.EventHandler(this.chkWPT_CheckedChanged);
             // 
             // btnCreateConfig
             // 

+ 6 - 1
HOZProject/UserControls/UControl_Init.cs

@@ -575,6 +575,7 @@ namespace HOZProject
             {
                 chkWPT.Checked = false;
                 chkWPT.Visible = false;
+                FormHOZMainObject.m_MeasureType = (int)MeasureMsgManage.measureType.Photo;
             }
             else
             {
@@ -582,6 +583,10 @@ namespace HOZProject
             }
         }
         #endregion
-        
+
+        private void chkWPT_CheckedChanged(object sender, EventArgs e)
+        {
+            FormHOZMainObject.m_MeasureType = (int)MeasureMsgManage.measureType.PT;
+        }
     }
 }

+ 4 - 3
HOZProject/UserControls/UControl_ParaInfo.cs

@@ -36,7 +36,6 @@ namespace HOZProject
         private FormHOZMain formHOZMain;
         private TimeLineItem[] tlItem = null;
         private UCTimeLine uCTimeLine=null;
-        private int flowCode = 1;
         public FormHOZMain FormHOZMainObject { get => formHOZMain; set => formHOZMain = value; }
         public string StartTime { get => startTime; set => startTime = value; }
         public string EndTime { get => endTime; set => endTime = value; }
@@ -50,7 +49,8 @@ namespace HOZProject
         {
             InitializeComponent();
             FormHOZMainObject = formHOZ;
-            ShowMeasureFlow("1");
+            //显示测量流程
+            ShowMeasureFlow("3");
         }
 
         private void btnClose_Click(object sender, EventArgs e)
@@ -77,7 +77,7 @@ namespace HOZProject
         {
             if (plTimeLine.Controls.Count == 0)
             {
-                uCTimeLine = new UCTimeLine(tlItem);
+                uCTimeLine = new UCTimeLine(tlItem, FormHOZMainObject.m_MeasureType);
                 uCTimeLine.Dock = DockStyle.Fill;
                 plTimeLine.Controls.Add(uCTimeLine);
             }
@@ -146,6 +146,7 @@ namespace HOZProject
                 tlItem.State = -1;
                 tlItem.Title = nodeList[i].Attributes["Title"].Value;
                 tlItem.IsData = Convert.ToBoolean(nodeList[i].Attributes["IsData"].Value);
+                tlItem.Type = nodeList[i].Attributes["Type"].Value;
                 timeLineItem[i] = tlItem;
             }
             return timeLineItem;