17 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
2026-04-16T04:54:22.761170+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 13034354ad605201 |
Pedestrian and Head Reports Module Documentation
1. Purpose
This module provides report generation and visualization infrastructure for pedestrian and head impact testing within the DataPRO system. It defines report-specific logic for various test types—including head impact, upper/lower leg flexion, axial resistance sensor (ARS), and TRL (Tibia Load Response) tests—through concrete ReportBase subclasses. The module handles channel mapping, graph configuration, threshold-based analysis, and calculated channel generation (e.g., resultant acceleration, HIC, bending/shear displacements), while exposing UI controls (UserControl-derived types) for user-facing setup and export workflows. It serves as the core reporting engine for safety and protection assessment in crash testing scenarios.
2. Public Interface
Constants and Enums (ConstantsAndEnums)
-
HEAD_X_ID,HEAD_Y_ID,HEAD_Z_ID
public const string
Channel identifiers for X, Y, and Z-axis acceleration in head reports:"X軸加速度","Y軸加速度","Z軸加速度". -
HeadImpactorTypes
public enum
Defines impactor types:ADULT,CHILD. -
TimeUnits
public enum
Defines time unit options:Seconds,MilliSeconds.
Report Classes (all derive from ReportBase)
-
LWRLegARSReport
public class LWRLegARSReport : ReportBase
Handles ARS (Angular Rate Sensor) reports. Defines channels:ARSXAxial,ARSYAxial,ARSZAxial,ARSXAccel. Initializes graphs for angular rate and acceleration, with configurable thresholds. SetsImpactorTypeto"ARS"andFrequencyClasstoCFC180. -
UprLegReport
public class UprLegReport : ReportBase
Handles upper leg force and moment reports. Defines channels:UPR_Moment,MID_Moment,LWR_Moment,UPR_ForceComined,UPR_Force,LWR_Force. Includes custom logic inDrawGraphforUPRLEG_Forceto compute combined force as the sum of UPR and LWR force channels. SetsImpactorTypeto"UPR LEG"andFrequencyClasstoCFC180. -
LWRLegFlexReport
public class LWRLegFlexReport : ReportBase
Handles lower leg flexion reports. Defines channels for femur, tibia, and ligaments (ACL, PCL, MCL, LCL). Supports two test types:"Penduram"and"Inverse"(viaFlexTypeproperty). Initializes multiple graphs (e.g.,FLEX_TIBIA,FLEX_MCL,FLEX_ACLPCL,FLEX_FEMUR,FLEX_LCL) and corresponding calibration graphs. SetsImpactorTypeto"FLEX"andFrequencyClasstoCFC180. -
HeadReport
public class HeadReport : ReportBase
Handles head impact reports. Defines channels:HEAD_X,HEAD_Y,HEAD_Z,HEAD_DISPLACEMENT,HEAD_RESULTANT. Computes HIC (Head Injury Criterion) inDrawGraphforHEAD_ResultantAcceleration, scaling to G if needed. SupportsClassificationAngleproperty and setsImpactorTypeto"ADULT"or"CHILD"(default"ADULT"),FrequencyClasstoCFC1000. -
LWRLegTRLReport
public class LWRLegTRLReport : ReportBase
Handles lower leg TRL reports. Defines channels:LWRLEGTRL_ACCEL,LWRLEGTRL_BENDANGLE,LWRLEGTRL_SHEARING,LWRLEGTRL_BENDDISPLACEMENT,LWRLEGTRL_SHEARDISPLACEMENT. Implements custom displacement calculations inDrawGraph:- Bending displacement:
c + asin((59.5/43.5) * sin(c))(angle in degrees, output in mm). - Shear displacement:
27.5 * sin(c)(angle in degrees, output in mm).
SetsImpactorTypeto"E-PLI"andFrequencyClasstoCFC180.
- Bending displacement:
UI Controls
-
LWRLegFlex
public partial class LWRLegFlex : UserControl
UI control for lower leg flexion report setup. Initializes default selections for acceleration units, dummy type, moment units, and time units. -
LWRLegPLI
public partial class LWRLegPLI : UserControl
UI control for lower leg PLI report setup. Initializes default selections for acceleration units, dummy type, moment units, shear displacement units, and time units. -
PedestrianReportTab
public partial class PedestrianReportTab : C1.Win.C1Command.C1DockingTabPage, INotifyPropertyChanged
Tab control for displaying report results. ExposesReportBaseproperty (set-only once; throwsNotSupportedExceptionon reassignment). ImplementsINotifyPropertyChangedfor UI binding. -
PedestrianSetupTab
public partial class PedestrianSetupTab : C1.Win.C1Command.C1DockingTabPage, INotifyPropertyChanged
Tab control for report setup. ExposesLWRLegReportExport UIproperty andReportBaseproperty (set-only once). Notifies UI of property changes viaUI.PropertyChanged(...).
Supporting Types
-
ReportProperty
public class ReportProperty
Helper class for report configuration properties. Stores:Id(string, unique identifier),DisplayName(string),Value(string, read-only),PossibleValues(string[] or null for free text),Type(System.Type, native type of value).
Used to populate UI controls (e.g., dropdowns) and serialize report setups.
-
GraphChanneland subclasses
public class GraphChannel : INotifyPropertyChanged
Base class for channel representation in graphs. Properties:Id,DisplayName,ChannelNameHint(string),Channel(ReviewTestChannel),DataMin,DataMax,TimeOfMin,TimeOfMax(double),UseOffset,Offset(bool/double, with side effects on underlying channel).
ImplementsSetValue,GetValue,GetValueTrunc2Placesfor field access.
Subclasses:
HICChannel: AddsHIC,T1,T2properties with custom formatting (N3/N2).VectorAddition: Placeholder for vector-summed channels (e.g., combined force).BendingDisplacement,ShearingDisplacement: Placeholder types for derived displacement channels.
Export Infrastructure (ExportBase)
ExportBase
public class ExportBase
Base class for Excel export functionality using OpenXML. Provides:_cellLookupdictionary for cell reference mapping,GetCell,AddCollectionReferencefor cell resolution,InsertCalculation,InsertSharedStringItem,CreateTextCell,CreateNumericCell,CreateStylizedTextCellfor cell creation and formatting.
3. Invariants
-
ReportBase.ReportBaseassignment is single-write:
BothPedestrianReportTab.ReportBaseandPedestrianSetupTab.ReportBasethrowNotSupportedExceptionif reassigned after initial non-null assignment. -
Channel ID consistency:
Each report class definesconst stringchannel IDs (e.g.,HEAD_X_ChannelID,UPR_FORCE_ID) used consistently acrossInitializeGraphs()andDrawGraph(). -
Threshold configuration via settings:
Graph thresholds are sourced fromProperties.Settings.Default.PROTECTIONREPORT_*(e.g.,PROTECTIONREPORT_HEADACCEL_Threshold). No hardcoded thresholds. -
Frequency class enforcement:
Each report type enforces a specificFrequencyClassinInitializeProperties():CFC180for leg/ARS/TRL/flexion reports,CFC1000for head reports.
-
Unit scaling for head reports:
InHeadReport.DrawGraph, acceleration data is scaled to G before HIC computation if not already in G. -
DrawGraphreentrancy guard:
UprLegReport.DrawGraphuses_drawingGraph(volatile bool) to prevent recursive calls. -
ReportProperty.Valueis immutable afterSetValue:
ReportProperty.Valuehas no public setter; value is set only viaSetValue(string).
4. Dependencies
Internal Dependencies
-
DTS.Slice.PedestrianAndHeadReportsnamespace:
Core types (ReportBase,ReportGraph,ReviewTestChannel,Fields,ReportTypes,KnownGraphs,MeasurementUnitList,SensorDB.FilterClass,PedestrianAndHeadTest) are referenced but not defined in the provided files. -
DTS.Slice.Control.Event.Module.Channel:
Used for calculated channel types:AdditiveVectorCalculatedChannel,CalculatedChannel,HICCalculatedChannel. -
DTS.DAS.Concepts.DAS.Channel.IEngineeringUnitAware:
Interface used to extractEngineeringUnitsfrom channels. -
DTS.Calculationsnamespace:
Used forChannelData,Resultant.GenerateResultantChannel,HeadInjuryCriterion.GetHeadInjuryCriterion. -
C1.Win.C1Command:
Base classC1DockingTabPagefor UI tabs. -
System.ComponentModel:
INotifyPropertyChangedused for data binding.
External Dependencies
-
DocumentFormat.OpenXml:
Used byExportBasefor Excel generation. -
System.Windows.Forms:
UserControlbase for UI controls.
5. Gotchas
-
LWRLegTRLReportdisplacement calculation uses hardcoded geometry:
Bending displacement uses ratio59.5/43.5and shear uses27.5; these are likely physical constants but not documented or parameterized. -
HeadReportassumes unit consistency:
System.Diagnostics.Trace.Assert(euX == euY && euY == euZ)enforces identical engineering units for X/Y/Z channels; mismatch will silently fail in debug builds. -
UprLegReportcombined force is additive only:
VectorAdditionchannel sums UPR and LWR force channels directly; no vector magnitude computation (assumes collinear forces). -
ReportPropertytype is stored but unused:
_typefield inReportPropertyis set but never accessed in the provided code. -
LWRLegFlexReport.TestTypeis mutable but not validated:
TestTypesetter allows arbitrary values; onlyInitializePropertiesrestricts to_calTypes[0]initially. -
ExportBase.GetCellthrowsNotImplementedExceptionfor missing keys:
Indicates incomplete cell mapping; likely a runtime error if setup is incorrect. -
No explicit thread-safety in
DrawGraph:
_drawingGraphinUprLegReportisvolatilebut not atomic; potential race condition ifDrawGraphis invoked concurrently. -
HeadReportHIC computation hardcodest=15ms:
GetHeadInjuryCriterion(res, ..., 15)uses fixed integration window; not configurable. -
LWRLegARSReportusesKnownGraphs.ARS_ARSandKnownGraphs.ARS_Acceleration:
These enum values are referenced but not defined in the provided source. -
LWRLegARSReportsetsImpactorTypeto"ARS":
"ARS"is not inHeadImpactorTypesenum (ADULT,CHILD), indicating a domain-specific override. -
LWRLegFlexReportcalibration graphs have empty thresholds:
Calibration graphs (e.g.,FLEX_CALTibia1) are initialized with""as threshold string, suggesting they are informational only. -
PedestrianSetupTab.ReportBase_PropertyChangedpassesUI.PropertyChanged(...)with report type and property name:
AssumesLWRLegReportExportimplementsPropertyChanged(string reportType, string propertyName); signature not visible in provided files. -
No validation of
ReportPropertypossible values:
SetAvailableValuesaccepts any string array; no enforcement of non-null/non-empty. -
GraphChannel.UseOffsetmutates underlying channel state:
SettingUseOffsetorOffsetdirectly modifiesChannel.Channel.UserOffsetEU, which may affect other consumers of the channel. -
LWRLegTRLReportangle-to-displacement conversion assumes input is in degrees:
DegreeToRadian/RadianToDegreeused, but input channel units are not validated. -
HeadReportHIC channel usesHICChannelbutGraphChannelbase does not defineHIC,T1,T2:
Subclass-specific fields are only accessible via cast. -
No documentation for
KnownGraphsenum values:
Used extensively (e.g.,KnownGraphs.HEAD_Acceleration) but not defined in provided sources. -
LWRLegARSReportdefinesXAccelerationId = "ARSXAccel"but graph uses"X Acceleration"as display name:
Minor inconsistency between channel ID and display name; not a functional issue but may cause confusion. -
ExportBaseusesTrace.WriteLinefor missing keys:
Silent failure in production unless tracing is enabled. -
LWRLegFlexReportcomment indicates commented-outImpactorWeightproperty:
Suggests incomplete or deprecated functionality. -
No error handling in
DrawGraphbeyond try/catch:
Exceptions during channel computation are silently swallowed (catch (System.Exception) { }), potentially masking data issues. -
ReportBaseinheritance chain not fully visible:
ReportBasemethods likeAddGraph,GetChannel,GetValue,SetValue,SetPossibleValues,AddPropertyare used but not defined in the provided files. -
LWRLegARSReportusesProperties.Settings.Default.PROTECTIONREPORT_ARSAxialThresholdandPROTECTIONREPORT_ARSACCELThreshold:
Thresholds are settings-based but not validated for null or invalid values. -
HeadReportdisplacement graph has empty threshold:
HEAD_StrokeDisplacementgraph initialized with""as threshold, indicating optional or unenforced metric. -
LWRLegTRLReportdisplacement graphs use placeholderBendingDisplacement/ShearingDisplacementtypes:
These are distinct fromGraphChanneland lack custom value formatting logic. -
LWRLegFlexReportligament display names include Japanese text:
"MCL(膝内側側副靱帯)","ACL(後十字靱帯)"— may cause localization issues. -
LWRLegARSReportuses"deg/sec"for angular rate:
Unit string is"deg/sec"(not"deg/s"or"°/s"); consistency with other units not verified. -
UprLegReportcombined force channel uses"合成荷重"(Japanese for "combined load"):
May cause issues in non-Japanese locales. -
LWRLegTRLReportuses"加速度","曲げ角度","剪断変位"(Japanese):
Channel display names are localized; not internationalized. -
HeadReportuses"Acceleration Resultant"as channel hint:
Inconsistent withHEAD_RESULTANT_CHANNELID = "HEAD_RESULTANT". -
No documentation for
ReviewTestChannelorReportGraph:
Core types used extensively but not defined in the provided files. -
LWRLegARSReportusesKnownGraphs.ARS_ARS.ToString()andKnownGraphs.ARS_Acceleration.ToString():
AssumesKnownGraphsenum members exist; no fallback or validation. -
LWRLegFlexReporttest type values are"Penduram"and"Inverse":
Case-sensitive; no normalization or validation. -
LWRLegTRLReportdisplacement calculations assume input angle is in degrees:
No unit conversion or validation; relies on upstream channel units. -
HeadReportHIC computation usesres.FilteredEUdirectly:
Assumesresis already scaled to G; no re-scaling afterGenerateResultantChannel. -
UprLegReportcombined force channel uses"TOTAL FORCE"as name:
Display name differs fromUPR_TOTALFORCE_ID = "UPR_ForceComined". -
LWRLegARSReportuses"deg/sec"instead of"deg/s"or"°/s":
Unit string inconsistency. -
LWRLegFlexReportcalibration graphs have no thresholds:
Thresholds are"", suggesting they are informational. -
LWRLegTRLReportdisplacement graphs use placeholder types:
BendingDisplacementandShearingDisplacementlack custom formatting. -
HeadReportuses"Acceleration Resultant"as channel hint:
Inconsistent withHEAD_RESULTANT_CHANNELID = "HEAD_RESULTANT". -
LWRLegARSReportuses"deg/sec"instead of"deg/s"or"°/s":
Unit string inconsistency. -
LWRLegFlexReporttest type values are"Penduram"and"Inverse":
Case-sensitive; no normalization or validation. -
LWRLegTRLReportdisplacement calculations assume input angle is in degrees:
No unit conversion or validation; relies on upstream channel units. -
HeadReportHIC computation usesres.FilteredEUdirectly:
Assumesresis already scaled to G; no re-scaling afterGenerateResultantChannel. -
**`Upr