Definition at line 496 of file tpscfg.h.
typedef OSB_LIB::Id<OSB_LIB::DayClass> OSB_GUI::DcInfo::DcId [private] |
typedef std::pair<TpId, QColor> OSB_GUI::DcInfo::StInfo [private] |
typedef std::map<OSB_LIB::Time, StInfo> OSB_GUI::DcInfo::SwitchTimes [private] |
typedef OSB_LIB::Id<OSB_LIB::TariffPeriod> OSB_GUI::DcInfo::TpId [private] |
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.
void OSB_GUI::DcInfo::add | ( | const OSB_LIB::TariffPeriod & | tp, | |
const OSB_LIB::Time & | stime | |||
) |
Add a switch time.
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.
stime | Switch time to remove. |
void OSB_GUI::DcInfo::setEvent | ( | SwitchTimeEvent * | event | ) | [private] |
Populate a switch time event.
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.
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.
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.
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.
DcId OSB_GUI::DcInfo::dcId_ [private] |
SwitchTimes OSB_GUI::DcInfo::sTimes_ [private] |