93 lines
3.1 KiB
C#
93 lines
3.1 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using EasyInject.Attributes;
|
|
using TMPro;
|
|
/// <summary>
|
|
/// 堆垛机弹窗UI面板
|
|
/// </summary>
|
|
[GameObjectBean]
|
|
public class StackerPopUI : AbstractPopUI
|
|
{
|
|
[Header("堆垛机------------")]
|
|
[Header("设备名称")]
|
|
public TMP_Text stacker_deviceName;
|
|
|
|
[Header("设备编号")]
|
|
public TMP_Text stacker_deviceCode;
|
|
|
|
[Header("驱动名称")]
|
|
public TMP_Text stacker_driverName;
|
|
|
|
[Header("驱动策略")]
|
|
public TMP_Text stacker_strategy;
|
|
|
|
[Header("前叉状态")]
|
|
public TMP_Text stacker_frontStatus;
|
|
|
|
[Header("后叉状态")]
|
|
public TMP_Text stacker_backStatus;
|
|
|
|
[Header("前叉托盘")]
|
|
public TMP_Text stacker_frontContiner;
|
|
|
|
[Header("后叉托盘")]
|
|
public TMP_Text stacker_backContianer;
|
|
|
|
[Header("前指令")]
|
|
public TMP_Text stacker_frontIns;
|
|
|
|
[Header("后指令")]
|
|
public TMP_Text stacker_backIns;
|
|
|
|
[Header("异常消息")]
|
|
public TMP_Text stacker_message;
|
|
|
|
private DeviceData deviceData;
|
|
public override void Open(IDevice stacker)
|
|
{
|
|
DeviceData deviceData = stacker.DeviceData;
|
|
StackerData stackerData = stacker.DynamicData<StackerData>();
|
|
base.Open(stacker);
|
|
stacker_deviceCode.text = deviceData.deviceCode;
|
|
stacker_deviceName.text = deviceData.deviceName;
|
|
stacker_driverName.text = deviceData.driverName;
|
|
//stacker_backContianer.text = stackerData.backContainerCode;
|
|
stacker_frontContiner.text = stackerData.frontContainerCode;
|
|
stacker_frontIns.text = stackerData.frontInstructionCode;
|
|
//stacker_backIns.text = stackerData.backInstructionCode;
|
|
//stacker_backStatus.text = stackerData.backStatusDescription;
|
|
stacker_frontStatus.text = stackerData.frontStatusDescription;
|
|
stacker_message.text = deviceData.errorMessage;
|
|
stacker_strategy.text = deviceData.driverCode;
|
|
stacker.DataChange += DataChanageHandle;
|
|
gameObject.SetActive(!gameObject.activeSelf);
|
|
rectTransform.transform.parent = stacker.Transform;
|
|
rectTransform.localPosition = Vector3.zero + offset;
|
|
|
|
}
|
|
|
|
public override void DataChanageHandle(object data, object other)
|
|
{
|
|
StackerData stackerData = (StackerData)data;
|
|
DeviceData deviceData = (DeviceData)other;
|
|
if (this.deviceData.deviceCode != deviceData.deviceCode)
|
|
{
|
|
return;
|
|
}
|
|
stacker_deviceCode.text = deviceData.deviceCode;
|
|
stacker_deviceName.text = deviceData.deviceName;
|
|
stacker_driverName.text = deviceData.driverName;
|
|
//stacker_backContianer.text = stackerData.backContainerCode;
|
|
stacker_frontContiner.text = stackerData.frontContainerCode;
|
|
stacker_frontIns.text = stackerData.frontInstructionCode;
|
|
//stacker_backIns.text = stackerData.backInstructionCode;
|
|
//stacker_backStatus.text = stackerData.backStatusDescription;
|
|
stacker_frontStatus.text = stackerData.frontStatusDescription;
|
|
stacker_message.text = deviceData.errorMessage;
|
|
stacker_strategy.text = deviceData.driverCode;
|
|
}
|
|
|
|
|
|
}
|