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