Skip to content

Commit

Permalink
mode groupé pour les bras
Browse files Browse the repository at this point in the history
  • Loading branch information
mistic100 committed Apr 8, 2024
1 parent 4a8a651 commit 20e7c8e
Show file tree
Hide file tree
Showing 7 changed files with 222 additions and 153 deletions.
10 changes: 5 additions & 5 deletions src/app/components/map/input/game-status.manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,23 +96,23 @@ export class GameStatusManager {
this.plantes.destroyChildren();
this.pots.destroyChildren();

status.plantes.forEach((plante) => {
status.plantes?.forEach((plante) => {
this.addPlante(plante);
});

status.distribsPlantes.forEach((count, i) => {
status.distribsPlantes?.forEach((count, i) => {
this.addDistribPlantes(count, i);
});

Object.entries(status.distribsPots).forEach(([distrib, count]) => {
Object.entries(status.distribsPots ?? {}).forEach(([distrib, count]) => {
this.addDistribPots(count, distrib as DistribPot);
});

Object.entries(status.airesDepose).forEach(([aire, plante]) => {
Object.entries(status.airesDepose ?? {}).forEach(([aire, plante]) => {
this.addAireDepose(plante, aire as AireDepose);
});

status.panneaux.forEach(({ BLEU, JAUNE }, i) => {
status.panneaux?.forEach(({ BLEU, JAUNE }, i) => {
const panneau = this.panneaux.children.at(i);
if (BLEU && JAUNE) {
panneau.rotation(180);
Expand Down
22 changes: 17 additions & 5 deletions src/app/components/misc/pumps-control/pumps-control.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,23 @@ <h5 class="card-header d-flex justify-content-between">
<button type="button" class="btn btn-primary btn-sm" (click)="setElectroAimant('on')">Aimants ON</button>
<button type="button" class="btn btn-danger btn-sm" (click)="setElectroAimant('off')">Aimants OFF</button>

<button type="button" class="btn btn-primary btn-sm ml-3 btn-custom" style="--color-btn: #FFBF00"
(click)="setSolarWheel('jaune')">Roue Jaune</button>
<button type="button" class="btn btn-primary btn-sm btn-custom" style="--color-btn: #005CE6"
(click)="setSolarWheel('bleu')">Roue Bleu</button>
<button
type="button"
class="btn btn-primary btn-sm ml-3 btn-custom"
style="--color-btn: #ffbf00"
(click)="setSolarWheel('jaune')"
>
Roue Jaune
</button>
<button
type="button"
class="btn btn-primary btn-sm btn-custom"
style="--color-btn: #005ce6"
(click)="setSolarWheel('bleu')"
>
Roue Bleu
</button>
<button type="button" class="btn btn-danger btn-sm" (click)="setSolarWheel('off')">Roue OFF</button>
</div>
</h5>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ <h6 class="card-title mb-0">
(ngModelChange)="setPositionByName()"
/>
<label class="btn btn-outline-primary btn-sm" [for]="'pos-' + servo.id + '-' + pos.value">
{{pos.name}}
{{ pos.name }}
</label>
</ng-container>
</div>
Expand Down
71 changes: 50 additions & 21 deletions src/app/components/sidebars/bras/bras.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,32 @@
<arig-pumps-control [robot]="robot"></arig-pumps-control>

<div class="card">
<h5 class="card-header">
<fa-icon [icon]="$any(['fas', 'robot-arm'])"></fa-icon>
Bras
<h5 class="card-header d-flex justify-content-between">
<span>
<fa-icon [icon]="$any(['fas', 'robot-arm'])"></fa-icon>
Bras
</span>

<div class="btn-group d-flex">
<input
type="radio"
class="btn-check"
name="ctrlMode"
id="ctrlMode-unit"
[value]="false"
[(ngModel)]="groupMode"
/>
<label class="btn btn-sm btn-outline-primary" for="ctrlMode-unit"> Mode unitaire </label>
<input
type="radio"
class="btn-check"
name="ctrlMode"
id="ctrlMode-group"
[value]="true"
[(ngModel)]="groupMode"
/>
<label class="btn btn-sm btn-outline-primary" for="ctrlMode-group"> Mode groupé </label>
</div>
</h5>

<div class="card-body">
Expand All @@ -25,21 +48,21 @@ <h5 class="card-header">
[id]="'bras-' + bras"
[value]="bras"
[(ngModel)]="selectedBras"
(ngModelChange)="changeBras()"
(ngModelChange)="onChangeBras()"
/>
<label class="btn btn-outline-primary btn-custom"
[style]="'font-size: 0.8em; --color-btn:' + COLORS[bras]"
[for]="'bras-' + bras">
<label
class="btn btn-outline-primary btn-custom"
[style]="'font-size: 0.8em; flex: 1; --color-btn:' + COLORS[bras]"
[for]="'bras-' + bras"
>
{{ bras }}
</label>
</ng-container>
</div>

<div class="row mt-3 g-1" *ngIf="current">
<div *ngFor="let bras of names"
class="col-2"
[class.bg-secondary]="bras === selectedBras">
<form class="row" (ngSubmit)="click(current[bras], $any(bras))">
<div *ngFor="let bras of names" class="col-2" [class.bg-secondary]="isActive(bras)">
<form class="row" (ngSubmit)="setBras(current[bras], $any(bras))">
<div class="input-group input-group-sm">
<span class="input-group-text bg-primary text-white">x</span>
<input
Expand Down Expand Up @@ -72,10 +95,13 @@ <h5 class="card-header">
</div>
<div class="input-group input-group-sm">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox"
[id]="bras + '-invertA1'"
[(ngModel)]="current[bras].invertA1"
[name]="bras + '-invertA1'">
<input
class="form-check-input"
type="checkbox"
[id]="bras + '-invertA1'"
[(ngModel)]="current[bras].invertA1"
[name]="bras + '-invertA1'"
/>
<label class="form-check-label" [for]="bras + '-invertA1'">Invert A1</label>
</div>
</div>
Expand All @@ -86,15 +112,15 @@ <h5 class="card-header">
</div>
<div>
<span class="badge badge-big bg-secondary mr-2">a1</span>
{{ current[bras].a1 | number:'1.0-0' }}°
{{ current[bras].a1 | number: '1.0-0' }}°
</div>
<div>
<span class="badge badge-big bg-secondary mr-2">a2</span>
{{ current[bras].a2 | number:'1.0-0' }}°
{{ current[bras].a2 | number: '1.0-0' }}°
</div>
<div>
<span class="badge badge-big bg-secondary mr-2">a3</span>
{{ current[bras].a3 | number:'1.0-0' }}°
{{ current[bras].a3 | number: '1.0-0' }}°
</div>
</form>

Expand Down Expand Up @@ -127,10 +153,13 @@ <h5 class="card-header">
[id]="'pos-' + pinces[bras].id + '-' + i.value.value"
[value]="i.value.value"
[(ngModel)]="pinces[bras].currentPosition"
(ngModelChange)="setPince(bras)"
(ngModelChange)="setPince(bras, pinces[bras])"
/>
<label class="btn btn-outline-primary btn-sm" [for]="'pos-' + pinces[bras].id + '-' + i.value.value">
{{i.value.name}}
<label
class="btn btn-outline-primary btn-sm"
[for]="'pos-' + pinces[bras].id + '-' + i.value.value"
>
{{ i.value.name }}
</label>
</ng-container>
</div>
Expand Down
Loading

0 comments on commit 20e7c8e

Please sign in to comment.