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

Bsg small changes #727

Merged
merged 10 commits into from
Feb 3, 2025
Merged
4 changes: 4 additions & 0 deletions projects/kerttu-global/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@
"identification.boxes.new": "Draw a new box",
"identification.boxes.newRelated": "Draw a related box",
"identification.boxes.overlapsWithOthers": "Overlaps with other species",
"identification.boxes.soundType": "Sound type",
"identification.boxes.soundType.info": "If possible, define sound type. \"Song/display\" includes songs of songbirds and corresponding territorial/display vocalizations of adult birds, such as drumming of woodpeckers, winnowing of snipes, etc. \"Other\" includes other vocalization types such as flight, warning and contact calls, begging calls of juvenile birds, wing sound, etc. If this categorization is not applicable, sound type does not need to be determined.",
"identification.boxes.soundType.songOrDisplay": "Song/display",
"identification.boxes.soundType.other": "Other",
"identification.containsBirdsNotOnList": "Recording contains birds that are not on the list",
"identification.containsBirdsNotOnList.info": "Free-text field for species that are not found in the 2019 eBird/Clements taxonomy list. For example Maghreb Owl (<i>Strix [aluco] mauritanica<i>).",
"identification.containsHumanSpeech": "Recording contains human speech or other vocalizations",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<laji-spinner [spinning]="!continents?.length" [hideContentWhileLoading]="true">
<laji-spinner [spinning]="!continents.length" [hideContentWhileLoading]="true">
<table class="mt-0 mb-0">
<tr *ngFor="let continent of continents">
<th>{{ 'continents.' + continent.value | translate }}</th>
<td>
<select
[(ngModel)]="skillLevelByContinent[continent.id]"
class="form-control"
[disabled]="disabled || !birdSongRecognitionSkillLevels?.length"
[disabled]="disabled || !birdSongRecognitionSkillLevels.length"
(ngModelChange)="selectChange()"
>
<option
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,25 @@
[areaColor]="box.overlapsWithOtherSpecies ? overlappingBirdRectangleColor: birdRectangleColor"
></laji-small-audio-viewer>
</td>
<td *ngIf="showSoundTypeSelect" style="width: 160px" class="select-column">
<label>
<small>{{ 'identification.boxes.soundType' | translate }}</small>
<laji-info [placement]="'right'" [html]="'identification.boxes.soundType.info' | translate" [showOnHover]="true"></laji-info>
</label>
<select class="form-control input-sm" [(ngModel)]="box.soundType" (ngModelChange)="identificationChange.emit(identification)">
<option [ngValue]="undefined"></option>
<option [ngValue]="soundTypeEnum.songOrDisplay">
{{ 'identification.boxes.soundType.songOrDisplay' | translate }}
</option>
<option [ngValue]="soundTypeEnum.other">
{{ 'identification.boxes.soundType.other' | translate }}
</option>
</select>
</td>
<td style="width: 240px">
<div class="checkbox">
<label>
<input type="checkbox" [(ngModel)]="box.overlapsWithOtherSpecies" (ngModelChange)="identificationChange.emit(identification)">
{{ 'identification.boxes.overlapsWithOthers' | translate }}
<input type="checkbox" [(ngModel)]="box.overlapsWithOtherSpecies" (ngModelChange)="identificationChange.emit(identification)">{{ 'identification.boxes.overlapsWithOthers' | translate }}
</label>
</div>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,16 @@
.scroll-margin-top {
scroll-margin-top: $sp-6;
}

.select-column {
vertical-align: top !important;
padding-top: 2px;

label {
margin-bottom: 0;
}

select {
width: auto;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
import {
IGlobalRecording,
IGlobalSpeciesWithAnnotation,
isBoxGroup,
isBoxGroup, SoundTypeEnum,
SpeciesAnnotationEnum,
TaxonTypeEnum
} from '../../../../../../kerttu-global-shared/models';
Expand Down Expand Up @@ -38,6 +38,7 @@ export class IdentificationPanelComponent {
@Input({ required: true }) recording!: IGlobalRecording;
@Input({ required: true }) identification!: IGlobalSpeciesWithAnnotation;

@Input() showSoundTypeSelect = true;
@Input() showDrawRelatedBoxBtn = true;
@Input() buttonsDisabled = false;
@Input() drawBoxActive = false;
Expand All @@ -50,6 +51,7 @@ export class IdentificationPanelComponent {

speciesAnnotationEnum = SpeciesAnnotationEnum;
taxonTypeEnum = TaxonTypeEnum;
soundTypeEnum = SoundTypeEnum;

isBoxGroup = isBoxGroup;
getBoxLabel = KerttuGlobalUtil.getBoxLabel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[speciesIdx]="idx"
[recording]="recording"
[identification]="identification"
[showSoundTypeSelect]="showSoundTypeSelect"
[showDrawRelatedBoxBtn]="showDrawRelatedBoxBtn"
[buttonsDisabled]="buttonsDisabled"
[drawBoxActive]="drawBoxActive[idx]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export class IdentificationTableComponent implements OnChanges {
@Input() identifications!: IGlobalSpeciesWithAnnotation[];

@Input() loading = false;
@Input() showSoundTypeSelect = true;
@Input() showDrawRelatedBoxBtn = true;
@Input() buttonsDisabled = false;
@Input() drawActive = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<ng-template #audioCustomControls>
<laji-audio-viewer-simple-settings
[enableSlowDownAudioSetting]="recording.taxonType === taxonTypeEnum.bat || recording.taxonType === taxonTypeEnum.insect"
[enableShowWholeFrequencyRangeSetting]="recording.taxonType === taxonTypeEnum.bird || recording.taxonType === taxonTypeEnum.bat"
[enableShowWholeFrequencyRangeSetting]="recording.taxonType !== taxonTypeEnum.insect"
[enableShowWholeTimeRangeSetting]="recording.taxonType !== taxonTypeEnum.bat"
[(slowDownAudio)]="slowDownAudio"
[(showWholeFrequencyRange)]="showWholeFrequencyRange"
Expand Down Expand Up @@ -125,6 +125,7 @@ <h4>
[recording]="recording"
[(identifications)]="selectedSpecies"
[loading]="loadingSpecies"
[showSoundTypeSelect]="recording.taxonType === taxonTypeEnum.bird"
[showDrawRelatedBoxBtn]="recording.taxonType === taxonTypeEnum.insect"
[buttonsDisabled]="buttonsDisabled || loadingSpecies"
[birdRectangleColor]="birdRectangleColor"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[area]="template?.area"
[audio]="template ? audioIdMap[template.audioId] : undefined"
[spectrogramConfig]="spectrogramConfig"
[highlight]="(template && !confirmedTemplates?.[i] && highlightNonConfirmed) || !!template?.comment"
[highlight]="(template && !confirmedTemplates[i] && highlightNonConfirmed) || !!template?.comment"
[highlightType]="template?.comment?.type === 0 ? 'danger' : (template?.comment?.type === 1 ? 'warning' : 'default')"
[emptyAudioText]="'validation.undefined' | translate"
(templateClick)="templateClick.emit(i)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ export interface IGlobalRecordingAnnotation {
export interface IGlobalSpeciesAnnotation {
speciesId: number;
occurrence: SpeciesAnnotationEnum;
soundType?: SoundTypeEnum;
boxes?: (IGlobalSpeciesAnnotationBox|IGlobalSpeciesAnnotationBoxGroup)[];
}

Expand Down Expand Up @@ -218,6 +219,11 @@ export enum SpeciesAnnotationEnum {
possiblyOccurs = 2
}

export enum SoundTypeEnum {
songOrDisplay = 1,
other = 2
}

export enum KerttuGlobalErrorEnum {
speciesLocked = 'SpeciesLockedError',
invalidRecordingId = 'InvalidRecordingIdError',
Expand All @@ -227,7 +233,8 @@ export enum KerttuGlobalErrorEnum {
export enum TaxonTypeEnum {
bird = 0,
bat = 1,
insect = 2
insect = 2,
frog = 3
}

export enum AnnotationStatusEnum {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export class KerttuGlobalUtil {
}

public static getDefaultSampleRate(taxonType: TaxonTypeEnum = TaxonTypeEnum.bird) {
return taxonType === TaxonTypeEnum.bird ? defaultAudioSampleRate :
taxonType === TaxonTypeEnum.bat ? defaultBatAudioSampleRate :
defaultInsectAudioSampleRate;
return taxonType === TaxonTypeEnum.bat ? defaultBatAudioSampleRate :
taxonType === TaxonTypeEnum.insect ? defaultInsectAudioSampleRate :
defaultAudioSampleRate;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const defaultAudioSampleRate = 33200;
export const lowAudioSampleRate = 22050;
export const defaultBatAudioSampleRate = 240000;
export const defaultBatAudioSampleRate = 300000;
export const defaultInsectAudioSampleRate = 96000;
Loading