Skip to content

Commit

Permalink
Merge pull request #31 from ut-issl/feature/update-for-v5.0.0
Browse files Browse the repository at this point in the history
Update for v5.0.0
  • Loading branch information
200km authored May 11, 2022
2 parents ea6b22b + 3ecf038 commit 27030e2
Show file tree
Hide file tree
Showing 88 changed files with 1,618 additions and 1,401 deletions.
26 changes: 17 additions & 9 deletions General/CodingConvention.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,34 @@


## Naming Rules
- Now discussing)*
- The following rules are follows until the naming rule is decided.
- Now discussing
- The following rules are follows until the new naming rule is decided.
- Several old files do not follow the rules.

- File and directory Name
- `CamelCase`

- Macro (define)
- All capital letters, connect between words with _
- Snake case with capital case
- `SNAKE_CASE`

- Name of the class
CamelCase (capitalize only the beginning of words)
- `CamelCase`

- Variable name
- All lowercase letters, connect between words with _
- Snake case with lower case
- `snake_case`

- Constant name (not a define but a constant)
- Add k at the beginning and the rest is CamelCase
- Add k at the beginning and the rest is CamelCase
- `kCamelCase`

- Member variables in the class
- Lowercase letters, connect between words with _, end with _
- Snake case with lower case end with `_`
- `snake_case_`

- Methods (functions) in the class
- CamelCase
- `CamelCase`


## Documentation
Expand All @@ -38,4 +46,4 @@

## Initialization files (`.ini` files)
- Comments
- Use //
- Use //
4 changes: 2 additions & 2 deletions General/DocumentFormat.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Format to write specification documents

