Skip to content

Commit

Permalink
SDRplay RSP1
Browse files Browse the repository at this point in the history
  • Loading branch information
f4exb committed Jan 17, 2019
1 parent cf8df2b commit 4756be9
Show file tree
Hide file tree
Showing 9 changed files with 767 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/app/device-details/device-details-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { XtrxInputComponent } from './xtrx-input/xtrx-input.component';
import { XtrxOutputComponent } from './xtrx-output/xtrx-output.component';
import { Bladerf1OutputComponent } from './bladerf1-output/bladerf1-output.component';
import { Bladerf2OutputComponent } from './bladerf2-output/bladerf2-output.component';
import { SdrplayComponent } from './sdrplay/sdrplay.component';

export const routes: Routes = [
{
Expand Down Expand Up @@ -91,6 +92,10 @@ export const routes: Routes = [
path: 'rtlsdr',
component: RtlsdrComponent
},
{
path: 'sdrplay1',
component: SdrplayComponent
},
{
path: 'testsource',
component: TestsourceComponent
Expand Down
2 changes: 2 additions & 0 deletions src/app/device-details/device-details.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ export class DeviceDetailsComponent implements OnInit {
}
} else if (deviceSet.samplingDevice.hwType === 'RTLSDR') {
this.router.navigate(['rtlsdr'], { relativeTo: this.route});
} else if (deviceSet.samplingDevice.hwType === 'SDRplay1') {
this.router.navigate(['sdrplay1'], { relativeTo: this.route});
} else if (deviceSet.samplingDevice.hwType === 'TestSource') {
this.router.navigate(['testsource'], { relativeTo: this.route});
} else if (deviceSet.samplingDevice.hwType === 'XTRX') {
Expand Down
4 changes: 3 additions & 1 deletion src/app/device-details/device-details.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { XtrxInputComponent } from './xtrx-input/xtrx-input.component';
import { XtrxOutputComponent } from './xtrx-output/xtrx-output.component';
import { Bladerf1OutputComponent } from './bladerf1-output/bladerf1-output.component';
import { Bladerf2OutputComponent } from './bladerf2-output/bladerf2-output.component';
import { SdrplayComponent } from './sdrplay/sdrplay.component';

@NgModule({
imports: [
Expand Down Expand Up @@ -59,7 +60,8 @@ import { Bladerf2OutputComponent } from './bladerf2-output/bladerf2-output.compo
XtrxInputComponent,
XtrxOutputComponent,
Bladerf1OutputComponent,
Bladerf2OutputComponent
Bladerf2OutputComponent,
SdrplayComponent
]
})
export class DeviceDetailsModule { }
3 changes: 3 additions & 0 deletions src/app/device-details/device-details.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { XTRXInputSettings, XTRXInputReport } from './xtrx-input/xtrx-input';
import { XTRXOutputReport, XTRXOutputSettings } from './xtrx-output/xtrx-output';
import { BladeRF1OutputSettings } from './bladerf1-output/bladerf1-output';
import { BladeRF2OutputSettings } from './bladerf2-output/bladerf2-output';
import { SDRplaySettings } from './sdrplay/sdrplay';

export interface DeviceSettings {
deviceHwType: string;
Expand All @@ -37,6 +38,7 @@ export interface DeviceSettings {
plutoSdrInputSettings?: PlutoSDRInputSettings;
plutoSdrOutputSettings?: PlutoSDROutputSettings;
rtlSdrSettings?: RTLSDRSettings;
sdrPlaySettings?: SDRplaySettings;
testSourceSettings?: TestSourceSettings;
xtrxInputSettings?: XTRXInputSettings;
xtrxOutputSettings?: XTRXOutputSettings;
Expand All @@ -53,6 +55,7 @@ export interface DeviceReport {
plutoSdrInputReport?: PlutoSDRInputReport;
plutoSdrOutputReport?: PlutoSDROutputReport;
rtlSdrReport?: any;
sdrPlayReport?: any;
xtrxInputReport?: XTRXInputReport;
xtrxOutputReport?: XTRXOutputReport;
}
112 changes: 112 additions & 0 deletions src/app/device-details/sdrplay/sdrplay.component.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
.device-card {
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
border: outset;
border-color: whitesmoke;
border-width: 2px;
margin-bottom: 5px;
padding: 0.2em 0.2em 0.2em 0.2em;
}

.device-card-header {
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
border: solid;
border-color: gray;
border-width: 1px;
margin-bottom: 5px;
padding: 0.2em 0.2em 0.2em 0.2em;
}

.device-header-rx {
background-color: rgb(170,255,200);
}

.device-label {
margin-top: 5px;
}

.button-card {
padding-top: 0px;
padding-right: 0px;
padding-bottom: 0px;
padding-left: 0px;
width: 22px;
height: 22px;
}

.frequency-input {
width: 8ch;
margin: 1px;
}

.xfrequency-input {
width: 12ch;
}

.sample-rate-input {
width: 9ch;
}

.log2-input {
width: 4ch;
}

.record-file-input {
width: 29ch;
margin: 1px;
}

.gain-input {
width: 6ch;
}

.loppm-input {
width: 6ch;
}

.rfbandwidth-input {
width: 6ch;
}

.address-input {
width: 15ch;
}

.port-input {
width: 7ch;
}

td {
background-color: rgb(230, 230, 210);
}

.status-ok-card {
border: outset;
border-color: rgb(134, 255, 110);
border-width: 2px;
margin-bottom: 5px;
padding: 0.2em 0.2em 0.2em 0.2em;
}

.status-ko-card {
border: solid;
border-color: rgb(255, 134, 110);
border-width: 2px;
padding: 0.2em 0.2em 0.2em 0.2em;
}

::ng-deep .mat-card {
/* CSS styles go here */
padding: 0px; /* for example to remove the margin */
}

::ng-deep .mat-checkbox-inner-container {
height: 14px!important;
width: 14px!important;
background-color: white;
}

::ng-deep .mat-checkbox-label {
line-height: 16px!important;
}
207 changes: 207 additions & 0 deletions src/app/device-details/sdrplay/sdrplay.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
<mat-card class="deviceset-card">
<mat-card-header class="device-card-header device-header-rx">
<button mat-button class="button-card" (click)="getDeviceSettings()" matTooltip="Refresh">
<img src="./assets/icons/if_refresh.svg" style="height:16px; width:16px"/>
</button>&nbsp;
<span class="device-label">SDRplay RSP1 {{getSampleRate()/1000}} kS/s</span>
</mat-card-header>
<mat-card-content>
<table>
<!-- Center frequency -->
<tr>
<td colspan="3">
<app-frequency-dial
[frequency]="centerFreqKhz"
[min]="getMinFrequency()"
[max]="getMaxFrequency()"
tooltip="Center frequency"
[steps]="frequencySteps"
(frequencyChanged)="onFrequencyUpdate($event)">
</app-frequency-dial>
</td>
</tr>
<!-- LO correction, DC correction, IQ correction -->
<tr>
<td>
LO
<input type="number" class="loppm-input"
[(ngModel)]="loPPM"
(change)="setLoPPM()"
matTooltip="LO correction"
min=-20 max=20 step=0.1>
ppm
</td>
<td>
<mat-checkbox color="primary" [(ngModel)]="dcBlock" (change)="setDCBlock()" matTooltip="DC correction">
DC block
</mat-checkbox>
</td>
<td>
<mat-checkbox color="primary" [(ngModel)]="iqCorrection" (change)="setIQCorrection()" matTooltip="IQ correction">
IQ corr
</mat-checkbox>
</td>
</tr>
<!-- Band, Bandwidth, IF -->
<tr>
<td>
Band
<mat-select style="width:12ch; background-color: white; margin: 1px;"
[(value)]="settings.frequencyBandIndex"
(selectionChange)="setBandIndex()"
matTooltip="Frequency band">
<mat-option *ngFor="let frequencyBandName of frequencyBandNames" [value]="frequencyBandName.value">
{{frequencyBandName.viewValue}}
</mat-option>
</mat-select>
S/s
</td>
<td>
BW
<mat-select style="width:8ch; background-color: white; margin: 1px;"
[(value)]="settings.bandwidthIndex"
(selectionChange)="setBandwidthIndex()"
matTooltip="RF Bandwidth">
<mat-option *ngFor="let bandwidth of bandwidths" [value]="bandwidth.value">
{{bandwidth.viewValue}}
</mat-option>
</mat-select>
kHz
</td>
<td>
IF
<mat-select style="width:8ch; background-color: white; margin: 1px;"
[(value)]="settings.ifFrequencyIndex"
(selectionChange)="setIntermediateFrequencyIndex()"
matTooltip="IF Bandwidth">
<mat-option *ngFor="let intermediateFrequency of intermediateFrequencies" [value]="intermediateFrequency.value">
{{intermediateFrequency.viewValue}}
</mat-option>
</mat-select>
kHz
</td>
</tr>
<!-- Sample rate, Decimation, Fc position -->
<tr>
<td>
SR
<mat-select style="width:8ch; background-color: white; margin: 1px;"
[(value)]="settings.devSampleRateIndex"
(selectionChange)="setSampleRateIndex()"
matTooltip="Sample rate">
<mat-option *ngFor="let sampleRate of sampleRates" [value]="sampleRate.value">
{{sampleRate.viewValue/1000}}
</mat-option>
</mat-select>
kS/s
</td>
<td>
Decim
<mat-select style="width:6ch; background-color: white; margin: 1px;"
[(value)]="settings.log2Decim"
(selectionChange)="setLog2Decim()"
matTooltip="Decimation factor">
<mat-option *ngFor="let log2Decim of log2Decims" [value]="log2Decim.value">
{{log2Decim.viewValue}}
</mat-option>
</mat-select>
</td>
<td>
Fc pos
<mat-select style="width:8ch; background-color: white; margin: 1px;"
[(value)]="settings.fcPos"
(selectionChange)="setFcPos()"
matTooltip="Center frequency position">
<mat-option *ngFor="let fcPos of fcPositions" [value]="fcPos.value">
{{fcPos.viewValue}}
</mat-option>
</mat-select>
</td>
</tr>
<!-- Tuner gain mode, Tuner gain, -->
<tr>
<td>
<mat-checkbox color="primary" [(ngModel)]="tunerGainMode" (change)="setAutoGain()" matTooltip="Automatic gain setting">
Auto gain
</mat-checkbox>
</td>
<td>
Gain
<input type="number" class="gain-input"
[(ngModel)]="settings.tunerGain"
(change)="setTunerGain()"
matTooltip="Global tuner gain"
min=0 max=102
>
units
</td>
<td></td>
</tr>
<!-- LNA on/off, Mixer amp on/off, Baseband gain -->
<tr>
<td>
<mat-checkbox color="primary" [(ngModel)]="lnaOn" (change)="setLNA()" matTooltip="LNA on/off">
LNA
</mat-checkbox>
</td>
<td>
<mat-checkbox color="primary" [(ngModel)]="mixerAmpOn" (change)="setMixer()" matTooltip="Mixer amp on/off">
Mixer amp
</mat-checkbox>
</td>
<td>
BB Gain
<input type="number" class="gain-input"
[(ngModel)]="settings.basebandGain"
(change)="setBasebandGain()"
matTooltip="Baseband gain"
min=0 max=59
>
dB
</td>
</tr>
<!--- Use reverse API, reverse API device index, -->
<tr>
<td>
<mat-checkbox color="primary" [(ngModel)]="useReverseAPI" (change)="setUseReverseAPI()" matTooltip="Use reverse API">
Reverse API
</mat-checkbox>
</td>
<td>
Device
<input type="number" class="gain-input"
[(ngModel)]="settings.reverseAPIDeviceIndex"
(change)="setReverseAPIDeviceIndex()"
matTooltip="Reverse API device index"
min=0>
</td>
<td></td>
</tr>
<!--- reverse API address, reverse API port -->
<tr>
<td>
Addr
<input type="text" class="address-input"
[(ngModel)]="settings.reverseAPIAddress"
(change)="setReverseAPIAddress()"
matTooltip="Reverse API IPv4 address"
>
</td>
<td>
Port
<input type="number" class="port-input"
[(ngModel)]="settings.reverseAPIPort"
(change)="setReverseAPIPort()"
matTooltip="Reverse API port"
min=1024 max=65535>
</td>
<td></td>
</tr>
<tr style="height: 3px;">
</tr>
</table>
</mat-card-content>
</mat-card>
<mat-card [ngClass]="{'status-ko-card': statusError, 'status-ok-card': !statusError}">
{{ statusMessage }}
</mat-card>
Loading

0 comments on commit 4756be9

Please sign in to comment.