Skip to content

Commit

Permalink
working on partial left turn north south
Browse files Browse the repository at this point in the history
  • Loading branch information
geoyogesh committed Oct 4, 2020
1 parent c6f93a7 commit 80f48cd
Show file tree
Hide file tree
Showing 7 changed files with 267 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1,130 @@
<p>partial-displaced-left-turn-intersection-north-south-configuration works!</p>
<table class="no-border centered-child" [formGroup]="form">
<tr>
<td></td>
<td>
<table>
<tr>
<td><img src="assets/capx/south-left-turn.png" /></td>
<td><img src="assets/capx/south-thru.png" /></td>
<td><img src="assets/capx/south-right-turn.png" /></td>
<td><img src="assets/capx/south-u-turn.png" /></td>
</tr>
<tr>
<td class="readonly"><div>PEPCH <br/> {{(capxStateService.masterParameters$ | async)!.south_bound_u}}</div></td>
<td class="readonly"><div>PEPCH <br/> {{(capxStateService.masterParameters$ | async)!.south_bound_left}}</div></td>
<td class="readonly"><div>PEPCH <br/> {{(capxStateService.masterParameters$ | async)!.south_bound_thru}}</div></td>
<td class="readonly"><div>PEPCH <br/> {{(capxStateService.masterParameters$ | async)!.south_bound_right}}</div></td>
</tr>
<tr>
<td class="editable"><div><input type="number" min="0" max="9" value="1" formControlName="south_bound_left"></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" value="0" formControlName="south_bound_right"></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"><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"><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"><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"><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 style="margin: 0 auto;">
<tr>
<td>Zone 5</td>
</tr>
<tr>
<td [ngStyle]="{'color': 'black', 'background-color': (capxStateService.getClvRangeColor((capxStateService.state.get(junctions.PartialDisplacedLeftTurnIntersectionNorthSouth).intersectionResult | async).zone5_center_clv))}">{{(capxStateService.state.get(junctions.PartialDisplacedLeftTurnIntersectionNorthSouth).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"><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"><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"><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"><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">{{(capxStateService.masterParameters$ | async)!.north_bound_u}} <br/> PEPCH</td>
<td class="readonly">{{(capxStateService.masterParameters$ | async)!.north_bound_left}} <br/> PEPCH</td>
<td class="readonly">{{(capxStateService.masterParameters$ | async)!.north_bound_thru}} <br/> PEPCH</td>
<td class="readonly">{{(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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:host
{
display: block;
margin: auto;

table tr td input {
max-width: 30px;
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,55 @@
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
import { CapxStateService } from './../../../../../services/capx-state.service';
import { CapxIntersectionAnalysisResultParameters, Junction } from './../../../../../services/models/junction-capacity-analyser';
import { ChangeDetectionStrategy, Component, OnDestroy, OnInit } from '@angular/core';
import { BehaviorSubject } from 'rxjs';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { Junctions } from './../../../../../services/models/junctions';

@Component({
selector: 'capx-partial-displaced-left-turn-intersection-north-south-configuration',
templateUrl: './partial-displaced-left-turn-intersection-north-south-configuration.component.html',
styleUrls: ['./partial-displaced-left-turn-intersection-north-south-configuration.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class PartialDisplacedLeftTurnIntersectionNorthSouthConfigurationComponent implements OnInit {
export class PartialDisplacedLeftTurnIntersectionNorthSouthConfigurationComponent 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.updatePartialDisplacedLeftTurnIntersectionNorthSouthParameters(value);
});

// tslint:disable-next-line: max-line-length
this.form.setValue(this.capxStateService.partialDisplacedLeftTurnIntersectionNorthSouthJunctionParameters$.value, {onlySelf: true, emitEvent: false});

const junction = this.capxStateService.state.get(Junctions.PartialDisplacedLeftTurnIntersectionNorthSouth) as Junction;
(junction.intersectionResult as BehaviorSubject<CapxIntersectionAnalysisResultParameters>).subscribe(result => {
this.result$.next(result);
});
}

ngOnDestroy(): void {
this.result$.complete();
}

}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { CapxStateService } from './../../../../../services/capx-state.service';
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
import { Junctions } from './../../../../../services/models/junctions';

@Component({
selector: 'capx-partial-displaced-left-turn-intersection-north-south-design',
Expand All @@ -8,7 +10,9 @@ import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
})
export class PartialDisplacedLeftTurnIntersectionNorthSouthDesignComponent implements OnInit {

constructor() { }
junctions = Junctions;
constructor(public capxStateService: CapxStateService) { }


ngOnInit(): void {
}
Expand Down
Loading

0 comments on commit 80f48cd

Please sign in to comment.