feat(flow): 泳道拓宽计划(空泳道策略 + 多槽位泳道,三视图同步);发布 v1.3.4

- 空泳道策略(F2 文档设置 →「泳道」):动作全部移走的泳道可保留(默认,序号不变)
  或自动移除;条形空行 / 圆周空环 / 流程空列与左侧栏占位行同步
- 泳道加宽(1–5 槽):双击条形视图左侧泳道编号 / 右键空白泳道 / 左侧栏「N 槽」徽标;
  条形分子行(浅色虚线分隔)、圆周同色加宽环带 + 槽位虚线、流程图分子列且泳道带
  随内容智能加宽;拖拽动作同时换道 + 换槽位;旧数据零迁移(row 语义改为槽位并自动钳制)
- 流程图智能排开:同源同层扇出连线在空隙内均匀铺开;同层节点水平重叠自动推开
- 显示修复:画布左栏标题按真实行高排版(灰色副标题不再被换行标题压住,
  持续换行到泳道高度不足);多槽位采用「槽位紧凑 + 泳道间拉开」的间隔
- 「时序创建和编辑」更名为「文档设置」(含对话框标题/帮助/文档);新增自动保存
  (默认 10 分钟,可选 1/5/10/30 或关闭;写入文件并同步 .bak)
- 授权临时冻结(kLicenseRequired=false):桌面版导出无需 .lic;关于页授权状态
  「开放授权版本」、EDC 版权、开发者与交流群(邮箱 liuyu65@126.com、微信 online-goose)
- 更新体验:直接升级到最新版本提示、下载过程保持屏幕常亮提示、
  下载/上传统一限速 320KB/s(客户端限速 + 发布脚本 --limit-rate 320k)
