| | |
| | | <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" /> |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | using System.Reflection; |
| | | using System.Runtime.CompilerServices; |
| | | using System.Runtime.InteropServices; |
| | | |
| | | // 有关程序集的一般信息由以下 |
| | |
| | | // 生成号 |
| | | // 修订号 |
| | | // |
| | | [assembly: AssemblyVersion("1.0.0.0")] |
| | | [assembly: AssemblyFileVersion("1.0.0.0")] |
| | | [assembly: AssemblyVersion("1.0.0.1")] |
| | | [assembly: AssemblyFileVersion("1.0.0.1")] |
| | |
| | | xmlns:pw="https://opensource.panuon.com/wpf" |
| | | xmlns:pu="https://opensource.panuon.com/wpf-ui" |
| | | xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI" |
| | | d:DesignHeight="450" d:DesignWidth="800"> |
| | | d:DesignHeight="450" d:DesignWidth="800"> |
| | | <UserControl.Resources> |
| | | <Style x:Key="ovenTb" TargetType="TextBox" BasedOn="{StaticResource EditorTextBoxStyle}"> |
| | | <Setter Property="Height" Value="20"/> |
| | |
| | | </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"/> |
| | |
| | | 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> |
| | |
| | | xmlns:sys="clr-namespace:System;assembly=mscorlib" |
| | | mc:Ignorable="d" |
| | | Title="Form" |
| | | InteropOwnersMask ="False" |
| | | Width="1200" |
| | | Height="900" |
| | | WindowStartupLocation="CenterOwner" |
| | |
| | | private void DoExport() |
| | | { |
| | | SaveFileDialog sfd = new SaveFileDialog(); |
| | | sfd.Filter = "Excel 文件 (*.xls)|*.xls"; |
| | | if (sfd.ShowDialog() == true) |
| | | { |
| | | ExcelHelper.ExportExcel(sfd.FileName, Datasource); |
| | |
| | | private void DoImport() |
| | | { |
| | | OpenFileDialog ofd = new OpenFileDialog(); |
| | | ofd.Filter = "Excel 文件 (*.xls)|*.xls"; |
| | | if (ofd.ShowDialog() == true) |
| | | { |
| | | try |
| | |
| | | </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"/> |
| | |
| | | using HMI.Core.Util; |
| | | using HMI.UI.Util; |
| | | using HMI.Util; |
| | | using HslCommunication.Profinet.Siemens; |
| | | using log4net; |
| | | using Microsoft.Win32; |
| | | using Plugin.CurrentSensorControl.Entity; |
| | |
| | | using System.Timers; |
| | | using System.Windows; |
| | | using System.Windows.Controls; |
| | | using System.Xml.Linq; |
| | | |
| | | namespace Plugin.CurrentSensorControl |
| | | { |
| | |
| | | |
| | | 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() |
| | | { |
| | |
| | | opcTimer.Interval = 1000; |
| | | |
| | | S7Context.Init(SystemSetting.Instance.PlcIp, SystemSetting.Instance.PlcPort); |
| | | api = S7Context.Get($"1"); |
| | | |
| | | DataContext = this; |
| | | InitializeComponent(); |
| | |
| | | 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) |
| | |
| | | |
| | | private void DoDelete(SensorData data) |
| | | { |
| | | if (MsgBoxHelper2.WarnChoose("删除?") == MessageBoxResult.OK) |
| | | if (MsgBoxHelper2.WarnChoose("确定要删除吗?") == MessageBoxResult.OK) |
| | | { |
| | | var index = Datasource.IndexOf(data); |
| | | if (index >= 0) |
| | |
| | | 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" |
| | |
| | | <Setter Property="Padding" Value="5"/> |
| | | <Setter Property="BorderThickness" Value="0"/> |
| | | </Style> |
| | | |
| | | <Style TargetType="ScrollBar" BasedOn="{StaticResource ScrollStyle_Mobile}"/> |
| | | </DataGrid.Resources> |
| | | |
| | | <DataGrid.Columns> |
| | |
| | | xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI" |
| | | xmlns:ScottPlot="clr-namespace:ScottPlot.WPF;assembly=ScottPlot.WPF" |
| | | mc:Ignorable="d" |
| | | xmlns:ui="clr-namespace:HMI.UI;assembly=HMI.UI" |
| | | 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> |
| | |
| | | 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> |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | 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; |
| | |
| | | { |
| | | 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; |
| | |
| | | { |
| | | |
| | | } |
| | | |
| | | 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 |
| | | { |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | 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" |