proc SCHEMATIC_electrical_switch {} {




make input -name sw_on -origin {90 20}
make inout -name t1 -origin {30 70}
make inout -name t2 -origin {150 70}




}

proc ICON_electrical_switch args {
  icon_setup $args {{origin {0 0}} {orient R0} {name s} {on_resistance 1e3} {off_resistance 1000e9}}
icon_term -type inout -origin {-40 0} -name t1
icon_term -type inout -origin {40 0} -name t2
icon_term -type input -origin {0 -30} -orient R90 -name sw_on
icon_property -origin {-10 10} -label {$name}
  icon_property -origin {-90 130} -type user -name name -default s
  icon_line -40 0 -20 0 10 -20
  icon_line 10 0 40 0
  icon_property -origin {-200 110} -type fixed -name spice -text {$name $t1 $t2 $sw_on 0 ideal_switch_model}
  icon_property -origin {-90 150} -type user -name on_resistance -default 1e3
  icon_property -origin {-90 170} -type user -name off_resistance -default 1000e9
  icon_property -origin {-40 30} -text {[if {$on_resistance != 1e3} {set x "on_res=$on_resistance (Ohms)"}]}
  icon_property -origin {-40 50} -text {[if {$off_resistance != 1000e9} {set x "off_res=$off_resistance (Ohms)"}]}
}

