some fixes

This commit is contained in:
Ayzen
2025-09-29 16:02:06 +03:00
parent a43f949f24
commit 3b1aa988de
8 changed files with 44 additions and 25 deletions

View File

@ -61,14 +61,14 @@ export class AcquisitionManager {
const result = await response.json();
if (result.success) {
this.notifications.show(result.message, 'success');
this.notifications.show({type: 'success', message: result.message});
await this.updateStatus();
} else {
this.notifications.show(result.error || 'Failed to start acquisition', 'error');
this.notifications.show({type: 'error', message: result.error || 'Failed to start acquisition'});
}
} catch (error) {
console.error('Error starting acquisition:', error);
this.notifications.show('Failed to start acquisition', 'error');
this.notifications.show({type: 'error', message: 'Failed to start acquisition'});
} finally {
this.setButtonLoading(this.elements.startBtn, false);
}
@ -86,14 +86,14 @@ export class AcquisitionManager {
const result = await response.json();
if (result.success) {
this.notifications.show(result.message, 'success');
this.notifications.show({type: 'success', message: result.message});
await this.updateStatus();
} else {
this.notifications.show(result.error || 'Failed to stop acquisition', 'error');
this.notifications.show({type: 'error', message: result.error || 'Failed to stop acquisition'});
}
} catch (error) {
console.error('Error stopping acquisition:', error);
this.notifications.show('Failed to stop acquisition', 'error');
this.notifications.show({type: 'error', message: 'Failed to stop acquisition'});
} finally {
this.setButtonLoading(this.elements.stopBtn, false);
}
@ -111,14 +111,14 @@ export class AcquisitionManager {
const result = await response.json();
if (result.success) {
this.notifications.show(result.message, 'success');
this.notifications.show({type: 'success', message: result.message});
await this.updateStatus();
} else {
this.notifications.show(result.error || 'Failed to trigger single sweep', 'error');
this.notifications.show({type: 'error', message: result.error || 'Failed to trigger single sweep'});
}
} catch (error) {
console.error('Error triggering single sweep:', error);
this.notifications.show('Failed to trigger single sweep', 'error');
this.notifications.show({type: 'error', message: 'Failed to trigger single sweep'});
} finally {
this.setButtonLoading(this.elements.singleSweepBtn, false);
}