Skip to content

Commit

Permalink
Merge branch 'indilib:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
AstroAir authored Sep 26, 2023
2 parents 65ea27a + ff8656b commit f388736
Show file tree
Hide file tree
Showing 34 changed files with 10,747 additions and 406 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,8 @@ endif()
if(INDI_BUILD_DRIVERS OR INDI_BUILD_CLIENT OR INDI_BUILD_QT5_CLIENT)
install(FILES
${CMAKE_CURRENT_SOURCE_DIR}/libs/json.h
${CMAKE_CURRENT_SOURCE_DIR}/libs/httplib.h
${CMAKE_CURRENT_SOURCE_DIR}/libs/inicpp.h
${CMAKE_CURRENT_BINARY_DIR}/indiversion.h
DESTINATION ${INCLUDE_INSTALL_DIR}/libindi COMPONENT Devel
)
Expand Down
2 changes: 1 addition & 1 deletion cmake_modules/UnityBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ MACRO (ENABLE_UNITY_BUILD TARGET_NAME SOURCE_VARIABLE_NAME UNIT_SIZE EXTENSION)
# Limit is zero based conversion of unit_size
MATH(EXPR LIMIT ${UNIT_SIZE}-1)
SET(FILES ${SOURCE_VARIABLE_NAME})
# Effectivly ignore the source files from the build, but keep track them for changes.
# Effectively ignore the source files from the build, but keep track them for changes.
SET_SOURCE_FILES_PROPERTIES(${${FILES}} PROPERTIES HEADER_FILE_ONLY true)
# Counts the number of source files up to the threshold
SET(COUNTER ${LIMIT})
Expand Down
8 changes: 6 additions & 2 deletions drivers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@
</device>
<device label="Rainbow RST-135" manufacturer="Rainbow Astro">
<driver name="Rainbow">indi_rainbow_telescope</driver>
<version>1.1</version>
<version>1.3</version>
</device>
<device label="Rainbow RST-300" manufacturer="Rainbow Astro">
<driver name="Rainbow">indi_rainbow_telescope</driver>
<version>1.1</version>
<version>1.3</version>
</device>
<device label="CRUX TitanTCS" manufacturer="HOBYM">
<driver name="CRUX TitanTCS">indi_crux_mount</driver>
Expand Down Expand Up @@ -303,6 +303,10 @@
<driver name="PMC8">indi_pmc8_telescope</driver>
<version>0.5</version>
</device>
<device label="Planewave" manufacturer="Planewave Instruments">
<driver name="Planewave">indi_planewave_telescope</driver>
<version>0.1</version>
</device>
</devGroup>
<devGroup group="Focusers">
<device label="Focuser Simulator" manufacturer="Simulator">
Expand Down
10 changes: 5 additions & 5 deletions drivers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ All drivers must provide complete and up to date user Documentation. The documen

# Documentation Template

Below are some documentation templates that can be used to write new documentation for your driver. Be direct, simple, and make no assumptions on the user knowledge. The documentation should be friendly to new useres with clear instructions accompined with screenshots and visual aids to ensure proper communication.
Below are some documentation templates that can be used to write new documentation for your driver. Be direct, simple, and make no assumptions on the user knowledge. The documentation should be friendly to new useres with clear instructions accompanied with screenshots and visual aids to ensure proper communication.

Screenshots for the driver functionalities are required. You can use whatever GUI client of your choice when submitting the screenshots. The format must be JPG and named after the INDI group/tab they belong to (e.g. main_control.jpg, options.jpg..etc).

Expand Down Expand Up @@ -92,7 +92,7 @@ sudo apt-get update &amp;&amp; sudo apt-get install indi-DRIVER_NAME
<li><strong>Both</strong>: Dome locks &amp; Dome parks policies are applied.</li>
</ul>
<br /><img style="display: block; margin-left: auto; margin-right: auto;" src="/images/devices/DRIVER_NAME/options.jpg" alt="Options" /></li>
<li><strong>Scope Properties</strong>: Enter the Primary and Seconday scope information.&nbsp;Up to six different configurations for&nbsp;<em>Primary</em>&nbsp;and Secondary&nbsp;<em>Guider</em>&nbsp;telescopes can be saved separately, each with an optional unique label in <strong>Scope Name</strong> property.</li>
<li><strong>Scope Properties</strong>: Enter the Primary and Secondary scope information.&nbsp;Up to six different configurations for&nbsp;<em>Primary</em>&nbsp;and Secondary&nbsp;<em>Guider</em>&nbsp;telescopes can be saved separately, each with an optional unique label in <strong>Scope Name</strong> property.</li>
<li><strong>Scope Config</strong>: Select the active scope configuration.</li>
<li><strong>Joystick</strong>: Enable or Disable joystick support. An INDI Joystick driver must be running for this function to work. For more details, check the <a href="/support/tutorials/135-controlling-your-telescope-with-a-joystick.html">INDI Telescope Joystick</a> tutorial.</li>
</ul>
Expand All @@ -103,7 +103,7 @@ sudo apt-get update &amp;&amp; sudo apt-get install indi-DRIVER_NAME
<li><strong>Motion N/S/W/E</strong>: Directional manual motion control. Press the button to start the movement and release the button to stop.</li>
<li><strong>Slew Rate</strong>: Rate of manual motion control above where 1x equals one sidereal rate.</li>
<li><strong>Guide N/S/W/E</strong>: Guiding pulses durations in milliseconds. This property is meant for guider application (e.g. PHD2) and not intended to be used directly.</li>
<li><strong>Guiding Rate</strong>: Guiding Rate for RA &amp; DE. 0.3 means the mount shall move at 30% of the sidereal rate when the pulse is active. The sideral rate is ~15.04 arcseconds per second. So at 0.3x, the mount shall move 0.3*15.04 = 4.5 arcsecond per second. When receving a pulse for 1000ms, the total theoritical motion 4.5 arcseconds.</li>
<li><strong>Guiding Rate</strong>: Guiding Rate for RA &amp; DE. 0.3 means the mount shall move at 30% of the sidereal rate when the pulse is active. The sidereal rate is ~15.04 arcseconds per second. So at 0.3x, the mount shall move 0.3*15.04 = 4.5 arcsecond per second. When receiving a pulse for 1000ms, the total theoretical motion 4.5 arcseconds.</li>
<li><strong>Custom Speeds</strong>: Customs speeds in RA &amp; DEC axis when performing&nbsp;GOTO.</li>
<li><strong>Track Default</strong>: Default tracking rate to be used on startup.</li>
<li><strong>ST4 N/S/W/E</strong>: If the mount is receiving guiding pulses via ST4, apply this rate.</li>
Expand Down Expand Up @@ -195,7 +195,7 @@ This provides general information about the currently running driver and driver
<ul>
<li><strong>Frame</strong>: Set the desired <i>Region-Of-Interest</i> (ROI) by specifying the starting X and Y positions of the image and the desired width and height. It is recommended to set use even numbers only to enable binning if required. The ROI values are indenepdent of the binning used.</li>
<li><strong>Binning</strong>: Set the desired binning.</li>
<li>The usually supported image compression can be turned on in image settings to compress FITS images. This might require more processing but can reduce the size of the image by <b>up to 70%</b>. The uploaded image would have an extenstion of .fits.fz and it can be viewed in multiple clients like KStars.</li>
<li>The usually supported image compression can be turned on in image settings to compress FITS images. This might require more processing but can reduce the size of the image by <b>up to 70%</b>. The uploaded image would have an extension of .fits.fz and it can be viewed in multiple clients like KStars.</li>
<li>The <b>Frame Type</b> property is used to mark the frame type in the FITS header which is useful information for some processing applications. If there an electronic or mechanical shutter, the driver closes it automatically when taking dark frames.</li>
<li>To restore the ROI to the default values, click on the <b>Reset</b> button.</li>
<h3>Image Info</h3>
Expand Down Expand Up @@ -238,7 +238,7 @@ List what the driver supports.
<h3>Connecting to DRIVER_NAME</h3>
<p>
1. How is the device connectd? USB? Ethernet? WiFi..etc?
1. How is the device connected? USB? Ethernet? WiFi..etc?
2. Dedicate a section to each connection method. Put images of each. What configuration required..etc
3. Any special settings to take care of to ensure successful connection?
</p>
Expand Down
11 changes: 7 additions & 4 deletions drivers/ccd/ccd_simulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,9 @@ bool CCDSim::initProperties()
IPS_IDLE);

