|
|
|
@ -54,6 +54,7 @@ import { EllipsisChipListDirective } from '@shared/directives/ellipsis-chip-list |
|
|
|
import { MatButton } from '@angular/material/button'; |
|
|
|
import { TbPopoverService } from '@shared/components/popover.service'; |
|
|
|
import { ModbusDataKeysPanelComponent } from '../modbus-data-keys-panel/modbus-data-keys-panel.component'; |
|
|
|
import { coerceBoolean } from '@shared/decorators/coercion'; |
|
|
|
|
|
|
|
@Component({ |
|
|
|
selector: 'tb-modbus-values', |
|
|
|
@ -88,9 +89,10 @@ import { ModbusDataKeysPanelComponent } from '../modbus-data-keys-panel/modbus-d |
|
|
|
|
|
|
|
export class ModbusValuesComponent implements ControlValueAccessor, Validator, OnChanges, OnDestroy { |
|
|
|
|
|
|
|
@coerceBoolean() |
|
|
|
@Input() singleMode = false; |
|
|
|
@Input() disabled = false; |
|
|
|
|
|
|
|
disabled = false; |
|
|
|
modbusRegisterTypes: ModbusRegisterType[] = Object.values(ModbusRegisterType); |
|
|
|
modbusValueKeys = Object.values(ModbusValueKey); |
|
|
|
ModbusValuesTranslationsMap = ModbusRegisterTranslationsMap; |
|
|
|
@ -159,6 +161,11 @@ export class ModbusValuesComponent implements ControlValueAccessor, Validator, O |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
setDisabledState(isDisabled: boolean): void { |
|
|
|
this.disabled = isDisabled; |
|
|
|
this.cdr.markForCheck(); |
|
|
|
} |
|
|
|
|
|
|
|
getValueGroup(valueKey: ModbusValueKey, register?: ModbusRegisterType) { |
|
|
|
return register ? this.valuesFormGroup.get(register).get(valueKey).value : this.valuesFormGroup.get(valueKey).value; |
|
|
|
} |
|
|
|
|