Browse Source

180项目更新

样式分支
taoye 2 years ago
parent
commit
1191bb5ccc
10 changed files with 400 additions and 60 deletions
  1. +98
    -2
      BPASmartClient.CustomResource/Pages/View/MainView.xaml
  2. +26
    -1
      BPASmartClient.CustomResource/Pages/ViewModel/MainViewModel.cs
  3. +1
    -0
      BPASmartClient/BPASmartClient.csproj
  4. +2
    -1
      FryPot_DosingSystem/App.xaml
  5. +162
    -1
      FryPot_DosingSystem/App.xaml.cs
  6. +56
    -47
      FryPot_DosingSystem/Control/DosingLogicControl.cs
  7. +2
    -2
      FryPot_DosingSystem/Helper/HubHelper.cs
  8. +1
    -2
      FryPot_DosingSystem/Model/RecipeManage.cs
  9. +4
    -3
      FryPot_DosingSystem/View/RecipeSetView.xaml
  10. +48
    -1
      SmartClient.sln

+ 98
- 2
BPASmartClient.CustomResource/Pages/View/MainView.xaml View File

@@ -21,6 +21,7 @@
</Window.DataContext>

<Window.Resources>

<!--#region 静态资源-->
<ImageBrush x:Key="leftImage" ImageSource="../../Image/leftImage.png" />
@@ -280,7 +281,90 @@
</Setter>
</Style>
<!--#endregion-->

<Style x:Key="checkBoxStyle" TargetType="CheckBox">
<Setter Property="Foreground" Value="#a2c2e8" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="FocusVisualStyle">
<Setter.Value>
<Style>
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle
Margin="1"
SnapsToDevicePixels="True"
Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
StrokeDashArray="1 2"
StrokeThickness="1" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type CheckBox}">
<StackPanel
Background="Transparent"
Orientation="Horizontal"
SnapsToDevicePixels="True">
<Grid>
<Image
Width="12"
Height="14"
Source="/BPASmartClient.CustomResource;component/Image/Cb_HalfChecked.png" />
<Image
x:Name="image1"
Width="12"
Height="14"
Source="/BPASmartClient.CustomResource;component/Image/Cb_HalfChecked.png" />
</Grid>
<ContentPresenter
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding Content}"
ContentStringFormat="{TemplateBinding ContentStringFormat}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</StackPanel>
<ControlTemplate.Triggers>
<Trigger Property="HasContent" Value="True">
<Setter Property="FocusVisualStyle">
<Setter.Value>
<Style>
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle
Margin="14,0,0,0"
SnapsToDevicePixels="True"
Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
StrokeDashArray="1 2"
StrokeThickness="1" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Setter.Value>
</Setter>
<Setter Property="Padding" Value="4,0,0,0" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
</Trigger>
<Trigger Property="IsChecked" Value="true">
<Setter TargetName="image1" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/Cb_Checked.png" />
</Trigger>
<Trigger Property="IsChecked" Value="{x:Null}">
<Setter TargetName="image1" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/Cb_HalfChecked.png" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>

<Grid Background="#103153">
@@ -425,7 +509,19 @@
<RowDefinition Height="60" />
<RowDefinition />
</Grid.RowDefinitions>

<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<CheckBox
Style="{StaticResource checkBoxStyle}"
Margin="5,0,5,0"
Content="开机启动"
IsChecked="{Binding AutoStart}" />
<CheckBox
Style="{StaticResource checkBoxStyle}"
Margin="5,0,5,0"
Content="设备初始化"
IsChecked="{Binding Status}"
/>
</StackPanel>
<TextBlock
Margin="0,0,0,20"
HorizontalAlignment="Center"


+ 26
- 1
BPASmartClient.CustomResource/Pages/ViewModel/MainViewModel.cs View File

@@ -7,6 +7,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows;
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.Helper;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;

@@ -49,7 +50,31 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
}
}
}

private bool _status;
/// <summary>
/// 设备初始化状态
/// </summary>
public bool Status
{
get { return _status; }
set
{
if (value)
{
ActionManage.GetInstance.Send("StartPlcInite");
}
else
{
ActionManage.GetInstance.Send("EndPlcInite");
}
_status = value;
OnPropertyChanged();
}
}
/// <summary>
/// 开机自启
/// </summary>
public bool AutoStart { get { return SystemHelper.GetInstance.IsAutoStart(); } set { SystemHelper.GetInstance.AutoStart(value); OnPropertyChanged(); } }
public RelayCommand<object> NavChangedCommand { get; set; }

public FrameworkElement MainContent { get { return _mMainContent; } set { _mMainContent = value; OnPropertyChanged(); } }


