rt-sim-training-client/src/jmapNew/shape/factory.js

93 lines
3.7 KiB
JavaScript
Raw Normal View History

2019-11-29 12:51:58 +08:00
import deviceType from '../constant/deviceType';
import Section from './Section/index.js';
import Signal from './Signal/index.js';
import Station from './Station/index.js';
2019-12-23 10:53:25 +08:00
import Resource from './Resource/index.js';
2019-11-29 12:51:58 +08:00
import LcControl from './LcControl/index.js';
import LimitControl from './LimitControl/index.js';
import Switch from './Switch/index.js';
import ZcControl from './ZcControl/index.js';
import StationCounter from './StationCounter/index.js';
import StationDelayUnlock from './StationDelayUnlock/index.js';
import StationStand from './StationStand/index.js';
import Psd from './Psd/index.js';
2019-11-29 12:51:58 +08:00
import TrainWindow from './TrainWindow/index.js';
import Train from './Train/index.js';
import Line from './Line/index.js';
import Text2 from './Text/index.js';
2020-03-17 16:12:15 +08:00
import AxleReset from './AxleReset/index';
import GuideLock from './GuideLock/index';
import AutoTurnBack from './AutoTurnBack/index.js';
2020-03-05 15:48:51 +08:00
import OutFrame from './OutFrame/index.js';
2019-11-29 12:51:58 +08:00
import CheckBox from './checkBox/checkBox.js';
2020-03-05 16:39:49 +08:00
import AutomaticRoute from './AutomacticRoute/index.js';
2020-03-24 15:02:14 +08:00
import SaidLamp from './SaidLamp/index.js';
import SplitStation from './SplitStation/index';
import Arrow from './Arrow/index';
import Power from './Power/index';
import StationTurnBack from './StationTurnBack/index';
2020-08-13 19:27:02 +08:00
import OverAp from './OverAp/index.js';
2020-08-20 13:17:58 +08:00
import FloodGate from './FloodGate/index';
2020-10-10 17:58:14 +08:00
import DirectionRod from './DirectionRod/index';
2019-11-29 12:51:58 +08:00
/** 图库*/
const mapShape = {};
mapShape[deviceType.Section] = Section;
mapShape[deviceType.Signal] = Signal;
mapShape[deviceType.Station] = Station;
2019-12-23 10:53:25 +08:00
mapShape[deviceType.Resource] = Resource;
2019-11-29 12:51:58 +08:00
mapShape[deviceType.LcControl] = LcControl;
mapShape[deviceType.LimitControl] = LimitControl;
mapShape[deviceType.Switch] = Switch;
mapShape[deviceType.ZcControl] = ZcControl;
mapShape[deviceType.StationCounter] = StationCounter;
mapShape[deviceType.StationDelayUnlock] = StationDelayUnlock;
mapShape[deviceType.StationStand] = StationStand;
mapShape[deviceType.Psd] = Psd;
2019-11-29 12:51:58 +08:00
mapShape[deviceType.TrainWindow] = TrainWindow;
mapShape[deviceType.Train] = Train;
mapShape[deviceType.Line] = Line;
mapShape[deviceType.Text] = Text2;
mapShape[deviceType.AutoTurnBack] = AutoTurnBack;
2020-03-05 15:48:51 +08:00
mapShape[deviceType.OutFrame] = OutFrame;
2020-03-17 16:12:15 +08:00
mapShape[deviceType.AxleReset] = AxleReset;
mapShape[deviceType.GuideLock] = GuideLock;
2019-11-29 12:51:58 +08:00
mapShape[deviceType.CheckBox] = CheckBox;
2020-03-05 16:39:49 +08:00
mapShape[deviceType.AutomaticRoute] = AutomaticRoute;
2020-03-24 15:02:14 +08:00
mapShape[deviceType.AtsControl] = SaidLamp;
mapShape[deviceType.CenterCommunication] = SaidLamp;
mapShape[deviceType.ChainControl] = SaidLamp;
mapShape[deviceType.IntersiteControl] = SaidLamp;
mapShape[deviceType.LeuControl] = SaidLamp;
mapShape[deviceType.LocalControl] = SaidLamp;
mapShape[deviceType.Maintain] = SaidLamp;
mapShape[deviceType.PowerSupply] = SaidLamp;
mapShape[deviceType.NoOneReturn] = SaidLamp;
mapShape[deviceType.MaintenanceLamps] = SaidLamp;
2020-03-24 16:35:09 +08:00
mapShape[deviceType.ZcCommunication] = SaidLamp;
2020-04-14 15:45:13 +08:00
mapShape[deviceType.ControlSwitch] = SaidLamp;
mapShape[deviceType.LampFilament] = SaidLamp;
mapShape[deviceType.ModeStatusGroup] = SaidLamp;
mapShape[deviceType.FaultStatusGroup] = SaidLamp;
mapShape[deviceType.ReturnModeGroup] = SaidLamp;
mapShape[deviceType.Axle] = SaidLamp;
mapShape[deviceType.SwitchFault] = SaidLamp;
mapShape[deviceType.SplitStation] = SplitStation;
mapShape[deviceType.Arrow] = Arrow;
mapShape[deviceType.Power] = Power;
mapShape[deviceType.StationTurnBack] = StationTurnBack;
2020-08-13 19:27:02 +08:00
mapShape[deviceType.OverAp] = OverAp;
2020-08-20 13:17:58 +08:00
mapShape[deviceType.FloodGate] = FloodGate;
2020-10-10 17:58:14 +08:00
mapShape[deviceType.DirectionRod] = DirectionRod;
2019-11-29 12:51:58 +08:00
function shapefactory(device, jmap) {
const type = device._type;
const shape = mapShape[type];
if (shape instanceof Function) {
// eslint-disable-next-line
return new shape(device, jmap.style);
}
}
export default shapefactory;