Skip to content

Commit

Permalink
Link Atcore-app with atcore
Browse files Browse the repository at this point in the history
Connect button will now connect (needs https://phabricator.kde.org/D7759)

Signed-off-by: Chris Rizzitello <[email protected]>
  • Loading branch information
sithlord48 committed Sep 21, 2017
1 parent 11223d5 commit e4dfacd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Android")
set(atcore-gui_EXTRA_LIBS Qt5::AndroidExtras Qt5::QuickControls2)
endif()

find_package(AtCore REQUIRED COMPONENTS
AtCore
)

find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui Svg QuickControls2)

set(atcore-gui_SRCS
Expand All @@ -27,6 +31,6 @@ set(atcore-gui_SRCS
qt5_add_resources(RESOURCES resources.qrc)

add_executable(atcore-gui ${atcore-gui_SRCS} ${RESOURCES})
target_link_libraries(atcore-gui Qt5::Core Qt5::Qml Qt5::Quick Qt5::Svg ${atcore-gui_EXTRA_LIBS})
target_link_libraries(atcore-gui AtCore::AtCore Qt5::Core Qt5::Qml Qt5::Quick Qt5::Svg ${atcore-gui_EXTRA_LIBS})

install(TARGETS atcore-gui ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
4 changes: 2 additions & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
#include <QQuickView>
#include <QtQml>
#include <QUrl>

#include <AtCore/AtCore>

Q_DECL_EXPORT int main(int argc, char *argv[])
{
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);

QApplication app(argc, argv);

qmlRegisterType<AtCore>("org.kde.atcore", 1, 0, "AtCore");
QQuickView view;
view.setResizeMode(QQuickView::SizeRootObjectToView);
view.setSource(QUrl(QStringLiteral("qrc:///main.qml")));
Expand Down
7 changes: 7 additions & 0 deletions main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@ import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import org.kde.kirigami 2.1 as Kirigami
import QtQuick.Extras 1.4
import org.kde.atcore 1.0

Kirigami.ApplicationItem {
id: root

AtCore {
id: atcore
}

globalDrawer: Kirigami.GlobalDrawer {
id: left
title: "AtCore Gui"
Expand All @@ -29,12 +34,14 @@ Kirigami.ApplicationItem {
visible: false

TextField {
id: devText
placeholderText: "/dev/ttyUSB0"
Layout.fillWidth: true
}
Button {
text: "Connect"
onClicked: {
atcore.initSerial(devText.text, 115200)
rowPie.visible = !rowPie.visible
}
}
Expand Down

0 comments on commit e4dfacd

Please sign in to comment.