diff --git a/README.md b/README.md index 7e349d3..9e489c3 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,12 @@ app.py ----服务器的主程序 ## 更新日志 +* 2021年2月9号,前端更新 + + * 发现bug: 当schematic中没有组件时,spice的parse函数抛出错误 + * 待解决:如何将spice网表和simulation同时传入服务器 + * 新增:仿真的参数设置 + * ![avatar](./doc/schematic6.png) * 2021年2月8号,前端更新 * 新增在弹出窗口里嵌入bokehjs代码的功能 diff --git a/doc/schematic6.png b/doc/schematic6.png new file mode 100644 index 0000000..d23387e Binary files /dev/null and b/doc/schematic6.png differ diff --git a/static/spice/bokeh_02.js b/static/spice/bokeh_02.js new file mode 100644 index 0000000..94f248e --- /dev/null +++ b/static/spice/bokeh_02.js @@ -0,0 +1,52 @@ + +function openMode(evt, tabMode) { + var i, tabcontent, tablinks; + tabcontent = document.getElementsByClassName("tabcontent"); + for (i = 0; i < tabcontent.length; i++) { + tabcontent[i].style.display = "none"; + } + tablinks = document.getElementsByClassName("tablinks"); + for (i = 0; i < tablinks.length; i++) { + tablinks[i].className = tablinks[i].className.replace(" active", ""); + } + document.getElementById(tabMode).style.display = "block"; + evt.currentTarget.className += " active"; + +}; + +function Simulation(sim_type){ + + var properties = []; + var sel = $("#"+sim_type+" input"); + + sel.each(function(){ + var new_element = {}; + var n = $(this)[0].name; + var v = $(this)[0].value; + new_element[n] = v ; + properties.push(new_element); + }); + + + var data = new Object(); + data["type"] = sim_type; + data["properties"] = properties; + // data['spice'] = spice; + // alert(spice); + + // for(var i=0; i + + @@ -22,6 +24,8 @@ + + @@ -1119,7 +1134,106 @@ function showOutline(graph) })); - document.body.appendChild(mxUtils.button('wnd test', function() + document.body.appendChild(mxUtils.button('simulator', function(){ + + // let spice = get_spice(graph); + + var frame = document.createElement('div'); + frame.setAttribute('id','bokeh_02'); + + var div_tab = document.createElement('div'); + div_tab.setAttribute('class','tab'); + + let sim_mode = ['transient', 'dc', 'ac']; + + let sim_mode_content = { + 'transient': { + "key" :[ 'step_time', 'end_time', 'start_time','max_time','use_initial_condition'], + "value" :[ '', '', '0', 'None', 'False'] + }, + 'dc': { + "key" :[ "src","start","stop","step"], + "value" :[ "","","",""] + }, + 'ac': { + "key" :[ "variation", "number_of_points", "start_frequency", "stop_frequency"], + "value" :[ "","","",""] + } + }; + + for(var i=0; i