Home > Back-end >  With c #, to help guide the error
With c #, to help guide the error

Time:09-26

using System;
Using System. The Text;
Using System. Windows. Forms;
Using Hik. Script. The Methods;
Using System.Net;
Using System.Net.Sockets;
Using System. The Threading;
Using System. Collections. Generic;
The class UserScript: ScriptMethods, IProcessMethods
{
Float x, y, Angle, tempX, tempY, tempA;
Int X1, X2, Y1, Y2, A1, A2,
///& lt; Summary>
///precompiled variable initialization
///& lt;/summary>
Public void Init ()
{
}
///& lt; Summary>
///Process execution time to enter the Process function
///& lt;/summary>
///& lt; Returns>
Public Boolean Process ()
{
GetFloatValue (" x ", ref x);
GetFloatValue (" y ", ref y);
GetFloatValue (" Angle ", ref Angle);
X1=(int) x;
TempX=Math. Abs (X-ray (float) X1);
X2=AB (tempX);
If (x<0)
{
X2=- X2;
}

Y1=(int) y;
TempY=Math. Abs (y - (float) Y1);
Y2=AB (tempY);
If (y<0)
{
Y2=- Y2;
}

A1=(int) Angle;
TempA=Math. Abs (Angle - (float) A1);
A2=AB (tempA);
If (angle<0)
{
A2=- A2;
}


SetIntValue (" X1 ", the X1);
SetIntValue (" X2 ", X2);
SetIntValue (Y1, Y1);
SetIntValue (Y2, Y2);
SetIntValue (" A1 ", A1);
SetIntValue (" A2 ", A2);
return true;
}

Int AB (float a)
{
A=a * 1000;
String A=a.T oString ();
String B=A.S ubstring (0, 3);
C=int the Convert. ToInt32 (B);
return C;
}

CodePudding user response: