@fmsim/machine 0.0.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (274) hide show
  1. package/dist/agv-line.js +48 -0
  2. package/dist/agv-line.js.map +1 -0
  3. package/dist/agv.js +43 -0
  4. package/dist/agv.js.map +1 -0
  5. package/dist/buffer.js +40 -0
  6. package/dist/buffer.js.map +1 -0
  7. package/dist/conveyor-join.js +169 -0
  8. package/dist/conveyor-join.js.map +1 -0
  9. package/dist/conveyor.js +84 -0
  10. package/dist/conveyor.js.map +1 -0
  11. package/dist/crane.js +55 -0
  12. package/dist/crane.js.map +1 -0
  13. package/dist/data-subscription.js +126 -0
  14. package/dist/data-subscription.js.map +1 -0
  15. package/dist/editors/index.js +2 -0
  16. package/dist/editors/index.js.map +1 -0
  17. package/dist/equipment.js +18 -0
  18. package/dist/equipment.js.map +1 -0
  19. package/dist/features/client-api.js +45 -0
  20. package/dist/features/client-api.js.map +1 -0
  21. package/dist/features/conveyor-mixin.js +54 -0
  22. package/dist/features/conveyor-mixin.js.map +1 -0
  23. package/dist/features/mcs-event-handler-mixin.js +65 -0
  24. package/dist/features/mcs-event-handler-mixin.js.map +1 -0
  25. package/dist/features/mcs-status-default.js +67 -0
  26. package/dist/features/mcs-status-default.js.map +1 -0
  27. package/dist/features/mcs-status-mixin.js +39 -0
  28. package/dist/features/mcs-status-mixin.js.map +1 -0
  29. package/dist/features/mcs-transport-mixin.js +39 -0
  30. package/dist/features/mcs-transport-mixin.js.map +1 -0
  31. package/dist/features/mcs-zone-mixin.js +18 -0
  32. package/dist/features/mcs-zone-mixin.js.map +1 -0
  33. package/dist/groups/index.js +10 -0
  34. package/dist/groups/index.js.map +1 -0
  35. package/dist/groups/mcs-acs.js +24 -0
  36. package/dist/groups/mcs-acs.js.map +1 -0
  37. package/dist/groups/mcs-bcs.js +27 -0
  38. package/dist/groups/mcs-bcs.js.map +1 -0
  39. package/dist/groups/mcs-ccs.js +25 -0
  40. package/dist/groups/mcs-ccs.js.map +1 -0
  41. package/dist/groups/mcs-ecs.js +23 -0
  42. package/dist/groups/mcs-ecs.js.map +1 -0
  43. package/dist/groups/mcs-ocs.js +25 -0
  44. package/dist/groups/mcs-ocs.js.map +1 -0
  45. package/dist/groups/mcs-path.js +28 -0
  46. package/dist/groups/mcs-path.js.map +1 -0
  47. package/dist/groups/mcs-scs.js +26 -0
  48. package/dist/groups/mcs-scs.js.map +1 -0
  49. package/dist/groups/mcs-shape.js +26 -0
  50. package/dist/groups/mcs-shape.js.map +1 -0
  51. package/dist/index.js +25 -0
  52. package/dist/index.js.map +1 -0
  53. package/dist/mcs-carrier-holder.js +107 -0
  54. package/dist/mcs-carrier-holder.js.map +1 -0
  55. package/dist/mcs-gauge-capacity-bar.js +170 -0
  56. package/dist/mcs-gauge-capacity-bar.js.map +1 -0
  57. package/dist/mcs-gauge-capacity-circle.js +91 -0
  58. package/dist/mcs-gauge-capacity-circle.js.map +1 -0
  59. package/dist/mcs-machine.js +84 -0
  60. package/dist/mcs-machine.js.map +1 -0
  61. package/dist/mcs-popup.js +82 -0
  62. package/dist/mcs-popup.js.map +1 -0
  63. package/dist/mcs-transport.js +18 -0
  64. package/dist/mcs-transport.js.map +1 -0
  65. package/dist/mcs-unit.js +78 -0
  66. package/dist/mcs-unit.js.map +1 -0
  67. package/dist/mcs-vehicle.js +69 -0
  68. package/dist/mcs-vehicle.js.map +1 -0
  69. package/dist/mcs-zone-unit.js +11 -0
  70. package/dist/mcs-zone-unit.js.map +1 -0
  71. package/dist/oht-line.js +32 -0
  72. package/dist/oht-line.js.map +1 -0
  73. package/dist/oht.js +42 -0
  74. package/dist/oht.js.map +1 -0
  75. package/dist/port.js +32 -0
  76. package/dist/port.js.map +1 -0
  77. package/dist/rtv-rail.js +36 -0
  78. package/dist/rtv-rail.js.map +1 -0
  79. package/dist/shelf.js +41 -0
  80. package/dist/shelf.js.map +1 -0
  81. package/dist/shuttle.js +49 -0
  82. package/dist/shuttle.js.map +1 -0
  83. package/dist/stocker-capacity-bar.js +171 -0
  84. package/dist/stocker-capacity-bar.js.map +1 -0
  85. package/dist/stocker.js +36 -0
  86. package/dist/stocker.js.map +1 -0
  87. package/dist/templates/agv-line-corner.js +34 -0
  88. package/dist/templates/agv-line-corner.js.map +1 -0
  89. package/dist/templates/agv-line-cross.js +34 -0
  90. package/dist/templates/agv-line-cross.js.map +1 -0
  91. package/dist/templates/agv-line-horizontal.js +34 -0
  92. package/dist/templates/agv-line-horizontal.js.map +1 -0
  93. package/dist/templates/agv-line-vertical.js +34 -0
  94. package/dist/templates/agv-line-vertical.js.map +1 -0
  95. package/dist/templates/agv-line.js +15 -0
  96. package/dist/templates/agv-line.js.map +1 -0
  97. package/dist/templates/agv.js +15 -0
  98. package/dist/templates/agv.js.map +1 -0
  99. package/dist/templates/buffer.js +15 -0
  100. package/dist/templates/buffer.js.map +1 -0
  101. package/dist/templates/conveyor-corner.js +33 -0
  102. package/dist/templates/conveyor-corner.js.map +1 -0
  103. package/dist/templates/conveyor-join.js +21 -0
  104. package/dist/templates/conveyor-join.js.map +1 -0
  105. package/dist/templates/conveyor-left.js +33 -0
  106. package/dist/templates/conveyor-left.js.map +1 -0
  107. package/dist/templates/conveyor-middle.js +33 -0
  108. package/dist/templates/conveyor-middle.js.map +1 -0
  109. package/dist/templates/conveyor-right.js +33 -0
  110. package/dist/templates/conveyor-right.js.map +1 -0
  111. package/dist/templates/conveyor.js +18 -0
  112. package/dist/templates/conveyor.js.map +1 -0
  113. package/dist/templates/crane.js +15 -0
  114. package/dist/templates/crane.js.map +1 -0
  115. package/dist/templates/data-subscription.js +16 -0
  116. package/dist/templates/data-subscription.js.map +1 -0
  117. package/dist/templates/equipment.js +15 -0
  118. package/dist/templates/equipment.js.map +1 -0
  119. package/dist/templates/index.js +35 -0
  120. package/dist/templates/index.js.map +1 -0
  121. package/dist/templates/mcs-gauge-capacity-bar.js +18 -0
  122. package/dist/templates/mcs-gauge-capacity-bar.js.map +1 -0
  123. package/dist/templates/mcs-gauge-capacity-circle.js +18 -0
  124. package/dist/templates/mcs-gauge-capacity-circle.js.map +1 -0
  125. package/dist/templates/oht-line-corner.js +34 -0
  126. package/dist/templates/oht-line-corner.js.map +1 -0
  127. package/dist/templates/oht-line-cross.js +34 -0
  128. package/dist/templates/oht-line-cross.js.map +1 -0
  129. package/dist/templates/oht-line-horizontal.js +34 -0
  130. package/dist/templates/oht-line-horizontal.js.map +1 -0
  131. package/dist/templates/oht-line-vertical.js +34 -0
  132. package/dist/templates/oht-line-vertical.js.map +1 -0
  133. package/dist/templates/oht-line.js +15 -0
  134. package/dist/templates/oht-line.js.map +1 -0
  135. package/dist/templates/oht.js +15 -0
  136. package/dist/templates/oht.js.map +1 -0
  137. package/dist/templates/port.js +15 -0
  138. package/dist/templates/port.js.map +1 -0
  139. package/dist/templates/rtv-corner.js +33 -0
  140. package/dist/templates/rtv-corner.js.map +1 -0
  141. package/dist/templates/rtv-left.js +33 -0
  142. package/dist/templates/rtv-left.js.map +1 -0
  143. package/dist/templates/rtv-middle.js +33 -0
  144. package/dist/templates/rtv-middle.js.map +1 -0
  145. package/dist/templates/rtv-rail.js +15 -0
  146. package/dist/templates/rtv-rail.js.map +1 -0
  147. package/dist/templates/rtv-right.js +33 -0
  148. package/dist/templates/rtv-right.js.map +1 -0
  149. package/dist/templates/rtv.js +15 -0
  150. package/dist/templates/rtv.js.map +1 -0
  151. package/dist/templates/shelf.js +15 -0
  152. package/dist/templates/shelf.js.map +1 -0
  153. package/dist/templates/shuttle.js +15 -0
  154. package/dist/templates/shuttle.js.map +1 -0
  155. package/dist/templates/stocker-capacity-bar.js +18 -0
  156. package/dist/templates/stocker-capacity-bar.js.map +1 -0
  157. package/dist/templates/stocker-capacity-circle.js +18 -0
  158. package/dist/templates/stocker-capacity-circle.js.map +1 -0
  159. package/dist/templates/stocker.js +16 -0
  160. package/dist/templates/stocker.js.map +1 -0
  161. package/dist/templates/zone-capacity-bar.js +19 -0
  162. package/dist/templates/zone-capacity-bar.js.map +1 -0
  163. package/dist/tsconfig.tsbuildinfo +1 -0
  164. package/dist/utils/get-locale.js +19 -0
  165. package/dist/utils/get-locale.js.map +1 -0
  166. package/dist/utils/get-value-on-ranges.js +23 -0
  167. package/dist/utils/get-value-on-ranges.js.map +1 -0
  168. package/dist/utils/normalize-angle.js +11 -0
  169. package/dist/utils/normalize-angle.js.map +1 -0
  170. package/dist/utils/safe-round.js +9 -0
  171. package/dist/utils/safe-round.js.map +1 -0
  172. package/dist/zone-capacity-bar.js +162 -0
  173. package/dist/zone-capacity-bar.js.map +1 -0
  174. package/icons/agv-line.png +0 -0
  175. package/icons/agv.png +0 -0
  176. package/icons/buffer.png +0 -0
  177. package/icons/conveyor-corner.png +0 -0
  178. package/icons/conveyor-corner.svg +10 -0
  179. package/icons/conveyor-join.png +0 -0
  180. package/icons/conveyor-left.png +0 -0
  181. package/icons/conveyor-left.svg +6 -0
  182. package/icons/conveyor-middle.png +0 -0
  183. package/icons/conveyor-middle.svg +5 -0
  184. package/icons/conveyor-right.png +0 -0
  185. package/icons/conveyor-right.svg +6 -0
  186. package/icons/conveyor.png +0 -0
  187. package/icons/crane.png +0 -0
  188. package/icons/equipment.png +0 -0
  189. package/icons/icon-data-subscription.png +0 -0
  190. package/icons/oht-line.png +0 -0
  191. package/icons/oht.png +0 -0
  192. package/icons/pallet-empty.svg +3 -0
  193. package/icons/pallet.svg +11 -0
  194. package/icons/path-position.svg +5 -0
  195. package/icons/port.png +0 -0
  196. package/icons/process.png +0 -0
  197. package/icons/rtv-rail.png +0 -0
  198. package/icons/rtv.png +0 -0
  199. package/icons/shelf.png +0 -0
  200. package/icons/shuttle.png +0 -0
  201. package/icons/stocker-capacity-bar.png +0 -0
  202. package/icons/stocker-capacity-circle.png +0 -0
  203. package/icons/stocker.png +0 -0
  204. package/icons/symbol-data-subscription.png +0 -0
  205. package/icons/vehicle.png +0 -0
  206. package/icons/zone-capacity-bar.png +0 -0
  207. package/migration-samples/model.json +7964 -0
  208. package/package.json +59 -0
  209. package/src/agv-line.ts +59 -0
  210. package/src/agv.ts +56 -0
  211. package/src/buffer.ts +50 -0
  212. package/src/conveyor-join.ts +208 -0
  213. package/src/conveyor.ts +101 -0
  214. package/src/crane.ts +72 -0
  215. package/src/data-subscription.ts +150 -0
  216. package/src/editors/index.ts +0 -0
  217. package/src/equipment.ts +21 -0
  218. package/src/features/client-api.ts +52 -0
  219. package/src/features/conveyor-mixin.ts +75 -0
  220. package/src/features/mcs-status-default.ts +76 -0
  221. package/src/features/mcs-status-mixin.ts +53 -0
  222. package/src/features/mcs-zone-mixin.ts +23 -0
  223. package/src/groups/index.ts +10 -0
  224. package/src/groups/mcs-acs.ts +24 -0
  225. package/src/groups/mcs-bcs.ts +27 -0
  226. package/src/groups/mcs-ccs.ts +25 -0
  227. package/src/groups/mcs-ecs.ts +23 -0
  228. package/src/groups/mcs-ocs.ts +25 -0
  229. package/src/groups/mcs-path.ts +28 -0
  230. package/src/groups/mcs-scs.ts +26 -0
  231. package/src/groups/mcs-shape.ts +26 -0
  232. package/src/index.ts +29 -0
  233. package/src/mcs-carrier-holder.ts +141 -0
  234. package/src/mcs-gauge-capacity-circle.ts +113 -0
  235. package/src/mcs-machine.ts +101 -0
  236. package/src/mcs-popup.ts +99 -0
  237. package/src/mcs-transport.ts +20 -0
  238. package/src/mcs-unit.ts +91 -0
  239. package/src/mcs-vehicle.ts +79 -0
  240. package/src/oht-line.ts +43 -0
  241. package/src/oht.ts +55 -0
  242. package/src/port.ts +41 -0
  243. package/src/shelf.ts +53 -0
  244. package/src/shuttle.ts +65 -0
  245. package/src/stocker-capacity-bar.ts +220 -0
  246. package/src/stocker.ts +45 -0
  247. package/src/templates/agv-line.ts +15 -0
  248. package/src/templates/agv.ts +15 -0
  249. package/src/templates/buffer.ts +15 -0
  250. package/src/templates/conveyor.ts +18 -0
  251. package/src/templates/crane.ts +15 -0
  252. package/src/templates/data-subscription.js +16 -0
  253. package/src/templates/equipment.ts +15 -0
  254. package/src/templates/index.ts +43 -0
  255. package/src/templates/oht-line.ts +15 -0
  256. package/src/templates/oht.ts +15 -0
  257. package/src/templates/port.ts +15 -0
  258. package/src/templates/shelf.ts +15 -0
  259. package/src/templates/shuttle.ts +15 -0
  260. package/src/templates/stocker-capacity-bar.ts +18 -0
  261. package/src/templates/stocker-capacity-circle.ts +18 -0
  262. package/src/templates/stocker.ts +16 -0
  263. package/src/templates/zone-capacity-bar.ts +19 -0
  264. package/src/utils/get-locale.ts +22 -0
  265. package/src/utils/get-value-on-ranges.ts +25 -0
  266. package/src/utils/normalize-angle.ts +9 -0
  267. package/src/utils/safe-round.ts +8 -0
  268. package/src/zone-capacity-bar.ts +209 -0
  269. package/things-scene.config.js +7 -0
  270. package/translations/en.json +7 -0
  271. package/translations/ja.json +7 -0
  272. package/translations/ko.json +7 -0
  273. package/translations/ms.json +7 -0
  274. package/translations/zh.json +7 -0
