Compare commits

..

No commits in common. "b6dfdd568657c2308bed60123d933f7baae552e6" and "d7ee5062e41c62679e26a70ee26acf3e5a29fa7a" have entirely different histories.

7 changed files with 15 additions and 85 deletions

View File

@ -1,7 +1,6 @@
import {Routes} from '@angular/router';
import {ElectroComponent} from './electro/electro.component';
import {GreenhouseComponent} from './greenhouse/greenhouse/greenhouse.component';
import {CisternComponent} from './cistern/cistern.component';
export class Path {
@ -21,8 +20,7 @@ export class Path {
export const ROUTING = {
ENERGY: new Path('Energy', 'Energie', true),
CISTERN: new Path('CISTERN', 'Zisterne', true),
GREENHOUSE: new Path('Greenhouse', 'Gewächshaus', false),
GREENHOUSE: new Path('Greenhouse', 'Gewächshaus', true),
}
export function menubar(): Path[] {
@ -31,7 +29,6 @@ export function menubar(): Path[] {
export const routes: Routes = [
{path: ROUTING.ENERGY.path, component: ElectroComponent},
{path: ROUTING.CISTERN.path, component: CisternComponent},
{path: ROUTING.GREENHOUSE.path, component: GreenhouseComponent},
{path: '**', redirectTo: ROUTING.ENERGY.path},
];

View File

@ -1,18 +0,0 @@
<table class="vertical">
<tr>
<th>Füllgrad</th>
<td class="valueInteger">{{ seriesService.cisternHeight.series?.lastValue?.percent(93.5)?.localeString }}</td>
<td class="unit">%</td>
</tr>
<tr>
<th>Füllhöhe</th>
<td class="valueInteger">{{ seriesService.cisternHeight.series?.lastValue?.localeString }}</td>
<td class="unit">{{ seriesService.cisternHeight.series?.lastValue?.unit?.unit }}</td>
</tr>
<tr>
<th>Volumen</th>
<td class="valueInteger">{{ seriesService.cisternVolume.series?.lastValue?.localeString }}</td>
<td class="unit">{{ seriesService.cisternVolume.series?.lastValue?.unit?.unit }}</td>
</tr>
</table>
<img width="100%" *ngIf="seriesService.cisternVolume.series" [src]="graph(seriesService.cisternVolume.series)" [alt]="seriesService.cisternVolume.series.title">

View File

@ -1,37 +0,0 @@
import {Component, OnDestroy, OnInit} from '@angular/core';
import {SeriesService} from '../series/series.service';
import {Subscription} from 'rxjs';
import {NgIf} from '@angular/common';
import {Series} from '../series/Series';
import {ApiService} from '../core/api.service';
@Component({
selector: 'app-cistern',
imports: [
NgIf
],
templateUrl: './cistern.component.html',
styleUrl: './cistern.component.less'
})
export class CisternComponent implements OnInit, OnDestroy {
private subs: Subscription[] = [];
constructor(
readonly seriesService: SeriesService,
) {
}
ngOnInit(): void {
this.subs.push(this.seriesService.subscribeAny());
}
ngOnDestroy(): void {
this.subs.forEach(sub => sub.unsubscribe());
}
graph(series: Series) {
return ApiService.url('http', ['Series', 'Graph', series.id, '400', '100', 'FIVE', '0', '288']);
}
}

View File

@ -28,10 +28,6 @@ export class SeriesService extends AbstractRepositoryService {
readonly greenhouseIlluminance: SeriesWrapper = new SeriesWrapper("greenhouse/illuminance", this.onSubscribe, this.onUnsubscribe);
readonly cisternHeight: SeriesWrapper = new SeriesWrapper("Cistern/height", this.onSubscribe, this.onUnsubscribe);
readonly cisternVolume: SeriesWrapper = new SeriesWrapper("Cistern/volume", this.onSubscribe, this.onUnsubscribe);
protected get liveValues(): SeriesWrapper[] {
return [
this.powerConsumed,
@ -42,8 +38,6 @@ export class SeriesService extends AbstractRepositoryService {
this.greenhouseHumidityRelative,
this.greenhouseHumidityAbsolute,
this.greenhouseIlluminance,
this.cisternHeight,
this.cisternVolume,
];
}

View File

@ -36,10 +36,6 @@ export class Unit {
static readonly LIGHT_BOOLEAN = new Unit('LIGHT_BOOLEAN', '');
static readonly VOLUME_L = new Unit('VOLUME_L', 'l');
static readonly LENGTH_CM = new Unit('LENGTH_CM', 'cm');
private constructor(
readonly name: string,
readonly unit: string,

View File

@ -1,19 +1,17 @@
package de.ph87.data.series.graph;
import de.ph87.data.series.Aligned;
import de.ph87.data.series.SeriesDto;
import de.ph87.data.series.SeriesType;
import de.ph87.data.value.Autoscale;
import jakarta.annotation.Nullable;
import lombok.NonNull;
import de.ph87.data.series.*;
import de.ph87.data.value.*;
import jakarta.annotation.*;
import lombok.*;
import java.awt.*;
import java.awt.geom.Line2D;
import java.awt.image.BufferedImage;
import java.awt.geom.*;
import java.awt.image.*;
import java.util.List;
import java.util.function.Function;
import java.util.function.*;
import static java.lang.Math.max;
import static java.lang.Math.*;
public class Graph {
@ -119,14 +117,14 @@ public class Graph {
final Graphics2D g = (Graphics2D) image.getGraphics();
final int fontH3_4 = (int) Math.round(g.getFontMetrics().getHeight() * 0.75);
// g.setColor(Color.gray);
// final String string = "%s [%s]".formatted(series.getTitle(), autoscale.unit);
// g.drawString(string, border, border + fontH3_4);
g.setColor(Color.gray);
final String string = "%s [%s]".formatted(series.getTitle(), autoscale.unit);
g.drawString(string, border, border + fontH3_4);
yLabel(g, valueMax, DASHED, Color.red.darker().darker());
// yLabel(g, valueAvg, DASHED, new Color(0, 127, 0));
yLabel(g, valueMax, DASHED, Color.red);
yLabel(g, valueAvg, DASHED, new Color(0, 127, 0));
yLabel(g, 0, NORMAL, Color.BLACK);
yLabel(g, valueMin, DASHED, new Color(64, 128, 255).darker().darker());
yLabel(g, valueMin, DASHED, Color.blue);
g.translate(border, height - border);
g.scale(1, -1);