Skip to content

Commit

Permalink
import ut-issl/c2a-tlm-cmd-code-generator ae-v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sksat committed Oct 2, 2023
1 parent ea6c763 commit 5546696
Show file tree
Hide file tree
Showing 22 changed files with 1,767 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tlm-cmd-code-generator/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[flake8]
max-line-length = 100
ignore =
# black と競合するので
E203,
E501,
W503,
W504
26 changes: 26 additions & 0 deletions tlm-cmd-code-generator/.github/ISSUE_TEMPLATE/action_item.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Action Item
about: AI 管理用テンプレート
title: ''
labels: ''
assignees: ''

---

## 概要
ひとことで

## 詳細
詳しく

## close条件
どうなったらcloseできるか

## 備考
なにかあれば

## 注意
- 関連する Projects が存在する場合,それの紐付けを行うこと
- 可能ならば `priority` ラベルを付けること
- 可能ならば Assignees を設定すること
- close するときは結論を明記すること
37 changes: 37 additions & 0 deletions tlm-cmd-code-generator/.github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

## 概要
ひとことで

## 詳細
### 詳細症状
どういうバグか

### 発生条件
発生した環境,症状,パラメタなど

### 追加資料
あればリンクなどを貼る

## 必要な作業
- [ ] あれして
- [ ] これする

## 影響範囲
tool類が全部死ぬ... みたいな

## 補足
何かれば

## 注意
- 関連する Projects が存在する場合,それの紐付けを行うこと
- 可能ならば `priority` ラベルを付けること
- 可能ならば Assignees を設定すること
- close するときは結論を明記すること
23 changes: 23 additions & 0 deletions tlm-cmd-code-generator/.github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## 概要
ひとことで

## Issue
- 関連する issue

## 詳細
詳しく

## 検証結果
test へのリンクや,検証結果へのリンク

## 影響範囲
XX系の動作がガラッと変わる,とか.

## 補足
何かあれば

## 注意
- 関連する Projects が存在する場合,それの紐付けを行うこと
- Assignees を設定すること
- 可能ならば Reviewers を設定すること
- 可能ならば `priority` ラベルを付けること
55 changes: 55 additions & 0 deletions tlm-cmd-code-generator/.github/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
- name: "bug"
color: "d73a4a"
description: "Something isn't working"

- name: "documentation"
color: "0075ca"
description: "Improvements or additions to documentation"

- name: "duplicate"
color: "cfd8d7"
description: "This issue or pull request already exists"

- name: "enhancement"
description: "New feature or request"
color: "a2eeef"

- name: "good first issue"
description: "Good for newcomers"
color: "7057ff"

- name: "help wanted"
description: "Extra attention is needed"
color: "008672"

- name: "invalid"
description: "This doesn't seem right"
color: "e4e669"

- name: "question"
description: "Further information is requested"
color: "d876e3"

- name: "wontfix"
description: "This will not be worked on"
color: "ffffff"

- name: "icebox"
description: "icebox or pending"
color: "c5def5"

- name: "priority::high"
description: "priorityg high"
color: "d93f0b"

- name: "priority::low"
description: "priority low"
color: "9dcce0"

- name: "priority::medium"
description: "priority medium"
color: "fbca04"

- name: "tools"
description: ""
color: "510f70"
17 changes: 17 additions & 0 deletions tlm-cmd-code-generator/.github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: reviewdog / actionlint

on:
pull_request:
paths:
- '.github/workflows/**'

jobs:
actionlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: reviewdog/action-actionlint@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review
fail_on_error: true
25 changes: 25 additions & 0 deletions tlm-cmd-code-generator/.github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: labeler

on:
push:
branches:
- main
pull_request:
paths:
- .github/workflows/labeler.yml
- .github/labels.yml

jobs:
labeler:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Run Labeler
uses: crazy-max/ghaction-github-labeler@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
yaml-file: .github/labels.yml
skip-delete: false
dry-run: ${{ github.ref != 'refs/heads/main' }}
25 changes: 25 additions & 0 deletions tlm-cmd-code-generator/.github/workflows/python_check_format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: reviewdog / python format check

on:
push:
branches:
- main
pull_request:

jobs:
black_format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

# - name: check python format with black
# uses: psf/black@stable

- uses: reviewdog/action-black@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# reporter: github-pr-review # TODO: いい感じになったら直す
reporter: github-pr-check
filter_mode: nofilter
fail_on_error: true
level: warning
27 changes: 27 additions & 0 deletions tlm-cmd-code-generator/.github/workflows/python_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: reviewdog / lint python

on:
push:
branches:
- main
pull_request:

jobs:
flake8_lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up python environment
uses: actions/setup-python@v4
with:
python-version: "3.8"

- name: flake8 Lint
uses: reviewdog/action-flake8@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review
filter_mode: nofilter
fail_on_error: true
level: warning
22 changes: 22 additions & 0 deletions tlm-cmd-code-generator/.github/workflows/validate-renovate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: validate / renovate.json

on:
pull_request:
paths:
- 'renovate.json'
- '.github/workflows/validate-renovate.yml'

jobs:
validate-renovate:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3

- name: install
run: |
npm install -g renovate
- name: validate
run: |
renovate-config-validator
16 changes: 16 additions & 0 deletions tlm-cmd-code-generator/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# OSX
.DS_Store
.AppleDouble
.LSOverride
Icon

# Thumbnails
._*

# Files that might appear on external disk
.Spotlight-V100
.Trashes

# others
*.pyc
gstos_files/*
53 changes: 53 additions & 0 deletions tlm-cmd-code-generator/GenerateC2ACode.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# coding: UTF-8
"""
python 3.7以上を要求
"""

import json
import sys

import my_mod.load_db
import my_mod.cmd_def
import my_mod.tlm_def
import my_mod.tlm_buffer


# import pprint
# import os.path
# import msvcrt # Enter不要な入力用
# import subprocess


# 環境変数
DEBUG = 0
# 0 : Release
# 1 : all
SETTING_FILE_PATH = "settings.json"


def main():
with open(SETTING_FILE_PATH, mode="r") as fh:
settings = json.load(fh)
# print(settings["path_to_src"]);

cmd_db = my_mod.load_db.LoadCmdDb(settings)
tlm_db = my_mod.load_db.LoadTlmDb(settings)
# pprint.pprint(cmd_db)
# pprint.pprint(tlm_db)
# print(tlm_db)

my_mod.cmd_def.GenerateCmdDef(settings, cmd_db["sgc"])
my_mod.cmd_def.GenerateBctDef(settings, cmd_db["bct"])
my_mod.tlm_def.GenerateTlmDef(settings, tlm_db["tlm"])

if settings["is_main_obc"]:
my_mod.cmd_def.GenerateOtherObcCmdDef(settings, cmd_db["other_obc"])
my_mod.tlm_def.GenerateOtherObcTlmDef(settings, tlm_db["other_obc"])
my_mod.tlm_buffer.GenerateTlmBuffer(settings, tlm_db["other_obc"])

print("Completed!")
sys.exit(0)


if __name__ == "__main__":
main()
21 changes: 21 additions & 0 deletions tlm-cmd-code-generator/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Intelligent Space Systems Laboratory, The University of Tokyo

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit 5546696

Please sign in to comment.