diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000..aa38eefe --- /dev/null +++ b/.clang-format @@ -0,0 +1,3 @@ +BasedOnStyle: Microsoft +Language: Cpp +InsertNewlineAtEOF: true diff --git a/CMakeLists.txt b/CMakeLists.txt index c5d8339e..7333b208 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,8 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD 17) +add_definitions( -DDEV_ESSENTIAL_DISABLE_MAKE_RESULT_CHECK_RESERVED_ZERO=1 -DDEV_ESSENTIAL_DISABLE_DEPRECATED_WARNINGS=1) + file(STRINGS version QC4OPENX_VERSION LIMIT_COUNT 1) project(qc4openx VERSION ${QC4OPENX_VERSION}) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index e3c848bc..5cb9aec3 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -14,4 +14,4 @@ install( xosc_examples DESTINATION examples -) \ No newline at end of file +) diff --git a/examples/checker_bundle_example/src/main.cpp b/examples/checker_bundle_example/src/main.cpp index d2a35892..988d4bf7 100644 --- a/examples/checker_bundle_example/src/main.cpp +++ b/examples/checker_bundle_example/src/main.cpp @@ -8,16 +8,16 @@ #include "main.h" -#include "common/result_format/cChecker.h" -#include "common/result_format/cCheckerBundle.h" -#include "common/result_format/cParameterContainer.h" -#include "common/result_format/cResultContainer.h" +#include "common/result_format/c_checker.h" +#include "common/result_format/c_checker_bundle.h" +#include "common/result_format/c_parameter_container.h" +#include "common/result_format/c_result_container.h" -#include "common/config_format/cConfiguration.h" -#include "common/config_format/cConfigurationCheckerBundle.h" +#include "common/config_format/c_configuration.h" +#include "common/config_format/c_configuration_checker_bundle.h" // Main Programm -int main(int argc, char* argv[]) +int main(int argc, char *argv[]) { std::string strToolpath = argv[0]; @@ -70,11 +70,12 @@ int main(int argc, char* argv[]) inputParams.Overwrite(configuration.GetParams()); // We search for parameters applied to our configuration. - cConfigurationCheckerBundle* checkerBundleConfig = configuration.GetCheckerBundleByName(CHECKER_BUNDLE_NAME); + cConfigurationCheckerBundle *checkerBundleConfig = configuration.GetCheckerBundleByName(CHECKER_BUNDLE_NAME); if (nullptr != checkerBundleConfig) inputParams.Overwrite(checkerBundleConfig->GetParams()); else - std::cerr << "No configuration for module '" << CHECKER_BUNDLE_NAME << "' found. Start with default params." << std::endl; + std::cerr << "No configuration for module '" << CHECKER_BUNDLE_NAME << "' found. Start with default params." + << std::endl; } else if (StringEndsWith(ToLower(strFilepath), "--defaultconfig")) { @@ -96,7 +97,7 @@ int main(int argc, char* argv[]) return 0; } -void ShowHelp(const std::string& toolPath) +void ShowHelp(const std::string &toolPath) { std::string applicationName = toolPath; std::string applicationNameWithoutExt = toolPath; @@ -106,27 +107,27 @@ void ShowHelp(const std::string& toolPath) std::cout << "\n\nUsage of " << applicationNameWithoutExt << ":" << std::endl; std::cout << "\nRun the application with xodr file: \n" << applicationName << " sample.xodr" << std::endl; std::cout << "\nRun the application with dbqa configuration: \n" << applicationName << " config.xml" << std::endl; - std::cout << "\nRun the application and write empty report as default configuration: \n" << applicationName << " --defaultconfig" << std::endl; + std::cout << "\nRun the application and write empty report as default configuration: \n" + << applicationName << " --defaultconfig" << std::endl; std::cout << "\n\n"; } -void RunChecks(const cParameterContainer& inputParams) +void RunChecks(const cParameterContainer &inputParams) { // Now we define a result container which contains our results. cResultContainer pResultContainer; // Lets go on with the checker bundle. A bundle contains 0 or more checks. - cCheckerBundle* pExampleCheckerBundle = new cCheckerBundle(CHECKER_BUNDLE_NAME); + cCheckerBundle *pExampleCheckerBundle = new cCheckerBundle(CHECKER_BUNDLE_NAME); // Add the checkerBundle to our results. You can do it later as well. pResultContainer.AddCheckerBundle(pExampleCheckerBundle); // Create a checker with a factory in the checker bundle - cChecker* pExampeChecker = pExampleCheckerBundle->CreateChecker("exampleChecker", "This is a description"); + cChecker *pExampeChecker = pExampleCheckerBundle->CreateChecker("exampleChecker", "This is a description"); // Lets add now an issue - pExampeChecker->AddIssue(new cIssue("This is an information from the demo usecase", - INFO_LVL)); + pExampeChecker->AddIssue(new cIssue("This is an information from the demo usecase", INFO_LVL)); // Lets add a summary for the checker bundle unsigned int issueCount = pExampleCheckerBundle->GetIssueCount(); @@ -146,7 +147,7 @@ void RunChecks(const cParameterContainer& inputParams) void WriteEmptyReport() { cResultContainer emptyReport; - cCheckerBundle* pCheckerBundle = new cCheckerBundle(CHECKER_BUNDLE_NAME); + cCheckerBundle *pCheckerBundle = new cCheckerBundle(CHECKER_BUNDLE_NAME); emptyReport.AddCheckerBundle(pCheckerBundle); @@ -164,4 +165,4 @@ void WriteEmptyReport() emptyReport.WriteResults(ssReportFile.str()); std::cout << "Finished." << std::endl; -} \ No newline at end of file +} diff --git a/examples/checker_bundle_example/src/main.h b/examples/checker_bundle_example/src/main.h index 8395caaa..d1e41783 100644 --- a/examples/checker_bundle_example/src/main.h +++ b/examples/checker_bundle_example/src/main.h @@ -16,27 +16,27 @@ class cParameterContainer; /** -* Main function for application -* -* @param [in] argc Number of arguments in shell -* @param [in] argv Pointer to arguments -* -* @return The standard return value -*/ -int main(int argc, char* argv[]); + * Main function for application + * + * @param [in] argc Number of arguments in shell + * @param [in] argv Pointer to arguments + * + * @return The standard return value + */ +int main(int argc, char *argv[]); /** -* Shows the help for the application -* @param [in] applicationName The name of the application -*/ -void ShowHelp(const std::string& applicationName); + * Shows the help for the application + * @param [in] applicationName The name of the application + */ +void ShowHelp(const std::string &applicationName); /** -* Runs the checks -*/ -void RunChecks(const cParameterContainer& inputParams); + * Runs the checks + */ +void RunChecks(const cParameterContainer &inputParams); /* -* Writes an empty Report -*/ -void WriteEmptyReport(); \ No newline at end of file + * Writes an empty Report + */ +void WriteEmptyReport(); diff --git a/examples/checker_bundle_example/src/stdafx.h b/examples/checker_bundle_example/src/stdafx.h index 51fbccc0..4d65a490 100644 --- a/examples/checker_bundle_example/src/stdafx.h +++ b/examples/checker_bundle_example/src/stdafx.h @@ -9,11 +9,11 @@ #ifndef _STD_AFX_ #define _STD_AFX_ -#include #include -#include #include #include #include +#include +#include #endif // _STD_INCLUDES_HEADER_FEP_XODR_MANIPULATION_ diff --git a/examples/viewer_example/viewer_example.cpp b/examples/viewer_example/viewer_example.cpp index b5fbe1f6..defb9365 100644 --- a/examples/viewer_example/viewer_example.cpp +++ b/examples/viewer_example/viewer_example.cpp @@ -6,13 +6,13 @@ * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "viewer/iConnector.h" -#include "common/result_format/cIssue.h" -#include "common/result_format/cLocationsContainer.h" -#include +#include "common/result_format/c_issue.h" +#include "common/result_format/c_locations_container.h" +#include "viewer/i_connector.h" #include +#include -const char* lasterrormsg = ""; +const char *lasterrormsg = ""; bool StartViewer() { @@ -20,9 +20,9 @@ bool StartViewer() return true; } -bool Initialize(const char* xoscPath, const char* xodrPath) +bool Initialize(const char *xoscPath, const char *xodrPath) { - if (std::strcmp(xoscPath, "")==0 && std::strcmp(xodrPath,"")==0) + if (std::strcmp(xoscPath, "") == 0 && std::strcmp(xodrPath, "") == 0) { lasterrormsg = "ERROR: No valid xosc or xodr file found."; return false; @@ -32,23 +32,23 @@ bool Initialize(const char* xoscPath, const char* xodrPath) return true; } -bool AddIssue(void* issueToAdd) +bool AddIssue(void *issueToAdd) { - auto issue = static_cast(issueToAdd); + auto issue = static_cast(issueToAdd); std::cout << "ADD ISSUE: " << issue->GetDescription() << std::endl; return true; } -bool ShowIssue(void * itemToShow, void* locationToShow) +bool ShowIssue(void *itemToShow, void *locationToShow) { - auto issue = static_cast(itemToShow); - auto location = static_cast(locationToShow); + auto issue = static_cast(itemToShow); + auto location = static_cast(locationToShow); std::cout << "SHOW ISSUE: " << issue->GetDescription() << std::endl; std::cout << "LOCATION: " << location->GetDescription() << std::endl; return true; } -const char* GetName() +const char *GetName() { return "Viewer Example"; } @@ -59,8 +59,7 @@ bool CloseViewer() return true; } -const char* GetLastErrorMessage() +const char *GetLastErrorMessage() { return lasterrormsg; } - diff --git a/include/common/config_format/cConfiguration.h b/include/common/config_format/cConfiguration.h deleted file mode 100644 index 5c512e11..00000000 --- a/include/common/config_format/cConfiguration.h +++ /dev/null @@ -1,107 +0,0 @@ -/** - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -#ifndef cConfiguration_h__ -#define cConfiguration_h__ - -#include -#include -#include -#include -#include - -#include "common/result_format/cParameterContainer.h" - -#include "../util.h" -#include "../xml/utilXerces.h" - -class cConfigurationReportModule; -class cConfigurationCheckerBundle; - -// name of the global parameter xodr file -const std::string PARAM_XODR_FILE = "XodrFile"; - -// name of the global parameter xosc file -const std::string PARAM_XOSC_FILE = "XoscFile"; - - -// This class stores all settings of a configuration file (used to parameterize the framework). The -// configuration can be parsed and written. -class cConfiguration -{ - -public: - // name of the xml node for the configuration - static const XMLCh* TAG_CONFIGURATION; - - // parses the file at a given path and returns a configuration - static bool ParseFromXML(cConfiguration* config, const std::string& configFilePath); - - // parses the file at a given path and returns a configuration - static cConfiguration* ParseFromXML(const std::string& configFilePath); - - // writes a stored configuration to a given file location - void WriteConfigurationToFile(const std::string& filePath); - - // clear all internal lists - void Clear(); - - // destructor - virtual ~cConfiguration(); - - // returns the parameters - cParameterContainer GetParams() const; - - // True if parameter is available - bool HasParam(const std::string& name) const; - - // Returns a param with a given name - std::string GetParam(const std::string& name) const; - - // Sets a param with a given name and value - void SetParam(const std::string& name, const std::string& value); - - // Overwrite parameters - void OverwriteParams(const cParameterContainer& params); - - // returns the checker bundles - std::vector GetCheckerBundles() const; - - // returns the report modules - std::vector GetReportModules() const; - - // Returns a report Module by a given application name - cConfigurationReportModule* GetReportModuleByName(const std::string& applicationName); - - // Returns a checker Bundle by a given application name - cConfigurationCheckerBundle* GetCheckerBundleByName(const std::string& applicationName); - - // Adds a ReportModule - cConfigurationReportModule* AddReportModule(const std::string& applicationName); - - // Adds a CheckerBundle - cConfigurationCheckerBundle* AddCheckerBundle(const std::string& applicationName); - - // Merges anorther configuration into this one. All parameters will be overwritten by - // pAnortherConfig. CheckerBundles and Checkers are added, even duplicates. - bool AddConfiguration(const cConfiguration* pAnortherConfig); - -protected: - // mapping of parameters stored inside the root node - cParameterContainer m_params; - - // list of checker bundles defined in the configuration - std::vector m_checkerBundles; - - // list of report modules defined in the configuration - std::vector m_reportModules; - - void ProcessDomNode(XERCES_CPP_NAMESPACE::DOMNode* const nodeToProcess, cConfiguration* const cConfig) const; -}; - -#endif \ No newline at end of file diff --git a/include/common/config_format/cConfigurationChecker.h b/include/common/config_format/cConfigurationChecker.h deleted file mode 100644 index 070e9f3a..00000000 --- a/include/common/config_format/cConfigurationChecker.h +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -#ifndef cConfigurationChecker_h__ -#define cConfigurationChecker_h__ - -#include "../result_format/cParameterContainer.h" -#include "../result_format/cIssue.h" -#include "../util.h" -#include "../xml/utilXerces.h" - -// Represents the parameters for a single Checker (e.g. elevation checker) in the config xml file -// used to parametrize the framework -class cConfigurationChecker -{ -public: - // name of the xml node for the checker - static const XMLCh* TAG_CHECKER; - - // xml attribute for the checker id - static const XMLCh* ATTR_CHECKER_ID; - - // xml attribute for the warning level of the checker - static const XMLCh* ATTR_CHECKER_MIN_LEVEL; - static const XMLCh* ATTR_CHECKER_MAX_LEVEL; - - cConfigurationChecker(); - cConfigurationChecker(const std::string& checkerId, eIssueLevel minLevel = INFO_LVL, eIssueLevel maxLevel = ERROR_LVL); - - virtual ~cConfigurationChecker(); - - // parses the parameters in the xml file - static cConfigurationChecker* ParseConfigurationChecker(DOMNode * const pXMLNode, DOMElement* const pXMLElement); - - // writes the parsed configuration to a given xml file - DOMElement * WriteXML(XERCES_CPP_NAMESPACE::DOMDocument* pResultDocument, DOMElement* p_parentElement) const; - - // deletes the object - void Clear(); - - // Returns the parameters - cParameterContainer GetParams() const; - - // Returns the checker ID - std::string GetCheckerId() const; - - // Sets the checker ID - void SetCheckerId(const std::string& in); - - // Returns the minial level for issue reporting - eIssueLevel GetMinLevel() const; - - // Sets the minial level for issue reporting - void SetMinLevel(eIssueLevel newLevel); - - // Returns the minial level for issue reporting - eIssueLevel GetMaxLevel() const; - - // Sets the minial level for issue reporting - void SetMaxLevel(eIssueLevel newLevel); - - // True if parameter is available - bool HasParam(const std::string& name) const; - - // Returns a param with a given name - std::string GetParam(const std::string& name) const; - - // Sets a param with a given name and value - void SetParam(const std::string& name, const std::string& value); - - // Overwrite parameters - void OverwriteParams(const cParameterContainer& params); -protected: - std::string m_checkerID; - eIssueLevel m_minLevel; - eIssueLevel m_maxLevel; - - // parameters defined for this checker - cParameterContainer m_params; - - DOMElement* CreateXMLNode(XERCES_CPP_NAMESPACE::DOMDocument* pResultDocument) const; -}; - -#endif \ No newline at end of file diff --git a/include/common/config_format/cConfigurationCheckerBundle.h b/include/common/config_format/cConfigurationCheckerBundle.h deleted file mode 100644 index b1bc7ff8..00000000 --- a/include/common/config_format/cConfigurationCheckerBundle.h +++ /dev/null @@ -1,92 +0,0 @@ -/** - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -#ifndef cConfigurationCheckerBundle_h__ -#define cConfigurationCheckerBundle_h__ - -#include "../result_format/cParameterContainer.h" -#include "../result_format/cIssue.h" - -#include "../util.h" -#include "../xml/utilXerces.h" - -class cConfigurationChecker; - -// Represents the parameters for a CheckerBundle in the config xml file used to parametrize the -// framework -class cConfigurationCheckerBundle -{ -public: - // name of the xml node for the checker bundle - static const XMLCh* TAG_CHECKERBUNDLE; - // application attribute in the xml node - static const XMLCh* ATTR_APPLICATION; - - cConfigurationCheckerBundle(); - cConfigurationCheckerBundle(const std::string& applicationName); - - // d'tor - virtual ~cConfigurationCheckerBundle(); - - // parses the parameters in the xml file - static cConfigurationCheckerBundle* ParseConfigurationCheckerBundle(DOMNode* const pXMLNode, DOMElement* const pXMLElement); - - // writes the parsed checker bundle information to a given xml file - DOMElement * WriteXML(XERCES_CPP_NAMESPACE::DOMDocument* pResultDocument, DOMElement* p_parentElement) const; - - // returns all parsed checker nodes - std::vector GetConfigurationCheckers() const; - - // deletes the object - void Clear(); - - // Sets the name of the checker Bundle application - void SetCheckerBundleApplication(std::string applicationName); - - // Gets the name of the cheker Bundle application - std::string GetCheckerBundleApplication() const; - - // Adds a Checker - cConfigurationChecker* AddChecker(const std::string& checkerId, eIssueLevel minLevel = INFO_LVL, eIssueLevel maxLevel = ERROR_LVL); - - // Returns the checkers - std::vector GetCheckers() const; - - // Returns the checkers. Returns nullptr if no checker is available - cConfigurationChecker* GetCheckerById(const std::string& checkerID) const; - - // Returns true if a checker is available - bool HasCheckerWithId(const std::string& checkerID) const; - - // returns the parameters - cParameterContainer GetParams() const; - - // True if parameter is available - bool HasParam(const std::string& name) const; - - // Returns a param with a given name - std::string GetParam(const std::string& name) const; - - // Sets a param with a given name and value - void SetParam(const std::string& name, const std::string& value); - - // Overwrite parameters - void OverwriteParams(const cParameterContainer& params); -protected: - std::string strApplication; - - // parameters defined for this checker bundle - cParameterContainer m_params; - - // list of parsed checker nodes - std::vector m_Checkers; - - DOMElement* CreateXMLNode(XERCES_CPP_NAMESPACE::DOMDocument* pResultDocument) const; - void ProcessDomNode(DOMNode* nodeToProcess, cConfigurationCheckerBundle* currentCheckerBundle); -}; -#endif \ No newline at end of file diff --git a/include/common/config_format/cConfigurationReportModule.h b/include/common/config_format/cConfigurationReportModule.h deleted file mode 100644 index 4ed6698c..00000000 --- a/include/common/config_format/cConfigurationReportModule.h +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -#ifndef cConfigurationReportModule_h__ -#define cConfigurationReportModule_h__ - -#include "../result_format/cParameterContainer.h" -#include "../util.h" -#include "../xml/utilXerces.h" - -// Represents the parameters for a ReportModule in the config xml file used to parametrize the -// framework -class cConfigurationReportModule -{ -public: - // application attribute in the xml - static const XMLCh* ATTR_APPLICATION; - - // name of the xml node for the report module - static const XMLCh* TAG_REPORT_MODULE; - - cConfigurationReportModule(); - cConfigurationReportModule(const std::string& applicationName); - - // parses the parameters in the xml file - static cConfigurationReportModule* ParseConfigurationReportModule(XERCES_CPP_NAMESPACE::DOMNode * const pXMLNode, XERCES_CPP_NAMESPACE::DOMElement* const pXMLElement); - - // writes the stored configuration to an xml file - XERCES_CPP_NAMESPACE::DOMElement* WriteXML(XERCES_CPP_NAMESPACE::DOMDocument* pResultDocument, XERCES_CPP_NAMESPACE::DOMElement* p_parentElement) const; - - // deletes the object - void Clear(); - - // d'tor - virtual ~cConfigurationReportModule(); - - // Sets the name of the report module - void SetReportModuleApplication(const std::string& applicationName); - - // Returns the name of the report module - std::string GetReportModuleApplication() const; - - // returns the parameters - cParameterContainer GetParams() const; - - // True if parameter is available - bool HasParam(const std::string& name) const; - - // Returns a param with a given name - std::string GetParam(const std::string& name) const; - - // Sets a param with a given name and value - void SetParam(const std::string& name, const std::string& value); - - // Overwrite parameters - void OverwriteParams(const cParameterContainer& params); -protected: - std::string strApplication; - - cParameterContainer m_params; - - void ProcessDomNode(XERCES_CPP_NAMESPACE::DOMNode* nodeToProcess, cConfigurationReportModule* currentCheckerBundle); - -}; -#endif \ No newline at end of file diff --git a/include/common/config_format/c_configuration.h b/include/common/config_format/c_configuration.h new file mode 100644 index 00000000..dba1ec21 --- /dev/null +++ b/include/common/config_format/c_configuration.h @@ -0,0 +1,106 @@ +/** + * Copyright 2023 CARIAD SE. + * + * This Source Code Form is subject to the terms of the Mozilla + * Public License, v. 2.0. If a copy of the MPL was not distributed + * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#ifndef cConfiguration_h__ +#define cConfiguration_h__ + +#include +#include +#include +#include +#include + +#include "common/result_format/c_parameter_container.h" + +#include "../util.h" +#include "../xml/util_xerces.h" + +class cConfigurationReportModule; +class cConfigurationCheckerBundle; + +// name of the global parameter xodr file +const std::string PARAM_XODR_FILE = "XodrFile"; + +// name of the global parameter xosc file +const std::string PARAM_XOSC_FILE = "XoscFile"; + +// This class stores all settings of a configuration file (used to parameterize the framework). The +// configuration can be parsed and written. +class cConfiguration +{ + + public: + // name of the xml node for the configuration + static const XMLCh *TAG_CONFIGURATION; + + // parses the file at a given path and returns a configuration + static bool ParseFromXML(cConfiguration *config, const std::string &configFilePath); + + // parses the file at a given path and returns a configuration + static cConfiguration *ParseFromXML(const std::string &configFilePath); + + // writes a stored configuration to a given file location + void WriteConfigurationToFile(const std::string &filePath); + + // clear all internal lists + void Clear(); + + // destructor + virtual ~cConfiguration(); + + // returns the parameters + cParameterContainer GetParams() const; + + // True if parameter is available + bool HasParam(const std::string &name) const; + + // Returns a param with a given name + std::string GetParam(const std::string &name) const; + + // Sets a param with a given name and value + void SetParam(const std::string &name, const std::string &value); + + // Overwrite parameters + void OverwriteParams(const cParameterContainer ¶ms); + + // returns the checker bundles + std::vector GetCheckerBundles() const; + + // returns the report modules + std::vector GetReportModules() const; + + // Returns a report Module by a given application name + cConfigurationReportModule *GetReportModuleByName(const std::string &applicationName); + + // Returns a checker Bundle by a given application name + cConfigurationCheckerBundle *GetCheckerBundleByName(const std::string &applicationName); + + // Adds a ReportModule + cConfigurationReportModule *AddReportModule(const std::string &applicationName); + + // Adds a CheckerBundle + cConfigurationCheckerBundle *AddCheckerBundle(const std::string &applicationName); + + // Merges anorther configuration into this one. All parameters will be overwritten by + // pAnortherConfig. CheckerBundles and Checkers are added, even duplicates. + bool AddConfiguration(const cConfiguration *pAnortherConfig); + + protected: + // mapping of parameters stored inside the root node + cParameterContainer m_params; + + // list of checker bundles defined in the configuration + std::vector m_checkerBundles; + + // list of report modules defined in the configuration + std::vector m_reportModules; + + void ProcessDomNode(XERCES_CPP_NAMESPACE::DOMNode *const nodeToProcess, cConfiguration *const cConfig) const; +}; + +#endif diff --git a/include/common/config_format/c_configuration_checker.h b/include/common/config_format/c_configuration_checker.h new file mode 100644 index 00000000..80a15261 --- /dev/null +++ b/include/common/config_format/c_configuration_checker.h @@ -0,0 +1,91 @@ +/** + * Copyright 2023 CARIAD SE. + * + * This Source Code Form is subject to the terms of the Mozilla + * Public License, v. 2.0. If a copy of the MPL was not distributed + * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#ifndef cConfigurationChecker_h__ +#define cConfigurationChecker_h__ + +#include "../result_format/c_issue.h" +#include "../result_format/c_parameter_container.h" +#include "../util.h" +#include "../xml/util_xerces.h" + +// Represents the parameters for a single Checker (e.g. elevation checker) in the config xml file +// used to parametrize the framework +class cConfigurationChecker +{ + public: + // name of the xml node for the checker + static const XMLCh *TAG_CHECKER; + + // xml attribute for the checker id + static const XMLCh *ATTR_CHECKER_ID; + + // xml attribute for the warning level of the checker + static const XMLCh *ATTR_CHECKER_MIN_LEVEL; + static const XMLCh *ATTR_CHECKER_MAX_LEVEL; + + cConfigurationChecker(); + cConfigurationChecker(const std::string &checkerId, eIssueLevel minLevel = INFO_LVL, + eIssueLevel maxLevel = ERROR_LVL); + + virtual ~cConfigurationChecker(); + + // parses the parameters in the xml file + static cConfigurationChecker *ParseConfigurationChecker(DOMNode *const pXMLNode, DOMElement *const pXMLElement); + + // writes the parsed configuration to a given xml file + DOMElement *WriteXML(XERCES_CPP_NAMESPACE::DOMDocument *pResultDocument, DOMElement *p_parentElement) const; + + // deletes the object + void Clear(); + + // Returns the parameters + cParameterContainer GetParams() const; + + // Returns the checker ID + std::string GetCheckerId() const; + + // Sets the checker ID + void SetCheckerId(const std::string &in); + + // Returns the minial level for issue reporting + eIssueLevel GetMinLevel() const; + + // Sets the minial level for issue reporting + void SetMinLevel(eIssueLevel newLevel); + + // Returns the minial level for issue reporting + eIssueLevel GetMaxLevel() const; + + // Sets the minial level for issue reporting + void SetMaxLevel(eIssueLevel newLevel); + + // True if parameter is available + bool HasParam(const std::string &name) const; + + // Returns a param with a given name + std::string GetParam(const std::string &name) const; + + // Sets a param with a given name and value + void SetParam(const std::string &name, const std::string &value); + + // Overwrite parameters + void OverwriteParams(const cParameterContainer ¶ms); + + protected: + std::string m_checkerID; + eIssueLevel m_minLevel; + eIssueLevel m_maxLevel; + + // parameters defined for this checker + cParameterContainer m_params; + + DOMElement *CreateXMLNode(XERCES_CPP_NAMESPACE::DOMDocument *pResultDocument) const; +}; + +#endif diff --git a/include/common/config_format/c_configuration_checker_bundle.h b/include/common/config_format/c_configuration_checker_bundle.h new file mode 100644 index 00000000..3e74027b --- /dev/null +++ b/include/common/config_format/c_configuration_checker_bundle.h @@ -0,0 +1,95 @@ +/** + * Copyright 2023 CARIAD SE. + * + * This Source Code Form is subject to the terms of the Mozilla + * Public License, v. 2.0. If a copy of the MPL was not distributed + * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#ifndef cConfigurationCheckerBundle_h__ +#define cConfigurationCheckerBundle_h__ + +#include "../result_format/c_issue.h" +#include "../result_format/c_parameter_container.h" + +#include "../util.h" +#include "../xml/util_xerces.h" + +class cConfigurationChecker; + +// Represents the parameters for a CheckerBundle in the config xml file used to parametrize the +// framework +class cConfigurationCheckerBundle +{ + public: + // name of the xml node for the checker bundle + static const XMLCh *TAG_CHECKERBUNDLE; + // application attribute in the xml node + static const XMLCh *ATTR_APPLICATION; + + cConfigurationCheckerBundle(); + cConfigurationCheckerBundle(const std::string &applicationName); + + // d'tor + virtual ~cConfigurationCheckerBundle(); + + // parses the parameters in the xml file + static cConfigurationCheckerBundle *ParseConfigurationCheckerBundle(DOMNode *const pXMLNode, + DOMElement *const pXMLElement); + + // writes the parsed checker bundle information to a given xml file + DOMElement *WriteXML(XERCES_CPP_NAMESPACE::DOMDocument *pResultDocument, DOMElement *p_parentElement) const; + + // returns all parsed checker nodes + std::vector GetConfigurationCheckers() const; + + // deletes the object + void Clear(); + + // Sets the name of the checker Bundle application + void SetCheckerBundleApplication(std::string applicationName); + + // Gets the name of the cheker Bundle application + std::string GetCheckerBundleApplication() const; + + // Adds a Checker + cConfigurationChecker *AddChecker(const std::string &checkerId, eIssueLevel minLevel = INFO_LVL, + eIssueLevel maxLevel = ERROR_LVL); + + // Returns the checkers + std::vector GetCheckers() const; + + // Returns the checkers. Returns nullptr if no checker is available + cConfigurationChecker *GetCheckerById(const std::string &checkerID) const; + + // Returns true if a checker is available + bool HasCheckerWithId(const std::string &checkerID) const; + + // returns the parameters + cParameterContainer GetParams() const; + + // True if parameter is available + bool HasParam(const std::string &name) const; + + // Returns a param with a given name + std::string GetParam(const std::string &name) const; + + // Sets a param with a given name and value + void SetParam(const std::string &name, const std::string &value); + + // Overwrite parameters + void OverwriteParams(const cParameterContainer ¶ms); + + protected: + std::string strApplication; + + // parameters defined for this checker bundle + cParameterContainer m_params; + + // list of parsed checker nodes + std::vector m_Checkers; + + DOMElement *CreateXMLNode(XERCES_CPP_NAMESPACE::DOMDocument *pResultDocument) const; + void ProcessDomNode(DOMNode *nodeToProcess, cConfigurationCheckerBundle *currentCheckerBundle); +}; +#endif diff --git a/include/common/config_format/c_configuration_report_module.h b/include/common/config_format/c_configuration_report_module.h new file mode 100644 index 00000000..6d4c5a8b --- /dev/null +++ b/include/common/config_format/c_configuration_report_module.h @@ -0,0 +1,72 @@ +/** + * Copyright 2023 CARIAD SE. + * + * This Source Code Form is subject to the terms of the Mozilla + * Public License, v. 2.0. If a copy of the MPL was not distributed + * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#ifndef cConfigurationReportModule_h__ +#define cConfigurationReportModule_h__ + +#include "../result_format/c_parameter_container.h" +#include "../util.h" +#include "../xml/util_xerces.h" + +// Represents the parameters for a ReportModule in the config xml file used to parametrize the +// framework +class cConfigurationReportModule +{ + public: + // application attribute in the xml + static const XMLCh *ATTR_APPLICATION; + + // name of the xml node for the report module + static const XMLCh *TAG_REPORT_MODULE; + + cConfigurationReportModule(); + cConfigurationReportModule(const std::string &applicationName); + + // parses the parameters in the xml file + static cConfigurationReportModule *ParseConfigurationReportModule( + XERCES_CPP_NAMESPACE::DOMNode *const pXMLNode, XERCES_CPP_NAMESPACE::DOMElement *const pXMLElement); + + // writes the stored configuration to an xml file + XERCES_CPP_NAMESPACE::DOMElement *WriteXML(XERCES_CPP_NAMESPACE::DOMDocument *pResultDocument, + XERCES_CPP_NAMESPACE::DOMElement *p_parentElement) const; + + // deletes the object + void Clear(); + + // d'tor + virtual ~cConfigurationReportModule(); + + // Sets the name of the report module + void SetReportModuleApplication(const std::string &applicationName); + + // Returns the name of the report module + std::string GetReportModuleApplication() const; + + // returns the parameters + cParameterContainer GetParams() const; + + // True if parameter is available + bool HasParam(const std::string &name) const; + + // Returns a param with a given name + std::string GetParam(const std::string &name) const; + + // Sets a param with a given name and value + void SetParam(const std::string &name, const std::string &value); + + // Overwrite parameters + void OverwriteParams(const cParameterContainer ¶ms); + + protected: + std::string strApplication; + + cParameterContainer m_params; + + void ProcessDomNode(XERCES_CPP_NAMESPACE::DOMNode *nodeToProcess, cConfigurationReportModule *currentCheckerBundle); +}; +#endif diff --git a/include/common/qc4openx_filesystem.h b/include/common/qc4openx_filesystem.h index ba6f367a..f82be48d 100644 --- a/include/common/qc4openx_filesystem.h +++ b/include/common/qc4openx_filesystem.h @@ -10,15 +10,15 @@ #define QC4OPENX_FILESYSTEM_H_ #ifdef __has_include - #if __has_include() - #include - namespace fs = std::filesystem; - #else - #include - namespace fs = std::experimental::filesystem; - #endif +#if __has_include() +#include +namespace fs = std::filesystem; #else - #error __has_include is not defined, but is needed to detect correct filesystem! +#include +namespace fs = std::experimental::filesystem; +#endif +#else +#error __has_include is not defined, but is needed to detect correct filesystem! #endif #endif diff --git a/include/common/result_format/IResult.h b/include/common/result_format/IResult.h deleted file mode 100644 index c0d887da..00000000 --- a/include/common/result_format/IResult.h +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -#ifndef _I_RESULT_H__ -#define _I_RESULT_H__ - -#include - -XERCES_CPP_NAMESPACE_USE - -class IResult -{ -public: - // Writes the result to an xml - virtual DOMElement* WriteXML(XERCES_CPP_NAMESPACE::DOMDocument* p_resultDocument) = 0; - - // True if a new Issue Id should be assigned to the entry - virtual bool AssignIssueId() = 0; - - // Sets a new issue id, if AssignIssueId returned true - virtual void SetIssueId(unsigned long long newIssueId) = 0; - - virtual ~IResult() = default; -}; - -#endif \ No newline at end of file diff --git a/include/common/result_format/cChecker.h b/include/common/result_format/cChecker.h deleted file mode 100644 index 349806b2..00000000 --- a/include/common/result_format/cChecker.h +++ /dev/null @@ -1,176 +0,0 @@ -/** - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -#ifndef cChecker_h__ -#define cChecker_h__ - -#include "cIssue.h" -#include "cParameterContainer.h" -#include "../util.h" -#include "../xml/utilXerces.h" - -#include -#include - -// Forward declaration to avoid problems with circular dependencies (especially under Linux) -class cCheckerBundle; -class cIssue; - -/* -* Definition of a basic checker -*/ -class cChecker -{ - friend class cCheckerBundle; - friend class cIssue; - -public: - static const XMLCh* TAG_CHECKER; - static const XMLCh* ATTR_CHECKER_ID; - static const XMLCh* ATTR_DESCRIPTION; - static const XMLCh* ATTR_SUMMARY; - - // Returns the checker id - std::string GetCheckerID() const; - - // Returns the summary - std::string GetSummary() const; - - // Returns the description - std::string GetDescription() const; - - // Sets the description - void SetDescription(const std::string& strDescription); - - // sets the summary - void SetSummary(const std::string& strSummary); - - /* - * Adds an issue to the checker results - * \param instance if the result - */ - cIssue* AddIssue(cIssue* const issueToAdd); - - // Clears all issues from the container - void Clear(); - - // Creates an XML node for the checker - DOMElement* CreateNode(XERCES_CPP_NAMESPACE::DOMDocument* pDOMDocResultDocument); - - // Write the xml for this issue - virtual DOMElement* WriteXML(XERCES_CPP_NAMESPACE::DOMDocument* p_resultDocument); - - // Creates an Checker out of an XML Element - static cChecker* ParseFromXML(DOMNode* pXMLNode, DOMElement* pXMLElement, cCheckerBundle* checkerBundle); - - // Counts the Issues - unsigned int GetIssueCount(); - - // Updates the summary - void UpdateSummary(); - - // Returns the issues - std::list GetIssues(); - - // Processes every issue and does a defined processing - void DoProcessing(void(*funcIzteratorPtr)(cIssue*)); - - // Returns the checkerBundle where this checker belongs to - cCheckerBundle* GetCheckerBundle() const; - - // Returns an issue by its id - cIssue* GetIssueById(unsigned long long id) const; - - /* - * Sets or adds a parameter with a given name for a checkerBundle - * \param name: Name of the parameter - * \param value: Value of the parameter - */ - void SetParam(const std::string& name, const std::string& value); - void SetParam(const std::string& name, const int& value); - void SetParam(const std::string& name, const float& value); - void SetParam(const std::string& name, const double& value); - - /* - * Returns the paramater for a given name for a checkerBundle - * \param name: Name of the parameter - * \returns: Value of the parameter - */ - std::string GetParam(const std::string& name) const; - - /* - * Returns true if a parameter with a name exists for a checkerBundle - * \param name: Name of the parameter - */ - bool HasParam(const std::string& name) const; - - /* - * Deletes a param for a checker bundle. Returns true if - * remove was successfull - * \param name: Name of the parameter - * \returns: True if deletion was successfull - */ - bool DeleteParam(const std::string& name); - - /* - * Clears all params - */ - void ClearParams(); - - /* - * Return the names of all parameters - */ - std::vector GetParams() const; - - /* - * Return true if parameters are available - */ - bool HasParams() const; - - /* - * Return the count of parameters - */ - std::size_t CountParams() const; - - /* - * Returns an instance of the param container - */ - cParameterContainer const * GetParamContainer() const; - - /* - * Returns an instance of the param container - */ - cParameterContainer * GetParamContainer(); - -protected: - // Creates a new checker instance - cChecker(const std::string& strCheckerId, const std::string& strDescription, const std::string& strSummary) : - m_Bundle(nullptr), m_CheckerId(strCheckerId), m_Description(strDescription), m_Summary(strSummary) {} - - // Creates a new checker instance - cChecker() : - m_Bundle(nullptr), m_CheckerId(""), m_Description(""), m_Summary("") {} - - virtual ~cChecker(); - - // Assigns a specific bundle to the checker - void AssignCheckerBundle(cCheckerBundle* myBundle); - - // Returns the next free ID - unsigned long long NextFreeId() const; - - std::string m_CheckerId; - std::string m_Description; - std::string m_Summary; - cCheckerBundle* m_Bundle; - - std::list m_Issues; - cParameterContainer m_Params; -}; - -#endif \ No newline at end of file diff --git a/include/common/result_format/cCheckerBundle.h b/include/common/result_format/cCheckerBundle.h deleted file mode 100644 index 9aa386a5..00000000 --- a/include/common/result_format/cCheckerBundle.h +++ /dev/null @@ -1,259 +0,0 @@ -/** - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -#ifndef cCheckerBundle_h__ -#define cCheckerBundle_h__ - -#include "cParameterContainer.h" -#include "../util.h" -#include "../xml/utilXerces.h" -#include "common/result_format/cIssue.h" - -// Forward declaration to avoid problems with circular dependencies (especially under Linux) -class cResultContainer; -class cChecker; - -class cCheckerBundle -{ - friend class cResultContainer; - friend class cChecker; - -public: - static const XMLCh* TAG_CHECKER_BUNDLE; - static const XMLCh* ATTR_CHECKER_NAME; - static const XMLCh* ATTR_CHECKER_SUMMARY; - static const XMLCh* ATTR_CHECKER_FILE; - static const XMLCh* ATTR_DESCR; - static const XMLCh* ATTR_BUILD_VERSION; - static const XMLCh* ATTR_BUILD_DATE; - - /* - * Creates a new checker bundle - * - */ - cCheckerBundle(const std::string& checkerName) : - m_CheckerName(checkerName) {} - - /* - * Creates a new checker bundle - * - */ - cCheckerBundle(const std::string& checkerName, const std::string& checkerSummary, const std::string& description); - - virtual ~cCheckerBundle(); - - // Write the xml for this issue - virtual DOMElement* WriteXML(XERCES_CPP_NAMESPACE::DOMDocument* p_resultDocument); - - // Adds a new checker - cChecker* CreateChecker(cChecker* newChecker); - - // Adds a new checker - cChecker* CreateChecker(const std::string& checkerId, const std::string& strDescription="", const std::string& strSummary=""); - - /* - * Adds an amout of issues to the checker bundle - */ - cChecker* CreateCheckerWithIssues(const std::string& strCheckerId, const std::string& strDescription, eIssueLevel issueLevel, std::map m_Issues); - - /* - * Returns a checker by its Id - * \return Returns a checker instance or nullptr - */ - cChecker* GetCheckerById(const std::string& checkerId) const; - - // Deletes all checkers - void Clear(); - - // Returns the checker id - std::string GetCheckerID() const; - - // Sets the summary - void SetSummary(const std::string& strSummary); - - // Sets the file name - void SetXODRFileName(const std::string& strFileName); - - /* Sets the file path to an XODR file which is checked. - * \param strXodrFilePath : The file path can be an absolute or relative path. - */ - void SetXODRFilePath(const std::string& strXodrFilePath); - - /* Sets the file path to an XOSC file which is checked. - * \param strXoscFilePath : The file path can be an absolute or relative path. - */ - void SetXOSCFilePath(const std::string& strXoscFilePath); - - // Sets the file name - void SetDescription(const std::string& strDescription); - - // Sets build date - void SetBuildDate(const std::string& strBuildDate); - - // Sets build version - void SetBuildVersion(const std::string& strBuildVersion); - - // Gets the summary - std::string GetSummary() const; - - /* Gets the file name of the stored XODR file - *\param bRemoveExtension : True if no extension should be returned - */ - std::string GetXODRFileName(const bool bRemoveExtension = true) const; - - /* Gets the file name of the stored XOSC file - *\param bRemoveExtension : True if no extension should be returned - */ - std::string GetXOSCFileName(const bool bRemoveExtension = true) const; - - // Returns the file path an XODR file which is relative or absolute to the result file itself - std::string GetXODRFilePath() const; - - // Returns the file path an XODR file which is relative or absolute to the result file itself - std::string GetXOSCFilePath() const; - - // Gets the file name - std::string GetDescription() const; - - // Gets the BundleName - std::string GetBundleName() const; - - // Creates a CheckerSummary out of an XML Element - static cCheckerBundle* ParseFromXML(DOMNode* pXMLNode, DOMElement* pXMLElement, cResultContainer* targetContainer); - - // Counts the Issues - unsigned int GetIssueCount() const; - - // Counts the Checkers - unsigned int GetCheckerCount() const; - - // Returns the checkers - std::list GetCheckers() const; - - // Creates the basic XM node of a checker bundle - DOMElement* CreateXMLNode(XERCES_CPP_NAMESPACE::DOMDocument* pResultDocument); - - // Processes every issue on every checker and does a defined processing - void DoProcessing(void(*funcIteratorPtr)(cChecker*, cIssue*)); - - // Returns an issue by its id - cIssue* GetIssueById(unsigned long long id) const; - - // Gets the issues from all checkers - std::list GetIssues() const; - - /* - * Sets or adds a parameter with a given name for a checkerBundle - * \param name: Name of the parameter - * \param value: Value of the parameter - */ - void SetParam(const std::string& name, const std::string& value); - void SetParam(const std::string& name, const int& value); - void SetParam(const std::string& name, const float& value); - void SetParam(const std::string& name, const double& value); - - // Overwrites or adds parameters from container - void OverwriteParams(cParameterContainer& container); - - /* - * Returns the paramater for a given name for a checkerBundle. If the - * value does not exist it return the default value. - * \param name: Name of the parameter - * \param defaultValue: Default value - * \returns: Value of the parameter or default value if parameter does not exist - */ - std::string GetParam(const std::string& name, const std::string& defaultValue = "") const; - - /* - * Returns true if a parameter with a name exists for a checkerBundle - * \param name: Name of the parameter - */ - bool HasParam(const std::string& name) const; - - /* - * Deletes a param for a checker bundle. Returns true if - * remove was successfull - * \param name: Name of the parameter - * \returns: True if deletion was successfull - */ - bool DeleteParam(const std::string& name); - - /* - * Clears all params - */ - void ClearParams(); - - /* - * Return the names of all parameters - */ - std::vector GetParams() const; - - /* - * Return true if parameters are available - */ - bool HasParams() const; - - /* - * Return the count of parameters - */ - std::size_t CountParams() const; - - /* - * Returns an instance of the param container - */ - cParameterContainer const* GetParamContainer() const; - - /* - * Returns an instance of the param container - */ - cParameterContainer* GetParamContainer(); - - /* - * Returns the build date - */ - std::string GetBuildDate() const; - - /* - * Returns the build version - */ - std::string GetBuildVersion() const; - - /* - * Returns the result container - */ - cResultContainer const* GetResultContainer() const; - -protected: - /* - * Creates a new checker bundle - */ - cCheckerBundle(const std::string& checkerName, const std::string& checkerSummary, - const std::string& fileName, const std::string& filepath, const std::string& description, - const std::string& version, const std::string& date) : - m_CheckerName(checkerName), m_CheckerSummary(checkerSummary), m_Description(description), m_FileName(fileName), m_FilePath(filepath), - m_BuildVersion(version), m_BuildDate(date) {} - - // Returns the next free ID - unsigned long long NextFreeId() const; - - void AssignResultContainer(cResultContainer* container); - - std::string m_CheckerName; - std::string m_CheckerSummary; - std::string m_Description; - std::string m_FileName; - std::string m_FilePath; - std::string m_BuildDate; - std::string m_BuildVersion; - - std::list m_Checkers; - cParameterContainer m_Params; - cResultContainer* m_Container; -}; - -#endif \ No newline at end of file diff --git a/include/common/result_format/cExtendedInformation.h b/include/common/result_format/cExtendedInformation.h deleted file mode 100644 index ef8785a9..00000000 --- a/include/common/result_format/cExtendedInformation.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -#ifndef cExtendedInfo_h__ -#define cExtendedInfo_h__ - -#include "../util.h" -#include "../xml/utilXerces.h" -#include - -/* -* Definition of additional Issues Information -*/ -class cExtendedInformation -{ -public: - static const XMLCh* ATTR_DESCRIPTION; - - /* - * Creates a new ExtendedInformationObject - * - */ - cExtendedInformation(const std::string& tagName="") : - m_TagName(tagName) {} - - virtual ~cExtendedInformation() = default; - - // Write the xml for this issue - virtual XERCES_CPP_NAMESPACE::DOMElement* WriteXML(XERCES_CPP_NAMESPACE::DOMDocument* p_resultDocument) = 0; - - // Returns the tag name - std::string GetTagName() const; - - // Checks if an extended Information is of a special type - template - bool IsType() - { - T derived = dynamic_cast(this); - return nullptr != derived; - } -protected: - std::string m_TagName; - - // This creates a basic extended information xml node. Use this for extensions. - XERCES_CPP_NAMESPACE::DOMElement* CreateExtendedInformationXMLNode(XERCES_CPP_NAMESPACE::DOMDocument * p_resultDocument); -}; - -#endif \ No newline at end of file diff --git a/include/common/result_format/cFileLocation.h b/include/common/result_format/cFileLocation.h deleted file mode 100644 index acc88efd..00000000 --- a/include/common/result_format/cFileLocation.h +++ /dev/null @@ -1,81 +0,0 @@ -/** - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -#ifndef cFileInfo_h__ -#define cFileInfo_h__ - -#include "cExtendedInformation.h" -#include "../xml/utilXerces.h" - -enum eFileType -{ - NONE, - XODR, - XOSC -}; - -/* -* Definition of additional Issues FileInformation (Location of the Issue in the Xodr File) -*/ -class cFileLocation : public cExtendedInformation -{ - -public: - static const XMLCh* TAG_NAME; - static const XMLCh* ATTR_FILETYPE; - static const XMLCh* ATTR_ROW; - static const XMLCh* ATTR_COLUMN; - - /* - * Creates a new FileLocationInfo - * \param row: Row of the file location - * \param column: Column of the file location - * \param description: Description - */ - cFileLocation(eFileType fileType, int row, int column) : cExtendedInformation("FileLocation") - { - m_FileType = fileType; - m_Column = column; - m_Row = row; - } - - // Serialize this information - virtual XERCES_CPP_NAMESPACE::DOMElement* WriteXML(XERCES_CPP_NAMESPACE::DOMDocument* p_resultDocument); - - // Unserialize this information - static cFileLocation* ParseFromXML(XERCES_CPP_NAMESPACE::DOMNode* pXMLNode, XERCES_CPP_NAMESPACE::DOMElement* pXMLElement); - - // Returns the file type - eFileType GetFileType() const; - - // Returns the file type as string - std::string GetFileTypeStr() const; - - // Returns the row - int GetRow() const; - - // Returns the column - int GetColumn() const; - - // Returns true if this is an Xodr file location - bool IsXODRFileLocation() const; - - // Returns true if this is an Xosc file location - bool IsXOSCFileLocation() const; - -protected: - eFileType m_FileType; - int m_Column; - int m_Row; - -private: - cFileLocation(); - cFileLocation(const cFileLocation&); -}; - -#endif \ No newline at end of file diff --git a/include/common/result_format/cInertialLocation.h b/include/common/result_format/cInertialLocation.h deleted file mode 100644 index d5a9b50d..00000000 --- a/include/common/result_format/cInertialLocation.h +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -#ifndef cInertialLocation_h__ -#define cInertialLocation_h__ - -#include "cExtendedInformation.h" -#include "../xml/utilXerces.h" - -/* -* Definition of additional interial location information. This can be used to debug special positions -* in dbqa framework -*/ -class cInertialLocation : public cExtendedInformation -{ - -public: - static const XMLCh* TAG_NAME; - static const XMLCh* ATTR_X; - static const XMLCh* ATTR_Y; - static const XMLCh* ATTR_Z; - static const XMLCh* ATTR_H; - static const XMLCh* ATTR_P; - static const XMLCh* ATTR_R; - - /* - * Creates a new instance of cInertialLocation - * \param x: X of the position in inertial coordinate system - * \param y: Y of the position in inertial coordinate system - * \param z: Z of the position in inertial coordinate system - * \param description: Additional description - */ - cInertialLocation(double x, double y, double z) : cExtendedInformation("InertialLocation"), - m_X(x), m_Y(y), m_Z(z), - m_H(0.0), m_P(0.0), m_R(0.0) - { - } - - /* - * Creates a new instance of cInertialLocation - * \param x: X of the position in inertial coordinate system - * \param y: Y of the position in inertial coordinate system - * \param z: Z of the position in inertial coordinate system - * \param description: Additional description - */ - cInertialLocation(double x, double y, double z, double head, double pitch, double roll) : - cExtendedInformation("InertialLocation"), - m_X(x), m_Y(y), m_Z(z), - m_H(head), m_P(pitch), m_R(roll) - { - } - - - // Serialize this information - virtual XERCES_CPP_NAMESPACE::DOMElement* WriteXML(XERCES_CPP_NAMESPACE::DOMDocument* p_resultDocument); - - // Unserialize this information - static cInertialLocation* ParseFromXML(XERCES_CPP_NAMESPACE::DOMNode* pXMLNode, XERCES_CPP_NAMESPACE::DOMElement* pXMLElement); - - // Returns the X - double GetX() const; - - // Returns the Y - double GetY() const; - - // Returns the Z - double GetZ() const; - - // Returns the Head - double GetHead() const; - - // Returns the Pitch - double GetPitch() const; - - // Returns the Roll - double GetRoll() const; -protected: - double m_X, m_Y, m_Z; - double m_H, m_P, m_R; - -private: - cInertialLocation(); - cInertialLocation(const cInertialLocation&); -}; - -#endif \ No newline at end of file diff --git a/include/common/result_format/cIssue.h b/include/common/result_format/cIssue.h deleted file mode 100644 index e8091853..00000000 --- a/include/common/result_format/cIssue.h +++ /dev/null @@ -1,139 +0,0 @@ -/** - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -#ifndef cIssue_h__ -#define cIssue_h__ - -#include "IResult.h" -#include -#include -#include -#include - -#include "../xml/utilXerces.h" - -class cChecker; -class cLocationsContainer; - -/* -* Definition of issue levels -*/ -enum eIssueLevel -{ - INFO_LVL = 3, - WARNING_LVL = 2, - ERROR_LVL = 1 -}; - -/* -* Definition of a basic Issue -*/ -class cIssue : public IResult -{ - friend class cResultContainer; - -public: - static const XMLCh* TAG_ISSUE; - static const XMLCh* ATTR_ISSUE_ID; - static const XMLCh* ATTR_DESCRIPTION; - static const XMLCh* ATTR_LEVEL; - - static const std::map issueLevelToString; - - /* - * Creates a new Issue - * - */ - cIssue(const std::string& description, eIssueLevel infoLvl, cLocationsContainer* locationsContainer = nullptr); - - /* - * Creates a new Issue - * - */ - cIssue(const std::string& description, eIssueLevel infoLvl, std::list listLoc); - - ~cIssue(); - - // Adds extendesd information to this issue - void AddLocationsContainer(cLocationsContainer* locationsContainer); - - // Adds extendesd information to this issue - void AddLocationsContainer(std::list listLoc); - - // Write the xml for this issue - virtual DOMElement* WriteXML(XERCES_CPP_NAMESPACE::DOMDocument* p_resultDocument); - - // Returns if a new issue id should be assigned - virtual bool AssignIssueId(); - - // Returns th count of locations - std::size_t GetLocationsCount() const; - - // Assigns an issue to a checker - void AssignChecker(cChecker* checkerToAssign); - - // Sets a new issue id - void SetIssueId(const std::string& newIssueId); - - // Sets a new issue id - void SetIssueId(unsigned long long newIssueId); - - // Creates an Issue out of an XML Element - static cIssue* ParseFromXML(DOMNode* pXMLNode, DOMElement* pXMLElement, cChecker* checker); - - // Returns an IssueLevel from a given string - static eIssueLevel GetIssueLevelFromStr(const std::string& issueLevelString); - - // Sets the description - void SetDescription(const std::string& strDescription); - - // Sets the level - void SetLevel(eIssueLevel level); - - // Returns the description - std::string GetDescription() const; - - // Returns the issue level - eIssueLevel GetIssueLevel() const; - - // Return thr issue id - unsigned long long GetIssueId() const; - - // Returns the issue level as a string - std::string GetIssueLevelStr() const; - - // Returns true if this issue has location containers - bool HasLocations() const; - - // Returns all extended informations - std::list GetLocationsContainer() const; - - // Returns the checker this issue belongs to - cChecker* GetChecker() const; - - // Returns the xodr file name - std::string GetXODRFilename() const; - - // Returns the xodr file path - std::string GetXODRFilepath() const; - - // Returns the next free ID - unsigned long long NextFreeId() const; - -protected: - unsigned long long m_Id; - std::string m_Description; - eIssueLevel m_IssueLevel; - cChecker* m_Checker; - - std::list m_Locations; -}; - -std::string PrintIssueLevel(const eIssueLevel); - -#endif \ No newline at end of file diff --git a/include/common/result_format/cParameterContainer.h b/include/common/result_format/cParameterContainer.h deleted file mode 100644 index aeaa0d41..00000000 --- a/include/common/result_format/cParameterContainer.h +++ /dev/null @@ -1,111 +0,0 @@ -/** - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -#ifndef CPARAMETER_CONTAINER_H__ -#define CPARAMETER_CONTAINER_H__ - -#include -#include -#include -#include -#include "../xml/utilXerces.h" - -class cParameterContainer -{ -public: - // c'tor - cParameterContainer(); - - static const XMLCh* TAG_PARAM; - static const XMLCh* ATTR_NAME; - static const XMLCh* ATTR_VALUE; - - // Write the xml for all parameters - virtual void WriteXML(XERCES_CPP_NAMESPACE::DOMDocument* p_resultDocument, XERCES_CPP_NAMESPACE::DOMElement* parentElement) const; - - // Creates an Issue out of an XML Element - static void ParseFromXML(XERCES_CPP_NAMESPACE::DOMNode* pXMLNode, XERCES_CPP_NAMESPACE::DOMElement* pXMLElement, cParameterContainer* container); - - /* - * Sets or adds a parameter with a given name for a checkerBundle - * \param name: Name of the parameter - * \param value: Value of the parameter - */ - void SetParam(const std::string& name, const std::string& value); - - /* - * Sets or adds a parameter with a given name for a checkerBundle - * \param name: Name of the parameter - * \param value: Value of the parameter - */ - void SetParam(const std::string& name, const float& value); - - /* - * Sets or adds a parameter with a given name for a checkerBundle - * \param name: Name of the parameter - * \param value: Value of the parameter - */ - void SetParam(const std::string& name, const double& value); - - /* - * Sets or adds a parameter with a given name for a checkerBundle - * \param name: Name of the parameter - * \param value: Value of the parameter - */ - void SetParam(const std::string& name, const int& value); - - /* - * Returns the paramater for a given name for a checkerBundle. If the - * value does not exist it return the default value. - * \param name: Name of the parameter - * \param defaultValue: Default value - * \returns: Value of the parameter or default value if parameter does not exist - */ - std::string GetParam(const std::string& name, const std::string& defaultValue = "") const; - - /* - * Returns true if a parameter with a name exists for a checkerBundle - * \param name: Name of the parameter - */ - bool HasParam(const std::string& name) const; - - /* - * Overwrites the current container with new parameters from anorther one. - * \param container: The container with params to overwrite - */ - void Overwrite(const cParameterContainer& container); - - /* - * Deletes a param for a checker bundle. Returns true if - * remove was successfull - * \param name: Name of the parameter - * \returns: True if deletion was successfull - */ - bool DeleteParam(const std::string& name); - - /* - * Clears all params - */ - void ClearParams(); - - // Returns all the names of the parameters - std::vector GetParams() const; - - // Returns true if params are available - bool HasParams() const; - - // Returns the amount of params - size_t CountParams() const; - -protected: - std::map m_Parameters; - - XERCES_CPP_NAMESPACE::DOMElement* CreateNode(XERCES_CPP_NAMESPACE::DOMDocument* pDOMDocResultDocument, const std::string& name, const std::string& value) const; -}; - -#endif \ No newline at end of file diff --git a/include/common/result_format/cResultContainer.h b/include/common/result_format/cResultContainer.h deleted file mode 100644 index 5ad4ec68..00000000 --- a/include/common/result_format/cResultContainer.h +++ /dev/null @@ -1,143 +0,0 @@ -/** - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -#ifndef cResultContainer_h__ -#define cResultContainer_h__ - -#include -#include -#include -#include -#include - -#include "../util.h" -#include "../xml/utilXerces.h" - -#include -#include - -// Forward declaration to avoid problems with circular dependencies (especially under Linux) -class cCheckerBundle; -class cConfiguration; -class cIssue; -class cChecker; - -class cResultContainer -{ - friend class cCheckerBundle; - -public: - // c'tor - cResultContainer(); - - cResultContainer(cResultContainer& ) = delete; - cResultContainer& operator=(const cResultContainer& ) = delete; - - //d'tor - virtual ~cResultContainer(); - - static const XMLCh* ATTR_VERSION; - static const XMLCh* XAQR_VERSION; - - /* - Adds a result to the result list. - \param result The instance of IResult to add - */ - void AddCheckerBundle(cCheckerBundle* checkerBundleInstance); - - /* - Clears all results from the list. - Makes sure that the memory is freed after calling. - */ - void Clear(); - - /* - Writes the results to a given filename and iterated each element in the result list. - \param fileName The name of the file. - */ - void WriteResults(const std::string& strFileName) const; - - /* - Adds the results from a already existing XQAR file - \param strXmlFilePath: Path to a existing QXAR file - */ - void AddResultsFromXML(const std::string& strXmlFilePath); - - // Counts the Issues - unsigned int GetIssueCount() const; - - // Counts the Checkers - unsigned int GetCheckerCount() const; - - // Counts the Checkers - unsigned int GetCheckerBundleCount() const; - - // Returns true if the container has checker bundles - bool HasCheckerBundles() const; - - // Returns checker bundles - std::list GetCheckerBundles() const; - - // Returns the Checkers by a given checker bundle name - std::list GetCheckers(const std::string& parentCheckerBundleName); - - // Returns the Checkers by a given parent. If the parent is NULL, all available checkers will be returned. - std::list GetCheckers(cCheckerBundle* parent = 0); - - //// Returns the Issues by a given parent checker id. - std::list GetIssuesByCheckerID(const std::string& checkerID); - - // Returns the Issues by a given parent. If the parent is NULL, all available issues will be returned. - std::list GetIssues(cChecker* parent = 0) const; - - // Returns all issues form a list of checkers - std::list GetIssues(std::list checkersInput) const; - - // Returns an issue by its id - cIssue* GetIssueById(unsigned long long id) const; - - // Returns true if a xodr filename is available - bool HasXODRFileName() const; - - // Returns true if a xosc filename is available - bool HasXOSCFilePath() const; - - /* - Returns the xodr filename of the first checkerbundle. Empty string if no file name is present. - \param bRemoveExtension : True if no extension should be returned - */ - std::string GetXODRFileName(const bool bRemoveExtension = true) const; - - // Returns the xodr path of the first checkerbundle. Empty string if no file name is present. - std::string GetXODRFilePath() const; - - // Returns the xosc path of the first checkerbundle. Empty string if no file name is present. - std::string GetXOSCFilePath() const; - - // Processes every issue on every checkerbundle, checker and does a defined processing - void DoProcessing(void(*funcIteratorPtr)(cCheckerBundle*, cChecker*, cIssue*)); - - /*! - * Converts a report to a configuration - * - * \param resultConfiguration The configuration which should contain the results - */ - void ConvertReportToConfiguration(cConfiguration* resultConfiguration); - -protected: - std::list m_Bundles; - - unsigned long long m_NextFreeId = 0; - -private: - // Returns the next free ID - unsigned long long NextFreeId(); -}; - - -#endif \ No newline at end of file diff --git a/include/common/result_format/cRoadLocation.h b/include/common/result_format/cRoadLocation.h deleted file mode 100644 index 8074096e..00000000 --- a/include/common/result_format/cRoadLocation.h +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -#ifndef cRoadLocation_h__ -#define cRoadLocation_h__ - -#include "cExtendedInformation.h" -#include "../xml/utilXerces.h" - -/* -* Definition of additional road location. This can be used to debug special positions -* in dbqa framework. -*/ -class cRoadLocation : public cExtendedInformation -{ - -public: - static const XMLCh* TAG_NAME; - static const XMLCh* ATTR_ROAD_ID; - static const XMLCh* ATTR_S; - static const XMLCh* ATTR_T; - - /* - * Creates a new instance of cRoadLocation - * \param roadId: ID of the road in OpenDrive - * \param s: S of the road in OpenDrive - * \param t: T of the road in OpenDrive - */ - cRoadLocation(const std::string& roadId, float s = 0.0f, float t = 0.0f) : cExtendedInformation("RoadLocation") - { - m_RoadID = roadId; - m_S = s; - m_T = t; - } - - // Serialize this information - virtual XERCES_CPP_NAMESPACE::DOMElement* WriteXML(XERCES_CPP_NAMESPACE::DOMDocument* p_resultDocument); - - // Unserialize this information - static cRoadLocation* ParseFromXML(XERCES_CPP_NAMESPACE::DOMNode* pXMLNode, XERCES_CPP_NAMESPACE::DOMElement* pXMLElement); - - // Returns the xPath - std::string GetRoadID() const; - - // Returns the road Id as integer - void GetRoadID(int& roadId) const; - - // Returns the s of the road - float GetS() const; - - // Returns the t of the road - float GetT() const; -protected: - std::string m_RoadID; - float m_S; - float m_T; - -private: - cRoadLocation(); - cRoadLocation(const cRoadLocation&); -}; - -#endif \ No newline at end of file diff --git a/include/common/result_format/cXMLLocation.h b/include/common/result_format/cXMLLocation.h deleted file mode 100644 index 8500f19d..00000000 --- a/include/common/result_format/cXMLLocation.h +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -#ifndef cXMLLocation_h__ -#define cXMLLocation_h__ - -#include "cExtendedInformation.h" -#include "../xml/utilXerces.h" - -/* -* Definition of additional xml path location (Location of the Issue in the Xodr File) -*/ -class cXMLLocation : public cExtendedInformation -{ - -public: - static const XMLCh* TAG_NAME; - static const XMLCh* ATTR_XPATH; - - /* - * Creates a new FileLocationInfo - * - */ - cXMLLocation(const std::string& xpath) : cExtendedInformation("XMLLocation") - { - m_XPath = xpath; - } - - // Serialize this information - virtual XERCES_CPP_NAMESPACE::DOMElement* WriteXML(XERCES_CPP_NAMESPACE::DOMDocument* p_resultDocument); - - // Unserialize this information - static cXMLLocation* ParseFromXML(XERCES_CPP_NAMESPACE::DOMNode* pXMLNode, XERCES_CPP_NAMESPACE::DOMElement* pXMLElement); - - // Returns the xPath - std::string GetXPath() const; - - // Creates an XMLLocation for an OpenDRIVE road by a roadID filter - static cXMLLocation* CreateXMLLocationByRoadId(const std::string& roadId); - - // Creates an XMLLocation for the planView of an OpenDRIVE road by a roadID filter - static cXMLLocation* CreateXMLLocationByRoadIdWithPlanView(const std::string& roadId); - - // Creates an XMLLocation for the elevationProfile of an OpenDRIVE road by a roadID filter - static cXMLLocation* CreateXMLLocationByRoadIdWithElevationProfile(const std::string& roadId); - -protected: - std::string m_XPath; - -private: - cXMLLocation(); - cXMLLocation(const cXMLLocation&); - - // Creates an XPath for an OpenDRIVE road by a roadID filter - static std::stringstream CreateXPathByRoadId(const std::string& roadId); -}; - -#endif \ No newline at end of file diff --git a/include/common/result_format/c_checker.h b/include/common/result_format/c_checker.h new file mode 100644 index 00000000..f45f7527 --- /dev/null +++ b/include/common/result_format/c_checker.h @@ -0,0 +1,179 @@ +/** + * Copyright 2023 CARIAD SE. + * + * This Source Code Form is subject to the terms of the Mozilla + * Public License, v. 2.0. If a copy of the MPL was not distributed + * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#ifndef cChecker_h__ +#define cChecker_h__ + +#include "../util.h" +#include "../xml/util_xerces.h" +#include "c_issue.h" +#include "c_parameter_container.h" + +#include +#include + +// Forward declaration to avoid problems with circular dependencies (especially under Linux) +class cCheckerBundle; +class cIssue; + +/* + * Definition of a basic checker + */ +class cChecker +{ + friend class cCheckerBundle; + friend class cIssue; + + public: + static const XMLCh *TAG_CHECKER; + static const XMLCh *ATTR_CHECKER_ID; + static const XMLCh *ATTR_DESCRIPTION; + static const XMLCh *ATTR_SUMMARY; + + // Returns the checker id + std::string GetCheckerID() const; + + // Returns the summary + std::string GetSummary() const; + + // Returns the description + std::string GetDescription() const; + + // Sets the description + void SetDescription(const std::string &strDescription); + + // sets the summary + void SetSummary(const std::string &strSummary); + + /* + * Adds an issue to the checker results + * \param instance if the result + */ + cIssue *AddIssue(cIssue *const issueToAdd); + + // Clears all issues from the container + void Clear(); + + // Creates an XML node for the checker + DOMElement *CreateNode(XERCES_CPP_NAMESPACE::DOMDocument *pDOMDocResultDocument); + + // Write the xml for this issue + virtual DOMElement *WriteXML(XERCES_CPP_NAMESPACE::DOMDocument *p_resultDocument); + + // Creates an Checker out of an XML Element + static cChecker *ParseFromXML(DOMNode *pXMLNode, DOMElement *pXMLElement, cCheckerBundle *checkerBundle); + + // Counts the Issues + unsigned int GetIssueCount(); + + // Updates the summary + void UpdateSummary(); + + // Returns the issues + std::list GetIssues(); + + // Processes every issue and does a defined processing + void DoProcessing(void (*funcIzteratorPtr)(cIssue *)); + + // Returns the checkerBundle where this checker belongs to + cCheckerBundle *GetCheckerBundle() const; + + // Returns an issue by its id + cIssue *GetIssueById(unsigned long long id) const; + + /* + * Sets or adds a parameter with a given name for a checkerBundle + * \param name: Name of the parameter + * \param value: Value of the parameter + */ + void SetParam(const std::string &name, const std::string &value); + void SetParam(const std::string &name, const int &value); + void SetParam(const std::string &name, const float &value); + void SetParam(const std::string &name, const double &value); + + /* + * Returns the paramater for a given name for a checkerBundle + * \param name: Name of the parameter + * \returns: Value of the parameter + */ + std::string GetParam(const std::string &name) const; + + /* + * Returns true if a parameter with a name exists for a checkerBundle + * \param name: Name of the parameter + */ + bool HasParam(const std::string &name) const; + + /* + * Deletes a param for a checker bundle. Returns true if + * remove was successfull + * \param name: Name of the parameter + * \returns: True if deletion was successfull + */ + bool DeleteParam(const std::string &name); + + /* + * Clears all params + */ + void ClearParams(); + + /* + * Return the names of all parameters + */ + std::vector GetParams() const; + + /* + * Return true if parameters are available + */ + bool HasParams() const; + + /* + * Return the count of parameters + */ + std::size_t CountParams() const; + + /* + * Returns an instance of the param container + */ + cParameterContainer const *GetParamContainer() const; + + /* + * Returns an instance of the param container + */ + cParameterContainer *GetParamContainer(); + + protected: + // Creates a new checker instance + cChecker(const std::string &strCheckerId, const std::string &strDescription, const std::string &strSummary) + : m_Bundle(nullptr), m_CheckerId(strCheckerId), m_Description(strDescription), m_Summary(strSummary) + { + } + + // Creates a new checker instance + cChecker() : m_Bundle(nullptr), m_CheckerId(""), m_Description(""), m_Summary("") + { + } + + virtual ~cChecker(); + + // Assigns a specific bundle to the checker + void AssignCheckerBundle(cCheckerBundle *myBundle); + + // Returns the next free ID + unsigned long long NextFreeId() const; + + std::string m_CheckerId; + std::string m_Description; + std::string m_Summary; + cCheckerBundle *m_Bundle; + + std::list m_Issues; + cParameterContainer m_Params; +}; + +#endif diff --git a/include/common/result_format/c_checker_bundle.h b/include/common/result_format/c_checker_bundle.h new file mode 100644 index 00000000..e6b3d525 --- /dev/null +++ b/include/common/result_format/c_checker_bundle.h @@ -0,0 +1,264 @@ +/** + * Copyright 2023 CARIAD SE. + * + * This Source Code Form is subject to the terms of the Mozilla + * Public License, v. 2.0. If a copy of the MPL was not distributed + * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#ifndef cCheckerBundle_h__ +#define cCheckerBundle_h__ + +#include "../util.h" +#include "../xml/util_xerces.h" +#include "c_parameter_container.h" +#include "common/result_format/c_issue.h" + +// Forward declaration to avoid problems with circular dependencies (especially under Linux) +class cResultContainer; +class cChecker; + +class cCheckerBundle +{ + friend class cResultContainer; + friend class cChecker; + + public: + static const XMLCh *TAG_CHECKER_BUNDLE; + static const XMLCh *ATTR_CHECKER_NAME; + static const XMLCh *ATTR_CHECKER_SUMMARY; + static const XMLCh *ATTR_CHECKER_FILE; + static const XMLCh *ATTR_DESCR; + static const XMLCh *ATTR_BUILD_VERSION; + static const XMLCh *ATTR_BUILD_DATE; + + /* + * Creates a new checker bundle + * + */ + cCheckerBundle(const std::string &checkerName) : m_CheckerName(checkerName) + { + } + + /* + * Creates a new checker bundle + * + */ + cCheckerBundle(const std::string &checkerName, const std::string &checkerSummary, const std::string &description); + + virtual ~cCheckerBundle(); + + // Write the xml for this issue + virtual DOMElement *WriteXML(XERCES_CPP_NAMESPACE::DOMDocument *p_resultDocument); + + // Adds a new checker + cChecker *CreateChecker(cChecker *newChecker); + + // Adds a new checker + cChecker *CreateChecker(const std::string &checkerId, const std::string &strDescription = "", + const std::string &strSummary = ""); + + /* + * Adds an amout of issues to the checker bundle + */ + cChecker *CreateCheckerWithIssues(const std::string &strCheckerId, const std::string &strDescription, + eIssueLevel issueLevel, std::map m_Issues); + + /* + * Returns a checker by its Id + * \return Returns a checker instance or nullptr + */ + cChecker *GetCheckerById(const std::string &checkerId) const; + + // Deletes all checkers + void Clear(); + + // Returns the checker id + std::string GetCheckerID() const; + + // Sets the summary + void SetSummary(const std::string &strSummary); + + // Sets the file name + void SetXODRFileName(const std::string &strFileName); + + /* Sets the file path to an XODR file which is checked. + * \param strXodrFilePath : The file path can be an absolute or relative path. + */ + void SetXODRFilePath(const std::string &strXodrFilePath); + + /* Sets the file path to an XOSC file which is checked. + * \param strXoscFilePath : The file path can be an absolute or relative path. + */ + void SetXOSCFilePath(const std::string &strXoscFilePath); + + // Sets the file name + void SetDescription(const std::string &strDescription); + + // Sets build date + void SetBuildDate(const std::string &strBuildDate); + + // Sets build version + void SetBuildVersion(const std::string &strBuildVersion); + + // Gets the summary + std::string GetSummary() const; + + /* Gets the file name of the stored XODR file + *\param bRemoveExtension : True if no extension should be returned + */ + std::string GetXODRFileName(const bool bRemoveExtension = true) const; + + /* Gets the file name of the stored XOSC file + *\param bRemoveExtension : True if no extension should be returned + */ + std::string GetXOSCFileName(const bool bRemoveExtension = true) const; + + // Returns the file path an XODR file which is relative or absolute to the result file itself + std::string GetXODRFilePath() const; + + // Returns the file path an XODR file which is relative or absolute to the result file itself + std::string GetXOSCFilePath() const; + + // Gets the file name + std::string GetDescription() const; + + // Gets the BundleName + std::string GetBundleName() const; + + // Creates a CheckerSummary out of an XML Element + static cCheckerBundle *ParseFromXML(DOMNode *pXMLNode, DOMElement *pXMLElement, cResultContainer *targetContainer); + + // Counts the Issues + unsigned int GetIssueCount() const; + + // Counts the Checkers + unsigned int GetCheckerCount() const; + + // Returns the checkers + std::list GetCheckers() const; + + // Creates the basic XM node of a checker bundle + DOMElement *CreateXMLNode(XERCES_CPP_NAMESPACE::DOMDocument *pResultDocument); + + // Processes every issue on every checker and does a defined processing + void DoProcessing(void (*funcIteratorPtr)(cChecker *, cIssue *)); + + // Returns an issue by its id + cIssue *GetIssueById(unsigned long long id) const; + + // Gets the issues from all checkers + std::list GetIssues() const; + + /* + * Sets or adds a parameter with a given name for a checkerBundle + * \param name: Name of the parameter + * \param value: Value of the parameter + */ + void SetParam(const std::string &name, const std::string &value); + void SetParam(const std::string &name, const int &value); + void SetParam(const std::string &name, const float &value); + void SetParam(const std::string &name, const double &value); + + // Overwrites or adds parameters from container + void OverwriteParams(cParameterContainer &container); + + /* + * Returns the paramater for a given name for a checkerBundle. If the + * value does not exist it return the default value. + * \param name: Name of the parameter + * \param defaultValue: Default value + * \returns: Value of the parameter or default value if parameter does not exist + */ + std::string GetParam(const std::string &name, const std::string &defaultValue = "") const; + + /* + * Returns true if a parameter with a name exists for a checkerBundle + * \param name: Name of the parameter + */ + bool HasParam(const std::string &name) const; + + /* + * Deletes a param for a checker bundle. Returns true if + * remove was successfull + * \param name: Name of the parameter + * \returns: True if deletion was successfull + */ + bool DeleteParam(const std::string &name); + + /* + * Clears all params + */ + void ClearParams(); + + /* + * Return the names of all parameters + */ + std::vector GetParams() const; + + /* + * Return true if parameters are available + */ + bool HasParams() const; + + /* + * Return the count of parameters + */ + std::size_t CountParams() const; + + /* + * Returns an instance of the param container + */ + cParameterContainer const *GetParamContainer() const; + + /* + * Returns an instance of the param container + */ + cParameterContainer *GetParamContainer(); + + /* + * Returns the build date + */ + std::string GetBuildDate() const; + + /* + * Returns the build version + */ + std::string GetBuildVersion() const; + + /* + * Returns the result container + */ + cResultContainer const *GetResultContainer() const; + + protected: + /* + * Creates a new checker bundle + */ + cCheckerBundle(const std::string &checkerName, const std::string &checkerSummary, const std::string &fileName, + const std::string &filepath, const std::string &description, const std::string &version, + const std::string &date) + : m_CheckerName(checkerName), m_CheckerSummary(checkerSummary), m_Description(description), + m_FileName(fileName), m_FilePath(filepath), m_BuildVersion(version), m_BuildDate(date) + { + } + + // Returns the next free ID + unsigned long long NextFreeId() const; + + void AssignResultContainer(cResultContainer *container); + + std::string m_CheckerName; + std::string m_CheckerSummary; + std::string m_Description; + std::string m_FileName; + std::string m_FilePath; + std::string m_BuildDate; + std::string m_BuildVersion; + + std::list m_Checkers; + cParameterContainer m_Params; + cResultContainer *m_Container; +}; + +#endif diff --git a/include/common/result_format/c_extended_information.h b/include/common/result_format/c_extended_information.h new file mode 100644 index 00000000..a01102cf --- /dev/null +++ b/include/common/result_format/c_extended_information.h @@ -0,0 +1,55 @@ +/** + * Copyright 2023 CARIAD SE. + * + * This Source Code Form is subject to the terms of the Mozilla + * Public License, v. 2.0. If a copy of the MPL was not distributed + * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#ifndef cExtendedInfo_h__ +#define cExtendedInfo_h__ + +#include "../util.h" +#include "../xml/util_xerces.h" +#include + +/* + * Definition of additional Issues Information + */ +class cExtendedInformation +{ + public: + static const XMLCh *ATTR_DESCRIPTION; + + /* + * Creates a new ExtendedInformationObject + * + */ + cExtendedInformation(const std::string &tagName = "") : m_TagName(tagName) + { + } + + virtual ~cExtendedInformation() = default; + + // Write the xml for this issue + virtual XERCES_CPP_NAMESPACE::DOMElement *WriteXML(XERCES_CPP_NAMESPACE::DOMDocument *p_resultDocument) = 0; + + // Returns the tag name + std::string GetTagName() const; + + // Checks if an extended Information is of a special type + template bool IsType() + { + T derived = dynamic_cast(this); + return nullptr != derived; + } + + protected: + std::string m_TagName; + + // This creates a basic extended information xml node. Use this for extensions. + XERCES_CPP_NAMESPACE::DOMElement *CreateExtendedInformationXMLNode( + XERCES_CPP_NAMESPACE::DOMDocument *p_resultDocument); +}; + +#endif diff --git a/include/common/result_format/c_file_location.h b/include/common/result_format/c_file_location.h new file mode 100644 index 00000000..3629be65 --- /dev/null +++ b/include/common/result_format/c_file_location.h @@ -0,0 +1,82 @@ +/** + * Copyright 2023 CARIAD SE. + * + * This Source Code Form is subject to the terms of the Mozilla + * Public License, v. 2.0. If a copy of the MPL was not distributed + * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#ifndef cFileInfo_h__ +#define cFileInfo_h__ + +#include "../xml/util_xerces.h" +#include "c_extended_information.h" + +enum eFileType +{ + NONE, + XODR, + XOSC +}; + +/* + * Definition of additional Issues FileInformation (Location of the Issue in the Xodr File) + */ +class cFileLocation : public cExtendedInformation +{ + + public: + static const XMLCh *TAG_NAME; + static const XMLCh *ATTR_FILETYPE; + static const XMLCh *ATTR_ROW; + static const XMLCh *ATTR_COLUMN; + + /* + * Creates a new FileLocationInfo + * \param row: Row of the file location + * \param column: Column of the file location + * \param description: Description + */ + cFileLocation(eFileType fileType, int row, int column) : cExtendedInformation("FileLocation") + { + m_FileType = fileType; + m_Column = column; + m_Row = row; + } + + // Serialize this information + virtual XERCES_CPP_NAMESPACE::DOMElement *WriteXML(XERCES_CPP_NAMESPACE::DOMDocument *p_resultDocument); + + // Unserialize this information + static cFileLocation *ParseFromXML(XERCES_CPP_NAMESPACE::DOMNode *pXMLNode, + XERCES_CPP_NAMESPACE::DOMElement *pXMLElement); + + // Returns the file type + eFileType GetFileType() const; + + // Returns the file type as string + std::string GetFileTypeStr() const; + + // Returns the row + int GetRow() const; + + // Returns the column + int GetColumn() const; + + // Returns true if this is an Xodr file location + bool IsXODRFileLocation() const; + + // Returns true if this is an Xosc file location + bool IsXOSCFileLocation() const; + + protected: + eFileType m_FileType; + int m_Column; + int m_Row; + + private: + cFileLocation(); + cFileLocation(const cFileLocation &); +}; + +#endif diff --git a/include/common/result_format/c_inertial_location.h b/include/common/result_format/c_inertial_location.h new file mode 100644 index 00000000..ebde1348 --- /dev/null +++ b/include/common/result_format/c_inertial_location.h @@ -0,0 +1,89 @@ +/** + * Copyright 2023 CARIAD SE. + * + * This Source Code Form is subject to the terms of the Mozilla + * Public License, v. 2.0. If a copy of the MPL was not distributed + * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#ifndef cInertialLocation_h__ +#define cInertialLocation_h__ + +#include "../xml/util_xerces.h" +#include "c_extended_information.h" + +/* + * Definition of additional interial location information. This can be used to debug special positions + * in dbqa framework + */ +class cInertialLocation : public cExtendedInformation +{ + + public: + static const XMLCh *TAG_NAME; + static const XMLCh *ATTR_X; + static const XMLCh *ATTR_Y; + static const XMLCh *ATTR_Z; + static const XMLCh *ATTR_H; + static const XMLCh *ATTR_P; + static const XMLCh *ATTR_R; + + /* + * Creates a new instance of cInertialLocation + * \param x: X of the position in inertial coordinate system + * \param y: Y of the position in inertial coordinate system + * \param z: Z of the position in inertial coordinate system + * \param description: Additional description + */ + cInertialLocation(double x, double y, double z) + : cExtendedInformation("InertialLocation"), m_X(x), m_Y(y), m_Z(z), m_H(0.0), m_P(0.0), m_R(0.0) + { + } + + /* + * Creates a new instance of cInertialLocation + * \param x: X of the position in inertial coordinate system + * \param y: Y of the position in inertial coordinate system + * \param z: Z of the position in inertial coordinate system + * \param description: Additional description + */ + cInertialLocation(double x, double y, double z, double head, double pitch, double roll) + : cExtendedInformation("InertialLocation"), m_X(x), m_Y(y), m_Z(z), m_H(head), m_P(pitch), m_R(roll) + { + } + + // Serialize this information + virtual XERCES_CPP_NAMESPACE::DOMElement *WriteXML(XERCES_CPP_NAMESPACE::DOMDocument *p_resultDocument); + + // Unserialize this information + static cInertialLocation *ParseFromXML(XERCES_CPP_NAMESPACE::DOMNode *pXMLNode, + XERCES_CPP_NAMESPACE::DOMElement *pXMLElement); + + // Returns the X + double GetX() const; + + // Returns the Y + double GetY() const; + + // Returns the Z + double GetZ() const; + + // Returns the Head + double GetHead() const; + + // Returns the Pitch + double GetPitch() const; + + // Returns the Roll + double GetRoll() const; + + protected: + double m_X, m_Y, m_Z; + double m_H, m_P, m_R; + + private: + cInertialLocation(); + cInertialLocation(const cInertialLocation &); +}; + +#endif diff --git a/include/common/result_format/c_issue.h b/include/common/result_format/c_issue.h new file mode 100644 index 00000000..2bd744ec --- /dev/null +++ b/include/common/result_format/c_issue.h @@ -0,0 +1,139 @@ +/** + * Copyright 2023 CARIAD SE. + * + * This Source Code Form is subject to the terms of the Mozilla + * Public License, v. 2.0. If a copy of the MPL was not distributed + * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#ifndef cIssue_h__ +#define cIssue_h__ + +#include "i_result.h" +#include +#include +#include +#include + +#include "../xml/util_xerces.h" + +class cChecker; +class cLocationsContainer; + +/* + * Definition of issue levels + */ +enum eIssueLevel +{ + INFO_LVL = 3, + WARNING_LVL = 2, + ERROR_LVL = 1 +}; + +/* + * Definition of a basic Issue + */ +class cIssue : public IResult +{ + friend class cResultContainer; + + public: + static const XMLCh *TAG_ISSUE; + static const XMLCh *ATTR_ISSUE_ID; + static const XMLCh *ATTR_DESCRIPTION; + static const XMLCh *ATTR_LEVEL; + + static const std::map issueLevelToString; + + /* + * Creates a new Issue + * + */ + cIssue(const std::string &description, eIssueLevel infoLvl, cLocationsContainer *locationsContainer = nullptr); + + /* + * Creates a new Issue + * + */ + cIssue(const std::string &description, eIssueLevel infoLvl, std::list listLoc); + + ~cIssue(); + + // Adds extendesd information to this issue + void AddLocationsContainer(cLocationsContainer *locationsContainer); + + // Adds extendesd information to this issue + void AddLocationsContainer(std::list listLoc); + + // Write the xml for this issue + virtual DOMElement *WriteXML(XERCES_CPP_NAMESPACE::DOMDocument *p_resultDocument); + + // Returns if a new issue id should be assigned + virtual bool AssignIssueId(); + + // Returns th count of locations + std::size_t GetLocationsCount() const; + + // Assigns an issue to a checker + void AssignChecker(cChecker *checkerToAssign); + + // Sets a new issue id + void SetIssueId(const std::string &newIssueId); + + // Sets a new issue id + void SetIssueId(unsigned long long newIssueId); + + // Creates an Issue out of an XML Element + static cIssue *ParseFromXML(DOMNode *pXMLNode, DOMElement *pXMLElement, cChecker *checker); + + // Returns an IssueLevel from a given string + static eIssueLevel GetIssueLevelFromStr(const std::string &issueLevelString); + + // Sets the description + void SetDescription(const std::string &strDescription); + + // Sets the level + void SetLevel(eIssueLevel level); + + // Returns the description + std::string GetDescription() const; + + // Returns the issue level + eIssueLevel GetIssueLevel() const; + + // Return thr issue id + unsigned long long GetIssueId() const; + + // Returns the issue level as a string + std::string GetIssueLevelStr() const; + + // Returns true if this issue has location containers + bool HasLocations() const; + + // Returns all extended informations + std::list GetLocationsContainer() const; + + // Returns the checker this issue belongs to + cChecker *GetChecker() const; + + // Returns the xodr file name + std::string GetXODRFilename() const; + + // Returns the xodr file path + std::string GetXODRFilepath() const; + + // Returns the next free ID + unsigned long long NextFreeId() const; + + protected: + unsigned long long m_Id; + std::string m_Description; + eIssueLevel m_IssueLevel; + cChecker *m_Checker; + + std::list m_Locations; +}; + +std::string PrintIssueLevel(const eIssueLevel); + +#endif diff --git a/include/common/result_format/cLocationsContainer.h b/include/common/result_format/c_locations_container.h similarity index 51% rename from include/common/result_format/cLocationsContainer.h rename to include/common/result_format/c_locations_container.h index d3c56a09..e3c4df61 100644 --- a/include/common/result_format/cLocationsContainer.h +++ b/include/common/result_format/c_locations_container.h @@ -9,57 +9,57 @@ #ifndef cLocationsContainer_h__ #define cLocationsContainer_h__ -#include "IResult.h" -#include +#include "i_result.h" +#include #include +#include #include -#include -#include "../xml/utilXerces.h" +#include "../xml/util_xerces.h" class cExtendedInformation; /* -* Definition of issue information grouped as a location node -*/ + * Definition of issue information grouped as a location node + */ class cLocationsContainer { friend class cResultContainer; -public: - static const XMLCh* TAG_LOCATIONS; - static const XMLCh* ATTR_DESCRIPTION; + public: + static const XMLCh *TAG_LOCATIONS; + static const XMLCh *ATTR_DESCRIPTION; /* - * Creates a new location node - */ - cLocationsContainer(const std::string& description, cExtendedInformation* extendedInformation = nullptr); + * Creates a new location node + */ + cLocationsContainer(const std::string &description, cExtendedInformation *extendedInformation = nullptr); /* - * Creates a new location node - */ - cLocationsContainer(const std::string& description, std::list listExt); + * Creates a new location node + */ + cLocationsContainer(const std::string &description, std::list listExt); // d'tor virtual ~cLocationsContainer(); // Adds extendesd information to this issue - void AddExtendedInformation(cExtendedInformation* extendedInformation); + void AddExtendedInformation(cExtendedInformation *extendedInformation); // Adds extendesd information to this issue - void AddExtendedInformation(std::list listExt); + void AddExtendedInformation(std::list listExt); // Write the xml for this issue - virtual DOMElement* WriteXML(XERCES_CPP_NAMESPACE::DOMDocument* p_resultDocument); + virtual DOMElement *WriteXML(XERCES_CPP_NAMESPACE::DOMDocument *p_resultDocument); // Returns th count of extended Informations size_t GetExtendedInformationCount() const; - + // Creates an Issue out of an XML Element - static cLocationsContainer* ParseFromXML(DOMNode* pXMLNode, DOMElement* pXMLElement); + static cLocationsContainer *ParseFromXML(DOMNode *pXMLNode, DOMElement *pXMLElement); // Sets the description - void SetDescription(const std::string& strDescription); + void SetDescription(const std::string &strDescription); // Returns the description std::string GetDescription() const; @@ -68,13 +68,13 @@ class cLocationsContainer bool HasExtendedInformations() const; // Returns all extended informations - std::list GetExtendedInformations() const; + std::list GetExtendedInformations() const; // Checks if this hassue has extended informations of a specific type - template - bool HasExtendedInformation() const + template bool HasExtendedInformation() const { - for (std::list::const_iterator itExtension = m_Extended.cbegin(); itExtension != m_Extended.cend(); itExtension++) + for (std::list::const_iterator itExtension = m_Extended.cbegin(); + itExtension != m_Extended.cend(); itExtension++) { if (T derived = dynamic_cast(*itExtension)) { @@ -85,10 +85,10 @@ class cLocationsContainer } // Returns extended informations of a specific type - template - T GetExtendedInformation() const + template T GetExtendedInformation() const { - for (std::list::const_iterator itExtension = m_Extended.cbegin(); itExtension != m_Extended.cend(); itExtension++) + for (std::list::const_iterator itExtension = m_Extended.cbegin(); + itExtension != m_Extended.cend(); itExtension++) { if (T derived = dynamic_cast(*itExtension)) return derived; @@ -97,23 +97,22 @@ class cLocationsContainer } // Returns extended informations of a specific type - template - std::size_t GetExtendedInformationCount() const + template std::size_t GetExtendedInformationCount() const { std::size_t result = 0; - for (std::list::const_iterator itExtension = m_Extended.cbegin(); itExtension != m_Extended.cend(); itExtension++) + for (std::list::const_iterator itExtension = m_Extended.cbegin(); + itExtension != m_Extended.cend(); itExtension++) { if (T derived = dynamic_cast(*itExtension)) result++; } return result; } - -protected: + + protected: std::string m_Description; - std::list m_Extended; + std::list m_Extended; }; - -#endif \ No newline at end of file +#endif diff --git a/include/common/result_format/c_parameter_container.h b/include/common/result_format/c_parameter_container.h new file mode 100644 index 00000000..cd47d9f8 --- /dev/null +++ b/include/common/result_format/c_parameter_container.h @@ -0,0 +1,114 @@ +/** + * Copyright 2023 CARIAD SE. + * + * This Source Code Form is subject to the terms of the Mozilla + * Public License, v. 2.0. If a copy of the MPL was not distributed + * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#ifndef CPARAMETER_CONTAINER_H__ +#define CPARAMETER_CONTAINER_H__ + +#include "../xml/util_xerces.h" +#include +#include +#include +#include + +class cParameterContainer +{ + public: + // c'tor + cParameterContainer(); + + static const XMLCh *TAG_PARAM; + static const XMLCh *ATTR_NAME; + static const XMLCh *ATTR_VALUE; + + // Write the xml for all parameters + virtual void WriteXML(XERCES_CPP_NAMESPACE::DOMDocument *p_resultDocument, + XERCES_CPP_NAMESPACE::DOMElement *parentElement) const; + + // Creates an Issue out of an XML Element + static void ParseFromXML(XERCES_CPP_NAMESPACE::DOMNode *pXMLNode, XERCES_CPP_NAMESPACE::DOMElement *pXMLElement, + cParameterContainer *container); + + /* + * Sets or adds a parameter with a given name for a checkerBundle + * \param name: Name of the parameter + * \param value: Value of the parameter + */ + void SetParam(const std::string &name, const std::string &value); + + /* + * Sets or adds a parameter with a given name for a checkerBundle + * \param name: Name of the parameter + * \param value: Value of the parameter + */ + void SetParam(const std::string &name, const float &value); + + /* + * Sets or adds a parameter with a given name for a checkerBundle + * \param name: Name of the parameter + * \param value: Value of the parameter + */ + void SetParam(const std::string &name, const double &value); + + /* + * Sets or adds a parameter with a given name for a checkerBundle + * \param name: Name of the parameter + * \param value: Value of the parameter + */ + void SetParam(const std::string &name, const int &value); + + /* + * Returns the paramater for a given name for a checkerBundle. If the + * value does not exist it return the default value. + * \param name: Name of the parameter + * \param defaultValue: Default value + * \returns: Value of the parameter or default value if parameter does not exist + */ + std::string GetParam(const std::string &name, const std::string &defaultValue = "") const; + + /* + * Returns true if a parameter with a name exists for a checkerBundle + * \param name: Name of the parameter + */ + bool HasParam(const std::string &name) const; + + /* + * Overwrites the current container with new parameters from anorther one. + * \param container: The container with params to overwrite + */ + void Overwrite(const cParameterContainer &container); + + /* + * Deletes a param for a checker bundle. Returns true if + * remove was successfull + * \param name: Name of the parameter + * \returns: True if deletion was successfull + */ + bool DeleteParam(const std::string &name); + + /* + * Clears all params + */ + void ClearParams(); + + // Returns all the names of the parameters + std::vector GetParams() const; + + // Returns true if params are available + bool HasParams() const; + + // Returns the amount of params + size_t CountParams() const; + + protected: + std::map m_Parameters; + + XERCES_CPP_NAMESPACE::DOMElement *CreateNode(XERCES_CPP_NAMESPACE::DOMDocument *pDOMDocResultDocument, + const std::string &name, const std::string &value) const; +}; + +#endif diff --git a/include/common/result_format/c_result_container.h b/include/common/result_format/c_result_container.h new file mode 100644 index 00000000..02b1f99f --- /dev/null +++ b/include/common/result_format/c_result_container.h @@ -0,0 +1,142 @@ +/** + * Copyright 2023 CARIAD SE. + * + * This Source Code Form is subject to the terms of the Mozilla + * Public License, v. 2.0. If a copy of the MPL was not distributed + * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#ifndef cResultContainer_h__ +#define cResultContainer_h__ + +#include +#include +#include +#include +#include + +#include "../util.h" +#include "../xml/util_xerces.h" + +#include +#include + +// Forward declaration to avoid problems with circular dependencies (especially under Linux) +class cCheckerBundle; +class cConfiguration; +class cIssue; +class cChecker; + +class cResultContainer +{ + friend class cCheckerBundle; + + public: + // c'tor + cResultContainer(); + + cResultContainer(cResultContainer &) = delete; + cResultContainer &operator=(const cResultContainer &) = delete; + + // d'tor + virtual ~cResultContainer(); + + static const XMLCh *ATTR_VERSION; + static const XMLCh *XAQR_VERSION; + + /* + Adds a result to the result list. + \param result The instance of IResult to add + */ + void AddCheckerBundle(cCheckerBundle *checkerBundleInstance); + + /* + Clears all results from the list. + Makes sure that the memory is freed after calling. + */ + void Clear(); + + /* + Writes the results to a given filename and iterated each element in the result list. + \param fileName The name of the file. + */ + void WriteResults(const std::string &strFileName) const; + + /* + Adds the results from a already existing XQAR file + \param strXmlFilePath: Path to a existing QXAR file + */ + void AddResultsFromXML(const std::string &strXmlFilePath); + + // Counts the Issues + unsigned int GetIssueCount() const; + + // Counts the Checkers + unsigned int GetCheckerCount() const; + + // Counts the Checkers + unsigned int GetCheckerBundleCount() const; + + // Returns true if the container has checker bundles + bool HasCheckerBundles() const; + + // Returns checker bundles + std::list GetCheckerBundles() const; + + // Returns the Checkers by a given checker bundle name + std::list GetCheckers(const std::string &parentCheckerBundleName); + + // Returns the Checkers by a given parent. If the parent is NULL, all available checkers will be returned. + std::list GetCheckers(cCheckerBundle *parent = 0); + + //// Returns the Issues by a given parent checker id. + std::list GetIssuesByCheckerID(const std::string &checkerID); + + // Returns the Issues by a given parent. If the parent is NULL, all available issues will be returned. + std::list GetIssues(cChecker *parent = 0) const; + + // Returns all issues form a list of checkers + std::list GetIssues(std::list checkersInput) const; + + // Returns an issue by its id + cIssue *GetIssueById(unsigned long long id) const; + + // Returns true if a xodr filename is available + bool HasXODRFileName() const; + + // Returns true if a xosc filename is available + bool HasXOSCFilePath() const; + + /* + Returns the xodr filename of the first checkerbundle. Empty string if no file name is present. + \param bRemoveExtension : True if no extension should be returned + */ + std::string GetXODRFileName(const bool bRemoveExtension = true) const; + + // Returns the xodr path of the first checkerbundle. Empty string if no file name is present. + std::string GetXODRFilePath() const; + + // Returns the xosc path of the first checkerbundle. Empty string if no file name is present. + std::string GetXOSCFilePath() const; + + // Processes every issue on every checkerbundle, checker and does a defined processing + void DoProcessing(void (*funcIteratorPtr)(cCheckerBundle *, cChecker *, cIssue *)); + + /*! + * Converts a report to a configuration + * + * \param resultConfiguration The configuration which should contain the results + */ + void ConvertReportToConfiguration(cConfiguration *resultConfiguration); + + protected: + std::list m_Bundles; + + unsigned long long m_NextFreeId = 0; + + private: + // Returns the next free ID + unsigned long long NextFreeId(); +}; + +#endif diff --git a/include/common/result_format/c_road_location.h b/include/common/result_format/c_road_location.h new file mode 100644 index 00000000..ca5dcceb --- /dev/null +++ b/include/common/result_format/c_road_location.h @@ -0,0 +1,70 @@ +/** + * Copyright 2023 CARIAD SE. + * + * This Source Code Form is subject to the terms of the Mozilla + * Public License, v. 2.0. If a copy of the MPL was not distributed + * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#ifndef cRoadLocation_h__ +#define cRoadLocation_h__ + +#include "../xml/util_xerces.h" +#include "c_extended_information.h" + +/* + * Definition of additional road location. This can be used to debug special positions + * in dbqa framework. + */ +class cRoadLocation : public cExtendedInformation +{ + + public: + static const XMLCh *TAG_NAME; + static const XMLCh *ATTR_ROAD_ID; + static const XMLCh *ATTR_S; + static const XMLCh *ATTR_T; + + /* + * Creates a new instance of cRoadLocation + * \param roadId: ID of the road in OpenDrive + * \param s: S of the road in OpenDrive + * \param t: T of the road in OpenDrive + */ + cRoadLocation(const std::string &roadId, float s = 0.0f, float t = 0.0f) : cExtendedInformation("RoadLocation") + { + m_RoadID = roadId; + m_S = s; + m_T = t; + } + + // Serialize this information + virtual XERCES_CPP_NAMESPACE::DOMElement *WriteXML(XERCES_CPP_NAMESPACE::DOMDocument *p_resultDocument); + + // Unserialize this information + static cRoadLocation *ParseFromXML(XERCES_CPP_NAMESPACE::DOMNode *pXMLNode, + XERCES_CPP_NAMESPACE::DOMElement *pXMLElement); + + // Returns the xPath + std::string GetRoadID() const; + + // Returns the road Id as integer + void GetRoadID(int &roadId) const; + + // Returns the s of the road + float GetS() const; + + // Returns the t of the road + float GetT() const; + + protected: + std::string m_RoadID; + float m_S; + float m_T; + + private: + cRoadLocation(); + cRoadLocation(const cRoadLocation &); +}; + +#endif diff --git a/include/common/result_format/c_xml_location.h b/include/common/result_format/c_xml_location.h new file mode 100644 index 00000000..9490c707 --- /dev/null +++ b/include/common/result_format/c_xml_location.h @@ -0,0 +1,64 @@ +/** + * Copyright 2023 CARIAD SE. + * + * This Source Code Form is subject to the terms of the Mozilla + * Public License, v. 2.0. If a copy of the MPL was not distributed + * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#ifndef cXMLLocation_h__ +#define cXMLLocation_h__ + +#include "../xml/util_xerces.h" +#include "c_extended_information.h" + +/* + * Definition of additional xml path location (Location of the Issue in the Xodr File) + */ +class cXMLLocation : public cExtendedInformation +{ + + public: + static const XMLCh *TAG_NAME; + static const XMLCh *ATTR_XPATH; + + /* + * Creates a new FileLocationInfo + * + */ + cXMLLocation(const std::string &xpath) : cExtendedInformation("XMLLocation") + { + m_XPath = xpath; + } + + // Serialize this information + virtual XERCES_CPP_NAMESPACE::DOMElement *WriteXML(XERCES_CPP_NAMESPACE::DOMDocument *p_resultDocument); + + // Unserialize this information + static cXMLLocation *ParseFromXML(XERCES_CPP_NAMESPACE::DOMNode *pXMLNode, + XERCES_CPP_NAMESPACE::DOMElement *pXMLElement); + + // Returns the xPath + std::string GetXPath() const; + + // Creates an XMLLocation for an OpenDRIVE road by a roadID filter + static cXMLLocation *CreateXMLLocationByRoadId(const std::string &roadId); + + // Creates an XMLLocation for the planView of an OpenDRIVE road by a roadID filter + static cXMLLocation *CreateXMLLocationByRoadIdWithPlanView(const std::string &roadId); + + // Creates an XMLLocation for the elevationProfile of an OpenDRIVE road by a roadID filter + static cXMLLocation *CreateXMLLocationByRoadIdWithElevationProfile(const std::string &roadId); + + protected: + std::string m_XPath; + + private: + cXMLLocation(); + cXMLLocation(const cXMLLocation &); + + // Creates an XPath for an OpenDRIVE road by a roadID filter + static std::stringstream CreateXPathByRoadId(const std::string &roadId); +}; + +#endif diff --git a/include/common/result_format/i_result.h b/include/common/result_format/i_result.h new file mode 100644 index 00000000..863b5559 --- /dev/null +++ b/include/common/result_format/i_result.h @@ -0,0 +1,31 @@ +/** + * Copyright 2023 CARIAD SE. + * + * This Source Code Form is subject to the terms of the Mozilla + * Public License, v. 2.0. If a copy of the MPL was not distributed + * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#ifndef _I_RESULT_H__ +#define _I_RESULT_H__ + +#include + +XERCES_CPP_NAMESPACE_USE + +class IResult +{ + public: + // Writes the result to an xml + virtual DOMElement *WriteXML(XERCES_CPP_NAMESPACE::DOMDocument *p_resultDocument) = 0; + + // True if a new Issue Id should be assigned to the entry + virtual bool AssignIssueId() = 0; + + // Sets a new issue id, if AssignIssueId returned true + virtual void SetIssueId(unsigned long long newIssueId) = 0; + + virtual ~IResult() = default; +}; + +#endif diff --git a/include/common/util.h b/include/common/util.h index e12a1f88..e6c1d250 100644 --- a/include/common/util.h +++ b/include/common/util.h @@ -9,16 +9,16 @@ #ifndef _UTIL_H__ #define _UTIL_H__ -#include +#include #include -#include +#include #include -#include #include -#include -#include -#include // explicit include necessary for Linux support +#include #include // explicit include necessary for Linux support +#include // explicit include necessary for Linux support +#include +#include #include "softwareVersion.h" @@ -28,33 +28,33 @@ #endif typedef std::pair tBoundary; -typedef std::map > tHistogram; +typedef std::map> tHistogram; // Returns the file sze of a document -std::ifstream::pos_type GetFileSize(const char* filename); +std::ifstream::pos_type GetFileSize(const char *filename); -// Returns the filename from a given path. -void GetFileName(std::string* strFilePath, const bool bRemoveExtension); +// Returns the filename from a given path. +void GetFileName(std::string *strFilePath, const bool bRemoveExtension); // Checks if a char is a double bool IsDouble(char i_chars[]); // True if strings match -bool Equals(const std::string& in1, const std::string& in2); +bool Equals(const std::string &in1, const std::string &in2); // True if strings match -bool Equals(const wchar_t* in1, const wchar_t* in2); +bool Equals(const wchar_t *in1, const wchar_t *in2); /* Computes a histogram out of given boundaries and values. - \param boundaries Given boundaries for the input vector. Have to be at least 2 values. - Format: { 1.0f, 2.0f, 3.0f } => [1.0f, 2.0f], [2.0f, 3.0f] + \param boundaries Given boundaries for the input vector. Have to be at least 2 values. + Format: { 1.0f, 2.0f, 3.0f } => [1.0f, 2.0f], [2.0f, 3.0f] \param values Values as vector */ tHistogram ComputeHistogram(const std::vector boundaries, const std::vector values); // Prints a histogram to a text -std::string PrintHistogram(const tHistogram& histogram); +std::string PrintHistogram(const tHistogram &histogram); // Returns true if a value is in a given boundary bool InBound(const tBoundary boundary, const float value); @@ -64,74 +64,70 @@ bool InBound(const tBoundary boundary, const float value); \param value value to print \param precision The number of decimal points */ -template -std::string PrintDecimalValue(const T value, const int precision = 2) +template std::string PrintDecimalValue(const T value, const int precision = 2) { - std::ostringstream out; - out.setf(std::ios::fixed); - out.precision(precision); - out << value; - return out.str(); + std::ostringstream out; + out.setf(std::ios::fixed); + out.precision(precision); + out << value; + return out.str(); } // Returns true if a string has a certain ending -bool StringEndsWith(const std::string& value, const std::string& ending); +bool StringEndsWith(const std::string &value, const std::string &ending); /* Simple method to concatenate strings */ -template -std::string ToString(T val) +template std::string ToString(T val) { - std::stringstream out; - out << val; - return out.str(); + std::stringstream out; + out << val; + return out.str(); } /* Simple method to concatenate strings */ -template -std::string ToString(T val, Args... args) +template std::string ToString(T val, Args... args) { - // recursive variadic function - std::stringstream out; - out << val << ToString(args...); - return out.str(); + // recursive variadic function + std::stringstream out; + out << val << ToString(args...); + return out.str(); } // Joins a collection by some string and returns the result. -template -std::string Join(const T& v, const std::string& delim) +template std::string Join(const T &v, const std::string &delim) { - std::ostringstream s; - for (const auto& i : v) - { - if (&i != &v[0]) - { - s << delim; - } - s << i; - } - return s.str(); + std::ostringstream s; + for (const auto &i : v) + { + if (&i != &v[0]) + { + s << delim; + } + s << i; + } + return s.str(); } // Converts a string to lower case -std::string ToLower(const std::string& source); +std::string ToLower(const std::string &source); // Converts a string to upper case -std::string ToUpper(const std::string& source); +std::string ToUpper(const std::string &source); // Checks if a file at a certain path exists bool CheckIfFileExists(std::string filePath, const bool printLog = true); // Replaced a string in anorther string -bool Replace(std::string& str, const std::string& from, const std::string& to); +bool Replace(std::string &str, const std::string &from, const std::string &to); // Returns true if the string is a number -bool IsNumber(const std::string& input); +bool IsNumber(const std::string &input); // parse an XOSC file to get the XODR path -bool GetXodrFilePathFromXosc(const std::string xoscFilePath, std::string& strPathOut); +bool GetXodrFilePathFromXosc(const std::string xoscFilePath, std::string &strPathOut); -#endif \ No newline at end of file +#endif diff --git a/include/common/xml/cXPathEvaluator.h b/include/common/xml/cXPathEvaluator.h deleted file mode 100644 index 39b2c8be..00000000 --- a/include/common/xml/cXPathEvaluator.h +++ /dev/null @@ -1,98 +0,0 @@ -/** - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -#ifndef _cXPathEvaluator_H__ -#define _cXPathEvaluator_H__ - -#include -#include -#include -#include -#include -#include - -#include - -class cXPathEvaluator -{ -public: - - /*! - * Constructor creates the basic query object for the xpath evaluation. - */ - cXPathEvaluator(); - - /*! - * Basic destructor. - */ - virtual ~cXPathEvaluator(); - - /*! - * Set the xml content for the xpath evaluation: - * - Read xml content from file - * - Annotate content with row information --> extended xml content - * - Set the extended xml content as focus of the xpath evaluation - * - * \param xmlFilePath: path to the xml file - * \return: true, if no error occured - */ - bool SetXmlContent(const QString xmlFilePath); - - /*! - * Evaluate the xpath expression on the given xml content (see: SetXmlContent) and return the affected rows. - * - * \param xpath: xpath expression for the evaluation - * \param rows: out parameter: vector of all affected rows of the xpath evaluation - * \return: true, if no error occured - */ - bool GetAffectedRowsOfXPath(const QString xpath, QVector& rows); - -protected: - - /*! - * Query for the xpath evaluation. - */ - QXmlQuery query{QXmlQuery::XQuery10}; - - /*! - * Read DOM document from xml file. - * - * \param xmlFilePath: path to the xml file - * \param domDocument: out parameter: DOM document - * \return: true, if no error occured - */ - static bool ReadDOMFromFile(const QString xmlFilePath, QDomDocument& domDocument); - - /*! - * Annotate row information on all child elements of the given DOM element. - * Hint: This method is recursive. All childs of childs are affected. - * - * \param domElement: DOM element - */ - static void SetAnnotatedRowsOnChildElements(QDomElement domElement); - - /*! - * Get the row information of every top level element of the xml content. - * - * \param xml: xml content - * \param rows: out parameter: vector of all rows of the top level elements - * \return: true, if no error occured - */ - static bool GetAnnotatedRowsOfRootElements(const QString xml, QVector& rows); - - /*! - * Evaluate the xpath expression on the given xml content (see: SetXmlContent) and return the xml result. - * - * \param xpath: xpath expression for the evaluation - * \param xmlResult: xml result - * \return: true, if no error occured - */ - bool GetXmlResultOfXPath(const QString xpath, QString& xmlResult); -}; - -#endif \ No newline at end of file diff --git a/include/common/xml/c_x_path_evaluator.h b/include/common/xml/c_x_path_evaluator.h new file mode 100644 index 00000000..9760316c --- /dev/null +++ b/include/common/xml/c_x_path_evaluator.h @@ -0,0 +1,96 @@ +/** + * Copyright 2023 CARIAD SE. + * + * This Source Code Form is subject to the terms of the Mozilla + * Public License, v. 2.0. If a copy of the MPL was not distributed + * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#ifndef _cXPathEvaluator_H__ +#define _cXPathEvaluator_H__ + +#include +#include +#include +#include +#include +#include + +#include + +class cXPathEvaluator +{ + public: + /*! + * Constructor creates the basic query object for the xpath evaluation. + */ + cXPathEvaluator(); + + /*! + * Basic destructor. + */ + virtual ~cXPathEvaluator(); + + /*! + * Set the xml content for the xpath evaluation: + * - Read xml content from file + * - Annotate content with row information --> extended xml content + * - Set the extended xml content as focus of the xpath evaluation + * + * \param xmlFilePath: path to the xml file + * \return: true, if no error occured + */ + bool SetXmlContent(const QString xmlFilePath); + + /*! + * Evaluate the xpath expression on the given xml content (see: SetXmlContent) and return the affected rows. + * + * \param xpath: xpath expression for the evaluation + * \param rows: out parameter: vector of all affected rows of the xpath evaluation + * \return: true, if no error occured + */ + bool GetAffectedRowsOfXPath(const QString xpath, QVector &rows); + + protected: + /*! + * Query for the xpath evaluation. + */ + QXmlQuery query{QXmlQuery::XQuery10}; + + /*! + * Read DOM document from xml file. + * + * \param xmlFilePath: path to the xml file + * \param domDocument: out parameter: DOM document + * \return: true, if no error occured + */ + static bool ReadDOMFromFile(const QString xmlFilePath, QDomDocument &domDocument); + + /*! + * Annotate row information on all child elements of the given DOM element. + * Hint: This method is recursive. All childs of childs are affected. + * + * \param domElement: DOM element + */ + static void SetAnnotatedRowsOnChildElements(QDomElement domElement); + + /*! + * Get the row information of every top level element of the xml content. + * + * \param xml: xml content + * \param rows: out parameter: vector of all rows of the top level elements + * \return: true, if no error occured + */ + static bool GetAnnotatedRowsOfRootElements(const QString xml, QVector &rows); + + /*! + * Evaluate the xpath expression on the given xml content (see: SetXmlContent) and return the xml result. + * + * \param xpath: xpath expression for the evaluation + * \param xmlResult: xml result + * \return: true, if no error occured + */ + bool GetXmlResultOfXPath(const QString xpath, QString &xmlResult); +}; + +#endif diff --git a/include/common/xml/utilXerces.h b/include/common/xml/util_xerces.h similarity index 86% rename from include/common/xml/utilXerces.h rename to include/common/xml/util_xerces.h index f313baa2..c0fc3797 100644 --- a/include/common/xml/utilXerces.h +++ b/include/common/xml/util_xerces.h @@ -12,7 +12,7 @@ #include // This is necessary for linux support -#define CONST_XMLCH(s) reinterpret_cast(u ## s) +#define CONST_XMLCH(s) reinterpret_cast(u##s) static_assert(sizeof(::XMLCh) == sizeof(char16_t), "XMLCh is not sized correctly for UTF-16."); -#endif \ No newline at end of file +#endif diff --git a/include/common/xsd/cOSCSchemaChecker.h b/include/common/xsd/cOSCSchemaChecker.h deleted file mode 100644 index e1a7dd70..00000000 --- a/include/common/xsd/cOSCSchemaChecker.h +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -#ifndef cOSCSchemaChecker_h__ -#define cOSCSchemaChecker_h__ - -#include "cParserErrorHandler.h" -#include "common/qc4openx_filesystem.h" -#include "common/result_format/cChecker.h" -#include "common/result_format/cCheckerBundle.h" -#include "common/result_format/cFileLocation.h" -#include "common/result_format/cLocationsContainer.h" -#include "common/result_format/cResultContainer.h" -#include "common/util.h" - -#include -#include -#include -#include - -class OSCSchemaChecker { -private: - cResultContainer* pResultContainer; - cCheckerBundle* pXSDCheckerBundle; - std::string checkerBundleName; - cParameterContainer inputParams; - std::string xoscFilePath; - std::map> versionToXsdFile; - std::list unsupportedVersions; - -public: - OSCSchemaChecker() - { - } - OSCSchemaChecker(const std::string& name, - cParameterContainer params, - std::map> versionMap) - : checkerBundleName(name), inputParams(params), versionToXsdFile(versionMap) - { - Init(); - } - ~OSCSchemaChecker() - { - } - void Init(); - bool RunChecks(); - bool ValidateXSD(const std::list& lSchemaFiles); - bool ExtractXOSCVersion(unsigned* i_uRevMajor, unsigned* i_uRevMinor); - void WriteEmptyReport(); -}; - -#endif \ No newline at end of file diff --git a/include/common/xsd/cParserErrorHandler.h b/include/common/xsd/cParserErrorHandler.h deleted file mode 100644 index e98f3280..00000000 --- a/include/common/xsd/cParserErrorHandler.h +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -#ifndef cParserErrorHandler_h__ -#define cParserErrorHandler_h__ - -#include "common/util.h" - -#define SAX_EXPORT -#include "common/result_format/cIssue.h" - -#include -#include - -class cCheckerBundle; - -class cParserErrorHandler : public ErrorHandler { -private: - cCheckerBundle* myCheckerBundle; - const char* myFilePath; - - void reportParseException(const SAXParseException& ex); - - void reportParseIssue(const SAXParseException& ex, eIssueLevel issueLevel); - -public: - cParserErrorHandler() = default; - virtual ~cParserErrorHandler() = default; - - cParserErrorHandler(cCheckerBundle* myCheckerBundle, const char* filePath); - - void warning(const SAXParseException& ex); - void error(const SAXParseException& ex); - void fatalError(const SAXParseException& ex); - void resetErrors(); -}; - -#endif \ No newline at end of file diff --git a/include/viewer/iConnector.h b/include/viewer/iConnector.h deleted file mode 100644 index d07fa0e9..00000000 --- a/include/viewer/iConnector.h +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -#ifndef _CONNECTOR_H_ -#define _CONNECTOR_H_ - -#ifdef WIN32 -#define EXPORT_VIEWER __declspec(dllexport) -#else // WIN32 -#define EXPORT_VIEWER __attribute__((visibility("default"))) -#endif // WIN32 - -#define VIEWER EXPORT_VIEWER - -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Is called if the viewer application should be startet from main menu -**/ -VIEWER bool StartViewer(); - -/** -* Does the initialization with xosc file of an viewer -* \param xoscPath Path to an xosc file -**/ -VIEWER bool Initialize(const char* xoscPath, const char* xodrPath); - -/** -* Is called if an issues has to be added. -* \param issueToAdd The item which should be added. Pointer to a cIssue class. -**/ -VIEWER bool AddIssue(void * issueToAdd); - -/** -* Is called if an issues has to be showed. -* \param itemToShow The item which should be showed. Pointer to a cIssue class. -* \param locationToShow The location where to show the issue. Pointer to a cLocationsContainer class -**/ -VIEWER bool ShowIssue(void * itemToShow, void* locationToShow); - -/** -* Returns the name of the viewer. -**/ -VIEWER const char* GetName(); - -/** -* Is called if the viewer application should be closed -**/ -VIEWER bool CloseViewer(); - -/** -* Returns the last error message stored by the viewer. -**/ -VIEWER const char* GetLastErrorMessage(); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/include/viewer/i_connector.h b/include/viewer/i_connector.h new file mode 100644 index 00000000..be7473bf --- /dev/null +++ b/include/viewer/i_connector.h @@ -0,0 +1,68 @@ +/** + * Copyright 2023 CARIAD SE. + * + * This Source Code Form is subject to the terms of the Mozilla + * Public License, v. 2.0. If a copy of the MPL was not distributed + * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#ifndef _CONNECTOR_H_ +#define _CONNECTOR_H_ + +#ifdef WIN32 +#define EXPORT_VIEWER __declspec(dllexport) +#else // WIN32 +#define EXPORT_VIEWER __attribute__((visibility("default"))) +#endif // WIN32 + +#define VIEWER EXPORT_VIEWER + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * Is called if the viewer application should be startet from main menu + **/ + VIEWER bool StartViewer(); + + /** + * Does the initialization with xosc file of an viewer + * \param xoscPath Path to an xosc file + **/ + VIEWER bool Initialize(const char *xoscPath, const char *xodrPath); + + /** + * Is called if an issues has to be added. + * \param issueToAdd The item which should be added. Pointer to a cIssue class. + **/ + VIEWER bool AddIssue(void *issueToAdd); + + /** + * Is called if an issues has to be showed. + * \param itemToShow The item which should be showed. Pointer to a cIssue class. + * \param locationToShow The location where to show the issue. Pointer to a cLocationsContainer class + **/ + VIEWER bool ShowIssue(void *itemToShow, void *locationToShow); + + /** + * Returns the name of the viewer. + **/ + VIEWER const char *GetName(); + + /** + * Is called if the viewer application should be closed + **/ + VIEWER bool CloseViewer(); + + /** + * Returns the last error message stored by the viewer. + **/ + VIEWER const char *GetLastErrorMessage(); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/pull_request_template.md b/pull_request_template.md new file mode 100644 index 00000000..b2d6186e --- /dev/null +++ b/pull_request_template.md @@ -0,0 +1,14 @@ +**Description** + +A brief description of the PR. + +**Main changes** +1. First change +2. Second change + +**How was the PR tested?** +1. Unit-test with some sample data. All unit tests passed. +2. Print output values. The printed outputs look reasonable. +3. Executed container locally and it worked. + +**Notes** diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a8366fe4..7adab0b9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -8,45 +8,10 @@ set(CMAKE_INSTALL_RPATH $ORIGIN/../lib) add_subdirectory(common) add_subdirectory(report_modules) -add_subdirectory(checker_bundles) add_subdirectory(result_pooling) add_subdirectory(runtime) -if (WIN32) - ## copy batch scripts - install( - FILES - CheckXodr.bat - CheckXosc.bat - DESTINATION - ${CMAKE_INSTALL_PREFIX}/bin - ) -else(WIN32) - ## copy shell scripts - install( - FILES - CheckXodr.sh - CheckXosc.sh - DESTINATION - ${CMAKE_INSTALL_PREFIX}/bin - PERMISSIONS - OWNER_EXECUTE OWNER_WRITE OWNER_READ - GROUP_EXECUTE GROUP_WRITE GROUP_READ - WORLD_EXECUTE WORLD_WRITE WORLD_READ - ) -endif(WIN32) - # FIXME: install()? -## copy default configs -file( - COPY "${CMAKE_CURRENT_SOURCE_DIR}/DefaultXoscConfiguration.xml" - DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/ - ) -file( - COPY "${CMAKE_CURRENT_SOURCE_DIR}/DefaultXodrConfiguration.xml" - DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/ - ) - ## copy common lib file( COPY "${PROJECT_SOURCE_DIR}/include" @@ -68,11 +33,6 @@ file( DESTINATION ${CMAKE_INSTALL_PREFIX}/src/common PATTERN "*.svn" EXCLUDE ) -file( - COPY "${CMAKE_CURRENT_SOURCE_DIR}/common/src/xsd" - DESTINATION ${CMAKE_INSTALL_PREFIX}/src/common - PATTERN "*.svn" EXCLUDE - ) # FIXME: No cpp file file( COPY "${CMAKE_CURRENT_SOURCE_DIR}/common/src/util.cpp" diff --git a/src/CheckXodr.bat b/src/CheckXodr.bat deleted file mode 100644 index ef17ba38..00000000 --- a/src/CheckXodr.bat +++ /dev/null @@ -1,93 +0,0 @@ -:: Copyright 2023 CARIAD SE. -:: -:: This Source Code Form is subject to the terms of the Mozilla -:: Public License, v. 2.0. If a copy of the MPL was not distributed -:: with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - -@echo off - -REM Get current directory where script lies -set INSTALL_DIR=%~dp0 - -echo. -echo ============================= -echo QChecker for OpenX (QC4OpenX) -echo ============================= - -if "%~1" == "" ( - echo Syntax: - echo. - echo CheckXODR.bat myXodrFileToCheck.xodr - echo. - echo. - pause - exit -) - -set XODR_FILE=%1 -if not exist %XODR_FILE% ( - echo File %XODR_FILE% does not exist. - echo. - echo. - pause - exit -) - -set XODR_FILE_EXTENSION=%~x1 -if /I not %XODR_FILE_EXTENSION% == .xodr ( - echo File %XODR_FILE% is no XODR file. - echo. - echo. - pause - exit -) - -echo. -echo ========================================= -echo == Configuration -echo ========================================= -echo Check: %XODR_FILE% -echo. -echo Delete all .xqar Files: -del /s /q /f *.xqar -echo. -echo. - -echo ========================================= -echo == XODR schema check -echo ========================================= -%INSTALL_DIR%/XodrSchemaChecker.exe %XODR_FILE% -if ERRORLEVEL == 1 ( - echo Schema is not valid. Will skip any other checks. - pause - exit 1 -) -echo. -echo ========================================= -echo == Pool results -echo ========================================= -%INSTALL_DIR%/ResultPooling.exe / -echo. -echo. - -echo ========================================= -echo == Generate text report -echo ========================================= -%INSTALL_DIR%/TextReport.exe Result.xqar -echo. -echo. -echo ========================================= -echo == Open text report -echo ========================================= -start Report.txt -echo. -echo. -echo ========================================= -echo == Open text report with ui -echo ========================================= -%INSTALL_DIR%/ReportGUI.exe Result.xqar - -echo. -echo. -echo Finished all. -echo. \ No newline at end of file diff --git a/src/CheckXodr.sh b/src/CheckXodr.sh deleted file mode 100644 index a072fc16..00000000 --- a/src/CheckXodr.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/bash -# Copyright 2023 CARIAD SE. -# -# This Source Code Form is subject to the terms of the Mozilla -# Public License, v. 2.0. If a copy of the MPL was not distributed -# with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - - -function pause(){ - read -p "Press [Enter] key to continue ..." -} - -# Get current directory where script lies -INSTALL_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -echo -echo ============================= -echo QChecker for OpenX - QC4OpenX -echo ============================= - -if [ ! $1 ]; then - echo Syntax: - echo - echo CheckXODR.sh myXodrFileToCheck.xodr - echo - echo - pause - exit -fi - -XODR_FILE=$1 -if [ ! -f "$XODR_FILE" ]; then - echo File $XODR_FILE does not exist. - echo - echo - pause - exit -fi - -if [[ ! ${XODR_FILE,,} =~ \.xodr$ ]]; then - echo File $XODR_FILE is no XODR file. - echo - echo - pause - exit -fi - -echo -echo ========================================= -echo == Configuration -echo ========================================= -echo Check: $XODR_FILE -echo -echo Delete all .xqar Files: -find . -name "*.xqar" -type f -delete -print -echo -echo - -echo ========================================= -echo == XODR schema check -echo ========================================= -$INSTALL_DIR/XodrSchemaChecker $XODR_FILE -if [ $? != 0 ]; then - echo Schema is not valid. Will skip any other checks. - pause - exit 1 -fi -echo -echo - -echo ========================================= -echo == Pool results -echo ========================================= -$INSTALL_DIR/ResultPooling -echo -echo - -echo ========================================= -echo == Generate text report -echo ========================================= -$INSTALL_DIR/TextReport Result.xqar - -echo -echo -echo Finished all. -echo diff --git a/src/CheckXosc.bat b/src/CheckXosc.bat deleted file mode 100644 index ed8b200d..00000000 --- a/src/CheckXosc.bat +++ /dev/null @@ -1,93 +0,0 @@ -:: Copyright 2023 CARIAD SE. -:: -:: This Source Code Form is subject to the terms of the Mozilla -:: Public License, v. 2.0. If a copy of the MPL was not distributed -:: with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - -@echo off - -REM Get current directory where script lies -set INSTALL_DIR=%~dp0 - -echo. -echo ============================= -echo QChecker for OpenX (QC4OpenX) -echo ============================= - -if "%~1" == "" ( - echo Syntax: - echo. - echo CheckXOSC.bat myXoscFileToCheck.xosc - echo. - echo. - pause - exit -) - -set XOSC_FILE=%1 -if not exist %XOSC_FILE% ( - echo File %XOSC_FILE% does not exist. - echo. - echo. - pause - exit -) - -set XOSC_FILE_EXTENSION=%~x1 -if /I not %XOSC_FILE_EXTENSION% == .xosc ( - echo File %XOSC_FILE% is no XOSC file. - echo. - echo. - pause - exit -) - -echo. -echo ========================================= -echo == Configuration -echo ========================================= -echo Check: %XOSC_FILE% -echo. -echo Delete all .xqar Files: -del /s /q /f *.xqar -echo. -echo. - -echo ========================================= -echo == XOSC schema check -echo ========================================= -%INSTALL_DIR%/XoscSchemaChecker.exe %XOSC_FILE% -if ERRORLEVEL == 1 ( - echo Schema is not valid. Will skip any other checks. - pause - exit 1 -) -echo. -echo ========================================= -echo == Pool results -echo ========================================= -%INSTALL_DIR%/ResultPooling.exe / -echo. -echo. - -echo ========================================= -echo == Generate text report -echo ========================================= -%INSTALL_DIR%/TextReport.exe Result.xqar -echo. -echo. -echo ========================================= -echo == Open text report -echo ========================================= -start Report.txt -echo. -echo. -echo ========================================= -echo == Open text report with ui -echo ========================================= -%INSTALL_DIR%/ReportGUI.exe Result.xqar - -echo. -echo. -echo Finished all. -echo. \ No newline at end of file diff --git a/src/CheckXosc.sh b/src/CheckXosc.sh deleted file mode 100644 index 8aec8c1a..00000000 --- a/src/CheckXosc.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/bash -# Copyright 2023 CARIAD SE. -# -# This Source Code Form is subject to the terms of the Mozilla -# Public License, v. 2.0. If a copy of the MPL was not distributed -# with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - - -function pause(){ - read -p "Press [Enter] key to continue ..." -} - -# Get current directory where script lies -INSTALL_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -echo ============================= -echo QChecker for OpenX - QC4OpenX -echo ============================= -echo - -if [ ! $1 ]; then - echo Syntax: - echo - echo CheckXOSC.sh myXoscFileToCheck.xosc - echo - echo - pause - exit -fi - -XOSC_FILE=$1 -if [ ! -f "$XOSC_FILE" ]; then - echo File $XOSC_FILE does not exist. - echo - echo - pause - exit -fi - -if [[ ! ${XOSC_FILE,,} =~ \.xosc$ ]]; then - echo File $XOSC_FILE is no XOSC file. - echo - echo - pause - exit -fi - -echo -echo ========================================= -echo == Configuration -echo ========================================= -echo Check: $XOSC_FILE -echo -echo Delete all .xqar Files: -find . -name "*.xqar" -type f -delete -print -echo -echo - -echo ========================================= -echo == XOSC schema check -echo ========================================= -$INSTALL_DIR/XoscSchemaChecker $XOSC_FILE -if [ $? != 0 ]; then - echo Schema is not valid. Will skip any other checks. - pause - exit 1 -fi -echo -echo ========================================= -echo == Pool results -echo ========================================= -$INSTALL_DIR/ResultPooling -echo -echo - -echo ========================================= -echo == Generate text report -echo ========================================= -$INSTALL_DIR/TextReport Result.xqar -echo -echo - -echo -echo -echo Finished all. -echo diff --git a/src/DefaultXodrConfiguration.xml b/src/DefaultXodrConfiguration.xml deleted file mode 100644 index 1eafe01c..00000000 --- a/src/DefaultXodrConfiguration.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/DefaultXoscConfiguration.xml b/src/DefaultXoscConfiguration.xml deleted file mode 100644 index 81333f53..00000000 --- a/src/DefaultXoscConfiguration.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/checker_bundles/CMakeLists.txt b/src/checker_bundles/CMakeLists.txt deleted file mode 100644 index 33982d90..00000000 --- a/src/checker_bundles/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright 2023 CARIAD SE. -# -# This Source Code Form is subject to the terms of the Mozilla -# Public License, v. 2.0. If a copy of the MPL was not distributed -# with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - -add_subdirectory(xodr_schema) -add_subdirectory(xosc_schema) \ No newline at end of file diff --git a/src/checker_bundles/xodr_schema/CMakeLists.txt b/src/checker_bundles/xodr_schema/CMakeLists.txt deleted file mode 100644 index f3f091cc..00000000 --- a/src/checker_bundles/xodr_schema/CMakeLists.txt +++ /dev/null @@ -1,72 +0,0 @@ -# Copyright 2023 CARIAD SE. -# -# This Source Code Form is subject to the terms of the Mozilla -# Public License, v. 2.0. If a copy of the MPL was not distributed -# with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - -set(CHECKER_BUNDLE_XODR_SCHEMA "XodrSchemaChecker") -project(${CHECKER_BUNDLE_XODR_SCHEMA}) - -add_executable(${CHECKER_BUNDLE_XODR_SCHEMA} - src/stdafx.h - src/stdafx.cpp - src/staticODRChecks.h - src/staticODRChecks.cpp - src/xsd/cParserErrorHandler.h - src/xsd/cParserErrorHandler.cpp -) - -target_link_libraries(${CHECKER_BUNDLE_XODR_SCHEMA} PRIVATE qc4openx-common) - -install(TARGETS ${CHECKER_BUNDLE_XODR_SCHEMA} DESTINATION bin) -qc4openx_install_qt(bin ${CHECKER_BUNDLE_XODR_SCHEMA}${CMAKE_EXECUTABLE_SUFFIX}) - -#################################################################################################### -############################### Find supported opendrive schema files ############################## -#################################################################################################### -set(ASAM_OPENDRIVE_XSD_DIR "" CACHE PATH "Directory containing the ASAM OpenDRIVE schema files (*.xsd)") -if (NOT ASAM_OPENDRIVE_XSD_DIR) - message(FATAL_ERROR "ASAM_OPENDRIVE_XSD_DIR must be set!") -endif() - -file(GLOB_RECURSE schema_files "${ASAM_OPENDRIVE_XSD_DIR}/*.xsd") -if (NOT schema_files) - message(FATAL_ERROR "No OpenDRIVE schema files found in ASAM_OPENDRIVE_XSD_DIR: ${ASAM_OPENDRIVE_XSD_DIR}") -endif () - -set(found_schema_versions) -set(found_schema_files) -set(vires_xodr_version_regex - "^.*Definition for OpenDRIVE XML files \- Rev\. ([0-9]+\.[0-9]+[A-Z]*).*") -set(asam_xodr_version_regex "^.*ASAM OpenDRIVE V([0-9]+\.[0-9]+\.[0-9]+)") - -message("-- Finding OpenDRIVE schema files in ${ASAM_OPENDRIVE_XSD_DIR}") -list(APPEND CMAKE_MESSAGE_INDENT "-- ") -foreach(schema_file ${schema_files}) - file(STRINGS "${schema_file}" schema_file_content) - # Check each line for a matching version - foreach(line ${schema_file_content}) - # Vires xodr schema files are delivered as one file - string(REGEX MATCH "${vires_xodr_version_regex}" _ ${line}) - if(NOT CMAKE_MATCH_1) - # ASAM xodr schema files are delivered as multiple files - string(REGEX MATCH "${asam_xodr_version_regex}" _ ${line}) - endif() - - if(CMAKE_MATCH_1) - list(APPEND found_schema_versions ${CMAKE_MATCH_1}) - list(APPEND found_schema_files "${schema_file}") - message("Found version ${CMAKE_MATCH_1}: ${schema_file}") - install(FILES "${schema_file}" DESTINATION bin/xsd/xodr/${CMAKE_MATCH_1}) - break() - endif() - endforeach() -endforeach() - -list(POP_BACK CMAKE_MESSAGE_INDENT) -if (NOT found_schema_files) - message(FATAL_ERROR "No OpenDRIVE schema files found in ASAM_OPENDRIVE_XSD_DIR: ${ASAM_OPENDRIVE_XSD_DIR}") -endif () - -# Without the trailing slash, the parent dir would be copied as well (so leave it!) -set_target_properties(${CHECKER_BUNDLE_XODR_SCHEMA} PROPERTIES FOLDER checker_bundles) diff --git a/src/checker_bundles/xodr_schema/src/staticODRChecks.cpp b/src/checker_bundles/xodr_schema/src/staticODRChecks.cpp deleted file mode 100644 index 37557b9c..00000000 --- a/src/checker_bundles/xodr_schema/src/staticODRChecks.cpp +++ /dev/null @@ -1,400 +0,0 @@ -/* - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ -#include "stdafx.h" -#include "staticODRChecks.h" -#include "common/result_format/cChecker.h" -#include "common/result_format/cCheckerBundle.h" -#include "common/result_format/cResultContainer.h" -#include "common/result_format/cLocationsContainer.h" -#include "common/result_format/cFileLocation.h" -#include "common/result_format/cParameterContainer.h" - -#include "common/config_format/cConfiguration.h" -#include "common/config_format/cConfigurationChecker.h" -#include "common/config_format/cConfigurationCheckerBundle.h" -#include "xsd/cParserErrorHandler.h" - -XERCES_CPP_NAMESPACE_USE - -cResultContainer* pResultContainer; -cCheckerBundle* pXSDCheckerBundle; - -XERCES_CPP_NAMESPACE_USE - -// Main Programm -int main(int argc, char* argv[]) -{ - std::string strToolpath = argv[0]; - - if (argc != 2) - { - ShowHelp(strToolpath); - - if (argc < 2) - return 0; - else - return -1; - } - - QCoreApplication app(argc, argv); - - XMLPlatformUtils::Initialize(); - - std::string strFilepath = argv[1]; - - std::stringstream ssResultFile; - ssResultFile << CHECKER_BUNDLE_NAME << ".xqar"; - - cParameterContainer inputParams; - - // Default parameters - inputParams.SetParam("strResultFile", ssResultFile.str()); - - if (StringEndsWith(ToLower(strFilepath), ".xodr")) - { - inputParams.SetParam("XodrFile", strFilepath); - } - else if (StringEndsWith(ToLower(strFilepath), ".xml")) - { - cConfiguration configuration; - - std::cout << "Config: " << strFilepath << std::endl; - if (!cConfiguration::ParseFromXML(&configuration, strFilepath)) - { - std::cerr << "Could not read configuration! Abort." << std::endl; - return -1; - } - - inputParams.Overwrite(configuration.GetParams()); - - cConfigurationCheckerBundle* checkerBundleConfig = configuration.GetCheckerBundleByName(CHECKER_BUNDLE_NAME); - if (nullptr != checkerBundleConfig) - inputParams.Overwrite(checkerBundleConfig->GetParams()); - else - std::cerr << "No configuration for module '" << CHECKER_BUNDLE_NAME << "' found. Start with default params." << std::endl; - - // We do no OpenSCENARIO validation - inputParams.DeleteParam("XoscFile"); - } - else if (StringEndsWith(ToLower(strFilepath), "--defaultconfig")) - { - WriteEmptyReport(); - return 0; - } - else if (strcmp(strFilepath.c_str(), "-h") == 0 || strcmp(strFilepath.c_str(), "--help") == 0) - { - ShowHelp(strToolpath); - return 0; - } - else - { - ShowHelp(strToolpath); - return -1; - } - - bool bXODRValid = RunChecks(inputParams); - exit(bXODRValid ? 0 : 1); -} - -void ShowHelp(const std::string& toolPath) -{ - std::string applicationName = toolPath; - std::string applicationNameWithoutExt = toolPath; - GetFileName(&applicationName, false); - GetFileName(&applicationNameWithoutExt, true); - - std::cout << "\n\nUsage of " << applicationNameWithoutExt << ":" << std::endl; - std::cout << "\nRun the application with xodr file: \n" << applicationName << " sample.xodr" << std::endl; - std::cout << "\nRun the application with dbqa configuration: \n" << applicationName << " config.xml" << std::endl; - std::cout << "\nRun the application and write empty report as default configuration: \n" << applicationName << " --defaultconfig" << std::endl; - std::cout << "\n\n"; -} - -bool ValidateXSD(cCheckerBundle* pBundleSummary, const std::string& strSchemaFilePath, - const char* strXodrFilePath, unsigned int& numOfIdentityConstraintKeyErrors) -{ - // Remove xml namespace, if present, because the validation expects files without xml namespace - bool use_temp_file = true; - auto time_now = std::chrono::system_clock::now().time_since_epoch(); - auto millis = std::chrono::duration_cast(time_now).count(); - const std::string temp_file = "temp_" + std::to_string(millis) + ".xodr"; - std::ifstream input_file_stream(strXodrFilePath); - std::ofstream temp_file_stream(temp_file); - std::string line; - while (std::getline(input_file_stream, line) && use_temp_file) { - if (line.find("CreateChecker("xsdSchemaChecker", "Checks the validity of an OpenDRIVE."); - - std::stringstream ssErrorDesc; - ssErrorDesc << "Schema file '" << strSchemaFilePath << "'could not be loaded. Abort schema verifcation with error."; - - pXSDParserChecker->AddIssue(new cIssue(ssErrorDesc.str(), ERROR_LVL)); - pXSDParserChecker->UpdateSummary(); - - return false; - } - - cParserErrorHandler parserErrorHandler(pBundleSummary, strXodrFilePath); - - domParser.setErrorHandler(&parserErrorHandler); - domParser.setValidationScheme(XercesDOMParser::Val_Always); - domParser.setDoNamespaces(true); - domParser.setDoSchema(true); - domParser.setValidationSchemaFullChecking(true); - domParser.setExternalNoNamespaceSchemaLocation(strSchemaFilePath.c_str()); - - if (use_temp_file) { - domParser.parse(temp_file.c_str()); - } - else { - domParser.parse(strXodrFilePath); - } - std::remove(temp_file.c_str()); - - if (domParser.getErrorCount() != 0) - validationSuccessfull = false; - numOfIdentityConstraintKeyErrors = parserErrorHandler.GetNumberOfIdentityConstraintKeyError(); - - return validationSuccessfull; -} - -bool RunChecks(const cParameterContainer& inputParams) -{ - pResultContainer = new cResultContainer(); - // Use this constructor because it sets build date and build version - pXSDCheckerBundle = new cCheckerBundle(CHECKER_BUNDLE_NAME, "", ""); - - pXSDCheckerBundle->SetParam("strResultFile", inputParams.GetParam("strResultFile")); - pResultContainer->AddCheckerBundle(pXSDCheckerBundle); - - std::map versionToXSDFile = { - {"1.1", GetApplicationDir() + "/xsd/xodr/1.1/OpenDRIVE_1.1.xsd"}, - {"1.2", GetApplicationDir() + "/xsd/xodr/1.2/OpenDRIVE_1.2.xsd"}, - {"1.3", GetApplicationDir() + "/xsd/xodr/1.3D/OpenDRIVE_1.3.xsd"}, - {"1.4", GetApplicationDir() + "/xsd/xodr/1.4H/OpenDRIVE_1.4H.xsd"}, - {"1.5", GetApplicationDir() + "/xsd/xodr/1.5M/OpenDRIVE_1.5M.xsd"}, - {"1.6", GetApplicationDir() + "/xsd/xodr/1.6.1/opendrive_16_core.xsd"}, - {"1.7", GetApplicationDir() + "/xsd/xodr/1.7.0/opendrive_17_core.xsd"} - }; - - bool bXODRValid = false; - std::string xodrFilePath = inputParams.GetParam("XodrFile"); - std::string xodrFileName = xodrFilePath; - GetFileName(&xodrFileName, false); - - try - { - unsigned revMinorHeader = 4; - unsigned revMajorHeader = 1; - std::stringstream ssVersionString; - std::string strVersionString; - - std::cout << "Check: '" << xodrFileName.c_str() << "'" << std::endl << std::endl; - - bXODRValid = ExtractXODRVersion(pXSDCheckerBundle, xodrFilePath.c_str(), &revMinorHeader, &revMajorHeader); - - ssVersionString << revMajorHeader << "." << revMinorHeader; - strVersionString = ssVersionString.str(); - - std::cout << "Found OpenDRIVE version: " << strVersionString << ". "; - - // Check if we have a xsd file for the version - if (versionToXSDFile.find(strVersionString.c_str()) != versionToXSDFile.end()) - { - std::string strVersionFileName = versionToXSDFile.at(strVersionString).filename().string(); - - std::cout << "Use schema file " << strVersionFileName << " for validation." << std::endl << std::endl; - std::cout << "Validate..." << std::endl; - unsigned int numOfIdentityConstraintKeyErrors = 0; - // Validate XML with schema file - ValidateXSD(pXSDCheckerBundle, versionToXSDFile.at(strVersionString).string(), xodrFilePath.c_str(), numOfIdentityConstraintKeyErrors); - - cChecker* pXSDParserChecker = pXSDCheckerBundle->GetCheckerById("xsdSchemaChecker"); - - if (nullptr == pXSDParserChecker) - pXSDParserChecker = pXSDCheckerBundle->CreateChecker("xsdSchemaChecker", "Checks the validity of the xml schema of an OpenDRIVE."); - - std::string s_description = pXSDParserChecker->GetDescription(); - std::stringstream ssDescription; - ssDescription << s_description << " Found OpenDRIVE version: " << strVersionString << ". Used schema file " << strVersionFileName << " for validation."; - pXSDParserChecker->SetDescription(ssDescription.str()); - - if (numOfIdentityConstraintKeyErrors) - { - std::stringstream errorStream; - errorStream << "Found " << numOfIdentityConstraintKeyErrors << - " issues: identity constraint key for element 'OpenDRIVE' not found, but cannot determine the location in file."; - pXSDParserChecker->AddIssue( - new cIssue(errorStream.str(), - eIssueLevel::ERROR_LVL)); - } - - pXSDParserChecker->UpdateSummary(); - } - else - { - std::stringstream errMsg; - errMsg << "Got header version " << strVersionString << " from OpenDRIVE. This version is not supported."; - - std::cerr << errMsg.str(); - - cChecker* pXSDParserChecker = pXSDCheckerBundle->CreateChecker("xodrVersionChecker", "Checks the validity of an OpenDRIVE."); - cLocationsContainer* loc = new cLocationsContainer("Version isn't supported.", (cExtendedInformation*) new cFileLocation(eFileType::XODR, 3, 5)); - pXSDParserChecker->AddIssue(new cIssue(errMsg.str(), ERROR_LVL, loc)); - pXSDParserChecker->UpdateSummary(); - bXODRValid = false; - } - - pXSDCheckerBundle->SetXODRFilePath(xodrFilePath); - } - catch (...) - { - std::cerr << "Unexpected exception occurred while parsing XODR." << std::endl; - XMLPlatformUtils::Terminate(); - exit(1); - } - - //pXSDCheckerBundle->DoProcessing(AddPrefixForDescriptionIssueProcessor); - pXSDCheckerBundle->SetDescription("Checks validity of the xml schema of a given xodr file."); - - std::stringstream ssSummaryString; - unsigned int issueCount = pXSDCheckerBundle->GetIssueCount(); - ssSummaryString << "Found " << issueCount << (issueCount == 1 ? " issue" : " issues"); - pXSDCheckerBundle->SetSummary(ssSummaryString.str()); - - std::cout << pXSDCheckerBundle->GetSummary() << std::endl << std::endl; - std::cout << "Write report: '" << inputParams.GetParam("strResultFile") << "'" << std::endl << std::endl; - pResultContainer->WriteResults(inputParams.GetParam("strResultFile")); - - std::cout << "Finished." << std::endl; - - pResultContainer->Clear(); - delete pResultContainer; - - XMLPlatformUtils::Terminate(); - - return bXODRValid; -} - -// Gets the xodr version from the header tag of a given xodr file. -bool ExtractXODRVersion(cCheckerBundle* ptrCheckerBundle, const char* i_cXodrPath, unsigned* i_uRevMinor, unsigned* i_uRevMajor) -{ - bool b_valid = false; - try - { - XMLCh* i_pRevMinor = XMLString::transcode("revMinor"); - XMLCh* i_pRevMajor = XMLString::transcode("revMajor"); - - XercesDOMParser domParser; - cParserErrorHandler parserErrorHandler(ptrCheckerBundle, i_cXodrPath); - - domParser.setErrorHandler(&parserErrorHandler); - - domParser.parse(i_cXodrPath); - - DOMDocument* pInputDocument = domParser.getDocument(); - - if (nullptr == pInputDocument) - return false; - - XMLCh* i_pTagName = XMLString::transcode("header"); - DOMNodeList * i_lHeaderNodes = pInputDocument->getElementsByTagName(i_pTagName); - - if (i_lHeaderNodes->getLength() != 1) - { - std::stringstream errMsg; - errMsg << "Found " << (i_lHeaderNodes->getLength() == 0 ? "zero" : "multiple") << " header tags in xml file. This is not supported."; - - cChecker* pXSDParserChecker = pXSDCheckerBundle->GetCheckerById("xsdSchemaChecker"); - - if(nullptr == pXSDParserChecker) - { - pXSDParserChecker = pXSDCheckerBundle->CreateChecker("xsdSchemaChecker", "Checks the validity of the header tag of an OpenDRIVE."); - } - - pXSDParserChecker->AddIssue(new cIssue(errMsg.str(), ERROR_LVL)); - pXSDParserChecker->UpdateSummary(); - } - else - { - b_valid = true; - } - - XMLSize_t i_sIdx = 0; - DOMElement * i_nHeaderNode = dynamic_cast (i_lHeaderNodes->item(i_sIdx)); - - std::string i_sRevMinor = XMLString::transcode(i_nHeaderNode->getAttribute(i_pRevMinor)); - std::string i_sRevMajor = XMLString::transcode(i_nHeaderNode->getAttribute(i_pRevMajor)); - - *i_uRevMajor = stoul(i_sRevMajor, nullptr, 0); - *i_uRevMinor = stoul(i_sRevMinor, nullptr, 0); - - XMLString::release(&i_pTagName); - XMLString::release(&i_pRevMajor); - XMLString::release(&i_pRevMinor); - } - catch (...) - { - std::stringstream errMsg; - errMsg << "Could not retrieve header version from xodr. Abort with error."; - - cChecker* pXSDParserChecker = pXSDCheckerBundle->CreateChecker("xsdSchemaChecker", "Checks the validity of the header tag of an OpenDRIVE"); - pXSDParserChecker->AddIssue(new cIssue(errMsg.str(), ERROR_LVL)); - pXSDParserChecker->UpdateSummary(); - } - - return b_valid; -} - -void WriteEmptyReport() -{ - cResultContainer emptyReport; - // Use this constructor because it sets build date and build version - cCheckerBundle* pCheckerBundle = new cCheckerBundle(CHECKER_BUNDLE_NAME, "", ""); - - emptyReport.AddCheckerBundle(pCheckerBundle); - - std::stringstream ssDefaultResultFile; - ssDefaultResultFile << CHECKER_BUNDLE_NAME << ".xqar"; - pCheckerBundle->SetParam("strResultFile", ssDefaultResultFile.str()); - - pCheckerBundle->CreateChecker("xodrVersionChecker"); - pCheckerBundle->CreateChecker("xsdSchemaChecker"); - - std::stringstream ssReportFile; - ssReportFile << CHECKER_BUNDLE_NAME << ".xqar"; - - std::cout << std::endl; - std::cout << "Write empty report: '" << ssReportFile.str() << "'" << std::endl << std::endl; - emptyReport.WriteResults(ssReportFile.str()); - - std::cout << "Finished." << std::endl; -} - -const std::string GetApplicationDir() -{ - return QCoreApplication::applicationDirPath().toStdString(); -} \ No newline at end of file diff --git a/src/checker_bundles/xodr_schema/src/staticODRChecks.h b/src/checker_bundles/xodr_schema/src/staticODRChecks.h deleted file mode 100644 index e2dfb5a9..00000000 --- a/src/checker_bundles/xodr_schema/src/staticODRChecks.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ -#ifndef STATICODRCHECKS_H__ -#define STATICODRCHECKS_H__ - -#include "common/util.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "common/qc4openx_filesystem.h" - -#define CHECKER_BUNDLE_NAME "XodrSchemaChecker" - -class cParameterContainer; -class cCheckerBundle; - -/** -* Main function for application -* -* @param [in] argc Number of arguments in shell -* @param [in] argv Pointer to arguments -* -* @return The standard return value -*/ -int main(int argc, char* argv[]); - -/** -* Shows the help for the application -* @param [in] applicationName The name of the application -*/ -void ShowHelp(const std::string& applicationName); - -/** -* Runs the checks -*/ -bool RunChecks(const cParameterContainer& inputParams); - -/** -* Validates an xml file with a schema file -* -* @param [in] pBundleSummary Pointer to the result container -* @param [in] strSchemaFilePath Pointer to the schema file (*.xsd) -* @param [in] strXodrFilePath Pointer to the xodr file -* -* @return True if XODR could be successfully validated -*/ -bool ValidateXSD(cCheckerBundle* pBundleSummary, const std::string& strSchemaFilePath, const char* strXodrFilePath); - -/** -* Extracts version information from an xodr file -* -* @param [in] ptrCheckerBundle Pointer to the checkerBundle, in case issues need to be added to it -* @param [in] i_cXodrPath Pointer to the file path of the xodr -* @param [in] i_uRevMinor Pointer to the minor version number -* @param [in] i_uRevMajor Pointer to the major version number -*/ -bool ExtractXODRVersion(cCheckerBundle* ptrCheckerBundle, const char* i_cXodrPath, unsigned* i_uRevMinor, unsigned* i_uRevMajor); - -/* -* Writes an empty Report -*/ -void WriteEmptyReport(); - -/** -* Get application directory -* -* @return directory, where the application is installed -*/ -const std::string GetApplicationDir(); - -#endif \ No newline at end of file diff --git a/src/checker_bundles/xodr_schema/src/stdafx.cpp b/src/checker_bundles/xodr_schema/src/stdafx.cpp deleted file mode 100644 index 75048a9a..00000000 --- a/src/checker_bundles/xodr_schema/src/stdafx.cpp +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ -#include "stdafx.h" diff --git a/src/checker_bundles/xodr_schema/src/stdafx.h b/src/checker_bundles/xodr_schema/src/stdafx.h deleted file mode 100644 index b3a9e206..00000000 --- a/src/checker_bundles/xodr_schema/src/stdafx.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ -#ifndef _STD_AFX_ -#define _STD_AFX_ - -#include -#include -#include -#include -#include -#include - -#endif // _STD_INCLUDES_HEADER_FEP_XODR_MANIPULATION_ diff --git a/src/checker_bundles/xodr_schema/src/xsd/cParserErrorHandler.cpp b/src/checker_bundles/xodr_schema/src/xsd/cParserErrorHandler.cpp deleted file mode 100644 index 8aa68d20..00000000 --- a/src/checker_bundles/xodr_schema/src/xsd/cParserErrorHandler.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -#include "cParserErrorHandler.h" - -#include "common/result_format/cResultContainer.h" -#include "common/result_format/cCheckerBundle.h" -#include "common/result_format/cChecker.h" -#include "common/result_format/cLocationsContainer.h" -#include "common/result_format/cFileLocation.h" - -cParserErrorHandler::cParserErrorHandler(cCheckerBundle* checkerBundle, const char* filePath) - : ErrorHandler(), myCheckerBundle(checkerBundle), myFilePath(filePath) -{ -} - -void cParserErrorHandler::reportParseException(const SAXParseException& ex) -{ - reportParseIssue(ex, eIssueLevel::WARNING_LVL); -} - -void cParserErrorHandler::reportParseIssue(const SAXParseException& ex, eIssueLevel issueLevel) -{ - if (myCheckerBundle != nullptr) - { - std::stringstream errorStr; - std::string message = XMLString::transcode(ex.getMessage()); - - errorStr << "Row:" << ex.getLineNumber() << " Column:" << ex.getColumnNumber() << " Message: " << message; - - cChecker* pXodrParserChecker = myCheckerBundle->GetCheckerById("xsdSchemaChecker"); - - if (nullptr == pXodrParserChecker) - { - pXodrParserChecker = myCheckerBundle->CreateChecker("xsdSchemaChecker", "Checks the xsd validity of an xodr."); - } - - // The message "identity constraint key for element 'OpenDRIVE' not found" cannot be located. So we count them - if (message.find("identity constraint key for element 'OpenDRIVE' not found") != std::string::npos) - { - m_NumOfIdentityConstraintKeyErrors++; - return; - } - - pXodrParserChecker->AddIssue( - new cIssue(errorStr.str(), - issueLevel, - new cLocationsContainer( - message, - (cExtendedInformation*) new cFileLocation(eFileType::XODR, (int)ex.getLineNumber(), (int)ex.getColumnNumber())))); - } -} - -void cParserErrorHandler::warning(const SAXParseException& ex) -{ - reportParseIssue(ex, eIssueLevel::WARNING_LVL); -} - -void cParserErrorHandler::error(const SAXParseException& ex) -{ - reportParseIssue(ex, eIssueLevel::ERROR_LVL); -} - -void cParserErrorHandler::fatalError(const SAXParseException& ex) -{ - reportParseIssue(ex, eIssueLevel::ERROR_LVL); -} - -void cParserErrorHandler::resetErrors() -{ -} - -unsigned int cParserErrorHandler::GetNumberOfIdentityConstraintKeyError() const -{ - return m_NumOfIdentityConstraintKeyErrors; -} - diff --git a/src/checker_bundles/xodr_schema/src/xsd/cParserErrorHandler.h b/src/checker_bundles/xodr_schema/src/xsd/cParserErrorHandler.h deleted file mode 100644 index a11d1de1..00000000 --- a/src/checker_bundles/xodr_schema/src/xsd/cParserErrorHandler.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ -#ifndef cParserErrorHandler_h__ -#define cParserErrorHandler_h__ - -#include "common/util.h" - -#include "common/result_format/cIssue.h" - -#define SAX_EXPORT -#include -#include - -class cCheckerBundle; - -class cParserErrorHandler : public ErrorHandler -{ -private: - cCheckerBundle * myCheckerBundle{nullptr}; - const char* myFilePath{nullptr}; - - void reportParseException(const SAXParseException& ex); - - void reportParseIssue(const SAXParseException& ex, eIssueLevel issueLevel); - - unsigned int m_NumOfIdentityConstraintKeyErrors{0}; - -public: - cParserErrorHandler() = delete; - ~cParserErrorHandler() = default; - explicit cParserErrorHandler(cCheckerBundle*, const char*); - - void warning(const SAXParseException& ex); - void error(const SAXParseException& ex); - void fatalError(const SAXParseException& ex); - void resetErrors(); - unsigned int GetNumberOfIdentityConstraintKeyError() const; -}; - -#endif \ No newline at end of file diff --git a/src/checker_bundles/xosc_schema/CMakeLists.txt b/src/checker_bundles/xosc_schema/CMakeLists.txt deleted file mode 100644 index 53a40fe2..00000000 --- a/src/checker_bundles/xosc_schema/CMakeLists.txt +++ /dev/null @@ -1,74 +0,0 @@ -# Copyright 2023 CARIAD SE. -# -# This Source Code Form is subject to the terms of the Mozilla -# Public License, v. 2.0. If a copy of the MPL was not distributed -# with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - -set(CHECKER_BUNDLE_XOSC_SCHEMA "XoscSchemaChecker") -project(${CHECKER_BUNDLE_XOSC_SCHEMA}) - -add_executable(${CHECKER_BUNDLE_XOSC_SCHEMA} - src/stdafx.h - src/stdafx.cpp - src/staticOSCChecks.h - src/staticOSCChecks.cpp -) - -target_link_libraries(${CHECKER_BUNDLE_XOSC_SCHEMA} PRIVATE - qc4openx-common - Qt5::XmlPatterns -) - -install(TARGETS ${CHECKER_BUNDLE_XOSC_SCHEMA} DESTINATION bin) -qc4openx_install_qt(bin ${CHECKER_BUNDLE_XOSC_SCHEMA}${CMAKE_EXECUTABLE_SUFFIX}) - -#################################################################################################### -############################# Find supported openscenario schema files ############################# -#################################################################################################### -# find supported openscenario schema files -set(ASAM_OPENSCENARIO_XSD_DIR "" CACHE PATH "Directory containing the ASAM OpenSCENARIO schema files (*.xsd)") -if (NOT ASAM_OPENSCENARIO_XSD_DIR) - message(FATAL_ERROR "ASAM_OPENSCENARIO_XSD_DIR must be set!") -endif() - -file(GLOB_RECURSE schema_files "${ASAM_OPENSCENARIO_XSD_DIR}/*.xsd") -if (NOT schema_files) - message(FATAL_ERROR "No OpenSCENARIO schema files found in ASAM_OPENSCENARIO_XSD_DIR: ${ASAM_OPENSCENARIO_XSD_DIR}") -endif () - -set(found_schema_versions) -set(found_schema_files) -set(vires_xosc_version_regex - # non-capturing groups currently not supported in CMake (see: https://gitlab.kitware.com/cmake/cmake/-/issues/17686) - "^.*XML Schema .+ Version [D]*[r]*[a]*[f]*[t]*[ ]*([0-9]+\.[0-9]+\.[0-9]+).*") -set(asam_xosc_version_regex "^.*ASAM OpenSCENARIO V([0-9]+\.[0-9]+\.[0-9]+)") - -message("-- Finding OpenSCENARIO schema files in ${ASAM_OPENSCENARIO_XSD_DIR}") -list(APPEND CMAKE_MESSAGE_INDENT "-- ") -foreach(schema_file ${schema_files}) - file(STRINGS "${schema_file}" schema_file_content) - # Check each line for a matching version - foreach(line ${schema_file_content}) - # Vires xosc schema file? - string(REGEX MATCH "${vires_xosc_version_regex}" _ ${line}) - if(NOT CMAKE_MATCH_1) - # Maybe ASAM xosc schema file? - string(REGEX MATCH "${asam_xosc_version_regex}" _ ${line}) - endif() - - if(CMAKE_MATCH_1) - list(APPEND found_schema_versions ${CMAKE_MATCH_1}) - list(APPEND found_schema_files "${schema_file}") - message("Found version ${CMAKE_MATCH_1}: ${schema_file}") - install(FILES "${schema_file}" DESTINATION bin/xsd/xosc/${CMAKE_MATCH_1}) - break() - endif() - endforeach() -endforeach() - -list(POP_BACK CMAKE_MESSAGE_INDENT) -if (NOT found_schema_files) - message(FATAL_ERROR "No OpenSCENARIO schema files found in ASAM_OPENSCENARIO_XSD_DIR: ${ASAM_OPENSCENARIO_XSD_DIR}") -endif () - -set_target_properties(${CHECKER_BUNDLE_XOSC_SCHEMA} PROPERTIES FOLDER checker_bundles) diff --git a/src/checker_bundles/xosc_schema/src/staticOSCChecks.cpp b/src/checker_bundles/xosc_schema/src/staticOSCChecks.cpp deleted file mode 100644 index a8eb5673..00000000 --- a/src/checker_bundles/xosc_schema/src/staticOSCChecks.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -#include "staticOSCChecks.h" - -int main(int argc, char* argv[]) -{ - std::string strToolpath = argv[0]; - - if (argc != 2) { - ShowHelp(strToolpath); - if (argc < 2) - return 0; - else - return -1; - } - - QCoreApplication app(argc, argv); - - std::string strFilepath = argv[1]; - - cParameterContainer inputParams; - OSCSchemaChecker* schemaChecker; - - std::stringstream ssResultFile; - ssResultFile << CHECKER_BUNDLE_NAME << ".xqar"; - inputParams.SetParam("strResultFile", ssResultFile.str()); - - std::map> versionToXSDFile = { - {"0.9", - {GetApplicationDir() + "/xsd/xosc/0.9.1/OpenSCENARIO_TypeDefs.xsd", - GetApplicationDir() + "/xsd/xosc/0.9.1/OpenSCENARIO_v0.9.1.xsd"}}, - {"1.0", {GetApplicationDir() + "/xsd/xosc/1.0.0/OpenSCENARIO.xsd"}}, - {"1.1", {GetApplicationDir() + "/xsd/xosc/1.1.0/OpenSCENARIO.xsd"}}}; - - if (StringEndsWith(ToLower(strFilepath), ".xosc")) { - inputParams.SetParam("XoscFile", strFilepath); - } - else if (StringEndsWith(ToLower(strFilepath), ".xml")) { - cConfiguration configuration; - - std::cout << "Config: " << strFilepath << std::endl; - if (!cConfiguration::ParseFromXML(&configuration, strFilepath)) { - std::cerr << "Could not read configuration! Abort." << std::endl; - return -1; - } - - inputParams.Overwrite(configuration.GetParams()); - - cConfigurationCheckerBundle* checkerBundleConfig = - configuration.GetCheckerBundleByName(CHECKER_BUNDLE_NAME); - if (nullptr != checkerBundleConfig) - inputParams.Overwrite(checkerBundleConfig->GetParams()); - else - std::cerr << "No configuration for module '" << CHECKER_BUNDLE_NAME - << "' found. Start with default params." << std::endl; - - inputParams.DeleteParam("XodrFile"); - } - else if (StringEndsWith(ToLower(strFilepath), "--defaultconfig")) { - schemaChecker = new OSCSchemaChecker(CHECKER_BUNDLE_NAME, inputParams, versionToXSDFile); - schemaChecker->WriteEmptyReport(); - return 0; - } - else if (strcmp(strFilepath.c_str(), "-h") == 0 || strcmp(strFilepath.c_str(), "--help") == 0) { - ShowHelp(strToolpath); - return 0; - } - else { - ShowHelp(strToolpath); - return -1; - } - - schemaChecker = new OSCSchemaChecker(CHECKER_BUNDLE_NAME, inputParams, versionToXSDFile); - - bool bXOSCValid = schemaChecker->RunChecks(); - exit(bXOSCValid ? 0 : 1); -} - -void ShowHelp(const std::string& toolPath) -{ - std::string applicationName = toolPath; - std::string applicationNameWithoutExt = toolPath; - GetFileName(&applicationName, false); - GetFileName(&applicationNameWithoutExt, true); - - std::cout << "\n\nUsage of " << applicationNameWithoutExt << ":" << std::endl; - std::cout << "\nRun the application with xosc file: \n" << applicationName << " sample.xosc" << std::endl; - std::cout << "\nRun the application with dbqa configuration: \n" - << applicationName << " config.xml" << std::endl; - std::cout << "\nRun the application and write empty report as default configuration: \n" - << applicationName << " --defaultconfig" << std::endl; - std::cout << "\n\n"; -} - -const std::string GetApplicationDir() -{ - return QCoreApplication::applicationDirPath().toStdString(); -} \ No newline at end of file diff --git a/src/checker_bundles/xosc_schema/src/stdafx.cpp b/src/checker_bundles/xosc_schema/src/stdafx.cpp deleted file mode 100644 index 4a0e5a70..00000000 --- a/src/checker_bundles/xosc_schema/src/stdafx.cpp +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -#include "stdafx.h" diff --git a/src/checker_bundles/xosc_schema/src/stdafx.h b/src/checker_bundles/xosc_schema/src/stdafx.h deleted file mode 100644 index 4d65a490..00000000 --- a/src/checker_bundles/xosc_schema/src/stdafx.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -#ifndef _STD_AFX_ -#define _STD_AFX_ - -#include -#include -#include -#include -#include -#include - -#endif // _STD_INCLUDES_HEADER_FEP_XODR_MANIPULATION_ diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 3f5b9033..7f0f2589 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -14,24 +14,22 @@ find_package(Threads) add_library(qc4openx-common STATIC src/util.cpp - src/result_format/cResultContainer.cpp - src/result_format/cIssue.cpp - src/result_format/cCheckerBundle.cpp - src/result_format/cChecker.cpp - src/result_format/cExtendedInformation.cpp - src/result_format/cFileLocation.cpp - src/result_format/cInertialLocation.cpp - src/result_format/cRoadLocation.cpp - src/result_format/cXMLLocation.cpp - src/result_format/cParameterContainer.cpp - src/result_format/cLocationsContainer.cpp - src/config_format/cConfiguration.cpp - src/config_format/cConfigurationChecker.cpp - src/config_format/cConfigurationCheckerBundle.cpp - src/config_format/cConfigurationReportModule.cpp - src/xsd/cOSCSchemaChecker.cpp - src/xsd/cParserErrorHandler.cpp - src/xml/cXPathEvaluator.cpp + src/result_format/c_result_container.cpp + src/result_format/c_issue.cpp + src/result_format/c_checker_bundle.cpp + src/result_format/c_checker.cpp + src/result_format/c_extended_information.cpp + src/result_format/c_file_location.cpp + src/result_format/c_inertial_location.cpp + src/result_format/c_road_location.cpp + src/result_format/c_xml_location.cpp + src/result_format/c_parameter_container.cpp + src/result_format/c_locations_container.cpp + src/config_format/c_configuration.cpp + src/config_format/c_configuration_checker.cpp + src/config_format/c_configuration_checker_bundle.cpp + src/config_format/c_configuration_report_module.cpp + src/xml/c_x_path_evaluator.cpp ) target_include_directories(qc4openx-common PUBLIC ${PROJECT_SOURCE_DIR}/include diff --git a/src/common/src/config_format/cConfiguration.cpp b/src/common/src/config_format/c_configuration.cpp similarity index 52% rename from src/common/src/config_format/cConfiguration.cpp rename to src/common/src/config_format/c_configuration.cpp index c929d7cb..55d86fd0 100644 --- a/src/common/src/config_format/cConfiguration.cpp +++ b/src/common/src/config_format/c_configuration.cpp @@ -5,27 +5,27 @@ * Public License, v. 2.0. If a copy of the MPL was not distributed * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "common/config_format/cConfiguration.h" -#include "common/config_format/cConfigurationChecker.h" +#include "common/config_format/c_configuration.h" +#include "common/config_format/c_configuration_checker.h" -#include "common/config_format/cConfigurationReportModule.h" -#include "common/config_format/cConfigurationCheckerBundle.h" +#include "common/config_format/c_configuration_checker_bundle.h" +#include "common/config_format/c_configuration_report_module.h" XERCES_CPP_NAMESPACE_USE -const XMLCh* cConfiguration::TAG_CONFIGURATION = CONST_XMLCH("Config"); +const XMLCh *cConfiguration::TAG_CONFIGURATION = CONST_XMLCH("Config"); cConfiguration::~cConfiguration() { Clear(); } -bool cConfiguration::ParseFromXML(cConfiguration* config, const std::string& configFilePath) +bool cConfiguration::ParseFromXML(cConfiguration *config, const std::string &configFilePath) { XMLPlatformUtils::Initialize(); if (!CheckIfFileExists(configFilePath)) return false; - XercesDOMParser* pDomParser = new XercesDOMParser(); + XercesDOMParser *pDomParser = new XercesDOMParser(); pDomParser->setValidationScheme(XercesDOMParser::Val_Never); pDomParser->setDoNamespaces(false); @@ -36,12 +36,12 @@ bool cConfiguration::ParseFromXML(cConfiguration* config, const std::string& con { pDomParser->parse(configFilePath.c_str()); - DOMDocument* pXmlDoc = pDomParser->getDocument(); + DOMDocument *pXmlDoc = pDomParser->getDocument(); if (nullptr == pXmlDoc) return false; - DOMElement* pRoot = pXmlDoc->getDocumentElement(); + DOMElement *pRoot = pXmlDoc->getDocumentElement(); // Parse Root if (nullptr == pRoot) @@ -49,12 +49,12 @@ bool cConfiguration::ParseFromXML(cConfiguration* config, const std::string& con std::cout << "Could not get root node of document " << configFilePath << ". Aborting." << std::endl; return false; } - DOMNodeList* pChildList = pRoot->getChildNodes(); - const XMLSize_t configNode = pChildList->getLength(); + DOMNodeList *pChildList = pRoot->getChildNodes(); + const XMLSize_t configNode = pChildList->getLength(); for (XMLSize_t i = 0; i < configNode; ++i) { - DOMNode* pCurrentNode = pChildList->item(i); + DOMNode *pCurrentNode = pChildList->item(i); if (pCurrentNode->getNodeType() == DOMNode::ELEMENT_NODE) { @@ -76,40 +76,41 @@ bool cConfiguration::ParseFromXML(cConfiguration* config, const std::string& con return true; } -cConfiguration* cConfiguration::ParseFromXML(const std::string& configFilePath) +cConfiguration *cConfiguration::ParseFromXML(const std::string &configFilePath) { - cConfiguration* cConfig = new cConfiguration(); + cConfiguration *cConfig = new cConfiguration(); if (ParseFromXML(cConfig, configFilePath)) return cConfig; - -return nullptr; + + return nullptr; } -void cConfiguration::WriteConfigurationToFile(const std::string& filePath) +void cConfiguration::WriteConfigurationToFile(const std::string &filePath) { XMLPlatformUtils::Initialize(); - DOMImplementation* p_DOMImplementationCore = DOMImplementationRegistry::getDOMImplementation(XMLString::transcode("core")); - DOMLSSerializer* p_DOMSerializer = ((DOMImplementationLS*)p_DOMImplementationCore)->createLSSerializer(); + DOMImplementation *p_DOMImplementationCore = + DOMImplementationRegistry::getDOMImplementation(XMLString::transcode("core")); + DOMLSSerializer *p_DOMSerializer = ((DOMImplementationLS *)p_DOMImplementationCore)->createLSSerializer(); - DOMConfiguration* p_DOMConfig = p_DOMSerializer->getDomConfig(); + DOMConfiguration *p_DOMConfig = p_DOMSerializer->getDomConfig(); p_DOMConfig->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, true); - DOMDocument* p_resultDocument = p_DOMImplementationCore->createDocument(0, TAG_CONFIGURATION, 0); - DOMElement* p_RootElement = p_resultDocument->getDocumentElement(); + DOMDocument *p_resultDocument = p_DOMImplementationCore->createDocument(0, TAG_CONFIGURATION, 0); + DOMElement *p_RootElement = p_resultDocument->getDocumentElement(); m_params.WriteXML(p_resultDocument, p_RootElement); // write checker bundle data to xml - for (std::vector::const_iterator it = m_checkerBundles.begin(); - it != m_checkerBundles.end(); ++it) + for (std::vector::const_iterator it = m_checkerBundles.begin(); + it != m_checkerBundles.end(); ++it) { (*it)->WriteXML(p_resultDocument, p_RootElement); } // write report module data to xml - for (std::vector::const_iterator it = m_reportModules.begin(); - it != m_reportModules.end(); ++it) + for (std::vector::const_iterator it = m_reportModules.begin(); + it != m_reportModules.end(); ++it) { (*it)->WriteXML(p_resultDocument, p_RootElement); } @@ -117,7 +118,7 @@ void cConfiguration::WriteConfigurationToFile(const std::string& filePath) // StdOutFormatTarget prints the resultant XML stream // to stdout once it receives any thing from the serializer. XMLFormatTarget *fileTarget = new LocalFileFormatTarget(XMLString::transcode(filePath.c_str())); - DOMLSOutput* theOutput = ((DOMImplementationLS*)p_DOMImplementationCore)->createLSOutput(); + DOMLSOutput *theOutput = ((DOMImplementationLS *)p_DOMImplementationCore)->createLSOutput(); theOutput->setByteStream(fileTarget); // FIXME: return value of 'write' as function return value? @@ -133,12 +134,12 @@ void cConfiguration::WriteConfigurationToFile(const std::string& filePath) XMLPlatformUtils::Terminate(); } -void cConfiguration::ProcessDomNode(DOMNode* const nodeToProcess, cConfiguration* const cConfig) const +void cConfiguration::ProcessDomNode(DOMNode *const nodeToProcess, cConfiguration *const cConfig) const { if (nodeToProcess->getNodeType() == DOMNode::ELEMENT_NODE) { - DOMElement* currentIssueElement = dynamic_cast(nodeToProcess); - const char* currentTagName = XMLString::transcode(currentIssueElement->getTagName()); + DOMElement *currentIssueElement = dynamic_cast(nodeToProcess); + const char *currentTagName = XMLString::transcode(currentIssueElement->getTagName()); if (Equals(currentTagName, XMLString::transcode(cParameterContainer::TAG_PARAM))) { @@ -146,13 +147,15 @@ void cConfiguration::ProcessDomNode(DOMNode* const nodeToProcess, cConfiguration } else if (Equals(currentTagName, XMLString::transcode(cConfigurationReportModule::TAG_REPORT_MODULE))) { - cConfigurationReportModule* p_reportModule = cConfigurationReportModule::ParseConfigurationReportModule(nodeToProcess, currentIssueElement); + cConfigurationReportModule *p_reportModule = + cConfigurationReportModule::ParseConfigurationReportModule(nodeToProcess, currentIssueElement); if (nullptr != p_reportModule) cConfig->m_reportModules.push_back(p_reportModule); } else if (Equals(currentTagName, XMLString::transcode(cConfigurationCheckerBundle::TAG_CHECKERBUNDLE))) { - cConfigurationCheckerBundle* p_checkerBundle = cConfigurationCheckerBundle::ParseConfigurationCheckerBundle(nodeToProcess, currentIssueElement); + cConfigurationCheckerBundle *p_checkerBundle = + cConfigurationCheckerBundle::ParseConfigurationCheckerBundle(nodeToProcess, currentIssueElement); if (nullptr != p_checkerBundle) cConfig->m_checkerBundles.push_back(p_checkerBundle); } @@ -161,17 +164,15 @@ void cConfiguration::ProcessDomNode(DOMNode* const nodeToProcess, cConfiguration void cConfiguration::Clear() { - for (std::vector::iterator it = m_checkerBundles.begin(); - it != m_checkerBundles.end(); - it++) + for (std::vector::iterator it = m_checkerBundles.begin(); + it != m_checkerBundles.end(); it++) { (*it)->Clear(); delete (*it); } m_checkerBundles.clear(); - for (std::vector::iterator it = m_reportModules.begin(); - it != m_reportModules.end(); + for (std::vector::iterator it = m_reportModules.begin(); it != m_reportModules.end(); it++) { (*it)->Clear(); @@ -187,41 +188,41 @@ cParameterContainer cConfiguration::GetParams() const return m_params; } -std::vector cConfiguration::GetCheckerBundles() const +std::vector cConfiguration::GetCheckerBundles() const { return m_checkerBundles; } -std::vector cConfiguration::GetReportModules() const +std::vector cConfiguration::GetReportModules() const { return m_reportModules; } -bool cConfiguration::HasParam(const std::string& name) const +bool cConfiguration::HasParam(const std::string &name) const { return m_params.HasParam(name); } -std::string cConfiguration::GetParam(const std::string& name) const +std::string cConfiguration::GetParam(const std::string &name) const { return m_params.GetParam(name); } -void cConfiguration::SetParam(const std::string& name, const std::string& value) +void cConfiguration::SetParam(const std::string &name, const std::string &value) { m_params.SetParam(name, value); } // Overwrite parameters -void cConfiguration::OverwriteParams(const cParameterContainer& params) +void cConfiguration::OverwriteParams(const cParameterContainer ¶ms) { m_params.Overwrite(params); } // Returns a report Module by a given application name -cConfigurationReportModule* cConfiguration::GetReportModuleByName(const std::string& applicationName) +cConfigurationReportModule *cConfiguration::GetReportModuleByName(const std::string &applicationName) { - std::vector::iterator it = m_reportModules.begin(); + std::vector::iterator it = m_reportModules.begin(); for (; it != m_reportModules.end(); it++) { @@ -235,9 +236,9 @@ cConfigurationReportModule* cConfiguration::GetReportModuleByName(const std::str } // Returns a checker Bundle by a given application name -cConfigurationCheckerBundle* cConfiguration::GetCheckerBundleByName(const std::string& applicationName) +cConfigurationCheckerBundle *cConfiguration::GetCheckerBundleByName(const std::string &applicationName) { - std::vector::iterator it = m_checkerBundles.begin(); + std::vector::iterator it = m_checkerBundles.begin(); for (; it != m_checkerBundles.end(); it++) { @@ -251,25 +252,25 @@ cConfigurationCheckerBundle* cConfiguration::GetCheckerBundleByName(const std::s } // Adds a ReportModule -cConfigurationReportModule* cConfiguration::AddReportModule(const std::string& applicationName) +cConfigurationReportModule *cConfiguration::AddReportModule(const std::string &applicationName) { - cConfigurationReportModule* result = new cConfigurationReportModule(applicationName); + cConfigurationReportModule *result = new cConfigurationReportModule(applicationName); m_reportModules.push_back(result); return result; } // Adds a CheckerBundle -cConfigurationCheckerBundle* cConfiguration::AddCheckerBundle(const std::string& applicationName) +cConfigurationCheckerBundle *cConfiguration::AddCheckerBundle(const std::string &applicationName) { - cConfigurationCheckerBundle* result = new cConfigurationCheckerBundle(applicationName); + cConfigurationCheckerBundle *result = new cConfigurationCheckerBundle(applicationName); m_checkerBundles.push_back(result); return result; } // Merges another configuration into this one -bool cConfiguration::AddConfiguration(const cConfiguration* pAnotherConfig) +bool cConfiguration::AddConfiguration(const cConfiguration *pAnotherConfig) { if (nullptr == pAnotherConfig) return false; @@ -278,39 +279,38 @@ bool cConfiguration::AddConfiguration(const cConfiguration* pAnotherConfig) m_params.Overwrite(pAnotherConfig->GetParams()); // Add CheckerBundle configs - std::vector checkerBundleConfigs = pAnotherConfig->GetCheckerBundles(); - std::vector::iterator itCheckerBundle = checkerBundleConfigs.begin(); + std::vector checkerBundleConfigs = pAnotherConfig->GetCheckerBundles(); + std::vector::iterator itCheckerBundle = checkerBundleConfigs.begin(); for (; itCheckerBundle != checkerBundleConfigs.end(); itCheckerBundle++) { - cConfigurationCheckerBundle* newCheckerBundle = AddCheckerBundle((*itCheckerBundle)->GetCheckerBundleApplication()); + cConfigurationCheckerBundle *newCheckerBundle = + AddCheckerBundle((*itCheckerBundle)->GetCheckerBundleApplication()); newCheckerBundle->OverwriteParams((*itCheckerBundle)->GetParams()); // Add Checker configs - std::vector checkerConfigs = (*itCheckerBundle)->GetCheckers(); - std::vector::iterator itChecker = checkerConfigs.begin(); + std::vector checkerConfigs = (*itCheckerBundle)->GetCheckers(); + std::vector::iterator itChecker = checkerConfigs.begin(); for (; itChecker != checkerConfigs.end(); itChecker++) { - cConfigurationChecker* newChecker = newCheckerBundle->AddChecker( (*itChecker)->GetCheckerId(), - (*itChecker)->GetMinLevel(), - (*itChecker)->GetMaxLevel()); + cConfigurationChecker *newChecker = newCheckerBundle->AddChecker( + (*itChecker)->GetCheckerId(), (*itChecker)->GetMinLevel(), (*itChecker)->GetMaxLevel()); newChecker->OverwriteParams((*itChecker)->GetParams()); } } // Add ReportModule configs - std::vector checkerReportModuleConfigs = pAnotherConfig->GetReportModules(); - std::vector::iterator itReportModule = checkerReportModuleConfigs.begin(); + std::vector checkerReportModuleConfigs = pAnotherConfig->GetReportModules(); + std::vector::iterator itReportModule = checkerReportModuleConfigs.begin(); for (; itReportModule != checkerReportModuleConfigs.end(); itReportModule++) { - cConfigurationReportModule* newReportModule = AddReportModule((*itReportModule)->GetReportModuleApplication()); + cConfigurationReportModule *newReportModule = AddReportModule((*itReportModule)->GetReportModuleApplication()); newReportModule->OverwriteParams((*itReportModule)->GetParams()); } return true; } - diff --git a/src/common/src/config_format/cConfigurationChecker.cpp b/src/common/src/config_format/c_configuration_checker.cpp similarity index 64% rename from src/common/src/config_format/cConfigurationChecker.cpp rename to src/common/src/config_format/c_configuration_checker.cpp index 2dcc4c08..94fa1eef 100644 --- a/src/common/src/config_format/cConfigurationChecker.cpp +++ b/src/common/src/config_format/c_configuration_checker.cpp @@ -5,14 +5,14 @@ * Public License, v. 2.0. If a copy of the MPL was not distributed * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "common/config_format/cConfigurationChecker.h" +#include "common/config_format/c_configuration_checker.h" XERCES_CPP_NAMESPACE_USE -const XMLCh* cConfigurationChecker::ATTR_CHECKER_ID = CONST_XMLCH("checkerId"); -const XMLCh* cConfigurationChecker::ATTR_CHECKER_MIN_LEVEL = CONST_XMLCH("minLevel"); -const XMLCh* cConfigurationChecker::ATTR_CHECKER_MAX_LEVEL = CONST_XMLCH("maxLevel"); -const XMLCh* cConfigurationChecker::TAG_CHECKER = CONST_XMLCH("Checker"); +const XMLCh *cConfigurationChecker::ATTR_CHECKER_ID = CONST_XMLCH("checkerId"); +const XMLCh *cConfigurationChecker::ATTR_CHECKER_MIN_LEVEL = CONST_XMLCH("minLevel"); +const XMLCh *cConfigurationChecker::ATTR_CHECKER_MAX_LEVEL = CONST_XMLCH("maxLevel"); +const XMLCh *cConfigurationChecker::TAG_CHECKER = CONST_XMLCH("Checker"); cConfigurationChecker::cConfigurationChecker() { @@ -21,20 +21,21 @@ cConfigurationChecker::cConfigurationChecker() m_maxLevel = ERROR_LVL; } -cConfigurationChecker::cConfigurationChecker(const std::string& checkerId, eIssueLevel minLevel, eIssueLevel maxLevel) : cConfigurationChecker() +cConfigurationChecker::cConfigurationChecker(const std::string &checkerId, eIssueLevel minLevel, eIssueLevel maxLevel) + : cConfigurationChecker() { m_checkerID = checkerId; m_minLevel = minLevel; m_maxLevel = maxLevel; } -cConfigurationChecker* cConfigurationChecker::ParseConfigurationChecker(DOMNode * pXMLNode, DOMElement* pXMLElement) +cConfigurationChecker *cConfigurationChecker::ParseConfigurationChecker(DOMNode *pXMLNode, DOMElement *pXMLElement) { std::string strCheckerId = XMLString::transcode(pXMLElement->getAttribute(ATTR_CHECKER_ID)); std::string sMinLevel = XMLString::transcode(pXMLElement->getAttribute(ATTR_CHECKER_MIN_LEVEL)); std::string sMaxLevel = XMLString::transcode(pXMLElement->getAttribute(ATTR_CHECKER_MAX_LEVEL)); - cConfigurationChecker* parsedChecker = new cConfigurationChecker(); + cConfigurationChecker *parsedChecker = new cConfigurationChecker(); parsedChecker->m_checkerID = strCheckerId; parsedChecker->m_maxLevel = ERROR_LVL; parsedChecker->m_minLevel = INFO_LVL; @@ -51,20 +52,21 @@ cConfigurationChecker* cConfigurationChecker::ParseConfigurationChecker(DOMNode if (pXMLNode->getNodeType() == DOMNode::ELEMENT_NODE) { - DOMNodeList* pCheckerChildList = pXMLNode->getChildNodes(); - const XMLSize_t checkerNodeCount = pCheckerChildList->getLength(); + DOMNodeList *pCheckerChildList = pXMLNode->getChildNodes(); + const XMLSize_t checkerNodeCount = pCheckerChildList->getLength(); for (XMLSize_t j = 0; j < checkerNodeCount; ++j) { - DOMNode* currentCheckerNode = pCheckerChildList->item(j); + DOMNode *currentCheckerNode = pCheckerChildList->item(j); if (currentCheckerNode->getNodeType() == DOMNode::ELEMENT_NODE) { - DOMElement* currentIssueElement = dynamic_cast(currentCheckerNode); - const char* currentTagName = XMLString::transcode(currentIssueElement->getTagName()); + DOMElement *currentIssueElement = dynamic_cast(currentCheckerNode); + const char *currentTagName = XMLString::transcode(currentIssueElement->getTagName()); if (Equals(currentTagName, XMLString::transcode(cParameterContainer::TAG_PARAM))) - cParameterContainer::ParseFromXML(currentCheckerNode, currentIssueElement, &parsedChecker->m_params); + cParameterContainer::ParseFromXML(currentCheckerNode, currentIssueElement, + &parsedChecker->m_params); } } } @@ -72,9 +74,9 @@ cConfigurationChecker* cConfigurationChecker::ParseConfigurationChecker(DOMNode return parsedChecker; } -DOMElement * cConfigurationChecker::WriteXML(DOMDocument* pResultDocument, DOMElement* p_parentElement) const +DOMElement *cConfigurationChecker::WriteXML(DOMDocument *pResultDocument, DOMElement *p_parentElement) const { - DOMElement* pDataElement = CreateXMLNode(pResultDocument); + DOMElement *pDataElement = CreateXMLNode(pResultDocument); // Add parameters m_params.WriteXML(pResultDocument, pDataElement); @@ -84,15 +86,15 @@ DOMElement * cConfigurationChecker::WriteXML(DOMDocument* pResultDocument, DOMEl return pDataElement; } -DOMElement* cConfigurationChecker::CreateXMLNode(DOMDocument* pResultDocument) const +DOMElement *cConfigurationChecker::CreateXMLNode(DOMDocument *pResultDocument) const { - DOMElement* p_DataElement = pResultDocument->createElement(cConfigurationChecker::TAG_CHECKER); + DOMElement *p_DataElement = pResultDocument->createElement(cConfigurationChecker::TAG_CHECKER); - XMLCh* pCheckerID = XMLString::transcode(this->m_checkerID.c_str()); - XMLCh* pCheckerMinLevel = XMLString::transcode(ToString(this->m_minLevel).c_str()); - XMLCh* pCheckerMaxLevel = XMLString::transcode(ToString(this->m_maxLevel).c_str()); + XMLCh *pCheckerID = XMLString::transcode(this->m_checkerID.c_str()); + XMLCh *pCheckerMinLevel = XMLString::transcode(ToString(this->m_minLevel).c_str()); + XMLCh *pCheckerMaxLevel = XMLString::transcode(ToString(this->m_maxLevel).c_str()); - p_DataElement->setAttribute(cConfigurationChecker::ATTR_CHECKER_ID , pCheckerID); + p_DataElement->setAttribute(cConfigurationChecker::ATTR_CHECKER_ID, pCheckerID); p_DataElement->setAttribute(cConfigurationChecker::ATTR_CHECKER_MAX_LEVEL, pCheckerMaxLevel); p_DataElement->setAttribute(cConfigurationChecker::ATTR_CHECKER_MIN_LEVEL, pCheckerMinLevel); @@ -108,7 +110,6 @@ void cConfigurationChecker::Clear() m_params.ClearParams(); } - cConfigurationChecker::~cConfigurationChecker() { Clear(); @@ -124,7 +125,7 @@ std::string cConfigurationChecker::GetCheckerId() const return m_checkerID; } -void cConfigurationChecker::SetCheckerId(const std::string& in) +void cConfigurationChecker::SetCheckerId(const std::string &in) { m_checkerID = in; } @@ -152,22 +153,22 @@ void cConfigurationChecker::SetMaxLevel(eIssueLevel newLevel) m_maxLevel = newLevel; } -void cConfigurationChecker::SetParam(const std::string& name, const std::string& value) +void cConfigurationChecker::SetParam(const std::string &name, const std::string &value) { return m_params.SetParam(name, value); } -bool cConfigurationChecker::HasParam(const std::string& name) const +bool cConfigurationChecker::HasParam(const std::string &name) const { return m_params.HasParam(name); } -std::string cConfigurationChecker::GetParam(const std::string& name) const +std::string cConfigurationChecker::GetParam(const std::string &name) const { return m_params.GetParam(name); } -void cConfigurationChecker::OverwriteParams(const cParameterContainer& params) +void cConfigurationChecker::OverwriteParams(const cParameterContainer ¶ms) { m_params.Overwrite(params); } diff --git a/src/common/src/config_format/cConfigurationCheckerBundle.cpp b/src/common/src/config_format/c_configuration_checker_bundle.cpp similarity index 54% rename from src/common/src/config_format/cConfigurationCheckerBundle.cpp rename to src/common/src/config_format/c_configuration_checker_bundle.cpp index c0ed45b3..4fce1181 100644 --- a/src/common/src/config_format/cConfigurationCheckerBundle.cpp +++ b/src/common/src/config_format/c_configuration_checker_bundle.cpp @@ -5,26 +5,29 @@ * Public License, v. 2.0. If a copy of the MPL was not distributed * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "common/config_format/cConfigurationCheckerBundle.h" +#include "common/config_format/c_configuration_checker_bundle.h" -#include "common/config_format/cConfigurationChecker.h" +#include "common/config_format/c_configuration_checker.h" XERCES_CPP_NAMESPACE_USE -const XMLCh* cConfigurationCheckerBundle::ATTR_APPLICATION = CONST_XMLCH("application"); -const XMLCh* cConfigurationCheckerBundle::TAG_CHECKERBUNDLE = CONST_XMLCH("CheckerBundle"); +const XMLCh *cConfigurationCheckerBundle::ATTR_APPLICATION = CONST_XMLCH("application"); +const XMLCh *cConfigurationCheckerBundle::TAG_CHECKERBUNDLE = CONST_XMLCH("CheckerBundle"); cConfigurationCheckerBundle::cConfigurationCheckerBundle() -{} +{ +} -cConfigurationCheckerBundle::cConfigurationCheckerBundle(const std::string& applicationName) : cConfigurationCheckerBundle() +cConfigurationCheckerBundle::cConfigurationCheckerBundle(const std::string &applicationName) + : cConfigurationCheckerBundle() { strApplication = applicationName; } -cConfigurationCheckerBundle* cConfigurationCheckerBundle::ParseConfigurationCheckerBundle(DOMNode * pXMLNode, DOMElement* pXMLElement) +cConfigurationCheckerBundle *cConfigurationCheckerBundle::ParseConfigurationCheckerBundle(DOMNode *pXMLNode, + DOMElement *pXMLElement) { - cConfigurationCheckerBundle* parsedCheckerBundle = new cConfigurationCheckerBundle(); + cConfigurationCheckerBundle *parsedCheckerBundle = new cConfigurationCheckerBundle(); std::string strApp = XMLString::transcode(pXMLElement->getAttribute(ATTR_APPLICATION)); @@ -32,12 +35,12 @@ cConfigurationCheckerBundle* cConfigurationCheckerBundle::ParseConfigurationChec if (pXMLNode->getNodeType() == DOMNode::ELEMENT_NODE) { - DOMNodeList* pCheckerChildList = pXMLNode->getChildNodes(); - const XMLSize_t checkerNodeCount = pCheckerChildList->getLength(); + DOMNodeList *pCheckerChildList = pXMLNode->getChildNodes(); + const XMLSize_t checkerNodeCount = pCheckerChildList->getLength(); for (XMLSize_t j = 0; j < checkerNodeCount; ++j) { - DOMNode* currentCheckerNode = pCheckerChildList->item(j); + DOMNode *currentCheckerNode = pCheckerChildList->item(j); if (currentCheckerNode->getNodeType() == DOMNode::ELEMENT_NODE) parsedCheckerBundle->ProcessDomNode(currentCheckerNode, parsedCheckerBundle); } @@ -46,14 +49,16 @@ cConfigurationCheckerBundle* cConfigurationCheckerBundle::ParseConfigurationChec return parsedCheckerBundle; } -void cConfigurationCheckerBundle::ProcessDomNode(DOMNode* nodeToProcess, cConfigurationCheckerBundle* currentCheckerBundle) +void cConfigurationCheckerBundle::ProcessDomNode(DOMNode *nodeToProcess, + cConfigurationCheckerBundle *currentCheckerBundle) { - DOMElement* currentIssueElement = dynamic_cast(nodeToProcess); - const char* currentTagName = XMLString::transcode(currentIssueElement->getTagName()); + DOMElement *currentIssueElement = dynamic_cast(nodeToProcess); + const char *currentTagName = XMLString::transcode(currentIssueElement->getTagName()); if (Equals(currentTagName, XMLString::transcode(cConfigurationChecker::TAG_CHECKER))) { - cConfigurationChecker* cChecker = cConfigurationChecker::ParseConfigurationChecker(nodeToProcess, currentIssueElement); + cConfigurationChecker *cChecker = + cConfigurationChecker::ParseConfigurationChecker(nodeToProcess, currentIssueElement); if (nullptr != cChecker) currentCheckerBundle->m_Checkers.push_back(cChecker); } @@ -63,15 +68,14 @@ void cConfigurationCheckerBundle::ProcessDomNode(DOMNode* nodeToProcess, cConfig } } -DOMElement* cConfigurationCheckerBundle::WriteXML(DOMDocument* pResultDocument, DOMElement* p_parentElement) const +DOMElement *cConfigurationCheckerBundle::WriteXML(DOMDocument *pResultDocument, DOMElement *p_parentElement) const { - DOMElement* p_dataElement = CreateXMLNode(pResultDocument); + DOMElement *p_dataElement = CreateXMLNode(pResultDocument); // Add parameters m_params.WriteXML(pResultDocument, p_dataElement); - for (std::vector::const_iterator it = m_Checkers.begin(); - it != m_Checkers.end(); ++it) + for (std::vector::const_iterator it = m_Checkers.begin(); it != m_Checkers.end(); ++it) { (*it)->WriteXML(pResultDocument, p_dataElement); } @@ -81,11 +85,11 @@ DOMElement* cConfigurationCheckerBundle::WriteXML(DOMDocument* pResultDocument, return p_dataElement; } -DOMElement* cConfigurationCheckerBundle::CreateXMLNode(DOMDocument* pResultDocument) const +DOMElement *cConfigurationCheckerBundle::CreateXMLNode(DOMDocument *pResultDocument) const { - DOMElement* p_DataElement = pResultDocument->createElement(cConfigurationCheckerBundle::TAG_CHECKERBUNDLE); + DOMElement *p_DataElement = pResultDocument->createElement(cConfigurationCheckerBundle::TAG_CHECKERBUNDLE); - XMLCh* pApplication = XMLString::transcode(this->strApplication.c_str()); + XMLCh *pApplication = XMLString::transcode(this->strApplication.c_str()); p_DataElement->setAttribute(cConfigurationCheckerBundle::ATTR_APPLICATION, pApplication); @@ -94,15 +98,14 @@ DOMElement* cConfigurationCheckerBundle::CreateXMLNode(DOMDocument* pResultDocum return p_DataElement; } -std::vector cConfigurationCheckerBundle::GetConfigurationCheckers() const +std::vector cConfigurationCheckerBundle::GetConfigurationCheckers() const { return m_Checkers; } void cConfigurationCheckerBundle::Clear() { - for (std::vector::iterator it = m_Checkers.begin(); - it != m_Checkers.end(); it++) + for (std::vector::iterator it = m_Checkers.begin(); it != m_Checkers.end(); it++) { (*it)->Clear(); delete (*it); @@ -128,23 +131,23 @@ std::string cConfigurationCheckerBundle::GetCheckerBundleApplication() const } // Returns the checkers -std::vector cConfigurationCheckerBundle::GetCheckers() const +std::vector cConfigurationCheckerBundle::GetCheckers() const { return m_Checkers; } -cConfigurationChecker* cConfigurationCheckerBundle::AddChecker(const std::string& checkerId, eIssueLevel minLevel, eIssueLevel maxLevel) +cConfigurationChecker *cConfigurationCheckerBundle::AddChecker(const std::string &checkerId, eIssueLevel minLevel, + eIssueLevel maxLevel) { - cConfigurationChecker* result = new cConfigurationChecker(checkerId, minLevel, maxLevel); + cConfigurationChecker *result = new cConfigurationChecker(checkerId, minLevel, maxLevel); m_Checkers.push_back(result); return result; } - -cConfigurationChecker* cConfigurationCheckerBundle::GetCheckerById(const std::string& checkerID) const +cConfigurationChecker *cConfigurationCheckerBundle::GetCheckerById(const std::string &checkerID) const { - std::vector::const_iterator it = m_Checkers.cbegin(); + std::vector::const_iterator it = m_Checkers.cbegin(); for (; it != m_Checkers.cend(); it++) { @@ -157,9 +160,9 @@ cConfigurationChecker* cConfigurationCheckerBundle::GetCheckerById(const std::st return nullptr; } -bool cConfigurationCheckerBundle::HasCheckerWithId(const std::string& checkerID) const +bool cConfigurationCheckerBundle::HasCheckerWithId(const std::string &checkerID) const { - std::vector::const_iterator it = m_Checkers.cbegin(); + std::vector::const_iterator it = m_Checkers.cbegin(); for (; it != m_Checkers.cend(); it++) { @@ -177,23 +180,22 @@ cParameterContainer cConfigurationCheckerBundle::GetParams() const return m_params; } -void cConfigurationCheckerBundle::SetParam(const std::string& name, const std::string& value) +void cConfigurationCheckerBundle::SetParam(const std::string &name, const std::string &value) { return m_params.SetParam(name, value); } - -bool cConfigurationCheckerBundle::HasParam(const std::string& name) const +bool cConfigurationCheckerBundle::HasParam(const std::string &name) const { return m_params.HasParam(name); } -std::string cConfigurationCheckerBundle::GetParam(const std::string& name) const +std::string cConfigurationCheckerBundle::GetParam(const std::string &name) const { return m_params.GetParam(name); } -void cConfigurationCheckerBundle::OverwriteParams(const cParameterContainer& params) +void cConfigurationCheckerBundle::OverwriteParams(const cParameterContainer ¶ms) { m_params.Overwrite(params); } diff --git a/src/common/src/config_format/cConfigurationReportModule.cpp b/src/common/src/config_format/c_configuration_report_module.cpp similarity index 60% rename from src/common/src/config_format/cConfigurationReportModule.cpp rename to src/common/src/config_format/c_configuration_report_module.cpp index 31bca641..2c16ea73 100644 --- a/src/common/src/config_format/cConfigurationReportModule.cpp +++ b/src/common/src/config_format/c_configuration_report_module.cpp @@ -5,38 +5,39 @@ * Public License, v. 2.0. If a copy of the MPL was not distributed * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "common/config_format/cConfigurationReportModule.h" +#include "common/config_format/c_configuration_report_module.h" XERCES_CPP_NAMESPACE_USE -const XMLCh* cConfigurationReportModule::ATTR_APPLICATION = CONST_XMLCH("application"); -const XMLCh* cConfigurationReportModule::TAG_REPORT_MODULE = CONST_XMLCH("ReportModule"); +const XMLCh *cConfigurationReportModule::ATTR_APPLICATION = CONST_XMLCH("application"); +const XMLCh *cConfigurationReportModule::TAG_REPORT_MODULE = CONST_XMLCH("ReportModule"); cConfigurationReportModule::cConfigurationReportModule() { - } -cConfigurationReportModule::cConfigurationReportModule(const std::string& applicationName) : cConfigurationReportModule() +cConfigurationReportModule::cConfigurationReportModule(const std::string &applicationName) + : cConfigurationReportModule() { strApplication = applicationName; } -cConfigurationReportModule* cConfigurationReportModule::ParseConfigurationReportModule(DOMNode* const pXMLNode, DOMElement* const pXMLElement) +cConfigurationReportModule *cConfigurationReportModule::ParseConfigurationReportModule(DOMNode *const pXMLNode, + DOMElement *const pXMLElement) { - cConfigurationReportModule* parsedReportModule = new cConfigurationReportModule(); + cConfigurationReportModule *parsedReportModule = new cConfigurationReportModule(); std::string strApp = XMLString::transcode(pXMLElement->getAttribute(ATTR_APPLICATION)); parsedReportModule->strApplication = strApp; if (pXMLNode->getNodeType() == DOMNode::ELEMENT_NODE) { - DOMNodeList* pCheckerChildList = pXMLNode->getChildNodes(); - const XMLSize_t checkerNodeCount = pCheckerChildList->getLength(); + DOMNodeList *pCheckerChildList = pXMLNode->getChildNodes(); + const XMLSize_t checkerNodeCount = pCheckerChildList->getLength(); for (XMLSize_t j = 0; j < checkerNodeCount; ++j) { - DOMNode* currentCheckerNode = pCheckerChildList->item(j); + DOMNode *currentCheckerNode = pCheckerChildList->item(j); if (currentCheckerNode->getNodeType() == DOMNode::ELEMENT_NODE) parsedReportModule->ProcessDomNode(currentCheckerNode, parsedReportModule); } @@ -45,23 +46,24 @@ cConfigurationReportModule* cConfigurationReportModule::ParseConfigurationReport return parsedReportModule; } -void cConfigurationReportModule::ProcessDomNode(DOMNode* nodeToProcess, cConfigurationReportModule* currentCheckerBundle) +void cConfigurationReportModule::ProcessDomNode(DOMNode *nodeToProcess, + cConfigurationReportModule *currentCheckerBundle) { - DOMElement* currentIssueElement = dynamic_cast(nodeToProcess); - const char* currentTagName = XMLString::transcode(currentIssueElement->getTagName()); + DOMElement *currentIssueElement = dynamic_cast(nodeToProcess); + const char *currentTagName = XMLString::transcode(currentIssueElement->getTagName()); if (Equals(currentTagName, XMLString::transcode(cParameterContainer::TAG_PARAM))) cParameterContainer::ParseFromXML(nodeToProcess, currentIssueElement, ¤tCheckerBundle->m_params); } -DOMElement * cConfigurationReportModule::WriteXML(DOMDocument* pResultDocument, DOMElement* p_parentElement) const +DOMElement *cConfigurationReportModule::WriteXML(DOMDocument *pResultDocument, DOMElement *p_parentElement) const { - DOMElement* p_DataElement = pResultDocument->createElement(cConfigurationReportModule::TAG_REPORT_MODULE); + DOMElement *p_DataElement = pResultDocument->createElement(cConfigurationReportModule::TAG_REPORT_MODULE); // Add parameters m_params.WriteXML(pResultDocument, p_DataElement); - XMLCh* pApplication = XMLString::transcode(strApplication.c_str()); + XMLCh *pApplication = XMLString::transcode(strApplication.c_str()); p_DataElement->setAttribute(cConfigurationReportModule::ATTR_APPLICATION, pApplication); p_parentElement->appendChild(p_DataElement); @@ -82,7 +84,7 @@ cConfigurationReportModule::~cConfigurationReportModule() } // Sets the name of the report module -void cConfigurationReportModule::SetReportModuleApplication(const std::string& applicationName) +void cConfigurationReportModule::SetReportModuleApplication(const std::string &applicationName) { strApplication = applicationName; } @@ -97,23 +99,22 @@ cParameterContainer cConfigurationReportModule::GetParams() const return m_params; } -void cConfigurationReportModule::SetParam(const std::string& name, const std::string& value) +void cConfigurationReportModule::SetParam(const std::string &name, const std::string &value) { return m_params.SetParam(name, value); } - -bool cConfigurationReportModule::HasParam(const std::string& name) const +bool cConfigurationReportModule::HasParam(const std::string &name) const { return m_params.HasParam(name); } -std::string cConfigurationReportModule::GetParam(const std::string& name) const +std::string cConfigurationReportModule::GetParam(const std::string &name) const { return m_params.GetParam(name); } -void cConfigurationReportModule::OverwriteParams(const cParameterContainer& params) +void cConfigurationReportModule::OverwriteParams(const cParameterContainer ¶ms) { m_params.Overwrite(params); } diff --git a/src/common/src/result_format/cLocationsContainer.cpp b/src/common/src/result_format/cLocationsContainer.cpp deleted file mode 100644 index 649a4368..00000000 --- a/src/common/src/result_format/cLocationsContainer.cpp +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -#include "common/result_format/cLocationsContainer.h" -#include "common/util.h" - -#include "common/result_format/cExtendedInformation.h" -#include "common/result_format/cFileLocation.h" -#include "common/result_format/cXMLLocation.h" -#include "common/result_format/cRoadLocation.h" -#include "common/result_format/cInertialLocation.h" - -XERCES_CPP_NAMESPACE_USE - -const XMLCh* cLocationsContainer::TAG_LOCATIONS = CONST_XMLCH("Locations"); -const XMLCh* cLocationsContainer::ATTR_DESCRIPTION = CONST_XMLCH("description"); - - -cLocationsContainer::cLocationsContainer(const std::string& description, cExtendedInformation* extendedInformation) -{ - m_Description = description; - AddExtendedInformation(extendedInformation); -} - -cLocationsContainer::cLocationsContainer(const std::string& description, std::list listExt) - : cLocationsContainer(description) -{ - AddExtendedInformation(listExt); -} - -cLocationsContainer::~cLocationsContainer() -{ - for (std::list::const_iterator extIt = m_Extended.cbegin(); - extIt != m_Extended.cend(); - extIt++) - { - delete (*extIt); - } - - m_Extended.clear(); -} - -void cLocationsContainer::AddExtendedInformation(cExtendedInformation* extendedInformation) -{ - if (nullptr != extendedInformation) - m_Extended.push_back(extendedInformation); -} - -void cLocationsContainer::AddExtendedInformation(std::list listExt) -{ - m_Extended.insert(m_Extended.end(), listExt.begin(), listExt.end()); -} - -DOMElement * cLocationsContainer::WriteXML(DOMDocument* p_resultDocument) -{ - DOMElement* p_DataElement = p_resultDocument->createElement(TAG_LOCATIONS); - XMLCh* pDescription = XMLString::transcode(m_Description.c_str()); - p_DataElement->setAttribute(ATTR_DESCRIPTION, pDescription); - - // Write extended informations - if (HasExtendedInformations()) - { - for (std::list::const_iterator extIt = m_Extended.cbegin(); - extIt != m_Extended.cend(); - extIt++) - { - DOMElement* extElement = (*extIt)->WriteXML(p_resultDocument); - p_DataElement->appendChild(extElement); - } - } - - XMLString::release(&pDescription); - - return p_DataElement; -} - -cLocationsContainer* cLocationsContainer::ParseFromXML(DOMNode* pXMLNode, DOMElement* pXMLElement) -{ - std::string strDescription = XMLString::transcode(pXMLElement->getAttribute(ATTR_DESCRIPTION)); - - cLocationsContainer* subIssue = new cLocationsContainer(strDescription); - - DOMNodeList* pIssueChildList = pXMLNode->getChildNodes(); - const XMLSize_t issueNodeCount = pIssueChildList->getLength(); - - // Iterate Extended Informations and parse ... - for (XMLSize_t i = 0; i < issueNodeCount; ++i) - { - DOMNode* currentIssueNode = pIssueChildList->item(i); - - if (currentIssueNode->getNodeType() && - currentIssueNode->getNodeType() == DOMNode::ELEMENT_NODE) - { - DOMElement* currentIssueElement = dynamic_cast(currentIssueNode); - const char* currentTagName = XMLString::transcode(currentIssueElement->getTagName()); - - // Parse cFileLocation - if (Equals(currentTagName, XMLString::transcode(cFileLocation::TAG_NAME))) - { - subIssue->AddExtendedInformation((cExtendedInformation*)cFileLocation::ParseFromXML(currentIssueNode, currentIssueElement)); - } - // Parse cXMLLocation - else if (Equals(currentTagName, XMLString::transcode(cXMLLocation::TAG_NAME))) - { - subIssue->AddExtendedInformation((cExtendedInformation*)cXMLLocation::ParseFromXML(currentIssueNode, currentIssueElement)); - } - // Parse cRoadLocation - else if (Equals(currentTagName, XMLString::transcode(cRoadLocation::TAG_NAME))) - { - subIssue->AddExtendedInformation((cExtendedInformation*)cRoadLocation::ParseFromXML(currentIssueNode, currentIssueElement)); - } - // Parse cInertialLocation - else if (Equals(currentTagName, XMLString::transcode(cInertialLocation::TAG_NAME))) - { - subIssue->AddExtendedInformation((cExtendedInformation*)cInertialLocation::ParseFromXML(currentIssueNode, currentIssueElement)); - } - } - } - - return subIssue; -} - -bool cLocationsContainer::HasExtendedInformations() const -{ - return (m_Extended.size() != 0); -} - -size_t cLocationsContainer::GetExtendedInformationCount() const -{ - return m_Extended.size(); -} - -// Returns all extended informations -std::list cLocationsContainer::GetExtendedInformations() const -{ - return m_Extended; -} - -void cLocationsContainer::SetDescription(const std::string& strDescription) -{ - m_Description = strDescription; -} - -// Returns the description -std::string cLocationsContainer::GetDescription() const -{ - return m_Description; -} diff --git a/src/common/src/result_format/cChecker.cpp b/src/common/src/result_format/c_checker.cpp similarity index 59% rename from src/common/src/result_format/cChecker.cpp rename to src/common/src/result_format/c_checker.cpp index a99fbbec..bc00bc3e 100644 --- a/src/common/src/result_format/cChecker.cpp +++ b/src/common/src/result_format/c_checker.cpp @@ -5,13 +5,13 @@ * Public License, v. 2.0. If a copy of the MPL was not distributed * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "common/result_format/cChecker.h" -#include "common/result_format/cCheckerBundle.h" +#include "common/result_format/c_checker.h" +#include "common/result_format/c_checker_bundle.h" -const XMLCh* cChecker::TAG_CHECKER = CONST_XMLCH("Checker"); -const XMLCh* cChecker::ATTR_CHECKER_ID = CONST_XMLCH("checkerId"); -const XMLCh* cChecker::ATTR_DESCRIPTION = CONST_XMLCH("description"); -const XMLCh* cChecker::ATTR_SUMMARY = CONST_XMLCH("summary"); +const XMLCh *cChecker::TAG_CHECKER = CONST_XMLCH("Checker"); +const XMLCh *cChecker::ATTR_CHECKER_ID = CONST_XMLCH("checkerId"); +const XMLCh *cChecker::ATTR_DESCRIPTION = CONST_XMLCH("description"); +const XMLCh *cChecker::ATTR_SUMMARY = CONST_XMLCH("summary"); XERCES_CPP_NAMESPACE_USE @@ -40,61 +40,61 @@ std::string cChecker::GetDescription() const } // Sets the description -void cChecker::SetDescription(const std::string& strDescription) +void cChecker::SetDescription(const std::string &strDescription) { m_Description = strDescription; } // Write the xml for this issue -DOMElement* cChecker::WriteXML(DOMDocument* pResultDocument) +DOMElement *cChecker::WriteXML(DOMDocument *pResultDocument) { // Add bundle summary - DOMElement* pCheckerNode = CreateNode(pResultDocument); + DOMElement *pCheckerNode = CreateNode(pResultDocument); // Add parameters m_Params.WriteXML(pResultDocument, pCheckerNode); // Add Issues und cCheckerSummaries - for (std::list::const_iterator it = m_Issues.begin(); it != m_Issues.end(); ++it) + for (std::list::const_iterator it = m_Issues.begin(); it != m_Issues.end(); ++it) { - DOMElement* p_DataElement = (*it)->WriteXML(pResultDocument); + DOMElement *p_DataElement = (*it)->WriteXML(pResultDocument); - if(nullptr != p_DataElement) + if (nullptr != p_DataElement) pCheckerNode->appendChild(p_DataElement); } return pCheckerNode; } -cCheckerBundle* cChecker::GetCheckerBundle() const +cCheckerBundle *cChecker::GetCheckerBundle() const { return m_Bundle; } // Creates an Checker out of an XML Element -cChecker* cChecker::ParseFromXML(DOMNode* pXMLNode, DOMElement* pXMLElement, cCheckerBundle* checkerBundle) +cChecker *cChecker::ParseFromXML(DOMNode *pXMLNode, DOMElement *pXMLElement, cCheckerBundle *checkerBundle) { std::string strCheckerId = XMLString::transcode(pXMLElement->getAttribute(ATTR_CHECKER_ID)); std::string strSummary = XMLString::transcode(pXMLElement->getAttribute(ATTR_SUMMARY)); std::string strDescription = XMLString::transcode(pXMLElement->getAttribute(ATTR_DESCRIPTION)); - cChecker* pChecker = new cChecker(strCheckerId, strDescription, strSummary); + cChecker *pChecker = new cChecker(strCheckerId, strDescription, strSummary); pChecker->AssignCheckerBundle(checkerBundle); - DOMNodeList* pIssueChildList = pXMLNode->getChildNodes(); - const XMLSize_t issueNodeCount = pIssueChildList->getLength(); + DOMNodeList *pIssueChildList = pXMLNode->getChildNodes(); + const XMLSize_t issueNodeCount = pIssueChildList->getLength(); // Iterate Issues for (XMLSize_t j = 0; j < issueNodeCount; ++j) { - DOMNode* currentIssueNode = pIssueChildList->item(j); + DOMNode *currentIssueNode = pIssueChildList->item(j); // Is element node... if (currentIssueNode->getNodeType() == DOMNode::ELEMENT_NODE) { - DOMElement* currentIssueElement = dynamic_cast< xercesc::DOMElement* >(currentIssueNode); - const char* currentTagName = XMLString::transcode(currentIssueElement->getTagName()); + DOMElement *currentIssueElement = dynamic_cast(currentIssueNode); + const char *currentTagName = XMLString::transcode(currentIssueElement->getTagName()); // Parse Param if (Equals(currentTagName, XMLString::transcode(cParameterContainer::TAG_PARAM))) @@ -105,9 +105,9 @@ cChecker* cChecker::ParseFromXML(DOMNode* pXMLNode, DOMElement* pXMLElement, cCh // Parse Issue if (Equals(currentTagName, XMLString::transcode(cIssue::TAG_ISSUE))) { - cIssue* issueInstance = cIssue::ParseFromXML(currentIssueNode, currentIssueElement, pChecker); + cIssue *issueInstance = cIssue::ParseFromXML(currentIssueNode, currentIssueElement, pChecker); - if(issueInstance != nullptr) + if (issueInstance != nullptr) pChecker->AddIssue(issueInstance); } } @@ -116,13 +116,13 @@ cChecker* cChecker::ParseFromXML(DOMNode* pXMLNode, DOMElement* pXMLElement, cCh return pChecker; } -DOMElement* cChecker::CreateNode(DOMDocument* pDOMDocResultDocument) +DOMElement *cChecker::CreateNode(DOMDocument *pDOMDocResultDocument) { - DOMElement* pBundleSummary = pDOMDocResultDocument->createElement(TAG_CHECKER); + DOMElement *pBundleSummary = pDOMDocResultDocument->createElement(TAG_CHECKER); - XMLCh* pCheckerId = XMLString::transcode(m_CheckerId.c_str()); - XMLCh* pDescription = XMLString::transcode(m_Description.c_str()); - XMLCh* pSummary = XMLString::transcode(m_Summary.c_str()); + XMLCh *pCheckerId = XMLString::transcode(m_CheckerId.c_str()); + XMLCh *pDescription = XMLString::transcode(m_Description.c_str()); + XMLCh *pSummary = XMLString::transcode(m_Summary.c_str()); pBundleSummary->setAttribute(ATTR_CHECKER_ID, pCheckerId); pBundleSummary->setAttribute(ATTR_DESCRIPTION, pDescription); @@ -135,7 +135,7 @@ DOMElement* cChecker::CreateNode(DOMDocument* pDOMDocResultDocument) return pBundleSummary; } -void cChecker::SetSummary(const std::string& strSummary) +void cChecker::SetSummary(const std::string &strSummary) { m_Summary = strSummary; } @@ -149,7 +149,7 @@ void cChecker::UpdateSummary() SetSummary(ss.str()); } -cIssue* cChecker::AddIssue(cIssue* const issueToAdd) +cIssue *cChecker::AddIssue(cIssue *const issueToAdd) { if (nullptr == m_Bundle) { @@ -171,7 +171,7 @@ cIssue* cChecker::AddIssue(cIssue* const issueToAdd) // Deletes all issues void cChecker::Clear() { - for (std::list::iterator it = m_Issues.begin(); it != m_Issues.end(); it++) + for (std::list::iterator it = m_Issues.begin(); it != m_Issues.end(); it++) delete *it; m_Issues.clear(); @@ -184,30 +184,27 @@ unsigned int cChecker::GetIssueCount() } // Returns the checkers -std::list cChecker::GetIssues() +std::list cChecker::GetIssues() { return m_Issues; } // Assigns a specific bundle to the checker -void cChecker::AssignCheckerBundle(cCheckerBundle* myBundle) +void cChecker::AssignCheckerBundle(cCheckerBundle *myBundle) { m_Bundle = myBundle; } -void cChecker::DoProcessing(void(*funcIteratorPtr)(cIssue*)) +void cChecker::DoProcessing(void (*funcIteratorPtr)(cIssue *)) { - for (std::list::const_iterator itIssue = m_Issues.begin(); itIssue != m_Issues.end(); - itIssue++) + for (std::list::const_iterator itIssue = m_Issues.begin(); itIssue != m_Issues.end(); itIssue++) funcIteratorPtr(*itIssue); } // Returns an issue by its id -cIssue* cChecker::GetIssueById(unsigned long long id) const +cIssue *cChecker::GetIssueById(unsigned long long id) const { - for (std::list::const_iterator itIssues = m_Issues.cbegin(); - itIssues != m_Issues.cend(); - itIssues++) + for (std::list::const_iterator itIssues = m_Issues.cbegin(); itIssues != m_Issues.cend(); itIssues++) { if ((*itIssues)->GetIssueId() == id) return (*itIssues); @@ -216,37 +213,37 @@ cIssue* cChecker::GetIssueById(unsigned long long id) const return nullptr; } -void cChecker::SetParam(const std::string& name, const std::string& value) +void cChecker::SetParam(const std::string &name, const std::string &value) { return m_Params.SetParam(name, value); } -void cChecker::SetParam(const std::string& name, const int& value) +void cChecker::SetParam(const std::string &name, const int &value) { return m_Params.SetParam(name, value); } -void cChecker::SetParam(const std::string& name, const float& value) +void cChecker::SetParam(const std::string &name, const float &value) { return m_Params.SetParam(name, value); } -void cChecker::SetParam(const std::string& name, const double& value) +void cChecker::SetParam(const std::string &name, const double &value) { return m_Params.SetParam(name, value); } -std::string cChecker::GetParam(const std::string& name) const +std::string cChecker::GetParam(const std::string &name) const { return m_Params.GetParam(name); } -bool cChecker::HasParam(const std::string& name) const +bool cChecker::HasParam(const std::string &name) const { return m_Params.HasParam(name); } -bool cChecker::DeleteParam(const std::string& name) +bool cChecker::DeleteParam(const std::string &name) { return m_Params.DeleteParam(name); } @@ -257,41 +254,41 @@ void cChecker::ClearParams() } /* -* Return the names of all parameters -*/ + * Return the names of all parameters + */ std::vector cChecker::GetParams() const { return m_Params.GetParams(); } /* -* Return true if parameters are available -*/ + * Return true if parameters are available + */ bool cChecker::HasParams() const { return m_Params.HasParams(); } /* -* Return the count of parameters -*/ + * Return the count of parameters + */ size_t cChecker::CountParams() const { return m_Params.CountParams(); } /* -* Returns an instance of the param container -*/ -cParameterContainer const* cChecker::GetParamContainer() const + * Returns an instance of the param container + */ +cParameterContainer const *cChecker::GetParamContainer() const { return &m_Params; } /* -* Returns an instance of the param container -*/ -cParameterContainer* cChecker::GetParamContainer() + * Returns an instance of the param container + */ +cParameterContainer *cChecker::GetParamContainer() { return &m_Params; } @@ -306,11 +303,10 @@ unsigned long long cChecker::NextFreeId() const { unsigned long long newId = 0; - while(true) + while (true) { // Try to find new id in issues - for (std::list::const_iterator itIssues = m_Issues.cbegin(); - itIssues != m_Issues.cend(); + for (std::list::const_iterator itIssues = m_Issues.cbegin(); itIssues != m_Issues.cend(); itIssues++) { if ((*itIssues)->GetIssueId() == newId) @@ -324,4 +320,4 @@ unsigned long long cChecker::NextFreeId() const return newId; } } -} \ No newline at end of file +} diff --git a/src/common/src/result_format/cCheckerBundle.cpp b/src/common/src/result_format/c_checker_bundle.cpp similarity index 56% rename from src/common/src/result_format/cCheckerBundle.cpp rename to src/common/src/result_format/c_checker_bundle.cpp index 3cf74562..04a11881 100644 --- a/src/common/src/result_format/cCheckerBundle.cpp +++ b/src/common/src/result_format/c_checker_bundle.cpp @@ -5,22 +5,23 @@ * Public License, v. 2.0. If a copy of the MPL was not distributed * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "common/result_format/cCheckerBundle.h" +#include "common/result_format/c_checker_bundle.h" -#include "common/result_format/cResultContainer.h" -#include "common/result_format/cChecker.h" +#include "common/result_format/c_checker.h" +#include "common/result_format/c_result_container.h" XERCES_CPP_NAMESPACE_USE -const XMLCh* cCheckerBundle::TAG_CHECKER_BUNDLE = CONST_XMLCH("CheckerBundle"); -const XMLCh* cCheckerBundle::ATTR_CHECKER_NAME = CONST_XMLCH("name"); -const XMLCh* cCheckerBundle::ATTR_CHECKER_SUMMARY = CONST_XMLCH("summary"); -const XMLCh* cCheckerBundle::ATTR_DESCR = CONST_XMLCH("description"); -const XMLCh* cCheckerBundle::ATTR_BUILD_DATE = CONST_XMLCH("build_date"); -const XMLCh* cCheckerBundle::ATTR_BUILD_VERSION = CONST_XMLCH("version"); +const XMLCh *cCheckerBundle::TAG_CHECKER_BUNDLE = CONST_XMLCH("CheckerBundle"); +const XMLCh *cCheckerBundle::ATTR_CHECKER_NAME = CONST_XMLCH("name"); +const XMLCh *cCheckerBundle::ATTR_CHECKER_SUMMARY = CONST_XMLCH("summary"); +const XMLCh *cCheckerBundle::ATTR_DESCR = CONST_XMLCH("description"); +const XMLCh *cCheckerBundle::ATTR_BUILD_DATE = CONST_XMLCH("build_date"); +const XMLCh *cCheckerBundle::ATTR_BUILD_VERSION = CONST_XMLCH("version"); -cCheckerBundle::cCheckerBundle(const std::string& checkerName, const std::string& checkerSummary, const std::string& description) : - m_CheckerName(checkerName), m_CheckerSummary(checkerSummary), m_Description(description) +cCheckerBundle::cCheckerBundle(const std::string &checkerName, const std::string &checkerSummary, + const std::string &description) + : m_CheckerName(checkerName), m_CheckerSummary(checkerSummary), m_Description(description) { m_BuildDate = BUILD_DATE; m_BuildVersion = BUILD_VERSION; @@ -32,15 +33,15 @@ cCheckerBundle::~cCheckerBundle() } // Creates the basic XM node of a checker bundle -DOMElement* cCheckerBundle::CreateXMLNode(DOMDocument* pResultDocument) +DOMElement *cCheckerBundle::CreateXMLNode(DOMDocument *pResultDocument) { - DOMElement* p_DataElement = pResultDocument->createElement(TAG_CHECKER_BUNDLE); + DOMElement *p_DataElement = pResultDocument->createElement(TAG_CHECKER_BUNDLE); - XMLCh* pCheckerName = XMLString::transcode(m_CheckerName.c_str()); - XMLCh* pCheckerSummary = XMLString::transcode(m_CheckerSummary.c_str()); - XMLCh* pDescription = XMLString::transcode(m_Description.c_str()); - XMLCh* pBuildDate = XMLString::transcode(m_BuildDate.c_str()); - XMLCh* pBuildVersion = XMLString::transcode(m_BuildVersion.c_str()); + XMLCh *pCheckerName = XMLString::transcode(m_CheckerName.c_str()); + XMLCh *pCheckerSummary = XMLString::transcode(m_CheckerSummary.c_str()); + XMLCh *pDescription = XMLString::transcode(m_Description.c_str()); + XMLCh *pBuildDate = XMLString::transcode(m_BuildDate.c_str()); + XMLCh *pBuildVersion = XMLString::transcode(m_BuildVersion.c_str()); p_DataElement->setAttribute(ATTR_CHECKER_NAME, pCheckerName); p_DataElement->setAttribute(ATTR_CHECKER_SUMMARY, pCheckerSummary); @@ -57,20 +58,19 @@ DOMElement* cCheckerBundle::CreateXMLNode(DOMDocument* pResultDocument) return p_DataElement; } -DOMElement * cCheckerBundle::WriteXML(DOMDocument* pResultDocument) +DOMElement *cCheckerBundle::WriteXML(DOMDocument *pResultDocument) { - DOMElement* pDataElement = CreateXMLNode(pResultDocument); + DOMElement *pDataElement = CreateXMLNode(pResultDocument); // Add parameters m_Params.WriteXML(pResultDocument, pDataElement); // Add checkers - for (std::list::const_iterator it = m_Checkers.begin(); it != m_Checkers.end(); - ++it) + for (std::list::const_iterator it = m_Checkers.begin(); it != m_Checkers.end(); ++it) { - DOMElement* pChildElement = (*it)->WriteXML(pResultDocument); + DOMElement *pChildElement = (*it)->WriteXML(pResultDocument); - if(nullptr != pChildElement) + if (nullptr != pChildElement) pDataElement->appendChild(pChildElement); } @@ -84,30 +84,31 @@ std::string cCheckerBundle::GetCheckerID() const } // Creates a CheckerSummary out of an XML Element -cCheckerBundle* cCheckerBundle::ParseFromXML(DOMNode* pXMLNode, DOMElement* pXMLElement, cResultContainer* targetContainer) +cCheckerBundle *cCheckerBundle::ParseFromXML(DOMNode *pXMLNode, DOMElement *pXMLElement, + cResultContainer *targetContainer) { std::string strCheckerName = XMLString::transcode(pXMLElement->getAttribute(ATTR_CHECKER_NAME)); std::string strCheckerSummary = XMLString::transcode(pXMLElement->getAttribute(ATTR_CHECKER_SUMMARY)); std::string strDescription = XMLString::transcode(pXMLElement->getAttribute(ATTR_DESCR)); - cCheckerBundle* checkerBundle = new cCheckerBundle(strCheckerName, strCheckerSummary, strDescription); + cCheckerBundle *checkerBundle = new cCheckerBundle(strCheckerName, strCheckerSummary, strDescription); checkerBundle->SetBuildDate(XMLString::transcode(pXMLElement->getAttribute(ATTR_BUILD_DATE))); checkerBundle->SetBuildVersion(XMLString::transcode(pXMLElement->getAttribute(ATTR_BUILD_VERSION))); checkerBundle->AssignResultContainer(targetContainer); - DOMNodeList* pCheckerChildList = pXMLNode->getChildNodes(); - const XMLSize_t checkerNodeCount = pCheckerChildList->getLength(); + DOMNodeList *pCheckerChildList = pXMLNode->getChildNodes(); + const XMLSize_t checkerNodeCount = pCheckerChildList->getLength(); // Iterate Issues for (XMLSize_t j = 0; j < checkerNodeCount; ++j) { - DOMNode* currentCheckerNode = pCheckerChildList->item(j); + DOMNode *currentCheckerNode = pCheckerChildList->item(j); // Is element node... if (currentCheckerNode->getNodeType() == DOMNode::ELEMENT_NODE) { - DOMElement* currentIssueElement = dynamic_cast< DOMElement* >(currentCheckerNode); - const char* currentTagName = XMLString::transcode(currentIssueElement->getTagName()); + DOMElement *currentIssueElement = dynamic_cast(currentCheckerNode); + const char *currentTagName = XMLString::transcode(currentIssueElement->getTagName()); // Parse Param if (Equals(currentTagName, XMLString::transcode(cParameterContainer::TAG_PARAM))) @@ -118,7 +119,8 @@ cCheckerBundle* cCheckerBundle::ParseFromXML(DOMNode* pXMLNode, DOMElement* pXML // Parse Checker if (Equals(currentTagName, XMLString::transcode(cChecker::TAG_CHECKER))) { - cChecker* checkerInstance = cChecker::ParseFromXML(currentCheckerNode, currentIssueElement, checkerBundle); + cChecker *checkerInstance = + cChecker::ParseFromXML(currentCheckerNode, currentIssueElement, checkerBundle); if (checkerInstance != nullptr) checkerBundle->CreateChecker(checkerInstance); @@ -133,7 +135,7 @@ cCheckerBundle* cCheckerBundle::ParseFromXML(DOMNode* pXMLNode, DOMElement* pXML } // Adds a new checker -cChecker* cCheckerBundle::CreateChecker(cChecker* newChecker) +cChecker *cCheckerBundle::CreateChecker(cChecker *newChecker) { if (nullptr == newChecker) return nullptr; @@ -144,14 +146,16 @@ cChecker* cCheckerBundle::CreateChecker(cChecker* newChecker) } // Adds a new checker -cChecker* cCheckerBundle::CreateChecker(const std::string& checkerId, const std::string& strDescription, const std::string& strSummary) +cChecker *cCheckerBundle::CreateChecker(const std::string &checkerId, const std::string &strDescription, + const std::string &strSummary) { return CreateChecker(new cChecker(checkerId, strDescription, strSummary)); } -cChecker* cCheckerBundle::CreateCheckerWithIssues(const std::string& strCheckerId, const std::string& strDescription, eIssueLevel issueLevel, std::map m_Issues) +cChecker *cCheckerBundle::CreateCheckerWithIssues(const std::string &strCheckerId, const std::string &strDescription, + eIssueLevel issueLevel, std::map m_Issues) { - cChecker* pChecker = new cChecker(strCheckerId, strDescription, ""); + cChecker *pChecker = new cChecker(strCheckerId, strDescription, ""); CreateChecker(pChecker); for (std::map::const_iterator it = m_Issues.cbegin(); it != m_Issues.cend(); it++) @@ -171,7 +175,7 @@ cChecker* cCheckerBundle::CreateCheckerWithIssues(const std::string& strCheckerI // Deletes all checkers void cCheckerBundle::Clear() { - for (std::list::const_iterator it = m_Checkers.begin(); it != m_Checkers.end(); it++) + for (std::list::const_iterator it = m_Checkers.begin(); it != m_Checkers.end(); it++) { (*it)->Clear(); delete *it; @@ -181,41 +185,41 @@ void cCheckerBundle::Clear() } // Sets the summary -void cCheckerBundle::SetSummary(const std::string& strSummary) +void cCheckerBundle::SetSummary(const std::string &strSummary) { m_CheckerSummary = strSummary; } // Sets the file name -void cCheckerBundle::SetXODRFileName(const std::string& strFileName) +void cCheckerBundle::SetXODRFileName(const std::string &strFileName) { m_FileName = strFileName; } // Sets the file name -void cCheckerBundle::SetXODRFilePath(const std::string& strXodrFilePath) +void cCheckerBundle::SetXODRFilePath(const std::string &strXodrFilePath) { SetParam("XodrFile", strXodrFilePath); } // Sets the file name -void cCheckerBundle::SetXOSCFilePath(const std::string& strXoscFilePath) +void cCheckerBundle::SetXOSCFilePath(const std::string &strXoscFilePath) { SetParam("XoscFile", strXoscFilePath); } // Sets the file name -void cCheckerBundle::SetDescription(const std::string& strDescription) +void cCheckerBundle::SetDescription(const std::string &strDescription) { m_Description = strDescription; } -void cCheckerBundle::SetBuildDate(const std::string& strBuildDate) +void cCheckerBundle::SetBuildDate(const std::string &strBuildDate) { m_BuildDate = strBuildDate; } -void cCheckerBundle::SetBuildVersion(const std::string& strBuildVersion) +void cCheckerBundle::SetBuildVersion(const std::string &strBuildVersion) { m_BuildVersion = strBuildVersion; } @@ -273,7 +277,7 @@ unsigned int cCheckerBundle::GetIssueCount() const { unsigned int result = 0; - for (std::list::const_iterator it = m_Checkers.begin(); it != m_Checkers.end(); it++) + for (std::list::const_iterator it = m_Checkers.begin(); it != m_Checkers.end(); it++) result += (*it)->GetIssueCount(); return result; @@ -285,10 +289,9 @@ unsigned int cCheckerBundle::GetCheckerCount() const return (unsigned int)m_Checkers.size(); } -cChecker* cCheckerBundle::GetCheckerById(const std::string& checkerId) const +cChecker *cCheckerBundle::GetCheckerById(const std::string &checkerId) const { - for (std::list::const_iterator it = m_Checkers.begin(); it != m_Checkers.end(); - it++) + for (std::list::const_iterator it = m_Checkers.begin(); it != m_Checkers.end(); it++) { if ((*it)->GetCheckerID() == checkerId) return (*it); @@ -298,7 +301,7 @@ cChecker* cCheckerBundle::GetCheckerById(const std::string& checkerId) const } // Returns the checkers -std::list cCheckerBundle::GetCheckers() const +std::list cCheckerBundle::GetCheckers() const { return m_Checkers; } @@ -312,14 +315,12 @@ unsigned long long cCheckerBundle::NextFreeId() const else { unsigned long long newId = 0; - std::list issues = GetIssues(); + std::list issues = GetIssues(); while (true) { // Try to find new id in issues - for (std::list::const_iterator itIssues = issues.cbegin(); - itIssues != issues.cend(); - itIssues++) + for (std::list::const_iterator itIssues = issues.cbegin(); itIssues != issues.cend(); itIssues++) { if ((*itIssues)->GetIssueId() == newId) { @@ -334,28 +335,25 @@ unsigned long long cCheckerBundle::NextFreeId() const } } -void cCheckerBundle::DoProcessing(void(*funcIteratorPtr)(cChecker*, cIssue*)) +void cCheckerBundle::DoProcessing(void (*funcIteratorPtr)(cChecker *, cIssue *)) { - for (std::list::const_iterator itChecker = m_Checkers.begin(); - itChecker != m_Checkers.end(); + for (std::list::const_iterator itChecker = m_Checkers.begin(); itChecker != m_Checkers.end(); itChecker++) { - std::list issues = (*itChecker)->GetIssues(); + std::list issues = (*itChecker)->GetIssues(); - for (std::list::const_iterator itIssue = issues.begin(); itIssue != issues.end(); - itIssue++) + for (std::list::const_iterator itIssue = issues.begin(); itIssue != issues.end(); itIssue++) funcIteratorPtr(*itChecker, *itIssue); } } // Returns an issue by its id -cIssue* cCheckerBundle::GetIssueById(unsigned long long id) const +cIssue *cCheckerBundle::GetIssueById(unsigned long long id) const { - for (std::list::const_iterator itCheckers = m_Checkers.cbegin(); - itCheckers != m_Checkers.cend(); + for (std::list::const_iterator itCheckers = m_Checkers.cbegin(); itCheckers != m_Checkers.cend(); itCheckers++) { - cIssue* issue = (*itCheckers)->GetIssueById(id); + cIssue *issue = (*itCheckers)->GetIssueById(id); if (nullptr != issue) return issue; @@ -365,16 +363,15 @@ cIssue* cCheckerBundle::GetIssueById(unsigned long long id) const } // Gets the issues from all checkers -std::list cCheckerBundle::GetIssues() const +std::list cCheckerBundle::GetIssues() const { - std::list results; - std::list checkers = GetCheckers(); + std::list results; + std::list checkers = GetCheckers(); - for (std::list::const_iterator itCheckers = checkers.cbegin(); - itCheckers != checkers.cend(); + for (std::list::const_iterator itCheckers = checkers.cbegin(); itCheckers != checkers.cend(); itCheckers++) { - std::list issues = (*itCheckers)->GetIssues(); + std::list issues = (*itCheckers)->GetIssues(); results.insert(results.end(), issues.begin(), issues.end()); } @@ -382,37 +379,37 @@ std::list cCheckerBundle::GetIssues() const return results; } -void cCheckerBundle::SetParam(const std::string& name, const std::string& value) +void cCheckerBundle::SetParam(const std::string &name, const std::string &value) { return m_Params.SetParam(name, value); } -void cCheckerBundle::SetParam(const std::string& name, const double& value) +void cCheckerBundle::SetParam(const std::string &name, const double &value) { return m_Params.SetParam(name, value); } -void cCheckerBundle::SetParam(const std::string& name, const float& value) +void cCheckerBundle::SetParam(const std::string &name, const float &value) { return m_Params.SetParam(name, value); } -void cCheckerBundle::SetParam(const std::string& name, const int& value) +void cCheckerBundle::SetParam(const std::string &name, const int &value) { return m_Params.SetParam(name, value); } -std::string cCheckerBundle::GetParam(const std::string& name, const std::string& defaultValue) const +std::string cCheckerBundle::GetParam(const std::string &name, const std::string &defaultValue) const { return m_Params.GetParam(name, defaultValue); } -bool cCheckerBundle::HasParam(const std::string& name) const +bool cCheckerBundle::HasParam(const std::string &name) const { return m_Params.HasParam(name); } -bool cCheckerBundle::DeleteParam(const std::string& name) +bool cCheckerBundle::DeleteParam(const std::string &name) { return m_Params.DeleteParam(name); } @@ -428,67 +425,67 @@ std::vector cCheckerBundle::GetParams() const } /* -* Return true if parameters are available -*/ + * Return true if parameters are available + */ bool cCheckerBundle::HasParams() const { return m_Params.HasParams(); } /* -* Return the count of parameters -*/ + * Return the count of parameters + */ size_t cCheckerBundle::CountParams() const { return m_Params.CountParams(); } /* -* Returns an instance of the param container -*/ -cParameterContainer const* cCheckerBundle::GetParamContainer() const + * Returns an instance of the param container + */ +cParameterContainer const *cCheckerBundle::GetParamContainer() const { return &m_Params; } /* -* Returns an instance of the param container -*/ -cParameterContainer* cCheckerBundle::GetParamContainer() + * Returns an instance of the param container + */ +cParameterContainer *cCheckerBundle::GetParamContainer() { return &m_Params; } -void cCheckerBundle::OverwriteParams(cParameterContainer& container) +void cCheckerBundle::OverwriteParams(cParameterContainer &container) { m_Params.Overwrite(container); } /* -* Returns the build date -*/ + * Returns the build date + */ std::string cCheckerBundle::GetBuildDate() const { return m_BuildDate; } /* -* Returns the build version -*/ + * Returns the build version + */ std::string cCheckerBundle::GetBuildVersion() const { return m_BuildVersion; } /* -* Returns the result container -*/ -cResultContainer const* cCheckerBundle::GetResultContainer() const + * Returns the result container + */ +cResultContainer const *cCheckerBundle::GetResultContainer() const { return m_Container; } -void cCheckerBundle::AssignResultContainer(cResultContainer* container) +void cCheckerBundle::AssignResultContainer(cResultContainer *container) { m_Container = container; -} \ No newline at end of file +} diff --git a/src/common/src/result_format/cExtendedInformation.cpp b/src/common/src/result_format/c_extended_information.cpp similarity index 61% rename from src/common/src/result_format/cExtendedInformation.cpp rename to src/common/src/result_format/c_extended_information.cpp index 62cc099f..29e22f66 100644 --- a/src/common/src/result_format/cExtendedInformation.cpp +++ b/src/common/src/result_format/c_extended_information.cpp @@ -5,15 +5,15 @@ * Public License, v. 2.0. If a copy of the MPL was not distributed * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "common/result_format/cExtendedInformation.h" +#include "common/result_format/c_extended_information.h" XERCES_CPP_NAMESPACE_USE -DOMElement* cExtendedInformation::CreateExtendedInformationXMLNode(DOMDocument * p_resultDocument) +DOMElement *cExtendedInformation::CreateExtendedInformationXMLNode(DOMDocument *p_resultDocument) { - XMLCh* pTagName = XMLString::transcode(m_TagName.c_str()); + XMLCh *pTagName = XMLString::transcode(m_TagName.c_str()); - DOMElement* p_DataElement = p_resultDocument->createElement(pTagName); + DOMElement *p_DataElement = p_resultDocument->createElement(pTagName); XMLString::release(&pTagName); @@ -24,4 +24,4 @@ DOMElement* cExtendedInformation::CreateExtendedInformationXMLNode(DOMDocument * std::string cExtendedInformation::GetTagName() const { return m_TagName; -} \ No newline at end of file +} diff --git a/src/common/src/result_format/cFileLocation.cpp b/src/common/src/result_format/c_file_location.cpp similarity index 65% rename from src/common/src/result_format/cFileLocation.cpp rename to src/common/src/result_format/c_file_location.cpp index cde3ee7b..37b132bd 100644 --- a/src/common/src/result_format/cFileLocation.cpp +++ b/src/common/src/result_format/c_file_location.cpp @@ -5,23 +5,22 @@ * Public License, v. 2.0. If a copy of the MPL was not distributed * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "common/result_format/cFileLocation.h" +#include "common/result_format/c_file_location.h" XERCES_CPP_NAMESPACE_USE -const XMLCh* cFileLocation::TAG_NAME = CONST_XMLCH("FileLocation"); -const XMLCh* cFileLocation::ATTR_FILETYPE = CONST_XMLCH("fileType"); -const XMLCh* cFileLocation::ATTR_ROW = CONST_XMLCH("row"); -const XMLCh* cFileLocation::ATTR_COLUMN = CONST_XMLCH("column"); +const XMLCh *cFileLocation::TAG_NAME = CONST_XMLCH("FileLocation"); +const XMLCh *cFileLocation::ATTR_FILETYPE = CONST_XMLCH("fileType"); +const XMLCh *cFileLocation::ATTR_ROW = CONST_XMLCH("row"); +const XMLCh *cFileLocation::ATTR_COLUMN = CONST_XMLCH("column"); - -DOMElement* cFileLocation::WriteXML(DOMDocument* p_resultDocument) +DOMElement *cFileLocation::WriteXML(DOMDocument *p_resultDocument) { - DOMElement* p_DataElement = CreateExtendedInformationXMLNode(p_resultDocument); + DOMElement *p_DataElement = CreateExtendedInformationXMLNode(p_resultDocument); - XMLCh* pFileType = XMLString::transcode(std::to_string(m_FileType).c_str()); - XMLCh* pRow = XMLString::transcode(std::to_string(m_Row).c_str()); - XMLCh* pColumn = XMLString::transcode(std::to_string(m_Column).c_str()); + XMLCh *pFileType = XMLString::transcode(std::to_string(m_FileType).c_str()); + XMLCh *pRow = XMLString::transcode(std::to_string(m_Row).c_str()); + XMLCh *pColumn = XMLString::transcode(std::to_string(m_Column).c_str()); p_DataElement->setAttribute(ATTR_FILETYPE, pFileType); p_DataElement->setAttribute(ATTR_ROW, pRow); @@ -34,7 +33,7 @@ DOMElement* cFileLocation::WriteXML(DOMDocument* p_resultDocument) return p_DataElement; } -cFileLocation* cFileLocation::ParseFromXML(DOMNode* , DOMElement* pXMLElement) +cFileLocation *cFileLocation::ParseFromXML(DOMNode *, DOMElement *pXMLElement) { std::string strRow = XMLString::transcode(pXMLElement->getAttribute(ATTR_ROW)); std::string strColumn = XMLString::transcode(pXMLElement->getAttribute(ATTR_COLUMN)); @@ -46,7 +45,8 @@ cFileLocation* cFileLocation::ParseFromXML(DOMNode* , DOMElement* pXMLElement) if (pXMLElement->hasAttribute(ATTR_FILETYPE)) strFileType = XMLString::transcode(pXMLElement->getAttribute(ATTR_FILETYPE)); - cFileLocation* result = new cFileLocation(static_cast(atoi(strFileType.c_str())), atoi(strRow.c_str()), atoi(strColumn.c_str())); + cFileLocation *result = new cFileLocation(static_cast(atoi(strFileType.c_str())), atoi(strRow.c_str()), + atoi(strColumn.c_str())); return result; } diff --git a/src/common/src/result_format/cInertialLocation.cpp b/src/common/src/result_format/c_inertial_location.cpp similarity index 63% rename from src/common/src/result_format/cInertialLocation.cpp rename to src/common/src/result_format/c_inertial_location.cpp index 71c8d955..b9c02d03 100644 --- a/src/common/src/result_format/cInertialLocation.cpp +++ b/src/common/src/result_format/c_inertial_location.cpp @@ -5,28 +5,28 @@ * Public License, v. 2.0. If a copy of the MPL was not distributed * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "common/result_format/cInertialLocation.h" +#include "common/result_format/c_inertial_location.h" XERCES_CPP_NAMESPACE_USE -const XMLCh* cInertialLocation::TAG_NAME = CONST_XMLCH("InertialLocation"); -const XMLCh* cInertialLocation::ATTR_X = CONST_XMLCH("x"); -const XMLCh* cInertialLocation::ATTR_Y = CONST_XMLCH("y"); -const XMLCh* cInertialLocation::ATTR_Z = CONST_XMLCH("z"); -const XMLCh* cInertialLocation::ATTR_H = CONST_XMLCH("h"); -const XMLCh* cInertialLocation::ATTR_P = CONST_XMLCH("p"); -const XMLCh* cInertialLocation::ATTR_R = CONST_XMLCH("r"); +const XMLCh *cInertialLocation::TAG_NAME = CONST_XMLCH("InertialLocation"); +const XMLCh *cInertialLocation::ATTR_X = CONST_XMLCH("x"); +const XMLCh *cInertialLocation::ATTR_Y = CONST_XMLCH("y"); +const XMLCh *cInertialLocation::ATTR_Z = CONST_XMLCH("z"); +const XMLCh *cInertialLocation::ATTR_H = CONST_XMLCH("h"); +const XMLCh *cInertialLocation::ATTR_P = CONST_XMLCH("p"); +const XMLCh *cInertialLocation::ATTR_R = CONST_XMLCH("r"); -DOMElement* cInertialLocation::WriteXML(DOMDocument * p_resultDocument) +DOMElement *cInertialLocation::WriteXML(DOMDocument *p_resultDocument) { - DOMElement* p_DataElement = CreateExtendedInformationXMLNode(p_resultDocument); + DOMElement *p_DataElement = CreateExtendedInformationXMLNode(p_resultDocument); - XMLCh* pX = XMLString::transcode(std::to_string(m_X).c_str()); - XMLCh* pY = XMLString::transcode(std::to_string(m_Y).c_str()); - XMLCh* pZ = XMLString::transcode(std::to_string(m_Z).c_str()); - XMLCh* pH = XMLString::transcode(std::to_string(m_H).c_str()); - XMLCh* pP = XMLString::transcode(std::to_string(m_P).c_str()); - XMLCh* pR = XMLString::transcode(std::to_string(m_R).c_str()); + XMLCh *pX = XMLString::transcode(std::to_string(m_X).c_str()); + XMLCh *pY = XMLString::transcode(std::to_string(m_Y).c_str()); + XMLCh *pZ = XMLString::transcode(std::to_string(m_Z).c_str()); + XMLCh *pH = XMLString::transcode(std::to_string(m_H).c_str()); + XMLCh *pP = XMLString::transcode(std::to_string(m_P).c_str()); + XMLCh *pR = XMLString::transcode(std::to_string(m_R).c_str()); p_DataElement->setAttribute(ATTR_X, pX); p_DataElement->setAttribute(ATTR_Y, pY); @@ -45,7 +45,7 @@ DOMElement* cInertialLocation::WriteXML(DOMDocument * p_resultDocument) return p_DataElement; } -cInertialLocation* cInertialLocation::ParseFromXML(DOMNode *, DOMElement * pXMLElement) +cInertialLocation *cInertialLocation::ParseFromXML(DOMNode *, DOMElement *pXMLElement) { std::string strX = XMLString::transcode(pXMLElement->getAttribute(ATTR_X)); std::string strY = XMLString::transcode(pXMLElement->getAttribute(ATTR_Y)); @@ -54,7 +54,7 @@ cInertialLocation* cInertialLocation::ParseFromXML(DOMNode *, DOMElement * pXMLE std::string strP = XMLString::transcode(pXMLElement->getAttribute(ATTR_P)); std::string strR = XMLString::transcode(pXMLElement->getAttribute(ATTR_R)); - cInertialLocation* result = new cInertialLocation(atof(strX.c_str()), atof(strY.c_str()), atof(strZ.c_str()), + cInertialLocation *result = new cInertialLocation(atof(strX.c_str()), atof(strY.c_str()), atof(strZ.c_str()), atof(strH.c_str()), atof(strP.c_str()), atof(strR.c_str())); return result; @@ -94,4 +94,4 @@ double cInertialLocation::GetPitch() const double cInertialLocation::GetRoll() const { return m_R; -} \ No newline at end of file +} diff --git a/src/common/src/result_format/cIssue.cpp b/src/common/src/result_format/c_issue.cpp similarity index 57% rename from src/common/src/result_format/cIssue.cpp rename to src/common/src/result_format/c_issue.cpp index 7d20d644..856cf3f3 100644 --- a/src/common/src/result_format/cIssue.cpp +++ b/src/common/src/result_format/c_issue.cpp @@ -6,25 +6,23 @@ * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "common/result_format/cIssue.h" -#include "common/result_format/cChecker.h" -#include "common/result_format/cCheckerBundle.h" -#include "common/result_format/cLocationsContainer.h" +#include "common/result_format/c_issue.h" +#include "common/result_format/c_checker.h" +#include "common/result_format/c_checker_bundle.h" +#include "common/result_format/c_locations_container.h" #include "common/util.h" XERCES_CPP_NAMESPACE_USE -const XMLCh* cIssue::TAG_ISSUE = CONST_XMLCH("Issue"); -const XMLCh* cIssue::ATTR_ISSUE_ID = CONST_XMLCH("issueId"); -const XMLCh* cIssue::ATTR_DESCRIPTION = CONST_XMLCH("description"); -const XMLCh* cIssue::ATTR_LEVEL = CONST_XMLCH("level"); +const XMLCh *cIssue::TAG_ISSUE = CONST_XMLCH("Issue"); +const XMLCh *cIssue::ATTR_ISSUE_ID = CONST_XMLCH("issueId"); +const XMLCh *cIssue::ATTR_DESCRIPTION = CONST_XMLCH("description"); +const XMLCh *cIssue::ATTR_LEVEL = CONST_XMLCH("level"); const std::map cIssue::issueLevelToString = { - {eIssueLevel::INFO_LVL, "Info"}, - {eIssueLevel::WARNING_LVL, "Warning"}, - {eIssueLevel::ERROR_LVL, "Error"}}; + {eIssueLevel::INFO_LVL, "Info"}, {eIssueLevel::WARNING_LVL, "Warning"}, {eIssueLevel::ERROR_LVL, "Error"}}; -cIssue::cIssue(const std::string& description, eIssueLevel infoLvl, cLocationsContainer* locationsContainer) +cIssue::cIssue(const std::string &description, eIssueLevel infoLvl, cLocationsContainer *locationsContainer) { m_Description = description; m_IssueLevel = infoLvl; @@ -33,7 +31,8 @@ cIssue::cIssue(const std::string& description, eIssueLevel infoLvl, cLocationsCo AddLocationsContainer(locationsContainer); } -cIssue::cIssue(const std::string& description, eIssueLevel infoLvl, std::list listLoc) : cIssue(description, infoLvl) +cIssue::cIssue(const std::string &description, eIssueLevel infoLvl, std::list listLoc) + : cIssue(description, infoLvl) { AddLocationsContainer(listLoc); } @@ -42,7 +41,8 @@ cIssue::~cIssue() { m_Checker = nullptr; - for (std::list::const_iterator locIt = m_Locations.cbegin(); locIt != m_Locations.cend(); locIt++) + for (std::list::const_iterator locIt = m_Locations.cbegin(); locIt != m_Locations.cend(); + locIt++) { delete (*locIt); } @@ -50,34 +50,34 @@ cIssue::~cIssue() m_Locations.clear(); } -void cIssue::AddLocationsContainer(cLocationsContainer* locationsContainer) +void cIssue::AddLocationsContainer(cLocationsContainer *locationsContainer) { if (nullptr != locationsContainer) m_Locations.push_back(locationsContainer); } -void cIssue::AddLocationsContainer(std::list listLoc) +void cIssue::AddLocationsContainer(std::list listLoc) { m_Locations.insert(m_Locations.end(), listLoc.begin(), listLoc.end()); } -void cIssue::AssignChecker(cChecker* checkerToAssign) +void cIssue::AssignChecker(cChecker *checkerToAssign) { m_Checker = checkerToAssign; } -cChecker* cIssue::GetChecker() const +cChecker *cIssue::GetChecker() const { return m_Checker; } -DOMElement * cIssue::WriteXML(DOMDocument* p_resultDocument) +DOMElement *cIssue::WriteXML(DOMDocument *p_resultDocument) { - DOMElement* p_DataElement = p_resultDocument->createElement(TAG_ISSUE); + DOMElement *p_DataElement = p_resultDocument->createElement(TAG_ISSUE); - XMLCh* pIssueId = XMLString::transcode(std::to_string(m_Id).c_str()); - XMLCh* pDescription = XMLString::transcode(m_Description.c_str()); - XMLCh* pLevel = XMLString::transcode(std::to_string((int)m_IssueLevel).c_str()); + XMLCh *pIssueId = XMLString::transcode(std::to_string(m_Id).c_str()); + XMLCh *pDescription = XMLString::transcode(m_Description.c_str()); + XMLCh *pLevel = XMLString::transcode(std::to_string((int)m_IssueLevel).c_str()); p_DataElement->setAttribute(ATTR_ISSUE_ID, pIssueId); p_DataElement->setAttribute(ATTR_DESCRIPTION, pDescription); @@ -86,9 +86,10 @@ DOMElement * cIssue::WriteXML(DOMDocument* p_resultDocument) // Write extended informations if (HasLocations()) { - for (std::list::const_iterator locIt = m_Locations.cbegin(); locIt != m_Locations.cend(); locIt++) + for (std::list::const_iterator locIt = m_Locations.cbegin(); locIt != m_Locations.cend(); + locIt++) { - DOMElement* locElement = (*locIt)->WriteXML(p_resultDocument); + DOMElement *locElement = (*locIt)->WriteXML(p_resultDocument); p_DataElement->appendChild(locElement); } } @@ -107,7 +108,7 @@ bool cIssue::AssignIssueId() } // Sets a new issue id -void cIssue::SetIssueId(const std::string& newIssueId) +void cIssue::SetIssueId(const std::string &newIssueId) { if (IsNumber(newIssueId)) m_Id = atoi(newIssueId.c_str()); @@ -123,7 +124,7 @@ unsigned long long cIssue::NextFreeId() const { return m_Checker->NextFreeId(); } -return 0; + return 0; } // Sets a new issue id @@ -137,35 +138,35 @@ unsigned long long cIssue::GetIssueId() const return m_Id; } -cIssue* cIssue::ParseFromXML(DOMNode* pXMLNode, DOMElement* pXMLElement, cChecker* checker) +cIssue *cIssue::ParseFromXML(DOMNode *pXMLNode, DOMElement *pXMLElement, cChecker *checker) { std::string strDescription = XMLString::transcode(pXMLElement->getAttribute(ATTR_DESCRIPTION)); std::string strID = XMLString::transcode(pXMLElement->getAttribute(ATTR_ISSUE_ID)); std::string strLevel = XMLString::transcode(pXMLElement->getAttribute(ATTR_LEVEL)); - cIssue* issue = new cIssue(strDescription, GetIssueLevelFromStr(strLevel)); + cIssue *issue = new cIssue(strDescription, GetIssueLevelFromStr(strLevel)); issue->AssignChecker(checker); issue->SetIssueId(strID); - DOMNodeList* pIssueChildList = pXMLNode->getChildNodes(); - const XMLSize_t issueNodeCount = pIssueChildList->getLength(); + DOMNodeList *pIssueChildList = pXMLNode->getChildNodes(); + const XMLSize_t issueNodeCount = pIssueChildList->getLength(); // Iterate Extended Informations and parse ... for (XMLSize_t i = 0; i < issueNodeCount; ++i) { - DOMNode* currentIssueNode = pIssueChildList->item(i); + DOMNode *currentIssueNode = pIssueChildList->item(i); - if (currentIssueNode->getNodeType() && - currentIssueNode->getNodeType() == DOMNode::ELEMENT_NODE) + if (currentIssueNode->getNodeType() && currentIssueNode->getNodeType() == DOMNode::ELEMENT_NODE) { - DOMElement* currentIssueElement = dynamic_cast(currentIssueNode); - const char* currentTagName = XMLString::transcode(currentIssueElement->getTagName()); + DOMElement *currentIssueElement = dynamic_cast(currentIssueNode); + const char *currentTagName = XMLString::transcode(currentIssueElement->getTagName()); // Parse cFileLocation if (Equals(currentTagName, XMLString::transcode(cLocationsContainer::TAG_LOCATIONS))) { - issue->AddLocationsContainer((cLocationsContainer*)cLocationsContainer::ParseFromXML(currentIssueNode, currentIssueElement)); + issue->AddLocationsContainer( + (cLocationsContainer *)cLocationsContainer::ParseFromXML(currentIssueNode, currentIssueElement)); } } } @@ -184,17 +185,17 @@ size_t cIssue::GetLocationsCount() const } // Returns all extended informations -std::list cIssue::GetLocationsContainer() const +std::list cIssue::GetLocationsContainer() const { return m_Locations; } -eIssueLevel cIssue::GetIssueLevelFromStr(const std::string& issueLevelString) +eIssueLevel cIssue::GetIssueLevelFromStr(const std::string &issueLevelString) { return (eIssueLevel)stoi(issueLevelString); } -void cIssue::SetDescription(const std::string& strDescription) +void cIssue::SetDescription(const std::string &strDescription) { m_Description = strDescription; } @@ -224,17 +225,17 @@ std::string cIssue::GetIssueLevelStr() const if (pos != issueLevelToString.end()) return pos->second; -return std::string("Unknown"); + return std::string("Unknown"); } // Returns the xodr file name std::string cIssue::GetXODRFilename() const { - cChecker* checker = GetChecker(); + cChecker *checker = GetChecker(); if (nullptr != checker) { - cCheckerBundle* bundle = checker->GetCheckerBundle(); + cCheckerBundle *bundle = checker->GetCheckerBundle(); if (nullptr != bundle) { @@ -248,11 +249,11 @@ std::string cIssue::GetXODRFilename() const // Returns the xodr file path std::string cIssue::GetXODRFilepath() const { - cChecker* checker = GetChecker(); + cChecker *checker = GetChecker(); if (nullptr != checker) { - cCheckerBundle* bundle = checker->GetCheckerBundle(); + cCheckerBundle *bundle = checker->GetCheckerBundle(); if (nullptr != bundle) { @@ -267,16 +268,16 @@ std::string PrintIssueLevel(const eIssueLevel level) { std::string retval; - switch(level) + switch (level) { - case INFO_LVL: - retval = "Information"; - break; - case WARNING_LVL: - retval = "Warning"; - break; - default: - retval = "Error"; + case INFO_LVL: + retval = "Information"; + break; + case WARNING_LVL: + retval = "Warning"; + break; + default: + retval = "Error"; } -return retval; + return retval; } diff --git a/src/common/src/result_format/c_locations_container.cpp b/src/common/src/result_format/c_locations_container.cpp new file mode 100644 index 00000000..b69a5b71 --- /dev/null +++ b/src/common/src/result_format/c_locations_container.cpp @@ -0,0 +1,153 @@ +/* + * Copyright 2023 CARIAD SE. + * + * This Source Code Form is subject to the terms of the Mozilla + * Public License, v. 2.0. If a copy of the MPL was not distributed + * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#include "common/result_format/c_locations_container.h" +#include "common/util.h" + +#include "common/result_format/c_extended_information.h" +#include "common/result_format/c_file_location.h" +#include "common/result_format/c_inertial_location.h" +#include "common/result_format/c_road_location.h" +#include "common/result_format/c_xml_location.h" + +XERCES_CPP_NAMESPACE_USE + +const XMLCh *cLocationsContainer::TAG_LOCATIONS = CONST_XMLCH("Locations"); +const XMLCh *cLocationsContainer::ATTR_DESCRIPTION = CONST_XMLCH("description"); + +cLocationsContainer::cLocationsContainer(const std::string &description, cExtendedInformation *extendedInformation) +{ + m_Description = description; + AddExtendedInformation(extendedInformation); +} + +cLocationsContainer::cLocationsContainer(const std::string &description, std::list listExt) + : cLocationsContainer(description) +{ + AddExtendedInformation(listExt); +} + +cLocationsContainer::~cLocationsContainer() +{ + for (std::list::const_iterator extIt = m_Extended.cbegin(); extIt != m_Extended.cend(); + extIt++) + { + delete (*extIt); + } + + m_Extended.clear(); +} + +void cLocationsContainer::AddExtendedInformation(cExtendedInformation *extendedInformation) +{ + if (nullptr != extendedInformation) + m_Extended.push_back(extendedInformation); +} + +void cLocationsContainer::AddExtendedInformation(std::list listExt) +{ + m_Extended.insert(m_Extended.end(), listExt.begin(), listExt.end()); +} + +DOMElement *cLocationsContainer::WriteXML(DOMDocument *p_resultDocument) +{ + DOMElement *p_DataElement = p_resultDocument->createElement(TAG_LOCATIONS); + XMLCh *pDescription = XMLString::transcode(m_Description.c_str()); + p_DataElement->setAttribute(ATTR_DESCRIPTION, pDescription); + + // Write extended informations + if (HasExtendedInformations()) + { + for (std::list::const_iterator extIt = m_Extended.cbegin(); extIt != m_Extended.cend(); + extIt++) + { + DOMElement *extElement = (*extIt)->WriteXML(p_resultDocument); + p_DataElement->appendChild(extElement); + } + } + + XMLString::release(&pDescription); + + return p_DataElement; +} + +cLocationsContainer *cLocationsContainer::ParseFromXML(DOMNode *pXMLNode, DOMElement *pXMLElement) +{ + std::string strDescription = XMLString::transcode(pXMLElement->getAttribute(ATTR_DESCRIPTION)); + + cLocationsContainer *subIssue = new cLocationsContainer(strDescription); + + DOMNodeList *pIssueChildList = pXMLNode->getChildNodes(); + const XMLSize_t issueNodeCount = pIssueChildList->getLength(); + + // Iterate Extended Informations and parse ... + for (XMLSize_t i = 0; i < issueNodeCount; ++i) + { + DOMNode *currentIssueNode = pIssueChildList->item(i); + + if (currentIssueNode->getNodeType() && currentIssueNode->getNodeType() == DOMNode::ELEMENT_NODE) + { + DOMElement *currentIssueElement = dynamic_cast(currentIssueNode); + const char *currentTagName = XMLString::transcode(currentIssueElement->getTagName()); + + // Parse cFileLocation + if (Equals(currentTagName, XMLString::transcode(cFileLocation::TAG_NAME))) + { + subIssue->AddExtendedInformation( + (cExtendedInformation *)cFileLocation::ParseFromXML(currentIssueNode, currentIssueElement)); + } + // Parse cXMLLocation + else if (Equals(currentTagName, XMLString::transcode(cXMLLocation::TAG_NAME))) + { + subIssue->AddExtendedInformation( + (cExtendedInformation *)cXMLLocation::ParseFromXML(currentIssueNode, currentIssueElement)); + } + // Parse cRoadLocation + else if (Equals(currentTagName, XMLString::transcode(cRoadLocation::TAG_NAME))) + { + subIssue->AddExtendedInformation( + (cExtendedInformation *)cRoadLocation::ParseFromXML(currentIssueNode, currentIssueElement)); + } + // Parse cInertialLocation + else if (Equals(currentTagName, XMLString::transcode(cInertialLocation::TAG_NAME))) + { + subIssue->AddExtendedInformation( + (cExtendedInformation *)cInertialLocation::ParseFromXML(currentIssueNode, currentIssueElement)); + } + } + } + + return subIssue; +} + +bool cLocationsContainer::HasExtendedInformations() const +{ + return (m_Extended.size() != 0); +} + +size_t cLocationsContainer::GetExtendedInformationCount() const +{ + return m_Extended.size(); +} + +// Returns all extended informations +std::list cLocationsContainer::GetExtendedInformations() const +{ + return m_Extended; +} + +void cLocationsContainer::SetDescription(const std::string &strDescription) +{ + m_Description = strDescription; +} + +// Returns the description +std::string cLocationsContainer::GetDescription() const +{ + return m_Description; +} diff --git a/src/common/src/result_format/cParameterContainer.cpp b/src/common/src/result_format/c_parameter_container.cpp similarity index 57% rename from src/common/src/result_format/cParameterContainer.cpp rename to src/common/src/result_format/c_parameter_container.cpp index 27ea66a6..4c762ac4 100644 --- a/src/common/src/result_format/cParameterContainer.cpp +++ b/src/common/src/result_format/c_parameter_container.cpp @@ -6,24 +6,25 @@ * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "common/result_format/cParameterContainer.h" +#include "common/result_format/c_parameter_container.h" XERCES_CPP_NAMESPACE_USE -const XMLCh* cParameterContainer::TAG_PARAM = CONST_XMLCH("Param"); -const XMLCh* cParameterContainer::ATTR_NAME = CONST_XMLCH("name"); -const XMLCh* cParameterContainer::ATTR_VALUE = CONST_XMLCH("value"); +const XMLCh *cParameterContainer::TAG_PARAM = CONST_XMLCH("Param"); +const XMLCh *cParameterContainer::ATTR_NAME = CONST_XMLCH("name"); +const XMLCh *cParameterContainer::ATTR_VALUE = CONST_XMLCH("value"); cParameterContainer::cParameterContainer() { } -DOMElement* cParameterContainer::CreateNode(DOMDocument* pDOMDocResultDocument, const std::string& name, const std::string& value) const +DOMElement *cParameterContainer::CreateNode(DOMDocument *pDOMDocResultDocument, const std::string &name, + const std::string &value) const { - DOMElement* pParam = pDOMDocResultDocument->createElement(TAG_PARAM); + DOMElement *pParam = pDOMDocResultDocument->createElement(TAG_PARAM); - XMLCh* pName = XMLString::transcode(name.c_str()); - XMLCh* pValue = XMLString::transcode(value.c_str()); + XMLCh *pName = XMLString::transcode(name.c_str()); + XMLCh *pValue = XMLString::transcode(value.c_str()); pParam->setAttribute(ATTR_NAME, pName); pParam->setAttribute(ATTR_VALUE, pValue); @@ -34,19 +35,19 @@ DOMElement* cParameterContainer::CreateNode(DOMDocument* pDOMDocResultDocument, return pParam; } -void cParameterContainer::WriteXML(DOMDocument* p_resultDocument, DOMElement* parentElement) const +void cParameterContainer::WriteXML(DOMDocument *p_resultDocument, DOMElement *parentElement) const { // Serialize params to XML - for (auto const& param : m_Parameters) + for (auto const ¶m : m_Parameters) { // Add param - DOMElement* pParamElement = CreateNode(p_resultDocument, param.first, param.second); + DOMElement *pParamElement = CreateNode(p_resultDocument, param.first, param.second); parentElement->appendChild(pParamElement); } } -void cParameterContainer::ParseFromXML(DOMNode*, DOMElement* pXMLElement, cParameterContainer* paramContainer) +void cParameterContainer::ParseFromXML(DOMNode *, DOMElement *pXMLElement, cParameterContainer *paramContainer) { std::string paramName = XMLString::transcode(pXMLElement->getAttribute(ATTR_NAME)); std::string paramValue = XMLString::transcode(pXMLElement->getAttribute(ATTR_VALUE)); @@ -55,28 +56,27 @@ void cParameterContainer::ParseFromXML(DOMNode*, DOMElement* pXMLElement, cParam paramContainer->SetParam(paramName, paramValue); } -void cParameterContainer::SetParam(const std::string& name, const std::string& value) +void cParameterContainer::SetParam(const std::string &name, const std::string &value) { m_Parameters[name] = value; } -void cParameterContainer::SetParam(const std::string& name, const int& value) +void cParameterContainer::SetParam(const std::string &name, const int &value) { m_Parameters[name] = std::to_string(value); } -void cParameterContainer::SetParam(const std::string& name, const float& value) +void cParameterContainer::SetParam(const std::string &name, const float &value) { m_Parameters[name] = std::to_string(value); } -void cParameterContainer::SetParam(const std::string& name, const double& value) +void cParameterContainer::SetParam(const std::string &name, const double &value) { m_Parameters[name] = std::to_string(value); } -std::string cParameterContainer::GetParam(const std::string& name, - const std::string& defaultValue) const +std::string cParameterContainer::GetParam(const std::string &name, const std::string &defaultValue) const { auto search = m_Parameters.find(name); @@ -87,13 +87,12 @@ std::string cParameterContainer::GetParam(const std::string& name, return defaultValue; } - -bool cParameterContainer::HasParam(const std::string& name) const +bool cParameterContainer::HasParam(const std::string &name) const { return (m_Parameters.count(name) > 0); } -bool cParameterContainer::DeleteParam(const std::string& name) +bool cParameterContainer::DeleteParam(const std::string &name) { if (HasParam(name)) return (m_Parameters.erase(name) > 0); @@ -110,9 +109,7 @@ std::vector cParameterContainer::GetParams() const { std::vector results; - for (std::map::const_iterator it = m_Parameters.cbegin(); - it != m_Parameters.cend(); - ++it) + for (std::map::const_iterator it = m_Parameters.cbegin(); it != m_Parameters.cend(); ++it) { results.push_back(it->first); } @@ -130,7 +127,7 @@ size_t cParameterContainer::CountParams() const return m_Parameters.size(); } -void cParameterContainer::Overwrite(const cParameterContainer& container) +void cParameterContainer::Overwrite(const cParameterContainer &container) { std::map::const_iterator it = container.m_Parameters.cbegin(); @@ -138,4 +135,4 @@ void cParameterContainer::Overwrite(const cParameterContainer& container) { SetParam(it->first, it->second); } -} \ No newline at end of file +} diff --git a/src/common/src/result_format/cResultContainer.cpp b/src/common/src/result_format/c_result_container.cpp similarity index 52% rename from src/common/src/result_format/cResultContainer.cpp rename to src/common/src/result_format/c_result_container.cpp index 5a65bf6f..9d4e42a7 100644 --- a/src/common/src/result_format/cResultContainer.cpp +++ b/src/common/src/result_format/c_result_container.cpp @@ -5,18 +5,18 @@ * Public License, v. 2.0. If a copy of the MPL was not distributed * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "common/config_format/cConfiguration.h" -#include "common/config_format/cConfigurationChecker.h" -#include "common/config_format/cConfigurationCheckerBundle.h" -#include "common/result_format/cCheckerBundle.h" -#include "common/result_format/cChecker.h" -#include "common/result_format/cIssue.h" -#include "common/result_format/cResultContainer.h" +#include "common/result_format/c_result_container.h" +#include "common/config_format/c_configuration.h" +#include "common/config_format/c_configuration_checker.h" +#include "common/config_format/c_configuration_checker_bundle.h" +#include "common/result_format/c_checker.h" +#include "common/result_format/c_checker_bundle.h" +#include "common/result_format/c_issue.h" XERCES_CPP_NAMESPACE_USE -const XMLCh* cResultContainer::ATTR_VERSION = CONST_XMLCH("version"); -const XMLCh* cResultContainer::XAQR_VERSION = CONST_XMLCH("1.0.0"); +const XMLCh *cResultContainer::ATTR_VERSION = CONST_XMLCH("version"); +const XMLCh *cResultContainer::XAQR_VERSION = CONST_XMLCH("1.0.0"); cResultContainer::cResultContainer() { @@ -31,7 +31,7 @@ cResultContainer::~cResultContainer() Adds a result to the result list. \param result The instance of IResult to add */ -void cResultContainer::AddCheckerBundle(cCheckerBundle* checkerBundle) +void cResultContainer::AddCheckerBundle(cCheckerBundle *checkerBundle) { if (nullptr == checkerBundle) return; @@ -47,7 +47,7 @@ Makes sure that the memory is freed after calling. */ void cResultContainer::Clear() { - for (std::list::iterator it = m_Bundles.begin(); it != m_Bundles.end(); it++) + for (std::list::iterator it = m_Bundles.begin(); it != m_Bundles.end(); it++) { (*it)->Clear(); delete *it; @@ -56,35 +56,35 @@ void cResultContainer::Clear() m_Bundles.clear(); } -void cResultContainer::WriteResults(const std::string& path) const +void cResultContainer::WriteResults(const std::string &path) const { XMLPlatformUtils::Initialize(); - DOMImplementation * p_DOMImplementationCore = DOMImplementationRegistry::getDOMImplementation(CONST_XMLCH("core")); + DOMImplementation *p_DOMImplementationCore = DOMImplementationRegistry::getDOMImplementation(CONST_XMLCH("core")); // For storing a file, we need DOMImplementationLS - DOMImplementation * p_DOMImplementationLS = DOMImplementationRegistry::getDOMImplementation(CONST_XMLCH("LS")); + DOMImplementation *p_DOMImplementationLS = DOMImplementationRegistry::getDOMImplementation(CONST_XMLCH("LS")); - DOMLSSerializer * p_DOMSerializer = ((DOMImplementationLS*)p_DOMImplementationLS)->createLSSerializer(); + DOMLSSerializer *p_DOMSerializer = ((DOMImplementationLS *)p_DOMImplementationLS)->createLSSerializer(); - DOMConfiguration * p_DOMConfig = p_DOMSerializer->getDomConfig(); + DOMConfiguration *p_DOMConfig = p_DOMSerializer->getDomConfig(); p_DOMConfig->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, true); - DOMDocument* p_resultDocument = p_DOMImplementationCore->createDocument(0, CONST_XMLCH("CheckerResults"), 0); + DOMDocument *p_resultDocument = p_DOMImplementationCore->createDocument(0, CONST_XMLCH("CheckerResults"), 0); - DOMElement* p_RootElement = p_resultDocument->getDocumentElement(); + DOMElement *p_RootElement = p_resultDocument->getDocumentElement(); p_RootElement->setAttribute(ATTR_VERSION, XAQR_VERSION); // Write all Summaries to XML - for (std::list::const_iterator it = m_Bundles.begin(); it != m_Bundles.end(); ++it) + for (std::list::const_iterator it = m_Bundles.begin(); it != m_Bundles.end(); ++it) { - DOMElement* pSummary = (*it)->WriteXML(p_resultDocument); + DOMElement *pSummary = (*it)->WriteXML(p_resultDocument); p_RootElement->appendChild(pSummary); } - XMLCh* pPath = XMLString::transcode(path.c_str()); - XMLFormatTarget * pTarget = new LocalFileFormatTarget(pPath); + XMLCh *pPath = XMLString::transcode(path.c_str()); + XMLFormatTarget *pTarget = new LocalFileFormatTarget(pPath); - DOMLSOutput* pDomLsOutput = ((DOMImplementationLS*)p_DOMImplementationLS)->createLSOutput(); + DOMLSOutput *pDomLsOutput = ((DOMImplementationLS *)p_DOMImplementationLS)->createLSOutput(); pDomLsOutput->setByteStream(pTarget); p_DOMSerializer->write(p_resultDocument, pDomLsOutput); @@ -104,7 +104,7 @@ void cResultContainer::WriteResults(const std::string& path) const Adds the results from a already existing XQAR file \param strXmlFilePath: Path to a existing QXAR file */ -void cResultContainer::AddResultsFromXML(const std::string& strXmlFilePath) +void cResultContainer::AddResultsFromXML(const std::string &strXmlFilePath) { struct stat fileStatus; @@ -119,7 +119,7 @@ void cResultContainer::AddResultsFromXML(const std::string& strXmlFilePath) else { XMLPlatformUtils::Initialize(); - xercesc::XercesDOMParser* pDomParser = new xercesc::XercesDOMParser(); + xercesc::XercesDOMParser *pDomParser = new xercesc::XercesDOMParser(); pDomParser->setValidationScheme(XercesDOMParser::Val_Never); pDomParser->setDoNamespaces(false); @@ -130,24 +130,25 @@ void cResultContainer::AddResultsFromXML(const std::string& strXmlFilePath) { pDomParser->parse(strXmlFilePath.c_str()); - DOMDocument* pXmlDoc = pDomParser->getDocument(); - DOMElement* pRoot = pXmlDoc->getDocumentElement(); + DOMDocument *pXmlDoc = pDomParser->getDocument(); + DOMElement *pRoot = pXmlDoc->getDocumentElement(); // Parse Root if (nullptr != pRoot) { - DOMNodeList* pChildList = pRoot->getChildNodes(); - const XMLSize_t bundleSummaryNodeCount = pChildList->getLength(); + DOMNodeList *pChildList = pRoot->getChildNodes(); + const XMLSize_t bundleSummaryNodeCount = pChildList->getLength(); for (XMLSize_t i = 0; i < bundleSummaryNodeCount; ++i) { - DOMNode* pCurrentBundleSummaryNode = pChildList->item(i); + DOMNode *pCurrentBundleSummaryNode = pChildList->item(i); // Is element node... if (pCurrentBundleSummaryNode->getNodeType() == DOMNode::ELEMENT_NODE) { - DOMElement* currentBundleSummaryElement = dynamic_cast< xercesc::DOMElement* >(pCurrentBundleSummaryNode); - const char* currentTagName = XMLString::transcode(currentBundleSummaryElement->getTagName()); + DOMElement *currentBundleSummaryElement = + dynamic_cast(pCurrentBundleSummaryNode); + const char *currentTagName = XMLString::transcode(currentBundleSummaryElement->getTagName()); // Parse BundleSummary if (Equals(currentTagName, XMLString::transcode(cCheckerBundle::TAG_CHECKER_BUNDLE))) @@ -173,7 +174,7 @@ unsigned int cResultContainer::GetIssueCount() const { unsigned int result = 0; - for (std::list::const_iterator it = m_Bundles.begin(); it != m_Bundles.end(); it++) + for (std::list::const_iterator it = m_Bundles.begin(); it != m_Bundles.end(); it++) { result += (*it)->GetIssueCount(); } @@ -186,7 +187,7 @@ unsigned int cResultContainer::GetCheckerCount() const { unsigned int result = 0; - for (std::list::const_iterator it = m_Bundles.cbegin(); it != m_Bundles.cend(); it++) + for (std::list::const_iterator it = m_Bundles.cbegin(); it != m_Bundles.cend(); it++) { result += (*it)->GetCheckerCount(); } @@ -194,7 +195,7 @@ unsigned int cResultContainer::GetCheckerCount() const return result; } -std::list cResultContainer::GetCheckerBundles() const +std::list cResultContainer::GetCheckerBundles() const { return m_Bundles; } @@ -209,15 +210,15 @@ bool cResultContainer::HasCheckerBundles() const return m_Bundles.size() > 0; } -std::list cResultContainer::GetCheckers(const std::string& parentCheckerBundleName) +std::list cResultContainer::GetCheckers(const std::string &parentCheckerBundleName) { - std::list results; + std::list results; - for (std::list::const_iterator it = m_Bundles.cbegin(); it != m_Bundles.cend(); it++) + for (std::list::const_iterator it = m_Bundles.cbegin(); it != m_Bundles.cend(); it++) { if (parentCheckerBundleName == (*it)->GetBundleName()) { - std::list items = (*it)->GetCheckers(); + std::list items = (*it)->GetCheckers(); results.insert(results.end(), items.begin(), items.end()); } } @@ -226,25 +227,25 @@ std::list cResultContainer::GetCheckers(const std::string& parentChec } // Returns the Checkers by a given parent. If the parent is NULL, all available checkers will be returned. -std::list cResultContainer::GetCheckers(cCheckerBundle* parentCheckerBundle) +std::list cResultContainer::GetCheckers(cCheckerBundle *parentCheckerBundle) { - std::list results; + std::list results; if (parentCheckerBundle == nullptr) { - for (std::list::const_iterator it = m_Bundles.cbegin(); it != m_Bundles.cend(); it++) + for (std::list::const_iterator it = m_Bundles.cbegin(); it != m_Bundles.cend(); it++) { - std::list items = (*it)->GetCheckers(); + std::list items = (*it)->GetCheckers(); results.insert(results.end(), items.begin(), items.end()); } } else { - for (std::list::const_iterator it = m_Bundles.cbegin(); it != m_Bundles.cend(); it++) + for (std::list::const_iterator it = m_Bundles.cbegin(); it != m_Bundles.cend(); it++) { if (parentCheckerBundle == (*it) || parentCheckerBundle->GetBundleName() == (*it)->GetBundleName()) { - std::list items = (*it)->GetCheckers(); + std::list items = (*it)->GetCheckers(); results.insert(results.end(), items.begin(), items.end()); } } @@ -254,19 +255,21 @@ std::list cResultContainer::GetCheckers(cCheckerBundle* parentChecker } // Returns the Issues by a given parent. If the parent is NULL, all available issues will be returned. -std::list cResultContainer::GetIssues(cChecker* parentChecker) const +std::list cResultContainer::GetIssues(cChecker *parentChecker) const { - std::list results; + std::list results; if (parentChecker == nullptr) { - for (std::list::const_iterator itCheckerBundle = m_Bundles.cbegin(); itCheckerBundle != m_Bundles.cend(); itCheckerBundle++) + for (std::list::const_iterator itCheckerBundle = m_Bundles.cbegin(); + itCheckerBundle != m_Bundles.cend(); itCheckerBundle++) { - std::list checkers = (*itCheckerBundle)->GetCheckers(); + std::list checkers = (*itCheckerBundle)->GetCheckers(); - for (std::list::const_iterator itCheckers = checkers.cbegin(); itCheckers != checkers.cend(); itCheckers++) + for (std::list::const_iterator itCheckers = checkers.cbegin(); itCheckers != checkers.cend(); + itCheckers++) { - std::list issues = (*itCheckers)->GetIssues(); + std::list issues = (*itCheckers)->GetIssues(); results.insert(results.end(), issues.begin(), issues.end()); } @@ -274,15 +277,17 @@ std::list cResultContainer::GetIssues(cChecker* parentChecker) const } else { - for (std::list::const_iterator itCheckerBundle = m_Bundles.cbegin(); itCheckerBundle != m_Bundles.cend(); itCheckerBundle++) + for (std::list::const_iterator itCheckerBundle = m_Bundles.cbegin(); + itCheckerBundle != m_Bundles.cend(); itCheckerBundle++) { - std::list checkers = (*itCheckerBundle)->GetCheckers(); + std::list checkers = (*itCheckerBundle)->GetCheckers(); - for (std::list::const_iterator itCheckers = checkers.cbegin(); itCheckers != checkers.cend(); itCheckers++) + for (std::list::const_iterator itCheckers = checkers.cbegin(); itCheckers != checkers.cend(); + itCheckers++) { if (parentChecker == (*itCheckers) || parentChecker->GetCheckerID() == (*itCheckers)->GetCheckerID()) { - std::list issues = (*itCheckers)->GetIssues(); + std::list issues = (*itCheckers)->GetIssues(); results.insert(results.end(), issues.begin(), issues.end()); } @@ -294,13 +299,14 @@ std::list cResultContainer::GetIssues(cChecker* parentChecker) const } // Returns the Issues by a given parent. If the parent is NULL, all available issues will be returned. -std::list cResultContainer::GetIssues(std::list checkersInput) const +std::list cResultContainer::GetIssues(std::list checkersInput) const { - std::list results; + std::list results; - for (std::list::const_iterator itCheckers = checkersInput.cbegin(); itCheckers != checkersInput.cend(); itCheckers++) + for (std::list::const_iterator itCheckers = checkersInput.cbegin(); itCheckers != checkersInput.cend(); + itCheckers++) { - std::list issues = (*itCheckers)->GetIssues(); + std::list issues = (*itCheckers)->GetIssues(); results.insert(results.end(), issues.begin(), issues.end()); } @@ -308,20 +314,20 @@ std::list cResultContainer::GetIssues(std::list checkersInpu return results; } - -std::list cResultContainer::GetIssuesByCheckerID(const std::string& checkerID) +std::list cResultContainer::GetIssuesByCheckerID(const std::string &checkerID) { - std::list results; + std::list results; - for (std::list::const_iterator it = m_Bundles.cbegin(); it != m_Bundles.cend(); it++) + for (std::list::const_iterator it = m_Bundles.cbegin(); it != m_Bundles.cend(); it++) { - std::list checkers = (*it)->GetCheckers(); + std::list checkers = (*it)->GetCheckers(); - for (std::list::const_iterator itCheckers = checkers.cbegin(); itCheckers != checkers.cend(); itCheckers++) + for (std::list::const_iterator itCheckers = checkers.cbegin(); itCheckers != checkers.cend(); + itCheckers++) { if (Equals(checkerID, (*itCheckers)->GetCheckerID())) { - std::list issues = (*itCheckers)->GetIssues(); + std::list issues = (*itCheckers)->GetIssues(); results.insert(results.end(), issues.begin(), issues.end()); } } @@ -330,11 +336,12 @@ std::list cResultContainer::GetIssuesByCheckerID(const std::string& che return results; } -cIssue* cResultContainer::GetIssueById(unsigned long long id) const +cIssue *cResultContainer::GetIssueById(unsigned long long id) const { - for (std::list::const_iterator itCheckerBundle = m_Bundles.cbegin(); itCheckerBundle != m_Bundles.cend(); itCheckerBundle++) + for (std::list::const_iterator itCheckerBundle = m_Bundles.cbegin(); + itCheckerBundle != m_Bundles.cend(); itCheckerBundle++) { - cIssue* issue = (*itCheckerBundle)->GetIssueById(id); + cIssue *issue = (*itCheckerBundle)->GetIssueById(id); if (nullptr != issue) { @@ -360,7 +367,8 @@ bool cResultContainer::HasXOSCFilePath() const // Returns the xodr filename. Empty string if no file name is present. std::string cResultContainer::GetXODRFileName(const bool bRemoveExtension) const { - for (std::list::const_iterator itCheckerBundle = m_Bundles.cbegin(); itCheckerBundle != m_Bundles.cend(); itCheckerBundle++) + for (std::list::const_iterator itCheckerBundle = m_Bundles.cbegin(); + itCheckerBundle != m_Bundles.cend(); itCheckerBundle++) { std::string xodrFilename = (*itCheckerBundle)->GetXODRFileName(bRemoveExtension); @@ -374,7 +382,8 @@ std::string cResultContainer::GetXODRFileName(const bool bRemoveExtension) const // Returns the xodr path of the first checkerbundle. Empty string if no file name is present. std::string cResultContainer::GetXODRFilePath() const { - for (std::list::const_iterator itCheckerBundle = m_Bundles.cbegin(); itCheckerBundle != m_Bundles.cend(); itCheckerBundle++) + for (std::list::const_iterator itCheckerBundle = m_Bundles.cbegin(); + itCheckerBundle != m_Bundles.cend(); itCheckerBundle++) { std::string xodrFilepath = (*itCheckerBundle)->GetXODRFilePath(); @@ -388,7 +397,8 @@ std::string cResultContainer::GetXODRFilePath() const // Returns the xodr path of the first checkerbundle. Empty std::string if no file name is present. std::string cResultContainer::GetXOSCFilePath() const { - for (std::list::const_iterator itCheckerBundle = m_Bundles.cbegin(); itCheckerBundle != m_Bundles.cend(); itCheckerBundle++) + for (std::list::const_iterator itCheckerBundle = m_Bundles.cbegin(); + itCheckerBundle != m_Bundles.cend(); itCheckerBundle++) { std::string xoscFilepath = (*itCheckerBundle)->GetXOSCFilePath(); @@ -400,17 +410,19 @@ std::string cResultContainer::GetXOSCFilePath() const } // Processes every issue on every checkerbundle, checker and does a defined processing -void cResultContainer::DoProcessing(void(*funcIteratorPtr)(cCheckerBundle*, cChecker*, cIssue*)) +void cResultContainer::DoProcessing(void (*funcIteratorPtr)(cCheckerBundle *, cChecker *, cIssue *)) { - for (std::list::const_iterator itCheckerBundle = m_Bundles.begin(); itCheckerBundle != m_Bundles.end(); itCheckerBundle++) + for (std::list::const_iterator itCheckerBundle = m_Bundles.begin(); + itCheckerBundle != m_Bundles.end(); itCheckerBundle++) { - std::list checkers = (*itCheckerBundle)->GetCheckers(); + std::list checkers = (*itCheckerBundle)->GetCheckers(); - for (std::list::const_iterator itChecker = checkers.begin(); itChecker != checkers.end(); itChecker++) + for (std::list::const_iterator itChecker = checkers.begin(); itChecker != checkers.end(); + itChecker++) { - std::list issues = (*itChecker)->GetIssues(); + std::list issues = (*itChecker)->GetIssues(); - for (std::list::const_iterator itIssue = issues.begin(); itIssue != issues.end(); itIssue++) + for (std::list::const_iterator itIssue = issues.begin(); itIssue != issues.end(); itIssue++) { funcIteratorPtr(*itCheckerBundle, *itChecker, *itIssue); } @@ -432,39 +444,43 @@ unsigned long long cResultContainer::NextFreeId() * * \return */ - void cResultContainer::ConvertReportToConfiguration(cConfiguration* resultConfiguration) +void cResultContainer::ConvertReportToConfiguration(cConfiguration *resultConfiguration) { - if (nullptr == resultConfiguration) - return; - + if (nullptr == resultConfiguration) + return; // Transfer checker bundles from report to configuration - for (std::list::const_iterator itCheckerBundle = m_Bundles.begin(); itCheckerBundle != m_Bundles.end(); itCheckerBundle++) + for (std::list::const_iterator itCheckerBundle = m_Bundles.begin(); + itCheckerBundle != m_Bundles.end(); itCheckerBundle++) { - cConfigurationCheckerBundle* pConfigBundle = resultConfiguration->AddCheckerBundle((*itCheckerBundle)->GetBundleName()); - const cParameterContainer* pBundleParams = (*itCheckerBundle)->GetParamContainer(); + cConfigurationCheckerBundle *pConfigBundle = + resultConfiguration->AddCheckerBundle((*itCheckerBundle)->GetBundleName()); + const cParameterContainer *pBundleParams = (*itCheckerBundle)->GetParamContainer(); std::vector bundleParamKeys = pBundleParams->GetParams(); // Transfer params from report to configuration - for (std::vector::const_iterator itCheckerBundleParams = bundleParamKeys.begin(); itCheckerBundleParams != bundleParamKeys.end(); itCheckerBundleParams++) + for (std::vector::const_iterator itCheckerBundleParams = bundleParamKeys.begin(); + itCheckerBundleParams != bundleParamKeys.end(); itCheckerBundleParams++) { pConfigBundle->SetParam(*itCheckerBundleParams, pBundleParams->GetParam(*itCheckerBundleParams)); } // Transfer checkers from report to configuration - std::list checkers = (*itCheckerBundle)->GetCheckers(); - for (std::list::const_iterator itChecker = checkers.begin(); itChecker != checkers.end(); itChecker++) + std::list checkers = (*itCheckerBundle)->GetCheckers(); + for (std::list::const_iterator itChecker = checkers.begin(); itChecker != checkers.end(); + itChecker++) { - cConfigurationChecker* pConfigChecker = pConfigBundle->AddChecker((*itChecker)->GetCheckerID()); + cConfigurationChecker *pConfigChecker = pConfigBundle->AddChecker((*itChecker)->GetCheckerID()); - const cParameterContainer* pCheckerParams = (*itChecker)->GetParamContainer(); + const cParameterContainer *pCheckerParams = (*itChecker)->GetParamContainer(); std::vector checkerParamKeys = pCheckerParams->GetParams(); // Transfer params from report to configuration - for (std::vector::const_iterator itCheckerParams = checkerParamKeys.begin(); itCheckerParams != checkerParamKeys.end(); itCheckerParams++) + for (std::vector::const_iterator itCheckerParams = checkerParamKeys.begin(); + itCheckerParams != checkerParamKeys.end(); itCheckerParams++) { pConfigChecker->SetParam(*itCheckerParams, pCheckerParams->GetParam(*itCheckerParams)); } } } -} \ No newline at end of file +} diff --git a/src/common/src/result_format/cRoadLocation.cpp b/src/common/src/result_format/c_road_location.cpp similarity index 60% rename from src/common/src/result_format/cRoadLocation.cpp rename to src/common/src/result_format/c_road_location.cpp index 649e0d8e..d9e71c1d 100644 --- a/src/common/src/result_format/cRoadLocation.cpp +++ b/src/common/src/result_format/c_road_location.cpp @@ -5,22 +5,22 @@ * Public License, v. 2.0. If a copy of the MPL was not distributed * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "common/result_format/cRoadLocation.h" +#include "common/result_format/c_road_location.h" XERCES_CPP_NAMESPACE_USE -const XMLCh* cRoadLocation::TAG_NAME = CONST_XMLCH("RoadLocation"); -const XMLCh* cRoadLocation::ATTR_ROAD_ID = CONST_XMLCH("roadId"); -const XMLCh* cRoadLocation::ATTR_S = CONST_XMLCH("s"); -const XMLCh* cRoadLocation::ATTR_T = CONST_XMLCH("t"); +const XMLCh *cRoadLocation::TAG_NAME = CONST_XMLCH("RoadLocation"); +const XMLCh *cRoadLocation::ATTR_ROAD_ID = CONST_XMLCH("roadId"); +const XMLCh *cRoadLocation::ATTR_S = CONST_XMLCH("s"); +const XMLCh *cRoadLocation::ATTR_T = CONST_XMLCH("t"); -DOMElement* cRoadLocation::WriteXML(DOMDocument * p_resultDocument) +DOMElement *cRoadLocation::WriteXML(DOMDocument *p_resultDocument) { - DOMElement* p_DataElement = CreateExtendedInformationXMLNode(p_resultDocument); + DOMElement *p_DataElement = CreateExtendedInformationXMLNode(p_resultDocument); - XMLCh* pRoadId = XMLString::transcode(m_RoadID.c_str()); - XMLCh* pS = XMLString::transcode(std::to_string(m_S).c_str()); - XMLCh* pT = XMLString::transcode(std::to_string(m_T).c_str()); + XMLCh *pRoadId = XMLString::transcode(m_RoadID.c_str()); + XMLCh *pS = XMLString::transcode(std::to_string(m_S).c_str()); + XMLCh *pT = XMLString::transcode(std::to_string(m_T).c_str()); p_DataElement->setAttribute(ATTR_ROAD_ID, pRoadId); p_DataElement->setAttribute(ATTR_S, pS); @@ -33,13 +33,13 @@ DOMElement* cRoadLocation::WriteXML(DOMDocument * p_resultDocument) return p_DataElement; } -cRoadLocation* cRoadLocation::ParseFromXML(DOMNode *, DOMElement * pXMLElement) +cRoadLocation *cRoadLocation::ParseFromXML(DOMNode *, DOMElement *pXMLElement) { std::string strRoadId = XMLString::transcode(pXMLElement->getAttribute(ATTR_ROAD_ID)); std::string strS = XMLString::transcode(pXMLElement->getAttribute(ATTR_S)); std::string strT = XMLString::transcode(pXMLElement->getAttribute(ATTR_T)); - cRoadLocation* result = new cRoadLocation(strRoadId, (float)atof(strS.c_str()), (float)atof(strT.c_str())); + cRoadLocation *result = new cRoadLocation(strRoadId, (float)atof(strS.c_str()), (float)atof(strT.c_str())); return result; } @@ -51,7 +51,7 @@ std::string cRoadLocation::GetRoadID() const } // Returns the road Id as integer -void cRoadLocation::GetRoadID(int& roadId) const +void cRoadLocation::GetRoadID(int &roadId) const { roadId = atoi(m_RoadID.c_str()); } @@ -66,4 +66,4 @@ float cRoadLocation::GetS() const float cRoadLocation::GetT() const { return m_T; -} \ No newline at end of file +} diff --git a/src/common/src/result_format/cXMLLocation.cpp b/src/common/src/result_format/c_xml_location.cpp similarity index 59% rename from src/common/src/result_format/cXMLLocation.cpp rename to src/common/src/result_format/c_xml_location.cpp index e76276b4..48d9200e 100644 --- a/src/common/src/result_format/cXMLLocation.cpp +++ b/src/common/src/result_format/c_xml_location.cpp @@ -5,18 +5,18 @@ * Public License, v. 2.0. If a copy of the MPL was not distributed * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "common/result_format/cXMLLocation.h" +#include "common/result_format/c_xml_location.h" XERCES_CPP_NAMESPACE_USE -const XMLCh* cXMLLocation::TAG_NAME = CONST_XMLCH("XMLLocation"); -const XMLCh* cXMLLocation::ATTR_XPATH = CONST_XMLCH("xpath"); +const XMLCh *cXMLLocation::TAG_NAME = CONST_XMLCH("XMLLocation"); +const XMLCh *cXMLLocation::ATTR_XPATH = CONST_XMLCH("xpath"); -DOMElement* cXMLLocation::WriteXML(DOMDocument * p_resultDocument) +DOMElement *cXMLLocation::WriteXML(DOMDocument *p_resultDocument) { - DOMElement* p_DataElement = CreateExtendedInformationXMLNode(p_resultDocument); + DOMElement *p_DataElement = CreateExtendedInformationXMLNode(p_resultDocument); - XMLCh* pXPath = XMLString::transcode(m_XPath.c_str()); + XMLCh *pXPath = XMLString::transcode(m_XPath.c_str()); p_DataElement->setAttribute(ATTR_XPATH, pXPath); @@ -25,11 +25,11 @@ DOMElement* cXMLLocation::WriteXML(DOMDocument * p_resultDocument) return p_DataElement; } -cXMLLocation* cXMLLocation::ParseFromXML(DOMNode *, DOMElement * pXMLElement) +cXMLLocation *cXMLLocation::ParseFromXML(DOMNode *, DOMElement *pXMLElement) { std::string strXPath = XMLString::transcode(pXMLElement->getAttribute(ATTR_XPATH)); - cXMLLocation* result = new cXMLLocation(strXPath); + cXMLLocation *result = new cXMLLocation(strXPath); return result; } @@ -39,31 +39,31 @@ std::string cXMLLocation::GetXPath() const return m_XPath; } -cXMLLocation* cXMLLocation::CreateXMLLocationByRoadId(const std::string& roadId) +cXMLLocation *cXMLLocation::CreateXMLLocationByRoadId(const std::string &roadId) { std::stringstream xPath = CreateXPathByRoadId(roadId); return new cXMLLocation(xPath.str()); } -cXMLLocation* cXMLLocation::CreateXMLLocationByRoadIdWithPlanView(const std::string& roadId) +cXMLLocation *cXMLLocation::CreateXMLLocationByRoadIdWithPlanView(const std::string &roadId) { std::stringstream xPath = CreateXPathByRoadId(roadId); xPath << "/planView"; return new cXMLLocation(xPath.str()); } -cXMLLocation* cXMLLocation::CreateXMLLocationByRoadIdWithElevationProfile(const std::string& roadId) +cXMLLocation *cXMLLocation::CreateXMLLocationByRoadIdWithElevationProfile(const std::string &roadId) { std::stringstream xPath = CreateXPathByRoadId(roadId); xPath << "/elevationProfile"; return new cXMLLocation(xPath.str()); } -std::stringstream cXMLLocation::CreateXPathByRoadId(const std::string& roadId) +std::stringstream cXMLLocation::CreateXPathByRoadId(const std::string &roadId) { std::stringstream xPath; xPath << "/OpenDRIVE/road[@id='"; xPath << roadId; xPath << "']"; return xPath; -} \ No newline at end of file +} diff --git a/src/common/src/util.cpp b/src/common/src/util.cpp index 1e9898b2..a29af432 100644 --- a/src/common/src/util.cpp +++ b/src/common/src/util.cpp @@ -7,16 +7,16 @@ */ #include "common/util.h" -#include -#include #include +#include +#include #include -#include "common/result_format/cFileLocation.h" +#include "common/result_format/c_file_location.h" #include -void GetFileName(std::string* strFilePath, const bool bRemoveExtension) +void GetFileName(std::string *strFilePath, const bool bRemoveExtension) { if (strFilePath->size() < 1) return; @@ -41,20 +41,20 @@ void GetFileName(std::string* strFilePath, const bool bRemoveExtension) } // Returns the file size of a document -std::ifstream::pos_type GetFileSize(const char* filename) +std::ifstream::pos_type GetFileSize(const char *filename) { std::ifstream in(filename, std::ifstream::ate | std::ifstream::binary); return in.tellg(); } // true wenn strings identisch -bool Equals(const std::string& in1, const std::string& in2) +bool Equals(const std::string &in1, const std::string &in2) { return !in1.compare(in2); } // True if strings match -bool Equals(const wchar_t* in1, const wchar_t* in2) +bool Equals(const wchar_t *in1, const wchar_t *in2) { return wcscmp(in1, in2) == 0; } @@ -84,7 +84,7 @@ bool IsDouble(char i_chars[]) return true; } -bool StringEndsWith(std::string const& value, std::string const& ending) +bool StringEndsWith(std::string const &value, std::string const &ending) { if (ending.size() > value.size()) { @@ -110,13 +110,15 @@ tHistogram ComputeHistogram(const std::vector boundaries, const std::vect float firstBoundary = boundaries.front(); // Iterate bounds, begin at bounds + 1 because we already have first entry. - for (std::vector::const_iterator currentUpperBound = boundaries.begin()+1 ; currentUpperBound != boundaries.end(); currentUpperBound++) + for (std::vector::const_iterator currentUpperBound = boundaries.begin() + 1; + currentUpperBound != boundaries.end(); currentUpperBound++) { std::pair currentBound(firstBoundary, *currentUpperBound); float vCount = 0.0f; float vSum = 0.0f; - for (std::vector::const_iterator currentValue = values.begin(); currentValue != values.end(); currentValue++) + for (std::vector::const_iterator currentValue = values.begin(); currentValue != values.end(); + currentValue++) { if (InBound(currentBound, *currentValue)) { @@ -127,61 +129,55 @@ tHistogram ComputeHistogram(const std::vector boundaries, const std::vect firstBoundary = *currentUpperBound; - computedHistogramm[currentBound] = std::vector {vCount, vCount / values.size(), vSum }; + computedHistogramm[currentBound] = std::vector{vCount, vCount / values.size(), vSum}; } return computedHistogramm; } - -std::string PrintHistogram(const tHistogram& histogram) +std::string PrintHistogram(const tHistogram &histogram) { std::stringstream ssMapResultString; - if(histogram.size() == 0) + if (histogram.size() == 0) { return "no entries."; } ssMapResultString.setf(std::ios::fixed); ssMapResultString.precision(2); - for (std::map, std::vector >::const_iterator it = histogram.begin(); it != histogram.end(); it++) + for (std::map, std::vector>::const_iterator it = histogram.begin(); + it != histogram.end(); it++) { - std::pairkey(it->first); + std::pair key(it->first); ssMapResultString << "[" << ((key.first == FLT_MAX) ? "inf" : PrintDecimalValue(key.first, 0)) << "," - << ((key.second == FLT_MAX) ? "inf" : PrintDecimalValue(key.second, 0)) << ") = " - << PrintDecimalValue(it->second.at(0), 0) << "(" << it->second.at(1) * 100.0f << "%); "; + << ((key.second == FLT_MAX) ? "inf" : PrintDecimalValue(key.second, 0)) + << ") = " << PrintDecimalValue(it->second.at(0), 0) << "(" << it->second.at(1) * 100.0f + << "%); "; } return ssMapResultString.str(); } -std::string ToLower(const std::string& source) +std::string ToLower(const std::string &source) { std::string result; result.resize(source.size()); - std::transform(source.begin(), - source.end(), - result.begin(), - ::tolower); + std::transform(source.begin(), source.end(), result.begin(), ::tolower); return result; } -std::string ToUpper(const std::string& source) +std::string ToUpper(const std::string &source) { std::string result; result.resize(source.size()); - std::transform(source.begin(), - source.end(), - result.begin(), - ::toupper); + std::transform(source.begin(), source.end(), result.begin(), ::toupper); return result; } - bool CheckIfFileExists(std::string filePath, const bool printLog) { struct stat fileStatus; @@ -189,33 +185,35 @@ bool CheckIfFileExists(std::string filePath, const bool printLog) if (stat(filePath.c_str(), &fileStatus) == -1) // ==0 ok; ==-1 error { if (printLog) - std::cout << "File " << filePath << " could not be parsed. Please check file path and if file exists" << std::endl; + std::cout << "File " << filePath << " could not be parsed. Please check file path and if file exists" + << std::endl; return false; } return true; } -bool Replace(std::string& str, const std::string& from, const std::string& to) +bool Replace(std::string &str, const std::string &from, const std::string &to) { if (from.empty()) return false; size_t start_pos = 0; - while ((start_pos = str.find(from, start_pos)) != std::string::npos) { + while ((start_pos = str.find(from, start_pos)) != std::string::npos) + { str.replace(start_pos, from.length(), to); start_pos += to.length(); // In case 'to' contains 'from', like replacing 'x' with 'yx' } return true; } -bool IsNumber(const std::string& input) +bool IsNumber(const std::string &input) { long double ld{0}; - return((std::istringstream(input) >> ld >> std::ws).eof() && !input.empty()); + return ((std::istringstream(input) >> ld >> std::ws).eof() && !input.empty()); } -bool GetXodrFilePathFromXosc(const std::string xoscFilePath, std::string& strPathOut) +bool GetXodrFilePathFromXosc(const std::string xoscFilePath, std::string &strPathOut) { QDomDocument xmlBOM; QString xodrFilePath = ""; @@ -256,9 +254,11 @@ bool GetXodrFilePathFromXosc(const std::string xoscFilePath, std::string& strPat // Read each entry of the child node while (!Entry.isNull()) { - if (Entry.tagName().toLower() == "logics" || Entry.tagName().toLower() == "logicfile") // XOSC 0.9 & 1.0 + if (Entry.tagName().toLower() == "logics" || + Entry.tagName().toLower() == "logicfile") // XOSC 0.9 & 1.0 xodrFilePath = Entry.attribute("filepath", ""); - if (Entry.tagName().toLower() == "scenegraph" || Entry.tagName().toLower() == "scenegraphfile") // XOSC 0.9 & 1.0 + if (Entry.tagName().toLower() == "scenegraph" || + Entry.tagName().toLower() == "scenegraphfile") // XOSC 0.9 & 1.0 sceneGraphFileName = Entry.attribute("filepath", ""); // Next Entry diff --git a/src/common/src/xml/cXPathEvaluator.cpp b/src/common/src/xml/c_x_path_evaluator.cpp similarity index 93% rename from src/common/src/xml/cXPathEvaluator.cpp rename to src/common/src/xml/c_x_path_evaluator.cpp index 0167e051..5cb48a68 100644 --- a/src/common/src/xml/cXPathEvaluator.cpp +++ b/src/common/src/xml/c_x_path_evaluator.cpp @@ -6,9 +6,9 @@ * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "common/xml/cXPathEvaluator.h" +#include "common/xml/c_x_path_evaluator.h" -#include "common/result_format/cFileLocation.h" +#include "common/result_format/c_file_location.h" cXPathEvaluator::cXPathEvaluator() { @@ -58,7 +58,7 @@ void cXPathEvaluator::SetAnnotatedRowsOnChildElements(QDomElement domElement) } } -bool cXPathEvaluator::ReadDOMFromFile(const QString xmlFilePath, QDomDocument& domDocument) +bool cXPathEvaluator::ReadDOMFromFile(const QString xmlFilePath, QDomDocument &domDocument) { QFile xmlFile; xmlFile.setFileName(xmlFilePath); @@ -80,7 +80,8 @@ bool cXPathEvaluator::ReadDOMFromFile(const QString xmlFilePath, QDomDocument& d if (!domDocument.setContent(&xmlFile)) { - std::cerr << "Could not set content of file '" << xmlFilePath.toLocal8Bit().data() << "' to DOM document." << std::endl; + std::cerr << "Could not set content of file '" << xmlFilePath.toLocal8Bit().data() << "' to DOM document." + << std::endl; xmlFile.close(); return false; } @@ -89,7 +90,7 @@ bool cXPathEvaluator::ReadDOMFromFile(const QString xmlFilePath, QDomDocument& d return true; } -bool cXPathEvaluator::GetAffectedRowsOfXPath(const QString xpath, QVector& rows) +bool cXPathEvaluator::GetAffectedRowsOfXPath(const QString xpath, QVector &rows) { QString xmlResult; bool success = GetXmlResultOfXPath(xpath, xmlResult); @@ -103,7 +104,7 @@ bool cXPathEvaluator::GetAffectedRowsOfXPath(const QString xpath, QVector& return (rows.size() > 0); } -bool cXPathEvaluator::GetXmlResultOfXPath(const QString xpath, QString& xmlResult) +bool cXPathEvaluator::GetXmlResultOfXPath(const QString xpath, QString &xmlResult) { query.setQuery(xpath); if (!query.isValid()) @@ -116,15 +117,15 @@ bool cXPathEvaluator::GetXmlResultOfXPath(const QString xpath, QString& xmlResul if (!success) return false; - if (xmlResult.isNull() || xmlResult.isEmpty() || xmlResult.size()<2) + if (xmlResult.isNull() || xmlResult.isEmpty() || xmlResult.size() < 2) { std::cerr << "Query for xpath '" << xpath.toLocal8Bit().data() << "' found no result." << std::endl; return false; } -return true; + return true; } -bool cXPathEvaluator::GetAnnotatedRowsOfRootElements(const QString xml, QVector& rows) +bool cXPathEvaluator::GetAnnotatedRowsOfRootElements(const QString xml, QVector &rows) { // If the xml string contains more than one root node, it is not valid. // Therefore we add a default root around the given xml string @@ -155,6 +156,3 @@ bool cXPathEvaluator::GetAnnotatedRowsOfRootElements(const QString xml, QVector< return true; } - - - diff --git a/src/common/src/xsd/cOSCSchemaChecker.cpp b/src/common/src/xsd/cOSCSchemaChecker.cpp deleted file mode 100644 index 5d23accf..00000000 --- a/src/common/src/xsd/cOSCSchemaChecker.cpp +++ /dev/null @@ -1,250 +0,0 @@ -/* - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ -#include "common/xsd/cOSCSchemaChecker.h" - -XERCES_CPP_NAMESPACE_USE - -void OSCSchemaChecker::Init() -{ - XMLPlatformUtils::Initialize(); - pResultContainer = new cResultContainer(); - pXSDCheckerBundle = new cCheckerBundle(checkerBundleName, "", ""); - pResultContainer->AddCheckerBundle(pXSDCheckerBundle); - xoscFilePath = inputParams.GetParam("XoscFile"); -} - -bool OSCSchemaChecker::RunChecks() -{ - bool bXOSCValid = false; - - try { - unsigned revMajorHeader = 0; - unsigned revMinorHeader = 0; - std::stringstream ssVersionString; - - std::cout << "Check: '" << xoscFilePath.c_str() << "'" << std::endl << std::endl; - - bXOSCValid = ExtractXOSCVersion(&revMajorHeader, &revMinorHeader); - - ssVersionString << revMajorHeader << "." << revMinorHeader; - std::cout << "Found OpenSCENARIO version: " << ssVersionString.str() << ". "; - std::string strSchemaFilesUsedDesc = ""; - - if (versionToXsdFile.find(ssVersionString.str().c_str()) != versionToXsdFile.end()) { - std::list schemaFiles = versionToXsdFile.at(ssVersionString.str().c_str()); - std::cout << "Use schema files:" << std::endl; - - std::list::iterator itSchemaFile; - for (itSchemaFile = schemaFiles.begin(); itSchemaFile != schemaFiles.end(); - itSchemaFile++) { - std::cout << "> " << itSchemaFile->filename() << std::endl; - strSchemaFilesUsedDesc += itSchemaFile->filename().string(); - strSchemaFilesUsedDesc += ", "; - } - std::cout << std::endl << "for validation." << std::endl << std::endl; - - if (strSchemaFilesUsedDesc.size() > 2) - strSchemaFilesUsedDesc = - strSchemaFilesUsedDesc.substr(0, strSchemaFilesUsedDesc.size() - 2); - - ValidateXSD(schemaFiles); - - cChecker* pXSDParserChecker = pXSDCheckerBundle->GetCheckerById("xoscSchemaChecker"); - - if (nullptr == pXSDParserChecker) - pXSDParserChecker = pXSDCheckerBundle->CreateChecker( - "xoscSchemaChecker", "Checks the validity of the xml schema of an xosc."); - - std::string s_description = pXSDParserChecker->GetDescription(); - std::stringstream ssDescription; - ssDescription << s_description << " Found xosc version: " << ssVersionString.str() - << ". Used schema file " << strSchemaFilesUsedDesc << " for validation."; - pXSDParserChecker->SetDescription(ssDescription.str()); - - pXSDParserChecker->UpdateSummary(); - } - else { - std::stringstream errMsg; - errMsg << "Got header version " << ssVersionString.str() - << " from OpenSCENARIO. This version is not supported."; - - std::cerr << errMsg.str(); - - cChecker* pXSDParserChecker = pXSDCheckerBundle->CreateChecker( - "xoscVersionChecker", "Checks the validity of an xosc."); - cLocationsContainer* loc = new cLocationsContainer( - "Version isn't supported.", - (cExtendedInformation*)new cFileLocation(eFileType::XOSC, 3, 5)); - pXSDParserChecker->AddIssue(new cIssue(errMsg.str(), ERROR_LVL, loc)); - pXSDParserChecker->UpdateSummary(); - bXOSCValid = false; - } - - pXSDCheckerBundle->SetXOSCFilePath(xoscFilePath); - } - catch (...) { - std::cerr << "Unexpected exception occurred while parsing XOSC." << std::endl; - XMLPlatformUtils::Terminate(); - exit(1); - } - - pXSDCheckerBundle->SetDescription("Checks validity of the xml schema of a given xosc file."); - - std::stringstream ssSummaryString; - unsigned int issueCount = pXSDCheckerBundle->GetIssueCount(); - ssSummaryString << "Found " << issueCount << (issueCount == 1 ? " issue" : " issues"); - pXSDCheckerBundle->SetSummary(ssSummaryString.str()); - - std::cout << pXSDCheckerBundle->GetSummary() << std::endl << std::endl; - std::cout << "Write report: '" << inputParams.GetParam("strResultFile") << "'" << std::endl << std::endl; - pResultContainer->WriteResults(inputParams.GetParam("strResultFile")); - - std::cout << "Finished." << std::endl; - - pResultContainer->Clear(); - delete pResultContainer; - - XMLPlatformUtils::Terminate(); - - return bXOSCValid; -} - -bool OSCSchemaChecker::ValidateXSD(const std::list& lSchemaFiles) -{ - bool validationSuccessfull = true; - - XercesDOMParser domParser; - std::list::const_iterator itSchemaFile; - for (itSchemaFile = lSchemaFiles.begin(); itSchemaFile != lSchemaFiles.end(); itSchemaFile++) { - std::string strSchemaFilePath = itSchemaFile->string(); - std::cout << "Load Grammar: " << strSchemaFilePath << std::endl; - - if (domParser.loadGrammar(strSchemaFilePath.c_str(), Grammar::SchemaGrammarType) == NULL) { - validationSuccessfull = false; - - cChecker* pXSDParserChecker = pXSDCheckerBundle->CreateChecker( - "xoscSchemaChecker", "Checks the validity of an xosc."); - - std::stringstream ssErrorDesc; - ssErrorDesc << "Schema file '" << strSchemaFilePath - << "'could not be loaded. Abort schema verifcation with error."; - - pXSDParserChecker->AddIssue(new cIssue(ssErrorDesc.str(), ERROR_LVL)); - pXSDParserChecker->UpdateSummary(); - - return false; - } - domParser.setExternalNoNamespaceSchemaLocation(strSchemaFilePath.c_str()); - } - - cParserErrorHandler parserErrorHandler(pXSDCheckerBundle, xoscFilePath.c_str()); - - domParser.setErrorHandler(&parserErrorHandler); - domParser.setValidationScheme(XercesDOMParser::Val_Always); - domParser.setDoNamespaces(true); - domParser.setDoSchema(true); - domParser.setValidationSchemaFullChecking(true); - - std::cout << "Validate..." << std::endl; - domParser.parse(xoscFilePath.c_str()); - - if (domParser.getErrorCount() != 0) - validationSuccessfull = false; - - return validationSuccessfull; -} - -bool OSCSchemaChecker::ExtractXOSCVersion(unsigned* i_uRevMajor, unsigned* i_uRevMinor) -{ - bool bValid = false; - - try { - XMLCh* i_pRevMinor = XMLString::transcode("revMinor"); - XMLCh* i_pRevMajor = XMLString::transcode("revMajor"); - - XercesDOMParser domParser; - cParserErrorHandler parserErrorHandler(pXSDCheckerBundle, xoscFilePath.c_str()); - - domParser.setErrorHandler(&parserErrorHandler); - - domParser.parse(xoscFilePath.c_str()); - - DOMDocument* pInputDocument = domParser.getDocument(); - - if (nullptr == pInputDocument) - return false; - - XMLCh* pTagName = XMLString::transcode("FileHeader"); - DOMNodeList* lHeaderNodes = pInputDocument->getElementsByTagName(pTagName); - - if (lHeaderNodes->getLength() != 1) { - std::stringstream errMsg; - errMsg << "Found " << (lHeaderNodes->getLength() == 0 ? "zero" : "multiple") - << " file header tags in xml file. This is not supported."; - - cChecker* pXSDParserChecker = pXSDCheckerBundle->GetCheckerById("xoscSchemaChecker"); - - if (nullptr == pXSDParserChecker) { - pXSDParserChecker = pXSDCheckerBundle->CreateChecker( - "xoscSchemaChecker", "Checks the validity of the header tag of an xosc."); - } - - pXSDParserChecker->AddIssue(new cIssue(errMsg.str(), ERROR_LVL)); - pXSDParserChecker->UpdateSummary(); - } - else { - bValid = true; - } - - XMLSize_t i_sIdx = 0; - DOMElement* i_nHeaderNode = dynamic_cast(lHeaderNodes->item(i_sIdx)); - - std::string i_sRevMinor = XMLString::transcode(i_nHeaderNode->getAttribute(i_pRevMinor)); - std::string i_sRevMajor = XMLString::transcode(i_nHeaderNode->getAttribute(i_pRevMajor)); - - *i_uRevMajor = stoul(i_sRevMajor, nullptr, 0); - *i_uRevMinor = stoul(i_sRevMinor, nullptr, 0); - - XMLString::release(&pTagName); - XMLString::release(&i_pRevMajor); - XMLString::release(&i_pRevMinor); - } - catch (...) { - std::stringstream errMsg; - errMsg << "Could not retrieve header version from OpenSCENARIO. Abort with error."; - - cChecker* pXSDParserChecker = pXSDCheckerBundle->CreateChecker( - "xoscSchemaChecker", "Checks the validity of the header tag of an OpenSCENARIO."); - pXSDParserChecker->AddIssue(new cIssue(errMsg.str(), ERROR_LVL)); - pXSDParserChecker->UpdateSummary(); - } - - return bValid; -} - -void OSCSchemaChecker::WriteEmptyReport() -{ - cResultContainer emptyReport; - emptyReport.AddCheckerBundle(pXSDCheckerBundle); - - std::stringstream ssDefaultResultFile; - ssDefaultResultFile << checkerBundleName << ".xqar"; - pXSDCheckerBundle->SetParam("strResultFile", ssDefaultResultFile.str()); - - pXSDCheckerBundle->CreateChecker("xoscVersionChecker"); - pXSDCheckerBundle->CreateChecker("xoscSchemaChecker"); - - std::stringstream ssReportFile; - ssReportFile << checkerBundleName << ".xqar"; - - std::cout << std::endl; - std::cout << "Write empty report: '" << ssReportFile.str() << "'" << std::endl << std::endl; - emptyReport.WriteResults(ssReportFile.str()); - - std::cout << "Finished." << std::endl; -} \ No newline at end of file diff --git a/src/common/src/xsd/cParserErrorHandler.cpp b/src/common/src/xsd/cParserErrorHandler.cpp deleted file mode 100644 index 2c029c3b..00000000 --- a/src/common/src/xsd/cParserErrorHandler.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -#include "common/xsd/cParserErrorHandler.h" - -#include "common/result_format/cChecker.h" -#include "common/result_format/cCheckerBundle.h" -#include "common/result_format/cFileLocation.h" -#include "common/result_format/cLocationsContainer.h" - -cParserErrorHandler::cParserErrorHandler(cCheckerBundle* checkerBundle, const char* filePath) - : ErrorHandler() -{ - myCheckerBundle = checkerBundle; - myFilePath = filePath; -} - -void cParserErrorHandler::reportParseException(const SAXParseException& ex) -{ - reportParseIssue(ex, eIssueLevel::WARNING_LVL); -} - -void cParserErrorHandler::reportParseIssue(const SAXParseException& ex, eIssueLevel issueLevel) -{ - if (myCheckerBundle != nullptr) { - std::stringstream errorStr; - std::string message = XMLString::transcode(ex.getMessage()); - - errorStr << "Row:" << ex.getLineNumber() << " Column:" << ex.getColumnNumber() - << " Message: " << message; - - cChecker* pXodrParserChecker = myCheckerBundle->GetCheckerById("xoscSchemaChecker"); - - if (nullptr == pXodrParserChecker) { - pXodrParserChecker = myCheckerBundle->CreateChecker( - "xoscSchemaChecker", "Checks the xsd validity of an OpenSCENARIO."); - } - - cLocationsContainer* loc = new cLocationsContainer( - message, - (cExtendedInformation*)new cFileLocation( - eFileType::XOSC, (int)ex.getLineNumber(), (int)ex.getColumnNumber())); - - pXodrParserChecker->AddIssue(new cIssue(errorStr.str(), issueLevel, loc)); - } -} - -void cParserErrorHandler::warning(const SAXParseException& ex) -{ - reportParseIssue(ex, eIssueLevel::WARNING_LVL); -} - -void cParserErrorHandler::error(const SAXParseException& ex) -{ - reportParseIssue(ex, eIssueLevel::ERROR_LVL); -} - -void cParserErrorHandler::fatalError(const SAXParseException& ex) -{ - reportParseIssue(ex, eIssueLevel::ERROR_LVL); -} - -void cParserErrorHandler::resetErrors() -{ -} diff --git a/src/report_modules/report_module_gui/CMakeLists.txt b/src/report_modules/report_module_gui/CMakeLists.txt index d636dbec..04c507e7 100644 --- a/src/report_modules/report_module_gui/CMakeLists.txt +++ b/src/report_modules/report_module_gui/CMakeLists.txt @@ -11,13 +11,13 @@ set(CMAKE_AUTOMOC ON) qt5_add_resources(Resources res/POC_ReportModuleGUI.qrc) add_executable(${REPORT_MODULE_GUI_PROJECT} - src/reportFormatUI.cpp - src/ui/cCheckerWidget.cpp - src/ui/cReportModuleWindow.cpp - src/ui/cXMLCodeEditor.cpp - src/ui/cXODREditorWidget.cpp - src/ui/cXOSCEditorWidget.cpp - src/qrc/POC_ReportModuleGUI_QRC.cpp + src/report_format_ui.cpp + src/ui/c_checker_widget.cpp + src/ui/c_report_module_window.cpp + src/ui/c_xml_code_editor.cpp + src/ui/c_xodr_editor_widget.cpp + src/ui/c_xosc_editor_widget.cpp + src/qrc/poc__report_module_gui__qrc.cpp ) target_link_libraries(${REPORT_MODULE_GUI_PROJECT} PRIVATE diff --git a/src/report_modules/report_module_gui/src/qrc/POC_ReportModuleGUI_QRC.cpp b/src/report_modules/report_module_gui/src/qrc/POC_ReportModuleGUI_QRC.cpp deleted file mode 100644 index fab0d38f..00000000 --- a/src/report_modules/report_module_gui/src/qrc/POC_ReportModuleGUI_QRC.cpp +++ /dev/null @@ -1,475 +0,0 @@ -/**************************************************************************** -** Resource object code -** -** Created by: The Resource Compiler for Qt version 5.9.0 -** -** WARNING! All changes made in this file will be lost! -*****************************************************************************/ - -static const unsigned char qt_resource_data[] = { - // res/icons/marked_visible.png - 0x0,0x0,0x1,0x79, - 0x89, - 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, - 0x0,0x0,0x1f,0x0,0x0,0x0,0x1f,0x8,0x6,0x0,0x0,0x0,0x1f,0xae,0x16,0x39, - 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xb1,0x8f,0xb,0xfc,0x61,0x5, - 0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xe,0xc1,0x0,0x0,0xe,0xc1, - 0x1,0xb8,0x91,0x6b,0xed,0x0,0x0,0x0,0x18,0x74,0x45,0x58,0x74,0x53,0x6f,0x66, - 0x74,0x77,0x61,0x72,0x65,0x0,0x70,0x61,0x69,0x6e,0x74,0x2e,0x6e,0x65,0x74,0x20, - 0x34,0x2e,0x31,0x2e,0x34,0x13,0x40,0x68,0xc4,0x0,0x0,0x0,0xf7,0x49,0x44,0x41, - 0x54,0x58,0x47,0xed,0x92,0x1,0xa,0x83,0x40,0xc,0x4,0x7d,0xa0,0xcf,0xeb,0x4b, - 0xfb,0x81,0x2b,0xdb,0xcd,0x86,0xc4,0x8b,0x45,0xeb,0x29,0x5,0x3b,0xb0,0x60,0xf6, - 0xbc,0xc,0xb4,0x4e,0xbf,0xcf,0xa3,0xb5,0x94,0x4b,0x58,0x4a,0x63,0x4e,0xa7,0x92, - 0x2e,0x33,0x0,0x2c,0xe9,0x53,0xc9,0xd6,0xb2,0x76,0xbf,0xea,0x19,0xa7,0x3a,0xec, - 0x5,0xdf,0xa4,0xda,0xcb,0x38,0x4d,0x3c,0xdb,0xe4,0x29,0x97,0xed,0x4c,0xdc,0x27, - 0xe0,0xa3,0x96,0x58,0x7d,0x67,0x39,0x9e,0x3d,0xc5,0xb2,0xdd,0x9,0xfb,0x84,0xcd, - 0x8e,0xd5,0x77,0xfe,0xd9,0xe3,0xcb,0xd5,0xb2,0xbd,0x89,0xfb,0x4,0x7c,0xd4,0x12, - 0xab,0xfd,0x80,0xd1,0x92,0xd8,0xc5,0x7e,0x4b,0xc2,0x3d,0x61,0xb3,0x63,0x75,0x6, - 0x97,0xe7,0x79,0xb6,0xa9,0xa7,0x13,0x15,0xa9,0x80,0x8f,0x5a,0x62,0x75,0x6,0xe2, - 0x4f,0x72,0x51,0x49,0x91,0x35,0xe0,0xa3,0x96,0x58,0x9d,0xd9,0x2a,0x17,0x5b,0xc4, - 0x0,0x3e,0x6a,0x89,0xd5,0x7e,0xf0,0x8e,0xe4,0xb1,0x3b,0x12,0x61,0xb3,0x63,0x75, - 0xfe,0x3a,0x25,0x8f,0xdd,0x91,0x8,0xf8,0xa8,0x25,0x56,0xdf,0x59,0x8e,0x67,0x45, - 0xf2,0xd8,0x1d,0x89,0xb0,0xd9,0xb1,0x3a,0x23,0xf9,0x68,0xe0,0xa3,0x96,0x58,0x9d, - 0xf9,0xcb,0x47,0x3,0x1f,0xb5,0x44,0x45,0x8a,0xe4,0xd5,0xd9,0x80,0x38,0xd5,0xe1, - 0x65,0xf2,0x92,0x20,0x3f,0x7,0xfc,0x5,0x6b,0x91,0x7c,0xd9,0x8f,0x4a,0x59,0x5e, - 0x93,0x36,0xbd,0x0,0xd4,0x9e,0x8,0x29,0x47,0xd,0xfa,0x49,0x0,0x0,0x0,0x0, - 0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, - // res/icons/green.png - 0x0,0x0,0x3,0xff, - 0x89, - 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, - 0x0,0x0,0x1c,0x0,0x0,0x0,0x1c,0x8,0x6,0x0,0x0,0x0,0x72,0xd,0xdf,0x94, - 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xb1,0x8f,0xb,0xfc,0x61,0x5, - 0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xe,0xbf,0x0,0x0,0xe,0xbf, - 0x1,0x38,0x5,0x53,0x24,0x0,0x0,0x0,0x18,0x74,0x45,0x58,0x74,0x53,0x6f,0x66, - 0x74,0x77,0x61,0x72,0x65,0x0,0x70,0x61,0x69,0x6e,0x74,0x2e,0x6e,0x65,0x74,0x20, - 0x34,0x2e,0x31,0x2e,0x35,0x64,0x47,0x58,0x52,0x0,0x0,0x3,0x7d,0x49,0x44,0x41, - 0x54,0x48,0x4b,0xb5,0x96,0x4b,0x48,0x94,0x51,0x14,0xc7,0xe7,0x9b,0x87,0xe3,0x3c, - 0x1c,0xb3,0x84,0xd1,0xb1,0x49,0x19,0x4d,0xcc,0xf7,0x38,0x5a,0xa0,0x16,0xd9,0x3, - 0x9,0x5b,0xf8,0x28,0x82,0x12,0x75,0xb4,0x8d,0x8b,0x20,0x2,0xa9,0x4d,0x8b,0x70, - 0xe1,0x22,0x5a,0x16,0xd5,0xaa,0x4d,0x11,0x4,0xee,0x6a,0x51,0x6,0x86,0x42,0x88, - 0x45,0x90,0xf4,0x10,0x6c,0x9b,0xa1,0x14,0x81,0xa4,0xe5,0x63,0x4e,0xff,0xff,0xe7, - 0xcc,0x50,0x79,0x1d,0x47,0xfd,0x3a,0xf0,0x5b,0x28,0xf7,0xde,0xff,0x9c,0x7b,0xcf, - 0x39,0xff,0xcf,0xb4,0x41,0xd8,0x40,0x6,0xa8,0x0,0xfd,0x60,0x4,0x4c,0x81,0x5, - 0x30,0xb,0x26,0xc0,0x10,0xe8,0x3,0x41,0xb0,0x3,0x58,0xc1,0xa6,0x83,0x42,0xc5, - 0xa0,0x17,0x8c,0x99,0x6d,0xda,0xb2,0xcb,0x9f,0x22,0x99,0x55,0x4e,0xc9,0x3a,0x98, - 0x26,0x39,0xc7,0x3d,0xe2,0x6b,0xf0,0x88,0xb7,0xce,0x2d,0xbb,0x82,0x4e,0x71,0xfa, - 0x6c,0xa2,0x59,0xb4,0x15,0xac,0x1d,0x6,0x1d,0xc0,0xf,0x2c,0x20,0xa9,0x60,0x46, - 0xdd,0x60,0xd4,0x62,0xd7,0x96,0x79,0x68,0xf9,0xe5,0x2c,0x39,0xfa,0x28,0x5f,0xda, - 0xde,0x95,0x4a,0xfb,0x4c,0x50,0xba,0x17,0xab,0xa5,0x73,0xae,0x4a,0xce,0x7e,0xae, - 0x94,0xd6,0xb7,0x25,0xd2,0x70,0x3f,0x20,0xa5,0x97,0xbc,0x92,0x19,0x72,0x9,0x7e, - 0xdc,0x77,0xec,0x7d,0x0,0xe,0x1,0x3b,0x48,0x18,0x7b,0xc0,0x0,0x98,0xde,0x59, - 0xee,0x88,0x1c,0xb8,0xe1,0x97,0xe6,0x57,0xc5,0xd2,0xbd,0x5c,0x2d,0xe7,0xa5,0x26, - 0x21,0xfc,0x11,0x27,0x47,0xf7,0xe9,0xc2,0x8e,0x6c,0xdb,0x22,0xce,0x78,0x9,0x5a, - 0x40,0x2a,0x50,0x6,0x33,0x1b,0x30,0x69,0xa6,0x6f,0xfe,0xa6,0x74,0x69,0x7a,0x51, - 0x24,0xe1,0x9f,0x21,0xe5,0xe1,0xeb,0x12,0xa9,0x91,0xf6,0xd9,0xa0,0xd4,0xde,0xcc, - 0x95,0xb4,0x80,0x3d,0x82,0xf3,0x3e,0x80,0x46,0xb0,0xe6,0x5d,0xf9,0x66,0xbc,0xc6, - 0x69,0x8a,0xb5,0xbc,0x29,0x91,0x9e,0x24,0xb2,0x5a,0x8f,0xce,0xb9,0x90,0xd4,0xdf, - 0xce,0x13,0x57,0x4e,0x4a,0x4,0x9,0xb0,0xb0,0xca,0x80,0x6,0xe2,0xc1,0x2,0x19, - 0xe5,0x35,0x32,0xb3,0xed,0x88,0xc5,0xe8,0x9a,0xf,0x49,0x59,0x5f,0x96,0xd8,0xdc, - 0x66,0x16,0xd3,0x20,0x88,0xbf,0x27,0xb3,0xeb,0x65,0x81,0xf0,0xcd,0x36,0x7d,0x8d, - 0x9,0x68,0xff,0x1a,0x44,0x21,0x39,0x45,0xd3,0x4c,0x4b,0xd0,0x38,0x6,0xf4,0x2c, - 0xf9,0x76,0x63,0xac,0x46,0x16,0x88,0x6a,0xe3,0x76,0xa8,0xbb,0x93,0x87,0x2c,0x2d, - 0x2,0x8d,0x71,0x60,0xa6,0x60,0x5,0xfb,0x8c,0xa5,0x9f,0x4c,0x35,0x6e,0x96,0xf0, - 0xaf,0x90,0x78,0xa,0x53,0x5,0xb9,0x51,0x34,0x9f,0x82,0xfd,0x6c,0x6a,0xf6,0x99, - 0x6a,0x83,0x11,0x30,0x19,0xb3,0x55,0xa3,0xe0,0x55,0xa,0x8e,0x70,0x82,0xb0,0xa9, - 0x55,0x8b,0x8d,0xe0,0xc4,0xb3,0x42,0xb1,0xd8,0xcd,0x14,0x7c,0x4e,0xc1,0x29,0x8e, - 0x2b,0x4e,0x10,0xd5,0x62,0x23,0x38,0xf3,0xa9,0x5c,0xac,0xe,0x5d,0xf0,0x23,0x5, - 0x17,0x38,0x1b,0x39,0x29,0x54,0x8b,0x8d,0x20,0xbc,0x10,0x12,0xab,0x53,0x17,0x9c, - 0xa7,0xe0,0xac,0xef,0x88,0x47,0xba,0x7e,0x18,0xd7,0xe,0xff,0xc2,0xe9,0x13,0x15, - 0x9c,0xa1,0xe0,0x84,0xb7,0xde,0x2d,0xe7,0xbe,0x54,0x2a,0x17,0x1b,0xc1,0xa9,0xf7, - 0xa5,0x62,0x59,0xbd,0xd2,0x37,0x14,0x1c,0xa2,0xc5,0x70,0xea,0xab,0x16,0x1b,0x41, - 0xe3,0xe3,0xbd,0x28,0x1a,0xbd,0x4a,0x9f,0x50,0xb0,0x8f,0x7e,0x46,0x8b,0x51,0x2d, - 0x36,0x82,0x92,0xb,0xde,0x58,0x5b,0x5c,0xa4,0x60,0x90,0xe6,0x49,0x5b,0xf9,0x1f, - 0x85,0xd3,0x89,0xda,0x70,0x7,0xec,0x14,0xe3,0x4c,0xd,0x50,0x90,0x9f,0x5,0xc3, - 0x34,0x4f,0xfa,0x19,0x2d,0x46,0xb5,0x71,0x2b,0xf4,0xac,0xd4,0xc8,0xfe,0xeb,0x7e, - 0xb1,0xba,0xf4,0xf7,0x7b,0xa,0xf4,0xd1,0x46,0xaf,0xea,0xa0,0x53,0x33,0x4b,0x56, - 0x94,0x6a,0xf3,0x56,0x68,0x7e,0x5d,0x2c,0xe9,0x45,0xfa,0x58,0xe3,0xf7,0x4f,0x2d, - 0x88,0x5b,0x14,0x9d,0xfe,0x21,0xde,0x72,0xa9,0xee,0x56,0xae,0xee,0x67,0xaa,0x3, - 0x36,0xc3,0xe9,0xc9,0x32,0xc9,0x6b,0xcd,0x60,0xb1,0xd0,0xfd,0xaf,0x1,0xba,0x52, - 0x3c,0x98,0xe5,0x61,0x30,0xe6,0x29,0xb0,0x47,0xea,0x31,0xe1,0xe9,0x67,0xaa,0x83, - 0x92,0x81,0x62,0x85,0xe1,0x4c,0xb1,0xa5,0x59,0xe8,0xfa,0x77,0x81,0xf,0xfc,0x65, - 0xc0,0xc,0x1a,0x64,0x1b,0xfe,0x3d,0xe9,0xda,0x9d,0x22,0x15,0x57,0xb2,0x75,0x3f, - 0x53,0x1d,0xb8,0x1e,0x7c,0x33,0x5e,0x23,0x33,0x8b,0x8a,0xdd,0x3,0x5,0x40,0x7f, - 0x3b,0x55,0x38,0x40,0x23,0x44,0x27,0xb0,0x61,0x85,0xe6,0x49,0x3f,0xa3,0xc5,0xa8, - 0x4,0xfe,0x84,0xd5,0xc8,0x2,0xe1,0x9b,0x45,0xaf,0x91,0x99,0x25,0x14,0x8b,0x5, - 0xaf,0x97,0xdf,0x20,0x83,0x74,0x6a,0x9a,0x27,0xfd,0x8c,0x16,0xc3,0xa9,0xcf,0x41, - 0xcc,0xd9,0xc8,0xe2,0xe2,0x4,0x61,0x53,0xb3,0xcf,0x58,0xfa,0x7a,0x35,0xae,0x16, - 0x8,0xdf,0x8c,0xd7,0xb8,0xa1,0x58,0x2c,0x78,0xdf,0xbc,0x62,0x7e,0x16,0x8c,0xe3, - 0x2f,0xbd,0x71,0x69,0x31,0x9c,0xfa,0x9c,0x8b,0x84,0xe3,0x8a,0x13,0x24,0xda,0xd4, - 0xec,0x33,0x96,0x3e,0xab,0x91,0x5,0xb2,0xe6,0xcd,0x92,0x9,0x6e,0xe2,0xaf,0xa4, - 0x53,0xd3,0x3c,0xe9,0x67,0xb4,0x18,0x4e,0x7d,0xe,0x62,0xce,0x46,0x8e,0x2b,0x4e, - 0x10,0x36,0x35,0xd7,0x26,0x10,0x32,0x99,0x7e,0x3,0x5,0x3b,0x43,0x15,0xa,0x17, - 0x25,0xf9,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, - // res/icons/issue.png - 0x0,0x0,0x1,0xb, - 0x89, - 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, - 0x0,0x0,0x1f,0x0,0x0,0x0,0x1f,0x8,0x6,0x0,0x0,0x0,0x1f,0xae,0x16,0x39, - 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xb1,0x8f,0xb,0xfc,0x61,0x5, - 0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xe,0xc0,0x0,0x0,0xe,0xc0, - 0x1,0x6a,0xd6,0x89,0x9,0x0,0x0,0x0,0x18,0x74,0x45,0x58,0x74,0x53,0x6f,0x66, - 0x74,0x77,0x61,0x72,0x65,0x0,0x70,0x61,0x69,0x6e,0x74,0x2e,0x6e,0x65,0x74,0x20, - 0x34,0x2e,0x31,0x2e,0x34,0x13,0x40,0x68,0xc4,0x0,0x0,0x0,0x89,0x49,0x44,0x41, - 0x54,0x58,0x47,0x63,0x18,0x5,0x83,0x16,0xf0,0xe7,0xff,0x17,0x60,0xcf,0xff,0xaf, - 0x40,0x2c,0x6,0xa9,0x87,0x6a,0xa5,0x1c,0x70,0x66,0xff,0x6f,0xe0,0xca,0xf9,0xff, - 0x9f,0x58,0xc,0x52,0xf,0xd5,0x4a,0x39,0x18,0x50,0xcb,0xb9,0xb3,0xff,0x3b,0x80, - 0xc,0x84,0x61,0xa0,0x5,0xfd,0x68,0x16,0xf6,0x23,0xcb,0x83,0xd4,0x43,0xb5,0x52, - 0x1f,0x80,0xe2,0x15,0xd9,0x72,0x10,0x1f,0x2a,0x45,0x7b,0x30,0x6a,0xf9,0xa8,0xe5, - 0xa3,0x96,0xd3,0x5,0x8c,0x5a,0x3e,0x6a,0xf9,0xa8,0xe5,0x74,0x1,0x23,0xc7,0x72, - 0xce,0x9c,0xff,0x1,0xc0,0x16,0xca,0x7c,0x18,0xe6,0xca,0xfe,0xbf,0x1a,0xd9,0x72, - 0x10,0x1f,0x59,0x1e,0xa4,0x1e,0xaa,0x95,0x72,0x0,0x34,0x70,0x84,0x36,0x20,0x47, - 0xc1,0x30,0x2,0xc,0xc,0x0,0x8f,0x58,0x79,0xd,0x18,0xf,0x7f,0xb9,0x0,0x0, - 0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, - // res/icons/yellow.png - 0x0,0x0,0x3,0xd3, - 0x89, - 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, - 0x0,0x0,0x1c,0x0,0x0,0x0,0x1c,0x8,0x6,0x0,0x0,0x0,0x72,0xd,0xdf,0x94, - 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xb1,0x8f,0xb,0xfc,0x61,0x5, - 0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xe,0xbf,0x0,0x0,0xe,0xbf, - 0x1,0x38,0x5,0x53,0x24,0x0,0x0,0x0,0x18,0x74,0x45,0x58,0x74,0x53,0x6f,0x66, - 0x74,0x77,0x61,0x72,0x65,0x0,0x70,0x61,0x69,0x6e,0x74,0x2e,0x6e,0x65,0x74,0x20, - 0x34,0x2e,0x31,0x2e,0x35,0x64,0x47,0x58,0x52,0x0,0x0,0x3,0x51,0x49,0x44,0x41, - 0x54,0x48,0x4b,0xb5,0x96,0x3b,0x48,0x5c,0x51,0x10,0x86,0xf7,0xde,0x7d,0xde,0x55, - 0x21,0x29,0x7d,0xa5,0x30,0x22,0x12,0x88,0xb2,0xda,0x45,0xd,0x51,0x22,0x16,0x56, - 0x31,0xbd,0x60,0x3a,0xb,0x21,0x8,0x8b,0x36,0x29,0x82,0x85,0x85,0x58,0x2a,0x9a, - 0x2a,0x8d,0x21,0x20,0xd8,0x99,0x22,0x1a,0x50,0x14,0x82,0xa8,0x8,0x8a,0x26,0x82, - 0xb6,0x2a,0x8a,0x21,0xb0,0xac,0xeb,0x73,0x27,0xf3,0x5d,0xd6,0x25,0x89,0xc7,0xf5, - 0xb5,0xe,0x7c,0x20,0x72,0xce,0xf9,0x77,0xe6,0xcc,0x99,0xff,0x7a,0xae,0x8,0xbf, - 0xf2,0x50,0xa9,0x54,0x7a,0x94,0x19,0x65,0x43,0x49,0x28,0x7b,0xca,0x8a,0x32,0xa9, - 0x44,0x95,0x88,0xf2,0x40,0xf1,0x29,0x37,0xe,0x84,0x9e,0x28,0xed,0xca,0x9c,0xdf, - 0xef,0x39,0x2d,0x2e,0xb6,0xa4,0xaa,0xca,0x96,0xba,0x3a,0x5b,0x1a,0x1b,0xbd,0x52, - 0x5f,0x6f,0x4b,0x4d,0x8d,0x2d,0x91,0x88,0x2d,0x5,0x5,0x96,0x78,0xbd,0x9e,0x33, - 0x5d,0x3b,0xa5,0xb4,0x2a,0xc5,0x8a,0x57,0xb9,0x56,0x90,0xd1,0x1b,0x65,0x36,0x18, - 0xf4,0x9c,0x72,0x68,0x57,0x97,0x4f,0x46,0x47,0x3,0xb2,0xba,0x1a,0x92,0xdd,0x5d, - 0x47,0x8e,0x8f,0xc3,0x12,0x8b,0x39,0xb2,0xb5,0xe5,0xc8,0xf2,0x72,0x48,0x46,0x46, - 0x2,0xd2,0xd9,0xe9,0x93,0xea,0x6a,0x5b,0xf4,0xc7,0xfd,0xd6,0xbd,0x9f,0x94,0xe7, - 0x4a,0x50,0xc9,0x18,0x8f,0x94,0x5e,0x65,0xbb,0xa2,0xc2,0x4e,0xf6,0xf7,0xfb,0x65, - 0x61,0x21,0x24,0xa7,0xa7,0x61,0x11,0xc9,0xc,0x3f,0x62,0x76,0x36,0xe8,0xa,0xe7, - 0xe7,0x5b,0xc7,0x7a,0xc6,0x77,0xe5,0x95,0x12,0x52,0x8c,0x41,0x66,0xbd,0x96,0xe5, - 0xf9,0xd5,0xdc,0xec,0x95,0xe9,0xe9,0xa0,0x1c,0x1e,0x9a,0xf,0xbf,0x8c,0x64,0x32, - 0x2c,0x7b,0x7b,0x8e,0xc,0xc,0x4,0xa4,0xa4,0xc4,0x4a,0xea,0x79,0x3f,0x94,0x26, - 0xe5,0xc2,0xbd,0x72,0x67,0x94,0x71,0x1b,0xb1,0xa5,0xa5,0xeb,0x65,0x75,0x19,0xb1, - 0x58,0x58,0x86,0x86,0x2,0x52,0x58,0x68,0x25,0x35,0x1,0x1a,0xeb,0xa9,0x62,0x29, - 0xe9,0xa0,0x41,0x66,0x29,0x23,0x99,0xdd,0x45,0xec,0x9c,0x83,0x83,0xb0,0x44,0xa3, - 0x3e,0xc9,0xcd,0x75,0x9b,0x69,0x4c,0x49,0xdf,0x27,0xd9,0xb5,0xd3,0x20,0xdc,0xd9, - 0x4d,0xcb,0x98,0x89,0xfd,0x7d,0x47,0x1b,0xc9,0x12,0xcd,0xf2,0x44,0x35,0x5e,0x2a, - 0x6e,0x96,0xdc,0xdd,0x1c,0xdd,0x48,0x83,0x98,0x36,0xde,0x85,0xe1,0xe1,0x0,0x59, - 0x8a,0x6a,0xcc,0x2b,0x36,0x82,0x95,0xbc,0x33,0x5a,0x3f,0x1b,0xa5,0xfc,0x9f,0xa3, - 0x23,0x47,0xca,0xca,0xdc,0x2c,0x11,0x7d,0x8c,0x60,0xf,0x8f,0x9a,0x77,0x66,0xda, - 0x90,0xd,0x48,0xc6,0xe7,0x73,0x5,0xdf,0x21,0x38,0xc3,0x4,0xe1,0x51,0x9b,0x16, - 0x67,0x83,0x89,0x89,0xa0,0x68,0x8f,0x20,0xf8,0xd,0xc1,0xd,0xc6,0x15,0x13,0xc4, - 0xb4,0x38,0x1b,0x6c,0x6e,0x86,0xc4,0x71,0x5c,0xc1,0x9f,0x8,0x26,0x98,0x8d,0x4c, - 0xa,0xd3,0xe2,0x6c,0x90,0x48,0x38,0x12,0xe,0xbb,0x82,0x7,0x8,0xee,0x35,0x34, - 0x78,0x25,0x1e,0x37,0x2f,0xce,0x6,0x4c,0x9f,0x94,0xe0,0x2e,0x82,0x2b,0xb5,0xb5, - 0xb6,0xec,0xec,0xdc,0x5f,0x49,0xd7,0xd6,0xd2,0x25,0x5d,0x42,0x70,0x12,0x8b,0x61, - 0xea,0x9b,0x16,0x67,0x83,0xf1,0xf1,0x74,0xd3,0x7c,0x41,0x30,0x8a,0x9f,0x61,0x31, - 0xa6,0xc5,0xd9,0xa0,0xa3,0x23,0xfd,0x2c,0xde,0x22,0x18,0xc1,0x3c,0xb1,0x95,0xfb, - 0x68,0x9c,0x78,0xdc,0xc1,0x39,0x10,0x63,0xa6,0x96,0x20,0xc8,0x67,0xc1,0x14,0xe6, - 0x89,0x9f,0x61,0x31,0xa6,0x8d,0xb7,0xe1,0xec,0x2c,0x2c,0x7d,0x7d,0x7e,0xc9,0xc9, - 0x71,0xb3,0xfb,0xaa,0xb8,0xa3,0xd,0xaf,0x6a,0xc5,0xa9,0xc9,0x92,0x8e,0x32,0x6d, - 0xbe,0xd,0x8b,0x8b,0x21,0x29,0x2f,0x77,0xc7,0x1a,0xdf,0x3f,0xcf,0x94,0xb4,0x45, - 0xe1,0xf4,0x9f,0xf5,0x2e,0x4f,0x6,0x7,0x3,0xae,0x9f,0x99,0xe,0xb8,0x9,0xeb, - 0xeb,0x21,0x69,0x69,0xf1,0xd2,0x2c,0xb8,0xff,0x7b,0x5,0x57,0x4a,0x7,0x59,0xbe, - 0x50,0xe6,0x4a,0x4b,0xad,0x24,0x13,0x1e,0x3f,0x33,0x1d,0x74,0x1d,0x10,0x6b,0x6b, - 0xf3,0x49,0x5e,0x9e,0x7,0xd7,0xff,0xa0,0x14,0x28,0xff,0x18,0x30,0x81,0x41,0xbe, - 0xd6,0xf4,0xd7,0x8b,0x8a,0x2c,0xe9,0xee,0xf6,0xb9,0x7e,0x66,0x3a,0xf0,0x32,0xb8, - 0x33,0xca,0x48,0x66,0x29,0xb1,0x8f,0x4a,0xa9,0xe2,0xde,0x9d,0x29,0x1c,0xa5,0x89, - 0xcf,0x2,0xdd,0x70,0x86,0x79,0x92,0x2d,0x16,0x63,0x12,0xf8,0x1b,0xba,0x91,0x6, - 0xe1,0xce,0x52,0x65,0x24,0xb3,0x8c,0x62,0xe7,0x41,0x79,0xf9,0x6,0x19,0xc3,0xa9, - 0x31,0x4f,0xfc,0xc,0x8b,0x61,0xea,0x33,0x88,0x99,0x8d,0x34,0x17,0x13,0x84,0x47, - 0xcd,0x3b,0xa3,0xf5,0xe9,0xc6,0x54,0x83,0x70,0x67,0x94,0xf1,0x4a,0xb1,0xf3,0xa0, - 0xde,0x94,0x98,0xcf,0x82,0x79,0x3d,0xc4,0x7d,0xb8,0x4c,0xb,0x46,0x14,0x73,0x11, - 0xf8,0x9b,0xff,0xa5,0x1e,0x35,0xef,0x8c,0xd6,0xa7,0x1b,0x69,0x90,0xb,0x77,0x76, - 0x9d,0x60,0x13,0xbf,0x12,0xa7,0xc6,0x3c,0xf1,0x33,0x2c,0x86,0xa9,0xcf,0x20,0x66, - 0x36,0x32,0xae,0x98,0x20,0x3c,0x6a,0xd6,0x66,0x10,0xf2,0x78,0xfe,0x0,0xfe,0xb6, - 0xe,0x28,0x8d,0x19,0xd8,0xbc,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42, - 0x60,0x82, - // res/icons/visible.png - 0x0,0x0,0x1,0x9, - 0x89, - 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, - 0x0,0x0,0x1f,0x0,0x0,0x0,0x1f,0x8,0x6,0x0,0x0,0x0,0x1f,0xae,0x16,0x39, - 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xb1,0x8f,0xb,0xfc,0x61,0x5, - 0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xe,0xc1,0x0,0x0,0xe,0xc1, - 0x1,0xb8,0x91,0x6b,0xed,0x0,0x0,0x0,0x18,0x74,0x45,0x58,0x74,0x53,0x6f,0x66, - 0x74,0x77,0x61,0x72,0x65,0x0,0x70,0x61,0x69,0x6e,0x74,0x2e,0x6e,0x65,0x74,0x20, - 0x34,0x2e,0x31,0x2e,0x34,0x13,0x40,0x68,0xc4,0x0,0x0,0x0,0x87,0x49,0x44,0x41, - 0x54,0x58,0x47,0xed,0x8d,0x41,0xa,0xc0,0x20,0xc,0x4,0x7d,0xa0,0xcf,0xeb,0x7f, - 0x6d,0x85,0x8,0x36,0xac,0xad,0xd9,0xda,0x50,0x4a,0x6,0xe6,0x10,0xc1,0x9d,0xf4, - 0x7d,0xb6,0x52,0x4e,0xba,0xa0,0xa3,0xbd,0xaf,0x83,0xa2,0xda,0xd7,0x40,0xb1,0x91, - 0x88,0xd1,0xfb,0x14,0x3a,0xc0,0x48,0x83,0xc6,0xac,0xd2,0xa0,0x31,0xab,0x34,0x68, - 0xcc,0x2a,0xd,0x1a,0xb3,0x4a,0x83,0xc6,0xac,0xd2,0xa0,0x31,0xab,0x34,0x68,0xcc, - 0x2a,0xcd,0x68,0xa0,0x1f,0xbf,0x93,0xe6,0xf8,0x9c,0x73,0x1e,0xf,0xe8,0x10,0x92, - 0xa5,0x86,0x2f,0xe3,0xd,0x14,0xad,0x3e,0x61,0x3a,0xde,0x58,0x15,0xae,0x98,0xe3, - 0x2b,0x89,0xb8,0x9c,0xbe,0x44,0x5c,0x4e,0x5f,0x22,0x2e,0xa7,0x2f,0x11,0x97,0xf3, - 0x4f,0xa4,0xb4,0x3,0x1a,0xb3,0x3c,0xac,0x93,0xe,0x6d,0x12,0x0,0x0,0x0,0x0, - 0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, - // res/icons/params.png - 0x0,0x0,0x1,0x9, - 0x89, - 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, - 0x0,0x0,0x1f,0x0,0x0,0x0,0x1f,0x8,0x6,0x0,0x0,0x0,0x1f,0xae,0x16,0x39, - 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xb1,0x8f,0xb,0xfc,0x61,0x5, - 0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xe,0xc0,0x0,0x0,0xe,0xc0, - 0x1,0x6a,0xd6,0x89,0x9,0x0,0x0,0x0,0x18,0x74,0x45,0x58,0x74,0x53,0x6f,0x66, - 0x74,0x77,0x61,0x72,0x65,0x0,0x70,0x61,0x69,0x6e,0x74,0x2e,0x6e,0x65,0x74,0x20, - 0x34,0x2e,0x31,0x2e,0x35,0x64,0x47,0x58,0x52,0x0,0x0,0x0,0x87,0x49,0x44,0x41, - 0x54,0x58,0x47,0xed,0xd1,0x31,0xe,0xc0,0x20,0xc,0x43,0x51,0xee,0x7f,0x69,0x2a, - 0xeb,0x9b,0x4c,0xac,0x31,0x43,0xf3,0xa4,0xc,0x75,0x87,0x3f,0xb0,0xc6,0x6f,0xed, - 0x7,0x57,0x6e,0x3f,0xbb,0xaf,0xec,0x24,0xf5,0xc8,0xc2,0x73,0x86,0x7a,0x64,0xe1, - 0x39,0x43,0x3d,0xb2,0xf0,0x5c,0x3f,0x5a,0xee,0xf0,0x77,0xf1,0x9c,0xa1,0x1e,0x59, - 0x78,0xce,0x50,0x8f,0x2c,0x3c,0x67,0xa8,0x47,0x16,0x9e,0xe7,0xcd,0x7b,0xa9,0x47, - 0x16,0x9e,0x33,0xd4,0x23,0xb,0xcf,0xf3,0xe6,0xbd,0xd4,0x23,0xb,0xcf,0x19,0xea, - 0x91,0x85,0xe7,0x79,0xf3,0x5e,0xea,0x91,0x85,0xe7,0xc,0xf5,0xc8,0xc2,0x73,0x86, - 0x7a,0x64,0x71,0x86,0xe4,0x95,0xdb,0xcf,0xee,0x7b,0x4c,0x4f,0xf0,0xea,0xae,0x63, - 0xe6,0xf6,0xfa,0x0,0xc5,0xe6,0xa9,0xc7,0xee,0x3c,0xc4,0x7c,0x0,0x0,0x0,0x0, - 0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, - // res/icons/no_params.png - 0x0,0x0,0x1,0x1b, - 0x89, - 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, - 0x0,0x0,0x1f,0x0,0x0,0x0,0x1f,0x8,0x6,0x0,0x0,0x0,0x1f,0xae,0x16,0x39, - 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xb1,0x8f,0xb,0xfc,0x61,0x5, - 0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xe,0xbf,0x0,0x0,0xe,0xbf, - 0x1,0x38,0x5,0x53,0x24,0x0,0x0,0x0,0x18,0x74,0x45,0x58,0x74,0x53,0x6f,0x66, - 0x74,0x77,0x61,0x72,0x65,0x0,0x70,0x61,0x69,0x6e,0x74,0x2e,0x6e,0x65,0x74,0x20, - 0x34,0x2e,0x31,0x2e,0x35,0x64,0x47,0x58,0x52,0x0,0x0,0x0,0x99,0x49,0x44,0x41, - 0x54,0x58,0x47,0xed,0xd1,0x31,0xe,0x83,0x40,0x14,0xc4,0x50,0xee,0x7f,0x69,0x22, - 0xcb,0x13,0x2a,0x5a,0x4c,0x91,0x3c,0xe9,0x37,0xb3,0x85,0x8b,0x3d,0xfe,0x7e,0xd6, - 0xf9,0xc2,0x5d,0xee,0x1e,0x9f,0xbe,0xcb,0x59,0xa2,0x67,0x56,0x9b,0x1b,0xf4,0xcc, - 0x6a,0x73,0x83,0x9e,0x59,0x6d,0x6e,0xd0,0x33,0xab,0xcd,0xd,0x7a,0x66,0xb5,0xb9, - 0x41,0xcf,0xac,0x36,0x37,0xe8,0x99,0xd5,0xe6,0x6,0x3d,0xb3,0xda,0xdc,0xa0,0x67, - 0x56,0x9b,0x1b,0xf4,0xcc,0x6a,0x73,0x83,0x9e,0x59,0x6d,0x6e,0xd0,0x33,0xab,0xcd, - 0xd,0x7a,0x66,0xb5,0xb9,0x41,0xcf,0xac,0x36,0x37,0xe8,0x99,0xd5,0xe6,0x6,0x3d, - 0xb3,0xda,0xdc,0xa0,0x67,0x56,0x9b,0x1b,0xf4,0xcc,0x6a,0x73,0x83,0x9e,0x59,0x6d, - 0x6e,0xd0,0x33,0xab,0xef,0x50,0xde,0xe5,0xee,0xf1,0xe9,0x7b,0x19,0x5f,0xf0,0xd6, - 0xdd,0x8e,0xcd,0x9d,0xc7,0x7,0x7e,0x7c,0xbc,0xc2,0x4d,0xba,0x5f,0x28,0x0,0x0, - 0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, - // res/icons/red.png - 0x0,0x0,0x3,0xda, - 0x89, - 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, - 0x0,0x0,0x1c,0x0,0x0,0x0,0x1c,0x8,0x6,0x0,0x0,0x0,0x72,0xd,0xdf,0x94, - 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xb1,0x8f,0xb,0xfc,0x61,0x5, - 0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xe,0xbf,0x0,0x0,0xe,0xbf, - 0x1,0x38,0x5,0x53,0x24,0x0,0x0,0x0,0x18,0x74,0x45,0x58,0x74,0x53,0x6f,0x66, - 0x74,0x77,0x61,0x72,0x65,0x0,0x70,0x61,0x69,0x6e,0x74,0x2e,0x6e,0x65,0x74,0x20, - 0x34,0x2e,0x31,0x2e,0x35,0x64,0x47,0x58,0x52,0x0,0x0,0x3,0x58,0x49,0x44,0x41, - 0x54,0x48,0x4b,0xb5,0x96,0x4b,0x48,0x54,0x61,0x18,0x86,0x67,0xf4,0xcc,0x38,0x17, - 0xb,0x6f,0x99,0x5a,0xe3,0x65,0xc6,0xd1,0xf1,0x96,0x8,0x5d,0xc0,0x40,0x82,0x82, - 0x68,0x19,0x2d,0xda,0xb9,0x70,0x11,0x28,0x2d,0xda,0xb8,0xab,0x20,0x4,0xad,0x7d, - 0x2b,0x57,0xd1,0x22,0xdc,0x24,0xad,0x8a,0xc2,0x50,0x52,0xa,0x11,0x2a,0x9a,0xa0, - 0xb,0x5a,0xd1,0x5,0xa1,0x20,0x5a,0x25,0x64,0xf9,0xf5,0x3e,0xe3,0x68,0x52,0xa7, - 0xd1,0xd1,0xf1,0x87,0x67,0x31,0xc3,0x7f,0xfe,0xf7,0x7c,0x97,0xff,0x7b,0x8f,0x67, - 0x9d,0xe5,0x13,0xc5,0xa2,0x5d,0xc,0x88,0x49,0x31,0x2b,0x16,0xc4,0x17,0x91,0x14, - 0x63,0xa2,0x5f,0x74,0x88,0x22,0xe1,0x88,0xac,0x17,0x42,0xcd,0xa2,0x57,0x4c,0x3b, - 0x5e,0xef,0xcf,0x2a,0x9f,0xcf,0xda,0x2,0x41,0x3b,0x14,0xa,0x59,0x57,0xb8,0xd0, - 0x3a,0x43,0x61,0xdb,0x1f,0xc,0x59,0x4b,0x20,0x60,0x15,0x8e,0x63,0xf9,0x1e,0xef, - 0x2f,0xed,0x9d,0x10,0xdd,0x22,0x22,0xf2,0xc5,0x86,0x16,0x11,0xf5,0x88,0x29,0xbf, - 0x84,0xe,0xe8,0xd0,0xbe,0x92,0x32,0x1b,0xde,0x13,0xb1,0xf1,0x68,0xdc,0x9e,0xc5, - 0x13,0xf6,0x2e,0xd1,0x62,0xaf,0x1b,0x9b,0xed,0x71,0xbc,0xd1,0xc6,0xea,0xea,0xed, - 0x6a,0xd5,0x5e,0x3b,0x53,0x52,0x6a,0xfb,0xf4,0x42,0x7a,0xb9,0x6f,0x7a,0xf6,0x86, - 0xe8,0x12,0x5,0x22,0xe3,0xaa,0x16,0x43,0x62,0xbe,0xa9,0x20,0xb0,0x74,0xb1,0xbc, - 0xc2,0xee,0xd4,0xc5,0xec,0xbd,0x4,0x3e,0x35,0xb5,0x66,0x84,0x97,0xb8,0x55,0x13, - 0x4d,0x9,0x97,0x3b,0xce,0xf,0x9d,0xf1,0x48,0x9c,0x14,0x1,0xe1,0xba,0x88,0x6c, - 0xc8,0xeb,0xf1,0x7c,0x3d,0x5a,0x58,0x68,0x37,0x6b,0xea,0xec,0xcd,0x6,0x84,0xd6, - 0xf2,0x51,0x24,0x1b,0x12,0x36,0x58,0x51,0x69,0x35,0x7e,0xff,0x92,0xce,0x7b,0x21, - 0x8e,0x8b,0x7f,0xea,0x4a,0xcd,0x48,0xe3,0x3c,0x62,0x77,0x89,0xea,0xaf,0xc3,0xb2, - 0x81,0x74,0x5f,0xae,0xa8,0x52,0x6d,0x7d,0x88,0xd2,0x58,0x6d,0x42,0xb1,0xfc,0x59, - 0x34,0xc8,0x14,0x69,0x24,0xb2,0xad,0x88,0xad,0x30,0x97,0x68,0xb6,0xde,0xd2,0x32, - 0xb,0xe7,0xe5,0xd1,0x4c,0xa3,0x62,0xb5,0x9e,0x44,0xd7,0x4b,0x83,0x50,0xb3,0x6c, - 0xd3,0x98,0x89,0xe7,0xd,0x4d,0xea,0xec,0x80,0x29,0xb4,0x45,0x69,0x1c,0x13,0xa9, - 0x28,0xa9,0xdd,0x34,0xdd,0x48,0x83,0xb8,0x3d,0xb8,0x15,0xae,0x28,0xb5,0x8a,0xd2, - 0xa4,0x31,0x23,0xf2,0x10,0x6c,0xe7,0x9e,0xd1,0xfa,0x1b,0xe9,0xc6,0x6c,0x79,0xab, - 0x7a,0x46,0x7d,0x5,0x44,0x89,0x68,0xc,0xc1,0x1,0x2e,0x35,0xf7,0xcc,0xed,0x81, - 0x5c,0xd0,0xa7,0x5a,0x2a,0x28,0x4,0x2f,0x20,0x38,0xc9,0x4,0xe1,0x52,0xbb,0x6d, - 0xce,0x5,0x23,0xd5,0xb5,0x56,0xb0,0x2c,0x78,0x1f,0xc1,0x59,0xc6,0x15,0x13,0xc4, - 0x6d,0x73,0x2e,0x78,0x18,0x6b,0xb0,0x80,0x37,0x55,0xc7,0x97,0x8,0x2e,0x30,0x1b, - 0x99,0x14,0x6e,0x9b,0x73,0xc1,0x9c,0xea,0x18,0x5c,0x6e,0x9c,0xef,0x8,0x7e,0x39, - 0x1c,0xe,0xdb,0xac,0xfe,0x74,0xdb,0x9c,0xb,0x92,0xca,0x5e,0x5a,0xf0,0x33,0x82, - 0xc9,0x83,0xba,0x12,0x4f,0xb7,0x31,0xa5,0xe3,0xd1,0x7a,0xa5,0x34,0x55,0xc3,0x27, - 0x8,0x8e,0xb5,0xea,0x72,0x32,0xf5,0xdd,0x36,0xe7,0x82,0xeb,0x91,0x1a,0xd3,0x60, - 0x41,0xf0,0x36,0x82,0xfd,0xf8,0x19,0x16,0xe3,0xb6,0x39,0x17,0xf4,0x14,0x97,0x58, - 0xfe,0xb2,0xe0,0x39,0x4,0x3b,0x30,0x4f,0x6c,0x65,0x3b,0x1a,0x87,0xde,0x88,0xf8, - 0xfc,0x88,0x31,0x53,0xa3,0x8,0xf2,0x59,0x30,0x81,0x79,0xe2,0x67,0x58,0x8c,0xdb, - 0x83,0x9b,0xe1,0x83,0x38,0xaf,0xf9,0x1c,0x5a,0x6e,0x98,0x7b,0x22,0x35,0xda,0xf0, - 0xaa,0x6e,0x9c,0x9a,0x28,0x93,0x1a,0xb8,0x6e,0xf,0x6f,0x6,0x66,0x73,0xcc,0xef, - 0x67,0xac,0xf1,0xfd,0xd3,0x29,0x56,0x2d,0xa,0xa7,0x1f,0xd9,0xed,0x38,0x8b,0x83, - 0x1a,0xb6,0xf8,0x99,0xdb,0x1,0xd9,0xf0,0x20,0x16,0xb7,0x13,0x3b,0x76,0xd2,0x2c, - 0xb8,0xff,0x25,0x81,0x2b,0xad,0x2e,0xa2,0x3c,0x22,0xa6,0x6b,0xe5,0xd4,0x4c,0x78, - 0xfc,0xcc,0xed,0xa0,0x8d,0x80,0xd8,0xe9,0xa2,0x22,0x5c,0x2,0x3,0x1e,0x16,0x55, - 0x62,0x35,0xba,0x95,0x85,0x41,0x9e,0xd2,0xbf,0xaf,0x2a,0x1d,0x9f,0x9d,0x2d,0xdd, - 0x95,0xf2,0x33,0xb7,0x3,0xff,0x7,0x35,0x23,0x8d,0x44,0x96,0x16,0xbb,0x26,0xea, - 0x45,0xaa,0x76,0x6e,0x2b,0x28,0xf8,0x6,0x49,0x16,0xca,0xa9,0x31,0x4f,0xa2,0xc5, - 0x62,0xdc,0x4,0xd6,0x42,0x37,0xd2,0x20,0xd4,0x2c,0x9d,0x46,0x22,0xcb,0x28,0xb6, - 0xb2,0x48,0x2f,0xdf,0x20,0xa3,0x8a,0x76,0x11,0xf3,0xc4,0xcf,0xb0,0x18,0xa6,0x3e, - 0x83,0x98,0xd9,0xc8,0xb8,0x62,0x82,0x70,0xa9,0xb9,0x67,0xb4,0x3e,0xdd,0x98,0x6e, - 0x10,0x6a,0x46,0x1a,0xd7,0x15,0x5b,0x59,0xe4,0x9b,0x14,0xf3,0x59,0x30,0xa3,0x1f, - 0x29,0x3f,0xc3,0x62,0x98,0xfa,0xcc,0x45,0x60,0x5c,0x31,0x41,0xd2,0x97,0x9a,0x7b, - 0x46,0xeb,0xd3,0x8d,0x34,0x8,0x67,0x64,0xbd,0x78,0x88,0xb7,0xc4,0xa9,0x31,0x4f, - 0xfc,0xc,0x8b,0x61,0xea,0x33,0x88,0x99,0x8d,0x8c,0x2b,0x26,0x8,0x97,0x9a,0xbd, - 0x19,0x84,0x3c,0x9e,0xdf,0xfd,0xb2,0x98,0x79,0x58,0xd9,0x56,0xc7,0x0,0x0,0x0, - 0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, - // icons/marked.png - 0x0,0x0,0x1,0x10, - 0x89, - 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, - 0x0,0x0,0x1f,0x0,0x0,0x0,0x1f,0x8,0x6,0x0,0x0,0x0,0x1f,0xae,0x16,0x39, - 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xb1,0x8f,0xb,0xfc,0x61,0x5, - 0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xe,0xc1,0x0,0x0,0xe,0xc1, - 0x1,0xb8,0x91,0x6b,0xed,0x0,0x0,0x0,0x18,0x74,0x45,0x58,0x74,0x53,0x6f,0x66, - 0x74,0x77,0x61,0x72,0x65,0x0,0x70,0x61,0x69,0x6e,0x74,0x2e,0x6e,0x65,0x74,0x20, - 0x34,0x2e,0x31,0x2e,0x34,0x13,0x40,0x68,0xc4,0x0,0x0,0x0,0x8e,0x49,0x44,0x41, - 0x54,0x58,0x47,0xed,0x93,0x31,0xe,0x80,0x30,0xc,0xc4,0xfa,0xff,0xe7,0xf2,0x81, - 0xa2,0x93,0x2f,0x99,0x3a,0x92,0x64,0xa0,0x96,0x4e,0xa2,0x66,0xf0,0x50,0x58,0x97, - 0xdf,0xb2,0x7,0x96,0x9c,0x5e,0x56,0x2f,0xd9,0xc1,0xb3,0x57,0xd9,0x2,0xf5,0xc8, - 0x82,0xf5,0x9f,0xe3,0x7a,0xae,0x5a,0xe0,0x73,0x62,0x7d,0xef,0xbc,0x66,0x81,0x7a, - 0x64,0xc1,0x7a,0xf8,0xce,0x3b,0x50,0x8f,0x2c,0x58,0xf7,0xa0,0x1e,0x59,0xb0,0xee, - 0x41,0x3d,0xb2,0x60,0x3d,0x7c,0xe7,0xa7,0xaf,0xf4,0xab,0x5,0xea,0x91,0x5,0xeb, - 0xfb,0x9f,0xd7,0x2c,0xf0,0x39,0xb1,0xee,0x41,0x3d,0xb2,0x60,0xdd,0x83,0x7a,0x64, - 0xc1,0xba,0x7,0xf5,0xc8,0x82,0x75,0xf,0xea,0x91,0x85,0x10,0x9d,0x4b,0x4e,0x2f, - 0xab,0x37,0x8c,0xae,0x60,0x6a,0x47,0xd9,0xb3,0xbd,0x5e,0x6b,0xee,0xd1,0x4,0xc4, - 0x9e,0xe9,0xa0,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, - -}; - -static const unsigned char qt_resource_name[] = { - // icons - 0x0,0x5, - 0x0,0x6f,0xa6,0x53, - 0x0,0x69, - 0x0,0x63,0x0,0x6f,0x0,0x6e,0x0,0x73, - // marked_visible.png - 0x0,0x12, - 0x9,0x20,0x2,0x47, - 0x0,0x6d, - 0x0,0x61,0x0,0x72,0x0,0x6b,0x0,0x65,0x0,0x64,0x0,0x5f,0x0,0x76,0x0,0x69,0x0,0x73,0x0,0x69,0x0,0x62,0x0,0x6c,0x0,0x65,0x0,0x2e,0x0,0x70,0x0,0x6e, - 0x0,0x67, - // green.png - 0x0,0x9, - 0xb,0xc1,0x8a,0x47, - 0x0,0x67, - 0x0,0x72,0x0,0x65,0x0,0x65,0x0,0x6e,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, - // issue.png - 0x0,0x9, - 0xa,0xb8,0xb6,0x7, - 0x0,0x69, - 0x0,0x73,0x0,0x73,0x0,0x75,0x0,0x65,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, - // yellow.png - 0x0,0xa, - 0x3,0x69,0xaf,0x27, - 0x0,0x79, - 0x0,0x65,0x0,0x6c,0x0,0x6c,0x0,0x6f,0x0,0x77,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, - // visible.png - 0x0,0xb, - 0x9,0xde,0x44,0xa7, - 0x0,0x76, - 0x0,0x69,0x0,0x73,0x0,0x69,0x0,0x62,0x0,0x6c,0x0,0x65,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, - // params.png - 0x0,0xa, - 0x8,0x4c,0x86,0x47, - 0x0,0x70, - 0x0,0x61,0x0,0x72,0x0,0x61,0x0,0x6d,0x0,0x73,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, - // no_params.png - 0x0,0xd, - 0xe,0xea,0x87,0x87, - 0x0,0x6e, - 0x0,0x6f,0x0,0x5f,0x0,0x70,0x0,0x61,0x0,0x72,0x0,0x61,0x0,0x6d,0x0,0x73,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, - // red.png - 0x0,0x7, - 0x8,0xb7,0x57,0xa7, - 0x0,0x72, - 0x0,0x65,0x0,0x64,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, - // marked.png - 0x0,0xa, - 0x1,0xb9,0x26,0x67, - 0x0,0x6d, - 0x0,0x61,0x0,0x72,0x0,0x6b,0x0,0x65,0x0,0x64,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, - -}; - -static const unsigned char qt_resource_struct[] = { - // : - 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x1, -0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - // :/icons - 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x9,0x0,0x0,0x0,0x2, -0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - // :/icons/marked.png - 0x0,0x0,0x0,0xee,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x11,0x7d, -0x0,0x0,0x1,0x68,0x27,0x5f,0xe2,0x4e, - // :/icons/yellow.png - 0x0,0x0,0x0,0x6a,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x6,0x8f, -0x0,0x0,0x1,0x68,0x7a,0x1b,0xdf,0xe5, - // :/icons/params.png - 0x0,0x0,0x0,0xa0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xb,0x73, -0x0,0x0,0x1,0x68,0x27,0x5f,0xe2,0x3e, - // :/icons/red.png - 0x0,0x0,0x0,0xda,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xd,0x9f, -0x0,0x0,0x1,0x68,0x7a,0x1b,0x97,0x71, - // :/icons/marked_visible.png - 0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0, -0x0,0x0,0x1,0x68,0x27,0x5f,0xe6,0x36, - // :/icons/visible.png - 0x0,0x0,0x0,0x84,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xa,0x66, -0x0,0x0,0x1,0x68,0x27,0x5f,0xe2,0x4e, - // :/icons/issue.png - 0x0,0x0,0x0,0x52,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x5,0x80, -0x0,0x0,0x1,0x68,0x27,0x5f,0xe2,0x4e, - // :/icons/green.png - 0x0,0x0,0x0,0x3a,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x1,0x7d, -0x0,0x0,0x1,0x68,0x7a,0x18,0x53,0x80, - // :/icons/no_params.png - 0x0,0x0,0x0,0xba,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xc,0x80, -0x0,0x0,0x1,0x68,0x27,0x5f,0xe2,0x3e, - -}; - -#ifdef QT_NAMESPACE -# define QT_RCC_PREPEND_NAMESPACE(name) ::QT_NAMESPACE::name -# define QT_RCC_MANGLE_NAMESPACE0(x) x -# define QT_RCC_MANGLE_NAMESPACE1(a, b) a##_##b -# define QT_RCC_MANGLE_NAMESPACE2(a, b) QT_RCC_MANGLE_NAMESPACE1(a,b) -# define QT_RCC_MANGLE_NAMESPACE(name) QT_RCC_MANGLE_NAMESPACE2( \ - QT_RCC_MANGLE_NAMESPACE0(name), QT_RCC_MANGLE_NAMESPACE0(QT_NAMESPACE)) -#else -# define QT_RCC_PREPEND_NAMESPACE(name) name -# define QT_RCC_MANGLE_NAMESPACE(name) name -#endif - -#ifdef QT_NAMESPACE -namespace QT_NAMESPACE { -#endif - -bool qRegisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *); - -bool qUnregisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *); - -#ifdef QT_NAMESPACE -} -#endif - -int QT_RCC_MANGLE_NAMESPACE(qInitResources)(); -int QT_RCC_MANGLE_NAMESPACE(qInitResources)() -{ - QT_RCC_PREPEND_NAMESPACE(qRegisterResourceData) - (0x2, qt_resource_struct, qt_resource_name, qt_resource_data); - return 1; -} - -int QT_RCC_MANGLE_NAMESPACE(qCleanupResources)(); -int QT_RCC_MANGLE_NAMESPACE(qCleanupResources)() -{ - QT_RCC_PREPEND_NAMESPACE(qUnregisterResourceData) - (0x2, qt_resource_struct, qt_resource_name, qt_resource_data); - return 1; -} - -namespace { - struct initializer { - initializer() { QT_RCC_MANGLE_NAMESPACE(qInitResources)(); } - ~initializer() { QT_RCC_MANGLE_NAMESPACE(qCleanupResources)(); } - } dummy; -} diff --git a/src/report_modules/report_module_gui/src/qrc/poc__report_module_gui__qrc.cpp b/src/report_modules/report_module_gui/src/qrc/poc__report_module_gui__qrc.cpp new file mode 100644 index 00000000..c6538c08 --- /dev/null +++ b/src/report_modules/report_module_gui/src/qrc/poc__report_module_gui__qrc.cpp @@ -0,0 +1,5364 @@ +/**************************************************************************** +** Resource object code +** +** Created by: The Resource Compiler for Qt version 5.9.0 +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +static const unsigned char qt_resource_data[] = { + // res/icons/marked_visible.png + 0x0, + 0x0, + 0x1, + 0x79, + 0x89, + 0x50, + 0x4e, + 0x47, + 0xd, + 0xa, + 0x1a, + 0xa, + 0x0, + 0x0, + 0x0, + 0xd, + 0x49, + 0x48, + 0x44, + 0x52, + 0x0, + 0x0, + 0x0, + 0x1f, + 0x0, + 0x0, + 0x0, + 0x1f, + 0x8, + 0x6, + 0x0, + 0x0, + 0x0, + 0x1f, + 0xae, + 0x16, + 0x39, + 0x0, + 0x0, + 0x0, + 0x4, + 0x67, + 0x41, + 0x4d, + 0x41, + 0x0, + 0x0, + 0xb1, + 0x8f, + 0xb, + 0xfc, + 0x61, + 0x5, + 0x0, + 0x0, + 0x0, + 0x9, + 0x70, + 0x48, + 0x59, + 0x73, + 0x0, + 0x0, + 0xe, + 0xc1, + 0x0, + 0x0, + 0xe, + 0xc1, + 0x1, + 0xb8, + 0x91, + 0x6b, + 0xed, + 0x0, + 0x0, + 0x0, + 0x18, + 0x74, + 0x45, + 0x58, + 0x74, + 0x53, + 0x6f, + 0x66, + 0x74, + 0x77, + 0x61, + 0x72, + 0x65, + 0x0, + 0x70, + 0x61, + 0x69, + 0x6e, + 0x74, + 0x2e, + 0x6e, + 0x65, + 0x74, + 0x20, + 0x34, + 0x2e, + 0x31, + 0x2e, + 0x34, + 0x13, + 0x40, + 0x68, + 0xc4, + 0x0, + 0x0, + 0x0, + 0xf7, + 0x49, + 0x44, + 0x41, + 0x54, + 0x58, + 0x47, + 0xed, + 0x92, + 0x1, + 0xa, + 0x83, + 0x40, + 0xc, + 0x4, + 0x7d, + 0xa0, + 0xcf, + 0xeb, + 0x4b, + 0xfb, + 0x81, + 0x2b, + 0xdb, + 0xcd, + 0x86, + 0xc4, + 0x8b, + 0x45, + 0xeb, + 0x29, + 0x5, + 0x3b, + 0xb0, + 0x60, + 0xf6, + 0xbc, + 0xc, + 0xb4, + 0x4e, + 0xbf, + 0xcf, + 0xa3, + 0xb5, + 0x94, + 0x4b, + 0x58, + 0x4a, + 0x63, + 0x4e, + 0xa7, + 0x92, + 0x2e, + 0x33, + 0x0, + 0x2c, + 0xe9, + 0x53, + 0xc9, + 0xd6, + 0xb2, + 0x76, + 0xbf, + 0xea, + 0x19, + 0xa7, + 0x3a, + 0xec, + 0x5, + 0xdf, + 0xa4, + 0xda, + 0xcb, + 0x38, + 0x4d, + 0x3c, + 0xdb, + 0xe4, + 0x29, + 0x97, + 0xed, + 0x4c, + 0xdc, + 0x27, + 0xe0, + 0xa3, + 0x96, + 0x58, + 0x7d, + 0x67, + 0x39, + 0x9e, + 0x3d, + 0xc5, + 0xb2, + 0xdd, + 0x9, + 0xfb, + 0x84, + 0xcd, + 0x8e, + 0xd5, + 0x77, + 0xfe, + 0xd9, + 0xe3, + 0xcb, + 0xd5, + 0xb2, + 0xbd, + 0x89, + 0xfb, + 0x4, + 0x7c, + 0xd4, + 0x12, + 0xab, + 0xfd, + 0x80, + 0xd1, + 0x92, + 0xd8, + 0xc5, + 0x7e, + 0x4b, + 0xc2, + 0x3d, + 0x61, + 0xb3, + 0x63, + 0x75, + 0x6, + 0x97, + 0xe7, + 0x79, + 0xb6, + 0xa9, + 0xa7, + 0x13, + 0x15, + 0xa9, + 0x80, + 0x8f, + 0x5a, + 0x62, + 0x75, + 0x6, + 0xe2, + 0x4f, + 0x72, + 0x51, + 0x49, + 0x91, + 0x35, + 0xe0, + 0xa3, + 0x96, + 0x58, + 0x9d, + 0xd9, + 0x2a, + 0x17, + 0x5b, + 0xc4, + 0x0, + 0x3e, + 0x6a, + 0x89, + 0xd5, + 0x7e, + 0xf0, + 0x8e, + 0xe4, + 0xb1, + 0x3b, + 0x12, + 0x61, + 0xb3, + 0x63, + 0x75, + 0xfe, + 0x3a, + 0x25, + 0x8f, + 0xdd, + 0x91, + 0x8, + 0xf8, + 0xa8, + 0x25, + 0x56, + 0xdf, + 0x59, + 0x8e, + 0x67, + 0x45, + 0xf2, + 0xd8, + 0x1d, + 0x89, + 0xb0, + 0xd9, + 0xb1, + 0x3a, + 0x23, + 0xf9, + 0x68, + 0xe0, + 0xa3, + 0x96, + 0x58, + 0x9d, + 0xf9, + 0xcb, + 0x47, + 0x3, + 0x1f, + 0xb5, + 0x44, + 0x45, + 0x8a, + 0xe4, + 0xd5, + 0xd9, + 0x80, + 0x38, + 0xd5, + 0xe1, + 0x65, + 0xf2, + 0x92, + 0x20, + 0x3f, + 0x7, + 0xfc, + 0x5, + 0x6b, + 0x91, + 0x7c, + 0xd9, + 0x8f, + 0x4a, + 0x59, + 0x5e, + 0x93, + 0x36, + 0xbd, + 0x0, + 0xd4, + 0x9e, + 0x8, + 0x29, + 0x47, + 0xd, + 0xfa, + 0x49, + 0x0, + 0x0, + 0x0, + 0x0, + 0x49, + 0x45, + 0x4e, + 0x44, + 0xae, + 0x42, + 0x60, + 0x82, + // res/icons/green.png + 0x0, + 0x0, + 0x3, + 0xff, + 0x89, + 0x50, + 0x4e, + 0x47, + 0xd, + 0xa, + 0x1a, + 0xa, + 0x0, + 0x0, + 0x0, + 0xd, + 0x49, + 0x48, + 0x44, + 0x52, + 0x0, + 0x0, + 0x0, + 0x1c, + 0x0, + 0x0, + 0x0, + 0x1c, + 0x8, + 0x6, + 0x0, + 0x0, + 0x0, + 0x72, + 0xd, + 0xdf, + 0x94, + 0x0, + 0x0, + 0x0, + 0x4, + 0x67, + 0x41, + 0x4d, + 0x41, + 0x0, + 0x0, + 0xb1, + 0x8f, + 0xb, + 0xfc, + 0x61, + 0x5, + 0x0, + 0x0, + 0x0, + 0x9, + 0x70, + 0x48, + 0x59, + 0x73, + 0x0, + 0x0, + 0xe, + 0xbf, + 0x0, + 0x0, + 0xe, + 0xbf, + 0x1, + 0x38, + 0x5, + 0x53, + 0x24, + 0x0, + 0x0, + 0x0, + 0x18, + 0x74, + 0x45, + 0x58, + 0x74, + 0x53, + 0x6f, + 0x66, + 0x74, + 0x77, + 0x61, + 0x72, + 0x65, + 0x0, + 0x70, + 0x61, + 0x69, + 0x6e, + 0x74, + 0x2e, + 0x6e, + 0x65, + 0x74, + 0x20, + 0x34, + 0x2e, + 0x31, + 0x2e, + 0x35, + 0x64, + 0x47, + 0x58, + 0x52, + 0x0, + 0x0, + 0x3, + 0x7d, + 0x49, + 0x44, + 0x41, + 0x54, + 0x48, + 0x4b, + 0xb5, + 0x96, + 0x4b, + 0x48, + 0x94, + 0x51, + 0x14, + 0xc7, + 0xe7, + 0x9b, + 0x87, + 0xe3, + 0x3c, + 0x1c, + 0xb3, + 0x84, + 0xd1, + 0xb1, + 0x49, + 0x19, + 0x4d, + 0xcc, + 0xf7, + 0x38, + 0x5a, + 0xa0, + 0x16, + 0xd9, + 0x3, + 0x9, + 0x5b, + 0xf8, + 0x28, + 0x82, + 0x12, + 0x75, + 0xb4, + 0x8d, + 0x8b, + 0x20, + 0x2, + 0xa9, + 0x4d, + 0x8b, + 0x70, + 0xe1, + 0x22, + 0x5a, + 0x16, + 0xd5, + 0xaa, + 0x4d, + 0x11, + 0x4, + 0xee, + 0x6a, + 0x51, + 0x6, + 0x86, + 0x42, + 0x88, + 0x45, + 0x90, + 0xf4, + 0x10, + 0x6c, + 0x9b, + 0xa1, + 0x14, + 0x81, + 0xa4, + 0xe5, + 0x63, + 0x4e, + 0xff, + 0xff, + 0xe7, + 0xcc, + 0x50, + 0x79, + 0x1d, + 0x47, + 0xfd, + 0x3a, + 0xf0, + 0x5b, + 0x28, + 0xf7, + 0xde, + 0xff, + 0x9c, + 0x7b, + 0xcf, + 0x39, + 0xff, + 0xcf, + 0xb4, + 0x41, + 0xd8, + 0x40, + 0x6, + 0xa8, + 0x0, + 0xfd, + 0x60, + 0x4, + 0x4c, + 0x81, + 0x5, + 0x30, + 0xb, + 0x26, + 0xc0, + 0x10, + 0xe8, + 0x3, + 0x41, + 0xb0, + 0x3, + 0x58, + 0xc1, + 0xa6, + 0x83, + 0x42, + 0xc5, + 0xa0, + 0x17, + 0x8c, + 0x99, + 0x6d, + 0xda, + 0xb2, + 0xcb, + 0x9f, + 0x22, + 0x99, + 0x55, + 0x4e, + 0xc9, + 0x3a, + 0x98, + 0x26, + 0x39, + 0xc7, + 0x3d, + 0xe2, + 0x6b, + 0xf0, + 0x88, + 0xb7, + 0xce, + 0x2d, + 0xbb, + 0x82, + 0x4e, + 0x71, + 0xfa, + 0x6c, + 0xa2, + 0x59, + 0xb4, + 0x15, + 0xac, + 0x1d, + 0x6, + 0x1d, + 0xc0, + 0xf, + 0x2c, + 0x20, + 0xa9, + 0x60, + 0x46, + 0xdd, + 0x60, + 0xd4, + 0x62, + 0xd7, + 0x96, + 0x79, + 0x68, + 0xf9, + 0xe5, + 0x2c, + 0x39, + 0xfa, + 0x28, + 0x5f, + 0xda, + 0xde, + 0x95, + 0x4a, + 0xfb, + 0x4c, + 0x50, + 0xba, + 0x17, + 0xab, + 0xa5, + 0x73, + 0xae, + 0x4a, + 0xce, + 0x7e, + 0xae, + 0x94, + 0xd6, + 0xb7, + 0x25, + 0xd2, + 0x70, + 0x3f, + 0x20, + 0xa5, + 0x97, + 0xbc, + 0x92, + 0x19, + 0x72, + 0x9, + 0x7e, + 0xdc, + 0x77, + 0xec, + 0x7d, + 0x0, + 0xe, + 0x1, + 0x3b, + 0x48, + 0x18, + 0x7b, + 0xc0, + 0x0, + 0x98, + 0xde, + 0x59, + 0xee, + 0x88, + 0x1c, + 0xb8, + 0xe1, + 0x97, + 0xe6, + 0x57, + 0xc5, + 0xd2, + 0xbd, + 0x5c, + 0x2d, + 0xe7, + 0xa5, + 0x26, + 0x21, + 0xfc, + 0x11, + 0x27, + 0x47, + 0xf7, + 0xe9, + 0xc2, + 0x8e, + 0x6c, + 0xdb, + 0x22, + 0xce, + 0x78, + 0x9, + 0x5a, + 0x40, + 0x2a, + 0x50, + 0x6, + 0x33, + 0x1b, + 0x30, + 0x69, + 0xa6, + 0x6f, + 0xfe, + 0xa6, + 0x74, + 0x69, + 0x7a, + 0x51, + 0x24, + 0xe1, + 0x9f, + 0x21, + 0xe5, + 0xe1, + 0xeb, + 0x12, + 0xa9, + 0x91, + 0xf6, + 0xd9, + 0xa0, + 0xd4, + 0xde, + 0xcc, + 0x95, + 0xb4, + 0x80, + 0x3d, + 0x82, + 0xf3, + 0x3e, + 0x80, + 0x46, + 0xb0, + 0xe6, + 0x5d, + 0xf9, + 0x66, + 0xbc, + 0xc6, + 0x69, + 0x8a, + 0xb5, + 0xbc, + 0x29, + 0x91, + 0x9e, + 0x24, + 0xb2, + 0x5a, + 0x8f, + 0xce, + 0xb9, + 0x90, + 0xd4, + 0xdf, + 0xce, + 0x13, + 0x57, + 0x4e, + 0x4a, + 0x4, + 0x9, + 0xb0, + 0xb0, + 0xca, + 0x80, + 0x6, + 0xe2, + 0xc1, + 0x2, + 0x19, + 0xe5, + 0x35, + 0x32, + 0xb3, + 0xed, + 0x88, + 0xc5, + 0xe8, + 0x9a, + 0xf, + 0x49, + 0x59, + 0x5f, + 0x96, + 0xd8, + 0xdc, + 0x66, + 0x16, + 0xd3, + 0x20, + 0x88, + 0xbf, + 0x27, + 0xb3, + 0xeb, + 0x65, + 0x81, + 0xf0, + 0xcd, + 0x36, + 0x7d, + 0x8d, + 0x9, + 0x68, + 0xff, + 0x1a, + 0x44, + 0x21, + 0x39, + 0x45, + 0xd3, + 0x4c, + 0x4b, + 0xd0, + 0x38, + 0x6, + 0xf4, + 0x2c, + 0xf9, + 0x76, + 0x63, + 0xac, + 0x46, + 0x16, + 0x88, + 0x6a, + 0xe3, + 0x76, + 0xa8, + 0xbb, + 0x93, + 0x87, + 0x2c, + 0x2d, + 0x2, + 0x8d, + 0x71, + 0x60, + 0xa6, + 0x60, + 0x5, + 0xfb, + 0x8c, + 0xa5, + 0x9f, + 0x4c, + 0x35, + 0x6e, + 0x96, + 0xf0, + 0xaf, + 0x90, + 0x78, + 0xa, + 0x53, + 0x5, + 0xb9, + 0x51, + 0x34, + 0x9f, + 0x82, + 0xfd, + 0x6c, + 0x6a, + 0xf6, + 0x99, + 0x6a, + 0x83, + 0x11, + 0x30, + 0x19, + 0xb3, + 0x55, + 0xa3, + 0xe0, + 0x55, + 0xa, + 0x8e, + 0x70, + 0x82, + 0xb0, + 0xa9, + 0x55, + 0x8b, + 0x8d, + 0xe0, + 0xc4, + 0xb3, + 0x42, + 0xb1, + 0xd8, + 0xcd, + 0x14, + 0x7c, + 0x4e, + 0xc1, + 0x29, + 0x8e, + 0x2b, + 0x4e, + 0x10, + 0xd5, + 0x62, + 0x23, + 0x38, + 0xf3, + 0xa9, + 0x5c, + 0xac, + 0xe, + 0x5d, + 0xf0, + 0x23, + 0x5, + 0x17, + 0x38, + 0x1b, + 0x39, + 0x29, + 0x54, + 0x8b, + 0x8d, + 0x20, + 0xbc, + 0x10, + 0x12, + 0xab, + 0x53, + 0x17, + 0x9c, + 0xa7, + 0xe0, + 0xac, + 0xef, + 0x88, + 0x47, + 0xba, + 0x7e, + 0x18, + 0xd7, + 0xe, + 0xff, + 0xc2, + 0xe9, + 0x13, + 0x15, + 0x9c, + 0xa1, + 0xe0, + 0x84, + 0xb7, + 0xde, + 0x2d, + 0xe7, + 0xbe, + 0x54, + 0x2a, + 0x17, + 0x1b, + 0xc1, + 0xa9, + 0xf7, + 0xa5, + 0x62, + 0x59, + 0xbd, + 0xd2, + 0x37, + 0x14, + 0x1c, + 0xa2, + 0xc5, + 0x70, + 0xea, + 0xab, + 0x16, + 0x1b, + 0x41, + 0xe3, + 0xe3, + 0xbd, + 0x28, + 0x1a, + 0xbd, + 0x4a, + 0x9f, + 0x50, + 0xb0, + 0x8f, + 0x7e, + 0x46, + 0x8b, + 0x51, + 0x2d, + 0x36, + 0x82, + 0x92, + 0xb, + 0xde, + 0x58, + 0x5b, + 0x5c, + 0xa4, + 0x60, + 0x90, + 0xe6, + 0x49, + 0x5b, + 0xf9, + 0x1f, + 0x85, + 0xd3, + 0x89, + 0xda, + 0x70, + 0x7, + 0xec, + 0x14, + 0xe3, + 0x4c, + 0xd, + 0x50, + 0x90, + 0x9f, + 0x5, + 0xc3, + 0x34, + 0x4f, + 0xfa, + 0x19, + 0x2d, + 0x46, + 0xb5, + 0x71, + 0x2b, + 0xf4, + 0xac, + 0xd4, + 0xc8, + 0xfe, + 0xeb, + 0x7e, + 0xb1, + 0xba, + 0xf4, + 0xf7, + 0x7b, + 0xa, + 0xf4, + 0xd1, + 0x46, + 0xaf, + 0xea, + 0xa0, + 0x53, + 0x33, + 0x4b, + 0x56, + 0x94, + 0x6a, + 0xf3, + 0x56, + 0x68, + 0x7e, + 0x5d, + 0x2c, + 0xe9, + 0x45, + 0xfa, + 0x58, + 0xe3, + 0xf7, + 0x4f, + 0x2d, + 0x88, + 0x5b, + 0x14, + 0x9d, + 0xfe, + 0x21, + 0xde, + 0x72, + 0xa9, + 0xee, + 0x56, + 0xae, + 0xee, + 0x67, + 0xaa, + 0x3, + 0x36, + 0xc3, + 0xe9, + 0xc9, + 0x32, + 0xc9, + 0x6b, + 0xcd, + 0x60, + 0xb1, + 0xd0, + 0xfd, + 0xaf, + 0x1, + 0xba, + 0x52, + 0x3c, + 0x98, + 0xe5, + 0x61, + 0x30, + 0xe6, + 0x29, + 0xb0, + 0x47, + 0xea, + 0x31, + 0xe1, + 0xe9, + 0x67, + 0xaa, + 0x83, + 0x92, + 0x81, + 0x62, + 0x85, + 0xe1, + 0x4c, + 0xb1, + 0xa5, + 0x59, + 0xe8, + 0xfa, + 0x77, + 0x81, + 0xf, + 0xfc, + 0x65, + 0xc0, + 0xc, + 0x1a, + 0x64, + 0x1b, + 0xfe, + 0x3d, + 0xe9, + 0xda, + 0x9d, + 0x22, + 0x15, + 0x57, + 0xb2, + 0x75, + 0x3f, + 0x53, + 0x1d, + 0xb8, + 0x1e, + 0x7c, + 0x33, + 0x5e, + 0x23, + 0x33, + 0x8b, + 0x8a, + 0xdd, + 0x3, + 0x5, + 0x40, + 0x7f, + 0x3b, + 0x55, + 0x38, + 0x40, + 0x23, + 0x44, + 0x27, + 0xb0, + 0x61, + 0x85, + 0xe6, + 0x49, + 0x3f, + 0xa3, + 0xc5, + 0xa8, + 0x4, + 0xfe, + 0x84, + 0xd5, + 0xc8, + 0x2, + 0xe1, + 0x9b, + 0x45, + 0xaf, + 0x91, + 0x99, + 0x25, + 0x14, + 0x8b, + 0x5, + 0xaf, + 0x97, + 0xdf, + 0x20, + 0x83, + 0x74, + 0x6a, + 0x9a, + 0x27, + 0xfd, + 0x8c, + 0x16, + 0xc3, + 0xa9, + 0xcf, + 0x41, + 0xcc, + 0xd9, + 0xc8, + 0xe2, + 0xe2, + 0x4, + 0x61, + 0x53, + 0xb3, + 0xcf, + 0x58, + 0xfa, + 0x7a, + 0x35, + 0xae, + 0x16, + 0x8, + 0xdf, + 0x8c, + 0xd7, + 0xb8, + 0xa1, + 0x58, + 0x2c, + 0x78, + 0xdf, + 0xbc, + 0x62, + 0x7e, + 0x16, + 0x8c, + 0xe3, + 0x2f, + 0xbd, + 0x71, + 0x69, + 0x31, + 0x9c, + 0xfa, + 0x9c, + 0x8b, + 0x84, + 0xe3, + 0x8a, + 0x13, + 0x24, + 0xda, + 0xd4, + 0xec, + 0x33, + 0x96, + 0x3e, + 0xab, + 0x91, + 0x5, + 0xb2, + 0xe6, + 0xcd, + 0x92, + 0x9, + 0x6e, + 0xe2, + 0xaf, + 0xa4, + 0x53, + 0xd3, + 0x3c, + 0xe9, + 0x67, + 0xb4, + 0x18, + 0x4e, + 0x7d, + 0xe, + 0x62, + 0xce, + 0x46, + 0x8e, + 0x2b, + 0x4e, + 0x10, + 0x36, + 0x35, + 0xd7, + 0x26, + 0x10, + 0x32, + 0x99, + 0x7e, + 0x3, + 0x5, + 0x3b, + 0x43, + 0x15, + 0xa, + 0x17, + 0x25, + 0xf9, + 0x0, + 0x0, + 0x0, + 0x0, + 0x49, + 0x45, + 0x4e, + 0x44, + 0xae, + 0x42, + 0x60, + 0x82, + // res/icons/issue.png + 0x0, + 0x0, + 0x1, + 0xb, + 0x89, + 0x50, + 0x4e, + 0x47, + 0xd, + 0xa, + 0x1a, + 0xa, + 0x0, + 0x0, + 0x0, + 0xd, + 0x49, + 0x48, + 0x44, + 0x52, + 0x0, + 0x0, + 0x0, + 0x1f, + 0x0, + 0x0, + 0x0, + 0x1f, + 0x8, + 0x6, + 0x0, + 0x0, + 0x0, + 0x1f, + 0xae, + 0x16, + 0x39, + 0x0, + 0x0, + 0x0, + 0x4, + 0x67, + 0x41, + 0x4d, + 0x41, + 0x0, + 0x0, + 0xb1, + 0x8f, + 0xb, + 0xfc, + 0x61, + 0x5, + 0x0, + 0x0, + 0x0, + 0x9, + 0x70, + 0x48, + 0x59, + 0x73, + 0x0, + 0x0, + 0xe, + 0xc0, + 0x0, + 0x0, + 0xe, + 0xc0, + 0x1, + 0x6a, + 0xd6, + 0x89, + 0x9, + 0x0, + 0x0, + 0x0, + 0x18, + 0x74, + 0x45, + 0x58, + 0x74, + 0x53, + 0x6f, + 0x66, + 0x74, + 0x77, + 0x61, + 0x72, + 0x65, + 0x0, + 0x70, + 0x61, + 0x69, + 0x6e, + 0x74, + 0x2e, + 0x6e, + 0x65, + 0x74, + 0x20, + 0x34, + 0x2e, + 0x31, + 0x2e, + 0x34, + 0x13, + 0x40, + 0x68, + 0xc4, + 0x0, + 0x0, + 0x0, + 0x89, + 0x49, + 0x44, + 0x41, + 0x54, + 0x58, + 0x47, + 0x63, + 0x18, + 0x5, + 0x83, + 0x16, + 0xf0, + 0xe7, + 0xff, + 0x17, + 0x60, + 0xcf, + 0xff, + 0xaf, + 0x40, + 0x2c, + 0x6, + 0xa9, + 0x87, + 0x6a, + 0xa5, + 0x1c, + 0x70, + 0x66, + 0xff, + 0x6f, + 0xe0, + 0xca, + 0xf9, + 0xff, + 0x9f, + 0x58, + 0xc, + 0x52, + 0xf, + 0xd5, + 0x4a, + 0x39, + 0x18, + 0x50, + 0xcb, + 0xb9, + 0xb3, + 0xff, + 0x3b, + 0x80, + 0xc, + 0x84, + 0x61, + 0xa0, + 0x5, + 0xfd, + 0x68, + 0x16, + 0xf6, + 0x23, + 0xcb, + 0x83, + 0xd4, + 0x43, + 0xb5, + 0x52, + 0x1f, + 0x80, + 0xe2, + 0x15, + 0xd9, + 0x72, + 0x10, + 0x1f, + 0x2a, + 0x45, + 0x7b, + 0x30, + 0x6a, + 0xf9, + 0xa8, + 0xe5, + 0xa3, + 0x96, + 0xd3, + 0x5, + 0x8c, + 0x5a, + 0x3e, + 0x6a, + 0xf9, + 0xa8, + 0xe5, + 0x74, + 0x1, + 0x23, + 0xc7, + 0x72, + 0xce, + 0x9c, + 0xff, + 0x1, + 0xc0, + 0x16, + 0xca, + 0x7c, + 0x18, + 0xe6, + 0xca, + 0xfe, + 0xbf, + 0x1a, + 0xd9, + 0x72, + 0x10, + 0x1f, + 0x59, + 0x1e, + 0xa4, + 0x1e, + 0xaa, + 0x95, + 0x72, + 0x0, + 0x34, + 0x70, + 0x84, + 0x36, + 0x20, + 0x47, + 0xc1, + 0x30, + 0x2, + 0xc, + 0xc, + 0x0, + 0x8f, + 0x58, + 0x79, + 0xd, + 0x18, + 0xf, + 0x7f, + 0xb9, + 0x0, + 0x0, + 0x0, + 0x0, + 0x49, + 0x45, + 0x4e, + 0x44, + 0xae, + 0x42, + 0x60, + 0x82, + // res/icons/yellow.png + 0x0, + 0x0, + 0x3, + 0xd3, + 0x89, + 0x50, + 0x4e, + 0x47, + 0xd, + 0xa, + 0x1a, + 0xa, + 0x0, + 0x0, + 0x0, + 0xd, + 0x49, + 0x48, + 0x44, + 0x52, + 0x0, + 0x0, + 0x0, + 0x1c, + 0x0, + 0x0, + 0x0, + 0x1c, + 0x8, + 0x6, + 0x0, + 0x0, + 0x0, + 0x72, + 0xd, + 0xdf, + 0x94, + 0x0, + 0x0, + 0x0, + 0x4, + 0x67, + 0x41, + 0x4d, + 0x41, + 0x0, + 0x0, + 0xb1, + 0x8f, + 0xb, + 0xfc, + 0x61, + 0x5, + 0x0, + 0x0, + 0x0, + 0x9, + 0x70, + 0x48, + 0x59, + 0x73, + 0x0, + 0x0, + 0xe, + 0xbf, + 0x0, + 0x0, + 0xe, + 0xbf, + 0x1, + 0x38, + 0x5, + 0x53, + 0x24, + 0x0, + 0x0, + 0x0, + 0x18, + 0x74, + 0x45, + 0x58, + 0x74, + 0x53, + 0x6f, + 0x66, + 0x74, + 0x77, + 0x61, + 0x72, + 0x65, + 0x0, + 0x70, + 0x61, + 0x69, + 0x6e, + 0x74, + 0x2e, + 0x6e, + 0x65, + 0x74, + 0x20, + 0x34, + 0x2e, + 0x31, + 0x2e, + 0x35, + 0x64, + 0x47, + 0x58, + 0x52, + 0x0, + 0x0, + 0x3, + 0x51, + 0x49, + 0x44, + 0x41, + 0x54, + 0x48, + 0x4b, + 0xb5, + 0x96, + 0x3b, + 0x48, + 0x5c, + 0x51, + 0x10, + 0x86, + 0xf7, + 0xde, + 0x7d, + 0xde, + 0x55, + 0x21, + 0x29, + 0x7d, + 0xa5, + 0x30, + 0x22, + 0x12, + 0x88, + 0xb2, + 0xda, + 0x45, + 0xd, + 0x51, + 0x22, + 0x16, + 0x56, + 0x31, + 0xbd, + 0x60, + 0x3a, + 0xb, + 0x21, + 0x8, + 0x8b, + 0x36, + 0x29, + 0x82, + 0x85, + 0x85, + 0x58, + 0x2a, + 0x9a, + 0x2a, + 0x8d, + 0x21, + 0x20, + 0xd8, + 0x99, + 0x22, + 0x1a, + 0x50, + 0x14, + 0x82, + 0xa8, + 0x8, + 0x8a, + 0x26, + 0x82, + 0xb6, + 0x2a, + 0x8a, + 0x21, + 0xb0, + 0xac, + 0xeb, + 0x73, + 0x27, + 0xf3, + 0x5d, + 0xd6, + 0x25, + 0x89, + 0xc7, + 0xf5, + 0xb5, + 0xe, + 0x7c, + 0x20, + 0x72, + 0xce, + 0xf9, + 0x77, + 0xe6, + 0xcc, + 0x99, + 0xff, + 0x7a, + 0xae, + 0x8, + 0xbf, + 0xf2, + 0x50, + 0xa9, + 0x54, + 0x7a, + 0x94, + 0x19, + 0x65, + 0x43, + 0x49, + 0x28, + 0x7b, + 0xca, + 0x8a, + 0x32, + 0xa9, + 0x44, + 0x95, + 0x88, + 0xf2, + 0x40, + 0xf1, + 0x29, + 0x37, + 0xe, + 0x84, + 0x9e, + 0x28, + 0xed, + 0xca, + 0x9c, + 0xdf, + 0xef, + 0x39, + 0x2d, + 0x2e, + 0xb6, + 0xa4, + 0xaa, + 0xca, + 0x96, + 0xba, + 0x3a, + 0x5b, + 0x1a, + 0x1b, + 0xbd, + 0x52, + 0x5f, + 0x6f, + 0x4b, + 0x4d, + 0x8d, + 0x2d, + 0x91, + 0x88, + 0x2d, + 0x5, + 0x5, + 0x96, + 0x78, + 0xbd, + 0x9e, + 0x33, + 0x5d, + 0x3b, + 0xa5, + 0xb4, + 0x2a, + 0xc5, + 0x8a, + 0x57, + 0xb9, + 0x56, + 0x90, + 0xd1, + 0x1b, + 0x65, + 0x36, + 0x18, + 0xf4, + 0x9c, + 0x72, + 0x68, + 0x57, + 0x97, + 0x4f, + 0x46, + 0x47, + 0x3, + 0xb2, + 0xba, + 0x1a, + 0x92, + 0xdd, + 0x5d, + 0x47, + 0x8e, + 0x8f, + 0xc3, + 0x12, + 0x8b, + 0x39, + 0xb2, + 0xb5, + 0xe5, + 0xc8, + 0xf2, + 0x72, + 0x48, + 0x46, + 0x46, + 0x2, + 0xd2, + 0xd9, + 0xe9, + 0x93, + 0xea, + 0x6a, + 0x5b, + 0xf4, + 0xc7, + 0xfd, + 0xd6, + 0xbd, + 0x9f, + 0x94, + 0xe7, + 0x4a, + 0x50, + 0xc9, + 0x18, + 0x8f, + 0x94, + 0x5e, + 0x65, + 0xbb, + 0xa2, + 0xc2, + 0x4e, + 0xf6, + 0xf7, + 0xfb, + 0x65, + 0x61, + 0x21, + 0x24, + 0xa7, + 0xa7, + 0x61, + 0x11, + 0xc9, + 0xc, + 0x3f, + 0x62, + 0x76, + 0x36, + 0xe8, + 0xa, + 0xe7, + 0xe7, + 0x5b, + 0xc7, + 0x7a, + 0xc6, + 0x77, + 0xe5, + 0x95, + 0x12, + 0x52, + 0x8c, + 0x41, + 0x66, + 0xbd, + 0x96, + 0xe5, + 0xf9, + 0xd5, + 0xdc, + 0xec, + 0x95, + 0xe9, + 0xe9, + 0xa0, + 0x1c, + 0x1e, + 0x9a, + 0xf, + 0xbf, + 0x8c, + 0x64, + 0x32, + 0x2c, + 0x7b, + 0x7b, + 0x8e, + 0xc, + 0xc, + 0x4, + 0xa4, + 0xa4, + 0xc4, + 0x4a, + 0xea, + 0x79, + 0x3f, + 0x94, + 0x26, + 0xe5, + 0xc2, + 0xbd, + 0x72, + 0x67, + 0x94, + 0x71, + 0x1b, + 0xb1, + 0xa5, + 0xa5, + 0xeb, + 0x65, + 0x75, + 0x19, + 0xb1, + 0x58, + 0x58, + 0x86, + 0x86, + 0x2, + 0x52, + 0x58, + 0x68, + 0x25, + 0x35, + 0x1, + 0x1a, + 0xeb, + 0xa9, + 0x62, + 0x29, + 0xe9, + 0xa0, + 0x41, + 0x66, + 0x29, + 0x23, + 0x99, + 0xdd, + 0x45, + 0xec, + 0x9c, + 0x83, + 0x83, + 0xb0, + 0x44, + 0xa3, + 0x3e, + 0xc9, + 0xcd, + 0x75, + 0x9b, + 0x69, + 0x4c, + 0x49, + 0xdf, + 0x27, + 0xd9, + 0xb5, + 0xd3, + 0x20, + 0xdc, + 0xd9, + 0x4d, + 0xcb, + 0x98, + 0x89, + 0xfd, + 0x7d, + 0x47, + 0x1b, + 0xc9, + 0x12, + 0xcd, + 0xf2, + 0x44, + 0x35, + 0x5e, + 0x2a, + 0x6e, + 0x96, + 0xdc, + 0xdd, + 0x1c, + 0xdd, + 0x48, + 0x83, + 0x98, + 0x36, + 0xde, + 0x85, + 0xe1, + 0xe1, + 0x0, + 0x59, + 0x8a, + 0x6a, + 0xcc, + 0x2b, + 0x36, + 0x82, + 0x95, + 0xbc, + 0x33, + 0x5a, + 0x3f, + 0x1b, + 0xa5, + 0xfc, + 0x9f, + 0xa3, + 0x23, + 0x47, + 0xca, + 0xca, + 0xdc, + 0x2c, + 0x11, + 0x7d, + 0x8c, + 0x60, + 0xf, + 0x8f, + 0x9a, + 0x77, + 0x66, + 0xda, + 0x90, + 0xd, + 0x48, + 0xc6, + 0xe7, + 0x73, + 0x5, + 0xdf, + 0x21, + 0x38, + 0xc3, + 0x4, + 0xe1, + 0x51, + 0x9b, + 0x16, + 0x67, + 0x83, + 0x89, + 0x89, + 0xa0, + 0x68, + 0x8f, + 0x20, + 0xf8, + 0xd, + 0xc1, + 0xd, + 0xc6, + 0x15, + 0x13, + 0xc4, + 0xb4, + 0x38, + 0x1b, + 0x6c, + 0x6e, + 0x86, + 0xc4, + 0x71, + 0x5c, + 0xc1, + 0x9f, + 0x8, + 0x26, + 0x98, + 0x8d, + 0x4c, + 0xa, + 0xd3, + 0xe2, + 0x6c, + 0x90, + 0x48, + 0x38, + 0x12, + 0xe, + 0xbb, + 0x82, + 0x7, + 0x8, + 0xee, + 0x35, + 0x34, + 0x78, + 0x25, + 0x1e, + 0x37, + 0x2f, + 0xce, + 0x6, + 0x4c, + 0x9f, + 0x94, + 0xe0, + 0x2e, + 0x82, + 0x2b, + 0xb5, + 0xb5, + 0xb6, + 0xec, + 0xec, + 0xdc, + 0x5f, + 0x49, + 0xd7, + 0xd6, + 0xd2, + 0x25, + 0x5d, + 0x42, + 0x70, + 0x12, + 0x8b, + 0x61, + 0xea, + 0x9b, + 0x16, + 0x67, + 0x83, + 0xf1, + 0xf1, + 0x74, + 0xd3, + 0x7c, + 0x41, + 0x30, + 0x8a, + 0x9f, + 0x61, + 0x31, + 0xa6, + 0xc5, + 0xd9, + 0xa0, + 0xa3, + 0x23, + 0xfd, + 0x2c, + 0xde, + 0x22, + 0x18, + 0xc1, + 0x3c, + 0xb1, + 0x95, + 0xfb, + 0x68, + 0x9c, + 0x78, + 0xdc, + 0xc1, + 0x39, + 0x10, + 0x63, + 0xa6, + 0x96, + 0x20, + 0xc8, + 0x67, + 0xc1, + 0x14, + 0xe6, + 0x89, + 0x9f, + 0x61, + 0x31, + 0xa6, + 0x8d, + 0xb7, + 0xe1, + 0xec, + 0x2c, + 0x2c, + 0x7d, + 0x7d, + 0x7e, + 0xc9, + 0xc9, + 0x71, + 0xb3, + 0xfb, + 0xaa, + 0xb8, + 0xa3, + 0xd, + 0xaf, + 0x6a, + 0xc5, + 0xa9, + 0xc9, + 0x92, + 0x8e, + 0x32, + 0x6d, + 0xbe, + 0xd, + 0x8b, + 0x8b, + 0x21, + 0x29, + 0x2f, + 0x77, + 0xc7, + 0x1a, + 0xdf, + 0x3f, + 0xcf, + 0x94, + 0xb4, + 0x45, + 0xe1, + 0xf4, + 0x9f, + 0xf5, + 0x2e, + 0x4f, + 0x6, + 0x7, + 0x3, + 0xae, + 0x9f, + 0x99, + 0xe, + 0xb8, + 0x9, + 0xeb, + 0xeb, + 0x21, + 0x69, + 0x69, + 0xf1, + 0xd2, + 0x2c, + 0xb8, + 0xff, + 0x7b, + 0x5, + 0x57, + 0x4a, + 0x7, + 0x59, + 0xbe, + 0x50, + 0xe6, + 0x4a, + 0x4b, + 0xad, + 0x24, + 0x13, + 0x1e, + 0x3f, + 0x33, + 0x1d, + 0x74, + 0x1d, + 0x10, + 0x6b, + 0x6b, + 0xf3, + 0x49, + 0x5e, + 0x9e, + 0x7, + 0xd7, + 0xff, + 0xa0, + 0x14, + 0x28, + 0xff, + 0x18, + 0x30, + 0x81, + 0x41, + 0xbe, + 0xd6, + 0xf4, + 0xd7, + 0x8b, + 0x8a, + 0x2c, + 0xe9, + 0xee, + 0xf6, + 0xb9, + 0x7e, + 0x66, + 0x3a, + 0xf0, + 0x32, + 0xb8, + 0x33, + 0xca, + 0x48, + 0x66, + 0x29, + 0xb1, + 0x8f, + 0x4a, + 0xa9, + 0xe2, + 0xde, + 0x9d, + 0x29, + 0x1c, + 0xa5, + 0x89, + 0xcf, + 0x2, + 0xdd, + 0x70, + 0x86, + 0x79, + 0x92, + 0x2d, + 0x16, + 0x63, + 0x12, + 0xf8, + 0x1b, + 0xba, + 0x91, + 0x6, + 0xe1, + 0xce, + 0x52, + 0x65, + 0x24, + 0xb3, + 0x8c, + 0x62, + 0xe7, + 0x41, + 0x79, + 0xf9, + 0x6, + 0x19, + 0xc3, + 0xa9, + 0x31, + 0x4f, + 0xfc, + 0xc, + 0x8b, + 0x61, + 0xea, + 0x33, + 0x88, + 0x99, + 0x8d, + 0x34, + 0x17, + 0x13, + 0x84, + 0x47, + 0xcd, + 0x3b, + 0xa3, + 0xf5, + 0xe9, + 0xc6, + 0x54, + 0x83, + 0x70, + 0x67, + 0x94, + 0xf1, + 0x4a, + 0xb1, + 0xf3, + 0xa0, + 0xde, + 0x94, + 0x98, + 0xcf, + 0x82, + 0x79, + 0x3d, + 0xc4, + 0x7d, + 0xb8, + 0x4c, + 0xb, + 0x46, + 0x14, + 0x73, + 0x11, + 0xf8, + 0x9b, + 0xff, + 0xa5, + 0x1e, + 0x35, + 0xef, + 0x8c, + 0xd6, + 0xa7, + 0x1b, + 0x69, + 0x90, + 0xb, + 0x77, + 0x76, + 0x9d, + 0x60, + 0x13, + 0xbf, + 0x12, + 0xa7, + 0xc6, + 0x3c, + 0xf1, + 0x33, + 0x2c, + 0x86, + 0xa9, + 0xcf, + 0x20, + 0x66, + 0x36, + 0x32, + 0xae, + 0x98, + 0x20, + 0x3c, + 0x6a, + 0xd6, + 0x66, + 0x10, + 0xf2, + 0x78, + 0xfe, + 0x0, + 0xfe, + 0xb6, + 0xe, + 0x28, + 0x8d, + 0x19, + 0xd8, + 0xbc, + 0x0, + 0x0, + 0x0, + 0x0, + 0x49, + 0x45, + 0x4e, + 0x44, + 0xae, + 0x42, + 0x60, + 0x82, + // res/icons/visible.png + 0x0, + 0x0, + 0x1, + 0x9, + 0x89, + 0x50, + 0x4e, + 0x47, + 0xd, + 0xa, + 0x1a, + 0xa, + 0x0, + 0x0, + 0x0, + 0xd, + 0x49, + 0x48, + 0x44, + 0x52, + 0x0, + 0x0, + 0x0, + 0x1f, + 0x0, + 0x0, + 0x0, + 0x1f, + 0x8, + 0x6, + 0x0, + 0x0, + 0x0, + 0x1f, + 0xae, + 0x16, + 0x39, + 0x0, + 0x0, + 0x0, + 0x4, + 0x67, + 0x41, + 0x4d, + 0x41, + 0x0, + 0x0, + 0xb1, + 0x8f, + 0xb, + 0xfc, + 0x61, + 0x5, + 0x0, + 0x0, + 0x0, + 0x9, + 0x70, + 0x48, + 0x59, + 0x73, + 0x0, + 0x0, + 0xe, + 0xc1, + 0x0, + 0x0, + 0xe, + 0xc1, + 0x1, + 0xb8, + 0x91, + 0x6b, + 0xed, + 0x0, + 0x0, + 0x0, + 0x18, + 0x74, + 0x45, + 0x58, + 0x74, + 0x53, + 0x6f, + 0x66, + 0x74, + 0x77, + 0x61, + 0x72, + 0x65, + 0x0, + 0x70, + 0x61, + 0x69, + 0x6e, + 0x74, + 0x2e, + 0x6e, + 0x65, + 0x74, + 0x20, + 0x34, + 0x2e, + 0x31, + 0x2e, + 0x34, + 0x13, + 0x40, + 0x68, + 0xc4, + 0x0, + 0x0, + 0x0, + 0x87, + 0x49, + 0x44, + 0x41, + 0x54, + 0x58, + 0x47, + 0xed, + 0x8d, + 0x41, + 0xa, + 0xc0, + 0x20, + 0xc, + 0x4, + 0x7d, + 0xa0, + 0xcf, + 0xeb, + 0x7f, + 0x6d, + 0x85, + 0x8, + 0x36, + 0xac, + 0xad, + 0xd9, + 0xda, + 0x50, + 0x4a, + 0x6, + 0xe6, + 0x10, + 0xc1, + 0x9d, + 0xf4, + 0x7d, + 0xb6, + 0x52, + 0x4e, + 0xba, + 0xa0, + 0xa3, + 0xbd, + 0xaf, + 0x83, + 0xa2, + 0xda, + 0xd7, + 0x40, + 0xb1, + 0x91, + 0x88, + 0xd1, + 0xfb, + 0x14, + 0x3a, + 0xc0, + 0x48, + 0x83, + 0xc6, + 0xac, + 0xd2, + 0xa0, + 0x31, + 0xab, + 0x34, + 0x68, + 0xcc, + 0x2a, + 0xd, + 0x1a, + 0xb3, + 0x4a, + 0x83, + 0xc6, + 0xac, + 0xd2, + 0xa0, + 0x31, + 0xab, + 0x34, + 0x68, + 0xcc, + 0x2a, + 0xcd, + 0x68, + 0xa0, + 0x1f, + 0xbf, + 0x93, + 0xe6, + 0xf8, + 0x9c, + 0x73, + 0x1e, + 0xf, + 0xe8, + 0x10, + 0x92, + 0xa5, + 0x86, + 0x2f, + 0xe3, + 0xd, + 0x14, + 0xad, + 0x3e, + 0x61, + 0x3a, + 0xde, + 0x58, + 0x15, + 0xae, + 0x98, + 0xe3, + 0x2b, + 0x89, + 0xb8, + 0x9c, + 0xbe, + 0x44, + 0x5c, + 0x4e, + 0x5f, + 0x22, + 0x2e, + 0xa7, + 0x2f, + 0x11, + 0x97, + 0xf3, + 0x4f, + 0xa4, + 0xb4, + 0x3, + 0x1a, + 0xb3, + 0x3c, + 0xac, + 0x93, + 0xe, + 0x6d, + 0x12, + 0x0, + 0x0, + 0x0, + 0x0, + 0x49, + 0x45, + 0x4e, + 0x44, + 0xae, + 0x42, + 0x60, + 0x82, + // res/icons/params.png + 0x0, + 0x0, + 0x1, + 0x9, + 0x89, + 0x50, + 0x4e, + 0x47, + 0xd, + 0xa, + 0x1a, + 0xa, + 0x0, + 0x0, + 0x0, + 0xd, + 0x49, + 0x48, + 0x44, + 0x52, + 0x0, + 0x0, + 0x0, + 0x1f, + 0x0, + 0x0, + 0x0, + 0x1f, + 0x8, + 0x6, + 0x0, + 0x0, + 0x0, + 0x1f, + 0xae, + 0x16, + 0x39, + 0x0, + 0x0, + 0x0, + 0x4, + 0x67, + 0x41, + 0x4d, + 0x41, + 0x0, + 0x0, + 0xb1, + 0x8f, + 0xb, + 0xfc, + 0x61, + 0x5, + 0x0, + 0x0, + 0x0, + 0x9, + 0x70, + 0x48, + 0x59, + 0x73, + 0x0, + 0x0, + 0xe, + 0xc0, + 0x0, + 0x0, + 0xe, + 0xc0, + 0x1, + 0x6a, + 0xd6, + 0x89, + 0x9, + 0x0, + 0x0, + 0x0, + 0x18, + 0x74, + 0x45, + 0x58, + 0x74, + 0x53, + 0x6f, + 0x66, + 0x74, + 0x77, + 0x61, + 0x72, + 0x65, + 0x0, + 0x70, + 0x61, + 0x69, + 0x6e, + 0x74, + 0x2e, + 0x6e, + 0x65, + 0x74, + 0x20, + 0x34, + 0x2e, + 0x31, + 0x2e, + 0x35, + 0x64, + 0x47, + 0x58, + 0x52, + 0x0, + 0x0, + 0x0, + 0x87, + 0x49, + 0x44, + 0x41, + 0x54, + 0x58, + 0x47, + 0xed, + 0xd1, + 0x31, + 0xe, + 0xc0, + 0x20, + 0xc, + 0x43, + 0x51, + 0xee, + 0x7f, + 0x69, + 0x2a, + 0xeb, + 0x9b, + 0x4c, + 0xac, + 0x31, + 0x43, + 0xf3, + 0xa4, + 0xc, + 0x75, + 0x87, + 0x3f, + 0xb0, + 0xc6, + 0x6f, + 0xed, + 0x7, + 0x57, + 0x6e, + 0x3f, + 0xbb, + 0xaf, + 0xec, + 0x24, + 0xf5, + 0xc8, + 0xc2, + 0x73, + 0x86, + 0x7a, + 0x64, + 0xe1, + 0x39, + 0x43, + 0x3d, + 0xb2, + 0xf0, + 0x5c, + 0x3f, + 0x5a, + 0xee, + 0xf0, + 0x77, + 0xf1, + 0x9c, + 0xa1, + 0x1e, + 0x59, + 0x78, + 0xce, + 0x50, + 0x8f, + 0x2c, + 0x3c, + 0x67, + 0xa8, + 0x47, + 0x16, + 0x9e, + 0xe7, + 0xcd, + 0x7b, + 0xa9, + 0x47, + 0x16, + 0x9e, + 0x33, + 0xd4, + 0x23, + 0xb, + 0xcf, + 0xf3, + 0xe6, + 0xbd, + 0xd4, + 0x23, + 0xb, + 0xcf, + 0x19, + 0xea, + 0x91, + 0x85, + 0xe7, + 0x79, + 0xf3, + 0x5e, + 0xea, + 0x91, + 0x85, + 0xe7, + 0xc, + 0xf5, + 0xc8, + 0xc2, + 0x73, + 0x86, + 0x7a, + 0x64, + 0x71, + 0x86, + 0xe4, + 0x95, + 0xdb, + 0xcf, + 0xee, + 0x7b, + 0x4c, + 0x4f, + 0xf0, + 0xea, + 0xae, + 0x63, + 0xe6, + 0xf6, + 0xfa, + 0x0, + 0xc5, + 0xe6, + 0xa9, + 0xc7, + 0xee, + 0x3c, + 0xc4, + 0x7c, + 0x0, + 0x0, + 0x0, + 0x0, + 0x49, + 0x45, + 0x4e, + 0x44, + 0xae, + 0x42, + 0x60, + 0x82, + // res/icons/no_params.png + 0x0, + 0x0, + 0x1, + 0x1b, + 0x89, + 0x50, + 0x4e, + 0x47, + 0xd, + 0xa, + 0x1a, + 0xa, + 0x0, + 0x0, + 0x0, + 0xd, + 0x49, + 0x48, + 0x44, + 0x52, + 0x0, + 0x0, + 0x0, + 0x1f, + 0x0, + 0x0, + 0x0, + 0x1f, + 0x8, + 0x6, + 0x0, + 0x0, + 0x0, + 0x1f, + 0xae, + 0x16, + 0x39, + 0x0, + 0x0, + 0x0, + 0x4, + 0x67, + 0x41, + 0x4d, + 0x41, + 0x0, + 0x0, + 0xb1, + 0x8f, + 0xb, + 0xfc, + 0x61, + 0x5, + 0x0, + 0x0, + 0x0, + 0x9, + 0x70, + 0x48, + 0x59, + 0x73, + 0x0, + 0x0, + 0xe, + 0xbf, + 0x0, + 0x0, + 0xe, + 0xbf, + 0x1, + 0x38, + 0x5, + 0x53, + 0x24, + 0x0, + 0x0, + 0x0, + 0x18, + 0x74, + 0x45, + 0x58, + 0x74, + 0x53, + 0x6f, + 0x66, + 0x74, + 0x77, + 0x61, + 0x72, + 0x65, + 0x0, + 0x70, + 0x61, + 0x69, + 0x6e, + 0x74, + 0x2e, + 0x6e, + 0x65, + 0x74, + 0x20, + 0x34, + 0x2e, + 0x31, + 0x2e, + 0x35, + 0x64, + 0x47, + 0x58, + 0x52, + 0x0, + 0x0, + 0x0, + 0x99, + 0x49, + 0x44, + 0x41, + 0x54, + 0x58, + 0x47, + 0xed, + 0xd1, + 0x31, + 0xe, + 0x83, + 0x40, + 0x14, + 0xc4, + 0x50, + 0xee, + 0x7f, + 0x69, + 0x22, + 0xcb, + 0x13, + 0x2a, + 0x5a, + 0x4c, + 0x91, + 0x3c, + 0xe9, + 0x37, + 0xb3, + 0x85, + 0x8b, + 0x3d, + 0xfe, + 0x7e, + 0xd6, + 0xf9, + 0xc2, + 0x5d, + 0xee, + 0x1e, + 0x9f, + 0xbe, + 0xcb, + 0x59, + 0xa2, + 0x67, + 0x56, + 0x9b, + 0x1b, + 0xf4, + 0xcc, + 0x6a, + 0x73, + 0x83, + 0x9e, + 0x59, + 0x6d, + 0x6e, + 0xd0, + 0x33, + 0xab, + 0xcd, + 0xd, + 0x7a, + 0x66, + 0xb5, + 0xb9, + 0x41, + 0xcf, + 0xac, + 0x36, + 0x37, + 0xe8, + 0x99, + 0xd5, + 0xe6, + 0x6, + 0x3d, + 0xb3, + 0xda, + 0xdc, + 0xa0, + 0x67, + 0x56, + 0x9b, + 0x1b, + 0xf4, + 0xcc, + 0x6a, + 0x73, + 0x83, + 0x9e, + 0x59, + 0x6d, + 0x6e, + 0xd0, + 0x33, + 0xab, + 0xcd, + 0xd, + 0x7a, + 0x66, + 0xb5, + 0xb9, + 0x41, + 0xcf, + 0xac, + 0x36, + 0x37, + 0xe8, + 0x99, + 0xd5, + 0xe6, + 0x6, + 0x3d, + 0xb3, + 0xda, + 0xdc, + 0xa0, + 0x67, + 0x56, + 0x9b, + 0x1b, + 0xf4, + 0xcc, + 0x6a, + 0x73, + 0x83, + 0x9e, + 0x59, + 0x6d, + 0x6e, + 0xd0, + 0x33, + 0xab, + 0xef, + 0x50, + 0xde, + 0xe5, + 0xee, + 0xf1, + 0xe9, + 0x7b, + 0x19, + 0x5f, + 0xf0, + 0xd6, + 0xdd, + 0x8e, + 0xcd, + 0x9d, + 0xc7, + 0x7, + 0x7e, + 0x7c, + 0xbc, + 0xc2, + 0x4d, + 0xba, + 0x5f, + 0x28, + 0x0, + 0x0, + 0x0, + 0x0, + 0x49, + 0x45, + 0x4e, + 0x44, + 0xae, + 0x42, + 0x60, + 0x82, + // res/icons/red.png + 0x0, + 0x0, + 0x3, + 0xda, + 0x89, + 0x50, + 0x4e, + 0x47, + 0xd, + 0xa, + 0x1a, + 0xa, + 0x0, + 0x0, + 0x0, + 0xd, + 0x49, + 0x48, + 0x44, + 0x52, + 0x0, + 0x0, + 0x0, + 0x1c, + 0x0, + 0x0, + 0x0, + 0x1c, + 0x8, + 0x6, + 0x0, + 0x0, + 0x0, + 0x72, + 0xd, + 0xdf, + 0x94, + 0x0, + 0x0, + 0x0, + 0x4, + 0x67, + 0x41, + 0x4d, + 0x41, + 0x0, + 0x0, + 0xb1, + 0x8f, + 0xb, + 0xfc, + 0x61, + 0x5, + 0x0, + 0x0, + 0x0, + 0x9, + 0x70, + 0x48, + 0x59, + 0x73, + 0x0, + 0x0, + 0xe, + 0xbf, + 0x0, + 0x0, + 0xe, + 0xbf, + 0x1, + 0x38, + 0x5, + 0x53, + 0x24, + 0x0, + 0x0, + 0x0, + 0x18, + 0x74, + 0x45, + 0x58, + 0x74, + 0x53, + 0x6f, + 0x66, + 0x74, + 0x77, + 0x61, + 0x72, + 0x65, + 0x0, + 0x70, + 0x61, + 0x69, + 0x6e, + 0x74, + 0x2e, + 0x6e, + 0x65, + 0x74, + 0x20, + 0x34, + 0x2e, + 0x31, + 0x2e, + 0x35, + 0x64, + 0x47, + 0x58, + 0x52, + 0x0, + 0x0, + 0x3, + 0x58, + 0x49, + 0x44, + 0x41, + 0x54, + 0x48, + 0x4b, + 0xb5, + 0x96, + 0x4b, + 0x48, + 0x54, + 0x61, + 0x18, + 0x86, + 0x67, + 0xf4, + 0xcc, + 0x38, + 0x17, + 0xb, + 0x6f, + 0x99, + 0x5a, + 0xe3, + 0x65, + 0xc6, + 0xd1, + 0xf1, + 0x96, + 0x8, + 0x5d, + 0xc0, + 0x40, + 0x82, + 0x82, + 0x68, + 0x19, + 0x2d, + 0xda, + 0xb9, + 0x70, + 0x11, + 0x28, + 0x2d, + 0xda, + 0xb8, + 0xab, + 0x20, + 0x4, + 0xad, + 0x7d, + 0x2b, + 0x57, + 0xd1, + 0x22, + 0xdc, + 0x24, + 0xad, + 0x8a, + 0xc2, + 0x50, + 0x52, + 0xa, + 0x11, + 0x2a, + 0x9a, + 0xa0, + 0xb, + 0x5a, + 0xd1, + 0x5, + 0xa1, + 0x20, + 0x5a, + 0x25, + 0x64, + 0xf9, + 0xf5, + 0x3e, + 0xe3, + 0x68, + 0x52, + 0xa7, + 0xd1, + 0xd1, + 0xf1, + 0x87, + 0x67, + 0x31, + 0xc3, + 0x7f, + 0xfe, + 0xf7, + 0x7c, + 0x97, + 0xff, + 0x7b, + 0x8f, + 0x67, + 0x9d, + 0xe5, + 0x13, + 0xc5, + 0xa2, + 0x5d, + 0xc, + 0x88, + 0x49, + 0x31, + 0x2b, + 0x16, + 0xc4, + 0x17, + 0x91, + 0x14, + 0x63, + 0xa2, + 0x5f, + 0x74, + 0x88, + 0x22, + 0xe1, + 0x88, + 0xac, + 0x17, + 0x42, + 0xcd, + 0xa2, + 0x57, + 0x4c, + 0x3b, + 0x5e, + 0xef, + 0xcf, + 0x2a, + 0x9f, + 0xcf, + 0xda, + 0x2, + 0x41, + 0x3b, + 0x14, + 0xa, + 0x59, + 0x57, + 0xb8, + 0xd0, + 0x3a, + 0x43, + 0x61, + 0xdb, + 0x1f, + 0xc, + 0x59, + 0x4b, + 0x20, + 0x60, + 0x15, + 0x8e, + 0x63, + 0xf9, + 0x1e, + 0xef, + 0x2f, + 0xed, + 0x9d, + 0x10, + 0xdd, + 0x22, + 0x22, + 0xf2, + 0xc5, + 0x86, + 0x16, + 0x11, + 0xf5, + 0x88, + 0x29, + 0xbf, + 0x84, + 0xe, + 0xe8, + 0xd0, + 0xbe, + 0x92, + 0x32, + 0x1b, + 0xde, + 0x13, + 0xb1, + 0xf1, + 0x68, + 0xdc, + 0x9e, + 0xc5, + 0x13, + 0xf6, + 0x2e, + 0xd1, + 0x62, + 0xaf, + 0x1b, + 0x9b, + 0xed, + 0x71, + 0xbc, + 0xd1, + 0xc6, + 0xea, + 0xea, + 0xed, + 0x6a, + 0xd5, + 0x5e, + 0x3b, + 0x53, + 0x52, + 0x6a, + 0xfb, + 0xf4, + 0x42, + 0x7a, + 0xb9, + 0x6f, + 0x7a, + 0xf6, + 0x86, + 0xe8, + 0x12, + 0x5, + 0x22, + 0xe3, + 0xaa, + 0x16, + 0x43, + 0x62, + 0xbe, + 0xa9, + 0x20, + 0xb0, + 0x74, + 0xb1, + 0xbc, + 0xc2, + 0xee, + 0xd4, + 0xc5, + 0xec, + 0xbd, + 0x4, + 0x3e, + 0x35, + 0xb5, + 0x66, + 0x84, + 0x97, + 0xb8, + 0x55, + 0x13, + 0x4d, + 0x9, + 0x97, + 0x3b, + 0xce, + 0xf, + 0x9d, + 0xf1, + 0x48, + 0x9c, + 0x14, + 0x1, + 0xe1, + 0xba, + 0x88, + 0x6c, + 0xc8, + 0xeb, + 0xf1, + 0x7c, + 0x3d, + 0x5a, + 0x58, + 0x68, + 0x37, + 0x6b, + 0xea, + 0xec, + 0xcd, + 0x6, + 0x84, + 0xd6, + 0xf2, + 0x51, + 0x24, + 0x1b, + 0x12, + 0x36, + 0x58, + 0x51, + 0x69, + 0x35, + 0x7e, + 0xff, + 0x92, + 0xce, + 0x7b, + 0x21, + 0x8e, + 0x8b, + 0x7f, + 0xea, + 0x4a, + 0xcd, + 0x48, + 0xe3, + 0x3c, + 0x62, + 0x77, + 0x89, + 0xea, + 0xaf, + 0xc3, + 0xb2, + 0x81, + 0x74, + 0x5f, + 0xae, + 0xa8, + 0x52, + 0x6d, + 0x7d, + 0x88, + 0xd2, + 0x58, + 0x6d, + 0x42, + 0xb1, + 0xfc, + 0x59, + 0x34, + 0xc8, + 0x14, + 0x69, + 0x24, + 0xb2, + 0xad, + 0x88, + 0xad, + 0x30, + 0x97, + 0x68, + 0xb6, + 0xde, + 0xd2, + 0x32, + 0xb, + 0xe7, + 0xe5, + 0xd1, + 0x4c, + 0xa3, + 0x62, + 0xb5, + 0x9e, + 0x44, + 0xd7, + 0x4b, + 0x83, + 0x50, + 0xb3, + 0x6c, + 0xd3, + 0x98, + 0x89, + 0xe7, + 0xd, + 0x4d, + 0xea, + 0xec, + 0x80, + 0x29, + 0xb4, + 0x45, + 0x69, + 0x1c, + 0x13, + 0xa9, + 0x28, + 0xa9, + 0xdd, + 0x34, + 0xdd, + 0x48, + 0x83, + 0xb8, + 0x3d, + 0xb8, + 0x15, + 0xae, + 0x28, + 0xb5, + 0x8a, + 0xd2, + 0xa4, + 0x31, + 0x23, + 0xf2, + 0x10, + 0x6c, + 0xe7, + 0x9e, + 0xd1, + 0xfa, + 0x1b, + 0xe9, + 0xc6, + 0x6c, + 0x79, + 0xab, + 0x7a, + 0x46, + 0x7d, + 0x5, + 0x44, + 0x89, + 0x68, + 0xc, + 0xc1, + 0x1, + 0x2e, + 0x35, + 0xf7, + 0xcc, + 0xed, + 0x81, + 0x5c, + 0xd0, + 0xa7, + 0x5a, + 0x2a, + 0x28, + 0x4, + 0x2f, + 0x20, + 0x38, + 0xc9, + 0x4, + 0xe1, + 0x52, + 0xbb, + 0x6d, + 0xce, + 0x5, + 0x23, + 0xd5, + 0xb5, + 0x56, + 0xb0, + 0x2c, + 0x78, + 0x1f, + 0xc1, + 0x59, + 0xc6, + 0x15, + 0x13, + 0xc4, + 0x6d, + 0x73, + 0x2e, + 0x78, + 0x18, + 0x6b, + 0xb0, + 0x80, + 0x37, + 0x55, + 0xc7, + 0x97, + 0x8, + 0x2e, + 0x30, + 0x1b, + 0x99, + 0x14, + 0x6e, + 0x9b, + 0x73, + 0xc1, + 0x9c, + 0xea, + 0x18, + 0x5c, + 0x6e, + 0x9c, + 0xef, + 0x8, + 0x7e, + 0x39, + 0x1c, + 0xe, + 0xdb, + 0xac, + 0xfe, + 0x74, + 0xdb, + 0x9c, + 0xb, + 0x92, + 0xca, + 0x5e, + 0x5a, + 0xf0, + 0x33, + 0x82, + 0xc9, + 0x83, + 0xba, + 0x12, + 0x4f, + 0xb7, + 0x31, + 0xa5, + 0xe3, + 0xd1, + 0x7a, + 0xa5, + 0x34, + 0x55, + 0xc3, + 0x27, + 0x8, + 0x8e, + 0xb5, + 0xea, + 0x72, + 0x32, + 0xf5, + 0xdd, + 0x36, + 0xe7, + 0x82, + 0xeb, + 0x91, + 0x1a, + 0xd3, + 0x60, + 0x41, + 0xf0, + 0x36, + 0x82, + 0xfd, + 0xf8, + 0x19, + 0x16, + 0xe3, + 0xb6, + 0x39, + 0x17, + 0xf4, + 0x14, + 0x97, + 0x58, + 0xfe, + 0xb2, + 0xe0, + 0x39, + 0x4, + 0x3b, + 0x30, + 0x4f, + 0x6c, + 0x65, + 0x3b, + 0x1a, + 0x87, + 0xde, + 0x88, + 0xf8, + 0xfc, + 0x88, + 0x31, + 0x53, + 0xa3, + 0x8, + 0xf2, + 0x59, + 0x30, + 0x81, + 0x79, + 0xe2, + 0x67, + 0x58, + 0x8c, + 0xdb, + 0x83, + 0x9b, + 0xe1, + 0x83, + 0x38, + 0xaf, + 0xf9, + 0x1c, + 0x5a, + 0x6e, + 0x98, + 0x7b, + 0x22, + 0x35, + 0xda, + 0xf0, + 0xaa, + 0x6e, + 0x9c, + 0x9a, + 0x28, + 0x93, + 0x1a, + 0xb8, + 0x6e, + 0xf, + 0x6f, + 0x6, + 0x66, + 0x73, + 0xcc, + 0xef, + 0x67, + 0xac, + 0xf1, + 0xfd, + 0xd3, + 0x29, + 0x56, + 0x2d, + 0xa, + 0xa7, + 0x1f, + 0xd9, + 0xed, + 0x38, + 0x8b, + 0x83, + 0x1a, + 0xb6, + 0xf8, + 0x99, + 0xdb, + 0x1, + 0xd9, + 0xf0, + 0x20, + 0x16, + 0xb7, + 0x13, + 0x3b, + 0x76, + 0xd2, + 0x2c, + 0xb8, + 0xff, + 0x25, + 0x81, + 0x2b, + 0xad, + 0x2e, + 0xa2, + 0x3c, + 0x22, + 0xa6, + 0x6b, + 0xe5, + 0xd4, + 0x4c, + 0x78, + 0xfc, + 0xcc, + 0xed, + 0xa0, + 0x8d, + 0x80, + 0xd8, + 0xe9, + 0xa2, + 0x22, + 0x5c, + 0x2, + 0x3, + 0x1e, + 0x16, + 0x55, + 0x62, + 0x35, + 0xba, + 0x95, + 0x85, + 0x41, + 0x9e, + 0xd2, + 0xbf, + 0xaf, + 0x2a, + 0x1d, + 0x9f, + 0x9d, + 0x2d, + 0xdd, + 0x95, + 0xf2, + 0x33, + 0xb7, + 0x3, + 0xff, + 0x7, + 0x35, + 0x23, + 0x8d, + 0x44, + 0x96, + 0x16, + 0xbb, + 0x26, + 0xea, + 0x45, + 0xaa, + 0x76, + 0x6e, + 0x2b, + 0x28, + 0xf8, + 0x6, + 0x49, + 0x16, + 0xca, + 0xa9, + 0x31, + 0x4f, + 0xa2, + 0xc5, + 0x62, + 0xdc, + 0x4, + 0xd6, + 0x42, + 0x37, + 0xd2, + 0x20, + 0xd4, + 0x2c, + 0x9d, + 0x46, + 0x22, + 0xcb, + 0x28, + 0xb6, + 0xb2, + 0x48, + 0x2f, + 0xdf, + 0x20, + 0xa3, + 0x8a, + 0x76, + 0x11, + 0xf3, + 0xc4, + 0xcf, + 0xb0, + 0x18, + 0xa6, + 0x3e, + 0x83, + 0x98, + 0xd9, + 0xc8, + 0xb8, + 0x62, + 0x82, + 0x70, + 0xa9, + 0xb9, + 0x67, + 0xb4, + 0x3e, + 0xdd, + 0x98, + 0x6e, + 0x10, + 0x6a, + 0x46, + 0x1a, + 0xd7, + 0x15, + 0x5b, + 0x59, + 0xe4, + 0x9b, + 0x14, + 0xf3, + 0x59, + 0x30, + 0xa3, + 0x1f, + 0x29, + 0x3f, + 0xc3, + 0x62, + 0x98, + 0xfa, + 0xcc, + 0x45, + 0x60, + 0x5c, + 0x31, + 0x41, + 0xd2, + 0x97, + 0x9a, + 0x7b, + 0x46, + 0xeb, + 0xd3, + 0x8d, + 0x34, + 0x8, + 0x67, + 0x64, + 0xbd, + 0x78, + 0x88, + 0xb7, + 0xc4, + 0xa9, + 0x31, + 0x4f, + 0xfc, + 0xc, + 0x8b, + 0x61, + 0xea, + 0x33, + 0x88, + 0x99, + 0x8d, + 0x8c, + 0x2b, + 0x26, + 0x8, + 0x97, + 0x9a, + 0xbd, + 0x19, + 0x84, + 0x3c, + 0x9e, + 0xdf, + 0xfd, + 0xb2, + 0x98, + 0x79, + 0x58, + 0xd9, + 0x56, + 0xc7, + 0x0, + 0x0, + 0x0, + 0x0, + 0x49, + 0x45, + 0x4e, + 0x44, + 0xae, + 0x42, + 0x60, + 0x82, + // icons/marked.png + 0x0, + 0x0, + 0x1, + 0x10, + 0x89, + 0x50, + 0x4e, + 0x47, + 0xd, + 0xa, + 0x1a, + 0xa, + 0x0, + 0x0, + 0x0, + 0xd, + 0x49, + 0x48, + 0x44, + 0x52, + 0x0, + 0x0, + 0x0, + 0x1f, + 0x0, + 0x0, + 0x0, + 0x1f, + 0x8, + 0x6, + 0x0, + 0x0, + 0x0, + 0x1f, + 0xae, + 0x16, + 0x39, + 0x0, + 0x0, + 0x0, + 0x4, + 0x67, + 0x41, + 0x4d, + 0x41, + 0x0, + 0x0, + 0xb1, + 0x8f, + 0xb, + 0xfc, + 0x61, + 0x5, + 0x0, + 0x0, + 0x0, + 0x9, + 0x70, + 0x48, + 0x59, + 0x73, + 0x0, + 0x0, + 0xe, + 0xc1, + 0x0, + 0x0, + 0xe, + 0xc1, + 0x1, + 0xb8, + 0x91, + 0x6b, + 0xed, + 0x0, + 0x0, + 0x0, + 0x18, + 0x74, + 0x45, + 0x58, + 0x74, + 0x53, + 0x6f, + 0x66, + 0x74, + 0x77, + 0x61, + 0x72, + 0x65, + 0x0, + 0x70, + 0x61, + 0x69, + 0x6e, + 0x74, + 0x2e, + 0x6e, + 0x65, + 0x74, + 0x20, + 0x34, + 0x2e, + 0x31, + 0x2e, + 0x34, + 0x13, + 0x40, + 0x68, + 0xc4, + 0x0, + 0x0, + 0x0, + 0x8e, + 0x49, + 0x44, + 0x41, + 0x54, + 0x58, + 0x47, + 0xed, + 0x93, + 0x31, + 0xe, + 0x80, + 0x30, + 0xc, + 0xc4, + 0xfa, + 0xff, + 0xe7, + 0xf2, + 0x81, + 0xa2, + 0x93, + 0x2f, + 0x99, + 0x3a, + 0x92, + 0x64, + 0xa0, + 0x96, + 0x4e, + 0xa2, + 0x66, + 0xf0, + 0x50, + 0x58, + 0x97, + 0xdf, + 0xb2, + 0x7, + 0x96, + 0x9c, + 0x5e, + 0x56, + 0x2f, + 0xd9, + 0xc1, + 0xb3, + 0x57, + 0xd9, + 0x2, + 0xf5, + 0xc8, + 0x82, + 0xf5, + 0x9f, + 0xe3, + 0x7a, + 0xae, + 0x5a, + 0xe0, + 0x73, + 0x62, + 0x7d, + 0xef, + 0xbc, + 0x66, + 0x81, + 0x7a, + 0x64, + 0xc1, + 0x7a, + 0xf8, + 0xce, + 0x3b, + 0x50, + 0x8f, + 0x2c, + 0x58, + 0xf7, + 0xa0, + 0x1e, + 0x59, + 0xb0, + 0xee, + 0x41, + 0x3d, + 0xb2, + 0x60, + 0x3d, + 0x7c, + 0xe7, + 0xa7, + 0xaf, + 0xf4, + 0xab, + 0x5, + 0xea, + 0x91, + 0x5, + 0xeb, + 0xfb, + 0x9f, + 0xd7, + 0x2c, + 0xf0, + 0x39, + 0xb1, + 0xee, + 0x41, + 0x3d, + 0xb2, + 0x60, + 0xdd, + 0x83, + 0x7a, + 0x64, + 0xc1, + 0xba, + 0x7, + 0xf5, + 0xc8, + 0x82, + 0x75, + 0xf, + 0xea, + 0x91, + 0x85, + 0x10, + 0x9d, + 0x4b, + 0x4e, + 0x2f, + 0xab, + 0x37, + 0x8c, + 0xae, + 0x60, + 0x6a, + 0x47, + 0xd9, + 0xb3, + 0xbd, + 0x5e, + 0x6b, + 0xee, + 0xd1, + 0x4, + 0xc4, + 0x9e, + 0xe9, + 0xa0, + 0x0, + 0x0, + 0x0, + 0x0, + 0x49, + 0x45, + 0x4e, + 0x44, + 0xae, + 0x42, + 0x60, + 0x82, + +}; + +static const unsigned char qt_resource_name[] = { + // icons + 0x0, + 0x5, + 0x0, + 0x6f, + 0xa6, + 0x53, + 0x0, + 0x69, + 0x0, + 0x63, + 0x0, + 0x6f, + 0x0, + 0x6e, + 0x0, + 0x73, + // marked_visible.png + 0x0, + 0x12, + 0x9, + 0x20, + 0x2, + 0x47, + 0x0, + 0x6d, + 0x0, + 0x61, + 0x0, + 0x72, + 0x0, + 0x6b, + 0x0, + 0x65, + 0x0, + 0x64, + 0x0, + 0x5f, + 0x0, + 0x76, + 0x0, + 0x69, + 0x0, + 0x73, + 0x0, + 0x69, + 0x0, + 0x62, + 0x0, + 0x6c, + 0x0, + 0x65, + 0x0, + 0x2e, + 0x0, + 0x70, + 0x0, + 0x6e, + 0x0, + 0x67, + // green.png + 0x0, + 0x9, + 0xb, + 0xc1, + 0x8a, + 0x47, + 0x0, + 0x67, + 0x0, + 0x72, + 0x0, + 0x65, + 0x0, + 0x65, + 0x0, + 0x6e, + 0x0, + 0x2e, + 0x0, + 0x70, + 0x0, + 0x6e, + 0x0, + 0x67, + // issue.png + 0x0, + 0x9, + 0xa, + 0xb8, + 0xb6, + 0x7, + 0x0, + 0x69, + 0x0, + 0x73, + 0x0, + 0x73, + 0x0, + 0x75, + 0x0, + 0x65, + 0x0, + 0x2e, + 0x0, + 0x70, + 0x0, + 0x6e, + 0x0, + 0x67, + // yellow.png + 0x0, + 0xa, + 0x3, + 0x69, + 0xaf, + 0x27, + 0x0, + 0x79, + 0x0, + 0x65, + 0x0, + 0x6c, + 0x0, + 0x6c, + 0x0, + 0x6f, + 0x0, + 0x77, + 0x0, + 0x2e, + 0x0, + 0x70, + 0x0, + 0x6e, + 0x0, + 0x67, + // visible.png + 0x0, + 0xb, + 0x9, + 0xde, + 0x44, + 0xa7, + 0x0, + 0x76, + 0x0, + 0x69, + 0x0, + 0x73, + 0x0, + 0x69, + 0x0, + 0x62, + 0x0, + 0x6c, + 0x0, + 0x65, + 0x0, + 0x2e, + 0x0, + 0x70, + 0x0, + 0x6e, + 0x0, + 0x67, + // params.png + 0x0, + 0xa, + 0x8, + 0x4c, + 0x86, + 0x47, + 0x0, + 0x70, + 0x0, + 0x61, + 0x0, + 0x72, + 0x0, + 0x61, + 0x0, + 0x6d, + 0x0, + 0x73, + 0x0, + 0x2e, + 0x0, + 0x70, + 0x0, + 0x6e, + 0x0, + 0x67, + // no_params.png + 0x0, + 0xd, + 0xe, + 0xea, + 0x87, + 0x87, + 0x0, + 0x6e, + 0x0, + 0x6f, + 0x0, + 0x5f, + 0x0, + 0x70, + 0x0, + 0x61, + 0x0, + 0x72, + 0x0, + 0x61, + 0x0, + 0x6d, + 0x0, + 0x73, + 0x0, + 0x2e, + 0x0, + 0x70, + 0x0, + 0x6e, + 0x0, + 0x67, + // red.png + 0x0, + 0x7, + 0x8, + 0xb7, + 0x57, + 0xa7, + 0x0, + 0x72, + 0x0, + 0x65, + 0x0, + 0x64, + 0x0, + 0x2e, + 0x0, + 0x70, + 0x0, + 0x6e, + 0x0, + 0x67, + // marked.png + 0x0, + 0xa, + 0x1, + 0xb9, + 0x26, + 0x67, + 0x0, + 0x6d, + 0x0, + 0x61, + 0x0, + 0x72, + 0x0, + 0x6b, + 0x0, + 0x65, + 0x0, + 0x64, + 0x0, + 0x2e, + 0x0, + 0x70, + 0x0, + 0x6e, + 0x0, + 0x67, + +}; + +static const unsigned char qt_resource_struct[] = { + // : + 0x0, + 0x0, + 0x0, + 0x0, + 0x0, + 0x2, + 0x0, + 0x0, + 0x0, + 0x1, + 0x0, + 0x0, + 0x0, + 0x1, + 0x0, + 0x0, + 0x0, + 0x0, + 0x0, + 0x0, + 0x0, + 0x0, + // :/icons + 0x0, + 0x0, + 0x0, + 0x0, + 0x0, + 0x2, + 0x0, + 0x0, + 0x0, + 0x9, + 0x0, + 0x0, + 0x0, + 0x2, + 0x0, + 0x0, + 0x0, + 0x0, + 0x0, + 0x0, + 0x0, + 0x0, + // :/icons/marked.png + 0x0, + 0x0, + 0x0, + 0xee, + 0x0, + 0x0, + 0x0, + 0x0, + 0x0, + 0x1, + 0x0, + 0x0, + 0x11, + 0x7d, + 0x0, + 0x0, + 0x1, + 0x68, + 0x27, + 0x5f, + 0xe2, + 0x4e, + // :/icons/yellow.png + 0x0, + 0x0, + 0x0, + 0x6a, + 0x0, + 0x0, + 0x0, + 0x0, + 0x0, + 0x1, + 0x0, + 0x0, + 0x6, + 0x8f, + 0x0, + 0x0, + 0x1, + 0x68, + 0x7a, + 0x1b, + 0xdf, + 0xe5, + // :/icons/params.png + 0x0, + 0x0, + 0x0, + 0xa0, + 0x0, + 0x0, + 0x0, + 0x0, + 0x0, + 0x1, + 0x0, + 0x0, + 0xb, + 0x73, + 0x0, + 0x0, + 0x1, + 0x68, + 0x27, + 0x5f, + 0xe2, + 0x3e, + // :/icons/red.png + 0x0, + 0x0, + 0x0, + 0xda, + 0x0, + 0x0, + 0x0, + 0x0, + 0x0, + 0x1, + 0x0, + 0x0, + 0xd, + 0x9f, + 0x0, + 0x0, + 0x1, + 0x68, + 0x7a, + 0x1b, + 0x97, + 0x71, + // :/icons/marked_visible.png + 0x0, + 0x0, + 0x0, + 0x10, + 0x0, + 0x0, + 0x0, + 0x0, + 0x0, + 0x1, + 0x0, + 0x0, + 0x0, + 0x0, + 0x0, + 0x0, + 0x1, + 0x68, + 0x27, + 0x5f, + 0xe6, + 0x36, + // :/icons/visible.png + 0x0, + 0x0, + 0x0, + 0x84, + 0x0, + 0x0, + 0x0, + 0x0, + 0x0, + 0x1, + 0x0, + 0x0, + 0xa, + 0x66, + 0x0, + 0x0, + 0x1, + 0x68, + 0x27, + 0x5f, + 0xe2, + 0x4e, + // :/icons/issue.png + 0x0, + 0x0, + 0x0, + 0x52, + 0x0, + 0x0, + 0x0, + 0x0, + 0x0, + 0x1, + 0x0, + 0x0, + 0x5, + 0x80, + 0x0, + 0x0, + 0x1, + 0x68, + 0x27, + 0x5f, + 0xe2, + 0x4e, + // :/icons/green.png + 0x0, + 0x0, + 0x0, + 0x3a, + 0x0, + 0x0, + 0x0, + 0x0, + 0x0, + 0x1, + 0x0, + 0x0, + 0x1, + 0x7d, + 0x0, + 0x0, + 0x1, + 0x68, + 0x7a, + 0x18, + 0x53, + 0x80, + // :/icons/no_params.png + 0x0, + 0x0, + 0x0, + 0xba, + 0x0, + 0x0, + 0x0, + 0x0, + 0x0, + 0x1, + 0x0, + 0x0, + 0xc, + 0x80, + 0x0, + 0x0, + 0x1, + 0x68, + 0x27, + 0x5f, + 0xe2, + 0x3e, + +}; + +#ifdef QT_NAMESPACE +#define QT_RCC_PREPEND_NAMESPACE(name) ::QT_NAMESPACE::name +#define QT_RCC_MANGLE_NAMESPACE0(x) x +#define QT_RCC_MANGLE_NAMESPACE1(a, b) a##_##b +#define QT_RCC_MANGLE_NAMESPACE2(a, b) QT_RCC_MANGLE_NAMESPACE1(a, b) +#define QT_RCC_MANGLE_NAMESPACE(name) \ + QT_RCC_MANGLE_NAMESPACE2(QT_RCC_MANGLE_NAMESPACE0(name), QT_RCC_MANGLE_NAMESPACE0(QT_NAMESPACE)) +#else +#define QT_RCC_PREPEND_NAMESPACE(name) name +#define QT_RCC_MANGLE_NAMESPACE(name) name +#endif + +#ifdef QT_NAMESPACE +namespace QT_NAMESPACE +{ +#endif + +bool qRegisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *); + +bool qUnregisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *); + +#ifdef QT_NAMESPACE +} +#endif + +int QT_RCC_MANGLE_NAMESPACE(qInitResources)(); +int QT_RCC_MANGLE_NAMESPACE(qInitResources)() +{ + QT_RCC_PREPEND_NAMESPACE(qRegisterResourceData) + (0x2, qt_resource_struct, qt_resource_name, qt_resource_data); + return 1; +} + +int QT_RCC_MANGLE_NAMESPACE(qCleanupResources)(); +int QT_RCC_MANGLE_NAMESPACE(qCleanupResources)() +{ + QT_RCC_PREPEND_NAMESPACE(qUnregisterResourceData) + (0x2, qt_resource_struct, qt_resource_name, qt_resource_data); + return 1; +} + +namespace +{ +struct initializer +{ + initializer() + { + QT_RCC_MANGLE_NAMESPACE(qInitResources)(); + } + ~initializer() + { + QT_RCC_MANGLE_NAMESPACE(qCleanupResources)(); + } +} dummy; +} // namespace diff --git a/src/report_modules/report_module_gui/src/reportFormatUI.h b/src/report_modules/report_module_gui/src/reportFormatUI.h deleted file mode 100644 index ba58fdc6..00000000 --- a/src/report_modules/report_module_gui/src/reportFormatUI.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ -#include "common/util.h" - -#include - -#define REPORT_MODULE_NAME "ReportGUI" - -class cParameterContainer; - -/** -* Main function for application -* -* @param [in] argc Number of arguments in shell -* @param [in] argv Pointer to arguments -* -* @return The standard return value -*/ -int main(int argc, char* argv[]); - -/** -* Shows the help for the application -* @param [in] applicationName The name of the application -*/ -void ShowHelp(const std::string& applicationName); - -/** -* Runs the report gui module -*/ -int RunReportGUI(const cParameterContainer& inputParams, const QApplication& app); - -/** -* Writes the default configuration for a report -*/ -void WriteDefaultConfig(); diff --git a/src/report_modules/report_module_gui/src/reportFormatUI.cpp b/src/report_modules/report_module_gui/src/report_format_ui.cpp similarity index 83% rename from src/report_modules/report_module_gui/src/reportFormatUI.cpp rename to src/report_modules/report_module_gui/src/report_format_ui.cpp index e290269c..bf4a0ee2 100644 --- a/src/report_modules/report_module_gui/src/reportFormatUI.cpp +++ b/src/report_modules/report_module_gui/src/report_format_ui.cpp @@ -11,18 +11,18 @@ #include #endif +#include "common/config_format/c_configuration.h" +#include "common/config_format/c_configuration_report_module.h" +#include "common/result_format/c_parameter_container.h" +#include "common/result_format/c_result_container.h" +#include "report_format_ui.h" +#include "ui/c_report_module_window.h" #include -#include "reportFormatUI.h" -#include "common/result_format/cResultContainer.h" -#include "common/result_format/cParameterContainer.h" -#include "common/config_format/cConfiguration.h" -#include "common/config_format/cConfigurationReportModule.h" -#include "ui/cReportModuleWindow.h" XERCES_CPP_NAMESPACE_USE // Main Programm -int main(int argc, char* argv[]) +int main(int argc, char *argv[]) { #ifdef WIN32 auto workdir = a_util::filesystem::getWorkingDirectory(); @@ -53,7 +53,8 @@ int main(int argc, char* argv[]) { if (stat(strFilepath.c_str(), &fileStatus) == -1) // ==0 ok; ==-1 error { - std::cerr << "Could not open file '" << strFilepath << "'!" << std::endl << "Abort generating report!" << std::endl; + std::cerr << "Could not open file '" << strFilepath << "'!" << std::endl + << "Abort generating report!" << std::endl; return -1; } @@ -72,11 +73,12 @@ int main(int argc, char* argv[]) inputParams.Overwrite(configuration.GetParams()); - cConfigurationReportModule* reportModuleConfig = configuration.GetReportModuleByName(REPORT_MODULE_NAME); + cConfigurationReportModule *reportModuleConfig = configuration.GetReportModuleByName(REPORT_MODULE_NAME); if (nullptr != reportModuleConfig) inputParams.Overwrite(reportModuleConfig->GetParams()); else - std::cerr << "No configuration for module '" << REPORT_MODULE_NAME << "' found. Start with default params." << std::endl; + std::cerr << "No configuration for module '" << REPORT_MODULE_NAME + << "' found. Start with default params." << std::endl; } else if (StringEndsWith(ToLower(strFilepath), "--defaultconfig")) { @@ -100,7 +102,7 @@ int main(int argc, char* argv[]) return execCode; } -void ShowHelp(const std::string& toolPath) +void ShowHelp(const std::string &toolPath) { std::string applicationName = toolPath; std::string applicationNameWithoutExt = toolPath; @@ -110,13 +112,14 @@ void ShowHelp(const std::string& toolPath) std::cout << "\n\nUsage of " << applicationNameWithoutExt << ":" << std::endl; std::cout << "\nRun the application with xqar file: \n" << applicationName << " result.xqar" << std::endl; std::cout << "\nRun the application with dbqa configuration: \n" << applicationName << " config.xml" << std::endl; - std::cout << "\nRun the application and write default configuration: \n" << applicationName << " --defaultconfig" << std::endl; + std::cout << "\nRun the application and write default configuration: \n" + << applicationName << " --defaultconfig" << std::endl; std::cout << "\n\n"; } -int RunReportGUI(const cParameterContainer& inputParams, const QApplication& app) +int RunReportGUI(const cParameterContainer &inputParams, const QApplication &app) { - cResultContainer* pResultContainer = new cResultContainer(); + cResultContainer *pResultContainer = new cResultContainer(); std::string strXMLResultsPath = inputParams.GetParam("strInputFile"); @@ -153,7 +156,7 @@ void WriteDefaultConfig() { cConfiguration defaultConfig; - cConfigurationReportModule* reportModuleConfig = defaultConfig.AddReportModule(REPORT_MODULE_NAME); + cConfigurationReportModule *reportModuleConfig = defaultConfig.AddReportModule(REPORT_MODULE_NAME); reportModuleConfig->SetParam("strInputFile", "Result.xqar"); std::stringstream ssConfigFile; @@ -164,4 +167,4 @@ void WriteDefaultConfig() defaultConfig.WriteConfigurationToFile(ssConfigFile.str()); std::cout << "Finished." << std::endl; -} \ No newline at end of file +} diff --git a/src/report_modules/report_module_gui/src/report_format_ui.h b/src/report_modules/report_module_gui/src/report_format_ui.h new file mode 100644 index 00000000..3a7db233 --- /dev/null +++ b/src/report_modules/report_module_gui/src/report_format_ui.h @@ -0,0 +1,40 @@ +/* + * Copyright 2023 CARIAD SE. + * + * This Source Code Form is subject to the terms of the Mozilla + * Public License, v. 2.0. If a copy of the MPL was not distributed + * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ +#include "common/util.h" + +#include + +#define REPORT_MODULE_NAME "ReportGUI" + +class cParameterContainer; + +/** + * Main function for application + * + * @param [in] argc Number of arguments in shell + * @param [in] argv Pointer to arguments + * + * @return The standard return value + */ +int main(int argc, char *argv[]); + +/** + * Shows the help for the application + * @param [in] applicationName The name of the application + */ +void ShowHelp(const std::string &applicationName); + +/** + * Runs the report gui module + */ +int RunReportGUI(const cParameterContainer &inputParams, const QApplication &app); + +/** + * Writes the default configuration for a report + */ +void WriteDefaultConfig(); diff --git a/src/report_modules/report_module_gui/src/ui/cCheckerWidget.h b/src/report_modules/report_module_gui/src/ui/cCheckerWidget.h deleted file mode 100644 index 1af33f04..00000000 --- a/src/report_modules/report_module_gui/src/ui/cCheckerWidget.h +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ -#ifndef CHECKER_WIDGET_H -#define CHECKER_WIDGET_H - -#include -#include - -#include - -class QTreeWidget; -class QTreeWidgetItem; -class QTextEdit; - -class cIssue; -class cChecker; -class cCheckerBundle; -class cExtendedInformation; -class cParameterContainer; -class cLocationsContainer; -class cResultContainer; - -Q_DECLARE_OPAQUE_POINTER(cChecker*) -Q_DECLARE_OPAQUE_POINTER(cCheckerBundle*) -Q_DECLARE_OPAQUE_POINTER(cExtendedInformation*) - -Q_DECLARE_METATYPE(cChecker*) -Q_DECLARE_METATYPE(cCheckerBundle*) -Q_DECLARE_METATYPE(cExtendedInformation*) - -class cCheckerWidget : public QWidget -{ - Q_OBJECT - -public: - static const unsigned int ISSUE_DATA = Qt::UserRole + 1; - static const unsigned int CHECKER_DATA = Qt::UserRole + 2; - static const unsigned int CHECKER_BUNDLE_DATA = Qt::UserRole + 3; - static const unsigned int ISSUE_EXTENDED_DATA = Qt::UserRole + 4; - static const unsigned int ISSUE_EXTENDED_DESCRIPTION = Qt::UserRole + 5; - static const unsigned int ISSUE_ORDER = Qt::UserRole + 6; - - cCheckerWidget(QWidget* parent = 0); - - void LoadResultContainer(cResultContainer* const container); -protected: - - //Loads a list of cCheckerBundles to the widget view. - void LoadCheckerBundles(std::list checkerBundles) const; - - //Selects a given cCheckerBundle in the widget view. - void SelectCheckerBundle(cCheckerBundle* checkerBundle) const; - - //Loads a list of cChecker to the widget view. - void LoadCheckers(std::list checkers) const; - - //Selects a given cChecker in the widget view. - void SelectChecker(cChecker* checker) const; - - //Selects a given cIssue in the widget view. - void SelectIssue(cIssue* issue) const; - - //Loads a list of cIssues to the widget view. - void LoadIssues(std::list issues) const; - - //Reset the widget view to default - void LoadAllItems() const; - - // Shows an Issue and marks the problems in the XML view and shows the issue in the 3D Viewer - // \param itemToShow : The item to show - // \param extInfo : The group of extended items to be showed. - void ShowIssue(cIssue* const itemToShow, const cLocationsContainer* locationToShow, QList const extInfoDescr = {}) const; - - // Show details of an issue - void ShowDetails(cIssue* const itemToShow) const; - -protected: - // Fills an issue tree item - void FillIssueTreeItem(QTreeWidgetItem *treeItem, cIssue* const issue) const; - - // Fills an checker Bundle tree item - void FillCheckerBundleTreeItem(QTreeWidgetItem *treeItem, cCheckerBundle* const bundle) const; - - // Fills an checker tree item - void FillCheckerTreeItem(QTreeWidgetItem *treeItem, cChecker* const checker) const; - - // Fills an item with parameter information - void FillParameters(QTreeWidgetItem *treeItem, cParameterContainer* const params) const; -private: - QTreeWidget* _checkerBundleBox{nullptr}; - QTreeWidget* _checkerBox{nullptr}; - QTreeWidget* _issueBox{nullptr}; - QTextEdit* _issueDetailsTextWidget{nullptr}; - - cResultContainer* _currentResultContainer{nullptr}; - - const std::string STR_SELECT_ALL_CHECKER_BUNDLE = "Select All"; - - // Prints extended informations into a stream - void PrintExtendedInformationIntoStream(cExtendedInformation* item, std::stringstream* ssStream) const; -public slots: - //OnClick event for cCheckerBundle widget view - void OnClickCheckerBundle(QTreeWidgetItem* item, int); - - //OnClick event for cChecker widget view - void OnClickChecker(QTreeWidgetItem* item, int); - - //OnClick event for cIssues widget view - void OnClickIssue(QTreeWidgetItem* item, int); -signals: - // Invoked if an resultcontainer has to be loaded - void Load(cResultContainer* const resiltContainer) const; - - /* - * Invoked if an issue will be showed. - * \param row: Row which should be displayed. -1 for no specific row. - */ - void ShowXODRIssue(const cIssue* const issue, const int row) const; - - /* - * Invoked if an issue will be showed. - * \param row: Row which should be displayed. -1 for no specific row. - */ - void ShowXOSCIssue(const cIssue* const issue, const int row) const; - - /* - * Invoked if an issue should be showed in 3DViewer. - */ - void ShowIssueIn3DViewer(const cIssue* const issue, const cLocationsContainer* locationToShow) const; -}; - -#endif \ No newline at end of file diff --git a/src/report_modules/report_module_gui/src/ui/cReportModuleWindow.h b/src/report_modules/report_module_gui/src/ui/cReportModuleWindow.h deleted file mode 100644 index b7805377..00000000 --- a/src/report_modules/report_module_gui/src/ui/cReportModuleWindow.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ -#pragma once - -#include -#include -#include - -#include -#include -#include - -#include "common/result_format/cIssue.h" - -class cCheckerBundle; -class cCheckerWidget; -class cXODREditorWidget; -class cXOSCEditorWidget; -class cResultContainer; -class cLocationsContainer; - -class QActionGroup; -class QMenu; -class QAction; - -class cReportModuleWindow : public QMainWindow -{ - Q_OBJECT - -protected: - cResultContainer* _results{nullptr}; - - QString _reportModuleName; - QMenu* _fileMenu{nullptr}; - QMenu* _subMenu{nullptr}; - - cXODREditorWidget* _xodrEditorWidget{nullptr}; - cXOSCEditorWidget* _xoscEditorWidget{nullptr}; - cCheckerWidget* _checkerWidget{nullptr}; - - // Function pointers for functions of IConnector.h - typedef bool (*StartViewer_ptr)(); - typedef bool (*Initialize_ptr)(const char*, const char* ); - typedef bool (*AddIssue_ptr)(const void*); - typedef bool (*ShowIssue_ptr)(const void*, const void*); - typedef const char* (*GetName_ptr)(); - typedef bool (*CloseViewer_ptr)(); - typedef const char* (*GetLastErrorMessage_ptr)(); - - struct Viewer { - StartViewer_ptr StartViewer_f{nullptr}; - Initialize_ptr Initialize_f{nullptr}; - AddIssue_ptr AddIssue_f{nullptr}; - ShowIssue_ptr ShowIssue_f{nullptr}; - GetName_ptr GetName_f{nullptr}; - CloseViewer_ptr CloseViewer_f{nullptr}; - GetLastErrorMessage_ptr GetLastErrorMessage_f{nullptr}; - QAction* associatedAction{nullptr}; - }; - - std::vector> viewerEntries; - Viewer* _viewerActive{nullptr}; - -public: - cReportModuleWindow() = delete; - cReportModuleWindow(cReportModuleWindow&& ) = delete; - cReportModuleWindow(const cReportModuleWindow&) = delete; - explicit cReportModuleWindow(cResultContainer* container, - const std::string& reportModuleName, - QWidget* parent = 0); - - virtual ~cReportModuleWindow() = default; - - // Loads the result container - void LoadResultContainer(cResultContainer* const container) const; - -private slots: - // Open result file - void OpenResultFile(); - - // starts the Viewer - void StartViewer(Viewer* viewer); - - // shows a XODR Issue in a viewer if available - void ShowIssueInViewer(const cIssue* const issue, const cLocationsContainer* locationToShow); - -private: - // Handle application close - void closeEvent(QCloseEvent *bar); - - // Checks if the OpenDRIVE or OpenSCENARIO could be loaded - void ValidateInputFile(cCheckerBundle* const bundle, QMap* fileReplacementMap, const std::string& parameter, const std::string& fileName, const std::string& filter) const; -}; \ No newline at end of file diff --git a/src/report_modules/report_module_gui/src/ui/cCheckerWidget.cpp b/src/report_modules/report_module_gui/src/ui/c_checker_widget.cpp similarity index 74% rename from src/report_modules/report_module_gui/src/ui/cCheckerWidget.cpp rename to src/report_modules/report_module_gui/src/ui/c_checker_widget.cpp index 03c61a21..399f89f4 100644 --- a/src/report_modules/report_module_gui/src/ui/cCheckerWidget.cpp +++ b/src/report_modules/report_module_gui/src/ui/c_checker_widget.cpp @@ -5,30 +5,30 @@ * Public License, v. 2.0. If a copy of the MPL was not distributed * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "cCheckerWidget.h" +#include "c_checker_widget.h" -#include -#include +#include +#include #include +#include #include #include -#include -#include -#include +#include +#include -#include "common/result_format/cChecker.h" -#include "common/result_format/cCheckerBundle.h" -#include "common/result_format/cIssue.h" -#include "common/result_format/cRoadLocation.h" -#include "common/result_format/cInertialLocation.h" -#include "common/result_format/cXMLLocation.h" -#include "common/result_format/cFileLocation.h" -#include "common/result_format/cResultContainer.h" -#include "common/result_format/cLocationsContainer.h" +#include "common/result_format/c_checker.h" +#include "common/result_format/c_checker_bundle.h" +#include "common/result_format/c_file_location.h" +#include "common/result_format/c_inertial_location.h" +#include "common/result_format/c_issue.h" +#include "common/result_format/c_locations_container.h" +#include "common/result_format/c_result_container.h" +#include "common/result_format/c_road_location.h" +#include "common/result_format/c_xml_location.h" #include "common/util.h" -cCheckerWidget::cCheckerWidget(QWidget* parent) : QWidget(parent) +cCheckerWidget::cCheckerWidget(QWidget *parent) : QWidget(parent) { QFont font; font.setFamily("Courier"); @@ -37,11 +37,11 @@ cCheckerWidget::cCheckerWidget(QWidget* parent) : QWidget(parent) QFontMetrics metrics(font); QVBoxLayout *layout = new QVBoxLayout; - QSplitter* splitter = new QSplitter(Qt::Vertical); + QSplitter *splitter = new QSplitter(Qt::Vertical); - QWidget* checkerBundleWidget = new QWidget(this); - QVBoxLayout * checkerBundleWidgetLayout = new QVBoxLayout; - QLabel* checkerBundleWidgetLabel = new QLabel(checkerBundleWidget); + QWidget *checkerBundleWidget = new QWidget(this); + QVBoxLayout *checkerBundleWidgetLayout = new QVBoxLayout; + QLabel *checkerBundleWidgetLabel = new QLabel(checkerBundleWidget); checkerBundleWidgetLabel->setText("CheckerBundles"); checkerBundleWidgetLabel->setStyleSheet("font-weight: bold;"); _checkerBundleBox = new QTreeWidget(this); @@ -64,9 +64,9 @@ cCheckerWidget::cCheckerWidget(QWidget* parent) : QWidget(parent) splitter->addWidget(checkerBundleWidget); - QWidget* checkerWidget = new QWidget(this); - QVBoxLayout * checkerWidgetLayout = new QVBoxLayout; - QLabel* checkerWidgetLabel = new QLabel(checkerWidget); + QWidget *checkerWidget = new QWidget(this); + QVBoxLayout *checkerWidgetLayout = new QVBoxLayout; + QLabel *checkerWidgetLabel = new QLabel(checkerWidget); checkerWidgetLabel->setText("Checkers with issues"); checkerWidgetLabel->setStyleSheet("font-weight: bold;"); _checkerBox = new QTreeWidget(this); @@ -88,9 +88,9 @@ cCheckerWidget::cCheckerWidget(QWidget* parent) : QWidget(parent) checkerWidget->setLayout(checkerWidgetLayout); splitter->addWidget(checkerWidget); - QWidget* issueWidget = new QWidget(this); - QVBoxLayout * issueWidgetLayout = new QVBoxLayout; - QLabel* issueWidgetLabel = new QLabel(issueWidget); + QWidget *issueWidget = new QWidget(this); + QVBoxLayout *issueWidgetLayout = new QVBoxLayout; + QLabel *issueWidgetLabel = new QLabel(issueWidget); issueWidgetLabel->setText("Issues"); issueWidgetLabel->setStyleSheet("font-weight: bold;"); _issueBox = new QTreeWidget(this); @@ -133,9 +133,9 @@ cCheckerWidget::cCheckerWidget(QWidget* parent) : QWidget(parent) p.setColor(QPalette::Base, QColor(220, 220, 220)); _issueDetailsTextWidget->setPalette(p); - QWidget* issueDetailsWidget = new QWidget(this); - QVBoxLayout * issueDetailsLayout = new QVBoxLayout; - QLabel* issueDetailsLabel = new QLabel(issueDetailsWidget); + QWidget *issueDetailsWidget = new QWidget(this); + QVBoxLayout *issueDetailsLayout = new QVBoxLayout; + QLabel *issueDetailsLabel = new QLabel(issueDetailsWidget); issueDetailsLabel->setText("Description"); issueDetailsLabel->setStyleSheet("font-weight: bold;"); issueDetailsLayout->addWidget(issueDetailsLabel); @@ -149,9 +149,10 @@ cCheckerWidget::cCheckerWidget(QWidget* parent) : QWidget(parent) splitter->setStretchFactor(2, 3.0f); splitter->setStretchFactor(3, 1.2f); - connect(_checkerBundleBox, SIGNAL(itemClicked(QTreeWidgetItem*, int)), SLOT(OnClickCheckerBundle(QTreeWidgetItem*, int))); - connect(_checkerBox, SIGNAL(itemClicked(QTreeWidgetItem*, int)), SLOT(OnClickChecker(QTreeWidgetItem*, int))); - connect(_issueBox, SIGNAL(itemClicked(QTreeWidgetItem*, int)), SLOT(OnClickIssue(QTreeWidgetItem*, int))); + connect(_checkerBundleBox, SIGNAL(itemClicked(QTreeWidgetItem *, int)), + SLOT(OnClickCheckerBundle(QTreeWidgetItem *, int))); + connect(_checkerBox, SIGNAL(itemClicked(QTreeWidgetItem *, int)), SLOT(OnClickChecker(QTreeWidgetItem *, int))); + connect(_issueBox, SIGNAL(itemClicked(QTreeWidgetItem *, int)), SLOT(OnClickIssue(QTreeWidgetItem *, int))); layout->addWidget(splitter); setLayout(layout); @@ -159,7 +160,7 @@ cCheckerWidget::cCheckerWidget(QWidget* parent) : QWidget(parent) _currentResultContainer = nullptr; } -void cCheckerWidget::LoadResultContainer(cResultContainer* const container) +void cCheckerWidget::LoadResultContainer(cResultContainer *const container) { _currentResultContainer = container; @@ -172,7 +173,7 @@ void cCheckerWidget::LoadResultContainer(cResultContainer* const container) } // For initialisation select "Select All" item - QTreeWidgetItem* firstEntry = _checkerBundleBox->topLevelItem(0); + QTreeWidgetItem *firstEntry = _checkerBundleBox->topLevelItem(0); if (nullptr != firstEntry) { _checkerBundleBox->clearSelection(); @@ -181,7 +182,7 @@ void cCheckerWidget::LoadResultContainer(cResultContainer* const container) } } -void cCheckerWidget::LoadCheckerBundles(std::list checkerBundles) const +void cCheckerWidget::LoadCheckerBundles(std::list checkerBundles) const { if (checkerBundles.size() == 0) return; @@ -189,19 +190,20 @@ void cCheckerWidget::LoadCheckerBundles(std::list checkerBundle _checkerBundleBox->clear(); QString strSelectAllItemName; QTextStream tsSelectAllItemName(&strSelectAllItemName); - tsSelectAllItemName << STR_SELECT_ALL_CHECKER_BUNDLE.c_str() << " (" << _currentResultContainer->GetCheckerBundleCount() << " CheckerBundles, " << _currentResultContainer->GetCheckerCount() <<" Checkers, " << _currentResultContainer->GetIssueCount() << " Issues)"; + tsSelectAllItemName << STR_SELECT_ALL_CHECKER_BUNDLE.c_str() << " (" + << _currentResultContainer->GetCheckerBundleCount() << " CheckerBundles, " + << _currentResultContainer->GetCheckerCount() << " Checkers, " + << _currentResultContainer->GetIssueCount() << " Issues)"; // Create select all entry - QTreeWidgetItem* selectAllEntry = new QTreeWidgetItem(_checkerBundleBox); + QTreeWidgetItem *selectAllEntry = new QTreeWidgetItem(_checkerBundleBox); selectAllEntry->setText(1, strSelectAllItemName); selectAllEntry->setSizeHint(0, QSize(35, 30)); selectAllEntry->setIcon(0, QIcon(":/icons/no_params.png")); selectAllEntry->setToolTip(0, "No parameters available."); _checkerBundleBox->addTopLevelItem(selectAllEntry); - for (std::list::const_iterator it = checkerBundles.cbegin(); - it != checkerBundles.cend(); - it++) + for (std::list::const_iterator it = checkerBundles.cbegin(); it != checkerBundles.cend(); it++) { QTreeWidgetItem *newBundleItem = new QTreeWidgetItem(_checkerBundleBox); @@ -210,11 +212,11 @@ void cCheckerWidget::LoadCheckerBundles(std::list checkerBundle } } -void cCheckerWidget::LoadCheckers(std::list checkers) const +void cCheckerWidget::LoadCheckers(std::list checkers) const { _checkerBox->clear(); - for (std::list::const_iterator it = checkers.cbegin(); it != checkers.cend(); it++) + for (std::list::const_iterator it = checkers.cbegin(); it != checkers.cend(); it++) { // Display checkers only if there are more then 0 issues. if ((*it)->GetIssueCount() > 0) @@ -227,11 +229,11 @@ void cCheckerWidget::LoadCheckers(std::list checkers) const } } -void cCheckerWidget::LoadIssues(std::list issues) const +void cCheckerWidget::LoadIssues(std::list issues) const { _issueBox->clear(); - for (std::list::const_iterator it = issues.cbegin(); it != issues.cend(); it++) + for (std::list::const_iterator it = issues.cbegin(); it != issues.cend(); it++) { QTreeWidgetItem *newItem = new QTreeWidgetItem(_issueBox); @@ -243,7 +245,7 @@ void cCheckerWidget::LoadIssues(std::list issues) const if (issues.size() > 0) { - cIssue* firstIssue = issues.front(); + cIssue *firstIssue = issues.front(); SelectIssue(firstIssue); ShowIssue(firstIssue, nullptr); } @@ -251,14 +253,14 @@ void cCheckerWidget::LoadIssues(std::list issues) const _issueBox->expandAll(); } -void cCheckerWidget::FillCheckerBundleTreeItem(QTreeWidgetItem *treeItem, cCheckerBundle* const bundle) const +void cCheckerWidget::FillCheckerBundleTreeItem(QTreeWidgetItem *treeItem, cCheckerBundle *const bundle) const { QString strCheckerBundleItemName; QTextStream tsCheckerBundleItemName(&strCheckerBundleItemName); tsCheckerBundleItemName << bundle->GetBundleName().c_str() << " (" << bundle->GetCheckerCount() - << ((bundle->GetCheckerCount() > 1) ? " Checkers, " : " Checker, ") << - bundle->GetIssueCount() << ((bundle->GetIssueCount() > 1) ? " Issues)" : " Issue)"); + << ((bundle->GetCheckerCount() > 1) ? " Checkers, " : " Checker, ") + << bundle->GetIssueCount() << ((bundle->GetIssueCount() > 1) ? " Issues)" : " Issue)"); treeItem->setText(1, strCheckerBundleItemName); @@ -269,7 +271,7 @@ void cCheckerWidget::FillCheckerBundleTreeItem(QTreeWidgetItem *treeItem, cCheck FillParameters(treeItem, bundle->GetParamContainer()); } -void cCheckerWidget::FillCheckerTreeItem(QTreeWidgetItem *treeItem, cChecker* const checker) const +void cCheckerWidget::FillCheckerTreeItem(QTreeWidgetItem *treeItem, cChecker *const checker) const { QString strCheckerItemName; QTextStream tsCheckerItemName(&strCheckerItemName); @@ -284,7 +286,7 @@ void cCheckerWidget::FillCheckerTreeItem(QTreeWidgetItem *treeItem, cChecker* co FillParameters(treeItem, checker->GetParamContainer()); } -void cCheckerWidget::FillParameters(QTreeWidgetItem *treeItem, cParameterContainer* const params) const +void cCheckerWidget::FillParameters(QTreeWidgetItem *treeItem, cParameterContainer *const params) const { if (params->HasParams()) { @@ -300,10 +302,7 @@ void cCheckerWidget::FillParameters(QTreeWidgetItem *treeItem, cParameterContain for (; itParams != paramNames.end(); itParams++) { - ssParamDetails << endl << "\t" - << (*itParams).c_str() - << " = " - << params->GetParam(*itParams).c_str(); + ssParamDetails << endl << "\t" << (*itParams).c_str() << " = " << params->GetParam(*itParams).c_str(); } treeItem->setToolTip(0, toolTip); @@ -316,7 +315,7 @@ void cCheckerWidget::FillParameters(QTreeWidgetItem *treeItem, cParameterContain } } -void cCheckerWidget::FillIssueTreeItem(QTreeWidgetItem *treeItem, cIssue* const issue) const +void cCheckerWidget::FillIssueTreeItem(QTreeWidgetItem *treeItem, cIssue *const issue) const { treeItem->setToolTip(0, "Identifier"); treeItem->setText(0, QString::number(issue->GetIssueId())); @@ -331,13 +330,13 @@ void cCheckerWidget::FillIssueTreeItem(QTreeWidgetItem *treeItem, cIssue* const for (const auto subIssue : issue->GetLocationsContainer()) { - if (subIssue->HasExtendedInformation() || - subIssue->HasExtendedInformation()) + if (subIssue->HasExtendedInformation() || + subIssue->HasExtendedInformation()) { isVisibleInViewer = true; } - if (subIssue->HasExtendedInformation()) + if (subIssue->HasExtendedInformation()) { isVisibleInFileView = true; } @@ -412,7 +411,7 @@ void cCheckerWidget::FillIssueTreeItem(QTreeWidgetItem *treeItem, cIssue* const } } - QTreeWidgetItem* extendedIssueSubItem = new QTreeWidgetItem(_issueBox); + QTreeWidgetItem *extendedIssueSubItem = new QTreeWidgetItem(_issueBox); extendedIssueSubItem->setData(1, ISSUE_DATA, issue->GetIssueId()); extendedIssueSubItem->setData(1, ISSUE_EXTENDED_DATA, true); @@ -431,15 +430,15 @@ void cCheckerWidget::FillIssueTreeItem(QTreeWidgetItem *treeItem, cIssue* const treeItem->setFirstColumnSpanned(false); } -void cCheckerWidget::SelectCheckerBundle(cCheckerBundle* checkerBundle) const +void cCheckerWidget::SelectCheckerBundle(cCheckerBundle *checkerBundle) const { if (nullptr == checkerBundle) return; for (int i = 0; i < _checkerBundleBox->topLevelItemCount(); ++i) { - QTreeWidgetItem* item = _checkerBundleBox->topLevelItem(i); - cCheckerBundle* checkerBundleData = item->data(0, CHECKER_BUNDLE_DATA).value(); + QTreeWidgetItem *item = _checkerBundleBox->topLevelItem(i); + cCheckerBundle *checkerBundleData = item->data(0, CHECKER_BUNDLE_DATA).value(); if (nullptr == checkerBundleData) continue; @@ -454,15 +453,15 @@ void cCheckerWidget::SelectCheckerBundle(cCheckerBundle* checkerBundle) const } } -void cCheckerWidget::SelectChecker(cChecker* checker) const +void cCheckerWidget::SelectChecker(cChecker *checker) const { if (nullptr == checker) return; for (int i = 0; i < _checkerBox->topLevelItemCount(); ++i) { - QTreeWidgetItem* item = _checkerBox->topLevelItem(i); - cChecker* checkerData = item->data(0, CHECKER_DATA).value(); + QTreeWidgetItem *item = _checkerBox->topLevelItem(i); + cChecker *checkerData = item->data(0, CHECKER_DATA).value(); if (nullptr == checkerData) continue; @@ -477,14 +476,14 @@ void cCheckerWidget::SelectChecker(cChecker* checker) const } } -void cCheckerWidget::SelectIssue(cIssue* issue) const +void cCheckerWidget::SelectIssue(cIssue *issue) const { if (nullptr == issue) return; for (int i = 0; i < _issueBox->topLevelItemCount(); ++i) { - QTreeWidgetItem* item = _issueBox->topLevelItem(i); + QTreeWidgetItem *item = _issueBox->topLevelItem(i); if (item->data(1, ISSUE_DATA).toLongLong() == issue->GetIssueId()) { @@ -496,8 +495,7 @@ void cCheckerWidget::SelectIssue(cIssue* issue) const } } - -void cCheckerWidget::OnClickCheckerBundle(QTreeWidgetItem* item, int) +void cCheckerWidget::OnClickCheckerBundle(QTreeWidgetItem *item, int) { QString itemName = item->text(1); @@ -507,8 +505,8 @@ void cCheckerWidget::OnClickCheckerBundle(QTreeWidgetItem* item, int) LoadAllItems(); _checkerBundleBox->clearSelection(); - QTreeWidgetItem* firstEntry = _checkerBundleBox->topLevelItem(0); - if(nullptr != firstEntry) + QTreeWidgetItem *firstEntry = _checkerBundleBox->topLevelItem(0); + if (nullptr != firstEntry) _checkerBundleBox->setItemSelected(firstEntry, true); } // Ortherwise @@ -517,28 +515,28 @@ void cCheckerWidget::OnClickCheckerBundle(QTreeWidgetItem* item, int) if (nullptr == _currentResultContainer) return; - cCheckerBundle* checkerBundleData = item->data(0, CHECKER_BUNDLE_DATA).value(); + cCheckerBundle *checkerBundleData = item->data(0, CHECKER_BUNDLE_DATA).value(); if (nullptr == checkerBundleData) return; - std::list resultCheckers = _currentResultContainer->GetCheckers(checkerBundleData->GetBundleName()); - std::list resultIssues = _currentResultContainer->GetIssues(resultCheckers); + std::list resultCheckers = _currentResultContainer->GetCheckers(checkerBundleData->GetBundleName()); + std::list resultIssues = _currentResultContainer->GetIssues(resultCheckers); LoadCheckers(resultCheckers); LoadIssues(resultIssues); } } -void cCheckerWidget::OnClickChecker(QTreeWidgetItem* item, int) +void cCheckerWidget::OnClickChecker(QTreeWidgetItem *item, int) { if (nullptr == _currentResultContainer) return; - cChecker* checker = item->data(0, CHECKER_DATA).value(); + cChecker *checker = item->data(0, CHECKER_DATA).value(); if (nullptr != checker) { - std::list resultIssues = _currentResultContainer->GetIssues(checker); + std::list resultIssues = _currentResultContainer->GetIssues(checker); LoadIssues(resultIssues); if (nullptr != checker->GetCheckerBundle()) @@ -548,13 +546,13 @@ void cCheckerWidget::OnClickChecker(QTreeWidgetItem* item, int) } } -void cCheckerWidget::OnClickIssue(QTreeWidgetItem* item, int col) +void cCheckerWidget::OnClickIssue(QTreeWidgetItem *item, int col) { if (nullptr == _currentResultContainer) return; // Retrieve the issue - cIssue* issue = _currentResultContainer->GetIssueById(item->data(1, ISSUE_DATA).toLongLong()); + cIssue *issue = _currentResultContainer->GetIssueById(item->data(1, ISSUE_DATA).toLongLong()); if (nullptr != issue) { @@ -562,8 +560,8 @@ void cCheckerWidget::OnClickIssue(QTreeWidgetItem* item, int col) if (item->data(1, ISSUE_EXTENDED_DATA).toBool()) { int clickedLocation = item->data(1, ISSUE_ORDER).toInt(); - QMap> groupedExpandedtems; - cLocationsContainer* locationPtr = nullptr; + QMap> groupedExpandedtems; + cLocationsContainer *locationPtr = nullptr; // locationscontainer has a LIST... so we can't just use []operator here *doh* int i = 0; @@ -571,7 +569,7 @@ void cCheckerWidget::OnClickIssue(QTreeWidgetItem* item, int col) { if (location->HasExtendedInformations() && i == clickedLocation) { - groupedExpandedtems[i] = QList(); + groupedExpandedtems[i] = QList(); for (auto xItem : location->GetExtendedInformations()) { groupedExpandedtems[i].append(xItem); @@ -587,7 +585,8 @@ void cCheckerWidget::OnClickIssue(QTreeWidgetItem* item, int col) } else { - std::cout << "Cannot find extended information group with identifier. Abort." << clickedLocation << std::endl; + std::cout << "Cannot find extended information group with identifier. Abort." << clickedLocation + << std::endl; } } else @@ -595,14 +594,14 @@ void cCheckerWidget::OnClickIssue(QTreeWidgetItem* item, int col) } } - -void cCheckerWidget::ShowIssue(cIssue* const itemToShow, const cLocationsContainer* locationToShow, QList const extendedInformationGroup) const +void cCheckerWidget::ShowIssue(cIssue *const itemToShow, const cLocationsContainer *locationToShow, + QList const extendedInformationGroup) const { if (nullptr != itemToShow) { bool hasXODRPath = false; bool hasXOSCPath = false; - cChecker* checker = itemToShow->GetChecker(); + cChecker *checker = itemToShow->GetChecker(); ShowDetails(itemToShow); @@ -610,7 +609,7 @@ void cCheckerWidget::ShowIssue(cIssue* const itemToShow, const cLocationsContain { SelectChecker(checker); - cCheckerBundle* checkerBundle = checker->GetCheckerBundle(); + cCheckerBundle *checkerBundle = checker->GetCheckerBundle(); SelectCheckerBundle(checkerBundle); if (checkerBundle->GetXODRFilePath() != "") @@ -623,12 +622,12 @@ void cCheckerWidget::ShowIssue(cIssue* const itemToShow, const cLocationsContain // Evaluate extended information groups for more sophisticated reports if (extendedInformationGroup.count() > 0) { - for (cExtendedInformation* extInfo : extendedInformationGroup) + for (cExtendedInformation *extInfo : extendedInformationGroup) { // Show File-Locations - if (extInfo->IsType()) + if (extInfo->IsType()) { - cFileLocation* fileLocation = ((cFileLocation*)extInfo); + cFileLocation *fileLocation = ((cFileLocation *)extInfo); int row = fileLocation->GetRow(); @@ -642,8 +641,7 @@ void cCheckerWidget::ShowIssue(cIssue* const itemToShow, const cLocationsContain } // Show RoadLocations and InertialLocations in Viewer - if (extInfo->IsType() || - extInfo->IsType()) + if (extInfo->IsType() || extInfo->IsType()) { ShowIssueIn3DViewer(itemToShow, locationToShow); } @@ -665,19 +663,19 @@ void cCheckerWidget::ShowIssue(cIssue* const itemToShow, const cLocationsContain } } -void cCheckerWidget::ShowDetails(cIssue* const itemToShow) const +void cCheckerWidget::ShowDetails(cIssue *const itemToShow) const { if (nullptr != itemToShow) { QString result; QTextStream ssDetails(&result); - cChecker* checker = itemToShow->GetChecker(); + cChecker *checker = itemToShow->GetChecker(); if (nullptr != checker) { - cCheckerBundle* checkerBundle = itemToShow->GetChecker()->GetCheckerBundle(); + cCheckerBundle *checkerBundle = itemToShow->GetChecker()->GetCheckerBundle(); - if(nullptr != checkerBundle) + if (nullptr != checkerBundle) { ssDetails << "CheckerBundle: \t" << checkerBundle->GetBundleName().c_str() << endl; ssDetails << "Build date:\t\t" << checkerBundle->GetBuildDate().c_str() << endl; @@ -692,14 +690,14 @@ void cCheckerWidget::ShowDetails(cIssue* const itemToShow) const std::vector checkerBundleParams = checkerBundle->GetParams(); std::vector::const_iterator itCheckerBundleParams = checkerBundleParams.begin(); - ssDetails << (*itCheckerBundleParams).c_str() << " = " << checkerBundle->GetParam(*itCheckerBundleParams).c_str(); + ssDetails << (*itCheckerBundleParams).c_str() << " = " + << checkerBundle->GetParam(*itCheckerBundleParams).c_str(); itCheckerBundleParams++; for (; itCheckerBundleParams != checkerBundleParams.end(); itCheckerBundleParams++) { - ssDetails << "\n\t\t\t\t" << (*itCheckerBundleParams).c_str() - << " = " - << checkerBundle->GetParam(*itCheckerBundleParams).c_str(); + ssDetails << "\n\t\t\t\t" << (*itCheckerBundleParams).c_str() << " = " + << checkerBundle->GetParam(*itCheckerBundleParams).c_str(); } ssDetails << endl; } @@ -721,9 +719,8 @@ void cCheckerWidget::ShowDetails(cIssue* const itemToShow) const for (; itCheckerParams != checkerParams.end(); itCheckerParams++) { - ssDetails << "\n\t\t\t\t" << (*itCheckerParams).c_str() - << " = " - << checker->GetParam(*itCheckerParams).c_str(); + ssDetails << "\n\t\t\t\t" << (*itCheckerParams).c_str() << " = " + << checker->GetParam(*itCheckerParams).c_str(); } ssDetails << endl; } @@ -740,47 +737,45 @@ void cCheckerWidget::LoadAllItems() const if (nullptr == _currentResultContainer) return; - std::list checkerBundles = _currentResultContainer->GetCheckerBundles(); - std::list checkers = _currentResultContainer->GetCheckers(); - std::list issues = _currentResultContainer->GetIssues(); + std::list checkerBundles = _currentResultContainer->GetCheckerBundles(); + std::list checkers = _currentResultContainer->GetCheckers(); + std::list issues = _currentResultContainer->GetIssues(); LoadCheckerBundles(checkerBundles); LoadCheckers(checkers); LoadIssues(issues); } -void cCheckerWidget::PrintExtendedInformationIntoStream(cExtendedInformation* item, std::stringstream* ssStream) const +void cCheckerWidget::PrintExtendedInformationIntoStream(cExtendedInformation *item, std::stringstream *ssStream) const { - if (item->IsType()) + if (item->IsType()) { - cFileLocation* fileLoc = (cFileLocation*)item; + cFileLocation *fileLoc = (cFileLocation *)item; *ssStream << std::endl << " File: row=" << fileLoc->GetRow() << " column=" << fileLoc->GetColumn(); } - else if (item->IsType()) + else if (item->IsType()) { - cXMLLocation* xmlLoc = (cXMLLocation*)item; + cXMLLocation *xmlLoc = (cXMLLocation *)item; *ssStream << std::endl << " XPath: " << xmlLoc->GetXPath(); } - else if (item->IsType()) + else if (item->IsType()) { - cRoadLocation* roadLoc = (cRoadLocation*)item; + cRoadLocation *roadLoc = (cRoadLocation *)item; ssStream->setf(std::ios::fixed, std::ios::floatfield); *ssStream << std::endl - << " Road: id=" << roadLoc->GetRoadID() << " s=" << std::setprecision(2) - << roadLoc->GetS() << " t=" << std::setprecision(2) << roadLoc->GetT(); + << " Road: id=" << roadLoc->GetRoadID() << " s=" << std::setprecision(2) << roadLoc->GetS() + << " t=" << std::setprecision(2) << roadLoc->GetT(); } - else if (item->IsType()) + else if (item->IsType()) { - cInertialLocation* initialLoc = (cInertialLocation*)item; + cInertialLocation *initialLoc = (cInertialLocation *)item; ssStream->setf(std::ios::fixed, std::ios::floatfield); *ssStream << std::endl - << " Location: x=" << std::setprecision(2) << initialLoc->GetX() - << " y=" << std::setprecision(2) << initialLoc->GetY() - << " z=" << std::setprecision(2) << initialLoc->GetZ() - << " heading=" << std::setprecision(2) << initialLoc->GetHead() - << " pitch=" << std::setprecision(2) << initialLoc->GetPitch() - << " roll=" << std::setprecision(2) << initialLoc->GetRoll(); + << " Location: x=" << std::setprecision(2) << initialLoc->GetX() << " y=" << std::setprecision(2) + << initialLoc->GetY() << " z=" << std::setprecision(2) << initialLoc->GetZ() + << " heading=" << std::setprecision(2) << initialLoc->GetHead() << " pitch=" << std::setprecision(2) + << initialLoc->GetPitch() << " roll=" << std::setprecision(2) << initialLoc->GetRoll(); } -} \ No newline at end of file +} diff --git a/src/report_modules/report_module_gui/src/ui/c_checker_widget.h b/src/report_modules/report_module_gui/src/ui/c_checker_widget.h new file mode 100644 index 00000000..76478aa0 --- /dev/null +++ b/src/report_modules/report_module_gui/src/ui/c_checker_widget.h @@ -0,0 +1,139 @@ +/* + * Copyright 2023 CARIAD SE. + * + * This Source Code Form is subject to the terms of the Mozilla + * Public License, v. 2.0. If a copy of the MPL was not distributed + * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ +#ifndef CHECKER_WIDGET_H +#define CHECKER_WIDGET_H + +#include +#include + +#include + +class QTreeWidget; +class QTreeWidgetItem; +class QTextEdit; + +class cIssue; +class cChecker; +class cCheckerBundle; +class cExtendedInformation; +class cParameterContainer; +class cLocationsContainer; +class cResultContainer; + +Q_DECLARE_OPAQUE_POINTER(cChecker *) +Q_DECLARE_OPAQUE_POINTER(cCheckerBundle *) +Q_DECLARE_OPAQUE_POINTER(cExtendedInformation *) + +Q_DECLARE_METATYPE(cChecker *) +Q_DECLARE_METATYPE(cCheckerBundle *) +Q_DECLARE_METATYPE(cExtendedInformation *) + +class cCheckerWidget : public QWidget +{ + Q_OBJECT + + public: + static const unsigned int ISSUE_DATA = Qt::UserRole + 1; + static const unsigned int CHECKER_DATA = Qt::UserRole + 2; + static const unsigned int CHECKER_BUNDLE_DATA = Qt::UserRole + 3; + static const unsigned int ISSUE_EXTENDED_DATA = Qt::UserRole + 4; + static const unsigned int ISSUE_EXTENDED_DESCRIPTION = Qt::UserRole + 5; + static const unsigned int ISSUE_ORDER = Qt::UserRole + 6; + + cCheckerWidget(QWidget *parent = 0); + + void LoadResultContainer(cResultContainer *const container); + + protected: + // Loads a list of cCheckerBundles to the widget view. + void LoadCheckerBundles(std::list checkerBundles) const; + + // Selects a given cCheckerBundle in the widget view. + void SelectCheckerBundle(cCheckerBundle *checkerBundle) const; + + // Loads a list of cChecker to the widget view. + void LoadCheckers(std::list checkers) const; + + // Selects a given cChecker in the widget view. + void SelectChecker(cChecker *checker) const; + + // Selects a given cIssue in the widget view. + void SelectIssue(cIssue *issue) const; + + // Loads a list of cIssues to the widget view. + void LoadIssues(std::list issues) const; + + // Reset the widget view to default + void LoadAllItems() const; + + // Shows an Issue and marks the problems in the XML view and shows the issue in the 3D Viewer + // \param itemToShow : The item to show + // \param extInfo : The group of extended items to be showed. + void ShowIssue(cIssue *const itemToShow, const cLocationsContainer *locationToShow, + QList const extInfoDescr = {}) const; + + // Show details of an issue + void ShowDetails(cIssue *const itemToShow) const; + + protected: + // Fills an issue tree item + void FillIssueTreeItem(QTreeWidgetItem *treeItem, cIssue *const issue) const; + + // Fills an checker Bundle tree item + void FillCheckerBundleTreeItem(QTreeWidgetItem *treeItem, cCheckerBundle *const bundle) const; + + // Fills an checker tree item + void FillCheckerTreeItem(QTreeWidgetItem *treeItem, cChecker *const checker) const; + + // Fills an item with parameter information + void FillParameters(QTreeWidgetItem *treeItem, cParameterContainer *const params) const; + + private: + QTreeWidget *_checkerBundleBox{nullptr}; + QTreeWidget *_checkerBox{nullptr}; + QTreeWidget *_issueBox{nullptr}; + QTextEdit *_issueDetailsTextWidget{nullptr}; + + cResultContainer *_currentResultContainer{nullptr}; + + const std::string STR_SELECT_ALL_CHECKER_BUNDLE = "Select All"; + + // Prints extended informations into a stream + void PrintExtendedInformationIntoStream(cExtendedInformation *item, std::stringstream *ssStream) const; + public slots: + // OnClick event for cCheckerBundle widget view + void OnClickCheckerBundle(QTreeWidgetItem *item, int); + + // OnClick event for cChecker widget view + void OnClickChecker(QTreeWidgetItem *item, int); + + // OnClick event for cIssues widget view + void OnClickIssue(QTreeWidgetItem *item, int); + signals: + // Invoked if an resultcontainer has to be loaded + void Load(cResultContainer *const resiltContainer) const; + + /* + * Invoked if an issue will be showed. + * \param row: Row which should be displayed. -1 for no specific row. + */ + void ShowXODRIssue(const cIssue *const issue, const int row) const; + + /* + * Invoked if an issue will be showed. + * \param row: Row which should be displayed. -1 for no specific row. + */ + void ShowXOSCIssue(const cIssue *const issue, const int row) const; + + /* + * Invoked if an issue should be showed in 3DViewer. + */ + void ShowIssueIn3DViewer(const cIssue *const issue, const cLocationsContainer *locationToShow) const; +}; + +#endif diff --git a/src/report_modules/report_module_gui/src/ui/cReportModuleWindow.cpp b/src/report_modules/report_module_gui/src/ui/c_report_module_window.cpp similarity index 80% rename from src/report_modules/report_module_gui/src/ui/cReportModuleWindow.cpp rename to src/report_modules/report_module_gui/src/ui/c_report_module_window.cpp index b7e608a5..15063b9d 100644 --- a/src/report_modules/report_module_gui/src/ui/cReportModuleWindow.cpp +++ b/src/report_modules/report_module_gui/src/ui/c_report_module_window.cpp @@ -11,27 +11,28 @@ #include #endif -#include "cReportModuleWindow.h" +#include "c_report_module_window.h" #include -#include "cXODREditorWidget.h" -#include "cXOSCEditorWidget.h" -#include "cCheckerWidget.h" +#include "c_checker_widget.h" +#include "c_xodr_editor_widget.h" +#include "c_xosc_editor_widget.h" -#include "common/result_format/cCheckerBundle.h" -#include "common/result_format/cResultContainer.h" -#include "common/result_format/cLocationsContainer.h" +#include "common/result_format/c_checker_bundle.h" +#include "common/result_format/c_locations_container.h" +#include "common/result_format/c_result_container.h" -#include +#include #include -#include -#include #include -#include -#include #include +#include +#include +#include +#include -cReportModuleWindow::cReportModuleWindow(cResultContainer *resultContainer, const std::string& reportModuleName, QWidget*) +cReportModuleWindow::cReportModuleWindow(cResultContainer *resultContainer, const std::string &reportModuleName, + QWidget *) { _results = resultContainer; _reportModuleName = QString::fromStdString(reportModuleName); @@ -111,11 +112,12 @@ cReportModuleWindow::cReportModuleWindow(cResultContainer *resultContainer, cons msgBox.setWindowTitle(this->_reportModuleName + " Error"); msgBox.setStandardButtons(QMessageBox::Ok); - //Load the DLL + // Load the DLL #ifdef WIN32 auto viewer_dll = LoadLibrary(viewer_list.at(i).absoluteFilePath().toStdString().c_str()); #else - auto viewer_dll = dlopen(viewer_list.at(i).absoluteFilePath().toStdString().c_str(), RTLD_NOW | RTLD_GLOBAL); + auto viewer_dll = + dlopen(viewer_list.at(i).absoluteFilePath().toStdString().c_str(), RTLD_NOW | RTLD_GLOBAL); #endif if (!viewer_dll) @@ -125,7 +127,8 @@ cReportModuleWindow::cReportModuleWindow(cResultContainer *resultContainer, cons #else QString error = dlerror(); #endif - QString text = QString("Could not load viewer (%1). Error (%2). Abort.").arg(viewer_list.at(i).baseName(), error); + QString text = + QString("Could not load viewer (%1). Error (%2). Abort.").arg(viewer_list.at(i).baseName(), error); msgBox.setText(text); msgBox.exec(); break; @@ -140,7 +143,8 @@ cReportModuleWindow::cReportModuleWindow(cResultContainer *resultContainer, cons if (!viewerEntries[i]->StartViewer_f) { - QString text = QString("Could not locate the function StartViewer (%1). Abort.").arg(viewer_list.at(i).baseName()); + QString text = + QString("Could not locate the function StartViewer (%1). Abort.").arg(viewer_list.at(i).baseName()); msgBox.setText(text); msgBox.exec(); break; @@ -155,7 +159,8 @@ cReportModuleWindow::cReportModuleWindow(cResultContainer *resultContainer, cons if (!viewerEntries[i]->Initialize_f) { - QString text = QString("Could not locate the function Initialize (%1). Abort.").arg(viewer_list.at(i).baseName()); + QString text = + QString("Could not locate the function Initialize (%1). Abort.").arg(viewer_list.at(i).baseName()); msgBox.setText(text); msgBox.exec(); break; @@ -170,7 +175,8 @@ cReportModuleWindow::cReportModuleWindow(cResultContainer *resultContainer, cons if (!viewerEntries[i]->AddIssue_f) { - QString text = QString("Could not locate the function AddIssue (%1). Abort.").arg(viewer_list.at(i).baseName()); + QString text = + QString("Could not locate the function AddIssue (%1). Abort.").arg(viewer_list.at(i).baseName()); msgBox.setText(text); msgBox.exec(); break; @@ -185,7 +191,8 @@ cReportModuleWindow::cReportModuleWindow(cResultContainer *resultContainer, cons if (!viewerEntries[i]->ShowIssue_f) { - QString text = QString("Could not locate the function ShowIssue (%1). Abort.").arg(viewer_list.at(i).baseName()); + QString text = + QString("Could not locate the function ShowIssue (%1). Abort.").arg(viewer_list.at(i).baseName()); msgBox.setText(text); msgBox.exec(); break; @@ -200,7 +207,8 @@ cReportModuleWindow::cReportModuleWindow(cResultContainer *resultContainer, cons if (!viewerEntries[i]->GetName_f) { - QString text = QString("Could not locate the function GetName (%1). Abort.").arg(viewer_list.at(i).baseName()); + QString text = + QString("Could not locate the function GetName (%1). Abort.").arg(viewer_list.at(i).baseName()); msgBox.setText(text); msgBox.exec(); break; @@ -215,7 +223,8 @@ cReportModuleWindow::cReportModuleWindow(cResultContainer *resultContainer, cons if (!viewerEntries[i]->CloseViewer_f) { - QString text = QString("Could not locate the function CloseViewer (%1). Abort.").arg(viewer_list.at(i).baseName()); + QString text = + QString("Could not locate the function CloseViewer (%1). Abort.").arg(viewer_list.at(i).baseName()); msgBox.setText(text); msgBox.exec(); break; @@ -223,14 +232,16 @@ cReportModuleWindow::cReportModuleWindow(cResultContainer *resultContainer, cons // resolve function address GetLastErrorMessage here #ifdef WIN32 - viewerEntries[i]->GetLastErrorMessage_f = (GetLastErrorMessage_ptr)GetProcAddress(viewer_dll, "GetLastErrorMessage"); + viewerEntries[i]->GetLastErrorMessage_f = + (GetLastErrorMessage_ptr)GetProcAddress(viewer_dll, "GetLastErrorMessage"); #else viewerEntries[i]->GetLastErrorMessage_f = (GetLastErrorMessage_ptr)dlsym(viewer_dll, "GetLastErrorMessage"); #endif if (!viewerEntries[i]->GetLastErrorMessage_f) { - QString text = QString("Could not locate the function GetLastErrorMessage (%1). Abort.").arg(viewer_list.at(i).baseName()); + QString text = QString("Could not locate the function GetLastErrorMessage (%1). Abort.") + .arg(viewer_list.at(i).baseName()); msgBox.setText(text); msgBox.exec(); break; @@ -241,9 +252,7 @@ cReportModuleWindow::cReportModuleWindow(cResultContainer *resultContainer, cons QAction *openViewer = new QAction(fileMenuViewerEntry, this); openViewer->setStatusTip(fileMenuViewerEntry); - connect(openViewer, &QAction::triggered, this, [=]() { - this->StartViewer(viewerEntries[i].get()); - }); + connect(openViewer, &QAction::triggered, this, [=]() { this->StartViewer(viewerEntries[i].get()); }); viewerEntries[i]->associatedAction = openViewer; _subMenu->addAction(openViewer); @@ -263,8 +272,7 @@ void cReportModuleWindow::LoadResultContainer(cResultContainer *const container) QMap fileReplacementMap; std::list bundles = container->GetCheckerBundles(); - for (std::list::const_iterator itBundle = bundles.cbegin(); - itBundle != bundles.cend(); + for (std::list::const_iterator itBundle = bundles.cbegin(); itBundle != bundles.cend(); itBundle++) { ValidateInputFile(*itBundle, &fileReplacementMap, "XodrFile", "OpenDRIVE", "OpenDRIVE (*.xodr)"); @@ -275,9 +283,7 @@ void cReportModuleWindow::LoadResultContainer(cResultContainer *const container) std::string xodrFilePath = container->GetXODRFilePath(); // Check if we have an OpenSCENARIO and no OpenDRIVE given - if (container->GetCheckerBundleCount() > 0 && - xoscFilePath.length() > 0 && - xodrFilePath.length() == 0) + if (container->GetCheckerBundleCount() > 0 && xoscFilePath.length() > 0 && xodrFilePath.length() == 0) { // Retrive OpenDRIVE file from scenario and add it to the first bundle if (GetXodrFilePathFromXosc(xoscFilePath, xodrFilePath)) @@ -291,11 +297,9 @@ void cReportModuleWindow::LoadResultContainer(cResultContainer *const container) _checkerWidget->LoadResultContainer(container); } -void cReportModuleWindow::ValidateInputFile(cCheckerBundle* const bundle, - QMap* fileReplacementMap, - const std::string& parameter, - const std::string& fileName, - const std::string& filter) const +void cReportModuleWindow::ValidateInputFile(cCheckerBundle *const bundle, QMap *fileReplacementMap, + const std::string ¶meter, const std::string &fileName, + const std::string &filter) const { std::string filePath = bundle->GetParam(parameter); @@ -309,9 +313,7 @@ void cReportModuleWindow::ValidateInputFile(cCheckerBundle* const bundle, QMessageBox msgBox; std::stringstream ssDesc; - ssDesc << bundle->GetBundleName() << ": File could not be opened:\n" - << filePath << std::endl - << std::endl; + ssDesc << bundle->GetBundleName() << ": File could not be opened:\n" << filePath << std::endl << std::endl; ssDesc << "Do you like to choose a corresponding file?"; msgBox.setWindowTitle(_reportModuleName + " Error"); @@ -322,10 +324,7 @@ void cReportModuleWindow::ValidateInputFile(cCheckerBundle* const bundle, if (messageBoxReturn == QMessageBox::Yes) { - QString xodrFilePath = QFileDialog::getOpenFileName(nullptr, - fileName.c_str(), - "", - filter.c_str()); + QString xodrFilePath = QFileDialog::getOpenFileName(nullptr, fileName.c_str(), "", filter.c_str()); if (!xodrFilePath.isEmpty()) { @@ -338,22 +337,19 @@ void cReportModuleWindow::ValidateInputFile(cCheckerBundle* const bundle, void cReportModuleWindow::OpenResultFile() { - QString filePath = QFileDialog::getOpenFileName(this, - tr("Open File"), - "", - "XODR checker results (*.xqar)"); + QString filePath = QFileDialog::getOpenFileName(this, tr("Open File"), "", "XODR checker results (*.xqar)"); if (!filePath.isNull()) { - //clear old results + // clear old results _results->Clear(); - //load new one + // load new one _results->AddResultsFromXML(filePath.toUtf8().constData()); LoadResultContainer(_results); } } -void cReportModuleWindow::StartViewer(Viewer* viewer) +void cReportModuleWindow::StartViewer(Viewer *viewer) { if (_viewerActive != nullptr) { @@ -361,7 +357,8 @@ void cReportModuleWindow::StartViewer(Viewer* viewer) if (!_viewerActive->CloseViewer_f()) { std::string error(_viewerActive->GetLastErrorMessage_f()); - std::cout << "Closing the viewer " << _viewerActive->GetName_f() << " failed, error: " << error << std::endl; + std::cout << "Closing the viewer " << _viewerActive->GetName_f() << " failed, error: " << error + << std::endl; } _viewerActive = nullptr; @@ -372,9 +369,7 @@ void cReportModuleWindow::StartViewer(Viewer* viewer) msgBox.setStandardButtons(QMessageBox::Ok); // Start viewer when we have an OpenDRIVE or an OpenSCENARIO - if (_results != nullptr && - (_results->HasXODRFileName() || - _results->HasXOSCFilePath())) + if (_results != nullptr && (_results->HasXODRFileName() || _results->HasXOSCFilePath())) { setCursor(Qt::WaitCursor); QApplication::processEvents(); @@ -404,7 +399,7 @@ void cReportModuleWindow::StartViewer(Viewer* viewer) // Add issues to viewer auto issues = _results->GetIssues(_results->GetCheckers(NULL)); - for (const auto& issue : issues) + for (const auto &issue : issues) { result = viewer->AddIssue_f(issue); @@ -429,27 +424,29 @@ void cReportModuleWindow::StartViewer(Viewer* viewer) } } -void cReportModuleWindow::ShowIssueInViewer(const cIssue* const issue, const cLocationsContainer* locationToShow) +void cReportModuleWindow::ShowIssueInViewer(const cIssue *const issue, const cLocationsContainer *locationToShow) { QMessageBox msgBox; msgBox.setWindowTitle(this->_reportModuleName + " Error"); msgBox.setStandardButtons(QMessageBox::Ok); - if (_viewerActive != nullptr) { + if (_viewerActive != nullptr) + { bool result = _viewerActive->ShowIssue_f(issue, locationToShow); if (!result) { - QString errormsg = QString("Show issue failed, abort. Error msg: ") + _viewerActive->GetLastErrorMessage_f(); + QString errormsg = + QString("Show issue failed, abort. Error msg: ") + _viewerActive->GetLastErrorMessage_f(); msgBox.setText(errormsg); msgBox.exec(); } } } -void cReportModuleWindow::closeEvent(QCloseEvent*) +void cReportModuleWindow::closeEvent(QCloseEvent *) { for (uint32_t i = 0; i < viewerEntries.size(); i++) { viewerEntries[i]->CloseViewer_f(); } -} \ No newline at end of file +} diff --git a/src/report_modules/report_module_gui/src/ui/c_report_module_window.h b/src/report_modules/report_module_gui/src/ui/c_report_module_window.h new file mode 100644 index 00000000..3d7a9a55 --- /dev/null +++ b/src/report_modules/report_module_gui/src/ui/c_report_module_window.h @@ -0,0 +1,98 @@ +/* + * Copyright 2023 CARIAD SE. + * + * This Source Code Form is subject to the terms of the Mozilla + * Public License, v. 2.0. If a copy of the MPL was not distributed + * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ +#pragma once + +#include +#include +#include + +#include +#include +#include + +#include "common/result_format/c_issue.h" + +class cCheckerBundle; +class cCheckerWidget; +class cXODREditorWidget; +class cXOSCEditorWidget; +class cResultContainer; +class cLocationsContainer; + +class QActionGroup; +class QMenu; +class QAction; + +class cReportModuleWindow : public QMainWindow +{ + Q_OBJECT + + protected: + cResultContainer *_results{nullptr}; + + QString _reportModuleName; + QMenu *_fileMenu{nullptr}; + QMenu *_subMenu{nullptr}; + + cXODREditorWidget *_xodrEditorWidget{nullptr}; + cXOSCEditorWidget *_xoscEditorWidget{nullptr}; + cCheckerWidget *_checkerWidget{nullptr}; + + // Function pointers for functions of IConnector.h + typedef bool (*StartViewer_ptr)(); + typedef bool (*Initialize_ptr)(const char *, const char *); + typedef bool (*AddIssue_ptr)(const void *); + typedef bool (*ShowIssue_ptr)(const void *, const void *); + typedef const char *(*GetName_ptr)(); + typedef bool (*CloseViewer_ptr)(); + typedef const char *(*GetLastErrorMessage_ptr)(); + + struct Viewer + { + StartViewer_ptr StartViewer_f{nullptr}; + Initialize_ptr Initialize_f{nullptr}; + AddIssue_ptr AddIssue_f{nullptr}; + ShowIssue_ptr ShowIssue_f{nullptr}; + GetName_ptr GetName_f{nullptr}; + CloseViewer_ptr CloseViewer_f{nullptr}; + GetLastErrorMessage_ptr GetLastErrorMessage_f{nullptr}; + QAction *associatedAction{nullptr}; + }; + + std::vector> viewerEntries; + Viewer *_viewerActive{nullptr}; + + public: + cReportModuleWindow() = delete; + cReportModuleWindow(cReportModuleWindow &&) = delete; + cReportModuleWindow(const cReportModuleWindow &) = delete; + explicit cReportModuleWindow(cResultContainer *container, const std::string &reportModuleName, QWidget *parent = 0); + + virtual ~cReportModuleWindow() = default; + + // Loads the result container + void LoadResultContainer(cResultContainer *const container) const; + + private slots: + // Open result file + void OpenResultFile(); + + // starts the Viewer + void StartViewer(Viewer *viewer); + + // shows a XODR Issue in a viewer if available + void ShowIssueInViewer(const cIssue *const issue, const cLocationsContainer *locationToShow); + + private: + // Handle application close + void closeEvent(QCloseEvent *bar); + + // Checks if the OpenDRIVE or OpenSCENARIO could be loaded + void ValidateInputFile(cCheckerBundle *const bundle, QMap *fileReplacementMap, + const std::string ¶meter, const std::string &fileName, const std::string &filter) const; +}; diff --git a/src/report_modules/report_module_gui/src/ui/cXMLCodeEditor.cpp b/src/report_modules/report_module_gui/src/ui/c_xml_code_editor.cpp similarity index 83% rename from src/report_modules/report_module_gui/src/ui/cXMLCodeEditor.cpp rename to src/report_modules/report_module_gui/src/ui/c_xml_code_editor.cpp index 35961240..f69ee62a 100644 --- a/src/report_modules/report_module_gui/src/ui/cXMLCodeEditor.cpp +++ b/src/report_modules/report_module_gui/src/ui/c_xml_code_editor.cpp @@ -32,9 +32,9 @@ * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "cXMLCodeEditor.h" +#include "c_xml_code_editor.h" -cXMLCodeEditor::cXMLCodeEditor(QTabWidget* tab, QWidget* parent) : _tabWidget(tab) +cXMLCodeEditor::cXMLCodeEditor(QTabWidget *tab, QWidget *parent) : _tabWidget(tab) { _currentMarkerRow = 0; @@ -67,7 +67,7 @@ cXMLCodeEditor::~cXMLCodeEditor() } // Sets the text on the editor window -void cXMLCodeEditor::SetText(const QString& text) +void cXMLCodeEditor::SetText(const QString &text) { blockSignals(true); setPlainText(text); @@ -77,7 +77,7 @@ void cXMLCodeEditor::SetText(const QString& text) } // Paints the lins number are -void cXMLCodeEditor::LineNumberAreaPaintEvent(QPaintEvent* event) +void cXMLCodeEditor::LineNumberAreaPaintEvent(QPaintEvent *event) { QPainter painter(_lineNumberArea); QBrush backgroundMarkerBrush; @@ -91,21 +91,23 @@ void cXMLCodeEditor::LineNumberAreaPaintEvent(QPaintEvent* event) int top = (int)blockBoundingGeometry(block).translated(contentOffset()).top(); int bottom = top + (int)blockBoundingRect(block).height(); - while (block.isValid() && top <= event->rect().bottom()) { - if (block.isVisible() && bottom >= event->rect().top()) { + while (block.isValid() && top <= event->rect().bottom()) + { + if (block.isVisible() && bottom >= event->rect().top()) + { QString number = QString::number(blockNumber + 1); - if (_currentMarkerRow == blockNumber + 1) { + if (_currentMarkerRow == blockNumber + 1) + { painter.setPen(Qt::red); painter.setFont(_boldFont); - painter.drawText( - 0, top, _lineNumberArea->width(), _metrics->height(), Qt::AlignRight, number); + painter.drawText(0, top, _lineNumberArea->width(), _metrics->height(), Qt::AlignRight, number); } - else { + else + { painter.setPen(Qt::black); painter.setFont(_normalFont); - painter.drawText( - 0, top, _lineNumberArea->width(), _metrics->height(), Qt::AlignRight, number); + painter.drawText(0, top, _lineNumberArea->width(), _metrics->height(), Qt::AlignRight, number); } } @@ -120,7 +122,8 @@ int cXMLCodeEditor::LineNumberAreaWidth() const { int digits = 1; int max = qMax(1, blockCount()); - while (max >= 10) { + while (max >= 10) + { max /= 10; ++digits; } @@ -130,11 +133,12 @@ int cXMLCodeEditor::LineNumberAreaWidth() const return qMax(3, space); } -void cXMLCodeEditor::UpdateLineNumberArea(const QRect& rect, int dy) +void cXMLCodeEditor::UpdateLineNumberArea(const QRect &rect, int dy) { if (dy) _lineNumberArea->scroll(0, dy); - else { + else + { _lineNumberArea->update(0, rect.y(), _lineNumberArea->width(), rect.height()); } @@ -149,8 +153,9 @@ void cXMLCodeEditor::UpdateLineNumberAreaWidth(int /* newBlockCount */) void cXMLCodeEditor::SetMarker(unsigned newRow) { - if (newRow != _currentMarkerRow) { + if (newRow != _currentMarkerRow) + { _currentMarkerRow = newRow; repaint(); } -} \ No newline at end of file +} diff --git a/src/report_modules/report_module_gui/src/ui/cXMLCodeEditor.h b/src/report_modules/report_module_gui/src/ui/c_xml_code_editor.h similarity index 78% rename from src/report_modules/report_module_gui/src/ui/cXMLCodeEditor.h rename to src/report_modules/report_module_gui/src/ui/c_xml_code_editor.h index a804513c..429c5da0 100644 --- a/src/report_modules/report_module_gui/src/ui/cXMLCodeEditor.h +++ b/src/report_modules/report_module_gui/src/ui/c_xml_code_editor.h @@ -44,49 +44,51 @@ #include // Displays a XML Code snippet -class cXMLCodeEditor : public QPlainTextEdit { +class cXMLCodeEditor : public QPlainTextEdit +{ Q_OBJECT -public: + public: // Paints the lins number are - void LineNumberAreaPaintEvent(QPaintEvent* event); + void LineNumberAreaPaintEvent(QPaintEvent *event); // Returns the width od the line numer area int LineNumberAreaWidth() const; // Sets the text on the editor window - void SetText(const QString& text); + void SetText(const QString &text); // Sets the marker to a new row entry void SetMarker(unsigned newRow); -protected: + protected: cXMLCodeEditor() = delete; - cXMLCodeEditor(const cXMLCodeEditor&) = delete; - cXMLCodeEditor(cXMLCodeEditor&&) = delete; - explicit cXMLCodeEditor(QTabWidget* tab, QWidget* parent); + cXMLCodeEditor(const cXMLCodeEditor &) = delete; + cXMLCodeEditor(cXMLCodeEditor &&) = delete; + explicit cXMLCodeEditor(QTabWidget *tab, QWidget *parent); virtual ~cXMLCodeEditor(); -public slots: - void UpdateLineNumberArea(const QRect& rect, int dy); + public slots: + void UpdateLineNumberArea(const QRect &rect, int dy); void UpdateLineNumberAreaWidth(int); -protected: - QTabWidget* const _tabWidget{nullptr}; - QWidget* _lineNumberArea{nullptr}; + protected: + QTabWidget *const _tabWidget{nullptr}; + QWidget *_lineNumberArea{nullptr}; QFont _normalFont; QFont _boldFont; - QFontMetrics* _metrics{nullptr}; + QFontMetrics *_metrics{nullptr}; QList> _issueHints; unsigned _currentMarkerRow{0}; }; // Diaplays the lines -class cLineNumberArea : public QWidget { -public: - cLineNumberArea(cXMLCodeEditor* editor) : QWidget(editor), _codeEditor(editor) +class cLineNumberArea : public QWidget +{ + public: + cLineNumberArea(cXMLCodeEditor *editor) : QWidget(editor), _codeEditor(editor) { } @@ -95,14 +97,14 @@ class cLineNumberArea : public QWidget { return QSize(_codeEditor->LineNumberAreaWidth(), 0); } -protected: - void paintEvent(QPaintEvent* event) override + protected: + void paintEvent(QPaintEvent *event) override { _codeEditor->LineNumberAreaPaintEvent(event); } -private: - cXMLCodeEditor* const _codeEditor{nullptr}; + private: + cXMLCodeEditor *const _codeEditor{nullptr}; }; -#endif \ No newline at end of file +#endif diff --git a/src/report_modules/report_module_gui/src/ui/cXODREditorWidget.cpp b/src/report_modules/report_module_gui/src/ui/c_xodr_editor_widget.cpp similarity index 67% rename from src/report_modules/report_module_gui/src/ui/cXODREditorWidget.cpp rename to src/report_modules/report_module_gui/src/ui/c_xodr_editor_widget.cpp index dac5330b..51792bc9 100644 --- a/src/report_modules/report_module_gui/src/ui/cXODREditorWidget.cpp +++ b/src/report_modules/report_module_gui/src/ui/c_xodr_editor_widget.cpp @@ -32,16 +32,16 @@ * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "cXODREditorWidget.h" +#include "c_xodr_editor_widget.h" -#include "common/result_format/cChecker.h" -#include "common/result_format/cCheckerBundle.h" -#include "common/result_format/cFileLocation.h" -#include "common/result_format/cIssue.h" -#include "common/result_format/cLocationsContainer.h" -#include "common/result_format/cResultContainer.h" +#include "common/result_format/c_checker.h" +#include "common/result_format/c_checker_bundle.h" +#include "common/result_format/c_file_location.h" +#include "common/result_format/c_issue.h" +#include "common/result_format/c_locations_container.h" +#include "common/result_format/c_result_container.h" -cXODREditorWidget::cXODREditorWidget(QTabWidget* tab, QWidget* parent) : cXMLCodeEditor(tab, parent) +cXODREditorWidget::cXODREditorWidget(QTabWidget *tab, QWidget *parent) : cXMLCodeEditor(tab, parent) { _openedFilePath = ""; @@ -60,21 +60,26 @@ cXODREditorWidget::~cXODREditorWidget() delete _highlighter; } -void cXODREditorWidget::ShowXODRIssue(const cIssue* const issue, const int row) +void cXODREditorWidget::ShowXODRIssue(const cIssue *const issue, const int row) { _tabWidget->setCurrentIndex(0); int rowToSelect = row; // If we passed no specific row... - if (rowToSelect == -1) { - for (const auto& location: issue->GetLocationsContainer()) { + if (rowToSelect == -1) + { + for (const auto &location : issue->GetLocationsContainer()) + { // Iterate all extended items and get the first file location // Which references to an OpenDRIVE - for (const auto& extendedItem: location->GetExtendedInformations()) { - if (extendedItem->IsType()) { - cFileLocation* fileLoc = (cFileLocation*)extendedItem; - - if (fileLoc->IsXODRFileLocation()) { + for (const auto &extendedItem : location->GetExtendedInformations()) + { + if (extendedItem->IsType()) + { + cFileLocation *fileLoc = (cFileLocation *)extendedItem; + + if (fileLoc->IsXODRFileLocation()) + { rowToSelect = fileLoc->GetRow(); break; } @@ -87,18 +92,20 @@ void cXODREditorWidget::ShowXODRIssue(const cIssue* const issue, const int row) verticalScrollBar()->setValue(rowToSelect - OFFSET_SHOW_ISSUE); } -void cXODREditorWidget::LoadXODR(cResultContainer* const container) +void cXODREditorWidget::LoadXODR(cResultContainer *const container) { _tabWidget->setTabEnabled(0, true); QString fileToOpen = container->GetXODRFilePath().c_str(); - if (fileToOpen == "") { + if (fileToOpen == "") + { // If no file was selected, disable tab. _tabWidget->setTabEnabled(0, false); return; } - if (_openedFilePath != fileToOpen) { + if (_openedFilePath != fileToOpen) + { QFile file(fileToOpen); file.open(QIODevice::Text | QIODevice::ReadOnly); @@ -109,11 +116,13 @@ void cXODREditorWidget::LoadXODR(cResultContainer* const container) content.reserve(max_file_size); qint64 file_size = file.size(); - if (file_size > max_file_size) { + if (file_size > max_file_size) + { content.append("File exceeds limit of " + QString::number(max_file_size_mb) + " MB. " + "Interactive issue reporting not possible."); } - else { + else + { while (!file.atEnd()) content.append(file.readLine()); } @@ -136,29 +145,28 @@ void cXODREditorWidget::LoadXODR(cResultContainer* const container) QTextCharFormat fmt; fmt.setBackground(Qt::yellow); - std::list bundles = container->GetCheckerBundles(); - for (std::list::const_iterator checkerBundleIt = bundles.cbegin(); - checkerBundleIt != bundles.cend(); - checkerBundleIt++) { + std::list bundles = container->GetCheckerBundles(); + for (std::list::const_iterator checkerBundleIt = bundles.cbegin(); + checkerBundleIt != bundles.cend(); checkerBundleIt++) + { // If the checkerBundle is referenced to an xosc file - if ((*checkerBundleIt)->GetXODRFilePath() != "") { - std::list checkers = (*checkerBundleIt)->GetCheckers(); - for (std::list::const_iterator checkerIt = checkers.cbegin(); - checkerIt != checkers.cend(); - checkerIt++) { - std::list issues = (*checkerIt)->GetIssues(); - for (std::list::const_iterator issueIt = issues.cbegin(); - issueIt != issues.cend(); - issueIt++) { - for (const auto& location: (*issueIt)->GetLocationsContainer()) { - std::list extInfo = - location->GetExtendedInformations(); - - for (std::list::const_iterator extIt = - extInfo.cbegin(); - extIt != extInfo.cend(); - extIt++) { - cFileLocation* fileLocation = dynamic_cast(*extIt); + if ((*checkerBundleIt)->GetXODRFilePath() != "") + { + std::list checkers = (*checkerBundleIt)->GetCheckers(); + for (std::list::const_iterator checkerIt = checkers.cbegin(); checkerIt != checkers.cend(); + checkerIt++) + { + std::list issues = (*checkerIt)->GetIssues(); + for (std::list::const_iterator issueIt = issues.cbegin(); issueIt != issues.cend(); issueIt++) + { + for (const auto &location : (*issueIt)->GetLocationsContainer()) + { + std::list extInfo = location->GetExtendedInformations(); + + for (std::list::const_iterator extIt = extInfo.cbegin(); + extIt != extInfo.cend(); extIt++) + { + cFileLocation *fileLocation = dynamic_cast(*extIt); if (nullptr != fileLocation && fileLocation->IsXODRFileLocation()) HighlightIssue(*issueIt, fileLocation->GetRow(), fmt, &cursor); @@ -176,24 +184,19 @@ void cXODREditorWidget::LoadXODR(cResultContainer* const container) verticalScrollBar()->setValue(0); } -void cXODREditorWidget::HighlightIssue(const cIssue* const issue, - unsigned int row, - QTextCharFormat fmt, - QTextCursor* cursor) +void cXODREditorWidget::HighlightIssue(const cIssue *const issue, unsigned int row, QTextCharFormat fmt, + QTextCursor *cursor) { // OpenDRIVE and xml tag are not included... unsigned textRow = (row > 1) ? row - 1 : row; unsigned textColumn = 0; cursor->movePosition(QTextCursor::Start); - cursor->movePosition(QTextCursor::Down, QTextCursor::MoveAnchor, textRow); // go down y-times - cursor->movePosition( - QTextCursor::Right, QTextCursor::MoveAnchor, textColumn); // go right x-times - - cursor->movePosition( - QTextCursor::Down, QTextCursor::QTextCursor::KeepAnchor, 1); // go down y-times - cursor->movePosition( - QTextCursor::Right, QTextCursor::QTextCursor::KeepAnchor, textColumn); // go right x-times + cursor->movePosition(QTextCursor::Down, QTextCursor::MoveAnchor, textRow); // go down y-times + cursor->movePosition(QTextCursor::Right, QTextCursor::MoveAnchor, textColumn); // go right x-times + + cursor->movePosition(QTextCursor::Down, QTextCursor::QTextCursor::KeepAnchor, 1); // go down y-times + cursor->movePosition(QTextCursor::Right, QTextCursor::QTextCursor::KeepAnchor, textColumn); // go right x-times cursor->setCharFormat(fmt); QRect hintRect(0, textRow, 2, 1); @@ -205,28 +208,30 @@ void cXODREditorWidget::HighlightIssue(const cIssue* const issue, _issueHints.append(content); } -void cXODREditorWidget::resizeEvent(QResizeEvent* event) +void cXODREditorWidget::resizeEvent(QResizeEvent *event) { QPlainTextEdit::resizeEvent(event); QRect cr = contentsRect(); - _lineNumberArea->setGeometry( - QRect(cr.left() + 2, cr.top(), LineNumberAreaWidth() + 2, cr.height())); + _lineNumberArea->setGeometry(QRect(cr.left() + 2, cr.top(), LineNumberAreaWidth() + 2, cr.height())); } -bool cXODREditorWidget::event(QEvent* event) +bool cXODREditorWidget::event(QEvent *event) { - if (event->type() == QEvent::ToolTip) { - QHelpEvent* helpEvent = static_cast(event); + if (event->type() == QEvent::ToolTip) + { + QHelpEvent *helpEvent = static_cast(event); QTextCursor cursor = cursorForPosition(helpEvent->pos()); bool showHint = false; QList>::iterator itHint; - for (itHint = _issueHints.begin(); itHint != _issueHints.end(); ++itHint) { + for (itHint = _issueHints.begin(); itHint != _issueHints.end(); ++itHint) + { int x = 1; int y = cursor.blockNumber(); - if (itHint->first.contains(QPoint(x, y))) { + if (itHint->first.contains(QPoint(x, y))) + { QToolTip::showText(helpEvent->globalPos(), itHint->second); showHint = true; } @@ -240,7 +245,7 @@ bool cXODREditorWidget::event(QEvent* event) return QPlainTextEdit::event(event); } -cXODRSyntaxHighlighter::cXODRSyntaxHighlighter(QTextDocument* parent) : QSyntaxHighlighter(parent) +cXODRSyntaxHighlighter::cXODRSyntaxHighlighter(QTextDocument *parent) : QSyntaxHighlighter(parent) { //----------------------------- // Rule for tag attributes @@ -289,13 +294,15 @@ cXODRSyntaxHighlighter::cXODRSyntaxHighlighter(QTextDocument* parent) : QSyntaxH _highlightingRules.append(attValueRule); } -void cXODRSyntaxHighlighter::highlightBlock(const QString& text) +void cXODRSyntaxHighlighter::highlightBlock(const QString &text) { - foreach (const HighlightingRule& rule, _highlightingRules) { + foreach (const HighlightingRule &rule, _highlightingRules) + { QRegularExpressionMatchIterator matchIterator = rule.pattern.globalMatch(text); - while (matchIterator.hasNext()) { + while (matchIterator.hasNext()) + { QRegularExpressionMatch match = matchIterator.next(); setFormat(match.capturedStart(), match.capturedLength(), rule.format); } } -} \ No newline at end of file +} diff --git a/src/report_modules/report_module_gui/src/ui/cXODREditorWidget.h b/src/report_modules/report_module_gui/src/ui/c_xodr_editor_widget.h similarity index 72% rename from src/report_modules/report_module_gui/src/ui/cXODREditorWidget.h rename to src/report_modules/report_module_gui/src/ui/c_xodr_editor_widget.h index 187664f9..71e65e57 100644 --- a/src/report_modules/report_module_gui/src/ui/cXODREditorWidget.h +++ b/src/report_modules/report_module_gui/src/ui/c_xodr_editor_widget.h @@ -35,7 +35,7 @@ #ifndef XODR_EDITOR_WIDGET_H #define XODR_EDITOR_WIDGET_H -#include "cXMLCodeEditor.h" +#include "c_xml_code_editor.h" #include #include @@ -55,60 +55,60 @@ class cResultContainer; class cXODRSyntaxHighlighter; // Basic Editor Widget -class cXODREditorWidget : public cXMLCodeEditor { +class cXODREditorWidget : public cXMLCodeEditor +{ Q_OBJECT -private: - cXODRSyntaxHighlighter* _highlighter{nullptr}; + private: + cXODRSyntaxHighlighter *_highlighter{nullptr}; QString _openedFilePath; const int OFFSET_SHOW_ISSUE = 6; -public: + public: cXODREditorWidget() = delete; - cXODREditorWidget(const cXODREditorWidget&) = delete; - cXODREditorWidget(cXODREditorWidget&&) = delete; - cXODREditorWidget(QTabWidget* tabWidget, QWidget* parent = nullptr); + cXODREditorWidget(const cXODREditorWidget &) = delete; + cXODREditorWidget(cXODREditorWidget &&) = delete; + cXODREditorWidget(QTabWidget *tabWidget, QWidget *parent = nullptr); virtual ~cXODREditorWidget(); -protected: - void resizeEvent(QResizeEvent* event) override; + protected: + void resizeEvent(QResizeEvent *event) override; - bool event(QEvent* event); + bool event(QEvent *event); - void HighlightIssue(const cIssue* const issue, - unsigned int row, - QTextCharFormat fmt, - QTextCursor* cursor); + void HighlightIssue(const cIssue *const issue, unsigned int row, QTextCharFormat fmt, QTextCursor *cursor); -public slots: + public slots: // Loads the content of the editor window - void LoadXODR(cResultContainer* const container); + void LoadXODR(cResultContainer *const container); // Shows a specific XODR Position - void ShowXODRIssue(const cIssue* const issue, const int row); + void ShowXODRIssue(const cIssue *const issue, const int row); -signals: - void highlight(cXODREditorWidget* widget); + signals: + void highlight(cXODREditorWidget *widget); }; // Syntax Hightlighter for XODR -class cXODRSyntaxHighlighter : public QSyntaxHighlighter { +class cXODRSyntaxHighlighter : public QSyntaxHighlighter +{ Q_OBJECT -private: - struct HighlightingRule { + private: + struct HighlightingRule + { QRegularExpression pattern; QTextCharFormat format; }; QVector _highlightingRules; -public: - cXODRSyntaxHighlighter(QTextDocument* parent = nullptr); + public: + cXODRSyntaxHighlighter(QTextDocument *parent = nullptr); -protected: - void highlightBlock(const QString& text) override; + protected: + void highlightBlock(const QString &text) override; }; #endif diff --git a/src/report_modules/report_module_gui/src/ui/cXOSCEditorWidget.cpp b/src/report_modules/report_module_gui/src/ui/c_xosc_editor_widget.cpp similarity index 66% rename from src/report_modules/report_module_gui/src/ui/cXOSCEditorWidget.cpp rename to src/report_modules/report_module_gui/src/ui/c_xosc_editor_widget.cpp index 6726f20b..e4024620 100644 --- a/src/report_modules/report_module_gui/src/ui/cXOSCEditorWidget.cpp +++ b/src/report_modules/report_module_gui/src/ui/c_xosc_editor_widget.cpp @@ -32,16 +32,16 @@ * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "cXOSCEditorWidget.h" +#include "c_xosc_editor_widget.h" -#include "common/result_format/cChecker.h" -#include "common/result_format/cCheckerBundle.h" -#include "common/result_format/cFileLocation.h" -#include "common/result_format/cIssue.h" -#include "common/result_format/cLocationsContainer.h" -#include "common/result_format/cResultContainer.h" +#include "common/result_format/c_checker.h" +#include "common/result_format/c_checker_bundle.h" +#include "common/result_format/c_file_location.h" +#include "common/result_format/c_issue.h" +#include "common/result_format/c_locations_container.h" +#include "common/result_format/c_result_container.h" -cXOSCEditorWidget::cXOSCEditorWidget(QTabWidget* tab, QWidget* parent) : cXMLCodeEditor(tab, parent) +cXOSCEditorWidget::cXOSCEditorWidget(QTabWidget *tab, QWidget *parent) : cXMLCodeEditor(tab, parent) { _openedFilePath = ""; @@ -59,21 +59,26 @@ cXOSCEditorWidget::~cXOSCEditorWidget() delete _highlighter; } -void cXOSCEditorWidget::ShowXOSCIssue(const cIssue* const issue, const int row) +void cXOSCEditorWidget::ShowXOSCIssue(const cIssue *const issue, const int row) { _tabWidget->setCurrentIndex(1); int rowToSelect = row; // If we passed no specific row... - if (rowToSelect == -1) { - for (const auto& location: issue->GetLocationsContainer()) { + if (rowToSelect == -1) + { + for (const auto &location : issue->GetLocationsContainer()) + { // Iterate all extended items and get the first file location // Which references to an OpenSCENARIO - for (auto extendedItem: location->GetExtendedInformations()) { - if (extendedItem->IsType()) { - cFileLocation* fileLoc = (cFileLocation*)extendedItem; - - if (fileLoc->IsXOSCFileLocation()) { + for (auto extendedItem : location->GetExtendedInformations()) + { + if (extendedItem->IsType()) + { + cFileLocation *fileLoc = (cFileLocation *)extendedItem; + + if (fileLoc->IsXOSCFileLocation()) + { rowToSelect = fileLoc->GetRow(); break; } @@ -86,19 +91,21 @@ void cXOSCEditorWidget::ShowXOSCIssue(const cIssue* const issue, const int row) verticalScrollBar()->setValue(rowToSelect - OFFSET_SHOW_ISSUE); } -void cXOSCEditorWidget::LoadXOSC(cResultContainer* const container) +void cXOSCEditorWidget::LoadXOSC(cResultContainer *const container) { _tabWidget->setTabEnabled(1, true); QString fileToOpen = container->GetXOSCFilePath().c_str(); // If no file was selected, disable tab. - if (fileToOpen == "") { + if (fileToOpen == "") + { _tabWidget->setTabEnabled(1, false); return; } - if (_openedFilePath != fileToOpen) { + if (_openedFilePath != fileToOpen) + { QFile file(fileToOpen); file.open(QIODevice::Text | QIODevice::ReadOnly); @@ -109,11 +116,13 @@ void cXOSCEditorWidget::LoadXOSC(cResultContainer* const container) content.reserve(max_file_size); qint64 file_size = file.size(); - if (file_size > max_file_size) { + if (file_size > max_file_size) + { content.append("File exceeds limit of " + QString::number(max_file_size_mb) + " MB. " + "Interactive issue reporting not possible."); } - else { + else + { while (!file.atEnd()) content.append(file.readLine()); } @@ -137,29 +146,28 @@ void cXOSCEditorWidget::LoadXOSC(cResultContainer* const container) QTextCharFormat fmt; fmt.setBackground(Qt::yellow); - std::list bundles = container->GetCheckerBundles(); - for (std::list::const_iterator checkerBundleIt = bundles.cbegin(); - checkerBundleIt != bundles.cend(); - checkerBundleIt++) { + std::list bundles = container->GetCheckerBundles(); + for (std::list::const_iterator checkerBundleIt = bundles.cbegin(); + checkerBundleIt != bundles.cend(); checkerBundleIt++) + { // If the checkerBundle is referenced to an xosc file - if ((*checkerBundleIt)->GetXOSCFilePath() != "") { - std::list checkers = (*checkerBundleIt)->GetCheckers(); - for (std::list::const_iterator checkerIt = checkers.cbegin(); - checkerIt != checkers.cend(); - checkerIt++) { - std::list issues = (*checkerIt)->GetIssues(); - for (std::list::const_iterator issueIt = issues.cbegin(); - issueIt != issues.cend(); - issueIt++) { - for (const auto& location: (*issueIt)->GetLocationsContainer()) { - std::list extInfo = - location->GetExtendedInformations(); - - for (std::list::const_iterator extIt = - extInfo.cbegin(); - extIt != extInfo.cend(); - extIt++) { - cFileLocation* fileLocation = dynamic_cast(*extIt); + if ((*checkerBundleIt)->GetXOSCFilePath() != "") + { + std::list checkers = (*checkerBundleIt)->GetCheckers(); + for (std::list::const_iterator checkerIt = checkers.cbegin(); checkerIt != checkers.cend(); + checkerIt++) + { + std::list issues = (*checkerIt)->GetIssues(); + for (std::list::const_iterator issueIt = issues.cbegin(); issueIt != issues.cend(); issueIt++) + { + for (const auto &location : (*issueIt)->GetLocationsContainer()) + { + std::list extInfo = location->GetExtendedInformations(); + + for (std::list::const_iterator extIt = extInfo.cbegin(); + extIt != extInfo.cend(); extIt++) + { + cFileLocation *fileLocation = dynamic_cast(*extIt); if (nullptr != fileLocation && fileLocation->IsXOSCFileLocation()) HighlightIssue(*issueIt, fileLocation->GetRow(), fmt, &cursor); @@ -177,24 +185,19 @@ void cXOSCEditorWidget::LoadXOSC(cResultContainer* const container) verticalScrollBar()->setValue(0); } -void cXOSCEditorWidget::HighlightIssue(const cIssue* const issue, - unsigned int row, - QTextCharFormat fmt, - QTextCursor* cursor) +void cXOSCEditorWidget::HighlightIssue(const cIssue *const issue, unsigned int row, QTextCharFormat fmt, + QTextCursor *cursor) { // OpenDRIVE and xml tag are not included... unsigned textRow = (row > 1) ? row - 1 : row; unsigned textColumn = 0; cursor->movePosition(QTextCursor::Start); - cursor->movePosition(QTextCursor::Down, QTextCursor::MoveAnchor, textRow); // go down y-times - cursor->movePosition( - QTextCursor::Right, QTextCursor::MoveAnchor, textColumn); // go right x-times - - cursor->movePosition( - QTextCursor::Down, QTextCursor::QTextCursor::KeepAnchor, 1); // go down y-times - cursor->movePosition( - QTextCursor::Right, QTextCursor::QTextCursor::KeepAnchor, textColumn); // go right x-times + cursor->movePosition(QTextCursor::Down, QTextCursor::MoveAnchor, textRow); // go down y-times + cursor->movePosition(QTextCursor::Right, QTextCursor::MoveAnchor, textColumn); // go right x-times + + cursor->movePosition(QTextCursor::Down, QTextCursor::QTextCursor::KeepAnchor, 1); // go down y-times + cursor->movePosition(QTextCursor::Right, QTextCursor::QTextCursor::KeepAnchor, textColumn); // go right x-times cursor->setCharFormat(fmt); QRect hintRect(0, textRow, 2, 1); @@ -206,28 +209,30 @@ void cXOSCEditorWidget::HighlightIssue(const cIssue* const issue, _issueHints.append(content); } -void cXOSCEditorWidget::resizeEvent(QResizeEvent* event) +void cXOSCEditorWidget::resizeEvent(QResizeEvent *event) { QPlainTextEdit::resizeEvent(event); QRect cr = contentsRect(); - _lineNumberArea->setGeometry( - QRect(cr.left() + 2, cr.top(), LineNumberAreaWidth() + 2, cr.height())); + _lineNumberArea->setGeometry(QRect(cr.left() + 2, cr.top(), LineNumberAreaWidth() + 2, cr.height())); } -bool cXOSCEditorWidget::event(QEvent* event) +bool cXOSCEditorWidget::event(QEvent *event) { - if (event->type() == QEvent::ToolTip) { - QHelpEvent* helpEvent = static_cast(event); + if (event->type() == QEvent::ToolTip) + { + QHelpEvent *helpEvent = static_cast(event); QTextCursor cursor = cursorForPosition(helpEvent->pos()); bool showHint = false; QList>::iterator itHint; - for (itHint = _issueHints.begin(); itHint != _issueHints.end(); ++itHint) { + for (itHint = _issueHints.begin(); itHint != _issueHints.end(); ++itHint) + { int x = 1; int y = cursor.blockNumber(); - if (itHint->first.contains(QPoint(x, y))) { + if (itHint->first.contains(QPoint(x, y))) + { QToolTip::showText(helpEvent->globalPos(), itHint->second); showHint = true; } @@ -241,7 +246,7 @@ bool cXOSCEditorWidget::event(QEvent* event) return QPlainTextEdit::event(event); } -cXOSCSyntaxHighlighter::cXOSCSyntaxHighlighter(QTextDocument* parent) : QSyntaxHighlighter(parent) +cXOSCSyntaxHighlighter::cXOSCSyntaxHighlighter(QTextDocument *parent) : QSyntaxHighlighter(parent) { //----------------------------- // Rule for tag attributes @@ -287,13 +292,15 @@ cXOSCSyntaxHighlighter::cXOSCSyntaxHighlighter(QTextDocument* parent) : QSyntaxH _highlightingRules.append(attValueRule); } -void cXOSCSyntaxHighlighter::highlightBlock(const QString& text) +void cXOSCSyntaxHighlighter::highlightBlock(const QString &text) { - foreach (const HighlightingRule& rule, _highlightingRules) { + foreach (const HighlightingRule &rule, _highlightingRules) + { QRegularExpressionMatchIterator matchIterator = rule.pattern.globalMatch(text); - while (matchIterator.hasNext()) { + while (matchIterator.hasNext()) + { QRegularExpressionMatch match = matchIterator.next(); setFormat(match.capturedStart(), match.capturedLength(), rule.format); } } -} \ No newline at end of file +} diff --git a/src/report_modules/report_module_gui/src/ui/cXOSCEditorWidget.h b/src/report_modules/report_module_gui/src/ui/c_xosc_editor_widget.h similarity index 72% rename from src/report_modules/report_module_gui/src/ui/cXOSCEditorWidget.h rename to src/report_modules/report_module_gui/src/ui/c_xosc_editor_widget.h index 13fcfed9..6dbce6e0 100644 --- a/src/report_modules/report_module_gui/src/ui/cXOSCEditorWidget.h +++ b/src/report_modules/report_module_gui/src/ui/c_xosc_editor_widget.h @@ -35,7 +35,7 @@ #ifndef XOSC_EDITOR_WIDGET_H #define XOSC_EDITOR_WIDGET_H -#include "cXMLCodeEditor.h" +#include "c_xml_code_editor.h" #include #include @@ -56,60 +56,60 @@ class XMLIssueHighlightWorker; class cXOSCSyntaxHighlighter; // Basic Editor Widget -class cXOSCEditorWidget : public cXMLCodeEditor { +class cXOSCEditorWidget : public cXMLCodeEditor +{ Q_OBJECT -private: - cXOSCSyntaxHighlighter* _highlighter{nullptr}; + private: + cXOSCSyntaxHighlighter *_highlighter{nullptr}; QString _openedFilePath; const int OFFSET_SHOW_ISSUE = 6; -public: + public: cXOSCEditorWidget() = delete; - cXOSCEditorWidget(const cXOSCEditorWidget&) = delete; - cXOSCEditorWidget(cXOSCEditorWidget&&) = delete; - cXOSCEditorWidget(QTabWidget* tabWidget, QWidget* parent = nullptr); + cXOSCEditorWidget(const cXOSCEditorWidget &) = delete; + cXOSCEditorWidget(cXOSCEditorWidget &&) = delete; + cXOSCEditorWidget(QTabWidget *tabWidget, QWidget *parent = nullptr); virtual ~cXOSCEditorWidget(); -protected: - void resizeEvent(QResizeEvent* event) override; + protected: + void resizeEvent(QResizeEvent *event) override; - bool event(QEvent* event); + bool event(QEvent *event); - void HighlightIssue(const cIssue* const issue, - unsigned int row, - QTextCharFormat fmt, - QTextCursor* cursor); + void HighlightIssue(const cIssue *const issue, unsigned int row, QTextCharFormat fmt, QTextCursor *cursor); -public slots: + public slots: // Loads the content of the editor window - void LoadXOSC(cResultContainer* const container); + void LoadXOSC(cResultContainer *const container); // Shows a specific XOSC Position - void ShowXOSCIssue(const cIssue* const issue, const int row); + void ShowXOSCIssue(const cIssue *const issue, const int row); -signals: - void highlight(cXOSCEditorWidget* widget); + signals: + void highlight(cXOSCEditorWidget *widget); }; // Syntax Hightlighter for XOSC -class cXOSCSyntaxHighlighter : public QSyntaxHighlighter { +class cXOSCSyntaxHighlighter : public QSyntaxHighlighter +{ Q_OBJECT -private: - struct HighlightingRule { + private: + struct HighlightingRule + { QRegularExpression pattern; QTextCharFormat format; }; QVector _highlightingRules; -public: - cXOSCSyntaxHighlighter(QTextDocument* parent = nullptr); + public: + cXOSCSyntaxHighlighter(QTextDocument *parent = nullptr); -protected: - void highlightBlock(const QString& text) override; + protected: + void highlightBlock(const QString &text) override; }; -#endif \ No newline at end of file +#endif diff --git a/src/report_modules/report_module_text/CMakeLists.txt b/src/report_modules/report_module_text/CMakeLists.txt index 64718ff7..e5918940 100644 --- a/src/report_modules/report_module_text/CMakeLists.txt +++ b/src/report_modules/report_module_text/CMakeLists.txt @@ -10,8 +10,8 @@ project(${REPORT_MODULE_TEXT_PROJECT}) add_executable(${REPORT_MODULE_TEXT_PROJECT} src/stdafx.h src/stdafx.cpp - src/reportFormatText.h - src/reportFormatText.cpp + src/report_format_text.h + src/report_format_text.cpp ) target_link_libraries(${REPORT_MODULE_TEXT_PROJECT} PRIVATE qc4openx-common) diff --git a/src/report_modules/report_module_text/src/reportFormatText.h b/src/report_modules/report_module_text/src/reportFormatText.h deleted file mode 100644 index 92d6adb8..00000000 --- a/src/report_modules/report_module_text/src/reportFormatText.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -#include "common/util.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "common/result_format/cIssue.h" - -#define REPORT_MODULE_NAME "TextReport" - -class cParameterContainer; - -/** -* Main function for application -* -* @param [in] argc Number of arguments in shell -* @param [in] argv Pointer to arguments -* -* @return The standard return value -*/ -int main(int argc, char* argv[]); - -/** -* Shows the help for the application -* @param [in] applicationName The name of the application -*/ -void ShowHelp(const std::string& applicationName); - -/** -* Runs the text report module -*/ -void RunTextReport(const cParameterContainer& inputParams); - -// Prints Extended Informations into the text report -void PrintExtendedInformationIntoStream(cIssue* item, std::stringstream* ssStream); - -/** -* Writes the default configuration for a report -*/ -void WriteDefaultConfig(); diff --git a/src/report_modules/report_module_text/src/reportFormatText.cpp b/src/report_modules/report_module_text/src/report_format_text.cpp similarity index 64% rename from src/report_modules/report_module_text/src/reportFormatText.cpp rename to src/report_modules/report_module_text/src/report_format_text.cpp index 3e588dc6..fd78b0b5 100644 --- a/src/report_modules/report_module_text/src/reportFormatText.cpp +++ b/src/report_modules/report_module_text/src/report_format_text.cpp @@ -5,42 +5,39 @@ * Public License, v. 2.0. If a copy of the MPL was not distributed * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "report_format_text.h" +#include "common/config_format/c_configuration.h" +#include "common/config_format/c_configuration_report_module.h" +#include "common/result_format/c_checker.h" +#include "common/result_format/c_checker_bundle.h" +#include "common/result_format/c_file_location.h" +#include "common/result_format/c_inertial_location.h" +#include "common/result_format/c_issue.h" +#include "common/result_format/c_locations_container.h" +#include "common/result_format/c_parameter_container.h" +#include "common/result_format/c_result_container.h" +#include "common/result_format/c_road_location.h" +#include "common/result_format/c_xml_location.h" #include "stdafx.h" -#include "reportFormatText.h" -#include "common/config_format/cConfiguration.h" -#include "common/config_format/cConfigurationReportModule.h" -#include "common/result_format/cResultContainer.h" -#include "common/result_format/cCheckerBundle.h" -#include "common/result_format/cChecker.h" -#include "common/result_format/cFileLocation.h" -#include "common/result_format/cInertialLocation.h" -#include "common/result_format/cParameterContainer.h" -#include "common/result_format/cRoadLocation.h" -#include "common/result_format/cXMLLocation.h" -#include "common/result_format/cIssue.h" -#include "common/result_format/cLocationsContainer.h" #include "common/qc4openx_filesystem.h" XERCES_CPP_NAMESPACE_USE -const char BASIC_SEPARATOR_LINE[] = "====================================================================================================\n"; - -static std::map mapIssueLevelToString = -{ - {eIssueLevel::INFO_LVL, "Info: "}, - {eIssueLevel::WARNING_LVL,"Warning: "}, - {eIssueLevel::ERROR_LVL, "Error: "} -}; +const char BASIC_SEPARATOR_LINE[] = + "====================================================================================================\n"; +static std::map mapIssueLevelToString = {{eIssueLevel::INFO_LVL, "Info: "}, + {eIssueLevel::WARNING_LVL, "Warning: "}, + {eIssueLevel::ERROR_LVL, "Error: "}}; // Writes the results to the hard dis drive -void WriteResults(const char* file, cResultContainer* ptrResultContainer); +void WriteResults(const char *file, cResultContainer *ptrResultContainer); -void AddPrefixForDescriptionIssueProcessor(cChecker* checker, cIssue* issueToProcess); +void AddPrefixForDescriptionIssueProcessor(cChecker *checker, cIssue *issueToProcess); // Main Programm -int main(int argc, char* argv[]) +int main(int argc, char *argv[]) { std::string strToolpath = argv[0]; @@ -69,7 +66,8 @@ int main(int argc, char* argv[]) { if (stat(strFilepath.c_str(), &fileStatus) == -1) // ==0 ok; ==-1 error { - std::cerr << "Could not open file '" << strFilepath << "'!" << std::endl << "Abort generating report!" << std::endl; + std::cerr << "Could not open file '" << strFilepath << "'!" << std::endl + << "Abort generating report!" << std::endl; return 1; } @@ -88,11 +86,12 @@ int main(int argc, char* argv[]) inputParams.Overwrite(configuration.GetParams()); - cConfigurationReportModule* reportModuleConfig = configuration.GetReportModuleByName(REPORT_MODULE_NAME); + cConfigurationReportModule *reportModuleConfig = configuration.GetReportModuleByName(REPORT_MODULE_NAME); if (nullptr != reportModuleConfig) inputParams.Overwrite(reportModuleConfig->GetParams()); else - std::cerr << "No configuration for module '" << REPORT_MODULE_NAME << "' found. Start with default params." << std::endl; + std::cerr << "No configuration for module '" << REPORT_MODULE_NAME << "' found. Start with default params." + << std::endl; } else if (StringEndsWith(ToLower(strFilepath), "--defaultconfig")) { @@ -114,7 +113,7 @@ int main(int argc, char* argv[]) RunTextReport(inputParams); } -void ShowHelp(const std::string& toolPath) +void ShowHelp(const std::string &toolPath) { std::string applicationName = toolPath; std::string applicationNameWithoutExt = toolPath; @@ -124,13 +123,14 @@ void ShowHelp(const std::string& toolPath) std::cout << "\n\nUsage of " << applicationNameWithoutExt << ":" << std::endl; std::cout << "\nRun the application with xqar file: \n" << applicationName << " result.xqar" << std::endl; std::cout << "\nRun the application with dbqa configuration: \n" << applicationName << " config.xml" << std::endl; - std::cout << "\nRun the application with and write default configuration: \n" << applicationName << " --defaultconfig" << std::endl; + std::cout << "\nRun the application with and write default configuration: \n" + << applicationName << " --defaultconfig" << std::endl; std::cout << "\n\n"; } -void RunTextReport(const cParameterContainer& inputParams) +void RunTextReport(const cParameterContainer &inputParams) { - cResultContainer* pResultContainer = new cResultContainer(); + cResultContainer *pResultContainer = new cResultContainer(); try { @@ -139,10 +139,9 @@ void RunTextReport(const cParameterContainer& inputParams) pResultContainer->AddResultsFromXML(inputParams.GetParam("strInputFile")); // Add prefix with issue id - std::list checkerBundles = pResultContainer->GetCheckerBundles(); - for (std::list::const_iterator itCheckerBundles = checkerBundles.cbegin(); - itCheckerBundles != checkerBundles.end(); - itCheckerBundles++) + std::list checkerBundles = pResultContainer->GetCheckerBundles(); + for (std::list::const_iterator itCheckerBundles = checkerBundles.cbegin(); + itCheckerBundles != checkerBundles.end(); itCheckerBundles++) { (*itCheckerBundles)->DoProcessing(AddPrefixForDescriptionIssueProcessor); } @@ -165,7 +164,7 @@ void RunTextReport(const cParameterContainer& inputParams) } // Writes the summary to text -void WriteResults(const char* file, cResultContainer* ptrResultContainer) +void WriteResults(const char *file, cResultContainer *ptrResultContainer) { // TODO: Write TEXT here std::ofstream outFile; @@ -174,10 +173,9 @@ void WriteResults(const char* file, cResultContainer* ptrResultContainer) if (!ptrResultContainer->HasCheckerBundles()) return; - std::list bundles = ptrResultContainer->GetCheckerBundles(); - std::list checkers; - std::list issues; - + std::list bundles = ptrResultContainer->GetCheckerBundles(); + std::list checkers; + std::list issues; if (outFile.is_open()) { @@ -187,7 +185,7 @@ void WriteResults(const char* file, cResultContainer* ptrResultContainer) ss << BASIC_SEPARATOR_LINE; ss << std::endl; - if((*bundles.begin())->GetXODRFileName().size() > 0) + if ((*bundles.begin())->GetXODRFileName().size() > 0) ss << "XodrFile: " << (*bundles.begin())->GetXODRFileName(false) << std::endl; if ((*bundles.begin())->GetXOSCFileName().size() > 0) @@ -196,9 +194,9 @@ void WriteResults(const char* file, cResultContainer* ptrResultContainer) ss << std::endl; // Loop over all checkers - for (std::list::const_iterator it_Bundle = bundles.begin(); - it_Bundle != bundles.end(); - it_Bundle++) { + for (std::list::const_iterator it_Bundle = bundles.begin(); it_Bundle != bundles.end(); + it_Bundle++) + { ss << BASIC_SEPARATOR_LINE; ss << " CheckerBundle: " << (*it_Bundle)->GetBundleName() << "\n"; ss << " Build date: " << (*it_Bundle)->GetBuildDate() << "\n"; @@ -218,16 +216,15 @@ void WriteResults(const char* file, cResultContainer* ptrResultContainer) for (; itParams != checkerBundleParams.end(); itParams++) { - ss << "\n " << *itParams - << " = " << (*it_Bundle)->GetParam(*itParams); + ss << "\n " << *itParams << " = " << (*it_Bundle)->GetParam(*itParams); } ss << "\n"; } checkers = (*it_Bundle)->GetCheckers(); - for (std::list::const_iterator itChecker = checkers.begin(); - itChecker != checkers.end(); - itChecker++) { + for (std::list::const_iterator itChecker = checkers.begin(); itChecker != checkers.end(); + itChecker++) + { issues = (*itChecker)->GetIssues(); if (issues.size() > 0) { @@ -248,16 +245,16 @@ void WriteResults(const char* file, cResultContainer* ptrResultContainer) for (; itCheckerParams != checkerParams.end(); itCheckerParams++) { - ss << "\n " << *itCheckerParams - << " = " << (*itChecker)->GetParam(*itCheckerParams); + ss << "\n " << *itCheckerParams << " = " + << (*itChecker)->GetParam(*itCheckerParams); } } - for (std::list::const_iterator it_Issue = issues.begin(); - it_Issue != issues.end(); - it_Issue++) { + for (std::list::const_iterator it_Issue = issues.begin(); it_Issue != issues.end(); + it_Issue++) + { ss << "\n " << mapIssueLevelToString[(*it_Issue)->GetIssueLevel()] - << (*it_Issue)->GetDescription(); + << (*it_Issue)->GetDescription(); PrintExtendedInformationIntoStream((*it_Issue), &ss); } @@ -273,7 +270,7 @@ void WriteResults(const char* file, cResultContainer* ptrResultContainer) } } -void AddPrefixForDescriptionIssueProcessor(cChecker* , cIssue* issueToProcess) +void AddPrefixForDescriptionIssueProcessor(cChecker *, cIssue *issueToProcess) { std::stringstream ssDescription; ssDescription << "#" << issueToProcess->GetIssueId() << ": " << issueToProcess->GetDescription(); @@ -281,49 +278,44 @@ void AddPrefixForDescriptionIssueProcessor(cChecker* , cIssue* issueToProcess) issueToProcess->SetDescription(ssDescription.str()); } -void PrintExtendedInformationIntoStream(cIssue* issue, std::stringstream* ssStream) +void PrintExtendedInformationIntoStream(cIssue *issue, std::stringstream *ssStream) { for (const auto location : issue->GetLocationsContainer()) { *ssStream << "\n " << location->GetDescription(); - std::list extendedInfos = location->GetExtendedInformations(); + std::list extendedInfos = location->GetExtendedInformations(); - for (std::list::iterator extIt = extendedInfos.begin(); - extIt != extendedInfos.end(); + for (std::list::iterator extIt = extendedInfos.begin(); extIt != extendedInfos.end(); extIt++) { - if ((*extIt)->IsType()) + if ((*extIt)->IsType()) { - cFileLocation* fileLoc = (cFileLocation*)(*extIt); + cFileLocation *fileLoc = (cFileLocation *)(*extIt); *ssStream << "\n " - << " File: source=" << fileLoc->GetFileTypeStr() - << " row=" << fileLoc->GetRow() - << " column=" << fileLoc->GetColumn(); + << " File: source=" << fileLoc->GetFileTypeStr() << " row=" << fileLoc->GetRow() + << " column=" << fileLoc->GetColumn(); } - else if ((*extIt)->IsType()) + else if ((*extIt)->IsType()) { - cXMLLocation* xmlLoc = (cXMLLocation*)(*extIt); + cXMLLocation *xmlLoc = (cXMLLocation *)(*extIt); *ssStream << "\n " - << " XPath: " << xmlLoc->GetXPath(); + << " XPath: " << xmlLoc->GetXPath(); } - else if ((*extIt)->IsType()) + else if ((*extIt)->IsType()) { - cRoadLocation* roadLoc = (cRoadLocation*)(*extIt); + cRoadLocation *roadLoc = (cRoadLocation *)(*extIt); *ssStream << "\n " - << " Road: id=" << roadLoc->GetRoadID() - << " s=" << roadLoc->GetS() << " t=" << roadLoc->GetT(); + << " Road: id=" << roadLoc->GetRoadID() << " s=" << roadLoc->GetS() + << " t=" << roadLoc->GetT(); } - else if ((*extIt)->IsType()) + else if ((*extIt)->IsType()) { - cInertialLocation* inertialLoc = (cInertialLocation*)(*extIt); + cInertialLocation *inertialLoc = (cInertialLocation *)(*extIt); *ssStream << "\n " - << " Location: x=" << inertialLoc->GetX() - << " y=" << inertialLoc->GetY() - << " z=" << inertialLoc->GetZ() - << " heading=" << inertialLoc->GetHead() - << " pitch=" << inertialLoc->GetPitch() - << " roll=" << inertialLoc->GetRoll(); + << " Location: x=" << inertialLoc->GetX() << " y=" << inertialLoc->GetY() + << " z=" << inertialLoc->GetZ() << " heading=" << inertialLoc->GetHead() + << " pitch=" << inertialLoc->GetPitch() << " roll=" << inertialLoc->GetRoll(); } } } @@ -333,7 +325,7 @@ void WriteDefaultConfig() { cConfiguration defaultConfig; - cConfigurationReportModule* reportModuleConfig = defaultConfig.AddReportModule(REPORT_MODULE_NAME); + cConfigurationReportModule *reportModuleConfig = defaultConfig.AddReportModule(REPORT_MODULE_NAME); reportModuleConfig->SetParam("strInputFile", "Result.xqar"); reportModuleConfig->SetParam("strReportFile", "Report.txt"); @@ -345,4 +337,4 @@ void WriteDefaultConfig() defaultConfig.WriteConfigurationToFile(ssConfigFile.str()); std::cout << "Finished." << std::endl; -} \ No newline at end of file +} diff --git a/src/checker_bundles/xosc_schema/src/staticOSCChecks.h b/src/report_modules/report_module_text/src/report_format_text.h similarity index 58% rename from src/checker_bundles/xosc_schema/src/staticOSCChecks.h rename to src/report_modules/report_module_text/src/report_format_text.h index 7122b448..54eb7cbc 100644 --- a/src/checker_bundles/xosc_schema/src/staticOSCChecks.h +++ b/src/report_modules/report_module_text/src/report_format_text.h @@ -6,16 +6,6 @@ * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef STATICOSCCHECKS_H__ -#define STATICOSCCHECKS_H__ - -#include "common/qc4openx_filesystem.h" -#include "common/xsd/cOSCSchemaChecker.h" -#include "common/xsd/cParserErrorHandler.h" -#include "common/config_format/cConfiguration.h" -#include "common/config_format/cConfigurationCheckerBundle.h" -#include "common/config_format/cConfigurationReportModule.h" -#include "stdafx.h" #include "common/util.h" #include @@ -27,12 +17,11 @@ #include #include -#include +#include "common/result_format/c_issue.h" -#define CHECKER_BUNDLE_NAME "XoscSchemaChecker" +#define REPORT_MODULE_NAME "TextReport" class cParameterContainer; -class cCheckerBundle; /** * Main function for application @@ -42,19 +31,23 @@ class cCheckerBundle; * * @return The standard return value */ -int main(int argc, char* argv[]); +int main(int argc, char *argv[]); /** * Shows the help for the application * @param [in] applicationName The name of the application */ -void ShowHelp(const std::string& applicationName); +void ShowHelp(const std::string &applicationName); /** - * Get application directory - * - * @return directory, where the application is installed + * Runs the text report module */ -const std::string GetApplicationDir(); +void RunTextReport(const cParameterContainer &inputParams); + +// Prints Extended Informations into the text report +void PrintExtendedInformationIntoStream(cIssue *item, std::stringstream *ssStream); -#endif \ No newline at end of file +/** + * Writes the default configuration for a report + */ +void WriteDefaultConfig(); diff --git a/src/report_modules/report_module_text/src/stdafx.h b/src/report_modules/report_module_text/src/stdafx.h index dc1a675a..80bf8468 100644 --- a/src/report_modules/report_module_text/src/stdafx.h +++ b/src/report_modules/report_module_text/src/stdafx.h @@ -8,12 +8,12 @@ #ifndef _STD_INCLUDES_HEADER_FEP_XODR_MANIPULATION_ #define _STD_INCLUDES_HEADER_FEP_XODR_MANIPULATION_ -#include #include -#include #include -#include #include +#include +#include +#include #include "common/util.h" diff --git a/src/result_pooling/CMakeLists.txt b/src/result_pooling/CMakeLists.txt index 1e712ebd..c31f380a 100644 --- a/src/result_pooling/CMakeLists.txt +++ b/src/result_pooling/CMakeLists.txt @@ -10,8 +10,8 @@ project(${RESULT_POOLING_PROJECT}) add_executable(${RESULT_POOLING_PROJECT} src/stdafx.h src/stdafx.cpp - src/resultPooling.h - src/resultPooling.cpp + src/result_pooling.h + src/result_pooling.cpp ) target_link_libraries(${RESULT_POOLING_PROJECT} PRIVATE diff --git a/src/result_pooling/src/resultPooling.h b/src/result_pooling/src/resultPooling.h deleted file mode 100644 index 138b932f..00000000 --- a/src/result_pooling/src/resultPooling.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -#include "common/util.h" -#include "common/result_format/cResultContainer.h" -#include "common/qc4openx_filesystem.h" -#include - -#define CHECKER_BUNDLE_NAME "ResultPooling" - -class cParameterContainer; - -/** -* Main function for application -* -* @param [in] argc Number of arguments in shell -* @param [in] argv Pointer to arguments -* -* @return The standard return value -*/ -int main(int argc, char* argv[]); - -/** -* Shows the help for the application -* @param [in] applicationName The name of the application -*/ -void ShowHelp(const std::string& applicationName); - -/** -* Runs the result pooling -*/ -void RunResultPooling(const cParameterContainer& inputParams, const fs::path& pathToResults); - -/*! -* Loop over the issues of the checker bundles of the result container: -* Convert the xml location of the issues in a file location -* and add the file location to the issue. -*/ -static void AddFileLocationsToIssues(); - -/** -* Get working directory -* -* @return directory, from where the application is started -*/ -const fs::path GetWorkingDir(); \ No newline at end of file diff --git a/src/result_pooling/src/resultPooling.cpp b/src/result_pooling/src/result_pooling.cpp similarity index 75% rename from src/result_pooling/src/resultPooling.cpp rename to src/result_pooling/src/result_pooling.cpp index 69c14f8f..a6f6e7f1 100644 --- a/src/result_pooling/src/resultPooling.cpp +++ b/src/result_pooling/src/result_pooling.cpp @@ -5,24 +5,24 @@ * Public License, v. 2.0. If a copy of the MPL was not distributed * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "result_pooling.h" +#include "common/config_format/c_configuration.h" +#include "common/result_format/c_checker_bundle.h" +#include "common/result_format/c_file_location.h" +#include "common/result_format/c_inertial_location.h" +#include "common/result_format/c_issue.h" +#include "common/result_format/c_locations_container.h" +#include "common/result_format/c_parameter_container.h" +#include "common/result_format/c_result_container.h" +#include "common/result_format/c_road_location.h" +#include "common/result_format/c_xml_location.h" +#include "common/xml/c_x_path_evaluator.h" #include "stdafx.h" -#include "resultPooling.h" -#include "common/result_format/cCheckerBundle.h" -#include "common/result_format/cIssue.h" -#include "common/result_format/cLocationsContainer.h" -#include "common/result_format/cParameterContainer.h" -#include "common/result_format/cFileLocation.h" -#include "common/result_format/cRoadLocation.h" -#include "common/result_format/cXMLLocation.h" -#include "common/result_format/cInertialLocation.h" -#include "common/result_format/cResultContainer.h" -#include "common/config_format/cConfiguration.h" -#include "common/xml/cXPathEvaluator.h" - -cResultContainer * pResultContainer; + +cResultContainer *pResultContainer; // Main Programm -int main(int argc, char* argv[]) +int main(int argc, char *argv[]) { std::string strToolpath = argv[0]; @@ -55,7 +55,8 @@ int main(int argc, char* argv[]) fs::path pFilepath = strFilepath; if (pFilepath.is_absolute()) resultsDirectory = pFilepath; - else { + else + { if ("/" == strFilepath) resultsDirectory += strFilepath; else @@ -72,11 +73,11 @@ int main(int argc, char* argv[]) } RunResultPooling(inputParams, resultsDirectory); - -return 0; + + return 0; } -void ShowHelp(const std::string& toolPath) +void ShowHelp(const std::string &toolPath) { std::string applicationName = toolPath; std::string applicationNameWithoutExt = toolPath; @@ -91,7 +92,7 @@ void ShowHelp(const std::string& toolPath) std::cout << "\n\n"; } -void RunResultPooling(const cParameterContainer& inputParams, const fs::path& resultsDirectory) +void RunResultPooling(const cParameterContainer &inputParams, const fs::path &resultsDirectory) { std::string strResultFile = inputParams.GetParam("strResultFile"); @@ -110,12 +111,10 @@ void RunResultPooling(const cParameterContainer& inputParams, const fs::path& re file.remove(); } std::cout << std::endl << std::endl; - std::cout << "Collect results from directory: " << std::endl - << resultsDirectory << std::endl - << std::endl; + std::cout << "Collect results from directory: " << std::endl << resultsDirectory << std::endl << std::endl; std::cout << "Found: " << std::endl; - for (auto& pFilePath : fs::directory_iterator(resultsDirectory)) + for (auto &pFilePath : fs::directory_iterator(resultsDirectory)) { std::string strFilePath = pFilePath.path().string(); std::string strFileName = strFilePath; @@ -147,10 +146,9 @@ void RunResultPooling(const cParameterContainer& inputParams, const fs::path& re static void AddFileLocationsToIssues() { // Calculate and set file location for ervery xml location - std::list checkerBundles = pResultContainer->GetCheckerBundles(); - for (std::list::const_iterator itCheckerBundle = checkerBundles.cbegin(); - itCheckerBundle != checkerBundles.cend(); - itCheckerBundle++) + std::list checkerBundles = pResultContainer->GetCheckerBundles(); + for (std::list::const_iterator itCheckerBundle = checkerBundles.cbegin(); + itCheckerBundle != checkerBundles.cend(); itCheckerBundle++) { cXPathEvaluator xodrXPathEvaluator; cXPathEvaluator xoscXPathEvaluator; @@ -168,21 +166,17 @@ static void AddFileLocationsToIssues() successXoscContent = xoscXPathEvaluator.SetXmlContent(QString::fromStdString(xoscFilePath)); // Evaluate XPath for every issue and set calculated file location - std::list issues = (*itCheckerBundle)->GetIssues(); - for (std::list::const_iterator itIssue = issues.cbegin(); itIssue != issues.cend(); - itIssue++) + std::list issues = (*itCheckerBundle)->GetIssues(); + for (std::list::const_iterator itIssue = issues.cbegin(); itIssue != issues.cend(); itIssue++) { for (const auto location : (*itIssue)->GetLocationsContainer()) { // Check for xml Location - std::list extInformations = - location->GetExtendedInformations(); - for (std::list::const_iterator extIt = - extInformations.cbegin(); - extIt != extInformations.cend(); - extIt++) + std::list extInformations = location->GetExtendedInformations(); + for (std::list::const_iterator extIt = extInformations.cbegin(); + extIt != extInformations.cend(); extIt++) { - cXMLLocation* xmlLocation = dynamic_cast(*extIt); + cXMLLocation *xmlLocation = dynamic_cast(*extIt); if (nullptr != xmlLocation) { // Calculate and set file location @@ -211,10 +205,9 @@ static void AddFileLocationsToIssues() } if (!successGetRows) - std::cerr - << "Could not calculate file location for current issue (xpath: '" - << xpath << "')." << std::endl - << std::endl; + std::cerr << "Could not calculate file location for current issue (xpath: '" << xpath + << "')." << std::endl + << std::endl; } } } @@ -225,4 +218,4 @@ static void AddFileLocationsToIssues() const fs::path GetWorkingDir() { return fs::current_path(); -} \ No newline at end of file +} diff --git a/src/result_pooling/src/result_pooling.h b/src/result_pooling/src/result_pooling.h new file mode 100644 index 00000000..b1169e2b --- /dev/null +++ b/src/result_pooling/src/result_pooling.h @@ -0,0 +1,51 @@ +/* + * Copyright 2023 CARIAD SE. + * + * This Source Code Form is subject to the terms of the Mozilla + * Public License, v. 2.0. If a copy of the MPL was not distributed + * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#include "common/qc4openx_filesystem.h" +#include "common/result_format/c_result_container.h" +#include "common/util.h" +#include + +#define CHECKER_BUNDLE_NAME "ResultPooling" + +class cParameterContainer; + +/** + * Main function for application + * + * @param [in] argc Number of arguments in shell + * @param [in] argv Pointer to arguments + * + * @return The standard return value + */ +int main(int argc, char *argv[]); + +/** + * Shows the help for the application + * @param [in] applicationName The name of the application + */ +void ShowHelp(const std::string &applicationName); + +/** + * Runs the result pooling + */ +void RunResultPooling(const cParameterContainer &inputParams, const fs::path &pathToResults); + +/*! + * Loop over the issues of the checker bundles of the result container: + * Convert the xml location of the issues in a file location + * and add the file location to the issue. + */ +static void AddFileLocationsToIssues(); + +/** + * Get working directory + * + * @return directory, from where the application is started + */ +const fs::path GetWorkingDir(); diff --git a/src/result_pooling/src/stdafx.h b/src/result_pooling/src/stdafx.h index dc1a675a..80bf8468 100644 --- a/src/result_pooling/src/stdafx.h +++ b/src/result_pooling/src/stdafx.h @@ -8,12 +8,12 @@ #ifndef _STD_INCLUDES_HEADER_FEP_XODR_MANIPULATION_ #define _STD_INCLUDES_HEADER_FEP_XODR_MANIPULATION_ -#include #include -#include #include -#include #include +#include +#include +#include #include "common/util.h" diff --git a/src/runtime/CMakeLists.txt b/src/runtime/CMakeLists.txt index 16c78fb2..ba9cacc6 100644 --- a/src/runtime/CMakeLists.txt +++ b/src/runtime/CMakeLists.txt @@ -11,21 +11,21 @@ set(CMAKE_AUTOMOC ON) qt5_add_resources(Resources res/POC_Runtime.qrc) add_executable(${RUNTIME_PROJECT} - src/cConfigurationValidator.cpp - src/cConfigurationValidator.h + src/c_configuration_validator.cpp + src/c_configuration_validator.h src/runtime.cpp src/runtime.h src/stdafx.cpp src/stdafx.h - src/ui/cCheckerDialog.cpp - src/ui/cParamDialog.cpp - src/ui/cLocalParamDialog.cpp - src/ui/cGlobalParamDialog.cpp - src/ui/cProcessLog.cpp - src/ui/cProcessView.cpp - src/ui/cRuntimeControl.cpp - src/ui/cRuntimeThread.cpp - src/ui/cRuntimeWindow.cpp + src/ui/c_checker_dialog.cpp + src/ui/c_param_dialog.cpp + src/ui/c_local_param_dialog.cpp + src/ui/c_global_param_dialog.cpp + src/ui/c_process_log.cpp + src/ui/c_process_view.cpp + src/ui/c_runtime_control.cpp + src/ui/c_runtime_thread.cpp + src/ui/c_runtime_window.cpp ${Resources} ) diff --git a/src/runtime/src/cConfigurationValidator.cpp b/src/runtime/src/c_configuration_validator.cpp similarity index 76% rename from src/runtime/src/cConfigurationValidator.cpp rename to src/runtime/src/c_configuration_validator.cpp index 4a8521bd..0115025a 100644 --- a/src/runtime/src/cConfigurationValidator.cpp +++ b/src/runtime/src/c_configuration_validator.cpp @@ -5,12 +5,11 @@ * Public License, v. 2.0. If a copy of the MPL was not distributed * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "cConfigurationValidator.h" +#include "c_configuration_validator.h" -#include "common/config_format/cConfiguration.h" +#include "common/config_format/c_configuration.h" -bool cConfigurationValidator::ValidateConfiguration(cConfiguration* const configuration, - std::string& message) +bool cConfigurationValidator::ValidateConfiguration(cConfiguration *const configuration, std::string &message) { message = "Unknown failure"; @@ -30,8 +29,7 @@ bool cConfigurationValidator::ValidateConfiguration(cConfiguration* const config return true; } -bool cConfigurationValidator::CheckNecessaryParametersExist(cConfiguration* const configuration, - std::string& message) +bool cConfigurationValidator::CheckNecessaryParametersExist(cConfiguration *const configuration, std::string &message) { if (!configuration->HasParam(PARAM_XODR_FILE) && !configuration->HasParam(PARAM_XOSC_FILE)) { @@ -42,11 +40,10 @@ bool cConfigurationValidator::CheckNecessaryParametersExist(cConfiguration* cons return true; } -bool cConfigurationValidator::CheckParameterNotEmptyAndCorrectExtension( - cConfiguration* const configuration, - const std::string& paramName, - const std::string& extension, - std::string& message) +bool cConfigurationValidator::CheckParameterNotEmptyAndCorrectExtension(cConfiguration *const configuration, + const std::string ¶mName, + const std::string &extension, + std::string &message) { if (configuration->HasParam(paramName)) { diff --git a/src/runtime/src/cConfigurationValidator.h b/src/runtime/src/c_configuration_validator.h similarity index 60% rename from src/runtime/src/cConfigurationValidator.h rename to src/runtime/src/c_configuration_validator.h index ec6e105b..18428269 100644 --- a/src/runtime/src/cConfigurationValidator.h +++ b/src/runtime/src/c_configuration_validator.h @@ -16,16 +16,18 @@ class cConfiguration; class cConfigurationValidator { -public: + public: // Checks a Configuration for consistency - static bool ValidateConfiguration(cConfiguration* config, std::string& message); + static bool ValidateConfiguration(cConfiguration *config, std::string &message); -protected: + protected: // Check if at least one of the necessary parameters exists - static bool CheckNecessaryParametersExist(cConfiguration* const configuration, std::string& message); + static bool CheckNecessaryParametersExist(cConfiguration *const configuration, std::string &message); // Check if parameter is valid (is not empty and has the expected file extension) - static bool CheckParameterNotEmptyAndCorrectExtension(cConfiguration* const configuration, const std::string& paramName, const std::string& extension, std::string& message); + static bool CheckParameterNotEmptyAndCorrectExtension(cConfiguration *const configuration, + const std::string ¶mName, const std::string &extension, + std::string &message); }; -#endif \ No newline at end of file +#endif diff --git a/src/runtime/src/runtime.cpp b/src/runtime/src/runtime.cpp index a8d62ce1..7433fbe1 100644 --- a/src/runtime/src/runtime.cpp +++ b/src/runtime/src/runtime.cpp @@ -5,15 +5,15 @@ * Public License, v. 2.0. If a copy of the MPL was not distributed * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "stdafx.h" #include "runtime.h" +#include "stdafx.h" -#include "ui/cRuntimeWindow.h" +#include "ui/c_runtime_window.h" XERCES_CPP_NAMESPACE_USE // Main program entry point -int main(int argc, char* argv[]) +int main(int argc, char *argv[]) { std::string strToolpath = argv[0]; @@ -68,10 +68,10 @@ int main(int argc, char* argv[]) QApplication app(argc, argv); RunConfigGUI(strConfigurationFilepath, strXODRFilepath, strXOSCFilePath, bAutostart, app); -return 0; + return 0; } -void ShowHelp(const std::string& toolPath) +void ShowHelp(const std::string &toolPath) { std::string applicationName = toolPath; std::string applicationNameWithoutExt = toolPath; @@ -83,20 +83,15 @@ void ShowHelp(const std::string& toolPath) << applicationName << " myConfiguration.xml" << std::endl; std::cout << "\nOpen the application with myConfiguration.xml and a given xodr which is under " "test. Autostart enables the automatic validation mode: \n" - << applicationName << " -config myConfiguration.xml -xodr myTrack.xodr [-autostart]" - << std::endl; + << applicationName << " -config myConfiguration.xml -xodr myTrack.xodr [-autostart]" << std::endl; std::cout << "\nOpen the application with myConfiguration.xml and a given xosc which is under " "test. Autostart enables the automatic validation mode: \n" - << applicationName << " -config myConfiguration.xml -xosc myTrack.xosc [-autostart]" - << std::endl; + << applicationName << " -config myConfiguration.xml -xosc myTrack.xosc [-autostart]" << std::endl; std::cout << "\n\n"; } -void RunConfigGUI(const std::string& strConfigurationFilepath, - const std::string& strXODRFilepath, - const std::string& strXOSCFilePath, - const bool bAutostart, - const QApplication& app) +void RunConfigGUI(const std::string &strConfigurationFilepath, const std::string &strXODRFilepath, + const std::string &strXOSCFilePath, const bool bAutostart, const QApplication &app) { cRuntimeWindow mainWindow(strConfigurationFilepath, strXODRFilepath, strXOSCFilePath, bAutostart); mainWindow.show(); @@ -112,4 +107,3 @@ void RunConfigGUI(const std::string& strConfigurationFilepath, else app.exec(); } - diff --git a/src/runtime/src/runtime.h b/src/runtime/src/runtime.h index d41309ff..6ec38ed1 100644 --- a/src/runtime/src/runtime.h +++ b/src/runtime/src/runtime.h @@ -10,22 +10,23 @@ #include /** -* Main function for application -* -* @param [in] argc Number of arguments in shell -* @param [in] argv Pointer to arguments -* -* @return The standard return value -*/ -int main(int argc, char* argv[]); + * Main function for application + * + * @param [in] argc Number of arguments in shell + * @param [in] argv Pointer to arguments + * + * @return The standard return value + */ +int main(int argc, char *argv[]); /** -* Shows the help for the application -* @param [in] applicationName The name of the application -*/ -void ShowHelp(const std::string& applicationName); + * Shows the help for the application + * @param [in] applicationName The name of the application + */ +void ShowHelp(const std::string &applicationName); /** -* Runs the config gui -*/ -void RunConfigGUI(const std::string& strConfigurationFilepath, const std::string& strXODRFilepath, const std::string& strXOSCFilePath, const bool bAutostart, const QApplication& app); + * Runs the config gui + */ +void RunConfigGUI(const std::string &strConfigurationFilepath, const std::string &strXODRFilepath, + const std::string &strXOSCFilePath, const bool bAutostart, const QApplication &app); diff --git a/src/runtime/src/stdafx.h b/src/runtime/src/stdafx.h index ef776dfb..370fd954 100644 --- a/src/runtime/src/stdafx.h +++ b/src/runtime/src/stdafx.h @@ -8,12 +8,11 @@ #ifndef _STD_INCLUDE_HEADER_ #define _STD_INCLUDE_HEADER_ -#include #include -#include #include +#include +#include #include "common/util.h" - #endif // _STD_INCLUDE_HEADER_ diff --git a/src/runtime/src/ui/cGlobalParamDialog.h b/src/runtime/src/ui/cGlobalParamDialog.h deleted file mode 100644 index 2a2e80e1..00000000 --- a/src/runtime/src/ui/cGlobalParamDialog.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ -#ifndef CGLOBAL_PARAM_DIALOG_H -#define CGLOBAL_PARAM_DIALOG_H - -#include "cParamDialog.h" - -// Forward declaration to avoid problems with circular dependencies (especially under Linux) -class cConfiguration; -class cProcessView; - -class cGlobalParamDialog : public cParamDialog -{ - Q_OBJECT - -public: - cGlobalParamDialog(const QString& initalParamName, const QString& initalParamValue, const bool paramNameEditable, cProcessView* parent, const cConfiguration* currentConfig); - -protected: - cProcessView* _processView{nullptr}; - QComboBox* _paramNameComboBox{nullptr}; - QPushButton* _fileOpenButton{nullptr}; - - void InitUIElements(const QString& initalParamName, const QString& initalParamValue, const bool paramNameEditable, const cConfiguration* currentConfig); - void AddWidgetsToLayout(const QString& initalParamName); - -private: - void AddFileOpenButton(const char* slot); - void RemoveFileOpenButton(); - -public slots: - void SwitchCall(const QString& paramName); - void SaveAndClose(); - void OpenXODRFile(); - void OpenXOSCFile(); -}; - -#endif - diff --git a/src/runtime/src/ui/cCheckerDialog.cpp b/src/runtime/src/ui/c_checker_dialog.cpp similarity index 82% rename from src/runtime/src/ui/cCheckerDialog.cpp rename to src/runtime/src/ui/c_checker_dialog.cpp index b925b94e..4dea8fd4 100644 --- a/src/runtime/src/ui/cCheckerDialog.cpp +++ b/src/runtime/src/ui/c_checker_dialog.cpp @@ -5,17 +5,17 @@ * Public License, v. 2.0. If a copy of the MPL was not distributed * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "cCheckerDialog.h" +#include "c_checker_dialog.h" #include -cCheckerDialog::cCheckerDialog(eIssueLevel minLevel, eIssueLevel maxLevel, QWidget* parent) : QDialog(parent) +cCheckerDialog::cCheckerDialog(eIssueLevel minLevel, eIssueLevel maxLevel, QWidget *parent) : QDialog(parent) { - QVBoxLayout * layout = new QVBoxLayout; + QVBoxLayout *layout = new QVBoxLayout; - QWidget* paramWidget = new QWidget(this); - QVBoxLayout * paramWidgetLayout = new QVBoxLayout; + QWidget *paramWidget = new QWidget(this); + QVBoxLayout *paramWidgetLayout = new QVBoxLayout; - QLabel* minLevelLabel = new QLabel(paramWidget); + QLabel *minLevelLabel = new QLabel(paramWidget); minLevelLabel->setText("Minimal warn level of issues"); _minLevelEdit = new QComboBox(this); @@ -31,7 +31,7 @@ cCheckerDialog::cCheckerDialog(eIssueLevel minLevel, eIssueLevel maxLevel, QWidg _minLevelEdit->setCurrentIndex(index); } - QLabel* maxLevelLabel = new QLabel(paramWidget); + QLabel *maxLevelLabel = new QLabel(paramWidget); maxLevelLabel->setText("Maximal warn level of issues"); _maxLevelEdit = new QComboBox(this); @@ -54,7 +54,7 @@ cCheckerDialog::cCheckerDialog(eIssueLevel minLevel, eIssueLevel maxLevel, QWidg paramWidgetLayout->addWidget(_maxLevelEdit, 0); paramWidget->setLayout(paramWidgetLayout); - QPushButton* okay = new QPushButton(this); + QPushButton *okay = new QPushButton(this); okay->setText("Set"); connect(okay, SIGNAL(clicked()), this, SLOT(SaveAndClose())); @@ -86,5 +86,5 @@ eIssueLevel cCheckerDialog::GetMinLevel() const eIssueLevel cCheckerDialog::GetMaxLevel() const { assert(_maxLevelEdit != nullptr); - return static_cast(_maxLevelEdit->currentData().toInt()); -} \ No newline at end of file + return static_cast(_maxLevelEdit->currentData().toInt()); +} diff --git a/src/runtime/src/ui/cCheckerDialog.h b/src/runtime/src/ui/c_checker_dialog.h similarity index 81% rename from src/runtime/src/ui/cCheckerDialog.h rename to src/runtime/src/ui/c_checker_dialog.h index 77552f57..6fac185a 100644 --- a/src/runtime/src/ui/cCheckerDialog.h +++ b/src/runtime/src/ui/c_checker_dialog.h @@ -8,35 +8,35 @@ #ifndef CCHECKER_DIALOG_H #define CCHECKER_DIALOG_H +#include #include -#include +#include #include #include -#include #include -#include +#include -#include "common/result_format/cIssue.h" +#include "common/result_format/c_issue.h" class cCheckerDialog : public QDialog { Q_OBJECT -public: - cCheckerDialog(eIssueLevel minLevel, eIssueLevel maxLevel, QWidget* parent); - + public: + cCheckerDialog(eIssueLevel minLevel, eIssueLevel maxLevel, QWidget *parent); + // Returns the min level eIssueLevel GetMinLevel() const; // Returns the max level eIssueLevel GetMaxLevel() const; -protected: - QComboBox* _minLevelEdit{nullptr}; - QComboBox* _maxLevelEdit{nullptr}; + protected: + QComboBox *_minLevelEdit{nullptr}; + QComboBox *_maxLevelEdit{nullptr}; -public slots: + public slots: void SaveAndClose(); }; -#endif \ No newline at end of file +#endif diff --git a/src/runtime/src/ui/cGlobalParamDialog.cpp b/src/runtime/src/ui/c_global_param_dialog.cpp similarity index 70% rename from src/runtime/src/ui/cGlobalParamDialog.cpp rename to src/runtime/src/ui/c_global_param_dialog.cpp index de14ecda..efa271a4 100644 --- a/src/runtime/src/ui/cGlobalParamDialog.cpp +++ b/src/runtime/src/ui/c_global_param_dialog.cpp @@ -5,22 +5,25 @@ * Public License, v. 2.0. If a copy of the MPL was not distributed * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "cGlobalParamDialog.h" +#include "c_global_param_dialog.h" #include "common/util.h" -#include "cProcessView.h" +#include "c_process_view.h" -#include "common/config_format/cConfiguration.h" +#include "common/config_format/c_configuration.h" -cGlobalParamDialog::cGlobalParamDialog(const QString& initalParamName, const QString& initalParamValue, const bool paramNameEditable, cProcessView* parent, const cConfiguration* currentConfig) : - cParamDialog(initalParamName, initalParamValue, paramNameEditable, parent) +cGlobalParamDialog::cGlobalParamDialog(const QString &initalParamName, const QString &initalParamValue, + const bool paramNameEditable, cProcessView *parent, + const cConfiguration *currentConfig) + : cParamDialog(initalParamName, initalParamValue, paramNameEditable, parent) { _processView = parent; InitUIElements(initalParamName, initalParamValue, paramNameEditable, currentConfig); AddWidgetsToLayout(initalParamName); } -void cGlobalParamDialog::InitUIElements(const QString& initalParamName, const QString& initalParamValue, const bool paramNameEditable, const cConfiguration* currentConfig) +void cGlobalParamDialog::InitUIElements(const QString &initalParamName, const QString &initalParamValue, + const bool paramNameEditable, const cConfiguration *currentConfig) { InitBasicUIElements(initalParamName, initalParamValue); @@ -44,11 +47,11 @@ void cGlobalParamDialog::InitUIElements(const QString& initalParamName, const QS _paramNameComboBox->setEditable(true); _paramNameComboBox->setEnabled(paramNameEditable); - connect(_paramNameComboBox, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(SwitchCall(const QString&))); - connect(_paramNameComboBox, SIGNAL(editTextChanged(const QString&)), this, SLOT(SwitchCall(const QString&))); + connect(_paramNameComboBox, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(SwitchCall(const QString &))); + connect(_paramNameComboBox, SIGNAL(editTextChanged(const QString &)), this, SLOT(SwitchCall(const QString &))); } -void cGlobalParamDialog::AddWidgetsToLayout(const QString& initalParamName) +void cGlobalParamDialog::AddWidgetsToLayout(const QString &initalParamName) { _paramWidgetLayout->addWidget(_paramNameComboBox, 2); AddBasicWidgetsToLayout(); @@ -56,7 +59,7 @@ void cGlobalParamDialog::AddWidgetsToLayout(const QString& initalParamName) SwitchCall(initalParamName); } -void cGlobalParamDialog::SwitchCall(const QString& paramName) +void cGlobalParamDialog::SwitchCall(const QString ¶mName) { RemoveFileOpenButton(); @@ -66,7 +69,7 @@ void cGlobalParamDialog::SwitchCall(const QString& paramName) AddFileOpenButton(SLOT(OpenXOSCFile())); } -void cGlobalParamDialog::AddFileOpenButton(const char* slot) +void cGlobalParamDialog::AddFileOpenButton(const char *slot) { _fileOpenButton = new QPushButton(this); _fileOpenButton->setText("..."); @@ -96,7 +99,7 @@ void cGlobalParamDialog::SaveAndClose() std::string xodrFilePath = ""; // When we could retrieve a path, set it - if(GetXodrFilePathFromXosc(xoscFilePath, xodrFilePath)) + if (GetXodrFilePathFromXosc(xoscFilePath, xodrFilePath)) _processView->SetGlobalParamXodrFile(xodrFilePath); } else if (_paramName.toLower() == QString::fromStdString(PARAM_XODR_FILE).toLower()) @@ -109,10 +112,7 @@ void cGlobalParamDialog::SaveAndClose() void cGlobalParamDialog::OpenXODRFile() { - QString filePath = QFileDialog::getOpenFileName(this, - tr("Open File"), - "", - tr("OpenDRIVE (*.xodr)")); + QString filePath = QFileDialog::getOpenFileName(this, tr("Open File"), "", tr("OpenDRIVE (*.xodr)")); if (!filePath.isEmpty()) _paramValueEdit->setText(filePath); @@ -120,11 +120,8 @@ void cGlobalParamDialog::OpenXODRFile() void cGlobalParamDialog::OpenXOSCFile() { - QString filePath = QFileDialog::getOpenFileName(this, - tr("Open File"), - "", - tr("OpenSCENARIO (*.xosc)")); + QString filePath = QFileDialog::getOpenFileName(this, tr("Open File"), "", tr("OpenSCENARIO (*.xosc)")); if (!filePath.isEmpty()) _paramValueEdit->setText(filePath); -} \ No newline at end of file +} diff --git a/src/runtime/src/ui/c_global_param_dialog.h b/src/runtime/src/ui/c_global_param_dialog.h new file mode 100644 index 00000000..74781c8b --- /dev/null +++ b/src/runtime/src/ui/c_global_param_dialog.h @@ -0,0 +1,45 @@ +/* + * Copyright 2023 CARIAD SE. + * + * This Source Code Form is subject to the terms of the Mozilla + * Public License, v. 2.0. If a copy of the MPL was not distributed + * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ +#ifndef CGLOBAL_PARAM_DIALOG_H +#define CGLOBAL_PARAM_DIALOG_H + +#include "c_param_dialog.h" + +// Forward declaration to avoid problems with circular dependencies (especially under Linux) +class cConfiguration; +class cProcessView; + +class cGlobalParamDialog : public cParamDialog +{ + Q_OBJECT + + public: + cGlobalParamDialog(const QString &initalParamName, const QString &initalParamValue, const bool paramNameEditable, + cProcessView *parent, const cConfiguration *currentConfig); + + protected: + cProcessView *_processView{nullptr}; + QComboBox *_paramNameComboBox{nullptr}; + QPushButton *_fileOpenButton{nullptr}; + + void InitUIElements(const QString &initalParamName, const QString &initalParamValue, const bool paramNameEditable, + const cConfiguration *currentConfig); + void AddWidgetsToLayout(const QString &initalParamName); + + private: + void AddFileOpenButton(const char *slot); + void RemoveFileOpenButton(); + + public slots: + void SwitchCall(const QString ¶mName); + void SaveAndClose(); + void OpenXODRFile(); + void OpenXOSCFile(); +}; + +#endif diff --git a/src/runtime/src/ui/cLocalParamDialog.cpp b/src/runtime/src/ui/c_local_param_dialog.cpp similarity index 63% rename from src/runtime/src/ui/cLocalParamDialog.cpp rename to src/runtime/src/ui/c_local_param_dialog.cpp index e3297581..ee272b49 100644 --- a/src/runtime/src/ui/cLocalParamDialog.cpp +++ b/src/runtime/src/ui/c_local_param_dialog.cpp @@ -5,15 +5,18 @@ * Public License, v. 2.0. If a copy of the MPL was not distributed * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "cLocalParamDialog.h" +#include "c_local_param_dialog.h" -cLocalParamDialog::cLocalParamDialog(const QString& initalParamName, const QString& initalParamValue, const bool paramNameEditable, QWidget* parent) : cParamDialog(initalParamName, initalParamValue, paramNameEditable, parent) +cLocalParamDialog::cLocalParamDialog(const QString &initalParamName, const QString &initalParamValue, + const bool paramNameEditable, QWidget *parent) + : cParamDialog(initalParamName, initalParamValue, paramNameEditable, parent) { InitUIElements(initalParamName, initalParamValue, paramNameEditable); AddWidgetsToLayout(); } -void cLocalParamDialog::InitUIElements(const QString& initalParamName, const QString& initalParamValue, const bool paramNameEditable) +void cLocalParamDialog::InitUIElements(const QString &initalParamName, const QString &initalParamValue, + const bool paramNameEditable) { InitBasicUIElements(initalParamName, initalParamValue); @@ -34,4 +37,4 @@ void cLocalParamDialog::SaveAndClose() _paramValue = _paramValueEdit->text(); accept(); -} \ No newline at end of file +} diff --git a/src/runtime/src/ui/cLocalParamDialog.h b/src/runtime/src/ui/c_local_param_dialog.h similarity index 53% rename from src/runtime/src/ui/cLocalParamDialog.h rename to src/runtime/src/ui/c_local_param_dialog.h index 4b83b58a..747ae4fb 100644 --- a/src/runtime/src/ui/cLocalParamDialog.h +++ b/src/runtime/src/ui/c_local_param_dialog.h @@ -8,24 +8,24 @@ #ifndef CLOCAL_PARAM_DIALOG_H #define CLOCAL_PARAM_DIALOG_H -#include "cParamDialog.h" +#include "c_param_dialog.h" class cLocalParamDialog : public cParamDialog { Q_OBJECT -public: - cLocalParamDialog(const QString& initalParamName, const QString& initalParamValue, const bool paramNameEditable, QWidget* parent); + public: + cLocalParamDialog(const QString &initalParamName, const QString &initalParamValue, const bool paramNameEditable, + QWidget *parent); -protected: - QLineEdit* _paramNameEdit{nullptr}; + protected: + QLineEdit *_paramNameEdit{nullptr}; - void InitUIElements(const QString& initalParamName, const QString& initalParamValue, const bool paramNameEditable); + void InitUIElements(const QString &initalParamName, const QString &initalParamValue, const bool paramNameEditable); void AddWidgetsToLayout(); -public slots: + public slots: void SaveAndClose(); }; #endif - diff --git a/src/runtime/src/ui/cParamDialog.cpp b/src/runtime/src/ui/c_param_dialog.cpp similarity index 74% rename from src/runtime/src/ui/cParamDialog.cpp rename to src/runtime/src/ui/c_param_dialog.cpp index acf68a4e..f69230cb 100644 --- a/src/runtime/src/ui/cParamDialog.cpp +++ b/src/runtime/src/ui/c_param_dialog.cpp @@ -5,24 +5,22 @@ * Public License, v. 2.0. If a copy of the MPL was not distributed * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "cParamDialog.h" +#include "c_param_dialog.h" -cParamDialog::cParamDialog(const QString& /*initalParamName*/, - const QString& /*initalParamValue*/, - const bool /*paramNameEditable*/, - QWidget* parent) +cParamDialog::cParamDialog(const QString & /*initalParamName*/, const QString & /*initalParamValue*/, + const bool /*paramNameEditable*/, QWidget *parent) : QDialog(parent) { } -void cParamDialog::InitBasicUIElements(const QString& initalParamName, const QString& initalParamValue) +void cParamDialog::InitBasicUIElements(const QString &initalParamName, const QString &initalParamValue) { _paramName = initalParamName; _paramValue = initalParamValue; - QVBoxLayout* layout = new QVBoxLayout; + QVBoxLayout *layout = new QVBoxLayout; - QWidget* paramWidget = new QWidget(this); + QWidget *paramWidget = new QWidget(this); _paramWidgetLayout = new QHBoxLayout; _paramWidgetLayout->setContentsMargins(3, 3, 3, 3); paramWidget->setLayout(_paramWidgetLayout); @@ -34,7 +32,7 @@ void cParamDialog::InitBasicUIElements(const QString& initalParamName, const QSt _paramValueEdit = new QLineEdit(this); _paramValueEdit->setText(initalParamValue); - QPushButton* okayButton = new QPushButton(this); + QPushButton *okayButton = new QPushButton(this); okayButton->setText("Set"); connect(okayButton, SIGNAL(clicked()), this, SLOT(SaveAndClose())); @@ -67,4 +65,4 @@ QString cParamDialog::GetParamName() const QString cParamDialog::GetParamValue() const { return _paramValue; -} \ No newline at end of file +} diff --git a/src/runtime/src/ui/cParamDialog.h b/src/runtime/src/ui/c_param_dialog.h similarity index 68% rename from src/runtime/src/ui/cParamDialog.h rename to src/runtime/src/ui/c_param_dialog.h index 42248522..4165cae5 100644 --- a/src/runtime/src/ui/cParamDialog.h +++ b/src/runtime/src/ui/c_param_dialog.h @@ -8,21 +8,22 @@ #ifndef CPARAM_DIALOG_H #define CPARAM_DIALOG_H +#include #include -#include +#include #include #include #include -#include #include -#include +#include class cParamDialog : public QDialog { Q_OBJECT -public: - cParamDialog(const QString& initalParamName, const QString& initalParamValue, const bool paramNameEditable, QWidget* parent); + public: + cParamDialog(const QString &initalParamName, const QString &initalParamValue, const bool paramNameEditable, + QWidget *parent); // Returns the name of the param QString GetParamName() const; @@ -30,19 +31,19 @@ class cParamDialog : public QDialog // Returns the value of the param QString GetParamValue() const; -protected: + protected: QString _paramName; QString _paramValue; - QHBoxLayout* _paramWidgetLayout{nullptr}; - QLabel* _paramLabel{nullptr}; - QLineEdit* _paramValueEdit{nullptr}; + QHBoxLayout *_paramWidgetLayout{nullptr}; + QLabel *_paramLabel{nullptr}; + QLineEdit *_paramValueEdit{nullptr}; - void InitBasicUIElements(const QString& initalParamName, const QString& initalParamValue); + void InitBasicUIElements(const QString &initalParamName, const QString &initalParamValue); void AddBasicWidgetsToLayout(); -public slots: + public slots: virtual void SaveAndClose() = 0; }; -#endif \ No newline at end of file +#endif diff --git a/src/runtime/src/ui/cProcessLog.cpp b/src/runtime/src/ui/c_process_log.cpp similarity index 84% rename from src/runtime/src/ui/cProcessLog.cpp rename to src/runtime/src/ui/c_process_log.cpp index c62b0f1e..f4952d58 100644 --- a/src/runtime/src/ui/cProcessLog.cpp +++ b/src/runtime/src/ui/c_process_log.cpp @@ -32,12 +32,12 @@ * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "cProcessLog.h" +#include "c_process_log.h" #include #include -cProcessLog::cProcessLog(QWidget* parent) : QPlainTextEdit(parent) +cProcessLog::cProcessLog(QWidget *parent) : QPlainTextEdit(parent) { QFont font; font.setFamily("Courier"); @@ -68,7 +68,7 @@ cProcessLog::~cProcessLog() delete _metrics; } -void cProcessLog::SaveToFile(const QString& filepath) const +void cProcessLog::SaveToFile(const QString &filepath) const { QFile file(filepath); if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) @@ -85,12 +85,12 @@ void cProcessLog::Clear() clear(); } -void cProcessLog::Log(const QString& log) +void cProcessLog::Log(const QString &log) { appendPlainText(log); } -void cProcessLog::LineNumberAreaPaintEvent(QPaintEvent* event) +void cProcessLog::LineNumberAreaPaintEvent(QPaintEvent *event) { assert(_metrics != nullptr); assert(_lineNumberArea != nullptr); @@ -104,11 +104,10 @@ void cProcessLog::LineNumberAreaPaintEvent(QPaintEvent* event) painter.setPen(Qt::black); QTextBlock block = firstVisibleBlock(); int lineno = 1 + block.blockNumber(); - for (; block.isValid() && block.isVisible(); block = block.next(), ++lineno) { - auto ypos = - static_cast(blockBoundingGeometry(block).translated(contentOffset()).top()); - painter.drawText( - 0, ypos, _lineNumberArea->width(), height, Qt::AlignRight, QString::number(lineno)); + for (; block.isValid() && block.isVisible(); block = block.next(), ++lineno) + { + auto ypos = static_cast(blockBoundingGeometry(block).translated(contentOffset()).top()); + painter.drawText(0, ypos, _lineNumberArea->width(), height, Qt::AlignRight, QString::number(lineno)); } } @@ -120,13 +119,14 @@ int cProcessLog::LineNumberAreaWidth() const return qMax(3, space); } -void cProcessLog::UpdateLineNumberArea(const QRect& rect, int dy) +void cProcessLog::UpdateLineNumberArea(const QRect &rect, int dy) { assert(_lineNumberArea != nullptr); if (dy) _lineNumberArea->scroll(0, dy); - else { + else + { _lineNumberArea->update(0, rect.y(), _lineNumberArea->width(), rect.height()); } @@ -139,13 +139,12 @@ void cProcessLog::UpdateLineNumberAreaWidth(int /* newBlockCount */) setViewportMargins(LineNumberAreaWidth() + 10, 0, 10, 0); } -void cProcessLog::resizeEvent(QResizeEvent* event) +void cProcessLog::resizeEvent(QResizeEvent *event) { assert(_lineNumberArea != nullptr); QPlainTextEdit::resizeEvent(event); QRect cr = contentsRect(); - _lineNumberArea->setGeometry( - QRect(cr.left() + 2, cr.top(), LineNumberAreaWidth() + 2, cr.height())); + _lineNumberArea->setGeometry(QRect(cr.left() + 2, cr.top(), LineNumberAreaWidth() + 2, cr.height())); } diff --git a/src/runtime/src/ui/cProcessLog.h b/src/runtime/src/ui/c_process_log.h similarity index 78% rename from src/runtime/src/ui/cProcessLog.h rename to src/runtime/src/ui/c_process_log.h index 0f9188bd..5336f514 100644 --- a/src/runtime/src/ui/cProcessLog.h +++ b/src/runtime/src/ui/c_process_log.h @@ -40,44 +40,46 @@ #include #include -class cProcessLog : public QPlainTextEdit { +class cProcessLog : public QPlainTextEdit +{ Q_OBJECT -protected: -public: - cProcessLog(QWidget* parent = 0); + protected: + public: + cProcessLog(QWidget *parent = 0); virtual ~cProcessLog(); // Dumps the console output into a file - void SaveToFile(const QString& filepath) const; + void SaveToFile(const QString &filepath) const; // Clears the console void Clear(); // Paints the lins number are - void LineNumberAreaPaintEvent(QPaintEvent* event); + void LineNumberAreaPaintEvent(QPaintEvent *event); // Returns the width od the line numer area int LineNumberAreaWidth() const; -public slots: - void Log(const QString& log); + public slots: + void Log(const QString &log); - void UpdateLineNumberArea(const QRect& rect, int dy); + void UpdateLineNumberArea(const QRect &rect, int dy); void UpdateLineNumberAreaWidth(int); -protected: - void resizeEvent(QResizeEvent* event) override; + protected: + void resizeEvent(QResizeEvent *event) override; -private: - QWidget* _lineNumberArea{nullptr}; - QFontMetrics* _metrics{nullptr}; + private: + QWidget *_lineNumberArea{nullptr}; + QFontMetrics *_metrics{nullptr}; }; -class cLineNumberArea : public QWidget { -public: - cLineNumberArea(cProcessLog* editor) : QWidget(editor), codeEditor(editor) +class cLineNumberArea : public QWidget +{ + public: + cLineNumberArea(cProcessLog *editor) : QWidget(editor), codeEditor(editor) { // codeEditor = editor; } @@ -87,14 +89,14 @@ class cLineNumberArea : public QWidget { return QSize(codeEditor->LineNumberAreaWidth(), 0); } -protected: - void paintEvent(QPaintEvent* event) override + protected: + void paintEvent(QPaintEvent *event) override { codeEditor->LineNumberAreaPaintEvent(event); } -private: - cProcessLog* codeEditor; + private: + cProcessLog *codeEditor; }; -#endif \ No newline at end of file +#endif diff --git a/src/runtime/src/ui/cProcessView.cpp b/src/runtime/src/ui/c_process_view.cpp similarity index 57% rename from src/runtime/src/ui/cProcessView.cpp rename to src/runtime/src/ui/c_process_view.cpp index 18fb2c8e..79a394b9 100644 --- a/src/runtime/src/ui/cProcessView.cpp +++ b/src/runtime/src/ui/c_process_view.cpp @@ -5,23 +5,23 @@ * Public License, v. 2.0. If a copy of the MPL was not distributed * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "cProcessView.h" +#include "c_process_view.h" -#include "common/result_format/cResultContainer.h" -#include "common/result_format/cParameterContainer.h" -#include "common/result_format/cCheckerBundle.h" +#include "common/result_format/c_checker_bundle.h" +#include "common/result_format/c_parameter_container.h" +#include "common/result_format/c_result_container.h" -#include "common/config_format/cConfiguration.h" -#include "common/config_format/cConfigurationChecker.h" -#include "common/config_format/cConfigurationCheckerBundle.h" -#include "common/config_format/cConfigurationReportModule.h" +#include "common/config_format/c_configuration.h" +#include "common/config_format/c_configuration_checker.h" +#include "common/config_format/c_configuration_checker_bundle.h" +#include "common/config_format/c_configuration_report_module.h" -#include "cParamDialog.h" -#include "cLocalParamDialog.h" -#include "cGlobalParamDialog.h" -#include "cCheckerDialog.h" +#include "c_checker_dialog.h" +#include "c_global_param_dialog.h" +#include "c_local_param_dialog.h" +#include "c_param_dialog.h" -cProcessView::cProcessView(QWidget* parent) : QTreeWidget(parent) +cProcessView::cProcessView(QWidget *parent) : QTreeWidget(parent) { setContextMenuPolicy(Qt::CustomContextMenu); @@ -35,7 +35,7 @@ const QString cProcessView::GetApplicationDir() return QCoreApplication::applicationDirPath() + "/"; } -void cProcessView::LoadConfiguration(cConfiguration* const configuration) +void cProcessView::LoadConfiguration(cConfiguration *const configuration) { _currentConfiguration = configuration; clear(); @@ -44,30 +44,24 @@ void cProcessView::LoadConfiguration(cConfiguration* const configuration) std::vector paramNames = configParams.GetParams(); // Add Configuration Params - for (std::vector::const_iterator paramIt = paramNames.cbegin(); - paramIt != paramNames.cend(); + for (std::vector::const_iterator paramIt = paramNames.cbegin(); paramIt != paramNames.cend(); paramIt++) { AddParamItemToRoot(*paramIt, configParams.GetParam(*paramIt)); } // Add CheckerBundles - std::vector checkerBundle = configuration->GetCheckerBundles(); - for (std::vector::const_iterator bundleIt = - checkerBundle.cbegin(); - bundleIt != checkerBundle.cend(); - bundleIt++) + std::vector checkerBundle = configuration->GetCheckerBundles(); + for (std::vector::const_iterator bundleIt = checkerBundle.cbegin(); + bundleIt != checkerBundle.cend(); bundleIt++) { AddCheckerBundleItemToRoot(*bundleIt); } - // Add ReportModules - std::vector reportModules = configuration->GetReportModules(); - for (std::vector::const_iterator reportModuleIt = - reportModules.cbegin(); - reportModuleIt != reportModules.cend(); - reportModuleIt++) + std::vector reportModules = configuration->GetReportModules(); + for (std::vector::const_iterator reportModuleIt = reportModules.cbegin(); + reportModuleIt != reportModules.cend(); reportModuleIt++) { AddReportModuleItemToRoot(*reportModuleIt); } @@ -75,37 +69,31 @@ void cProcessView::LoadConfiguration(cConfiguration* const configuration) expandAll(); } -void cProcessView::AddConfiguration(cConfiguration* const configurationToAdd) +void cProcessView::AddConfiguration(cConfiguration *const configurationToAdd) { if (nullptr == configurationToAdd) return; // Add CheckerBundles - std::vector checkerBundle = - configurationToAdd->GetCheckerBundles(); - for (std::vector::const_iterator bundleIt = - checkerBundle.cbegin(); - bundleIt != checkerBundle.cend(); - bundleIt++) + std::vector checkerBundle = configurationToAdd->GetCheckerBundles(); + for (std::vector::const_iterator bundleIt = checkerBundle.cbegin(); + bundleIt != checkerBundle.cend(); bundleIt++) { AddCheckerBundleItemToRoot(*bundleIt, true); } - // Add ReportModules - std::vector reportModules = configurationToAdd->GetReportModules(); - for (std::vector::const_iterator reportModuleIt = - reportModules.cbegin(); - reportModuleIt != reportModules.cend(); - reportModuleIt++) + std::vector reportModules = configurationToAdd->GetReportModules(); + for (std::vector::const_iterator reportModuleIt = reportModules.cbegin(); + reportModuleIt != reportModules.cend(); reportModuleIt++) { AddReportModuleItemToRoot(*reportModuleIt, true); } } -void cProcessView::showContextMenu(const QPoint & pos) +void cProcessView::showContextMenu(const QPoint &pos) { - QTreeWidgetItem* currentItem = itemAt(pos); + QTreeWidgetItem *currentItem = itemAt(pos); QMenu menu(this); if (nullptr != currentItem) @@ -114,83 +102,79 @@ void cProcessView::showContextMenu(const QPoint & pos) switch (itemType.toInt()) { - case ITEM_PARAM: - { - QAction* editAction = new QAction("Edit"); - menu.addAction(editAction); - QAction* deleteAction = new QAction("Delete"); - menu.addAction(deleteAction); - - connect(editAction, SIGNAL(triggered(void)), this, SLOT(EditParam())); - connect(deleteAction, SIGNAL(triggered(void)), this, SLOT(DeleteParam())); - break; - } - case ITEM_CHECKER_BUNDLE: - { - QAction* addParameterAction = new QAction("Add Parameter"); - menu.addAction(addParameterAction); - menu.addSeparator(); - QAction* deleteAction = new QAction("Delete"); - menu.addAction(deleteAction); - - menu.addSeparator(); - QAction* moveUpAction = new QAction("Move Up"); - menu.addAction(moveUpAction); - QAction* moveDownAction = new QAction("Move Down"); - menu.addAction(moveDownAction); - - connect(addParameterAction, SIGNAL(triggered(void)), this, SLOT(AddLocalParam())); - connect(deleteAction, SIGNAL(triggered(void)), this, SLOT(DeleteCheckerBundle())); - connect(moveUpAction, SIGNAL(triggered(void)), this, SLOT(MoveUp())); - connect(moveDownAction, SIGNAL(triggered(void)), this, SLOT(MoveDown())); - - break; - } - case ITEM_CHECKER: - { - QAction* addParameterAction = new QAction("Add Parameter"); - menu.addAction(addParameterAction); + case ITEM_PARAM: { + QAction *editAction = new QAction("Edit"); + menu.addAction(editAction); + QAction *deleteAction = new QAction("Delete"); + menu.addAction(deleteAction); + + connect(editAction, SIGNAL(triggered(void)), this, SLOT(EditParam())); + connect(deleteAction, SIGNAL(triggered(void)), this, SLOT(DeleteParam())); + break; + } + case ITEM_CHECKER_BUNDLE: { + QAction *addParameterAction = new QAction("Add Parameter"); + menu.addAction(addParameterAction); + menu.addSeparator(); + QAction *deleteAction = new QAction("Delete"); + menu.addAction(deleteAction); + + menu.addSeparator(); + QAction *moveUpAction = new QAction("Move Up"); + menu.addAction(moveUpAction); + QAction *moveDownAction = new QAction("Move Down"); + menu.addAction(moveDownAction); + + connect(addParameterAction, SIGNAL(triggered(void)), this, SLOT(AddLocalParam())); + connect(deleteAction, SIGNAL(triggered(void)), this, SLOT(DeleteCheckerBundle())); + connect(moveUpAction, SIGNAL(triggered(void)), this, SLOT(MoveUp())); + connect(moveDownAction, SIGNAL(triggered(void)), this, SLOT(MoveDown())); - QAction* editAction = new QAction("Edit"); - menu.addAction(editAction); - QAction* deleteAction = new QAction("Delete"); - menu.addAction(deleteAction); + break; + } + case ITEM_CHECKER: { + QAction *addParameterAction = new QAction("Add Parameter"); + menu.addAction(addParameterAction); - connect(addParameterAction, SIGNAL(triggered(void)), this, SLOT(AddLocalParam())); - connect(editAction, SIGNAL(triggered(void)), this, SLOT(EditChecker())); - connect(deleteAction, SIGNAL(triggered(void)), this, SLOT(DeleteChecker())); + QAction *editAction = new QAction("Edit"); + menu.addAction(editAction); + QAction *deleteAction = new QAction("Delete"); + menu.addAction(deleteAction); - break; - } - case ITEM_REPORT_MODULE: - { - QAction* addParameterAction = new QAction("Add Parameter"); - menu.addAction(addParameterAction); - - menu.addSeparator(); - QAction* editAction = new QAction("Edit"); - menu.addAction(editAction); - QAction* deleteAction = new QAction("Delete"); - menu.addAction(deleteAction); - - menu.addSeparator(); - QAction* moveUpAction = new QAction("Move Up"); - menu.addAction(moveUpAction); - QAction* moveDownAction = new QAction("Move Down"); - menu.addAction(moveDownAction); - - connect(addParameterAction, SIGNAL(triggered(void)), this, SLOT(AddLocalParam())); - connect(deleteAction, SIGNAL(triggered(void)), this, SLOT(DeleteReportModule())); - connect(moveUpAction, SIGNAL(triggered(void)), this, SLOT(MoveUp())); - connect(moveDownAction, SIGNAL(triggered(void)), this, SLOT(MoveDown())); - - break; - } + connect(addParameterAction, SIGNAL(triggered(void)), this, SLOT(AddLocalParam())); + connect(editAction, SIGNAL(triggered(void)), this, SLOT(EditChecker())); + connect(deleteAction, SIGNAL(triggered(void)), this, SLOT(DeleteChecker())); + + break; + } + case ITEM_REPORT_MODULE: { + QAction *addParameterAction = new QAction("Add Parameter"); + menu.addAction(addParameterAction); + + menu.addSeparator(); + QAction *editAction = new QAction("Edit"); + menu.addAction(editAction); + QAction *deleteAction = new QAction("Delete"); + menu.addAction(deleteAction); + + menu.addSeparator(); + QAction *moveUpAction = new QAction("Move Up"); + menu.addAction(moveUpAction); + QAction *moveDownAction = new QAction("Move Down"); + menu.addAction(moveDownAction); + + connect(addParameterAction, SIGNAL(triggered(void)), this, SLOT(AddLocalParam())); + connect(deleteAction, SIGNAL(triggered(void)), this, SLOT(DeleteReportModule())); + connect(moveUpAction, SIGNAL(triggered(void)), this, SLOT(MoveUp())); + connect(moveDownAction, SIGNAL(triggered(void)), this, SLOT(MoveDown())); + + break; + } } } else { - QAction* addModuleAction = new QAction("Add Module"); + QAction *addModuleAction = new QAction("Add Module"); menu.addAction(addModuleAction); connect(addModuleAction, SIGNAL(triggered(void)), this, SLOT(AddModule())); @@ -199,9 +183,9 @@ void cProcessView::showContextMenu(const QPoint & pos) menu.exec(mapToGlobal(pos)); }; -void cProcessView::mouseDoubleClickEvent(QMouseEvent* event) +void cProcessView::mouseDoubleClickEvent(QMouseEvent *event) { - QTreeWidgetItem* clickedItem = itemAt(event->pos()); + QTreeWidgetItem *clickedItem = itemAt(event->pos()); if (nullptr != clickedItem) { @@ -214,43 +198,41 @@ void cProcessView::mouseDoubleClickEvent(QMouseEvent* event) } } -cParamData cProcessView::GetParamDataFromItem(const QTreeWidgetItem* item) +cParamData cProcessView::GetParamDataFromItem(const QTreeWidgetItem *item) { QVariant data = item->data(0, ITEM_DATA_ID); cParamData paramData = data.value(); return paramData; } -cCheckerBundleData cProcessView::GetCheckerBundleDataFromItem(const QTreeWidgetItem* item) +cCheckerBundleData cProcessView::GetCheckerBundleDataFromItem(const QTreeWidgetItem *item) { QVariant data = item->data(0, ITEM_DATA_ID); cCheckerBundleData checkerBundleData = data.value(); return checkerBundleData; - } -cCheckerData cProcessView::GetCheckerDataFromItem(const QTreeWidgetItem* item) +cCheckerData cProcessView::GetCheckerDataFromItem(const QTreeWidgetItem *item) { QVariant data = item->data(0, ITEM_DATA_ID); cCheckerData checkerData = data.value(); return checkerData; - } -cReportModuleData cProcessView::GetReportModuleDataFromItem(const QTreeWidgetItem* item) +cReportModuleData cProcessView::GetReportModuleDataFromItem(const QTreeWidgetItem *item) { QVariant data = item->data(0, ITEM_DATA_ID); cReportModuleData reportModuleData = data.value(); return reportModuleData; - } -void cProcessView::AddCheckerBundleItemToRoot(cConfigurationCheckerBundle* const checkerBundle, const bool expand) +void cProcessView::AddCheckerBundleItemToRoot(cConfigurationCheckerBundle *const checkerBundle, const bool expand) { - QTreeWidgetItem* newCheckerBundleItem = new QTreeWidgetItem(invisibleRootItem()); + QTreeWidgetItem *newCheckerBundleItem = new QTreeWidgetItem(invisibleRootItem()); newCheckerBundleItem->setBackgroundColor(0, QColor(0, 120, 250, 128)); - newCheckerBundleItem->setText(0, QString("CheckerBundle %1").arg(checkerBundle->GetCheckerBundleApplication().c_str())); + newCheckerBundleItem->setText( + 0, QString("CheckerBundle %1").arg(checkerBundle->GetCheckerBundleApplication().c_str())); newCheckerBundleItem->setChildIndicatorPolicy(QTreeWidgetItem::DontShowIndicatorWhenChildless); newCheckerBundleItem->setData(0, ITEM_TYPE_ID, ITEM_CHECKER_BUNDLE); @@ -267,18 +249,16 @@ void cProcessView::AddCheckerBundleItemToRoot(cConfigurationCheckerBundle* const cParameterContainer configParams = checkerBundle->GetParams(); std::vector paramNames = configParams.GetParams(); - for (std::vector::const_iterator paramIt = paramNames.cbegin(); - paramIt != paramNames.cend(); + for (std::vector::const_iterator paramIt = paramNames.cbegin(); paramIt != paramNames.cend(); paramIt++) { AddParamItem(newCheckerBundleItem, *paramIt, configParams.GetParam(*paramIt)); } // Add Checkers - std::vector checkers = checkerBundle->GetCheckers(); - for (std::vector::const_iterator checkerIt = checkers.cbegin(); - checkerIt != checkers.cend(); - checkerIt++) + std::vector checkers = checkerBundle->GetCheckers(); + for (std::vector::const_iterator checkerIt = checkers.cbegin(); + checkerIt != checkers.cend(); checkerIt++) { AddCheckerItem(newCheckerBundleItem, *checkerIt); } @@ -289,16 +269,15 @@ void cProcessView::AddCheckerBundleItemToRoot(cConfigurationCheckerBundle* const addTopLevelItem(newCheckerBundleItem); } -void cProcessView::AddCheckerItem(QTreeWidgetItem* parentCheckerBundleItem, cConfigurationChecker* const checker) +void cProcessView::AddCheckerItem(QTreeWidgetItem *parentCheckerBundleItem, cConfigurationChecker *const checker) { - QTreeWidgetItem* newCheckerItem = new QTreeWidgetItem(parentCheckerBundleItem); + QTreeWidgetItem *newCheckerItem = new QTreeWidgetItem(parentCheckerBundleItem); newCheckerItem->setBackgroundColor(0, QColor(0, 120, 250, 32)); std::stringstream ssCheckerName; - ssCheckerName << checker->GetCheckerId().c_str() << " [" - << PrintIssueLevel(checker->GetMinLevel()) << ", " - << PrintIssueLevel(checker->GetMaxLevel()) << "]"; + ssCheckerName << checker->GetCheckerId().c_str() << " [" << PrintIssueLevel(checker->GetMinLevel()) << ", " + << PrintIssueLevel(checker->GetMaxLevel()) << "]"; newCheckerItem->setText(0, ssCheckerName.str().c_str()); newCheckerItem->setChildIndicatorPolicy(QTreeWidgetItem::DontShowIndicatorWhenChildless); @@ -318,8 +297,7 @@ void cProcessView::AddCheckerItem(QTreeWidgetItem* parentCheckerBundleItem, cCon cParameterContainer configParams = checker->GetParams(); std::vector paramNames = configParams.GetParams(); - for (std::vector::const_iterator paramIt = paramNames.cbegin(); - paramIt != paramNames.cend(); + for (std::vector::const_iterator paramIt = paramNames.cbegin(); paramIt != paramNames.cend(); paramIt++) { AddParamItem(newCheckerItem, *paramIt, configParams.GetParam(*paramIt)); @@ -328,9 +306,9 @@ void cProcessView::AddCheckerItem(QTreeWidgetItem* parentCheckerBundleItem, cCon parentCheckerBundleItem->addChild(newCheckerItem); } -void cProcessView::AddReportModuleItemToRoot(cConfigurationReportModule* const reportModule, const bool expand) +void cProcessView::AddReportModuleItemToRoot(cConfigurationReportModule *const reportModule, const bool expand) { - QTreeWidgetItem* newReportModuleItem = new QTreeWidgetItem(invisibleRootItem()); + QTreeWidgetItem *newReportModuleItem = new QTreeWidgetItem(invisibleRootItem()); newReportModuleItem->setBackgroundColor(0, QColor(0, 113, 77, 91)); newReportModuleItem->setText(0, QString("ReportModule %1").arg(reportModule->GetReportModuleApplication().c_str())); @@ -349,8 +327,7 @@ void cProcessView::AddReportModuleItemToRoot(cConfigurationReportModule* const r // Add Report Params cParameterContainer configParams = reportModule->GetParams(); std::vector paramNames = configParams.GetParams(); - for (std::vector::const_iterator paramIt = paramNames.cbegin(); - paramIt != paramNames.cend(); + for (std::vector::const_iterator paramIt = paramNames.cbegin(); paramIt != paramNames.cend(); paramIt++) { AddParamItem(newReportModuleItem, *paramIt, configParams.GetParam(*paramIt)); @@ -362,23 +339,18 @@ void cProcessView::AddReportModuleItemToRoot(cConfigurationReportModule* const r addTopLevelItem(newReportModuleItem); } - -void cProcessView::AddParamItem(QTreeWidgetItem* parentItem, - const std::string& name, - const std::string& value) +void cProcessView::AddParamItem(QTreeWidgetItem *parentItem, const std::string &name, const std::string &value) { - QTreeWidgetItem* newParamItem = new QTreeWidgetItem(parentItem); + QTreeWidgetItem *newParamItem = new QTreeWidgetItem(parentItem); AddParamToItem(newParamItem, name, value); parentItem->addChild(newParamItem); } -void cProcessView::AddParamItemToRoot(const std::string& name, - const std::string& value, - const bool setAsFirstItem) +void cProcessView::AddParamItemToRoot(const std::string &name, const std::string &value, const bool setAsFirstItem) { - QTreeWidgetItem* newParamItem = new QTreeWidgetItem(invisibleRootItem()); + QTreeWidgetItem *newParamItem = new QTreeWidgetItem(invisibleRootItem()); AddParamToItem(newParamItem, name, value); @@ -387,14 +359,12 @@ void cProcessView::AddParamItemToRoot(const std::string& name, if (setAsFirstItem) { int index = invisibleRootItem()->indexOfChild(newParamItem); - QTreeWidgetItem* child = invisibleRootItem()->takeChild(index); + QTreeWidgetItem *child = invisibleRootItem()->takeChild(index); invisibleRootItem()->insertChild(0, child); } } -void cProcessView::AddParamToItem(QTreeWidgetItem* newItem, - const std::string& name, - const std::string& value) +void cProcessView::AddParamToItem(QTreeWidgetItem *newItem, const std::string &name, const std::string &value) { newItem->setChildIndicatorPolicy(QTreeWidgetItem::DontShowIndicatorWhenChildless); newItem->setData(0, ITEM_TYPE_ID, ITEM_PARAM); @@ -402,9 +372,7 @@ void cProcessView::AddParamToItem(QTreeWidgetItem* newItem, SetParamDataOnItem(newItem, name, value); } -void cProcessView::SetParamDataOnItem(QTreeWidgetItem* item, - const std::string& name, - const std::string& value) +void cProcessView::SetParamDataOnItem(QTreeWidgetItem *item, const std::string &name, const std::string &value) { cParamData newData; newData.paramName = name; @@ -418,13 +386,12 @@ void cProcessView::SetParamDataOnItem(QTreeWidgetItem* item, item->setText(0, QString("%1=\"%2\"").arg(name.c_str(), value.c_str())); } -QTreeWidgetItem* cProcessView::HasParamItem(const QTreeWidgetItem* parentItem, - const std::string& name) +QTreeWidgetItem *cProcessView::HasParamItem(const QTreeWidgetItem *parentItem, const std::string &name) { - QTreeWidgetItem* foundItem = nullptr; + QTreeWidgetItem *foundItem = nullptr; for (int i = 0; i < parentItem->childCount(); i++) { - QTreeWidgetItem* child = parentItem->child(i); + QTreeWidgetItem *child = parentItem->child(i); cParamData paramData = GetParamDataFromItem(child); if (paramData.paramName == name) @@ -441,7 +408,7 @@ void cProcessView::AddLocalParam() { if (selectedItems().count() > 0) { - QTreeWidgetItem* selected = selectedItems().first(); + QTreeWidgetItem *selected = selectedItems().first(); cLocalParamDialog newDlg("newParameter", "", true, this); @@ -450,12 +417,13 @@ void cProcessView::AddLocalParam() std::string paramName = newDlg.GetParamName().toLocal8Bit().data(); std::string paramValue = newDlg.GetParamValue().toLocal8Bit().data(); - QTreeWidgetItem* existingItem = HasParamItem(selected, paramName); + QTreeWidgetItem *existingItem = HasParamItem(selected, paramName); if (existingItem) { - QMessageBox::StandardButton reply = QMessageBox::question(this, - "Overwrite Parameter", - "Do you want to overwrite\nthe parameter '" + QString::fromStdString(paramName) + "'\nwith '" + QString::fromStdString(paramValue) + "'?", + QMessageBox::StandardButton reply = QMessageBox::question( + this, "Overwrite Parameter", + "Do you want to overwrite\nthe parameter '" + QString::fromStdString(paramName) + "'\nwith '" + + QString::fromStdString(paramValue) + "'?", QMessageBox::Yes | QMessageBox::No); if (reply == QMessageBox::Yes) @@ -485,13 +453,14 @@ void cProcessView::AddGlobalParam() std::string paramName = newDlg.GetParamName().toLocal8Bit().data(); std::string paramValue = newDlg.GetParamValue().toLocal8Bit().data(); - QTreeWidgetItem* existingItem = HasParamItem(invisibleRootItem(), paramName); + QTreeWidgetItem *existingItem = HasParamItem(invisibleRootItem(), paramName); if (existingItem) { - QMessageBox::StandardButton reply = QMessageBox::question(this, - "Overwrite Parameter", - "Do you want to overwrite\nthe parameter '" + QString::fromStdString(paramName) + "'\nwith '" + QString::fromStdString(paramValue) + "'?", - QMessageBox::Yes | QMessageBox::No); + QMessageBox::StandardButton reply = + QMessageBox::question(this, "Overwrite Parameter", + "Do you want to overwrite\nthe parameter '" + QString::fromStdString(paramName) + + "'\nwith '" + QString::fromStdString(paramValue) + "'?", + QMessageBox::Yes | QMessageBox::No); if (reply == QMessageBox::Yes) { @@ -507,19 +476,19 @@ void cProcessView::AddGlobalParam() } } -void cProcessView::SetGlobalParamXodrFile(const std::string& xodrFilePath) +void cProcessView::SetGlobalParamXodrFile(const std::string &xodrFilePath) { std::string paramName = PARAM_XODR_FILE; std::string paramValue = xodrFilePath; - QTreeWidgetItem* existingItem = HasParamItem(invisibleRootItem(), paramName); + QTreeWidgetItem *existingItem = HasParamItem(invisibleRootItem(), paramName); if (existingItem) { - QMessageBox::StandardButton reply = QMessageBox::question(this, - "Overwrite Parameter", - "\nShould be the parameter '" + QString::fromStdString(paramName) + "' overwritten with:\n\n" + - QString::fromStdString(paramValue), - QMessageBox::Yes | QMessageBox::No); + QMessageBox::StandardButton reply = + QMessageBox::question(this, "Overwrite Parameter", + "\nShould be the parameter '" + QString::fromStdString(paramName) + + "' overwritten with:\n\n" + QString::fromStdString(paramValue), + QMessageBox::Yes | QMessageBox::No); if (reply == QMessageBox::Yes) { @@ -540,35 +509,37 @@ void cProcessView::EditParam() EditParam(selectedItems().first()); } -void cProcessView::EditParam(QTreeWidgetItem* item) +void cProcessView::EditParam(QTreeWidgetItem *item) { cParamData paramData = GetParamDataFromItem(item); - cParamDialog* newDlg; + cParamDialog *newDlg; if (item->parent() == nullptr) { cConfiguration currentConfig; GetConfigurationFromView(¤tConfig); - newDlg = new cGlobalParamDialog(paramData.paramName.c_str(), paramData.paramValue.c_str(), false, this, ¤tConfig); + newDlg = new cGlobalParamDialog(paramData.paramName.c_str(), paramData.paramValue.c_str(), false, this, + ¤tConfig); } else newDlg = new cLocalParamDialog(paramData.paramName.c_str(), paramData.paramValue.c_str(), false, this); if (newDlg->exec() == QDialog::Accepted) { - SetParamDataOnItem(item, newDlg->GetParamName().toLocal8Bit().data(), newDlg->GetParamValue().toLocal8Bit().data()); + SetParamDataOnItem(item, newDlg->GetParamName().toLocal8Bit().data(), + newDlg->GetParamValue().toLocal8Bit().data()); emit ChangeConfiguration(); } } -void cProcessView::GetConfigurationFromView(cConfiguration* newConfiguration) +void cProcessView::GetConfigurationFromView(cConfiguration *newConfiguration) { - QTreeWidgetItem* rootItem = invisibleRootItem(); + QTreeWidgetItem *rootItem = invisibleRootItem(); newConfiguration->Clear(); for (int i = 0; i < rootItem->childCount(); ++i) { - QTreeWidgetItem* configurationItem = rootItem->child(i); + QTreeWidgetItem *configurationItem = rootItem->child(i); // Params... if (configurationItem->data(0, ITEM_TYPE_ID) == ITEM_PARAM) @@ -580,11 +551,11 @@ void cProcessView::GetConfigurationFromView(cConfiguration* newConfiguration) else if (configurationItem->data(0, ITEM_TYPE_ID) == ITEM_CHECKER_BUNDLE) { cCheckerBundleData bundleData = GetCheckerBundleDataFromItem(configurationItem); - cConfigurationCheckerBundle* newBundle = newConfiguration->AddCheckerBundle(bundleData.applicationName); + cConfigurationCheckerBundle *newBundle = newConfiguration->AddCheckerBundle(bundleData.applicationName); for (int j = 0; j < configurationItem->childCount(); ++j) { - QTreeWidgetItem* checkerBundleItem = configurationItem->child(j); + QTreeWidgetItem *checkerBundleItem = configurationItem->child(j); if (checkerBundleItem->data(0, ITEM_TYPE_ID) == ITEM_PARAM) { @@ -595,11 +566,12 @@ void cProcessView::GetConfigurationFromView(cConfiguration* newConfiguration) else if (checkerBundleItem->data(0, ITEM_TYPE_ID) == ITEM_CHECKER) { cCheckerData checkerData = GetCheckerDataFromItem(checkerBundleItem); - cConfigurationChecker* newChecker = newBundle->AddChecker(checkerData.checkerId, checkerData.minLevel, checkerData.maxLevel); + cConfigurationChecker *newChecker = + newBundle->AddChecker(checkerData.checkerId, checkerData.minLevel, checkerData.maxLevel); for (int p = 0; p < checkerBundleItem->childCount(); ++p) { - QTreeWidgetItem* checkerItem = checkerBundleItem->child(p); + QTreeWidgetItem *checkerItem = checkerBundleItem->child(p); if (checkerItem->data(0, ITEM_TYPE_ID) == ITEM_PARAM) { @@ -613,12 +585,12 @@ void cProcessView::GetConfigurationFromView(cConfiguration* newConfiguration) else if (configurationItem->data(0, ITEM_TYPE_ID) == ITEM_REPORT_MODULE) { cReportModuleData moduleData = GetReportModuleDataFromItem(configurationItem); - cConfigurationReportModule* newModule = newConfiguration->AddReportModule(moduleData.applicationName); + cConfigurationReportModule *newModule = newConfiguration->AddReportModule(moduleData.applicationName); // Params for reportModules... for (int j = 0; j < configurationItem->childCount(); ++j) { - QTreeWidgetItem* reportModuleItem = configurationItem->child(j); + QTreeWidgetItem *reportModuleItem = configurationItem->child(j); if (reportModuleItem->data(0, ITEM_TYPE_ID) == ITEM_PARAM) { @@ -641,7 +613,7 @@ void cProcessView::EditChecker() if (selectedItems().count() > 0) EditChecker(selectedItems().first()); } -void cProcessView::EditChecker(QTreeWidgetItem* item) +void cProcessView::EditChecker(QTreeWidgetItem *item) { QVariant data = item->data(0, ITEM_DATA_ID); @@ -655,9 +627,8 @@ void cProcessView::EditChecker(QTreeWidgetItem* item) data.setValue(moduleData); std::stringstream ssIconName; - ssIconName << moduleData.checkerId << " [" - << PrintIssueLevel(moduleData.minLevel) << ", " - << PrintIssueLevel(moduleData.maxLevel) << "]"; + ssIconName << moduleData.checkerId << " [" << PrintIssueLevel(moduleData.minLevel) << ", " + << PrintIssueLevel(moduleData.maxLevel) << "]"; item->setData(0, ITEM_DATA_ID, data); item->setText(0, ssIconName.str().c_str()); @@ -680,10 +651,8 @@ void cProcessView::DeleteReportModule() void cProcessView::SelectModuleFromFileSystem() { - QString pathToNewModule = QFileDialog::getOpenFileName( this, - tr("Add module to configuration"), - GetApplicationDir(), - tr("CheckerBundles, ReportModules (*.exe);;All files (*)")); + QString pathToNewModule = QFileDialog::getOpenFileName(this, tr("Add module to configuration"), GetApplicationDir(), + tr("CheckerBundles, ReportModules (*.exe);;All files (*)")); if (pathToNewModule.length() > 0) { @@ -693,18 +662,18 @@ void cProcessView::SelectModuleFromFileSystem() void cProcessView::MoveUp() { - QTreeWidgetItem* item = currentItem(); + QTreeWidgetItem *item = currentItem(); int row = currentIndex().row(); if (item && row > 0) { - QTreeWidgetItem* parent = item->parent(); + QTreeWidgetItem *parent = item->parent(); if (nullptr == parent) parent = invisibleRootItem(); int index = parent->indexOfChild(item); - QTreeWidgetItem* child = parent->takeChild(index); + QTreeWidgetItem *child = parent->takeChild(index); parent->insertChild((index > 1) ? index - 1 : 1, child); } @@ -714,18 +683,18 @@ void cProcessView::MoveUp() void cProcessView::MoveDown() { - QTreeWidgetItem* item = currentItem(); + QTreeWidgetItem *item = currentItem(); int row = currentIndex().row(); if (item && row > 0) { - QTreeWidgetItem* parent = item->parent(); + QTreeWidgetItem *parent = item->parent(); if (nullptr == parent) parent = invisibleRootItem(); int index = parent->indexOfChild(item); - QTreeWidgetItem* child = parent->takeChild(index); + QTreeWidgetItem *child = parent->takeChild(index); parent->insertChild((index < topLevelItemCount()) ? index + 1 : index, child); } @@ -739,14 +708,14 @@ void cProcessView::DeleteCheckerBundle() DeleteItem(selectedItems().first(), true); } -void cProcessView::DeleteItem(QTreeWidgetItem* item, bool deleteChilds) +void cProcessView::DeleteItem(QTreeWidgetItem *item, bool deleteChilds) { if (deleteChilds) { // Delete childs for (int i = 0; i < item->childCount(); ++i) { - QTreeWidgetItem* childItem = item->child(i); + QTreeWidgetItem *childItem = item->child(i); DeleteItem(childItem, deleteChilds); } @@ -756,4 +725,3 @@ void cProcessView::DeleteItem(QTreeWidgetItem* item, bool deleteChilds) emit ChangeConfiguration(); } - diff --git a/src/runtime/src/ui/cProcessView.h b/src/runtime/src/ui/c_process_view.h similarity index 64% rename from src/runtime/src/ui/cProcessView.h rename to src/runtime/src/ui/c_process_view.h index b02375e3..31e32ca0 100644 --- a/src/runtime/src/ui/cProcessView.h +++ b/src/runtime/src/ui/c_process_view.h @@ -8,19 +8,19 @@ #ifndef CPROCESS_VIEW_H #define CPROCESS_VIEW_H -#include -#include #include +#include #include +#include #include -#include -#include #include +#include +#include -#include "common/result_format/cIssue.h" -#include "common/result_format/cResultContainer.h" +#include "common/result_format/c_issue.h" +#include "common/result_format/c_result_container.h" class cParamDialog; class cCheckerDialog; @@ -65,7 +65,7 @@ class cProcessView : public QTreeWidget { Q_OBJECT -protected: + protected: static const unsigned int ITEM_TYPE_ID = Qt::UserRole + 1; static const unsigned int ITEM_DATA_ID = Qt::UserRole + 10; static const unsigned int ITEM_PARAM = 0; @@ -74,58 +74,58 @@ class cProcessView : public QTreeWidget static const unsigned int ITEM_REPORT_MODULE = 3; // Pointer to current configuration which is hold in cRuntimeWindow - const cConfiguration* _currentConfiguration{nullptr}; + const cConfiguration *_currentConfiguration{nullptr}; -public: - cProcessView(QWidget* parent = nullptr); + public: + cProcessView(QWidget *parent = nullptr); /** - * Loads a configuration in the processView - **/ - void LoadConfiguration(cConfiguration* const configuration); + * Loads a configuration in the processView + **/ + void LoadConfiguration(cConfiguration *const configuration); /*! * Adds a configuration * * \param configurationToAdd */ - void AddConfiguration(cConfiguration* const configurationToAdd); + void AddConfiguration(cConfiguration *const configurationToAdd); - void GetConfigurationFromView(cConfiguration* newConfiguration); + void GetConfigurationFromView(cConfiguration *newConfiguration); - void SetGlobalParamXodrFile(const std::string& xodrFilePath); + void SetGlobalParamXodrFile(const std::string &xodrFilePath); -private: + private: // Add checker bundle item to invisible root item - void AddCheckerBundleItemToRoot(cConfigurationCheckerBundle* const checkerBundle, const bool expand = false); + void AddCheckerBundleItemToRoot(cConfigurationCheckerBundle *const checkerBundle, const bool expand = false); // Add checker item to checker bundle item - void AddCheckerItem(QTreeWidgetItem* parentCheckerBundleItem, cConfigurationChecker* const checker); + void AddCheckerItem(QTreeWidgetItem *parentCheckerBundleItem, cConfigurationChecker *const checker); // Add report module item to invisible root item - void AddReportModuleItemToRoot(cConfigurationReportModule* const reportModule, const bool expand = false); + void AddReportModuleItemToRoot(cConfigurationReportModule *const reportModule, const bool expand = false); // Add param item to parent item - void AddParamItem(QTreeWidgetItem* parentItem, const std::string& name, const std::string& value); + void AddParamItem(QTreeWidgetItem *parentItem, const std::string &name, const std::string &value); // Add param item to invisible root item - void AddParamItemToRoot(const std::string& name, const std::string& value, const bool setAsFirstItem = false); + void AddParamItemToRoot(const std::string &name, const std::string &value, const bool setAsFirstItem = false); - void AddParamToItem(QTreeWidgetItem* newItem, const std::string& name, const std::string& value); + void AddParamToItem(QTreeWidgetItem *newItem, const std::string &name, const std::string &value); // Set param data and text - void SetParamDataOnItem(QTreeWidgetItem* item, const std::string& name, const std::string& value); + void SetParamDataOnItem(QTreeWidgetItem *item, const std::string &name, const std::string &value); // Evaluates, if the parent item has a param item with the given name as child // Returns the found param item or nullptr - QTreeWidgetItem* HasParamItem(const QTreeWidgetItem* parentItem, const std::string& name); + QTreeWidgetItem *HasParamItem(const QTreeWidgetItem *parentItem, const std::string &name); - cParamData GetParamDataFromItem(const QTreeWidgetItem* item); - cCheckerBundleData GetCheckerBundleDataFromItem(const QTreeWidgetItem* item); - cCheckerData GetCheckerDataFromItem(const QTreeWidgetItem* item); - cReportModuleData GetReportModuleDataFromItem(const QTreeWidgetItem* item); + cParamData GetParamDataFromItem(const QTreeWidgetItem *item); + cCheckerBundleData GetCheckerBundleDataFromItem(const QTreeWidgetItem *item); + cCheckerData GetCheckerDataFromItem(const QTreeWidgetItem *item); + cReportModuleData GetReportModuleDataFromItem(const QTreeWidgetItem *item); -public slots: + public slots: // Add a local parameter void AddLocalParam(); @@ -136,7 +136,7 @@ public slots: void EditParam(); // Calls the dialog for a special item - void EditParam(QTreeWidgetItem* item); + void EditParam(QTreeWidgetItem *item); // Deletes the current selected item void DeleteParam(); @@ -151,7 +151,7 @@ public slots: void EditChecker(); // Calls the dialog for a special item - void EditChecker(QTreeWidgetItem* item); + void EditChecker(QTreeWidgetItem *item); // Deletes the current selected item void DeleteChecker(); @@ -159,7 +159,7 @@ public slots: // Deletes the current selected item void DeleteReportModule(); - void DeleteItem(QTreeWidgetItem* item, bool deleteChilds = true); + void DeleteItem(QTreeWidgetItem *item, bool deleteChilds = true); // Moves an item up void MoveUp(); @@ -167,22 +167,22 @@ public slots: // Moves an item down void MoveDown(); -signals: + signals: void ChangeConfiguration(); int ExecuteProcessAndAddConfiguration(QString processPath); -private: - virtual void mouseDoubleClickEvent(QMouseEvent* event); + private: + virtual void mouseDoubleClickEvent(QMouseEvent *event); -protected: - void showContextMenu(const QPoint & pos); + protected: + void showContextMenu(const QPoint &pos); /** - * Get application directory - * - * @return directory, where the application is installed - */ + * Get application directory + * + * @return directory, where the application is installed + */ const QString GetApplicationDir(); }; @@ -191,4 +191,4 @@ Q_DECLARE_METATYPE(cCheckerBundleData) Q_DECLARE_METATYPE(cCheckerData) Q_DECLARE_METATYPE(cReportModuleData) -#endif \ No newline at end of file +#endif diff --git a/src/runtime/src/ui/cRuntimeControl.cpp b/src/runtime/src/ui/c_runtime_control.cpp similarity index 89% rename from src/runtime/src/ui/cRuntimeControl.cpp rename to src/runtime/src/ui/c_runtime_control.cpp index 340fd62f..12b22d7d 100644 --- a/src/runtime/src/ui/cRuntimeControl.cpp +++ b/src/runtime/src/ui/c_runtime_control.cpp @@ -5,11 +5,11 @@ * Public License, v. 2.0. If a copy of the MPL was not distributed * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "cRuntimeControl.h" +#include "c_runtime_control.h" cRuntimeControl::cRuntimeControl(QWidget *parent) : QWidget(parent) { - QHBoxLayout* runtimeLayout = new QHBoxLayout; + QHBoxLayout *runtimeLayout = new QHBoxLayout; runtimeBtn = new QLabel(this); runtimeLayout->addWidget(runtimeBtn, 100, Qt::AlignCenter); @@ -20,7 +20,7 @@ cRuntimeControl::cRuntimeControl(QWidget *parent) : QWidget(parent) UpdateControl(); } -void cRuntimeControl::mousePressEvent(QMouseEvent* event) +void cRuntimeControl::mousePressEvent(QMouseEvent *event) { if (isRunning) { @@ -62,4 +62,4 @@ void cRuntimeControl::FinishedExecution() { isRunning = false; UpdateControl(); -} \ No newline at end of file +} diff --git a/src/runtime/src/ui/cRuntimeControl.h b/src/runtime/src/ui/c_runtime_control.h similarity index 82% rename from src/runtime/src/ui/cRuntimeControl.h rename to src/runtime/src/ui/c_runtime_control.h index 9ce0b1ff..9c3280b2 100644 --- a/src/runtime/src/ui/cRuntimeControl.h +++ b/src/runtime/src/ui/c_runtime_control.h @@ -8,36 +8,36 @@ #ifndef CRUNTIME_CONTROL_H #define CRUNTIME_CONTROL_H -#include -#include #include #include +#include +#include class cRuntimeControl : public QWidget { Q_OBJECT -protected: - QLabel* runtimeBtn; + protected: + QLabel *runtimeBtn; -public: + public: cRuntimeControl(QWidget *parent = 0); bool IsRunning() const; -signals: + signals: void Abort(); void Run(); -public slots: + public slots: void FinishedExecution(); -protected: - void mousePressEvent(QMouseEvent* event); + protected: + void mousePressEvent(QMouseEvent *event); void UpdateControl(); bool isRunning; }; -#endif \ No newline at end of file +#endif diff --git a/src/runtime/src/ui/cRuntimeThread.cpp b/src/runtime/src/ui/c_runtime_thread.cpp similarity index 79% rename from src/runtime/src/ui/cRuntimeThread.cpp rename to src/runtime/src/ui/c_runtime_thread.cpp index 64533b7e..ccf2b07b 100644 --- a/src/runtime/src/ui/cRuntimeThread.cpp +++ b/src/runtime/src/ui/c_runtime_thread.cpp @@ -5,14 +5,15 @@ * Public License, v. 2.0. If a copy of the MPL was not distributed * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "cRuntimeThread.h" +#include "c_runtime_thread.h" -#include "common/config_format/cConfiguration.h" -#include "common/config_format/cConfigurationCheckerBundle.h" -#include "common/config_format/cConfigurationReportModule.h" -#include "cProcessLog.h" +#include "c_process_log.h" +#include "common/config_format/c_configuration.h" +#include "common/config_format/c_configuration_checker_bundle.h" +#include "common/config_format/c_configuration_report_module.h" -void cRuntimeThread::Initialize(cProcessLog* const processLog, cConfiguration* const configuration, const QString& configurationPath) +void cRuntimeThread::Initialize(cProcessLog *const processLog, cConfiguration *const configuration, + const QString &configurationPath) { _abortExecution = false; _myConfiguration = configuration; @@ -49,7 +50,7 @@ void cRuntimeThread::run() emit Log(QString("---- Cleanup ------------------------------------------------")); emit Log(QString("-------------------------------------------------------------")); - for (auto& pFilePath : fs::directory_iterator(GetWorkingDir())) + for (auto &pFilePath : fs::directory_iterator(GetWorkingDir())) { std::string strFileName = pFilePath.path().string(); GetFileName(&strFileName, false); @@ -69,8 +70,8 @@ void cRuntimeThread::run() emit Log(""); // Process CheckerBundles - std::vector checkerBundle = _myConfiguration->GetCheckerBundles(); - std::vector::const_iterator bundleIt = checkerBundle.cbegin(); + std::vector checkerBundle = _myConfiguration->GetCheckerBundles(); + std::vector::const_iterator bundleIt = checkerBundle.cbegin(); QStringList defaultParams; defaultParams.append(_myConfigurationPath); @@ -81,12 +82,11 @@ void cRuntimeThread::run() } // Process ResultPooling - ExecuteProcess(GetApplicationDir() + "ResultPooling.exe", { "" }); + ExecuteProcess(GetApplicationDir() + "ResultPooling.exe", {""}); // Process ReportModules - std::vector reportModules = _myConfiguration->GetReportModules(); - std::vector::const_iterator reportModuleIt = - reportModules.cbegin(); + std::vector reportModules = _myConfiguration->GetReportModules(); + std::vector::const_iterator reportModuleIt = reportModules.cbegin(); for (; reportModuleIt != reportModules.cend() && !_abortExecution; reportModuleIt++) { @@ -101,7 +101,7 @@ void cRuntimeThread::run() emit Finished(); } -int cRuntimeThread::ExecuteProcess(const QString& processName, const QStringList& params) +int cRuntimeThread::ExecuteProcess(const QString &processName, const QStringList ¶ms) { QProcess process; @@ -156,4 +156,4 @@ int cRuntimeThread::ExecuteProcess(const QString& processName, const QStringList } return 0; -} \ No newline at end of file +} diff --git a/src/runtime/src/ui/cRuntimeThread.h b/src/runtime/src/ui/c_runtime_thread.h similarity index 57% rename from src/runtime/src/ui/cRuntimeThread.h rename to src/runtime/src/ui/c_runtime_thread.h index b2fb193a..3d6da609 100644 --- a/src/runtime/src/ui/cRuntimeThread.h +++ b/src/runtime/src/ui/c_runtime_thread.h @@ -8,9 +8,9 @@ #ifndef CRUNTIME_THREAD_H #define CRUNTIME_THREAD_H -#include -#include #include +#include +#include #include "common/qc4openx_filesystem.h" @@ -22,48 +22,48 @@ class cRuntimeThread : public QThread { Q_OBJECT -public: - void Initialize(cProcessLog* const, cConfiguration* const, const QString&); + public: + void Initialize(cProcessLog *const, cConfiguration *const, const QString &); void Abort(); bool IsRunning() const; /*! - * Executes a Process with a given name and params - * - * \param processName - * \param params - * \return - */ - int ExecuteProcess(const QString& processName, const QStringList& params); + * Executes a Process with a given name and params + * + * \param processName + * \param params + * \return + */ + int ExecuteProcess(const QString &processName, const QStringList ¶ms); -signals: + signals: void Log(QString log); void Finished(); -protected: + protected: void run(); bool _abortExecution{false}; - const cConfiguration* _myConfiguration{nullptr}; - const cProcessLog* _myLog{nullptr}; + const cConfiguration *_myConfiguration{nullptr}; + const cProcessLog *_myLog{nullptr}; QString _myConfigurationPath; /** - * Get application directory - * - * @return directory, where the application is installed - */ + * Get application directory + * + * @return directory, where the application is installed + */ const QString GetApplicationDir(); /** - * Get working directory - * - * @return directory, from where the application is started - */ + * Get working directory + * + * @return directory, from where the application is started + */ const fs::path GetWorkingDir(); }; -#endif \ No newline at end of file +#endif diff --git a/src/runtime/src/ui/cRuntimeWindow.cpp b/src/runtime/src/ui/c_runtime_window.cpp similarity index 78% rename from src/runtime/src/ui/cRuntimeWindow.cpp rename to src/runtime/src/ui/c_runtime_window.cpp index 9a106d9d..d0ab268a 100644 --- a/src/runtime/src/ui/cRuntimeWindow.cpp +++ b/src/runtime/src/ui/c_runtime_window.cpp @@ -5,61 +5,58 @@ * Public License, v. 2.0. If a copy of the MPL was not distributed * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "cRuntimeWindow.h" +#include "c_runtime_window.h" -#include #include -#include -#include #include -#include #include +#include +#include #include #include +#include +#include -#include "common/result_format/cResultContainer.h" +#include "common/result_format/c_result_container.h" -#include "cProcessLog.h" -#include "cProcessView.h" -#include "cRuntimeControl.h" -#include "../cConfigurationValidator.h" +#include "../c_configuration_validator.h" +#include "c_process_log.h" +#include "c_process_view.h" +#include "c_runtime_control.h" const QString cRuntimeWindow::DEFAULT_XODR_CONFIG = "DefaultXodrConfiguration.xml"; const QString cRuntimeWindow::DEFAULT_XOSC_CONFIG = "DefaultXoscConfiguration.xml"; -cRuntimeWindow::cRuntimeWindow(const std::string& strConfigurationFilepath, - const std::string& xodrFile, - const std::string& xoscFile, - const bool bAutostart, - QWidget* parent) +cRuntimeWindow::cRuntimeWindow(const std::string &strConfigurationFilepath, const std::string &xodrFile, + const std::string &xoscFile, const bool bAutostart, QWidget *parent) : QMainWindow(parent) { _autostart = bAutostart; - QAction* newAction = new QAction(tr("&New"), this); + QAction *newAction = new QAction(tr("&New"), this); newAction->setShortcuts(QKeySequence::New); newAction->setStatusTip(tr("New configuration")); connect(newAction, &QAction::triggered, this, &cRuntimeWindow::NewConfiguration); - QAction* openAction = new QAction(tr("&Open..."), this); + QAction *openAction = new QAction(tr("&Open..."), this); openAction->setShortcuts(QKeySequence::Open); openAction->setStatusTip(tr("Open configuration")); connect(openAction, &QAction::triggered, this, &cRuntimeWindow::OpenConfigurationFile); - QAction* saveAction = new QAction(tr("&Save..."), this); + QAction *saveAction = new QAction(tr("&Save..."), this); saveAction->setShortcuts(QKeySequence::Save); saveAction->setStatusTip(tr("Save configuration")); connect(saveAction, &QAction::triggered, this, &cRuntimeWindow::SaveConfigurationFile); - QAction* saveAsAction = new QAction(tr("&Save As..."), this); + QAction *saveAsAction = new QAction(tr("&Save As..."), this); saveAsAction->setStatusTip(tr("Save configuration")); connect(saveAsAction, &QAction::triggered, this, &cRuntimeWindow::SaveAsConfigurationFile); - QAction* clearConsoleAction = new QAction(tr("Clear"), this); + QAction *clearConsoleAction = new QAction(tr("Clear"), this); clearConsoleAction->setStatusTip(tr("Clear console")); connect(clearConsoleAction, &QAction::triggered, this, &cRuntimeWindow::ClearConsole); - QAction* saveConsoleAction = new QAction(tr("Save"), this); + QAction *saveConsoleAction = new QAction(tr("Save"), this); saveConsoleAction->setStatusTip(tr("Save console output")); connect(saveConsoleAction, &QAction::triggered, this, &cRuntimeWindow::SaveConsole); @@ -73,17 +70,17 @@ cRuntimeWindow::cRuntimeWindow(const std::string& strConfigurationFilepath, consoleMenu->addAction(clearConsoleAction); consoleMenu->addAction(saveConsoleAction); - QSplitter* splitter = new QSplitter(Qt::Horizontal); + QSplitter *splitter = new QSplitter(Qt::Horizontal); - QWidget* processWidget = new QWidget(this); - QVBoxLayout * processLayout = new QVBoxLayout; + QWidget *processWidget = new QWidget(this); + QVBoxLayout *processLayout = new QVBoxLayout; - QWidget* processButtonBar = new QWidget(this); - QHBoxLayout* processButtonBarLayout = new QHBoxLayout; + QWidget *processButtonBar = new QWidget(this); + QHBoxLayout *processButtonBarLayout = new QHBoxLayout; - QPushButton* addModule = new QPushButton(this); + QPushButton *addModule = new QPushButton(this); addModule->setText("Add Module"); - QPushButton* addParameter = new QPushButton(this); + QPushButton *addParameter = new QPushButton(this); addParameter->setText("Add global Parameter"); processButtonBarLayout->addWidget(addParameter); @@ -91,7 +88,7 @@ cRuntimeWindow::cRuntimeWindow(const std::string& strConfigurationFilepath, processButtonBarLayout->setContentsMargins(2, 2, 2, 2); processButtonBar->setLayout(processButtonBarLayout); - QLabel* processLabel = new QLabel(processWidget); + QLabel *processLabel = new QLabel(processWidget); processLabel->setText("Runtime Configuration"); processLabel->setStyleSheet("font-weight: bold;"); _processView = new cProcessView(this); @@ -112,9 +109,9 @@ cRuntimeWindow::cRuntimeWindow(const std::string& strConfigurationFilepath, processWidget->setLayout(processLayout); splitter->addWidget(processWidget); - QWidget* outputWidget = new QWidget(this); - QVBoxLayout * outputLayout = new QVBoxLayout; - QLabel* outputLabel = new QLabel(outputWidget); + QWidget *outputWidget = new QWidget(this); + QVBoxLayout *outputLayout = new QVBoxLayout; + QLabel *outputLabel = new QLabel(outputWidget); outputLabel->setText("Console Output"); outputLabel->setStyleSheet("font-weight: bold;"); _processLog = new cProcessLog(this); @@ -132,7 +129,8 @@ cRuntimeWindow::cRuntimeWindow(const std::string& strConfigurationFilepath, connect(addParameter, SIGNAL(pressed()), _processView, SLOT(AddGlobalParam())); connect(_processView, SIGNAL(ChangeConfiguration()), this, SLOT(OnChangeConfiguration())); - connect(_processView, SIGNAL(ExecuteProcessAndAddConfiguration(QString)), this, SLOT(ExecuteProcessAndAddConfiguration(QString))); + connect(_processView, SIGNAL(ExecuteProcessAndAddConfiguration(QString)), this, + SLOT(ExecuteProcessAndAddConfiguration(QString))); connect(runtimeControl, &cRuntimeControl::Run, this, &cRuntimeWindow::Run); connect(runtimeControl, &cRuntimeControl::Abort, this, &cRuntimeWindow::Abort); @@ -155,7 +153,7 @@ cRuntimeWindow::cRuntimeWindow(const std::string& strConfigurationFilepath, else { // Standardkonfiguration laden - QString defaultXODRConfigPath = GetApplicationDir() + "/" + DEFAULT_XODR_CONFIG; + QString defaultXODRConfigPath = GetApplicationDir() + "/" + DEFAULT_XODR_CONFIG; if (CheckIfFileExists(defaultXODRConfigPath.toStdString())) { LoadConfiguration(&_currentConfiguration, defaultXODRConfigPath); @@ -195,16 +193,13 @@ const QString cRuntimeWindow::GetWorkingDir() void cRuntimeWindow::OpenConfigurationFile() { - QString filePath = QFileDialog::getOpenFileName(this, - tr("Open Configuration"), - GetWorkingDir(), - tr("configurations (*.xml)")); + QString filePath = + QFileDialog::getOpenFileName(this, tr("Open Configuration"), GetWorkingDir(), tr("configurations (*.xml)")); LoadConfiguration(&_currentConfiguration, filePath); ShowConfiguration(&_currentConfiguration); } - bool cRuntimeWindow::SaveConfigurationFile(const bool bAutostart) { if (!_currentConfigurationPath.isEmpty()) @@ -225,10 +220,9 @@ bool cRuntimeWindow::SaveConfigurationFile(const bool bAutostart) QMessageBox::StandardButton reply = QMessageBox::NoButton; if (!bAutostart) { - reply = QMessageBox::question( this, - "Overwrite Configuration", - "Do you want to overwrite:\n" + fileInfo.fileName(), - QMessageBox::Yes | QMessageBox::No); + reply = QMessageBox::question(this, "Overwrite Configuration", + "Do you want to overwrite:\n" + fileInfo.fileName(), + QMessageBox::Yes | QMessageBox::No); } if (bAutostart || reply == QMessageBox::Yes) @@ -256,10 +250,8 @@ bool cRuntimeWindow::SaveConfigurationFile(const bool bAutostart) bool cRuntimeWindow::SaveAsConfigurationFile() { - QString filePath = QFileDialog::getSaveFileName(this, - tr("Save Configuration"), - GetWorkingDir(), - tr("configurations (*.xml)")); + QString filePath = + QFileDialog::getSaveFileName(this, tr("Save Configuration"), GetWorkingDir(), tr("configurations (*.xml)")); if (!filePath.isEmpty()) { @@ -268,9 +260,10 @@ bool cRuntimeWindow::SaveAsConfigurationFile() if (fileInfo.fileName().toLower() == DEFAULT_XODR_CONFIG.toLower() || fileInfo.fileName().toLower() == DEFAULT_XOSC_CONFIG.toLower()) { - QMessageBox::information(this, "Save Configuration", - "It is not possible to overwrite a default configuration.\nPlease enter a different file name.", - QMessageBox::Ok); + QMessageBox::information( + this, "Save Configuration", + "It is not possible to overwrite a default configuration.\nPlease enter a different file name.", + QMessageBox::Ok); // Open Dialog bool saved = SaveAsConfigurationFile(); @@ -299,7 +292,8 @@ void cRuntimeWindow::SetupWindowTitle() if (!_currentConfigurationPath.isEmpty()) { QFileInfo fileInfo(_currentConfigurationPath); - QString applicationTitle = QString(" - %1.xml%2").arg(fileInfo.baseName()).arg(_configurationChanged ? "*" : ""); + QString applicationTitle = + QString(" - %1.xml%2").arg(fileInfo.baseName()).arg(_configurationChanged ? "*" : ""); applicationTitle = QString::fromStdString(config_ui_name) + applicationTitle; setWindowTitle(applicationTitle); } @@ -315,7 +309,7 @@ void cRuntimeWindow::UpdateConfiguration() _processView->GetConfigurationFromView(&_currentConfiguration); } -void cRuntimeWindow::LoadConfiguration(cConfiguration* const configuration, const QString& strConfigurationFilepath) +void cRuntimeWindow::LoadConfiguration(cConfiguration *const configuration, const QString &strConfigurationFilepath) { if (!strConfigurationFilepath.isNull()) { @@ -324,9 +318,10 @@ void cRuntimeWindow::LoadConfiguration(cConfiguration* const configuration, cons if (!cConfiguration::ParseFromXML(configuration, strConfigurationFilepath.toLocal8Bit().data())) { std::stringstream ssError; - ssError << "Couldn't load the configuration '" << strConfigurationFilepath.toLocal8Bit().data() <<"'. It occured a problem while parsing. Abort."; + ssError << "Couldn't load the configuration '" << strConfigurationFilepath.toLocal8Bit().data() + << "'. It occured a problem while parsing. Abort."; - QMessageBox::warning( this, tr("Load Configuration"), ssError.str().c_str(), QMessageBox::Ok); + QMessageBox::warning(this, tr("Load Configuration"), ssError.str().c_str(), QMessageBox::Ok); } else { @@ -335,7 +330,7 @@ void cRuntimeWindow::LoadConfiguration(cConfiguration* const configuration, cons } } -void cRuntimeWindow::CreateNewConfiguration(cConfiguration* const configuration) +void cRuntimeWindow::CreateNewConfiguration(cConfiguration *const configuration) { _currentConfigurationPath = ""; @@ -346,7 +341,7 @@ void cRuntimeWindow::CreateNewConfiguration(cConfiguration* const configuration) OnChangeConfiguration(); } -void cRuntimeWindow::ShowConfiguration(cConfiguration* const configurationToBeShown) +void cRuntimeWindow::ShowConfiguration(cConfiguration *const configurationToBeShown) { _processLog->clear(); @@ -355,14 +350,13 @@ void cRuntimeWindow::ShowConfiguration(cConfiguration* const configurationToBeSh SetupWindowTitle(); } - void cRuntimeWindow::NewConfiguration() { CreateNewConfiguration(&_currentConfiguration); ShowConfiguration(&_currentConfiguration); } -void cRuntimeWindow::closeEvent(QCloseEvent* /*event*/ ) +void cRuntimeWindow::closeEvent(QCloseEvent * /*event*/) { _runningThread.Abort(); _runningThread.wait(); @@ -375,10 +369,7 @@ void cRuntimeWindow::ClearConsole() void cRuntimeWindow::SaveConsole() { - QString filePath = QFileDialog::getSaveFileName(this, - tr("Console Dump"), - GetWorkingDir(), - tr("Log (*.log)")); + QString filePath = QFileDialog::getSaveFileName(this, tr("Console Dump"), GetWorkingDir(), tr("Log (*.log)")); if (!filePath.isEmpty()) { @@ -410,10 +401,7 @@ void cRuntimeWindow::Run() if (!_autostart) { - QMessageBox::warning(this, - tr("Error"), - tr(ssDetails.str().c_str()), - QMessageBox::Ok); + QMessageBox::warning(this, tr("Error"), tr(ssDetails.str().c_str()), QMessageBox::Ok); } else std::cerr << ssDetails.str(); @@ -427,10 +415,8 @@ void cRuntimeWindow::Run() if (!saved) { - QMessageBox::warning( this, - tr("Error"), - tr("Skip execution. Please save the configuration first."), - QMessageBox::Ok); + QMessageBox::warning(this, tr("Error"), tr("Skip execution. Please save the configuration first."), + QMessageBox::Ok); emit Finished(); return; @@ -456,7 +442,7 @@ bool cRuntimeWindow::IsRunning() const return _runningThread.IsRunning(); } -int cRuntimeWindow::ExecuteProcessAndAddConfiguration(const QString& processPath) +int cRuntimeWindow::ExecuteProcessAndAddConfiguration(const QString &processPath) { QProcess process; QFileInfo fileInfo(processPath); @@ -483,7 +469,7 @@ int cRuntimeWindow::ExecuteProcessAndAddConfiguration(const QString& processPath return -1; } - process.start(processName, { "--defaultConfig" }); + process.start(processName, {"--defaultConfig"}); process.setWorkingDirectory(processDir); process.waitForStarted(); @@ -530,7 +516,8 @@ int cRuntimeWindow::ExecuteProcessAndAddConfiguration(const QString& processPath } else { - emit Log(QString("> Report '%1' or configuration '%2' does not exist. Abort.").arg(reportFile.toLocal8Bit().data(), confgurationFile.toLocal8Bit().data())); + emit Log(QString("> Report '%1' or configuration '%2' does not exist. Abort.") + .arg(reportFile.toLocal8Bit().data(), confgurationFile.toLocal8Bit().data())); return -1; } @@ -546,4 +533,4 @@ int cRuntimeWindow::ExecuteProcessAndAddConfiguration(const QString& processPath } return 0; -} \ No newline at end of file +} diff --git a/src/runtime/src/ui/cRuntimeWindow.h b/src/runtime/src/ui/c_runtime_window.h similarity index 57% rename from src/runtime/src/ui/cRuntimeWindow.h rename to src/runtime/src/ui/c_runtime_window.h index ae387b74..f8c908ab 100644 --- a/src/runtime/src/ui/cRuntimeWindow.h +++ b/src/runtime/src/ui/c_runtime_window.h @@ -10,8 +10,8 @@ #include -#include "common/config_format/cConfiguration.h" -#include "cRuntimeThread.h" +#include "c_runtime_thread.h" +#include "common/config_format/c_configuration.h" class cProcessView; class cProcessLog; @@ -22,31 +22,32 @@ class cRuntimeWindow : public QMainWindow { Q_OBJECT -protected: - cProcessView* _processView{nullptr}; - cProcessLog* _processLog{nullptr}; + protected: + cProcessView *_processView{nullptr}; + cProcessLog *_processLog{nullptr}; - cConfiguration _currentConfiguration; - QString _currentConfigurationPath; + cConfiguration _currentConfiguration; + QString _currentConfigurationPath; - cRuntimeThread _runningThread; - bool _configurationChanged{false}; - bool _autostart{true}; + cRuntimeThread _runningThread; + bool _configurationChanged{false}; + bool _autostart{true}; -public: - cRuntimeWindow(const std::string& configurationFilePath, const std::string& xodrFile, const std::string& xoscFile, const bool bAutostart, QWidget *parent = 0); + public: + cRuntimeWindow(const std::string &configurationFilePath, const std::string &xodrFile, const std::string &xoscFile, + const bool bAutostart, QWidget *parent = 0); /* - * Loads a configuration from file to datastructure - * \param strConfigurationFilepath: File path of the configuration which should be loaded - */ - void LoadConfiguration(cConfiguration* const configuration, const QString& strConfigurationFilepath); + * Loads a configuration from file to datastructure + * \param strConfigurationFilepath: File path of the configuration which should be loaded + */ + void LoadConfiguration(cConfiguration *const configuration, const QString &strConfigurationFilepath); /* - * Shows a configuration to the user - * \param currentConfiguration: Configuration which should be shown - */ - void ShowConfiguration(cConfiguration* const currentConfiguration); + * Shows a configuration to the user + * \param currentConfiguration: Configuration which should be shown + */ + void ShowConfiguration(cConfiguration *const currentConfiguration); // Updates the internal configuration void UpdateConfiguration(); @@ -54,14 +55,14 @@ class cRuntimeWindow : public QMainWindow // Returns true if the execution thread is running bool IsRunning() const; -public slots: + public slots: // Runs the process void Run(); // Aborts the running process void Abort(); -private slots: + private slots: // Open result file void OpenConfigurationFile(); @@ -89,14 +90,14 @@ private slots: * \param processPath * \return Positive number if everything is okay */ - int ExecuteProcessAndAddConfiguration(const QString& processPath); + int ExecuteProcessAndAddConfiguration(const QString &processPath); -signals: + signals: void Finished(); void Log(QString log); -private: + private: // Filename of the default xodr configuration static const QString DEFAULT_XODR_CONFIG; @@ -104,17 +105,17 @@ private slots: static const QString DEFAULT_XOSC_CONFIG; /** - * Get application directory - * - * @return directory, where the application is installed - */ + * Get application directory + * + * @return directory, where the application is installed + */ const QString GetApplicationDir(); /** - * Get working directory - * - * @return directory, from where the application is started - */ + * Get working directory + * + * @return directory, from where the application is started + */ const QString GetWorkingDir(); // Handle application close @@ -124,7 +125,7 @@ private slots: void SetupWindowTitle(); // Creates an empty configuration - void CreateNewConfiguration(cConfiguration* const configuration); + void CreateNewConfiguration(cConfiguration *const configuration); }; -#endif \ No newline at end of file +#endif diff --git a/test/function/CMakeLists.txt b/test/function/CMakeLists.txt index d94661d4..897bedf1 100644 --- a/test/function/CMakeLists.txt +++ b/test/function/CMakeLists.txt @@ -4,7 +4,6 @@ # Public License, v. 2.0. If a copy of the MPL was not distributed # with this file, You can obtain one at https://mozilla.org/MPL/2.0/. -add_subdirectory(checker_bundles) add_subdirectory(examples) add_subdirectory(report_modules) add_subdirectory(result_pooling/src) @@ -18,15 +17,6 @@ add_custom_target(INSTALL_TEST_REFERENCES ALL) add_custom_command( TARGET INSTALL_TEST_REFERENCES PRE_BUILD - - COMMAND ${CMAKE_COMMAND} -E copy_directory - ${CMAKE_CURRENT_SOURCE_DIR}/checker_bundles/xodr_schema/files - ${REFERENCE_FILES_INSTALL_DIR}/function/checker_bundles/xodr_schema - - COMMAND ${CMAKE_COMMAND} -E copy_directory - ${CMAKE_CURRENT_SOURCE_DIR}/checker_bundles/xosc_schema/files - ${REFERENCE_FILES_INSTALL_DIR}/function/checker_bundles/xosc_schema - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/examples/example_checker_bundle/files ${REFERENCE_FILES_INSTALL_DIR}/function/examples/example_checker_bundle @@ -46,15 +36,4 @@ add_custom_command( COMMENT "Copying test reference files..." ) -configure_file ( - ${CMAKE_CURRENT_SOURCE_DIR}/checker_bundles/xodr_schema/files/XodrSchemaChecker.xqar.in - ${REFERENCE_FILES_INSTALL_DIR}/function/checker_bundles/xodr_schema/XodrSchemaChecker.xqar - @ONLY -) -configure_file ( - ${CMAKE_CURRENT_SOURCE_DIR}/checker_bundles/xosc_schema/files/XoscSchemaChecker.xqar.in - ${REFERENCE_FILES_INSTALL_DIR}/function/checker_bundles/xosc_schema/XoscSchemaChecker.xqar - @ONLY -) - set_target_properties(INSTALL_TEST_REFERENCES PROPERTIES FOLDER test/references) diff --git a/test/function/_common/helper.cpp b/test/function/_common/helper.cpp index a080a1b9..8701b899 100644 --- a/test/function/_common/helper.cpp +++ b/test/function/_common/helper.cpp @@ -7,9 +7,7 @@ */ #include "helper.h" -qc4openx::Result ExecuteCommand(std::string& strResultMessage, - std::string strCommand, - const std::string strArgument) +qc4openx::Result ExecuteCommand(std::string &strResultMessage, std::string strCommand, const std::string strArgument) { std::string strInstallDir = std::string(QC4OPENX_DBQA_BIN_DIR); strInstallDir.append("/"); @@ -20,39 +18,43 @@ qc4openx::Result ExecuteCommand(std::string& strResultMessage, #endif strTotalCommand.append(strCommand.c_str()); - if (a_util::filesystem::exists(strTotalCommand)) { - if (!strArgument.empty()) { + if (a_util::filesystem::exists(strTotalCommand)) + { + if (!strArgument.empty()) + { strTotalCommand.append(" "); strTotalCommand.append(strArgument.c_str()); } GTEST_PRINTF(strTotalCommand.c_str()); int32_t i32Res = system(strTotalCommand.c_str()); - if (i32Res != 0) { - strResultMessage = "Command executed with result " + std::to_string(i32Res) + - ". Command: '" + strTotalCommand + "'."; + if (i32Res != 0) + { + strResultMessage = + "Command executed with result " + std::to_string(i32Res) + ". Command: '" + strTotalCommand + "'."; return qc4openx::ERR_FAILED; } - else { + else + { return qc4openx::ERR_NOERROR; } } strResultMessage = - "Command to execute was not found in any defined install directory. Command: '" + - strTotalCommand + "'."; + "Command to execute was not found in any defined install directory. Command: '" + strTotalCommand + "'."; return qc4openx::ERR_FILE_NOT_FOUND; } -qc4openx::Result CheckFileExists(std::string& strResultMessage, - const std::string strFilePath, - const bool bDelete) +qc4openx::Result CheckFileExists(std::string &strResultMessage, const std::string strFilePath, const bool bDelete) { - if (a_util::filesystem::exists(strFilePath.c_str())) { + if (a_util::filesystem::exists(strFilePath.c_str())) + { std::string strFileContent; a_util::filesystem::readTextFile(strFilePath.c_str(), strFileContent); - if (strFileContent.size() > 0) { - if (bDelete == true) { + if (strFileContent.size() > 0) + { + if (bDelete == true) + { a_util::filesystem::remove(strFilePath.c_str()); } return qc4openx::ERR_NOERROR; @@ -66,26 +68,26 @@ qc4openx::Result CheckFileExists(std::string& strResultMessage, return qc4openx::ERR_FILE_NOT_FOUND; } -qc4openx::Result CheckFilesEqual(std::string& strResultMessage, - const std::string strFilePath1, +qc4openx::Result CheckFilesEqual(std::string &strResultMessage, const std::string strFilePath1, const std::string strFilePath2) { - FILE* f1 = fopen(strFilePath1.c_str(), "r"); - FILE* f2 = fopen(strFilePath2.c_str(), "r"); + FILE *f1 = fopen(strFilePath1.c_str(), "r"); + FILE *f2 = fopen(strFilePath2.c_str(), "r"); constexpr int n = 10000; char buf1[n]; char buf2[n]; - while (!feof(f1) || !feof(f2)) { + while (!feof(f1) || !feof(f2)) + { size_t r1 = fread(buf1, 1, n, f1); size_t r2 = fread(buf2, 1, n, f2); - if (r1 != r2 || memcmp(buf1, buf2, r1)) { + if (r1 != r2 || memcmp(buf1, buf2, r1)) + { fclose(f1); fclose(f2); - strResultMessage = - "Files '" + strFilePath1 + "' and '" + strFilePath2 + "' do not match."; + strResultMessage = "Files '" + strFilePath1 + "' and '" + strFilePath2 + "' do not match."; return qc4openx::ERR_FAILED; } } @@ -93,4 +95,4 @@ qc4openx::Result CheckFilesEqual(std::string& strResultMessage, fclose(f1); fclose(f2); return qc4openx::ERR_NOERROR; -} \ No newline at end of file +} diff --git a/test/function/_common/helper.h b/test/function/_common/helper.h index 246f36a2..b20afafe 100644 --- a/test/function/_common/helper.h +++ b/test/function/_common/helper.h @@ -10,22 +10,22 @@ #include -#include "a_util/result.h" #include "a_util/filesystem.h" +#include "a_util/result.h" #include "gtest/gtest.h" #include "qc4openx_errors.h" /** - * This macro prints a formatted message during test execution. - * - * @param [in] _message Message string - */ -#define GTEST_PRINTF(_message) \ - { \ - testing::internal::ColoredPrintf(testing::internal::COLOR_GREEN, "[ ] "); \ - testing::internal::ColoredPrintf(testing::internal::COLOR_YELLOW, _message); \ - testing::internal::ColoredPrintf(testing::internal::COLOR_YELLOW, "\n"); \ + * This macro prints a formatted message during test execution. + * + * @param [in] _message Message string + */ +#define GTEST_PRINTF(_message) \ + { \ + testing::internal::ColoredPrintf(testing::internal::COLOR_GREEN, "[ ] "); \ + testing::internal::ColoredPrintf(testing::internal::COLOR_YELLOW, _message); \ + testing::internal::ColoredPrintf(testing::internal::COLOR_YELLOW, "\n"); \ } /** @@ -34,23 +34,20 @@ * @param [in] expression The expression which will be excecuted * @param [in] msg Additional information which will be logged */ -#define ASSERT_TRUE_EXT(expression, msg) \ - if (!(expression)) \ - { \ - GTEST_PRINTF(msg); \ - } \ +#define ASSERT_TRUE_EXT(expression, msg) \ + if (!(expression)) \ + { \ + GTEST_PRINTF(msg); \ + } \ ASSERT_TRUE(expression) -qc4openx::Result ExecuteCommand(std::string& strResultMessage, - std::string strCommand, +qc4openx::Result ExecuteCommand(std::string &strResultMessage, std::string strCommand, const std::string strArgument = ""); -qc4openx::Result CheckFileExists(std::string& strResultMessage, - const std::string strFilePath, +qc4openx::Result CheckFileExists(std::string &strResultMessage, const std::string strFilePath, const bool bDelete = true); -qc4openx::Result CheckFilesEqual(std::string& strResultMessage, - const std::string strFilePath1, +qc4openx::Result CheckFilesEqual(std::string &strResultMessage, const std::string strFilePath1, const std::string strFilePath2); -#endif \ No newline at end of file +#endif diff --git a/test/function/_common/qc4openx_errors.h b/test/function/_common/qc4openx_errors.h index 647d6538..dc3ab3ea 100644 --- a/test/function/_common/qc4openx_errors.h +++ b/test/function/_common/qc4openx_errors.h @@ -11,47 +11,50 @@ namespace qc4openx { - /// \copydoc a_util::result::Result - using a_util::result::Result; - /// \copydoc a_util::result::is_ok - using a_util::result::isOk; - /// \copydoc a_util::result::is_failed - using a_util::result::isFailed; +/// \copydoc a_util::result::Result +using a_util::result::Result; +/// \copydoc a_util::result::is_ok +using a_util::result::isOk; +/// \copydoc a_util::result::is_failed +using a_util::result::isFailed; - /// \cond nodoc - _MAKE_RESULT(0, ERR_NOERROR); - _MAKE_RESULT(-2, ERR_UNKNOWN); - _MAKE_RESULT(-3, ERR_UNEXPECTED); - _MAKE_RESULT(-4, ERR_UNKNOWN_FORMAT); - _MAKE_RESULT(-5, ERR_FILE_NOT_FOUND); - _MAKE_RESULT(-6, ERR_FAILED); - - /// \endcond -} +/// \cond nodoc +_MAKE_RESULT(0, ERR_NOERROR); +_MAKE_RESULT(-2, ERR_UNKNOWN); +_MAKE_RESULT(-3, ERR_UNEXPECTED); +_MAKE_RESULT(-4, ERR_UNKNOWN_FORMAT); +_MAKE_RESULT(-5, ERR_FILE_NOT_FOUND); +_MAKE_RESULT(-6, ERR_FAILED); + +/// \endcond +} // namespace qc4openx #ifndef COMPARATORS_OVERLOADED #define COMPARATORS_OVERLOADED - inline qc4openx::Result operator|(const qc4openx::Result& lhs, const qc4openx::Result& rhs) - { - if (a_util::result::isFailed(lhs)) - { - return lhs; - } - return rhs; - } - - inline qc4openx::Result& operator|=(qc4openx::Result& lhs, const qc4openx::Result& rhs) +inline qc4openx::Result operator|(const qc4openx::Result &lhs, const qc4openx::Result &rhs) +{ + if (a_util::result::isFailed(lhs)) { - lhs = lhs | rhs; return lhs; } -#endif //COMPARATORS_OVERLOADED + return rhs; +} + +inline qc4openx::Result &operator|=(qc4openx::Result &lhs, const qc4openx::Result &rhs) +{ + lhs = lhs | rhs; + return lhs; +} +#endif // COMPARATORS_OVERLOADED /// Provide legacy RETURN_IF_FAILED implementation #ifndef RETURN_IF_FAILED -#define RETURN_IF_FAILED(s) \ -{ \ - qc4openx::Result _errcode(s); \ - if (qc4openx::isFailed(_errcode)) { return (_errcode); } \ -} +#define RETURN_IF_FAILED(s) \ + { \ + qc4openx::Result _errcode(s); \ + if (qc4openx::isFailed(_errcode)) \ + { \ + return (_errcode); \ + } \ + } #endif #endif // _QC4OPENX_UTILITY_ERRORS_H diff --git a/test/function/checker_bundles/CMakeLists.txt b/test/function/checker_bundles/CMakeLists.txt deleted file mode 100644 index 2847ba01..00000000 --- a/test/function/checker_bundles/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright 2023 CARIAD SE. -# -# This Source Code Form is subject to the terms of the Mozilla -# Public License, v. 2.0. If a copy of the MPL was not distributed -# with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - - -add_subdirectory(xodr_schema/src) -add_subdirectory(xosc_schema/src) \ No newline at end of file diff --git a/test/function/checker_bundles/xodr_schema/files/XodrSchemaChecker.xqar.in b/test/function/checker_bundles/xodr_schema/files/XodrSchemaChecker.xqar.in deleted file mode 100644 index dc4d3dee..00000000 --- a/test/function/checker_bundles/xodr_schema/files/XodrSchemaChecker.xqar.in +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/test/function/checker_bundles/xodr_schema/files/XodrSchemaChecker_config.xml b/test/function/checker_bundles/xodr_schema/files/XodrSchemaChecker_config.xml deleted file mode 100644 index 971983f1..00000000 --- a/test/function/checker_bundles/xodr_schema/files/XodrSchemaChecker_config.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - diff --git a/test/function/checker_bundles/xodr_schema/src/CMakeLists.txt b/test/function/checker_bundles/xodr_schema/src/CMakeLists.txt deleted file mode 100644 index 741e469d..00000000 --- a/test/function/checker_bundles/xodr_schema/src/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright 2023 CARIAD SE. -# -# This Source Code Form is subject to the terms of the Mozilla -# Public License, v. 2.0. If a copy of the MPL was not distributed -# with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - - -set(TEST_NAME xodr_schema_tester) - -set_property(GLOBAL PROPERTY USE_FOLDERS true) - -include_directories(${TEST_NAME} PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/../../../_common) - -add_executable(${TEST_NAME} - ${CMAKE_CURRENT_SOURCE_DIR}/../../../_common/helper.cpp - ${TEST_NAME}.cpp) - -add_test(NAME ${TEST_NAME} - COMMAND ${TEST_NAME} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../../../ -) - -target_link_libraries(${TEST_NAME} - PRIVATE - GTest::gtest_main - dev_essential::result - dev_essential::system -) - -target_compile_definitions(${TEST_NAME} - PRIVATE QC4OPENX_DBQA_BIN_DIR="${QC4OPENX_DBQA_DIR}/bin" - PRIVATE QC4OPENX_DBQA_XODR_SCHEMA_TEST_WORK_DIR="${CMAKE_CURRENT_BINARY_DIR}/../../../" - PRIVATE QC4OPENX_DBQA_XODR_SCHEMA_TEST_REF_DIR="${REFERENCE_FILES_INSTALL_DIR}/function/checker_bundles/xodr_schema") - -set_target_properties(${TEST_NAME} PROPERTIES FOLDER test/function) diff --git a/test/function/checker_bundles/xodr_schema/src/xodr_schema_tester.cpp b/test/function/checker_bundles/xodr_schema/src/xodr_schema_tester.cpp deleted file mode 100644 index 32a04cee..00000000 --- a/test/function/checker_bundles/xodr_schema/src/xodr_schema_tester.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -#include "gtest/gtest.h" - -#include "helper.h" - -#define MODULE_NAME "XodrSchemaChecker" - -class cTesterXodrSchema : public ::testing::Test -{ - public: - std::string strTestFilesDir = std::string(QC4OPENX_DBQA_XODR_SCHEMA_TEST_REF_DIR); - std::string strWorkingDir = std::string(QC4OPENX_DBQA_XODR_SCHEMA_TEST_WORK_DIR); -}; - -TEST_F(cTesterXodrSchema, CmdBasic) -{ - std::string strResultMessage; - - qc4openx::Result nRes = ExecuteCommand(strResultMessage, MODULE_NAME); - ASSERT_TRUE_EXT(nRes == qc4openx::ERR_NOERROR, strResultMessage.c_str()); -} - -TEST_F(cTesterXodrSchema, CmdDefaultConfig) -{ - std::string strResultMessage; - - std::string strDefaultConfigFilePath = strWorkingDir + "/" + std::string(MODULE_NAME) + ".xqar"; - - qc4openx::Result nRes = ExecuteCommand(strResultMessage, MODULE_NAME, "--defaultconfig"); - ASSERT_TRUE_EXT(nRes == qc4openx::ERR_NOERROR, strResultMessage.c_str()); - - nRes |= CheckFileExists(strResultMessage, strDefaultConfigFilePath); - ASSERT_TRUE_EXT(nRes == qc4openx::ERR_NOERROR, strResultMessage.c_str()); -} - -TEST_F(cTesterXodrSchema, CmdConfig) -{ - std::string strResultMessage; - - std::string strConfigFilePath = strTestFilesDir + "/" + std::string(MODULE_NAME) + "_config.xml"; - std::string strResultFilePath = strWorkingDir + "/" + std::string(MODULE_NAME) + ".xqar"; - std::string strExpectedResultFilePath = strTestFilesDir + "/" + std::string(MODULE_NAME) + ".xqar"; - - qc4openx::Result nRes = ExecuteCommand(strResultMessage, MODULE_NAME, strConfigFilePath); - ASSERT_TRUE_EXT(nRes == qc4openx::ERR_NOERROR, strResultMessage.c_str()); - - nRes |= CheckFileExists(strResultMessage, strResultFilePath, false); - ASSERT_TRUE_EXT(nRes == qc4openx::ERR_NOERROR, strResultMessage.c_str()); - - nRes |= CheckFilesEqual(strResultMessage, strResultFilePath, strExpectedResultFilePath); - ASSERT_TRUE_EXT(nRes == qc4openx::ERR_NOERROR, strResultMessage.c_str()); - - a_util::filesystem::remove(strResultFilePath.c_str()); -} - -TEST_F(cTesterXodrSchema, CmdXodr) -{ - std::string strResultMessage; - - std::string strXodrFilePath = "../stimuli/xodr_examples/three_connected_roads_with_steps.xodr"; - std::string strResultFilePath = strWorkingDir + "/" + std::string(MODULE_NAME) + ".xqar"; - std::string strExpectedResultFilePath = strTestFilesDir + "/" + std::string(MODULE_NAME) + ".xqar"; - - qc4openx::Result nRes = ExecuteCommand(strResultMessage, MODULE_NAME, strXodrFilePath); - ASSERT_TRUE_EXT(nRes == qc4openx::ERR_NOERROR, strResultMessage.c_str()); - - nRes |= CheckFileExists(strResultMessage, strResultFilePath, false); - ASSERT_TRUE_EXT(nRes == qc4openx::ERR_NOERROR, strResultMessage.c_str()); - - nRes |= CheckFilesEqual(strResultMessage, strResultFilePath, strExpectedResultFilePath); - ASSERT_TRUE_EXT(nRes == qc4openx::ERR_NOERROR, strResultMessage.c_str()); - - a_util::filesystem::remove(strResultFilePath.c_str()); -} - -TEST_F(cTesterXodrSchema, CmdConfigFileNotFound) -{ - std::string strResultMessage; - - qc4openx::Result nRes = ExecuteCommand(strResultMessage, MODULE_NAME, "error.xml"); - ASSERT_TRUE(nRes == qc4openx::ERR_FAILED); -} - -TEST_F(cTesterXodrSchema, CmdFirstArgumentWrong) -{ - std::string strResultMessage; - - qc4openx::Result nRes = ExecuteCommand(strResultMessage, MODULE_NAME, "error"); - ASSERT_TRUE(nRes == qc4openx::ERR_FAILED); -} - -TEST_F(cTesterXodrSchema, CmdTooMuchArguments) -{ - std::string strResultMessage; - - qc4openx::Result nRes = ExecuteCommand(strResultMessage, MODULE_NAME, "a b"); - ASSERT_TRUE(nRes == qc4openx::ERR_FAILED); -} \ No newline at end of file diff --git a/test/function/checker_bundles/xosc_schema/files/XoscSchemaChecker.xqar.in b/test/function/checker_bundles/xosc_schema/files/XoscSchemaChecker.xqar.in deleted file mode 100644 index c916959a..00000000 --- a/test/function/checker_bundles/xosc_schema/files/XoscSchemaChecker.xqar.in +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/test/function/checker_bundles/xosc_schema/files/XoscSchemaChecker_config.xml b/test/function/checker_bundles/xosc_schema/files/XoscSchemaChecker_config.xml deleted file mode 100644 index 48f1f7b3..00000000 --- a/test/function/checker_bundles/xosc_schema/files/XoscSchemaChecker_config.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - diff --git a/test/function/checker_bundles/xosc_schema/src/CMakeLists.txt b/test/function/checker_bundles/xosc_schema/src/CMakeLists.txt deleted file mode 100644 index c5100d62..00000000 --- a/test/function/checker_bundles/xosc_schema/src/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright 2023 CARIAD SE. -# -# This Source Code Form is subject to the terms of the Mozilla -# Public License, v. 2.0. If a copy of the MPL was not distributed -# with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - - -set(TEST_NAME xosc_schema_tester) - -set_property(GLOBAL PROPERTY USE_FOLDERS true) - -include_directories(${TEST_NAME} PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/../../../_common) - -add_executable(${TEST_NAME} - ${CMAKE_CURRENT_SOURCE_DIR}/../../../_common/helper.cpp - ${TEST_NAME}.cpp) - -add_test(NAME ${TEST_NAME} - COMMAND ${TEST_NAME} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../../../ -) - -target_link_libraries(${TEST_NAME} - PRIVATE - GTest::gtest_main - dev_essential::result - dev_essential::system -) - -target_compile_definitions(${TEST_NAME} - PRIVATE QC4OPENX_DBQA_BIN_DIR="${QC4OPENX_DBQA_DIR}/bin" - PRIVATE QC4OPENX_DBQA_XOSC_SCHEMA_TEST_WORK_DIR="${CMAKE_CURRENT_BINARY_DIR}/../../../" - PRIVATE QC4OPENX_DBQA_XOSC_SCHEMA_TEST_REF_DIR="${REFERENCE_FILES_INSTALL_DIR}/function/checker_bundles/xosc_schema") - -set_target_properties(${TEST_NAME} PROPERTIES FOLDER test/function) \ No newline at end of file diff --git a/test/function/checker_bundles/xosc_schema/src/xosc_schema_tester.cpp b/test/function/checker_bundles/xosc_schema/src/xosc_schema_tester.cpp deleted file mode 100644 index fc207d25..00000000 --- a/test/function/checker_bundles/xosc_schema/src/xosc_schema_tester.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright 2023 CARIAD SE. - * - * This Source Code Form is subject to the terms of the Mozilla - * Public License, v. 2.0. If a copy of the MPL was not distributed - * with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -#include "gtest/gtest.h" - -#include "helper.h" - -#define MODULE_NAME "XoscSchemaChecker" - -class cTesterXoscSchema : public ::testing::Test { -public: - std::string strTestFilesDir = std::string(QC4OPENX_DBQA_XOSC_SCHEMA_TEST_REF_DIR); - std::string strWorkingDir = std::string(QC4OPENX_DBQA_XOSC_SCHEMA_TEST_WORK_DIR); -}; - -TEST_F(cTesterXoscSchema, CmdBasic) -{ - std::string strResultMessage; - - qc4openx::Result nRes = ExecuteCommand(strResultMessage, MODULE_NAME); - ASSERT_TRUE_EXT(nRes == qc4openx::ERR_NOERROR, strResultMessage.c_str()); -} - -TEST_F(cTesterXoscSchema, CmdDefaultConfig) -{ - std::string strResultMessage; - - std::string strDefaultConfigFilePath = strWorkingDir + "/" + std::string(MODULE_NAME) + ".xqar"; - - qc4openx::Result nRes = ExecuteCommand(strResultMessage, MODULE_NAME, "--defaultconfig"); - ASSERT_TRUE_EXT(nRes == qc4openx::ERR_NOERROR, strResultMessage.c_str()); - - nRes |= CheckFileExists(strResultMessage, strDefaultConfigFilePath); - ASSERT_TRUE_EXT(nRes == qc4openx::ERR_NOERROR, strResultMessage.c_str()); -} - -TEST_F(cTesterXoscSchema, CmdConfig) -{ - std::string strResultMessage; - - std::string strConfigFilePath = strTestFilesDir + "/" + std::string(MODULE_NAME) + "_config.xml"; - std::string strResultFilePath = strWorkingDir + "/" + std::string(MODULE_NAME) + ".xqar"; - std::string strExpectedResultFilePath = strTestFilesDir + "/" + std::string(MODULE_NAME) + ".xqar"; - - qc4openx::Result nRes = ExecuteCommand(strResultMessage, MODULE_NAME, strConfigFilePath); - ASSERT_TRUE_EXT(nRes == qc4openx::ERR_NOERROR, strResultMessage.c_str()); - - nRes |= CheckFileExists(strResultMessage, strResultFilePath, false); - ASSERT_TRUE_EXT(nRes == qc4openx::ERR_NOERROR, strResultMessage.c_str()); - - nRes |= CheckFilesEqual(strResultMessage, strResultFilePath, strExpectedResultFilePath); - ASSERT_TRUE_EXT(nRes == qc4openx::ERR_NOERROR, strResultMessage.c_str()); - - a_util::filesystem::remove(strResultFilePath.c_str()); -} - -TEST_F(cTesterXoscSchema, CmdXosc) -{ - std::string strResultMessage; - - std::string strXoscFilePath = "../stimuli/xosc_examples/test_ramp.xosc"; - std::string strResultFilePath = strWorkingDir + "/" + std::string(MODULE_NAME) + ".xqar"; - std::string strExpectedResultFilePath = strTestFilesDir + "/" + std::string(MODULE_NAME) + ".xqar"; - - qc4openx::Result nRes = ExecuteCommand(strResultMessage, MODULE_NAME, strXoscFilePath); - ASSERT_TRUE_EXT(nRes == qc4openx::ERR_NOERROR, strResultMessage.c_str()); - - nRes |= CheckFileExists(strResultMessage, strResultFilePath, false); - ASSERT_TRUE_EXT(nRes == qc4openx::ERR_NOERROR, strResultMessage.c_str()); - - nRes |= CheckFilesEqual(strResultMessage, strResultFilePath, strExpectedResultFilePath); - ASSERT_TRUE_EXT(nRes == qc4openx::ERR_NOERROR, strResultMessage.c_str()); - - a_util::filesystem::remove(strResultFilePath.c_str()); -} - -TEST_F(cTesterXoscSchema, CmdConfigFileNotFound) -{ - std::string strResultMessage; - - qc4openx::Result nRes = ExecuteCommand(strResultMessage, MODULE_NAME, "error.xml"); - ASSERT_TRUE(nRes == qc4openx::ERR_FAILED); -} - -TEST_F(cTesterXoscSchema, CmdFirstArgumentWrong) -{ - std::string strResultMessage; - - qc4openx::Result nRes = ExecuteCommand(strResultMessage, MODULE_NAME, "error"); - ASSERT_TRUE(nRes == qc4openx::ERR_FAILED); -} - -TEST_F(cTesterXoscSchema, CmdTooMuchArguments) -{ - std::string strResultMessage; - - qc4openx::Result nRes = ExecuteCommand(strResultMessage, MODULE_NAME, "a b"); - ASSERT_TRUE(nRes == qc4openx::ERR_FAILED); -} \ No newline at end of file diff --git a/test/function/examples/example_checker_bundle/src/example_checker_bundle_tester.cpp b/test/function/examples/example_checker_bundle/src/example_checker_bundle_tester.cpp index aa90714c..3cb5bcbe 100644 --- a/test/function/examples/example_checker_bundle/src/example_checker_bundle_tester.cpp +++ b/test/function/examples/example_checker_bundle/src/example_checker_bundle_tester.cpp @@ -14,9 +14,9 @@ class cTesterExampleCheckerBundle : public ::testing::Test { - public: - std::string strTestFilesDir = std::string(QC4OPENX_DBQA_EXAMPLE_TEST_REF_DIR); - std::string strWorkingDir = std::string(QC4OPENX_DBQA_EXAMPLE_TEST_WORK_DIR); + public: + std::string strTestFilesDir = std::string(QC4OPENX_DBQA_EXAMPLE_TEST_REF_DIR); + std::string strWorkingDir = std::string(QC4OPENX_DBQA_EXAMPLE_TEST_WORK_DIR); }; TEST_F(cTesterExampleCheckerBundle, CmdBasic) @@ -102,4 +102,4 @@ TEST_F(cTesterExampleCheckerBundle, CmdTooMuchArguments) qc4openx::Result nRes = ExecuteCommand(strResultMessage, MODULE_NAME, "a b"); ASSERT_TRUE(nRes == qc4openx::ERR_FAILED); -} \ No newline at end of file +} diff --git a/test/function/report_modules/report_module_gui/src/report_module_gui_tester.cpp b/test/function/report_modules/report_module_gui/src/report_module_gui_tester.cpp index 1052b52b..68841e6d 100644 --- a/test/function/report_modules/report_module_gui/src/report_module_gui_tester.cpp +++ b/test/function/report_modules/report_module_gui/src/report_module_gui_tester.cpp @@ -30,8 +30,8 @@ TEST_F(cTesterReportModuleGui, CmdDefaultConfig) { std::string strResultMessage; - std::string strDefaultConfigFilePath = a_util::filesystem::getWorkingDirectory().toString() + - "/" + std::string(MODULE_NAME) + ".xml"; + std::string strDefaultConfigFilePath = + a_util::filesystem::getWorkingDirectory().toString() + "/" + std::string(MODULE_NAME) + ".xml"; qc4openx::Result nRes = ExecuteCommand(strResultMessage, MODULE_NAME, "--defaultconfig"); ASSERT_TRUE_EXT(nRes == qc4openx::ERR_NOERROR, strResultMessage.c_str()); @@ -80,4 +80,4 @@ TEST_F(cTesterReportModuleGui, CmdTooMuchArguments) qc4openx::Result nRes = ExecuteCommand(strResultMessage, MODULE_NAME, "a b"); ASSERT_TRUE(nRes == qc4openx::ERR_FAILED); -} \ No newline at end of file +} diff --git a/test/function/report_modules/report_module_text/src/report_module_text_tester.cpp b/test/function/report_modules/report_module_text/src/report_module_text_tester.cpp index ed6d7049..9f68727c 100644 --- a/test/function/report_modules/report_module_text/src/report_module_text_tester.cpp +++ b/test/function/report_modules/report_module_text/src/report_module_text_tester.cpp @@ -14,9 +14,9 @@ class cTesterReportModuleText : public ::testing::Test { - public: - std::string strTestFilesDir = std::string(QC4OPENX_DBQA_REPORT_MODULE_TEXT_TEST_REF_DIR); - std::string strWorkingDir = std::string(QC4OPENX_DBQA_REPORT_MODULE_TEXT_TEST_WORK_DIR); + public: + std::string strTestFilesDir = std::string(QC4OPENX_DBQA_REPORT_MODULE_TEXT_TEST_REF_DIR); + std::string strWorkingDir = std::string(QC4OPENX_DBQA_REPORT_MODULE_TEXT_TEST_WORK_DIR); }; TEST_F(cTesterReportModuleText, CmdBasic) @@ -98,4 +98,4 @@ TEST_F(cTesterReportModuleText, CmdTooMuchArguments) qc4openx::Result nRes = ExecuteCommand(strResultMessage, MODULE_NAME, "a b"); ASSERT_TRUE(nRes == qc4openx::ERR_FAILED); -} \ No newline at end of file +} diff --git a/test/function/result_pooling/src/result_pooling_tester.cpp b/test/function/result_pooling/src/result_pooling_tester.cpp index 85f37bfd..c4618a20 100644 --- a/test/function/result_pooling/src/result_pooling_tester.cpp +++ b/test/function/result_pooling/src/result_pooling_tester.cpp @@ -12,8 +12,9 @@ #define MODULE_NAME "ResultPooling" -class cTesterResultPooling : public ::testing::Test { -public: +class cTesterResultPooling : public ::testing::Test +{ + public: std::string strTestFilesDir = std::string(QC4OPENX_DBQA_RESULT_POOLING_TEST_REF_DIR); std::string strWorkingDir = std::string(QC4OPENX_DBQA_RESULT_POOLING_TEST_WORK_DIR); }; @@ -86,4 +87,4 @@ TEST_F(cTesterResultPooling, CmdTooMuchArguments) qc4openx::Result nRes = ExecuteCommand(strResultMessage, MODULE_NAME, "a b"); ASSERT_TRUE(nRes == qc4openx::ERR_FAILED); -} \ No newline at end of file +} diff --git a/test/function/runtime/src/runtime_tester.cpp b/test/function/runtime/src/runtime_tester.cpp index a580eb31..26843465 100644 --- a/test/function/runtime/src/runtime_tester.cpp +++ b/test/function/runtime/src/runtime_tester.cpp @@ -14,9 +14,9 @@ class cTesterRuntime : public ::testing::Test { - public: - std::string strTestFilesDir = std::string(QC4OPENX_DBQA_RUNTIME_TEST_REF_DIR); - std::string strWorkingDir = std::string(QC4OPENX_DBQA_RUNTIME_TEST_WORK_DIR); + public: + std::string strTestFilesDir = std::string(QC4OPENX_DBQA_RUNTIME_TEST_REF_DIR); + std::string strWorkingDir = std::string(QC4OPENX_DBQA_RUNTIME_TEST_WORK_DIR); }; TEST_F(cTesterRuntime, CmdHelp) @@ -42,7 +42,8 @@ TEST_F(cTesterRuntime, CmdConfigAutostart) std::string strConfigFilePath = strTestFilesDir + "/" + "DemoCheckerBundle_config.xml"; std::string strResultFilePath = strWorkingDir + "/" + "Result.xqar"; - qc4openx::Result nRes = ExecuteCommand(strResultMessage, MODULE_NAME, "-config " + strConfigFilePath + " -autostart"); + qc4openx::Result nRes = + ExecuteCommand(strResultMessage, MODULE_NAME, "-config " + strConfigFilePath + " -autostart"); ASSERT_TRUE_EXT(nRes == qc4openx::ERR_NOERROR, strResultMessage.c_str()); // DemoCheckerBundle not found in bin (is in examples) --> no DemoCheckerBundle.xqar --> Result.xqar with no entries @@ -60,7 +61,8 @@ TEST_F(cTesterRuntime, CmdConfigXodrAutostart) std::string strXodrSchemaCheckerResultFilePath = strWorkingDir + "/" + "XodrSchemaChecker.xqar"; std::string strResultFilePath = strWorkingDir + "/" + "Result.xqar"; - qc4openx::Result nRes = ExecuteCommand(strResultMessage, MODULE_NAME, "-config " + strConfigFilePath + " -xodr " + strXodrFilePath + " -autostart"); + qc4openx::Result nRes = ExecuteCommand( + strResultMessage, MODULE_NAME, "-config " + strConfigFilePath + " -xodr " + strXodrFilePath + " -autostart"); ASSERT_TRUE_EXT(nRes == qc4openx::ERR_NOERROR, strResultMessage.c_str()); nRes |= CheckFileExists(strResultMessage, strXodrSchemaCheckerResultFilePath); @@ -79,7 +81,8 @@ TEST_F(cTesterRuntime, CmdConfigXoscAutostart) std::string strXoscSchemaCheckerResultFilePath = strWorkingDir + "/" + "XoscSchemaChecker.xqar"; std::string strResultFilePath = strWorkingDir + "/" + "Result.xqar"; - qc4openx::Result nRes = ExecuteCommand(strResultMessage, MODULE_NAME, "-config " + strConfigFilePath + " -xosc " + strXoscFilePath + " -autostart"); + qc4openx::Result nRes = ExecuteCommand( + strResultMessage, MODULE_NAME, "-config " + strConfigFilePath + " -xosc " + strXoscFilePath + " -autostart"); ASSERT_TRUE_EXT(nRes == qc4openx::ERR_NOERROR, strResultMessage.c_str()); nRes |= CheckFileExists(strResultMessage, strXoscSchemaCheckerResultFilePath); @@ -87,4 +90,4 @@ TEST_F(cTesterRuntime, CmdConfigXoscAutostart) nRes |= CheckFileExists(strResultMessage, strResultFilePath); ASSERT_TRUE_EXT(nRes == qc4openx::ERR_NOERROR, strResultMessage.c_str()); -} \ No newline at end of file +}