Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var json ='[["r",[312,72,0],{"name":"","r":"100","_json_":0},["1","2"]],["r",[312,160,0],{"name":"","r":"100","_json_":1},["2","0"]],["w",[312,120,312,160]],["v",[160,112,0],{"name":"","value":"dc(5)","_json_":3},["1","0"]],["g",[160,160,0],{"_json_":4},["0"]],["w",[160,112,312,72]],["w",[160,160,312,208]],["view",0,0,2,"20","10","1G",null,"100","1","1000"]]'
- console.log(json)
- function extract_circuit() {
- var ckt = new cktsim.Circuit(json)
- if(ckt)
- {
- console.log('The json structure loaded is valid')
- }
- else
- console.log('The json strucuture loaded is invalid')
- }
- function dc_analysis() {
- var ckt1 = new cktsim.Circuit(json)
- if (ckt1 === null) return;
- // run the analysis
- var show_result = ckt1.dc()
- }
- var a = extract_circuit()
Add Comment
Please, Sign In to add comment