|
|
@ -23,6 +23,7 @@ namespace DyeingComputer.Windows |
|
|
|
public ViewStep() |
|
|
|
{ |
|
|
|
InitializeComponent(); |
|
|
|
Form1_Load(); |
|
|
|
} |
|
|
|
|
|
|
|
private void Tb_KeyPress(object sender, TextCompositionEventArgs e)//输入事件
|
|
|
@ -31,23 +32,48 @@ namespace DyeingComputer.Windows |
|
|
|
//Regex re = new Regex("[^0-9.-]+");
|
|
|
|
Regex re = new Regex(@"^[0-9]+(.[0-9]{1,3})?$");// 非零的正整数
|
|
|
|
e.Handled = !re.IsMatch(e.Text); |
|
|
|
} |
|
|
|
|
|
|
|
private void Form1_Load() |
|
|
|
{ |
|
|
|
this.boxID.Items.Add(Properties.Resources.TemperatureControl); |
|
|
|
this.boxID.Items.Add(Properties.Resources.AddWater + "(" + Properties.Resources.WaterLevel + ")"); |
|
|
|
this.boxID.Items.Add(Properties.Resources.AddWater + "(" + Properties.Resources.Flowmeter + ")"); |
|
|
|
this.boxID.Items.Add(Properties.Resources.Washing + "(" + Properties.Resources.WaterLevel + ")"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
private void TextBox_TextChanged(object sender, TextChangedEventArgs e) |
|
|
|
{ |
|
|
|
int l = code.Text.Length; |
|
|
|
string text = code.Text.ToString(); |
|
|
|
int l = boxNAME.Text.Length; |
|
|
|
string text = boxNAME.Text.ToString(); |
|
|
|
if (l == 3) |
|
|
|
{ |
|
|
|
if(text == "001") { } |
|
|
|
if(text == "001") |
|
|
|
{ |
|
|
|
boxID.SelectedIndex = 0; //温度控制
|
|
|
|
} |
|
|
|
else |
|
|
|
if (text == "007") { } |
|
|
|
if (text == "007") |
|
|
|
{ |
|
|
|
boxID.SelectedIndex = 1; //水位入水
|
|
|
|
} |
|
|
|
else |
|
|
|
if (text == "008") { } |
|
|
|
if (text == "008") |
|
|
|
{ |
|
|
|
boxID.SelectedIndex = 2; //流量入水
|
|
|
|
} |
|
|
|
else |
|
|
|
if (text == "013") { } |
|
|
|
else |
|
|
|
if (text == "014") { } |
|
|
|
if (text == "013") |
|
|
|
{ |
|
|
|
boxID.SelectedIndex = 3;//水洗
|
|
|
|
} |
|
|
|
else |
|
|
|
if (text == "017") { } |
|
|
|
else |
|
|
@ -123,5 +149,10 @@ namespace DyeingComputer.Windows |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void boxID_SelectionChanged(object sender, SelectionChangedEventArgs e) |
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|