mirror of
https://github.com/klxf/eext-jiepei-helper.git
synced 2025-12-06 22:24:14 +08:00
Compare commits
No commits in common. "master" and "v1.0.3" have entirely different histories.
11
CHANGELOG.md
11
CHANGELOG.md
@ -1,18 +1,7 @@
|
|||||||
# 1.2.0
|
|
||||||
|
|
||||||
1. 支持将下单预设内嵌至 PCB
|
|
||||||
2. 前往下单时将自动导出 Berber 制板文件
|
|
||||||
3. extension.json 的 engines.eda 字段新增对 V3 的支持
|
|
||||||
|
|
||||||
# 1.1.1
|
|
||||||
|
|
||||||
修复板子大小精度问题,自动识别将保留两位小数
|
|
||||||
|
|
||||||
# 1.1.0
|
# 1.1.0
|
||||||
|
|
||||||
1. 支持自动识别板子层数
|
1. 支持自动识别板子层数
|
||||||
2. 更新依赖 pro-api-types
|
2. 更新依赖 pro-api-types
|
||||||
3. 检查更新目标更改为 Github Releases
|
|
||||||
|
|
||||||
# 1.0.2
|
# 1.0.2
|
||||||
|
|
||||||
|
|||||||
18
README.md
18
README.md
@ -1,7 +1,5 @@
|
|||||||
# 捷配下单助手
|
# 捷配下单助手
|
||||||
|
|
||||||
<img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/klxf/eext-jiepei-helper?style=flat-square&label=Stars"><img alt="GitHub Release" src="https://img.shields.io/github/v/release/klxf/eext-jiepei-helper?style=flat-square&label=Release&color=%233fb950"><img alt="GitHub License" src="https://img.shields.io/github/license/klxf/eext-jiepei-helper?style=flat-square&label=License"><img alt="GitHub Downloads" src="https://img.shields.io/github/downloads/klxf/eext-jiepei-helper/total?style=flat-square&label=Downloads"><img alt="EasyEDA Version" src="https://img.shields.io/badge/dynamic/json?style=flat-square&url=https%3A%2F%2Fraw.githubusercontent.com%2Fklxf%2Feext-jiepei-helper%2Frefs%2Fheads%2Fmaster%2Fextension.json&query=engines.eda&label=EasyEDA&color=5588ff">
|
|
||||||
|
|
||||||
一键前往捷配下单 PCB,支持保存下单偏好,~~这很牛头人了~~
|
一键前往捷配下单 PCB,支持保存下单偏好,~~这很牛头人了~~
|
||||||
|
|
||||||
## 如何使用
|
## 如何使用
|
||||||
@ -10,31 +8,27 @@
|
|||||||
|
|
||||||
参考 [嘉立创 EDA 用户指南](https://prodocs.lceda.cn/cn/api/user-guide/using-extension.html#%E5%AE%89%E8%A3%85%E6%89%A9%E5%B1%95) 安装扩展。
|
参考 [嘉立创 EDA 用户指南](https://prodocs.lceda.cn/cn/api/user-guide/using-extension.html#%E5%AE%89%E8%A3%85%E6%89%A9%E5%B1%95) 安装扩展。
|
||||||
|
|
||||||
_使用本扩展的“检查更新”功能需要给予扩展“外部交互”权限。_
|
*使用本扩展的“检查更新”功能需要给予扩展“外部交互”权限。*
|
||||||
|
|
||||||
### 使用扩展
|
### 使用扩展
|
||||||
|
|
||||||
**本扩展仅在 PCB 界面激活**,菜单栏中将出现“捷配”菜单,“下单”子菜单为本扩展的主界面。
|
**本扩展仅在 PCB 界面激活**,菜单栏中将出现“捷配”菜单,“下单”子菜单为本扩展的主界面。
|
||||||
|
|
||||||
可直接在主界面选择 PCB 生产工艺参数,点击“前往下单”按钮即可前往捷配下单 PCB 页面,同时将自动导出 Berber 制板文件。
|
可直接在主界面选择 PCB 生产工艺参数,点击“前往下单”按钮即可前往捷配下单 PCB 页面。
|
||||||
|
|
||||||
> [!IMPORTANT] > **下单前务必仔细检查所有项目是否符合预期,捷配官网可能与本扩展显示存在出入,本扩展不对工艺组合可行性进行验证,以捷配官网为准。**
|
> [!IMPORTANT]
|
||||||
|
> **下单前务必仔细检查所有项目是否符合预期,捷配官网可能与本扩展显示存在出入,本扩展不对工艺组合可行性进行验证,以捷配官网为准。**
|
||||||
|
|
||||||
**本扩展提供“工艺预设”功能**,可将常用的工艺参数保存为预设,方便下次使用:
|
**本扩展提供“工艺预设”功能**,可将常用的工艺参数保存为预设,方便下次使用:
|
||||||
|
|
||||||
- 【**新建预设**】在“下单”界面顶部“订单工艺预设”面板新建预设,设置工艺参数与个性化服务选项,点击底部“保存预设”按钮即可保存;
|
- 【**新建预设**】在“下单”界面顶部“订单工艺预设”面板新建预设,设置工艺参数与个性化服务选项,点击底部“保存预设”按钮即可保存;
|
||||||
- 【**使用预设**】在“下单”界面顶部“订单工艺预设”面板选择已有的预设,将自动应用此前保存的参数与个性化选项;
|
- 【**使用预设**】在“下单”界面顶部“订单工艺预设”面板选择已有的预设,将自动应用此前保存的参数与个性化选项;
|
||||||
- 【**删除预设**】在“下单”界面顶部“订单工艺预设”面板选择已有的预设,点击底部“删除预设”按钮即可删除。
|
- 【**删除预设**】在“下单”界面顶部“订单工艺预设”面板选择已有的预设,点击底部“删除预设”按钮即可删除。
|
||||||
- 【**内嵌预设**】点击“下单”界面底部的“内嵌预设”按钮即可将当前工艺参数保存到 PCB 中。若 PCB 中存在内嵌预设,扩展将自动读取。
|
|
||||||
|
|
||||||
本扩展支持自动计算:
|
**本扩展支持自动计算 PCB 尺寸**,点击“选择板框”按钮后在画布上选择板框图元,即可自动计算板框大小。
|
||||||
|
|
||||||
- 【**PCB 层数**】点击“板子层数”右侧“识别”按钮后即可自动计算板子层数。**注意:EDA 仅支持绘制偶数层铜箔的 PCB,因此识别到的板子层数必然为偶数**
|
|
||||||
- 【**PCB 尺寸**】点击“板子大小”右侧的“选择板框”按钮后在画布上选择板框图元,即可自动计算板框大小。
|
|
||||||
|
|
||||||
## 即将推出的新特性
|
## 即将推出的新特性
|
||||||
|
|
||||||
- ~~自动识别板子层数~~ ——_V1.1.0_
|
- 自动识别板子层数【Coming s∞n】
|
||||||
|
|
||||||
## 开源许可
|
## 开源许可
|
||||||
|
|
||||||
|
|||||||
@ -3,22 +3,22 @@
|
|||||||
"uuid": "817c3321fba54f70b0186500933ed47b",
|
"uuid": "817c3321fba54f70b0186500933ed47b",
|
||||||
"displayName": "捷配下单助手",
|
"displayName": "捷配下单助手",
|
||||||
"description": "一键前往捷配下单 PCB,支持保存下单偏好",
|
"description": "一键前往捷配下单 PCB,支持保存下单偏好",
|
||||||
"version": "1.2.0",
|
"version": "1.1.0",
|
||||||
"publisher": "Mr_Fang",
|
"publisher": "Mr_Fang",
|
||||||
"engines": {
|
"engines": {
|
||||||
"eda": "^2.3.0 || ^3.0.0"
|
"eda": "^2.3.0"
|
||||||
},
|
},
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "github",
|
"type": "github",
|
||||||
"url": "https://github.com/klxf/eext-jiepei-helper"
|
"url": "https://github.com/klxf/"
|
||||||
},
|
},
|
||||||
"categories": "Other",
|
"categories": "Other",
|
||||||
"keywords": ["Helper"],
|
"keywords": ["Helper"],
|
||||||
"images": {
|
"images": {
|
||||||
"logo": "./images/logo.png"
|
"logo": "./images/logo.png"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/klxf/eext-jiepei-helper",
|
"homepage": "https://extensions.oshwhub.com/item/fangs233/jiepei-helper",
|
||||||
"bugs": "https://github.com/klxf/eext-jiepei-helper/issues",
|
"bugs": "https://github.com/klxf/eext-jiepei-helper/issues",
|
||||||
"activationEvents": {},
|
"activationEvents": {},
|
||||||
"entry": "./dist/index",
|
"entry": "./dist/index",
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
<!doctype html>
|
<!DOCTYPE html>
|
||||||
<html lang="zh-CN">
|
<html lang="zh-CN">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>关于软件</title>
|
<title>关于软件</title>
|
||||||
<link rel="stylesheet" href="/iframe/css/index.css" />
|
<link rel="stylesheet" href="/iframe/css/index.css">
|
||||||
</head>
|
</head>
|
||||||
<body class="bg-gray-100 flex items-center justify-center min-h-screen">
|
<body class="bg-gray-100 flex items-center justify-center min-h-screen">
|
||||||
<div class="min-h-screen bg-gray-100 flex items-center justify-center">
|
<div class="min-h-screen bg-gray-100 flex items-center justify-center">
|
||||||
@ -17,18 +17,26 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex justify-center space-x-4 mt-auto">
|
<div class="flex justify-center space-x-4 mt-auto">
|
||||||
<a id="home" class="text-blue-600 hover:text-blue-800 text-sm transition duration-300 ease-in-out"> 🏠 扩展主页 </a>
|
<a id="home" class="text-blue-600 hover:text-blue-800 text-sm transition duration-300 ease-in-out">
|
||||||
<a id="bugs" class="text-blue-600 hover:text-blue-800 text-sm transition duration-300 ease-in-out"> 🐞 Bug反馈 </a>
|
🏠 扩展主页
|
||||||
<a id="check" class="text-blue-600 hover:text-blue-800 text-sm transition duration-300 ease-in-out"> ✨ 检查更新 </a>
|
</a>
|
||||||
|
<a id="bugs" class="text-blue-600 hover:text-blue-800 text-sm transition duration-300 ease-in-out">
|
||||||
|
🐞 Bug反馈
|
||||||
|
</a>
|
||||||
|
<a id="check" class="text-blue-600 hover:text-blue-800 text-sm transition duration-300 ease-in-out">
|
||||||
|
✨ 检查更新
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex justify-center text-[12px] text-gray-500 mt-2">本扩展使用 Apache-2.0 许可协议开源</div>
|
<div class="flex justify-center text-[12px] text-gray-500 mt-2">
|
||||||
|
本扩展使用 Apache-2.0 许可协议开源
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
// 页面加载完成
|
// 页面加载完成
|
||||||
document.addEventListener('DOMContentLoaded', async function () {
|
document.addEventListener('DOMContentLoaded', async function () {
|
||||||
const file = await eda.sys_FileSystem.getExtensionFile('/extension.json');
|
const file = await eda.sys_FileSystem.getExtensionFile("/extension.json");
|
||||||
if (file) {
|
if (file) {
|
||||||
const extensionData = JSON.parse(await file.text());
|
const extensionData = JSON.parse(await file.text());
|
||||||
document.getElementById('name').textContent = extensionData.displayName;
|
document.getElementById('name').textContent = extensionData.displayName;
|
||||||
@ -51,40 +59,6 @@
|
|||||||
|
|
||||||
document.getElementById('check').addEventListener('click', function (event) {
|
document.getElementById('check').addEventListener('click', function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
eda.sys_ClientUrl
|
|
||||||
.request('https://api.github.com/repos/klxf/eext-jiepei-helper/releases/latest', 'GET')
|
|
||||||
.then((response) => response.json())
|
|
||||||
.then((data) => {
|
|
||||||
if (data && data.tag_name) {
|
|
||||||
const latestVersion = data.tag_name.replace('v', '');
|
|
||||||
const currentVersion = document.getElementById('version').textContent.replace('V', '');
|
|
||||||
// 比较版本号,latestVersion 和 currentVersion
|
|
||||||
const latestParts = latestVersion.split('.').map(Number);
|
|
||||||
const currentParts = currentVersion.split('.').map(Number);
|
|
||||||
let isNewVersionAvailable = false;
|
|
||||||
for (let i = 0; i < Math.max(latestParts.length, currentParts.length); i++) {
|
|
||||||
const latestPart = latestParts[i] || 0;
|
|
||||||
const currentPart = currentParts[i] || 0;
|
|
||||||
if (latestPart > currentPart) {
|
|
||||||
isNewVersionAvailable = true;
|
|
||||||
break;
|
|
||||||
} else if (latestPart < currentPart) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (isNewVersionAvailable) {
|
|
||||||
eda.sys_Message.showToastMessage(`😋 有新版本可用: V${latestVersion}`, 'info');
|
|
||||||
document.getElementById('tip').innerHTML =
|
|
||||||
`<a href="${data.html_url}" target="_blank" class="text-blue-600 hover:text-blue-800">前往更新新版本</a>`;
|
|
||||||
} else {
|
|
||||||
eda.sys_Message.showToastMessage('👍 当前已是最新版本', 'success');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
eda.sys_Message.showToastMessage('🥺 获取版本信息失败', 'error');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
/* 已下架,弃用
|
|
||||||
eda.sys_ClientUrl.request("https://extensions.oshwhub.com/api/v1/extensions/his_version_list?bizKey=188546598067642368", "GET")
|
eda.sys_ClientUrl.request("https://extensions.oshwhub.com/api/v1/extensions/his_version_list?bizKey=188546598067642368", "GET")
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
@ -116,8 +90,7 @@
|
|||||||
eda.sys_Message.showToastMessage("🥺 获取版本信息失败", 'error');
|
eda.sys_Message.showToastMessage("🥺 获取版本信息失败", 'error');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
*/
|
})
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -251,7 +251,6 @@
|
|||||||
class="w-16 p-1 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm"
|
class="w-16 p-1 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm"
|
||||||
id="BoardWidth"
|
id="BoardWidth"
|
||||||
type="number"
|
type="number"
|
||||||
step="0.01"
|
|
||||||
value="10"
|
value="10"
|
||||||
/>
|
/>
|
||||||
<span class="text-gray-700">CM × 宽(y)</span>
|
<span class="text-gray-700">CM × 宽(y)</span>
|
||||||
@ -259,7 +258,6 @@
|
|||||||
class="w-16 p-1 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm"
|
class="w-16 p-1 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm"
|
||||||
id="BoardHeight"
|
id="BoardHeight"
|
||||||
type="number"
|
type="number"
|
||||||
step="0.01"
|
|
||||||
value="10"
|
value="10"
|
||||||
/>
|
/>
|
||||||
<span class="text-gray-700">CM,数量</span>
|
<span class="text-gray-700">CM,数量</span>
|
||||||
@ -855,12 +853,6 @@
|
|||||||
>
|
>
|
||||||
删除预设
|
删除预设
|
||||||
</button>
|
</button>
|
||||||
<button
|
|
||||||
class="px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors duration-200 ease-in-out"
|
|
||||||
id="saveToPCB"
|
|
||||||
>
|
|
||||||
内嵌预设
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -1384,18 +1376,6 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
eda.pcb_Layer.getAllLayers().then((layers) => {
|
|
||||||
const data_layer = layers.filter((layer) => layer.id >= 71 && layer.id <= 270 && layer.name.startsWith('【勿动】捷配下单数据'));
|
|
||||||
if (data_layer.length === 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const craft_data = JSON.parse(data_layer[0].name.split('=')[1]);
|
|
||||||
// console.log(craft_data);
|
|
||||||
presetList['InnerData'] = craft_data;
|
|
||||||
autoSetupPreset('InnerData');
|
|
||||||
eda.sys_Message.showToastMessage('成功读取内嵌预设', 'success');
|
|
||||||
});
|
|
||||||
|
|
||||||
setupRadioGroup('proCategory', 'proCategory', 'fr4Item', updateBoardCraft);
|
setupRadioGroup('proCategory', 'proCategory', 'fr4Item', updateBoardCraft);
|
||||||
updateBoardCraft(document.getElementById('proCategory').getValue());
|
updateBoardCraft(document.getElementById('proCategory').getValue());
|
||||||
setupRadioGroup('BoardLayers', 'BoardLayers', '2');
|
setupRadioGroup('BoardLayers', 'BoardLayers', '2');
|
||||||
@ -1484,6 +1464,8 @@
|
|||||||
const WhitePaperService = document.querySelector('input[name="WhitePaperService"]:checked')?.value || '';
|
const WhitePaperService = document.querySelector('input[name="WhitePaperService"]:checked')?.value || '';
|
||||||
const IsNoneFont = document.querySelector('input[name="IsNoneFont"]:checked')?.value || '';
|
const IsNoneFont = document.querySelector('input[name="IsNoneFont"]:checked')?.value || '';
|
||||||
|
|
||||||
|
// 拼接 url:https://www.jiepei.com/pcb/pcbquote?proCategory=fr4Item&BoardHeight=10&BoardWidth=10&num=4&BoardLayers=2&BoardType=set&BoardThickness=2
|
||||||
|
|
||||||
let url = `https://www.jiepei.com/pcb/pcbquote?proCategory=${encodeURIComponent(proCategory)}&BoardHeight=${encodeURIComponent(boardHeight)}&BoardWidth=${encodeURIComponent(boardWidth)}&num=${encodeURIComponent(num)}&BoardLayers=${encodeURIComponent(boardLayers)}&BoardType=${encodeURIComponent(boardType)}&OrderStage=${encodeURIComponent(orderStage)}`;
|
let url = `https://www.jiepei.com/pcb/pcbquote?proCategory=${encodeURIComponent(proCategory)}&BoardHeight=${encodeURIComponent(boardHeight)}&BoardWidth=${encodeURIComponent(boardWidth)}&num=${encodeURIComponent(num)}&BoardLayers=${encodeURIComponent(boardLayers)}&BoardType=${encodeURIComponent(boardType)}&OrderStage=${encodeURIComponent(orderStage)}`;
|
||||||
|
|
||||||
url += mixedCategory ? `&MixedCategory=${encodeURIComponent(mixedCategory)}` : '';
|
url += mixedCategory ? `&MixedCategory=${encodeURIComponent(mixedCategory)}` : '';
|
||||||
@ -1514,17 +1496,6 @@
|
|||||||
url += WhitePaperService ? `&WhitePaperService=${encodeURIComponent(WhitePaperService)}` : '';
|
url += WhitePaperService ? `&WhitePaperService=${encodeURIComponent(WhitePaperService)}` : '';
|
||||||
url += IsNoneFont ? `&IsNoneFont=${encodeURIComponent(IsNoneFont)}` : '';
|
url += IsNoneFont ? `&IsNoneFont=${encodeURIComponent(IsNoneFont)}` : '';
|
||||||
|
|
||||||
// 保存制板文件
|
|
||||||
eda.pcb_ManufactureData.getGerberFile().then((file) => {
|
|
||||||
eda.dmt_Board.getCurrentBoardInfo().then((board) => {
|
|
||||||
const board_name = board.name;
|
|
||||||
const pcb_name = board.pcb.name;
|
|
||||||
const date = new Date();
|
|
||||||
const file_name = `${board_name}_${pcb_name}_${date.getFullYear()}-${date.getMonth()}-${date.getDate()}.zip`;
|
|
||||||
eda.sys_FileSystem.saveFile(file, file_name);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// 打开新窗口
|
// 打开新窗口
|
||||||
// window.open(url, '_blank');
|
// window.open(url, '_blank');
|
||||||
dialog(
|
dialog(
|
||||||
@ -1561,8 +1532,8 @@
|
|||||||
const BBox = await eda.pcb_Primitive.getPrimitivesBBox([selectedPrimitives[0].getState_PrimitiveId()]);
|
const BBox = await eda.pcb_Primitive.getPrimitivesBBox([selectedPrimitives[0].getState_PrimitiveId()]);
|
||||||
const boardHeight = eda.sys_Unit.milToMm(BBox.maxY - BBox.minY - 10) / 10;
|
const boardHeight = eda.sys_Unit.milToMm(BBox.maxY - BBox.minY - 10) / 10;
|
||||||
const boardWidth = eda.sys_Unit.milToMm(BBox.maxX - BBox.minX - 10) / 10;
|
const boardWidth = eda.sys_Unit.milToMm(BBox.maxX - BBox.minX - 10) / 10;
|
||||||
document.getElementById('BoardHeight').value = boardHeight.toFixed(2);
|
document.getElementById('BoardHeight').value = boardHeight;
|
||||||
document.getElementById('BoardWidth').value = boardWidth.toFixed(2);
|
document.getElementById('BoardWidth').value = boardWidth;
|
||||||
eda.sys_Message.showToastMessage('已自动识别板子大小', 'success');
|
eda.sys_Message.showToastMessage('已自动识别板子大小', 'success');
|
||||||
} else {
|
} else {
|
||||||
eda.sys_Message.showToastMessage('所选图元非板框', 'error');
|
eda.sys_Message.showToastMessage('所选图元非板框', 'error');
|
||||||
@ -1579,6 +1550,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
function dialog(title, content, cmd) {
|
function dialog(title, content, cmd) {
|
||||||
|
// tailwind css 实现,带半透明背景
|
||||||
let dialogHtml = `
|
let dialogHtml = `
|
||||||
<div class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity z-50" id="dialogOverlay">
|
<div class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity z-50" id="dialogOverlay">
|
||||||
<div class="flex items-center justify-center min-h-screen">
|
<div class="flex items-center justify-center min-h-screen">
|
||||||
@ -2024,45 +1996,6 @@
|
|||||||
setupRadioGroup('FlyingProbe', 'FlyingProbe', selectedFlyingProbe);
|
setupRadioGroup('FlyingProbe', 'FlyingProbe', selectedFlyingProbe);
|
||||||
setupRadioGroup('SurfaceFinish', 'SurfaceFinish', selectedSurfaceFinish);
|
setupRadioGroup('SurfaceFinish', 'SurfaceFinish', selectedSurfaceFinish);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAllBoardCreaft() {
|
|
||||||
return {
|
|
||||||
proCategory: document.querySelector('input[name="proCategory"]:checked')?.value || '',
|
|
||||||
BoardHeight: document.getElementById('BoardHeight').value,
|
|
||||||
BoardWidth: document.getElementById('BoardWidth').value,
|
|
||||||
num: document.getElementById('num').value,
|
|
||||||
MixedCategory: document.querySelector('input[name="MixedCategory"]:checked')?.value || '',
|
|
||||||
BoardLayers: document.querySelector('input[name="BoardLayers"]:checked')?.value || '',
|
|
||||||
BoardType: document.querySelector('input[name="BoardType"]:checked')?.value || '',
|
|
||||||
OrderStage: document.querySelector('input[name="OrderStage"]:checked')?.value || '',
|
|
||||||
BoardThickness: document.querySelector('input[name="BoardThickness"]:checked')?.value || '',
|
|
||||||
CopperThickness: document.querySelector('input[name="CopperThickness"]:checked')?.value || '',
|
|
||||||
InnerCopperThickness: document.querySelector('input[name="InnerCopperThickness"]:checked')?.value || '',
|
|
||||||
AluminumType: document.querySelector('input[name="AluminumType"]:checked')?.value || '',
|
|
||||||
CopperStructure: document.querySelector('input[name="CopperStructure"]:checked')?.value || '',
|
|
||||||
Invoice: document.querySelector('input[name="Invoice"]:checked')?.value || '',
|
|
||||||
SolderColor: document.querySelector('input[name="SolderColor"]:checked')?.value || '',
|
|
||||||
FontColor: document.querySelector('input[name="FontColor"]:checked')?.value || '',
|
|
||||||
LineWeight: document.querySelector('input[name="LineWeight"]:checked')?.value || '',
|
|
||||||
Vias: document.querySelector('input[name="Vias"]:checked')?.value || '',
|
|
||||||
SolderCover: document.querySelector('input[name="SolderCover"]:checked')?.value || '',
|
|
||||||
FlyingProbe: document.querySelector('input[name="FlyingProbe"]:checked')?.value || '',
|
|
||||||
SurfaceFinish: document.querySelector('input[name="SurfaceFinish"]:checked')?.value || '',
|
|
||||||
ImGoldThinckness: document.querySelector('input[name="ImGoldThinckness"]:checked')?.value || '',
|
|
||||||
HalfHole: document.querySelector('input[name="HalfHole"]:checked')?.value || '',
|
|
||||||
HoleThickness_: document.querySelector('input[name="HoleThickness_"]:checked')?.value || '',
|
|
||||||
ImpedanceSize: document.querySelector('input[name="ImpedanceSize"]:checked')?.value || '',
|
|
||||||
WithstandVoltage: document.querySelector('input[name="WithstandVoltage"]:checked')?.value || '',
|
|
||||||
QualityCompensation: document.querySelector('input[name="QualityCompensation"]:checked')?.value || '',
|
|
||||||
LowResistanceTest: document.querySelector('input[name="LowResistanceTest"]:checked')?.value || '',
|
|
||||||
ProductFileSure: document.querySelector('input[name="ProductFileSure"]:checked')?.value || '',
|
|
||||||
ReportMaterial: document.querySelector('input[name="ReportMaterial"]:checked')?.value || '',
|
|
||||||
GongBoundaryTolerance: document.querySelector('input[name="GongBoundaryTolerance"]:checked')?.value || '',
|
|
||||||
PanelAppearanceRequire: document.querySelector('input[name="PanelAppearanceRequire"]:checked')?.value || '',
|
|
||||||
WhitePaperService: document.querySelector('input[name="WhitePaperService"]:checked')?.value || '',
|
|
||||||
IsNoneFont: document.querySelector('input[name="IsNoneFont"]:checked')?.value || '',
|
|
||||||
};
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -2125,7 +2058,43 @@
|
|||||||
|
|
||||||
document.getElementById('savePreset').addEventListener('click', () => {
|
document.getElementById('savePreset').addEventListener('click', () => {
|
||||||
if (presetName) {
|
if (presetName) {
|
||||||
presetList[presetName] = getAllBoardCreaft();
|
presetList[presetName] = {
|
||||||
|
proCategory: document.querySelector('input[name="proCategory"]:checked')?.value || '',
|
||||||
|
BoardHeight: document.getElementById('BoardHeight').value,
|
||||||
|
BoardWidth: document.getElementById('BoardWidth').value,
|
||||||
|
num: document.getElementById('num').value,
|
||||||
|
MixedCategory: document.querySelector('input[name="MixedCategory"]:checked')?.value || '',
|
||||||
|
BoardLayers: document.querySelector('input[name="BoardLayers"]:checked')?.value || '',
|
||||||
|
BoardType: document.querySelector('input[name="BoardType"]:checked')?.value || '',
|
||||||
|
OrderStage: document.querySelector('input[name="OrderStage"]:checked')?.value || '',
|
||||||
|
BoardThickness: document.querySelector('input[name="BoardThickness"]:checked')?.value || '',
|
||||||
|
CopperThickness: document.querySelector('input[name="CopperThickness"]:checked')?.value || '',
|
||||||
|
InnerCopperThickness: document.querySelector('input[name="InnerCopperThickness"]:checked')?.value || '',
|
||||||
|
AluminumType: document.querySelector('input[name="AluminumType"]:checked')?.value || '',
|
||||||
|
CopperStructure: document.querySelector('input[name="CopperStructure"]:checked')?.value || '',
|
||||||
|
Invoice: document.querySelector('input[name="Invoice"]:checked')?.value || '',
|
||||||
|
SolderColor: document.querySelector('input[name="SolderColor"]:checked')?.value || '',
|
||||||
|
FontColor: document.querySelector('input[name="FontColor"]:checked')?.value || '',
|
||||||
|
LineWeight: document.querySelector('input[name="LineWeight"]:checked')?.value || '',
|
||||||
|
Vias: document.querySelector('input[name="Vias"]:checked')?.value || '',
|
||||||
|
SolderCover: document.querySelector('input[name="SolderCover"]:checked')?.value || '',
|
||||||
|
FlyingProbe: document.querySelector('input[name="FlyingProbe"]:checked')?.value || '',
|
||||||
|
SurfaceFinish: document.querySelector('input[name="SurfaceFinish"]:checked')?.value || '',
|
||||||
|
ImGoldThinckness: document.querySelector('input[name="ImGoldThinckness"]:checked')?.value || '',
|
||||||
|
HalfHole: document.querySelector('input[name="HalfHole"]:checked')?.value || '',
|
||||||
|
HoleThickness_: document.querySelector('input[name="HoleThickness_"]:checked')?.value || '',
|
||||||
|
ImpedanceSize: document.querySelector('input[name="ImpedanceSize"]:checked')?.value || '',
|
||||||
|
WithstandVoltage: document.querySelector('input[name="WithstandVoltage"]:checked')?.value || '',
|
||||||
|
QualityCompensation: document.querySelector('input[name="QualityCompensation"]:checked')?.value || '',
|
||||||
|
LowResistanceTest: document.querySelector('input[name="LowResistanceTest"]:checked')?.value || '',
|
||||||
|
ProductFileSure: document.querySelector('input[name="ProductFileSure"]:checked')?.value || '',
|
||||||
|
ReportMaterial: document.querySelector('input[name="ReportMaterial"]:checked')?.value || '',
|
||||||
|
GongBoundaryTolerance: document.querySelector('input[name="GongBoundaryTolerance"]:checked')?.value || '',
|
||||||
|
PanelAppearanceRequire: document.querySelector('input[name="PanelAppearanceRequire"]:checked')?.value || '',
|
||||||
|
WhitePaperService: document.querySelector('input[name="WhitePaperService"]:checked')?.value || '',
|
||||||
|
IsNoneFont: document.querySelector('input[name="IsNoneFont"]:checked')?.value || '',
|
||||||
|
};
|
||||||
|
|
||||||
eda.sys_Storage.setExtensionUserConfig('PresetList', presetList);
|
eda.sys_Storage.setExtensionUserConfig('PresetList', presetList);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -2142,29 +2111,10 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
document.getElementById('saveToPCB').addEventListener('click', () => {
|
|
||||||
eda.pcb_Layer.getAllLayers().then(async (layers) => {
|
|
||||||
const property = {
|
|
||||||
name: '【勿动】捷配下单数据=' + JSON.stringify(getAllBoardCreaft()),
|
|
||||||
color: '#881415',
|
|
||||||
transparency: 100,
|
|
||||||
};
|
|
||||||
|
|
||||||
const data_layer = layers.filter((layer) => layer.id >= 71 && layer.id <= 270 && layer.name.startsWith('【勿动】捷配下单数据'));
|
|
||||||
|
|
||||||
const layer = data_layer.length === 0 ? await eda.pcb_Layer.addCustomLayer() : data_layer[0].id;
|
|
||||||
|
|
||||||
eda.pcb_Layer.modifyLayer(layer, property).then(() => {
|
|
||||||
dialog('成功', '已将下单预设内嵌到PCB中,请勿删除、修改标有【勿动】字样的层,下次打开扩展将自动识别');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
function showPresetList() {
|
function showPresetList() {
|
||||||
const presetListContainer = document.getElementById('PresetList');
|
const presetListContainer = document.getElementById('PresetList');
|
||||||
presetListContainer.innerHTML = ''; // 清空现有内容
|
presetListContainer.innerHTML = ''; // 清空现有内容
|
||||||
for (const name in presetList) {
|
for (const name in presetList) {
|
||||||
if (name === 'InnerData') continue;
|
|
||||||
const iconList = {
|
const iconList = {
|
||||||
'fr4Item': '/iframe/img/img_pro_FR4.png',
|
'fr4Item': '/iframe/img/img_pro_FR4.png',
|
||||||
'rogersItem': '/iframe/img/img_pro_Rogers.png',
|
'rogersItem': '/iframe/img/img_pro_Rogers.png',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user