2015-09-22 12:01:43 +00:00
|
|
|
|
///
|
2016-06-10 10:37:34 +00:00
|
|
|
|
/// Copyright (c) 2013-2016 Sensus Metering Systems
|
2015-09-22 12:01:43 +00:00
|
|
|
|
///
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
using log4net;
|
|
|
|
|
|
using TBF.BenchControl.Generic;
|
|
|
|
|
|
using TBF.Resources;
|
|
|
|
|
|
|
|
|
|
|
|
namespace TBF.BenchControl.DataEntry.Standard12
|
|
|
|
|
|
{
|
|
|
|
|
|
public partial class EntryFormCfgCtrl : UserControl, IComponentCfgCtrl
|
|
|
|
|
|
{
|
|
|
|
|
|
static readonly ILog log = LogManager.GetLogger(typeof(EntryFormCfgCtrl));
|
|
|
|
|
|
|
|
|
|
|
|
public bool ShowMore { get { return false; } }
|
|
|
|
|
|
|
|
|
|
|
|
EntryFormCfg config;
|
|
|
|
|
|
public IComponentCfg Config
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return config as IComponentCfg; }
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
config = value as EntryFormCfg;
|
|
|
|
|
|
Redraw();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public EntryFormCfgCtrl()
|
|
|
|
|
|
{
|
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void EntryFormCfgCtrl_Load(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
Localize();
|
|
|
|
|
|
Redraw();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Localize()
|
|
|
|
|
|
{
|
2016-06-10 10:37:34 +00:00
|
|
|
|
enterSNsAtTheEndCheckBox.Text = Strings.Enter_SNs_at_the_end;
|
|
|
|
|
|
showEndStateFormCheckBox.Text = Strings.Show_cycle_end_form;
|
2016-06-17 13:59:32 +00:00
|
|
|
|
sensusExtensionsCheckBox.Text = Strings.Sensus_extensions;
|
2016-06-10 10:37:34 +00:00
|
|
|
|
}
|
2015-09-22 12:01:43 +00:00
|
|
|
|
|
|
|
|
|
|
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;
|
2016-06-10 10:37:34 +00:00
|
|
|
|
enterSNsAtTheEndCheckBox.Checked = config.EnterSerialNrsAtTheEnd;
|
|
|
|
|
|
showEndStateFormCheckBox.Checked = config.ShowCycleEndForm;
|
|
|
|
|
|
sensusExtensionsCheckBox.Checked = config.SensusExtensions;
|
2015-09-22 12:01:43 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Unlock()
|
|
|
|
|
|
{
|
|
|
|
|
|
nameTextBox.Enabled = true;
|
2016-06-10 10:37:34 +00:00
|
|
|
|
enterSNsAtTheEndCheckBox.Enabled = true;
|
|
|
|
|
|
showEndStateFormCheckBox.Enabled = true;
|
|
|
|
|
|
sensusExtensionsCheckBox.Enabled = true;
|
|
|
|
|
|
}
|
2015-09-22 12:01:43 +00:00
|
|
|
|
|
|
|
|
|
|
public CfgUpdateFlags VerifyCfg(ref string message)
|
|
|
|
|
|
{
|
|
|
|
|
|
CfgUpdateFlags flags = CfgUpdateFlags.None;
|
|
|
|
|
|
return flags;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public CfgUpdateFlags UpdateCfg()
|
|
|
|
|
|
{
|
|
|
|
|
|
CfgUpdateFlags flags = CfgUpdateFlags.RestartRqrd;
|
|
|
|
|
|
|
|
|
|
|
|
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
|
|
|
|
|
|
|
|
|
|
|
|
config.Name = nameTextBox.Text;
|
2016-06-10 10:37:34 +00:00
|
|
|
|
config.EnterSerialNrsAtTheEnd = enterSNsAtTheEndCheckBox.Checked;
|
|
|
|
|
|
config.ShowCycleEndForm = showEndStateFormCheckBox.Checked;
|
|
|
|
|
|
config.SensusExtensions = sensusExtensionsCheckBox.Checked;
|
2015-09-22 12:01:43 +00:00
|
|
|
|
|
|
|
|
|
|
return flags;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|