sc 11 months ago
parent
commit
a52fffde49
  1. 2
      MainWindow.xaml.cs
  2. 9
      Properties/Resources.Designer.cs
  3. 3
      Properties/Resources.en-US.resx
  4. 3
      Properties/Resources.resx
  5. 3
      Properties/Resources.zh-CN.resx
  6. 7
      SunlightCentralizedControlManagement_SCCM_.csproj
  7. 1
      View/CurveView.xaml
  8. 87
      View/MachinesSet.xaml
  9. 59
      View/MachinesSet.xaml.cs

2
MainWindow.xaml.cs

@ -102,7 +102,7 @@ namespace SunlightCentralizedControlManagement_SCCM_
private void ButtonSYS_Click(object sender, RoutedEventArgs e)
{
Picture.Content =new View.EngineerSetView();
Picture.Content = new View.MachinesSet();//EngineerSetView();
}
}
}

9
Properties/Resources.Designer.cs

@ -2292,6 +2292,15 @@ namespace SunlightCentralizedControlManagement_SCCM_.Properties {
}
}
/// <summary>
/// 查找类似 Test 的本地化字符串。
/// </summary>
public static string Test {
get {
return ResourceManager.GetString("Test", resourceCulture);
}
}
/// <summary>
/// 查找类似 Time 的本地化字符串。
/// </summary>

3
Properties/Resources.en-US.resx

@ -924,4 +924,7 @@
<data name="DayAfter" xml:space="preserve">
<value>Day After</value>
</data>
<data name="Test" xml:space="preserve">
<value>Test</value>
</data>
</root>

3
Properties/Resources.resx

@ -924,4 +924,7 @@
<data name="DayAfter" xml:space="preserve">
<value>DayAfter</value>
</data>
<data name="Test" xml:space="preserve">
<value>Test</value>
</data>
</root>

3
Properties/Resources.zh-CN.resx

@ -924,4 +924,7 @@
<data name="DayAfter" xml:space="preserve">
<value>后一天</value>
</data>
<data name="Test" xml:space="preserve">
<value>测试</value>
</data>
</root>

7
SunlightCentralizedControlManagement_SCCM_.csproj

@ -111,6 +111,9 @@
<Compile Include="View\info.xaml.cs">
<DependentUpon>info.xaml</DependentUpon>
</Compile>
<Compile Include="View\MachinesSet.xaml.cs">
<DependentUpon>MachinesSet.xaml</DependentUpon>
</Compile>
<Compile Include="View\MonitorView.xaml.cs">
<DependentUpon>MonitorView.xaml</DependentUpon>
</Compile>
@ -169,6 +172,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\MachinesSet.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\MonitorView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>

1
View/CurveView.xaml

@ -11,7 +11,6 @@
xmlns:ConvertMoels="clr-namespace:SunlightCentralizedControlManagement_SCCM_.ConvertMoels"
mc:Ignorable="d"
Loaded="UserControl_Loaded"
d:DesignHeight="900" d:DesignWidth="1800">
<UserControl.Resources>
<ConvertMoels:StateToColorConvert x:Key="StateToColorConvert"/>

87
View/MachinesSet.xaml

