Project Documentation Manager BRIGADOON-0002
Project Documentation Manager
Loading...
Searching...
No Matches
ProgramVersion Class Reference

Class for Program Vesrion. More...

#include <programversion.h>

Inheritance diagram for ProgramVersion:
[legend]
Collaboration diagram for ProgramVersion:
[legend]

Public Slots

void DoClear (void)
 Reset the Version Information.
void ReadProjectInfo (PROJECT_INFORMATION *ProjectId)
 Read The Project Information.
void ReadProjectDateTime (QDateTime ProjectDateTime)
 Read the Project DateTime.

Signals

void SendVersionInfo (REMOTE_VERSION_ENTRY VersionEntry)
 Send the Version information by the Signal-Slot Method.
void SendLogEntry (REMOTE_LOG_ENTRY LogEntry)
 Send Log Entry to the Log \LogEntry Structure holding Log information.
void SendMajorVersion (int MajorVersion)
 Send the Major Version.
void SendMinorVersion (int MinorVersion)
 Send the Minor Version.
void SendRevision (int Revision)
 Send the Revision.
void SendProjectDateTime (QString ProjectDateTime)
 Send the Current DateTime as the Version DateTime.

Public Member Functions

 ProgramVersion (Ui::MainWindow *UI_Window)
 Program Version Class Constructor.

Private Slots

void SetMajorVersion (quint16 Value)
 Sets the Project's Major Version to Value.
void SetMinorVersion (quint16 Value)
 Sets the Project's Minor Version to Value.
void SetRevision (quint16 Value)
 Sets the Project's Revision to Value.
void SetStepOverride (int State)
 Set the Status of Version Step Override.
void UpdateMajorVersion (int MajorVersion)
 Set the Major Version to the Value Supplied.
void UpdateMinorVersion (int MinorVersion)
 Set the Minor Version to the Value Supplied.
void UpdateRevision (int Revision)
 Set the Revision to the Value Supplied.
void SetVersionDate (void)
 Set the Version Date.
void ReadVersionText (uint ProjectIndex, VERSION_INFO Version)
 Read the Version Text for the Project's Version.
void SaveVersion (void)
 Save the Project's Version.
void SetOverrideEnable (bool Enable)
 Enable/Disable the Override.
REMOTE_VERSION_ENTRY WriteVersion (uint ProjectId)
 Read the Version Information into Structure.
void LogProgramVersion (REMOTE_VERSION_ENTRY VersionInstance)
 Convert the Program Version to Log Message and Send It.

Private Member Functions

void PresetMajorVersion (quint16 Value)
 Preset the Major Version to a Value.
void LogAdd (LOGGING_SEVERITY Severity, LOGGING_MODE Mode, QString Message)
void PresetMinorVersion (quint16 Value)
 Preset the Minor Version to a Value.
void PresetRevision (quint16 Value)
 Preset the Revision to a Value.
QString ReadFullHistory (int ProjectIndex)
 Read the entire history of the Project as a string.
QString FormatVersion (int MajorVersion, int MinorVersion, int Revision)
 Format the numeric version (major, minor, revision) as text.

Private Attributes

Ui::MainWindow * ui
uint project_index = 0
 Project Index Number.
VERSION_INFO version_info
 Structure holding Version Information.
QString timestamp_format_string
 DateTime Format String.

Detailed Description

Class for Program Vesrion.

Definition at line 22 of file programversion.h.

Constructor & Destructor Documentation

◆ ProgramVersion()

ProgramVersion::ProgramVersion ( Ui::MainWindow * UI_Window)
explicit

Program Version Class Constructor.

Parameters
UI_WindowMain Program Window

Definition at line 9 of file programversion.cpp.

