Пример #1
0
            private void CheckRcn()
            {
                if (!Callsign.IsJACallsign(log.Callsign))
                {
                    log.Point = 0;
                    ErrorReason.Set(listErr, Reason.OmakuniNonJA.ToString());
                    return;
                }
                if (Contestno.HasPower(log.ReceivedCn) == false)
                {
                    ErrorReason.Set(listErr, Reason.InvalidReceivedCn.ToString());
                }

                var hasStroke     = Callsign.HasStroke(log.Callsign);
                var areano        = Contestno.GetAreano(log);
                var stationAreano = Areano.GetNoFromStation(station, SubSelecter ? listMainArea : listSubArea);
                var suggests      = Areano.GetSuggestFromStation(station, SubSelecter ? listMainArea : listSubArea);

                if (!Freq.IsBeen(log.Freq))
                {
                    ErrorReason.Set(listErr, Reason.InvalidFreq.ToString());
                }
                if (Contestno.GetRegion(Contestno.GetPrefno(log, SubSelecter ? false : true)) != Callsign.GetRegion(log.Callsign, hasStroke))
                {
                    ErrorReason.Set(listErr, Reason.RegionUnmatches.ToString());
                }
                if (!Station.IsMatched(areano, stationAreano) && station != null && !hasStroke)
                {
                    ErrorReason.Set(listErr, Reason.AddressUnmatches.ToString(), Utils.ConvTostrarrFromList(suggests));
                }
                if (!Areano.IsBeen(SubSelecter ? listMainArea : listSubArea, areano))
                {
                    ErrorReason.Set(listErr, Reason.ReceivedCnUnexists.ToString(), Utils.ConvTostrarrFromList(Areano.GetFromList(Station.GetList(station), listMainArea)));
                }
            }
Пример #2
0
            private void CheckLog()
            {
                Anv.Check(log.Callsign, anvStr, listErr, station);
                if (station == null)
                {
                    ErrorReason.Set(listErr, Reason.GetDataFailed.ToString());
                }
                log.Point = 1;
                switch (log.Freq)
                {
                case "1.9MHz":
                case "3.5MHz":
                case "7MHz":
                case "10MHz":
                case "14MHz":
                case "18MHz":
                case "24MHz":
                case "430MHz":
                case "1200MHz":
                case "2400MHz":
                case "5600MHz":
                    log.Point = 0;
                    ErrorReason.Set(listErr, Reason.OutOfFreq.ToString());
                    break;

                default: break;
                }
            }
Пример #3
0
            private void CheckLog()
            {
                Anv.Check(log.Callsign, anvStr, listErr, station);
                if (station == null)
                {
                    ErrorReason.Set(listErr, Reason.GetDataFailed.ToString());
                }
                log.Point = 1;
                if (log.ReceivedCn[log.ReceivedCn.Length - 1] == 'N')
                {
                    log.Point = 2;
                }
                switch (config.CategoryCode[3])
                {
                case 'H':
                    if (Freq.CnvTofrqnum("28MHz") < Freq.CnvTofrqnum(log.Freq))
                    {
                        log.Point = 0;
                        ErrorReason.Set(listErr, Reason.OutOfFreq.ToString());
                    }
                    break;

                case 'V':
                    if (Freq.CnvTofrqnum("28MHz") >= Freq.CnvTofrqnum(log.Freq))
                    {
                        log.Point = 0;
                        ErrorReason.Set(listErr, Reason.OutOfFreq.ToString());
                    }
                    break;

                default: break;
                }
            }
Пример #4
0
 private void CheckScn()
 {
     Contestno.CheckSentCn(log, config.Contestno, null, isNTT, listErr);
     if ((isNTT && log.SentCn[log.SentCn.Length - 1] != 'N') || (!isNTT && log.SentCn[log.SentCn.Length - 1] == 'N'))
     {
         ErrorReason.Set(listErr, ExtraReason.InvalidSignOfCn.ToString());
         log.Point = 0;
     }
 }
Пример #5
0
            private void CheckRcn()
            {
                if (!Callsign.IsJACallsign(log.Callsign))
                {
                    log.Point = 0;
                    ErrorReason.Set(listErr, Reason.OmakuniNonJA.ToString());
                    return;
                }

                var  hasStroke     = Callsign.HasStroke(log.Callsign);
                var  areano        = Contestno.GetAreano(log);
                var  phoneRegion   = Contestno.GetPhoneRegion(areano, listMainArea);
                var  stationAreano = Areano.GetNoFromStation(station, listMainArea);
                var  suggests      = Areano.GetSuggestFromStation(station, listMainArea);
                char lrc           = log.ReceivedCn[log.ReceivedCn.Length - 1];

                if (lrc != 'N' && !('0' <= lrc && lrc <= '9'))
                {
                    ErrorReason.Set(listErr, ExtraReason.InvalidSignOfCn.ToString());
                    log.Point = 0;
                }

                if (!Freq.IsBeen(log.Freq))
                {
                    ErrorReason.Set(listErr, Reason.InvalidFreq.ToString());
                }
                if (phoneRegion == null)
                {
                    switch (areano)
                    {
                    case "050":
                    case "070":
                    case "080":
                    case "090":
                        break;

                    default:
                        ErrorReason.Set(listErr, Reason.ReceivedCnUnexists.ToString(), Utils.ConvTostrarrFromList(Areano.GetFromList(Station.GetList(station), listMainArea)));
                        break;
                    }
                }
                else
                {
                    if (!phoneRegion.Any(x => x == Callsign.GetRegion(log.Callsign, hasStroke)))
                    {
                        ErrorReason.Set(listErr, Reason.RegionUnmatches.ToString());
                    }
                    if (!Station.IsMatched(areano, stationAreano) && station != null && !hasStroke)
                    {
                        ErrorReason.Set(listErr, Reason.AddressUnmatches.ToString(), Utils.ConvTostrarrFromList(suggests));
                    }
                }
            }
Пример #6
0
 private void CheckLog()
 {
     Anv.Check(log.Callsign, anvStr, listErr, station);
     if (station == null)
     {
         ErrorReason.Set(listErr, Reason.GetDataFailed.ToString());
     }
     log.Point = 1;
     if (Freq.CnvTofrqnum(log.Freq) < Freq.CnvTofrqnum("430MHz"))
     {
         log.Point = 0;
         ErrorReason.Set(listErr, Reason.OutOfFreq.ToString());
     }
 }
Пример #7
0
            /// <summary>
            /// 送信コンテストナンバが正しいか確認 不正ならエラーリストに追加
            /// </summary>
            /// <param name="log">確認元ログデータ</param>
            /// <param name="contestno">通常のコンテストナンバ</param>
            /// <param name="extraCn">周波数特有のコンテストナンバ</param>
            /// <param name="hasPower">空中線電力の表示があるか</param>
            /// <param name="listErr">エラーリスト</param>
            public static void CheckSentCn(LogData log, string contestno, string extraCn, bool hasPower, Dictionary <string, ErrorReason> listErr)
            {
                string chk  = Contestno.GetRstFilteredStr(log)["Sent"];
                var    cn   = contestno;
                var    excn = extraCn;

                if (excn != null)
                {
                    cn = excn;
                }
                if (chk != cn || Contestno.HasPower(log.SentCn) != hasPower)
                {
                    ErrorReason.Set(listErr, Reason.InvalidSentCn.ToString());
                }
            }
Пример #8
0
        private void btExecute_Click(object sender, RoutedEventArgs e)
        {
            var listErr = ErrorReason.GetInitial();

            ErrorReason.Set(listErr, Reason.Duplicate.ToString());
            foreach (var d in Delete)
            {
                Log.Remove(d);
            }
            foreach (var l in Log)
            {
                l.FailedStr.Replace(ErrorReason.GetFailedStr(listErr), "");
            }
            this.Close();
        }
Пример #9
0
            /// <summary>
            /// 記念局であるか確認 記念局リストに存在しないもしくは、存在しない局ならエラーリストに追加
            /// </summary>
            /// <param name="callsign">確認先コールサイン</param>
            /// <param name="anvStr">記念局リスト</param>
            /// <param name="listError">エラーリスト</param>
            /// <param name="station">無線局情報</param>
            public static void Check(string callsign, string anvStr, Dictionary <string, ErrorReason> listError, StationData station)
            {
                if (callsign[0] != '8' || callsign.Substring(0, 2) != "8J")
                {
                    return;
                }
                string cs = Callsign.GetRemovedStroke(callsign);

                if (!anvStr.Contains(cs))
                {
                    ErrorReason.Set(listError, Reason.AnvUnchecked.ToString());
                }
                if (station == null && callsign[0] != '8')
                {
                    ErrorReason.Set(listError, Reason.GetDataFailed.ToString());
                }
            }
Пример #10
0
            private void CheckRcn()
            {
                if (!Callsign.IsJACallsign(log.Callsign))
                {
                    log.Point = 0;
                    ErrorReason.Set(listErr, Reason.OmakuniNonJA.ToString());
                    return;
                }
                if (Contestno.HasPower(log.ReceivedCn) == true)
                {
                    ErrorReason.Set(listErr, Reason.InvalidReceivedCn.ToString());
                }

                var prefno = Contestno.GetPrefno(log);

                if (prefno.Length > 3)
                {
                    prefno = prefno.Substring(0, 2);
                }
                if (config.CategoryCode[0] == 'X' && prefno != "11")
                {
                    ErrorReason.Set(listErr, ExtraReason.NotInKanagawa.ToString());
                    log.Point = 0;
                }
                var hasStroke     = Callsign.HasStroke(log.Callsign);
                var areano        = Contestno.GetAreano(log);
                var stationAreano = Areano.GetNoFromStation(station, listMainArea);
                var suggests      = Areano.GetSuggestFromStation(station, listMainArea);

                if (!Freq.IsBeen(log.Freq))
                {
                    ErrorReason.Set(listErr, Reason.InvalidFreq.ToString());
                }
                if (Contestno.GetRegion(prefno) != Callsign.GetRegion(log.Callsign, hasStroke))
                {
                    ErrorReason.Set(listErr, Reason.RegionUnmatches.ToString());
                }
                if (!Station.IsMatched(areano, stationAreano) && station != null && !hasStroke)
                {
                    ErrorReason.Set(listErr, Reason.AddressUnmatches.ToString(), Utils.ConvTostrarrFromList(suggests));
                }
                if (!Areano.IsBeen(listMainArea, areano))
                {
                    ErrorReason.Set(listErr, Reason.ReceivedCnUnexists.ToString(), Utils.ConvTostrarrFromList(Areano.GetFromList(Station.GetList(station), listMainArea)));
                }
            }
