package ifc.bim.openecg.jtools.jparser; /** *
Title: SCP-ECG Section Header
*Description: The structure of Section 0 with methods to parse data
*Company: Ist. Fisiologia Clinica del CNR via G.Moruzzi,1 54124 Pisa Italy
* @authors Giacomo Ciani - Fabrizio Conforti (conforti@ifc.cnr.it) * @version 1.0 */ import java.io.*; import java.nio.*; import java.util.*; import java.util.logging.*; import javax.imageio.stream.*; /** * The structure of Section 0 with methods to parse data */ public class Sect000 extends SectGen { /** *The structure of a section pointer */ public class Pointer { /**Stores the section id*/ public int id; /**Stores the section length*/ public int len; /**Stores the section starting position*/ public int idx; /** *Constructs a Pointer */ public Pointer(){ id = readShort(); len = readInt(); idx = readInt(); } } /**Stores the sections' pointers*/ public Pointer[] ptrs; /** *Constructs a Sect0 with an anonymous logger */ public Sect000 () { this( Logger.getAnonymousLogger() ); } /** * Constructs a Sect0 that uses a specific logger * @param log the logger to be used */ public Sect000(Logger log){ this.log =log; head.sectCrc=0; head.sectId =0; head.sectLen=16; head.dataLen=0; head.sectVer=20; head.protVer=20; head.res ="SCPECG"; } /** * Parse the data part retrieving the value of single fields * @param lNum total number of leads stored in the SCP-ECG record (irrilevant for this section) * @throws Exception if any error occours during the operation */ public void Parse (int lNum) throws Exception{ try { ptrs = new Pointer[head.dataLen/10]; for(int i=0; i