本文整理汇总了C++中Tool::Heater方法的典型用法代码示例。如果您正苦于以下问题:C++ Tool::Heater方法的具体用法?C++ Tool::Heater怎么用?C++ Tool::Heater使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tool
的用法示例。
在下文中一共展示了Tool::Heater方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsHeaterAssignedToTool
bool RepRap::IsHeaterAssignedToTool(int8_t heater) const
{
for(Tool *tool = toolList; tool != nullptr; tool = tool->Next())
{
for(size_t i = 0; i < tool->HeaterCount(); i++)
{
if (tool->Heater(i) == heater)
{
// It's already in use by some tool
return true;
}
}
}
return false;
}
示例2: if
//.........这里部分代码省略.........
// There currently appears to be no need for this one, so skip it
//response->catf(",\"buff\":%u", webserver->GetGCodeBufferSpace(WebSource::HTTP));
}
/* Sensors */
{
response->cat(",\"sensors\":{");
// Probe
const int v0 = platform->GetZProbeReading();
int v1, v2;
switch (platform->GetZProbeSecondaryValues(v1, v2))
{
case 1:
response->catf("\"probeValue\":%d,\"probeSecondary\":[%d]", v0, v1);
break;
case 2:
response->catf("\"probeValue\":%d,\"probeSecondary\":[%d,%d]", v0, v1, v2);
break;
default:
response->catf("\"probeValue\":%d", v0);
break;
}
// Fan RPM
response->catf(",\"fanRPM\":%d}", static_cast<unsigned int>(platform->GetFanRPM()));
}
/* Temperatures */
{
response->cat(",\"temps\":{");
/* Bed */
const int8_t bedHeater = heat->GetBedHeater();
if (bedHeater != -1)
{
response->catf("\"bed\":{\"current\":%.1f,\"active\":%.1f,\"state\":%d},",
heat->GetTemperature(bedHeater), heat->GetActiveTemperature(bedHeater),
heat->GetStatus(bedHeater));
}
/* Chamber */
const int8_t chamberHeater = heat->GetChamberHeater();
if (chamberHeater != -1)
{
response->catf("\"chamber\":{\"current\":%.1f,", heat->GetTemperature(chamberHeater));
response->catf("\"active\":%.1f,", heat->GetActiveTemperature(chamberHeater));
response->catf("\"state\":%d},", static_cast<int>(heat->GetStatus(chamberHeater)));
}
/* Heads */
{
response->cat("\"heads\":{\"current\":");
// Current temperatures
ch = '[';
for (size_t heater = DefaultE0Heater; heater < GetToolHeatersInUse(); heater++)
{
response->catf("%c%.1f", ch, heat->GetTemperature(heater));
ch = ',';
}
response->cat((ch == '[') ? "[]" : "]");
// Active temperatures
response->catf(",\"active\":");
ch = '[';
示例3: if
//.........这里部分代码省略.........
// There currently appears to be no need for this one, so skip it
//response->catf(",\"buff\":%u", webserver->GetGCodeBufferSpace(WebSource::HTTP));
}
/* Sensors */
{
response->cat(",\"sensors\":{");
// Probe
int v0 = platform->ZProbe();
int v1, v2;
switch (platform->GetZProbeSecondaryValues(v1, v2))
{
case 1:
response->catf("\"probeValue\":%d,\"probeSecondary\":[%d]", v0, v1);
break;
case 2:
response->catf("\"probeValue\":%d,\"probeSecondary\":[%d,%d]", v0, v1, v2);
break;
default:
response->catf("\"probeValue\":%d", v0);
break;
}
// Fan RPM
response->catf(",\"fanRPM\":%d}", static_cast<unsigned int>(platform->GetFanRPM()));
}
/* Temperatures */
{
response->cat(",\"temps\":{");
/* Bed */
const int8_t bedHeater = heat->GetBedHeater();
if (bedHeater != -1)
{
response->catf("\"bed\":{\"current\":%.1f,\"active\":%.1f,\"state\":%d},",
heat->GetTemperature(bedHeater), heat->GetActiveTemperature(bedHeater),
heat->GetStatus(bedHeater));
}
/* Chamber */
const int8_t chamberHeater = heat->GetChamberHeater();
if (chamberHeater != -1)
{
response->catf("\"chamber\":{\"current\":%.1f,", heat->GetTemperature(chamberHeater));
response->catf("\"active\":%.1f,", heat->GetActiveTemperature(chamberHeater));
response->catf("\"state\":%d},", static_cast<int>(heat->GetStatus(chamberHeater)));
}
/* Heads */
{
response->cat("\"heads\":{\"current\":");
// Current temperatures
ch = '[';
for (size_t heater = E0_HEATER; heater < GetToolHeatersInUse(); heater++)
{
response->catf("%c%.1f", ch, heat->GetTemperature(heater));
ch = ',';
}
response->cat((ch == '[') ? "[]" : "]");
// Active temperatures
response->catf(",\"active\":");
ch = '[';