Kaynağa Gözat

通知消息修改

master
pry 1 yıl önce
ebeveyn
işleme
34e8b213a6
54 değiştirilmiş dosya ile 714 ekleme ve 323 silme
  1. +35
    -0
      BPASmartClient.CustomResource/Converters/ForegroundConverter.cs
  2. +48
    -0
      BPASmartClient.CustomResource/Converters/StatusIconConverter.cs
  3. +15
    -0
      BPASmartClient.CustomResource/Pages/Enums/Status.cs
  4. +4
    -4
      BPASmartClient.CustomResource/Pages/Model/MessageNotify.cs
  5. +2
    -2
      BPASmartClient.CustomResource/Pages/ViewModel/NfcSetViewModel.cs
  6. +1
    -1
      BPASmartClient.CustomResource/Pages/ViewModel/RunLogViewModel.cs
  7. +1
    -1
      BPASmartClient.CustomResource/Pages/ViewModel/UserLogViewModel.cs
  8. +128
    -0
      BPASmartClient.CustomResource/RecDictionarys/GlobalStyle.xaml
  9. +2
    -2
      BPASmartClient.DosingProject/App.xaml.cs
  10. +12
    -12
      BPASmartClient.DosingProject/Model/ProcessControl.cs
  11. +9
    -9
      BPASmartClient.DosingProject/Model/RawMaterial/DeviceInquire.cs
  12. +2
    -2
      BPASmartClient.DosingProject/ViewModel/NewMaterialViewModel.cs
  13. +3
    -3
      BPASmartClient.DosingProject/ViewModel/RecipeControlViewModel.cs
  14. +3
    -3
      BPASmartClient.DosingProject/ViewModel/RecipeReceiveViewModel.cs
  15. +4
    -4
      BPASmartClient.DosingProject/ViewModel/RecipeSettingsViewModel.cs
  16. +1
    -1
      BPASmartClient.DosingProject/ViewModel/SiemensRecipeReceiveViewModel.cs
  17. +2
    -2
      BPASmartClient.JXJFoodBigStation/App.xaml.cs
  18. +2
    -2
      BPASmartClient.JXJFoodBigStation/Model/HK_PLC/HKDeviceStatus.cs
  19. +4
    -4
      BPASmartClient.JXJFoodBigStation/Model/ProcessControl.cs
  20. +1
    -1
      BPASmartClient.JXJFoodBigStation/ViewModel/RecipeReceiveViewModel.cs
  21. +2
    -2
      BPASmartClient.JXJFoodSmallStation/App.xaml.cs
  22. +8
    -8
      BPASmartClient.JXJFoodSmallStation/Model/HK_PLC/HKDeviceStatus.cs
  23. +38
    -38
      BPASmartClient.JXJFoodSmallStation/Model/ProcessControl.cs
  24. +5
    -5
      BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/DeviceInquire.cs
  25. +2
    -2
      BPASmartClient.JXJFoodSmallStation/ViewModel/NewMaterialViewModel.cs
  26. +3
    -3
      BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeControlViewModel.cs
  27. +3
    -3
      BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeReceiveViewModel.cs
  28. +4
    -4
      BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeSettingsViewModel.cs
  29. +1
    -1
      BPASmartClient.JXJFoodSmallStation/ViewModel/SiemensRecipeReceiveViewModel.cs
  30. +2
    -2
      BPASmartClient.SmallBatchingSystem/Services/Control.cs
  31. +1
    -1
      BPASmartClient.ZhuoDian/App.xaml.cs
  32. +11
    -4
      DosingSystem/App.xaml.cs
  33. +4
    -1
      DosingSystem/BPASmartClient.DosingSystem.csproj
  34. +15
    -10
      DosingSystem/Model/DeviceInquire.cs
  35. +0
    -15
      DosingSystem/Model/DevicePar.cs
  36. +44
    -0
      DosingSystem/Model/par/DevicePar.cs
  37. +0
    -0
      DosingSystem/Model/par/DeviceParModel.cs
  38. +0
    -0
      DosingSystem/Model/par/LocaPar.cs
  39. +45
    -0
      DosingSystem/View/CommParSetView.xaml
  40. +28
    -0
      DosingSystem/View/CommParSetView.xaml.cs
  41. +1
    -2
      DosingSystem/ViewModel/ChangeDeviceNameViewModel.cs
  42. +48
    -0
      DosingSystem/ViewModel/CommparSetViewModel.cs
  43. +1
    -1
      DosingSystem/ViewModel/DeviceListViewModel.cs
  44. +1
    -2
      DosingSystem/ViewModel/DeviceMaterialParViewModel.cs
  45. +1
    -1
      DosingSystem/ViewModel/HardwareStatusViewModel.cs
  46. +6
    -2
      DosingSystem/ViewModel/ManualControlViewModel.cs
  47. +3
    -4
      DosingSystem/ViewModel/NewMaterialViewModel.cs
  48. +1
    -1
      DosingSystem/ViewModel/NewRecipeViewModel.cs
  49. +4
    -5
      DosingSystem/ViewModel/RecipeControlViewModel.cs
  50. +5
    -5
      DosingSystem/ViewModel/RecipeSettingsViewModel.cs
  51. +2
    -2
      FryPot_DosingSystem/App.xaml.cs
  52. +15
    -15
      FryPot_DosingSystem/Control/DeviceOperate.cs
  53. +122
    -122
      FryPot_DosingSystem/Control/DosingLogicControl.cs
  54. +9
    -9
      FryPot_DosingSystem/ViewModel/NewRecipeViewModel.cs

+ 35
- 0
BPASmartClient.CustomResource/Converters/ForegroundConverter.cs Dosyayı Görüntüle

@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Windows.Data;
using System.Globalization;
using System.Windows.Media;

namespace BPASmartClient.CustomResource.Converters
{
public class ForegroundConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
SolidColorBrush returnValue = new SolidColorBrush(Color.FromArgb(255, 0, 204, 255));
if (value != null)
{
if (value.ToString() == "等待配料")
returnValue = new SolidColorBrush(Color.FromArgb(255, 236, 187, 17));//黄 FFECBB11
else if (value.ToString() == "正在配料")
returnValue = new SolidColorBrush(Color.FromArgb(255, 22, 219, 234));//篮 FF16DBEA
else if (value.ToString() == "配料完成")
returnValue = new SolidColorBrush(Color.FromArgb(255, 43, 208, 111));//绿 FF2BD06F
}
return returnValue;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

+ 48
- 0
BPASmartClient.CustomResource/Converters/StatusIconConverter.cs Dosyayı Görüntüle

@@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Windows.Data;
using System.Globalization;
using System.Text.RegularExpressions;
using BPASmartClient.CustomResource.Pages.Enums;

namespace BPASmartClient.CustomResource.Converters
{
public class StatusIconConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value != null)
{
if (value.ToString() == Status.等待配料.ToString())
return Regex.Unescape(StringToUnicode(""));
else if (value.ToString() == Status.正在配料.ToString())
return Regex.Unescape(StringToUnicode(""));
else if (value.ToString() == Status.配料完成.ToString())
return Regex.Unescape(StringToUnicode(""));
}
return value;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}

/// <summary>
/// 字符串转为UniCode码字符串
/// </summary>
public static string StringToUnicode(string s)
{
if (!string.IsNullOrEmpty(s))
{
//这里把格式&#xe625; 转为 \ue625
return s.Replace(@"&#x", @"\u").Replace(";", "");
}
return s;
}
}
}

+ 15
- 0
BPASmartClient.CustomResource/Pages/Enums/Status.cs Dosyayı Görüntüle

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.CustomResource.Pages.Enums
{
public enum Status
{
等待配料,
正在配料,
配料完成
}
}

BPASmartClient.CustomResource/Pages/Model/MessageLog.cs → BPASmartClient.CustomResource/Pages/Model/MessageNotify.cs Dosyayı Görüntüle

@@ -12,15 +12,15 @@ using BPASmartClient.CustomResource.Pages.View;

namespace BPASmartClient.CustomResource.Pages.Model
{
public class MessageLog
public class MessageNotify
{
private volatile static MessageLog _Instance;
public static MessageLog GetInstance => _Instance ??= new MessageLog();
private volatile static MessageNotify _Instance;
public static MessageNotify GetInstance => _Instance ??= new MessageNotify();

public static readonly object runLock = new object();
public static readonly object userlock = new object();
public static readonly object alarmlock = new object();
private MessageLog() { }
private MessageNotify() { }

public Action<string> UserLog { get; set; }


+ 2
- 2
BPASmartClient.CustomResource/Pages/ViewModel/NfcSetViewModel.cs Dosyayı Görüntüle

@@ -75,7 +75,7 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
});
Config.GetInstance.SaveUser();
Info = $"Info:ID {CardNum} 添加成功;";
MessageLog.GetInstance.ShowRunLog($" ID {CardNum} 用户添加成功");
MessageNotify.GetInstance.ShowRunLog($" ID {CardNum} 用户添加成功");
Thread.Sleep(1000);
ActionManage.GetInstance.Send("Exit");
}
@@ -96,7 +96,7 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
Global.userManager.userInfos.Remove(res);
Config.GetInstance.SaveUser();
Info = $"Info:ID {CardNum} 注销成功;";
MessageLog.GetInstance.ShowRunLog($"ID {CardNum} 用户注销成功");
MessageNotify.GetInstance.ShowRunLog($"ID {CardNum} 用户注销成功");
Thread.Sleep(1000);
ActionManage.GetInstance.Send("Exit");
}


+ 1
- 1
BPASmartClient.CustomResource/Pages/ViewModel/RunLogViewModel.cs Dosyayı Görüntüle

@@ -121,6 +121,6 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel

public ObservableCollection<RunLog> HistoryRunLog { get; set; } = new ObservableCollection<RunLog>();

public ObservableCollection<RunLog> Log { get; set; } = MessageLog.GetInstance.runLogs;
public ObservableCollection<RunLog> Log { get; set; } = MessageNotify.GetInstance.runLogs;
}
}

+ 1
- 1
BPASmartClient.CustomResource/Pages/ViewModel/UserLogViewModel.cs Dosyayı Görüntüle

@@ -17,7 +17,7 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
public UserLogViewModel()
{
Sqlite<UserLog>.GetInstance.Save();
UserLogs = MessageLog.GetInstance.userLogs;
UserLogs = MessageNotify.GetInstance.userLogs;
SwitchCommand = new RelayCommand(() =>
{
if (ButContent == "历史日志")


+ 128
- 0
BPASmartClient.CustomResource/RecDictionarys/GlobalStyle.xaml Dosyayı Görüntüle

@@ -15,4 +15,132 @@
<SolidColorBrush x:Key="BorderSolid" Color="#5523CACA" />



<!--#region 颜色资源-->
<SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" />
<SolidColorBrush x:Key="tabColor" Color="#FF2AB2E7" />
<SolidColorBrush x:Key="bordColor" Color="#332AB2E7" />
<!--#endregion-->

<!--#region 值转换器-->
<con:DataTableRedundantConverter x:Key="tabConvert" />
<con:StatusIconConverter x:Key="StatusIconConverter" />
<con:ForegroundConverter x:Key="ForegroundConverter" />
<!--#endregion-->

<Style x:Key="TextBlockStyle" TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="Foreground" Value="{StaticResource FontColor}" />
<Setter Property="FontSize" Value="20" />
</Style>

<Style x:Key="TextBoxStyle" TargetType="TextBox">
<Setter Property="FontFamily" Value="楷体" />
<Setter Property="FontSize" Value="22" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Width" Value="188" />
<Setter Property="Padding" Value="6,0,0,0" />
<Setter Property="Height" Value="37" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Foreground" Value="#009dff" />
<Setter Property="BorderBrush" Value="#009dff" />
<Setter Property="CaretBrush" Value="#009dff" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/textBox.png" Stretch="Fill" />
</Setter.Value>
</Setter>
</Style>

<Style x:Key="InputTextboxStyle" TargetType="TextBox">
<Setter Property="Margin" Value="5,0,0,0" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="Width" Value="150" />
<Setter Property="Height" Value="40" />
<Setter Property="CaretBrush" Value="{StaticResource TitleBorderColor}" />
<Setter Property="Foreground" Value="{StaticResource TitleBorderColor}" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="FontSize" Value="14" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>

<Style x:Key="ControlButtonStyle" TargetType="Button">
<Setter Property="Margin" Value="0" />
<Setter Property="FontSize" Value="18" />
<Setter Property="Foreground" Value="#FFF53F62" />
<Setter Property="FontWeight" Value="SemiBold" />
<Setter Property="FontFamily" Value="楷体" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border
Name="TitleBarBr"
BorderBrush="#00c2f4"
BorderThickness="0"
CornerRadius="0"
Opacity="0.8">

<ContentPresenter
Margin="{TemplateBinding Margin}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
<Border.Background>
<ImageBrush
ImageSource="/BPASmartClient.CustomResource;component/Image/组合边框1.1.png"
Opacity="0.8"
Stretch="Fill" />
</Border.Background>

</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="TitleBarBr" Property="Opacity" Value="1" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<Style x:Key="TitleTextblockStyle" TargetType="TextBlock">
<Setter Property="FontSize" Value="16" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Foreground" Value="{StaticResource tabColor}" />
<Setter Property="FontFamily" Value="楷体" />
<Setter Property="FontWeight" Value="SemiBold" />
</Style>

<Style x:Key="UserItemContainerStyle" TargetType="ListBoxItem">
<Style.Resources>
<!-- SelectedItem with focus -->
<SolidColorBrush
x:Key="{x:Static SystemColors.HighlightBrushKey}"
Opacity=".4"
Color="White" />
<!-- SelectedItem without focus -->
<SolidColorBrush
x:Key="{x:Static SystemColors.ControlBrushKey}"
Opacity=".4"
Color="White" />
</Style.Resources>
<!-- 设置触发器 -->
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" Value="White" />
<Setter Property="Foreground" Value="White" />
</Trigger>
<Trigger Property="IsFocused" Value="true">
<Setter Property="Background" Value="White" />
<Setter Property="Foreground" Value="White" />
</Trigger>
</Style.Triggers>
</Style>


</ResourceDictionary>

+ 2
- 2
BPASmartClient.DosingProject/App.xaml.cs Dosyayı Görüntüle

@@ -32,7 +32,7 @@ namespace BPASmartClient.DosingProject
var res = lv.ShowDialog();
if (res != null && res == true)
{
MessageLog.GetInstance.ShowUserLog("用户登录");
MessageNotify.GetInstance.ShowUserLog("用户登录");
mv.Show();
}
else
@@ -44,7 +44,7 @@ namespace BPASmartClient.DosingProject
{
base.OnExit(e);
Json<LocaPar>.Save();
MessageLog.GetInstance.LogSave();
MessageNotify.GetInstance.LogSave();
ThreadManage.GetInstance().Dispose();
}



+ 12
- 12
BPASmartClient.DosingProject/Model/ProcessControl.cs Dosyayı Görüntüle

@@ -56,7 +56,7 @@ namespace BPASmartClient.DosingHKProject.Model
if (HKDevice.IsConnected)
{
HKDevice.Init();
MessageLog.GetInstance.ShowUserLog("海科plc连接成功,并初始化完成");
MessageNotify.GetInstance.ShowUserLog("海科plc连接成功,并初始化完成");
}
}
catch(Exception ex)
@@ -346,7 +346,7 @@ namespace BPASmartClient.DosingHKProject.Model
{
HKDevice.HK_PLC_S7.Write<bool>("DB2.DBX3.0", false);
HKDevice.HK_PLC_S7.Write<bool>("DB2.DBX3.1", false);
MessageLog.GetInstance.ShowRunLog($"下料桶堵料,线体不运行");
MessageNotify.GetInstance.ShowRunLog($"下料桶堵料,线体不运行");
cnt_sensor8++;
}
else
@@ -437,7 +437,7 @@ namespace BPASmartClient.DosingHKProject.Model
if (GVL_SmallStation.GetInstance.AllowDosing_Pos[0])
{
int res = 1;
MessageLog.GetInstance.ShowRunLog($"配方:{recipeName},1号桶,{res}料仓,允许配料");
MessageNotify.GetInstance.ShowRunLog($"配方:{recipeName},1号桶,{res}料仓,允许配料");
if (res > 0 )
{
int loc_index = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == res);
@@ -448,13 +448,13 @@ namespace BPASmartClient.DosingHKProject.Model
GVL_SmallStation.GetInstance.StockInIsWork = (int)res;
}
GVL_SmallStation.GetInstance.DosingTray1 = true;
MessageLog.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},1号桶,{(int)res}号仓,配料完成");
MessageNotify.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},1号桶,{(int)res}号仓,配料完成");
}
}
else if(RTrig.GetInstance("DB3.DBX50.1").Start(HKDevice.HK_PLC_S7.Read<bool>("DB3.DBX50.1")))
{
var res = HKDevice.HK_PLC_S7.Read<float>("DB3.DBD14");
MessageLog.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},2号桶,{res}料仓,允许配料");
MessageNotify.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},2号桶,{res}料仓,允许配料");
if (res > 0 && res is float loc)
{
int loc_index = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == loc);
@@ -465,13 +465,13 @@ namespace BPASmartClient.DosingHKProject.Model
GVL_SmallStation.GetInstance.StockInIsWork = (int)loc;
}
GVL_SmallStation.GetInstance.DosingTray1 = true;
MessageLog.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},2号桶,{(int)loc}号仓,配料完成");
MessageNotify.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},2号桶,{(int)loc}号仓,配料完成");
}
}
else if (RTrig.GetInstance("DB3.DBX50.2").Start(HKDevice.HK_PLC_S7.Read<bool>("DB3.DBX50.2")))
{
var res = HKDevice.HK_PLC_S7.Read<float>("DB3.DBD18");
MessageLog.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},3号桶,{res}料仓,允许配料");
MessageNotify.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},3号桶,{res}料仓,允许配料");
if (res > 0 && res is float loc)
{
int loc_index = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == loc);
@@ -482,13 +482,13 @@ namespace BPASmartClient.DosingHKProject.Model
GVL_SmallStation.GetInstance.StockInIsWork = (int)loc;
}
GVL_SmallStation.GetInstance.DosingTray1 = true;
MessageLog.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},3号桶,{(int)loc}号仓,配料完成");
MessageNotify.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},3号桶,{(int)loc}号仓,配料完成");
}
}
else if (RTrig.GetInstance("DB3.DBX50.3").Start(HKDevice.HK_PLC_S7.Read<bool>("DB3.DBX50.3")))
{
var res = HKDevice.HK_PLC_S7.Read<float>("DB3.DBD22");
MessageLog.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},4号桶,{res}料仓,允许配料");
MessageNotify.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},4号桶,{res}料仓,允许配料");
if (res > 0 && res is float loc)
{
int loc_index = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == loc);
@@ -499,7 +499,7 @@ namespace BPASmartClient.DosingHKProject.Model
GVL_SmallStation.GetInstance.StockInIsWork = (int)loc;
}
GVL_SmallStation.GetInstance.DosingTray1 = true;
MessageLog.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},4号桶,{(int)loc}号仓,配料完成");
MessageNotify.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},4号桶,{(int)loc}号仓,配料完成");
}
}
if (GVL_SmallStation.GetInstance.DosingTray1)
@@ -508,7 +508,7 @@ namespace BPASmartClient.DosingHKProject.Model
{
if (RTrig.GetInstance("GetDeviceRunStatus").Start(DeviceInquire.GetInstance.GetDevice(i).deviceStatus.RunStatus == 3))
{
MessageLog.GetInstance.ShowRunLog($"柔性味魔方,托盘1,配方:{recipeName},{i}号仓,配料完成");
MessageNotify.GetInstance.ShowRunLog($"柔性味魔方,托盘1,配方:{recipeName},{i}号仓,配料完成");
int res = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == i);
RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(res).Laying_Off_Weight = DeviceInquire.GetInstance.GetDevice(i).deviceStatus.CutWeightFeedback;
DeviceInquire.GetInstance.GetDevice(i).StatusReset();
@@ -527,7 +527,7 @@ namespace BPASmartClient.DosingHKProject.Model
if (RTrig.GetInstance("配方配料完成").Start(HKDevice.HK_PLC_S7.Read<bool>("DB3.DBX1.1")) && (GVL_SmallStation.GetInstance.WindSendDosingFinish || !GVL_SmallStation.GetInstance.IsUseWindSend))
{
var res = Json<RemoteRecipeDataColl>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == code);
MessageLog.GetInstance.ShowRunLog($"托盘1,配方{res.RecipeName},配料完成");
MessageNotify.GetInstance.ShowRunLog($"托盘1,配方{res.RecipeName},配料完成");
App.Current.Dispatcher.Invoke(() =>
{
Json<RemoteRecipeDataColl>.Data.Recipes.Remove(res);


+ 9
- 9
BPASmartClient.DosingProject/Model/RawMaterial/DeviceInquire.cs Dosyayı Görüntüle

@@ -307,13 +307,13 @@ namespace BPASmartClient.DosingHKProject.Model
deviceStatus.DeviceNum = (ushort)this.modbusTcp.ReadShort(DeviceAddress.DeviceNum);//获取设备编号
deviceStatus.DeviceAlarmCode = (ushort)this.modbusTcp.ReadShort(DeviceAddress.DeviceAlarmCode);//获取设备故障编码

AlarmHelper<AlarmInfo>.Alarm.EStop1 = deviceStatus.DeviceAlarmCode.Get16bitValue(1);
AlarmHelper<AlarmInfo>.Alarm.Servo = deviceStatus.DeviceAlarmCode.Get16bitValue(2);
AlarmHelper<AlarmInfo>.Alarm.Inverter = deviceStatus.DeviceAlarmCode.Get16bitValue(3);
AlarmHelper<AlarmInfo>.Alarm.EStop2 = deviceStatus.DeviceAlarmCode.Get16bitValue(7);
AlarmHelper<AlarmInfo>.Alarm.SiloUpperLimit = deviceStatus.DeviceAlarmCode.Get16bitValue(8);
AlarmHelper<AlarmInfo>.Alarm.SiloLowerLimit = deviceStatus.DeviceAlarmCode.Get16bitValue(9);
AlarmHelper<AlarmInfo>.Alarm.EStop1 = true;
AlarmHelper<AlarmInfo>.GetInstance(DeviceName).EStop1 = deviceStatus.DeviceAlarmCode.Get16bitValue(1);
AlarmHelper<AlarmInfo>.GetInstance(DeviceName).Servo = deviceStatus.DeviceAlarmCode.Get16bitValue(2);
AlarmHelper<AlarmInfo>.GetInstance(DeviceName).Inverter = deviceStatus.DeviceAlarmCode.Get16bitValue(3);
AlarmHelper<AlarmInfo>.GetInstance(DeviceName).EStop2 = deviceStatus.DeviceAlarmCode.Get16bitValue(7);
AlarmHelper<AlarmInfo>.GetInstance(DeviceName).SiloUpperLimit = deviceStatus.DeviceAlarmCode.Get16bitValue(8);
AlarmHelper<AlarmInfo>.GetInstance(DeviceName).SiloLowerLimit = deviceStatus.DeviceAlarmCode.Get16bitValue(9);
AlarmHelper<AlarmInfo>.GetInstance(DeviceName).EStop1 = true;
Thread.Sleep(10);
}), $"{DeviceName} 开始监听", true);
}
@@ -342,7 +342,7 @@ namespace BPASmartClient.DosingHKProject.Model
{
modbusTcp.SetReal(DeviceAddress.WeightSet, Value);//写入配方量
modbusTcp.Write(DeviceAddress.Start, (ushort)1);//设备启动写入
MessageLog.GetInstance.ShowRunLog($"开始配料");
MessageNotify.GetInstance.ShowRunLog($"开始配料");
//配料设备参数写入
var res = Json<DevicePar>.Data.deviceParModels.FirstOrDefault(p => p.MaterialName == DeviceName);
if (res != null)
@@ -355,7 +355,7 @@ namespace BPASmartClient.DosingHKProject.Model
modbusTcp.SetUint(DeviceAddress.SiloUpperLimitWeight, (uint)res.SiloUpperLimitWeight);
modbusTcp.SetUint(DeviceAddress.LowerLimitWeightOfSilo, (uint)res.LowerLimitWeightOfSilo);
modbusTcp.SetUint(DeviceAddress.StirringSpeed, (uint)res.StirringSpeed * 100);
MessageLog.GetInstance.ShowRunLog($"参数下发完成");
MessageNotify.GetInstance.ShowRunLog($"参数下发完成");
}
}
}


