Get X-binned dim-1 with N X-bins as json

This commit is contained in:
Dominik Werder
2021-06-16 13:57:45 +02:00
parent edafc610c2
commit 99d0a97a69
8 changed files with 405 additions and 205 deletions

View File

@@ -2,6 +2,7 @@ use crate::agg::enp::{WaveEvents, XBinnedScalarEvents, XBinnedWaveEvents};
use crate::agg::eventbatch::MinMaxAvgScalarEventBatch;
use crate::agg::scalarbinbatch::MinMaxAvgScalarBinBatch;
use crate::agg::streams::StreamItem;
use crate::binned::dim1::MinMaxAvgDim1Bins;
use crate::binned::{MinMaxAvgBins, MinMaxAvgWaveBins, NumOps, RangeCompletableItem};
use crate::decode::EventValues;
use crate::frame::inmem::InMemoryFrame;
@@ -118,6 +119,13 @@ where
const FRAME_TYPE_ID: u32 = 0xa00 + NTY::SUB;
}
impl<NTY> FrameType for Sitemty<MinMaxAvgDim1Bins<NTY>>
where
NTY: SubFrId,
{
const FRAME_TYPE_ID: u32 = 0xb00 + NTY::SUB;
}
pub trait ProvidesFrameType {
fn frame_type_id(&self) -> u32;
}
@@ -226,6 +234,18 @@ where
}
}
impl<NTY> Framable for Sitemty<MinMaxAvgDim1Bins<NTY>>
where
NTY: NumOps + Serialize,
{
fn typeid(&self) -> u32 {
Self::FRAME_TYPE_ID
}
fn make_frame(&self) -> Result<BytesMut, Error> {
make_frame(self)
}
}
pub fn make_frame<FT>(item: &FT) -> Result<BytesMut, Error>
where
FT: FrameType + Serialize,