Commit 8faef48e authored by legoc's avatar legoc
Browse files

Renamed app-state into server-state

parent 164a1f02
const Controller = require('./controller');
const PubSub = require('pubsub-js');
const { config } = require('../app-state');
const { config } = require('../server-state');
const { requester } = require('../main/context');
const { synchronize } = require('../main/synchronizer');
......
const Controller = require('./controller');
const { plane, peaks, sample, atoms, matrix } = require('../app-state');
const { plane, peaks, sample, atoms, matrix } = require('../server-state');
class LatticeController extends Controller {
constructor(lattice3D) {
......
const Controller = require('./controller');
const { requester } = require('../main/context');
const { peaks } = require('../app-state');
const { peaks } = require('../server-state');
class PeaksController extends Controller {
constructor(peaksPanel) {
......
const Controller = require('./controller');
const PubSub = require('pubsub-js');
const { menuEvent, requester } = require('../main/context');
const { expdata, grid, plane, peaks, matrix } = require('../app-state');
const { expdata, grid, plane, peaks, matrix } = require('../server-state');
class PlaneController extends Controller {
constructor(planePanel, gridPanel, expDataPanel, plane3D) {
......
const Controller = require('./controller');
const PubSub = require('pubsub-js');
const { sample, matrix, plane, atoms } = require('../app-state');
const { sample, matrix, plane, atoms } = require('../server-state');
const { requester } = require('../main/context');
const THREE = require('three');
......
const Controller = require('./controller');
const PubSub = require('pubsub-js');
const { menuEvent, requester, receiver } = require('../main/context');
const { scattering, matrix } = require('../app-state');
const { scattering, matrix } = require('../server-state');
const { calculateKiKf } = require('../utils/calculations');
const THREE = require('three');
......
const Controller = require('./controller');
const PubSub = require('pubsub-js');
const { requester } = require('../main/context');
const { trajectory, scattering, matrix } = require('../app-state');
const { trajectory, scattering, matrix } = require('../server-state');
const { synchronize, synchronizeSpy, synchronizeScan } = require('../main/synchronizer');
const THREE = require('three');
......
const Controller = require('./controller');
const PubSub = require('pubsub-js');
const { requester } = require('../main/context');
const { atoms, sample } = require('../app-state');
const { atoms, sample } = require('../server-state');
class UnitCellController extends Controller {
constructor(atomsPanel) {
......
const { requester, menuEvent } = require('./context');
const { synchronize } = require('./synchronizer');
const myLayout = require('./multi-layout');
const state = require('../app-state');
const state = require('../server-state');
requester.onReady(() => {
......
......@@ -2,7 +2,7 @@
* Multi-layout management with Golden Layout.
*/
const GoldenLayout = require('golden-layout');
const state = require('../app-state');
const state = require('../server-state');
// Golden Layout initial config.
let config = {
......
const state = require('../app-state');
const state = require('../server-state');
const PubSub = require('pubsub-js');
function synchronize(data) {
......
......@@ -3,13 +3,16 @@ const LineSegment = require('./line-segment');
const {scale, vector3WorldToView, scalarWorldToView, vector3ViewToWorld} = require('../conversion');
const Color = require('../colors');
const {mapColor} = require('../map-color');
const { mode } = require('../../app-state');
const { mode } = require('../../server-state');
const THREE = require('three');
class EnergyLine extends TrajectoryLine {
constructor(type, parent, start, end, center, steps) {
super(type, parent, start, end, center, steps);
// Scale the energy if the local z direction.
this._scale = 1.0;
// Material.
this._lineMaterial = new THREE.MeshBasicMaterial({ color: Color.Q, depthTest: true, transparent: false });
......@@ -30,6 +33,10 @@ class EnergyLine extends TrajectoryLine {
this.updateLine();
}
scale(value) {
this._scale = value;
}
setData(data) {
// Update only if the new data has more points.
......
......@@ -17,8 +17,7 @@ class TrajectoryLine {
this._setIntervals();
this._type = type;
this._center = center.clone();
this._scale = 1.0;
// Create a group for the elements of the line.
this._group = new THREE.Group();
this._group.scale.x = scale;
......@@ -105,10 +104,6 @@ class TrajectoryLine {
throw new Error('highlightSpheres must be redefined');
}
scale(value) {
this._scale = value;
}
calculateSegmentMatrix(start, end) {
let d = end.clone().sub(start).normalize();
......
......@@ -2,7 +2,7 @@ const View3D = require('./view3d');
const {vector3WorldToView} = require('../../utils/conversion');
const math = require('mathjs');
const xtal = require('../../../server/model/xtal/xtal');
const { peaks } = require('../../app-state');
const { peaks } = require('../../server-state');
const THREE = require('three');
// Value for determining if a peak is in the scattering plane.
......
......@@ -2,7 +2,7 @@ const View3D = require('./view3d');
const {vector3WorldToView, vector3ViewToWorld} = require('../../utils/conversion');
const { mapColor } = require('../../utils/map-color');
const THREE = require('three');
const { grid, matrix } = require('../../app-state');
const { grid, matrix } = require('../../server-state');
const { requester } = require('../../main/context');
const X_DIR = 1;
......
......@@ -6,7 +6,7 @@ const Arrow3D = require('../../utils/shapes/arrow-3d');
const Color = require('../../utils/colors');
const {vector3WorldToView, vector3ViewToWorld } = require('../../utils/conversion');
const { calculateSs, calculateKiKf } = require('../../utils/calculations');
const { scattering, matrix, mode } = require('../../app-state');
const { scattering, matrix, mode } = require('../../server-state');
class ScatteringView3D extends View3D {
constructor(scene, dragControls, raycaster, draggables, mapControls) {
......
......@@ -4,7 +4,7 @@ const EnergyLine = require('../../utils/shapes/energy-line');
const { calculateKiKf } = require('../../utils/calculations');
const THREE = require('three');
const { displayMode } = require('../../main/context');
const { scattering, matrix, trajectoryData } = require('../../app-state');
const { scattering, matrix, trajectoryData } = require('../../server-state');
const {scalarWorldToView} = require('../../utils/conversion');
const Constants = require('../../utils/constants');
......@@ -462,7 +462,7 @@ class TrajectoryView3D extends View3D {
let energyStart = this.loadEnergyPoint(trajectory.start, bMatrix, uMatrix);
let energyEnd = this.loadEnergyPoint(trajectory.end, bMatrix, uMatrix);
energyLine = new EnergyLine('q', this._energyTranslationGroup,
energyLine = new EnergyLine('ki', this._energyTranslationGroup,
energyStart,
energyEnd,
energyStart,
......@@ -533,7 +533,7 @@ class TrajectoryView3D extends View3D {
let energyStart = this.loadEnergyPoint(trajectory.start, bMatrix, uMatrix);
let energyEnd = this.loadEnergyPoint(trajectory.end, bMatrix, uMatrix);
energyLine = new EnergyLine('q', this._energyTranslationGroup,
energyLine = new EnergyLine('kf', this._energyTranslationGroup,
energyStart,
energyEnd,
energyStart,
......
const viewManager = require('../../utils/view-manager');
const { requester, receiver } = require('../../main/context');
const { synchronize } = require('../../main/synchronizer');
const { mode } = require('../../app-state');
const { mode } = require('../../server-state');
const PubSub = require('pubsub-js');
class AnglesPanelView {
......
......@@ -3,7 +3,7 @@ const viewManager = require('../../utils/view-manager');
const PubSub = require('pubsub-js');
const xtal = require('../../../server/model/xtal/xtal');
const grid = require('ag-grid');
const { atoms } = require('../../app-state');
const { atoms } = require('../../server-state');
const atomColor = require('../../utils/atom-color');
const SeedRandom = require('seedrandom');
......
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