/******************************************************************************* This function update the free mem *******************************************************************************/ static void _memUpdate() { OBJECT *tree; int i,obx,oby,obw,obh; glb.mem.tfre=(*manag_size)(); if (glb.mem.tfre!=glb.mem.free && !glb.div.Exit) { glb.mem.free=glb.mem.tfre; updFreeMem(); _initRSC(FMEM,FMEMSYS); _initRSC(FMEM,FMEMLEN); _initRSC(FMEM,FMEMFRE); wind_update(BEG_UPDATE); i=_winFindId(TW_FORM,FMEM,TRUE); if (i!=-1) { tree=glb.rsc.head.trindex[FMEM]; _coord(tree,FMEMLEN,TRUE,&obx,&oby,&obw,&obh); _winObdraw(i,tree,FMEMLEN,MAX_DEPTH,obx,oby,obw,obh); _coord(tree,FMEMFRE,TRUE,&obx,&oby,&obw,&obh); _winObdraw(i,tree,FMEMFRE,MAX_DEPTH,obx,oby,obw,obh); _coord(tree,FMEMSYS,TRUE,&obx,&oby,&obw,&obh); _winObdraw(i,tree,FMEMSYS,MAX_DEPTH,obx,oby,obw,obh); } wind_update(END_UPDATE); } }
double Excellon::InterpretCoord( const char *coordinate, const int digits_left_of_point, const int digits_right_of_point, const bool leading_zero_suppression, const bool trailing_zero_suppression ) const { double multiplier = m_units; double result; std::string _coord( coordinate ); if (_coord[0] == '-') { multiplier *= -1.0; _coord.erase(0,1); } // End if - then if (_coord[0] == '+') { multiplier *= +1.0; _coord.erase(0,1); } // End if - then if (leading_zero_suppression) { while (_coord.size() < (unsigned int) digits_right_of_point) _coord.insert(0,"0"); // use the end of the string as the reference point. result = atof( _coord.substr( 0, _coord.size() - digits_right_of_point ).c_str() ); result += (atof( _coord.substr( _coord.size() - digits_right_of_point ).c_str() ) / pow(10.0, digits_right_of_point)); } // End if - then else { if (trailing_zero_suppression) { while (_coord.size() < (unsigned int) digits_left_of_point) _coord.push_back('0'); } // End while // use the beginning of the string as the reference point. result = atof( _coord.substr( 0, digits_left_of_point ).c_str() ); result += (atof( _coord.substr( digits_left_of_point ).c_str() ) / pow(10.0, (int)(_coord.size() - digits_left_of_point))); } // End if - else result *= multiplier; // printf("Excellon::InterpretCoord(%s) = %lf\n", coordinate, result ); return(result); } // End InterpretCoord() method