sc 11 months ago
parent
commit
387f42577b
  1. 2
      View/MonitorView.xaml
  2. 28
      View/MonitorView.xaml.cs

2
View/MonitorView.xaml

@ -97,7 +97,7 @@
<ColumnDefinition Width="5"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<DataGrid Grid.Column="2" x:Name="Gridstep" AlternationCount="2" IsReadOnly="True" MouseDoubleClick="Gridstep_MouseDoubleClick"
<DataGrid Grid.Column="2" x:Name="Gridstep" AlternationCount="2" IsReadOnly="True" SelectionChanged="Gridstep_SelectionChanged"
d:ItemsSource="{d:SampleData ItemCount=90}" AutoGenerateColumns="False" MinColumnWidth="30"
ItemsSource="{Binding Path=TechnologicalProcess_View,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" Background="White"

28
View/MonitorView.xaml.cs

@ -61,8 +61,8 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
}
}
private void Gridstep_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
private void Gridstep_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
Paused.IsEnabled = true;
MainWindowViewModel.TechnologicalProcess_bool = false;
int rownum = Gridstep.SelectedIndex;//获取鼠标选中行并定义变量
@ -148,7 +148,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
viewstop.data = ID;
viewstop.AddressUpdated += new ViewStep.AddressUpdateHandler(edit_ButtonClicked);
viewstop.ShowDialog();
MainWindowViewModel.TechnologicalProcess_bool = true;
}//编辑
string Numder = null;
string ID = null;
@ -173,6 +172,8 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
int index = Convert.ToInt16(drEmployee.Field<object>("ID"));
MainWindowViewModel.stringQueue.Enqueue(new MainWindowViewModel.QueueString { ID = index,
DAT = "SC821" + MainWindowViewModel.Selet_Machines(MainWindowViewModel.Machines, "SYSKEY", index) + dat_821.ToJsonString() });
MainWindowViewModel.TechnologicalProcess_bool = true;
}
private void ListViewItem_Jump(object sender, MouseButtonEventArgs e)
@ -186,9 +187,11 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
viewstop.AddressUpdated += new ViewStep.AddressUpdateHandler(Insert_ButtonClicked);
viewstop.ShowDialog();
}//插入
private void Insert_ButtonClicked(object sender, AddressUpdateEventArgs e)//cr返回结果
{
MainWindowViewModel.TechnologicalProcess_bool = true;
Dictionary<string, object> dat_821 = new Dictionary<string, object>();
dat_821.Clear();
@ -221,6 +224,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
MainWindowViewModel.stringQueue.Enqueue(new MainWindowViewModel.QueueString { ID = index,
DAT = "SC821" + MainWindowViewModel.Selet_Machines(MainWindowViewModel.Machines, "SYSKEY", index) + dat_821.ToJsonString() });
MainWindowViewModel.TechnologicalProcess_bool = true;
}
}//删除
@ -233,9 +237,23 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
timer1s.Tick += Tick_Event_1S;
timer1s.Start();
}//时间周期初始化
int Time_D = 0;
void Tick_Event_1S(object sender, EventArgs e)//Tick_Event周期执行事件1S
{
if (Paused.IsEnabled)
{
if (!Resume.IsEnabled)
{
Time_D++;
if (Time_D > 10)
{
Paused.IsEnabled = false;
MainWindowViewModel.TechnologicalProcess_bool = true;
}
}
}else { Time_D=0; }
if (!string.IsNullOrEmpty(machine))
{
try

Loading…
Cancel
Save