Merge branch 'master' of http://www.scserverddns.top:13000/sc/SunlightCentralizedControlManagement
This commit is contained in:
commit
63efc5e436
4 files changed
+116
-110
No files matched your search
@@ -109,16 +109,16 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
|||||||
else if (SYSAPI == "SC831")
|
else if (SYSAPI == "SC831")
|
||||||
{
|
{
|
||||||
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
||||||
MonitorView.TechnologicalProcess = JsonConvert.DeserializeObject<DataTable>(DAT);//反序列化
|
MainWindowViewModel.dt_TP = JsonConvert.DeserializeObject<DataTable>(DAT);//反序列化
|
||||||
}
|
}
|
||||||
else if (SYSAPI == "SC832")
|
else if (SYSAPI == "SC832")
|
||||||
{
|
{
|
||||||
MonitorView.Sys_log = DAT.Substring(DAT.IndexOf("]") + 1);
|
MainWindowViewModel.MachineLOG = DAT.Substring(DAT.IndexOf("]") + 1);
|
||||||
|
|
||||||
}//当前细节信息
|
}//当前细节信息
|
||||||
else if (SYSAPI == "SC833")
|
else if (SYSAPI == "SC833")
|
||||||
{
|
{
|
||||||
MonitorView.Sys_log = DAT.Substring(DAT.IndexOf("]") + 1);
|
MainWindowViewModel.MachineLOG = DAT.Substring(DAT.IndexOf("]") + 1);
|
||||||
|
|
||||||
}//当前领料单信息
|
}//当前领料单信息
|
||||||
else if (SYSAPI == "SC851")
|
else if (SYSAPI == "SC851")
|
||||||
|
|||||||
+50
-55
@@ -10,8 +10,7 @@
|
|||||||
d:DataContext="{d:DesignInstance Type=viewmodel:MainWindowViewModel}"
|
d:DataContext="{d:DesignInstance Type=viewmodel:MainWindowViewModel}"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="1000" d:DesignWidth="1900">
|
d:DesignHeight="1000" d:DesignWidth="1900">
|
||||||
<Grid Cursor="">
|
<Grid>
|
||||||
<Grid.ColumnDefinitions/>
|
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="300"/>
|
<RowDefinition Height="300"/>
|
||||||
<RowDefinition Height="5"/>
|
<RowDefinition Height="5"/>
|
||||||
@@ -20,10 +19,11 @@
|
|||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<DataGrid Grid.Row="0" Grid.Column="0" x:Name="Griddata" AlternationCount="2" IsReadOnly="True" SelectionChanged="Griddata_SelectionChanged"
|
<DataGrid Grid.Row="0" Grid.Column="0" x:Name="Griddata" AlternationCount="2" IsReadOnly="True" SelectionChanged="Griddata_SelectionChanged"
|
||||||
d:ItemsSource="{d:SampleData ItemCount=999}" AutoGenerateColumns="False" MinColumnWidth="30"
|
d:ItemsSource="{d:SampleData ItemCount=999}" AutoGenerateColumns="False" MinColumnWidth="30"
|
||||||
|
ItemsSource="{Binding Path=TechnologicalMachine_View,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
|
||||||
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" Background="White"
|
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" Background="White"
|
||||||
GridLinesVisibility="All" ColumnHeaderHeight="40" HorizontalContentAlignment="Right"
|
GridLinesVisibility="All" ColumnHeaderHeight="40" HorizontalContentAlignment="Right"
|
||||||
CanUserReorderColumns="False" CanUserSortColumns="False" CanUserResizeRows="False" CanUserResizeColumns="False"
|
CanUserReorderColumns="False" CanUserSortColumns="False" CanUserResizeRows="False" CanUserResizeColumns="False"
|
||||||
CanUserDeleteRows="False" SelectionMode="Single" FontSize="15" Focusable="True">
|
CanUserDeleteRows="False" SelectionMode="Single" FontSize="15" Focusable="True" >
|
||||||
<DataGrid.RowStyle >
|
<DataGrid.RowStyle >
|
||||||
<Style TargetType="{x:Type DataGridRow}">
|
<Style TargetType="{x:Type DataGridRow}">
|
||||||
<Setter Property="Height" Value="30" />
|
<Setter Property="Height" Value="30" />
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
</DataGrid>
|
</DataGrid>
|
||||||
<GridSplitter Grid.Row="1" Height="5" HorizontalAlignment="Stretch" Background="#FF00204E"/>
|
<GridSplitter Grid.Row="1" Height="5" HorizontalAlignment="Stretch" Background="#FF00204E"/>
|
||||||
<Grid Grid.Row="2">
|
<Grid Grid.Row="2" d:DataContext="{d:DesignInstance Type=viewmodel:MainWindowViewModel}">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition/>
|
<ColumnDefinition/>
|
||||||
<ColumnDefinition Width="5"/>
|
<ColumnDefinition Width="5"/>
|
||||||
@@ -73,62 +73,57 @@
|
|||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<DataGrid Grid.Column="2" x:Name="Gridstep" AlternationCount="2" IsReadOnly="True" SelectionChanged="Gridstep_SelectionChanged"
|
<DataGrid Grid.Column="2" x:Name="Gridstep" AlternationCount="2" IsReadOnly="True" SelectionChanged="Gridstep_SelectionChanged"
|
||||||
d:ItemsSource="{d:SampleData ItemCount=90}" AutoGenerateColumns="False" MinColumnWidth="30"
|
d:ItemsSource="{d:SampleData ItemCount=90}" AutoGenerateColumns="False" MinColumnWidth="30"
|
||||||
ItemsSource="{Binding Path=TechnologicalProcess_View,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
|
ItemsSource="{Binding Path=TechnologicalProcess_View,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
|
||||||
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" Background="White"
|
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" Background="White"
|
||||||
GridLinesVisibility="All" ColumnHeaderHeight="40" HorizontalContentAlignment="Right"
|
GridLinesVisibility="All" ColumnHeaderHeight="40" HorizontalContentAlignment="Right"
|
||||||
CanUserReorderColumns="False" CanUserSortColumns="False" CanUserResizeRows="False" CanUserResizeColumns="False"
|
CanUserReorderColumns="False" CanUserSortColumns="False" CanUserResizeRows="False" CanUserResizeColumns="False"
|
||||||
CanUserDeleteRows="False" SelectionMode="Single" FontSize="15" Focusable="True">
|
CanUserDeleteRows="False" SelectionMode="Single" FontSize="15" Focusable="True" >
|
||||||
<DataGrid.RowStyle >
|
<DataGrid.RowStyle >
|
||||||
<Style TargetType="{x:Type DataGridRow}">
|
<Style TargetType="{x:Type DataGridRow}">
|
||||||
<Setter Property="Height" Value="30" />
|
<Setter Property="Height" Value="30" />
|
||||||
<Setter Property="FontSize" Value="25" />
|
<Setter Property="FontSize" Value="25" />
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="ItemsControl.AlternationIndex" Value="0">
|
<Trigger Property="ItemsControl.AlternationIndex" Value="0">
|
||||||
<Setter Property="Background" Value="#FFFFFFFF" />
|
<Setter Property="Background" Value="#FFFFFFFF" />
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
|
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
|
||||||
<Setter Property="Background" Value="#FFF0F0F0" />
|
<Setter Property="Background" Value="#FFF0F0F0" />
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsMouseOver" Value="False"/>
|
<Trigger Property="IsMouseOver" Value="False"/>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
</DataGrid.RowStyle>
|
</DataGrid.RowStyle>
|
||||||
<DataGrid.CellStyle>
|
<DataGrid.CellStyle>
|
||||||
<Style TargetType="DataGridCell">
|
<Style TargetType="DataGridCell">
|
||||||
<Setter Property="BorderThickness" Value="0"/>
|
<Setter Property="BorderThickness" Value="0"/>
|
||||||
<Setter Property="MinWidth" Value="20"/>
|
<Setter Property="MinWidth" Value="20"/>
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="IsSelected" Value="True">
|
<Trigger Property="IsSelected" Value="True">
|
||||||
<Setter Property="Background" Value="#FFC0C0C0"/>
|
<Setter Property="Background" Value="#FFC0C0C0"/>
|
||||||
<Setter Property="BorderBrush" Value="#FFC0C0C0"/>
|
<Setter Property="BorderBrush" Value="#FFC0C0C0"/>
|
||||||
<Setter Property="Foreground" Value="Black"/>
|
<Setter Property="Foreground" Value="Black"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
</DataGrid.CellStyle>
|
</DataGrid.CellStyle>
|
||||||
<DataGrid.Columns>
|
<DataGrid.Columns>
|
||||||
<!--列信息绑定-->
|
<!--列信息绑定-->
|
||||||
<DataGridTextColumn Binding="{Binding ProgramID}" Width="0" MinWidth="0" MaxWidth="0"/>
|
<DataGridTextColumn Binding="{Binding ProgramID}" Width="0" MinWidth="0" MaxWidth="0"/>
|
||||||
<DataGridTextColumn Binding="{Binding Program}" Width="0" MinWidth="0" MaxWidth="0"/>
|
<DataGridTextColumn Binding="{Binding Program}" Width="0" MinWidth="0" MaxWidth="0"/>
|
||||||
<DataGridTextColumn Header="{x:Static lang:Resources.Step}" Binding="{Binding Step}" Width="70" IsReadOnly="True"/>
|
<DataGridTextColumn Binding="{Binding Step}" Width="70" Header="{x:Static lang:Resources.Step}" IsReadOnly="True"/>
|
||||||
<DataGridTextColumn Header="{x:Static lang:Resources.Code}" Width="0" MinWidth="0" MaxWidth="0" Binding="{Binding StepID}" IsReadOnly="True"/>
|
<DataGridTextColumn Binding="{Binding StepID}" Width="0" MinWidth="0" MaxWidth="0" IsReadOnly="True"/>
|
||||||
<DataGridTextColumn Header="{x:Static lang:Resources.Directives}" Width="300" Binding="{Binding StepName}" IsReadOnly="True"/>
|
<DataGridTextColumn Binding="{Binding StepName}" Header="{x:Static lang:Resources.Directives}" Width="300" IsReadOnly="True"/>
|
||||||
<DataGridTextColumn Header="{x:Static lang:Resources.ParameterSet}" Width="*" Binding="{Binding ParameterName}" IsReadOnly="True"/>
|
<DataGridTextColumn Binding="{Binding ParameterName}" Header="{x:Static lang:Resources.ParameterSet}" Width="*" IsReadOnly="True"/>
|
||||||
<DataGridTextColumn Binding="{Binding Parameter1}" Width="0" MinWidth="0" MaxWidth="0"/>
|
<DataGridTextColumn Binding="{Binding Parameter1}" Width="0" MinWidth="0" MaxWidth="0"/>
|
||||||
<DataGridTextColumn Binding="{Binding Parameter2}" Width="0" MinWidth="0" MaxWidth="0"/>
|
<DataGridTextColumn Binding="{Binding Parameter2}" Width="0" MinWidth="0" MaxWidth="0"/>
|
||||||
<DataGridTextColumn Binding="{Binding Parameter3}" Width="0" MinWidth="0" MaxWidth="0"/>
|
<DataGridTextColumn Binding="{Binding Parameter3}" Width="0" MinWidth="0" MaxWidth="0"/>
|
||||||
<DataGridTextColumn Binding="{Binding Parameter4}" Width="0" MinWidth="0" MaxWidth="0"/>
|
<DataGridTextColumn Binding="{Binding Parameter4}" Width="0" MinWidth="0" MaxWidth="0"/>
|
||||||
<DataGridTextColumn Binding="{Binding Parameter5}" Width="0" MinWidth="0" MaxWidth="0"/>
|
<DataGridTextColumn Binding="{Binding Parameter5}" Width="0" MinWidth="0" MaxWidth="0"/>
|
||||||
<DataGridTextColumn Binding="{Binding Parameter6}" Width="0" MinWidth="0" MaxWidth="0"/>
|
<DataGridTextColumn Binding="{Binding DYELOT}" Width="0" MinWidth="0" MaxWidth="0"/>
|
||||||
<DataGridTextColumn Binding="{Binding Parameter7}" Width="0" MinWidth="0" MaxWidth="0"/>
|
</DataGrid.Columns>
|
||||||
<DataGridTextColumn Binding="{Binding Parameter8}" Width="0" MinWidth="0" MaxWidth="0"/>
|
|
||||||
<DataGridTextColumn Binding="{Binding Parameter9}" Width="0" MinWidth="0" MaxWidth="0"/>
|
|
||||||
<DataGridTextColumn Binding="{Binding Parameter10}" Width="0" MinWidth="0" MaxWidth="0"/>
|
|
||||||
<DataGridTextColumn Binding="{Binding DYELOT}" Width="0" MinWidth="0" MaxWidth="0"/>
|
|
||||||
</DataGrid.Columns>
|
|
||||||
</DataGrid>
|
</DataGrid>
|
||||||
<TextBlock Grid.Column="0" x:Name="machin_LOG" TextWrapping="Wrap" FontSize="27" VerticalAlignment="Top" Height="40" Background="#FF2793FF" Foreground="White" FontWeight="Bold"/>
|
<TextBlock Grid.Column="0" x:Name="machin_LOG" TextWrapping="Wrap" FontSize="27" VerticalAlignment="Top" Height="40" Background="#FF2793FF" Foreground="White" FontWeight="Bold"/>
|
||||||
<TextBlock Grid.Column="0" x:Name="log" TextWrapping="Wrap" FontSize="25" Background="White" Margin="0,42,4,-2" Grid.ColumnSpan="2"/>
|
<TextBlock Grid.Column="0" x:Name="log" Text="{Binding Sys_machine}" TextWrapping="Wrap" FontSize="25" Background="White" Margin="0,42,4,-2" Grid.ColumnSpan="2"/>
|
||||||
<GridSplitter Grid.Row="0" Grid.Column="1" Width="5" HorizontalAlignment="Center" Background="#FF00204E"/>
|
<GridSplitter Grid.Row="0" Grid.Column="1" Width="5" HorizontalAlignment="Center" Background="#FF00204E"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<StackPanel Grid.Row="3" x:Name="mt" VerticalAlignment="Bottom" Height="60" Background="#FF00204E" Orientation="Horizontal" Margin="0,0,0,0" Width="700" HorizontalAlignment="Left">
|
<StackPanel Grid.Row="3" x:Name="mt" VerticalAlignment="Bottom" Height="60" Background="#FF00204E" Orientation="Horizontal" Margin="0,0,0,0" Width="700" HorizontalAlignment="Left">
|
||||||
|
|||||||
@@ -37,8 +37,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
|||||||
public MonitorView()
|
public MonitorView()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
Griddata.ItemsSource = MainWindowViewModel.Machines.DefaultView;
|
|
||||||
CountDown();
|
CountDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,9 +48,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
|||||||
|
|
||||||
private void Griddata_SelectionChanged(object sender, SelectionChangedEventArgs e)//设备列表
|
private void Griddata_SelectionChanged(object sender, SelectionChangedEventArgs e)//设备列表
|
||||||
{
|
{
|
||||||
Gridstep.ItemsSource = null; log.Text = null;
|
|
||||||
Stop.IsEnabled = true;
|
Stop.IsEnabled = true;
|
||||||
|
|
||||||
int rownum = Griddata.SelectedIndex;//获取鼠标选中行并定义变量
|
int rownum = Griddata.SelectedIndex;//获取鼠标选中行并定义变量
|
||||||
if (rownum != -1)//判断鼠标定位是否有效
|
if (rownum != -1)//判断鼠标定位是否有效
|
||||||
{
|
{
|
||||||
@@ -142,7 +138,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
|||||||
private void ListViewItem_edit(object sender, MouseButtonEventArgs e)
|
private void ListViewItem_edit(object sender, MouseButtonEventArgs e)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(Numder)) { Numder = null; P1 = "0"; P2 = "0"; P3 = "0"; P4 = "0"; P5 = "0"; }
|
if (string.IsNullOrEmpty(Numder)) { Numder = null; P1 = "0"; P2 = "0"; P3 = "0"; P4 = "0"; P5 = "0"; }
|
||||||
if (ID == null) ID = TechnologicalProcess.Rows.Count.ToString();
|
|
||||||
ViewStep viewstop = new ViewStep(Numder, P1, P2, P3, P4, P5);
|
ViewStep viewstop = new ViewStep(Numder, P1, P2, P3, P4, P5);
|
||||||
viewstop.data = ID;
|
viewstop.data = ID;
|
||||||
viewstop.AddressUpdated += new ViewStep.AddressUpdateHandler(edit_ButtonClicked);
|
viewstop.AddressUpdated += new ViewStep.AddressUpdateHandler(edit_ButtonClicked);
|
||||||
@@ -177,7 +172,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
|||||||
}//跳步
|
}//跳步
|
||||||
private void ListViewItem_Insert(object sender, MouseButtonEventArgs e)
|
private void ListViewItem_Insert(object sender, MouseButtonEventArgs e)
|
||||||
{
|
{
|
||||||
if (ID == null) ID = (TechnologicalProcess.Rows.Count).ToString();
|
|
||||||
ViewStep viewstop = new ViewStep(null, "0", "0", "0", "0", "0");
|
ViewStep viewstop = new ViewStep(null, "0", "0", "0", "0", "0");
|
||||||
viewstop.data = ID;
|
viewstop.data = ID;
|
||||||
viewstop.AddressUpdated += new ViewStep.AddressUpdateHandler(Insert_ButtonClicked);
|
viewstop.AddressUpdated += new ViewStep.AddressUpdateHandler(Insert_ButtonClicked);
|
||||||
@@ -211,14 +205,12 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
|||||||
{
|
{
|
||||||
DispatcherTimer timer1s = new DispatcherTimer//初始化循环,每1秒调用一次Tick
|
DispatcherTimer timer1s = new DispatcherTimer//初始化循环,每1秒调用一次Tick
|
||||||
{
|
{
|
||||||
Interval = TimeSpan.FromSeconds(1)//秒
|
Interval = TimeSpan.FromSeconds(1.5)//秒
|
||||||
};
|
};
|
||||||
timer1s.Tick += Tick_Event_1S;
|
timer1s.Tick += Tick_Event_1S;
|
||||||
timer1s.Start();
|
timer1s.Start();
|
||||||
}//时间周期初始化
|
}//时间周期初始化
|
||||||
|
|
||||||
public static DataTable TechnologicalProcess =new DataTable();
|
|
||||||
|
|
||||||
void Tick_Event_1S(object sender, EventArgs e)//Tick_Event周期执行事件1S
|
void Tick_Event_1S(object sender, EventArgs e)//Tick_Event周期执行事件1S
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(machine))
|
if (!string.IsNullOrEmpty(machine))
|
||||||
@@ -242,38 +234,25 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
|||||||
{
|
{
|
||||||
MainWindowViewModel.MachiensTcpClient[index].SendAsync("SC833" + MainWindowViewModel.Selet_Machines(MainWindowViewModel.Machines, "SYSKEY", index));
|
MainWindowViewModel.MachiensTcpClient[index].SendAsync("SC833" + MainWindowViewModel.Selet_Machines(MainWindowViewModel.Machines, "SYSKEY", index));
|
||||||
}//单据
|
}//单据
|
||||||
log.Text = Sys_log;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
log.Text = null;
|
MainWindowViewModel.MachineLOG = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((State_ == 101) || (State_ == 201) || (State_ == 202) || (State_ == 309))//获得细节信息
|
if ((State_ == 101) || (State_ == 201) || (State_ == 202) || (State_ == 309))//获得细节信息
|
||||||
{
|
{
|
||||||
MainWindowViewModel.MachiensTcpClient[index].SendAsync("SC831" + MainWindowViewModel.Selet_Machines(MainWindowViewModel.Machines, "SYSKEY", index));
|
MainWindowViewModel.MachiensTcpClient[index].SendAsync("SC831" + MainWindowViewModel.Selet_Machines(MainWindowViewModel.Machines, "SYSKEY", index));
|
||||||
if (TechnologicalProcess.Rows.Count > 0)
|
|
||||||
{
|
|
||||||
// Gridstep.ItemsSource = MainWindowViewModel.dt_TP.DefaultView;
|
|
||||||
// if (!Equals(Gridstep.ItemsSource , TechnologicalProcess.DefaultView))
|
|
||||||
// {
|
|
||||||
MainWindowViewModel.dt_TP = TechnologicalProcess;
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// MainWindowViewModel.dt_TP = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// MainWindowViewModel.dt_TP = null;
|
MainWindowViewModel.dt_TP.Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception )
|
catch (Exception )
|
||||||
{
|
{
|
||||||
log.Text = null;
|
// MainWindowViewModel.MachineLOG = null;
|
||||||
// MainWindowViewModel.dt_TP = null;
|
// MainWindowViewModel.dt_TP.Clear();
|
||||||
}//返回错误为空
|
}//返回错误为空
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,12 +77,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public string sys_Time; //显示系统时间
|
|
||||||
public string Sys_Time //通知UI控件参数改变
|
|
||||||
{
|
|
||||||
get { return sys_Time; }
|
|
||||||
set { sys_Time = value; OnPropertyChanged("Sys_Time"); }
|
|
||||||
}
|
|
||||||
public void CountDown()
|
public void CountDown()
|
||||||
{
|
{
|
||||||
DispatcherTimer timer1s = new DispatcherTimer//初始化循环,每1秒调用一次Tick
|
DispatcherTimer timer1s = new DispatcherTimer//初始化循环,每1秒调用一次Tick
|
||||||
@@ -121,7 +116,15 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
|||||||
//Updata_Machines(Machines, Convert.ToInt16(dt["ID"]), "State", "800");
|
//Updata_Machines(Machines, Convert.ToInt16(dt["ID"]), "State", "800");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (int i = 0; i < Machinesdata_Count; i++)
|
||||||
|
{
|
||||||
|
string mac_s = Selet_Machines(Machines, "State", i).ToString();
|
||||||
|
if ((mac_s == "101") || (mac_s == "201") || (mac_s == "202") || (mac_s == "309"))//获取信息
|
||||||
|
{
|
||||||
|
MachiensTcpClient[i].SendAsync("SC830" + Selet_Machines(Machines, "SYSKEY", i).ToString());
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
void Tick_Event_5S(object sender, EventArgs e)//Tick_Event周期执行事件5S
|
void Tick_Event_5S(object sender, EventArgs e)//Tick_Event周期执行事件5S
|
||||||
{
|
{
|
||||||
@@ -139,15 +142,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
|||||||
{
|
{
|
||||||
DATA_view();
|
DATA_view();
|
||||||
|
|
||||||
for (int i = 0; i < Machinesdata_Count; i++)
|
|
||||||
{
|
|
||||||
string mac_s = Selet_Machines(Machines, "State", i).ToString();
|
|
||||||
if ((mac_s == "101")|| (mac_s == "201") || (mac_s == "202")|| (mac_s == "309"))//获取信息
|
|
||||||
{
|
|
||||||
MachiensTcpClient[i].SendAsync("SC830" + Selet_Machines(Machines, "SYSKEY", i).ToString());
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private SQLiteHelper SQLiteHelpers = null; //定义数据库
|
private SQLiteHelper SQLiteHelpers = null; //定义数据库
|
||||||
@@ -192,8 +187,19 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
|||||||
public static int SYS_AT3;
|
public static int SYS_AT3;
|
||||||
|
|
||||||
|
|
||||||
|
public string sys_Time; //显示系统时间
|
||||||
|
public string Sys_Time //通知UI控件参数改变
|
||||||
|
{
|
||||||
|
get { return sys_Time; }
|
||||||
|
set { sys_Time = value; OnPropertyChanged("Sys_Time"); }
|
||||||
|
}
|
||||||
|
public static string MachineLOG;
|
||||||
|
public string sys_machine; //显示log
|
||||||
|
public string Sys_machine //通知UI控件参数改变
|
||||||
|
{
|
||||||
|
get { return sys_machine; }
|
||||||
|
set { sys_machine = value; OnPropertyChanged("Sys_machine"); }
|
||||||
|
}
|
||||||
|
|
||||||
public static object Selet_Machines(DataTable DB, string name, int key)//查询
|
public static object Selet_Machines(DataTable DB, string name, int key)//查询
|
||||||
{
|
{
|
||||||
@@ -238,6 +244,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
|||||||
public static DataTable dt_d = new DataTable("DIO");
|
public static DataTable dt_d = new DataTable("DIO");
|
||||||
public static DataTable dt_a = new DataTable("AIO");
|
public static DataTable dt_a = new DataTable("AIO");
|
||||||
public static DataTable dt_m = new DataTable("M");
|
public static DataTable dt_m = new DataTable("M");
|
||||||
|
public static DataTable dt_TM = new DataTable();
|
||||||
public static DataTable dt_TP = new DataTable();
|
public static DataTable dt_TP = new DataTable();
|
||||||
private async void DATA_view()//IO显示
|
private async void DATA_view()//IO显示
|
||||||
{
|
{
|
||||||
@@ -245,7 +252,16 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
TechnologicalProcess_View = ToObservableCollection<Technological>(dt_TP);
|
TechnologicalMachine_View = ToObservableCollection<TechnologicalM>(Machines);
|
||||||
|
}
|
||||||
|
catch (Exception) { }
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (dt_TP.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
TechnologicalProcess_View = ToObservableCollection<TechnologicalP>(dt_TP);
|
||||||
|
Sys_machine = MachineLOG;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception) { }
|
catch (Exception) { }
|
||||||
});
|
});
|
||||||
@@ -254,7 +270,8 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
|||||||
ObservableCollection<DATA_A> sysData_A = new ObservableCollection<DATA_A>();
|
ObservableCollection<DATA_A> sysData_A = new ObservableCollection<DATA_A>();
|
||||||
ObservableCollection<DATA_D> sysData_D = new ObservableCollection<DATA_D>();
|
ObservableCollection<DATA_D> sysData_D = new ObservableCollection<DATA_D>();
|
||||||
ObservableCollection<DATA_M> sysData_M = new ObservableCollection<DATA_M>();
|
ObservableCollection<DATA_M> sysData_M = new ObservableCollection<DATA_M>();
|
||||||
ObservableCollection<Technological> technologicalProcess_View = new ObservableCollection<Technological>();
|
ObservableCollection<TechnologicalP> technologicalProcess_View = new ObservableCollection<TechnologicalP>();
|
||||||
|
ObservableCollection<TechnologicalM> technologicalMachine_View = new ObservableCollection<TechnologicalM>();
|
||||||
public ObservableCollection<DATA_A> SYSData_A
|
public ObservableCollection<DATA_A> SYSData_A
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -285,9 +302,8 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
|||||||
RaisePropertyChanged("SYSData_M");
|
RaisePropertyChanged("SYSData_M");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public ObservableCollection<Technological> TechnologicalProcess_View
|
public ObservableCollection<TechnologicalP> TechnologicalProcess_View
|
||||||
{
|
{
|
||||||
|
|
||||||
get { return technologicalProcess_View; }
|
get { return technologicalProcess_View; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
@@ -295,6 +311,15 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
|||||||
RaisePropertyChanged("TechnologicalProcess_View");
|
RaisePropertyChanged("TechnologicalProcess_View");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public ObservableCollection<TechnologicalM> TechnologicalMachine_View
|
||||||
|
{
|
||||||
|
get { return technologicalMachine_View; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
technologicalMachine_View = value;
|
||||||
|
RaisePropertyChanged("TechnologicalMachine_View");
|
||||||
|
}
|
||||||
|
}
|
||||||
public class DATA_A
|
public class DATA_A
|
||||||
{
|
{
|
||||||
public string IOName { get; set; }
|
public string IOName { get; set; }
|
||||||
@@ -319,7 +344,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
|||||||
public string PLC { get; set; }
|
public string PLC { get; set; }
|
||||||
public string type { get; set; }
|
public string type { get; set; }
|
||||||
}
|
}
|
||||||
public class Technological
|
public class TechnologicalP
|
||||||
{
|
{
|
||||||
public string ProgramID { get; set; }
|
public string ProgramID { get; set; }
|
||||||
public string Program { get; set; }
|
public string Program { get; set; }
|
||||||
@@ -332,13 +357,20 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
|||||||
public string Parameter3 { get; set; }
|
public string Parameter3 { get; set; }
|
||||||
public string Parameter4 { get; set; }
|
public string Parameter4 { get; set; }
|
||||||
public string Parameter5 { get; set; }
|
public string Parameter5 { get; set; }
|
||||||
public string Parameter6 { get; set; }
|
|
||||||
public string Parameter7 { get; set; }
|
|
||||||
public string Parameter8 { get; set; }
|
|
||||||
public string Parameter9 { get; set; }
|
|
||||||
public string Parameter10 { get; set; }
|
|
||||||
public string DYELOT { get; set; }
|
public string DYELOT { get; set; }
|
||||||
}
|
}
|
||||||
|
public class TechnologicalM
|
||||||
|
{
|
||||||
|
public string Name { get; set; }
|
||||||
|
public string WorkOrder { get; set; }
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public string Temperature { get; set; }
|
||||||
|
public string WaterLevel { get; set; }
|
||||||
|
public string Process { get; set; }
|
||||||
|
public string Step { get; set; }
|
||||||
|
public string Message { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
public ObservableCollection<T> ToObservableCollection<T>(DataTable dt) where T : class, new()
|
public ObservableCollection<T> ToObservableCollection<T>(DataTable dt) where T : class, new()
|
||||||
{
|
{
|
||||||
Type t = typeof(T);
|
Type t = typeof(T);
|
||||||
|
|||||||
Reference in new issue
Block a user