/*
    AVR8 Burn-O-Mat
 
    Copyright (C) 2007  Torsten Brischalle

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/
 */
package avr8_burn_o_mat;

import de.lazyzero.kkMulticopterFlashTool.KKMulticopterFlashTool;


public class AVR {
    
	private String lfuse; 
	private String hfuse;
	
    private String m_name;
    
    private String m_caption;
	private String desc;
	private int eepromSize;
    
  
    
    /** Creates a new instance of AVR */
    public AVR() {
    }
    
    public AVR(String name, String caption) {
        m_name = name;
        m_caption = caption;
    }
    
    public AVR(String name, String desc, String caption, int eepromSize, String lfuse, String hfuse) {
        m_name = name;
        m_caption = caption;
        this.desc = desc;
        this.lfuse = lfuse;
        this.hfuse = hfuse;
        this.eepromSize = eepromSize;
      
    }
    
    public String getDescription() {
    	return desc;
    }

	@Override
	public String toString() {
		String name = this.getName() + (null!=this.getDescription()?" (" + this.getDescription() + ")":"");
		return name;
	}

	public String getName() {
        return m_name;
    }
	
	public String getCaption() {
	        return m_caption;
	    }

    
    public String getCaptionAliasFree() {
    	if (m_caption.equals(KKMulticopterFlashTool.KKPLUSBOOT)) {
    		return "m168p";
    	} else if (m_caption.equals(KKMulticopterFlashTool.FLYCAM_BLACKBOARD_P)) {
    		return "m168p";
    	} else if (m_caption.equals(KKMulticopterFlashTool.FLYCAM_BLACKBOARD)) {
    		return "m168";
    	} else if (m_caption.equals(KKMulticopterFlashTool.ESC)) {
    		return "m8";
    	} else if (m_caption.equals(KKMulticopterFlashTool.SMARTLCD)) {
    		return "m48p";
    	}
        return m_caption;
    }

	/**
	 * @return the lfuse
	 */
	public String getLfuse() {
		return lfuse;
	}

	/**
	 * @param lfuse the lfuse to set
	 */
	public void setLfuse(String lfuse) {
		this.lfuse = lfuse;
	}

	/**
	 * @return the hfuse
	 */
	public String getHfuse() {
		return hfuse;
	}

	/**
	 * @param hfuse the hfuse to set
	 */
	public void setHfuse(String hfuse) {
		this.hfuse = hfuse;
	}

	public int getEepromSize() {
		return eepromSize;
	}

	public void setEepromSize(int eepromSize) {
		this.eepromSize = eepromSize;
	}
    

    
}
