Compare commits
4 commits
Author | SHA1 | Date | |
---|---|---|---|
fc76bbf1ae | |||
66820a5d4c | |||
2b2810fbe2 | |||
46696d93d5 |
13 changed files with 104 additions and 3005 deletions
|
@ -1,31 +0,0 @@
|
|||
use super::MessageSpecies;
|
||||
|
||||
pub enum FmCO2Message{
|
||||
GET_BREATH, //Request 0
|
||||
GET_AMBIENT_PRESSURE, //Request 1
|
||||
GET_MODULE_CONFIG, //Request 2
|
||||
GET_CALIBRATION, //Request 3
|
||||
GET_SERVICE_TIME, //Request 4
|
||||
GET_CAL_TIME, //Request 5
|
||||
GET_CONFIG, //Request 6
|
||||
PUT_BREATH, //Response 0
|
||||
PUT_AMBIENT_PRESSURE, //Response 1
|
||||
PUT_MODULE_CONFIG, //Response 2
|
||||
PUT_CALIBRATION, //Response 3
|
||||
PUT_SERVICE_TIME, //Response 4
|
||||
PUT_CAL_TIME, //Response 5
|
||||
PUT_CONFIG, //Response 6
|
||||
RESTART_BREATH_ALG, //Command 0
|
||||
START_CALIBRATION, //Command 1
|
||||
STOP_CALIBRATION, //Command 2
|
||||
FORCE_SFM, //Command 3
|
||||
PUMP_CONTROL, //Command 4
|
||||
START_SFM, //Command 5
|
||||
SET_MODULE_CONFIG, //Command 6
|
||||
START_ACQUIRE, //Command 7
|
||||
STOP_ACQUIRE, //Command 8
|
||||
WRITE_CONFIG, //Command 9
|
||||
STREAM_CO2, //Stream 0
|
||||
}
|
||||
|
||||
impl MessageSpecies for FmCO2Message{}
|
195
FmCO2_objects.rs
195
FmCO2_objects.rs
|
@ -1,195 +0,0 @@
|
|||
use crate::datatypes;
|
||||
use super::{Object, ObjectSpecies, RawObject};
|
||||
use derive_getters::Getters;
|
||||
use derive_builder::Builder;
|
||||
use downcast_rs::Downcast
|
||||
|
||||
pub trait FmCO2:Downcast{}
|
||||
|
||||
#[derive(Clone,Debug)]
|
||||
pub enum FmCO2Species{
|
||||
SpDATA,
|
||||
SpCALIBRATION,
|
||||
SpSTANDARD,
|
||||
SpMSG_ARGUMENTS,
|
||||
}
|
||||
impl ObjectSpecies for FmCO2Species{}
|
||||
|
||||
impl FmCO2 for CCO2DData{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CCO2DData{
|
||||
status:Status,
|
||||
extstatus:ExtStatus,
|
||||
source:Source,
|
||||
mode:Mode,
|
||||
method:Method,
|
||||
etco2:OBJECT::CNumDStd,
|
||||
fico2:OBJECT::CNumDStd,
|
||||
rr:OBJECT::CNumDStd,
|
||||
ipi:OBJECT::CNumDStd,
|
||||
s_etco2:OBJECT::CNumDStd,
|
||||
s_fico2:OBJECT::CNumDStd,
|
||||
contco2:OBJECT::CNumDStd,
|
||||
s_density_5:OBJECT::CNumDStd,
|
||||
s_density_10:OBJECT::CNumDStd,
|
||||
s_density_30:OBJECT::CNumDStd,
|
||||
apneaindex_total:OBJECT::CNumDStd,
|
||||
apneaindex_10_19:OBJECT::CNumDStd,
|
||||
apneaindex_20_29:OBJECT::CNumDStd,
|
||||
apneaindex_30:OBJECT::CNumDStd,
|
||||
desatcount:OBJECT::CNumDStd,
|
||||
stime:chrono::NaiveDateTime,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Status{
|
||||
#[default]
|
||||
DATA_NOT_AVAIL,
|
||||
DATA_COMPLETE,
|
||||
DATA_FAILURE,
|
||||
DATA_EXCEPTION,
|
||||
DATA_PROCESSING,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum ExtStatus{
|
||||
#[default]
|
||||
INITIALIZATION,
|
||||
SFM_REQUIRED,
|
||||
SFM_IN_PROGRESS,
|
||||
PURGING_IN_PROGRESS,
|
||||
FILTER_LINE_NO_CONNECT,
|
||||
CHECK_CALIBRATION,
|
||||
CHECK_FLOW,
|
||||
OCCLUSION_IN_GAS_LINE,
|
||||
TEMPERATURE_OUT_OF_RANGE,
|
||||
PUMP_OFF,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Source{
|
||||
#[default]
|
||||
NONE,
|
||||
UNKNOWN,
|
||||
BREATH_DETECTED,
|
||||
INTERVAL,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Mode{
|
||||
#[default]
|
||||
NONE,
|
||||
UNKNOWN,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Method{
|
||||
#[default]
|
||||
NONE,
|
||||
UNKNOWN,
|
||||
MANUAL,
|
||||
DEVICE,
|
||||
REMOTE,
|
||||
}
|
||||
|
||||
pub impl CCO2DData {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CCO2DData{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmCO2 }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnDATA }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmCO2Species::CCO2DData) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmCO2 for CCO2CCal{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CCO2CCal{
|
||||
status:Status,
|
||||
method:Method,
|
||||
gasconcentration:uint8,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Status{
|
||||
#[default]
|
||||
IN_PROGRESS,
|
||||
NOT_READY,
|
||||
CALCULATING,
|
||||
COMPLETE_ERROR,
|
||||
COMPLETE_SUCCESS,
|
||||
USER_ABORT,
|
||||
MEASUREMENT_ERROR,
|
||||
AZ_FAIL,
|
||||
GAS_CONCENTRATION_CHECK,
|
||||
GAS_FLOW_UNSTABLE,
|
||||
CALIBRATION_FAILURE,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Method{
|
||||
#[default]
|
||||
NONE,
|
||||
REGULAR_CALIBRATION,
|
||||
SPECIAL_FACTORY_CALIBRATION,
|
||||
CALIBRATION_CHECK,
|
||||
}
|
||||
|
||||
pub impl CCO2CCal {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CCO2CCal{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmCO2 }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnCONFIG }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmCO2Species::CCO2CCal) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmCO2 for CCO2CStd{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CCO2CStd{
|
||||
displayunits:DisplayUnits,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum DisplayUnits{
|
||||
#[default]
|
||||
UNITS_MMHG,
|
||||
UNITS_KPA,
|
||||
}
|
||||
|
||||
pub impl CCO2CStd {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CCO2CStd{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmCO2 }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnCONFIG }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmCO2Species::CCO2CStd) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmCO2 for CCO2PMsgArg{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CCO2PMsgArg{
|
||||
ioparametera:uint16,
|
||||
ioparameterb:uint16,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
pub impl CCO2PMsgArg {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CCO2PMsgArg{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmCO2 }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnPARAMETER }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmCO2Species::CCO2PMsgArg) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
use super::MessageSpecies;
|
||||
|
||||
pub enum FmECGMessage{
|
||||
GET_CONFIG, //Request 0
|
||||
GET_LEADMEASUREMENT, //Request 1
|
||||
GET_MEASURMENTS, //Request 2
|
||||
GET_LEADIMPEDANCE, //Request 3
|
||||
GET_QRSCOMPLEX, //Request 4
|
||||
PUT_CONFIG, //Response 0
|
||||
PUT_LEADMEASUREMENT, //Response 1
|
||||
PUT_MEASUREMENTS, //Response 2
|
||||
PUT_LEADIMPEDANCE, //Response 3
|
||||
PUT_QRSCOMPLEX, //Response 4
|
||||
WRITE_CONFIG, //Command 0
|
||||
START_TEST, //Command 1
|
||||
STOP_TEST, //Command 2
|
||||
ECG_MODE, //Command 3
|
||||
}
|
||||
|
||||
impl MessageSpecies for FmECGMessage{}
|
644
FmECG_objects.rs
644
FmECG_objects.rs
|
@ -1,644 +0,0 @@
|
|||
use crate::datatypes;
|
||||
use super::{Object, ObjectSpecies, RawObject};
|
||||
use derive_getters::Getters;
|
||||
use derive_builder::Builder;
|
||||
use downcast_rs::Downcast
|
||||
|
||||
pub trait FmECG:Downcast{}
|
||||
|
||||
#[derive(Clone,Debug)]
|
||||
pub enum FmECGSpecies{
|
||||
SpPACER,
|
||||
SpGLOBALMEASURE,
|
||||
SpLEADMEASURE,
|
||||
SpSTATUS,
|
||||
SpRHYTHMREPORT,
|
||||
SpAUTOREPORT,
|
||||
SpMISCELLANEOUS,
|
||||
SpSTANDARD,
|
||||
SpSETTINGS,
|
||||
SpSELECTOR,
|
||||
}
|
||||
impl ObjectSpecies for FmECGSpecies{}
|
||||
|
||||
impl FmECG for CECGDPacer{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CECGDPacer{
|
||||
cwavesamplepacer:OBJECT::CWaveSampleCRPDetect,
|
||||
cwavedpacer:OBJECT::CWaveDStd,
|
||||
cwavecpacer:OBJECT::CWaveCStd,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
pub impl CECGDPacer {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CECGDPacer{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmECG }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnDATA }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmECGSpecies::CECGDPacer) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmECG for CECGDGlobalMeas{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CECGDGlobalMeas{
|
||||
pduration:uint32,
|
||||
pqduration:uint32,
|
||||
qrsduration:uint32,
|
||||
qtduration:uint32,
|
||||
qtcduration:uint32,
|
||||
qtdduration:uint32,
|
||||
paxis:uint32,
|
||||
qrsaxis:uint32,
|
||||
taxis:uint32,
|
||||
heartrate:uint32,
|
||||
ponset:uint32,
|
||||
poffset:uint32,
|
||||
qrsonset:uint32,
|
||||
qrsoffset:uint32,
|
||||
toffset:uint32,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
pub impl CECGDGlobalMeas {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CECGDGlobalMeas{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmECG }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnDATA }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmECGSpecies::CECGDGlobalMeas) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmECG for CECGDLeadMeas{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CECGDLeadMeas{
|
||||
leadidentifier:LeadIdentifier,
|
||||
pposamp:int32,
|
||||
pnegamp:int32,
|
||||
qduration:int32,
|
||||
qamp:int32,
|
||||
rduration:int32,
|
||||
ramp:int32,
|
||||
sduration:int32,
|
||||
samp:int32,
|
||||
raccduration:int32,
|
||||
raccamp:int32,
|
||||
saccduration:int32,
|
||||
saccamp:int32,
|
||||
iduration:int32,
|
||||
st0:int32,
|
||||
st20:int32,
|
||||
st40:int32,
|
||||
st60:int32,
|
||||
st80:int32,
|
||||
tposamp:int32,
|
||||
tnegamp:int32,
|
||||
r2accduration:int32,
|
||||
r2accamp:int32,
|
||||
s2accduration:int32,
|
||||
s2accamp:int32,
|
||||
kduration:int32,
|
||||
endt:int32,
|
||||
qrstype:widechar,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum LeadIdentifier{
|
||||
#[default]
|
||||
I,
|
||||
II,
|
||||
III,
|
||||
AVR,
|
||||
AVL,
|
||||
AVF,
|
||||
V1,
|
||||
V2,
|
||||
V3,
|
||||
V4,
|
||||
V5,
|
||||
V6,
|
||||
V7,
|
||||
V3R,
|
||||
V5R,
|
||||
X,
|
||||
Y,
|
||||
Z,
|
||||
V4R,
|
||||
V6R,
|
||||
V8,
|
||||
V9,
|
||||
NONE,
|
||||
}
|
||||
|
||||
pub impl CECGDLeadMeas {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CECGDLeadMeas{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmECG }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnDATA }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmECGSpecies::CECGDLeadMeas) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmECG for CECGDStatus{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CECGDStatus{
|
||||
electrodeoffstatus:ElectrodeOffStatus,
|
||||
arrhythmiastatus:byte,
|
||||
activeleads:ActiveLeads,
|
||||
container:OBJECT::ANY_CLASS,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum ElectrodeOffStatus{
|
||||
#[default]
|
||||
ELECTRODE_RL,
|
||||
ELECTRODE_LL,
|
||||
ELECTRODE_RA,
|
||||
ELECTRODE_LA,
|
||||
ELECTRODE_V,
|
||||
ELECTRODE_V1,
|
||||
ELECTRODE_V2,
|
||||
ELECTRODE_V3,
|
||||
ELECTRODE_V4,
|
||||
ELECTRODE_V5,
|
||||
ELECTRODE_V6,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum ActiveLeads{
|
||||
#[default]
|
||||
ECG_I,
|
||||
ECG_II,
|
||||
ECG_III,
|
||||
ECG_aVR,
|
||||
ECG_aVL,
|
||||
ECG_aVF,
|
||||
ECG_V,
|
||||
ECG_V1,
|
||||
ECG_V2,
|
||||
ECG_V3,
|
||||
ECG_V4,
|
||||
ECG_V5,
|
||||
ECG_V6,
|
||||
}
|
||||
|
||||
pub impl CECGDStatus {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CECGDStatus{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmECG }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnDATA }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmECGSpecies::CECGDStatus) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmECG for CECGCRhythmReport{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CECGCRhythmReport{
|
||||
leadarrangement:LeadArrangement,
|
||||
defspeedsetting:DefSpeedSetting,
|
||||
stdleadorder:uint8,
|
||||
augleadorder:uint8,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum LeadArrangement{
|
||||
#[default]
|
||||
3LEAD,
|
||||
6LEAD,
|
||||
12LEAD,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum DefSpeedSetting{
|
||||
#[default]
|
||||
10mm_s,
|
||||
25mm_s,
|
||||
50mm_s,
|
||||
}
|
||||
|
||||
pub impl CECGCRhythmReport {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CECGCRhythmReport{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmECG }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnCONFIG }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmECGSpecies::CECGCRhythmReport) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmECG for CECGCAutoReport{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CECGCAutoReport{
|
||||
extmeasurements:boolean,
|
||||
interp:boolean,
|
||||
copieswithint:boolean,
|
||||
unconfreport:boolean,
|
||||
abnormalecg:boolean,
|
||||
fname:boolean,
|
||||
slname:boolean,
|
||||
mi:boolean,
|
||||
wt:boolean,
|
||||
ht:boolean,
|
||||
gender:boolean,
|
||||
race:boolean,
|
||||
med:boolean,
|
||||
clinicalhist:boolean,
|
||||
bp:boolean,
|
||||
comments:boolean,
|
||||
custdef1:boolean,
|
||||
custdef2:boolean,
|
||||
reasonstatementsenabled:boolean,
|
||||
ageformat:AgeFormat,
|
||||
leadarrangement:LeadArrangement,
|
||||
rhythld1:RhythLd1,
|
||||
rhythld2:RhythLd2,
|
||||
rhythld3:RhythLd3,
|
||||
avgcycle:AvgCycle,
|
||||
copies:uint16,
|
||||
custdef1lbl:widechar,
|
||||
custdef2lbl:widechar,
|
||||
physician:boolean,
|
||||
technician:boolean,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum AgeFormat{
|
||||
#[default]
|
||||
DOB,
|
||||
AGE,
|
||||
OFF,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum LeadArrangement{
|
||||
#[default]
|
||||
3X4,
|
||||
3X4_1R,
|
||||
3X4_3R,
|
||||
6X2,
|
||||
12X1,
|
||||
6X2_50mm,
|
||||
6X2_ext,
|
||||
2X6_1R,
|
||||
NOPRINT,
|
||||
6X2_1R,
|
||||
2X6,
|
||||
3x4_25mm_5sec,
|
||||
3x4_50mm,
|
||||
3x4_50mm_5sec,
|
||||
6x2_25mm,
|
||||
6x2_50mm_5sec,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum RhythLd1{
|
||||
#[default]
|
||||
I,
|
||||
II,
|
||||
III,
|
||||
AVR,
|
||||
AVL,
|
||||
AVF,
|
||||
V1,
|
||||
V2,
|
||||
V3,
|
||||
V4,
|
||||
V5,
|
||||
V6,
|
||||
OFF,
|
||||
V7,
|
||||
V3R,
|
||||
V5R,
|
||||
X,
|
||||
Y,
|
||||
Z,
|
||||
V4R,
|
||||
V6R,
|
||||
V8,
|
||||
V9,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum RhythLd2{
|
||||
#[default]
|
||||
I,
|
||||
II,
|
||||
III,
|
||||
AVR,
|
||||
AVL,
|
||||
AVF,
|
||||
V1,
|
||||
V2,
|
||||
V3,
|
||||
V4,
|
||||
V5,
|
||||
V6,
|
||||
OFF,
|
||||
V7,
|
||||
V3R,
|
||||
V5R,
|
||||
X,
|
||||
Y,
|
||||
Z,
|
||||
V4R,
|
||||
V6R,
|
||||
V8,
|
||||
V9,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum RhythLd3{
|
||||
#[default]
|
||||
I,
|
||||
II,
|
||||
III,
|
||||
AVR,
|
||||
AVL,
|
||||
AVF,
|
||||
V1,
|
||||
V2,
|
||||
V3,
|
||||
V4,
|
||||
V5,
|
||||
V6,
|
||||
OFF,
|
||||
V7,
|
||||
V3R,
|
||||
V5R,
|
||||
X,
|
||||
Y,
|
||||
Z,
|
||||
V4R,
|
||||
V6R,
|
||||
V8,
|
||||
V9,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum AvgCycle{
|
||||
#[default]
|
||||
3x4_3R,
|
||||
6x2_6R,
|
||||
NOPRINT,
|
||||
3x4_2R_25mm,
|
||||
3x4_2R,
|
||||
3x4_3R_25mm,
|
||||
2x6_1R_25mm,
|
||||
2x6_1R,
|
||||
6x2_2R,
|
||||
6x2_1R_25mm,
|
||||
6x2_1R,
|
||||
}
|
||||
|
||||
pub impl CECGCAutoReport {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CECGCAutoReport{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmECG }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnCONFIG }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmECGSpecies::CECGCAutoReport) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmECG for CECGCMiscellaneous{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CECGCMiscellaneous{
|
||||
leadconfig:LeadConfig,
|
||||
mains:Mains,
|
||||
autoexport:AutoExport,
|
||||
electrodelbl:ElectrodeLbl,
|
||||
leadtiming:LeadTiming,
|
||||
defgainsetting:DefGainSetting,
|
||||
defmusclefilter:boolean,
|
||||
defbaselinefilter:boolean,
|
||||
baselinecenter:boolean,
|
||||
autosave:boolean,
|
||||
autoreport2:boolean,
|
||||
printartifactreport:boolean,
|
||||
electrodeplacement:ElectrodePlacement,
|
||||
qtcmethod:QTcMethod,
|
||||
savereminder:boolean,
|
||||
disablemains:boolean,
|
||||
ecgautoprint:boolean,
|
||||
ecgsetpatientdemographic:boolean,
|
||||
remotefolderpath:widechar,
|
||||
qrstone:QRSTone,
|
||||
printlabel:PrintLabel,
|
||||
pacerlead:PacerLead,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum LeadConfig{
|
||||
#[default]
|
||||
STANDARD,
|
||||
CABRERA,
|
||||
NEHB,
|
||||
FRANK,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Mains{
|
||||
#[default]
|
||||
OFF,
|
||||
50HZ,
|
||||
60HZ,
|
||||
AUTO,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum AutoExport{
|
||||
#[default]
|
||||
OFF,
|
||||
MEDIACARD,
|
||||
FAA,
|
||||
FAX,
|
||||
WORKSTATION,
|
||||
REMOTE,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum ElectrodeLbl{
|
||||
#[default]
|
||||
AHA,
|
||||
IEC,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum LeadTiming{
|
||||
#[default]
|
||||
SIMOULTANEOUS,
|
||||
SEQUENTIAL,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum DefGainSetting{
|
||||
#[default]
|
||||
5mm_mv,
|
||||
10mm_mv,
|
||||
20mm_mv,
|
||||
AUTO,
|
||||
2mm5_mv,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum ElectrodePlacement{
|
||||
#[default]
|
||||
STANDARD,
|
||||
ALTERNATE,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum QTcMethod{
|
||||
#[default]
|
||||
BAZETT,
|
||||
HODGES,
|
||||
FRIDERICIA,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum QRSTone{
|
||||
#[default]
|
||||
NONE,
|
||||
FREQ_1KHZ,
|
||||
FREQ_2KHZ,
|
||||
FREQ_2K67HZ,
|
||||
FREQ_3K2HZ,
|
||||
FREQ_4KHZ,
|
||||
FREQ_5K3HZ,
|
||||
FREQ_6K4HZ,
|
||||
FREQ_8KHZ,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum PrintLabel{
|
||||
#[default]
|
||||
NONE,
|
||||
PR,
|
||||
PQ,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum PacerLead{
|
||||
#[default]
|
||||
NONE,
|
||||
I,
|
||||
II,
|
||||
V1,
|
||||
V2,
|
||||
V3,
|
||||
V4,
|
||||
V5,
|
||||
V6,
|
||||
V7,
|
||||
V8,
|
||||
V9,
|
||||
V3R,
|
||||
V4R,
|
||||
V5R,
|
||||
V6R,
|
||||
}
|
||||
|
||||
pub impl CECGCMiscellaneous {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CECGCMiscellaneous{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmECG }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnCONFIG }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmECGSpecies::CECGCMiscellaneous) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmECG for CECGCSettings{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CECGCSettings{
|
||||
activeleads:ActiveLeads,
|
||||
mainsfilter:MainsFilter,
|
||||
pacerenabled:boolean,
|
||||
leadmode:LeadMode,
|
||||
vtachthreshold:uint8,
|
||||
impedancerespiration:boolean,
|
||||
asystolethreshold:uint16,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum ActiveLeads{
|
||||
#[default]
|
||||
ECG_I,
|
||||
ECG_II,
|
||||
ECG_III,
|
||||
ECG_aVR,
|
||||
ECG_aVL,
|
||||
ECG_aVF,
|
||||
ECG_V,
|
||||
ECG_V1,
|
||||
ECG_V2,
|
||||
ECG_V3,
|
||||
ECG_V4,
|
||||
ECG_V5,
|
||||
ECG_V6,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum MainsFilter{
|
||||
#[default]
|
||||
NONE,
|
||||
OFF,
|
||||
50HZ,
|
||||
60HZ,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum LeadMode{
|
||||
#[default]
|
||||
NONE,
|
||||
UNKNOWN,
|
||||
3_LEAD,
|
||||
5_LEAD,
|
||||
}
|
||||
|
||||
pub impl CECGCSettings {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CECGCSettings{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmECG }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnCONFIG }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmECGSpecies::CECGCSettings) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmECG for CECGPSelector{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CECGPSelector{
|
||||
speciesselector:uint32,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
pub impl CECGPSelector {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CECGPSelector{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmECG }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnPARAMETER }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmECGSpecies::CECGPSelector) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
use super::MessageSpecies;
|
||||
|
||||
pub enum FmNIBPMessage{
|
||||
GET_BP, //Request 0
|
||||
GET_CONFIG, //Request 1
|
||||
GET_STATUS, //Request 2
|
||||
GET_CALIBRATION, //Request 3
|
||||
GET_BP_SETTINGS, //Request 4
|
||||
GET_CHUNK, //Request 5
|
||||
GET_CHUNK_SIZE, //Request 6
|
||||
GET_MAX_CHUNK_ID, //Request 7
|
||||
GET_HARDWARE_STATE, //Request 8
|
||||
GET_TEST_LOCK, //Request 9
|
||||
GET_RAW_DATA, //Request 10
|
||||
GET_PRESSURE_DATA, //Request 11
|
||||
PUT_BP, //Response 0
|
||||
PUT_CONFIG, //Response 1
|
||||
PUT_STATUS, //Response 2
|
||||
PUT_CALIBRATION, //Response 3
|
||||
PUT_BP_SETTINGS, //Response 4
|
||||
PUT_CHUNK, //Response 5
|
||||
PUT_CHUNK_SIZE, //Response 6
|
||||
PUT_MAX_CHUNK_ID, //Response 7
|
||||
PUT_HARDWARE_STATE, //Response 8
|
||||
PUT_TEST_LOCK, //Response 9
|
||||
PUT_RAW_DATA, //Response 10
|
||||
PUT_PRESSURE_DATA, //Response 11
|
||||
START_NIBP, //Command 0
|
||||
STOP_NIBP, //Command 1
|
||||
WRITE_CONFIG, //Command 2
|
||||
ZERO_NIBP, //Command 3
|
||||
MSG_PUSH_ENABLE, //Command 4
|
||||
CLEAR_SAFTEY_STATUS, //Command 5
|
||||
CLEAR_POST_STATUS, //Command 6
|
||||
RESET_DEVICE, //Command 7
|
||||
SET_CALIBRATION, //Command 8
|
||||
SAVE_CALIBRATION, //Command 9
|
||||
LOAD_CALIBRATION, //Command 10
|
||||
RESTORE_DFLT_CALIBRATION, //Command 11
|
||||
SET_BP_SETTINGS, //Command 12
|
||||
SAVE_BP_SETTINGS, //Command 13
|
||||
LOAD_BP_SETTINGS, //Command 14
|
||||
RESTORE_DFLT_SETTINGS, //Command 15
|
||||
SET_HARDWARE_STATE, //Command 16
|
||||
PULSE_STEP_VALVE, //Command 17
|
||||
SET_TEST_LOCK, //Command 18
|
||||
REPORT_BP, //Status 0
|
||||
REPORT_BP, //Stream 0
|
||||
REPORT_STATUS, //Stream 1
|
||||
}
|
||||
|
||||
impl MessageSpecies for FmNIBPMessage{}
|
|
@ -1,657 +0,0 @@
|
|||
use crate::datatypes;
|
||||
use super::{Object, ObjectSpecies, RawObject};
|
||||
use derive_getters::Getters;
|
||||
use derive_builder::Builder;
|
||||
use downcast_rs::Downcast
|
||||
|
||||
pub trait FmNIBP:Downcast{}
|
||||
|
||||
#[derive(Clone,Debug)]
|
||||
pub enum FmNIBPSpecies{
|
||||
SpSTANDARD,
|
||||
SpDATA,
|
||||
SpENGCHUNK,
|
||||
SpEVENTCHUNK,
|
||||
SpHARDWARESTATE,
|
||||
SpLOCK,
|
||||
SpRAWDATA,
|
||||
SpPRESSUREDATA,
|
||||
SpSTATUS,
|
||||
SpDATAMODIFIED,
|
||||
SpCALIBRATION,
|
||||
SpSELECTOR,
|
||||
SpCHUNK_SELECTOR,
|
||||
}
|
||||
impl ObjectSpecies for FmNIBPSpecies{}
|
||||
|
||||
impl FmNIBP for CNIBPDStd{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CNIBPDStd{
|
||||
stime:chrono::NaiveDateTime,
|
||||
status:Status,
|
||||
systolic:int16,
|
||||
diastolic:int16,
|
||||
map:int16,
|
||||
hr:uint16,
|
||||
extstatus:ExtStatus,
|
||||
source:Source,
|
||||
mode:Mode,
|
||||
method:Method,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Status{
|
||||
#[default]
|
||||
DATA_NOT_AVAIL,
|
||||
DATA_COMPLETE,
|
||||
DATA_FAILURE,
|
||||
DATA_EXCEPTION,
|
||||
DATA_PROCESSING,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum ExtStatus{
|
||||
#[default]
|
||||
NONE,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Source{
|
||||
#[default]
|
||||
NONE,
|
||||
UNKNOWN,
|
||||
CVSM,
|
||||
MODB,
|
||||
MODF,
|
||||
POEM,
|
||||
MODG,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Mode{
|
||||
#[default]
|
||||
NONE,
|
||||
UNKNOWN,
|
||||
ADULT,
|
||||
NEONATAL,
|
||||
PEDIATRIC,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Method{
|
||||
#[default]
|
||||
NONE,
|
||||
UNKNOWN,
|
||||
MANUAL,
|
||||
DEVICE,
|
||||
REMOTE,
|
||||
FAST_BP,
|
||||
STEP_BP,
|
||||
NEONATAL_STEP_BP,
|
||||
LINEAR_DEFLATION_BP,
|
||||
AVERAGE_BP,
|
||||
}
|
||||
|
||||
pub impl CNIBPDStd {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CNIBPDStd{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmNIBP }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnDATA }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmNIBPSpecies::CNIBPDStd) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmNIBP for CNIBPDData{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CNIBPDData{
|
||||
status:Status,
|
||||
systolic:OBJECT::CNumDStd,
|
||||
diastolic:OBJECT::CNumDStd,
|
||||
map:OBJECT::CNumDStd,
|
||||
pr:OBJECT::CNumDStd,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Status{
|
||||
#[default]
|
||||
RD_OK,
|
||||
RD_ABORT,
|
||||
RD_NOT_AVAIL,
|
||||
RD_SPLAT,
|
||||
RD_ARTIFACT,
|
||||
RD_LOW_INFLAT,
|
||||
RD_KINKED_TUBE,
|
||||
RD_EARLY_DUMP,
|
||||
RD_NOT_ENOUGH_DATA,
|
||||
RD_PATIENT_INVALID,
|
||||
RD_REINF_TOO_LATE,
|
||||
RD_REINF_LIMIT,
|
||||
RD_BLEED,
|
||||
RD_LEAK,
|
||||
RD_SAFETY_FAULT,
|
||||
RD_ZERO_FAULT,
|
||||
}
|
||||
|
||||
pub impl CNIBPDData {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CNIBPDData{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmNIBP }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnDATA }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmNIBPSpecies::CNIBPDData) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmNIBP for CNIBPDChunk{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CNIBPDChunk{
|
||||
tag:int8,
|
||||
chunkid:uint16,
|
||||
chunkindex:uint16,
|
||||
chunkdata:uint8,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
pub impl CNIBPDChunk {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CNIBPDChunk{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmNIBP }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnDATA }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmNIBPSpecies::CNIBPDChunk) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmNIBP for CNIBPDHState{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CNIBPDHState{
|
||||
hardware:hardware,
|
||||
state:int16,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum hardware{
|
||||
#[default]
|
||||
PRIM_VALVE,
|
||||
SEC_VALVE,
|
||||
PUMP,
|
||||
}
|
||||
|
||||
pub impl CNIBPDHState {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CNIBPDHState{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmNIBP }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnDATA }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmNIBPSpecies::CNIBPDHState) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmNIBP for CNIBPDLock{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CNIBPDLock{
|
||||
lock:lock,
|
||||
state:int8,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum lock{
|
||||
#[default]
|
||||
AMB_TEMP_CHECK,
|
||||
PRIM_SAFETY_CHECK,
|
||||
SAFE_SAFETY_CHECK,
|
||||
SINGLE_LUMEN_CHECK,
|
||||
AD_CHANNEL,
|
||||
FAILSAFE_TEST_MODE,
|
||||
}
|
||||
|
||||
pub impl CNIBPDLock {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CNIBPDLock{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmNIBP }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnDATA }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmNIBPSpecies::CNIBPDLock) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmNIBP for CNIBPDRData{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CNIBPDRData{
|
||||
raw5v:uint32,
|
||||
raw1v:uint32,
|
||||
raw2v:uint32,
|
||||
raw4v:uint32,
|
||||
rawbat:int16,
|
||||
rawambtemp:uint32,
|
||||
rawprimtrans:uint32,
|
||||
rawsectrans:int16,
|
||||
rawsecbat:int16,
|
||||
rawseccorr:int16,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
pub impl CNIBPDRData {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CNIBPDRData{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmNIBP }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnDATA }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmNIBPSpecies::CNIBPDRData) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmNIBP for CNIBPDPData{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CNIBPDPData{
|
||||
primpress:int16,
|
||||
primpressnoise:int16,
|
||||
primazerooffset:int16,
|
||||
secpress:int16,
|
||||
secpressnoise:int16,
|
||||
secazerooffset:int16,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
pub impl CNIBPDPData {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CNIBPDPData{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmNIBP }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnDATA }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmNIBPSpecies::CNIBPDPData) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmNIBP for CNIBPDStatus{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CNIBPDStatus{
|
||||
modulestate:moduleState,
|
||||
error:uint16,
|
||||
hardwarestates:uint16,
|
||||
safetystates:safetyStates,
|
||||
cuffpressure:int16,
|
||||
batvoltage:int16,
|
||||
ambtemp:int16,
|
||||
statustype:statusType,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum moduleState{
|
||||
#[default]
|
||||
IDLE,
|
||||
AUTOZERO,
|
||||
INFLATING,
|
||||
STABILIZING,
|
||||
BLEEDING,
|
||||
DUMPING,
|
||||
REPUMP,
|
||||
ERROR,
|
||||
BOOT,
|
||||
POST,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum safetyStates{
|
||||
#[default]
|
||||
belowResidual,
|
||||
longAutoTimerClear,
|
||||
statAutoTimerClear,
|
||||
failsafeFault,
|
||||
autoZeroFault,
|
||||
transducerFault,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum statusType{
|
||||
#[default]
|
||||
NONE,
|
||||
PRIMARY,
|
||||
SECONDARY,
|
||||
}
|
||||
|
||||
pub impl CNIBPDStatus {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CNIBPDStatus{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmNIBP }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnDATA }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmNIBPSpecies::CNIBPDStatus) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmNIBP for CNIBPDDataModified{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CNIBPDDataModified{
|
||||
nibpdata:OBJECT::CNIBPDData,
|
||||
status:Status,
|
||||
stime:chrono::NaiveDateTime,
|
||||
mode:Mode,
|
||||
patientposition:PatientPosition,
|
||||
cuffsize:CuffSize,
|
||||
cufflocation:CuffLocation,
|
||||
source:Source,
|
||||
method:Method,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Status{
|
||||
#[default]
|
||||
DATA_NOT_AVAIL,
|
||||
DATA_COMPLETE,
|
||||
DATA_FAILURE,
|
||||
DATA_EXCEPTION,
|
||||
DATA_PROCESSING,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Mode{
|
||||
#[default]
|
||||
NONE,
|
||||
UNKNOWN,
|
||||
ADULT,
|
||||
NEONATAL,
|
||||
PEDIATRIC,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum PatientPosition{
|
||||
#[default]
|
||||
NONE,
|
||||
UNKNOWN,
|
||||
LYING,
|
||||
SITTING,
|
||||
STANDING,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum CuffSize{
|
||||
#[default]
|
||||
NONE,
|
||||
UNKNOWN,
|
||||
NEONATAL_1,
|
||||
NEONATAL_2,
|
||||
NEONATAL_3,
|
||||
NEONATAL_4,
|
||||
NEONATAL_5,
|
||||
SMALL_INFANT,
|
||||
INFANT,
|
||||
SMALL_CHILD,
|
||||
CHILD,
|
||||
SMALL_ADULT,
|
||||
ADULT,
|
||||
ADULT_LONG,
|
||||
LARGE_ADULT,
|
||||
LARGE_ADULT_LONG,
|
||||
THIGH,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum CuffLocation{
|
||||
#[default]
|
||||
NONE,
|
||||
UNKNOWN,
|
||||
LEFT_ARM,
|
||||
RIGHT_ARM,
|
||||
LEFT_LEG,
|
||||
RIGHT_LEG,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Source{
|
||||
#[default]
|
||||
NONE,
|
||||
UNKNOWN,
|
||||
CVSM,
|
||||
MODB,
|
||||
MODF,
|
||||
POEM,
|
||||
MODG,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Method{
|
||||
#[default]
|
||||
NONE,
|
||||
UNKNOWN,
|
||||
MANUAL,
|
||||
DEVICE,
|
||||
REMOTE,
|
||||
FAST_BP,
|
||||
STEP_BP,
|
||||
NEONATAL_STEP_BP,
|
||||
LINEAR_DEFLATION_BP,
|
||||
AVERAGE_BP,
|
||||
}
|
||||
|
||||
pub impl CNIBPDDataModified {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CNIBPDDataModified{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmNIBP }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnDATA }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmNIBPSpecies::CNIBPDDataModified) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmNIBP for CNIBPCStd{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CNIBPCStd{
|
||||
displayunits:DisplayUnits,
|
||||
mapdisplay:MAPDisplay,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum DisplayUnits{
|
||||
#[default]
|
||||
NIBP_MMHG,
|
||||
NIBP_KPA,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum MAPDisplay{
|
||||
#[default]
|
||||
DISABLE,
|
||||
ENABLE,
|
||||
}
|
||||
|
||||
pub impl CNIBPCStd {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CNIBPCStd{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmNIBP }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnCONFIG }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmNIBPSpecies::CNIBPCStd) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmNIBP for CNIBPCData{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CNIBPCData{
|
||||
dfltadulttargpress:int16,
|
||||
dfltpedtargpress:int16,
|
||||
dfltneotargpress:int16,
|
||||
pedmaxpresslimit:int16,
|
||||
residualmaxpresslimit:int16,
|
||||
dfltpatientmode:dfltPatientMode,
|
||||
dfltadultalg:int8,
|
||||
dfltpedalg:int8,
|
||||
dfltneoalg:int8,
|
||||
saoenabled:boolean,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum dfltPatientMode{
|
||||
#[default]
|
||||
ADULT,
|
||||
PEDIATRIC,
|
||||
NEONATE,
|
||||
}
|
||||
|
||||
pub impl CNIBPCData {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CNIBPCData{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmNIBP }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnCONFIG }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmNIBPSpecies::CNIBPCData) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmNIBP for CNIBPCCal{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CNIBPCCal{
|
||||
caltype:calType,
|
||||
calsignature:int32,
|
||||
caldatetime:chrono::NaiveDateTime,
|
||||
modconfig:int16,
|
||||
spancorr:int16,
|
||||
zerocorr:int16,
|
||||
battcal:int16,
|
||||
tempcal:int16,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum calType{
|
||||
#[default]
|
||||
NONE,
|
||||
PRIMARY,
|
||||
SECONDARY,
|
||||
}
|
||||
|
||||
pub impl CNIBPCCal {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CNIBPCCal{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmNIBP }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnCONFIG }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmNIBPSpecies::CNIBPCCal) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmNIBP for CNIBPPData{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CNIBPPData{
|
||||
targpress:int16,
|
||||
patientmode:patientMode,
|
||||
cyclemode:cycleMode,
|
||||
algorithm:algorithm,
|
||||
disableneocheck:int8,
|
||||
firstreading:boolean,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum patientMode{
|
||||
#[default]
|
||||
DEFAULT,
|
||||
ADULT,
|
||||
PEDIATRIC,
|
||||
NEONATE,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum cycleMode{
|
||||
#[default]
|
||||
MANUAL,
|
||||
LONG_AUTO,
|
||||
STAT,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum algorithm{
|
||||
#[default]
|
||||
DEFAULT,
|
||||
FAST_BP,
|
||||
STEP_BP,
|
||||
NEO_BP,
|
||||
}
|
||||
|
||||
pub impl CNIBPPData {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CNIBPPData{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmNIBP }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnPARAMETER }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmNIBPSpecies::CNIBPPData) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmNIBP for CNIBPPSelector{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CNIBPPSelector{
|
||||
value:uint32,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
pub impl CNIBPPSelector {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CNIBPPSelector{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmNIBP }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnPARAMETER }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmNIBPSpecies::CNIBPPSelector) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmNIBP for CNIBPPChunkSelector{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CNIBPPChunkSelector{
|
||||
chunk:uint32,
|
||||
index:uint32,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
pub impl CNIBPPChunkSelector {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CNIBPPChunkSelector{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmNIBP }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnPARAMETER }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmNIBPSpecies::CNIBPPChunkSelector) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmNIBP for CNIBPDExtStd{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CNIBPDExtStd{
|
||||
container:OBJECT::ANY_CLASS,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
pub impl CNIBPDExtStd {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CNIBPDExtStd{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmNIBP }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnDATAEXT }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmNIBPSpecies::CNIBPDExtStd) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
use super::MessageSpecies;
|
||||
|
||||
pub enum FmSPO2Message{
|
||||
GET_SPO2, //Request 0
|
||||
GET_CONFIG, //Request 1
|
||||
PUT_SPO2, //Response 0
|
||||
PUT_CONFIG, //Response 1
|
||||
WRITE_CONFIG, //Command 0
|
||||
START_ACQUIRE, //Command 1
|
||||
STOP_ACQUIRE, //Command 2
|
||||
REPORT_SPO2, //Status 0
|
||||
STREAM_SPO2, //Stream 0
|
||||
}
|
||||
|
||||
impl MessageSpecies for FmSPO2Message{}
|
|
@ -1,375 +0,0 @@
|
|||
use crate::datatypes;
|
||||
use super::{Object, ObjectSpecies, RawObject};
|
||||
use derive_getters::Getters;
|
||||
use derive_builder::Builder;
|
||||
use downcast_rs::Downcast
|
||||
|
||||
pub trait FmSPO2:Downcast{}
|
||||
|
||||
#[derive(Clone,Debug)]
|
||||
pub enum FmSPO2Species{
|
||||
SpSTANDARD,
|
||||
SpDATA,
|
||||
SpDATAMODIFIED,
|
||||
SpSELECTOR,
|
||||
}
|
||||
impl ObjectSpecies for FmSPO2Species{}
|
||||
|
||||
impl FmSPO2 for CSpO2DStd{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CSpO2DStd{
|
||||
stime:chrono::NaiveDateTime,
|
||||
status:Status,
|
||||
sat:uint16,
|
||||
hr:uint16,
|
||||
extstatus:ExtStatus,
|
||||
source:Source,
|
||||
mode:Mode,
|
||||
method:Method,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Status{
|
||||
#[default]
|
||||
DATA_NOT_AVAIL,
|
||||
DATA_COMPLETE,
|
||||
DATA_FAILURE,
|
||||
DATA_EXCEPTION,
|
||||
DATA_PROCESSING,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum ExtStatus{
|
||||
#[default]
|
||||
NONE,
|
||||
SPO2_NOPROBE,
|
||||
SPO2_NOTAVAIL,
|
||||
SPO2_OUT_OF_TRACK,
|
||||
SPO2_BAD,
|
||||
SPO2_WAIT,
|
||||
SPO2_SENSOR_BAD,
|
||||
SPO2_FROZEN,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Source{
|
||||
#[default]
|
||||
NONE,
|
||||
UNKNOWN,
|
||||
NONIN,
|
||||
NELLCOR_MP205,
|
||||
NELLCOR_MP506,
|
||||
MASIMO_MS11,
|
||||
NELLCOR_NELL3,
|
||||
NELLCOR_NELL1,
|
||||
MASIMO_MS2011,
|
||||
MASIMO_MX,
|
||||
NELLCOR,
|
||||
NELLCOR_PMB05N,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Mode{
|
||||
#[default]
|
||||
NONE,
|
||||
UNKNOWN,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Method{
|
||||
#[default]
|
||||
NONE,
|
||||
UNKNOWN,
|
||||
MANUAL,
|
||||
DEVICE,
|
||||
REMOTE,
|
||||
}
|
||||
|
||||
pub impl CSpO2DStd {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CSpO2DStd{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmSPO2 }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnDATA }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmSPO2Species::CSpO2DStd) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmSPO2 for CSpO2DData{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CSpO2DData{
|
||||
stime:chrono::NaiveDateTime,
|
||||
extstatus:ExtStatus,
|
||||
source:Source,
|
||||
sat:OBJECT::CNumDStd,
|
||||
hr:OBJECT::CNumDStd,
|
||||
pi:OBJECT::CNumDStd,
|
||||
status:Status,
|
||||
elapsedsatseconds:OBJECT::CNumDStd,
|
||||
totalsatseconds:OBJECT::CNumDStd,
|
||||
satconfidence:OBJECT::CNumDStd,
|
||||
hrconfidence:OBJECT::CNumDStd,
|
||||
piconfidence:OBJECT::CNumDStd,
|
||||
pviconfidence:OBJECT::CNumDStd,
|
||||
pvi:OBJECT::CNumDStd,
|
||||
mode:Mode,
|
||||
method:Method,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum ExtStatus{
|
||||
#[default]
|
||||
PULSE_FOUND,
|
||||
SEARCHING_FOR_BOARD,
|
||||
NO_PROBE,
|
||||
INCORRECT_PROBE,
|
||||
SEARCHING_FOR_PULSE,
|
||||
BAD_PROBE,
|
||||
PROBE_EXPIRED,
|
||||
NO_CABLE,
|
||||
INCORRECT_CABLE,
|
||||
BAD_CABLE,
|
||||
CABLE_EXPIRED,
|
||||
VALUE_NOT_ACQUIRED,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Source{
|
||||
#[default]
|
||||
NONE,
|
||||
UNKNOWN,
|
||||
NONIN,
|
||||
NELLCOR_MP205,
|
||||
NELLCOR_MP506,
|
||||
MASIMO_MS11,
|
||||
NELLCOR_NELL3,
|
||||
NELLCOR_NELL1,
|
||||
MASIMO_MS2011,
|
||||
MASIMO_MX,
|
||||
NELLCOR,
|
||||
NELLCOR_PMB05N,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Status{
|
||||
#[default]
|
||||
DATA_NOT_AVAIL,
|
||||
DATA_COMPLETE,
|
||||
DATA_FAILURE,
|
||||
DATA_EXCEPTION,
|
||||
DATA_PROCESSING,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Mode{
|
||||
#[default]
|
||||
NONE,
|
||||
UNKNOWN,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Method{
|
||||
#[default]
|
||||
NONE,
|
||||
UNKNOWN,
|
||||
MANUAL,
|
||||
DEVICE,
|
||||
REMOTE,
|
||||
}
|
||||
|
||||
pub impl CSpO2DData {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CSpO2DData{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmSPO2 }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnDATA }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmSPO2Species::CSpO2DData) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmSPO2 for CSpO2DDataModified{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CSpO2DDataModified{
|
||||
spo2data:OBJECT::CSpO2DData,
|
||||
o2flowrate:uint8,
|
||||
o2concentration:uint8,
|
||||
o2method:O2Method,
|
||||
location:Location,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum O2Method{
|
||||
#[default]
|
||||
NONE,
|
||||
UNKNOWN,
|
||||
AEROSOL_HUMIDIFIED_MASK,
|
||||
FACE_TENT,
|
||||
MASK,
|
||||
NASAL_CANNULA,
|
||||
NON_REBREATHER,
|
||||
PARTIAL_REBREATHER,
|
||||
T_PIECE,
|
||||
TRACHEOSTOMY_COLLAR,
|
||||
VENTILATOR,
|
||||
VENTURI_MASK,
|
||||
ROOM_AIR,
|
||||
OXYMIZER,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Location{
|
||||
#[default]
|
||||
NONE,
|
||||
UNKNOWN,
|
||||
EAR,
|
||||
FINGER,
|
||||
TOE,
|
||||
FOREHEAD,
|
||||
}
|
||||
|
||||
pub impl CSpO2DDataModified {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CSpO2DDataModified{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmSPO2 }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnDATA }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmSPO2Species::CSpO2DDataModified) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmSPO2 for CSpO2CStd{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CSpO2CStd{
|
||||
enabled:boolean,
|
||||
installedmodule:InstalledModule,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum InstalledModule{
|
||||
#[default]
|
||||
NONE,
|
||||
UNKNOWN,
|
||||
NONIN,
|
||||
NELLCOR_MP205,
|
||||
NELLCOR_MP506,
|
||||
MASIMO_MS11,
|
||||
NELLCOR_NELL3,
|
||||
NELLCOR_NELL1,
|
||||
MASIMO_MS2011,
|
||||
MASIMO_MX,
|
||||
NELLCOR,
|
||||
NELLCOR_PMB05N,
|
||||
}
|
||||
|
||||
pub impl CSpO2CStd {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CSpO2CStd{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmSPO2 }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnCONFIG }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmSPO2Species::CSpO2CStd) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmSPO2 for CSpO2CData{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CSpO2CData{
|
||||
satexponent:int8,
|
||||
piexponent:int8,
|
||||
satalarms:OBJECT::CNumCStd,
|
||||
hralarms:OBJECT::CNumCStd,
|
||||
fastsat:FastSat,
|
||||
sensitivity:Sensitivity,
|
||||
averagingtime:AveragingTime,
|
||||
satsecondslimit:SatSecondsLimit,
|
||||
smarttone:SmartTone,
|
||||
pviexponent:int8,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum FastSat{
|
||||
#[default]
|
||||
NONE,
|
||||
OFF,
|
||||
ON,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Sensitivity{
|
||||
#[default]
|
||||
NONE,
|
||||
NORMAL,
|
||||
MAXIMUM,
|
||||
APOD,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum AveragingTime{
|
||||
#[default]
|
||||
NONE,
|
||||
2_TO_4_SEC,
|
||||
4_TO_6_SEC,
|
||||
8_SEC,
|
||||
10_SEC,
|
||||
12_SEC,
|
||||
14_SEC,
|
||||
16_SEC,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum SatSecondsLimit{
|
||||
#[default]
|
||||
NONE,
|
||||
DISABLED,
|
||||
10_SEC,
|
||||
25_SEC,
|
||||
50_SEC,
|
||||
100_SEC,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum SmartTone{
|
||||
#[default]
|
||||
NONE,
|
||||
OFF,
|
||||
ON,
|
||||
}
|
||||
|
||||
pub impl CSpO2CData {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CSpO2CData{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmSPO2 }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnCONFIG }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmSPO2Species::CSpO2CData) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmSPO2 for CSpO2PSelector{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CSpO2PSelector{
|
||||
value:uint32,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
pub impl CSpO2PSelector {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CSpO2PSelector{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmSPO2 }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnPARAMETER }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmSPO2Species::CSpO2PSelector) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
|
@ -1,59 +0,0 @@
|
|||
use super::MessageSpecies;
|
||||
|
||||
pub enum FmTEMPMessage{
|
||||
GET_TEMP, //Request 0
|
||||
GET_CONFIG, //Request 1
|
||||
GET_ENG_STATUS, //Request 2
|
||||
STATUS, //Request 3
|
||||
GET_PROBE_INFO, //Request 4
|
||||
GET_CALIBRATION, //Request 5
|
||||
GET_SETTINGS, //Request 6
|
||||
GET_HARDWARE_STATE, //Request 7
|
||||
GET_TEST_LOCK, //Request 8
|
||||
GET_RAW_DATA, //Request 9
|
||||
GET_SAMPLE, //Request 10
|
||||
GET_TOUCH, //Request 11
|
||||
GET_THERM, //Request 12
|
||||
GET_THERMOMETER_SETTINGS, //Request 13
|
||||
PUT_TEMP, //Response 0
|
||||
PUT_CONFIG, //Response 1
|
||||
PUT_ENG_STATUS, //Response 2
|
||||
PUT_STATUS, //Response 3
|
||||
PUT_PROBE_INFO, //Response 4
|
||||
PUT_CALIBRATION, //Response 5
|
||||
PUT_SETTINGS, //Response 6
|
||||
PUT_HARDWARE_STATE, //Response 7
|
||||
PUT_TEST_LOCK, //Response 8
|
||||
PUT_RAW_DATA, //Response 9
|
||||
PUT_SAMPLE, //Response 10
|
||||
PUT_TOUCH, //Response 11
|
||||
PUT_THERM, //Response 12
|
||||
PUT_THERMOMETER_SETTINGS, //Response 13
|
||||
WRITE_CONFIG, //Command 0
|
||||
MSG_PUSH_ENABLE, //Command 1
|
||||
MSG_SET_ALG, //Command 2
|
||||
MSG_SET_MODE, //Command 3
|
||||
RESET_DEVICE, //Command 4
|
||||
SET_CALIBRATION, //Command 5
|
||||
SAVE_CALIBRATION, //Command 6
|
||||
LOAD_CALIBRATION, //Command 7
|
||||
RESTORE_DFLT_CALIBRATION, //Command 8
|
||||
SET_SETTINGS, //Command 9
|
||||
SAVE_SETTINGS, //Command 10
|
||||
LOAD_SETTINGS, //Command 11
|
||||
RESTORE_DFLT_SETTINGS, //Command 12
|
||||
SET_HARDWARE_STATE, //Command 13
|
||||
SET_TEST_LOCK, //Command 14
|
||||
SET_THERM, //Command 15
|
||||
START_ACQUIRE, //Command 16
|
||||
STOP_ACQUIRE, //Command 17
|
||||
WRITE_THERMOMETER_SETTINGS, //Command 18
|
||||
REPORT_TEMPERATURE, //Status 0
|
||||
REPORT_ENG_STATUS, //Stream 0
|
||||
REPORT_STATUS, //Stream 1
|
||||
REPORT_SAMPLE, //Stream 2
|
||||
REPORT_TOUCH, //Stream 3
|
||||
REPORT_THERM, //Stream 4
|
||||
}
|
||||
|
||||
impl MessageSpecies for FmTEMPMessage{}
|
|
@ -1,850 +0,0 @@
|
|||
use crate::datatypes;
|
||||
use super::{Object, ObjectSpecies, RawObject};
|
||||
use derive_getters::Getters;
|
||||
use derive_builder::Builder;
|
||||
use downcast_rs::Downcast
|
||||
|
||||
pub trait FmTEMP:Downcast{}
|
||||
|
||||
#[derive(Clone,Debug)]
|
||||
pub enum FmTEMPSpecies{
|
||||
SpSTANDARD,
|
||||
SpDATA,
|
||||
SpENGDATA,
|
||||
SpPROBEDATA,
|
||||
SpHARDWARESTATE,
|
||||
SpLOCK,
|
||||
SpRAWDATA,
|
||||
SpSTATUS,
|
||||
SpADSAMPLEDATA,
|
||||
SpTOUCHDATA,
|
||||
SpTHERMDATA,
|
||||
SpCALIBRATION,
|
||||
SpMSG_ARGUMENTS,
|
||||
SpSELECTOR,
|
||||
}
|
||||
impl ObjectSpecies for FmTEMPSpecies{}
|
||||
|
||||
impl FmTEMP for CTempDStd{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CTempDStd{
|
||||
stime:chrono::NaiveDateTime,
|
||||
status:Status,
|
||||
extstatus:ExtStatus,
|
||||
source:Source,
|
||||
mode:Mode,
|
||||
method:Method,
|
||||
temperature:float,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Status{
|
||||
#[default]
|
||||
DATA_NOT_AVAIL,
|
||||
DATA_COMPLETE,
|
||||
DATA_FAILURE,
|
||||
DATA_EXCEPTION,
|
||||
DATA_PROCESSING,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum ExtStatus{
|
||||
#[default]
|
||||
NONE,
|
||||
FINAL_POSITION,
|
||||
FINAL_OVER_TEMP,
|
||||
FINAL_OVER_TEMP_POSITION,
|
||||
FINAL_UNDER_TEMP,
|
||||
FINAL_UNDER_TEMP_POSITION,
|
||||
MONITOR_POSITION,
|
||||
MONITOR_OVER_TEMP,
|
||||
MONITOR_OVER_TEMP_POSITION,
|
||||
MONITOR_UNDER_TEMP,
|
||||
MONITOR_UNDER_TEMP_POSITION,
|
||||
CRC_FAILURE,
|
||||
COMM_FAILURE,
|
||||
FINAL_UNADJUSTED,
|
||||
BUTTON_RANGE_ERROR,
|
||||
AMB_RANGE_ERROR,
|
||||
ENTRY_RANGE_ERROR,
|
||||
TT_RANGE_ERROR,
|
||||
TT_SLOPE_RANGE_ERROR,
|
||||
OUTPUT_RANGE_ERROR,
|
||||
CAP_STABILITY_ERROR,
|
||||
CAP_ENTRY_ERROR,
|
||||
PREMATURE_BUTTON_PRESS,
|
||||
CALIBRATION,
|
||||
UNADJUSTED_NO_OFFSETS,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Source{
|
||||
#[default]
|
||||
NONE,
|
||||
UNKNOWN,
|
||||
SURETEMP_SW,
|
||||
SURETEMP,
|
||||
SURETEMP_PLUS,
|
||||
BRAUN_PRO4000,
|
||||
BRAUN_PRO6000,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Mode{
|
||||
#[default]
|
||||
NONE,
|
||||
UNKNOWN,
|
||||
ORAL,
|
||||
RECTAL,
|
||||
PED_AXIL,
|
||||
CAL_KEY,
|
||||
ADULT_AXIL,
|
||||
TYMPANIC,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Method{
|
||||
#[default]
|
||||
NONE,
|
||||
UNKNOWN,
|
||||
MANUAL,
|
||||
DEVICE,
|
||||
REMOTE,
|
||||
PREDICT,
|
||||
MONITOR,
|
||||
IR,
|
||||
BRAUN_CALC,
|
||||
TECHNIQUE_COMPENSATION_CALC,
|
||||
}
|
||||
|
||||
pub impl CTempDStd {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CTempDStd{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmTEMP }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnDATA }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmTEMPSpecies::CTempDStd) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmTEMP for CTempDData{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CTempDData{
|
||||
stime:chrono::NaiveDateTime,
|
||||
status:Status,
|
||||
extstatus:ExtStatus,
|
||||
source:Source,
|
||||
mode:Mode,
|
||||
method:Method,
|
||||
temperature:OBJECT::CNumDFloat,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Status{
|
||||
#[default]
|
||||
DATA_NOT_AVAIL,
|
||||
DATA_COMPLETE,
|
||||
DATA_FAILURE,
|
||||
DATA_EXCEPTION,
|
||||
DATA_PROCESSING,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum ExtStatus{
|
||||
#[default]
|
||||
NONE,
|
||||
FINAL_POSITION,
|
||||
FINAL_OVER_TEMP,
|
||||
FINAL_OVER_TEMP_POSITION,
|
||||
FINAL_UNDER_TEMP,
|
||||
FINAL_UNDER_TEMP_POSITION,
|
||||
MONITOR_POSITION,
|
||||
MONITOR_OVER_TEMP,
|
||||
MONITOR_OVER_TEMP_POSITION,
|
||||
MONITOR_UNDER_TEMP,
|
||||
MONITOR_UNDER_TEMP_POSITION,
|
||||
CRC_FAILURE,
|
||||
COMM_FAILURE,
|
||||
FINAL_UNADJUSTED,
|
||||
BUTTON_RANGE_ERROR,
|
||||
AMB_RANGE_ERROR,
|
||||
ENTRY_RANGE_ERROR,
|
||||
TT_RANGE_ERROR,
|
||||
TT_SLOPE_RANGE_ERROR,
|
||||
OUTPUT_RANGE_ERROR,
|
||||
CAP_STABILITY_ERROR,
|
||||
CAP_ENTRY_ERROR,
|
||||
PREMATURE_BUTTON_PRESS,
|
||||
CALIBRATION,
|
||||
UNADJUSTED_NO_OFFSETS,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Source{
|
||||
#[default]
|
||||
NONE,
|
||||
UNKNOWN,
|
||||
SURETEMP_SW,
|
||||
SURETEMP,
|
||||
SURETEMP_PLUS,
|
||||
BRAUN_PRO4000,
|
||||
BRAUN_PRO6000,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Mode{
|
||||
#[default]
|
||||
NONE,
|
||||
UNKNOWN,
|
||||
ORAL,
|
||||
RECTAL,
|
||||
PED_AXIL,
|
||||
CAL_KEY,
|
||||
ADULT_AXIL,
|
||||
TYMPANIC,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Method{
|
||||
#[default]
|
||||
NONE,
|
||||
UNKNOWN,
|
||||
MANUAL,
|
||||
DEVICE,
|
||||
REMOTE,
|
||||
PREDICT,
|
||||
MONITOR,
|
||||
IR,
|
||||
BRAUN_CALC,
|
||||
TECHNIQUE_COMPENSATION_CALC,
|
||||
}
|
||||
|
||||
pub impl CTempDData {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CTempDData{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmTEMP }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnDATA }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmTEMPSpecies::CTempDData) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmTEMP for CSTPTempDEng{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CSTPTempDEng{
|
||||
temp:float,
|
||||
probe_temp:float,
|
||||
heater:uint16,
|
||||
reserved_1:uint16,
|
||||
method:method,
|
||||
algo:algo,
|
||||
status:status,
|
||||
error:error,
|
||||
active:uint8,
|
||||
probe_type:probe_type,
|
||||
resistance:float,
|
||||
ambient_temp:float,
|
||||
ptb_resistance:float,
|
||||
battery:uint16,
|
||||
probe_temp_min:float,
|
||||
probe_temp_max:float,
|
||||
complete:uint8,
|
||||
sample:uint32,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum method{
|
||||
#[default]
|
||||
PREDICT,
|
||||
MONITOR,
|
||||
CLINICAL,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum algo{
|
||||
#[default]
|
||||
NONE,
|
||||
ORAL_ALG,
|
||||
PED_AX_ALG,
|
||||
ADULT_AX_ALG,
|
||||
RECTAL_ALG,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum status{
|
||||
#[default]
|
||||
IDLE,
|
||||
NOT_READY,
|
||||
READY,
|
||||
PREDICT,
|
||||
PREDICT_DISPLAY,
|
||||
PREDICT_POS,
|
||||
FINAL,
|
||||
FINAL_POS,
|
||||
FINAL_OVER_TEMP,
|
||||
FINAL_UNDER_TEMP,
|
||||
FINAL_OVER_TEMP_POS,
|
||||
FINAL_UNDER_TEMP_POS,
|
||||
NO_PREDICT,
|
||||
ERROR,
|
||||
MONITOR,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum error{
|
||||
#[default]
|
||||
NO_ERROR,
|
||||
ERROR_ALG_PROBE_OVER_TEMP,
|
||||
ERROR_ALG_EXCESSIVE_HTR_ENERGY,
|
||||
ERROR_ALG_OVER_AMB_TEMP,
|
||||
ERROR_ALG_UNDER_AMB_TEMP,
|
||||
ERROR_ALG_NO_PROBE_TEMP_RISE,
|
||||
ERROR_ALG_BAD_PROBE_GAIN,
|
||||
ERROR_ALG_BAD_PROBE_RESP_VAL,
|
||||
ERROR_HTR_ON_NOT_OFF,
|
||||
ERROR_HTR_OFF_NOT_ON,
|
||||
ERROR_HTR_VOLT_HIGH_Q,
|
||||
ERROR_HTR_VOLT_Q_HIGH_IMP,
|
||||
ERROR_HTR_VOLT_LOW,
|
||||
ERROR_HTR_FAILSAFE,
|
||||
ERROR_AD_PULSE_LONG,
|
||||
ERROR_AD_PULSE_SHORT,
|
||||
ERROR_AD_RCAL_LONG,
|
||||
ERROR_AD_RCAL_SHORT,
|
||||
ERROR_AD_PTB_OVER,
|
||||
ERROR_AD_PTB_UNDER,
|
||||
ERROR_AD_TIMEOUT,
|
||||
ERROR_CFG_XFER,
|
||||
ERROR_CFG_SET_CRC,
|
||||
ERROR_CFG_PROBE_CRC,
|
||||
ERROR_CFG_CAL_CRC,
|
||||
ERROR_CFG_LOG_CRC,
|
||||
ERROR_CFG_NO_PROBE,
|
||||
ERROR_CFG_UNIT_PROBE,
|
||||
ERROR_CFG_ACK,
|
||||
ERROR_CFG_INIT,
|
||||
ERROR_BAT_HIGH,
|
||||
ERROR_BAT_LOW,
|
||||
ERROR_BAD_VIBES,
|
||||
ERROR_NO_PROBE_WELL,
|
||||
ERROR_POST_FAIL,
|
||||
ERROR_INTERNAL_FAULT,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum probe_type{
|
||||
#[default]
|
||||
NO_PROBE,
|
||||
ORAL,
|
||||
RECTAL,
|
||||
CALKEY,
|
||||
}
|
||||
|
||||
pub impl CSTPTempDEng {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CSTPTempDEng{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmTEMP }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnDATA }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmTEMPSpecies::CSTPTempDEng) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmTEMP for CSTPDProbe{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CSTPDProbe{
|
||||
probetype:probeType,
|
||||
partnumber:int8,
|
||||
lotcode:uint32,
|
||||
lotseqnum:int16,
|
||||
probearrayloc:int16,
|
||||
testpassfailcode:int16,
|
||||
calsignature:int32,
|
||||
caldatetime:chrono::NaiveDateTime,
|
||||
heatergain:float,
|
||||
heatertimedelay:float,
|
||||
responses:float,
|
||||
thermcalm:float,
|
||||
thermcalb:float,
|
||||
coefa:float,
|
||||
coefb:float,
|
||||
coefc:float,
|
||||
coefd:float,
|
||||
coefe:float,
|
||||
probecyclecount:uint32,
|
||||
devicecount:uint16,
|
||||
lastdevicesn:int8,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum probeType{
|
||||
#[default]
|
||||
ORAL,
|
||||
CALKEY,
|
||||
RECTAL,
|
||||
NONE,
|
||||
}
|
||||
|
||||
pub impl CSTPDProbe {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CSTPDProbe{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmTEMP }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnDATA }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmTEMPSpecies::CSTPDProbe) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmTEMP for CSTPDHState{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CSTPDHState{
|
||||
hardware:hardware,
|
||||
state:int16,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum hardware{
|
||||
#[default]
|
||||
PROBE_WELL_SW,
|
||||
PROBE_SW,
|
||||
PROBE_CONNECTED_SW,
|
||||
}
|
||||
|
||||
pub impl CSTPDHState {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CSTPDHState{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmTEMP }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnDATA }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmTEMPSpecies::CSTPDHState) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmTEMP for CSTPDLock{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CSTPDLock{
|
||||
lock:lock,
|
||||
state:int8,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum lock{
|
||||
#[default]
|
||||
DIGITAL_INPUT_LOCK,
|
||||
AD_CHANNEL,
|
||||
}
|
||||
|
||||
pub impl CSTPDLock {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CSTPDLock{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmTEMP }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnDATA }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmTEMPSpecies::CSTPDLock) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmTEMP for CSTPDRData{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CSTPDRData{
|
||||
thermistor:uint32,
|
||||
ptbresistor:uint32,
|
||||
rcalresistor:uint32,
|
||||
vref:uint32,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
pub impl CSTPDRData {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CSTPDRData{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmTEMP }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnDATA }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmTEMPSpecies::CSTPDRData) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmTEMP for CSTPDStat{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CSTPDStat{
|
||||
state:state,
|
||||
error:error,
|
||||
hardwarestate:hardwareState,
|
||||
finaltemp:float,
|
||||
probetemp:float,
|
||||
method:method,
|
||||
probetype:probeType,
|
||||
algorithm:algorithm,
|
||||
battery:uint16,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum state{
|
||||
#[default]
|
||||
IDLE,
|
||||
NOT_READY,
|
||||
READY,
|
||||
PREDICT,
|
||||
PREDICT_DISPLAY,
|
||||
PREDICT_POS,
|
||||
FINAL,
|
||||
FINAL_POS,
|
||||
FINAL_OVER_TEMP,
|
||||
FINAL_UNDER_TEMP,
|
||||
FINAL_OVER_TEMP_POS,
|
||||
FINAL_UNDER_TEMP_POS,
|
||||
NO_PREDICT,
|
||||
ERROR,
|
||||
MONITOR,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum error{
|
||||
#[default]
|
||||
NO_ERROR,
|
||||
ERROR_ALG_PROBE_OVER_TEMP,
|
||||
ERROR_ALG_EXCESSIVE_HTR_ENERGY,
|
||||
ERROR_ALG_OVER_AMB_TEMP,
|
||||
ERROR_ALG_UNDER_AMB_TEMP,
|
||||
ERROR_ALG_NO_PROBE_TEMP_RISE,
|
||||
ERROR_ALG_BAD_PROBE_GAIN,
|
||||
ERROR_ALG_BAD_PROBE_RESP_VAL,
|
||||
ERROR_HTR_ON_NOT_OFF,
|
||||
ERROR_HTR_OFF_NOT_ON,
|
||||
ERROR_HTR_VOLT_HIGH_Q,
|
||||
ERROR_HTR_VOLT_Q_HIGH_IMP,
|
||||
ERROR_HTR_VOLT_LOW,
|
||||
ERROR_HTR_FAILSAFE,
|
||||
ERROR_AD_PULSE_LONG,
|
||||
ERROR_AD_PULSE_SHORT,
|
||||
ERROR_AD_RCAL_LONG,
|
||||
ERROR_AD_RCAL_SHORT,
|
||||
ERROR_AD_PTB_OVER,
|
||||
ERROR_AD_PTB_UNDER,
|
||||
ERROR_AD_TIMEOUT,
|
||||
ERROR_CFG_XFER,
|
||||
ERROR_CFG_SET_CRC,
|
||||
ERROR_CFG_PROBE_CRC,
|
||||
ERROR_CFG_CAL_CRC,
|
||||
ERROR_CFG_LOG_CRC,
|
||||
ERROR_CFG_NO_PROBE,
|
||||
ERROR_CFG_UNIT_PROBE,
|
||||
ERROR_CFG_ACK,
|
||||
ERROR_CFG_INIT,
|
||||
ERROR_BAT_HIGH,
|
||||
ERROR_BAT_LOW,
|
||||
ERROR_BAD_VIBES,
|
||||
ERROR_NO_PROBE_WELL,
|
||||
ERROR_POST_FAIL,
|
||||
ERROR_INTERNAL_FAULT,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum hardwareState{
|
||||
#[default]
|
||||
probeConnected,
|
||||
probePulled,
|
||||
probeWellIn,
|
||||
savingCal,
|
||||
savingSettings,
|
||||
takeReadingActive,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum method{
|
||||
#[default]
|
||||
PREDICT,
|
||||
MONITOR,
|
||||
CLINICAL,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum probeType{
|
||||
#[default]
|
||||
NO_PROBE,
|
||||
ORAL,
|
||||
RECTAL,
|
||||
CALKEY,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum algorithm{
|
||||
#[default]
|
||||
NONE,
|
||||
ORAL_ALG,
|
||||
PED_AX_ALG,
|
||||
ADULT_AX_ALG,
|
||||
RECTAL_ALG,
|
||||
}
|
||||
|
||||
pub impl CSTPDStat {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CSTPDStat{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmTEMP }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnDATA }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmTEMPSpecies::CSTPDStat) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmTEMP for CSTPDSample{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CSTPDSample{
|
||||
channel:uint8,
|
||||
error:uint8,
|
||||
sample:uint32,
|
||||
data:uint32,
|
||||
temperature:float,
|
||||
resistance:float,
|
||||
last_rcal:uint32,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
pub impl CSTPDSample {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CSTPDSample{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmTEMP }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnDATA }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmTEMPSpecies::CSTPDSample) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmTEMP for CTempDTouch{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CTempDTouch{
|
||||
ele0:uint16,
|
||||
ele1:uint16,
|
||||
ele2:uint16,
|
||||
touchstatus:uint16,
|
||||
ele0bv:uint8,
|
||||
ele1bv:uint8,
|
||||
ele2bv:uint8,
|
||||
hardwarestateir:hardwareStateIR,
|
||||
samplecount:uint32,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum hardwareStateIR{
|
||||
#[default]
|
||||
TAKE_READING_ACTIVE,
|
||||
PROBE_COVER_ON,
|
||||
}
|
||||
|
||||
pub impl CTempDTouch {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CTempDTouch{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmTEMP }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnDATA }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmTEMPSpecies::CTempDTouch) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmTEMP for CTempDTherm{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CTempDTherm{
|
||||
ambient:float,
|
||||
ambient_count:int32,
|
||||
thermopile:float,
|
||||
thermopile_count:int32,
|
||||
samplecount:uint32,
|
||||
heaterpwm:int16,
|
||||
heaterstate:heaterState,
|
||||
heatererror:int16,
|
||||
braun_ambient:float,
|
||||
tcvalue:float,
|
||||
pre_num:uint8,
|
||||
post_num:uint8,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum heaterState{
|
||||
#[default]
|
||||
IDLE,
|
||||
HEATER_TEST,
|
||||
HEATER_ON,
|
||||
READY,
|
||||
ERROR,
|
||||
}
|
||||
|
||||
pub impl CTempDTherm {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CTempDTherm{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmTEMP }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnDATA }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmTEMPSpecies::CTempDTherm) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmTEMP for CTempCStd{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CTempCStd{
|
||||
enabled:boolean,
|
||||
installedmodule:InstalledModule,
|
||||
displayunits:DisplayUnits,
|
||||
mode:Mode,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum InstalledModule{
|
||||
#[default]
|
||||
NONE,
|
||||
UNKNOWN,
|
||||
SURETEMP_SW,
|
||||
SURETEMP,
|
||||
SURETEMP_PLUS,
|
||||
BRAUN_PRO4000,
|
||||
BRAUN_PRO6000,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum DisplayUnits{
|
||||
#[default]
|
||||
DEG_F,
|
||||
DEG_C,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum Mode{
|
||||
#[default]
|
||||
NONE,
|
||||
UNKNOWN,
|
||||
ORAL,
|
||||
ADULT_AXIL,
|
||||
PED_AXIL,
|
||||
LAST,
|
||||
}
|
||||
|
||||
pub impl CTempCStd {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CTempCStd{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmTEMP }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnCONFIG }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmTEMPSpecies::CTempCStd) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmTEMP for CSTPCStd{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CSTPCStd{
|
||||
clinicalpause:uint16,
|
||||
devicetype:deviceType,
|
||||
dfltalgorithm:dfltAlgorithm,
|
||||
ambientbias:float,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum deviceType{
|
||||
#[default]
|
||||
PREDICT_DEVICE,
|
||||
MONITOR_DEVICE,
|
||||
}
|
||||
|
||||
#[derive(Clone,Copy,Debug,Default)]
|
||||
pub enum dfltAlgorithm{
|
||||
#[default]
|
||||
ORAL,
|
||||
PED_AXILLARY,
|
||||
ADULT_AXILLARY,
|
||||
LAST,
|
||||
}
|
||||
|
||||
pub impl CSTPCStd {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CSTPCStd{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmTEMP }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnCONFIG }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmTEMPSpecies::CSTPCStd) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmTEMP for CSTPCCal{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CSTPCCal{
|
||||
signature:uint32,
|
||||
datetime:chrono::NaiveDateTime,
|
||||
modconfig:float,
|
||||
yp0:float,
|
||||
rp0:float,
|
||||
rptbeff:float,
|
||||
rcaleff:float,
|
||||
vref:float,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
pub impl CSTPCCal {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CSTPCCal{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmTEMP }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnCONFIG }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmTEMPSpecies::CSTPCCal) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmTEMP for CTempPMsgArg{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CTempPMsgArg{
|
||||
ioparametera:uint32,
|
||||
ioparameterb:uint32,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
pub impl CTempPMsgArg {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CTempPMsgArg{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmTEMP }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnPARAMETER }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmTEMPSpecies::CTempPMsgArg) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
||||
impl FmTEMP for CSTPPSelector{}
|
||||
#[derive(Getters,Builder,Clone,Debug)]
|
||||
pub struct CSTPPSelector{
|
||||
value:uint32,
|
||||
#[getter(skip)]
|
||||
raw_object:RawObject,
|
||||
}
|
||||
|
||||
pub impl CSTPPSelector {
|
||||
fn new() -> Self { todo!() }
|
||||
}
|
||||
impl Object for CSTPPSelector{
|
||||
fn get_family(&self) -> datatypes::Family { datatypes::Family::FmTEMP }
|
||||
fn get_genus(&self) -> datatypes::Genus { datatypes::Genus::GnPARAMETER }
|
||||
fn get_species(&self) -> Box<dyn super::ObjectSpecies> { Box::new(FmTEMPSpecies::CSTPPSelector) }
|
||||
fn get_raw_object(&self) -> RawObject { self.raw_object.clone() }
|
||||
}
|
||||
|
185
src/main.rs
185
src/main.rs
|
@ -153,6 +153,17 @@ fn nested_parse(input_family:&mut oop::Family, node: roxmltree::Node, mut curren
|
|||
.filter(|species| species.get_name().as_str() == current.attr_species)
|
||||
.for_each(|species|{
|
||||
current.attr_member = node.attribute("name").unwrap().to_string();
|
||||
let size:Option<usize>;
|
||||
match node.attribute("size"){
|
||||
None => size = None,
|
||||
Some(size_string) => {
|
||||
if size_string == "UNBOUNDED" {
|
||||
size = Some(usize::MAX);
|
||||
} else {
|
||||
size = Some(size_string.parse::<usize>().unwrap());
|
||||
}
|
||||
},
|
||||
}
|
||||
species.get_objects().last_mut().unwrap().push_object_member(oop::ObjectMember::new(
|
||||
node.attribute("type").unwrap().to_string(),
|
||||
node.attribute("name").unwrap().to_string(),
|
||||
|
@ -160,7 +171,8 @@ fn nested_parse(input_family:&mut oop::Family, node: roxmltree::Node, mut curren
|
|||
node.attribute("minversion").unwrap().to_string(),
|
||||
node.attribute("maxversion").unwrap().to_string(),
|
||||
Vec::new(),
|
||||
node.attribute("format").unwrap_or("").to_string()
|
||||
node.attribute("format").unwrap_or("").to_string(),
|
||||
size
|
||||
));
|
||||
|
||||
});
|
||||
|
@ -217,115 +229,107 @@ fn output_gen(family: oop::Family, output_path: String) -> (String, String){
|
|||
"Species{\n"
|
||||
);
|
||||
for species_name in family.list_species() {
|
||||
write_string = format!(
|
||||
"{}{}{}{}",
|
||||
write_string,
|
||||
"\t",
|
||||
species_name,
|
||||
",\n"
|
||||
);
|
||||
write_string.push_str(format!("\t{}\n",species_name).as_str());
|
||||
}
|
||||
write_string = format!(
|
||||
"{}{}{}{}",
|
||||
write_string,
|
||||
"}\nimpl ObjectSpecies for ",
|
||||
family.get_name().as_str(),
|
||||
"Species{}\n\n"
|
||||
);
|
||||
write_string.push_str(format!(
|
||||
"}}\nimpl ObjectSpecies for {}Species{{}}\n\n",
|
||||
family.get_name()
|
||||
).as_str());
|
||||
let mut genus_name:String;
|
||||
for genus in family.clone().get_genera() {
|
||||
genus_name = genus.get_name();
|
||||
for species in genus.get_species() {
|
||||
for object in species.get_objects() {
|
||||
write_string = format!(
|
||||
"{}{}{}{}{}{}{}{}",
|
||||
write_string,
|
||||
"impl ",
|
||||
write_string.push_str(format!(
|
||||
"impl {} for {}{{}}\n#[derive(Getters,Builder,Clone,Debug)]\npub struct {}{{\n",
|
||||
family.get_name(),
|
||||
" for ",
|
||||
object.get_name(),
|
||||
"{}\n#[derive(Getters,Builder,Clone,Debug)]\npub struct ",
|
||||
object.get_name(),
|
||||
"{\n"
|
||||
);
|
||||
).as_str());
|
||||
let mut enums = Vec::new();
|
||||
for member in object.get_members() {
|
||||
if member.get_member_type() != "OBJECT" {
|
||||
if member.get_member_type() == "TIME" {
|
||||
write_string = format!(
|
||||
"{}{}{}{}",
|
||||
write_string,
|
||||
"\t",
|
||||
match member.get_member_type().as_str(){
|
||||
"OBJECT" => {
|
||||
write_string.push_str(format!(
|
||||
"\t{}:&'static dyn Object,\n",
|
||||
member.get_member_name().to_lowercase(),
|
||||
":chrono::NaiveDateTime,\n",
|
||||
);
|
||||
} else if !member.get_enumerations().is_empty() && member.get_enumerations().first().unwrap().get_name() != "" {
|
||||
write_string = format!(
|
||||
"{}{}{}{}{}{}",
|
||||
write_string,
|
||||
"\t",
|
||||
).as_str());
|
||||
},
|
||||
"TIME" => {
|
||||
write_string.push_str(format!(
|
||||
"\t{}:chrono::NaiveDateTime,\n",
|
||||
member.get_member_name().to_lowercase())
|
||||
.as_str());
|
||||
},
|
||||
"ansichar" | "widechar" => {
|
||||
write_string.push_str(format!(
|
||||
"\t{}:String,\n",
|
||||
member.get_member_name().to_lowercase())
|
||||
.as_str());
|
||||
},
|
||||
_ => {
|
||||
write_string.push_str(format!(
|
||||
"\t{}:",
|
||||
member.get_member_name().to_lowercase(),
|
||||
":",
|
||||
member.get_member_name(),
|
||||
",\n"
|
||||
);
|
||||
).as_str());
|
||||
if let Some(size_value) = member.get_size(){
|
||||
if size_value == usize::MAX {
|
||||
write_string.push_str("Vec<");
|
||||
} else {
|
||||
write_string = format!(
|
||||
"{}{}{}{}{}{}",
|
||||
write_string,
|
||||
"\t",
|
||||
member.get_member_name().to_lowercase(),
|
||||
":",
|
||||
member.get_member_type(),
|
||||
",\n"
|
||||
);
|
||||
write_string.push_str("[");
|
||||
}
|
||||
}
|
||||
if member.get_member_type().contains("uint"){
|
||||
let mut fixed_type = member.get_member_type();
|
||||
fixed_type.retain(|char| char.is_digit(10) || char == 'u' );
|
||||
write_string.push_str(fixed_type.as_str());
|
||||
} else if member.get_member_type().contains("int"){
|
||||
let mut fixed_type = member.get_member_type();
|
||||
fixed_type.retain(|char| char.is_digit(10) || char == 'i' );
|
||||
write_string.push_str(fixed_type.as_str());
|
||||
} else if member.get_member_type().contains("bool"){
|
||||
write_string.push_str("bool");
|
||||
} else if member.get_member_type().contains("float"){
|
||||
write_string.push_str("f32");
|
||||
} else {
|
||||
write_string.push_str(member.get_member_type().as_str());
|
||||
}
|
||||
|
||||
if let Some(size_value) = member.get_size(){
|
||||
if size_value == usize::MAX {
|
||||
write_string.push_str(">,\n");
|
||||
} else {
|
||||
write_string.push_str(format!("; {},\n]",size_value).as_str());
|
||||
}
|
||||
} else {
|
||||
write_string = format!(
|
||||
"{}{}{}{}{}{}{}{}",
|
||||
write_string,
|
||||
"\t",
|
||||
member.get_member_name().to_lowercase(),
|
||||
":",
|
||||
"Object",
|
||||
"::",
|
||||
member.get_member_class(),
|
||||
",\n"
|
||||
);
|
||||
write_string.push_str(",\n");
|
||||
}
|
||||
},
|
||||
}
|
||||
if !member.get_enumerations().is_empty() && member.get_enumerations().first().unwrap().get_name() != "" {
|
||||
enums.push(member)
|
||||
}
|
||||
}
|
||||
write_string = format!(
|
||||
"{}{}",
|
||||
write_string,
|
||||
"\t#[getter(skip)]\n\traw_object:RawObject,\n"
|
||||
);
|
||||
write_string.push_str("\t#[getter(skip)]\n\traw_object:RawObject,\n");
|
||||
|
||||
if !enums.is_empty() {
|
||||
for member in enums {
|
||||
write_string = format!(
|
||||
"{}{}{}{}",
|
||||
write_string,
|
||||
write_string.push_str(format!(
|
||||
"{}{}{}",
|
||||
"}\n\n#[derive(Clone,Copy,Debug,Default)]\npub enum ",
|
||||
member.get_member_name(),
|
||||
"{\n\t#[default]\n"
|
||||
);
|
||||
).as_str());
|
||||
for e in member.get_enumerations() {
|
||||
write_string = format!(
|
||||
"{}{}{}{}",
|
||||
write_string,
|
||||
"\t",
|
||||
write_string.push_str(format!(
|
||||
"\t{},\n",
|
||||
e.get_name(),
|
||||
",\n"
|
||||
);
|
||||
).as_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
write_string = format!(
|
||||
"{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
|
||||
write_string,
|
||||
write_string.push_str(format!(
|
||||
"{}{}{}{}{}{}{}{}{}{}{}{}{}",
|
||||
"}\n\nimpl ",
|
||||
object.get_name(),
|
||||
" {\n\tpub fn new() -> Self { todo!() }\n}\nimpl Object for ",
|
||||
|
@ -339,7 +343,7 @@ fn output_gen(family: oop::Family, output_path: String) -> (String, String){
|
|||
"Species::",
|
||||
object.get_name(),
|
||||
") }\n\tfn get_raw_object(&self) -> RawObject { self.raw_object.clone() }\n}\n\n"
|
||||
);
|
||||
).as_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -364,26 +368,19 @@ fn output_gen(family: oop::Family, output_path: String) -> (String, String){
|
|||
}
|
||||
let mut message_num = 0x00;
|
||||
for message in messages {
|
||||
write_string = format!(
|
||||
"{}{}{}{}{}{}{}{}",
|
||||
write_string,
|
||||
"\t",
|
||||
write_string.push_str(format!(
|
||||
"\t{},\t\t\t//{} {}\n",
|
||||
message,
|
||||
",\t\t\t//",
|
||||
message_type,
|
||||
" ",
|
||||
message_num,
|
||||
"\n"
|
||||
);
|
||||
message_num += 0x01;
|
||||
).as_str());
|
||||
message_num += 1;
|
||||
}
|
||||
}
|
||||
write_string = format!(
|
||||
"{}{}{}{}",
|
||||
write_string,
|
||||
"}\n\nimpl MessageSpecies for ",
|
||||
family.get_name().as_str(), "Message{}"
|
||||
);
|
||||
write_string.push_str(format!(
|
||||
"}}\n\nimpl MessageSpecies for {}Message{{}} ",
|
||||
family.get_name().as_str(),
|
||||
).as_str());
|
||||
|
||||
},
|
||||
&_ => panic!("Output path format error")
|
||||
|
|
17
src/oop.rs
17
src/oop.rs
|
@ -2,6 +2,7 @@ use phf::phf_ordered_map;
|
|||
use crate::roxmltree::Node;
|
||||
use std::fmt;
|
||||
|
||||
|
||||
const MESSAGETYPE: phf::OrderedMap<&'static str, &'static str> = phf_ordered_map! {
|
||||
"Request" => "requests",
|
||||
"Response" => "responses",
|
||||
|
@ -173,18 +174,23 @@ pub struct ObjectMember {
|
|||
maxversion: String,
|
||||
enumerations: Vec<MemberEnumeration>,
|
||||
format: String,
|
||||
size: Option<usize>,
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
impl ObjectMember {
|
||||
pub fn new(member_type: String, name: String, class: String, minversion: String, maxversion: String, enumerations: Vec<MemberEnumeration>, format: String) -> Self {
|
||||
Self { member_type, name, class, minversion, maxversion, enumerations, format }
|
||||
pub fn new(member_type: String, name: String, class: String, minversion: String, maxversion: String, enumerations: Vec<MemberEnumeration>, format: String, size: Option<usize>) -> Self {
|
||||
Self { member_type, name, class, minversion, maxversion, enumerations, format, size }
|
||||
}
|
||||
|
||||
pub fn get_size(&self) -> Option<usize>{
|
||||
return self.size.clone()
|
||||
}
|
||||
|
||||
pub fn get_member_name(&self) -> String{
|
||||
return self.name.clone()
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
pub fn get_member_type(&self) -> String{
|
||||
return self.member_type.clone()
|
||||
}
|
||||
|
@ -193,27 +199,22 @@ impl ObjectMember {
|
|||
return self.class.clone();
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
pub fn get_minversion(&self) -> String{
|
||||
return self.minversion.clone()
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
pub fn get_maxversion(&self) -> String{
|
||||
return self.maxversion.clone()
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
pub fn get_enumerations(&mut self) -> &mut Vec<MemberEnumeration>{
|
||||
return &mut self.enumerations
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
pub fn push_member_enumeration(&mut self, enumeration: MemberEnumeration) {
|
||||
self.enumerations.push(enumeration);
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
pub fn get_format(&self) -> Option<String>{
|
||||
if self.class != "" {
|
||||
return None;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue