U3D_TobaccoWarehouseISMDTSy.../Assets/Scripts/YL/Conveyorpanel.cs

154 lines
3.8 KiB
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Conveyorpanel : MonoBehaviour
{
/// <summary>
/// 关闭窗口
/// </summary>
public Button Offbutton;
/// <summary>
/// 任务信息
/// </summary>
public Text Timeidtext, Tasknumber, Upperboxtext, Initiationtext, Superweighttext, Goaltext, Underthetext, Cleantext, Dragdowntext, Spotchecktext, Smokeboxtext;
/// <summary>
/// 状态信息
/// </summary>
public Toggle Breakdown, Touch, Operation, Runningovertime, Airswitch, Disconnectingswitch;
/// <summary>
/// 接受接口的数据
/// </summary>
public void Getconvey(string timetext, string tasknumber, string upperboxtext, string initiationtext, string superweighttext, string goaltext, string underthetext,
string cleantext, string dragdowntext, string spotchecktext, string smokeboxtext, string breakdown, string touch, string operation,
string runningovertime, string airswitch, string disconnectingswitch, Action action)
{
Timeidtext.text = timetext;
Tasknumber.text = tasknumber;
Upperboxtext.text = upperboxtext;
Initiationtext.text = initiationtext;
Superweighttext.text = superweighttext;
Goaltext.text = goaltext;
Underthetext.text = underthetext;
Cleantext.text = cleantext;
Dragdowntext.text = dragdowntext;
Spotchecktext.text = spotchecktext;
Smokeboxtext.text = smokeboxtext;
switch (breakdown)
{
case "False":
Breakdown.isOn = false;
break;
case "":
Breakdown.isOn = false;
break;
case "True":
Breakdown.isOn = true;
break;
default:
break;
}
switch (touch)
{
case "False":
Touch.isOn = false;
break;
case "":
Touch.isOn = false;
break;
case "True":
Touch.isOn = true;
break;
default:
break;
}
switch (operation)
{
case "False":
Operation.isOn = false;
break;
case "":
Operation.isOn = false;
break;
case "True":
Operation.isOn = true;
break;
default:
break;
}
switch (runningovertime)
{
case "False":
Runningovertime.isOn = false;
break;
case "":
Runningovertime.isOn = false;
break;
case "True":
Runningovertime.isOn = true;
break;
default:
break;
}
switch (airswitch)
{
case "False":
Airswitch.isOn = false;
break;
case "":
Airswitch.isOn = false;
break;
case "True":
Airswitch.isOn = true;
break;
default:
break;
}
switch (disconnectingswitch)
{
case "False":
Disconnectingswitch.isOn = false;
break;
case "":
Disconnectingswitch.isOn = false;
break;
case "True":
Disconnectingswitch.isOn = true;
break;
default:
break;
}
Offbutton.onClick.AddListener(() =>
{
if (action != null)
{
action?.Invoke();
}
});
}
void Start()
{
}
void Update()
{
}
}