sc 1 year ago
parent
commit
aa827e30c1
  1. 1
      View/TechnologicalProcessView.xaml
  2. 22
      View/TechnologicalProcessView.xaml.cs

1
View/TechnologicalProcessView.xaml

@ -62,6 +62,7 @@
<DataGridTextColumn Binding="{Binding Parameter8}" Width="0" MinWidth="0" MaxWidth="0"/> <DataGridTextColumn Binding="{Binding Parameter8}" Width="0" MinWidth="0" MaxWidth="0"/>
<DataGridTextColumn Binding="{Binding Parameter9}" 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 Parameter10}" Width="0" MinWidth="0" MaxWidth="0"/>
<DataGridTextColumn Binding="{Binding DYELOT}" Width="0" MinWidth="0" MaxWidth="0"/>
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>
<TextBlock x:Name="log" HorizontalAlignment="Left" Margin="0,40,0,0" TextWrapping="Wrap" Width="600" FontSize="20" Background="White"/> <TextBlock x:Name="log" HorizontalAlignment="Left" Margin="0,40,0,0" TextWrapping="Wrap" Width="600" FontSize="20" Background="White"/>

22
View/TechnologicalProcessView.xaml.cs

@ -30,6 +30,15 @@ namespace DyeingComputer.View
public TechnologicalProcessView() public TechnologicalProcessView()
{ {
InitializeComponent(); InitializeComponent();
FocusManager.SetFocusedElement(Grid, Grid);
if (workName != null)
{
TechnologicalProcess_Import();
}
else
{
TechnologicalProcess_sql();
}
} }
public static object workName; public static object workName;
@ -77,6 +86,7 @@ namespace DyeingComputer.View
if (sql != null) sql.Clear(); //清空缓存 if (sql != null) sql.Clear(); //清空缓存
sql = SQLiteHelpers.ExecuteDataSet(sql_script, null); //读取表写入缓存 sql = SQLiteHelpers.ExecuteDataSet(sql_script, null); //读取表写入缓存
name.Text = SQLiteHelpers.ExecuteScalar("select Program from RUN where Step = '1'", null).ToString(); name.Text = SQLiteHelpers.ExecuteScalar("select Program from RUN where Step = '1'", null).ToString();
MainWindowViewModel.WorkNumder = SQLiteHelpers.ExecuteScalar("select DYELOT from RUN where Step = '1'", null).ToString();
SQLiteHelpers.Close(); //关闭连接 SQLiteHelpers.Close(); //关闭连接
if (sql != null) Grid.ItemsSource = sql.Tables[0].DefaultView; //转换显示计划表 if (sql != null) Grid.ItemsSource = sql.Tables[0].DefaultView; //转换显示计划表
@ -84,20 +94,15 @@ namespace DyeingComputer.View
private void UserControl_Loaded(object sender, RoutedEventArgs e) private void UserControl_Loaded(object sender, RoutedEventArgs e)
{ {
FocusManager.SetFocusedElement(Grid, Grid); // FocusManager.SetFocusedElement(Grid, Grid);
if (workName != null) if (workName != null)
{ {
TechnologicalProcess_Import(); Grid.SelectedIndex = 0;
//Grid.SelectedIndex = 0;
//MainWindowViewModel.Process_step = 0;
} }
else else
{ {
TechnologicalProcess_sql(); if (MainWindowViewModel.WORK_RUN != 0) Grid.SelectedIndex = MainWindowViewModel.RUN_STEPID - 1;//设定图表显示
// Grid.SelectedIndex = Convert.ToInt16(MainWindowViewModel.Process_step);
} }
if(MainWindowViewModel.WORK_RUN !=0)Grid.SelectedIndex = MainWindowViewModel.RUN_STEPID-1;//设定图表显示
} }
private void UserControl_KeyDown(object sender, KeyEventArgs e) //键盘监控 private void UserControl_KeyDown(object sender, KeyEventArgs e) //键盘监控
@ -222,6 +227,7 @@ namespace DyeingComputer.View
string P1 = "0", P2 = "0", P3 = "0", P4 = "0", P5 = "0"; string P1 = "0", P2 = "0", P3 = "0", P4 = "0", P5 = "0";
private void Grid_SelectionChanged(object sender, SelectionChangedEventArgs e) private void Grid_SelectionChanged(object sender, SelectionChangedEventArgs e)
{ {
if (MainWindowViewModel.WORK_RUN ==2) Grid.SelectedIndex = MainWindowViewModel.RUN_STEPID - 1;//设定图表显示
int rownum = Grid.SelectedIndex;//获取鼠标选中行并定义变量 int rownum = Grid.SelectedIndex;//获取鼠标选中行并定义变量
if (rownum != -1)//判断鼠标定位是否有效 if (rownum != -1)//判断鼠标定位是否有效
{ {

Loading…
Cancel
Save