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
+100
-12
@@ -7,19 +7,109 @@
|
||||
xmlns:viewmodel="clr-namespace:SunlightCentralizedControlManagement_SCCM_.ViewModel"
|
||||
xmlns:local="clr-namespace:SunlightCentralizedControlManagement_SCCM_.View"
|
||||
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"
|
||||
Loaded="UserControl_Loaded"
|
||||
d:DataContext="{d:DesignInstance Type=viewmodel:CurveDiagramViewModel}"
|
||||
d:DesignHeight="900" d:DesignWidth="1800">
|
||||
<UserControl.Resources>
|
||||
<ConvertMoels:StateToColorConvert x:Key="StateToColorConvert"/>
|
||||
</UserControl.Resources>
|
||||
<Grid>
|
||||
|
||||
<ListView x:Name="machines" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Foreground="#FF1368BD"
|
||||
HorizontalAlignment="Right" Width="300" Margin="0,60,0,0">
|
||||
</ListView>
|
||||
|
||||
<lvc:CartesianChart x:Name="OscChart" MinWidth="1280" MinHeight="600" EasingFunction="{x:Null}"
|
||||
Series="{Binding Series}" YAxes="{Binding YAxes}" XAxes="{Binding XAxes}" Margin="0,0,300,60">
|
||||
<DataGrid x:Name="Griddata" AlternationCount="2" IsReadOnly="True" d:ItemsSource="{d:SampleData ItemCount=999}"
|
||||
Background="White" 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"
|
||||
Margin="0,0,0,60" HorizontalAlignment="Right" Width="300" 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"/>
|
||||
</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>
|
||||
<Style TargetType="{x:Type lvc:CartesianChart}">
|
||||
<Setter Property="ZoomMode" Value="PanX"/>
|
||||
@@ -28,16 +118,14 @@
|
||||
</lvc:CartesianChart.Style>
|
||||
</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">
|
||||
<ListViewItem Height="60" MouseLeftButtonUp="DatePicker_Today" VerticalAlignment="Center">
|
||||
<ListViewItem Height="60" VerticalAlignment="Center">
|
||||
<StackPanel Orientation="Horizontal" >
|
||||
<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"/>
|
||||
<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}"/>
|
||||
<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>
|
||||
</ListViewItem>
|
||||
</ListView>
|
||||
|
||||
+11
-64
@@ -34,7 +34,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
DataContext = new CurveDiagramViewModel();
|
||||
|
||||
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)//查询
|
||||
@@ -57,74 +56,13 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
|
||||
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// 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);
|
||||
Griddata.ItemsSource = MainWindowViewModel.Machines.DefaultView;
|
||||
|
||||
|
||||
/* 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)
|
||||
{
|
||||
|
||||
@@ -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