Vesna
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Static Public Attributes | List of all members
CommandSegmentsBusinessLogic Class Reference

#include <CommandSegmentsBusinessLogic.h>

Inheritance diagram for CommandSegmentsBusinessLogic:
Inheritance graph
[legend]
Collaboration diagram for CommandSegmentsBusinessLogic:
Collaboration graph
[legend]

Public Member Functions

 CommandSegmentsBusinessLogic ()
 
virtual ~CommandSegmentsBusinessLogic ()
 
void GetCommandSegmentTimes (EM::Strojcek::VstupneUdaje::Turnusy::EPrikazKurz *commandSegment, QTime &startTime, QTime &endTime)
 GetCommandSegmentTimes - converts command segment start and end time from "minutes from command start" to QTime. More...
 
void CalculateCommandSegmentDateTimes (EM::Strojcek::VstupneUdaje::Turnusy::EPrikazKurz *commandSegment, QDateTime &startDateTime, QDateTime &endDateTime)
 CalculateCommandSegmentDateTimes - calculates command segment start and end date and time from "minutes from command start", dates are calculated by "lowest time to departure". More...
 
void CalculateNextCommandSegmentDateTimes (EM::Strojcek::VstupneUdaje::Turnusy::EPrikazKurz *previousCommandSegment, EM::Strojcek::VstupneUdaje::Turnusy::EPrikazKurz *&nextCommandSegment, const QDate &previousSegmentStartDate, QDateTime &startDateTime, QDateTime &endDateTime)
 CalculateNextCommandSegmentDateTimes - calculates command segment start and end date and time from "minutes from command start", dates are calculated in relation to previous command segment. More...
 
void GetCommandSegmentLineTripTexts (EM::Strojcek::VstupneUdaje::Turnusy::EPrikazKurz *commandSegment, QString &lineText, QString &tripText)
 GetCommandSegmentLineTripTexts. More...
 
bool GetCommandSegmentBusStopsInfo (EM::Strojcek::VstupneUdaje::Turnusy::EPrikazKurz *commandSegment, QStringList &times, QStringList &busStops)
 GetCommandSegmentBusStopsInfo. More...
 
bool IsCrossingCommandSegment (EM::Strojcek::VstupneUdaje::Turnusy::EPrikazKurz *commandSegment)
 IsCrossingCommandSegment. More...
 
bool GetNextCommandSegment (EM::Strojcek::VstupneUdaje::Turnusy::EPrikazKurz *actualCommandSegment, EM::Strojcek::VstupneUdaje::Turnusy::EPrikazKurz *&nextCommandSegment)
 GetNextCommandSegment. More...
 
bool GetCommandSegmentFirstAndLastBusStopID (EM::Strojcek::VstupneUdaje::Turnusy::EPrikazKurz *commandSegment, unsigned long &commandSegmentFirstBusStopId, unsigned long &commandSegmentLastBusStopId)
 GetCommandSegmentFirstAndLastBusStopID. More...
 
bool GetCommandSegmentFirstTripBusStop (EM::Strojcek::VstupneUdaje::Turnusy::EPrikazKurz *commandSegment, EM::Strojcek::VstupneUdaje::CestovnePoriadky::ESpojZastavka *&tripBusStop)
 GetCommandSegmentFirstTripBusStop returns first bus stop platform on command segment. More...
 
bool GetCommandSegmentFirstBusStopPlatformName (EM::Strojcek::VstupneUdaje::Turnusy::EPrikazKurz *commandSegment, QString &commandSegmentFirstBusStopPlatformName)
 GetCommandSegmentFirstBusStopPlatformName returns first bus stop platform name on command segment. More...
 
bool GetCommandSegmentFirstAndLastBusStopTripOrder (EM::Strojcek::VstupneUdaje::Turnusy::EPrikazKurz *commandSegment, int &firstBusStopTripOrder, int &lastBusStopTripOrder)
 GetCommandSegmentFirstAndLastBusStopTripOrder returns first and last bus stop trip order. More...
 
bool GetCommandSegmentTripBusStopsCount (EM::Strojcek::VstupneUdaje::Turnusy::EPrikazKurz *commandSegment, int &tripBusStopsCount)
 GetCommandSegmentTripBusStopsCount returns trip bus stops count. More...
 
