Guest User

Untitled

a guest
Apr 9th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. 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"]]'
  2. console.log(json)
  3.  
  4. function extract_circuit() {
  5. var ckt = new cktsim.Circuit(json)
  6. if(ckt)
  7. {
  8. console.log('The json structure loaded is valid')
  9. }
  10. else
  11. console.log('The json strucuture loaded is invalid')
  12. }
  13. function dc_analysis() {
  14.  
  15.  
  16. var ckt1 = new cktsim.Circuit(json)
  17. if (ckt1 === null) return;
  18.  
  19. // run the analysis
  20. var show_result = ckt1.dc()
  21.  
  22.  
  23. }
  24.  
  25.  
  26.  
  27. var a = extract_circuit()
Add Comment
Please, Sign In to add comment