添加图片资源,修改工艺启动页面,修改图形页面大小添加关机按钮
This commit is contained in:
commit
d448909269
15 files changed
+98
-107
No files matched your search
@@ -17,5 +17,8 @@
|
||||
<TextBlock Name="RX" TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Bottom" Height="30" Width="100" Margin="5,0,0,0"/>
|
||||
<TextBlock Name="TX" TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Bottom" Height="30" Width="100" Margin="200,0,0,0"/>
|
||||
|
||||
<Button Content="{x:Static lang:Resources.Shutdown}" x:Name="Shutdown" FontSize="20" HorizontalAlignment="Right" Height="40" Margin="0,0,10,10"
|
||||
VerticalAlignment="Bottom" Width="200" Background="White" Click="Shutdown_Click"/>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -65,13 +65,21 @@ namespace DyeingComputer.View
|
||||
timer1s.Start();
|
||||
}
|
||||
|
||||
|
||||
void Tick_Event_1S(object sender, EventArgs e)//Tick_Event周期执行事件1S
|
||||
{
|
||||
RX.Text = MainWindowViewModel.RX.ToString();
|
||||
TX.Text = MainWindowViewModel.TX.ToString();
|
||||
}
|
||||
|
||||
|
||||
private void Shutdown_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show(Properties.Resources.Shutdown, "800", MessageBoxButton.YesNo);
|
||||
if (messageBoxResult == MessageBoxResult.No) return;
|
||||
if (messageBoxResult == MessageBoxResult.Yes)
|
||||
{
|
||||
// Application.Current.Shutdown();
|
||||
System.Environment.Exit(0);//退出
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
-16
@@ -10,7 +10,7 @@
|
||||
xmlns:viewmodel="clr-namespace:DyeingComputer.ViewModel"
|
||||
xmlns:ConvertMoels="clr-namespace:DyeingComputer.ConvertMoels"
|
||||
d:DataContext="{d:DesignInstance Type=viewmodel:WorkOrderViewModel}"
|
||||
mc:Ignorable="d" KeyDown="UserControl_KeyDown"
|
||||
mc:Ignorable="d"
|
||||
Loaded="UserControl_Loaded"
|
||||
d:DesignHeight="630" d:DesignWidth="1280" >
|
||||
<UserControl.Resources>
|
||||
@@ -30,7 +30,7 @@
|
||||
VerticalAlignment="Top" Width="200" Background="White" Click="WorkOrderView_redy_Click"/>
|
||||
|
||||
<DataGrid x:Name="Grid" AlternationCount="2" IsReadOnly="True" SelectionChanged="Grid_SelectionChanged"
|
||||
Margin="0,40,0,300" d:ItemsSource="{d:SampleData ItemCount=20}" AutoGenerateColumns="False" MinColumnWidth="30"
|
||||
Margin="0,40,0,400" d:ItemsSource="{d:SampleData ItemCount=20}" AutoGenerateColumns="False" MinColumnWidth="30"
|
||||
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" GridLinesVisibility="All" BorderBrush="#CCCCCC"
|
||||
BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" Grid.ColumnSpan="2" AllowDrop="False"
|
||||
CanUserReorderColumns="False" CanUserSortColumns="False" CanUserResizeRows="False" CanUserResizeColumns="False"
|
||||
@@ -100,20 +100,14 @@
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.Remark}" Width="*" Binding="{Binding Remark}" IsReadOnly="True"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<Grid VerticalAlignment="Bottom" Height="300">
|
||||
<ContentControl x:Name="Picture" Margin="0,0,200,0"/>
|
||||
|
||||
<Button x:Name="inf" FontSize="20" HorizontalAlignment="Right" Height="100" VerticalAlignment="Top" Width="200" Click="inf_Click">
|
||||
<Button.Background>
|
||||
<ImageBrush ImageSource="/Lmage/inf.png" TileMode="None" Stretch="Uniform"/>
|
||||
</Button.Background>
|
||||
</Button>
|
||||
<Button x:Name="start" FontSize="20" HorizontalAlignment="Right" Height="200" VerticalAlignment="Bottom" Width="200" Click="start_Click" >
|
||||
<Button.Background>
|
||||
<ImageBrush ImageSource="/Lmage/start3.png" TileMode="None"/>
|
||||
</Button.Background>
|
||||
</Button>
|
||||
|
||||
<Grid VerticalAlignment="Bottom" Height="400">
|
||||
<ContentControl x:Name="Picture" Margin="0,0,200,0"/>
|
||||
<Image Source="/Lmage/IconParkMessages.png" HorizontalAlignment="Right" Height="200"
|
||||
VerticalAlignment="Top" Width="200" MouseLeftButtonDown="Image_MouseLeftButtonDown"
|
||||
MouseLeftButtonUp="Image_MouseLeftButtonUp"/>
|
||||
<Image Source="/Lmage/IconParkPlayTwo.png" HorizontalAlignment="Right" Height="200"
|
||||
VerticalAlignment="Bottom" Width="200" MouseLeftButtonDown="Image_MouseLeftButtonDown1"
|
||||
MouseLeftButtonUp="Image_MouseLeftButtonUp1"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
+46
-86
@@ -100,7 +100,6 @@ namespace DyeingComputer.View
|
||||
Process_id = null;
|
||||
_lock = null;
|
||||
}
|
||||
|
||||
|
||||
private void WorkOrderView_lock_Click(object sender, RoutedEventArgs e)//锁定按钮
|
||||
{
|
||||
@@ -184,58 +183,47 @@ namespace DyeingComputer.View
|
||||
TEMP();
|
||||
}
|
||||
}
|
||||
|
||||
private void UserControl_KeyDown(object sender, KeyEventArgs e) //键盘监控
|
||||
|
||||
private void Image_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (e.Key == Key.Y) //按键
|
||||
{
|
||||
if(string.IsNullOrEmpty(WorkOrder_Numder)) return;
|
||||
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||
SQLiteHelpers.Open(); //打开数据库
|
||||
|
||||
updata_temp.Clear(); //使用前清缓存
|
||||
updata_temp.Add("State", 101);
|
||||
SQLiteHelpers.Update("WorkOrder", updata_temp, "WorkOrder='" + WorkOrder_Numder + "'", null);
|
||||
|
||||
DataTable WorkorderSteps = SQLiteHelpers.ExecuteDataSet(
|
||||
"select * from WorkorderSteps where WorkOrder='" + WorkOrder_Numder + "'", null).Tables[0]; //读取表写入缓存
|
||||
MainWindowViewModel.ProgramName = Process_Name;
|
||||
SQLiteHelpers.Delete("RUN", null, null); //删除run信息
|
||||
DataTable data_t = new DataTable();
|
||||
data_t = WorkorderSteps.Clone();
|
||||
int a = WorkorderSteps.Rows.Count;
|
||||
for (int i = 0; i < a; i++)
|
||||
{
|
||||
data_t.Clear();//清空
|
||||
DataRow dt = WorkorderSteps.Rows[i];//行转
|
||||
DataRow dr = data_t.NewRow();
|
||||
dr.ItemArray = dt.ItemArray;
|
||||
dr.BeginEdit(); //添加订单号
|
||||
dr["ProgramID"] = Process_id;
|
||||
dr["Program"] = MainWindowViewModel.ProgramName;
|
||||
dr.EndEdit();
|
||||
data_t.Rows.InsertAt(dr, 0); //行转换
|
||||
|
||||
SQLiteHelpers.InsertData("RUN", SQLiteHelpers.DataTableToDictionary(data_t));//行插入
|
||||
}
|
||||
|
||||
SQLiteHelpers.Close(); //关闭连接
|
||||
|
||||
if (Process_id != null) //选定工艺有效跳转准备
|
||||
{
|
||||
MainWindowViewModel.WorkNumder = WorkOrder_Numder;
|
||||
TechnologicalProcessView.workName = Process_id;
|
||||
MainWindowViewModel.SYS_REDYE = 0;
|
||||
|
||||
MainWindowViewModel.ViewID = 1;
|
||||
var _mainWindow = Application.Current.Windows.Cast<Window>().FirstOrDefault(window => window is MainWindow) as MainWindow;//跨页面
|
||||
_mainWindow.container.Content = new TechnologicalProcessView();//获取控件
|
||||
}
|
||||
}
|
||||
((System.Windows.Controls.Image)sender).RenderTransform = new ScaleTransform(0.9, 0.9);
|
||||
}
|
||||
|
||||
private void start_Click(object sender, RoutedEventArgs e)//开始
|
||||
private void Image_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
((System.Windows.Controls.Image)sender).RenderTransform = Transform.Identity;
|
||||
if (string.IsNullOrEmpty(WorkOrder_Numder)) return;
|
||||
|
||||
DataGrid dataGrid = new DataGrid();
|
||||
dataGrid.Columns.Add(new DataGridTextColumn() { Header = Properties.Resources.Step, Width = 60, Binding = new Binding("Step") });
|
||||
dataGrid.Columns.Add(new DataGridTextColumn() { Header = Properties.Resources.Directives, Width = 300, Binding = new Binding("StepName") });
|
||||
dataGrid.Columns.Add(new DataGridTextColumn() { Header = Properties.Resources.ParameterSet, Width = 500, Binding = new Binding("ParameterName") });
|
||||
dataGrid.Columns.Add(new DataGridTextColumn() { Header = Properties.Resources.Remark, Width = 600, Binding = new Binding("Remark") });
|
||||
dataGrid.AutoGenerateColumns = false;
|
||||
dataGrid.CanUserReorderColumns = false;
|
||||
dataGrid.CanUserSortColumns = false;
|
||||
dataGrid.CanUserResizeRows = false;
|
||||
dataGrid.CanUserResizeColumns = false;
|
||||
dataGrid.ColumnHeaderHeight = 40;
|
||||
dataGrid.FontSize = 25;
|
||||
dataGrid.HorizontalGridLinesBrush = new SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 201, 201, 201));
|
||||
dataGrid.VerticalGridLinesBrush = new SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 201, 201, 201));
|
||||
|
||||
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||
SQLiteHelpers.Open(); //打开数据库
|
||||
string sql_script = "select * from WorkorderSteps where WorkOrder='" + WorkOrder_Numder + "'";
|
||||
DataTable inf = SQLiteHelpers.ExecuteDataSet(sql_script, null).Tables[0]; //读取表写入缓存
|
||||
SQLiteHelpers.Close(); //关闭连接
|
||||
dataGrid.ItemsSource = inf.DefaultView; //转换显示计划表
|
||||
|
||||
Picture.Content = dataGrid;
|
||||
}//信息
|
||||
private void Image_MouseLeftButtonDown1(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
((System.Windows.Controls.Image)sender).RenderTransform = new ScaleTransform(0.9, 0.9);
|
||||
}
|
||||
private void Image_MouseLeftButtonUp1(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
((System.Windows.Controls.Image)sender).RenderTransform = Transform.Identity;
|
||||
if (string.IsNullOrEmpty(WorkOrder_Numder)) return;
|
||||
if (_lock == "1")
|
||||
{
|
||||
@@ -251,16 +239,16 @@ namespace DyeingComputer.View
|
||||
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||
SQLiteHelpers.Open(); //打开数据库
|
||||
|
||||
int R_D = SQLiteHelpers.ExecuteDataSet( "select * from RUN", null).Tables[0].Rows.Count; //读取表写入缓存
|
||||
int R_D = SQLiteHelpers.ExecuteDataSet("select * from RUN", null).Tables[0].Rows.Count; //读取表写入缓存
|
||||
if (R_D > 0)//判断是否有运行中工艺
|
||||
{
|
||||
SQLiteHelpers.Close(); //关闭连接
|
||||
|
||||
MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show(Properties.Resources.RunningProcess, "800", MessageBoxButton.YesNo);
|
||||
if (messageBoxResult == MessageBoxResult.No) return;
|
||||
if (messageBoxResult == MessageBoxResult.Yes)
|
||||
if (messageBoxResult == MessageBoxResult.No) return;
|
||||
if (messageBoxResult == MessageBoxResult.Yes)
|
||||
{
|
||||
if(MainWindowViewModel.S17 == 1) //拒绝操作
|
||||
if (MainWindowViewModel.S17 == 1) //拒绝操作
|
||||
{
|
||||
System.Windows.MessageBox.Show(Properties.Resources.refuse, "800", MessageBoxButton.OK);
|
||||
return;
|
||||
@@ -309,9 +297,9 @@ namespace DyeingComputer.View
|
||||
MainWindowViewModel.RUN_STEPID = Convert.ToInt16(1);//插入步骤号
|
||||
MainWindowViewModel.STEP_START(Numder, Convert.ToDouble(P1), Convert.ToDouble(P2), Convert.ToDouble(P3),
|
||||
Convert.ToDouble(P4), Convert.ToDouble(P5));
|
||||
MainWindowViewModel.WORK_RUN =2;
|
||||
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "Jump", "STEP = " +
|
||||
MainWindowViewModel.RUN_STEPID +";StepID=" + Numder + ";P1=" + P1 + ";P2=" + P2 + ";P3=" + P3 + ";P4=" + P4 + ";P5=" + P5);
|
||||
MainWindowViewModel.WORK_RUN = 2;
|
||||
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "Jump", "STEP = " +
|
||||
MainWindowViewModel.RUN_STEPID + ";StepID=" + Numder + ";P1=" + P1 + ";P2=" + P2 + ";P3=" + P3 + ";P4=" + P4 + ";P5=" + P5);
|
||||
|
||||
/*选定工艺有效跳转准备 */
|
||||
if (Process_id != null) //选定工艺有效跳转准备
|
||||
@@ -324,35 +312,7 @@ namespace DyeingComputer.View
|
||||
var _mainWindow = Application.Current.Windows.Cast<Window>().FirstOrDefault(window => window is MainWindow) as MainWindow;//跨页面
|
||||
_mainWindow.container.Content = new TechnologicalProcessView();//获取控件
|
||||
}
|
||||
}
|
||||
private void inf_Click(object sender, RoutedEventArgs e)//信息
|
||||
{
|
||||
if (string.IsNullOrEmpty(WorkOrder_Numder)) return;
|
||||
|
||||
DataGrid dataGrid = new DataGrid();
|
||||
dataGrid.Columns.Add(new DataGridTextColumn() { Header = Properties.Resources.Step, Width = 60, Binding = new Binding("Step") });
|
||||
dataGrid.Columns.Add(new DataGridTextColumn() { Header = Properties.Resources.Directives, Width = 300, Binding = new Binding("StepName") });
|
||||
dataGrid.Columns.Add(new DataGridTextColumn() { Header = Properties.Resources.ParameterSet, Width =500, Binding = new Binding("ParameterName") });
|
||||
dataGrid.Columns.Add(new DataGridTextColumn() { Header = Properties.Resources.Remark, Width = 600, Binding = new Binding("Remark") });
|
||||
dataGrid.AutoGenerateColumns = false;
|
||||
dataGrid.CanUserReorderColumns = false;
|
||||
dataGrid.CanUserSortColumns = false;
|
||||
dataGrid.CanUserResizeRows = false;
|
||||
dataGrid.CanUserResizeColumns = false;
|
||||
dataGrid.ColumnHeaderHeight = 40;
|
||||
dataGrid.FontSize = 25;
|
||||
dataGrid.HorizontalGridLinesBrush = new SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 201, 201, 201));
|
||||
dataGrid.VerticalGridLinesBrush = new SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 201, 201, 201));
|
||||
|
||||
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||
SQLiteHelpers.Open(); //打开数据库
|
||||
string sql_script = "select * from WorkorderSteps where WorkOrder='"+ WorkOrder_Numder+"'";
|
||||
DataTable inf = SQLiteHelpers.ExecuteDataSet(sql_script, null).Tables[0]; //读取表写入缓存
|
||||
SQLiteHelpers.Close(); //关闭连接
|
||||
dataGrid.ItemsSource = inf.DefaultView; //转换显示计划表
|
||||
|
||||
Picture.Content = dataGrid;
|
||||
}
|
||||
}//开始
|
||||
|
||||
private void TEMP()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user