+ 2
- 2
BPASmartClient.DosingProject/ViewModel/NewMaterialViewModel.cs Dosyayı Görüntüle

@@ -37,7 +37,7 @@ public class NewMaterialViewModel:ObservableObject
var res = Materials.FirstOrDefault(p=>p.RawMaterialId == id);
Materials.Remove(res);
Json<LocaMaterial>.Save();
MessageLog.GetInstance.ShowUserLog($"删除原料--{res.RawMaterialName}");
MessageNotify.GetInstance.ShowUserLog($"删除原料--{res.RawMaterialName}");
}
}

@@ -52,7 +52,7 @@ public class NewMaterialViewModel:ObservableObject
if(Json<LocaMaterial>.Data.LocalMaterails.FirstOrDefault(p=>p.RawMaterialName == MaterialName) != null) { ErrorInfo = "本地原料名称重复";return ;}
Json<LocaMaterial>.Data.LocalMaterails.Add(new RawMaterialModel { RawMaterialName = MaterialName, RawMaterialId = Guid.NewGuid().ToString() , RawMaterialSource = 0 });
Json<LocaMaterial>.Save();
MessageLog.GetInstance.ShowUserLog($"添加原料--{MaterialName}");
MessageNotify.GetInstance.ShowUserLog($"添加原料--{MaterialName}");
});
}
}

+ 3
- 3
BPASmartClient.DosingProject/ViewModel/RecipeControlViewModel.cs Dosyayı Görüntüle

@@ -35,7 +35,7 @@ namespace BPASmartClient.DosingHKProject.ViewModel
{
Recipes.ElementAt(index).IsEnable = false;
}
MessageLog.GetInstance.ShowUserLog($"下发工单 { Recipes.ElementAt(index).RecipeName}");
MessageNotify.GetInstance.ShowUserLog($"下发工单 { Recipes.ElementAt(index).RecipeName}");
devices.Enqueue(deviceName);
var res = Recipes.FirstOrDefault(p => p.RecipeName == deviceName);
UserTreeWait.Add(new RecipeModel { RecipeName = deviceName, RawMaterials = res.RawMaterials });
@@ -43,7 +43,7 @@ namespace BPASmartClient.DosingHKProject.ViewModel


NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"配方下发成功!");
MessageLog.GetInstance.ShowUserLog($"下发工单 {Guid.NewGuid().ToString()}");
MessageNotify.GetInstance.ShowUserLog($"下发工单 {Guid.NewGuid().ToString()}");
});

ChangeRecipeStateCommand = new RelayCommand<object>(ChangeRecipeState);
@@ -128,7 +128,7 @@ namespace BPASmartClient.DosingHKProject.ViewModel
for (int n = 0; n < recipeProcesses.Count; n++)
{
DeviceInquire.GetInstance.GetDevice(Recipes.ElementAt(recipIndex).RawMaterials.ElementAt(n).DeviceIp).StatusReset();//完成配料的设备运行状态地址写0
MessageLog.GetInstance.ShowRunLog(Recipes.ElementAt(recipIndex).RawMaterials.ElementAt(n).DeviceIp);
MessageNotify.GetInstance.ShowRunLog(Recipes.ElementAt(recipIndex).RawMaterials.ElementAt(n).DeviceIp);
}
App.Current.Dispatcher.Invoke(new Action(() => { recipeProcesses.Clear(); }));
Recipes.ElementAt(recipIndex).IsEnable = true;


+ 3
- 3
BPASmartClient.DosingProject/ViewModel/RecipeReceiveViewModel.cs Dosyayı Görüntüle

@@ -43,7 +43,7 @@ namespace BPASmartClient.DosingHKProject.ViewModel
if (res != null)
{
Json<LocalRecipeDataColl>.Data.Recipes.Remove(res);
MessageLog.GetInstance.ShowUserLog($"删除配方——{res.RecipeName}");
MessageNotify.GetInstance.ShowUserLog($"删除配方——{res.RecipeName}");
}
}
});
@@ -58,7 +58,7 @@ namespace BPASmartClient.DosingHKProject.ViewModel
{
ActionManage.GetInstance.Send("LocalRecipeEdit", res);
nrv.Show();
MessageLog.GetInstance.ShowUserLog($"编辑配方——{res.RecipeName}");
MessageNotify.GetInstance.ShowUserLog($"编辑配方——{res.RecipeName}");
}
}
});
@@ -70,7 +70,7 @@ namespace BPASmartClient.DosingHKProject.ViewModel
if (res != null)
{
Json<RemoteRecipeDataColl>.Data.Recipes.Add(res);
MessageLog.GetInstance.ShowUserLog($"下发配方——{res.RecipeName}");
MessageNotify.GetInstance.ShowUserLog($"下发配方——{res.RecipeName}");
}
}
});


+ 4
- 4
BPASmartClient.DosingProject/ViewModel/RecipeSettingsViewModel.cs Dosyayı Görüntüle

@@ -37,12 +37,12 @@ namespace BPASmartClient.DosingHKProject.ViewModel
{
NewRecipeView nrv = new NewRecipeView();
nrv.ShowDialog();
MessageLog.GetInstance.ShowUserLog("新建配方");
MessageNotify.GetInstance.ShowUserLog("新建配方");
});
SaveRecipe = new RelayCommand(() =>
{
Json<LocaPar>.Save();
MessageLog.GetInstance.ShowUserLog("保存配方");
MessageNotify.GetInstance.ShowUserLog("保存配方");
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"配方保存成功!");
});
RemoveCommand = new RelayCommand<object>((o) =>
@@ -51,7 +51,7 @@ namespace BPASmartClient.DosingHKProject.ViewModel
{
var res = Json<LocaPar>.Data.Recipes.FirstOrDefault(p => p.RecipCode == str);
if (res != null) Json<LocaPar>.Data.Recipes.Remove(res);
MessageLog.GetInstance.ShowUserLog($"删除名称——{res.RecipeName}");
MessageNotify.GetInstance.ShowUserLog($"删除名称——{res.RecipeName}");
}
});

@@ -64,7 +64,7 @@ namespace BPASmartClient.DosingHKProject.ViewModel
var res = Json<LocaPar>.Data.Recipes.FirstOrDefault(p => p.RecipCode == str);
ActionManage.GetInstance.Send("Details", res);
nrv.ShowDialog();
MessageLog.GetInstance.ShowUserLog($"编辑配方名称——{res.RecipeName}");
MessageNotify.GetInstance.ShowUserLog($"编辑配方名称——{res.RecipeName}");
}
});



+ 1
- 1
BPASmartClient.DosingProject/ViewModel/SiemensRecipeReceiveViewModel.cs Dosyayı Görüntüle

@@ -40,7 +40,7 @@ namespace BPASmartClient.DosingHKProject.ViewModel
{
ActionManage.GetInstance.Send("RecipeInfo", res);
nrv.Show();
MessageLog.GetInstance.ShowUserLog($"查看配方——{res.RecipeName}");
MessageNotify.GetInstance.ShowUserLog($"查看配方——{res.RecipeName}");
}
}
});


+ 2
- 2
BPASmartClient.JXJFoodBigStation/App.xaml.cs Dosyayı Görüntüle

@@ -34,7 +34,7 @@ namespace BPASmartClient.JXJFoodBigStation
var res = lv.ShowDialog();
if (res != null && res == true)
{
MessageLog.GetInstance.ShowUserLog("用户登录");
MessageNotify.GetInstance.ShowUserLog("用户登录");
mv.Show();
}
else
@@ -45,7 +45,7 @@ namespace BPASmartClient.JXJFoodBigStation
protected override void OnExit(ExitEventArgs e)
{
base.OnExit(e);
MessageLog.GetInstance.LogSave();
MessageNotify.GetInstance.LogSave();
ThreadManage.GetInstance().Dispose();
}



+ 2
- 2
BPASmartClient.JXJFoodBigStation/Model/HK_PLC/HKDeviceStatus.cs Dosyayı Görüntüle

@@ -54,7 +54,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC
{
string address = "MD" + (4120 + (loc - 1) * 4 + (barrel - 1 - 1) * 48);
HK_PLC_S7.Write<float>(address, recipe.RawMaterial.ElementAt(index).RawMaterialWeight);
MessageLog.GetInstance.ShowRunLog($"配方数据下发完成,地址:{address},重量:{recipe.RawMaterial.ElementAt(index).RawMaterialWeight}");
MessageNotify.GetInstance.ShowRunLog($"配方数据下发完成,地址:{address},重量:{recipe.RawMaterial.ElementAt(index).RawMaterialWeight}");
}
else//不存在的原料信息,重量写0
{
@@ -68,7 +68,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC
{
string address = "MD" + (4120 + (loc - 1) * 4 + (barrel - 1) * 48);
HK_PLC_S7.Write<float>(address, recipe.RawMaterial.ElementAt(index).RawMaterialWeight);
MessageLog.GetInstance.ShowRunLog($"配方数据下发完成,地址:{address},重量:{recipe.RawMaterial.ElementAt(index).RawMaterialWeight}");
MessageNotify.GetInstance.ShowRunLog($"配方数据下发完成,地址:{address},重量:{recipe.RawMaterial.ElementAt(index).RawMaterialWeight}");
}
else//不存在的原料信息,重量写0
{


+ 4
- 4
BPASmartClient.JXJFoodBigStation/Model/ProcessControl.cs Dosyayı Görüntüle

@@ -108,7 +108,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model
if (HKDevice.IsConnected)
{
HKDevice.Init();
MessageLog.GetInstance.ShowRunLog("海科plc连接成功");
MessageNotify.GetInstance.ShowRunLog("海科plc连接成功");
}
if (SiemensDevice.IsConnected)
{
@@ -299,20 +299,20 @@ namespace BPASmartClient.JXJFoodBigStation.Model
HKDevice.HK_PLC_S7.Write<bool>("M4001.0", true);//配发下发完成,to plc
HKDevice.HK_PLC_S7.Write<bool>("M5001.0", false);//复位允许下发配方1信号
BigStation.RecipeDosingStatus = 1;
MessageLog.GetInstance.ShowRunLog($"配方状态:{code}下发完成");
MessageNotify.GetInstance.ShowRunLog($"配方状态:{code}下发完成");
}
if (HKDevice.HK_PLC_S7.Read<bool>("M5001.4") && BigStation.RecipeDosingStatus == 1)
{
BigStation.RecipeDosingStatus = 2;
HKDevice.HK_PLC_S7.Write<bool>("M5001.4", false);//
MessageLog.GetInstance.ShowRunLog($"配方状态:{code}配方配料");
MessageNotify.GetInstance.ShowRunLog($"配方状态:{code}配方配料");
}
if (BigStation.RecipeDosingStatus == 2)
{
if (RTrig.GetInstance("StockState").Start(HKDevice.HK_PLC_S7.Read<bool>("M5007.0")))
{
BigStation.RecipeDosingStatus = 3;
MessageLog.GetInstance.ShowRunLog($"配方状态:{code}配料完成");
MessageNotify.GetInstance.ShowRunLog($"配方状态:{code}配料完成");
HKDevice.HK_PLC_S7.Write<bool>("M5007.0",false);
RecipeQueue.TryDequeue(out code);
IssuedComplete.Add(RemoteRecipes.ElementAt(index));//将该配方添加到下


+ 1
- 1
BPASmartClient.JXJFoodBigStation/ViewModel/RecipeReceiveViewModel.cs Dosyayı Görüntüle

@@ -37,7 +37,7 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel
var res = Json<LocalRecipe>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == num);
ActionManage.GetInstance.Send("RecipeInfo", res);
nrv.Show();
MessageLog.GetInstance.ShowUserLog($"查看配方——{res.RecipeName}");
MessageNotify.GetInstance.ShowUserLog($"查看配方——{res.RecipeName}");
}
});
NewRecipe = new RelayCommand(() => {


+ 2
- 2
BPASmartClient.JXJFoodSmallStation/App.xaml.cs Dosyayı Görüntüle

@@ -35,7 +35,7 @@ namespace BPASmartClient.JXJFoodSmallStation
var res = lv.ShowDialog();
if (res != null && res == true)
{
MessageLog.GetInstance.ShowUserLog("用户登录");
MessageNotify.GetInstance.ShowUserLog("用户登录");
mv.Show();
}
else
@@ -48,7 +48,7 @@ namespace BPASmartClient.JXJFoodSmallStation
base.OnExit(e);
Json<LocaPar>.Save();
Json<LocalRecipeDataColl>.Save();
MessageLog.GetInstance.LogSave();
MessageNotify.GetInstance.LogSave();
ThreadManage.GetInstance().Dispose();
}



+ 8
- 8
BPASmartClient.JXJFoodSmallStation/Model/HK_PLC/HKDeviceStatus.cs Dosyayı Görüntüle

@@ -86,7 +86,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model.HK_PLC
{
HK_PLC_S7.Write<bool>("DB4.DBX11." + (StockBinLocation - 9), true);
}
MessageLog.GetInstance.ShowRunLog($"托盘1—1号桶在料仓{StockBinLocation}配料");
MessageNotify.GetInstance.ShowRunLog($"托盘1—1号桶在料仓{StockBinLocation}配料");
}
else if (BarrelNum == 2)
{
@@ -98,7 +98,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model.HK_PLC
{
HK_PLC_S7.Write<bool>("DB4.DBX13." + (StockBinLocation - 9), true);
}
MessageLog.GetInstance.ShowRunLog($"托盘1—2号桶在料仓{StockBinLocation}配料");
MessageNotify.GetInstance.ShowRunLog($"托盘1—2号桶在料仓{StockBinLocation}配料");
}
else if (BarrelNum == 3)
{
@@ -110,7 +110,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model.HK_PLC
{
HK_PLC_S7.Write<bool>("DB4.DBX15." + (StockBinLocation - 9), true);
}
MessageLog.GetInstance.ShowRunLog($"托盘1—3号桶在料仓{StockBinLocation}配料");
MessageNotify.GetInstance.ShowRunLog($"托盘1—3号桶在料仓{StockBinLocation}配料");
}
else if (BarrelNum == 4)
{
@@ -122,7 +122,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model.HK_PLC
{
HK_PLC_S7.Write<bool>("DB4.DBX17." + (StockBinLocation - 9), true);
}
MessageLog.GetInstance.ShowRunLog($"托盘1—4号桶在料仓{StockBinLocation}配料");
MessageNotify.GetInstance.ShowRunLog($"托盘1—4号桶在料仓{StockBinLocation}配料");
}
}
}
@@ -140,7 +140,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model.HK_PLC
{
HK_PLC_S7.Write<bool>("DB4.DBX19." + (StockBinLocation - 9), true);
}
MessageLog.GetInstance.ShowRunLog($"托盘2—1号桶在料仓{StockBinLocation}配料");
MessageNotify.GetInstance.ShowRunLog($"托盘2—1号桶在料仓{StockBinLocation}配料");
}
else if (BarrelNum == 2)
{
@@ -152,7 +152,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model.HK_PLC
{
HK_PLC_S7.Write<bool>("DB4.DBX21." + (StockBinLocation - 9), true);
}
MessageLog.GetInstance.ShowRunLog($"托盘2—2号桶在料仓{StockBinLocation}配料");
MessageNotify.GetInstance.ShowRunLog($"托盘2—2号桶在料仓{StockBinLocation}配料");
}
else if (BarrelNum == 3)
{
@@ -164,7 +164,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model.HK_PLC
{
HK_PLC_S7.Write<bool>("DB4.DBX23." + (StockBinLocation - 9), true);
}
MessageLog.GetInstance.ShowRunLog($"托盘2—3号桶在料仓{StockBinLocation}配料");
MessageNotify.GetInstance.ShowRunLog($"托盘2—3号桶在料仓{StockBinLocation}配料");
}
else if (BarrelNum == 4)
{
@@ -176,7 +176,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model.HK_PLC
{
HK_PLC_S7.Write<bool>("DB4.DBX25." + (StockBinLocation - 9), true);
}
MessageLog.GetInstance.ShowRunLog($"托盘2—4号桶在料仓{StockBinLocation}配料");
MessageNotify.GetInstance.ShowRunLog($"托盘2—4号桶在料仓{StockBinLocation}配料");
}
}
}


