Wiki source code of Project Guidelines
Last modified by stu114053 on 2025/01/30 12:17
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | = Project Management = | ||
| 2 | |||
| 3 | The general project **meeting** takes place in the **Railwayroom, Tuesday at 16:00.** | ||
| 4 | |||
| 5 | = Development Environment = | ||
| 6 | |||
| 7 | == KIELER == | ||
| 8 | |||
| 9 | Use the[[ KIELER Nightly Build>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/files/nightly/sccharts/||shape="rect"]]. Keep your version up-to-date. | ||
| 10 | You can update to a new version from within your running installation via **Help > Check for updates**. Thus it is not necessary to download the KIELER archive every time. | ||
| 11 | |||
| 12 | Use UTF-8 as codepage (**especially when using Windows**): | ||
| 13 | |||
| 14 | * General > Workspace | ||
| 15 | ** Text file encoding: UTF-8 | ||
| 16 | |||
| 17 | It may be helpful to configure the following settings to avoid //Resource is out of sync// warnings in Eclipse: | ||
| 18 | |||
| 19 | * General > Workspace | ||
| 20 | ** Refresh using native hooks or polling: Check | ||
| 21 | ** Refresh on access | ||
| 22 | ** Save automatically before build | ||
| 23 | |||
| 24 | = Code Style = | ||
| 25 | |||
| 26 | == General == | ||
| 27 | |||
| 28 | Use an indentation of 2 Spaces: | ||
| 29 | |||
| 30 | * General > Text Editors | ||
| 31 | ** Insert Spaces for Tabs: Check | ||
| 32 | ** Displayed Tab Width: 2 | ||
| 33 | |||
| 34 | == SCT Style == | ||
| 35 | |||
| 36 | Use the following conventions when modeling an SCChart: | ||
| 37 | |||
| 38 | * General order | ||
| 39 | ** inputs first | ||
| 40 | ** outputs second | ||
| 41 | ** internal variables third | ||
| 42 | ** regions and states afterwards | ||
| 43 | * Name all regions if you have at least two (no implicit region, unless there is only one) | ||
| 44 | * Naming | ||
| 45 | ** For semantically relevant names, use lower case with underscores (e.g. //state some_long_state_name//) | ||
| 46 | ** For labels and stuff that is intended to increase readability, use more natural english (e.g. //state some_long_state_name "Wait for orders"//) | ||
| 47 | |||
| 48 | {{code language="sct" title="SCT Code Style" linenumbers="true"}} | ||
| 49 | scchart Test { | ||
| 50 | |||
| 51 | input bool trigger; | ||
| 52 | input int array[10]; | ||
| 53 | |||
| 54 | output bool action0, action1; | ||
| 55 | |||
| 56 | int fun; | ||
| 57 | |||
| 58 | region first_region "Have fun": | ||
| 59 | // State example | ||
| 60 | initial state example_state | ||
| 61 | --> example_state immediate "Having fun" | ||
| 62 | with trigger | ||
| 63 | / action0 = true | ||
| 64 | ; action1 = false | ||
| 65 | ; fun++ | ||
| 66 | |||
| 67 | --> example_state immediate "Having fun" | ||
| 68 | with trigger | ||
| 69 | / action0 = true | ||
| 70 | ; action1 = false | ||
| 71 | ; fun-- | ||
| 72 | ; | ||
| 73 | |||
| 74 | // Region | ||
| 75 | region second_region "Do nothing concurrently": | ||
| 76 | |||
| 77 | initial state init; | ||
| 78 | } | ||
| 79 | {{/code}} | ||
| 80 | |||
| 81 | {{code language="sct" title="SCTx CodeStyle" linenumbers="true"}} | ||
| 82 | #import blub | ||
| 83 | |||
| 84 | |||
| 85 | scchart Test { | ||
| 86 | |||
| 87 | input bool trigger | ||
| 88 | input int array[10] | ||
| 89 | |||
| 90 | output bool action0, action1 | ||
| 91 | |||
| 92 | int fun | ||
| 93 | |||
| 94 | region first_region "Have fun": | ||
| 95 | // State example | ||
| 96 | initial state example_state | ||
| 97 | go to example_state immediate | ||
| 98 | if trigger | ||
| 99 | && (trigger1 | ||
| 100 | || trigger2) | ||
| 101 | do action0 = true | ||
| 102 | ; action1 = false | ||
| 103 | ; fun++ | ||
| 104 | label "Having fun" | ||
| 105 | |||
| 106 | go to example_state immediate | ||
| 107 | if trigger | ||
| 108 | do action0 = true | ||
| 109 | ; action1 = false | ||
| 110 | ; fun-- | ||
| 111 | label "Having fun" | ||
| 112 | |||
| 113 | // Region | ||
| 114 | region second_region "Do nothing concurrently": | ||
| 115 | |||
| 116 | initial state init; | ||
| 117 | } | ||
| 118 | {{/code}} | ||
| 119 | |||
| 120 | == Build Settings == | ||
| 121 | |||
| 122 | To have the simulation and SCT build correctly via Prom, one has to modify the Prom environment that builds the project: | ||
| 123 | |||
| 124 | * Preferences > KIELER SCCharts > Execution Environments | ||
| 125 | ** Select //Generic// | ||
| 126 | ** Select tab //Compilation// | ||
| 127 | ** Select// kieler-gen// as //target directory// | ||
| 128 | ** Set //Snippets directory// to //snippets// | ||
| 129 | ** //Set following as compile chain~:// | ||
| 130 | //T_REFERENCE, T_CONST, T_MAP, T_FOR, T_HISTORY, T_SUSPEND, T_COUNTDELAY, T_SIGNAL, T_PRE, T_WEAKSUSPEND, T_DEFERRED, T_DURING, T_COMPLEXFINALSTATE, T_ABORT, T_EXIT, T_STATIC, T_INITIALIZATION, T_ENTRY, T_CONNECTOR, T_TRIGGEREFFECT, T_SURFACEDEPTH, T_sccharts.scg, T_scg.dependency, [[T_scg.basicblock.sc>>url:http://T_scg.basicblock.sc||shape="rect"]], T_scg.guardExpressions, T_scg.guards, T_scg.scheduling, T_scg.sequentialize, T_scg.s, T_s.c// | ||
| 131 | |||
| 132 | == Git == | ||
| 133 | |||
| 134 | Use git. | ||
| 135 | |||
| 136 | Pull before you start coding. | ||
| 137 | |||
| 138 | Add a commit message. | ||
| 139 | |||
| 140 | In case of non-trivial conflicts: ask. | ||
| 141 | |||
| 142 | \\ | ||
| 143 | |||
| 144 | \\ |