Browse Source

添加中控自动状态信息

master
sc 3 months ago
parent
commit
c0aedcb843
  1. 2
      DyeingComputer.csproj
  2. BIN
      Lmage/IconParkAutoFocus.png
  3. 15
      MainWindow.xaml
  4. 11
      MainWindow.xaml.cs
  5. 9
      Properties/Resources.Designer.cs
  6. 3
      Properties/Resources.en-US.resx
  7. 3
      Properties/Resources.resx
  8. 3
      Properties/Resources.zh-CN.resx
  9. 3
      Properties/Resources.zh-TW.resx
  10. 24
      ViewModel/MainWindowViewModel.cs

2
DyeingComputer.csproj

@ -413,6 +413,8 @@
<Content Include="Fonts\font-awesome-4.7.0\css\font-awesome.css" />
<Content Include="Fonts\font-awesome-4.7.0\css\font-awesome.min.css" />
<Content Include="Fonts\font-awesome-4.7.0\fonts\fontawesome-webfont.svg" />
<Resource Include="Lmage\IconParkAutoFocus.png" />
<Resource Include="Lmage\FlatColorIconsCancel.png" />
<Resource Include="Lmage\IconParkPauseOne.png" />
<Resource Include="Lmage\IconParkPlay.png" />
<Resource Include="Lmage\IconParkStopwatch.png" />

BIN
Lmage/IconParkAutoFocus.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

15
MainWindow.xaml

@ -162,9 +162,10 @@
TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="20"
Background="{x:Null}" BorderBrush="{x:Null}" SelectionBrush="{x:Null}"
IsReadOnly="True" IsUndoEnabled="False" MaxLines="1" IsEnabled="False"/>
<StackPanel Margin="0,0,170,0" HorizontalAlignment="Right"
Orientation="Horizontal" FlowDirection="RightToLeft">
<Image Height="40" VerticalAlignment="Top" Width="40">
<Image Height="40" Width="40" VerticalAlignment="Center">
<Image.Style>
<Style TargetType="Image">
<Setter Property="Source" Value="/Lmage/IconParkStopwatch.png"/>
@ -178,13 +179,15 @@
</Style.Triggers>
</Style>
</Image.Style>
</Image>
<Image Height="40" VerticalAlignment="Top" Width="40" Source="/Lmage/IconParkLock.png"
</Image>
<Image Height="40" Width="40" Source="/Lmage/IconParkLock.png"
Visibility="{Binding Lock_bool}" MouseLeftButtonDown="Image_MouseLeftButtonDown"
MouseLeftButtonUp="Image_MouseLeftButtonUp"/>
<Image Height="40" VerticalAlignment="Top" Width="40" Source="/Lmage/link.png"
MouseLeftButtonUp="Image_MouseLeftButtonUp" VerticalAlignment="Center"/>
<Image Height="40" VerticalAlignment="Center" Width="40" Source="/Lmage/link.png"
Visibility="{Binding Link_bool}"/>
<Image Height="40" VerticalAlignment="Top" Width="40" Source="/Lmage/Manual.png"/>
<Image Height="40" VerticalAlignment="Center" Width="40" Source="/Lmage/IconParkAutoFocus.png"
Visibility="{Binding AUTO_bool}" MouseLeftButtonDown="Image_MouseLeftButtonDown_1"
MouseLeftButtonUp="Image_MouseLeftButtonUp_1"/>
</StackPanel>
</Grid>
</Grid>

11
MainWindow.xaml.cs

@ -207,6 +207,17 @@ namespace DyeingComputer
((Image)sender).RenderTransform = Transform.Identity;
MainWindowViewModel.UserInfoStart = 901;
MainWindowViewModel.UserInfo = Properties.Resources.Unlock;
}//解锁
private void Image_MouseLeftButtonDown_1(object sender, MouseButtonEventArgs e)
{
((Image)sender).RenderTransform = new ScaleTransform(0.9, 0.9);
}
private void Image_MouseLeftButtonUp_1(object sender, MouseButtonEventArgs e)
{
((Image)sender).RenderTransform = Transform.Identity;
MainWindowViewModel.UserInfoStart = 901;
MainWindowViewModel.UserInfo = Properties.Resources.Manual;
}//手动
}
}

9
Properties/Resources.Designer.cs

