2025-10-16 10:24:29 +09:00
|
|
|
using Newtonsoft.Json;
|
2026-02-03 11:40:26 +09:00
|
|
|
using Simulator.CameraData;
|
2025-11-04 11:02:02 +09:00
|
|
|
using Simulator.Data.Transport;
|
2025-10-16 10:24:29 +09:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2026-02-03 11:40:26 +09:00
|
|
|
using UnityEngine;
|
2025-10-16 10:24:29 +09:00
|
|
|
|
|
|
|
|
namespace Simulator.Data
|
|
|
|
|
{
|
|
|
|
|
[Serializable]
|
2025-11-04 11:02:02 +09:00
|
|
|
public class Totaljson
|
2025-10-16 10:24:29 +09:00
|
|
|
{
|
|
|
|
|
public int status;
|
|
|
|
|
public string code;
|
2026-02-24 14:07:57 +09:00
|
|
|
public LogicRow data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable]
|
|
|
|
|
public class LogicRow
|
|
|
|
|
{
|
|
|
|
|
public List<LogicData> rows;
|
|
|
|
|
public int count;
|
|
|
|
|
public string timestamp;
|
2025-10-16 10:24:29 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable]
|
2025-11-04 11:02:02 +09:00
|
|
|
public class LogicData
|
2025-10-16 10:24:29 +09:00
|
|
|
{
|
|
|
|
|
public int id;
|
2025-12-08 10:59:29 +09:00
|
|
|
public string name;
|
2026-02-25 16:30:12 +09:00
|
|
|
public string userId;
|
2025-11-04 11:02:02 +09:00
|
|
|
public LogicDetailData data;
|
2026-02-03 11:40:26 +09:00
|
|
|
public Webconfig webConfig;
|
|
|
|
|
public User user;
|
2025-10-16 10:24:29 +09:00
|
|
|
}
|
|
|
|
|
[Serializable]
|
2025-11-04 11:02:02 +09:00
|
|
|
public class LogicDetailData
|
2025-10-16 10:24:29 +09:00
|
|
|
{
|
|
|
|
|
public string name;
|
2025-12-11 18:26:09 +09:00
|
|
|
public templates templates;
|
2025-11-04 11:02:02 +09:00
|
|
|
public Infrastructure infrastructure;
|
|
|
|
|
public Transport_System transport_system;
|
|
|
|
|
public Production_System production_system;
|
2026-02-03 11:40:26 +09:00
|
|
|
public CameraEntity camAngle;
|
2025-10-16 10:24:29 +09:00
|
|
|
}
|
|
|
|
|
|
2025-12-11 18:26:09 +09:00
|
|
|
[Serializable]
|
|
|
|
|
public class templates
|
|
|
|
|
{
|
|
|
|
|
public List<PrefabData> prefabs;
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-16 10:24:29 +09:00
|
|
|
[Serializable]
|
2025-11-04 11:02:02 +09:00
|
|
|
public class Infrastructure
|
2025-10-16 10:24:29 +09:00
|
|
|
{
|
|
|
|
|
public List<QueueDataClass> queues;
|
2025-12-11 18:26:09 +09:00
|
|
|
public List<WorkerDataClass> resources;
|
2025-10-16 10:24:29 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable]
|
2025-11-04 11:02:02 +09:00
|
|
|
public class Transport_System
|
|
|
|
|
{
|
|
|
|
|
public List<Node_Networks> node_networks=new List<Node_Networks>();
|
|
|
|
|
public List<Transport_Manager> transport_managers=new List<Transport_Manager>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable]
|
|
|
|
|
public class Node_Networks
|
|
|
|
|
{
|
|
|
|
|
public List<NodeDataClass> nodes= new List<NodeDataClass>();
|
2026-02-10 17:01:25 +09:00
|
|
|
public List<PathDataClass> edges=new List<PathDataClass>();
|
2025-11-04 11:02:02 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable]
|
|
|
|
|
public class Transport_Manager
|
|
|
|
|
{
|
|
|
|
|
public string label;
|
|
|
|
|
public string manager_id;
|
|
|
|
|
public string network_id;
|
|
|
|
|
public string manager_type;
|
|
|
|
|
public List<Vehicle_Fleet> vehicle_fleets;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable]
|
|
|
|
|
public class Vehicle_Fleet
|
|
|
|
|
{
|
|
|
|
|
public string label;
|
|
|
|
|
public string fleet_id;
|
|
|
|
|
public List<AGVData> vehicles;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable]
|
|
|
|
|
public class Production_System
|
2025-10-16 10:24:29 +09:00
|
|
|
{
|
|
|
|
|
public List<SourceDataClass> sources;
|
|
|
|
|
public List<SinkDataClass> sinks;
|
|
|
|
|
public List<ASRSDataClass> asrs;
|
2025-11-04 11:02:02 +09:00
|
|
|
public List<RackDataClass> racks;
|
|
|
|
|
public List<ConveyorDataClass> conveyors;
|
2025-12-08 10:59:29 +09:00
|
|
|
public List<RobotArmDataClass> robot_arms;
|
2025-12-11 18:26:09 +09:00
|
|
|
public List<ProcessorDataClass> processors;
|
2025-10-16 10:24:29 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable]
|
2025-11-04 11:02:02 +09:00
|
|
|
public class Physical
|
2025-10-16 10:24:29 +09:00
|
|
|
{
|
2026-02-03 11:40:26 +09:00
|
|
|
public event Action onOrientationChanged;
|
2025-11-04 11:02:02 +09:00
|
|
|
public Position position = new Position();
|
|
|
|
|
public Dimensions dimensions = new Dimensions();
|
2026-02-03 11:40:26 +09:00
|
|
|
float _orientation;
|
|
|
|
|
public float orientation
|
|
|
|
|
{
|
|
|
|
|
get => _orientation;
|
2026-02-25 16:30:12 +09:00
|
|
|
set { _orientation = RotationSnap.SnapOrientation(value);onOrientationChanged?.Invoke(); }
|
2026-02-03 11:40:26 +09:00
|
|
|
}
|
2025-11-04 11:02:02 +09:00
|
|
|
public Access_Points access_points = new Access_Points();
|
2025-10-16 10:24:29 +09:00
|
|
|
}
|
|
|
|
|
|
2026-02-03 11:40:26 +09:00
|
|
|
public static class RotationSnap
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// angleDeg를 0/90/180/270 중 가장 가까운 값으로 반올림 스냅합니다.
|
|
|
|
|
/// 반환 범위: {0, 90, 180, 270}
|
|
|
|
|
/// </summary>
|
2026-02-25 16:30:12 +09:00
|
|
|
public static float SnapOrientation(float angleDeg)
|
2026-02-03 11:40:26 +09:00
|
|
|
{
|
|
|
|
|
// 0~360 정규화 (음수/초과 처리)
|
|
|
|
|
float a = Mathf.Repeat(angleDeg, 360f);
|
|
|
|
|
|
|
|
|
|
// 90도 단위로 반올림
|
|
|
|
|
int snapped = Mathf.RoundToInt(a / 90f) * 90;
|
|
|
|
|
|
|
|
|
|
// 360 -> 0 처리
|
|
|
|
|
snapped %= 360;
|
|
|
|
|
|
|
|
|
|
// 결과는 0/90/180/270 중 하나
|
|
|
|
|
return snapped;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-16 10:24:29 +09:00
|
|
|
[Serializable]
|
2025-11-04 11:02:02 +09:00
|
|
|
public class Position
|
2025-10-16 10:24:29 +09:00
|
|
|
{
|
2026-02-03 11:40:26 +09:00
|
|
|
public event Action onChanged;
|
|
|
|
|
|
2026-02-10 17:01:25 +09:00
|
|
|
private float _x;
|
|
|
|
|
private float _y;
|
|
|
|
|
private float _z;
|
2026-02-03 11:40:26 +09:00
|
|
|
|
|
|
|
|
public float x
|
|
|
|
|
{
|
|
|
|
|
get => _x;
|
|
|
|
|
set {_x = value; onChanged?.Invoke(); }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public float y
|
|
|
|
|
{
|
|
|
|
|
get => _y;
|
|
|
|
|
set {_y = value; onChanged?.Invoke(); }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public float z
|
|
|
|
|
{
|
|
|
|
|
get => _z;
|
|
|
|
|
set {_z = value; onChanged?.Invoke(); }
|
|
|
|
|
}
|
2025-10-16 10:24:29 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable]
|
2025-11-04 11:02:02 +09:00
|
|
|
public class Dimensions
|
2025-10-16 10:24:29 +09:00
|
|
|
{
|
|
|
|
|
public float width = 0.0f;
|
|
|
|
|
public float height = 0.0f;
|
|
|
|
|
public float depth = 0.0f;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable]
|
2025-11-04 11:02:02 +09:00
|
|
|
public class Access_Points
|
2025-10-16 10:24:29 +09:00
|
|
|
{
|
2026-02-03 11:40:26 +09:00
|
|
|
public InputPosition input;
|
|
|
|
|
public OutputPosition output;
|
2025-10-16 10:24:29 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable]
|
2026-02-03 11:40:26 +09:00
|
|
|
public class InputPosition
|
2025-10-16 10:24:29 +09:00
|
|
|
{
|
2025-11-04 11:02:02 +09:00
|
|
|
public Position local_position = new Position();
|
2025-10-16 10:24:29 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable]
|
2026-02-03 11:40:26 +09:00
|
|
|
public class OutputPosition
|
2025-10-16 10:24:29 +09:00
|
|
|
{
|
2025-11-04 11:02:02 +09:00
|
|
|
public Position local_position = new Position();
|
2025-10-16 10:24:29 +09:00
|
|
|
}
|
2026-01-16 11:36:54 +09:00
|
|
|
|
|
|
|
|
[Serializable]
|
|
|
|
|
public class Property
|
|
|
|
|
{
|
|
|
|
|
public Processor Processor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable]
|
|
|
|
|
public class Processor
|
|
|
|
|
{
|
|
|
|
|
public List<Workbench> workbench;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable]
|
|
|
|
|
public class Workbench
|
|
|
|
|
{
|
|
|
|
|
public string name;
|
|
|
|
|
public string label;
|
2026-02-03 11:40:26 +09:00
|
|
|
public List<Inout_Items> input_items;
|
|
|
|
|
public List<Inout_Items> output_items;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable]
|
|
|
|
|
public class Inout_Items
|
|
|
|
|
{
|
|
|
|
|
public string prefab;
|
|
|
|
|
public List<LocationCounts> locationCounts;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable]
|
|
|
|
|
public class LocationCounts
|
|
|
|
|
{
|
|
|
|
|
public string type;
|
|
|
|
|
public int count;
|
|
|
|
|
public string label;
|
|
|
|
|
public string location;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable]
|
|
|
|
|
public class User
|
|
|
|
|
{
|
|
|
|
|
public string name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable]
|
|
|
|
|
public class Webconfig
|
|
|
|
|
{
|
|
|
|
|
public List<tagData> tags;
|
|
|
|
|
public Property property;
|
2026-01-16 11:36:54 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable]
|
2026-02-03 11:40:26 +09:00
|
|
|
public class tagData
|
2026-01-16 11:36:54 +09:00
|
|
|
{
|
2026-02-03 11:40:26 +09:00
|
|
|
public string key;
|
2026-01-16 11:36:54 +09:00
|
|
|
public string type;
|
|
|
|
|
}
|
2025-10-16 10:24:29 +09:00
|
|
|
}
|