I've been playing around a bit with example6.cpp from the Developer manual to get to know how to work with AC variables. I've managed to create an AC variable by declaring it as member of the class example6_t:
Code: Select all
comm_var_t test_ac;
Code: Select all
test_ac.data_type = MHA_AC_FLOAT;
test_ac.num_entries = 2;
test_ac.stride = 1;
test_ac.data = test;
ac.insert_var( ac.handle, "testac", test_ac );
Now I was wondering how to get an AC variable from an other plugin. For this I've put the original plugin example6 before my own plugin:
Code: Select all
mha.algos=[ example6 steffencov acmon ]
Code: Select all
ac.get_var(ac.handle, "example6_rmslev",&new_ac_var);
Code: Select all
ac.insert_var( ac.handle, "test3", new_ac_var );
Code: Select all
ac.get_var(ac.handle, "SimpleStream_tc",&new_ac_var);
Code: Select all
ac.insert_var( ac.handle, "test3", new_ac_var );
Code: Select all
# complete list of variables
# vector<string> (monitor)
mha.acmon.varlist = [SimpleStream SimpleStream_new SimpleStream_tc SimpleStream_ts test3]
# variable dimensions in AC space
# vector<string> (monitor)
mha.acmon.dimensions = [1x480 1x1 1x1 1x1 0x1]
I will attach my (rather messy) C++ code and the configuration I've used for testing this.
Best regards,
Steffen