Commit f3b04f4d authored by Tomi Korpipää's avatar Tomi Korpipää

Update Kria Cluster to Studio API 1.1

parent bc4a878b
......@@ -43,8 +43,6 @@
<file>presentation/Gaugesvol1/maps/carInterior.hdr</file>
<file>presentation/Gaugesvol1/maps/environment.hdr</file>
<file>presentation/Gaugesvol1/maps/environment.jpg</file>
<file>presentation/Gaugesvol1/maps/speed_new.jpg</file>
<file>presentation/Gaugesvol1/maps/tacho_new.jpg</file>
<file>presentation/Tachoneedle_001/meshes/tachoNeedle.mesh</file>
<file>presentation/Tachoneedle_001/Tachoneedle.import</file>
<file>presentation/VignetteEffect.effect</file>
......
......@@ -8,8 +8,8 @@
<Scene id="Scene" >
<Layer id="Layer" >
<Camera id="Camera" />
<Text id="speed" />
<Text id="kmh" />
<Text id="speed" controlledproperty="speedText textstring" />
<Text id="kmh" controlledproperty="speedUnitSlide textstring" />
</Layer>
</Scene>
</Graph>
......@@ -18,8 +18,8 @@
<Add ref="#Layer" />
<Add ref="#Camera" orthographic="True" />
<State id="Scene-Slide1" name="Slide1" >
<Add ref="#speed" name="speed" font="TitilliumWeb-Regular" position="0 40 0" size="60" textstring="0" />
<Add ref="#kmh" name="kmh" font="TitilliumWeb-Regular" position="0 -40 0" size="20" textstring="kph" />
<Add ref="#speed" name="speed" font="TitilliumWeb-Regular" position="0 40 0" size="90" textstring="0" />
<Add ref="#kmh" name="kmh" font="TitilliumWeb-Regular" position="0 -40 0" size="30" textstring="kph" />
</State>
</State>
</Logic>
......
......@@ -9,7 +9,7 @@
<Layer id="Layer" >
<Camera id="Camera" />
<Text id="rpm" />
<Text id="tacho" />
<Text id="tacho" controlledproperty="tachoText textstring" />
</Layer>
</Scene>
</Graph>
......@@ -18,8 +18,8 @@
<Add ref="#Layer" />
<Add ref="#Camera" orthographic="True" />
<State id="Scene-Slide1" name="Slide1" >
<Add ref="#rpm" name="rpm" font="TitilliumWeb-Regular" position="0 -40 0" rotation="0 0 0" size="20" textstring="rpm x 1000" />
<Add ref="#tacho" name="tacho" font="TitilliumWeb-Regular" position="0 40 0" size="60" textstring="0.0" />
<Add ref="#rpm" name="rpm" font="TitilliumWeb-Regular" position="0 -40 0" rotation="0 0 0" size="30" textstring="rpm x 1000" />
<Add ref="#tacho" name="tacho" font="TitilliumWeb-Regular" opacity="99" position="0 40 0" size="90" textstring="0.0" />
</State>
</State>
</Logic>
......
......@@ -8,6 +8,14 @@
<presentation id="SpeedBackground" src="speedBackground.uip"/>
<presentation id="TachoBackground" src="tachoBackground.uip"/>
<presentation-qml id="navigationStream" args="../qml/Navigation.qml"/>
<dataInput name="mainSlide" type="String"/>
<dataInput name="carSlide" type="String"/>
<dataInput name="colorSlide" type="String"/>
<dataInput name="speedUnitSlide" type="String"/>
<dataInput name="tacho" type="Ranged Number" min="0" max="7000"/>
<dataInput name="speed" type="Ranged Number" min="0" max="260"/>
<dataInput name="speedText" type="String"/>
<dataInput name="tachoText" type="String"/>
</assets>
<statemachine ref="#logic">
<visual-states>
......
......@@ -11,7 +11,7 @@
<Effect id="VignetteEffect" name="VignetteEffect" sourcepath=".\VignetteEffect.effect" />
</Classes>
<Graph >
<Scene id="Scene" backgroundcolor="0 0 0" >
<Scene id="Scene" backgroundcolor="0 0 0" controlledproperty="mainSlide @slide" >
<Layer id="2DLayer" >
<Camera id="Camera_001" />
<Model id="line" >
......@@ -132,7 +132,7 @@
</Add>
<Add ref="#tachomat" bumpamount="1" diffusemap="#tachomat_diffusemap" emissivecolor="0 0 0" fresnelPower="1" importfile=".\Gaugesvol1\Gaugesvol1.import" shaderlighting="Pixel" specularamount="0.2" specularmodel="Default" specularroughness="0.001" speculartint="0.0627451 0.0627451 0.0627451" />
<Add ref="#tachomat_diffusemap" sourcepath="Gaugesvol1/maps/tacho_new.jpg" subpresentation="TachoBackground" />
<Add ref="#tachoNeedle" name="tachoNeedle" endtime="1000" opacity="100" position="0 1 0" >
<Add ref="#tachoNeedle" name="tachoNeedle" controlledproperty="tacho @timeline" endtime="1000" opacity="100" position="0 1 0" >
<AnimationTrack property="opacity" type="EaseInOut" >0 100 0 0</AnimationTrack>
</Add>
<Add ref="#centerTacho" endtime="1000" importfile=".\Gaugesvol1\Gaugesvol1.import" position="0 1 -0" rotation="0 -0 0" sourcepath="center_new8_003/meshes/centerTacho.mesh" >
......@@ -206,7 +206,7 @@
<AnimationTrack property="scale.z" type="EaseInOut" >0 1 0 0</AnimationTrack>
</Add>
<Add ref="#lambert8_001" name="lambert8" endtime="1000" referencedmaterial="#lambert8" />
<Add ref="#speedNeedle" name="speedNeedle" endtime="1000" opacity="100" position="0 1 0" scale="1 1 1" >
<Add ref="#speedNeedle" name="speedNeedle" controlledproperty="speed @timeline" endtime="1000" opacity="100" position="0 1 0" scale="1 1 1" >
<AnimationTrack property="opacity" type="EaseInOut" >0 100 0 0</AnimationTrack>
<AnimationTrack property="scale.x" type="EaseInOut" >0 1 0 0</AnimationTrack>
<AnimationTrack property="scale.y" type="EaseInOut" >0 1 0 0</AnimationTrack>
......@@ -231,7 +231,7 @@
<Add ref="#Light_002" name="Light" brightness="250" castshadow="True" endtime="1000" expfade="0" lightambient="0.427451 0.427451 0.427451" lightdiffuse="0.901961 0.901961 0.901961" lightspecular="0.113725 0.109804 0.14902" lighttype="Point" linearfade="9.25926" position="0 48 -110" scale="4 1 1" shdwbias="0.032" shdwfactor="79.8333" shdwfilter="4.66667" shdwmapfar="1500" shdwmapres="10" />
<Add ref="#Map" name="Content_Layer" height="70" left="15" top="17" width="72" />
<Add ref="#Camera_002" orthographic="True" />
<Add ref="#Car" name="Car" />
<Add ref="#Car" name="Car" controlledproperty="carSlide @slide" />
<Add ref="#map" name="Navigation" opacity="100" scale="25.9751 9.54456 1" sourcepath="#Rectangle" >
<AnimationTrack property="opacity" type="EaseInOut" >0 100 0 0</AnimationTrack>
</Add>
......
......@@ -9,7 +9,7 @@
<ImageBuffer sourcepath="Gaugesvol1/maps/gaugespeed_mph.png" hasTransparency="True" />
</BufferData>
<Graph >
<Scene id="Scene" >
<Scene id="Scene" controlledproperty="speedUnitSlide @slide" >
<Layer id="Layer" >
<Camera id="Camera" />
<Model id="speed_mph_new" >
......@@ -46,8 +46,8 @@
</Add>
<Add ref="#Material_001" diffusemap="#Material_001_diffusemap" shaderlighting="None" />
<Add ref="#Material_001_diffusemap" sourcepath="Gaugesvol1/maps/gaugespeed_kph.png" />
<Add ref="#gaugespeed_background" name="gaugespeed_background" />
<State id="Scene-Kph" name="Kph" playmode="Stop at end" >
<Add ref="#gaugespeed_background" name="gaugespeed_background" controlledproperty="colorSlide @slide" />
<State id="Scene-kph" name="kph" playmode="Stop at end" >
<Set ref="#Layer" endtime="1000" />
<Set ref="#Camera" endtime="1000" />
<Set ref="#speed_mph_new" endtime="1000" opacity="100" >
......@@ -58,7 +58,7 @@
</Set>
<Set ref="#gaugespeed_background" endtime="1000" />
</State>
<State id="Scene-Mph" name="Mph" initialplaystate="Play" playmode="Stop at end" playthroughto="#Scene-Kph" >
<State id="Scene-mph" name="mph" initialplaystate="Play" playmode="Stop at end" playthroughto="#Scene-kph" >
<Set ref="#Layer" endtime="1000" />
<Set ref="#Camera" endtime="1000" />
<Set ref="#speed_mph_new" endtime="1000" opacity="100" >
......
......@@ -35,7 +35,7 @@
</Add>
<Add ref="#Material" diffusemap="#Material_diffusemap" shaderlighting="None" />
<Add ref="#Material_diffusemap" sourcepath="Gaugesvol1/maps/gaugetacho.png" />
<Add ref="#gaugespeed_background" name="gaugetacho_background" />
<Add ref="#gaugespeed_background" name="gaugetacho_background" controlledproperty="colorSlide @slide" />
<State id="Scene-Tacho" name="Tacho" playmode="Stop at end" >
<Set ref="#Layer" endtime="1000" />
<Set ref="#Camera" endtime="1000" />
......
......@@ -53,6 +53,7 @@ import QtQuick 2.9
Item {
id: simulation
property real speed: 0
property real rpm: (speed / .0371)
property int turnSignal: Qt.NoArrow
......
......@@ -49,7 +49,7 @@
****************************************************************************/
import QtQuick 2.9
import QtStudio3D 1.0
import QtStudio3D 1.1
import QtQuick.Controls 2.1
Item {
......@@ -83,7 +83,7 @@ Item {
Studio3D {
id: studio3D
width: parent.width
height: parent.height //width * 0.375 // based on the aspect ratio of the presentation
height: parent.height
anchors.verticalCenter: parent.verticalCenter
ViewerSettings {
......@@ -99,54 +99,49 @@ Item {
startupAnimation = false;
}
SceneElement {
DataInput {
id: mainScene
elementPath: "Scene"
name: "mainSlide"
}
SceneElement {
DataInput {
id: carScene
elementPath: "Scene.Content_Layer.Car"
name: "carSlide"
}
Element {
id: speedScene
elementPath: "digitalSpeed:Scene.Layer.speed"
DataInput {
id: tachometerNeedle
name: "tacho"
}
Element {
id: tachoScene
elementPath: "digitalTacho:Scene.Layer.tacho"
DataInput {
id: tachometerText
name: "tachoText"
}
SceneElement {
DataInput {
id: speedometerNeedle
elementPath: "Scene.Gauges_Layer.Gauges.Group_Speed.speedNeedle"
name: "speed"
}
SceneElement {
id: tachometerNeedle
elementPath: "Scene.Gauges_Layer.Gauges.Group_Tacho.tachoNeedle"
DataInput {
id: speedometerText
name: "speedText"
}
Element {
id: carBodyMaterial
elementPath: "contentPresentation:Scene.Layer.Car.Car.body.lambert2"
DataInput {
id: displayColor
name: "colorSlide"
}
SceneElement {
DataInput {
id: speedometerUnit
elementPath: "SpeedBackground:Scene"
}
SceneElement {
id: speedometerColor
elementPath: "SpeedBackground:Scene.SpeedTextures.gaugespeed_background"
name: "speedUnitSlide"
}
SceneElement {
id: tachometerColor
elementPath: "TachoBackground:Scene.TachoTextures.gaugetacho_background"
Element {
id: carBodyMaterial
elementPath: "contentPresentation:Scene.Layer.Car.Car.body.lambert2"
}
SubPresentationSettings {
......@@ -189,23 +184,20 @@ Item {
carBodyMaterial.setAttribute("diffuse.r", 0.855);
carBodyMaterial.setAttribute("diffuse.g", 0.14);
carBodyMaterial.setAttribute("diffuse.b", 0.144);
speedometerColor.goToSlide("Scene", "red")
tachometerColor.goToSlide("Scene", "red")
displayColor.setValue("red");
} else {
carBodyMaterial.setAttribute("diffuse.r", 0.08);
carBodyMaterial.setAttribute("diffuse.g", 0.08);
carBodyMaterial.setAttribute("diffuse.b", 1.0);
speedometerColor.goToSlide("Scene", "blue")
tachometerColor.goToSlide("Scene", "blue")
displayColor.setValue("blue");
}
}
onUseMetricChanged: {
console.log("onUseMetricChanged: " + useMetric);
if (useMetric)
speedometerUnit.goToSlide("Scene", "Kph");
speedometerUnit.setValue("kph");
else
speedometerUnit.goToSlide("Scene", "Mph");
speedometerUnit.setValue("mph");
}
Keys.onRightPressed: {
......@@ -238,10 +230,13 @@ Item {
// Connect speed
onSpeedChanged: {
speedometerNeedle.goToTime(speed / 26.);
speedScene.setAttribute("textstring", speed.toFixed(0));
tachometerNeedle.goToTime(speed / 26.);
tachoScene.setAttribute("textstring", (speed / 37.1).toFixed(1));
speedometerNeedle.setValue(speed);
if (useMetric)
speedometerText.setValue(speed.toFixed(0));
else
speedometerText.setValue((speed / 1.6).toFixed(0));
tachometerNeedle.setValue(rpm);
tachometerText.setValue((rpm / 1000.0).toFixed(1));
}
}
......@@ -284,11 +279,11 @@ Item {
if (previousContentIndex === 2) { // from Navigation
allowSelection = false;
selectionTimer.start();
cluster.goToSlide("Scene", "ToBase");
mainScene.setValue("ToBase");
} else if (previousContentIndex === 5) { // from Car
allowSelection = false;
selectionTimer.start();
carScene.goToSlide("Scene", "FadeOut");
carScene.setValue("FadeOut");
}
switch (index) {
......@@ -299,7 +294,7 @@ Item {
allowSelection = false;
selectionTimer.start();
content.source = "";
cluster.goToSlide("Scene", "ToNavigation");
mainScene.setValue("ToNavigation");
contentStream.source = "qrc:/Navigation.qml";
contentStream.active = true;
break;
......@@ -313,7 +308,7 @@ Item {
allowSelection = false;
selectionTimer.start();
content.source = "";
carScene.goToSlide("Scene", "FadeIn");
carScene.setValue("FadeIn");
break;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment