配置功能修改
This commit is contained in:
parent
5c3120aca6
commit
94e5ecedef
@ -9285,7 +9285,7 @@ void HBD1000::DrawPowderCtrl(bool *winShow)
|
||||
tabs.push_back(_(u8"供粉轴"));
|
||||
tabs.push_back(_(u8"铺粉"));
|
||||
tabs.push_back(_(u8"控制"));
|
||||
int tabwidth = 0;
|
||||
float tabwidth = 0;
|
||||
for (size_t tindex = 0; tindex<tabs.size(); tindex++) {
|
||||
tabwidth= tabwidth+ImGui::CalcTextSize(tabs[tindex].c_str(), 0).x+15;
|
||||
}
|
||||
@ -10221,6 +10221,8 @@ void HBD1000::DrawPowderCtrl(bool *winShow)
|
||||
// ImGui::OpenPopup(u8"移载载入");
|
||||
//}
|
||||
|
||||
MACHINEPARAM mp;
|
||||
GetMachineParam(mp);
|
||||
if (ImGui::BeginPopupModal(_(u8"移载载入").c_str(), NULL, ImGuiWindowFlags_AlwaysAutoResize)) {
|
||||
if (GetLoadInProcStep() == In_Start) {
|
||||
ImGui::Text(_(u8"移载开始载入").c_str());
|
||||
@ -10241,22 +10243,23 @@ void HBD1000::DrawPowderCtrl(bool *winShow)
|
||||
ImGui::Text(_(u8"缸体打印位装载运行中").c_str());
|
||||
}
|
||||
|
||||
if (GetLoadInResult()== In_Intercept) {
|
||||
ImGui::TextColored(Toast::COLOR_ORANGE, GetLoadInfo().c_str());
|
||||
|
||||
if (mp.m_LoadInResut == In_Intercept) {
|
||||
ImGui::TextColored(Toast::COLOR_ORANGE, mp.m_LoadInfo.c_str());
|
||||
if (ImGui::Button(_(u8"确定").c_str(), ImVec2(-1, 0)))
|
||||
{
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
}
|
||||
else if (GetLoadInResult()== In_Success) {
|
||||
ImGui::TextColored(Toast::COLOR_GREEN, GetLoadInfo().c_str());
|
||||
else if (mp.m_LoadInResut == In_Success) {
|
||||
ImGui::TextColored(Toast::COLOR_GREEN, mp.m_LoadInfo.c_str());
|
||||
if (ImGui::Button(_(u8"确定").c_str(), ImVec2(-1, 0)))
|
||||
{
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
}
|
||||
else if (GetLoadInResult()> In_Success) {
|
||||
ImGui::TextColored(Toast::COLOR_RED, GetLoadInfo().c_str());
|
||||
else if (mp.m_LoadInResut > In_Success) {
|
||||
ImGui::TextColored(Toast::COLOR_RED, mp.m_LoadInfo.c_str());
|
||||
if (ImGui::Button(_(u8"确定").c_str(), ImVec2(-1, 0)))
|
||||
{
|
||||
ImGui::CloseCurrentPopup();
|
||||
@ -10300,29 +10303,29 @@ void HBD1000::DrawPowderCtrl(bool *winShow)
|
||||
ImGui::Text(_(u8"缸体与清粉箱连接中").c_str());
|
||||
}
|
||||
|
||||
if (IsWaitConnectBoxCommit()) {
|
||||
if (mp.m_WaitConnectBoxCommit) {
|
||||
if (ImGui::Button(_(u8"执行缸体与清粉箱连接").c_str()))
|
||||
{
|
||||
SetWaitConnectBoxCommit(false);
|
||||
}
|
||||
}
|
||||
|
||||
if (GetLoadOutResult() == Out_Intercept) {
|
||||
ImGui::TextColored(Toast::COLOR_ORANGE, GetLoadInfo().c_str());
|
||||
if (mp.m_LoadOutResut == Out_Intercept) {
|
||||
ImGui::TextColored(Toast::COLOR_ORANGE, mp.m_LoadInfo.c_str());
|
||||
if (ImGui::Button(_(u8"确定").c_str(), ImVec2(-1, 0)))
|
||||
{
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
}
|
||||
else if (GetLoadOutResult() == Out_Success) {
|
||||
ImGui::TextColored(Toast::COLOR_GREEN, GetLoadInfo().c_str());
|
||||
else if (mp.m_LoadOutResut == Out_Success) {
|
||||
ImGui::TextColored(Toast::COLOR_GREEN, mp.m_LoadInfo.c_str());
|
||||
if (ImGui::Button(_(u8"确定").c_str(), ImVec2(-1, 0)))
|
||||
{
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
}
|
||||
else if (GetLoadOutResult() > Out_Success) {
|
||||
ImGui::TextColored(Toast::COLOR_RED, GetLoadInfo().c_str());
|
||||
else if (mp.m_LoadOutResut > Out_Success) {
|
||||
ImGui::TextColored(Toast::COLOR_RED, mp.m_LoadInfo.c_str());
|
||||
if (ImGui::Button(_(u8"确定").c_str(), ImVec2(-1, 0)))
|
||||
{
|
||||
ImGui::CloseCurrentPopup();
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -84,7 +84,7 @@ public:
|
||||
void InitSysParam(SysParamWrapper* spw, void* cc);
|
||||
//void InitPLCCommand(vector<S7Command*>& vecs);
|
||||
void GetAlarmState(SignalState& signalState);
|
||||
//bool CheckPrintMoldReady();
|
||||
bool CheckPrintMoldReady();
|
||||
|
||||
virtual void CheckIO();
|
||||
private:
|
||||
|
@ -233,6 +233,9 @@ void Machine::Update(const ReadData& rd) {
|
||||
else if (it->nameKey == "WaitConnectBoxCommit") {
|
||||
m_WaitConnectBoxCommit = (bool)stoi(it->strValue);
|
||||
}
|
||||
else if (it->nameKey == "NeedWaitSelectOutPos") {
|
||||
m_NeedWaitSelectOutPos = (bool)stoi(it->strValue);
|
||||
}
|
||||
else {
|
||||
printf("error, key %s do not find...", it->nameKey.c_str());
|
||||
}
|
||||
|
@ -9,6 +9,20 @@
|
||||
#include "../UI/UIBean.h"
|
||||
#include "../config/bean/ExtCfg.h"
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
class Machine {
|
||||
public:
|
||||
Machine(MachineTypeCfg::MachineTypeId type);
|
||||
@ -45,13 +59,13 @@ protected:
|
||||
LeaveCriticalSection(&m_LoadCS);
|
||||
return rel;
|
||||
}
|
||||
int GetLoadOutResult() {
|
||||
int rel = 0;
|
||||
EnterCriticalSection(&m_LoadCS);
|
||||
rel = m_LoadOutResut;
|
||||
LeaveCriticalSection(&m_LoadCS);
|
||||
return rel;
|
||||
}
|
||||
//int GetLoadOutResult() {
|
||||
// int rel = 0;
|
||||
// EnterCriticalSection(&m_LoadCS);
|
||||
// rel = m_LoadOutResut;
|
||||
// LeaveCriticalSection(&m_LoadCS);
|
||||
// return rel;
|
||||
//}
|
||||
|
||||
int GetLoadInProcStep() {
|
||||
int rel = 0;
|
||||
@ -69,21 +83,21 @@ protected:
|
||||
return rel;
|
||||
}
|
||||
|
||||
string GetLoadInfo() {
|
||||
string rel = "";
|
||||
EnterCriticalSection(&m_LoadCS);
|
||||
rel = m_LoadInfo;
|
||||
LeaveCriticalSection(&m_LoadCS);
|
||||
return rel;
|
||||
}
|
||||
//string GetLoadInfo() {
|
||||
// string rel = "";
|
||||
// EnterCriticalSection(&m_LoadCS);
|
||||
// rel = m_LoadInfo;
|
||||
// LeaveCriticalSection(&m_LoadCS);
|
||||
// return rel;
|
||||
//}
|
||||
|
||||
bool IsWaitConnectBoxCommit() {
|
||||
bool rel = false;
|
||||
EnterCriticalSection(&m_LoadCS);
|
||||
rel = m_WaitConnectBoxCommit;
|
||||
LeaveCriticalSection(&m_LoadCS);
|
||||
return rel;
|
||||
}
|
||||
//bool IsWaitConnectBoxCommit() {
|
||||
// bool rel = false;
|
||||
// EnterCriticalSection(&m_LoadCS);
|
||||
// rel = m_WaitConnectBoxCommit;
|
||||
// LeaveCriticalSection(&m_LoadCS);
|
||||
// return rel;
|
||||
//}
|
||||
|
||||
void SetWaitConnectBoxCommit(bool commit);
|
||||
|
||||
@ -103,6 +117,39 @@ protected:
|
||||
return rel;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
//}
|
||||
|
||||
protected:
|
||||
MachineTypeCfg::MachineTypeId m_Type;
|
||||
SysParamWrapper* m_SysParamWrapper;
|
||||
@ -134,11 +181,12 @@ protected:
|
||||
int m_LoadOutProcStep;
|
||||
bool m_isLoadIn; //是否载入
|
||||
bool m_isLoadOut; //是否载出
|
||||
|
||||
bool m_WaitConnectBoxCommit;
|
||||
bool m_NeedWaitSelectOutPos;
|
||||
bool m_WaitSelectOutPosCommit;
|
||||
int m_SelectOutPos;
|
||||
|
||||
CRITICAL_SECTION m_LoadCS;
|
||||
|
||||
|
||||
|
||||
};
|
@ -5,6 +5,26 @@
|
||||
#include "../DataManage/DataHandle.h"
|
||||
|
||||
AxisState::AxisState()
|
||||
: m_ServoOn(new BoolData("ServoOn", u8"轴伺服ON_RW"))
|
||||
, m_ServoHomeIndexOn(new BoolData("ServoHomeIndexOn", u8"轴伺服成立原点_RW"))
|
||||
, m_ServoReset(new BoolData("ServoReset", u8"轴伺服复位_RW"))
|
||||
, m_MoveP(new BoolData("MoveP", u8"轴相对左运动_手动_RW"))
|
||||
, m_MoveN(new BoolData("MoveN", u8"轴相对右运动_手动_RW"))
|
||||
, m_MovePContinue(new BoolData("MovePContinue", u8"轴左JOG_手动_RW"))
|
||||
, m_MoveNContinue(new BoolData("MoveNContinue", u8"轴右JOG_手动_RW"))
|
||||
, m_MoveAbsPos(new BoolData("MoveAbsPos", u8"轴绝对值运动_手动_RW"))
|
||||
, m_MotionStop(new BoolData("MotionStop", u8"轴急停_RW"))
|
||||
, m_ServoRDY(new BoolData("ServoRDY", u8"轴伺服RDY状态_R"))
|
||||
, m_ServoHomeDone(new BoolData("ServoHomeDone", u8"轴指令运行HOME_Done_R"))
|
||||
, m_ResetDone(new BoolData("ResetDone", u8"轴指令运行RESET_Done_R"))
|
||||
, m_ServoBusy(new BoolData("ServoBusy", u8"轴伺服BUSY_R"))
|
||||
, m_ServoException(new BoolData("ServoException", u8"轴伺服异常_R"))
|
||||
, m_Runable(new BoolData("Runable", u8"轴可运行状态_R"))
|
||||
, m_ExceptionCode(new ShortData("ExceptionCode", u8"轴伺服异常字_R"))
|
||||
, m_Pos(new FloatData("Pos", u8"当前位置"))
|
||||
, m_Torque(new FloatData("Torque", u8"当前扭矩"))
|
||||
, m_ShowPos(new FloatData("ShowPos"))
|
||||
, m_RPos(new FloatData("RPos"))
|
||||
{
|
||||
size_t ptrSize = sizeof(nullptr); //指针大小
|
||||
void* startPtr = &m_startFlag + 1;
|
||||
@ -41,6 +61,9 @@ void AxisState::GetValue(AxisStateValue& value)
|
||||
value.Pos = m_Pos->GetValue();
|
||||
value.Torque = m_Torque->GetValue();
|
||||
value.ServoBusy = m_ServoBusy->GetValue();
|
||||
value.ShowPos = m_ShowPos->GetValue();
|
||||
value.RPos = m_RPos->GetValue();
|
||||
|
||||
}
|
||||
|
||||
//void AxisState::Update(unsigned char* addr)
|
||||
|
@ -79,6 +79,8 @@ public:
|
||||
FloatData* m_Torque; //当前扭矩
|
||||
FloatData* m_ShowPos;
|
||||
FloatData* m_RPos;
|
||||
|
||||
|
||||
char m_endFlag; //结束标志
|
||||
|
||||
std::shared_mutex mtx;
|
||||
|
@ -25,7 +25,7 @@ Controller::~Controller() {
|
||||
DELP(m_SysParamWrapper);
|
||||
DELP(m_AxisRecordWrapper);
|
||||
DELP(m_SignalStateWrapper);
|
||||
DELP(m_Machine);
|
||||
//DELP(m_Machine);
|
||||
DELP(m_MachineCfg);
|
||||
|
||||
SysParam::SFini();
|
||||
|
@ -296,7 +296,7 @@ void UIWin::Draw() {
|
||||
SetupDockSpace();
|
||||
DrawTitleBar();
|
||||
DrawToolBar();
|
||||
|
||||
DrawPowder();
|
||||
DrawMain();
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,6 @@ private:
|
||||
IOCfgWrapper* m_IOCfgWrapper;
|
||||
MachineCfg* m_MachineCfg;
|
||||
RunCfg m_RunCfg;
|
||||
//ExtCfg m_ExtCfg;
|
||||
AlarmCfgWrapper* m_AlarmCfgWrapper;
|
||||
|
||||
ParamLimitCfgNew m_ParamLimitCfg;
|
||||
|
@ -14,6 +14,7 @@ using namespace std;
|
||||
#define GTS_AXIS_ID_CLEAN 5
|
||||
#define GTS_AXIS_ID_ELE 6
|
||||
|
||||
#pragma pack(1)
|
||||
class AxisCfg : public Base
|
||||
{
|
||||
public:
|
||||
@ -70,4 +71,5 @@ public:
|
||||
BoolData* m_SafeLimit;
|
||||
char m_endFlag;
|
||||
};
|
||||
#pragma pack()
|
||||
|
||||
|
@ -155,6 +155,7 @@ public:
|
||||
};
|
||||
|
||||
|
||||
#pragma pack(1)
|
||||
class ParamLimitCfgNew :public Base {
|
||||
public:
|
||||
ParamLimitCfgNew();
|
||||
@ -227,4 +228,5 @@ private:
|
||||
FloatData* m_CoverDistanceMax;
|
||||
char m_endFlag;
|
||||
|
||||
};
|
||||
};
|
||||
#pragma pack()
|
Binary file not shown.
@ -14166,11 +14166,12 @@ void HBD1000::LoadOutRun()
|
||||
return;
|
||||
}
|
||||
if (m_SignalStateWrapper->m_CylinderState->GetValue() == CylinderInCleanInsidePlatformUnConnectBox) {
|
||||
m_WaitConnectBoxCommit->SetValue(true);
|
||||
while (m_LoadCtrlFlag && m_WaitConnectBoxCommit->GetValue()) {
|
||||
SetWaitConnectBoxCommit(true);
|
||||
MACHINEPARAM mp;
|
||||
while (m_LoadCtrlFlag && GetMachineParam(mp) && mp.m_WaitConnectBoxCommit) {
|
||||
Sleep(300);
|
||||
}
|
||||
if (!m_WaitConnectBoxCommit->GetValue())
|
||||
if (!(GetMachineParam(mp) && mp.m_WaitConnectBoxCommit))
|
||||
{
|
||||
SetLoadOutProcStep(Out_CylinderConnectCleanBox);
|
||||
m_SignalStateWrapper->m_CylinderConnectCleanBoxTriger->SetValue(true);
|
||||
|
@ -6692,19 +6692,21 @@ void HBD1200::LoadOutRun()
|
||||
return;
|
||||
}
|
||||
|
||||
m_WaitSelectOutPosCommit = false;
|
||||
SetWaitSelectOutPosCommit(false);
|
||||
|
||||
if (m_RunCfg->m_ShowUnloadHandPos) {
|
||||
m_NeedWaitSelectOutPos = true;
|
||||
while (!m_WaitSelectOutPosCommit && m_LoadCtrlFlag) {
|
||||
SetNeedWaitSelectOutPos(true);
|
||||
MACHINEPARAM mp;
|
||||
while (!(GetMachineParam(mp) && mp.m_WaitSelectOutPosCommit) && m_LoadCtrlFlag) {
|
||||
Sleep(300);
|
||||
}
|
||||
}
|
||||
else {
|
||||
m_SelectOutPos = 0;
|
||||
SetSelectOutPos(0);
|
||||
}
|
||||
|
||||
m_NeedWaitSelectOutPos = false;
|
||||
//m_NeedWaitSelectOutPos->SetValue(false);
|
||||
SetNeedWaitSelectOutPos(false);
|
||||
if (!m_LoadCtrlFlag) {
|
||||
SetLoadOutResult(Out_Intercept, _(u8"载出中断").c_str());
|
||||
return;
|
||||
@ -6762,7 +6764,10 @@ void HBD1200::LoadOutRun()
|
||||
SetLoadOutResult(Out_Intercept, _(u8"载出中断").c_str());
|
||||
return;
|
||||
}
|
||||
if (m_SelectOutPos == 0) {
|
||||
|
||||
MACHINEPARAM mp;
|
||||
GetMachineParam(mp);
|
||||
if (mp.m_SelectOutPos == 0) {
|
||||
|
||||
if (m_SignalStateWrapper->m_CylinderState->GetValue() == CylinderInCleanConnectedBox) {
|
||||
SetLoadOutResult(Out_Success, _(u8"缸体已载出到清粉位").c_str());
|
||||
@ -6825,11 +6830,12 @@ void HBD1200::LoadOutRun()
|
||||
return;
|
||||
}
|
||||
if (m_SignalStateWrapper->m_CylinderState->GetValue() == CylinderInCleanUnConnectBox) {
|
||||
m_WaitConnectBoxCommit->SetValue(true);
|
||||
while (m_LoadCtrlFlag && m_WaitConnectBoxCommit->GetValue()) {
|
||||
SetWaitConnectBoxCommit(true);
|
||||
MACHINEPARAM mp;
|
||||
while (m_LoadCtrlFlag && GetMachineParam(mp) && mp.m_WaitConnectBoxCommit) {
|
||||
Sleep(300);
|
||||
}
|
||||
if (!m_WaitConnectBoxCommit->GetValue())
|
||||
if (!(GetMachineParam(mp) && mp.m_WaitConnectBoxCommit))
|
||||
{
|
||||
SetLoadOutProcStep(Out_CylinderConnectCleanBox);
|
||||
m_SignalStateWrapper->m_CylinderConnectCleanBoxTriger->SetValue(true);
|
||||
@ -6887,7 +6893,7 @@ void HBD1200::LoadOutRun()
|
||||
}
|
||||
SetLoadOutResult(Out_Success, _(u8"缸体载出已完成").c_str());
|
||||
}
|
||||
else if (m_SelectOutPos == 1) {
|
||||
else if (mp.m_SelectOutPos == 1) {
|
||||
|
||||
if (m_SignalStateWrapper->m_CylinderState->GetValue() == CylinderInCleanConnectedBox) {
|
||||
SetLoadOutProcStep(Out_CylinderDisconnectCleanBox);
|
||||
|
@ -29,8 +29,8 @@ Machine::Machine(MachineTypeCfg::MachineTypeId type)
|
||||
, m_WaitConnectBoxCommit(new BoolData("WaitConnectBoxCommit"))
|
||||
, m_isLoadIn(new BoolData("IsLoadIn",u8"是否载入"))
|
||||
, m_isLoadOut(new BoolData("IsLoadOut",u8"是否载出"))
|
||||
, m_NeedWaitSelectOutPos(false)
|
||||
, m_WaitSelectOutPosCommit(false)
|
||||
, m_NeedWaitSelectOutPos(new BoolData("NeedWaitSelectOutPos"))
|
||||
, m_WaitSelectOutPosCommit(new BoolData("WaitSelectOutPosCommit"))
|
||||
{
|
||||
InsertMp(&m_LoadInfo, 1);
|
||||
InsertMp(&m_LoadInProcStep, 1);
|
||||
@ -40,6 +40,9 @@ Machine::Machine(MachineTypeCfg::MachineTypeId type)
|
||||
InsertMp(&m_WaitConnectBoxCommit, 1);
|
||||
InsertMp(&m_isLoadIn, 1);
|
||||
InsertMp(&m_isLoadOut, 1);
|
||||
InsertMp(&m_NeedWaitSelectOutPos, 1);
|
||||
InsertMp(&m_WaitSelectOutPosCommit, 1);
|
||||
InsertMp(&m_SelectOutPos, 1);
|
||||
|
||||
|
||||
m_AlarmEnableMap["CarbinDoorOpen"] = true;
|
||||
@ -382,7 +385,7 @@ void Machine::LoadIn()
|
||||
m_LoadCtrlFlag = true;
|
||||
SetLoadInResult(0, "");
|
||||
m_LoadInThread = AtlCreateThread(LoadInProc, this);
|
||||
m_isLoadIn->SetValue(true);
|
||||
SetIsLoadIn(true);
|
||||
}
|
||||
|
||||
DWORD WINAPI Machine::LoadInProc(Machine* _this)
|
||||
@ -395,7 +398,7 @@ DWORD WINAPI Machine::LoadInProc(Machine* _this)
|
||||
{
|
||||
CloseHandle(_this->m_LoadInThread);
|
||||
_this->m_LoadInThread = INVALID_HANDLE_VALUE;
|
||||
_this->m_isLoadIn->SetValue(false);
|
||||
_this->SetIsLoadIn(false);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@ -407,10 +410,10 @@ void Machine::LoadOut()
|
||||
if (m_LoadOutThread != INVALID_HANDLE_VALUE)return;
|
||||
m_LoadCtrlFlag = true;
|
||||
SetLoadOutResult(0, "");
|
||||
m_WaitConnectBoxCommit->SetValue(false);
|
||||
m_WaitSelectOutPosCommit = false;
|
||||
SetWaitConnectBoxCommit(false);
|
||||
SetWaitSelectOutPosCommit(false);
|
||||
m_LoadOutThread = AtlCreateThread(LoadOutProc, this);
|
||||
m_isLoadOut->SetValue(true);
|
||||
SetIsLoadOut(true);
|
||||
}
|
||||
|
||||
DWORD WINAPI Machine::LoadOutProc(Machine* _this)
|
||||
@ -423,7 +426,7 @@ DWORD WINAPI Machine::LoadOutProc(Machine* _this)
|
||||
{
|
||||
CloseHandle(_this->m_LoadOutThread);
|
||||
_this->m_LoadOutThread = INVALID_HANDLE_VALUE;
|
||||
_this->m_isLoadOut->SetValue(false);
|
||||
_this->SetIsLoadOut(false);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
@ -21,6 +21,20 @@
|
||||
#include "../LanguageManager.h"
|
||||
using namespace std;
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
|
||||
class Machine :public Base {
|
||||
typedef void(*IoVersionCheck)(vector<string>&, IOCfgWrapper*, string str, int type);
|
||||
@ -121,9 +135,6 @@ public:
|
||||
|
||||
//virtual bool CheckPrintMoldReady() = 0;
|
||||
|
||||
bool IsWaitConnectBoxCommit() { return m_WaitConnectBoxCommit->GetValue(); }
|
||||
void SetWaitConnectBoxCommit(bool commit) { m_WaitConnectBoxCommit->SetValue(commit); }
|
||||
|
||||
virtual bool CheckPrintHigh(float jobhigh) {
|
||||
return true;
|
||||
}
|
||||
@ -139,28 +150,14 @@ public:
|
||||
protected:
|
||||
virtual void LoadOutRun() = 0;
|
||||
virtual void LoadInRun() = 0;
|
||||
bool IsLoadIn() { m_isLoadIn->SetValue(m_LoadInThread != INVALID_HANDLE_VALUE); return m_isLoadIn->GetValue(); }
|
||||
bool IsLoadOut() { m_isLoadOut->SetValue(m_LoadOutThread != INVALID_HANDLE_VALUE); return m_isLoadOut->GetValue(); }
|
||||
/*int GetLoadInResult() {
|
||||
int rel = 0;
|
||||
EnterCriticalSection(&m_LoadCS);
|
||||
rel= m_LoadInResut;
|
||||
LeaveCriticalSection(&m_LoadCS);
|
||||
return rel;
|
||||
}
|
||||
int GetLoadOutResult() {
|
||||
int rel = 0;
|
||||
EnterCriticalSection(&m_LoadCS);
|
||||
rel = m_LoadOutResut;
|
||||
LeaveCriticalSection(&m_LoadCS);
|
||||
return rel;
|
||||
}*/
|
||||
|
||||
void SetLoadInResult(int res,string info) {
|
||||
EnterCriticalSection(&m_LoadCS);
|
||||
m_LoadInResut->SetValue( res);
|
||||
m_LoadInfo ->SetValue( info);
|
||||
LeaveCriticalSection(&m_LoadCS);
|
||||
}
|
||||
|
||||
void SetLoadOutResult(int res,string info) {
|
||||
EnterCriticalSection(&m_LoadCS);
|
||||
m_LoadOutResut->SetValue(res);
|
||||
@ -168,21 +165,24 @@ protected:
|
||||
LeaveCriticalSection(&m_LoadCS);
|
||||
}
|
||||
|
||||
//int GetLoadInProcStep() {
|
||||
// int rel = 0;
|
||||
// EnterCriticalSection(&m_LoadCS);
|
||||
// rel = m_LoadInProcStep->GetValue();
|
||||
// LeaveCriticalSection(&m_LoadCS);
|
||||
// return rel;
|
||||
//}
|
||||
bool GetMachineParam(MACHINEPARAM& mp) {
|
||||
EnterCriticalSection(&m_LoadCS);
|
||||
mp.m_LoadInResut = m_LoadInResut->GetValue();
|
||||
mp.m_LoadInfo = m_LoadInfo->GetValueStr();
|
||||
mp.m_LoadOutResut = m_LoadOutResut->GetValue();
|
||||
mp.m_LoadInProcStep = m_LoadInProcStep->GetValue();
|
||||
mp.m_LoadOutProcStep = m_LoadOutProcStep->GetValue();
|
||||
mp.m_isLoadIn = m_isLoadIn->GetValue();
|
||||
mp.m_isLoadOut = m_isLoadOut->GetValue();
|
||||
mp.m_WaitConnectBoxCommit = m_WaitConnectBoxCommit->GetValue();
|
||||
mp.m_NeedWaitSelectOutPos = m_NeedWaitSelectOutPos->GetValue();
|
||||
mp.m_WaitSelectOutPosCommit = m_WaitSelectOutPosCommit->GetValue();
|
||||
mp.m_SelectOutPos = m_SelectOutPos->GetValue();
|
||||
|
||||
LeaveCriticalSection(&m_LoadCS);
|
||||
return true;
|
||||
}
|
||||
|
||||
//int GetLoadOutProcSetp() {
|
||||
// int rel = 0;
|
||||
// EnterCriticalSection(&m_LoadCS);
|
||||
// rel = m_LoadOutProcStep;
|
||||
// LeaveCriticalSection(&m_LoadCS);
|
||||
// return rel;
|
||||
//}
|
||||
|
||||
void SetLoadInProcStep(int res) {
|
||||
EnterCriticalSection(&m_LoadCS);
|
||||
@ -195,13 +195,40 @@ protected:
|
||||
LeaveCriticalSection(&m_LoadCS);
|
||||
}
|
||||
|
||||
//string GetLoadInfo() {
|
||||
// string rel = "";
|
||||
// EnterCriticalSection(&m_LoadCS);
|
||||
// rel = m_LoadInfo;
|
||||
// LeaveCriticalSection(&m_LoadCS);
|
||||
// return rel;
|
||||
//}
|
||||
void SetIsLoadIn(bool res) {
|
||||
EnterCriticalSection(&m_LoadCS);
|
||||
m_isLoadIn->SetValue(res);
|
||||
LeaveCriticalSection(&m_LoadCS);
|
||||
}
|
||||
void SetIsLoadOut(bool res) {
|
||||
EnterCriticalSection(&m_LoadCS);
|
||||
m_isLoadOut->SetValue(res);
|
||||
LeaveCriticalSection(&m_LoadCS);
|
||||
}
|
||||
|
||||
void SetWaitConnectBoxCommit(bool res) {
|
||||
EnterCriticalSection(&m_LoadCS);
|
||||
m_WaitConnectBoxCommit->SetValue(res);
|
||||
LeaveCriticalSection(&m_LoadCS);
|
||||
}
|
||||
|
||||
void SetNeedWaitSelectOutPos(bool res) {
|
||||
EnterCriticalSection(&m_LoadCS);
|
||||
m_NeedWaitSelectOutPos->SetValue(res);
|
||||
LeaveCriticalSection(&m_LoadCS);
|
||||
}
|
||||
|
||||
void SetWaitSelectOutPosCommit(bool res) {
|
||||
EnterCriticalSection(&m_LoadCS);
|
||||
m_WaitSelectOutPosCommit->SetValue(res);
|
||||
LeaveCriticalSection(&m_LoadCS);
|
||||
}
|
||||
|
||||
void SetSelectOutPos(int res) {
|
||||
EnterCriticalSection(&m_LoadCS);
|
||||
m_SelectOutPos->SetValue(res);
|
||||
LeaveCriticalSection(&m_LoadCS);
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
@ -249,16 +276,15 @@ protected:
|
||||
IntData* m_LoadOutResut;
|
||||
IntData* m_LoadInProcStep;
|
||||
IntData* m_LoadOutProcStep;
|
||||
BoolData* m_WaitConnectBoxCommit;
|
||||
BoolData* m_isLoadIn; //绑定m_LoadInThread
|
||||
BoolData* m_isLoadOut; //绑定m_LoadOutThread
|
||||
|
||||
|
||||
bool m_NeedWaitSelectOutPos;
|
||||
bool m_WaitSelectOutPosCommit;
|
||||
int m_SelectOutPos;
|
||||
CRITICAL_SECTION m_LoadCS;
|
||||
BoolData* m_WaitConnectBoxCommit;
|
||||
BoolData* m_NeedWaitSelectOutPos;
|
||||
BoolData* m_WaitSelectOutPosCommit;
|
||||
IntData* m_SelectOutPos;
|
||||
|
||||
|
||||
CRITICAL_SECTION m_LoadCS;
|
||||
vector<string> m_AxisTabs;
|
||||
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user