package org.josast.amicalsat;

import org.josast.amicalsat.generated.FrameTlmAmicalsat.U2RlType;
import org.josast.amicalsat.generated.FrameTlmAmicalsat.U2Type;

//#[U2];RL;[Timestamp],[CPU voltage];[Battery voltage];[CPU temperature];[Amplifier temperature];[Flags]

public class U2RlTypeFrame extends Frame {


	
    private String cpuVoltage;
	private String batteryVoltage;
	private String cpuTtemperature;
	private String amplifierTemperature;
	private String flags;
	private Double cpuVoltageVolt;
	private Double batteryVoltageVolt;
	private Integer cpuTemperatureDegree;
	private Integer amplifierTemperatureDegree;
	private Integer flagsHexa;

	@Override
	protected void setUpFrame() {

		U2Type u2type = (U2Type) data.frameTlmEntrySat().payload().tlmAreaSwitch();
		U2RlType mstype = (U2RlType) u2type.tlmsw();
		
		timeStamps = mstype.timeStamp();
		hash.put("timeStamps", timeStamps);
		
	    cpuVoltage = mstype.cpuVoltage();
		hash.put("cpuVoltage", cpuVoltage);
		batteryVoltage = mstype.batteryVoltage();
		hash.put("batteryVoltage", batteryVoltage);
		cpuTtemperature = mstype.cpuTemperature();
		hash.put("cpuTtemperature", cpuTtemperature);
		cpuTtemperature = mstype.batteryVoltage();
		hash.put("batteryVoltage", batteryVoltage);
		amplifierTemperature = mstype.amplifierTemperature();
		hash.put("amplifierTemperature", amplifierTemperature);	
		flags = mstype.flags();
		hash.put("flags", ""+flags	);	
		
		cpuVoltageVolt = mstype.cpuVoltageVolt() ; 
		batteryVoltageVolt= mstype.batteryVoltageVolt();
		cpuTemperatureDegree = mstype.cpuTemperatureDegree();
		amplifierTemperatureDegree=mstype.amplifierTemperatureDegree();      
		flagsHexa=mstype.flagsHexa();
		
	}
	
	public  String toStringDecoded()
	{
		return "CPU VoltageVolt (V) = "+cpuVoltageVolt
				+ ", Battery Voltage (V) = "+batteryVoltageVolt
				+ ", CPU Temperature (D) = "+cpuTemperatureDegree				
				+ ", Amplifier Temperature (D) = "+amplifierTemperatureDegree
				+ ", flags  = "+flagsHexa;
	}

	public Double getCpuVoltageVolt() {
		return cpuVoltageVolt;
	}

	public Double getBatteryVoltageVolt() {
		return batteryVoltageVolt;
	}

	public Integer getCpuTemperatureDegree() {
		return cpuTemperatureDegree;
	}

	public Integer getAmplifierTemperatureDegree() {
		return amplifierTemperatureDegree;
	}

	public Integer getFlagsHexa() {
		return flagsHexa;
	}

	
	

}
