119 lines
2.3 KiB
C#
119 lines
2.3 KiB
C#
///
|
|
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
|
///
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Globalization;
|
|
using System.Windows.Forms;
|
|
using log4net;
|
|
using Config.Entities;
|
|
using TBF.Resources;
|
|
|
|
namespace TBF.UiControls
|
|
{
|
|
public partial class MetrologyDlgDensityTab : UserControl, IMetrologyDlgTab
|
|
{
|
|
static readonly ILog log = LogManager.GetLogger(typeof(MetrologyDlgDensityTab));
|
|
|
|
/// <summary>
|
|
/// Component entity that has a list of 'measurement-correction' pairs
|
|
/// to be updated in the database on OK.
|
|
/// </summary>
|
|
public Component MeterEntity
|
|
{
|
|
get { return null; }
|
|
set { }
|
|
}
|
|
|
|
/// <summary>
|
|
/// A list of 'measurement-correction' pairs to be deleted from the database on OK.
|
|
/// </summary>
|
|
public IList<MeasurementCorrection> ToBeRemoved
|
|
{
|
|
get { return toBeRemoved; }
|
|
set { toBeRemoved = value; }
|
|
}
|
|
IList<MeasurementCorrection> toBeRemoved;
|
|
|
|
MetrologyDlg parent;
|
|
bool unlocked;
|
|
|
|
public MetrologyDlgDensityTab()
|
|
{
|
|
InitializeComponent();
|
|
toBeRemoved = new List<MeasurementCorrection>();
|
|
unlocked = false;
|
|
}
|
|
|
|
private void MetrologyDlgDensityTab_Load(object sender, System.EventArgs e)
|
|
{
|
|
parent = ParentForm as MetrologyDlg;
|
|
|
|
/// Panel1
|
|
densityLabel.Text = Strings.Density_kg_m3;
|
|
temperatureLabel.Text = Strings.AtTemperature_C;
|
|
|
|
/// Panel2
|
|
|
|
RefreshAll();
|
|
}
|
|
|
|
void RefreshAll()
|
|
{
|
|
densityTextBox.Text = Program.LocalSettings.RealDensity.ToString();
|
|
temperatureTextBox.Text = Program.LocalSettings.AtTemperature.ToString();
|
|
}
|
|
|
|
public void Unlock()
|
|
{
|
|
unlocked = true;
|
|
|
|
densityTextBox.Enabled = true;
|
|
temperatureTextBox.Enabled = true;
|
|
}
|
|
|
|
public void OkBtnClicked()
|
|
{
|
|
float tmp;
|
|
if (Utils.TryParseUFloat(densityTextBox.Text, out tmp))
|
|
{
|
|
Program.LocalSettings.RealDensity = tmp;
|
|
}
|
|
if (Utils.TryParseUFloat(temperatureTextBox.Text, out tmp))
|
|
{
|
|
Program.LocalSettings.AtTemperature = tmp;
|
|
}
|
|
Program.LocalSettings.Save();
|
|
}
|
|
|
|
public void CancelBtnClicked()
|
|
{
|
|
}
|
|
|
|
public void AddOne()
|
|
{
|
|
}
|
|
|
|
public void RemoveSelected()
|
|
{
|
|
}
|
|
|
|
public void MoveUpSelected()
|
|
{
|
|
}
|
|
|
|
public void MoveDownSelected()
|
|
{
|
|
}
|
|
|
|
public string GetWarningsBeforeSaving()
|
|
{
|
|
return string.Empty;
|
|
}
|
|
|
|
public void UpdateRelatedItems()
|
|
{
|
|
}
|
|
}
|
|
}
|