+ 1
- 0
BPASmartClient/BPASmartClient.csproj View File

@@ -39,6 +39,7 @@
<ProjectReference Include="..\BPASmartClient.MorkT\BPASmartClient.MorkT.csproj" />
<ProjectReference Include="..\BPASmartClient.SCChip\BPASmartClient.SCChip.csproj" />
<ProjectReference Include="..\BPASmartClient.ViewModel\BPASmartClient.ViewModel.csproj" />
<ProjectReference Include="..\FryPot_DosingSystem\FryPot_DosingSystem.csproj" />
</ItemGroup>

<ItemGroup>


+ 2
- 1
FryPot_DosingSystem/App.xaml View File

@@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:FryPot_DosingSystem" xmlns:con="clr-namespace:System.Drawing;assembly=netstandard"
xmlns:con1="clr-namespace:BPASmartClient.CustomResource.Converters;assembly=BPASmartClient.CustomResource"
StartupUri="View/MainWindow.xaml">
>
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
@@ -23,6 +23,7 @@
<con1:TextConverter x:Key="TextConverter" />
<con1:VisibleTypeConverter x:Key="VisibleTypeConverter" />
<con1:StatusConverter x:Key="StatusConverter" />
<con1:StringToIconConverter x:Key="StringToIconConverter" />
</ResourceDictionary>

<ResourceDictionary>


+ 162
- 1
FryPot_DosingSystem/App.xaml.cs View File

@@ -1,5 +1,12 @@
using System;
using BPASmartClient.CustomResource.Pages.Enums;
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.CustomResource.Pages.View;
using BPASmartClient.Helper;
using FryPot_DosingSystem.Control;
using FryPot_DosingSystem.Model;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Configuration;
using System.Data;
using System.Linq;
@@ -13,5 +20,159 @@ namespace FryPot_DosingSystem
/// </summary>
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
MenuInite();
LoginDataInite();

MainView mv = new MainView();
LoginView lv = new LoginView();
var res = lv.ShowDialog();
if (res != null && res == true)
{
mv.Show();
DeviceOperate deviceOperate = DeviceOperate.GetInstance;//开启实时PLC数据读取
DosingLogicControl logigControl = DosingLogicControl.GetInstance;//开启逻辑控制任务程序
}
else
mv.Close();

}
protected override void OnExit(ExitEventArgs e)
{
base.OnExit(e);
Json<RecipeManage>.Save();
MessageLog.GetInstance.LogSave();
}
private void MenuInite()
{
#region 配方管理菜单
ObservableCollection<SubMenumodel> RecipeManage = new ObservableCollection<SubMenumodel>();
RecipeManage.Add(new SubMenumodel()
{
SubMenuName = "配方管理",
SubMenuPermission = new Permission[] { Permission.管理员 },
AssemblyName = "FryPot_DosingSystem",
ToggleWindowPath = "View.RecipeSetView"
});

RecipeManage.Add(new SubMenumodel()
{
SubMenuName = "配方下发",
SubMenuPermission = new Permission[] { Permission.操作员,Permission.管理员 },
AssemblyName = "FryPot_DosingSystem",
ToggleWindowPath = "View.RecipeSendDownView"
});

MenuManage.GetInstance.menuModels.Add(new MenuModel()
{
MainMenuIcon = "&#xe683;",
MainMenuName = "配方管理",
Alias = "Recipe Management",
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员 },
subMenumodels = RecipeManage,
});
#endregion

#region 消息日志
ObservableCollection<SubMenumodel> InfoLog = new ObservableCollection<SubMenumodel>();
InfoLog.Add(new SubMenumodel()
{
SubMenuName = "操作日志",
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.UserLogView"
});

InfoLog.Add(new SubMenumodel()
{
SubMenuName = "运行日志",
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.RunLogView"
});

InfoLog.Add(new SubMenumodel()
{
SubMenuName = "报警记录",
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.AlarmView"
});

MenuManage.GetInstance.menuModels.Add(new MenuModel()
{
MainMenuIcon = "&#xe668;",
MainMenuName = "消息日志",
Alias = "Message Log",
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
subMenumodels = InfoLog,
});
#endregion

#region 硬件设备监控
ObservableCollection<SubMenumodel> DeviceMonitor = new ObservableCollection<SubMenumodel>();
DeviceMonitor.Add(new SubMenumodel()
{
SubMenuName = "原料设备列表",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
AssemblyName = "FryPot_DosingSystem",
ToggleWindowPath = "View.DeviceListView"
});

DeviceMonitor.Add(new SubMenumodel()
{
SubMenuName = "设备状态",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
AssemblyName = "FryPot_DosingSystem",
ToggleWindowPath = "View.HardWareStatusView"
});


