You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-43Lines changed: 20 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,55 +29,29 @@ $ Simput
29
29
-o, --output [directory] Output directory to output to
30
30
-t, --type [type] Type of input
31
31
32
-
--no-gui Just generate output
33
32
-s, --silent Do not open the browser
34
33
35
34
-c, --compile [directory] Directory to compile files
36
35
-m, --minify Minify compiled file
37
-
-a, --add [file] Add model to list of available inputs
38
-
-l, --list List model types of available as inputs
39
-
-r, --remove [type] Remove model to list of available inputs
40
36
41
37
```
42
38
43
39
## Examples
44
40
45
41
```sh
46
-
$ Simput -t pyfr -o ~/pyfr/example
42
+
$ Simput -p
47
43
```
48
44
49
-
Starts a server and opens your web browser, an empty PyFR model is loaded which you can modify. The _Save_ button will export a pyfr.json file (model) which you can then be loaded later on. The _Convert_ button will export a `pyfr.ini` file for PyFR execution.
50
-
51
-
As no initial model was provided, the boundary names will be autogenerated.
52
-
In order to pre-define those boundary names, you can either edit the generated model (`pyfr.json`) or start with an empty model you've created like the following one.
53
-
54
-
my-pyfr-model.json
55
-
```js
56
-
{
57
-
"type":"pyfr",
58
-
"data": {},
59
-
"external": {
60
-
"boundary-names": {
61
-
"User friendly name":"value-expected-by-code",
62
-
"Inlet":"inlet",
63
-
"Outlet":"outlet",
64
-
"External walls":"external-wall"
65
-
}
66
-
}
67
-
}
68
-
```
69
-
70
-
Then loading it back for further edits can be performed with the following command line:
71
-
72
-
73
-
```sh
74
-
$ Simput -i my-pyfr-model.json -o ~/pyfr/example
75
-
```
45
+
Starts a server and opens your web browser, showing a landing page with a choice of inputs which you can create.
76
46
77
47
## Demos
78
48
79
49
There are a few supplied demos in the folder `types`, each have their own README.
80
50
51
+
* vCard is the simplest example, with a single type of output.
52
+
* oscillator is a bit more complex, because it derives from a real benchmarking application meant to exercise in-situ analyses on hpc systems.
53
+
* pyfr and vera produce input files for real applications, and are realistically complex.
54
+
81
55
## Development
82
56
83
57
```sh
@@ -99,27 +73,20 @@ $ Simput
99
73
-o, --output [directory] Output directory to output to
100
74
-t, --type [type] Type of input
101
75
102
-
--no-gui Just generate output
103
76
-s, --silent Do not open the browser
104
77
105
78
-c, --compile [directory] Directory to compile files
106
79
-m, --minify Minify compiled file
107
-
-a, --add [file] Add model to list of available inputs
108
-
-l, --list List model types of available as inputs
109
-
-r, --remove [type] Remove model to list of available inputs
110
80
111
81
```
112
82
113
-
Then to compile pyfr and publish it:
83
+
Then to compile pyfr and open a development server which watches for another compile:
A recent version Firefox is preferred for debugging. Errors in Chrome do not always point to [the exact line](https://github.com/altano/handlebars-loader/issues/67#issuecomment-171128403) where the error is happening.
122
-
123
90
## Creating a new simulation type
124
91
125
92
In a separate location create a folder for your type:
@@ -142,7 +109,7 @@ Create the folder and file structure:
142
109
- `[file for each property, contents are html]`
143
110
-`/templates`
144
111
-[template file and helpers]
145
-
-`model.json`, primary data structure.
112
+
-`model.js`, primary data structure.
146
113
-`convert.js`, converts the model into the simulation deck format.
147
114
-`parse.js`, converts a complete input file to the simput model; _recommended, not required_.
148
115
-`/samples`, empty or partially full sample datasets; _recommended, not required_.
Simput changed to a Vue.js framework, and no longer has the ability to dynamically add and load types - they must be present when Simput is built by webpack.
140
+
141
+
Add another script to `package.json` which compiles your type.
142
+
143
+
Add a call to `Simput.registerType()` for your type in `static/index.html`
144
+
145
+
This will likely change soon.
146
+
170
147
## Licensing
171
148
172
149
**Simput** is licensed under [BSD Clause 3](LICENSE).
Copy file name to clipboardExpand all lines: documentation/content/docs/convert.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
-
title: Convertion helper
1
+
title: Conversion helper
2
2
---
3
3
4
4
Once the view model is filled up by the user, we rely on a function to validate and convert the data into a structure easy to handle within a template.
5
5
6
-
On the other hand if the proper __output__ annotations have been used in the model definition, such method can be automatically generated for you.
6
+
On the other hand if the proper __output__ annotations have been used in the model definition, such method can be automatically generated for you.
7
7
8
8
The function definition is as follow:
9
9
@@ -39,7 +39,7 @@ module.exports = function (viewModel) {
39
39
40
40
## View Model structure
41
41
42
-
The view model is what you get from the outside world that you need to convert into a set of files. That structure is related to the definition you wrote and what the user trully filled.
42
+
The view model is what you get from the outside world that you need to convert into a set of files. That structure is related to the definition you wrote and what the user actually filled in.
43
43
44
44
```model.js
45
45
{
@@ -80,12 +80,12 @@ The view model is what you get from the outside world that you need to convert i
Copy file name to clipboardExpand all lines: documentation/content/docs/model.md
+31-32Lines changed: 31 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ SimPut works around a model definition that the user have to define initially. T
11
11
12
12
## Format
13
13
14
-
The model can either be a JSON or a JavaScript file. But we recommend to use the JavaScript syntax as it will allow you to use comment and ignore other restriction that JSON is enforcing.
14
+
The model can either be a JSON or a JavaScript file. We recommend using the JavaScript syntax as it will allow you to use comments and avoid other restrictions that JSON enforces.
15
15
16
16
```JavaScript
17
17
module.exports= {
@@ -23,7 +23,7 @@ module.exports = {
23
23
};
24
24
```
25
25
26
-
vs
26
+
vs
27
27
28
28
```JSON
29
29
{
@@ -42,7 +42,7 @@ Let's look closer to the various section that can exist inside a `model.[json/js
42
42
### Definitions
43
43
44
44
The definition is the home of the various attributes that regroup parameters that we want the user to input.
45
-
An attribute is defined by a group of parameters with a title.
45
+
An attribute is defined by a group of parameters with a title.
46
46
Each parameter is listed in an order manner and provide the following set of fields:
47
47
-__id:__ Identifiant that is used inside the attribute map within the view model.
48
48
-__type:__['string', 'double', 'int', 'bool', ...] The type is to properly convert user input from standard UI to their actual type.
@@ -53,7 +53,7 @@ Each parameter is listed in an order manner and provide the following set of fie
53
53
```
54
54
module.exports = {
55
55
definitions: {
56
-
attributeIdentifiant: {
56
+
attributeIdentifier: {
57
57
label: 'User friendly string for the attribute section',
58
58
parameters: [
59
59
{
@@ -83,9 +83,9 @@ Attribute rendering example
83
83
84
84
#### Parameter
85
85
86
-
##### Layout
86
+
##### Layout
87
87
88
-
When size is bigger than 1 it make sense to start providing a layout hint. Below we list known layout.
88
+
When size is bigger than 1 it makes sense to start providing a layout hint. Below we list known layout hints.
89
89
90
90
```
91
91
"parameters": [
@@ -146,8 +146,8 @@ Attribute rendering example
146
146
147
147
##### Show
148
148
149
-
An additional field can be provided to dynamically show or hide a given parameter based on a neighbor condition.
150
-
The value set is always capture within an array, which force the expression to be extracted like shown below.
149
+
An additional field can be provided to dynamically show or hide a given parameter based on a neighbor's value.
150
+
The value set is always captured within an array, which force the expression to be extracted like shown below.
151
151
152
152
```
153
153
"parameters": [
@@ -169,7 +169,7 @@ The value set is always capture within an array, which force the expression to b
169
169
170
170
##### UI
171
171
172
-
Sometime a single field need to have a custom presentation. A `ui` field is then use to let the user control what *presentation layer* should be used. Below are some existing `ui`implementation:
172
+
Sometimes a single field needs to have a custom presentation. A `ui` field is then used to let the user control what *presentation layer* should be used. Below are some existing `ui`implementations:
173
173
174
174
```
175
175
"attr2": {
@@ -226,7 +226,7 @@ Attribute rendering with different ui
226
226
Attribute rendering with different ui
227
227
</center>
228
228
229
-
The domain in the UI can be filled by some external data.
229
+
The domain in the UI can be filled by some external data.
230
230
231
231
```
232
232
{
@@ -241,7 +241,7 @@ The domain in the UI can be filled by some external data.
241
241
242
242
##### Conditional attributes
243
243
244
-
Parameters can be dynamically composed based on other attribute parameters and conditional expression.
244
+
Parameters can be dynamically composed based on other attribute parameters and conditional expressions.
245
245
246
246
```
247
247
"attrOr": {
@@ -273,11 +273,11 @@ Parameters can be dynamically composed based on other attribute parameters and c
273
273
274
274
### Views
275
275
276
-
Views are meant to gather several attribute/parameter into a meaningful pages that get driven based on a side menu.
277
-
The label for a view is what will be display in the side menu for selecting a given view/page.
276
+
Views are meant to gather several attributes/parameters into meaningful pages that get driven based on a side menu.
277
+
The label for a view is what will be displayed in the side menu for selecting a given view/page.
278
278
The content of the page will be defined by the __attributes__ array content that was describe above.
279
-
When no__attributes__ are given, a __children__should be used to create a nested list of other views.
280
-
The __size__for a view is used when you want to dynamically create/delete a given view.
279
+
Instead of__attributes__, a __children__array can be used to create a nested list of other views.
280
+
A __size: -1__ is used for a view when you want to dynamically create/delete views in a list.
281
281
282
282
```
283
283
views : {
@@ -309,7 +309,7 @@ views : {
309
309
View menu
310
310
</center>
311
311
312
-
To a view can be attached hooks to dynamically massage the data between transitions. This allow for instance to copy the dynamic view name into a parameter of a given attribute or expose a set of view data into some external domain so they could be used somewhere else in the input definition.
312
+
Hooks can be attached to a view to dynamically massage the data between transitions. This allows, for instance, copying the dynamic view name into a parameter of a given attribute or exposing a set of view data into some external domain so they can be used somewhere else in the input definition.
313
313
314
314
```
315
315
views : {
@@ -326,10 +326,10 @@ views : {
326
326
},
327
327
```
328
328
329
-
Note the `readOnly` option disable the view name edition from the side menu which works well if you want to use a parameter to define that view name.
330
-
The `noDelete` option disable the delete action on the view. That flag can either be define at the view definition or inside the `currentViewData` that the hooks are getting passed. The 'readOnly' flag follow the same pattern regarding where its definition can be provided.
329
+
Note the `readOnly` option disables the view name editing in the side menu which works well if you want to use a parameter to define that view name.
330
+
The `noDelete` option disables the delete action on the view. That flag can either be defined in the view definition or inside the `currentViewData` that the hooks are getting passed. The 'readOnly' flag follows the same pattern regarding where its definition can be provided.
331
331
332
-
To register your own hooks, you will have to create a `hooks.js` next to your model file. The following listing illustrate what that file should looks like.
332
+
To register your own hooks, you will have to create a `hooks.js` next to your model file. The following listing illustrates what that file should look like.
333
333
334
334
```
335
335
function getExternal(dataModel) {
@@ -376,7 +376,7 @@ Hooks can also be used to alter the model definition in order to add or remove v
376
376
377
377
### Order
378
378
379
-
The order is used to define the side menu to provide the list of view in an ordered manner.
379
+
The __order__ list is used to define the side menu, providing the list of views in order. A view will not appear unless it is included in this list.
380
380
381
381
```
382
382
order: [
@@ -399,15 +399,15 @@ output: {
399
399
},
400
400
```
401
401
402
-
Currently only 2 types are available [__default__ or __template__]:
402
+
Currently 2 types are available [__default__ or __template__]:
403
403
- The __default__ mode is just going to serialize the data model into JSON.
404
-
- The __template__ mode allow the user to define a [*Handlebars*](https://handlebarsjs.com/block_helpers.html) template to convert the JSON structure into any other format.
404
+
- The __template__ mode allow the user to define a [*Handlebars*](https://handlebarsjs.com/block_helpers.html) template to convert the JSON structure into any other format.
405
405
406
-
The output section require additional an additional __output__ field inside each `view` definition.
406
+
The output section requires an additional __output__ field inside each `view` definition.
407
407
408
408
#### Output inside views
409
409
410
-
On a view which list a set of *attributes*, you'll need to define an __output__ array that will define a mapping between view attributes into output data model.
410
+
On a view which lists a set of *attributes*, you will need to define an __output__ array that defines a mapping between view attributes and the output data model.
411
411
412
412
Here is an example:
413
413
@@ -429,12 +429,12 @@ output: [
429
429
430
430
Each entry in that output array should be composed of:
431
431
-__extract:__ list the parameters that we want to output somewhere in the model.
432
-
-__src:__ Name of the attribute that we want to extract the parameters from
432
+
-__src:__ Name of the attribute that we want to extract the parameters from
433
433
-__dst:__ List of mapping of where to store the given parameters
434
434
435
-
The left side of the *dst* entry define the path of where a given parameter should be stored which is provided on the right side of the `=`.
435
+
The left side of the *dst* entry define the path where the parameter on the right side of the `=`should be stored.
436
436
437
-
When we want to fill an array with object the following pattern can be used:
437
+
When we want to fill an array with objects the following pattern can be used:
438
438
439
439
```
440
440
'root.elements[]+=name',
@@ -445,11 +445,10 @@ When we want to fill an array with object the following pattern can be used:
445
445
```
446
446
447
447
448
-
The `.` on the left side are used as nesting structure inside an object.
449
-
The `{xxx}` are automatically replaced on the left side with the actual value of the `xxx` parameter.
450
-
448
+
The `.` on the left side define the nesting structure inside an object.
449
+
The `{xxx}` are automatically replaced on the left side with the actual value of the `xxx` parameter.
451
450
452
451
### Scripts
453
452
454
-
External scripts can be loaded for a given type by providing at the root level a `scripts: [],` section with the list of url that the type should load in order to works.
455
-
This can be useful to register custom widgets to edit your custom parameter.
453
+
External scripts can be loaded for a given type by providing at the root level a `scripts: [],` section with the list of url that the type should load.
454
+
This can be useful to register custom widgets to edit your custom parameters.
0 commit comments