mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-07 06:57:36 -06:00
FIX:optimize the fan gear
Change-Id: I02361a71b56f1527d85b2085f13fb374faacdc32
This commit is contained in:
parent
b5967505bd
commit
e9045c2f4b
3 changed files with 30 additions and 12 deletions
|
@ -2336,18 +2336,36 @@ int MachineObject::parse_json(std::string payload)
|
|||
big_fan1_speed = (int)((fan_gear & 0x0000FF00) >> 8);
|
||||
cooling_fan_speed= (int)((fan_gear & 0x000000FF) >> 0);
|
||||
}
|
||||
/* if (jj.contains("cooling_fan_speed")) {
|
||||
cooling_fan_speed = stoi(jj["cooling_fan_speed"].get<std::string>());
|
||||
else {
|
||||
if (jj.contains("cooling_fan_speed")) {
|
||||
cooling_fan_speed = stoi(jj["cooling_fan_speed"].get<std::string>());
|
||||
cooling_fan_speed = round(floor(cooling_fan_speed / float(1.5)));
|
||||
}
|
||||
else {
|
||||
cooling_fan_speed = 0;
|
||||
}
|
||||
|
||||
if (jj.contains("big_fan1_speed")) {
|
||||
big_fan1_speed = stoi(jj["big_fan1_speed"].get<std::string>());
|
||||
big_fan1_speed = round(floor(big_fan1_speed / float(1.5)));
|
||||
}
|
||||
else {
|
||||
big_fan1_speed = 0;
|
||||
}
|
||||
|
||||
if (jj.contains("big_fan2_speed")) {
|
||||
big_fan2_speed = stoi(jj["big_fan2_speed"].get<std::string>());
|
||||
big_fan2_speed = round(floor(big_fan2_speed / float(1.5)));
|
||||
}
|
||||
else {
|
||||
big_fan2_speed = 0;
|
||||
}
|
||||
}
|
||||
if (jj.contains("big_fan1_speed")) {
|
||||
big_fan1_speed = stoi(jj["big_fan1_speed"].get<std::string>());
|
||||
}
|
||||
if (jj.contains("big_fan2_speed")) {
|
||||
big_fan2_speed = stoi(jj["big_fan2_speed"].get<std::string>());
|
||||
}*/
|
||||
|
||||
if (jj.contains("heatbreak_fan_speed")) {
|
||||
heatbreak_fan_speed = stoi(jj["heatbreak_fan_speed"].get<std::string>());
|
||||
}
|
||||
|
||||
/* parse speed */
|
||||
try {
|
||||
if (jj.contains("spd_lvl")) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue