Browse Source

参数模块,修改bug

Linsk 3 months ago
parent
commit
c6dc0090db

+ 37 - 0
Helper/DelFile.cs

@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Helper
+{
+    public static class DelFile
+    {
+
+
+        /// <summary>
+        /// 定期删除文件夹
+        /// </summary>
+        /// <param name="folderPath"></param>
+        /// <param name="saveDay"></param>
+        public static void DeleteFolder(string folderPath, int saveDay)
+        {
+            DateTime nowtime = DateTime.Now; //获取当前时间
+            DirectoryInfo directoryInfo = new DirectoryInfo(folderPath);
+            DirectoryInfo[] directoryInfos = directoryInfo.GetDirectories();
+            foreach (DirectoryInfo dir in directoryInfos)
+            {
+                DeleteFolder(dir.FullName, saveDay);  //递归调用
+            }
+            TimeSpan t = nowtime - directoryInfo.CreationTime;  //当前时间  减去 文件夹创建时间
+            int day = t.Days;
+            if (day > saveDay)   //保存的时间 ;  单位:天
+            {
+                Directory.Delete(folderPath, true);  //删除超过时间的文件夹
+            }
+        }
+
+
+    }
+}

+ 7 - 6
Scada/FormMain.cs

@@ -3,6 +3,7 @@ using BLL.Dto.AuthDto;
 using BLL.Dto.DataDto;
 using BLL.Dto.DataDto;
 using BLL.Dto.UserDto;
 using BLL.Dto.UserDto;
 using BLL.Manager;
 using BLL.Manager;
+using Dm.util;
 using Helper;
 using Helper;
 using HZY.Framework.DependencyInjection;
 using HZY.Framework.DependencyInjection;
 using IoTClient.Clients.PLC;
 using IoTClient.Clients.PLC;
@@ -74,6 +75,10 @@ namespace Scada
 
 
         private void InitOther()
         private void InitOther()
         {
         {
+            if(Globals.SaveDay!="不清理")
+            {
+                DelFile.DeleteFolder(Globals.DelFilePath, Globals.SaveDay.replace("天","").ToInt());
+            }
             Timer.Interval = 1000; // 设置定时器间隔为1秒
             Timer.Interval = 1000; // 设置定时器间隔为1秒
             Timer.Elapsed += Timer_Elapsed;
             Timer.Elapsed += Timer_Elapsed;
             Timer.Start();
             Timer.Start();
@@ -128,9 +133,6 @@ namespace Scada
                             this.led_ProducteState.Blink = true;
                             this.led_ProducteState.Blink = true;
                         }
                         }
 
 
-
-
-
                         //存储数据
                         //存储数据
                         //用反射的方式将Globals.DataDic中对应Globals.SaveList名称的变量值保存到AddDataDto中,然后保存到数据库中
                         //用反射的方式将Globals.DataDic中对应Globals.SaveList名称的变量值保存到AddDataDto中,然后保存到数据库中
                         AddDataDto addDataDto = new AddDataDto();
                         AddDataDto addDataDto = new AddDataDto();
@@ -150,7 +152,6 @@ namespace Scada
                 }
                 }
             }
             }
         }
         }
-
         private List<string> CheckAlarms(List<string> alarmList)
         private List<string> CheckAlarms(List<string> alarmList)
         {
         {
             List<string> alarmInfos = new List<string>();
             List<string> alarmInfos = new List<string>();
@@ -164,7 +165,6 @@ namespace Scada
             }
             }
             return alarmInfos;
             return alarmInfos;
         }
         }
-
         private void InitConfig()
         private void InitConfig()
         {
         {
             //读取PLC配置 192.168.1.180  127.0.0.1
             //读取PLC配置 192.168.1.180  127.0.0.1
@@ -191,7 +191,8 @@ namespace Scada
 
 
             //软件版本
             //软件版本
             Globals.SoftwareVersion = Globals.IniFile.ReadString("软件参数", "软件版本", "V1.0");
             Globals.SoftwareVersion = Globals.IniFile.ReadString("软件参数", "软件版本", "V1.0");
-
+            Globals.DelFilePath = Globals.IniFile.ReadString("系统参数", "删除文件夹路径", Path.Combine(Application.StartupPath, "Logs"));
+            Globals.SaveDay = Globals.IniFile.ReadString("系统参数", "保存文件夹天数", "30天");
             _logger.LogInformation("读取配置文件成功");
             _logger.LogInformation("读取配置文件成功");
         }
         }
         private void InitPlcClient()
         private void InitPlcClient()

+ 2 - 0
Scada/Globals.cs

