Ver código fonte

180更新

样式分支
taoye 2 anos atrás
pai
commit
1609496f0f
19 arquivos alterados com 1057 adições e 200 exclusões
  1. +3
    -2
      BPASmartClient.CustomResource/Pages/View/VariableConfigView.xaml
  2. +8
    -7
      BPASmartClient.CustomResource/Pages/View/VariableConfigView.xaml.cs
  3. +1
    -0
      BPASmartClient.MilkWithTea/BPASmartClient.MilkWithTea.csproj
  4. +4
    -3
      FryPot_DosingSystem/App.xaml.cs
  5. +212
    -112
      FryPot_DosingSystem/Control/DosingLogicControl.cs
  6. +26
    -2
      FryPot_DosingSystem/Control/GlobalVariable.cs
  7. +4
    -4
      FryPot_DosingSystem/Model/FlowProcessModel.cs
  8. +17
    -0
      FryPot_DosingSystem/Model/FlowProcessNames.cs
  9. +1
    -0
      FryPot_DosingSystem/View/DeviceListVIew.xaml
  10. +398
    -19
      FryPot_DosingSystem/View/FlowProcessView.xaml
  11. +80
    -2
      FryPot_DosingSystem/View/FlowProcessView.xaml.cs
  12. +2
    -2
      FryPot_DosingSystem/View/NewRecipeView.xaml.cs
  13. +122
    -0
      FryPot_DosingSystem/View/RecipesSendDown.xaml
  14. +28
    -0
      FryPot_DosingSystem/View/RecipesSendDown.xaml.cs
  15. +114
    -21
      FryPot_DosingSystem/ViewModel/FlowProcessSetViewModel.cs
  16. +1
    -1
      FryPot_DosingSystem/ViewModel/NewRecipeViewModel.cs
  17. +30
    -21
      FryPot_DosingSystem/ViewModel/RecipeSetDownViewModel.cs
  18. +3
    -0
      FryPot_DosingSystem/ViewModel/RecipeSetViewModel.cs
  19. +3
    -4
      SmartClient.sln

+ 3
- 2
BPASmartClient.CustomResource/Pages/View/VariableConfigView.xaml Ver arquivo

@@ -373,8 +373,9 @@
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<ComboBox ItemsSource="{Binding DeviceName}" Text="滚筒输送线" Style="{StaticResource ComboBoxStyle1}" SelectionChanged="ComboBox_SelectionChanged" FontSize="20" Foreground="#FF2AB2E7" Width="120" Height="40" Margin="0,0,10,0"></ComboBox>
<Button HorizontalAlignment="Right" Width="120" Height="40" Margin="0,0,10,0" Background="Transparent" Content="保存配置" Foreground="#FF2AB2E7" FontSize="20" BorderBrush="LightSkyBlue" BorderThickness="2" Command="{Binding SaveDataCommand}"></Button>
<ComboBox ItemsSource="{Binding DeviceName}" SelectedValue="滚筒输送线" Style="{StaticResource ComboBoxStyle1}"
VerticalContentAlignment="Center" SelectionChanged="ComboBox_SelectionChanged" FontSize="20" Foreground="#FF2AB2E7" Width="130" Height="40" Margin="0,0,10,0"></ComboBox>
<Button HorizontalAlignment="Right" Width="120" Height="40" Margin="0,0,10,0" Background="Transparent" Content="保存配置" Foreground="#FF2AB2E7" FontSize="20" BorderBrush="LightSkyBlue" BorderThickness="1" Command="{Binding SaveDataCommand}"></Button>
</StackPanel>
<!--变量配置-->
<DataGrid Name="GT" Grid.Row="1" ItemsSource="{Binding Variables}" GridLinesVisibility="All" Background="Transparent" EnableRowVirtualization="False"


+ 8
- 7
BPASmartClient.CustomResource/Pages/View/VariableConfigView.xaml.cs Ver arquivo

@@ -57,17 +57,18 @@ namespace BPASmartClient.CustomResource.Pages.View
private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
ComboBox cbo= sender as ComboBox;
if (cbo != null)
if (cbo != null&&GT!=null&&fryOne!=null&&fryTwo!=null&&fryThree!=null&&fryFour!=null&&fryFive!=null)
{
switch (cbo.SelectedValue)
{
case "滚筒输送线":
this.GT.Visibility = Visibility.Visible;
this.fryOne.Visibility = Visibility.Collapsed;
this.fryTwo.Visibility=Visibility.Collapsed;
this.fryThree.Visibility = Visibility.Collapsed;
this.fryFour.Visibility = Visibility.Collapsed;
this.fryFive.Visibility = Visibility.Collapsed;
this.GT.Visibility = Visibility.Visible;
this.fryOne.Visibility = Visibility.Collapsed;
this.fryTwo.Visibility = Visibility.Collapsed;
this.fryThree.Visibility = Visibility.Collapsed;
this.fryFour.Visibility = Visibility.Collapsed;
this.fryFive.Visibility = Visibility.Collapsed;
break;
case "炒锅1":
this.GT.Visibility = Visibility.Collapsed;


+ 1
- 0
BPASmartClient.MilkWithTea/BPASmartClient.MilkWithTea.csproj Ver arquivo

@@ -20,6 +20,7 @@
<ProjectReference Include="..\BPASmartClient.IoT\BPASmartClient.IoT.csproj" />
<ProjectReference Include="..\BPASmartClient.Model\BPASmartClient.Model.csproj" />
<ProjectReference Include="..\BPASmartClient.MORKSM.BK.PLC\BPASmartClient.PLC.csproj" />
<ProjectReference Include="..\BPASmartClient.MorkTM\BPASmartClient.MorkTM.csproj" />
<ProjectReference Include="..\BPASmartClient.ViewModel\BPASmartClient.ViewModel.csproj" />
</ItemGroup>



+ 4
- 3
FryPot_DosingSystem/App.xaml.cs Ver arquivo

@@ -25,6 +25,7 @@ namespace FryPot_DosingSystem
/// </summary>
public partial class App : Application
{
public static Window MainWindow;
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
@@ -44,7 +45,7 @@ namespace FryPot_DosingSystem
}
else
mv.Close();
MainWindow = mv;

//HubHelper.GetInstance.Report = new Action<object>((o) =>
//{
@@ -57,7 +58,7 @@ namespace FryPot_DosingSystem
//});
//本地服务连接

}

@@ -86,7 +87,7 @@ namespace FryPot_DosingSystem
SubMenuName = "配方下发",
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 },
AssemblyName = "FryPot_DosingSystem",
ToggleWindowPath = "View.RecipeSendDownView"
ToggleWindowPath = "View.RecipesSendDown"
});

MenuManage.GetInstance.menuModels.Add(new MenuModel()


+ 212
- 112
FryPot_DosingSystem/Control/DosingLogicControl.cs Ver arquivo

@@ -141,10 +141,15 @@ namespace FryPot_DosingSystem.Control
string LFourrobotJobId = string.Empty;//线体4当前上游系统任务号,全局唯一 从炒锅1、4到线体4路径
string LFiverobotJobId = string.Empty; //从炒锅2、5到线体4路径
string LSixrobotJobId = string.Empty; //从炒锅3到线体4路径
string LSevenrobotJobId = string.Empty; //从线体1到清洗台路径
string LEightrobotJobId = string.Empty; //从线体2到清洗台路径
string LNinerobotJobId = string.Empty; //从线体3到清洗台路径
string LTenrobotJobId = string.Empty; //从清洗台到线体4路径
List<string> LSevenrobotJobId =new List<string>(); //从线体1到清洗台路径
List<string> LEightrobotJobId = new List<string>();//从线体2到清洗台路径
List<string> LNinerobotJobId = new List<string>(); //从线体3到清洗台路径
List<string> LTenrobotJobId = new List<string>(); //从清洗台到线体4路径

Dictionary<string, int> agvCodeOne = new Dictionary<string, int>();//1号agv小车的编号对AGV动画小车编号
Dictionary<string, int> agvCodeTwo = new Dictionary<string, int>();//2号agv小车的编号对AGV动画小车编号
Dictionary<string, int> agvCodeThree =new Dictionary<string, int>();//3号agv小车的编号对AGV动画小车编号
Dictionary<string, int> agvCodeFour = new Dictionary<string, int>();//4号agv小车的编号对AGV动画小车编号

public int CleanNum = 0;//当前清洗台桶数

@@ -178,7 +183,9 @@ namespace FryPot_DosingSystem.Control
}), "CleanPlateCallAgv");
ActionManage.GetInstance.Register(new Action(() =>
{
globalVar.agvArriveCleanUnLoad = true;//清洗台空桶下料就位
globalVar.rollerLineOne.agvArriveCleanUnLoad = true;//清洗台空桶下料就位
globalVar.rollerLineTwo.agvArriveCleanUnLoad = true;
globalVar.rollerLineThree.agvArriveCleanUnLoad = true;

}), "AgvArriveCleanPlateLoc");
ActionManage.GetInstance.Register(new Action(() =>
@@ -189,7 +196,9 @@ namespace FryPot_DosingSystem.Control
ActionManage.GetInstance.Register(new Action(() =>
{
globalVar.agvArriveLineFour = true;

globalVar.rollerLineOne.agvArriveLineFour = true;
globalVar.rollerLineTwo.agvArriveLineFour = true;
globalVar.rollerLineThree.agvArriveLineFour = true;
}), "AgvArriveLineFourLoc");

ActionManage.GetInstance.Register(new Action(() =>
@@ -226,7 +235,10 @@ namespace FryPot_DosingSystem.Control

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

}, "AgvArriveLineFourLocCom");
ActionManage.GetInstance.Register(() =>
@@ -235,10 +247,10 @@ namespace FryPot_DosingSystem.Control

}, "AgvArriveCleanPlateLocLoadCom");

ActionManage.GetInstance.Register(() =>
ActionManage.GetInstance.Register(() =>
{
globalVar.rollerLineOne.RecipeCompleteSingle = 1;
}, "LineOneRecipeComSignal");
ActionManage.GetInstance.Register(() =>
{
@@ -428,7 +440,7 @@ namespace FryPot_DosingSystem.Control
DateTime timeNow = DateTime.Now;
if (TimeDiff(timeNow, createTime) != 0 && TimeDiff(timeNow, createTime) > days)
{
Directory.Delete(item);
Directory.Delete(item, true);
}
}
}
@@ -442,7 +454,7 @@ namespace FryPot_DosingSystem.Control
DateTime timeNow = DateTime.Now;
if (TimeDiff(timeNow, createTime) != 0 && TimeDiff(timeNow, createTime) > days)
{
Directory.Delete(item);
Directory.Delete(item, true);
}
}
}
@@ -456,7 +468,7 @@ namespace FryPot_DosingSystem.Control
DateTime timeNow = DateTime.Now;
if (TimeDiff(timeNow, createTime) != 0 && TimeDiff(timeNow, createTime) > days)
{
Directory.Delete(item);
Directory.Delete(item, true);
}
}
}
@@ -470,7 +482,7 @@ namespace FryPot_DosingSystem.Control
DateTime timeNow = DateTime.Now;
if (TimeDiff(timeNow, createTime) != 0 && TimeDiff(timeNow, createTime) > days)
{
Directory.Delete(item);
Directory.Delete(item, true);
}
}
}
@@ -484,7 +496,7 @@ namespace FryPot_DosingSystem.Control
DateTime timeNow = DateTime.Now;
if (TimeDiff(timeNow, createTime) != 0 && TimeDiff(timeNow, createTime) > days)
{
Directory.Delete(item);
Directory.Delete(item, true);
}
}
}
@@ -713,12 +725,16 @@ namespace FryPot_DosingSystem.Control
if (objData.robotJobId == LFourrobotJobId && objData.command == "LOAD")//同一任务号且处于上料阶段,AGV请求上料
{
globalVar.agvArriveUpLoad = true;//AGV到达上料位置
}
if (objData.robotJobId == LFourrobotJobId && objData.command == "UNLOAD")//同一任务号且处于下料阶段
{
globalVar.agvArriveLineFour = true;//AGV到达下料位置

globalVar.rollerLineOne.agvArriveLineFour = true;//AGV到达下料位置
AgvViewModel.GetInstance().Set滚筒线状态(4, IsRun.Start);
AgvViewModel.GetInstance().Set滚筒线上数量(4, (++globalVar.LFourRollerNum).ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(1, IsBool.No);
AgvViewModel.GetInstance().Set小车运动(1, CartMotionTrajectory.hj);
AgvViewModel.GetInstance().Set停车桩(1, IsBool.Yes);
}

if (objData.robotJobId == LFiverobotJobId && objData.command == "LOAD")
@@ -728,8 +744,12 @@ namespace FryPot_DosingSystem.Control
}
if (objData.robotJobId == LFiverobotJobId && objData.command == "UNLOAD")//同一任务号且处于下料阶段
{
globalVar.agvArriveLineFour = true;//AGV到达下料位置

globalVar.rollerLineTwo.agvArriveLineFour = true;//AGV到达下料位置
AgvViewModel.GetInstance().Set滚筒线状态(4, IsRun.Start);
AgvViewModel.GetInstance().Set滚筒线上数量(4, (++globalVar.LFourRollerNum).ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(2, IsBool.No);
AgvViewModel.GetInstance().Set小车运动(2, CartMotionTrajectory.hj);
AgvViewModel.GetInstance().Set停车桩(2, IsBool.Yes);
}

if (objData.robotJobId == LSixrobotJobId && objData.command == "LOAD")
@@ -739,50 +759,75 @@ namespace FryPot_DosingSystem.Control
}
if (objData.robotJobId == LSixrobotJobId && objData.command == "UNLOAD")//同一任务号且处于下料阶段
{
globalVar.agvArriveLineFour = true;//AGV到达下料位置
globalVar.rollerLineThree.agvArriveLineFour = true;//AGV到达下料位置
AgvViewModel.GetInstance().Set滚筒线状态(4, IsRun.Start);
AgvViewModel.GetInstance().Set滚筒线上数量(4, (++globalVar.LFourRollerNum).ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(3, IsBool.No);
AgvViewModel.GetInstance().Set小车运动(3, CartMotionTrajectory.hj);
AgvViewModel.GetInstance().Set停车桩(3, IsBool.Yes);
}
#endregion
#region 线体到清洗台
if (objData.robotJobId == LSevenrobotJobId && objData.command == "LOAD")//同一任务号且处于上料阶段,AGV请求上料
if (LSevenrobotJobId.FirstOrDefault(p=>p==objData.robotJobId)!=null && objData.command == "LOAD")//同一任务号且处于上料阶段,AGV请求上料
{
globalVar.agvArriveLineOneLoadEmptyRoller = true;//AGV到达上料位置

}
if (objData.robotJobId == LSevenrobotJobId && objData.command == "UNLOAD")//同一任务号且处于下料阶段
if (LSevenrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.command == "UNLOAD")//同一任务号且处于下料阶段
{
globalVar.agvArriveCleanUnLoad = true;//AGV到达下料位置

globalVar.rollerLineOne.agvArriveCleanUnLoad = true;//AGV到达下料位置
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.No);
AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.qxt_hj);
AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes);
AgvViewModel.GetInstance().SetCleanRollerNum(++CleanNum);
}

