changed scan period back to milliseconds

This commit is contained in:
mpetrov 2024-08-19 12:14:15 +03:00
parent 840751b3ca
commit 006e12fd09
6 changed files with 18 additions and 16 deletions

View File

@ -69,15 +69,15 @@
</div> </div>
<div class="tb-flex no-gap"> <div class="tb-flex no-gap">
<mat-form-field class="tb-flex no-gap" appearance="outline" subscriptSizing="dynamic"> <mat-form-field class="tb-flex no-gap" appearance="outline" subscriptSizing="dynamic">
<input matInput type="number" min="1" name="value" <input matInput type="number" min="1000" name="value"
formControlName="scanPeriodInSec" placeholder="{{ 'gateway.set' | translate }}"/> formControlName="scanPeriodInMillis" placeholder="{{ 'gateway.set' | translate }}"/>
<mat-icon matSuffix <mat-icon matSuffix
matTooltipPosition="above" matTooltipPosition="above"
matTooltipClass="tb-error-tooltip" matTooltipClass="tb-error-tooltip"
[matTooltip]="'gateway.scan-period-error' | translate: {min: 1}" [matTooltip]="'gateway.scan-period-error' | translate: {min: 1000}"
*ngIf="(serverConfigFormGroup.get('scanPeriodInSec').hasError('required') || *ngIf="(serverConfigFormGroup.get('scanPeriodInMillis').hasError('required') ||
serverConfigFormGroup.get('scanPeriodInSec').hasError('min')) && serverConfigFormGroup.get('scanPeriodInMillis').hasError('min')) &&
serverConfigFormGroup.get('scanPeriodInSec').touched" serverConfigFormGroup.get('scanPeriodInMillis').touched"
class="tb-error"> class="tb-error">
warning warning
</mat-icon> </mat-icon>

View File