@@ -49,6 +49,8 @@ namespace Scada
 
 
         public static int SYTime;
         public static int SYTime;
 
 
+        public static string PLCVarAddressPath;
+
         public static string SoftwareVersion;
         public static string SoftwareVersion;
 
 
         public static bool PlcWrite(string varName,dynamic value)
         public static bool PlcWrite(string varName,dynamic value)

+ 9 - 1
Scada/Page/PageAuthManage.cs

@@ -32,7 +32,15 @@ namespace Scada.Page
             await LoadAuthAynsc(SystemEnums.UserRole.访客, cbg_Visitor);
             await LoadAuthAynsc(SystemEnums.UserRole.访客, cbg_Visitor);
             await LoadAuthAynsc(SystemEnums.UserRole.操作员, cbg_Operator);
             await LoadAuthAynsc(SystemEnums.UserRole.操作员, cbg_Operator);
         }
         }
-
+        protected override CreateParams CreateParams
+        {
+            get
+            {
+                CreateParams paras = base.CreateParams;
+                paras.ExStyle |= 0x02000000;
+                return paras;
+            }
+        }
         private async Task LoadAuthAynsc(SystemEnums.UserRole role, UICheckBoxGroup cbg)
         private async Task LoadAuthAynsc(SystemEnums.UserRole role, UICheckBoxGroup cbg)
         {
         {
             var result = await _authManager.GetAuthAsync(new QueryAuthDto() { Role = role.ToString() });
             var result = await _authManager.GetAuthAsync(new QueryAuthDto() { Role = role.ToString() });

+ 1 - 0
Scada/Page/PageChartManage.Designer.cs

@@ -47,6 +47,7 @@
             btn_QueryData.TabIndex = 9;
             btn_QueryData.TabIndex = 9;
             btn_QueryData.Text = "查询数据";
             btn_QueryData.Text = "查询数据";
             btn_QueryData.TipsFont = new Font("宋体", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
             btn_QueryData.TipsFont = new Font("宋体", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
+            btn_QueryData.Click += btn_QueryData_Click;
             // 
             // 
             // dtp_End
             // dtp_End
             // 
             // 

+ 18 - 10
Scada/Page/PageChartManage.cs

@@ -58,7 +58,15 @@ namespace Scada.Page
 
 
             lc_Chart.SetOption(uILineOption);
             lc_Chart.SetOption(uILineOption);
         }
         }
-
+        protected override CreateParams CreateParams
+        {
+            get
+            {
+                CreateParams paras = base.CreateParams;
+                paras.ExStyle |= 0x02000000;
+                return paras;
+            }
+        }
         private void AddSeries(UILineOption uILineOption, string data)
         private void AddSeries(UILineOption uILineOption, string data)
         {
         {
             var series = uILineOption.AddSeries(new UILineSeries(data));
             var series = uILineOption.AddSeries(new UILineSeries(data));
@@ -85,13 +93,12 @@ namespace Scada.Page
                 UIMessageBox.ShowError("开始时间不能大于或等于结束时间");
                 UIMessageBox.ShowError("开始时间不能大于或等于结束时间");
                 return;
                 return;
             }
             }
-
+            ClearUILineData();
             QueryDataDto queryDataDto = new QueryDataDto
             QueryDataDto queryDataDto = new QueryDataDto
             {
             {
                 StartTime = t1,
                 StartTime = t1,
                 EndTime = t2
                 EndTime = t2
             };
             };
-            ClearChartData(lc_Chart.Option);
             var res = await _dataManager.GetDataListByTimeAsync(queryDataDto);
             var res = await _dataManager.GetDataListByTimeAsync(queryDataDto);
             if(res.Result == SystemEnums.Result.Success)
             if(res.Result == SystemEnums.Result.Success)
             {
             {
@@ -116,14 +123,15 @@ namespace Scada.Page
             lc_Chart.Refresh();
             lc_Chart.Refresh();
         }
         }
 
 
-        private void ClearChartData(UILineOption option)
+        private void ClearUILineData()
         {
         {
-            // 清空所有系列的数据点
-            //foreach (var series in option.Series)
-            //{
-            //    var UILineSeries = series.Value;
-                
-            //}
+            lc_Chart.Option.Clear("脱脂喷淋泵压力值");
+            lc_Chart.Option.Clear("脱脂PH值");
+            lc_Chart.Option.Clear("粗洗喷淋泵压力值");
+            lc_Chart.Option.Clear("陶化喷淋泵压力值");
+            lc_Chart.Option.Clear("精洗喷淋泵压力值");
+            lc_Chart.Option.Clear("水分炉测量温度");
+            lc_Chart.Option.Clear("固化炉测量温度");
         }
         }
     }
     }
 }
 }

+ 14 - 0
Scada/Page/PageEquipmentMonitor1.Designer.cs

@@ -74,6 +74,7 @@
             userVarCurrentValue3.BackColor = Color.Transparent;
             userVarCurrentValue3.BackColor = Color.Transparent;
             userVarCurrentValue3.DeviceVarName = "粗洗喷淋泵压力值";
             userVarCurrentValue3.DeviceVarName = "粗洗喷淋泵压力值";
             userVarCurrentValue3.FillColor = Color.Transparent;
             userVarCurrentValue3.FillColor = Color.Transparent;
+            userVarCurrentValue3.FillColor2 = Color.Transparent;
             userVarCurrentValue3.Font = new Font("宋体", 12F, FontStyle.Regular, GraphicsUnit.Point, 134);
             userVarCurrentValue3.Font = new Font("宋体", 12F, FontStyle.Regular, GraphicsUnit.Point, 134);
             userVarCurrentValue3.Location = new Point(43, 111);
             userVarCurrentValue3.Location = new Point(43, 111);
             userVarCurrentValue3.MinimumSize = new Size(1, 1);
             userVarCurrentValue3.MinimumSize = new Size(1, 1);
@@ -124,11 +125,13 @@
             userDeviceState3.BackColor = Color.Transparent;
             userDeviceState3.BackColor = Color.Transparent;
             userDeviceState3.DeviceRunName = "粗洗喷淋泵运行状态";
             userDeviceState3.DeviceRunName = "粗洗喷淋泵运行状态";
             userDeviceState3.FillColor = Color.Transparent;
             userDeviceState3.FillColor = Color.Transparent;
+            userDeviceState3.FillColor2 = Color.Transparent;
             userDeviceState3.Font = new Font("宋体", 12F, FontStyle.Regular, GraphicsUnit.Point, 134);
             userDeviceState3.Font = new Font("宋体", 12F, FontStyle.Regular, GraphicsUnit.Point, 134);
             userDeviceState3.Location = new Point(8, 55);
             userDeviceState3.Location = new Point(8, 55);
             userDeviceState3.MinimumSize = new Size(1, 1);
             userDeviceState3.MinimumSize = new Size(1, 1);
             userDeviceState3.Name = "userDeviceState3";
             userDeviceState3.Name = "userDeviceState3";
             userDeviceState3.RectColor = Color.Transparent;
             userDeviceState3.RectColor = Color.Transparent;
+            userDeviceState3.RectDisableColor = Color.Transparent;
             userDeviceState3.Size = new Size(316, 50);
             userDeviceState3.Size = new Size(316, 50);
             userDeviceState3.State = false;
             userDeviceState3.State = false;
             userDeviceState3.TabIndex = 1;
             userDeviceState3.TabIndex = 1;
@@ -159,6 +162,7 @@
             userVarCurrentValue5.BackColor = Color.Transparent;
             userVarCurrentValue5.BackColor = Color.Transparent;
             userVarCurrentValue5.DeviceVarName = "陶化喷淋泵压力值";
             userVarCurrentValue5.DeviceVarName = "陶化喷淋泵压力值";
             userVarCurrentValue5.FillColor = Color.Transparent;
             userVarCurrentValue5.FillColor = Color.Transparent;
+            userVarCurrentValue5.FillColor2 = Color.Transparent;
             userVarCurrentValue5.Font = new Font("宋体", 12F, FontStyle.Regular, GraphicsUnit.Point, 134);
             userVarCurrentValue5.Font = new Font("宋体", 12F, FontStyle.Regular, GraphicsUnit.Point, 134);
             userVarCurrentValue5.Location = new Point(43, 116);
             userVarCurrentValue5.Location = new Point(43, 116);
             userVarCurrentValue5.MinimumSize = new Size(1, 1);
             userVarCurrentValue5.MinimumSize = new Size(1, 1);
@@ -177,6 +181,7 @@
             userVarCurrentValue4.BackColor = Color.Transparent;
             userVarCurrentValue4.BackColor = Color.Transparent;
             userVarCurrentValue4.DeviceVarName = "陶化PH值";
             userVarCurrentValue4.DeviceVarName = "陶化PH值";
             userVarCurrentValue4.FillColor = Color.Transparent;
             userVarCurrentValue4.FillColor = Color.Transparent;
+            userVarCurrentValue4.FillColor2 = Color.Transparent;
             userVarCurrentValue4.Font = new Font("宋体", 12F, FontStyle.Regular, GraphicsUnit.Point, 134);
             userVarCurrentValue4.Font = new Font("宋体", 12F, FontStyle.Regular, GraphicsUnit.Point, 134);
             userVarCurrentValue4.Location = new Point(576, 116);
             userVarCurrentValue4.Location = new Point(576, 116);
             userVarCurrentValue4.MinimumSize = new Size(1, 1);
             userVarCurrentValue4.MinimumSize = new Size(1, 1);
@@ -227,11 +232,13 @@
             userDeviceState4.BackColor = Color.Transparent;
             userDeviceState4.BackColor = Color.Transparent;
             userDeviceState4.DeviceRunName = "陶化喷淋泵运行状态";
             userDeviceState4.DeviceRunName = "陶化喷淋泵运行状态";
             userDeviceState4.FillColor = Color.Transparent;
             userDeviceState4.FillColor = Color.Transparent;
+            userDeviceState4.FillColor2 = Color.Transparent;
             userDeviceState4.Font = new Font("宋体", 12F, FontStyle.Regular, GraphicsUnit.Point, 134);
             userDeviceState4.Font = new Font("宋体", 12F, FontStyle.Regular, GraphicsUnit.Point, 134);
             userDeviceState4.Location = new Point(8, 63);
             userDeviceState4.Location = new Point(8, 63);
             userDeviceState4.MinimumSize = new Size(1, 1);
             userDeviceState4.MinimumSize = new Size(1, 1);
             userDeviceState4.Name = "userDeviceState4";
             userDeviceState4.Name = "userDeviceState4";
             userDeviceState4.RectColor = Color.Transparent;
             userDeviceState4.RectColor = Color.Transparent;
+            userDeviceState4.RectDisableColor = Color.Transparent;
             userDeviceState4.Size = new Size(316, 50);
             userDeviceState4.Size = new Size(316, 50);
             userDeviceState4.State = false;
             userDeviceState4.State = false;
             userDeviceState4.TabIndex = 5;
             userDeviceState4.TabIndex = 5;
@@ -244,11 +251,13 @@
             userDeviceState1.BackColor = Color.Transparent;
             userDeviceState1.BackColor = Color.Transparent;
             userDeviceState1.DeviceRunName = "脱脂喷淋泵运行状态";
             userDeviceState1.DeviceRunName = "脱脂喷淋泵运行状态";
             userDeviceState1.FillColor = Color.Transparent;
             userDeviceState1.FillColor = Color.Transparent;
+            userDeviceState1.FillColor2 = Color.Transparent;
             userDeviceState1.Font = new Font("宋体", 12F, FontStyle.Regular, GraphicsUnit.Point, 134);
             userDeviceState1.Font = new Font("宋体", 12F, FontStyle.Regular, GraphicsUnit.Point, 134);
             userDeviceState1.Location = new Point(8, 45);
             userDeviceState1.Location = new Point(8, 45);
             userDeviceState1.MinimumSize = new Size(1, 1);
             userDeviceState1.MinimumSize = new Size(1, 1);
             userDeviceState1.Name = "userDeviceState1";
             userDeviceState1.Name = "userDeviceState1";
             userDeviceState1.RectColor = Color.Transparent;
             userDeviceState1.RectColor = Color.Transparent;
+            userDeviceState1.RectDisableColor = Color.Transparent;
             userDeviceState1.Size = new Size(316, 50);
             userDeviceState1.Size = new Size(316, 50);
             userDeviceState1.State = false;
             userDeviceState1.State = false;
             userDeviceState1.TabIndex = 0;
             userDeviceState1.TabIndex = 0;
@@ -261,11 +270,13 @@
             userDeviceState2.BackColor = Color.Transparent;
             userDeviceState2.BackColor = Color.Transparent;
             userDeviceState2.DeviceRunName = "脱脂排风机运行状态";
             userDeviceState2.DeviceRunName = "脱脂排风机运行状态";
             userDeviceState2.FillColor = Color.Transparent;
             userDeviceState2.FillColor = Color.Transparent;
+            userDeviceState2.FillColor2 = Color.Transparent;
             userDeviceState2.Font = new Font("宋体", 12F, FontStyle.Regular, GraphicsUnit.Point, 134);
             userDeviceState2.Font = new Font("宋体", 12F, FontStyle.Regular, GraphicsUnit.Point, 134);
             userDeviceState2.Location = new Point(357, 45);
             userDeviceState2.Location = new Point(357, 45);
             userDeviceState2.MinimumSize = new Size(1, 1);
             userDeviceState2.MinimumSize = new Size(1, 1);
             userDeviceState2.Name = "userDeviceState2";
             userDeviceState2.Name = "userDeviceState2";
             userDeviceState2.RectColor = Color.Transparent;
             userDeviceState2.RectColor = Color.Transparent;
