00001 // This class is to serve in figuring out the integral of a function 00002 // It will operate by being a circular que of a 2 200 element arrays. 00003 // One array will hold the error value and one will hold the sample-hold 00004 // time or the sample time (TBD). Both arrays will be initialized with 00005 // zeroes. 00006 00007 #ifndef CAJUN_STEERING_INTEGRAL 00008 #define CAJUN_STEERING_INTEGRAL 00009 00010 #include <cmath> 00011 00012 using namespace std; 00013 00014 class integral 00015 { 00016 public: 00017 // Initialize integral queue with all values as zero, 00018 00019 void initializeIntegral(); 00020 00021 // The function should be sent the new values and will return 00022 // the old values. 00023 00024 void pushPullValues(double &error, double &time); 00025 double get_total_error () { return m_total_error;} 00026 00027 // Que will keep track of the totals in each category 00028 00029 private: 00030 double m_errorQue[200]; 00031 double m_timeQue[200]; 00032 int m_queMarker; 00033 double m_total_error; 00034 }; 00035 00036 00037 #endif