本文整理汇总了C++中Tool::GetXAxisMap方法的典型用法代码示例。如果您正苦于以下问题:C++ Tool::GetXAxisMap方法的具体用法?C++ Tool::GetXAxisMap怎么用?C++ Tool::GetXAxisMap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tool
的用法示例。
在下文中一共展示了Tool::GetXAxisMap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
/* Tool Mapping */
{
response->cat(",\"tools\":[");
for(Tool *tool = toolList; tool != nullptr; tool = tool->Next())
{
// Heaters
response->catf("{\"number\":%d,\"heaters\":[", tool->Number());
for(size_t heater=0; heater<tool->HeaterCount(); heater++)
{
response->catf("%d", tool->Heater(heater));
if (heater + 1 < tool->HeaterCount())
{
response->cat(",");
}
}
// Extruder drives
response->cat("],\"drives\":[");
for(size_t drive=0; drive<tool->DriveCount(); drive++)
{
response->catf("%d", tool->Drive(drive));
if (drive + 1 < tool->DriveCount())
{
response->cat(",");
}
}
// Axis mapping. Currently we only map the X axis, but we return an array of arrays to allow for mapping other axes in future.
response->cat("],\"axisMap\":[[");
bool first = true;
for (size_t xi = 0; xi < MAX_AXES; ++xi)
{
if ((tool->GetXAxisMap() & (1u << xi)) != 0)
{
if (first)
{
first = false;
}
else
{
response->cat(",");
}
response->catf("%u", xi);
}
}
// Do we have any more tools?
if (tool->Next() != nullptr)
{
response->cat("]]},");
}
else
{
response->cat("]]}");
}
}
response->cat("]");
}
// MCU temperatures
#ifndef __RADDS__
{
float minT, currT, maxT;
platform->GetMcuTemperatures(minT, currT, maxT);
response->catf(",\"mcutemp\":{\"min\":%.1f,\"cur\":%.1f,\"max\":%.1f}", minT, currT, maxT);