gnss_qc/report/rinex/
doris.rs1use crate::report::shared::SamplingReport;
2use itertools::Itertools;
3use maud::{html, Markup, Render};
4use std::collections::HashMap;
5
6use crate::plot::Plot;
7
8use rinex::{
9 carrier::Carrier,
10 prelude::{Observable, Rinex},
11};
12
13struct SignalPage {
14 sampling: SamplingReport,
16 raw_plots: HashMap<Observable, Plot>,
18}
19
20impl Render for SignalPage {
21 fn render(&self) -> Markup {
22 html! {
23 table class="table is-bordered" {
24 tr {
25 th class="is-info" {
26 "Sampling"
27 }
28 td {
29 (self.sampling.render())
30 }
31 }
32 @for observable in self.raw_plots.keys().sorted() {
33 @if let Some(plot) = self.raw_plots.get(observable) {
34 th class="is-info" {
35 (format!("{} Observations", observable))
36 }
37 td {
38 (plot.render())
39 }
40 }
41 }
42 }
43 }
44 }
45}
46
47pub struct DorisReport {
49 sampling: SamplingReport,
50 signals: HashMap<Carrier, SignalPage>,
51}
52
53impl DorisReport {
54 pub fn new(rinex: &Rinex) -> Self {
55 Self {
56 sampling: SamplingReport::from_rinex(rinex),
57 signals: {
58 let mut signals = HashMap::<Carrier, SignalPage>::new();
59 signals
60 },
61 }
62 }
63 pub fn html_inline_menu_bar(&self) -> Markup {
64 html! {
65 a id="menu:doris" {
66 span class="icon" {
67 i class="fa-solid fa-tower-cell" {}
68 }
69 "DORIS Observations"
70 }
71 }
72 }
73}
74
75impl Render for DorisReport {
76 fn render(&self) -> Markup {
77 html! {
78 table class="table is-bordered" {
79 tr {
80 th class="is-info" {
81 "Sampling"
82 }
83 td {
84 (self.sampling.render())
85 }
86 }
87 @for signal in self.signals.keys().sorted() {
88 @if let Some(page) = self.signals.get(signal) {
89 tr {
90 td {
91 (page.render())
92 }
93 }
94 }
95 }
96 }
97 }
98 }
99}