- docs/HELP.md 与帮助中心同步更新;新增 docs/ROADMAP.md 开发路线图
- flutter analyze 0 问题、40 项测试全过;演示截图更新(含泳道加宽与拥挤场景验证图)
This commit is contained in:
2026-10-10 09:21:45 +08:00
parent b902fa06c4
commit fe5e0be131
27 changed files with 1390 additions and 245 deletions
+86 -8
View File
@@ -18,6 +18,7 @@ import 'package:flutter/services.dart';
import '../export/drawio_writer.dart';
import '../export/export_renderer.dart';
import '../export/svg_writer.dart';
import '../layout/layout.dart';
import '../model/models.dart';
import '../model/units.dart';
import '../persistence/android_docs.dart';
@@ -1179,7 +1180,7 @@ class _AppShellState extends State<AppShell> {
children: <Widget>[
Row(
children: <Widget>[
_sectionLabel(t, '时序创建和编辑'),
_sectionLabel(t, '文档设置'),
const Spacer(),
_panelControls(t, true),
],
@@ -1188,14 +1189,14 @@ class _AppShellState extends State<AppShell> {
_editEntry(
t,
icon: Icons.edit_note,
label: '编辑时序与节拍参数',
label: '文档设置',
enabled: !flow,
onTap: () => showDialog<void>(
context: context,
builder: (_) => SettingsDialog(controller: c),
),
),
// 较浅的分隔横线,区分上方「时序创建和编辑」与下方「动作和执行编辑」。
// 较浅的分隔横线,区分上方「文档设置」与下方「动作和执行编辑」。
const SizedBox(height: 14),
Divider(height: 1, thickness: 1, color: t.line),
const SizedBox(height: 14),
@@ -1358,6 +1359,35 @@ class _AppShellState extends State<AppShell> {
return Tooltip(message: '流程图只读:修改请切回条形 / 圆周视图', child: card);
}
/// 左侧栏的泳道槽位小徽标:显示当前槽位数,点击可调整(1–5 槽)。
///
/// 槽位数 > 1 时高亮显示(多槽位泳道内动作按子行并列放置)。
Widget _laneSlotChip(Tokens t, int lane) {
final int n = c.project.slotsOf(lane);
return Builder(
builder: (BuildContext ctx) => Tooltip(
message: '泳道 L${lane + 1} 槽位数:$n(点击调整,最多 5)',
child: InkWell(
borderRadius: BorderRadius.circular(6),
onTap: () async {
final RenderBox box = ctx.findRenderObject()! as RenderBox;
await showLaneSlotMenu(context, c, box.localToGlobal(Offset.zero), lane);
},
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2),
decoration: BoxDecoration(
color: n > 1 ? t.accent.withValues(alpha: 0.14) : t.panel2,
borderRadius: BorderRadius.circular(6),
border: Border.all(color: n > 1 ? t.accent.withValues(alpha: 0.4) : t.line2),
),
child: Text('$n 槽',
style: TextStyle(color: n > 1 ? t.accent : t.dim, fontSize: 10)),
),
),
),
);
}
/// 动作列表小节标题右侧的紧凑按钮(新建 / 删除)。
///
/// [onTap] 为 null 时按钮呈禁用态(降低不透明度),用于「未选中动作时禁用删除」。
@@ -1385,12 +1415,17 @@ class _AppShellState extends State<AppShell> {
/// 左侧栏:按泳道 / 轨道分组的行列表。
List<Widget> _laneRows(Tokens t, bool bar) {
final List<int> lanes = <int>{for (final Action a in c.project.actions) a.layer}.toList()..sort();
final List<int> lanes = c.project.renderLanes;
final List<Widget> out = <Widget>[];
for (int li = 0; li < lanes.length; li++) {
final int lane = lanes[li];
final List<Action> acts = c.project.actions.where((Action a) => a.layer == lane).toList()
..sort((Action a, Action b) => a.startAngle.compareTo(b.startAngle));
// 空泳道(开启「保留空泳道」后动作被全部移走):显示占位行。
if (acts.isEmpty) {
out.add(_emptyLaneRow(t, lane, li));
continue;
}
// 单动作泳道沿用普通动作行;多动作泳道合并显示。
out.add(acts.length == 1
? _actionRow(t, acts.first, li, bar)
@@ -1399,6 +1434,42 @@ class _AppShellState extends State<AppShell> {
return out;
}
/// 左侧栏中的空泳道占位行(开启「保留空泳道」后,动作被全部移走的泳道)。
Widget _emptyLaneRow(Tokens t, int lane, int li) {
return Padding(
padding: const EdgeInsets.only(bottom: 6),
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
border: Border.all(color: t.line),
),
child: Row(
children: <Widget>[
Container(
width: 22,
height: 22,
decoration: BoxDecoration(
color: t.panel2,
borderRadius: BorderRadius.circular(6),
border: Border.all(color: t.line2),
),
alignment: Alignment.center,
child: Text('${li + 1}',
style: TextStyle(color: t.dim, fontSize: 11, fontWeight: FontWeight.w700)),
),
const SizedBox(width: 9),
Expanded(
child: Text('空泳道(已保留,可拖入动作)',
style: TextStyle(color: t.dim, fontSize: 11)),
),
_laneSlotChip(t, lane),
],
),
),
);
}
/// 单条泳道 / 轨道行:多个动作合并显示(≤2 行,/ 分隔)。
Widget _laneRow(Tokens t, int lane, int li, List<Action> acts, bool bar) {
if (acts.isEmpty) return const SizedBox.shrink();
@@ -1454,7 +1525,8 @@ class _AppShellState extends State<AppShell> {
children: <Widget>[
Text(
joined,
maxLines: 2,
// 多槽位泳道允许更多行(最多与槽位数一致),持续自动换行。
maxLines: math.max(2, c.project.slotsOf(lane)),
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: sel ? t.text : t.text2,
@@ -1492,6 +1564,8 @@ class _AppShellState extends State<AppShell> {
),
),
const SizedBox(width: 6),
_laneSlotChip(t, lane),
const SizedBox(width: 4),
InkWell(
onTap: flow
? null
@@ -1561,7 +1635,9 @@ class _AppShellState extends State<AppShell> {
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(color: sel ? t.text : t.text2, fontSize: 12, fontWeight: sel ? FontWeight.w600 : FontWeight.normal)),
Text('${a.id} · ${st?.name ?? a.stationId} · ${a.driver}',
Text(
'${a.id} · ${st?.name ?? a.stationId} · ${a.driver}'
'${c.project.slotsOf(a.layer) > 1 ? ' · 槽 ${effectiveSlot(c.project, a) + 1}' : ''}',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(color: t.dim, fontSize: 10)),
@@ -1589,6 +1665,8 @@ class _AppShellState extends State<AppShell> {
),
),
const SizedBox(width: 6),
_laneSlotChip(t, a.layer),
const SizedBox(width: 4),
InkWell(
onTap: flow
? null
@@ -2160,9 +2238,9 @@ class _AppShellState extends State<AppShell> {
'相位 360° = 100%',
'动作 ${c.project.actions.length}',
'依赖 ${_depCount()}',
circular ? '轨道 L1–L${c.project.laneCount}' : '工位 ${c.project.stations.length}',
circular ? '轨道 L1–L${c.project.renderLaneCount}' : '工位 ${c.project.stations.length}',
mode == ViewMode.flow
? '泳道 L1–L${c.project.laneCount}(流程节点 ${c.project.actions.length})'
? '泳道 L1–L${c.project.renderLaneCount}(流程节点 ${c.project.actions.length})'
: (circular ? '同心圆 ${c.project.laneCount}' : '时间轴 0–${tfmt(c.project.cycle.durationMs, u)}'),
'单位 ${timeUnitLabel(u.timeUnit)} / ${phaseUnitLabel(u.phaseUnit)}',
'1° = ${tfmtAuto(c.project.cycle.durationMs / 360)}',
+4 -1
View File
@@ -318,7 +318,10 @@ class _SelectedCard extends StatelessWidget {
_kv(t, '结束相位', pfmt(a.endAngle, u)),
_kv(t, '持续相位', pfmt(a.durationAngle, u)),
const SizedBox(height: 4),
Text('Δ = $delta · 层 L${a.layer + 1} · ${st?.id ?? a.stationId}',
Text(
'Δ = $delta · 层 L${a.layer + 1}'
'${c.project.slotsOf(a.layer) > 1 ? ' · 槽 ${effectiveSlot(c.project, a) + 1}' : ''}'
' · ${st?.id ?? a.stationId}',
style: TextStyle(color: t.accent, fontSize: 11, fontWeight: FontWeight.w600)),
],
),
+38 -15
View File
@@ -204,7 +204,7 @@ class _CanvasViewState extends State<CanvasView> {
} else {
final CircularLayout layout = CircularLayout(c.project, size);
for (final Action a in c.project.actions) {
final double r = layout.radiusFor(a.layer);
final double r = layout.radiusFor(a.layer, layout.slotOf(a));
final double ds = (p - polar(layout.center, r, a.startAngle)).distance;
final double de = (p - polar(layout.center, r, math.min(a.endAngle, 360))).distance;
if (ds < bestDist) {
@@ -478,6 +478,14 @@ class _CanvasViewState extends State<CanvasView> {
_renameZone(zi);
return;
}
// 双击左侧泳道编号区(图外空白):打开泳道槽位菜单(加宽 / 恢复)。
if (p.dx < BarLayout.leftGutter) {
final BarLayout layout = BarLayout(c.project, size);
if (layout.lanes.isNotEmpty) {
_laneSlotMenu(d.globalPosition, layout.laneAt(p.dy));
return;
}
}
}
final Action? hit = c.project.viewState.mode == ViewMode.bar
? BarLayout(c.project, size).hitTest(p, slop: _hitSlop)
@@ -688,17 +696,16 @@ class _CanvasViewState extends State<CanvasView> {
status: '调整起始角',
);
} else {
// 整体移动:水平改起始相位 + 垂直跟随泳道,两者可同时进行。
// (原先要求「垂直分量明显大于水平」才换道,斜向拖拽几乎换不了道,
// 表现为“有一股磁吸力、拖不到别的泳道”。)
// 整体移动:水平改起始相位 + 垂直跟随泳道 / 槽位,两者可同时进行。
c.setActionStart(_dragAction!.id, _startAngle + dx / layout.span * 360);
final int curLane =
c.project.actionById(_dragAction!.id)?.layer ?? _dragAction!.layer;
final int target = layout.laneAt(p.dy);
if (target != curLane) {
_dropLane = target;
_dropValid = c.canPlaceInLane(_dragAction!.id, target);
c.moveActionLane(_dragAction!.id, target);
final Action? cur = c.project.actionById(_dragAction!.id);
final int curLane = cur?.layer ?? _dragAction!.layer;
final int curSlot = cur == null ? 0 : layout.slotOf(cur);
final (int, int) target = layout.laneSlotAt(p.dy);
if (target.$1 != curLane || target.$2 != curSlot) {
_dropLane = target.$1;
_dropValid = c.canPlaceInLane(_dragAction!.id, target.$1, slot: target.$2);
c.moveActionTo(_dragAction!.id, target.$1, target.$2);
}
}
} else {
@@ -724,9 +731,10 @@ class _CanvasViewState extends State<CanvasView> {
status: '调整起始角',
);
} else if (shift) {
// Shift + 径向拖拽:换轨道(同轨道可放多个不重叠动作)。
// Shift + 径向拖拽:换轨道 / 换子环(槽位)。
final double rad = (p - layout.center).distance;
c.moveActionLane(_dragAction!.id, layout.laneAtRadius(rad));
final (int, int) t = layout.laneSlotAtRadius(rad);
c.moveActionTo(_dragAction!.id, t.$1, t.$2);
} else {
c.setActionStart(_dragAction!.id, _startAngle + delta);
}
@@ -866,8 +874,17 @@ class _CanvasViewState extends State<CanvasView> {
? BarLayout(c.project, size).hitTest(local)
: CircularLayout(c.project, size).hitTest(local);
if (hit == null) {
// 未命中动作:若命中依赖连线,弹出连线菜单。
if (depKey != null) await _depMenu(global, depKey);
// 未命中动作:先看依赖连线,其次(条形视图)提供泳道槽位菜单。
if (depKey != null) {
await _depMenu(global, depKey);
return;
}
if (c.project.viewState.mode == ViewMode.bar) {
final BarLayout layout = BarLayout(c.project, size);
if (layout.lanes.isNotEmpty) {
await _laneSlotMenu(global, layout.laneAt(local.dy));
}
}
return;
}
c.select(hit.id);
@@ -925,6 +942,12 @@ class _CanvasViewState extends State<CanvasView> {
}
}
/// 泳道槽位菜单(实现见 [showLaneSlotMenu],画布与侧栏共用)。
///
/// 入口:双击条形视图左侧泳道编号区 / 右键空白泳道。
Future<void> _laneSlotMenu(Offset global, int lane) =>
showLaneSlotMenu(context, c, global, lane);
/// 相位分区右键菜单:重命名 / 插入 / 删除,实现任意增减。
Future<void> _zoneMenu(Offset global, int index) async {
final RenderBox box = context.findRenderObject()! as RenderBox;
+150 -53
View File
@@ -5,7 +5,7 @@
// 包含:
// · 通用消息提示(showMessage);
// · .seq.json 文件浏览/保存对话框(FileBrowserDialog / pickFile);
// · 动作编辑、依赖编辑、工艺参数设置、帮助中心等业务对话框。
// · 动作编辑、依赖编辑、文档设置、帮助中心等业务对话框。
import 'dart:io';
import 'dart:math' as math;
@@ -18,6 +18,7 @@ import '../persistence/android_docs.dart';
import '../persistence/storage.dart';
import '../state/app_controller.dart';
import '../theme/tokens.dart';
import '../version.dart';
import 'app_logo.dart';
// ===================== 对话框等比缩放 =====================
@@ -876,7 +877,7 @@ class _ActionEditorDialogState extends State<ActionEditorDialog> {
],
),
const SizedBox(height: 8),
// 按时间输入:与角度实时双向换算(单位随工艺参数设置)。
// 按时间输入:与角度实时双向换算(单位随文档设置)。
Row(
children: <Widget>[
Expanded(
@@ -1045,22 +1046,57 @@ class _DependencyEditorDialogState extends State<DependencyEditorDialog> {
}
}
// ===================== 工艺参数设置对话框 =====================
// ===================== 文档设置对话框 =====================
/// 工艺参数对话框:设置项目名称、时间/相位单位、显示精度、
/// 循环时长、换算表与编辑辅助选项。
/// 泳道槽位菜单:把泳道加宽为 1–5 槽(同一泳道并列放置多个动作),或恢复 1 槽。
///
/// 入口:双击条形视图左侧泳道编号区 / 右键空白泳道 / 左侧栏「N 槽」徽标。
/// 加宽后同一泳道的动作按 `Action.row`(槽位)分成多条并排行,
/// 圆周视图与流程图同样按槽位分行 / 分环 / 分列。
Future<void> showLaneSlotMenu(
BuildContext context, AppController controller, Offset global, int lane) async {
final RenderBox box = context.findRenderObject()! as RenderBox;
final Offset pos = box.globalToLocal(global);
final int cur = controller.project.slotsOf(lane);
final String? result = await showMenu<String>(
context: context,
position: RelativeRect.fromLTRB(pos.dx, pos.dy, pos.dx, pos.dy),
items: <PopupMenuEntry<String>>[
const PopupMenuItem<String>(
enabled: false,
height: 34,
child: Text('泳道槽位数(并列动作数)', style: TextStyle(fontSize: 11.5)),
),
for (int i = 1; i <= 5; i++)
PopupMenuItem<String>(
value: '$i',
child: Row(
children: <Widget>[
Text(i == cur ? '✓' : '', style: const TextStyle(fontSize: 12)),
const SizedBox(width: 6),
Text('$i 槽${i == cur ? '(当前)' : ''}'),
],
),
),
],
);
if (result != null) controller.setLaneSlots(lane, int.tryParse(result) ?? 1);
}
/// 文档设置对话框:设置项目名称、时间/相位单位、显示精度、
/// 循环时长、泳道策略、换算表与编辑辅助选项。
class SettingsDialog extends StatefulWidget {
const SettingsDialog({super.key, required this.controller});
/// 全局应用控制器。
final AppController controller;
/// 创建工艺参数对话框对应的状态对象。
/// 创建文档设置对话框对应的状态对象。
@override
State<SettingsDialog> createState() => _SettingsDialogState();
}
/// 工艺参数对话框状态:以副本形式编辑单位设置,点击“应用”后统一提交。
/// 文档设置对话框状态:以副本形式编辑单位设置,点击“应用”后统一提交。
class _SettingsDialogState extends State<SettingsDialog> {
/// 正在编辑的单位设置副本。
late UnitSettings _u;
@@ -1081,7 +1117,7 @@ class _SettingsDialogState extends State<SettingsDialog> {
_name = TextEditingController(text: widget.controller.project.name);
}
/// 渲染工艺参数表单:项目名、单位、精度、循环、换算表与编辑辅助。
/// 渲染文档设置表单:项目名、单位、精度、循环、泳道、换算表与编辑辅助。
@override
Widget build(BuildContext context) {
final Tokens t = context.tok;
@@ -1100,7 +1136,7 @@ class _SettingsDialogState extends State<SettingsDialog> {
children: <Widget>[
Row(
children: <Widget>[
Text('工艺参数', style: TextStyle(fontSize: 17, fontWeight: FontWeight.w700, color: t.text)),
Text('文档设置', style: TextStyle(fontSize: 17, fontWeight: FontWeight.w700, color: t.text)),
const SizedBox(width: 14),
Text('单位与精度 / 循环与相位 / 编辑辅助',
style: TextStyle(fontSize: 11, color: t.dim)),
@@ -1254,6 +1290,61 @@ class _SettingsDialogState extends State<SettingsDialog> {
],
),
const SizedBox(height: 18),
// 泳道策略:动作全部移走后,泳道保留还是自动移除。
Text('泳道', style: TextStyle(color: t.sub, fontSize: 11)),
const SizedBox(height: 8),
Wrap(
spacing: 10,
children: <Widget>[
FilterChip(
label: const Text('保留空泳道'),
selected: widget.controller.project.keepEmptyLanes,
onSelected: (bool v) {
widget.controller.setKeepEmptyLanes(v);
setState(() {});
},
),
],
),
const SizedBox(height: 6),
Text(
'开启:动作全部移走的泳道保留(条形行 / 圆周环 / 流程列,序号不变);关闭:空泳道自动移除、序号顺延。',
style: TextStyle(color: t.dim, fontSize: 10.5, height: 1.5),
),
const SizedBox(height: 18),
// 自动保存:定时把文档写回文件(需已手动保存过一次路径)。
Text('自动保存', style: TextStyle(color: t.sub, fontSize: 11)),
const SizedBox(height: 8),
Wrap(
spacing: 10,
runSpacing: 6,
crossAxisAlignment: WrapCrossAlignment.center,
children: <Widget>[
FilterChip(
label: const Text('启用自动保存'),
selected: widget.controller.project.autoSaveEnabled,
onSelected: (bool v) {
widget.controller.setAutoSave(enabled: v);
setState(() {});
},
),
for (final int m in <int>[1, 5, 10, 30])
ChoiceChip(
label: Text('$m 分钟'),
selected: widget.controller.project.autoSaveMinutes == m,
onSelected: (_) {
widget.controller.setAutoSave(minutes: m);
setState(() {});
},
),
],
),
const SizedBox(height: 6),
Text(
'默认每 10 分钟自动保存一次(可选 1 / 5 / 10 / 30 分钟);需先手动保存过一次(有文件路径)才生效,自动保存会同步更新 .bak 备份。',
style: TextStyle(color: t.dim, fontSize: 10.5, height: 1.5),
),
const SizedBox(height: 18),
// 时间 / 相位换算表:以 90° 为步长展示对应关系。
Text('时间 / 相位 换算', style: TextStyle(color: t.sub, fontSize: 11)),
const SizedBox(height: 6),
@@ -1363,7 +1454,7 @@ class _SettingsDialogState extends State<SettingsDialog> {
final double? cv = double.tryParse(_cycle.text);
final double ms = cv == null ? cycleMs : cv * kTimeDiv[_u.timeUnit]!;
final AppController c = widget.controller;
c.setUnits(_u, status: '工艺参数已应用');
c.setUnits(_u, status: '文档设置已应用');
c.setCycleDuration(ms);
if (_name.text.trim().isNotEmpty && _name.text.trim() != c.project.name) {
c.setProjectName(_name.text.trim());
@@ -1999,12 +2090,15 @@ class HelpDialog extends StatelessWidget {
<String>['我要删除动作', '选中后:左侧「删除」/ 行内删除图标 / Delete 键 / 右键菜单;至少保留一个动作 / 泳道。'],
<String>['我要改动作属性', '双击画布色块(条形块 / 圆弧)或左侧动作行 → 打开动作编辑对话框;也可选中后点左侧行内编辑图标。'],
<String>['我要复制 / 对齐', '画布左下角「编辑工具」→「复制」/「对齐」;圆周视图右侧浮动工具条同款。'],
<String>['我要编辑工位', '左侧「动作和执行编辑」→「编辑工位」:可增删工位、改名称与颜色、上下调整顺序;删除工位后其动作自动改挂到第一个工位。'],
<String>['我要编辑工位', '左侧「动作和执行编辑」→「编辑工位」:可增删工位、改名称与颜色、上下调整顺序;删除工位后其动作自动改挂到第一个工位。工位用于区分“谁在做”,是并行关系的首选维度(同工位并行时再用泳道加宽)。'],
<String>['一条泳道放多个动作', '泳道/轨道=一个执行器:上下拖拽(条形)或 Shift+径向拖拽(圆周)换道;不重叠即可共存,标题合并显示(/ 分隔,≤2 行)。'],
<String>['泳道加宽(并列动作)', '默认每条泳道 1 槽;并行动作优先用不同工位 / 泳道区分。需要同一泳道并行时:双击条形视图左侧泳道编号(或右键空白泳道 / 点左侧栏「N 槽」徽标)→ 选 1–5 槽(5 为上限);条形分子行、圆周分子环、流程图分子列,槽位间自动留出依赖箭头空间;拖拽动作可同时换道 + 换槽位。'],
<String>['空泳道的保留 / 移除', 'F2 文档设置 →「泳道」→ 保留空泳道(默认开):动作全部移走的泳道保留,序号不变;关闭则自动移除、序号顺延。条形空行 / 圆周空环 / 流程图空列与左侧栏同步显示。'],
<String>['工位与泳道的关系', '工位 = 物理工位(谁在做:上料 / 加工 / 检测…,可增删改与排序);泳道 = 执行器轨道(并行关系:同一泳道 = 同一执行器,可放多个不重叠动作,加宽后最多 5 个并列)。'],
]),
// 目标:调整时间轴与动作间的先后 / 并行关系。
_section(t, <List<String>>[
<String>['我要改时间轴长度', '左侧「时序创建和编辑」→「编辑时序与节拍参数」,或按 F2 →「循环与相位」→ 循环时长 → 应用。'],
<String>['我要改时间轴长度', '左侧「文档设置」入口(或按 F2)→「循环与相位」→ 循环时长 → 应用。'],
<String>['我要调相位 / 时长', '拖动动作块平移相位;拖条形右端改持续角;圆周视图拖弧两端改起止角;右侧滑杆可精调。'],
<String>['我要让动作跨循环', '使「起始角 + 持续角 > 360°」,会自动拆分并以半透明虚线渲染尾段。'],
<String>['我要加前置依赖(输入)', '右侧「前置依赖 · 输入」→「添加前置依赖」;或右键动作 →「添加依赖」。'],
@@ -2015,7 +2109,7 @@ class HelpDialog extends StatelessWidget {
]),
// 目标:编辑相位分区并控制画布显示。
_section(t, <List<String>>[
<String>['相位分区是什么', '把一个循环按角度分成的命名工艺阶段(默认上料 / 加工 / 检测),条形图顶部标注带即它。'],
<String>['相位分区是什么', '把一个循环按角度分成的命名工艺阶段(默认上料 / 加工 / 检测):条形图顶部为标注色带、圆周视图为最外圈相位环与径向边界、流程图左侧为竖排阶段栏。可重叠、可留空、>360° 表示跨圈。'],
<String>['我要编辑相位分区', '左侧「动作和执行编辑」→「编辑相位分区」;或 F2 →「相位分区」→「编辑…」。增删分区、改名称与起止角;可重叠、可留空、>360° 表示跨圈。'],
<String>['我要隐藏相位分区', '左侧「显示选项」取消勾选「相位分区标注」。'],
<String>['刻度怎么读', '条形视图:分区带与刻度线之间上排为相位、下排为等价时间;圆周视图:每 30° 的度数外侧标注等价时间。'],
@@ -2035,7 +2129,7 @@ class HelpDialog extends StatelessWidget {
<String>['我要导出 SVG', '顶部「导出」下拉菜单 →「导出 SVG」:矢量、分层、带语义 id 与 data-*,可直接进工艺卡 / MES。'],
<String>['我要导出 PNG', '顶部「导出」下拉菜单 →「导出 PNG」:按 2 倍像素比导出当前视图为位图。'],
<String>['我要导出 drawio', '流程图视图专用:顶部「导出」→「导出 drawio」,输出 diagrams.net(draw.io)可继续编辑的工程文件。'],
<String>['我要保存 / 恢复', '「保存」写入 .seq.json 并生成 .bak;每 5 秒自动快照,异常退出后启动可恢复。'],
<String>['我要保存 / 恢复', '「保存」写入 .seq.json 并生成 .bak;每 5 秒自动快照(异常退出可恢复);F2 文档设置中可开启「自动保存」(默认每 10 分钟一次,需先手动保存过一次路径)。'],
]),
// 目标:调整界面与使用快捷键。
_section(t, <List<String>>[
@@ -2052,7 +2146,7 @@ class HelpDialog extends StatelessWidget {
<String>['撤销 / 保存', 'Ctrl+Z / Ctrl+Y 撤销重做;Ctrl+S 保存;Ctrl+O / Ctrl+N 打开 / 新建。'],
<String>['帮助入口', '顶部工具栏右侧「?」或 F1 打开帮助中心;画布编辑工具条不重复放置帮助按钮。'],
<String>['导出入口', '导出统一放在顶部工具栏「导出」下拉菜单:SVG / PNG 三种视图通用;流程图另有 drawio。'],
<String>['其它', 'F2 编辑时序与节拍参数(含单位与相位分区);F3 切换深/浅主题;Delete 删除选中动作。'],
<String>['其它', 'F2 文档设置(含单位、循环、泳道与相位分区);F3 切换深/浅主题;Delete 删除选中动作。'],
]),
// 关于:设计人、版本、版权、授权信息与本机 MAC。
_about(context, t),
@@ -2096,9 +2190,11 @@ class HelpDialog extends StatelessWidget {
Widget _about(BuildContext context, Tokens t) {
final bool android = AndroidDocs.isAvailable;
final LicenseInfo info = LicenseService.instance.info;
final String lic = info.valid
? '已授权(${info.filePath?.split(RegExp(r'[\\/]')).last ?? '.lic'})'
: '未授权';
final String lic = !kLicenseRequired
? '已开放(临时免授权)'
: (info.valid
? '已授权(${info.filePath?.split(RegExp(r'[\\/]')).last ?? '.lic'})'
: '未授权');
Widget row(String k, String v, {Color? vc}) => Padding(
padding: const EdgeInsets.only(bottom: 10),
child: Row(
@@ -2129,7 +2225,7 @@ class HelpDialog extends StatelessWidget {
Text('时序图设计 · Sequence Diagram Studio',
style: TextStyle(color: t.text, fontSize: 15, fontWeight: FontWeight.w700)),
const SizedBox(height: 4),
Text('V1.3.3(${android ? '安卓版' : 'Windows 版'})',
Text('V1.3.4(${android ? '安卓版' : 'Windows 版'})',
style: TextStyle(color: t.dim, fontSize: 12)),
],
),
@@ -2140,15 +2236,16 @@ class HelpDialog extends StatelessWidget {
row('设计人', '呆头鹅'),
row(
'授权状态',
android ? '已授权(安卓版免授权)' : lic,
vc: (android || info.valid) ? t.ok : t.danger,
!kLicenseRequired ? '开放授权版本' : (android ? '已授权(安卓版免授权)' : lic),
vc: (android || !kLicenseRequired || info.valid) ? t.ok : t.danger,
),
if (!android)
// 注意:绝不能展示「期望授权串」——它等同于 .lic 内容,公开即可被绕过授权。
row('本机 MAC', info.mac ?? '读取失败'),
row('版权声明', 'Copyright © 2026 呆头鹅。保留所有权利。'),
row('产品简介', '面向 PLC 流程节拍 / 相位角设计的时序图工具:条形 / 圆周双视图、'
'FS / SS 依赖与关键路径、SVG / PNG 导出,成果可直接进工艺卡与 MES。'),
row('版权声明', 'Copyright © 2026 EDC(Easy Design Collection)呆头鹅。保留所有权利。'),
row('产品简介', '面向 PLC 流程节拍 / 相位角设计的设计工具:条形 / 圆周 / 流程图三视图、'
'FS / SS 依赖与关键路径、泳道加宽(多槽位)与空泳道策略、依赖走线可调、'
'支持导出 SVG / PNG / drawio,成果可直接进工艺卡与 MES。'),
const SizedBox(height: 6),
// 官网入口(点击导航到 sincos.cc)。
Row(
@@ -2171,34 +2268,35 @@ class HelpDialog extends StatelessWidget {
],
),
const SizedBox(height: 10),
if (!android)
// 授权指南(桌面版:按本机 MAC 申请 .lic)。
Container(
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: t.info,
borderRadius: BorderRadius.circular(10),
border: Border.all(color: t.line),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
Icon(Icons.menu_book_outlined, size: 16, color: t.accent),
const SizedBox(width: 6),
Text('授权指南', style: TextStyle(color: t.accent, fontSize: 12.5, fontWeight: FontWeight.w600)),
],
),
const SizedBox(height: 8),
guideLine('1. 复制上方「本机 MAC」。'),
guideLine('2. 访问官网 sincos.cc,或把 MAC 发送到邮箱 liuyu65@126.com 申请授权。'),
guideLine('3. 收到 .lic 文件后,放入软件目录下的 license 文件夹,重启软件即可导出 SVG / PNG。'),
],
),
)
else
// 安卓版说明:免授权 + 保存位置 + 反馈方式。
// 开发者与交流群(原「授权指南」位置;授权恢复后回补授权指南)。
Container(
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: t.info,
borderRadius: BorderRadius.circular(10),
border: Border.all(color: t.line),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
Icon(Icons.groups_outlined, size: 16, color: t.accent),
const SizedBox(width: 6),
Text('开发者与交流群',
style: TextStyle(color: t.accent, fontSize: 12.5, fontWeight: FontWeight.w600)),
],
),
const SizedBox(height: 8),
guideLine('开发者邮箱:liuyu65@126.com'),
guideLine('设计交流群:添加开发者微信 online-goose,加入「设计与制造业设计交流群」。'),
guideLine('官网:sincos.cc'),
],
),
),
const SizedBox(height: 10),
if (android)
// 安卓版说明:免授权 + 保存位置。
Container(
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
@@ -2220,7 +2318,6 @@ class HelpDialog extends StatelessWidget {
guideLine('本版面向应用商店分发,无需授权,全部功能可用。'),
guideLine('保存 / 导出文件位于「文件管理」可见的公共目录(默认 Documents/SequenceDiagram,'
'可在保存对话框中更改位置)。'),
guideLine('帮助与反馈:官网 sincos.cc 或邮箱 liuyu65@126.com。'),
],
),
),
+29 -1
View File
@@ -207,6 +207,11 @@ class _UpdateDialogState extends State<UpdateDialog> {
],
),
const SizedBox(height: 4),
Text(
'将直接升级到最新版本 v${info.version}(无需逐版本安装)',
style: TextStyle(color: t.accent, fontSize: 11),
),
const SizedBox(height: 2),
Text(
'安装包:${info.assetName}${sizeText.isEmpty ? '' : '($sizeText)'}',
style: TextStyle(color: t.dim, fontSize: 11),
@@ -256,7 +261,7 @@ class _UpdateDialogState extends State<UpdateDialog> {
),
if (_busy && _progress >= 0)
Text('${(_progress * 100).clamp(0, 100).toStringAsFixed(0)}% · '
'${(_received / 1048576).toStringAsFixed(1)} MB',
'${(_received / 1048576).toStringAsFixed(1)} MB · 限速 320KB/s',
style: TextStyle(color: t.dim, fontSize: 11)),
],
),
@@ -279,6 +284,29 @@ class _UpdateDialogState extends State<UpdateDialog> {
height: 1.5)),
),
],
// 下载提示:明确提醒保持屏幕常亮与网络连接,避免下载中断。
Container(
width: double.infinity,
padding: const EdgeInsets.all(10),
decoration: BoxDecoration(
color: t.warn.withValues(alpha: 0.10),
borderRadius: BorderRadius.circular(8),
border: Border.all(color: t.warn.withValues(alpha: 0.35)),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Icon(Icons.lightbulb_outline, size: 15, color: t.warn),
const SizedBox(width: 8),
Expanded(
child: Text(
'下载更新过程中,请确保屏幕保持长亮、网络持续连接,避免更新包下载中断。',
style: TextStyle(color: t.warn, fontSize: 11.5, height: 1.5),
),
),
],
),
),
const SizedBox(height: 14),
// 操作按钮