package org.josast.amicalsat;

import java.util.HashMap;


public abstract class Frame {
    protected FrameTlmAmicalsat data =null;
	protected HashMap <String, String> hash = new HashMap<String, String>();
	protected HashMap <String, String> hashHeader = new HashMap<String, String>();
	private String tlmArea;
	private String typeFrame;
	
	
	public  void setUp(FrameTlmAmicalsat fm)
	{
		data = fm;
		tlmArea = fm.frameTlmEntrySat().payload().tlmArea();
		typeFrame = fm.frameTlmEntrySat().payload().tlmType();
		hash.put("Area", tlmArea);
		hash.put("typeFrame", typeFrame);		
		setUpFrame();
	}

	protected abstract void  setUpFrame ();
	
    public String toStringHeader() {
    	hashHeader.put("Source", data.frameTlmEntrySat().ax25Header().srcCallsignRaw().srcCallsignRor().srcCallsign());
    	hashHeader.put("Destination",data.frameTlmEntrySat().ax25Header().destCallsignRaw().destCallsignRor().destCallsign());
    	hashHeader.put("PID",""+data.frameTlmEntrySat().payload().pid());
       	hashHeader.put("SSID",""+data.frameTlmEntrySat().ax25Header().srcSsidRaw());
		return hashHeader.toString();

    }
	@Override
    public String toString() {
		return hash.toString();

    }

}