// FWHM
auto focuser = ActiveDeviceT[ACTIVE_FOCUSER].text ? ActiveDeviceT[ACTIVE_FOCUSER].text : "";
IUFillNumber(&FWHMN[0], "SIM_FWHM", "FWHM (arcseconds)", "%4.2f", 0, 60, 0, 7.5);
IUFillNumberVector(&FWHMNP, FWHMN, 1, ActiveDeviceT[ACTIVE_FOCUSER].text, "FWHM", "FWHM", OPTIONS_TAB, IP_RO, 60, IPS_IDLE);
IUFillNumberVector(&FWHMNP, FWHMN, 1, focuser, "FWHM", "FWHM", OPTIONS_TAB, IP_RO, 60, IPS_IDLE);

// Cooler
IUFillSwitch(&CoolerS[INDI_ENABLED], "COOLER_ON", "ON", ISS_OFF);
Expand All @@ -188,14 +189,16 @@ bool CCDSim::initProperties()
DirectorySP[INDI_DISABLED].fill("INDI_DISABLED", "Disabled", ISS_ON);
DirectorySP.fill(getDeviceName(), "CCD_DIRECTORY_TOGGLE", "Use Dir.", SIMULATOR_TAB, IP_RW, ISR_1OFMANY, 60, IPS_IDLE);

auto mount = ActiveDeviceT[ACTIVE_TELESCOPE].text ? ActiveDeviceT[ACTIVE_TELESCOPE].text : "";

#ifdef USE_EQUATORIAL_PE
IDSnoopDevice(ActiveDeviceT[0].text, "EQUATORIAL_PE");
IDSnoopDevice(mount, "EQUATORIAL_PE");
#else
IDSnoopDevice(ActiveDeviceT[ACTIVE_TELESCOPE].text, "EQUATORIAL_EOD_COORD");
IDSnoopDevice(mount, "EQUATORIAL_EOD_COORD");
#endif


IDSnoopDevice(ActiveDeviceT[ACTIVE_FOCUSER].text, "FWHM");
IDSnoopDevice(focuser, "FWHM");

uint32_t cap = 0;

Expand Down
2 changes: 1 addition & 1 deletion drivers/ccd/guide_simulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ int GuideSim::DrawCcdFrame(INDI::CCDChip * targetChip)

