diff --git a/PrintC/Machine/HBD1000.cpp b/PrintC/Machine/HBD1000.cpp index f403d3d..e4afd65 100644 --- a/PrintC/Machine/HBD1000.cpp +++ b/PrintC/Machine/HBD1000.cpp @@ -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 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(); diff --git a/PrintC/Machine/HBD1200.cpp b/PrintC/Machine/HBD1200.cpp index 31251f3..125a992 100644 --- a/PrintC/Machine/HBD1200.cpp +++ b/PrintC/Machine/HBD1200.cpp @@ -8,6 +8,7 @@ #include "../Toast.h" #include "../SystemInfo.h" #include "../Logger.h" +#include "../DataManage/DataHandle.h" const int HBD1200::IO_V0 = 0; HBD1200::HBD1200(MachineTypeCfg::MachineTypeId type) :Machine(type) @@ -2818,1381 +2819,1393 @@ void HBD1200::DrawServoState(bool* winShow) // ImGui::EndChild(); //} -void HBD1200::DrawPowderCtrl(bool* winShow) -{} - //void HBD1200::DrawPowderCtrl(bool* winShow) -//{ -// ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(4, 8)); -// ImGui::Begin(_(u8"铺粉装置调试").c_str(), winShow, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoDocking | ImGuiWindowFlags_NoNav); -// ImGui::PopStyleVar(); -// -// int dstepflag = 1; -// double fstepflag = 1.0; -// long lstepflag = 1; -// static int kb = GTS_AXIS_ID_ARM; -// static bool continue_move = false; -// -// //CoverCfg* coverCfg = m_CoverCfg; -// MainAxisState* mold = m_Axis->m_Mold->GetState(); -// //MainAxisState* ele = m_Axis->m_Clean->GetState(); -// AxisState* load = m_Axis->m_Load->GetState(); -// AxisState* arm = m_Axis->m_Arm->GetState(); -// AxisState* supply = m_Axis->m_Supply->GetState(); -// -// AxisConfig* armCfg = m_Axis->m_Arm->GetConfig(); -// AxisConfig::CfgValue armCfgVal; -// armCfg->GetValue(armCfgVal); -// AxisConfig* moldCfg = m_Axis->m_Mold->GetConfig(); -// AxisConfig::CfgValue moldCfgVal; -// moldCfg->GetValue(moldCfgVal); -// //AxisConfig* cleanCfg = m_Axis->m_Clean->GetConfig(); -// //AxisConfig::CfgValue cleanCfgVal; -// //cleanCfg->GetValue(cleanCfgVal); -// AxisConfig* loadCfg = m_Axis->m_Load->GetConfig(); -// AxisConfig::CfgValue loadCfgVal; -// loadCfg->GetValue(loadCfgVal); -// AxisConfig* supplyCfg = m_Axis->m_Supply->GetConfig(); -// AxisConfig::CfgValue supplyCfgVal; -// supplyCfg->GetValue(supplyCfgVal); -// -// ChartletManager* chartletManager = ChartletManager::GetInstance(); -// ImVec2 wpos = ImGui::GetWindowPos(); -// SignalService::GetInstance().GetSignalState(m_SignalState); -// if (m_PowderAssist.isLeftExpand) -// { -// ImGui::BeginGroup(); -// vector tabs; -// tabs.push_back(_(u8"成型缸")); -// tabs.push_back(_(u8"移载轴")); -// tabs.push_back(_(u8"铺粉轴")); -// tabs.push_back(_(u8"供粉轴")); -// tabs.push_back(_(u8"铺粉")); -// tabs.push_back(_(u8"控制")); -// int tabwidth = 0; -// for (size_t tindex = 0; tindex < tabs.size(); tindex++) { -// tabwidth = tabwidth + ImGui::CalcTextSize(tabs[tindex].c_str(), 0).x + 15; -// } -// ImVec2 showSize = ImVec2(tabwidth, 600); -// -// ImGui::BeginChild("AxisSettingChild", showSize, false, ImGuiWindowFlags_NoNav); -// ImGui::BeginTabBar("AxisSetting"); -// if (ImGui::BeginTabItem(_(u8"成型缸").c_str())) { -// ImGui::PushItemWidth(100); -// if (ImGui::InputScalar(_(u8"速度(mm/s)").c_str(), ImGuiDataType_Float, &moldCfgVal.speed, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) -// { -// moldCfg->m_Speed->SetValue(moldCfgVal.speed); -// g_log->TraceInfo(_(u8"更改成型缸速度:%.3f").c_str(), moldCfgVal.speed); -// } -// if (ImGui::InputScalar(_(u8"加速度(m/s²)").c_str(), ImGuiDataType_Float, &moldCfgVal.acc, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) -// { -// moldCfg->m_Acc->SetValue(moldCfgVal.acc); -// g_log->TraceInfo(_(u8"更改成型缸加速度:%.3f").c_str(), moldCfgVal.acc); -// } -// if (ImGui::InputScalar(_(u8"减速度(m/s2)").c_str(), ImGuiDataType_Float, &moldCfgVal.dec, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) -// { -// moldCfg->m_Dec->SetValue(moldCfgVal.dec); -// g_log->TraceInfo(_(u8"更新成型缸减速度:%.3f").c_str(), moldCfgVal.dec); -// } -// if (ImGui::InputScalar(_(u8"点动行程(μm)").c_str(), ImGuiDataType_Float, &moldCfgVal.rel, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) { -// moldCfg->m_RefDistance->SetValue(moldCfgVal.rel); -// g_log->TraceInfo(_(u8"更改成型缸点动行程:%.3f").c_str(), moldCfgVal.rel); -// } -// ImGui::PopItemWidth(); -// -// if ((g_Admin > USER_ADMIN)) { -// ImGui::Dummy(ImVec2(0, 20)); -// if (mold->m_MoveAbsPos) -// { -// if (m_SysParamWrapper->m_MoldAbsTestPos->GetValue() == 0) -// { -// if (ImGui::ImageButton(chartletManager->m_MoldMoveDownesting->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) -// { -// m_Axis->m_Mold->GetCtrl()->m_MoveAbsPos->SetValue(false); -// g_log->TraceInfo(_(u8"中断打印升降轴移动到安全位").c_str()); -// } -// if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"打印升降轴移动到安全位").c_str()); -// } -// else { -// ImGui::ImageButton(chartletManager->m_MoldMoveDownestDisable->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); -// if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"不能执行打印升降轴移动到安全位").c_str()); -// } -// } -// else { -// if (ImGui::ImageButton(chartletManager->m_MoldMoveDownestEnable->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) -// { -// m_SysParamWrapper->m_MoldAbsTestPos->SetValue(0); -// m_Axis->m_Mold->GetCtrl()->m_MoveAbsPos->SetValue(true); -// g_log->TraceInfo(_(u8"执行打印升降轴移动到安全位").c_str()); -// } -// if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"打印升降轴移动到安全位").c_str()); -// } -// -// ImGui::SameLine(); -// -// if (mold->m_MoveAbsPos) -// { -// if (m_SysParamWrapper->m_MoldAbsTestPos->GetValue() == 3) -// { -// if (ImGui::ImageButton(chartletManager->m_MoldMovePlatformBottoming->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) -// { -// m_Axis->m_Mold->GetCtrl()->m_MoveAbsPos->SetValue(false); -// g_log->TraceInfo(_(u8"中断打印轴移动到底座缸平面位").c_str()); -// } -// if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"中断打印轴移动到底座缸平面位").c_str()); -// } -// else { -// ImGui::ImageButton(chartletManager->m_MoldMovePlatformBottomDisable->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); -// if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"不能执行打印轴移动到底座缸平面位").c_str()); -// } -// } -// else { -// if (ImGui::ImageButton(chartletManager->m_MoldMovePlatformBottomEnable->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) -// { -// m_SysParamWrapper->m_MoldAbsTestPos->SetValue(3); -// m_Axis->m_Mold->GetCtrl()->m_MoveAbsPos->SetValue(true); -// g_log->TraceInfo(_(u8"执行打印轴移动到底座缸平面位").c_str()); -// } -// if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"打印轴移动到底座缸平面位").c_str()); -// } -// ImGui::SameLine(); -// if (mold->m_MoveAbsPos) -// { -// if (m_SysParamWrapper->m_MoldAbsTestPos->GetValue() == 4) -// { -// if (ImGui::ImageButton(chartletManager->m_MoldMovePlatforming->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) -// { -// m_Axis->m_Mold->GetCtrl()->m_MoveAbsPos->SetValue(false); -// g_log->TraceInfo(_(u8"中断打印轴移动到基板缸平面位").c_str()); -// } -// if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"中断打印轴移动到基板缸平面位").c_str()); -// -// } -// else { -// ImGui::ImageButton(chartletManager->m_MoldMovePlatformDisable->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); -// if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"不能执行打印轴移动到基板缸平面位").c_str()); -// } -// } -// else { -// if (ImGui::ImageButton(chartletManager->m_MoldMovePlatformEnable->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) -// { -// m_SysParamWrapper->m_MoldAbsTestPos->SetValue(4); -// m_Axis->m_Mold->GetCtrl()->m_MoveAbsPos->SetValue(true); -// g_log->TraceInfo(_(u8"执行打印轴移动到基板缸平面位").c_str()); -// } -// if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"打印轴移动到基板缸平面位").c_str()); -// } -// } -// ImGui::EndTabItem(); -// } -// -// if (ImGui::BeginTabItem(_(u8"移载轴").c_str())) { -// ImGui::PushItemWidth(100); -// if (ImGui::InputScalar(_(u8"速度(mm/s)").c_str(), ImGuiDataType_Float, &loadCfgVal.speed, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) -// { -// loadCfg->m_Speed->SetValue(loadCfgVal.speed); -// g_log->TraceInfo(_(u8"更新移载轴速度:%.3f").c_str(), loadCfgVal.speed); -// } -// if (ImGui::InputScalar(_(u8"加速度(m/s²)").c_str(), ImGuiDataType_Float, &loadCfgVal.acc, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) -// { -// loadCfg->m_Acc->SetValue(loadCfgVal.acc); -// g_log->TraceInfo(_(u8"更新移载轴加速度:%.3f").c_str(), loadCfgVal.acc); -// } -// if (ImGui::InputScalar(_(u8"减速度(m/s2)").c_str(), ImGuiDataType_Float, &loadCfgVal.dec, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) -// { -// loadCfg->m_Dec->SetValue(loadCfgVal.dec); -// g_log->TraceInfo(_(u8"更新移载轴减速度:%.3f").c_str(), loadCfgVal.dec); -// } -// if (ImGui::InputScalar(_(u8"点动行程(μm)").c_str(), ImGuiDataType_Float, &loadCfgVal.rel, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) { -// loadCfg->m_RefDistance->SetValue(loadCfgVal.rel); -// g_log->TraceInfo(_(u8"更新移载轴点动距离:%.3f").c_str(), loadCfgVal.rel); -// } -// ImGui::PopItemWidth(); -// if (g_Admin > USER_ADMIN) { -// ImGui::Dummy(ImVec2(0, 20)); -// -// if (load->m_MoveAbsPos) -// { -// if (m_SysParamWrapper->m_LoadAxisAbsTestPos->GetValue() == 3) -// { -// if (ImGui::ImageButton(chartletManager->m_LoadHandPosing->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) -// { -// m_Axis->m_Load->GetCtrl()->m_MoveAbsPos->SetValue(false); -// g_log->TraceInfo(_(u8"中断移载轴移动到轨道吊装位").c_str()); -// } -// if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"中断移载轴移动到轨道吊装位").c_str()); -// -// } -// else { -// ImGui::ImageButton(chartletManager->m_LoadHandPosDisable->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); -// if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"不能执行移载轴移动到轨道吊装位").c_str()); -// } -// } -// else { -// if (ImGui::ImageButton(chartletManager->m_LoadHandPosEnable->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) -// { -// m_SysParamWrapper->m_LoadAxisAbsTestPos->SetValue(3); -// m_Axis->m_Load->GetCtrl()->m_MoveAbsPos->SetValue(true); -// g_log->TraceInfo(_(u8"执行移载轴移动到轨道吊装位").c_str()); -// } -// if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"移载轴移动到轨道吊装位").c_str()); -// } -// -// ImGui::SameLine(); -// if (load->m_MoveAbsPos) -// { -// if (m_SysParamWrapper->m_LoadAxisAbsTestPos->GetValue() == 1) -// { -// if (ImGui::ImageButton(chartletManager->m_LoadCleanPosing->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) -// { -// m_Axis->m_Load->GetCtrl()->m_MoveAbsPos->SetValue(false); -// g_log->TraceInfo(_(u8"中断移载轴移动到轨道清粉位").c_str()); -// } -// if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"中断移载轴移动到轨道清粉位").c_str()); -// -// } -// else { -// ImGui::ImageButton(chartletManager->m_LoadCleanPosDisable->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); -// if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"不能执行移载轴移动到轨道清粉位").c_str()); -// } -// } -// else { -// if (ImGui::ImageButton(chartletManager->m_LoadCleanPosEnable->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) -// { -// m_SysParamWrapper->m_LoadAxisAbsTestPos->SetValue(1); -// m_Axis->m_Load->GetCtrl()->m_MoveAbsPos->SetValue(true); -// g_log->TraceInfo(_(u8"执行移载轴移动到轨道清粉位").c_str()); -// } -// if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"移载轴移动到轨道清粉位").c_str()); -// } -// ImGui::SameLine(); -// if (load->m_MoveAbsPos) -// { -// if (m_SysParamWrapper->m_LoadAxisAbsTestPos->GetValue() == 0) -// { -// if (ImGui::ImageButton(chartletManager->m_LoadPrintPosing->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) -// { -// m_Axis->m_Load->GetCtrl()->m_MoveAbsPos->SetValue(false); -// g_log->TraceInfo(_(u8"中断移载轴移动到轨道打印位").c_str()); -// } -// if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"中断移载轴移动到轨道打印位").c_str()); -// -// } -// else { -// ImGui::ImageButton(chartletManager->m_LoadPrintPosDisable->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); -// if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"不能执行移载轴移动到轨道打印位").c_str()); -// } -// } -// else { -// if (ImGui::ImageButton(chartletManager->m_LoadPrintPosEnable->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) -// { -// m_SysParamWrapper->m_LoadAxisAbsTestPos->SetValue(0); -// m_Axis->m_Load->GetCtrl()->m_MoveAbsPos->SetValue(true); -// g_log->TraceInfo(_(u8"执行移载轴移动到轨道打印位").c_str()); -// } -// if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"移载轴移动到轨道打印位").c_str()); -// } -// } -// -// ImGui::EndTabItem(); -// } -// -// if (ImGui::BeginTabItem(_(u8"铺粉轴").c_str())) { -// ImGui::PushItemWidth(100); -// if (ImGui::InputScalar(_(u8"速度(mm/s)").c_str(), ImGuiDataType_Float, &armCfgVal.speed, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) -// { -// armCfg->m_Speed->SetValue(armCfgVal.speed); -// g_log->TraceInfo(_(u8"更新铺粉轴速度:%.3f").c_str(), armCfgVal.speed); -// } -// if (ImGui::InputScalar(_(u8"加速度(m/s²)").c_str(), ImGuiDataType_Float, &armCfgVal.acc, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) -// { -// armCfg->m_Acc->SetValue(armCfgVal.acc); -// g_log->TraceInfo(_(u8"更新铺粉轴加速度:%.3f").c_str(), armCfgVal.acc); -// } -// if (ImGui::InputScalar(_(u8"减速度(m/s2)").c_str(), ImGuiDataType_Float, &armCfgVal.dec, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) -// { -// armCfg->m_Dec->SetValue(armCfgVal.dec); -// g_log->TraceInfo(_(u8"更新铺粉轴减速度:%.3f").c_str(), armCfgVal.dec); -// } -// if (ImGui::InputScalar(_(u8"点动行程(μm)").c_str(), ImGuiDataType_Float, &armCfgVal.rel, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) { -// armCfg->m_RefDistance->SetValue(armCfgVal.rel); -// g_log->TraceInfo(_(u8"更新铺粉轴点动距离:%.3f").c_str(), armCfgVal.rel); -// } -// ImGui::PopItemWidth(); -// if (g_Admin > USER_ADMIN) { -// ImGui::Dummy(ImVec2(0, 20)); -// -// if (arm->m_MoveAbsPos) -// { -// if (m_SysParamWrapper->m_ArmAbsTestPos->GetValue() == 0) -// { -// if (ImGui::ImageButton(chartletManager->m_ArmAcceptPosing->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) -// { -// m_Axis->m_Arm->GetCtrl()->m_MoveAbsPos->SetValue(false); -// g_log->TraceInfo(_(u8"中断铺粉轴移动到接粉位").c_str()); -// } -// if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"中断铺粉轴移动到接粉位").c_str()); -// -// } -// else { -// ImGui::ImageButton(chartletManager->m_ArmAcceptPosDisable->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); -// if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"不能执行铺粉轴移动到接粉位").c_str()); -// } -// } -// else { -// if (ImGui::ImageButton(chartletManager->m_ArmAcceptPosEnable->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) -// { -// m_SysParamWrapper->m_ArmAbsTestPos->SetValue(0); -// m_Axis->m_Arm->GetCtrl()->m_MoveAbsPos->SetValue(true); -// g_log->TraceInfo(_(u8"执行铺粉轴移动到接粉位").c_str()); -// } -// if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"铺粉轴移动到接粉位").c_str()); -// } -// ImGui::SameLine(); -// if (arm->m_MoveAbsPos) -// { -// if (m_SysParamWrapper->m_ArmAbsTestPos->GetValue() == 1) -// { -// if (ImGui::ImageButton(chartletManager->m_ArmFrontDropPosing->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) -// { -// m_Axis->m_Arm->GetCtrl()->m_MoveAbsPos->SetValue(false); -// g_log->TraceInfo(_(u8"中断铺粉轴移动到前下粉位").c_str()); -// } -// if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"中断铺粉轴移动到前下粉位").c_str()); -// -// } -// else { -// ImGui::ImageButton(chartletManager->m_ArmFrontDropPosDisable->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); -// if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"不能执行铺粉轴移动到前下粉位").c_str()); -// } -// } -// else { -// if (ImGui::ImageButton(chartletManager->m_ArmFrontDropPosEnable->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) -// { -// m_SysParamWrapper->m_ArmAbsTestPos->SetValue(1); -// m_Axis->m_Arm->GetCtrl()->m_MoveAbsPos->SetValue(true); -// g_log->TraceInfo(_(u8"执行铺粉轴移动到前下粉位").c_str()); -// } -// if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"铺粉轴移动到前下粉位").c_str()); -// } -// } -// -// ImGui::EndTabItem(); -// } -// -// if (ImGui::BeginTabItem(_(u8"供粉轴").c_str())) { -// ImGui::PushItemWidth(100); -// if (ImGui::InputScalar(_(u8"速度(mm/s)").c_str(), ImGuiDataType_Float, &supplyCfgVal.speed, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) -// { -// supplyCfg->m_Speed->SetValue(supplyCfgVal.speed); -// g_log->TraceInfo(_(u8"更新下粉轴速度:%.3f").c_str(), supplyCfgVal.speed); -// } -// if (ImGui::InputScalar(_(u8"加速度(m/s²)").c_str(), ImGuiDataType_Float, &supplyCfgVal.acc, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) -// { -// supplyCfg->m_Acc->SetValue(supplyCfgVal.acc); -// g_log->TraceInfo(_(u8"更新下粉轴加速度:%.3f").c_str(), supplyCfgVal.acc); -// } -// if (ImGui::InputScalar(_(u8"减速度(m/s2)").c_str(), ImGuiDataType_Float, &supplyCfgVal.dec, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) -// { -// supplyCfg->m_Dec->SetValue(supplyCfgVal.dec); -// g_log->TraceInfo(_(u8"更新下粉轴减速度:%.3f").c_str(), supplyCfgVal.dec); -// } -// if (ImGui::InputScalar(_(u8"粉格").c_str(), ImGuiDataType_Float, &supplyCfgVal.rel, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) { -// supplyCfg->m_RefDistance->SetValue(supplyCfgVal.rel); -// g_log->TraceInfo(_(u8"更新下粉轴相对移动距离:%.3f").c_str(), supplyCfgVal.rel); -// } -// ImGui::PopItemWidth(); -// ImGui::EndTabItem(); -// } -// -// if (ImGui::BeginTabItem(_(u8"铺粉").c_str())) { -// AxisData ad; -// vector ss = { _(u8"双向铺粉"),_(u8"单向铺粉"),_(u8"不铺粉") ,_(u8"双向铺粉2") ,_(u8"单向铺粉2"),_(u8"单向铺粉3") }; -// m_SysParamWrapper->GetAxisData(ad); -// ImGui::PushItemWidth(120); -// if (ImGui::SemicolonCombo(_(u8"铺粉类型").c_str(), &ad.CoverType, ss)) { -// m_SysParamWrapper->m_CoverType->SetValue(ad.CoverType); -// g_log->TraceInfo(_(u8"更新铺粉方式:%d").c_str(), ad.CoverType); -// } -// -// if (ImGui::InputFloat(_(u8"打印铺粉速度(mm/s)").c_str(), &ad.CoverSpeed, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) { -// m_SysParamWrapper->m_CoverSpeed->SetValue(ad.CoverSpeed); -// g_log->TraceInfo(_(u8"更新铺粉速度:%.3f").c_str(), ad.CoverSpeed); -// } -// if (ImGui::InputFloat(_(u8"打印单向铺粉返回变速(mm/s)").c_str(), &ad.CoverReturnSpeed, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) { -// m_SysParamWrapper->m_CoverReturnSpeed->SetValue(ad.CoverReturnSpeed); -// g_log->TraceInfo(_(u8"更新打印单向返回速度:%.3f").c_str(), ad.CoverReturnSpeed); -// } -// if (ImGui::InputFloat(_(u8"打印单向铺粉距离(mm)").c_str(), &ad.CoverDistance, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) { -// m_SysParamWrapper->m_CoverDistance->SetValue(ad.CoverDistance); -// g_log->TraceInfo(_(u8"更新打印单向铺粉距离:%.3f").c_str(), ad.CoverDistance); -// } -// if (ImGui::InputFloat(_(u8"打印铺粉层厚(μm)").c_str(), &ad.LayerThick, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) { -// m_SysParamWrapper->m_LayerThick->SetValue(ad.LayerThick); -// g_log->TraceInfo(_(u8"更新打印铺粉层厚:%.3f").c_str(), ad.LayerThick); -// } -// if (ImGui::InputFloat(_(u8"打印间隙补偿(μm)").c_str(), &ad.FixGap, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) { -// m_SysParamWrapper->m_FixGap->SetValue(ad.FixGap); -// g_log->TraceInfo(_(u8"更新打印间隙补偿:%.3f").c_str(), ad.FixGap); -// } -// if (ImGui::InputScalar(_(u8"打印铺粉格数").c_str(), ImGuiDataType_S16, &ad.SupplyCount, 0, 0, 0, ImGuiInputTextFlags_EnterReturnsTrue)) { -// m_SysParamWrapper->m_SupplyCount->SetValue(ad.SupplyCount); -// g_log->TraceInfo(_(u8"更新打印铺粉格数:%d").c_str(), ad.SupplyCount); -// } -// if (ImGui::InputScalar(_(u8"打印下粉时间(ms)").c_str(), ImGuiDataType_S16, &ad.SupplyTime, 0, 0, 0, ImGuiInputTextFlags_EnterReturnsTrue)) { -// m_SysParamWrapper->m_SupplyTime->SetValue(ad.SupplyTime); -// g_log->TraceInfo(_(u8"更新打印下粉时间:%d").c_str(), ad.SupplyTime); -// } -// if (ImGui::InputFloat(_(u8"铺粉调试层厚(μm)").c_str(), &ad.DebugLayerThick, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) { -// m_SysParamWrapper->m_DebugLayerThick->SetValue(ad.DebugLayerThick); -// g_log->TraceInfo(_(u8"更新铺粉调试层厚:%.3f").c_str(), ad.DebugLayerThick); -// } -// if (ImGui::InputFloat(_(u8"铺粉调试间隙(μm)").c_str(), &ad.DebugFixGap, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) { -// m_SysParamWrapper->m_DebugFixGap->SetValue(ad.DebugFixGap); -// g_log->TraceInfo(_(u8"更新铺粉调试间隙补偿:%.3f").c_str(), ad.DebugFixGap); -// } -// if (ImGui::InputScalar(_(u8"铺粉调试下粉时间(ms)").c_str(), ImGuiDataType_S16, &ad.DebugSupplyTime, 0, 0, 0, ImGuiInputTextFlags_EnterReturnsTrue)) { -// m_SysParamWrapper->m_DebugSupplyTime->SetValue(ad.DebugSupplyTime); -// g_log->TraceInfo(_(u8"更新铺粉调试下粉时间:%d").c_str(), ad.DebugSupplyTime); -// } -// if (ImGui::InputScalar(_(u8"铺粉调试格数").c_str(), ImGuiDataType_S16, &ad.DebugSupplyCount, 0, 0, 0, ImGuiInputTextFlags_EnterReturnsTrue)) { -// m_SysParamWrapper->m_DebugSupplyCount->SetValue(ad.DebugSupplyCount); -// g_log->TraceInfo(_(u8"更新铺粉调试格数:%d").c_str(), ad.DebugSupplyCount); -// } -// if (ImGui::InputFloat(_(u8"铺粉调试铺粉距离(mm)").c_str(), &ad.DebugCoverDistance, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) { -// m_SysParamWrapper->m_DebugCoverDistance->SetValue(ad.DebugCoverDistance); -// g_log->TraceInfo(_(u8"更新铺粉调试距离:%.3f").c_str(), ad.DebugCoverDistance); -// } -// ImGui::PopItemWidth(); -// -// ImGui::Dummy(ImVec2(0, 20)); -// if (m_SignalStateWrapper->m_IsCovering->GetValue()) { -// ImGui::PushID("CoverTrigerStop"); -// if (ImGui::Button(_(u8"停止").c_str(), ImVec2(-1, 0))) { -// m_SignalStateWrapper->m_CoverTriger->SetValue(false); -// g_log->TraceInfo(_(u8"停止铺粉调试").c_str()); -// } -// ImGui::PopID(); -// } -// else { -// // if (m_Purifier->IsCoverWindSet()) -// // { -// // m_Purifier->ResetSlowWind(); -// // } -// if (ImGui::Button(_(u8"铺粉调试").c_str(), ImVec2(-1, 0))) { -// if (m_SignalStateWrapper->m_CoverEnable->GetValue()) { -// // if (m_ExtCfg->m_AutoCoverSlowWind && m_Purifier->IsWindActive()) { -// // m_Purifier->SetCoverWind(true); -// // } -// m_SignalStateWrapper->m_IsCoverDebug->SetValue(true); -// Sleep(50); -// m_SignalStateWrapper->m_ManualCoverTest->SetValue(true); -// Sleep(50); -// g_log->TraceInfo(_(u8"执行铺粉调试").c_str()); -// } -// else { -// g_Toast->AddToast(new ToastBean(_(u8"铺粉调试条件不成立").c_str(), 3000)); -// } -// } -// } -// ImGui::EndTabItem(); -// } -// if (g_Admin > USER_ADMIN) { -// if (ImGui::BeginTabItem(_(u8"控制").c_str())) { -// if (m_SignalStateWrapper->m_CylinderReachPrintRun->GetValue()) { -// ImGui::PushID("CylinderReachPrintTrigerStop"); -// if (ImGui::Button(_(u8"停止").c_str())) { -// m_SignalStateWrapper->m_CylinderReachPrintTriger->SetValue(false); -// } -// ImGui::PopID(); -// } -// else { -// -// ImGui::PushItemFlag(ImGuiItemFlags_Disabled, !m_SignalStateWrapper->m_CylinderReachPrintEnable->GetValue()); -// if (ImGui::Button(_(u8"移动缸体到打印位").c_str())) { -// if (m_SignalStateWrapper->m_CylinderReachPrintEnable->GetValue()) { -// m_SignalStateWrapper->m_CylinderReachPrintTriger->SetValue(true); -// g_log->TraceInfo(_(u8"执行移动缸体到打印位").c_str()); -// } -// else { -// g_Toast->AddToast(new ToastBean(_(u8"移动缸体到打印位条件不成立").c_str(), 3000)); -// } -// m_RunCfg->m_HadSetBasePlatformPoint = false; -// } -// ImGui::PopItemFlag(); -// } -// -// if (m_SignalStateWrapper->m_CylinderReachCleanRun->GetValue()) { -// ImGui::PushID("CylinderReachCleanTrigerStop"); -// if (ImGui::Button(_(u8"停止").c_str())) { -// m_SignalStateWrapper->m_CylinderReachCleanTriger->SetValue(false); -// } -// ImGui::PopID(); -// } -// else { -// ImGui::PushItemFlag(ImGuiItemFlags_Disabled, !m_SignalStateWrapper->m_CylinderReachCleanEnable->GetValue()); -// if (ImGui::Button(_(u8"移动缸体到清粉位").c_str())) { -// if (m_SignalStateWrapper->m_CylinderReachCleanEnable->GetValue()) { -// m_SignalStateWrapper->m_CylinderReachCleanTriger->SetValue(true); -// g_log->TraceInfo(_(u8"执行移动缸体到清粉位").c_str()); -// } -// else { -// g_Toast->AddToast(new ToastBean(_(u8"移动缸体到清粉位条件不成立").c_str(), 3000)); -// } -// -// } -// ImGui::PopItemFlag(); -// } -// -// -// if (m_SignalStateWrapper->m_CylinderPrintLoadRun->GetValue()) { -// ImGui::PushID("CylinderPrintLoadTrigerStop"); -// if (ImGui::Button(_(u8"停止").c_str())) { -// m_SignalStateWrapper->m_CylinderPrintLoadTriger->SetValue(false); -// } -// ImGui::PopID(); -// } -// else { -// ImGui::PushItemFlag(ImGuiItemFlags_Disabled, !m_SignalStateWrapper->m_CylinderPrintLoadEnable->GetValue()); -// if (ImGui::Button(_(u8"缸体打印位装载").c_str())) { -// if (m_SignalStateWrapper->m_CylinderPrintLoadEnable->GetValue()) { -// m_SignalStateWrapper->m_CylinderPrintLoadTriger->SetValue(true); -// g_log->TraceInfo(_(u8"执行缸体打印位装载").c_str()); -// } -// else { -// g_Toast->AddToast(new ToastBean(_(u8"缸体打印位装载条件不成立").c_str(), 3000)); -// } -// m_RunCfg->m_HadSetBasePlatformPoint = false; -// } -// ImGui::PopItemFlag(); -// } -// -// if (m_SignalStateWrapper->m_CylinderConnectCleanBoxRun->GetValue()) { -// ImGui::PushID("CylinderConnectCleanBoxTrigerStop"); -// if (ImGui::Button(_(u8"停止").c_str())) { -// m_SignalStateWrapper->m_CylinderConnectCleanBoxTriger->SetValue(false); -// } -// ImGui::PopID(); -// } -// else { -// ImGui::PushItemFlag(ImGuiItemFlags_Disabled, !m_SignalStateWrapper->m_CylinderConnectCleanBoxEnable->GetValue()); -// if (ImGui::Button(_(u8"缸体连接清粉箱").c_str())) { -// if (m_SignalStateWrapper->m_CylinderConnectCleanBoxEnable->GetValue()) { -// m_SignalStateWrapper->m_CylinderConnectCleanBoxTriger->SetValue(true); -// g_log->TraceInfo(_(u8"执行缸体连接清粉箱").c_str()); -// } -// else { -// g_Toast->AddToast(new ToastBean(_(u8"缸体连接清粉箱条件不成立").c_str(), 3000)); -// } -// } -// ImGui::PopItemFlag(); -// } -// -// if (m_SignalStateWrapper->m_CylinderPrintUnloadRun->GetValue()) { -// ImGui::PushID("CylinderPrintUnloadTrigerStop"); -// if (ImGui::Button(_(u8"停止").c_str())) { -// m_SignalStateWrapper->m_CylinderPrintUnloadTriger->SetValue(false); -// } -// ImGui::PopID(); -// } -// else { -// ImGui::PushItemFlag(ImGuiItemFlags_Disabled, !m_SignalStateWrapper->m_CylinderPrintUnloadEnable->GetValue()); -// if (ImGui::Button(_(u8"缸体打印位卸载").c_str())) { -// if (m_SignalStateWrapper->m_CylinderPrintUnloadEnable->GetValue()) { -// m_SignalStateWrapper->m_CylinderPrintUnloadTriger->SetValue(true); -// g_log->TraceInfo(_(u8"执行缸体打印位卸载").c_str()); -// } -// else { -// g_Toast->AddToast(new ToastBean(_(u8"缸体打印位卸载条件不成立").c_str(), 3000)); -// } -// m_RunCfg->m_HadSetBasePlatformPoint = false; -// } -// ImGui::PopItemFlag(); -// } -// -// if (m_SignalStateWrapper->m_CylinderDisconnectCleanBoxRun->GetValue()) { -// ImGui::PushID("CylinderDisconnectCleanBoxTrigerStop"); -// if (ImGui::Button(_(u8"停止").c_str())) { -// m_SignalStateWrapper->m_CylinderDisconnectCleanBoxTriger->SetValue(false); -// } -// ImGui::PopID(); -// } -// else { -// ImGui::PushItemFlag(ImGuiItemFlags_Disabled, !m_SignalStateWrapper->m_CylinderDisconnectCleanBoxEnable->GetValue()); -// if (ImGui::Button(_(u8"缸体脱离清粉箱").c_str())) { -// if (m_SignalStateWrapper->m_CylinderDisconnectCleanBoxEnable->GetValue()) { -// m_SignalStateWrapper->m_CylinderDisconnectCleanBoxTriger->SetValue(true); -// g_log->TraceInfo(_(u8"执行缸体脱离清粉箱").c_str()); -// } -// else { -// g_Toast->AddToast(new ToastBean(_(u8"缸体脱离清粉箱条件不成立").c_str(), 3000)); -// } -// } -// ImGui::PopItemFlag(); -// } -// -// ImGui::EndTabItem(); -// } -// } -// ImGui::EndTabBar(); -// ImGui::EndChild(); -// -// -// if (ImGui::Button(_(u8"运动急停").c_str(), ImVec2(tabwidth, 0))) { -// m_Axis->StopAll(); -// g_log->TraceInfo(_(u8"运动急停").c_str()); -// } -// -// ImGui::EndGroup(); -// ImGui::SameLine(); -// } -// -// ImGui::BeginChild("AxisCtrl", ImVec2(840, 670)); -// if (m_PowderAssist.isLeftExpand) { -// if (ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::HNARROW]->GetTex(), ImVec2(38, 50), ImVec2(0, 0), ImVec2(1, 1), 0)) { -// m_PowderAssist.isLeftExpand = !m_PowderAssist.isLeftExpand; -// } -// } -// else { -// if (ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::HEXPAND]->GetTex(), ImVec2(38, 50), ImVec2(0, 0), ImVec2(1, 1), 0)) { -// m_PowderAssist.isLeftExpand = !m_PowderAssist.isLeftExpand; -// } -// } -// -// ImGui::SameLine(); -// ImGui::BeginGroup(); -// if (ImGui::ToggleButton(_(u8"连续运动").c_str(), continue_move)) -// continue_move = !continue_move; -// ImGui::SameLine(); -// ImGui::Text(_(u8"连续运动").c_str()); -// -// ImGui::Dummy(ImVec2(0, 250)); -// -// if (ImGui::ImageButton(chartletManager->m_LoadOut->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) { -// LoadOut(); -// ImGui::OpenPopup(_(u8"移载载出").c_str()); -// g_log->TraceInfo(_(u8"执行移出").c_str()); -// } -// if (ImGui::IsItemHovered()) { -// ImGui::SetTooltip(_(u8"载出").c_str()); -// } -// ImGui::SameLine(); -// if (ImGui::ImageButton(chartletManager->m_LoadIn->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) { -// LoadIn(); -// ImGui::OpenPopup(_(u8"移载载入").c_str()); -// g_log->TraceInfo(_(u8"执行移入").c_str()); -// } -// if (ImGui::IsItemHovered()) { -// ImGui::SetTooltip(_(u8"载入").c_str()); -// } -// -// if (ImGui::BeginPopupModal(_(u8"移载载入").c_str(), NULL, ImGuiWindowFlags_AlwaysAutoResize)) { -// if (GetLoadInProcStep() == In_Start) { -// ImGui::Text(_(u8"移载开始载入").c_str()); -// } -// if (GetLoadInProcStep() == In_CylinderDisconnectCleanBox) { -// ImGui::Text(_(u8"缸体与清粉箱分离中").c_str()); -// } -// if (GetLoadInProcStep() == In_CylinderReachPrint) { -// ImGui::Text(_(u8"缸体到打印位运行中").c_str()); -// } -// if (GetLoadInProcStep() == In_CylinderPrintLoad) { -// ImGui::Text(_(u8"缸体打印位装载运行中").c_str()); -// } -// -// if (GetLoadInResult() == In_Intercept) { -// ImGui::TextColored(Toast::COLOR_ORANGE, GetLoadInfo().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()); -// if (ImGui::Button(_(u8"确定").c_str(), ImVec2(-1, 0))) -// { -// ImGui::CloseCurrentPopup(); -// } -// } -// else if (GetLoadInResult() > In_Success) { -// ImGui::TextColored(Toast::COLOR_RED, GetLoadInfo().c_str()); -// if (ImGui::Button(_(u8"确定").c_str(), ImVec2(-1, 0))) -// { -// ImGui::CloseCurrentPopup(); -// } -// } -// -// if (IsLoadIn()) { -// if (ImGui::Button(_(u8"中断载入").c_str(), ImVec2(-1, 0))) -// { -// InterceptLoad(); -// } -// } -// ImGui::EndPopup(); -// } -// -// -// if (ImGui::BeginPopupModal(_(u8"移载载出").c_str(), NULL, ImGuiWindowFlags_AlwaysAutoResize)) { -// if (GetLoadOutProcSetp() == Out_Start) -// { -// ImGui::Text(_(u8"移载开始载出").c_str()); -// } -// if (GetLoadOutProcSetp() == Out_CylinderPrintUnload) -// { -// ImGui::Text(_(u8"缸体打印位卸载运行中").c_str()); -// } -// if (GetLoadOutProcSetp() == Out_CylinderReachClean) -// { -// ImGui::Text(_(u8"缸体到清粉位运行中").c_str()); -// } -// if (GetLoadOutProcSetp() == Out_CylinderConnectCleanBox) -// { -// ImGui::Text(_(u8"缸体与清粉箱连接中").c_str()); -// } -// if (GetLoadOutProcSetp() == Out_CylinderReachHand) -// { -// ImGui::Text(_(u8"缸体与吊装位运行中").c_str()); -// } -// -// if (GetLoadOutProcSetp() == Out_CylinderDisconnectCleanBox) -// { -// ImGui::Text(_(u8"缸体与清粉箱分离中").c_str()); -// } -// -// -// if (m_NeedWaitSelectOutPos) { -// vector combtemp = { _(u8"清粉位"),_(u8"吊装位") }; -// ImGui::PushItemWidth(120); -// ImGui::SemicolonCombo(_(u8"选择载出位置").c_str(), &m_SelectOutPos, combtemp); -// ImGui::PopItemWidth(); -// ImGui::SameLine(); -// if (ImGui::Button(_(u8"下一步").c_str())) -// { -// m_WaitSelectOutPosCommit = true; -// } -// } -// -// if (IsWaitConnectBoxCommit()) { -// if (ImGui::Button(_(u8"执行缸体与清粉箱连接").c_str())) -// { -// SetWaitConnectBoxCommit(false); -// } -// } -// -// if (GetLoadOutResult() == Out_Intercept) { -// ImGui::TextColored(Toast::COLOR_ORANGE, GetLoadInfo().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()); -// if (ImGui::Button(_(u8"确定").c_str(), ImVec2(-1, 0))) -// { -// ImGui::CloseCurrentPopup(); -// } -// } -// else if (GetLoadOutResult() > Out_Success) { -// ImGui::TextColored(Toast::COLOR_RED, GetLoadInfo().c_str()); -// if (ImGui::Button(_(u8"确定").c_str(), ImVec2(-1, 0))) -// { -// ImGui::CloseCurrentPopup(); -// } -// } -// -// if (IsLoadOut()) { -// if (ImGui::Button(_(u8"中断载出").c_str(), ImVec2(-1, 0))) -// { -// InterceptLoad(); -// } -// } -// ImGui::EndPopup(); -// } -// -// ImGui::Dummy(ImVec2(0, 80)); -// ImGui::RadioButton(_(u8"移载轴").c_str(), &kb, GTS_AXIS_ID_LOAD); -// if (IsLoadAxisCanMoveLeft()) -// { -// ImGui::PushID("LoadMovePointLeft"); -// if (ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::LEFT_ARROW_GREEN]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) { -// m_Axis->m_Load->MovPoint(AxisConfig::ActiveDirect::LEFT); -// g_log->TraceInfo(_(u8"移载[%.3f]往左移动%.3f").c_str(), load->GetShowPos(), loadCfgVal.rel); -// } -// ImGui::PopID(); -// if (ImGui::IsItemHovered()) { -// ImGui::SetTooltip(_(u8"移载轴左移 %.3fmm").c_str(), loadCfgVal.rel / 1000.0f); -// } -// if (kb == GTS_AXIS_ID_LOAD && !continue_move) { -// if (ImGui::IsWindowFocused() && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_LeftArrow), false)) { -// m_Axis->m_Load->MovPoint(AxisConfig::ActiveDirect::LEFT); -// g_log->TraceInfo(_(u8"移载[%.3f]往左移动%.3f").c_str(), load->GetShowPos(), loadCfgVal.rel); -// } -// } -// } -// else { -// ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::LEFT_ARROW_RED]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); -// if (ImGui::IsItemHovered()) { -// ImGui::SetTooltip(GetLoadAxisCanotMoveLeftInfo().c_str()); -// } -// } -// -// ImGui::SameLine(); -// -// if (IsLoadAxisCanMoveRight()) -// { -// ImGui::PushID("LoadMovePointRight"); -// if (ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::RIGHT_ARROW_GREEN]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) -// { -// m_Axis->m_Load->MovPoint(AxisConfig::ActiveDirect::RIGHT); -// g_log->TraceInfo(_(u8"移载[%.3f]往右移动%.3f").c_str(), load->GetShowPos(), loadCfgVal.rel); -// } -// ImGui::PopID(); -// if (ImGui::IsItemHovered()) { -// ImGui::SetTooltip(_(u8"移载轴右移 %.3fmm").c_str(), loadCfgVal.rel); -// } -// if (kb == GTS_AXIS_ID_LOAD && !continue_move) { -// if (ImGui::IsWindowFocused() && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_RightArrow), false)) { -// m_Axis->m_Load->MovPoint(AxisConfig::ActiveDirect::RIGHT); -// g_log->TraceInfo(_(u8"移载[%.3f]往右移动%.3f").c_str(), load->GetShowPos(), loadCfgVal.rel); -// } -// } -// } -// else { -// ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::RIGHT_ARROW_RED]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); -// if (ImGui::IsItemHovered()) { -// ImGui::SetTooltip(GetLoadAxisCanotMoveRightInfo().c_str()); -// } -// } -// -// if (IsLoadAxisCanMoveLeft()) { -// ImGui::PushID("LoadMoveLimitLeft"); -// if (ImGui::ImageButtonEx(chartletManager->m_TextureMap[ChartletManager::LEFT_ARROW_GREEN_BAR]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) { -// if (!m_PowderAssist.isLoadLeftRepeat) { -// m_PowderAssist.isLoadLeftRepeat = true; -// m_Axis->m_Load->MovLimitStart(AxisConfig::ActiveDirect::LEFT); -// g_log->TraceInfo(_(u8"移载[%.3f]往左连续移动").c_str(), load->GetShowPos()); -// } -// } -// else { -// if (m_PowderAssist.isLoadLeftRepeat) -// { -// m_Axis->m_Load->MovLimitStop(AxisConfig::ActiveDirect::LEFT); -// m_PowderAssist.isLoadLeftRepeat = false; -// } -// } -// ImGui::PopID(); -// if (ImGui::IsItemHovered()) { -// ImGui::SetTooltip(_(u8"移载轴左连续").c_str()); -// } -// } -// else { -// ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::LEFT_ARROW_RED_BAR]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); -// if (ImGui::IsItemHovered()) { -// ImGui::SetTooltip(GetLoadAxisCanotMoveLeftInfo().c_str()); -// } -// if (m_PowderAssist.isLoadLeftRepeat) { -// m_Axis->m_Load->MovLimitStop(AxisConfig::ActiveDirect::LEFT); -// m_PowderAssist.isLoadLeftRepeat = false; -// } -// } -// -// if (kb == GTS_AXIS_ID_LOAD && continue_move) { -// if (ImGui::IsWindowFocused() && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_LeftArrow), false)) { -// if (IsLoadAxisCanMoveLeft()) { -// m_Axis->m_Load->MovLimitStart(AxisConfig::ActiveDirect::LEFT); -// g_log->TraceInfo(_(u8"移载[%.3f]往左连续移动").c_str(), load->GetShowPos()); -// } -// else { -// g_Toast->AddToast(new ToastBean(GetLoadAxisCanotMoveLeftInfo(), 5000, Toast::COLOR_ORANGE)); -// } -// } -// if (ImGui::IsWindowFocused() && ImGui::IsKeyReleased(ImGui::GetKeyIndex(ImGuiKey_LeftArrow))) -// m_Axis->m_Load->MovLimitStop(AxisConfig::ActiveDirect::LEFT); -// } -// -// ImGui::SameLine(); -// if (IsLoadAxisCanMoveRight()) { -// ImGui::PushID("LoadMoveLimitRight"); -// if (ImGui::ImageButtonEx(chartletManager->m_TextureMap[ChartletManager::RIGHT_ARROW_GREEN_BAR]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) -// { -// if (!m_PowderAssist.isLoadRightRepeat) { -// m_PowderAssist.isLoadRightRepeat = true; -// m_Axis->m_Load->MovLimitStart(AxisConfig::ActiveDirect::RIGHT); -// g_log->TraceInfo(_(u8"移载[%.3f]往右连续移动").c_str(), load->GetShowPos()); -// } -// -// } -// else { -// if (m_PowderAssist.isLoadRightRepeat) -// { -// m_Axis->m_Load->MovLimitStop(AxisConfig::ActiveDirect::RIGHT); -// m_PowderAssist.isLoadRightRepeat = false; -// } -// } -// ImGui::PopID(); -// if (ImGui::IsItemHovered()) { -// ImGui::SetTooltip(_(u8"移载轴右连续").c_str()); -// } -// } -// else { -// ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::RIGHT_ARROW_RED_BAR]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); -// if (ImGui::IsItemHovered()) { -// ImGui::SetTooltip(GetLoadAxisCanotMoveRightInfo().c_str()); -// } -// if (m_PowderAssist.isLoadRightRepeat) { -// m_Axis->m_Load->MovLimitStop(AxisConfig::ActiveDirect::RIGHT); -// m_PowderAssist.isLoadRightRepeat = false; -// } -// } -// if (kb == GTS_AXIS_ID_LOAD && continue_move) { -// if (ImGui::IsWindowFocused() && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_RightArrow), false)) -// { -// if (IsLoadAxisCanMoveRight()) { -// m_Axis->m_Load->MovLimitStart(AxisConfig::ActiveDirect::RIGHT); -// g_log->TraceInfo(_(u8"移载[%.3f]往右连续移动").c_str(), load->GetShowPos()); -// } -// else { -// g_Toast->AddToast(new ToastBean(GetLoadAxisCanotMoveRightInfo(), 5000, Toast::COLOR_ORANGE)); -// } -// } -// if (ImGui::IsWindowFocused() && ImGui::IsKeyReleased(ImGui::GetKeyIndex(ImGuiKey_RightArrow))) -// { -// m_Axis->m_Load->MovLimitStop(AxisConfig::ActiveDirect::RIGHT); -// } -// } -// ImGui::PushID("load_to_zero"); -// if (ImGui::ImageButton(chartletManager->m_ToZero->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) -// load->SetZeroPos(); -// ImGui::PopID(); -// if (ImGui::IsItemHovered()) { -// ImGui::SetTooltip(_(u8"移栽轴位置清零").c_str()); -// } -// -// ImGui::EndGroup(); -// -// ImGui::SameLine(); -// ImGui::BeginGroup(); -// -// //ImGui::Dummy(ImVec2(500,1)); -// ImGui::BeginChild("SupplyCtrl", ImVec2(500, 160)); -// ImGui::BeginGroup(); -// ImGui::Text(_(u8"移栽轴:%.3f").c_str(), load->GetShowPos() / 1000.0f); -// ImGui::Text(_(u8"成型缸:%.3f").c_str(), mold->GetShowPos() / 1000.0f); -// ImGui::Text(_(u8"铺粉臂:%.3f").c_str(), arm->GetShowPos() / 1000.0f); -// ImGui::EndGroup(); -// ImGui::SameLine(350); -// ImGui::BeginGroup(); -// ImGui::RadioButton(_(u8"供粉轴").c_str(), &kb, GTS_AXIS_ID_SUPPLY); -// -// -// ImGui::PushID("SupplyMovePointFront"); -// if (ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::DOWN_ARROW_GREEN]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) { -// m_Axis->m_Supply->MovPoint(AxisConfig::ActiveDirect::FRONT); -// } -// ImGui::PopID(); -// if (ImGui::IsItemHovered()) { -// ImGui::SetTooltip(_(u8"下粉轴前转%.2f格").c_str(), supplyCfgVal.rel); -// } -// if (kb == GTS_AXIS_ID_SUPPLY && !continue_move) { -// if (ImGui::IsWindowFocused() && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_DownArrow), false)) { -// m_Axis->m_Supply->MovPoint(AxisConfig::ActiveDirect::FRONT); -// } -// } -// ImGui::SameLine(); -// ImGui::PushID("SupplyMoveLimitFront"); -// if (ImGui::ImageButtonEx(chartletManager->m_TextureMap[ChartletManager::DOWN_ARROW_GREEN_BAR]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) { -// if (!m_PowderAssist.isSupplyNegativeRepeat) { -// m_PowderAssist.isSupplyNegativeRepeat = true; -// m_Axis->m_Supply->MovLimitStart(AxisConfig::ActiveDirect::FRONT); -// //OutputDebugString("left\n"); -// } -// } -// else { -// if (m_PowderAssist.isSupplyNegativeRepeat) -// { -// m_Axis->m_Supply->MovLimitStop(AxisConfig::ActiveDirect::FRONT); -// m_PowderAssist.isSupplyNegativeRepeat = false; -// //OutputDebugString("stop\n"); -// } -// } -// ImGui::PopID(); -// if (ImGui::IsItemHovered()) { -// ImGui::SetTooltip(_(u8"供粉轴左连续").c_str()); -// } -// if (kb == GTS_AXIS_ID_SUPPLY && continue_move) { -// if (ImGui::IsWindowFocused() && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_DownArrow), false)) { -// m_Axis->m_Supply->MovLimitStart(AxisConfig::ActiveDirect::FRONT); -// } -// if (ImGui::IsWindowFocused() && ImGui::IsKeyReleased(ImGui::GetKeyIndex(ImGuiKey_DownArrow))) -// m_Axis->m_Supply->MovLimitStop(AxisConfig::ActiveDirect::FRONT); -// } -// -// -// ImGui::EndGroup(); -// ImGui::EndChild(); -// -// MotionDrawAssist assit; -// -// AxisStateValue loadvalue; -// load->GetValue(loadvalue); -// AxisData axisData; -// m_SysParamWrapper->GetAxisData(axisData); -// float loadposdif = axisData.LoadAxisTrackCleanPos - axisData.LoadAxisTrackPrintPos; -// if (loadposdif != 0.0f)assit.loadRPos = (loadvalue.Pos - axisData.LoadAxisTrackPrintPos) / loadposdif; -// else assit.loadRPos = 0.0f; -// -// assit.loadRPos = assit.loadRPos > 1.0f ? 1.0f : assit.loadRPos; -// assit.loadRPos = assit.loadRPos < 0.0f ? 0.0f : assit.loadRPos; -// -// /*assit.loadRPos = load->m_RPos>1.0f ? 1.0f : load->m_RPos; -// int cylinderState = m_SignalState.m_CylinderState; -// if (cylinderState == CylinderInCleanUnConnectBox || -// cylinderState == CylinderInCleanConnectedBox || -// cylinderState == CylinderInHand) { -// assit.loadRPos = 1.0f; -// }*/ -// -// assit.moldRpos = mold->m_RPos>1.0f ? 1.0f : mold->m_RPos; -// assit.armRPos = arm->m_RPos; -// assit.isCleanPressure = true; -// assit.isPrintPressure = true; -// assit.isPrintMoldSupprt = false; -// assit.isPrintJackup = false; -// assit.isInPrintPos = (m_SignalState.m_CylinderState == CylinderInPrintLoaded || m_SignalState.m_CylinderState == CylinderInPrintUnLoaded); -// assit.isCleanClose = true; -// if (m_IOCfgWrapper->m_Clean3RCylinderContact)assit.isCleanConnect = m_IOCfgWrapper->m_Clean3RCylinderContact->IsActive(); -// ImGui::Powder1500V1(assit); -// ImGui::EndGroup(); -// -// ImGui::SameLine(); -// ImGui::BeginGroup(); -// ImGui::Dummy(ImVec2(0, 170)); -// ImGui::RadioButton(_(u8"铺粉臂").c_str(), &kb, GTS_AXIS_ID_ARM); -// if (IsArmCanMoveBack()) { -// ImGui::PushID("ArmMovPointBack"); -// if (ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::UP_ARROW_GREEN]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) -// { -// m_Axis->m_Arm->MovPoint(AxisConfig::ActiveDirect::BACK); -// } -// ImGui::PopID(); -// if (ImGui::IsItemHovered()) { -// ImGui::SetTooltip(_(u8"铺粉轴后移 %.3fmm").c_str(), armCfgVal.rel / 1000.0f); -// } -// if (kb == GTS_AXIS_ID_ARM && !continue_move) { -// if (ImGui::IsWindowFocused() && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_UpArrow), false)) { -// m_Axis->m_Arm->MovPoint(AxisConfig::ActiveDirect::BACK); -// } -// } -// } -// else { -// ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::UP_ARROW_RED]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); -// if (ImGui::IsItemHovered()) { -// ImGui::SetTooltip(GetArmCanotMoveBackInfo().c_str()); -// } -// } -// -// ImGui::SameLine(); -// if (IsArmCanMoveBack()) { -// ImGui::PushID("ArmMoveLimitBack"); -// if (ImGui::ImageButtonEx(chartletManager->m_TextureMap[ChartletManager::UP_ARROW_GREEN_BAR]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) -// { -// if (!m_PowderAssist.isArmBackRepeat) { -// m_PowderAssist.isArmBackRepeat = true; -// m_Axis->m_Arm->MovLimitStart(AxisConfig::ActiveDirect::BACK); -// } -// } -// else { -// if (m_PowderAssist.isArmBackRepeat) -// { -// m_Axis->m_Arm->MovLimitStop(AxisConfig::ActiveDirect::BACK); -// m_PowderAssist.isArmBackRepeat = false; -// } -// } -// ImGui::PopID(); -// -// if (ImGui::IsItemHovered()) { -// ImGui::SetTooltip(_(u8"铺粉轴后连续").c_str()); -// } -// } -// else { -// ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::UP_ARROW_RED_BAR]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); -// if (ImGui::IsItemHovered()) { -// ImGui::SetTooltip(GetArmCanotMoveBackInfo().c_str()); -// } -// if (m_PowderAssist.isArmBackRepeat) { -// m_Axis->m_Arm->MovLimitStop(AxisConfig::ActiveDirect::BACK); -// m_PowderAssist.isArmBackRepeat = false; -// } -// } -// if (kb == GTS_AXIS_ID_ARM && continue_move) { -// if (ImGui::IsWindowFocused() && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_UpArrow), false)) -// { -// if (IsArmCanMoveBack()) { -// m_Axis->m_Arm->MovLimitStart(AxisConfig::ActiveDirect::BACK); -// } -// else { -// g_Toast->AddToast(new ToastBean(GetArmCanotMoveBackInfo(), 5000, Toast::COLOR_ORANGE)); -// } -// } -// if (ImGui::IsWindowFocused() && ImGui::IsKeyReleased(ImGui::GetKeyIndex(ImGuiKey_UpArrow))) -// { -// m_Axis->m_Arm->MovLimitStop(AxisConfig::ActiveDirect::BACK); -// } -// } -// -// if (IsArmCanMoveFront()) { -// ImGui::PushID("ArmMovPointFront"); -// if (ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::DOWN_ARROW_GREEN]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) { -// m_Axis->m_Arm->MovPoint(AxisConfig::ActiveDirect::FRONT); -// } -// ImGui::PopID(); -// if (ImGui::IsItemHovered()) { -// ImGui::SetTooltip(_(u8"铺粉轴前移 %.3fmm").c_str(), armCfgVal.rel / 1000.0f); -// } -// -// if (kb == GTS_AXIS_ID_ARM && !continue_move) { -// if (ImGui::IsWindowFocused() && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_DownArrow), false)) { -// m_Axis->m_Arm->MovPoint(AxisConfig::ActiveDirect::FRONT); -// } -// } -// } -// else { -// ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::DOWN_ARROW_RED]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); -// if (ImGui::IsItemHovered()) { -// ImGui::SetTooltip(GetArmCanotMoveFrontInfo().c_str()); -// } -// } -// -// ImGui::SameLine(); -// -// if (IsArmCanMoveFront()) { -// ImGui::PushID("ArmMoveLimitFront"); -// if (ImGui::ImageButtonEx(chartletManager->m_TextureMap[ChartletManager::DOWN_ARROW_GREEN_BAR]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) { -// if (!m_PowderAssist.isArmFrontRepeat) { -// m_PowderAssist.isArmFrontRepeat = true; -// m_Axis->m_Arm->MovLimitStart(AxisConfig::ActiveDirect::FRONT); -// } -// } -// else { -// if (m_PowderAssist.isArmFrontRepeat) -// { -// m_Axis->m_Arm->MovLimitStop(AxisConfig::ActiveDirect::FRONT); -// m_PowderAssist.isArmFrontRepeat = false; -// } -// } -// ImGui::PopID(); -// if (ImGui::IsItemHovered()) { -// ImGui::SetTooltip(_(u8"铺粉轴前连续").c_str()); -// } -// } -// else { -// ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::DOWN_ARROW_RED_BAR]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); -// if (ImGui::IsItemHovered()) { -// ImGui::SetTooltip(GetArmCanotMoveBackInfo().c_str()); -// } -// if (m_PowderAssist.isArmFrontRepeat) { -// m_Axis->m_Arm->MovLimitStop(AxisConfig::ActiveDirect::FRONT); -// m_PowderAssist.isArmFrontRepeat = false; -// } -// } -// if (kb == GTS_AXIS_ID_ARM && continue_move) { -// if (ImGui::IsWindowFocused() && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_DownArrow), false)) { -// if (IsArmCanMoveFront()) { -// m_Axis->m_Arm->MovLimitStart(AxisConfig::ActiveDirect::FRONT); -// } -// else { -// g_Toast->AddToast(new ToastBean(GetArmCanotMoveBackInfo(), 5000, Toast::COLOR_ORANGE)); -// } -// } -// if (ImGui::IsWindowFocused() && ImGui::IsKeyReleased(ImGui::GetKeyIndex(ImGuiKey_DownArrow))) -// m_Axis->m_Arm->MovLimitStop(AxisConfig::ActiveDirect::FRONT); -// } -// -// ImGui::PushID("arm_to_zero"); -// if (ImGui::ImageButton(chartletManager->m_ToZero->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) -// arm->SetZeroPos(); -// ImGui::PopID(); -// if (ImGui::IsItemHovered()) { -// ImGui::SetTooltip(_(u8"铺粉轴位置清零").c_str()); -// } -// if (m_AxisRecordWrapper->m_PCArmOverLimitAlarm->GetValue()) -// { -// ImGui::SameLine(); -// ImGui::PushID("arm_alarm_remove"); -// if (ImGui::ImageButton(chartletManager->m_AlarmRemove->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) -// { -// m_AxisRecordWrapper->m_PCArmOverLimitAlarmRemove->SetValue(true); -// } -// ImGui::PopID(); -// if (ImGui::IsItemHovered()) { -// ImGui::SetTooltip(_(u8"铺粉轴越限解除").c_str()); -// } -// } -// ImGui::Dummy(ImVec2(0, 35)); -// ImGui::RadioButton(_(u8"成型缸").c_str(), &kb, GTS_AXIS_ID_MOLD); -// if (IsMoldCanMoveUp()) { -// ImGui::PushID("MoldMovePointUp"); -// if (ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::UP_ARROW_GREEN]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) { -// m_Axis->m_Mold->MovPoint(AxisConfig::ActiveDirect::UP); -// g_log->TraceInfo(_(u8"升降[%.3f]往上移动%.3f").c_str(), mold->GetShowPos(), moldCfgVal.rel); -// } -// ImGui::PopID(); -// if (ImGui::IsItemHovered()) { -// ImGui::SetTooltip(_(u8"成型缸上移 %.3fmm").c_str(), moldCfgVal.rel / 1000.0f); -// } -// if (kb == GTS_AXIS_ID_MOLD && !continue_move) { -// if (ImGui::IsWindowFocused() && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_UpArrow), false)) { -// m_Axis->m_Mold->MovPoint(AxisConfig::ActiveDirect::UP); -// g_log->TraceInfo(_(u8"升降[%.3f]往上移动%.3f").c_str(), mold->GetShowPos(), moldCfgVal.rel); -// } -// } -// } -// else { -// ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::UP_ARROW_RED]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); -// if (ImGui::IsItemHovered()) { -// ImGui::SetTooltip(GetMoldCanotUpInfo().c_str()); -// } -// } -// -// ImGui::SameLine(); -// if (IsMoldCanMoveUp()) { -// ImGui::PushID("MoldMoveLimitUp"); -// if (ImGui::ImageButtonEx(chartletManager->m_TextureMap[ChartletManager::UP_ARROW_GREEN_BAR]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) { -// if (!m_PowderAssist.isMoldUpRepeat) { -// m_PowderAssist.isMoldUpRepeat = true; -// m_Axis->m_Mold->MovLimitStart(AxisConfig::ActiveDirect::UP); -// g_log->TraceInfo(_(u8"升降[%.3f]往上连续移动").c_str(), mold->GetShowPos()); -// } -// } -// else { -// if (m_PowderAssist.isMoldUpRepeat) -// { -// m_Axis->m_Mold->MovLimitStop(AxisConfig::ActiveDirect::UP); -// m_PowderAssist.isMoldUpRepeat = false; -// } -// } -// ImGui::PopID(); -// if (ImGui::IsItemHovered()) { -// ImGui::SetTooltip(_(u8"成型缸上连续").c_str()); -// } -// } -// else { -// ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::UP_ARROW_RED_BAR]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); -// if (ImGui::IsItemHovered()) { -// ImGui::SetTooltip(GetMoldCanotUpInfo().c_str()); -// } -// if (m_PowderAssist.isMoldUpRepeat) { -// m_Axis->m_Mold->MovLimitStop(AxisConfig::ActiveDirect::UP); -// m_PowderAssist.isMoldUpRepeat = false; -// } -// } -// if (kb == GTS_AXIS_ID_MOLD && continue_move) { -// if (ImGui::IsWindowFocused() && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_UpArrow), false)) { -// if (IsMoldCanMoveUp()) { -// m_Axis->m_Mold->MovLimitStart(AxisConfig::ActiveDirect::UP); -// g_log->TraceInfo(_(u8"升降[%.3f]往上连续移动").c_str(), mold->GetShowPos()); -// } -// else { -// g_Toast->AddToast(new ToastBean(GetMoldCanotUpInfo(), 5000, Toast::COLOR_ORANGE)); -// } -// } -// if (ImGui::IsWindowFocused() && ImGui::IsKeyReleased(ImGui::GetKeyIndex(ImGuiKey_UpArrow))) -// m_Axis->m_Mold->MovLimitStop(AxisConfig::ActiveDirect::UP); -// } -// -// if (IsMoldCanMoveDown()) { -// ImGui::PushID("MoldMovePointDown"); -// if (ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::DOWN_ARROW_GREEN]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) -// { -// m_Axis->m_Mold->MovPoint(AxisConfig::ActiveDirect::DOWN); -// g_log->TraceInfo(_(u8"升降[%.3f]往下移动%.3f").c_str(), mold->GetShowPos(), moldCfgVal.rel); -// } -// ImGui::PopID(); -// if (ImGui::IsItemHovered()) { -// ImGui::SetTooltip(_(u8"成型缸下移 %.3fmm").c_str(), moldCfgVal.rel / 1000.0f); -// } -// if (kb == GTS_AXIS_ID_MOLD && !continue_move) { -// if (ImGui::IsWindowFocused() && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_DownArrow), false)) { -// m_Axis->m_Mold->MovPoint(AxisConfig::ActiveDirect::DOWN); -// g_log->TraceInfo(_(u8"升降[%.3f]往下移动%.3f").c_str(), mold->GetShowPos(), moldCfgVal.rel); -// } -// } -// } -// else { -// ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::DOWN_ARROW_RED]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); -// if (ImGui::IsItemHovered()) { -// ImGui::SetTooltip(GetMoldCanotDownInfo().c_str()); -// } -// } -// -// ImGui::SameLine(); -// -// if (IsMoldCanMoveDown()) { -// ImGui::PushID("MoldMoveLimitDown"); -// if (ImGui::ImageButtonEx(chartletManager->m_TextureMap[ChartletManager::DOWN_ARROW_GREEN_BAR]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) -// { -// if (!m_PowderAssist.isMoldDownRepeat) { -// m_PowderAssist.isMoldDownRepeat = true; -// m_Axis->m_Mold->MovLimitStart(AxisConfig::ActiveDirect::DOWN); -// g_log->TraceInfo(_(u8"升降[%.3f]往下连续移动").c_str(), mold->GetShowPos()); -// } -// } -// else { -// if (m_PowderAssist.isMoldDownRepeat) -// { -// m_Axis->m_Mold->MovLimitStop(AxisConfig::ActiveDirect::DOWN); -// m_PowderAssist.isMoldDownRepeat = false; -// } -// } -// ImGui::PopID(); -// if (ImGui::IsItemHovered()) { -// ImGui::SetTooltip(_(u8"成型缸下连续").c_str()); -// } -// -// } -// else { -// ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::DOWN_ARROW_RED_BAR]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); -// if (ImGui::IsItemHovered()) { -// ImGui::SetTooltip(GetMoldCanotDownInfo().c_str()); -// } -// if (m_PowderAssist.isMoldDownRepeat) { -// m_Axis->m_Mold->MovLimitStop(AxisConfig::ActiveDirect::DOWN); -// m_PowderAssist.isMoldDownRepeat = false; -// } -// } -// if (kb == GTS_AXIS_ID_MOLD && continue_move) { -// if (ImGui::IsWindowFocused() && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_DownArrow), false)) -// { -// if (IsMoldCanMoveDown()) { -// m_Axis->m_Mold->MovLimitStart(AxisConfig::ActiveDirect::DOWN); -// g_log->TraceInfo(_(u8"升降[%.3f]往连续下移动").c_str(), mold->GetShowPos()); -// } -// else -// { -// g_Toast->AddToast(new ToastBean(GetMoldCanotDownInfo(), 5000, Toast::COLOR_ORANGE)); -// } -// -// } -// if (ImGui::IsWindowFocused() && ImGui::IsKeyReleased(ImGui::GetKeyIndex(ImGuiKey_DownArrow))) -// { -// m_Axis->m_Mold->MovLimitStop(AxisConfig::ActiveDirect::DOWN); -// } -// } -// ImGui::PushID("mold_to_zero"); -// if (ImGui::ImageButton(chartletManager->m_ToZero->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) -// mold->SetZeroPos(); -// ImGui::PopID(); -// if (ImGui::IsItemHovered()) { -// ImGui::SetTooltip(_(u8"成型缸位置清零").c_str()); -// } -// ImGui::EndGroup(); -// -// ImGui::EndChild(); -// -// ImGui::End(); -// -//} +//{} + +void HBD1200::DrawPowderCtrl(bool* winShow) +{ + ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(4, 8)); + ImGui::Begin(_(u8"铺粉装置调试").c_str(), winShow, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoDocking | ImGuiWindowFlags_NoNav); + ImGui::PopStyleVar(); + + int dstepflag = 1; + double fstepflag = 1.0; + long lstepflag = 1; + static int kb = GTS_AXIS_ID_ARM; + static bool continue_move = false; + + //CoverCfg* coverCfg = m_CoverCfg; + MainAxisState* pMold = m_Axis->m_Mold->GetState(); + //MainAxisState* ele = m_Axis->m_Clean->GetState(); + AxisState* pLoad = m_Axis->m_Load->GetState(); + AxisState* pArm = m_Axis->m_Arm->GetState(); + AxisState* pSupply = m_Axis->m_Supply->GetState(); + + AxisConfig* armCfg = m_Axis->m_Arm->GetConfig(); + AxisConfig::CfgValue armCfgVal; + armCfg->GetValue(armCfgVal); + AxisConfig* moldCfg = m_Axis->m_Mold->GetConfig(); + AxisConfig::CfgValue moldCfgVal; + moldCfg->GetValue(moldCfgVal); + //AxisConfig* cleanCfg = m_Axis->m_Clean->GetConfig(); + //AxisConfig::CfgValue cleanCfgVal; + //cleanCfg->GetValue(cleanCfgVal); + AxisConfig* loadCfg = m_Axis->m_Load->GetConfig(); + AxisConfig::CfgValue loadCfgVal; + loadCfg->GetValue(loadCfgVal); + AxisConfig* supplyCfg = m_Axis->m_Supply->GetConfig(); + AxisConfig::CfgValue supplyCfgVal; + supplyCfg->GetValue(supplyCfgVal); + + ChartletManager* chartletManager = ChartletManager::GetInstance(); + ImVec2 wpos = ImGui::GetWindowPos(); + SignalService::GetInstance().GetSignalState(m_SignalState); + if (m_PowderAssist.isLeftExpand) + { + ImGui::BeginGroup(); + vector tabs; + tabs.push_back(_(u8"成型缸")); + tabs.push_back(_(u8"移载轴")); + tabs.push_back(_(u8"铺粉轴")); + tabs.push_back(_(u8"供粉轴")); + tabs.push_back(_(u8"铺粉")); + tabs.push_back(_(u8"控制")); + float tabwidth = 0.f; + for (size_t tindex = 0; tindex < tabs.size(); tindex++) { + tabwidth = tabwidth + ImGui::CalcTextSize(tabs[tindex].c_str(), 0).x + 15; + } + ImVec2 showSize = ImVec2(tabwidth, 600); + + ImGui::BeginChild("AxisSettingChild", showSize, false, ImGuiWindowFlags_NoNav); + ImGui::BeginTabBar("AxisSetting"); + if (ImGui::BeginTabItem(_(u8"成型缸").c_str())) { + ImGui::PushItemWidth(100); + if (ImGui::InputScalar(_(u8"速度(mm/s)").c_str(), ImGuiDataType_Float, &moldCfgVal.speed, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) + { + moldCfg->m_Speed->SetValue(moldCfgVal.speed); + g_log->TraceInfo(_(u8"更改成型缸速度:%.3f").c_str(), moldCfgVal.speed); + } + if (ImGui::InputScalar(_(u8"加速度(m/s²)").c_str(), ImGuiDataType_Float, &moldCfgVal.acc, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) + { + moldCfg->m_Acc->SetValue(moldCfgVal.acc); + g_log->TraceInfo(_(u8"更改成型缸加速度:%.3f").c_str(), moldCfgVal.acc); + } + if (ImGui::InputScalar(_(u8"减速度(m/s2)").c_str(), ImGuiDataType_Float, &moldCfgVal.dec, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) + { + moldCfg->m_Dec->SetValue(moldCfgVal.dec); + g_log->TraceInfo(_(u8"更新成型缸减速度:%.3f").c_str(), moldCfgVal.dec); + } + if (ImGui::InputScalar(_(u8"点动行程(μm)").c_str(), ImGuiDataType_Float, &moldCfgVal.rel, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) { + moldCfg->m_RefDistance->SetValue(moldCfgVal.rel); + g_log->TraceInfo(_(u8"更改成型缸点动行程:%.3f").c_str(), moldCfgVal.rel); + } + ImGui::PopItemWidth(); + + if ((g_Admin > USER_ADMIN)) { + ImGui::Dummy(ImVec2(0, 20)); + if (pMold->m_MoveAbsPos) + { + if (m_SysParamWrapper->m_MoldAbsTestPos->GetValue() == 0) + { + if (ImGui::ImageButton(chartletManager->m_MoldMoveDownesting->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) + { + m_Axis->m_Mold->GetCtrl()->m_MoveAbsPos->SetValue(false); + g_log->TraceInfo(_(u8"中断打印升降轴移动到安全位").c_str()); + } + if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"打印升降轴移动到安全位").c_str()); + } + else { + ImGui::ImageButton(chartletManager->m_MoldMoveDownestDisable->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); + if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"不能执行打印升降轴移动到安全位").c_str()); + } + } + else { + if (ImGui::ImageButton(chartletManager->m_MoldMoveDownestEnable->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) + { + m_SysParamWrapper->m_MoldAbsTestPos->SetValue(0); + m_Axis->m_Mold->GetCtrl()->m_MoveAbsPos->SetValue(true); + g_log->TraceInfo(_(u8"执行打印升降轴移动到安全位").c_str()); + } + if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"打印升降轴移动到安全位").c_str()); + } + + ImGui::SameLine(); + + if (pMold->m_MoveAbsPos) + { + if (m_SysParamWrapper->m_MoldAbsTestPos->GetValue() == 3) + { + if (ImGui::ImageButton(chartletManager->m_MoldMovePlatformBottoming->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) + { + m_Axis->m_Mold->GetCtrl()->m_MoveAbsPos->SetValue(false); + g_log->TraceInfo(_(u8"中断打印轴移动到底座缸平面位").c_str()); + } + if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"中断打印轴移动到底座缸平面位").c_str()); + } + else { + ImGui::ImageButton(chartletManager->m_MoldMovePlatformBottomDisable->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); + if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"不能执行打印轴移动到底座缸平面位").c_str()); + } + } + else { + if (ImGui::ImageButton(chartletManager->m_MoldMovePlatformBottomEnable->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) + { + m_SysParamWrapper->m_MoldAbsTestPos->SetValue(3); + m_Axis->m_Mold->GetCtrl()->m_MoveAbsPos->SetValue(true); + g_log->TraceInfo(_(u8"执行打印轴移动到底座缸平面位").c_str()); + } + if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"打印轴移动到底座缸平面位").c_str()); + } + ImGui::SameLine(); + if (pMold->m_MoveAbsPos) + { + if (m_SysParamWrapper->m_MoldAbsTestPos->GetValue() == 4) + { + if (ImGui::ImageButton(chartletManager->m_MoldMovePlatforming->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) + { + m_Axis->m_Mold->GetCtrl()->m_MoveAbsPos->SetValue(false); + g_log->TraceInfo(_(u8"中断打印轴移动到基板缸平面位").c_str()); + } + if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"中断打印轴移动到基板缸平面位").c_str()); + + } + else { + ImGui::ImageButton(chartletManager->m_MoldMovePlatformDisable->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); + if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"不能执行打印轴移动到基板缸平面位").c_str()); + } + } + else { + if (ImGui::ImageButton(chartletManager->m_MoldMovePlatformEnable->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) + { + m_SysParamWrapper->m_MoldAbsTestPos->SetValue(4); + m_Axis->m_Mold->GetCtrl()->m_MoveAbsPos->SetValue(true); + g_log->TraceInfo(_(u8"执行打印轴移动到基板缸平面位").c_str()); + } + if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"打印轴移动到基板缸平面位").c_str()); + } + } + ImGui::EndTabItem(); + } + + if (ImGui::BeginTabItem(_(u8"移载轴").c_str())) { + ImGui::PushItemWidth(100); + if (ImGui::InputScalar(_(u8"速度(mm/s)").c_str(), ImGuiDataType_Float, &loadCfgVal.speed, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) + { + loadCfg->m_Speed->SetValue(loadCfgVal.speed); + g_log->TraceInfo(_(u8"更新移载轴速度:%.3f").c_str(), loadCfgVal.speed); + } + if (ImGui::InputScalar(_(u8"加速度(m/s²)").c_str(), ImGuiDataType_Float, &loadCfgVal.acc, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) + { + loadCfg->m_Acc->SetValue(loadCfgVal.acc); + g_log->TraceInfo(_(u8"更新移载轴加速度:%.3f").c_str(), loadCfgVal.acc); + } + if (ImGui::InputScalar(_(u8"减速度(m/s2)").c_str(), ImGuiDataType_Float, &loadCfgVal.dec, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) + { + loadCfg->m_Dec->SetValue(loadCfgVal.dec); + g_log->TraceInfo(_(u8"更新移载轴减速度:%.3f").c_str(), loadCfgVal.dec); + } + if (ImGui::InputScalar(_(u8"点动行程(μm)").c_str(), ImGuiDataType_Float, &loadCfgVal.rel, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) { + loadCfg->m_RefDistance->SetValue(loadCfgVal.rel); + g_log->TraceInfo(_(u8"更新移载轴点动距离:%.3f").c_str(), loadCfgVal.rel); + } + ImGui::PopItemWidth(); + if (g_Admin > USER_ADMIN) { + ImGui::Dummy(ImVec2(0, 20)); + + if (pLoad->m_MoveAbsPos) + { + if (m_SysParamWrapper->m_LoadAxisAbsTestPos->GetValue() == 3) + { + if (ImGui::ImageButton(chartletManager->m_LoadHandPosing->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) + { + m_Axis->m_Load->GetCtrl()->m_MoveAbsPos->SetValue(false); + g_log->TraceInfo(_(u8"中断移载轴移动到轨道吊装位").c_str()); + } + if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"中断移载轴移动到轨道吊装位").c_str()); + + } + else { + ImGui::ImageButton(chartletManager->m_LoadHandPosDisable->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); + if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"不能执行移载轴移动到轨道吊装位").c_str()); + } + } + else { + if (ImGui::ImageButton(chartletManager->m_LoadHandPosEnable->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) + { + m_SysParamWrapper->m_LoadAxisAbsTestPos->SetValue(3); + m_Axis->m_Load->GetCtrl()->m_MoveAbsPos->SetValue(true); + g_log->TraceInfo(_(u8"执行移载轴移动到轨道吊装位").c_str()); + } + if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"移载轴移动到轨道吊装位").c_str()); + } + + ImGui::SameLine(); + if (pLoad->m_MoveAbsPos) + { + if (m_SysParamWrapper->m_LoadAxisAbsTestPos->GetValue() == 1) + { + if (ImGui::ImageButton(chartletManager->m_LoadCleanPosing->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) + { + m_Axis->m_Load->GetCtrl()->m_MoveAbsPos->SetValue(false); + g_log->TraceInfo(_(u8"中断移载轴移动到轨道清粉位").c_str()); + } + if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"中断移载轴移动到轨道清粉位").c_str()); + + } + else { + ImGui::ImageButton(chartletManager->m_LoadCleanPosDisable->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); + if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"不能执行移载轴移动到轨道清粉位").c_str()); + } + } + else { + if (ImGui::ImageButton(chartletManager->m_LoadCleanPosEnable->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) + { + m_SysParamWrapper->m_LoadAxisAbsTestPos->SetValue(1); + m_Axis->m_Load->GetCtrl()->m_MoveAbsPos->SetValue(true); + g_log->TraceInfo(_(u8"执行移载轴移动到轨道清粉位").c_str()); + } + if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"移载轴移动到轨道清粉位").c_str()); + } + ImGui::SameLine(); + if (pLoad->m_MoveAbsPos) + { + if (m_SysParamWrapper->m_LoadAxisAbsTestPos->GetValue() == 0) + { + if (ImGui::ImageButton(chartletManager->m_LoadPrintPosing->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) + { + m_Axis->m_Load->GetCtrl()->m_MoveAbsPos->SetValue(false); + g_log->TraceInfo(_(u8"中断移载轴移动到轨道打印位").c_str()); + } + if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"中断移载轴移动到轨道打印位").c_str()); + + } + else { + ImGui::ImageButton(chartletManager->m_LoadPrintPosDisable->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); + if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"不能执行移载轴移动到轨道打印位").c_str()); + } + } + else { + if (ImGui::ImageButton(chartletManager->m_LoadPrintPosEnable->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) + { + m_SysParamWrapper->m_LoadAxisAbsTestPos->SetValue(0); + m_Axis->m_Load->GetCtrl()->m_MoveAbsPos->SetValue(true); + g_log->TraceInfo(_(u8"执行移载轴移动到轨道打印位").c_str()); + } + if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"移载轴移动到轨道打印位").c_str()); + } + } + + ImGui::EndTabItem(); + } + + if (ImGui::BeginTabItem(_(u8"铺粉轴").c_str())) { + ImGui::PushItemWidth(100); + if (ImGui::InputScalar(_(u8"速度(mm/s)").c_str(), ImGuiDataType_Float, &armCfgVal.speed, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) + { + armCfg->m_Speed->SetValue(armCfgVal.speed); + g_log->TraceInfo(_(u8"更新铺粉轴速度:%.3f").c_str(), armCfgVal.speed); + } + if (ImGui::InputScalar(_(u8"加速度(m/s²)").c_str(), ImGuiDataType_Float, &armCfgVal.acc, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) + { + armCfg->m_Acc->SetValue(armCfgVal.acc); + g_log->TraceInfo(_(u8"更新铺粉轴加速度:%.3f").c_str(), armCfgVal.acc); + } + if (ImGui::InputScalar(_(u8"减速度(m/s2)").c_str(), ImGuiDataType_Float, &armCfgVal.dec, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) + { + armCfg->m_Dec->SetValue(armCfgVal.dec); + g_log->TraceInfo(_(u8"更新铺粉轴减速度:%.3f").c_str(), armCfgVal.dec); + } + if (ImGui::InputScalar(_(u8"点动行程(μm)").c_str(), ImGuiDataType_Float, &armCfgVal.rel, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) { + armCfg->m_RefDistance->SetValue(armCfgVal.rel); + g_log->TraceInfo(_(u8"更新铺粉轴点动距离:%.3f").c_str(), armCfgVal.rel); + } + ImGui::PopItemWidth(); + if (g_Admin > USER_ADMIN) { + ImGui::Dummy(ImVec2(0, 20)); + + if (pArm->m_MoveAbsPos) + { + if (m_SysParamWrapper->m_ArmAbsTestPos->GetValue() == 0) + { + if (ImGui::ImageButton(chartletManager->m_ArmAcceptPosing->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) + { + m_Axis->m_Arm->GetCtrl()->m_MoveAbsPos->SetValue(false); + g_log->TraceInfo(_(u8"中断铺粉轴移动到接粉位").c_str()); + } + if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"中断铺粉轴移动到接粉位").c_str()); + + } + else { + ImGui::ImageButton(chartletManager->m_ArmAcceptPosDisable->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); + if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"不能执行铺粉轴移动到接粉位").c_str()); + } + } + else { + if (ImGui::ImageButton(chartletManager->m_ArmAcceptPosEnable->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) + { + m_SysParamWrapper->m_ArmAbsTestPos->SetValue(0); + m_Axis->m_Arm->GetCtrl()->m_MoveAbsPos->SetValue(true); + g_log->TraceInfo(_(u8"执行铺粉轴移动到接粉位").c_str()); + } + if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"铺粉轴移动到接粉位").c_str()); + } + ImGui::SameLine(); + if (pArm->m_MoveAbsPos) + { + if (m_SysParamWrapper->m_ArmAbsTestPos->GetValue() == 1) + { + if (ImGui::ImageButton(chartletManager->m_ArmFrontDropPosing->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) + { + m_Axis->m_Arm->GetCtrl()->m_MoveAbsPos->SetValue(false); + g_log->TraceInfo(_(u8"中断铺粉轴移动到前下粉位").c_str()); + } + if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"中断铺粉轴移动到前下粉位").c_str()); + + } + else { + ImGui::ImageButton(chartletManager->m_ArmFrontDropPosDisable->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); + if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"不能执行铺粉轴移动到前下粉位").c_str()); + } + } + else { + if (ImGui::ImageButton(chartletManager->m_ArmFrontDropPosEnable->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) + { + m_SysParamWrapper->m_ArmAbsTestPos->SetValue(1); + m_Axis->m_Arm->GetCtrl()->m_MoveAbsPos->SetValue(true); + g_log->TraceInfo(_(u8"执行铺粉轴移动到前下粉位").c_str()); + } + if (ImGui::IsItemHovered())ImGui::SetTooltip(_(u8"铺粉轴移动到前下粉位").c_str()); + } + } + + ImGui::EndTabItem(); + } + + if (ImGui::BeginTabItem(_(u8"供粉轴").c_str())) { + ImGui::PushItemWidth(100); + if (ImGui::InputScalar(_(u8"速度(mm/s)").c_str(), ImGuiDataType_Float, &supplyCfgVal.speed, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) + { + supplyCfg->m_Speed->SetValue(supplyCfgVal.speed); + g_log->TraceInfo(_(u8"更新下粉轴速度:%.3f").c_str(), supplyCfgVal.speed); + } + if (ImGui::InputScalar(_(u8"加速度(m/s²)").c_str(), ImGuiDataType_Float, &supplyCfgVal.acc, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) + { + supplyCfg->m_Acc->SetValue(supplyCfgVal.acc); + g_log->TraceInfo(_(u8"更新下粉轴加速度:%.3f").c_str(), supplyCfgVal.acc); + } + if (ImGui::InputScalar(_(u8"减速度(m/s2)").c_str(), ImGuiDataType_Float, &supplyCfgVal.dec, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) + { + supplyCfg->m_Dec->SetValue(supplyCfgVal.dec); + g_log->TraceInfo(_(u8"更新下粉轴减速度:%.3f").c_str(), supplyCfgVal.dec); + } + if (ImGui::InputScalar(_(u8"粉格").c_str(), ImGuiDataType_Float, &supplyCfgVal.rel, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) { + supplyCfg->m_RefDistance->SetValue(supplyCfgVal.rel); + g_log->TraceInfo(_(u8"更新下粉轴相对移动距离:%.3f").c_str(), supplyCfgVal.rel); + } + ImGui::PopItemWidth(); + ImGui::EndTabItem(); + } + + if (ImGui::BeginTabItem(_(u8"铺粉").c_str())) { + AxisData ad; + vector ss = { _(u8"双向铺粉"),_(u8"单向铺粉"),_(u8"不铺粉") ,_(u8"双向铺粉2") ,_(u8"单向铺粉2"),_(u8"单向铺粉3") }; + m_SysParamWrapper->GetAxisData(ad); + ImGui::PushItemWidth(120); + if (ImGui::SemicolonCombo(_(u8"铺粉类型").c_str(), &ad.CoverType, ss)) { + m_SysParamWrapper->m_CoverType->SetValue(ad.CoverType); + g_log->TraceInfo(_(u8"更新铺粉方式:%d").c_str(), ad.CoverType); + } + + if (ImGui::InputFloat(_(u8"打印铺粉速度(mm/s)").c_str(), &ad.CoverSpeed, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) { + m_SysParamWrapper->m_CoverSpeed->SetValue(ad.CoverSpeed); + g_log->TraceInfo(_(u8"更新铺粉速度:%.3f").c_str(), ad.CoverSpeed); + } + if (ImGui::InputFloat(_(u8"打印单向铺粉返回变速(mm/s)").c_str(), &ad.CoverReturnSpeed, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) { + m_SysParamWrapper->m_CoverReturnSpeed->SetValue(ad.CoverReturnSpeed); + g_log->TraceInfo(_(u8"更新打印单向返回速度:%.3f").c_str(), ad.CoverReturnSpeed); + } + if (ImGui::InputFloat(_(u8"打印单向铺粉距离(mm)").c_str(), &ad.CoverDistance, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) { + m_SysParamWrapper->m_CoverDistance->SetValue(ad.CoverDistance); + g_log->TraceInfo(_(u8"更新打印单向铺粉距离:%.3f").c_str(), ad.CoverDistance); + } + if (ImGui::InputFloat(_(u8"打印铺粉层厚(μm)").c_str(), &ad.LayerThick, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) { + m_SysParamWrapper->m_LayerThick->SetValue(ad.LayerThick); + g_log->TraceInfo(_(u8"更新打印铺粉层厚:%.3f").c_str(), ad.LayerThick); + } + if (ImGui::InputFloat(_(u8"打印间隙补偿(μm)").c_str(), &ad.FixGap, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) { + m_SysParamWrapper->m_FixGap->SetValue(ad.FixGap); + g_log->TraceInfo(_(u8"更新打印间隙补偿:%.3f").c_str(), ad.FixGap); + } + if (ImGui::InputScalar(_(u8"打印铺粉格数").c_str(), ImGuiDataType_S16, &ad.SupplyCount, 0, 0, 0, ImGuiInputTextFlags_EnterReturnsTrue)) { + m_SysParamWrapper->m_SupplyCount->SetValue(ad.SupplyCount); + g_log->TraceInfo(_(u8"更新打印铺粉格数:%d").c_str(), ad.SupplyCount); + } + if (ImGui::InputScalar(_(u8"打印下粉时间(ms)").c_str(), ImGuiDataType_S16, &ad.SupplyTime, 0, 0, 0, ImGuiInputTextFlags_EnterReturnsTrue)) { + m_SysParamWrapper->m_SupplyTime->SetValue(ad.SupplyTime); + g_log->TraceInfo(_(u8"更新打印下粉时间:%d").c_str(), ad.SupplyTime); + } + if (ImGui::InputFloat(_(u8"铺粉调试层厚(μm)").c_str(), &ad.DebugLayerThick, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) { + m_SysParamWrapper->m_DebugLayerThick->SetValue(ad.DebugLayerThick); + g_log->TraceInfo(_(u8"更新铺粉调试层厚:%.3f").c_str(), ad.DebugLayerThick); + } + if (ImGui::InputFloat(_(u8"铺粉调试间隙(μm)").c_str(), &ad.DebugFixGap, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) { + m_SysParamWrapper->m_DebugFixGap->SetValue(ad.DebugFixGap); + g_log->TraceInfo(_(u8"更新铺粉调试间隙补偿:%.3f").c_str(), ad.DebugFixGap); + } + if (ImGui::InputScalar(_(u8"铺粉调试下粉时间(ms)").c_str(), ImGuiDataType_S16, &ad.DebugSupplyTime, 0, 0, 0, ImGuiInputTextFlags_EnterReturnsTrue)) { + m_SysParamWrapper->m_DebugSupplyTime->SetValue(ad.DebugSupplyTime); + g_log->TraceInfo(_(u8"更新铺粉调试下粉时间:%d").c_str(), ad.DebugSupplyTime); + } + if (ImGui::InputScalar(_(u8"铺粉调试格数").c_str(), ImGuiDataType_S16, &ad.DebugSupplyCount, 0, 0, 0, ImGuiInputTextFlags_EnterReturnsTrue)) { + m_SysParamWrapper->m_DebugSupplyCount->SetValue(ad.DebugSupplyCount); + g_log->TraceInfo(_(u8"更新铺粉调试格数:%d").c_str(), ad.DebugSupplyCount); + } + if (ImGui::InputFloat(_(u8"铺粉调试铺粉距离(mm)").c_str(), &ad.DebugCoverDistance, 0, 0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) { + m_SysParamWrapper->m_DebugCoverDistance->SetValue(ad.DebugCoverDistance); + g_log->TraceInfo(_(u8"更新铺粉调试距离:%.3f").c_str(), ad.DebugCoverDistance); + } + ImGui::PopItemWidth(); + + ImGui::Dummy(ImVec2(0, 20)); + if (m_SignalStateWrapper->m_IsCovering->GetValue()) { + ImGui::PushID("CoverTrigerStop"); + if (ImGui::Button(_(u8"停止").c_str(), ImVec2(-1, 0))) { + m_SignalStateWrapper->m_CoverTriger->SetValue(false); + g_log->TraceInfo(_(u8"停止铺粉调试").c_str()); + } + ImGui::PopID(); + } + else { + // if (m_Purifier->IsCoverWindSet()) + // { + // m_Purifier->ResetSlowWind(); + // } + if (ImGui::Button(_(u8"铺粉调试").c_str(), ImVec2(-1, 0))) { + if (m_SignalStateWrapper->m_CoverEnable->GetValue()) { + // if (m_ExtCfg->m_AutoCoverSlowWind && m_Purifier->IsWindActive()) { + // m_Purifier->SetCoverWind(true); + // } + m_SignalStateWrapper->m_IsCoverDebug->SetValue(true); + Sleep(50); + m_SignalStateWrapper->m_ManualCoverTest->SetValue(true); + Sleep(50); + g_log->TraceInfo(_(u8"执行铺粉调试").c_str()); + } + else { + g_Toast->AddToast(new ToastBean(_(u8"铺粉调试条件不成立").c_str(), 3000)); + } + } + } + ImGui::EndTabItem(); + } + if (g_Admin > USER_ADMIN) { + if (ImGui::BeginTabItem(_(u8"控制").c_str())) { + if (m_SignalStateWrapper->m_CylinderReachPrintRun->GetValue()) { + ImGui::PushID("CylinderReachPrintTrigerStop"); + if (ImGui::Button(_(u8"停止").c_str())) { + m_SignalStateWrapper->m_CylinderReachPrintTriger->SetValue(false); + } + ImGui::PopID(); + } + else { + + ImGui::PushItemFlag(ImGuiItemFlags_Disabled, !m_SignalStateWrapper->m_CylinderReachPrintEnable->GetValue()); + if (ImGui::Button(_(u8"移动缸体到打印位").c_str())) { + if (m_SignalStateWrapper->m_CylinderReachPrintEnable->GetValue()) { + m_SignalStateWrapper->m_CylinderReachPrintTriger->SetValue(true); + g_log->TraceInfo(_(u8"执行移动缸体到打印位").c_str()); + } + else { + g_Toast->AddToast(new ToastBean(_(u8"移动缸体到打印位条件不成立").c_str(), 3000)); + } + m_RunCfg->m_HadSetBasePlatformPoint = false; + } + ImGui::PopItemFlag(); + } + + if (m_SignalStateWrapper->m_CylinderReachCleanRun->GetValue()) { + ImGui::PushID("CylinderReachCleanTrigerStop"); + if (ImGui::Button(_(u8"停止").c_str())) { + m_SignalStateWrapper->m_CylinderReachCleanTriger->SetValue(false); + } + ImGui::PopID(); + } + else { + ImGui::PushItemFlag(ImGuiItemFlags_Disabled, !m_SignalStateWrapper->m_CylinderReachCleanEnable->GetValue()); + if (ImGui::Button(_(u8"移动缸体到清粉位").c_str())) { + if (m_SignalStateWrapper->m_CylinderReachCleanEnable->GetValue()) { + m_SignalStateWrapper->m_CylinderReachCleanTriger->SetValue(true); + g_log->TraceInfo(_(u8"执行移动缸体到清粉位").c_str()); + } + else { + g_Toast->AddToast(new ToastBean(_(u8"移动缸体到清粉位条件不成立").c_str(), 3000)); + } + + } + ImGui::PopItemFlag(); + } + + + if (m_SignalStateWrapper->m_CylinderPrintLoadRun->GetValue()) { + ImGui::PushID("CylinderPrintLoadTrigerStop"); + if (ImGui::Button(_(u8"停止").c_str())) { + m_SignalStateWrapper->m_CylinderPrintLoadTriger->SetValue(false); + } + ImGui::PopID(); + } + else { + ImGui::PushItemFlag(ImGuiItemFlags_Disabled, !m_SignalStateWrapper->m_CylinderPrintLoadEnable->GetValue()); + if (ImGui::Button(_(u8"缸体打印位装载").c_str())) { + if (m_SignalStateWrapper->m_CylinderPrintLoadEnable->GetValue()) { + m_SignalStateWrapper->m_CylinderPrintLoadTriger->SetValue(true); + g_log->TraceInfo(_(u8"执行缸体打印位装载").c_str()); + } + else { + g_Toast->AddToast(new ToastBean(_(u8"缸体打印位装载条件不成立").c_str(), 3000)); + } + m_RunCfg->m_HadSetBasePlatformPoint = false; + } + ImGui::PopItemFlag(); + } + + if (m_SignalStateWrapper->m_CylinderConnectCleanBoxRun->GetValue()) { + ImGui::PushID("CylinderConnectCleanBoxTrigerStop"); + if (ImGui::Button(_(u8"停止").c_str())) { + m_SignalStateWrapper->m_CylinderConnectCleanBoxTriger->SetValue(false); + } + ImGui::PopID(); + } + else { + ImGui::PushItemFlag(ImGuiItemFlags_Disabled, !m_SignalStateWrapper->m_CylinderConnectCleanBoxEnable->GetValue()); + if (ImGui::Button(_(u8"缸体连接清粉箱").c_str())) { + if (m_SignalStateWrapper->m_CylinderConnectCleanBoxEnable->GetValue()) { + m_SignalStateWrapper->m_CylinderConnectCleanBoxTriger->SetValue(true); + g_log->TraceInfo(_(u8"执行缸体连接清粉箱").c_str()); + } + else { + g_Toast->AddToast(new ToastBean(_(u8"缸体连接清粉箱条件不成立").c_str(), 3000)); + } + } + ImGui::PopItemFlag(); + } + + if (m_SignalStateWrapper->m_CylinderPrintUnloadRun->GetValue()) { + ImGui::PushID("CylinderPrintUnloadTrigerStop"); + if (ImGui::Button(_(u8"停止").c_str())) { + m_SignalStateWrapper->m_CylinderPrintUnloadTriger->SetValue(false); + } + ImGui::PopID(); + } + else { + ImGui::PushItemFlag(ImGuiItemFlags_Disabled, !m_SignalStateWrapper->m_CylinderPrintUnloadEnable->GetValue()); + if (ImGui::Button(_(u8"缸体打印位卸载").c_str())) { + if (m_SignalStateWrapper->m_CylinderPrintUnloadEnable->GetValue()) { + m_SignalStateWrapper->m_CylinderPrintUnloadTriger->SetValue(true); + g_log->TraceInfo(_(u8"执行缸体打印位卸载").c_str()); + } + else { + g_Toast->AddToast(new ToastBean(_(u8"缸体打印位卸载条件不成立").c_str(), 3000)); + } + m_RunCfg->m_HadSetBasePlatformPoint = false; + } + ImGui::PopItemFlag(); + } + + if (m_SignalStateWrapper->m_CylinderDisconnectCleanBoxRun->GetValue()) { + ImGui::PushID("CylinderDisconnectCleanBoxTrigerStop"); + if (ImGui::Button(_(u8"停止").c_str())) { + m_SignalStateWrapper->m_CylinderDisconnectCleanBoxTriger->SetValue(false); + } + ImGui::PopID(); + } + else { + ImGui::PushItemFlag(ImGuiItemFlags_Disabled, !m_SignalStateWrapper->m_CylinderDisconnectCleanBoxEnable->GetValue()); + if (ImGui::Button(_(u8"缸体脱离清粉箱").c_str())) { + if (m_SignalStateWrapper->m_CylinderDisconnectCleanBoxEnable->GetValue()) { + m_SignalStateWrapper->m_CylinderDisconnectCleanBoxTriger->SetValue(true); + g_log->TraceInfo(_(u8"执行缸体脱离清粉箱").c_str()); + } + else { + g_Toast->AddToast(new ToastBean(_(u8"缸体脱离清粉箱条件不成立").c_str(), 3000)); + } + } + ImGui::PopItemFlag(); + } + + ImGui::EndTabItem(); + } + } + ImGui::EndTabBar(); + ImGui::EndChild(); + + + if (ImGui::Button(_(u8"运动急停").c_str(), ImVec2(tabwidth, 0))) { + //m_Axis->StopAll(); + DataHandle::Instance()->SetPushMsg(AXISSTOPALL); + g_log->TraceInfo(_(u8"运动急停").c_str()); + } + + ImGui::EndGroup(); + ImGui::SameLine(); + } + + ImGui::BeginChild("AxisCtrl", ImVec2(840, 670)); + if (m_PowderAssist.isLeftExpand) { + if (ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::HNARROW]->GetTex(), ImVec2(38, 50), ImVec2(0, 0), ImVec2(1, 1), 0)) { + m_PowderAssist.isLeftExpand = !m_PowderAssist.isLeftExpand; + } + } + else { + if (ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::HEXPAND]->GetTex(), ImVec2(38, 50), ImVec2(0, 0), ImVec2(1, 1), 0)) { + m_PowderAssist.isLeftExpand = !m_PowderAssist.isLeftExpand; + } + } + + ImGui::SameLine(); + ImGui::BeginGroup(); + if (ImGui::ToggleButton(_(u8"连续运动").c_str(), continue_move)) + continue_move = !continue_move; + ImGui::SameLine(); + ImGui::Text(_(u8"连续运动").c_str()); + + ImGui::Dummy(ImVec2(0, 250)); + + if (ImGui::ImageButton(chartletManager->m_LoadOut->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) { + //LoadOut(); + DataHandle::Instance()->SetPushMsg(LOADOUT); + ImGui::OpenPopup(_(u8"移载载出").c_str()); + g_log->TraceInfo(_(u8"执行移出").c_str()); + } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_(u8"载出").c_str()); + } + ImGui::SameLine(); + if (ImGui::ImageButton(chartletManager->m_LoadIn->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) { + //LoadIn(); + DataHandle::Instance()->SetPushMsg(LOADIN); + ImGui::OpenPopup(_(u8"移载载入").c_str()); + g_log->TraceInfo(_(u8"执行移入").c_str()); + } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_(u8"载入").c_str()); + } + + MACHINEPARAM mp; + GetMachineParam(mp); + if (ImGui::BeginPopupModal(_(u8"移载载入").c_str(), NULL, ImGuiWindowFlags_AlwaysAutoResize)) { + if (GetLoadInProcStep() == In_Start) { + ImGui::Text(_(u8"移载开始载入").c_str()); + } + if (GetLoadInProcStep() == In_CylinderDisconnectCleanBox) { + ImGui::Text(_(u8"缸体与清粉箱分离中").c_str()); + } + if (GetLoadInProcStep() == In_CylinderReachPrint) { + ImGui::Text(_(u8"缸体到打印位运行中").c_str()); + } + if (GetLoadInProcStep() == In_CylinderPrintLoad) { + ImGui::Text(_(u8"缸体打印位装载运行中").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 (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 (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(); + } + } + + if (IsLoadIn()) { + if (ImGui::Button(_(u8"中断载入").c_str(), ImVec2(-1, 0))) + { + //InterceptLoad(); + DataHandle::Instance()->SetPushMsg(INTERCEPTLOAD); + } + } + ImGui::EndPopup(); + } + + + if (ImGui::BeginPopupModal(_(u8"移载载出").c_str(), NULL, ImGuiWindowFlags_AlwaysAutoResize)) { + if (GetLoadOutProcSetp() == Out_Start) + { + ImGui::Text(_(u8"移载开始载出").c_str()); + } + if (GetLoadOutProcSetp() == Out_CylinderPrintUnload) + { + ImGui::Text(_(u8"缸体打印位卸载运行中").c_str()); + } + if (GetLoadOutProcSetp() == Out_CylinderReachClean) + { + ImGui::Text(_(u8"缸体到清粉位运行中").c_str()); + } + if (GetLoadOutProcSetp() == Out_CylinderConnectCleanBox) + { + ImGui::Text(_(u8"缸体与清粉箱连接中").c_str()); + } + if (GetLoadOutProcSetp() == Out_CylinderReachHand) + { + ImGui::Text(_(u8"缸体与吊装位运行中").c_str()); + } + + if (GetLoadOutProcSetp() == Out_CylinderDisconnectCleanBox) + { + ImGui::Text(_(u8"缸体与清粉箱分离中").c_str()); + } + + if (mp.m_NeedWaitSelectOutPos) { + vector combtemp = { _(u8"清粉位"),_(u8"吊装位") }; + ImGui::PushItemWidth(120); + ImGui::SemicolonCombo(_(u8"选择载出位置").c_str(), &m_SelectOutPos, combtemp); + ImGui::PopItemWidth(); + ImGui::SameLine(); + if (ImGui::Button(_(u8"下一步").c_str())) + { + m_WaitSelectOutPosCommit = true; + } + } + + if (mp.m_WaitConnectBoxCommit) { + if (ImGui::Button(_(u8"执行缸体与清粉箱连接").c_str())) + { + SetWaitConnectBoxCommit(false); + } + } + + + 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 (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 (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(); + } + } + + if (IsLoadOut()) { + if (ImGui::Button(_(u8"中断载出").c_str(), ImVec2(-1, 0))) + { + //InterceptLoad(); + DataHandle::Instance()->SetPushMsg(INTERCEPTLOAD); + } + } + ImGui::EndPopup(); + } + + ImGui::Dummy(ImVec2(0, 80)); + ImGui::RadioButton(_(u8"移载轴").c_str(), &kb, GTS_AXIS_ID_LOAD); + if (IsLoadAxisCanMoveLeft()) + { + ImGui::PushID("LoadMovePointLeft"); + if (ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::LEFT_ARROW_GREEN]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) { + m_Axis->m_Load->MovPoint(AxisConfig::ActiveDirect::LEFT); + g_log->TraceInfo(_(u8"移载[%.3f]往左移动%.3f").c_str(), pLoad->GetShowPos(), loadCfgVal.rel); + } + ImGui::PopID(); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_(u8"移载轴左移 %.3fmm").c_str(), loadCfgVal.rel / 1000.0f); + } + if (kb == GTS_AXIS_ID_LOAD && !continue_move) { + if (ImGui::IsWindowFocused() && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_LeftArrow), false)) { + m_Axis->m_Load->MovPoint(AxisConfig::ActiveDirect::LEFT); + g_log->TraceInfo(_(u8"移载[%.3f]往左移动%.3f").c_str(), pLoad->GetShowPos(), loadCfgVal.rel); + } + } + } + else { + ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::LEFT_ARROW_RED]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(GetLoadAxisCanotMoveLeftInfo().c_str()); + } + } + + ImGui::SameLine(); + + if (IsLoadAxisCanMoveRight()) + { + ImGui::PushID("LoadMovePointRight"); + if (ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::RIGHT_ARROW_GREEN]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) + { + m_Axis->m_Load->MovPoint(AxisConfig::ActiveDirect::RIGHT); + g_log->TraceInfo(_(u8"移载[%.3f]往右移动%.3f").c_str(), pLoad->GetShowPos(), loadCfgVal.rel); + } + ImGui::PopID(); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_(u8"移载轴右移 %.3fmm").c_str(), loadCfgVal.rel); + } + if (kb == GTS_AXIS_ID_LOAD && !continue_move) { + if (ImGui::IsWindowFocused() && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_RightArrow), false)) { + m_Axis->m_Load->MovPoint(AxisConfig::ActiveDirect::RIGHT); + g_log->TraceInfo(_(u8"移载[%.3f]往右移动%.3f").c_str(), pLoad->GetShowPos(), loadCfgVal.rel); + } + } + } + else { + ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::RIGHT_ARROW_RED]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(GetLoadAxisCanotMoveRightInfo().c_str()); + } + } + + if (IsLoadAxisCanMoveLeft()) { + ImGui::PushID("LoadMoveLimitLeft"); + if (ImGui::ImageButtonEx(chartletManager->m_TextureMap[ChartletManager::LEFT_ARROW_GREEN_BAR]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) { + if (!m_PowderAssist.isLoadLeftRepeat) { + m_PowderAssist.isLoadLeftRepeat = true; + m_Axis->m_Load->MovLimitStart(AxisConfig::ActiveDirect::LEFT); + g_log->TraceInfo(_(u8"移载[%.3f]往左连续移动").c_str(), pLoad->GetShowPos()); + } + } + else { + if (m_PowderAssist.isLoadLeftRepeat) + { + m_Axis->m_Load->MovLimitStop(AxisConfig::ActiveDirect::LEFT); + m_PowderAssist.isLoadLeftRepeat = false; + } + } + ImGui::PopID(); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_(u8"移载轴左连续").c_str()); + } + } + else { + ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::LEFT_ARROW_RED_BAR]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(GetLoadAxisCanotMoveLeftInfo().c_str()); + } + if (m_PowderAssist.isLoadLeftRepeat) { + m_Axis->m_Load->MovLimitStop(AxisConfig::ActiveDirect::LEFT); + m_PowderAssist.isLoadLeftRepeat = false; + } + } + + if (kb == GTS_AXIS_ID_LOAD && continue_move) { + if (ImGui::IsWindowFocused() && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_LeftArrow), false)) { + if (IsLoadAxisCanMoveLeft()) { + m_Axis->m_Load->MovLimitStart(AxisConfig::ActiveDirect::LEFT); + g_log->TraceInfo(_(u8"移载[%.3f]往左连续移动").c_str(), pLoad->GetShowPos()); + } + else { + g_Toast->AddToast(new ToastBean(GetLoadAxisCanotMoveLeftInfo(), 5000, Toast::COLOR_ORANGE)); + } + } + if (ImGui::IsWindowFocused() && ImGui::IsKeyReleased(ImGui::GetKeyIndex(ImGuiKey_LeftArrow))) + m_Axis->m_Load->MovLimitStop(AxisConfig::ActiveDirect::LEFT); + } + + ImGui::SameLine(); + if (IsLoadAxisCanMoveRight()) { + ImGui::PushID("LoadMoveLimitRight"); + if (ImGui::ImageButtonEx(chartletManager->m_TextureMap[ChartletManager::RIGHT_ARROW_GREEN_BAR]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) + { + if (!m_PowderAssist.isLoadRightRepeat) { + m_PowderAssist.isLoadRightRepeat = true; + m_Axis->m_Load->MovLimitStart(AxisConfig::ActiveDirect::RIGHT); + g_log->TraceInfo(_(u8"移载[%.3f]往右连续移动").c_str(), pLoad->GetShowPos()); + } + + } + else { + if (m_PowderAssist.isLoadRightRepeat) + { + m_Axis->m_Load->MovLimitStop(AxisConfig::ActiveDirect::RIGHT); + m_PowderAssist.isLoadRightRepeat = false; + } + } + ImGui::PopID(); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_(u8"移载轴右连续").c_str()); + } + } + else { + ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::RIGHT_ARROW_RED_BAR]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(GetLoadAxisCanotMoveRightInfo().c_str()); + } + if (m_PowderAssist.isLoadRightRepeat) { + m_Axis->m_Load->MovLimitStop(AxisConfig::ActiveDirect::RIGHT); + m_PowderAssist.isLoadRightRepeat = false; + } + } + if (kb == GTS_AXIS_ID_LOAD && continue_move) { + if (ImGui::IsWindowFocused() && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_RightArrow), false)) + { + if (IsLoadAxisCanMoveRight()) { + m_Axis->m_Load->MovLimitStart(AxisConfig::ActiveDirect::RIGHT); + g_log->TraceInfo(_(u8"移载[%.3f]往右连续移动").c_str(), pLoad->GetShowPos()); + } + else { + g_Toast->AddToast(new ToastBean(GetLoadAxisCanotMoveRightInfo(), 5000, Toast::COLOR_ORANGE)); + } + } + if (ImGui::IsWindowFocused() && ImGui::IsKeyReleased(ImGui::GetKeyIndex(ImGuiKey_RightArrow))) + { + m_Axis->m_Load->MovLimitStop(AxisConfig::ActiveDirect::RIGHT); + } + } + ImGui::PushID("load_to_zero"); + if (ImGui::ImageButton(chartletManager->m_ToZero->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) + pLoad->SetZeroPos(); + ImGui::PopID(); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_(u8"移栽轴位置清零").c_str()); + } + + ImGui::EndGroup(); + + ImGui::SameLine(); + ImGui::BeginGroup(); + + //ImGui::Dummy(ImVec2(500,1)); + ImGui::BeginChild("SupplyCtrl", ImVec2(500, 160)); + ImGui::BeginGroup(); + ImGui::Text(_(u8"移栽轴:%.3f").c_str(), pLoad->GetShowPos() / 1000.0f); + ImGui::Text(_(u8"成型缸:%.3f").c_str(), pMold->GetShowPos() / 1000.0f); + ImGui::Text(_(u8"铺粉臂:%.3f").c_str(), pArm->GetShowPos() / 1000.0f); + ImGui::EndGroup(); + ImGui::SameLine(350); + ImGui::BeginGroup(); + ImGui::RadioButton(_(u8"供粉轴").c_str(), &kb, GTS_AXIS_ID_SUPPLY); + + + ImGui::PushID("SupplyMovePointFront"); + if (ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::DOWN_ARROW_GREEN]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) { + m_Axis->m_Supply->MovPoint(AxisConfig::ActiveDirect::FRONT); + } + ImGui::PopID(); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_(u8"下粉轴前转%.2f格").c_str(), supplyCfgVal.rel); + } + if (kb == GTS_AXIS_ID_SUPPLY && !continue_move) { + if (ImGui::IsWindowFocused() && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_DownArrow), false)) { + m_Axis->m_Supply->MovPoint(AxisConfig::ActiveDirect::FRONT); + } + } + ImGui::SameLine(); + ImGui::PushID("SupplyMoveLimitFront"); + if (ImGui::ImageButtonEx(chartletManager->m_TextureMap[ChartletManager::DOWN_ARROW_GREEN_BAR]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) { + if (!m_PowderAssist.isSupplyNegativeRepeat) { + m_PowderAssist.isSupplyNegativeRepeat = true; + m_Axis->m_Supply->MovLimitStart(AxisConfig::ActiveDirect::FRONT); + //OutputDebugString("left\n"); + } + } + else { + if (m_PowderAssist.isSupplyNegativeRepeat) + { + m_Axis->m_Supply->MovLimitStop(AxisConfig::ActiveDirect::FRONT); + m_PowderAssist.isSupplyNegativeRepeat = false; + //OutputDebugString("stop\n"); + } + } + ImGui::PopID(); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_(u8"供粉轴左连续").c_str()); + } + if (kb == GTS_AXIS_ID_SUPPLY && continue_move) { + if (ImGui::IsWindowFocused() && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_DownArrow), false)) { + m_Axis->m_Supply->MovLimitStart(AxisConfig::ActiveDirect::FRONT); + } + if (ImGui::IsWindowFocused() && ImGui::IsKeyReleased(ImGui::GetKeyIndex(ImGuiKey_DownArrow))) + m_Axis->m_Supply->MovLimitStop(AxisConfig::ActiveDirect::FRONT); + } + + + ImGui::EndGroup(); + ImGui::EndChild(); + + MotionDrawAssist assit; + + AxisStateValue loadvalue; + pLoad->GetValue(loadvalue); + AxisStateValue mold; + pMold->GetValue(mold); + AxisStateValue arm; + pArm->GetValue(arm); + AxisData axisData; + m_SysParamWrapper->GetAxisData(axisData); + float loadposdif = axisData.LoadAxisTrackCleanPos - axisData.LoadAxisTrackPrintPos; + if (loadposdif != 0.0f)assit.loadRPos = (loadvalue.Pos - axisData.LoadAxisTrackPrintPos) / loadposdif; + else assit.loadRPos = 0.0f; + + assit.loadRPos = assit.loadRPos > 1.0f ? 1.0f : assit.loadRPos; + assit.loadRPos = assit.loadRPos < 0.0f ? 0.0f : assit.loadRPos; + + /*assit.loadRPos = load->m_RPos>1.0f ? 1.0f : load->m_RPos; + int cylinderState = m_SignalState.m_CylinderState; + if (cylinderState == CylinderInCleanUnConnectBox || + cylinderState == CylinderInCleanConnectedBox || + cylinderState == CylinderInHand) { + assit.loadRPos = 1.0f; + }*/ + + + assit.moldRpos = mold.RPos>1.0f ? 1.0f : mold.RPos; + assit.armRPos = arm.RPos; + assit.isCleanPressure = true; + assit.isPrintPressure = true; + assit.isPrintMoldSupprt = false; + assit.isPrintJackup = false; + assit.isInPrintPos = (m_SignalState.m_CylinderState == CylinderInPrintLoaded || m_SignalState.m_CylinderState == CylinderInPrintUnLoaded); + assit.isCleanClose = true; + if (m_IOCfgWrapper->m_Clean3RCylinderContact)assit.isCleanConnect = m_IOCfgWrapper->m_Clean3RCylinderContact->IsActive(); + ImGui::Powder1500V1(assit); + ImGui::EndGroup(); + + ImGui::SameLine(); + ImGui::BeginGroup(); + ImGui::Dummy(ImVec2(0, 170)); + ImGui::RadioButton(_(u8"铺粉臂").c_str(), &kb, GTS_AXIS_ID_ARM); + if (IsArmCanMoveBack()) { + ImGui::PushID("ArmMovPointBack"); + if (ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::UP_ARROW_GREEN]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) + { + m_Axis->m_Arm->MovPoint(AxisConfig::ActiveDirect::BACK); + } + ImGui::PopID(); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_(u8"铺粉轴后移 %.3fmm").c_str(), armCfgVal.rel / 1000.0f); + } + if (kb == GTS_AXIS_ID_ARM && !continue_move) { + if (ImGui::IsWindowFocused() && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_UpArrow), false)) { + m_Axis->m_Arm->MovPoint(AxisConfig::ActiveDirect::BACK); + } + } + } + else { + ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::UP_ARROW_RED]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(GetArmCanotMoveBackInfo().c_str()); + } + } + + ImGui::SameLine(); + if (IsArmCanMoveBack()) { + ImGui::PushID("ArmMoveLimitBack"); + if (ImGui::ImageButtonEx(chartletManager->m_TextureMap[ChartletManager::UP_ARROW_GREEN_BAR]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) + { + if (!m_PowderAssist.isArmBackRepeat) { + m_PowderAssist.isArmBackRepeat = true; + m_Axis->m_Arm->MovLimitStart(AxisConfig::ActiveDirect::BACK); + } + } + else { + if (m_PowderAssist.isArmBackRepeat) + { + m_Axis->m_Arm->MovLimitStop(AxisConfig::ActiveDirect::BACK); + m_PowderAssist.isArmBackRepeat = false; + } + } + ImGui::PopID(); + + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_(u8"铺粉轴后连续").c_str()); + } + } + else { + ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::UP_ARROW_RED_BAR]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(GetArmCanotMoveBackInfo().c_str()); + } + if (m_PowderAssist.isArmBackRepeat) { + m_Axis->m_Arm->MovLimitStop(AxisConfig::ActiveDirect::BACK); + m_PowderAssist.isArmBackRepeat = false; + } + } + if (kb == GTS_AXIS_ID_ARM && continue_move) { + if (ImGui::IsWindowFocused() && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_UpArrow), false)) + { + if (IsArmCanMoveBack()) { + m_Axis->m_Arm->MovLimitStart(AxisConfig::ActiveDirect::BACK); + } + else { + g_Toast->AddToast(new ToastBean(GetArmCanotMoveBackInfo(), 5000, Toast::COLOR_ORANGE)); + } + } + if (ImGui::IsWindowFocused() && ImGui::IsKeyReleased(ImGui::GetKeyIndex(ImGuiKey_UpArrow))) + { + m_Axis->m_Arm->MovLimitStop(AxisConfig::ActiveDirect::BACK); + } + } + + if (IsArmCanMoveFront()) { + ImGui::PushID("ArmMovPointFront"); + if (ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::DOWN_ARROW_GREEN]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) { + m_Axis->m_Arm->MovPoint(AxisConfig::ActiveDirect::FRONT); + } + ImGui::PopID(); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_(u8"铺粉轴前移 %.3fmm").c_str(), armCfgVal.rel / 1000.0f); + } + + if (kb == GTS_AXIS_ID_ARM && !continue_move) { + if (ImGui::IsWindowFocused() && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_DownArrow), false)) { + m_Axis->m_Arm->MovPoint(AxisConfig::ActiveDirect::FRONT); + } + } + } + else { + ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::DOWN_ARROW_RED]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(GetArmCanotMoveFrontInfo().c_str()); + } + } + + ImGui::SameLine(); + + if (IsArmCanMoveFront()) { + ImGui::PushID("ArmMoveLimitFront"); + if (ImGui::ImageButtonEx(chartletManager->m_TextureMap[ChartletManager::DOWN_ARROW_GREEN_BAR]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) { + if (!m_PowderAssist.isArmFrontRepeat) { + m_PowderAssist.isArmFrontRepeat = true; + m_Axis->m_Arm->MovLimitStart(AxisConfig::ActiveDirect::FRONT); + } + } + else { + if (m_PowderAssist.isArmFrontRepeat) + { + m_Axis->m_Arm->MovLimitStop(AxisConfig::ActiveDirect::FRONT); + m_PowderAssist.isArmFrontRepeat = false; + } + } + ImGui::PopID(); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_(u8"铺粉轴前连续").c_str()); + } + } + else { + ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::DOWN_ARROW_RED_BAR]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(GetArmCanotMoveBackInfo().c_str()); + } + if (m_PowderAssist.isArmFrontRepeat) { + m_Axis->m_Arm->MovLimitStop(AxisConfig::ActiveDirect::FRONT); + m_PowderAssist.isArmFrontRepeat = false; + } + } + if (kb == GTS_AXIS_ID_ARM && continue_move) { + if (ImGui::IsWindowFocused() && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_DownArrow), false)) { + if (IsArmCanMoveFront()) { + m_Axis->m_Arm->MovLimitStart(AxisConfig::ActiveDirect::FRONT); + } + else { + g_Toast->AddToast(new ToastBean(GetArmCanotMoveBackInfo(), 5000, Toast::COLOR_ORANGE)); + } + } + if (ImGui::IsWindowFocused() && ImGui::IsKeyReleased(ImGui::GetKeyIndex(ImGuiKey_DownArrow))) + m_Axis->m_Arm->MovLimitStop(AxisConfig::ActiveDirect::FRONT); + } + + ImGui::PushID("arm_to_zero"); + if (ImGui::ImageButton(chartletManager->m_ToZero->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) + pArm->SetZeroPos(); + ImGui::PopID(); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_(u8"铺粉轴位置清零").c_str()); + } + if (m_AxisRecordWrapper->m_PCArmOverLimitAlarm->GetValue()) + { + ImGui::SameLine(); + ImGui::PushID("arm_alarm_remove"); + if (ImGui::ImageButton(chartletManager->m_AlarmRemove->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) + { + m_AxisRecordWrapper->m_PCArmOverLimitAlarmRemove->SetValue(true); + } + ImGui::PopID(); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_(u8"铺粉轴越限解除").c_str()); + } + } + ImGui::Dummy(ImVec2(0, 35)); + ImGui::RadioButton(_(u8"成型缸").c_str(), &kb, GTS_AXIS_ID_MOLD); + if (IsMoldCanMoveUp()) { + ImGui::PushID("MoldMovePointUp"); + if (ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::UP_ARROW_GREEN]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) { + m_Axis->m_Mold->MovPoint(AxisConfig::ActiveDirect::UP); + g_log->TraceInfo(_(u8"升降[%.3f]往上移动%.3f").c_str(), pMold->GetShowPos(), moldCfgVal.rel); + } + ImGui::PopID(); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_(u8"成型缸上移 %.3fmm").c_str(), moldCfgVal.rel / 1000.0f); + } + if (kb == GTS_AXIS_ID_MOLD && !continue_move) { + if (ImGui::IsWindowFocused() && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_UpArrow), false)) { + m_Axis->m_Mold->MovPoint(AxisConfig::ActiveDirect::UP); + g_log->TraceInfo(_(u8"升降[%.3f]往上移动%.3f").c_str(), pMold->GetShowPos(), moldCfgVal.rel); + } + } + } + else { + ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::UP_ARROW_RED]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(GetMoldCanotUpInfo().c_str()); + } + } + + ImGui::SameLine(); + if (IsMoldCanMoveUp()) { + ImGui::PushID("MoldMoveLimitUp"); + if (ImGui::ImageButtonEx(chartletManager->m_TextureMap[ChartletManager::UP_ARROW_GREEN_BAR]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) { + if (!m_PowderAssist.isMoldUpRepeat) { + m_PowderAssist.isMoldUpRepeat = true; + m_Axis->m_Mold->MovLimitStart(AxisConfig::ActiveDirect::UP); + g_log->TraceInfo(_(u8"升降[%.3f]往上连续移动").c_str(), pMold->GetShowPos()); + } + } + else { + if (m_PowderAssist.isMoldUpRepeat) + { + m_Axis->m_Mold->MovLimitStop(AxisConfig::ActiveDirect::UP); + m_PowderAssist.isMoldUpRepeat = false; + } + } + ImGui::PopID(); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_(u8"成型缸上连续").c_str()); + } + } + else { + ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::UP_ARROW_RED_BAR]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(GetMoldCanotUpInfo().c_str()); + } + if (m_PowderAssist.isMoldUpRepeat) { + m_Axis->m_Mold->MovLimitStop(AxisConfig::ActiveDirect::UP); + m_PowderAssist.isMoldUpRepeat = false; + } + } + if (kb == GTS_AXIS_ID_MOLD && continue_move) { + if (ImGui::IsWindowFocused() && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_UpArrow), false)) { + if (IsMoldCanMoveUp()) { + m_Axis->m_Mold->MovLimitStart(AxisConfig::ActiveDirect::UP); + g_log->TraceInfo(_(u8"升降[%.3f]往上连续移动").c_str(), pMold->GetShowPos()); + } + else { + g_Toast->AddToast(new ToastBean(GetMoldCanotUpInfo(), 5000, Toast::COLOR_ORANGE)); + } + } + if (ImGui::IsWindowFocused() && ImGui::IsKeyReleased(ImGui::GetKeyIndex(ImGuiKey_UpArrow))) + m_Axis->m_Mold->MovLimitStop(AxisConfig::ActiveDirect::UP); + } + + if (IsMoldCanMoveDown()) { + ImGui::PushID("MoldMovePointDown"); + if (ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::DOWN_ARROW_GREEN]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) + { + m_Axis->m_Mold->MovPoint(AxisConfig::ActiveDirect::DOWN); + g_log->TraceInfo(_(u8"升降[%.3f]往下移动%.3f").c_str(), pMold->GetShowPos(), moldCfgVal.rel); + } + ImGui::PopID(); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_(u8"成型缸下移 %.3fmm").c_str(), moldCfgVal.rel / 1000.0f); + } + if (kb == GTS_AXIS_ID_MOLD && !continue_move) { + if (ImGui::IsWindowFocused() && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_DownArrow), false)) { + m_Axis->m_Mold->MovPoint(AxisConfig::ActiveDirect::DOWN); + g_log->TraceInfo(_(u8"升降[%.3f]往下移动%.3f").c_str(), pMold->GetShowPos(), moldCfgVal.rel); + } + } + } + else { + ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::DOWN_ARROW_RED]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(GetMoldCanotDownInfo().c_str()); + } + } + + ImGui::SameLine(); + + if (IsMoldCanMoveDown()) { + ImGui::PushID("MoldMoveLimitDown"); + if (ImGui::ImageButtonEx(chartletManager->m_TextureMap[ChartletManager::DOWN_ARROW_GREEN_BAR]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) + { + if (!m_PowderAssist.isMoldDownRepeat) { + m_PowderAssist.isMoldDownRepeat = true; + m_Axis->m_Mold->MovLimitStart(AxisConfig::ActiveDirect::DOWN); + g_log->TraceInfo(_(u8"升降[%.3f]往下连续移动").c_str(), pMold->GetShowPos()); + } + } + else { + if (m_PowderAssist.isMoldDownRepeat) + { + m_Axis->m_Mold->MovLimitStop(AxisConfig::ActiveDirect::DOWN); + m_PowderAssist.isMoldDownRepeat = false; + } + } + ImGui::PopID(); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_(u8"成型缸下连续").c_str()); + } + + } + else { + ImGui::ImageButton(chartletManager->m_TextureMap[ChartletManager::DOWN_ARROW_RED_BAR]->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(GetMoldCanotDownInfo().c_str()); + } + if (m_PowderAssist.isMoldDownRepeat) { + m_Axis->m_Mold->MovLimitStop(AxisConfig::ActiveDirect::DOWN); + m_PowderAssist.isMoldDownRepeat = false; + } + } + if (kb == GTS_AXIS_ID_MOLD && continue_move) { + if (ImGui::IsWindowFocused() && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_DownArrow), false)) + { + if (IsMoldCanMoveDown()) { + m_Axis->m_Mold->MovLimitStart(AxisConfig::ActiveDirect::DOWN); + g_log->TraceInfo(_(u8"升降[%.3f]往连续下移动").c_str(), pMold->GetShowPos()); + } + else + { + g_Toast->AddToast(new ToastBean(GetMoldCanotDownInfo(), 5000, Toast::COLOR_ORANGE)); + } + + } + if (ImGui::IsWindowFocused() && ImGui::IsKeyReleased(ImGui::GetKeyIndex(ImGuiKey_DownArrow))) + { + m_Axis->m_Mold->MovLimitStop(AxisConfig::ActiveDirect::DOWN); + } + } + ImGui::PushID("mold_to_zero"); + if (ImGui::ImageButton(chartletManager->m_ToZero->GetTex(), ImVec2(60, 60), ImVec2(0, 0), ImVec2(1, 1), 0)) + pMold->SetZeroPos(); + ImGui::PopID(); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_(u8"成型缸位置清零").c_str()); + } + ImGui::EndGroup(); + + ImGui::EndChild(); + + ImGui::End(); + +} void HBD1200::DrawAnalogExt() { @@ -7040,195 +7053,195 @@ void HBD1200::GetAlarmState(SignalState& signalState) // //} // -//bool HBD1200::CheckPrintMoldReady() -//{ -// if (m_SignalStateWrapper->m_CylinderState->GetValue() != CylinderInPrintLoaded) -// { -// return false; -// } -// else return true; -//} -// -//bool HBD1200::IsLoadAxisCanMoveLeft() -//{ -// if (!m_SignalState.m_PrintJackupInSafePos)return false; -// if (!m_SignalState.m_LoadTorqueInsideLimit)return false; -// if (!m_SignalState.m_LoadPosInsideLeftSoftLimit)return false; -// if (!m_SignalState.m_CylinderFixInReleasePos)return false; -// if (!m_SignalState.m_LoadLeftNotInsideLimit)return false; -// if (!m_SignalState.m_LoadServoNoAlarm)return false; -// if (!m_SignalState.m_EleServoInBottomPos)return false; -// if (m_SignalState.m_HighPressureLackAlarm)return false; -// if (m_SignalState.m_SystemStopAlarm)return false; -// if (m_SignalState.m_CleanLiftStopAlarm)return false; -// if (m_Axis->m_Load->GetState()->m_AxisCfg->m_SafeLimit && !g_SystemInfo->m_EnvState.m_IsPrintCabinDoorClose)return false; -// return true; -//} -// -//string HBD1200::GetLoadAxisCanotMoveLeftInfo() { -// if (!m_SignalState.m_PrintJackupInSafePos)return _(u8"打印顶升轴不在安全位").c_str(); -// if (!m_SignalState.m_LoadTorqueInsideLimit)return _(u8"移载扭力越限").c_str(); -// if (!m_SignalState.m_LoadPosInsideLeftSoftLimit)return _(u8"移载轴越软左限").c_str(); -// if (!m_SignalState.m_CylinderFixInReleasePos)return _(u8"缸体固定气缸不在松开位").c_str(); -// if (!m_SignalState.m_LoadLeftNotInsideLimit)return _(u8"移载轴已到左限位").c_str(); -// if (!m_SignalState.m_LoadServoNoAlarm)return _(u8"移载轴伺服异常").c_str(); -// if (!m_SignalState.m_EleServoInBottomPos)return _(u8"电缸不在底座位").c_str(); -// if (m_SignalState.m_HighPressureLackAlarm)return _(u8"高压气不足报警").c_str(); -// if (m_SignalState.m_SystemStopAlarm)return _(u8"系统急停异常").c_str(); -// if (m_SignalState.m_CleanLiftStopAlarm)return _(u8"清粉急停异常").c_str(); -// if (m_Axis->m_Load->GetState()->m_AxisCfg->m_SafeLimit && !g_SystemInfo->m_EnvState.m_IsPrintCabinDoorClose)return _(u8"舱门打开时运动受限").c_str(); -// return _(u8"未知原因").c_str(); -//} -// -//bool HBD1200::IsLoadAxisCanMoveRight() -//{ -// if (!m_SignalState.m_PrintJackupInSafePos)return false; -// if (!m_SignalState.m_LoadTorqueInsideLimit)return false; -// if (!m_SignalState.m_LoadPosInsideRightSoftLimit)return false; -// if (!m_SignalState.m_CylinderFixInReleasePos)return false; -// if (!m_SignalState.m_LoadRightNotInsideLimit)return false; -// if (!m_SignalState.m_LoadServoNoAlarm)return false; -// if (!m_SignalState.m_EleServoInBottomPos)return false; -// if (m_SignalState.m_HighPressureLackAlarm)return false; -// if (m_SignalState.m_SystemStopAlarm)return false; -// if (m_SignalState.m_CleanLiftStopAlarm)return false; -// if (m_Axis->m_Load->GetState()->m_AxisCfg->m_SafeLimit && !g_SystemInfo->m_EnvState.m_IsPrintCabinDoorClose)return false; -// return true; -//} -// -//string HBD1200::GetLoadAxisCanotMoveRightInfo() { -// if (!m_SignalState.m_PrintJackupInSafePos)return _(u8"打印顶升轴不在安全位").c_str(); -// if (!m_SignalState.m_LoadTorqueInsideLimit)return _(u8"移载扭力越限").c_str(); -// if (!m_SignalState.m_LoadPosInsideRightSoftLimit)return _(u8"移载轴越软右限").c_str(); -// if (!m_SignalState.m_CylinderFixInReleasePos)return _(u8"缸体固定气缸不在松开位").c_str(); -// if (!m_SignalState.m_LoadRightNotInsideLimit)return _(u8"移载轴已到右限位").c_str(); -// if (!m_SignalState.m_LoadServoNoAlarm)return _(u8"移载轴伺服异常").c_str(); -// if (!m_SignalState.m_EleServoInBottomPos)return _(u8"电缸不在底座位").c_str(); -// if (m_SignalState.m_HighPressureLackAlarm)return _(u8"高压气不足报警").c_str(); -// if (m_SignalState.m_SystemStopAlarm)return _(u8"系统急停异常").c_str(); -// if (m_SignalState.m_CleanLiftStopAlarm)return _(u8"清粉急停异常").c_str(); -// if (m_Axis->m_Load->GetState()->m_AxisCfg->m_SafeLimit && !g_SystemInfo->m_EnvState.m_IsPrintCabinDoorClose)return _(u8"舱门打开时运动受限").c_str(); -// return _(u8"未知原因").c_str(); -//} -// -//bool HBD1200::IsArmCanMoveBack() -//{ -// if (!m_SignalState.m_PrintUpDownPosBelowPlatform)return false; -// if (!m_SignalState.m_ArmTorqueInsideLimit)return false; -// if (!m_SignalState.m_ArmPosInsideSoftBackLimit)return false; -// if (!m_SignalState.m_ArmPosInsideBackLimit)return false; -// if (!m_SignalState.m_ArmServoNoAlarm)return false; -// if (m_SignalState.m_HighPressureLackAlarm)return false; -// if (m_SignalState.m_SystemStopAlarm)return false; -// if (m_SignalState.m_CleanLiftStopAlarm)return false; -// if (m_Axis->m_Arm->GetState()->m_AxisCfg->m_SafeLimit && !g_SystemInfo->m_EnvState.m_IsPrintCabinDoorClose)return false; -// return true; -//} -// -//string HBD1200::GetArmCanotMoveBackInfo() -//{ -// if (!m_SignalState.m_PrintUpDownPosBelowPlatform)return _(u8"打印升降轴高于基板缸平面").c_str(); -// if (!m_SignalState.m_ArmTorqueInsideLimit)return _(u8"铺粉轴扭力越限").c_str(); -// if (!m_SignalState.m_ArmPosInsideSoftBackLimit)return _(u8"铺粉轴位置超过软后限").c_str(); -// if (!m_SignalState.m_ArmPosInsideBackLimit)return _(u8"铺粉轴已到后限位").c_str(); -// if (!m_SignalState.m_ArmServoNoAlarm)return _(u8"铺粉轴伺服异常").c_str(); -// if (m_SignalState.m_HighPressureLackAlarm)return _(u8"高压气不足报警").c_str(); -// if (m_SignalState.m_SystemStopAlarm)return _(u8"系统急停异常").c_str(); -// if (m_SignalState.m_CleanLiftStopAlarm)return _(u8"清粉急停异常").c_str(); -// if (m_Axis->m_Arm->GetState()->m_AxisCfg->m_SafeLimit && !g_SystemInfo->m_EnvState.m_IsPrintCabinDoorClose)return _(u8"舱门打开时运动受限").c_str(); -// return _(u8"未知原因").c_str(); -//} -// -//bool HBD1200::IsArmCanMoveFront() -//{ -// if (!m_SignalState.m_PrintUpDownPosBelowPlatform)return false; -// if (!m_SignalState.m_ArmTorqueInsideLimit)return false; -// if (!m_SignalState.m_ArmPosInsideSoftFrontLimit)return false; -// if (!m_SignalState.m_ArmPosInsideFrontLimit)return false; -// if (!m_SignalState.m_ArmServoNoAlarm)return false; -// if (m_SignalState.m_HighPressureLackAlarm)return false; -// if (m_SignalState.m_SystemStopAlarm)return false; -// if (m_SignalState.m_CleanLiftStopAlarm)return false; -// if (m_Axis->m_Arm->GetState()->m_AxisCfg->m_SafeLimit && !g_SystemInfo->m_EnvState.m_IsPrintCabinDoorClose)return false; -// return true; -//} -// -//string HBD1200::GetArmCanotMoveFrontInfo() -//{ -// if (!m_SignalState.m_PrintUpDownPosBelowPlatform)return _(u8"打印升降轴高于基板缸平面").c_str(); -// if (!m_SignalState.m_ArmTorqueInsideLimit)return _(u8"铺粉轴扭力越限").c_str(); -// if (!m_SignalState.m_ArmPosInsideSoftFrontLimit)return _(u8"铺粉轴位置超过软前限").c_str(); -// if (!m_SignalState.m_ArmPosInsideFrontLimit)return _(u8"铺粉轴已到前限位").c_str(); -// if (!m_SignalState.m_ArmServoNoAlarm)return _(u8"铺粉轴伺服异常").c_str(); -// if (m_SignalState.m_HighPressureLackAlarm)return _(u8"高压气不足报警").c_str(); -// if (m_SignalState.m_SystemStopAlarm)return _(u8"系统急停异常").c_str(); -// if (m_SignalState.m_CleanLiftStopAlarm)return _(u8"清粉急停异常").c_str(); -// if (m_Axis->m_Arm->GetState()->m_AxisCfg->m_SafeLimit && !g_SystemInfo->m_EnvState.m_IsPrintCabinDoorClose)return _(u8"舱门打开时运动受限").c_str(); -// return _(u8"未知原因").c_str(); -//} -// -//bool HBD1200::IsMoldCanMoveUp() -//{ -// if (!m_SignalState.m_PrintTorqueUpInsideLimit)return false; -// if (!m_SignalState.m_ArmNotUponBasePlatform)return false; -// if (!m_SignalState.m_PrintMoldPosInsideUpSoftLimit)return false; -// if (!m_SignalState.m_PrintInsideUpLimit)return false; -// if (!m_SignalState.m_PrintMainServoNoAlarm)return false; -// if (m_SignalState.m_HighPressureLackAlarm)return false; -// if (m_SignalState.m_SystemStopAlarm)return false; -// if (m_SignalState.m_CleanLiftStopAlarm)return false; -// if (!m_SignalState.m_PrintMoldInPrintPos && !m_SignalState.m_PrintMoldInCleanPos && !m_SignalState.m_PrintMoldInHandPos)return false; -// if (m_Axis->m_Mold->GetState()->m_AxisCfg->m_SafeLimit && !g_SystemInfo->m_EnvState.m_IsPrintCabinDoorClose)return false; -// return true; -//} -// -//string HBD1200::GetMoldCanotUpInfo() -//{ -// if (!m_SignalState.m_PrintTorqueUpInsideLimit)return _(u8"升降轴上升扭力越限").c_str(); -// if (!m_SignalState.m_ArmNotUponBasePlatform)return _(u8"铺粉臂在基板范围内").c_str(); -// if (!m_SignalState.m_PrintMoldPosInsideUpSoftLimit)return _(u8"升降轴越软上限").c_str(); -// if (!m_SignalState.m_PrintInsideUpLimit)return _(u8"升降轴越上限").c_str(); -// if (!m_SignalState.m_PrintMainServoNoAlarm)return _(u8"打印主轴伺服异常").c_str(); -// if (!m_SignalState.m_PrintMoldInPrintPos && !m_SignalState.m_PrintMoldInCleanPos && !m_SignalState.m_PrintMoldInHandPos) -// { -// return _(u8"缸体不在打印位、清粉位、吊装位").c_str(); -// } -// if (m_SignalState.m_HighPressureLackAlarm)return _(u8"高压气不足报警").c_str(); -// if (m_SignalState.m_SystemStopAlarm)return _(u8"系统急停异常").c_str(); -// if (m_SignalState.m_CleanLiftStopAlarm)return _(u8"清粉急停异常").c_str(); -// if (m_Axis->m_Mold->GetState()->m_AxisCfg->m_SafeLimit && !g_SystemInfo->m_EnvState.m_IsPrintCabinDoorClose)return _(u8"舱门打开时运动受限").c_str(); -// return _(u8"未知原因").c_str(); -//} -// -//bool HBD1200::IsMoldCanMoveDown() -//{ -// if (!m_SignalState.m_PrintTorqueDownInsideLimit)return false; -// if (!m_SignalState.m_ArmNotUponBasePlatform)return false; -// if (!m_SignalState.m_PrintAxisPosInsideDownSoftLimit)return false; -// if (!m_SignalState.m_PrintInsideDownLimit)return false; -// if (!m_SignalState.m_PrintMainServoNoAlarm)return false; -// if (m_SignalState.m_HighPressureLackAlarm)return false; -// if (m_SignalState.m_SystemStopAlarm)return false; -// if (m_SignalState.m_CleanLiftStopAlarm)return false; -// if (!m_SignalState.m_PrintMoldInPrintPos && !m_SignalState.m_PrintMoldInCleanPos && !m_SignalState.m_PrintMoldInHandPos)return false; -// if (m_Axis->m_Mold->GetState()->m_AxisCfg->m_SafeLimit && !g_SystemInfo->m_EnvState.m_IsPrintCabinDoorClose)return false; -// return true; -//} -// -//string HBD1200::GetMoldCanotDownInfo() -//{ -// if (!m_SignalState.m_PrintTorqueDownInsideLimit)return _(u8"升降轴下降扭力越限").c_str(); -// if (!m_SignalState.m_ArmNotUponBasePlatform)return _(u8"铺粉臂在基板范围内").c_str(); -// if (!m_SignalState.m_PrintAxisPosInsideDownSoftLimit)return _(u8"升降轴越软下限").c_str(); -// if (!m_SignalState.m_PrintInsideDownLimit)return _(u8"升降轴越下限").c_str(); -// if (!m_SignalState.m_PrintMainServoNoAlarm)return _(u8"打印主轴伺服异常").c_str(); -// if (!m_SignalState.m_PrintMoldInPrintPos && !m_SignalState.m_PrintMoldInCleanPos && !m_SignalState.m_PrintMoldInHandPos) -// { -// return _(u8"缸体不在打印位、清粉位、吊装位").c_str(); -// } -// if (m_SignalState.m_HighPressureLackAlarm)return _(u8"高压气不足报警").c_str(); -// if (m_SignalState.m_SystemStopAlarm)return _(u8"系统急停异常").c_str(); -// if (m_SignalState.m_CleanLiftStopAlarm)return _(u8"清粉急停异常").c_str(); -// if (m_Axis->m_Mold->GetState()->m_AxisCfg->m_SafeLimit && !g_SystemInfo->m_EnvState.m_IsPrintCabinDoorClose)return _(u8"舱门打开时运动受限").c_str(); -// return _(u8"未知原因").c_str(); -//} \ No newline at end of file +bool HBD1200::CheckPrintMoldReady() +{ + if (m_SignalStateWrapper->m_CylinderState->GetValue() != CylinderInPrintLoaded) + { + return false; + } + else return true; +} + +bool HBD1200::IsLoadAxisCanMoveLeft() +{ + if (!m_SignalState.m_PrintJackupInSafePos)return false; + if (!m_SignalState.m_LoadTorqueInsideLimit)return false; + if (!m_SignalState.m_LoadPosInsideLeftSoftLimit)return false; + if (!m_SignalState.m_CylinderFixInReleasePos)return false; + if (!m_SignalState.m_LoadLeftNotInsideLimit)return false; + if (!m_SignalState.m_LoadServoNoAlarm)return false; + if (!m_SignalState.m_EleServoInBottomPos)return false; + if (m_SignalState.m_HighPressureLackAlarm)return false; + if (m_SignalState.m_SystemStopAlarm)return false; + if (m_SignalState.m_CleanLiftStopAlarm)return false; + if (m_Axis->m_Load->GetState()->m_AxisCfg->m_SafeLimit && !g_SystemInfo->m_EnvState.m_IsPrintCabinDoorClose)return false; + return true; +} + +string HBD1200::GetLoadAxisCanotMoveLeftInfo() { + if (!m_SignalState.m_PrintJackupInSafePos)return _(u8"打印顶升轴不在安全位").c_str(); + if (!m_SignalState.m_LoadTorqueInsideLimit)return _(u8"移载扭力越限").c_str(); + if (!m_SignalState.m_LoadPosInsideLeftSoftLimit)return _(u8"移载轴越软左限").c_str(); + if (!m_SignalState.m_CylinderFixInReleasePos)return _(u8"缸体固定气缸不在松开位").c_str(); + if (!m_SignalState.m_LoadLeftNotInsideLimit)return _(u8"移载轴已到左限位").c_str(); + if (!m_SignalState.m_LoadServoNoAlarm)return _(u8"移载轴伺服异常").c_str(); + if (!m_SignalState.m_EleServoInBottomPos)return _(u8"电缸不在底座位").c_str(); + if (m_SignalState.m_HighPressureLackAlarm)return _(u8"高压气不足报警").c_str(); + if (m_SignalState.m_SystemStopAlarm)return _(u8"系统急停异常").c_str(); + if (m_SignalState.m_CleanLiftStopAlarm)return _(u8"清粉急停异常").c_str(); + if (m_Axis->m_Load->GetState()->m_AxisCfg->m_SafeLimit && !g_SystemInfo->m_EnvState.m_IsPrintCabinDoorClose)return _(u8"舱门打开时运动受限").c_str(); + return _(u8"未知原因").c_str(); +} + +bool HBD1200::IsLoadAxisCanMoveRight() +{ + if (!m_SignalState.m_PrintJackupInSafePos)return false; + if (!m_SignalState.m_LoadTorqueInsideLimit)return false; + if (!m_SignalState.m_LoadPosInsideRightSoftLimit)return false; + if (!m_SignalState.m_CylinderFixInReleasePos)return false; + if (!m_SignalState.m_LoadRightNotInsideLimit)return false; + if (!m_SignalState.m_LoadServoNoAlarm)return false; + if (!m_SignalState.m_EleServoInBottomPos)return false; + if (m_SignalState.m_HighPressureLackAlarm)return false; + if (m_SignalState.m_SystemStopAlarm)return false; + if (m_SignalState.m_CleanLiftStopAlarm)return false; + if (m_Axis->m_Load->GetState()->m_AxisCfg->m_SafeLimit && !g_SystemInfo->m_EnvState.m_IsPrintCabinDoorClose)return false; + return true; +} + +string HBD1200::GetLoadAxisCanotMoveRightInfo() { + if (!m_SignalState.m_PrintJackupInSafePos)return _(u8"打印顶升轴不在安全位").c_str(); + if (!m_SignalState.m_LoadTorqueInsideLimit)return _(u8"移载扭力越限").c_str(); + if (!m_SignalState.m_LoadPosInsideRightSoftLimit)return _(u8"移载轴越软右限").c_str(); + if (!m_SignalState.m_CylinderFixInReleasePos)return _(u8"缸体固定气缸不在松开位").c_str(); + if (!m_SignalState.m_LoadRightNotInsideLimit)return _(u8"移载轴已到右限位").c_str(); + if (!m_SignalState.m_LoadServoNoAlarm)return _(u8"移载轴伺服异常").c_str(); + if (!m_SignalState.m_EleServoInBottomPos)return _(u8"电缸不在底座位").c_str(); + if (m_SignalState.m_HighPressureLackAlarm)return _(u8"高压气不足报警").c_str(); + if (m_SignalState.m_SystemStopAlarm)return _(u8"系统急停异常").c_str(); + if (m_SignalState.m_CleanLiftStopAlarm)return _(u8"清粉急停异常").c_str(); + if (m_Axis->m_Load->GetState()->m_AxisCfg->m_SafeLimit && !g_SystemInfo->m_EnvState.m_IsPrintCabinDoorClose)return _(u8"舱门打开时运动受限").c_str(); + return _(u8"未知原因").c_str(); +} + +bool HBD1200::IsArmCanMoveBack() +{ + if (!m_SignalState.m_PrintUpDownPosBelowPlatform)return false; + if (!m_SignalState.m_ArmTorqueInsideLimit)return false; + if (!m_SignalState.m_ArmPosInsideSoftBackLimit)return false; + if (!m_SignalState.m_ArmPosInsideBackLimit)return false; + if (!m_SignalState.m_ArmServoNoAlarm)return false; + if (m_SignalState.m_HighPressureLackAlarm)return false; + if (m_SignalState.m_SystemStopAlarm)return false; + if (m_SignalState.m_CleanLiftStopAlarm)return false; + if (m_Axis->m_Arm->GetState()->m_AxisCfg->m_SafeLimit && !g_SystemInfo->m_EnvState.m_IsPrintCabinDoorClose)return false; + return true; +} + +string HBD1200::GetArmCanotMoveBackInfo() +{ + if (!m_SignalState.m_PrintUpDownPosBelowPlatform)return _(u8"打印升降轴高于基板缸平面").c_str(); + if (!m_SignalState.m_ArmTorqueInsideLimit)return _(u8"铺粉轴扭力越限").c_str(); + if (!m_SignalState.m_ArmPosInsideSoftBackLimit)return _(u8"铺粉轴位置超过软后限").c_str(); + if (!m_SignalState.m_ArmPosInsideBackLimit)return _(u8"铺粉轴已到后限位").c_str(); + if (!m_SignalState.m_ArmServoNoAlarm)return _(u8"铺粉轴伺服异常").c_str(); + if (m_SignalState.m_HighPressureLackAlarm)return _(u8"高压气不足报警").c_str(); + if (m_SignalState.m_SystemStopAlarm)return _(u8"系统急停异常").c_str(); + if (m_SignalState.m_CleanLiftStopAlarm)return _(u8"清粉急停异常").c_str(); + if (m_Axis->m_Arm->GetState()->m_AxisCfg->m_SafeLimit && !g_SystemInfo->m_EnvState.m_IsPrintCabinDoorClose)return _(u8"舱门打开时运动受限").c_str(); + return _(u8"未知原因").c_str(); +} + +bool HBD1200::IsArmCanMoveFront() +{ + if (!m_SignalState.m_PrintUpDownPosBelowPlatform)return false; + if (!m_SignalState.m_ArmTorqueInsideLimit)return false; + if (!m_SignalState.m_ArmPosInsideSoftFrontLimit)return false; + if (!m_SignalState.m_ArmPosInsideFrontLimit)return false; + if (!m_SignalState.m_ArmServoNoAlarm)return false; + if (m_SignalState.m_HighPressureLackAlarm)return false; + if (m_SignalState.m_SystemStopAlarm)return false; + if (m_SignalState.m_CleanLiftStopAlarm)return false; + if (m_Axis->m_Arm->GetState()->m_AxisCfg->m_SafeLimit && !g_SystemInfo->m_EnvState.m_IsPrintCabinDoorClose)return false; + return true; +} + +string HBD1200::GetArmCanotMoveFrontInfo() +{ + if (!m_SignalState.m_PrintUpDownPosBelowPlatform)return _(u8"打印升降轴高于基板缸平面").c_str(); + if (!m_SignalState.m_ArmTorqueInsideLimit)return _(u8"铺粉轴扭力越限").c_str(); + if (!m_SignalState.m_ArmPosInsideSoftFrontLimit)return _(u8"铺粉轴位置超过软前限").c_str(); + if (!m_SignalState.m_ArmPosInsideFrontLimit)return _(u8"铺粉轴已到前限位").c_str(); + if (!m_SignalState.m_ArmServoNoAlarm)return _(u8"铺粉轴伺服异常").c_str(); + if (m_SignalState.m_HighPressureLackAlarm)return _(u8"高压气不足报警").c_str(); + if (m_SignalState.m_SystemStopAlarm)return _(u8"系统急停异常").c_str(); + if (m_SignalState.m_CleanLiftStopAlarm)return _(u8"清粉急停异常").c_str(); + if (m_Axis->m_Arm->GetState()->m_AxisCfg->m_SafeLimit && !g_SystemInfo->m_EnvState.m_IsPrintCabinDoorClose)return _(u8"舱门打开时运动受限").c_str(); + return _(u8"未知原因").c_str(); +} + +bool HBD1200::IsMoldCanMoveUp() +{ + if (!m_SignalState.m_PrintTorqueUpInsideLimit)return false; + if (!m_SignalState.m_ArmNotUponBasePlatform)return false; + if (!m_SignalState.m_PrintMoldPosInsideUpSoftLimit)return false; + if (!m_SignalState.m_PrintInsideUpLimit)return false; + if (!m_SignalState.m_PrintMainServoNoAlarm)return false; + if (m_SignalState.m_HighPressureLackAlarm)return false; + if (m_SignalState.m_SystemStopAlarm)return false; + if (m_SignalState.m_CleanLiftStopAlarm)return false; + if (!m_SignalState.m_PrintMoldInPrintPos && !m_SignalState.m_PrintMoldInCleanPos && !m_SignalState.m_PrintMoldInHandPos)return false; + if (m_Axis->m_Mold->GetState()->m_AxisCfg->m_SafeLimit && !g_SystemInfo->m_EnvState.m_IsPrintCabinDoorClose)return false; + return true; +} + +string HBD1200::GetMoldCanotUpInfo() +{ + if (!m_SignalState.m_PrintTorqueUpInsideLimit)return _(u8"升降轴上升扭力越限").c_str(); + if (!m_SignalState.m_ArmNotUponBasePlatform)return _(u8"铺粉臂在基板范围内").c_str(); + if (!m_SignalState.m_PrintMoldPosInsideUpSoftLimit)return _(u8"升降轴越软上限").c_str(); + if (!m_SignalState.m_PrintInsideUpLimit)return _(u8"升降轴越上限").c_str(); + if (!m_SignalState.m_PrintMainServoNoAlarm)return _(u8"打印主轴伺服异常").c_str(); + if (!m_SignalState.m_PrintMoldInPrintPos && !m_SignalState.m_PrintMoldInCleanPos && !m_SignalState.m_PrintMoldInHandPos) + { + return _(u8"缸体不在打印位、清粉位、吊装位").c_str(); + } + if (m_SignalState.m_HighPressureLackAlarm)return _(u8"高压气不足报警").c_str(); + if (m_SignalState.m_SystemStopAlarm)return _(u8"系统急停异常").c_str(); + if (m_SignalState.m_CleanLiftStopAlarm)return _(u8"清粉急停异常").c_str(); + if (m_Axis->m_Mold->GetState()->m_AxisCfg->m_SafeLimit && !g_SystemInfo->m_EnvState.m_IsPrintCabinDoorClose)return _(u8"舱门打开时运动受限").c_str(); + return _(u8"未知原因").c_str(); +} + +bool HBD1200::IsMoldCanMoveDown() +{ + if (!m_SignalState.m_PrintTorqueDownInsideLimit)return false; + if (!m_SignalState.m_ArmNotUponBasePlatform)return false; + if (!m_SignalState.m_PrintAxisPosInsideDownSoftLimit)return false; + if (!m_SignalState.m_PrintInsideDownLimit)return false; + if (!m_SignalState.m_PrintMainServoNoAlarm)return false; + if (m_SignalState.m_HighPressureLackAlarm)return false; + if (m_SignalState.m_SystemStopAlarm)return false; + if (m_SignalState.m_CleanLiftStopAlarm)return false; + if (!m_SignalState.m_PrintMoldInPrintPos && !m_SignalState.m_PrintMoldInCleanPos && !m_SignalState.m_PrintMoldInHandPos)return false; + if (m_Axis->m_Mold->GetState()->m_AxisCfg->m_SafeLimit && !g_SystemInfo->m_EnvState.m_IsPrintCabinDoorClose)return false; + return true; +} + +string HBD1200::GetMoldCanotDownInfo() +{ + if (!m_SignalState.m_PrintTorqueDownInsideLimit)return _(u8"升降轴下降扭力越限").c_str(); + if (!m_SignalState.m_ArmNotUponBasePlatform)return _(u8"铺粉臂在基板范围内").c_str(); + if (!m_SignalState.m_PrintAxisPosInsideDownSoftLimit)return _(u8"升降轴越软下限").c_str(); + if (!m_SignalState.m_PrintInsideDownLimit)return _(u8"升降轴越下限").c_str(); + if (!m_SignalState.m_PrintMainServoNoAlarm)return _(u8"打印主轴伺服异常").c_str(); + if (!m_SignalState.m_PrintMoldInPrintPos && !m_SignalState.m_PrintMoldInCleanPos && !m_SignalState.m_PrintMoldInHandPos) + { + return _(u8"缸体不在打印位、清粉位、吊装位").c_str(); + } + if (m_SignalState.m_HighPressureLackAlarm)return _(u8"高压气不足报警").c_str(); + if (m_SignalState.m_SystemStopAlarm)return _(u8"系统急停异常").c_str(); + if (m_SignalState.m_CleanLiftStopAlarm)return _(u8"清粉急停异常").c_str(); + if (m_Axis->m_Mold->GetState()->m_AxisCfg->m_SafeLimit && !g_SystemInfo->m_EnvState.m_IsPrintCabinDoorClose)return _(u8"舱门打开时运动受限").c_str(); + return _(u8"未知原因").c_str(); +} \ No newline at end of file diff --git a/PrintC/Machine/HBD1200.h b/PrintC/Machine/HBD1200.h index 567acac..feecd63 100644 --- a/PrintC/Machine/HBD1200.h +++ b/PrintC/Machine/HBD1200.h @@ -84,7 +84,7 @@ public: void InitSysParam(SysParamWrapper* spw, void* cc); //void InitPLCCommand(vector& vecs); void GetAlarmState(SignalState& signalState); - //bool CheckPrintMoldReady(); + bool CheckPrintMoldReady(); virtual void CheckIO(); private: diff --git a/PrintC/Machine/Machine.cpp b/PrintC/Machine/Machine.cpp index aaea47b..fb05240 100644 --- a/PrintC/Machine/Machine.cpp +++ b/PrintC/Machine/Machine.cpp @@ -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()); } diff --git a/PrintC/Machine/Machine.h b/PrintC/Machine/Machine.h index 2d343c7..5249723 100644 --- a/PrintC/Machine/Machine.h +++ b/PrintC/Machine/Machine.h @@ -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; - }; \ No newline at end of file diff --git a/PrintC/PLC/AxisState.cpp b/PrintC/PLC/AxisState.cpp index 0f35dd4..da04bad 100644 --- a/PrintC/PLC/AxisState.cpp +++ b/PrintC/PLC/AxisState.cpp @@ -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) diff --git a/PrintC/PLC/AxisState.h b/PrintC/PLC/AxisState.h index bd3bf9f..da381a6 100644 --- a/PrintC/PLC/AxisState.h +++ b/PrintC/PLC/AxisState.h @@ -79,6 +79,8 @@ public: FloatData* m_Torque; //当前扭矩 FloatData* m_ShowPos; FloatData* m_RPos; + + char m_endFlag; //结束标志 std::shared_mutex mtx; diff --git a/PrintC/UI/Controller.cpp b/PrintC/UI/Controller.cpp index 2441955..7e1e082 100644 --- a/PrintC/UI/Controller.cpp +++ b/PrintC/UI/Controller.cpp @@ -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(); diff --git a/PrintC/UI/UIWin.cpp b/PrintC/UI/UIWin.cpp index 9721c77..5e7888f 100644 --- a/PrintC/UI/UIWin.cpp +++ b/PrintC/UI/UIWin.cpp @@ -296,7 +296,7 @@ void UIWin::Draw() { SetupDockSpace(); DrawTitleBar(); DrawToolBar(); - + DrawPowder(); DrawMain(); } diff --git a/PrintC/config/ConfigManager.h b/PrintC/config/ConfigManager.h index 31d0840..39fecaf 100644 --- a/PrintC/config/ConfigManager.h +++ b/PrintC/config/ConfigManager.h @@ -36,7 +36,6 @@ private: IOCfgWrapper* m_IOCfgWrapper; MachineCfg* m_MachineCfg; RunCfg m_RunCfg; - //ExtCfg m_ExtCfg; AlarmCfgWrapper* m_AlarmCfgWrapper; ParamLimitCfgNew m_ParamLimitCfg; diff --git a/PrintC/config/bean/AxisCfg.h b/PrintC/config/bean/AxisCfg.h index 64b053f..eeb967e 100644 --- a/PrintC/config/bean/AxisCfg.h +++ b/PrintC/config/bean/AxisCfg.h @@ -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() diff --git a/PrintC/config/bean/ParamLimitCfg.h b/PrintC/config/bean/ParamLimitCfg.h index 060b7a2..5eb3f72 100644 --- a/PrintC/config/bean/ParamLimitCfg.h +++ b/PrintC/config/bean/ParamLimitCfg.h @@ -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; -}; \ No newline at end of file +}; +#pragma pack() \ No newline at end of file diff --git a/PrintC/output/Release/log/2024.hbd b/PrintC/output/Release/log/2024.hbd index 1d884fe..46679f0 100644 Binary files a/PrintC/output/Release/log/2024.hbd and b/PrintC/output/Release/log/2024.hbd differ diff --git a/PrintS/Machine/HBD1000.cpp b/PrintS/Machine/HBD1000.cpp index d0e02ae..10e1d37 100644 --- a/PrintS/Machine/HBD1000.cpp +++ b/PrintS/Machine/HBD1000.cpp @@ -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); diff --git a/PrintS/Machine/HBD1200.cpp b/PrintS/Machine/HBD1200.cpp index eb0b53d..54a54bb 100644 --- a/PrintS/Machine/HBD1200.cpp +++ b/PrintS/Machine/HBD1200.cpp @@ -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); diff --git a/PrintS/Machine/Machine.cpp b/PrintS/Machine/Machine.cpp index c73b088..6b9234e 100644 --- a/PrintS/Machine/Machine.cpp +++ b/PrintS/Machine/Machine.cpp @@ -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; diff --git a/PrintS/Machine/Machine.h b/PrintS/Machine/Machine.h index fe71d6c..f3ce904 100644 --- a/PrintS/Machine/Machine.h +++ b/PrintS/Machine/Machine.h @@ -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&, 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 m_AxisTabs; };