first commit

This commit is contained in:
phil 2024-10-19 11:53:15 +02:00
commit 62506c830a
1207 changed files with 40706 additions and 0 deletions

View file

@ -0,0 +1,17 @@
<div class="container">
<mat-icon *ngIf='featureFinderService.hasDirection$ | async' aria-hidden="false"
matTooltip="Direction to interesting stuff..."
[ngStyle]="{'transform':'rotate(' + (featureFinderService.direction$ | async) + 'deg)'}">
north
</mat-icon>
<div *ngIf='distance'>
{{ distance }} m
</div>
<mat-icon class="north"
matTooltip="Direction of north"
[ngStyle]="{'transform':'rotate(' + (featureFinderService.orientation$ | async) + 'deg)'}">
north
</mat-icon>
<div>

View file

@ -0,0 +1,6 @@
.container {
display: flex;
flex-direction: row;
align-items: center;
font-size: 1.5em;
}

View file

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { IndicatorComponent } from './indicator.component';
describe('IndicatorComponent', () => {
let component: IndicatorComponent;
let fixture: ComponentFixture<IndicatorComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ IndicatorComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(IndicatorComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,41 @@
import { Component, OnInit,
ChangeDetectorRef, ChangeDetectionStrategy } from '@angular/core'
import { Observable, BehaviorSubject } from 'rxjs'
import { map } from 'rxjs/operators'
import { ActionService } from '../action.service'
import { FeatureFinderService } from '../feature-finder.service'
@Component({
selector: 'app-indicator',
templateUrl: './indicator.component.html',
styleUrls: ['./indicator.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class IndicatorComponent implements OnInit {
constructor(
public actionService: ActionService,
public featureFinderService: FeatureFinderService,
private cdr: ChangeDetectorRef,
) { }
distance: number
ngOnInit(): void {
this.featureFinderService.distance$.subscribe(
dist => {
this.distance = Math.round(dist)
this.cdr.markForCheck()
}
)
this.featureFinderService.direction$.subscribe(
_ => this.cdr.markForCheck()
)
this.featureFinderService.orientation$.subscribe(
_ => this.cdr.markForCheck()
)
}
}