@@ -0,0 +1,150 @@
1
+ import { SubscriptionClient } from 'subscriptions-transport-ws'
2
+ import { Component, ComponentNature, DataSource, RectPath, Shape } from '@hatiolab/things-scene'
3
+
4
+ const COMPONENT_IMAGE = new URL('../icons/symbol-data-subscription.png', import.meta.url).href
5
+
6
+ const NATURE: ComponentNature = {
7
+ mutable: false,
8
+ resizable: true,
9
+ rotatable: true,
10
+ properties: [
11
+ {
12
+ type: 'string',
13
+ label: 'tag',
14
+ name: 'tag'
15
+ }
16
+ ],
17
+ 'value-property': 'tag',
18
+ help: 'scene/component/data-subscription'
19
+ }
20
+
21
+ export default class DataSubscription extends DataSource(RectPath(Shape)) {
22
+ static _image
23
+ subscription
24
+ client
25
+ disposed
26
+
27
+ static get image() {
28
+ if (!DataSubscription._image) {
29
+ DataSubscription._image = new Image()
30
+ DataSubscription._image.src = COMPONENT_IMAGE
31
+ }
32
+
33
+ return DataSubscription._image
34
+ }
35
+
36
+ dispose() {
37
+ if (this.subscription) {
38
+ this.subscription.unsubscribe()
39
+ }
40
+ if (this.client) {
41
+ this.client.unsubscribeAll()
42
+ this.client.close(true)
43
+ }
44
+
45
+ super.dispose()
46
+ }
47
+
48
+ render(context) {
49
+ var { left, top, width, height } = this.bounds
50
+
51
+ context.beginPath()
52
+ this.drawImage(context, DataSubscription.image, left, top, width, height)
53
+ }
54
+
55
+ ready() {
56
+ this._initDataSubscription()
57
+ }
58
+
59
+ get nature() {
60
+ return NATURE
61
+ }
62
+
63
+ get tag() {
64
+ return this.state.tag
65
+ }
66
+
67
+ set tag(tag) {
68
+ this.setState('tag', tag)
69
+ }
70
+
71
+ _initDataSubscription() {
72
+ if (!this.app.isViewMode) return
73
+
74
+ this.requestData()
75
+ }
76
+
77
+ async requestData() {
78
+ var { tag } = this.state
79
+ var self = this
80
+ var query = `"${tag}"`
81
+ // var query = `
82
+ // subscription {
83
+ // data(tag: "${tag}") {
84
+ // tag
85
+ // data
86
+ // }
87
+ // }`
88
+ // let wsKey = guid()
89
+ var endpoint = location.origin.replace(/^http/, 'ws') + '/subscriptions'
90
+ this.client = new SubscriptionClient(
91
+ endpoint,
92
+ {
93
+ reconnect: true,
94
+ connectionParams: {
95
+ headers: {
96
+ /*
97
+ 특정 도메인의 데이타만 받고자 하는 경우에, referer 정보를 제공해서 서버에서 서브도메인 정보를 취득하도록 한다.
98
+ referer: location.href
99
+ 또는, 이미 서브도메인 정보를 알고 있다면,
100
+ 'x-things-factory-domain': '[subdomain]'
101
+ 을 보낼 수 있다.
102
+ 관련 정보를 보내지 않는다면, 사용자가 권한을 가진 모든 도메인의 데이타를 수신하게 된다.
103
+ */
104
+ referer: location.href
105
+ }
106
+ }
107
+ }
108
+ // null,
109
+ // null
110
+ // wsKey
111
+ )
112
+
113
+ this.client.onError(e => {
114
+ var client = this.client
115
+ // 보드가 실행중이면 재시도, 아니면 재연결 취소
116
+ if (this.disposed) {
117
+ client.reconnect = false
118
+
119
+ this.client.unsubscribeAll()
120
+ this.client.close(true)
121
+ }
122
+ })
123
+ this.client.onConnected(() => {
124
+ // this.subscription = this.client.request({ query }).subscribe({
125
+ // next({ data }) {
126
+ // if (data) {
127
+ // self.data = data.data.data
128
+ // }
129
+ // }
130
+ // })
131
+ // console.log('this.subscription : ', this.subscription)
132
+ })
133
+ this.subscription = this.client.request({ query }).subscribe({
134
+ next({ data }) {
135
+ if (data) {
136
+ self.data = data.data.data
137
+ }
138
+ }
139
+ })
140
+
141
+ // function guid() {
142
+ // function s4() {
143
+ // return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1)
144
+ // }
145
+ // return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4()
146
+ // }
147
+ }
148
+ }
149
+
150
+ Component.register('data-subscription', DataSubscription)
File without changes
@@ -0,0 +1,21 @@
1
+ import { Component, ComponentNature } from '@hatiolab/things-scene'
2
+ import MCSMachine from './mcs-machine'
3
+
4
+ const NATURE: ComponentNature = {
5
+ mutable: false,
6
+ resizable: true,
7
+ rotatable: true,
8
+ properties: [...MCSMachine.properties]
9
+ }
10
+
11
+ export default class Equipment extends MCSMachine {
12
+ static get nature() {
13
+ return NATURE
14
+ }
15
+
16
+ containable(component: Component) {
17
+ return super.containable(component) || ['Port'].includes(component.state.type)
18
+ }
19
+ }
20
+
21
+ Component.register('Equipment', Equipment)
@@ -0,0 +1,52 @@
1
+ import gql from 'graphql-tag'
2
+
3
+ import { client } from '@operato/graphql'
4
+
5
+ export const themesColorMap = async () => {
6
+ var response = await client.query({
7
+ query: gql`
8
+ query {
9
+ themes {
10
+ items {
11
+ name
12
+ type
13
+ }
14
+ }
15
+ }
16
+ `
17
+ })
18
+
19
+ if (response.errors) {
20
+ return ['']
21
+ }
22
+
23
+ const items = response.data.themes.items.filter((item: any) => item.type == 'color-map').map((item: any) => item.name)
24
+ const sorted = items.sort()
25
+
26
+ return [''].concat(sorted)
27
+ }
28
+
29
+ export const themesColorRange = async () => {
30
+ var response = await client.query({
31
+ query: gql`
32
+ query {
33
+ themes {
34
+ items {
35
+ name
36
+ type
37
+ }
38
+ }
39
+ }
40
+ `
41
+ })
42
+ if (response.errors) {
43
+ return ['']
44
+ }
45
+
46
+ const items = response.data.themes.items
47
+ .filter((item: any) => item.type == 'color-range')
48
+ .map((item: any) => item.name)
49
+ const sorted = items.sort()
50
+
51
+ return [''].concat(sorted)
52
+ }
@@ -0,0 +1,75 @@
1
+ import { Component } from '@hatiolab/things-scene'
2
+ type Constructor<T = {}> = new (...args: any[]) => T
3
+
4
+ function pattern(component: any) {
5
+ var { height } = component.bounds
6
+
7
+ var { rollWidth = 10 } = component.model
8
+
9
+ var width = Math.max(rollWidth, 1)
10
+
11
+ var color = component.statusColor!
12
+ var stroke = component.auxColor!
13
+ var lineWidth = 1
14
+
15
+ if (!component._pattern) {
16
+ component._pattern = document.createElement('canvas')
17
+ }
18
+
19
+ component._pattern.width = width
20
+ component._pattern.height = height
21
+
22
+ var context = component._pattern.getContext('2d')
23
+
24
+ context.beginPath()
25
+ context.fillStyle = color
26
+ context.strokeStyle = stroke
27
+ context.lineWidth = lineWidth
28
+
29
+ context.moveTo(0, 0)
30
+ context.lineTo(width, 0)
31
+ context.lineTo(width, height)
32
+ context.lineTo(0, height)
33
+ context.lineTo(0, 0)
34
+ context.fill()
35
+
36
+ context.beginPath()
37
+
38
+ context.globalAlpha = 0.2
39
+
40
+ var x_for_belt = (component._step || 0) % width
41
+ if (component.value == 2) {
42
+ x_for_belt = width - x_for_belt
43
+ }
44
+
45
+ context.moveTo(x_for_belt, height)
46
+ context.lineTo(x_for_belt, 0)
47
+
48
+ context.stroke()
49
+
50
+ return component._pattern
51
+ }
52
+
53
+ export function ConveyorMixin<TBase extends Constructor<Component>>(Base: TBase) {
54
+ const A = class extends Base {
55
+ _pattern
56
+
57
+ dispose() {
58
+ super.dispose()
59
+ delete this._pattern
60
+ }
61
+
62
+ get fillStyle() {
63
+ return {
64
+ image: pattern(this),
65
+ offsetX: 0,
66
+ offsetY: 0,
67
+ type: 'pattern'
68
+ }
69
+ }
70
+ }
71
+
72
+ Component.memoize(A.prototype, 'fillStyle', false)
73
+
74
+ return A
75
+ }
@@ -0,0 +1,76 @@
1
+ export interface Legend {
2
+ [key: string]: string
3
+ }
4
+
5
+ export const LEGEND_NULL: Legend = { default: 'black' }
6
+
7
+ export const LEGEND_MACHINE: Legend = {
8
+ '1000': '#ad0d8c', // DISCONNECTED
9
+ '1001': '#01ff00', // UP
10
+ '1002': '#ff0000', // OUTOFSERVICE
11
+ '1003': '#7030a0', // PM
12
+ '1004': '#ffffff', // NOTONLINE
13
+ '1005': '#ff0000', // DOWN
14
+ '1006': '#ffff00', // NOTAUTO
15
+ '1007': '#ff9900', // ALARM
16
+ '1008': '#0600ff', // FULL
17
+ default: '#d6d6d6'
18
+ }
19
+
20
+ export const LEGEND_VEHICLE: Legend = {
21
+ '4000': '#ff0000', // OUTOFSERVICE
22
+ '4001': '#01ff00', // ASSIGNED
23
+ // '4002': '#cbf266', // ASSIGNED_ACQUIRING
24
+ // '4003': '#cbf266', // ASSIGNED_DEPOSITING
25
+ // '4004': '#cbf266', // ASSIGNED_ENROUTE
26
+ // '4005': '#cbf266', // ASSIGNED_PARKED
27
+ '4006': '#ffff00', // NOTASSIGNED
28
+ '4007': '#ffffff', // INSTALLED
29
+ '4008': '#b1a0c7', // CHARGING
30
+ '4009': '#7030a0', // CHARGED
31
+ '4010': '#7f878f', // REMOVED
32
+ default: '#cbf266'
33
+ }
34
+
35
+ export const LEGEND_UNIT: Legend = {
36
+ '2000': '#808080', // BANNED
37
+ '2001': '#ff0000', // DOWN
38
+ '2002': 'transparent', // EMPTY
39
+ '2003': '#01ff00', // EMPTY_RESERVED
40
+ '2004': '#01ffff', // FULL_RESERVED
41
+ '2005': '#0600ff', // FULL
42
+ '2006': '#ff0000', // NOTINSERVICE
43
+ default: '#d6d6d6'
44
+ }
45
+
46
+ export const LEGEND_TRANSPORT: Legend = {
47
+ '1000': '#ad0d8c', // DISCONNECTED
48
+ '1001': '#01ff00', // UP
49
+ '1002': '#ff0000', // OUTOFSERVICE
50
+ '1003': '#7030a0', // PM
51
+ '1004': '#ffffff', // NOTONLINE
52
+ '1005': '#ff0000', // DOWN
53
+ '1006': '#ffff00', // NOTAUTO
54
+ '1007': '#ff9900', // ALARM
55
+ '1008': '#0600ff', // FULL
56
+ default: '#d6d6d6'
57
+ }
58
+
59
+ export const LEGEND_CARRIER: Legend = {
60
+ Full: '#ad0d8c',
61
+ Empty: '#01ff00',
62
+ FullFull: '#ffff00',
63
+ FullEmpty: '#7030a0',
64
+ EmptyFull: '#ff9900',
65
+ EmptyEmpty: '#ff0000',
66
+ default: '#d6d6d6'
67
+ }
68
+
69
+ export const LEGEND_CAPACITY: Legend = {
70
+ '0~20': '#ad0d8c',
71
+ '20~40': '#01ff00',
72
+ '40~60': '#ffff00',
73
+ '60~80': '#7030a0',
74
+ '80~100': '#ff9900',
75
+ default: '#d6d6d6'
76
+ }
@@ -0,0 +1,53 @@
1
+ type Constructor<T = {}> = new (...args: any[]) => T
2
+
3
+ interface Legend {
4
+ [key: string]: string
5
+ }
6
+
7
+ import { LEGEND_NULL } from './mcs-status-default'
8
+ import { themesColorMap } from './client-api'
9
+
10
+ export const MCSStatusMixinProperties = [
11
+ {
12
+ type: 'select',
13
+ label: 'legend-name',
14
+ name: 'legendName',
15
+ property: {
16
+ options: themesColorMap
17
+ }
18
+ }
19
+ ]
20
+
21
+ export function MCSStatusMixin<TBase extends Constructor>(Base: TBase) {
22
+ return class extends Base {
23
+ get status(): string | undefined {
24
+ return
25
+ }
26
+
27
+ get auxStatus(): string | undefined {
28
+ return
29
+ }
30
+
31
+ get legend(): Legend {
32
+ return LEGEND_NULL
33
+ }
34
+
35
+ get auxLegend(): Legend {
36
+ return LEGEND_NULL
37
+ }
38
+
39
+ get statusColor(): string | undefined {
40
+ const status = this.status
41
+ const legend = this.legend
42
+
43
+ return (status && legend && (legend[status] || legend[status!] || legend.default)) || legend?.default
44
+ }
45
+
46
+ get auxColor(): string | undefined {
47
+ const status = this.auxStatus
48
+ const legend = this.auxLegend
49
+
50
+ return (status && legend && (legend[status] || legend[status!] || legend.default)) || legend?.default
51
+ }
52
+ }
53
+ }
@@ -0,0 +1,23 @@
1
+ type Constructor<T = {}> = new (...args: any[]) => T
2
+
3
+ import MCSUnit from 'src/mcs-unit'
4
+
5
+ export const MCSZoneMixinProperties = [
6
+ {
7
+ type: 'string',
8
+ label: 'zone',
9
+ name: 'zone'
10
+ }
11
+ ]
12
+
13
+ export function MCSZoneMixin<TBase extends Constructor<MCSUnit>>(Base: TBase) {
14
+ return class extends Base {
15
+ get zone(): string | undefined {
16
+ return
17
+ }
18
+
19
+ set zone(zone: string) {
20
+ this.zone = zone
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,10 @@
1
+ import { ACS } from './mcs-acs'
2
+ import { BCS } from './mcs-bcs'
3
+ import { CCS } from './mcs-ccs'
4
+ import { ECS } from './mcs-ecs'
5
+ import { OCS } from './mcs-ocs'
6
+ import { SCS } from './mcs-scs'
7
+ import { mcsPath } from './mcs-path'
8
+ import { mcsShape } from './mcs-shape'
9
+
10
+ export default [ACS, BCS, CCS, ECS, OCS, SCS, mcsShape, mcsPath]
@@ -0,0 +1,24 @@
1
+ const icon = `
2
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
3
+ viewBox="0 0 35 35" style="enable-background:new 0 0 35 35;" xml:space="preserve">
4
+ <style type="text/css">
5
+ .st0{fill:{{strokeColor}};}
6
+ </style>
7
+ <path class="st0" d="M7.12,20.14l-0.93,3.44H4.14l3.47-12.14h2.52l3.52,12.14h-2.12l-0.98-3.44H7.12z M10.22,18.46l-0.85-2.99
8
+ c-0.21-0.74-0.39-1.57-0.55-2.27H8.79c-0.16,0.7-0.32,1.55-0.51,2.27l-0.84,2.99H10.22z"/>
9
+ <path class="st0" d="M22.61,23.22c-0.47,0.27-1.5,0.54-2.8,0.54c-3.44,0-5.53-2.41-5.53-6.1c0-4,2.48-6.41,5.79-6.41
10
+ c1.3,0,2.24,0.31,2.64,0.54l-0.43,1.76c-0.51-0.25-1.22-0.47-2.12-0.47c-2.2,0-3.8,1.55-3.8,4.47c0,2.66,1.4,4.38,3.78,4.38
11
+ c0.8,0,1.64-0.18,2.16-0.45L22.61,23.22z"/>
12
+ <path class="st0" d="M24.25,21.16c0.64,0.41,1.61,0.77,2.62,0.77c1.27,0,1.98-0.67,1.98-1.66c0-0.92-0.55-1.46-1.93-2.02
13
+ c-1.79-0.72-2.93-1.78-2.93-3.53c0-1.98,1.48-3.49,3.83-3.49c1.17,0,2.04,0.29,2.61,0.61l-0.48,1.78c-0.39-0.23-1.14-0.58-2.16-0.58
14
+ c-1.25,0-1.8,0.76-1.8,1.46c0,0.94,0.63,1.37,2.07,2c1.88,0.79,2.8,1.85,2.8,3.6c0,1.94-1.32,3.64-4.12,3.64
15
+ c-1.14,0-2.33-0.36-2.93-0.76L24.25,21.16z"/>
16
+ </svg>
17
+ `
18
+
19
+ export const ACS = {
20
+ name: 'ACS',
21
+ description: 'The object groups composing the ACS system',
22
+ icon,
23
+ templates: []
24
+ }
@@ -0,0 +1,27 @@
1
+ const icon = `
2
+ <svg version="1.1" id="Layer_2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
3
+ viewBox="0 0 35 35" style="enable-background:new 0 0 35 35;" xml:space="preserve">
4
+ <style type="text/css">
5
+ .st0{fill:{{strokeColor}};}
6
+ </style>
7
+ <path class="st0" d="M4.86,11.6c0.63-0.14,1.77-0.25,2.88-0.25c1.46,0,2.36,0.2,3.1,0.77c0.68,0.45,1.13,1.24,1.13,2.27
8
+ c0,1.12-0.63,2.14-1.8,2.63v0.04c1.14,0.32,2.19,1.33,2.19,3.01c0,1.08-0.42,1.93-1.05,2.5c-0.77,0.76-2.04,1.13-4.02,1.13
9
+ c-1.09,0-1.93-0.09-2.43-0.16V11.6z M6.82,16.39h1.01c1.37,0,2.14-0.72,2.14-1.75c0-1.13-0.77-1.66-2.03-1.66
10
+ c-0.58,0-0.92,0.04-1.13,0.09V16.39z M6.82,21.97c0.26,0.04,0.6,0.05,1.05,0.05c1.27,0,2.4-0.54,2.4-2.03c0-1.4-1.09-1.98-2.46-1.98
11
+ H6.82V21.97z"/>
12
+ <path class="st0" d="M21.89,23.22c-0.47,0.27-1.5,0.54-2.8,0.54c-3.44,0-5.53-2.41-5.53-6.1c0-4,2.48-6.41,5.79-6.41
13
+ c1.3,0,2.24,0.31,2.64,0.54l-0.43,1.76c-0.51-0.25-1.22-0.47-2.12-0.47c-2.2,0-3.8,1.55-3.8,4.47c0,2.66,1.4,4.38,3.78,4.38
14
+ c0.8,0,1.64-0.18,2.16-0.45L21.89,23.22z"/>
15
+ <path class="st0" d="M23.53,21.16c0.64,0.41,1.61,0.77,2.62,0.77c1.27,0,1.98-0.67,1.98-1.66c0-0.92-0.55-1.46-1.93-2.02
16
+ c-1.79-0.72-2.93-1.78-2.93-3.53c0-1.98,1.48-3.49,3.83-3.49c1.17,0,2.04,0.29,2.61,0.61l-0.48,1.78c-0.39-0.23-1.14-0.58-2.16-0.58
17
+ c-1.25,0-1.8,0.76-1.8,1.46c0,0.94,0.63,1.37,2.07,2c1.88,0.79,2.8,1.85,2.8,3.6c0,1.94-1.32,3.64-4.12,3.64
18
+ c-1.14,0-2.33-0.36-2.93-0.76L23.53,21.16z"/>
19
+ </svg>
20
+ `
21
+
22
+ export const BCS = {
23
+ name: 'BCS',
24
+ description: 'The object groups composing the BCS system',
25
+ icon,
26
+ templates: []
27
+ }
@@ -0,0 +1,25 @@
1
+ const icon = `
2
+ <svg version="1.1" id="Layer_2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
3
+ viewBox="0 0 35 35" style="enable-background:new 0 0 35 35;" xml:space="preserve">
4
+ <style type="text/css">
5
+ .st0{fill:{{strokeColor}};}
6
+ </style>
7
+ <path class="st0" d="M13.02,23.22c-0.47,0.27-1.5,0.54-2.8,0.54c-3.44,0-5.53-2.41-5.53-6.1c0-4,2.48-6.41,5.79-6.41
8
+ c1.3,0,2.24,0.31,2.64,0.54l-0.43,1.76c-0.51-0.25-1.22-0.47-2.12-0.47c-2.2,0-3.8,1.55-3.8,4.47c0,2.66,1.4,4.38,3.78,4.38
9
+ c0.8,0,1.64-0.18,2.16-0.45L13.02,23.22z"/>
10
+ <path class="st0" d="M22.06,23.22c-0.47,0.27-1.5,0.54-2.8,0.54c-3.44,0-5.53-2.41-5.53-6.1c0-4,2.48-6.41,5.79-6.41
11
+ c1.3,0,2.24,0.31,2.64,0.54l-0.43,1.76c-0.51-0.25-1.22-0.47-2.12-0.47c-2.2,0-3.8,1.55-3.8,4.47c0,2.66,1.4,4.38,3.78,4.38
12
+ c0.8,0,1.64-0.18,2.16-0.45L22.06,23.22z"/>
13
+ <path class="st0" d="M23.7,21.16c0.64,0.41,1.61,0.77,2.62,0.77c1.27,0,1.98-0.67,1.98-1.66c0-0.92-0.55-1.46-1.93-2.02
14
+ c-1.79-0.72-2.93-1.78-2.93-3.53c0-1.98,1.48-3.49,3.83-3.49c1.17,0,2.04,0.29,2.61,0.61l-0.48,1.78c-0.39-0.23-1.14-0.58-2.16-0.58
15
+ c-1.25,0-1.8,0.76-1.8,1.46c0,0.94,0.63,1.37,2.07,2c1.88,0.79,2.8,1.85,2.8,3.6c0,1.94-1.32,3.64-4.12,3.64
16
+ c-1.14,0-2.33-0.36-2.93-0.76L23.7,21.16z"/>
17
+ </svg>
18
+ `
19
+
20
+ export const CCS = {
21
+ name: 'CCS',
22
+ description: 'The object groups composing the CCS system',
23
+ icon,
24
+ templates: []
25
+ }
@@ -0,0 +1,23 @@
1
+ const icon = `
2
+ <svg version="1.1" id="Layer_2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
3
+ viewBox="0 0 35 35" style="enable-background:new 0 0 35 35;" xml:space="preserve">
4
+ <style type="text/css">
5
+ .st0{fill:{{strokeColor}};}
6
+ </style>
7
+ <path class="st0" d="M11.41,18.19H7.33v3.57h4.57v1.82H5.35V11.44h6.3v1.82H7.33v3.13h4.08V18.19z"/>
8
+ <path class="st0" d="M21.4,23.22c-0.47,0.27-1.5,0.54-2.8,0.54c-3.44,0-5.53-2.41-5.53-6.1c0-4,2.48-6.41,5.79-6.41
9
+ c1.3,0,2.24,0.31,2.64,0.54l-0.43,1.76c-0.51-0.25-1.22-0.47-2.12-0.47c-2.2,0-3.8,1.55-3.8,4.47c0,2.66,1.4,4.38,3.78,4.38
10
+ c0.8,0,1.64-0.18,2.16-0.45L21.4,23.22z"/>
11
+ <path class="st0" d="M23.04,21.16c0.64,0.41,1.61,0.77,2.62,0.77c1.27,0,1.98-0.67,1.98-1.66c0-0.92-0.55-1.46-1.93-2.02
12
+ c-1.79-0.72-2.93-1.78-2.93-3.53c0-1.98,1.48-3.49,3.83-3.49c1.17,0,2.04,0.29,2.61,0.61l-0.48,1.78c-0.39-0.23-1.14-0.58-2.16-0.58
13
+ c-1.25,0-1.8,0.76-1.8,1.46c0,0.94,0.63,1.37,2.07,2c1.88,0.79,2.8,1.85,2.8,3.6c0,1.94-1.32,3.64-4.12,3.64
14
+ c-1.14,0-2.33-0.36-2.93-0.76L23.04,21.16z"/>
15
+ </svg>
16
+ `
17
+
18
+ export const ECS = {
19
+ name: 'ECS',
20
+ description: 'The object groups composing the ECS system',
21
+ icon,
22
+ templates: []
23
+ }
@@ -0,0 +1,25 @@
1
+ const icon = `
2
+ <svg version="1.1" id="Layer_2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
3
+ viewBox="0 0 35 35" style="enable-background:new 0 0 35 35;" xml:space="preserve">
4
+ <style type="text/css">
5
+ .st0{fill:{{strokeColor}};}
6
+ </style>
7
+ <path class="st0" d="M13.73,17.37c0,4.07-2.2,6.39-5.19,6.39c-3.06,0-4.99-2.61-4.99-6.18c0-3.73,2.09-6.36,5.15-6.36
8
+ C11.86,11.23,13.73,13.92,13.73,17.37z M5.64,17.55c0,2.47,1.11,4.43,3.01,4.43c1.91,0,2.99-1.98,2.99-4.52
9
+ c0-2.29-1.01-4.45-2.99-4.45C6.68,13.02,5.64,15.05,5.64,17.55z"/>
10
+ <path class="st0" d="M23.2,23.21c-0.47,0.27-1.5,0.54-2.8,0.54c-3.44,0-5.53-2.41-5.53-6.1c0-4,2.48-6.41,5.79-6.41
11
+ c1.3,0,2.24,0.31,2.64,0.54l-0.43,1.76c-0.51-0.25-1.22-0.47-2.12-0.47c-2.2,0-3.8,1.55-3.8,4.47c0,2.66,1.4,4.38,3.78,4.38
12
+ c0.8,0,1.64-0.18,2.16-0.45L23.2,23.21z"/>
13
+ <path class="st0" d="M24.84,21.16c0.64,0.41,1.61,0.77,2.62,0.77c1.27,0,1.98-0.67,1.98-1.66c0-0.92-0.55-1.46-1.93-2.02
14
+ c-1.79-0.72-2.93-1.78-2.93-3.53c0-1.98,1.48-3.49,3.83-3.49c1.17,0,2.04,0.29,2.61,0.61l-0.48,1.78c-0.39-0.23-1.14-0.58-2.16-0.58
15
+ c-1.25,0-1.8,0.76-1.8,1.46c0,0.94,0.63,1.37,2.07,2c1.88,0.79,2.8,1.85,2.8,3.6c0,1.94-1.32,3.64-4.12,3.64
16
+ c-1.14,0-2.33-0.36-2.93-0.76L24.84,21.16z"/>
17
+ </svg>
18
+ `
19
+
20
+ export const OCS = {
21
+ name: 'OCS',
22
+ description: 'The object groups composing the OCS system',
23
+ icon,
24
+ templates: []
25
+ }
@@ -0,0 +1,28 @@
1
+ const icon = `
2
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
3
+ viewBox="0 0 35 35" style="enable-background:new 0 0 35 35;" xml:space="preserve">
4
+ <style type="text/css">
5
+ .st0{fill:none;stroke:{{strokeColor}};stroke-width:2;stroke-linecap:round;stroke-miterlimit:10;}
6
+ .st1{fill:{{strokeColor}}}
7
+ .st2{fill:none;stroke:{{strokeColor}};stroke-miterlimit:10;}
8
+ </style>
9
+ <path class="st0" d="M26.17,27.87H8.74c-2.36,0-4.29-1.93-4.29-4.29V12.16c0-2.36,1.93-4.29,4.29-4.29h17.43
10
+ c2.36,0,4.29,1.93,4.29,4.29v11.43C30.46,25.94,28.53,27.87,26.17,27.87z"/>
11
+ <path class="st0" d="M26.46,27.87h-18c-2.2,0-4-1.8-4-4v0c0-2.2,1.8-4,4-4h18c2.2,0,4,1.8,4,4v0
12
+ C30.46,26.07,28.66,27.87,26.46,27.87z"/>
13
+ <circle class="st1" cx="10.29" cy="24.06" r="1.5"/>
14
+ <circle class="st1" cx="17.64" cy="24.06" r="1.5"/>
15
+ <circle class="st1" cx="24.99" cy="24.06" r="1.5"/>
16
+ <line class="st2" x1="8.61" y1="7.87" x2="8.61" y2="19.87"/>
17
+ <line class="st2" x1="14.57" y1="7.87" x2="14.57" y2="19.87"/>
18
+ <line class="st2" x1="20.53" y1="7.87" x2="20.53" y2="19.87"/>
19
+ <line class="st2" x1="26.49" y1="7.87" x2="26.49" y2="19.87"/>
20
+ </svg>
21
+ `
22
+
23
+ export const mcsPath = {
24
+ name: 'mcsPath',
25
+ description: 'a group of various mcs-paths',
26
+ icon,
27
+ templates: []
28
+ }
@@ -0,0 +1,26 @@
1
+ const icon = `
2
+ <svg version="1.1" id="Layer_2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
3
+ viewBox="0 0 35 35" style="enable-background:new 0 0 35 35;" xml:space="preserve">
4
+ <style type="text/css">
5
+ .st0{fill:{{strokeColor}};}
6
+ </style>
7
+ <path class="st0" d="M5.51,21.16c0.64,0.41,1.61,0.77,2.62,0.77c1.27,0,1.98-0.67,1.98-1.66c0-0.92-0.55-1.46-1.93-2.02
8
+ c-1.79-0.72-2.93-1.78-2.93-3.53c0-1.98,1.48-3.49,3.83-3.49c1.17,0,2.04,0.29,2.61,0.61l-0.48,1.78c-0.39-0.23-1.14-0.58-2.16-0.58
9
+ c-1.25,0-1.8,0.76-1.8,1.46c0,0.94,0.63,1.37,2.07,2c1.88,0.79,2.8,1.85,2.8,3.6c0,1.94-1.32,3.64-4.12,3.64
10
+ c-1.14,0-2.33-0.36-2.93-0.76L5.51,21.16z"/>
11
+ <path class="st0" d="M21.67,23.22c-0.47,0.27-1.5,0.54-2.8,0.54c-3.44,0-5.53-2.41-5.53-6.1c0-4,2.48-6.41,5.79-6.41
12
+ c1.3,0,2.24,0.31,2.64,0.54l-0.43,1.76c-0.51-0.25-1.22-0.47-2.12-0.47c-2.2,0-3.8,1.55-3.8,4.47c0,2.66,1.4,4.38,3.78,4.38
13
+ c0.8,0,1.64-0.18,2.16-0.45L21.67,23.22z"/>
14
+ <path class="st0" d="M23.32,21.16c0.64,0.41,1.61,0.77,2.62,0.77c1.27,0,1.98-0.67,1.98-1.66c0-0.92-0.55-1.46-1.93-2.02
15
+ c-1.79-0.72-2.93-1.78-2.93-3.53c0-1.98,1.48-3.49,3.83-3.49c1.17,0,2.04,0.29,2.61,0.61l-0.48,1.78c-0.39-0.23-1.14-0.58-2.16-0.58
16
+ c-1.25,0-1.8,0.76-1.8,1.46c0,0.94,0.63,1.37,2.07,2c1.88,0.79,2.8,1.85,2.8,3.6c0,1.94-1.32,3.64-4.12,3.64
17
+ c-1.14,0-2.33-0.36-2.93-0.76L23.32,21.16z"/>
18
+ </svg>
19
+ `
20
+
21
+ export const SCS = {
22
+ name: 'SCS',
23
+ description: 'The object groups composing the SCS system',
24
+ icon,
25
+ templates: []
26
+ }