Skip to content

Commit

Permalink
Reorganize qml structure and add boson-specific controls
Browse files Browse the repository at this point in the history
  • Loading branch information
kekiefer committed Dec 27, 2016
1 parent f8b919a commit e315486
Show file tree
Hide file tree
Showing 18 changed files with 430 additions and 152 deletions.
21 changes: 15 additions & 6 deletions inc/bosonvariation.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,22 @@ class BosonVariation : public AbstractCCInterface

virtual const AbstractCCInterface& operator =(const AbstractCCInterface&);

BOSON_ENUM_PROPERTY(COLORLUT_ID_E, vidPcolorLut, colorLutGetId, colorLutSetId)
BOSON_ENUM_PROPERTY(COLORLUT_ID_E, colorLutId, colorLutGetId, colorLutSetId)

Q_PROPERTY(const QString sysFlirSerialNumber READ getSysFlirSerialNumber)
const QString getSysFlirSerialNumber();
Q_PROPERTY(const QString cameraSerialNumber READ getCameraSerialNumber)
const QString getCameraSerialNumber();

Q_PROPERTY(const QString oemFlirPartNumber READ getOemFlirPartNumber)
const QString getOemFlirPartNumber();
Q_PROPERTY(const QString cameraPartNumber READ getCameraPartNumber)
const QString getCameraPartNumber();

Q_PROPERTY(const QString sensorSerialNumber READ getSensorSerialNumber)
const QString getSensorSerialNumber();

Q_PROPERTY(const QString sensorPartNumber READ getSensorPartNumber)
const QString getSensorPartNumber();

Q_PROPERTY(const QString softwareRev READ getSoftwareRev)
const QString getSoftwareRev();

Q_PROPERTY(float cameraInternalTempC READ getCameraInternalTempC NOTIFY cameraInternalTempChanged)
float getCameraInternalTempC();
Expand All @@ -64,7 +73,7 @@ class BosonVariation : public AbstractCCInterface
signals:
void cameraInternalTempChanged(float temp);

void vidPcolorLutChanged(COLORLUT_ID_E val);
void colorLutIdChanged(COLORLUT_ID_E val);

public slots:
virtual void performFfc();
Expand Down
43 changes: 43 additions & 0 deletions inc/bosonvariation_types.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#ifndef BOSONVARIATION_TYPES_H
#define BOSONVARIATION_TYPES_H

#include <QQmlComponent>
#include <QMetaType>

extern "C" {
#include "boson_sdk/ReturnCodes.h"
#include "boson_sdk/EnumTypes.h"
}

#define QML_ENUM(name, storageType, ...)\
enum class name : storageType {\
__VA_ARGS__\
};\
class QE_##name {\
Q_GADGET\
Q_ENUMS(E)\
public:\
enum class E : storageType {\
__VA_ARGS__\
};\
};

namespace FLR {

QML_ENUM(COLORLUT_ID_E, int32_t, \
FLR_COLORLUT_WHITEHOT, \
FLR_COLORLUT_BLACKHOT, \
FLR_COLORLUT_REDHOT, \
FLR_COLORLUT_RAINBOW, \
FLR_COLORLUT_IRONBOW, \
FLR_COLORLUT_LAVA, \
FLR_COLORLUT_ARCTIC, \
FLR_COLORLUT_GLOBOW, \
FLR_COLORLUT_GRADEDFIRE, \
FLR_COLORLUT_INSTALERT, \
)

}
void registerBosonVariationQmlTypes();

#endif // BOSONVARIATION_TYPES_H
48 changes: 0 additions & 48 deletions qml/PaletteModel.qml

This file was deleted.

85 changes: 3 additions & 82 deletions qml/ViewerForm.ui.qml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import QtQuick.Controls 2.0
import QtQuick.Layouts 1.0
import QtMultimedia 5.5
import GetThermal 1.0
import "qrc:/lepton"
import "qrc:/controls"
import "qrc:/images"

Expand All @@ -14,7 +13,6 @@ Item {
property alias acq: acq
property alias player: player
property alias videoOutput: videoOutput
property alias leptonControls1: leptonControls1
width: 640

UvcAcquisition {
Expand All @@ -30,87 +28,10 @@ Item {
spacing: 0
anchors.fill: parent

Pane {
rightPadding: 12
topPadding: 12
bottomPadding: 12
leftPadding: 12
Layout.minimumWidth: 220
CameraControls {
Layout.minimumWidth: 240
Layout.fillHeight: true
padding: 0

Image {
id: imageLogo
anchors.left: parent.left
anchors.top: parent.top
anchors.right: parent.right
height: 50
fillMode: Image.PreserveAspectFit
source: "/images/images/brand-logo.png"
}

Page {
anchors.top: imageLogo.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
clip: true

header: TabBar {
id: tabBar
currentIndex: swipeView.currentIndex
TabButton {
text: qsTr("VID")
}
TabButton {
text: qsTr("AGC")
visible: typeof acq === "LeptonVariation"
}
TabButton {
text: qsTr("Info")
visible: typeof acq === "LeptonVariation"
}
}

SwipeView {
id: swipeView
x: 0
y: 40
currentIndex: tabBar.currentIndex
anchors.fill: parent


VidControls {
id: vidControls1
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.top: parent.top
acq: acq
}

AgcControls {
id: agcControls1
anchors.bottom: parent.bottom
anchors.left: vidControls1.right
anchors.top: parent.top
acq: acq
visible: typeof acq === "LeptonVariation"
}


LeptonControls {
id: leptonControls1
anchors.bottom: parent.bottom
anchors.left: agcControls1.right
anchors.top: parent.top
acq: acq
visible: typeof acq === "LeptonVariation"
}
}



}
acq: acq
}

Pane {
Expand Down
52 changes: 52 additions & 0 deletions qml/boson/BosonTabs.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import QtQuick 2.0
import QtQuick.Controls 2.0
import GetThermal 1.0
import "qrc:/boson"

Page {
id: root
clip: true

width: 220
height: 480

property UvcAcquisition acq: null

header: TabBar {
id: tabBar
currentIndex: swipeView.currentIndex

TabButton {
text: qsTr("Vid")
}

TabButton {
text: qsTr("Info")
}
}

SwipeView {
id: swipeView
x: 0
y: 40
currentIndex: tabBar.currentIndex
anchors.fill: parent

VidControls {
id: vidControls1
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.top: parent.top
acq: root.acq
}

InfoControls {
id: infoControls1
anchors.bottom: parent.bottom
anchors.left: vidControls1.right
anchors.top: parent.top
acq: root.acq
}
}

}
49 changes: 49 additions & 0 deletions qml/boson/InfoControls.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import QtQuick 2.0
import QtQuick.Controls 2.0
import GetThermal 1.0

Item {
id: root
width: 200
property UvcAcquisition acq: null

GroupBox {
id: groupBox1
clip: true

anchors.margins: 5
anchors.fill: parent
title: qsTr("FLIR Boson")

Grid {
id: grid

columns: 1
rows: 8
anchors.fill: parent
spacing: 10
flow: Grid.TopToBottom

Label {
text: qsTr("Sensor PN: ") + acq.cci.sensorPartNumber
}

Label {
text: qsTr("Sensor SN: ") + acq.cci.sensorSerialNumber
}

Label {
text: qsTr("Cam PN: ") + acq.cci.cameraPartNumber
}

Label {
text: qsTr("Cam SN: ") + acq.cci.cameraSerialNumber
}

Label {
text: qsTr("Software: ") + acq.cci.softwareRev
}
}
}

}
Loading

0 comments on commit e315486

Please sign in to comment.