10{
11 ui = UI_Window;
12
14
15 QObject::connect( ui->MajorVersion, QOverload<int>::of(&QSpinBox::valueChanged), [=](quint16 i){ SetMajorVersion(i); });
16 QObject::connect( ui->MinorVersion, QOverload<int>::of(&QSpinBox::valueChanged), [=](quint16 i){ SetMinorVersion(i); });
17 QObject::connect( ui->Revision, QOverload<int>::of(&QSpinBox::valueChanged), [=](quint16 i){ SetRevision(i); });
18 QObject::connect( ui->OverrideStepControl, SIGNAL(stateChanged(int)), this, SLOT(SetStepOverride(int)));
19 QObject::connect( ui->MajorVersion, SIGNAL(valueChanged(int)), this, SLOT(UpdateMajorVersion(int)));
20 QObject::connect( ui->MinorVersion, SIGNAL(valueChanged(int)), this, SLOT(UpdateMinorVersion(int)));
21 QObject::connect( ui->Revision, SIGNAL(valueChanged(int)), this, SLOT(UpdateRevision(int)));
22 QObject::connect(ui->UpdateVersion, SIGNAL(pressed()), this, SLOT(SaveVersion()));
23 QObject::connect(ui->ProjectStatusDate, SIGNAL(dateTimeChanged(QDateTime)), this, SLOT(ReadProjectDateTime(QDateTime)));
24}
Ui::MainWindow * ui
void SaveVersion(void)
Save the Project's Version.
QString timestamp_format_string
DateTime Format String.
void UpdateRevision(int Revision)
Set the Revision to the Value Supplied.
void UpdateMajorVersion(int MajorVersion)
Set the Major Version to the Value Supplied.
void UpdateMinorVersion(int MinorVersion)
Set the Minor Version to the Value Supplied.
void SetStepOverride(int State)
Set the Status of Version Step Override.
void ReadProjectDateTime(QDateTime ProjectDateTime)
Read the Project DateTime.
#define DATETIME_DISPLAY_FORMAT
DateTime formatting for the program displays.

References DATETIME_DISPLAY_FORMAT, ReadProjectDateTime(), SaveVersion(), SetStepOverride(), timestamp_format_string, ui, UpdateMajorVersion(), UpdateMinorVersion(), and UpdateRevision().

Here is the call graph for this function:

Member Function Documentation

◆ DoClear

void ProgramVersion::DoClear ( void )
slot

Reset the Version Information.

Definition at line 187 of file programversion.cpp.

188{
189 SetOverrideEnable(true);
192 SetRevision(0);
194 ui->VersionDescription->clear();
195 ui->ExecutableDirectory->clear();
196 ui->FullHistory->clear();
197 SetOverrideEnable(false);
198}
void SetOverrideEnable(bool Enable)
Enable/Disable the Override.
void SetMajorVersion(quint16 Value)
Sets the Project's Major Version to Value.
void SetMinorVersion(quint16 Value)
Sets the Project's Minor Version to Value.
void SetRevision(quint16 Value)
Sets the Project's Revision to Value.
void SetVersionDate(void)
Set the Version Date.

References SetMajorVersion(), SetMinorVersion(), SetOverrideEnable(), SetRevision(), SetVersionDate(), and ui.

Here is the call graph for this function:

◆ FormatVersion()

QString ProgramVersion::FormatVersion ( int MajorVersion,
int MinorVersion,
int Revision )
private

Format the numeric version (major, minor, revision) as text.

Parameters
MajorVersionMajor Project Version
MinorVersionMinor Project Version
RevisionRevision of Major:Minor version
Returns
String formatted with format in form Major.Minor.Revision

Definition at line 302 of file programversion.cpp.

303{
304 return(QString::number(MajorVersion).rightJustified(2, '0') + "." +
305 QString::number(MinorVersion).rightJustified(2, '0') + "." +
306 QString::number(Revision).rightJustified(2, '0')
307 );
308}

Referenced by ReadFullHistory(), and WriteVersion().

Here is the caller graph for this function:

◆ LogAdd()

void ProgramVersion::LogAdd ( LOGGING_SEVERITY Severity,
LOGGING_MODE Mode,
QString Message )
private

