-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added GeneralTab to gatelibrary_manager's tab widget
Added close button to gatelibrary_manager to get back to previous screen Added docstrings
- Loading branch information
1 parent
18ba4b0
commit 39e51e6
Showing
8 changed files
with
217 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
.../gui/include/gui/gatelibrary_management/gatelibrary_tab_widgets/gatelibrary_tab_general.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// MIT License | ||
// | ||
// Copyright (c) 2019 Ruhr University Bochum, Chair for Embedded Security. All Rights reserved. | ||
// Copyright (c) 2019 Marc Fyrbiak, Sebastian Wallat, Max Hoffmann ("ORIGINAL AUTHORS"). All rights reserved. | ||
// Copyright (c) 2021 Max Planck Institute for Security and Privacy. All Rights reserved. | ||
// Copyright (c) 2021 Jörn Langheinrich, Julian Speith, Nils Albartus, René Walendy, Simon Klix ("ORIGINAL AUTHORS"). All Rights reserved. | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in all | ||
// copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
|
||
#pragma once | ||
|
||
#include "gatelibrary_tab_interface.h" | ||
#include "hal_core/defines.h" | ||
#include "hal_core/netlist/gate_library/gate_type.h" | ||
|
||
#include <QGridLayout> | ||
#include <QLabel> | ||
|
||
namespace hal | ||
{ | ||
/** | ||
* Widget which shows general information of a given gate | ||
*/ | ||
class GateLibraryTabGeneral : public QWidget, public GateLibraryTabInterface | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
GateLibraryTabGeneral(QWidget* parent = nullptr); | ||
|
||
|
||
void update(GateType* gate) override; | ||
|
||
|
||
private: | ||
|
||
QGridLayout* mGridLayout; | ||
|
||
QLabel* mNameLabel; | ||
QLabel* mIdLabel; | ||
QLabel* mComponentLabel; | ||
QLabel* mBooleanFunctionLabel; | ||
QLabel* mPinLabel; | ||
|
||
QLabel* mNamePropertyLabel; | ||
QLabel* mIdPropertyLabel; | ||
QLabel* mComponentPropertyLabel; | ||
QLabel* mBooleanFunctionPropertyLabel; | ||
QLabel* mPinPropertyLabel; | ||
|
||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
plugins/gui/src/gatelibrary_management/gatelibrary_tab_widgets/gatelibrary_tab_general.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
|
||
#include "gui/gatelibrary_management/gatelibrary_tab_widgets/gatelibrary_tab_general.h" | ||
|
||
#include "gui/gui_globals.h" | ||
#include "hal_core/netlist/gate_library/gate_type_component/ff_component.h" | ||
|
||
namespace hal | ||
{ | ||
|
||
GateLibraryTabGeneral::GateLibraryTabGeneral(QWidget* parent) : QWidget(parent) | ||
{ | ||
mGridLayout = new QGridLayout(parent); | ||
|
||
mNameLabel = new QLabel("Name", parent); | ||
mIdLabel = new QLabel("ID", parent); | ||
mComponentLabel = new QLabel("Component", parent); | ||
mBooleanFunctionLabel = new QLabel("Boolean function", parent); | ||
mPinLabel = new QLabel("Pins", parent); | ||
|
||
mNamePropertyLabel = new QLabel(" - ", parent); | ||
mIdPropertyLabel = new QLabel(" - ", parent); | ||
mComponentPropertyLabel = new QLabel(" - ", parent); | ||
mBooleanFunctionPropertyLabel = new QLabel(" - ", parent); | ||
mPinPropertyLabel = new QLabel(" - ", parent); | ||
|
||
mGridLayout->addWidget(mIdLabel, 0, 0); | ||
mGridLayout->addWidget(mIdPropertyLabel, 0, 1, Qt::AlignLeft); | ||
mGridLayout->addWidget(mNameLabel, 1, 0); | ||
mGridLayout->addWidget(mNamePropertyLabel, 1, 1, Qt::AlignLeft); | ||
mGridLayout->addWidget(mComponentLabel, 2, 0); | ||
mGridLayout->addWidget(mComponentPropertyLabel, 2, 1, Qt::AlignLeft); | ||
mGridLayout->addWidget(mBooleanFunctionLabel, 3, 0); | ||
mGridLayout->addWidget(mBooleanFunctionPropertyLabel, 3, 1, Qt::AlignLeft); | ||
mGridLayout->addWidget(mPinLabel, 4, 0); | ||
mGridLayout->addWidget(mPinPropertyLabel, 4, 1, Qt::AlignLeft); | ||
|
||
setLayout(mGridLayout); | ||
|
||
} | ||
|
||
void GateLibraryTabGeneral::update(GateType* gate) | ||
{ | ||
|
||
if(!gate){ | ||
//TODO make default look | ||
mNamePropertyLabel->setText("-"); | ||
mIdPropertyLabel->setText("-"); | ||
mComponentPropertyLabel->setText("-"); | ||
mBooleanFunctionPropertyLabel->setText("-"); | ||
mPinPropertyLabel->setText("-"); | ||
|
||
return; | ||
} | ||
|
||
mNamePropertyLabel->setText(QString::fromStdString(gate->get_name())); | ||
mIdPropertyLabel->setText(QString::number(gate->get_id())); | ||
//TODO add component | ||
mComponentPropertyLabel->setText("TODO"); | ||
mBooleanFunctionPropertyLabel->setText(QString::fromStdString(gate->get_boolean_function().to_string())); | ||
|
||
QString in = " "; | ||
QString out = " "; | ||
|
||
for(auto const& pin : gate->get_input_pin_names()){ | ||
in += QString::fromStdString(pin) + "\n "; | ||
} | ||
|
||
for(auto const& pin : gate->get_output_pin_names()){ | ||
out += QString::fromStdString(pin) + "\n "; | ||
} | ||
|
||
mPinPropertyLabel->setText("In:\n" + in + "\nOut:\n" + out); | ||
|
||
|
||
|
||
|
||
|
||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters