Skip to content

DM-9691: time series image problems fixed #328

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

Merged
merged 1 commit into from
Mar 5, 2017
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
12 changes: 12 additions & 0 deletions src/firefly/js/templates/lightcurve/LcManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,13 +262,15 @@ function handleValueChange(layoutInfo, action) {
if ((get(layoutInfo, [LC.GENERAL_DATA, fieldKey]) !== value) && (value > 0.0) ) {
if (get(layoutInfo, ['displayMode']) === LC.RESULT_PAGE) {
layoutInfo = updateSet(layoutInfo, [LC.GENERAL_DATA, fieldKey], value);
clearLcImages();
setupImages(layoutInfo);
}
}
} else if ([LC.META_COORD_XNAME, LC.META_COORD_YNAME, LC.META_COORD_SYS].includes(fieldKey)) {
if (get(layoutInfo, [LC.MISSION_DATA, fieldKey]) !== value) {
if (get(layoutInfo, ['displayMode']) === LC.RESULT_PAGE) {
layoutInfo = updateSet(layoutInfo, [LC.MISSION_DATA, fieldKey], value);
clearLcImages();
setupImages(layoutInfo);
}
}
Expand All @@ -295,6 +297,7 @@ function handleValueChange(layoutInfo, action) {
updatePhaseTableChart(fluxCol);
}

clearLcImages();
setupImages(newLayoutInfo);

// update time or flux for period panel field group if it exists
Expand All @@ -304,6 +307,7 @@ function handleValueChange(layoutInfo, action) {
}
}
if (didChange(LC.META_URL_CNAME)) {
clearLcImages();
setupImages(newLayoutInfo);
}

Expand Down Expand Up @@ -337,9 +341,17 @@ function handlePlotActive(layoutInfo, action) {
return layoutInfo;
}

function clearLcImages() {
const vr= visRoot();
vr.plotViewAry.forEach( (pv) => dispatchDeletePlotView({plotId:pv.plotId}));
dispatchReplaceViewerItems(LC.IMG_VIEWER_ID, ['placeHolder']);
}

