Skip to content
Snippets Groups Projects
Commit 68ddb3c3 authored by François Grand's avatar François Grand
Browse files

feat: predams: apply event processing to basin move functionnalities

refs #522
parent c1d828b9
No related branches found
No related tags found
1 merge request!166Resolve "Prébarrages: Regroupement de la saisie des bassins"
Pipeline #139825 passed
......@@ -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() {
......
......@@ -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
}
);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment