Changeset 6657


Ignore:
Timestamp:
Dec 5, 2016 12:58:07 PM (8 years ago)
Author:
ldelgass
Message:

add ephemeris time map style setting

Location:
trunk/gui/scripts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/map.tcl

    r6651 r6657  
    614614    foreach key [array names styleinfo] {
    615615        set valid 0
    616         foreach validkey {-ambient -color -edgecolor -edges -lighting -linewidth -vertscale -wireframe} {
     616        foreach validkey {-ambient -color -edgecolor -edges -lighting -linewidth -time -vertscale -wireframe} {
    617617            if {$key == $validkey} {
    618618                set valid 1
  • trunk/gui/scripts/mapviewer.tcl

    r6563 r6657  
    9292    private method Camera {option args}
    9393    private method Connect {}
     94    private method ConvertTime { timeval }
    9495    private method CurrentLayers {args}
    9596    private method DisablePanningMouseBindings {}
     
    26542655}
    26552656
     2657# Convert from Tcl integer epoch time value to hours as a double
     2658itcl::body Rappture::MapViewer::ConvertTime { timeval } {
     2659    set hrs [clock format $timeval -format %k -gmt 1]
     2660    set min [clock format $timeval -format %M -gmt 1]
     2661    set sec [clock format $timeval -format %S -gmt 1]
     2662    set val [expr {$hrs + $min/60.0 + $sec/3600.0}]
     2663}
     2664
    26562665itcl::body Rappture::MapViewer::SetTerrainStyle { style } {
    26572666    array set settings {
     
    26622671        -lighting 1
    26632672        -linewidth 1.0
     2673        -time now
    26642674        -vertscale 1.0
    26652675        -wireframe 0
     
    26732683    SendCmd "map terrain color [Color2RGB $settings(-color)]"
    26742684    #SendCmd "map terrain colormode constant"
     2685    if {$settings(-time) eq "now"} {
     2686        set settings(-time) [ConvertTime [clock seconds]]
     2687    } else {
     2688        set settings(-time) [ConvertTime [clock scan $settings(-time) -gmt 1]]
     2689    }
     2690    SendCmd "map time $settings(-time)"
     2691    set _settings(time) $settings(-time)
    26752692    SendCmd "map terrain lighting $settings(-lighting)"
    26762693    set _settings(terrain-lighting) $settings(-lighting)
Note: See TracChangeset for help on using the changeset viewer.