Procházet zdrojové kódy

Merge pull request #8 from runhey/dev

Dev
huangrunheng před 3 roky
rodič
revize
0ec3441fdb
43 změnil soubory, kde provedl 38218 přidání a 1705 odebrání
  1. 1 0
      .gitignore
  2. 38 9
      README.md
  3. 44 1446
      config/template.json
  4. 14 1
      gui.py
  5. 1 0
      module/config/argument/setting-template.json
  6. 14 0
      module/config/config.py
  7. 1 1
      module/device/control.py
  8. 5 5
      module/device/device.py
  9. 4 4
      module/device/screenshot.py
  10. binární
      module/gui/FluentUI/fluentuiplugin.dll
  11. 1673 0
      module/gui/FluentUI/fluentuiplugin.qmltypes
  12. 1 1
      module/gui/README.md
  13. 95 0
      module/gui/context/add.py
  14. 127 0
      module/gui/context/process_manager.py
  15. 53 0
      module/gui/context/settings.py
  16. 16 3
      module/gui/fluent_app.py
  17. 63 0
      module/gui/process/script_process.py
  18. 11 0
      module/gui/qml.qrc
  19. 137 0
      module/gui/qml/Component/Add.qml
  20. 8 0
      module/gui/qml/Component/Args.qml
  21. 128 0
      module/gui/qml/Component/FComboBox.qml
  22. 39 0
      module/gui/qml/Component/FItemDelegate.qml
  23. 5 0
      module/gui/qml/Component/FluDialog.qml
  24. 146 0
      module/gui/qml/Component/Overview.qml
  25. 11 0
      module/gui/qml/Component/ScriptItem.qml
  26. 82 8
      module/gui/qml/Component/SplitPanel.qml
  27. 44 0
      module/gui/qml/Component/Taskmini.qml
  28. 9 1
      module/gui/qml/Global/ItemsFooter.qml
  29. 47 8
      module/gui/qml/Global/ItemsOriginal.qml
  30. 99 0
      module/gui/qml/Global/MainEvent.qml
  31. 17 4
      module/gui/qml/MainWindow.qml
  32. 26 0
      module/gui/qml/Page/Home.qml
  33. 19 0
      module/gui/qml/Page/O_Home.qml
  34. 5 5
      module/gui/qml/Page/O_Settings.qml
  35. 37 0
      module/gui/qml/Page/ScriptView.qml
  36. 9 0
      module/gui/qml/Page/Update.qml
  37. 1194 203
      module/gui/qml_rcc.py
  38. 1 0
      module/gui/res.qrc
  39. binární
      module/gui/res/icon.png
  40. 33927 0
      module/gui/res_rcc.py
  41. 2 1
      requirements-in.txt
  42. 16 1
      requirements.txt
  43. 49 4
      script.py

+ 1 - 0
.gitignore

@@ -24,6 +24,7 @@ test/
 *.user
 !module/gui/FluentUI/fluentuiplugin.dll
 build-fluentui-Desktop_*/
+module/config/argument/setting.json
 
 
 

+ 38 - 9
README.md

@@ -1,17 +1,46 @@
-新项目:
+欢迎大家捧场
 
-理论上是支持全平台的,但是我只有win设备
+![image-20230526205041711](https://runhey-img-stg1.oss-cn-chengdu.aliyuncs.com/img2/202305262050939.png)
 
-打算模仿alas的项目
+## 设计思路(其实大部分就是alas的设计)
 
-- ui使用这个库[FluentUI for QML](https://github.com/zhuzichu520/FluentUI), 个人发觉alas的设计思路很不错
-- 按照alas的部署 更新方式
-- ocr使用paddleocr因为cnocr对于python3.10的支持有一些问题
+<details>
+<summary></summary>
 
+- 核心
 
+  - 看上图左侧的+号,每一个被称为script实例,可以简单的理解为不同的模拟器配置或者是不同的任务配置,每个实例由一个config.json文件来驱动。config来管理任务的调度,配置任务的不同的参数。
+  - 这个脚本的目的是实现全程的7x24的接管游戏,去享受生活而不是在阴阳师这里上班,所以我也是有空更新。
+  - 对于每个任务的执行过程就是比较常规的截图(识别)+控制(点击啥的),在这里会选择和我[早期的设计](https://github.com/runhey/Uowl)一致,设计一个原子化的模块化的配置信息。比如说要识别某个图片会添加一份json数据来设置识图的范围、方式、识别的图片。点击的话也会有一份json数据配置点击的随机概率、范围等等。每一个操作都一份可格式化的配置信息,而不是同alas一样将识别图片和点击一起抽象成一个button。
+  - 噢对了我在写代码的时候命名上并没有针对oas,因此说你可以fork该项目使用到你的游戏脚本上
 
-- 2023.5.17
+- 部署方式:用的是batchfile + python(env+pip) + git 
 
-ui库目前还没完善,先做device
+  - 具体的说就是,需要先下载一个安装包里面包含一个最小python和git环境,运行后下拉仓库,完事后安装依赖,再完事后启动gui。
 
-![image-20230517184432630](https://runhey-img-stg1.oss-cn-chengdu.aliyuncs.com/img2/202305171844003.png)
+
+#### 设计架构
+
+
+- gui部分
+
+  - 用的是这个库[FluentUI for QML ](https://github.com/zhuzichu520/FluentUI).是用的qml来写,我想懂这个语言的人不多吧,跟python通信一个是靠注入上下文,另一个是靠zerorpc。
+
+- 程序入口
+
+  - 有两个根目录下的gui.py和script.py。而gui.py会根据配置文件config.json来实例化不同的script,script就是某个具体的脚本过程。
+
+- 进程
+
+  - gui启动自带一个进程,每有一个script就会继续多一个进程,单独建一个进程来提供ocr服务。一般用zerorpc来进程通信。
+
+- 运行过程
+
+  - gui 按钮点击后就会开始从script上启动服务。script持有一个设备device,一个配置config,一个任务task。这个时候调度器(其实就是config)会更新出running、pending and waiting tasks。选择runing的去执行,任务的执行过程就是一个大的状态机。
+
+#### 模块设计
+
+- config模块,主要是有一个类Config,主要是对配置的文件的接口,以及一些代码中手工配置的参数。(我还没写好从yaml到template.json和从template更新配置)
+- device模块,四个方向的功能管理模拟器,管理游戏,截图和控制
+
+</details>    

+ 44 - 1446
config/template.json

@@ -1,1449 +1,47 @@
 {
-  "Alas": {
-    "Emulator": {
-      "Serial": "auto",
-      "PackageName": "auto",
-      "ScreenshotMethod": "ADB",
-      "ControlMethod": "minitouch",
-      "ScreenshotDedithering": false,
-      "AdbRestart": false
-    },
-    "Error": {
-      "HandleError": true,
-      "SaveError": true,
-      "ScreenshotLength": 1
-    },
-    "Optimization": {
-      "ScreenshotInterval": 0.3,
-      "CombatScreenshotInterval": 1.0,
-      "TaskHoardingDuration": 0,
-      "WhenTaskQueueEmpty": "goto_main"
-    },
-    "DropRecord": {
-      "SaveFolder": "./screenshots",
-      "AzurStatsID": null,
-      "API": "default",
-      "ResearchRecord": "do_not",
-      "CommissionRecord": "do_not",
-      "CombatRecord": "do_not",
-      "OpsiRecord": "do_not",
-      "MeowfficerBuy": "do_not",
-      "MeowfficerTalent": "do_not"
-    }
-  },
-  "General": {
-    "Retirement": {
-      "Enable": true,
-      "RetireMode": "one_click_retire",
-      "RetireAmount": "retire_all",
-      "EnhanceFavourite": false,
-      "EnhanceFilter": null,
-      "EnhanceCheckPerCategory": 2,
-      "OldRetireN": true,
-      "OldRetireR": true,
-      "OldRetireSR": false,
-      "OldRetireSSR": false
-    }
-  },
-  "Restart": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Restart",
-      "SuccessInterval": 0,
-      "FailureInterval": 0,
-      "ServerUpdate": "00:00"
-    }
-  },
-  "Main": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Main",
-      "SuccessInterval": 0,
-      "FailureInterval": 120,
-      "ServerUpdate": "00:00"
-    },
-    "Campaign": {
-      "Name": "12-4",
-      "Event": "campaign_main",
-      "Mode": "normal",
-      "UseClearMode": true,
-      "UseFleetLock": true,
-      "UseAutoSearch": true,
-      "Use2xBook": false,
-      "AmbushEvade": true
-    },
-    "StopCondition": {
-      "RunCount": 0,
-      "OilLimit": 1000,
-      "MapAchievement": "non_stop",
-      "StageIncrease": false,
-      "GetNewShip": false,
-      "ReachLevel": 0
-    },
-    "Fleet": {
-      "Fleet1": 1,
-      "Fleet1Formation": "double_line",
-      "Fleet1Mode": "combat_auto",
-      "Fleet1Step": 3,
-      "Fleet2": 2,
-      "Fleet2Formation": "double_line",
-      "Fleet2Mode": "combat_auto",
-      "Fleet2Step": 2,
-      "FleetOrder": "fleet1_mob_fleet2_boss"
-    },
-    "Submarine": {
-      "Fleet": 0,
-      "Mode": "do_not_use",
-      "AutoSearchMode": "sub_standby",
-      "DistanceToBoss": "2_grid_to_boss"
-    },
-    "Emotion": {
-      "CalculateEmotion": true,
-      "IgnoreLowEmotionWarn": false,
-      "Fleet1Value": 119,
-      "Fleet1Record": "2020-01-01 00:00:00",
-      "Fleet1Control": "prevent_yellow_face",
-      "Fleet1Recover": "not_in_dormitory",
-      "Fleet1Oath": false,
-      "Fleet2Value": 119,
-      "Fleet2Record": "2020-01-01 00:00:00",
-      "Fleet2Control": "prevent_yellow_face",
-      "Fleet2Recover": "not_in_dormitory",
-      "Fleet2Oath": false
-    },
-    "HpControl": {
-      "UseHpBalance": false,
-      "UseEmergencyRepair": false,
-      "UseLowHpRetreat": false,
-      "HpBalanceThreshold": 0.2,
-      "HpBalanceWeight": "1000, 1000, 1000",
-      "RepairUseSingleThreshold": 0.3,
-      "RepairUseMultiThreshold": 0.6,
-      "LowHpRetreatThreshold": 0.3
-    },
-    "EnemyPriority": {
-      "EnemyScaleBalanceWeight": "default_mode"
-    }
-  },
-  "Main2": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Main2",
-      "SuccessInterval": 0,
-      "FailureInterval": 120,
-      "ServerUpdate": "00:00"
-    },
-    "Campaign": {
-      "Name": "12-4",
-      "Event": "campaign_main",
-      "Mode": "normal",
-      "UseClearMode": true,
-      "UseFleetLock": true,
-      "UseAutoSearch": true,
-      "Use2xBook": false,
-      "AmbushEvade": true
-    },
-    "StopCondition": {
-      "RunCount": 0,
-      "OilLimit": 1000,
-      "MapAchievement": "non_stop",
-      "StageIncrease": false,
-      "GetNewShip": false,
-      "ReachLevel": 0
-    },
-    "Fleet": {
-      "Fleet1": 1,
-      "Fleet1Formation": "double_line",
-      "Fleet1Mode": "combat_auto",
-      "Fleet1Step": 3,
-      "Fleet2": 2,
-      "Fleet2Formation": "double_line",
-      "Fleet2Mode": "combat_auto",
-      "Fleet2Step": 2,
-      "FleetOrder": "fleet1_mob_fleet2_boss"
-    },
-    "Submarine": {
-      "Fleet": 0,
-      "Mode": "do_not_use",
-      "AutoSearchMode": "sub_standby",
-      "DistanceToBoss": "2_grid_to_boss"
-    },
-    "Emotion": {
-      "CalculateEmotion": true,
-      "IgnoreLowEmotionWarn": false,
-      "Fleet1Value": 119,
-      "Fleet1Record": "2020-01-01 00:00:00",
-      "Fleet1Control": "prevent_yellow_face",
-      "Fleet1Recover": "not_in_dormitory",
-      "Fleet1Oath": false,
-      "Fleet2Value": 119,
-      "Fleet2Record": "2020-01-01 00:00:00",
-      "Fleet2Control": "prevent_yellow_face",
-      "Fleet2Recover": "not_in_dormitory",
-      "Fleet2Oath": false
-    },
-    "HpControl": {
-      "UseHpBalance": false,
-      "UseEmergencyRepair": false,
-      "UseLowHpRetreat": false,
-      "HpBalanceThreshold": 0.2,
-      "HpBalanceWeight": "1000, 1000, 1000",
-      "RepairUseSingleThreshold": 0.3,
-      "RepairUseMultiThreshold": 0.6,
-      "LowHpRetreatThreshold": 0.3
-    },
-    "EnemyPriority": {
-      "EnemyScaleBalanceWeight": "default_mode"
-    }
-  },
-  "Main3": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Main3",
-      "SuccessInterval": 0,
-      "FailureInterval": 120,
-      "ServerUpdate": "00:00"
-    },
-    "Campaign": {
-      "Name": "12-4",
-      "Event": "campaign_main",
-      "Mode": "normal",
-      "UseClearMode": true,
-      "UseFleetLock": true,
-      "UseAutoSearch": true,
-      "Use2xBook": false,
-      "AmbushEvade": true
-    },
-    "StopCondition": {
-      "RunCount": 0,
-      "OilLimit": 1000,
-      "MapAchievement": "non_stop",
-      "StageIncrease": false,
-      "GetNewShip": false,
-      "ReachLevel": 0
-    },
-    "Fleet": {
-      "Fleet1": 1,
-      "Fleet1Formation": "double_line",
-      "Fleet1Mode": "combat_auto",
-      "Fleet1Step": 3,
-      "Fleet2": 2,
-      "Fleet2Formation": "double_line",
-      "Fleet2Mode": "combat_auto",
-      "Fleet2Step": 2,
-      "FleetOrder": "fleet1_mob_fleet2_boss"
-    },
-    "Submarine": {
-      "Fleet": 0,
-      "Mode": "do_not_use",
-      "AutoSearchMode": "sub_standby",
-      "DistanceToBoss": "2_grid_to_boss"
-    },
-    "Emotion": {
-      "CalculateEmotion": true,
-      "IgnoreLowEmotionWarn": false,
-      "Fleet1Value": 119,
-      "Fleet1Record": "2020-01-01 00:00:00",
-      "Fleet1Control": "prevent_yellow_face",
-      "Fleet1Recover": "not_in_dormitory",
-      "Fleet1Oath": false,
-      "Fleet2Value": 119,
-      "Fleet2Record": "2020-01-01 00:00:00",
-      "Fleet2Control": "prevent_yellow_face",
-      "Fleet2Recover": "not_in_dormitory",
-      "Fleet2Oath": false
-    },
-    "HpControl": {
-      "UseHpBalance": false,
-      "UseEmergencyRepair": false,
-      "UseLowHpRetreat": false,
-      "HpBalanceThreshold": 0.2,
-      "HpBalanceWeight": "1000, 1000, 1000",
-      "RepairUseSingleThreshold": 0.3,
-      "RepairUseMultiThreshold": 0.6,
-      "LowHpRetreatThreshold": 0.3
-    },
-    "EnemyPriority": {
-      "EnemyScaleBalanceWeight": "default_mode"
-    }
-  },
-  "GemsFarming": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "GemsFarming",
-      "SuccessInterval": 0,
-      "FailureInterval": 120,
-      "ServerUpdate": "00:00"
-    },
-    "GemsFarming": {
-      "FlagshipChange": true,
-      "FlagshipEquipChange": false,
-      "VanguardChange": false,
-      "VanguardEquipChange": false,
-      "LowEmotionRetreat": true,
-      "CommonCV": "any"
-    },
-    "Campaign": {
-      "Name": "12-4",
-      "Event": "campaign_main",
-      "Mode": "normal",
-      "UseClearMode": true,
-      "UseFleetLock": true,
-      "UseAutoSearch": true,
-      "Use2xBook": false,
-      "AmbushEvade": true
-    },
-    "StopCondition": {
-      "RunCount": 0,
-      "OilLimit": 1000,
-      "MapAchievement": "non_stop",
-      "StageIncrease": false,
-      "GetNewShip": false,
-      "ReachLevel": 0
-    },
-    "Fleet": {
-      "Fleet1": 1,
-      "Fleet1Formation": "double_line",
-      "Fleet1Mode": "combat_auto",
-      "Fleet1Step": 3,
-      "Fleet2": 2,
-      "Fleet2Formation": "double_line",
-      "Fleet2Mode": "combat_auto",
-      "Fleet2Step": 2,
-      "FleetOrder": "fleet1_mob_fleet2_boss"
-    },
-    "Emotion": {
-      "CalculateEmotion": true,
-      "IgnoreLowEmotionWarn": false,
-      "Fleet1Value": 119,
-      "Fleet1Record": "2020-01-01 00:00:00",
-      "Fleet1Control": "prevent_yellow_face",
-      "Fleet1Recover": "not_in_dormitory",
-      "Fleet1Oath": false,
-      "Fleet2Value": 119,
-      "Fleet2Record": "2020-01-01 00:00:00",
-      "Fleet2Control": "prevent_yellow_face",
-      "Fleet2Recover": "not_in_dormitory",
-      "Fleet2Oath": false
-    },
-    "EnemyPriority": {
-      "EnemyScaleBalanceWeight": "default_mode"
-    }
-  },
-  "EventGeneral": {
-    "EventGeneral": {
-      "PtLimit": 0,
-      "TimeLimit": "2020-01-01 00:00:00"
-    }
-  },
-  "Event": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Event",
-      "SuccessInterval": 0,
-      "FailureInterval": 120,
-      "ServerUpdate": "00:00"
-    },
-    "Campaign": {
-      "Name": "12-4",
-      "Event": "campaign_main",
-      "Mode": "normal",
-      "UseClearMode": true,
-      "UseFleetLock": true,
-      "UseAutoSearch": true,
-      "Use2xBook": false,
-      "AmbushEvade": true
-    },
-    "StopCondition": {
-      "RunCount": 0,
-      "OilLimit": 1000,
-      "MapAchievement": "non_stop",
-      "StageIncrease": false,
-      "GetNewShip": false,
-      "ReachLevel": 0
-    },
-    "Fleet": {
-      "Fleet1": 1,
-      "Fleet1Formation": "double_line",
-      "Fleet1Mode": "combat_auto",
-      "Fleet1Step": 3,
-      "Fleet2": 2,
-      "Fleet2Formation": "double_line",
-      "Fleet2Mode": "combat_auto",
-      "Fleet2Step": 2,
-      "FleetOrder": "fleet1_mob_fleet2_boss"
-    },
-    "Submarine": {
-      "Fleet": 0,
-      "Mode": "do_not_use",
-      "AutoSearchMode": "sub_standby",
-      "DistanceToBoss": "2_grid_to_boss"
-    },
-    "Emotion": {
-      "CalculateEmotion": true,
-      "IgnoreLowEmotionWarn": false,
-      "Fleet1Value": 119,
-      "Fleet1Record": "2020-01-01 00:00:00",
-      "Fleet1Control": "prevent_yellow_face",
-      "Fleet1Recover": "not_in_dormitory",
-      "Fleet1Oath": false,
-      "Fleet2Value": 119,
-      "Fleet2Record": "2020-01-01 00:00:00",
-      "Fleet2Control": "prevent_yellow_face",
-      "Fleet2Recover": "not_in_dormitory",
-      "Fleet2Oath": false
-    },
-    "HpControl": {
-      "UseHpBalance": false,
-      "UseEmergencyRepair": false,
-      "UseLowHpRetreat": false,
-      "HpBalanceThreshold": 0.2,
-      "HpBalanceWeight": "1000, 1000, 1000",
-      "RepairUseSingleThreshold": 0.3,
-      "RepairUseMultiThreshold": 0.6,
-      "LowHpRetreatThreshold": 0.3
-    },
-    "EnemyPriority": {
-      "EnemyScaleBalanceWeight": "default_mode"
-    }
-  },
-  "Event2": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Event2",
-      "SuccessInterval": 0,
-      "FailureInterval": 120,
-      "ServerUpdate": "00:00"
-    },
-    "Campaign": {
-      "Name": "12-4",
-      "Event": "campaign_main",
-      "Mode": "normal",
-      "UseClearMode": true,
-      "UseFleetLock": true,
-      "UseAutoSearch": true,
-      "Use2xBook": false,
-      "AmbushEvade": true
-    },
-    "StopCondition": {
-      "RunCount": 0,
-      "OilLimit": 1000,
-      "MapAchievement": "non_stop",
-      "StageIncrease": false,
-      "GetNewShip": false,
-      "ReachLevel": 0
-    },
-    "Fleet": {
-      "Fleet1": 1,
-      "Fleet1Formation": "double_line",
-      "Fleet1Mode": "combat_auto",
-      "Fleet1Step": 3,
-      "Fleet2": 2,
-      "Fleet2Formation": "double_line",
-      "Fleet2Mode": "combat_auto",
-      "Fleet2Step": 2,
-      "FleetOrder": "fleet1_mob_fleet2_boss"
-    },
-    "Submarine": {
-      "Fleet": 0,
-      "Mode": "do_not_use",
-      "AutoSearchMode": "sub_standby",
-      "DistanceToBoss": "2_grid_to_boss"
-    },
-    "Emotion": {
-      "CalculateEmotion": true,
-      "IgnoreLowEmotionWarn": false,
-      "Fleet1Value": 119,
-      "Fleet1Record": "2020-01-01 00:00:00",
-      "Fleet1Control": "prevent_yellow_face",
-      "Fleet1Recover": "not_in_dormitory",
-      "Fleet1Oath": false,
-      "Fleet2Value": 119,
-      "Fleet2Record": "2020-01-01 00:00:00",
-      "Fleet2Control": "prevent_yellow_face",
-      "Fleet2Recover": "not_in_dormitory",
-      "Fleet2Oath": false
-    },
-    "HpControl": {
-      "UseHpBalance": false,
-      "UseEmergencyRepair": false,
-      "UseLowHpRetreat": false,
-      "HpBalanceThreshold": 0.2,
-      "HpBalanceWeight": "1000, 1000, 1000",
-      "RepairUseSingleThreshold": 0.3,
-      "RepairUseMultiThreshold": 0.6,
-      "LowHpRetreatThreshold": 0.3
-    },
-    "EnemyPriority": {
-      "EnemyScaleBalanceWeight": "default_mode"
-    }
-  },
-  "EventAb": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "EventAb",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "EventAb": {
-      "StageFilter": "A1 > A2 > A3 > B1 > B2 > B3",
-      "LastStage": 0
-    },
-    "Campaign": {
-      "Name": "dynamic",
-      "Event": "campaign_main",
-      "Mode": "normal",
-      "UseClearMode": true,
-      "UseFleetLock": true,
-      "UseAutoSearch": true,
-      "Use2xBook": false,
-      "AmbushEvade": true
-    },
-    "StopCondition": {
-      "RunCount": 0,
-      "OilLimit": 1000,
-      "MapAchievement": "non_stop",
-      "StageIncrease": false,
-      "GetNewShip": false,
-      "ReachLevel": 0
-    },
-    "Fleet": {
-      "Fleet1": 1,
-      "Fleet1Formation": "double_line",
-      "Fleet1Mode": "combat_auto",
-      "Fleet1Step": 3,
-      "Fleet2": 2,
-      "Fleet2Formation": "double_line",
-      "Fleet2Mode": "combat_auto",
-      "Fleet2Step": 2,
-      "FleetOrder": "fleet1_mob_fleet2_boss"
-    },
-    "Submarine": {
-      "Fleet": 0,
-      "Mode": "do_not_use",
-      "AutoSearchMode": "sub_standby",
-      "DistanceToBoss": "2_grid_to_boss"
-    },
-    "Emotion": {
-      "CalculateEmotion": true,
-      "IgnoreLowEmotionWarn": false,
-      "Fleet1Value": 119,
-      "Fleet1Record": "2020-01-01 00:00:00",
-      "Fleet1Control": "prevent_yellow_face",
-      "Fleet1Recover": "not_in_dormitory",
-      "Fleet1Oath": false,
-      "Fleet2Value": 119,
-      "Fleet2Record": "2020-01-01 00:00:00",
-      "Fleet2Control": "prevent_yellow_face",
-      "Fleet2Recover": "not_in_dormitory",
-      "Fleet2Oath": false
-    },
-    "HpControl": {
-      "UseHpBalance": false,
-      "UseEmergencyRepair": false,
-      "UseLowHpRetreat": false,
-      "HpBalanceThreshold": 0.2,
-      "HpBalanceWeight": "1000, 1000, 1000",
-      "RepairUseSingleThreshold": 0.3,
-      "RepairUseMultiThreshold": 0.6,
-      "LowHpRetreatThreshold": 0.3
-    }
-  },
-  "EventCd": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "EventCd",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "EventCd": {
-      "StageFilter": "C1 > C2 > C3 > D1 > D2 > D3",
-      "LastStage": 0
-    },
-    "Campaign": {
-      "Name": "dynamic",
-      "Event": "campaign_main",
-      "Mode": "normal",
-      "UseClearMode": true,
-      "UseFleetLock": true,
-      "UseAutoSearch": true,
-      "Use2xBook": false,
-      "AmbushEvade": true
-    },
-    "StopCondition": {
-      "RunCount": 0,
-      "OilLimit": 1000,
-      "MapAchievement": "non_stop",
-      "StageIncrease": false,
-      "GetNewShip": false,
-      "ReachLevel": 0
-    },
-    "Fleet": {
-      "Fleet1": 1,
-      "Fleet1Formation": "double_line",
-      "Fleet1Mode": "combat_auto",
-      "Fleet1Step": 3,
-      "Fleet2": 2,
-      "Fleet2Formation": "double_line",
-      "Fleet2Mode": "combat_auto",
-      "Fleet2Step": 2,
-      "FleetOrder": "fleet1_mob_fleet2_boss"
-    },
-    "Submarine": {
-      "Fleet": 0,
-      "Mode": "do_not_use",
-      "AutoSearchMode": "sub_standby",
-      "DistanceToBoss": "2_grid_to_boss"
-    },
-    "Emotion": {
-      "CalculateEmotion": true,
-      "IgnoreLowEmotionWarn": false,
-      "Fleet1Value": 119,
-      "Fleet1Record": "2020-01-01 00:00:00",
-      "Fleet1Control": "prevent_yellow_face",
-      "Fleet1Recover": "not_in_dormitory",
-      "Fleet1Oath": false,
-      "Fleet2Value": 119,
-      "Fleet2Record": "2020-01-01 00:00:00",
-      "Fleet2Control": "prevent_yellow_face",
-      "Fleet2Recover": "not_in_dormitory",
-      "Fleet2Oath": false
-    },
-    "HpControl": {
-      "UseHpBalance": false,
-      "UseEmergencyRepair": false,
-      "UseLowHpRetreat": false,
-      "HpBalanceThreshold": 0.2,
-      "HpBalanceWeight": "1000, 1000, 1000",
-      "RepairUseSingleThreshold": 0.3,
-      "RepairUseMultiThreshold": 0.6,
-      "LowHpRetreatThreshold": 0.3
-    }
-  },
-  "EventSp": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "EventSp",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "Campaign": {
-      "Name": "sp",
-      "Event": "campaign_main",
-      "Mode": "normal",
-      "UseClearMode": true,
-      "UseFleetLock": true,
-      "UseAutoSearch": true,
-      "Use2xBook": false,
-      "AmbushEvade": true
-    },
-    "StopCondition": {
-      "RunCount": 0,
-      "OilLimit": 1000,
-      "MapAchievement": "non_stop",
-      "StageIncrease": false,
-      "GetNewShip": false,
-      "ReachLevel": 0
-    },
-    "Fleet": {
-      "Fleet1": 1,
-      "Fleet1Formation": "double_line",
-      "Fleet1Mode": "combat_auto",
-      "Fleet1Step": 3,
-      "Fleet2": 2,
-      "Fleet2Formation": "double_line",
-      "Fleet2Mode": "combat_auto",
-      "Fleet2Step": 2,
-      "FleetOrder": "fleet1_mob_fleet2_boss"
-    },
-    "Submarine": {
-      "Fleet": 0,
-      "Mode": "do_not_use",
-      "AutoSearchMode": "sub_standby",
-      "DistanceToBoss": "2_grid_to_boss"
-    },
-    "Emotion": {
-      "CalculateEmotion": true,
-      "IgnoreLowEmotionWarn": false,
-      "Fleet1Value": 119,
-      "Fleet1Record": "2020-01-01 00:00:00",
-      "Fleet1Control": "prevent_yellow_face",
-      "Fleet1Recover": "not_in_dormitory",
-      "Fleet1Oath": false,
-      "Fleet2Value": 119,
-      "Fleet2Record": "2020-01-01 00:00:00",
-      "Fleet2Control": "prevent_yellow_face",
-      "Fleet2Recover": "not_in_dormitory",
-      "Fleet2Oath": false
-    },
-    "HpControl": {
-      "UseHpBalance": false,
-      "UseEmergencyRepair": false,
-      "UseLowHpRetreat": false,
-      "HpBalanceThreshold": 0.2,
-      "HpBalanceWeight": "1000, 1000, 1000",
-      "RepairUseSingleThreshold": 0.3,
-      "RepairUseMultiThreshold": 0.6,
-      "LowHpRetreatThreshold": 0.3
-    }
-  },
-  "Raid": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Raid",
-      "SuccessInterval": 0,
-      "FailureInterval": 120,
-      "ServerUpdate": "00:00"
-    },
-    "Raid": {
-      "Mode": "hard",
-      "UseTicket": false
-    },
-    "Campaign": {
-      "Name": "dynamic",
-      "Event": "campaign_main",
-      "Mode": "normal",
-      "UseClearMode": true,
-      "UseFleetLock": true,
-      "UseAutoSearch": false,
-      "Use2xBook": false,
-      "AmbushEvade": true
-    },
-    "StopCondition": {
-      "RunCount": 0,
-      "OilLimit": 1000,
-      "MapAchievement": "non_stop",
-      "StageIncrease": false,
-      "GetNewShip": false,
-      "ReachLevel": 0
-    },
-    "Emotion": {
-      "CalculateEmotion": true,
-      "IgnoreLowEmotionWarn": false,
-      "Fleet1Value": 119,
-      "Fleet1Record": "2020-01-01 00:00:00",
-      "Fleet1Control": "prevent_yellow_face",
-      "Fleet1Recover": "not_in_dormitory",
-      "Fleet1Oath": false,
-      "Fleet2Value": 119,
-      "Fleet2Record": "2020-01-01 00:00:00",
-      "Fleet2Control": "prevent_yellow_face",
-      "Fleet2Recover": "not_in_dormitory",
-      "Fleet2Oath": false
-    }
-  },
-  "RaidDaily": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "RaidDaily",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "RaidDaily": {
-      "StageFilter": "hard > normal > easy"
-    },
-    "Campaign": {
-      "Name": "dynamic",
-      "Event": "campaign_main",
-      "Mode": "normal",
-      "UseClearMode": true,
-      "UseFleetLock": true,
-      "UseAutoSearch": false,
-      "Use2xBook": false,
-      "AmbushEvade": true
-    },
-    "StopCondition": {
-      "RunCount": 0,
-      "OilLimit": 1000,
-      "MapAchievement": "non_stop",
-      "StageIncrease": false,
-      "GetNewShip": false,
-      "ReachLevel": 0
-    },
-    "Emotion": {
-      "CalculateEmotion": true,
-      "IgnoreLowEmotionWarn": false,
-      "Fleet1Value": 119,
-      "Fleet1Record": "2020-01-01 00:00:00",
-      "Fleet1Control": "prevent_yellow_face",
-      "Fleet1Recover": "not_in_dormitory",
-      "Fleet1Oath": false,
-      "Fleet2Value": 119,
-      "Fleet2Record": "2020-01-01 00:00:00",
-      "Fleet2Control": "prevent_yellow_face",
-      "Fleet2Recover": "not_in_dormitory",
-      "Fleet2Oath": false
-    }
-  },
-  "MaritimeEscort": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "MaritimeEscort",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "MaritimeEscort": {
-      "Enable": true
-    }
-  },
-  "Commission": {
-    "Scheduler": {
-      "Enable": true,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Commission",
-      "SuccessInterval": "30-60",
-      "FailureInterval": "30-60",
-      "ServerUpdate": "00:00"
-    },
-    "Commission": {
-      "DoMajorCommission": false,
-      "CommissionFilter": "DailyEvent\n> Gem-8 > Gem-4 > Gem-2\n> NightDrill-8 > NightDrill-7 > NightDrill-6\n> ExtraDrill-0:20 > ExtraDrill-1 > ExtraDrill-2 > ExtraDrill-2:40 > ExtraDrill-3:20 > ExtraDrill-5:20\n> Box-6 > Box-3 > Box-1\n> DailyCube-0:30 > UrgentCube-1:30 > DailyCube-1:30 > UrgentCube-1:45 > UrgentCube-2:15 > UrgentCube-3\n> Major\n> DailyChip > DailyResource\n> UrgentBook-2:30 > UrgentBook-2 > UrgentBook-1:20 > UrgentBook-1:40\n> Daily-0:20 > Daily-0:30 > Daily-1:00 > Daily-1:30 > Daily-2:00\n> NightOil > NightCube\n> shortest"
-    }
-  },
-  "Tactical": {
-    "Scheduler": {
-      "Enable": true,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Tactical",
-      "SuccessInterval": "30-60",
-      "FailureInterval": "120-240",
-      "ServerUpdate": "00:00"
-    },
-    "Tactical": {
-      "TacticalFilter": "SameT4 > SameT3 > SameT2 > SameT1\n> BlueT2 > YellowT2 > RedT2\n> BlueT3 > YellowT3 > RedT3\n> BlueT4 > YellowT4 > RedT4\n> BlueT1 > YellowT1 > RedT1\n> first"
-    },
-    "ControlExpOverflow": {
-      "Enable": true,
-      "T4Allow": 100,
-      "T3Allow": 100,
-      "T2Allow": 200,
-      "T1Allow": 200
-    }
-  },
-  "Research": {
-    "Scheduler": {
-      "Enable": true,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Research",
-      "SuccessInterval": "30-60",
-      "FailureInterval": "30-60",
-      "ServerUpdate": "00:00"
-    },
-    "Research": {
-      "UseCube": "only_05_hour",
-      "UseCoin": "always_use",
-      "UsePart": "always_use",
-      "PresetFilter": "series_4_blueprint_tenrai",
-      "CustomFilter": "S4-Q0.5 > Q-0.5 > S4-DR0.5 > S4-PRY0.5 > DR-0.5 > PRY-0.5\n> S4-Q1 > S4-Q2\n> S4-DR2.5 > S4-G1.5\n> S4-Q4 > S4-H0.5 > S4-G4\n> S4-PRY2.5 > S4-G2.5\n> reset > S4-H1 > shortest"
-    }
-  },
-  "Dorm": {
-    "Scheduler": {
-      "Enable": true,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Dorm",
-      "SuccessInterval": 278,
-      "FailureInterval": 278,
-      "ServerUpdate": "00:00"
-    },
-    "Dorm": {
-      "Collect": true,
-      "Feed": true,
-      "FeedFilter": "20000 > 10000 > 5000 > 3000 > 2000 > 1000"
-    }
-  },
-  "Meowfficer": {
-    "Scheduler": {
-      "Enable": true,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Meowfficer",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "Meowfficer": {
-      "BuyAmount": 1,
-      "FortChoreMeowfficer": true
-    },
-    "MeowfficerTrain": {
-      "Enable": false,
-      "Mode": "seamlessly",
-      "RetainTalentedGold": true,
-      "RetainTalentedPurple": true,
-      "EnhanceIndex": 1
-    }
-  },
-  "Guild": {
-    "Scheduler": {
-      "Enable": true,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Guild",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00, 06:00, 12:00, 18:00, 21:00"
-    },
-    "GuildLogistics": {
-      "Enable": true,
-      "SelectNewMission": false,
-      "ExchangeFilter": "PlateTorpedoT1 > PlateAntiAirT1 > PlatePlaneT1 > PlateGunT1 > PlateGeneralT1\n> PlateTorpedoT2 > PlateAntiAirT2 > PlatePlaneT2 > PlateGunT2 > PlateGeneralT2\n> PlateTorpedoT3 > PlateAntiAirT3 > PlatePlaneT3 > PlateGunT3 > PlateGeneralT3\n> OxyCola > Coolant > Merit > Coin > Oil"
-    },
-    "GuildOperation": {
-      "Enable": true,
-      "SelectNewOperation": false,
-      "NewOperationMaxDate": 15,
-      "JoinThreshold": 1,
-      "AttackBoss": true,
-      "BossFleetRecommend": false
-    }
-  },
-  "Reward": {
-    "Scheduler": {
-      "Enable": true,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Reward",
-      "SuccessInterval": "120-240",
-      "FailureInterval": "120-240",
-      "ServerUpdate": "00:00"
-    },
-    "Reward": {
-      "CollectOil": true,
-      "CollectCoin": true,
-      "CollectExp": true,
-      "CollectMission": true,
-      "CollectWeeklyMission": true
-    }
-  },
-  "ShopFrequent": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "ShopFrequent",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00, 12:00, 18:00"
-    },
-    "GeneralShop": {
-      "UseGems": false,
-      "Refresh": false,
-      "BuySkinBox": false,
-      "Filter": "BookRedT3 > BookYellowT3 > BookBlueT3 > BookRedT2\n> Cube\n> FoodT6 > FoodT5"
-    }
-  },
-  "ShopOnce": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "ShopOnce",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "GuildShop": {
-      "Refresh": true,
-      "Filter": "PlateT4 > BookT3 > PR > CatT3 > Chip > BookT2 > Retrofit > FoodT6 > FoodT5 > CatT2 > BoxT4",
-      "BOX_T3": "ironblood",
-      "BOX_T4": "ironblood",
-      "BOOK_T2": "red",
-      "BOOK_T3": "red",
-      "RETROFIT_T2": "cl",
-      "RETROFIT_T3": "cl",
-      "PLATE_T2": "general",
-      "PLATE_T3": "general",
-      "PLATE_T4": "gun",
-      "PR1": "neptune",
-      "PR2": "seattle",
-      "PR3": "cheshire"
-    },
-    "MedalShop2": {
-      "Filter": "DR > PR\n> BookRedT3 > BookYellowT3 > BookBlueT3\n> BookRedT2 > BookYellowT2 > BookBlueT2\n> RetrofitT3\n> FoodT6 > FoodT5\n> PlateGeneralT3 > PlateWildT3",
-      "RETROFIT_T1": "cl",
-      "RETROFIT_T2": "cl",
-      "RETROFIT_T3": "cl",
-      "PLATE_T1": "general",
-      "PLATE_T2": "general",
-      "PLATE_T3": "general"
-    },
-    "MeritShop": {
-      "Refresh": false,
-      "Filter": "Cube"
-    },
-    "CoreShop": {
-      "Filter": "Array"
-    }
-  },
-  "Shipyard": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Shipyard",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "04:00"
-    },
-    "Shipyard": {
-      "ResearchSeries": 1,
-      "ShipIndex": 0,
-      "BuyAmount": 2
-    }
-  },
-  "Gacha": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Gacha",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "Gacha": {
-      "Pool": "light",
-      "Amount": 1,
-      "UseDrill": false
-    }
-  },
-  "DataKey": {
-    "Scheduler": {
-      "Enable": true,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "DataKey",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    }
-  },
-  "SupplyPack": {
-    "Scheduler": {
-      "Enable": true,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "SupplyPack",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "SupplyPack": {
-      "WeeklyFreeSupplyPack": true
-    }
-  },
-  "BattlePass": {
-    "Scheduler": {
-      "Enable": true,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "BattlePass",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "BattlePass": {
-      "BattlePassReward": true
-    }
-  },
-  "MetaReward": {
-    "Scheduler": {
-      "Enable": true,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "MetaReward",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "MetaReward": {
-      "MetaReward": true
-    }
-  },
-  "Daily": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Daily",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "Daily": {
-      "UseDailySkip": true,
-      "EscortMission": "first",
-      "EscortMissionFleet": 5,
-      "AdvanceMission": "first",
-      "AdvanceMissionFleet": 5,
-      "FierceAssault": "first",
-      "FierceAssaultFleet": 5,
-      "TacticalTraining": "second",
-      "TacticalTrainingFleet": 5,
-      "SupplyLineDisruption": "second",
-      "ModuleDevelopment": "first",
-      "ModuleDevelopmentFleet": 5
-    }
-  },
-  "Hard": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Hard",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "Hard": {
-      "HardStage": "11-4",
-      "HardFleet": 1
-    }
-  },
-  "Exercise": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Exercise",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00, 12:00, 18:00"
-    },
-    "Exercise": {
-      "OpponentChooseMode": "max_exp",
-      "OpponentTrial": 1,
-      "ExercisePreserve": 0,
-      "LowHpThreshold": 0.4,
-      "LowHpConfirmWait": 0.1,
-      "OpponentRefreshValue": 0,
-      "OpponentRefreshRecord": "2020-01-01 00:00:00"
-    }
-  },
-  "Sos": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Sos",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "Sos": {
-      "Chapter": 3
-    },
-    "Campaign": {
-      "Name": "dynamic",
-      "Event": "campaign_main",
-      "Mode": "normal",
-      "UseClearMode": true,
-      "UseFleetLock": true,
-      "UseAutoSearch": false,
-      "Use2xBook": false,
-      "AmbushEvade": true
-    },
-    "StopCondition": {
-      "RunCount": 0,
-      "OilLimit": 1000,
-      "MapAchievement": "non_stop",
-      "StageIncrease": false,
-      "GetNewShip": false,
-      "ReachLevel": 0
-    },
-    "Fleet": {
-      "Fleet1": 1,
-      "Fleet1Formation": "double_line",
-      "Fleet1Mode": "combat_auto",
-      "Fleet1Step": 3,
-      "Fleet2": 2,
-      "Fleet2Formation": "double_line",
-      "Fleet2Mode": "combat_auto",
-      "Fleet2Step": 2,
-      "FleetOrder": "fleet1_mob_fleet2_boss"
-    },
-    "Submarine": {
-      "Fleet": 0,
-      "Mode": "do_not_use",
-      "AutoSearchMode": "sub_standby",
-      "DistanceToBoss": "2_grid_to_boss"
-    },
-    "Emotion": {
-      "CalculateEmotion": true,
-      "IgnoreLowEmotionWarn": false,
-      "Fleet1Value": 119,
-      "Fleet1Record": "2020-01-01 00:00:00",
-      "Fleet1Control": "prevent_yellow_face",
-      "Fleet1Recover": "not_in_dormitory",
-      "Fleet1Oath": false,
-      "Fleet2Value": 119,
-      "Fleet2Record": "2020-01-01 00:00:00",
-      "Fleet2Control": "prevent_yellow_face",
-      "Fleet2Recover": "not_in_dormitory",
-      "Fleet2Oath": false
-    },
-    "HpControl": {
-      "UseHpBalance": false,
-      "UseEmergencyRepair": false,
-      "UseLowHpRetreat": false,
-      "HpBalanceThreshold": 0.2,
-      "HpBalanceWeight": "1000, 1000, 1000",
-      "RepairUseSingleThreshold": 0.3,
-      "RepairUseMultiThreshold": 0.6,
-      "LowHpRetreatThreshold": 0.3
-    }
-  },
-  "WarArchives": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "WarArchives",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "Campaign": {
-      "Name": "12-4",
-      "Event": "war_archives_20210325_cn",
-      "Mode": "normal",
-      "UseClearMode": true,
-      "UseFleetLock": true,
-      "UseAutoSearch": true,
-      "Use2xBook": false,
-      "AmbushEvade": true
-    },
-    "StopCondition": {
-      "RunCount": 0,
-      "OilLimit": 1000,
-      "MapAchievement": "non_stop",
-      "StageIncrease": false,
-      "GetNewShip": false,
-      "ReachLevel": 0
-    },
-    "Fleet": {
-      "Fleet1": 1,
-      "Fleet1Formation": "double_line",
-      "Fleet1Mode": "combat_auto",
-      "Fleet1Step": 3,
-      "Fleet2": 2,
-      "Fleet2Formation": "double_line",
-      "Fleet2Mode": "combat_auto",
-      "Fleet2Step": 2,
-      "FleetOrder": "fleet1_mob_fleet2_boss"
-    },
-    "Submarine": {
-      "Fleet": 0,
-      "Mode": "do_not_use",
-      "AutoSearchMode": "sub_standby",
-      "DistanceToBoss": "2_grid_to_boss"
-    },
-    "Emotion": {
-      "CalculateEmotion": true,
-      "IgnoreLowEmotionWarn": false,
-      "Fleet1Value": 119,
-      "Fleet1Record": "2020-01-01 00:00:00",
-      "Fleet1Control": "prevent_yellow_face",
-      "Fleet1Recover": "not_in_dormitory",
-      "Fleet1Oath": false,
-      "Fleet2Value": 119,
-      "Fleet2Record": "2020-01-01 00:00:00",
-      "Fleet2Control": "prevent_yellow_face",
-      "Fleet2Recover": "not_in_dormitory",
-      "Fleet2Oath": false
-    },
-    "HpControl": {
-      "UseHpBalance": false,
-      "UseEmergencyRepair": false,
-      "UseLowHpRetreat": false,
-      "HpBalanceThreshold": 0.2,
-      "HpBalanceWeight": "1000, 1000, 1000",
-      "RepairUseSingleThreshold": 0.3,
-      "RepairUseMultiThreshold": 0.6,
-      "LowHpRetreatThreshold": 0.3
-    }
-  },
-  "OpsiGeneral": {
-    "OpsiGeneral": {
-      "UseLogger": true,
-      "BuyActionPoint": false,
-      "OilLimit": 1000,
-      "RepairThreshold": 0.4,
-      "DoRandomMapEvent": true,
-      "AkashiShopFilter": "ActionPoint > PurpleCoins"
-    },
-    "OpsiAshBeacon": {
-      "AshAttack": true,
-      "EnsureFullyCollected": true,
-      "RequestAssist": true
-    }
-  },
-  "OpsiAshAssist": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "OpsiAshAssist",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "OpsiAshAssist": {
-      "Tier": 15
-    }
-  },
-  "OpsiExplore": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "OpsiExplore",
-      "SuccessInterval": 0,
-      "FailureInterval": 0,
-      "ServerUpdate": "00:00"
-    },
-    "OpsiExplore": {
-      "SpecialRadar": false,
-      "ForceRun": false,
-      "LastZone": 0
-    },
-    "OpsiFleet": {
-      "Fleet": 1,
-      "Submarine": false
-    }
-  },
-  "OpsiShop": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "OpsiShop",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "OpsiShop": {
-      "BuySupply": true
-    }
-  },
-  "OpsiDaily": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "OpsiDaily",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "OpsiDaily": {
-      "DoMission": true,
-      "UseTuningSample": true
-    },
-    "OpsiFleet": {
-      "Fleet": 1,
-      "Submarine": false
-    }
-  },
-  "OpsiObscure": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "OpsiObscure",
-      "SuccessInterval": 60,
-      "FailureInterval": 60,
-      "ServerUpdate": "00:00"
-    },
-    "OpsiObscure": {
-      "ForceRun": false
-    },
-    "OpsiFleet": {
-      "Fleet": 1,
-      "Submarine": false
-    }
-  },
-  "OpsiAbyssal": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "OpsiAbyssal",
-      "SuccessInterval": 60,
-      "FailureInterval": 60,
-      "ServerUpdate": "00:00"
-    },
-    "OpsiAbyssal": {
-      "ForceRun": false
-    },
-    "OpsiFleetFilter": {
-      "Filter": "Fleet-4 > CallSubmarine > Fleet-2 > Fleet-3 > Fleet-1"
-    }
-  },
-  "OpsiStronghold": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "OpsiStronghold",
-      "SuccessInterval": 60,
-      "FailureInterval": 60,
-      "ServerUpdate": "00:00"
-    },
-    "OpsiStronghold": {
-      "ForceRun": false
-    },
-    "OpsiFleetFilter": {
-      "Filter": "Fleet-4 > CallSubmarine > Fleet-2 > Fleet-3 > Fleet-1"
-    }
-  },
-  "OpsiMeowfficerFarming": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "OpsiMeowfficerFarming",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "OpsiMeowfficerFarming": {
-      "ActionPointPreserve": 500,
-      "HazardLevel": 5,
-      "TargetZone": 0
-    },
-    "OpsiFleet": {
-      "Fleet": 1,
-      "Submarine": false
-    }
-  },
-  "Daemon": {
-    "Daemon": {
-      "EnterMap": true
-    }
-  },
-  "OpsiDaemon": {
-    "OpsiDaemon": {
-      "RepairShip": true,
-      "SelectEnemy": true
-    }
-  },
-  "Benchmark": {
-    "Benchmark": {
-      "AdbScreenshot": true,
-      "AdbncScreenshot": true,
-      "Uiautomator2Screenshot": true,
-      "AscreencapScreenshot": true,
-      "AscreencapncScreenshot": true,
-      "AdbClick": true,
-      "Uiautomator2Click": true,
-      "MinitouchClick": true,
-      "HermitClick": false
-    }
-  },
-  "AzurLaneUncensored": {
-    "AzurLaneUncensored": {
-      "Repository": "https://gitee.com/LmeSzinc/AzurLaneUncensored"
-    }
-  },
-  "GameManager": {
-    "GameManager": {
-      "AutoRestart": true
+    "Script":{
+        "Device":{
+            "Serial": "127.0.0.1:7555",
+            "Handle":"auto",
+            "PackageName":"auto",
+            "ScreenshotMethod": "ADB",
+            "ControlMethod": "minitouch",
+            "AdbRestart": false
+        },
+        "Error": {
+            "HandleError": true,
+            "SaveError": true,
+            "ScreenshotLength": 1
+          },
+        "Optimization": {
+              "ScreenshotInterval": 0.3,
+              "CombatScreenshotInterval": 1.0,
+              "TaskHoardingDuration": 0,
+              "WhenTaskQueueEmpty": "goto_home"
+    	}
+    },
+    "General": {
+        "Retirement": {
+          "Enable": true,
+          "RetireMode": "one_click_retire",
+          "RetireAmount": "retire_all",
+          "EnhanceFavourite": false,
+          "EnhanceFilter": null,
+          "EnhanceCheckPerCategory": 2,
+          "OldRetireN": true,
+          "OldRetireR": true,
+          "OldRetireSR": false,
+          "OldRetireSSR": false
+        }
+      },
+    "Restart": {
+        "Scheduler": {
+            "Enable": false,
+            "NextRun": "2021-01-01 00:00:00",
+            "Command": "Restart",
+            "SuccessInterval": 0,
+            "FailureInterval": 0,
+            "ServerUpdate": "00:00"
+        }
     }
-  }
 }

