//////////////////////////////////////////////////////////////////// // Function: PPInstance::read_xhost // Access: Private // Description: Reads the host data from the <host> (or <alt_host>) // entry in the contents.xml file. //////////////////////////////////////////////////////////////////// void PPInstance:: read_xhost(TiXmlElement *xhost) { // Get the "download" URL, which is the source from which we // download everything other than the contents.xml file. const char *download_url = xhost->Attribute("download_url"); if (download_url != NULL) { _download_url_prefix = download_url; } else { _download_url_prefix = PANDA_PACKAGE_HOST_URL; } if (!_download_url_prefix.empty()) { if (_download_url_prefix[_download_url_prefix.size() - 1] != '/') { _download_url_prefix += "/"; } } TiXmlElement *xmirror = xhost->FirstChildElement("mirror"); while (xmirror != NULL) { const char *url = xmirror->Attribute("url"); if (url != NULL) { add_mirror(url); } xmirror = xmirror->NextSiblingElement("mirror"); } }
void TDeviceFileInput::copy_contents(const TDeviceFileInput& new_device_input) { int i; MaterialParam j; MaterialParamInput new_param_input; DopingInput new_doping; StructureInput new_structure; for (i=0;i<new_device_input.number_grid;i++) add_grid(*(new_device_input.grid_ptr+i)); for (i=0;i<new_device_input.number_doping;i++) { new_doping.length=(new_device_input.doping_ptr+i)->length; new_doping.acceptor_function=(new_device_input.doping_ptr+i)->acceptor_function->create_copy(); new_doping.donor_function=(new_device_input.doping_ptr+i)->donor_function->create_copy(); new_doping.acceptor_degeneracy=(new_device_input.doping_ptr+i)->acceptor_degeneracy; new_doping.acceptor_level=(new_device_input.doping_ptr+i)->acceptor_level; new_doping.donor_degeneracy=(new_device_input.doping_ptr+i)->donor_degeneracy; new_doping.donor_level=(new_device_input.doping_ptr+i)->donor_level; add_doping(new_doping); } for (i=0;i<new_device_input.number_structure;i++) { new_structure.material_type=(new_device_input.structure_ptr+i)->material_type; new_structure.alloy_type=(new_device_input.structure_ptr+i)->alloy_type; new_structure.length=(new_device_input.structure_ptr+i)->length; new_structure.alloy_function=(new_device_input.structure_ptr+i)->alloy_function->create_copy(); add_structure(new_structure); } for (i=0;i<new_device_input.number_region;i++) add_region(*(new_device_input.region_ptr+i)); for (i=0;i<new_device_input.number_cavity;i++) add_cavity(*(new_device_input.cavity_ptr+i)); for (i=0;i<new_device_input.number_mirror;i++) add_mirror(*(new_device_input.mirror_ptr+i)); radius=new_device_input.radius; for (j=1;j<=MAT_MAX_NUMBER_PARAMETERS;j++) { for (i=0;i<new_device_input.number_material_param[j-1];i++) { new_param_input.length=(new_device_input.material_param_input[j-1]+i)->length; new_param_input.material_model= new TMaterialParamModel(*((new_device_input.material_param_input[j-1]+i)->material_model)); add_material_param(j,new_param_input); } } }