+ 38
- 38
BPASmartClient.JXJFoodSmallStation/Model/ProcessControl.cs Dosyayı Görüntüle

@@ -80,7 +80,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
}
else
{
MessageLog.GetInstance.AlarmLog("配方名称与本地不符合");
MessageNotify.GetInstance.AlarmLog("配方名称与本地不符合");
}
}
Json<RemoteRecipeDataColl>.Data.Recipes.Add(new RemoteRecipeData()
@@ -117,17 +117,17 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
if (HKDevice.IsConnected)
{
HKDevice.Init();
MessageLog.GetInstance.ShowRunLog("海科plc连接成功,并初始化完成");
MessageNotify.GetInstance.ShowRunLog("海科plc连接成功,并初始化完成");
}
if (SiemensDevice.IsConnected)
{
SiemensDevice.Init();
MessageLog.GetInstance.ShowRunLog("西门子plc连接成功,并初始化完成");
MessageNotify.GetInstance.ShowRunLog("西门子plc连接成功,并初始化完成");
}
if (WindSendDevice.IsConnected)
{
WindSendDevice.Init();
MessageLog.GetInstance.ShowRunLog("风送plc连接成功,并初始化完成");
MessageNotify.GetInstance.ShowRunLog("风送plc连接成功,并初始化完成");
}
}
catch(Exception ex)
@@ -706,7 +706,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
}
HKDevice.HK_PLC_S7.Write("DB4.DBX1.3", true);
GVL_SmallStation.GetInstance.RecipeStatusID = 1;
MessageLog.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},下发完成");
MessageNotify.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},下发完成");
HKDevice.HK_PLC_S7.Write("DB3.DBX1.3", true);
}
@@ -714,14 +714,14 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
{
HKDevice.HK_PLC_S7.Write("DB3.DBX1.3", false);
GVL_SmallStation.GetInstance.RecipeStatusID = 2;
MessageLog.GetInstance.ShowRunLog($"托盘1,{ recipeName}plc端 配方接收完成");
MessageNotify.GetInstance.ShowRunLog($"托盘1,{ recipeName}plc端 配方接收完成");
}
if (GVL_SmallStation.GetInstance.RecipeStatusID == 2)
{
if (RTrig.GetInstance("DB3.DBX50.0").Start(HKDevice.HK_PLC_S7.Read<bool>("DB3.DBX50.0")))
{
var res = HKDevice.HK_PLC_S7.Read<float>("DB3.DBD10");
MessageLog.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},1号桶,{res}料仓,允许配料");
MessageNotify.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},1号桶,{res}料仓,允许配料");
if (res > 0 && res is float loc)
{
int loc_index = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == loc);
@@ -734,13 +734,13 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
}
GVL_SmallStation.GetInstance.DosingTray1 = true;
GVL_SmallStation.GetInstance.DosingTray1Loc = (int)loc;
MessageLog.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},1号桶,{(int)loc}号仓,配料完成");
MessageNotify.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},1号桶,{(int)loc}号仓,配料完成");
}
}
else if(RTrig.GetInstance("DB3.DBX50.1").Start(HKDevice.HK_PLC_S7.Read<bool>("DB3.DBX50.1")))
{
var res = HKDevice.HK_PLC_S7.Read<float>("DB3.DBD14");
MessageLog.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},2号桶,{res}料仓,允许配料");
MessageNotify.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},2号桶,{res}料仓,允许配料");
if (res > 0 && res is float loc)
{
int loc_index = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == loc);
@@ -753,13 +753,13 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
}
GVL_SmallStation.GetInstance.DosingTray1 = true;
GVL_SmallStation.GetInstance.DosingTray1Loc = (int)loc;
MessageLog.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},2号桶,{(int)loc}号仓,配料完成");
MessageNotify.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},2号桶,{(int)loc}号仓,配料完成");
}
}
else if (RTrig.GetInstance("DB3.DBX50.2").Start(HKDevice.HK_PLC_S7.Read<bool>("DB3.DBX50.2")))
{
var res = HKDevice.HK_PLC_S7.Read<float>("DB3.DBD18");
MessageLog.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},3号桶,{res}料仓,允许配料");
MessageNotify.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},3号桶,{res}料仓,允许配料");
if (res > 0 && res is float loc)
{
int loc_index = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == loc);
@@ -772,13 +772,13 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
}
GVL_SmallStation.GetInstance.DosingTray1 = true;
GVL_SmallStation.GetInstance.DosingTray1Loc = (int)loc;
MessageLog.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},3号桶,{(int)loc}号仓,配料完成");
MessageNotify.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},3号桶,{(int)loc}号仓,配料完成");
}
}
else if (RTrig.GetInstance("DB3.DBX50.3").Start(HKDevice.HK_PLC_S7.Read<bool>("DB3.DBX50.3")))
{
var res = HKDevice.HK_PLC_S7.Read<float>("DB3.DBD22");
MessageLog.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},4号桶,{res}料仓,允许配料");
MessageNotify.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},4号桶,{res}料仓,允许配料");
if (res > 0 && res is float loc)
{
int loc_index = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == loc);
@@ -791,7 +791,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
}
GVL_SmallStation.GetInstance.DosingTray1 = true;
GVL_SmallStation.GetInstance.DosingTray1Loc = (int)loc;
MessageLog.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},4号桶,{(int)loc}号仓,配料完成");
MessageNotify.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},4号桶,{(int)loc}号仓,配料完成");
}
}
if (GVL_SmallStation.GetInstance.DosingTray1 && GVL_SmallStation.GetInstance.DosingTray1Loc > 0 && GVL_SmallStation.GetInstance.DosingTray1Loc < 16)
@@ -799,27 +799,27 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
int i = GVL_SmallStation.GetInstance.DosingTray1Loc;
if (RTrig.GetInstance("Tray1StatusDevice" + i).Start(DeviceInquire.GetInstance.GetDevice(i).deviceStatus.RunStatus == 3))
{
MessageLog.GetInstance.ShowRunLog($"柔性味魔方,托盘1,配方:{recipeName},{i}号仓,配料完成");
MessageNotify.GetInstance.ShowRunLog($"柔性味魔方,托盘1,配方:{recipeName},{i}号仓,配料完成");
int res = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == i);
RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(res).Laying_Off_Weight = DeviceInquire.GetInstance.GetDevice(i).deviceStatus.CutWeightFeedback;
bool info = DeviceInquire.GetInstance.GetDevice(i).StatusReset();
if (info)
{
MessageLog.GetInstance.ShowRunLog($"柔性味魔方配料完成后复位 发送成功");
MessageNotify.GetInstance.ShowRunLog($"柔性味魔方配料完成后复位 发送成功");
}
else
{
MessageLog.GetInstance.ShowRunLog($"柔性味魔方配料完成后复位 发送失败");
MessageNotify.GetInstance.ShowRunLog($"柔性味魔方配料完成后复位 发送失败");
}
if (i >= 1 && i <= 8)
{
string commInfo = HKDevice.HK_PLC_S7.Write("DB4.DBX30." + (i - 1), true, 4);
MessageLog.GetInstance.ShowRunLog(commInfo);
MessageNotify.GetInstance.ShowRunLog(commInfo);
}
else if (i >= 9 && i <= 15)
{
string commInfo1 = HKDevice.HK_PLC_S7.Write("DB4.DBX31." + (i - 9), true, 4);
MessageLog.GetInstance.ShowRunLog(commInfo1);
MessageNotify.GetInstance.ShowRunLog(commInfo1);
}
GVL_SmallStation.GetInstance.DosingTray1 = false;
GVL_SmallStation.GetInstance.DosingTray1Loc = 0;
@@ -829,7 +829,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
if (RTrig.GetInstance("配方配料完成").Start(HKDevice.HK_PLC_S7.Read<bool>("DB3.DBX1.1")) && (GVL_SmallStation.GetInstance.WindSendDosingFinish || !GVL_SmallStation.GetInstance.IsUseWindSend))
{
var res = Json<RemoteRecipeDataColl>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == code);
MessageLog.GetInstance.ShowRunLog($"托盘1,配方{res.RecipeName},配料完成");
MessageNotify.GetInstance.ShowRunLog($"托盘1,配方{res.RecipeName},配料完成");
RecipeFinishInfo.Order_No = RemoteRecipes.ElementAt(index).RecipeCode;
RecipeFinishInfo.Product_Code = RemoteRecipes.ElementAt(index).RecipeName;
for (int i = 0; i < RemoteRecipes.ElementAt(index).RawMaterial.Count; i++)
@@ -868,14 +868,14 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
{
if (GVL_SmallStation.GetInstance.RecipeStatusIDTray2 == 0)
{
MessageLog.GetInstance.ShowRunLog($"托盘2,配方:{recipeName},初始化");
MessageNotify.GetInstance.ShowRunLog($"托盘2,配方:{recipeName},初始化");
foreach (var item in RemoteRecipes.ElementAt(index).RawMaterial)
{
HKDevice.StockBinPar((uint)item.RawMaterialBarrelNum, (ushort)item.RawMaterialLocation, 2);
}
HKDevice.HK_PLC_S7.Write("DB4.DBX1.4", true);
GVL_SmallStation.GetInstance.RecipeStatusIDTray2 = 1;
MessageLog.GetInstance.ShowRunLog($"托盘2,配方:{recipeName},下发完成");
MessageNotify.GetInstance.ShowRunLog($"托盘2,配方:{recipeName},下发完成");
HKDevice.HK_PLC_S7.Write("DB3.DBX1.4", true);
}

@@ -883,14 +883,14 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
{
HKDevice.HK_PLC_S7.Write("DB3.DBX1.4", false);
GVL_SmallStation.GetInstance.RecipeStatusIDTray2 = 2;
MessageLog.GetInstance.ShowRunLog($"配方:{recipeName},plc端 配方接收完成");
MessageNotify.GetInstance.ShowRunLog($"配方:{recipeName},plc端 配方接收完成");
}
if (GVL_SmallStation.GetInstance.RecipeStatusIDTray2 == 2)
{
if (RTrig.GetInstance("DB3.DBX50.4").Start(HKDevice.HK_PLC_S7.Read<bool>("DB3.DBX50.4")))
{
var res = HKDevice.HK_PLC_S7.Read<float>("DB3.DBD26");
MessageLog.GetInstance.ShowRunLog($"托盘2,配方:{recipeName},1号桶,{res}料仓,允许配料");
MessageNotify.GetInstance.ShowRunLog($"托盘2,配方:{recipeName},1号桶,{res}料仓,允许配料");
if (res > 0 && res is float loc)
{
//int decimalNum = Convert.ToInt32(loc.ToString().Substring(loc.ToString().IndexOf(".") + 1));
@@ -904,13 +904,13 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
}
GVL_SmallStation.GetInstance.DosingTray2 = true;
GVL_SmallStation.GetInstance.DosingTray2Loc = (int)loc;
MessageLog.GetInstance.ShowRunLog($"托盘2,配方:{recipeName},1号桶,{(int)loc}号仓,配料完成");
MessageNotify.GetInstance.ShowRunLog($"托盘2,配方:{recipeName},1号桶,{(int)loc}号仓,配料完成");
}
}
else if (RTrig.GetInstance("DB3.DBX50.5").Start(HKDevice.HK_PLC_S7.Read<bool>("DB3.DBX50.5")))
{
var res = HKDevice.HK_PLC_S7.Read<float>("DB3.DBD30");
MessageLog.GetInstance.ShowRunLog($"托盘2,配方:{recipeName},2号桶,{res}料仓,允许配料");
MessageNotify.GetInstance.ShowRunLog($"托盘2,配方:{recipeName},2号桶,{res}料仓,允许配料");
if (res > 0 && res is float loc)
{
int loc_index = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == loc);
@@ -923,13 +923,13 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
}
GVL_SmallStation.GetInstance.DosingTray2 = true;
GVL_SmallStation.GetInstance.DosingTray2Loc = (int)loc;
MessageLog.GetInstance.ShowRunLog($"托盘2,配方:{recipeName},2号桶,{(int)loc}号仓,配料完成");
MessageNotify.GetInstance.ShowRunLog($"托盘2,配方:{recipeName},2号桶,{(int)loc}号仓,配料完成");
}
}
else if (RTrig.GetInstance("DB3.DBX50.6").Start(HKDevice.HK_PLC_S7.Read<bool>("DB3.DBX50.6")))
{
var res = HKDevice.HK_PLC_S7.Read<float>("DB3.DBD34");
MessageLog.GetInstance.ShowRunLog($"托盘2,配方:{recipeName},3号桶,{res}料仓,允许配料");
MessageNotify.GetInstance.ShowRunLog($"托盘2,配方:{recipeName},3号桶,{res}料仓,允许配料");
if (res > 0 && res is float loc)
{
int loc_index = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == loc);
@@ -942,13 +942,13 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
}
GVL_SmallStation.GetInstance.DosingTray2 = true;
GVL_SmallStation.GetInstance.DosingTray2Loc = (int)loc;
MessageLog.GetInstance.ShowRunLog($"托盘2,配方:{recipeName},3号桶,{(int)loc}号仓,配料完成");
MessageNotify.GetInstance.ShowRunLog($"托盘2,配方:{recipeName},3号桶,{(int)loc}号仓,配料完成");
}
}
else if (RTrig.GetInstance("DB3.DBX50.7").Start(HKDevice.HK_PLC_S7.Read<bool>("DB3.DBX50.7")))
{
var res = HKDevice.HK_PLC_S7.Read<float>("DB3.DBD38");
MessageLog.GetInstance.ShowRunLog($"托盘2,配方:{recipeName},4号桶,{res}料仓,允许配料");
MessageNotify.GetInstance.ShowRunLog($"托盘2,配方:{recipeName},4号桶,{res}料仓,允许配料");
if (res > 0 && res is float loc)
{
int loc_index = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == loc);
@@ -961,7 +961,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
}
GVL_SmallStation.GetInstance.DosingTray2 = true;
GVL_SmallStation.GetInstance.DosingTray2Loc = (int)loc;
MessageLog.GetInstance.ShowRunLog($"托盘2,配方:{recipeName},4号桶,{(int)loc}号仓,配料完成");
MessageNotify.GetInstance.ShowRunLog($"托盘2,配方:{recipeName},4号桶,{(int)loc}号仓,配料完成");
}
}
if (GVL_SmallStation.GetInstance.DosingTray2 == true && GVL_SmallStation.GetInstance.DosingTray1 == false && GVL_SmallStation.GetInstance.DosingTray2Loc > 0 && GVL_SmallStation.GetInstance.DosingTray2Loc < 16)
@@ -969,27 +969,27 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
int i = GVL_SmallStation.GetInstance.DosingTray2Loc;
if (RTrig.GetInstance("Tray2StatusDevice" + i).Start(DeviceInquire.GetInstance.GetDevice(i).deviceStatus.RunStatus == 3))
{
MessageLog.GetInstance.ShowRunLog($"柔性味魔方,托盘2,配方:{recipeName},{i}号仓,配料完成");
MessageNotify.GetInstance.ShowRunLog($"柔性味魔方,托盘2,配方:{recipeName},{i}号仓,配料完成");
int res = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == i);
RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(res).Laying_Off_Weight = DeviceInquire.GetInstance.GetDevice(i).deviceStatus.CutWeightFeedback;
bool info = DeviceInquire.GetInstance.GetDevice(i).StatusReset();
if (info)
{
MessageLog.GetInstance.ShowRunLog($"柔性味魔方配料完成后复位 发送成功");
MessageNotify.GetInstance.ShowRunLog($"柔性味魔方配料完成后复位 发送成功");
}
else
{
MessageLog.GetInstance.ShowRunLog($"柔性味魔方配料完成后复位 发送失败");
MessageNotify.GetInstance.ShowRunLog($"柔性味魔方配料完成后复位 发送失败");
}
if (i >= 1 && i <= 8)
{
string commInfo = HKDevice.HK_PLC_S7.Write("DB4.DBX30." + (i - 1), true, 4);
MessageLog.GetInstance.ShowRunLog(commInfo);
MessageNotify.GetInstance.ShowRunLog(commInfo);
}
else if (i >= 9 && i <= 15)
{
string commInfo1 = HKDevice.HK_PLC_S7.Write("DB4.DBX31." + (i - 9), true, 4);
MessageLog.GetInstance.ShowRunLog(commInfo1);
MessageNotify.GetInstance.ShowRunLog(commInfo1);
}
GVL_SmallStation.GetInstance.DosingTray2 = false;
GVL_SmallStation.GetInstance.DosingTray2Loc = 0;
@@ -998,7 +998,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
if (RTrig.GetInstance("DB3.DBX1.2").Start(HKDevice.HK_PLC_S7.Read<bool>("DB3.DBX1.2")))
{
var res = Json<RemoteRecipeDataColl>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == code);
MessageLog.GetInstance.ShowRunLog($"托盘2,配方{res.RecipeName},配料完成");
MessageNotify.GetInstance.ShowRunLog($"托盘2,配方{res.RecipeName},配料完成");
RecipeFinishInfo.Order_No = RemoteRecipes.ElementAt(index).RecipeCode;
RecipeFinishInfo.Product_Code = RemoteRecipes.ElementAt(index).RecipeName;
for (int i = 0; i < RemoteRecipes.ElementAt(index).RawMaterial.Count; i++)
@@ -1040,7 +1040,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
{
if (RTrig.GetInstance("Tray2StatusDevice" + DeviceID).Start(DeviceInquire.GetInstance.GetDevice(DeviceID).deviceStatus.RunStatus == 3))
{
MessageLog.GetInstance.ShowRunLog($"柔性味魔方,托盘2,配方:{RemoteRecipes.ElementAt(Index).RecipeName},{DeviceID}号仓,配料完成");
MessageNotify.GetInstance.ShowRunLog($"柔性味魔方,托盘2,配方:{RemoteRecipes.ElementAt(Index).RecipeName},{DeviceID}号仓,配料完成");
int res = Array.FindIndex(RemoteRecipes.ElementAt(Index).RawMaterial.ToArray(), p => p.RawMaterialLocation == DeviceID);
RemoteRecipes.ElementAt(Index).RawMaterial.ElementAt(res).Laying_Off_Weight = DeviceInquire.GetInstance.GetDevice(DeviceID).deviceStatus.CutWeightFeedback;
DeviceInquire.GetInstance.GetDevice(DeviceID).StatusReset();


+ 5
- 5
BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/DeviceInquire.cs Dosyayı Görüntüle

@@ -297,12 +297,12 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
{
modbusTcp.Show += new Action<string>((s) =>
{
if (s != null) MessageLog.GetInstance.ShowRunLog(s);
if (s != null) MessageNotify.GetInstance.ShowRunLog(s);
});

modbusTcp.ShowEx += new Action<string>((s) =>
{
if (s != null) MessageLog.GetInstance.ShowRunLog(s);
if (s != null) MessageNotify.GetInstance.ShowRunLog(s);
});
this.DeviceName = DeviceName;
AlarmHelper<AlarmInfo>.Init();
@@ -358,11 +358,11 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
bool returnValue = modbusTcp.Write(DeviceAddress.Start, (ushort)1);//设备启动写入
if (returnValue)
{
MessageLog.GetInstance.ShowRunLog($"发送成功" + DeviceAddress.Start);
MessageNotify.GetInstance.ShowRunLog($"发送成功" + DeviceAddress.Start);
}
else
{
MessageLog.GetInstance.ShowRunLog($"发送失败" + DeviceAddress.Start);
MessageNotify.GetInstance.ShowRunLog($"发送失败" + DeviceAddress.Start);
}
//配料设备参数写入
var res = Json<DevicePar>.Data.deviceParModels.FirstOrDefault(p => p.MaterialName == DeviceName);
@@ -376,7 +376,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
modbusTcp.SetUint(DeviceAddress.SiloUpperLimitWeight, (uint)res.SiloUpperLimitWeight);
modbusTcp.SetUint(DeviceAddress.LowerLimitWeightOfSilo, (uint)res.LowerLimitWeightOfSilo);
modbusTcp.SetUint(DeviceAddress.StirringSpeed, (uint)res.StirringSpeed * 100);
MessageLog.GetInstance.ShowRunLog($"{res.MaterialName},参数下发完成");
MessageNotify.GetInstance.ShowRunLog($"{res.MaterialName},参数下发完成");
}
}
}


