Kirdy::set_tec_current
This commit is contained in:
parent
22492da21b
commit
f24c710af2
15
kirdy.cpp
15
kirdy.cpp
@ -29,8 +29,17 @@ Json::Value Kirdy::command(Json::Value &request)
|
|||||||
|
|
||||||
float Kirdy::get_laser_temp()
|
float Kirdy::get_laser_temp()
|
||||||
{
|
{
|
||||||
Json::Value json;
|
Json::Value request;
|
||||||
json["device_cmd"] = "GetStatusReport";
|
request["device_cmd"] = "GetStatusReport";
|
||||||
auto reply = command(json);
|
Json::Value reply = command(request);
|
||||||
return reply["thermostat"]["temperature"].asFloat();
|
return reply["thermostat"]["temperature"].asFloat();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Kirdy::set_tec_current(float amps)
|
||||||
|
{
|
||||||
|
Json::Value request;
|
||||||
|
request["tec_set_i"] = amps;
|
||||||
|
Json::Value reply = command(request);
|
||||||
|
if(reply["msg_type"].asString() != "Acknowledge")
|
||||||
|
std::cerr << "TEC set current failed" << std::endl;
|
||||||
|
}
|
||||||
|
@ -10,4 +10,5 @@ class Kirdy {
|
|||||||
public:
|
public:
|
||||||
Kirdy(asio::string_view host, asio::string_view service);
|
Kirdy(asio::string_view host, asio::string_view service);
|
||||||
float get_laser_temp();
|
float get_laser_temp();
|
||||||
|
void set_tec_current(float amps);
|
||||||
};
|
};
|
||||||
|
@ -260,6 +260,7 @@ static void servo_thread(int channel)
|
|||||||
while(!shutdown_threads) {
|
while(!shutdown_threads) {
|
||||||
clocker.tick();
|
clocker.tick();
|
||||||
laser_temp[channel] = kirdy.get_laser_temp();
|
laser_temp[channel] = kirdy.get_laser_temp();
|
||||||
|
kirdy.set_tec_current(0.01);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user