if (objData.robotJobId == LEightrobotJobId && objData.command == "LOAD")
if ( LEightrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.command == "LOAD")
{
globalVar.agvArriveLineTwoLoadEmptyRoller = true;//AGV到达上料位置

}
if (objData.robotJobId == LEightrobotJobId && objData.command == "UNLOAD")//同一任务号且处于下料阶段
if ( LEightrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.command == "UNLOAD")//同一任务号且处于下料阶段
{
globalVar.agvArriveCleanUnLoad = true;//AGV到达下料位置
globalVar.rollerLineTwo.agvArriveCleanUnLoad = true;//AGV到达下料位置
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.No);
AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.qxt_hj);
AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes);
AgvViewModel.GetInstance().SetCleanRollerNum(++CleanNum);

}

if (objData.robotJobId == LSixrobotJobId && objData.command == "LOAD")
if (LNinerobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.command == "LOAD")
{
globalVar.agvArriveLineThreeLoadEmptyRoller = true;//AGV到达上料位置

}
if (objData.robotJobId == LSixrobotJobId && objData.command == "UNLOAD")//同一任务号且处于下料阶段
if (LNinerobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.command == "UNLOAD")//同一任务号且处于下料阶段
{
globalVar.agvArriveCleanUnLoad = true;//AGV到达下料位置
globalVar.rollerLineThree.agvArriveCleanUnLoad = true;//AGV到达下料位置
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.No);
AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.qxt_hj);
AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes);
AgvViewModel.GetInstance().SetCleanRollerNum(++CleanNum);
}
#endregion

if (objData.robotJobId == LTenrobotJobId && objData.command == "LOAD")
if (LTenrobotJobId.FirstOrDefault(p=>p==objData.robotJobId)!=null && objData.command == "LOAD")
{
globalVar.agvArriveCleanLoad = true;//agv到达清洗台上料位置
}
if (objData.robotJobId == LTenrobotJobId && objData.command == "UNLOAD")
if (LTenrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.command == "UNLOAD")
{
globalVar.agvArriveLineFour = true;//agv到达线体4下料位置
AgvViewModel.GetInstance().Set滚筒线状态(4, IsRun.Start);
AgvViewModel.GetInstance().Set滚筒线上数量(4, (++globalVar.LFourRollerNum).ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.No);
AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.hj);
AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes);
}
}

@@ -835,7 +880,7 @@ namespace FryPot_DosingSystem.Control
//线体1任务上报
if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LOnerobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体上料
{
globalVar.agvLineOneLoadCom = true;
AgvViewModel.GetInstance().Set滚筒线上数量(1, (globalVar.LOneMaterialNum - 1).ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(1, IsBool.Yes);
if (globalVar.LOneFryPotSerial == 1)
@@ -851,7 +896,7 @@ namespace FryPot_DosingSystem.Control
//线体2任务上报
if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LTworobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体上料
{
globalVar.agvLineTwoLoadCom = true;
AgvViewModel.GetInstance().Set滚筒线上数量(2, (globalVar.LTwoMaterialNum - 1).ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(2, IsBool.Yes);
if (globalVar.LTwoFryPotSerial == 2)
@@ -867,7 +912,7 @@ namespace FryPot_DosingSystem.Control
//线体3任务上报
if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LThreerobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体上料
{
globalVar.agvLineThreeLoadCom = true;
AgvViewModel.GetInstance().Set滚筒线上数量(3, (globalVar.LThreeMaterialNum - 1).ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(3, IsBool.Yes);
AgvViewModel.GetInstance().Set小车运动(3, CartMotionTrajectory.yc_3_3);
@@ -875,29 +920,29 @@ namespace FryPot_DosingSystem.Control
}

//线体1任务上报
if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LSevenrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体1空桶上料
if (objData.state == "ROLLER_LOAD_FINISH" && LSevenrobotJobId.FirstOrDefault(p=>p==objData.robotJobId)!=null && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体1空桶上料
{
globalVar.agvArriveLineOneLoadCom = true;
AgvViewModel.GetInstance().Set滚筒线上数量(1, (globalVar.LOneMaterialNum - 1).ToString());
AgvViewModel.GetInstance().Set滚筒线上数量(1, globalVar.LOneMaterialNum.ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.OnllYes);
AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.tqx_1);
//到清洗处
}
//线体2任务上报
if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LEightrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体2空桶上料
if (objData.state == "ROLLER_LOAD_FINISH" && LEightrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体2空桶上料
{
globalVar.agvArriveLineTwoLoadCom = true;
AgvViewModel.GetInstance().Set滚筒线上数量(2, (globalVar.LTwoMaterialNum - 1).ToString());
AgvViewModel.GetInstance().Set滚筒线上数量(2, globalVar.LTwoMaterialNum.ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.OnllYes);
AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.tqx_2);
//到清洗处

}
//线体3任务上报
if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LThreerobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体3空桶上料
if (objData.state == "ROLLER_LOAD_FINISH" && LNinerobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体3空桶上料
{
globalVar.agvArriveLineThreeLoadCom = true;
AgvViewModel.GetInstance().Set滚筒线上数量(3, (globalVar.LThreeMaterialNum - 1).ToString());
AgvViewModel.GetInstance().Set滚筒线上数量(3, globalVar.LThreeMaterialNum.ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.OnllYes);
AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.tqx_3);
//到清洗处
@@ -937,17 +982,17 @@ namespace FryPot_DosingSystem.Control

#region 空桶上下料任务信息回报
//线体1任务上报
if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LOnerobotJobId && objData.jobData.startPointCode == "")// AGV正在上料,指炒锅空桶上料
if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LFourrobotJobId && objData.jobData.startPointCode == "")// AGV正在上料,指炒锅空桶上料
{
//日志
}
//线体2任务上报
if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LTworobotJobId && objData.jobData.startPointCode == "")// AGV正在上料,指炒锅空桶上料
if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LFiverobotJobId && objData.jobData.startPointCode == "")// AGV正在上料,指炒锅空桶上料
{
//日志
}
//线体3任务上报
if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LThreerobotJobId && objData.jobData.startPointCode == "")// AGV正在上料,指炒锅空桶上料
if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LSixrobotJobId && objData.jobData.startPointCode == "")// AGV正在上料,指炒锅空桶上料
{
//日志
}
@@ -1034,6 +1079,7 @@ namespace FryPot_DosingSystem.Control
//线体1任务上报
if (objData.state == "DONE" && objData.robotJobId == LFourrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指炒锅空桶下料
{
MessageLog.GetInstance.ShowRunLog("1号线炒锅空桶在4号线卸桶完成");
// globalVar.EmptyRollerUnLoadcCom = true;
AgvViewModel.GetInstance().Set小车运动(1, AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车停止(1);
@@ -1043,6 +1089,7 @@ namespace FryPot_DosingSystem.Control
//线体2任务上报
if (objData.state == "DONE" && objData.robotJobId == LFiverobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指炒锅空桶下料
{
MessageLog.GetInstance.ShowRunLog("2号线炒锅空桶在4号线卸桶完成");
// globalVar.EmptyRollerUnLoadcCom = true;
AgvViewModel.GetInstance().Set小车运动(2, AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车停止(2);
@@ -1051,41 +1098,45 @@ namespace FryPot_DosingSystem.Control
//线体3任务上报
if (objData.state == "DONE" && objData.robotJobId == LSixrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指炒锅空桶下料
{
MessageLog.GetInstance.ShowRunLog("3号线炒锅空桶在4号线卸桶完成");
// globalVar.EmptyRollerUnLoadcCom = true;
AgvViewModel.GetInstance().Set小车运动(3, AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车停止(3);
AgvViewModel.GetInstance().Set停车桩(3, IsBool.Yes);
}

if (objData.state == "DONE" && objData.robotJobId == LSevenrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指从线体1到清戏台空桶下料
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("清洗台卸桶完成");
AgvViewModel.GetInstance().Set小车运动(4, AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车停止(4);
AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes);
}
if (objData.state == "DONE" && objData.robotJobId == LEightrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指从线体2到清戏台空桶下料
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("清洗台卸桶完成");
AgvViewModel.GetInstance().Set小车运动(4, AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车停止(4);
AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes);
}
if (objData.state == "DONE" && objData.robotJobId == LNinerobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指从线体3到清戏台空桶下料
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("清洗台卸桶完成");
AgvViewModel.GetInstance().Set小车运动(4, AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车停止(4);
AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes);
}
if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LTenrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料位置上料完成,指清戏台空桶到上料
if (objData.state == "ROLLER_LOAD_FINISH" && LTenrobotJobId.FirstOrDefault(p=>p==objData.robotJobId)!=null && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料位置上料完成,指清戏台空桶到上料
{
MessageLog.GetInstance.ShowRunLog("清洗台空桶装载完成");
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.OnllYes);
AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.hs_4);//去四号空桶线

}
if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LTenrobotJobId && objData.jobData.targetPointCode == "")//指定下料点正在下料,指清洗台空桶到线体4下料
if (objData.state == "ROLLER_UNLOAD_DOING" && LTenrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.targetPointCode == "")//指定下料点正在下料,指清洗台空桶到线体4下料
{
AgvViewModel.GetInstance().Set滚筒线状态(4, IsRun.Start);
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.No);
@@ -1099,8 +1150,9 @@ namespace FryPot_DosingSystem.Control
}
}

if (objData.state == "DONE" && objData.robotJobId == LTenrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指清戏台空桶到线体4下料
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】号线空桶回桶完成");
AgvViewModel.GetInstance().Set小车运动(4, AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车停止(4);
@@ -1272,7 +1324,9 @@ namespace FryPot_DosingSystem.Control

globalVar.agvArriveLineFour = false;
globalVar.agvArriveCleanLoad = false;
globalVar.agvArriveCleanUnLoad = false;
globalVar.rollerLineOne.agvArriveCleanUnLoad = false;
globalVar.rollerLineTwo.agvArriveCleanUnLoad = false;
globalVar.rollerLineThree.agvArriveCleanUnLoad = false;
globalVar.agvArriveLineOneLoadEmptyRoller = false;
globalVar.agvArriveLineTwoLoadEmptyRoller = false;
globalVar.agvArriveLineThreeLoadEmptyRoller = false;
@@ -1431,14 +1485,20 @@ namespace FryPot_DosingSystem.Control
if (globalVar.rollerLineOne.EmptyRollerConfirmSingle == 1 && globalVar.rollerLineOne.EmptyRollerNum != 0)
{
globalVar.rollerLineOne.EmptyRollerNums.Add(globalVar.rollerLineOne.EmptyRollerNum);
globalVar.LOneMaterialNum++;
//是否手动复位PLC
}
if (globalVar.rollerLineTwo.EmptyRollerConfirmSingle == 1 && globalVar.rollerLineTwo.EmptyRollerNum != 0)
{
globalVar.rollerLineTwo.EmptyRollerNums.Add(globalVar.rollerLineTwo.EmptyRollerNum);
globalVar.LTwoMaterialNum++;
//是否手动复位PLC
}
if (globalVar.rollerLineThree.EmptyRollerConfirmSingle == 1 && globalVar.rollerLineThree.EmptyRollerNum != 0)
{
globalVar.rollerLineThree.EmptyRollerNums.Add(globalVar.rollerLineThree.EmptyRollerNum);
globalVar.LThreeMaterialNum++;
//是否手动复位PLC
}
//炒锅状态数据
if (globalVar.fryPotOne.OilConfirm == 1)
@@ -1539,10 +1599,10 @@ namespace FryPot_DosingSystem.Control

if (globalVar.LOneFryPotSerial == 1 && fryOneRecipe != string.Empty)
{
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅1状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm").Replace(':', '.') + fryOneRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅1状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("HH:mm").Replace(':', '.') + fryOneRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
{
writeStream.Position = writeStream.Length;
PotOneStatus p1 = new PotOneStatus { Temperature = FryPotMonitorManage.GetInstance.fryOne.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryOne.HotPower, Speed = FryPotMonitorManage.GetInstance.fryOne.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryOne.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryOne.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryOne.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryOne.TotalProduct, RecipeName = fryOneRecipe, Time = DateTime.Now.ToShortDateString() };
PotOneStatus p1 = new PotOneStatus { Temperature = FryPotMonitorManage.GetInstance.fryOne.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryOne.HotPower, Speed = FryPotMonitorManage.GetInstance.fryOne.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryOne.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryOne.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryOne.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryOne.TotalProduct, RecipeName = fryOneRecipe,Time = DateTime.Now.ToShortDateString() };
BinaryFormatter bf = new BinaryFormatter();
bf.Serialize(writeStream, p1);

@@ -1555,7 +1615,7 @@ namespace FryPot_DosingSystem.Control
Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅1状态数据\\" + DateTime.Now.ToShortDateString());
if (globalVar.LOneFryPotSerial == 1 && fryOneRecipe != string.Empty)
{
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅1状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm").Replace(':', '.') + fryOneRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅1状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("HH:mm").Replace(':', '.') + fryOneRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
{
writeStream.Position = writeStream.Length;
PotOneStatus p1 = new PotOneStatus { Temperature = FryPotMonitorManage.GetInstance.fryOne.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryOne.HotPower, Speed = FryPotMonitorManage.GetInstance.fryOne.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryOne.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryOne.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryOne.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryOne.TotalProduct, RecipeName = fryOneRecipe, Time = DateTime.Now.ToShortDateString() };
@@ -1575,9 +1635,9 @@ namespace FryPot_DosingSystem.Control

if (globalVar.LTwoFryPotSerial == 2 && fryTwoRecipe != string.Empty)
{
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅2状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm").Replace(':', '.') + fryTwoRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅2状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("HH:mm").Replace(':', '.') + fryTwoRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
{
writeStream.Position = writeStream.Length;
PotTwoStatus p1 = new PotTwoStatus { Temperature = FryPotMonitorManage.GetInstance.fryTwo.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryTwo.HotPower, Speed = FryPotMonitorManage.GetInstance.fryTwo.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryTwo.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryTwo.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryTwo.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryTwo.TotalProduct, RecipeName = fryTwoRecipe, Time = DateTime.Now.ToShortDateString() };
BinaryFormatter bf = new BinaryFormatter();
bf.Serialize(writeStream, p1);
@@ -1591,9 +1651,9 @@ namespace FryPot_DosingSystem.Control
Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅2状态数据\\" + DateTime.Now.ToShortDateString());
if (globalVar.LTwoFryPotSerial == 2 && fryTwoRecipe != string.Empty)
{
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅2状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm").Replace(':', '.') + fryTwoRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅2状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("HH:mm").Replace(':', '.') + fryTwoRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
{
writeStream.Position = writeStream.Length;
PotTwoStatus p1 = new PotTwoStatus { Temperature = FryPotMonitorManage.GetInstance.fryTwo.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryTwo.HotPower, Speed = FryPotMonitorManage.GetInstance.fryTwo.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryTwo.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryTwo.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryTwo.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryTwo.TotalProduct, RecipeName = fryTwoRecipe, Time = DateTime.Now.ToShortDateString() };
BinaryFormatter bf = new BinaryFormatter();
bf.Serialize(writeStream, p1);
@@ -1611,9 +1671,9 @@ namespace FryPot_DosingSystem.Control

if (globalVar.LThreeFryPotSerial == 3 && fryThreeRecipe != string.Empty)
{
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅3状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm").Replace(':', '.') + fryThreeRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅3状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("HH:mm").Replace(':', '.') + fryThreeRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
{
writeStream.Position = writeStream.Length;
PotThreeStatus p1 = new PotThreeStatus { Temperature = FryPotMonitorManage.GetInstance.fryThree.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryThree.HotPower, Speed = FryPotMonitorManage.GetInstance.fryThree.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryThree.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryThree.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryThree.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryThree.TotalProduct, RecipeName = fryThreeRecipe, Time = DateTime.Now.ToShortDateString() };
BinaryFormatter bf = new BinaryFormatter();
bf.Serialize(writeStream, p1);
@@ -1627,9 +1687,9 @@ namespace FryPot_DosingSystem.Control
Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅3状态数据\\" + DateTime.Now.ToShortDateString());
if (globalVar.LThreeFryPotSerial == 3 && fryThreeRecipe != string.Empty)
{
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅3状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm").Replace(':', '.') + fryThreeRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅3状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("HH:mm").Replace(':', '.') + fryThreeRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
{
writeStream.Position = writeStream.Length;
PotThreeStatus p1 = new PotThreeStatus { Temperature = FryPotMonitorManage.GetInstance.fryThree.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryThree.HotPower, Speed = FryPotMonitorManage.GetInstance.fryThree.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryThree.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryThree.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryThree.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryThree.TotalProduct, RecipeName = fryThreeRecipe, Time = DateTime.Now.ToShortDateString() };
BinaryFormatter bf = new BinaryFormatter();
bf.Serialize(writeStream, p1);
@@ -1647,7 +1707,7 @@ namespace FryPot_DosingSystem.Control

if (globalVar.LOneFryPotSerial == 4 && fryFourRecipe != string.Empty)
{
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅4状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm").Replace(':', '.') + fryFourRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅4状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("HH:mm").Replace(':', '.') + fryFourRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
{
writeStream.Position = writeStream.Length;
PotFourStatus p1 = new PotFourStatus { Temperature = FryPotMonitorManage.GetInstance.fryFour.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFour.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFour.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFour.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFour.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFour.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFour.TotalProduct, RecipeName = fryFourRecipe, Time = DateTime.Now.ToShortDateString() };
@@ -1663,7 +1723,7 @@ namespace FryPot_DosingSystem.Control
Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅4状态数据\\" + DateTime.Now.ToShortDateString());
if (globalVar.LOneFryPotSerial == 4 && fryFourRecipe != string.Empty)
{
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅4状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm").Replace(':', '.') + fryFourRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅4状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("HH:mm").Replace(':', '.') + fryFourRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
{
writeStream.Position = writeStream.Length;
PotFourStatus p1 = new PotFourStatus { Temperature = FryPotMonitorManage.GetInstance.fryFour.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFour.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFour.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFour.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFour.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFour.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFour.TotalProduct, RecipeName = fryFourRecipe, Time = DateTime.Now.ToShortDateString() };
@@ -1683,7 +1743,7 @@ namespace FryPot_DosingSystem.Control

if (globalVar.LTwoFryPotSerial == 5 && fryFiveRecipe != string.Empty)
{
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅5状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm").Replace(':', '.') + fryFiveRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅5状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("HH:mm").Replace(':', '.') + fryFiveRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
{
writeStream.Position = writeStream.Length;
PotFiveStatus p1 = new PotFiveStatus { Temperature = FryPotMonitorManage.GetInstance.fryFive.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFive.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFive.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFive.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFive.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFive.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFive.TotalProduct, RecipeName = fryFiveRecipe, Time = DateTime.Now.ToShortDateString() };
@@ -1699,7 +1759,7 @@ namespace FryPot_DosingSystem.Control
Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅5状态数据\\" + DateTime.Now.ToShortDateString());
if (globalVar.LTwoFryPotSerial == 5 && fryFiveRecipe != string.Empty)
{
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅5状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm").Replace(':', '.') + fryFiveRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅5状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("HH:mm").Replace(':', '.') + fryFiveRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
{
writeStream.Position = writeStream.Length;
PotFiveStatus p1 = new PotFiveStatus { Temperature = FryPotMonitorManage.GetInstance.fryFive.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFive.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFive.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFive.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFive.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFive.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFive.TotalProduct, RecipeName = fryFiveRecipe, Time = DateTime.Now.ToShortDateString() };
@@ -1989,11 +2049,13 @@ namespace FryPot_DosingSystem.Control
{
//线体123到清洗台
AgvFromLineToCleanPlate();
AgvArriveCleanPlate();
//清洗台到线体4
AgvArriveCleanPlateFromLine();
//空桶到线体4
CallAgvToLineFour();
CleanPlateUpLoad();
EmptyRollerToLinFour();
//清洗台或线体123空桶到线体4
EmptyRollerToLinFourFromClean();
}

private void CleanPlateUpLoad()
@@ -2026,11 +2088,11 @@ namespace FryPot_DosingSystem.Control

//下发AGV去空桶线洗桶任务
e: string id = Guid.NewGuid().ToString("N");
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || id == LSevenrobotJobId || id == LEightrobotJobId || id == LNinerobotJobId || id == LTenrobotJobId)
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p => p == id)!=null || LEightrobotJobId.FirstOrDefault(p => p == id) != null || LNinerobotJobId.FirstOrDefault(p => p == id) != null || LTenrobotJobId.FirstOrDefault(p => p == id) != null)
goto e;
string info = AGVHelper.GetInstance.AgvLeaveLOneToClean(id);//1号线到洗桶处
LFourrobotJobId = id;
LSevenrobotJobId.Add(id);
Thread.Sleep(500);
LineToCleanCarryTaskErrorCodeAnalysis(info, 1);
globalVar.rollerLineOne.IsEpmtyBefore = true;
@@ -2053,11 +2115,11 @@ namespace FryPot_DosingSystem.Control
{
//下发AGV去空桶线洗桶任务
e: string id = Guid.NewGuid().ToString("N");
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || id == LSevenrobotJobId || id == LEightrobotJobId || id == LNinerobotJobId || id == LTenrobotJobId)
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p => p == id) != null || LEightrobotJobId.FirstOrDefault(p => p == id) != null || LNinerobotJobId.FirstOrDefault(p => p == id) != null || LTenrobotJobId.FirstOrDefault(p => p == id) != null)
goto e;

string info = AGVHelper.GetInstance.AgvLeaveLTwoToClean(id);//2号线到洗桶处
LFiverobotJobId = id;
LEightrobotJobId.Add(id);
Thread.Sleep(500);
LineToCleanCarryTaskErrorCodeAnalysis(info, 2);
globalVar.rollerLineTwo.IsEpmtyBefore = true;
@@ -2080,11 +2142,11 @@ namespace FryPot_DosingSystem.Control
{
//下发AGV去空桶线洗桶任务
e: string id = Guid.NewGuid().ToString("N");
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || id == LSevenrobotJobId || id == LEightrobotJobId || id == LNinerobotJobId || id == LTenrobotJobId)
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p => p == id) != null || LEightrobotJobId.FirstOrDefault(p => p == id) != null || LNinerobotJobId.FirstOrDefault(p => p == id) != null || LTenrobotJobId.FirstOrDefault(p => p == id) != null)
goto e;

string info = AGVHelper.GetInstance.AgvLeaveLThreeToClean(id);//3号线到洗桶处
LSixrobotJobId = id;
LNinerobotJobId.Add(id);
Thread.Sleep(500);
LineToCleanCarryTaskErrorCodeAnalysis(info, 3);
globalVar.rollerLineThree.IsEpmtyBefore = true;
@@ -2100,24 +2162,39 @@ namespace FryPot_DosingSystem.Control
}

/// <summary>
/// AGV到达清洗台下料位置
/// AGV从线体123到达清洗台下料位置
/// </summary>
private void AgvArriveCleanPlate()
private void AgvArriveCleanPlateFromLine()
{
if (globalVar.agvArriveCleanUnLoad)
if (globalVar.rollerLineOne.agvArriveCleanUnLoad)
{
globalVar.agvArriveCleanUnLoad = false;
MessageLog.GetInstance.ShowRunLog("空桶到达清洗位置,准备卸桶");
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.No);
AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.qxt_hj);
AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes);
AgvViewModel.GetInstance().SetCleanRollerNum(++CleanNum);
globalVar.rollerLineOne.agvArriveCleanUnLoad = false;
MessageLog.GetInstance.ShowRunLog("空桶从线体1到达清洗位置,准备卸桶");
//plc交互
WritePlcData("D1065", 1);//AGV空桶洗桶就位信号下发PLC
// MessageLog.GetInstance.ShowRunLog("卸桶完成");
}
}
if (globalVar.rollerLineTwo.agvArriveCleanUnLoad)
{
globalVar.rollerLineTwo.agvArriveCleanUnLoad = false;
MessageLog.GetInstance.ShowRunLog("空桶从线体2到达清洗位置,准备卸桶");

//plc交互
WritePlcData("D1065", 1);//AGV空桶洗桶就位信号下发PLC
// MessageLog.GetInstance.ShowRunLog("卸桶完成");
}
if (globalVar.rollerLineThree.agvArriveCleanUnLoad)
{
globalVar.rollerLineThree.agvArriveCleanUnLoad = false;
MessageLog.GetInstance.ShowRunLog("空桶从线体3到达清洗位置,准备卸桶");

//plc交互
WritePlcData("D1065", 1);//AGV空桶洗桶就位信号下发PLC
// MessageLog.GetInstance.ShowRunLog("卸桶完成");
}
}
/// <summary>
/// 呼叫Agv从清洗台运洗好的空桶到四号线体
/// </summary>
@@ -2128,11 +2205,11 @@ namespace FryPot_DosingSystem.Control
//是否需要手动给PLC置位??
globalVar.CleanComplete = 0;
e: string id = Guid.NewGuid().ToString("N");
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || id == LSevenrobotJobId || id == LEightrobotJobId || id == LNinerobotJobId || id == LTenrobotJobId)
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p => p == id) != null || LEightrobotJobId.FirstOrDefault(p => p == id) != null || LNinerobotJobId.FirstOrDefault(p => p == id) != null || LTenrobotJobId.FirstOrDefault(p => p == id) != null)
goto e;

string info = AGVHelper.GetInstance.AgvFromCleanToLineFourUnLoadRoller(id);
LTenrobotJobId = id;
LTenrobotJobId.Add(id);
Thread.Sleep(500);
MessageLog.GetInstance.ShowRunLog("清洗台呼叫AGV取桶");
CleanToLineCarryTaskErrorCodeAnalysis(info, 4);
@@ -2144,7 +2221,7 @@ namespace FryPot_DosingSystem.Control
/// <exception cref="NotImplementedException"></exception>
private void LThreeRecipeDataToPlc()
{
if (LThreeOutputMaterialQuene.Count == 0 && LThreeInputMaterialQuene.Count == 0 && !LThreeErrorRecipe&&globalVar.rollerLineThree.RecipeCompleteSingle==1)
if (LThreeOutputMaterialQuene.Count == 0 && LThreeInputMaterialQuene.Count == 0 && !LThreeErrorRecipe && globalVar.rollerLineThree.RecipeCompleteSingle == 1)
{
globalVar.rollerLineThree.RecipeComMidSingle = 1;
if (globalVar.LThreeCurrentRecipeName != string.Empty)
@@ -2165,7 +2242,7 @@ namespace FryPot_DosingSystem.Control
Task.Run(() => { Thread.Sleep(1500); fryThreeRecipe = string.Empty; });
}
}
if (LThreeRecipeQuene.Count > 0 && LThreeOutputMaterialQuene.Count == 0 && LThreeInputMaterialQuene.Count == 0&&globalVar.rollerLineThree.RecipeComMidSingle==1)//后续添加其它限制条件
if (LThreeRecipeQuene.Count > 0 && LThreeOutputMaterialQuene.Count == 0 && LThreeInputMaterialQuene.Count == 0 && globalVar.rollerLineThree.RecipeComMidSingle == 1)//后续添加其它限制条件
{
Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_3.goodsName = string.Empty; }));
Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_3.workflows = new ObservableCollection<WorkflowModel>(); }));
@@ -2206,7 +2283,7 @@ namespace FryPot_DosingSystem.Control
}
}
DeviceOperate.GetInstance.WritePlcData("D1043", (ushort)result.materialCollection.Count);//发送3号滚筒线工序数据
globalVar.rollerLineThree.RecipeComMidSingle = 0;
globalVar.rollerLineThree.RecipeComMidSingle = 0;
}
}

@@ -2219,7 +2296,7 @@ namespace FryPot_DosingSystem.Control
/// <exception cref="NotImplementedException"></exception>
private void LTwoRecipeDataToPlc()
{
if (LTwoOutputMaterialQuene.Count == 0 && LTwoInputMaterialQuene.Count == 0 && !LTwoErrorRecipe&&globalVar.rollerLineTwo.RecipeCompleteSingle == 1)
if (LTwoOutputMaterialQuene.Count == 0 && LTwoInputMaterialQuene.Count == 0 && !LTwoErrorRecipe && globalVar.rollerLineTwo.RecipeCompleteSingle == 1)
{
globalVar.rollerLineTwo.RecipeComMidSingle = 1;
if (globalVar.LTwoCurrentRecipeName != string.Empty)
@@ -2252,7 +2329,7 @@ namespace FryPot_DosingSystem.Control
}
}

if (LTwoRecipeQuene.Count > 0 && LTwoOutputMaterialQuene.Count == 0 && LTwoInputMaterialQuene.Count == 0 && globalVar.rollerLineTwo.RecipeComMidSingle== 1)//后续添加其它限制条件
if (LTwoRecipeQuene.Count > 0 && LTwoOutputMaterialQuene.Count == 0 && LTwoInputMaterialQuene.Count == 0 && globalVar.rollerLineTwo.RecipeComMidSingle == 1)//后续添加其它限制条件
{
if (globalVar.LTwoFryPotSerial == 2)
{
@@ -2281,7 +2358,7 @@ namespace FryPot_DosingSystem.Control
{
if (result.materialCollection[i].MaterialLoc % 100 == i + 1 && result.materialCollection[i].MaterialLoc / 100 == headNum && (headNum == 2 || headNum == 5))
{
if (headNum == 1)//炒锅2
if (headNum == 2)//炒锅2
{
fryTwoRecipe = result.RecipeName;//炒锅状态开始记录
Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_2.goodsName = result.RecipeName; }));
@@ -2322,7 +2399,7 @@ namespace FryPot_DosingSystem.Control
/// </summary>
private void LOneRecipeDataToPlc()
{
if (OutputMaterialQuene.Count == 0 && InputMaterialQuene.Count == 0 && !ErrorRecipe&&globalVar.rollerLineOne.RecipeCompleteSingle==1)
if (OutputMaterialQuene.Count == 0 && InputMaterialQuene.Count == 0 && !ErrorRecipe && globalVar.rollerLineOne.RecipeCompleteSingle == 1)
{
globalVar.rollerLineOne.RecipeComMidSingle = 1;
if (globalVar.LOneCurrentRecipeName != string.Empty)
@@ -2354,7 +2431,7 @@ namespace FryPot_DosingSystem.Control
Task.Run(() => { Thread.Sleep(1500); fryOneRecipe = string.Empty; fryFourRecipe = string.Empty; });
}
}
if (RecipeQuene.Count > 0 && OutputMaterialQuene.Count == 0 && InputMaterialQuene.Count == 0&&globalVar.rollerLineOne.RecipeComMidSingle==1)//后续添加其它限制条件
if (RecipeQuene.Count > 0 && OutputMaterialQuene.Count == 0 && InputMaterialQuene.Count == 0 && globalVar.rollerLineOne.RecipeComMidSingle == 1)//后续添加其它限制条件
{
if (globalVar.LOneFryPotSerial == 1)
{
@@ -2947,25 +3024,48 @@ namespace FryPot_DosingSystem.Control
}

}

/// <summary>
/// 4号线体下料
/// </summary>
public void EmptyRollerToLinFour()
public void EmptyRollerToLinFourFromClean()
{

if (globalVar.agvArriveLineFour)//agv到达线体4下料位置
{
globalVar.agvArriveLineFour = false;
//线体四信号交互
WritePlcData("D1067", 1);//AGV空桶回桶就位信号下发PLC
MessageLog.GetInstance.ShowRunLog("AGV到达【4】号回收线体,准备卸桶");
MessageLog.GetInstance.ShowRunLog("AGV从清洗台到达【4】号回收线体,准备卸桶");
// MessageLog.GetInstance.ShowRunLog("卸桶完成");
}
if (globalVar.rollerLineOne.agvArriveLineFour)//agv到达线体4下料位置
{
globalVar.rollerLineOne.agvArriveLineFour = false;
//线体四信号交互
WritePlcData("D1067", 1);//AGV空桶回桶就位信号下发PLC
MessageLog.GetInstance.ShowRunLog("AGV从1号线体对应炒锅到达【4】号回收线体,准备卸桶");
// MessageLog.GetInstance.ShowRunLog("卸桶完成");
}
if (globalVar.rollerLineTwo.agvArriveLineFour)//agv到达线体4下料位置
{
globalVar.rollerLineTwo.agvArriveLineFour = false;
//线体四信号交互
WritePlcData("D1067", 1);//AGV空桶回桶就位信号下发PLC
MessageLog.GetInstance.ShowRunLog("AGV从2号线体对应炒锅到达【4】号回收线体,准备卸桶");
// MessageLog.GetInstance.ShowRunLog("卸桶完成");
}
if (globalVar.rollerLineThree.agvArriveLineFour)//agv到达线体4下料位置
{
globalVar.rollerLineThree.agvArriveLineFour = false;
//线体四信号交互
WritePlcData("D1067", 1);//AGV空桶回桶就位信号下发PLC
MessageLog.GetInstance.ShowRunLog("AGV从3号炒锅到达【4】号回收线体,准备卸桶");
// MessageLog.GetInstance.ShowRunLog("卸桶完成");
AgvViewModel.GetInstance().Set滚筒线状态(4, IsRun.Start);
AgvViewModel.GetInstance().Set滚筒线上数量(4, (++globalVar.LFourRollerNum).ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.No);
AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.hj);
AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes);
}

}
///// <summary>
///// 2号线体对应空桶清洗
///// </summary>
@@ -3341,7 +3441,7 @@ namespace FryPot_DosingSystem.Control
{
case 1:
erp: string id = Guid.NewGuid().ToString("N");//上游唯一ID
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || id == LSevenrobotJobId || id == LEightrobotJobId || id == LNinerobotJobId || id == LTenrobotJobId)
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p=>p==id)!=null || LEightrobotJobId.FirstOrDefault(p => p == id) != null || LNinerobotJobId.FirstOrDefault(p => p == id) != null || LTenrobotJobId.FirstOrDefault(p => p == id) != null)
{
goto erp;
}
@@ -3351,7 +3451,7 @@ namespace FryPot_DosingSystem.Control
FryCarryTaskErrorCodeAnalysis(info, 1); break;
case 4:
erp3: string id3 = Guid.NewGuid().ToString("N");//上游唯一ID
if (id3 == LOnerobotJobId || id3 == LTworobotJobId || id3 == LThreerobotJobId || id3 == LFourrobotJobId || id3 == LFiverobotJobId || id3 == LSixrobotJobId || id3 == LSevenrobotJobId || id3 == LEightrobotJobId || id3 == LNinerobotJobId || id3 == LTenrobotJobId)
if (id3 == LOnerobotJobId || id3 == LTworobotJobId || id3 == LThreerobotJobId || id3 == LFourrobotJobId || id3 == LFiverobotJobId || id3 == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p => p == id3) != null || LEightrobotJobId.FirstOrDefault(p => p == id3) != null || LNinerobotJobId.FirstOrDefault(p => p == id3) != null || LTenrobotJobId.FirstOrDefault(p => p == id3) != null)
{
goto erp3;
}
@@ -3370,7 +3470,7 @@ namespace FryPot_DosingSystem.Control
{
case 2:
erp1: string id1 = Guid.NewGuid().ToString("N");//上游唯一ID
if (id1 == LOnerobotJobId || id1 == LTworobotJobId || id1 == LThreerobotJobId || id1 == LFourrobotJobId || id1 == LFiverobotJobId || id1 == LSixrobotJobId || id1 == LSevenrobotJobId || id1 == LEightrobotJobId || id1 == LNinerobotJobId || id1 == LTenrobotJobId)
if (id1 == LOnerobotJobId || id1 == LTworobotJobId || id1 == LThreerobotJobId || id1 == LFourrobotJobId || id1 == LFiverobotJobId || id1 == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p => p == id1) != null || LEightrobotJobId.FirstOrDefault(p => p == id1) != null || LNinerobotJobId.FirstOrDefault(p => p == id1) != null || LTenrobotJobId.FirstOrDefault(p => p == id1) != null)
{
goto erp1;
}
@@ -3380,7 +3480,7 @@ namespace FryPot_DosingSystem.Control
FryCarryTaskErrorCodeAnalysis(info1, 2); break;
case 5:
erp4: string id4 = Guid.NewGuid().ToString("N");//上游唯一ID
if (id4 == LOnerobotJobId || id4 == LTworobotJobId || id4 == LThreerobotJobId || id4 == LFourrobotJobId || id4 == LFiverobotJobId || id4 == LSixrobotJobId || id4 == LSevenrobotJobId || id4 == LEightrobotJobId || id4 == LNinerobotJobId || id4 == LTenrobotJobId)
if (id4 == LOnerobotJobId || id4 == LTworobotJobId || id4 == LThreerobotJobId || id4 == LFourrobotJobId || id4 == LFiverobotJobId || id4 == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p => p == id4) != null || LEightrobotJobId.FirstOrDefault(p => p == id4) != null || LNinerobotJobId.FirstOrDefault(p => p == id4) != null || LTenrobotJobId.FirstOrDefault(p => p == id4) != null)
{
goto erp4;
}
@@ -3396,7 +3496,7 @@ namespace FryPot_DosingSystem.Control
public void AgvFromFryPotThreeToClean()
{
erp2: string id2 = Guid.NewGuid().ToString("N");//上游唯一ID
if (id2 == LOnerobotJobId || id2 == LTworobotJobId || id2 == LThreerobotJobId || id2 == LFourrobotJobId || id2 == LFiverobotJobId || id2 == LSixrobotJobId || id2 == LSevenrobotJobId || id2 == LEightrobotJobId || id2 == LNinerobotJobId || id2 == LTenrobotJobId)
if (id2 == LOnerobotJobId || id2 == LTworobotJobId || id2 == LThreerobotJobId || id2 == LFourrobotJobId || id2 == LFiverobotJobId || id2 == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p => p == id2) != null || LEightrobotJobId.FirstOrDefault(p => p == id2) != null || LNinerobotJobId.FirstOrDefault(p => p == id2) != null || LTenrobotJobId.FirstOrDefault(p => p == id2) != null)
{
goto erp2;
}
@@ -3466,7 +3566,7 @@ namespace FryPot_DosingSystem.Control
globalVar.rollerLineOne.EmptyRollerNums.RemoveAt(0);
globalVar.agvArriveLineOneLoadCom = false;
globalVar.rollerLineOne.IsEpmtyBefore = false;
MessageLog.GetInstance.ShowRunLog($"AGV在【1】号线体完成{emptyRollerNum}号空料桶装载");
MessageLog.GetInstance.ShowRunLog($"AGV在【1】号线体完成{emptyRollerNum}号空料桶装载");
}
}
else//有故障
@@ -3745,7 +3845,7 @@ namespace FryPot_DosingSystem.Control
{
globalVar.rollerLineOne.CanRun = false;
e: string id = Guid.NewGuid().ToString("N");
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || id == LSevenrobotJobId || id == LEightrobotJobId || id == LNinerobotJobId || id == LTenrobotJobId)
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p => p == id) != null || LEightrobotJobId.FirstOrDefault(p => p == id) != null || LNinerobotJobId.FirstOrDefault(p => p == id) != null || LTenrobotJobId.FirstOrDefault(p => p == id) != null)
goto e;

