Bi-monthly release with minor bug fixes and improvements
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
The generic timer call back is used for temperature monitoring
void ToupBase::TimerHit()
{
if (isConnected() == false)
return;
if (InExposure)
{
struct timeval curtime, diff;
gettimeofday(&curtime, nullptr);
timersub(&ExposureEnd, &curtime, &diff);
double timeleft = diff.tv_sec + diff.tv_usec / 1e6;
if (timeleft < 0)
timeleft = 0;
PrimaryCCD.setExposureLeft(timeleft);
}
if (m_Instance->model->flag & CP(FLAG_GETTEMPERATURE))
{
double currentTemperature = TemperatureN[0].value;
int16_t nTemperature = 0;
HRESULT rc = FP(get_Temperature(m_CameraHandle, &nTemperature));
if (FAILED(rc))
{
LOGF_ERROR("get_Temperature error. %s", errorCodes[rc].c_str());
TemperatureNP.s = IPS_ALERT;
}
else
{
TemperatureN[0].value = static_cast<double>(nTemperature / 10.0);
}
switch (TemperatureNP.s)
{
case IPS_IDLE:
case IPS_OK:
if (fabs(currentTemperature - TemperatureN[0].value) > TEMP_THRESHOLD / 10.0)
{
IDSetNumber(&TemperatureNP, nullptr);
}
break;
case IPS_ALERT:
break;
case IPS_BUSY:
// If we're within threshold, let's make it BUSY ---> OK
// if (fabs(TemperatureRequest - TemperatureN[0].value) <= TEMP_THRESHOLD)
// {
// TemperatureNP.s = IPS_OK;
// }
IDSetNumber(&TemperatureNP, nullptr);
break;
}
}
SetTimer(getCurrentPollingPeriod());
}
Please Log in or Create an account to join the conversation.