alielie
2025-11-25 006c98e5650b530e5220f279c1e803fefe69d40d
优化一些东西;
13个文件已修改
123 ■■■■■ 已修改文件
HMI.Core/HMI.Core.csproj 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ModBusTcpController/ModBusTcpController.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ModBusTcpController/Properties/AssemblyInfo.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Plugin.CurrentSensorControl/BurnInOven.xaml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Plugin.CurrentSensorControl/BurnInOvenCollection.xaml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Plugin.CurrentSensorControl/BurnInSettingModal.xaml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Plugin.CurrentSensorControl/BurnInSettingModal.xaml.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Plugin.CurrentSensorControl/ControlPage.xaml 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Plugin.CurrentSensorControl/ControlPage.xaml.cs 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Plugin.TsExecution/SingleControl.xaml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Plugin.TsExecution/TsExecution.xaml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Plugin.TsExecution/TsExecution.xaml.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WPFProject/WPFProject.csproj 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HMI.Core/HMI.Core.csproj
@@ -85,18 +85,11 @@
    <Reference Include="System.Data.SQLite">
      <HintPath>..\Libs\System.Data.SQLite.dll</HintPath>
    </Reference>
    <Reference Include="System.Data.SQLite.EF6">
      <HintPath>..\Libs\System.Data.SQLite.EF6.dll</HintPath>
    </Reference>
    <Reference Include="System.Data.SQLite.Linq">
      <HintPath>..\Libs\System.Data.SQLite.Linq.dll</HintPath>
    </Reference>
    <Reference Include="System.Messaging" />
    <Reference Include="System.Numerics" />
    <Reference Include="System.Web" />
    <Reference Include="System.Xaml" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System.Data" />
    <Reference Include="System.Net.Http" />
ModBusTcpController/ModBusTcpController.cs
@@ -48,19 +48,19 @@
            return res?.IsSuccess == true;
        }
        public bool ReadDIInt(string address, out int? res, out string msg)
        public bool ReadDIInt(string address, out int res, out string msg)
        {
            var result = client?.ReadInt32($"x=2;{address}");
            msg = result?.Message;
            res = result?.Content;
            res = result?.Content ?? 0;
            return result?.IsSuccess == true;
        }
        public bool ReadDOInt(string address, out int? res, out string msg)
        public bool ReadDOInt(string address, out int res, out string msg)
        {
            var result = client?.ReadInt32(address);
            msg = result?.Message;
            res = result?.Content;
            res = result?.Content ?? 0;
            return result?.IsSuccess == true;
        }
ModBusTcpController/Properties/AssemblyInfo.cs
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
@@ -29,5 +28,5 @@
//      生成号
//      修订号
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.0.1")]
[assembly: AssemblyFileVersion("1.0.0.1")]
Plugin.CurrentSensorControl/BurnInOven.xaml
@@ -22,7 +22,7 @@
        </Style>
    </UserControl.Resources>
    <GroupBox Header="{Binding Header}">
    <GroupBox Header="{Binding Header}" Background="#FFF" >
        <Grid dp:GridHelper.Space="5" dp:GridHelper.SpaceIgnore="ALL">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
Plugin.CurrentSensorControl/BurnInOvenCollection.xaml
@@ -13,7 +13,7 @@
xmlns:pu="https://opensource.panuon.com/wpf-ui"
xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI"
             d:DesignHeight="450" d:DesignWidth="800">
    <Grid x:Name="mainGrid" dp:GridHelper.Space="6">
    <Grid x:Name="mainGrid" dp:GridHelper.Space="6" dp:GridHelper.SpaceIgnore="ALL">
    </Grid>
</UserControl>
Plugin.CurrentSensorControl/BurnInSettingModal.xaml
@@ -10,6 +10,7 @@
            xmlns:sys="clr-namespace:System;assembly=mscorlib"
            mc:Ignorable="d"
            Title="Form"
            InteropOwnersMask ="False"
            Width="1200"
            Height="900"
            WindowStartupLocation="CenterOwner"
Plugin.CurrentSensorControl/BurnInSettingModal.xaml.cs
@@ -101,6 +101,7 @@
        private void DoExport()
        {
            SaveFileDialog sfd = new SaveFileDialog();
            sfd.Filter = "Excel 文件 (*.xls)|*.xls";
            if (sfd.ShowDialog() == true)
            {
                ExcelHelper.ExportExcel(sfd.FileName, Datasource);
@@ -110,6 +111,7 @@
        private void DoImport()
        {
            OpenFileDialog ofd = new OpenFileDialog();
            ofd.Filter = "Excel 文件 (*.xls)|*.xls";
            if (ofd.ShowDialog() == true)
            {
                try
Plugin.CurrentSensorControl/ControlPage.xaml
@@ -60,13 +60,19 @@
                </ControlTemplate>
            </TabControl.Template>
            <TabItem Header="老化调试">
                <Grid dp:GridHelper.Space="5" dp:GridHelper.SpaceIgnore="ALL">
                <Grid dp:GridHelper.Space="5" Background="#f3f9ff">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <StackPanel Orientation="Horizontal">
                    <StackPanel Orientation="Horizontal" Height="30" dp:StackPanelHelper.ChildSpace="10" Margin="6,0,6,0">
                        <Button Style="{StaticResource SettingBtn}" x:Name="burnInSettingBtn" Click="Button_Click"/>
                        <pu:Switch CheckedContent="静音ON" x:Name="lightSw"
CheckedBackground="Green"
Background="{StaticResource DangerColor}"
IsChecked="{Binding PlcMute,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
Content="静音OFF"/>
                    </StackPanel>
                    <local:BurnInOvenCollection Grid.Row="1" Grid.Column="0" x:Name="ovenCollection"/>
Plugin.CurrentSensorControl/ControlPage.xaml.cs
@@ -5,6 +5,7 @@
using HMI.Core.Util;
using HMI.UI.Util;
using HMI.Util;
using HslCommunication.Profinet.Siemens;
using log4net;
using Microsoft.Win32;
using Plugin.CurrentSensorControl.Entity;
@@ -13,6 +14,7 @@
using System.Timers;
using System.Windows;
using System.Windows.Controls;
using System.Xml.Linq;
namespace Plugin.CurrentSensorControl
{
@@ -28,10 +30,33 @@
        private System.Timers.Timer timer;
        private System.Timers.Timer opcTimer;
        private SCADAApi api;
        public static ILog Logger { get; private set; }
        private volatile bool needRead = false;
        private SiemensS7Net api;
        private bool plcMute = false;
        public bool PlcMute
        {
            get => plcMute;
            set
            {
                try
                {
                    string name = $"PLC_Mute";
                    if (S7Context.WriteData(api, name, value))
                    {
                        plcMute = value;
                        OnPropertyChanged(nameof(PlcMute));
                    }
                }
                catch (Exception ex)
                {
                }
            }
        }
        public ControlPage()
        {
@@ -46,6 +71,7 @@
            opcTimer.Interval = 1000;
            S7Context.Init(SystemSetting.Instance.PlcIp, SystemSetting.Instance.PlcPort);
            api = S7Context.Get($"1");
            DataContext = this;
            InitializeComponent();
@@ -73,6 +99,19 @@
        private void Timer_Elapsed(object sender, ElapsedEventArgs e)
        {
            timer.Enabled = false;
            try
            {
                if (S7Context.GetData(api, "PLC_Mute", out object val))
                {
                    plcMute = (bool)val;
                    OnPropertyChanged("PlcMute");
                }
            }
            catch (Exception ex)
            {
            }
            try
            {
                foreach (var ctl in controls)
@@ -299,7 +338,7 @@
        private void DoDelete(SensorData data)
        {
            if (MsgBoxHelper2.WarnChoose("删除?") == MessageBoxResult.OK)
            if (MsgBoxHelper2.WarnChoose("确定要删除吗?") == MessageBoxResult.OK)
            {
                var index = Datasource.IndexOf(data);
                if (index >= 0)
Plugin.TsExecution/SingleControl.xaml
@@ -343,9 +343,7 @@
                  pu:DataGridHelper.ColumnHeaderFontSize="{Binding ActualWidth,
            ElementName=control,
Converter={StaticResource fc}, ConverterParameter='11,1093,14'}"
            FontSize="{Binding ActualWidth,
            ElementName=control,
Converter={StaticResource fc}, ConverterParameter='11,1093,14'}"
            FontSize="{DynamicResource tableFontSize}"
                  pu:DataGridHelper.ColumnHeaderPadding="3"
                  dp:DataGridHelper.ShowRowNumber="True"
                  VirtualizingPanel.IsContainerVirtualizable="True"
@@ -369,6 +367,8 @@
                        <Setter Property="Padding" Value="5"/>
                        <Setter Property="BorderThickness" Value="0"/>
                    </Style>
                    <Style TargetType="ScrollBar" BasedOn="{StaticResource ScrollStyle_Mobile}"/>
                </DataGrid.Resources>
                <DataGrid.Columns>
Plugin.TsExecution/TsExecution.xaml
@@ -11,12 +11,19 @@
         xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI"
         xmlns:ScottPlot="clr-namespace:ScottPlot.WPF;assembly=ScottPlot.WPF"
         mc:Ignorable="d" 
         xmlns:sys="clr-namespace:System;assembly=mscorlib"
                  xmlns:ui="clr-namespace:HMI.UI;assembly=HMI.UI"
         Padding="10"
         Loaded="PluginControl_Loaded"
         SizeChanged="PluginControl_SizeChanged"
         Background="{StaticResource WorkspaceBackground}"
         d:DesignHeight="450" d:DesignWidth="800">
    <UserControl.Resources>
        <ResourceDictionary>
            <sys:Double x:Key="tableFontSize">20</sys:Double>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <Grid>
            <Grid.ColumnDefinitions>
@@ -90,6 +97,12 @@
                                PreEditing="RequirePassword"
                                Value="{Binding CurrentWorkorder,Mode=TwoWay}"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" dp:StackPanelHelper.ChildSpace="5">
                        <Label FontSize="20" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Padding="0" Content="字体大小"/>
                        <ComboBox Name="CbFontSize" Width="60" ItemsSource="{Binding FontSizeSource}"
                                  SelectionChanged="CbFontSize_SelectionChanged"/>
                    </StackPanel>
                </StackPanel>
Plugin.TsExecution/TsExecution.xaml.cs
@@ -122,6 +122,10 @@
            }
        }
        public List<double> FontSizeSource { get; set; } = new List<double> {
            10,11,12,13,14,15,16,17,18,19,20
        };
        private Pie pie;
        private string CountIniPath;
        private bool IsOptRequirePassword;
@@ -572,6 +576,9 @@
        {
            pass = Convert.ToInt32(IniFileHelper.ReadIniData("Count", "Pass", "0", CountIniPath));
            fail = Convert.ToInt32(IniFileHelper.ReadIniData("Count", "Fail", "0", CountIniPath));
            var fontSize = Convert.ToDouble(IniFileHelper.ReadIniData("Config", "TableFontSize", "12", CountIniPath));
            this.Resources["tableFontSize"] = fontSize;
            CbFontSize.SelectedItem = fontSize;
        }
        private string csvDir;
@@ -1438,5 +1445,21 @@
        {
        }
        private void CbFontSize_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                if (e.AddedItems != null && e.AddedItems.Count > 0)
                {
                    var fontSize = (double)e.AddedItems[0];
                    this.Resources["tableFontSize"] = fontSize;
                    IniFileHelper.WriteIniData("Config", "TableFontSize", fontSize.ToString(), CountIniPath);
                }
            }
            catch
            {
            }
        }
    }
}
WPFProject/WPFProject.csproj
@@ -570,6 +570,7 @@
move /y "$(TargeDir)ConnectionUtil.dll" $(TargeDir)Libs\ConnectionUtil.dll"
move /y "$(TargeDir)HMI.StdControl.dll" $(TargeDir)Libs\HMI.StdControl.dll"
move /y "$(TargeDir)S7Driver.dll" $(TargeDir)Libs\S7Driver.dll"
move /y "$(TargeDir)HslCommunication.dll" $(TargeDir)Libs\HslCommunication.dll"
move /y "$(TargeDir)HMI.LogUtil.dll" $(TargeDir)Api\HMI.LogUtil.dll"
move /y "$(TargeDir)HMI.SerialData.Util.dll" $(TargeDir)Api\HMI.SerialData.Util.dll"