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/BurnInCell.xaml.cs |  189 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 189 insertions(+), 0 deletions(-)

diff --git a/Plugin.CurrentSensorControl/BurnInCell.xaml.cs b/Plugin.CurrentSensorControl/BurnInCell.xaml.cs
new file mode 100644
index 0000000..2d9c3cc
--- /dev/null
+++ b/Plugin.CurrentSensorControl/BurnInCell.xaml.cs
@@ -0,0 +1,189 @@
+锘縰sing CommunityToolkit.Mvvm.ComponentModel;
+using HslCommunication.Profinet.Siemens;
+using PLCHelper;
+using Plugin.CurrentSensorControl.Entity;
+using System.Windows.Controls;
+
+namespace Plugin.CurrentSensorControl
+{
+    /// <summary>
+    /// BurnInOven.xaml 鐨勪氦浜掗�昏緫
+    /// </summary>
+    [ObservableObject]
+    public partial class BurnInCell : UserControl
+    {
+        private BaseConfig config;
+
+        [ObservableProperty]
+        private string header;
+
+        [ObservableProperty]
+        private string req;
+
+        [ObservableProperty]
+        private bool lightOK;
+
+        [ObservableProperty]
+        private bool lightNG;
+
+        private bool powerStatus;
+
+        public bool PowerStatus
+        {
+            get => powerStatus;
+            set
+            {
+                try
+                {
+                    string name = $"Oven{ovenIndex + 1}_Cell{cellIndex + 1}_Power";
+                    if (S7Context.WriteData(api, name, value))
+                    {
+                        powerStatus = value;
+                        OnPropertyChanged(nameof(PowerStatus));
+                    }
+                }
+                catch (Exception ex)
+                {
+
+                }
+            }
+        }
+
+        private bool activationStatus;
+        public bool ActivationStatus
+        {
+            get => activationStatus;
+            set
+            {
+
+                try
+                {
+                    string name = $"Oven{ovenIndex + 1}_Cell{cellIndex + 1}_Activation";
+                    if (S7Context.WriteData(api, name, value))
+                    {
+                        activationStatus = value;
+                        OnPropertyChanged(nameof(ActivationStatus));
+                    }
+                }
+                catch (Exception ex)
+                {
+
+                }
+            }
+        }
+
+        private bool okLightOn;
+        public bool OkLightOn
+        {
+            get => okLightOn;
+            set
+            {
+
+                try
+                {
+                    string name = $"Oven{ovenIndex + 1}_Cell{cellIndex + 1}_Light_OK";
+                    if (S7Context.WriteData(api, name, value))
+                    {
+                        okLightOn = value;
+                        OnPropertyChanged(nameof(OkLightOn));
+                    }
+                }
+                catch (Exception ex)
+                {
+
+                }
+            }
+        }
+
+        private bool ngLightOn;
+        public bool NgLightOn
+        {
+            get => ngLightOn;
+            set
+            {
+
+                try
+                {
+                    string name = $"Oven{ovenIndex + 1}_Cell{cellIndex + 1}_Light_NG";
+                    if (S7Context.WriteData(api, name, value))
+                    {
+                        ngLightOn = value;
+                        OnPropertyChanged(nameof(NgLightOn));
+                    }
+                }
+                catch (Exception ex)
+                {
+
+                }
+            }
+        }
+
+        [ObservableProperty]
+        private string current;
+
+
+
+        [ObservableProperty]
+        private bool? cellStatus;
+
+        private int ovenIndex;
+        private int cellIndex;
+        private SiemensS7Net api;
+
+        public BurnInCell(int ovenIndex, int cellIndex)
+        {
+            this.ovenIndex = ovenIndex;
+            this.cellIndex = cellIndex;
+            this.Header = $"Cell {cellIndex + 1}";
+            DataContext = this;
+            api = S7Context.Get($"1");
+            config = BaseConfig.Instance;
+            InitializeComponent();
+        }
+
+        public void Refresh()
+        {
+            try
+            {
+                string name = $"Oven{ovenIndex + 1}_Cell{cellIndex + 1}_Power";
+                object val; string errMsg;
+                if (S7Context.GetData(api, name, out val))
+                {
+                    powerStatus = (bool)val;
+                    OnPropertyChanged("PowerStatus");
+                }
+
+                name = $"Oven{ovenIndex + 1}_Cell{cellIndex + 1}_Activation";
+                if (S7Context.GetData(api, name, out val))
+                {
+                    activationStatus = (bool)val;
+                    OnPropertyChanged("ActivationStatus");
+                }
+
+                name = $"Oven{ovenIndex + 1}_Cell{cellIndex + 1}_Light_OK";
+                if (S7Context.GetData(api, name, out val))
+                {
+                    okLightOn = (bool)val;
+                    OnPropertyChanged("OkLightOn");
+                }
+
+                name = $"Oven{ovenIndex + 1}_Cell{cellIndex + 1}_Light_NG";
+                if (S7Context.GetData(api, name, out val))
+                {
+                    ngLightOn = (bool)val;
+                    OnPropertyChanged("NgLightOn");
+                }
+
+                name = $"Oven{ovenIndex + 1}_Cell{cellIndex + 1}_Current";
+                if (S7Context.GetData(api, name, out val))
+                {
+                    Current = val.ToString();
+                }
+            }
+            catch (Exception ex)
+            {
+
+            }
+        }
+    }
+}

--
Gitblit v1.9.1