添加步骤页面参数及工单
This commit is contained in:
commit
10508fb79a
7 files changed
+183
-56
No files matched your search
@@ -84,10 +84,97 @@
|
||||
<DataGridTextColumn Binding="{Binding DYELOT}" Width="0" MinWidth="0" MaxWidth="0"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<ScrollViewer HorizontalAlignment="Left" Width="600" Margin="0,40,0,0" VerticalScrollBarVisibility="Auto"
|
||||
PanningMode="VerticalOnly">
|
||||
<TextBlock x:Name="log" TextWrapping="Wrap" FontSize="25" Background="White" Text="{Binding Sys_log}" />
|
||||
</ScrollViewer>
|
||||
<Grid Width="600" Margin="0,40,0,0" HorizontalAlignment="Left" >
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" PanningMode="VerticalOnly">
|
||||
<TextBlock x:Name="log" TextWrapping="Wrap" FontSize="25" Background="White"
|
||||
Text="{Binding Sys_log}" />
|
||||
</ScrollViewer>
|
||||
<DataGrid x:Name="Receip" HorizontalAlignment="Left" IsHitTestVisible="False" Visibility="Collapsed"
|
||||
AutoGenerateColumns="False" FontSize="15" AlternationCount="2"
|
||||
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9"
|
||||
ColumnHeaderHeight="40" >
|
||||
<DataGrid.RowStyle >
|
||||
<Style TargetType="{x:Type DataGridRow}">
|
||||
<Setter Property="IsHitTestVisible" Value="False"/>
|
||||
<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"/>
|
||||
<DataTrigger Binding="{Binding Amount}" Value="{x:Null}">
|
||||
<Setter Property="Foreground" Value="#FFADADAD"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Amount}" Value="0">
|
||||
<Setter Property="Foreground" Value="Red"/>
|
||||
</DataTrigger>
|
||||
</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.Step}" Binding="{Binding Step}" Width="60"/>
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.Directives}" Width="200" Binding="{Binding ProductCode}"/>
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.ParameterSet}" Width="*" Binding="{Binding Grams}"/>
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.ParameterSet}" Width="*" Binding="{Binding Amount}"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<DataGrid x:Name="Parameter_set" HorizontalAlignment="Left" Visibility="Collapsed"
|
||||
AutoGenerateColumns="False" FontSize="15" AlternationCount="2"
|
||||
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9"
|
||||
ColumnHeaderHeight="40" >
|
||||
<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.ParameterSet}" Binding="{Binding Name}" Width="200"/>
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.ParameterSet}" Width="200" Binding="{Binding ParameterSet}"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
<TextBlock x:Name="name" HorizontalAlignment="Left" Margin="600,0,0,0" TextWrapping="Wrap" FontSize="24" Background="#FFD0D0D0" Text="{Binding Program_Name}" Height="30" Block.TextAlignment="Center">
|
||||
<TextBlock.LayoutTransform>
|
||||
<!--文字同样旋转90度-->
|
||||
@@ -99,7 +186,7 @@
|
||||
<Button Content="{x:Static lang:Resources.Receipt}" FontSize="20" HorizontalAlignment="Left" Height="40" VerticalAlignment="Top" Width="200" Background="White" Click="Receipt_Click"/>
|
||||
<Button Content="{x:Static lang:Resources.ParameterSet}" FontSize="20" HorizontalAlignment="Left" Height="40" VerticalAlignment="Top" Width="200" Background="White" Click="ParameterSet_Click"/>
|
||||
</WrapPanel>
|
||||
<WrapPanel Orientation="Horizontal" Background="#FFCCCCCC" VerticalAlignment="Top" Margin="630,0,0,0">
|
||||
<WrapPanel Orientation="Horizontal" Background="#FFCCCCCC" VerticalAlignment="Top" Margin="630,0,0,0">
|
||||
<Button Content="{x:Static lang:Resources.edit}" x:Name="ProgramgroupView_edit" FontSize="20" HorizontalAlignment="Left" Height="40" VerticalAlignment="Top" Width="200" Background="White"
|
||||
Click="ProgramgroupView_edit_Click" IsEnabled="{Binding UserButton}"/>
|
||||
<Button Content="{x:Static lang:Resources.Delete}" x:Name="ProgramgroupView_del" FontSize="20" HorizontalAlignment="Left" Height="40" VerticalAlignment="Top" Width="200" Background="White"
|
||||
|
||||
@@ -54,21 +54,31 @@ namespace DyeingComputer.View
|
||||
{
|
||||
InitializeComponent();
|
||||
//Grid.DataContext = new MainWindowViewModel();
|
||||
// FocusManager.SetFocusedElement(Grid, Grid);
|
||||
// if (workName != null)
|
||||
// {
|
||||
// TechnologicalProcess_Import();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
TechnologicalProcess_sql();
|
||||
// FocusManager.SetFocusedElement(Grid, Grid);
|
||||
// if (workName != null)
|
||||
// {
|
||||
// TechnologicalProcess_Import();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
TechnologicalProcess_sql();
|
||||
// }
|
||||
|
||||
// ProgramgroupView_edit.IsEnabled = false;
|
||||
// ProgramgroupView_del.IsEnabled = false;
|
||||
// ProgramgroupView_Insert.IsEnabled = false;
|
||||
}
|
||||
|
||||
// ProgramgroupView_edit.IsEnabled = false;
|
||||
// ProgramgroupView_del.IsEnabled = false;
|
||||
// ProgramgroupView_Insert.IsEnabled = false;
|
||||
tblDatas.Columns.Add("Name", Type.GetType("System.String"));
|
||||
tblDatas.Columns.Add("Value", Type.GetType("System.Double"));
|
||||
tblDatas.Columns.Add("ID", Type.GetType("System.String"));
|
||||
|
||||
DataRow newRow;
|
||||
newRow = tblDatas.NewRow();
|
||||
newRow["Name"] = Properties.Resources.PumpSpeed;//
|
||||
newRow["Value"] = MainWindowViewModel.Selet_dtm("1020");
|
||||
newRow["ID"] = "1020";
|
||||
tblDatas.Rows.Add(newRow);
|
||||
}
|
||||
DataTable tblDatas = new DataTable("Datas");
|
||||
public static object workName;
|
||||
public static SQLiteHelper SQLiteHelpers = null; //定义数据库
|
||||
public static readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\800COMPUTER.db"; //数据库路径
|
||||
@@ -125,7 +135,7 @@ namespace DyeingComputer.View
|
||||
|
||||
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// FocusManager.SetFocusedElement(Grid, Grid);
|
||||
// FocusManager.SetFocusedElement(Grid, Grid);
|
||||
// Grid.DataContext = new MainWindowViewModel();
|
||||
if (workName != null)
|
||||
{
|
||||
@@ -150,7 +160,7 @@ namespace DyeingComputer.View
|
||||
{
|
||||
MainWindowViewModel.WORK_RUN = 2;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
MainWindowViewModel.RUN_DATATABLE = sql.Tables[0];//缓存表
|
||||
MainWindowViewModel.RUN_STEPID = Convert.ToInt16(ID);//插入步骤号
|
||||
@@ -173,7 +183,7 @@ namespace DyeingComputer.View
|
||||
private void Address_ButtonClicked(object sender, AddressUpdateEventArgs e)//编辑返回结果
|
||||
{
|
||||
int n = Convert.ToInt16(ID);
|
||||
ID=null;
|
||||
ID = null;
|
||||
DataRow dr = sql.Tables[0].Rows[n - 1];
|
||||
dr.BeginEdit();
|
||||
dr["StepID"] = e.StepID;
|
||||
@@ -271,7 +281,7 @@ namespace DyeingComputer.View
|
||||
dr["Program"] = ProgramNAME;
|
||||
|
||||
sql.Tables[0].Rows.InsertAt(dr, d - 1);
|
||||
// ID = null;
|
||||
// ID = null;
|
||||
|
||||
Dat();
|
||||
|
||||
@@ -288,15 +298,27 @@ namespace DyeingComputer.View
|
||||
string ID = null;
|
||||
string P1 = "0", P2 = "0", P3 = "0", P4 = "0", P5 = "0";
|
||||
|
||||
private void DyeingMachine_Click(object sender, RoutedEventArgs e)
|
||||
private void DyeingMachine_Click(object sender, RoutedEventArgs e)//染色剂
|
||||
{
|
||||
|
||||
Receip.Visibility = Visibility.Collapsed;
|
||||
// Parameter_Scroll.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
private void Receipt_Click(object sender, RoutedEventArgs e)
|
||||
private void Receipt_Click(object sender, RoutedEventArgs e)//领料单
|
||||
{
|
||||
|
||||
Receip.Visibility = Visibility.Visible;
|
||||
// Parameter_Scroll.Visibility = Visibility.Collapsed;
|
||||
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||
SQLiteHelpers.Open(); //打开数据库
|
||||
string sql_script = "select * from Dyelot where WorkOrder = '" + MainWindowViewModel.WorkNumder + "'";
|
||||
Receip.ItemsSource = SQLiteHelpers.ExecuteDataSet(sql_script, null).Tables[0].DefaultView; //转换显示
|
||||
SQLiteHelpers.Close(); //关闭连接
|
||||
}
|
||||
|
||||
private void ParameterSet_Click(object sender, RoutedEventArgs e)//参数
|
||||
{
|
||||
// Parameter_Scroll.Visibility = Visibility.Visible;
|
||||
Receip.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
private void ProgramgroupView_run_Click(object sender, RoutedEventArgs e)//运行/暂停
|
||||
{
|
||||
|
||||
@@ -307,11 +329,6 @@ namespace DyeingComputer.View
|
||||
|
||||
}
|
||||
|
||||
private void ParameterSet_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void Grid_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (MainWindowViewModel.WORK_RUN == 2) GridSTEP.SelectedIndex = MainWindowViewModel.RUN_STEPID - 1;//设定图表显示
|
||||
@@ -331,7 +348,7 @@ namespace DyeingComputer.View
|
||||
ProgramgroupView_Insert.IsEnabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void CountDown()
|
||||
{
|
||||
DispatcherTimer timer1s = new DispatcherTimer//初始化循环,每1秒调用一次Tick
|
||||
@@ -344,10 +361,14 @@ namespace DyeingComputer.View
|
||||
void Tick_Event_1S(object sender, EventArgs e)//Tick_Event周期执行事件1S
|
||||
{
|
||||
if (MainWindowViewModel.WORK_RUN == 2) GridSTEP.SelectedIndex = MainWindowViewModel.RUN_STEPID - 1;//设定图表显示
|
||||
if (sql != null)
|
||||
if (sql != null)
|
||||
{
|
||||
dt_TP= sql.Tables[0];
|
||||
dt_TP = sql.Tables[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user