[정영민] Meun 오류 수정
This commit is contained in:
@@ -17,10 +17,13 @@ namespace ChunilENG.UI.Command
|
||||
|
||||
public void Execute(object? parameter = null)
|
||||
{
|
||||
propertyWindow.Hide();
|
||||
|
||||
var uiManager = ChunilENGSceneMain.Instance.GetManager<ChunilENGUIManager>();
|
||||
uiManager.GetCanvas<PopupCanvas>().OpenPanel<AlarmHistoryPanel>(CanvasPanelOpenMode.Single);
|
||||
|
||||
uiManager.GetCanvas<StaticCanvas>().GetPanel<BottomLeftToolbar>().HideItem();
|
||||
|
||||
var topmenuPanel = uiManager.GetCanvas<StaticCanvas>().GetPanel<TopMenuPanel>();
|
||||
topmenuPanel.PropertyWindow.Hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,19 +7,16 @@ namespace ChunilENG.UI.Command
|
||||
{
|
||||
public class OpenAssemblyProgressPanelCommand : ICommand
|
||||
{
|
||||
private PropertyWindow propertyWindow;
|
||||
|
||||
public OpenAssemblyProgressPanelCommand(PropertyWindow propertyWindow)
|
||||
{
|
||||
this.propertyWindow = propertyWindow;
|
||||
}
|
||||
|
||||
public void Execute(object? parameter = null)
|
||||
{
|
||||
var uiManager = ChunilENGSceneMain.Instance.GetManager<ChunilENGUIManager>();
|
||||
uiManager.GetCanvas<StaticCanvas>().GetPanel<LeftSidePanel>().DeactiveCurrentSideTab();
|
||||
uiManager.GetCanvas<StaticCanvas>().GetPanel<LeftSidePanel>().SideTabBar.DeactivateCurrentTab();
|
||||
uiManager.GetCanvas<StaticCanvas>().GetPanel<LeftSidePanel>().DeactiveSideToolButton();
|
||||
propertyWindow.Hide();
|
||||
|
||||
uiManager.GetCanvas<StaticCanvas>().GetPanel<BottomLeftToolbar>().HideItem();
|
||||
|
||||
var topmenuPanel = uiManager.GetCanvas<StaticCanvas>().GetPanel<TopMenuPanel>();
|
||||
topmenuPanel.PropertyWindow.Hide();
|
||||
|
||||
uiManager.GetCanvas<PopupCanvas>().OpenPanel<AssemblyProgressPanel>(CanvasPanelOpenMode.Single);
|
||||
}
|
||||
|
||||
@@ -8,19 +8,16 @@ namespace ChunilENG.UI.Command
|
||||
{
|
||||
public class OpenFinalInspectionPanelCommand : ICommand
|
||||
{
|
||||
private PropertyWindow propertyWindow;
|
||||
|
||||
public OpenFinalInspectionPanelCommand(PropertyWindow propertyWindow)
|
||||
{
|
||||
this.propertyWindow = propertyWindow;
|
||||
}
|
||||
|
||||
public void Execute(object? parameter = null)
|
||||
{
|
||||
var uiManager = ChunilENGSceneMain.Instance.GetManager<ChunilENGUIManager>();
|
||||
uiManager.GetCanvas<StaticCanvas>().GetPanel<LeftSidePanel>().DeactiveCurrentSideTab();
|
||||
uiManager.GetCanvas<StaticCanvas>().GetPanel<LeftSidePanel>().SideTabBar.DeactivateCurrentTab();
|
||||
uiManager.GetCanvas<StaticCanvas>().GetPanel<LeftSidePanel>().DeactiveSideToolButton();
|
||||
propertyWindow.Hide();
|
||||
|
||||
uiManager.GetCanvas<StaticCanvas>().GetPanel<BottomLeftToolbar>().HideItem();
|
||||
|
||||
var topmenuPanel = uiManager.GetCanvas<StaticCanvas>().GetPanel<TopMenuPanel>();
|
||||
topmenuPanel.PropertyWindow.Hide();
|
||||
|
||||
uiManager.GetCanvas<PopupCanvas>().OpenPanel<FinalInspectionPanel>(CanvasPanelOpenMode.Single);
|
||||
}
|
||||
|
||||
@@ -21,6 +21,15 @@ namespace ChunilENG.UI.Command
|
||||
|
||||
var uiManager = ChunilENGSceneMain.Instance.GetManager<ChunilENGUIManager>();
|
||||
uiManager.GetCanvas<PopupCanvas>().ClosePanel();
|
||||
|
||||
var leftSidePanel = uiManager.GetCanvas<StaticCanvas>().GetPanel<LeftSidePanel>();
|
||||
var topmenuPanel = uiManager.GetCanvas<StaticCanvas>().GetPanel<TopMenuPanel>();
|
||||
|
||||
leftSidePanel.DeactiveSideToolButton();
|
||||
leftSidePanel.SideTabBar.DeactivateCurrentTab();
|
||||
|
||||
uiManager.GetCanvas<StaticCanvas>().GetPanel<BottomLeftToolbar>().HideItem();
|
||||
topmenuPanel.PropertyWindow.Hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,23 +8,24 @@ namespace ChunilENG.UI.Command
|
||||
{
|
||||
public class OpenMachineDashBoardCommand : ICommand
|
||||
{
|
||||
private PropertyWindow propertyWindow;
|
||||
|
||||
public Machine machine;
|
||||
public CompleteInfo completeInfo;
|
||||
|
||||
public OpenMachineDashBoardCommand(PropertyWindow propertyWindow, Machine machine, CompleteInfo completeInfo)
|
||||
public OpenMachineDashBoardCommand(Machine machine, CompleteInfo completeInfo)
|
||||
{
|
||||
this.propertyWindow = propertyWindow;
|
||||
this.machine = machine;
|
||||
this.completeInfo = completeInfo;
|
||||
}
|
||||
public void Execute(object? parameter = null)
|
||||
{
|
||||
var uiManager = ChunilENGSceneMain.Instance.GetManager<ChunilENGUIManager>();
|
||||
uiManager.GetCanvas<StaticCanvas>().GetPanel<LeftSidePanel>().DeactiveCurrentSideTab();
|
||||
uiManager.GetCanvas<StaticCanvas>().GetPanel<LeftSidePanel>().SideTabBar.DeactivateCurrentTab();
|
||||
uiManager.GetCanvas<StaticCanvas>().GetPanel<LeftSidePanel>().DeactiveSideToolButton();
|
||||
propertyWindow.Hide();
|
||||
|
||||
uiManager.GetCanvas<StaticCanvas>().GetPanel<BottomLeftToolbar>().HideItem();
|
||||
|
||||
var topmenuPanel = uiManager.GetCanvas<StaticCanvas>().GetPanel<TopMenuPanel>();
|
||||
topmenuPanel.PropertyWindow.Hide();
|
||||
|
||||
uiManager.GetCanvas<PopupCanvas>().GetPanel<MachineDashBoard>().SetDetailDashBoardData(completeInfo, machine);
|
||||
uiManager.GetCanvas<PopupCanvas>().OpenPanel<MachineDashBoard>(CanvasPanelOpenMode.Single);
|
||||
|
||||
@@ -8,19 +8,16 @@ namespace ChunilENG.UI.Command
|
||||
{
|
||||
public class OpenProductionProgressPanelCommand : ICommand
|
||||
{
|
||||
private PropertyWindow propertyWindow;
|
||||
|
||||
public OpenProductionProgressPanelCommand(PropertyWindow propertyWindow)
|
||||
{
|
||||
this.propertyWindow = propertyWindow;
|
||||
}
|
||||
|
||||
public void Execute(object? parameter = null)
|
||||
{
|
||||
var uiManager = ChunilENGSceneMain.Instance.GetManager<ChunilENGUIManager>();
|
||||
uiManager.GetCanvas<StaticCanvas>().GetPanel<LeftSidePanel>().DeactiveCurrentSideTab();
|
||||
uiManager.GetCanvas<StaticCanvas>().GetPanel<LeftSidePanel>().SideTabBar.DeactivateCurrentTab();
|
||||
uiManager.GetCanvas<StaticCanvas>().GetPanel<LeftSidePanel>().DeactiveSideToolButton();
|
||||
propertyWindow.Hide();
|
||||
|
||||
uiManager.GetCanvas<StaticCanvas>().GetPanel<BottomLeftToolbar>().HideItem();
|
||||
|
||||
var topmenuPanel = uiManager.GetCanvas<StaticCanvas>().GetPanel<TopMenuPanel>();
|
||||
topmenuPanel.PropertyWindow.Hide();
|
||||
|
||||
uiManager.GetCanvas<PopupCanvas>().OpenPanel<ProductionProgressPanel>(CanvasPanelOpenMode.Single);
|
||||
}
|
||||
|
||||
@@ -8,19 +8,16 @@ namespace ChunilENG.UI.Command
|
||||
{
|
||||
public class OpenTotalProgressPanelCommand : ICommand
|
||||
{
|
||||
private PropertyWindow propertyWindow;
|
||||
|
||||
public OpenTotalProgressPanelCommand(PropertyWindow propertyWindow)
|
||||
{
|
||||
this.propertyWindow = propertyWindow;
|
||||
}
|
||||
|
||||
public void Execute(object? parameter = null)
|
||||
{
|
||||
var uiManager = ChunilENGSceneMain.Instance.GetManager<ChunilENGUIManager>();
|
||||
uiManager.GetCanvas<StaticCanvas>().GetPanel<LeftSidePanel>().DeactiveCurrentSideTab();
|
||||
uiManager.GetCanvas<StaticCanvas>().GetPanel<LeftSidePanel>().SideTabBar.DeactivateCurrentTab();
|
||||
uiManager.GetCanvas<StaticCanvas>().GetPanel<LeftSidePanel>().DeactiveSideToolButton();
|
||||
propertyWindow.Hide();
|
||||
|
||||
uiManager.GetCanvas<StaticCanvas>().GetPanel<BottomLeftToolbar>().HideItem();
|
||||
|
||||
var topmenuPanel = uiManager.GetCanvas<StaticCanvas>().GetPanel<TopMenuPanel>();
|
||||
topmenuPanel.PropertyWindow.Hide();
|
||||
|
||||
uiManager.GetCanvas<PopupCanvas>().OpenPanel<TotalProgressPanel>(CanvasPanelOpenMode.Single);
|
||||
}
|
||||
|
||||
@@ -8,19 +8,16 @@ namespace ChunilENG.UI.Command
|
||||
{
|
||||
public class OpenWorkProgressPanelCommand : ICommand
|
||||
{
|
||||
private PropertyWindow propertyWindow;
|
||||
|
||||
public OpenWorkProgressPanelCommand(PropertyWindow propertyWindow)
|
||||
{
|
||||
this.propertyWindow = propertyWindow;
|
||||
}
|
||||
|
||||
public void Execute(object? parameter = null)
|
||||
{
|
||||
var uiManager = ChunilENGSceneMain.Instance.GetManager<ChunilENGUIManager>();
|
||||
uiManager.GetCanvas<StaticCanvas>().GetPanel<LeftSidePanel>().DeactiveCurrentSideTab();
|
||||
uiManager.GetCanvas<StaticCanvas>().GetPanel<LeftSidePanel>().SideTabBar.DeactivateCurrentTab();
|
||||
uiManager.GetCanvas<StaticCanvas>().GetPanel<LeftSidePanel>().DeactiveSideToolButton();
|
||||
propertyWindow.Hide();
|
||||
|
||||
uiManager.GetCanvas<StaticCanvas>().GetPanel<BottomLeftToolbar>().HideItem();
|
||||
|
||||
var topmenuPanel = uiManager.GetCanvas<StaticCanvas>().GetPanel<TopMenuPanel>();
|
||||
topmenuPanel.PropertyWindow.Hide();
|
||||
|
||||
uiManager.GetCanvas<PopupCanvas>().OpenPanel<WorkProgressPanel>(CanvasPanelOpenMode.Single);
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ namespace ChunilENG.Management
|
||||
private void OnClickMachineInfoItem(MachineInfoItem machineInfoItem)
|
||||
{
|
||||
machineInfoItem.transform.SetAsLastSibling();
|
||||
CommandManager.Instance.Execute(new OpenMachineDashBoardCommand(propertyWindow, itemToMachines[machineInfoItem], machineInfoItem.data));
|
||||
CommandManager.Instance.Execute(new OpenMachineDashBoardCommand(itemToMachines[machineInfoItem], machineInfoItem.data));
|
||||
}
|
||||
|
||||
bool IsScreenRange(Machine machine)
|
||||
@@ -270,7 +270,7 @@ namespace ChunilENG.Management
|
||||
{
|
||||
item.transform.SetAsLastSibling();
|
||||
CommandManager.Instance.Execute(
|
||||
new OpenMachineDashBoardCommand(propertyWindow, null, item.data));
|
||||
new OpenMachineDashBoardCommand(null, item.data));
|
||||
}
|
||||
|
||||
private CompleteInfo CreateMockCompleteInfo(EquipmentItem equipment)
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using OCTOPUS_TWIN.UI;
|
||||
using OCTOPUS_TWIN.Command;
|
||||
using ChunilENG.Management;
|
||||
|
||||
namespace ChunilENG.UI
|
||||
{
|
||||
@@ -52,6 +53,7 @@ namespace ChunilENG.UI
|
||||
private void OnClickButton(FloorControlItem currentButton)
|
||||
{
|
||||
OnValueChanged(currentButton.value);
|
||||
ChunilENGSceneMain.Instance.GetManager<ChunilENGUIManager>().GetCanvas<StaticCanvas>().GetPanel<BottomLeftToolbar>().HideItem();
|
||||
}
|
||||
|
||||
public void ChangedCurrentFloor(int value)
|
||||
|
||||
@@ -31,16 +31,6 @@ namespace ChunilENG.UI
|
||||
|
||||
await UniTask.CompletedTask;
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
SetupToolBox();
|
||||
DeactiveCurrentSideTab();
|
||||
|
||||
var initialViewCommand = new CameraViewModeChangedCommand(ViewMode.PerspectiveView);
|
||||
initialViewCommand.Execute();
|
||||
}
|
||||
|
||||
private void SetupToolBox()
|
||||
{
|
||||
// ToolbarModel 인스턴스 생성
|
||||
@@ -139,10 +129,6 @@ namespace ChunilENG.UI
|
||||
recorder = new CaptureRecoder();
|
||||
recorder.Setup();
|
||||
}
|
||||
public void DeactiveCurrentSideTab()
|
||||
{
|
||||
sideTabBar.DeactivateCurrentTab();
|
||||
}
|
||||
public void DeactiveSideToolButton()
|
||||
{
|
||||
toolbar.SetToggleButtonState("button_icon_control", false);
|
||||
|
||||
@@ -28,6 +28,8 @@ namespace ChunilENG
|
||||
[SerializeField]
|
||||
private PropertyWindow propertyWindow;
|
||||
|
||||
public PropertyWindow PropertyWindow { get => propertyWindow; }
|
||||
|
||||
public override async UniTask Init()
|
||||
{
|
||||
propertyWindow = FindAnyObjectByType<PropertyWindow>(FindObjectsInactive.Include);
|
||||
@@ -42,11 +44,6 @@ namespace ChunilENG
|
||||
await UniTask.CompletedTask;
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
SetupToolBox();
|
||||
}
|
||||
|
||||
private ContentModalView contentModalView;
|
||||
private async void SetSettingContent()
|
||||
{
|
||||
@@ -132,11 +129,11 @@ namespace ChunilENG
|
||||
Debug.LogWarning("TopMenuController is not assigned in SceneMain.");
|
||||
return;
|
||||
}
|
||||
topMenu.AddMenuItem(new MenuItemData("total_production_status", "종합 진행 현황", new OpenTotalProgressPanelCommand(propertyWindow)));
|
||||
topMenu.AddMenuItem(new MenuItemData("production_status", "작업 진행 현황", new OpenWorkProgressPanelCommand(propertyWindow)));
|
||||
topMenu.AddMenuItem(new MenuItemData("production_status", "생산 진행 현황", new OpenProductionProgressPanelCommand(propertyWindow)));
|
||||
topMenu.AddMenuItem(new MenuItemData("injection_status", "조립 진행 현황", new OpenAssemblyProgressPanelCommand(propertyWindow)));
|
||||
topMenu.AddMenuItem(new MenuItemData("production_status", "최종 검사", new OpenFinalInspectionPanelCommand(propertyWindow)));
|
||||
topMenu.AddMenuItem(new MenuItemData("total_production_status", "종합 진행 현황", new OpenTotalProgressPanelCommand()));
|
||||
topMenu.AddMenuItem(new MenuItemData("production_status", "작업 진행 현황", new OpenWorkProgressPanelCommand()));
|
||||
topMenu.AddMenuItem(new MenuItemData("production_status", "생산 진행 현황", new OpenProductionProgressPanelCommand()));
|
||||
topMenu.AddMenuItem(new MenuItemData("injection_status", "조립 진행 현황", new OpenAssemblyProgressPanelCommand()));
|
||||
topMenu.AddMenuItem(new MenuItemData("production_status", "최종 검사", new OpenFinalInspectionPanelCommand()));
|
||||
topMenu.Initialize();
|
||||
}
|
||||
private void SetupToolBox()
|
||||
|
||||
@@ -22,10 +22,9 @@ MonoBehaviour:
|
||||
sceneNames:
|
||||
- KEPCOScene
|
||||
volumeProfiles:
|
||||
- {fileID: 11400000, guid: 10fc4df2da32a41aaa32d77bc913491c, type: 2}
|
||||
- {fileID: 11400000, guid: b88f584d02e80704dbb909e5ca9daccb, type: 2}
|
||||
staticCanvasPrefab: {fileID: 9115987721486925841, guid: df39e435fbc6b27458c0ced9b20b0bd7, type: 3}
|
||||
popupCanvasPrefab: {fileID: 6944805395147841475, guid: 211ab265afe9f854bae51f1a2602c3f5, type: 3}
|
||||
contentModalViewPrefab: {fileID: 660829159889194611, guid: e1d277c7d9a85d3419471387fb9f9bee, type: 3}
|
||||
sceneMain: {fileID: 5850141579646257595, guid: 2b7f55830958f804aaad00ae1d4bbe6a, type: 3}
|
||||
labelCanvas: {fileID: 5307194914983898905, guid: 3611a796a20d61f4faad719a2a0352be, type: 3}
|
||||
isLocked: 0
|
||||
|
||||
@@ -33,6 +33,7 @@ namespace KEPCO
|
||||
|
||||
public void InitSceneMain()
|
||||
{
|
||||
BaseCameraPoistion();
|
||||
OnAppInitialized();
|
||||
}
|
||||
|
||||
@@ -41,8 +42,6 @@ namespace KEPCO
|
||||
//await requestDataAsync();
|
||||
animationManager = await LoadManager<ScriptableAnimationManager>();
|
||||
colorPalette = await LoadManager<ColorPalette>();
|
||||
facilityManager = await LoadManager<FacilityManager>();
|
||||
sensorManager = await LoadManager<SensorManager>();
|
||||
|
||||
building = FindAnyObjectByType<Building>();
|
||||
await building.Init();
|
||||
@@ -60,6 +59,16 @@ namespace KEPCO
|
||||
await UniTask.CompletedTask;
|
||||
}
|
||||
|
||||
private void BaseCameraPoistion()
|
||||
{
|
||||
var controller = OctopusTwinAppMain.Instance.cameraController;
|
||||
controller.currentAzimuth = -139f;
|
||||
controller.currentElevation = 23f;
|
||||
controller.currentDistance = 30f;
|
||||
controller.SetTargetPos(new Vector3(16.5f, 0.05f, -12));
|
||||
}
|
||||
|
||||
|
||||
private readonly Dictionary<Type, Manager> managers = new();
|
||||
private async UniTask<T> LoadManager<T>() where T : Manager
|
||||
{
|
||||
@@ -78,6 +87,7 @@ namespace KEPCO
|
||||
//Debug.LogWarning($"Duplicate Manager: {type.Name}");
|
||||
return manager;
|
||||
}
|
||||
|
||||
await manager.Init();
|
||||
managers.Add(type, manager);
|
||||
|
||||
|
||||
@@ -40,9 +40,6 @@ namespace KEPCO.Managements
|
||||
{
|
||||
Application.targetFrameRate = 60;
|
||||
|
||||
facilityManager = KEPCOSceneMain.Instance.GetManager<FacilityManager>();
|
||||
sensorManager = KEPCOSceneMain.Instance.GetManager<SensorManager>();
|
||||
|
||||
SCADAPanelData = Resources.Load<TextAsset>($"{ResourceURL.kepcoENGdataFolderPath}{nameof(SCADAPanelData)}").text;
|
||||
operateInfo = JsonConvert.DeserializeObject<OperateApiResponse>(SCADAPanelData);
|
||||
|
||||
@@ -52,16 +49,23 @@ namespace KEPCO.Managements
|
||||
SensorColorData = Resources.Load<TextAsset>($"{ResourceURL.kepcoENGdataFolderPath}{nameof(SensorColorData)}").text;
|
||||
sensorStatusInfo = JsonConvert.DeserializeObject<SensorEventApiResponse>(SensorColorData);
|
||||
|
||||
UpdateAllFacilityData();
|
||||
UpdateAllSensorData();
|
||||
test = BuildAllPanelsGrouped(11);
|
||||
|
||||
KEPCOSceneMain.Instance.Initialized += OnSceneInitialized;
|
||||
|
||||
await UniTask.CompletedTask;
|
||||
}
|
||||
public void OnSceneInitialized()
|
||||
{
|
||||
var parent = FindObjectsByType<Tag_Machine>(FindObjectsSortMode.None);
|
||||
|
||||
facilityManager = new FacilityManager();
|
||||
facilityManager.InitFacility(parent);
|
||||
|
||||
sensorManager = new SensorManager();
|
||||
sensorManager.InitSensor(parent);
|
||||
|
||||
UpdateAllFacilityData();
|
||||
UpdateAllSensorData();
|
||||
|
||||
var facilitiesGroups = BuildAllPanelsGrouped(11);
|
||||
CommandManager.Instance.Execute(new SetTotalProgressDataCommand(facilitiesGroups));
|
||||
}
|
||||
|
||||
@@ -8,11 +8,12 @@ using OCTOPUS_TWIN.Constants;
|
||||
using KEPCO.Object;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using UVC.Management;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace KEPCO.Managements
|
||||
{
|
||||
[Serializable]
|
||||
public class FacilityManager : Manager
|
||||
public class FacilityManager
|
||||
{
|
||||
public List<Facility> facilities = new List<Facility>();
|
||||
|
||||
@@ -22,12 +23,14 @@ namespace KEPCO.Managements
|
||||
public Dictionary<string, Facility> nameToFacility = new();
|
||||
public Dictionary<string, Facility> codeToFacility = new();
|
||||
|
||||
public override async UniTask Init()
|
||||
public void InitFacility(Tag_Machine[] parent)
|
||||
{
|
||||
jsonFacilityNameTable.Clear();
|
||||
jsonFacilityCodeTable.Clear();
|
||||
nameToFacility.Clear();
|
||||
codeToFacility.Clear();
|
||||
facilities.Clear();
|
||||
|
||||
var facilityParents = FindObjectsByType<Tag_Machine>(FindObjectsSortMode.None);
|
||||
|
||||
var json = ReadJsonFacilityData();
|
||||
|
||||
foreach(var j in json)
|
||||
@@ -37,7 +40,7 @@ namespace KEPCO.Managements
|
||||
jsonFacilityCodeTable.TryAdd(code, j);
|
||||
}
|
||||
|
||||
foreach(var m in facilityParents)
|
||||
foreach(var m in parent)
|
||||
{
|
||||
var childTransforms = m.GetComponentsInChildren<Transform>();
|
||||
|
||||
@@ -74,6 +77,7 @@ namespace KEPCO.Managements
|
||||
continue;
|
||||
}
|
||||
}
|
||||
fac.Init();
|
||||
fac.data = facData;
|
||||
|
||||
nameToFacility.TryAdd(name, fac);
|
||||
@@ -85,7 +89,7 @@ namespace KEPCO.Managements
|
||||
facilities.Add(fac);
|
||||
}
|
||||
}
|
||||
await UniTask.CompletedTask;
|
||||
//await UniTask.CompletedTask;
|
||||
}
|
||||
public JsonFacilityData[] ReadJsonFacilityData()
|
||||
{
|
||||
|
||||
@@ -17,6 +17,9 @@ namespace KEPCO.Managements
|
||||
public UI_FacilityIcon facilityIcon;
|
||||
public UI_SensorIcon sensorIcon;
|
||||
|
||||
private List<UI_FacilityIcon> facilityIcons = new();
|
||||
private List<UI_SensorIcon> sensorIcons = new();
|
||||
|
||||
OrbitalController controller;
|
||||
DataManager dataManager;
|
||||
|
||||
@@ -38,40 +41,59 @@ namespace KEPCO.Managements
|
||||
internal bool alramVisibliity;
|
||||
|
||||
public override async UniTask Init()
|
||||
{
|
||||
KEPCOSceneMain.Instance.Initialized += InitIcon;
|
||||
await UniTask.CompletedTask;
|
||||
}
|
||||
public void InitIcon()
|
||||
{
|
||||
controller = OctopusTwinAppMain.Instance.cameraController;
|
||||
dataManager = KEPCOSceneMain.Instance.GetManager<DataManager>();
|
||||
|
||||
foreach(var facility in dataManager.facilityManager.facilities)
|
||||
ClearIcon();
|
||||
|
||||
foreach (var facility in dataManager.facilityManager.facilities)
|
||||
{
|
||||
var icon = CreateFacilityIcon();
|
||||
var icon = CreateFacilityIcon(facility.data);
|
||||
icon.Init(facility);
|
||||
//icon.UI_FacilityInfo = facilityInfo;
|
||||
}
|
||||
|
||||
|
||||
foreach (var sensor in dataManager.sensorManager.sensors)
|
||||
{
|
||||
var icon = CreateScreenSpaceSensorIcon();
|
||||
var icon = CreateScreenSpaceSensorIcon(sensor.data);
|
||||
var sensorData = dataManager.sensorManager.sensorDataList[sensor];
|
||||
sensor.SetData(sensorData, icon);
|
||||
}
|
||||
}
|
||||
private void ClearIcon()
|
||||
{
|
||||
foreach (var facilityIcon in facilityIcons)
|
||||
{
|
||||
Destroy(facilityIcon.gameObject);
|
||||
}
|
||||
facilityIcons.Clear();
|
||||
|
||||
await UniTask.CompletedTask;
|
||||
foreach (var sensorIcon in sensorIcons)
|
||||
{
|
||||
Destroy(sensorIcon.gameObject);
|
||||
}
|
||||
sensorIcons.Clear();
|
||||
}
|
||||
|
||||
private UI_FacilityIcon CreateFacilityIcon()
|
||||
private UI_FacilityIcon CreateFacilityIcon(JsonFacilityData data)
|
||||
{
|
||||
var icon = GameObject.Instantiate(facilityIcon);
|
||||
icon.transform.SetParent(transform, false);
|
||||
facilityIcons.Add(icon);
|
||||
return icon;
|
||||
}
|
||||
|
||||
|
||||
UI_SensorIcon CreateScreenSpaceSensorIcon()
|
||||
UI_SensorIcon CreateScreenSpaceSensorIcon(JsonSensorData data)
|
||||
{
|
||||
var icon = GameObject.Instantiate(sensorIcon);
|
||||
icon.transform.SetParent(transform, false);
|
||||
sensorIcons.Add(icon);
|
||||
return icon;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,12 +7,13 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UVC.Management;
|
||||
|
||||
namespace KEPCO.Managements
|
||||
{
|
||||
[Serializable]
|
||||
public class SensorManager : Manager
|
||||
public class SensorManager
|
||||
{
|
||||
public List<Sensor> sensors = new List<Sensor>();
|
||||
|
||||
@@ -24,9 +25,16 @@ namespace KEPCO.Managements
|
||||
public Dictionary<string, JsonSensorData> jsonSensorCode = new();
|
||||
public Dictionary<Sensor, JsonSensorData> sensorDataList = new();
|
||||
|
||||
public override async UniTask Init()
|
||||
|
||||
public void InitSensor(Tag_Machine[] parent)
|
||||
{
|
||||
jsonSensorName.Clear();
|
||||
jsonSensorCode.Clear();
|
||||
sensorDataList.Clear();
|
||||
nameToSensor.Clear();
|
||||
codeToSensor.Clear();
|
||||
typeToSensor.Clear();
|
||||
sensors.Clear();
|
||||
|
||||
var json = ReadJsonSensorData();
|
||||
|
||||
@@ -37,9 +45,8 @@ namespace KEPCO.Managements
|
||||
|
||||
jsonSensorCode.TryAdd(code, j);
|
||||
}
|
||||
var machineParents = FindObjectsByType<Tag_Machine>(FindObjectsSortMode.None);
|
||||
|
||||
foreach (var m in machineParents)
|
||||
foreach (var m in parent)
|
||||
{
|
||||
var childTransforms = m.GetComponentsInChildren<Transform>();
|
||||
foreach (var c in childTransforms)
|
||||
@@ -87,7 +94,7 @@ namespace KEPCO.Managements
|
||||
sensorDataList.TryAdd(sensor, sensorData);
|
||||
}
|
||||
}
|
||||
await UniTask.CompletedTask;
|
||||
//await UniTask.CompletedTask;
|
||||
}
|
||||
public JsonSensorData[] ReadJsonSensorData()
|
||||
{
|
||||
|
||||
@@ -10,14 +10,6 @@ namespace KEPCO.Object
|
||||
{
|
||||
public class Building : MonoBehaviour
|
||||
{
|
||||
// Facility
|
||||
public List<Facility> GetMachines() { return facilityList; }
|
||||
public List<Facility> facilityList = new List<Facility>();
|
||||
|
||||
// Sensor
|
||||
public List<Sensor> GetThermostats() { return sensortList; }
|
||||
public List<Sensor> sensortList = new List<Sensor>();
|
||||
|
||||
// Floor
|
||||
public Floor GetCurFloor() { return floorList[curFloorIndex]; }
|
||||
private List<Floor> floorList = new List<Floor>();
|
||||
@@ -25,28 +17,12 @@ namespace KEPCO.Object
|
||||
|
||||
public async UniTask Init()
|
||||
{
|
||||
facilityList.Clear();
|
||||
floorList.Clear();
|
||||
sensortList.Clear();
|
||||
|
||||
var facilities = GetComponentsInChildren<Facility>();
|
||||
for (int i = 0; i < facilities.Length; i++)
|
||||
{
|
||||
await facilities[i].Init();
|
||||
facilityList.Add(facilities[i]);
|
||||
}
|
||||
|
||||
var sensors = GetComponentsInChildren<Sensor>();
|
||||
for (int i = 0; i < sensors.Length; i++)
|
||||
{
|
||||
await sensors[i].Init();
|
||||
sensortList.Add(sensors[i]);
|
||||
}
|
||||
|
||||
var floor = GetComponentsInChildren<Floor>();
|
||||
for (int i = 0; i < floor.Length; i++)
|
||||
{
|
||||
await floor[i].Init();
|
||||
floor[i].Init();
|
||||
floorList.Add(floor[i]);
|
||||
}
|
||||
var topFloorIndex = floorList.Count - 1;
|
||||
|
||||
@@ -24,12 +24,10 @@ namespace KEPCO.Object
|
||||
public Vector3 centerPos;
|
||||
public Vector3 originScale;
|
||||
|
||||
public async UniTask Init()
|
||||
public void Init()
|
||||
{
|
||||
centerPos = transform.GetMeshCenter();
|
||||
originScale = gameObject.transform.localScale;
|
||||
|
||||
await UniTask.CompletedTask;
|
||||
}
|
||||
|
||||
public void OnPointerClick(PointerEventData eventData)
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace KEPCO.Object
|
||||
public Transform startPoint;
|
||||
public GameObject Site;
|
||||
|
||||
public async UniTask Init()
|
||||
public void Init()
|
||||
{
|
||||
if (startPoint == null)
|
||||
{
|
||||
@@ -23,7 +23,6 @@ namespace KEPCO.Object
|
||||
|
||||
startPoint.transform.position = transform.GetMeshCenter();
|
||||
}
|
||||
await UniTask.CompletedTask;
|
||||
}
|
||||
public void SetGISActive(bool isOn)
|
||||
{
|
||||
|
||||
@@ -11,9 +11,9 @@ namespace KEPCO.Object
|
||||
{
|
||||
public class Sensor : MonoBehaviour
|
||||
{
|
||||
public async UniTask Init()
|
||||
public void Init()
|
||||
{
|
||||
await UniTask.CompletedTask;
|
||||
|
||||
}
|
||||
|
||||
public Floor _floor;
|
||||
|
||||
@@ -30,16 +30,15 @@ namespace KEPCO.UI
|
||||
ScrollView_FacilityList = GetElement<ScrollRect>(nameof(ScrollView_FacilityList));
|
||||
Button_Close = GetElement<Button>(nameof(Button_Close));
|
||||
|
||||
SetSensorScrollView();
|
||||
SetFacilityScrollView();
|
||||
Toggle_Sensor.onValueChanged.AddListener(OnValueChanged_Sensor);
|
||||
Toggle_Facility.onValueChanged.AddListener(OnValueChanged_Facility);
|
||||
scrollRects = GetComponentsInChildren<ScrollRect>();
|
||||
ScrollView_SensorList.gameObject.SetActive(false);
|
||||
Button_Close.onClick.AddListener(OnClickEvent_Close);
|
||||
ToggleAllSensor(false);
|
||||
gameObject.SetActive(false);
|
||||
|
||||
KEPCOSceneMain.Instance.Initialized += SetScrollView;
|
||||
|
||||
await UniTask.CompletedTask;
|
||||
}
|
||||
|
||||
@@ -48,15 +47,28 @@ namespace KEPCO.UI
|
||||
sensorTypeToggles[SensorType.ALL].toggle.isOn = visibility;
|
||||
}
|
||||
|
||||
public void ToggleSensor(SensorType st, bool visibility)
|
||||
public void SetScrollView()
|
||||
{
|
||||
sensorTypeToggles[st].toggle.isOn = visibility;
|
||||
}
|
||||
ClearScrollView();
|
||||
|
||||
public bool GetSensorTypeToggleValue(SensorType targetType)
|
||||
SetSensorScrollView();
|
||||
SetFacilityScrollView();
|
||||
|
||||
ToggleAllSensor(true);
|
||||
}
|
||||
private void ClearScrollView()
|
||||
{
|
||||
var targetTypeCheck = sensorTypeToggles[targetType].toggle.isOn;
|
||||
return targetTypeCheck;
|
||||
foreach(var sensorTypeToggle in sensorTypeToggles.Values)
|
||||
{
|
||||
Destroy(sensorTypeToggle.gameObject);
|
||||
}
|
||||
sensorTypeToggles.Clear();
|
||||
|
||||
foreach (var facilityToggle in facilityToggles)
|
||||
{
|
||||
Destroy(facilityToggle.gameObject);
|
||||
}
|
||||
facilityToggles.Clear();
|
||||
}
|
||||
|
||||
private void SetSensorScrollView()
|
||||
@@ -111,7 +123,6 @@ namespace KEPCO.UI
|
||||
foreach (var t in facilityToggles)
|
||||
t.toggle.isOn = value;
|
||||
};
|
||||
|
||||
facilityToggles.Add(all);
|
||||
|
||||
foreach (var f in facilities)
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1d263a473629d1344898151a27f5f8ea
|
||||
guid: 1d263a473629d1344898151a27f5f8ea
|
||||
@@ -17,7 +17,7 @@ namespace KEPCO.UI
|
||||
private RectTransform Content;
|
||||
private Button Button_Close;
|
||||
|
||||
private Panel_Effect panel_effect;
|
||||
private Panel_Effect effect;
|
||||
|
||||
public TextMeshProUGUI CurrentDate;
|
||||
public TextMeshProUGUI CurrentTime;
|
||||
@@ -41,7 +41,7 @@ namespace KEPCO.UI
|
||||
MTRAttribute = GetElement<RectTransform>(nameof(MTRAttribute));
|
||||
GISAttribute = GetElement<RectTransform>(nameof(GISAttribute));
|
||||
|
||||
panel_effect = FindAnyObjectByType<Panel_Effect>(FindObjectsInactive.Include);
|
||||
effect = FindAnyObjectByType<Panel_Effect>(FindObjectsInactive.Include);
|
||||
|
||||
Button_Close.onClick.AddListener(Close);
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace KEPCO.UI
|
||||
public override void Open()
|
||||
{
|
||||
gameObject.SetActive(true);
|
||||
panel_effect.ActivePanel();
|
||||
effect.ActivePanel();
|
||||
gameObject.transform.SetAsLastSibling();
|
||||
|
||||
if (facilitiesContents.Count <= 0)
|
||||
@@ -70,7 +70,7 @@ namespace KEPCO.UI
|
||||
public override void Close()
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
panel_effect.DeactivePanel();
|
||||
effect.DeactivePanel();
|
||||
ResetStatusContentOrder();
|
||||
isChangedData = false;
|
||||
}
|
||||
|
||||
@@ -23,11 +23,6 @@ namespace ChunilENG.UI
|
||||
await UniTask.CompletedTask;
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
SetModel();
|
||||
}
|
||||
|
||||
private void SetModel()
|
||||
{
|
||||
var toolbarModel = new ToolbarModel();
|
||||
|
||||
Reference in New Issue
Block a user