2024-04-01 18:26:14 +08:00
|
|
|
|
#pragma once
|
2024-04-09 16:53:02 +08:00
|
|
|
|
#include "../config/bean/IOCfg.h"
|
2024-04-01 18:26:14 +08:00
|
|
|
|
#include "../config/bean/SystemBase.h"
|
|
|
|
|
#include "../plc/SysParam.h"
|
|
|
|
|
#include "../plc/SignalState.h"
|
|
|
|
|
#include "../LanguageManager.h"
|
2024-05-06 10:49:15 +08:00
|
|
|
|
#include "../plc/Axis.h"
|
|
|
|
|
#include "../config/bean/ParamLimitCfg.h"
|
|
|
|
|
#include "../UI/UIBean.h"
|
|
|
|
|
#include "../config/bean/ExtCfg.h"
|
2024-04-09 16:53:02 +08:00
|
|
|
|
|
2024-05-06 17:10:57 +08:00
|
|
|
|
struct MACHINEPARAM{
|
|
|
|
|
int m_LoadInResut;
|
|
|
|
|
string m_LoadInfo;
|
|
|
|
|
int m_LoadOutResut;
|
|
|
|
|
int m_LoadInProcStep;
|
|
|
|
|
int m_LoadOutProcStep;
|
|
|
|
|
bool m_isLoadIn; //绑定m_LoadInThread
|
|
|
|
|
bool m_isLoadOut; //绑定m_LoadOutThread
|
|
|
|
|
bool m_WaitConnectBoxCommit;
|
|
|
|
|
bool m_NeedWaitSelectOutPos;
|
|
|
|
|
bool m_WaitSelectOutPosCommit;
|
|
|
|
|
int m_SelectOutPos;
|
|
|
|
|
};
|
|
|
|
|
|
2024-04-01 18:26:14 +08:00
|
|
|
|
class Machine {
|
|
|
|
|
public:
|
|
|
|
|
Machine(MachineTypeCfg::MachineTypeId type);
|
|
|
|
|
virtual ~Machine();
|
|
|
|
|
static Machine* CreateInstance(int type);
|
|
|
|
|
|
2024-04-09 16:53:02 +08:00
|
|
|
|
//void SetIO (IOCfgWrapper* io){
|
|
|
|
|
// m_IOCfgWrapper = io;
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
void Init();
|
|
|
|
|
|
2024-04-24 18:12:41 +08:00
|
|
|
|
virtual void InitSignal(SignalStateWrapper* ssw, void* cc) = 0;
|
|
|
|
|
virtual void InitSysParam(SysParamWrapper* spw, void* cc) = 0;
|
|
|
|
|
|
2024-05-06 10:49:15 +08:00
|
|
|
|
virtual void DrawPowderCtrl(bool* winShow) = 0;
|
|
|
|
|
|
|
|
|
|
void SetAxisAndSignal(SysParamWrapper* sysParamWrapper, AxisRecordWrapper* axisRecordWrapper, PLCAxis* axis){
|
2024-04-01 18:26:14 +08:00
|
|
|
|
m_SysParamWrapper = sysParamWrapper;
|
|
|
|
|
m_AxisRecordWrapper = axisRecordWrapper;
|
2024-05-06 10:49:15 +08:00
|
|
|
|
m_Axis = axis;
|
2024-04-01 18:26:14 +08:00
|
|
|
|
}
|
|
|
|
|
|
2024-04-09 16:53:02 +08:00
|
|
|
|
virtual void CheckIO() {}
|
|
|
|
|
void DrawIO(bool* isShow);
|
2024-04-01 18:26:14 +08:00
|
|
|
|
virtual void DrawAnalogExt();
|
2024-05-06 10:49:15 +08:00
|
|
|
|
|
|
|
|
|
void Update(const ReadData& rd);
|
|
|
|
|
protected:
|
|
|
|
|
int GetLoadInResult() {
|
|
|
|
|
int rel = 0;
|
|
|
|
|
EnterCriticalSection(&m_LoadCS);
|
|
|
|
|
rel = m_LoadInResut;
|
|
|
|
|
LeaveCriticalSection(&m_LoadCS);
|
|
|
|
|
return rel;
|
|
|
|
|
}
|
2024-05-06 17:10:57 +08:00
|
|
|
|
//int GetLoadOutResult() {
|
|
|
|
|
// int rel = 0;
|
|
|
|
|
// EnterCriticalSection(&m_LoadCS);
|
|
|
|
|
// rel = m_LoadOutResut;
|
|
|
|
|
// LeaveCriticalSection(&m_LoadCS);
|
|
|
|
|
// return rel;
|
|
|
|
|
//}
|
2024-05-06 10:49:15 +08:00
|
|
|
|
|
|
|
|
|
int GetLoadInProcStep() {
|
|
|
|
|
int rel = 0;
|
|
|
|
|
EnterCriticalSection(&m_LoadCS);
|
|
|
|
|
rel = m_LoadInProcStep;
|
|
|
|
|
LeaveCriticalSection(&m_LoadCS);
|
|
|
|
|
return rel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int GetLoadOutProcSetp() {
|
|
|
|
|
int rel = 0;
|
|
|
|
|
EnterCriticalSection(&m_LoadCS);
|
|
|
|
|
rel = m_LoadOutProcStep;
|
|
|
|
|
LeaveCriticalSection(&m_LoadCS);
|
|
|
|
|
return rel;
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-06 17:10:57 +08:00
|
|
|
|
//string GetLoadInfo() {
|
|
|
|
|
// string rel = "";
|
|
|
|
|
// EnterCriticalSection(&m_LoadCS);
|
|
|
|
|
// rel = m_LoadInfo;
|
|
|
|
|
// LeaveCriticalSection(&m_LoadCS);
|
|
|
|
|
// return rel;
|
|
|
|
|
//}
|
2024-05-06 10:49:15 +08:00
|
|
|
|
|
2024-05-06 17:10:57 +08:00
|
|
|
|
//bool IsWaitConnectBoxCommit() {
|
|
|
|
|
// bool rel = false;
|
|
|
|
|
// EnterCriticalSection(&m_LoadCS);
|
|
|
|
|
// rel = m_WaitConnectBoxCommit;
|
|
|
|
|
// LeaveCriticalSection(&m_LoadCS);
|
|
|
|
|
// return rel;
|
|
|
|
|
//}
|
2024-05-06 10:49:15 +08:00
|
|
|
|
|
|
|
|
|
void SetWaitConnectBoxCommit(bool commit);
|
|
|
|
|
|
|
|
|
|
bool IsLoadIn() {
|
|
|
|
|
bool rel = false;
|
|
|
|
|
EnterCriticalSection(&m_LoadCS);
|
|
|
|
|
rel = m_isLoadIn;
|
|
|
|
|
LeaveCriticalSection(&m_LoadCS);
|
|
|
|
|
return rel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool IsLoadOut() {
|
|
|
|
|
bool rel = false;
|
|
|
|
|
EnterCriticalSection(&m_LoadCS);
|
|
|
|
|
rel = m_isLoadOut;
|
|
|
|
|
LeaveCriticalSection(&m_LoadCS);
|
|
|
|
|
return rel;
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-06 17:10:57 +08:00
|
|
|
|
bool GetMachineParam(MACHINEPARAM& mp) {
|
|
|
|
|
EnterCriticalSection(&m_LoadCS);
|
|
|
|
|
mp.m_LoadInResut = m_LoadInResut;
|
|
|
|
|
mp.m_LoadInfo = m_LoadInfo;
|
|
|
|
|
mp.m_LoadOutResut = m_LoadOutResut;
|
|
|
|
|
mp.m_LoadInProcStep = m_LoadInProcStep;
|
|
|
|
|
mp.m_LoadOutProcStep = m_LoadOutProcStep;
|
|
|
|
|
mp.m_isLoadIn = m_isLoadIn;
|
|
|
|
|
mp.m_isLoadOut = m_isLoadOut;
|
|
|
|
|
mp.m_WaitConnectBoxCommit = m_WaitConnectBoxCommit;
|
|
|
|
|
mp.m_NeedWaitSelectOutPos = m_NeedWaitSelectOutPos;
|
|
|
|
|
mp.m_WaitSelectOutPosCommit = m_WaitSelectOutPosCommit;
|
|
|
|
|
mp.m_SelectOutPos = m_SelectOutPos;
|
|
|
|
|
|
|
|
|
|
LeaveCriticalSection(&m_LoadCS);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//bool IsWaitConnectBoxCommit() { return m_WaitConnectBoxCommit; }
|
|
|
|
|
//void SetWaitConnectBoxCommit(bool res) {
|
|
|
|
|
// EnterCriticalSection(&m_LoadCS);
|
|
|
|
|
// m_WaitConnectBoxCommit = commit;
|
|
|
|
|
// LeaveCriticalSection(&m_LoadCS);
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
//void SetNeedWaitSelectOutPos(bool res) {
|
|
|
|
|
// EnterCriticalSection(&m_LoadCS);
|
|
|
|
|
// m_NeedWaitSelectOutPos->SetValue(res);
|
|
|
|
|
// LeaveCriticalSection(&m_LoadCS);
|
|
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
2024-04-01 18:26:14 +08:00
|
|
|
|
protected:
|
2024-04-09 16:53:02 +08:00
|
|
|
|
MachineTypeCfg::MachineTypeId m_Type;
|
2024-04-01 18:26:14 +08:00
|
|
|
|
SysParamWrapper* m_SysParamWrapper;
|
|
|
|
|
AxisRecordWrapper* m_AxisRecordWrapper;
|
|
|
|
|
SignalStateWrapper* m_SignalStateWrapper;
|
|
|
|
|
SignalState m_SignalState;
|
|
|
|
|
|
|
|
|
|
void* m_PLC; //wxxtest
|
2024-05-06 10:49:15 +08:00
|
|
|
|
PLCAxis* m_Axis;
|
2024-04-09 16:53:02 +08:00
|
|
|
|
|
|
|
|
|
//AlarmCfgWrapper* m_AlarmCfgWrapper;
|
|
|
|
|
IOCfgWrapper* m_IOCfgWrapper;
|
|
|
|
|
RunCfg* m_RunCfg;
|
2024-05-06 10:49:15 +08:00
|
|
|
|
ExtCfgNew* m_ExtCfg;
|
|
|
|
|
|
|
|
|
|
PowderAssistBean m_PowderAssist;
|
|
|
|
|
ParamLimitCfgNew* m_ParamLimitCfg;
|
|
|
|
|
|
|
|
|
|
AxisCfg* m_MoldAxisCfg;
|
|
|
|
|
AxisCfg* m_LoadAxisCfg;
|
|
|
|
|
AxisCfg* m_ArmAxisCfg;
|
|
|
|
|
AxisCfg* m_SupplyAxisCfg;
|
|
|
|
|
AxisCfg* m_CleanAxisCfg;
|
|
|
|
|
|
|
|
|
|
int m_LoadInResut;
|
|
|
|
|
string m_LoadInfo;
|
|
|
|
|
int m_LoadOutResut;
|
|
|
|
|
int m_LoadInProcStep;
|
|
|
|
|
int m_LoadOutProcStep;
|
|
|
|
|
bool m_isLoadIn; //是否载入
|
|
|
|
|
bool m_isLoadOut; //是否载出
|
|
|
|
|
bool m_WaitConnectBoxCommit;
|
2024-05-06 17:10:57 +08:00
|
|
|
|
bool m_NeedWaitSelectOutPos;
|
|
|
|
|
bool m_WaitSelectOutPosCommit;
|
|
|
|
|
int m_SelectOutPos;
|
2024-05-06 10:49:15 +08:00
|
|
|
|
|
|
|
|
|
CRITICAL_SECTION m_LoadCS;
|
|
|
|
|
|
|
|
|
|
|
2024-04-01 18:26:14 +08:00
|
|
|
|
};
|