From bc6019340270d7c8414684e315bd7a40810bc3e1 Mon Sep 17 00:00:00 2001 From: moellep Date: Thu, 4 Jan 2024 17:13:07 +0000 Subject: [PATCH] fix #6419 optionally show plot resolution --- sirepo/package_data/static/html/plot3d.html | 4 +++- sirepo/package_data/static/js/sirepo-plotting.js | 4 ++++ sirepo/package_data/static/json/srw-schema.json | 4 +++- sirepo/sim_data/srw.py | 1 + 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/sirepo/package_data/static/html/plot3d.html b/sirepo/package_data/static/html/plot3d.html index 0b3e4a478b..dfb3fb7435 100644 --- a/sirepo/package_data/static/html/plot3d.html +++ b/sirepo/package_data/static/html/plot3d.html @@ -69,6 +69,8 @@ -
{{width}}x{{height}}
+
plot resolution: {{width}}x{{height}}
+ +
diff --git a/sirepo/package_data/static/js/sirepo-plotting.js b/sirepo/package_data/static/js/sirepo-plotting.js index 16951b7c73..76d97497d2 100644 --- a/sirepo/package_data/static/js/sirepo-plotting.js +++ b/sirepo/package_data/static/js/sirepo-plotting.js @@ -3173,6 +3173,10 @@ SIREPO.app.directive('plot3d', function(appState, focusPointService, layoutServi resizefocusPointText(); }; + $scope.showPlotSize = () => { + return appState.models[$scope.modelName].showPlotSize == '1'; + }; + $scope.$on(SIREPO.PLOTTING_LINE_CSV_EVENT, function(evt, axisName) { var title = $($scope.element).closest('.panel-body') .parent().parent().find('.sr-panel-heading').text(); diff --git a/sirepo/package_data/static/json/srw-schema.json b/sirepo/package_data/static/json/srw-schema.json index 6eaf7edf35..386bb63f12 100644 --- a/sirepo/package_data/static/json/srw-schema.json +++ b/sirepo/package_data/static/json/srw-schema.json @@ -479,6 +479,7 @@ "horizontalOffset": ["Horizontal Center Position [mm]", "Float", 0], "verticalOffset": ["Vertical Center Position [mm]", "Float", 0], "useDetector": ["Use Detector", "Boolean", "0"], + "showPlotSize": ["Show Result Dimensions on Plot", "Boolean", "0"], "d_x": ["Horizontal Center Position [m]", "Float", 0], "d_rx": ["Horizontal Detector Range [m]", "Float", 0.01], "d_nx": ["Horizontal Pixel Count", "Integer", 1024], @@ -1168,7 +1169,8 @@ "d_ny", "d_y" ]] - ] + ], + "showPlotSize" ]], ["Other", [ "colorMap", diff --git a/sirepo/sim_data/srw.py b/sirepo/sim_data/srw.py index 06f034726d..cf970b74d9 100644 --- a/sirepo/sim_data/srw.py +++ b/sirepo/sim_data/srw.py @@ -32,6 +32,7 @@ class SimData(sirepo.sim_data.SimDataBase): "plotScale", "rotateAngle", "rotateReshape", + "showPlotSize", "useIntensityLimits", "usePlotRange", "verticalOffset",