Reorg csv in lib
This commit is contained in:
parent
bfa1fef9d8
commit
d7c98d37a2
|
@ -3,35 +3,8 @@ use crate::util::*;
|
|||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::error::Error;
|
||||
use super::TransferRecord;
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct TransferRecord {
|
||||
#[serde(rename = "Source Plate", alias = "source plate", alias = "src plate")]
|
||||
pub source_plate: String,
|
||||
#[serde(rename = "Source Well", alias = "source well", alias = "src well")]
|
||||
pub source_well: String,
|
||||
#[serde(
|
||||
rename = "Dest Plate",
|
||||
alias = "dest plate",
|
||||
alias = "destination plate"
|
||||
)]
|
||||
pub destination_plate: String,
|
||||
#[serde(
|
||||
rename = "Destination Well",
|
||||
alias = "destination well",
|
||||
alias = "dest well"
|
||||
)]
|
||||
pub destination_well: String,
|
||||
#[serde(rename = "Transfer Volume", alias = "transfer volume")]
|
||||
#[serde(default = "volume_default")]
|
||||
pub volume: f32,
|
||||
#[serde(rename = "Concentration", alias = "concentration")]
|
||||
pub concentration: Option<f32>,
|
||||
}
|
||||
|
||||
pub fn volume_default() -> f32 {
|
||||
Transfer::default().volume
|
||||
}
|
||||
|
||||
pub fn transfer_to_records(
|
||||
tr: &Transfer,
|
|
@ -0,0 +1,6 @@
|
|||
mod transfer_record;
|
||||
mod conversion;
|
||||
|
||||
pub use transfer_record::volume_default;
|
||||
pub use transfer_record::TransferRecord;
|
||||
pub use conversion::*;
|
|
@ -0,0 +1,33 @@
|
|||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::transfer::Transfer;
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct TransferRecord {
|
||||
#[serde(rename = "Source Plate", alias = "source plate", alias = "src plate")]
|
||||
pub source_plate: String,
|
||||
#[serde(rename = "Source Well", alias = "source well", alias = "src well")]
|
||||
pub source_well: String,
|
||||
#[serde(
|
||||
rename = "Dest Plate",
|
||||
alias = "dest plate",
|
||||
alias = "destination plate"
|
||||
)]
|
||||
pub destination_plate: String,
|
||||
#[serde(
|
||||
rename = "Destination Well",
|
||||
alias = "destination well",
|
||||
alias = "dest well"
|
||||
)]
|
||||
pub destination_well: String,
|
||||
#[serde(rename = "Transfer Volume", alias = "transfer volume")]
|
||||
#[serde(default = "volume_default")]
|
||||
pub volume: f32,
|
||||
#[serde(rename = "Concentration", alias = "concentration")]
|
||||
pub concentration: Option<f32>,
|
||||
}
|
||||
|
||||
pub fn volume_default() -> f32 {
|
||||
Transfer::default().volume
|
||||
}
|
||||
|
Loading…
Reference in New Issue