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

Method Unit

lib/mdflib/mdflib/src/cn4block.cpp:290–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288}
289
290std::string Cn4Block::Unit() const {
291
292 if (!unit_) {
293 switch (Sync()) {
294 case ChannelSyncType::Time:
295 return "s";
296
297 case ChannelSyncType::Angle:
298 return "rad";
299
300 case ChannelSyncType::Distance:
301 return "m";
302
303 default:
304 break;
305 }
306
307 // Return the CC block unit if it exists.
308 return cc_block_ ? cc_block_->Unit() : std::string();
309 }
310
311 if (unit_->IsTxtBlock()) {
312 return unit_->Text();
313 }
314 return unit_->TxComment();
315}
316
317void Cn4Block::GetBlockProperty(BlockPropertyList &dest) const {
318 MdfBlock::GetBlockProperty(dest);

Callers

nothing calls this directly

Calls 8

MdStringClass · 0.85
IsTxtBlockMethod · 0.80
emptyMethod · 0.80
TextMethod · 0.45
TxCommentMethod · 0.45
resetMethod · 0.45
CommentMethod · 0.45
ToXmlMethod · 0.45

Tested by

no test coverage detected