+            userDeviceState2.RectDisableColor = Color.Transparent;
             userDeviceState2.Size = new Size(316, 50);
             userDeviceState2.Size = new Size(316, 50);
             userDeviceState2.State = false;
             userDeviceState2.State = false;
             userDeviceState2.TabIndex = 1;
             userDeviceState2.TabIndex = 1;
@@ -277,6 +288,7 @@
             // 
             // 
             userAlarmState1.DeviceName = "脱脂低液位报警";
             userAlarmState1.DeviceName = "脱脂低液位报警";
             userAlarmState1.FillColor = Color.Transparent;
             userAlarmState1.FillColor = Color.Transparent;
+            userAlarmState1.FillColor2 = Color.Transparent;
             userAlarmState1.Font = new Font("宋体", 12F, FontStyle.Regular, GraphicsUnit.Point, 134);
             userAlarmState1.Font = new Font("宋体", 12F, FontStyle.Regular, GraphicsUnit.Point, 134);
             userAlarmState1.Location = new Point(704, 45);
             userAlarmState1.Location = new Point(704, 45);
             userAlarmState1.MinimumSize = new Size(1, 1);
             userAlarmState1.MinimumSize = new Size(1, 1);
@@ -294,6 +306,7 @@
             userVarCurrentValue1.BackColor = Color.Transparent;
             userVarCurrentValue1.BackColor = Color.Transparent;
             userVarCurrentValue1.DeviceVarName = "脱脂喷淋泵压力值";
             userVarCurrentValue1.DeviceVarName = "脱脂喷淋泵压力值";
             userVarCurrentValue1.FillColor = Color.Transparent;
             userVarCurrentValue1.FillColor = Color.Transparent;
+            userVarCurrentValue1.FillColor2 = Color.Transparent;
             userVarCurrentValue1.Font = new Font("宋体", 12F, FontStyle.Regular, GraphicsUnit.Point, 134);
             userVarCurrentValue1.Font = new Font("宋体", 12F, FontStyle.Regular, GraphicsUnit.Point, 134);
             userVarCurrentValue1.Location = new Point(43, 101);
             userVarCurrentValue1.Location = new Point(43, 101);
             userVarCurrentValue1.MinimumSize = new Size(1, 1);
             userVarCurrentValue1.MinimumSize = new Size(1, 1);
@@ -330,6 +343,7 @@
             userVarCurrentValue2.BackColor = Color.Transparent;
             userVarCurrentValue2.BackColor = Color.Transparent;
             userVarCurrentValue2.DeviceVarName = "脱脂PH值";
             userVarCurrentValue2.DeviceVarName = "脱脂PH值";
             userVarCurrentValue2.FillColor = Color.Transparent;
             userVarCurrentValue2.FillColor = Color.Transparent;
+            userVarCurrentValue2.FillColor2 = Color.Transparent;
             userVarCurrentValue2.Font = new Font("宋体", 12F, FontStyle.Regular, GraphicsUnit.Point, 134);
             userVarCurrentValue2.Font = new Font("宋体", 12F, FontStyle.Regular, GraphicsUnit.Point, 134);
             userVarCurrentValue2.Location = new Point(533, 101);
             userVarCurrentValue2.Location = new Point(533, 101);
             userVarCurrentValue2.MinimumSize = new Size(1, 1);
             userVarCurrentValue2.MinimumSize = new Size(1, 1);

+ 9 - 1
Scada/Page/PageEquipmentMonitor1.cs

@@ -23,7 +23,15 @@ namespace Scada.Page
             this.timer1.Tick += Timer1_Tick;
             this.timer1.Tick += Timer1_Tick;
             this.timer1.Start();
             this.timer1.Start();
         }
         }
-
+        protected override CreateParams CreateParams
+        {
+            get
+            {
+                CreateParams paras = base.CreateParams;
+                paras.ExStyle |= 0x02000000;
+                return paras;
+            }
+        }
         private void Timer1_Tick(object? sender, EventArgs e)
         private void Timer1_Tick(object? sender, EventArgs e)
         {
         {
             if (Globals.SiemensClient.Connected)
             if (Globals.SiemensClient.Connected)

+ 9 - 1
Scada/Page/PageEquipmentMonitor2.cs

@@ -24,7 +24,15 @@ namespace Scada
             this.timer1.Start();
             this.timer1.Start();
 
 
         }
         }
-
+        protected override CreateParams CreateParams
+        {
+            get
+            {
+                CreateParams paras = base.CreateParams;
+                paras.ExStyle |= 0x02000000;
+                return paras;
+            }
+        }
         private void Timer1_Tick(object? sender, EventArgs e)
         private void Timer1_Tick(object? sender, EventArgs e)
         {
         {
             if (Globals.SiemensClient.Connected)
             if (Globals.SiemensClient.Connected)

+ 9 - 1
Scada/Page/PageEquipmentMonitor3.cs

@@ -23,7 +23,15 @@ namespace Scada.Page
             this.timer1.Tick += Timer1_Tick;
             this.timer1.Tick += Timer1_Tick;
             this.timer1.Start();
             this.timer1.Start();
         }
         }
-
+        protected override CreateParams CreateParams
+        {
+            get
+            {
+                CreateParams paras = base.CreateParams;
+                paras.ExStyle |= 0x02000000;
+                return paras;
+            }
+        }
         private void Timer1_Tick(object? sender, EventArgs e)
         private void Timer1_Tick(object? sender, EventArgs e)
         {
         {
 
 

+ 13 - 1
Scada/Page/PageLogManage.cs

@@ -18,6 +18,7 @@ namespace Scada.Page
 {
 {
     public partial class PageLogManage : UIPage, ISingletonSelfDependency
     public partial class PageLogManage : UIPage, ISingletonSelfDependency
     {
     {
+        
         public PageLogManage()
         public PageLogManage()
         {
         {
             InitializeComponent();
             InitializeComponent();
@@ -112,10 +113,12 @@ namespace Scada.Page
 
 
                 this.txt_ShowLog.Text = "";
                 this.txt_ShowLog.Text = "";
 
 
-                using (StreamReader sr = new StreamReader(logPath, Encoding.UTF8))
+                using (FileStream fs = new FileStream(logPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
+                using (StreamReader sr = new StreamReader(fs, Encoding.UTF8))
                 {
                 {
                     content = await sr.ReadToEndAsync();
                     content = await sr.ReadToEndAsync();
                 }
                 }
+                
                 this.txt_ShowLog.Text = content;
                 this.txt_ShowLog.Text = content;
             }
             }
             catch (Exception ex)
             catch (Exception ex)
@@ -174,6 +177,15 @@ namespace Scada.Page
             this.dgv_ShowLog.DataSource = dt;
             this.dgv_ShowLog.DataSource = dt;
             this.dgv_ShowLog.Columns["日志内容"].Width = 500; // 设置日志内容列的宽度
             this.dgv_ShowLog.Columns["日志内容"].Width = 500; // 设置日志内容列的宽度
         }
         }
+        protected override CreateParams CreateParams
+        {
+            get
+            {
+                CreateParams paras = base.CreateParams;
+                paras.ExStyle |= 0x02000000;
+                return paras;
+            }
+        }
 
 
         private void btn_ShowToTXT_Click(object sender, EventArgs e)
         private void btn_ShowToTXT_Click(object sender, EventArgs e)
         {
         {

+ 9 - 1
Scada/Page/PageRecipeManage.cs

@@ -30,7 +30,15 @@ namespace Scada.Page
             dgv_Recipe.AutoGenerateColumns = false;
             dgv_Recipe.AutoGenerateColumns = false;
             this.Load += PageRecipeManage_Load;
             this.Load += PageRecipeManage_Load;
         }
         }
-
+        protected override CreateParams CreateParams
+        {
+            get
+            {
+                CreateParams paras = base.CreateParams;
+                paras.ExStyle |= 0x02000000;
+                return paras;
+            }
+        }
         private async void PageRecipeManage_Load(object sender, EventArgs e)
         private async void PageRecipeManage_Load(object sender, EventArgs e)
         {
         {
             await LoadRecipe();
             await LoadRecipe();

+ 9 - 1
Scada/Page/PageReportManage.cs

@@ -30,7 +30,15 @@ namespace Scada.Page
 
 
             this.dgv_Data.AutoGenerateColumns = false;
             this.dgv_Data.AutoGenerateColumns = false;
         }
         }
-
+        protected override CreateParams CreateParams
+        {
+            get
+            {
+                CreateParams paras = base.CreateParams;
+                paras.ExStyle |= 0x02000000;
+                return paras;
+            }
+        }
         private void PageReportManage_Load(object sender, EventArgs e)
         private void PageReportManage_Load(object sender, EventArgs e)
         {
         {
 
 

+ 3 - 2
Scada/Page/PageSystemParameterSet.Designer.cs

@@ -184,9 +184,9 @@
             // 
             // 
             uiLabel7.Font = new Font("宋体", 12F, FontStyle.Regular, GraphicsUnit.Point, 134);
             uiLabel7.Font = new Font("宋体", 12F, FontStyle.Regular, GraphicsUnit.Point, 134);
             uiLabel7.ForeColor = Color.FromArgb(48, 48, 48);
             uiLabel7.ForeColor = Color.FromArgb(48, 48, 48);
-            uiLabel7.Location = new Point(300, 102);
+            uiLabel7.Location = new Point(295, 102);
             uiLabel7.Name = "uiLabel7";
             uiLabel7.Name = "uiLabel7";
-            uiLabel7.Size = new Size(138, 54);
+            uiLabel7.Size = new Size(120, 29);
             uiLabel7.TabIndex = 11;
             uiLabel7.TabIndex = 11;
             uiLabel7.Text = "PLC连接超时";
             uiLabel7.Text = "PLC连接超时";
             // 
             // 
@@ -454,6 +454,7 @@
             btn_Save.TabIndex = 3;
             btn_Save.TabIndex = 3;
             btn_Save.Text = "保存";
             btn_Save.Text = "保存";
             btn_Save.TipsFont = new Font("宋体", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
             btn_Save.TipsFont = new Font("宋体", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
+            btn_Save.Click += btn_Save_Click;
             // 
             // 
             // PageSystemParameterSet
             // PageSystemParameterSet
             // 
             // 

+ 97 - 2
Scada/Page/PageSystemParameterSet.cs

@@ -19,7 +19,15 @@ namespace Scada.Page
             InitializeComponent();
             InitializeComponent();
             this.Load += PageSystemParameterSet_Load;
             this.Load += PageSystemParameterSet_Load;
         }
         }
-
+        protected override CreateParams CreateParams
+        {
+            get
+            {
+                CreateParams paras = base.CreateParams;
+                paras.ExStyle |= 0x02000000;
+                return paras;
+            }
+        }
         private void PageSystemParameterSet_Load(object sender, EventArgs e)
         private void PageSystemParameterSet_Load(object sender, EventArgs e)
         {
         {
             InitSystemParameter();
             InitSystemParameter();
@@ -36,7 +44,94 @@ namespace Scada.Page
             this.cb_CPUType.Text = Globals.CpuType.ToString();
             this.cb_CPUType.Text = Globals.CpuType.ToString();
             this.txt_Slot.Text = Globals.Slot.ToString();
             this.txt_Slot.Text = Globals.Slot.ToString();
             this.txt_Rack.Text = Globals.Rack.ToString();
             this.txt_Rack.Text = Globals.Rack.ToString();
-            
+            this.txt_DirePath.Text = Globals.DelFilePath;
+            switch (Globals.SaveDay)
+            {
+                case "不清理":
+                    this.rbg_Save.SelectedIndex = 0;
+                    break;
+                case "3天":
+                    this.rbg_Save.SelectedIndex = 1;
+                    break;
+                case "7天":
+                    this.rbg_Save.SelectedIndex = 2;
+                    break;
+                case "15天":
+                    this.rbg_Save.SelectedIndex = 3;
+                    break;
+                case "30天":
+                    this.rbg_Save.SelectedIndex = 4;
+                    break;
+                case "60天":
+                    this.rbg_Save.SelectedIndex = 5;
+                    break;
+            }
+            this.txt_SoftTime.Text = Globals.SYTime.ToString();
+            this.txt_SoftwareVersion.Text = Globals.SoftwareVersion;
+        }
+
+        private void btn_Save_Click(object sender, EventArgs e)
+        {
+
+            var parameters = new Dictionary<string, string>
+     {
+         {"PLC地址",this.txt_IPAddress.Text },
+         {"PLC端口" ,this.txt_Port.Text},
+          { "CPU类型", this.cb_CPUType.Text },
+         { "机架号", this.txt_Rack.Text },
+         { "插槽号", this.txt_Slot.Text },
+         { "超时时间",this.txt_ConnectTimeOut.Text },
+         { "循环读取时间",this.txt_ReadTimeInterval.Text},
+         { "重连时间",this.txt_ReConnectTimeInterval.Text }
+ };
+
+            foreach (var parameter in parameters)
+            {
+                if (!Globals.IniFile.Write("PLC参数", parameter.Key, parameter.Value))
+                {
+                    UIMessageTip.ShowWarning($"保存{parameter.Key}失败!");
+                    return;
+                }
+            }
+
+            string delDirePath = this.txt_DirePath.Text;
+            string saveDay = this.rbg_Save.Items[this.rbg_Save.SelectedIndex].ToString();
+
+            if (Directory.Exists(delDirePath))
+            {
+                if (!Globals.IniFile.Write("系统参数", "删除文件夹路径", delDirePath))
+                {
+                    UIMessageTip.ShowWarning("删除文件夹路径失败");
+                    return;
+                }
+            }
+            else
+            {
+                UIMessageTip.ShowWarning("删除文件夹不存在");
+                return;
+            }
+
+            if (!Globals.IniFile.Write("系统参数", "保存文件夹天数", saveDay))
+            {
+                UIMessageTip.ShowWarning("保存天数失败");
+                return;
+            }
+
+            if (!Globals.IniFile.Write("软件参数", "软件版本", this.txt_SoftwareVersion.Text))
+            {
+                UIMessageTip.ShowWarning("保存软件版本信息失败!");
+                return;
+            }
+
+            if (!Globals.IniFile.Write("软件参数", "试用时间", this.txt_SoftTime.Text))
+            {
+                UIMessageTip.ShowWarning("保存软件试用时间失败!");
+                return;
+            }
+
+            UIMessageTip.ShowOk("保存成功!");
+
+
         }
         }
     }
     }
 }
 }

+ 9 - 1
Scada/Page/PageTotalEquipmentControl.cs

@@ -24,7 +24,15 @@ namespace Scada.Page
             InitializeComponent();
             InitializeComponent();
             LogExtension.ShowMessage = ShowLog;
             LogExtension.ShowMessage = ShowLog;
         }
         }
-
+        protected override CreateParams CreateParams
+        {
+            get
+            {
+                CreateParams paras = base.CreateParams;
+                paras.ExStyle |= 0x02000000;
+                return paras;
+            }
+        }
         private void btn_Start_Common_Click(object sender, EventArgs e)
         private void btn_Start_Common_Click(object sender, EventArgs e)
         {
         {
             UISymbolButton uISymbolButton = sender as UISymbolButton;
             UISymbolButton uISymbolButton = sender as UISymbolButton;

+ 9 - 0
Scada/Page/PageUserManage.cs

@@ -175,5 +175,14 @@ namespace Scada.Page
                 LogExtension.ShowMessage("删除用户失败", Microsoft.Extensions.Logging.LogLevel.Information);
                 LogExtension.ShowMessage("删除用户失败", Microsoft.Extensions.Logging.LogLevel.Information);
             }
             }
         }
         }