+ 2
- 2
BPASmartClient.JXJFoodSmallStation/ViewModel/NewMaterialViewModel.cs Dosyayı Görüntüle

@@ -37,7 +37,7 @@ public class NewMaterialViewModel:ObservableObject
var res = Materials.FirstOrDefault(p=>p.RawMaterialId == id);
Materials.Remove(res);
Json<LocaMaterial>.Save();
MessageLog.GetInstance.ShowUserLog($"删除原料--{res.RawMaterialName}");
MessageNotify.GetInstance.ShowUserLog($"删除原料--{res.RawMaterialName}");
}
}

@@ -52,7 +52,7 @@ public class NewMaterialViewModel:ObservableObject
if(Json<LocaMaterial>.Data.LocalMaterails.FirstOrDefault(p=>p.RawMaterialName == MaterialName) != null) { ErrorInfo = "本地原料名称重复";return ;}
Json<LocaMaterial>.Data.LocalMaterails.Add(new RawMaterialModel { RawMaterialName = MaterialName, RawMaterialId = Guid.NewGuid().ToString() , RawMaterialSource = 0 });
Json<LocaMaterial>.Save();
MessageLog.GetInstance.ShowUserLog($"添加原料--{MaterialName}");
MessageNotify.GetInstance.ShowUserLog($"添加原料--{MaterialName}");
});
}
}

+ 3
- 3
BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeControlViewModel.cs Dosyayı Görüntüle

@@ -34,7 +34,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel
{
Recipes.ElementAt(index).IsEnable = false;
}
MessageLog.GetInstance.ShowUserLog($"下发工单 { Recipes.ElementAt(index).RecipeName}");
MessageNotify.GetInstance.ShowUserLog($"下发工单 { Recipes.ElementAt(index).RecipeName}");
devices.Enqueue(deviceName);
var res = Recipes.FirstOrDefault(p => p.RecipeName == deviceName);
UserTreeWait.Add(new RecipeModel { RecipeName = deviceName, RawMaterials = res.RawMaterials });
@@ -42,7 +42,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel


NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"配方下发成功!");
MessageLog.GetInstance.ShowUserLog($"下发工单 {Guid.NewGuid().ToString()}");
MessageNotify.GetInstance.ShowUserLog($"下发工单 {Guid.NewGuid().ToString()}");
});

ChangeRecipeStateCommand = new RelayCommand<object>(ChangeRecipeState);
@@ -127,7 +127,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel
for (int n = 0; n < recipeProcesses.Count; n++)
{
DeviceInquire.GetInstance.GetDevice(Recipes.ElementAt(recipIndex).RawMaterials.ElementAt(n).DeviceIp).StatusReset();//完成配料的设备运行状态地址写0
MessageLog.GetInstance.ShowRunLog(Recipes.ElementAt(recipIndex).RawMaterials.ElementAt(n).DeviceIp);
MessageNotify.GetInstance.ShowRunLog(Recipes.ElementAt(recipIndex).RawMaterials.ElementAt(n).DeviceIp);
}
App.Current.Dispatcher.Invoke(new Action(() => { recipeProcesses.Clear(); }));
Recipes.ElementAt(recipIndex).IsEnable = true;


+ 3
- 3
BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeReceiveViewModel.cs Dosyayı Görüntüle

@@ -45,7 +45,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel
if (res != null)
{
Json<LocalRecipeDataColl>.Data.Recipes.Remove(res);
MessageLog.GetInstance.ShowUserLog($"删除配方——{res.RecipeName}");
MessageNotify.GetInstance.ShowUserLog($"删除配方——{res.RecipeName}");
}
}
});
@@ -60,7 +60,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel
{
ActionManage.GetInstance.Send("LocalRecipeEdit", res);
nrv.Show();
MessageLog.GetInstance.ShowUserLog($"编辑配方——{res.RecipeName}");
MessageNotify.GetInstance.ShowUserLog($"编辑配方——{res.RecipeName}");
}
}
});
@@ -86,7 +86,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel
{
ActionManage.GetInstance.Send("LocalSimulationRecipeIssue", res);
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"{res.RecipeName}配方下发成功!");
MessageLog.GetInstance.ShowUserLog($"下发本地模拟配方——{res.RecipeName}");
MessageNotify.GetInstance.ShowUserLog($"下发本地模拟配方——{res.RecipeName}");
}
}
}


+ 4
- 4
BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeSettingsViewModel.cs Dosyayı Görüntüle

@@ -36,12 +36,12 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel
{
NewRecipeView nrv = new NewRecipeView();
nrv.ShowDialog();
MessageLog.GetInstance.ShowUserLog("新建配方");
MessageNotify.GetInstance.ShowUserLog("新建配方");
});
SaveRecipe = new RelayCommand(() =>
{
Json<LocaPar>.Save();
MessageLog.GetInstance.ShowUserLog("保存配方");
MessageNotify.GetInstance.ShowUserLog("保存配方");
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"配方保存成功!");
});
RemoveCommand = new RelayCommand<object>((o) =>
@@ -50,7 +50,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel
{
var res = Json<LocaPar>.Data.Recipes.FirstOrDefault(p => p.RecipCode == str);
if (res != null) Json<LocaPar>.Data.Recipes.Remove(res);
MessageLog.GetInstance.ShowUserLog($"删除名称——{res.RecipeName}");
MessageNotify.GetInstance.ShowUserLog($"删除名称——{res.RecipeName}");
}
});

@@ -63,7 +63,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel
var res = Json<LocaPar>.Data.Recipes.FirstOrDefault(p => p.RecipCode == str);
ActionManage.GetInstance.Send("Details", res);
nrv.ShowDialog();
MessageLog.GetInstance.ShowUserLog($"编辑配方名称——{res.RecipeName}");
MessageNotify.GetInstance.ShowUserLog($"编辑配方名称——{res.RecipeName}");
}
});



+ 1
- 1
BPASmartClient.JXJFoodSmallStation/ViewModel/SiemensRecipeReceiveViewModel.cs Dosyayı Görüntüle

@@ -40,7 +40,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel
{
ActionManage.GetInstance.Send("RecipeInfo", res);
nrv.Show();
MessageLog.GetInstance.ShowUserLog($"查看配方——{res.RecipeName}");
MessageNotify.GetInstance.ShowUserLog($"查看配方——{res.RecipeName}");
}
}
});


+ 2
- 2
BPASmartClient.SmallBatchingSystem/Services/Control.cs Dosyayı Görüntüle

@@ -312,13 +312,13 @@ PlcServer.GetInstance.WriteData("M4.0", false);//复位出料完成信号

public void RunLog(string info)
{
BPASmartClient.CustomResource.Pages.Model.MessageLog.GetInstance.ShowRunLog(info);
BPASmartClient.CustomResource.Pages.Model.MessageNotify.GetInstance.ShowRunLog(info);
Debug.WriteLine($"{DateTime.Now.ToString("HH:mm:ss")}:{info}");
}

public void OperationLog(string info)
{
BPASmartClient.CustomResource.Pages.Model.MessageLog.GetInstance.ShowUserLog(info);
BPASmartClient.CustomResource.Pages.Model.MessageNotify.GetInstance.ShowUserLog(info);
Debug.WriteLine($"{DateTime.Now.ToString("HH:mm:ss")}:{info}");
}



+ 1
- 1
BPASmartClient.ZhuoDian/App.xaml.cs Dosyayı Görüntüle

@@ -35,7 +35,7 @@ namespace BPASmartClient.ZhuoDian
protected override void OnExit(ExitEventArgs e)
{
base.OnExit(e);
MessageLog.GetInstance.LogSave();
MessageNotify.GetInstance.LogSave();
}

private void MenuInit()


+ 11
- 4
DosingSystem/App.xaml.cs Dosyayı Görüntüle

@@ -12,8 +12,7 @@ using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.CustomResource.Pages.View;
using BPASmartClient.CustomResource.Pages.ViewModel;
using BPASmartClient.DosingSystem.View;
using BPASmartClient.Helper;
using BPASmartClient.Nfc;
using BPA.Helper;

namespace BPASmartClient.DosingSystem
{
@@ -37,7 +36,7 @@ namespace BPASmartClient.DosingSystem
var res = lv.ShowDialog();
if (res != null && res == true)
{
MessageLog.GetInstance.ShowUserLog("用户登录");
BPASmartClient.CustomResource.Pages.Model.MessageNotify.GetInstance.ShowUserLog("用户登录");
mv.Show();
}
else
@@ -50,7 +49,7 @@ namespace BPASmartClient.DosingSystem
base.OnExit(e);
Json<LocaPar>.Save();
Json<DevicePar>.Save();
MessageLog.GetInstance.LogSave();
BPASmartClient.CustomResource.Pages.Model.MessageNotify.GetInstance.LogSave();
ThreadManage.GetInstance().Dispose();
}

@@ -95,6 +94,14 @@ namespace BPASmartClient.DosingSystem
ToggleWindowPath = "View.DeviceMaterialParView"
});

ParSet.Add(new SubMenumodel()
{
SubMenuName = "通讯参数设置",
SubMenuPermission = new Permission[] { Permission.管理员 },
AssemblyName = "BPASmartClient.DosingSystem",
ToggleWindowPath = "View.CommParSetView"
});

MenuManage.GetInstance.menuModels.Add(new MenuModel()
{
MainMenuIcon = "&#xe62d;",


+ 4
- 1
DosingSystem/BPASmartClient.DosingSystem.csproj Dosyayı Görüntüle

@@ -24,7 +24,10 @@
<ItemGroup>
<ProjectReference Include="..\BPASmartClient.CustomResource\BPASmartClient.CustomResource.csproj" />
<ProjectReference Include="..\BPASmartClient.Modbus\BPASmartClient.Modbus.csproj" />
<ProjectReference Include="..\BPASmartClient.Nfc\BPASmartClient.Nfc.csproj" />
</ItemGroup>

<ItemGroup>
<Folder Include="Service\" />
</ItemGroup>

</Project>

+ 15
- 10
DosingSystem/Model/DeviceInquire.cs Dosyayı Görüntüle

@@ -1,6 +1,5 @@
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.DosingSystem.ViewModel;
using BPASmartClient.Helper;
using BPASmartClient.Modbus;
using BPASmartClient.Model;
using System;
@@ -11,6 +10,8 @@ using System.Linq;
using System.Net.NetworkInformation;
using System.Threading;
using System.Threading.Tasks;
using BPA.Helper;
using System.Text.RegularExpressions;

namespace BPASmartClient.DosingSystem
{
@@ -106,6 +107,8 @@ namespace BPASmartClient.DosingSystem

public void Init()
{
if (!string.IsNullOrEmpty(Json<DevicePar>.Data.Address)) IPSegment = Json<DevicePar>.Data.Address;
else Json<DevicePar>.Data.Address = IPSegment;
TestData();
IpAddressLines();
DeviceDataInit();
@@ -150,7 +153,11 @@ namespace BPASmartClient.DosingSystem
{
if (!InvalidIP.Contains($"{IPSegment}{i}") && !DeviceLists.ContainsKey($"{IPSegment}{i}"))
{
IPLists.Add($"{IPSegment}{i}");
string pattern = @"^(([1-9]\d?)|(1\d{2})|(2[01]\d)|(22[0-3]))(\.((1?\d\d?)|(2[04]/d)|(25[0-5]))){3}$";
if (Regex.IsMatch($"{IPSegment}{i}", pattern))
{
IPLists.Add($"{IPSegment}{i}");
}
}
}

@@ -281,8 +288,6 @@ namespace BPASmartClient.DosingSystem
/// </summary>
public RawMaterialDeviceStatus deviceStatus { get; set; } = new RawMaterialDeviceStatus();



public ModbusTcp modbusTcp = new ModbusTcp();

public bool IsConnected => modbusTcp.Connected;
@@ -311,12 +316,12 @@ namespace BPASmartClient.DosingSystem
deviceStatus.DeviceNum = (ushort)this.modbusTcp.ReadShort(DeviceAddress.DeviceNum);//获取设备编号
deviceStatus.DeviceAlarmCode = (ushort)this.modbusTcp.ReadShort(DeviceAddress.DeviceAlarmCode);//获取设备故障编码

AlarmHelper<AlarmInfo>.GetInstance(DeviceName).EStop1 = deviceStatus.DeviceAlarmCode.Get16bitValue(1);
AlarmHelper<AlarmInfo>.GetInstance(DeviceName).Servo = deviceStatus.DeviceAlarmCode.Get16bitValue(2);
AlarmHelper<AlarmInfo>.GetInstance(DeviceName).Inverter = deviceStatus.DeviceAlarmCode.Get16bitValue(3);
AlarmHelper<AlarmInfo>.GetInstance(DeviceName).EStop2 = deviceStatus.DeviceAlarmCode.Get16bitValue(7);
AlarmHelper<AlarmInfo>.GetInstance(DeviceName).SiloUpperLimit = deviceStatus.DeviceAlarmCode.Get16bitValue(8);
AlarmHelper<AlarmInfo>.GetInstance(DeviceName).SiloLowerLimit = deviceStatus.DeviceAlarmCode.Get16bitValue(9);
AlarmHelper<AlarmInfo>.GetInstance(DeviceName).EStop1 = deviceStatus.DeviceAlarmCode.GetBitValue(1);
AlarmHelper<AlarmInfo>.GetInstance(DeviceName).Servo = deviceStatus.DeviceAlarmCode.GetBitValue(2);
AlarmHelper<AlarmInfo>.GetInstance(DeviceName).Inverter = deviceStatus.DeviceAlarmCode.GetBitValue(3);
AlarmHelper<AlarmInfo>.GetInstance(DeviceName).EStop2 = deviceStatus.DeviceAlarmCode.GetBitValue(7);
AlarmHelper<AlarmInfo>.GetInstance(DeviceName).SiloUpperLimit = deviceStatus.DeviceAlarmCode.GetBitValue(8);
AlarmHelper<AlarmInfo>.GetInstance(DeviceName).SiloLowerLimit = deviceStatus.DeviceAlarmCode.GetBitValue(9);
Thread.Sleep(100);
}), $"{DeviceName} 开始监听", true);
}


+ 0
- 15
DosingSystem/Model/DevicePar.cs Dosyayı Görüntüle

@@ -1,15 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using System.Collections.ObjectModel;

namespace BPASmartClient.DosingSystem
{
public class DevicePar
{
public ObservableCollection<DeviceParModel> deviceParModels { get; set; } = new ObservableCollection<DeviceParModel>();
}
}

+ 44
- 0
DosingSystem/Model/par/DevicePar.cs Dosyayı Görüntüle

@@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using System.Collections.ObjectModel;

namespace BPASmartClient.DosingSystem
{
public class DevicePar
{
/// <summary>
/// 配料设备参数
/// </summary>
public ObservableCollection<DeviceParModel> deviceParModels { get; set; } = new ObservableCollection<DeviceParModel>();

/// <summary>
/// 设备扫描网段
/// </summary>
public string Address { get; set; } = string.Empty;

/// <summary>
/// 设备端口号
/// </summary>
public int Port { get; set; } = 502;

/// <summary>
/// 升降气缸数量
/// </summary>
public int LiftCylinderCount { get; set; }

/// <summary>
/// 阻挡气缸数量
/// </summary>
public int BlockCylinderCount { get; set; }

/// <summary>
/// 托盘气缸数量
/// </summary>
public int PalletCylinderCount { get; set; }

}
}

DosingSystem/Model/DeviceParModel.cs → DosingSystem/Model/par/DeviceParModel.cs Dosyayı Görüntüle


DosingSystem/Model/LocaPar.cs → DosingSystem/Model/par/LocaPar.cs Dosyayı Görüntüle


+ 45
- 0
DosingSystem/View/CommParSetView.xaml Dosyayı Görüntüle

@@ -0,0 +1,45 @@
<UserControl
x:Class="BPASmartClient.DosingSystem.View.CommParSetView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BPASmartClient.DosingSystem.View"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:BPASmartClient.DosingSystem.ViewModel"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">

<UserControl.DataContext>
<vm:CommparSetViewModel />
</UserControl.DataContext>

<Grid>
<StackPanel
Margin="0,10,0,0"
VerticalAlignment="Top"
Orientation="Horizontal">
<TextBlock
Margin="10,0,0,0"
HorizontalAlignment="Left"
Style="{StaticResource TextBlockStyle}"
Text="设备网段地址设置:" />
<TextBox
Width="180"
Height="35"
Margin="0,0,0,0"
FontSize="20"
Style="{StaticResource TextBoxStyle}"
Text="{Binding Address}" />
<Button
Width="90"
Height="30"
Margin="5,0,5,0"
Command="{Binding SaveCommand}"
Content="保存参数"
FontSize="20"
Style="{StaticResource ImageButtonStyle}" />

</StackPanel>
</Grid>
</UserControl>

+ 28
- 0
DosingSystem/View/CommParSetView.xaml.cs Dosyayı Görüntüle

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace BPASmartClient.DosingSystem.View
{
/// <summary>
/// CommParSetView.xaml 的交互逻辑
/// </summary>
public partial class CommParSetView : UserControl
{
public CommParSetView()
{
InitializeComponent();
}
}
}

+ 1
- 2
DosingSystem/ViewModel/ChangeDeviceNameViewModel.cs Dosyayı Görüntüle

@@ -3,8 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BPASmartClient.Helper;

using BPA.Helper;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.CustomResource.Pages.Model;


+ 48
- 0
DosingSystem/ViewModel/CommparSetViewModel.cs Dosyayı Görüntüle

@@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BPA.Helper;
using BPASmartClient.CustomResource.UserControls;
using BPASmartClient.CustomResource.UserControls.MessageShow;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;

namespace BPASmartClient.DosingSystem.ViewModel
{
public class CommparSetViewModel : ObservableObject
{
public CommparSetViewModel()
{
SaveCommand = new RelayCommand(() =>
{
if (!string.IsNullOrEmpty(Address))
{
var res = Address.Split(".");
if (res != null)
{
StringBuilder sb = new StringBuilder();
if (res.Length >= 3)
{
for (int i = 0; i < 3; i++)
{
sb.Append($"{res[i]}.");
}
Json<DevicePar>.Data.Address = sb.ToString();
Json<DevicePar>.Save();
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"参数保存成功!");
}
}
}
});
Address = Json<DevicePar>.Data.Address;
}

public string Address { get { return _mAddress; } set { _mAddress = value; OnPropertyChanged(); } }
private string _mAddress;

public RelayCommand SaveCommand { get; set; }

}
}

+ 1
- 1
DosingSystem/ViewModel/DeviceListViewModel.cs Dosyayı Görüntüle

@@ -7,7 +7,7 @@ using Microsoft.Toolkit.Mvvm.ComponentModel;
using System.Collections.Concurrent;
using System.Collections.ObjectModel;
using System.Windows;
using BPASmartClient.Helper;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.DosingSystem.View;



