-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
不养闲人任务合并+优化ui路径+自定义副表名称+仅回满提前上班 #693
Conversation
@@ -3339,6 +3385,9 @@ def maa_plan_solver(self, tasks="All", one_time=False): | |||
): | |||
self.MAA.stop() | |||
hard_stop = True | |||
elif config.stop_maa.is_set(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这是里是什么意思呀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
就是立即停止上面有个停止maa按钮,点了那个可以中断maa的任务。
arknights_mower/utils/plan.py
Outdated
@@ -141,6 +141,7 @@ def __init__( | |||
trigger: Optional[LogicExpression] = None, | |||
task: Optional[dict[str, list[str]]] = None, | |||
trigger_timing: Optional[str] = None, | |||
name: Optional[str] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我觉得标题在 plan.json存就好 了,没必要传到后端?
i, d = self.op_data.get_dorm_by_name(task.meta_data) | ||
if i is None: | ||
logger.info(f"检测到{task.meta_data}不在宿舍,移除相关任务") | ||
return False | ||
return True | ||
|
||
self.tasks = [t for t in self.tasks if should_keep(t)] | ||
merge_interval = config.conf.merge_interval |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
except NotFound: | ||
return "<h1>404 Not Found</h1>", 404 | ||
return send_from_directory("dist", "index.html") | ||
return send_from_directory("ui/dist", "index.html") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ui 的 read me 可以更新一下嘛
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改好了
@@ -578,19 +586,33 @@ def plan_metadata(self): | |||
logger.debug("检测到时间数据不存在") | |||
self.op_data.reset_dorm_time() | |||
self.error = True | |||
self.tasks.sort(key=lambda task: task.time) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这行不需要了对吧?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
之前append的任务应该默认是在tasks的最后一个吧?我不是很清楚有没有排过序,就加了一行这个。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scheduling 方法每次任务开始的时候都自带排序的,所以不要刻意排序
i, d = self.op_data.get_dorm_by_name(task.meta_data) | ||
if i is None: | ||
logger.info(f"检测到{task.meta_data}不在宿舍,移除相关任务") | ||
return False | ||
return True | ||
|
||
self.tasks = [t for t in self.tasks if should_keep(t)] | ||
merge_interval = config.conf.merge_interval | ||
merge_release_dorm(self.tasks, merge_interval) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这部分能移到任务开始的时候嘛。那里有个任务调度逻辑
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这样做问题就是生成不养闲人时候,假如不养闲人就是最近的任务怎么办
arknights_mower/utils/config/plan.py
Outdated
@@ -105,6 +105,7 @@ class BackupPlan(BaseModel): | |||
task: Task = {} | |||
trigger: Trigger = {} | |||
trigger_timing: str = "AFTER_PLANNING" | |||
name: str = "plan" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
名字可以不用传到后端,因为后端不需要名字对吧?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是的,只在前端的标题里面看
不养闲人任务将会自动合并至自定义间隔以内的下一个任务。
打包后需要在internal文件夹内新建ui文件夹,并将原本ui文件下编译生成的dist文件夹放入其中。
可以修改副表名称,方便查看每个副表的功能。
回满任务检测组内所有干员有无耗尽,若无耗尽则上班任务提前,删除了减少仅回满干员0.5心情上限的功能。