-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
working on Partial Displaced Left Turn Intersection (E-W)
- Loading branch information
Showing
6 changed files
with
263 additions
and
7 deletions.
There are no files selected for viewing
131 changes: 130 additions & 1 deletion
131
...iguration/partial-displaced-left-turn-intersection-east-west-configuration.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,130 @@ | ||
<p>partial-displaced-left-turn-intersection-east-west-configuration works!</p> | ||
<table class="no-border centered-child" [formGroup]="form"> | ||
<tr> | ||
<td></td> | ||
<td> | ||
<table> | ||
<tr> | ||
<td><img src="assets/capx/south-right-turn.png" /></td> | ||
<td><img src="assets/capx/south-thru.png" /></td> | ||
<td><img src="assets/capx/south-left-turn.png" /></td> | ||
<td><img src="assets/capx/south-u-turn.png" /></td> | ||
</tr> | ||
<tr> | ||
<td class="readonly pepch"><div>PEPCH <br/> {{(capxStateService.masterParameters$ | async)!.south_bound_right}}</div></td> | ||
<td class="readonly pepch"><div>PEPCH <br/> {{(capxStateService.masterParameters$ | async)!.south_bound_thru}}</div></td> | ||
<td class="readonly pepch"><div>PEPCH <br/> {{(capxStateService.masterParameters$ | async)!.south_bound_left}}</div></td> | ||
<td class="readonly pepch"><div>PEPCH <br/> {{(capxStateService.masterParameters$ | async)!.south_bound_u}}</div></td> | ||
</tr> | ||
<tr> | ||
<td class="editable"><div><input type="number" value="0" formControlName="south_bound_right"></div></td> | ||
<td class="editable"><div><input type="number" min="0" max="9" value="1" formControlName="south_bound_thru"></div></td> | ||
<td colspan="2" class="editable"><div><input type="number" min="0" max="9" value="1" formControlName="south_bound_left"></div></td> | ||
</tr> | ||
</table> | ||
</td> | ||
<td></td> | ||
</tr> | ||
<tr> | ||
<td> | ||
|
||
<div> | ||
<table class="config-table"> | ||
<tr> | ||
<td><img src="assets/capx/east-u-turn.png" /></td> | ||
<td class="readonly pepch"><div class="east-rotation">{{(capxStateService.masterParameters$ | async)!.east_bound_u}} <br/> PEPCH</div></td> | ||
<td rowspan="2" class="editable"><div class="east-rotation"><input type="number" min="0" max="9" value="1" formControlName="east_bound_left"></div></td> | ||
</tr> | ||
<tr> | ||
<td><img src="assets/capx/east-left-turn.png" /></td> | ||
<td class="readonly pepch"><div class="east-rotation">{{(capxStateService.masterParameters$ | async)!.east_bound_left}} <br/> PEPCH</div></td> | ||
</tr> | ||
|
||
<tr> | ||
<td><img src="assets/capx/east-thru.png" /></td> | ||
<td class="readonly pepch"><div class="east-rotation">{{(capxStateService.masterParameters$ | async)!.east_bound_thru}} <br/> PEPCH</div></td> | ||
<td class="editable"><div class="east-rotation"><input type="number" min="0" max="9" value="1" formControlName="east_bound_thru"></div></td> | ||
</tr> | ||
|
||
<tr> | ||
<td><img src="assets/capx/east-right-turn.png" /></td> | ||
<td class="readonly pepch"><div class="east-rotation">{{(capxStateService.masterParameters$ | async)!.east_bound_right}} <br/> PEPCH</div></td> | ||
<td class="editable"><div class="east-rotation"><input type="number" min="0" max="9" value="1" formControlName="east_bound_right"></div></td> | ||
</tr> | ||
</table> | ||
</div> | ||
|
||
|
||
</td> | ||
<td> | ||
|
||
<div> | ||
<table class="zone-table"> | ||
<tr> | ||
<td class="zone-cell">Zone 5</td> | ||
</tr> | ||
<tr> | ||
<td [ngStyle]="{'color': 'black', 'background-color': (capxStateService.getClvRangeColor((capxStateService.state.get(junctions.PartialDisplacedLeftTurnIntersectionEastWest).intersectionResult | async).zone5_center_clv))}">{{(capxStateService.state.get(junctions.PartialDisplacedLeftTurnIntersectionEastWest).intersectionResult | async).zone5_center_clv}}</td> | ||
</tr> | ||
</table> | ||
</div> | ||
|
||
</td> | ||
<td> | ||
<div> | ||
<table> | ||
<tr> | ||
<td class="editable"><div class="west-rotation"><input type="number" min="0" max="9" value="1" formControlName="west_bound_right"></div></td> | ||
<td class="readonly pepch"><div class="west-rotation">PEPCH <br/> {{(capxStateService.masterParameters$ | async)!.west_bound_right}}</div></td> | ||
<td><img src="assets/capx/west-right-turn.png" /></td> | ||
</tr> | ||
<tr> | ||
<td class="editable"><div class="west-rotation"><input type="number" min="0" max="9" value="1" formControlName="west_bound_thru"></div></td> | ||
<td class="readonly pepch"><div class="west-rotation">PEPCH <br/> {{(capxStateService.masterParameters$ | async)!.west_bound_thru}}</div></td> | ||
<td><img src="assets/capx/west-thru.png" /></td> | ||
</tr> | ||
|
||
<tr> | ||
<td rowspan="2" class="editable"><div class="west-rotation"><input type="number" min="0" max="9" value="1" formControlName="west_bound_left"></div></td> | ||
<td class="readonly pepch"><div class="west-rotation">PEPCH <br/> {{(capxStateService.masterParameters$ | async)!.west_bound_left}}</div></td> | ||
<td><img src="assets/capx/west-left-turn.png" /></td> | ||
</tr> | ||
|
||
<tr> | ||
<td class="readonly pepch"><div class="west-rotation">PEPCH <br/> {{(capxStateService.masterParameters$ | async)!.west_bound_u}}</div></td> | ||
<td><img src="assets/capx/west-u-turn.png" /></td> | ||
</tr> | ||
</table> | ||
</div> | ||
|
||
|
||
</td> | ||
</tr> | ||
<tr> | ||
<td></td> | ||
<td> | ||
|
||
<table> | ||
<tr> | ||
<td colspan="2" class="editable"><input type="number" min="0" max="9" value="1" formControlName="north_bound_left"></td> | ||
<td class="editable"><input type="number" value="0" formControlName="north_bound_thru"></td> | ||
<td class="editable"><input type="number" min="0" max="9" value="1" formControlName="north_bound_right"></td> | ||
</tr> | ||
<tr> | ||
<td class="readonly pepch">{{(capxStateService.masterParameters$ | async)!.north_bound_u}} <br/> PEPCH</td> | ||
<td class="readonly pepch">{{(capxStateService.masterParameters$ | async)!.north_bound_left}} <br/> PEPCH</td> | ||
<td class="readonly pepch">{{(capxStateService.masterParameters$ | async)!.north_bound_thru}} <br/> PEPCH</td> | ||
<td class="readonly pepch">{{(capxStateService.masterParameters$ | async)!.north_bound_right}} <br/> PEPCH</td> | ||
</tr> | ||
<tr> | ||
<td><img src="assets/capx/north-u-turn.png" /></td> | ||
<td><img src="assets/capx/north-left-turn.png" /></td> | ||
<td><img src="assets/capx/north-thru.png" /></td> | ||
<td><img src="assets/capx/north-right-turn.png" /></td> | ||
</tr> | ||
</table> | ||
|
||
|
||
</td> | ||
<td></td> | ||
</tr> | ||
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
:host | ||
{ | ||
display: block; | ||
overflow-y: auto; | ||
|
||
table tr td input { | ||
max-width: 30px; | ||
} | ||
} |
46 changes: 43 additions & 3 deletions
46
...nfiguration/partial-displaced-left-turn-intersection-east-west-configuration.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,56 @@ | ||
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core'; | ||
import { CapxStateService } from './../../../../../services/capx-state.service'; | ||
import { ChangeDetectionStrategy, Component, OnDestroy, OnInit } from '@angular/core'; | ||
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; | ||
import { CapxIntersectionAnalysisResultParameters, Junction } from './../../../../../services/models/junction-capacity-analyser'; | ||
import { Junctions } from './../../../../../services/models/junctions'; | ||
import { BehaviorSubject } from 'rxjs'; | ||
|
||
@Component({ | ||
selector: 'capx-partial-displaced-left-turn-intersection-east-west-configuration', | ||
templateUrl: './partial-displaced-left-turn-intersection-east-west-configuration.component.html', | ||
styleUrls: ['./partial-displaced-left-turn-intersection-east-west-configuration.component.scss'], | ||
changeDetection: ChangeDetectionStrategy.OnPush | ||
}) | ||
export class PartialDisplacedLeftTurnIntersectionEastWestConfigurationComponent implements OnInit { | ||
export class PartialDisplacedLeftTurnIntersectionEastWestConfigurationComponent implements OnInit, OnDestroy { | ||
|
||
constructor() { } | ||
result$: BehaviorSubject<CapxIntersectionAnalysisResultParameters> = new BehaviorSubject(null); | ||
|
||
junctions = Junctions; | ||
constructor(private fb: FormBuilder, public capxStateService: CapxStateService) { } | ||
|
||
|
||
form: FormGroup = this.fb.group({ | ||
east_bound_left: [null , Validators.required], | ||
east_bound_thru: [null, Validators.required], | ||
east_bound_right: [null, Validators.required], | ||
west_bound_left: [null, Validators.required], | ||
west_bound_thru: [null, Validators.required], | ||
west_bound_right: [null, Validators.required], | ||
south_bound_left: [null, Validators.required], | ||
south_bound_thru: [null, Validators.required], | ||
south_bound_right: [null, Validators.required], | ||
north_bound_left: [null, Validators.required], | ||
north_bound_thru: [null, Validators.required], | ||
north_bound_right: [null, Validators.required] | ||
}); | ||
|
||
ngOnInit(): void { | ||
this.form.valueChanges.subscribe(value => { | ||
this.capxStateService.updatePartialDisplacedLeftTurnIntersectionEastWestParameters(value); | ||
}); | ||
|
||
// tslint:disable-next-line: max-line-length | ||
this.form.setValue(this.capxStateService.partialDisplacedLeftTurnIntersectionEastWestJunctionParameters$.value, {onlySelf: true, emitEvent: false}); | ||
|
||
const junction = this.capxStateService.state.get(Junctions.PartialDisplacedLeftTurnIntersectionEastWest) as Junction; | ||
(junction.intersectionResult as BehaviorSubject<CapxIntersectionAnalysisResultParameters>).subscribe(result => { | ||
this.result$.next(result); | ||
}); | ||
} | ||
|
||
ngOnDestroy(): void { | ||
this.result$.complete(); | ||
} | ||
|
||
} | ||
|
2 changes: 1 addition & 1 deletion
2
...uration/partial-displaced-left-turn-intersection-north-south-configuration.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
:host | ||
{ | ||
display: block; | ||
overflow-y: scroll; | ||
overflow-y: auto; | ||
|
||
table tr td input { | ||
max-width: 30px; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters