Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
114 changed files
with
1,954 additions
and
3,503 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,100 +1,69 @@ | ||
class App { | ||
public control: Control; | ||
|
||
private imports: Imports; | ||
public plot: Plot; | ||
private plotBasics: PlotBasics; | ||
private fft: FFT; | ||
private precisionDac: PrecisionDac; | ||
|
||
public fftApp: FFTApp; | ||
public ddsFrequency: DDSFrequency; | ||
private temperatureSensor: TemperatureSensor; | ||
private temperatureSensorApp: TemperatureSensorApp; | ||
private powerMonitor: PowerMonitor; | ||
private powerMonitorApp: PowerMonitorApp; | ||
private clockGenerator: ClockGenerator; | ||
private clockGeneratorApp: ClockGeneratorApp; | ||
private precisionDac: PrecisionDac; | ||
private precisionAdc: PrecisionAdc; | ||
private clkGenerator: ClockGenerator; | ||
|
||
private temperatureVoltageReference: HTMLSpanElement; | ||
private temperatureBoardSpan: HTMLSpanElement; | ||
private temperatureZynqSpan: HTMLSpanElement; | ||
private supplyMainVoltageSpan: HTMLSpanElement; | ||
private supplyMainCurrentSpan: HTMLSpanElement; | ||
private supplyClockVoltageSpan: HTMLSpanElement; | ||
private supplyClockCurrentSpan: HTMLSpanElement; | ||
|
||
private precisionAdcNum: number; | ||
private precisionAdcSpans: HTMLSpanElement[]; | ||
private precisionChannelsApp: PrecisionChannelsApp; | ||
private exportFile: ExportFile; | ||
|
||
private navigation: Navigation; | ||
private n_pts: number; | ||
private x_min: number; | ||
private x_max: number; | ||
private y_min: number; | ||
private y_max: number; | ||
|
||
constructor(window: Window, document: Document, | ||
ip: string, plot_placeholder: JQuery) { | ||
let sockpoolSize: number = 10; | ||
let client = new Client(ip, sockpoolSize); | ||
|
||
this.temperatureVoltageReference = <HTMLSpanElement>document.getElementById('temperature-voltage-reference'); | ||
this.temperatureBoardSpan = <HTMLSpanElement>document.getElementById('temperature-board'); | ||
this.temperatureZynqSpan = <HTMLSpanElement>document.getElementById('temperature-zynq'); | ||
this.supplyMainVoltageSpan = <HTMLSpanElement>document.getElementById('supply-main-voltage'); | ||
this.supplyMainCurrentSpan = <HTMLSpanElement>document.getElementById('supply-main-current'); | ||
this.supplyClockVoltageSpan = <HTMLSpanElement>document.getElementById('supply-clock-voltage'); | ||
this.supplyClockCurrentSpan = <HTMLSpanElement>document.getElementById('supply-clock-current'); | ||
|
||
this.precisionAdcNum = 4; | ||
this.precisionAdcSpans = []; | ||
|
||
for (let i:number = 0; i < this.precisionAdcNum; i++) { | ||
this.precisionAdcSpans[i] = <HTMLInputElement>document.getElementById('precision-adc-' + i.toString()); | ||
} | ||
|
||
window.addEventListener('load', () => { | ||
window.addEventListener('HTMLImportsLoaded', () => { | ||
client.init( () => { | ||
this.imports = new Imports(document); | ||
this.fft = new FFT(client); | ||
this.precisionDac = new PrecisionDac(client); | ||
this.precisionAdc = new PrecisionAdc(client); | ||
this.temperatureSensor = new TemperatureSensor(client); | ||
this.powerMonitor = new PowerMonitor(client); | ||
this.precisionAdc = new PrecisionAdc(client); | ||
this.clkGenerator = new ClockGenerator(client); | ||
this.navigation = new Navigation(document); | ||
this.clockGenerator = new ClockGenerator(client); | ||
|
||
this.fft.init( () => { | ||
this.control = new Control(document, this.fft, this.precisionDac, this.clkGenerator); | ||
this.plot = new Plot(document, plot_placeholder, this.fft, this.control); | ||
this.updateTemperatures(); | ||
this.updateSupplies(); | ||
this.updatePrecisionAdcValues(); | ||
}); | ||
}); | ||
}, false); | ||
this.fftApp = new FFTApp(document, this.fft); | ||
this.ddsFrequency = new DDSFrequency(document, this.fft); | ||
|
||
window.onbeforeunload = () => { client.exit(); }; | ||
} | ||
this.n_pts = this.fft.fft_size / 2; | ||
this.x_min = 0; | ||
this.x_max = this.fft.status.fs / 1E6 / 2; | ||
this.y_min = -200; | ||
this.y_max = 170; | ||
|
||
private updateTemperatures() { | ||
this.temperatureSensor.getTemperatures((temperatures: Float32Array) => { | ||
this.temperatureVoltageReference.innerHTML = temperatures[0].toFixed(3).toString(); | ||
this.temperatureBoardSpan.innerHTML = temperatures[1].toFixed(3).toString(); | ||
this.temperatureZynqSpan.innerHTML = temperatures[2].toFixed(3).toString(); | ||
this.plotBasics = new PlotBasics(document, plot_placeholder, this.plot, this.n_pts, this.x_min, this.x_max, this.y_min, this.y_max, this.fft, "", "Frequency (MHz)"); | ||
this.plot = new Plot(document, this.fft, this.plotBasics); | ||
|
||
requestAnimationFrame( () => { this.updateTemperatures(); } ); | ||
}); | ||
} | ||
this.temperatureSensorApp = new TemperatureSensorApp(document, this.temperatureSensor); | ||
this.powerMonitorApp = new PowerMonitorApp(document, this.powerMonitor); | ||
this.clockGeneratorApp = new ClockGeneratorApp(document, this.clockGenerator); | ||
this.precisionChannelsApp = new PrecisionChannelsApp(document, this.precisionAdc, this.precisionDac); | ||
this.exportFile = new ExportFile(document, this.plot); | ||
|
||
private updateSupplies() { | ||
this.powerMonitor.getSuppliesUI((supplyValues: Float32Array) => { | ||
this.supplyMainCurrentSpan.innerHTML = (supplyValues[0] * 1E3).toFixed(1).toString(); | ||
this.supplyMainVoltageSpan.innerHTML = supplyValues[1].toFixed(3).toString(); | ||
this.supplyClockCurrentSpan.innerHTML = (supplyValues[2] * 1E3).toFixed(1).toString(); | ||
this.supplyClockVoltageSpan.innerHTML = supplyValues[3].toFixed(3).toString(); | ||
}); | ||
}); | ||
}, false); | ||
|
||
requestAnimationFrame( () => { this.updateSupplies(); }); | ||
}); | ||
window.onbeforeunload = () => { client.exit(); }; | ||
} | ||
|
||
private updatePrecisionAdcValues() { | ||
this.precisionAdc.getAdcValues((adcValues: Float32Array) => { | ||
for (let i: number = 0; i < this.precisionAdcNum; i++) { | ||
this.precisionAdcSpans[i].innerHTML = (adcValues[i] * 1000).toFixed(4).toString(); | ||
} | ||
|
||
requestAnimationFrame( () => { this.updatePrecisionAdcValues(); }); | ||
}); | ||
} | ||
} | ||
|
||
let app = new App(window, document, location.hostname, $('#plot-placeholder')); |
32 changes: 32 additions & 0 deletions
32
examples/alpha250/fft/web/clock-generator/clock-generator-app.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
class ClockGeneratorApp { | ||
|
||
private clkgenInputs: HTMLInputElement[]; | ||
|
||
constructor(document: Document, private driver) { | ||
this.clkgenInputs = <HTMLInputElement[]><any>document.getElementsByClassName("clkgen-input"); | ||
this.initClkgenInputs(); | ||
this.updateReferenceClock(); | ||
} | ||
|
||
private initClkgenInputs(): void { | ||
for (let i = 0; i < this.clkgenInputs.length; i ++) { | ||
this.clkgenInputs[i].addEventListener('change', (event) => { | ||
this.driver[(<HTMLInputElement>event.currentTarget).dataset.command](parseInt((<HTMLInputElement>event.currentTarget).value)); | ||
}) | ||
} | ||
} | ||
|
||
private updateReferenceClock() { | ||
this.driver.getReferenceClock( (clkin: number) => { | ||
|
||
let clkIndex: string = "0"; | ||
if (clkin !== 0) { | ||
clkIndex = "2"; | ||
} | ||
|
||
(<HTMLInputElement>document.querySelector("[data-command='setReferenceClock'][value='" + clkIndex + "']")).checked = true; | ||
requestAnimationFrame( () => { this.updateReferenceClock(); } ) | ||
}); | ||
} | ||
|
||
} |
File renamed without changes.
9 changes: 9 additions & 0 deletions
9
examples/alpha250/fft/web/clock-generator/reference-clock.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<template class="template"> | ||
<label for="reference-clock">Reference Clock (10 MHz):</label> | ||
<div class="radio-wrapper"> | ||
<input type="radio" name="reference-clock" value="2" checked class="clkgen-input" data-valuestr="internal" data-command="setReferenceClock">Internal | ||
</div> | ||
<div class="radio-wrapper"> | ||
<input type="radio" name="reference-clock" value="0" class="clkgen-input" data-valuestr="external" data-command="setReferenceClock">External | ||
</div> | ||
</template> |
9 changes: 9 additions & 0 deletions
9
examples/alpha250/fft/web/clock-generator/sampling-frequency.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<template class="template"> | ||
<label for="sampling-frequency">Sampling Frequency:</label> | ||
<div class="radio-wrapper"> | ||
<input type="radio" name="sampling-frequency" value="0" checked class="clkgen-input" data-command="setSamplingFrequency" data-valuestr="200">200 MHz | ||
</div> | ||
<div class="radio-wrapper"> | ||
<input type="radio" name="sampling-frequency" value="1" class="clkgen-input" data-command="setSamplingFrequency" data-valuestr="250">250 MHz | ||
</div> | ||
</template> |
Oops, something went wrong.