PikeAero::CTaskFuelPressureMonitor Class Reference

Implements a fuel pressure monitor that controlls the fuel pump outputs and provides fuel pressure data to the EFI calculator. More...

#include <ctaskfuelpressuremonitor.h>

Inheritance diagram for PikeAero::CTaskFuelPressureMonitor:

Inheritance graph
[legend]
Collaboration diagram for PikeAero::CTaskFuelPressureMonitor:

Collaboration graph
[legend]

Public Member Functions

 CTaskFuelPressureMonitor ()
void event (CEvent *e)
 The CEvent listener [ inherits pointer ownership ].
virtual CMachine::bit32 fault ()
 The CTaskScheduler will call the fault() method when a fault code was returned by any of the task's other methods.
virtual const char * name ()
virtual CMachine::bit32 run ()
 called exactly once. perform task initialization such as initializing private variable. Other tasks are not guaranteed so do not interract with other tasks at this stage.
virtual CMachine::bit32 start ()
 called exactly once. all tasks are initialized at this point. called just prior to first call to run()
virtual CMachine::bit32 stop ()
 The CTaskScheduler will call the stop () method after the task was scheduled for cancelation.
virtual ~CTaskFuelPressureMonitor ()

Private Attributes

CMachine::ubit32 mFuelPressure [2]
CBinaryOutputGPIOmFuelPump [2]

Detailed Description

Implements a fuel pressure monitor that controlls the fuel pump outputs and provides fuel pressure data to the EFI calculator.

Author:
Michael Sharkey <mike@pikeaero.com>
Assumes fuel pressure senors are connected to the STR730 internal A/D channels 0, and 1. Fuel pressure 0 and 1 control fuel pump relay outputs 0 and 1 respectively.

Definition at line 34 of file ctaskfuelpressuremonitor.h.


Constructor & Destructor Documentation

PikeAero::CTaskFuelPressureMonitor::CTaskFuelPressureMonitor (  ) 

get instances of the GPIO pins

initialize with off-scale pressure reading

Definition at line 28 of file ctaskfuelpressuremonitor.cpp.

References GPIO1, GPIO_PIN_4, GPIO_PIN_5, mFuelPressure, mFuelPump, PikeAero::ITask::PriorityLow, and PikeAero::ITask::setPriority().

00029 : ITask()
00030 {
00031 
00032     /** get instances of the GPIO pins */
00033     mFuelPump[0] = new CBinaryOutputGPIO( GPIO1, GPIO_PIN_4, false, false );
00034     mFuelPump[1] = new CBinaryOutputGPIO( GPIO1, GPIO_PIN_5, false, false );
00035 
00036     /** initialize with off-scale pressure reading */
00037     mFuelPressure[0]=0xFFFFFFFF;
00038     mFuelPressure[1]=0xFFFFFFFF;
00039 
00040     setPriority( ITask::PriorityLow );
00041 }

Here is the call graph for this function:

PikeAero::CTaskFuelPressureMonitor::~CTaskFuelPressureMonitor (  )  [virtual]

Definition at line 44 of file ctaskfuelpressuremonitor.cpp.

References PikeAero::CEvent::AnalogToDigital, mFuelPump, PikeAero::CEventQueue::removeListener(), and stop().

00045 {
00046     stop();
00047     delete mFuelPump[0];
00048     delete mFuelPump[1];
00049     CEventQueue::removeListener(this,CEvent::AnalogToDigital);
00050 }

Here is the call graph for this function:


Member Function Documentation

void PikeAero::CTaskFuelPressureMonitor::event ( CEvent e  )  [virtual]

The CEvent listener [ inherits pointer ownership ].

The CEvent listener - Do not take pointer ownership of CEvent object pointer.

wake up the bottom half

Reimplemented from PikeAero::CObject.

Definition at line 115 of file ctaskfuelpressuremonitor.cpp.

References PikeAero::CEvent::AnalogToDigital, mFuelPressure, PikeAero::ITask::setSleeping(), and PikeAero::CEvent::type().

00116 {
00117     switch ( e->type() )
00118     {
00119         case CEvent::AnalogToDigital:
00120             {
00121                 CEventAnalogConversion* event = (CEventAnalogConversion*)e;
00122                 mFuelPressure[0] = event->value(0);
00123                 mFuelPressure[1] = event->value(1);
00124                 setSleeping(false); /** wake up the bottom half */
00125             }
00126             break;
00127         default:
00128             break;
00129     }
00130 }

