67 lines
2.2 KiB
C#
67 lines
2.2 KiB
C#
using Cysharp.Threading.Tasks;
|
|
using System;
|
|
using UnityEngine;
|
|
using UVC.Core;
|
|
using UVC.Data;
|
|
using UVC.Tests;
|
|
|
|
namespace SampleProject
|
|
{
|
|
[DefaultExecutionOrder(100)]
|
|
public class AppMain : SingletonApp<AppMain>
|
|
{
|
|
|
|
public Action Initialized;
|
|
|
|
private MQTTPipeLine mqttPipeLine;
|
|
public MQTTPipeLine MQTTPipeLine => mqttPipeLine;
|
|
|
|
/// <summary>
|
|
/// 초기 화 메서드입니다.
|
|
/// Awake 메서드에서 호출되며, MonoBehaviour가 생성될 때 한 번만 실행됩니다.
|
|
/// </summary>
|
|
protected override void Init()
|
|
{
|
|
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.AddTopic("ALARM");
|
|
mqttPipeLine.Execute();
|
|
|
|
//10초 후 정지
|
|
//UniTask.Delay(TimeSpan.FromSeconds(10)).ContinueWith(() =>
|
|
//{
|
|
// mqttPipeLine.Stop();
|
|
//});
|
|
}
|
|
|
|
}
|
|
}
|