All files / src/app/components/signal-command signal-command.component.html

95.38% Statements 62/65
90% Branches 27/30
75% Functions 6/8
100% Lines 32/32

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 5514x   3174x 193x     3174x   53x 53x 52x 53x   1x     3174x 18x 985x 994x       3174x   773x     386x   1x   1x 1x       14x 1587x   3188x 3174x 10x 1364x     3174x 3x 4x 200x 403x 3x   14x  
<div class="form-container">
 
  @if (signal.data_type==='bool') {
    <p-toggleswitch [(ngModel)]="boolValue" />
  }
 
  @if (signal.data_type==='float') {
    <p-inputgroup>
      <p-inputgroup-addon>{{signal.ticker}}</p-inputgroup-addon>
      <p-inputnumber [(ngModel)]="floatValue" [placeholder]="placeholder" [maxFractionDigits]="precisionNumber"/>
      @if (signal.unit) {
        <p-inputgroup-addon>{{signal.unit}}</p-inputgroup-addon>
      }
    </p-inputgroup>
  }
 
  @if (signal.isEnum() && enumOptions.length>0) {
    <p-select id="string-enum"
      [options]="enumOptions"
      [(ngModel)]="stringValue"
      placeholder="Select a command" />
  }
 
  @if (signal.data_type === 'epoch') {
    <p-floatLabel>
      <p-datepicker [(ngModel)]="dateValue" inputId="epoch"
        [showButtonBar]="true"
        [showTime]="true"
        [showSeconds]="true"
        todayButtonStyleClass="today-button"
        (onTodayClick)="setDatePickerToNow()"
        />
      <label for="epoch">Set Countdown</label>
    </p-floatLabel>
  }
 
 
  <button class="button cmd" (click)="sendCommand()"
    [disabled]="!canControlSignal || (signal.data_type === 'float' && (floatValue === undefined || floatValue === null)) ||
                (signal.isEnum() && enumOptions.length<0)"
    [id]="signal.device_id + '_' + signal.ticker + '_command'" [title]="buttonsTooltip">{{forceButtonMessage}}</button>
  @if (this.signal.type === 'command') {
    <button class="button cmd forced" (click)="forceCommand()"  [id]="signal.device_id + '_' + signal.ticker + '_forced_command'"
      [disabled]="!canControlSignal" [title]="buttonsTooltip">Force command</button>
  }
 
  @if (this.canUnForce) {
    <button
      class="button cmd" (click)="unForce()"  [id]="signal.device_id + '_' + signal.ticker + '_unforce_command'"
      [disabled]="!canControlSignal || this.commandPending" [title]="buttonsTooltip">
      {{ unForceButtonMessage }}
    </button>
  }
</div>