Пример #11
0
            private void CheckRcn()
            {
                if (!Callsign.IsJACallsign(log.Callsign))
                {
                    log.Point = 0;
                    ErrorReason.Set(listErr, Reason.OmakuniNonJA.ToString());
                    return;
                }
                if (Contestno.HasPower(log.ReceivedCn) == true)
                {
                    ErrorReason.Set(listErr, Reason.InvalidReceivedCn.ToString());
                }

                //59##L
                var prefno = Contestno.GetPrefno(log, true);

                if (10 > int.Parse(prefno) || int.Parse(prefno) > 17)
                {
                    ErrorReason.Set(listErr, ExtraReason.NotInKanto.ToString());
                    log.Point = 0;
                }
                var hasStroke     = Callsign.HasStroke(log.Callsign);
                var areano        = Contestno.GetAreano(log);
                var stationAreano = Areano.GetNoFromStation(station, listMainArea);
                var suggests      = Areano.GetSuggestFromStation(station, listMainArea);

                if (!Freq.IsBeen(log.Freq))
                {
                    ErrorReason.Set(listErr, Reason.InvalidFreq.ToString());
                }
                if (Contestno.GetRegion(prefno) != Callsign.GetRegion(log.Callsign, hasStroke))
                {
                    ErrorReason.Set(listErr, Reason.RegionUnmatches.ToString());
                }
                if (!Station.IsMatched(areano, stationAreano) && station != null && !hasStroke)
                {
                    ErrorReason.Set(listErr, Reason.AddressUnmatches.ToString(), Utils.ConvTostrarrFromList(suggests));
                }
                if (!Areano.IsBeen(listMainArea, areano))
                {
                    ErrorReason.Set(listErr, Reason.ReceivedCnUnexists.ToString(), Utils.ConvTostrarrFromList(Areano.GetFromList(Station.GetList(station), listMainArea)));
                }
            }
Пример #12
0
        private void UpdateData()
        {
            if (Work.Log.Count == 0)
            {
                return;
            }

            int unsearchen = 0;
            int unfinden   = 0;
            int erroren    = 0;
            int dupen      = 0;
            int dupegrpen  = 0;

            var listErr = ErrorReason.GetInitial();

            ErrorReason.Set(listErr, Reason.Duplicate.ToString());
            string dup = ErrorReason.GetFailedStr(listErr);

            foreach (var l in Work.Log)
            {
                while (l.FailedStr.Contains(dup))
                {
                    int idx = l.FailedStr.IndexOf(dup);
                    if (idx < 0)
                    {
                        break;
                    }
                    l.FailedStr = l.FailedStr.Remove(idx, dup.Length);
                }
            }

            Duplicates = new ObservableCollection <List <LogData> >();
            var gb = Work.Log.GroupBy(wl => new { wl.Callsign, wl.Freq }).Where(g => g.Count() > 1).ToList();

            dupegrpen = gb.Count;
            foreach (var g in gb)
            {
                var tmp = new List <LogData>();
                dupen += g.Count();
                for (int i = 0; i < g.Count(); i++)
                {
                    if (!g.ElementAt(i).FailedStr.Contains(dup))
                    {
                        g.ElementAt(i).FailedStr += dup;
                    }
                    tmp.Add(g.ElementAt(i));
                }
                Duplicates.Add(tmp);
            }

            lbReadenLogNum.Content = Work.Log.Count;
            Work.Log          = new ObservableCollection <LogData>(Work.Log.OrderByDescending(l => l.FailedStr));
            dgLog.ItemsSource = Work.Log;
            if (Work.Config != null)
            {
                lbSettingConfigen.Content = "";
            }
            foreach (var l in Work.Log)
            {
                if (!l.IsSearched)
                {
                    unsearchen++;
                }
                if (!l.IsFinded)
                {
                    unfinden++;
                }
                if (!l.IsRate0)
                {
                    erroren++;
                }
            }
            lbUnsearchenLogNum.Content = unsearchen;
            lbUnavailenLogNum.Content  = unfinden;
            lbErrorenLogNum.Content    = erroren;
            lbDupenLogNum.Content      = dupegrpen + "(" + dupen + ")";
        }