退役独立扒图程序与试验工具,消除重复源码:删 pdfbt 项目/cadbt C#部分(保留 node+CAD-Viewer 网页引擎,主程序扒图依赖)/ghj/yjktool;打包链同步(make_package 去独立exe/setup.iss 删pdfbt/更新包不再带pdfbt.exe);护栏扩到全部4对双胞胎文件;README 结构更新;编译+组装验证通过
This commit is contained in:
+2
-17
@@ -119,13 +119,9 @@ def main():
|
||||
ignore=shutil.ignore_patterns("__pycache__", "*.pyc"))
|
||||
print("复制目录", d)
|
||||
|
||||
# ===== cadbt(CAD扒图独立程序,默认安装) =====
|
||||
# ===== cadbt(CAD 网页引擎运行时;2026-10-01 独立 cadbt.exe 退役,只装 node+CAD-Viewer) =====
|
||||
cadbt_src = os.path.join(ROOT, "cadbt", "cadbt", "bin", "Debug")
|
||||
cadbt_dst = os.path.join(REL, "cadbt")
|
||||
os.makedirs(cadbt_dst, exist_ok=True)
|
||||
for f in os.listdir(cadbt_src):
|
||||
if f.endswith((".exe", ".dll", ".config")):
|
||||
shutil.copy2(os.path.join(cadbt_src, f), os.path.join(cadbt_dst, f))
|
||||
os.makedirs(os.path.join(cadbt_dst, "node"), exist_ok=True)
|
||||
shutil.copy2(os.path.join(cadbt_src, "node", "node.exe"), os.path.join(cadbt_dst, "node", "node.exe"))
|
||||
dist_src = os.path.join(ROOT, "cadbt", "cadbt", "CAD-Viewer", "packages", "cad-viewer-example", "dist")
|
||||
@@ -148,18 +144,7 @@ def main():
|
||||
print("补齐 dist/server.cjs")
|
||||
else:
|
||||
print("!! 运行目录缺少 server.cjs(CAD 网页服务起不来!)")
|
||||
os.makedirs(os.path.join(cadbt_dst, "sjk", "bjb"), exist_ok=True)
|
||||
print("复制目录 cadbt(exe+DLL+node+dist 网页+fonts/templates/server.cjs)")
|
||||
|
||||
# ===== pdfbt(PDF扒图独立程序+OCR Python 环境,默认安装) =====
|
||||
pdfbt_src = os.path.join(ROOT, "pdfbt", "bin", "Debug")
|
||||
pdfbt_dst = os.path.join(REL, "pdfbt")
|
||||
os.makedirs(pdfbt_dst, exist_ok=True)
|
||||
for f in os.listdir(pdfbt_src):
|
||||
if f.endswith((".exe", ".dll", ".config")):
|
||||
shutil.copy2(os.path.join(pdfbt_src, f), os.path.join(pdfbt_dst, f))
|
||||
os.makedirs(os.path.join(pdfbt_dst, "sjk", "bjb"), exist_ok=True)
|
||||
print("复制目录 pdfbt(exe+pdfium,OCR=百度API无需本地环境)")
|
||||
print("复制目录 cadbt(node+CAD-Viewer 网页引擎+fonts/templates/server.cjs;独立 exe 已退役)")
|
||||
|
||||
# ===== AI 助手引擎目录(2026-09-26 OpenClaw→ZCode 开源版 zai-org/ZCode) =====
|
||||
# ai助手\ = zcode\(官方 build:zcode 发行包:bin/web/server/agent/node_modules + 捆绑 node)
|
||||
|
||||
@@ -48,9 +48,7 @@ def main():
|
||||
|
||||
# 主程序
|
||||
shutil.copy2(os.path.join(REL, "成套报价软件.exe"), PKG)
|
||||
|
||||
# PDF 扒图独立程序(2026-10-01 第2期:缩放卡顿同步修复)
|
||||
shutil.copy2(os.path.join(REL, "pdfbt", "pdfbt.exe"), PKG)
|
||||
# (2026-10-01 独立 pdfbt.exe 退役后不再随更新包分发)
|
||||
|
||||
# 使用说明(GBK,记事本直接打开不乱码)
|
||||
with open(os.path.join(PKG, "使用说明.txt"), "w", encoding="gbk", newline="\r\n") as f:
|
||||
|
||||
+26
-12
@@ -1,4 +1,4 @@
|
||||
# ============================================================
|
||||
# ============================================================
|
||||
# 扒图同步检查.ps1 —— Cad/Pdf 扒图窗口 Form3.cs 漂移护栏
|
||||
# ============================================================
|
||||
# 背景: 扒图\Cad\Form3.cs 与 扒图\Pdf\Form3.cs 是约 98% 重复的双胞胎文件
|
||||
@@ -18,8 +18,19 @@ $cadPath = Join-Path $root '成套报价软件\扒图\Cad\Form3.cs'
|
||||
$pdfPath = Join-Path $root '成套报价软件\扒图\Pdf\Form3.cs'
|
||||
$baseline = Join-Path $PSScriptRoot '扒图同步基线.txt'
|
||||
|
||||
foreach ($f in @($cadPath, $pdfPath)) {
|
||||
if (-not (Test-Path $f)) { Write-Host "[FAIL] 缺少文件: $f" -ForegroundColor Red; exit 2 }
|
||||
# ★ 2026-10-01 扩充:从只查 Form3.cs 扩展到全部 Cad/Pdf 双胞胎文件对
|
||||
# (新建项目.cs 与两对 Designer/ui.cs 此前是漂移盲区)
|
||||
$pairs = @(
|
||||
@('成套报价软件\扒图\Cad\Form3.cs', '成套报价软件\扒图\Pdf\Form3.cs'),
|
||||
@('成套报价软件\扒图\Cad\新建项目.cs', '成套报价软件\扒图\Pdf\新建项目.cs'),
|
||||
@('成套报价软件\扒图\Cad\Form3.ui.cs', '成套报价软件\扒图\Pdf\Form3.Designer.cs'),
|
||||
@('成套报价软件\扒图\Cad\新建项目.ui.cs', '成套报价软件\扒图\Pdf\新建项目.Designer.cs')
|
||||
)
|
||||
|
||||
foreach ($p in $pairs) {
|
||||
foreach ($f in @((Join-Path $root $p[0]), (Join-Path $root $p[1]))) {
|
||||
if (-not (Test-Path $f)) { Write-Host "[FAIL] 缺少文件: $f" -ForegroundColor Red; exit 2 }
|
||||
}
|
||||
}
|
||||
|
||||
function Normalize([string]$path) {
|
||||
@@ -34,17 +45,20 @@ function Normalize([string]$path) {
|
||||
|
||||
$tmpCad = Join-Path $env:TEMP 'baotu_cad_norm.cs'
|
||||
$tmpPdf = Join-Path $env:TEMP 'baotu_pdf_norm.cs'
|
||||
Normalize $cadPath | Set-Content $tmpCad -Encoding UTF8
|
||||
Normalize $pdfPath | Set-Content $tmpPdf -Encoding UTF8
|
||||
|
||||
$diffFile = Join-Path $env:TEMP 'baotu_drift.diff'
|
||||
$null = git diff --no-index --unified=1 $tmpCad $tmpPdf 2>$null | Out-File $diffFile -Encoding UTF8
|
||||
|
||||
$numstat = git diff --no-index --numstat $tmpCad $tmpPdf 2>$null
|
||||
$added = 0; $deleted = 0
|
||||
if ($numstat) {
|
||||
$parts = (@($numstat)[0]) -split "`t"
|
||||
if ($parts.Count -ge 2) { $added = [int]$parts[0]; $deleted = [int]$parts[1] }
|
||||
"" | Out-File $diffFile -Encoding UTF8
|
||||
|
||||
foreach ($p in $pairs) {
|
||||
$cadF = Join-Path $root $p[0]; $pdfF = Join-Path $root $p[1]
|
||||
Normalize $cadF | Set-Content $tmpCad -Encoding UTF8
|
||||
Normalize $pdfF | Set-Content $tmpPdf -Encoding UTF8
|
||||
$null = git diff --no-index --unified=1 $tmpCad $tmpPdf 2>$null | Out-File $diffFile -Append -Encoding UTF8
|
||||
$numstat = git diff --no-index --numstat $tmpCad $tmpPdf 2>$null
|
||||
if ($numstat) {
|
||||
$parts = (@($numstat)[0]) -split "`t"
|
||||
if ($parts.Count -ge 2) { $added += [int]$parts[0]; $deleted += [int]$parts[1] }
|
||||
}
|
||||
}
|
||||
$drift = $added + $deleted
|
||||
|
||||
|
||||
Reference in New Issue
Block a user