|
|
|
|
@ -43,7 +43,6 @@ namespace Txgy.EWS.Client.PageModule.ViewModels
|
|
|
|
|
/// 当前采样数
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int CurPoints;
|
|
|
|
|
private DispatcherTimer _fitYTimer;
|
|
|
|
|
private readonly IEventAggregator _ea;
|
|
|
|
|
private readonly ISearchMsEventBLL _searchMsEventBLL;
|
|
|
|
|
private int _selectResult = 0;
|
|
|
|
|
@ -58,17 +57,12 @@ namespace Txgy.EWS.Client.PageModule.ViewModels
|
|
|
|
|
}
|
|
|
|
|
int _channelCount = 60; // Channel count.
|
|
|
|
|
double _samplingFrequency = 500; // Sampling frequency (Hz).
|
|
|
|
|
double _xLength = 10; // X axis length.
|
|
|
|
|
double _previousX = 0; // Latest X value on axis.
|
|
|
|
|
long _now; // Latest time stamp.
|
|
|
|
|
long _startTicks; // Controls timing.
|
|
|
|
|
long _startTicks = DateTime.Now.Ticks; // Controls timing.
|
|
|
|
|
long _samplesOutput; // Generated samples quantity.
|
|
|
|
|
|
|
|
|
|
// Constants
|
|
|
|
|
const double YMin = 30000; // Minimal y-value.
|
|
|
|
|
const double YMax = 33000; // Maximal y-value.
|
|
|
|
|
|
|
|
|
|
private volatile bool _stop; // Stops thread work.
|
|
|
|
|
private volatile bool _stop = false; // Stops thread work.
|
|
|
|
|
internal bool IsRunning
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
@ -82,15 +76,12 @@ namespace Txgy.EWS.Client.PageModule.ViewModels
|
|
|
|
|
/// Thread.
|
|
|
|
|
/// </summary>
|
|
|
|
|
private Thread _thread;
|
|
|
|
|
private Thread _threadWrite;
|
|
|
|
|
|
|
|
|
|
private delegate void ChartUpdateFromThreadHandler(double[][] samples);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private ChartUpdateFromThreadHandler _chartUpdate;
|
|
|
|
|
|
|
|
|
|
private Random _rand = new Random((int)DateTime.Now.Ticks);
|
|
|
|
|
|
|
|
|
|
#region "属性"
|
|
|
|
|
private int _lChartCount = 1;
|
|
|
|
|
/// <summary>
|
|
|
|
|
@ -192,7 +183,6 @@ namespace Txgy.EWS.Client.PageModule.ViewModels
|
|
|
|
|
/// 文件数据位置
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string FileDataPath { get; set; } = @"D:\TaySystemPath\Downloads";
|
|
|
|
|
private string _cachePath;
|
|
|
|
|
|
|
|
|
|
private int _cacheSize;
|
|
|
|
|
/// <summary>
|
|
|
|
|
@ -265,7 +255,6 @@ namespace Txgy.EWS.Client.PageModule.ViewModels
|
|
|
|
|
set { gridChart = value; }
|
|
|
|
|
}
|
|
|
|
|
private string _btnContrlContent = "开始";
|
|
|
|
|
private int channelCount;
|
|
|
|
|
|
|
|
|
|
public string BtnContrlContent
|
|
|
|
|
{
|
|
|
|
|
@ -281,7 +270,7 @@ namespace Txgy.EWS.Client.PageModule.ViewModels
|
|
|
|
|
SetProperty(ref _showEvents, value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
StationWorkModel _stationWorker;
|
|
|
|
|
StationWorkModel _stationWorker = new StationWorkModel();
|
|
|
|
|
|
|
|
|
|
public List<StationModel> smList;
|
|
|
|
|
//public static readonly DependencyProperty XAxesProperty =
|
|
|
|
|
@ -455,8 +444,6 @@ namespace Txgy.EWS.Client.PageModule.ViewModels
|
|
|
|
|
}
|
|
|
|
|
private void UpdateChartData()
|
|
|
|
|
{
|
|
|
|
|
double yRange = YMax - YMin;
|
|
|
|
|
|
|
|
|
|
double[][] multiChannelData = new double[smList.Count * 3][];
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
@ -480,10 +467,6 @@ namespace Txgy.EWS.Client.PageModule.ViewModels
|
|
|
|
|
public void UpdateWavesFromTxt(string fn)
|
|
|
|
|
{
|
|
|
|
|
string allStr;
|
|
|
|
|
string sn = "";//0
|
|
|
|
|
int points = 0;//1
|
|
|
|
|
int samp = 500;//2
|
|
|
|
|
string startTime = "";//3;4,5,6=null
|
|
|
|
|
|
|
|
|
|
smList = new List<StationModel>();
|
|
|
|
|
using (StreamReader streamReader = new StreamReader(fn))
|
|
|
|
|
@ -493,9 +476,6 @@ namespace Txgy.EWS.Client.PageModule.ViewModels
|
|
|
|
|
if (allStr.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
string[] strLines = allStr.Trim().Split(new char[] { '\n' });
|
|
|
|
|
List<string> strList = strLines.ToList();
|
|
|
|
|
int cnt = strList.Count;
|
|
|
|
|
int num = 0;
|
|
|
|
|
string[] snStr = strLines[0].Trim().Split(',');
|
|
|
|
|
string tmpName = snStr[0].Substring(14, 3);
|
|
|
|
|
CurPoints = int.Parse(snStr[1].Trim().Split(' ')[0]);
|
|
|
|
|
@ -913,8 +893,6 @@ namespace Txgy.EWS.Client.PageModule.ViewModels
|
|
|
|
|
}
|
|
|
|
|
private void ThreadLoop()
|
|
|
|
|
{
|
|
|
|
|
int sm = 0;
|
|
|
|
|
|
|
|
|
|
while (_stop == false)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
@ -941,7 +919,6 @@ namespace Txgy.EWS.Client.PageModule.ViewModels
|
|
|
|
|
if (sampleBundleToGenerate > 0)
|
|
|
|
|
{
|
|
|
|
|
//YMax = tmps.Max();
|
|
|
|
|
double yRange = YMax - YMin;
|
|
|
|
|
|
|
|
|
|
double[][] multiChannelData = new double[_channelCount][];
|
|
|
|
|
|
|
|
|
|
|