Replies: 3 comments 6 replies
-
|
@TSSkyhits The trick is that the reference_list_ is actually implemented in the Cc4Block class and is reached by calling the IChannelConversion::NofReferences() followed by one or more calls to the IChannelConversion::Reference(index) that returns a string. I don't see what type of conversion the block is doing but I assume that it is a value-to-text conversion also known as an enumerate value. In the above example, it should be 5 look-up values and 6 reference (string) values. The MDF 3 storage is more user friendly while MDF 4 is more flexible. The documentation could have been better or/and the users interface could be better. You can use the MDF Viewer application which you can download from the latest revision in the GitHub:Ihedvall/mdflib repository. Below a typical enumerate value. |
Beta Was this translation helpful? Give feedback.
-
|
Simple example void MostConfigAdapter::CreateCompleteAckChannel(IChannel& parent_channel,
uint32_t byte_offset) const {
std::ostringstream name;
name << parent_channel.Name() << ".CAck";
if (IChannel* c_ack = CreateBitsChannel(parent_channel, name.str(),
byte_offset,0, 3);
c_ack != nullptr) {
c_ack->Flags(CnFlag::BusEvent | CnFlag::RangeValid);
c_ack->Range(0,4);
if (auto* cc_ack = c_ack->CreateChannelConversion();
cc_ack != nullptr) {
cc_ack->Type(ConversionType::ValueToText);
cc_ack->Name("CompleteAckEnum");
cc_ack->Parameter(0, 0.0);
cc_ack->Parameter(1, 1.0);
cc_ack->Parameter(2, 4.0);
cc_ack->Reference(0, "No Response");
cc_ack->Reference(1, "CRC Error");
cc_ack->Reference(2, "OK");
cc_ack->Reference(3, "Unknown"); // Default text
CcComment cc_comment("Complete ACK Enumerate");
cc_ack->SetCcComment(cc_comment);
}
}
} |
Beta Was this translation helpful? Give feedback.
-
|
@TSSkyhits Currently there are basic support function targeted bus configuration that uses a lot of composite sub-channels. If you see that your application uses a lot of repeated code, it could be better to add it to the IConfigAdapter class. Note that this interface was added recently and simplifies the readability of the code and simplify the task of doing the configuration that can be complicated. |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I try to read the conversion detail of one data channel, which contains a value table.


What I read from the mf4 file via the lib:
As shown in the above figure, only the numerical table can be seen, and the corresponding string list cannot be seen.
This is a value table seen from another tool.
Beta Was this translation helpful? Give feedback.
All reactions