OSB_GUI::DcInfo Class Reference

Inheritance diagram for OSB_GUI::DcInfo:

Inheritance graph
[legend]
Collaboration diagram for OSB_GUI::DcInfo:

Collaboration graph
[legend]
List of all members.

Detailed Description

Widget to show the switch times for one day class.

Definition at line 496 of file tpscfg.h.

Signals

Public Member Functions

Private Types

Private Member Functions

Private Attributes


Member Typedef Documentation

typedef OSB_LIB::Id<OSB_LIB::DayClass> OSB_GUI::DcInfo::DcId [private]

Short-hand for a day class id.

Definition at line 500 of file tpscfg.h.

typedef std::pair<TpId, QColor> OSB_GUI::DcInfo::StInfo [private]

Information about a switch time.

This is the id of the tariff period and its color.

Definition at line 508 of file tpscfg.h.

typedef std::map<OSB_LIB::Time, StInfo> OSB_GUI::DcInfo::SwitchTimes [private]

Container to hold the switch times.

For each day class the switch time must be unique and can therefore be used as key to the map.

Note the end time of a tariff period interval is implicitely determined by the next entry in the map or 24:00:00.

Definition at line 518 of file tpscfg.h.

typedef OSB_LIB::Id<OSB_LIB::TariffPeriod> OSB_GUI::DcInfo::TpId [private]

Short-hand for a tariff period id.

Definition at line 502 of file tpscfg.h.


Constructor & Destructor Documentation

OSB_GUI::DcInfo::DcInfo ( const DcId dcId,
QWidget parent,
const char *  name = "dcInfo_",
WFlags  fl = 0 
) [explicit]

Constructor with day class id and Qt standard arguments.


Member Function Documentation

void OSB_GUI::DcInfo::add ( const OSB_LIB::TariffPeriod tp,
const OSB_LIB::Time stime 
)

Add a switch time.

Parameters:
tp Tariff period to add.
stime Switch time to add.

const DcId& OSB_GUI::DcInfo::dcId (  )  const

Get id of day class.

void OSB_GUI::DcInfo::getConfig ( OSB_LIB::TpsConfig config  )  const

Get the configuration.

void OSB_GUI::DcInfo::mouseEvent ( QMouseEvent *  e  )  [private]

Common handling of mouse move and press events.

Emits sigSwitchTime() if the mouse x-position is inside the displayed hours.

void OSB_GUI::DcInfo::mouseMoveEvent ( QMouseEvent *  e  )  [private]

Handle the mouse position.

Calls mouseEvent() if the left button is pressed.

void OSB_GUI::DcInfo::mousePressEvent ( QMouseEvent *  e  )  [private]

Handle mouse clicks.

Calls mouseEvent() if the left button was pressed.

void OSB_GUI::DcInfo::paintEvent ( QPaintEvent *   )  [private]

Paint the widget.

void OSB_GUI::DcInfo::remove ( const OSB_LIB::Time stime  ) 

Remove a switch time.

Parameters:
stime Switch time to remove.

void OSB_GUI::DcInfo::setEvent ( SwitchTimeEvent event  )  [private]

Populate a switch time event.

Parameters:
event Event to populate, its selected time must be set.

void OSB_GUI::DcInfo::showHours ( QPainter &  painter,
const OSB_LIB::Time start,
const OSB_LIB::Time end 
) [private]

Paint a time range.

Parameters:
painter Painter to use, its pen and brush must be set.
start Start time.
end End time.

void OSB_GUI::DcInfo::sigSwitchTime ( const SwitchTimeEvent event  )  [signal]

Signal time under mouse pointer.

Sent on mouse clicks or if the mouse is moved while a button is down.

Parameters:
event Information about the selected time.

int OSB_GUI::DcInfo::time2x ( const OSB_LIB::Time time,
bool  isEnd = false 
) [private]

Convert time to x-coordinate.

Parameters:
time Time to convert.
isEnd Flag if this is an end time.
This relevant if minutes and seconds are 0: do we need the end of the hour or the start?

OSB_LIB::Time OSB_GUI::DcInfo::x2time ( int  x  )  [private]

Convert x-coordinate to time.

Each pixel represents a few minutes: we return the start time of this interval.


Member Data Documentation

DcId OSB_GUI::DcInfo::dcId_ [private]

Object id of the day class.

Definition at line 624 of file tpscfg.h.

SwitchTimes OSB_GUI::DcInfo::sTimes_ [private]

Switch times for the day class.

Definition at line 626 of file tpscfg.h.


The documentation for this class was generated from the following file:
Generated on Sat Sep 2 14:22:15 2006 for OSB Library by  doxygen 1.4.7