@@ -173,6 +173,21 @@ public static PassThruSimulationGenerator LoadPassThruLogFile(string PassThruLog
173173 return new PassThruSimulationGenerator ( ExpressionGenerator ) ;
174174 }
175175 /// <summary>
176+ /// Spawns a new SimulationGenerator from a collection of PassThru log files.
177+ /// </summary>
178+ /// <param name="PassThruLogFiles">The log files to load into expressions. This MUST be a normal PassThru log!</param>
179+ /// <returns>A new expressions generator ready to load all content inside of the input log file</returns>
180+ public static PassThruSimulationGenerator LoadPassThruLogFiles ( string [ ] PassThruLogFiles )
181+ {
182+ // Load a generator for our content here
183+ PassThruExpressionsGenerator ExpressionGenerator = PassThruExpressionsGenerator . LoadPassThruLogFiles ( PassThruLogFiles ) ;
184+ if ( ExpressionGenerator . GenerateLogExpressions ( ) . Length == 0 )
185+ throw new DataException ( $ "Error! No expressions were able to be built from log file { ExpressionGenerator . PassThruLogFile } !") ;
186+
187+ // Build and return a new simulation generator from our built expressions objects
188+ return new PassThruSimulationGenerator ( ExpressionGenerator ) ;
189+ }
190+ /// <summary>
176191 /// Spawns a new SimulationGenerator from a PassThru expressions file
177192 /// </summary>
178193 /// <param name="ExpressionsFile">The expressions file to load and convert. This MUST be an Expressions log!</param>
@@ -222,6 +237,15 @@ public PassThruSimulationChannel[] GenerateLogSimulation()
222237 var PTFilterCommands = ExpressionSet . Value
223238 . Where ( ExpObj => ExpObj . TypeOfExpression == PassThruExpressionTypes . PTStartMsgFilter )
224239 . Cast < PassThruStartMessageFilterExpression > ( )
240+ . GroupBy ( FilterObj => new
241+ {
242+ FilterMask = FilterObj . MessageFilterContents [ 0 ] . Last ( ) ,
243+ FilterPattern = FilterObj . MessageFilterContents [ 1 ] . Last ( ) ,
244+ FilterFlow = FilterObj . MessageFilterContents . Count >= 3
245+ ? FilterObj . MessageFilterContents [ 2 ] . Last ( )
246+ : string . Empty
247+ } )
248+ . Select ( FilterGroup => FilterGroup . First ( ) )
225249 . ToArray ( ) ;
226250 var PTReadCommands = ExpressionSet . Value
227251 . Where ( ExpObj => ExpObj . TypeOfExpression == PassThruExpressionTypes . PTReadMsgs )
0 commit comments