Merge branch 'master' of http://www.scserverddns.top:13000/sc/SunlightCentralizedControlManagement
This commit is contained in:
commit
7c64350792
6 files changed
+150
-110
No files matched your search
@@ -1,32 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Globalization;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Data;
|
|
||||||
|
|
||||||
namespace DyeingComputer.ConvertMoels
|
|
||||||
{
|
|
||||||
internal class BoolRBConvert : IValueConverter
|
|
||||||
{
|
|
||||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
||||||
{
|
|
||||||
bool G =(Boolean) value;
|
|
||||||
// bool G = (bool)value;
|
|
||||||
if (!G)//判断单元格值是否为零
|
|
||||||
{
|
|
||||||
return "";//零返回
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return "red";//非零返回红色
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
||||||
{
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Media;
|
||||||
|
|
||||||
|
namespace SunlightCentralizedControlManagement_SCCM_.ConvertMoels
|
||||||
|
{
|
||||||
|
internal class StateToColorConvert : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
if (value == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string Staten = null;
|
||||||
|
string i = value.ToString();
|
||||||
|
|
||||||
|
if (i == "101") return "Gray";
|
||||||
|
else if (i == "201") return "green";
|
||||||
|
else if (i == "202") return "yellow";
|
||||||
|
else return "Red";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
return "Gray";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-1
@@ -87,7 +87,7 @@
|
|||||||
</ListViewItem>
|
</ListViewItem>
|
||||||
<ListViewItem Height="60" MouseLeftButtonUp="ListViewItem_Curve">
|
<ListViewItem Height="60" MouseLeftButtonUp="ListViewItem_Curve">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<materialDesign:PackIcon Kind="ShowChart" Width="25" Height="25" Margin="10" VerticalAlignment="Center"/>
|
<materialDesign:PackIcon Kind="ChartBellCurve" Width="25" Height="25" Margin="10" VerticalAlignment="Center"/>
|
||||||
<TextBlock Text="{x:Static lang:Resources.Curve}" VerticalAlignment="Center" Margin="20 10" Foreground="White"/>
|
<TextBlock Text="{x:Static lang:Resources.Curve}" VerticalAlignment="Center" Margin="20 10" Foreground="White"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ListViewItem>
|
</ListViewItem>
|
||||||
|
|||||||
@@ -139,7 +139,7 @@
|
|||||||
<DependentUpon>App.xaml</DependentUpon>
|
<DependentUpon>App.xaml</DependentUpon>
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="ConvertMoels\BoolRBConvert.cs" />
|
<Compile Include="ConvertMoels\StateToColorConvert.cs" />
|
||||||
<Compile Include="ConvertMoels\GramsSQLConvert.cs" />
|
<Compile Include="ConvertMoels\GramsSQLConvert.cs" />
|
||||||
<Compile Include="ConvertMoels\IORBConvert.cs" />
|
<Compile Include="ConvertMoels\IORBConvert.cs" />
|
||||||
<Compile Include="ConvertMoels\ProductTypeSQLConvert.cs" />
|
<Compile Include="ConvertMoels\ProductTypeSQLConvert.cs" />
|
||||||
|
|||||||
+100
-12
@@ -7,19 +7,109 @@
|
|||||||
xmlns:viewmodel="clr-namespace:SunlightCentralizedControlManagement_SCCM_.ViewModel"
|
xmlns:viewmodel="clr-namespace:SunlightCentralizedControlManagement_SCCM_.ViewModel"
|
||||||
xmlns:local="clr-namespace:SunlightCentralizedControlManagement_SCCM_.View"
|
xmlns:local="clr-namespace:SunlightCentralizedControlManagement_SCCM_.View"
|
||||||
xmlns:lang="clr-namespace:SunlightCentralizedControlManagement_SCCM_.Properties"
|
xmlns:lang="clr-namespace:SunlightCentralizedControlManagement_SCCM_.Properties"
|
||||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||||
|
xmlns:ConvertMoels="clr-namespace:SunlightCentralizedControlManagement_SCCM_.ConvertMoels"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Loaded="UserControl_Loaded"
|
Loaded="UserControl_Loaded"
|
||||||
d:DataContext="{d:DesignInstance Type=viewmodel:CurveDiagramViewModel}"
|
d:DataContext="{d:DesignInstance Type=viewmodel:CurveDiagramViewModel}"
|
||||||
d:DesignHeight="900" d:DesignWidth="1800">
|
d:DesignHeight="900" d:DesignWidth="1800">
|
||||||
|
<UserControl.Resources>
|
||||||
|
<ConvertMoels:StateToColorConvert x:Key="StateToColorConvert"/>
|
||||||
|
</UserControl.Resources>
|
||||||
<Grid>
|
<Grid>
|
||||||
|
<DataGrid x:Name="Griddata" AlternationCount="2" IsReadOnly="True" d:ItemsSource="{d:SampleData ItemCount=999}"
|
||||||
<ListView x:Name="machines" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Foreground="#FF1368BD"
|
Background="White" HorizontalGridLinesBrush="{x:Null}" VerticalGridLinesBrush="#FFC9C9C9"
|
||||||
HorizontalAlignment="Right" Width="300" Margin="0,60,0,0">
|
GridLinesVisibility="All" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" FontSize="15"
|
||||||
</ListView>
|
Grid.ColumnSpan="2" CanUserResizeRows="False" AutoGenerateColumns="False" MinColumnWidth="30"
|
||||||
|
CanUserAddRows="False" CanUserDeleteRows="False" HeadersVisibility ="Column" SelectionMode="Single"
|
||||||
<lvc:CartesianChart x:Name="OscChart" MinWidth="1280" MinHeight="600" EasingFunction="{x:Null}"
|
Margin="0,0,0,60" HorizontalAlignment="Right" Width="300" MouseDoubleClick="Griddata_MouseDoubleClick">
|
||||||
Series="{Binding Series}" YAxes="{Binding YAxes}" XAxes="{Binding XAxes}" Margin="0,0,300,60">
|
<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"/>
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</DataGrid>
|
||||||
|
<DataGrid x:Name="GridWorkOrder" AlternationCount="2" IsReadOnly="True" d:ItemsSource="{d:SampleData ItemCount=90}"
|
||||||
|
Background="White" HorizontalGridLinesBrush="#FFC9C9C9" 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"
|
||||||
|
VerticalAlignment="Top" Height="500" Margin="0,0,300,0" MouseDoubleClick="GridWorkOrder_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>
|
||||||
|
<!--列信息绑定-->
|
||||||
|
<DataGridTextColumn Header="{x:Static lang:Resources.Machine}" Binding="{Binding Name}" Width="150" IsReadOnly="True"/>
|
||||||
|
<DataGridTextColumn Header="{x:Static lang:Resources.WorkOrder}" Binding="{Binding WorkOrder}" Width="300" IsReadOnly="True"/>
|
||||||
|
<DataGridTextColumn Header="{x:Static lang:Resources.ProcessName}" Binding="{Binding ProgramName}" Width="250" IsReadOnly="True"/>
|
||||||
|
<DataGridTextColumn Header="{x:Static lang:Resources.StartTime}" Binding="{Binding StartTime}" Width="150" IsReadOnly="True"/>
|
||||||
|
<DataGridTextColumn Header="{x:Static lang:Resources.Remark}" Binding="{Binding Remark}" Width="500" IsReadOnly="True"/>
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</DataGrid>
|
||||||
|
|
||||||
|
<lvc:CartesianChart x:Name="OscChart" MinWidth="400" MinHeight="300" EasingFunction="{x:Null}"
|
||||||
|
Series="{Binding Series}" YAxes="{Binding YAxes}" XAxes="{Binding XAxes}" Margin="0,500,300,60">
|
||||||
<lvc:CartesianChart.Style>
|
<lvc:CartesianChart.Style>
|
||||||
<Style TargetType="{x:Type lvc:CartesianChart}">
|
<Style TargetType="{x:Type lvc:CartesianChart}">
|
||||||
<Setter Property="ZoomMode" Value="PanX"/>
|
<Setter Property="ZoomMode" Value="PanX"/>
|
||||||
@@ -28,16 +118,14 @@
|
|||||||
</lvc:CartesianChart.Style>
|
</lvc:CartesianChart.Style>
|
||||||
</lvc:CartesianChart>
|
</lvc:CartesianChart>
|
||||||
|
|
||||||
<StackPanel x:Name="s1cr" VerticalAlignment="Bottom" Height="60" Background="#FF00204E" Orientation="Horizontal" Margin="0,0,0,0">
|
<StackPanel x:Name="s1cr" VerticalAlignment="Bottom" Height="60" Background="#FF00204E" Orientation="Horizontal">
|
||||||
<ListView ScrollViewer.HorizontalScrollBarVisibility="Disabled" Foreground="#FF1368BD">
|
<ListView ScrollViewer.HorizontalScrollBarVisibility="Disabled" Foreground="#FF1368BD">
|
||||||
<ListViewItem Height="60" MouseLeftButtonUp="DatePicker_Today" VerticalAlignment="Center">
|
<ListViewItem Height="60" VerticalAlignment="Center">
|
||||||
<StackPanel Orientation="Horizontal" >
|
<StackPanel Orientation="Horizontal" >
|
||||||
<materialDesign:PackIcon Kind="DateRange" Width="25" Height="40" Margin="10" VerticalAlignment="Center"/>
|
<materialDesign:PackIcon Kind="DateRange" Width="25" Height="40" Margin="10" VerticalAlignment="Center"/>
|
||||||
<TextBlock Text="{x:Static lang:Resources.SelectDate}" VerticalAlignment="Center" Margin="20 10" Foreground="White"/>
|
<TextBlock Text="{x:Static lang:Resources.SelectDate}" VerticalAlignment="Center" Margin="20 10" Foreground="White"/>
|
||||||
<DatePicker x:Name="Sdatepicker" Width="150" FontSize="20" Height="40" FontWeight="Bold" Padding="1,1,0,1"
|
<DatePicker x:Name="Sdatepicker" Width="150" FontSize="20" Height="40" FontWeight="Bold" Padding="1,1,0,1"
|
||||||
Focusable="False" Text="{x:Static lang:Resources.Startdate}"/>
|
Focusable="False" Text="{x:Static lang:Resources.Startdate}"/>
|
||||||
<DatePicker x:Name="Edatepicker" Width="150" FontSize="20" Height="40" FontWeight="Bold" Padding="1,1,0,1"
|
|
||||||
Focusable="False" Text="{x:Static lang:Resources.Enddate}"/>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ListViewItem>
|
</ListViewItem>
|
||||||
</ListView>
|
</ListView>
|
||||||
|
|||||||
+11
-64
@@ -34,7 +34,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
|||||||
DataContext = new CurveDiagramViewModel();
|
DataContext = new CurveDiagramViewModel();
|
||||||
|
|
||||||
Sdatepicker.Language = XmlLanguage.GetLanguage(Configini.IniReadvalue("SYS", "Language"));
|
Sdatepicker.Language = XmlLanguage.GetLanguage(Configini.IniReadvalue("SYS", "Language"));
|
||||||
Edatepicker.Language = XmlLanguage.GetLanguage(Configini.IniReadvalue("SYS", "Language"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static object Selet_Machines(DataTable DB, string name, int key)//查询
|
public static object Selet_Machines(DataTable DB, string name, int key)//查询
|
||||||
@@ -57,74 +56,13 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
|||||||
|
|
||||||
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
// Griddata.ItemsSource = MainWindowViewModel.Machines.DefaultView;
|
Griddata.ItemsSource = MainWindowViewModel.Machines.DefaultView;
|
||||||
ListViewItem[] listViewItems =new ListViewItem[999];
|
|
||||||
|
|
||||||
ListView[] listView = new ListView[999];
|
|
||||||
|
|
||||||
for (int i = 0; i < MainWindowViewModel.Machines.Rows.Count; i++)
|
|
||||||
{
|
|
||||||
StackPanel stackPanel = new StackPanel();
|
|
||||||
stackPanel.Orientation = Orientation.Horizontal;
|
|
||||||
|
|
||||||
TextBlock textBlock = new TextBlock();
|
|
||||||
|
|
||||||
PackIcon packIcon = new PackIcon();
|
|
||||||
packIcon.Kind = PackIconKind.ChartBellCurve; //曲线图标
|
|
||||||
packIcon.Width = 25;
|
|
||||||
packIcon.Height = 40;
|
|
||||||
packIcon.VerticalAlignment = VerticalAlignment.Center;
|
|
||||||
|
|
||||||
stackPanel.Children.Add(packIcon);
|
|
||||||
stackPanel.Children.Add(textBlock);
|
|
||||||
|
|
||||||
|
|
||||||
/* inf[i] = new View.info(); Width="25" Height="40" Margin="10" VerticalAlignment="Center"/>
|
|
||||||
inf[i].Margin = new Thickness(5, 5, 0, 5);
|
|
||||||
inf[i].Width = 300;
|
|
||||||
inf[i].Height = 400;
|
|
||||||
inf[i].name.Text = Selet_Machines(MainWindowViewModel.Machines, "name", i).ToString();
|
|
||||||
|
|
||||||
string State_ = Selet_Machines(MainWindowViewModel.Machines, "State", i).ToString();
|
|
||||||
if (State_ == "101")
|
|
||||||
{ inf[i].name.Background = new SolidColorBrush(Color.FromRgb(100, 100, 100)); }
|
|
||||||
else if (State_ == "201")
|
|
||||||
{ inf[i].name.Background = new SolidColorBrush(Color.FromRgb(0, 255, 0)); }
|
|
||||||
else if (State_ == "202")
|
|
||||||
{ inf[i].name.Background = new SolidColorBrush(Color.FromRgb(255, 255, 0)); }
|
|
||||||
else
|
|
||||||
{ inf[i].name.Background = new SolidColorBrush(Color.FromRgb(255, 0, 0)); }
|
|
||||||
|
|
||||||
inf[i].temp.Text = (Selet_Machines(MainWindowViewModel.Machines, "Temperature", i) + "°C").ToString();
|
|
||||||
inf[i].Process.Text = Selet_Machines(MainWindowViewModel.Machines, "Process", i).ToString();
|
|
||||||
inf[i].Step.Text = Selet_Machines(MainWindowViewModel.Machines, "Step", i).ToString();
|
|
||||||
inf[i].Message.Text = Selet_Machines(MainWindowViewModel.Machines, "Message", i).ToString();
|
|
||||||
inf[i].Orders.Text = Selet_Machines(MainWindowViewModel.Machines, "Orders", i).ToString();
|
|
||||||
inf[i].time.Text = Selet_Machines(MainWindowViewModel.Machines, "time", i).ToString();
|
|
||||||
|
|
||||||
WholeView.Children.Add(inf[i]);*/
|
|
||||||
listViewItems[i]= new ListViewItem();
|
|
||||||
listViewItems[i].Tag = stackPanel;
|
|
||||||
// listViewItems[i].
|
|
||||||
|
|
||||||
// listView[i].Template = Selet_Machines(MainWindowViewModel.Machines,"name",i);
|
|
||||||
|
|
||||||
machines.Items.Add(listView[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Griddata_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DatePicker_Today(object sender, MouseButtonEventArgs e)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void WorkOrderNumder_Click(object sender, RoutedEventArgs e)
|
private void WorkOrderNumder_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -145,5 +83,14 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Griddata_MouseDoubleClick(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void GridWorkOrder_MouseDoubleClick(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user