Skip to content
Snippets Groups Projects
Commit 81fbc31e authored by DHOMBRES Stephanie's avatar DHOMBRES Stephanie
Browse files

Merge branch 'doc-update' into 'master'

Doc update

See merge request !3
parents c0e5156a 346e293d
No related branches found
No related tags found
1 merge request!3Doc update
......@@ -61,98 +61,13 @@ In the web browser at `http://localhost:8888/swagger-ui/index.html`. You should
![screenshot](doc/images/swagger.png)
You can now create a new project or import existing project.
Follow the [wiki pages](https://gitlab.isae-supaero.fr/nanostar/nanospace/nanospace-demo/-/wikis/home) to setup the demo.
![screenshot](doc/images/project.png)
Enjoy :satellite: :rocket: !
- Click on `Subscribe` link.
- Choose your username and password.
- Log in using chosen username and password.
- Download the [TutorialNanostar.json](https://gitlab.isae-supaero.fr/nanostar/nanospace/nanospace-user/-/blob/master/examples/TutorialNanostar.json) file example on your local drive.
- Click on `Project` (in the top right header) > `Import Project`
- Import the `TutorialNanostar.json` file.
- You can invite other users by selecting `TutorialNanostar` in the `Project` tree and therefore share your project with them (they need to be registered).
# 4. Contact Point
Enjoy :satellite: :rocket: !
# 4. API
API is described at [http://localhost:8888/swagger-ui/index.html](http://localhost:8888/swagger-ui/index.html).
The API port is 8888 by default.
A Python example is given in [Python API](https://gitlab.isae-supaero.fr/nanostar/nanospace/nanospace-clients/nanospace-python-client)
# 5. Templates
(A big thanks to Carlos Sarille on this part!)
Oh hello!
In this part I will document how I am doing for the use of templates.
Example files for the following can be found on the [System Engineering folder](https://gitlab.isae-supaero.fr/nanostar/nanospace/nanospace-demo/-/tree/master/examples?ref_type=heads)
## 5.A Usage
The main idea is that, in order to facilitate work, there are user-definable templates that can be used to create elements in Nanospace. That is done by clicking secondary button in the tree, and navigating into "Create from template". Angular reads a json file with the templates (this should be uploadable by the user) and displays the posibilities.
As examples, we could have a context menu like this:
![example context menu](doc/images/tree.png)
What is going on behind the curtains is the following:
- On the tree, I added a submenu to the context menu. This will execute a function that reads the json file provided by the user and generates the submenus accordingly.
- When the user clicks on one option, this will execute another function that will create the nodes, child nodes and values (only strings by now, sorry). The code is not too complicated but it took me a while to make it work. Most of the stuff is in the sidebar-component.ts file, but I also had to add a "addStringSilent", and some others to the Nanospace service.
The document with the templates has the following format:
- Extension: .json
- Format of submenus:
- {"name":"submenu_name", "type":"submenu", "children":[{child_1},{child_2},...]}
- Children can be submenus or elements.
- Format of elements
- {"name":"element_name", "type":"element", "children":[{child_1},{child_2},...]}
- Children can be elements or modes.
- Format of modes
- {"name":"mode_name", "type":"element", "values":[{value_1},{value_2},...]}
- Format of values
- {"name":"value_name", "type":"value_string", "value":"number_or_string", "mode":"nominal"}
- type can be "value_string", "value_formula" or "calue_matrix".
The file is loaded in the top right menu. It is shared between navbar.component and sidebar.component through tool.service in a very precarious way. I don't have the time to do it better but hey, you probably do so go for it!
## 5.B Generation of templates
When you right click on an element, there is a "Generate template from element" option, that displays a messy window from where you can copy the json code for that element as a template. This way you don't have to worry too much about writing the json. It is still a bit messy for the user but definitely better than writing the json by hand. There is a template file as example in the folder carlos_mods. Most of the changes are in the sidebar-component.ts
## 5.C CopyPaste
With the right click menu on the tree you can copy and paste elements. it works exactly as the template generation and loading but without dealing with files. Most of the changes are in the sidebar-component.ts
## 5.D Drag and Drop
You can drag and drop elements, values and modes from the tree to the text inputs for strings formulas and matrixes. Most of the changes are in the sidebar-component.ts
## 5.E Full tree
The tree now displays components, modes and values. If there are no values it shows no modes. This makes everything much easier for the user. Clicking on values takes you to the element. Hovering the mouse over the value name on the tree shows the value in an alt. Most of the changes are in the sidebar-component.ts
## 5.F API Endpoint
So we discovered this when deploying in several computers. So far the endpoint (this is, the address where the frontend sends the requests to the middle ent) was harcoded. For deployment in a server this might be a good idea, I don't know. For local networks it's a mess.
The solution was to add a couple of lines to the file main.ts, that update the api endpoint variable to be the same address where you are getting the web from. So, if you are connecting to 192.168.123 to access nanospace, all the requests to the middlend will be done to that same IP. If the IP changes, this adapts by itself.
## 5.G Other additions
All this changes are in sidebar-component.ts
- Search bar for the tree
- Tree is now organized alphabetically and by cathegory
- Refresh button for the tree
# 5. Contact Point
- Stéphanie Dhombres from [ISAE-SUPAERO - DCAS](https://www.isae-supaero.fr/departement-conception-et-conduite-des-vehicules-aeronautiques-et-spatiaux-dcas/)
- Thibault Gateau from [ISAE-SUPAERO - DCAS](https://www.isae-supaero.fr/departement-conception-et-conduite-des-vehicules-aeronautiques-et-spatiaux-dcas/)
- Stéphanie Dhombres (firstname.lastname@isae-supaero.fr) from [ISAE-SUPAERO - DCAS](https://www.isae-supaero.fr/departement-conception-et-conduite-des-vehicules-aeronautiques-et-spatiaux-dcas/)
- Thibault Gateau (firstname.lastname@isae-supaero.fr) from [ISAE-SUPAERO - DCAS](https://www.isae-supaero.fr/departement-conception-et-conduite-des-vehicules-aeronautiques-et-spatiaux-dcas/)
doc/images/add_mode.png

77.5 KiB

doc/images/create_component.png

61.7 KiB

doc/images/create_new_projet.png

18.9 KiB

doc/images/edit.png

63.3 KiB

doc/images/export.png

29.1 KiB

doc/images/get.png

69.6 KiB

doc/images/new_project.png

37.1 KiB

doc/images/reset_database.png

25.4 KiB

doc/images/values.png

31.1 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment