Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer
This commit is contained in:
commit
ad9d7b50e4
7 files changed
+195
-42
No files matched your search
@@ -181,7 +181,7 @@
|
||||
<value>温度</value>
|
||||
</data>
|
||||
<data name="Time" xml:space="preserve">
|
||||
<value>时间[min]</value>
|
||||
<value>时间</value>
|
||||
</data>
|
||||
<data name="WorkOrder" xml:space="preserve">
|
||||
<value>工作清单</value>
|
||||
@@ -370,7 +370,7 @@
|
||||
<value>压力</value>
|
||||
</data>
|
||||
<data name="Rate" xml:space="preserve">
|
||||
<value>速率(°C/min)</value>
|
||||
<value>速率</value>
|
||||
</data>
|
||||
<data name="Tank" xml:space="preserve">
|
||||
<value>缸</value>
|
||||
|
||||
@@ -87,6 +87,7 @@ namespace DyeingComputer.View
|
||||
|
||||
string Numder = null;
|
||||
string ID = null;
|
||||
string P1, P2, P3, P4, P5;
|
||||
private void Grid_SelectionChanged(object sender, SelectionChangedEventArgs e)//表格选择事件
|
||||
{
|
||||
int rownum = Grid.SelectedIndex;//获取鼠标选中行并定义变量
|
||||
@@ -94,6 +95,11 @@ namespace DyeingComputer.View
|
||||
{
|
||||
ID = (Grid.Columns[2].GetCellContent(Grid.Items[rownum]) as TextBlock).Text;//定位第0列,
|
||||
Numder = (Grid.Columns[3].GetCellContent(Grid.Items[rownum]) as TextBlock).Text;//定位第1列,
|
||||
P1 = (Grid.Columns[6].GetCellContent(Grid.Items[rownum]) as TextBlock).Text;//定位第6列,
|
||||
P2 = (Grid.Columns[7].GetCellContent(Grid.Items[rownum]) as TextBlock).Text;//定位第7列,
|
||||
P3 = (Grid.Columns[8].GetCellContent(Grid.Items[rownum]) as TextBlock).Text;//定位第8列,
|
||||
P4 = (Grid.Columns[9].GetCellContent(Grid.Items[rownum]) as TextBlock).Text;//定位第9列,
|
||||
P5 = (Grid.Columns[10].GetCellContent(Grid.Items[rownum]) as TextBlock).Text;//定位第10列,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,8 +130,9 @@ namespace DyeingComputer.View
|
||||
|
||||
private void ProgramgroupView_edit_Click(object sender, RoutedEventArgs e)//编辑
|
||||
{
|
||||
if(ID == null) ID = sql.Tables[0].Rows.Count.ToString();
|
||||
ViewStep viewstop = new ViewStep();
|
||||
if (string.IsNullOrEmpty(Numder)) { Numder = null; P1 = "0";P2 = "0";P3 = "0";P4 = "0";P5 = "0"; }
|
||||
if (ID == null) ID = sql.Tables[0].Rows.Count.ToString();
|
||||
ViewStep viewstop = new ViewStep(Numder, P1, P2, P3, P4, P5);
|
||||
viewstop.AddressUpdated += new ViewStep.AddressUpdateHandler(Address_ButtonClicked);
|
||||
viewstop.data = ID;
|
||||
viewstop.ShowDialog();
|
||||
|
||||
@@ -7,21 +7,14 @@
|
||||
xmlns:lang="clr-namespace:DyeingComputer.Properties"
|
||||
mc:Ignorable="d" Loaded="UserControl_Loaded"
|
||||
d:DesignHeight="630" d:DesignWidth="1280">
|
||||
<Grid>
|
||||
<TextBlock x:Name="log" HorizontalAlignment="Left" Margin="0,0,0,0" TextWrapping="Wrap" Width="600" FontSize="20" Background="White"/>
|
||||
<TextBlock x:Name="name" HorizontalAlignment="Left" Margin="600,0,0,0" TextWrapping="Wrap" FontSize="24" Background="#FFD0D0D0" Text="NAME" Height="30" Block.TextAlignment="Center">
|
||||
<TextBlock.LayoutTransform>
|
||||
<!--文字同样旋转90度-->
|
||||
<RotateTransform Angle="270"/>
|
||||
</TextBlock.LayoutTransform>
|
||||
</TextBlock>
|
||||
<DataGrid x:Name="Grid" AlternationCount="2" IsReadOnly="True"
|
||||
<Grid Focusable="True">
|
||||
<DataGrid x:Name="Grid" AlternationCount="2" IsReadOnly="True" SelectionChanged="Grid_SelectionChanged"
|
||||
Margin="630,0,0,0" d:ItemsSource="{d:SampleData ItemCount=90}" AutoGenerateColumns="False" MinColumnWidth="30"
|
||||
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" GridLinesVisibility="All" BorderBrush="Black"
|
||||
BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" Grid.ColumnSpan="2" AllowDrop="False"
|
||||
CanUserReorderColumns="False" CanUserSortColumns="False" CanUserResizeRows="False" CanUserResizeColumns="False"
|
||||
CanUserAddRows="True" CanUserDeleteRows="False" HeadersVisibility ="Column"
|
||||
Background="White" SelectionMode="Single" FontSize="15" MinHeight="632">
|
||||
Background="White" SelectionMode="Single" FontSize="15" MinHeight="632" TabIndex="1" Focusable="True">
|
||||
<DataGrid.RowStyle >
|
||||
<Style TargetType="{x:Type DataGridRow}">
|
||||
<Setter Property="Height" Value="30" />
|
||||
@@ -50,13 +43,12 @@
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGrid.CellStyle>
|
||||
|
||||
<DataGrid.Columns>
|
||||
<!--列信息绑定-->
|
||||
<DataGridTextColumn Binding="{Binding ProgramID}" 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="60" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.Code}" Width="100" Binding="{Binding StepID}" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.Code}" Width="0" MinWidth="0" MaxWidth="0" Binding="{Binding StepID}" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.Directives}" Width="300" Binding="{Binding StepName}" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.ParameterSet}" Width="*" Binding="{Binding ParameterName}" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Binding="{Binding Parameter1}" Width="0" MinWidth="0" MaxWidth="0"/>
|
||||
@@ -71,5 +63,16 @@
|
||||
<DataGridTextColumn Binding="{Binding Parameter10}" Width="0" MinWidth="0" MaxWidth="0"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<TextBlock x:Name="log" HorizontalAlignment="Left" Margin="0,40,0,0" TextWrapping="Wrap" Width="600" FontSize="20" Background="White"/>
|
||||
<TextBlock x:Name="name" HorizontalAlignment="Left" Margin="600,0,0,0" TextWrapping="Wrap" FontSize="24" Background="#FFD0D0D0" Text="NAME" Height="30" Block.TextAlignment="Center">
|
||||
<TextBlock.LayoutTransform>
|
||||
<!--文字同样旋转90度-->
|
||||
<RotateTransform Angle="270"/>
|
||||
</TextBlock.LayoutTransform>
|
||||
</TextBlock>
|
||||
<Rectangle Margin="0,0,0,0" Fill="#FFCCCCCC" VerticalAlignment="Top" Width="600" Height="40" HorizontalAlignment="Left"/>
|
||||
<Button Content="{x:Static lang:Resources.edit}" x:Name="ProgramgroupView_edit" FontSize="20" HorizontalAlignment="Left" Height="40" Margin="0,0,0,0" VerticalAlignment="Top" Width="200" Background="White" Click="ProgramgroupView_edit_Click"/>
|
||||
<Button Content="{x:Static lang:Resources.Delete}" x:Name="ProgramgroupView_del" FontSize="20" HorizontalAlignment="Left" Height="40" Margin="400,0,0,0" VerticalAlignment="Top" Width="200" Background="White" Click="ProgramgroupView_del_Click"/>
|
||||
<Button Content="{x:Static lang:Resources.Insert}" x:Name="ProgramgroupView_Insert" FontSize="20" HorizontalAlignment="Left" Height="40" Margin="200,0,0,0" VerticalAlignment="Top" Width="200" Background="White" Click="ProgramgroupView_Insert_Click"/>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -1,5 +1,6 @@
|
||||
using DyeingComputer.UserClass;
|
||||
using DyeingComputer.ViewModel;
|
||||
using DyeingComputer.Windows;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
@@ -17,6 +18,7 @@ using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using static DyeingComputer.UserClass.SqliteHelper;
|
||||
using static DyeingComputer.Windows.ViewStep;
|
||||
|
||||
namespace DyeingComputer.View
|
||||
{
|
||||
@@ -27,7 +29,7 @@ namespace DyeingComputer.View
|
||||
{
|
||||
public TechnologicalProcessView()
|
||||
{
|
||||
InitializeComponent();
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public static object workName;
|
||||
@@ -35,22 +37,21 @@ namespace DyeingComputer.View
|
||||
private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\800COMPUTER.db"; //数据库路径
|
||||
DataSet sql; //内存数据缓存
|
||||
|
||||
public void TechnologicalProcess_sql()
|
||||
private void TechnologicalProcess_Import()
|
||||
{
|
||||
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||
SQLiteHelpers.Open(); //打开数据库
|
||||
int r = 0;
|
||||
string sql_script = "select * from ProgramSteps where ProgramID = '" + workName + "'";
|
||||
|
||||
if (sql != null) sql.Clear(); //清空缓存
|
||||
sql = SQLiteHelpers.ExecuteDataSet(sql_script, null); //读取表写入缓存
|
||||
name.Text = SQLiteHelpers.ExecuteScalar("select ProgramName from ProgramName where ProgramID = '" + workName + "'", null).ToString();
|
||||
name.Text = SQLiteHelpers.ExecuteScalar("select ProgramName from ProgramName where ProgramID = '" + workName + "'", null).ToString();
|
||||
if (sql != null) Grid.ItemsSource = sql.Tables[0].DefaultView; //转换显示计划表
|
||||
|
||||
SQLiteHelpers.Delete("RUN",null,null); //删除run信息
|
||||
SQLiteHelpers.Delete("RUN", null, null); //删除run信息
|
||||
DataTable data_t = new DataTable();
|
||||
data_t = sql.Tables[0].Clone();
|
||||
data_t.Columns.Add("DYELOT",typeof(string)); //添加列
|
||||
data_t.Columns.Add("DYELOT", typeof(string)); //添加列
|
||||
int a = sql.Tables[0].Rows.Count;
|
||||
for (int i = 0; i < a; i++)
|
||||
{
|
||||
@@ -68,15 +69,148 @@ namespace DyeingComputer.View
|
||||
SQLiteHelpers.Close(); //关闭连接
|
||||
}
|
||||
|
||||
private void TechnologicalProcess_sql()
|
||||
{
|
||||
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||
SQLiteHelpers.Open(); //打开数据库
|
||||
string sql_script = "select * from RUN";
|
||||
if (sql != null) sql.Clear(); //清空缓存
|
||||
sql = SQLiteHelpers.ExecuteDataSet(sql_script, null); //读取表写入缓存
|
||||
name.Text = SQLiteHelpers.ExecuteScalar("select Program from RUN where Step = '1'", null).ToString();
|
||||
SQLiteHelpers.Close(); //关闭连接
|
||||
|
||||
if (sql != null) Grid.ItemsSource = sql.Tables[0].DefaultView; //转换显示计划表
|
||||
}
|
||||
|
||||
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if(workName !=null) TechnologicalProcess_sql();
|
||||
//Grid.SelectedIndex = 0;
|
||||
FocusManager.SetFocusedElement(Grid, Grid);
|
||||
if (workName != null)
|
||||
{
|
||||
TechnologicalProcess_Import();
|
||||
//Grid.SelectedIndex = 0;
|
||||
//MainWindowViewModel.Process_step = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
TechnologicalProcess_sql();
|
||||
// Grid.SelectedIndex = Convert.ToInt16(MainWindowViewModel.Process_step);
|
||||
}
|
||||
}
|
||||
|
||||
private void UserControl_KeyDown(object sender, KeyEventArgs e) //键盘监控
|
||||
{
|
||||
if (e.Key == Key.Y) //按键y
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void ProgramgroupView_edit_Click(object sender, RoutedEventArgs e)//编辑按钮
|
||||
{
|
||||
if (string.IsNullOrEmpty(Numder)) { Numder = null; P1 = "0"; P2 = "0"; P3 = "0"; P4 = "0"; P5 = "0"; }
|
||||
if (ID == null) ID = sql.Tables[0].Rows.Count.ToString();
|
||||
ViewStep viewstop = new ViewStep(Numder,P1,P2,P3,P4,P5);
|
||||
viewstop.data = ID;
|
||||
viewstop.AddressUpdated += new ViewStep.AddressUpdateHandler(Address_ButtonClicked);
|
||||
viewstop.ShowDialog();
|
||||
}
|
||||
private void Address_ButtonClicked(object sender, AddressUpdateEventArgs e)//编辑返回结果
|
||||
{
|
||||
int n = StrToInt.To16Convert10(ID);
|
||||
|
||||
DataRow dr = sql.Tables[0].Rows[n - 1];
|
||||
dr.BeginEdit();
|
||||
dr["StepID"] = e.StepID;
|
||||
dr["StepName"] = e.StepNAME;
|
||||
dr["ParameterName"] = e.PNAME;
|
||||
dr["Parameter1"] = e.P1;
|
||||
dr["Parameter2"] = e.P2;
|
||||
dr["Parameter3"] = e.P3;
|
||||
dr["Parameter4"] = e.P4;
|
||||
dr["Parameter5"] = e.P5;
|
||||
dr.EndEdit();
|
||||
|
||||
Grid.ItemsSource = sql.Tables[0].DefaultView;
|
||||
Grid.SelectedIndex = -1;
|
||||
|
||||
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||
SQLiteHelpers.Open(); //打开数据库
|
||||
SQLiteHelpers.Delete("RUN", null, null);
|
||||
DataTable data_t = new DataTable();
|
||||
data_t = sql.Tables[0].Clone();
|
||||
int a = sql.Tables[0].Rows.Count;
|
||||
for (int i = 0; i < a; i++)
|
||||
{
|
||||
data_t.Clear();//清空
|
||||
|
||||
DataRow dt = sql.Tables[0].Rows[i];//行转换
|
||||
DataRow drT = data_t.NewRow();
|
||||
drT.ItemArray = dt.ItemArray;
|
||||
data_t.Rows.InsertAt(drT, 0);
|
||||
|
||||
SQLiteHelpers.InsertData("RUN", SQLiteHelpers.DataTableToDictionary(data_t));//行插入
|
||||
}
|
||||
|
||||
SQLiteHelpers.Close(); //关闭连接
|
||||
}
|
||||
public void Dat()//行号刷新
|
||||
{
|
||||
int a = sql.Tables[0].Rows.Count;
|
||||
for (int i = 0; i < a; i++)
|
||||
{
|
||||
DataRow dr = sql.Tables[0].Rows[i];
|
||||
dr.BeginEdit();
|
||||
dr["Step"] = i + 1;
|
||||
dr.EndEdit();
|
||||
}
|
||||
}
|
||||
private void ProgramgroupView_del_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
int d = 0;
|
||||
int a = sql.Tables[0].Rows.Count;
|
||||
|
||||
if (ID != null) { d = StrToInt.To16Convert10(ID); } else { return; }
|
||||
if (a != d)//如果删除不是最后一行执行
|
||||
{
|
||||
sql.Tables[0].Rows.RemoveAt(d - 1);
|
||||
|
||||
Dat();
|
||||
Grid.ItemsSource = sql.Tables[0].DefaultView; //转换显示计划表
|
||||
}
|
||||
}
|
||||
|
||||
private void ProgramgroupView_Insert_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
int d = 0;
|
||||
|
||||
if (ID != null) { d = StrToInt.To16Convert10(ID); } else { return; }
|
||||
DataRow dr = sql.Tables[0].NewRow();//添加表数据
|
||||
// dr["ProgramID"] = ProgramID;
|
||||
// dr["Program"] = ProgramNAME;
|
||||
sql.Tables[0].Rows.InsertAt(dr, d - 1);
|
||||
ID = null;
|
||||
|
||||
Dat();
|
||||
Grid.ItemsSource = sql.Tables[0].DefaultView; //转换显示计划表
|
||||
}
|
||||
|
||||
string Numder = null;
|
||||
string ID = null;
|
||||
string P1, P2, P3, P4, P5;
|
||||
private void Grid_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
int rownum = Grid.SelectedIndex;//获取鼠标选中行并定义变量
|
||||
if (rownum != -1)//判断鼠标定位是否有效
|
||||
{
|
||||
ID = (Grid.Columns[2].GetCellContent(Grid.Items[rownum]) as TextBlock).Text;//定位第0列,
|
||||
Numder = (Grid.Columns[3].GetCellContent(Grid.Items[rownum]) as TextBlock).Text;//定位第1列,
|
||||
P1 = (Grid.Columns[6].GetCellContent(Grid.Items[rownum]) as TextBlock).Text;//定位第6列,
|
||||
P2 = (Grid.Columns[7].GetCellContent(Grid.Items[rownum]) as TextBlock).Text;//定位第7列,
|
||||
P3 = (Grid.Columns[8].GetCellContent(Grid.Items[rownum]) as TextBlock).Text;//定位第8列,
|
||||
P4 = (Grid.Columns[9].GetCellContent(Grid.Items[rownum]) as TextBlock).Text;//定位第9列,
|
||||
P5 = (Grid.Columns[10].GetCellContent(Grid.Items[rownum]) as TextBlock).Text;//定位第10列,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -155,6 +155,7 @@ namespace DyeingComputer.ViewModel
|
||||
|
||||
public static object Name_err;
|
||||
public static object WorkNumder;
|
||||
public static object Process_step;
|
||||
public Int32 DIDETime;
|
||||
void Tick_Event_1S(object sender, EventArgs e)//Tick_Event周期执行事件1S
|
||||
{
|
||||
|
||||
+10
-10
@@ -16,21 +16,21 @@
|
||||
<TextBox x:Name="boxNAME" HorizontalAlignment="Right" Height="30" Margin="0,20,10,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="230" MaxLines="1" ClipToBounds="True"
|
||||
TextChanged="TextBox_TextChanged" PreviewTextInput="Tb_KeyPress" InputMethod.IsInputMethodEnabled="False" FontSize="20" HorizontalContentAlignment="Right" MaxLength="3"/>
|
||||
|
||||
<TextBlock x:Name="P1N" HorizontalAlignment="Left" Height="30" Margin="10,120,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="20" Background="#FFEFEEEE"/>
|
||||
<TextBlock x:Name="P1N" HorizontalAlignment="Left" Height="30" Margin="10,120,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="20" Background="#FFEFEEEE" Visibility="Hidden"/>
|
||||
<TextBox x:Name="P1" HorizontalAlignment="Right" Height="30" Margin="0,120,10,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="230" MaxLines="1" ClipToBounds="True"
|
||||
Text="0" PreviewTextInput="Tb_KeyP1" InputMethod.IsInputMethodEnabled="False" FontSize="20" HorizontalContentAlignment="Right" />
|
||||
<TextBlock x:Name="P2N" HorizontalAlignment="Left" Height="30" Margin="10,155,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="20" Background="#FFEFEEEE"/>
|
||||
Text="0" PreviewTextInput="Tb_KeyP1" InputMethod.IsInputMethodEnabled="False" FontSize="20" HorizontalContentAlignment="Right" Visibility="Hidden" />
|
||||
<TextBlock x:Name="P2N" HorizontalAlignment="Left" Height="30" Margin="10,155,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="20" Background="#FFEFEEEE" Visibility="Hidden"/>
|
||||
<TextBox x:Name="P2" HorizontalAlignment="Right" Height="30" Margin="0,155,10,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="230" MaxLines="1" ClipToBounds="True"
|
||||
Text="0" PreviewTextInput="Tb_KeyP2" InputMethod.IsInputMethodEnabled="False" FontSize="20" HorizontalContentAlignment="Right" />
|
||||
<TextBlock x:Name="P3N" HorizontalAlignment="Left" Height="30" Margin="10,190,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="20" Background="#FFEFEEEE"/>
|
||||
Text="0" PreviewTextInput="Tb_KeyP2" InputMethod.IsInputMethodEnabled="False" FontSize="20" HorizontalContentAlignment="Right" Visibility="Hidden" />
|
||||
<TextBlock x:Name="P3N" HorizontalAlignment="Left" Height="30" Margin="10,190,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="20" Background="#FFEFEEEE" Visibility="Hidden"/>
|
||||
<TextBox x:Name="P3" HorizontalAlignment="Right" Height="30" Margin="0,190,10,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="230" MaxLines="1" ClipToBounds="True"
|
||||
Text="0" PreviewTextInput="Tb_KeyP3" InputMethod.IsInputMethodEnabled="False" FontSize="20" HorizontalContentAlignment="Right" />
|
||||
<TextBlock x:Name="P4N" HorizontalAlignment="Left" Height="30" Margin="10,225,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="20" Background="#FFEFEEEE"/>
|
||||
Text="0" PreviewTextInput="Tb_KeyP3" InputMethod.IsInputMethodEnabled="False" FontSize="20" HorizontalContentAlignment="Right" Visibility="Hidden" />
|
||||
<TextBlock x:Name="P4N" HorizontalAlignment="Left" Height="30" Margin="10,225,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="20" Background="#FFEFEEEE" Visibility="Hidden"/>
|
||||
<TextBox x:Name="P4" HorizontalAlignment="Right" Height="30" Margin="0,225,10,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="230" MaxLines="1" ClipToBounds="True"
|
||||
Text="0" PreviewTextInput="Tb_KeyP4" InputMethod.IsInputMethodEnabled="False" FontSize="20" HorizontalContentAlignment="Right" />
|
||||
<TextBlock x:Name="P5N" HorizontalAlignment="Left" Height="30" Margin="10,260,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="20" Background="#FFEFEEEE"/>
|
||||
Text="0" PreviewTextInput="Tb_KeyP4" InputMethod.IsInputMethodEnabled="False" FontSize="20" HorizontalContentAlignment="Right" Visibility="Hidden" />
|
||||
<TextBlock x:Name="P5N" HorizontalAlignment="Left" Height="30" Margin="10,260,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="20" Background="#FFEFEEEE" Visibility="Hidden"/>
|
||||
<TextBox x:Name="P5" HorizontalAlignment="Right" Height="30" Margin="0,260,10,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="230" MaxLines="1" ClipToBounds="True"
|
||||
Text="0" PreviewTextInput="Tb_KeyP5" InputMethod.IsInputMethodEnabled="False" FontSize="20" HorizontalContentAlignment="Right" />
|
||||
Text="0" PreviewTextInput="Tb_KeyP5" InputMethod.IsInputMethodEnabled="False" FontSize="20" HorizontalContentAlignment="Right" Visibility="Hidden" />
|
||||
|
||||
<Button Content="{x:Static lang:Resources.YES}" HorizontalAlignment="Left" Height="35" Margin="50,70,0,5" VerticalAlignment="Bottom" Width="80" Click="YES_Click"/>
|
||||
<Button Content="{x:Static lang:Resources.NO}" HorizontalAlignment="Right" Height="35" Margin="0,70,50,5" VerticalAlignment="Bottom" Width="80" Click="NO_Click"/>
|
||||
|
||||
@@ -31,15 +31,21 @@ namespace DyeingComputer.Windows
|
||||
//声明一个更新Address的事件
|
||||
public event AddressUpdateHandler AddressUpdated;
|
||||
|
||||
public ViewStep()
|
||||
public ViewStep(string Numder ,string P1D,string P2D,string P3D,string P4D,string P5D)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = this;
|
||||
Form1_Load();
|
||||
// FocusManager.SetFocusedElement(boxNAME, boxNAME);
|
||||
boxNAME.Focus();
|
||||
boxNAME.Text = Numder;
|
||||
|
||||
P1.Visibility = Visibility.Collapsed;
|
||||
P1.Text = P1D;
|
||||
P2.Text = P2D;
|
||||
P3.Text = P3D;
|
||||
P4.Text = P4D;
|
||||
P5.Text = P5D;
|
||||
/* P1.Visibility = Visibility.Collapsed;
|
||||
P1N.Visibility = Visibility.Collapsed;
|
||||
P2.Visibility = Visibility.Collapsed;
|
||||
P2N.Visibility = Visibility.Collapsed;
|
||||
@@ -48,7 +54,7 @@ namespace DyeingComputer.Windows
|
||||
P4.Visibility = Visibility.Collapsed;
|
||||
P4N.Visibility = Visibility.Collapsed;
|
||||
P5.Visibility = Visibility.Collapsed;
|
||||
P5N.Visibility = Visibility.Collapsed;
|
||||
P5N.Visibility = Visibility.Collapsed;*/
|
||||
}
|
||||
|
||||
private void Tb_KeyPress(object sender, TextCompositionEventArgs e)//输入事件
|
||||
@@ -136,6 +142,8 @@ namespace DyeingComputer.Windows
|
||||
this.boxID.Items.Add(Properties.Resources.PHTemperatureControl);//ph温度控制091
|
||||
this.boxID.Items.Add(Properties.Resources.PHDetection);//ph检测093
|
||||
this.boxID.Items.Add(Properties.Resources.PHControl);//ph控制094
|
||||
|
||||
// boxNAME.Text = datid;
|
||||
}
|
||||
|
||||
private void TextBox_TextChanged(object sender, TextChangedEventArgs e)//输入事件
|
||||
@@ -148,11 +156,11 @@ namespace DyeingComputer.Windows
|
||||
if (g != -1)
|
||||
{
|
||||
boxID.SelectedIndex = g;//有效索引传入
|
||||
set(g);
|
||||
Set(g);
|
||||
} else
|
||||
{
|
||||
boxID.SelectedIndex =-1;
|
||||
set(-1);
|
||||
Set(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -162,7 +170,7 @@ namespace DyeingComputer.Windows
|
||||
{
|
||||
int i = boxID.SelectedIndex;
|
||||
boxNAME.Text = a.ElementAt(i);
|
||||
set(i);
|
||||
Set(i);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,13 +194,13 @@ namespace DyeingComputer.Windows
|
||||
this.Close(); //关闭窗口
|
||||
}
|
||||
|
||||
private void set(int a) //参数显示
|
||||
private void Set(int a) //参数显示
|
||||
{
|
||||
switch (a)
|
||||
{
|
||||
case 0:
|
||||
P1N.Text = Properties.Resources.Target+Properties.Resources.Temperature;
|
||||
P2N.Text = Properties.Resources.Rate;
|
||||
P2N.Text = Properties.Resources.Rate+ "(°C/min)";
|
||||
P3N.Text = Properties.Resources.Time;
|
||||
P1.Visibility = Visibility.Visible;
|
||||
P1N.Visibility = Visibility.Visible;
|
||||
|
||||
Reference in new issue
Block a user