本文整理匯總了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;
}