#ifndef ATTRIBUTE_DIALOG_H #define ATTRIBUTE_DIALOG_H #include #include #include #include #include #include #include #include #include #include #include #include #include "comdel/domain/comdel_validator.h" namespace display { class AttributeDialog : public QDialog { domain::Value value; long long int parseInt(std::string expression) { try { if (expression.size() > 2) { if (expression.substr(0, 2) == "0x") { return std::stoll(expression, nullptr, 16); } else if (expression.substr(0, 2) == "0b") { return std::stoll(expression, nullptr, 2); } else { return std::stoll(expression, nullptr, 10); } } else { return std::stoll(expression, nullptr, 10); } } catch (std::exception &e) { return 0; } } domain::InstanceAttribute *attributeValue; public: AttributeDialog(domain::InstanceAttribute *attribute); public slots: void onTextChanged(const QString &string); void onEnumerationChanged(int index); void onUpdate(); }; class MemoryDialog : public QDialog { domain::Value value; domain::InstanceAttribute *attributeValue; std::vector memoryInstances; public: MemoryDialog(domain::InstanceAttribute *attribute, std::vector> instances); public slots: void onMemoryChanged(int index); void onUpdate(); }; class ErrorDialog : public QDialog { public: ErrorDialog(std::vector errors); }; class WarningDialog : public QDialog { public: WarningDialog(domain::ValidationError error); }; } #endif //ATTRIBUTE_DIALOG_H