function clearResults(layoutInfo) {
removeTablesFromGroup();
removeTablesFromGroup(LC.PERIODOGRAM_GROUP);
clearLcImages();


if (has(layoutInfo, [LC.MISSION_DATA])) {
dispatchMountFieldGroup(getViewerGroupKey(get(layoutInfo, LC.MISSION_DATA)), false, false,
Expand Down
16 changes: 14 additions & 2 deletions src/firefly/js/visualize/iv/ImageViewerLayout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,13 @@ const draggingOrReleasing = (ms) => ms==DRAG || ms===DRAG_COMPONENT || ms===UP |

function updateZoom(pv, paging) {
if (!primePlot(pv)) return;
const vr= visRoot();
var doZoom= false;
var actionScope= ActionScope.GROUP;
if (isImageViewerSingleLayout(getMultiViewRoot(), visRoot(), pv.plotId)) {
const vr= visRoot();
if (!paging && vr.wcsMatchType && pv.plotId!==vr.mpwWcsPrimId) {
doZoom= false;
}
else if (isImageViewerSingleLayout(getMultiViewRoot(), vr, pv.plotId)) {
doZoom= true;
actionScope= ActionScope.SINGLE;
}
Expand All @@ -54,6 +57,7 @@ function updateZoom(pv, paging) {
doZoom= (isActive || !inActive);
actionScope= isActive ? ActionScope.GROUP : ActionScope.SINGLE;
}

if (doZoom) {
dispatchZoom({
plotId: pv.plotId,
Expand Down Expand Up @@ -98,6 +102,14 @@ export class ImageViewerLayout extends Component {
}
}

componentWillReceiveProps(nextProps) {
const {width,height}= nextProps;
const {viewDim}= nextProps.plotView;
if (width!==viewDim.width && height!==viewDim.height) {
dispatchUpdateViewSize(nextProps.plotView.plotId,width,height);
}
}

componentDidUpdate() {
const {width,height,externalWidth,externalHeight, plotView:pv}= this.props;
const {prevWidth,prevHeight, prevExternalWidth, prevExternalHeight, prevPlotId}= this.previousDim;
Expand Down
4 changes: 2 additions & 2 deletions src/firefly/js/visualize/task/ImageOverlayTask.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ const nextColor= () => colorChoose.next().value;
export function* watchForCompletedPlot(options) {


var idMatch= false;
let idMatch= false;
while (!idMatch) {
const action = yield take([ImagePlotCntlr.PLOT_IMAGE, ImagePlotCntlr.PLOT_IMAGE_FAIL]);
const {pvNewPlotInfoAry, plotId}= action.payload;
const idMatch = Boolean(pvNewPlotInfoAry && pvNewPlotInfoAry.find((i) => i.plotId === options.plotId)) ||
idMatch = Boolean(pvNewPlotInfoAry && pvNewPlotInfoAry.find((i) => i.plotId === options.plotId)) ||
plotId===options.plotId;
if (idMatch) {
if (action.type===ImagePlotCntlr.PLOT_IMAGE) {
Expand Down
66 changes: 57 additions & 9 deletions src/firefly/js/visualize/task/WcsMatchTask.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,89 @@
*/

import {get} from 'lodash';
import {take} from 'redux-saga/effects';
import ImagePlotCntlr, {WcsMatchType, IMAGE_PLOT_KEY,
dispatchGroupLocking, dispatchZoom, dispatchRotate,
dispatchUpdateViewSize, dispatchRecenter, ActionScope} from '../ImagePlotCntlr.js';
import {getPlotViewById, primePlot, applyToOnePvOrGroup, findPlotGroup} from '../PlotViewUtil.js';
import {PlotAttribute} from '../WebPlot.js';
import PlotView from '../reducer/PlotView.js';
import {getCenterPtOfPlot, FullType, isPlotNorth, getRotationAngle} from '../VisUtil.js';
import {FullType, isPlotNorth, getRotationAngle} from '../VisUtil.js';
import {getEstimatedFullZoomFactor, getArcSecPerPix, getZoomLevelForScale, UserZoomTypes} from '../ZoomUtil.js';
import {RotateType} from '../PlotState.js';
import {CCUtil} from '../CsysConverter.js';
import {ZoomType} from '../ZoomType.js';
import {makeScreenPt} from '../Point.js';
import {dispatchAddSaga} from '../../core/MasterSaga.js';


export function* watchForCompletedPlot(options, dispatch, getState) {


let masterPlot;
let plot;

while (!masterPlot || !plot) {
const action = yield take([ImagePlotCntlr.PLOT_IMAGE, ImagePlotCntlr.PLOT_IMAGE_FAIL]);
const {plotId, masterPlotId, wcsMatchType}= options;

if (action.type===ImagePlotCntlr.PLOT_IMAGE_FAIL && action.payload.plotId===plotId) {
return;
}
const visRoot= getState()[IMAGE_PLOT_KEY];
masterPlot= primePlot(visRoot, masterPlotId);
plot= primePlot(visRoot, plotId);


if (masterPlot && plot) {
const masterPv= getPlotViewById(visRoot, masterPlotId);
const pv= getPlotViewById(visRoot, plotId);
const level = wcsMatchType===WcsMatchType.Standard || wcsMatchType===WcsMatchType.Target ?
masterPlot.zoomFactor :
getEstimatedFullZoomFactor(primePlot(masterPv),masterPv.viewDim, FullType.WIDTH_HEIGHT);
const asPerPix= getArcSecPerPix(masterPlot,level);
if (wcsMatchType===WcsMatchType.Target) {
const ft= masterPlot.attributes[PlotAttribute.FIXED_TARGET];
if (ft) dispatchRecenter({plotId:masterPv.plotId, centerPt:ft});
}
syncPlotToLevel(primePlot(pv), masterPlot, asPerPix);
dispatchUpdateViewSize(pv.plotId);
}
}

}


export function wcsMatchActionCreator(action) {
return (dispatcher, getState) => {
var {plotId, matchType}= action.payload;
matchType= WcsMatchType.get(matchType);
var visRoot= getState()[IMAGE_PLOT_KEY];
var masterPv= getPlotViewById(visRoot, plotId);
const {plotId}= action.payload;
const matchType= WcsMatchType.get(action.payload.matchType);
let visRoot= getState()[IMAGE_PLOT_KEY];
let masterPv= getPlotViewById(visRoot, plotId);

const width= get(masterPv,'viewDim.width',false);
const height= get(masterPv,'viewDim.height',false);

var group= findPlotGroup(masterPv.plotGroupId, visRoot.plotGroupAry);
let group= findPlotGroup(masterPv.plotGroupId, visRoot.plotGroupAry);


if (!matchType || !width || !height) {
dispatcher({
type: ImagePlotCntlr.WCS_MATCH,
payload: {wcsMatchCenterWP:null,wcsMatchType:matchType,mpwWcsPrimId:plotId}
});
applyToOnePvOrGroup(visRoot.plotViewAry, masterPv.plotId, group,
(pv) => dispatchUpdateViewSize(pv.plotId));
if (matchType) {
applyToOnePvOrGroup(visRoot.plotViewAry, masterPv.plotId, group,
(pv) => {
if (masterPv.plotId!==pv.plotId) {
dispatchAddSaga( watchForCompletedPlot, {plotId:pv.plotId, masterPlotId:plotId, wcsMatchType:matchType});
}
}
);
}
else {
applyToOnePvOrGroup(visRoot.plotViewAry, masterPv.plotId, group,
(pv) => dispatchUpdateViewSize(pv.plotId));
}
return;
}

Expand Down
3 changes: 2 additions & 1 deletion src/firefly/js/visualize/ui/MultiItemViewerView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ const flexContainerStyle= {
display:'flex',
flexDirection:'column',
flexWrap:'nowrap',
alignItems: 'stretch'
alignItems: 'stretch',
flexGrow: 1
};

const defDecStyle= {
Expand Down