Browse Source

morkt

样式分支
NXX 2 years ago
parent
commit
acaf3bbd29
9 changed files with 69 additions and 188 deletions
  1. +0
    -11
      BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj
  2. +0
    -35
      BPASmartClient.CustomResource/Properties/App.xaml
  3. +0
    -132
      BPASmartClient.CustomResource/Properties/App.xaml.cs
  4. +1
    -0
      BPASmartClient.DRCoffee/CoffeeMachine.cs
  5. +1
    -0
      BPASmartClient.GSIceCream/IceCreamMachine.cs
  6. +1
    -0
      BPASmartClient.Lebai/LebaiRobot.cs
  7. +4
    -7
      BPASmartClient.MorkT/Control_MorkT.cs
  8. +59
    -0
      BPASmartClient.MorkT/GLV_MorkT.cs
  9. +3
    -3
      BPASmartClient/App.config

+ 0
- 11
BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj View File

@@ -167,17 +167,6 @@
<None Remove="Image\黑菠萝科技.png" />
</ItemGroup>

<ItemGroup>
<Page Remove="Properties\App.xaml" />
</ItemGroup>

<ItemGroup>
<ApplicationDefinition Include="Properties\App.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
<Generator>MSBuild:Compile</Generator>
</ApplicationDefinition>
</ItemGroup>

<ItemGroup>
<Resource Include="Image\btn_close.png" />
<Resource Include="Image\ComboBoxPopSelect.png" />


+ 0
- 35
BPASmartClient.CustomResource/Properties/App.xaml View File

@@ -1,35 +0,0 @@
<Application
x:Class="BPASmartClient.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:con="clr-namespace:BPASmartClient.CustomResource.Converters;assembly=BPASmartClient.CustomResource"
xmlns:local="clr-namespace:BPASmartClient">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>

<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecCheckBox.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecTitleBarButton.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/GlobalStyle.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecComboBox.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecIcoButtonStyle.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecToggleButton.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/BeveledRadioButtonStyle.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/DatePickeerDictionary.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecButtonStyle.xaml" />

<ResourceDictionary>
<con:ColorConverter x:Key="ColorConverter" />
<con:TextConverter x:Key="TextConverter" />
<con:VisibleTypeConverter x:Key="VisibleTypeConverter" />
</ResourceDictionary>

<ResourceDictionary>
<ImageBrush x:Key="hbl" ImageSource="/BPASmartClient.CustomResource;component/Image/HBL.png" />
<ImageBrush x:Key="dbxt" ImageSource="/BPASmartClient.CustomResource;component/Image/顶部线条.png" />
</ResourceDictionary>

</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>

+ 0
- 132
BPASmartClient.CustomResource/Properties/App.xaml.cs View File

@@ -1,132 +0,0 @@
using BPA.Message;
using BPA.Message.Enum;
using BPASmartClient.Helper;
using BPASmartClient.Message;
using BPASmartClient.Model;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Configuration;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Forms;

namespace BPASmartClient
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : System.Windows.Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
SystemHelper.GetInstance.CreateDesktopShortcut();
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
DataRead();
MainWindow mainView = new MainWindow();
mainView.Show();
SplitScreenDisplay();
NoCompleteOrderInit();
}

/// <summary>
/// 分屏显示
/// </summary>
private void SplitScreenDisplay()
{
if (Screen.AllScreens.Length == 3)
{
//left = new MORKD_Window_Left();
//right = new MORKD_Window_Right();

//Screen[] screen = Screen.AllScreens;
//Rectangle[] rectangle = new Rectangle[screen.Length];
//Window[] windows = new Window[screen.Length];
//windows[0] = mainView;
//windows[1] = left;
//windows[2] = right;
//for (int i = 0; i < screen.Length; i++)
//{
// rectangle[i] = screen[i].WorkingArea;
// windows[i].Height = rectangle[i].Height;
// windows[i].Width = rectangle[i].Width;
// windows[i].Top = rectangle[i].Top;
// windows[i].Left = rectangle[i].Left;
//}

//left.Show();
//right.Show();
//windows[1].Owner = windows[0];
//windows[2].Owner = windows[0];
}
}

/// <summary>
/// 未完成订单初始化
/// </summary>
private void NoCompleteOrderInit()
{
if (Json<KeepDataBase>.Data.orderLists.Count > 0)
{
OrderListDialogView listDialogView = new OrderListDialogView();
listDialogView.ShowDialog();
}
}

private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
var ErroLog = e.ExceptionObject.ToString();
MessageLog.GetInstance.Show(ErroLog);
TextHelper.GetInstance.WriteTextInfo(ErroLog, "ErroLog");
DataSave();
//SqlHelper.GetInstance.Save();
//MainConsole.Main.GetInstance.DataSave();
//IotReport.GetInstance.HttpAddLog(new BPA.Message.API请求.LogTable
//{
// ClientId = InternetInfo.ClientId.ToString(),
// LogTime = DateTime.Now,
// LogType = "1",
// LogMessage = ErroLog,
// LogVla = "异常",
//});
// Process.Start($"{AppDomain.CurrentDomain.BaseDirectory}{AppDomain.CurrentDomain.FriendlyName}.exe");
}

protected override void OnExit(ExitEventArgs e)
{
base.OnExit(e);
DataSave();
//IotReport.Close();
//SqlHelper.GetInstance.Save();
//MainConsole.Main.GetInstance.DataSave();
ThreadManage.GetInstance().Dispose();
System.Environment.Exit(0);

}

/// <summary>
/// 输入保存
/// </summary>
private void DataSave()
{
Json<KeepDataBase>.Save();
//Sqlite<Alarm>.GetInstance.Save();
}

