本文整理汇总了C#中System.Int16.CopyTo方法的典型用法代码示例。如果您正苦于以下问题:C# Int16.CopyTo方法的具体用法?C# Int16.CopyTo怎么用?C# Int16.CopyTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Int16
的用法示例。
在下文中一共展示了Int16.CopyTo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoFreqTstStep
private bool DoFreqTstStep(int step, Int16[] scaleList)
{
Int16[] chValues = new Int16[100];
Int16[] refValues = new Int16[100];
SetFreq(step);
sigSource.SetAmpli(freqFullValues[step] * 0.75f);
DateTime startTime = DateTime.Now;
AppendText(this.txtMessage, String.Format("��ʼƵ��{0}����һ���Բ���,��ֵ�ȶ��������������һ��Ƶ��\r\n", freqNameList[step]));
waitKey.Reset();
while ((DateTime.Now - startTime).TotalSeconds < 10)
{
if (!Funs485.RdAllCh(cardAddr, out chValues))
{
AppendText(this.txtMessage, String.Format("��ȡ��{0}ģ��������ʧ��", cardAddr));
return false;
}
if (!Funs485.RdAllCh(refCardNo, out refValues))
{
AppendText(this.txtMessage, String.Format("��ȡ��{0}ģ��������ʧ��", cardAddr));
return false;
}
if (chValues.Length != refValues.Length)
{
AppendText(this.txtMessage, String.Format("�������У�岻һ��"));
return false;
}
chValues.CopyTo(WaitCalcValues, 0);
refValues.CopyTo(RefValues, 0);
InvalidateCtrl(this.gridValueView);
if (waitKey.WaitOne(0,true)) break;
}
StringBuilder sb = new StringBuilder();
sb.AppendFormat("����������{0}:", step);
for (int i = 0; i < chValues.Length / 3; i++)
{
float refVal = refValues[i * 3];
float realVal = chValues[i * 3];
sb.AppendFormat("{0}/{1}/{2}%,", realVal, refVal, realVal * 100 / refVal);
}
sb.AppendLine();
AppendText(this.txtMessage, sb.ToString());
WriteToFile(sb.ToString());
InvalidateCtrl(this.gridValueView);
return true;
}
示例2: DoCalcStep
private bool DoCalcStep(int step, Int16[] scaleList)
{
Int16[] chValues = new Int16[100];
Int16[] refValues = new Int16[100];
SetFreq(step);
DateTime startTime = DateTime.Now;
AppendText(this.txtMessage, String.Format("��ʼУƵ��{0},��ֵ�ȶ��������������һ��Ƶ��\r\n", freqNameList[step]));
waitKey.Reset();
while ((DateTime.Now - startTime).TotalSeconds < 10)
{
if (!Funs485.RdAllCh(cardAddr, out chValues))
{
AppendText(this.txtMessage, String.Format("��ȡ��{0}ģ��������ʧ��", cardAddr));
return false;
}
if (!Funs485.RdAllCh(refCardNo, out refValues))
{
AppendText(this.txtMessage, String.Format("��ȡ��{0}ģ��������ʧ��", cardAddr));
return false;
}
if (chValues.Length != refValues.Length)
{
AppendText(this.txtMessage, String.Format("�������У�岻һ��"));
return false;
}
chValues.CopyTo(WaitCalcValues, 0);
refValues.CopyTo(RefValues, 0);
InvalidateCtrl(this.gridValueView);
if (waitKey.WaitOne(0,true)) break;
}
for (int i = 0; i < chValues.Length / 3; i++)
{
double coef = scaleList[i * 4 + step] * 1.0;
float refVal = refValues[i * 3];
float realVal = chValues[i * 3];
coef = coef * refVal;
coef = coef / realVal;
// coef *= coef * refVal /realVal;
scaleList[i * 4 + step] = (Int16)Math.Round(coef);
}
scaleList.CopyTo(CoeffValues, 0);
InvalidateCtrl(this.gridValueView);
return true;
}