61 lines
2.1 KiB
C#
61 lines
2.1 KiB
C#
using System;
|
|
using UnityEngine;
|
|
using UVC.Core;
|
|
using UVC.Data;
|
|
using UVC.UI.Tooltip;
|
|
|
|
namespace SampleProject
|
|
{
|
|
public class AppMain : SingletonApp<AppMain>
|
|
{
|
|
|
|
public Action Initialized;
|
|
|
|
private MQTTPipeLine mqttPipeLine;
|
|
public MQTTPipeLine MQTTPipeLine => mqttPipeLine;
|
|
|
|
/// <summary>
|
|
/// 초기 화 메서드입니다.
|
|
/// Awake 메서드에서 호출되며, MonoBehaviour가 생성될 때 한 번만 실행됩니다.
|
|
/// </summary>
|
|
protected override void Init()
|
|
{
|
|
Canvas rootCanvas = GameObject.FindFirstObjectByType<Canvas>();
|
|
if (rootCanvas != null && !TooltipManager.Instance.IsInitialized) TooltipManager.Instance.Initialize(rootCanvas.transform, rootCanvas);
|
|
|
|
SetNetworkInfo();
|
|
if (Initialized != null)
|
|
{
|
|
Initialized.Invoke();
|
|
}
|
|
}
|
|
|
|
void Start()
|
|
{
|
|
//Tester.RunAllTests();
|
|
}
|
|
|
|
private void SetNetworkInfo()
|
|
{
|
|
URLList.Add("baseinfo", "http://localhost:8888/baseinfo/00:00");
|
|
URLList.Add("AGV", "http://localhost:8888/AGV/00:00");
|
|
URLList.Add("STOCKER_STACK", "http://localhost:8888/STOCKER_STACK/00:00");
|
|
URLList.Add("CARRIER", "http://localhost:8888/CARRIER/00:00");
|
|
URLList.Add("EQUIPMENT", "http://localhost:8888/EQUIPMENT/00:00");
|
|
URLList.Add("PORT", "http://localhost:8888/PORT/00:00");
|
|
URLList.Add("RACK", "http://localhost:8888/RACK/00:00");
|
|
URLList.Add("TWIN_FORK", "http://localhost:8888/TWIN_FORK/00:00");
|
|
URLList.Add("HVC_PLC", "http://localhost:8888/HVC_PLC/00:00");
|
|
URLList.Add("HVC_CRANE", "http://localhost:8888/HVC_CRANE/00:00");
|
|
URLList.Add("ALARM", "http://localhost:8888/ALARM/00:00");
|
|
URLList.Add("Dashboard", "http://localhost:8888/Dashboard/00:00");
|
|
URLList.Add("SIMULATION_RANK", "http://localhost:8888/SIMULATION_RANK/00:00");
|
|
|
|
mqttPipeLine = new MQTTPipeLine("localhost", 1883);
|
|
mqttPipeLine.AddTopic("AGV");
|
|
mqttPipeLine.Execute();
|
|
}
|
|
|
|
}
|
|
}
|