Definition at line 170 of file programversion.cpp.

171{
172 REMOTE_LOG_ENTRY log_entry;
173 log_entry.Severity = Severity;
174 log_entry.Mode = Mode;
175 log_entry.Message = Message;
176 emit SendLogEntry(log_entry);
177}
void SendLogEntry(REMOTE_LOG_ENTRY LogEntry)
Send Log Entry to the Log \LogEntry Structure holding Log information.
LOGGING_MODE Mode
Definition logger.h:61
QString Message
Definition logger.h:63
LOGGING_SEVERITY Severity
Definition logger.h:62

References REMOTE_LOG_ENTRY::Message, REMOTE_LOG_ENTRY::Mode, SendLogEntry(), and REMOTE_LOG_ENTRY::Severity.

Referenced by LogProgramVersion(), SaveVersion(), and SetStepOverride().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LogProgramVersion

void ProgramVersion::LogProgramVersion ( REMOTE_VERSION_ENTRY VersionInstance)
privateslot

Convert the Program Version to Log Message and Send It.

Definition at line 179 of file programversion.cpp.

180{
181 QString version_timestamp_string = VersionInstance.VersionInfo.VersionDate.toString(timestamp_format_string);
182 QString message_template = "Program Version is %1, dated %2";
183 QString log_message = message_template.arg(VersionInstance.VersionInfo.FullVersionString, version_timestamp_string);
184 LogAdd(LOG_DEBUG, MODE_OPERATOR, log_message);
185}
void LogAdd(LOGGING_SEVERITY Severity, LOGGING_MODE Mode, QString Message)
@ LOG_DEBUG
Definition logger.h:56
@ MODE_OPERATOR
Definition logger.h:34
VERSION_INFO VersionInfo

References VERSION_INFO::FullVersionString, LOG_DEBUG, LogAdd(), MODE_OPERATOR, timestamp_format_string, VERSION_INFO::VersionDate, and REMOTE_VERSION_ENTRY::VersionInfo.

Referenced by SetVersionDate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PresetMajorVersion()

void ProgramVersion::PresetMajorVersion ( quint16 Value)
private

Preset the Major Version to a Value.

Parameters
ValueThe Valule of the Major Version

This function is used to preset the Major Value with out affecting the Minor or Revision Values.

Definition at line 76 of file programversion.cpp.

77{
78 ui->MajorVersion->setMinimum( 0 );
79 ui->MajorVersion->setMaximum( 999 );
80 ui->MajorVersion->setValue( Value );
81 SetMajorVersion( Value );
82}

References SetMajorVersion(), and ui.

Referenced by ReadProjectInfo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PresetMinorVersion()

void ProgramVersion::PresetMinorVersion ( quint16 Value)
private

Preset the Minor Version to a Value.

Parameters
ValueThe Valule of the Minor Version

This function is used to preset the Minor Value with out affecting the Major or Revision Values.

Definition at line 84 of file programversion.cpp.

85{
86 ui->MinorVersion->setMinimum( 0 );
87 ui->MinorVersion->setMaximum( 999 );
88 ui->MinorVersion->setValue( Value );
89 SetMinorVersion( Value );
90}

References SetMinorVersion(), and ui.

Referenced by ReadProjectInfo(), and SetMajorVersion().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PresetRevision()

void ProgramVersion::PresetRevision ( quint16 Value)
private

Preset the Revision to a Value.

Parameters
ValueThe Valule of the Revision

This function is used to preset the Revision Value with out affecting the Major or Minor Values.

Definition at line 92 of file programversion.cpp.

93{
94 ui->Revision->setMinimum( 0 );
95 ui->Revision->setMaximum( 999 );
96 ui->Revision->setValue( Value );
97 SetRevision( Value );
98}

References SetRevision(), and ui.

Referenced by ReadProjectInfo(), and SetMinorVersion().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadFullHistory()

QString ProgramVersion::ReadFullHistory ( int ProjectIndex)
private

