Skip to content

Commit

Permalink
Merge branch 'master' into pandaKConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
cbcalves authored Feb 15, 2021
2 parents 5904d92 + 3faad1f commit 04161ab
Show file tree
Hide file tree
Showing 40 changed files with 341 additions and 296 deletions.
37 changes: 14 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ jobs:

steps:
- uses: actions/checkout@v2
with:
with:
submodules: recursive
fetch-depth: 0

- name: Install Qt5
run: |
sudo apt-get update
sudo apt-get install build-essential libgl1-mesa-dev libxkbcommon-x11-0 libpulse-dev -y
sudo apt-get install build-essential libgl1-mesa-dev libxkbcommon-x11-0 libpulse-dev -y cmake libkf5config-dev
python3 -m pip install setuptools wheel
python3 -m pip install py7zr==0.10.1
python3 -m pip install aqtinstall==0.9.7
Expand All @@ -40,7 +40,7 @@ jobs:
export PATH
- name: Install AppImage dependencies
run: |
sudo apt-get install libgstreamer-plugins-base1.0-0 libgstreamer-plugins-base1.0-dev
sudo apt-get install libgstreamer-plugins-base1.0-0 libgstreamer-plugins-base1.0-dev
sudo apt-get install libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0-dev libxcb-render-util0 libxcb-xinerama0
- name: Get linuxdeployqt
run: |
Expand All @@ -50,10 +50,7 @@ jobs:
run: |
PATH=/home/runner/work/wiredpanda-testing/Qt/5.15.1/gcc_64/bin:$PATH
export PATH
mkdir build
cd build
qmake ../WPanda.pro
make -j8
cmake -B build -DCMAKE_BUILD_TYPE=Release && cmake --build build --parallel --config Release
- name: Deploy
uses: actions/upload-artifact@v2
with:
Expand All @@ -66,7 +63,7 @@ jobs:
export PATH
cp installer/Linux/portable_files/wpanda.desktop build/app/wpanda.desktop
cp app/resources/wpanda.png build/app/wpanda.png
~/linuxdeployqt-continuous-x86_64.AppImage build/app/wpanda -appimage
~/linuxdeployqt-continuous-x86_64.AppImage build/app/wpanda -appimage
- name: Upload WiredPanda AppImage
uses: actions/upload-artifact@v2
with:
Expand All @@ -81,7 +78,7 @@ jobs:

steps:
- uses: actions/checkout@v2
with:
with:
submodules: recursive
fetch-depth: 0

Expand All @@ -90,13 +87,13 @@ jobs:
with:
version: 5.15.1
modules: qtcharts qtmultimedia
run: |
sudo apt-get update
sudo apt-get install build-essential libgl1-mesa-dev libxkbcommon-x11-0 libpulse-dev -y cmake libkf5config-dev
- name: Build
run: |
mkdir build
cd build
qmake ../WPanda.pro
make -j8
cmake -B build -DCMAKE_BUILD_TYPE=Release && cmake --build build --parallel --config Release
- name: Deploy
uses: actions/upload-artifact@v2
with:
Expand All @@ -109,7 +106,7 @@ jobs:

steps:
- uses: actions/checkout@v2
with:
with:
submodules: recursive
fetch-depth: 0

Expand All @@ -125,10 +122,7 @@ jobs:

- name: Build
run: |
mkdir build
cd build
qmake ../WPanda.pro
make -j8
cmake -B build -DCMAKE_BUILD_TYPE=Release && cmake --build build --parallel --config Release
- name: Deploy WiredPanda binary
run : |
cd build\app\release
Expand All @@ -153,7 +147,7 @@ jobs:

steps:
- uses: actions/checkout@v2
with:
with:
submodules: recursive
fetch-depth: 0

