@@ -130,7 +130,7 @@ namespace BPASmartClient.Device | |||||
peripherals.ForEach(p => | peripherals.ForEach(p => | ||||
{ | { | ||||
p.DeviceId = this.DeviceId; | p.DeviceId = this.DeviceId; | ||||
p.Init(); | p.Init(); | ||||
}); | }); | ||||
this.peripherals = peripherals; | this.peripherals = peripherals; | ||||
@@ -196,6 +196,21 @@ namespace BPASmartClient.Device | |||||
InitTask(); | InitTask(); | ||||
} | } | ||||
private void ResetStatus() | |||||
{ | |||||
this.GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).ToList().ForEach(item => | |||||
{ | |||||
var res = item.FieldType.GetInterfaces(); | |||||
if (res != null) | |||||
{ | |||||
foreach (var faces in res) | |||||
{ | |||||
if (faces.Name == "IStatus") InterfaceStatus = item.GetValue(this) as IStatus; | |||||
} | |||||
} | |||||
}); | |||||
} | |||||
private void GetGvlStatus() | private void GetGvlStatus() | ||||
{ | { | ||||
this.GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).ToList().ForEach(item => | this.GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).ToList().ForEach(item => | ||||
@@ -284,6 +299,7 @@ namespace BPASmartClient.Device | |||||
ThreadManage.GetInstance().StopTask($"GvlStatusMonitor:{DeviceId}", new Action(() => | ThreadManage.GetInstance().StopTask($"GvlStatusMonitor:{DeviceId}", new Action(() => | ||||
{ | { | ||||
ResetProgram(); | ResetProgram(); | ||||
ResetStatus(); | |||||
InitTask(); | InitTask(); | ||||
})); | })); | ||||
})); | })); | ||||
@@ -6,11 +6,11 @@ using System.Text; | |||||
using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
using System.Collections.ObjectModel; | using System.Collections.ObjectModel; | ||||
using System.Collections.Concurrent; | using System.Collections.Concurrent; | ||||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||||
namespace BPASmartClient.Model | namespace BPASmartClient.Model | ||||
{ | { | ||||
public class KeepDataBase | |||||
public class KeepDataBase : ObservableObject | |||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// 模拟订单数据的配置 | /// 模拟订单数据的配置 | ||||
@@ -22,5 +22,12 @@ namespace BPASmartClient.Model | |||||
/// </summary> | /// </summary> | ||||
public ObservableCollection<OrderData> orderLists { get; set; } = new ObservableCollection<OrderData>(); | public ObservableCollection<OrderData> orderLists { get; set; } = new ObservableCollection<OrderData>(); | ||||
/// <summary> | |||||
/// 是否验证上位机 | |||||
/// </summary> | |||||
public bool IsVerify { get { return _mIsVerify; } set { _mIsVerify = value; OnPropertyChanged(); } } | |||||
private bool _mIsVerify; | |||||
} | } | ||||
} | } |
@@ -1,29 +0,0 @@ | |||||
//using System; | |||||
//using System.Collections.Generic; | |||||
//using System.Linq; | |||||
//using System.Text; | |||||
//using System.Threading.Tasks; | |||||
//namespace BPASmartClient.Model | |||||
//{ | |||||
// public class ParSet | |||||
// { | |||||
// public ushort Minute { get { return _mMinute; } set { _mMinute = value; } } | |||||
// private ushort _mMinute; | |||||
// public ushort Second { get { return _mSecond; } set { _mSecond = value; } } | |||||
// private ushort _mSecond; | |||||
// public bool IsShield { get { return _mIsShield; } set { _mIsShield = value; } } | |||||
// private bool _mIsShield; | |||||
// public string TextBlockContext { get { return _mTextBlockContext; } set { _mTextBlockContext = value; } } | |||||
// private string _mTextBlockContext; | |||||
// public string CheckBoxContext { get { return _mCheckBoxContext; } set { _mCheckBoxContext = value; } } | |||||
// private string _mCheckBoxContext; | |||||
// } | |||||
//} |
@@ -240,18 +240,7 @@ namespace BPASmartClient.MorkS | |||||
mORKS.doOrderEvents.Add(order); | mORKS.doOrderEvents.Add(order); | ||||
if (order.MorkOrder.GoodBatchings == null) return; | if (order.MorkOrder.GoodBatchings == null) return; | ||||
OrderCount++; | OrderCount++; | ||||
new OrderStatusChangedEvent() | |||||
{ | |||||
DeviceId = DeviceId, | |||||
SubOrderId = order.MorkOrder.SuborderId, | |||||
Status = ORDER_STATUS.WAIT, | |||||
GoodName = order.MorkOrder.GoodsName, | |||||
SortNum = order.MorkOrder.SortNum.ToString(), | |||||
deviceClientType = DeviceType | |||||
}.Publish(); | |||||
OrderChange(order.MorkOrder.SuborderId, ORDER_STATUS.WAIT); | |||||
DeviceProcessLogShow($"接收到{OrderCount}次订单"); | DeviceProcessLogShow($"接收到{OrderCount}次订单"); | ||||
foreach (var item in order.MorkOrder.GoodBatchings) | foreach (var item in order.MorkOrder.GoodBatchings) | ||||
{ | { | ||||
@@ -294,8 +283,10 @@ namespace BPASmartClient.MorkS | |||||
public override void MainTask() | public override void MainTask() | ||||
{ | { | ||||
mORKS.AllowRun = mORKS.InitComplete; | mORKS.AllowRun = mORKS.InitComplete; | ||||
IsHealth = mORKS.Error && mORKS.InitComplete; | |||||
//IsHealth = true; | |||||
if (Json<KeepDataBase>.Data.IsVerify) | |||||
IsHealth = mORKS.Error && mORKS.InitComplete; | |||||
else | |||||
IsHealth = true; | |||||
if (mORKS.AllowRun) | if (mORKS.AllowRun) | ||||
{ | { | ||||
@@ -5,6 +5,7 @@ using System.Collections.ObjectModel; | |||||
using System.Linq; | using System.Linq; | ||||
using System.Text; | using System.Text; | ||||
using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||||
namespace BPASmartClient.MorkS.Model | namespace BPASmartClient.MorkS.Model | ||||
{ | { | ||||
@@ -25,6 +25,7 @@ | |||||
Width="150" | Width="150" | ||||
Margin="10,0,0,0" | Margin="10,0,0,0" | ||||
HorizontalAlignment="Left" | HorizontalAlignment="Left" | ||||
Command="{Binding InitCommand}" | |||||
Content="初始化设备" | Content="初始化设备" | ||||
Style="{StaticResource ButtonStyle}" /> | Style="{StaticResource ButtonStyle}" /> | ||||
</Grid> | </Grid> | ||||
@@ -3,8 +3,9 @@ using System.Collections.Generic; | |||||
using System.Linq; | using System.Linq; | ||||
using System.Text; | using System.Text; | ||||
using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
using BPASmartClient.Helper; | |||||
using Microsoft.Toolkit.Mvvm.ComponentModel; | using Microsoft.Toolkit.Mvvm.ComponentModel; | ||||
using Microsoft.Toolkit.Mvvm.Input; | |||||
namespace BPASmartClient.MorkS.ViewModel | namespace BPASmartClient.MorkS.ViewModel | ||||
{ | { | ||||
@@ -12,7 +13,9 @@ namespace BPASmartClient.MorkS.ViewModel | |||||
{ | { | ||||
public DebugViewModel() | public DebugViewModel() | ||||
{ | { | ||||
InitCommand = new RelayCommand(() => { ActionManage.GetInstance.Send("InitDevice"); }); | |||||
} | } | ||||
public RelayCommand InitCommand { get; set; } | |||||
} | } | ||||
} | } |
@@ -1,6 +1,7 @@ | |||||
using BPASmartClient.Business; | using BPASmartClient.Business; | ||||
using BPASmartClient.Helper; | using BPASmartClient.Helper; | ||||
using BPASmartClient.Message; | using BPASmartClient.Message; | ||||
using BPASmartClient.Model; | |||||
using Microsoft.Toolkit.Mvvm.ComponentModel; | using Microsoft.Toolkit.Mvvm.ComponentModel; | ||||
using Microsoft.Toolkit.Mvvm.Input; | using Microsoft.Toolkit.Mvvm.Input; | ||||
using System; | using System; | ||||
@@ -74,7 +75,7 @@ namespace BPASmartClient.ViewModel | |||||
}; | }; | ||||
dispatcherTimer.Interval = TimeSpan.FromSeconds(1); | dispatcherTimer.Interval = TimeSpan.FromSeconds(1); | ||||
dispatcherTimer.Start(); | dispatcherTimer.Start(); | ||||
} | } | ||||
@@ -82,7 +83,7 @@ namespace BPASmartClient.ViewModel | |||||
public bool AutoStart { get { return SystemHelper.GetInstance.IsAutoStart(); } set { SystemHelper.GetInstance.AutoStart(value); OnPropertyChanged(); } } | public bool AutoStart { get { return SystemHelper.GetInstance.IsAutoStart(); } set { SystemHelper.GetInstance.AutoStart(value); OnPropertyChanged(); } } | ||||
public bool IsVerty { get { return Json<KeepDataBase>.Data.IsVerify; } set { Json<KeepDataBase>.Data.IsVerify = value; OnPropertyChanged(); } } | |||||
} | } | ||||
@@ -4,7 +4,8 @@ | |||||
<!--通用配置--> | <!--通用配置--> | ||||
<add key="ClientId" value="43"/> | <add key="ClientId" value="43"/> | ||||
<add key="IsEnableTest" value="true"/> | |||||
<add key="IsEnableTest" value="false"/> | |||||
<add key="IsVerify" value="false"/> | |||||
<!--开发环境--> | <!--开发环境--> | ||||
<!--<add key="apollouri" value="http://10.2.1.21:28080/"/> | <!--<add key="apollouri" value="http://10.2.1.21:28080/"/> | ||||
@@ -49,7 +49,7 @@ | |||||
Margin="20,0,0,0" | Margin="20,0,0,0" | ||||
VerticalAlignment="Center" | VerticalAlignment="Center" | ||||
Style="{DynamicResource imagetop_Title}" /> | Style="{DynamicResource imagetop_Title}" /> | ||||
<Grid Grid.Column="1" > | |||||
<Grid Grid.Column="1"> | |||||
<Menu x:Name="myMenu"> | <Menu x:Name="myMenu"> | ||||
<MenuItem Header="功能列表"> | <MenuItem Header="功能列表"> | ||||
<MenuItem | <MenuItem | ||||
@@ -82,7 +82,7 @@ | |||||
Header="阿里连接维护" | Header="阿里连接维护" | ||||
Tag="DataVView" /> | Tag="DataVView" /> | ||||
<Separator /> | <Separator /> | ||||
<MenuItem | |||||
<MenuItem | |||||
Click="Debug_Click" | Click="Debug_Click" | ||||
FontSize="12" | FontSize="12" | ||||
Header="调试界面" | Header="调试界面" | ||||
@@ -221,30 +221,35 @@ | |||||
Grid.Row="0" | Grid.Row="0" | ||||
Grid.RowSpan="2" | Grid.RowSpan="2" | ||||
Style="{DynamicResource border右下}" /> | Style="{DynamicResource border右下}" /> | ||||
<Border | <Border | ||||
Grid.Row="0" | Grid.Row="0" | ||||
Grid.RowSpan="2" | Grid.RowSpan="2" | ||||
Style="{DynamicResource border左下}" /> | Style="{DynamicResource border左下}" /> | ||||
<Border | <Border | ||||
Grid.Row="0" | Grid.Row="0" | ||||
Grid.RowSpan="2" | Grid.RowSpan="2" | ||||
Style="{DynamicResource border右上}" /> | Style="{DynamicResource border右上}" /> | ||||
<Border | <Border | ||||
Grid.Row="0" | Grid.Row="0" | ||||
Grid.RowSpan="2" | Grid.RowSpan="2" | ||||
Style="{DynamicResource border左上}" /> | Style="{DynamicResource border左上}" /> | ||||
<Grid Margin="10"> | <Grid Margin="10"> | ||||
<Border Width="600" Style="{DynamicResource borderFromTitle}" /> | <Border Width="600" Style="{DynamicResource borderFromTitle}" /> | ||||
<StackPanel Orientation="Horizontal" > | |||||
<StackPanel Orientation="Horizontal"> | |||||
<CheckBox | <CheckBox | ||||
Content="开机启动" Margin="5,0,5,0" | |||||
IsChecked="{Binding AutoStart}" /> | |||||
<Button | |||||
Margin="5,0,5,0" | |||||
Content="开机启动" | |||||
IsChecked="{Binding AutoStart}" /> | |||||
<CheckBox | |||||
Margin="5,0,5,0" | |||||
Content="验证设备" | |||||
IsChecked="{Binding IsVerty}" /> | |||||
<!--<Button | |||||
Name="init" Margin="5,0,5,0" | Name="init" Margin="5,0,5,0" | ||||
Grid.Row="0" | Grid.Row="0" | ||||
Width="90" | Width="90" | ||||
@@ -259,7 +264,7 @@ | |||||
VerticalAlignment="Top" | VerticalAlignment="Top" | ||||
Click="Button_Click" | Click="Button_Click" | ||||
Content="测试" | Content="测试" | ||||
Cursor="Hand" /> | |||||
Cursor="Hand" />--> | |||||
</StackPanel> | </StackPanel> | ||||
<TextBlock | <TextBlock | ||||
@@ -270,30 +275,31 @@ | |||||
日志监控界面 | 日志监控界面 | ||||
</TextBlock> | </TextBlock> | ||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> | |||||
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal"> | |||||
<Button | <Button | ||||
Name="login" Margin="5,0,5,0" | |||||
Grid.Row="0" | |||||
Width="45" | |||||
HorizontalAlignment="Right" | |||||
VerticalAlignment="Top" | |||||
Click="Button_Login" | |||||
Content="登录" | |||||
Cursor="Hand"/> | |||||
Name="login" | |||||
Grid.Row="0" | |||||
Width="45" | |||||
Margin="5,0,5,0" | |||||
HorizontalAlignment="Right" | |||||
VerticalAlignment="Top" | |||||
Click="Button_Login" | |||||
Content="登录" | |||||
Cursor="Hand" /> | |||||
<Button | <Button | ||||
Name="logout" | |||||
Grid.Row="0" | |||||
Width="45" | |||||
HorizontalAlignment="Right" | |||||
VerticalAlignment="Top" | |||||
Click="Button_LogOut" | |||||
Command="{Binding LogoutCommand}" | |||||
Content="注销" | |||||
Cursor="Hand" /> | |||||
Name="logout" | |||||
Grid.Row="0" | |||||
Width="45" | |||||
HorizontalAlignment="Right" | |||||
VerticalAlignment="Top" | |||||
Click="Button_LogOut" | |||||
Command="{Binding LogoutCommand}" | |||||
Content="注销" | |||||
Cursor="Hand" /> | |||||
</StackPanel> | </StackPanel> | ||||
</Grid> | </Grid> | ||||
<!--#region 底部窗体栏--> | <!--#region 底部窗体栏--> | ||||
<ContentControl x:Name="contentRegion" Grid.Row="1" /> | <ContentControl x:Name="contentRegion" Grid.Row="1" /> | ||||
<!--#endregion--> | <!--#endregion--> | ||||