Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use AS instead of THIS #959

Merged
merged 2 commits into from
Jan 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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