+ 14 - 1
gui.py

@@ -2,10 +2,23 @@
 # @author runhey
 # github https://github.com/runhey
 
+from module.gui.context.add import Add
+from module.gui.context.settings import Setting
+from module.gui.context.process_manager import ProcessManager
 from module.gui.fluent_app import FluentApp
 
 if __name__ == "__main__":
     # 检查是不是以管理员身份运行,脚本启动的其他进程会继承权限
+
     # 启动一个UI交互的线程,因为信号槽不可跨进程
+    # 后面选择注入上下文快
+    app = FluentApp()
+    add_config = Add()
+    setting = Setting()
+    process_manager = ProcessManager()
+
+    app.set_context_property(setting, 'setting')
+    app.set_context_property(add_config, 'add_config')
+    app.set_context_property(process_manager, 'process_manager')
     # 启动一个GUI
-    FluentApp().run()
+    app.run()

+ 1 - 0
module/config/argument/setting-template.json

@@ -0,0 +1 @@
+{"displayMode":1,"darkMode":2,"primaryColor":"Yellow","nativeText":true,"language":"zh-CN"}

+ 14 - 0
module/config/config.py

@@ -25,6 +25,7 @@ class Config(ConfigManual, ConfigWatcher, ConfigUpdater):
         """
         self.config_name = config_name
         self.data: dict = {}
+        self.is_template_config = config_name.startswith("template")
 
         self.load()
 
@@ -46,6 +47,19 @@ class Config(ConfigManual, ConfigWatcher, ConfigUpdater):
         except:
             logger.exception(f'have no arg {task}.{group}.{argument}')
 
+    def set_arg(self, task: str, group: str, argument: str, value) -> None:
+        """
+
+        :param task:
+        :param group:
+        :param argument:
+        :param value:
+        :return:
+        """
+        try:
+            self.data[task][group][argument] = value
+        except:
+            logger.exception(f'have no arg {task}.{group}.{argument}')
 
 if __name__ == '__main__':
     config = Config(config_name='oas1')

+ 1 - 1
module/device/control.py

@@ -11,7 +11,7 @@ from module.device.method.window import Window
 from module.logger import logger
 
 
-class Control(Minitouch, Scrcpy, Window, Adb):
+class Control(Minitouch, Scrcpy, Window):
     def handle_control_check(self, button):
         # Will be overridden in Device
         pass

+ 5 - 5
module/device/device.py

@@ -9,7 +9,7 @@ from module.device.control import Control
 from module.device.screenshot import Screenshot
 from module.exception import (GameNotRunningError, GameStuckError,
                               GameTooManyClickError, RequestHumanTakeover)
-from module.handler.assets import GET_MISSION
+# from module.handler.assets import GET_MISSION
 from module.logger import logger
 
 if sys.platform == 'win32':
@@ -65,10 +65,10 @@ class Device(Screenshot, Control, AppControl, EmulatorManager):
         if threshold < diff < 86400 - threshold:
             return False
 
-        if GET_MISSION.match(self.image, offset=True):
-            logger.info('Night commission appear.')
-            self.click(GET_MISSION)
-            return True
+        # if GET_MISSION.match(self.image, offset=True):
+        #     logger.info('Night commission appear.')
+        #     self.click(GET_MISSION)
+        #     return True
 
         return False
 

+ 4 - 4
module/device/screenshot.py

@@ -145,17 +145,17 @@ class Screenshot(Adb, DroidCast, Scrcpy, Window):
                 Or None for Optimization_ScreenshotInterval, 'combat' for Optimization_CombatScreenshotInterval
         """
         if interval is None:
-            origin = self.config.Optimization_ScreenshotInterval
+            origin = self.config.get_arg('Script', 'Optimization', 'ScreenshotInterval')
             interval = limit_in(origin, 0.1, 0.3)
             if interval != origin:
                 logger.warning(f'Optimization.ScreenshotInterval {origin} is revised to {interval}')
-                self.config.Optimization_ScreenshotInterval = interval
+                self.config.set_arg('Script', 'Optimization', 'ScreenshotInterval', interval)
         elif interval == 'combat':
-            origin = self.config.Optimization_CombatScreenshotInterval
+            origin = self.config.get_arg('Script', 'Optimization', 'CombatScreenshotInterval')
             interval = limit_in(origin, 0.3, 1.0)
             if interval != origin:
                 logger.warning(f'Optimization.CombatScreenshotInterval {origin} is revised to {interval}')
-                self.config.Optimization_CombatScreenshotInterval = interval
+                self.config.set_arg('Script', 'Optimization', 'CombatScreenshotInterval', interval)
         elif isinstance(interval, (int, float)):
             # No limitation for manual set in code
             pass

binární
module/gui/FluentUI/fluentuiplugin.dll


+ 1673 - 0
module/gui/FluentUI/fluentuiplugin.qmltypes

@@ -0,0 +1,1673 @@
+import QtQuick.tooling 1.2
+
+// This file describes the plugin-supplied types contained in the library.
+// It is used for QML tooling purposes only.
+//
+// This file was auto-generated by qmltyperegistrar.
+
+Module {
+    Component {
+        file: "FluApp.h"
+        name: "FluApp"
+        accessSemantics: "reference"
+        prototype: "QObject"
+        exports: ["FluentUI/FluApp 1.0"]
+        isCreatable: false
+        isSingleton: true
+        exportMetaObjectRevisions: [256]
+        Property { name: "initialRoute"; type: "QString"; notify: "initialRouteChanged"; index: 0 }
+        Property { name: "routes"; type: "QJsonObject"; notify: "routesChanged"; index: 1 }
+        Signal { name: "initialRouteChanged" }
+        Signal { name: "routesChanged" }
+        Method { name: "run" }
+        Method {
+            name: "navigate"
+            Parameter { name: "route"; type: "QString" }
+            Parameter { name: "argument"; type: "QJsonObject" }
+            Parameter { name: "fluRegister"; type: "FluRegister"; isPointer: true }
+        }
+        Method {
+            name: "navigate"
+            Parameter { name: "route"; type: "QString" }
+            Parameter { name: "argument"; type: "QJsonObject" }
+        }
+        Method {
+            name: "navigate"
+            Parameter { name: "route"; type: "QString" }
+        }
+        Method {
+            name: "init"
+            Parameter { name: "window"; type: "QQuickWindow"; isPointer: true }
+        }
+        Method {
+            name: "awesomelist"
+            type: "QJsonArray"
+            Parameter { name: "keyword"; type: "QString" }
+        }
+        Method { name: "awesomelist"; type: "QJsonArray" }
+        Method { name: "closeApp" }
+    }
+    Component {
+        file: "FluColors.h"
+        name: "FluColors"
+        accessSemantics: "reference"
+        prototype: "QObject"
+        exports: ["FluentUI/FluColors 1.0"]
+        isCreatable: false
+        isSingleton: true
+        exportMetaObjectRevisions: [256]
+        Property { name: "Black"; type: "QString"; notify: "BlackChanged"; index: 0 }
+        Property { name: "White"; type: "QString"; notify: "WhiteChanged"; index: 1 }
+        Property { name: "Grey10"; type: "QString"; notify: "Grey10Changed"; index: 2 }
+        Property { name: "Grey20"; type: "QString"; notify: "Grey20Changed"; index: 3 }
+        Property { name: "Grey30"; type: "QString"; notify: "Grey30Changed"; index: 4 }
+        Property { name: "Grey40"; type: "QString"; notify: "Grey40Changed"; index: 5 }
+        Property { name: "Grey50"; type: "QString"; notify: "Grey50Changed"; index: 6 }
+        Property { name: "Grey60"; type: "QString"; notify: "Grey60Changed"; index: 7 }
+        Property { name: "Grey70"; type: "QString"; notify: "Grey70Changed"; index: 8 }
+        Property { name: "Grey80"; type: "QString"; notify: "Grey80Changed"; index: 9 }
+        Property { name: "Grey90"; type: "QString"; notify: "Grey90Changed"; index: 10 }
+        Property { name: "Grey100"; type: "QString"; notify: "Grey100Changed"; index: 11 }
+        Property { name: "Grey110"; type: "QString"; notify: "Grey110Changed"; index: 12 }
+        Property { name: "Grey120"; type: "QString"; notify: "Grey120Changed"; index: 13 }
+        Property { name: "Grey130"; type: "QString"; notify: "Grey130Changed"; index: 14 }
+        Property { name: "Grey140"; type: "QString"; notify: "Grey140Changed"; index: 15 }
+        Property { name: "Grey150"; type: "QString"; notify: "Grey150Changed"; index: 16 }
+        Property { name: "Grey160"; type: "QString"; notify: "Grey160Changed"; index: 17 }
+        Property { name: "Grey170"; type: "QString"; notify: "Grey170Changed"; index: 18 }
+        Property { name: "Grey180"; type: "QString"; notify: "Grey180Changed"; index: 19 }
+        Property { name: "Grey190"; type: "QString"; notify: "Grey190Changed"; index: 20 }
+        Property { name: "Grey200"; type: "QString"; notify: "Grey200Changed"; index: 21 }
+        Property { name: "Grey210"; type: "QString"; notify: "Grey210Changed"; index: 22 }
+        Property { name: "Grey220"; type: "QString"; notify: "Grey220Changed"; index: 23 }
+        Property {
+            name: "Yellow"
+            type: "FluColorSet"
+            isPointer: true
+            notify: "YellowChanged"
+            index: 24
+        }
+        Property {
+            name: "Orange"
+            type: "FluColorSet"
+            isPointer: true
+            notify: "OrangeChanged"
+            index: 25
+        }
+        Property { name: "Red"; type: "FluColorSet"; isPointer: true; notify: "RedChanged"; index: 26 }
+        Property {
+            name: "Magenta"
+            type: "FluColorSet"
+            isPointer: true
+            notify: "MagentaChanged"
+            index: 27
+        }
+        Property {
+            name: "Purple"
+            type: "FluColorSet"
+            isPointer: true
+            notify: "PurpleChanged"
+            index: 28
+        }
+        Property { name: "Blue"; type: "FluColorSet"; isPointer: true; notify: "BlueChanged"; index: 29 }
+        Property { name: "Teal"; type: "FluColorSet"; isPointer: true; notify: "TealChanged"; index: 30 }
+        Property { name: "Green"; type: "FluColorSet"; isPointer: true; notify: "GreenChanged"; index: 31 }
+        Signal { name: "BlackChanged" }
+        Signal { name: "WhiteChanged" }
+        Signal { name: "Grey10Changed" }
+        Signal { name: "Grey20Changed" }
+        Signal { name: "Grey30Changed" }
+        Signal { name: "Grey40Changed" }
+        Signal { name: "Grey50Changed" }
+        Signal { name: "Grey60Changed" }
+        Signal { name: "Grey70Changed" }
+        Signal { name: "Grey80Changed" }
+        Signal { name: "Grey90Changed" }
+        Signal { name: "Grey100Changed" }
+        Signal { name: "Grey110Changed" }
+        Signal { name: "Grey120Changed" }
+        Signal { name: "Grey130Changed" }
+        Signal { name: "Grey140Changed" }
+        Signal { name: "Grey150Changed" }
+        Signal { name: "Grey160Changed" }
+        Signal { name: "Grey170Changed" }
+        Signal { name: "Grey180Changed" }
+        Signal { name: "Grey190Changed" }
+        Signal { name: "Grey200Changed" }
+        Signal { name: "Grey210Changed" }
+        Signal { name: "Grey220Changed" }
+        Signal { name: "YellowChanged" }
+        Signal { name: "OrangeChanged" }
+        Signal { name: "RedChanged" }
+        Signal { name: "MagentaChanged" }
+        Signal { name: "PurpleChanged" }
+        Signal { name: "BlueChanged" }
+        Signal { name: "TealChanged" }
+        Signal { name: "GreenChanged" }
+    }
+    Component {
+        file: "FluTextStyle.h"
+        name: "FluTextStyle"
+        accessSemantics: "reference"
+        prototype: "QObject"
+        exports: ["FluentUI/FluTextStyle 1.0"]
+        isCreatable: false
+        isSingleton: true
+        exportMetaObjectRevisions: [256]
+        Property { name: "Caption"; type: "QFont"; notify: "CaptionChanged"; index: 0 }
+        Property { name: "Body"; type: "QFont"; notify: "BodyChanged"; index: 1 }
+        Property { name: "BodyStrong"; type: "QFont"; notify: "BodyStrongChanged"; index: 2 }
+        Property { name: "Subtitle"; type: "QFont"; notify: "SubtitleChanged"; index: 3 }
+        Property { name: "Title"; type: "QFont"; notify: "TitleChanged"; index: 4 }
+        Property { name: "TitleLarge"; type: "QFont"; notify: "TitleLargeChanged"; index: 5 }
+        Property { name: "Display"; type: "QFont"; notify: "DisplayChanged"; index: 6 }
+        Signal { name: "CaptionChanged" }
+        Signal { name: "BodyChanged" }
+        Signal { name: "BodyStrongChanged" }
+        Signal { name: "SubtitleChanged" }
+        Signal { name: "TitleChanged" }
+        Signal { name: "TitleLargeChanged" }
+        Signal { name: "DisplayChanged" }
+    }
+    Component {
+        file: "FluTheme.h"
+        name: "FluTheme"
+        accessSemantics: "reference"
+        prototype: "QObject"
+        exports: ["FluentUI/FluTheme 1.0"]
+        isCreatable: false
+        isSingleton: true
+        exportMetaObjectRevisions: [256]
+        Property {
+            name: "dark"
+            type: "bool"
+            read: "dark"
+            notify: "darkChanged"
+            index: 0
+            isReadonly: true
+        }
+        Property {
+            name: "primaryColor"
+            type: "FluColorSet"
+            isPointer: true
+            notify: "primaryColorChanged"
+            index: 1
+        }
+        Property { name: "darkMode"; type: "int"; notify: "darkModeChanged"; index: 2 }
+        Property { name: "nativeText"; type: "bool"; notify: "nativeTextChanged"; index: 3 }
+        Signal { name: "primaryColorChanged" }
+        Signal { name: "darkModeChanged" }
+        Signal { name: "nativeTextChanged" }
+        Signal { name: "darkChanged" }
+    }
+    Component {
+        file: "FluTools.h"
+        name: "FluTools"
+        accessSemantics: "reference"
+        prototype: "QObject"
+        exports: ["FluentUI/FluTools 1.0"]
+        isCreatable: false
+        isSingleton: true
+        exportMetaObjectRevisions: [256]
+        Method {
+            name: "clipText"
+            Parameter { name: "text"; type: "QString" }
+        }
+        Method { name: "uuid"; type: "QString" }
+        Method {
+            name: "readFile"
+            type: "QString"
+            Parameter { name: "fileName"; type: "QString" }
+        }
+        Method { name: "isMacos"; type: "bool" }
+        Method { name: "isLinux"; type: "bool" }
+        Method { name: "isWin"; type: "bool" }
+    }
+    Component {
+        file: "Def.h"
+        name: "Fluent_Awesome"
+        accessSemantics: "none"
+        exports: ["FluentUI/FluentIcons 1.0"]
+        isCreatable: false
+        exportMetaObjectRevisions: [256]
+        Enum {
+            name: "Fluent_AwesomeType"
+            values: [
+                "GlobalNavButton",
+                "Wifi",
+                "Bluetooth",
+                "Connect",
+                "InternetSharing",
+                "VPN",
+                "Brightness",
+                "MapPin",
+                "QuietHours",
+                "Airplane",
+                "Tablet",
+                "QuickNote",
+                "RememberedDevice",
+                "ChevronDown",
+                "ChevronUp",
+                "Edit",
+                "Add",
+                "Cancel",
+                "More",
+                "Settings",
+                "Video",
+                "Mail",
+                "People",
+                "Phone",
+                "Pin",
+                "Shop",
+                "Stop",
+                "Link",
+                "Filter",
+                "AllApps",
+                "Zoom",
+                "ZoomOut",
+                "Microphone",
+                "Search",
+                "Camera",
+                "Attach",
+                "Send",
+                "SendFill",
+                "WalkSolid",
+                "InPrivate",
+                "FavoriteList",
+                "PageSolid",
+                "Forward",
+                "Back",
+                "Refresh",
+                "Share",
+                "Lock",
+                "ReportHacked",
+                "EMI",
+                "FavoriteStar",
+                "FavoriteStarFill",
+                "ReadingMode",
+                "Favicon",
+                "Remove",
+                "Checkbox",
+                "CheckboxComposite",
+                "CheckboxFill",
+                "CheckboxIndeterminate",
+                "CheckboxCompositeReversed",
+                "CheckMark",
+                "BackToWindow",
+                "FullScreen",
+                "ResizeTouchLarger",
+                "ResizeTouchSmaller",
+                "ResizeMouseSmall",
+                "ResizeMouseMedium",
+                "ResizeMouseWide",
+                "ResizeMouseTall",
+                "ResizeMouseLarge",
+                "SwitchUser",
+                "Print",
+                "Up",
+                "Down",
+                "OEM",
+                "Delete",
+                "Save",
+                "Mute",
+                "BackSpaceQWERTY",
+                "ReturnKey",
+                "UpArrowShiftKey",
+                "Cloud",
+                "Flashlight",
+                "RotationLock",
+                "CommandPrompt",
+                "SIPMove",
+                "SIPUndock",
+                "SIPRedock",
+                "EraseTool",
+                "UnderscoreSpace",
+                "GripperTool",
+                "Dialpad",
+                "PageLeft",
+                "PageRight",
+                "MultiSelect",
+                "KeyboardLeftHanded",
+                "KeyboardRightHanded",
+                "KeyboardClassic",
+                "KeyboardSplit",
+                "Volume",
+                "Play",
+                "Pause",
+                "ChevronLeft",
+                "ChevronRight",
+                "InkingTool",
+                "Emoji2",
+                "GripperBarHorizontal",
+                "System",
+                "Personalize",
+                "Devices",
+                "SearchAndApps",
+                "Globe",
+                "TimeLanguage",
+                "EaseOfAccess",
+                "UpdateRestore",
+                "HangUp",
+                "ContactInfo",
+                "Unpin",
+                "Contact",
+                "Memo",
+                "IncomingCall",
+                "Paste",
+                "PhoneBook",
+                "LEDLight",
+                "Error",
+                "GripperBarVertical",
+                "Unlock",
+                "Slideshow",
+                "Calendar",
+                "GripperResize",
+                "Megaphone",
+                "Trim",
+                "NewWindow",
+                "SaveLocal",
+                "Color",
+                "DataSense",
+                "SaveAs",
+                "Light",
+                "AspectRatio",
+                "DataSenseBar",
+                "Redo",
+                "Undo",
+                "Crop",
+                "OpenWith",
+                "Rotate",
+                "RedEye",
+                "SetlockScreen",
+                "MapPin2",
+                "Package",
+                "Warning",
+                "ReadingList",
+                "Education",
+                "ShoppingCart",
+                "Train",
+                "Flag",
+                "Move",
+                "Page",
+                "TaskView",
+                "BrowsePhotos",
+                "HalfStarLeft",
+                "HalfStarRight",
+                "Record",
+                "TouchPointer",
+                "LangJPN",
+                "Ferry",
+                "Highlight",
+                "ActionCenterNotification",
+                "PowerButton",
+                "ResizeTouchNarrower",
+                "ResizeTouchShorter",
+                "DrivingMode",
+                "RingerSilent",
+                "OtherUser",
+                "Admin",
+                "CC",
+                "SDCard",
+                "CallForwarding",
+                "SettingsDisplaySound",
+                "TVMonitor",
+                "Speakers",
+                "Headphone",
+                "DeviceLaptopPic",
+                "DeviceLaptopNoPic",
+                "DeviceMonitorRightPic",
+                "DeviceMonitorLeftPic",
+                "DeviceMonitorNoPic",
+                "Game",
+                "HorizontalTabKey",
+                "StreetsideSplitMinimize",
+                "StreetsideSplitExpand",
+                "Car",
+                "Walk",
+                "Bus",
+                "TiltUp",
+                "TiltDown",
+                "CallControl",
+                "RotateMapRight",
+                "RotateMapLeft",
+                "Home",
+                "ParkingLocation",
+                "MapCompassTop",
+                "MapCompassBottom",
+                "IncidentTriangle",
+                "Touch",
+                "MapDirections",
+                "StartPoint",
+                "StopPoint",
+                "EndPoint",
+                "History",
+                "Location",
+                "MapLayers",
+                "Accident",
+                "Work",
+                "Construction",
+                "Recent",
+                "Bank",
+                "DownloadMap",
+                "InkingToolFill2",
+                "HighlightFill2",
+                "EraseToolFill",
+                "EraseToolFill2",
+                "Dictionary",
+                "DictionaryAdd",
+                "ToolTip",
+                "ChromeBack",
+                "ProvisioningPackage",
+                "AddRemoteDevice",
+                "FolderOpen",
+                "Ethernet",
+                "ShareBroadband",
+                "DirectAccess",
+                "DialUp",
+                "DefenderApp",
+                "BatteryCharging9",
+                "Battery10",
+                "Pinned",
+                "PinFill",
+                "PinnedFill",
+                "PeriodKey",
+                "PuncKey",
+                "RevToggleKey",
+                "RightArrowKeyTime1",
+                "RightArrowKeyTime2",
+                "LeftQuote",
+                "RightQuote",
+                "DownShiftKey",
+                "UpShiftKey",
+                "PuncKey0",
+                "PuncKeyLeftBottom",
+                "RightArrowKeyTime3",
+                "RightArrowKeyTime4",
+                "Battery0",
+                "Battery1",
+                "Battery2",
+                "Battery3",
+                "Battery4",
+                "Battery5",
+                "Battery6",
+                "Battery7",
+                "Battery8",
+                "Battery9",
+                "BatteryCharging0",
+                "BatteryCharging1",
+                "BatteryCharging2",
+                "BatteryCharging3",
+                "BatteryCharging4",
+                "BatteryCharging5",
+                "BatteryCharging6",
+                "BatteryCharging7",
+                "BatteryCharging8",
+                "BatterySaver0",
+                "BatterySaver1",
+                "BatterySaver2",
+                "BatterySaver3",
+                "BatterySaver4",
+                "BatterySaver5",
+                "BatterySaver6",
+                "BatterySaver7",
+                "BatterySaver8",
+                "SignalBars1",
+                "SignalBars2",
+                "SignalBars3",
+                "SignalBars4",
+                "SignalBars5",
+                "SignalNotConnected",
+                "Wifi1",
+                "Wifi2",
+                "Wifi3",
+                "MobSIMLock",
+                "MobSIMMissing",
+                "Vibrate",
+                "RoamingInternational",
+                "RoamingDomestic",
+                "CallForwardInternational",
+                "CallForwardRoaming",
+                "JpnRomanji",
+                "JpnRomanjiLock",
+                "JpnRomanjiShift",
+                "JpnRomanjiShiftLock",
+                "StatusDataTransfer",
+                "StatusDataTransferVPN",
+                "StatusDualSIM2",
+                "StatusDualSIM2VPN",
+                "StatusDualSIM1",
+                "StatusDualSIM1VPN",
+                "StatusSGLTE",
+                "StatusSGLTECell",
+                "StatusSGLTEDataVPN",
+                "StatusVPN",
+                "WifiHotspot",
+                "LanguageKor",
+                "LanguageCht",
+                "LanguageChs",
+                "USB",
+                "InkingToolFill",
+                "View",
+                "HighlightFill",
+                "Previous",
+                "Next",
+                "Clear",
+                "Sync",
+                "Download",
+                "Help",
+                "Upload",
+                "Emoji",
+                "TwoPage",
+                "LeaveChat",
+                "MailForward",
+                "RotateCamera",
+                "ClosePane",
+                "OpenPane",
+                "PreviewLink",
+                "AttachCamera",
+                "ZoomIn",
+                "Bookmarks",
+                "Document",
+                "ProtectedDocument",
+                "OpenInNewWindow",
+                "MailFill",
+                "ViewAll",
+                "VideoChat",
+                "Switch",
+                "Rename",
+                "Go",
+                "SurfaceHub",
+                "Remote",
+                "Click",
+                "Shuffle",
+                "Movies",
+                "SelectAll",
+                "Orientation",
+                "Import",
+                "ImportAll",
+                "Folder",
+                "Webcam",
+                "Picture",
+                "Caption",
+                "ChromeClose",
+                "ShowResults",
+                "Message",
+                "Leaf",
+                "CalendarDay",
+                "CalendarWeek",
+                "Characters",
+                "MailReplyAll",
+                "Read",
+                "ShowBcc",
+                "HideBcc",
+                "Cut",
+                "PaymentCard",
+                "Copy",
+                "Important",
+                "MailReply",
+                "Sort",
+                "MobileTablet",
+                "DisconnectDrive",
+                "MapDrive",
+                "ContactPresence",
+                "Priority",
+                "GotoToday",
+                "Font",
+                "FontColor",
+                "Contact2",
+                "FolderFill",
+                "Audio",
+                "Permissions",
+                "DisableUpdates",
+                "Unfavorite",
+                "OpenLocal",
+                "Italic",
+                "Underline",
+                "Bold",
+                "MoveToFolder",
+                "LikeDislike",
+                "Dislike",
+                "Like",
+                "AlignRight",
+                "AlignCenter",
+                "AlignLeft",
+                "OpenFile",
+                "ClearSelection",
+                "FontDecrease",
+                "FontIncrease",
+                "FontSize",
+                "CellPhone",
+                "Reshare",
+                "Tag",
+                "RepeatOne",
+                "RepeatAll",
+                "Calculator",
+                "Directions",
+                "Library",
+                "ChatBubbles",
+                "PostUpdate",
+                "NewFolder",
+                "CalendarReply",
+                "UnsyncFolder",
+                "SyncFolder",
+                "BlockContact",
+                "SwitchApps",
+                "AddFriend",
+                "Accept",
+                "GoToStart",
+                "BulletedList",
+                "Scan",
+                "Preview",
+                "Group",
+                "ZeroBars",
+                "OneBar",
+                "TwoBars",
+                "ThreeBars",
+                "FourBars",
+                "World",
+                "Comment",
+                "MusicInfo",
+                "DockLeft",
+                "DockRight",
+                "DockBottom",
+                "Repair",
+                "Accounts",
+                "DullSound",
+                "Manage",
+                "Street",
+                "Printer3D",
+                "RadioBullet",
+                "Stopwatch",
+                "Photo",
+                "ActionCenter",
+                "FullCircleMask",
+                "ChromeMinimize",
+                "ChromeMaximize",
+                "ChromeRestore",
+                "Annotation",
+                "BackSpaceQWERTYSm",
+                "BackSpaceQWERTYMd",
+                "Swipe",
+                "Fingerprint",
+                "Handwriting",
+                "ChromeBackToWindow",
+                "ChromeFullScreen",
+                "KeyboardStandard",
+                "KeyboardDismiss",
+                "Completed",
+                "ChromeAnnotate",
+                "Label",
+                "IBeam",
+                "IBeamOutline",
+                "FlickDown",
+                "FlickUp",
+                "FlickLeft",
+                "FlickRight",
+                "FeedbackApp",
+                "MusicAlbum",
+                "Streaming",
+                "Code",
+                "ReturnToWindow",
+                "LightningBolt",
+                "Info",
+                "CalculatorMultiply",
+                "CalculatorAddition",
+                "CalculatorSubtract",
+                "CalculatorDivide",
+                "CalculatorSquareroot",
+                "CalculatorPercentage",
+                "CalculatorNegate",
+                "CalculatorEqualTo",
+                "CalculatorBackspace",
+                "Component",
+                "DMC",
+                "Dock",
+                "MultimediaDMS",
+                "MultimediaDVR",
+                "MultimediaPMP",
+                "PrintfaxPrinterFile",
+                "Sensor",
+                "StorageOptical",
+                "Communications",
+                "Headset",
+                "Projector",
+                "Health",
+                "Wire",
+                "Webcam2",
+                "Input",
+                "Mouse",
+                "Smartcard",
+                "SmartcardVirtual",
+                "MediaStorageTower",
+                "ReturnKeySm",
+                "GameConsole",
+                "Network",
+                "StorageNetworkWireless",
+                "StorageTape",
+                "ChevronUpSmall",
+                "ChevronDownSmall",
+                "ChevronLeftSmall",
+                "ChevronRightSmall",
+                "ChevronUpMed",
+                "ChevronDownMed",
+                "ChevronLeftMed",
+                "ChevronRightMed",
+                "Devices2",
+                "ExpandTile",
+                "PC1",
+                "PresenceChicklet",
+                "PresenceChickletVideo",
+                "Reply",
+                "SetTile",
+                "Type",
+                "Korean",
+                "HalfAlpha",
+                "FullAlpha",
+                "Key12On",
+                "ChineseChangjie",
+                "QWERTYOn",
+                "QWERTYOff",
+                "ChineseQuick",
+                "Japanese",
+                "FullHiragana",
+                "FullKatakana",
+                "HalfKatakana",
+                "ChineseBoPoMoFo",
+                "ChinesePinyin",
+                "ConstructionCone",
+                "XboxOneConsole",
+                "Volume0",
+                "Volume1",
+                "Volume2",
+                "Volume3",
+                "BatteryUnknown",
+                "WifiAttentionOverlay",
+                "Robot",
+                "TapAndSend",
+                "FitPage",
+                "PasswordKeyShow",
+                "PasswordKeyHide",
+                "BidiLtr",
+                "BidiRtl",
+                "ForwardSm",
+                "CommaKey",
+                "DashKey",
+                "DullSoundKey",
+                "HalfDullSound",
+                "RightDoubleQuote",
+                "LeftDoubleQuote",
+                "PuncKeyRightBottom",
+                "PuncKey1",
+                "PuncKey2",
+                "PuncKey3",
+                "PuncKey4",
+                "PuncKey5",
+                "PuncKey6",
+                "PuncKey9",
+                "PuncKey7",
+                "PuncKey8",
+                "Frigid",
+                "Unknown",
+                "AreaChart",
+                "CheckList",
+                "Diagnostic",
+                "Equalizer",
+                "Process",
+                "Processing",
+                "ReportDocument",
+                "VideoSolid",
+                "MixedMediaBadge",
+                "DisconnectDisplay",
+                "Shield",
+                "Info2",
+                "ActionCenterAsterisk",
+                "Beta",
+                "SaveCopy",
+                "List",
+                "Asterisk",
+                "ErrorBadge",
+                "CircleRing",
+                "CircleFill",
+                "MergeCall",
+                "PrivateCall",
+                "Record2",
+                "AllAppsMirrored",
+                "BookmarksMirrored",
+                "BulletedListMirrored",
+                "CallForwardInternationalMirrored",
+                "CallForwardRoamingMirrored",
+                "ChromeBackMirrored",
+                "ClearSelectionMirrored",
+                "ClosePaneMirrored",
+                "ContactInfoMirrored",
+                "DockRightMirrored",
+                "DockLeftMirrored",
+                "ExpandTileMirrored",
+                "GoMirrored",
+                "GripperResizeMirrored",
+                "HelpMirrored",
+                "ImportMirrored",
+                "ImportAllMirrored",
+                "LeaveChatMirrored",
+                "ListMirrored",
+                "MailForwardMirrored",
+                "MailReplyMirrored",
+                "MailReplyAllMirrored",
+                "OpenPaneMirrored",
+                "OpenWithMirrored",
+                "ParkingLocationMirrored",
+                "ResizeMouseMediumMirrored",
+                "ResizeMouseSmallMirrored",
+                "ResizeMouseTallMirrored",
+                "ResizeTouchNarrowerMirrored",
+                "SendMirrored",
+                "SendFillMirrored",
+                "ShowResultsMirrored",
+                "Media",
+                "SyncError",
+                "Devices3",
+                "SlowMotionOn",
+                "Lightbulb",
+                "StatusCircle",
+                "StatusTriangle",
+                "StatusError",
+                "StatusWarning",
+                "Puzzle",
+                "CalendarSolid",
+                "HomeSolid",
+                "ParkingLocationSolid",
+                "ContactSolid",
+                "ConstructionSolid",
+                "AccidentSolid",
+                "Ringer",
+                "PDF",
+                "ThoughtBubble",
+                "HeartBroken",
+                "BatteryCharging10",
+                "BatterySaver9",
+                "BatterySaver10",
+                "CallForwardingMirrored",
+                "MultiSelectMirrored",
+                "Broom",
+                "ForwardCall",
+                "Trackers",
+                "Market",
+                "PieSingle",
+                "StockUp",
+                "StockDown",
+                "Design",
+                "Website",
+                "Drop",
+                "Radar",
+                "BusSolid",
+                "FerrySolid",
+                "StartPointSolid",
+                "StopPointSolid",
+                "EndPointSolid",
+                "AirplaneSolid",
+                "TrainSolid",
+                "WorkSolid",
+                "ReminderFill",
+                "Reminder",
+                "Heart",
+                "HeartFill",
+                "EthernetError",
+                "EthernetWarning",
+                "StatusConnecting1",
+                "StatusConnecting2",
+                "StatusUnsecure",
+                "WifiError0",
+                "WifiError1",
+                "WifiError2",
+                "WifiError3",
+                "WifiError4",
+                "WifiWarning0",
+                "WifiWarning1",
+                "WifiWarning2",
+                "WifiWarning3",
+                "WifiWarning4",
+                "Devices4",
+                "NUIIris",
+                "NUIFace",
+                "GatewayRouter",
+                "EditMirrored",
+                "NUIFPStartSlideHand",
+                "NUIFPStartSlideAction",
+                "NUIFPContinueSlideHand",
+                "NUIFPContinueSlideAction",
+                "NUIFPRollRightHand",
+                "NUIFPRollRightHandAction",
+                "NUIFPRollLeftHand",
+                "NUIFPRollLeftAction",
+                "NUIFPPressHand",
+                "NUIFPPressAction",
+                "NUIFPPressRepeatHand",
+                "NUIFPPressRepeatAction",
+                "StatusErrorFull",
+                "TaskViewExpanded",
+                "Certificate",
+                "BackSpaceQWERTYLg",
+                "ReturnKeyLg",
+                "FastForward",
+                "Rewind",
+                "Photo2",
+                "MobBattery0",
+                "MobBattery1",
+                "MobBattery2",
+                "MobBattery3",
+                "MobBattery4",
+                "MobBattery5",
+                "MobBattery6",
+                "MobBattery7",
+                "MobBattery8",
+                "MobBattery9",
+                "MobBattery10",
+                "MobBatteryCharging0",
+                "MobBatteryCharging1",
+                "MobBatteryCharging2",
+                "MobBatteryCharging3",
+                "MobBatteryCharging4",
+                "MobBatteryCharging5",
+                "MobBatteryCharging6",
+                "MobBatteryCharging7",
+                "MobBatteryCharging8",
+                "MobBatteryCharging9",
+                "MobBatteryCharging10",
+                "MobBatterySaver0",
+                "MobBatterySaver1",
+                "MobBatterySaver2",
+                "MobBatterySaver3",
+                "MobBatterySaver4",
+                "MobBatterySaver5",
+                "MobBatterySaver6",
+                "MobBatterySaver7",
+                "MobBatterySaver8",
+                "MobBatterySaver9",
+                "MobBatterySaver10",
+                "DictionaryCloud",
+                "ResetDrive",
+                "VolumeBars",
+                "Project",
+                "AdjustHologram",
+                "CloudDownload",
+                "MobWifiCallBars",
+                "MobWifiCall0",
+                "MobWifiCall1",
+                "MobWifiCall2",
+                "MobWifiCall3",
+                "MobWifiCall4",
+                "Family",
+                "LockFeedback",
+                "DeviceDiscovery",
+                "WindDirection",
+                "RightArrowKeyTime0",
+                "Bug",
+                "TabletMode",
+                "StatusCircleLeft",
+                "StatusTriangleLeft",
+                "StatusErrorLeft",
+                "StatusWarningLeft",
+                "MobBatteryUnknown",
+                "NetworkTower",
+                "CityNext",
+                "CityNext2",
+                "Courthouse",
+                "Groceries",
+                "Sustainable",
+                "BuildingEnergy",
+                "ToggleFilled",
+                "ToggleBorder",
+                "SliderThumb",
+                "ToggleThumb",
+                "MiracastLogoSmall",
+                "MiracastLogoLarge",
+                "PLAP",
+                "Badge",
+                "SignalRoaming",
+                "MobileLocked",
+                "InsiderHubApp",
+                "PersonalFolder",
+                "HomeGroup",
+                "MyNetwork",
+                "KeyboardFull",
+                "Cafe",
+                "MobSignal1",
+                "MobSignal2",
+                "MobSignal3",
+                "MobSignal4",
+                "MobSignal5",
+                "MobWifi1",
+                "MobWifi2",
+                "MobWifi3",
+                "MobWifi4",
+                "MobAirplane",
+                "MobBluetooth",
+                "MobActionCenter",
+                "MobLocation",
+                "MobWifiHotspot",
+                "LanguageJpn",
+                "MobQuietHours",
+                "MobDrivingMode",
+                "SpeedOff",
+                "SpeedMedium",
+                "SpeedHigh",
+                "ThisPC",
+                "MusicNote",
+                "FileExplorer",
+                "FileExplorerApp",
+                "LeftArrowKeyTime0",
+                "MicOff",
+                "MicSleep",
+                "MicError",
+                "PlaybackRate1x",
+                "PlaybackRateOther",
+                "CashDrawer",
+                "BarcodeScanner",
+                "ReceiptPrinter",
+                "MagStripeReader",
+                "CompletedSolid",
+                "CompanionApp",
+                "Favicon2",
+                "SwipeRevealArt",
+                "MicOn",
+                "MicClipping",
+                "TabletSelected",
+                "MobileSelected",
+                "LaptopSelected",
+                "TVMonitorSelected",
+                "DeveloperTools",
+                "MobCallForwarding",
+                "MobCallForwardingMirrored",
+                "BodyCam",
+                "PoliceCar",
+                "Draw",
+                "DrawSolid",
+                "LowerBrightness",
+                "ScrollUpDown",
+                "DateTime",
+                "HoloLens",
+                "Tiles",
+                "PartyLeader",
+                "AppIconDefault",
+                "Calories",
+                "POI",
+                "BandBattery0",
+                "BandBattery1",
+                "BandBattery2",
+                "BandBattery3",
+                "BandBattery4",
+                "BandBattery5",
+                "BandBattery6",
+                "AddSurfaceHub",
+                "DevUpdate",
+                "Unit",
+                "AddTo",
+                "RemoveFrom",
+                "RadioBtnOff",
+                "RadioBtnOn",
+                "RadioBullet2",
+                "ExploreContent",
+                "Blocked2",
+                "ScrollMode",
+                "ZoomMode",
+                "PanMode",
+                "WiredUSB",
+                "WirelessUSB",
+                "USBSafeConnect",
+                "ActionCenterNotificationMirrored",
+                "ActionCenterMirrored",
+                "SubscriptionAdd",
+                "ResetDevice",
+                "SubscriptionAddMirrored",
+                "QRCode",
+                "Feedback",
+                "Hide",
+                "Subtitles",
+                "SubtitlesAudio",
+                "OpenFolderHorizontal",
+                "CalendarMirrored",
+                "MobeSIM",
+                "MobeSIMNoProfile",
+                "MobeSIMLocked",
+                "MobeSIMBusy",
+                "SignalError",
+                "StreamingEnterprise",
+                "Headphone0",
+                "Headphone1",
+                "Headphone2",
+                "Headphone3",
+                "Apps",
+                "KeyboardBrightness",
+                "KeyboardLowerBrightness",
+                "SkipBack10",
+                "SkipForward30",
+                "TreeFolderFolder",
+                "TreeFolderFolderFill",
+                "TreeFolderFolderOpen",
+                "TreeFolderFolderOpenFill",
+                "MultimediaDMP",
+                "KeyboardOneHanded",
+                "Narrator",
+                "EmojiTabPeople",
+                "EmojiTabSmilesAnimals",
+                "EmojiTabCelebrationObjects",
+                "EmojiTabFoodPlants",
+                "EmojiTabTransitPlaces",
+                "EmojiTabSymbols",
+                "EmojiTabTextSmiles",
+                "EmojiTabFavorites",
+                "EmojiSwatch",
+                "ConnectApp",
+                "CompanionDeviceFramework",
+                "Ruler",
+                "FingerInking",
+                "StrokeErase",
+                "PointErase",
+                "ClearAllInk",
+                "Pencil",
+                "Marker",
+                "InkingCaret",
+                "InkingColorOutline",
+                "InkingColorFill",
+                "HardDrive",
+                "NetworkAdapter",
+                "Touchscreen",
+                "NetworkPrinter",
+                "CloudPrinter",
+                "KeyboardShortcut",
+                "BrushSize",
+                "NarratorForward",
+                "NarratorForwardMirrored",
+                "SyncBadge12",
+                "RingerBadge12",
+                "AsteriskBadge12",
+                "ErrorBadge12",
+                "CircleRingBadge12",
+                "CircleFillBadge12",
+                "ImportantBadge12",
+                "MailBadge12",
+                "PauseBadge12",
+                "PlayBadge12",
+                "PenWorkspace",
+                "CaretLeft8",
+                "CaretRight8",
+                "CaretUp8",
+                "CaretDown8",
+                "CaretLeftSolid8",
+                "CaretRightSolid8",
+                "CaretUpSolid8",
+                "CaretDownSolid8",
+                "Strikethrough",
+                "Export",
+                "ExportMirrored",
+                "ButtonMenu",
+                "CloudSearch",
+                "PinyinIMELogo",
+                "CalligraphyPen",
+                "ReplyMirrored",
+                "LockscreenDesktop",
+                "TaskViewSettings",
+                "MiniExpand2Mirrored",
+                "MiniContract2Mirrored",
+                "Play36",
+                "PenPalette",
+                "GuestUser",
+                "SettingsBattery",
+                "TaskbarPhone",
+                "LockScreenGlance",
+                "GenericScan",
+                "ImageExport",
+                "WifiEthernet",
+                "ActionCenterQuiet",
+                "ActionCenterQuietNotification",
+                "TrackersMirrored",
+                "DateTimeMirrored",
+                "Wheel",
+                "VirtualMachineGroup",
+                "ButtonView2",
+                "PenWorkspaceMirrored",
+                "PenPaletteMirrored",
+                "StrokeEraseMirrored",
+                "PointEraseMirrored",
+                "ClearAllInkMirrored",
+                "BackgroundToggle",
+                "Marquee",
+                "ChromeCloseContrast",
+                "ChromeMinimizeContrast",
+                "ChromeMaximizeContrast",
+                "ChromeRestoreContrast",
+                "TrafficLight",
+                "Replay",
+                "Eyedropper",
+                "LineDisplay",
+                "PINPad",
+                "SignatureCapture",
+                "ChipCardCreditCardReader",
+                "MarketDown",
+                "PlayerSettings",
+                "LandscapeOrientation",
+                "Flow",
+                "Touchpad",
+                "Speech",
+                "KnowledgeArticle",
+                "Relationship",
+                "ZipFolder",
+                "DefaultAPN",
+                "UserAPN",
+                "DoublePinyin",
+                "BlueLight",
+                "CaretSolidLeft",
+                "CaretSolidDown",
+                "CaretSolidRight",
+                "CaretSolidUp",
+                "ButtonA",
+                "ButtonB",
+                "ButtonY",
+                "ButtonX",
+                "ArrowUp8",
+                "ArrowDown8",
+                "ArrowRight8",
+                "ArrowLeft8",
+                "QuarentinedItems",
+                "QuarentinedItemsMirrored",
+                "Protractor",
+                "ChecklistMirrored",
+                "StatusCircle7",
+                "StatusCheckmark7",
+                "StatusErrorCircle7",
+                "Connected",
+                "PencilFill",
+                "CalligraphyFill",
+                "QuarterStarLeft",
+                "QuarterStarRight",
+                "ThreeQuarterStarLeft",
+                "ThreeQuarterStarRight",
+                "QuietHoursBadge12",
+                "BackMirrored",
+                "ForwardMirrored",
+                "ChromeBackContrast",
+                "ChromeBackContrastMirrored",
+                "ChromeBackToWindowContrast",
+                "ChromeFullScreenContrast",
+                "GridView",
+                "ClipboardList",
+                "ClipboardListMirrored",
+                "OutlineQuarterStarLeft",
+                "OutlineQuarterStarRight",
+                "OutlineHalfStarLeft",
+                "OutlineHalfStarRight",
+                "OutlineThreeQuarterStarLeft",
+                "OutlineThreeQuarterStarRight",
+                "SpatialVolume0",
+                "SpatialVolume1",
+                "SpatialVolume2",
+                "SpatialVolume3",
+                "ApplicationGuard",
+                "OutlineStarLeftHalf",
+                "OutlineStarRightHalf",
+                "ChromeAnnotateContrast",
+                "DefenderBadge12",
+                "DetachablePC",
+                "LeftStick",
+                "RightStick",
+                "TriggerLeft",
+                "TriggerRight",
+                "BumperLeft",
+                "BumperRight",
+                "Dpad",
+                "EnglishPunctuation",
+                "ChinesePunctuation",
+                "HMD",
+                "CtrlSpatialRight",
+                "PaginationDotOutline10",
+                "PaginationDotSolid10",
+                "StrokeErase2",
+                "SmallErase",
+                "LargeErase",
+                "FolderHorizontal",
+                "MicrophoneListening",
+                "StatusExclamationCircle7",
+                "Video360",
+                "GiftboxOpen",
+                "StatusCircleOuter",
+                "StatusCircleInner",
+                "StatusCircleRing",
+                "StatusTriangleOuter",
+                "StatusTriangleInner",
+                "StatusTriangleExclamation",
+                "StatusCircleExclamation",
+                "StatusCircleErrorX",
+                "StatusCircleCheckmark",
+                "StatusCircleInfo",
+                "StatusCircleBlock",
+                "StatusCircleBlock2",
+                "StatusCircleQuestionMark",
+                "StatusCircleSync",
+                "Dial1",
+                "Dial2",
+                "Dial3",
+                "Dial4",
+                "Dial5",
+                "Dial6",
+                "Dial7",
+                "Dial8",
+                "Dial9",
+                "Dial10",
+                "Dial11",
+                "Dial12",
+                "Dial13",
+                "Dial14",
+                "Dial15",
+                "Dial16",
+                "DialShape1",
+                "DialShape2",
+                "DialShape3",
+                "DialShape4",
+                "ClosedCaptionsInternational",
+                "TollSolid",
+                "TrafficCongestionSolid",
+                "ExploreContentSingle",
+                "CollapseContent",
+                "CollapseContentSingle",
+                "InfoSolid",
+                "GroupList",
+                "CaretBottomRightSolidCenter8",
+                "ProgressRingDots",
+                "Checkbox14",
+                "CheckboxComposite14",
+                "CheckboxIndeterminateCombo14",
+                "CheckboxIndeterminateCombo",
+                "StatusPause7",
+                "CharacterAppearance",
+                "Lexicon",
+                "ScreenTime",
+                "HeadlessDevice",
+                "NetworkSharing",
+                "EyeGaze",
+                "ToggleLeft",
+                "ToggleRight",
+                "WindowsInsider",
+                "ChromeSwitch",
+                "ChromeSwitchContast",
+                "StatusCheckmark",
+                "StatusCheckmarkLeft",
+                "KeyboardLeftAligned",
+                "KeyboardRightAligned",
+                "KeyboardSettings",
+                "NetworkPhysical",
+                "IOT",
+                "UnknownMirrored",
+                "ViewDashboard",
+                "ExploitProtectionSettings",
+                "KeyboardNarrow",
+                "Keyboard12Key",
+                "KeyboardDock",
+                "KeyboardUndock",
+                "KeyboardLeftDock",
+                "KeyboardRightDock",
+                "Ear",
+                "PointerHand",
+                "Bullseye",
+                "DocumentApproval",
+                "LocaleLanguage",
+                "PassiveAuthentication",
+                "ColorSolid",
+                "NetworkOffline",
+                "NetworkConnected",
+                "NetworkConnectedCheckmark",
+                "SignOut",
+                "StatusInfo",
+                "StatusInfoLeft",
+                "NearbySharing",
+                "CtrlSpatialLeft",
+                "InteractiveDashboard",
+                "DeclineCall",
+                "ClippingTool",
+                "RectangularClipping",
+                "FreeFormClipping",
+                "CopyTo",
+                "IDBadge",
+                "DynamicLock",
+                "PenTips",
+                "PenTipsMirrored",
+                "HWPJoin",
+                "HWPInsert",
+                "HWPStrikeThrough",
+                "HWPScratchOut",
+                "HWPSplit",
+                "HWPNewLine",
+                "HWPOverwrite",
+                "MobWifiWarning1",
+                "MobWifiWarning2",
+                "MobWifiWarning3",
+                "MobWifiWarning4",
+                "MicLocationCombo",
+                "Globe2",
+                "SpecialEffectSize",
+                "GIF",
+                "Sticker2",
+                "SurfaceHubSelected",
+                "HoloLensSelected",
+                "Earbud",
+                "MixVolumes",
+                "Safe",
+                "LaptopSecure",
+                "PrintDefault",
+                "PageMirrored",
+                "LandscapeOrientationMirrored",
+                "ColorOff",
+                "PrintAllPages",
+                "PrintCustomRange",
+                "PageMarginPortraitNarrow",
+                "PageMarginPortraitNormal",
+                "PageMarginPortraitModerate",
+                "PageMarginPortraitWide",
+                "PageMarginLandscapeNarrow",
+                "PageMarginLandscapeNormal",
+                "PageMarginLandscapeModerate",
+                "PageMarginLandscapeWide",
+                "CollateLandscape",
+                "CollatePortrait",
+                "CollatePortraitSeparated",
+                "DuplexLandscapeOneSided",
+                "DuplexLandscapeOneSidedMirrored",
+                "DuplexLandscapeTwoSidedLongEdge",
+                "DuplexLandscapeTwoSidedLongEdgeMirrored",
+                "DuplexLandscapeTwoSidedShortEdge",
+                "DuplexLandscapeTwoSidedShortEdgeMirrored",
+                "DuplexPortraitOneSided",
+                "DuplexPortraitOneSidedMirrored",
+                "DuplexPortraitTwoSidedLongEdge",
+                "DuplexPortraitTwoSidedLongEdgeMirrored",
+                "DuplexPortraitTwoSidedShortEdge",
+                "DuplexPortraitTwoSidedShortEdgeMirrored",
+                "PPSOneLandscape",
+                "PPSTwoLandscape",
+                "PPSTwoPortrait",
+                "PPSFourLandscape",
+                "PPSFourPortrait",
+                "HolePunchOff",
+                "HolePunchPortraitLeft",
+                "HolePunchPortraitRight",
+                "HolePunchPortraitTop",
+                "HolePunchPortraitBottom",
+                "HolePunchLandscapeLeft",
+                "HolePunchLandscapeRight",
+                "HolePunchLandscapeTop",
+                "HolePunchLandscapeBottom",
+                "StaplingOff",
+                "StaplingPortraitTopLeft",
+                "StaplingPortraitTopRight",
+                "StaplingPortraitBottomRight",
+                "StaplingPortraitTwoLeft",
+                "StaplingPortraitTwoRight",
+                "StaplingPortraitTwoTop",
+                "StaplingPortraitTwoBottom",
+                "StaplingPortraitBookBinding",
+                "StaplingLandscapeTopLeft",
+                "StaplingLandscapeTopRight",
+                "StaplingLandscapeBottomLeft",
+                "StaplingLandscapeBottomRight",
+                "StaplingLandscapeTwoLeft",
+                "StaplingLandscapeTwoRight",
+                "StaplingLandscapeTwoTop",
+                "StaplingLandscapeTwoBottom",
+                "StaplingLandscapeBookBinding",
+                "StatusDataTransferRoaming",
+                "MobSIMError",
+                "CollateLandscapeSeparated",
+                "PPSOnePortrait",
+                "StaplingPortraitBottomLeft",
+                "PlaySolid",
+                "RepeatOff",
+                "Set",
+                "SetSolid",
+                "FuzzyReading",
+                "VerticalBattery0",
+                "VerticalBattery1",
+                "VerticalBattery2",
+                "VerticalBattery3",
+                "VerticalBattery4",
+                "VerticalBattery5",
+                "VerticalBattery6",
+                "VerticalBattery7",
+                "VerticalBattery8",
+                "VerticalBattery9",
+                "VerticalBattery10",
+                "VerticalBatteryCharging0",
+                "VerticalBatteryCharging1",
+                "VerticalBatteryCharging2",
+                "VerticalBatteryCharging3",
+                "VerticalBatteryCharging4",
+                "VerticalBatteryCharging5",
+                "VerticalBatteryCharging6",
+                "VerticalBatteryCharging7",
+                "VerticalBatteryCharging8",
+                "VerticalBatteryCharging9",
+                "VerticalBatteryCharging10",
+                "VerticalBatteryUnknown",
+                "SIMError",
+                "SIMMissing",
+                "SIMLock",
+                "eSIM",
+                "eSIMNoProfile",
+                "eSIMLocked",
+                "eSIMBusy",
+                "NoiseCancelation",
+                "NoiseCancelationOff",
+                "MusicSharing",
+                "MusicSharingOff",
+                "CircleShapeSolid",
+                "WifiCallBars",
+                "WifiCall0",
+                "WifiCall1",
+                "WifiCall2",
+                "WifiCall3",
+                "WifiCall4",
+                "CHTLanguageBar",
+                "ComposeMode",
+                "ExpressiveInputEntry",
+                "EmojiTabMoreSymbols",
+                "WebSearch",
+                "Kiosk",
+                "RTTLogo",
+                "VoiceCall",
+                "GoToMessage",
+                "ReturnToCall",
+                "StartPresenting",
+                "StopPresenting",
+                "ProductivityMode",
+                "SetHistoryStatus",
+                "SetHistoryStatus2",
+                "Keyboardsettings20",
+                "OneHandedRight20",
+                "OneHandedLeft20",
+                "Split20",
+                "Full20",
+                "Handwriting20",
+                "ChevronLeft20",
+                "ChevronLeft32",
+                "ChevronRight20",
+                "ChevronRight32",
+                "Event12",
+                "MicOff2",
+                "DeliveryOptimization",
+                "CancelMedium",
+                "SearchMedium",
+                "AcceptMedium",
+                "RevealPasswordMedium",
+                "DeleteWord",
+                "DeleteWordFill",
+                "DeleteLines",
+                "DeleteLinesFill",
+                "InstertWords",
+                "InstertWordsFill",
+                "JoinWords",
+                "JoinWordsFill",
+                "OverwriteWords",
+                "OverwriteWordsFill",
+                "AddNewLine",
+                "AddNewLineFill",
+                "OverwriteWordsKorean",
+                "OverwriteWordsFillKorean",
+                "EducationIcon",
+                "WindowSnipping",
+                "VideoCapture",
+                "StatusSecured",
+                "NarratorApp",
+                "PowerButtonUpdate",
+                "RestartUpdate",
+                "UpdateStatusDot",
+                "Eject",
+                "Spelling",
+                "SpellingKorean",
+                "SpellingSerbian",
+                "SpellingChinese",
+                "FolderSelect",
+                "SmartScreen",
+                "ExploitProtection",
+                "AddBold",
+                "SubtractBold",
+                "BackSolidBold",
+                "ForwardSolidBold",
+                "PauseBold",
+                "ClickSolid",
+                "SettingsSolid",
+                "MicrophoneSolidBold",
+                "SpeechSolidBold",
+                "ClickedOutLoudSolidBold"
+            ]
+        }
+    }
+    Component {
+        file: "Def.h"
+        name: "Fluent_DarkMode"
+        accessSemantics: "none"
+        exports: ["FluentUI/FluDarkMode 1.0"]
+        isCreatable: false
+        exportMetaObjectRevisions: [256]
+        Enum {
+            name: "Fluent_DarkModeType"
+            values: ["System", "Light", "Dark"]
+        }
+    }
+    Component {
+        file: "WindowHelper.h"
+        name: "WindowHelper"
+        accessSemantics: "reference"
+        prototype: "QObject"
+        exports: ["FluentUI/WindowHelper 1.0"]
+        exportMetaObjectRevisions: [256]
+        Method {
+            name: "initWindow"
+            Parameter { name: "window"; type: "QQuickWindow"; isPointer: true }
+        }
+        Method { name: "deleteWindow" }
+        Method {
+            name: "createRegister"
+            type: "QVariant"
+            Parameter { name: "window"; type: "QQuickWindow"; isPointer: true }
+            Parameter { name: "path"; type: "QString" }
+        }
+    }
+}

