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

76.92% Statements 50/65
76.66% Branches 23/30
75% Functions 6/8
84.37% Lines 27/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 5510x   3110x 197x     3110x                   3110x 12x 965x 971x       3110x   793x     396x   1x   1x 1x       10x 1555x   3120x 3110x 10x 1408x     3110x 2x 2x 162x 326x 2x   10x  
<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>