Skip to content

Commit

Permalink
Fix compile errors due to migration to new INDI properties
Browse files Browse the repository at this point in the history
  • Loading branch information
knro committed Sep 14, 2024
1 parent fa35d75 commit 28be790
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 50 deletions.
28 changes: 10 additions & 18 deletions indi-fli/kepler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,6 @@ std::map<FPRODEVICETYPE, double> Kepler::SensorPixelSize
{FPRODEVICETYPE::FPRO_CAM_DEVICE_TYPE_FTM, 99}
};

/********************************************************************************
*
********************************************************************************/
void Kepler::workerStreamVideo(const std::atomic_bool &isAboutToQuit)
{

}

/********************************************************************************
*
********************************************************************************/
Expand Down Expand Up @@ -881,7 +873,7 @@ void Kepler::prepareUnpacked()
int Kepler::SetTemperature(double temperature)
{
// Return OK for
if (std::abs(temperature - TemperatureN[0].value) < TEMPERATURE_THRESHOLD)
if (std::abs(temperature - TemperatureNP[0].getValue()) < TEMPERATURE_THRESHOLD)
return 1;
int result = FPROCtrl_SetTemperatureSetPoint(m_CameraHandle, temperature);
if (result >= 0)
Expand Down Expand Up @@ -992,8 +984,8 @@ void Kepler::readTemperature()
int result = FPROCtrl_GetTemperatures(m_CameraHandle, &ambient, &base, &cooler);
if (result < 0)
{
TemperatureNP.s = IPS_ALERT;
IDSetNumber(&TemperatureNP, nullptr);
TemperatureNP.setState(IPS_ALERT);
TemperatureNP.apply();

#ifdef LEGACY_MODE
TemperatureReadNP.setState(IPS_ALERT);
Expand All @@ -1002,14 +994,14 @@ void Kepler::readTemperature()
LOGF_WARN("FPROCtrl_GetTemperatures failed: %d", result);
}

switch (TemperatureNP.s)
switch (TemperatureNP.getState())
{
case IPS_IDLE:
case IPS_OK:
if (std::abs(cooler - TemperatureN[0].value) > TEMPERATURE_THRESHOLD)
if (std::abs(cooler - TemperatureNP[0].getValue()) > TEMPERATURE_THRESHOLD)
{
TemperatureN[0].value = cooler;
IDSetNumber(&TemperatureNP, nullptr);
TemperatureNP[0].setValue(cooler);
TemperatureNP.apply();

#ifdef LEGACY_MODE
TemperatureReadNP.setState(IPS_OK);
Expand All @@ -1022,15 +1014,15 @@ void Kepler::readTemperature()
case IPS_BUSY:
if (std::abs(cooler - m_TargetTemperature) <= TEMPERATURE_THRESHOLD)
{
TemperatureNP.s = IPS_OK;
TemperatureNP.setState(IPS_OK);
#ifdef LEGACY_MODE
TemperatureReadNP.setState(IPS_OK);
#endif
// Reset now to idle frequency checks.
m_TemperatureTimer.setInterval(TEMPERATURE_FREQUENCY_IDLE);
}
TemperatureN[0].value = cooler;
IDSetNumber(&TemperatureNP, nullptr);
TemperatureNP[0].setValue(cooler);
TemperatureNP.apply();
#ifdef LEGACY_MODE
TemperatureReadNP[0].value = cooler;
TemperatureReadNP.apply();
Expand Down
3 changes: 1 addition & 2 deletions indi-fli/kepler.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class Kepler : public INDI::CCD
INDI::PropertyNumber CoolerDutyNP {1};
INDI::PropertySwitch FanSP {2};

// Merging
// Merging
INDI::PropertySwitch MergePlanesSP {3};
INDI::PropertySwitch RequestStatSP {2};
INDI::PropertyText MergeCalibrationFilesTP {2};
Expand Down Expand Up @@ -132,7 +132,6 @@ class Kepler : public INDI::CCD
//****************************************************************************************
// Workers
//****************************************************************************************
void workerStreamVideo(const std::atomic_bool &isAboutToQuit);
void workerExposure(const std::atomic_bool &isAboutToQuit, float duration);

//****************************************************************************************
Expand Down
4 changes: 2 additions & 2 deletions indi-pentax/pentax_ccd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ bool PentaxCCD::initProperties()

BayerTP[2].setText("RGGB");

PrimaryCCD.getCCDInfo()->p = IP_RW;
PrimaryCCD.getCCDInfo().setPermission(IP_RW);

uint32_t cap = CCD_HAS_BAYER | CCD_HAS_STREAMING;
SetCCDCapability(cap);
Expand Down Expand Up @@ -107,7 +107,7 @@ bool PentaxCCD::updateProperties()
}

buildCaptureSwitches();

INDI::CCD::updateProperties();

defineProperty(&autoFocusSP);
Expand Down
58 changes: 30 additions & 28 deletions indi-pentax/pktriggercord_ccd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ bool PkTriggerCordCCD::initProperties()
IUFillSwitch(&autoFocusS[1], "OFF", "Off", ISS_ON);
IUFillSwitchVector(&autoFocusSP, autoFocusS, 2, getDeviceName(), "AUTO_FOCUS", "Auto Focus", MAIN_CONTROL_TAB, IP_RW,
ISR_1OFMANY, 0, IPS_IDLE);
/*
IUFillSwitch(&transferFormatS[0], "FORMAT_FITS", "FITS", ISS_ON);
IUFillSwitch(&transferFormatS[1], "FORMAT_NATIVE", "Native", ISS_OFF);
IUFillSwitchVector(&transferFormatSP, transferFormatS, 2, getDeviceName(), "CCD_TRANSFER_FORMAT", "Output", OPTIONS_TAB,
IP_RW, ISR_1OFMANY, 0, IPS_IDLE);
*/
/*
IUFillSwitch(&transferFormatS[0], "FORMAT_FITS", "FITS", ISS_ON);
IUFillSwitch(&transferFormatS[1], "FORMAT_NATIVE", "Native", ISS_OFF);
IUFillSwitchVector(&transferFormatSP, transferFormatS, 2, getDeviceName(), "CCD_TRANSFER_FORMAT", "Output", OPTIONS_TAB,
IP_RW, ISR_1OFMANY, 0, IPS_IDLE);
*/

IUFillSwitch(&preserveOriginalS[1], "PRESERVE_ON", "Also Copy Native Image", ISS_OFF);
IUFillSwitch(&preserveOriginalS[0], "PRESERVE_OFF", "Keep FITS Only", ISS_ON);
Expand All @@ -86,7 +86,7 @@ bool PkTriggerCordCCD::initProperties()

BayerTP[2].setText("RGGB");

PrimaryCCD.getCCDInfo()->p = IP_RW;
PrimaryCCD.getCCDInfo().setPermission(IP_RW);

uint32_t cap = CCD_HAS_BAYER;
SetCCDCapability(cap);
Expand All @@ -113,7 +113,7 @@ bool PkTriggerCordCCD::updateProperties()

// defineProperty(&transferFormatSP);
defineProperty(&autoFocusSP);
//if (transferFormatS[0].s == ISS_ON)
//if (transferFormatS[0].s == ISS_ON)
if (EncodeFormatSP[FORMAT_FITS].getState() == ISS_ON)
{
defineProperty(&preserveOriginalSP);
Expand Down Expand Up @@ -177,9 +177,11 @@ void PkTriggerCordCCD::buildCaptureSwitches()
{
current_format_name = "PEF";
}
for (size_t i=0; i<(sizeof(imageformat)/sizeof(imageformat[0])); i++) {
for (size_t i = 0; i < (sizeof(imageformat) / sizeof(imageformat[0])); i++)
{
auto isOn = false;
if (imageformat[i]==current_format_name) {
if (imageformat[i] == current_format_name)
{
isOn = true;
}
CaptureFormat format = {imageformat[i], imageformat[i], 8, isOn};
Expand Down Expand Up @@ -593,7 +595,7 @@ bool PkTriggerCordCCD::grabImage()


// fits handling code
// if (transferFormatS[0].s == ISS_ON)
// if (transferFormatS[0].s == ISS_ON)
if ( EncodeFormatSP[FORMAT_FITS].s == ISS_ON )
{
PrimaryCCD.setImageExtension("fits");
Expand Down Expand Up @@ -734,22 +736,22 @@ bool PkTriggerCordCCD::ISNewSwitch(const char * dev, const char * name, ISState
autoFocusSP.s = IPS_OK;
IDSetSwitch(&autoFocusSP, nullptr);
}
/*
else if (!strcmp(name, transferFormatSP.name))
{
IUUpdateSwitch(&transferFormatSP, states, names, n);
transferFormatSP.s = IPS_OK;
IDSetSwitch(&transferFormatSP, nullptr);
if (transferFormatS[0].s == ISS_ON)
{
defineProperty(&preserveOriginalSP);
}
else
{
deleteProperty(preserveOriginalSP.name);
}
}
*/
/*
else if (!strcmp(name, transferFormatSP.name))
{
IUUpdateSwitch(&transferFormatSP, states, names, n);
transferFormatSP.s = IPS_OK;
IDSetSwitch(&transferFormatSP, nullptr);
if (transferFormatS[0].s == ISS_ON)
{
defineProperty(&preserveOriginalSP);
}
else
{
deleteProperty(preserveOriginalSP.name);
}
}
*/
else if (!strcmp(name, preserveOriginalSP.name))
{
IUUpdateSwitch(&preserveOriginalSP, states, names, n);
Expand Down Expand Up @@ -898,7 +900,7 @@ bool PkTriggerCordCCD::SetCaptureFormat(uint8_t index)
{
uff = USER_FILE_FORMAT_JPEG;
}
pslr_set_user_file_format(device, uff);
pslr_set_user_file_format(device, uff);

return true;
}

0 comments on commit 28be790

Please sign in to comment.