Skip to content

Commit ba01a5a

Browse files
authored
Update capture_RPi.cpp: Implement callSaveImage
1 parent 3d2cc71 commit ba01a5a

1 file changed

Lines changed: 22 additions & 18 deletions

File tree

src/capture_RPi.cpp

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -944,25 +944,29 @@ myModeMeanSetting.modeMean = CG.myModeMeanSetting.modeMean;
944944
Log(4, " > Saving %s image '%s'\n",
945945
CG.takeDarkFrames ? "dark" : dayOrNight.c_str(), CG.finalFileName);
946946

947-
char cmd[1100+strlen(CG.allskyHome)];
948-
949-
if (CG.focusMode)
950-
{
951-
snprintf(cmd, sizeof(cmd), "%s/saveImage.sh %s '%s' --focus-mode %ld %d", CG.allskyScripts,
952-
dayOrNight.c_str(), CG.fullFilename, CG.lastFocusMetric, numExposures);
953-
// In focusMode, wait for processing to complete since we
954-
// don't otherwise delay between images.
955-
}
956-
else
957-
{
958-
snprintf(cmd, sizeof(cmd), "%s/saveImage.sh %s '%s'", CG.allskyScripts,
959-
dayOrNight.c_str(), CG.fullFilename);
960-
add_variables_to_command(CG, cmd, exposureStartDateTime);
961-
strcat(cmd, " &");
947+
if (CG.callSaveImage) {
948+
char cmd[1100+strlen(CG.allskyHome)];
949+
950+
if (CG.focusMode)
951+
{
952+
snprintf(cmd, sizeof(cmd), "%s/saveImage.sh %s '%s' --focus-mode %ld %d", CG.allskyScripts,
953+
dayOrNight.c_str(), CG.fullFilename, CG.lastFocusMetric, numExposures);
954+
// In focusMode, wait for processing to complete since we
955+
// don't otherwise delay between images.
956+
}
957+
else
958+
{
959+
snprintf(cmd, sizeof(cmd), "%s/saveImage.sh %s '%s'", CG.allskyScripts,
960+
dayOrNight.c_str(), CG.fullFilename);
961+
add_variables_to_command(CG, cmd, exposureStartDateTime);
962+
strcat(cmd, " &");
963+
}
964+
965+
// Not too useful to check return code for commands run in the background.
966+
system(cmd);
967+
} else {
968+
Log(3, "=== Saved %s\n", CG.fullFilename);
962969
}
963-
964-
// Not too useful to check return code for commands run in the background.
965-
system(cmd);
966970
} else {
967971
// We're not using the image so delete it.
968972
unlink(savedImage.c_str());

0 commit comments

Comments
 (0)