Read the entire history of the Project as a string.

Parameters
ProjectIndexProject's database index
Returns
The full history with version and date in descending order

Definition at line 310 of file programversion.cpp.

311{
312 QString full_history;
313 QString query_string = QString("select major_version, minor_version, revision, description, version_status from proj_version_info where project_id = %1 order by major_version desc, minor_version desc, revision desc")
314 .arg(QString::number(ProjectIndex));
315 QSqlQuery version_text_query(query_string);
316
317 while (version_text_query.next())
318 {
319 full_history += QString("<P><B>Version ") + FormatVersion(version_text_query.value(0).toInt(), version_text_query.value(1).toInt(), version_text_query.value(2).toInt()) + ": <I>";
320 full_history += version_text_query.value(4).toString() + " </I></B>";
321 full_history += version_text_query.value(3).toString() + "</P>";
322 }
323 ui->FullHistory->setText(full_history);
324
325 return(full_history);
326}
QString FormatVersion(int MajorVersion, int MinorVersion, int Revision)
Format the numeric version (major, minor, revision) as text.

References FormatVersion(), and ui.

Referenced by ReadVersionText(), and SaveVersion().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadProjectDateTime

void ProgramVersion::ReadProjectDateTime ( QDateTime ProjectDateTime)
slot

Read the Project DateTime.

Definition at line 297 of file programversion.cpp.

298{
299 emit SendProjectDateTime(ProjectDateTime.toString(timestamp_format_string));
300}
void SendProjectDateTime(QString ProjectDateTime)
Send the Current DateTime as the Version DateTime.

References SendProjectDateTime(), and timestamp_format_string.

Referenced by ProgramVersion().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadProjectInfo

void ProgramVersion::ReadProjectInfo ( PROJECT_INFORMATION * ProjectId)
slot

Read The Project Information.

Definition at line 137 of file programversion.cpp.

138{
140 version_info = ProjectId->VersionInfo;
144 QString version_timestamp = ProjectId->VersionInfo.VersionDate.toLocalTime().toString(timestamp_format_string);
145 ui->VersionDate->setText(version_timestamp);
147}
void PresetRevision(quint16 Value)
Preset the Revision to a Value.
uint project_index
Project Index Number.
void PresetMinorVersion(quint16 Value)
Preset the Minor Version to a Value.
VERSION_INFO version_info
Structure holding Version Information.
void ReadVersionText(uint ProjectIndex, VERSION_INFO Version)
Read the Version Text for the Project's Version.
void PresetMajorVersion(quint16 Value)
Preset the Major Version to a Value.
PROJECT_DESCRIPTION ProjectDesc

References VERSION_INFO::MajorVersion, VERSION_INFO::MinorVersion, PresetMajorVersion(), PresetMinorVersion(), PresetRevision(), project_index, PROJECT_INFORMATION::ProjectDesc, PROJECT_DESCRIPTION::ProjectIndex, ReadVersionText(), VERSION_INFO::Revision, timestamp_format_string, ui, version_info, VERSION_INFO::VersionDate, and PROJECT_INFORMATION::VersionInfo.

Here is the call graph for this function:

◆ ReadVersionText

void ProgramVersion::ReadVersionText ( uint ProjectIndex,
VERSION_INFO Version )
privateslot

Read the Version Text for the Project's Version.

Definition at line 200 of file programversion.cpp.

201{
202 QString p1 = QString::number(ProjectIndex);
203 QString p2 = QString::number(VersionInstance.MajorVersion);
204 QString p3 = QString::number(VersionInstance.MinorVersion);
205 QString p4 = QString::number(VersionInstance.Revision);
206 QString query_template = QString("select description, version_timestamp from proj_version_info where project_id = %1 and major_version = %2 and minor_version = %3 and revision = %4 ");
207 QString query_string = query_template.arg(p1, p2, p3,p4);
208 QSqlQuery version_text_query(query_string);
209
210 while (version_text_query.next())
211 {
212 QString version_string = version_text_query.value(0).toString();
213 ui->VersionDescription->setText(version_string);
214 QDateTime version_datetime = version_text_query.value(1).toDateTime();
215 ui->VersionDate->setText(version_datetime.toLocalTime().toString());
216 }
217
218 ReadFullHistory(ProjectIndex);
219}
QString ReadFullHistory(int ProjectIndex)
Read the entire history of the Project as a string.

References VERSION_INFO::MajorVersion, VERSION_INFO::MinorVersion, ReadFullHistory(), VERSION_INFO::Revision, and ui.

Referenced by ReadProjectInfo(), SetMajorVersion(), SetMinorVersion(), and SetRevision().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SaveVersion

void ProgramVersion::SaveVersion ( void )
privateslot

Save the Project's Version.

Definition at line 221 of file programversion.cpp.

222{
223 bool new_version = false;
224
225 // Get the Version Data
226 REMOTE_VERSION_ENTRY version = WriteVersion(project_index);
227 QString p1 = QString::number(project_index);
228 QString p2 = QString::number(ui->MajorVersion->value());
229 QString p3 = QString::number(ui->MinorVersion->value());
230 QString p4 = QString::number(ui->Revision->value());
231 QString p5 = ui->VersionDescription->toPlainText();
232 QString p6 = ui->ProjectStatus->currentText();
233 QDateTime p7 = QDateTime::currentDateTime();
234 ui->VersionDate->setText(p7.toString());
235 // First Check if the Version Exists Already
236 QString query_string = QString("select project_id from proj_version_info where project_id = %1 and major_version = %2 and minor_version = %3 and revision = %4").arg(p1, p2, p3, p4);
237 QSqlQuery does_version_exist(query_string);
238
239 // If the Version Exists Update the Version's Description.
240 if (does_version_exist.next())
241 {
242 query_string = QString("update proj_version_info set description = '%1', version_status = '%5' where project_id = %2 and major_version = %3 and minor_version = %4 and revision = %5").arg(p5, p1, p2, p3, p4);
243 QSqlQuery update_version_description(query_string);
244 if (!update_version_description.exec()) LogAdd(LOG_ERROR, MODE_DATABASE, QString("ERROR - Unable to update Version %1.%2.%3").arg(p2, p3, p4, p5));
245 else LogAdd(LOG_DEBUG, MODE_DATABASE, QString("Update Version %1.%2.%3, Descrip: %p4, Status Level: %p5").arg(p1, p2, p3, p4, p5));
246 }
247
248 // No, It Doesn't, so make New Entry.
249 else
250 {
251 // First Update the Project's Version so that it Database Constraints aren't violated
252 query_string = QString("update project set major_version = %1, minor_version = %2, revision = %3 where project_index = %4").arg(p2, p3, p4, p1);
253 QSqlQuery update_version_query;
254 bool result = update_version_query.exec(query_string);
255 if (!result)
256 {
257 LogAdd(LOG_ERROR, MODE_DATABASE, "ERROR - Unable to update Project Version during Version Update");
258 }
259 else
260 {
261 query_string =
262 QString("INSERT INTO proj_version_info(project_id, major_version, minor_version, revision, description, version_status, version_timestamp) VALUES (%1, %2, %3, %4, '%5', '%6', '%7')").arg(p1, p2, p3, p4, p5, p6, p7.toString(DATETIME_DATABASE_FORMAT));
263 QSqlQuery insert_version_query;
264 result = insert_version_query.exec(query_string);
265 if (!result) LogAdd(LOG_ERROR, MODE_DATABASE, "ERROR - Unable to insert Version Description!");
266 else
267 {
268 LogAdd(LOG_DEBUG, MODE_DATABASE, QString("Inserted Version %1.%2.%3 Description").arg(p2, p3, p4));
269 new_version = true;
270 }
271 }
272 }
274
275 // If This is a New Version, Check if it should be committed to Git
276 if (new_version) emit SendVersionInfo(version);
277}
REMOTE_VERSION_ENTRY WriteVersion(uint ProjectId)
Read the Version Information into Structure.
void SendVersionInfo(REMOTE_VERSION_ENTRY VersionEntry)
Send the Version information by the Signal-Slot Method.
#define DATETIME_DATABASE_FORMAT
text format of the DateTime used by the Database.
@ LOG_ERROR
Definition logger.h:52
@ MODE_DATABASE
Definition logger.h:35

