feat: 用户界面实现算法共存与切换
This commit is contained in:
@@ -70,6 +70,7 @@ API 版本代号: `{version.codename.capitalize()}`
|
||||
# 运行环境信息
|
||||
|
||||
Python 解释器版本: {python_version}
|
||||
Python 解释器路径: {sys.executable}
|
||||
Textual 框架版本: {textual_version}
|
||||
终端模拟器: {terminal_info}
|
||||
操作系统版本: {os_version}
|
||||
|
||||
@@ -108,15 +108,14 @@ class DashboardScreen(Screen):
|
||||
}
|
||||
initial_time = float("inf")
|
||||
for i in range(repo.data_length):
|
||||
e = pt.Electron.from_data(repo.electronic_data_lict[i])
|
||||
e = pt.Electron.from_data(electronic_data=repo.electronic_data_lict[i], algo_name=repo.config['algorithm'])
|
||||
n = pt.Nucleon.from_data(repo.nucleonic_data_lict[i])
|
||||
if e.is_activated():
|
||||
repo.algotype = e.algoname
|
||||
repo.progress["touched"] += 1
|
||||
repo.nearest_review_time = min(repo.nearest_review_time, e.nextdate())
|
||||
# initial_time = min(initial_time, e.)
|
||||
repo.need_review = timer.get_daystamp() >= repo.nearest_review_time
|
||||
repo.prompt = f"""{repo.manifest['title']} ({repo.algotype})
|
||||
repo.prompt = f"""{repo.manifest['title']} ({repo.config['algorithm']})
|
||||
进度: {repo.progress['touched']}/{repo.progress['total']} ({round(repo.progress['touched']/repo.progress['total']*100, 1)}%)
|
||||
{'需要学习' if repo.need_review else "无需操作"}
|
||||
"""
|
||||
|
||||
@@ -92,7 +92,8 @@ class PreparationScreen(Screen):
|
||||
nucleonic_data=self.repo.nucleonic_data_lict.get_itemic_unit(i)
|
||||
)
|
||||
e = pt.Electron.from_data(
|
||||
electronic_data=self.repo.electronic_data_lict.get_itemic_unit(i)
|
||||
electronic_data=self.repo.electronic_data_lict.get_itemic_unit(i),
|
||||
algo_name=self.repo.config['algorithm']
|
||||
)
|
||||
statstr = ""
|
||||
|
||||
@@ -146,7 +147,8 @@ def launch(repo, app, scheduled_num):
|
||||
nucleonic_data=repo.nucleonic_data_lict.get_itemic_unit(i)
|
||||
)
|
||||
e = pt.Electron.from_data(
|
||||
electronic_data=repo.electronic_data_lict.get_itemic_unit(i)
|
||||
electronic_data=repo.electronic_data_lict.get_itemic_unit(i),
|
||||
algo_name=repo.config['algorithm']
|
||||
)
|
||||
a = pt.Atom(n, e, repo.orbitic_data)
|
||||
atoms.append(a)
|
||||
|
||||
@@ -7,6 +7,7 @@ import toml
|
||||
|
||||
import heurams.kernel.particles as pt
|
||||
|
||||
from heurams.context import config_var
|
||||
from heurams.kernel.auxiliary.lict import Lict
|
||||
|
||||
|
||||
@@ -62,6 +63,14 @@ class Repo:
|
||||
"algodata": self.algodata,
|
||||
"source": self.source,
|
||||
}
|
||||
self.config = {
|
||||
"algorithm": config_var.get()['interface']['global']['algorithm'],
|
||||
"scheduled_num": config_var.get()['interface']['global']['scheduled_num'],
|
||||
}
|
||||
try:
|
||||
self.config.update(dict(config_var.get()['repo'][self.manifest['package']]))
|
||||
except:
|
||||
pass
|
||||
self._generate_particles_data()
|
||||
|
||||
def _generate_particles_data(self):
|
||||
|
||||
@@ -11,7 +11,7 @@ class DebugClient:
|
||||
self.socket.connect(f"tcp://localhost:{port}")
|
||||
print(f"已连接到调试服务器 (端口 {port})")
|
||||
print("输入Python代码并按回车执行, 输入 'exit' 退出")
|
||||
print("可用变量: app, logger")
|
||||
print("可用变量: app, logger, config_var")
|
||||
print("-" * 50)
|
||||
|
||||
def execute(self, code):
|
||||
|
||||
Reference in New Issue
Block a user