; $Id: ccsds_hdr__define.pro 405 2010-07-04 11:21:38Z viggoh $
;+
; NAME:
;       CCSDS_HDR__DEFINE
;
; PURPOSE:
;       CCSDS_HDR__DEFINE defines the class structure 'ccsds_hdr'. 
;       An object of class 'ccsds_hdr' contains the parameters of 
;       the 10 byte CCDSDS header, that comes with all SOLAR B data 
;       packets (sent from the MDP to the ground). 
;
; CATEGORY:
;       Hansteen/Wikstol Data analysis SW
;
; CALLING SEQUENCE:
;       The CCSDS_HDR__DEFINE procedure is not called directly. An
;       object of class CCSDS_HDR is created with the following
;       statement: 
;                   ccsds_hdr = obj_new('ccsds_hdr')
;       To fill the object with information use the following statement:
;                     ccsds_hdr-> read, lu
;
; INPUTS:
;
; KEYWORD PARAMETERS:
;
; OUTPUTS:
;       Objects of type CCSDS_HDR
;
; CALLS:
;
; COMMON BLOCKS:
;       
;
; PROCEDURE:
;       The procedure opens an object of class CCSDS_HDR. The CCSDS_HDR
;       class inherits the superclass HW_HDR, that defines the general
;       structure of header classes used by the HW data analysis SW. 
;       This procedure also includes various functions (methods of
;       class  'ccsds_hdr') whose purpose is to get the different
;       fields of the header. For example, if you want to know the
;       version number:
;               print, ccsds_hdr-> getccsds_ver_no()
;
;
; RESTRICTIONS:
;
;
; MODIFICATION HISTORY:
;       21-Mar-2001: Oivind Wikstol.
;       26-Sep-2001: Oivind Wikstol. Added documentation.
;       10-Feb-2007: Viggo Hansteen. Added help mehtods.
;
; $Id: ccsds_hdr__define.pro 405 2010-07-04 11:21:38Z viggoh $
;-
;
function ccsds_hdr::init
  self.help=obj_new('hw_help')
  return,1
end

pro ccsds_hdr::display_all
  self.help->display_all
  return
end

pro ccsds_hdr::display_methods
  self.help->display_methods
  return
end

pro ccsds_hdr::cleanup
  obj_destroy,self.help
end

function ccsds_hdr::get_apid
  return, self.apid
end

function ccsds_hdr::getccsds_ver_no
  return, self.ver_no
end

function ccsds_hdr::getccsds_seq_flag
  return, self.seq_flag
end

function ccsds_hdr::getccsds_seq_count
  return, self.seq_count
end

function ccsds_hdr::getccsds_pkt_len
  return, self.pkt_len
end

function ccsds_hdr::getccsds_time
  return, self.time
end

pro ccsds_hdr__define

  struct={ccsds_hdr, $
          help:obj_new(), $
          raw:bytarr(10), $
          ver_no:0B, $
          type:0B, $
          seq_hdr_flag:0B, $
          apid:0U, $
          seq_flag:0B, $
          seq_count:0U, $
          pkt_len:0U, $
          time:0UL}       
end
