diff --git a/Makefile b/Makefile index e3374e9..bf9624c 100755 --- a/Makefile +++ b/Makefile @@ -65,6 +65,7 @@ #++ Mar 5, 2023 Re-organizing object lists #++ Dec 2, 2023 Added piswitch3 #++ Apr 22, 2024 Added _INCLUDE_MULTI_LANGUAGE_SUPPORT_ +#++ Jun 16, 2024 Updated QSI Makefile entry ###################################################################################### # Cr_Core is for the Sony camera ###################################################################################### @@ -2440,14 +2441,16 @@ qsi : DEFINEFLAGS += -D_ENABLE_QSI_ qsi : DEFINEFLAGS += -D_USE_OPENCV_ qsi : INCLUDES += -I$(QSI_INCLUDE_DIR) qsi : \ - $(CPP_OBJECTS) \ $(DRIVER_OBJECTS) \ + $(CAMERA_DRIVER_OBJECTS) \ $(SOCKET_OBJECTS) \ + $(HELPER_OBJECTS) \ $(LINK) \ - $(SOCKET_OBJECTS) \ - $(CPP_OBJECTS) \ $(DRIVER_OBJECTS) \ + $(CAMERA_DRIVER_OBJECTS) \ + $(SOCKET_OBJECTS) \ + $(HELPER_OBJECTS) \ $(OPENCV_LINK) \ -lcfitsio \ -lqsiapi \ diff --git a/alpacapi_EditHistory.txt b/alpacapi_EditHistory.txt index 03a8583..4f13003 100755 --- a/alpacapi_EditHistory.txt +++ b/alpacapi_EditHistory.txt @@ -1,4 +1,4 @@ -History Comments found =3502 in 522 files +History Comments found =3505 in 522 files PDS_ReadNASAfiles.c:28 //* Jan 26, 1992 Reading of PDS files into Mac program from CD working PDS_ReadNASAfiles.c:29 //* Mar 14, 1992 Starting on more detailed interpretation of label (header) PDS_ReadNASAfiles.c:30 //* Mar 16, 1992 Changed number of displayed bytes from 836 to 800 @@ -2674,7 +2674,7 @@ rotatordriver_sim.cpp:26 //* Mar 2, 2023 CONFORMU-rotatordriver_sim -> P switchdriver_sim.cpp:25 //* Mar 2, 2023 Created switchdriver_sim.cpp switchdriver_sim.h:11 //* Mar 2, 2023 Created switchdriver_sim.h alpacadriver.cpp:157 //* Mar 3, 2023 Added ProcessAlpacaCommand() -alpacadriver.cpp:4088 //* Mar 3, 2023 Make CONFORMU happy, check for valid device number +alpacadriver.cpp:4089 //* Mar 3, 2023 Make CONFORMU happy, check for valid device number alpacadriver_helper.c:13 //* Mar 3, 2023 Added FindDeviceTypeByStringLowerCase() calibration_sim.cpp:20 //* Mar 3, 2023 Created calibration_sim.cpp cameradriver_SONY.cpp:1295 //* Mar 3, 2023 this line caused a compile err @@ -3482,13 +3482,16 @@ SkyTravelTimeRoutines.c:7 //* Jun 11, 2024 Added SetCurrentTime() windowtab_skytravel.cpp:129 //* Jun 11, 2024 Changed cAutoAdvanceTime to global, gAutoAdvanceTime windowtab_solarsystem.cpp:24 //* Jun 11, 2024 Added time adjustment key commands identical to SkyTravel window KeplerEquations.cpp:6 //* Jun 12, 2024 Added ReadAsteroidElementsData() -windowtab_solarsystem.cpp:25 //* Jun 12, 2024 DrawAsteriods() & DrawAstronomicalScale() +windowtab_solarsystem.cpp:25 //* Jun 12, 2024 Added DrawAsteriods() & DrawAstronomicalScale() windowtab_solarsystem.cpp:26 //* Jun 12, 2024 Added DrawCrossHairs() windowtab_solarsystem.cpp:27 //* Jun 13, 2024 Added DrawKuiperBelt() KeplerEquations.cpp:7 //* Jun 14, 2024 Added ReadTransNeptunianData() windowtab_solarsystem.cpp:28 //* Jun 14, 2024 Added DrawOrbits() cameradriver.cpp:212 //* Jun 15, 2024 Fixed case bug in Put_SaveAsPNG() alpaca_defs.h:100 //* Jun 16, 2024 Build 179 - pushed to github +Makefile:68 #++ Jun 16, 2024 Updated QSI Makefile entry +alpacadriver.cpp:194 //* Jun 17, 2024 Fixed bug in ProcessCmdLineArgs(), -p6502 caused a segmentation fault +cameradriver_QSI.cpp:42 //* Jun 17, 2024 Fixed bug in CreateCameraObjects_QSI() invalid camera count cameradriver.cpp:214 //* Jan 1, 2119 ---------------------------------------- cameradriver.cpp:215 //* Jun 26, 2119 Add support for sub frames cameradriver_png.cpp:33 //* Jan 31, 2120 Add support for libpng @@ -3501,19 +3504,19 @@ controller_camera.cpp:79 //* Feb 6, 2121 Move downloading of images to cameradriver_QHY.cpp:52 //* Oct 10, 2122 Add support for percentcompleted to QHY camera driver spectrodriver.cpp:33 //* May 7, 2123 Add support for SlitID, SlitAngle, SlitWidth controller_dome.cpp:47 //* Jun 25, 2123 Add slaved to DeviceState -History Comments found = 3502 in 522 files -Total lines = 246837 -Total comment Lines = 40475 (16.4%) -Total comments = 45460 (18.4%) -Total history comments = 3502 (1.4%) +History Comments found = 3505 in 522 files +Total lines = 246878 +Total comment Lines = 40487 (16.4%) +Total comments = 45472 (18.4%) +Total history comments = 3505 (1.4%) Total C files = 69 Total C++ files = 196 Total H files = 255 -Preprocssor cnt = 7892 -Total SLOC = 156858 -Total SLOC-Logical = 120969 +Preprocssor cnt = 7893 +Total SLOC = 156884 +Total SLOC-Logical = 120997 Programmer comment summary -MLS = 3092 +MLS = 3095 TODO = 11 DDB = 1 JMH = 3 diff --git a/download_extra_data.sh b/download_extra_data.sh index 8d26167..9477cb1 100755 --- a/download_extra_data.sh +++ b/download_extra_data.sh @@ -55,7 +55,7 @@ then echo "Something is wrong, the folder exists but the data folder is missing" fi else - echo "Downloading via git................." + echo "Downloading milkyway outline data via git................." git clone https://github.com/ofrohn/d3-celestial.git fi diff --git a/src/alpacadriver.cpp b/src/alpacadriver.cpp index a8db44d..48aaad4 100644 --- a/src/alpacadriver.cpp +++ b/src/alpacadriver.cpp @@ -191,6 +191,7 @@ //* May 18, 2024 Added _DEBUG_MANAGEMENT_ //* May 18, 2024 Fixed cSendJSONresponse bug, not initialized to true //* Jun 1, 2024 Global GPS now looks for Emlid and if found, uses that port +//* Jun 17, 2024 Fixed bug in ProcessCmdLineArgs(), -p6502 caused a segmentation fault //***************************************************************************** //* to install code blocks 20 //* Step 1: sudo add-apt-repository ppa:codeblocks-devs/release @@ -4376,6 +4377,8 @@ int iii; char theChar; int newListenPort; +// CONSOLE_DEBUG(__FUNCTION__); + for (iii=1; iiicontentData, - "Gain", - gainString, - (sizeof(gainString) -1)); - if (gainFound) + if (IsValidNumericString(gainString)) { - if (IsValidNumericString(gainString)) + newGainValue = atoi(gainString); + if ((newGainValue >= cCameraProp.GainMin) && (newGainValue <= cCameraProp.GainMax)) { - newGainValue = atoi(gainString); - if ((newGainValue >= cCameraProp.GainMin) && (newGainValue <= cCameraProp.GainMax)) - { - alpacaErrCode = Write_Gain(newGainValue); - if (alpacaErrCode == kASCOM_Err_Success) - { - cCameraProp.Gain = newGainValue; - } - } - else + alpacaErrCode = Write_Gain(newGainValue); + if (alpacaErrCode == kASCOM_Err_Success) { - alpacaErrCode = kASCOM_Err_InvalidValue; - reqData->httpRetCode = 400; - GENERATE_ALPACAPI_ERRMSG(alpacaErrMsg, "Gain value outside of min/max"); - CONSOLE_DEBUG(alpacaErrMsg); + cCameraProp.Gain = newGainValue; } } else { alpacaErrCode = kASCOM_Err_InvalidValue; reqData->httpRetCode = 400; - GENERATE_ALPACAPI_ERRMSG(alpacaErrMsg, "Gain value is non-numeric"); + GENERATE_ALPACAPI_ERRMSG(alpacaErrMsg, "Gain value outside of min/max"); CONSOLE_DEBUG(alpacaErrMsg); } } @@ -2517,24 +2507,26 @@ char gainString[32]; { alpacaErrCode = kASCOM_Err_InvalidValue; reqData->httpRetCode = 400; - GENERATE_ALPACAPI_ERRMSG(alpacaErrMsg, "Gain not specified"); + GENERATE_ALPACAPI_ERRMSG(alpacaErrMsg, "Gain value is non-numeric"); CONSOLE_DEBUG(alpacaErrMsg); } - cBytesWrittenForThisCmd += JsonResponse_Add_Int32( reqData->socket, - reqData->jsonTextBuffer, - kMaxJsonBuffLen, - gValueString, - cCameraProp.Gain, - INCLUDE_COMMA); } else { - alpacaErrCode = kASCOM_Err_InternalError; + alpacaErrCode = kASCOM_Err_InvalidValue; + reqData->httpRetCode = 400; + GENERATE_ALPACAPI_ERRMSG(alpacaErrMsg, "Gain not specified"); + CONSOLE_DEBUG(alpacaErrMsg); } + cBytesWrittenForThisCmd += JsonResponse_Add_Int32( reqData->socket, + reqData->jsonTextBuffer, + kMaxJsonBuffLen, + gValueString, + cCameraProp.Gain, + INCLUDE_COMMA); return(alpacaErrCode); } - //***************************************************************************** TYPE_ASCOM_STATUS CameraDriver::Get_GainMax(TYPE_GetPutRequestData *reqData, char *alpacaErrMsg, const char *responseString) { @@ -2827,20 +2819,13 @@ TYPE_ASCOM_STATUS alpacaErrCode = kASCOM_Err_InternalError; if (cOffsetSupported) { - if (reqData != NULL) - { - cBytesWrittenForThisCmd += JsonResponse_Add_Int32( reqData->socket, - reqData->jsonTextBuffer, - kMaxJsonBuffLen, - responseString, //gValueString, - cCameraProp.Offset, - INCLUDE_COMMA); - alpacaErrCode = kASCOM_Err_Success; - } - else - { - alpacaErrCode = kASCOM_Err_InternalError; - } + cBytesWrittenForThisCmd += JsonResponse_Add_Int32( reqData->socket, + reqData->jsonTextBuffer, + kMaxJsonBuffLen, + responseString, //gValueString, + cCameraProp.Offset, + INCLUDE_COMMA); + alpacaErrCode = kASCOM_Err_Success; } else { @@ -3695,18 +3680,19 @@ double myExposureDuration_secs; double myExposure_usecs; bool lightFrame; - if (cVerboseDebug) +// if (cVerboseDebug) { CONSOLE_DEBUG(__FUNCTION__); CONSOLE_DEBUG_W_NUM("currentROIimageType\t=", cROIinfo.currentROIimageType); - CONSOLE_DEBUG_W_STR("contentData \t=", reqData->contentData); +// CONSOLE_DEBUG_W_STR("contentData \t=", reqData->contentData); +// CONSOLE_DEBUG_W_STR("htmlData\r\n", reqData->htmlData); + DumpRequestStructure(__FUNCTION__, reqData); } if (reqData != NULL) { lightFrame = true; - //* first we are going to check a bunch of stuff to make CONFORM happy if ((cCameraProp.CanAsymmetricBin == false) && (cCameraProp.BinX != cCameraProp.BinY)) { @@ -3790,6 +3776,13 @@ bool lightFrame; "exposure", currExposure_secs, INCLUDE_COMMA); + + cBytesWrittenForThisCmd += JsonResponse_Add_Bool(reqData->socket, + reqData->jsonTextBuffer, + kMaxJsonBuffLen, + "Light", + lightFrame, + INCLUDE_COMMA); } else { diff --git a/src/cameradriver_QSI.cpp b/src/cameradriver_QSI.cpp index 998421b..a81679f 100644 --- a/src/cameradriver_QSI.cpp +++ b/src/cameradriver_QSI.cpp @@ -39,6 +39,7 @@ //* May 18, 2022 Added Write_SensorTemp() //* May 18, 2022 SUPPORTED: QSI cameras //* Jun 7, 2022 Added maxbinx/y override until binning is implemented +//* Jun 17, 2024 Fixed bug in CreateCameraObjects_QSI() invalid camera count //***************************************************************************** #if defined(_ENABLE_CAMERA_) && defined(_ENABLE_QSI_) @@ -78,11 +79,29 @@ std::string text; std::string lastError(""); int numCamerasFound; QSICamera cQSIcam; +bool rulesFileOK; +char rulesFileName[] = "99-qsi.rules"; CONSOLE_DEBUG(__FUNCTION__); - numCamerasFound = 0; - camSerial[0] = ""; + numCamerasFound = 0; + cameraCreatedCount = 0; + camSerial[0] = ""; + + //---------------------------------------------------------------------- + //* check the rules file + rulesFileOK = Check_udev_rulesFile(rulesFileName); + if (rulesFileOK == false) + { + LogEvent( "camera", + "Problem with QSI rules", + NULL, + kASCOM_Err_Success, + rulesFileName); + CONSOLE_DEBUG_W_STR("QSI Rules file is not installed:", rulesFileName); + } + + cQSIcam.put_UseStructuredExceptions(false); qsi_Result = cQSIcam.get_DriverInfo(info); if (qsi_Result == QSI_OK) @@ -118,6 +137,7 @@ QSICamera cQSIcam; { //* for debugging without a camera new CameraDriverQSI(0, camSerial[0]); + cameraCreatedCount++; } } else diff --git a/src_skytravel/windowtab_fov.cpp b/src_skytravel/windowtab_fov.cpp index 5e402e9..88421c2 100755 --- a/src_skytravel/windowtab_fov.cpp +++ b/src_skytravel/windowtab_fov.cpp @@ -932,7 +932,6 @@ char textString[512]; char offsetsString[64]; char tempString[64]; int myDevCount; -bool hostNameIsIncluded; int hostNameLen; // CONSOLE_DEBUG(__FUNCTION__); @@ -965,7 +964,7 @@ int hostNameLen; if (cRemoteDeviceList[iii].alpacaDeviceNum > 0) { //* if the device number is not 0, we want to display it - sprintf(tempString, "%:%d",cRemoteDeviceList[iii].alpacaDeviceNum); + sprintf(tempString, ":%d",cRemoteDeviceList[iii].alpacaDeviceNum); strcat(nameString, tempString); } diff --git a/src_skytravel/windowtab_solarsystem.cpp b/src_skytravel/windowtab_solarsystem.cpp index d02b814..8ef2547 100644 --- a/src_skytravel/windowtab_solarsystem.cpp +++ b/src_skytravel/windowtab_solarsystem.cpp @@ -22,7 +22,7 @@ //* Jun 10, 2024 Solar system display working //* Jun 10, 2024 Verified display is correct https://www.theplanetstoday.com/index.html //* Jun 11, 2024 Added time adjustment key commands identical to SkyTravel window -//* Jun 12, 2024 DrawAsteriods() & DrawAstronomicalScale() +//* Jun 12, 2024 Added DrawAsteriods() & DrawAstronomicalScale() //* Jun 12, 2024 Added DrawCrossHairs() //* Jun 13, 2024 Added DrawKuiperBelt() //* Jun 14, 2024 Added DrawOrbits() @@ -231,28 +231,36 @@ int myChar; gAutoAdvanceTime = !gAutoAdvanceTime; break; + case 'A': case 'a': cDislayAsteriods = !cDislayAsteriods; break; case 'c': + case 'C': cCenter_X = cWidgetList[kSolarSystem_DisplayBox].left + (cWidgetList[kSolarSystem_DisplayBox].width / 2); cCenter_Y = cWidgetList[kSolarSystem_DisplayBox].top + (cWidgetList[kSolarSystem_DisplayBox].height / 2); break; //* set to Inner solar system + case 'I': case 'i': - cScaleFactor = kInnerSolarSystemScaleFactor; + cScaleFactor = kInnerSolarSystemScaleFactor; + cCenter_X = cWidgetList[kSolarSystem_DisplayBox].left + (cWidgetList[kSolarSystem_DisplayBox].width / 2); + cCenter_Y = cWidgetList[kSolarSystem_DisplayBox].top + (cWidgetList[kSolarSystem_DisplayBox].height / 2); break; + case 'K': case 'k': cDislayKuiperBelt = !cDislayKuiperBelt; break; + case 'O': case 'o': cDislayOrbit = !cDislayOrbit; break; + case 'P': case 'p': gTransNeptunianCount++; if (gTransNeptunianCount > 5) @@ -261,6 +269,7 @@ int myChar; } break; + case 'R': case 'r': cScaleFactor = kDefaultScaleFactor; cDislayOrbit = false; @@ -273,10 +282,12 @@ int myChar; cCenter_Y = cWidgetList[kSolarSystem_DisplayBox].top + (cWidgetList[kSolarSystem_DisplayBox].height / 2); break; + case 'U': case 'u': cDislayAUscale = !cDislayAUscale; break; + case 'X': case 'x': cDislayCrossHairs = !cDislayCrossHairs; break; @@ -578,9 +589,9 @@ struct tm myUtcTime; LLG_DrawCString(pt1_X + 5, pt1_Y, gPlanetKepData[iii].name); } } - sprintf(textBuff, "Scale Factor = %3.2f", cScaleFactor); + sprintf(textBuff, "Scale Factor = %3.0f (pixels per AU)", cScaleFactor); LLG_SetColor(W_WHITE); - LLG_DrawCString(graphWidget->left + 20, graphWidget->top + 40, textBuff); + LLG_DrawCString(graphWidget->left + 10, graphWidget->top + 30, textBuff); //----------------------------------------------------------------- //* Astronomical Units Scale