using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FryPot_DosingSystem.Control
{
///
/// plc变量
///
internal class GlobalVariable
{
///
/// 滚筒线1
///
public RollerLineOne rollerLineOne = new RollerLineOne();
///
/// 滚筒线2
///
public RollerLineTwo rollerLineTwo = new RollerLineTwo();
///
/// 滚筒线3
///
public RollerLineThree rollerLineThree = new RollerLineThree();
///
/// 炒锅1
///
public FryPotOne fryPotOne= new FryPotOne();
///
/// 炒锅2
///
public FryPotTwo fryPotTwo= new FryPotTwo();
///
/// 炒锅3
///
public FryPotThree fryPotThree= new FryPotThree();
///
/// 炒锅4
///
public FryPotFour fryPotFour= new FryPotFour();
///
/// 炒锅5
///
public FryPotFive fryPotFive= new FryPotFive();
///
/// 洗桶进桶滚筒运行信号
///
public ushort CleadBarrelEnterSingle { get; set; }
///
/// 洗桶出桶滚筒运行信号
///
public ushort CleadBarrelExitSingle { get; set; }
///
/// PLC初始化状态
///
public ushort PlcInite { get; set; }
#region 上位机内部逻辑条件
///
/// 退出主任务循环
///
public bool ExitMainTask { get; set; }
///
/// 允许AGV去线体1装桶条件
///
public bool AllowAgvToLineLoadRoller { get; set; } = true;
///
/// 允许AGV去线体2装桶条件
///
public bool AllowAgvToLineTwoLoadRoller { get; set; } = true;
///
/// 允许AGV去线体3装桶条件
///
public bool AllowAgvToLineThreeLoadRoller { get; set; } = true;
///
/// 配方唯一ID
///
public string RecipeId { get; set; }
///
/// 线体1对应的进桶出桶互锁
///
public bool InOrOutputLock { get; set; }
///
/// 线体2对应的进桶出桶互锁
///
public bool LTwoInOrOutputLock { get; set; }
///
/// 线体3对应的进桶出桶互锁
///
public bool LThreeInOrOutputLock { get; set; }
///
/// 线体1任务执行锁
///
public bool LOneTaskLock { get; set; }
///
/// 线体2任务执行锁
///
public bool LTwoTaskLock { get; set; }
///
/// 线体3任务执行锁
///
public bool LThreeTaskLock { get; set; }
///
/// 线体1当前正在制作的配方名称
///
public string LOneCurrentRecipeName { get; set; } = string.Empty;
///
/// 线体2当前正在制作的配方名称
///
public string LTwoCurrentRecipeName { get; set; } = string.Empty;
///
/// 线体3当前正在制作的配方名称
///
public string LThreeCurrentRecipeName { get; set; } = string.Empty;
#endregion
#region 线体1流程互锁变量
public bool LoadRoller { get; set; }
public bool AgvToFryPot { get; set; }
public bool PotOneInputMaterialArrive { get; set; }
public bool PotOneOutputRollerArrive { get; set; }
public bool AgvArrivePot { get; set; }
#endregion
#region 线体2流程互锁变量
public bool LTwoLoadRoller { get; set; }
public bool LTwoAgvToFryPot { get; set; }
public bool LTwoPotInputMaterialArrive { get; set; }
public bool LTwoPotOutputRollerArrive { get; set; }
public bool LTwoAgvArrivePot { get; set; }
#endregion
#region 线体3流程互锁变量
public bool LThreeLoadRoller { get; set; }
public bool LThreeAgvToFryPot { get; set; }
public bool LThreePotInputMaterialArrive { get; set; }
public bool LThreePotOutputRollerArrive { get; set; }
public bool LThreeAgvArrivePot { get; set; }
#endregion
#region AGV视图显示变量
public int LOneMaterialNum = 0;
public int LOneFryPotSerial = 1;
public int LOneCurrentCookingStep = 0;
public bool agvArriveUpLoad;
public bool agvArriveUnLoad;
public bool agvFryPotEmptyRollerArrive;
public bool EmptyRollerUnLoadcCom { get; set; }//AGV空桶4号线体下料完成
public int LTwoMaterialNum = 0;
public int LTwoFryPotSerial = 2;
public int LTwoCurrentCookingStep = 0;
public bool agvArriveLTwoUpLoad;
public bool LTwoagvArriveUnLoad;
public bool LTwoagvFryPotEmptyRollerArrive;
public bool LTwoEmptyRollerUnLoadcCom { get; set; }//AGV空桶4号线体下料完成
public int LThreeMaterialNum = 0;
public int LThreeFryPotSerial = 3;
public int LThreeCurrentCookingStep = 0;
public bool agvArriveLThreeUpLoad;
public bool LThreeagvArriveUnLoad;
public bool LThreeagvFryPotEmptyRollerArrive;
public bool LThreeEmptyRollerUnLoadcCom { get; set; }//AGV空桶4号线体下料完成
public int LFourRollerNum = 0;
#endregion
}
///
/// 滚筒线1相关变量
///
public class RollerLineOne
{
///
/// 工位号1
///
public ushort StationOne { get; set; }
///
/// 工位号2
///
public ushort StationTwo { get; set; }
///
/// 工位号3
///
public ushort StationThree { get; set; }
///
/// 工位号4
///
public ushort StationFour { get; set; }
///
/// 工位号5
///
public ushort StationFive { get; set; }
///
/// 工位号6
///
public ushort StationSix { get; set; }
///
/// 工位号7
///
public ushort StationSeven { get; set; }
///
/// 工位号8
///
public ushort StationEight { get; set; }
///
/// 输送出料滚筒运行信号
///
public ushort OutMaterialingSingle { get; set; }
///
/// 输送出料滚筒运行故障信号
///
public ushort OutMaterialingTroubleSingle { get; set; }
///
/// 当前线体配方完成信号
///
public ushort RecipeCompleteSingle { get; set; }
}
///
/// 滚筒线2相关变量
///
public class RollerLineTwo
{
///
/// 工位号1
///
public ushort StationOne { get; set; }
///
/// 工位号2
///
public ushort StationTwo { get; set; }
///
/// 工位号3
///
public ushort StationThree { get; set; }
///
/// 工位号4
///
public ushort StationFour { get; set; }
///
/// 工位号5
///
public ushort StationFive { get; set; }
///
/// 工位号6
///
public ushort StationSix { get; set; }
///
/// 工位号7
///
public ushort StationSeven { get; set; }
///
/// 工位号8
///
public ushort StationEight { get; set; }
///
/// 输送出料滚筒运行信号
///
public ushort OutMaterialingSingle { get; set; }
///
/// 输送出料滚筒运行故障信号
///
public ushort OutMaterialingTroubleSingle { get; set; }
///
/// 当前线体配方完成信号
///
public ushort RecipeCompleteSingle { get; set; }
}
///
/// 滚筒线3相关变量
///
public class RollerLineThree
{
///
/// 工位号1
///
public ushort StationOne { get; set; }
///
/// 工位号2
///
public ushort StationTwo { get; set; }
///
/// 工位号3
///
public ushort StationThree { get; set; }
///
/// 工位号4
///
public ushort StationFour { get; set; }
///
/// 工位号5
///
public ushort StationFive { get; set; }
///
/// 工位号6
///
public ushort StationSix { get; set; }
///
/// 工位号7
///
public ushort StationSeven { get; set; }
///
/// 工位号8
///
public ushort StationEight { get; set; }
///
/// 输送出料滚筒运行信号
///
public ushort OutMaterialingSingle { get; set; }
///
/// 输送出料滚筒运行故障信号
///
public ushort OutMaterialingTroubleSingle { get; set; }
///
/// 当前线体配方完成信号
///
public ushort RecipeCompleteSingle { get; set; }
}
///
/// 滚筒线4相关变量
///
public class RollerLineFour
{
///
/// 工位号1
///
public ushort StationOne { get; set; }
///
/// 工位号2
///
public ushort StationTwo { get; set; }
///
/// 工位号3
///
public ushort StationThree { get; set; }
///
/// 工位号4
///
public ushort StationFour { get; set; }
///
/// 工位号5
///
public ushort StationFive { get; set; }
///
/// 工位号6
///
public ushort StationSix { get; set; }
///
/// 工位号7
///
public ushort StationSeven { get; set; }
///
/// 工位号8
///
public ushort StationEight { get; set; }
///
/// 输送出料滚筒运行信号
///
public ushort OutMaterialingSingle { get; set; }
///
/// 输送出料滚筒运行故障信号
///
public ushort OutMaterialingTroubleSingle { get; set; }
///
/// 当前线体配方完成信号
///
public ushort RecipeCompleteSingle { get; set; }
}
///
/// 炒锅1相关变量
///
public class FryPotOne
{
///
/// 进料滚筒运行信号
///
public ushort InputMaterialRollerRunningSingle { get; set; }
///
/// 进料到位信号
///
public ushort InputMaterialArrivedSingle { get; set; }
///
/// 空桶到位信号
///
public ushort EmptyBarrelArrivedSingle { get; set; }
///
/// 空桶滚筒运行信号
///
public ushort EmptyBarrelRollerRunningSingle { get; set; }
///
/// 滚筒故障信号
///
public ushort RollerTroubleSingle { get; set; }
}
///
/// 炒锅2相关变量
///
public class FryPotTwo
{
///
/// 进料滚筒运行信号
///
public ushort InputMaterialRollerRunningSingle { get; set; }
///
/// 进料到位信号
///
public ushort InputMaterialArrivedSingle { get; set; }
///
/// 空桶到位信号
///
public ushort EmptyBarrelArrivedSingle { get; set; }
///
/// 空桶滚筒运行信号
///
public ushort EmptyBarrelRollerRunningSingle { get; set; }
///
/// 滚筒故障信号
///
public ushort RollerTroubleSingle { get; set; }
}
///
/// 炒锅3相关变量
///
public class FryPotThree
{
///
/// 进料滚筒运行信号
///
public ushort InputMaterialRollerRunningSingle { get; set; }
///
/// 进料到位信号
///
public ushort InputMaterialArrivedSingle { get; set; }
///
/// 空桶到位信号
///
public ushort EmptyBarrelArrivedSingle { get; set; }
///
/// 空桶滚筒运行信号
///
public ushort EmptyBarrelRollerRunningSingle { get; set; }
///
/// 滚筒故障信号
///
public ushort RollerTroubleSingle { get; set; }
}
///
/// 炒锅4相关变量
///
public class FryPotFour
{
///
/// 进料滚筒运行信号
///
public ushort InputMaterialRollerRunningSingle { get; set; }
///
/// 进料到位信号
///
public ushort InputMaterialArrivedSingle { get; set; }
///
/// 空桶到位信号
///
public ushort EmptyBarrelArrivedSingle { get; set; }
///
/// 空桶滚筒运行信号
///
public ushort EmptyBarrelRollerRunningSingle { get; set; }
///
/// 滚筒故障信号
///
public ushort RollerTroubleSingle { get; set; }
}
///
/// 炒锅5相关变量
///
public class FryPotFive
{
///
/// 进料滚筒运行信号
///
public ushort InputMaterialRollerRunningSingle { get; set; }
///
/// 进料到位信号
///
public ushort InputMaterialArrivedSingle { get; set; }
///
/// 空桶到位信号
///
public ushort EmptyBarrelArrivedSingle { get; set; }
///
/// 空桶滚筒运行信号
///
public ushort EmptyBarrelRollerRunningSingle { get; set; }
///
/// 滚筒故障信号
///
public ushort RollerTroubleSingle { get; set; }
}
}