The simulator settings are hold in property
which are also
saved:
SimulatorSettingsNP.save(fp)
but indeed changing values in the property and saving them e.g.
SimulatorSettingsNP[SIM_XRES].fill("SIM_XRES", "CCD X resolution", "%4.0f", 512, 8192, 512, 1280);
SimulatorSettingsNP[SIM_YRES].fill("SIM_YRES", "CCD Y resolution", "%4.0f", 512, 8192, 512, 1024);
SimulatorSettingsNP[SIM_XSIZE].fill("SIM_XSIZE", "CCD X Pixel Size", "%4.2f", 1, 30, 5, 5.2);
SimulatorSettingsNP[SIM_YSIZE].fill("SIM_YSIZE", "CCD Y Pixel Size", "%4.2f", 1, 30, 5, 5.2);
are subsequently loading back the property does not work. Also the step sizes do not seemsto be correct (e.g. X resolution can only be changed in 512 pixel steps, etc..)
Another property is
:
inline static const std::vector<std::pair<uint32_t, uint32_t>> Resolutions =
{
{1280, 1024},
{6000, 4000}
};
// Resolution
for (uint8_t i = 0; i < Resolutions.size(); i++)
{
std::ostringstream ss;
ss << Resolutions[i].first << " x " << Resolutions[i].second;
ResolutionSP[i].fill(ss.str().c_str(), ss.str().c_str(), i == 0 ? ISS_ON : ISS_OFF);
}
ResolutionSP.fill(getDeviceName(), "CCD_RESOLUTION", "Resolution", SIMULATOR_TAB, IP_RW, ISR_1OFMANY, 60, IPS_IDLE);
This property is used so far I can see only used in 3rdparty in toupek driver but nowhere else:
[indi-3rdparty]$ grep -r "CCD_RESOLUTION" . master
./indi-toupbase/indi_toupbase.cpp: IUFillSwitchVector(&m_ResolutionSP, m_ResolutionS, m_Instance->model->preview, getDeviceName(), "CCD_RESOLUTION",
[indi]$ grep -r "CCD_RESOLUTION" .
./drivers/ccd/ccd_simulator.cpp: ResolutionSP.fill(getDeviceName(), "CCD_RESOLUTION", "Resolution", SIMULATOR_TAB, IP_RW, ISR_1OFMANY, 60, IPS_IDLE);
How about removing CCD_RESOLUTION/ResolutionSP property and refactoring the CCD_Simulator code?