sc 2 months ago
parent
commit
58f457c305
  1. 20
      MainWindow.xaml
  2. 10
      MainWindow.xaml.cs
  3. 30
      UserClass/AsyncTcpServer.cs
  4. 8
      ViewModel/MainWindowViewModel.cs

20
MainWindow.xaml

@ -186,9 +186,23 @@
MouseLeftButtonUp="Image_MouseLeftButtonUp" VerticalAlignment="Center"/>
<Image Height="40" VerticalAlignment="Center" Width="40" Source="/Lmage/link.png"
Visibility="{Binding Link_bool}"/>
<Image Height="40" VerticalAlignment="Center" Width="40" Source="/Lmage/IconParkAutoFocus.png"
Visibility="{Binding AUTO_bool}" MouseLeftButtonDown="Image_MouseLeftButtonDown_1"
MouseLeftButtonUp="Image_MouseLeftButtonUp_1"/>
<Image Height="40" Width="40" VerticalAlignment="Center" FlowDirection="LeftToRight"
MouseLeftButtonDown="Image_MouseLeftButtonDown_1"
MouseLeftButtonUp="Image_MouseLeftButtonUp_1">
<Image.Style>
<Style TargetType="Image">
<Setter Property="Source" Value="/Lmage/IconParkAutoFocus.png"/>
<Style.Triggers>
<DataTrigger Binding="{Binding AUTO_bool}" Value="false">
<Setter Property="Source" Value="/Lmage/IconParkAutoFocus.png"/>
</DataTrigger>
<DataTrigger Binding="{Binding AUTO_bool}" Value="true">
<Setter Property="Source" Value="/Lmage/Hand.png"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
</StackPanel>
</Grid>
</Grid>

10
MainWindow.xaml.cs

@ -1,9 +1,10 @@
using DyeingComputer.UserClass;
using DyeingComputer.ViewModel;
using DyeingComputer.View;
using DyeingComputer.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
@ -34,8 +35,7 @@ namespace DyeingComputer
MainWindowViewModel.ViewID = 1;
}
private SQLiteHelper SQLiteHelpers = null; //定义数据库
public static SQLiteHelper SQLiteHelpers = null; //定义数据库
private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\800COMPUTER.db"; //数据库路径
/// <summary>
@ -197,7 +197,9 @@ namespace DyeingComputer
{
((Image)sender).RenderTransform = Transform.Identity;
MainWindowViewModel.UserInfoStart = 901;
MainWindowViewModel.UserInfo = Properties.Resources.Manual;
if (MainWindowViewModel._AUTO_bool)
{ MainWindowViewModel.UserInfo = Properties.Resources.Auto; }
else { MainWindowViewModel.UserInfo = Properties.Resources.Manual; }
}//手动
}
}

30
UserClass/AsyncTcpServer.cs

@ -468,16 +468,32 @@ namespace DyeingComputer.UserClass
{
Dictionary<string, object> dat_829;
dat_829 = SerializeConvert.JsonDeserializeFromString<Dictionary<string, object>>(SYSDAT);
if (dat_829.GetValue("LOCK").ToString() == "True")
{
MainWindowViewModel._Lock_bool = true;
client.SendAsync("SC829" + SYSKEY + SYSDAT);
if (dat_829.GetValue("NAME").ToString() == "LOCK") {
if (dat_829.GetValue("VALUE").ToString() == "True")
{
MainWindowViewModel._Lock_bool = true;
client.SendAsync("SC829" + SYSKEY + SYSDAT);
}
else
{
MainWindowViewModel._Lock_bool = false;
client.SendAsync("SC829" + SYSKEY + SYSDAT);
}
}
else
else if (dat_829.GetValue("NAME").ToString() == "AUTO")
{
MainWindowViewModel._Lock_bool = false;
client.SendAsync("SC829" + SYSKEY + SYSDAT);
if (dat_829.GetValue("VALUE").ToString() == "True")
{
MainWindowViewModel._AUTO_bool = true;
client.SendAsync("SC829" + SYSKEY + SYSDAT);
}
else
{
MainWindowViewModel._AUTO_bool = false;
client.SendAsync("SC829" + SYSKEY + SYSDAT);
}
}
MainWindowViewModel.TX++;
APILog.DBlog(client.IP, SYSKEY, SYSAPI, SYSDAT);//记录指令
}

8
ViewModel/MainWindowViewModel.cs

@ -133,8 +133,8 @@ namespace DyeingComputer.ViewModel
}
}
public static bool _AUTO_bool;
Visibility AUTO_bool_xml; //显示手自动状态
public Visibility AUTO_bool //
bool AUTO_bool_xml; //显示手自动状态
public bool AUTO_bool //
{
get => AUTO_bool_xml;
set
@ -538,8 +538,8 @@ namespace DyeingComputer.ViewModel
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 (_AUTO_bool) { AUTO_bool = _AUTO_bool; Updata_dtd("3005",true); }
else { AUTO_bool = _AUTO_bool; }//手自动图标
if ((Selet_dtm("1010") < 1) || (Selet_dtm("1010") > 160))
{ ERRinf.ERRinf_w(errTabler, Resources.Temperature + Resources.Sensor + Resources.Malfunction, "ERR101"); } //温度故障提示

Loading…
Cancel
Save