Skip to content

Commit

Permalink
Fix warnings (indilib#299)
Browse files Browse the repository at this point in the history
  • Loading branch information
pawel-soja authored Jan 21, 2021
1 parent f308892 commit 73f91fd
Show file tree
Hide file tree
Showing 104 changed files with 3,558 additions and 3,515 deletions.
4 changes: 2 additions & 2 deletions examples/generic-ccd/generic_ccd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ bool GenericCCD::updateProperties()
// Let's get parameters now from CCD
setupParams();

timerID = SetTimer(POLLMS);
timerID = SetTimer(getCurrentPollingPeriod());
}
else
{
Expand Down Expand Up @@ -710,7 +710,7 @@ void GenericCCD::TimerHit()
}

if (timerID == -1)
SetTimer(POLLMS);
SetTimer(getCurrentPollingPeriod());
return;
}

Expand Down
42 changes: 21 additions & 21 deletions indi-ahp-correlator/indi_ahp_correlator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -609,14 +609,14 @@ void AHP_XC::ISGetProperties(const char *dev)
if (isConnected())
{
for (int x=0; x<ahp_xc_get_nlines(); x++) {
defineSwitch(&lineEnableSP[x]);
defineProperty(&lineEnableSP[x]);
}
if(ahp_xc_get_autocorrelator_jittersize() > 1)
defineBLOB(&autocorrelationsBP);
defineProperty(&autocorrelationsBP);
if(ahp_xc_get_crosscorrelator_jittersize() > 1)
defineBLOB(&crosscorrelationsBP);
defineNumber(&correlationsNP);
defineNumber(&settingsNP);
defineProperty(&crosscorrelationsBP);
defineProperty(&correlationsNP);
defineProperty(&settingsNP);

// Define our properties
}
Expand All @@ -638,14 +638,14 @@ bool AHP_XC::updateProperties()
setupParams();

