WIP
This commit is contained in:
@@ -10,7 +10,6 @@ use crate::IsoDateTime;
|
||||
use crate::ReadPbv;
|
||||
use crate::ReadableFromFile;
|
||||
use crate::Sitemty;
|
||||
use crate::SubFrId;
|
||||
use crate::TimeBinnableDyn;
|
||||
use crate::{ts_offs_from_abs, FrameType};
|
||||
use crate::{NewEmpty, RangeOverlapInfo, WithLen};
|
||||
@@ -18,6 +17,7 @@ use crate::{TimeBinnableType, TimeBinnableTypeAggregator};
|
||||
use crate::{TimeBinned, TimeBinnerDyn, TimeBins};
|
||||
use chrono::{TimeZone, Utc};
|
||||
use err::Error;
|
||||
use items_0::subfr::SubFrId;
|
||||
use netpod::log::*;
|
||||
use netpod::timeunits::SEC;
|
||||
use netpod::{NanoRange, Shape};
|
||||
|
||||
@@ -14,9 +14,10 @@ use crate::TimeBinnableType;
|
||||
use crate::TimeBinnableTypeAggregator;
|
||||
use crate::TimeBins;
|
||||
use crate::{pulse_offs_from_abs, FrameType};
|
||||
use crate::{Fits, FitsInside, NewEmpty, ReadPbv, Sitemty, SubFrId, TimeBinned, WithLen};
|
||||
use crate::{Fits, FitsInside, NewEmpty, ReadPbv, Sitemty, TimeBinned, WithLen};
|
||||
use chrono::{TimeZone, Utc};
|
||||
use err::Error;
|
||||
use items_0::subfr::SubFrId;
|
||||
use netpod::log::*;
|
||||
use netpod::timeunits::SEC;
|
||||
use netpod::{NanoRange, Shape};
|
||||
|
||||
@@ -15,7 +15,6 @@ pub mod xbinnedscalarevents;
|
||||
pub mod xbinnedwaveevents;
|
||||
|
||||
use crate::frame::make_frame_2;
|
||||
use crate::numops::BoolNum;
|
||||
use bytes::BytesMut;
|
||||
use chrono::{TimeZone, Utc};
|
||||
use err::Error;
|
||||
@@ -25,10 +24,10 @@ use netpod::log::*;
|
||||
use netpod::timeunits::{MS, SEC};
|
||||
use netpod::{log::Level, AggKind, EventDataReadStats, NanoRange, Shape};
|
||||
use netpod::{DiskStats, RangeFilterStats, ScalarType};
|
||||
use numops::StringNum;
|
||||
use serde::de::{self, DeserializeOwned, Visitor};
|
||||
use serde::{Deserialize, Serialize, Serializer};
|
||||
use std::any::Any;
|
||||
use std::collections::VecDeque;
|
||||
use std::fmt;
|
||||
use std::future::Future;
|
||||
use std::marker::PhantomData;
|
||||
@@ -190,58 +189,6 @@ pub const INMEM_FRAME_HEAD: usize = 20;
|
||||
pub const INMEM_FRAME_FOOT: usize = 4;
|
||||
pub const INMEM_FRAME_MAGIC: u32 = 0xc6c3b73d;
|
||||
|
||||
pub trait SubFrId {
|
||||
const SUB: u32;
|
||||
}
|
||||
|
||||
impl SubFrId for u8 {
|
||||
const SUB: u32 = 0x03;
|
||||
}
|
||||
|
||||
impl SubFrId for u16 {
|
||||
const SUB: u32 = 0x05;
|
||||
}
|
||||
|
||||
impl SubFrId for u32 {
|
||||
const SUB: u32 = 0x08;
|
||||
}
|
||||
|
||||
impl SubFrId for u64 {
|
||||
const SUB: u32 = 0x0a;
|
||||
}
|
||||
|
||||
impl SubFrId for i8 {
|
||||
const SUB: u32 = 0x02;
|
||||
}
|
||||
|
||||
impl SubFrId for i16 {
|
||||
const SUB: u32 = 0x04;
|
||||
}
|
||||
|
||||
impl SubFrId for i32 {
|
||||
const SUB: u32 = 0x07;
|
||||
}
|
||||
|
||||
impl SubFrId for i64 {
|
||||
const SUB: u32 = 0x09;
|
||||
}
|
||||
|
||||
impl SubFrId for f32 {
|
||||
const SUB: u32 = 0x0b;
|
||||
}
|
||||
|
||||
impl SubFrId for f64 {
|
||||
const SUB: u32 = 0x0c;
|
||||
}
|
||||
|
||||
impl SubFrId for StringNum {
|
||||
const SUB: u32 = 0x0d;
|
||||
}
|
||||
|
||||
impl SubFrId for BoolNum {
|
||||
const SUB: u32 = 0x0e;
|
||||
}
|
||||
|
||||
// Required for any inner type of Sitemty.
|
||||
pub trait FrameTypeInnerStatic {
|
||||
const FRAME_TYPE_ID: u32;
|
||||
@@ -421,6 +368,7 @@ impl FrameType for EventQueryJsonStringFrame {
|
||||
pub trait EventsNodeProcessorOutput:
|
||||
Send + Unpin + DeserializeOwned + WithTimestamps + TimeBinnableType + ByteEstimate
|
||||
{
|
||||
fn into_parts<NTY>(self) -> (VecDeque<NTY>, VecDeque<u64>);
|
||||
}
|
||||
|
||||
pub trait EventsNodeProcessor: Send + Unpin {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::SubFrId;
|
||||
use items_0::subfr::SubFrId;
|
||||
use num_traits::{Bounded, Float, Zero};
|
||||
use serde::de::DeserializeOwned;
|
||||
use serde::{Deserialize, Serialize};
|
||||
@@ -123,6 +123,7 @@ pub trait NumOps:
|
||||
+ SubFrId
|
||||
+ Serialize
|
||||
+ DeserializeOwned
|
||||
+ items_0::scalar_ops::ScalarOps
|
||||
{
|
||||
fn min_or_nan() -> Self;
|
||||
fn max_or_nan() -> Self;
|
||||
@@ -203,3 +204,43 @@ impl_num_ops!(f32, NAN, NAN, is_nan_float);
|
||||
impl_num_ops!(f64, NAN, NAN, is_nan_float);
|
||||
impl_num_ops!(BoolNum, MIN, MAX, is_nan_int);
|
||||
impl_num_ops!(StringNum, MIN, MAX, is_nan_int);
|
||||
|
||||
impl SubFrId for StringNum {
|
||||
const SUB: u32 = 0x0d;
|
||||
}
|
||||
|
||||
impl SubFrId for BoolNum {
|
||||
const SUB: u32 = 0x0e;
|
||||
}
|
||||
|
||||
impl items_0::scalar_ops::AsPrimF32 for BoolNum {
|
||||
fn as_prim_f32_b(&self) -> f32 {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
impl items_0::scalar_ops::AsPrimF32 for StringNum {
|
||||
fn as_prim_f32_b(&self) -> f32 {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
impl items_0::scalar_ops::ScalarOps for BoolNum {
|
||||
fn zero_b() -> Self {
|
||||
todo!()
|
||||
}
|
||||
|
||||
fn equal_slack(&self, _rhs: &Self) -> bool {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
impl items_0::scalar_ops::ScalarOps for StringNum {
|
||||
fn zero_b() -> Self {
|
||||
todo!()
|
||||
}
|
||||
|
||||
fn equal_slack(&self, _rhs: &Self) -> bool {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -823,4 +823,11 @@ impl<NTY: NumOps + 'static> TimeBinnerDyn for ScalarEventsTimeBinner<NTY> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<NTY> EventsNodeProcessorOutput for ScalarEvents<NTY> where NTY: NumOps {}
|
||||
impl<NTY> EventsNodeProcessorOutput for ScalarEvents<NTY>
|
||||
where
|
||||
NTY: NumOps,
|
||||
{
|
||||
fn into_parts<NTY2>(self) -> (VecDeque<NTY2>, VecDeque<u64>) {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ use err::Error;
|
||||
use netpod::log::*;
|
||||
use netpod::{NanoRange, Shape};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::VecDeque;
|
||||
use std::fmt;
|
||||
use tokio::fs::File;
|
||||
|
||||
@@ -421,4 +422,8 @@ impl EventAppendable for StatsEvents {
|
||||
}
|
||||
}
|
||||
|
||||
impl EventsNodeProcessorOutput for StatsEvents {}
|
||||
impl EventsNodeProcessorOutput for StatsEvents {
|
||||
fn into_parts<NTY2>(self) -> (VecDeque<NTY2>, VecDeque<u64>) {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,13 +5,14 @@ use crate::xbinnedwaveevents::XBinnedWaveEvents;
|
||||
use crate::{
|
||||
Appendable, ByteEstimate, Clearable, EventAppendable, EventsDyn, EventsNodeProcessor, EventsNodeProcessorOutput,
|
||||
FilterFittingInside, Fits, FitsInside, FrameType, FrameTypeInnerStatic, NewEmpty, PushableIndex, RangeOverlapInfo,
|
||||
ReadPbv, ReadableFromFile, SubFrId, TimeBinnableDyn, TimeBinnableType, TimeBinnableTypeAggregator, WithLen,
|
||||
WithTimestamps,
|
||||
ReadPbv, ReadableFromFile, TimeBinnableDyn, TimeBinnableType, TimeBinnableTypeAggregator, WithLen, WithTimestamps,
|
||||
};
|
||||
use err::Error;
|
||||
use items_0::subfr::SubFrId;
|
||||
use netpod::log::*;
|
||||
use netpod::{x_bin_count, AggKind, NanoRange, Shape};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::VecDeque;
|
||||
use std::marker::PhantomData;
|
||||
use tokio::fs::File;
|
||||
|
||||
@@ -535,4 +536,11 @@ impl<NTY: NumOps> EventsDyn for WaveEvents<NTY> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<NTY> EventsNodeProcessorOutput for WaveEvents<NTY> where NTY: NumOps {}
|
||||
impl<NTY> EventsNodeProcessorOutput for WaveEvents<NTY>
|
||||
where
|
||||
NTY: NumOps,
|
||||
{
|
||||
fn into_parts<NTY2>(self) -> (VecDeque<NTY2>, VecDeque<u64>) {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
use std::collections::VecDeque;
|
||||
|
||||
use crate::binsdim0::MinMaxAvgDim0Bins;
|
||||
use crate::numops::NumOps;
|
||||
use crate::streams::{Collectable, Collector};
|
||||
use crate::{
|
||||
ts_offs_from_abs, Appendable, ByteEstimate, Clearable, EventsNodeProcessorOutput, FilterFittingInside, Fits,
|
||||
FitsInside, FrameType, FrameTypeInnerStatic, NewEmpty, PushableIndex, RangeOverlapInfo, ReadPbv, ReadableFromFile,
|
||||
SubFrId, TimeBinnableType, TimeBinnableTypeAggregator, WithLen, WithTimestamps,
|
||||
TimeBinnableType, TimeBinnableTypeAggregator, WithLen, WithTimestamps,
|
||||
};
|
||||
use err::Error;
|
||||
use items_0::subfr::SubFrId;
|
||||
use netpod::log::*;
|
||||
use netpod::{NanoRange, Shape};
|
||||
use serde::{Deserialize, Serialize};
|
||||
@@ -502,4 +505,11 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<NTY> EventsNodeProcessorOutput for XBinnedScalarEvents<NTY> where NTY: NumOps {}
|
||||
impl<NTY> EventsNodeProcessorOutput for XBinnedScalarEvents<NTY>
|
||||
where
|
||||
NTY: NumOps,
|
||||
{
|
||||
fn into_parts<NTY2>(self) -> (VecDeque<NTY2>, VecDeque<u64>) {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,14 +3,16 @@ use crate::numops::NumOps;
|
||||
use crate::streams::{Collectable, Collector};
|
||||
use crate::{
|
||||
Appendable, ByteEstimate, Clearable, EventsNodeProcessorOutput, FilterFittingInside, Fits, FitsInside, FrameType,
|
||||
FrameTypeInnerStatic, NewEmpty, PushableIndex, RangeOverlapInfo, ReadPbv, ReadableFromFile, SubFrId,
|
||||
TimeBinnableType, TimeBinnableTypeAggregator, WithLen, WithTimestamps,
|
||||
FrameTypeInnerStatic, NewEmpty, PushableIndex, RangeOverlapInfo, ReadPbv, ReadableFromFile, TimeBinnableType,
|
||||
TimeBinnableTypeAggregator, WithLen, WithTimestamps,
|
||||
};
|
||||
use err::Error;
|
||||
use items_0::subfr::SubFrId;
|
||||
use netpod::log::*;
|
||||
use netpod::timeunits::*;
|
||||
use netpod::{NanoRange, Shape};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::VecDeque;
|
||||
use std::mem;
|
||||
use tokio::fs::File;
|
||||
|
||||
@@ -533,4 +535,11 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<NTY> EventsNodeProcessorOutput for XBinnedWaveEvents<NTY> where NTY: NumOps {}
|
||||
impl<NTY> EventsNodeProcessorOutput for XBinnedWaveEvents<NTY>
|
||||
where
|
||||
NTY: NumOps,
|
||||
{
|
||||
fn into_parts<NTY2>(self) -> (VecDeque<NTY2>, VecDeque<u64>) {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user