PyANGKernel.GKTimeDuration¶
- class GKTimeDuration¶
Synopsis¶
Methods¶
def
__init__()def
addMSecs()def
addSecs()def
hour()def
isNull()def
isValid()def
minute()def
msec()def
msecsTo()def
__ne__()def
__add__()def
__iadd__()def
__sub__()def
__isub__()def
__lt__()def
__le__()def
__eq__()def
__gt__()def
__ge__()def
second()def
secsTo()def
setHMS()def
toDays()def
toHours()def
toMilliseconds()def
toMinutes()def
toQTime()def
toSeconds()def
toString()
Static functions¶
def
fromString()def
isValid()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description¶
In Aimsun events start at a given moment and have a duration instead of an end time.
- PyANGKernel.GKTimeDuration.MSECS_PER_DAY¶
- __init__()¶
- __init__(rhs)
- Parameters:
rhs –
GKTimeDuration
- __init__(t)
- Parameters:
t –
QTime
- __init__(dsinit)
- Parameters:
dsinit – int
- __init__(ms)
- Parameters:
ms –
std::chrono::milliseconds
- __init__(h, m[, s=0[, ms=0]])
- Parameters:
h – int
m – int
s – int
ms – int
- addMSecs(ms)¶
- Parameters:
ms – int
- Return type:
Adds milliseconds to the current time duration
- addSecs(secs)¶
- Parameters:
secs – int
- Return type:
Adds seconds to the current time duration
- static durationBetweenTimes(from, to)¶
- Parameters:
- Return type:
Duration between to times. Note that a duration is always positive so this function will reorder from and to if to < from.
- static durationBetweenTimes(from, to)
- Parameters:
- Return type:
Duration between to times. Note that a duration is always positive so this function will reorder from and to if to < from.
- static fromString(s)¶
- Parameters:
s – str
- Return type:
Returns a duration from a string in the format HH:MM:SS
Converts this duration to hour, minutes, seconds and milliseconds and returns the hour. For example: 3610.5 is converted to 01:00:10.500 and it returns 1.
A duration of 0 milliseconds.
Is valid?
- static isValid(h, m, s)
- Parameters:
h – int
m – int
s – int
- Return type:
Is valid?
Converts this duration to hour, minutes, seconds and milliseconds and returns the minute. For example: 3610.5 is converted to 01:00:10.500 and it returns 0.
Converts this duration to hour, minutes, seconds and milliseconds and returns the millisecond. For example: 3610.5 is converted to 01:00:10.500 and it returns 500.
- msecsTo(t)¶
- Parameters:
t –
GKTimeDuration- Return type:
Returns the number of remaining milliseconds until the desired time)
- __ne__(d)¶
- Parameters:
d –
GKTimeDuration- Return type:
Returns true if the compared time durations are not equal
- __add__(c)¶
- Parameters:
c –
GKTimeDuration- Return type:
Adds two time durations
- __iadd__(c)¶
- Parameters:
c –
GKTimeDuration- Return type:
Adds a time duration to the current time duration
- __sub__(c)¶
- Parameters:
c –
GKTimeDuration- Return type:
Subtracts a time duration to another time duration
- __isub__(c)¶
- Parameters:
c –
GKTimeDuration- Return type:
Subtracts a time duration to the current time duration
- __lt__(d)¶
- Parameters:
d –
GKTimeDuration- Return type:
Returns true if the left time duration is lower
- __le__(d)¶
- Parameters:
d –
GKTimeDuration- Return type:
Returns true if the left time duration is lower or equal
- __eq__(d)¶
- Parameters:
d –
GKTimeDuration- Return type:
Returns true if the compared time durations are equal
- __gt__(d)¶
- Parameters:
d –
GKTimeDuration- Return type:
Returns true if the left time duration is greater
- __ge__(d)¶
- Parameters:
d –
GKTimeDuration- Return type:
Returns true if the left time duration is greater or equal
Converts this duration to hour, minutes, seconds and milliseconds and returns the second. For example: 3610.5 is converted to 01:00:10.500 and it returns 10.
- secsTo(arg__1)¶
- Parameters:
arg__1 –
GKTimeDuration- Return type:
Returns the number of remaining seconds until the desired time)
Set the duration.
Returns this duration in days, the remaining time is returned in the miliseconds parameter if given.
Returns this
GKTimeDuration‘s hour, minute and second converted to hoursGet this duration in milliseconds (note that this is not equal to
msec)Returns this
GKTimeDuration‘s hour, minute and second converted to minutesRetuns a QTime equivalent to this duration. Note that an overflow is possible as QTime only support 24 hours (check QTime::isValid()).
Returns this
GKTimeDuration‘s hour, minute and second converted to seconds. If the miliseconds parameter is given, it will updated with the remaining miliseconds.Returns a string representation of this duration. If forceMilliseconds is false it will not add millisecond info when they are zero.