Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sprint-14-release #225

Merged
merged 53 commits into from
Feb 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
87236f9
implemented #151
nicolaskolbenschlag Dec 27, 2022
0296fee
requested changes #151
nicolaskolbenschlag Jan 9, 2023
2164b86
quick webgl signal head implementation
Feb 1, 2023
bd19212
Create feature-board.PNG
dev3225 Feb 1, 2023
1ed1652
Add files via upload
dev3225 Feb 1, 2023
6aa984f
Add files via upload
dev3225 Feb 1, 2023
95ef833
Add files via upload
dev3225 Feb 1, 2023
76c0f48
updated vision and mission
Feb 1, 2023
cd9b323
Merge branch 'dev' into feature/#150-update-architecture-documentation
jandegen Feb 1, 2023
b0779fc
Maybe I missspelled some names
Feb 1, 2023
d1be9e3
Merge remote-tracking branch 'origin/feature/#150-update-architecture…
Feb 1, 2023
f112a9b
added demo-video
rabbit-zero Feb 1, 2023
0691509
Merge branch 'dev' into feature/#196-signal-head-webgl
motschel123 Feb 2, 2023
4c2b522
Merge branch 'dev' into po/sprint-13
jenswaechtler Feb 2, 2023
f11d4e5
Merge pull request #209 from amosproj/po/sprint-13
jenswaechtler Feb 2, 2023
3f529d0
Merge remote-tracking branch 'origin/dev' into feature/#151-time-swee…
jenswaechtler Feb 2, 2023
31d55e0
Fix timesweep indicator
jenswaechtler Feb 2, 2023
b937528
Fix format
jenswaechtler Feb 2, 2023
140b96b
Introduce constant for time per div
jenswaechtler Feb 3, 2023
c368f3e
Updated gitignore and added logical, process and use case view diagrams
Feb 3, 2023
16e1953
Merge remote-tracking branch 'origin/dev' into feature/#150-update-ar…
Feb 3, 2023
81847cb
Added architectural diagrams, optimized import in settingspopup
Feb 3, 2023
8161a7a
Added deployment view diagram
Feb 3, 2023
d70d281
added overview diagram
Feb 3, 2023
1c37bb2
Merge branch 'dev' into feature/#196-signal-head-webgl
motschel123 Feb 3, 2023
7ee1815
Merge pull request #205 from amosproj/feature/#196-signal-head-webgl
motschel123 Feb 3, 2023
b5f7300
Merge branch 'dev' into feature/#151-time-sweep-indicator
motschel123 Feb 4, 2023
136f9bc
Naive thickness by duplicating lines with slight offset
motschel123 Feb 4, 2023
6c00984
Merge branch 'dev' into feature/#150-update-architecture-documentation
jandegen Feb 5, 2023
bad6094
Placeholder for deliverable
Feb 5, 2023
aa50d35
Merge pull request #215 from amosproj/feature/#151-time-sweep-indicator
jenswaechtler Feb 5, 2023
b9cc501
Merge branch 'dev' into feature/#150-update-architecture-documentation
PhlppKrmr Feb 5, 2023
b48acaa
Merge branch 'dev' into feature/#208-build-documentation-final-release
jandegen Feb 5, 2023
a240dd8
Introduced third line for thickness + moved computation of offset int…
PhlppKrmr Feb 5, 2023
0c3861d
Adjusted comment
PhlppKrmr Feb 5, 2023
5e7355d
Merge branch 'dev' of origin into feature/#126-refactoring-line-thick…
PhlppKrmr Feb 6, 2023
16b9e5d
Remove unused webgl-plot
PhlppKrmr Feb 6, 2023
82f3633
Merge pull request #218 from amosproj/feature/#126-refactoring-line-t…
motschel123 Feb 6, 2023
349e508
Merge branch 'dev' into feature/remove-unused-webgl-plot
motschel123 Feb 6, 2023
5de9c98
Merge pull request #221 from amosproj/feature/remove-unused-webgl-plot
PhlppKrmr Feb 6, 2023
8ba8cac
Other/#206 user documentation final release (#216)
leandertolksdorf Feb 6, 2023
7ce04bc
Add pdf file for build and deployment documentation
jenswaechtler Feb 7, 2023
0a6dcb9
Merge branch 'dev' into feature/#150-update-architecture-documentation
jenswaechtler Feb 7, 2023
628ce7a
Merge pull request #219 from amosproj/feature/#208-build-documentatio…
jenswaechtler Feb 7, 2023
b6280cd
Merge branch 'dev' into feature/#150-update-architecture-documentation
jenswaechtler Feb 7, 2023
bec13e0
Add md pdf with link to wiki with design documentation
jenswaechtler Feb 7, 2023
f0baf2f
Merge remote-tracking branch 'origin/feature/#150-update-architecture…
jenswaechtler Feb 7, 2023
04ce1d8
Sprint 14 feature board and planning document
dev3225 Feb 7, 2023
8290740
Merge pull request #223 from amosproj/po/sprint-14
jenswaechtler Feb 8, 2023
b0b3d58
Merge branch 'dev' into feature/#150-update-architecture-documentation
jenswaechtler Feb 8, 2023
abac324
Merge pull request #213 from amosproj/feature/#150-update-architectur…
jenswaechtler Feb 8, 2023
5506229
Merge pull request #224 from amosproj/dev
jenswaechtler Feb 8, 2023
08119e9
Merge branch 'main' into int
jenswaechtler Feb 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ bin/
.DS_Store


