This commit is contained in:
2025-05-28 19:02:53 +09:00
parent 308affbac9
commit 94e8a4e777
5 changed files with 19 additions and 68 deletions

53
.json
View File

@@ -1,52 +1 @@
[
{
"prefabName": "RoboArm",
"modelName": "RoboArm_1",
"modelType": "Resource",
"modelID": "",
"nodeID": "",
"position": "(-2.93, 0.00, -16.20)",
"rotation": "(0.00000, 0.00000, 0.00000, 1.00000)",
"scale": "(1.00, 1.00, 1.00)"
},
{
"prefabName": "RoboArm",
"modelName": "RoboArm_0",
"modelType": "Resource",
"modelID": "",
"nodeID": "",
"position": "(-0.12, 0.00, -9.08)",
"rotation": "(0.00000, 0.00000, 0.00000, 1.00000)",
"scale": "(1.00, 1.00, 1.00)"
},
{
"prefabName": "AssemblyLine",
"modelName": "AssemblyLine_0",
"modelType": "Move",
"modelID": "",
"nodeID": "",
"position": "(1.99, 0.00, -18.60)",
"rotation": "(0.00000, 0.00000, 0.00000, 1.00000)",
"scale": "(1.00, 1.00, 1.00)"
},
{
"prefabName": "ForkLift",
"modelName": "ForkLift_0",
"modelType": "Move",
"modelID": "",
"nodeID": "product_generator_0_47f91e67-41ad-434c-bb7f-e983c143a840",
"position": "(-3.44, 0.00, -11.70)",
"rotation": "(0.15745, -0.41944, -0.83088, -0.33002)",
"scale": "(1.00, 1.00, 1.00)"
},
{
"prefabName": "Pallet",
"modelName": "Pallet_0",
"modelType": "Source",
"modelID": "",
"nodeID": "",
"position": "(-1.52, 0.00, -17.98)",
"rotation": "(0.00000, 0.00000, 0.00000, 1.00000)",
"scale": "(1.00, 1.00, 1.00)"
}
]
[]

View File

@@ -92,8 +92,8 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 24
m_fontSizeBase: 24
m_fontSize: 18
m_fontSizeBase: 18
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18

View File

@@ -45,10 +45,11 @@ namespace Octopus.Simulator.Networks
void Awake()
{
mqttManager = this;
FindAnyObjectByType<WebReceiver>().onMqttConfigReceived += SetMqttConfig;
//FindAnyObjectByType<WebReceiver>().onMqttConfigReceived += SetMqttConfig;
SetMqttConfig();
}
public void SetMqttConfig(string json)
public void SetMqttConfig()
{
/*
string path = Application.streamingAssetsPath + MQTTpath;
@@ -56,11 +57,10 @@ namespace Octopus.Simulator.Networks
using (StreamReader reader = new StreamReader(path))
{
json = reader.ReadToEnd();
}
} */
TextAsset json = Resources.Load<TextAsset>(MQTTpath);
Debug.Log(json.text);
*/
MQTTConfigList ConfigList = JsonConvert.DeserializeObject<MQTTConfigList>(json);
MQTTConfigList ConfigList = JsonConvert.DeserializeObject<MQTTConfigList>(json.text);
var config = ConfigList.configs[0];
string clientName = config.name;
string host = config.host;

View File

@@ -32,12 +32,12 @@ namespace Octopus.Simulator.Networks
void Awake()
{
webManager = this;
FindAnyObjectByType<WebReceiver>().onWebConfigReceived += SetWebConfig;
//SetWebConfig();
//FindAnyObjectByType<WebReceiver>().onWebConfigReceived += SetWebConfig;
SetWebConfig();
SetApiConfig();
}
private void SetWebConfig(string json)
private void SetWebConfig()
{
/*
string path = Application.streamingAssetsPath + WebPath;
@@ -46,9 +46,10 @@ namespace Octopus.Simulator.Networks
{
json = reader.ReadToEnd();
}
var json = Resources.Load<TextAsset>(WebPath)
*/
WebConfigList ConfigList = JsonConvert.DeserializeObject<WebConfigList>(json);
var json = Resources.Load<TextAsset>(WebPath);
WebConfigList ConfigList = JsonConvert.DeserializeObject<WebConfigList>(json.text);
var config = ConfigList.configs[0];
host = config.host;
Debug.Log($"host:{host}");

View File

@@ -15,16 +15,17 @@ public class WebReceiver : MonoBehaviour
public void Start()
{
Application.ExternalCall("loadingComplete");
/*
Application.ExternalCall("loadingComplete");
*/
config.projectId = "17";
//config.simulationId = "15";
config.logicId = "25";
WebParameters.config = config;
//onParameterRecived += FindAnyObjectByType<ProjectDataManager>().RequestInfo;
//onParameterRecived += FindAnyObjectByType<LogicDataManager>().RequestInfo;
onParameterRecived += FindAnyObjectByType<ProjectDataManager>().RequestInfo;
onParameterRecived += FindAnyObjectByType<LogicDataManager>().RequestInfo;
onParameterRecived?.Invoke();
*/
}
public void ReceiveWebParameterJson(string json)