|
|
|
@ -23,6 +23,7 @@ using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows;
|
|
|
|
|
using System.Windows.Media;
|
|
|
|
|
|
|
|
|
|
namespace SlnMesnac.WPF.ViewModel
|
|
|
|
@ -63,6 +64,8 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
|
|
|
|
|
|
//程序启动,打开绿色指示灯
|
|
|
|
|
gunHelper.SendData("OK");
|
|
|
|
|
OKIsVis = Visibility.Hidden;
|
|
|
|
|
NGIsVis = Visibility.Hidden;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -72,7 +75,8 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
|
/// <exception cref="NotImplementedException"></exception>
|
|
|
|
|
private void Reset()
|
|
|
|
|
{
|
|
|
|
|
//FileHelper.FindPhoto(DebugConfig.Instance.CameraFilePath);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
logoBusiness.Pass();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -263,39 +267,66 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region Logo识别结果
|
|
|
|
|
private string _resultTxt;
|
|
|
|
|
public string ResultTxt
|
|
|
|
|
//private string _resultTxt;
|
|
|
|
|
//public string ResultTxt
|
|
|
|
|
//{
|
|
|
|
|
// get { return _resultTxt; }
|
|
|
|
|
// set
|
|
|
|
|
// {
|
|
|
|
|
// _resultTxt = value;
|
|
|
|
|
// RaisePropertyChanged(nameof(ResultTxt));
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
//private System.Windows.Media.Brush _resultColor;
|
|
|
|
|
//public System.Windows.Media.Brush ResultColor
|
|
|
|
|
//{
|
|
|
|
|
// get { return _resultColor; }
|
|
|
|
|
// set
|
|
|
|
|
// {
|
|
|
|
|
// _resultColor = value;
|
|
|
|
|
// RaisePropertyChanged(nameof(ResultColor));
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
#region 识别结果ok\ng展示
|
|
|
|
|
private Visibility _OKIsVis;
|
|
|
|
|
public Visibility OKIsVis
|
|
|
|
|
{
|
|
|
|
|
get { return _resultTxt; }
|
|
|
|
|
get { return _OKIsVis; }
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_resultTxt = value;
|
|
|
|
|
RaisePropertyChanged(nameof(ResultTxt));
|
|
|
|
|
_OKIsVis = value;
|
|
|
|
|
RaisePropertyChanged(nameof(OKIsVis));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private System.Windows.Media.Brush _resultColor;
|
|
|
|
|
public System.Windows.Media.Brush ResultColor
|
|
|
|
|
private Visibility _NGIsVis;
|
|
|
|
|
public Visibility NGIsVis
|
|
|
|
|
{
|
|
|
|
|
get { return _resultColor; }
|
|
|
|
|
get { return _NGIsVis; }
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_resultColor = value;
|
|
|
|
|
RaisePropertyChanged(nameof(ResultColor));
|
|
|
|
|
_NGIsVis = value;
|
|
|
|
|
RaisePropertyChanged(nameof(NGIsVis));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
public void RefreshResultColor(bool isSuccess)
|
|
|
|
|
{
|
|
|
|
|
if (isSuccess)
|
|
|
|
|
{
|
|
|
|
|
ResultTxt = "OK";
|
|
|
|
|
ResultColor = System.Windows.Media.Brushes.LimeGreen;
|
|
|
|
|
OKIsVis = Visibility.Visible;
|
|
|
|
|
NGIsVis = Visibility.Collapsed;
|
|
|
|
|
//ResultTxt = "OK";
|
|
|
|
|
//ResultColor = System.Windows.Media.Brushes.LimeGreen;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ResultTxt = "NG";
|
|
|
|
|
ResultColor = System.Windows.Media.Brushes.Red;
|
|
|
|
|
OKIsVis = Visibility.Collapsed;
|
|
|
|
|
NGIsVis = Visibility.Visible;
|
|
|
|
|
//ResultTxt = "NG";
|
|
|
|
|
//ResultColor = System.Windows.Media.Brushes.Red;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|