업무용 소스 예제

펄스 정보 전시용 함수 예제 소스

안요사님 2021. 10. 16. 18:17
728x90
반응형
728x90

- 펄스 정보 전시용 함수 예제 소스

public void SetPulseData()
        {
            try
            {
                ushort unChannel = DataManagerUnit1.BDTSystemInfo.stBDTSelectTargetInfo.unChannel;
                ST_IPSTGT stIPS = null;
                ST_IPS_ITA_FULLANAL stFullAnal = null;

                if (unChannel > 0 && !unChannel.Equals(ushort.MaxValue) && unChannel < 18)
                {
                    if (DataManagerUnit1.dic_PulseTargetInfos.ContainsKey((byte)unChannel))
                        stIPS = DataManagerUnit1.dic_PulseTargetInfos[(byte)unChannel];
                    if (DataManagerUnit6.dic_IPS_PulseFullAnal.ContainsKey(unChannel))
                        stFullAnal = DataManagerUnit6.dic_IPS_PulseFullAnal[unChannel].stIPSITAFullAnal;
                                                                            }

                                                                

                if (stIPS == null || stFullAnal == null)
                {
                    uc_Bearing.Text = "-";
                    uc_BearingRate.Text = "-";
                    uc_SNR.Text = "-";
                    uc_Frequency.Text = "-";
                    uc_PulseRange.Text = "-";
                    uc_Level.Text = "-";
                    uc_PulsePRI.Text = "-";
                }
                else
                {
                    SetFixedData((float)(stIPS.usBearing * 0.1), (float)(stIPS.shBearingVar * 0.1), (float)(stIPS.shSN * 0.1));

                    uc_Frequency.Text = (stIPS.unFrequency.Equals(uint.MaxValue)) ? "-" : string.Format("{0:F1}", stIPS.unFrequency * 0.001);

                    if (stFullAnal == null)
                    {
                        uc_PulseRange.Text = "-";
                        uc_Level.Text = "-";
                        uc_PulsePRI.Text = "-";
                    }
                    else
                    {
                        uc_PulseRange.Text = (stFullAnal.usPulse_Length.Equals(ushort.MaxValue)) ? "-" : string.Format("{0:F1}", stFullAnal.usPulse_Length);
                        uc_Level.Text = (stFullAnal.sPulse_Level.Equals(short.MaxValue)) ? "-" : string.Format("{0:F1}", stFullAnal.sPulse_Level * 0.1);
                        uc_PulsePRI.Text = (stFullAnal.usPulse_PRI.Equals(ushort.MaxValue)) ? "-" : string.Format("{0:F1}", stFullAnal.usPulse_PRI);
                    }
                    TrackingMode((EN_TARGETTRACKINGMODE)1);
                    control1.TitleForeground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#ced1d9"));                 }
            }
            catch (Exception ee)
            {
                TraceManager.AddLog(string.Format("{0}r\n{1}", ee.StackTrace, ee.Message));
                System.Diagnostics.Debug.WriteLine(string.Format("{0}r\n{1}", ee.StackTrace, ee.Message));
            }
        }

                                                        public void SetFixedData(float fBearing, float fBearingRate, float fSNR)
        {
            try
            {
                if (fBearing.Equals(float.MaxValue)) uc_Bearing.Text = "-";
                else uc_Bearing.Text = string.Format("{0:F1}", fBearing);                                 if (fBearingRate.Equals(float.MaxValue)) uc_BearingRate.Text = "-";
                else uc_BearingRate.Text = (fBearingRate > 0) ? string.Format("R {0:F1}", fBearingRate) : string.Format("L {0:F1}", -fBearingRate);
                if (fSNR.Equals(float.MaxValue)) uc_SNR.Text = "-";
                else uc_SNR.Text = string.Format("{0:F1}", fSNR); 
                DataManager._CMSHCI_WIDEBAND_TARGET_REQUEST.fTargetBeaing = fBearing;
            }
            catch (Exception ee)
            {
                TraceManager.AddLog(string.Format("{0}r\n{1}", ee.StackTrace, ee.Message));
                System.Diagnostics.Debug.WriteLine(string.Format("{0}r\n{1}", ee.StackTrace, ee.Message));
            }
        }
728x90
반응형