+ 1
- 2
DosingSystem/ViewModel/DeviceMaterialParViewModel.cs Dosyayı Görüntüle

@@ -5,8 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using System.Collections.ObjectModel;

using BPASmartClient.Helper;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.CustomResource.UserControls.MessageShow;
using BPASmartClient.CustomResource.UserControls;


+ 1
- 1
DosingSystem/ViewModel/HardwareStatusViewModel.cs Dosyayı Görüntüle

@@ -7,7 +7,7 @@ using Microsoft.Toolkit.Mvvm.ComponentModel;
using System.Collections.Concurrent;
using System.Collections.ObjectModel;
using System.Windows;
using BPASmartClient.Helper;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;




+ 6
- 2
DosingSystem/ViewModel/ManualControlViewModel.cs Dosyayı Görüntüle

@@ -6,6 +6,7 @@ using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using System.Collections.ObjectModel;
using Microsoft.Toolkit.Mvvm.Input;
using BPA.Helper;

namespace BPASmartClient.DosingSystem.ViewModel
{
@@ -13,7 +14,7 @@ namespace BPASmartClient.DosingSystem.ViewModel
{
public ManualControlViewModel()
{
for (int i = 0; i < 15; i++)
for (int i = 0; i < Json<DevicePar>.Data.LiftCylinderCount; i++)
{
cylinderModels.Add(new CylinderModel()
{
@@ -21,7 +22,10 @@ namespace BPASmartClient.DosingSystem.ViewModel
LeftTog = false,
RightTog = false,
});
}

for (int i = 0; i < Json<DevicePar>.Data.BlockCylinderCount; i++)
{
BlockCylinders.Add(new CylinderModel()
{
Name = $"阻挡气缸 {i + 1}",
@@ -30,7 +34,7 @@ namespace BPASmartClient.DosingSystem.ViewModel
});
}

for (int i = 0; i < 4; i++)
for (int i = 0; i < Json<DevicePar>.Data.PalletCylinderCount; i++)
{
PalletCylinders.Add(new CylinderModel()
{


+ 3
- 4
DosingSystem/ViewModel/NewMaterialViewModel.cs Dosyayı Görüntüle

@@ -1,6 +1,5 @@
using BPASmartClient.CustomResource.Pages.Model;

using BPASmartClient.Helper;
using BPA.Helper;
using BPASmartClient.Model;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;
@@ -37,7 +36,7 @@ public class NewMaterialViewModel : ViewModelBase
var res = Materials.FirstOrDefault(p => p.RawMaterialId == id);
Materials.Remove(res);
Json<LocaMaterial>.Save();
MessageLog.GetInstance.ShowUserLog($"删除原料--{res.RawMaterialName}");
MessageNotify.GetInstance.ShowUserLog($"删除原料--{res.RawMaterialName}");
}
}

@@ -52,7 +51,7 @@ public class NewMaterialViewModel : ViewModelBase
if (Json<LocaMaterial>.Data.LocalMaterails.FirstOrDefault(p => p.RawMaterialName == MaterialName) != null) { ErrorInfo = "本地原料名称重复"; return; }
Json<LocaMaterial>.Data.LocalMaterails.Add(new RawMaterialModel { RawMaterialName = MaterialName, RawMaterialId = Guid.NewGuid().ToString(), RawMaterialSource = 0 });
Json<LocaMaterial>.Save();
MessageLog.GetInstance.ShowUserLog($"添加原料--{MaterialName}");
MessageNotify.GetInstance.ShowUserLog($"添加原料--{MaterialName}");
});
}
}

+ 1
- 1
DosingSystem/ViewModel/NewRecipeViewModel.cs Dosyayı Görüntüle

@@ -6,7 +6,7 @@ using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using System.Collections.ObjectModel;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.Helper;
using BPA.Helper;
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.Model;
using BPASmartClient.CustomResource.UserControls.MessageShow;


+ 4
- 5
DosingSystem/ViewModel/RecipeControlViewModel.cs Dosyayı Görüntüle

@@ -7,9 +7,8 @@ using Microsoft.Toolkit.Mvvm.ComponentModel;
using System.Collections.Concurrent;
using System.Collections.ObjectModel;
using System.Windows;
using BPASmartClient.Helper;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;

using System.Threading;
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.CustomResource.UserControls.MessageShow;
@@ -34,7 +33,7 @@ namespace BPASmartClient.DosingSystem.ViewModel
{
Recipes.ElementAt(index).IsEnable = false;
}
MessageLog.GetInstance.ShowUserLog($"下发工单 {Recipes.ElementAt(index).RecipeName}");
MessageNotify.GetInstance.ShowUserLog($"下发工单 {Recipes.ElementAt(index).RecipeName}");
devices.Enqueue(deviceName);
var res = Recipes.FirstOrDefault(p => p.RecipeName == deviceName);
UserTreeWait.Add(new RecipeModel { RecipeName = deviceName, RawMaterials = res.RawMaterials });
@@ -42,7 +41,7 @@ namespace BPASmartClient.DosingSystem.ViewModel


NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"配方下发成功!");
MessageLog.GetInstance.ShowUserLog($"下发工单 {Guid.NewGuid().ToString()}");
MessageNotify.GetInstance.ShowUserLog($"下发工单 {Guid.NewGuid().ToString()}");
});

ChangeRecipeStateCommand = new RelayCommand<object>(ChangeRecipeState);
@@ -129,7 +128,7 @@ namespace BPASmartClient.DosingSystem.ViewModel
for (int n = 0; n < recipeProcesses.Count; n++)
{
DeviceInquire.GetInstance.GetDevice(Recipes.ElementAt(recipIndex).RawMaterials.ElementAt(n).DeviceIp).StatusReset();//完成配料的设备运行状态地址写0
MessageLog.GetInstance.ShowRunLog(Recipes.ElementAt(recipIndex).RawMaterials.ElementAt(n).DeviceIp);
MessageNotify.GetInstance.ShowRunLog(Recipes.ElementAt(recipIndex).RawMaterials.ElementAt(n).DeviceIp);
}
App.Current.Dispatcher.Invoke(new Action(() => { recipeProcesses.Clear(); }));
Recipes.ElementAt(recipIndex).IsEnable = true;


+ 5
- 5
DosingSystem/ViewModel/RecipeSettingsViewModel.cs Dosyayı Görüntüle

@@ -7,7 +7,7 @@ using Microsoft.Toolkit.Mvvm.ComponentModel;
using System.Collections.Concurrent;
using System.Collections.ObjectModel;
using System.Windows;
using BPASmartClient.Helper;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.DosingSystem.View;
using BPASmartClient.CustomResource.UserControls;
@@ -35,25 +35,25 @@ namespace BPASmartClient.DosingSystem.ViewModel
{
NewRecipeView nrv = new NewRecipeView();
nrv.ShowDialog();
MessageLog.GetInstance.ShowUserLog("新建配方");
MessageNotify.GetInstance.ShowUserLog("新建配方");
});
SaveRecipe = new RelayCommand(() =>
{
Json<LocaPar>.Save();
MessageLog.GetInstance.ShowUserLog("保存配方");
MessageNotify.GetInstance.ShowUserLog("保存配方");
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"配方保存成功!");
});
RemoveCommand = new RelayCommand<object>((o) =>
{
if (!string.IsNullOrEmpty(o?.ToString()))
{
if (MessageLog.GetInstance.ShowDialog($"是否删除【{o.ToString()}】配方,删除后数据将永久丢失!无法找回", DialogType.Warning))
if (MessageNotify.GetInstance.ShowDialog($"是否删除【{o.ToString()}】配方,删除后数据将永久丢失!无法找回", DialogType.Warning))
{
var res = Json<LocaPar>.Data.Recipes.FirstOrDefault(p => p.RecipeName == o.ToString());
if (res != null) Json<LocaPar>.Data.Recipes.Remove(res);
Json<LocaPar>.Save();
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"配方删除成功!");
MessageLog.GetInstance.ShowUserLog($"删除配方 {res.RecipeName}");
MessageNotify.GetInstance.ShowUserLog($"删除配方 {res.RecipeName}");
}
}
});


+ 2
- 2
FryPot_DosingSystem/App.xaml.cs Dosyayı Görüntüle

@@ -38,7 +38,7 @@ namespace FryPot_DosingSystem
if (res != null && res == true)
{
mv.Show();
MessageLog.GetInstance.ShowUserLog("用户登录");
MessageNotify.GetInstance.ShowUserLog("用户登录");
await Task.Run(()=> { DeviceOperate deviceOperate = DeviceOperate.GetInstance; });//开启实时PLC数据读取
DosingLogicControl logigControl = DosingLogicControl.GetInstance;//开启逻辑控制任务程序
HubHelper.GetInstance.Connect("192.168.1.20", 8089);
@@ -67,7 +67,7 @@ namespace FryPot_DosingSystem
{
base.OnExit(e);
Json<RecipeManage>.Save();
MessageLog.GetInstance.LogSave();
MessageNotify.GetInstance.LogSave();
}
private void MenuInite()
{


+ 15
- 15
FryPot_DosingSystem/Control/DeviceOperate.cs Dosyayı Görüntüle

@@ -130,19 +130,19 @@ namespace FryPot_DosingSystem.Control
}
}
IsConfig = true;
MessageLog.GetInstance.ShowRunLog("PLC变量配置加载成功");
MessageNotify.GetInstance.ShowRunLog("PLC变量配置加载成功");
}
catch (Exception)
{
IsConfig = false;
MessageLog.GetInstance.ShowRunLog("PLC变量配置加载错误,请重新配置并重启软件");
MessageNotify.GetInstance.ShowRunLog("PLC变量配置加载错误,请重新配置并重启软件");
//throw;
}
}
else
{
IsConfig = false;
MessageLog.GetInstance.ShowRunLog("PLC变量配置加载失败:文件无数据,请重新配置并重启软件");
MessageNotify.GetInstance.ShowRunLog("PLC变量配置加载失败:文件无数据,请重新配置并重启软件");
}
//Variables.Add(new PlcVariableModel() { Address = "D2001", Length = 8 });//1号线体滚筒工位号
//Variables.Add(new PlcVariableModel() { Address = "D2011", Length = 8 });//2号线体滚筒工位号
@@ -180,12 +180,12 @@ namespace FryPot_DosingSystem.Control
string DeviceName = devices.Devices[i].DeviceName;
switch (DeviceName)
{
case "滚筒输送线": modbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageLog.GetInstance.ShowRunLog("滚筒线PLC连接成功"); break;
case "炒锅1": fryOneModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageLog.GetInstance.ShowRunLog("1号炒锅PLC连接成功"); break;
case "炒锅2": fryTwoModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageLog.GetInstance.ShowRunLog("2号炒锅PLC连接成功"); break;
case "炒锅3": fryThreeModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageLog.GetInstance.ShowRunLog("3号炒锅PLC连接成功"); break;
case "炒锅4": fryFourModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageLog.GetInstance.ShowRunLog("4号炒锅PLC连接成功"); break;
case "炒锅5": fryFiveModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageLog.GetInstance.ShowRunLog("5号炒锅PLC连接成功"); break;
case "滚筒输送线": modbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageNotify.GetInstance.ShowRunLog("滚筒线PLC连接成功"); break;
case "炒锅1": fryOneModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageNotify.GetInstance.ShowRunLog("1号炒锅PLC连接成功"); break;
case "炒锅2": fryTwoModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageNotify.GetInstance.ShowRunLog("2号炒锅PLC连接成功"); break;
case "炒锅3": fryThreeModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageNotify.GetInstance.ShowRunLog("3号炒锅PLC连接成功"); break;
case "炒锅4": fryFourModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageNotify.GetInstance.ShowRunLog("4号炒锅PLC连接成功"); break;
case "炒锅5": fryFiveModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageNotify.GetInstance.ShowRunLog("5号炒锅PLC连接成功"); break;
}

}
@@ -225,7 +225,7 @@ namespace FryPot_DosingSystem.Control
DeviceManage devices = Json<DeviceManage>.Data;
var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "滚筒输送线");
if (res != null)
modbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageLog.GetInstance.ShowRunLog("滚筒线PLC重连成功");
modbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageNotify.GetInstance.ShowRunLog("滚筒线PLC重连成功");
}
Thread.Sleep(10);
}), $"滚筒线实时数据读取线程");
@@ -259,7 +259,7 @@ namespace FryPot_DosingSystem.Control
DeviceManage devices = Json<DeviceManage>.Data;
var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "炒锅1");
if (res != null)
modbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageLog.GetInstance.ShowRunLog("1号炒锅PLC重连成功");
modbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageNotify.GetInstance.ShowRunLog("1号炒锅PLC重连成功");
}
Thread.Sleep(10);
}), $"炒锅1实时数据读取线程");
@@ -289,7 +289,7 @@ namespace FryPot_DosingSystem.Control
DeviceManage devices = Json<DeviceManage>.Data;
var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "炒锅2");
if (res != null)
modbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageLog.GetInstance.ShowRunLog("2号炒锅PLC重连成功");
modbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageNotify.GetInstance.ShowRunLog("2号炒锅PLC重连成功");
}
Thread.Sleep(10);
}), $"炒锅2实时数据读取线程");
@@ -319,7 +319,7 @@ namespace FryPot_DosingSystem.Control
DeviceManage devices = Json<DeviceManage>.Data;
var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "炒锅3");
if (res != null)
modbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageLog.GetInstance.ShowRunLog("3号炒锅PLC重连成功");
modbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageNotify.GetInstance.ShowRunLog("3号炒锅PLC重连成功");
}
Thread.Sleep(10);
}), $"炒锅3实时数据读取线程");
@@ -349,7 +349,7 @@ namespace FryPot_DosingSystem.Control
DeviceManage devices = Json<DeviceManage>.Data;
var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "炒锅4");
if (res != null)
modbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageLog.GetInstance.ShowRunLog("4号炒锅PLC重连成功");
modbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageNotify.GetInstance.ShowRunLog("4号炒锅PLC重连成功");
}
Thread.Sleep(10);
}), $"炒锅4实时数据读取线程");
@@ -379,7 +379,7 @@ namespace FryPot_DosingSystem.Control
DeviceManage devices = Json<DeviceManage>.Data;
var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "炒锅5");
if (res != null)
modbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageLog.GetInstance.ShowRunLog("5号炒锅PLC重连成功");
modbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageNotify.GetInstance.ShowRunLog("5号炒锅PLC重连成功");
}
Thread.Sleep(10);
}), $"炒锅5实时数据读取线程");


+ 122
- 122
FryPot_DosingSystem/Control/DosingLogicControl.cs Dosyayı Görüntüle

@@ -222,35 +222,35 @@ namespace FryPot_DosingSystem.Control
string errorCode = AGVHelper.GetInstance.AgvToLineOneLoadRoller(id);
if (errorCode == "SUCCESS")
{
MessageLog.GetInstance.ShowRunLog($"AGV任务下发成功");
MessageNotify.GetInstance.ShowRunLog($"AGV任务下发成功");
}
else if (errorCode == "Analysis Error")
{
MessageLog.GetInstance.ShowRunLog($"提示:AGV 调用API失败,请检查请求报文");
MessageNotify.GetInstance.ShowRunLog($"提示:AGV 调用API失败,请检查请求报文");
}
else
{
MessageLog.GetInstance.ShowRunLog($"提示:AGV任务下发失败,错误码:{errorCode}");
MessageNotify.GetInstance.ShowRunLog($"提示:AGV任务下发失败,错误码:{errorCode}");
}
}), "AgvDebug");

ActionManage.GetInstance.Register(() =>
{
MessageLog.GetInstance.ShowRunLog("清洗台卸桶完成");
MessageNotify.GetInstance.ShowRunLog("清洗台卸桶完成");

}, "AgvArriveCleanPlateLocCom");

ActionManage.GetInstance.Register(() =>
{
MessageLog.GetInstance.ShowRunLog("清洗台空桶在【4】号线卸桶完成");
MessageLog.GetInstance.ShowRunLog("【1】号线炒锅空桶在【4】号线卸桶完成");
MessageLog.GetInstance.ShowRunLog("【2】号线炒锅空桶在【4】号线卸桶完成");
MessageLog.GetInstance.ShowRunLog("【3】号线炒锅空桶在【4】号线卸桶完成");
MessageNotify.GetInstance.ShowRunLog("清洗台空桶在【4】号线卸桶完成");
MessageNotify.GetInstance.ShowRunLog("【1】号线炒锅空桶在【4】号线卸桶完成");
MessageNotify.GetInstance.ShowRunLog("【2】号线炒锅空桶在【4】号线卸桶完成");
MessageNotify.GetInstance.ShowRunLog("【3】号线炒锅空桶在【4】号线卸桶完成");

}, "AgvArriveLineFourLocCom");
ActionManage.GetInstance.Register(() =>
{
MessageLog.GetInstance.ShowRunLog("清洗台空桶装载完成");
MessageNotify.GetInstance.ShowRunLog("清洗台空桶装载完成");

}, "AgvArriveCleanPlateLocLoadCom");

