const DataRef ExceptionOperator::getParameter(const unsigned int id) const { switch(id) { case THROW_INITIALIZE: return m_throwInitialize; case THROW_ACTIVATE: return m_throwActivate; case THROW_EXECUTE: return m_throwExecute; case THROW_DEACTIVATE: return m_throwDeactivate; case THROW_DEINITIALIZE: return m_throwDeinitialize; case THROW_PARAMETER: return m_throwParameter; case PARAMETER: if (m_throwParameter) throw WrongParameterId(id, *this); else return m_parameter; default: throw WrongParameterId(id, *this); } }
void TestOperator::setParameter(unsigned int id, const runtime::Data& value) { try { switch(id) { case BUFFER_SIZE: m_bufferSize = data_cast<UInt32>(value); break; case SLEEP_TIME: m_sleepTime = data_cast<UInt32>(value); break; case THROW_EXCEPTION: m_throwException = data_cast<Bool>(value); break; case TEST_DATA: m_testData = data_cast<TestData>(value); break; default: throw WrongParameterId(id, *this); } } catch(std::bad_cast&) { throw WrongParameterType(*parameters()[id], *this); } }
void CameraBuffer::setParameter(const unsigned int id, const Data& value) { try { switch(id) { case BUFFER_SIZE: m_bufferSize = stromx::runtime::data_cast<UInt32>(value); break; case NUM_BUFFERS: { UInt32 newNumBuffers = stromx::runtime::data_cast<UInt32>(value); if(newNumBuffers < 1) throw WrongParameterValue(parameter(NUM_BUFFERS), *this); m_numBuffers = newNumBuffers; break; } default: throw WrongParameterId(id, *this); } } catch(std::bad_cast&) { throw WrongParameterType(parameter(id), *this); } }
void ReadDirectory::setParameter(unsigned int id, const Data& value) { Enum enumValue; try { switch(id) { case DIRECTORY: enumValue = data_cast<Enum>(value); if (m_directory != NO_DIRECTORY) { if(m_directoryMap.count(std::size_t(enumValue)) == 0) throw WrongParameterValue(parameter(id), *this); } m_directory = enumValue; break; default: throw WrongParameterId(id, *this); } } catch(std::bad_cast&) { throw WrongParameterType(parameter(id), *this); } }
const DataRef Send::getParameter(const unsigned int id) const { switch(id) { case PORT: return m_port; default: throw WrongParameterId(id, *this); } }
const DataRef Flicker::getParameter(const unsigned int id) const { switch(id) { case AMOUNT: return m_amount; default: throw WrongParameterId(id, *this); } }
const DataRef ReadGpio::getParameter(const unsigned int id) const { switch(id) { case GPIO: return m_gpio; default: throw WrongParameterId(id, *this); } }
const DataRef ReadDirectory::getParameter(const unsigned int id) const { switch(id) { case DIRECTORY: return m_directory; default: throw WrongParameterId(id, *this); } }
const DataRef CameraBuffer::getParameter(const unsigned int id) const { switch(id) { case BUFFER_SIZE: return m_bufferSize; case NUM_BUFFERS: return m_numBuffers; default: throw WrongParameterId(id, *this); } }
const DataRef ConvertPixelType::getParameter(const unsigned int id) const { switch(id) { case PIXEL_TYPE: return m_pixelType; case DATA_FLOW: return m_dataFlow; default: throw WrongParameterId(id, *this); } }
void ExceptionOperator::setParameter(unsigned int id, const Data& value) { try { switch(id) { case THROW_INITIALIZE: m_throwInitialize = data_cast<Bool>(value); break; case THROW_ACTIVATE: m_throwActivate = data_cast<Bool>(value); break; case THROW_EXECUTE: m_throwExecute = data_cast<Bool>(value); break; case THROW_DEACTIVATE: m_throwDeactivate = data_cast<Bool>(value); break; case THROW_DEINITIALIZE: m_throwDeinitialize = data_cast<Bool>(value); break; case THROW_PARAMETER: m_throwParameter = data_cast<Bool>(value); break; case PARAMETER: if (m_throwParameter) throw WrongParameterId(id, *this); else m_parameter = data_cast<Int32>(value); break; default: throw WrongParameterId(id, *this); } } catch(std::bad_cast&) { throw WrongParameterType(*parameters()[id], *this); } }
const DataRef TestOperator::getParameter(const unsigned int id) const { switch(id) { case BUFFER_SIZE: return m_bufferSize; case SLEEP_TIME: return m_sleepTime; case THROW_EXCEPTION: return m_throwException; case TEST_DATA: return m_testData; default: throw WrongParameterId(id, *this); } }
void Send::setParameter(unsigned int id, const runtime::Data& value) { UInt16 uintValue; switch(id) { case PORT: uintValue = data_cast<UInt16>(value); if(uintValue < MIN_PORT) throw WrongParameterValue(parameter(PORT), *this, "Too small port number."); if(uintValue > MAX_PORT) throw WrongParameterValue(parameter(PORT), *this, "Too large port number."); m_port = uintValue; break; default: throw WrongParameterId(id, *this); } }
void Flicker::setParameter(unsigned int id, const Data& value) { try { switch(id) { case AMOUNT: m_amount = stromx::runtime::data_cast<Float64>(value); m_amount = std::max(0.0, std::min(double(1.0), double(m_amount))); break; default: throw WrongParameterId(id, *this); } } catch(std::bad_cast&) { throw WrongParameterType(parameter(id), *this); } }
void ParameterOperator::setParameter(unsigned int id, const Data& value) { try { switch(id) { case INT_PARAM: m_intParam = data_cast<Int32>(value); break; case INITIALIZE_PARAM: m_initializeParam = data_cast<UInt32>(value); break; case ENUM_PARAM: m_enumParam = data_cast<Enum>(value); break; case BOOL_PARAM: m_boolParam = data_cast<Bool>(value); break; case MATRIX_PARAM: m_matrixParam = data_cast<stromx::runtime::Matrix>(value); break; case INT_MATRIX_PARAM: m_intMatrixParam = data_cast<stromx::runtime::Matrix>(value); break; case TRIGGER_VALUE_PARAM: m_triggerValue = data_cast<stromx::runtime::Bool>(value); break; case TRIGGER_PARAM: data_cast<stromx::runtime::TriggerData>(value); m_triggerValue = true; break; case PUSH_PARAM: m_pushValue = data_cast<Float32>(value); break; default: throw WrongParameterId(id, *this); } } catch(std::bad_cast&) { throw WrongParameterType(*parameters()[id], *this); } }
void ReadGpio::setParameter(unsigned int id, const Data& data) { try { switch(id) { case GPIO: { m_gpio = data_cast<runtime::Enum>(data); break; } default: throw WrongParameterId(id, *this); } } catch(std::bad_cast&) { throw WrongParameterType(parameter(id), *this); } }
void ConvertPixelType::setParameter(unsigned int id, const Data& value) { try { switch(id) { case PIXEL_TYPE: m_pixelType = stromx::runtime::data_cast<Enum>(value); break; case DATA_FLOW: m_dataFlow = stromx::runtime::data_cast<Enum>(value); break; default: throw WrongParameterId(id, *this); } } catch(std::bad_cast&) { throw WrongParameterType(parameter(id), *this); } }
const DataRef ParameterOperator::getParameter(const unsigned int id) const { switch(id) { case INT_PARAM: return m_intParam; case INITIALIZE_PARAM: return m_initializeParam; case ENUM_PARAM: return m_enumParam; case BOOL_PARAM: return m_boolParam; case MATRIX_PARAM: return m_matrixParam; case INT_MATRIX_PARAM: return m_intMatrixParam; case TRIGGER_VALUE_PARAM: return m_triggerValue; case PULL_PARAM: return m_pullValue; default: throw WrongParameterId(id, *this); } }
const DataRef Merge::getParameter(const unsigned int id) const { throw WrongParameterId(id, *this); }
void Merge::setParameter(unsigned int id, const runtime::Data& /*value*/) { throw WrongParameterId(id, *this); }