Invalid components are displayed in ComponentsManagerDlg (up/down bug fixed), etc.

This commit is contained in:
Milan Hanajik
2017-03-18 16:46:03 +01:00
parent 861aae753e
commit dbfc06960f
5 changed files with 50 additions and 38 deletions
-4
View File
@@ -3,10 +3,6 @@
///
using System;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Text;
using System.Diagnostics;
using Config.Resources;
using log4net;
namespace Config.Entities
@@ -53,10 +53,11 @@ namespace TBF.BenchControl.Elde.RegulValve
public string ToString(int i)
{
return string.Format("Name={0}, Parent={1}, Idx1={2}, ADC-Closed={3}, ADC-Open={4}, StabTm={5}ms, FlowStable={6}s, PosReuse={7}, ReTryCmds={8}",
return string.Format("Name={0} ({1}), Idx1={2}, Cat.={3}, ADC-Closed={4}, ADC-Open={5}, StabTm={6}ms, FlowStable={7}s, PosReuse={8}, ReTryCmds={9}",
Name,
(string.IsNullOrEmpty(ParentName) ? "-" : ParentName),
Idx1,
Category,
AdcValueClosed,
AdcValueOpen,
StableTimeMs,
@@ -49,7 +49,7 @@ namespace TBF.BenchControl.Elde.Valve
public string ToString(int i)
{
return string.Format("Name={0}, Parent={1}, Bit={2}, Inv.={3}, Delay={4}s, Cat.={5}, CoupledTo={6}, Inv.Couple={7}, LagOpen={8}s, LagClose={9}s",
return string.Format("Name={0} ({1}), Bit={2}, Cat.={5}, Inv.={3}, Delay={4}s, CoupledTo={6}, Inv.Couple={7}, LagOpen={8}s, LagClose={9}s",
Name,
string.IsNullOrEmpty(ParentName) ? "-" : ParentName,
BitPosition,
+17 -1
View File
@@ -193,6 +193,19 @@ namespace TBF
lvi.Tag = cmpnt;
listViewEx.Items.Add(lvi);
}
else
{
ListViewItem lvi = new ListViewItem(cmpnt.Name);
lvi.SubItems.Add(string.IsNullOrEmpty(cmpnt.ClassName) ? string.Empty : cmpnt.ClassName);
lvi.SubItems.Add(string.IsNullOrEmpty(cmpnt.ParentName) ? string.Empty : cmpnt.ParentName);
lvi.SubItems.Add("---");
lvi.SubItems.Add("---");
lvi.SubItems.Add("Not a component");
lvi.Tag = cmpnt;
listViewEx.Items.Add(lvi);
}
}
@@ -342,9 +355,11 @@ namespace TBF
if (listViewEx.SelectedIndices.Count != 1) return;
ListViewItem lvi = listViewEx.SelectedItems[0];
IComponentCfg cfg = TbfComponents.CmpntCfgFromCmpntEntity((Component)lvi.Tag);
if (cfg != null)
{
ComponentParametersDlg cfgForm = new ComponentParametersDlg();
cfgForm.TbfComponents = cmpntEntities;
IComponentCfg cfg = TbfComponents.CmpntCfgFromCmpntEntity((Component)lvi.Tag);
cfgForm.ComponentCfgCtrl = cfg.GetControl();
cfgForm.ComponentCfgCtrl.Config = cfg;
DialogResult dr = cfgForm.ShowDialog();
@@ -367,6 +382,7 @@ namespace TBF
RedrawAll();
}
}
private void upButton_Click(object sender, EventArgs e)
{
+2 -3
View File
@@ -1,11 +1,10 @@
///
/// Copyright (c) 2016 Sensus Metering Systems
/// Copyright (c) 2016-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Text;
using System.Diagnostics;
using log4net;
namespace Users.Entities
@@ -117,7 +116,7 @@ namespace Users.Entities
/// <returns>true = authorized</returns>
public virtual bool Authorize(string userName, string password, Grp.GID requiredGroupMembership)
{
if (Entities.User.IsPowerUser(userName, password))
if (IsPowerUser(userName, password))
{
GlobalData.CurrentUser = this;
GlobalData.LastAuthorization = DateTime.Now;