本文整理汇总了C#中SampleType类的典型用法代码示例。如果您正苦于以下问题:C# SampleType类的具体用法?C# SampleType怎么用?C# SampleType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SampleType类属于命名空间,在下文中一共展示了SampleType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteFile2
public void WriteFile2()
{
var engine = new FileHelperEngine<SampleType>();
var res = new SampleType[2];
res[0] = new SampleType();
res[1] = new SampleType();
res[0].Field1 = DateTime.Now.AddDays(1);
res[0].Field2 = "je";
res[0].Field3 = 0;
res[1].Field1 = DateTime.Now;
res[1].Field2 = "ho";
res[1].Field3 = 2;
engine.WriteFile(@"miprueba.txt", res, -10);
res = (SampleType[]) engine.ReadFile(@"miprueba.txt");
if (File.Exists(@"miprueba.txt"))
File.Delete(@"miprueba.txt");
Assert.AreEqual(2, res.Length);
}
示例2: P25Decoder
public P25Decoder(int sampleRate, SampleType sampleType)
: base(sampleType)
{
if (sampleType == SampleType.COMPLEX) //JG This is used when listening to the raw feed, not demodulated.
{
mBasebandFilter = new DSP.Filter.ComplexFIRFilter(DSP.Filter.FilterFactory.getLowPass(sampleRate, 5000, 31, WindowType.HAMMING), 1.0);
this.addComplexListener(mBasebandFilter);
mBasebandFilter.SetListener(mDemodulator);
mDemodulator.setListener(getRealReceiver());
}
mSymbolFilter = new DSP.Filter.C4FMSymbolFilter(sampleRate);
addRealSampleListener(mSymbolFilter);
mSymbolFilter.SetOutputListener(mSlicer);
mMessageProcessor = new DSP.FSK.P25MessageProcessor();
mNormalFramer = new DSP.FSK.P25MessageFramer(P25.FrameSync.P25_PHASE1.getSync(), 64, false);
mSlicer.AddListener(mNormalFramer);
mNormalFramer.setListener(mMessageProcessor);
mInvertedFramer = new DSP.FSK.P25MessageFramer(P25.FrameSync.P25_PHASE1_INVERTED.getSync(), 64, true);
mSlicer.AddListener(mInvertedFramer);
mInvertedFramer.setListener(mMessageProcessor);
mMessageProcessor.addMessageListener(this);
}
示例3: WriteEvents
public void WriteEvents()
{
before = 0;
after = 0;
engine = new FileHelperEngine<SampleType>();
engine.BeforeWriteRecord += engine_BeforeWriteRecord;
engine.AfterWriteRecord += engine_AfterWriteRecord;
SampleType[] res = new SampleType[2];
res[0] = new SampleType();
res[1] = new SampleType();
res[0].Field1 = DateTime.Now.AddDays(1);
res[0].Field2 = "je";
res[0].Field3 = 0;
res[1].Field1 = DateTime.Now;
res[1].Field2 = "ho";
res[1].Field3 = 2;
engine.WriteString(res);
Assert.AreEqual(2, engine.TotalRecords);
Assert.AreEqual(2, before);
Assert.AreEqual(2, after);
}
示例4: WriteFileNotifyPercent
public void WriteFileNotifyPercent()
{
actualPerc = 0;
actualAdd = 50;
var engine = new FileHelperEngine<SampleType>();
engine.Progress += ProgressChangePercent;
var res = new SampleType[2];
res[0] = new SampleType();
res[1] = new SampleType();
res[0].Field1 = DateTime.Now.AddDays(1);
res[0].Field2 = "je";
res[0].Field3 = 0;
res[1].Field1 = DateTime.Now;
res[1].Field2 = "ho";
res[1].Field3 = 2;
engine.WriteFile("prog1.txt", res);
if (File.Exists("prog1.txt"))
File.Delete("prog1.txt");
}
示例5: WriteStream
public void WriteStream()
{
engine = new FileHelperEngine(typeof (SampleType));
SampleType[] res = new SampleType[2];
res[0] = new SampleType();
res[1] = new SampleType();
res[0].Field1 = DateTime.Now.AddDays(1);
res[0].Field2 = "je";
res[0].Field3 = 0;
res[1].Field1 = DateTime.Now;
res[1].Field2 = "ho";
res[1].Field3 = 2;
StringBuilder sb = new StringBuilder();
StringWriter writer = new StringWriter(sb);
engine.WriteStream(writer, res, 1);
Assert.AreEqual(14 + 2, sb.ToString().Length);
Assert.AreEqual(sb.ToString(0, 8), DateTime.Now.AddDays(1).ToString("ddMMyyyy"));
}
示例6: RandomAttribute
/// <summary>
/// Construct a set of doubles from min to max
/// </summary>
/// <param name="min"></param>
/// <param name="max"></param>
/// <param name="count"></param>
public RandomAttribute(double min, double max, int count)
{
this.count = count;
this.dmin = min;
this.dmax = max;
this.sampleType = SampleType.DoubleRange;
}
示例7: SampleDefinition
public SampleDefinition(string name, Type pageType, SampleType sampleType, SampleCategory sampleArea)
{
_name = name;
_pageType = pageType;
_sampleType = sampleType;
_sampleCategory = sampleArea;
}
示例8: AppendToFile
public void AppendToFile()
{
var engine = new FileHelperEngine<SampleType>();
var res = new SampleType[2];
res[0] = new SampleType();
res[1] = new SampleType();
res[0].Field1 = DateTime.Now.AddDays(1).Date;
res[0].Field2 = "je";
res[0].Field3 = 0;
res[1].Field1 = DateTime.Now.Date;
res[1].Field2 = "ho";
res[1].Field3 = 2;
engine.WriteFile(@"test.txt", res);
engine.AppendToFile(@"test.txt", res);
var res2 = (SampleType[]) engine.ReadFile(@"test.txt");
Assert.AreEqual(4, res2.Length);
Assert.AreEqual(res[0].Field1, res2[0].Field1);
Assert.AreEqual(res[1].Field1, res2[1].Field1);
Assert.AreEqual(res[0].Field1, res2[2].Field1);
Assert.AreEqual(res[1].Field1, res2[3].Field1);
}
示例9: AppendOneToFile
public void AppendOneToFile()
{
engine = new FileHelperEngine(typeof (SampleType));
SampleType[] res = new SampleType[2];
res[0] = new SampleType();
res[1] = new SampleType();
res[0].Field1 = DateTime.Now.AddDays(1).Date;
res[0].Field2 = "je";
res[0].Field3 = 0;
res[1].Field1 = DateTime.Now.Date;
res[1].Field2 = "ho";
res[1].Field3 = 2;
engine.WriteFile(@"test.txt", res);
SampleType record = new SampleType();
record.Field1 = DateTime.Now.Date;
record.Field2 = "h2";
record.Field3 = 2;
engine.AppendToFile(@"test.txt", record);
SampleType[] res2 = (SampleType[]) engine.ReadFile(@"test.txt");
Assert.AreEqual(3, res2.Length);
Assert.AreEqual(res[0].Field1, res2[0].Field1);
Assert.AreEqual(res[1].Field1, res2[1].Field1);
Assert.AreEqual(DateTime.Now.Date, res2[2].Field1);
}
示例10: InsMethodOverload
public void InsMethodOverload()
{
SampleType x = new SampleType();
Assert.That(
MethodCall.Invoke(x, "XBaseInsMethod", 10),
Is.EqualTo("XBaseInsMethod(int i)"));
}
示例11: FormAddNew
public FormAddNew(SampleType table)
{
InitializeComponent();
InitializeOpenFileDialog();
_tableType = table;
tables = new DataGridView[] { dataGridViewNew, dataGridViewMil, dataGridViewMed, dataGridViewPsy, dataGridViewFamily, dataGridViewSocial, dataGridViewStudy, dataGridViewWork };
FillTable();
}
示例12: InsField
public void InsField()
{
SampleType x = new SampleType();
MethodCall.SetField(x, "baseInsField", "la la");
Assert.That(
MethodCall.GetField(x, "baseInsField"),
Is.EqualTo("la la"));
}
示例13: InsProp
public void InsProp()
{
SampleType x = new SampleType();
MethodCall.SetProp(x, "XBaseInsProp", "zoo");
Assert.That(
MethodCall.GetProp(x, "XBaseInsProp"),
Is.EqualTo("zoo"));
}
示例14: Histogram
public Histogram(SampleType type)
{
switch(type)
{
case SampleType.BIASED:
_sample = new ExponentiallyDecayingSample();
break;
case SampleType.UNIFORM:
_sample = new UniformSample();
break;
default:
throw new ArgumentException("Unknown enum value found.");
}
}
示例15: WriteNull
public void WriteNull()
{
var engine = new FileHelperEngine<SampleType>();
SampleType[] res = new SampleType[3];
res[0] = new SampleType();
res[1] = new SampleType();
res[2] = new SampleType();
string tempo = engine.WriteString(res);
res = engine.ReadString(tempo);
Assert.AreEqual(3, res.Length);
Assert.AreEqual(3, engine.TotalRecords);
Assert.AreEqual(0, engine.ErrorManager.ErrorCount);
Assert.AreEqual(DateTime.MinValue, res[0].Field1);
Assert.AreEqual("", res[0].Field2);
Assert.AreEqual(0, res[0].Field3);
}