Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages | Examples

startup.cpp

Go to the documentation of this file.
00001 /************************************************************************************************/
00002 /*! \file startup.cpp
00003 *  \brief Specify which devices to start using the relay board
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 <fstream.h>
00013 #include <iostream.h>
00014 #include <unistd.h>
00015 #include <string>
00016 #include <Base/Actuator.h>
00017 #include "instrument.h"
00018 #include <sys/io.h>
00019 
00020 using namespace std;
00021 
00022 int DefineDevice(int devicenum) // define address of relay for each device need to define channel 2 in physicalrelay
00023 {
00024 int dsignal=0;
00025 switch(devicenum) {
00026         case 1: // MotionPak address is 1
00027         dsignal= 1;
00028         break;
00029         
00030         case 2: // Momentum Wheel x address is 2
00031         dsignal = 2;
00032         break;
00033 
00034         case 3: // Momemtum Wheel y address is 4
00035         dsignal = 4;
00036         break;
00037         
00038         case 4: // Momemtum Wheel z address is 8
00039         dsignal = 8;
00040         break;
00041 
00042         case 5: // Linear Actuator x address is 16
00043         dsignal = 16;
00044         break;
00045 
00046         case 6: // Linear Actuator y address is 32
00047         dsignal = 32;
00048         break;
00049         
00050         case 7: // Linear Actuator z address is 64
00051         dsignal = 64;
00052         break;
00053         
00054         case 8:// CMG motor is 128
00055         dsignal = 128;
00056         break;
00057 
00058         default:        
00059         break;  
00060 }
00061 return dsignal;
00062 }
00063 
00064 int main() {
00065 
00066         Relay mySetup; // implement relay class
00067         int signal=0; 
00068         char ans;
00069         int value=0;
00070 
00071         // begin direct configuration of devices enabled
00072 
00073         cout << "Power on Momentum Wheel X? :";
00074         cin >> ans;
00075         if(ans=='y') {
00076                 value = DefineDevice(2);
00077                 signal = signal + value;
00078                 }
00079 
00080         else {signal = signal;}
00081         
00082         cout << "Power on Momentum Wheel Y? :";
00083         cin >> ans;
00084         if(ans=='y') {
00085                 value = DefineDevice(3);
00086                 signal = signal + value;
00087                 }
00088         else {signal = signal;}
00089         
00090         cout << "Power on Momentum Wheel Z? :";
00091         cin >> ans;
00092         if(ans=='y') {
00093                 value = DefineDevice(4);
00094                 signal = signal + value;
00095                 }
00096         else {signal = signal;}
00097 
00098         cout << "Power on MotionPak? :";
00099         cin >> ans;
00100         if(ans=='y') {
00101                 value=DefineDevice(1);
00102                 signal = signal + value;
00103                 }
00104         else {signal = signal;}
00105 
00106         cout <<  "Power on Linear Actuator Control X? :" ;
00107         cin >> ans;
00108         if(ans=='y') {
00109                 value=DefineDevice(5);
00110                 signal = signal + value;
00111                 }
00112         else {signal=signal;}
00113                 
00114 
00115         cout << "Power on Linear Actuator Control Y? :";
00116         cin >> ans;
00117         if(ans=='y') {
00118                 value=DefineDevice(6);
00119                 signal = signal + value;
00120                 }
00121         else {signal=signal;}
00122 
00123         cout <<  "Power on Linear Actuator Control Z? : ";
00124         cin >> ans;
00125         if(ans=='y') {
00126                 value=DefineDevice(7);
00127                 signal = signal + value;
00128                 }
00129         else {signal=signal;}
00130 
00131         cout <<  "Power on CMG? : ";
00132         cin >> ans;
00133         if(ans=='y') {
00134                 value=DefineDevice(8);
00135                 signal = signal + value;
00136                 }
00137         else {signal=signal;}
00138                 cout << signal;
00139                 mySetup.PowerOn(signal, 0);
00140                         
00141         return 0;
00142 }
00143 
00144 // Do not change the comments below - they will be added automatically by CVS
00145 /*****************************************************************************
00146 *       $Log: startup.cpp,v $
00147 *       Revision 1.1  2006/07/05 21:04:21  jayhawk_hokie
00148 *       Initial submission for power management of Whorl's.
00149 *
00150 *
00151 *
00152 ******************************************************************************/
00153 

Generated on Wed Sep 5 12:54:25 2007 for DSACSS Operational Code by  doxygen 1.3.9.1