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 {