|
@@ -32,7 +32,8 @@ namespace FurnaceUI.Views.Maintenances
|
|
|
public class IOListEditViewModel : UiViewModelBase
|
|
|
{
|
|
|
private XDocument xmlDoc = new XDocument();
|
|
|
-
|
|
|
+ [Subscription("PM1.RunningMode")]
|
|
|
+ public bool RunningModeIsDebug { get; set; }
|
|
|
public ObservableCollection<IOItem<bool>> DIs { get; private set; }
|
|
|
public ObservableCollection<IOItem<bool>> DOs { get; private set; }
|
|
|
public ObservableCollection<IOItem<float>> AIs { get; private set; }
|
|
@@ -303,6 +304,7 @@ namespace FurnaceUI.Views.Maintenances
|
|
|
|
|
|
|
|
|
var diDoAiAoData = GetDiDoAiAo();
|
|
|
+
|
|
|
AIViewSource = new ListCollectionView(AIs);
|
|
|
INViewSource = new ListCollectionView(DIs);
|
|
|
BufferViewSource = new ListCollectionView(DIs);
|
|
@@ -361,46 +363,50 @@ namespace FurnaceUI.Views.Maintenances
|
|
|
}
|
|
|
return isfilter;
|
|
|
};
|
|
|
-
|
|
|
- OutViewSource = new ListCollectionView(DOs);
|
|
|
- AOViewSource = new ListCollectionView(AOs);
|
|
|
- AOViewSource.Filter = (object obi) =>
|
|
|
+ if (!RunningModeIsDebug)
|
|
|
{
|
|
|
- bool isfilter = false;
|
|
|
- if (obi is IOItem item)
|
|
|
+ OutViewSource = new ListCollectionView(DOs);
|
|
|
+ AOViewSource = new ListCollectionView(AOs);
|
|
|
+ AOViewSource.Filter = (object obi) =>
|
|
|
{
|
|
|
- var fileterName = _isSimulatorMode ? item.Name.Replace("PM1.", "") : item.Name;
|
|
|
- if (diDoAiAoData != null && diDoAiAoData.Count > 0 && diDoAiAoData.Values.Contains(fileterName))
|
|
|
+ bool isfilter = false;
|
|
|
+ if (obi is IOItem item)
|
|
|
{
|
|
|
- var pmContentItem = diDoAiAoData.FirstOrDefault(a => a.Value.Equals(fileterName));
|
|
|
- item.DisplayName = _showKey ? pmContentItem.Key : pmContentItem.Value;
|
|
|
- isfilter = true;
|
|
|
- }
|
|
|
+ var fileterName = _isSimulatorMode ? item.Name.Replace("PM1.", "") : item.Name;
|
|
|
+ if (diDoAiAoData != null && diDoAiAoData.Count > 0 && diDoAiAoData.Values.Contains(fileterName))
|
|
|
+ {
|
|
|
+ var pmContentItem = diDoAiAoData.FirstOrDefault(a => a.Value.Equals(fileterName));
|
|
|
+ item.DisplayName = _showKey ? pmContentItem.Key : pmContentItem.Value;
|
|
|
+ isfilter = true;
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
- return isfilter;
|
|
|
- };
|
|
|
- OutViewSource.Filter = (object obi) =>
|
|
|
- {
|
|
|
- bool isfilter = false;
|
|
|
- if (obi is IOItem item)
|
|
|
+ }
|
|
|
+ return isfilter;
|
|
|
+ };
|
|
|
+ OutViewSource.Filter = (object obi) =>
|
|
|
{
|
|
|
- var fileterName = _isSimulatorMode ? item.Name.Replace("PM1.", "") : item.Name;
|
|
|
- if (diDoAiAoData != null && diDoAiAoData.Count > 0 && diDoAiAoData.Values.Contains(fileterName))
|
|
|
+ bool isfilter = false;
|
|
|
+ if (obi is IOItem item)
|
|
|
{
|
|
|
- var pmContentItem = diDoAiAoData.FirstOrDefault(a => a.Value.Equals(fileterName));
|
|
|
- item.DisplayName = _showKey ? pmContentItem.Key : pmContentItem.Value;
|
|
|
- isfilter = true;
|
|
|
- }
|
|
|
+ var fileterName = _isSimulatorMode ? item.Name.Replace("PM1.", "") : item.Name;
|
|
|
+ if (diDoAiAoData != null && diDoAiAoData.Count > 0 && diDoAiAoData.Values.Contains(fileterName))
|
|
|
+ {
|
|
|
+ var pmContentItem = diDoAiAoData.FirstOrDefault(a => a.Value.Equals(fileterName));
|
|
|
+ item.DisplayName = _showKey ? pmContentItem.Key : pmContentItem.Value;
|
|
|
+ isfilter = true;
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
- return isfilter;
|
|
|
- };
|
|
|
+ }
|
|
|
+ return isfilter;
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
- DIDOVisibility = (INViewSource.Count > 0 || OutViewSource.Count > 0);
|
|
|
- AIAOVisibility = (AIViewSource.Count > 0 || AOViewSource.Count > 0);
|
|
|
+ DIDOVisibility = (INViewSource.Count > 0 || (OutViewSource!=null&&OutViewSource.Count > 0));
|
|
|
+ AIAOVisibility = (AIViewSource.Count > 0 || (AOViewSource != null && AOViewSource.Count > 0));
|
|
|
if (DIDOVisibility)
|
|
|
{
|
|
|
SelectedIndexData = 0;
|