@ -0,0 +1,87 @@
<UserControl x:Class="SunlightCentralizedControlManagement_SCCM_.View.MachinesSet"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:SunlightCentralizedControlManagement_SCCM_.View"
xmlns:lang="clr-namespace:SunlightCentralizedControlManagement_SCCM_.Properties"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:ConvertMoels="clr-namespace:SunlightCentralizedControlManagement_SCCM_.ConvertMoels"
mc:Ignorable="d"
Loaded="UserControl_Loaded"
d:DesignHeight="900" d:DesignWidth="1200">
<UserControl.Resources>
<ConvertMoels:StateToColorConvert x:Key="StateToColorConvert"/>
</UserControl.Resources>
<Grid>
<DataGrid x:Name="Griddata" AlternationCount="2" IsReadOnly="True" d:ItemsSource="{d:SampleData ItemCount=999}"
Background="#FFC7C7C7" HorizontalGridLinesBrush="{x:Null}" VerticalGridLinesBrush="#FFC9C9C9"
GridLinesVisibility="All" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" FontSize="15"
Grid.ColumnSpan="2" CanUserResizeRows="False" AutoGenerateColumns="False" MinColumnWidth="30"
CanUserAddRows="False" CanUserDeleteRows="False" HeadersVisibility ="Column" SelectionMode="Single"
HorizontalAlignment="Right" Width="500" MouseDoubleClick="Griddata_MouseDoubleClick">
<DataGrid.RowStyle >
<Style TargetType="{x:Type DataGridRow}">
<Setter Property="Height" Value="30" />
<Setter Property="FontSize" Value="25" />
<Style.Triggers>
<Trigger Property="ItemsControl.AlternationIndex" Value="0">
<Setter Property="Background" Value="#FFFFFFFF" />
</Trigger>
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
<Setter Property="Background" Value="#FFF0F0F0" />
</Trigger>
<Trigger Property="IsMouseOver" Value="False"/>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="MinWidth" Value="20"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#FFC0C0C0"/>
<Setter Property="BorderBrush" Value="#FFC0C0C0"/>
<Setter Property="Foreground" Value="Black"/>
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.CellStyle>
<DataGrid.Columns>
<!--列信息绑定-->
<DataGridTemplateColumn Width="70" Header="{x:Static lang:Resources.State}">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<materialDesign:PackIcon Kind="StateMachine" Width="25" Height="30" VerticalAlignment="Center" HorizontalAlignment="Center"
Foreground="{Binding Path=State,Converter={StaticResource StateToColorConvert}}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header="{x:Static lang:Resources.Machine}" Binding="{Binding Name}" Width="210" IsReadOnly="True"/>
<DataGridTextColumn Header="{x:Static lang:Resources.Group}" Binding="{Binding Group}" Width="210" IsReadOnly="True"/>
</DataGrid.Columns>
</DataGrid>
<ComboBox HorizontalAlignment="Left" Height="30" Margin="150,10,0,0" x:Name="comboBoxMachine" VerticalAlignment="Top" Width="270" FontSize="20" IsEditable="True" />
<TextBlock HorizontalAlignment="Left" Height="40" Margin="10,10,0,0" TextWrapping="Wrap" Text="{x:Static lang:Resources.Machine}" VerticalAlignment="Top" Width="120" FontSize="25"/>
<TextBox HorizontalAlignment="Left" Height="30" Margin="150,50,0,0" x:Name="TextMachineGroup" VerticalAlignment="Top" Width="270" FontSize="20" MaxLines="1"/>
<TextBlock HorizontalAlignment="Left" Height="40" Margin="10,50,0,0" TextWrapping="Wrap" Text="{x:Static lang:Resources.MachineGroup}" VerticalAlignment="Top" Width="120" FontSize="25"/>
<TextBox HorizontalAlignment="Left" Height="30" Margin="150,100,0,0" x:Name="IP" VerticalAlignment="Top" Width="200" FontSize="20" MaxLines="1"/>
<TextBlock HorizontalAlignment="Left" Height="40" Margin="350,100,0,0" TextWrapping="Wrap" Text=":" VerticalAlignment="Top" Width="20" FontSize="25"/>
<TextBox HorizontalAlignment="Left" Height="30" Margin="360,100,0,0" x:Name="PORT" VerticalAlignment="Top" Width="60" FontSize="20" MaxLines="1" Text="7789"/>
<TextBlock HorizontalAlignment="Left" Height="40" Margin="10,100,0,0" TextWrapping="Wrap" Text="IP/PORT" VerticalAlignment="Top" Width="120" FontSize="25"/>
<ComboBox HorizontalAlignment="Left" Height="30" Margin="150,150,0,0" x:Name="comboBoxCOM0" VerticalAlignment="Top" Width="200" FontSize="20" />
<TextBlock HorizontalAlignment="Left" Height="40" Margin="10,150,0,0" TextWrapping="Wrap" Text="COM" VerticalAlignment="Top" Width="120" FontSize="25"/>
<TextBox HorizontalAlignment="Left" Height="30" Margin="360,150,0,0" x:Name="BAUD" VerticalAlignment="Top" Width="60" FontSize="20" MaxLines="1" Text="57600"/>
<TextBlock HorizontalAlignment="Left" Height="40" Margin="350,150,0,0" TextWrapping="Wrap" Text=":" VerticalAlignment="Top" Width="20" FontSize="25"/>
<TextBlock HorizontalAlignment="Left" Height="40" Margin="10,200,0,0" TextWrapping="Wrap" Text="------------" VerticalAlignment="Top" Width="140" FontSize="25"/>
<Button Content="{x:Static lang:Resources.Save}" HorizontalAlignment="Left" Height="35" Margin="250,200,0,5" VerticalAlignment="Top" Width="80" Click="Save_Click"/>
<Button Content="{x:Static lang:Resources.Delete}" HorizontalAlignment="Left" Height="35" Margin="340,200,0,5" VerticalAlignment="Top" Width="80" Click="Delete_Click"/>
<Button Content="{x:Static lang:Resources.Test}" HorizontalAlignment="Left" Height="35" Margin="160,200,50,5" VerticalAlignment="Top" Width="80" Click="Test_Click"/>
</Grid>
</UserControl>

59
View/MachinesSet.xaml.cs

@ -0,0 +1,59 @@
using SkiaSharp;
using SunlightCentralizedControlManagement_SCCM_.ViewModel;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using static SunlightCentralizedControlManagement_SCCM_.UserClass.SqliteHelper;
namespace SunlightCentralizedControlManagement_SCCM_.View
{
/// <summary>
/// MachinesSet.xaml 的交互逻辑
/// </summary>
public partial class MachinesSet : UserControl
{
public MachinesSet()
{
InitializeComponent();
}
private SQLiteHelper SQLiteHelpers = null; //定义数据库
private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\SCCM.db"; //数据库路径
private readonly UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "SCCM.ini");
private void UserControl_Loaded(object sender, RoutedEventArgs e)
{
Griddata.ItemsSource = MainWindowViewModel.Machines.DefaultView;
}
private void Griddata_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
}
private void Save_Click(object sender, RoutedEventArgs e)
{
}
private void Delete_Click(object sender, RoutedEventArgs e)
{
}
private void Test_Click(object sender, RoutedEventArgs e)
{
}
}
}
Loading…
Cancel
Save