tecscde 0.6.0

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 (237) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +12 -0
  3. data/.rubocop.yml +125 -0
  4. data/.rubocop_todo.yml +188 -0
  5. data/CHANGELOG.md +3 -0
  6. data/Gemfile +6 -0
  7. data/LICENSE +46 -0
  8. data/LICENSE.ja +32 -0
  9. data/README.ja.md +200 -0
  10. data/README.md +35 -0
  11. data/Rakefile +27 -0
  12. data/bin/tecscde +64 -0
  13. data/glade/tecscde-cell-property.glade +205 -0
  14. data/glade/tecscde-celltype-property.glade +172 -0
  15. data/glade/tecscde-celltype.glade +414 -0
  16. data/glade/tecscde-export.glade +161 -0
  17. data/glade/test-cell-plugin.rb +51 -0
  18. data/glade/test-cell-property.rb +35 -0
  19. data/glade/test-export.rb +35 -0
  20. data/glade/test-palette.rb +26 -0
  21. data/lib/tcflow.rb +148 -0
  22. data/lib/tecscde.rb +65 -0
  23. data/lib/tecscde/NewCell.png +0 -0
  24. data/lib/tecscde/SelectArrow.png +0 -0
  25. data/lib/tecscde/attr_tree_view.rb +253 -0
  26. data/lib/tecscde/cell_plugin_dialog.glade +294 -0
  27. data/lib/tecscde/cell_plugin_dialog.rb +89 -0
  28. data/lib/tecscde/celltype_tree_view.rb +105 -0
  29. data/lib/tecscde/change_set_control.rb +35 -0
  30. data/lib/tecscde/change_set_control/change_set.rb +32 -0
  31. data/lib/tecscde/change_set_control/change_set_manager.rb +62 -0
  32. data/lib/tecscde/command.rb +35 -0
  33. data/lib/tecscde/control.rb +491 -0
  34. data/lib/tecscde/highlighted_objects.rb +180 -0
  35. data/lib/tecscde/logger.rb +74 -0
  36. data/lib/tecscde/main_view_and_model.rb +80 -0
  37. data/lib/tecscde/palette.glade +553 -0
  38. data/lib/tecscde/palette.rb +174 -0
  39. data/lib/tecscde/preferences.glade +117 -0
  40. data/lib/tecscde/preferences.rb +44 -0
  41. data/lib/tecscde/tecs_model.rb +1137 -0
  42. data/lib/tecscde/tecs_model/hbar.rb +68 -0
  43. data/lib/tecscde/tecs_model/tm_c_port.rb +122 -0
  44. data/lib/tecscde/tecs_model/tm_c_port_array.rb +98 -0
  45. data/lib/tecscde/tecs_model/tm_cell.rb +496 -0
  46. data/lib/tecscde/tecs_model/tm_e_port.rb +126 -0
  47. data/lib/tecscde/tecs_model/tm_e_port_array.rb +78 -0
  48. data/lib/tecscde/tecs_model/tm_join.rb +293 -0
  49. data/lib/tecscde/tecs_model/tm_join_bar.rb +146 -0
  50. data/lib/tecscde/tecs_model/tm_port.rb +238 -0
  51. data/lib/tecscde/tecs_model/tm_port_array.rb +246 -0
  52. data/lib/tecscde/tecs_model/tm_region.rb +107 -0
  53. data/lib/tecscde/tecs_model/tm_uneditable.rb +68 -0
  54. data/lib/tecscde/tecs_model/vbar.rb +68 -0
  55. data/lib/tecscde/templates/_cell_info.cde.erb +15 -0
  56. data/lib/tecscde/templates/_join_info.cde.erb +28 -0
  57. data/lib/tecscde/templates/main.cde.erb +49 -0
  58. data/lib/tecscde/tm_object.rb +91 -0
  59. data/lib/tecscde/version.rb +4 -0
  60. data/lib/tecscde/view.rb +58 -0
  61. data/lib/tecscde/view/cairo_matrix.rb +90 -0
  62. data/lib/tecscde/view/canvas.rb +59 -0
  63. data/lib/tecscde/view/constants.rb +114 -0
  64. data/lib/tecscde/view/main_view.rb +1245 -0
  65. data/lib/tecsflow.rb +475 -0
  66. data/lib/tecsflow/C_parser.tab.rb +2471 -0
  67. data/lib/tecsflow/C_parser.y.rb +1087 -0
  68. data/lib/tecsflow/classes.rb +421 -0
  69. data/lib/tecsgen.rb +581 -0
  70. data/lib/tecsgen/core/C_parser.tab.rb +2477 -0
  71. data/lib/tecsgen/core/C_parser.y +1032 -0
  72. data/lib/tecsgen/core/bnf-deb.tab.rb +5193 -0
  73. data/lib/tecsgen/core/bnf.tab.rb +5193 -0
  74. data/lib/tecsgen/core/bnf.y +2211 -0
  75. data/lib/tecsgen/core/componentobj.rb +7901 -0
  76. data/lib/tecsgen/core/ctypes.rb +226 -0
  77. data/lib/tecsgen/core/expression.rb +1031 -0
  78. data/lib/tecsgen/core/gen_xml.rb +374 -0
  79. data/lib/tecsgen/core/generate.rb +5206 -0
  80. data/lib/tecsgen/core/location.rb +116 -0
  81. data/lib/tecsgen/core/messages.rb +101 -0
  82. data/lib/tecsgen/core/optimize.rb +456 -0
  83. data/lib/tecsgen/core/plugin.rb +332 -0
  84. data/lib/tecsgen/core/pluginModule.rb +165 -0
  85. data/lib/tecsgen/core/syntaxobj.rb +1234 -0
  86. data/lib/tecsgen/core/tecs_lang.rb +306 -0
  87. data/lib/tecsgen/core/tecsgen.rb +453 -0
  88. data/lib/tecsgen/core/tecsinfo.rb +860 -0
  89. data/lib/tecsgen/core/tool_info.rb +258 -0
  90. data/lib/tecsgen/core/types.rb +1632 -0
  91. data/lib/tecsgen/core/unjoin_plugin.rb +218 -0
  92. data/lib/tecsgen/core/value.rb +650 -0
  93. data/lib/tecsgen/messages/messages_console_en_US.rb +1171 -0
  94. data/lib/tecsgen/messages/messages_console_ja_JP.rb +1171 -0
  95. data/lib/tecsgen/messages/messages_file_en_US.rb +334 -0
  96. data/lib/tecsgen/messages/messages_file_ja_JP.rb +163 -0
  97. data/lib/tecsgen/plugin/ATK1AlarmPlugin.rb +196 -0
  98. data/lib/tecsgen/plugin/ATK1DelayTaskPlugin.rb +106 -0
  99. data/lib/tecsgen/plugin/ATK1EventPlugin.rb +147 -0
  100. data/lib/tecsgen/plugin/ATK1ISRPlugin.rb +174 -0
  101. data/lib/tecsgen/plugin/ATK1KernelPlugin.rb +287 -0
  102. data/lib/tecsgen/plugin/ATK1ResourcePlugin.rb +124 -0
  103. data/lib/tecsgen/plugin/ATK1TaskPlugin.rb +220 -0
  104. data/lib/tecsgen/plugin/C2TECSBridgePlugin.rb +210 -0
  105. data/lib/tecsgen/plugin/CellPlugin.rb +61 -0
  106. data/lib/tecsgen/plugin/CelltypePlugin.rb +72 -0
  107. data/lib/tecsgen/plugin/CompositePlugin.rb +66 -0
  108. data/lib/tecsgen/plugin/DomainPlugin.rb +89 -0
  109. data/lib/tecsgen/plugin/HRP2AlarmHandlerPlugin.rb +76 -0
  110. data/lib/tecsgen/plugin/HRP2Cache.rb +1 -0
  111. data/lib/tecsgen/plugin/HRP2CyclicHandlerPlugin.rb +75 -0
  112. data/lib/tecsgen/plugin/HRP2DataqueuePlugin.rb +68 -0
  113. data/lib/tecsgen/plugin/HRP2EventflagPlugin.rb +68 -0
  114. data/lib/tecsgen/plugin/HRP2FixedSizeMemoryPoolPlugin.rb +68 -0
  115. data/lib/tecsgen/plugin/HRP2HandlerPlugin.rb +117 -0
  116. data/lib/tecsgen/plugin/HRP2KernelObjectPlugin.rb +372 -0
  117. data/lib/tecsgen/plugin/HRP2ObjectPlugin.rb +94 -0
  118. data/lib/tecsgen/plugin/HRP2Plugin.rb +140 -0
  119. data/lib/tecsgen/plugin/HRP2PostHook.rb +111 -0
  120. data/lib/tecsgen/plugin/HRP2PriorityDataqueuePlugin.rb +66 -0
  121. data/lib/tecsgen/plugin/HRP2RPCPlugin.rb +319 -0
  122. data/lib/tecsgen/plugin/HRP2SVCPlugin.rb +473 -0
  123. data/lib/tecsgen/plugin/HRP2SemaphorePlugin.rb +67 -0
  124. data/lib/tecsgen/plugin/HRP2TaskPlugin.rb +200 -0
  125. data/lib/tecsgen/plugin/HRPHandlerPlugin.rb +125 -0
  126. data/lib/tecsgen/plugin/HRPKernelObjectManager.rb +72 -0
  127. data/lib/tecsgen/plugin/HRPKernelObjectPlugin.rb +333 -0
  128. data/lib/tecsgen/plugin/HRPObjectPlugin.rb +93 -0
  129. data/lib/tecsgen/plugin/HRPPlugin.rb +356 -0
  130. data/lib/tecsgen/plugin/HRPRPCPlugin.rb +407 -0
  131. data/lib/tecsgen/plugin/HRPSVCPlugin.rb +859 -0
  132. data/lib/tecsgen/plugin/HRPTaskPlugin.rb +107 -0
  133. data/lib/tecsgen/plugin/Mruby2CBridgePlugin.rb +86 -0
  134. data/lib/tecsgen/plugin/MrubyBridgeCellPlugin.rb +264 -0
  135. data/lib/tecsgen/plugin/MrubyBridgeCelltypePlugin.rb +293 -0
  136. data/lib/tecsgen/plugin/MrubyBridgeCompositePlugin.rb +49 -0
  137. data/lib/tecsgen/plugin/MrubyBridgePlugin.rb +67 -0
  138. data/lib/tecsgen/plugin/MrubyBridgeSignaturePlugin.rb +1307 -0
  139. data/lib/tecsgen/plugin/MrubyInfoBridgePlugin.rb +14 -0
  140. data/lib/tecsgen/plugin/MrubyInfoBridgeSignaturePlugin.rb +994 -0
  141. data/lib/tecsgen/plugin/MultiPlugin.rb +57 -0
  142. data/lib/tecsgen/plugin/NotifierPlugin.rb +1217 -0
  143. data/lib/tecsgen/plugin/OpaqueMarshalerPlugin.rb +81 -0
  144. data/lib/tecsgen/plugin/OpaqueRPCPlugin.rb +323 -0
  145. data/lib/tecsgen/plugin/RPCPlugin.rb +266 -0
  146. data/lib/tecsgen/plugin/RepeatCellPlugin.rb +166 -0
  147. data/lib/tecsgen/plugin/RepeatJoinPlugin.rb +130 -0
  148. data/lib/tecsgen/plugin/SharedOpaqueRPCPlugin.rb +357 -0
  149. data/lib/tecsgen/plugin/SharedRPCPlugin.rb +329 -0
  150. data/lib/tecsgen/plugin/SignaturePlugin.rb +77 -0
  151. data/lib/tecsgen/plugin/TECS2CBridgePlugin.rb +178 -0
  152. data/lib/tecsgen/plugin/TECSInfoPlugin.rb +280 -0
  153. data/lib/tecsgen/plugin/ThroughPlugin.rb +333 -0
  154. data/lib/tecsgen/plugin/TracePlugin.rb +484 -0
  155. data/lib/tecsgen/plugin/lib/GenHRP2Marshaler.rb +761 -0
  156. data/lib/tecsgen/plugin/lib/GenOpaqueMarshaler.rb +1107 -0
  157. data/lib/tecsgen/plugin/lib/GenParamCopy.rb +365 -0
  158. data/lib/tecsgen/plugin/lib/GenTransparentMarshaler.rb +683 -0
  159. data/lib/tecsgen/plugin/lib/MrubyBridgeCelltypePluginModule.rb +283 -0
  160. data/lib/tecsgen/plugin/lib/MrubyBridgeSignaturePluginModule.rb +277 -0
  161. data/lib/tecsgen/version.rb +6 -0
  162. data/samples/FigureSamples/active/active.cde +104 -0
  163. data/samples/FigureSamples/active/active.cdl +20 -0
  164. data/samples/FigureSamples/active/active.pdf +0 -0
  165. data/samples/FigureSamples/active/active.png +0 -0
  166. data/samples/FigureSamples/active/gen/tmp_C_src.c +36 -0
  167. data/samples/FigureSamples/active/gen/tmp_cygwin_tecs.h +1908 -0
  168. data/samples/FigureSamples/active/gen/tmp_plugin_post_code.cdl +0 -0
  169. data/samples/FigureSamples/allocator/allocator-internal.png +0 -0
  170. data/samples/FigureSamples/allocator/allocator.cde +171 -0
  171. data/samples/FigureSamples/allocator/allocator.cdl +58 -0
  172. data/samples/FigureSamples/allocator/allocator.png +0 -0
  173. data/samples/FigureSamples/basic/Makefile +87 -0
  174. data/samples/FigureSamples/basic/SimpleSample-trace.cdl +50 -0
  175. data/samples/FigureSamples/basic/SimpleSample.cde +91 -0
  176. data/samples/FigureSamples/basic/SimpleSample.cdl +47 -0
  177. data/samples/FigureSamples/basic/basic.cde +93 -0
  178. data/samples/FigureSamples/basic/basic.cdl +46 -0
  179. data/samples/FigureSamples/basic/basic.png +0 -0
  180. data/samples/FigureSamples/callback/callback.cde +130 -0
  181. data/samples/FigureSamples/callback/callback.cdl +29 -0
  182. data/samples/FigureSamples/callback/callback.png +0 -0
  183. data/samples/FigureSamples/carray/carray.cde +144 -0
  184. data/samples/FigureSamples/carray/carray.cdl +38 -0
  185. data/samples/FigureSamples/carray/carray.png +0 -0
  186. data/samples/FigureSamples/cearray/cearray.cde +314 -0
  187. data/samples/FigureSamples/cearray/cearray.cdl +60 -0
  188. data/samples/FigureSamples/cearray/cearray.png +0 -0
  189. data/samples/FigureSamples/composite/composite-internal.png +0 -0
  190. data/samples/FigureSamples/composite/composite.cde +216 -0
  191. data/samples/FigureSamples/composite/composite.cdl +95 -0
  192. data/samples/FigureSamples/composite/composite.png +0 -0
  193. data/samples/FigureSamples/earray/earray.cde +142 -0
  194. data/samples/FigureSamples/earray/earray.cdl +38 -0
  195. data/samples/FigureSamples/earray/earray.png +0 -0
  196. data/samples/FigureSamples/join/Makefile +87 -0
  197. data/samples/FigureSamples/join/join.cde +132 -0
  198. data/samples/FigureSamples/join/join.cdl +40 -0
  199. data/samples/FigureSamples/join/join.png +0 -0
  200. data/samples/FigureSamples/relay/Makefile +99 -0
  201. data/samples/FigureSamples/relay/relay-internal.png +0 -0
  202. data/samples/FigureSamples/relay/relay.cde +284 -0
  203. data/samples/FigureSamples/relay/relay.cdl +52 -0
  204. data/samples/FigureSamples/relay/relay.png +0 -0
  205. data/samples/FigureSamples/rpc/Makefile +123 -0
  206. data/samples/FigureSamples/rpc/rpc-expand.png +0 -0
  207. data/samples/FigureSamples/rpc/rpc.cde +245 -0
  208. data/samples/FigureSamples/rpc/rpc.png +0 -0
  209. data/samples/FigureSamples/rpc/rpc_sample.cdl +53 -0
  210. data/samples/SimpleSample/Makefile +25 -0
  211. data/samples/SimpleSample/SimpleSample/Makefile +86 -0
  212. data/samples/SimpleSample/SimpleSample/Makefile-trace +91 -0
  213. data/samples/SimpleSample/SimpleSample/README.txt +106 -0
  214. data/samples/SimpleSample/SimpleSample/SimpleSample-trace.cdl +50 -0
  215. data/samples/SimpleSample/SimpleSample/SimpleSample.cdl +45 -0
  216. data/samples/SimpleSample/SimpleSample/src/tSample.c +77 -0
  217. data/samples/SimpleSample/SimpleSample/src/tSimple.c +48 -0
  218. data/samples/SimpleSample/SimpleSample/src/tecs-types.h +27 -0
  219. data/samples/SimpleSample/SimpleSampleOpaqueRPC/Makefile +51 -0
  220. data/samples/SimpleSample/SimpleSampleOpaqueRPC/Makefile-trace +91 -0
  221. data/samples/SimpleSample/SimpleSampleOpaqueRPC/README.txt +106 -0
  222. data/samples/SimpleSample/SimpleSampleOpaqueRPC/SimpleSample-trace.cdl +80 -0
  223. data/samples/SimpleSample/SimpleSampleOpaqueRPC/SimpleSample.cdl +77 -0
  224. data/samples/SimpleSample/SimpleSampleOpaqueRPC/rSample/Makefile +112 -0
  225. data/samples/SimpleSample/SimpleSampleOpaqueRPC/rSimple/Makefile +109 -0
  226. data/samples/SimpleSample/SimpleSampleOpaqueRPC/src/tSample.c +80 -0
  227. data/samples/SimpleSample/SimpleSampleOpaqueRPC/src/tSimple.c +47 -0
  228. data/samples/SimpleSample/SimpleSampleOpaqueRPC/src/tTaskMain.c +66 -0
  229. data/samples/SimpleSample/SimpleSampleOpaqueRPC/src/tecs-types.h +27 -0
  230. data/samples/SimpleSample/SimpleSampleTransparentRPC/Makefile +125 -0
  231. data/samples/SimpleSample/SimpleSampleTransparentRPC/Makefile-trace +130 -0
  232. data/samples/SimpleSample/SimpleSampleTransparentRPC/SimpleSample-trace.cdl +54 -0
  233. data/samples/SimpleSample/SimpleSampleTransparentRPC/SimpleSample.cdl +53 -0
  234. data/samples/SimpleSample/SimpleSampleTransparentRPC/src/tSample.c +80 -0
  235. data/samples/SimpleSample/SimpleSampleTransparentRPC/src/tSimple.c +54 -0
  236. data/tecscde.gemspec +41 -0
  237. metadata +353 -0
