92 lines
2.1 KiB
C#
92 lines
2.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
using Config.Entities;
|
|
using TBF.BenchControl;
|
|
using TBF.BenchControl.Generic;
|
|
|
|
|
|
namespace DeviceTest
|
|
{
|
|
public partial class DeviceTestDlg : Form
|
|
{
|
|
IList<string> compClasses;
|
|
|
|
IComponentFactory parentFactory;
|
|
IComponentFactory componentFactory;
|
|
|
|
IComponentCfg parentCfg;
|
|
IComponentCfg componentCfg;
|
|
|
|
|
|
public DeviceTestDlg()
|
|
{
|
|
InitializeComponent();
|
|
compClasses = new List<string>();
|
|
foreach (var componentFactory in TbfComponents.Factories)
|
|
{
|
|
compClasses.Add(componentFactory.ClassName);
|
|
}
|
|
}
|
|
|
|
private void DeviceTestDlg_Load(object sender, EventArgs e)
|
|
{
|
|
foreach (var clName in compClasses) parentClassNameComboBox.Items.Add(clName);
|
|
}
|
|
|
|
private void configureParentButton_Click(object sender, EventArgs e)
|
|
{
|
|
foreach (var factory in TbfComponents.Factories)
|
|
{
|
|
if (parentNameTextBox.Text == factory.ClassName)
|
|
{
|
|
parentFactory = factory;
|
|
break;
|
|
}
|
|
|
|
return;
|
|
}
|
|
|
|
IComponentCfg cfg = parentFactory.DefaultConfig();
|
|
IComponentCfgCtrl cfgControl = cfg.GetControl();
|
|
cfgControl.Config = cfg;
|
|
cfgControl.Config.ItemNr = 0;
|
|
|
|
TBF.ComponentParametersDlg cfgForm = new TBF.ComponentParametersDlg();
|
|
cfgForm.TbfComponents = new List<Config.Entities.Component>();
|
|
cfgForm.ComponentCfgCtrl = cfgControl;
|
|
cfgForm.UnlockAfterStart = true;
|
|
DialogResult dr = cfgForm.ShowDialog();
|
|
if (dr != DialogResult.OK) return;
|
|
|
|
//flags |= CfgUpdateFlags.RestartRqrd;
|
|
//AddOne(cfgForm.Config.CreateDbEntity());
|
|
}
|
|
|
|
private void configureButton_Click(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
|
|
private void button1_Click(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
|
|
private void startButton_Click(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
|
|
private void stopButton_Click(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
}
|
|
}
|