Skip to content

Commit 3bae000

Browse files
committed
DM-7784-7963: getting the cutout value and pass it to the URL retrieve fixed
1 parent 18f8fa0 commit 3bae000

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

src/firefly/js/templates/lightcurve/LcManager.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {dispatchTableToIgnore} from '../../visualize/DrawLayerCntlr.js';
1818
import Catlog from '../../drawingLayers/Catalog.js';
1919
import {ServerRequest} from '../../data/ServerRequest.js';
2020
import {CHANGE_VIEWER_LAYOUT} from '../../visualize/MultiViewCntlr.js';
21-
import LcPFOptionsPanel, {getCutoutValue} from './LcPhaseFoldingPanel.jsx';
21+
import {LcPFOptionsPanel, grpkey} from './LcPhaseFoldingPanel.jsx';
2222
import FieldGroupUtils, {revalidateFields} from '../../fieldGroup/FieldGroupUtils';
2323

2424
export const RAW_TABLE = 'raw_table';
@@ -166,7 +166,9 @@ function getWebPlotRequestViaUrl(tableModel, hlrow) {
166166
const scan_id = res[1] + res[2];
167167
const scangrp = res[2];
168168
const frame_num = res[3];
169-
const cutoutsize = tableModel.request.cutout_size || 0.3;
169+
170+
let {cutoutSize} = FieldGroupUtils.getGroupFields(grpkey);
171+
const cutoutsize = cutoutSize.value;
170172

171173
/*the following should be from reading in the url column returned from LC search
172174
we are constructing the url for wise as the LC table does
@@ -190,7 +192,7 @@ function getWebPlotRequestViaUrl(tableModel, hlrow) {
190192

191193
}
192194

193-
function setupImages(tbl_id) {
195+
export function setupImages(tbl_id) {
194196
const viewer= getViewer(getMultiViewRoot(),IMG_VIEWER_ID);
195197
const count= get(viewer, 'layoutDetail.count',DEF_IMAGE_CNT);
196198
const tableModel = getTblById(tbl_id);

src/firefly/js/templates/lightcurve/LcPhaseFoldingPanel.jsx

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ import {dispatchShowDialog} from '../../core/ComponentCntlr.js';
2727
import {dispatchTableSearch, TABLE_HIGHLIGHT} from '../../tables/TablesCntlr.js';
2828

2929
import {loadXYPlot} from '../../charts/dataTypes/XYColsCDT.js';
30-
import {RAW_TABLE, PHASE_FOLDED, PERIODOGRAM, PEAK_TABLE} from '../../templates/lightcurve/LcManager.js';
30+
import {RAW_TABLE, PHASE_FOLDED, PERIODOGRAM, PEAK_TABLE, setupImages} from '../../templates/lightcurve/LcManager.js';
3131
import {showPhaseFoldingPopup} from './LcPhaseFoldingPopup.jsx';
3232

3333
import {isUndefined, get,set,isNil} from 'lodash';
3434
import {take} from 'redux-saga/effects';
3535
import './LCPanels.css';
3636

37-
const grpkey = 'LC_FORM_Panel';
37+
export const grpkey = 'LC_FORM_Panel';
3838

3939
function getDialogBuilder() {
4040
var popup= null;
@@ -265,8 +265,8 @@ export function LcPFOptionsPanel ({fields}) {
265265
fieldKey: 'cutoutSize',
266266
value: '0.3',
267267
//validator: Validate.floatRange.bind(null, 0.1, 1, 3,'cutoutsize'),
268-
tooltip: 'Cutout Size',
269-
label : 'Cutout Size:',
268+
tooltip: 'Cutout Size in degrees',
269+
label : 'Cutout Size (deg):',
270270
labelWidth : 100
271271
}} />
272272

@@ -441,7 +441,6 @@ function handleTableHighlight(action) {
441441
if (per) {
442442
dispatchValueChange({fieldKey: 'period', groupKey: grpkey, value: per});
443443
}
444-
445444
}
446445
//export default LcPhaseFoldingForm;
447446

@@ -458,4 +457,16 @@ function getPeriodFromTable(tbl_id) {
458457
} else if (tbl_id === PEAK_TABLE) {
459458
return getCellValue(tableModel, tableModel.highlightedRow, 'Period');
460459
}
460+
}
461+
462+
/**
463+
* return true if the table is LC raw or phase folded table
464+
* @param {string} tbl_id
465+
* @returns
466+
*/
467+
function isLcTable(tbl_id) {
468+
const tableModel = getTblById(tbl_id);
469+
if (!tableModel || isNil(tableModel.highlightedRow)) return;
470+
return !![RAW_TABLE, PHASE_FOLDED].includes(tbl_id);
471+
461472
}

0 commit comments

Comments
 (0)