/// <summary>
/// 输入读取
/// </summary>
private void DataRead()
{
Json<KeepDataBase>.Read();
Task.Run(new Action(() => { Sqlite<Alarm>.GetInstance.GetData(); }));
}



}
}

+ 1
- 0
BPASmartClient.DRCoffee/CoffeeMachine.cs View File

@@ -148,6 +148,7 @@ namespace BPASmartClient.DRCoffee
lastRefreshTime = DateTime.Now;
IsConnected = OnLine;
status["CoffeConnected"] = OnLine;
new DRCoffee_CoffeEndCookEvent() { DeviceId = DeviceId }.Publish();
}
else status["Status"] = package.Status;


+ 1
- 0
BPASmartClient.GSIceCream/IceCreamMachine.cs View File

@@ -177,6 +177,7 @@ namespace BPASmartClient.GSIceCream
private void ProcessHeart(ICMSG_Heart_UP heartUpMsg)
{
IsConnected = OnLine;
status["IceCreamIsConnected"] = OnLine;
status["CurrentMode"] = heartUpMsg.MS;
status["YLWD"] = BitConverter.ToInt16(new byte[] { heartUpMsg.YLWD_L,heartUpMsg.YLWD_H },0);
status["HQWD"] = BitConverter.ToInt16(new byte[] { heartUpMsg.HQWD_L,heartUpMsg.HQWD_H },0);


+ 1
- 0
BPASmartClient.Lebai/LebaiRobot.cs View File

@@ -45,6 +45,7 @@ namespace BPASmartClient.Lebai
ThreadManage.GetInstance().StartLong(() =>
{
IsConnected = LebaiHelper.GetInstance().IsConnected;
status["RobotIsConnected"] = LebaiHelper.GetInstance().IsConnected;
status["OK"] = LebaiHelper.GetInstance().GetValueAsync().Ok;
status["Value"] = LebaiHelper.GetInstance().GetValueAsync().Value;
if (LebaiHelper.GetInstance().robotData != null) status["RobotMode"] = LebaiHelper.GetInstance().robotData.RobotMode.Mode;


+ 4
- 7
BPASmartClient.MorkT/Control_MorkT.cs View File

@@ -67,12 +67,6 @@ namespace BPASmartClient.MorkT
public override void MainTask()
{

GetStatus("RobotMode", new Action<object>((o) =>
{


}));

MakeCoffeeProcess();
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent { DeviceId = DeviceId, Pin = 0 },(o)=>
{
@@ -90,7 +84,10 @@ namespace BPASmartClient.MorkT

public override void ReadData()
{
GetStatus("IsConnected", new Action<object>((o) =>
{
}));
}




+ 59
- 0
BPASmartClient.MorkT/GLV_MorkT.cs View File

@@ -1,4 +1,8 @@
using BPASmartClient.Device;
using BPASmartClient.DRCoffee;
using BPASmartClient.GSIceCream;
using BPASmartClient.LebaiRobot;
using BPASmartClient.Model.冰淇淋.Enum;
using Robotc;
using System;
using System.Collections.Concurrent;
@@ -40,5 +44,60 @@ namespace BPASmartClient.MorkT
/// 冰淇淋机器出料口传感器检测
/// </summary>
public bool IceIsOK = true;

#region

[VariableMonitor("机器人连接状态")]
public bool RobotIsConnected;

[VariableMonitor("机器人状态")]
public ELebaiRModel RobotMode;

[VariableMonitor("冰淇淋连接状态")]
public bool IceCreamIsConnected;

[VariableMonitor("冰淇淋机器预冷温度")]
public short YLWD;

[VariableMonitor("冰淇淋机器回气温度")]
public short HQWD;

[VariableMonitor("冰淇淋机器环境温度")]
public short HJWD;

[VariableMonitor("冰淇淋机器电流")]
public short DL;

[VariableMonitor("冰淇淋机器电压")]
public bool DY;

[VariableMonitor("冰淇淋机器成型比")]
public byte CBX;

[VariableMonitor("冰淇淋机器模式")]
public MORKI_MODE IceCreamMode;

[VariableMonitor("冰淇淋机器故障")]
public MORKI_FAULT IceCreamFault;

[VariableMonitor("冰淇淋机器打料是否完成")]
public bool DLCompleted;

[VariableMonitor("咖啡机连接状态")]
public bool CoffeeIsConnected;

[VariableMonitor("咖啡机状态")]
public DrCoffeeStatus DrCoffeeStatus;

[VariableMonitor("咖啡机应用状态")]
public DrCoffeeAppStatus CoffeeAppStatus;

[VariableMonitor("咖啡机告警")]
public DrCoffeeWarning CoffeeWarning;

[VariableMonitor("咖啡机故障")]
public DrCoffeeFault CaffeeFault;

#endregion
}
}

+ 3
- 3
BPASmartClient/App.config View File

@@ -19,10 +19,10 @@
<!--阿里云上报启动方式:API 或者 LOCAL-->
<!--API :通过客户端ID,调用接口查询“设备连接信息”-->
<!--LOCAL:直接使用下方本地“设备连接信息”-->
<add key="StartupMode" value="API"/>
<add key="StartupMode" value="LOCAL"/>
<add key="ProductKey" value="grgpECHSL7q"/>
<add key="DeviceName" value="qsqd"/>
<add key="DeviceSecret" value="3c0f2390943bff4fece523af22655196"/>
<add key="DeviceName" value="qsqdzklb"/>
<add key="DeviceSecret" value="e2b300892c3e21469c8dc6c7c5c4430d"/>
<add key="PasswordBox" value="6WrKhYmTIhLV7g24jIH/lg=="/>




Loading…
Cancel
Save