Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

デモ用のアプリ #411

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

デモ用のアプリ #411

wants to merge 2 commits into from

Conversation

meltingrabbit
Copy link
Member

@meltingrabbit meltingrabbit commented Feb 11, 2025

C2A + Gaia + dev-tools による,FSW や運用のデモをするために,シンプルな電卓アプリをつくった.
BC をつかうことなどで,アトミック処理もデモができる.

実運用には不要なアプリなため,マージするかは要検討.

↓ デモ用のコマンドファイル.

# === 2 way 確立 ===
[email protected] NOP
.

# === テレメ要求 ===
## テレメ停止
[email protected] TLM_MGR_INIT
 wait 1.5s
 @RT.MOBC TLM_MGR_STOP_TLM
.
## Send cmd and Get tlm
[email protected] TG_GENERATE_RT_TLM tlmid!(MOBC.HK)
[email protected] EL_RECORD_EVENT 60 10 0 100
[email protected] TG_GENERATE_RT_TLM tlmid!(MOBC.HK)
[email protected] EL_RECORD_EVENT 70 20 0 200
.

# === テレメ登録 ===
[email protected] TLM_MGR_INIT
 wait 1.5s
 @RT.MOBC TLM_MGR_REGISTER_GENERATE_RT_TLM 0 tlmid!(MOBC.HK)
 wait 0.5s
 @RT.MOBC TLM_MGR_REGISTER_GENERATE_RT_TLM 1 tlmid!(MOBC.TL)
 wait 0.5s
 @RT.MOBC TLM_MGR_REGISTER_GENERATE_RT_TLM 1 tlmid!(MOBC.BL)
 wait 0.5s
 @RT.MOBC TLM_MGR_REGISTER_GENERATE_RT_TLM 1 tlmid!(MOBC.DEMO_CALC)
 wait 0.5s
 @RT.MOBC TLM_MGR_START_TLM
.

# === 電卓デモ ===
.let add = 0
 let sub = 1
 let mul = 2
 let div = 3
 let mod = 4

[email protected] APP_CALC_SET_A 10
[email protected] APP_CALC_SET_B 3
[email protected] APP_CALC_SET_OP sub
[email protected] APP_CALC_EXEC
.
[email protected] APP_CALC_SET_A 4
[email protected] APP_CALC_SET_B 6
[email protected] APP_CALC_SET_OP mul
[email protected] APP_CALC_EXEC
.

# === アトミック処理 ===
[email protected] APP_CALC_RESET
## アトミック処理単位の生成
.let bc_id = 100
@RT.MOBC BCT_CLEAR_BLOCK bc_id
.
# << BCT 確認 >>

[email protected] 20: APP_CALC_SET_A 500
 wait 0.5s
 @BL.MOBC 40: APP_CALC_SET_B 12
 wait 0.5s
 @BL.MOBC 60: APP_CALC_SET_OP div
 wait 0.5s
 @BL.MOBC 80: APP_CALC_EXEC
 wait 0.5s
 @RT.MOBC BCE_ACTIVATE_BLOCK
.
# << BCT 確認 >>

## アトミック処理単位の実行
[email protected] TLCD_DEPLOY_BLOCK 1 bc_id
.

# === Timeline 登録 ===
[email protected] APP_CALC_RESET
## TL の登録
.
# << TL 確認 >>

# << 現在 TI の確認とセット >>
.let now = 6200
 let offset = 300
 @TL.MOBC now + offset + 20: APP_CALC_SET_A 5000
 wait 0.5s
 @TL.MOBC now + offset + 40: APP_CALC_SET_B 120
 wait 0.5s
 @TL.MOBC now + offset + 60: APP_CALC_SET_OP div
 wait 0.5s
 @TL.MOBC now + offset + 80: APP_CALC_EXEC
.
# << TL 確認 >>

## TL の実行
# << TL が実行されるのを眺める >>
.

# === バックアップコマンド ===
[email protected] TLM_MGR_STOP_TLM
.
[email protected] APP_CALC_EXEC
[email protected] APP_CALC_SET_A 10
[email protected] APP_CALC_SET_B 3
[email protected] APP_CALC_SET_OP add
[email protected] APP_CALC_SET_OP sub
[email protected] APP_CALC_SET_OP mul
[email protected] APP_CALC_SET_OP div
[email protected] APP_CALC_SET_OP mod
[email protected] APP_CALC_RESET

@meltingrabbit meltingrabbit self-assigned this Feb 11, 2025
}


CCP_CmdRet Cmd_APP_CALC_SET_OP(const CommonCmdPacket* packet){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [check_coding_rule] reported by reviewdog 🐶
PROHIBITED PATTERNS:'){' (SPACE IS REQUIRED)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant