@@ -8,7 +8,7 @@ | |||
<ItemGroup> | |||
<PackageReference Include="BPA.ApolloClient" Version="1.0.12" /> | |||
<PackageReference Include="BPA.Message" Version="1.0.21" /> | |||
<PackageReference Include="BPA.Message" Version="1.0.24" /> | |||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" /> | |||
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="6.0.0" /> | |||
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0" /> | |||
@@ -25,6 +25,8 @@ namespace BPASmartClient.Business | |||
//Apollo地址 | |||
private string apolloUri; | |||
private string apoid; | |||
private string namespa; | |||
//设备集合 | |||
private List<DeviceConfig> deviceConfigs; | |||
public void Dispose() | |||
@@ -35,6 +37,8 @@ namespace BPASmartClient.Business | |||
{ | |||
ClientId = int.Parse(System.Configuration.ConfigurationManager.AppSettings["ClientId"]); | |||
apolloUri = System.Configuration.ConfigurationManager.AppSettings["ApolloUri"].ToString(); | |||
apoid = System.Configuration.ConfigurationManager.AppSettings["AppId"].ToString(); | |||
namespa = System.Configuration.ConfigurationManager.AppSettings["Namespaces"].ToString(); | |||
InternetInfo.OrderServer = System.Configuration.ConfigurationManager.AppSettings["OrderServiceUri"].ToString(); | |||
InternetInfo.StockServer = System.Configuration.ConfigurationManager.AppSettings["StockServiceUri"].ToString(); | |||
InitDeviceModel(); | |||
@@ -83,60 +87,6 @@ namespace BPASmartClient.Business | |||
deviceConfig.Peripherals.Add(peripheral); | |||
} | |||
} | |||
//if (null != device.Element("Parameters")) | |||
//{ | |||
// foreach (var deviceParameter in device.Element("Parameters").Elements()) | |||
// { | |||
// deviceConfig.Parameters.Add(deviceParameter.Name.LocalName, deviceParameter.Value); | |||
// } | |||
//} | |||
//var Peripheral = device.XPathSelectElements("Parameters"); | |||
//if (null != Peripheral) | |||
//{ | |||
// foreach (var deviceParameter in Peripheral) | |||
// { | |||
// deviceConfig.Parameters.Add(deviceParameter.Name.LocalName, deviceParameter.Value); | |||
// } | |||
//} | |||
//if (device.Element("Peripheral") != null) | |||
//{ | |||
// foreach (var peripherals in device.Element("Peripheral").Elements()) | |||
// { | |||
// BPASmartClient.Model.Peripheral peripheral = new BPASmartClient.Model.Peripheral(); | |||
// peripheral.Module = peripherals.Attribute("Module").Value; | |||
// if (null != peripherals.Element("Parameters")) | |||
// { | |||
// foreach (XElement parameter in peripherals.Element("Parameters").Elements()) | |||
// { | |||
// peripheral.Parameters.Add(parameter.Name.LocalName, parameter.Value); | |||
// } | |||
// } | |||
// deviceConfig.Peripherals.Add(peripheral); | |||
// } | |||
//} | |||
//foreach (var peripheralEl in device.XPathSelectElements("//Peripheral")) | |||
//{ | |||
// BPASmartClient.Model.Peripheral peripheral = new BPASmartClient.Model.Peripheral(); | |||
// peripheral.Module = peripheralEl.Attribute("Module").Value; | |||
// if (null != peripheralEl.Element("Parameters")) | |||
// { | |||
// foreach (XElement parameter in peripheralEl.Element("Parameters").Elements()) | |||
// { | |||
// peripheral.Parameters.Add(parameter.Name.LocalName, parameter.Value); | |||
// } | |||
// } | |||
// deviceConfig.Peripherals.Add(peripheral); | |||
//} | |||
deviceConfigs.Add(deviceConfig); | |||
} | |||
} | |||
@@ -159,9 +109,9 @@ namespace BPASmartClient.Business | |||
//正式版本 | |||
configurationBuilder.AddApolloConfiguration(p => | |||
{ | |||
p.AppId = "order"; | |||
p.AppId = apoid; | |||
p.MetaServer = apolloUri; | |||
p.Namespaces = new List<string>() { "TEST1.Config" }; | |||
p.Namespaces = new List<string>() { namespa }; | |||
}); | |||
IConfiguration config = configurationBuilder.Build(); | |||
@@ -99,7 +99,7 @@ namespace BPASmartClient.Business | |||
{ | |||
EventBus.EventBus.GetInstance().Publish(new RecipeBomEvent() | |||
{ | |||
Id = device.DeviceId, | |||
DeviceId = device.DeviceId, | |||
recipeBoms = JsonConvert.DeserializeObject<RecipeBoms>(result) | |||
}); | |||
MessageLog.GetInstance.Show("接收到辅料信息"); | |||
@@ -109,7 +109,7 @@ namespace BPASmartClient.Business | |||
var apiData = JsonConvert.DeserializeObject<OrderMaterialDelivery>(result); | |||
EventBus.EventBus.GetInstance().Publish(new MaterialDeliveryEvent() | |||
{ | |||
Id = device.DeviceId, | |||
DeviceId = device.DeviceId, | |||
orderMaterialDelivery = apiData | |||
}); | |||
MessageLog.GetInstance.Show("接收到物料信息"); | |||
@@ -1,4 +1,4 @@ | |||
#define test | |||
//#define test | |||
using BPA.Message; | |||
using BPA.Message.Enum; | |||
using BPASmartClient.EventBus; | |||
@@ -109,7 +109,7 @@ namespace BPASmartClient.Business | |||
morkOrderPushes.Enqueue(temp); | |||
#endif | |||
var orderEvent = DoOrderEvent.Make(temp); | |||
orderEvent.Id = device.DeviceId; | |||
orderEvent.DeviceId = device.DeviceId; | |||
orderEvent.Publish(); | |||
ActionManage.GetInstance.Send("AddOrder", new object[] { temp, device }); | |||
} | |||
@@ -124,6 +124,8 @@ namespace BPASmartClient.Business | |||
OrderStatusChangedEvent orderStatusChangedEvent = @event as OrderStatusChangedEvent; | |||
string result = string.Empty; | |||
OrderStatusChange orderStatusChange = new OrderStatusChange() { CookingStatus = orderStatusChangedEvent.Status, SuborderId = orderStatusChangedEvent.SubOrderId }; | |||
#region API 订单状态修改 | |||
try | |||
{ | |||
string header = $"[{InternetInfo.OrderServer}/order/robotstatuschange]_[{DateTime.Now.Ticks}]".AESEncrypt(); | |||
@@ -137,8 +139,17 @@ namespace BPASmartClient.Business | |||
var res = JsonConvert.DeserializeObject<OrderStatusRsp>(result); | |||
ActionManage.GetInstance.Send("OrderStatusChange", orderStatusChangedEvent); | |||
MessageLog.GetInstance.Show(string.Format("订单状态改变,调用API执行结果{0}", res == null ? false : res.isSuccess)); | |||
#endregion | |||
#region MQTT 订单状态修改 | |||
var clientId = Plugin.GetInstance().GetPlugin<ConfigMgr>().ClientId; | |||
var temp = BPAPackage.Make(orderStatusChange, clientId, orderStatusChangedEvent.deviceClientType); | |||
Plugin.GetInstance().GetPlugin<MQTTMgr>().Publish(TOPIC.GetInstance.GetAppTopic(clientId.ToString()), temp.Serialize(false)); | |||
#endregion | |||
} | |||
/// <summary> | |||
/// 资源释放 | |||
/// </summary> | |||
@@ -200,7 +200,7 @@ | |||
</ItemGroup> | |||
<ItemGroup> | |||
<PackageReference Include="BPA.Message" Version="1.0.21" /> | |||
<PackageReference Include="BPA.Message" Version="1.0.24" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
@@ -141,7 +141,7 @@ namespace BPASmartClient.DRCoffee | |||
{ | |||
status["Status"] = package.Status; | |||
lastRefreshTime = DateTime.Now; | |||
new DRCoffee_CoffeEndCookEvent() { Id = DeviceId }.Publish(); | |||
new DRCoffee_CoffeEndCookEvent() { DeviceId = DeviceId }.Publish(); | |||
} | |||
else status["Status"] = package.Status; | |||
status["AppStatus"] = package.ApplicationStatus; | |||
@@ -5,7 +5,7 @@ | |||
</PropertyGroup> | |||
<ItemGroup> | |||
<PackageReference Include="BPA.Message" Version="1.0.21" /> | |||
<PackageReference Include="BPA.Message" Version="1.0.24" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
@@ -70,12 +70,12 @@ namespace BPASmartClient.EventBus | |||
/// </summary> | |||
public void Publish<TEvent>(TEvent @event) where TEvent : IEvent | |||
{ | |||
if (_eventHandls.ContainsKey(@event.Id)) | |||
if (_eventHandls.ContainsKey(@event.DeviceId)) | |||
{ | |||
if (_eventHandls[@event.Id].ContainsKey(typeof(TEvent))) | |||
if (_eventHandls[@event.DeviceId].ContainsKey(typeof(TEvent))) | |||
{ | |||
for (int i = _eventHandls[@event.Id][typeof(TEvent)].Count - 1; i >= 0; i--) | |||
_eventHandls[@event.Id][typeof(TEvent)][i](@event); | |||
for (int i = _eventHandls[@event.DeviceId][typeof(TEvent)].Count - 1; i >= 0; i--) | |||
_eventHandls[@event.DeviceId][typeof(TEvent)][i](@event); | |||
//_eventHandls[typeof(TEvent)].ForEach(p => | |||
//{ | |||
@@ -91,9 +91,9 @@ namespace BPASmartClient.EventBus | |||
public void Publish<TEvent>(TEvent @event, EventCallBackHandle eventCallBack) where TEvent : IEvent | |||
{ | |||
List<object> result = new List<object>(); | |||
if (_eventHandls.ContainsKey(@event.Id)) | |||
if (_eventHandls.ContainsKey(@event.DeviceId)) | |||
{ | |||
if (_eventHandls[@event.Id].ContainsKey(typeof(TEvent))) | |||
if (_eventHandls[@event.DeviceId].ContainsKey(typeof(TEvent))) | |||
{ | |||
//_eventHandls[typeof(TEvent)].ForEach(p => | |||
//{ | |||
@@ -103,9 +103,9 @@ namespace BPASmartClient.EventBus | |||
// }); | |||
//}); | |||
for (int i = _eventHandls[@event.Id][typeof(TEvent)].Count - 1; i >= 0; i--) | |||
for (int i = _eventHandls[@event.DeviceId][typeof(TEvent)].Count - 1; i >= 0; i--) | |||
{ | |||
_eventHandls[@event.Id][typeof(TEvent)][i](@event, delegate (object[] args) | |||
_eventHandls[@event.DeviceId][typeof(TEvent)][i](@event, delegate (object[] args) | |||
{ | |||
result.AddRange(args); | |||
}); | |||
@@ -5,6 +5,6 @@ | |||
/// </summary> | |||
public interface IEvent | |||
{ | |||
int Id { get; set; } | |||
int DeviceId { get; set; } | |||
} | |||
} |
@@ -273,13 +273,13 @@ namespace BPASmartClient.GSIceCream | |||
if ((MORKI_FAULT)status["Fault"] != MORKI_FAULT.未发生故障) | |||
{ | |||
MessageLog.GetInstance.Show(string.Format("当前存在故障[{0}%],不允许制作",(MORKI_FAULT)status["Fault"])); | |||
new GSIceCream_EndCookEvent() { Id = DeviceId,Status = false }.Publish(); | |||
new GSIceCream_EndCookEvent() { DeviceId = DeviceId,Status = false }.Publish(); | |||
return; | |||
} | |||
if ((byte)status["CXB"] <= 86) | |||
{ | |||
MessageLog.GetInstance.Show(string.Format("当前成型比[{0}%],低于86%,不允许制作",(byte)status["CXB"])); | |||
new GSIceCream_EndCookEvent() { Id = DeviceId,Status = false }.Publish(); | |||
new GSIceCream_EndCookEvent() { DeviceId = DeviceId,Status = false }.Publish(); | |||
return; | |||
} | |||
@@ -315,13 +315,13 @@ namespace BPASmartClient.GSIceCream | |||
commProxy.SendData(data); | |||
Thread.Sleep(200); | |||
free = false; | |||
new GSIceCream_EndCookEvent() { Id = DeviceId,Status =true}.Publish(); | |||
new GSIceCream_EndCookEvent() { DeviceId = DeviceId,Status =true}.Publish(); | |||
MessageLog.GetInstance.Show(string.Format("出料操作->设置模式[{0}]",MORKI_MODE.打料)); | |||
} | |||
else | |||
{ | |||
MessageLog.GetInstance.Show(string.Format("出料操作->模式切换失败,当前模式[{0}],不允许出料",(MORKI_MODE)status["CurrentMode"])); | |||
new GSIceCream_EndCookEvent() { Id = DeviceId,Status = false }.Publish(); | |||
new GSIceCream_EndCookEvent() { DeviceId = DeviceId,Status = false }.Publish(); | |||
} | |||
} | |||
catch (Exception ex) | |||
@@ -80,12 +80,11 @@ namespace BPASmartClient.Message | |||
public void DeviceProcessLogShow(string id, string info) | |||
{ | |||
if (!DPLogInfo.ContainsKey(id)) | |||
{ | |||
DPLogInfo.TryAdd(id, info); | |||
Debug.WriteLine($"{DateTime.Now.ToString("HH:mm:ss")}:{info}"); | |||
//ExLogInfo = $"{DateTime.Now.ToString("HH:mm:ss")}:{info} \n\r {ExLogInfo}"; | |||
if (DeviceProcessLogNotify != null) DeviceProcessLogNotify(info); | |||
} | |||
else | |||
DPLogInfo[id] = $"{DateTime.Now.ToString("HH:mm:ss")}:{info} \n\r {DPLogInfo[id]}"; | |||
Debug.WriteLine($"{DateTime.Now.ToString("HH:mm:ss")}:{info}"); | |||
if (DeviceProcessLogNotify != null) DeviceProcessLogNotify(info); | |||
} | |||
#endregion | |||
@@ -15,7 +15,7 @@ | |||
</ItemGroup> | |||
<ItemGroup> | |||
<PackageReference Include="BPA.Message" Version="1.0.21" /> | |||
<PackageReference Include="BPA.Message" Version="1.0.24" /> | |||
<PackageReference Include="Microsoft.Toolkit.Mvvm" Version="7.1.2" /> | |||
</ItemGroup> | |||
@@ -1,4 +1,5 @@ | |||
using BPASmartClient.EventBus; | |||
using BPA.Message.Enum; | |||
using BPASmartClient.EventBus; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
@@ -9,6 +10,7 @@ namespace BPASmartClient.Model | |||
{ | |||
public class BaseEvent : IEvent | |||
{ | |||
public int Id { get; set; } | |||
public int DeviceId { get; set; } | |||
public DeviceClientType deviceClientType { get; set; } | |||
} | |||
} |
@@ -6,6 +6,10 @@ | |||
<Nullable>enable</Nullable> | |||
</PropertyGroup> | |||
<ItemGroup> | |||
<PackageReference Include="BPA.Models" Version="1.0.10" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\BPASmartClient.Device\BPASmartClient.Device.csproj" /> | |||
<ProjectReference Include="..\BPASmartClient.Model\BPASmartClient.Model.csproj" /> | |||
@@ -106,7 +106,7 @@ namespace BPASmartClient.MorkF | |||
private void OrderChange(string subid, ORDER_STATUS oRDER_STATUS) | |||
{ | |||
EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { Id = DeviceId, Status = oRDER_STATUS, SubOrderId = subid }); | |||
EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { DeviceId = DeviceId, Status = oRDER_STATUS, SubOrderId = subid }); | |||
} | |||
/// <summary> | |||
@@ -504,7 +504,7 @@ namespace BPASmartClient.MorkF | |||
/// <param name="value"></param> | |||
private void WriteData(string address, object value) | |||
{ | |||
EventBus.EventBus.GetInstance().Publish(new WriteModel() { Id = DeviceId, Address = address, Value = value }); | |||
EventBus.EventBus.GetInstance().Publish(new WriteModel() { DeviceId = DeviceId, Address = address, Value = value }); | |||
} | |||
/// <summary> | |||
/// 灶台档位调节 | |||
@@ -27,6 +27,7 @@ namespace BPASmartClient.MorkS | |||
{ | |||
ServerInit(); | |||
DataParse(); | |||
ActionManage.GetInstance.Register(new Action(() => { DeviceInit(); }), "InitDevice"); | |||
} | |||
public override void ResetProgram() | |||
@@ -66,12 +67,12 @@ namespace BPASmartClient.MorkS | |||
private void OrderChange(string subid, ORDER_STATUS oRDER_STATUS) | |||
{ | |||
EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { Id = DeviceId, Status = oRDER_STATUS, SubOrderId = subid }); | |||
EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { DeviceId = DeviceId, Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); | |||
} | |||
private void ReadData(string address, ushort len = 1, Action<bool[]> action = null) | |||
{ | |||
EventBus.EventBus.GetInstance().Publish(new ReadModel() { Id = DeviceId, Address = address, Length = len }, (o) => | |||
EventBus.EventBus.GetInstance().Publish(new ReadModel() { DeviceId = DeviceId, Address = address, Length = len }, (o) => | |||
{ | |||
if (o != null && o.Length > 0 && o[0] is bool[] bools) | |||
{ | |||
@@ -159,7 +160,7 @@ namespace BPASmartClient.MorkS | |||
} | |||
})); | |||
EventBus.EventBus.GetInstance().Publish(new ReadModel() { Id = DeviceId, Address = "VW372", Length = 1 }, (o) => | |||
EventBus.EventBus.GetInstance().Publish(new ReadModel() { DeviceId = DeviceId, Address = "VW372", Length = 1 }, (o) => | |||
{ | |||
if (o != null && o.Length > 0 && o[0] is ushort value) | |||
{ | |||
@@ -443,7 +444,7 @@ namespace BPASmartClient.MorkS | |||
private void WriteData(string address, object value) | |||
{ | |||
EventBus.EventBus.GetInstance().Publish(new WriteModel() { Id = DeviceId, Address = address, Value = value }); | |||
EventBus.EventBus.GetInstance().Publish(new WriteModel() { DeviceId = DeviceId, Address = address, Value = value }); | |||
} | |||
/// <summary> | |||
@@ -20,10 +20,10 @@ namespace BPASmartClient.ViewModel | |||
/// <summary> | |||
/// 日志界面 | |||
/// </summary> | |||
public class LogViewModel :ObservableObject | |||
public class LogViewModel : ObservableObject | |||
{ | |||
//public DispatcherTimer dispatcherTimer; | |||
public string ClientId= System.Configuration.ConfigurationManager.AppSettings["ClientId"].ToString(); | |||
public string ClientId = System.Configuration.ConfigurationManager.AppSettings["ClientId"].ToString(); | |||
private ObservableCollection<LogModel> _LogModels; | |||
public ObservableCollection<LogModel> LogDataGrid | |||
{ | |||
@@ -43,20 +43,20 @@ namespace BPASmartClient.ViewModel | |||
public static LogViewModel GetInstance() => _Instance ?? (_Instance = new LogViewModel()); | |||
private LogViewModel() | |||
{ | |||
if(LogDataGrid==null) | |||
if (LogDataGrid == null) | |||
LogDataGrid = new ObservableCollection<LogModel>(); | |||
MessageLog.GetInstance.InfoNotify = new Action<string>((s) => | |||
{ | |||
System.Windows.Application.Current?.Dispatcher.Invoke((Action)(() => | |||
{ | |||
LogDataGrid.Insert(0,new LogModel { message = s,type = "Info" }); | |||
LogDataGrid.Insert(0, new LogModel { message = s, type = "Base" });//基础消息 | |||
})); | |||
}); | |||
MessageLog.GetInstance.ExInfoNotify = new Action<string>((s) => | |||
{ | |||
System.Windows.Application.Current?.Dispatcher.Invoke((Action)(() => | |||
{ | |||
LogDataGrid.Insert(0,new LogModel { message = s,type = "Error" }); | |||
LogDataGrid.Insert(0, new LogModel { message = s, type = "Error" });//错误消息 | |||
DataVClient.GetInstance().HttpAddLog(new LogTable | |||
{ | |||
ClientId = ClientId, | |||
@@ -67,6 +67,13 @@ namespace BPASmartClient.ViewModel | |||
}); | |||
})); | |||
}); | |||
MessageLog.GetInstance.DeviceProcessLogNotify = new Action<string>((s) => | |||
{ | |||
Application.Current?.Dispatcher.Invoke(new Action(() => | |||
{ | |||
LogDataGrid.Insert(0, new LogModel { message = s, type = "Device" });//设备消息 | |||
})); | |||
}); | |||
ExcelCommand = new RelayCommand(() => | |||
{ | |||
ExcellOrder(); | |||
@@ -83,7 +90,7 @@ namespace BPASmartClient.ViewModel | |||
string text = "时间 类型 日志内容\n"; | |||
LogDataGrid?.ToList().ForEach(temp => | |||
{ | |||
text = text + temp.time + " " + temp.type + " " + temp.message+ "\n"; | |||
text = text + temp.time + " " + temp.type + " " + temp.message + "\n"; | |||
}); | |||
SaveFileDialog openfile = new SaveFileDialog(); | |||
openfile.Filter = "Txt文件(*.txt)|*.txt"; | |||
@@ -95,7 +102,7 @@ namespace BPASmartClient.ViewModel | |||
if (!System.IO.File.Exists(path)) | |||
{ | |||
//没有则创建这个文件 | |||
FileStream fs1 = new FileStream(path,FileMode.Create,FileAccess.Write);//创建写入文件 | |||
FileStream fs1 = new FileStream(path, FileMode.Create, FileAccess.Write);//创建写入文件 | |||
StreamWriter sw = new StreamWriter(fs1); | |||
sw.WriteLine(text);//开始写入值 | |||
sw.Close(); | |||
@@ -103,14 +110,14 @@ namespace BPASmartClient.ViewModel | |||
} | |||
else | |||
{ | |||
FileStream fs = new FileStream(path,FileMode.Open,FileAccess.Write); | |||
FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Write); | |||
StreamWriter sr = new StreamWriter(fs); | |||
sr.WriteLine(text);//开始写入值 | |||
sr.Close(); | |||
fs.Close(); | |||
} | |||
string msg = string.Format("记录导出完成,共导出记录{0}条,是否打开!",LogDataGrid.Count); | |||
if (System.Windows.MessageBox.Show(msg,"提示",MessageBoxButton.OKCancel) == MessageBoxResult.OK) | |||
string msg = string.Format("记录导出完成,共导出记录{0}条,是否打开!", LogDataGrid.Count); | |||
if (System.Windows.MessageBox.Show(msg, "提示", MessageBoxButton.OKCancel) == MessageBoxResult.OK) | |||
{ | |||
OpenFile(openfile.FileName); | |||
} | |||
@@ -206,7 +213,7 @@ namespace BPASmartClient.ViewModel | |||
} | |||
public class LogModel :ObservableObject | |||
public class LogModel : ObservableObject | |||
{ | |||
public string time { get; set; } | |||
@@ -222,7 +229,7 @@ namespace BPASmartClient.ViewModel | |||
if (_type == value) | |||
return; | |||
_type = value; | |||
if(_type== "Error") foreground = new SolidColorBrush((System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#ed0032")); | |||
if (_type == "Error") foreground = new SolidColorBrush((System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#ed0032")); | |||
OnPropertyChanged("type"); | |||
} | |||
@@ -246,8 +253,8 @@ namespace BPASmartClient.ViewModel | |||
} | |||
public LogModel() | |||
{ | |||
foreground=new SolidColorBrush((System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#21bb2e")); | |||
time =DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); | |||
foreground = new SolidColorBrush((System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#21bb2e")); | |||
time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); | |||
} | |||
} | |||
} |
@@ -11,7 +11,7 @@ | |||
<!--客户端ID--> | |||
<!--1:且时且多冰淇淋咖啡机,2:且时且多煮面机,3:海科煮面机测试店铺--> | |||
<add key="ClientId" value="2"/> | |||
<add key="ClientId" value="111"/> | |||
<!--<add key="ApolloUri" value="http://10.2.1.21:28080"/> | |||
<add key="OrderServiceUri" value="http://10.2.1.26:21527/order/"/> | |||
<add key="StockServiceUri" value="http://10.2.1.26:21527/stock/"/>--> | |||
@@ -23,6 +23,8 @@ | |||
<add key="OrderServiceUri" value="https://bpa.black-pa.com:21527/order/"/> | |||
<add key="StockServiceUri" value="https://bpa.black-pa.com:21527/stock/"/> | |||
<add key="DataVServiceUri" value="https://bpa.black-pa.com:21527/datav"/> | |||
<add key="AppId" value="order"/> | |||
<add key ="Namespaces" value="TEST1.Config"/> | |||
<!--正式环境--> | |||
<!--<add key="ApolloUri" value="http://47.108.65.220:28080"/> | |||
@@ -42,14 +42,12 @@ | |||
<Peripherals> | |||
<Peripheral Module="BPASmartClient.PLC.MorksMachine"> | |||
<Parameters> | |||
<IpAddress>127.0.0.1</IpAddress> | |||
<Port>502</Port> | |||
<PLCReadAddress>M,M550.0,16;M,M0.1,1;M,M1.0,8;M,M2.0,9;M,M8.0,4;M,M13.5,1;M,M16.0,7;</PLCReadAddress> | |||
<IpAddress>192.168.1.11</IpAddress> | |||
<Port>508</Port> | |||
<PLCReadAddress>M,M550.0,16;M,M0.3,3;M,M100.0,16;M,M235.0,1;M,M102.0,7;M,M103.0,6;VW,VW372,1</PLCReadAddress> | |||
</Parameters> | |||
</Peripheral> | |||
</Peripherals> | |||
</Device> | |||
</BPADevices> |
@@ -261,6 +261,18 @@ | |||
Cursor="Hand" | |||
Style="{DynamicResource CommonBtn_返回}" /> | |||
<Button | |||
Name="init" | |||
Grid.Row="0" | |||
Width="90" | |||
Margin="350,0,0,0" | |||
HorizontalAlignment="Left" | |||
VerticalAlignment="Top" | |||
Click="init_Click" | |||
Content="初始化设备" | |||
Cursor="Hand" | |||
Style="{DynamicResource CommonBtn_返回}" /> | |||
<TextBlock | |||
x:Name="Title" | |||
HorizontalAlignment="Center" | |||
@@ -132,21 +132,6 @@ namespace BPASmartClient | |||
private void Button_Click_1(object sender, RoutedEventArgs e) | |||
{ | |||
//List<string> name = new List<string>(); | |||
//var a = AppDomain.CurrentDomain.GetAssemblies(); | |||
//foreach (var item in a) | |||
//{ | |||
// if (item.FullName.Contains("Mork")) | |||
// { | |||
// name.Add(item.FullName); | |||
// } | |||
//} | |||
//var re = this.GetType().Assembly.GetTypes().ToList().Where(p => p.GetInterfaces().Contains(typeof(IDevice))).ToList(); | |||
//var res = AppDomain.CurrentDomain.GetAssemblies(); | |||
//var re = | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Info, this, "我是标题", "我是消息内容!我是消息内容!我是消息内容!我是消息内容!"); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, this, "我是标题", "我是消息内容!我是消息内容!我是消息内容!我是消息内容!"); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Warn, this, "我是标题", "我是消息内容!我是消息内容!我是消息内容!我是消息内容!"); | |||
@@ -188,5 +173,10 @@ namespace BPASmartClient | |||
} | |||
private void init_Click(object sender, RoutedEventArgs e) | |||
{ | |||
ActionManage.GetInstance.Send("InitDevice"); | |||
} | |||
} | |||
} |