📄 edit.tcl
字号:
######################################################### SaVi by Robert Thurman (thurman@geom.umn.edu) and# Patrick Worfolk (worfolk@alum.mit.edu).## Copyright (c) 1997 by The Geometry Center.# This file is part of SaVi. SaVi is free software;# you can redistribute it and/or modify it only under# the terms given in the file COPYRIGHT which you should# have received along with this file. SaVi may be# obtained from:# http://savi.sourceforge.net/# http://www.geom.uiuc.edu/locate/SaVi######################################################### edit.tcl## $Id: edit.tcl,v 1.7 2004/01/06 03:57:56 lloydwood Exp $proc edit(build) {} { global edit_oe geomview_module set edit_oe(OK) 0 set name [build_Toplevel edit] wm protocol $name WM_DELETE_WINDOW edit(dismiss) build_Title $name "Edit satellite parameters" set cmd [build_CmdFrame $name cmd] build_LabelEntryColumns $cmd le0 \ {text " " {"semi-major axis (km)" \ "eccentricity e" \ "inclination (deg)" \ "long. asc. node (deg)" \ "arg. of periapsis (deg)" \ "time to periapsis (s)"} } \ {dentry "Orbital elements" {edit_oe(a) edit_oe(e) edit_oe(i) \ edit_oe(Omega) edit_oe(omega) \ edit_oe(T)} } \ {slider " " { edit(slide_a) edit(slide_e) edit(slide_i) \ edit(slide_O) edit(slide_o) edit(slide_T)} } \ {ilabel {} {edit_oe(Period) edit_oe(Nodal_precession) \ edit_oe(Apsidal_rotation) edit_oe(Apoapsis_altitude) \ edit_oe(Periapsis_altitude)} } \ {text {} {"period (minutes)" "nodal precession (deg/day)" "apsidal rotation (deg/day)" "apoapsis altitude (km)" "periapsis altitude (km)"} } for {set i 0} {$i < 6} {incr i} { bind $cmd.le0.c1.$i <Return> edit(oe) bind $cmd.le0.c1.$i <Tab> edit(oe) } if {$geomview_module == 1} { build_HOptionslist $cmd le2 edit(oe) \ {"Display satellite" edit_oe(disp_satellite)} \ {"Display orbit" edit_oe(disp_orbit)} \ {"Display cone" edit_oe(disp_cone)} \ {"Display footprint" edit_oe(disp_footprint)} } pack $cmd -fill both -expand 1 build_DismissButtonbar $name dbbar edit(dismiss) update set edit_oe(OK) 1}proc edit(dismiss) {} { destroy .edit}proc edit(oe) {} { global edit_oe if {$edit_oe(n) < 0} { return } # could make edited satellite more visible by moving Geomview plane # to its plane of orbit # satellites PLANE $edit_oe(i) $edit_oe(Omega) # but this should really be set via an $edit_oe(disp_plane) option. satellites SET $edit_oe(n) $edit_oe(a) $edit_oe(e) $edit_oe(i) \ $edit_oe(Omega) $edit_oe(omega) $edit_oe(T) $edit_oe(disp_satellite) \ $edit_oe(disp_orbit) $edit_oe(disp_cone) $edit_oe(disp_footprint) edit(set) $edit_oe(n) main(update_one) $edit_oe(n)}proc edit(slide_a) v { global edit_oe if {$edit_oe(OK) > 0} { set edit_oe(a) [expr $v*300+6400.0] edit(oe) }}proc edit(slide_e) v { global edit_oe if {$edit_oe(OK) > 0} { # Don't want slider to allow eccentricity > 0.85 # as this shows movement of orbit over time. set edit_oe(e) [expr $v/125.0] edit(oe) }}proc edit(slide_i) v { global edit_oe if {$edit_oe(OK) > 0} { set edit_oe(i) [expr $v/100.0*180.0] edit(oe) }}proc edit(slide_O) v { global edit_oe if {$edit_oe(OK) > 0} { set edit_oe(Omega) [expr $v/100.0*360.0] edit(oe) }}proc edit(slide_o) v { global edit_oe if {$edit_oe(OK) > 0} { set edit_oe(omega) [expr $v/100.0*180.0] edit(oe) }}proc edit(slide_T) v { global edit_oe if {$edit_oe(OK) > 0} { set edit_oe(T) [expr $v/0.01] edit(oe) }}proc edit(update) {} { set n [.main.cmd.lb curselection] if {[llength $n] == 0} { edit(reset) } else { edit(set) [lindex $n 0] edit(oe) }}proc edit(reset) {} { global edit_oe set edit_oe(n) -1 set edit_oe(a) "" set edit_oe(e) "" set edit_oe(i) "" set edit_oe(Omega) "" set edit_oe(omega) "" set edit_oe(T) "" set edit_oe(disp_satellite) 1 set edit_oe(disp_orbit) 1 set edit_oe(disp_cone) 1 set edit_oe(disp_footprint) 1}proc edit(set) n { global edit_oe set noe [satellites GET $n] if {$noe == ""} { edit(reset) } else { set edit_oe(n) $n set edit_oe(a) [lindex $noe 0] set edit_oe(e) [lindex $noe 1] set edit_oe(i) [lindex $noe 2] set edit_oe(Omega) [lindex $noe 3] set edit_oe(omega) [lindex $noe 4] set edit_oe(T) [lindex $noe 5] set edit_oe(Period) [lindex $noe 6] set edit_oe(Nodal_precession) [lindex $noe 7] set edit_oe(Apsidal_rotation) [lindex $noe 8] set edit_oe(Apoapsis_altitude) [lindex $noe 9] set edit_oe(Periapsis_altitude) [lindex $noe 10] set edit_oe(disp_satellite) [lindex $noe 11] set edit_oe(disp_orbit) [lindex $noe 12] set edit_oe(disp_cone) [lindex $noe 13] set edit_oe(disp_footprint) [lindex $noe 14] }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -