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