References DATETIME_DATABASE_FORMAT, VERSION_INFO::FullVersionString, LOG_DEBUG, LOG_ERROR, LogAdd(), MODE_DATABASE, project_index, ReadFullHistory(), SendVersionInfo(), ui, REMOTE_VERSION_ENTRY::VersionInfo, and WriteVersion().

Referenced by ProgramVersion().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SendLogEntry

void ProgramVersion::SendLogEntry ( REMOTE_LOG_ENTRY LogEntry)
signal

Send Log Entry to the Log \LogEntry Structure holding Log information.

Referenced by LogAdd().

Here is the caller graph for this function:

◆ SendMajorVersion

void ProgramVersion::SendMajorVersion ( int MajorVersion)
signal

Send the Major Version.

Parameters
MajorVersionThe value of the Major Version

Referenced by UpdateMajorVersion().

Here is the caller graph for this function:

◆ SendMinorVersion

void ProgramVersion::SendMinorVersion ( int MinorVersion)
signal

Send the Minor Version.

Parameters
MinorVersionThe value of the Minor Version

Referenced by UpdateMinorVersion().

Here is the caller graph for this function:

◆ SendProjectDateTime

void ProgramVersion::SendProjectDateTime ( QString ProjectDateTime)
signal

Send the Current DateTime as the Version DateTime.

Parameters
ProjectDateTimeThe Project's DateTime for this Version

Referenced by ReadProjectDateTime().

Here is the caller graph for this function:

◆ SendRevision

void ProgramVersion::SendRevision ( int Revision)
signal

Send the Revision.

Parameters
RevisionThe value of the Revision

Referenced by UpdateRevision().

Here is the caller graph for this function:

◆ SendVersionInfo

void ProgramVersion::SendVersionInfo ( REMOTE_VERSION_ENTRY VersionEntry)
signal

Send the Version information by the Signal-Slot Method.

Parameters
VersionEntryStructure containing the Project's Version Information

Referenced by SaveVersion().

Here is the caller graph for this function:

◆ SetMajorVersion

void ProgramVersion::SetMajorVersion ( quint16 Value)
privateslot

Sets the Project's Major Version to Value.

Parameters
ValueNumber to which Major Version will be set

The function will set the Project's major version to the passed value.

If the OverrideStepControl is set, the value (between 0 and 999) will not affect the Minor and Revision values. If the override is not set,the Minor Version and ultimately the Revision will be set to zero. Additionally, the limits will be set so that the Major Version can only be increased by 1.

Definition at line 26 of file programversion.cpp.

27{
28 if ( ui->OverrideStepControl->isChecked() )
29 {
30 ui->MajorVersion->setMinimum( 0 );
31 ui->MajorVersion->setMaximum( 999 );
32 ui->MajorVersion->setValue(Value);
33 }
34 else
35 {
36 ui->MajorVersion->setMinimum( Value );
37 ui->MajorVersion->setMaximum( Value + 1 );
39 }
41}

References PresetMinorVersion(), project_index, ReadVersionText(), ui, and version_info.

Referenced by DoClear(), and PresetMajorVersion().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetMinorVersion

void ProgramVersion::SetMinorVersion ( quint16 Value)
privateslot

Sets the Project's Minor Version to Value.

Parameters
ValueNumber to which Minor Version will be set

The function will set the Project's minor version to the passed value.

If the OverrideStepControl is set, the value (between 0 and 999) will not affect the Revision values. If the override is not set,the Revision will be set to zero. Additionally, the limits will be set so that the Minor Version can only be increased by 1.

Definition at line 43 of file programversion.cpp.

44{
45 if ( ui->OverrideStepControl->isChecked() )
46 {
47 ui->MinorVersion->setMinimum( 0 );
48 ui->MinorVersion->setMaximum( 999 );
49 ui->MinorVersion->setValue(Value);
50 }
51 else
52 {
53 ui->MinorVersion->setMinimum( Value);
54 ui->MinorVersion->setMaximum( Value + 1 );
55 PresetRevision( 0 );
56 }
58}

References PresetRevision(), project_index, ReadVersionText(), ui, and version_info.

Referenced by DoClear(), and PresetMinorVersion().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetOverrideEnable

void ProgramVersion::SetOverrideEnable ( bool Enable)
privateslot

Enable/Disable the Override.

Definition at line 132 of file programversion.cpp.

133{
134 ui->OverrideStepControl->setChecked(Enable);
135}

References ui.

Referenced by DoClear().

Here is the caller graph for this function:

◆ SetRevision

void ProgramVersion::SetRevision ( quint16 Value)
privateslot

Sets the Project's Revision to Value.

Parameters
ValueNumber to which Revision will be set

The function will set the Project's revision to the passed value.

If the OverrideStepControl is set, the value can be set to 0 and 999 inclusive. If the override is not set, the limits will be set so that the Revision can only be increased by 1.

Definition at line 60 of file programversion.cpp.

61{
62 if ( ui->OverrideStepControl->isChecked() )
63 {
64 ui->Revision->setMinimum( 0);
65 ui->Revision->setMaximum( 999 );
66 ui->Revision->setValue(Value);
67 }
68 else
69 {
70 ui->Revision->setMinimum( Value );
71 ui->Revision->setMaximum( Value + 1 );
72 }
74}

References project_index, ReadVersionText(), ui, and version_info.

Referenced by DoClear(), and PresetRevision().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetStepOverride

void ProgramVersion::SetStepOverride ( int State)
privateslot

Set the Status of Version Step Override.

Definition at line 100 of file programversion.cpp.

101{
102 QString message = "Operator set Version Step Override to ";
103 if ( State == Qt::Checked )
104 {
105 ui->MajorVersion->setMinimum( 0 );
106 ui->MajorVersion->setMaximum( 999 );
107
108 ui->MinorVersion->setMinimum( 0 );
109 ui->MinorVersion->setMaximum( 999 );
110
111 ui->Revision->setMinimum( 0 );
112 ui->Revision->setMaximum( 999 );
113
114 LogAdd(LOG_DEBUG, MODE_OPERATOR, message + "ON.");
115 }
116 else
117 {
118 ui->MajorVersion->setMinimum( ui->MajorVersion->value() );
119 ui->MajorVersion->setMaximum( ui->MajorVersion->value() + 1 );
120
121 ui->MinorVersion->setMinimum( ui->MinorVersion->value() );
122 ui->MinorVersion->setMaximum( ui->MinorVersion->value() + 1 );
123
124 ui->Revision->setMinimum( ui->Revision->value() );
125 ui->Revision->setMaximum( ui->Revision->value() + 1 );
126
127 LogAdd(LOG_DEBUG, MODE_OPERATOR, message + "OFF.");
129 }
130}

References LOG_DEBUG, LogAdd(), MODE_OPERATOR, SetVersionDate(), and ui.

Referenced by ProgramVersion().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetVersionDate

void ProgramVersion::SetVersionDate ( void )
privateslot

Set the Version Date.

Definition at line 162 of file programversion.cpp.

163{
164 QString now = QDateTime::currentDateTime().toString(timestamp_format_string);
165 ui->VersionDate->setText(now);
166 if (!ui->OverrideStepControl->isChecked()) LogProgramVersion(WriteVersion(project_index));
167 ui->VersionDescription->clear();
168}
void LogProgramVersion(REMOTE_VERSION_ENTRY VersionInstance)
Convert the Program Version to Log Message and Send It.

