예제 #1
0
        public static EpgServiceInfo FromKey(UInt64 key)
        {
            if (IsSPKey(key))
            {
                return(CreateSPInfo(key));
            }

            EpgServiceInfo info = ChSet5.ChItem(key, true, true);

            if (info.Key != key)
            {
                //TSID移動前のチャンネルだった場合
                info.TSID = (ushort)(key >> 16);
            }
            else if (string.IsNullOrEmpty(info.service_name))
            {
                //ChSet5で全く見つからず、キーだけが入って戻ってきた場合
                info.network_name = CommonManager.ConvertNetworkNameText(info.ONID);
                //info.partialReceptionFlag = 0;不明
                info.remote_control_key_id = info.RemoconID();
                info.service_name          = "[不明]";
                info.service_provider_name = info.network_name;
                //info.service_type = 0x01;不明
                info.ts_name = info.network_name;
            }
            return(info);
        }
예제 #2
0
        protected override bool SetData(ManualAutoAddData data)
        {
            if (data == null)
            {
                return(false);
            }

            data   = data.DeepClone();
            dataID = data.dataID;

            //深夜時間帯の処理
            if (Settings.Instance.LaterTimeUse == true && DateTime28.IsLateHour(data.PgStartTime.Hour) == true)
            {
                data.ShiftRecDay(-1);
            }

            //曜日の処理、0~6bit目:日~土
            int val = 0;

            chbxList.ForEach(chbx => chbx.IsChecked = (data.dayOfWeekFlag & (0x01 << val++)) != 0);

            checkBox_keyDisabled.IsChecked = data.IsEnabled == false;

            comboBox_startHH.SelectedIndex = (int)(data.startTime / (60 * 60));
            comboBox_startMM.SelectedIndex = (int)((data.startTime % (60 * 60)) / 60);
            comboBox_startSS.SelectedIndex = (int)(data.startTime % 60);

            //深夜時間帯の処理も含む
            UInt32 endTime = data.startTime + data.durationSecond;

            if (endTime >= comboBox_endHH.Items.Count * 60 * 60 || endTime >= 24 * 60 * 60 &&
                DateTime28.JudgeLateHour(data.PgStartTime.AddSeconds(data.durationSecond), data.PgStartTime) == false)
            {
                //正規のデータであれば、必ず0~23時台かつstartTimeより小さくなる。
                endTime -= 24 * 60 * 60;
            }
            comboBox_endHH.SelectedIndex = (int)(endTime / (60 * 60));
            comboBox_endMM.SelectedIndex = (int)((endTime % (60 * 60)) / 60);
            comboBox_endSS.SelectedIndex = (int)(endTime % 60);

            textBox_title.Text = data.title;

            comboBox_service.SelectedItem = ChSet5.ChItem(data.Create64Key());
            if (comboBox_service.SelectedItem == null)
            {
                comboBox_service.SelectedIndex = 0;
            }

            recSettingView.SetDefSetting(data.recSetting);

            return(true);
        }
예제 #3
0
        //過去番組情報用の補正
        public void CorrectServiceInfo(IEnumerable <EpgServiceEventInfo> list, bool reUseData = false)
        {
            //データ未ロード時は再利用不可
            reUseData &= IsEpgLoaded;

            foreach (EpgServiceEventInfo info in list)
            {
                //あれば取得EPGデータのEpgServiceInfo、EventInfoに差し替え
                EpgServiceAllEventInfo refInfo;
                if (reUseData && ServiceEventList.TryGetValue(info.serviceInfo.Key, out refInfo))
                {
                    info.serviceInfo = refInfo.serviceInfo;
                }
                else
                {
                    EpgServiceInfo chSet5Item = ChSet5.ChItem(info.serviceInfo.Key, true, true);
                    if (info.serviceInfo.TSID != chSet5Item.TSID)
                    {
                        info.serviceInfo.service_name = "[廃]" + info.serviceInfo.service_name;
                    }
                    else if (string.IsNullOrWhiteSpace(chSet5Item.service_name) == false)
                    {
                        //過去チャンネルでない場合はChSet5の名称を優先する
                        info.serviceInfo.service_name = chSet5Item.service_name;
                        info.serviceInfo.network_name = chSet5Item.network_name;
                    }
                }

                new List <List <EpgEventInfo> > {
                    info.eventList, info is EpgServiceAllEventInfo ? (info as EpgServiceAllEventInfo).eventArcList : new List <EpgEventInfo>()
                }
                .ForEach(eventList =>
                {
                    for (int i = 0; i < eventList.Count; i++)
                    {
                        EpgEventInfo refData;
                        if (reUseData && EventUIDList.TryGetValue(eventList[i].CurrentPgUID(), out refData))
                        {
                            eventList[i] = refData;
                        }
                        else
                        {
                            eventList[i].ServiceInfo = info.serviceInfo;
                        }
                    }
                });
            }
        }
예제 #4
0
        private static void CheckService(bool apply, ulong id, Action <ulong> SetNewId, ref string log)
        {
            EpgServiceInfo item = ChSet5.ChItem(id, true, true);

            if (item.Key != id)
            {
                if (apply)
                {
                    SetNewId(item.Key);
                }
                else if (log.Count(c => c == '\n') < 5)
                {
                    log += "  ID=0x" + id.ToString("X12") + " -> 0x" + item.Key.ToString("X12") + " (" + item.service_name + ")\r\n";
                }
                else if (log.EndsWith(".\r\n", StringComparison.Ordinal) == false)
                {
                    log += "  ...\r\n";
                }
            }
        }
예제 #5
0
        private void SetReserveTimeInfo(ReserveData resInfo)
        {
            if (resInfo == null)
            {
                return;
            }

            try
            {
                Title = ViewUtil.WindowTitleText(resInfo.Title, addMode == AddMode.Add ? "予約登録" : "予約変更");

                //テキストの選択位置を戻す
                textBox_title.Text = null;
                Dispatcher.BeginInvoke(new Action(() => textBox_title.Text = resInfo.Title), DispatcherPriority.Render);

                comboBox_service.SelectedItem = ChSet5.ChItem(resInfo.Create64Key());
                if (comboBox_service.SelectedItem == null)
                {
                    comboBox_service.SelectedIndex = 0;
                }

                DateTime startTime = resInfo.StartTime;
                DateTime endTime   = resInfo.StartTime.AddSeconds(resInfo.DurationSecond);

                //深夜時間帯の処理
                bool use28      = Settings.Instance.LaterTimeUse == true && (endTime - startTime).TotalDays < 1;
                bool late_start = use28 && startTime.Hour + 24 < comboBox_sh.Items.Count && DateTime28.IsLateHour(startTime.Hour);
                bool late_end   = use28 && endTime.Hour + 24 < comboBox_eh.Items.Count && DateTime28.JudgeLateHour(endTime, startTime);

                datePicker_start.SelectedDate = startTime.Date.AddDays(late_start == true ? -1 : 0);
                comboBox_sh.SelectedIndex     = startTime.Hour + (late_start == true ? 24 : 0);
                comboBox_sm.SelectedIndex     = startTime.Minute;
                comboBox_ss.SelectedIndex     = startTime.Second;

                datePicker_end.SelectedDate = endTime.Date.AddDays(late_end == true ? -1 : 0);
                comboBox_eh.SelectedIndex   = endTime.Hour + (late_end == true ? 24 : 0);
                comboBox_em.SelectedIndex   = endTime.Minute;
                comboBox_es.SelectedIndex   = endTime.Second;
            }
            catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
        }