Update CmdUtil.tcl

This commit is contained in:
Akash Levy 2024-07-24 03:18:36 -07:00 committed by GitHub
parent 6110a6b965
commit a93369a8e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 0 deletions

View File

@ -118,6 +118,17 @@ proc report_units { args } {
}
}
proc write_units_json { jsonfile } {
set f [open $jsonfile w]
puts $f "{"
foreach unit {"time" "capacitance" "resistance" "voltage" "current" "power"} {
puts $f " \"$unit\": \"[unit_scaled_suffix $unit]\","
}
puts $f " \"distance\": \"[unit_scaled_suffix distance]\""
puts $f "}"
close $f
}
################################################################
define_cmd_args "set_cmd_units" \