string info = AGVHelper.GetInstance.AgvToLineOneLoadRoller(id);
@@ -3803,7 +3903,7 @@ namespace FryPot_DosingSystem.Control
{
globalVar.rollerLineTwo.CanRun = false;
e: string id = Guid.NewGuid().ToString("N");
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || id == LSevenrobotJobId || id == LEightrobotJobId || id == LNinerobotJobId || id == LTenrobotJobId)
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p => p == id) != null || LEightrobotJobId.FirstOrDefault(p => p == id) != null || LNinerobotJobId.FirstOrDefault(p => p == id) != null || LTenrobotJobId.FirstOrDefault(p => p == id) != null)
goto e;

string info = AGVHelper.GetInstance.AgvToLineTwoLoadRoller(id);
@@ -3854,7 +3954,7 @@ namespace FryPot_DosingSystem.Control
{
globalVar.rollerLineThree.CanRun = false;
e: string id = Guid.NewGuid().ToString("N");
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || id == LSevenrobotJobId || id == LEightrobotJobId || id == LNinerobotJobId || id == LTenrobotJobId)
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p => p == id) != null || LEightrobotJobId.FirstOrDefault(p => p == id) != null || LNinerobotJobId.FirstOrDefault(p => p == id) != null || LTenrobotJobId.FirstOrDefault(p => p == id) != null)
goto e;

