Skip to content

Commit

Permalink
add metadata for instance tracking of feature and title
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyLikness committed Aug 24, 2021
1 parent feaaa45 commit 9ae8ac3
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 59 deletions.
8 changes: 1 addition & 7 deletions applyHubbleToRGB.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,8 @@ Transforms red, "smoky" nebula to blueish with higher contrast.
#feature-id DeepSkyWorkflows > ApplyHubbleToRGB

#define TITLE "Apply Hubble Palette to RGB"

#ifndef FEATURE
#define FEATURE "applyHubbleToRGB"
#endif

#ifndef DEBUG_AH
#define DEBUG_AH false
#endif

#include "deepSkyCommon.js"
#include "applyHubbleToRGB/engine.js"
Expand All @@ -38,7 +32,7 @@ Transforms red, "smoky" nebula to blueish with higher contrast.
ds.debug.register(FEATURE, DEBUG_AH);
ds.debug[FEATURE].debugLn(TITLE, 'debugging is on.');

ds.features.register(FEATURE, hubbleEngine, { data: { toClose: [] }});
ds.features.register(FEATURE, TITLE, hubbleEngine, { data: { toClose: [] }});

ds.debug[FEATURE].debugLn(
'Registered feature: ',
Expand Down
2 changes: 1 addition & 1 deletion applyHubbleToRGB/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function hubbleDialog() {
this.lblHeadLine = new Label(this);
with (this.lblHeadLine) {
useRichText = true;
text = util.concatenateStr('<b>', TITLE, ' v', VERSION, '</b>');
text = util.concatenateStr('<b>', ds.activeFeature.title, ' v', ds.version, '</b>');
}

// my copyright
Expand Down
8 changes: 1 addition & 7 deletions autoLinearFitAndCombine.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,8 @@ then use LRGB to combine them.
#feature-id DeepSkyWorkflows > AutoLinearFit

#define TITLE "Auto Linear Fit"

#ifndef FEATURE
#define FEATURE "autoLinearFit"
#endif

#ifndef DEBUG_ALF
#define DEBUG_ALF false
#endif

#include "deepSkyCommon.js"

Expand Down Expand Up @@ -276,7 +270,7 @@ function featureDialog() {
ds.debug.register(FEATURE, DEBUG_ALF);
ds.debug[FEATURE].debugLn(TITLE, 'debugging is on.');

ds.features.register(FEATURE, {
ds.features.register(FEATURE, TITLE, {

separateChannels: function () {

Expand Down
8 changes: 1 addition & 7 deletions createLumMask.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,8 @@ This script will extract luminance and stretch it for a mask.
#feature-id DeepSkyWorkflows > CreateLumMask

#define TITLE "Luminance Mask"

#ifndef FEATURE
#define FEATURE "createLumMask"
#endif

#ifndef DEBUG_CLM
#define DEBUG_CLM false
#endif

#include "deepSkyCommon.js"

Expand All @@ -36,7 +30,7 @@ This script will extract luminance and stretch it for a mask.
ds.debug.register(FEATURE, DEBUG_CLM);
ds.debug[FEATURE].debugLn(TITLE, 'debugging is on.');

ds.features.register(FEATURE, {
ds.features.register(FEATURE, TITLE, {

genMask: function() {

Expand Down
7 changes: 5 additions & 2 deletions deepSkyInit.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Creates the global deepsky object.
*/

#ifndef VERSION
#define VERSION "0.5"
#define VERSION "0.6"
#define DEBUG_GLOBAL false
#endif

Expand Down Expand Up @@ -69,14 +69,17 @@ var deepSky = function (ds) {
ds.debug.global.debugLn('GLOBAL DEBUG ON');

ds.features = {
register: function (name, feature, initialState) {
register: function (name, title, feature, initialState) {

ds.features[name] = {
title: title,
engine: feature,
executionState: initialState || {},
dialog: null
};

ds.activeFeature = ds.features[name];

ds.getExecutionState = function () {
return ds.features[name].executionState;
};
Expand Down
11 changes: 9 additions & 2 deletions deepSkyUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,11 @@ User interface helpers.

createDialog: function (dlgFn) {

ds.debug.ui.debugLn("createDialogInvoked for", TITLE, "version", VERSION);
ds.debug.ui.debugLn(
"createDialogInvoked for",
ds.activeFeature.title,
"version",
ds.version);

let template = function () {
this.__base__ = Dialog;
Expand All @@ -333,7 +337,10 @@ User interface helpers.
template.prototype = new Dialog;
const dialog = new template;

dialog.windowTitle = ds.utilities.concatenateStr(TITLE, ' v', VERSION);
dialog.windowTitle = ds.utilities.concatenateStr(
ds.activeFeature.title,
' v',
ds.version);
dialog.adjustToContents();

return dialog;
Expand Down
2 changes: 1 addition & 1 deletion deepSkyUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Common utilities used across various scripts.
for (var arg = 0; arg < arguments.length; ++arg) {
var val = arguments[arg];
if (arg === 0) {
console.writeln(ds.utilities.concatenateStr('<b>', TITLE, '</b>: ', val));
console.writeln(ds.utilities.concatenateStr('<b>', ds.activeFeature.title, '</b>: ', val));
}
else {
console.writeln(val);
Expand Down
12 changes: 3 additions & 9 deletions fixRGBpixels.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,8 @@ them up by finding pixels that deviate from the other two channels and normalizi
#feature-id DeepSkyWorkflows > FixRGBPixels

#define TITLE "Fix RGB Pixels"

#ifndef FEATURE
#define FEATURE "fixRGBPixels"
#endif

#ifndef DEBUG_FRP
#define DEBUG_FRP false
#endif

#include "deepSkyCommon.js"

Expand Down Expand Up @@ -103,8 +97,8 @@ function frpDialog() {
this.lblCopyright = new Label(this);
this.lblCopyright.text = "© 2021, Jeremy Likness";

this.createNewInstance = ds.ui.align(ds.ui.createBoundCheckbox(dialog, 'createNewInstance',
ds.ui.align.ALIGN_RIGHT));
this.createNewInstance = ds.ui.align(ds.ui.createBoundCheckbox(dialog, 'createNewInstance'),
ds.ui.ALIGN_RIGHT);

// main settings
this.strengthSlider = ds.ui.createBoundNumericControl(dialog, 'strength',
Expand Down Expand Up @@ -144,7 +138,7 @@ function frpDialog() {
ds.debug.register(FEATURE, DEBUG_FRP);
ds.debug[FEATURE].debugLn(TITLE, 'debugging is on.');

ds.features.register(FEATURE, fixRGBEngine);
ds.features.register(FEATURE, TITLE, fixRGBEngine);

ds.debug[FEATURE].debugLn(
'Registered feature: ',
Expand Down
8 changes: 1 addition & 7 deletions generateDeconSupport.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,8 @@ This script implements my workflow for deconvolution. It will create:
#feature-id DeepSkyWorkflows > GenerateDeconSupport

#define TITLE "Generate Decon Support"

#ifndef DEBUG_GDS
#define DEBUG_GDS false
#endif

#ifndef FEATURE
#define FEATURE "generateDeconSupport"
#endif

#include "deepSkyCommon.js"
#include "./generateDeconSupport/engine.js"
Expand All @@ -44,7 +38,7 @@ This script implements my workflow for deconvolution. It will create:
ds.debug.register(FEATURE, DEBUG_GDS);
ds.debug[FEATURE].debugLn(TITLE, 'debugging is on.');

ds.features.register(FEATURE, deconEngine, { masks: {} });
ds.features.register(FEATURE, TITLE, deconEngine, { masks: {} });

ds.debug[FEATURE].debugLn(
'Registered feature: ',
Expand Down
9 changes: 1 addition & 8 deletions nonLinearStretch.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,8 @@ using luminance masks and curves transformations.
#feature-id DeepSkyWorkflows > NonLinearStretch

#define TITLE "Non-Linear Stretch"

#ifndef FEATURE
#define FEATURE "nonLinearStretch"
#endif


#ifndef DEBUG_NLS
#define DEBUG_NLS false
#endif

#include "deepSkyCommon.js"

Expand Down Expand Up @@ -181,7 +174,7 @@ function nlsDialog() {
ds.debug.register(FEATURE, DEBUG_NLS);
ds.debug[FEATURE].debugLn(TITLE, 'debugging is on.');

ds.features.register(FEATURE, {
ds.features.register(FEATURE, TITLE, {

getCurvesTransformation: function (up) {

Expand Down
9 changes: 1 addition & 8 deletions template.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,8 @@ This script is intended as a starting reference for new scripts.
*/

#define TITLE "Template"

#ifndef FEATURE
#define FEATURE "template"
#endif


#ifndef DEBUG_TEMPLATE
#define DEBUG_TEMPLATE false
#endif

#include "deepSkyCommon.js"

Expand Down Expand Up @@ -119,7 +112,7 @@ function tDialog() {
ds.debug.register(FEATURE, DEBUG_TEMPLATE);
ds.debug[FEATURE].debugLn(TITLE, 'debugging is on.');

ds.features.register(FEATURE, {
ds.features.register(FEATURE, TITLE, {

alert: function (msg) {
this.debugLn('alert called with parameter', msg.toString());
Expand Down

0 comments on commit 9ae8ac3

Please sign in to comment.