
Public Types | |
| enum | EField { kUnknown = 0, kUUID, kCreationTimestamp, kCreationText, kRecentlyUsedTimestamp, kRecentlyUsedText, kPrinterName, kIjsFilename, kNumberOfUses, kNumberOfImages, kUsername, kDescription, kDirectory, kMax } |
| Various fields we need to track, most of which are also shown in the summary window. More... | |
Public Member Functions | |
| ~SessionRecord (void) | |
| Destructor. More... | |
| SessionRecord (void) | |
| Simple empty constructor sets everything to default values. More... | |
| SessionRecord (Json &json) | |
| Create a session from a JSON object. More... | |
| std::string | uuid (void) const |
| Something that happens often, so provide an easy way to get to the uuid. More... | |
| File | get_dir (void) const |
| Get the directory in which this session is stored. More... | |
| File | get_ijs_file (void) const |
| Get the .ijs file for this print job session. More... | |
| SessionRecord & | initialize (void) |
| Initialize a number of fields and values which are derived from other sources. More... | |
Static Public Member Functions | |
| static void | schedule_sessions_to_be_saved (void) |
| Sets the flag indicating that configuration should be saved, and starts (or restarts) the timer in GPCApp to ensure the session records are eventually saved to disk. More... | |
Public Attributes | |
| std::time_t | creationEpoch |
| Epoch when the print job session was created. More... | |
| std::time_t | recentlyUsedEpoch |
| Epoch when the print job session was last loaded onto the IncJet device. More... | |
| std::string | field [EField::kMax] |
| Array of text strings that define this print job. More... | |
| size_t | printer_number |
| Determines if this print job applies to printer #1 or printer #2. More... | |
| MStr | image_descriptions |
| Each image can have a text string description. More... | |
Static Public Attributes | |
| static bool | configuration_needs_to_be_saved = false |
| Flag set to indicate changes have been made to configuration. More... | |
Various fields we need to track, most of which are also shown in the summary window.
| SessionRecord::~SessionRecord | ( | void | ) |
Destructor.
| SessionRecord::SessionRecord | ( | void | ) |
Simple empty constructor sets everything to default values.
References nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::count(), creationEpoch, field, nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::get(), initialize(), printer_number, and recentlyUsedEpoch.

| SessionRecord::SessionRecord | ( | Json & | json | ) |
Create a session from a JSON object.
Used when loading the sessions from disk.
References nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::begin(), nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::count(), creationEpoch, nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::dump(), nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::end(), field, image_descriptions, initialize(), printer_number, and recentlyUsedEpoch.

|
inline |
Something that happens often, so provide an easy way to get to the uuid.
References field.
Referenced by initialize(), and schedule_sessions_to_be_saved().

|
inline |
Get the directory in which this session is stored.
References field.
Referenced by SummaryComponent::buttonClicked(), and get_ijs_file().

|
inline |
Get the .ijs file for this print job session.
References field, get_dir(), and initialize().
Referenced by SessionComponentLoader::run().


| SessionRecord & SessionRecord::initialize | ( | void | ) |
Initialize a number of fields and values which are derived from other sources.
For example, the fields kCreationTimestamp and kCreationText are both derived from crationEpoch. This may be called multiple times without ill effects.
References creationEpoch, GPCApplication::directory, field, Cfg::get_str(), printer_number, recentlyUsedEpoch, and uuid().
Referenced by SummaryComponent::buttonClicked(), get_ijs_file(), SessionComponentTransfer::run(), and SessionRecord().


|
static |
Sets the flag indicating that configuration should be saved, and starts (or restarts) the timer in GPCApp to ensure the session records are eventually saved to disk.
References configuration_needs_to_be_saved, creationEpoch, GPCApplication::directory, nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::dump(), field, image_descriptions, nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::parse(), printer_number, recentlyUsedEpoch, and uuid().
Referenced by SummaryComponent::buttonClicked(), and SessionComponentTransfer::run().


| std::time_t SessionRecord::creationEpoch |
Epoch when the print job session was created.
Referenced by initialize(), schedule_sessions_to_be_saved(), SessionRecord(), and SummaryComponent::sortOrderChanged().
| std::time_t SessionRecord::recentlyUsedEpoch |
Epoch when the print job session was last loaded onto the IncJet device.
Referenced by initialize(), SessionComponentTransfer::run(), schedule_sessions_to_be_saved(), SessionRecord(), and SummaryComponent::sortOrderChanged().
| std::string SessionRecord::field[EField::kMax] |
Array of text strings that define this print job.
Referenced by SummaryComponent::buttonClicked(), get_dir(), get_ijs_file(), initialize(), SessionComponentLoader::run(), SessionComponentTransfer::run(), schedule_sessions_to_be_saved(), SessionRecord(), and uuid().
| size_t SessionRecord::printer_number |
Determines if this print job applies to printer #1 or printer #2.
Referenced by SummaryComponent::buttonClicked(), initialize(), SessionComponentTransfer::run(), schedule_sessions_to_be_saved(), and SessionRecord().
| MStr SessionRecord::image_descriptions |
Each image can have a text string description.
The key is the short image name, and the value is the description to show the user.
Referenced by schedule_sessions_to_be_saved(), and SessionRecord().
|
static |
Flag set to indicate changes have been made to configuration.
Don't set this directly; instead, call the function scehdule_sessions_to_be_saved() which will start a timer.
Referenced by schedule_sessions_to_be_saved(), and GPCApplication::timerCallback().