@ -39,6 +39,7 @@ import { TruncateWithTooltipDirective } from '@shared/directives/truncate-with-t
import { import {
SecurityConfigComponent SecurityConfigComponent
} from '@home/components/widget/lib/gateway/connectors-configuration/security-config/security-config.component'; } from '@home/components/widget/lib/gateway/connectors-configuration/security-config/security-config.component';
import { HOUR } from '@shared/models/time/time.models';
@Component({ @Component({
selector: 'tb-opc-server-config', selector: 'tb-opc-server-config',
@ -80,7 +81,7 @@ export class OpcServerConfigComponent implements ControlValueAccessor, Validator
name: ['', []], name: ['', []],
url: ['', [Validators.required, Validators.pattern(noLeadTrailSpacesRegex)]], url: ['', [Validators.required, Validators.pattern(noLeadTrailSpacesRegex)]],
timeoutInMillis: [1000, [Validators.required, Validators.min(1000)]], timeoutInMillis: [1000, [Validators.required, Validators.min(1000)]],
scanPeriodInSec: [3600, [Validators.required, Validators.min(1)]], scanPeriodInMillis: [HOUR, [Validators.required, Validators.min(1000)]],
pollPeriodInMillis: [5000, [Validators.required, Validators.min(50)]], pollPeriodInMillis: [5000, [Validators.required, Validators.min(50)]],
enableSubscriptions: [true, []], enableSubscriptions: [true, []],
subCheckPeriodInMillis: [100, [Validators.required, Validators.min(100)]], subCheckPeriodInMillis: [100, [Validators.required, Validators.min(100)]],
@ -119,7 +120,7 @@ export class OpcServerConfigComponent implements ControlValueAccessor, Validator
writeValue(serverConfig: ServerConfig): void { writeValue(serverConfig: ServerConfig): void {
const { const {
timeoutInMillis = 1000, timeoutInMillis = 1000,
scanPeriodInSec = 3600, scanPeriodInMillis = HOUR,
pollPeriodInMillis = 5000, pollPeriodInMillis = 5000,
enableSubscriptions = true, enableSubscriptions = true,
subCheckPeriodInMillis = 100, subCheckPeriodInMillis = 100,
@ -131,7 +132,7 @@ export class OpcServerConfigComponent implements ControlValueAccessor, Validator
this.serverConfigFormGroup.reset({ this.serverConfigFormGroup.reset({
...serverConfig, ...serverConfig,
timeoutInMillis, timeoutInMillis,
scanPeriodInSec, scanPeriodInMillis,
pollPeriodInMillis, pollPeriodInMillis,
enableSubscriptions, enableSubscriptions,
subCheckPeriodInMillis, subCheckPeriodInMillis,

View File

@ -150,7 +150,7 @@ export interface ServerConfig {
name: string; name: string;
url: string; url: string;
timeoutInMillis: number; timeoutInMillis: number;
scanPeriodInSec: number; scanPeriodInMillis: number;
pollPeriodInMillis: number; pollPeriodInMillis: number;
enableSubscriptions: boolean; enableSubscriptions: boolean;
subCheckPeriodInMillis: number; subCheckPeriodInMillis: number;

View File

@ -3178,8 +3178,8 @@
"without-response": "Without response", "without-response": "Without response",
"other": "Other", "other": "Other",
"save-tip": "Save configuration file", "save-tip": "Save configuration file",
"scan-period": "Scan period (s)", "scan-period": "Scan period (ms)",
"scan-period-error": "Scan period should be at least {{min}} (s).", "scan-period-error": "Scan period should be at least {{min}} (ms).",
"sub-check-period": "Subscription check period (ms)", "sub-check-period": "Subscription check period (ms)",
"sub-check-period-error": "Subscription check period should be at least {{min}} (ms).", "sub-check-period-error": "Subscription check period should be at least {{min}} (ms).",
"security": "Security", "security": "Security",
@ -3389,9 +3389,9 @@
"file": "Your data will be stored in separated files and will be saved even after the gateway restart.", "file": "Your data will be stored in separated files and will be saved even after the gateway restart.",
"sqlite": "Your data will be stored in file based database. And will be saved even after the gateway restart.", "sqlite": "Your data will be stored in file based database. And will be saved even after the gateway restart.",
"opc-timeout": "Timeout in milliseconds for connecting to OPC-UA server.", "opc-timeout": "Timeout in milliseconds for connecting to OPC-UA server.",
"scan-period": "Period in seconds to rescan the server.", "scan-period": "Period in milliseconds to rescan the server.",
"sub-check-period": "Period to check the subscriptions in the OPC-UA server.", "sub-check-period": "Period to check the subscriptions in the OPC-UA server.",
"enable-subscription": "If true - the gateway will subscribe to interesting nodes and wait for data update and if false - the gateway will rescan OPC-UA server every scanPeriodInSec.", "enable-subscription": "If true - the gateway will subscribe to interesting nodes and wait for data update and if false - the gateway will rescan OPC-UA server every scanPeriodInMillis.",
"show-map": "Show nodes on scanning.", "show-map": "Show nodes on scanning.",
"method-name": "Name of method on OPC-UA server.", "method-name": "Name of method on OPC-UA server.",
"arguments": "Arguments for the method (will be overwritten by arguments from the RPC request).", "arguments": "Arguments for the method (will be overwritten by arguments from the RPC request).",

View File

@ -3,7 +3,8 @@
"name": "OPC-UA Default Server", "name": "OPC-UA Default Server",
"url": "localhost:4840/freeopcua/server/", "url": "localhost:4840/freeopcua/server/",
"timeoutInMillis": 5000, "timeoutInMillis": 5000,
"scanPeriodInMillis": 5000, "scanPeriodInMillis": 3600000,
"pollPeriodInMillis": 5000,
"enableSubscriptions": true, "enableSubscriptions": true,
"subCheckPeriodInMillis": 100, "subCheckPeriodInMillis": 100,
"showMap": false, "showMap": false,

View File

@ -3,7 +3,7 @@
"name": "OPC-UA Default Server", "name": "OPC-UA Default Server",
"url": "localhost:4840/freeopcua/server/", "url": "localhost:4840/freeopcua/server/",
"timeoutInMillis": 5000, "timeoutInMillis": 5000,
"scanPeriodInSec": 3600, "scanPeriodInMillis": 3600000,
"pollPeriodInMillis": 5000, "pollPeriodInMillis": 5000,
"disableSubscriptions": false, "disableSubscriptions": false,
"subCheckPeriodInMillis": 100, "subCheckPeriodInMillis": 100,