From 9d1660270272180cd71147d6ddd53d1382643d2e Mon Sep 17 00:00:00 2001
From: wenxiangchao <wenxiangchao@ihengxin.com.cn>
Date: 星期一, 02 十一月 2026 18:00:14 +0800
Subject: [PATCH] merge: 并入远程 Initial commit 作为历史根节点

---
 Plugin.CurrentSensorControl/BurnInOvenCollection.xaml.cs |   93 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 93 insertions(+), 0 deletions(-)

diff --git a/Plugin.CurrentSensorControl/BurnInOvenCollection.xaml.cs b/Plugin.CurrentSensorControl/BurnInOvenCollection.xaml.cs
new file mode 100644
index 0000000..0273756
--- /dev/null
+++ b/Plugin.CurrentSensorControl/BurnInOvenCollection.xaml.cs
@@ -0,0 +1,93 @@
+锘縰sing HMI.Core.Setting;
+using PLCHelper;
+using Plugin.CurrentSensorControl.Entity;
+using System.Windows.Controls;
+
+namespace Plugin.CurrentSensorControl
+{
+    /// <summary>
+    /// BurnInOvenCollection.xaml 鐨勪氦浜掗�昏緫
+    /// </summary>
+    public partial class BurnInOvenCollection : UserControl
+    {
+        private int rowCount;
+        private int colCount;
+        private int cellCount;
+        private BurnInOven[] ovens;
+        private BaseConfig config;
+
+        public BurnInOvenCollection()
+        {
+            config = BaseConfig.Instance;
+            InitializeComponent();
+            InitMainGrid();
+        }
+
+        public void InitMainGrid()
+        {
+            S7Context.Init(SystemSetting.Instance.PlcIp, SystemSetting.Instance.PlcPort);
+            this.rowCount = config.Row;
+            this.colCount = config.Column;
+            ovens = new BurnInOven[this.rowCount * this.colCount];
+            if (config.CellCount < 0)
+            {
+                this.cellCount = rowCount * colCount;
+            }
+            else
+            {
+                this.cellCount = config.CellCount;
+            }
+            for (int r = 0; r < rowCount; r++)
+            {
+                RowDefinition row = new RowDefinition();
+                mainGrid.RowDefinitions.Add(row);
+            }
+
+            for (int c = 0; c < colCount; c++)
+            {
+                ColumnDefinition col = new ColumnDefinition();
+                mainGrid.ColumnDefinitions.Add(col);
+            }
+            string[] names = config.NameStr.Split(',');
+            for (int n = 0; n < cellCount; n++)
+            {
+                string name = n < names.Length ? names[n] : "";
+                BurnInOven child = new BurnInOven(n);
+                child.Header = name;
+                mainGrid.Children.Add(child);
+                ovens[n] = child;
+                int row = n / colCount;
+                int col = n % colCount;
+                Grid.SetRow(child, row);
+                Grid.SetColumn(child, col);
+            }
+        }
+
+        public void Refresh()
+        {
+            try
+            {
+                for (int i = 0; i < ovens.Length; i++)
+                {
+                    var oven = ovens[i];
+                    oven.Refresh();
+                }
+                //Task[] allTask = new Task[ovens.Length];
+                //for (int i = 0; i < ovens.Length; i++)
+                //{
+                //    var oven = ovens[i];
+                //    var task = Task.Factory.StartNew(() =>
+                //    {
+                //        oven.Refresh();
+                //    });
+                //    allTask[i] = task;
+                //}
+                //Task.WaitAll(allTask);
+            }
+            catch (Exception ex)
+            {
+
+            }
+        }
+    }
+}

--
Gitblit v1.9.1