Skip to main content

Program.cs

The class that contains the Main() entry point of the testbed console app. This class is where you configure the testbed behavior, including:

  1. Specifying which module to run.
  2. Mapping points in your module to your data source.
  3. Creating a context to map your module to an asset in your data source.
  4. Adjusting logging levels.

Definition​

Namespace: GSharp.Testbed
Assembly: GSharp.Testbed.exe

internal partial class Program

Methods​

MethodDescription
MainThe console application's main entry point.
ConfigureAssemblyThe method to specify the module, context and point mapping for the testbed.

Example​

internal partial class Program
{
private static void Main()
{
RunTestbed();
}

private void ConfigureAssembly(AssemblyBuilder builder)
{
builder.AddModule<TankVolume>(moduleBuilder => moduleBuilder
.ConfigurePoint(nameof(TankVolume.Diameter), "Diameter_cnst")
.ConfigurePoint(nameof(TankVolume.Level), "Level_meas")
.ConfigurePoint(nameof(TankVolume.Volume), "Volume_calc")
.AddContext("Test Tank 000", @"\\SVRPI01\Tank Demo\Tanks\Tank 000")
)
.RunAsAt("*")
.WithMinimumAssemblyLogLevel(LogLevel.Info)
.UsingFullLogLayoutFormat()
;
}
}

Remarks​

The Program.cs file is designed to be edited by you, the developer, and contains methods to set up the testbed for your specific module and data source. The rest of the Program class is hidden away in a partial class so as to remove any distractions and allow you to focus on the configuration. It sets up the framework of the testbed and handles the execution of your module. It does not need to be modified.