References LogProgramVersion(), project_index, timestamp_format_string, ui, and WriteVersion().

Referenced by DoClear(), SetStepOverride(), UpdateMajorVersion(), UpdateMinorVersion(), and UpdateRevision().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateMajorVersion

void ProgramVersion::UpdateMajorVersion ( int MajorVersion)
privateslot

Set the Major Version to the Value Supplied.

Parameters
MajorVersionMajor Project Version to Use

Definition at line 279 of file programversion.cpp.

280{
282 emit SendMajorVersion(MajorVersion);
283}
void SendMajorVersion(int MajorVersion)
Send the Major Version.

References SendMajorVersion(), and SetVersionDate().

Referenced by ProgramVersion().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateMinorVersion

void ProgramVersion::UpdateMinorVersion ( int MinorVersion)
privateslot

Set the Minor Version to the Value Supplied.

Parameters
MinorVersionMinor Project Version to Use

Definition at line 285 of file programversion.cpp.

286{
288 emit SendMinorVersion(MinorVersion);
289}
void SendMinorVersion(int MinorVersion)
Send the Minor Version.

References SendMinorVersion(), and SetVersionDate().

Referenced by ProgramVersion().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateRevision

void ProgramVersion::UpdateRevision ( int Revision)
privateslot

Set the Revision to the Value Supplied.

Parameters
RevisionRevision to Use

Definition at line 291 of file programversion.cpp.

292{
294 emit SendRevision(Revision);
295}
void SendRevision(int Revision)
Send the Revision.

References SendRevision(), and SetVersionDate().

Referenced by ProgramVersion().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteVersion

REMOTE_VERSION_ENTRY ProgramVersion::WriteVersion ( uint ProjectId)
privateslot

Read the Version Information into Structure.

Parameters
ProjectIdProject Database Index
Returns
Version Information

Definition at line 149 of file programversion.cpp.

150{
151 REMOTE_VERSION_ENTRY result;
152 result.ProjectNumber = ProjectId;
153 result.VersionInfo.MajorVersion = ui->MajorVersion->value();
154 result.VersionInfo.MinorVersion = ui->MinorVersion->value();
155 result.VersionInfo.Revision = ui->Revision->value();
157 result.VersionInfo.VersionDate = QDateTime::fromString(ui->VersionDate->text(), timestamp_format_string );
158 result.VersionInfo.VersionString = ui->VersionDescription->toPlainText();
159 return( result );
160}
uint ProjectNumber

References FormatVersion(), VERSION_INFO::FullVersionString, VERSION_INFO::MajorVersion, VERSION_INFO::MinorVersion, REMOTE_VERSION_ENTRY::ProjectNumber, VERSION_INFO::Revision, timestamp_format_string, ui, VERSION_INFO::VersionDate, REMOTE_VERSION_ENTRY::VersionInfo, and VERSION_INFO::VersionString.

Referenced by SaveVersion(), and SetVersionDate().

Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ project_index

uint ProgramVersion::project_index = 0
private

Project Index Number.

Definition at line 65 of file programversion.h.

Referenced by ReadProjectInfo(), SaveVersion(), SetMajorVersion(), SetMinorVersion(), SetRevision(), and SetVersionDate().

◆ timestamp_format_string

QString ProgramVersion::timestamp_format_string
private

DateTime Format String.

Definition at line 77 of file programversion.h.

Referenced by LogProgramVersion(), ProgramVersion(), ReadProjectDateTime(), ReadProjectInfo(), SetVersionDate(), and WriteVersion().

◆ ui

◆ version_info

VERSION_INFO ProgramVersion::version_info
private

Structure holding Version Information.

Definition at line 71 of file programversion.h.

Referenced by ReadProjectInfo(), SetMajorVersion(), SetMinorVersion(), and SetRevision().


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