OPower.cc

Go to the documentation of this file.
00001 /*
00002  * This file is part of openSDK.
00003  *
00004  * Copyright (C) 2006-2007 openSDK team
00005  *
00006  * openSDK is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; version 2.
00009  *
00010  * openSDK 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 openSDK; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00018  *
00019  *     $Id: OPower.cc,v 1.3 2007/01/26 23:12:05 nuno-lopes Exp $
00020  */
00021 
00022 #include <OPENR/OPower.h>
00023 #include <time.h>
00024 
00025 OPowerStatus::OPowerStatus() {
00026         // do nothing
00027 }
00028 
00029 OPowerStatus::OPowerStatus(longword rs, word bs, word rc, word tmpr, word fc, word vlt, word crnt, sbyte td, byte vlm)
00030 {
00031         robotStatus          = rs;
00032         batteryStatus        = bs;
00033         remainingCapacity    = rc;
00034         temperature          = tmpr;
00035         fullyChargedCapacity = fc;
00036         voltage              = vlt;
00037         current              = crnt;
00038         timeDif              = td;
00039         volume               = vlm;
00040 }
00041 
00042 OPowerStatus::OPowerStatus(const OPowerStatus& ps)
00043 {
00044         *this = ps;
00045 }
00046 
00047 void OPowerStatus::Set(longword rs, word bs, word rc, word tmpr, sbyte td, byte vlm)
00048 {
00049         robotStatus          = rs;
00050         batteryStatus        = bs;
00051         remainingCapacity    = rc;
00052         temperature          = tmpr;
00053         timeDif              = td;
00054         volume               = vlm;
00055 }
00056 
00057 OPowerStatus& OPowerStatus::operator=(const OPowerStatus& ps)
00058 {
00059         robotStatus          = ps.robotStatus;
00060         batteryStatus        = ps.batteryStatus;
00061         remainingCapacity    = ps.remainingCapacity;
00062         temperature          = ps.temperature;
00063         fullyChargedCapacity = ps.fullyChargedCapacity;
00064         voltage              = ps.voltage;
00065         current              = ps.current;
00066         timeDif              = ps.timeDif;
00067         volume               = ps.volume;
00068 
00069         return *this;
00070 }
00071 
00072 void OPowerStatus::Print() const
00073 {
00074         //TODO
00075 }
00076 
00077 void OPowerStatus::PrintDetail() const
00078 {
00079         //TODO
00080 }
00081 
00082 
00083 // OBootCondition class
00084 OBootCondition::OBootCondition()
00085 {
00086         // do nothing
00087 }
00088 
00089 OBootCondition::OBootCondition(word bm)
00090 {
00091         bitmap = bm;
00092 }
00093 
00094 OBootCondition::OBootCondition(word bm, time_t bt, longword btt)
00095 {
00096         bitmap = bm;
00097         bootTime = bt;
00098         bootTimeType = btt;
00099 }
00100 
00101 OBootCondition::OBootCondition(word bm, time_t bt, longword btt, byte vl)
00102 {
00103         bitmap = bm;
00104         bootTime = bt;
00105         bootTimeType = btt;
00106         vibrationLevel = vl;
00107 }
00108 
00109 OBootCondition::OBootCondition(const OBootCondition& bc)
00110 {
00111         *this = bc;
00112 }
00113 
00114 OBootCondition& OBootCondition::operator=(const OBootCondition& bc)
00115 {
00116         bitmap = bc.bitmap;
00117         bootTime = bc.bootTime;
00118         bootTimeType = bc.bootTimeType;
00119         vibrationLevel = bc.vibrationLevel;
00120 
00121         return *this;
00122 }

Generated on Sun Dec 2 23:04:30 2007 for openSDK by  doxygen 1.3.9.1