-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FreeDV demodulator channel component
- Loading branch information
Showing
10 changed files
with
636 additions
and
6 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
91 changes: 91 additions & 0 deletions
91
src/app/channel-details/freedv-demod/freedv-demod.component.css
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,91 @@ | ||
.channel-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; | ||
} | ||
|
||
.channel-header-rx { | ||
background-color: rgb(170,255,200); | ||
} | ||
|
||
.channel-header-comp { | ||
margin-top: 1px; | ||
} | ||
|
||
.button-card { | ||
padding-top: 0px; | ||
padding-right: 0px; | ||
padding-bottom: 0px; | ||
padding-left: 0px; | ||
width: 22px; | ||
height: 22px; | ||
} | ||
|
||
.button-on { | ||
border: solid; | ||
border-width: 1px; | ||
border-color: gray; | ||
background-color: rgb(0, 255, 0, 1.0); | ||
} | ||
|
||
.button-off { | ||
border: solid; | ||
border-width: 1px; | ||
border-color: gray; | ||
background-color: rgb(0, 0, 0, 0); | ||
} | ||
|
||
.volume-input { | ||
width: 6ch; | ||
} | ||
|
||
.squelch-input { | ||
width: 6ch; | ||
} | ||
|
||
.rfbw-input { | ||
width: 6ch; | ||
} | ||
|
||
.source-input { | ||
width: 10ch; | ||
background-color: white; | ||
} | ||
|
||
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; | ||
} |
132 changes: 132 additions & 0 deletions
132
src/app/channel-details/freedv-demod/freedv-demod.component.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,132 @@ | ||
<mat-card> | ||
<mat-card-header class="channel-card-header channel-header-rx"> | ||
<button mat-button class="button-card" matTooltip="Refresh" (click)="getChannelSettings()"> | ||
<img src="./assets/icons/if_refresh.svg" style="height:16px; width:16px"/> | ||
</button> | ||
<button mat-button mat-raised-button | ||
[ngClass]="{'button-card': true, 'button-on': monitor, 'button-off': !monitor}" | ||
matTooltip="Monitor on/off" | ||
(click)="toggleMonitor()"> | ||
<img src="./assets/icons/eye-icon.svg" style="height:16px; width:16px; margin-top: 2px;"/> | ||
</button> | ||
<app-channel-header class="channel-header-comp" channelType="FreeDVDemod" | ||
[basebandRate]="deviceBasebandRate" | ||
[title]="settings.title" | ||
[color]="rgbTitleStr" | ||
(titleChanged)="onTitleChanged($event)" | ||
(colorChanged)="onTitleColorChanged($event)" > | ||
</app-channel-header> | ||
</mat-card-header> | ||
<mat-card-content> | ||
<table> | ||
<!-- Row 1: channel monitor (optional) --> | ||
<tr *ngIf="monitor"> | ||
<td colspan="3"> | ||
<app-channel-monitor [value]=this.report.channelPowerDB | ||
[min]="-120" | ||
[max]="0" | ||
[squelch]="this.report.squelch !== 0"> | ||
</app-channel-monitor> | ||
</td> | ||
</tr> | ||
<!-- Row 2: Frequency dial --> | ||
<tr> | ||
<td colspan="2"> | ||
<app-frequency-dial | ||
[frequency]="channelCenterFrequencyKhz" | ||
[min]="channelMinFrequencyKhz" | ||
[max]="channelMaxFrequencyKhz" | ||
(frequencyChanged)="onFrequencyUpdate($event)"> | ||
</app-frequency-dial> | ||
</td> | ||
<td style="width:15ch"> | ||
Δf {{getDeltaFrequency()}} kHz | ||
</td> | ||
</tr> | ||
<!-- Row 3: Span, Mode, AGC --> | ||
<tr> | ||
<td> | ||
÷ | ||
<mat-select style="width:6ch; background-color: white; margin: 1px;" | ||
[(value)]="settings.spanLog2" | ||
(selectionChange)="setSpan()" | ||
matTooltip="Channel decimation"> | ||
<mat-option *ngFor="let spanLog2 of spanLog2s" [value]="spanLog2.value"> | ||
{{spanLog2.viewValue}} | ||
</mat-option> | ||
</mat-select> | ||
<span matTooltip="Channel bandwidth"> | ||
{{getChannelBaseband()}} kHz | ||
</span> | ||
</td> | ||
<td> | ||
Mode | ||
<mat-select class="source-input" | ||
[(value)]="settings.freeDVMode" | ||
(selectionChange)="setFreeDVMode()" | ||
matTooltip="FreeDV protocol and modulation mode"> | ||
<mat-option *ngFor="let freeDVMode of freeDVModes" [value]="freeDVMode.value"> | ||
{{freeDVMode.viewValue}} | ||
</mat-option> | ||
</mat-select> | ||
</td> | ||
<td> | ||
<mat-checkbox color="primary" [(ngModel)]="agc" (change)="setAGC()" matTooltip="Automatic Gain Control"> | ||
AGC | ||
</mat-checkbox> | ||
</td> | ||
</tr> | ||
<!-- row 4:volumeIn, volume, audio mute--> | ||
<tr> | ||
<td> | ||
Vol In | ||
<input type="number" class="volume-input" | ||
[(ngModel)]="settings.volumeIn" | ||
(change)="setVolumeIn()" | ||
matTooltip="Modem input volume" | ||
min=0 max=9.9 | ||
step="0.1"> | ||
</td> | ||
<td> | ||
Vol Out | ||
<input type="number" class="volume-input" | ||
[(ngModel)]="settings.volume" | ||
(change)="setVolume()" | ||
matTooltip="Audio output volume" | ||
min=0 max=9.9 | ||
step="0.1"> | ||
</td> | ||
<td> | ||
<mat-checkbox color="primary" [(ngModel)]="audioMute" (change)="setAudioMute()" matTooltip="Audio mute"> | ||
Mute | ||
</mat-checkbox> | ||
</td> | ||
</tr> | ||
<!-- Audio options --> | ||
<tr> | ||
<td colspan="3"> | ||
Audio: | ||
<mat-select style="width:48ch; background-color: white; margin: 1px;" | ||
[(value)]="settings.audioDeviceName" | ||
(selectionChange)="setAudioDevice()" | ||
matTooltip="Audio input device"> | ||
<mat-option *ngFor="let audioDevice of audioDevices" [value]="audioDevice.value"> | ||
{{audioDevice.value}} | ||
</mat-option> | ||
</mat-select> | ||
</td> | ||
</tr> | ||
<!-- Row 6: empty footer --> | ||
<tr style="height: 3px;"> | ||
</tr> | ||
</table> | ||
<!-- empty footer --> | ||
<table> | ||
<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> |
53 changes: 53 additions & 0 deletions
53
src/app/channel-details/freedv-demod/freedv-demod.component.spec.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,53 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { FreeDVDemodComponent } from './freedv-demod.component'; | ||
import { ChannelHeaderComponent } from '../channel-header/channel-header.component'; | ||
import { ChannelMonitorComponent } from '../channel-monitor/channel-monitor.component'; | ||
import { RouterModule, ActivatedRoute } from '@angular/router'; | ||
import { FormsModule } from '@angular/forms'; | ||
import { MatCardModule, MatSelectModule, MatOptionModule, MatCheckboxModule, MatTooltipModule, MatProgressBarModule } from '@angular/material'; | ||
import { HttpClientTestingModule } from '@angular/common/http/testing'; | ||
import { CommonComponentsModule } from 'src/app/common-components/common-components.module'; | ||
import { ColorPickerModule } from 'ngx-color-picker'; | ||
|
||
describe('FreedvDemodComponent', () => { | ||
let component: FreeDVDemodComponent; | ||
let fixture: ComponentFixture<FreeDVDemodComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ | ||
FreeDVDemodComponent, | ||
ChannelHeaderComponent, | ||
ChannelMonitorComponent | ||
], | ||
imports: [ | ||
RouterModule, | ||
FormsModule, | ||
MatCardModule, | ||
MatSelectModule, | ||
MatOptionModule, | ||
MatCheckboxModule, | ||
MatTooltipModule, | ||
MatProgressBarModule, | ||
HttpClientTestingModule, | ||
CommonComponentsModule, | ||
ColorPickerModule | ||
], | ||
providers: [ | ||
{provide: ActivatedRoute, useValue: { snapshot: {parent: {params: {dix: 0, cix: 0}}}}} | ||
] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(FreeDVDemodComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.