Here is the call graph for this function:

CMachine::bit32 PikeAero::CTaskFuelPressureMonitor::fault (  )  [virtual]

The CTaskScheduler will call the fault() method when a fault code was returned by any of the task's other methods.

Returns:
0 on success.
The CTaskScheduler will call the fault() method when a fault code was returned by any of the task's other methods.

Reimplemented from PikeAero::ITask.

Definition at line 107 of file ctaskfuelpressuremonitor.cpp.

00108 {
00109     return 0;
00110 }

virtual const char* PikeAero::CTaskFuelPressureMonitor::name (  )  [inline, virtual]

Returns:
A CString containing an human readable name for the task

Reimplemented from PikeAero::ITask.

Definition at line 43 of file ctaskfuelpressuremonitor.h.

00043 {return "CTaskFuelPressureMonitor";}

CMachine::bit32 PikeAero::CTaskFuelPressureMonitor::run (  )  [virtual]

called exactly once. perform task initialization such as initializing private variable. Other tasks are not guaranteed so do not interract with other tasks at this stage.

Called periodically by CTaskScheduler to do a piece of work.

Returns:
0 on success.

Reimplemented from PikeAero::ITask.

Definition at line 68 of file ctaskfuelpressuremonitor.cpp.

References PikeAero::CMachine::config(), PikeAero::CMachine::FaultFuelPressureHigh, PikeAero::CMachine::FaultFuelPressureLow, PikeAero::CMachine::FaultNone, mFuelPressure, mFuelPump, PikeAero::CBinaryInputOutputGPIO::reset(), PikeAero::CBinaryInputOutputGPIO::set(), and PikeAero::ITask::setSleeping().

00069 {
00070     CMachine::FaultCode rc = CMachine::FaultNone;
00071 
00072     for ( CMachine::ubit32 n=0; n < 2; n++ )
00073     {
00074         if ( mFuelPressure[n] <= CMachine::config()->getFuelPressureMin(n) )
00075         {
00076             rc = CMachine::FaultFuelPressureLow;
00077             mFuelPump[n]->set();
00078         }
00079         else
00080         if ( mFuelPressure[n] >= CMachine::config()->getFuelPressureMax(n) )
00081         {
00082             rc = CMachine::FaultFuelPressureHigh;
00083             mFuelPump[n]->reset();
00084         }
00085     }
00086 
00087     setSleeping(true);
00088     return rc;
00089 }

Here is the call graph for this function:

CMachine::bit32 PikeAero::CTaskFuelPressureMonitor::start (  )  [virtual]

called exactly once. all tasks are initialized at this point. called just prior to first call to run()

Do task initialization. Called just prior to first call to run().

Returns:
0 on success.

Install an event listener to listen to CEvent::AnalogToDigital CEvents.

Reimplemented from PikeAero::ITask.

Definition at line 56 of file ctaskfuelpressuremonitor.cpp.

References PikeAero::CEvent::AnalogToDigital, PikeAero::CEventQueue::installListener(), and PikeAero::ITask::setSleeping().

00057 {
00058     setSleeping(true);
00059     /** Install an event listener to listen to CEvent::AnalogToDigital CEvents. */
00060     CEventQueue::installListener(this,CEvent::AnalogToDigital);
00061     return 0;
00062 }

Here is the call graph for this function:

CMachine::bit32 PikeAero::CTaskFuelPressureMonitor::stop (  )  [virtual]

The CTaskScheduler will call the stop () method after the task was scheduled for cancelation.

Returns:
0 on success.

Reimplemented from PikeAero::ITask.

Definition at line 95 of file ctaskfuelpressuremonitor.cpp.

References mFuelPump, PikeAero::CBinaryInputOutputGPIO::reset(), and PikeAero::ITask::setSleeping().

Referenced by ~CTaskFuelPressureMonitor().

00096 {
00097     setSleeping(true);
00098     mFuelPump[0]->reset();
00099     mFuelPump[1]->reset();
00100     return 0;
00101 }

Here is the call graph for this function:

Here is the caller graph for this function:


Field Documentation

Definition at line 70 of file ctaskfuelpressuremonitor.h.

Referenced by CTaskFuelPressureMonitor(), event(), and run().


The documentation for this class was generated from the following files:

Generated on Sun Oct 25 14:00:26 2009 for stingray3 by  doxygen 1.5.8