## 0. General rule
- The file name should be "Spec_***.md" in the Specifications directory.
- The file name should be `Spec_CamelCase.md` in the Specifications directory.
- Please use the markdown format.
- The markdown files are converted to a book with [mdBook](https://rust-lang.github.io/mdBook/) and published in Github Pages.
- The equations are rendered with [MathJax](https://www.mathjax.org/)
Expand Down Expand Up @@ -77,4 +77,4 @@
## 4. References
1.
1.
107 changes: 55 additions & 52 deletions General/HowToCompileWithUbuntuInDocker.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,98 +4,99 @@
- [Docker](https://www.docker.com/) is useful for the easy setup of the compile environment for S2E.
- *Both Windows and Mac* users can use the same environment and get the same result by using the docker container.
- We selected [Ubuntu](https://ubuntu.com/) as an OS in the docker image and [GCC/G++](https://gcc.gnu.org/) as a compiler for S2E.
**Note**: Currently, we use a 32bit compiler for S2E since flight S/Ws are usually executed on a 32bit microcomputers.
**Note**: We currently use a 32bit compiler for S2E since flight S/Ws are usually executed on a 32bit microcomputers.
- We recommend using [Visual Studio Code](https://code.visualstudio.com/) as an editor for the environment.
- This document explains a setup sequence of the docker environment for S2E.
- Note: For a detailed explanation of Docker and VSCode's Extensions, please see the latest and official information.

## 2. Install Required Application
### 2.1. Docker
- Go [install web page of Docker](https://docs.docker.com/get-docker/)
- Go to the [install web page of Docker](https://docs.docker.com/get-docker/).
- Install `Docker for Windows` or `Docker for Mac` to suit your platform.

### 2.2. Visual Studio Code (VS Code)
- Go [install web page of VS Code](https://code.visualstudio.com/)
- Go [install web page of VS Code](https://code.visualstudio.com/).
- Install `Visual Studio Code` to suit your platform.
- Install following extensions
- Remote-SSH
- CMake
- CMake Tools
- C/C++
- Following extensions are also useful
- Markdown+Math
please change the delimiter setting to use the same math format with `Gitlab`.
- Code Spell Checker

### 2.3. **For Mac users**
- Install `coreutils` to use `realpath` command in `setup_docker.sh`
- Use the `brew install coreutils` command when you have `Homebrew`
- Install the `coreutils` to use the `realpath` command in `setup_docker.sh`
- Use the `brew install coreutils` command when you have `Homebrew`

## 3. A Sequence of environment setting
### 3.1. Working directory setting
- Create `work` directory as a working directory.
- Create a `work` directory as a working directory.
- Clone [s2e-core](https://github.com/ut-issl/s2e-core) in the `work` directory.
- Add the `work` directory in the `file sharing` directory of Docker.
**Note**: This setting does not exist in the latest Docker and WSL2 environments in Windows, so it is not necessary.
- **Note**: This setting does not exist in the latest Docker and WSL2 environments in Windows, so it is not necessary.

### 3.2. Make Docker image and container
- Launch `git bash` (for windows users) or `terminal` (for Mac users)
- Move `/s2e-core/scripts/Docker_Ubuntu` directory
- Edit `Dockerfile` or `setup_docker.sh` when you want to change the directory name, the user name of the container, and other settings.
- Execute `./setup_docker.sh build` to make images
- Check created image (`issl` (and `ubuntu`))
command: `docker images`
- Execute `./setup_docker.sh run_core` to make a container
- Check created container (`issl:latest`)
command: `docker ps -a`
- Check dashboard of Docker
<div align="center">
<img src="./figs/Docker_container.png" alt="DockerContainer" style="zoom:30%;" />
</div>
- Check created images (`issl` (and `ubuntu`))
- command: `docker images`
- Execute `./setup_docker.sh run_core` to make the container
- Check created container (`issl:latest`)
- command: `docker ps -a`
- Check the dashboard of Docker as follows.
<div align="center">
<img src="./figs/Docker_container.png" alt="DockerContainer" style="zoom:30%;" />
</div>

### 3.3. SSH connect with VS Code
- Launch `VS Code` and open new window
- Click the `Remote Explorer` icon on the left side
Note: the icon looks like a monitor
### 3.3. SSH connects with VS Code
- Launch `VS Code` and open a new window.
- Click the `Remote Explorer` icon on the left side.
- Note: the icon looks like a monitor
- Click the `gear` icon of `SSH TARGETS` and select the config file you want to edit
Default: `C:\Users\UserName\ssh\config` or `User/UserName/ssh/config`
- Default: `C:\Users\UserName\ssh\config` or `User/UserName/ssh/config`
- Edit the config file as follows
```
Host issl-1
HostName localhost
User s2e
Port 2222
```
```
Host issl-1
HostName localhost
User s2e
Port 2222
```
- Save the config file and check a new SSH target `issl-1` is made in the explorer
- Click `Connect to Host in New Window` icon on right side of `issl-1`
- Enter the password `s2e` when required
- See left bottom icon `SSH:issl-1` to confirm the connection
- Open the `work` directory in the container by using `Open folder`
<div align="center">
<img src="./figs/VSC_SSH_connect.png" alt="VSC_SSH_connect" style="zoom:30%;" />
</div>
<div align="center">
<img src="./figs/VSC_SSH_connect.png" alt="VSC_SSH_connect" style="zoom:30%;" />
</div>

### 3.4. Setting of build environment
### 3.4. Download External Libraries
**Note** : This sequence was integrated within the docker build process, so this is currently unnecessary.

- S2E has several script files to get external libraries.
- For this ubuntu/docker platform, users should use script files in `scripts/Common` directory and `scripts/Docker_Ubuntu` directory.
- Users can execute most of the script files with `git bash` or `terminal` in the outside of the container, but users should execute `scripts/Common/download_nrlmsise00_src_and_table.sh` inside the container to use the same compiler.
- Click `Terminal > New terminal` in the menu bar of VS Code
- Select `bash` terminal at the bottom window
- execute `./s2e-core/scripts/Common/download_nrlmsise00_src_and_table.sh`
- Click `Terminal > New terminal` in the menu bar of VS Code.
- Select `bash` terminal at the bottom window.
- Execute `./s2e-core/scripts/Common/download_nrlmsise00_src_and_table.sh`.
- See `ExtLibraries` to confirm the NRLMSISE library is generated.


### 3.5. Build S2E
- Install following extensions in the `issl-1 SSH connection`
Even if the extensions were already installed in local VS code, you also need to install them in the `SSH connection`
- Install the following extensions in the `issl-1 SSH connection`
Even if the extensions were already installed in local VS code, you also need to install them in the `SSH connection`.
- C/C++
- CMake
- CMake Tools
**Note** : You need to reload VS Code after installing new extensions
- Edit setting of `CMake Tools` in `issl-1`
`Cmake Build Directory: ${workspaceFolder}/s2e-core/build/Debug`
- After `CMake` and `CMake Tools` are installed, VS Code requires you to configure the build environment with `CMakeList.txt`. Please select `yes`. But there is no `CMakeList.txt` file in the `work` directory, and VS Code requires you to locate `CMakeList.txt`, so please select the `CMakeList.txt` file in `s2e-core` directory.
**Note** : You need to reload VS Code after installing new extensions
- Edit setting of `CMake Tools` in `issl-1`
```
Cmake Build Directory: ${workspaceFolder}/s2e-core/build/Debug
```
- After `CMake` and `CMake Tools` are installed, VS Code requires you to configure the building environment with `CMakeList.txt`. Please select `yes`. However, there is no `CMakeList.txt` file in the `work` directory, and VS Code requires you to locate `CMakeList.txt`, so please select the `CMakeList.txt` file in `s2e-core` directory.
- This setting is written in `.vscode/settings.json`
- You can directly edit the `settings.json` as follows
```json
Expand All @@ -104,23 +105,25 @@ Host issl-1
"cmake.buildDirectory": "${workspaceFolder}/s2e-core/build/Debug"
}
```
- Select `GCC 9.3.0` as a kit (compiler)
- Select `GCC 11.2.0` as a kit (compiler)
- Note: Users can also choose other GCC versions.
- Select `CMake [Debug]` and check the configuration is successfully done.
- Build S2E
- If you want clean up, please use `CMake: Clean` command
- Move `build/Debug` directory with `Terminal` in VS Code
- Execute `./S2E` or click `run` icon in bottom
- Check `data/log` directory to confirm log file output
- If you want to clean up, please use `CMake: Clean` command.
- Move to `build/Debug` directory with `Terminal` in VS Code.
- Execute `./S2E` or click the `run` icon at the bottom.
- Check the `data/log` directory to confirm log file output.

## 4. Debug with VS Code
- Select `Run > Start Debugging` in the menu bar.
- Select `C++(GDB/LLDB)` debugger
`.vscode/launch.json` will be created.
- Edit as follows
- If `C++(GDB/LLDB)` is not shown, please open a CPP file and select `Run > Start Debugging` again.
- `.vscode/launch.json` will be created.
- Edit as follows.
```json
"program": "${workspaceFolder}/s2e-core/build/Debug/S2E",
"cwd": "${workspaceFolder}/s2e-core/build/Debug",
```
- Select `Run > Start Debugging` again
- Check `data/log` directory to confirm log file output
- You can use break point in the VS Code editor
- Select `Run > Start Debugging` again.
- Check the `data/log` directory to confirm log file output.
- You can use breakpoints in the VS Code editor.
67 changes: 0 additions & 67 deletions General/HowToCompileWith_OSX.md

This file was deleted.

7 changes: 5 additions & 2 deletions General/HowToDownloadNRLMSISE00library.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@

## 1. Overview
- [NRLMSISE00](https://agupubs.onlinelibrary.wiley.com/doi/full/10.1029/2002JA009430) is an atmosphere model to calculate an air density, considering the solar activity.
- [C language version of NRLMSISE00](https://ccmc.gsfc.nasa.gov/pub/modelweb/atmospheric/msis/nrlmsise00/nrlmsis00_c_version/) is a mandatory library for S2E to calculate the atmosphere density around the Earth.
- [C language version of NRLMSISE00](https://git.linta.de/?p=~brodo/nrlmsise-00.git;a=summary) is a mandatory library for S2E to calculate the atmosphere density around the Earth.
- How to use NRLMSISE00 is written in the [Specification of Atmosphere model](../Specifications/Environment/Spec_Atmosphere.md).
- **Note** The [s2e-core v5.0.0](https://github.com/ut-issl/s2e-core/releases/tag/v5.0.0) provides the CMake file to download and install the external libraries, and we recommend to use it since it is simpler. So users do not need to execute the following process.

## 2. How to set up NRLMSISE00 for S2E

## 2. How to set up NRLMSISE00 for S2E [OLD Descriptions]
1. In any environment, run `s2e-core/scripts/Common/download_nrlmsise00_src_and_table.sh`
+ Source codes of NRLMISE00 and `SpaceWeather.txt` will be downloaded, and `libnrlmsise00.a` will be made for Linux and OSX.
+ Users have to compile the codes using the same compiler with S2E. After these codes are downloaded, you can directly compile them by using makefile in the `ExtLibraries\nrlmsise00\src`.
+ If you use Windows, a bash terminal for Windows (e.g. Git bash, WSL, MSYS) is needed to run this script, and you need to run an additional script. Proceed to Step 2.


2. For Windows Visual Studio users, run `s2e-core/scripts/VisualStudio/make_nrlmsise00_VS32bit.bat` after the process 1.
+ VS command prompt will be launched, then run `scripts/VisualStudio/make_libnrlmsise.bat` in VS command prompt.
+ `libnrlmise.lib`, which is the library for Windows Visual Studio will be made.
Expand Down
4 changes: 3 additions & 1 deletion General/HowToDwnloadCSPCElibrary.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
## 1. Overview
- [SPICE](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/info/intrdctn.html) is a system to combine the most accurate space geometry and event data with space mission analysis, observation planning, or science data processing software developed by NASA.
- [CSPICE](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/index.html) is the C language version of SPICE and mandatory library for S2E to get planet information.
- **Note** The [s2e-core v5.0.0](https://github.com/ut-issl/s2e-core/releases/tag/v5.0.0) provides the CMake file to download and install the external libraries, and we recommend to use it since it is simpler. So users do not need to execute the following process.

## 2. How to set up CSPICE Library for S2E

## 2. How to set up CSPICE Library for S2E [OLD Descriptions]
**Note**: Users can use the script file to automatically set up the following process in the `s2e-core/script` directory. If the script does not work, please see the following process.

- Make directories as follow
Expand Down
15 changes: 11 additions & 4 deletions Overview.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
## Overview

- This repository summarizes documents of S2E (Spacecraft Simulation Environment) CORE.
- The Documents should be
- written in English
- written as markdown format
- updated ASAP when the source codes are modified
- The branch construction
- main
- Documents for the latest stable version of s2e-core
- Current version supports [s2e-core v5.0.0](https://github.com/ut-issl/s2e-core/releases/tag/v5.0.0)
- The old versions are managed with `release/tag/v.*.*.*`
- The release version number is compatible with s2e-core's version number
- develop
- Documents for the latest `develop` branch of s2e-core
- This version is only for s2e-core developers
- feature/branch-name
- Writing documents before merge with the `develop`
Loading

0 comments on commit 27030e2

Please sign in to comment.