Skip to content

Commit

Permalink
エンジンを追加したあとのアプリケーションの再起動を不要にする (#1400)
Browse files Browse the repository at this point in the history
Co-authored-by: Nanashi. <[email protected]>
  • Loading branch information
Hiroshiba and sevenc-nanashi authored Jul 29, 2023
1 parent 9aed6e8 commit da73bcd
Show file tree
Hide file tree
Showing 21 changed files with 351 additions and 192 deletions.
75 changes: 43 additions & 32 deletions docs/res/終了シーケンス図.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,57 @@
# 終了シーケンス図

```mermaid
flowchart
node_1>"アプリ実行中"] -->|"アプリを再起動"| node_3["back.RESTART_APP"]
flowchart TD
node_1>"アプリ実行中"] -.->|"MacのCmd+Q"| subgraph_2["app.before_quit"]
style node_1 fill:#ffbbbb,stroke:#ff0000
node_3 --> node_4(["willRestart=true"])
node_1 -.->|"MacのCmd+Q"| subgraph_2["app.before_quit"]
node_21{{"winがclose済みか"}} -.->|"NO"| subgraph_1["win.close"]
node_1 -->|"アプリ起動直後のVVPPインストール後の再起動"| 132024(["willRestart=true"])
132024 --> 512010["app.quit"]
512010 -.-> subgraph_2
438128["win.close"] -.-> subgraph_1
node_1 -.->|"ウィンドウを閉じる"| subgraph_1
node_4 --> 438128
442878["event.preventDefault"] --> 571782["Vuex.CHECK_EDITED_AND_NOT_WAVE"]
node_9["event.preventDefault"] --> 571782
node_1 -.->|"MacのCmd+W・WinのAlt+F4"| subgraph_1
node_15["app.quit"] -.-> subgraph_2
a{{"willQuit"}} -.-> subgraph_2
node_8["win.destroy"] -.-> subgraph_1
701221{{"willRestart"}} -->|"false"| node_21
a{{"willQuit"}} -.->|"true"| subgraph_2
node_21 -.->|"YES"| node_23>"アプリ終了"]
style node_23 fill:#bbbbff,stroke:#0000ff
subgraph 571782["Vuex.CHECK_EDITED_AND_NOT_WAVE"]
node_5["back.CLOSE_WINDOW"] --> node_7(["willQuit=true"])
node_7 --> node_8
453066{" "} -->|"キャンセル"| node_6>"アプリ実行中に戻る"]
453066 --> node_5
846215{" "} -->|"reload"| 186768["RELOAD_APP"]
node_1 -->|"×ボタン"| 295190(["close"])
node_1 -->|"アプリを再読み込み"| 929152(["reload"])
846215 -->|"close"| 208965["back.CLOSE_WINDOW"]
node_9["event.preventDefault"] --> 295190
295190 --> 571782["Vuex.CHECK_EDITED_AND_NOT_SAVE"]
929152 --> 571782
177756{{"alreadyCompleted?"}} -->|"true"| node_21
442878["event.preventDefault"] --> 295190
node_8["win.destroy"] -.-> subgraph_2
705785[["cleanupEngines"]] ~~~ 793927["cleanupEngines"]
198115["win.loadURL"] --> 562861>"UIの描画"]
454139[["cleanupEngines"]] ~~~ 793927
subgraph 186768["RELOAD_APP"]
705785 --> 700765{{"alreadyCompleted?"}}
700765 -->|"false"| 462289["await"]
700765 -->|"true"| 464405[["launchEngines"]]
462289 --> 464405
464405 --> 198115
494918["win.loadURL(dummy)"] --> 705785
end
subgraph subgraph_2["app.before_quit"]
c["willQuit"] -->|"false"| node_9
node_13["event.preventDefault"] --> node_14["全エンジンkill待機"]
node_19(["willRestart=false, willQuit=false"]) --> node_20>"back.start"]
subgraph 208965["back.CLOSE_WINDOW"]
node_7(["willQuit=true"]) --> node_8
end
subgraph 571782["Vuex.CHECK_EDITED_AND_NOT_SAVE"]
846215 -->|"キャンセル"| node_6>"アプリ実行中に戻る"]
end
subgraph 793927["cleanupEngines"]
node_12["engine.killEngineAll"] --> 889691{{"numLivingEngineProcess"}}
889691 -->|"&gt;0"| 701221
701221 -->|"true"| node_17["event.preventDefault"]
c -->|"true"| node_12
889691 -->|"0"| 916552{{"hasMarkedEngineDirs"}}
916552 -->|"false"| 701221
916552 -->|"true"| node_13
node_17 --> node_19
node_14 --> node_18["vvpp.handleMarkedEngineDirs"]
node_18 --> node_15
node_14["全エンジンkill待機"] --> node_18["vvpp.handleMarkedEngineDirs"]
889691 -->|">0"| node_14
916552 -->|"false"| node_14
916552 -->|"true"| 655722["何もしない"]
end
subgraph subgraph_2["app.before_quit"]
c["willQuit"] -->|"false"| node_9
c -->|"true"| 454139
454139 --> 177756
177756 -->|"false"| node_13["event.preventDefault"]
node_13 --> 322763["await"]
322763 --> node_15
end
subgraph subgraph_1["win.close"]
a -->|"false"| 442878
Expand Down
32 changes: 16 additions & 16 deletions docs/res/起動シーケンス図.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,17 @@
```mermaid
flowchart
174170["back.installVvppEngineWithWarning"] --> 786961["back.installVvppEngine"]
786961 --> 409576{{"再起動するか"}}
409576 -->|"する"| 173803>"アプリ起動直後のVVPPインストール後の再起動へ"]
764022["(画面読み込み)"] --> 698565["App.vue"]
764022 --> 332024["EditorHome.vue"]
389651["back.start"] --> 733212["back.createWindow"]
733212 -.-> 764022
733212["back.createWindow"] -.-> 764022
448821>"アプリ停止中"] -.-> 430173["app.ready"]
style 448821 fill:#ffbbbb,stroke:#ff0000
430173 -->|"ある"| 174170
409576 -->|"しない"| 389651
430173 -->|"ない"| 389651
430173 -->|"ない"| 389651["back.start"]
698565 -.-> 704891>"アプリ実行中"]
style 704891 fill:#bbbbff,stroke:#0000ff
332024 -.-> 704891
786961 --> 389651
subgraph 332024["EditorHome.vue"]
709863["Vuex.GET_ENGINE_INFOS"] --> 773040["Vuex.POST_ENGINE_START"]
subgraph 773040["Vuex.POST_ENGINE_START"]
Expand All @@ -31,13 +28,19 @@ flowchart
end
end
subgraph 389651["back.start"]
250263["store.get engineSettings"] --> 222321["store.set engineSettings"]
870482["store.get registeredEngineDirs"] --> 250263
222321 --> 967432["engine.runEngineAll"]
656570["engine.fetchEngineInfos"] --> 870482
110954["engine.initializeEngineInfosAndAltPortInfo"] --> 656570
subgraph 656570["engine.fetchEngineInfos"]
267019["engine.fetchAdditionalEngineInfos"]
967432["engine.runEngineAll"] --> 733212
subgraph 733212["back.createWindow"]
613440["win.loadURL"]
end
subgraph 548965["launchEngines"]
250263["store.get engineSettings"] --> 222321["store.set engineSettings"]
870482["store.get registeredEngineDirs"] --> 250263
222321 --> 967432
656570["engine.fetchEngineInfos"] --> 870482
110954["engine.initializeEngineInfosAndAltPortInfo"] --> 656570
subgraph 656570["engine.fetchEngineInfos"]
267019["engine.fetchAdditionalEngineInfos"]
end
end
end
subgraph 430173["app.ready"]
Expand All @@ -49,7 +52,4 @@ flowchart
225701["win.show"]
end
end
subgraph 733212["back.createWindow"]
613440["win.loadURL"]
end
```
9 changes: 7 additions & 2 deletions docs/コードの歩き方.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,17 @@ flowchart LR
945949 -->|"条件2"| 871294["受動的な処理は点線\n(イベント発生など)"]
366994 --> 617606["大きい関数(subgraph)"]
871294 -.->|"発生条件"| 617606
617606 --> 314405>"なんらかの状態"]
617606 --> 230853>"シーケンスの終了"]
572391[["外に定義した関数"]] --> 314405>"なんらかの状態"]
572391 --> 230853>"シーケンスの終了"]
style 230853 fill:#bbbbff,stroke:#0000ff
617606 --> 572391
572391 ~~~|"透明な線で結んでもよし"| 513532["外に定義した関数"]
subgraph 617606["大きい関数(subgraph)"]
776462["処理開始"] --> 992786["処理終了"]
end
subgraph 513532["外に定義した関数"]
327013["処理"]
end
```

処理の prefix 一覧
Expand Down
24 changes: 24 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"dependencies": {
"@gtm-support/vue-gtm": "1.2.3",
"@quasar/extras": "1.10.10",
"async-lock": "1.4.0",
"buffer": "6.0.3",
"clone-deep": "4.0.1",
"core-js": "3.12.1",
Expand Down Expand Up @@ -72,6 +73,7 @@
"@openapitools/openapi-generator-cli": "2.3.3",
"@playwright/test": "1.32.1",
"@quasar/vite-plugin": "1.3.0",
"@types/async-lock": "1.4.0",
"@types/clone-deep": "4.0.1",
"@types/electron-devtools-installer": "2.2.2",
"@types/encoding-japanese": "1.0.18",
Expand Down
Loading

0 comments on commit da73bcd

Please sign in to comment.