void portExcitation::ecrire(int nb) {

    std::ostringstream monEcriture;
    monEcriture << "Port_d'excitation_numero_" << nb << "\n";
    monEcriture << "Port_actif_OUI>1_NON>0:\n";
    monEcriture << ((int)this->portActif) << std::endl;
    monEcriture << "Port_infinitésimal_OUI>1_NON>0\n";
    monEcriture << ((int)this->portInfinitesimal) << std::endl;
    if(this->portInfinitesimal) {
        monEcriture << "Port_type_Magnétique>1_Electrique>2\n";
        monEcriture << this->typePort << std::endl;
    }
    monEcriture << "Direction_1>x_2>y_3>z\n";
    monEcriture << this->direction << std::endl;
    std::string ecriture(monEcriture.str());
    Ecriture::Ecrire(ecriture);

    //Les coordonnées
    this->ecrireElementBase();

    std::ostringstream finEcriture;
    finEcriture << "Impedance_de_la_source_(en_Ohm):\n";
    finEcriture << this->impedance << std::endl;
    finEcriture << "Source_de_tension>1_Source_de_courant:\n";
    finEcriture << this->typeSource << std::endl;
    finEcriture << "Ponderation_amplitude_(coefficient_multiplicatif):\n";
    finEcriture << this->ponderationAmplitude << std::endl;
    finEcriture << "Ponderation_phase_(retard_temporel_en_s):\n";
    finEcriture << this->ponderationPhase << std::endl;
    std::string ecritureFin(finEcriture.str());
    Ecriture::Ecrire(ecritureFin);
}
Ejemplo n.º 2
0
void sonde::ecrire(int nb){

    std::ostringstream monEcriture;
    monEcriture << "Sonde_numero_" << nb << "\n";
    monEcriture << "Ex_1>OUI_0>NON\n";
    monEcriture << ((int)this->ex) << std::endl;
    monEcriture << "Ey_1>OUI_0>NON\n";
    monEcriture << ((int)this->ey) << std::endl;
    monEcriture << "Ez_1>OUI_0>NON\n";
    monEcriture << ((int)this->ez) << std::endl;
    monEcriture << "Hx_1>OUI_0>NON\n";
    monEcriture << ((int)this->hx) << std::endl;
    monEcriture << "Hy_1>OUI_0>NON\n";
    monEcriture << ((int)this->hy) << std::endl;
    monEcriture << "Hz_1>OUI_0>NON\n";
    monEcriture << ((int)this->hz) << std::endl;
    std::string ecriture(monEcriture.str());
    Ecriture::Ecrire(ecriture);

    //Le point d'application
    Ecriture::Ecrire("Coordonnees_du_point_d_application\n");
    this->pointApplication.ecrire();

    std::ostringstream finEcriture;
    finEcriture << "Valeur_au_centre_de_la_cellule_de_YEE_OUI>1_NON>0:\n";
    finEcriture << ((int)this->valeurAuCentre) << std::endl;
    std::string ecritureFin(finEcriture.str());
    Ecriture::Ecrire(ecritureFin);

}
void elementLocalise::ecrire(int nb){

    std::ostringstream monEcriture;
    monEcriture << "Element_Localise_numero_" << nb << "\n";
    monEcriture << "Type_d_element_1>resistance_2>capacite_3>self:\n";
    monEcriture << this->type << std::endl;
    monEcriture << "Valeur_de_l_element_en_Ohm_Farad_ou_Henry:\n";
    monEcriture << this->valeur << std::endl;
    monEcriture << "Direction_1>x_2>y_3>z\n";
    monEcriture << this->direction << std::endl;
    std::string ecriture(monEcriture.str());
    Ecriture::Ecrire(ecriture);

    this->ecrireElementBase();
}
void blocMetallisation::ecrire(){

    setHeader("[METALLISATIONS]");
    setExtension(".dsc");
    this->blocConfiguration::ecrire();



    std::ostringstream monEcriture;
    monEcriture << "Nombre_de_plans_de_metallisations\n";
    monEcriture << this->getNbElement() << std::endl;

    std::string ecriture(monEcriture.str());
    Ecriture::Ecrire(ecriture);

    for(int i=0; i<this->getNbElement() ; i++){
        metallisation* temp = this->GetMetallisation(i);
        temp->ecrire(i+1);
    }

    Ecriture::Ecrire("\n");
}
void cageExcitation::ecrire(){

    setHeader("[CAGES_EXCITATION]");
    setExtension(".ana");
    this->blocConfiguration::ecrire();

    std::ostringstream monEcriture;
    monEcriture << "Nombre_de_cages_d_excitation:\n";
    if (!isCreate())
    {
        monEcriture << 0 << std::endl;
        Ecriture::Ecrire(monEcriture.str());
    }
    else
    {
        monEcriture << 1 << std::endl;
        monEcriture << "Cage_excitation_numero_1\n";
        monEcriture << "Type_excitation_1>inside_2>outside\n";
        monEcriture << this->insideOutside << std::endl;
        monEcriture << "Nombre_de_faces_d_excitation:\n";
        monEcriture << this->nbFaces << std::endl;
        monEcriture << "Type_excitation_1>onde_plane_2>TE10_3>TM10_4>fichier_excitation\n";
        monEcriture << this->typeExcitation << std::endl;

        if(this->nbFaces == 1 && this->typeExcitation >= 1 && this->typeExcitation <= 3){
            monEcriture << "Type_0>OndeplaneX_1>OndeplaneY_2>GuideTE10X_3>GuideTE10Y:\n";
            monEcriture << this->modeExcitation << std::endl;
            monEcriture << "Coordonnees_sur_la_hauteur:\n";
            monEcriture << this->hauteur << std::endl;
            monEcriture << "Sens_de_propagation_de_l_onde_-1>z_croissants_2>z_decroissants:\n";
            monEcriture << this->sensPropagation << std::endl;

            std::string ecriture(monEcriture.str()); //Il faut qu'on écrive ici, car il y a les coordonnées après
            Ecriture::Ecrire(ecriture);
        } else {

            if(this->typeExcitation == 4){
                monEcriture << "Nom_du_fichier\n";
                monEcriture << this->nomFichier << std::endl;
            }

            //Du coup on écrit aussi dans le else
            Ecriture::Ecrire(monEcriture.str());

            //On écrit les coordonnées
            this->ecrireElementBase();

            //On ouvre un aute flux
            std::ostringstream finEcriture;

            if(this->typeExcitation >= 1 && this->typeExcitation <= 3){
                Ecriture::Ecrire("Coordonnees_du_point_de_reference\n");
                this->GetPointReference().ecrire();

                finEcriture << "Avec_les_angles_d_incidence_en_degres\n";
                finEcriture << "theta0:\n";
                finEcriture << this->theta0 << std::endl;
                finEcriture << "phi0:\n";
                finEcriture << this->phi0 << std::endl;
                finEcriture << "psi0_(angle_forme_par_vecteur_E_et_e_theta):\n";
                finEcriture << this->psi0 << std::endl;
            }

            if(this->typeExcitation == 4){
                finEcriture << "Coefficient_modulation_amplitude:\n";
                finEcriture << this->modulationAmplitude << std::endl;
                finEcriture << "Coefficient_modulation_phase_(retard_temporel):\n";
                finEcriture << this->modulationPhase << std::endl;
            }

            Ecriture::Ecrire(finEcriture.str());
        }

    }

    Ecriture::Ecrire("\n");
}
Ejemplo n.º 6
0
void Configuration::enregistrer (std::string chemin) const
{
	std::ofstream fichierEnregistrement(chemin);
	boost::archive::text_oarchive ecriture(fichierEnregistrement);
    ecriture << *this;
}