/**
 * This thread runs during a connection with a remote device.
 * It handles all incoming and outgoing transmissions.
 */
package nctu.brc.mindo_con.constant;

import android.app.Application;




public class Constant extends Application{
	
	
		
	private static Constant dom;
	
	public static Constant getInstance() {
		if (dom == null)
			dom = new Constant();
		return dom;
	}

	
	private int seconds=4,resolution=16,channel=4,brain_channel,sampleRate=512,gain=1,downSample,downSampleCheck,offlineDisplaySecond,
	offline_Height,offline_Width,offline_Channel,offline_SampleRate,offline_Second,offline_rawDataLength,data_sec,preAmp
	,display_index,gain_index;
	private String saveAs,file_name;
	private double[][] VoltData;
	private float dataLengthCh;
	private byte[] header1;
	
	public void setDisplay(int seconds){
		this.seconds = seconds;
	}
	
	public int getDisplay(){
		return seconds;
	}

	public void setResolution(int resolution){
		this.resolution = resolution;
	}
	
	public int getResolution(){
		return resolution;
	}

	public void setChannel(int channel){
		this.channel = channel;
	}
	
	public int getChannel(){
		return channel;
	}
	
	public void setBrainChannel(int brain_channel){
		this.brain_channel = brain_channel;
	}
	
	public int getBrainChannel(){
		return brain_channel;
	}

	public void setSampleRate(int sampleRate){
		this.sampleRate = sampleRate;
	}
	
	public int getSampleRate(){
		return sampleRate;
	}

	public void setGain(int gain){
		this.gain = gain;
	}
	
	public int getGain(){
		return gain;
	}
	
	public void setPreAmp(int preAmp){
		this.preAmp = preAmp;
	}
	
	public int getPreAmp(){
		return preAmp;
	}
	
	public void setSaveAs(String saveAs){
		this.saveAs = saveAs;
	}
	
	public String getSaveAs(){
		return saveAs;
	}
	
	public void setDownSample(int downSample){
		this.downSample = downSample;
	}
	
	public int getDownSample(){
		return downSample;
	}
	
	public void setDownSampleCheck(int downSampleCheck){
		this.downSampleCheck = downSampleCheck;
	}
	
	public int getDownSampleCheck(){
		return downSampleCheck;
	}
	
	public void setDisplayIndex(int index){
		display_index = index;
	}
	public int getDisplayIndex(){
		return display_index;
	}
	
	public void setGainIndex(int index){
		gain_index = index;
	}
	
	public int getGainIndex(){
		return gain_index;
	}
	
	public String[] getChannelInfo(int Channel){
		String[] channel_text = new String[Channel];
    	if(Channel==4){
    		channel_text[0] = "AF8";
    		channel_text[1] = "FP2";
    		channel_text[2] = "FP1";
    		channel_text[3] = "AF7";
    	}else if(Channel==16){
    		channel_text[0] = "AF8";
    		channel_text[1] = "FP2";
    		channel_text[2] = "FP1";
    		channel_text[3] = "AF7";
    		channel_text[4] = "AF8";
    		channel_text[5] = "FP2";
    		channel_text[6] = "FP1";
    		channel_text[7] = "AF7";
    		channel_text[8] = "AF8";
    		channel_text[9] = "FP2";
    		channel_text[10] = "FP1";
    		channel_text[11] = "AF7";
    		channel_text[12] = "AF8";
    		channel_text[13] = "FP2";
    		channel_text[14] = "FP1";
    		channel_text[15] = "AF7";
    	}
    	return channel_text;
	}
	
	public void setFirstOfflineVoltData(double[][] VoltData){
		this.VoltData = VoltData;
	}
	
	public double[][] getFirstOfflineVoltData(){
		return VoltData;
	}
	
	public void setOffline_Channel(int offline_Channel){
		this.offline_Channel = offline_Channel;
	}

	public int getOffline_Channel(){
		return offline_Channel;
	}
	
	public void setOffline_SampleRate(int offline_SampleRate){
		this.offline_SampleRate = offline_SampleRate;
	}

	public int getOffline_SampleRate(){
		return offline_SampleRate;
	}
	
	public void setOfflineSecond(int offline_Second){
		this.offline_Second = offline_Second;
	}
	
	public int getOfflineSecond(){
		return offline_Second;
	}
	
	public void setOfflineFileName(String file_name){
		this.file_name = file_name;	
	}
	
	public String getOfflineFileName(){
		return file_name;
	}
	
	public void setOfflineRawDataLength(int offline_rawDataLength){
		this.offline_rawDataLength = offline_rawDataLength;
	}
	
	public int getOfflineRawDataLength(){
		return offline_rawDataLength;
	}
	
	public void setCutDataLength(int data_sec){
		this.data_sec = data_sec;//一次load幾秒的data長度
	}
	
	public int getCutDataLength(){
		return data_sec;
	}
	
	public void setRawDataLengthOfChannel(float dataLengthCh){
		this.dataLengthCh = dataLengthCh;
	}
	
	public float getRawDataLengthOfChannel(){
		return dataLengthCh;
	}
	
	public void setOfflineDisplaySecond(int offlineDisplaySecond){
		this.offlineDisplaySecond = offlineDisplaySecond;
	}
	
	public int getOfflineDisplaySecond(){
		return offlineDisplaySecond;
	}
	
	public void setReadHeader1(byte[] header1){
		this.header1 = header1;
	}
	
	public byte[] getReaderHeader1(){
		return header1;
	}
}

