Skip to content

Commit

Permalink
fix #7179 use weight windows file in new simulation (#7321)
Browse files Browse the repository at this point in the history
* fix #1755 resizing browser window now correctly updates 3d plot axes
* fix #6325 fixed axis swap bug
  • Loading branch information
moellep authored Oct 21, 2024
1 parent 2e9f88a commit 79725ca
Show file tree
Hide file tree
Showing 13 changed files with 474 additions and 855 deletions.
16 changes: 12 additions & 4 deletions sirepo/package_data/static/html/openmc-visualization.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<div class="container-fluid">
<div class="row">
<div class="col-md-6 col-xl-4">
<div class="col-md-6 col-xxl-4">
<div data-basic-editor-panel="" data-view-name="settings"></div>
</div>
<div class="col-md-6 col-xl-4">
<div class="col-md-6 col-xxl-4">
<div data-simple-panel="simulationStatus">
<div data-sim-status-panel="visualization.simState" data-start-function="visualization.startSimulation()"></div>
<div class="row">
Expand Down Expand Up @@ -43,6 +43,12 @@
</tbody>
</table>
</div>
<div class="col-sm-12" data-ng-if="visualization.hasWeightWindowsFile">
<div class="col-sm-12"><a data-ng-attr-href="{{ visualization.weightWindowsFileURL() }}">
<span class="glyphicon glyphicon-cloud-download"></span> Computed Weight Windows</a>
<buttontype="button" class="btn btn-sm btn-default" data-ng-click="visualization.applyWeightWindows()">Apply Weight Windows</button>
</div>
</div>
</div>
</div>
</div>
Expand All @@ -54,13 +60,15 @@
</div>
<div class="col-sm-4">
<div data-simple-panel="tallySettings">
<div data-tally-settings=""></div>
<div data-advanced-editor-pane="" data-view-name="'tallySettings'" data-want-buttons=""
data-field-def="basic"></div>
</div>
<div data-ng-if="showEnergyPlot()">
<div data-ng-if="visualization.showEnergyPlot()">
<div data-report-panel="parameter" data-model-name="energyAnimation" data-panel-title="Energy Spectrum">
<div data-advanced-editor-pane="" data-view-name="'energyAnimation'" data-field-def="basic"></div>
</div>
</div>
</div>
</div>
</div>
<div data-apply-weight-window-confirmation=""></div>
287 changes: 177 additions & 110 deletions sirepo/package_data/static/js/openmc.js

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions sirepo/package_data/static/js/sirepo-beamline.js
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ SIREPO.app.directive('beamlineIcon', function() {
};
});

SIREPO.app.directive('beamlineItem', function(beamlineService, $timeout) {
SIREPO.app.directive('beamlineItem', function(beamlineService, $timeout, $rootScope) {
return {
scope: {
item: '=',
Expand Down Expand Up @@ -566,8 +566,7 @@ SIREPO.app.directive('beamlineItem', function(beamlineService, $timeout) {
}).on('show.bs.popover', function() {
$('.srw-beamline-element-label').not(el).popover('hide');
beamlineService.setActiveItem(scope.item);
var editor = el.data('bs.popover').getContent();
editor.trigger('sr.resetActivePage');
$rootScope.$broadcast('sr.setActivePage', scope.item.type, 0);
}).on('shown.bs.popover', function() {
$('.popover-content .form-control').first().select();
}).on('hide.bs.popover', function() {
Expand Down
22 changes: 15 additions & 7 deletions sirepo/package_data/static/js/sirepo-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,13 @@ SIREPO.app.directive('advancedEditorPane', function(appState, panelState, utilit
},
link: function(scope, element) {
$(element).closest('.modal').on('show.bs.modal', scope.resetActivePage);
//TODO(pjm): need a generalized case for this
$(element).closest('.sr-beamline-editor').on('sr.resetActivePage', scope.resetActivePage);
scope.$on('sr.setActivePage', (event, modelName, pageNumber) => {
if (scope.modelName === modelName && scope.pages) {
scope.setActivePage(scope.pages[pageNumber]);
}
});
scope.$on('$destroy', function() {
$(element).closest('.modal').off();
$(element).closest('.sr-beamline-editor').off();
});
}
};
Expand Down Expand Up @@ -4775,7 +4777,7 @@ SIREPO.app.directive('sbatchLoginModal', function() {
</div>
</div>
`,
controller: function($scope, authState, sbatchLoginService) {
controller: function(authState, sbatchLoginService, $element, $scope) {
const _resetLoginFormText = () => {
$scope.otp = '';
$scope.password = '';
Expand Down Expand Up @@ -4816,7 +4818,9 @@ SIREPO.app.directive('sbatchLoginModal', function() {
return $scope.password.length < 1 || $scope.username.length < 1 || ! sbatchLoginService.query('showLogin');
};


$scope.$on('destroy', () => {
$($element).off();
});

$scope.$on(
'sbatchLoginEvent',
Expand All @@ -4836,6 +4840,10 @@ SIREPO.app.directive('sbatchLoginModal', function() {
}
},
);

$($element).on('shown.bs.modal', () => {
$($element).find('.form-control').first().select();
});
},
};

Expand Down Expand Up @@ -4933,8 +4941,8 @@ SIREPO.app.directive('simStatusPanel', function(appState) {
</form>
<div data-canceled-due-to-timeout-alert="simState"></div>
<form name="form" class="form-horizontal" autocomplete="off" novalidate data-ng-show="simState.isStopped()">
<div class="col-sm-12" data-ng-show="simState.getFrameCount() > 0" data-simulation-stopped-status="simState"><br><br></div>
<div class="col-sm-12" data-ng-show="simState.getFrameCount() > 0">
<div data-ng-show="simState.getFrameCount() > 0" data-simulation-stopped-status="simState"><br><br></div>
<div data-ng-show="simState.getFrameCount() > 0">
<div class="col-sm-12" data-simulation-status-timer="simState"></div>
</div>
<div data-job-settings-sbatch-login-and-start-simulation data-sim-state="simState" data-start-simulation="start()"></div>
Expand Down
Loading

0 comments on commit 79725ca

Please sign in to comment.