00001 ////////////////////////////////////////////////////////////////////////////////////////////////// 00002 /*! \file instrument.cpp 00003 * \brief Implementation of the relay class 00004 * \author $Author: jayhawk_hokie $ 00005 * \version $Revision: 1.1 $ 00006 * \date $Date: 2006/07/05 21:04:21 $ 00007 *////////////////////////////////////////////////////////////////////////////////////////////////// 00008 /*! 00009 */ 00010 /////////////////////////////////////////////////////////////////////////////////////////////////// 00011 00012 #include "instrument.h" 00013 00014 ////////////////////////////////////////////////////////////////////// 00015 // Construction/Destruction 00016 ////////////////////////////////////////////////////////////////////// 00017 00018 Relay::Relay() 00019 { 00020 00021 } 00022 Relay::Relay(cfgBody& cfgdat) 00023 { 00024 const char *myCommands[20] = {"Number"}; 00025 for (int i = 0; cfgdat.keys[i][0]; i++){ 00026 switch(getCmdIndex(myCommands, cfgdat.keys[i])){ 00027 case 0: 00028 m_Device = atoi(cfgdat.vals[i][0]); 00029 break; 00030 default: 00031 break; 00032 } 00033 } 00034 Initialize(); 00035 } 00036 00037 Relay::~Relay() 00038 { 00039 Stop(); 00040 Deinitialize(); 00041 } 00042 00043 int Relay::Initialize() 00044 { 00045 m_PhysicalRelay.Initialize(); 00046 return 0; 00047 } 00048 00049 void Relay::PowerOn(BYTE signal, int bank) 00050 { 00051 m_PhysicalRelay.PowerOn(signal, bank); 00052 } 00053 00054 void Relay::PowerOff() 00055 { 00056 m_PhysicalRelay.PowerOff(); 00057 } 00058 00059 int Relay::Stop() 00060 { 00061 return NO_ERROR; 00062 } 00063 00064 // Do not change the comments below - they will be added automatically by CVS 00065 /***************************************************************************** 00066 * $Log: instrument.cpp,v $ 00067 * Revision 1.1 2006/07/05 21:04:21 jayhawk_hokie 00068 * Initial submission for power management of Whorl's. 00069 * 00070 * 00071 * 00072 ******************************************************************************/