use super::IInstr;

pub fn nbcell_onoff(instr:&mut visa_rs::Instrument,onoff:bool)->Result<(),()>{
    let key = if onoff{"CALL"}else{"OFF"};
    instr.m_send(&format!("CALL:OPERating:MODE:NBiot {}",key)).ok().ok_or(())?;
    Ok(())
}
pub fn catmcell_onoff(instr:&mut visa_rs::Instrument,onoff:bool)->Result<(),()>{
    let key = if onoff{"CALL"}else{"OFF"};
    instr.m_send(&format!("CALL:OPERating:MODE:TLTE {}",key)).ok().ok_or(())?;
    Ok(())
}
pub fn catm_epre_set(instr:&mut visa_rs::Instrument,pow:f32)->Result<(),()>{
    let mes = format!("RFGenerator:MANual:TRANsmit:POWer:NORMalized:TLTE {:.2}",pow);
    instr.m_send(&mes).ok().ok_or(())?;
    Ok(())
}
pub fn nb_epre_set(instr:&mut visa_rs::Instrument,pow:f32)->Result<(),()>{
    let mes = format!("RFGenerator:MANual:TRANsmit:POWer:NORMalized:NBiot {:.2}",pow);
    instr.m_send(&mes).ok().ok_or(())?;
    Ok(())
}