Skip to content

Commit 91fc805

Browse files
authored
Merge pull request #218 from wbinek/Port_STI_calculation
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).
2 parents f9aa8f1 + e9da8b3 commit 91fc805

File tree

8 files changed

+549
-22
lines changed

8 files changed

+549
-22
lines changed

Diff for: src/isimpa/3dengine/Core/Recepteurs_surfacique.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@ bool RecepteursSControler::LoadRecepteursSFile(wxArrayString& recepteurSFiles, v
266266
libellLegends.unit=_("%");
267267
}else if(RecordRecepteurSurfType==(int)RECEPTEURS_RECORD_TYPE_PRESSURE){
268268
libellLegends.unit=_("Pascal");
269+
}else if(RecordRecepteurSurfType==(int)RECEPTEURS_RECORD_TYPE_STI){
270+
libellLegends.unit=_(" ");
269271
}
270272
libellLegends.labelEl=elConf->GetElementInfos().libelleElement;
271273
}
@@ -731,6 +733,8 @@ bool RecepteursSControler::UserWantToKnowAcousticLevelAtPosition( vec3 extractPo
731733
wxLogMessage(_("The pressure value at this coordinate is %.2f")+libellLegends.unit,energyValue);
732734
else if(RecordRecepteurSurfType==(int)formatRSBIN::RECEPTEURS_RECORD_TYPE_EDT)
733735
wxLogMessage(_("EDT at pointer is %.2f ")+libellLegends.unit,energyValue);
736+
else if(RecordRecepteurSurfType==(int)formatRSBIN::RECEPTEURS_RECORD_TYPE_STI)
737+
wxLogMessage(_("The STI value at this coordinate is %.2f")+libellLegends.unit,energyValue);
734738
}
735739
}
736740
}else{
@@ -762,6 +766,8 @@ void RecepteursSControler::RedrawLegend()
762766
wxString precision("%.1f %s");
763767
if(libellLegends.unit=="s")
764768
precision="%.3f %s";
769+
else if(libellLegends.unit==" ")
770+
precision="%.2f %s";
765771
libellLegends.maxValue=wxString::Format(precision,libellLegends.v_max,libellLegends.unit);
766772
libellLegends.avgValue=wxString::Format(precision,(libellLegends.v_max-libellLegends.v_min)/2+libellLegends.v_min,libellLegends.unit);
767773
libellLegends.minValue=wxString::Format(precision,libellLegends.v_min,libellLegends.unit);

Diff for: src/isimpa/data_manager/element.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public :
206206
ELEMENT_TYPE_DIRECTIVITIES_APP,
207207
ELEMENT_TYPE_DIRECTIVITIES_USER,
208208
ELEMENT_TYPE_FILE,
209-
ELEMENT_TYPE_REPORT_GABE_RECPS /*!< Receiver sound level by source */
209+
ELEMENT_TYPE_REPORT_GABE_RECPS, /*!< Receiver sound level by source */
210210
};
211211
/**
212212
* Indice des états des images
@@ -364,6 +364,7 @@ public :
364364
IDEVENT_NEW_RECEPTEUR_S_COUPE, /*!< \~english Add a cutting plan receiver event \~french Ajouter une récepteur en coupe */
365365
IDEVENT_BFREQ_PRESELECTION_ALL, /*!< \~english built-in event \~french Séléction automatique des bandes de fréquences */
366366
IDEVENT_NEW_USERDIRECTIV,
367+
IDEVENT_RECEPTEURS_COMPUTE_STI,
367368
IDEVENT_LAST_FIXED /* !! This event must be the last, those before are "built-in" and those after are send to python */
368369
};
369370
/**

Diff for: src/isimpa/data_manager/projet.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,9 @@ void ProjectManager::ElementEvent(wxCommandEvent& eventElement,eventCtrl fromCtr
598598
case Element::IDEVENT_RECEPTEURS_COMPUTE_ST:
599599
this->OnMenuRecepteurSurfDoAcousticParametersComputation(pCtrl,eRoot,elementSelected,"ST");
600600
break;
601+
case Element::IDEVENT_RECEPTEURS_COMPUTE_STI:
602+
this->OnMenuRecepteurSurfDoSTIComputation(pCtrl,eRoot,elementSelected,"STI");
603+
break;
601604
case Element::IDEVENT_NEW_RECEPTEURP_GROUP:
602605
this->OnMenuNewRecepteurPGroup(elementSelected);
603606
break;
@@ -3311,3 +3314,4 @@ void ProjectManager::OpenNewDataWindow(Element* linkedElement)
33113314
particulesContainer.EnableRendering(animationPropertyElement->GetBoolConfig("showparticle"));
33123315
recepteursSContainer.EnableRendering(animationPropertyElement->GetBoolConfig("showrecepteurss"));
33133316
}
3317+

Diff for: src/isimpa/data_manager/projet.h

+1
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,7 @@ class ProjectManager{
678678
*/
679679
void OnMenuDoAdvancedAcousticParametersComputation(Element* selectedElement); //
680680
void OnMenuRecepteurSurfDoAcousticParametersComputation(uiTreeCtrl* fromCtrl,Element* eRoot,Element* rpadvres,const wxString& parametertype); //Calcul des paramètres acoustique d'un récepteur de surface
681+
void OnMenuRecepteurSurfDoSTIComputation(uiTreeCtrl* fromCtrl,Element* eRoot,Element* rpadvres,const wxString& parametertype);
681682

682683
/**
683684
* Supprimer l'element séléctionné par l'utilisateur

0 commit comments

Comments
 (0)