Initial commit
This commit is contained in:
10
example_application/CMakeLists.txt
Normal file
10
example_application/CMakeLists.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
add_executable(fb_application_example main.cpp)
|
||||
|
||||
target_link_libraries(fb_application_example PRIVATE daq::opendaq)
|
||||
|
||||
add_dependencies(
|
||||
fb_application_example
|
||||
example_module
|
||||
daq::ref_device_module
|
||||
daq::ref_fb_module
|
||||
)
|
||||
26
example_application/main.cpp
Normal file
26
example_application/main.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Server application
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <opendaq/opendaq.h>
|
||||
|
||||
using namespace daq;
|
||||
|
||||
int main(int /*argc*/, const char* /*argv*/[])
|
||||
{
|
||||
const auto instance = Instance();
|
||||
auto referenceDevice = instance.addDevice("daqref://device0");
|
||||
auto renderer = instance.addFunctionBlock("RefFBModuleRenderer");
|
||||
auto exampleModule = instance.addFunctionBlock("ExampleScalingModule");
|
||||
exampleModule.setPropertyValue("Scale", 3);
|
||||
exampleModule.setPropertyValue("Offset", -2);
|
||||
|
||||
exampleModule.getInputPorts()[0].connect(referenceDevice.getSignalsRecursive()[0]);
|
||||
renderer.getInputPorts()[0].connect(referenceDevice.getSignalsRecursive()[0]);
|
||||
renderer.getInputPorts()[1].connect(exampleModule.getSignals()[0]);
|
||||
|
||||
std::cout << "Press \"enter\" to exit the application..." << std::endl;
|
||||
std::cin.get();
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user