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

Clasas to Control the Project's Development Family Information. More...

#include <developmentfamily.h>

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

Public Slots

void DoClear (void)
 Reload the Development Famlies.
void ReadProjectId (PROJECT_INFORMATION *ProjectId)
 Read the Development, Compiler, Primary Tool and Target System Name.

Signals

void SendLogEntry (REMOTE_LOG_ENTRY LogEntry)
void SendDevelopmentFamily (DEVELOPMENT_FAMILY DevFamily)
 Advertise out the current state of the development families.
void SendPrimaryToolChanged (int Index)
 Advertise a change to the Primary Tool.

Public Member Functions

 DevelopmentFamily (Ui::MainWindow *UI_Window)
 DevelopmentFamily Constructor.
void LoadDevelopmentFamilies (void)

Private Slots

void PrimaryToolChanged (int Index)
 Receive signal that Primary Tool has Changed & process.
void PostDevelopmentFamily (void)
 take signal from widget and broadcast new status

Private Member Functions

void SendStatusMessage (QString Type, int Counter)
 Send the Data Type and number of entries obtained.
void LogAdd (LOGGING_SEVERITY Severity, LOGGING_MODE Mode, const QString Message)
 Send Message to the Log.

Private Attributes

Ui::MainWindow * ui

Detailed Description

Clasas to Control the Project's Development Family Information.

Definition at line 13 of file developmentfamily.h.

Constructor & Destructor Documentation

◆ DevelopmentFamily()

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

DevelopmentFamily Constructor.

Parameters
UI_WindowMain Program Window

Definition at line 5 of file developmentfamily.cpp.

6{
7 // Save the Pointer to the Main Window & Pointer to Log
8 ui = UI_Window;
9 QObject::connect(ui->PrimaryTool, SIGNAL(currentIndexChanged(int)), this, SLOT(PrimaryToolChanged(int)));
10 QObject::connect(ui->DevelopmentFamily, SIGNAL(currentIndexChanged(int)), this, SLOT(PostDevelopmentFamily()));
11 QObject::connect(ui->LanguageFamily, SIGNAL(currentIndexChanged(int)), this, SLOT(PostDevelopmentFamily()));
12 QObject::connect(ui->TargetFamily, SIGNAL(currentIndexChanged(int)), this, SLOT(PostDevelopmentFamily()));
13}
Ui::MainWindow * ui
void PostDevelopmentFamily(void)
take signal from widget and broadcast new status
void PrimaryToolChanged(int Index)
Receive signal that Primary Tool has Changed & process.

References PostDevelopmentFamily(), PrimaryToolChanged(), and ui.

Here is the call graph for this function:

Member Function Documentation

◆ DoClear

void DevelopmentFamily::DoClear ( void )
slot

Reload the Development Famlies.

Definition at line 148 of file developmentfamily.cpp.

149{
151}
void LoadDevelopmentFamilies(void)

References LoadDevelopmentFamilies().

Here is the call graph for this function:

◆ LoadDevelopmentFamilies()

void DevelopmentFamily::LoadDevelopmentFamilies ( void )

Definition at line 15 of file developmentfamily.cpp.

16{
17 QSqlDatabase db = QSqlDatabase::database();
18
19 // Clear the Development Family List
20 ui->DevelopmentFamily->clear();
21
22 // Get a List of the Development Families from Database
23 QSqlQuery dev_family_query( "select dev_family_index, short_name from dev_family" );
24
25 // Step through the Results
26 int row_index = 0;
27 while ( dev_family_query.next() )
28 {
29 int dev_family_index = dev_family_query.value(0).toInt();
30 QString development_entry = dev_family_query.value(1).toString();
31 ui->DevelopmentFamily->addItem( development_entry, dev_family_index );
32 row_index++;
33 }
34 SendStatusMessage("Development Family", row_index);
35
36 // Clear the Language Family List
37 ui->LanguageFamily->clear();
38
39 // Get a List of the Language from Database
40 QSqlQuery lang_family_query( "select comp_family_index, short_name from compiler_family" );
41
42 // Step through the Results
43 row_index = 0;
44 while ( lang_family_query.next() )
45 {
46 int comp_family_index = lang_family_query.value(0).toInt();
47 QString language_entry = lang_family_query.value(1).toString();
48 ui->LanguageFamily->addItem( language_entry, comp_family_index );
49 row_index++;
50 }
51 SendStatusMessage("Language Family", row_index);
52
53 ui->PrimaryTool->clear();
54 // Get a List of the Major Compiler/Tools from Database
55 QSqlQuery comp_instance_query( "select compiler_instance_index, short_name from compiler_instance" );
56
57 // Step through the Results
58 row_index = 0;
59 while ( comp_instance_query.next() )
60 {
61 int comp_instance_index = comp_instance_query.value(0).toInt();
62 QString compiler_instance = comp_instance_query.value(1).toString();
63 ui->PrimaryTool->addItem( compiler_instance, comp_instance_index );
64 row_index++;
65 }
66 SendStatusMessage("Primary Tool", row_index);
67
68 // Clear the Development Family List
69 ui->TargetFamily->clear();
70
71 // Get a List of the Target System Families from Database
72 QSqlQuery target_family_query( "select target_family_index, short_name from target_family" );
73
74 // Step through the Results
75 row_index = 0;
76 while ( target_family_query.next() )
77 {
78 int target_family_index = target_family_query.value(0).toInt();
79 QString target_entry = target_family_query.value(1).toString();
80 ui->TargetFamily->addItem( target_entry, target_family_index );
81 row_index++;
82 }
83 SendStatusMessage("Target Family", row_index);
84}
void SendStatusMessage(QString Type, int Counter)
Send the Data Type and number of entries obtained.

References SendStatusMessage(), and ui.

Referenced by DoClear().

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

◆ LogAdd()

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

Send Message to the Log.

Parameters
SeveritySeverity of the Log Message
ModeWhich part of the program does the message relate to
MessageText message to be added to the Log

Definition at line 98 of file developmentfamily.cpp.

99{
100 REMOTE_LOG_ENTRY log_entry;
101 log_entry.Severity = Severity;
102 log_entry.Mode = Mode;
103 log_entry.Message = Message;
104 emit SendLogEntry(log_entry);
105}
void SendLogEntry(REMOTE_LOG_ENTRY LogEntry)
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 SendStatusMessage().

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

◆ PostDevelopmentFamily

void DevelopmentFamily::PostDevelopmentFamily ( void )
privateslot

take signal from widget and broadcast new status

Definition at line 121 of file developmentfamily.cpp.

122{
123 DEVELOPMENT_FAMILY DevFamily;
124 DevFamily.LanguageFamily = ui->LanguageFamily->currentData().toInt();
125 DevFamily.LanguageFamilyString = ui->LanguageFamily->currentText();
126 DevFamily.DevelopmentFamilyString = ui->DevelopmentFamily->currentText();
127 DevFamily.DevelopmentFamily = ui->DevelopmentFamily->currentData().toInt();
128 DevFamily.CompilerFamilyString = ui->PrimaryTool->currentText();
129 DevFamily.CompilerFamily = ui->PrimaryTool->currentData().toInt();
130 DevFamily.TargetFamilyString = ui->TargetFamily->currentText();
131 DevFamily.TargetFamily = ui->TargetFamily->currentData().toInt();
132
133 emit SendDevelopmentFamily(DevFamily);
134}
void SendDevelopmentFamily(DEVELOPMENT_FAMILY DevFamily)
Advertise out the current state of the development families.

References DEVELOPMENT_FAMILY::CompilerFamily, DEVELOPMENT_FAMILY::CompilerFamilyString, DEVELOPMENT_FAMILY::DevelopmentFamily, DEVELOPMENT_FAMILY::DevelopmentFamilyString, DEVELOPMENT_FAMILY::LanguageFamily, DEVELOPMENT_FAMILY::LanguageFamilyString, SendDevelopmentFamily(), DEVELOPMENT_FAMILY::TargetFamily, DEVELOPMENT_FAMILY::TargetFamilyString, and ui.

Referenced by DevelopmentFamily(), and PrimaryToolChanged().

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

◆ PrimaryToolChanged

void DevelopmentFamily::PrimaryToolChanged ( int Index)
privateslot

Receive signal that Primary Tool has Changed & process.

Parameters
IndexValue of the new tool

Definition at line 107 of file developmentfamily.cpp.