@@ -0,0 +1,107 @@
1
+ #
2
+ # TECSCDE - TECS Component Diagram Editor
3
+ #
4
+ # Copyright (C) 2014-2019 by TOPPERS Project
5
+ #
6
+ # The above copyright holders grant permission gratis to use,
7
+ # duplicate, modify, or redistribute (hereafter called use) this
8
+ # software (including the one made by modifying this software),
9
+ # provided that the following four conditions (1) through (4) are
10
+ # satisfied.
11
+ #
12
+ # (1) When this software is used in the form of source code, the above
13
+ # copyright notice, this use conditions, and the disclaimer shown
14
+ # below must be retained in the source code without modification.
15
+ #
16
+ # (2) When this software is redistributed in the forms usable for the
17
+ # development of other software, such as in library form, the above
18
+ # copyright notice, this use conditions, and the disclaimer shown
19
+ # below must be shown without modification in the document provided
20
+ # with the redistributed software, such as the user manual.
21
+ #
22
+ # (3) When this software is redistributed in the forms unusable for the
23
+ # development of other software, such as the case when the software
24
+ # is embedded in a piece of equipment, either of the following two
25
+ # conditions must be satisfied:
26
+ #
27
+ # (a) The above copyright notice, this use conditions, and the
28
+ # disclaimer shown below must be shown without modification in
29
+ # the document provided with the redistributed software, such as
30
+ # the user manual.
31
+ #
32
+ # (b) How the software is to be redistributed must be reported to the
33
+ # TOPPERS Project according to the procedure described
34
+ # separately.
35
+ #
36
+ # (4) The above copyright holders and the TOPPERS Project are exempt
37
+ # from responsibility for any type of damage directly or indirectly
38
+ # caused from the use of this software and are indemnified by any
39
+ # users or end users of this software from any and all causes of
40
+ # action whatsoever.
41
+ #
42
+ # THIS SOFTWARE IS PROVIDED "AS IS." THE ABOVE COPYRIGHT HOLDERS AND
43
+ # THE TOPPERS PROJECT DISCLAIM ANY EXPRESS OR IMPLIED WARRANTIES,
44
+ # INCLUDING, BUT NOT LIMITED TO, ITS APPLICABILITY TO A PARTICULAR
45
+ # PURPOSE. IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS AND THE
46
+ # TOPPERS PROJECT BE LIABLE FOR ANY TYPE OF DAMAGE DIRECTLY OR
47
+ # INDIRECTLY CAUSED FROM THE USE OF THIS SOFTWARE.
48
+ #
49
+
50
+ require "tecscde/tm_object"
51
+
52
+ module TECSCDE
53
+ class TECSModel
54
+ class TmRegion < TECSCDE::TmObject
55
+ # @sub_region::{name=>TmRegion}
56
+
57
+ #=== TmRegion#initialize
58
+ # namespace_path::NamespacePath
59
+ # owner::TmRegion (parent) or TECSModel (root region)
60
+ def initialize(namespace_path, owner)
61
+ @namespace_path = namespace_path
62
+ @owner = owner
63
+
64
+ # region's property
65
+ @sub_region = {}
66
+ @cell_list = {}
67
+ modified {}
68
+ end
69
+
70
+ def get_namespace_path
71
+ @namespace_path
72
+ end
73
+
74
+ def get_color
75
+ end
76
+
77
+ def delete_cell(cell)
78
+ @owner.delete_cell(cell)
79
+ end
80
+
81
+ def rename_cell(cell, name)
82
+ @owner.rename_cell(cell, name)
83
+ end
84
+
85
+ def get_region(name)
86
+ if @sub_region[name].nil?
87
+ modified do
88
+ parent = self
89
+ @sub_region[name] = TmRegion.new(@namespace_path.append(name), parent)
90
+ end
91
+ end
92
+ @sub_region[name]
93
+ end
94
+
95
+ #=== TmRegion#clone_for_undo
96
+ def clone_for_undo
97
+ bu = clone
98
+ bu.copy_from(self)
99
+ bu
100
+ end
101
+
102
+ def setup_clone(sub_region)
103
+ @sub_region = sub_region.dup
104
+ end
105
+ end
106
+ end
107
+ end
@@ -0,0 +1,68 @@
1
+ #
2
+ # TECSCDE - TECS Component Diagram Editor
3
+ #
4
+ # Copyright (C) 2014-2019 by TOPPERS Project
5
+ #
6
+ # The above copyright holders grant permission gratis to use,
7
+ # duplicate, modify, or redistribute (hereafter called use) this
8
+ # software (including the one made by modifying this software),
9
+ # provided that the following four conditions (1) through (4) are
10
+ # satisfied.
11
+ #
12
+ # (1) When this software is used in the form of source code, the above
13
+ # copyright notice, this use conditions, and the disclaimer shown
14
+ # below must be retained in the source code without modification.
15
+ #
16
+ # (2) When this software is redistributed in the forms usable for the
17
+ # development of other software, such as in library form, the above
18
+ # copyright notice, this use conditions, and the disclaimer shown
19
+ # below must be shown without modification in the document provided
20
+ # with the redistributed software, such as the user manual.
21
+ #
22
+ # (3) When this software is redistributed in the forms unusable for the
23
+ # development of other software, such as the case when the software
24
+ # is embedded in a piece of equipment, either of the following two
25
+ # conditions must be satisfied:
26
+ #
27
+ # (a) The above copyright notice, this use conditions, and the
28
+ # disclaimer shown below must be shown without modification in
29
+ # the document provided with the redistributed software, such as
30
+ # the user manual.
31
+ #
32
+ # (b) How the software is to be redistributed must be reported to the
33
+ # TOPPERS Project according to the procedure described
34
+ # separately.
35
+ #
36
+ # (4) The above copyright holders and the TOPPERS Project are exempt
37
+ # from responsibility for any type of damage directly or indirectly
38
+ # caused from the use of this software and are indemnified by any
39
+ # users or end users of this software from any and all causes of
40
+ # action whatsoever.
41
+ #
42
+ # THIS SOFTWARE IS PROVIDED "AS IS." THE ABOVE COPYRIGHT HOLDERS AND
43
+ # THE TOPPERS PROJECT DISCLAIM ANY EXPRESS OR IMPLIED WARRANTIES,
44
+ # INCLUDING, BUT NOT LIMITED TO, ITS APPLICABILITY TO A PARTICULAR
45
+ # PURPOSE. IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS AND THE
46
+ # TOPPERS PROJECT BE LIABLE FOR ANY TYPE OF DAMAGE DIRECTLY OR
47
+ # INDIRECTLY CAUSED FROM THE USE OF THIS SOFTWARE.
48
+ #
49
+
50
+ module TECSCDE
51
+ class TECSModel
52
+ # class must be descendant of Node
53
+ module TmUneditable
54
+ # @editable::Bool | Nil: objects from .cdl cannot be editable (used by TmJoin, TmCell)
55
+
56
+ #=== TmObject#set_editable
57
+ # locale:: see Node in syntaxobj.rb
58
+ def set_editable(locale)
59
+ @editable = locale[0] == model.file_editing
60
+ end
61
+
62
+ #=== TmObject#editable? ***
63
+ def editable?
64
+ @editable
65
+ end
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,68 @@
1
+ #
2
+ # TECSCDE - TECS Component Diagram Editor
3
+ #
4
+ # Copyright (C) 2014-2019 by TOPPERS Project
5
+ #
6
+ # The above copyright holders grant permission gratis to use,
7
+ # duplicate, modify, or redistribute (hereafter called use) this
8
+ # software (including the one made by modifying this software),
9
+ # provided that the following four conditions (1) through (4) are
10
+ # satisfied.
11
+ #
12
+ # (1) When this software is used in the form of source code, the above
13
+ # copyright notice, this use conditions, and the disclaimer shown
14
+ # below must be retained in the source code without modification.
15
+ #
16
+ # (2) When this software is redistributed in the forms usable for the
17
+ # development of other software, such as in library form, the above
18
+ # copyright notice, this use conditions, and the disclaimer shown
19
+ # below must be shown without modification in the document provided
20
+ # with the redistributed software, such as the user manual.
21
+ #
22
+ # (3) When this software is redistributed in the forms unusable for the
23
+ # development of other software, such as the case when the software
24
+ # is embedded in a piece of equipment, either of the following two
25
+ # conditions must be satisfied:
26
+ #
27
+ # (a) The above copyright notice, this use conditions, and the
28
+ # disclaimer shown below must be shown without modification in
29
+ # the document provided with the redistributed software, such as
30
+ # the user manual.
31
+ #
32
+ # (b) How the software is to be redistributed must be reported to the
33
+ # TOPPERS Project according to the procedure described
34
+ # separately.
35
+ #
36
+ # (4) The above copyright holders and the TOPPERS Project are exempt
37
+ # from responsibility for any type of damage directly or indirectly
38
+ # caused from the use of this software and are indemnified by any
39
+ # users or end users of this software from any and all causes of
40
+ # action whatsoever.
41
+ #
42
+ # THIS SOFTWARE IS PROVIDED "AS IS." THE ABOVE COPYRIGHT HOLDERS AND
43
+ # THE TOPPERS PROJECT DISCLAIM ANY EXPRESS OR IMPLIED WARRANTIES,
44
+ # INCLUDING, BUT NOT LIMITED TO, ITS APPLICABILITY TO A PARTICULAR
45
+ # PURPOSE. IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS AND THE
46
+ # TOPPERS PROJECT BE LIABLE FOR ANY TYPE OF DAMAGE DIRECTLY OR
47
+ # INDIRECTLY CAUSED FROM THE USE OF THIS SOFTWARE.
48
+ #
49
+
50
+ require "tecscde/tecs_model/tm_join_bar"
51
+
52
+ module TECSCDE
53
+ class TECSModel
54
+ class VBar < TECSCDE::TECSModel::TmJoinBar
55
+ def horizontal?
56
+ false
57
+ end
58
+
59
+ def vertical?
60
+ true
61
+ end
62
+
63
+ def type
64
+ "VBar"
65
+ end
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,15 @@
1
+ <%-
2
+ x, y, width, height = cell.get_geometry
3
+ ports = cell.cports.values + cell.eports.values
4
+ port_locations_lines = JSON.pretty_generate(port_location(ports), indent: " ").lines
5
+ port_locations_json = port_locations_lines.first + port_locations_lines[1..-1].map do |line|
6
+ " " + line
7
+ end.join
8
+ -%>
9
+ { /** cell_list[ <%= index %> ] **/
10
+ "type" : "cell_location",
11
+ "name" : "<%= cell.get_name %>",
12
+ "location" : [ <%= x %>, <%= y %>, <%= width %>, <%= height %> ],
13
+ "region" : "<%= cell.get_region.get_namespace_path %>",
14
+ "port_location" : <%= port_locations_json %>
15
+ }
@@ -0,0 +1,28 @@
1
+ <%-
2
+ cport = join.cport
3
+ eport = join.eport
4
+ bar_list = join.bars.map do |bar|
5
+ {
6
+ type: bar.type,
7
+ position: bar.get_position
8
+ }
9
+ end
10
+ bar_list_lines = JSON.pretty_generate(bar_list, indent: " ").lines
11
+ bar_list_json = bar_list_lines.first + bar_list_lines[1..-1].map do |line|
12
+ " " + line
13
+ end.join
14
+ -%>
15
+ { /** join_list[ <%= index %> ] **/
16
+ "type" : "join_location",
17
+ "call_cell" : "<%= cport.get_cell.get_name %>",
18
+ "call_region" : "<%= cport.get_cell.get_region.get_namespace_path %>",
19
+ "call_port" : "<%= cport.get_name %>",
20
+ <%- if cport.get_subscript -%>
21
+ "call_port_subscript": "<%= cport.get_subscript %>",
22
+ <%- end -%>
23
+ "entry_cell" : "<%= eport.get_cell.get_name %>",
24
+ "entry_region": "<%= eport.get_cell.get_region.get_namespace_path %>",
25
+ "entry_port" : "<%= eport.get_name %>",
26
+ "entry_port_subscript": "<%= eport.get_subscript %>",
27
+ "bar_list": <%= bar_list_json %>
28
+ }
@@ -0,0 +1,49 @@
1
+ __tool_info__ ("tecsgen") <%= JSON.pretty_generate(tecsgen, indent: " ") %>
2
+
3
+ <%- @cell_list.select(&:editable?).each do |cell| -%>
4
+ cell <%= cell.get_celltype.get_namespace_path %> <%= cell.get_name %> {
5
+ <%- cports = cell.cports -%>
6
+ <%- unless cports.empty? -%>
7
+ /*** call ports ***/
8
+ <%- generate_cports_lines(cports).each do |line| -%>
9
+ <%= line %>
10
+ <%- end -%>
11
+ <%- end -%>
12
+ <%- attributes = cell.get_attr_list -%>
13
+ <%- unless attributes.empty? -%>
14
+ /*** attributes ***/
15
+ <%- attributes.keys.sort.each do |key| -%>
16
+ <%= key %> = <%= attributes[key] %>
17
+ <%- end -%>
18
+ <%- end -%>
19
+ };
20
+ <%- end -%>
21
+
22
+ /*************************************************
23
+ * TOOL INFORMATION FOR TECSCDE *
24
+ * This information is used by tecscde *
25
+ * please don't touch if you are not familiar *
26
+ ************************************************/
27
+ __tool_info__ ("tecscde") {
28
+ "paper" : {
29
+ "type" : "paper",
30
+ "size" : "<%= @paper[:size] %>",
31
+ "orientation" : "<%= @paper[:orientation] %>"
32
+ },
33
+ "cell_list" : [
34
+ <%- unless @cell_list.empty? -%>
35
+ <%- @cell_list[0..-2].each_with_index do |cell, index| -%>
36
+ <%= render_partial("_cell_info.cde.erb", index: index, cell: cell).chomp %>,
37
+ <%- end -%>
38
+ <%= render_partial("_cell_info.cde.erb", index: @cell_list.size, cell: @cell_list.last).chomp %>
39
+ <%- end -%>
40
+ ],
41
+ "join_list" : [
42
+ <%- unless @join_list.empty? -%>
43
+ <%- @join_list[0..-2].each do |join| -%>
44
+ <%= render_partial("_join_info.cde.erb", join: join).chomp %>,
45
+ <%- end -%>
46
+ <%= render_partial("_join_info.cde.erb", join: @join_list.last).chomp %>
47
+ <%- end -%>
48
+ ]
49
+ }
@@ -0,0 +1,91 @@
1
+ #
2
+ # TECSCDE - TECS Component Diagram Editor
3
+ #
4
+ # Copyright (C) 2014-2019 by TOPPERS Project
5
+ #
6
+ # The above copyright holders grant permission gratis to use,
7
+ # duplicate, modify, or redistribute (hereafter called use) this
8
+ # software (including the one made by modifying this software),
9
+ # provided that the following four conditions (1) through (4) are
10
+ # satisfied.
11
+ #
12
+ # (1) When this software is used in the form of source code, the above
13
+ # copyright notice, this use conditions, and the disclaimer shown
14
+ # below must be retained in the source code without modification.
15
+ #
16
+ # (2) When this software is redistributed in the forms usable for the
17
+ # development of other software, such as in library form, the above
18
+ # copyright notice, this use conditions, and the disclaimer shown
19
+ # below must be shown without modification in the document provided
20
+ # with the redistributed software, such as the user manual.
21
+ #
22
+ # (3) When this software is redistributed in the forms unusable for the
23
+ # development of other software, such as the case when the software
24
+ # is embedded in a piece of equipment, either of the following two
25
+ # conditions must be satisfied:
26
+ #
27
+ # (a) The above copyright notice, this use conditions, and the
28
+ # disclaimer shown below must be shown without modification in
29
+ # the document provided with the redistributed software, such as
30
+ # the user manual.
31
+ #
32
+ # (b) How the software is to be redistributed must be reported to the
33
+ # TOPPERS Project according to the procedure described
34
+ # separately.
35
+ #
36
+ # (4) The above copyright holders and the TOPPERS Project are exempt
37
+ # from responsibility for any type of damage directly or indirectly
38
+ # caused from the use of this software and are indemnified by any
39
+ # users or end users of this software from any and all causes of
40
+ # action whatsoever.
41
+ #
42
+ # THIS SOFTWARE IS PROVIDED "AS IS." THE ABOVE COPYRIGHT HOLDERS AND
43
+ # THE TOPPERS PROJECT DISCLAIM ANY EXPRESS OR IMPLIED WARRANTIES,
44
+ # INCLUDING, BUT NOT LIMITED TO, ITS APPLICABILITY TO A PARTICULAR
45
+ # PURPOSE. IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS AND THE
46
+ # TOPPERS PROJECT BE LIABLE FOR ANY TYPE OF DAMAGE DIRECTLY OR
47
+ # INDIRECTLY CAUSED FROM THE USE OF THIS SOFTWARE.
48
+ #
49
+
50
+ module TECSCDE
51
+ #== TmObject: base class for TECSModel & its children
52
+ #
53
+ class TmObject
54
+ # @owner::
55
+ # TmRegion => TmRegion, TECSModel(for root region)
56
+ # TmCell => TmRegion
57
+ # TmPort => TmCell | TmCPortArray | TmEPortArray
58
+ # TmJoin => TECSModel
59
+ # TmJoinBar => TmJoin
60
+ # TECSModel => Nil
61
+
62
+ attr_accessor :owner
63
+
64
+ def model
65
+ if @owner
66
+ @owner.model
67
+ else
68
+ if is_a?(TECSModel)
69
+ raise "model: self is not TECSModel: #{self.class}"
70
+ end
71
+ self
72
+ end
73
+ end
74
+
75
+ def modified
76
+ model.add_change_set(self)
77
+ yield
78
+ end
79
+
80
+ def copy_from(tm_object)
81
+ tm_object.instance_variables.each do |iv|
82
+ val = tm_object.instance_variable_get(iv)
83
+ if val.is_a?(Array) || val.is_a?(Hash)
84
+ instance_variable_set(iv, val.dup)
85
+ else
86
+ instance_variable_set(iv, val)
87
+ end
88
+ end
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,4 @@
1
+ module TECSCDE
2
+ VERSION = "0.6.0"
3
+ FORMAT_VERSION = "0.5.0"
4
+ end
@@ -0,0 +1,58 @@
1
+ #
2
+ # TECSCDE - TECS Component Diagram Editor
3
+ #
4
+ # Copyright (C) 2014-2019 by TOPPERS Project
5
+ #
6
+ # The above copyright holders grant permission gratis to use,
7
+ # duplicate, modify, or redistribute (hereafter called use) this
8
+ # software (including the one made by modifying this software),
9
+ # provided that the following four conditions (1) through (4) are
10
+ # satisfied.
11
+ #
12
+ # (1) When this software is used in the form of source code, the above
13
+ # copyright notice, this use conditions, and the disclaimer shown
14
+ # below must be retained in the source code without modification.
15
+ #
16
+ # (2) When this software is redistributed in the forms usable for the
17
+ # development of other software, such as in library form, the above
18
+ # copyright notice, this use conditions, and the disclaimer shown
19
+ # below must be shown without modification in the document provided
20
+ # with the redistributed software, such as the user manual.
21
+ #
22
+ # (3) When this software is redistributed in the forms unusable for the
23
+ # development of other software, such as the case when the software
24
+ # is embedded in a piece of equipment, either of the following two
25
+ # conditions must be satisfied:
26
+ #
27
+ # (a) The above copyright notice, this use conditions, and the
28
+ # disclaimer shown below must be shown without modification in
29
+ # the document provided with the redistributed software, such as
30
+ # the user manual.
31
+ #
32
+ # (b) How the software is to be redistributed must be reported to the
33
+ # TOPPERS Project according to the procedure described
34
+ # separately.
35
+ #
36
+ # (4) The above copyright holders and the TOPPERS Project are exempt
37
+ # from responsibility for any type of damage directly or indirectly
38
+ # caused from the use of this software and are indemnified by any
39
+ # users or end users of this software from any and all causes of
40
+ # action whatsoever.
41
+ #
42
+ # THIS SOFTWARE IS PROVIDED "AS IS." THE ABOVE COPYRIGHT HOLDERS AND
43
+ # THE TOPPERS PROJECT DISCLAIM ANY EXPRESS OR IMPLIED WARRANTIES,
44
+ # INCLUDING, BUT NOT LIMITED TO, ITS APPLICABILITY TO A PARTICULAR
45
+ # PURPOSE. IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS AND THE
46
+ # TOPPERS PROJECT BE LIABLE FOR ANY TYPE OF DAMAGE DIRECTLY OR
47
+ # INDIRECTLY CAUSED FROM THE USE OF THIS SOFTWARE.
48
+ #
49
+
50
+ module TECSCDE
51
+ module View
52
+ end
53
+ end
54
+
55
+ require "tecscde/view/cairo_matrix"
56
+ require "tecscde/view/canvas"
57
+ require "tecscde/view/constants"
58
+ require "tecscde/view/main_view"