string info = AGVHelper.GetInstance.AgvToLineThreeLoadRoller(id);


+ 26
- 2
FryPot_DosingSystem/Control/GlobalVariable.cs Ver arquivo

@@ -185,8 +185,8 @@ namespace FryPot_DosingSystem.Control

public int LFourRollerNum { get; set; } = 0;//4号线体空桶数量
//新增空桶清洗系列变量
public bool agvArriveLineFour { get; set; }//agv到达线体4下料位置从清洗台或炒锅
public bool agvArriveCleanUnLoad { get; set; }//agv到达清洗台下料位置
public bool agvArriveLineFour { get; set; }//agv从清洗台到达线体4下料位置
//public bool agvArriveCleanUnLoad { get; set; }//agv到达清洗台下料位置
public bool agvArriveCleanLoad { get; set; }//agv到达清洗台上料位置

public bool agvArriveLineOneLoadEmptyRoller { get; set; }//agv到达线体1空桶上料位置
@@ -272,6 +272,14 @@ namespace FryPot_DosingSystem.Control
/// 线体1上所有空桶的编号集合
/// </summary>
public List<ushort> EmptyRollerNums { get; set; } = new List<ushort>();
/// <summary>
/// AGV从炒锅到达线体4空桶下料位置
/// </summary>
public bool agvArriveLineFour { get; set; }
/// <summary>
/// AGV从线体1到达清洗台
/// </summary>
public bool agvArriveCleanUnLoad { get; set; }
}
/// <summary>
/// 滚筒线2相关变量
@@ -344,6 +352,14 @@ namespace FryPot_DosingSystem.Control
/// 线体2上所有空桶的编号集合
/// </summary>
public List<ushort> EmptyRollerNums { get; set; } = new List<ushort>();
/// <summary>
/// AGV从炒锅到达线体4空桶下料位置
/// </summary>
public bool agvArriveLineFour { get; set; }
/// <summary>
/// AGV从线体2到达清洗台
/// </summary>
public bool agvArriveCleanUnLoad { get; set; }
}
/// <summary>
/// 滚筒线3相关变量
@@ -417,6 +433,14 @@ namespace FryPot_DosingSystem.Control
/// 线体3上所有空桶的编号集合
/// </summary>
public List<ushort> EmptyRollerNums { get; set; } = new List<ushort>();
/// <summary>
/// AGV从炒锅到达线体4空桶下料位置
/// </summary>
public bool agvArriveLineFour { get; set; }
/// <summary>
/// AGV从线体3到达清洗台
/// </summary>
public bool agvArriveCleanUnLoad { get; set; }
}
/// <summary>
/// 滚筒线4相关变量


+ 4
- 4
FryPot_DosingSystem/Model/FlowProcessModel.cs Ver arquivo

@@ -14,10 +14,10 @@ namespace FryPot_DosingSystem.Model
/// </summary>
public string RecipeName { get { return _recipeName; }set { _recipeName = value;OnPropertyChanged(); } }
private string _recipeName;
/// <summary>
/// 工艺步骤
/// </summary>
public int Id { get; set; }
///// <summary>
///// 工艺步骤
///// </summary>
//public int Id { get; set; }

/// <summary>
/// 炒制原料/桶号


+ 17
- 0
FryPot_DosingSystem/Model/FlowProcessNames.cs Ver arquivo

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

namespace FryPot_DosingSystem.Model
{
internal class FlowProcessNames:ObservableObject
{
private static FlowProcessNames _instance;
public static FlowProcessNames GetInstance => _instance ?? (_instance = new FlowProcessNames());
public ObservableCollection<string> Names { get; set; } = new ObservableCollection<string>();
}
}

+ 1
- 0
FryPot_DosingSystem/View/DeviceListVIew.xaml Ver arquivo

@@ -4,6 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:vm="clr-namespace:FryPot_DosingSystem.ViewModel"
xmlns:local="clr-namespace:FryPot_DosingSystem.View"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">


+ 398
- 19
FryPot_DosingSystem/View/FlowProcessView.xaml Ver arquivo

@@ -5,11 +5,384 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:FryPot_DosingSystem.View"
xmlns:vm="clr-namespace:FryPot_DosingSystem.ViewModel"
xmlns:Themes1="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Classic"
mc:Ignorable="d"
Title="FlowProcessView" Height="550" Width="800" WindowStartupLocation="CenterScreen" WindowStyle="None" AllowsTransparency="True">
<Window.DataContext>
<vm:FlowProcessSetViewModel/>
</Window.DataContext>
<Window.Resources>
<!--<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>-->
<SolidColorBrush x:Key="foreground" Color="#a2c2e8" />
<SolidColorBrush x:Key="borderBrush" Color="#FF074B92" />
<Style x:Key="ComboBoxFocusVisual">
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle
Margin="4,4,21,4"
SnapsToDevicePixels="true"
Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
StrokeDashArray="1 2"
StrokeThickness="1" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Geometry x:Key="DownArrowGeometry">M 0 0 L 3.5 4 L 7 0 Z</Geometry>
<Style x:Key="ComboBoxTransparentButtonStyle" TargetType="{x:Type ToggleButton}">
<Setter Property="MinWidth" Value="0" />
<Setter Property="MinHeight" Value="0" />
<Setter Property="Width" Value="Auto" />
<Setter Property="Height" Value="Auto" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="White" />
<Setter Property="BorderBrush" Value="{x:Static Themes1:ClassicBorderDecorator.ClassicBorderBrush}" />
<Setter Property="BorderThickness" Value="2" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<DockPanel
Background="{TemplateBinding Background}"
LastChildFill="false"
SnapsToDevicePixels="true">
<Themes1:ClassicBorderDecorator
x:Name="Border"
Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderStyle="None"
BorderThickness="{TemplateBinding BorderThickness}"
DockPanel.Dock="Right">
<Path
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="{StaticResource DownArrowGeometry}"
Fill="{TemplateBinding Foreground}" />
</Themes1:ClassicBorderDecorator>
</DockPanel>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="true">
<Setter TargetName="Border" Property="BorderStyle" Value="AltPressed" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" />
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="ComboBoxEditableTextBox" TargetType="{x:Type TextBox}">
<Setter Property="OverridesDefaultStyle" Value="true" />
<Setter Property="AllowDrop" Value="true" />
<Setter Property="MinWidth" Value="0" />
<Setter Property="Foreground" Value="{DynamicResource foreground}" />
<Setter Property="MinHeight" Value="0" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst" />
<Setter Property="Stylus.IsFlicksEnabled" Value="False" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<ScrollViewer
x:Name="PART_ContentHost"
Background="Transparent"
Focusable="false"
HorizontalScrollBarVisibility="Hidden"
VerticalScrollBarVisibility="Hidden" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<ControlTemplate x:Key="ComboBoxEditableTemplate" TargetType="{x:Type ComboBox}">
<Border
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
SnapsToDevicePixels="true">
<Grid>
<Themes1:ClassicBorderDecorator
x:Name="Border"
BorderBrush="{x:Static Themes1:ClassicBorderDecorator.ClassicBorderBrush}"
BorderStyle="None"
BorderThickness="2">
<Popup
x:Name="PART_Popup"
AllowsTransparency="true"
Focusable="False"
IsOpen="{TemplateBinding IsDropDownOpen}"
Placement="Bottom"
PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}">
<Themes1:SystemDropShadowChrome
x:Name="Shdw"
MinWidth="{Binding ActualWidth, ElementName=Border}"
MaxHeight="{TemplateBinding MaxDropDownHeight}"
Color="Transparent">
<Border
x:Name="DropDownBorder"
BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}"
BorderThickness="1">
<Border.Background>
<ImageBrush
ImageSource="/BPASmartClient.CustomResource;component/Image/窗体样式/From/内部背景.png"
Opacity="0.5"
Stretch="Fill" />
</Border.Background>
<ScrollViewer x:Name="DropDownScrollViewer">
<Grid RenderOptions.ClearTypeHint="Enabled">
<Canvas
Width="0"
Height="0"
HorizontalAlignment="Left"
VerticalAlignment="Top">
<Rectangle
x:Name="OpaqueRect"
Width="{Binding ActualWidth, ElementName=DropDownBorder}"
Height="{Binding ActualHeight, ElementName=DropDownBorder}"
Fill="{Binding Background, ElementName=DropDownBorder}" />
</Canvas>
<ItemsPresenter
x:Name="ItemsPresenter"
KeyboardNavigation.DirectionalNavigation="Contained"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Grid>
</ScrollViewer>
</Border>
</Themes1:SystemDropShadowChrome>
</Popup>
</Themes1:ClassicBorderDecorator>
<ToggleButton
Width="Auto"
MinWidth="0"
MinHeight="0"
ClickMode="Press"
Focusable="false"
IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
Style="{StaticResource ComboBoxTransparentButtonStyle}" />
<DockPanel>
<FrameworkElement Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" DockPanel.Dock="Right" />
<TextBox
x:Name="PART_EditableTextBox"
Margin="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
CaretBrush="White"
IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}"
Style="{StaticResource ComboBoxEditableTextBox}" />
</DockPanel>

</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="HasItems" Value="false">
<Setter TargetName="DropDownBorder" Property="MinHeight" Value="95" />
</Trigger>
<Trigger SourceName="PART_Popup" Property="HasDropShadow" Value="true">
<Setter TargetName="Shdw" Property="Margin" Value="0,0,5,5" />
<Setter TargetName="Shdw" Property="Color" Value="#71000000" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsGrouping" Value="true" />
<Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false" />
</MultiTrigger.Conditions>
<Setter Property="ScrollViewer.CanContentScroll" Value="false" />
</MultiTrigger>
<Trigger SourceName="DropDownScrollViewer" Property="ScrollViewer.CanContentScroll" Value="false">
<Setter TargetName="OpaqueRect" Property="Canvas.Top" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}" />
<Setter TargetName="OpaqueRect" Property="Canvas.Left" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<Style x:Key="BaseComboBoxStyle" TargetType="{x:Type ComboBox}">
<Setter Property="FocusVisualStyle" Value="{StaticResource ComboBoxFocusVisual}" />
<Setter Property="Foreground" Value="{DynamicResource foreground}" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="{DynamicResource borderBrush}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Margin" Value="0,0,0,0" />
<Setter Property="Padding" Value="0" />
<Setter Property="Height" Value="24" />
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
<Setter Property="ScrollViewer.CanContentScroll" Value="true" />
<Setter Property="ScrollViewer.PanningMode" Value="Both" />
<Setter Property="Stylus.IsFlicksEnabled" Value="False" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="IsTextSearchCaseSensitive" Value="true" />
<Setter Property="IsEditable" Value="true" />
<Setter Property="StaysOpenOnEdit" Value="true" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ComboBox}">

<Border
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
SnapsToDevicePixels="true">
<Grid>
<Themes1:ClassicBorderDecorator
x:Name="Border"
BorderBrush="{x:Static Themes1:ClassicBorderDecorator.ClassicBorderBrush}"
BorderStyle="None"
BorderThickness="2">
<Popup
x:Name="PART_Popup"
AllowsTransparency="true"
Focusable="False"
IsOpen="{TemplateBinding IsDropDownOpen}"
Placement="Bottom"
PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}">
<Themes1:SystemDropShadowChrome
x:Name="Shdw"
MinWidth="{Binding ActualWidth, ElementName=Border}"
MaxHeight="{TemplateBinding MaxDropDownHeight}"
Color="Transparent">
<Border
x:Name="DropDownBorder"
BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}"
BorderThickness="1">
<Border.Background>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/窗体样式/From/内部背景.png" />
</Border.Background>
<ScrollViewer x:Name="DropDownScrollViewer">
<Grid RenderOptions.ClearTypeHint="Enabled">
<Canvas
Width="0"
Height="0"
HorizontalAlignment="Left"
VerticalAlignment="Top">
<Rectangle
x:Name="OpaqueRect"
Width="{Binding ActualWidth, ElementName=DropDownBorder}"
Height="{Binding ActualHeight, ElementName=DropDownBorder}"
Fill="{Binding Background, ElementName=DropDownBorder}" />
</Canvas>
<ItemsPresenter
x:Name="ItemsPresenter"
KeyboardNavigation.DirectionalNavigation="Contained"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Grid>
</ScrollViewer>
</Border>
</Themes1:SystemDropShadowChrome>
</Popup>
</Themes1:ClassicBorderDecorator>
<DockPanel Margin="2">
<FrameworkElement Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" DockPanel.Dock="Right" />
<Border x:Name="SelectedItemBorder" Margin="{TemplateBinding Padding}">
<ContentPresenter
Margin="1,1,1,1"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding SelectionBoxItem}"
ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}"
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
</DockPanel>
<ToggleButton
Width="Auto"
MinWidth="0"
MinHeight="0"
Margin="2"
ClickMode="Press"
Focusable="false"
IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
Style="{StaticResource ComboBoxTransparentButtonStyle}" />
</Grid>
</Border>
<ControlTemplate.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<!--<Condition Property="IsSelectionBoxHighlighted" Value="true"/>-->
<Condition Property="IsDropDownOpen" Value="false" />
</MultiTrigger.Conditions>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}" />
</MultiTrigger>
<!--<Trigger Property="IsSelectionBoxHighlighted" Value="true">
<Setter Property="Background" TargetName="SelectedItemBorder" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
</Trigger>-->
<Trigger Property="HasItems" Value="false">
<Setter TargetName="DropDownBorder" Property="MinHeight" Value="95" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsGrouping" Value="true" />
<Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false" />
</MultiTrigger.Conditions>
<Setter Property="ScrollViewer.CanContentScroll" Value="false" />
</MultiTrigger>
<Trigger SourceName="PART_Popup" Property="HasDropShadow" Value="true">
<Setter TargetName="Shdw" Property="Margin" Value="0,0,5,5" />
<Setter TargetName="Shdw" Property="Color" Value="#71000000" />
</Trigger>
<Trigger SourceName="DropDownScrollViewer" Property="ScrollViewer.CanContentScroll" Value="false">
<Setter TargetName="OpaqueRect" Property="Canvas.Top" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}" />
<Setter TargetName="OpaqueRect" Property="Canvas.Left" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsEditable" Value="true">
<Setter Property="IsTabStop" Value="false" />
<Setter Property="Padding" Value="1" />
<Setter Property="Template" Value="{StaticResource ComboBoxEditableTemplate}" />
</Trigger>
</Style.Triggers>

</Style>
<Style BasedOn="{StaticResource BaseComboBoxStyle}" TargetType="ComboBox" />
<!--#endregion-->