+ 1 - 1
module/gui/README.md

@@ -6,7 +6,7 @@
 where python
 cd module/gui
 pyside6-rcc -o qml_rcc.py qml.qrc
-pyside6-rcc -o rec_rcc.py res.qrc
+pyside6-rcc -o res_rcc.py res.qrc
 ```
 
 即可生成rcc文件。当然当你每修改一次qrc指向的资源文件时候就需要运行一次

+ 95 - 0
module/gui/context/add.py

@@ -0,0 +1,95 @@
+# This Python file uses the following encoding: utf-8
+# @author runhey
+# github https://github.com/runhey
+#
+import re
+from pathlib import Path
+from PySide6.QtCore import QObject, Slot, Signal
+
+from module.logger import logger
+
+# 震惊到我姥姥家 除了第一个函数all_script_files是我自己写的
+# 后面的都是github copilot写的
+class Add(QObject):
+    
+    def __init__(self) -> None:
+        super(Add, self).__init__()
+
+
+    @Slot(result="QVariantList")
+    def all_script_files(self) -> list:
+        """
+        获取所有的脚本文件 除了tmplate
+        :return: ['oas1', 'oas2']
+        """
+        # 获取某个路径的所有json文件名
+        config_path = Path.cwd() / 'config'
+        json_files = config_path.glob('*.json')
+        result = []
+        for json in json_files:
+            if json.stem == 'template':
+                continue
+            result.append(json.stem)
+        return result
+
+    @Slot(result="QVariantList")
+    def all_json_file(self) -> list:
+        """
+        获取所有的json文件
+        :return: ['oas1', 'oas2']
+        """
+        # 获取某个路径的所有json文件名
+        config_path = Path.cwd() / 'config'
+        json_files = config_path.glob('*.json')
+        result = []
+        for json in json_files:
+            if json.stem == 'template':
+                result.insert(0, json.stem)
+            else:
+                result.append(json.stem)
+        return result
+
+
+    @Slot(str, str)
+    def copy(self, file: str, template: str = 'template') -> None:
+        """
+        复制一个配置文件
+        :param file:  不带json后缀
+        :param template:
+        :return:
+        """
+        config_path = Path.cwd() / 'config'
+        template_path = config_path / f'{template}.json'
+        file_path = config_path / f'{file}.json'
+        if file_path.exists():
+            logger.error(f'{file_path} is exists')
+            return
+        with open(template_path, 'r') as f:
+            template_content = f.read()
+        with open(file_path, 'w') as f:
+            f.write(template_content)
+        logger.info(f'copy {template_path} to {file_path}')
+
+
+    @Slot(result="QString")
+    def generate_script_name(self) -> str:
+        """
+        生成一个新的配置的名字
+        :return:
+        """
+        all_script_files = self.all_script_files()
+        if not all_script_files:
+            return 'oas1'
+        all_script_files.sort()
+        last_script = all_script_files[-1]
+        last_script_number = re.findall(r'\d+', last_script)[0]
+        new_script_number = int(last_script_number) + 1
+        return f'oas{new_script_number}'
+
+if __name__ == "__main__":
+    a = Add()
+    print(a.all_script_files())
+    print(a.all_json_file())
+    print(a.generate_script_name())
+
+

+ 127 - 0
module/gui/context/process_manager.py

@@ -0,0 +1,127 @@
+# This Python file uses the following encoding: utf-8
+# @author runhey
+# github https://github.com/runhey
+import socket
+import random
+import zerorpc
+
+from PySide6.QtCore import QObject, Slot, Signal
+
+from module.gui.process.script_process import ScriptProcess
+from module.gui.context.add import Add
+from module.logger import logger
+
+
+def is_port_in_use(ip, port) -> bool:
+    """
+    检查端口是否被占用
+    :param ip:
+    :param port:
+    :return:
+    """
+    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+    try:
+        s.connect((ip, port))
+        s.shutdown(2)
+        logger.info(f'port {port} is in use')
+        return True
+    except:
+        logger.info(f'port {port} is not in use')
+        return False
+
+
+
+
+class ProcessManager(QObject):
+    """
+    进程管理
+    """
+
+    def __init__(self) -> None:
+        """
+        init
+        """
+        super().__init__()
+        self.processes = {}  # 持有所有的进程
+        self.ports = {}  # 持有所有的端口
+        self.clients = {}  # zerorpc连接的客户端
+
+    @Slot()
+    def create_all(self) -> None:
+        """
+        创建所有的配置实例
+        :return:
+        """
+        configs = Add().all_script_files()
+        for config in configs:
+            self.add(config)
+
+    def add(self, config: str) -> None:
+        """
+        add
+        :param config:
+        :return:
+        """
+        if config not in self.processes:
+            port = 40000 + random.randint(0, 200)
+            while is_port_in_use('127.0.0.1', port):
+                port = 40000 + random.randint(0, 200)
+            self.ports[config] = port
+            self.processes[config] = ScriptProcess(config, port)
+            logger.info(f'create script {config} on port {port}')
+            try:
+                self.clients[config] = zerorpc.Client()
+                self.clients[config].connect(f'tcp://127.0.0.1:{self.ports[config]}')
+            except:
+                logger.exception(f'connect to script {config} error')
+                raise
+            self.processes[config].start()
+            logger.info(f'add script {config}')
+        else:
+            logger.info(f'script {config} is already running')
+
+    def remove(self, config: str) -> None:
+        """
+        remove
+        :param config:
+        :return:
+        """
+        if config in self.processes:
+            self.processes[config].stop()
+            del self.processes[config]
+            del self.ports[config]
+            del self.clients[config]
+            logger.info(f'remove script {config}')
+            logger.info(f'port {config} is released')
+        else:
+            logger.info(f'script {config} is not running')
+
+    def restart(self, config: str) -> None:
+        """
+        restart
+        :param config:
+        :return:
+        """
+        if config in self.processes:
+            self.processes[config].restart()
+            logger.info(f'restart script {config}')
+        else:
+            logger.info(f'script {config} is not running')
+
+    def stop_all(self) -> None:
+        """
+        stop_all
+        :return:
+        """
+        for config in self.processes:
+            self.processes[config].stop()
+        logger.info(f'stop all script')
+
+    def restart_all(self) -> None:
+        """
+        restart_all
+        :return:
+        """
+        for config in self.processes:
+            self.processes[config].restart()
+        logger.info(f'restart all script')

+ 53 - 0
module/gui/context/settings.py

@@ -0,0 +1,53 @@
+# This Python file uses the following encoding: utf-8
+# @author runhey
+# github https://github.com/runhey
+from pathlib import Path
+from PySide6.QtCore import QObject, Slot, Signal
+
+from module.logger import logger
+
+class Setting(QObject):
+
+    @classmethod
+    def copy_from_template(cls) -> None:
+        """
+        从模板复制一个配置文件
+        :return:
+        """
+        template_path = Path.cwd() / 'module' / 'config' / 'argument' / 'setting-template.json'
+        if not template_path.exists():
+            logger.error('template.json not exists')
+            return
+        with open(template_path, 'r', encoding='utf-8') as f:
+            data = f.read()
+        setting_path = Path.cwd() / 'module' / 'config' / 'argument' / 'setting.json'
+        with open(setting_path, 'w', encoding='utf-8') as f:
+            f.write(data)
+        logger.info('setting.json copy from template.json success')
+
+    @Slot(result="QString")
+    def read(self) -> str:
+        """
+        读取配置文件的数据
+        :return:
+        """
+        setting_path = Path.cwd() / 'module' / 'config' / 'argument' / 'setting.json'
+        if not setting_path.exists():
+            logger.error('setting.json not exists')
+            self.copy_from_template()
+        with open(setting_path, 'r', encoding='utf-8') as f:
+            return f.read()
+
+    @Slot(str)
+    def update(self, data: str) -> None:
+        """
+        更新配置文件的数据
+        :return:
+        """
+        setting_path = Path.cwd() / 'module' / 'config' / 'argument' / 'setting.json'
+        if not setting_path.exists():
+            logger.error('setting.json not exists')
+            self.copy_from_template()
+        with open(setting_path, 'w', encoding='utf-8') as f:
+            f.write(data)
+        logger.info('setting.json update success')

+ 16 - 3
module/gui/fluent_app.py

@@ -33,10 +33,23 @@ class FluentApp():
         QGuiApplication.setApplicationName("oas")
         QGuiApplication.setOrganizationName("oas")
 
-    def run(self):
         FluentApp.engine = QQmlApplicationEngine()
-        FluentApp.engine.addImportPath(os.fspath(Path(__file__).resolve().parent ))
+        FluentApp.engine.addImportPath(os.fspath(Path(__file__).resolve().parent))
+
+    @classmethod
+    def run(cls):
         FluentApp.engine.load(os.fspath(Path(get_work_path() / 'module' / 'gui' / 'qml' / 'app.qml')))
         if not FluentApp.engine.rootObjects():
             sys.exit(-1)
-        sys.exit(FluentApp.app.exec())
+        sys.exit(FluentApp.app.exec())
+
+    @classmethod
+    def set_context_property(cls, context, name: str) -> None:
+        """
+        设置上下文
+        :param name:
+        :param context:
+        :return:
+        """
+        FluentApp.engine.rootContext().setContextProperty(name, context)
+

+ 63 - 0
module/gui/process/script_process.py

@@ -0,0 +1,63 @@
+# This Python file uses the following encoding: utf-8
+# @author runhey
+# github https://github.com/runhey
+
+from multiprocessing import Process
+
+from module.logger import logger
+
+
+class ScriptProcess(Process):
+
+    def __init__(self, config: str, port: int) -> None:
+        """
+
+        :param port: 端口 tcp 127.0.0.1:port
+        :param config: 如oas1
+        """
+        super().__init__()
+        self.config = config
+        self.port = port
+        self.name = config
+        self.daemon = True  # 设置为守护进程,主进程结束,子进程也结束
+
+    @property
+    def alive(self) -> bool:
+        """
+        alive
+        :return:
+        """
+        return self.is_alive()
+
+    def run(self) -> None:
+        """
+        run
+        :return:
+        """
+        try:
+            from script import Script
+            script = Script(config_name=self.config)
+            script.init_server(self.port)
+            script.run_server()
+        except:
+            logger.exception(f'run script {self.config} error')
+            raise
+
+    def stop(self) -> None:
+        """
+        stop the  process
+        是强制的,不会等待子进程结束
+        :return:
+        """
+        self.terminate()
+        self.join()
+        logger.info(f'stop script {self.config}')
+
+    def restart(self) -> None:
+        """
+        restart the process
+        :return:
+        """
+        self.stop()
+        self.start()
+        logger.info(f'restart script {self.config}')

+ 11 - 0
module/gui/qml.qrc

@@ -11,5 +11,16 @@
         <file>qml/Component/SplitPanel.qml</file>
         <file>qml/Component/OverStatus.qml</file>
         <file>qml/Component/RunStatusIcon.qml</file>
+        <file>qml/Component/Add.qml</file>
+        <file>qml/Component/FluDialog.qml</file>
+        <file>qml/Component/FComboBox.qml</file>
+        <file>qml/Component/FItemDelegate.qml</file>
+        <file>qml/Page/ScriptView.qml</file>
+        <file>qml/Component/ScriptItem.qml</file>
+        <file>qml/Component/Overview.qml</file>
+        <file>qml/Page/Home.qml</file>
+        <file>qml/Page/Update.qml</file>
+        <file>qml/Component/Args.qml</file>
+        <file>qml/Component/Taskmini.qml</file>
     </qresource>
 </RCC>

+ 137 - 0
module/gui/qml/Component/Add.qml

@@ -0,0 +1,137 @@
+import QtQuick
+import QtQuick.Layouts
+import QtQuick.Window
+import QtQuick.Controls
+import FluentUI
+import "../Global"
+
+FluContentDialog{
+    id:dialog
+    title:"Add new config"
+
+    signal updateScriptItems
+
+    contentItem: Rectangle {
+        id:layout_content
+        implicitWidth:minWidth
+        implicitHeight: text_title.height + contextC.height + layout_actions.height
+        color:FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(249/255,249/255,249/255,1)
+        radius:5
+        FluShadow{
+            radius: 5
+        }
+        FluText{
+            id:text_title
+            font: FluTextStyle.Subtitle
+            text:title
+            topPadding: 20
+            leftPadding: 20
+            rightPadding: 20
+            wrapMode: Text.WrapAnywhere
+            horizontalAlignment: Text.AlignHCenter
+            anchors{
+                top:parent.top
+                left: parent.left
+                right: parent.right
+            }
+        }
+        Column{
+            id: contextC
+            anchors{
+                horizontalCenter: parent.horizontalCenter
+                top: text_title.bottom
+            }
+            spacing: 10
+            FluText{
+                text: 'New name'
+                leftPadding: 6
+                font: FluTextStyle.Caption
+            }
+            FluTextBox{
+                id: newNameBox
+                placeholderText:"推荐:oas+number"
+            }
+            FluText{
+                text: 'Copy from existing config'
+                leftPadding: 6
+                font: FluTextStyle.Caption
+            }
+            FComboBox{
+                id: copyConfig
+                width: newNameBox.width
+                model: ["Option 1", "Option 2", "Option 3"]
+            }
+        }
+        Rectangle{
+            id:layout_actions
+            height: 68
+            radius: 5
+            color: FluTheme.dark ? Qt.rgba(32/255,32/255,32/255,1) : Qt.rgba(243/255,243/255,243/255,1)
+            anchors{
+                top:contextC.bottom
+                topMargin: 12
+                left: parent.left
+                right: parent.right
+            }
+            RowLayout{
+                anchors
+                {
+                    centerIn: parent
+                    margins: spacing
+                    fill: parent
+                }
+                spacing: 15
+                FluButton{
+                    id:neutral_btn
+                    Layout.fillWidth: true
+                    Layout.fillHeight: true
+                    visible: dialog.buttonFlags&FluContentDialog.NeutralButton
+                    text: neutralText
+                    onClicked: {
+                        dialog.close()
+                        neutralClicked()
+                    }
+                }
+                FluButton{
+                    id:negative_btn
+                    Layout.fillWidth: true
+                    Layout.fillHeight: true
+                    visible: dialog.buttonFlags&FluContentDialog.NegativeButton
+                    text: negativeText
+                    onClicked: {
+                        dialog.close()
+                        negativeClicked()
+                    }
+                }
+                FluFilledButton{
+                    id:positive_btn
+                    Layout.fillWidth: true
+                    Layout.fillHeight: true
+                    visible: dialog.buttonFlags&FluContentDialog.PositiveButton
+                    text: positiveText
+                    onClicked: {
+                        dialog.close()
+                        positiveClicked()
+                    }
+                }
+            }
+        }
+    }
+
+    negativeText:"取消"
+    buttonFlags: FluContentDialog.NegativeButton | FluContentDialog.PositiveButton
+    onNegativeClicked:{
+        showSuccess("取消创建")
+    }
+    positiveText:"确定"
+    onPositiveClicked:{
+        showSuccess("已创建")
+        add_config.copy(newNameBox.text, copyConfig.currentText)
+        dialog.updateScriptItems()
+    }
+
+    onOpened: {
+        newNameBox.text = add_config.generate_script_name()
+        copyConfig.model = add_config.all_json_file()
+    }
+}

+ 8 - 0
module/gui/qml/Component/Args.qml

@@ -0,0 +1,8 @@
+import QtQuick
+import FluentUI
+
+Item {
+    FluText{
+        text: 'this args '
+    }
+}

+ 128 - 0
module/gui/qml/Component/FComboBox.qml

@@ -0,0 +1,128 @@
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls.Basic
+import FluentUI
+import QtQuick.Templates as T
+
+ComboBox {
+    id: control
+    property bool disabled: false
+    property color normalColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(254/255,254/255,254/255,1)
+    property color hoverColor: FluTheme.dark ? Qt.rgba(68/255,68/255,68/255,1) : Qt.rgba(251/255,251/255,251/255,1)
+    property color disableColor: FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(252/255,252/255,252/255,1)
+    implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
+                            implicitContentWidth + leftPadding + rightPadding)
+    implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
+                             implicitContentHeight + topPadding + bottomPadding,
+                             implicitIndicatorHeight + topPadding + bottomPadding)
+
+    leftPadding: padding + (!control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing)
+    rightPadding: padding + (control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing)
+    enabled: !disabled
+    delegate: FItemDelegate{
+        width: ListView.view.width
+        text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData
+        palette.text: control.palette.text
+        palette.highlightedText: control.palette.highlightedText
+        font.weight: control.currentIndex === index ? Font.DemiBold : Font.Normal
+        highlighted: control.highlightedIndex === index
+        hoverEnabled: control.hoverEnabled
+    }
+
+    indicator: FluIcon {
+        x: control.mirrored ? control.padding : control.width - width - control.padding
+        y: control.topPadding + (control.availableHeight - height) / 2
+        width: 28
+        iconSource:FluentIcons.ChevronDown
+        iconSize: 15
+        opacity: enabled ? 1 : 0.3
+    }
+
+    contentItem: T.TextField {
+        property bool disabled: !control.editable
+        leftPadding: !control.mirrored ? 12 : control.editable && activeFocus ? 3 : 1
+        rightPadding: control.mirrored ? 12 : control.editable && activeFocus ? 3 : 1
+        topPadding: 6 - control.padding
+        bottomPadding: 6 - control.padding
+        renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering
+        selectionColor: FluTheme.primaryColor.lightest
+        text: control.editable ? control.editText : control.displayText
+        enabled: control.editable
+        autoScroll: control.editable
+        font:FluTextStyle.Body
+        readOnly: control.down
+        color: FluTheme.dark ?  Qt.rgba(255/255,255/255,255/255,1) : Qt.rgba(27/255,27/255,27/255,1)
+        inputMethodHints: control.inputMethodHints
+        validator: control.validator
+        selectByMouse: true
+        verticalAlignment: Text.AlignVCenter
+        leftInset:1
+        topInset:1
+        bottomInset:1
+        rightInset:1
+        background: FluTextBoxBackground{
+            border.width: 0
+            inputItem: contentItem
+        }
+    }
+
+    background: Rectangle {
+        implicitWidth: 140
+        implicitHeight: 28
+        border.color: FluTheme.dark ? "#505050" : "#DFDFDF"
+        border.width: 1
+        visible: !control.flat || control.down
+        radius: 4
+        FluFocusRectangle{
+            visible: control.visualFocus
+            radius:8
+        }
+        color:{
+            if(disabled){
+                return disableColor
+            }
+            return hovered ? hoverColor :normalColor
+        }
+    }
+
+    popup: T.Popup {
+        y: control.height
+        width: control.width
+        height: Math.min(contentItem.implicitHeight, control.Window.height - topMargin - bottomMargin)
+        topMargin: 6
+        bottomMargin: 6
+        contentItem: ListView {
+            clip: true
+            implicitHeight: contentHeight
+            model: control.delegateModel
+            currentIndex: control.highlightedIndex
+            highlightMoveDuration: 0
+            T.ScrollIndicator.vertical: ScrollIndicator { }
+        }
+        enter: Transition {
+            NumberAnimation {
+                property: "opacity"
+                from:0
+                to:1
+                duration: 83
+            }
+        }
+        exit:Transition {
+            NumberAnimation {
+                property: "opacity"
+                from:1
+                to:0
+                duration: 83
+            }
+        }
+        background:Rectangle{
+            color:FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(249/255,249/255,249/255,1)
+            border.color: FluTheme.dark ? Window.active ? Qt.rgba(55/255,55/255,55/255,1):Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,229/255,234/255,1)
+            border.width: 1
+            radius: 5
+            FluShadow{
+                radius: 5
+            }
+        }
+    }
+}

+ 39 - 0
module/gui/qml/Component/FItemDelegate.qml

@@ -0,0 +1,39 @@
+import QtQuick
+import QtQuick.Controls.Basic
+import QtQuick.Templates as T
+import FluentUI
+
+T.ItemDelegate {
+    id: control
+
+    implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
+                            implicitContentWidth + leftPadding + rightPadding)
+    implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
+                             implicitContentHeight + topPadding + bottomPadding,
+                             implicitIndicatorHeight + topPadding + bottomPadding)
+
+    padding: 12
+    spacing: 8
+
+    icon.width: 24
+    icon.height: 24
+    icon.color: control.palette.text
+
+    contentItem: FluText {
+        text: control.text
+        font: control.font
+    }
+
+    background: Rectangle {
+        implicitWidth: 100
+        implicitHeight: 40
+        color:{
+            if(FluTheme.dark){
+                return Qt.rgba(1,1,1,0.05)
+            }else{
+                return Qt.rgba(0,0,0,0.05)
+            }
+        }
+        visible: control.down || control.highlighted || control.visualFocus
+    }
+}

+ 5 - 0
module/gui/qml/Component/FluDialog.qml

@@ -0,0 +1,5 @@
+import QtQuick 2.0
+
+Item {
+
+}

+ 146 - 0
module/gui/qml/Component/Overview.qml

@@ -0,0 +1,146 @@
+import QtQuick
+import QtQuick.Layouts
+import FluentUI
+
+Item {
+
+
+
+    Item{
+        id: leftScheduler
+        width: 260
+        anchors{
+            left: parent.left
+            top: parent.top
+            bottom: parent.bottom
+        }
+        FluArea{
+            id: schedulerOpen
+            anchors.top: parent.top
+            width: parent.width
+            height: 50
+            RowLayout{
+                anchors.fill: parent
+                FluText{
+                    text: 'Scheduler'
+                    Layout.leftMargin: 16
+                    font: FluTextStyle.Subtitle
+                    Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
+                }
+                FluToggleButton{
+                    Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
+                    Layout.rightMargin: 16
+                    text:"Start"
+                    onClicked: {
+                        selected = !selected
+                        if(selected){
+                            text = "Start"
+                        }else{
+                            text = "Stop"
+                        }
+                    }
+                }
+            }
+        }
+        FluArea{
+            id: schedulerRunning
+            anchors.top: schedulerOpen.bottom
+            anchors.topMargin: 10
+            width: parent.width
+            height: 120
+            ColumnLayout{
+                width: parent.width
+                spacing: 8
+                FluText{
+                    text: 'Running'
+                    Layout.leftMargin: 16
+                    Layout.topMargin: 6
+                    font: FluTextStyle.Subtitle
+                }
+                Rectangle{
+                    width: schedulerRunning.width - 20
+                    height: 2
+                    Layout.alignment: Qt.AlignHCenter
+                    color: FluTheme.dark ? Qt.rgba(64/255, 68/255, 75/255, 1) : Qt.rgba(234/255, 236/255, 239/255, 1)
+                    radius: 2
+                }
+                Taskmini{
+                    Layout.leftMargin: 16
+                }
+            }
+        }
+        FluArea{
+            id: schedulerPending
+            anchors.top: schedulerRunning.bottom
+            anchors.topMargin: 10
+            width: parent.width
+            height: 240
+            ColumnLayout{
+                width: parent.width
+                spacing: 8
+                FluText{
+                    text: 'Pending'
+                    Layout.leftMargin: 16
+                    Layout.topMargin: 6
+                    font: FluTextStyle.Subtitle
+                }
+                Rectangle{
+                    width: schedulerRunning.width - 20
+                    height: 2
+                    Layout.alignment: Qt.AlignHCenter
+                    color: FluTheme.dark ? Qt.rgba(64/255, 68/255, 75/255, 1) : Qt.rgba(234/255, 236/255, 239/255, 1)
+                    radius: 2
+                }
+                Taskmini{
+                    Layout.leftMargin: 16
+                }
+                Taskmini{
+                    Layout.leftMargin: 16
+                }
+                Taskmini{
+                    Layout.leftMargin: 16
+                }
+                Taskmini{
+                    Layout.leftMargin: 16
+                }
+            }
+        }
+        FluArea{
+            id: schedulerWaiting
+            anchors.top: schedulerPending.bottom
+            anchors.topMargin: 10
+            anchors.bottom: parent.bottom
+            anchors.bottomMargin: 0
+            width: parent.width
+            ColumnLayout{
+                width: parent.width
+                spacing: 8
+                FluText{
+                    Layout.fillHeight: false
+                    text: 'Waiting'
+                    Layout.leftMargin: 16
+                    Layout.topMargin: 6
+                    font: FluTextStyle.Subtitle
+                }
+                Rectangle{
+                    Layout.fillHeight: false
+                    width: schedulerPending.width - 20
+                    height: 2
+                    Layout.alignment: Qt.AlignHCenter
+                    color: FluTheme.dark ? Qt.rgba(64/255, 68/255, 75/255, 1) : Qt.rgba(234/255, 236/255, 239/255, 1)
+                    radius: 2
+                }
+                Taskmini{
+                    Layout.leftMargin: 16
+                    Layout.fillHeight: false
+                }
+            }
+        }
+    }
+    FluArea{
+        anchors.left: leftScheduler.right
+        anchors.leftMargin: 10
+        height: parent.height
+        anchors.right: parent.right
+    }
+}

+ 11 - 0
module/gui/qml/Component/ScriptItem.qml

@@ -0,0 +1,11 @@
+import QtQuick
+import FluentUI
+import "../Global/"
+
+FluPaneItem{
+    title: "home"
+    icon:FluentIcons.Play36
+    onTap:{
+        navigationView.push(Qt.resolvedUrl("../../qml/Page/ScriptView.qml"))
+    }
+}

+ 82 - 8
module/gui/qml/Component/SplitPanel.qml

@@ -1,8 +1,11 @@
 import QtQuick
 import QtQuick.Controls
 import FluentUI
+import "../Global"
 
 Item {
+    id: splitPanel
+    property string title: ""
 
     // 左边菜单
     FluArea{
@@ -13,17 +16,18 @@ Item {
         FluTreeView{
             id: menu_tree
             anchors.fill: parent
-            Component.onCompleted: {
-                var datas = []
-                datas.push(createItem("Node1",false))
-                datas.push(createItem("Node2",false))
-                datas.push(createItem("Node2",true,[createItem("Node2-1",false),createItem("Node2-2",false)]))
-                updateData(datas)
-            }
+            selectionMode: FluTabView.SizeToContent
+
+            onItemClicked:(model)=>{
+                    MainEvent.menuTitle = model.text
+                    splitPanel.title = model.text
+                    showSuccess(model.text)
+                }
         }
     }
     // 右边内容
-    FluArea{
+    Loader{
+        id: contentDefalut
         anchors.right: parent.right
         anchors.rightMargin: 12
         anchors.left: menuArea.right
@@ -32,4 +36,74 @@ Item {
         anchors.bottom: parent.bottom
         anchors.bottomMargin: 12
     }
+    Loader{
+        id: contentLoader
+        anchors.right: parent.right
+        anchors.rightMargin: 12
+        anchors.left: menuArea.right
+        anchors.leftMargin: 12
+        anchors.top: parent.top
+        anchors.bottom: parent.bottom
+        anchors.bottomMargin: 12
+    }
+
+    Component.onCompleted: {
+        var datas = []
+        datas.push(menu_tree.createItem("Home",false))
+        datas.push(menu_tree.createItem("Update",false))
+//        datas.push(menu_tree.createItem("Node2",true,[createItem("Node2-1",false),createItem("Node2-2",false)]))
+        menu_tree.updateData(datas)
+    }
+    //创建左边的菜单,最多两级
+    //['home', 'xxx':['x1', 'x2']]
+    function create(data){
+        var datas = []
+        for(var items in data){
+            if(items.length === 0){
+                datas.push(menu_tree.createItem(items,false))
+            }else{
+                var da = []
+                for(var item in data[items]){
+                    da.push(menu_tree.createItem(data[items][item], false))
+                }
+                datas.push(menu_tree.createItem(items, true, da))
+            }
+        }
+        menu_tree.updateData(datas)
+    }
+
+    //右侧的分为两个部分一个部分是contentDefalut表示固定的不动的
+    //第二个部分是一个加载器动态加载不同的组件
+    //显示固定的部分
+    function showDefalut(){
+        contentDefalut.visible = true
+        contentLoader.visible = false
+    }
+    //显示不固定的
+    function showLoader(){
+        contentDefalut.visible = false
+        contentLoader.visible = true
+    }
+
+    //设置固定的部分的具体内容  主要是传一个组件
+    function setDefalut(component){
+        contentDefalut.sourceComponent = component
+        showDefalut()
+    }
+    //
+    function setLoader(component){
+        contentLoader.sourceComponent = component
+        showLoader()
+    }
+
+    //获取固定的部分的对象的,方便更改属性
+//    function getDefalut(){
+//        return contentDefalut.item
+//    }
+//    //方便更改属性
+//    function getDefalut(){
+//        return contentLoader.item
+//    }
+
+
 }

+ 44 - 0
module/gui/qml/Component/Taskmini.qml

@@ -0,0 +1,44 @@
+import QtQuick
+import QtQuick.Layouts
+import FluentUI
+// 这个组件是在总览那儿小小的显示
+// 任务的名称 + 时间 以及一个设置的入口
+
+Item {
+    width: 225
+    height: 40
+    FluText{
+        id: taskName
+        anchors{
+            left: parent.left
+            leftMargin: 0
+            top: parent.top
+            topMargin: 0
+        }
+        text: "taskName"
+        font: FluTextStyle.BodyStrong
+    }
+    FluText{
+        id: taskTime
+        anchors{
+            left: parent.left
+            leftMargin: 0
+            bottom: parent.bottom
+            bottomMargin: 0
+        }
+        text: "2023-05-26 18:33:55"
+        font: FluTextStyle.Caption
+    }
+    FluButton{
+        id: settingButton
+        anchors{
+            right: parent.right
+            rightMargin: 0
+            verticalCenter: parent.verticalCenter
+        }
+        text:"setting"
+        onClicked: {
+             showSuccess("setting")
+        }
+    }
+}

+ 9 - 1
module/gui/qml/Global/ItemsFooter.qml

@@ -2,6 +2,7 @@ pragma Singleton
 
 import QtQuick
 import FluentUI
+import "../Global/"
 
 FluObject{
 
@@ -12,7 +13,14 @@ FluObject{
     FluPaneItemSeparator{}
 
     FluPaneItem{
-        title: "关于"
+        title: "add"
+        icon: FluentIcons.Add
+        onTap:{
+            MainEvent.addOpen = !MainEvent.addOpen
+        }
+    }
+    FluPaneItem{
+        title: "about"
         icon:FluentIcons.Contact
         tapFunc:function(){
             console.debug("this click about")

+ 47 - 8
module/gui/qml/Global/ItemsOriginal.qml

@@ -2,6 +2,7 @@ pragma Singleton
 
 import QtQuick
 import FluentUI
+import "../Global/"
 
 FluObject{
     id: itemsOriginal
@@ -14,14 +15,6 @@ FluObject{
             navigationView.push(Qt.resolvedUrl("../../qml/Page/O_Home.qml"))
         }
     }
-    FluPaneItem{
-        title: "add"
-        icon: FluentIcons.Add
-        onTap:{
-            navigationView.push(Qt.resolvedUrl("../../qml/Page/O_Add.qml"))
-        }
-    }
-
     function getRecentlyAddedData(){
         var arr = []
         for(var i=0;i<children.length;i++){
@@ -69,5 +62,51 @@ FluObject{
     function startPageByItem(data){
         navigationView.startPageByItem(data)
     }
+    //获取现在存在的所有的Item
+    function allPaneItems(){
+        var arr = []
+        var items = navigationView.getItems();
+        for(var i=0;i<items.length;i++){
+            var item = items[i]
+            if(item instanceof FluPaneItem){
+                arr.push(item.title)
+            }
+        }
+        return arr
+    }
+
+    //动态添加Paneitem
+    function createPaneItem(configName){
+        var component = Qt.createComponent("../../qml/Component/ScriptItem.qml")
+        if (component.status === Component.Ready) {
+            var object = component.createObject(itemsOriginal, {
+                title: configName
+            });
+
+            if (object !== null) {
+                object.title = configName
+                // 创建成功,可以进行操作
+                children.push(object)
+//                children.insert(children.length -1, object)
+//                children.splice(children.length-1, object)
+            } else {
+                // 创建失败
+            }
+        } else {
+            // 组件加载失败
+        }
+    }
+    //给添加
+    function addFluPaneItems(){
+        var configs = add_config.all_script_files()
+        var exists = allPaneItems()
+        for(var i=0; i<configs.length; i++){
+            if(exists.includes(configs[i])){
+                console.debug('已经存在了:'+configs[i])
+            }else{
+            createPaneItem(configs[i])
+            }
+        }
+    }
 
 }

+ 99 - 0
module/gui/qml/Global/MainEvent.qml

@@ -4,7 +4,9 @@ import QtQuick
 import QtQuick.Controls
 import FluentUI
 
+
 QtObject {
+    id: mainEvent
     enum RunStatus {
         Error,
         Run,
@@ -12,7 +14,104 @@ QtObject {
         Empty //不显示
     }
 
+    // 界面的自定义设置
+    property var settings: {""}
     property int displayMode : FluNavigationView.Compact
+    property int darkMode: FluDarkMode.System
+    property QtObject primaryColor: FluColors.Orange
+    property bool nativeText: true
+    property string language: "zh-CN"
+
     property int runStatus: MainEvent.RunStatus.Empty
     property string menuTitle: "主页"
+    property bool addOpen: false
+    property string scriptName: ""
+
+    Component.onCompleted:{
+        var set = JSON.parse(setting.read())
+        mainEvent.settings = set
+        if(mainEvent.settings === ""){
+            mainEvent.settings = {
+                "displayMode": 1,
+                "darkMode": 2,
+                "primaryColor": "Orange",
+                "nativeText": true,
+                "language": "zh-CN"}
+        }
+
+        mainEvent.displayMode = set["displayMode"]
+        mainEvent.darkMode = set["darkMode"]
+        mainEvent.nativeText = set["nativeText"]
+        mainEvent.language = set["language"]
+
+        var primary_color = set["primaryColor"]
+        if(primary_color === "Yellow"){mainEvent.primaryColor = FluColors.Yellow}
+        else if(primary_color === "Orange"){mainEvent.primaryColor = FluColors.Orange}
+        else if(primary_color === "Red"){mainEvent.primaryColor = FluColors.Red}
+        else if(primary_color === "Magenta"){mainEvent.primaryColor = FluColors.Magenta}
+        else if(primary_color === "Purple"){mainEvent.primaryColor = FluColors.Purple}
+        else if(primary_color === "Blue"){mainEvent.primaryColor = FluColors.Blue}
+        else if(primary_color === "Teal"){mainEvent.primaryColor = FluColors.Teal}
+        else if(primary_color === "Green"){mainEvent.primaryColor = FluColors.Green}
+    }
+    onDisplayModeChanged: {
+        if(mainEvent.settings === ""){
+            console.debug('display mode and is none')
+        }
+
+        mainEvent.settings["displayMode"] = mainEvent.displayMode
+        setting.update(JSON.stringify(mainEvent.settings))
+//        showSuccess('update dark mode')
+    }
+    onDarkModeChanged: {
+        if(mainEvent.settings === ""){
+            console.debug('darkMode and is none')
+        }
+        FluTheme.darkMode = mainEvent.darkMode
+        mainEvent.settings["darkMode"] = FluTheme.darkMode
+        setting.update(JSON.stringify(mainEvent.settings))
+//        showSuccess('update dark mode' + FluTheme.darkMode)
+    }
+    onPrimaryColorChanged: {
+        if(mainEvent.settings === ""){
+            console.debug('primaryColor and is none')
+            var set = JSON.parse(setting.read())
+            mainEvent.settings = set
+            return
+        }
+
+        FluTheme.primaryColor = mainEvent.primaryColor
+        var primary_color = "Yellow"
+        if(FluTheme.primaryColor === FluColors.Yellow){primary_color="Yellow"}
+        else if(FluTheme.primaryColor === FluColors.Orange){primary_color="Orange"}
+        else if(FluTheme.primaryColor === FluColors.Red){primary_color="Red"}
+        else if(FluTheme.primaryColor === FluColors.Magenta){primary_color="Magenta"}
+        else if(FluTheme.primaryColor === FluColors.Purple){primary_color="Purple"}
+        else if(FluTheme.primaryColor === FluColors.Blue){primary_color="Blue"}
+        else if(FluTheme.primaryColor === FluColors.Teal){primary_color="Teal"}
+        else if(FluTheme.primaryColor === FluColors.Green){primary_color="Green"}
+        mainEvent.settings["primaryColor"] = primary_color
+        setting.update(JSON.stringify(mainEvent.settings))
+//        showSuccess('update primary color' + FluTheme.primaryColor)
+    }
+    onNativeTextChanged: {
+        if(mainEvent.settings === ""){
+            console.debug('nativeText and is none')
+        }
+
+        FluTheme.nativeText = mainEvent.nativeText
+        mainEvent.settings["nativeText"] = FluTheme.nativeText
+        setting.update(JSON.stringify(mainEvent.settings))
+//        var message = 'update native text' + FluTheme.nativeText
+//        showSuccess(message)
+    }
+    onLanguageChanged: {
+        if(mainEvent.settings === ""){
+            console.debug('language and is none')
+        }
+
+        mainEvent.settings["language"] = mainEvent.language
+        setting.update(JSON.stringify(mainEvent.settings))
+//        showSuccess('update language' + mainEvent.language)
+    }
 }

+ 17 - 4
module/gui/qml/MainWindow.qml

@@ -11,14 +11,13 @@ import "./Component/"
 FluWindow {
     id:window
     title: "oas"
-    width: 1000
+    width: 1100
     height: 720
     closeDestory:false
     minimumWidth: 520
     minimumHeight: 460
     launchMode: FluWindow.SingleTask
 
-
     FluAppBar{
        id:appbar
        z:9
@@ -57,6 +56,18 @@ FluWindow {
             }
     }
 
+    //添加一份脚本实例的dialog
+    Add{
+        id: add
+        property bool add_open: MainEvent.addOpen
+        onAdd_openChanged: {
+            add.open()
+        }
+        onUpdateScriptItems: {
+            nav_view.items.addFluPaneItems()
+            process_manager.create_all()
+        }
+    }
 
     FluNavigationView{
         id:nav_view
@@ -71,9 +82,11 @@ FluWindow {
             items.navigationView = nav_view
             footerItems.navigationView = nav_view
             nav_view.setCurrentIndex(0)
+            items.addFluPaneItems()
         }
     }
-
-
+    Component.onCompleted:{
+        process_manager.create_all()
+    }
 
 }

+ 26 - 0
module/gui/qml/Page/Home.qml

@@ -0,0 +1,26 @@
+import QtQuick
+import QtQuick.Layouts
+import FluentUI
+
+FluScrollablePage{
+    spacing: 6
+    Image {
+        id: name
+        Layout.preferredHeight: 40
+        Layout.preferredWidth: 40
+        Layout.alignment: Qt.AlignHCenter
+        source: "qrc:/res/icon.png"
+    }
+    FluText{
+//        Layout.fillWidth: true
+        text: "OAS是一款致力于全自动化的阴阳师脚本"
+        font: FluTextStyle.Title
+        Layout.alignment: Qt.AlignHCenter
+    }
+    FluText{
+        text: "https://github.com/runhey/OnmyojiAutoScript"
+        font: FluTextStyle.Body
+        Layout.alignment: Qt.AlignHCenter
+    }
+
+}

+ 19 - 0
module/gui/qml/Page/O_Home.qml

@@ -9,5 +9,24 @@ import "../Component"
 
 SplitPanel{
 
+    onTitleChanged: {
+        if(title === "Home"){
+            var comp = Qt.createComponent("../../qml/Page/Home.qml")
+            if (comp.status === Component.Ready) {
+                setLoader(comp)
+            }
+        }else if(title === "Update"){
+            var updater = Qt.createComponent("../../qml/Page/Update.qml")
+            if (updater.status === Component.Ready) {
+                setLoader(updater)
+            }
+        }
+    }
+    Component.onCompleted:{
+        var comp = Qt.createComponent("../../qml/Page/Home.qml")
+        if (comp.status === Component.Ready) {
+            setDefalut(comp)
+        }
+    }
 }
 

+ 5 - 5
module/gui/qml/Page/O_Settings.qml

@@ -32,10 +32,10 @@ FluScrollablePage{
             Repeater{
                 model: [{title:"System",mode:FluDarkMode.System},{title:"Light",mode:FluDarkMode.Light},{title:"Dark",mode:FluDarkMode.Dark}]
                 delegate:  FluRadioButton{
-                    selected : FluTheme.darkMode === modelData.mode
+                    selected : MainEvent.darkMode === modelData.mode
                     text:modelData.title
                     onClicked:{
-                        FluTheme.darkMode = modelData.mode
+                        MainEvent.darkMode = modelData.mode
                     }
                 }
             }
@@ -107,7 +107,7 @@ FluScrollablePage{
                             anchors.fill: parent
                             hoverEnabled: true
                             onClicked: {
-                                FluTheme.primaryColor = modelData
+                                MainEvent.primaryColor = modelData
                             }
                         }
                     }
@@ -119,9 +119,9 @@ FluScrollablePage{
             }
             FluToggleSwitch{
                 Layout.topMargin: 5
-                selected: FluTheme.nativeText
+                selected: MainEvent.nativeText
                 clickFunc:function(){
-                    FluTheme.nativeText = !FluTheme.nativeText
+                    MainEvent.nativeText = !MainEvent.nativeText
                 }
             }
         }

+ 37 - 0
module/gui/qml/Page/ScriptView.qml

@@ -0,0 +1,37 @@
+import QtQuick
+import QtQuick.Controls
+import FluentUI
+import "../Component"
+import "../Global"
+
+SplitPanel{
+
+    property string configName: ""
+    onTitleChanged: {
+        if(title === "Overview"){
+            showDefalut()
+        }
+        else{
+            var component = Qt.createComponent("../../qml/Component/Args.qml")
+            if (component.status === Component.Ready) {
+                setLoader(component)
+            }else{
+                // 组件加载失败
+            }
+        }
+    }
+
+
+    Component.onCompleted:{
+        var data = {'Overview':[], 'Script': ['Script', 'General', 'Restart']}
+        create(data)
+
+        var component = Qt.createComponent("../../qml/Component/Overview.qml")
+        if (component.status === Component.Ready) {
+            setDefalut(component)
+        } else {
+            // 组件加载失败
+            console.debug('组件加载失败')
+        }
+    }
+}

+ 9 - 0
module/gui/qml/Page/Update.qml

@@ -0,0 +1,9 @@
+import QtQuick
+import FluentUI
+
+FluScrollablePage{
+
+    FluText{
+        text: '显示github的更新信息'
+    }
+}

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1194 - 203
module/gui/qml_rcc.py


+ 1 - 0
module/gui/res.qrc

@@ -2,5 +2,6 @@
     <qresource prefix="/">
         <file>res/icon.ico</file>
         <file>res/exclamation-triangle-fill.svg</file>
+        <file>res/icon.png</file>
     </qresource>
 </RCC>

binární
module/gui/res/icon.png


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 33927 - 0
module/gui/res_rcc.py


+ 2 - 1
requirements-in.txt

@@ -8,4 +8,5 @@ numpy==1.24.3
 opencv-python==4.7.0.72
 websockets==11.0.3
 anytree==2.8.0
-pywin32==306
+pywin32==306
+zerorpc==0.6.3

+ 16 - 1
requirements.txt

@@ -8,9 +8,11 @@
 --trusted-host pypi.tuna.tsinghua.edu.cn
 
 adbutils==0.11.0          # via -r requirements-in.txt, uiautomator2
+anytree==2.8.0            # via -r requirements-in.txt
 apkutils2==1.0.0          # via adbutils
 cached-property==1.5.2    # via uiautomator2
 certifi==2023.5.7         # via requests
+cffi==1.15.1              # via gevent
 charset-normalizer==3.1.0  # via requests
 cigam==0.0.3              # via apkutils2
 colorama==0.4.6           # via logzero
@@ -18,32 +20,45 @@ decorator==5.1.1          # via retry
 deprecated==1.2.13        # via uiautomator2
 deprecation==2.1.0        # via adbutils
 filelock==3.12.0          # via uiautomator2
+future==0.18.3            # via zerorpc
+gevent==22.10.2           # via zerorpc
+greenlet==2.0.2           # via gevent
 idna==3.4                 # via requests
 logzero==1.7.0            # via uiautomator2
 lxml==4.9.2               # via uiautomator2
 markdown-it-py==2.2.0     # via rich
 mdurl==0.1.2              # via markdown-it-py
+msgpack==1.0.5            # via zerorpc
 numpy==1.24.3             # via -r requirements-in.txt, opencv-python
 opencv-python==4.7.0.72   # via -r requirements-in.txt
 packaging==20.9           # via deprecation, uiautomator2
 pillow==9.5.0             # via uiautomator2
 progress==1.6             # via uiautomator2
 py==1.11.0                # via retry
+pycparser==2.21           # via cffi
 pyelftools==0.29          # via apkutils2
 pygments==2.15.1          # via rich
 pyparsing==3.0.9          # via packaging
 pyside6==6.4.3            # via -r requirements-in.txt
 pyside6-addons==6.4.3     # via pyside6
 pyside6-essentials==6.4.3  # via pyside6, pyside6-addons
+pywin32==306              # via -r requirements-in.txt
 pyyaml==6.0               # via -r requirements-in.txt
+pyzmq==25.0.2             # via zerorpc
 requests==2.30.0          # via adbutils, uiautomator2
 retry==0.9.2              # via adbutils, uiautomator2
 rich==13.3.5              # via -r requirements-in.txt
 shiboken6==6.4.3          # via pyside6, pyside6-addons, pyside6-essentials
-six==1.16.0               # via adbutils, uiautomator2
+six==1.16.0               # via adbutils, anytree, uiautomator2
 uiautomator2==2.16.17     # via -r requirements-in.txt
 urllib3==2.0.2            # via requests
 websockets==11.0.3        # via -r requirements-in.txt
 whichcraft==0.6.1         # via adbutils, uiautomator2
 wrapt==1.15.0             # via deprecated
 xmltodict==0.13.0         # via apkutils2
+zerorpc==0.6.3            # via -r requirements-in.txt
+zope-event==4.6           # via gevent
+zope-interface==6.0       # via gevent
+
+# The following packages are considered to be unsafe in a requirements file:
+# setuptools

+ 49 - 4
script.py

@@ -1,18 +1,63 @@
 # This Python file uses the following encoding: utf-8
 # @author runhey
 # github https://github.com/runhey
-
+import zerorpc
+import zmq
+import random
 from cached_property import cached_property
 
-from module.device.device import Device
+from module.logger import logger
+from module.exception import *
 
 class Script:
     def __init__(self, config_name: str ='oas') -> None:
+        self.server = None
         self.config_name = config_name
 
     @cached_property
-    def device(self) -> Device:
-        pass
+    def config(self) -> "Config":
+        try:
+            from module.config.config import Config
+            config = Config(config_name=self.config_name)
+            return config
+        except RequestHumanTakeover:
+            logger.critical('Request human takeover')
+            exit(1)
+        except Exception as e:
+            logger.exception(e)
+            exit(1)
+
+    @cached_property
+    def device(self) -> "Device":
+        try:
+            from module.device.device import Device
+            device = Device(config=self.config)
+            return device
+        except RequestHumanTakeover:
+            logger.critical('Request human takeover')
+            exit(1)
+        except Exception as e:
+            logger.exception(e)
+            exit(1)
+
+    def init_server(self, port: int) -> int:
+        """
+        初始化zerorpc服务,返回端口号
+        :return:
+        """
+        self.server = zerorpc.Server(self)
+        try:
+            self.server.bind(f'tcp://127.0.0.1:{port}')
+            return port
+        except zmq.error.ZMQError:
+            logger.error(f"Ocr server cannot bind on port {port}")
+            return None
 
 
+    def run_server(self) -> None:
+        """
+        启动zerorpc服务
+        :return:
+        """
+        self.server.run()
 

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů