82 lines
1.7 KiB
C#
82 lines
1.7 KiB
C#
///
|
|
/// Copyright (c) 2017 Sensus Metering Systems
|
|
///
|
|
using System;
|
|
using System.Windows.Forms;
|
|
using Common;
|
|
using Config.Entities;
|
|
using TBF.Rig.Generic;
|
|
|
|
namespace TBF.Rig.TestMethods.LiveStream
|
|
{
|
|
public partial class CfgCtrl : UserControl, IComponentCfgCtrl
|
|
{
|
|
public bool ShowMore { get { return false; } }
|
|
|
|
LiveStreamCfg config;
|
|
public IComponentCfg Config
|
|
{
|
|
get { return config as IComponentCfg; }
|
|
set
|
|
{
|
|
config = value as LiveStreamCfg;
|
|
Redraw();
|
|
}
|
|
}
|
|
|
|
public CfgCtrl()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void EntryFormCfgCtrl_Load(object sender, EventArgs e)
|
|
{
|
|
Redraw();
|
|
}
|
|
|
|
public void Closing()
|
|
{
|
|
}
|
|
|
|
void Redraw()
|
|
{
|
|
if (config == null) return; /// Control was not loaded, settings were not changed
|
|
classNameLabel.Text = config.Factory.ClassName;
|
|
nameTextBox.Text = config.Name;
|
|
hiResolutionCheckBox.Checked = config.HiResolution;
|
|
}
|
|
|
|
public void Unlock()
|
|
{
|
|
nameTextBox.Enabled = true;
|
|
hiResolutionCheckBox.Enabled = true;
|
|
}
|
|
|
|
public CfgUpdateFlags VerifyCfg(ref string message)
|
|
{
|
|
return CfgUpdateFlags.None;
|
|
}
|
|
|
|
public CfgUpdateFlags UpdateCfg()
|
|
{
|
|
CfgUpdateFlags flags = CfgUpdateFlags.None;
|
|
|
|
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
|
|
|
|
if (config.Name != nameTextBox.Text)
|
|
{
|
|
config.Name = nameTextBox.Text;
|
|
flags |= (CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
|
|
}
|
|
|
|
if (config.HiResolution != hiResolutionCheckBox.Checked)
|
|
{
|
|
config.HiResolution = hiResolutionCheckBox.Checked;
|
|
flags |= (CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
|
|
}
|
|
|
|
return flags;
|
|
}
|
|
}
|
|
}
|