|
|
|
|
@ -251,18 +251,35 @@ namespace UDPLIB
@@ -251,18 +251,35 @@ namespace UDPLIB
|
|
|
|
|
{ |
|
|
|
|
UdpClient transmitter = null; |
|
|
|
|
IPEndPoint endPoint = null; |
|
|
|
|
Point pnt; |
|
|
|
|
UInt16 pntX = 0; |
|
|
|
|
UInt16 pntY = 0; |
|
|
|
|
UInt16 pntlx = 0; |
|
|
|
|
UInt16 pntly = 0; |
|
|
|
|
|
|
|
|
|
public UDPTransmit(String IPaddr, Int32 remotePortUDP, Point p) |
|
|
|
|
//public UDPTransmit(String IPaddr, Int32 remotePortUDP, Point p) |
|
|
|
|
//{ |
|
|
|
|
// transmitter = new UdpClient(); |
|
|
|
|
// endPoint = new IPEndPoint(IPAddress.Parse(IPaddr), remotePortUDP); |
|
|
|
|
// pnt = p; |
|
|
|
|
// pnt.X = Util.minmax((ushort)64, (ushort)576, (ushort)pnt.X); |
|
|
|
|
// pnt.Y = Util.minmax((ushort)64, (ushort)416, (ushort)pnt.Y); |
|
|
|
|
|
|
|
|
|
// Bitmap crop = Res.Clearimg.Clone(new Rectangle(pnt.X - 64, pnt.Y - 64, 128, 128), PixelFormat.Format24bppRgb); |
|
|
|
|
// Res.Crop = crop; |
|
|
|
|
// Thread UDPtransmitThread = new Thread(new ThreadStart(UDPtransmitFrame)); |
|
|
|
|
// UDPtransmitThread.Start(); |
|
|
|
|
//} |
|
|
|
|
public UDPTransmit(String IPaddr, Int32 remotePortUDP, (UInt16, UInt16, UInt16, UInt16) p) |
|
|
|
|
{ |
|
|
|
|
transmitter = new UdpClient(); |
|
|
|
|
endPoint = new IPEndPoint(IPAddress.Parse(IPaddr), remotePortUDP); |
|
|
|
|
pnt = p; |
|
|
|
|
pnt.X = Util.minmax((ushort)64, (ushort)576, (ushort)pnt.X); |
|
|
|
|
pnt.Y = Util.minmax((ushort)64, (ushort)416, (ushort)pnt.Y); |
|
|
|
|
|
|
|
|
|
Bitmap crop = Res.Clearimg.Clone(new Rectangle(pnt.X - 64, pnt.Y - 64, 128, 128), PixelFormat.Format24bppRgb); |
|
|
|
|
Res.Crop = crop; |
|
|
|
|
pntX = p.Item1; // X координата |
|
|
|
|
pntY = p.Item2; // Y координата |
|
|
|
|
pntlx = p.Item3; // ширина эталона |
|
|
|
|
pntly = p.Item4; // высота эталона |
|
|
|
|
|
|
|
|
|
Res.Crop = Res.Clearimg.Clone(new Rectangle(pntX - pntlx / 2, pntY - pntly / 2, pntlx, pntly), PixelFormat.Format24bppRgb); |
|
|
|
|
Thread UDPtransmitThread = new Thread(new ThreadStart(UDPtransmitFrame)); |
|
|
|
|
UDPtransmitThread.Start(); |
|
|
|
|
} |
|
|
|
|
@ -279,11 +296,6 @@ namespace UDPLIB
@@ -279,11 +296,6 @@ namespace UDPLIB
|
|
|
|
|
{ |
|
|
|
|
transmitter.Connect(endPoint); |
|
|
|
|
|
|
|
|
|
//using (Graphics g = Graphics.FromImage(Res.Bmp)) |
|
|
|
|
//{ |
|
|
|
|
// g.Clear(); |
|
|
|
|
//}; |
|
|
|
|
|
|
|
|
|
// RTPMsgHeader |
|
|
|
|
RTPet.MH_VerPXCC = 2; |
|
|
|
|
RTPet.MH_MPT = 0xC6; |
|
|
|
|
@ -292,15 +304,15 @@ namespace UDPLIB
@@ -292,15 +304,15 @@ namespace UDPLIB
|
|
|
|
|
RTPet.MH_PT = 99; |
|
|
|
|
RTPet.MH_M = 0; |
|
|
|
|
RTPet.MH_SSRC = 12345678; |
|
|
|
|
RTPet.MH_DataLen = 36; |
|
|
|
|
RTPet.MH_DataLen = (UInt16)(RTPet.DataH0.Length - RTPet.DataH1.Length); |
|
|
|
|
RTPet.MH_RowNumber = 0; |
|
|
|
|
RTPet.MH_Offset = 0; |
|
|
|
|
|
|
|
|
|
// RTPVideoSupplementalData |
|
|
|
|
RTPet.SD_Width = (ushort)Res.Crop.Width; |
|
|
|
|
RTPet.SD_Height = (ushort)Res.Crop.Height; |
|
|
|
|
RTPet.SD_AzUpr = 0; |
|
|
|
|
RTPet.SD_ElUpr = 0; |
|
|
|
|
RTPet.SD_AzUpr = RTP.SD_AzUpr; |
|
|
|
|
RTPet.SD_ElUpr = RTP.SD_ElUpr; |
|
|
|
|
RTPet.SD_Shirota = RTP.SD_Shirota; |
|
|
|
|
RTPet.SD_Dolgota = RTP.SD_Dolgota; |
|
|
|
|
RTPet.SD_Vysota = RTP.SD_Vysota; |
|
|
|
|
@ -308,18 +320,12 @@ namespace UDPLIB
@@ -308,18 +320,12 @@ namespace UDPLIB
|
|
|
|
|
RTPet.SD_Roll = RTP.SD_Roll; |
|
|
|
|
RTPet.SD_Pitch = RTP.SD_Pitch; |
|
|
|
|
RTPet.SD_FrameId = 0; |
|
|
|
|
RTPet.SD_X = 0; |
|
|
|
|
RTPet.SD_Y = 0; |
|
|
|
|
RTPet.SD_lx = ; |
|
|
|
|
RTPet.SD_ly = 0; |
|
|
|
|
RTPet.SD_rejim_oes = 0; |
|
|
|
|
RTPet.SD_color = 0; |
|
|
|
|
|
|
|
|
|
// RTPVideoSupplementalDataExtra |
|
|
|
|
//RTP.DE_TLV_X = 0; |
|
|
|
|
//RTP.DE_TLV_Y = 0; |
|
|
|
|
//RTP.DE_TLV_dX = 0; |
|
|
|
|
//RTP.DE_TLV_dY = 0; |
|
|
|
|
RTPet.SD_X = pntX; |
|
|
|
|
RTPet.SD_Y = pntY; |
|
|
|
|
RTPet.SD_lx = (Byte)pntlx; |
|
|
|
|
RTPet.SD_ly = (Byte)pntly; |
|
|
|
|
RTPet.SD_rejim_oes = RTP.SD_rejim_oes; |
|
|
|
|
RTPet.SD_color = RTP.SD_color; |
|
|
|
|
|
|
|
|
|
RTPet.MakeDataH0(); |
|
|
|
|
transmitter.Send(RTPet.DataH0, RTPet.DataH0.Length); |
|
|
|
|
@ -430,7 +436,7 @@ namespace UDPLIB
@@ -430,7 +436,7 @@ namespace UDPLIB
|
|
|
|
|
RTP.MH_PT = 99; |
|
|
|
|
RTP.MH_M = 0; |
|
|
|
|
RTP.MH_SSRC = 12345678; |
|
|
|
|
RTP.MH_DataLen = 36; |
|
|
|
|
RTP.MH_DataLen = (UInt16)(RTP.DataH0.Length - RTP.DataH1.Length); |
|
|
|
|
RTP.MH_RowNumber = 0; |
|
|
|
|
RTP.MH_Offset = 0; |
|
|
|
|
|
|
|
|
|
@ -442,13 +448,11 @@ namespace UDPLIB
@@ -442,13 +448,11 @@ namespace UDPLIB
|
|
|
|
|
RTP.SD_Course = 0; |
|
|
|
|
RTP.SD_Roll = 0; |
|
|
|
|
RTP.SD_Pitch = 0; |
|
|
|
|
RTP.SD_FrameId = 0; |
|
|
|
|
|
|
|
|
|
// RTPVideoSupplementalDataExtra |
|
|
|
|
RTP.DE_TLV_X = 0; |
|
|
|
|
RTP.DE_TLV_Y = 0; |
|
|
|
|
RTP.DE_TLV_dX = 0; |
|
|
|
|
RTP.DE_TLV_dY = 0; |
|
|
|
|
RTP.SD_rejim_oes = 2; |
|
|
|
|
RTP.SD_color = 1; |
|
|
|
|
|
|
|
|
|
RTP.SD_FrameId = 0; |
|
|
|
|
|
|
|
|
|
RTP.MakeDataH0(); |
|
|
|
|
transmitter.Send(RTP.DataH0, RTP.DataH0.Length); |
|
|
|
|
@ -528,6 +532,16 @@ namespace UDPLIB
@@ -528,6 +532,16 @@ namespace UDPLIB
|
|
|
|
|
public static Int16 Course { set; get; } |
|
|
|
|
public static Int16 Roll { set; get; } |
|
|
|
|
public static Int16 Pitch { set; get; } |
|
|
|
|
public static Int32 Shirota { set; get; } |
|
|
|
|
public static Int32 Dolgota { set; get; } |
|
|
|
|
public static Int32 Vysota { set; get; } |
|
|
|
|
public static UInt16 X { set; get; } |
|
|
|
|
public static UInt16 Y { set; get; } |
|
|
|
|
public static Byte lx { set; get; } |
|
|
|
|
public static Byte ly { set; get; } |
|
|
|
|
public static Byte rejim_oes { set; get; } // Режим ОЭС: «0» – Обзор, «1» – АС |
|
|
|
|
public static Byte zahvat { set; get; } // Захват: «0» – отсутствие захвата, «1» – налачие захвата |
|
|
|
|
public static Byte color { set; get; } // Цвет изображения: «1» – цветное, «0» – монохромное |
|
|
|
|
public static String Version |
|
|
|
|
{ |
|
|
|
|
get |
|
|
|
|
|