Repository navigation
Load With Associates Examples - #55
ma-bristow wants to merge 2 commits into
Conversation
| primarySessionParameterIdentifier, | ||
| associateParameterIdentifier | ||
| ]); | ||
|
|
There was a problem hiding this comment.
var buildResults = functionManager.Build(functionDefinition);
if (buildResults .Errors.Any())
{
Console.WriteLine("Function build failed.");
foreach (var error in buildResults .Errors)
{
Console.WriteLine($"{error}");
}
return;
}
Forgot to actually build the function. Needs to happen before we build the PDA.
| @@ -1389,6 +1453,96 @@ private static void ReadParameterUnit() | |||
| Console.WriteLine(); | |||
There was a problem hiding this comment.
// Assumption Session 02 is a continuation of Session 01.
var timeValuesLaterThanSession01 = samples.Timestamp.Last() > session01.Session.EndTime;
Console.WriteLine($"\nIs the last sample time value later than session 01? {timeValuesLaterThanSession01}");
In testing I added a little verification output to know it works.
| } | ||
|
|
||
| private static void CompositeSessionWithvTagSessionsTest() | ||
| /// <summary> |
There was a problem hiding this comment.
/// <summary>
/// This example demonstrates how to load two individual sessions from a SQL Race backed
/// database, append them into a single Composite Session, and then request
/// and print sample data for a specified parameter across the combined session range.
///
/// Appending sessions is useful when multiple related sessions need to be treated
/// as one continuous dataset. For example, you might combine several qualifying
/// runs into a single Composite Session to analyse a driver's full qualifying
/// performance, compare behaviour across runs, or access parameters seamlessly
/// across the full combined time window.
/// </summary>
Revision of description.
| } | ||
|
|
||
| private static void LoadSSNWithAssociatedMerge() | ||
| /// <summary> |
There was a problem hiding this comment.
/// <summary>
/// This example loads a Primary session and an Associate session (but multiple can base passed in) in order to
/// create a Composite Session (a session made up of one or more sessions).
/// It then retrieves and prints a small number of sample values for a
/// specified parameter from both the Primary and the Associate sessions.
/// </summary>
Minor revision to header.
| // ========= EDITABLE SECTION (tweak these values for your run) ========= | ||
| const string primarySsnPath = @"<FILE PATH TO .SSN>"; | ||
| const string associateSsnPath = @"<FILE PATH TO ASSOCIATE .SSN>"; | ||
| const string primaryParamId = "<PARAMETER IDENTIFIER FROM SESSION>"; |
There was a problem hiding this comment.
Think it would be better to be more verbose with the naming and consistent with what I had done so there is no confusion.
primaryParamId > primaryParameterIdentifier
associateParamId > associateParameterIdentifier
| using (var pda = compositeSession.CreateParameterDataAccess(primaryParamId)) | ||
| { | ||
| pda.GoTo(compositeSession.StartTime + (compositeSession.EndTime - compositeSession.StartTime) / 2); | ||
| var samples = pda.GetNextSamples(10); |
There was a problem hiding this comment.
var samples = pda.GetNextSamples(10);
if (samples == null)
{
Console.WriteLine($"Failed to get samples for {primaryParameterIdentifier}");
return;
}
Forgot to add a check to make sure we have samples.
| using (var pda = compositeSession.CreateParameterDataAccess(associateParamId)) | ||
| { | ||
| pda.GoTo(compositeSession.StartTime + (compositeSession.EndTime - compositeSession.StartTime) / 2); | ||
| var samples = pda.GetNextSamples(10); |
There was a problem hiding this comment.
var samples = pda.GetNextSamples(10);
if (samples == null)
{
Console.WriteLine($"Failed to get samples for {associateParameterIdentifier}");
return;
}
Forgot to add a check to make sure we have samples.
| /// <summary> | ||
| /// Loads a session with an associated session | ||
| /// This example demonstrates how to get associated session summaries for a given session |
There was a problem hiding this comment.
/// <summary>
/// This example demonstrates how to get associated session summaries for a given session
/// from a SQL backed session database. It retrieves the list of associated sessions
/// and prints their identifiers.
///
/// This is particularly useful in situations where you know you want to load associate
/// sessions but do not yet know which associates are available. The returned session
/// summaries can be inspected to decide which associates to load or process next.
/// </summary>
Minor revision to summary.
| /// resulting Function values to the console. | ||
| /// </summary> | ||
| private static void CreateFunctionAcrossMultipleSessionsWithCompositeSession() | ||
| { |
There was a problem hiding this comment.
// ===================== REMINDER =====================
// To use Functions, LicenceProgramName must be "ATLAS Data Platform"
// =====================================================
Might be worth adding a reminder above the editable section.
| const string connectionString = @"<CONNECTION STRING>"; | ||
| const string primarySessionKey = "<SESSION KEY>"; | ||
| const string associateSessionKey = "<SESSION IDENTIFIER>"; | ||
| const string sessionParamId = "<PARAMETER IDENTIFIER FROM SESSION>"; |
There was a problem hiding this comment.
Think it would be better to be more verbose with the naming and consistent with what I had done so there is no confusion.
sessionParamId > sessionParameterIdentifier
associateParamId > associateParameterIdentifier
|
Superseded by #59 (mdr/89128-composite-session-changes) which contains these same examples plus additional methods and the FunctionHelper utility. |
|
Closing as superseded by #59. |
🏗️ In Progress