* Read a control network file and prepare the data to be converted into * a control network. * * @param netFile The control network file to read. * @param progress The progress object to track reading points. */
| 551 | * @param progress The progress object to track reading points. |
| 552 | */ |
| 553 | void ControlNetVersioner::read(const FileName netFile, Progress *progress) { |
| 554 | try { |
| 555 | |
| 556 | const Pvl &network(netFile.expanded()); |
| 557 | |
| 558 | if ( network.hasObject("ProtoBuffer") ) { |
| 559 | readProtobuf(network, netFile, progress); |
| 560 | } |
| 561 | else if ( network.hasObject("ControlNetwork") ) { |
| 562 | readPvl(network, progress); |
| 563 | } |
| 564 | else { |
| 565 | QString msg = "Could not determine the control network file type"; |
| 566 | throw IException(IException::Io, msg, _FILEINFO_); |
| 567 | } |
| 568 | } |
| 569 | catch (IException &e) { |
| 570 | QString msg = "Reading the control network [" + netFile.name() |
| 571 | + "] failed"; |
| 572 | throw IException(e, IException::Io, msg, _FILEINFO_); |
| 573 | } |
| 574 | } |
| 575 | |
| 576 | |
| 577 | /** |
no test coverage detected