Browse Source

小料站新增机器人动作标志位变量,修改配方完成数目为本地保存。

master
ZhaoGang 1 year ago
parent
commit
c5ea0411cb
4 changed files with 23 additions and 10 deletions
  1. +2
    -0
      BPASmartClient.JXJFoodSmallStation/App.xaml.cs
  2. +12
    -0
      BPASmartClient.JXJFoodSmallStation/Model/HK_PLC/PlcReadAddressDB3.cs
  3. +4
    -0
      BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/LocaPar.cs
  4. +5
    -10
      BPASmartClient.JXJFoodSmallStation/ViewModel/ManualFlowViewModel.cs

+ 2
- 0
BPASmartClient.JXJFoodSmallStation/App.xaml.cs View File

@@ -52,6 +52,7 @@ namespace BPASmartClient.JXJFoodSmallStation
}
else
mv.Close();
GVL_SmallStation.GetInstance.RecipeDosingCompleNum = Json<LocaPar>.Data.RecipeDosingCompleNum;
MainWindow = mv;
}
private async void Init()
@@ -66,6 +67,7 @@ namespace BPASmartClient.JXJFoodSmallStation
protected override void OnExit(ExitEventArgs e)
{
base.OnExit(e);
Json<LocaPar>.Data.RecipeDosingCompleNum = GVL_SmallStation.GetInstance.RecipeDosingCompleNum;
Json<LocaPar>.Save();
Json<LocalRecipeDataColl>.Save();
Json<RemoteRecipeDataColl>.Save();


+ 12
- 0
BPASmartClient.JXJFoodSmallStation/Model/HK_PLC/PlcReadAddressDB3.cs View File

@@ -69,5 +69,17 @@ namespace BPASmartClient.JXJFoodSmallStation.Model.HK_PLC
[VarComm("DB3.DBX40.2", "工站1气缸信号")]
public bool Station1Cylinder { get; set; }

[VarComm("DB3.DBX100.7", "机器人抓空桶完成")]
public bool RobotTakeEmptyBarrelFinish { get; set; }

[VarComm("DB3.DBX101.0", "机器人放空桶完成")]
public bool RobotPutEmptyBarrelFinish { get; set; }

[VarComm("DB3.DBX101.1", "机器人抓满桶完成")]
public bool RobotTakeFullBarrelFinish { get; set; }

[VarComm("DB3.DBX101.2", "机器人放满桶完成")]
public bool RobotPutFullBarrelFinish { get; set; }

}
}

+ 4
- 0
BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/LocaPar.cs View File

@@ -12,5 +12,9 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
public class LocaPar
{
public ObservableCollection<RecipeModel> Recipes { get; set; } = new ObservableCollection<RecipeModel>();
/// <summary>
/// 配方完成数目。
/// </summary>
public int RecipeDosingCompleNum { get; set; } = 0;
}
}

+ 5
- 10
BPASmartClient.JXJFoodSmallStation/ViewModel/ManualFlowViewModel.cs View File

@@ -39,7 +39,9 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel
VisibilityBtn3 = Visibility.Hidden;
GVL_SmallStation.GetInstance.ManualIssueRecipe = false;
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"手动点击按钮,AGV送托盘完成");
}, () => CanManualGetTray());
}, () => { return Delay.GetInstance("CanManualGetTray").Start(GVL_SmallStation.GetInstance.ManualIssueRecipe, 10); });

Test2Command = new RelayCommand(() =>
{
ActionManage.GetInstance.Send("PLCWrite", new HKDeviceWrite() { Address = "DB4.DBX4.0", PlcVarType = PlcVarType.Bool, Value = true });
@@ -66,6 +68,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel
VisibilityBtn3 = Visibility.Hidden;
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"手动点击按钮,AGV取托盘完成");
});

Test4Command = new RelayCommand(() =>
{
ActionManage.GetInstance.Send("PLCWrite", new HKDeviceWrite() { Address = "DB4.DBX1.5", PlcVarType = PlcVarType.Bool, Value = true });
@@ -375,14 +378,6 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel

private static Visibility _VisibilityBtn3 = Visibility.Hidden;

//延迟10s后才可以执行手动点击送托盘完成操作。
private bool CanManualGetTray()
{
if (Delay.GetInstance("CanManualGetTray").Start(GVL_SmallStation.GetInstance.ManualIssueRecipe,10))
{
return true;
}
return false;
}
}
}

Loading…
Cancel
Save