Skip to content

Commit

Permalink
Update dev modal
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphiiko committed Sep 3, 2024
1 parent d2512cb commit 4cca232
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,2 @@
<pre>
{{ colorTemp }}K
</pre>
<app-slider
[min]="1000"
[max]="6600"
[step]="100"
[value]="colorTemp"
(valueChange)="setColorTemp($event)"
></app-slider>
<pre>
{{ result | json }}
</pre>
<button class="btn btn-primary" (click)="pullOvrData()">PULL OVR DATA</button>
<pre>{{ovrData | json}}</pre>
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Component, Input, OnInit } from '@angular/core';
import { BaseModalComponent } from '../../base-modal/base-modal.component';
import { invoke } from '@tauri-apps/api';
import { OpenVRService } from '../../../services/openvr.service';
import { firstValueFrom, take } from 'rxjs';
import { writeText } from '@tauri-apps/api/clipboard';

@Component({
selector: 'app-misc-testing',
Expand All @@ -10,15 +12,16 @@ import { invoke } from '@tauri-apps/api';
export class MiscTestingComponent implements OnInit {
@Input() modal?: BaseModalComponent<any, any>;

constructor() {}
constructor(private openvr: OpenVRService) {}

ngOnInit(): void {}

colorTemp = 6600;
result: any;
ovrData: any = {};

async setColorTemp(temp: number) {
this.colorTemp = temp;
this.result = await invoke('openvr_set_analog_color_temp', { temperature: this.colorTemp });
async pullOvrData() {
this.ovrData = await firstValueFrom(this.openvr.devices.pipe(take(1)));
await writeText(JSON.stringify(this.ovrData, null, 2));
alert('OVR data copied to clipboard');
}
}

0 comments on commit 4cca232

Please sign in to comment.