@joergmittaglawo/dmvconfig
Version:
DMV Configuration scripts for Lawo V__matrix Distributed Multiviewers.
189 lines (187 loc) • 8.2 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Enums = exports.All = exports.lower = exports.lift = void 0;
const VScript = require("vscript");
const _PTP = require("./PTP");
const _Time = require("./Time");
exports.lift = {
AllMicroEpochs: (kwl, socket) => kwl ? (new AllMicroEpochs(new VScript.Subtree(socket, kwl))) : null,
AllParametersPllParsCalibrated: (kwl, socket) => kwl ? (new AllParametersPllParsCalibrated(new VScript.Subtree(socket, kwl))) : null,
AllParameters: (kwl, socket) => kwl ? (new AllParameters(new VScript.Subtree(socket, kwl))) : null,
AllStatisticsCounters: (x, _) => { return x ? { missing_samples: x[0], bp_overall: x[1], bp_offset: x[2], bp_offset_errors: x[3], bp_drift: x[4], bp_drift_errors: x[5] } : null; },
AllStatistics: (kwl, socket) => kwl ? (new AllStatistics(new VScript.Subtree(socket, kwl))) : null,
PLLParameters: (x, _) => { return x ? { max_drift_adjustment_step: x[0], stiffness: x[1], damping: x[2] } : null; },
MicroEpoch: (x, _) => { return x ? { epoch_index: x[0], continuity_index: x[1], reference_time: x[2], reference_counter: x[3], fpga_drift_to_clock: x[4], best_before: x[5], g23_98: x[6], g24: x[7], g25: x[8], g29_97: x[9], g30: x[10], g50: x[11], g59_94: x[12], g60: x[13], grtp_48k: x[14], grtp_90k: x[15], grtp_27m: x[16] } : null; }
};
exports.lower = {
AllMicroEpochs: (ref) => ref ? ref.raw.kwl : null,
AllParametersPllParsCalibrated: (ref) => ref ? ref.raw.kwl : null,
AllParameters: (ref) => ref ? ref.raw.kwl : null,
AllStatisticsCounters: (x) => x ? [x.missing_samples, x.bp_overall, x.bp_offset, x.bp_offset_errors, x.bp_drift, x.bp_drift_errors] : null,
AllStatistics: (ref) => ref ? ref.raw.kwl : null,
PLLParameters: (x) => x ? [x.max_drift_adjustment_step, x.stiffness, x.damping] : null,
MicroEpoch: (x) => x ? [x.epoch_index, x.continuity_index, x.reference_time, x.reference_counter, x.fpga_drift_to_clock, x.best_before, x.g23_98, x.g24, x.g25, x.g29_97, x.g30, x.g50, x.g59_94, x.g60, x.grtp_48k, x.grtp_90k, x.grtp_27m] : null
};
class AllStatistics {
constructor(raw) {
this.raw = raw;
}
/**
counter values may be negative to indicate deviations beyond the holdover
threshold
*/
get counters() {
return new VScript.rKeyword(this, "counters", { lift: exports.lift.AllStatisticsCounters, lower: exports.lower.AllStatisticsCounters });
}
get attempting_calibration_for() {
return new VScript.rKeyword(this, "attempting_calibration_for");
}
}
class AllParametersPllParsCalibrated {
constructor(raw) {
this.raw = raw;
}
get inner_corridor() {
return new VScript.rwKeyword(this, "inner_corridor", { lift: exports.lift.PLLParameters, lower: exports.lower.PLLParameters });
}
get outer() {
return new VScript.rwKeyword(this, "outer", { lift: exports.lift.PLLParameters, lower: exports.lower.PLLParameters });
}
}
class AllParameters {
constructor(raw) {
this.raw = raw;
}
/**
use this as the default UTC/TAI offset for time sources that don't supply
this information on their own (i.e., PTP agents enslaved to a
sufficiently well-informed Master). Following the PTP standard, this
denotes the TAI-to-UTC offset and hence should always be positive.
*/
get default_utc_offset_seconds() {
return new VScript.rwKeyword(this, "default_utc_offset_seconds");
}
get locking_policy() {
return new VScript.rwKeyword(this, "locking_policy");
}
get pll_pars_uncalibrated() {
return new VScript.rwKeyword(this, "pll_pars_uncalibrated", { lift: exports.lift.PLLParameters, lower: exports.lower.PLLParameters });
}
get max_rel_acceleration() {
return new VScript.rKeyword(this, "max_rel_acceleration");
}
get max_allowed_offset() {
return new VScript.rwKeyword(this, "max_allowed_offset");
}
/**
ignore incoming messages for this long after irregular clock adjustments
and hard resets
*/
get timeout_after_reset() {
return new VScript.rwKeyword(this, "timeout_after_reset");
}
get capture_threshold() {
return new VScript.rwKeyword(this, "capture_threshold");
}
get convergence_threshold() {
return new VScript.rwKeyword(this, "convergence_threshold");
}
get capture_drift_threshold() {
return new VScript.rwKeyword(this, "capture_drift_threshold");
}
get convergence_drift_threshold() {
return new VScript.rwKeyword(this, "convergence_drift_threshold");
}
get promotion_threshold() {
return new VScript.rwKeyword(this, "promotion_threshold");
}
get demotion_threshold() {
return new VScript.rwKeyword(this, "demotion_threshold");
}
/**
Determines how long the PTP clock may remain uncalibrated before it
resets itself
*/
get calibration_timeout() {
return new VScript.rwKeyword(this, "calibration_timeout");
}
/**
If set to `Reset`, a calibration timeout will reset the clock
controller's internal state and all estimates currently held by PTP
agents. If set to `ResetAggressively`, agents will be reinitialized
completely, clearing also their currently selected best masters and any
other transient data they may hold
*/
get on_calibration_timeout() {
return new VScript.rwKeyword(this, "on_calibration_timeout");
}
get pll_pars_calibrated() {
return new AllParametersPllParsCalibrated(this.raw.find("pll_pars_calibrated"));
}
}
class AllMicroEpochs {
constructor(raw) {
this.raw = raw;
}
get current() {
return new VScript.rKeyword(this, "current", { lift: exports.lift.MicroEpoch, lower: exports.lower.MicroEpoch });
}
get previous() {
return new VScript.rKeyword(this, "previous", { lift: exports.lift.MicroEpoch, lower: exports.lower.MicroEpoch });
}
get delta_offset() {
return new VScript.rKeyword(this, "delta_offset");
}
get delta_drift() {
return new VScript.rKeyword(this, "delta_drift");
}
}
class All {
constructor(raw) {
this.raw = raw;
}
get input() {
return new VScript.duplexKeyword(this, "input", { lift: _Time.lift.Source, lower: _Time.lower.Source });
}
get state() {
return new VScript.rKeyword(this, "state");
}
get alert_level() {
return new VScript.rKeyword(this, "alert_level");
}
/**
when `mode` is set to `LockToInput`, the PTP clock will attempt to
synchronize with the external time source designated by `input`. This is
the default setting and typically the only option suitable for production
use.
When `mode` is set to `UseInternalOscillator`, the PTP clock will first
reset its speed to the nominal clock rate generated by its internal
oscillator, and in the following suspend all clock control operations.
Likewise, `Disconnect` suspends all clock control operations but in
contrast to `UseInternalOscillator` continues to run at the current value
of `relative_clock_speed`
*/
get mode() { return new VScript.rwKeyword(this, "mode"); }
get relative_clock_speed() {
return new VScript.rKeyword(this, "relative_clock_speed");
}
/**
@brief Randomize clock
@desc Do not push this button
*/
get randomize_clock() {
return new VScript.rwKeyword(this, "randomize_clock");
}
get statistics() { return new AllStatistics(this.raw.find("statistics")); }
get parameters() { return new AllParameters(this.raw.find("parameters")); }
get micro_epochs() {
return new AllMicroEpochs(this.raw.find("micro_epochs"));
}
get output() { return new _Time.Source(this.raw.find("output")); }
get ptp_traits() { return new _PTP.Traits(this.raw.find("ptp_traits")); }
}
exports.All = All;
exports.Enums = {
Mode: ["LockToInput", "UseInternalOscillator", "Disconnect"],
State: ["FreeRun", "Uncalibrated", "Calibrated", "CalibratedAndLocked"]
};