@@ -1015,7 +1015,7 @@ namespace FryPot_DosingSystem.Control
//线体1任务上报
if (objData.state == "DONE" && objData.robotJobId == LFourrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指炒锅空桶下料
{
MessageLog.GetInstance.ShowRunLog("1号线炒锅空桶在4号线卸桶完成");
MessageNotify.GetInstance.ShowRunLog("1号线炒锅空桶在4号线卸桶完成");

if (globalVar.LFourRollerNum >= 8)
{
@@ -1033,7 +1033,7 @@ namespace FryPot_DosingSystem.Control
//线体2任务上报
if (objData.state == "DONE" && objData.robotJobId == LFiverobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指炒锅空桶下料
{
MessageLog.GetInstance.ShowRunLog("2号线炒锅空桶在4号线卸桶完成");
MessageNotify.GetInstance.ShowRunLog("2号线炒锅空桶在4号线卸桶完成");

if (globalVar.LFourRollerNum >= 8)
{
@@ -1050,7 +1050,7 @@ namespace FryPot_DosingSystem.Control
//线体3任务上报
if (objData.state == "DONE" && objData.robotJobId == LSixrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指炒锅空桶下料
{
MessageLog.GetInstance.ShowRunLog("3号线炒锅空桶在4号线卸桶完成");
MessageNotify.GetInstance.ShowRunLog("3号线炒锅空桶在4号线卸桶完成");

if (globalVar.LFourRollerNum >= 8)
{
@@ -1100,7 +1100,7 @@ namespace FryPot_DosingSystem.Control
if (objData.state == "DONE" && LSevenrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指从线体1到清戏台空桶下料
{
LSevenrobotJobId.Remove(objData.robotJobId);
MessageLog.GetInstance.ShowRunLog("线体【1】空桶在清洗台卸桶完成");
MessageNotify.GetInstance.ShowRunLog("线体【1】空桶在清洗台卸桶完成");
AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.No);
AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode], CartMotionTrajectory.qxt_hj);
AgvViewModel.GetInstance().Set停车桩(agvCode[objData.jobData.agvCode], IsBool.Yes);
@@ -1109,7 +1109,7 @@ namespace FryPot_DosingSystem.Control
if (objData.state == "DONE" && LEightrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指从线体2到清戏台空桶下料
{
LEightrobotJobId.Remove(objData.robotJobId);
MessageLog.GetInstance.ShowRunLog("线体【2】空桶在清洗台卸桶完成");
MessageNotify.GetInstance.ShowRunLog("线体【2】空桶在清洗台卸桶完成");
AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.No);
AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode], CartMotionTrajectory.qxt_hj);
AgvViewModel.GetInstance().Set停车桩(agvCode[objData.jobData.agvCode], IsBool.Yes);
@@ -1118,7 +1118,7 @@ namespace FryPot_DosingSystem.Control
if (objData.state == "DONE" && LNinerobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指从线体3到清戏台空桶下料
{
LNinerobotJobId.Remove(objData.robotJobId);
MessageLog.GetInstance.ShowRunLog("线体【3】空桶在清洗台卸桶完成");
MessageNotify.GetInstance.ShowRunLog("线体【3】空桶在清洗台卸桶完成");
AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.No);
AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode], CartMotionTrajectory.qxt_hj);
AgvViewModel.GetInstance().Set停车桩(agvCode[objData.jobData.agvCode], IsBool.Yes);
@@ -1128,7 +1128,7 @@ namespace FryPot_DosingSystem.Control
#region 清洗台到线体4
if (objData.state == "ROLLER_LOAD_FINISH" && LTenrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料位置上料完成,指清戏台空桶到上料
{
MessageLog.GetInstance.ShowRunLog("清洗台空桶装载完成");
MessageNotify.GetInstance.ShowRunLog("清洗台空桶装载完成");
AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.OnllYes);
AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode], CartMotionTrajectory.hs_4);//去四号空桶线
AgvViewModel.GetInstance().SetCleanRollerNum(--CleanNum);
@@ -1143,7 +1143,7 @@ namespace FryPot_DosingSystem.Control
if (objData.state == "DONE" && LTenrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指清戏台空桶到线体4下料
{
LTenrobotJobId.Remove(objData.robotJobId);
MessageLog.GetInstance.ShowRunLog("【4】号线空桶回桶完成");
MessageNotify.GetInstance.ShowRunLog("【4】号线空桶回桶完成");
if (globalVar.LFourRollerNum >= 8)
{
AgvViewModel.GetInstance().Set滚筒线上数量(4, "8");
@@ -1175,7 +1175,7 @@ namespace FryPot_DosingSystem.Control
{
if (RTrig.GetInstance("ResetProgram").Start(globalVar.PlcInite == 1))//判断是否初始化 一初始化就重启主任务
{
MessageLog.GetInstance.ShowUserLog("主任务正在重启");
MessageNotify.GetInstance.ShowUserLog("主任务正在重启");

ThreadManage.GetInstance().StopTask("MainViewReadPlcData", new Action(() =>
{
@@ -1193,7 +1193,7 @@ namespace FryPot_DosingSystem.Control
ReicpeNum = 0;
ReadPlcData();
MainTask();
MessageLog.GetInstance.ShowUserLog("主任务重启完成");
MessageNotify.GetInstance.ShowUserLog("主任务重启完成");
}));
}));

@@ -1234,7 +1234,7 @@ namespace FryPot_DosingSystem.Control
globalVar.agvLineOneLoadCom = false;

ThreadManage.GetInstance().StartLong(new Action(() => { LineOneProcessExecute(); Thread.Sleep(10); }), "滚筒线1任务线程");
MessageLog.GetInstance.ShowUserLog("滚筒线【1】任务重启成功");
MessageNotify.GetInstance.ShowUserLog("滚筒线【1】任务重启成功");
}));
}
public void LineTwoTaskRestart()
@@ -1266,7 +1266,7 @@ namespace FryPot_DosingSystem.Control
globalVar.agvLineTwoLoadCom = false;

ThreadManage.GetInstance().StartLong(new Action(() => { LineTwoProcessExecute(); Thread.Sleep(10); }), "滚筒线2任务线程");
MessageLog.GetInstance.ShowUserLog("滚筒线【2】任务重启成功");
MessageNotify.GetInstance.ShowUserLog("滚筒线【2】任务重启成功");
}));
}
public void LineThreeTaskRestart()
@@ -1295,7 +1295,7 @@ namespace FryPot_DosingSystem.Control
globalVar.LThreeagvFryPotEmptyRollerArrive = false;
globalVar.agvLineThreeLoadCom = false;
ThreadManage.GetInstance().StartLong(new Action(() => { LineThreeProcessExecute(); Thread.Sleep(10); }), "滚筒线3任务线程");
MessageLog.GetInstance.ShowUserLog("滚筒线【3】任务重启成功");
MessageNotify.GetInstance.ShowUserLog("滚筒线【3】任务重启成功");
}));
}

@@ -1315,7 +1315,7 @@ namespace FryPot_DosingSystem.Control
globalVar.agvArriveLineOneLoadEmptyRoller = false;
globalVar.agvArriveLineOneLoadCom = false;
ThreadManage.GetInstance().StartLong(new Action(() => { LineOneToCleanProcessExecute(); Thread.Sleep(10); }), "滚筒线1空桶清洗任务线程");
MessageLog.GetInstance.ShowUserLog("滚筒线【1】空桶清洗任务重启成功");
MessageNotify.GetInstance.ShowUserLog("滚筒线【1】空桶清洗任务重启成功");
}));
}

@@ -1339,7 +1339,7 @@ namespace FryPot_DosingSystem.Control
globalVar.agvArriveLineTwoLoadEmptyRoller = false;
globalVar.agvArriveLineTwoLoadCom = false;
ThreadManage.GetInstance().StartLong(new Action(() => { LineTwoToCleanProcessExecute(); Thread.Sleep(10); }), "滚筒线2空桶清洗任务线程");
MessageLog.GetInstance.ShowUserLog("滚筒线【2】空桶清洗任务重启成功");
MessageNotify.GetInstance.ShowUserLog("滚筒线【2】空桶清洗任务重启成功");
}));
}

@@ -1359,7 +1359,7 @@ namespace FryPot_DosingSystem.Control
globalVar.agvArriveLineThreeLoadEmptyRoller = false;
globalVar.agvArriveLineThreeLoadCom = false;
ThreadManage.GetInstance().StartLong(new Action(() => { LineThreeToCleanProcessExecute(); Thread.Sleep(10); }), "滚筒线3空桶清洗任务线程");
MessageLog.GetInstance.ShowUserLog("滚筒线【3】空桶清洗任务重启成功");
MessageNotify.GetInstance.ShowUserLog("滚筒线【3】空桶清洗任务重启成功");
}));
}
/// <summary>
@@ -1981,7 +1981,7 @@ namespace FryPot_DosingSystem.Control
if (obj != null && obj is NewRecipeModel[] recipes)
{
ReicpeNum = ReicpeNum + recipes.Length;
MessageLog.GetInstance.ShowUserLog($"新接收到{recipes.Length}个配方,总共{ReicpeNum}个配方");
MessageNotify.GetInstance.ShowUserLog($"新接收到{recipes.Length}个配方,总共{ReicpeNum}个配方");
for (int i = 0; i < recipes.Length; i++)
{
int? res = recipes[i].materialCollection.ElementAt(0).MaterialLoc / 100;
@@ -2122,7 +2122,7 @@ namespace FryPot_DosingSystem.Control
if (globalVar.agvArriveCleanLoad)
{
globalVar.agvArriveCleanLoad = false;
MessageLog.GetInstance.ShowRunLog("AGV到达清洗台空桶上料位置");
MessageNotify.GetInstance.ShowRunLog("AGV到达清洗台空桶上料位置");
erp: if (AlarmHelper<AlarmInfo>.GetInstance().CleanOutputRollerRunning == 0)
{
//plc交互
@@ -2137,7 +2137,7 @@ namespace FryPot_DosingSystem.Control
if (globalVar.ExitLineOneTask)
return;
}
MessageLog.GetInstance.ShowRunLog("清洗台空桶出桶滚筒重新运行!!");
MessageNotify.GetInstance.ShowRunLog("清洗台空桶出桶滚筒重新运行!!");
goto erp;
}
}
@@ -2277,7 +2277,7 @@ namespace FryPot_DosingSystem.Control
if (globalVar.rollerLineOne.agvArriveCleanUnLoad)
{
globalVar.rollerLineOne.agvArriveCleanUnLoad = false;
MessageLog.GetInstance.ShowRunLog("空桶从线体1到达清洗位置,准备卸桶");
MessageNotify.GetInstance.ShowRunLog("空桶从线体1到达清洗位置,准备卸桶");

erp: if (AlarmHelper<AlarmInfo>.GetInstance().CleanEnterRollerRunning == 0)
{
@@ -2293,7 +2293,7 @@ namespace FryPot_DosingSystem.Control
if (globalVar.ExitLineOneTask)
return;
}
MessageLog.GetInstance.ShowRunLog("清洗台空桶进桶滚筒重新运行!!");
MessageNotify.GetInstance.ShowRunLog("清洗台空桶进桶滚筒重新运行!!");
goto erp;
}
}
@@ -2309,7 +2309,7 @@ namespace FryPot_DosingSystem.Control
if (globalVar.rollerLineTwo.agvArriveCleanUnLoad)
{
globalVar.rollerLineTwo.agvArriveCleanUnLoad = false;
MessageLog.GetInstance.ShowRunLog("空桶从线体2到达清洗位置,准备卸桶");
MessageNotify.GetInstance.ShowRunLog("空桶从线体2到达清洗位置,准备卸桶");

erp: if (AlarmHelper<AlarmInfo>.GetInstance().CleanEnterRollerRunning == 0)
{
@@ -2325,7 +2325,7 @@ namespace FryPot_DosingSystem.Control
if (globalVar.ExitLineOneTask)
return;
}
MessageLog.GetInstance.ShowRunLog("清洗台空桶进桶滚筒重新运行!!");
MessageNotify.GetInstance.ShowRunLog("清洗台空桶进桶滚筒重新运行!!");
goto erp;
}
}
@@ -2341,7 +2341,7 @@ namespace FryPot_DosingSystem.Control
if (globalVar.rollerLineThree.agvArriveCleanUnLoad)
{
globalVar.rollerLineThree.agvArriveCleanUnLoad = false;
MessageLog.GetInstance.ShowRunLog("空桶从线体3到达清洗位置,准备卸桶");
MessageNotify.GetInstance.ShowRunLog("空桶从线体3到达清洗位置,准备卸桶");
erp: if (AlarmHelper<AlarmInfo>.GetInstance().CleanEnterRollerRunning == 0)
{
//plc交互
@@ -2356,7 +2356,7 @@ namespace FryPot_DosingSystem.Control
if (globalVar.ExitLineOneTask)
return;
}
MessageLog.GetInstance.ShowRunLog("清洗台空桶进桶滚筒重新运行!!");
MessageNotify.GetInstance.ShowRunLog("清洗台空桶进桶滚筒重新运行!!");
goto erp;
}
////plc交互
@@ -2385,11 +2385,11 @@ namespace FryPot_DosingSystem.Control
string info = AGVHelper.GetInstance.AgvFromCleanToLineFourUnLoadRoller(id);
LTenrobotJobId.Add(id);
//Thread.Sleep(500);
MessageLog.GetInstance.ShowRunLog("清洗台呼叫AGV取桶");
MessageNotify.GetInstance.ShowRunLog("清洗台呼叫AGV取桶");
if (!CleanToLineCarryTaskErrorCodeAnalysis(info, 4))
{
LTenrobotJobId.Remove(id);
MessageLog.GetInstance.ShowRunLog("清洗台呼叫AGV取桶失败");
MessageNotify.GetInstance.ShowRunLog("清洗台呼叫AGV取桶失败");
}
}
}
@@ -2404,7 +2404,7 @@ namespace FryPot_DosingSystem.Control
globalVar.rollerLineThree.RecipeComMidSingle = 1;
if (globalVar.LThreeCurrentRecipeName != string.Empty)
{
MessageLog.GetInstance.ShowUserLog($"【3】号滚筒线【{globalVar.LThreeCurrentRecipeName}】 配方制作完成");
MessageNotify.GetInstance.ShowUserLog($"【3】号滚筒线【{globalVar.LThreeCurrentRecipeName}】 配方制作完成");
if (globalVar.LThreeFryPotSerial == 3)
{
FryPotMonitorManage.GetInstance.fryThree.TotalProduct++;
@@ -2436,7 +2436,7 @@ namespace FryPot_DosingSystem.Control
globalVar.LThreeCurrentRecipeName = result.RecipeName;

AgvViewModel.GetInstance().Set滚筒线上数量(3, globalVar.LThreeMaterialNum.ToString());
MessageLog.GetInstance.ShowUserLog($"【3】号滚筒线开始制作【{result.RecipeName}】 配方");
MessageNotify.GetInstance.ShowUserLog($"【3】号滚筒线开始制作【{result.RecipeName}】 配方");
for (int i = 0; i < result.materialCollection.Count; i++) //遍历单个配方中所有物料
{
if (result.materialCollection[i].MaterialLoc % 100 == i + 1 && result.materialCollection[i].MaterialLoc / 100 == headNum && headNum == 3)
@@ -2453,8 +2453,8 @@ namespace FryPot_DosingSystem.Control
}
else
{
MessageLog.GetInstance.ShowRunLog($"【3】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作");
MessageLog.GetInstance.ShowUserLog($"【3】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作");
MessageNotify.GetInstance.ShowRunLog($"【3】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作");
MessageNotify.GetInstance.ShowUserLog($"【3】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作");
LThreeInputMaterialQuene.Clear();
LThreeErrorRecipe = true;
return;
@@ -2479,7 +2479,7 @@ namespace FryPot_DosingSystem.Control
globalVar.rollerLineTwo.RecipeComMidSingle = 1;
if (globalVar.LTwoCurrentRecipeName != string.Empty)
{
MessageLog.GetInstance.ShowUserLog($"【2】号滚筒线【{globalVar.LTwoCurrentRecipeName}】 配方制作完成");
MessageNotify.GetInstance.ShowUserLog($"【2】号滚筒线【{globalVar.LTwoCurrentRecipeName}】 配方制作完成");
if (globalVar.LTwoFryPotSerial == 2)
{
FryPotMonitorManage.GetInstance.fryTwo.TotalProduct++;
@@ -2531,7 +2531,7 @@ namespace FryPot_DosingSystem.Control
globalVar.LTwoFryPotSerial = headNum;
globalVar.LTwoCurrentRecipeName = result.RecipeName;
AgvViewModel.GetInstance().Set滚筒线上数量(2, globalVar.LTwoMaterialNum.ToString());
MessageLog.GetInstance.ShowUserLog($"【2】号滚筒线开始制作【{result.RecipeName}】 配方");
MessageNotify.GetInstance.ShowUserLog($"【2】号滚筒线开始制作【{result.RecipeName}】 配方");
for (int i = 0; i < result.materialCollection.Count; i++) //遍历单个配方中所有物料
{
if (result.materialCollection[i].MaterialLoc % 100 == i + 1 && result.materialCollection[i].MaterialLoc / 100 == headNum && (headNum == 2 || headNum == 5))
@@ -2556,8 +2556,8 @@ namespace FryPot_DosingSystem.Control
}
else
{
MessageLog.GetInstance.ShowRunLog($"【2】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作");
MessageLog.GetInstance.ShowUserLog($"【2】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作");
MessageNotify.GetInstance.ShowRunLog($"【2】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作");
MessageNotify.GetInstance.ShowUserLog($"【2】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作");
LTwoInputMaterialQuene.Clear();
LTwoErrorRecipe = true;
return;
@@ -2579,7 +2579,7 @@ namespace FryPot_DosingSystem.Control
globalVar.rollerLineOne.RecipeComMidSingle = 1;
if (globalVar.LOneCurrentRecipeName != string.Empty)
{
MessageLog.GetInstance.ShowUserLog($"【1】号滚筒线【{globalVar.LOneCurrentRecipeName}】 配方制作完成");
MessageNotify.GetInstance.ShowUserLog($"【1】号滚筒线【{globalVar.LOneCurrentRecipeName}】 配方制作完成");
if (globalVar.LOneFryPotSerial == 1)
{
FryPotMonitorManage.GetInstance.fryOne.TotalProduct++;
@@ -2628,7 +2628,7 @@ namespace FryPot_DosingSystem.Control
globalVar.LOneFryPotSerial = headNum;
globalVar.LOneCurrentRecipeName = result.RecipeName;
AgvViewModel.GetInstance().Set滚筒线上数量(1, globalVar.LOneMaterialNum.ToString());
MessageLog.GetInstance.ShowUserLog($"【1】号滚筒线开始制作【{result.RecipeName}】 配方");
MessageNotify.GetInstance.ShowUserLog($"【1】号滚筒线开始制作【{result.RecipeName}】 配方");
for (int i = 0; i < result.materialCollection.Count; i++) //遍历单个配方中所有物料
{
if (result.materialCollection.Count <= 8 && result.materialCollection[i].MaterialLoc % 100 == i + 1 && result.materialCollection[i].MaterialLoc / 100 == headNum && (headNum == 1 || headNum == 4))
@@ -2653,8 +2653,8 @@ namespace FryPot_DosingSystem.Control
}
else
{
MessageLog.GetInstance.ShowRunLog($"【1】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作");
MessageLog.GetInstance.ShowUserLog($"【1】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作");
MessageNotify.GetInstance.ShowRunLog($"【1】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作");
MessageNotify.GetInstance.ShowUserLog($"【1】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作");
InputMaterialQuene.Clear();
ErrorRecipe = true;
return;
@@ -2768,7 +2768,7 @@ namespace FryPot_DosingSystem.Control
{
globalVar.rollerLineOne.CanRun = true;
globalVar.agvLineOneLoadCom = false;
MessageLog.GetInstance.ShowRunLog("AGV在【1】号滚筒线装桶完成");
MessageNotify.GetInstance.ShowRunLog("AGV在【1】号滚筒线装桶完成");
}
}

@@ -2794,7 +2794,7 @@ namespace FryPot_DosingSystem.Control
{
globalVar.rollerLineTwo.CanRun = true;
globalVar.agvLineTwoLoadCom = false;
MessageLog.GetInstance.ShowRunLog("AGV在【2】号滚筒线装桶完成");
MessageNotify.GetInstance.ShowRunLog("AGV在【2】号滚筒线装桶完成");
}
}

@@ -2820,7 +2820,7 @@ namespace FryPot_DosingSystem.Control
{
globalVar.rollerLineThree.CanRun = true;
globalVar.agvLineThreeLoadCom = false;
MessageLog.GetInstance.ShowRunLog("AGV在【3】号滚筒线装桶完成");
MessageNotify.GetInstance.ShowRunLog("AGV在【3】号滚筒线装桶完成");
}
}
/// <summary>
@@ -2864,7 +2864,7 @@ namespace FryPot_DosingSystem.Control
// AgvViewModel.GetInstance().Set小车运动(1, CartMotionTrajectory.yc_1_4);
//}

MessageLog.GetInstance.ShowRunLog($"AGV到达【{globalVar.LOneFryPotSerial}】号炒锅下料位置");
MessageNotify.GetInstance.ShowRunLog($"AGV到达【{globalVar.LOneFryPotSerial}】号炒锅下料位置");
AgvArriveFryPotOneOrFourSingleSetDown();
globalVar.agvArriveUnLoad = false;
globalVar.PotOneInputMaterialArrive = true;
@@ -2929,7 +2929,7 @@ namespace FryPot_DosingSystem.Control
//{
// AgvViewModel.GetInstance().Set小车运动(2, CartMotionTrajectory.yc_2_5);
//}
MessageLog.GetInstance.ShowRunLog($"AGV到达【{globalVar.LTwoFryPotSerial}】号炒锅下料位置");
MessageNotify.GetInstance.ShowRunLog($"AGV到达【{globalVar.LTwoFryPotSerial}】号炒锅下料位置");
AgvArriveFryPotTwoOrFiveSingleSetDown();
globalVar.LTwoagvArriveUnLoad = false;
globalVar.LTwoPotInputMaterialArrive = true;
@@ -2986,7 +2986,7 @@ namespace FryPot_DosingSystem.Control
if (LThreeOutputMaterialQuene.Count > 0 && globalVar.LThreeagvArriveUnLoad && globalVar.LThreeAgvToFryPot && !globalVar.LThreePotInputMaterialArrive)
{
// AgvViewModel.GetInstance().Set小车运动(3, CartMotionTrajectory.yc_3_3);
MessageLog.GetInstance.ShowRunLog("AGV到达【3】号炒锅下料位置");
MessageNotify.GetInstance.ShowRunLog("AGV到达【3】号炒锅下料位置");
AgvArriveFryPotThreeSingleSetDown();
globalVar.LThreeagvArriveUnLoad = false;
globalVar.LThreePotInputMaterialArrive = true;
@@ -3062,7 +3062,7 @@ namespace FryPot_DosingSystem.Control
if (OutputMaterialQuene.Count > 0 && globalVar.InOrOutputLock && globalVar.agvArriveUpLoad && globalVar.PotOneOutputRollerArrive && !globalVar.AgvArrivePot)
{

MessageLog.GetInstance.ShowRunLog($"AGV到达【{globalVar.LOneFryPotSerial}】号炒锅空桶上料位置");
MessageNotify.GetInstance.ShowRunLog($"AGV到达【{globalVar.LOneFryPotSerial}】号炒锅空桶上料位置");
AgvArriveFryPotOneOrFourOutEmptyRollerSingleSetDown();//暂时考虑agv送完料后原地等待,不加条件,直接发送到位信号
globalVar.agvArriveUpLoad = false;
globalVar.AgvArrivePot = true;
@@ -3094,7 +3094,7 @@ namespace FryPot_DosingSystem.Control
//}
globalVar.agvFryPotEmptyRollerArrive = false;
globalVar.InOrOutputLock = false;
MessageLog.GetInstance.ShowRunLog($"AGV在【{globalVar.LOneFryPotSerial}】号炒锅将空桶回收到4号滚筒线");
MessageNotify.GetInstance.ShowRunLog($"AGV在【{globalVar.LOneFryPotSerial}】号炒锅将空桶回收到4号滚筒线");
//AGV拿到空桶,让AGV运桶到指定位置,同时可以让下一个AGV从线体装料运到炒锅
globalVar.AllowAgvToLineLoadRoller = true;
globalVar.LoadRoller = false;
@@ -3119,7 +3119,7 @@ namespace FryPot_DosingSystem.Control
if (LTwoOutputMaterialQuene.Count > 0 && globalVar.LTwoInOrOutputLock && globalVar.agvArriveLTwoUpLoad && globalVar.LTwoPotOutputRollerArrive && !globalVar.LTwoAgvArrivePot)
{

MessageLog.GetInstance.ShowRunLog($"AGV到达【{globalVar.LTwoFryPotSerial}】号炒锅空桶上料位置");
MessageNotify.GetInstance.ShowRunLog($"AGV到达【{globalVar.LTwoFryPotSerial}】号炒锅空桶上料位置");
AgvArriveFryPotTwoOrFiveOutEmptyRollerSingleSetDown();//暂时考虑agv送完料后原地等待,不加条件,直接发送到位信号
globalVar.agvArriveLTwoUpLoad = false;
globalVar.LTwoAgvArrivePot = true;
@@ -3151,7 +3151,7 @@ namespace FryPot_DosingSystem.Control
globalVar.LTwoagvFryPotEmptyRollerArrive = false;
globalVar.LTwoInOrOutputLock = false;

MessageLog.GetInstance.ShowRunLog($"AGV在【{globalVar.LTwoFryPotSerial}】号炒锅将空桶回收到4号滚筒线");
MessageNotify.GetInstance.ShowRunLog($"AGV在【{globalVar.LTwoFryPotSerial}】号炒锅将空桶回收到4号滚筒线");
//AGV拿到空桶,让AGV运桶到指定位置,同时可以让下一个AGV从线体装料运到炒锅
globalVar.AllowAgvToLineTwoLoadRoller = true;
globalVar.LTwoLoadRoller = false;
@@ -3173,7 +3173,7 @@ namespace FryPot_DosingSystem.Control
{
if (LThreeOutputMaterialQuene.Count > 0 && globalVar.LThreeInOrOutputLock && globalVar.agvArriveLThreeUpLoad && globalVar.LThreePotOutputRollerArrive && !globalVar.LThreeAgvArrivePot)
{
MessageLog.GetInstance.ShowRunLog($"AGV到达【{globalVar.LThreeFryPotSerial}】号炒锅空桶上料位置");
MessageNotify.GetInstance.ShowRunLog($"AGV到达【{globalVar.LThreeFryPotSerial}】号炒锅空桶上料位置");
AgvArriveFryPotThreeOutEmptyRollerSingleSetDown();//暂时考虑agv送完料后原地等待,不加条件,直接发送到位信号
globalVar.agvArriveLThreeUpLoad = false;
globalVar.LThreeAgvArrivePot = true;
@@ -3197,7 +3197,7 @@ namespace FryPot_DosingSystem.Control
globalVar.LThreeagvFryPotEmptyRollerArrive = false;
globalVar.LThreeInOrOutputLock = false;

MessageLog.GetInstance.ShowRunLog($"AGV在【{globalVar.LThreeFryPotSerial}】号炒锅将空桶回收到4号滚筒线");
MessageNotify.GetInstance.ShowRunLog($"AGV在【{globalVar.LThreeFryPotSerial}】号炒锅将空桶回收到4号滚筒线");
//AGV拿到空桶,让AGV运桶到指定位置,同时可以让下一个AGV从线体装料运到炒锅
globalVar.AllowAgvToLineThreeLoadRoller = true;
globalVar.LThreeLoadRoller = false;
@@ -3224,7 +3224,7 @@ namespace FryPot_DosingSystem.Control
globalVar.agvArriveLineFour = false;
//线体四信号交互
WritePlcData("D1067", 1);//AGV空桶回桶就位信号下发PLC
MessageLog.GetInstance.ShowRunLog("AGV从清洗台到达【4】号回收线体,准备卸桶");
MessageNotify.GetInstance.ShowRunLog("AGV从清洗台到达【4】号回收线体,准备卸桶");
// MessageLog.GetInstance.ShowRunLog("卸桶完成");
}

@@ -3237,7 +3237,7 @@ namespace FryPot_DosingSystem.Control
globalVar.rollerLineOne.agvArriveLineFour = false;
//线体四信号交互
WritePlcData("D1067", 1);//AGV空桶回桶就位信号下发PLC
MessageLog.GetInstance.ShowRunLog("AGV从1号线体对应炒锅到达【4】号回收线体,准备卸桶");
MessageNotify.GetInstance.ShowRunLog("AGV从1号线体对应炒锅到达【4】号回收线体,准备卸桶");
// MessageLog.GetInstance.ShowRunLog("卸桶完成");
}
if (globalVar.rollerLineTwo.agvArriveLineFour)//agv到达线体4下料位置
@@ -3245,7 +3245,7 @@ namespace FryPot_DosingSystem.Control
globalVar.rollerLineTwo.agvArriveLineFour = false;
//线体四信号交互
WritePlcData("D1067", 1);//AGV空桶回桶就位信号下发PLC
MessageLog.GetInstance.ShowRunLog("AGV从2号线体对应炒锅到达【4】号回收线体,准备卸桶");
MessageNotify.GetInstance.ShowRunLog("AGV从2号线体对应炒锅到达【4】号回收线体,准备卸桶");
// MessageLog.GetInstance.ShowRunLog("卸桶完成");
}
if (globalVar.rollerLineThree.agvArriveLineFour)//agv到达线体4下料位置
@@ -3253,7 +3253,7 @@ namespace FryPot_DosingSystem.Control
globalVar.rollerLineThree.agvArriveLineFour = false;
//线体四信号交互
WritePlcData("D1067", 1);//AGV空桶回桶就位信号下发PLC
MessageLog.GetInstance.ShowRunLog("AGV从3号炒锅到达【4】号回收线体,准备卸桶");
MessageNotify.GetInstance.ShowRunLog("AGV从3号炒锅到达【4】号回收线体,准备卸桶");
// MessageLog.GetInstance.ShowRunLog("卸桶完成");
}
}
@@ -3319,14 +3319,14 @@ namespace FryPot_DosingSystem.Control
// Thread.Sleep(5); if (globalVar.ExitMainTask)
// return;
//}
MessageLog.GetInstance.ShowRunLog($"炒锅【1】:【{OutputMaterialQuene.ElementAt(0).materialType.MaterialLoc}】号桶已到进料位置,准备倒料"); break;
MessageNotify.GetInstance.ShowRunLog($"炒锅【1】:【{OutputMaterialQuene.ElementAt(0).materialType.MaterialLoc}】号桶已到进料位置,准备倒料"); break;
case 4:
//while (globalVar.fryPotFour.InputMaterialArrivedSingle == 0)
//{
// Thread.Sleep(5); if (globalVar.ExitMainTask)
// return;
//}
MessageLog.GetInstance.ShowRunLog($"炒锅【4】:【{OutputMaterialQuene.ElementAt(0).materialType.MaterialLoc}】号桶已到进料位置,准备倒料"); break;
MessageNotify.GetInstance.ShowRunLog($"炒锅【4】:【{OutputMaterialQuene.ElementAt(0).materialType.MaterialLoc}】号桶已到进料位置,准备倒料"); break;
}
}
/// <summary>
@@ -3342,14 +3342,14 @@ namespace FryPot_DosingSystem.Control
// Thread.Sleep(5); if (globalVar.ExitMainTask)
// return;
//}
MessageLog.GetInstance.ShowRunLog($"炒锅【2】:【{LTwoOutputMaterialQuene.ElementAt(0).materialType.MaterialLoc}】号桶已到进料位置,准备倒料"); break;
MessageNotify.GetInstance.ShowRunLog($"炒锅【2】:【{LTwoOutputMaterialQuene.ElementAt(0).materialType.MaterialLoc}】号桶已到进料位置,准备倒料"); break;
case 5:
//while (globalVar.fryPotFive.InputMaterialArrivedSingle == 0)
//{
// Thread.Sleep(5); if (globalVar.ExitMainTask)
// return;
//}
MessageLog.GetInstance.ShowRunLog($"炒锅【5】:【{LTwoOutputMaterialQuene.ElementAt(0).materialType.MaterialLoc}】号桶已到进料位置,准备倒料"); break;
MessageNotify.GetInstance.ShowRunLog($"炒锅【5】:【{LTwoOutputMaterialQuene.ElementAt(0).materialType.MaterialLoc}】号桶已到进料位置,准备倒料"); break;
}
}
public void FryPotThreeInputMaterialRollerOperate()
@@ -3359,7 +3359,7 @@ namespace FryPot_DosingSystem.Control
// Thread.Sleep(5); if (globalVar.ExitMainTask)
// return;
//}
MessageLog.GetInstance.ShowRunLog($"炒锅【3】:【{LThreeOutputMaterialQuene.ElementAt(0).materialType.MaterialLoc}】号桶已到进料位置,准备倒料");
MessageNotify.GetInstance.ShowRunLog($"炒锅【3】:【{LThreeOutputMaterialQuene.ElementAt(0).materialType.MaterialLoc}】号桶已到进料位置,准备倒料");
}
/// <summary>
/// 炒锅滚筒空桶出桶处理
@@ -3419,14 +3419,14 @@ namespace FryPot_DosingSystem.Control
// Thread.Sleep(5); if (globalVar.ExitMainTask)
// return;
//}
MessageLog.GetInstance.ShowRunLog($"炒锅【1】原料:【{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}】空桶上料完成"); break;
MessageNotify.GetInstance.ShowRunLog($"炒锅【1】原料:【{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}】空桶上料完成"); break;
case 4:
//while (globalVar.fryPotFour.EmptyBarrelArrivedSingle == 0)
//{
// Thread.Sleep(5); if (globalVar.ExitMainTask)
// return;
//}
MessageLog.GetInstance.ShowRunLog($"炒锅【4】原料:【{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}】空桶上料完成"); break;
MessageNotify.GetInstance.ShowRunLog($"炒锅【4】原料:【{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}】空桶上料完成"); break;
}
}
/// <summary>
@@ -3442,14 +3442,14 @@ namespace FryPot_DosingSystem.Control
// Thread.Sleep(5); if (globalVar.ExitMainTask)
// return;
//}
MessageLog.GetInstance.ShowRunLog($"炒锅【2】原料:【{LTwoOutputMaterialQuene.ElementAt(0).materialType.MaterialName}】空桶上料完成"); break;
MessageNotify.GetInstance.ShowRunLog($"炒锅【2】原料:【{LTwoOutputMaterialQuene.ElementAt(0).materialType.MaterialName}】空桶上料完成"); break;
case 5:
//while (globalVar.fryPotFive.EmptyBarrelArrivedSingle == 0)
//{
// Thread.Sleep(5); if (globalVar.ExitMainTask)
// return;
//}
MessageLog.GetInstance.ShowRunLog($"炒锅【5】原料:【{LTwoOutputMaterialQuene.ElementAt(0).materialType.MaterialName}】空桶上料完成"); break;
MessageNotify.GetInstance.ShowRunLog($"炒锅【5】原料:【{LTwoOutputMaterialQuene.ElementAt(0).materialType.MaterialName}】空桶上料完成"); break;
}
}
/// <summary>
@@ -3462,7 +3462,7 @@ namespace FryPot_DosingSystem.Control
// Thread.Sleep(5); if (globalVar.ExitMainTask)
// return;
//}
MessageLog.GetInstance.ShowRunLog($"炒锅【3】原料:【{LThreeOutputMaterialQuene.ElementAt(0).materialType.MaterialName}】空桶上料完成");
MessageNotify.GetInstance.ShowRunLog($"炒锅【3】原料:【{LThreeOutputMaterialQuene.ElementAt(0).materialType.MaterialName}】空桶上料完成");
}
/// <summary>
/// 发送agv送料就位信号至PLC(线体到炒锅)
@@ -3610,7 +3610,7 @@ namespace FryPot_DosingSystem.Control
{
goto erp;
}
MessageLog.GetInstance.ShowRunLog("AGV执行【1】号炒锅空桶回收任务");
MessageNotify.GetInstance.ShowRunLog("AGV执行【1】号炒锅空桶回收任务");
string info = AGVHelper.GetInstance.AgvLeaveFryPotOne(id);
LFourrobotJobId = id;

