diff --git a/src/app/components/pb-schema/pb-schema.component.ts b/src/app/components/pb-schema/pb-schema.component.ts index c335b4083a7111cbb9b745060fdb113511b3ee46..7ac6b72a7bc7a7ac2c2d6414e1bd11deccce26f7 100644 --- a/src/app/components/pb-schema/pb-schema.component.ts +++ b/src/app/components/pb-schema/pb-schema.component.ts @@ -504,6 +504,7 @@ export class PbSchemaComponent implements AfterViewInit, AfterContentInit, OnIni switch (event.id) { case PrebarrageServiceEvents.BASIN_WALL_ADDED: case PrebarrageServiceEvents.BASIN_WALL_COPIED: + case PrebarrageServiceEvents.MOVE_BASIN: this.clearResults(); this.refreshWithSelection(nub.uid); this.calculatorComponent.showPBInputData = true; @@ -562,9 +563,6 @@ export class PbSchemaComponent implements AfterViewInit, AfterContentInit, OnIni if (this._selectedItem instanceof PbBassin) { this.predamService.moveSelectedBasinUp(); } - this.clearResults(); - this.refreshWithSelection(this._selectedItem.uid); - this.calculatorComponent.showPBInputData = true; } public get uitextMoveBasinUp() { @@ -583,9 +581,6 @@ export class PbSchemaComponent implements AfterViewInit, AfterContentInit, OnIni if (this._selectedItem instanceof PbBassin) { this.predamService.moveSelectedBasinDown(); } - this.clearResults(); - this.refreshWithSelection(this._selectedItem.uid); - this.calculatorComponent.showPBInputData = true; } public get uitextMoveBasinDown() { diff --git a/src/app/services/prebarrage.service.ts b/src/app/services/prebarrage.service.ts index 65e534627e3597e72c4345af7b19b3b73691f474..4fadedae0b607bcfd7e4e3d1d0e6e8fa9b7c92e6 100644 --- a/src/app/services/prebarrage.service.ts +++ b/src/app/services/prebarrage.service.ts @@ -5,7 +5,9 @@ export enum PrebarrageServiceEvents { BASIN_WALL_ADDED, // a wall has been added BASIN_WALL_COPIED, // a basin or wall has been copied BASIN_WALL_REMOVED, // a basin or a wall has been removed + MOVE_BASIN, // a basin has been moved up or down } + /** * service relatif au schéma de prébarrage */ @@ -176,6 +178,12 @@ export class PrebarrageService { public moveSelectedBasinUp() { const uid = this._selectedNub.uid; this.moveBasinUp(uid); + this._changeEventEmitter.emit( + { + id: PrebarrageServiceEvents.MOVE_BASIN, + data: this._selectedNub + } + ); } /** @@ -188,6 +196,12 @@ export class PrebarrageService { public moveSelectedBasinDown() { const uid = this._selectedNub.uid; this.moveBasinDown(uid); + this._changeEventEmitter.emit( + { + id: PrebarrageServiceEvents.MOVE_BASIN, + data: this._selectedNub + } + ); } /**