bool FindCommandSegmentByLineAndTrip (EM::Strojcek::VstupneUdaje::Turnusy::EPrikazKurz *&foundCommandSegment, unsigned short tripNumber, unsigned short binaryLineIndex)
 FindCommandSegmentByLineAndTrip returns commandSegment containing specified line and trip. More...
 
- Public Member Functions inherited from BusinessLogic
 BusinessLogic (ApplicationDefines::BusinessLogicType businessLogicType, ApplicationDefines::BusinessLogicLifeTimeType businessLogicLifeTimeType)
 
virtual ~BusinessLogic ()
 
ApplicationDefines::BusinessLogicType GetBusinessLogicType () const
 
ApplicationDefines::BusinessLogicLifeTimeType GetBusinessLogicLifeTimeType () const
 

Static Public Attributes

static const
ApplicationDefines::BusinessLogicType 
mBusinessLogicType = ApplicationDefines::CommandSegmentsBusinessLogic
 

Constructor & Destructor Documentation

CommandSegmentsBusinessLogic::CommandSegmentsBusinessLogic ( )
CommandSegmentsBusinessLogic::~CommandSegmentsBusinessLogic ( )
virtual

Member Function Documentation

void CommandSegmentsBusinessLogic::CalculateCommandSegmentDateTimes ( EM::Strojcek::VstupneUdaje::Turnusy::EPrikazKurz *  commandSegment,
QDateTime &  startDateTime,
QDateTime &  endDateTime 
)

CalculateCommandSegmentDateTimes - calculates command segment start and end date and time from "minutes from command start", dates are calculated by "lowest time to departure".

Note
Command segment start date is calculated in four steps: 1) Calculate time to departure, as if departure was yesterday. 2) Calculate time to departure, as if departure was today. 3) Calculate time to departure, as if departure was tomorrow. 4) Pick lowest time to departure.

Example: Command segment starts at 19:20, current dateTime is "25.10. 06:00". If departure was yesterday ("24.10. 19:20"), time to departure would be "10h 40m". If departure was today ("25.10. 19:20"), time to departure would be "13h 20m". If departure was tomorrow ("26.10. 19:20"), time to departure would be "37h 20m". Command segment start dateTime will be "yesterday" ( "24.10. 19:22").

Parameters
commandSegment- used command segment
startDateTime- command segment start datetime
endDateTime- command segment end datetime

Here is the call graph for this function:

Here is the caller graph for this function:

void CommandSegmentsBusinessLogic::CalculateNextCommandSegmentDateTimes ( EM::Strojcek::VstupneUdaje::Turnusy::EPrikazKurz *  previousCommandSegment,
EM::Strojcek::VstupneUdaje::Turnusy::EPrikazKurz *&  nextCommandSegment,
const QDate &  previousSegmentStartDate,
QDateTime &  startDateTime,
QDateTime &  endDateTime 
)

CalculateNextCommandSegmentDateTimes - calculates command segment start and end date and time from "minutes from command start", dates are calculated in relation to previous command segment.

Note
Command segment start date is calculated:
  • if nextCommandSegment starts on the same day as previousCommandSegment, start date is the same as previousSegmentStartDate
  • if nextCommandSegment does not start on the same day as previousCommandSegment, start date is (previousSegmentStartDate+1)
Parameters
previousCommandSegment
nextCommandSegment
previousSegmentStartDate- date on which previous command segment started
startDateTime- calculated command segment start datetime
endDateTime- calculated command segment end datetime

Here is the call graph for this function:

bool CommandSegmentsBusinessLogic::FindCommandSegmentByLineAndTrip ( EM::Strojcek::VstupneUdaje::Turnusy::EPrikazKurz *&  foundCommandSegment,
unsigned short  tripNumber,
unsigned short  binaryLineIndex 
)

FindCommandSegmentByLineAndTrip returns commandSegment containing specified line and trip.

Parameters
foundCommandSegment- output parameter
tripNumber
binaryLineIndex
Returns
true on success, otherwise false
bool CommandSegmentsBusinessLogic::GetCommandSegmentBusStopsInfo ( EM::Strojcek::VstupneUdaje::Turnusy::EPrikazKurz *  commandSegment,
QStringList &  times,
QStringList &  busStops 
)

GetCommandSegmentBusStopsInfo.

Parameters
commandSegment
busStopsInfo
Returns
true on success, otherwise false

Here is the call graph for this function:

Here is the caller graph for this function:

