Skip to content

Commit

Permalink
Merge pull request #959 from thomasjacquin/Use-AS-instead-of-THIS
Browse files Browse the repository at this point in the history
Use AS instead of THIS
  • Loading branch information
linuxkidd authored Jan 21, 2022
2 parents ed9a9b5 + d597357 commit 7052ab3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions scripts/darkCapture.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ if [ ! -f "${CURRENT_IMAGE}" ]; then
exit 2
fi

# ${THIS_TEMPERATURE} is passed to us by saveImage.sh, but may be null.
# If ${THIS_TEMPERATURE} is set, use it as the temperature, otherwise read the ${TEMPERATURE_FILE}.
# ${AS_TEMPERATURE} is passed to us by saveImage.sh, but may be null.
# If ${AS_TEMPERATURE} is set, use it as the temperature, otherwise read the ${TEMPERATURE_FILE}.
# If the ${TEMPERATURE_FILE} file doesn't exist, set the temperature to "n/a".
if [ "${THIS_TEMPERATURE}" = "" ]; then
if [ "${AS_TEMPERATURE}" = "" ]; then
TEMPERATURE_FILE="${ALLSKY_TMP}/temperature.txt"
if [ -s "${TEMPERATURE_FILE}" ]; then # -s so we don't use an empty file
THIS_TEMPERATURE=$( < ${TEMPERATURE_FILE})
AS_TEMPERATURE=$( < ${TEMPERATURE_FILE})
else
THIS_TEMPERATURE="n/a"
AS_TEMPERATURE="n/a"
fi
fi

Expand All @@ -35,10 +35,10 @@ if [ "${DARK_MODE}" = "1" ] ; then
mkdir -p "${DARKS_DIR}"
# If the camera doesn't support temperature, we will keep overwriting the file until
# the user creates a temperature.txt file.
if [ "${THIS_TEMPERATURE}" = "n/a" ]; then
if [ "${AS_TEMPERATURE}" = "n/a" ]; then
cp "${CURRENT_IMAGE}" "${DARKS_DIR}"
else
cp "${CURRENT_IMAGE}" "${DARKS_DIR}/${THIS_TEMPERATURE}.${DARK_EXTENSION}"
cp "${CURRENT_IMAGE}" "${DARKS_DIR}/${AS_TEMPERATURE}.${DARK_EXTENSION}"
fi

# If the user has notification images on, the current image says we're taking dark frames,
Expand Down
2 changes: 1 addition & 1 deletion scripts/saveImage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ fi
# Get passed-in variables.
# Normally at least the exposure will be passed and the sensor temp if known.
while [ $# -gt 0 ]; do
VARIABLE="THIS_${1%=*}" # everything before the "="
VARIABLE="AS_${1%=*}" # everything before the "="
VALUE="${1##*=}" # everything after the "="
shift
# Export the variable so other scripts we call can use it.
Expand Down

0 comments on commit 7052ab3

Please sign in to comment.