| | |
| | | private const string ConstraintMachineName = "拘束机"; |
| | | private const string PinMachineName = "插拔钉机"; |
| | | |
| | | // 拘束机点位 |
| | | private static readonly List<string> ConstraintMachineCodes = new List<string> { "10180", "20090" }; |
| | | // 插拔钉机点位 |
| | | private static readonly List<string> PinMachineCodes = new List<string> { "10190", "20100" }; |
| | | |
| | | public void HandleInboundNextAddress(CommonConveyorLine conveyorLine, string nextAddress, string childDeviceCode) |
| | | { |
| | | HandleDeviceRequest(conveyorLine, nextAddress, childDeviceCode, isUpper: true); |
| | |
| | | { |
| | | var devices = Storage.Devices; |
| | | |
| | | if (string.Equals(nextAddress, ConstraintMachineName, StringComparison.Ordinal)) |
| | | if (ConstraintMachineCodes.Contains(nextAddress)) |
| | | { |
| | | ConstraintMachine? constraint = devices.OfType<ConstraintMachine>().FirstOrDefault(d => d.DeviceName == ConstraintMachineName); |
| | | if (constraint == null) |
| | |
| | | conveyorLine, |
| | | childDeviceCode, |
| | | getMaterialRequest: () => isUpper |
| | | ? constraint.GetValue<ConstraintMachineDBName, bool>(ConstraintMachineDBName.MaterialRequestUpper) |
| | | : constraint.GetValue<ConstraintMachineDBName, bool>(ConstraintMachineDBName.MaterialRequestLower), |
| | | ? constraint.GetValue<ConstraintMachineDBName, short>(ConstraintMachineDBName.MaterialRequestUpper) != 0 |
| | | : constraint.GetValue<ConstraintMachineDBName, short>(ConstraintMachineDBName.MaterialRequestLower) != 0, |
| | | getOutputRequest: () => isUpper |
| | | ? constraint.GetValue<ConstraintMachineDBName, bool>(ConstraintMachineDBName.OutputRequestUpper) |
| | | : constraint.GetValue<ConstraintMachineDBName, bool>(ConstraintMachineDBName.OutputRequestLower), |
| | | ? constraint.GetValue<ConstraintMachineDBName, short>(ConstraintMachineDBName.OutputRequestUpper) != 0 |
| | | : constraint.GetValue<ConstraintMachineDBName, short>(ConstraintMachineDBName.OutputRequestLower) != 0, |
| | | setOutputReady: outputReq => |
| | | { |
| | | if (isUpper) |
| | |
| | | } |
| | | }); |
| | | } |
| | | else if (string.Equals(nextAddress, PinMachineName, StringComparison.Ordinal)) |
| | | else if (PinMachineCodes.Contains(nextAddress)) |
| | | { |
| | | PinMachine? pinMachine = devices.OfType<PinMachine>().FirstOrDefault(d => d.DeviceName == PinMachineName); |
| | | if (pinMachine == null) |
| | |
| | | conveyorLine, |
| | | childDeviceCode, |
| | | getMaterialRequest: () => isUpper |
| | | ? pinMachine.GetValue<PinMachineDBName, bool>(PinMachineDBName.MaterialRequestUpper) |
| | | : pinMachine.GetValue<PinMachineDBName, bool>(PinMachineDBName.MaterialRequestLower), |
| | | ? pinMachine.GetValue<PinMachineDBName, short>(PinMachineDBName.MaterialRequestUpper) != 0 |
| | | : pinMachine.GetValue<PinMachineDBName, short>(PinMachineDBName.MaterialRequestLower) != 0, |
| | | getOutputRequest: () => isUpper |
| | | ? pinMachine.GetValue<PinMachineDBName, bool>(PinMachineDBName.OutputRequestUpper) |
| | | : pinMachine.GetValue<PinMachineDBName, bool>(PinMachineDBName.OutputRequestLower), |
| | | ? pinMachine.GetValue<PinMachineDBName, short>(PinMachineDBName.OutputRequestUpper) != 0 |
| | | : pinMachine.GetValue<PinMachineDBName, short>(PinMachineDBName.OutputRequestLower) != 0, |
| | | setOutputReady: outputReq => |
| | | { |
| | | if (isUpper) |