| 288 | } |
| 289 | |
| 290 | std::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 | |
| 317 | void Cn4Block::GetBlockProperty(BlockPropertyList &dest) const { |
| 318 | MdfBlock::GetBlockProperty(dest); |