Common.cs
1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Asa.Camera
{
public class Common
{
public static VisionLib visionLib;
}
public class CameraRegion
{
public string CameraName { set; get; } = "";
public string RegionName { set; get; } = "";
public int X { set; get; } = 0;
public int Y { set; get; } = 0;
public int Width { set; get; } = 0;
public int Height { set; get; } = 0;
public float Ratio { set; get; } = 0;
public override string ToString()
{
string s = string.Format("{0} X:{1} Y:{2} W:{3} H:{4} R:{5}", RegionName, X, Y, Width, Height, Ratio);
return s;
}
public CameraRegion Clone()
{
CameraRegion node = new();
System.Reflection.PropertyInfo[] info1 = node.GetType().GetProperties();
System.Reflection.PropertyInfo[] info2 = GetType().GetProperties();
for (int i = 0; i < info1.Length; i++)
info1[i].SetValue(node, info2[i].GetValue(this));
return node;
}
}
}