통신 설정 기준 설비 정보 연결 초기화, 적용 기능 추가
This commit is contained in:
@@ -412380,6 +412380,11 @@ PrefabInstance:
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7787345956152867663, guid: b59b3195a2b1ed64ebe226010a38ae94,
|
||||
type: 3}
|
||||
propertyPath: m_Name
|
||||
value: machineInfoPath
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7981249893794920768, guid: b59b3195a2b1ed64ebe226010a38ae94,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
|
||||
@@ -37,9 +37,8 @@ public class MQTT : Protocol, ISingle, IOptionable
|
||||
}
|
||||
public void MQTTConnect()
|
||||
{
|
||||
Disconnect();
|
||||
//Disconnect();
|
||||
|
||||
errorMessage = ". . .";
|
||||
int.TryParse(port, out portData);
|
||||
subscriptionTopics = topics.Split(",");
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ namespace CHN
|
||||
httpData.InitInputFields(httpManager);
|
||||
|
||||
UI_StandardInfoFile = Find<UI_InputOrFind>("UI_StandardInfoFile");
|
||||
UI_StandardInfoFile.InitInfoFile(this);
|
||||
UI_StandardInfoFile.onClickFind += FindStandardInfo;
|
||||
}
|
||||
public void Update()
|
||||
@@ -154,6 +155,9 @@ namespace CHN
|
||||
|
||||
httpData.ResetInputFields(httpManager);
|
||||
httpManager.HTTPConnect();
|
||||
|
||||
UI_StandardInfoFile.ResetInputOrFind(this);
|
||||
ReadStandardInfo(new string[] { machineInfoPath });
|
||||
}
|
||||
|
||||
internal override void Accept()
|
||||
@@ -163,6 +167,9 @@ namespace CHN
|
||||
|
||||
httpData.AcceptInputFields(httpManager);
|
||||
httpManager.HTTPConnect();
|
||||
|
||||
UI_StandardInfoFile.AcceptInputOrFind(this);
|
||||
ReadStandardInfo(new string[] { machineInfoPath });
|
||||
}
|
||||
internal override void Open()
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
@@ -8,14 +9,23 @@ namespace CHN
|
||||
{
|
||||
public class UI_InputOrFind : UIBase
|
||||
{
|
||||
TextMeshProUGUI Text_Path;
|
||||
TextMeshProUGUI machineInfoPath;
|
||||
Button Button_Find;
|
||||
Image Image_Connected;
|
||||
Image Image_UnConnected;
|
||||
TextMeshProUGUI ErrorMessage;
|
||||
|
||||
public Action onClickFind;
|
||||
private Dictionary<string, string> initOption = new();
|
||||
private Dictionary<string, string> mappingOption = new();
|
||||
|
||||
public void InitInfoFile(MonoBehaviour mo)
|
||||
{
|
||||
var optionManager = FindSingle<OptionManager>();
|
||||
var option = optionManager.GetOption(mo);
|
||||
|
||||
initOption.Add(machineInfoPath.name, option[machineInfoPath.name]);
|
||||
}
|
||||
public enum State
|
||||
{
|
||||
None,
|
||||
@@ -53,7 +63,7 @@ namespace CHN
|
||||
|
||||
public void SetPathText(string str)
|
||||
{
|
||||
Text_Path.SetText(str);
|
||||
machineInfoPath.SetText(str);
|
||||
}
|
||||
public void SetErrorMessageText(string error)
|
||||
{
|
||||
@@ -69,5 +79,23 @@ namespace CHN
|
||||
{
|
||||
onClickFind?.Invoke();
|
||||
}
|
||||
public void ResetInputOrFind(MonoBehaviour mo)
|
||||
{
|
||||
var optionManager = FindSingle<OptionManager>();
|
||||
|
||||
foreach (var key in initOption.Keys)
|
||||
{
|
||||
machineInfoPath.text = initOption[key];
|
||||
}
|
||||
optionManager.SetOptionValue(mo, initOption);
|
||||
}
|
||||
public void AcceptInputOrFind(MonoBehaviour mo)
|
||||
{
|
||||
var optionManager = FindSingle<OptionManager>();
|
||||
mappingOption.Clear();
|
||||
|
||||
mappingOption.Add(machineInfoPath.name, machineInfoPath.text);
|
||||
optionManager.SetOptionValue(mo, mappingOption);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -122,9 +122,6 @@ namespace CHN
|
||||
{
|
||||
switch (req.State)
|
||||
{
|
||||
case HTTPRequestStates.Processing:
|
||||
errorMessage = ". . .";
|
||||
break;
|
||||
case HTTPRequestStates.Finished:
|
||||
if (resp.IsSuccess)
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user