Commit 01ef2a62 authored by legoc's avatar legoc
Browse files

Some corrections for the status

parent 09131ea9
......@@ -44,6 +44,16 @@
"runtimeExecutable": "node",
"protocol": "inspector",
"args": ["--spy"]
},
{
"type": "node",
"request": "launch",
"name": "Debug Node Process (--nomad)",
"program": "${workspaceFolder}/js/server/main.js",
"cwd": "${workspaceRoot}",
"runtimeExecutable": "node",
"protocol": "inspector",
"args": ["--nomad"]
}
]
}
\ No newline at end of file
......@@ -219,6 +219,7 @@ class ScatteringData {
set ss(value) { this._ss = value; }
get status() { return this._status; }
set status(value) { this._status = value; }
get paused() { return this._paused; }
set paused(value) { this._paused = value; }
......@@ -263,6 +264,8 @@ class ScatteringData {
this._ss = scatteringModel.ss;
this._status = scatteringModel.status;
console.log('status', this._status)
}
}
......
......@@ -106,19 +106,7 @@ class ScatteringView3D extends View3D {
});
receiver.on('update-status', (msg, value) => {
if (value.status === 1) {
this._qSphere.setColor(Color.OK);
this._kiSphere.setColor(Color.OK);
this._qArrow.setColor(Color.Q);
}
else {
this._qSphere.setColor(Color.ERROR);
this._kiSphere.setColor(Color.ERROR);
this._qArrow.setColor(Color.ERROR);
}
this._setStatus(value.status);
});
}
......@@ -155,6 +143,7 @@ class ScatteringView3D extends View3D {
this._kiSphere.position.copy(vector3WorldToView(scatteringModel.kiPoints.start));
this.drawArrows();
this._setStatus(scatteringModel.status);
// For the trajectory view.
PubSub.publishSync('update-3D-scattering', 0);
......@@ -411,6 +400,21 @@ class ScatteringView3D extends View3D {
}
}
_setStatus(status) {
if (status === 1) {
this._qSphere.setColor(Color.OK);
this._kiSphere.setColor(Color.OK);
this._qArrow.setColor(Color.Q);
}
else {
this._qSphere.setColor(Color.ERROR);
this._kiSphere.setColor(Color.ERROR);
this._qArrow.setColor(Color.ERROR);
}
}
}
module.exports = ScatteringView3D;
\ No newline at end of file
......@@ -66,31 +66,7 @@ class AnglesPanelView {
// Background color change if a position is forbidden.
receiver.on('update-status', (msg, value) => {
if (value.status === 1) {
$("#angleStatus").removeClass("angle-error");
$("#angleStatus").addClass("angle-ok");
$("#angleStatus").val('Ok');
}
else if (value.status !== 0) {
$("#angleStatus").removeClass("angle-ok");
$("#angleStatus").addClass("angle-error");
$("#angleStatus").val('Error');
}
if (value.status !== 0) {
for (let i = 1; i < 8; i++) {
let id = '#a' + i;
if (value.error === i) {
$(id).addClass("angle-error");
}
else {
$(id).removeClass("angle-error");
}
}
}
this._setStatus(value);
});
// Hide the button if not in spy mode.
......@@ -110,6 +86,7 @@ class AnglesPanelView {
$('#a5').val(value.a5.toFixed(3));
$('#a6').val(value.a6.toFixed(3));
$('#a7').val(value.a3p.toFixed(3));
this._setStatus(value);
}
/**
......@@ -130,6 +107,32 @@ class AnglesPanelView {
render() {
}
_setStatus(value) {
if (value.status === 1) {
$("#angleStatus").removeClass("angle-error");
$("#angleStatus").addClass("angle-ok");
$("#angleStatus").val('Ok');
}
else if (value.status !== 0) {
$("#angleStatus").removeClass("angle-ok");
$("#angleStatus").addClass("angle-error");
$("#angleStatus").val('Error');
}
if (value.status !== 0) {
for (let i = 1; i < 8; i++) {
let id = '#a' + i;
if (value.error === i) {
$(id).addClass("angle-error");
}
else {
$(id).removeClass("angle-error");
}
}
}
}
}
module.exports = AnglesPanelView;
\ No newline at end of file
......@@ -470,6 +470,7 @@ receiver.on('resync', (msg, data) => {
expdata: expDataModel.toObject(),
scattering: scatteringModel.toObject(),
trajectory: trajectoryModel.toObject(),
trajectoryData: trajectoryDataModel.toObject(), // We pass all the trajectories.
atoms: atomsModel.toObject(),
matrix: {
uMatrix: vEXP.uMatrix.toArray(),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment