Skip to content
Open
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
3 changes: 3 additions & 0 deletions dist/src/api_codes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export function wideangleURL(IP: string): string;
export function telephotoURL(IP: string): string;
export function rawPreviewURL(IP: string): string;
export function utcURL(IP: string): string;
export function timeZoneURL(IP: string): string;
export const turnOnCameraCmd: 10000;
export const turnOffCameraCmd: 10017;
export const telephotoCamera: 0;
Expand Down Expand Up @@ -63,6 +64,7 @@ export const statusWorkingStateTelephotoCmd: 10022;
export const statusWideangleCmd: 10217;
export const calibrateGotoCmd: 11205;
export const startGotoCmd: 11203;
export const stopGotoCmd: 11204;
export namespace planetsValueId {
let Mercury: number;
let Venus: number;
Expand Down Expand Up @@ -98,6 +100,7 @@ export const rawPreviewSingleComposite: 2;
export const takeAstroDarkFramesCmd: 10026;
export const darkGainDefault: 65528;
export const queryShotFieldCmd: 10027;
export const astroAutofocusCmd: 10031;
export const traceInitCmd: 11200;
export const startTrackingCmd: 11201;
export const stopTrackingCmd: 11202;
Expand Down
2 changes: 1 addition & 1 deletion dist/src/api_codes.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions dist/src/api_codes.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ export const rawPreviewURL = (IP) => `http://${IP}:8092/rawstream`;
* @returns {string}
*/
export const utcURL = (IP) => `http://${IP}:8092/date?date=`;
/**
* @param {string} IP
* @returns {string}
*/
export const timeZoneURL = (IP) => `http://${IP}:8092/timezone?timezone=`;
// ===============
// 3.1 image transmission
// ===============
Expand Down Expand Up @@ -116,6 +121,7 @@ export const statusWideangleCmd = 10217;
// goto
export const calibrateGotoCmd = 11205;
export const startGotoCmd = 11203;
export const stopGotoCmd = 11204;
export const planetsValueId = {
Mercury: 0,
Venus: 1,
Expand Down Expand Up @@ -155,6 +161,8 @@ export const takeAstroDarkFramesCmd = 10026;
export const darkGainDefault = 65528;
// query shot field
export const queryShotFieldCmd = 10027;
// astro Autofocus
export const astroAutofocusCmd = 10031;
// ===============
// 4.2 tracking
// ===============
Expand Down
25 changes: 21 additions & 4 deletions dist/src/astro.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
* @returns {string}
*/
export function formatUtcUrl(IP: string): string;
/**
* 4.1.1bis TimeZone name (Not Documented)
* @param {string} IP
* @param {string} timezone
* @returns {string}
*/
export function formatTimeZoneUrl(IP: string, timezone: string): string;
/**
* 4.1.2 correction
* @param {number} latitude
Expand All @@ -13,14 +20,19 @@ export function formatUtcUrl(IP: string): string;
export function calibrateGoto(latitude: number, longitude: number): any;
/**
* 4.1.3 Start goto
* @param {number|null} planet
* @param {string} rightAscension
* @param {string} declination
* @param {number|null|undefined} planet
* @param {number} rightAscension
* @param {number} declination
* @param {number} latitude
* @param {number} longitude
* @returns {Object}
*/
export function startGoto(planet: number | null, rightAscension: string, declination: string, latitude: number, longitude: number): any;
export function startGoto(planet: number | null | undefined, rightAscension: number, declination: number, latitude: number, longitude: number): any;
/**
* 4.1.3bis Stop goto (Not documented)
* @returns {Object}
*/
export function stopGoto(): any;
/**
* 4.1.4 Take raw pictures
* @param {string} rightAscension
Expand Down Expand Up @@ -60,4 +72,9 @@ export function takeAstroDarks(binning: number, exposure: number, count?: number
* @returns {Object}
*/
export function queryShotField(binning: number): any;
/**
* 4.1.12 Astro Autofocus
* @returns {Object}
*/
export function astroAutofocus(): any;
//# sourceMappingURL=astro.d.ts.map
2 changes: 1 addition & 1 deletion dist/src/astro.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 41 additions & 7 deletions dist/src/astro.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @module astro */
import { telephotoCamera, calibrateGotoCmd, startGotoCmd, binning2x2, fileTiff, takeAstroPhotoCmd, takeAstroDarkFramesCmd, darkGainDefault, utcURL, stopAstroPhotoCmd, rawPreviewContinousSuperimpose, queryShotFieldCmd, setRAWPreviewCmd, } from "./api_codes.js";
import { nowUTC, nowLocal, nowLocalFileName } from "./api_utils.js";
import { telephotoCamera, calibrateGotoCmd, startGotoCmd, stopGotoCmd, binning2x2, fileTiff, takeAstroPhotoCmd, takeAstroDarkFramesCmd, darkGainDefault, utcURL, timeZoneURL, stopAstroPhotoCmd, rawPreviewContinousSuperimpose, queryShotFieldCmd, astroAutofocusCmd, setRAWPreviewCmd, } from "./api_codes.js";
import { nowUTC, nowLocalFileName } from "./api_utils.js";
/**
* 4.1.1 UTC+0 time
* @param {string} IP
Expand All @@ -9,6 +9,15 @@ import { nowUTC, nowLocal, nowLocalFileName } from "./api_utils.js";
export function formatUtcUrl(IP) {
return `${utcURL(IP)}${nowUTC()}`;
}
/**
* 4.1.1bis TimeZone name (Not Documented)
* @param {string} IP
* @param {string} timezone
* @returns {string}
*/
export function formatTimeZoneUrl(IP, timezone) {
return `${timeZoneURL(IP)}${timezone}`;
}
/**
* 4.1.2 correction
* @param {number} latitude
Expand All @@ -21,16 +30,16 @@ export function calibrateGoto(latitude, longitude) {
camId: telephotoCamera,
lon: longitude,
lat: latitude,
date: nowLocal(),
date: nowUTC(),
path: `DWARF_GOTO_${nowLocalFileName()}`,
};
return options;
}
/**
* 4.1.3 Start goto
* @param {number|null} planet
* @param {string} rightAscension
* @param {string} declination
* @param {number|null|undefined} planet
* @param {number} rightAscension
* @param {number} declination
* @param {number} latitude
* @param {number} longitude
* @returns {Object}
Expand All @@ -41,18 +50,31 @@ export function startGoto(planet, rightAscension, declination, latitude, longitu
camId: telephotoCamera,
lon: longitude,
lat: latitude,
date: nowLocal(),
date: nowUTC(),
path: `DWARF_GOTO_${nowLocalFileName()}`,
};
if (planet !== undefined && planet !== null) {
options.planet = planet;
options.ra = 0.0;
options.dec = 0.0;
}
else {
options.ra = rightAscension;
options.dec = declination;
}
return options;
}
/**
* 4.1.3bis Stop goto (Not documented)
* @returns {Object}
*/
export function stopGoto() {
const options = {
interface: stopGotoCmd,
camId: telephotoCamera,
};
return options;
}
/**
* 4.1.4 Take raw pictures
* @param {string} rightAscension
Expand Down Expand Up @@ -89,6 +111,7 @@ export function takeAstroPhoto(rightAscension, declination, exposureTime, gain,
export function stopAstroPhoto() {
const options = {
interface: stopAstroPhotoCmd,
camId: telephotoCamera,
};
return options;
}
Expand Down Expand Up @@ -142,3 +165,14 @@ export function queryShotField(binning) {
};
return options;
}
/**
* 4.1.12 Astro Autofocus
* @returns {Object}
*/
export function astroAutofocus() {
const options = {
interface: astroAutofocusCmd,
camId: telephotoCamera,
};
return options;
}
Loading