데이터 연결
This commit is contained in:
@@ -504,9 +504,9 @@ RectTransform:
|
||||
- {fileID: 6177140491953025549}
|
||||
m_Father: {fileID: 2908491237677950400}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 189, y: -21}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 378, y: 42}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &1361978878394048592
|
||||
@@ -910,6 +910,7 @@ GameObject:
|
||||
- component: {fileID: 272558446133743867}
|
||||
- component: {fileID: 5034127106569237865}
|
||||
- component: {fileID: 3757060209888943725}
|
||||
- component: {fileID: 7997719753715833387}
|
||||
m_Layer: 5
|
||||
m_Name: Panel_InterworkingDataList
|
||||
m_TagString: Untagged
|
||||
@@ -967,6 +968,20 @@ MonoBehaviour:
|
||||
scrollRect: {fileID: 0}
|
||||
scrollView: {fileID: 0}
|
||||
Button_Close: {fileID: 0}
|
||||
--- !u!114 &7997719753715833387
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3225544561127309147}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: beaea798e37c61142a62ba5cecd426f2, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
prf_LinkDataUI: {fileID: 3588877776299194241, guid: 9f62a52c6a3d48947b57fdd4f941a260, type: 3}
|
||||
body: {fileID: 940260026812176822}
|
||||
--- !u!1 &3292359185768907377
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1373,7 +1388,7 @@ RectTransform:
|
||||
m_Father: {fileID: 1131025699729329251}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 0.9999825}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 2, y: 0}
|
||||
m_SizeDelta: {x: 8, y: 20}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
@@ -1523,9 +1538,9 @@ RectTransform:
|
||||
- {fileID: 4356538390996181562}
|
||||
m_Father: {fileID: 2908491237677950400}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 189, y: -69}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 378, y: 54}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7844618352928355017
|
||||
@@ -1653,9 +1668,9 @@ RectTransform:
|
||||
m_Father: {fileID: 528971216280600444}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: -20, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0, y: 1}
|
||||
--- !u!222 &3628341150788769786
|
||||
CanvasRenderer:
|
||||
@@ -1741,9 +1756,9 @@ RectTransform:
|
||||
- {fileID: 528971216280600444}
|
||||
m_Father: {fileID: 2908491237677950400}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 189, y: -498}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 378, y: 804}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &6888214792173045902
|
||||
@@ -2273,7 +2288,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: -0.00034048597, y: 0.000182237}
|
||||
m_AnchoredPosition: {x: -0.00034048597, y: 0.00038124458}
|
||||
m_SizeDelta: {x: 282.99957, y: 2}
|
||||
m_Pivot: {x: 0, y: 1}
|
||||
--- !u!114 &685881772641947593
|
||||
@@ -2283,7 +2298,7 @@ MonoBehaviour:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8343071174450817828}
|
||||
m_Enabled: 0
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3}
|
||||
m_Name:
|
||||
@@ -2293,11 +2308,11 @@ MonoBehaviour:
|
||||
m_Right: 0
|
||||
m_Top: 2
|
||||
m_Bottom: 0
|
||||
m_ChildAlignment: 0
|
||||
m_ChildAlignment: 1
|
||||
m_Spacing: 0
|
||||
m_ChildForceExpandWidth: 1
|
||||
m_ChildForceExpandHeight: 0
|
||||
m_ChildControlWidth: 1
|
||||
m_ChildControlWidth: 0
|
||||
m_ChildControlHeight: 0
|
||||
m_ChildScaleWidth: 0
|
||||
m_ChildScaleHeight: 0
|
||||
|
||||
@@ -244,9 +244,9 @@ RectTransform:
|
||||
- {fileID: 7364039931774757102}
|
||||
m_Father: {fileID: 6035487561118384887}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 172, y: -62}
|
||||
m_SizeDelta: {x: 309, y: 24}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!1 &3005838305467858752
|
||||
@@ -510,6 +510,7 @@ GameObject:
|
||||
- component: {fileID: 7364039931774757102}
|
||||
- component: {fileID: 6702556061787308760}
|
||||
- component: {fileID: 659159494829357379}
|
||||
- component: {fileID: 6625180587749650022}
|
||||
m_Layer: 0
|
||||
m_Name: ConnectedAssetMarker
|
||||
m_TagString: Untagged
|
||||
@@ -574,6 +575,50 @@ MonoBehaviour:
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &6625180587749650022
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7318833766114649878}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_WrapAround: 0
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_SelectedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 659159494829357379}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!1 &7320545626431284971
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -585,12 +630,12 @@ GameObject:
|
||||
- component: {fileID: 8505836957447598286}
|
||||
- component: {fileID: 981025460825339852}
|
||||
m_Layer: 0
|
||||
m_Name: AssetEditWindows
|
||||
m_Name: Panel_AssetEdit
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!224 &8505836957447598286
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -631,6 +676,7 @@ MonoBehaviour:
|
||||
UIList: []
|
||||
bottomPadding: 15
|
||||
prf_AssetEditUI: {fileID: 711459992227652906, guid: 1d75cf75eb9ebeb49ad59c5c8c23dd01, type: 3}
|
||||
datalist: {fileID: 0}
|
||||
--- !u!1 &8344989953616814535
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
47
Assets/Scripts/XED/Machine/AMR_Class.cs
Normal file
47
Assets/Scripts/XED/Machine/AMR_Class.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace XED.Machine
|
||||
{
|
||||
[Serializable]
|
||||
public class AMR_Class
|
||||
{
|
||||
public string type;
|
||||
public string AmrId;
|
||||
public int workstate;
|
||||
|
||||
public float moveSpeed;
|
||||
public Pose Pose;
|
||||
|
||||
public int lift_;
|
||||
public int loaded;
|
||||
public string Cmd;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class Pose
|
||||
{
|
||||
public float x;
|
||||
public float y;
|
||||
public float theta;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class AMR_Class_AMR
|
||||
{
|
||||
public AMR_Class_Payload payload;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class AMR_Class_Payload
|
||||
{
|
||||
public List<AMR_Class_plcdata> plcdatas;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class AMR_Class_plcdata
|
||||
{
|
||||
public List<AMR_Class> data;
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/XED/Machine/AMR_Class.cs.meta
Normal file
2
Assets/Scripts/XED/Machine/AMR_Class.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9f9de9b345b1d9e4ebf54f44d6ef63af
|
||||
249
Assets/Scripts/XED/Machine/ASRS_Class.cs
Normal file
249
Assets/Scripts/XED/Machine/ASRS_Class.cs
Normal file
@@ -0,0 +1,249 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace XED.Machine
|
||||
{
|
||||
[Serializable]
|
||||
public class ASRS_Lifter_Class
|
||||
{
|
||||
//asrs input lift
|
||||
public int ASRS_04_01_P2A_D_SKID_ON = 0;
|
||||
public int ASRS_04_01_P2A_UP_DOWN = 0;
|
||||
public int ASRS_04_01_P2A_LIFT_STATE = 0;
|
||||
public string ASRS_04_01_P2A_SKID_ID = "";
|
||||
public int ASRS_04_01_A2P_AMR_IN_COMPLETE = 0;
|
||||
public int ASRS_04_01_A2P_AMR_OUT_COMPLETE = 0;
|
||||
|
||||
//asrs output Lift
|
||||
public int ASRS_14_01_P2A_D_SKID_ON = 0;
|
||||
public int ASRS_14_01_P2A_UP_DOWN = 0;
|
||||
public int ASRS_14_01_P2A_LIFT_STATE = 0;
|
||||
public string ASRS_14_01_P2A_SKID_ID = "";
|
||||
public int ASRS_14_01_A2P_AMR_IN_COMPLETE = 0;
|
||||
public int ASRS_14_01_A2P_AMR_OUT_COMPLETE = 0;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class ASRS_Lifter_Breaked_Class
|
||||
{
|
||||
public int SKID_ON = 0;
|
||||
public int UP_DOWN = 0;
|
||||
public int LIFT_STATE = 0;
|
||||
public string SKID_ID = "";
|
||||
public int AMR_IN_COMPLETE = 0;
|
||||
public int AMR_OUT_COMPLETE = 0;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class ASRS_StackerCrane_Class
|
||||
{
|
||||
//asrs stacker position
|
||||
public int STK_03_20_Stacker_Position_X;
|
||||
public int STK_03_20_Stacker_Position_Y;
|
||||
public int STK_03_20_Stacker_Position_Z;
|
||||
public string STK_03_20_Stacker_SKID_ID = "";
|
||||
|
||||
public int STK_03_20_Stacker_Part_On;
|
||||
public int STK_03_20_Stacker_Warehousing_Location;
|
||||
public int STK_03_20_Stacker_Step_No;
|
||||
}
|
||||
[Serializable]
|
||||
public class ASRS_Class
|
||||
{
|
||||
//conv 01 01 trigger events
|
||||
public int CONV_01_01_P2A_D_SKID_ON;
|
||||
public int CONV_01_01_P2A_RUN_STATUS;
|
||||
|
||||
//conv 01 01 value
|
||||
//speed mm/Min
|
||||
public int CONV_01_01_P2A_SPEED;
|
||||
|
||||
//something wrong in conv 01 01
|
||||
public int CONV_01_01_P2A_EMG_STOP;
|
||||
public int CONV_01_01_P2A_Total_Error;
|
||||
|
||||
|
||||
//conv 01 02 divot conv trigger events
|
||||
//CONV_01_02_P2A
|
||||
public int CONV_01_02_P2A_UP_DOWN;
|
||||
public int CONV_01_02_P2A_LIFT_STATE;
|
||||
public int CONV_01_02_P2A_RUN_STATUS;
|
||||
public int CONV_01_02_P2A_D_SKID_ON;
|
||||
//conv 01 02 value events
|
||||
public int CONV_01_02_P2A_SPEED_CHAIN;
|
||||
|
||||
//something wrong in conv 01 02
|
||||
public int CONV_01_02_P2A_EMG_STOP;
|
||||
public int CONV_01_02_P2A_Total_Error;
|
||||
|
||||
|
||||
//conv 01 03 trigger events
|
||||
public int CONV_01_03_P2A_RUN_STATUS_IN;
|
||||
public int CONV_01_03_P2A_RUN_STATUS_OUT;
|
||||
public int CONV_01_03_P2A_G_SKID_ON;
|
||||
public int CONV_01_03_P2A_D_SKID_ON;
|
||||
|
||||
//conv 01 03 value Events;
|
||||
public int CONV_01_03_P2A_SPEED;
|
||||
|
||||
//soemthing wrong in covn 01 03
|
||||
public int CONV_01_03_P2A_EMG_STOP;
|
||||
public int CONV_01_03_P2A_Total_Error;
|
||||
|
||||
|
||||
//conv 01 04 trigger events
|
||||
public int CONV_01_04_P2A_RUN_STATUS_IN;
|
||||
public int CONV_01_04_P2A_RUN_STATUS_OUT;
|
||||
public int CONV_01_04_P2A_G_SKID_ON;
|
||||
public int CONV_01_04_P2A_D_SKID_ON;
|
||||
|
||||
//conv 01 04 value Events;
|
||||
public int CONV_01_04_P2A_SPEED;
|
||||
|
||||
//soemthing wrong in covn 01 04
|
||||
public int CONV_01_04_P2A_EMG_STOP;
|
||||
public int CONV_01_04_P2A_Total_Error;
|
||||
|
||||
|
||||
|
||||
//conv 02 01 trigger event
|
||||
public int CONV_02_01_P2A_RUN_STATUS_IN;
|
||||
public int CONV_02_01_P2A_RUN_STATUS_OUT;
|
||||
|
||||
//conv 02 01 value event
|
||||
public int CONV_02_01_P2A_SPEED_CHAIN;
|
||||
public string CONV_02_01_P2A_Bill_No;
|
||||
public int CONV_02_01_P2A_SPEPARATION_NO;
|
||||
public int CONV_02_01_P2A_D_SKID_ON;
|
||||
public int CONV_02_01_P2A_G_SKID_ON;
|
||||
|
||||
//something wrong in covn 02 01
|
||||
public int CONV_02_01_P2A_Total_Error;
|
||||
public int CONV_02_01_P2A_EMG_STOP;
|
||||
|
||||
|
||||
//conv 02 02 divot conv trigger events
|
||||
//CONV_02_02_P2A
|
||||
public int CONV_02_02_P2A_UP_DOWN;
|
||||
public int CONV_02_02_P2A_LIFT_STATE;
|
||||
public int CONV_02_02_P2A_RUN_STATUS_IN;
|
||||
public int CONV_02_02_P2A_RUN_STATUS_OUT;
|
||||
|
||||
|
||||
//conv 01 02 value events
|
||||
public int CONV_02_02_P2A_SPEED_CHAIN;
|
||||
public string CONV_02_02_P2A_Bill_No;
|
||||
public int CONV_02_02_P2A_SPEPARATION_NO;
|
||||
public int CONV_02_02_P2A_D_SKID_ON;
|
||||
public int CONV_02_02_P2A_G_SKID_ON;
|
||||
|
||||
//something wrong in conv 01 02
|
||||
public int CONV_02_02_P2A_EMG_STOP;
|
||||
public int CONV_02_02_P2A_Total_Error;
|
||||
|
||||
|
||||
public int CONV_02_03_P2A_D_SKID_ON;
|
||||
public int CONV_02_03_P2A_G_SKID_ON;
|
||||
|
||||
//conv 02 03 out conv trigger events
|
||||
public int CONV_02_03_P2A_RUN_STATUS_IN;
|
||||
public int CONV_02_03_P2A_RUN_STATUS_OUT;
|
||||
|
||||
//conv 02 03 value events
|
||||
public int CONV_02_03_P2A_SPEED;
|
||||
public string CONV_02_03_P2A_Bill_No;
|
||||
public int CONV_02_03_P2A_SPEPARATION_NO;
|
||||
|
||||
//something wrong in conv 02 03
|
||||
public int CONV_02_03_P2A_EMG_STOP;
|
||||
public int CONV_02_03_P2A_Total_Error;
|
||||
|
||||
//asrs stacker position
|
||||
public int Stacker_Position_X;
|
||||
public int Stacker_Position_Y;
|
||||
public int Stacker_Position_Z;
|
||||
|
||||
public int Stacker_Part_On;
|
||||
|
||||
#nullable enable
|
||||
//asrs rack status
|
||||
public int STK_03_01_P2A_CARGO_ARRIVED;
|
||||
public string? STK_03_01_P2A_Bill_No;
|
||||
public string? STK_03_01_P2A_SEPARATION_NO;
|
||||
|
||||
public int STK_03_02_P2A_CARGO_ARRIVED;
|
||||
public string? STK_03_02_P2A_Bill_No;
|
||||
public string? STK_03_02_P2A_SEPARATION_NO;
|
||||
|
||||
public int STK_03_03_P2A_CARGO_ARRIVED;
|
||||
public string? STK_03_03_P2A_Bill_No;
|
||||
public string? STK_03_03_P2A_SEPARATION_NO;
|
||||
|
||||
public int STK_03_04_P2A_CARGO_ARRIVED;
|
||||
public string? STK_03_04_P2A_Bill_No;
|
||||
public string? STK_03_04_P2A_SEPARATION_NO;
|
||||
|
||||
public int STK_03_05_P2A_CARGO_ARRIVED;
|
||||
public string? STK_03_05_P2A_Bill_No;
|
||||
public string? STK_03_05_P2A_SEPARATION_NO;
|
||||
|
||||
public int STK_03_06_P2A_CARGO_ARRIVED;
|
||||
public string? STK_03_06_P2A_Bill_No;
|
||||
public string? STK_03_06_P2A_SEPARATION_NO;
|
||||
|
||||
public int STK_03_07_P2A_CARGO_ARRIVED;
|
||||
public string? STK_03_07_P2A_Bill_No;
|
||||
public string? STK_03_07_P2A_SEPARATION_NO;
|
||||
|
||||
public int STK_03_08_P2A_CARGO_ARRIVED;
|
||||
public string? STK_03_08_P2A_Bill_No;
|
||||
public string? STK_03_08_P2A_SEPARATION_NO;
|
||||
|
||||
public int STK_03_09_P2A_CARGO_ARRIVED;
|
||||
public string? STK_03_09_P2A_Bill_No;
|
||||
public string? STK_03_09_P2A_SEPARATION_NO;
|
||||
|
||||
public int STK_03_10_P2A_CARGO_ARRIVED;
|
||||
public string? STK_03_10_P2A_Bill_No;
|
||||
public string? STK_03_10_P2A_SEPARATION_NO;
|
||||
|
||||
public int STK_03_11_P2A_CARGO_ARRIVED;
|
||||
public string? STK_03_11_P2A_Bill_No;
|
||||
public string? STK_03_11_P2A_SEPARATION_NO;
|
||||
|
||||
public int STK_03_12_P2A_CARGO_ARRIVED;
|
||||
public string? STK_03_12_P2A_Bill_No;
|
||||
public string? STK_03_12_P2A_SEPARATION_NO;
|
||||
|
||||
#nullable disable
|
||||
public string ASRS_01_01_P2A_Bill_No;
|
||||
public string ASRS_01_01_P2A_SEPARATION_NO;
|
||||
|
||||
public string ASRS_02_01_P2A_Bill_No;
|
||||
public string ASRS_02_01_P2A_SEPARATION_NO;
|
||||
|
||||
|
||||
|
||||
public string SUPPLY_01_01_P2A_Bill_No;
|
||||
public string SUPPLY_01_01_P2A_SEPARATION_NO;
|
||||
public int SUPPLY_01_01_P2A_G_SKID_ON;
|
||||
public int SUPPLY_01_01_P2A_D_SKID_ON;
|
||||
|
||||
public string SUPPLY_01_02_P2A_Bill_No;
|
||||
public string SUPPLY_01_02_P2A_SEPARATION_NO;
|
||||
public int SUPPLY_01_02_P2A_G_SKID_ON;
|
||||
public int SUPPLY_01_02_P2A_D_SKID_ON;
|
||||
|
||||
public string SUPPLY_01_03_P2A_Bill_No;
|
||||
public string SUPPLY_01_03_P2A_SEPARATION_NO;
|
||||
public int SUPPLY_01_03_P2A_G_SKID_ON;
|
||||
public int SUPPLY_01_03_P2A_D_SKID_ON;
|
||||
|
||||
public string SUPPLY_01_04_P2A_Bill_No;
|
||||
public string SUPPLY_01_04_P2A_SEPARATION_NO;
|
||||
public int SUPPLY_01_04_P2A_G_SKID_ON;
|
||||
public int SUPPLY_01_04_P2A_D_SKID_ON;
|
||||
|
||||
public string DataTime;
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/XED/Machine/ASRS_Class.cs.meta
Normal file
2
Assets/Scripts/XED/Machine/ASRS_Class.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 81cbb5803ff36ea439d8e597148ef460
|
||||
40
Assets/Scripts/XED/Machine/Cobot_Class.cs
Normal file
40
Assets/Scripts/XED/Machine/Cobot_Class.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace XED.Machine
|
||||
{
|
||||
[Serializable]
|
||||
public class COBOT_Class
|
||||
{
|
||||
public string id;
|
||||
public string time;
|
||||
public string subject;
|
||||
public Payload payload;
|
||||
|
||||
public class Payload
|
||||
{
|
||||
public List<PlcData> plcDatas;
|
||||
public int error;
|
||||
public int result;
|
||||
public string producer;
|
||||
public string plc;
|
||||
}
|
||||
|
||||
public class PlcData
|
||||
{
|
||||
public string plcsc;
|
||||
public List<Data> data;
|
||||
public int error;
|
||||
public int result;
|
||||
public string producer;
|
||||
public string plc;
|
||||
}
|
||||
|
||||
public class Data
|
||||
{
|
||||
public string tag;
|
||||
public string val;
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/XED/Machine/Cobot_Class.cs.meta
Normal file
2
Assets/Scripts/XED/Machine/Cobot_Class.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e3a2ab02a3c137046ad65f4028294197
|
||||
89
Assets/Scripts/XED/Machine/DataDistributer.cs
Normal file
89
Assets/Scripts/XED/Machine/DataDistributer.cs
Normal file
@@ -0,0 +1,89 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Newtonsoft.Json;
|
||||
using System.Reflection;
|
||||
|
||||
namespace XED.Machine
|
||||
{
|
||||
public class DataDistributer : MonoBehaviour
|
||||
{
|
||||
public event Action<string> onAMRDestinationDataReceived;
|
||||
public event Action<string,ASRS_Lifter_Class> onLifterDataReceived;
|
||||
public event Action<string,ASRS_StackerCrane_Class> onStackerDataReceived;
|
||||
public event Action<string,ASRS_Class> onASRSDataReceived;
|
||||
public event Action<string,Supplier_Class> onSupplierDataReceived;
|
||||
public event Action<string,COBOT_Class> onCobotDataReceived;
|
||||
public event Action<string,AMR_Class> onAMRDataReceived;
|
||||
|
||||
void Start()
|
||||
{
|
||||
FindObjectOfType<DataReader>().onMessageReceived += DataDistribute;
|
||||
}
|
||||
|
||||
public void DataDistribute(string topic, string data)
|
||||
{
|
||||
AMR_Class amr;
|
||||
ASRS_Lifter_Class lifter;
|
||||
ASRS_StackerCrane_Class stacker;
|
||||
ASRS_Class asrs;
|
||||
Supplier_Class supplier;
|
||||
COBOT_Class cobot;
|
||||
switch (topic)
|
||||
{
|
||||
case "amr":
|
||||
onAMRDestinationDataReceived?.Invoke(data);
|
||||
break;
|
||||
case "lifter":
|
||||
lifter = JsonConvert.DeserializeObject<ASRS_Lifter_Class>(data);
|
||||
onLifterDataReceived?.Invoke(topic, lifter);
|
||||
break;
|
||||
case "stacker":
|
||||
stacker = JsonConvert.DeserializeObject<ASRS_StackerCrane_Class>(data);
|
||||
onStackerDataReceived?.Invoke(topic, stacker);
|
||||
break;
|
||||
case "cargo":
|
||||
asrs = JsonConvert.DeserializeObject<ASRS_Class>(data);
|
||||
onASRSDataReceived?.Invoke(topic, asrs);
|
||||
break;
|
||||
case "supplier":
|
||||
supplier = JsonConvert.DeserializeObject<Supplier_Class>(data);
|
||||
onSupplierDataReceived?.Invoke(topic, supplier);
|
||||
break;
|
||||
case "H-ACS.PLC-SC_Cobot_Opc1":
|
||||
cobot = JsonConvert.DeserializeObject<COBOT_Class>(data);
|
||||
onCobotDataReceived?.Invoke(topic, cobot);
|
||||
break;
|
||||
case "H-ACS.PLC-SC_Cobot_Opc2":
|
||||
cobot = JsonConvert.DeserializeObject<COBOT_Class>(data);
|
||||
onCobotDataReceived?.Invoke(topic, cobot);
|
||||
break;
|
||||
case "H-ACS.PLC-SC_Cobot_Opc3":
|
||||
cobot = JsonConvert.DeserializeObject<COBOT_Class>(data);
|
||||
onCobotDataReceived?.Invoke(topic, cobot);
|
||||
break;
|
||||
case "H-ACS.PLC-SC_Cobot_Opc4":
|
||||
cobot = JsonConvert.DeserializeObject<COBOT_Class>(data);
|
||||
onCobotDataReceived?.Invoke(topic, cobot);
|
||||
break;
|
||||
case "R_137.ACS":
|
||||
amr = JsonConvert.DeserializeObject<AMR_Class>(data);
|
||||
onAMRDataReceived?.Invoke(topic, amr);
|
||||
break;
|
||||
case "R_147.ACS":
|
||||
amr = JsonConvert.DeserializeObject<AMR_Class>(data);
|
||||
onAMRDataReceived?.Invoke(topic, amr);
|
||||
break;
|
||||
case "R_153.ACS":
|
||||
amr = JsonConvert.DeserializeObject<AMR_Class>(data);
|
||||
onAMRDataReceived?.Invoke(topic, amr);
|
||||
break;
|
||||
case "R_156.ACS":
|
||||
amr = JsonConvert.DeserializeObject<AMR_Class>(data);
|
||||
onAMRDataReceived?.Invoke(topic, amr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/XED/Machine/DataDistributer.cs.meta
Normal file
2
Assets/Scripts/XED/Machine/DataDistributer.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fdf7eb60acc70744fa966e88090c0ff8
|
||||
102
Assets/Scripts/XED/Machine/DataReader.cs
Normal file
102
Assets/Scripts/XED/Machine/DataReader.cs
Normal file
@@ -0,0 +1,102 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using System.IO;
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using UnityEngine.SceneManagement;
|
||||
using TMPro;
|
||||
|
||||
[Serializable]
|
||||
public class timestampClass
|
||||
{
|
||||
public string TimeStamp;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class msg_TimeClass
|
||||
{
|
||||
public string msg_time;
|
||||
}
|
||||
public class DataReader : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
string separator = "@";
|
||||
|
||||
TextAsset csvFile;
|
||||
public event Action<string, string> onMessageReceived;
|
||||
|
||||
[SerializeField]
|
||||
TimeSpan prevTime = new TimeSpan();
|
||||
[SerializeField]
|
||||
TimeSpan nowTime = new TimeSpan();
|
||||
public string[] datas;
|
||||
|
||||
[SerializeField]
|
||||
TMP_Text ReplayTimer;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
//ReplayTimer.gameObject.SetActive(true);
|
||||
// Resources 폴더에서 파일을 불러옵니다.
|
||||
csvFile = Resources.Load<TextAsset>($"LogData/DataLog");
|
||||
|
||||
if (csvFile != null)
|
||||
{
|
||||
//Debug.Log($"DataArchitect: {csvFile.text}");
|
||||
StartCoroutine(GenerateDataFromCSV(csvFile.text,parseTime(PlayerPrefs.GetInt("Minute"),PlayerPrefs.GetInt("Second"))));
|
||||
PlayerPrefs.SetInt("Minute", 0);
|
||||
PlayerPrefs.SetInt("Second", 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("CSV 파일을 찾을 수 없습니다.");
|
||||
}
|
||||
}
|
||||
|
||||
public void SetTimer(int minute,int second)
|
||||
{
|
||||
PlayerPrefs.SetInt("Minute", minute);
|
||||
PlayerPrefs.SetInt("Second", second);
|
||||
SceneManager.LoadScene(1);
|
||||
}
|
||||
TimeSpan parseTime(int minute,int second)
|
||||
{
|
||||
return new TimeSpan(0, 0, minute, second, 0);
|
||||
}
|
||||
|
||||
IEnumerator GenerateDataFromCSV(string csvContent,TimeSpan startTime)
|
||||
{
|
||||
prevTime = new TimeSpan();
|
||||
nowTime = new TimeSpan();
|
||||
string[] lines = csvContent.Split(new string[] { "\n", "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
|
||||
foreach (var line in lines)
|
||||
{
|
||||
datas = line.Split(separator);
|
||||
if (nowTime < startTime)
|
||||
{
|
||||
TimeSpan.TryParse(datas[0], out nowTime);
|
||||
prevTime = nowTime;
|
||||
continue;
|
||||
}
|
||||
if (prevTime == null)
|
||||
{
|
||||
Debug.Log("setprev");
|
||||
yield return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
TimeSpan.TryParse(datas[0], out nowTime);
|
||||
yield return new WaitForSeconds((float)(nowTime - prevTime).TotalSeconds);
|
||||
}
|
||||
if (nowTime != null)
|
||||
{
|
||||
//ReplayTimer.text = nowTime.ToString(@"hh\:mm\:ss");
|
||||
}
|
||||
onMessageReceived?.Invoke(datas[1], datas[2]);
|
||||
prevTime = nowTime;
|
||||
}
|
||||
SceneManager.LoadScene(0);
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/XED/Machine/DataReader.cs.meta
Normal file
2
Assets/Scripts/XED/Machine/DataReader.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 33a032a155f67b6468082f3e1e69fd53
|
||||
29
Assets/Scripts/XED/Machine/Supplier_Class.cs
Normal file
29
Assets/Scripts/XED/Machine/Supplier_Class.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace XED
|
||||
{
|
||||
[Serializable]
|
||||
public class Supplier_Class
|
||||
{
|
||||
public int SUPPLY_06_01_A2P_AMR_IN_COMPLETE;
|
||||
public int SUPPLY_06_01_P2A_D_SKID_ON;
|
||||
public string SUPPLY_06_01_P2A_SKID_ID;
|
||||
|
||||
public int SUPPLY_06_02_A2P_AMR_IN_COMPLETE;
|
||||
public int SUPPLY_06_02_P2A_D_SKID_ON;
|
||||
public string SUPPLY_06_02_P2A_SKID_ID;
|
||||
|
||||
public int SUPPLY_06_03_A2P_AMR_IN_COMPLETE;
|
||||
public int SUPPLY_06_03_P2A_D_SKID_ON;
|
||||
public string SUPPLY_06_03_P2A_SKID_ID;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class Supplier_Breaked_Class
|
||||
{
|
||||
public int AMR_IN_COMPLETE;
|
||||
public int SKID_ON;
|
||||
public string SKID_ID;
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/XED/Machine/Supplier_Class.cs.meta
Normal file
2
Assets/Scripts/XED/Machine/Supplier_Class.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b80dffaa75a699c408270dba8c900d05
|
||||
251
Assets/Scripts/XED/Managers/LinkDataUIManager.cs
Normal file
251
Assets/Scripts/XED/Managers/LinkDataUIManager.cs
Normal file
@@ -0,0 +1,251 @@
|
||||
using UnityEngine;
|
||||
using XED.UI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
namespace XED.Machine
|
||||
{
|
||||
public class LinkDataUIManager : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
UI_LinkData prf_LinkDataUI;
|
||||
public Transform body;
|
||||
|
||||
Dictionary<string, UI_LinkData> linkDataDict = new Dictionary<string, UI_LinkData>();
|
||||
|
||||
Dictionary<string, AMR_Class> amrDict = new Dictionary<string, AMR_Class>();
|
||||
Dictionary<string, ASRS_Lifter_Breaked_Class> lifterDict = new Dictionary<string, ASRS_Lifter_Breaked_Class>();
|
||||
Dictionary<string, ASRS_StackerCrane_Class> stackerDict = new Dictionary<string, ASRS_StackerCrane_Class>();
|
||||
Dictionary<string, ASRS_Class> asrsDict = new Dictionary<string, ASRS_Class>();
|
||||
Dictionary<string, Supplier_Breaked_Class> supplierDict = new Dictionary<string, Supplier_Breaked_Class>();
|
||||
Dictionary<string, COBOT_Class> cobotDict = new Dictionary<string, COBOT_Class>();
|
||||
|
||||
public event Action<List<(string, string)>,string> onUISelected;
|
||||
|
||||
public override void AfterAwake()
|
||||
{
|
||||
var datadistributer = FindAnyObjectByType<DataDistributer>(FindObjectsInactive.Include);
|
||||
datadistributer.onAMRDataReceived += LinkDataUI_AMR;
|
||||
datadistributer.onLifterDataReceived += LinkDataUI_Lifter;
|
||||
datadistributer.onStackerDataReceived += LinkDataUI_StackerCrane;
|
||||
datadistributer.onASRSDataReceived += LinkDataUI_Asrs;
|
||||
datadistributer.onSupplierDataReceived += LinkDataUI_Supplier;
|
||||
datadistributer.onCobotDataReceived += LinkDataUI_Cobot;
|
||||
prf_LinkDataUI = Resources.Load<UI_LinkData>($"Prefabs/UI/{nameof(prf_LinkDataUI)}");
|
||||
}
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void LinkDataUI_AMR(string topic, AMR_Class data)
|
||||
{
|
||||
if (!linkDataDict.ContainsKey(topic))
|
||||
{
|
||||
var ui = Instantiate(prf_LinkDataUI, body);
|
||||
ui.SetUI(topic);
|
||||
ui.onUIClicked += findDictionaryByUI;
|
||||
linkDataDict.Add(topic, ui);
|
||||
amrDict.Add(topic, data);
|
||||
}
|
||||
else
|
||||
{
|
||||
amrDict[topic] = data;
|
||||
}
|
||||
}
|
||||
|
||||
void LinkDataUI_Lifter(string topic, ASRS_Lifter_Class data)
|
||||
{
|
||||
ASRS_Lifter_Breaked_Class asrs_04_01 = new ASRS_Lifter_Breaked_Class();
|
||||
asrs_04_01.SKID_ON = data.ASRS_04_01_P2A_D_SKID_ON;
|
||||
asrs_04_01.UP_DOWN = data.ASRS_04_01_P2A_UP_DOWN;
|
||||
asrs_04_01.LIFT_STATE = data.ASRS_04_01_P2A_LIFT_STATE;
|
||||
asrs_04_01.SKID_ID = data.ASRS_04_01_P2A_SKID_ID;
|
||||
asrs_04_01.AMR_IN_COMPLETE = data.ASRS_04_01_A2P_AMR_IN_COMPLETE;
|
||||
asrs_04_01.AMR_OUT_COMPLETE = data.ASRS_04_01_A2P_AMR_OUT_COMPLETE;
|
||||
|
||||
ASRS_Lifter_Breaked_Class asrs_14_01 = new ASRS_Lifter_Breaked_Class();
|
||||
asrs_14_01.SKID_ON = data.ASRS_14_01_P2A_D_SKID_ON;
|
||||
asrs_14_01.UP_DOWN = data.ASRS_14_01_P2A_UP_DOWN;
|
||||
asrs_14_01.LIFT_STATE = data.ASRS_14_01_P2A_LIFT_STATE;
|
||||
asrs_14_01.SKID_ID = data.ASRS_14_01_P2A_SKID_ID;
|
||||
asrs_14_01.AMR_IN_COMPLETE = data.ASRS_14_01_A2P_AMR_IN_COMPLETE;
|
||||
asrs_14_01.AMR_OUT_COMPLETE = data.ASRS_14_01_A2P_AMR_OUT_COMPLETE;
|
||||
|
||||
if (!linkDataDict.ContainsKey(nameof(asrs_04_01)))
|
||||
{
|
||||
var ui = Instantiate(prf_LinkDataUI, body);
|
||||
ui.SetUI(nameof(asrs_04_01));
|
||||
ui.onUIClicked += findDictionaryByUI;
|
||||
linkDataDict.Add(nameof(asrs_04_01), ui);
|
||||
lifterDict.Add(nameof(asrs_04_01), asrs_04_01);
|
||||
}
|
||||
else
|
||||
{
|
||||
lifterDict[nameof(asrs_04_01)]= asrs_04_01;
|
||||
}
|
||||
|
||||
if (!linkDataDict.ContainsKey(nameof(asrs_14_01)))
|
||||
{
|
||||
var ui = Instantiate(prf_LinkDataUI, body);
|
||||
ui.SetUI(nameof(asrs_14_01));
|
||||
ui.onUIClicked += findDictionaryByUI;
|
||||
linkDataDict.Add(nameof(asrs_14_01), ui);
|
||||
lifterDict.Add(nameof(asrs_14_01), asrs_14_01);
|
||||
}
|
||||
else
|
||||
{
|
||||
lifterDict[nameof(asrs_14_01)] = asrs_14_01;
|
||||
}
|
||||
}
|
||||
|
||||
void LinkDataUI_StackerCrane(string topic, ASRS_StackerCrane_Class data)
|
||||
{
|
||||
if (!linkDataDict.ContainsKey(topic))
|
||||
{
|
||||
var ui = Instantiate(prf_LinkDataUI, body);
|
||||
ui.SetUI(topic);
|
||||
ui.onUIClicked += findDictionaryByUI;
|
||||
linkDataDict.Add(topic, ui);
|
||||
stackerDict.Add(topic, data);
|
||||
}
|
||||
else
|
||||
{
|
||||
stackerDict[topic] = data;
|
||||
}
|
||||
}
|
||||
|
||||
void LinkDataUI_Asrs(string topic, ASRS_Class data)
|
||||
{
|
||||
if (!linkDataDict.ContainsKey(topic))
|
||||
{
|
||||
var ui = Instantiate(prf_LinkDataUI, body);
|
||||
ui.SetUI(topic);
|
||||
ui.onUIClicked += findDictionaryByUI;
|
||||
linkDataDict.Add(topic, ui);
|
||||
asrsDict.Add(topic, data);
|
||||
}
|
||||
else
|
||||
{
|
||||
asrsDict[topic] = data;
|
||||
}
|
||||
}
|
||||
|
||||
void LinkDataUI_Supplier(string topic, Supplier_Class data)
|
||||
{
|
||||
Supplier_Breaked_Class Supplier_06_01 = new Supplier_Breaked_Class();
|
||||
Supplier_06_01.AMR_IN_COMPLETE = data.SUPPLY_06_01_A2P_AMR_IN_COMPLETE;
|
||||
Supplier_06_01.SKID_ON = data.SUPPLY_06_01_P2A_D_SKID_ON;
|
||||
Supplier_06_01.SKID_ID = data.SUPPLY_06_01_P2A_SKID_ID;
|
||||
|
||||
Supplier_Breaked_Class Supplier_06_02 = new Supplier_Breaked_Class();
|
||||
Supplier_06_02.AMR_IN_COMPLETE = data.SUPPLY_06_02_A2P_AMR_IN_COMPLETE;
|
||||
Supplier_06_02.SKID_ON = data.SUPPLY_06_02_P2A_D_SKID_ON;
|
||||
Supplier_06_02.SKID_ID = data.SUPPLY_06_02_P2A_SKID_ID;
|
||||
|
||||
Supplier_Breaked_Class Supplier_06_03 = new Supplier_Breaked_Class();
|
||||
Supplier_06_03.AMR_IN_COMPLETE = data.SUPPLY_06_03_A2P_AMR_IN_COMPLETE;
|
||||
Supplier_06_03.SKID_ON = data.SUPPLY_06_03_P2A_D_SKID_ON;
|
||||
Supplier_06_03.SKID_ID = data.SUPPLY_06_03_P2A_SKID_ID;
|
||||
|
||||
if (!linkDataDict.ContainsKey(nameof(Supplier_06_01)))
|
||||
{
|
||||
var ui = Instantiate(prf_LinkDataUI, body);
|
||||
ui.SetUI(nameof(Supplier_06_01));
|
||||
ui.onUIClicked += findDictionaryByUI;
|
||||
linkDataDict.Add(nameof(Supplier_06_01), ui);
|
||||
supplierDict.Add(nameof(Supplier_06_01), Supplier_06_01);
|
||||
}
|
||||
else
|
||||
{
|
||||
supplierDict[nameof(Supplier_06_01)] = Supplier_06_01;
|
||||
}
|
||||
|
||||
if (!linkDataDict.ContainsKey(nameof(Supplier_06_02)))
|
||||
{
|
||||
var ui = Instantiate(prf_LinkDataUI, body);
|
||||
ui.SetUI(nameof(Supplier_06_02));
|
||||
ui.onUIClicked += findDictionaryByUI;
|
||||
linkDataDict.Add(nameof(Supplier_06_02), ui);
|
||||
supplierDict.Add(nameof(Supplier_06_02), Supplier_06_02);
|
||||
}
|
||||
else
|
||||
{
|
||||
supplierDict[nameof(Supplier_06_02)] = Supplier_06_02;
|
||||
}
|
||||
|
||||
if (!linkDataDict.ContainsKey(nameof(Supplier_06_03)))
|
||||
{
|
||||
var ui = Instantiate(prf_LinkDataUI, body);
|
||||
ui.SetUI(nameof(Supplier_06_03));
|
||||
ui.onUIClicked += findDictionaryByUI;
|
||||
linkDataDict.Add(nameof(Supplier_06_03), ui);
|
||||
supplierDict.Add(nameof(Supplier_06_03), Supplier_06_03);
|
||||
}
|
||||
else
|
||||
{
|
||||
supplierDict[nameof(Supplier_06_03)] = Supplier_06_03;
|
||||
}
|
||||
}
|
||||
|
||||
void LinkDataUI_Cobot(string topic, COBOT_Class data)
|
||||
{
|
||||
if (!linkDataDict.ContainsKey(topic))
|
||||
{
|
||||
var ui = Instantiate(prf_LinkDataUI, body);
|
||||
ui.SetUI(topic);
|
||||
ui.onUIClicked += findDictionaryByUI;
|
||||
linkDataDict.Add(topic, ui);
|
||||
cobotDict.Add(topic, data);
|
||||
}
|
||||
else
|
||||
{
|
||||
cobotDict[topic] = data;
|
||||
}
|
||||
}
|
||||
|
||||
void findDictionaryByUI(UI_LinkData UI)
|
||||
{
|
||||
var myKey = linkDataDict.FirstOrDefault(x => x.Value == UI).Key;
|
||||
if (amrDict.ContainsKey(myKey))
|
||||
{
|
||||
onUISelected?.Invoke(PrintAllVariables(amrDict[myKey]),myKey);
|
||||
}
|
||||
else if (lifterDict.ContainsKey(myKey))
|
||||
{
|
||||
onUISelected?.Invoke(PrintAllVariables(lifterDict[myKey]), myKey);
|
||||
}
|
||||
else if (stackerDict.ContainsKey(myKey))
|
||||
{
|
||||
onUISelected?.Invoke(PrintAllVariables(stackerDict[myKey]), myKey);
|
||||
}
|
||||
else if (asrsDict.ContainsKey(myKey))
|
||||
{
|
||||
onUISelected?.Invoke(PrintAllVariables(asrsDict[myKey]), myKey);
|
||||
}
|
||||
else if (supplierDict.ContainsKey(myKey))
|
||||
{
|
||||
onUISelected?.Invoke(PrintAllVariables(supplierDict[myKey]), myKey);
|
||||
}
|
||||
else if (cobotDict.ContainsKey(myKey))
|
||||
{
|
||||
onUISelected?.Invoke(PrintAllVariables(cobotDict[myKey]), myKey);
|
||||
}
|
||||
}
|
||||
|
||||
public List<(string,string)> PrintAllVariables(object target)
|
||||
{
|
||||
List<(string, string)> variableList = new List<(string, string)>();
|
||||
|
||||
Type type = target.GetType();
|
||||
|
||||
FieldInfo[] fields = type.GetFields(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static);
|
||||
foreach (FieldInfo field in fields)
|
||||
{
|
||||
var value = field.GetValue(target).ToString();
|
||||
var tuple = (field.Name, value);
|
||||
variableList.Add(tuple);
|
||||
}
|
||||
|
||||
return variableList;
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/XED/Managers/LinkDataUIManager.cs.meta
Normal file
2
Assets/Scripts/XED/Managers/LinkDataUIManager.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: beaea798e37c61142a62ba5cecd426f2
|
||||
@@ -14,6 +14,7 @@ namespace XED
|
||||
public Panel_Tooltip panel_tooltip;
|
||||
public Panel_PropertyViewer panel_propertyviewer;
|
||||
public Panel_DragHandler panel_draghandler;
|
||||
public Panel_AssetEdit panel_assetedit;
|
||||
|
||||
public override void AfterAwake()
|
||||
{
|
||||
|
||||
25
Assets/Scripts/XED/UI/Elements/UI_AssetEdit.cs
Normal file
25
Assets/Scripts/XED/UI/Elements/UI_AssetEdit.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
|
||||
namespace XED.UI
|
||||
{
|
||||
public class UI_AssetEdit : MonoBehaviour
|
||||
{
|
||||
public TMP_Text Title;
|
||||
public TMP_Text Label;
|
||||
public Image Marker;
|
||||
|
||||
public override void AfterAwake()
|
||||
{
|
||||
Title = Find<TMP_Text>(nameof(Title));
|
||||
Label = Find<TMP_Text>(nameof(Label));
|
||||
}
|
||||
|
||||
public void SetUI(string title,string label)
|
||||
{
|
||||
Title.text = title;
|
||||
Label.text = label;
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/XED/UI/Elements/UI_AssetEdit.cs.meta
Normal file
2
Assets/Scripts/XED/UI/Elements/UI_AssetEdit.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 80127229eba82e04484fc926cecfa21e
|
||||
26
Assets/Scripts/XED/UI/Elements/UI_LinkData.cs
Normal file
26
Assets/Scripts/XED/UI/Elements/UI_LinkData.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
|
||||
namespace XED.UI
|
||||
{
|
||||
public class UI_LinkData : MonoBehaviour
|
||||
{
|
||||
public TMP_Text DataID;
|
||||
public Button prf_LinkDataUI;
|
||||
public event Action<UI_LinkData> onUIClicked;
|
||||
|
||||
public override void AfterAwake()
|
||||
{
|
||||
prf_LinkDataUI = gameObject.GetComponent<Button>();
|
||||
DataID = Find<TMP_Text>(nameof(DataID));
|
||||
prf_LinkDataUI.onClick.AddListener(()=>onUIClicked?.Invoke(this));
|
||||
}
|
||||
|
||||
public void SetUI(string topic)
|
||||
{
|
||||
DataID.text = topic;
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/XED/UI/Elements/UI_LinkData.cs.meta
Normal file
2
Assets/Scripts/XED/UI/Elements/UI_LinkData.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4b559cf7a74601e4691527ab10d579b0
|
||||
63
Assets/Scripts/XED/UI/Panel/Panel_AssetEdit.cs
Normal file
63
Assets/Scripts/XED/UI/Panel/Panel_AssetEdit.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using System.Collections.Generic;
|
||||
using XRLib.UI;
|
||||
using TMPro;
|
||||
using XED.Machine;
|
||||
|
||||
namespace XED.UI
|
||||
{
|
||||
public class Panel_AssetEdit : PanelBase
|
||||
{
|
||||
public TMP_Text AssetLabel;
|
||||
public TMP_Text ConnectedAssetLabel;
|
||||
public Button ConnectedAssetMarker;
|
||||
public RectTransform Background;
|
||||
public RectTransform Body;
|
||||
public List<UI_AssetEdit> UIList = new List<UI_AssetEdit>();
|
||||
float defaulty=88f;
|
||||
public float bottomPadding = 30f;
|
||||
[SerializeField]
|
||||
UI_AssetEdit prf_AssetEditUI;
|
||||
|
||||
public Panel_InterworkingDataList datalist;
|
||||
|
||||
public override void AfterAwake()
|
||||
{
|
||||
AssetLabel = Find<TMP_Text>(nameof(AssetLabel));
|
||||
ConnectedAssetLabel = Find<TMP_Text>(nameof(ConnectedAssetLabel));
|
||||
ConnectedAssetMarker = Find<Button>(nameof(ConnectedAssetMarker));
|
||||
Background = Find<RectTransform>(nameof(Background));
|
||||
Body = Find<RectTransform>(nameof(Body));
|
||||
defaulty = Background.sizeDelta.y;
|
||||
datalist = FindAnyObjectByType<Panel_InterworkingDataList>(FindObjectsInactive.Include);
|
||||
ConnectedAssetMarker.onClick.AddListener(() => datalist.SetActive(true));
|
||||
FindAnyObjectByType<LinkDataUIManager>(FindObjectsInactive.Include).onUISelected += SetAssetData;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void SetAssetData(List<(string,string)> datas,string topic)
|
||||
{
|
||||
foreach(var ui in UIList)
|
||||
{
|
||||
Destroy(ui.gameObject);
|
||||
}
|
||||
UIList.Clear();
|
||||
ConnectedAssetLabel.text = topic;
|
||||
foreach (var d in datas)
|
||||
{
|
||||
var AssetEdit = Instantiate(prf_AssetEditUI, Body);
|
||||
AssetEdit.SetUI(d.Item1, d.Item2);
|
||||
UIList.Add(AssetEdit);
|
||||
SetBackgroundSize();
|
||||
}
|
||||
}
|
||||
|
||||
void SetBackgroundSize()
|
||||
{
|
||||
var yalpha = prf_AssetEditUI.GetComponent<RectTransform>().sizeDelta.y + Body.GetComponent<VerticalLayoutGroup>().spacing;
|
||||
Background.sizeDelta = new Vector2(Background.sizeDelta.x, defaulty + yalpha * UIList.Count + bottomPadding);
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/XED/UI/Panel/Panel_AssetEdit.cs.meta
Normal file
2
Assets/Scripts/XED/UI/Panel/Panel_AssetEdit.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ce9a6fef8abf9e044bf08d6e980212a8
|
||||
Reference in New Issue
Block a user