variable.cpp

00001 /***************************************************************************
00002  *   Copyright (C) 2004-2005 by Daniel Clarke   daniel.jc@gmail.com        *
00003  *   Copyright (C)      2005 by David Saxton                               *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 
00021 #include "pic14.h"
00022 #include "variable.h"
00023 
00024 Variable::Variable( VariableType type, const QString & name )
00025 {
00026         m_type = type;
00027         m_name = name;
00028 }
00029 
00030 
00031 Variable::Variable()
00032 {
00033         m_type = invalidType;
00034 }
00035 
00036 
00037 Variable::~Variable()
00038 {
00039 }
00040 
00041 
00042 void Variable::setPortPinList( const PortPinList & portPinList )
00043 {
00044         m_portPinList = portPinList;
00045 }
00046 
00047 
00048 bool Variable::isReadable() const
00049 {
00050         switch (m_type)
00051         {
00052                 case charType:
00053                 case keypadType:
00054                         return true;
00055                 case sevenSegmentType:
00056                 case invalidType:
00057                         return false;
00058         }
00059         
00060         return false;
00061 }
00062 
00063 
00064 bool Variable::isWritable() const
00065 {
00066         switch (m_type)
00067         {
00068                 case charType:
00069                 case sevenSegmentType:
00070                         return true;
00071                 case keypadType:
00072                 case invalidType:
00073                         return false;
00074         }
00075         
00076         return false;
00077 }
00078 
00079 

Generated on Tue May 8 17:05:34 2007 for KTechLab by  doxygen 1.5.1