Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Qt CAN - Virtual test-bench tooling
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
5
Issues
5
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Qt CAN 2.0
Qt CAN - Virtual test-bench tooling
Commits
af29121c
Commit
af29121c
authored
Jun 21, 2017
by
Thomas BOUTROUE
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better visual look and feel for I/O table delegates
parent
2e4a896c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
412 additions
and
189 deletions
+412
-189
CanTestBench.qbs
CanTestBench.qbs
+6
-0
DelegatePhyValTable.qml
components/DelegatePhyValTable.qml
+4
-1
DelegateRawAinTable.qml
components/DelegateRawAinTable.qml
+80
-0
DelegateRawAoutTable.qml
components/DelegateRawAoutTable.qml
+82
-0
DelegateRawBoardTable.qml
components/DelegateRawBoardTable.qml
+49
-0
DelegateRawDinTable.qml
components/DelegateRawDinTable.qml
+70
-0
DelegateRawDoutTable.qml
components/DelegateRawDoutTable.qml
+71
-0
DelegateRawNodeTable.qml
components/DelegateRawNodeTable.qml
+31
-0
DimensionsList.qml
components/DimensionsList.qml
+10
-8
ui_testBench.qml
ui_testBench.qml
+9
-180
No files found.
CanTestBench.qbs
View file @
af29121c
...
...
@@ -162,6 +162,12 @@ Project {
"components/DelegatePhyMarkerTable.qml",
"components/DelegatePhyValTable.qml",
"components/DelegatePropertyHelp.qml",
"components/DelegateRawAinTable.qml",
"components/DelegateRawAoutTable.qml",
"components/DelegateRawBoardTable.qml",
"components/DelegateRawDinTable.qml",
"components/DelegateRawDoutTable.qml",
"components/DelegateRawNodeTable.qml",
"components/DelegateRoutineOnCanFrame.qml",
"components/DelegateRoutineOnCanOpenNmtStateChange.qml",
"components/DelegateRoutineOnCanOpenObdValChange.qml",
...
...
components/DelegatePhyValTable.qml
View file @
af29121c
...
...
@@ -6,13 +6,14 @@ import QtCAN.CanTestBench 2.0;
MouseArea
{
id
:
delegatePhyValTable
;
height
:
implicitHeight
;
visible
:
(
current
||
editable
||
!
toggleShowOnlyEditable
.
checked
)
;
visible
:
shouldBeVisible
;
hoverEnabled
:
true
;
implicitHeight
:
(
layoutValPhyTable
.
height
+
layoutValPhyTable
.
anchors
.
margins
*
2
);
ExtraAnchors.horizontalFill
:
parent
;
onCurrentChanged
:
{
if
(
current
)
{
timerEnsureVisible
.
restart
();
editValPhy
.
forceActiveFocus
();
}
}
Component.onCompleted
:
{
...
...
@@ -24,6 +25,8 @@ MouseArea {
property
PhysicalValue
phyVal
:
null
;
readonly
property
bool
shouldBeVisible
:
(
current
||
editable
||
!
toggleShowOnlyEditable
.
checked
);
readonly
property
bool
current
:
(
phyVal
===
highlightPhyVal
);
readonly
property
bool
editable
:
(
phyVal
.
min
!==
phyVal
.
max
);
...
...
components/DelegateRawAinTable.qml
0 → 100644
View file @
af29121c
import
QtQuick
2.1
;
import
QtQmlTricks
.
UiElements
2.0
;
import
QtQmlTricks
.
SmartDataModels
2.0
;
import
QtCAN
.
CanTestBench
2.0
;
MouseArea
{
id
:
base
;
height
:
implicitHeight
;
hoverEnabled
:
true
;
implicitHeight
:
(
layoutIoTable
.
height
+
layoutIoTable
.
anchors
.
margins
*
2
);
ExtraAnchors.horizontalFill
:
parent
;
property
AnalogInput
io
:
null
;
Rectangle
{
color
:
Style
.
colorSecondary
;
opacity
:
0.15
;
border
{
width
:
Style
.
lineSize
;
color
:
Style
.
colorBorder
;
}
anchors.fill
:
parent
;
}
Rectangle
{
color
:
Style
.
opacify
(
Style
.
colorHighlight
,
0.35
);
visible
:
base
.
containsMouse
;
anchors.fill
:
parent
;
}
StretchRowContainer
{
id
:
layoutIoTable
;
spacing
:
Style
.
spacingNormal
;
anchors.margins
:
Style
.
spacingSmall
;
anchors.verticalCenter
:
parent
.
verticalCenter
;
ExtraAnchors.horizontalFill
:
parent
;
TextLabel
{
text
:
io
.
uid
;
emphasis
:
true
;
anchors.verticalCenter
:
parent
.
verticalCenter
;
}
SvgIconLoader
{
icon
:
(
io
.
link
&&
io
.
link
.
reversed
?
"qrc:///icons/reverse.svg"
:
"qrc:///icons/normal.svg"
);
size
:
Style
.
fontSizeSmall
;
color
:
Style
.
colorForeground
;
visible
:
linkSource
.
visible
;
anchors.verticalCenter
:
parent
.
verticalCenter
;
}
ClickableTextLabel
{
id
:
linkSource
;
text
:
(
io
.
link
&&
io
.
link
.
source
?
io
.
link
.
source
.
uid
:
""
);
visible
:
(
text
!==
""
);
anchors.verticalCenter
:
parent
.
verticalCenter
;
onClicked
:
{
highlightSensor
=
null
;
highlightSensor
=
io
.
link
.
source
;
}
}
Stretcher
{
}
TextLabel
{
text
:
(
io
.
resolutionInPoints
+
" points"
);
color
:
Style
.
colorBorder
;
visible
:
io
.
isAnalog
;
anchors.verticalCenter
:
parent
.
verticalCenter
;
}
Stretcher
{
implicitWidth
:
(
Style
.
spacingBig
*
3
);
}
NumberBox
{
padding
:
Style
.
spacingSmall
;
minValue
:
io
.
minRaw
;
maxValue
:
io
.
maxRaw
;
anchors.verticalCenter
:
parent
.
verticalCenter
;
onEdited
:
{
io
.
valRaw
=
value
;
}
Binding
on
value
{
value
:
io
.
valRaw
;
}
}
}
}
components/DelegateRawAoutTable.qml
0 → 100644
View file @
af29121c
import
QtQuick
2.1
;
import
QtQmlTricks
.
UiElements
2.0
;
import
QtQmlTricks
.
SmartDataModels
2.0
;
import
QtCAN
.
CanTestBench
2.0
;
MouseArea
{
id
:
base
;
height
:
implicitHeight
;
hoverEnabled
:
true
;
implicitHeight
:
(
layoutIoTable
.
height
+
layoutIoTable
.
anchors
.
margins
*
2
);
ExtraAnchors.horizontalFill
:
parent
;
property
AbstractIO
io
:
null
;
Rectangle
{
color
:
Style
.
colorSecondary
;
opacity
:
0.15
;
border
{
width
:
Style
.
lineSize
;
color
:
Style
.
colorBorder
;
}
anchors.fill
:
parent
;
}
Rectangle
{
color
:
Style
.
opacify
(
Style
.
colorHighlight
,
0.35
);
visible
:
base
.
containsMouse
;
anchors.fill
:
parent
;
}
StretchRowContainer
{
id
:
layoutIoTable
;
spacing
:
Style
.
spacingNormal
;
anchors.margins
:
Style
.
spacingSmall
;
anchors.verticalCenter
:
parent
.
verticalCenter
;
ExtraAnchors.horizontalFill
:
parent
;
TextLabel
{
text
:
io
.
uid
;
emphasis
:
true
;
anchors.verticalCenter
:
parent
.
verticalCenter
;
}
SvgIconLoader
{
icon
:
(
io
.
link
&&
io
.
link
.
reversed
?
"qrc:///icons/reverse.svg"
:
"qrc:///icons/normal.svg"
);
size
:
Style
.
fontSizeSmall
;
color
:
Style
.
colorForeground
;
visible
:
linkTarget
.
visible
;
anchors.verticalCenter
:
parent
.
verticalCenter
;
}
ClickableTextLabel
{
id
:
linkTarget
;
text
:
(
io
.
link
&&
io
.
link
.
target
?
io
.
link
.
target
.
uid
:
""
);
visible
:
(
text
!==
""
);
anchors.verticalCenter
:
parent
.
verticalCenter
;
onClicked
:
{
highlightActuator
=
null
;
highlightActuator
=
io
.
link
.
target
;
}
}
Stretcher
{
}
TextLabel
{
text
:
(
io
.
resolutionInPoints
+
" points"
);
color
:
Style
.
colorBorder
;
visible
:
io
.
isAnalog
;
anchors.verticalCenter
:
parent
.
verticalCenter
;
}
Stretcher
{
implicitWidth
:
(
Style
.
spacingBig
*
3
);
}
NumberBox
{
padding
:
Style
.
spacingSmall
;
visible
:
io
.
isAnalog
;
minValue
:
io
.
minRaw
;
maxValue
:
io
.
maxRaw
;
anchors.verticalCenter
:
parent
.
verticalCenter
;
onEdited
:
{
io
.
valRaw
=
value
;
}
Binding
on
value
{
value
:
io
.
valRaw
;
}
}
}
}
components/DelegateRawBoardTable.qml
0 → 100644
View file @
af29121c
import
QtQuick
2.1
;
import
QtQmlTricks
.
UiElements
2.0
;
import
QtQmlTricks
.
SmartDataModels
2.0
;
import
QtCAN
.
CanTestBench
2.0
;
ExpandableGroup
{
id
:
base
;
uidLabel
{
text
:
board
.
uid
;
emphasis
:
true
;
font.italic
:
true
;
}
titleLabel
{
text
:
board
.
title
;
font.italic
:
true
;
}
ExtraAnchors.horizontalFill
:
parent
;
property
Board
board
:
null
;
signal
needVisible
(
Item
item
);
Repeater
{
model
:
board
.
ios
;
delegate
:
InstanceCreator
{
component
:
{
switch
(
io
.
type
)
{
case
ObjectType
.
ANALOG
:
switch
(
io
.
direction
)
{
case
ObjectDirection
.
INPUT
:
return
compoDelegateRawAinTable
;
case
ObjectDirection
.
OUTPUT
:
return
compoDelegateRawAoutTable
;
}
break
;
case
ObjectType
.
DIGITAL
:
switch
(
io
.
direction
)
{
case
ObjectDirection
.
INPUT
:
return
compoDelegateRawDinTable
;
case
ObjectDirection
.
OUTPUT
:
return
compoDelegateRawDoutTable
;
}
break
;
}
return
null
;
}
properties
:
({
"io"
:
io
});
ExtraAnchors
.
horizontalFill
:
parent
;
readonly
property
AbstractIO
io
:
modelData
;
}
}
}
components/DelegateRawDinTable.qml
0 → 100644
View file @
af29121c
import
QtQuick
2.1
;
import
QtQmlTricks
.
UiElements
2.0
;
import
QtQmlTricks
.
SmartDataModels
2.0
;
import
QtCAN
.
CanTestBench
2.0
;
MouseArea
{
id
:
base
;
height
:
implicitHeight
;
hoverEnabled
:
true
;
implicitHeight
:
(
layoutIoTable
.
height
+
layoutIoTable
.
anchors
.
margins
*
2
);
ExtraAnchors.horizontalFill
:
parent
;
property
DigitalInput
io
:
null
;
Rectangle
{
color
:
Style
.
colorSecondary
;
opacity
:
0.15
;
border
{
width
:
Style
.
lineSize
;
color
:
Style
.
colorBorder
;
}
anchors.fill
:
parent
;
}
Rectangle
{
color
:
Style
.
opacify
(
Style
.
colorHighlight
,
0.35
);
visible
:
base
.
containsMouse
;
anchors.fill
:
parent
;
}
StretchRowContainer
{
id
:
layoutIoTable
;
spacing
:
Style
.
spacingNormal
;
anchors.margins
:
Style
.
spacingSmall
;
anchors.verticalCenter
:
parent
.
verticalCenter
;
ExtraAnchors.horizontalFill
:
parent
;
TextLabel
{
text
:
io
.
uid
;
emphasis
:
true
;
anchors.verticalCenter
:
parent
.
verticalCenter
;
}
SvgIconLoader
{
icon
:
(
io
.
link
&&
io
.
link
.
reversed
?
"qrc:///icons/reverse.svg"
:
"qrc:///icons/normal.svg"
);
size
:
Style
.
fontSizeSmall
;
color
:
Style
.
colorForeground
;
visible
:
linkSource
.
visible
;
anchors.verticalCenter
:
parent
.
verticalCenter
;
}
ClickableTextLabel
{
id
:
linkSource
;
text
:
(
io
.
link
&&
io
.
link
.
source
?
io
.
link
.
source
.
uid
:
""
);
visible
:
(
text
!==
""
);
anchors.verticalCenter
:
parent
.
verticalCenter
;
onClicked
:
{
highlightSensor
=
null
;
highlightSensor
=
io
.
link
.
source
;
}
}
Stretcher
{
}
CheckableBox
{
anchors.verticalCenter
:
parent
.
verticalCenter
;
onEdited
:
{
io
.
value
=
value
;
}
Binding
on
value
{
value
:
io
.
value
;
}
}
}
}
components/DelegateRawDoutTable.qml
0 → 100644
View file @
af29121c
import
QtQuick
2.1
;
import
QtQmlTricks
.
UiElements
2.0
;
import
QtQmlTricks
.
SmartDataModels
2.0
;
import
QtCAN
.
CanTestBench
2.0
;
MouseArea
{
id
:
base
;
height
:
implicitHeight
;
hoverEnabled
:
true
;
implicitHeight
:
(
layoutIoTable
.
height
+
layoutIoTable
.
anchors
.
margins
*
2
);
ExtraAnchors.horizontalFill
:
parent
;
property
DigitalOutput
io
:
null
;
Rectangle
{
color
:
Style
.
colorSecondary
;
opacity
:
0.15
;
border
{
width
:
Style
.
lineSize
;
color
:
Style
.
colorBorder
;
}
anchors.fill
:
parent
;
}
Rectangle
{
color
:
Style
.
opacify
(
Style
.
colorHighlight
,
0.35
);
visible
:
base
.
containsMouse
;
anchors.fill
:
parent
;
}
StretchRowContainer
{
id
:
layoutIoTable
;
spacing
:
Style
.
spacingNormal
;
anchors.margins
:
Style
.
spacingSmall
;
anchors.verticalCenter
:
parent
.
verticalCenter
;
ExtraAnchors.horizontalFill
:
parent
;
TextLabel
{
text
:
io
.
uid
;
emphasis
:
true
;
anchors.verticalCenter
:
parent
.
verticalCenter
;
}
SvgIconLoader
{
icon
:
(
io
.
link
&&
io
.
link
.
reversed
?
"qrc:///icons/reverse.svg"
:
"qrc:///icons/normal.svg"
);
size
:
Style
.
fontSizeSmall
;
color
:
Style
.
colorForeground
;
visible
:
linkTarget
.
visible
;
anchors.verticalCenter
:
parent
.
verticalCenter
;
}
ClickableTextLabel
{
id
:
linkTarget
;
text
:
(
io
.
link
&&
io
.
link
.
target
?
io
.
link
.
target
.
uid
:
""
);
visible
:
(
text
!==
""
);
anchors.verticalCenter
:
parent
.
verticalCenter
;
onClicked
:
{
highlightActuator
=
null
;
highlightActuator
=
io
.
link
.
target
;
}
}
Stretcher
{
}
Stretcher
{
implicitWidth
:
(
Style
.
spacingBig
*
3
);
}
CheckableBox
{
anchors.verticalCenter
:
parent
.
verticalCenter
;
onEdited
:
{
io
.
value
=
value
;
}
Binding
on
value
{
value
:
io
.
value
;
}
}
}
}
components/DelegateRawNodeTable.qml
0 → 100644
View file @
af29121c
import
QtQuick
2.1
;
import
QtQmlTricks
.
UiElements
2.0
;
import
QtQmlTricks
.
SmartDataModels
2.0
;
import
QtCAN
.
CanTestBench
2.0
;
ExpandableGroup
{
id
:
base
;
uidLabel
{
text
:
node
.
uid
;
emphasis
:
true
;
font.pixelSize
:
Style
.
fontSizeBig
;
}
titleLabel
{
text
:
node
.
title
;
font.pixelSize
:
Style
.
fontSizeBig
;
}
ExtraAnchors.horizontalFill
:
parent
;
property
Node
node
:
null
;
signal
needVisible
(
Item
item
);
Repeater
{
model
:
node
.
boards
;
delegate
:
InstanceCreator
{
component
:
compoDelegateRawBoardTable
;
properties
:
({
"board"
:
modelData
});
ExtraAnchors.horizontalFill
:
parent
;
}
}
}
components/DimensionsList.qml
View file @
af29121c
...
...
@@ -22,15 +22,17 @@ Repeater {
Repeater
{
id
:
repeaterDimensionsPhyVal
;
model
:
modelData
[
"phyValList"
];
delegate
:
DelegatePhyValTable
{
id
:
delegatePhyValTable
phyVal
:
modelData
;
ExtraAnchors.horizontalFill
:
parent
;
onNeedVisible
:
{
delegateDimensionTable
.
expanded
=
true
;
base
.
needVisible
(
item
);
delegate
:
InstanceCreator
{
visible
:
(
instance
&&
instance
[
"shouldBeVisible"
]);
component
:
DelegatePhyValTable
{
onNeedVisible
:
{
delegateDimensionTable
.
expanded
=
true
;
base
.
needVisible
(
item
);
}
onValueEdited
:
{
base
.
valueEdited
(
delegateDimensionTable
.
dimension
,
phyVal
,
value
);
}
}
onValueEdited
:
{
base
.
valueEdited
(
delegateDimensionTable
.
dimension
,
modelData
,
value
);
}
properties
:
({
"phyVal"
:
modelData
});
ExtraAnchors
.
horizontalFill
:
parent
;
}
}
}
...
...
ui_testBench.qml
View file @
af29121c
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment