You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Txgy.Microseismic.BaseLib
|
|
|
|
|
{
|
|
|
|
|
public class ChannelModel
|
|
|
|
|
{
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
|
|
|
|
public double[] datas { get; set; }
|
|
|
|
|
|
|
|
|
|
public void ReadDataFromTxt(string fn,int channelIndex)
|
|
|
|
|
{
|
|
|
|
|
datas=new double[30000];
|
|
|
|
|
string allline;
|
|
|
|
|
|
|
|
|
|
using (StreamReader streamReader = new StreamReader(fn))
|
|
|
|
|
{
|
|
|
|
|
allline=streamReader.ReadToEnd();
|
|
|
|
|
}
|
|
|
|
|
string[] strs = allline.Split(new char[] { '\n' });
|
|
|
|
|
for (int i = 0; i < datas.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
datas[i] = double.Parse(strs[channelIndex * 30001 + i+1]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|