2025-02-20 09:59:37 +09:00
|
|
|
|
using System.Collections;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
using WI;
|
|
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
using static MQTT;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
|
|
namespace CHN
|
|
|
|
|
|
{
|
2025-03-12 12:04:19 +09:00
|
|
|
|
public class Panel_CompleteAlramHistory : PanelBase, ISingle
|
2025-02-20 09:59:37 +09:00
|
|
|
|
{
|
|
|
|
|
|
public UI_CompleteTimeAlarmInfo prefab_completeTimeAlarmInfo;
|
|
|
|
|
|
public ScrollRect ScrollView_CompleteAlramHistory;
|
|
|
|
|
|
|
|
|
|
|
|
public Dictionary<string, UI_CompleteTimeAlarmInfo> completeInfoList = new();
|
|
|
|
|
|
public List<UI_CompleteTimeAlarmInfo> notCheckAlramList = new();
|
2025-03-12 12:04:19 +09:00
|
|
|
|
//public Action<int> onCheckAlarm;
|
2025-02-20 09:59:37 +09:00
|
|
|
|
public Action<CompleteInfo, bool> onCheckAlarmData;
|
2025-03-12 12:04:19 +09:00
|
|
|
|
public Action<string> onClose;
|
2025-02-20 09:59:37 +09:00
|
|
|
|
|
|
|
|
|
|
public override void AfterAwake()
|
|
|
|
|
|
{
|
2025-02-24 18:48:14 +09:00
|
|
|
|
prefab_completeTimeAlarmInfo = Resources.Load<UI_CompleteTimeAlarmInfo>("Prefabs/UI/PRF_UI_CompleteTimeAlramInfo");
|
2025-02-20 09:59:37 +09:00
|
|
|
|
notCheckAlramList.Clear();
|
|
|
|
|
|
completeInfoList.Clear();
|
|
|
|
|
|
SetActive(false);
|
|
|
|
|
|
}
|
|
|
|
|
|
public void Open()
|
|
|
|
|
|
{
|
|
|
|
|
|
SetActive(true);
|
|
|
|
|
|
}
|
|
|
|
|
|
public void Close()
|
|
|
|
|
|
{
|
2025-03-12 12:04:19 +09:00
|
|
|
|
onClose?.Invoke("<22>Ϸ<EFBFBD> <20>ð<EFBFBD> <20>˶<EFBFBD>");
|
2025-02-20 09:59:37 +09:00
|
|
|
|
}
|
|
|
|
|
|
public void SetAlarmInfoItems(List<CompleteTimeAlarmData> infos)
|
|
|
|
|
|
{
|
|
|
|
|
|
for (int i = 0; i < infos.Count; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (completeInfoList.ContainsKey(infos[i].completeInfo.worknm))
|
|
|
|
|
|
{
|
|
|
|
|
|
completeInfoList[infos[i].completeInfo.worknm].SetInfo(infos[i].completeInfo);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
var infoItem = Instantiate(prefab_completeTimeAlarmInfo, ScrollView_CompleteAlramHistory.content);
|
|
|
|
|
|
infoItem.SetInfo(infos[i].completeInfo);
|
|
|
|
|
|
infoItem.onCheck += CheckAlram;
|
|
|
|
|
|
infoItem.isCheck = infos[i].isCheck;
|
|
|
|
|
|
|
|
|
|
|
|
completeInfoList.Add(infos[i].completeInfo.worknm, infoItem);
|
|
|
|
|
|
|
2025-03-12 12:04:19 +09:00
|
|
|
|
//if (!infoItem.isCheck)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// notCheckAlramList.Add(infoItem);
|
|
|
|
|
|
//}
|
2025-02-20 09:59:37 +09:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-03-12 12:04:19 +09:00
|
|
|
|
//BlinkAlarmItems();
|
2025-02-20 09:59:37 +09:00
|
|
|
|
}
|
2025-03-12 12:04:19 +09:00
|
|
|
|
//private void BlinkAlarmItems()
|
|
|
|
|
|
//{
|
|
|
|
|
|
// onCheckAlarm?.Invoke(notCheckAlramList.Count);
|
|
|
|
|
|
//}
|
2025-02-20 09:59:37 +09:00
|
|
|
|
private void CheckAlram(UI_CompleteTimeAlarmInfo completeTimeAlarmInfo)
|
|
|
|
|
|
{
|
|
|
|
|
|
onCheckAlarmData?.Invoke(completeTimeAlarmInfo.completeInfo, completeTimeAlarmInfo.isCheck);
|
2025-03-12 12:04:19 +09:00
|
|
|
|
//notCheckAlramList.Remove(completeTimeAlarmInfo);
|
|
|
|
|
|
//onCheckAlarm?.Invoke(notCheckAlramList.Count);
|
2025-02-20 09:59:37 +09:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|