예제 #1
0
파일: Utility.cs 프로젝트: hong1975/wats
 public static int SortMarkerByFrequency(Marker marker1, Marker marker2)
 {
     return marker1.frequency.CompareTo(marker2.frequency);
 }
예제 #2
0
        public static void drawMarker(Graphics g, double minX, double span, int minAbsRssi, int maxAbsRssi, Marker marker)
        {
            //drawing curve
            using (Pen markerPen = new Pen(Color.Red, 1.0f))
            {
                float xa, xb, xc, ya, yb, yc;
                xa = (float)((marker.frequency - minX) * 350 /span + 52);
                ya = (float)((Math.Abs(marker.rssi) - minAbsRssi) * 130 / (maxAbsRssi - minAbsRssi) + 15);

                xb = xa - 1.5f; yb = ya - 4.0f;
                xc = xa + 1.5f; yc = ya - 4.0f;

                g.DrawLine(markerPen, xa, ya, xb, yb);
                g.DrawLine(markerPen, xa, ya, xc, yc);
                g.DrawLine(markerPen, xb, yb, xc, yc);
            }
        }
예제 #3
0
파일: Utility.cs 프로젝트: hong1975/wats
        public static Marker CreateMarker(string channelName, List<WatsEmiSample> channelSamples)
        {
            Marker marker = new Marker();
            marker.channelName = channelName;
            double minmumAbsRssi = double.MaxValue;
            foreach (WatsEmiSample sample in channelSamples)
            {
                if (Math.Abs(sample.mRssi) < minmumAbsRssi)
                {
                    minmumAbsRssi = Math.Abs(sample.mRssi);
                    marker.frequency = sample.mFreq;
                    marker.rssi = sample.mRssi;
                }
            }

            return marker;
        }