for (int x=0; x<ahp_xc_get_nlines(); x++) {
defineSwitch(&lineEnableSP[x]);
defineProperty(&lineEnableSP[x]);
}
if(ahp_xc_get_autocorrelator_jittersize() > 1)
defineBLOB(&autocorrelationsBP);
defineProperty(&autocorrelationsBP);
if(ahp_xc_get_crosscorrelator_jittersize() > 1)
defineBLOB(&crosscorrelationsBP);
defineNumber(&correlationsNP);
defineNumber(&settingsNP);
defineProperty(&crosscorrelationsBP);
defineProperty(&correlationsNP);
defineProperty(&settingsNP);
}
else
// We're disconnected
Expand Down Expand Up @@ -798,12 +798,12 @@ bool AHP_XC::ISNewSwitch(const char *dev, const char *name, ISState *states, cha
IUUpdateSwitch(&lineEnableSP[x], states, names, n);
if(lineEnableSP[x].sp[0].s == ISS_ON) {
ActiveLine(x, lineEnableSP[x].sp[0].s == ISS_ON, linePowerSP[x].sp[0].s == ISS_ON, lineActiveEdgeSP[x].sp[1].s == ISS_ON, lineEdgeTriggerSP[x].sp[1].s == ISS_ON);
defineSwitch(&linePowerSP[x]);
defineSwitch(&lineActiveEdgeSP[x]);
defineSwitch(&lineEdgeTriggerSP[x]);
defineNumber(&lineLocationNP[x]);
defineNumber(&lineDelayNP[x]);
defineNumber(&lineStatsNP[x]);
defineProperty(&linePowerSP[x]);
defineProperty(&lineActiveEdgeSP[x]);
defineProperty(&lineEdgeTriggerSP[x]);
defineProperty(&lineLocationNP[x]);
defineProperty(&lineDelayNP[x]);
defineProperty(&lineStatsNP[x]);
} else {
ActiveLine(x, false, false, false, false);
deleteProperty(linePowerSP[x].name);
Expand Down Expand Up @@ -917,20 +917,20 @@ void AHP_XC::TimerHit()
for (int x = 0; x < ahp_xc_get_nlines(); x++) {
double line_delay = delay[x];
double steradian = pow(asin(primaryAperture*0.5/primaryFocalLength), 2);
double photon_flux = ((double)totalcounts[x])*1000.0/POLLMS;
double photon_flux = ((double)totalcounts[x])*1000.0/getCurrentPollingPeriod();
double photon_flux0 = calc_photon_flux(0, settingsNP.np[1].value, settingsNP.np[0].value, steradian);
lineDelayNP[x].s = IPS_BUSY;
lineDelayNP[x].np[0].value = line_delay;
IDSetNumber(&lineDelayNP[x], nullptr);
lineStatsNP[x].s = IPS_BUSY;
lineStatsNP[x].np[0].value = ((double)totalcounts[x])*1000.0/(double)POLLMS;
lineStatsNP[x].np[0].value = ((double)totalcounts[x])*1000.0/(double)getCurrentPollingPeriod();
lineStatsNP[x].np[1].value = photon_flux/LUMEN(settingsNP.np[0].value);
lineStatsNP[x].np[2].value = photon_flux0/LUMEN(settingsNP.np[0].value);
lineStatsNP[x].np[3].value = calc_rel_magnitude(photon_flux, settingsNP.np[1].value, settingsNP.np[0].value, steradian);
IDSetNumber(&lineStatsNP[x], nullptr);
totalcounts[x] = 0;
for(int y = x+1; y < ahp_xc_get_nlines(); y++) {
correlationsNP.np[idx*2].value = (double)totalcorrelations[idx].correlations*1000.0/(double)POLLMS;
correlationsNP.np[idx*2].value = (double)totalcorrelations[idx].correlations*1000.0/(double)getCurrentPollingPeriod();
correlationsNP.np[idx*2+1].value = (double)totalcorrelations[idx].correlations/(double)totalcorrelations[idx].counts;
totalcorrelations[idx].counts = 0;
totalcorrelations[idx].correlations = 0;
Expand All @@ -945,7 +945,7 @@ void AHP_XC::TimerHit()
PrimaryCCD.setExposureLeft((double)timeleft);
}

SetTimer(POLLMS);
SetTimer(getCurrentPollingPeriod());

return;
}
Expand Down Expand Up @@ -1112,7 +1112,7 @@ bool AHP_XC::Connect()
IUFillNumberVector(&correlationsNP, correlationsN, ahp_xc_get_nbaselines()*2, getDeviceName(), "CORRELATIONS", "Correlations", "Stats", IP_RO, 60, IPS_BUSY);

// Start the timer
SetTimer(POLLMS);
SetTimer(getCurrentPollingPeriod());

readThread = new std::thread(&AHP_XC::Callback, this);

Expand Down
32 changes: 16 additions & 16 deletions indi-aok/lx200aok.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,9 @@ bool LX200Skywalker::updateProperties()
if (isConnected())
{
// registering here results in display at bottom of tab
defineSwitch(&MountStateSP);
defineNumber(&SystemSlewSpeedNP);
defineText(&FirmwareVersionTP);
defineProperty(&MountStateSP);
defineProperty(&SystemSlewSpeedNP);
defineProperty(&FirmwareVersionTP);
}
else
{
Expand Down Expand Up @@ -1468,38 +1468,38 @@ void LX200Skywalker::ISGetProperties(const char *dev)
if (isConnected())
{
if (HasTrackMode() && TrackModeS != nullptr)
defineSwitch(&TrackModeSP);
defineProperty(&TrackModeSP);
if (CanControlTrack())
defineSwitch(&TrackStateSP);
defineProperty(&TrackStateSP);
if (HasTrackRate())
defineNumber(&TrackRateNP);
defineProperty(&TrackRateNP);
}
/*
if (isConnected())
{
if (genericCapability & LX200_HAS_ALIGNMENT_TYPE)
defineSwitch(&AlignmentSP);
defineProperty(&AlignmentSP);
if (genericCapability & LX200_HAS_TRACKING_FREQ)
defineNumber(&TrackingFreqNP);
defineProperty(&TrackingFreqNP);
if (genericCapability & LX200_HAS_PULSE_GUIDING)
defineSwitch(&UsePulseCmdSP);
defineProperty(&UsePulseCmdSP);
if (genericCapability & LX200_HAS_SITES)
{
defineSwitch(&SiteSP);
defineText(&SiteNameTP);
defineProperty(&SiteSP);
defineProperty(&SiteNameTP);
}
defineNumber(&GuideNSNP);
defineNumber(&GuideWENP);
defineProperty(&GuideNSNP);
defineProperty(&GuideWENP);
if (genericCapability & LX200_HAS_FOCUS)
{
defineSwitch(&FocusMotionSP);
defineNumber(&FocusTimerNP);
defineSwitch(&FocusModeSP);
defineProperty(&FocusMotionSP);
defineProperty(&FocusTimerNP);
defineProperty(&FocusModeSP);
}
}
*/
Expand Down
22 changes: 11 additions & 11 deletions indi-apogee/apogee_ccd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ void ApogeeCCD::ISGetProperties(const char *dev)
{
INDI::CCD::ISGetProperties(dev);

defineSwitch(&PortTypeSP);
defineText(&NetworkInfoTP);
defineSwitch(&FilterTypeSP);
defineProperty(&PortTypeSP);
defineProperty(&NetworkInfoTP);
defineProperty(&FilterTypeSP);

loadConfig(true, PortTypeSP.name);
loadConfig(true, NetworkInfoTP.name);
Expand All @@ -207,20 +207,20 @@ bool ApogeeCCD::updateProperties()

if (isConnected())
{
defineText(&CamInfoTP);
defineSwitch(&CoolerSP);
defineNumber(&CoolerNP);
defineSwitch(&ReadOutSP);
defineSwitch(&FanStatusSP);
defineProperty(&CamInfoTP);
defineProperty(&CoolerSP);
defineProperty(&CoolerNP);
defineProperty(&ReadOutSP);
defineProperty(&FanStatusSP);
getCameraParams();

if (cfwFound)
{
INDI::FilterInterface::updateProperties();
defineText(&FilterInfoTP);
defineProperty(&FilterInfoTP);
}

timerID = SetTimer(POLLMS);
timerID = SetTimer(getCurrentPollingPeriod());
}
else
{
Expand Down Expand Up @@ -1471,7 +1471,7 @@ void ApogeeCCD::TimerHit()
}
}

SetTimer(POLLMS);
SetTimer(getCurrentPollingPeriod());
return;
}

Expand Down
12 changes: 6 additions & 6 deletions indi-apogee/apogee_cfw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ void ApogeeCFW::ISGetProperties(const char *dev)
{
INDI::FilterWheel::ISGetProperties(dev);

defineSwitch(&FilterTypeSP);
defineSwitch(&PortTypeSP);
defineText(&NetworkInfoTP);
defineProperty(&FilterTypeSP);
defineProperty(&PortTypeSP);
defineProperty(&NetworkInfoTP);

loadConfig(true, FilterTypeSP.name);
loadConfig(true, PortTypeSP.name);
Expand All @@ -133,8 +133,8 @@ bool ApogeeCFW::updateProperties()

if (isConnected())
{
defineText(&FilterInfoTP);
SetTimer(POLLMS);
defineProperty(&FilterInfoTP);
SetTimer(getCurrentPollingPeriod());
}
else
{
Expand Down Expand Up @@ -551,7 +551,7 @@ void ApogeeCFW::TimerHit()
}
}

SetTimer(POLLMS);
SetTimer(getCurrentPollingPeriod());
}

void ApogeeCFW::debugTriggered(bool enabled)
Expand Down
28 changes: 14 additions & 14 deletions indi-armadillo-platypus/arm_plat_focuser_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,17 +194,17 @@ bool ArmPlat::updateProperties()

if (isConnected())
{
defineSwitch(&PerPortSP);
defineNumber(&MaxSpeedNP);
defineNumber(&TemperatureNP);
defineSwitch(&IntExtTempSensorSP);
// defineSwitch(&FocuserBacklashSP);
// defineNumber(&BacklashNP);
defineSwitch(&HalfStepSP);
defineSwitch(&MotorTypeSP);
defineSwitch(&WiringSP);
//defineNumber(&SyncNP);
defineText(&FirmwareVersionTP);
defineProperty(&PerPortSP);
defineProperty(&MaxSpeedNP);
defineProperty(&TemperatureNP);
defineProperty(&IntExtTempSensorSP);
// defineProperty(&FocuserBacklashSP);
// defineProperty(&BacklashNP);
defineProperty(&HalfStepSP);
defineProperty(&MotorTypeSP);
defineProperty(&WiringSP);
//defineProperty(&SyncNP);
defineProperty(&FirmwareVersionTP);
if ( !loadConfig() )
LOG_ERROR("Error loading config" );
}
Expand Down Expand Up @@ -700,7 +700,7 @@ void ArmPlat::TimerHit()

if (!isConnected())
{
SetTimer(POLLMS);
SetTimer(getCurrentPollingPeriod());
return;
}

Expand All @@ -711,7 +711,7 @@ void ArmPlat::TimerHit()
DEBUG( INDI::Logger::DBG_WARNING, "Port must be selected (and configuration saved)" );
portWarned = true;
}
SetTimer(POLLMS);
SetTimer(getCurrentPollingPeriod());
return;
}
else
Expand Down Expand Up @@ -756,7 +756,7 @@ void ArmPlat::TimerHit()
}
}

SetTimer(POLLMS);
SetTimer(getCurrentPollingPeriod());
}

bool ArmPlat::AbortFocuser()
Expand Down
14 changes: 7 additions & 7 deletions indi-armadillo-platypus/dragonfly_dome.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Relay::Relay(uint8_t id, const std::string &device, const std::string &group)

void Relay::define(DD *parent)
{
parent->defineSwitch(&RelaySP);
parent->defineProperty(&RelaySP);
}

void Relay::remove(DD *parent)
Expand Down Expand Up @@ -206,7 +206,7 @@ void DragonFlyDome::ISGetProperties(const char *dev)
{
INDI::Dome::ISGetProperties(dev);

defineSwitch(&PerPortSP);
defineProperty(&PerPortSP);
loadConfig(true, PerPortSP.name);
}

Expand Down Expand Up @@ -235,16 +235,16 @@ bool DragonFlyDome::updateProperties()
SetParked(isSensorOn(parkedSensor));
}

defineText(&FirmwareVersionTP);
defineProperty(&FirmwareVersionTP);

// Relays
defineNumber(&DomeControlRelayNP);
defineProperty(&DomeControlRelayNP);
for (auto &oneRelay : Relays)
oneRelay->define(this);

// Sensors
defineNumber(&DomeControlSensorNP);
defineNumber(&SensorNP);
defineProperty(&DomeControlSensorNP);
defineProperty(&SensorNP);

}
else
Expand Down Expand Up @@ -464,7 +464,7 @@ void DragonFlyDome::TimerHit()
}
}

SetTimer(POLLMS);
SetTimer(getCurrentPollingPeriod());
}

//////////////////////////////////////////////////////////////////////////////
Expand Down
Loading

0 comments on commit 73f91fd

Please sign in to comment.