Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private syncPhase1Counts(final: boolean) {
if (final) {
// discard stopwatch and sync.
this._reportStopWatch = undefined;
} else {
// start stopwatch if not already going.
if (!this._reportStopWatch) {
this._reportStopWatch = new StopWatch(undefined, true);
this._nextET = 0;
} else if (this._reportStopWatch.elapsed.milliseconds < this._nextET) {
return;
}
this._nextET += 200;
}
const properties = [
new ToolSettingsPropertyItem(new ToolSettingsValue(this.currentFolder), this.currentFolderPropertyName),
new ToolSettingsPropertyItem(new ToolSettingsValue(this.currentFile), this.currentFilePropertyName),
new ToolSettingsPropertyItem(new ToolSettingsValue(this.photoCount), this.photoCountPropertyName),
new ToolSettingsPropertyItem(new ToolSettingsValue(this.panoramaCount), this.panoramaCountPropertyName),
];
this.onSyncPropertiesChangeEvent.emit({ properties });
}
// discard stopwatch and sync.
this._reportStopWatch = undefined;
} else {
// start stopwatch if not already going.
if (!this._reportStopWatch) {
this._reportStopWatch = new StopWatch(undefined, true);
this._nextET = 0;
} else if (this._reportStopWatch.elapsed.milliseconds < this._nextET) {
return;
}
this._nextET += 200;
}
const properties = [
new ToolSettingsPropertyItem(new ToolSettingsValue(this.currentFolder), this.currentFolderPropertyName),
new ToolSettingsPropertyItem(new ToolSettingsValue(this.currentFile), this.currentFilePropertyName),
new ToolSettingsPropertyItem(new ToolSettingsValue(this.photoCount), this.photoCountPropertyName),
new ToolSettingsPropertyItem(new ToolSettingsValue(this.panoramaCount), this.panoramaCountPropertyName),
];
this.onSyncPropertiesChangeEvent.emit({ properties });
}
if (final) {
// discard stopwatch and sync.
this._reportStopWatch = undefined;
} else {
// start stopwatch if not already going.
if (!this._reportStopWatch) {
this._reportStopWatch = new StopWatch(undefined, true);
this._nextET = 0;
} else if (this._reportStopWatch.elapsed.milliseconds < this._nextET) {
return;
}
this._nextET += 200;
}
const properties = [
new ToolSettingsPropertyItem(new ToolSettingsValue(this.currentFolder), this.currentFolderPropertyName),
new ToolSettingsPropertyItem(new ToolSettingsValue(this.currentFile), this.currentFilePropertyName),
new ToolSettingsPropertyItem(new ToolSettingsValue(this.photoCount), this.photoCountPropertyName),
new ToolSettingsPropertyItem(new ToolSettingsValue(this.panoramaCount), this.panoramaCountPropertyName),
];
this.onSyncPropertiesChangeEvent.emit({ properties });
}
this._reportStopWatch = undefined;
} else {
// start stopwatch if not already going.
if (!this._reportStopWatch) {
this._reportStopWatch = new StopWatch(undefined, true);
this._nextET = 0;
} else if (this._reportStopWatch.elapsed.milliseconds < this._nextET) {
return;
}
this._nextET += 200;
}
const properties = [
new ToolSettingsPropertyItem(new ToolSettingsValue(this.currentFolder), this.currentFolderPropertyName),
new ToolSettingsPropertyItem(new ToolSettingsValue(this.currentFile), this.currentFilePropertyName),
new ToolSettingsPropertyItem(new ToolSettingsValue(this.photoCount), this.photoCountPropertyName),
new ToolSettingsPropertyItem(new ToolSettingsValue(this.panoramaCount), this.panoramaCountPropertyName),
];
this.onSyncPropertiesChangeEvent.emit({ properties });
}
private _onRun = () => {
// this._closeDialog(); // NOTE: to close the dialog, uncomment this line
const { currentTab, sensor, startTime, endTime } = this.state;
const properties = [];
properties.push(new ToolSettingsPropertyItem(new ToolSettingsValue(this.props.dataProvider.getAnimationTypeFromString(sensor)), this.props.dataProvider.currentAnimationTypePropertyName));
properties.push(new ToolSettingsPropertyItem(new ToolSettingsValue(startTime), this.props.dataProvider.startTimePropertyName));
properties.push(new ToolSettingsPropertyItem(new ToolSettingsValue(endTime), this.props.dataProvider.endTimePropertyName));
properties.push(new ToolSettingsPropertyItem(new ToolSettingsValue(1 === currentTab ? true : false), this.props.dataProvider.monitorModePropertyName));
this.props.dataProvider.processChangesInUi(properties);
}
private _onRun = () => {
// this._closeDialog(); // NOTE: to close the dialog, uncomment this line
const { currentTab, sensor, startTime, endTime } = this.state;
const properties = [];
properties.push(new ToolSettingsPropertyItem(new ToolSettingsValue(this.props.dataProvider.getAnimationTypeFromString(sensor)), this.props.dataProvider.currentAnimationTypePropertyName));
properties.push(new ToolSettingsPropertyItem(new ToolSettingsValue(startTime), this.props.dataProvider.startTimePropertyName));
properties.push(new ToolSettingsPropertyItem(new ToolSettingsValue(endTime), this.props.dataProvider.endTimePropertyName));
properties.push(new ToolSettingsPropertyItem(new ToolSettingsValue(1 === currentTab ? true : false), this.props.dataProvider.monitorModePropertyName));
this.props.dataProvider.processChangesInUi(properties);
}
private _onRun = () => {
// this._closeDialog(); // NOTE: to close the dialog, uncomment this line
const { currentTab, sensor, startTime, endTime } = this.state;
const properties = [];
properties.push(new ToolSettingsPropertyItem(new ToolSettingsValue(this.props.dataProvider.getAnimationTypeFromString(sensor)), this.props.dataProvider.currentAnimationTypePropertyName));
properties.push(new ToolSettingsPropertyItem(new ToolSettingsValue(startTime), this.props.dataProvider.startTimePropertyName));
properties.push(new ToolSettingsPropertyItem(new ToolSettingsValue(endTime), this.props.dataProvider.endTimePropertyName));
properties.push(new ToolSettingsPropertyItem(new ToolSettingsValue(1 === currentTab ? true : false), this.props.dataProvider.monitorModePropertyName));
this.props.dataProvider.processChangesInUi(properties);
}
public syncLoadPhaseInUi() {
const properties = [new ToolSettingsPropertyItem(new ToolSettingsValue(this.loadPhase), this.loadPhasePropertyName)];
this.onSyncPropertiesChangeEvent.emit({ properties });
}