Use timestamp

This commit is contained in:
Dominik Werder
2025-02-27 16:02:17 +01:00
parent 8c772b208c
commit ccb8230fc3
2 changed files with 9 additions and 11 deletions

View File

@@ -11,13 +11,3 @@ pub fn dbg_chn(chn: &str) -> bool {
false
}
}
pub fn binwrite2_enable(chn: &str) -> bool {
let chns = [
// "ARS05-RAMP-0230:PLC-COUNT-MON",
// "ARS09-R3HC-0150:TUN1-MOTOR-TEMP",
// "ARS09-R3HC-0150:HOM27-ATT-TEMP",
// "ARIDI-BLM01:LOSS7",
];
chns.contains(&chn)
}

View File

@@ -1,4 +1,6 @@
use netpod::DtMs;
use netpod::TsMs;
use std::fmt;
autoerr::create_error_v1!(
name(Error, "BinMsp"),
@@ -17,6 +19,12 @@ pub enum PrebinnedPartitioning {
Day1,
}
impl fmt::Display for PrebinnedPartitioning {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fmt::Debug::fmt(self, fmt)
}
}
impl PrebinnedPartitioning {
pub fn bin_len(&self) -> DtMs {
use PrebinnedPartitioning::*;
@@ -53,7 +61,7 @@ impl PrebinnedPartitioning {
}
}
pub fn quo_rem(&self, val: DtMs) -> (u64, u32) {
pub fn quo_rem(&self, val: TsMs) -> (u64, u32) {
let valms = val.ms();
let divms = self.msp_div().ms();
let quo = valms / divms;