public static void insertFromWAttribute ( final WAttribute wAttributeValue , final DeviceAttribute deviceAttributeWritten ) throws DevFailed { Object value = null ; switch ( wAttributeValue . get_data_type ( ) ) { case TangoConst . Tango_DEV_SHORT : value = Short . valueOf ( wAttributeValue . getShortWriteValue ( ) ) ; break ; case TangoConst . Tango_DEV_USHORT : value = Integer . valueOf ( wAttributeValue . getUShortWriteValue ( ) ) ; break ; case TangoConst . Tango_DEV_CHAR : Except . throw_exception ( "TANGO_WRONG_DATA_ERROR" , "input type Tango_DEV_CHAR not supported" , "AttributeHelper.insertFromWAttribute(WAttribute wAttributeValue,deviceAttributeWritten)" ) ; break ; case TangoConst . Tango_DEV_UCHAR : Except . throw_exception ( "TANGO_WRONG_DATA_ERROR" , "input type Tango_DEV_UCHAR not supported" , "AttributeHelper.insertFromWAttribute(WAttribute wAttributeValue,deviceAttributeWritten)" ) ; break ; case TangoConst . Tango_DEV_LONG : value = Integer . valueOf ( wAttributeValue . getLongWriteValue ( ) ) ; break ; case TangoConst . Tango_DEV_ULONG : value = Long . valueOf ( wAttributeValue . getULongWriteValue ( ) ) ; break ; case TangoConst . Tango_DEV_LONG64 : value = Long . valueOf ( wAttributeValue . getLong64WriteValue ( ) ) ; break ; case TangoConst . Tango_DEV_ULONG64 : value = Long . valueOf ( wAttributeValue . getULong64WriteValue ( ) ) ; break ; case TangoConst . Tango_DEV_INT : value = Integer . valueOf ( wAttributeValue . getLongWriteValue ( ) ) ; break ; case TangoConst . Tango_DEV_FLOAT : value = Float . valueOf ( Double . valueOf ( wAttributeValue . getDoubleWriteValue ( ) ) . floatValue ( ) ) ; break ; case TangoConst . Tango_DEV_DOUBLE : value = Double . valueOf ( wAttributeValue . getDoubleWriteValue ( ) ) ; break ; case TangoConst . Tango_DEV_STRING : value = wAttributeValue . getStringWriteValue ( ) ; break ; case TangoConst . Tango_DEV_BOOLEAN : value = Boolean . valueOf ( wAttributeValue . getBooleanWriteValue ( ) ) ; break ; case TangoConst . Tango_DEV_STATE : value = wAttributeValue . getStateWriteValue ( ) ; break ; default : Except . throw_exception ( "TANGO_WRONG_DATA_ERROR" , "input type " + deviceAttributeWritten . getType ( ) + " not supported" , "AttributeHelper.insertFromDouble(Double value,deviceAttributeWritten)" ) ; break ; } insert ( value , deviceAttributeWritten ) ; }
Insert data in DeviceAttribute from a WAttribute .