diff --git a/README.md b/README.md index 4091021..ac305e6 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,12 @@ ## 更新日志 +* 2021年2月2日,前端更新 + + * 增加电路spice网表提取功能 + * 但是spice网表的具体格式仍存在一些小问题,需要与spice语法规则做进一步的校准 + * 另外,元件的名称需要增加自动调整功能,来保证所有元件名称的唯一性 + * ![avatar](./Schematic/schematic3.png) * 2021年2月1日,前端更新 * 发现bug,拖拽元件时,发现连线无法跟着移动 diff --git a/Schematic/schematic3.png b/Schematic/schematic3.png new file mode 100644 index 0000000..3a1affc Binary files /dev/null and b/Schematic/schematic3.png differ diff --git a/Schematic/template/schematic.html b/Schematic/template/schematic.html index a8d45b9..0e699e4 100644 --- a/Schematic/template/schematic.html +++ b/Schematic/template/schematic.html @@ -365,9 +365,170 @@ function ParseSpice(circuit_xml){ return result ; }; -// 根据从xml提取出来的info生成spice网表 -function ExtractSpice(info){ +function NormalizeXML(info){ + let circuit = []; + let netlist = []; + let nodes = []; + for(var i=0; i @@ -716,24 +877,48 @@ function showOutline(graph) mxUtils.popup(mxUtils.getPrettyXml(node), true); })); - + document.body.appendChild(mxUtils.button('Show Spice', function() + { + + var node = ParseSpice(graph.getModel()); + var circuit = NormalizeXML(node); + let spice = ExtractSpice(circuit); + mxUtils.popup(spice, true); + })); // Extract SPICE model - document.body.appendChild(mxUtils.button('Show SPICE', function() + document.body.appendChild(mxUtils.button('Show Info', function() { let content = ''; var node = ParseSpice(graph.getModel()); for(var i=0; i