Skip to content

Commit 9ae8ac3

Browse files
committed
add metadata for instance tracking of feature and title
1 parent feaaa45 commit 9ae8ac3

File tree

11 files changed

+25
-59
lines changed

11 files changed

+25
-59
lines changed

applyHubbleToRGB.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,8 @@ Transforms red, "smoky" nebula to blueish with higher contrast.
2020
#feature-id DeepSkyWorkflows > ApplyHubbleToRGB
2121

2222
#define TITLE "Apply Hubble Palette to RGB"
23-
24-
#ifndef FEATURE
2523
#define FEATURE "applyHubbleToRGB"
26-
#endif
27-
28-
#ifndef DEBUG_AH
2924
#define DEBUG_AH false
30-
#endif
3125

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

41-
ds.features.register(FEATURE, hubbleEngine, { data: { toClose: [] }});
35+
ds.features.register(FEATURE, TITLE, hubbleEngine, { data: { toClose: [] }});
4236

4337
ds.debug[FEATURE].debugLn(
4438
'Registered feature: ',

applyHubbleToRGB/ui.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function hubbleDialog() {
3232
this.lblHeadLine = new Label(this);
3333
with (this.lblHeadLine) {
3434
useRichText = true;
35-
text = util.concatenateStr('<b>', TITLE, ' v', VERSION, '</b>');
35+
text = util.concatenateStr('<b>', ds.activeFeature.title, ' v', ds.version, '</b>');
3636
}
3737

3838
// my copyright

autoLinearFitAndCombine.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,8 @@ then use LRGB to combine them.
2323
#feature-id DeepSkyWorkflows > AutoLinearFit
2424

2525
#define TITLE "Auto Linear Fit"
26-
27-
#ifndef FEATURE
2826
#define FEATURE "autoLinearFit"
29-
#endif
30-
31-
#ifndef DEBUG_ALF
3227
#define DEBUG_ALF false
33-
#endif
3428

3529
#include "deepSkyCommon.js"
3630

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

279-
ds.features.register(FEATURE, {
273+
ds.features.register(FEATURE, TITLE, {
280274

281275
separateChannels: function () {
282276

createLumMask.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,8 @@ This script will extract luminance and stretch it for a mask.
2020
#feature-id DeepSkyWorkflows > CreateLumMask
2121

2222
#define TITLE "Luminance Mask"
23-
24-
#ifndef FEATURE
2523
#define FEATURE "createLumMask"
26-
#endif
27-
28-
#ifndef DEBUG_CLM
2924
#define DEBUG_CLM false
30-
#endif
3125

3226
#include "deepSkyCommon.js"
3327

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

39-
ds.features.register(FEATURE, {
33+
ds.features.register(FEATURE, TITLE, {
4034

4135
genMask: function() {
4236

deepSkyInit.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Creates the global deepsky object.
1818
*/
1919

2020
#ifndef VERSION
21-
#define VERSION "0.5"
21+
#define VERSION "0.6"
2222
#define DEBUG_GLOBAL false
2323
#endif
2424

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

7171
ds.features = {
72-
register: function (name, feature, initialState) {
72+
register: function (name, title, feature, initialState) {
7373

7474
ds.features[name] = {
75+
title: title,
7576
engine: feature,
7677
executionState: initialState || {},
7778
dialog: null
7879
};
7980

81+
ds.activeFeature = ds.features[name];
82+
8083
ds.getExecutionState = function () {
8184
return ds.features[name].executionState;
8285
};

deepSkyUI.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,11 @@ User interface helpers.
315315

316316
createDialog: function (dlgFn) {
317317

318-
ds.debug.ui.debugLn("createDialogInvoked for", TITLE, "version", VERSION);
318+
ds.debug.ui.debugLn(
319+
"createDialogInvoked for",
320+
ds.activeFeature.title,
321+
"version",
322+
ds.version);
319323

320324
let template = function () {
321325
this.__base__ = Dialog;
@@ -333,7 +337,10 @@ User interface helpers.
333337
template.prototype = new Dialog;
334338
const dialog = new template;
335339

336-
dialog.windowTitle = ds.utilities.concatenateStr(TITLE, ' v', VERSION);
340+
dialog.windowTitle = ds.utilities.concatenateStr(
341+
ds.activeFeature.title,
342+
' v',
343+
ds.version);
337344
dialog.adjustToContents();
338345

339346
return dialog;

deepSkyUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Common utilities used across various scripts.
5454
for (var arg = 0; arg < arguments.length; ++arg) {
5555
var val = arguments[arg];
5656
if (arg === 0) {
57-
console.writeln(ds.utilities.concatenateStr('<b>', TITLE, '</b>: ', val));
57+
console.writeln(ds.utilities.concatenateStr('<b>', ds.activeFeature.title, '</b>: ', val));
5858
}
5959
else {
6060
console.writeln(val);

fixRGBpixels.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,8 @@ them up by finding pixels that deviate from the other two channels and normalizi
2121
#feature-id DeepSkyWorkflows > FixRGBPixels
2222

2323
#define TITLE "Fix RGB Pixels"
24-
25-
#ifndef FEATURE
2624
#define FEATURE "fixRGBPixels"
27-
#endif
28-
29-
#ifndef DEBUG_FRP
3025
#define DEBUG_FRP false
31-
#endif
3226

3327
#include "deepSkyCommon.js"
3428

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

106-
this.createNewInstance = ds.ui.align(ds.ui.createBoundCheckbox(dialog, 'createNewInstance',
107-
ds.ui.align.ALIGN_RIGHT));
100+
this.createNewInstance = ds.ui.align(ds.ui.createBoundCheckbox(dialog, 'createNewInstance'),
101+
ds.ui.ALIGN_RIGHT);
108102

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

147-
ds.features.register(FEATURE, fixRGBEngine);
141+
ds.features.register(FEATURE, TITLE, fixRGBEngine);
148142

149143
ds.debug[FEATURE].debugLn(
150144
'Registered feature: ',

generateDeconSupport.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,8 @@ This script implements my workflow for deconvolution. It will create:
2626
#feature-id DeepSkyWorkflows > GenerateDeconSupport
2727

2828
#define TITLE "Generate Decon Support"
29-
30-
#ifndef DEBUG_GDS
3129
#define DEBUG_GDS false
32-
#endif
33-
34-
#ifndef FEATURE
3530
#define FEATURE "generateDeconSupport"
36-
#endif
3731

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

47-
ds.features.register(FEATURE, deconEngine, { masks: {} });
41+
ds.features.register(FEATURE, TITLE, deconEngine, { masks: {} });
4842

4943
ds.debug[FEATURE].debugLn(
5044
'Registered feature: ',

nonLinearStretch.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,8 @@ using luminance masks and curves transformations.
2121
#feature-id DeepSkyWorkflows > NonLinearStretch
2222

2323
#define TITLE "Non-Linear Stretch"
24-
25-
#ifndef FEATURE
2624
#define FEATURE "nonLinearStretch"
27-
#endif
28-
29-
30-
#ifndef DEBUG_NLS
3125
#define DEBUG_NLS false
32-
#endif
3326

3427
#include "deepSkyCommon.js"
3528

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

184-
ds.features.register(FEATURE, {
177+
ds.features.register(FEATURE, TITLE, {
185178

186179
getCurvesTransformation: function (up) {
187180

0 commit comments

Comments
 (0)