v1.3.13: 模块化注册架构 + PDS流程设计套件更名 + 依赖/圆周交互修复
- 模块化:EdcModule 契约 + registry + 模块独立目录;发布包增加 modules/registry.json - 更名:PDS流程设计套件 / ProcessDesignSuite;同步构建、发布脚本与文档 - 时序图:依赖偏移以时间显示/编辑;紧贴依赖隐藏箭头并在接缝显示标签;动作条磁吸 - 圆周:依赖标签沿圆弧方向、环间空隙;动作旋转磁吸增强;短弧标签优先动作名 - 清理:release 移至源码同级(本地不入库);tool 合并到 tools;发布说明迁移 docs/release-notes
This commit is contained in:
+83
-31
@@ -11,16 +11,16 @@ import 'dart:math' as math;
|
||||
|
||||
import 'package:flutter/material.dart' hide Action;
|
||||
|
||||
import '../license/license_service.dart';
|
||||
import '../model/models.dart';
|
||||
import '../model/units.dart';
|
||||
import '../modules/module_registry.dart';
|
||||
import '../persistence/android_docs.dart';
|
||||
import '../persistence/storage.dart';
|
||||
import '../state/app_controller.dart';
|
||||
import '../theme/tokens.dart';
|
||||
import '../update/update_service.dart';
|
||||
import '../version.dart';
|
||||
import 'package:sequence_diagram/license/license_service.dart';
|
||||
import 'package:sequence_diagram/model/models.dart';
|
||||
import 'package:sequence_diagram/model/units.dart';
|
||||
import 'package:sequence_diagram/modules/registry.dart';
|
||||
import 'package:sequence_diagram/persistence/android_docs.dart';
|
||||
import 'package:sequence_diagram/persistence/storage.dart';
|
||||
import 'package:sequence_diagram/state/app_controller.dart';
|
||||
import 'package:sequence_diagram/theme/tokens.dart';
|
||||
import 'package:sequence_diagram/update/update_service.dart';
|
||||
import 'package:sequence_diagram/version.dart';
|
||||
import 'app_logo.dart';
|
||||
import 'update_dialog.dart';
|
||||
|
||||
@@ -970,38 +970,70 @@ class _ActionEditorDialogState extends State<ActionEditorDialog> {
|
||||
|
||||
// ===================== 依赖编辑对话框 =====================
|
||||
|
||||
/// 依赖编辑对话框:为指定动作添加一条前置依赖。
|
||||
/// 依赖编辑对话框:为指定动作添加或修改一条前置依赖。
|
||||
class DependencyEditorDialog extends StatefulWidget {
|
||||
const DependencyEditorDialog({super.key, required this.controller, required this.action});
|
||||
const DependencyEditorDialog({
|
||||
super.key,
|
||||
required this.controller,
|
||||
required this.action,
|
||||
this.initial,
|
||||
});
|
||||
|
||||
/// 全局应用控制器。
|
||||
final AppController controller;
|
||||
/// 目标动作(依赖的“后置”端)。
|
||||
final Action action;
|
||||
/// 要编辑的已有依赖;为 null 时是新增模式。
|
||||
final Dependency? initial;
|
||||
|
||||
/// 创建依赖编辑对话框对应的状态对象。
|
||||
@override
|
||||
State<DependencyEditorDialog> createState() => _DependencyEditorDialogState();
|
||||
}
|
||||
|
||||
/// 依赖编辑对话框状态:维护前置动作、依赖类型与偏移角。
|
||||
/// 依赖编辑对话框状态:维护前置动作、依赖类型与偏移时间。
|
||||
class _DependencyEditorDialogState extends State<DependencyEditorDialog> {
|
||||
/// 选择的前置动作 id。
|
||||
String? _from;
|
||||
/// 依赖类型,默认 FS(完成-启动)。
|
||||
DepType _type = DepType.fs;
|
||||
/// 偏移角输入控制器。
|
||||
final TextEditingController _offset = TextEditingController(text: '0');
|
||||
/// 偏移时间输入控制器(按当前时间单位输入,内部换算为角度)。
|
||||
late final TextEditingController _offset;
|
||||
|
||||
/// 渲染依赖表单:前置动作、依赖类型与偏移角。
|
||||
bool get _editing => widget.initial != null;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
final Dependency? d = widget.initial;
|
||||
_from = d?.fromId;
|
||||
_type = d?.type ?? DepType.fs;
|
||||
final UnitSettings u = widget.controller.project.units;
|
||||
final double cycleMs = widget.controller.project.cycle.durationMs;
|
||||
final double offsetMs = cycleMs <= 0 ? 0 : (d?.offsetAngle ?? 0) / 360 * cycleMs;
|
||||
_offset = TextEditingController(
|
||||
text: offsetMs == 0 ? '0' : timeValue(offsetMs, u.timeUnit).toStringAsFixed(3),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_offset.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
/// 渲染依赖表单:前置动作、依赖类型与偏移时间。
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final Tokens t = context.tok;
|
||||
final UnitSettings u = widget.controller.project.units;
|
||||
final List<Action> others =
|
||||
widget.controller.project.actions.where((Action a) => a.id != widget.action.id).toList();
|
||||
return AlertDialog(
|
||||
backgroundColor: t.dialog,
|
||||
title: Text('为 ${widget.action.id} 添加前置依赖'),
|
||||
title: Text(_editing
|
||||
? '编辑依赖 ${widget.initial!.fromId} → ${widget.action.id}'
|
||||
: '为 ${widget.action.id} 添加前置依赖'),
|
||||
content: SizedBox(
|
||||
width: 420,
|
||||
child: Column(
|
||||
@@ -1030,8 +1062,11 @@ class _DependencyEditorDialogState extends State<DependencyEditorDialog> {
|
||||
const SizedBox(height: 8),
|
||||
TextField(
|
||||
controller: _offset,
|
||||
keyboardType: TextInputType.number,
|
||||
decoration: const InputDecoration(labelText: '偏移角 offset (°)'),
|
||||
keyboardType: TextInputType.text,
|
||||
decoration: InputDecoration(
|
||||
labelText: '偏移时间 offset (${timeUnitLabel(u.timeUnit)})',
|
||||
helperText: '以时间为主:可直接输入 120ms / 0.5s / 1min;内部自动换算',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -1042,15 +1077,32 @@ class _DependencyEditorDialogState extends State<DependencyEditorDialog> {
|
||||
onPressed: () {
|
||||
// 未选择前置动作时不提交。
|
||||
if (_from == null) return;
|
||||
widget.controller.addDependency(
|
||||
_from!,
|
||||
widget.action.id,
|
||||
_type,
|
||||
double.tryParse(_offset.text) ?? 0,
|
||||
);
|
||||
final UnitSettings unit = widget.controller.project.units;
|
||||
final double cycleMs = widget.controller.project.cycle.durationMs;
|
||||
final double? offsetMs = parseDuration(_offset.text, unit);
|
||||
final double offset = (offsetMs == null || cycleMs <= 0)
|
||||
? 0
|
||||
: offsetMs / cycleMs * 360;
|
||||
final Dependency? old = widget.initial;
|
||||
if (old == null) {
|
||||
widget.controller.addDependency(
|
||||
_from!,
|
||||
widget.action.id,
|
||||
_type,
|
||||
offset,
|
||||
);
|
||||
} else {
|
||||
widget.controller.updateDependency(
|
||||
old.fromId,
|
||||
widget.action.id,
|
||||
fromId: _from!,
|
||||
type: _type,
|
||||
offset: offset,
|
||||
);
|
||||
}
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: const Text('添加'),
|
||||
child: Text(_editing ? '保存' : '添加'),
|
||||
),
|
||||
],
|
||||
);
|
||||
@@ -2049,7 +2101,7 @@ class _StationRowState extends State<_StationRow> {
|
||||
/// 双视图说明以及单位与导出等信息。
|
||||
/// 软件设置:集中设置入口(外观 / 文档默认 / 架构图网格 / 更新)。
|
||||
///
|
||||
/// 从左上角「EDC易得」菜单底部的「软件设置」打开;文档级的完整设置
|
||||
/// 从左上角「PDS流程设计套件」菜单底部的「软件设置」打开;文档级的完整设置
|
||||
/// (单位 / 循环 / 相位等)仍在「文档设置」(F2 / 左侧栏)里。
|
||||
class SoftwareSettingsDialog extends StatefulWidget {
|
||||
/// 构造软件设置对话框。
|
||||
@@ -2621,7 +2673,7 @@ class _HelpDialogState extends State<HelpDialog> {
|
||||
<String>['我要调相位 / 时长', '拖动动作块平移相位;拖条形右端改持续角;圆周视图拖弧两端改起止角;右侧滑杆可精调。'],
|
||||
<String>['泳道加宽(并列动作)', '双击条形视图左侧泳道编号(或点左侧栏「N 槽」徽标)→ 选 1–5 槽;拖拽动作可同时换道 + 换槽位。'],
|
||||
<String>['空泳道的保留 / 移除', 'F2 文档设置 →「泳道」→ 保留空泳道(默认开):动作全部移走的泳道保留,序号不变;关闭则自动移除。'],
|
||||
<String>['我要加前置依赖(输入)', '右侧「前置依赖 · 输入」→「添加前置依赖」;或右键动作 →「添加依赖」。FS 绿色实线=完成后启动;SS 琥珀虚线=可提前启动(带 +n°)。'],
|
||||
<String>['我要加前置依赖(输入)', '右侧「前置依赖 · 输入」→「添加前置依赖」;或右键动作 →「添加依赖」。FS 绿色实线=完成后启动;SS 琥珀虚线=可提前启动(带偏移时间,如 +0.33s)。'],
|
||||
<String>['连线重叠怎么办', '点选连线后拖动可沿法线方向平移整条线(圆周沿半径方向);双击连线或右键「复位走线偏移」恢复;同一组连线会自动错开。'],
|
||||
<String>['我要编辑相位分区', '左侧「文档设置」→「编辑相位分区」;增删分区、改名称与起止角;可重叠、可留空、>360° 表示跨圈。'],
|
||||
]),
|
||||
@@ -2743,7 +2795,7 @@ class _HelpDialogState extends State<HelpDialog> {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text('EDC易得 · Easy Design Collection',
|
||||
Text('PDS流程设计套件 · Process Design Suite',
|
||||
style: TextStyle(color: t.text, fontSize: 15, fontWeight: FontWeight.w700)),
|
||||
const SizedBox(height: 4),
|
||||
Text('V$kAppVersion(${android ? '安卓版' : 'Windows 版'})',
|
||||
@@ -2763,8 +2815,8 @@ class _HelpDialogState extends State<HelpDialog> {
|
||||
if (!android)
|
||||
// 注意:绝不能展示「期望授权串」——它等同于 .lic 内容,公开即可被绕过授权。
|
||||
row('本机 MAC', info.mac ?? '读取失败'),
|
||||
row('版权声明', 'Copyright © 2026 EDC(Easy Design Collection)呆头鹅。保留所有权利。'),
|
||||
row('产品简介', '设计合集(Easy Design Collection):时序图设计面向 PLC 流程节拍 / '
|
||||
row('版权声明', 'Copyright © 2026 PDS流程设计套件(Process Design Suite)呆头鹅。保留所有权利。'),
|
||||
row('产品简介', '流程设计套件(Process Design Suite):时序图设计面向 PLC 流程节拍 / '
|
||||
'相位角设计(条形 / 圆周 / 流程图三视图、FS / SS 依赖与关键路径、泳道加宽);'
|
||||
'架构图设计支持手绘识别标准图形、正交连线与标签;支持导出 SVG / PNG / drawio。'),
|
||||
const SizedBox(height: 6),
|
||||
|
||||
Reference in New Issue
Block a user