"""Useful definitions for Juno Waves GSE programming."""

import struct
import time
import sys

import util

##############################################################################
# Globals...

# Constants for getPktBytes
STOP_AT_EOF = True
DONT_STOP_AT_EOF = False

g_nJunoSclkOffset = 946706400.0

# Description Strings
g_dMPid2Str = {
   0x0:"Invalid", 0x1:"Invalid", 0x2:"Invalid", 0x3:"Invalid",
   0x4:"HFR Spectrum", 0x5:"HFR Baseband Spectrum", 0x6:"Invalid",
   0x7:"HFWBR Baseband Waveform", 0x8:"HFWBR Waveform",
   0x9:"LFR Spectrum", 0xA:"LFR Waveform", 0xB:"Invalid", 0xC:"Invalid",
	0xD:"Invalid", 0xE:"Invalid", 0xF:"MRO (deprecated)"
}

g_dMPid2ShortStr = {
   0x0:"Inval", 0x1:"Inval",    0x2:"Inval",    0x3:"Inval", 
	0x4:"HFR",   0x5:"HFR Base", 0x6:"Inval",    0x7:"HFWBR Base",
	0x8:"HFWBR", 0x9:"LFR Spec", 0xA:"LFR Wfrm", 0xB:"Inval", 
	0xC:"Inval", 0xD:"Inval",    0xE:"Inval",    0xF:"MRO (dep)"
}

g_dMPsrc2Str = {
	0x0:"Invalid       ", 0x1:"Mag 50 kHz    ", 0x2:"Elec 50 KHz   ",
	0x3:"Elec 375 KHz  ", 0x4:"Invalid       ", 0x5:"Invalid       ",
	0x6:"HFWBR Log     ", 0x7:"HFR Log       ", 0x8:"WBR I 1.3 MHz ",
	0x9:"WBR Q 1.3 MHz ", 0xA:"WBR IQ 1.3 MHz", 0xB:"WBR I 7 MHz   ", 
	0xC:"HFR I 1.3 MHz ", 0xD:"HFR Q 1.3 MHz ", 0xE:"HFR IQ 1.3 MHz",
	0xF:"HFR I 7 MHz   "
}

g_dFmt2Str = {
     
     0x14:"8 bit Int Rice",
      0x4:"8 bit Int in 8 bits  ",
     0x11:"8 bit Int in 16 bits, LBS",
      
     0x13:"12 bit Int Rice Comp.",
     0x10:"12 bit Int Truc. to 8 bits",
      0x6:"12 bit Int in 12 bits",
      0x7:"12 bit Int in 16-bits, LBS",
      0x8:"12 bit Int in 23-bits, LBS",

      0x9:"16 bit Int Rice Comp",
      0xA:"16 bit Int Trunc to 8 bits",
      0xB:"16 bit Int Trunc to 12 bits",
      0xC:"16 bit Int in 16 bits",
      0xD:"16 bit Int in 32 bits, LBS",

      0xE:"9 bit FP in 12 bits, LBS, Rice",
      0xF:"9 bit FP in 16 bits, LBS, Rice",
      0x5:"9 bit FP in 9 bits",
      0x3:"9 bit FP in 16 bits, LBS",
     0x12:"9 bit FP in 32 bits, LBS",
     
      0x2:"32 bit FP in 32 bits"
}


