From ce243991b6da4e186e3b3f4a742bdd6f07d4ff87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B5=D0=BD=D0=B8=D1=81=20=D0=9A=D1=83=D0=B7=D0=BD?= =?UTF-8?q?=D0=B5=D1=86=D0=BE=D0=B2?= Date: Mon, 13 Nov 2023 15:42:14 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=BC=D0=B5=D0=BB=D0=BA=D0=B0=D1=8F=20?= =?UTF-8?q?=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B0=20=D0=B2=20rtp.cs=20=D0=B8?= =?UTF-8?q?=20udplib.cs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rtp.cs | 9 ++++++--- udplib.cs | 42 +++++++++++++++++++++++++++++++++++------- 2 files changed, 41 insertions(+), 10 deletions(-) diff --git a/rtp.cs b/rtp.cs index fc3695f..c273ba8 100644 --- a/rtp.cs +++ b/rtp.cs @@ -132,6 +132,7 @@ namespace nRTP { get { + _status = 0; _status |= (Byte)(_rejim_oes << 0); _status |= (Byte)(_zahvat << 1); _status |= (Byte)(_color << 2); @@ -379,6 +380,7 @@ namespace nRTP { get { + _status = 0; _status |= (Byte)(_rejim_oes << 0); _status |= (Byte)(_zahvat << 1); _status |= (Byte)(_color << 2); @@ -387,9 +389,10 @@ namespace nRTP set { _status = value; - _rejim_oes = (Byte)((value >> 0) & 0x01); - _zahvat = (Byte)((value >> 1) & 0x01); - _color = (Byte)((value >> 2) & 0x01); + SD_Status = value; + _rejim_oes = (Byte)((value & 0x01) >> 0); + _zahvat = (Byte)((value & 0x02) >> 1); + _color = (Byte)((value & 0x04) >> 2); } } public static Byte SD_rezerv; diff --git a/udplib.cs b/udplib.cs index eb1c47b..d22a306 100644 --- a/udplib.cs +++ b/udplib.cs @@ -557,12 +557,23 @@ namespace UDPLIB RTP.SD_Height = (UInt16)sizeY; RTP.SD_AzUpr = 0; RTP.SD_ElUpr = 0; - RTP.SD_Course = 0; - RTP.SD_Roll = 0; - RTP.SD_Pitch = 0; - RTP.SD_rejim_oes = 2; - RTP.SD_color = 1; + RTP.SD_Shirota = Res.Shirota; + RTP.SD_Dolgota = Res.Dolgota; + RTP.SD_Vysota = Res.Vysota; + RTP.SD_Course = Res.Course; + RTP.SD_Roll = Res.Roll; + RTP.SD_Pitch = Res.Pitch; + //RTP.SD_X = pntX; + //RTP.SD_Y = pntY; + //RTP.SD_lx = (Byte)pntlx; + //RTP.SD_ly = (Byte)pntly; + RTP.SD_rejim_oes = Res.rejim_oes; + RTP.SD_color = Res.color; + RTP.SD_zahvat = Res.zahvat; + +// Console.WriteLine($"{RTP.SD_rejim_oes} {RTP.SD_zahvat} {RTP.SD_color} {RTP.SD_Status} {Res.status}"); + //Console.WriteLine($"{RTP.SD_color} {RTP.SD_zahvat} {RTP.SD_rejim_oes} {RTP.SD_Status}"); RTP.MakeDataH0(); transmitter.Send(RTP.DataH0, RTP.DataH0.Length); @@ -672,7 +683,7 @@ namespace UDPLIB 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 zahvat { set; get; } // Захват: «0» – отсутствие захвата, «1» – наличие захвата public static Byte color { set; get; } // Цвет изображения: «1» – цветное, «0» – монохромное public static String Version { get => Data.Ver; } public static String Configuration { get => Data.Conf; } @@ -680,7 +691,24 @@ namespace UDPLIB public static Boolean status_eth { set; get; } public static float Az { set; get; } public static float El { set; get; } - + //public static Byte status + //{ + // get + // { + // status = 0; + // status |= (Byte)(rejim_oes << 0); + // status |= (Byte)(zahvat << 1); + // status |= (Byte)(color << 2); + // return status; + // } + // set + // { + // status = value; + // rejim_oes = (Byte)((value >> 0) & 0x01); + // zahvat = (Byte)((value >> 1) & 0x01); + // color = (Byte)((value >> 2) & 0x01); + // } + //} } public class Res2 {