1b392a3832
# Conflicts: # src/jmap/config/deviceStyle.js # src/jmap/config/deviceType.js # src/jmap/shape/factory.js # src/jmap/utils/parser.js
43 lines
1.4 KiB
JavaScript
43 lines
1.4 KiB
JavaScript
import deviceType from '../config/deviceType';
|
|
import Link from './Link';
|
|
import Section from './Section';
|
|
import Signal from './Signal';
|
|
import Station from './Station';
|
|
import StationControl from './StationControl';
|
|
import ImageControl from './ImageControl';
|
|
import LcControl from './LcControl';
|
|
import LimitControl from './LimitControl';
|
|
import Switch from './Switch';
|
|
import ZcControl from './ZcControl';
|
|
import StationCounter from './StationCounter';
|
|
import StationDelayUnlock from './StationDelayUnlock';
|
|
import TrainWindow from "./TrainWindow";
|
|
import Train from "./Train";
|
|
|
|
/** 图库*/
|
|
const mapShape = {};
|
|
mapShape[deviceType.Link] = Link;
|
|
mapShape[deviceType.Section] = Section;
|
|
mapShape[deviceType.Signal] = Signal;
|
|
mapShape[deviceType.Station] = Station;
|
|
mapShape[deviceType.StationControl] = StationControl;
|
|
mapShape[deviceType.ImageControl] = ImageControl;
|
|
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.TrainWindow] = TrainWindow;
|
|
mapShape[deviceType.Train] = Train;
|
|
|
|
function shapefactory(type, device, jmap) {
|
|
const style = jmap.getStyleDict();
|
|
const shape = mapShape[type];
|
|
if (shape instanceof Function) {
|
|
return new shape(device, style[type], jmap);
|
|
}
|
|
}
|
|
|
|
export default shapefactory;
|