Skip to content

Commit

Permalink
Merge pull request #218 from wbinek/Port_STI_calculation
Browse files Browse the repository at this point in the history
Port STI calculation code
Basically the STI computation is based on IEC:60268-16:2011 standard. The NC curves are used to introduce background noise to the STI calculation (see: https://www.engineeringtoolbox.com/nc-noise-criterion-d_725.html).
  • Loading branch information
nicolas-f authored Sep 26, 2024
2 parents f9aa8f1 + e9da8b3 commit 91fc805
Show file tree
Hide file tree
Showing 8 changed files with 549 additions and 22 deletions.
6 changes: 6 additions & 0 deletions src/isimpa/3dengine/Core/Recepteurs_surfacique.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ bool RecepteursSControler::LoadRecepteursSFile(wxArrayString& recepteurSFiles, v
libellLegends.unit=_("%");
}else if(RecordRecepteurSurfType==(int)RECEPTEURS_RECORD_TYPE_PRESSURE){
libellLegends.unit=_("Pascal");
}else if(RecordRecepteurSurfType==(int)RECEPTEURS_RECORD_TYPE_STI){
libellLegends.unit=_(" ");
}
libellLegends.labelEl=elConf->GetElementInfos().libelleElement;
}
Expand Down Expand Up @@ -731,6 +733,8 @@ bool RecepteursSControler::UserWantToKnowAcousticLevelAtPosition( vec3 extractPo
wxLogMessage(_("The pressure value at this coordinate is %.2f")+libellLegends.unit,energyValue);
else if(RecordRecepteurSurfType==(int)formatRSBIN::RECEPTEURS_RECORD_TYPE_EDT)
wxLogMessage(_("EDT at pointer is %.2f ")+libellLegends.unit,energyValue);
else if(RecordRecepteurSurfType==(int)formatRSBIN::RECEPTEURS_RECORD_TYPE_STI)
wxLogMessage(_("The STI value at this coordinate is %.2f")+libellLegends.unit,energyValue);
}
}
}else{
Expand Down Expand Up @@ -762,6 +766,8 @@ void RecepteursSControler::RedrawLegend()
wxString precision("%.1f %s");
if(libellLegends.unit=="s")
precision="%.3f %s";
else if(libellLegends.unit==" ")
precision="%.2f %s";
libellLegends.maxValue=wxString::Format(precision,libellLegends.v_max,libellLegends.unit);
libellLegends.avgValue=wxString::Format(precision,(libellLegends.v_max-libellLegends.v_min)/2+libellLegends.v_min,libellLegends.unit);
libellLegends.minValue=wxString::Format(precision,libellLegends.v_min,libellLegends.unit);
Expand Down
3 changes: 2 additions & 1 deletion src/isimpa/data_manager/element.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public :
ELEMENT_TYPE_DIRECTIVITIES_APP,
ELEMENT_TYPE_DIRECTIVITIES_USER,
ELEMENT_TYPE_FILE,
ELEMENT_TYPE_REPORT_GABE_RECPS /*!< Receiver sound level by source */
ELEMENT_TYPE_REPORT_GABE_RECPS, /*!< Receiver sound level by source */
};
/**
* Indice des états des images
Expand Down Expand Up @@ -364,6 +364,7 @@ public :
IDEVENT_NEW_RECEPTEUR_S_COUPE, /*!< \~english Add a cutting plan receiver event \~french Ajouter une récepteur en coupe */
IDEVENT_BFREQ_PRESELECTION_ALL, /*!< \~english built-in event \~french Séléction automatique des bandes de fréquences */
IDEVENT_NEW_USERDIRECTIV,
IDEVENT_RECEPTEURS_COMPUTE_STI,
IDEVENT_LAST_FIXED /* !! This event must be the last, those before are "built-in" and those after are send to python */
};
/**
Expand Down
4 changes: 4 additions & 0 deletions src/isimpa/data_manager/projet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,9 @@ void ProjectManager::ElementEvent(wxCommandEvent& eventElement,eventCtrl fromCtr
case Element::IDEVENT_RECEPTEURS_COMPUTE_ST:
this->OnMenuRecepteurSurfDoAcousticParametersComputation(pCtrl,eRoot,elementSelected,"ST");
break;
case Element::IDEVENT_RECEPTEURS_COMPUTE_STI:
this->OnMenuRecepteurSurfDoSTIComputation(pCtrl,eRoot,elementSelected,"STI");
break;
case Element::IDEVENT_NEW_RECEPTEURP_GROUP:
this->OnMenuNewRecepteurPGroup(elementSelected);
break;
Expand Down Expand Up @@ -3311,3 +3314,4 @@ void ProjectManager::OpenNewDataWindow(Element* linkedElement)
particulesContainer.EnableRendering(animationPropertyElement->GetBoolConfig("showparticle"));
recepteursSContainer.EnableRendering(animationPropertyElement->GetBoolConfig("showrecepteurss"));
}

1 change: 1 addition & 0 deletions src/isimpa/data_manager/projet.h
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@ class ProjectManager{
*/
void OnMenuDoAdvancedAcousticParametersComputation(Element* selectedElement); //
void OnMenuRecepteurSurfDoAcousticParametersComputation(uiTreeCtrl* fromCtrl,Element* eRoot,Element* rpadvres,const wxString& parametertype); //Calcul des paramètres acoustique d'un récepteur de surface
void OnMenuRecepteurSurfDoSTIComputation(uiTreeCtrl* fromCtrl,Element* eRoot,Element* rpadvres,const wxString& parametertype);

/**
* Supprimer l'element séléctionné par l'utilisateur
Expand Down
Loading

0 comments on commit 91fc805

Please sign in to comment.