MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / GetBlockProperty

Method GetBlockProperty

lib/mdflib/mdflib/src/cc4block.cpp:150–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148}
149
150void Cc4Block::GetBlockProperty(BlockPropertyList& dest) const {
151 MdfBlock::GetBlockProperty(dest);
152
153 dest.emplace_back("Links", "", "", BlockItemType::HeaderItem);
154 dest.emplace_back("Name TX", ToHexString(Link(kIndexName)), name_,
155 BlockItemType::LinkItem);
156
157 dest.emplace_back("Unit TX/MD", ToHexString(Link(kIndexUnit)),
158 unit_ ? unit_->Comment() : std::string("<Invalid>"),
159 BlockItemType::LinkItem);
160 dest.emplace_back("Comment MD", ToHexString(Link(kIndexMd)), Comment(),
161 BlockItemType::LinkItem);
162 dest.emplace_back("Inverse CC", ToHexString(Link(kIndexInverse)),
163 "Link to inverse formula", BlockItemType::LinkItem);
164 for (const auto& block : ref_list_) {
165 if (!block) {
166
167 dest.emplace_back("Reference Link NIL", "0x00", "", BlockItemType::LinkItem);
168 } else if (block->BlockType() == "TX") {
169 const auto* tx = dynamic_cast<const Tx4Block*>(block.get());
170 dest.emplace_back("Reference Link TX", ToHexString(block->FilePosition()),
171 tx != nullptr ? tx->Text() : "",
172 BlockItemType::LinkItem);
173 } else if (block->BlockType() == "CC") {
174 const auto* cc = dynamic_cast<const Cc4Block*>(block.get());
175 dest.emplace_back("Reference Link CC", ToHexString(block->FilePosition()),
176 cc != nullptr ? cc->Name() : "",
177 BlockItemType::LinkItem);
178 }
179 }
180 dest.emplace_back("", "", "", BlockItemType::BlankItem);
181
182 dest.emplace_back("Information", "", "", BlockItemType::HeaderItem);
183 if (Link(kIndexName) > 0) {
184 dest.emplace_back("Name", name_);
185 }
186 if (Link(kIndexUnit) > 0) {
187 dest.emplace_back("Unit", Unit());
188 }
189 if (precision_ < 0xFF) {
190 dest.emplace_back("Nof Decimals", std::to_string(precision_));
191 }
192 dest.emplace_back("Conversion Type", MakeTypeString(type_));
193 dest.emplace_back("Flags", MakeFlagString(flags_));
194 dest.emplace_back("Nof References", std::to_string(nof_references_));
195 dest.emplace_back("Nof Values", std::to_string(nof_values_));
196 dest.emplace_back("Min Range", ToString(range_min_));
197 dest.emplace_back("Max Range", ToString(range_max_));
198 for (uint16_t ii = 0; ii < static_cast<uint16_t>(value_list_.size()); ++ii) {
199 std::ostringstream label;
200 label << "Value " << ii;
201 dest.emplace_back(label.str(), ToString(Parameter(ii)) );
202 }
203 if (md_comment_) {
204 md_comment_->GetBlockProperty(dest);
205 }
206}
207

Callers

nothing calls this directly

Calls 11

ToHexStringFunction · 0.85
ToStringFunction · 0.85
MakeTypeStringFunction · 0.70
MakeFlagStringFunction · 0.70
CommentMethod · 0.45
BlockTypeMethod · 0.45
getMethod · 0.45
FilePositionMethod · 0.45
TextMethod · 0.45
NameMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected