ajout du parametre de choix de fonctionnement du module

This commit is contained in:
Vincent BENOIT
2022-10-28 11:58:29 +02:00
parent 8f8f1fdf84
commit 56b98d9c44
6 changed files with 22 additions and 4 deletions

View File

@@ -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';