75 lines
3.0 KiB
C#
75 lines
3.0 KiB
C#
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UVC.Data;
|
|
using UVC.Log;
|
|
using UVC.network;
|
|
using UVC.Network;
|
|
using UVC.Tests;
|
|
using UVC.UI.Modal;
|
|
|
|
namespace SampleProject
|
|
{
|
|
public class AppMain : MonoBehaviour
|
|
{
|
|
|
|
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
|
async void Start()
|
|
{
|
|
|
|
//Tester.RunAllTests();
|
|
|
|
//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");
|
|
|
|
|
|
|
|
//Dictionary<string, string> headers = new Dictionary<string, string>();
|
|
//headers.Add("Content-Encoding", "gzip");
|
|
//string result = await HttpRequester.RequestPost<string>("http://localhost:8888/AGV/00:00", (string)null, headers);
|
|
//ULog.Debug($"AGV Result: {result}");
|
|
|
|
//MQTTService mqttService = new MQTTService("localhost", 1883);
|
|
//mqttService.AddTopicHandler("AGV", (topic, message) =>
|
|
//{
|
|
// ULog.Debug($"Received message on topic {topic}: {message}");
|
|
//});
|
|
//mqttService.Connect();
|
|
}
|
|
|
|
public async void ShowSimpleAlert()
|
|
{
|
|
Debug.Log("알림창을 엽니다...");
|
|
await Alert.Show("알림", "이것은 간단한 알림 메시지입니다.");
|
|
Debug.Log("알림창이 닫혔습니다.");
|
|
}
|
|
|
|
public async void ShowAlertWithCustomConfirmText()
|
|
{
|
|
await Alert.Show("경고", "데이터를 저장할 수 없습니다.", "알겠습니다");
|
|
}
|
|
|
|
public async void ShowLocalizedAlert()
|
|
{
|
|
// locale.json에 다음 키들이 정의되어 있다고 가정:
|
|
// "alert_title_error": "오류", "Error"
|
|
// "alert_message_network": "네트워크 연결을 확인해주세요.", "Please check your network connection."
|
|
// "alert_button_retry": "재시도", "Retry"
|
|
|
|
await Alert.ShowLocalized("error", "error_network_not", "button_retry");
|
|
// 또는 확인 버튼에 기본 키(modal_confirm_button)를 사용하려면:
|
|
// await Alert.ShowLocalized("alert_title_error", "alert_message_network");
|
|
}
|
|
}
|
|
}
|