Skip to content

Commit

Permalink
Fix ZWO nicknames causing loading issue with camera. Fix multiple EAF…
Browse files Browse the repository at this point in the history
…s and EFWs not loading properly under some conditions. Remove legacy ASI names that was causing this confusion for end users
  • Loading branch information
knro committed Jan 17, 2024
1 parent 745a7e7 commit e65d225
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 33 deletions.
7 changes: 7 additions & 0 deletions debian/indi-asi/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
indi-asi (2.4) jammy; urgency=medium

* Fixed issue with multiple EAFs not detected properly.
* Fixed ASI Camera nicknames causing camera to not load properly.

-- Jasem Mutlaq <[email protected]> Wed, 17 Jan 2023 15:00:00 +0300

indi-asi (2.3) jammy; urgency=medium

* Added support to EAF extended step range in firmware version 3.3.7.
Expand Down
2 changes: 1 addition & 1 deletion indi-asi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ find_package(USB1 REQUIRED)
find_package(Threads REQUIRED)

set(ASI_VERSION_MAJOR 2)
set(ASI_VERSION_MINOR 3)
set(ASI_VERSION_MINOR 4)

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h )
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/indi_asi.xml.cmake ${CMAKE_CURRENT_BINARY_DIR}/indi_asi.xml)
Expand Down
9 changes: 6 additions & 3 deletions indi-asi/asi_ccd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,13 @@ ASICCD::ASICCD(const ASI_CAMERA_INFO &camInfo, const std::string &cameraName,
auto nickname = mNicknames[mSerialNumber];
if (!nickname.empty())
{
setDeviceName(nickname.c_str());
mCameraName = nickname;
auto finalName = nickname;
if (finalName.find("ZWO CCD") != 0)
finalName = "ZWO CCD " + finalName;
setDeviceName(finalName.c_str());
mCameraName = finalName;
mNickname = nickname;
LOGF_INFO("Using nickname %s for serial number %s.", nickname.c_str(), mSerialNumber.c_str());
LOGF_INFO("Using nickname %s for serial number %s.", finalName.c_str(), mSerialNumber.c_str());
return;
}
}
Expand Down
15 changes: 6 additions & 9 deletions indi-asi/asi_focuser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ static class Loader
}

int iAvailableFocusersCount_ok = 0;
char *envDev = getenv("INDIDEV");
for (int i = 0; i < iAvailableFocusersCount; i++)
{
int id;
Expand Down Expand Up @@ -76,17 +77,13 @@ static class Loader
EAFClose(id);

std::string name = "ASI EAF";
if (envDev && envDev[0])
name = envDev;

// If we only have a single device connected
// then favor the INDIDEV driver label over the auto-generated name above
if (iAvailableFocusersCount == 1)
{
char *envDev = getenv("INDIDEV");
if (envDev && envDev[0])
name = envDev;
}
else
name += " " + std::to_string(i);
if (iAvailableFocusersCount > 1)
name += " " + std::to_string(i + 1);

focusers.push_back(std::unique_ptr<ASIEAF>(new ASIEAF(info, name.c_str())));
iAvailableFocusersCount_ok++;
Expand All @@ -99,7 +96,7 @@ ASIEAF::ASIEAF(const EAF_INFO &info, const char *name)
: m_ID(info.ID)
, m_MaxSteps(info.MaxStep)
{
setVersion(1, 1);
setVersion(1, 2);

// Can move in Absolute & Relative motions, can AbortFocuser motion, and can reverse.
FI::SetCapability(FOCUSER_CAN_ABS_MOVE |
Expand Down
14 changes: 6 additions & 8 deletions indi-asi/asi_wheel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ static class Loader
return;
}
int num_wheels_ok = 0;
char *envDev = getenv("INDIDEV");
for (int i = 0; i < num_wheels; i++)
{
int id;
Expand All @@ -79,17 +80,14 @@ static class Loader
continue;
}
std::string name = "ASI " + std::string(info.Name);
if (envDev && envDev[0])
name = envDev;

// If we only have a single device connected
// then favor the INDIDEV driver label over the auto-generated name above
if (num_wheels == 1)
{
char *envDev = getenv("INDIDEV");
if (envDev && envDev[0])
name = envDev;
}
else
name += " " + std::to_string(i);
if (num_wheels > 1)
name += " " + std::to_string(i + 1);

wheels.push_back(std::unique_ptr<ASIWHEEL>(new ASIWHEEL(info, name.c_str())));
num_wheels_ok++;
}
Expand Down
12 changes: 0 additions & 12 deletions indi-asi/indi_asi.xml.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,18 @@
</device>
</devGroup>
<devGroup group="Filter Wheels">
<device label="ASI EFW" mdpd="true" manufacturer="ZWO">
<driver name="ASI EFW">indi_asi_wheel</driver>
<version>@ASI_VERSION_MAJOR@.@ASI_VERSION_MINOR@</version>
</device>
<device label="ZWO EFW" mdpd="true" manufacturer="ZWO">
<driver name="ZWO EFW">indi_asi_wheel</driver>
<version>@ASI_VERSION_MAJOR@.@ASI_VERSION_MINOR@</version>
</device>
</devGroup>
<devGroup group="Focusers">
<device label="ASI EAF" manufacturer="ZWO">
<driver name="ASI EAF">indi_asi_focuser</driver>
<version>@ASI_VERSION_MAJOR@.@ASI_VERSION_MINOR@</version>
</device>
<device label="ZWO EAF" manufacturer="ZWO">
<driver name="ZWO EAF">indi_asi_focuser</driver>
<version>@ASI_VERSION_MAJOR@.@ASI_VERSION_MINOR@</version>
</device>
</devGroup>
<devGroup group="Auxiliary">
<device label="ASI ST4" manufacturer="ZWO">
<driver name="ASI ST4">indi_asi_st4</driver>
<version>@ASI_VERSION_MAJOR@.@ASI_VERSION_MINOR@</version>
</device>
<device label="ZWO ST4" manufacturer="ZWO">
<driver name="ASI ST4">indi_asi_st4</driver>
<version>@ASI_VERSION_MAJOR@.@ASI_VERSION_MINOR@</version>
Expand Down

0 comments on commit e65d225

Please sign in to comment.