feat: 原创「环序」标志;双视图与侧栏优化;工位管理;帮助完善
- 原创应用标志「环序/Cycle-Step」:tools/gen-icon.py 重写 + 工具栏 Logo 同源,小尺寸简化版 - 条形时序视图:标题/副标题精简、双刻度值置于分区与刻度线之间、时间默认内嵌、依赖线箭头收窄、同泳道箭头接色块外侧、图注自动避让 - 圆周时序视图:去掉色块描边、环宽与间隙优化、度数外侧标时间、方向箭头外移;固定顺时针(移除逆时针) - 左侧栏:编辑工位/编辑相位分区入口;双击画布色块或动作行进入编辑;至少保留一个动作/泳道 - 右侧栏:移除重复的编辑操作、导出与单位卡片;文件浏览器新增「桌面」快捷入口 - AI 对话框:字号优化并新增「编辑示例」;节拍统计移除无依据的预估产能 - 文档:README 与 docs/HELP.md 全面更新;dist 同步重建
This commit is contained in:
+40
-18
@@ -30,6 +30,12 @@ class _AiGenerateDialogState extends State<AiGenerateDialog> {
|
||||
/// 会话内复用的 API Key(不持久化)。
|
||||
static String _sessionKey = '';
|
||||
|
||||
/// 示例描述:与输入框灰色占位一致,可一键填入后直接编辑。
|
||||
static const String _examplePrompt =
|
||||
'一条装配线,循环 2.4 秒。上料后定位夹紧,夹紧完成再伺服下压 0.6 秒;'
|
||||
'下压完成后并行进行超声波焊接与视觉检测;检测完成分选下料,最后清洁吹气。'
|
||||
'共 3 个工位,请给出动作、相位与依赖关系。';
|
||||
|
||||
late final TextEditingController _key;
|
||||
late final TextEditingController _prompt;
|
||||
|
||||
@@ -92,26 +98,26 @@ class _AiGenerateDialogState extends State<AiGenerateDialog> {
|
||||
// 标题
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Icon(Icons.auto_awesome, size: 20, color: t.accent2),
|
||||
Icon(Icons.auto_awesome, size: 21, color: t.accent2),
|
||||
const SizedBox(width: 8),
|
||||
Text('AI 生成时序图', style: TextStyle(color: t.text, fontSize: 16, fontWeight: FontWeight.w700)),
|
||||
Text('AI 生成时序图', style: TextStyle(color: t.text, fontSize: 17, fontWeight: FontWeight.w700)),
|
||||
const Spacer(),
|
||||
Text('自然语言 → 时序图', style: TextStyle(color: t.dim, fontSize: 10)),
|
||||
Text('自然语言 → 时序图', style: TextStyle(color: t.dim, fontSize: 11.5)),
|
||||
],
|
||||
),
|
||||
const Divider(height: 22),
|
||||
|
||||
// API Key
|
||||
Text('DeepSeek API Key', style: TextStyle(color: t.sub, fontSize: 11)),
|
||||
Text('DeepSeek API Key', style: TextStyle(color: t.sub, fontSize: 12.5)),
|
||||
const SizedBox(height: 6),
|
||||
TextField(
|
||||
controller: _key,
|
||||
obscureText: _obscure,
|
||||
style: TextStyle(color: t.text, fontSize: 11),
|
||||
style: TextStyle(color: t.text, fontSize: 12.5),
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
hintText: 'sk-...',
|
||||
hintStyle: TextStyle(color: t.dim, fontSize: 11),
|
||||
hintStyle: TextStyle(color: t.dim, fontSize: 12.5),
|
||||
filled: true,
|
||||
fillColor: t.panel2,
|
||||
prefixIcon: Icon(Icons.key, size: 16, color: t.dim),
|
||||
@@ -133,7 +139,7 @@ class _AiGenerateDialogState extends State<AiGenerateDialog> {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text('模型', style: TextStyle(color: t.sub, fontSize: 11)),
|
||||
Text('模型', style: TextStyle(color: t.sub, fontSize: 12.5)),
|
||||
const SizedBox(height: 6),
|
||||
Container(
|
||||
height: 38,
|
||||
@@ -148,7 +154,7 @@ class _AiGenerateDialogState extends State<AiGenerateDialog> {
|
||||
isExpanded: true,
|
||||
underline: const SizedBox.shrink(),
|
||||
dropdownColor: t.dialog,
|
||||
style: TextStyle(color: t.text, fontSize: 11),
|
||||
style: TextStyle(color: t.text, fontSize: 12.5),
|
||||
icon: Icon(Icons.keyboard_arrow_down, size: 18, color: t.sub),
|
||||
items: kAiModels
|
||||
.map((AiModelOption m) =>
|
||||
@@ -167,7 +173,7 @@ class _AiGenerateDialogState extends State<AiGenerateDialog> {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text('推理强度', style: TextStyle(color: t.sub, fontSize: 11)),
|
||||
Text('推理强度', style: TextStyle(color: t.sub, fontSize: 12.5)),
|
||||
const SizedBox(height: 6),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
@@ -184,7 +190,25 @@ class _AiGenerateDialogState extends State<AiGenerateDialog> {
|
||||
const SizedBox(height: 14),
|
||||
|
||||
// 自然语言输入(大输入框)
|
||||
Text('用自然语言描述工艺流程', style: TextStyle(color: t.sub, fontSize: 11)),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Text('用自然语言描述工艺流程', style: TextStyle(color: t.sub, fontSize: 12.5)),
|
||||
const Spacer(),
|
||||
// 一键把灰色示例填入输入框,便于直接修改后生成。
|
||||
TextButton.icon(
|
||||
onPressed: _busy
|
||||
? null
|
||||
: () => setState(() => _prompt.text = _examplePrompt),
|
||||
icon: const Icon(Icons.edit_note, size: 17),
|
||||
label: const Text('编辑示例', style: TextStyle(fontSize: 12)),
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor: t.accent,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
minimumSize: const Size(0, 28),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
Expanded(
|
||||
child: Container(
|
||||
@@ -199,12 +223,10 @@ class _AiGenerateDialogState extends State<AiGenerateDialog> {
|
||||
maxLines: null,
|
||||
expands: true,
|
||||
textAlignVertical: TextAlignVertical.top,
|
||||
style: TextStyle(color: t.text, fontSize: 11, height: 1.5),
|
||||
style: TextStyle(color: t.text, fontSize: 12.5, height: 1.6),
|
||||
decoration: InputDecoration.collapsed(
|
||||
hintText: '例如:一条装配线,循环 2.4 秒。上料后定位夹紧,夹紧完成再伺服下压 0.6 秒;'
|
||||
'下压完成后并行进行超声波焊接与视觉检测;检测完成分选下料,最后清洁吹气。'
|
||||
'共 3 个工位,请给出动作、相位与依赖关系。',
|
||||
hintStyle: TextStyle(color: t.dim, fontSize: 11, height: 1.5),
|
||||
hintText: '例如:$_examplePrompt',
|
||||
hintStyle: TextStyle(color: t.dim, fontSize: 12.5, height: 1.6),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -219,7 +241,7 @@ class _AiGenerateDialogState extends State<AiGenerateDialog> {
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: t.danger.withValues(alpha: 0.5)),
|
||||
),
|
||||
child: Text(_error!, style: TextStyle(color: t.danger, fontSize: 11, height: 1.4)),
|
||||
child: Text(_error!, style: TextStyle(color: t.danger, fontSize: 12, height: 1.5)),
|
||||
),
|
||||
],
|
||||
const SizedBox(height: 14),
|
||||
@@ -230,7 +252,7 @@ class _AiGenerateDialogState extends State<AiGenerateDialog> {
|
||||
Expanded(
|
||||
child: Text(
|
||||
'API Key 仅保存在本机内存,不写入工程文件。',
|
||||
style: TextStyle(color: t.dim, fontSize: 10),
|
||||
style: TextStyle(color: t.dim, fontSize: 11),
|
||||
),
|
||||
),
|
||||
TextButton(onPressed: _busy ? null : () => Navigator.pop(context), child: const Text('取消')),
|
||||
@@ -275,7 +297,7 @@ class _AiGenerateDialogState extends State<AiGenerateDialog> {
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: active ? t.accent : t.line2),
|
||||
),
|
||||
child: Text(label, style: TextStyle(color: active ? t.accent : t.sub, fontSize: 11)),
|
||||
child: Text(label, style: TextStyle(color: active ? t.accent : t.sub, fontSize: 12.5)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user