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