Changeset 393 for cpp/frams/model


Ignore:
Timestamp:
06/03/15 17:57:46 (9 years ago)
Author:
sz
Message:

f0 parsing corrections and enhancements:

  • f0 genotype becomes invalid if any of its numeric fields can't be parsed
  • ParamInterface::set and ParamInterface::load2 return the error flag if a numeric parsing error occured
  • fixed a bug in load2 (was failing on quoted fields containing a comma)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/model/model.cpp

    r391 r393  
    570570        partparam.select(p);
    571571        pos+=2;
    572         partparam.load2(line,pos);
     572        if (partparam.load2(line,pos) & ParamInterface::LOAD2_PARSE_FAILED) return -1;
    573573        p->o.rotate(p->rot);
    574574        parts+=p;
     
    582582        modelparam.select(this);
    583583        pos+=2;
    584         modelparam.load2(line,pos);
     584        if (modelparam.load2(line,pos) & ParamInterface::LOAD2_PARSE_FAILED) return -1;
    585585        return 0;
    586586        }
     
    592592        pos+=2;
    593593        j->owner=this;
    594         jointparam.load2(line,pos);
     594        if (jointparam.load2(line,pos) & ParamInterface::LOAD2_PARSE_FAILED) return -1;
    595595        if ((j->p1_refno>=0)&&(j->p1_refno<getPartCount())&&
    596596           (j->p2_refno>=0)&&(j->p2_refno<getPartCount()))
     
    620620        neuroparam.select(nu);
    621621        pos+=2;
    622         neuroparam.load2(line,pos);
     622        if (neuroparam.load2(line,pos) & ParamInterface::LOAD2_PARSE_FAILED) return -1;
    623623#ifdef MODEL_V1_COMPATIBLE
    624624        if (nu->neuro_refno>=0) // parent specified...
     
    684684        ncparam.select(&c);
    685685        pos+=2;
    686         ncparam.load2(line,pos);
     686        if (ncparam.load2(line,pos) & ParamInterface::LOAD2_PARSE_FAILED) return -1;
    687687        if ((c.n1_refno>=0)&&(c.n1_refno<getNeuroCount())&&(c.n2_refno>=0)&&(c.n2_refno<getNeuroCount()))
    688688                {
     
    706706        neuroitemparam.select(nu);
    707707        pos+=3;
    708         neuroitemparam.load2(line,pos);
     708        if (neuroitemparam.load2(line,pos) & ParamInterface::LOAD2_PARSE_FAILED) return -1;
    709709        // illegal parent?
    710710        if ((nu->neuro_refno<0)||(nu->neuro_refno>=old_getNeuroCount()))
Note: See TracChangeset for help on using the changeset viewer.