sc 1 year ago
parent
commit
b66a4a13e5
  1. 45
      Properties/Resources.Designer.cs
  2. 12
      Properties/Resources.en-US.resx
  3. 15
      Properties/Resources.resx
  4. 12
      Properties/Resources.zh-CN.resx
  5. 12
      Properties/Resources.zh-TW.resx
  6. 4
      Windows/ViewStep.xaml
  7. 47
      Windows/ViewStep.xaml.cs

45
Properties/Resources.Designer.cs

@ -78,6 +78,15 @@ namespace DyeingComputer.Properties {
} }
} }
/// <summary>
/// 查找类似 Add water 的本地化字符串。
/// </summary>
public static string AddWater {
get {
return ResourceManager.GetString("AddWater", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 Auto 的本地化字符串。 /// 查找类似 Auto 的本地化字符串。
/// </summary> /// </summary>
@ -186,6 +195,15 @@ namespace DyeingComputer.Properties {
} }
} }
/// <summary>
/// 查找类似 Flowmeter 的本地化字符串。
/// </summary>
public static string Flowmeter {
get {
return ResourceManager.GetString("Flowmeter", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 History 的本地化字符串。 /// 查找类似 History 的本地化字符串。
/// </summary> /// </summary>
@ -429,6 +447,15 @@ namespace DyeingComputer.Properties {
} }
} }
/// <summary>
/// 查找类似 Temperature Control 的本地化字符串。
/// </summary>
public static string TemperatureControl {
get {
return ResourceManager.GetString("TemperatureControl", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 Time 的本地化字符串。 /// 查找类似 Time 的本地化字符串。
/// </summary> /// </summary>
@ -438,6 +465,24 @@ namespace DyeingComputer.Properties {
} }
} }
/// <summary>
/// 查找类似 Washing 的本地化字符串。
/// </summary>
public static string Washing {
get {
return ResourceManager.GetString("Washing", resourceCulture);
}
}
/// <summary>
/// 查找类似 Water Level 的本地化字符串。
/// </summary>
public static string WaterLevel {
get {
return ResourceManager.GetString("WaterLevel", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 Worklist 的本地化字符串。 /// 查找类似 Worklist 的本地化字符串。
/// </summary> /// </summary>

12
Properties/Resources.en-US.resx

@ -249,4 +249,16 @@
<data name="Quit" xml:space="preserve"> <data name="Quit" xml:space="preserve">
<value>Quit</value> <value>Quit</value>
</data> </data>
<data name="TemperatureControl" xml:space="preserve">
<value>Temperature Control</value>
</data>
<data name="AddWater" xml:space="preserve">
<value>Add water</value>
</data>
<data name="Flowmeter" xml:space="preserve">
<value>Flowmeter</value>
</data>
<data name="WaterLevel" xml:space="preserve">
<value>Water Level</value>
</data>
</root> </root>

15
Properties/Resources.resx

@ -249,4 +249,19 @@
<data name="Quit" xml:space="preserve"> <data name="Quit" xml:space="preserve">
<value>Quit</value> <value>Quit</value>
</data> </data>
<data name="AddWater" xml:space="preserve">
<value>Add water</value>
</data>
<data name="Flowmeter" xml:space="preserve">
<value>Flowmeter</value>
</data>
<data name="TemperatureControl" xml:space="preserve">
<value>Temperature Control</value>
</data>
<data name="Washing" xml:space="preserve">
<value>Washing</value>
</data>
<data name="WaterLevel" xml:space="preserve">
<value>Water Level</value>
</data>
</root> </root>

12
Properties/Resources.zh-CN.resx

@ -249,4 +249,16 @@
<data name="Quit" xml:space="preserve"> <data name="Quit" xml:space="preserve">
<value>退出</value> <value>退出</value>
</data> </data>
<data name="TemperatureControl" xml:space="preserve">
<value>温度控制</value>
</data>
<data name="AddWater" xml:space="preserve">
<value>入水</value>
</data>
<data name="Flowmeter" xml:space="preserve">
<value>流量</value>
</data>
<data name="WaterLevel" xml:space="preserve">
<value>水位</value>
</data>
</root> </root>

12
Properties/Resources.zh-TW.resx

@ -249,4 +249,16 @@
<data name="Quit" xml:space="preserve"> <data name="Quit" xml:space="preserve">
<value>退出</value> <value>退出</value>
</data> </data>
<data name="TemperatureControl" xml:space="preserve">
<value>溫度控制</value>
</data>
<data name="AddWater" xml:space="preserve">
<value>入水</value>
</data>
<data name="Flowmeter" xml:space="preserve">
<value>流量</value>
</data>
<data name="WaterLevel" xml:space="preserve">
<value>水位</value>
</data>
</root> </root>

4
Windows/ViewStep.xaml

@ -11,8 +11,8 @@
<Grid FocusManager.FocusedElement="{Binding ElementName=box}"> <Grid FocusManager.FocusedElement="{Binding ElementName=box}">
<TextBlock x:Name="code" HorizontalAlignment="Left" Height="30" Margin="10,20,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="20" Background="#FFEFEEEE"/> <TextBlock x:Name="code" HorizontalAlignment="Left" Height="30" Margin="10,20,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="20" Background="#FFEFEEEE"/>
<TextBlock x:Name="name" HorizontalAlignment="Left" Height="30" Margin="10,60,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="20" Background="#FFEFEEEE"/> <TextBlock x:Name="name" HorizontalAlignment="Left" Height="30" Margin="10,60,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="20" Background="#FFEFEEEE"/>
<ComboBox HorizontalAlignment="Right" Height="30" Margin="0,60,10,0" VerticalAlignment="Top" Width="230" FontSize="20" /> <ComboBox x:Name="boxID" HorizontalAlignment="Right" Height="30" Margin="0,60,10,0" VerticalAlignment="Top" Width="230" FontSize="20" Text="12345125" SelectionChanged="boxID_SelectionChanged"/>
<TextBox x:Name="box" HorizontalAlignment="Right" Height="30" Margin="0,20,10,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="230" MaxLines="1" ClipToBounds="True" <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"/> TextChanged="TextBox_TextChanged" PreviewTextInput="Tb_KeyPress" InputMethod.IsInputMethodEnabled="False" FontSize="20" HorizontalContentAlignment="Right"/>
<Grid Margin="5,100,5,5"> <Grid Margin="5,100,5,5">
<ContentControl x:Name="container"/> <ContentControl x:Name="container"/>

47
Windows/ViewStep.xaml.cs

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

Loading…
Cancel
Save