#############################################################################
# CDMS: Interface to CDMS-simulator
#   (c) 1997/2000: Rolf Schrödter, DLR, Institut für Planetenerkundung
#############################################################################
# $Id: BrowseInit.tcl,v 1.2 2006-11-17 16:34:47+01 rolf Exp rolf $
#############################################################################
# BrowseInit.tcl :    Init global variables
#############################################################################

namespace eval browse {  ;# create data namespace
    variable BROWSE
    variable DATA

    set BROWSE(Frame.Size)      280                 ;# TM frame size in bytes
    set BROWSE(Frame.Synchro)   [expr 0xFC1D1ACF]   ;# TM frame synchro, 32-bit little-endian

    set BROWSE(Latency)      1000        ;# How often to check file size

    set BROWSE(Unit.1)      APX
    set BROWSE(Unit.2)      TCU2
    set BROWSE(Unit.3)      CONSERT
    set BROWSE(Unit.4)      COSAC
    set BROWSE(Unit.5)      ADS
    set BROWSE(Unit.6)      PTOLEMY
    set BROWSE(Unit.7)      MUPUS
    set BROWSE(Unit.8)      ROLIS
    set BROWSE(Unit.9)      ROMAP
    set BROWSE(Unit.10)     SESAME
    set BROWSE(Unit.11)     POWER
    set BROWSE(Unit.12)     ANCHOR
    set BROWSE(Unit.13)     DRILL
    set BROWSE(Unit.14)     TCU1
    set BROWSE(Unit.15)     TIMER1
    set BROWSE(Unit.16)     GEAR
    set BROWSE(Unit.17)     TIMER2

    set BROWSE(CDMS.Fields) {
        Unit
        Type
        Hdr.Synchro     Hdr.UnitPID     Hdr.Category
        Hdr.PackSeq     Hdr.PackLen
        Hdr.OBT         Hdr.DataFieldHdr
        Hdr.StartFmt    Hdr.ScanPeriod  Hdr.ProcParm
        Hdr.DECW        Hdr.PECW
    }

    set BROWSE(BufSize.In)  102400      ;# Input buffer size
    set BROWSE(BufSize.Out) 102400      ;# Output buffer size

    set BROWSE(File.Types) {
        { "CDMS files" .dat   }
        { "CDMS files" .hk    }
        { "CDMS files" .rolbin   }
        { "All files"   *       }
    }

    set BROWSE(File.Dir)        [pwd]
    set BROWSE(File.FullName)   "<no file>"
    set BROWSE(File.Name)       "<no file>"
    set BROWSE(File.Chan)       ""
    set BROWSE(File.Size)       0       ;# file size in frames
    set BROWSE(File.Pos)        0       ;# file position in frames

    set BROWSE(Win)             ?
    set BROWSE(Win.Hdr)         ?
    set BROWSE(Win.NB)          ?
    set BROWSE(Win.Page)        Dump
    set BROWSE(Win.SearchBack)  0
    set BROWSE(Win.Message) ""

    set DATA(Unit)              ""
    set DATA(Type)              ""
}