@@ -3626,7 +3626,7 @@ namespace FryPot_DosingSystem.Control
{
goto erp3;
}
MessageLog.GetInstance.ShowRunLog("AGV执行【4】号炒锅空桶回收任务");
MessageNotify.GetInstance.ShowRunLog("AGV执行【4】号炒锅空桶回收任务");
string info3 = AGVHelper.GetInstance.AgvLeaveFryPotFour(id3);
LFourrobotJobId = id3;
if (!FryCarryTaskErrorCodeAnalysis(info3, 4))
@@ -3653,7 +3653,7 @@ namespace FryPot_DosingSystem.Control
{
goto erp1;
}
MessageLog.GetInstance.ShowRunLog("AGV执行【2】号炒锅空桶回收任务");
MessageNotify.GetInstance.ShowRunLog("AGV执行【2】号炒锅空桶回收任务");
string info1 = AGVHelper.GetInstance.AgvLeaveFryPotTwo(id1);
LFiverobotJobId = id1;

@@ -3669,7 +3669,7 @@ namespace FryPot_DosingSystem.Control
{
goto erp4;
}
MessageLog.GetInstance.ShowRunLog("AGV执行【5】号炒锅空桶回收任务");
MessageNotify.GetInstance.ShowRunLog("AGV执行【5】号炒锅空桶回收任务");
string info4 = AGVHelper.GetInstance.AgvLeaveFryPotFive(id4);
LFiverobotJobId = id4;

@@ -3693,7 +3693,7 @@ namespace FryPot_DosingSystem.Control
{
goto erp2;
}
MessageLog.GetInstance.ShowRunLog("AGV执行【3】号炒锅空桶回收任务");
MessageNotify.GetInstance.ShowRunLog("AGV执行【3】号炒锅空桶回收任务");
string info2 = AGVHelper.GetInstance.AgvLeaveFryPotThree(id2);
LSixrobotJobId = id2;

@@ -3715,11 +3715,11 @@ namespace FryPot_DosingSystem.Control
if (globalVar.agvArriveUpLoad && globalVar.LoadRoller && globalVar.rollerLineOne.StationEight == InputMaterialQuene.ElementAt(0).materialType.MaterialLoc && !globalVar.AgvToFryPot)//无故障
{

MessageLog.GetInstance.ShowRunLog("AGV到达【1】号滚筒线装桶位置");
MessageNotify.GetInstance.ShowRunLog("AGV到达【1】号滚筒线装桶位置");
AgvArriveLineSingelSetDown(InputMaterialQuene);
if (InputMaterialQuene.TryDequeue(out MaterialInfo materialInfo))
{
MessageLog.GetInstance.ShowRunLog($"AGV正在装载{materialInfo.materialType.MaterialLoc}号料桶");
MessageNotify.GetInstance.ShowRunLog($"AGV正在装载{materialInfo.materialType.MaterialLoc}号料桶");

globalVar.LOneCurrentCookingStep++;
OutputMaterialQuene.Enqueue(materialInfo);
@@ -3738,7 +3738,7 @@ namespace FryPot_DosingSystem.Control
if (globalVar.ExitLineOneTask)
return;
}
MessageLog.GetInstance.ShowRunLog("线体【1】滚筒故障解除,继续运行");
MessageNotify.GetInstance.ShowRunLog("线体【1】滚筒故障解除,继续运行");
//lineAlarm = 1;
goto erp;
}
@@ -3752,9 +3752,9 @@ namespace FryPot_DosingSystem.Control
{
if (globalVar.agvArriveLineOneLoadEmptyRoller)//agv到达上料位置
{
MessageLog.GetInstance.ShowRunLog("AGV到达【1】号滚筒线装桶位置");
MessageNotify.GetInstance.ShowRunLog("AGV到达【1】号滚筒线装桶位置");
DeviceOperate.GetInstance.WritePlcData("D1052", 1);//agv到达线体1上料位置信号下发plc
MessageLog.GetInstance.ShowRunLog($"AGV正在装载【{emptyRollerNum}】号空料桶");
MessageNotify.GetInstance.ShowRunLog($"AGV正在装载【{emptyRollerNum}】号空料桶");


globalVar.agvArriveLineOneLoadEmptyRoller = false;
@@ -3765,7 +3765,7 @@ namespace FryPot_DosingSystem.Control
globalVar.rollerLineOne.EmptyRollerNums.RemoveAt(0);
globalVar.agvArriveLineOneLoadCom = false;
globalVar.rollerLineOne.IsEpmtyBefore = false;
MessageLog.GetInstance.ShowRunLog($"AGV在【1】号线体完成【{emptyRollerNum}】号空料桶装载");
MessageNotify.GetInstance.ShowRunLog($"AGV在【1】号线体完成【{emptyRollerNum}】号空料桶装载");
}
}
else//有故障
@@ -3776,7 +3776,7 @@ namespace FryPot_DosingSystem.Control
if (globalVar.ExitLineOneTask)
return;
}
MessageLog.GetInstance.ShowRunLog("线体【1】滚筒故障解除,继续运行");
MessageNotify.GetInstance.ShowRunLog("线体【1】滚筒故障解除,继续运行");
//lineAlarm = 1;
goto erp;
}
@@ -3792,11 +3792,11 @@ namespace FryPot_DosingSystem.Control
{
if (globalVar.agvArriveLTwoUpLoad && globalVar.LTwoLoadRoller && globalVar.rollerLineTwo.StationEight == LTwoInputMaterialQuene.ElementAt(0).materialType.MaterialLoc && !globalVar.LTwoAgvToFryPot)//无故障
{
MessageLog.GetInstance.ShowRunLog("AGV到达【2】号滚筒线装桶位置");
MessageNotify.GetInstance.ShowRunLog("AGV到达【2】号滚筒线装桶位置");
AgvArriveLineSingelSetDown(LTwoInputMaterialQuene);
if (LTwoInputMaterialQuene.TryDequeue(out MaterialInfo materialInfo))
{
MessageLog.GetInstance.ShowRunLog($"AGV正在装载{materialInfo.materialType.MaterialLoc}号料桶");
MessageNotify.GetInstance.ShowRunLog($"AGV正在装载{materialInfo.materialType.MaterialLoc}号料桶");

globalVar.LTwoCurrentCookingStep++;
LTwoOutputMaterialQuene.Enqueue(materialInfo);
@@ -3817,7 +3817,7 @@ namespace FryPot_DosingSystem.Control
if (globalVar.ExitLineTwoTask)
return;
}
MessageLog.GetInstance.ShowRunLog("线体【2】滚筒故障解除,继续运行");
MessageNotify.GetInstance.ShowRunLog("线体【2】滚筒故障解除,继续运行");
// lineAlarm = 1;
goto erp;
}
@@ -3831,9 +3831,9 @@ namespace FryPot_DosingSystem.Control
{
if (globalVar.agvArriveLineTwoLoadEmptyRoller)//agv到达上料位置
{
MessageLog.GetInstance.ShowRunLog("AGV到达【2】号滚筒线装桶位置");
MessageNotify.GetInstance.ShowRunLog("AGV到达【2】号滚筒线装桶位置");
DeviceOperate.GetInstance.WritePlcData("D1053", 1);//agv到达线体2上料位置信号下发plc
MessageLog.GetInstance.ShowRunLog($"AGV正在装载【{emptyRollerNum}】号空料桶");
MessageNotify.GetInstance.ShowRunLog($"AGV正在装载【{emptyRollerNum}】号空料桶");


globalVar.agvArriveLineTwoLoadEmptyRoller = false;
@@ -3845,7 +3845,7 @@ namespace FryPot_DosingSystem.Control
globalVar.rollerLineTwo.EmptyRollerNums.RemoveAt(0);
globalVar.agvArriveLineTwoLoadCom = false;
globalVar.rollerLineTwo.IsEpmtyBefore = false;
MessageLog.GetInstance.ShowRunLog($"AGV在【2】号线体完成【{emptyRollerNum}】号空料桶装载");
MessageNotify.GetInstance.ShowRunLog($"AGV在【2】号线体完成【{emptyRollerNum}】号空料桶装载");
}
}
else//有故障
@@ -3856,7 +3856,7 @@ namespace FryPot_DosingSystem.Control
if (globalVar.ExitLineOneTask)
return;
}
MessageLog.GetInstance.ShowRunLog("线体【2】滚筒故障解除,继续运行");
MessageNotify.GetInstance.ShowRunLog("线体【2】滚筒故障解除,继续运行");
//lineAlarm = 1;
goto erp;
}
@@ -3872,11 +3872,11 @@ namespace FryPot_DosingSystem.Control
{
if (globalVar.agvArriveLThreeUpLoad && globalVar.LThreeLoadRoller && globalVar.rollerLineThree.StationEight == LThreeInputMaterialQuene.ElementAt(0).materialType.MaterialLoc && !globalVar.LThreeAgvToFryPot)//无故障
{
MessageLog.GetInstance.ShowRunLog("AGV到达【3】号滚筒线装桶位置");
MessageNotify.GetInstance.ShowRunLog("AGV到达【3】号滚筒线装桶位置");
AgvArriveLineSingelSetDown(LThreeInputMaterialQuene);
if (LThreeInputMaterialQuene.TryDequeue(out MaterialInfo materialInfo))
{
MessageLog.GetInstance.ShowRunLog($"AGV正在装载{materialInfo.materialType.MaterialLoc}号料桶");
MessageNotify.GetInstance.ShowRunLog($"AGV正在装载{materialInfo.materialType.MaterialLoc}号料桶");

globalVar.LThreeCurrentCookingStep++;
LThreeOutputMaterialQuene.Enqueue(materialInfo);
@@ -3897,7 +3897,7 @@ namespace FryPot_DosingSystem.Control
if (globalVar.ExitLineThreeTask)
return;
}
MessageLog.GetInstance.ShowRunLog("线体【3】滚筒故障解除,继续运行");
MessageNotify.GetInstance.ShowRunLog("线体【3】滚筒故障解除,继续运行");
// lineAlarm = 1;
goto erp;
}
@@ -3911,9 +3911,9 @@ namespace FryPot_DosingSystem.Control
{
if (globalVar.agvArriveLineThreeLoadEmptyRoller)//agv到达上料位置
{
MessageLog.GetInstance.ShowRunLog("AGV到达【3】号滚筒线装桶位置");
MessageNotify.GetInstance.ShowRunLog("AGV到达【3】号滚筒线装桶位置");
DeviceOperate.GetInstance.WritePlcData("D1054", 1);//agv到达线体3上料位置信号下发plc
MessageLog.GetInstance.ShowRunLog($"AGV正在装载【{emptyRollerNum}】号空料桶");
MessageNotify.GetInstance.ShowRunLog($"AGV正在装载【{emptyRollerNum}】号空料桶");


globalVar.agvArriveLineThreeLoadEmptyRoller = false;
@@ -3926,7 +3926,7 @@ namespace FryPot_DosingSystem.Control
globalVar.rollerLineThree.EmptyRollerNums.RemoveAt(0);
globalVar.agvArriveLineThreeLoadCom = false;
globalVar.rollerLineThree.IsEpmtyBefore = false;
MessageLog.GetInstance.ShowRunLog($"AGV在【3】号线体完成【{emptyRollerNum}】号空料桶装载");
MessageNotify.GetInstance.ShowRunLog($"AGV在【3】号线体完成【{emptyRollerNum}】号空料桶装载");
}
}
else//有故障
@@ -3937,7 +3937,7 @@ namespace FryPot_DosingSystem.Control
if (globalVar.ExitLineOneTask)
return;
}
MessageLog.GetInstance.ShowRunLog("线体【3】滚筒故障解除,继续运行");
MessageNotify.GetInstance.ShowRunLog("线体【3】滚筒故障解除,继续运行");
//lineAlarm = 1;
goto erp;
}
@@ -3952,17 +3952,17 @@ namespace FryPot_DosingSystem.Control
{
if (errorCode == "SUCCESS")
{
MessageLog.GetInstance.ShowRunLog($"AGV去{num}号滚筒线装桶");
MessageNotify.GetInstance.ShowRunLog($"AGV去{num}号滚筒线装桶");
return true;
}
else if (errorCode == "Analysis Error")
{
MessageLog.GetInstance.ShowRunLog($"提示:AGV去{num}号滚筒线API调用失败,请检查请求报文");
MessageNotify.GetInstance.ShowRunLog($"提示:AGV去{num}号滚筒线API调用失败,请检查请求报文");
return false;
}
else
{
MessageLog.GetInstance.ShowRunLog($"提示:AGV去{num}号滚筒线失败,错误码:{errorCode}");
MessageNotify.GetInstance.ShowRunLog($"提示:AGV去{num}号滚筒线失败,错误码:{errorCode}");
return false;
}
}
@@ -3975,17 +3975,17 @@ namespace FryPot_DosingSystem.Control
{
if (errorCode == "SUCCESS")
{
MessageLog.GetInstance.ShowRunLog($"AGV去{num}号滚筒线装空桶");
MessageNotify.GetInstance.ShowRunLog($"AGV去{num}号滚筒线装空桶");
return true;
}
else if (errorCode == "Analysis Error")
{
MessageLog.GetInstance.ShowRunLog($"提示:AGV去{num}号滚筒线API调用失败,请检查请求报文");
MessageNotify.GetInstance.ShowRunLog($"提示:AGV去{num}号滚筒线API调用失败,请检查请求报文");
return false;
}
else
{
MessageLog.GetInstance.ShowRunLog($"提示:AGV去{num}号滚筒线失败,错误码:{errorCode}");
MessageNotify.GetInstance.ShowRunLog($"提示:AGV去{num}号滚筒线失败,错误码:{errorCode}");
return false;
}
}
@@ -3998,17 +3998,17 @@ namespace FryPot_DosingSystem.Control
{
if (errorCode == "SUCCESS")
{
MessageLog.GetInstance.ShowRunLog($"AGV从清洗台到{num}号滚筒线卸桶");
MessageNotify.GetInstance.ShowRunLog($"AGV从清洗台到{num}号滚筒线卸桶");
return true;
}
else if (errorCode == "Analysis Error")
{
MessageLog.GetInstance.ShowRunLog($"提示:AGV去{num}号滚筒线API调用失败,请检查请求报文");
MessageNotify.GetInstance.ShowRunLog($"提示:AGV去{num}号滚筒线API调用失败,请检查请求报文");
return false;
}
else
{
MessageLog.GetInstance.ShowRunLog($"提示:AGV去{num}号滚筒线失败,错误码:{errorCode}");
MessageNotify.GetInstance.ShowRunLog($"提示:AGV去{num}号滚筒线失败,错误码:{errorCode}");
return false;
}
}
@@ -4021,17 +4021,17 @@ namespace FryPot_DosingSystem.Control
{
if (errorCode == "SUCCESS")
{
MessageLog.GetInstance.ShowRunLog($"AGV离开{num}号炒锅");
MessageNotify.GetInstance.ShowRunLog($"AGV离开{num}号炒锅");
return true;
}
else if (errorCode == "Analysis Error")
{
MessageLog.GetInstance.ShowRunLog($"提示:AGV离开{num}号炒锅接口调用失败,请检查");
MessageNotify.GetInstance.ShowRunLog($"提示:AGV离开{num}号炒锅接口调用失败,请检查");
return false;
}
else
{
MessageLog.GetInstance.ShowRunLog($"提示:AGV离开{num}号炒锅失败,错误码:{errorCode}");
MessageNotify.GetInstance.ShowRunLog($"提示:AGV离开{num}号炒锅失败,错误码:{errorCode}");
return false;
}
}
@@ -4454,7 +4454,7 @@ namespace FryPot_DosingSystem.Control
case 1:
if (AlarmHelper<AlarmInfo>.GetInstance().FryPotOneRollerTrouble == 1)
{
FryPotAlarm = -1; MessageLog.GetInstance.ShowRunLog("警告:炒锅【1】输送滚筒发生故障");
FryPotAlarm = -1; MessageNotify.GetInstance.ShowRunLog("警告:炒锅【1】输送滚筒发生故障");
}
else
{
@@ -4466,15 +4466,15 @@ namespace FryPot_DosingSystem.Control
Thread.Sleep(1000); if (globalVar.ExitLineOneTask)
return;
}
MessageLog.GetInstance.ShowRunLog("炒锅【1】输送滚筒故障解除,继续运行");
MessageNotify.GetInstance.ShowRunLog("炒锅【1】输送滚筒故障解除,继续运行");
FryPotAlarm = 1; break;
case 4:
if (AlarmHelper<AlarmInfo>.GetInstance().FryPotFourRollerTrouble == 1) { FryPotFourAlarm = -1; MessageLog.GetInstance.ShowRunLog("警告:炒锅【4】输送滚筒发生故障"); } else { FryPotFourAlarm = 1; return; } while (AlarmHelper<AlarmInfo>.GetInstance().FryPotFourRollerTrouble == 1)
if (AlarmHelper<AlarmInfo>.GetInstance().FryPotFourRollerTrouble == 1) { FryPotFourAlarm = -1; MessageNotify.GetInstance.ShowRunLog("警告:炒锅【4】输送滚筒发生故障"); } else { FryPotFourAlarm = 1; return; } while (AlarmHelper<AlarmInfo>.GetInstance().FryPotFourRollerTrouble == 1)
{
Thread.Sleep(1000); if (globalVar.ExitLineOneTask)
return;
}
MessageLog.GetInstance.ShowRunLog("炒锅【4】输送滚筒故障解除,继续运行");
MessageNotify.GetInstance.ShowRunLog("炒锅【4】输送滚筒故障解除,继续运行");
FryPotFourAlarm = 1; break;
}

@@ -4489,20 +4489,20 @@ namespace FryPot_DosingSystem.Control
switch (LTwoOutputMaterialQuene.ElementAt(0).materialType.MaterialLoc / 100)
{
case 2:
if (AlarmHelper<AlarmInfo>.GetInstance().FryPotTwoRollerTrouble == 1) { FryPotTwoAlarm = -1; MessageLog.GetInstance.ShowRunLog("警告:炒锅【1】输送滚筒发生故障"); } else { FryPotTwoAlarm = 1; return; } while (AlarmHelper<AlarmInfo>.GetInstance().FryPotTwoRollerTrouble == 1)
if (AlarmHelper<AlarmInfo>.GetInstance().FryPotTwoRollerTrouble == 1) { FryPotTwoAlarm = -1; MessageNotify.GetInstance.ShowRunLog("警告:炒锅【1】输送滚筒发生故障"); } else { FryPotTwoAlarm = 1; return; } while (AlarmHelper<AlarmInfo>.GetInstance().FryPotTwoRollerTrouble == 1)
{
Thread.Sleep(1000); if (globalVar.ExitLineTwoTask)
return;
}
MessageLog.GetInstance.ShowRunLog("炒锅【1】输送滚筒故障解除,继续运行");
MessageNotify.GetInstance.ShowRunLog("炒锅【1】输送滚筒故障解除,继续运行");
FryPotTwoAlarm = 1; break;
case 5:
if (AlarmHelper<AlarmInfo>.GetInstance().FryPotFiveRollerTrouble == 1) { FryPotFiveAlarm = -1; MessageLog.GetInstance.ShowRunLog("警告:炒锅【4】输送滚筒发生故障"); } else { FryPotFiveAlarm = 1; return; } while (AlarmHelper<AlarmInfo>.GetInstance().FryPotFiveRollerTrouble == 1)
if (AlarmHelper<AlarmInfo>.GetInstance().FryPotFiveRollerTrouble == 1) { FryPotFiveAlarm = -1; MessageNotify.GetInstance.ShowRunLog("警告:炒锅【4】输送滚筒发生故障"); } else { FryPotFiveAlarm = 1; return; } while (AlarmHelper<AlarmInfo>.GetInstance().FryPotFiveRollerTrouble == 1)
{
Thread.Sleep(1000); if (globalVar.ExitLineTwoTask)
return;
}
MessageLog.GetInstance.ShowRunLog("炒锅【4】输送滚筒故障解除,继续运行");
MessageNotify.GetInstance.ShowRunLog("炒锅【4】输送滚筒故障解除,继续运行");
FryPotFiveAlarm = 1; break;
}
}
@@ -4512,12 +4512,12 @@ namespace FryPot_DosingSystem.Control
public void FryPotThreeRollerTroubleCheck()
{
FryPotThreeAlarm = 0;
if (AlarmHelper<AlarmInfo>.GetInstance().FryPotThreeRollerTrouble == 1) { FryPotThreeAlarm = -1; MessageLog.GetInstance.ShowRunLog("警告:炒锅【3】输送滚筒发生故障"); } else { FryPotThreeAlarm = 1; return; } while (AlarmHelper<AlarmInfo>.GetInstance().FryPotThreeRollerTrouble == 1)
if (AlarmHelper<AlarmInfo>.GetInstance().FryPotThreeRollerTrouble == 1) { FryPotThreeAlarm = -1; MessageNotify.GetInstance.ShowRunLog("警告:炒锅【3】输送滚筒发生故障"); } else { FryPotThreeAlarm = 1; return; } while (AlarmHelper<AlarmInfo>.GetInstance().FryPotThreeRollerTrouble == 1)
{
Thread.Sleep(1000); if (globalVar.ExitLineThreeTask)
return;
}
MessageLog.GetInstance.ShowRunLog("炒锅【3】输送滚筒故障解除,继续运行");
MessageNotify.GetInstance.ShowRunLog("炒锅【3】输送滚筒故障解除,继续运行");
FryPotThreeAlarm = 1;
}



+ 9
- 9
FryPot_DosingSystem/ViewModel/NewRecipeViewModel.cs Dosyayı Görüntüle

@@ -107,7 +107,7 @@ namespace FryPot_DosingSystem.ViewModel
{
if (materials.ElementAt(i).MaterialLoc / 100 != lineNum|| materials.ElementAt(i).MaterialLoc % 100!=i+1||lineNum<=0||lineNum>5)
{
MessageLog.GetInstance.ShowUserLog($"新建配方【{RecipeName}】无效:【配方中原料桶号异常】");
MessageNotify.GetInstance.ShowUserLog($"新建配方【{RecipeName}】无效:【配方中原料桶号异常】");
NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "提示", $"新建配方【{RecipeName}】无效");
ActionManage.GetInstance.Send("CloseNewRecipeView");
return;
@@ -124,12 +124,12 @@ namespace FryPot_DosingSystem.ViewModel
{
goto prop;
}
MessageLog.GetInstance.ShowUserLog($"配方【{RecipeName}】新建成功");
MessageNotify.GetInstance.ShowUserLog($"配方【{RecipeName}】新建成功");
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"新建配方【{RecipeName}】成功");
}
else
{
MessageLog.GetInstance.ShowUserLog($"新建配方【{RecipeName}】无效:【配方中原料桶数异常】");
MessageNotify.GetInstance.ShowUserLog($"新建配方【{RecipeName}】无效:【配方中原料桶数异常】");
NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "提示", $"新建配方【{RecipeName}】无效");
}
ActionManage.GetInstance.Send("CloseNewRecipeView");
@@ -150,7 +150,7 @@ namespace FryPot_DosingSystem.ViewModel
{
if (materials.ElementAt(i).MaterialLoc / 100 != lineNum && materials.ElementAt(i).MaterialLoc % 100 != i + 1 || lineNum <= 0 || lineNum > 5)
{
MessageLog.GetInstance.ShowUserLog($"另存配方【{RecipeName}】无效:【配方中原料桶号异常】");
MessageNotify.GetInstance.ShowUserLog($"另存配方【{RecipeName}】无效:【配方中原料桶号异常】");
NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "提示", $"另存配方【{RecipeName}】无效");
ActionManage.GetInstance.Send("CloseNewRecipeView");
return;
@@ -160,12 +160,12 @@ namespace FryPot_DosingSystem.ViewModel
bom.RecipeName = RecipeName;
bom.UpdateTime = DateTime.Now.ToShortDateString();
Json<RecipeManage>.Save();
MessageLog.GetInstance.ShowUserLog($"配方【{RecipeName}】修改成功");
MessageNotify.GetInstance.ShowUserLog($"配方【{RecipeName}】修改成功");
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"修改配方【{RecipeName}】成功");
}
else
{
MessageLog.GetInstance.ShowUserLog($"修改配方【{RecipeName}】无效:【配方中原料桶数异常】");
MessageNotify.GetInstance.ShowUserLog($"修改配方【{RecipeName}】无效:【配方中原料桶数异常】");
NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "提示", $"修改配方【{RecipeName}】无效");
}
ActionManage.GetInstance.Send("CloseNewRecipeView");
@@ -186,7 +186,7 @@ namespace FryPot_DosingSystem.ViewModel
{
if (materials.ElementAt(i).MaterialLoc / 100 != lineNum && materials.ElementAt(i).MaterialLoc % 100 != i + 1 || lineNum <= 0 || lineNum > 5)
{
MessageLog.GetInstance.ShowUserLog($"另存配方【{RecipeName}】无效:【配方中原料桶号异常】");
MessageNotify.GetInstance.ShowUserLog($"另存配方【{RecipeName}】无效:【配方中原料桶号异常】");
NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "提示", $"另存配方【{RecipeName}】无效");
ActionManage.GetInstance.Send("CloseNewRecipeView");
return;
@@ -203,12 +203,12 @@ namespace FryPot_DosingSystem.ViewModel
{
goto prop;
}
MessageLog.GetInstance.ShowUserLog("另存配方成功");
MessageNotify.GetInstance.ShowUserLog("另存配方成功");
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"另存配方【{RecipeName}】成功");
}
else
{
MessageLog.GetInstance.ShowUserLog($"另存配方【{rec.RecipeName}】无效:【配方中原料桶数异常】");
MessageNotify.GetInstance.ShowUserLog($"另存配方【{rec.RecipeName}】无效:【配方中原料桶数异常】");
NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "提示", $"另存配方【{rec.RecipeName}】无效");
}
ActionManage.GetInstance.Send("CloseNewRecipeView");


Yükleniyor…
İptal
Kaydet