Apps/backend/target
Apps/backend/target
*.bkp
*.dtmp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ describe("everything visible on front page", () => {

it("closes popup on click outside", () => {
cy.get('[data-cy="settings-button"]').click();
cy.get('[data-cy="preset-config-open-popup"]').should("be.visible");
cy.get('[data-cy="oscilloscope"]').click();
cy.get('[data-cy="preset-config-open-popup"]').should("not.be.visible");
});
Expand Down
25 changes: 7 additions & 18 deletions Apps/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
},
"dependencies": {
"axios": "^1.2.1",
"sveltestrap": "^5.10.0",
"webgl-plot": "^0.7.0"
"sveltestrap": "^5.10.0"
}
}
131 changes: 128 additions & 3 deletions Apps/frontend/src/OscilloscopeWebGl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,26 @@ import {
channelFragmentShader,
channelVertexShader,
} from "./shader/channelShader";
import { headFragmentShader, headVertexShader } from "./shader/headShader";
import { createShaderProgram } from "./shader/shaderHelper";
import { get } from "svelte/store";
import { LINE_COLORS_WEBGL } from "./const";
import { amplitudeAdjustment, offsetAdjustment } from "./stores";
import {
LINE_COLORS_WEBGL,
LINE_THICKNESS_DELTA,
LINE_THICKNESS_DUPLICATES,
} from "./const";
import {
amplitudeAdjustment,
offsetAdjustment,
channelActivated,
thicknessAdjustment,
} from "./stores";
export class OscilloscopeWebGl {
private channelProgram: WebGLProgram;
private webgl: WebGL2RenderingContext;
private headProgram: WebGLProgram;
private channelVertexBuffer: WebGLBuffer;
private headVertexBuffer: WebGLBuffer;
private webgl: WebGL2RenderingContext;

constructor(webgl: WebGL2RenderingContext) {
this.webgl = webgl;
Expand All @@ -31,7 +43,13 @@ export class OscilloscopeWebGl {
channelVertexShader,
channelFragmentShader
);
this.headProgram = createShaderProgram(
this.webgl,
headVertexShader,
headFragmentShader
);
this.channelVertexBuffer = this.webgl.createBuffer() as WebGLBuffer;
this.headVertexBuffer = this.webgl.createBuffer() as WebGLBuffer;
}

clear() {
Expand Down Expand Up @@ -64,6 +82,7 @@ export class OscilloscopeWebGl {
);
this.webgl.enableVertexAttribArray(sampleAttribute);

// Colour
let colors = new Float32Array(LINE_COLORS_WEBGL[i]);
let colorUniform = this.webgl.getUniformLocation(
this.channelProgram,
Expand All @@ -72,13 +91,15 @@ export class OscilloscopeWebGl {

this.webgl.uniform4fv(colorUniform, colors);

// Offset
let offsetUniform = this.webgl.getUniformLocation(
this.channelProgram,
"u_offset"
);
let channelOffset = get(offsetAdjustment)[i];
this.webgl.uniform1f(offsetUniform, channelOffset);

// Amplitude
let amplitudeUniform = this.webgl.getUniformLocation(
this.channelProgram,
"u_amplitude"
Expand All @@ -87,6 +108,110 @@ export class OscilloscopeWebGl {
this.webgl.uniform1f(amplitudeUniform, channelAmplitude);

this.webgl.drawArrays(this.webgl.LINE_STRIP, 0, samples.length);

// draw three lines to make thicker line -> Thickness
if (get(thicknessAdjustment)[i]) {
// First line
let thicknessUniform = this.webgl.getUniformLocation(
this.channelProgram,
"u_thick_line_id"
);
this.webgl.uniform1i(thicknessUniform, 1);
this.webgl.drawArrays(this.webgl.LINE_STRIP, 0, samples.length);

// Second line
thicknessUniform = this.webgl.getUniformLocation(
this.channelProgram,
"u_thick_line_id"
);
this.webgl.uniform1i(thicknessUniform, 2);
this.webgl.drawArrays(this.webgl.LINE_STRIP, 0, samples.length);

// Third line -> "original" line
thicknessUniform = this.webgl.getUniformLocation(
this.channelProgram,
"u_thick_line_id"
);
this.webgl.uniform1i(thicknessUniform, 0);
this.webgl.drawArrays(this.webgl.LINE_STRIP, 0, samples.length);
}
}
}

drawHeads(xArr: number[], channelSamples: number[][]) {
this.webgl.useProgram(this.headProgram);

let headVertices = new Float32Array([
1.0, 1.0, -1.0, 1.0, 1.0, -1.0, -1.0, -1.0,
]);
this.webgl.bindBuffer(this.webgl.ARRAY_BUFFER, this.headVertexBuffer);
this.webgl.bufferData(
this.webgl.ARRAY_BUFFER,
headVertices,
this.webgl.STATIC_DRAW
);
let vertexAttribute = this.webgl.getAttribLocation(
this.headProgram,
"aVertex"
);

this.webgl.vertexAttribPointer(
vertexAttribute,
2,
this.webgl.FLOAT,
false,
0,
0
);
this.webgl.enableVertexAttribArray(vertexAttribute);

for (let i = 0; i < channelSamples.length; i++) {
let activated = get(channelActivated)[i];

if (!activated) continue;

let xCurr = xArr[i];
let xCurrUniform = this.webgl.getUniformLocation(
this.headProgram,
"u_xCurr"
);
this.webgl.uniform1f(xCurrUniform, xCurr);

let sampleCurr = channelSamples[i][xCurr];

let sampleUniform = this.webgl.getUniformLocation(
this.headProgram,
"u_sample"
);
this.webgl.uniform1f(sampleUniform, sampleCurr);

let color = new Float32Array(LINE_COLORS_WEBGL[i]);
let colorUniform = this.webgl.getUniformLocation(
this.headProgram,
"u_colour"
);

this.webgl.uniform4fv(colorUniform, color);

let offsetUniform = this.webgl.getUniformLocation(
this.headProgram,
"u_offset"
);
let channelOffset = get(offsetAdjustment)[i];
this.webgl.uniform1f(offsetUniform, channelOffset);

let amplitudeUniform = this.webgl.getUniformLocation(
this.headProgram,
"u_amplitude"
);
let channelAmplitude = get(amplitudeAdjustment)[i];
this.webgl.uniform1f(amplitudeUniform, channelAmplitude);

this.webgl.drawArrays(
this.webgl.TRIANGLE_STRIP,
0,
headVertices.length / 2
);
}
}
}
13 changes: 6 additions & 7 deletions Apps/frontend/src/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,12 @@ nav {

.wrapper {
display: grid;
grid-template-columns: 8vmax calc(16vw - 2em) calc(
100vw - 2 * (8vmax + 16vw - 2em)
) calc(16vw - 2em) 8vmax;
grid-template-rows: calc(1 / 2 * (8vmax)) calc(
1 / 2 * (100vw - 2 * (8vmax + 16vw - 2em))
) calc(100vh - 1 / 2 * (8vmax + 100vw - 2 * (8vmax + 16vw - 2em)));
grid-template-columns:
8vmax calc(16vw - 2em) calc(100vw - 2 * (8vmax + 16vw - 2em))
calc(16vw - 2em) 8vmax;
grid-template-rows:
calc(1 / 2 * (8vmax)) calc(1 / 2 * (100vw - 2 * (8vmax + 16vw - 2em)))
calc(100vh - 1 / 2 * (8vmax + 100vw - 2 * (8vmax + 16vw - 2em)));
width: 100%;
height: 100%;
}
Expand Down Expand Up @@ -224,7 +224,6 @@ nav {

&--waves {
position: absolute;
margin-top: 0.1vw;
margin-left: 0.1vw;
inset: 0;
}
Expand Down
4 changes: 3 additions & 1 deletion Apps/frontend/src/components/GNDButton.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@
}}
data-cy="gnd-button"
/>
<Tooltip target={button} placement="bottom" data-cy="gnd-button-tooltip">{TOOLTIP_BUTTON_GND}</Tooltip>
<Tooltip target={button} placement="bottom" data-cy="gnd-button-tooltip"
>{TOOLTIP_BUTTON_GND}</Tooltip
>
28 changes: 8 additions & 20 deletions Apps/frontend/src/components/Waves.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,9 @@
NUM_CHANNELS,
WAVE_CURSOR_SIZE,
} from "../const";
import {
channelActivated,
thicknessAdjustment,
timeSweep,
} from "../stores";
import {
OscilloscopeWebGl
} from "../OscilloscopeWebGl"
import { channelActivated, timeSweep } from "../stores";
import { OscilloscopeWebGl } from "../OscilloscopeWebGl";
import { computeDisplayDeltaFromTimeSweep } from "../helper";

export let scalesY;

let canvasElement;
let oscilloscopeWebGl;
/**
Expand Down Expand Up @@ -81,12 +72,9 @@
}
};

thicknessAdjustment.subscribe((isThick) => {
// thick lines not implemented
});

const update = () => {
oscilloscopeWebGl.drawChannels(channelSamples);
oscilloscopeWebGl.drawHeads(xLast, channelSamples);
};

const resizeCanvas = () => {
Expand All @@ -98,11 +86,11 @@
let webgl = canvasElement.getContext("webgl2");

if (webgl === null) {
alert(
"Unable to initialize WebGL. Your browser or machine may not support it."
);
return;
}
alert(
"Unable to initialize WebGL. Your browser or machine may not support it."
);
return;
}

oscilloscopeWebGl = new OscilloscopeWebGl(webgl);
};
Expand Down
11 changes: 5 additions & 6 deletions Apps/frontend/src/const.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ export const LINE_COLORS_RGBA = LINE_COLORS.map(rgbArrayToRGBAString);
export const LINE_COLORS_WEBGL = LINE_COLORS.map((color) =>
color.map((num) => num / 255).concat([1])
);
export const LINE_THICKNESS_SMALL = 0.002;
export const LINE_THICKNESS_BIG = 0.008;

export const NUM_CHANNELS = 10;
export const MIN_SWEEP = 0.1; // <= 1
export const MAX_SWEEP = 2.0; // >= 1
Expand All @@ -39,6 +36,7 @@ export const DEFAULT_STEP_SIZE = 1.0;
export const MIN_AMPLITUDE = 0.0;
export const MAX_AMPLITUDE = NUM_INTERVALS_HORIZONTAL / 2;
export const WAVE_CURSOR_SIZE = 50;
export const HEAD_WIDTH_PIXEL = 3;

export const MIN_CONTROL_PANEL_BOTTOM_HEIGHT = 304; //px

Expand All @@ -54,7 +52,8 @@ export const REST_ENDPOINT_CONFIG = `${BACKEND_API_URL}/config`;

/* DISPLAY SPEED */
const EXPECTED_UPDATES_PER_SECOND = 10_000;
const TIME_PER_UPDATE = 1 / EXPECTED_UPDATES_PER_SECOND;
const PIXELS_PER_DIV = CANVAS_WIDTH / NUM_INTERVALS_VERTICAL;
export const TIME_PER_DIV = PIXELS_PER_DIV * TIME_PER_UPDATE;
// Change this after functionality for measuring actual updates per second is implemented
const REAL_UPDATES_PER_SECOND = EXPECTED_UPDATES_PER_SECOND;
export const TIME_PER_DIV =
EXPECTED_UPDATES_PER_SECOND / REAL_UPDATES_PER_SECOND;
/* END DISPLAY SPEED */
5 changes: 3 additions & 2 deletions Apps/frontend/src/helper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
TEXT_INDICATORS_DECIMAL_PLACES, DEFAULT_STEP_SIZE,
TEXT_INDICATORS_DECIMAL_PLACES,
DEFAULT_STEP_SIZE,
MIN_SWEEP,
MAX_SWEEP,
} from "./const";
Expand Down Expand Up @@ -107,4 +108,4 @@ export function computeDisplayDeltaFromTimeSweep(sliderValue) {
DEFAULT_STEP_SIZE *
(1.0 + timeSweep * (timeSweep >= 0.0 ? MAX_SWEEP - 1.0 : 1.0 - MIN_SWEEP));
return delta;
}
}
Loading