From 642097a283a6d3b94e4b39caae55c81f4ff2764d Mon Sep 17 00:00:00 2001 From: Water-Zi <928069358@qq.com> Date: Fri, 19 May 2023 02:54:15 +0800 Subject: [PATCH] Added support for importing Altium Designer CSV. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This code provides an interface for directly importing CSV files from Altium Designer, reorganizing and rearranging the CSV, and then invoking the original interface for the import operation. However, there is a question regarding the documentation: it mentions the need to take the inverse of some coordinates, specifically the coordinates of the fiducial marks. However, in actual testing, it was found that the original interface automatically takes the inverse of the y-axis coordinates during the CSV import. Modifying the original CSV document or taking the inverse when copying the coordinates of the fiducial marks can lead to incorrect positioning of the components during operation. On the contrary, if no modifications are made to the output CSV data and the coordinates from the component list are directly copied into the Fiducial PCB column, the resulting operational position aligns with the expectations. Further testing may be required for this aspect, but at least on my computer with AD22.0.2 (Build 36), this is the observed behavior. 这些代码提供了一个直接导入Altium Designer的CSV文件的接口,对CSV进行重新组织和排列,然后调用原接口进行导入操作。但对于文档有一点疑问:文档中提到需要将一些坐标取反,对标记点的坐标取反。但是在实际测试中发现,原接口在导入CSV时会对y轴坐标取反,在此基础上,如果修改原CSV文档或在抄写标记点坐标时取反,都将导致设备运行的位置出错。相反,如果不对输出的CSV数据做任何修改,直接将component list中的坐标抄写到Fiducial pcb一栏中,得到的运行结果是符合预期的。对于这部分内容,可能还需要进行更多的测试,但至少在我的电脑上是这样的。我使用的是AD22.0.2(Build36) --- html/index.html | 13 ++ html/index.js | 1 + html/libs/load_altium_csv_modal.css | 39 ++++++ html/libs/papaparse.min.js | 7 + html/load_altium_csv.js | 190 ++++++++++++++++++++++++++++ 5 files changed, 250 insertions(+) create mode 100644 html/libs/load_altium_csv_modal.css create mode 100644 html/libs/papaparse.min.js create mode 100644 html/load_altium_csv.js diff --git a/html/index.html b/html/index.html index 79f95f6..e24c76d 100644 --- a/html/index.html +++ b/html/index.html @@ -16,6 +16,8 @@ border-bottom-width: 0; } + +
@@ -24,6 +26,7 @@There are more than one layer in your CSV file.
+Please select one of the layer.
+ +