<!--#region ColorCommboxStyle-->
<ObjectDataProvider
x:Key="colorPropertieOdp"
MethodName="GetProperties"
ObjectInstance="{x:Type Colors}" />
<Style
x:Key="ColorCommboxStyle"
BasedOn="{StaticResource BaseComboBoxStyle}"
TargetType="ComboBox">
<Setter Property="IsTextSearchCaseSensitive" Value="False" />
<Setter Property="IsEditable" Value="False" />
<Setter Property="StaysOpenOnEdit" Value="False" />
<Setter Property="ItemsSource" Value="{Binding Source={StaticResource colorPropertieOdp}}" />
<Setter Property="ItemTemplate">
<Setter.Value>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Rectangle
Width="40"
Height="10"
Fill="{Binding Name}" />
<TextBlock Text="{Binding Name}" />
</StackPanel>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
<!--#endregion-->
</Window.Resources>
<Border x:Name="br">
<Border.Background>
<SolidColorBrush Color="#264c73"/>
@@ -26,6 +399,9 @@

<Border BorderThickness="0,0,0,1" BorderBrush="#FF2AB2E7"></Border>
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right">
<Button Content="向前新增" Width="100" Margin="0,0,10,0" Height="30" Background="Transparent" BorderBrush="#FF2AB2E7" Foreground="#FF2AB2E7" Cursor="Hand" FontSize="18" Command="{Binding AddFrontFlowItemCommand}" ></Button>
<Button Content="向后新增" Width="100" Margin="0,0,10,0" Height="30" Background="Transparent" BorderBrush="#FF2AB2E7" Foreground="#FF2AB2E7" Cursor="Hand" FontSize="18" Command="{Binding AddLastFlowItemCommand}" ></Button>
<Button Content="删除选项" Width="100" Margin="0,0,10,0" Height="30" Background="Transparent" BorderBrush="#FF2AB2E7" Foreground="#FF2AB2E7" Cursor="Hand" FontSize="18" Command="{Binding DeleteFlowItemCommand}" ></Button>
<Button Content="保存工艺" Width="100" Margin="0,0,10,0" Height="30" Background="Transparent" BorderBrush="#FF2AB2E7" Foreground="#FF2AB2E7" Cursor="Hand" FontSize="18" Command="{Binding ConfirmCommand}" ></Button>
<Button Content="取消" Height="30" Width="100" Margin="0,0,10,0" Background="Transparent" FontSize="18" BorderBrush="#FF2AB2E7" Foreground="#FF2AB2E7" Command="{Binding CloseWindowCommand}"></Button>

@@ -51,25 +427,28 @@
<GridSplitter Grid.Column="4" BorderThickness="0.2" BorderBrush="White"></GridSplitter>
<TextBlock Grid.Column="5" Text="炒制时间" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"/>
</Grid>
<ItemsControl ItemsSource="{Binding flowProcessModels}" Grid.Row="3">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" >
<TextBox Text="{Binding Id}" Foreground="SkyBlue" Width="100" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" FontSize="18" Background="Transparent" IsReadOnly="True" BorderBrush="#FF2AB2E7" BorderThickness="1,1,0.5,1" />
<TextBox Text="{Binding FryMaterialNum}" Width="140" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,0.5,1"/>
<TextBox Text="{Binding FrySpeed}" Width="140" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,0.5,1"/>
<TextBox Text="{Binding FryWeight}" Width="140" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,0.5,1"/>
<TextBox Text="{Binding FryTemperature}" Width="140" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,0.5,1"/>
<TextBox Text="{Binding FryPeriodTime}" Width="140" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,1,1"/>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<ScrollViewer Grid.Row="3" VerticalScrollBarVisibility="Hidden">
<ItemsControl x:Name="itemcontrols" AlternationCount="{Binding flowProcessModels.Count}" ItemsSource="{Binding flowProcessModels}" Margin="0,1,0,-1">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel x:Name="stk" Orientation="Horizontal" >
<Label MouseLeftButtonDown="Label_MouseLeftButtonDown" Content="{Binding Path=(ItemsControl.AlternationIndex),RelativeSource={
RelativeSource TemplatedParent}}" Foreground="SkyBlue" Width="100" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" FontSize="18" Background="Transparent" BorderBrush="#FF2AB2E7" BorderThickness="1,1,0.5,1"/>
<ComboBox ItemsSource="{Binding DataContext.FlowItems, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}" Text="{Binding FryMaterialNum}" Style="{StaticResource BaseComboBoxStyle}" IsReadOnly="True" Width="140" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,0.5,1"/>
<TextBox Text="{Binding FrySpeed}" Width="140" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,0.5,1"/>
<TextBox Text="{Binding FryWeight}" Width="140" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,0.5,1"/>
<TextBox Text="{Binding FryTemperature}" Width="140" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,0.5,1"/>
<TextBox Text="{Binding FryPeriodTime}" Width="140" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,1,1"/>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Grid>
</Border>
</Window>

+ 80
- 2
FryPot_DosingSystem/View/FlowProcessView.xaml.cs Ver arquivo

@@ -1,4 +1,5 @@
using BPASmartClient.Helper;
using FryPot_DosingSystem.Model;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -20,16 +21,93 @@ namespace FryPot_DosingSystem.View
/// </summary>
public partial class FlowProcessView : Window
{
public FlowProcessView()
{
InitializeComponent();
this.br.MouseLeftButtonDown += (o, e) => { if (e.LeftButton == MouseButtonState.Pressed) this.DragMove(); };
ActionManage.GetInstance.CancelRegister("CloseFlowProcessView");
ActionManage.GetInstance.Register(new Action(() => {
ActionManage.GetInstance.Register(new Action(() =>
{
this.Close();
}), "CloseFlowProcessView");

}

private void Label_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
Label txt = sender as Label;
if (txt != null)
{
StackPanel oldSp = FindFirstVisualChild(itemcontrols, "stk");
if (oldSp != null)
oldSp.Background = new SolidColorBrush(Color.FromRgb(38, 76, 115));
StackPanel sp = VisualTreeHelper.GetParent(txt) as StackPanel;
sp.Background = new SolidColorBrush(Color.FromRgb(8, 20, 36));
ActionManage.GetInstance.Send("CurrentItemId", txt.Content);
}
}


public StackPanel FindFirstVisualChild(DependencyObject obj, string childName)
{
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(obj); i++)
{
DependencyObject child = VisualTreeHelper.GetChild(obj, i);
if (child != null && child is StackPanel && child.GetValue(NameProperty).ToString() == childName)
{
if (child is StackPanel stack && stack.Background?.ToString() == "#FF081424")
return stack;
}
else
{
StackPanel SP = FindFirstVisualChild(child, childName);
if (SP != null)
{
return SP;
}
}
}
return null;
}

//private void ComboBox_KeyUp(object sender, KeyEventArgs e)
//{
// var res = sender as ComboBox;
// Json<FlowProcessNames>.Read();

// if (res.Text != null && res.Text != String.Empty)
// {
// var datas = Json<FlowProcessNames>.Data.Names.Where(s => s.Contains(res.Text.Trim()));
// // var datas = Json<MaterialNames>.Data.Names.ToList().FindAll(s => s.Contains(res.Text.Trim()));
// if (datas.Count() > 0)
// {
// res.ItemsSource = datas;
// res.IsDropDownOpen = true;
// }
// else
// {
// res.IsDropDownOpen = false;
// }
// }
//}

//private void ComboBox_LostFocus(object sender, RoutedEventArgs e)
//{
// var res = sender as ComboBox;
// if (res.Text != null && res.Text != String.Empty)
// {
// if (!Json<FlowProcessNames>.Data.Names.Contains(res.Text.Trim()))//判断是否存在原料
// {
// //FlowProcessNames.GetInstance.Names.Add(res.Text.Trim());
// //Json<FlowProcessNames>.Data = FlowProcessNames.GetInstance;
// Json<FlowProcessNames>.Data.Names.Add(res.Text.Trim());
// Json<FlowProcessNames>.Save();
// }

// }
//}
}
}

+ 2
- 2
FryPot_DosingSystem/View/NewRecipeView.xaml.cs Ver arquivo