Expand All @@ -163,10 +157,7 @@ jobs:
- name: Build
run: |
QTDIR="/usr/local/opt/qt/" && PATH="${QTDIR}/bin:$PATH" && LDFLAGS=-L${QTDIR}/lib && CPPFLAGS=-I${QTDIR}/include;
mkdir build
cd build
qmake ../WPanda.pro
make -j8
cmake -B build -DCMAKE_BUILD_TYPE=Release && cmake --build build --parallel --config Release
- name: Deploy
uses: actions/upload-artifact@v2
with:
Expand Down
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)

if(MSVC)
set(COMPILE_WARNS /W4 /WX)
else()
set(COMPILE_WARNS -Wall -Wextra -pedantic)
endif()

add_compile_definitions(
QT_USE_QSTRINGBUILDER
QT_NO_CAST_TO_ASCII
Expand Down Expand Up @@ -57,7 +63,7 @@ set(
KF5::ConfigGui
)

find_package (ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
find_package (ECM ${KF5_MIN_VERSION} NO_MODULE)
set (CMAKE_MODULE_PATH ${ECM_MODULE_PATH})

include(cmake/Git.cmake)
Expand Down
2 changes: 2 additions & 0 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ target_compile_definitions(
-DCURRENTDIR="${CMAKE_CURRENT_SOURCE_DIR}"
-DAPP_VERSION="${APP_VERSION}"
)
target_compile_options( wpandacommon PUBLIC ${COMPILE_WARNS} )

add_subdirectory(element)
add_subdirectory(logicelement)
Expand Down Expand Up @@ -90,6 +91,7 @@ target_compile_definitions(
PUBLIC
-DAPP_VERSION="${APP_VERSION}"
)
target_compile_options( wpanda PUBLIC ${COMPILE_WARNS} )

target_link_libraries(
wpanda
Expand Down
1 change: 1 addition & 0 deletions app/element/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ set (
# tlatch.cpp
add_library(wpandaelements ${WPANDA_ELEMENT} )
target_link_libraries(wpandaelements PUBLIC ${WPANDA_LIBS} )
target_compile_options(wpandaelements PRIVATE ${COMPILE_WARNS} )
8 changes: 4 additions & 4 deletions app/element/and.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
And::And(QGraphicsItem *parent)
: GraphicElement(ElementType::AND, ElementGroup::GATE, 2, 8, 1, 1, parent)
{
pixmapSkinName = {":/basic/and.png"};
m_pixmapSkinName = {":/basic/and.png"};

setOutputsOnTop(true);
setPixmap(pixmapSkinName[0]);
setPixmap(m_pixmapSkinName[0]);
updatePorts();
setCanChangeSkin(true);
setPortName("AND");
Expand All @@ -18,6 +18,6 @@ And::And(QGraphicsItem *parent)

void And::setSkin(bool defaultSkin, const QString &filename)
{
pixmapSkinName[0] = defaultSkin ? ":/basic/and.png" : filename;
setPixmap(pixmapSkinName[0]);
m_pixmapSkinName[0] = defaultSkin ? ":/basic/and.png" : filename;
setPixmap(m_pixmapSkinName[0]);
}
16 changes: 8 additions & 8 deletions app/element/buzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ static constexpr std::array<const char *, 2> defaultSkins {
Buzzer::Buzzer(QGraphicsItem *parent)
: GraphicElement(ElementType::BUZZER, ElementGroup::OUTPUT, 1, 1, 0, 0, parent)
{
// pixmapSkinName.append( ":/output/BuzzerOff.png" );
// pixmapSkinName.append( ":/output/BuzzerOn.png" );
// m_pixmapSkinName.append( ":/output/BuzzerOff.png" );
// m_pixmapSkinName.append( ":/output/BuzzerOn.png" );
setOutputsOnTop(true);
setRotatable(false);
setHasAudio(true);
// setPixmap( pixmapSkinName[ 0 ] );
// setPixmap( m_pixmapSkinName[ 0 ] );
setPixmap(defaultSkins[0]);
m_alternativeSkins = QVector<QString>({defaultSkins[0], defaultSkins[1]});
updatePorts();
Expand All @@ -40,7 +40,7 @@ Buzzer::Buzzer(QGraphicsItem *parent)
setPortName("Buzzer");
setLabel(objectName() + "_" + QString::number(Buzzer::current_id_number));
++Buzzer::current_id_number;
usingDefaultSkin = true;
m_usingDefaultSkin = true;
setAudio("C6");
m_play = 0;
}
Expand Down Expand Up @@ -84,14 +84,14 @@ void Buzzer::playbuzzer()
return;
}

usingDefaultSkin ? setPixmap(defaultSkins[1]) : setPixmap(m_alternativeSkins[1]);
m_usingDefaultSkin ? setPixmap(defaultSkins[1]) : setPixmap(m_alternativeSkins[1]);
m_audio.play();
m_play = 1;
}

void Buzzer::stopbuzzer()
{
usingDefaultSkin ? setPixmap(defaultSkins[0]) : setPixmap(m_alternativeSkins[0]);
m_usingDefaultSkin ? setPixmap(defaultSkins[0]) : setPixmap(m_alternativeSkins[0]);
m_play = 0;
m_audio.stop();
}
Expand Down Expand Up @@ -119,10 +119,10 @@ void Buzzer::setSkin(bool defaultSkin, const QString &filename)
m_play = 1;
}
if (defaultSkin) {
usingDefaultSkin = true;
m_usingDefaultSkin = true;
setPixmap(defaultSkins[m_play]);
} else {
usingDefaultSkin = false;
m_usingDefaultSkin = false;
m_alternativeSkins[m_play] = filename;
setPixmap(m_alternativeSkins[m_play]);
// std::cerr << "Filename: " << alternativeSkins[ play ].toStdString() << '\n';
Expand Down
14 changes: 7 additions & 7 deletions app/element/clock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Clock::~Clock() = default;
Clock::Clock(QGraphicsItem *parent)
: GraphicElement(ElementType::CLOCK, ElementGroup::INPUT, 0, 0, 1, 1, parent)
{
pixmapSkinName = {
m_pixmapSkinName = {
":/input/clock0.png",
":/input/clock1.png"
};
Expand All @@ -31,7 +31,7 @@ Clock::Clock(QGraphicsItem *parent)
setHasLabel(true);
setPortName("Clock");
setOn(false);
setPixmap(pixmapSkinName[0]);
setPixmap(m_pixmapSkinName[0]);
}

void Clock::updateClock()
Expand All @@ -53,7 +53,7 @@ bool Clock::getOn() const
void Clock::setOn(bool value)
{
m_isOn = value;
setPixmap(pixmapSkinName[m_isOn ? 1 : 0]);
setPixmap(m_pixmapSkinName[m_isOn ? 1 : 0]);
m_outputs.first()->setValue(m_isOn);
}

Expand Down Expand Up @@ -113,10 +113,10 @@ QString Clock::genericProperties()
void Clock::setSkin(bool defaultSkin, const QString &filename)
{
if (!m_isOn) {
pixmapSkinName[0] = defaultSkin ? ":/input/clock0.png" : filename;
setPixmap(pixmapSkinName[0]);
m_pixmapSkinName[0] = defaultSkin ? ":/input/clock0.png" : filename;
setPixmap(m_pixmapSkinName[0]);
} else {
pixmapSkinName[1] = defaultSkin ? ":/input/clock1.png" : filename;
setPixmap(pixmapSkinName[1]);
m_pixmapSkinName[1] = defaultSkin ? ":/input/clock1.png" : filename;
setPixmap(m_pixmapSkinName[1]);
}
}
10 changes: 5 additions & 5 deletions app/element/demux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
Demux::Demux(QGraphicsItem *parent)
: GraphicElement(ElementType::DEMUX, ElementGroup::MUX, 2, 2, 2, 2, parent)
{
pixmapSkinName = {":/basic/demux.png"};
setPixmap(pixmapSkinName[0]);
m_pixmapSkinName = {":/basic/demux.png"};
setPixmap(m_pixmapSkinName[0]);
setRotatable(true);
setCanChangeSkin(true);
updatePorts();
Expand All @@ -34,9 +34,9 @@ void Demux::updatePorts()
void Demux::setSkin(bool defaultSkin, const QString &filename)
{
if (defaultSkin) {
pixmapSkinName[0] = ":/basic/demux.png";
m_pixmapSkinName[0] = ":/basic/demux.png";
} else {
pixmapSkinName[0] = filename;
m_pixmapSkinName[0] = filename;
}
setPixmap(pixmapSkinName[0]);
setPixmap(m_pixmapSkinName[0]);
}
10 changes: 5 additions & 5 deletions app/element/dflipflop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
DFlipFlop::DFlipFlop(QGraphicsItem *parent)
: GraphicElement(ElementType::DFLIPFLOP, ElementGroup::MEMORY, 4, 4, 2, 2, parent)
{
pixmapSkinName = {":/memory/D-flipflop.png"};
m_pixmapSkinName = {":/memory/D-flipflop.png"};

setPixmap(pixmapSkinName[0]);
setPixmap(m_pixmapSkinName[0]);
setRotatable(false);
setCanChangeSkin(true);
updatePorts();
Expand Down Expand Up @@ -46,9 +46,9 @@ void DFlipFlop::updatePorts()
void DFlipFlop::setSkin(bool defaultSkin, const QString &filename)
{
if (defaultSkin) {
pixmapSkinName[0] = ":/memory/D-flipflop.png";
m_pixmapSkinName[0] = ":/memory/D-flipflop.png";
} else {
pixmapSkinName[0] = filename;
m_pixmapSkinName[0] = filename;
}
setPixmap(pixmapSkinName[0]);
setPixmap(m_pixmapSkinName[0]);
}
26 changes: 13 additions & 13 deletions app/element/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ int Display::current_id_number = 0;
Display::Display(QGraphicsItem *parent)
: GraphicElement(ElementType::DISPLAY, ElementGroup::OUTPUT, 8, 8, 0, 0, parent)
{
pixmapSkinName = {
m_pixmapSkinName = {
":/output/counter/counter_off.png",
":/output/counter/counter_a.png",
":/output/counter/counter_b.png",
Expand All @@ -33,15 +33,15 @@ Display::Display(QGraphicsItem *parent)
setTopPosition(6);
setHasLabel(true);

setPixmap(pixmapSkinName[0]);
a = QPixmap(pixmapSkinName[1]);
b = QPixmap(pixmapSkinName[2]);
c = QPixmap(pixmapSkinName[3]);
d = QPixmap(pixmapSkinName[4]);
e = QPixmap(pixmapSkinName[5]);
f = QPixmap(pixmapSkinName[6]);
g = QPixmap(pixmapSkinName[7]);
dp = QPixmap(pixmapSkinName[8]);
setPixmap(m_pixmapSkinName[0]);
a = QPixmap(m_pixmapSkinName[1]);
b = QPixmap(m_pixmapSkinName[2]);
c = QPixmap(m_pixmapSkinName[3]);
d = QPixmap(m_pixmapSkinName[4]);
e = QPixmap(m_pixmapSkinName[5]);
f = QPixmap(m_pixmapSkinName[6]);
g = QPixmap(m_pixmapSkinName[7]);
dp = QPixmap(m_pixmapSkinName[8]);

setPortName("Display");
for (QNEPort *in : qAsConst(m_inputs)) {
Expand Down Expand Up @@ -139,9 +139,9 @@ void Display::load(QDataStream &ds, QMap<quint64, QNEPort *> &portMap, double ve
void Display::setSkin(bool defaultSkin, const QString &filename)
{
if (defaultSkin) {
pixmapSkinName[0] = ":/output/counter/counter_off.png";
m_pixmapSkinName[0] = ":/output/counter/counter_off.png";
} else {
pixmapSkinName[0] = filename;
m_pixmapSkinName[0] = filename;
}
setPixmap(pixmapSkinName[0]);
setPixmap(m_pixmapSkinName[0]);
}
Loading

0 comments on commit 04161ab

Please sign in to comment.