00001 #include "FullBypassTestResultStreamer.h"
00002
00003 using namespace Sct;
00004
00005 namespace SctData {
00006 namespace IO {
00007
00008 FullBypassTestResultStreamer::FullBypassTestResultStreamer() throw() {}
00009
00010 bool FullBypassTestResultStreamer::inMap = IOManager::addToMap("SctData::FullBypassTestResult", auto_ptr<Streamer>(new FullBypassTestResultStreamer()));
00011
00012 shared_ptr<Streamable> FullBypassTestResultStreamer::read(IStream& in, const IOManager& manager) const throw(LogicError, IoError){
00013 boost::shared_ptr<Streamable> ad (new FullBypassTestResult());
00014 read(in, *ad, manager);
00015 return ad;
00016 }
00017
00018 void FullBypassTestResultStreamer::write(OStream& out, const Streamable& ob, const IOManager& manager) const throw(LogicError, IoError) {
00019
00020
00021 TestResultStreamer::write(out, ob, manager);
00022
00023 const FullBypassTestResult& mytest = dynamic_cast<const FullBypassTestResult&>(ob);
00024
00025 out << mytest.getVddNom() << mytest.getNConfig();
00026
00027 for (unsigned int ichip=0; ichip<nChipModule; ichip++) {
00028 writeChipResult(out, mytest.getChipResult(ichip), manager);
00029 }
00030 }
00031
00032 void FullBypassTestResultStreamer::read(IStream& in, Streamable& ob, const IOManager& manager) const throw(LogicError, IoError) {
00033 TestResultStreamer::read(in, ob, manager);
00034
00035 FullBypassTestResult& mytest = dynamic_cast<FullBypassTestResult&>(ob);
00036
00037 bool mybool; float myfloat; unsigned myunsigned;
00038 in >> myfloat; mytest.setVddNom(myfloat);
00039 in >> myunsigned; mytest.setNConfig(myunsigned);
00040
00041 for (unsigned int ichip=0; ichip<nChipModule; ichip++) {
00042 readChipResult(in, mytest.getChipResult(ichip), manager);
00043 }
00044 }
00045
00046 void FullBypassTestResultStreamer::writeChipResult(OStream& out, const FullBypassTestResult::ChipFBResult& c, const IOManager& manager) const throw (LogicError, IoError) {
00047 out << c.status_direct << c.vdd_direct << c.status_bypass << c.vdd_bypass;
00048 }
00049
00050 void FullBypassTestResultStreamer::readChipResult(IStream& in, FullBypassTestResult::ChipFBResult& c, const IOManager& manager) const throw(LogicError, IoError) {
00051 in >> c.status_direct >> c.vdd_direct >> c.status_bypass >> c.vdd_bypass;
00052 }
00053
00054 }
00055 }