bool CommandSegmentsBusinessLogic::GetCommandSegmentFirstAndLastBusStopID ( EM::Strojcek::VstupneUdaje::Turnusy::EPrikazKurz *  commandSegment,
unsigned long &  commandSegmentFirstBusStopId,
unsigned long &  commandSegmentLastBusStopId 
)

GetCommandSegmentFirstAndLastBusStopID.

Parameters
commandSegment
commandSegmentFirstBusStopId
commandSegmentLastBusStopId
Returns
true on success, otherwise false

Here is the caller graph for this function:

bool CommandSegmentsBusinessLogic::GetCommandSegmentFirstAndLastBusStopTripOrder ( EM::Strojcek::VstupneUdaje::Turnusy::EPrikazKurz *  commandSegment,
int &  firstBusStopTripOrder,
int &  lastBusStopTripOrder 
)

GetCommandSegmentFirstAndLastBusStopTripOrder returns first and last bus stop trip order.

Parameters
commandSegment
firstBusStopTripOrder
lastBusStopTripOrder
Returns
true on success, otherwise false
Note
in case of online command, command segment first and last bus stop can be adjusted

Here is the caller graph for this function:

bool CommandSegmentsBusinessLogic::GetCommandSegmentFirstBusStopPlatformName ( EM::Strojcek::VstupneUdaje::Turnusy::EPrikazKurz *  commandSegment,
QString &  commandSegmentFirstBusStopPlatformName 
)

GetCommandSegmentFirstBusStopPlatformName returns first bus stop platform name on command segment.

Parameters
commandSegment
commandSegmentFirstBusStopPlatformName
Returns
true on success, otherwise false

Here is the call graph for this function:

Here is the caller graph for this function:

bool CommandSegmentsBusinessLogic::GetCommandSegmentFirstTripBusStop ( EM::Strojcek::VstupneUdaje::Turnusy::EPrikazKurz *  commandSegment,
EM::Strojcek::VstupneUdaje::CestovnePoriadky::ESpojZastavka *&  tripBusStop 
)

GetCommandSegmentFirstTripBusStop returns first bus stop platform on command segment.

Parameters
commandSegment
commandSegmentFirstBusStopPlatform
tripBusStop
Returns
true on success, otherwise false

Here is the caller graph for this function:

void CommandSegmentsBusinessLogic::GetCommandSegmentLineTripTexts ( EM::Strojcek::VstupneUdaje::Turnusy::EPrikazKurz *  commandSegment,
QString &  lineText,
QString &  tripText 
)

GetCommandSegmentLineTripTexts.

Parameters
commandSegment
lineText
tripText

Here is the caller graph for this function:

void CommandSegmentsBusinessLogic::GetCommandSegmentTimes ( EM::Strojcek::VstupneUdaje::Turnusy::EPrikazKurz *  commandSegment,
QTime &  startTime,
QTime &  endTime 
)

GetCommandSegmentTimes - converts command segment start and end time from "minutes from command start" to QTime.

Parameters
commandSegment- used command segment
startTime- command segment start time, always in range from 00:00 to 23:59
endTime- command segment end time, always in range from 00:00 to 23:59

Here is the caller graph for this function:

bool CommandSegmentsBusinessLogic::GetCommandSegmentTripBusStopsCount ( EM::Strojcek::VstupneUdaje::Turnusy::EPrikazKurz *  commandSegment,
int &  tripBusStopsCount 
)

GetCommandSegmentTripBusStopsCount returns trip bus stops count.

Parameters
commandSegment
tripBusStopsCount
Returns
true on success, otherwise false

Here is the caller graph for this function:

bool CommandSegmentsBusinessLogic::GetNextCommandSegment ( EM::Strojcek::VstupneUdaje::Turnusy::EPrikazKurz *  actualCommandSegment,
EM::Strojcek::VstupneUdaje::Turnusy::EPrikazKurz *&  nextCommandSegment 
)

GetNextCommandSegment.

Parameters
actualCommandSegment
commandSegment
Returns

Here is the caller graph for this function:

bool CommandSegmentsBusinessLogic::IsCrossingCommandSegment ( EM::Strojcek::VstupneUdaje::Turnusy::EPrikazKurz *  commandSegment)

IsCrossingCommandSegment.

Parameters
commandSegment
Returns

Here is the caller graph for this function:

Member Data Documentation

const ApplicationDefines::BusinessLogicType CommandSegmentsBusinessLogic::mBusinessLogicType = ApplicationDefines::CommandSegmentsBusinessLogic
static

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