/// <summary> /// Build the data provider /// </summary> /// <returns></returns> protected override SetupDataProvider BuildSetupDataProvider(ParameterPool parameters, BehaviorPool behaviors) { parameters.ThrowIfNull(nameof(parameters)); behaviors.ThrowIfNull(nameof(behaviors)); var provider = base.BuildSetupDataProvider(parameters, behaviors); // Add behaviors and parameters of the controlling voltage source provider.Add("control", behaviors[ControllingName]); provider.Add("control", parameters[ControllingName]); return(provider); }
/// <summary> /// Build the data provider for setting up a behavior for the entity. The entity can control which parameters /// and behaviors are visible to behaviors using this method. /// </summary> /// <param name="parameters">The parameters in the simulation.</param> /// <param name="behaviors">The behaviors in the simulation.</param> /// <returns>A data provider for the behaviors.</returns> /// <exception cref="ArgumentNullException"> /// parameters /// or /// behaviors /// </exception> protected virtual SetupDataProvider BuildSetupDataProvider(ParameterPool parameters, BehaviorPool behaviors) { parameters.ThrowIfNull(nameof(parameters)); behaviors.ThrowIfNull(nameof(behaviors)); // By default, we include the parameters of this entity var result = new SetupDataProvider(); result.Add("entity", parameters[Name]); result.Add("entity", behaviors[Name]); return(result); }
/// <summary> /// Add inductances to the data provider for setting up behaviors /// </summary> /// <returns></returns> protected override SetupDataProvider BuildSetupDataProvider(ParameterPool parameters, BehaviorPool behaviors) { parameters.ThrowIfNull(nameof(parameters)); behaviors.ThrowIfNull(nameof(behaviors)); // Base execution (will add entity behaviors and parameters for this mutual inductance) var data = base.BuildSetupDataProvider(parameters, behaviors); // Register inductor 1 data.Add("inductor1", parameters[InductorName1]); data.Add("inductor1", behaviors[InductorName1]); // Register inductor 2 data.Add("inductor2", parameters[InductorName2]); data.Add("inductor2", behaviors[InductorName2]); return(data); }