Problem with the Gev Server Node function "RegisterEventWrittenUpdated"

Also one hint I just got:

Dont forget (from the tutorial) to do the equivalent to:

enumerationNode->SetValueConfigCvb::GevServer::IntegerBaseNodePtr(windowStateRegNode_);

for your case.
Here the windowStateRegNode gets an integerbasenodeptr for the value…

I have also tried this way:

global_enumNodeGainSelec = Cvb::GevServer::EnumerationNode::Create(CVB_LIT("Std::GainSelector"));
global_server->NodeMap()->AddNode(global_enumNodeGainSelec);
global_enumNodeGainSelec->RegisterEventWrittenUpdated([](const auto& value) 
		{
			std::string enumStrValue = global_enumNodeGainSelec->Value();
			std::cout << "The Enum  " << enumStrValue << std::endl;
		});

But the change in the EnumerationNode was not recognized.

But I dont use an IntegerNode, I am using an EnumEntryNode.

I know, so does the example, but the enumerationnode gets an integernode for the value.

Yes, but as a workaround you can use the eventdatas value and store it for later use.

Yes, I could change that. It would may be a solution. But it’s still surprising why it doesn’t work with an EnumEntryNode.

Can you tell me, why this does not work?

Because you forgot to set the value to an integerpointer as mentioned above and done in the qmlgevserver tutorial?

Sorry, but I don’t understand what this has to do with an IntegerNode. Here only the current value of the EnumerationNode is queried and it should not matter if an IntegerNode is selected or an EnumEntryNode.

Its an integerbasenodeptr… from the tutorial I would assume this is needed to set/ change the value of the node… In your case to have values behind the enumeration entries

May you are right.
So the enumEntryNode->SetNumericValue(1) is than for what?
And why is the EnumerationNode->RegisterEventWrittenUpdated() not triggered if it is changed in GenICam Browser?

You did not mention, that it is not triggered at all, I thought just the access to the value does not work within the callback…

Please register the updated event on the int reg node as in my code example above, this should work then :slight_smile:

intGainRegNode->RegisterEventWrittenUpdated([](const auto& value)

So what we try to achieve is to have an enumeration node with enumeration entry nodes. The current value the enumeration node points to is in the integer register we set as value to the enumeration node. When the enumeration node is set to select a different enumeration entry by the user, it updates the integer value from the integer register. The integer register node check the change of the register and emits the EventWrittenUpdated(). It also always holds the current value of the register.
I hope that helps :slight_smile:

1 Like