종합 진행 현황판, 조립 진행 현황판, 라이브러리 UI 기능 개선 #107
41
Assets/Resources/DataOrder.json
Normal file
41
Assets/Resources/DataOrder.json
Normal file
@@ -0,0 +1,41 @@
|
||||
[
|
||||
"IJ01",
|
||||
"IJ02",
|
||||
"IJ03",
|
||||
"IJ04",
|
||||
"IJ05",
|
||||
"IJ06",
|
||||
"IJ07",
|
||||
"IJ08",
|
||||
"IJ09",
|
||||
"IJ10",
|
||||
"IJ11",
|
||||
"IJ12",
|
||||
"IJ13",
|
||||
"IJ14",
|
||||
"IJ15",
|
||||
"IJ16",
|
||||
"IJ17",
|
||||
"IJ18",
|
||||
"IJ19",
|
||||
"IJ20",
|
||||
"IJ21",
|
||||
"IJ22",
|
||||
"IJ23",
|
||||
"IJ24",
|
||||
"IJ25",
|
||||
"GC",
|
||||
"CO-1",
|
||||
"CO-3",
|
||||
"CO-4",
|
||||
"OD",
|
||||
"WA-1",
|
||||
"WA-2",
|
||||
"US-1",
|
||||
"US-2",
|
||||
"INLET",
|
||||
"TBC",
|
||||
"CAP-P",
|
||||
"CAP-W",
|
||||
"GP-2"
|
||||
]
|
||||
7
Assets/Resources/DataOrder.json.meta
Normal file
7
Assets/Resources/DataOrder.json.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8bd034273d6649142b507b1045c747cb
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -35,7 +35,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 1351.8077, y: 188}
|
||||
m_SizeDelta: {x: 1356.1, y: 188}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &6190704909698884585
|
||||
MonoBehaviour:
|
||||
@@ -67,7 +67,7 @@ MonoBehaviour:
|
||||
m_Right: 0
|
||||
m_Top: 0
|
||||
m_Bottom: 0
|
||||
m_ChildAlignment: 3
|
||||
m_ChildAlignment: 4
|
||||
m_Spacing: 0
|
||||
m_ChildForceExpandWidth: 1
|
||||
m_ChildForceExpandHeight: 0
|
||||
|
||||
@@ -375,7 +375,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0.5, y: 0}
|
||||
m_AnchorMax: {x: 0.5, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 25.5}
|
||||
m_SizeDelta: {x: 45, y: 18}
|
||||
m_SizeDelta: {x: 85, y: 20}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &719616778712221133
|
||||
CanvasRenderer:
|
||||
@@ -405,7 +405,7 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_text: CAP O-RING PRINTING
|
||||
m_text: OIL DEFLECT
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 2ec62c2b5b163f64e92dc4988250c9c8, type: 2}
|
||||
m_sharedMaterial: {fileID: 1892695685711531568, guid: 2ec62c2b5b163f64e92dc4988250c9c8, type: 2}
|
||||
@@ -432,8 +432,8 @@ MonoBehaviour:
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 7.5
|
||||
m_fontSizeBase: 7.5
|
||||
m_fontSize: 14
|
||||
m_fontSizeBase: 14
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
|
||||
@@ -712,10 +712,10 @@ RectTransform:
|
||||
m_Children: []
|
||||
m_Father: {fileID: 132617129989776828}
|
||||
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_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 100, y: 30}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &4810958584519438918
|
||||
CanvasRenderer:
|
||||
|
||||
@@ -290353,7 +290353,7 @@ MonoBehaviour:
|
||||
m_Bottom: 0
|
||||
m_ChildAlignment: 3
|
||||
m_Spacing: 0
|
||||
m_ChildForceExpandWidth: 1
|
||||
m_ChildForceExpandWidth: 0
|
||||
m_ChildForceExpandHeight: 0
|
||||
m_ChildControlWidth: 0
|
||||
m_ChildControlHeight: 0
|
||||
|
||||
@@ -112,6 +112,11 @@ namespace CHN
|
||||
libraryManager.onUpdateMachineFilters += popupCanvas.panel_library.UpdateFileterList;
|
||||
libraryManager.onLibraryFilterigComplete += popupCanvas.panel_library.AddLibrarayButtons;
|
||||
|
||||
productionStatusManager.onFirstFloorInfo += popupCanvas.panel_injectionproduction.SetProductionStatus;
|
||||
productionStatusManager.onSecondFloorInfo += popupCanvas.panel_assemblyproduction.SetProductionStatus;
|
||||
productionStatusManager.onTotalFloorInfo += popupCanvas.panel_totalproduction.SetTotalProductionStatus;
|
||||
productionStatusManager.onWorkShopInfo += popupCanvas.panel_workprogressstatus.SetWorkProgressStatus;
|
||||
|
||||
datamanager.onSimpleInfo += popupCanvas.SimpleView;
|
||||
datamanager.onCompleteInfo += popupCanvas.DetailView;
|
||||
datamanager.onKPIInfo += machineKPIManager.SetMachineKPI;
|
||||
@@ -123,11 +128,6 @@ namespace CHN
|
||||
mqttManager.onWorkshopData += productionStatusManager.SetWorkProgressStatus;
|
||||
mqttManager.onWorkshopData += popupCanvas.panel_totalproduction.SetWorkProgressStatus;
|
||||
|
||||
productionStatusManager.onFirstFloorInfo += popupCanvas.panel_injectionproduction.SetProductionStatus;
|
||||
productionStatusManager.onSecondFloorInfo += popupCanvas.panel_assemblyproduction.SetProductionStatus;
|
||||
productionStatusManager.onTotalFloorInfo += popupCanvas.panel_totalproduction.SetTotalProductionStatus;
|
||||
productionStatusManager.onWorkShopInfo += popupCanvas.panel_workprogressstatus.SetWorkProgressStatus;
|
||||
|
||||
completeTimeManager.onLoadData += popupCanvas.panel_completealramhistory.SetAlarmInfoItems;
|
||||
completeTimeManager.onUnloadData += popupCanvas.panel_completealramhistory.SetAlarmInfoItems;
|
||||
completeTimeManager.onActiveHighLighter += popupCanvas.MachineDashBoardOpen;
|
||||
|
||||
@@ -6,6 +6,8 @@ using UnityEngine.UI;
|
||||
using WI;
|
||||
using TMPro;
|
||||
using SFB;
|
||||
using Newtonsoft.Json;
|
||||
using System.Linq;
|
||||
//using static UnityEditor.Progress;
|
||||
|
||||
namespace CHN
|
||||
@@ -37,9 +39,11 @@ namespace CHN
|
||||
|
||||
public float fadeTime;
|
||||
public bool isActive;
|
||||
private string dataOrder;
|
||||
|
||||
public override void AfterAwake()
|
||||
{
|
||||
dataOrder = Resources.Load<TextAsset>("DataOrder").text;
|
||||
prf_LibraryButton = Resources.Load<UI_LibraryButton>("Prefabs/UI/PRF_UI_LibraryButton");
|
||||
prf_FilterToggle = Resources.Load<UI_FilterButton>("Prefabs/UI/PRF_UI_FilterButton");
|
||||
Button_Active.onClick.AddListener(OnClickActiveButton);
|
||||
@@ -120,8 +124,7 @@ namespace CHN
|
||||
{
|
||||
ScrollView_MachineList.Clear();
|
||||
|
||||
List<Machine> sortedMachines = new List<Machine>(machines);
|
||||
sortedMachines.Sort((x, y) => x.code.CompareTo(y.code));
|
||||
var sortedMachines = SortListByWorkcd(machines);
|
||||
|
||||
foreach (var machine in sortedMachines)
|
||||
{
|
||||
@@ -130,7 +133,19 @@ namespace CHN
|
||||
machineButton.onClickButton += OnClickLibraryButton;
|
||||
}
|
||||
}
|
||||
|
||||
public List<Machine> SortListByWorkcd(HashSet<Machine> machines)
|
||||
{
|
||||
List<string> workcdOrder = JsonConvert.DeserializeObject<List<string>>(dataOrder);
|
||||
|
||||
Dictionary<string, int> orderMap = workcdOrder
|
||||
.Select((workcd, index) => new { workcd, index })
|
||||
.ToDictionary(x => x.workcd, x => x.index);
|
||||
|
||||
return machines
|
||||
.OrderBy(field => orderMap[field.code])
|
||||
.ToList();
|
||||
}
|
||||
|
||||
|
||||
private void OnClickLibraryButton(UI_LibraryButton machineButton)
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@ using CHN;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
@@ -10,8 +11,8 @@ using static MQTT;
|
||||
|
||||
public enum MachineType
|
||||
{
|
||||
Assembly,
|
||||
Injection
|
||||
Injection,
|
||||
Assembly
|
||||
}
|
||||
public class MachineGroup
|
||||
{
|
||||
@@ -48,6 +49,8 @@ public class Panel_TotalProduction : PanelBase, IProductionPanel
|
||||
public Dictionary<int, UI_MachineEffectivenessContent> effectivenessContents = new Dictionary<int, UI_MachineEffectivenessContent>();
|
||||
private UI_MachineEffectivenessContent prf_effectivenessContent;
|
||||
private RectTransform MachineEffectivenessContent;
|
||||
private List<CompleteInfo> injectionOrder = new List<CompleteInfo>();
|
||||
private List<CompleteInfo> assemblyOrder = new List<CompleteInfo>();
|
||||
|
||||
public Action<Panel_TotalProduction> onSelected;
|
||||
public Action onOpen;
|
||||
@@ -112,7 +115,7 @@ public class Panel_TotalProduction : PanelBase, IProductionPanel
|
||||
|
||||
statusContents[currentContentIndex].gameObject.transform.SetAsFirstSibling();
|
||||
effectivenessContents[currentContentIndex].gameObject.transform.SetAsFirstSibling();
|
||||
WorkProgressContent.SetWorkProgressContent(assemblyWorkShopInfo);
|
||||
WorkProgressContent.SetWorkProgressContent(injectionWorkShopInfo);
|
||||
effectivenessContents[currentContentIndex].gameObject.transform.SetAsFirstSibling();
|
||||
|
||||
currentContentIndex++;
|
||||
@@ -129,10 +132,10 @@ public class Panel_TotalProduction : PanelBase, IProductionPanel
|
||||
statusContents[currentContentIndex].gameObject.transform.SetAsFirstSibling();
|
||||
|
||||
var content = statusContents[currentContentIndex];
|
||||
var workprogressContentData = content.dataType == MachineType.Assembly ? assemblyWorkShopInfo : injectionWorkShopInfo;
|
||||
var workprogressContentData = content.dataType == MachineType.Injection ? injectionWorkShopInfo : assemblyWorkShopInfo;
|
||||
WorkProgressContent.SetWorkProgressContent(workprogressContentData);
|
||||
|
||||
var effectivenessContentIndex = content.dataType == MachineType.Assembly ? 0 : 1;
|
||||
var effectivenessContentIndex = content.dataType == MachineType.Injection ? 0 : 1;
|
||||
effectivenessContents[effectivenessContentIndex].gameObject.transform.SetAsFirstSibling();
|
||||
|
||||
currentContentIndex++;
|
||||
@@ -149,27 +152,25 @@ public class Panel_TotalProduction : PanelBase, IProductionPanel
|
||||
#region WorkProgressUI
|
||||
public void SetWorkProgressStatus(List<WorkShopInfo> workshopInfos)
|
||||
{
|
||||
assemblyWorkShopInfo = workshopInfos[0];
|
||||
injectionWorkShopInfo = workshopInfos[1];
|
||||
injectionWorkShopInfo = workshopInfos[0];
|
||||
assemblyWorkShopInfo = workshopInfos[1];
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region MachineStatusUI
|
||||
public void SetTotalProductionStatus(List<CompleteInfo> assemblyMachineInfos, List<CompleteInfo> injectionMachineInfos)
|
||||
public void SetTotalProductionStatus(List<CompleteInfo> injectionMachineInfos, List<CompleteInfo> assemblyMachineInfos)
|
||||
{
|
||||
injectionOrder.Clear();
|
||||
assemblyOrder.Clear();
|
||||
|
||||
injectionOrder.AddRange(injectionMachineInfos);
|
||||
assemblyOrder.AddRange(assemblyMachineInfos);
|
||||
|
||||
var allGroups = new List<MachineGroup>();
|
||||
|
||||
var assemblySplit = SplitArray(assemblyMachineInfos, statusItemsCount);
|
||||
var injectionSplit = SplitArray(injectionMachineInfos, statusItemsCount);
|
||||
var assemblySplit = SplitArray(assemblyMachineInfos, statusItemsCount);
|
||||
|
||||
foreach (var group in assemblySplit)
|
||||
{
|
||||
allGroups.Add(new MachineGroup
|
||||
{
|
||||
Type = MachineType.Assembly,
|
||||
Infos = group
|
||||
});
|
||||
}
|
||||
|
||||
foreach (var group in injectionSplit)
|
||||
{
|
||||
@@ -179,6 +180,14 @@ public class Panel_TotalProduction : PanelBase, IProductionPanel
|
||||
Infos = group
|
||||
});
|
||||
}
|
||||
foreach (var group in assemblySplit)
|
||||
{
|
||||
allGroups.Add(new MachineGroup
|
||||
{
|
||||
Type = MachineType.Assembly,
|
||||
Infos = group
|
||||
});
|
||||
}
|
||||
|
||||
SetProductionContent(allGroups);
|
||||
}
|
||||
@@ -239,7 +248,7 @@ public class Panel_TotalProduction : PanelBase, IProductionPanel
|
||||
{
|
||||
allGroups.Add(new MachineEffectivenessGroup
|
||||
{
|
||||
Type = MachineType.Assembly,
|
||||
Type = MachineType.Injection,
|
||||
Infos = group
|
||||
});
|
||||
}
|
||||
@@ -266,8 +275,9 @@ public class Panel_TotalProduction : PanelBase, IProductionPanel
|
||||
public List<List<SimpleField>> SplitSimpleFieldList(List<SimpleField> data)
|
||||
{
|
||||
List<List<SimpleField>> result = new List<List<SimpleField>>();
|
||||
List<SimpleField> assemblyResult = new List<SimpleField>();
|
||||
List<SimpleField> injectionResult = new List<SimpleField>();
|
||||
List<SimpleField> assemblyResult = new List<SimpleField>();
|
||||
|
||||
|
||||
for (int i = 0; i < data.Count; i++)
|
||||
{
|
||||
@@ -275,22 +285,35 @@ public class Panel_TotalProduction : PanelBase, IProductionPanel
|
||||
{
|
||||
if (data[i].machineInfo.workcd.Contains("IJ"))
|
||||
{
|
||||
assemblyResult.Add(data[i]);
|
||||
injectionResult.Add(data[i]);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
injectionResult.Add(data[i]);
|
||||
assemblyResult.Add(data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
assemblyResult.Sort((data1, data2) => data1.machineInfo.worknm.CompareTo(data2.machineInfo.worknm));
|
||||
injectionResult.Sort((data1, data2) => data1.machineInfo.worknm.CompareTo(data2.machineInfo.worknm));
|
||||
//var newInjectionResult = SortListByReference(injectionResult, injectionOrder);
|
||||
//var newassemblyResult = SortListByReference(assemblyResult, assemblyOrder);
|
||||
|
||||
result.Add(assemblyResult);
|
||||
result.Add(injectionResult);
|
||||
result.Add(assemblyResult);
|
||||
|
||||
return result;
|
||||
}
|
||||
public static List<SimpleField> SortListByReference(List<SimpleField> target, List<CompleteInfo> reference)
|
||||
{
|
||||
// CompleteInfo의 workcd 기준으로 정렬 순서 매핑
|
||||
Dictionary<string, int> orderMap = reference
|
||||
.Select((item, index) => new { item.workcd, index })
|
||||
.ToDictionary(x => x.workcd, x => x.index);
|
||||
|
||||
// target을 machineInfo.workcd 기준으로 정렬
|
||||
return target
|
||||
.OrderBy(field => orderMap[field.machineInfo.workcd])
|
||||
.ToList();
|
||||
}
|
||||
#endregion
|
||||
|
||||
public void SetDate()
|
||||
|
||||
@@ -27,7 +27,42 @@ public class UI_MachineEffectivenessItem : UIBase
|
||||
var height = (StringConvertFloat(effectivnessValue) / 100f) * maxBarHeight;
|
||||
BarGraph.rectTransform.sizeDelta = new Vector2(BarGraph.rectTransform.sizeDelta.x, height);
|
||||
SetBarGraphColor(machineStatus);
|
||||
MachineName.SetText(machineName);
|
||||
|
||||
SetMachineName(machineName);
|
||||
}
|
||||
private void SetMachineName(string machineName)
|
||||
{
|
||||
if (machineName.Contains("Injector"))
|
||||
{
|
||||
var newName = machineName.Replace("Injector No.", "");
|
||||
int.TryParse(newName, out var index);
|
||||
|
||||
MachineName.SetText($"{index}호기");
|
||||
}
|
||||
else if (machineName.Contains("X76 GORE CAP"))
|
||||
{
|
||||
MachineName.SetText("X76");
|
||||
}
|
||||
else if(machineName.Contains("OIL DEFLECTOR"))
|
||||
{
|
||||
MachineName.SetText("OIL DEFLECT");
|
||||
}
|
||||
else if(machineName.Contains("INSULATOR ENG CVR"))
|
||||
{
|
||||
MachineName.SetText("INSULATOR");
|
||||
}
|
||||
else if(machineName.Contains("CAP O-RING PRINTING"))
|
||||
{
|
||||
MachineName.SetText("CAP PRINT");
|
||||
}
|
||||
else if(machineName.Contains("CAP VENT WELD"))
|
||||
{
|
||||
MachineName.SetText("CAP WELD");
|
||||
}
|
||||
else
|
||||
{
|
||||
MachineName.SetText(machineName);
|
||||
}
|
||||
}
|
||||
private float StringConvertFloat(string value)
|
||||
{
|
||||
|
||||
@@ -6,6 +6,7 @@ using WI;
|
||||
using System.Text.RegularExpressions;
|
||||
using UnityEngine;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace CHN
|
||||
{
|
||||
@@ -25,8 +26,10 @@ namespace CHN
|
||||
private HashSet<string> samples = new();
|
||||
|
||||
public KPIData kpiData;
|
||||
private string dataOrder;
|
||||
public override void AfterAwake()
|
||||
{
|
||||
dataOrder = Resources.Load<TextAsset>("DataOrder").text;
|
||||
machines = FindObjectsByType<Machine>(FindObjectsSortMode.None);
|
||||
|
||||
foreach (var machine in machines)
|
||||
@@ -52,7 +55,7 @@ namespace CHN
|
||||
samples.Add(fileds[i].Name);
|
||||
}
|
||||
|
||||
for(int i = 0; i < 3; i++)
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
samples.Add(typeFields[i].Name);
|
||||
}
|
||||
@@ -60,7 +63,7 @@ namespace CHN
|
||||
|
||||
public void SetKPIData(MachineKPIData machineKPIData)
|
||||
{
|
||||
foreach(var rows in machineKPIData.data.rows)
|
||||
foreach (var rows in machineKPIData.data.rows)
|
||||
{
|
||||
var id = rows.workcd;
|
||||
var name = GapRemove(id);
|
||||
@@ -89,7 +92,7 @@ namespace CHN
|
||||
|
||||
private void SetMachineData()
|
||||
{
|
||||
foreach(var machine in machines)
|
||||
foreach (var machine in machines)
|
||||
{
|
||||
if (string.IsNullOrEmpty(machine.code))
|
||||
return;
|
||||
@@ -111,13 +114,15 @@ namespace CHN
|
||||
includeFields[machineName].machineInfo = mqttDataTable[machineName];
|
||||
}
|
||||
|
||||
if(kpiDataTable.Count != 0)
|
||||
if (kpiDataTable.Count != 0)
|
||||
{
|
||||
includeFields[machineName].kpiDataInfo = kpiDataTable[machineName];
|
||||
}
|
||||
}
|
||||
|
||||
onKPIInfo.Invoke(includeFields.Values.ToList());
|
||||
var newIncludeFields = SortListByWorkcd(includeFields.Values.ToList());
|
||||
|
||||
onKPIInfo.Invoke(newIncludeFields);
|
||||
}
|
||||
|
||||
public void GetSimpleCompleteData(Machine machine)
|
||||
@@ -211,6 +216,19 @@ namespace CHN
|
||||
|
||||
return usageMQTTData;
|
||||
}
|
||||
|
||||
public List<SimpleField> SortListByWorkcd(List<SimpleField> target)
|
||||
{
|
||||
List<string> workcdOrder = JsonConvert.DeserializeObject<List<string>>(dataOrder);
|
||||
|
||||
Dictionary<string, int> orderMap = workcdOrder
|
||||
.Select((workcd, index) => new { workcd, index })
|
||||
.ToDictionary(x => x.workcd, x => x.index);
|
||||
|
||||
return target
|
||||
.OrderBy(field => orderMap[field.machineName])
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
[Serializable]
|
||||
public class SimpleField
|
||||
@@ -258,4 +276,5 @@ namespace CHN
|
||||
public string moldcd;
|
||||
public string moldseq;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -29161,11 +29161,6 @@
|
||||
Called when the Unity application's foreground state changed.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Best.HTTP.Shared.HTTPUpdateDelegator.ResetSetup">
|
||||
<summary>
|
||||
Called after scene loaded to support Configurable Enter Play Mode (https://docs.unity3d.com/2019.3/Documentation/Manual/ConfigurableEnterPlayMode.html)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Best.HTTP.Shared.HTTPUpdateDelegator.CheckInstance">
|
||||
<summary>
|
||||
Will create the HTTPUpdateDelegator instance and set it up.
|
||||
|
||||
Reference in New Issue
Block a user