mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 11:22:24 +02:00
Merge pull request #13850 from samcake/punk
Adjust Workload Region to be bigger
This commit is contained in:
commit
04d72ea39d
10 changed files with 264 additions and 127 deletions
|
@ -97,7 +97,8 @@ namespace render {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GameWorkloadRenderItem::GameWorkloadRenderItem() : _key(render::ItemKey::Builder::opaqueShape().withoutShadowCaster().withTagBits(render::ItemKey::TAG_BITS_0 | render::ItemKey::TAG_BITS_1)) {
|
|
||||||
|
GameWorkloadRenderItem::GameWorkloadRenderItem() : _key(render::ItemKey::Builder::opaqueShape().withShadowCaster().withTagBits(render::ItemKey::TAG_BITS_0 | render::ItemKey::TAG_BITS_1)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
render::ItemKey GameWorkloadRenderItem::getKey() const {
|
render::ItemKey GameWorkloadRenderItem::getKey() const {
|
||||||
|
|
82
libraries/render-utils/src/WorkloadResource.slh
Normal file
82
libraries/render-utils/src/WorkloadResource.slh
Normal file
|
@ -0,0 +1,82 @@
|
||||||
|
//
|
||||||
|
// Created by Sam Gateau on 7/31/2018.
|
||||||
|
// Copyright 2018 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
<@if not WORKLOAD_RESOURCE_SLH@>
|
||||||
|
<@def WORKLOAD_RESOURCE_SLH@>
|
||||||
|
|
||||||
|
<@include gpu/Color.slh@>
|
||||||
|
<$declareColorWheel()$>
|
||||||
|
|
||||||
|
const vec4 REGION_COLOR[4] = vec4[4](
|
||||||
|
vec4(0.0, 1.0, 0.0, 1.0),
|
||||||
|
vec4(1.0, 0.6, 0.0, 1.0),
|
||||||
|
vec4(1.0, 0.0, 0.0, 1.0),
|
||||||
|
vec4(0.3, 0.0, 0.8, 1.0)
|
||||||
|
);
|
||||||
|
|
||||||
|
<@func declareWorkloadProxies() @>
|
||||||
|
|
||||||
|
struct WorkloadProxy {
|
||||||
|
vec4 sphere;
|
||||||
|
vec4 region;
|
||||||
|
};
|
||||||
|
|
||||||
|
#if defined(GPU_GL410)
|
||||||
|
layout(binding=0) uniform samplerBuffer workloadProxiesBuffer;
|
||||||
|
WorkloadProxy getWorkloadProxy(int i) {
|
||||||
|
int offset = 2 * i;
|
||||||
|
WorkloadProxy proxy;
|
||||||
|
proxy.sphere = texelFetch(workloadProxiesBuffer, offset);
|
||||||
|
proxy.region = texelFetch(workloadProxiesBuffer, offset + 1);
|
||||||
|
return proxy;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
layout(std140, binding=0) buffer workloadProxiesBuffer {
|
||||||
|
WorkloadProxy _proxies[];
|
||||||
|
};
|
||||||
|
WorkloadProxy getWorkloadProxy(int i) {
|
||||||
|
WorkloadProxy proxy = _proxies[i];
|
||||||
|
return proxy;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
<@endfunc@>
|
||||||
|
|
||||||
|
|
||||||
|
<@func declareWorkloadViews() @>
|
||||||
|
|
||||||
|
struct WorkloadView {
|
||||||
|
vec4 direction_far;
|
||||||
|
vec4 fov;
|
||||||
|
vec4 origin;
|
||||||
|
vec4 backFront[2];
|
||||||
|
vec4 regions[3];
|
||||||
|
};
|
||||||
|
|
||||||
|
#if defined(GPU_GL410)
|
||||||
|
layout(binding=1) uniform samplerBuffer workloadViewsBuffer;
|
||||||
|
WorkloadView getWorkloadView(int i) {
|
||||||
|
int offset = 2 * i;
|
||||||
|
WorkloadView view;
|
||||||
|
view.origin = texelFetch(workloadViewsBuffer, offset);
|
||||||
|
view.radiuses = texelFetch(workloadViewsBuffer, offset + 1);
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
layout(std140, binding=1) buffer workloadViewsBuffer {
|
||||||
|
WorkloadView _views[];
|
||||||
|
};
|
||||||
|
WorkloadView getWorkloadView(int i) {
|
||||||
|
WorkloadView view = _views[i];
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
<@endfunc@>
|
||||||
|
|
||||||
|
<@endif@>
|
||||||
|
|
|
@ -15,11 +15,13 @@
|
||||||
|
|
||||||
in vec4 varColor;
|
in vec4 varColor;
|
||||||
in vec3 varTexcoord;
|
in vec3 varTexcoord;
|
||||||
|
in vec3 varEyePos;
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
if (varColor.w > 0.0) {
|
if (varColor.w > 0.0) {
|
||||||
float r = sqrt(dot(varTexcoord.xyz,varTexcoord.xyz));
|
float r = sqrt(dot(varTexcoord.xyz,varTexcoord.xyz));
|
||||||
float a = paintStripe(r * varColor.w, 0.0, 1.0 / varColor.w, 0.05 / varColor.w);
|
float d = varColor.w / abs(varEyePos.z);
|
||||||
|
float a = paintStripe(r * d, 0.0, 1.0 / d, 0.002 / d);
|
||||||
if (a <= 0.1 || r > 1.1) {
|
if (a <= 0.1 || r > 1.1) {
|
||||||
discard;
|
discard;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,40 +15,13 @@
|
||||||
<@include gpu/Transform.slh@>
|
<@include gpu/Transform.slh@>
|
||||||
<$declareStandardTransform()$>
|
<$declareStandardTransform()$>
|
||||||
|
|
||||||
<@include gpu/Color.slh@>
|
<@include WorkloadResource.slh@>
|
||||||
<$declareColorWheel()$>
|
<$declareWorkloadProxies()$>
|
||||||
|
|
||||||
layout(location=0) uniform vec4 inColor;
|
|
||||||
|
|
||||||
|
|
||||||
struct WorkloadProxy {
|
|
||||||
vec4 sphere;
|
|
||||||
vec4 region;
|
|
||||||
};
|
|
||||||
|
|
||||||
#if defined(GPU_GL410)
|
|
||||||
layout(binding=0) uniform samplerBuffer workloadProxiesBuffer;
|
|
||||||
WorkloadProxy getWorkloadProxy(int i) {
|
|
||||||
int offset = 2 * i;
|
|
||||||
WorkloadProxy proxy;
|
|
||||||
proxy.sphere = texelFetch(workloadProxiesBuffer, offset);
|
|
||||||
proxy.region = texelFetch(workloadProxiesBuffer, offset + 1);
|
|
||||||
return proxy;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
layout(std140, binding=0) buffer workloadProxiesBuffer {
|
|
||||||
WorkloadProxy _proxies[];
|
|
||||||
};
|
|
||||||
WorkloadProxy getWorkloadProxy(int i) {
|
|
||||||
WorkloadProxy proxy = _proxies[i];
|
|
||||||
return proxy;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
out vec4 varColor;
|
out vec4 varColor;
|
||||||
out vec3 varTexcoord;
|
out vec3 varTexcoord;
|
||||||
|
out vec3 varEyePos;
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
const vec4 UNIT_SPRITE[3] = vec4[3](
|
const vec4 UNIT_SPRITE[3] = vec4[3](
|
||||||
|
@ -79,6 +52,7 @@ void main(void) {
|
||||||
vec3 dirY = vec3(0.0, 1.0, 0.0);
|
vec3 dirY = vec3(0.0, 1.0, 0.0);
|
||||||
|
|
||||||
vec4 pos = vec4(proxyPosEye.xyz + proxy.sphere.w * ( dirX * spriteVert.x + dirY * spriteVert.y /* + dirZ * spriteVert.z*/), 1.0);
|
vec4 pos = vec4(proxyPosEye.xyz + proxy.sphere.w * ( dirX * spriteVert.x + dirY * spriteVert.y /* + dirZ * spriteVert.z*/), 1.0);
|
||||||
|
varEyePos = pos.xyz;
|
||||||
varTexcoord = spriteVert.xyz;
|
varTexcoord = spriteVert.xyz;
|
||||||
<$transformEyeToClipPos(cam, pos, gl_Position)$>
|
<$transformEyeToClipPos(cam, pos, gl_Position)$>
|
||||||
|
|
||||||
|
@ -86,7 +60,7 @@ void main(void) {
|
||||||
int region = floatBitsToInt(proxy.region.x);
|
int region = floatBitsToInt(proxy.region.x);
|
||||||
region = (0x000000FF & region);
|
region = (0x000000FF & region);
|
||||||
|
|
||||||
varColor = vec4(colorWheel(float(region) / 4.0), proxy.sphere.w);
|
varColor = vec4(REGION_COLOR[region].xyz, proxy.sphere.w);
|
||||||
|
|
||||||
if (region == 4) {
|
if (region == 4) {
|
||||||
gl_Position = vec4(0.0);
|
gl_Position = vec4(0.0);
|
||||||
|
|
|
@ -16,11 +16,13 @@
|
||||||
|
|
||||||
in vec4 varColor;
|
in vec4 varColor;
|
||||||
in vec3 varTexcoord;
|
in vec3 varTexcoord;
|
||||||
|
in vec3 varEyePos;
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
if (varColor.w > 0.0) {
|
if (varColor.w > 0.0) {
|
||||||
float r = sqrt(dot(varTexcoord.xyz,varTexcoord.xyz));
|
float r = sqrt(dot(varTexcoord.xyz,varTexcoord.xyz));
|
||||||
float a = paintStripe(r * varColor.w, 0.0, 1.0 / varColor.w, 0.05 / varColor.w);
|
float d = varColor.w / abs(varEyePos.z);
|
||||||
|
float a = paintStripe(r * d, 0.0, 1.0 / d, 0.005 / d);
|
||||||
if (a <= 0.1 || r > 1.1) {
|
if (a <= 0.1 || r > 1.1) {
|
||||||
discard;
|
discard;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,45 +15,12 @@
|
||||||
<@include gpu/Transform.slh@>
|
<@include gpu/Transform.slh@>
|
||||||
<$declareStandardTransform()$>
|
<$declareStandardTransform()$>
|
||||||
|
|
||||||
<@include gpu/Color.slh@>
|
<@include WorkloadResource.slh@>
|
||||||
<$declareColorWheel()$>
|
<$declareWorkloadViews()$>
|
||||||
|
|
||||||
layout(location=0) uniform vec4 inColor;
|
|
||||||
|
|
||||||
|
|
||||||
struct WorkloadView {
|
|
||||||
vec4 direction_far;
|
|
||||||
vec4 fov;
|
|
||||||
vec4 origin;
|
|
||||||
vec4 backFront[2];
|
|
||||||
vec4 regions[3];
|
|
||||||
};
|
|
||||||
|
|
||||||
#if defined(GPU_GL410)
|
|
||||||
layout(binding=1) uniform samplerBuffer workloadViewsBuffer;
|
|
||||||
WorkloadView getWorkloadView(int i) {
|
|
||||||
int offset = 2 * i;
|
|
||||||
WorkloadView view;
|
|
||||||
view.origin = texelFetch(workloadViewsBuffer, offset);
|
|
||||||
//view.radiuses = texelFetch(workloadViewsBuffer, offset + 1);
|
|
||||||
return view;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
layout(std140,binding=1) buffer workloadViewsBuffer {
|
|
||||||
WorkloadView _views[];
|
|
||||||
};
|
|
||||||
WorkloadView getWorkloadView(int i) {
|
|
||||||
WorkloadView view = _views[i];
|
|
||||||
return view;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
out vec4 varColor;
|
out vec4 varColor;
|
||||||
out vec3 varTexcoord;
|
out vec3 varTexcoord;
|
||||||
|
out vec3 varEyePos;
|
||||||
|
|
||||||
const int NUM_VERTICES_PER_SEGMENT = 2;
|
const int NUM_VERTICES_PER_SEGMENT = 2;
|
||||||
const int NUM_SEGMENT_PER_VIEW_REGION = 65;
|
const int NUM_SEGMENT_PER_VIEW_REGION = 65;
|
||||||
|
@ -112,12 +79,13 @@ void main(void) {
|
||||||
<$transformModelToEyeDir(cam, obj, originSpaceTan, tanEye)$>
|
<$transformModelToEyeDir(cam, obj, originSpaceTan, tanEye)$>
|
||||||
|
|
||||||
lateralDir = normalize(cross(vec3(0.0, 0.0, 1.0), normalize(tanEye)));
|
lateralDir = normalize(cross(vec3(0.0, 0.0, 1.0), normalize(tanEye)));
|
||||||
posEye.xyz += (0.05 * (regionID + 1)) * (-1.0 + 2.0 * float(segmentVertexID)) * lateralDir;
|
posEye.xyz += (0.005 * abs(posEye.z) * (regionID + 1)) * (-1.0 + 2.0 * float(segmentVertexID)) * lateralDir;
|
||||||
|
varEyePos = posEye.xyz;
|
||||||
|
|
||||||
<$transformEyeToClipPos(cam, posEye, gl_Position)$>
|
<$transformEyeToClipPos(cam, posEye, gl_Position)$>
|
||||||
|
|
||||||
varTexcoord = spriteVert.xyz;
|
varTexcoord = spriteVert.xyz;
|
||||||
|
|
||||||
// Convert region to color
|
// Convert region to color
|
||||||
varColor = vec4(colorWheel(float(regionID) / 4.0), -1.0);
|
varColor = vec4(REGION_COLOR[regionID].xyz, -1.0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,12 +91,24 @@ void ControlViews::run(const workload::WorkloadContextPointer& runContext, const
|
||||||
regulateViews(outViews, inTimings);
|
regulateViews(outViews, inTimings);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Export the timings for debuging
|
// Export the ranges for debuging
|
||||||
|
bool doExport = false;
|
||||||
|
if (outViews.size()) {
|
||||||
|
_dataExport.ranges[workload::Region::R1] = outViews[0].regionBackFronts[workload::Region::R1];
|
||||||
|
_dataExport.ranges[workload::Region::R2] = outViews[0].regionBackFronts[workload::Region::R2];
|
||||||
|
_dataExport.ranges[workload::Region::R3] = outViews[0].regionBackFronts[workload::Region::R3];
|
||||||
|
doExport = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Export the ranges and timings for debuging
|
||||||
if (inTimings.size()) {
|
if (inTimings.size()) {
|
||||||
_dataExport.timings[workload::Region::R1] = std::chrono::duration<float, std::milli>(inTimings[0]).count();
|
_dataExport.timings[workload::Region::R1] = std::chrono::duration<float, std::milli>(inTimings[0]).count();
|
||||||
_dataExport.timings[workload::Region::R2] = _dataExport.timings[workload::Region::R1];
|
_dataExport.timings[workload::Region::R2] = _dataExport.timings[workload::Region::R1];
|
||||||
_dataExport.timings[workload::Region::R3] = std::chrono::duration<float, std::milli>(inTimings[1]).count();
|
_dataExport.timings[workload::Region::R3] = std::chrono::duration<float, std::milli>(inTimings[1]).count();
|
||||||
|
doExport = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (doExport) {
|
||||||
auto config = std::static_pointer_cast<Config>(runContext->jobConfig);
|
auto config = std::static_pointer_cast<Config>(runContext->jobConfig);
|
||||||
config->dataExport = _dataExport;
|
config->dataExport = _dataExport;
|
||||||
config->emitDirty();
|
config->emitDirty();
|
||||||
|
@ -129,11 +141,6 @@ void ControlViews::regulateViews(workload::Views& outViews, const workload::Timi
|
||||||
regionBackFronts[workload::Region::R3] = regionRegulators[workload::Region::R3].run(loopDuration, timings[1], regionBackFronts[workload::Region::R3]);
|
regionBackFronts[workload::Region::R3] = regionRegulators[workload::Region::R3].run(loopDuration, timings[1], regionBackFronts[workload::Region::R3]);
|
||||||
|
|
||||||
enforceRegionContainment();
|
enforceRegionContainment();
|
||||||
|
|
||||||
_dataExport.ranges[workload::Region::R1] = regionBackFronts[workload::Region::R1];
|
|
||||||
_dataExport.ranges[workload::Region::R2] = regionBackFronts[workload::Region::R2];
|
|
||||||
_dataExport.ranges[workload::Region::R3] = regionBackFronts[workload::Region::R3];
|
|
||||||
|
|
||||||
for (auto& outView : outViews) {
|
for (auto& outView : outViews) {
|
||||||
outView.regionBackFronts[workload::Region::R1] = regionBackFronts[workload::Region::R1];
|
outView.regionBackFronts[workload::Region::R1] = regionBackFronts[workload::Region::R1];
|
||||||
outView.regionBackFronts[workload::Region::R2] = regionBackFronts[workload::Region::R2];
|
outView.regionBackFronts[workload::Region::R2] = regionBackFronts[workload::Region::R2];
|
||||||
|
|
|
@ -32,9 +32,9 @@ namespace workload {
|
||||||
};
|
};
|
||||||
|
|
||||||
const std::vector<glm::vec2> MAX_VIEW_BACK_FRONTS = {
|
const std::vector<glm::vec2> MAX_VIEW_BACK_FRONTS = {
|
||||||
{ 100.0f, 200.0f },
|
{ 100.0f, 1600.0f },
|
||||||
{ 150.0f, 300.0f },
|
{ 150.0f, 10000.0f },
|
||||||
{ 250.0f, 500.0f }
|
{ 250.0f, 16000.0f }
|
||||||
};
|
};
|
||||||
|
|
||||||
const float RELATIVE_STEP_DOWN = 0.05f;
|
const float RELATIVE_STEP_DOWN = 0.05f;
|
||||||
|
@ -192,7 +192,7 @@ namespace workload {
|
||||||
|
|
||||||
|
|
||||||
struct Data {
|
struct Data {
|
||||||
bool regulateViewRanges{ false };
|
bool regulateViewRanges{ false }; // regulation is OFF by default
|
||||||
} data;
|
} data;
|
||||||
|
|
||||||
struct DataExport {
|
struct DataExport {
|
||||||
|
|
|
@ -16,16 +16,9 @@
|
||||||
var ICON_URL = Script.resolvePath("../../../system/assets/images/luci-i.svg");
|
var ICON_URL = Script.resolvePath("../../../system/assets/images/luci-i.svg");
|
||||||
var ACTIVE_ICON_URL = Script.resolvePath("../../../system/assets/images/luci-a.svg");
|
var ACTIVE_ICON_URL = Script.resolvePath("../../../system/assets/images/luci-a.svg");
|
||||||
|
|
||||||
|
var onTablet = false; // set this to true to use the tablet, false use a floating window
|
||||||
var onAppScreen = false;
|
|
||||||
|
|
||||||
function onClicked() {
|
var onAppScreen = false;
|
||||||
if (onAppScreen) {
|
|
||||||
tablet.gotoHomeScreen();
|
|
||||||
} else {
|
|
||||||
tablet.loadQMLSource(QMLAPP_URL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||||
var button = tablet.addButton({
|
var button = tablet.addButton({
|
||||||
|
@ -36,42 +29,90 @@
|
||||||
|
|
||||||
var hasEventBridge = false;
|
var hasEventBridge = false;
|
||||||
|
|
||||||
function wireEventBridge(on) {
|
var onScreen = false;
|
||||||
if (!tablet) {
|
var window;
|
||||||
print("Warning in wireEventBridge(): 'tablet' undefined!");
|
|
||||||
return;
|
function onClicked() {
|
||||||
}
|
if (onTablet) {
|
||||||
if (on) {
|
if (onAppScreen) {
|
||||||
if (!hasEventBridge) {
|
tablet.gotoHomeScreen();
|
||||||
tablet.fromQml.connect(fromQml);
|
} else {
|
||||||
hasEventBridge = true;
|
tablet.loadQMLSource(QMLAPP_URL);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (hasEventBridge) {
|
if (onScreen) {
|
||||||
tablet.fromQml.disconnect(fromQml);
|
killWindow()
|
||||||
hasEventBridge = false;
|
} else {
|
||||||
|
createWindow()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function createWindow() {
|
||||||
|
var qml = Script.resolvePath(QMLAPP_URL);
|
||||||
|
window = Desktop.createWindow(Script.resolvePath(QMLAPP_URL), {
|
||||||
|
title: 'Workload Inspector',
|
||||||
|
flags: Desktop.ALWAYS_ON_TOP,
|
||||||
|
presentationMode: Desktop.PresentationMode.NATIVE,
|
||||||
|
size: {x: 400, y: 600}
|
||||||
|
});
|
||||||
|
// window.setPosition(200, 50);
|
||||||
|
window.closed.connect(killWindow);
|
||||||
|
window.fromQml.connect(fromQml);
|
||||||
|
onScreen = true
|
||||||
|
button.editProperties({isActive: true});
|
||||||
|
}
|
||||||
|
|
||||||
|
function killWindow() {
|
||||||
|
if (window !== undefined) {
|
||||||
|
window.closed.disconnect(killWindow);
|
||||||
|
window.fromQml.disconnect(fromQml);
|
||||||
|
window.close()
|
||||||
|
window = undefined
|
||||||
|
}
|
||||||
|
onScreen = false
|
||||||
|
button.editProperties({isActive: false})
|
||||||
|
}
|
||||||
|
|
||||||
|
function wireEventBridge(on) {
|
||||||
|
if (onTablet) {
|
||||||
|
if (!tablet) {
|
||||||
|
print("Warning in wireEventBridge(): 'tablet' undefined!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (on) {
|
||||||
|
if (!hasEventBridge) {
|
||||||
|
tablet.fromQml.connect(fromQml);
|
||||||
|
hasEventBridge = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (hasEventBridge) {
|
||||||
|
tablet.fromQml.disconnect(fromQml);
|
||||||
|
hasEventBridge = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onScreenChanged(type, url) {
|
function onScreenChanged(type, url) {
|
||||||
if (url === QMLAPP_URL) {
|
if (onTablet) {
|
||||||
onAppScreen = true;
|
if (url === QMLAPP_URL) {
|
||||||
} else {
|
onAppScreen = true;
|
||||||
onAppScreen = false;
|
} else {
|
||||||
|
onAppScreen = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
button.editProperties({isActive: onAppScreen});
|
||||||
|
wireEventBridge(onAppScreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
button.editProperties({isActive: onAppScreen});
|
|
||||||
wireEventBridge(onAppScreen);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function fromQml(message) {
|
|
||||||
}
|
|
||||||
|
|
||||||
button.clicked.connect(onClicked);
|
button.clicked.connect(onClicked);
|
||||||
tablet.screenChanged.connect(onScreenChanged);
|
tablet.screenChanged.connect(onScreenChanged);
|
||||||
|
|
||||||
Script.scriptEnding.connect(function () {
|
Script.scriptEnding.connect(function () {
|
||||||
|
killWindow()
|
||||||
if (onAppScreen) {
|
if (onAppScreen) {
|
||||||
tablet.gotoHomeScreen();
|
tablet.gotoHomeScreen();
|
||||||
}
|
}
|
||||||
|
@ -84,6 +125,7 @@
|
||||||
Script.include("./test_physics_scene.js")
|
Script.include("./test_physics_scene.js")
|
||||||
|
|
||||||
function fromQml(message) {
|
function fromQml(message) {
|
||||||
|
print("fromQml: " + JSON.stringify(message))
|
||||||
switch (message.method) {
|
switch (message.method) {
|
||||||
case "createScene":
|
case "createScene":
|
||||||
createScene();
|
createScene();
|
||||||
|
@ -113,8 +155,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendToQml(message) {
|
function sendToQml(message) {
|
||||||
tablet.sendToQml(message);
|
if (onTablet) {
|
||||||
|
tablet.sendToQml(message);
|
||||||
|
} else {
|
||||||
|
if (window) {
|
||||||
|
window.sendToQml(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updateGridInQML()
|
updateGridInQML()
|
||||||
}());
|
}());
|
||||||
|
|
|
@ -160,9 +160,9 @@ Rectangle {
|
||||||
}
|
}
|
||||||
Repeater {
|
Repeater {
|
||||||
model: [
|
model: [
|
||||||
"r1Front:500:1.0",
|
"r1Front:16000:1.0",
|
||||||
"r2Front:500:1.0",
|
"r2Front:16000:1.0",
|
||||||
"r3Front:500:1.0"
|
"r3Front:16000:1.0"
|
||||||
]
|
]
|
||||||
ConfigSlider {
|
ConfigSlider {
|
||||||
showLabel: false
|
showLabel: false
|
||||||
|
@ -259,18 +259,71 @@ Rectangle {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
/* PlotPerf {
|
||||||
|
title: "Ranges"
|
||||||
|
height: 100
|
||||||
|
object: stats.controlViews
|
||||||
|
valueScale: 1.0
|
||||||
|
valueUnit: "m"
|
||||||
|
plots: [
|
||||||
|
{
|
||||||
|
prop: "r3RangeFront",
|
||||||
|
label: "R3 F",
|
||||||
|
color: "#FF0000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "r3RangeBack",
|
||||||
|
label: "R3 B",
|
||||||
|
color: "#EF0000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "r2RangeFront",
|
||||||
|
label: "R2 F",
|
||||||
|
color: "orange"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "r2RangeBack",
|
||||||
|
label: "R2 B",
|
||||||
|
color: "magenta"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "r1RangeFront",
|
||||||
|
label: "R1 F",
|
||||||
|
color: "#00FF00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "r1RangeBack",
|
||||||
|
label: "R1 B",
|
||||||
|
color: "#00EF00"
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}*/
|
||||||
Separator {}
|
Separator {}
|
||||||
HifiControls.Label {
|
HifiControls.Label {
|
||||||
text: "Numbers:";
|
text: "Ranges & Numbers:";
|
||||||
}
|
}
|
||||||
HifiControls.Label {
|
Repeater {
|
||||||
text: "R1= " + Workload.getConfig("regionState")["numR1"];
|
model: [
|
||||||
}
|
"green:R1:numR1:r1RangeBack:r1RangeFront",
|
||||||
HifiControls.Label {
|
"orange:R2:numR2:r2RangeBack:r2RangeFront",
|
||||||
text: "R2= " + Workload.getConfig("regionState")["numR2"];
|
"red:R3:numR3:r3RangeBack:r3RangeFront"
|
||||||
}
|
]
|
||||||
HifiControls.Label {
|
RowLayout {
|
||||||
text: "R3= " + Workload.getConfig("regionState")["numR3"];
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
HifiControls.Label {
|
||||||
|
text: modelData.split(":")[1] + " : " + Workload.getConfig("regionState")[modelData.split(":")[2]] ;
|
||||||
|
color: modelData.split(":")[0]
|
||||||
|
}
|
||||||
|
HifiControls.Label {
|
||||||
|
text: Workload.getConfig("controlViews")[modelData.split(":")[3]].toFixed(0) ;
|
||||||
|
color: modelData.split(":")[0]
|
||||||
|
}
|
||||||
|
HifiControls.Label {
|
||||||
|
text: Workload.getConfig("controlViews")[modelData.split(":")[4]].toFixed(0) ;
|
||||||
|
color: modelData.split(":")[0]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Separator {}
|
Separator {}
|
||||||
|
|
Loading…
Reference in a new issue