Skip to content

Commit

Permalink
Fix config issues
Browse files Browse the repository at this point in the history
  • Loading branch information
knro committed Mar 23, 2024
1 parent 0e01e42 commit 3256618
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions indi-asi/asi_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,12 +335,14 @@ bool ASIBase::initProperties()
FlipSP[FLIP_HORIZONTAL].fill("FLIP_HORIZONTAL", "Horizontal", ISS_OFF);
FlipSP[FLIP_VERTICAL].fill("FLIP_VERTICAL", "Vertical", ISS_OFF);
FlipSP.fill(getDeviceName(), "FLIP", "Flip", CONTROL_TAB, IP_RW, ISR_NOFMANY, 60, IPS_IDLE);
FlipSP.load();

VideoFormatSP.fill(getDeviceName(), "CCD_VIDEO_FORMAT", "Format", CONTROL_TAB, IP_RW, ISR_1OFMANY, 60, IPS_IDLE);

BlinkNP[BLINK_COUNT ].fill("BLINK_COUNT", "Blinks before exposure", "%2.0f", 0, 100, 1.000, 0);
BlinkNP[BLINK_DURATION].fill("BLINK_DURATION", "Blink duration", "%2.3f", 0, 60, 0.001, 0);
BlinkNP.fill(getDeviceName(), "BLINK", "Blink", CONTROL_TAB, IP_RW, 60, IPS_IDLE);
BlinkNP.load();

IUSaveText(&BayerT[2], getBayerString());

Expand Down Expand Up @@ -442,19 +444,16 @@ bool ASIBase::updateProperties()
if (!ControlNP.isEmpty())
{
defineProperty(ControlNP);
loadConfig(true, ControlNP.getName());
}

if (!ControlSP.isEmpty())
{
defineProperty(ControlSP);
loadConfig(true, ControlSP.getName());
}

if (hasFlipControl())
{
defineProperty(FlipSP);
loadConfig(true, FlipSP.getName());
}

if (!VideoFormatSP.isEmpty())
Expand Down Expand Up @@ -566,11 +565,6 @@ bool ASIBase::Connect()

bool ASIBase::Disconnect()
{
// Save all config before shutdown
saveConfig(true);

LOGF_DEBUG("Closing %s...", mCameraName.c_str());

stopGuidePulse(mTimerNS);
stopGuidePulse(mTimerWE);
mTimerTemperature.stop();
Expand Down Expand Up @@ -788,13 +782,15 @@ bool ASIBase::ISNewNumber(const char *dev, const char *name, double values[], ch

ControlNP.setState(IPS_OK);
ControlNP.apply();
saveConfig(ControlNP);
return true;
}

if (BlinkNP.isNameMatch(name))
{
BlinkNP.setState(BlinkNP.update(values, names, n) ? IPS_OK : IPS_ALERT);
BlinkNP.apply();
saveConfig(BlinkNP);
return true;
}
}
Expand Down Expand Up @@ -846,6 +842,7 @@ bool ASIBase::ISNewSwitch(const char *dev, const char *name, ISState *states, ch

ControlSP.setState(IPS_OK);
ControlSP.apply();
saveConfig(ControlSP);
return true;
}

Expand Down Expand Up @@ -875,6 +872,7 @@ bool ASIBase::ISNewSwitch(const char *dev, const char *name, ISState *states, ch

FlipSP.setState(IPS_OK);
FlipSP.apply();
saveConfig(FlipSP);
return true;
}

Expand Down Expand Up @@ -922,6 +920,8 @@ bool ASIBase::ISNewSwitch(const char *dev, const char *name, ISState *states, ch
VideoFormatSP.setState(IPS_OK);
VideoFormatSP.apply();
}

saveConfig(VideoFormatSP);
return true;
}
}
Expand Down

0 comments on commit 3256618

Please sign in to comment.