Explorar el Código

测试修改

样式分支
pry hace 2 años
padre
commit
d9abdb7ad5
Se han modificado 8 ficheros con 227 adiciones y 12 borrados
  1. +3
    -3
      BPASmartClient.Business/Plugin/OrderProxy.cs
  2. +11
    -0
      BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj
  3. +35
    -0
      BPASmartClient.CustomResource/Properties/App.xaml
  4. +132
    -0
      BPASmartClient.CustomResource/Properties/App.xaml.cs
  5. +32
    -0
      BPASmartClient.CustomResource/RecDictionarys/RecButtonStyle.xaml
  6. +11
    -5
      BPASmartClient.MorkS/View/Debug.xaml
  7. +2
    -2
      BPASmartClient/App.config
  8. +1
    -2
      BPASmartClient/App.xaml

+ 3
- 3
BPASmartClient.Business/Plugin/OrderProxy.cs Ver fichero

@@ -45,11 +45,11 @@ namespace BPASmartClient.Business
if (morkOrderPushes.TryDequeue(out MorkOrderPush mork))
{
Thread.Sleep(3000);
new OrderStatusChangedEvent() { Status = ORDER_STATUS.COOKING, SubOrderId = mork.SuborderId, GoodName = mork.GoodsName }.Publish();
new OrderStatusChangedEvent() { SortNum = mork.SortNum.ToString(), Status = ORDER_STATUS.COOKING, SubOrderId = mork.SuborderId, GoodName = mork.GoodsName }.Publish();
Thread.Sleep(5000);
new OrderStatusChangedEvent() { Status = ORDER_STATUS.COMPLETED_COOK, SubOrderId = mork.SuborderId, GoodName = mork.GoodsName }.Publish();
new OrderStatusChangedEvent() { SortNum = mork.SortNum.ToString(), Status = ORDER_STATUS.COMPLETED_COOK, SubOrderId = mork.SuborderId, GoodName = mork.GoodsName }.Publish();
Thread.Sleep(5000);
new OrderStatusChangedEvent() { Status = ORDER_STATUS.COMPLETED_TAKE, SubOrderId = mork.SuborderId, GoodName = mork.GoodsName }.Publish();
new OrderStatusChangedEvent() { SortNum = mork.SortNum.ToString(), Status = ORDER_STATUS.COMPLETED_TAKE, SubOrderId = mork.SuborderId, GoodName = mork.GoodsName }.Publish();
Thread.Sleep(2000);
}
}


+ 11
- 0
BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj Ver fichero

@@ -167,6 +167,17 @@
<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" />


+ 35
- 0
BPASmartClient.CustomResource/Properties/App.xaml Ver fichero

@@ -0,0 +1,35 @@
<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>

+ 132
- 0
BPASmartClient.CustomResource/Properties/App.xaml.cs Ver fichero

@@ -0,0 +1,132 @@
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(); }));
}



}
}

+ 32
- 0
BPASmartClient.CustomResource/RecDictionarys/RecButtonStyle.xaml Ver fichero

@@ -0,0 +1,32 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!--#region 按钮样式-->
<Style x:Key="ButtonStyle" TargetType="Button">
<Setter Property="Foreground" Value="#00c2f4" />
<Setter Property="FontSize" Value="18" />
<Setter Property="Margin" Value="10,0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border
Name="TitleBarBr"
Background="Transparent"
BorderBrush="#00c2f4"
BorderThickness="2"
CornerRadius="10">
<ContentPresenter
Margin="{TemplateBinding Margin}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="TitleBarBr" Property="Background" Value="#3300c2f4" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--#endregion-->

</ResourceDictionary>

+ 11
- 5
BPASmartClient.MorkS/View/Debug.xaml Ver fichero

@@ -16,10 +16,16 @@
</UserControl.DataContext>

<Grid>
<Label
HorizontalAlignment="Center"
VerticalAlignment="Center"
Content="调试界面"
FontSize="40" />
<Grid.RowDefinitions>
<RowDefinition Height="35" />
<RowDefinition />
</Grid.RowDefinitions>
<Button
Grid.Row="0"
Width="150"
Margin="10,0,0,0"
HorizontalAlignment="Left"
Content="初始化设备"
Style="{StaticResource ButtonStyle}" />
</Grid>
</UserControl>

+ 2
- 2
BPASmartClient/App.config Ver fichero

@@ -3,8 +3,8 @@
<appSettings>

<!--通用配置-->
<add key="ClientId" value="54"/>
<add key="IsEnableTest" value="False"/>
<add key="ClientId" value="43"/>
<add key="IsEnableTest" value="true"/>

<!--开发环境-->
<!--<add key="apollouri" value="http://10.2.1.21:28080/"/>


+ 1
- 2
BPASmartClient/App.xaml Ver fichero

@@ -16,8 +16,7 @@
<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/Themes/GenricStyle.xaml"/>
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml"/>-->
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecButtonStyle.xaml" />

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


Cargando…
Cancelar
Guardar