MenuManage.GetInstance.menuModels.Add(new MenuModel()
{
MainMenuIcon = "&#xe603;",
MainMenuName = "设备监控",
Alias = "Device Monitor",
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
subMenumodels = DeviceMonitor,
});
#endregion

#region 用户管理
ObservableCollection<SubMenumodel> UserManager = new ObservableCollection<SubMenumodel>();
UserManager.Add(new SubMenumodel()
{
SubMenuName = "用户登录",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.LoginView"
});

UserManager.Add(new SubMenumodel()
{
SubMenuName = "密码修改",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.PasswordChangeView"
});


MenuManage.GetInstance.menuModels.Add(new MenuModel()
{
MainMenuIcon = "&#xe66d;",
MainMenuName = "用户管理",
Alias = "User Management",
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
subMenumodels = UserManager,
});
#endregion
}
private void LoginDataInite()
{
Config.GetInstance.Init();//用户数据初始化
Json<RecipeManage>.Read();
}
}
}

+ 56
- 47
FryPot_DosingSystem/Control/DosingLogicControl.cs View File

@@ -1,6 +1,6 @@
using BPASmartClient.AGV;
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.Helper;
using BPASmartClient.Message;
using FryPot_DosingSystem.Model;
using System;
using System.Collections.Concurrent;
@@ -36,7 +36,7 @@ namespace FryPot_DosingSystem.Control
GlobalVariable globalVar;

#region 上位机内部变量
int lineAlarm = 0;//线体故障信号 1:无故障 -1:故障
//int lineAlarm = 0;//线体故障信号 1:无故障 -1:故障
int FryPotAlarm = 0;//炒锅滚筒故障信号 1:无故障 -1:故障
int ReicpeNum = 0;//记录接收到的配方数
#endregion
@@ -66,7 +66,7 @@ namespace FryPot_DosingSystem.Control
{
if (RTrig.GetInstance("ResetProgram").Start(globalVar.PlcInite == 1))//判断是否初始化 一初始化就重启主任务
{
MessageLog.GetInstance.Show("主任务正在重启");
MessageLog.GetInstance.ShowRunLog("主任务正在重启");
ThreadManage.GetInstance().StopTask("MainTask", new Action(() =>
{
ThreadManage.GetInstance().StopTask("MainViewReadPlcData", new Action(() =>
@@ -79,7 +79,7 @@ namespace FryPot_DosingSystem.Control
ActionManage.GetInstance.Send("ClearRecipes");
ReadPlcData();
IniteTask();
MessageLog.GetInstance.Show("主任务重启完成");
MessageLog.GetInstance.ShowRunLog("主任务重启完成");
}));
}));
}
@@ -127,6 +127,15 @@ namespace FryPot_DosingSystem.Control
globalVar.rollerLineThree.StationSeven = data[6];
globalVar.rollerLineThree.StationEight = data[7];
}));
GetAddressData("D2031", new Action<ushort[]>((data) =>
{
globalVar.rollerLineOne.OutMaterialingSingle = data[3];
globalVar.rollerLineTwo.OutMaterialingSingle = data[4];
globalVar.rollerLineThree.OutMaterialingSingle = data[5];
globalVar.rollerLineOne.OutMaterialingTroubleSingle=data[6];
globalVar.rollerLineTwo.OutMaterialingTroubleSingle = data[7];
globalVar.rollerLineThree.OutMaterialingTroubleSingle = data[8];
}));
GetAddressData("D2040", new Action<ushort[]>((data) =>
{
globalVar.fryPotOne.InputMaterialRollerRunningSingle = data[0];
@@ -229,7 +238,7 @@ namespace FryPot_DosingSystem.Control
{
RecipeQuene.Enqueue(recipe);
ReicpeNum++;
MessageLog.GetInstance.Show($"接收到{ReicpeNum}个配方");
MessageLog.GetInstance.ShowRunLog($"接收到{ReicpeNum}个配方");
}

}
@@ -253,7 +262,7 @@ namespace FryPot_DosingSystem.Control

if (RecipeQuene.TryDequeue(out NewRecipeModel result))
{
MessageLog.GetInstance.Show($"开始制作【{result.RecipeName}】 配方");
MessageLog.GetInstance.ShowRunLog($"开始制作【{result.RecipeName}】 配方");
for (int i = 0; i < result.materialCollection.Count; i++) //遍历单个配方中所有物料
{
//将配方中原料加入新的队列
@@ -290,7 +299,7 @@ namespace FryPot_DosingSystem.Control
/// </summary>
public void AgvLoadRoller()
{
lineAlarm = 0;
//lineAlarm = 0;
if (InputMaterialQuene.Count > 0)
{
switch (InputMaterialQuene.ElementAt(0).materialType.MaterialLoc / 100)
@@ -382,35 +391,35 @@ namespace FryPot_DosingSystem.Control
Thread.Sleep(5); if (globalVar.ExitMainTask)
return;
}
MessageLog.GetInstance.Show($"炒锅【1】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}已到进料位置,准备倒料"); break;
MessageLog.GetInstance.ShowRunLog($"炒锅【1】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}已到进料位置,准备倒料"); break;
case 2:
while (globalVar.fryPotTwo.InputMaterialArrivedSingle == 0 || globalVar.fryPotTwo.InputMaterialRollerRunningSingle == 0)
{
Thread.Sleep(5); if (globalVar.ExitMainTask)
return;
}
MessageLog.GetInstance.Show($"炒锅【2】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}已到进料位置,准备倒料"); break;
MessageLog.GetInstance.ShowRunLog($"炒锅【2】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}已到进料位置,准备倒料"); break;
case 3:
while (globalVar.fryPotThree.InputMaterialArrivedSingle == 0 || globalVar.fryPotThree.InputMaterialRollerRunningSingle == 0)
{
Thread.Sleep(5); if (globalVar.ExitMainTask)
return;
}
MessageLog.GetInstance.Show($"炒锅【3】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}已到进料位置,准备倒料"); break;
MessageLog.GetInstance.ShowRunLog($"炒锅【3】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}已到进料位置,准备倒料"); break;
case 4:
while (globalVar.fryPotFour.InputMaterialArrivedSingle == 0 || globalVar.fryPotFour.InputMaterialRollerRunningSingle == 0)
{
Thread.Sleep(5); if (globalVar.ExitMainTask)
return;
}
MessageLog.GetInstance.Show($"炒锅【4】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}已到进料位置,准备倒料"); break;
MessageLog.GetInstance.ShowRunLog($"炒锅【4】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}已到进料位置,准备倒料"); break;
case 5:
while (globalVar.fryPotFive.InputMaterialArrivedSingle == 0 || globalVar.fryPotFive.InputMaterialRollerRunningSingle == 0)
{
Thread.Sleep(5); if (globalVar.ExitMainTask)
return;
}
MessageLog.GetInstance.Show($"炒锅【5】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}已到进料位置,准备倒料"); break;
MessageLog.GetInstance.ShowRunLog($"炒锅【5】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}已到进料位置,准备倒料"); break;
}

}
@@ -423,19 +432,19 @@ namespace FryPot_DosingSystem.Control
{
case 1: while (globalVar.fryPotOne.EmptyBarrelArrivedSingle == 0 || globalVar.fryPotOne.EmptyBarrelRollerRunningSingle == 0) { Thread.Sleep(5); if (globalVar.ExitMainTask)
return;
} MessageLog.GetInstance.Show($"炒锅【1】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}空桶到达出桶位置,正在出桶"); break;
} MessageLog.GetInstance.ShowRunLog($"炒锅【1】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}空桶到达出桶位置,正在出桶"); break;
case 2: while (globalVar.fryPotTwo.EmptyBarrelArrivedSingle == 0 || globalVar.fryPotTwo.EmptyBarrelRollerRunningSingle == 0) { Thread.Sleep(5); if (globalVar.ExitMainTask)
return;
} MessageLog.GetInstance.Show($"炒锅【2】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}空桶到达出桶位置,正在出桶"); break;
} MessageLog.GetInstance.ShowRunLog($"炒锅【2】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}空桶到达出桶位置,正在出桶"); break;
case 3: while (globalVar.fryPotThree.EmptyBarrelArrivedSingle == 0 || globalVar.fryPotThree.EmptyBarrelRollerRunningSingle == 0) { Thread.Sleep(5); if (globalVar.ExitMainTask)
return;
} MessageLog.GetInstance.Show($"炒锅【3】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}空桶到达出桶位置,正在出桶"); break;
} MessageLog.GetInstance.ShowRunLog($"炒锅【3】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}空桶到达出桶位置,正在出桶"); break;
case 4: while (globalVar.fryPotFour.EmptyBarrelArrivedSingle == 0 || globalVar.fryPotFour.EmptyBarrelRollerRunningSingle == 0) { Thread.Sleep(5); if (globalVar.ExitMainTask)
return;
} MessageLog.GetInstance.Show($"炒锅【4】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}空桶到达出桶位置,正在出桶"); break;
} MessageLog.GetInstance.ShowRunLog($"炒锅【4】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}空桶到达出桶位置,正在出桶"); break;
case 5: while (globalVar.fryPotFive.EmptyBarrelArrivedSingle == 0 || globalVar.fryPotFive.EmptyBarrelRollerRunningSingle == 0) { Thread.Sleep(5); if (globalVar.ExitMainTask)
return;
} MessageLog.GetInstance.Show($"炒锅【5】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}空桶到达出桶位置,正在出桶"); break;
} MessageLog.GetInstance.ShowRunLog($"炒锅【5】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}空桶到达出桶位置,正在出桶"); break;

}
}
@@ -473,7 +482,7 @@ namespace FryPot_DosingSystem.Control
/// <param name="lineAlarm"></param>
public void AgvFromLineOneToFryPot()
{
erp: if (lineAlarm == 1)//无故障
erp: if (globalVar.rollerLineOne.OutMaterialingTroubleSingle==0)//无故障
{
while (!agvArriveLine)//等待AGV到线体装料位置
{
@@ -498,14 +507,14 @@ namespace FryPot_DosingSystem.Control
}
else//有故障
{
while (lineAlarm == -1)
while (globalVar.rollerLineOne.OutMaterialingTroubleSingle == 1)
{
Thread.Sleep(50);
if (globalVar.ExitMainTask)
return;
}
MessageLog.GetInstance.Show("线体【1】滚筒故障解除,继续运行");
lineAlarm = 1;
MessageLog.GetInstance.ShowRunLog("线体【1】滚筒故障解除,继续运行");
//lineAlarm = 1;
goto erp;
}
}
@@ -515,7 +524,7 @@ namespace FryPot_DosingSystem.Control
/// <param name="lineAlarm"></param>
public void AgvFromLineTwoToFryPot()
{
erp: if (lineAlarm == 1)//无故障
erp: if (globalVar.rollerLineTwo.OutMaterialingTroubleSingle == 0)//无故障
{
while (!agvArriveLine)//等待AGV到线体装料位置
{
@@ -540,14 +549,14 @@ namespace FryPot_DosingSystem.Control
}
else//有故障
{
while (lineAlarm == -1)
while (globalVar.rollerLineTwo.OutMaterialingTroubleSingle == 1)
{
Thread.Sleep(50);
if (globalVar.ExitMainTask)
return;
}
MessageLog.GetInstance.Show("线体【2】滚筒故障解除,继续运行");
lineAlarm = 1;
MessageLog.GetInstance.ShowRunLog("线体【2】滚筒故障解除,继续运行");
// lineAlarm = 1;
goto erp;
}
}
@@ -557,7 +566,7 @@ namespace FryPot_DosingSystem.Control
/// <param name="lineAlarm"></param>
public void AgvFromLineThreeToFryPot()
{
erp: if (lineAlarm == 1)//无故障
erp: if (globalVar.rollerLineThree.OutMaterialingTroubleSingle == 0)//无故障
{
while (!agvArriveLine)//等待AGV到线体装料位置
{
@@ -580,16 +589,16 @@ namespace FryPot_DosingSystem.Control
}

}
else//有故障
else //有故障
{
while (lineAlarm == -1)
while (globalVar.rollerLineThree.OutMaterialingTroubleSingle == 1)
{
Thread.Sleep(50);
if (globalVar.ExitMainTask)
return;
}
MessageLog.GetInstance.Show("线体【3】滚筒故障解除,继续运行");
lineAlarm = 1;
MessageLog.GetInstance.ShowRunLog("线体【3】滚筒故障解除,继续运行");
// lineAlarm = 1;
goto erp;
}
}
@@ -606,16 +615,16 @@ namespace FryPot_DosingSystem.Control
return;
}
AGVHelper.GetInstance.AgvToLineOneLoadRoller();
MessageLog.GetInstance.Show("AGV去1号线体");
MessageLog.GetInstance.ShowRunLog("AGV去1号线体");
globalVar.AllowAgvToLineLoadRoller = false;
}
}
else
{
MessageLog.GetInstance.ShowEx("警告:滚筒输送线体【1】故障!!!");
lineAlarm = -1;
MessageLog.GetInstance.ShowRunLog("警告:滚筒输送线体【1】故障!!!");
// lineAlarm = -1;
}
lineAlarm = 1;
// lineAlarm = 1;
}
public void AgvToLineTwoLoadRoller()
{
@@ -630,17 +639,17 @@ namespace FryPot_DosingSystem.Control
return;
}
AGVHelper.GetInstance.AgvToLineTwoLoadRoller();
MessageLog.GetInstance.Show("AGV去2号线体");
MessageLog.GetInstance.ShowRunLog("AGV去2号线体");
globalVar.AllowAgvToLineLoadRoller = false;
}

}
else
{
MessageLog.GetInstance.ShowEx("警告:滚筒输送线体【2】故障!!!");
lineAlarm = -1;
MessageLog.GetInstance.ShowRunLog("警告:滚筒输送线体【2】故障!!!");
//lineAlarm = -1;
}
lineAlarm = 1;
// lineAlarm = 1;
}
public void AgvToLineThreeLoadRoller()
{
@@ -655,17 +664,17 @@ namespace FryPot_DosingSystem.Control
return;
}
AGVHelper.GetInstance.AgvToLineThreeLoadRoller();
MessageLog.GetInstance.Show("AGV去3号线体");
MessageLog.GetInstance.ShowRunLog("AGV去3号线体");
globalVar.AllowAgvToLineLoadRoller = false;
}

}
else
{
MessageLog.GetInstance.ShowEx("警告:滚筒输送线体【3】故障!!!");
lineAlarm = -1;
MessageLog.GetInstance.ShowRunLog("警告:滚筒输送线体【3】故障!!!");
// lineAlarm = -1;
}
lineAlarm = 1;
// lineAlarm = 1;
}
/// <summary>
/// 1号线体数据下发
@@ -827,35 +836,35 @@ namespace FryPot_DosingSystem.Control
switch (OutputMaterialQuene.ElementAt(0).materialType.MaterialLoc / 100)
{
case 1:
if (globalVar.fryPotOne.RollerTroubleSingle == 1) { FryPotAlarm = -1; MessageLog.GetInstance.ShowEx("警告:炒锅【1】输送滚筒发生故障"); } else { FryPotAlarm = 1; } while (globalVar.fryPotOne.RollerTroubleSingle == 1)
if (globalVar.fryPotOne.RollerTroubleSingle == 1) { FryPotAlarm = -1; MessageLog.GetInstance.ShowRunLog("警告:炒锅【1】输送滚筒发生故障"); } else { FryPotAlarm = 1; } while (globalVar.fryPotOne.RollerTroubleSingle == 1)
{
Thread.Sleep(50); if (globalVar.ExitMainTask)
return;
}
FryPotAlarm = 1; break;
case 2:
if (globalVar.fryPotTwo.RollerTroubleSingle == 1) { FryPotAlarm = -1; MessageLog.GetInstance.ShowEx("警告:炒锅【1】输送滚筒发生故障"); } else { FryPotAlarm = 1; } while (globalVar.fryPotTwo.RollerTroubleSingle == 1)
if (globalVar.fryPotTwo.RollerTroubleSingle == 1) { FryPotAlarm = -1; MessageLog.GetInstance.ShowRunLog("警告:炒锅【1】输送滚筒发生故障"); } else { FryPotAlarm = 1; } while (globalVar.fryPotTwo.RollerTroubleSingle == 1)
{
Thread.Sleep(50); if (globalVar.ExitMainTask)
return;
}
FryPotAlarm = 1; break;
case 3:
if (globalVar.fryPotThree.RollerTroubleSingle == 1) { FryPotAlarm = -1; MessageLog.GetInstance.ShowEx("警告:炒锅【1】输送滚筒发生故障"); } else { FryPotAlarm = 1; } while (globalVar.fryPotThree.RollerTroubleSingle == 1)
if (globalVar.fryPotThree.RollerTroubleSingle == 1) { FryPotAlarm = -1; MessageLog.GetInstance.ShowRunLog("警告:炒锅【1】输送滚筒发生故障"); } else { FryPotAlarm = 1; } while (globalVar.fryPotThree.RollerTroubleSingle == 1)
{
Thread.Sleep(50); if (globalVar.ExitMainTask)
return;
}
FryPotAlarm = 1; break;
case 4:
if (globalVar.fryPotFour.RollerTroubleSingle == 1) { FryPotAlarm = -1; MessageLog.GetInstance.ShowEx("警告:炒锅【1】输送滚筒发生故障"); } else { FryPotAlarm = 1; } while (globalVar.fryPotFour.RollerTroubleSingle == 1)
if (globalVar.fryPotFour.RollerTroubleSingle == 1) { FryPotAlarm = -1; MessageLog.GetInstance.ShowRunLog("警告:炒锅【1】输送滚筒发生故障"); } else { FryPotAlarm = 1; } while (globalVar.fryPotFour.RollerTroubleSingle == 1)
{
Thread.Sleep(50); if (globalVar.ExitMainTask)
return;
}
FryPotAlarm = 1; break;
case 5:
if (globalVar.fryPotFive.RollerTroubleSingle == 1) { FryPotAlarm = -1; MessageLog.GetInstance.ShowEx("警告:炒锅【1】输送滚筒发生故障"); } else { FryPotAlarm = 1; } while (globalVar.fryPotFive.RollerTroubleSingle == 1)
if (globalVar.fryPotFive.RollerTroubleSingle == 1) { FryPotAlarm = -1; MessageLog.GetInstance.ShowRunLog("警告:炒锅【1】输送滚筒发生故障"); } else { FryPotAlarm = 1; } while (globalVar.fryPotFive.RollerTroubleSingle == 1)
{
Thread.Sleep(50); if (globalVar.ExitMainTask)
return;


+ 2
- 2
FryPot_DosingSystem/Helper/HubHelper.cs View File

@@ -19,12 +19,12 @@ namespace FryPot_DosingSystem.Helper
{
hubConnection = new HubConnectionBuilder().WithAutomaticReconnect().WithUrl("http://localhost:5175/personhub").Build();//连接

//AGV搬运任务上报后执行的委托
hubConnection.On<object>("Report", (s) =>
{
//注册接收消息的委托
});
//AGV上下料交互请求执行的委托
hubConnection.On<object>("Upstreamrequest", (s) =>
{
//注册接收消息的委托


+ 1
- 2
FryPot_DosingSystem/Model/RecipeManage.cs View File

@@ -10,8 +10,7 @@ namespace FryPot_DosingSystem.Model
{
internal class RecipeManage:ObservableObject
{
//private static RecipeManage _Instance;
//public static RecipeManage GetInstance=>_Instance ?? (_Instance = new RecipeManage());
public ObservableCollection<NewRecipeModel> Recipes { get; set; }=new ObservableCollection<NewRecipeModel>();
}
}

+ 4
- 3
FryPot_DosingSystem/View/RecipeSetView.xaml View File

@@ -45,7 +45,7 @@
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="20"></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<UniformGrid Columns="2">
@@ -62,7 +62,7 @@
Command="{Binding NewRecipe}">
</pry:IcoButton>
<pry:IcoButton
Content="保存配方" Margin="0,5"
Content="保存配方" Margin="5,5"
Width="150"
FontSize="16"
Foreground="Aqua"
@@ -74,7 +74,8 @@

</StackPanel>
</UniformGrid>
<TextBlock Grid.Row="1" Text="配方信息" Foreground="Aquamarine" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="18" Margin="0,5" ></TextBlock>
<!--<TextBlock Grid.Row="1" Text="配方信息" Foreground="Aquamarine" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="18" Margin="0,5" ></TextBlock>-->
<Line Grid.Row="1" X1="0" Y1="10" X2="1000" Y2="10" Stroke="Aqua"></Line>
<ScrollViewer Grid.Row="2" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
<ItemsControl ItemsSource="{Binding recipeModels}">
<ItemsControl.ItemsPanel>


+ 48
- 1
SmartClient.sln View File

@@ -104,7 +104,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkT_Contai
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.IceMaker", "BPASmartClient.IceMaker\BPASmartClient.IceMaker.csproj", "{F61AC179-156D-4075-BFEB-355862231F48}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.MorkT_BarCounter", "BPASmartClient.MorkT_BarCounter\BPASmartClient.MorkT_BarCounter.csproj", "{048FED78-4BFA-4FCD-8FF2-905E9CA4D7DD}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkT_BarCounter", "BPASmartClient.MorkT_BarCounter\BPASmartClient.MorkT_BarCounter.csproj", "{048FED78-4BFA-4FCD-8FF2-905E9CA4D7DD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.AgvApi", "BPASmartClient.AgvApi\BPASmartClient.AgvApi.csproj", "{4B25A520-DC6B-4272-8839-E6281DD0D7B8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FryPot_DosingSystem", "FryPot_DosingSystem\FryPot_DosingSystem.csproj", "{7AB88042-3150-47C9-AA15-DF326B5F347D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -980,6 +984,46 @@ Global
{048FED78-4BFA-4FCD-8FF2-905E9CA4D7DD}.Release|x64.Build.0 = Release|Any CPU
{048FED78-4BFA-4FCD-8FF2-905E9CA4D7DD}.Release|x86.ActiveCfg = Release|Any CPU
{048FED78-4BFA-4FCD-8FF2-905E9CA4D7DD}.Release|x86.Build.0 = Release|Any CPU
{4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Debug|ARM.ActiveCfg = Debug|Any CPU
{4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Debug|ARM.Build.0 = Debug|Any CPU
{4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Debug|ARM64.Build.0 = Debug|Any CPU
{4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Debug|x64.ActiveCfg = Debug|Any CPU
{4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Debug|x64.Build.0 = Debug|Any CPU
{4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Debug|x86.ActiveCfg = Debug|Any CPU
{4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Debug|x86.Build.0 = Debug|Any CPU
{4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Release|Any CPU.Build.0 = Release|Any CPU
{4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Release|ARM.ActiveCfg = Release|Any CPU
{4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Release|ARM.Build.0 = Release|Any CPU
{4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Release|ARM64.ActiveCfg = Release|Any CPU
{4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Release|ARM64.Build.0 = Release|Any CPU
{4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Release|x64.ActiveCfg = Release|Any CPU
{4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Release|x64.Build.0 = Release|Any CPU
{4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Release|x86.ActiveCfg = Release|Any CPU
{4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Release|x86.Build.0 = Release|Any CPU
{7AB88042-3150-47C9-AA15-DF326B5F347D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7AB88042-3150-47C9-AA15-DF326B5F347D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7AB88042-3150-47C9-AA15-DF326B5F347D}.Debug|ARM.ActiveCfg = Debug|Any CPU
{7AB88042-3150-47C9-AA15-DF326B5F347D}.Debug|ARM.Build.0 = Debug|Any CPU
{7AB88042-3150-47C9-AA15-DF326B5F347D}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{7AB88042-3150-47C9-AA15-DF326B5F347D}.Debug|ARM64.Build.0 = Debug|Any CPU
{7AB88042-3150-47C9-AA15-DF326B5F347D}.Debug|x64.ActiveCfg = Debug|Any CPU
{7AB88042-3150-47C9-AA15-DF326B5F347D}.Debug|x64.Build.0 = Debug|Any CPU
{7AB88042-3150-47C9-AA15-DF326B5F347D}.Debug|x86.ActiveCfg = Debug|Any CPU
{7AB88042-3150-47C9-AA15-DF326B5F347D}.Debug|x86.Build.0 = Debug|Any CPU
{7AB88042-3150-47C9-AA15-DF326B5F347D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7AB88042-3150-47C9-AA15-DF326B5F347D}.Release|Any CPU.Build.0 = Release|Any CPU
{7AB88042-3150-47C9-AA15-DF326B5F347D}.Release|ARM.ActiveCfg = Release|Any CPU
{7AB88042-3150-47C9-AA15-DF326B5F347D}.Release|ARM.Build.0 = Release|Any CPU
{7AB88042-3150-47C9-AA15-DF326B5F347D}.Release|ARM64.ActiveCfg = Release|Any CPU
{7AB88042-3150-47C9-AA15-DF326B5F347D}.Release|ARM64.Build.0 = Release|Any CPU
{7AB88042-3150-47C9-AA15-DF326B5F347D}.Release|x64.ActiveCfg = Release|Any CPU
{7AB88042-3150-47C9-AA15-DF326B5F347D}.Release|x64.Build.0 = Release|Any CPU
{7AB88042-3150-47C9-AA15-DF326B5F347D}.Release|x86.ActiveCfg = Release|Any CPU
{7AB88042-3150-47C9-AA15-DF326B5F347D}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -993,6 +1037,7 @@ Global
{2344EB60-1760-4DF0-961A-FA5BE5BC47CC} = {3D1D0E04-03FD-480A-8CF8-6E01A2E28625}
{202763AA-4C4C-4738-B530-93A9A1ECE578} = {3D1D0E04-03FD-480A-8CF8-6E01A2E28625}
{13C86146-CD3C-4CD3-AB7F-7A155E222832} = {3D1D0E04-03FD-480A-8CF8-6E01A2E28625}
{9FB27073-61A0-4FE3-94DB-5FDDE062332F} = {666CB1A9-562E-453A-A2C7-FD9D77CFDFDD}
{0827FA85-8180-4A85-BE58-9483AC4BB3BA} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F}
{8878BCFD-AC5E-4D84-8C63-CA99DDE036EE} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F}
{B399BCFF-82E8-4940-9CE5-B7DCDDFDC696} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F}
@@ -1028,6 +1073,8 @@ Global
{3653724D-3683-4722-B978-EB88DD4AE5DB} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F}
{F61AC179-156D-4075-BFEB-355862231F48} = {666CB1A9-562E-453A-A2C7-FD9D77CFDFDD}
{048FED78-4BFA-4FCD-8FF2-905E9CA4D7DD} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F}
{4B25A520-DC6B-4272-8839-E6281DD0D7B8} = {8712125E-14CD-4E1B-A1CE-4BDE03805942}
{7AB88042-3150-47C9-AA15-DF326B5F347D} = {8712125E-14CD-4E1B-A1CE-4BDE03805942}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9AEC9B81-0222-4DE9-B642-D915C29222AC}


Loading…
Cancel
Save