diff --git a/Assets/Resources/Prefabs/UI/PRF_UI_MachineKPI.prefab b/Assets/Resources/Prefabs/UI/PRF_UI_MachineKPI.prefab index 9af8b04e..784bfb97 100644 --- a/Assets/Resources/Prefabs/UI/PRF_UI_MachineKPI.prefab +++ b/Assets/Resources/Prefabs/UI/PRF_UI_MachineKPI.prefab @@ -34,8 +34,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 67, y: -77.5} - m_SizeDelta: {x: 112, y: 65} + m_AnchoredPosition: {x: 75, y: -87.5} + m_SizeDelta: {x: 130, y: 65} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &574766797026458691 GameObject: @@ -388,8 +388,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 56, y: -44.19995} - m_SizeDelta: {x: 112, y: 40} + m_AnchoredPosition: {x: 65.000015, y: -44.19999} + m_SizeDelta: {x: 130, y: 40} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &556709095573162864 CanvasRenderer: @@ -874,8 +874,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 67, y: 1.0999756} - m_SizeDelta: {x: 112, y: 64.2} + m_AnchoredPosition: {x: 75, y: -7} + m_SizeDelta: {x: 130, y: 64.2} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &3122777493453557989 GameObject: @@ -986,8 +986,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -36, y: 17.100025} - m_SizeDelta: {x: 40, y: 30} + m_AnchoredPosition: {x: -30, y: 19.6} + m_SizeDelta: {x: 70, y: 25} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &684099983634931824 CanvasRenderer: @@ -1019,8 +1019,8 @@ MonoBehaviour: m_Calls: [] m_text: "\uC591\uD488\uB960" m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 73a8cbdb8d46fbb4bae58573ac247b09, type: 2} - m_sharedMaterial: {fileID: -2117747647215524922, guid: 73a8cbdb8d46fbb4bae58573ac247b09, + m_fontAsset: {fileID: 11400000, guid: 155cf7b89710f7e40aa64ac01771e416, type: 2} + m_sharedMaterial: {fileID: 2250789165734441016, guid: 155cf7b89710f7e40aa64ac01771e416, type: 2} m_fontSharedMaterials: [] m_fontMaterial: {fileID: 0} @@ -1045,14 +1045,14 @@ MonoBehaviour: m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_fontSize: 14 - m_fontSizeBase: 14 + m_fontSize: 22 + m_fontSizeBase: 22 m_fontWeight: 400 m_enableAutoSizing: 0 m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 - m_HorizontalAlignment: 2 + m_HorizontalAlignment: 1 m_VerticalAlignment: 512 m_textAlignment: 65535 m_characterSpacing: 0 @@ -1261,8 +1261,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 56, y: -44.19995} - m_SizeDelta: {x: 112, y: 40} + m_AnchoredPosition: {x: 65.000015, y: -44.19999} + m_SizeDelta: {x: 130, y: 40} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &1388094137228017459 CanvasRenderer: @@ -1628,8 +1628,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 56, y: -45} - m_SizeDelta: {x: 112, y: 40} + m_AnchoredPosition: {x: 65.000015, y: -45} + m_SizeDelta: {x: 130, y: 40} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &1249099739140455243 CanvasRenderer: @@ -1703,8 +1703,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -23, y: 17.5} - m_SizeDelta: {x: 66, y: 30} + m_AnchoredPosition: {x: -5, y: 20} + m_SizeDelta: {x: 120, y: 25} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &6152983718686089763 CanvasRenderer: @@ -1736,8 +1736,8 @@ MonoBehaviour: m_Calls: [] m_text: "\uC131\uB2A5\uAC00\uB3D9\uB960" m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 73a8cbdb8d46fbb4bae58573ac247b09, type: 2} - m_sharedMaterial: {fileID: -2117747647215524922, guid: 73a8cbdb8d46fbb4bae58573ac247b09, + m_fontAsset: {fileID: 11400000, guid: 155cf7b89710f7e40aa64ac01771e416, type: 2} + m_sharedMaterial: {fileID: 2250789165734441016, guid: 155cf7b89710f7e40aa64ac01771e416, type: 2} m_fontSharedMaterials: [] m_fontMaterial: {fileID: 0} @@ -1762,14 +1762,14 @@ MonoBehaviour: m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_fontSize: 14 - m_fontSizeBase: 14 + m_fontSize: 22 + m_fontSizeBase: 22 m_fontWeight: 400 m_enableAutoSizing: 0 m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 - m_HorizontalAlignment: 2 + m_HorizontalAlignment: 1 m_VerticalAlignment: 512 m_textAlignment: 65535 m_characterSpacing: 0 @@ -1977,8 +1977,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -16.5, y: 17.5} - m_SizeDelta: {x: 79, y: 30} + m_AnchoredPosition: {x: -5, y: 20} + m_SizeDelta: {x: 120, y: 25} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &8056126773163100328 CanvasRenderer: @@ -2010,8 +2010,8 @@ MonoBehaviour: m_Calls: [] m_text: "\uC870\uC5C5\uC2DC\uAC04\uB300\uBE44" m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 73a8cbdb8d46fbb4bae58573ac247b09, type: 2} - m_sharedMaterial: {fileID: -2117747647215524922, guid: 73a8cbdb8d46fbb4bae58573ac247b09, + m_fontAsset: {fileID: 11400000, guid: 155cf7b89710f7e40aa64ac01771e416, type: 2} + m_sharedMaterial: {fileID: 2250789165734441016, guid: 155cf7b89710f7e40aa64ac01771e416, type: 2} m_fontSharedMaterials: [] m_fontMaterial: {fileID: 0} @@ -2036,14 +2036,14 @@ MonoBehaviour: m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_fontSize: 14 - m_fontSizeBase: 14 + m_fontSize: 22 + m_fontSizeBase: 22 m_fontWeight: 400 m_enableAutoSizing: 0 m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 - m_HorizontalAlignment: 2 + m_HorizontalAlignment: 1 m_VerticalAlignment: 512 m_textAlignment: 65535 m_characterSpacing: 0 @@ -2114,8 +2114,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -68, y: -77.5} - m_SizeDelta: {x: 112, y: 65} + m_AnchoredPosition: {x: -75, y: -87.5} + m_SizeDelta: {x: 130, y: 65} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &8361265782747868586 GameObject: @@ -2330,8 +2330,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -16.5, y: 17.100025} - m_SizeDelta: {x: 79, y: 30} + m_AnchoredPosition: {x: -5, y: 19.599987} + m_SizeDelta: {x: 120, y: 25} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &5276157782184477752 CanvasRenderer: @@ -2363,8 +2363,8 @@ MonoBehaviour: m_Calls: [] m_text: "\uBD80\uD558\uC2DC\uAC04\uB300\uBE44" m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 73a8cbdb8d46fbb4bae58573ac247b09, type: 2} - m_sharedMaterial: {fileID: -2117747647215524922, guid: 73a8cbdb8d46fbb4bae58573ac247b09, + m_fontAsset: {fileID: 11400000, guid: 155cf7b89710f7e40aa64ac01771e416, type: 2} + m_sharedMaterial: {fileID: 2250789165734441016, guid: 155cf7b89710f7e40aa64ac01771e416, type: 2} m_fontSharedMaterials: [] m_fontMaterial: {fileID: 0} @@ -2389,14 +2389,14 @@ MonoBehaviour: m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_fontSize: 14 - m_fontSizeBase: 14 + m_fontSize: 22 + m_fontSizeBase: 22 m_fontWeight: 400 m_enableAutoSizing: 0 m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 - m_HorizontalAlignment: 2 + m_HorizontalAlignment: 1 m_VerticalAlignment: 512 m_textAlignment: 65535 m_characterSpacing: 0 @@ -2467,8 +2467,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -68, y: 1.0999756} - m_SizeDelta: {x: 112, y: 64.2} + m_AnchoredPosition: {x: -75, y: -7} + m_SizeDelta: {x: 130, y: 64.2} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &9090143095051259198 GameObject: @@ -2505,8 +2505,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 56, y: -45} - m_SizeDelta: {x: 112, y: 40} + m_AnchoredPosition: {x: 65.000015, y: -45} + m_SizeDelta: {x: 130, y: 40} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &5052908689444046254 CanvasRenderer: diff --git a/Assets/Scripts/UI/UI_MachineStatus.cs b/Assets/Scripts/UI/UI_MachineStatus.cs index c8cad0d4..ad43aafc 100644 --- a/Assets/Scripts/UI/UI_MachineStatus.cs +++ b/Assets/Scripts/UI/UI_MachineStatus.cs @@ -6,6 +6,7 @@ using WI; using TMPro; using static MQTT; using System; +using System.Globalization; public class UI_MachineStatus : UIBase { @@ -22,16 +23,18 @@ public class UI_MachineStatus : UIBase public TextMeshProUGUI goaltime; public Image UI_StatusItem; - public void SetStatusData(CompleteInfo completeInfo,Color color) + public void SetStatusData(CompleteInfo completeInfo, Color color) { UI_StatusItem = GetComponent(); + var currentTime = DateTime.Now.ToString("HHmm"); + worknm.SetText(completeInfo.worknm); status.SetText(completeInfo.statusnm); SetStatusColor(completeInfo.statusnm); itemcd.SetText(completeInfo.itemcd); itemdesc.SetText(completeInfo.itemdesc); wordno.SetText(completeInfo.wordno); - goaltime.SetText(completeInfo.goaltime); + goaltime.SetText(CalculateDate(currentTime, completeInfo.sttm)); goalqty.SetText(RoundToIntData(completeInfo.goalqty)); workqty.SetText(RoundToIntData(completeInfo.workqty)); @@ -41,6 +44,17 @@ public class UI_MachineStatus : UIBase efficiency.SetText(RoundToFloatData(completeInfo.efficiency)); UI_StatusItem.color = color; } + private string CalculateDate(string currentTimeData, string startTimeData) + { + string formattedCurrentTimeData = currentTimeData.Insert(2, ":"); + string formattedStartTimeData = startTimeData.Insert(2, ":"); + + DateTime.TryParseExact(formattedCurrentTimeData, "HH:mm", null, DateTimeStyles.None, out var currentTime); + DateTime.TryParseExact(formattedStartTimeData, "HH:mm", null, DateTimeStyles.None, out var startTime); + + var dateTime = currentTime.Subtract(startTime); + return dateTime.ToString(@"hh\:mm"); + } public string RoundToIntData(string data) { float.TryParse(data, out var floatData); diff --git a/Assets/WorkSpace/Personal/JYM/MachineKPIManager.cs b/Assets/WorkSpace/Personal/JYM/MachineKPIManager.cs index 1e40b239..3d880822 100644 --- a/Assets/WorkSpace/Personal/JYM/MachineKPIManager.cs +++ b/Assets/WorkSpace/Personal/JYM/MachineKPIManager.cs @@ -76,9 +76,12 @@ namespace CHN } private void OnClickMachineKPI(UI_MachineKPI machineKPI) { - if (current_MachineKPI != null) + foreach(var machine in machines) { - current_MachineKPI.Shrink(); + if (machine.machineKPI != null) + { + machine.machineKPI.Shrink(); + } } current_MachineKPI = machineKPI; current_MachineKPI.Expand(); diff --git a/Assets/WorkSpace/Personal/JYM/UI_StatusContent.cs b/Assets/WorkSpace/Personal/JYM/UI_StatusContent.cs index e0e87f28..4237413d 100644 --- a/Assets/WorkSpace/Personal/JYM/UI_StatusContent.cs +++ b/Assets/WorkSpace/Personal/JYM/UI_StatusContent.cs @@ -25,11 +25,13 @@ public class UI_StatusContent : MonoBehaviour if (odd) { - machineStatuses[machineInfo.worknm].SetStatusData(machineInfo, new Color(0.07058824f, 0.1294118f, 0.2941177f)); + var backgroundColor = new Color(0.07058824f, 0.1294118f, 0.2941177f); + machineStatuses[machineInfo.worknm].SetStatusData(machineInfo, backgroundColor); } else { - machineStatuses[machineInfo.worknm].SetStatusData(machineInfo, new Color(0.04313726f, 0.09019608f, 0.2235294f)); + var backgroundColor = new Color(0.04313726f, 0.09019608f, 0.2235294f); + machineStatuses[machineInfo.worknm].SetStatusData(machineInfo, backgroundColor); } odd = !odd; } diff --git a/CompleteTimeAlarmInfo.json b/CompleteTimeAlarmInfo.json index 5f1c375d..3d747f06 100644 --- a/CompleteTimeAlarmInfo.json +++ b/CompleteTimeAlarmInfo.json @@ -187,7 +187,7 @@ "worknm": "Injector No.06", "workseq": "1", "status": "1", - "statusnm": "가동중", + "statusnm": "비가동", "itemcd": "24295087-1", "itemdesc": "COVER A-CHK/VLV BODY", "pjtcd": "GF6", @@ -292,7 +292,7 @@ "worknm": "Injector No.09", "workseq": "1", "status": "4", - "statusnm": "금형교체", + "statusnm": "가동중", "itemcd": "C10039", "itemdesc": "BRACKET ASM-FV DRVR INFO CAMERA", "pjtcd": "9BQX", @@ -313,7 +313,7 @@ "ptotm": "2025-04-04 08:17:46", "psttm": "2025-04-03 08:18:46" }, - "isCheck": true + "isCheck": false }, { "completeInfo": { @@ -957,7 +957,7 @@ "worknm": "GF9 C/VB LINE", "workseq": "1", "status": "1", - "statusnm": "가동중", + "statusnm": "비가동", "itemcd": "24049859-GMA", "itemdesc": "COVER ASM-C/VLV BODY", "pjtcd": "GF9", @@ -1062,7 +1062,7 @@ "worknm": "SGE W/O LINE", "workseq": "1", "status": "1", - "statusnm": "비가동", + "statusnm": "가동중", "itemcd": "12707589-GMA", "itemdesc": "OUTLET ASM – WATER", "pjtcd": "SGE", @@ -1465,7 +1465,7 @@ "sttm": "1043", "totm": "", "goaltime": "299", - "ptotm": "2025-04-03 15:42:18", + "ptotm": "2025-04-03 18:21:28", "psttm": "2025-04-03 10:43:18" }, "isCheck": false @@ -1500,7 +1500,7 @@ "sttm": "1039", "totm": "", "goaltime": "213", - "ptotm": "2025-04-03 14:12:06", + "ptotm": "2025-04-03 19:08:32", "psttm": "2025-04-03 10:39:06" }, "isCheck": false