+        protected override CreateParams CreateParams
+        {
+            get
+            {
+                CreateParams paras = base.CreateParams;
+                paras.ExStyle |= 0x02000000;
+                return paras;
+            }
+        }
     }
     }
 }
 }

+ 1 - 0
Scada/UserControls/UserAlarmState.Designer.cs

@@ -84,6 +84,7 @@
             FillColor = Color.Transparent;
             FillColor = Color.Transparent;
             Name = "UserAlarmState";
             Name = "UserAlarmState";
             RectColor = Color.Transparent;
             RectColor = Color.Transparent;
+            RectDisableColor = Color.Transparent;
             Size = new Size(250, 60);
             Size = new Size(250, 60);
             uiTableLayoutPanel1.ResumeLayout(false);
             uiTableLayoutPanel1.ResumeLayout(false);
             ResumeLayout(false);
             ResumeLayout(false);

+ 2 - 0
Scada/UserControls/UserDeviceState.Designer.cs

@@ -83,8 +83,10 @@
             BackColor = Color.Transparent;
             BackColor = Color.Transparent;
             Controls.Add(uiTableLayoutPanel1);
             Controls.Add(uiTableLayoutPanel1);
             FillColor = Color.Transparent;
             FillColor = Color.Transparent;
+            FillColor2 = Color.Transparent;
             Name = "UserDeviceState";
             Name = "UserDeviceState";
             RectColor = Color.Transparent;
             RectColor = Color.Transparent;
+            RectDisableColor = Color.Transparent;
             Size = new Size(250, 60);
             Size = new Size(250, 60);
             uiTableLayoutPanel1.ResumeLayout(false);
             uiTableLayoutPanel1.ResumeLayout(false);
             ResumeLayout(false);
             ResumeLayout(false);

+ 1 - 0
Scada/UserControls/UserVarCurrentValue.Designer.cs

@@ -98,6 +98,7 @@
             BackColor = Color.Transparent;
             BackColor = Color.Transparent;
             Controls.Add(uiTableLayoutPanel1);
             Controls.Add(uiTableLayoutPanel1);
             FillColor = Color.Transparent;
             FillColor = Color.Transparent;
+            FillColor2 = Color.Transparent;
             Name = "UserVarCurrentValue";
             Name = "UserVarCurrentValue";
             RectColor = Color.Transparent;
             RectColor = Color.Transparent;
             Size = new Size(337, 60);
             Size = new Size(337, 60);