while (fgets(line, 256, pp) != nullptr)
{
// ok, lets parse this line for specifcs we want
// ok, lets parse this line for specifics we want
char id[20];
char plate[6];
char ob[6];
Expand Down
36 changes: 5 additions & 31 deletions drivers/focuser/deepskydad_af3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,6 @@ bool DeepSkyDadAF3::initProperties()
FocusBacklashN[0].step = 1;
FocusBacklashN[0].value = 0;

// Max. movement
IUFillNumber(&FocusMaxMoveN[0], "MAX_MOVE", "Steps", "%7.0f", 0, 9999999, 100, 0);
IUFillNumberVector(&FocusMaxMoveNP, FocusMaxMoveN, 1, getDeviceName(), "FOCUS_MAX_MOVE", "Max. movement",
MAIN_CONTROL_TAB, IP_RW, 0, IPS_IDLE);

// Settle buffer
IUFillNumber(&SettleBufferN[0], "SETTLE_BUFFER", "Period (ms)", "%5.0f", 0, 99999, 100, 0);
IUFillNumberVector(&SettleBufferNP, SettleBufferN, 1, getDeviceName(), "FOCUS_SETTLE_BUFFER", "Settle buffer",
Expand Down Expand Up @@ -132,7 +127,6 @@ bool DeepSkyDadAF3::updateProperties()

if (isConnected())
{
defineProperty(&FocusMaxMoveNP);
defineProperty(&StepModeSP);
defineProperty(&SpeedModeSP);
defineProperty(&SettleBufferNP);
Expand All @@ -146,7 +140,6 @@ bool DeepSkyDadAF3::updateProperties()
}
else
{
deleteProperty(FocusMaxMoveNP.name);
deleteProperty(StepModeSP.name);
deleteProperty(SpeedModeSP.name);
deleteProperty(SettleBufferNP.name);
Expand Down Expand Up @@ -293,8 +286,8 @@ bool DeepSkyDadAF3::readMaxMovement()
int rc = sscanf(res, "(%d)", &steps);
if (rc > 0)
{
FocusMaxMoveN[0].value = steps;
FocusMaxMoveNP.s = IPS_OK;
FocusMaxPosN[0].value = steps;
FocusMaxPosNP.s = IPS_OK;
}
else
{
Expand Down Expand Up @@ -654,25 +647,6 @@ bool DeepSkyDadAF3::ISNewNumber(const char * dev, const char * name, double valu
IDSetNumber(&FocusMaxPosNP, nullptr);
return true;
}

// Max. movement
// if (strcmp(name, FocusMaxMoveNP.name) == 0)
// {
// IUUpdateNumber(&FocusMaxMoveNP, values, names, n);
// char cmd[DSD_RES] = {0};
// snprintf(cmd, DSD_RES, "[SMXM%d]", static_cast<int>(FocusMaxMoveN[0].value));
// bool rc = sendCommandSet(cmd);
// if (!rc)
// {
// FocusMaxMoveNP.s = IPS_ALERT;
// return false;
// }

// FocusMaxMoveNP.s = IPS_OK;
// IDSetNumber(&FocusMaxMoveNP, nullptr);
// return true;
// }

}

return INDI::Focuser::ISNewNumber(dev, name, values, names, n);
Expand Down Expand Up @@ -705,7 +679,7 @@ void DeepSkyDadAF3::GetFocusParams()
IDSetNumber(&FocusMaxPosNP, nullptr);

if (readMaxMovement())
IDSetNumber(&FocusMaxMoveNP, nullptr);
IDSetNumber(&FocusMaxPosNP, nullptr);

if (readTemperature())
IDSetNumber(&TemperatureNP, nullptr);
Expand Down Expand Up @@ -804,7 +778,8 @@ void DeepSkyDadAF3::TimerHit()
{
if (!isMoving())
{
if( backlashComp == 0 ) {
if( backlashComp == 0 )
{
FocusAbsPosNP.s = IPS_OK;
FocusRelPosNP.s = IPS_OK;
}
Expand Down Expand Up @@ -858,7 +833,6 @@ bool DeepSkyDadAF3::saveConfigItems(FILE * fp)

IUSaveConfigSwitch(fp, &StepModeSP);
IUSaveConfigSwitch(fp, &SpeedModeSP);
IUSaveConfigNumber(fp, &FocusMaxMoveNP);
IUSaveConfigNumber(fp, &SettleBufferNP);
IUSaveConfigNumber(fp, &MoveCurrentMultiplierNP);
IUSaveConfigNumber(fp, &HoldCurrentMultiplierNP);
Expand Down
4 changes: 0 additions & 4 deletions drivers/focuser/deepskydad_af3.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,6 @@ class DeepSkyDadAF3 : public INDI::Focuser
INumber HoldCurrentMultiplierN[1];
INumberVectorProperty HoldCurrentMultiplierNP;

// Max movement
INumber FocusMaxMoveN[1];
INumberVectorProperty FocusMaxMoveNP;

// Settle buffer
INumber SettleBufferN[1];
INumberVectorProperty SettleBufferNP;
Expand Down
5 changes: 4 additions & 1 deletion drivers/focuser/lacerta_mfoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,10 @@ IPState lacerta_mfoc::MoveAbsFocuser(uint32_t targetTicks)
IPState lacerta_mfoc::MoveRelFocuser(FocusDirection dir, uint32_t ticks)
{
// Calculation of the demand absolute position
auto targetTicks = std::clamp(FocusAbsPosN[0].value + (ticks * (dir == FOCUS_INWARD ? -1 : 1)), FocusAbsPosN[0].min, FocusAbsPosN[0].max);
auto targetTicks = FocusAbsPosN[0].value;
if (dir == FOCUS_INWARD) targetTicks -= ticks;
else targetTicks += ticks;
targetTicks = std::clamp(targetTicks, FocusAbsPosN[0].min, FocusAbsPosN[0].max);

FocusAbsPosNP.s = IPS_BUSY;
IDSetNumber(&FocusAbsPosNP, nullptr);
Expand Down
5 changes: 4 additions & 1 deletion drivers/focuser/lacerta_mfoc_fmc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,10 @@ IPState lacerta_mfoc_fmc::MoveAbsFocuser(uint32_t targetTicks)
IPState lacerta_mfoc_fmc::MoveRelFocuser(FocusDirection dir, uint32_t ticks)
{
// Calculation of the demand absolute position
auto targetTicks = std::clamp(FocusAbsPosN[0].value + (ticks * (dir == FOCUS_INWARD ? -1 : 1)), FocusAbsPosN[0].min, FocusAbsPosN[0].max);
auto targetTicks = FocusAbsPosN[0].value;
if (dir == FOCUS_INWARD) targetTicks -= ticks;
else targetTicks += ticks;
targetTicks = std::clamp(targetTicks, FocusAbsPosN[0].min, FocusAbsPosN[0].max);

FocusAbsPosNP.s = IPS_BUSY;
IDSetNumber(&FocusAbsPosNP, nullptr);
Expand Down
8 changes: 8 additions & 0 deletions drivers/telescope/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -257,3 +257,11 @@ add_executable(indi_skywatcherAltAzMount
target_link_libraries(indi_skywatcherAltAzMount AlignmentDriver indidriver)

install(TARGETS indi_skywatcherAltAzMount RUNTIME DESTINATION bin)

# ########## Planewave Mount ##############
add_executable(indi_planewave_telescope
planewave_mount.cpp)

target_link_libraries(indi_planewave_telescope indidriver)

install(TARGETS indi_planewave_telescope RUNTIME DESTINATION bin)
12 changes: 12 additions & 0 deletions drivers/telescope/ioptronv3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,10 @@ bool IOptronV3::ReadScopeStatus()
if (isSimulation())
mountSim();

// Do not query mount if parked already.
if (TrackState == SCOPE_PARKED)
return true;

rc = driver->getStatus(&newInfo);

if (rc)
Expand Down Expand Up @@ -976,6 +980,10 @@ bool IOptronV3::Handshake()

bool IOptronV3::updateTime(ln_date *utc, double utc_offset)
{
// No communications while parked.
if (TrackState == SCOPE_PARKED)
return true;

bool rc1 = driver->setUTCDateTime(ln_get_julian_day(utc));

bool rc2 = driver->setUTCOffset(utc_offset * 60);
Expand All @@ -987,6 +995,10 @@ bool IOptronV3::updateLocation(double latitude, double longitude, double elevati
{
INDI_UNUSED(elevation);

// No communications while parked.
if (TrackState == SCOPE_PARKED)
return true;

if (longitude > 180)
longitude -= 360;

Expand Down
26 changes: 11 additions & 15 deletions drivers/telescope/lx200am5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ bool LX200AM5::initProperties()
{
LX200Generic::initProperties();

SetParkDataType(PARK_NONE);
SetParkDataType(PARK_SIMPLE);
timeFormat = LX200_24;

tcpConnection->setDefaultHost("192.168.4.1");
Expand Down Expand Up @@ -171,20 +171,7 @@ void LX200AM5::setup()
// MountTypeSP.setState(setMountType(MountTypeSP.findOnSwitchIndex()) ? IPS_OK : IPS_ALERT);
// MountTypeSP.apply();

if (InitPark())
{
// If loading parking data is successful, we just set the default parking values.
SetAxis1ParkDefault(LocationN[LOCATION_LATITUDE].value >= 0 ? 0 : 180);
SetAxis2ParkDefault(LocationN[LOCATION_LATITUDE].value);
}
else
{
// Otherwise, we set all parking data to default in case no parking data is found.
SetAxis1Park(LocationN[LOCATION_LATITUDE].value >= 0 ? 0 : 180);
SetAxis2Park(LocationN[LOCATION_LATITUDE].value);
SetAxis1ParkDefault(LocationN[LOCATION_LATITUDE].value >= 0 ? 0 : 180);
SetAxis2ParkDefault(LocationN[LOCATION_LATITUDE].value);
}
InitPark();

getMountType();
getTrackMode();
Expand Down Expand Up @@ -473,6 +460,15 @@ bool LX200AM5::Park()
return rc;
}

/////////////////////////////////////////////////////////////////////////////
///
/////////////////////////////////////////////////////////////////////////////
bool LX200AM5::UnPark()
{
TrackState = SCOPE_IDLE;
return true;
}

/////////////////////////////////////////////////////////////////////////////
///
/////////////////////////////////////////////////////////////////////////////
Expand Down
1 change: 1 addition & 0 deletions drivers/telescope/lx200am5.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class LX200AM5 : public LX200Generic

// Parking
virtual bool Park() override;
virtual bool UnPark() override;

private:

Expand Down
Loading

0 comments on commit f388736

Please sign in to comment.