@ -645,6 +645,15 @@ namespace DyeingComputer.Properties {
}
}
/// <summary>
/// 查找类似 Manual 的本地化字符串。
/// </summary>
public static string Manual {
get {
return ResourceManager.GetString("Manual", resourceCulture);
}
}
/// <summary>
/// 查找类似 MasterCylinder 的本地化字符串。
/// </summary>

3
Properties/Resources.en-US.resx

@ -552,4 +552,7 @@
<data name="Unlock" xml:space="preserve">
<value>Unlock</value>
</data>
<data name="Manual" xml:space="preserve">
<value>Manual</value>
</data>
</root>

3
Properties/Resources.resx

@ -552,4 +552,7 @@
<data name="Unlock" xml:space="preserve">
<value>Unlock</value>
</data>
<data name="Manual" xml:space="preserve">
<value>Manual</value>
</data>
</root>

3
Properties/Resources.zh-CN.resx

@ -552,4 +552,7 @@
<data name="Unlock" xml:space="preserve">
<value>解锁</value>
</data>
<data name="Manual" xml:space="preserve">
<value>手动</value>
</data>
</root>

3
Properties/Resources.zh-TW.resx

@ -552,4 +552,7 @@
<data name="Unlock" xml:space="preserve">
<value />
</data>
<data name="Manual" xml:space="preserve">
<value />
</data>
</root>

24
ViewModel/MainWindowViewModel.cs

@ -125,6 +125,17 @@ namespace DyeingComputer.ViewModel
OnPropertyChanged("Link_bool");
}
}
public static bool _AUTO_bool;
Visibility AUTO_bool_xml; //显示手自动状态
public Visibility AUTO_bool //
{
get => AUTO_bool_xml;
set
{
AUTO_bool_xml = value;
OnPropertyChanged("AUTO_bool");
}
}
System.Windows.Media.Brush Status_str_coloer;
public System.Windows.Media.Brush Status_Str_coloer
{
@ -134,7 +145,7 @@ namespace DyeingComputer.ViewModel
Status_str_coloer = value;
OnPropertyChanged("Status_Str_coloer");
}
}
}
public int wORK_run; //显示状态
public int WORK_run //通知UI控件参数改变
{
@ -239,6 +250,7 @@ namespace DyeingComputer.ViewModel
UserButton = false;
_Lock_bool = false;
_Link_bool = false;
_AUTO_bool = false;
ProgramgroupView_run = new RelayCommand(
execute:ProgramgroupView_run_ );//开始/暂停事件
ProgramgroupView_stop = new RelayCommand(
@ -428,7 +440,7 @@ namespace DyeingComputer.ViewModel
Work_Numder = WorkNumder.ToString();
StatusStr = Status_Str;
Program_Name = ProgramName;
if (dt_TP != null) Process_step = dt_TP.Select("Step=" + RUN_STEPID).First().Field<string>("ParameterName");
if (dt_TP.Rows.Count>0) Process_step = dt_TP.Select("Step=" + RUN_STEPID).First().Field<string>("ParameterName");
if (set_) { set_ = false; SYS_SET(); }//设置更新
if (!SETP_runtime) DIDETime++;
@ -449,8 +461,12 @@ namespace DyeingComputer.ViewModel
Updata_dtd("3003", Alert_yellow);
Updata_dtd("3004", Alert_bell);
if (_Lock_bool) { Lock_bool = Visibility.Visible; } else { Lock_bool = Visibility.Collapsed; }//锁图标
if (_Link_bool) { Link_bool = Visibility.Visible; } else { Link_bool = Visibility.Collapsed; }//连线图标
if (_Lock_bool) { Lock_bool = Visibility.Visible; }
else { Lock_bool = Visibility.Collapsed; }//锁图标
if (_Link_bool) { Link_bool = Visibility.Visible; }
else { Link_bool = Visibility.Collapsed; }//连线图标
if (_AUTO_bool) { AUTO_bool = Visibility.Visible; Updata_dtd("3005",true); }
else { AUTO_bool = Visibility.Collapsed; }//手自动图标
if ((Selet_dtm("1010") < 1) || (Selet_dtm("1010") > 160))
{ ERRinf.ERRinf_w(errTabler, Resources.Temperature + Resources.Sensor + Resources.Malfunction, "ERR101"); } //温度故障提示

Loading…
Cancel
Save