108{
109 emit SendPrimaryToolChanged(Index);
111}
void SendPrimaryToolChanged(int Index)
Advertise a change to the Primary Tool.

References PostDevelopmentFamily(), and SendPrimaryToolChanged().

Referenced by DevelopmentFamily().

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

◆ ReadProjectId

void DevelopmentFamily::ReadProjectId ( PROJECT_INFORMATION * ProjectId)
slot

Read the Development, Compiler, Primary Tool and Target System Name.

Parameters
ProjectIdInforamtion about the Project

Definition at line 113 of file developmentfamily.cpp.

114{
115 ui->DevelopmentFamily->setCurrentIndex(ui->DevelopmentFamily->findData(ProjectId->DevFamilyInfo.DevFamilyIndex));
116 ui->LanguageFamily->setCurrentIndex(ui->LanguageFamily->findData(ProjectId->LangFamilyInfo.LangFamilyIndex));
117 ui->PrimaryTool->setCurrentIndex(ui->PrimaryTool->findData(ProjectId->CompFamilyInfo.CompFamilyIndex));
118 ui->TargetFamily->setCurrentIndex(ui->TargetFamily->findData(ProjectId->TargetFamilyInfo.TargetFamilyIndex));
119}
TARGET_FAMILY_INFO TargetFamilyInfo
DEV_FAMILY_INFO DevFamilyInfo
COMP_FAMILY_INFO CompFamilyInfo
LANG_FAMILY_INFO LangFamilyInfo

References COMP_FAMILY_INFO::CompFamilyIndex, PROJECT_INFORMATION::CompFamilyInfo, DEV_FAMILY_INFO::DevFamilyIndex, PROJECT_INFORMATION::DevFamilyInfo, LANG_FAMILY_INFO::LangFamilyIndex, PROJECT_INFORMATION::LangFamilyInfo, TARGET_FAMILY_INFO::TargetFamilyIndex, PROJECT_INFORMATION::TargetFamilyInfo, and ui.

◆ SendDevelopmentFamily

void DevelopmentFamily::SendDevelopmentFamily ( DEVELOPMENT_FAMILY DevFamily)
signal

Advertise out the current state of the development families.

Referenced by PostDevelopmentFamily().

Here is the caller graph for this function:

◆ SendLogEntry

void DevelopmentFamily::SendLogEntry ( REMOTE_LOG_ENTRY LogEntry)
signal

Referenced by LogAdd().

Here is the caller graph for this function:

◆ SendPrimaryToolChanged

void DevelopmentFamily::SendPrimaryToolChanged ( int Index)
signal

Advertise a change to the Primary Tool.

Parameters
IndexIndex value of the new Primary Tool

This needs to be sent out because changing the Primary Tool may impact the range of available licences that can be used for the software development

Referenced by PrimaryToolChanged().

Here is the caller graph for this function:

◆ SendStatusMessage()

void DevelopmentFamily::SendStatusMessage ( QString Type,
int Counter )
private

Send the Data Type and number of entries obtained.

Parameters
TypeText message of Family Type
CounterNumber of entries found

Definition at line 86 of file developmentfamily.cpp.

87{
88 if (Counter > 0)
89 {
90 LogAdd(LOG_DEBUG, MODE_DATABASE, QString("%1 Loaded with %2 entries.").arg(Type, QString::number(Counter)));
91 }
92 else
93 {
94 LogAdd(LOG_ERROR, MODE_DATABASE, QString("%1 FAILED to load any entries.").arg(Type, Counter));
95 }
96}
void LogAdd(LOGGING_SEVERITY Severity, LOGGING_MODE Mode, const QString Message)
Send Message to the Log.
@ LOG_ERROR
Definition logger.h:52
@ LOG_DEBUG
Definition logger.h:56
@ MODE_DATABASE
Definition logger.h:35

References LOG_DEBUG, LOG_ERROR, LogAdd(), and MODE_DATABASE.

Referenced by LoadDevelopmentFamilies().

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

Field Documentation

◆ ui

Ui::MainWindow* DevelopmentFamily::ui
private

brief Pointer to the main window

Definition at line 75 of file developmentfamily.h.

Referenced by DevelopmentFamily(), LoadDevelopmentFamilies(), PostDevelopmentFamily(), and ReadProjectId().


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