Prusa MINI Firmware overview
|
#include <duration_t.h>
Public Member Functions | |
duration_t () | |
Constructor. More... | |
duration_t (uint32_t const &seconds) | |
Constructor. More... | |
bool | operator== (const uint32_t &value) const |
Equality comparison. More... | |
bool | operator!= (const uint32_t &value) const |
Inequality comparison. More... | |
uint8_t | year () const |
Formats the duration as years. More... | |
uint16_t | day () const |
Formats the duration as days. More... | |
uint32_t | hour () const |
Formats the duration as hours. More... | |
uint32_t | minute () const |
Formats the duration as minutes. More... | |
uint32_t | second () const |
Formats the duration as seconds. More... | |
char * | toString (char *const buffer) const |
Formats the duration as a string. More... | |
uint8_t | toDigital (char *buffer, bool with_days=false) const |
Formats the duration as a string. More... | |
Public Attributes | |
uint32_t | value |
Duration is stored in seconds. More... | |
Marlin 3D Printer Firmware Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
Based on Sprinter and grbl. Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
duration_t::duration_t | ( | ) |
Constructor.
duration_t::duration_t | ( | uint32_t const & | seconds | ) |
bool duration_t::operator== | ( | const uint32_t & | value | ) | const |
bool duration_t::operator!= | ( | const uint32_t & | value | ) | const |
Inequality comparison.
Overloads the inequality comparison operator
value | The number of seconds to compare to |
uint8_t duration_t::year | ( | ) | const |
Formats the duration as years.
uint16_t duration_t::day | ( | ) | const |
Formats the duration as days.
uint32_t duration_t::hour | ( | ) | const |
Formats the duration as hours.
uint32_t duration_t::minute | ( | ) | const |
Formats the duration as minutes.
uint32_t duration_t::second | ( | ) | const |
Formats the duration as seconds.
char* duration_t::toString | ( | char *const | buffer | ) | const |
Formats the duration as a string.
String will be formated using a "full" representation of duration
buffer | The array pointed to must be able to accommodate 21 bytes |
Output examples: 123456789012345678901 (strlen) 135y 364d 23h 59m 59s 364d 23h 59m 59s 23h 59m 59s 59m 59s 59s
uint8_t duration_t::toDigital | ( | char * | buffer, |
bool | with_days = false |
||
) | const |
Formats the duration as a string.
String will be formated using a "digital" representation of duration
buffer | The array pointed to must be able to accommodate 10 bytes |
Output examples: 123456789 (strlen) 99:59 11d 12:33
uint32_t duration_t::value |
Duration is stored in seconds.