@@ -40,7 +40,7 @@ namespace FryPot_DosingSystem.View
var res = sender as ComboBox;
Json<MaterialNames>.Read();
if (res.Text != null)
if (res.Text != null && res.Text != String.Empty)
{
var datas = Json<MaterialNames>.Data.Names.Where(s => s.Contains(res.Text.Trim()));
// var datas = Json<MaterialNames>.Data.Names.ToList().FindAll(s => s.Contains(res.Text.Trim()));
@@ -59,7 +59,7 @@ namespace FryPot_DosingSystem.View
private void ComboBox_LostFocus(object sender, RoutedEventArgs e)
{
var res = sender as ComboBox;
if (res.Text != null)
if (res.Text != null && res.Text != String.Empty)
{
if (!MaterialNames.GetInstance.Names.Contains(res.Text.Trim()))//判断是否存在原料
{


+ 122
- 0
FryPot_DosingSystem/View/RecipesSendDown.xaml Ver arquivo

@@ -0,0 +1,122 @@
<UserControl x:Class="FryPot_DosingSystem.View.RecipesSendDown"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:FryPot_DosingSystem.View"
xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
xmlns:vm="clr-namespace:FryPot_DosingSystem.ViewModel"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.DataContext>
<vm:RecipeSetDownViewModel/>
</UserControl.DataContext>
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
<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>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Button HorizontalAlignment="Right" VerticalAlignment="Center" Content="配方一键下发" Width="110" Height="30" Margin="0,0,10,0" Cursor="Hand" Command="{Binding AllRecipeSetDownCommand}"></Button>
<ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" >
<ListView
Margin="5"
VerticalAlignment="Top"
Background="Transparent"
BorderThickness="0"
ItemsSource="{Binding Recipes}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid
HorizontalAlignment="Left"
VerticalAlignment="Top"
Columns="8" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>

<ListView.ItemTemplate>
<DataTemplate>
<Border Margin="5" Background="LightSkyBlue">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="0.25*" />
<RowDefinition Height="0.2*" />
</Grid.RowDefinitions>

<Image Source="/BPASmartClient.CustomResource;component/Image/AGV/炒锅.png" />

<TextBlock
Grid.Row="1"
Margin="2,0,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="#dd000000"
Text="{Binding RecipeName}" />

<Grid
Name="gr"
Grid.Row="2"
Height="30"
Background="#00BEFA">

<pry:IcoButton
Width="{Binding ElementName=gr, Path=ActualWidth}"
Height="{Binding ElementName=gr, Path=ActualHeight}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
BorderThickness="0"
Command="{Binding DataContext.RecipeSetDownCommand, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
CommandParameter="{Binding RecipeId}"
Content="订单下发"
EnterBackground="Red"
FontStyle="Normal"
Foreground="#dd000000"
IcoText="&#xe6cf;"
IsEnabled="{Binding IsEnable}"
Style="{StaticResource IcoButtonStyle}" />


</Grid>

</Grid>
</Border>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ScrollViewer>
</Grid>
</UserControl>

+ 28
- 0
FryPot_DosingSystem/View/RecipesSendDown.xaml.cs Ver arquivo

@@ -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 FryPot_DosingSystem.View
{
/// <summary>
/// RecipesSendDown.xaml 的交互逻辑
/// </summary>
public partial class RecipesSendDown : UserControl
{
public RecipesSendDown()
{
InitializeComponent();
}
}
}

+ 114
- 21
FryPot_DosingSystem/ViewModel/FlowProcessSetViewModel.cs Ver arquivo

@@ -13,69 +13,162 @@ namespace FryPot_DosingSystem.ViewModel
internal class FlowProcessSetViewModel
{
public int Id { get; set; } = 0;
public static int materialNum { get; set; }
public ObservableCollection<FlowProcessModel> flowProcessModels { get; set; } = new ObservableCollection<FlowProcessModel>();

public string currnetRecipeName { get; set;}
public string currentRecipeName { get; set; }
public static int currentItemId { get; set; }
public RelayCommand CloseWindowCommand { get; set; }

public ObservableCollection<string> FlowItems { get; set; } = new ObservableCollection<string>();
public RelayCommand ConfirmCommand { get; set; }
public RelayCommand AddLastFlowItemCommand { get; set; }
public RelayCommand AddFrontFlowItemCommand { get; set; }
public RelayCommand DeleteFlowItemCommand { get; set; }
public FlowProcessSetViewModel()
{
Json<FlowProcessNames>.Read();
// FlowProcessNames.GetInstance.Names = Json<FlowProcessNames>.Data.Names;
FlowItems = Json<FlowProcessNames>.Data.Names;
ActionManage.GetInstance.Register(new Action<object>((obj) =>
{
if (obj != null)
try
{
currentItemId = Convert.ToInt32(obj);
}
catch (Exception)
{

}
}), "CurrentItemId");
//ActionManage.GetInstance.Register(new Action<object>(obj =>
//{
// if (obj != null)
// materialNum = Convert.ToInt32(obj);
//}), "MaterialNum");
ActionManage.GetInstance.Register(new Action<object>(recipeName =>
{
if (recipeName != null)
{
currnetRecipeName = recipeName.ToString();
currentRecipeName = recipeName.ToString();
var res = Json<RecipeManage>.Data.Recipes.FirstOrDefault(p => p.FlowProcess.RecipeName == recipeName.ToString());
if (res != null && res is NewRecipeModel recipe&&res.FlowProcess.fpModels.Count==res.materialCollection.Count+1) //编辑已有工艺
if (res != null && res is NewRecipeModel recipe) //编辑已有工艺
{
//flowProcessModels = recipe.FlowProcess.fpModels;
foreach (var item in recipe.materialCollection)
{
if (!FlowItems.Contains(item.MaterialName))
FlowItems.Insert(0, item.MaterialName);//下拉框
}
foreach (var item in recipe.FlowProcess.fpModels)
{
flowProcessModels.Add(new FlowProcessModel { Id = item.Id, FryMaterialNum = item.FryMaterialNum, FrySpeed = item.FrySpeed, FryWeight = item.FryWeight, FryTemperature = item.FryTemperature, FryPeriodTime = item.FryPeriodTime });
flowProcessModels.Add(new FlowProcessModel {FryMaterialNum = item.FryMaterialNum, FrySpeed = item.FrySpeed, FryWeight = item.FryWeight, FryTemperature = item.FryTemperature, FryPeriodTime = item.FryPeriodTime });
}

// ActionManage.GetInstance.Send("MaterialNum", recipe.materialCollection.Count);
}
else//创建新工艺
{
var name = Json<RecipeManage>.Data.Recipes.FirstOrDefault(p=>p.RecipeName==recipeName.ToString());
var name = Json<RecipeManage>.Data.Recipes.FirstOrDefault(p => p.RecipeName == recipeName.ToString());
if (name != null)
{
if (name.FlowProcess.fpModels.Count > 0)
{
name.FlowProcess.fpModels.Clear();
}
name.FlowProcess.RecipeName = recipeName.ToString();
flowProcessModels.Add(new FlowProcessModel { Id = Id + 1, FryMaterialNum = "油" });
Id++;

foreach (var item in name.materialCollection)
{
flowProcessModels.Add(new FlowProcessModel { Id = Id + 1, FryMaterialNum = item.MaterialName });
Id++;

if (!FlowItems.Contains(item.MaterialName))
FlowItems.Insert(0, item.MaterialName);//下拉框
}
name.FlowProcess.fpModels= flowProcessModels;
ActionManage.GetInstance.Send("MaterialNum", name.materialCollection.Count);
name.FlowProcess.fpModels = flowProcessModels;
}
}
}

}), "EditFlowProcess");
CloseWindowCommand = new RelayCommand(() =>
{
ActionManage.GetInstance.Send("CloseFlowProcessView");
});
ConfirmCommand = new RelayCommand(() =>
{
var name = Json<RecipeManage>.Data.Recipes.FirstOrDefault(p => p.RecipeName == currnetRecipeName.ToString());
var name = Json<RecipeManage>.Data.Recipes.FirstOrDefault(p => p.RecipeName == currentRecipeName.ToString());
if (name != null)
{
name.FlowProcess.RecipeName = currnetRecipeName.ToString();
name.FlowProcess.fpModels = flowProcessModels;
name.FlowProcess.RecipeName = currentRecipeName.ToString();
// name.FlowProcess.fpModels = flowProcessModels;
name.FlowProcess.fpModels.Clear();
foreach (var item in flowProcessModels)
{
name.FlowProcess.fpModels.Add(new FlowProcessModel { FryMaterialNum = item.FryMaterialNum, FrySpeed = item.FrySpeed, FryWeight = item.FryWeight, FryTemperature = item.FryTemperature, FryPeriodTime = item.FryPeriodTime });
}
foreach (var item in name.materialCollection)
{
string s= Json<FlowProcessNames>.Data.Names.FirstOrDefault(p=>p == item.MaterialName);
Json<FlowProcessNames>.Data.Names.Remove(s);
}
}
Json<RecipeManage>.Save();
Json<FlowProcessNames>.Save();
ActionManage.GetInstance.Send("CloseFlowProcessView");
});

AddFrontFlowItemCommand = new RelayCommand(() =>
{
try
{
if (currentItemId == 0)
{
flowProcessModels.Insert(0, new FlowProcessModel());
}
else
{
flowProcessModels.Insert(currentItemId, new FlowProcessModel());
currentItemId = currentItemId + 1;
}
}
catch (Exception)
{

//throw;
}

});
AddLastFlowItemCommand = new RelayCommand(() =>
{
try
{
if (flowProcessModels.Count <= 0)
{
flowProcessModels.Insert(0, new FlowProcessModel());

}
else if (currentItemId != 0)
{
flowProcessModels.Insert(currentItemId + 1, new FlowProcessModel());
}
else
{
flowProcessModels.Add(new FlowProcessModel());
}
}
catch (Exception)
{

// throw;
}
});
DeleteFlowItemCommand = new RelayCommand(() =>
{
if (flowProcessModels.Count > 0)
flowProcessModels.RemoveAt(currentItemId);
currentItemId = 0;
});
}
}
}

+ 1
- 1
FryPot_DosingSystem/ViewModel/NewRecipeViewModel.cs Ver arquivo

@@ -118,7 +118,7 @@ namespace FryPot_DosingSystem.ViewModel
}
else
{
MessageBox.Show("配方名称重复,请重命名!!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
MessageBox.Show("配方名称重复或为空,请重命名!!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}


+ 30
- 21
FryPot_DosingSystem/ViewModel/RecipeSetDownViewModel.cs Ver arquivo

@@ -1,4 +1,6 @@
using BPASmartClient.Helper;
using BPASmartClient.CustomResource.UserControls;
using BPASmartClient.CustomResource.UserControls.MessageShow;
using BPASmartClient.Helper;
using BPASmartClient.Message;
using FryPot_DosingSystem.Model;
using Microsoft.Toolkit.Mvvm.ComponentModel;
@@ -38,13 +40,15 @@ namespace FryPot_DosingSystem.ViewModel
if (res != null)
{
RecipeSetDown(new NewRecipeModel[] { res });
res.RecipeSetInfo = "配方下发成功";
Task.Run(() => { Thread.Sleep(1500); res.RecipeSetInfo = string.Empty; });
//res.RecipeSetInfo = "配方下发成功";
//Task.Run(() => { Thread.Sleep(1500); res.RecipeSetInfo = string.Empty; });
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"配方下发成功!");
}
else
{
res.RecipeSetInfo = "配方下发失败";
Task.Run(() => { Thread.Sleep(1500); res.RecipeSetInfo = string.Empty; });
//res.RecipeSetInfo = "配方下发失败";
//Task.Run(() => { Thread.Sleep(1500); res.RecipeSetInfo = string.Empty; });
NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "提示", $"配方下发失败!");
}
}
@@ -53,23 +57,28 @@ namespace FryPot_DosingSystem.ViewModel
{
if (Recipes != null)
{
//foreach (var recipeModel in Recipes)
//{
// RecipeSetDown(recipeModel);
//}
RecipeSetDown(Recipes.ToArray());
Task.Run(() =>
try
{
RecipeSetDown(Recipes.ToArray());
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"所有配方下发成功!");
}
catch (Exception)
{
foreach (var item in Recipes)
{
item.RecipeSetInfo = "下发成功";
}
Thread.Sleep(1500);
foreach (var item in Recipes)
{
item.RecipeSetInfo = string.Empty;
}
});

NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "提示", $"配方下发失败!");
}
//Task.Run(() =>
//{
// foreach (var item in Recipes)
// {
// item.RecipeSetInfo = "下发成功";
// }
// Thread.Sleep(1500);
// foreach (var item in Recipes)
// {
// item.RecipeSetInfo = string.Empty;
// }
//});

}



+ 3
- 0
FryPot_DosingSystem/ViewModel/RecipeSetViewModel.cs Ver arquivo

@@ -1,4 +1,6 @@
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.CustomResource.UserControls;
using BPASmartClient.CustomResource.UserControls.MessageShow;
using BPASmartClient.Helper;
using FryPot_DosingSystem.Model;
using FryPot_DosingSystem.View;
@@ -83,6 +85,7 @@ namespace FryPot_DosingSystem.ViewModel
{
Json<RecipeManage>.Save();
count = recipeModels.Count;
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"配方保存成功!");
}));
EditRecipeCommand = new RelayCommand<object>((Id) =>
{


+ 3
- 4
SmartClient.sln Ver arquivo

@@ -121,17 +121,16 @@ EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.KHKJ", "BPASmartClient.KHKJ\BPASmartClient.KHKJ.csproj", "{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkTM", "BPASmartClient.MorkTM\BPASmartClient.MorkTM.csproj", "{1612F583-D328-45C6-8BB1-5D41B8F1D216}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.KHKJ", "BPASmartClient.KHKJ\BPASmartClient.KHKJ.csproj", "{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.Nfc", "BPASmartClient.Nfc\BPASmartClient.Nfc.csproj", "{42D35B7C-764C-4692-AA85-9B343A0F5B7F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.Argox", "BPASmartClient.Argox\BPASmartClient.Argox.csproj", "{B8D499BA-A18A-4FD6-B036-44F02B4D164B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.S7Net", "BPASmartClient.S7Net\BPASmartClient.S7Net.csproj", "{D1F2379E-1755-4B50-9D67-15C960C33FFA}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.S7Net", "BPASmartClient.S7Net\BPASmartClient.S7Net.csproj", "{D1F2379E-1755-4B50-9D67-15C960C33FFA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.JXJFoodBigStation", "BPASmartClient.JXJFoodBigStation\BPASmartClient.JXJFoodBigStation.csproj", "{FA695D7E-6F12-4483-A16D-8494609FAE68}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.JXJFoodBigStation", "BPASmartClient.JXJFoodBigStation\BPASmartClient.JXJFoodBigStation.csproj", "{FA695D7E-6F12-4483-A16D-8494609FAE68}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.JXJFoodSmallStation", "BPASmartClient.JXJFoodSmallStation\BPASmartClient.JXJFoodSmallStation.csproj", "{D609C4CF-FA5C-4D39-B12F-07A60FFE5E40}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.JXJFoodSmallStation", "BPASmartClient.JXJFoodSmallStation\BPASmartClient.JXJFoodSmallStation.csproj", "{D609C4CF-FA5C-4D39-B12F-07A60FFE5E40}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution


Carregando…
Cancelar
Salvar