bit15(M70515) 팝업은 상승엣지 1회라 닫으면 값이 사라져, 현장에서 작업자가 레시피/페이지를 잊는 문제가 있었다. 팝업과 같은 기준·같은 워드를 화면 상단 전폭 띠로 ON 구간 내내 표시한다(Collapsed 시 높이 0이라 평소 화면 영향 없음). 공용(WeldingCommon)은 Status만 읽고 PTOP을 참조하지 않는다 — 값을 넣지 않는 타 설비는 분기문 없이 자동 미표시.
67 lines
2.5 KiB
C#
67 lines
2.5 KiB
C#
using Aurora;
|
|
using Aurora.Api;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows;
|
|
using WeldingCommon.Data;
|
|
|
|
namespace WeldingCommon
|
|
{
|
|
public class Status
|
|
{
|
|
public static IAuroraEnvironment AuroraEnv;
|
|
|
|
public static bool BOOT_COMPLETED = false;
|
|
|
|
public static void Init(IAuroraEnvironment env)
|
|
{
|
|
AuroraEnv = env;
|
|
|
|
|
|
}
|
|
|
|
private static WeldingData ProcessingWeldingData = new WeldingData();
|
|
public static WeldingData GetProcessingWeldingData()
|
|
{
|
|
return ProcessingWeldingData;
|
|
}
|
|
public static eEqpStatus EquipmentStatus { get; private set; }
|
|
public static void SetStatus(eEqpStatus status)
|
|
{
|
|
if (EquipmentStatus == status)
|
|
return;
|
|
|
|
EquipmentStatus = status;
|
|
Application.Current.AuroraEnv().EventPublisher.Publish(new EventMessage("Status", CommonEventIds.EVENT_EQUIPMENT_STATUS_CHANGE, status));
|
|
}
|
|
private static eWorkingPosition WorkingPos { get; set; }
|
|
public static void SetWorkingPosition(eWorkingPosition workingPos)
|
|
{
|
|
if (WorkingPos != workingPos) {
|
|
//Log.D($"WorkingPos : {WorkingPos} -> {workingPos}");
|
|
WorkingPos = workingPos;
|
|
Application.Current.AuroraEnv()?.EventPublisher?.Publish(new EventMessage("", EquipEvent.WORKING_POS_UPDATED));
|
|
}
|
|
}
|
|
public static eWorkingPosition GetWorkingPosition()
|
|
{
|
|
return WorkingPos;
|
|
}
|
|
|
|
public static bool RMSUse { get; set; } = false;
|
|
|
|
#region 260820 PLC 지시 Recipe/Page (원복: 이 region 삭제)
|
|
// 설비별 시퀀스/VM 이 값을 넣고, 공용 Recipe 작업 화면이 읽어서 상단 띠에 표시한다.
|
|
// PTOP: UCMainAutoRunViewModel.OnMonitoring() 에서 bit15(M70515) ON 구간에만 대입, OFF 면 null.
|
|
// 여기에 두는 이유 — 공용 화면이 설비(PTOP)를 참조하지 않게 하려면 의존 방향을 뒤집어야 한다.
|
|
// 값을 넣지 않는 설비는 계속 null 이므로 분기문 없이 자동으로 미표시된다.
|
|
// ※ null = 표시 안 함. 0 은 "PLC 가 0을 줬다"는 유효한 상태라 null 과 구분한다.
|
|
public static short? PlcGuideRecipeNo { get; set; }
|
|
public static short? PlcGuidePageNo { get; set; }
|
|
#endregion
|
|
}
|
|
}
|