|
@@ -17,9 +17,6 @@ using Venus_Core;
|
|
|
using System.Windows.Threading;
|
|
|
using Aitex.Core.RT.OperationCenter;
|
|
|
using System.Reflection;
|
|
|
-using MECF.Framework.Common.CommonData.DeviceData;
|
|
|
-using MECF.Framework.Common.Equipment;
|
|
|
-using Venus_MainPages.Unity;
|
|
|
//using SciChart.Core.Extensions;
|
|
|
//using VirgoUI.Client.Models.Sys;
|
|
|
|
|
@@ -79,7 +76,7 @@ namespace Venus_MainPages.ViewModels
|
|
|
public ObservableCollection<StatsDataListItemRFAndPump> _StatDataRFAndPump;
|
|
|
public ObservableCollection<string> _ModuleList = new ObservableCollection<string>();
|
|
|
public ObservableCollection<string> _FollowRFList = new ObservableCollection<string>();
|
|
|
-
|
|
|
+ DispatcherTimer timer;
|
|
|
public ObservableCollection<string> ModuleList
|
|
|
{
|
|
|
get { return _ModuleList; }
|
|
@@ -107,7 +104,6 @@ namespace Venus_MainPages.ViewModels
|
|
|
get { return _AddItemFollowRF; }
|
|
|
set { SetProperty(ref _AddItemFollowRF, value); }
|
|
|
}
|
|
|
- DispatcherTimer timer;
|
|
|
public StatisticsViewModel()
|
|
|
{
|
|
|
|
|
@@ -116,6 +112,7 @@ namespace Venus_MainPages.ViewModels
|
|
|
timer = new DispatcherTimer();
|
|
|
timer.Interval = TimeSpan.FromSeconds(1);
|
|
|
timer.Tick += timer_Tick;
|
|
|
+ //timer.Start();
|
|
|
|
|
|
string[] allModules = QueryDataClient.Instance.Service.GetConfig($"System.InstalledModules").ToString().Split(',');
|
|
|
AddItemName = "";
|
|
@@ -153,11 +150,12 @@ namespace Venus_MainPages.ViewModels
|
|
|
}
|
|
|
void timer_Tick(object sender, EventArgs e)
|
|
|
{
|
|
|
+ //return;
|
|
|
try
|
|
|
{
|
|
|
PollData();
|
|
|
}
|
|
|
- catch
|
|
|
+ catch (Exception ex)
|
|
|
{
|
|
|
|
|
|
}
|
|
@@ -206,27 +204,27 @@ namespace Venus_MainPages.ViewModels
|
|
|
private DelegateCommand _SubscribeItem;
|
|
|
public DelegateCommand SubscribeItem => _SubscribeItem ?? (_SubscribeItem = new DelegateCommand(OnSubscribeItem));
|
|
|
|
|
|
- //private int MenuPermission
|
|
|
- //{
|
|
|
- // //get
|
|
|
- // //{
|
|
|
- // // return ClientApp.Instance.GetPermission("Statistics");
|
|
|
- // //}
|
|
|
- // get; set;
|
|
|
- //}
|
|
|
- //protected bool OnTimer()
|
|
|
- //{
|
|
|
- // try
|
|
|
- // {
|
|
|
- // //PollData();
|
|
|
- // }
|
|
|
- // catch (Exception ex)
|
|
|
- // {
|
|
|
- // LOG.Error(ex.Message);
|
|
|
- // }
|
|
|
-
|
|
|
- // return true;
|
|
|
- //}
|
|
|
+ private int MenuPermission
|
|
|
+ {
|
|
|
+ //get
|
|
|
+ //{
|
|
|
+ // return ClientApp.Instance.GetPermission("Statistics");
|
|
|
+ //}
|
|
|
+ get; set;
|
|
|
+ }
|
|
|
+ protected bool OnTimer()
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ //PollData();
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ LOG.Error(ex.Message);
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
public ObservableCollection<StatsDataListItem> StatData
|
|
|
{
|
|
|
get { return _StatData; }
|
|
@@ -238,7 +236,7 @@ namespace Venus_MainPages.ViewModels
|
|
|
get { return _StatDataRFAndPump; }
|
|
|
set { SetProperty(ref _StatDataRFAndPump, value); }
|
|
|
}
|
|
|
- //private PeriodicJob _timer;
|
|
|
+ private PeriodicJob _timer;
|
|
|
//protected override void OnInitialize()
|
|
|
//{
|
|
|
// StatData = new ObservableCollection<StatsDataListItem>();
|
|
@@ -391,19 +389,21 @@ namespace Venus_MainPages.ViewModels
|
|
|
item.LastPMTime = ((DateTime)dbDataRFPump.Rows[i]["last_pm_time"]).ToString("yyyy-MM-dd HH:mm:ss.fff");
|
|
|
|
|
|
|
|
|
- if (item.Description.Contains("Follow => "))
|
|
|
- {
|
|
|
- string findmodule = item.Description.Replace("Follow => ", "");
|
|
|
- for (int j = 0; j < dbDataRFPump.Rows.Count; j++)
|
|
|
- {
|
|
|
- if (dbDataRFPump.Rows[j]["name"].ToString() == findmodule)
|
|
|
- {
|
|
|
- item.fromLastPM = dbDataRFPump.Rows[j]["from_last_pm"].ToString();
|
|
|
- item.Total = dbDataRFPump.Rows[j]["total"].ToString();
|
|
|
- item.LastPMTime = ((DateTime)dbDataRFPump.Rows[j]["last_pm_time"]).ToString("yyyy-MM-dd HH:mm:ss.fff");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ //if (item.Description.Contains("Follow => "))
|
|
|
+ //{
|
|
|
+ // string findmodule = item.Description.Replace("Follow => ", "");
|
|
|
+ // for (int j = 0; j < dbDataRFPump.Rows.Count; j++)
|
|
|
+ // {
|
|
|
+ // if (dbDataRFPump.Rows[j]["name"].ToString() == findmodule)
|
|
|
+ // {
|
|
|
+ // item.fromLastPM = ((float)dbDataRFPump.Rows[j]["from_last_pm"]
|
|
|
+ // + (float)dbDataRFPump.Rows[i]["from_last_pm"]).ToString();
|
|
|
+ // item.Total = ((float)dbDataRFPump.Rows[j]["total"]
|
|
|
+ // + (float)dbDataRFPump.Rows[i]["total"]).ToString();
|
|
|
+ // item.LastPMTime = ((DateTime)dbDataRFPump.Rows[i]["last_pm_time"]).ToString("yyyy-MM-dd HH:mm:ss.fff");
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ //}
|
|
|
//item.InvokePropertyChanged(nameof(item.Name));
|
|
|
//item.InvokePropertyChanged(nameof(item.AlarmEnable));
|
|
|
//item.InvokePropertyChanged(nameof(item.Description));
|
|
@@ -422,7 +422,7 @@ namespace Venus_MainPages.ViewModels
|
|
|
|
|
|
|
|
|
}
|
|
|
- catch
|
|
|
+ catch (Exception e)
|
|
|
{
|
|
|
}
|
|
|
}
|
|
@@ -487,45 +487,52 @@ namespace Venus_MainPages.ViewModels
|
|
|
public void ResetRFTotal(StatsDataListItemRFAndPump item)
|
|
|
{
|
|
|
|
|
|
+ //foreach (var rfpumpitem in StatDataRFAndPump.ToList().FindAll(x => x.Description == "Follow => " + item.Name))
|
|
|
+ //{
|
|
|
+ // InvokeClient.Instance.Service.DoOperation("System.Stats.IncreaseValue",
|
|
|
+ // rfpumpitem.Name, rfpumpitem.Description, item.fromLastPM, item.Total);
|
|
|
+ //}
|
|
|
+
|
|
|
+ InvokeClient.Instance.Service.DoOperation("System.Stats.RFResetTotal", item.Name);
|
|
|
if (item.Name.Contains(".BiasRfOnTime"))
|
|
|
{
|
|
|
- InvokeClient.Instance.Service.DoOperation("System.Stats.RFResetTotal", item.Name);
|
|
|
- InvokeClient.Instance.Service.DoOperation($"{item.Name.Split('.')[0]}.BiasRf.ResetRFStats", item.Name);
|
|
|
+ //InvokeClient.Instance.Service.DoOperation($"{item.Name.Split('.')[0]}.BiasRf.ResetRFStats", item.Name);
|
|
|
//ResetPumpStats
|
|
|
}
|
|
|
|
|
|
if (item.Name.Contains(".RfOnTime"))
|
|
|
{
|
|
|
- InvokeClient.Instance.Service.DoOperation("System.Stats.RFResetTotal", item.Name);
|
|
|
- InvokeClient.Instance.Service.DoOperation($"{item.Name.Split('.')[0]}.Rf.ResetRFStats", item.Name);
|
|
|
+ //InvokeClient.Instance.Service.DoOperation($"{item.Name.Split('.')[0]}.Rf.ResetRFStats", item.Name);
|
|
|
}
|
|
|
|
|
|
if (item.Name.Contains(".PumpOnTime"))
|
|
|
{
|
|
|
- InvokeClient.Instance.Service.DoOperation("System.Stats.RFResetTotal", item.Name);
|
|
|
- InvokeClient.Instance.Service.DoOperation($"{item.Name.Split('.')[0]}.MainPump.ResetPumpStats", item.Name);
|
|
|
+ //InvokeClient.Instance.Service.DoOperation($"{item.Name.Split('.')[0]}.MainPump.ResetPumpStats", item.Name);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public void ResetTimeValue(StatsDataListItemRFAndPump item)
|
|
|
{
|
|
|
+ //foreach (var rfpumpitem in StatDataRFAndPump.ToList().FindAll(x => x.Description == "Follow => " + item.Name))
|
|
|
+ //{
|
|
|
+ // InvokeClient.Instance.Service.DoOperation("System.Stats.IncreaseValue",
|
|
|
+ // rfpumpitem.Name, rfpumpitem.Description, rfpumpitem.fromLastPM, rfpumpitem.Total);
|
|
|
+ //}
|
|
|
+ InvokeClient.Instance.Service.DoOperation("System.StatsRFAndPump.ResetValue", item.Name);
|
|
|
if (item.Name.Contains(".BiasRfOnTime"))
|
|
|
{
|
|
|
- InvokeClient.Instance.Service.DoOperation("System.StatsRFAndPump.ResetValue", item.Name);
|
|
|
- InvokeClient.Instance.Service.DoOperation($"{item.Name.Split('.')[0]}.BiasRf.ResetRFStats", item.Name);
|
|
|
+ //InvokeClient.Instance.Service.DoOperation($"{item.Name.Split('.')[0]}.BiasRf.ResetRFStats", item.Name);
|
|
|
//ResetPumpStats
|
|
|
}
|
|
|
|
|
|
if (item.Name.Contains(".RfOnTime"))
|
|
|
{
|
|
|
- InvokeClient.Instance.Service.DoOperation("System.StatsRFAndPump.ResetValue", item.Name);
|
|
|
- InvokeClient.Instance.Service.DoOperation($"{item.Name.Split('.')[0]}.Rf.ResetRFStats", item.Name);
|
|
|
+ //InvokeClient.Instance.Service.DoOperation($"{item.Name.Split('.')[0]}.Rf.ResetRFStats", item.Name);
|
|
|
}
|
|
|
|
|
|
if (item.Name.Contains(".PumpOnTime"))
|
|
|
{
|
|
|
- InvokeClient.Instance.Service.DoOperation("System.StatsRFAndPump.ResetValue", item.Name);
|
|
|
- InvokeClient.Instance.Service.DoOperation($"{item.Name.Split('.')[0]}.MainPump.ResetPumpStats", item.Name);
|
|
|
+ //InvokeClient.Instance.Service.DoOperation($"{item.Name.Split('.')[0]}.MainPump.ResetPumpStats", item.Name);
|
|
|
}
|
|
|
|
|
|
//InvokeClient.Instance.Service.DoOperation("System.StatsRFAndPump.ResetValue", item.Name);
|
|
@@ -549,24 +556,25 @@ namespace Venus_MainPages.ViewModels
|
|
|
if (item.Name.Contains(".PumpOnTime"))
|
|
|
{
|
|
|
InvokeClient.Instance.Service.DoOperation("System.StatsRFAndPump.SetPMIntervalValue", item.Name, setValue);
|
|
|
- InvokeClient.Instance.Service.DoOperation($"{item.Name.Split('.')[0]}.MainPump.ResetPumpStats", item.Name);
|
|
|
+ //InvokeClient.Instance.Service.DoOperation($"{item.Name.Split('.')[0]}.MainPump.ResetPumpStats", item.Name);
|
|
|
}
|
|
|
|
|
|
if (item.Name.Contains(".BiasRfOnTime"))
|
|
|
{
|
|
|
InvokeClient.Instance.Service.DoOperation("System.StatsRFAndPump.SetPMIntervalValue", item.Name, setValue);
|
|
|
- InvokeClient.Instance.Service.DoOperation($"{item.Name.Split('.')[0]}.BiasRf.ResetRFStats", item.Name);
|
|
|
+ //InvokeClient.Instance.Service.DoOperation($"{item.Name.Split('.')[0]}.BiasRf.ResetRFStats", item.Name);
|
|
|
//ResetPumpStats
|
|
|
}
|
|
|
|
|
|
if (item.Name.Contains(".RfOnTime"))
|
|
|
{
|
|
|
InvokeClient.Instance.Service.DoOperation("System.StatsRFAndPump.SetPMIntervalValue", item.Name, setValue);
|
|
|
- InvokeClient.Instance.Service.DoOperation($"{item.Name.Split('.')[0]}.Rf.ResetRFStats", item.Name);
|
|
|
+ //InvokeClient.Instance.Service.DoOperation($"{item.Name.Split('.')[0]}.Rf.ResetRFStats", item.Name);
|
|
|
}
|
|
|
|
|
|
item.PMIntervalTextSaved = true;
|
|
|
}
|
|
|
+
|
|
|
public void EnterExitView(bool isEnter)
|
|
|
{
|
|
|
if (isEnter)
|