You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.1 KiB
C++

// EMS.h: interface for the CEMS class.
//
//////////////////////////////////////////////////////////////////////
#pragma once
#include "RunTask.h"
#include "Input.h"
#include "Output.h"
#include "commondef.h"
class CEMS : public CRunTask
{
public:
CEMS();
virtual ~CEMS();
bool CanMachineRun();
bool IsEMSEnable() const;
void UpdateMachineStart();
void UpdateMachineStop();
void UpdateUnitCount();
void InitParameters();
UINT RunThread() override;
void SetEMSOutput(int nNo, COutput* copOutput);
void SetEMSInput(int nNo, CInput* cipInput);
void SetGuiWindow(HWND hwnd);
private:
void CheckHostAllowMachineToRun();
void CheckMachineStatus();
void CheckUnitCountUpdate();
void GetMainApp();
CEvt m_evtSendUnitPulse;
CEvt m_evtMachineStop;
CEvt m_evtMachineStart;
HWND m_hwndMainApp{ nullptr };
CInput* m_cipEMSStatus{ nullptr };
COutput* m_copEMSCount{ nullptr };
bool m_bEMSEnable{ false };
bool m_bMsgSendOn{ false };
bool m_bMsgSendOff{ false };
int m_iEmsPulse{ 0 };
};