ajout du parametre de choix de fonctionnement du module
This commit is contained in:
@@ -30,6 +30,7 @@ import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
||||
import { MatGridListModule } from '@angular/material/grid-list';
|
||||
import { MatTabsModule } from '@angular/material/tabs';
|
||||
import { MatSliderModule } from '@angular/material/slider';
|
||||
import { MatRadioModule } from '@angular/material/radio';
|
||||
import { ToastrModule } from 'ngx-toastr';
|
||||
import { CodeInputModule } from 'angular-code-input';
|
||||
|
||||
@@ -91,6 +92,7 @@ import { LogsComponent } from './components/home/workspace/logs/logs.component';
|
||||
MatGridListModule,
|
||||
MatTabsModule,
|
||||
MatSliderModule,
|
||||
MatRadioModule,
|
||||
FlexLayoutModule,
|
||||
RouterModule,
|
||||
FontAwesomeModule,
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
}
|
||||
|
||||
table {
|
||||
margin: 1rem;
|
||||
table-layout: fixed;
|
||||
align: center;
|
||||
width: 80%;
|
||||
|
||||
@@ -6,12 +6,20 @@
|
||||
<div *ngIf="!isProcessing" class="container"
|
||||
fxLayout="column"
|
||||
fxLayoutAlign="space-around center">
|
||||
<section style="margin-top:1rem; width: 70%;">
|
||||
<label style="margin-left: 10px; font-size: smaller;">Fonctionnement:</label>
|
||||
<mat-radio-group [(ngModel)]="defaultOp">
|
||||
<mat-radio-button style="margin: 10px; font-size: smaller;" *ngFor="let operation of operations" [value]="operation">
|
||||
{{operation}}
|
||||
</mat-radio-button>
|
||||
</mat-radio-group>
|
||||
</section>
|
||||
|
||||
<!-- Params Form -->
|
||||
<form [formGroup]="paramsFG"
|
||||
fxLayout="column">
|
||||
|
||||
<mat-slide-toggle [checked]="slideDisable" (change)="onSlideChanged($event)" style="margin: 10px; font-size: smaller;">Activer code PIN</mat-slide-toggle>
|
||||
<code-input [isCodeHidden]="false" [codeLength]="4" [disabled]="!pinChecked" [code]="pinNumber" (codeChanged)="onCodeChanged($event)" (codeCompleted)="onCodeCompleted($event)"></code-input>
|
||||
<mat-slide-toggle [checked]="slideDisable" (change)="onSlideChanged($event)" style="margin-left:10px; margin-top:0.3rem; margin-bottom:1rem; font-size: smaller;">Activer code PIN</mat-slide-toggle>
|
||||
<code-input [isCodeHidden]="false" [codeLength]="4" [disabled]="!pinChecked" [code]="pinNumber" (codeChanged)="onCodeChanged($event)" (codeCompleted)="onCodeCompleted($event)" style="margin-bottom:1rem;"></code-input>
|
||||
<mat-form-field style="margin: 5px 10px 5px 10px;">
|
||||
<mat-label>Téléphone accepté</mat-label>
|
||||
<span matPrefix style="font-size: smaller;">+33 </span>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ThemePalette } from '@angular/material/core';
|
||||
import { FormBuilder, FormGroup, Validators, ValidatorFn, ValidationErrors, AbstractControl } from '@angular/forms';
|
||||
import { Router } from '@angular/router';
|
||||
import { BackendService } from '../../../../services/backend/backend.service';
|
||||
@@ -17,6 +18,8 @@ export class ParametresComponent implements OnInit {
|
||||
pinChecked:boolean=false;
|
||||
pinNumber:string="0000";
|
||||
isProcessing:boolean = true;
|
||||
defaultOp:string = 'Manuel ON';
|
||||
operations:string[] = ['Manuel ON', 'Manuel OFF', 'Horaires'];
|
||||
|
||||
constructor(private fb:FormBuilder,
|
||||
private bs:BackendService,
|
||||
@@ -49,6 +52,7 @@ export class ParametresComponent implements OnInit {
|
||||
this.paramsFG.get('num_tone').setValue(data.tone_duration);
|
||||
this.paramsFG.get('dtmf_code').setValue(data.dtmf_code);
|
||||
this.paramsFG.get('dtmf_duration').setValue(data.dtmf_duration);
|
||||
this.defaultOp = data.operation;
|
||||
this.slideDisable = data.pin_actif;
|
||||
this.pinChecked = data.pin_actif;
|
||||
this.pinNumber = data.code_pin;
|
||||
@@ -83,12 +87,14 @@ export class ParametresComponent implements OnInit {
|
||||
return;
|
||||
}
|
||||
|
||||
let params:Parameters = {pin_actif:false,
|
||||
let params:Parameters = {operation:'',
|
||||
pin_actif:false,
|
||||
code_pin:'',
|
||||
num_autorized:'',
|
||||
tone_duration:0,
|
||||
dtmf_code:'',
|
||||
dtmf_duration:0};
|
||||
params.operation = this.defaultOp;
|
||||
params.pin_actif = this.pinChecked;
|
||||
if (this.pinChecked == false) {
|
||||
params.code_pin = '0000';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
export interface Parameters {
|
||||
operation:string;
|
||||
pin_actif:boolean;
|
||||
code_pin:string;
|
||||
num_autorized:string;
|
||||
|
||||
BIN
src/assets/img/GNSS_GSM_GPS_rpi.png
Normal file
BIN
src/assets/img/GNSS_GSM_GPS_rpi.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 116 KiB |
Reference in New Issue
Block a user