John f5dbfa12fb B2017-079, B2017-053, B2017-049, improved the speed and logic of updating ROs. The Refresh ROs logic is now merged into the Update ROs logic. Also annotations are added when ROs are updated. The Refresh ROs options were removed from the tool list.
Better feedback when updating RO values, also save list of updated ROs in text file in Documents\VEPROMS
Save the date/time of the last successfully completed RO Values Update
Add annotations for updated RO values, better logic in updating RO figures so they are needlessly updated, better logic in determining if an RO needs to be updated
Logic to save the date/time of the last successfully completed RO Update
Better logic to determine if an RO value needs updated.
2017-06-20 16:26:04 +00:00

105 lines
2.5 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
namespace VEPROMS.CSLA.Library
{
[Serializable]
[TypeConverter(typeof(ExpandableObjectConverter))]
public class AssociationConfig : ConfigDynamicTypeDescriptor, INotifyPropertyChanged
{
#region DynamicTypeDescriptor
internal override bool IsReadOnly
{
get { return _Association == null; }
}
#endregion
#region XML
private XMLProperties _Xp;
private XMLProperties Xp
{
get { return _Xp; }
}
#endregion
#region Constructors
private Association _Association;
public AssociationConfig(Association association)
{
_Association = association;
string xml = association.Config;
if (xml == string.Empty) xml = "<Config/>";
_Xp = new XMLProperties(xml);
}
private AssociationInfo _AssociationInfo;
public AssociationConfig(AssociationInfo association)
{
_AssociationInfo = association;
string xml = association.Config;
if (xml == string.Empty) xml = "<Config/>";
_Xp = new XMLProperties(xml);
}
public AssociationConfig(string xml)
{
_Xp = new XMLProperties(xml);
}
public AssociationConfig()
{
string xml = "<Config/>";
_Xp = new XMLProperties(xml);
}
internal string GetValue(string group, string item)
{
return _Xp[group, item];
}
#endregion
public Association MyAssociation
{ get { return _Association; } }
#region RODefaults // From proc.ini
[Category("Referenced Objects")]
[DisplayName("Default RO Prefix")]
[RefreshProperties(RefreshProperties.All)]
[Description("Setpoint Prefix")]
public string RODefaults_setpointprefix
{
get
{
string s = _Xp["RODefaults", "Setpoint"];// get the saved value
return s;
}
set
{
_Xp["RODefaults", "Setpoint"] = value; // save selected value
OnPropertyChanged("RODefaults_setpointprefix");
}
}
#endregion
#region ROUpdate
[Category("RO Update")]
[DisplayName("Last Completed")]
[RefreshProperties(RefreshProperties.All)]
[Description("Last RO Update Completed")]
public string ROUpdate_LastCompleted
{
get
{
string s = _Xp["ROUpdate", "LastCompleted"];// get the saved value
return s;
}
set
{
_Xp["ROUpdate", "LastCompleted"] = value; // save selected value
}
}
#endregion // ROUpdate
#region ToString
public override string ToString()
{
string s = _Xp.ToString();
if (s == "<Config/>" || s == "<Config></config>") return string.Empty;
return s;
}
#endregion
}
}