pub(crate) fn from_raw(raw: (i32, i32, i32)) -> ActionValueChange {
        let (val, valhw, relmode) = raw;
        use ActionValueChange::*;
        if let Ok(val) = U7::try_from(val) {
            match (valhw, relmode) {
                (-1, 0) | (-1, 1) | (-1, 2) | (-1, 3) => match relmode {
                    0 => AbsoluteLowRes(val),
                    1 => Relative1(val),
                    2 => Relative2(val),
                    3 => Relative3(val),
                    _ => Unknown(Hidden((raw.0, raw.1, raw.2))),
                },
                (valhw, 0) if valhw >= 0 => {
                    if let Ok(valhw) = U7::try_from(valhw) {
                        let combined = ((val.get() as u32) << 7) | valhw.get() as u32;
                        AbsoluteHighRes(combined.try_into().expect("impossible"))
                    } else {
                        Unknown(Hidden((raw.0, raw.1, raw.2)))
                    }
                }
                _ => Unknown(Hidden((raw.0, raw.1, raw.2))),
            }
        } else {
            Unknown(Hidden((raw.0, raw.1, raw.2)))
        }
    }
/// Converts the given low-level API values to this action value change if possible.
Converts the given low-level API values to this action value change if possible.
Converts the given low - level API values to this action value change if possible .
pub(crate) fn from_raw(raw: (i32, i32, i32)) -> ActionValueChange {
        let (val, valhw, relmode) = raw;
        use ActionValueChange::*;
        if let Ok(val) = U7::try_from(val) {
            match (valhw, relmode) {
                (-1, 0) | (-1, 1) | (-1, 2) | (-1, 3) => match relmode {
                    0 => AbsoluteLowRes(val),
                    1 => Relative1(val),
                    2 => Relative2(val),
                    3 => Relative3(val),
                    _ => Unknown(Hidden((raw.0, raw.1, raw.2))),
                },
                (valhw, 0) if valhw >= 0 => {
                    if let Ok(valhw) = U7::try_from(valhw) {
                        let combined = ((val.get() as u32) << 7) | valhw.get() as u32;
                        AbsoluteHighRes(combined.try_into().expect("impossible"))
                    } else {
                        Unknown(Hidden((raw.0, raw.1, raw.2)))
                    }
                }
                _ => Unknown(Hidden((raw.0, raw.1, raw.2))),
            }
        } else {
            Unknown(Hidden((raw.0, raw.1, raw.2)))
        }
    }
pub ( crate ) fn from_raw ( raw : ( i32 , i32 , i32 ) ) -> ActionValueChange { let ( val , valhw , relmode ) = raw ; use ActionValueChange :: * ; if let Ok ( val ) = U7 :: try_from ( val ) { match ( valhw , relmode ) { ( - 1 , 0 ) | ( - 1 , 1 ) | ( - 1 , 2 ) | ( - 1 , 3 ) => match relmode { 0 => AbsoluteLowRes ( val ) , 1 => Relative1 ( val ) , 2 => Relative2 ( val ) , 3 => Relative3 ( val ) , _ => Unknown ( Hidden ( ( raw . 0 , raw . 1 , raw . 2 ) ) ) , } , ( valhw , 0 ) if valhw >= 0 => { if let Ok ( valhw ) = U7 :: try_from ( valhw ) { let combined = ( ( val . get ( ) as u32 ) << 7 ) | valhw . get ( ) as u32 ; AbsoluteHighRes ( combined . try_into ( ) . expect ( " " ) ) } else { Unknown ( Hidden ( ( raw . 0 , raw . 1 , raw . 2 ) ) ) } } _ => Unknown ( Hidden ( ( raw . 0 , raw . 1 , raw . 2 ) ) ) , } } else { Unknown ( Hidden ( ( raw . 0 , raw . 1 , raw . 2 ) ) ) } }
Converts the given low-level API values to this action value change if possible.
Converts the given low - level API values to this action value change if possible .
raw
(i32, i32, i32)
raw
(i32, i32, i32)