I am really new in programming with c# and am creating an application object for ArchestrA IDE from Wonderware.
I want to make a tabpage with a list of checkboxes which is created based on a list of objects in configtime but i don't know how to pass this list from configtime to editor.
Here is an extract of the code:
Code in Configtime:
public class Surveillance_AppConfigtime : ConfigtimeBase
{
public List<Primitive> _tEnginePrimitives;
private void Surveillance_AppConfigtime_ConfigtimeInitialize(object sender)
{
_tEnginePrimitives = new List<Primitive>();
_tEnginePrimitives.Add(new Primitive("Scheduler.ScanCyclesCnt", MxDataType.MxInteger));
_tEnginePrimitives.Add(new Primitive("Scheduler.ScanOverrunsCnt", MxDataType.MxInteger));
_tEnginePrimitives.Add(new Primitive("Scheduler.ScanOverrunsConsecCnt", MxDataType.MxInteger));
_tEnginePrimitives.Add(new Primitive("Scheduler.ScanPeriod", MxDataType.MxInteger));
_tEnginePrimitives.Add(new Primitive("Scheduler.TimeIdleAvg", MxDataType.MxInteger));
_tEnginePrimitives.Add(new Primitive("Engine.ProcessCPULoad", MxDataType.MxInteger,true));
_tEnginePrimitives.Add(new Primitive("ScanState", MxDataType.MxBoolean));
}
}
Code in Editor:
public partial class Surveillance_AppEditor : ArchestraEditorFramework.aaBaseEditorForm
{
TabPage enginePage = new TabPage("Engine");
CheckBox _cb = new CheckBox();
private int y = 0;
public Surveillance_AppEditor()
{
//enginePage
foreach (Primitive oPrimitive in _tEnginePrimitives)
{
_cb = new CheckBox();
_cb.Location = new Point(10, y);
_cb.Name = oPrimitive.Name;
platformPage.Controls.Add(_cb);
y += 15;
}
MainTabControl.TabPages.Add(enginePage);
}
}
Hope anyone can help me please. Thank you in advance!