Ejemplo n.º 1
0
        public SearchKeyDescView()
        {
            InitializeComponent();

            try
            {
                foreach (ChSet5Item info in ChSet5.ChList.Values)
                {
                    ServiceItem item = new ServiceItem();

                    item.ServiceInfo = CommonManager.ConvertChSet5To(info);
                    serviceList.Add(item);
                    serviceDict.Add((Int64)item.ID, item);
                }
                listView_service.ItemsSource = serviceList;

                comboBox_content.DataContext   = CommonManager.Instance.ContentKindList;
                comboBox_content.SelectedIndex = 0;

                comboBox_time_sw.DataContext   = CommonManager.Instance.DayOfWeekDictionary.Values;
                comboBox_time_sw.SelectedIndex = 0;
                comboBox_time_sh.DataContext   = CommonManager.Instance.HourDictionary.Values;
                comboBox_time_sh.SelectedIndex = 0;
                comboBox_time_sm.DataContext   = CommonManager.Instance.MinDictionary.Values;
                comboBox_time_sm.SelectedIndex = 0;
                comboBox_time_ew.DataContext   = CommonManager.Instance.DayOfWeekDictionary.Values;
                comboBox_time_ew.SelectedIndex = 6;
                comboBox_time_eh.DataContext   = CommonManager.Instance.HourDictionary.Values;
                comboBox_time_eh.SelectedIndex = 23;
                comboBox_time_em.DataContext   = CommonManager.Instance.MinDictionary.Values;
                comboBox_time_em.SelectedIndex = 59;
                comboBox_week_sh.DataContext   = CommonManager.Instance.HourDictionarySelect.Values;
                comboBox_week_sh.SelectedIndex = 0;
                comboBox_week_sm.DataContext   = CommonManager.Instance.MinDictionary.Values;
                comboBox_week_sm.SelectedIndex = 0;
                comboBox_week_eh.DataContext   = CommonManager.Instance.HourDictionarySelect.Values;
                comboBox_week_eh.SelectedIndex = 23;
                comboBox_week_em.DataContext   = CommonManager.Instance.MinDictionary.Values;
                comboBox_week_em.SelectedIndex = 59;

                var bxc = new BoxExchangeEdit.BoxExchangeEditor(null, listBox_content, true, true, true);
                button_content_clear.Click += new RoutedEventHandler(bxc.button_DeleteAll_Click);
                button_content_del.Click   += new RoutedEventHandler(bxc.button_Delete_Click);

                var bxd = new BoxExchangeEdit.BoxExchangeEditor(null, listBox_date, true, true, true);
                button_date_clear.Click += new RoutedEventHandler(bxd.button_DeleteAll_Click);
                button_date_del.Click   += new RoutedEventHandler(bxd.button_Delete_Click);

                new BoxExchangeEdit.BoxExchangeEditor(null, listView_service, true);
            }
            catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
        }
Ejemplo n.º 2
0
        public SearchKeyDescView()
        {
            InitializeComponent();

            try
            {
                foreach (ChSet5Item info in ChSet5.ChList.Values)
                {
                    ServiceItem item = new ServiceItem();

                    item.ServiceInfo = CommonManager.ConvertChSet5To(info);
                    serviceList.Add(item);
                    serviceDict.Add((Int64)item.ID, item);
                }
                listView_service.ItemsSource = serviceList;

                comboBox_content.DataContext = CommonManager.Instance.ContentKindList;
                comboBox_content.SelectedIndex = 0;

                comboBox_time_sw.DataContext = CommonManager.Instance.DayOfWeekDictionary.Values;
                comboBox_time_sw.SelectedIndex = 0;
                comboBox_time_sh.DataContext = CommonManager.Instance.HourDictionary.Values;
                comboBox_time_sh.SelectedIndex = 0;
                comboBox_time_sm.DataContext = CommonManager.Instance.MinDictionary.Values;
                comboBox_time_sm.SelectedIndex = 0;
                comboBox_time_ew.DataContext = CommonManager.Instance.DayOfWeekDictionary.Values;
                comboBox_time_ew.SelectedIndex = 6;
                comboBox_time_eh.DataContext = CommonManager.Instance.HourDictionary.Values;
                comboBox_time_eh.SelectedIndex = 23;
                comboBox_time_em.DataContext = CommonManager.Instance.MinDictionary.Values;
                comboBox_time_em.SelectedIndex = 59;
                comboBox_week_sh.DataContext = CommonManager.Instance.HourDictionarySelect.Values;
                comboBox_week_sh.SelectedIndex = 0;
                comboBox_week_sm.DataContext = CommonManager.Instance.MinDictionary.Values;
                comboBox_week_sm.SelectedIndex = 0;
                comboBox_week_eh.DataContext = CommonManager.Instance.HourDictionarySelect.Values;
                comboBox_week_eh.SelectedIndex = 23;
                comboBox_week_em.DataContext = CommonManager.Instance.MinDictionary.Values;
                comboBox_week_em.SelectedIndex = 59;

                var bxc = new BoxExchangeEdit.BoxExchangeEditor(null, listBox_content, true, true, true);
                button_content_clear.Click += new RoutedEventHandler(bxc.button_DeleteAll_Click);
                button_content_del.Click += new RoutedEventHandler(bxc.button_Delete_Click);

                var bxd = new BoxExchangeEdit.BoxExchangeEditor(null, listBox_date, true, true, true);
                button_date_clear.Click += new RoutedEventHandler(bxd.button_DeleteAll_Click);
                button_date_del.Click += new RoutedEventHandler(bxd.button_Delete_Click);

                new BoxExchangeEdit.BoxExchangeEditor(null, listView_service, true);
            }
            catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
        }
Ejemplo n.º 3
0
        private void ReloadProgramViewItem()
        {
            try
            {
                if (lastChkSID != null && listBox_service.ItemsSource != null)
                {
                    lastChkSID.Clear();
                    foreach (ServiceItem info in serviceList)
                    {
                        if (info.IsSelected == true)
                        {
                            lastChkSID.Add(info.ID, info.ID);
                        }
                    }
                }
                listBox_service.ItemsSource = null;
                serviceList.Clear();

                foreach (UInt64 id in viewCustServiceList)
                {
                    if (CommonManager.Instance.DB.ServiceEventList.ContainsKey(id) == true)
                    {
                        ServiceItem item = new ServiceItem();
                        item.ServiceInfo = CommonManager.Instance.DB.ServiceEventList[id].serviceInfo;
                        item.IsSelected  = true;
                        if (lastChkSID != null)
                        {
                            if (lastChkSID.ContainsKey(id) == false)
                            {
                                item.IsSelected = false;
                            }
                        }
                        serviceList.Add(item);
                    }
                }
                if (lastChkSID == null)
                {
                    lastChkSID = new Dictionary <ulong, ulong>();
                }

                listBox_service.ItemsSource = serviceList;

                UpdateEventList();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
            }
        }
Ejemplo n.º 4
0
        public SearchKeyDescView()
        {
            InitializeComponent();

            try
            {
                foreach (ChSet5Item info in ChSet5.Instance.ChList.Values)
                {
                    ServiceItem item = new ServiceItem();

                    item.ServiceInfo = CommonManager.ConvertChSet5To(info);
                    serviceList.Add(item);
                    serviceDict.Add((Int64)item.ID, item);
                }
                listView_service.ItemsSource = serviceList;

                comboBox_content.DataContext = CommonManager.Instance.ContentKindList;
                comboBox_content.SelectedIndex = 0;

                comboBox_time_sw.DataContext = CommonManager.Instance.DayOfWeekDictionary.Values;
                comboBox_time_sw.SelectedIndex = 0;
                comboBox_time_sh.DataContext = CommonManager.Instance.HourDictionary.Values;
                comboBox_time_sh.SelectedIndex = 0;
                comboBox_time_sm.DataContext = CommonManager.Instance.MinDictionary.Values;
                comboBox_time_sm.SelectedIndex = 0;
                comboBox_time_ew.DataContext = CommonManager.Instance.DayOfWeekDictionary.Values;
                comboBox_time_ew.SelectedIndex = 6;
                comboBox_time_eh.DataContext = CommonManager.Instance.HourDictionary.Values;
                comboBox_time_eh.SelectedIndex = 23;
                comboBox_time_em.DataContext = CommonManager.Instance.MinDictionary.Values;
                comboBox_time_em.SelectedIndex = 59;
                comboBox_week_sh.DataContext = CommonManager.Instance.HourDictionary.Values;
                comboBox_week_sh.SelectedIndex = 0;
                comboBox_week_sm.DataContext = CommonManager.Instance.MinDictionary.Values;
                comboBox_week_sm.SelectedIndex = 0;
                comboBox_week_eh.DataContext = CommonManager.Instance.HourDictionary.Values;
                comboBox_week_eh.SelectedIndex = 23;
                comboBox_week_em.DataContext = CommonManager.Instance.MinDictionary.Values;
                comboBox_week_em.SelectedIndex = 59;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
            }
        }
Ejemplo n.º 5
0
        private void ReloadProgramViewItemForSearch()
        {
            try
            {
                if (lastChkSID != null && listBox_service.ItemsSource != null)
                {
                    lastChkSID.Clear();
                    foreach (ServiceItem info in listBox_service.ItemsSource)
                    {
                        if (info.IsSelected == true)
                        {
                            lastChkSID.Add(info.ID, info.ID);
                        }
                    }
                }
                listBox_service.ItemsSource = null;
                var serviceList = new List <ServiceItem>();

                //番組情報の検索
                List <EpgSearchKeyInfo> keyList = new List <EpgSearchKeyInfo>();
                keyList.Add(setViewInfo.SearchKey);
                List <EpgEventInfo> list = new List <EpgEventInfo>();

                CommonManager.CreateSrvCtrl().SendSearchPg(keyList, ref list);

                //サービス毎のリストに変換
                serviceEventList.Clear();
                foreach (EpgEventInfo eventInfo in list)
                {
                    UInt64 id = CommonManager.Create64Key(eventInfo.original_network_id, eventInfo.transport_stream_id, eventInfo.service_id);
                    if (serviceEventList.ContainsKey(id) == false)
                    {
                        if (ChSet5.Instance.ChList.ContainsKey(id) == false)
                        {
                            //サービス情報ないので無効
                            continue;
                        }
                        serviceEventList.Add(id, new EpgServiceAllEventInfo(CommonManager.ConvertChSet5To(ChSet5.Instance.ChList[id])));
                    }
                    serviceEventList[id].eventList.Add(eventInfo);
                }

                for (int i = 0; i < setViewInfo.ViewServiceList.Count;)
                {
                    //TSIDが同じでSIDが逆順のときは正順にする
                    int skip = i + 1;
                    while (setViewInfo.ViewServiceList.Count > skip &&
                           setViewInfo.ViewServiceList[skip] >> 16 == setViewInfo.ViewServiceList[skip - 1] >> 16 &&
                           (setViewInfo.ViewServiceList[skip] & 0xFFFF) < (setViewInfo.ViewServiceList[skip - 1] & 0xFFFF))
                    {
                        skip++;
                    }
                    for (int j = skip - 1; j >= i; j--)
                    {
                        ulong id = setViewInfo.ViewServiceList[j];
                        if (serviceEventList.ContainsKey(id))
                        {
                            var item = new ServiceItem(serviceEventList[id].serviceInfo);
                            item.IsSelected = (lastChkSID == null || lastChkSID.ContainsKey(id));
                            serviceList.Add(item);
                        }
                    }
                    i = skip;
                }
                if (lastChkSID == null)
                {
                    lastChkSID = new Dictionary <ulong, ulong>();
                }

                listBox_service.ItemsSource = serviceList;

                UpdateEventList();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
            }
        }
Ejemplo n.º 6
0
        public SearchKeyDescView()
        {
            InitializeComponent();
            try
            {
                if (Settings.Instance.NoStyle == 1)
                {
                    button_content_add.Style = null;
                    button_content_del.Style = null;
                    button_all_on.Style      = null;
                    button_video_on.Style    = null;
                    button_bs_on.Style       = null;
                    button_cs_on.Style       = null;
                    button_tere_on.Style     = null;
                    button_1seg_on.Style     = null;
                    button_other_on.Style    = null;
                    button_all_off.Style     = null;
                    button_bs_on2.Style      = null;
                    button_cs_on2.Style      = null;
                    button_tere_on2.Style    = null;
                    button_1seg_on2.Style    = null;
                    button_other_on2.Style   = null;
                    button_date_del.Style    = null;
                    button_timeAdd.Style     = null;
                    button_weekAdd.Style     = null;
                }

                foreach (ChSet5Item info in ChSet5.Instance.ChList.Values)
                {
                    if (info.ServiceType != 0x01)
                    {
                        if (info.PartialFlag != 1 ||
                            info.ONID < 0x7880 || 0x7FE8 < info.ONID)
                        {
                            continue;
                        }
                    }

                    ServiceItem item = new ServiceItem();

                    item.ServiceInfo = CommonManager.ConvertChSet5To(info);
                    serviceList.Add(item);
                    serviceDict.Add((Int64)item.ID, item);
                }
                listView_service.ItemsSource = serviceList;

                comboBox_content.DataContext   = CommonManager.Instance.ContentKindDictionary.Values;
                comboBox_content.SelectedIndex = 0;

                comboBox_time_sw.DataContext   = CommonManager.Instance.DayOfWeekDictionary.Values;
                comboBox_time_sw.SelectedIndex = 0;
                comboBox_time_sh.DataContext   = CommonManager.Instance.HourDictionary.Values;
                comboBox_time_sh.SelectedIndex = 0;
                comboBox_time_sm.DataContext   = CommonManager.Instance.MinDictionary.Values;
                comboBox_time_sm.SelectedIndex = 0;
                comboBox_time_ew.DataContext   = CommonManager.Instance.DayOfWeekDictionary.Values;
                comboBox_time_ew.SelectedIndex = 6;
                comboBox_time_eh.DataContext   = CommonManager.Instance.HourDictionary.Values;
                comboBox_time_eh.SelectedIndex = 23;
                comboBox_time_em.DataContext   = CommonManager.Instance.MinDictionary.Values;
                comboBox_time_em.SelectedIndex = 59;
                comboBox_week_sh.DataContext   = CommonManager.Instance.HourDictionary.Values;
                comboBox_week_sh.SelectedIndex = 0;
                comboBox_week_sm.DataContext   = CommonManager.Instance.MinDictionary.Values;
                comboBox_week_sm.SelectedIndex = 0;
                comboBox_week_eh.DataContext   = CommonManager.Instance.HourDictionary.Values;
                comboBox_week_eh.SelectedIndex = 23;
                comboBox_week_em.DataContext   = CommonManager.Instance.MinDictionary.Values;
                comboBox_week_em.SelectedIndex = 59;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
            }
        }
Ejemplo n.º 7
0
        public void SetSearchKey(EpgSearchKeyInfo key)
        {
            comboBox_andKey.Text         = Regex.Replace(key.andKey, @"^(?:\^!\{999\})?(?:C!\{999\})?(?:D!\{1[0-9]{8}\})?", "");
            comboBox_notKey.Text         = key.notKey;
            checkBox_regExp.IsChecked    = key.regExpFlag != 0;
            checkBox_aimai.IsChecked     = key.aimaiFlag != 0;
            checkBox_titleOnly.IsChecked = key.titleOnlyFlag != 0;
            var match = Regex.Match(key.andKey, @"^((?:\^!\{999\})?)((?:C!\{999\})?)((?:D!\{1[0-9]{8}\})?)");

            checkBox_keyDisabled.IsChecked = match.Groups[1].Value.Length > 0;
            checkBox_case.IsChecked        = match.Groups[2].Value.Length > 0;
            uint dur = 0;

            if (match.Groups[3].Value.Length > 0)
            {
                dur = uint.Parse(match.Groups[3].Value.Substring(3, 9));
            }
            textBox_chkDurationMin.Text = (dur / 10000 % 10000).ToString();
            textBox_chkDurationMax.Text = (dur % 10000).ToString();

            EnableContentListBox(true);
            listBox_content.Items.Clear();
            foreach (EpgContentData item in key.contentList)
            {
                ushort          contentKey = (ushort)(item.content_nibble_level_1 << 8 | item.content_nibble_level_2);
                ContentKindInfo info       = comboBox_content.Items.Cast <ContentKindInfo>().FirstOrDefault(a => a.ID == contentKey);
                if (info == null)
                {
                    //未知のジャンル
                    info = new ContentKindInfo()
                    {
                        Nibble1 = item.content_nibble_level_1, Nibble2 = item.content_nibble_level_2
                    };
                }
                listBox_content.Items.Add(info);
            }
            if (listBox_content.Items.Count == 0)
            {
                EnableContentListBox(false);
            }
            checkBox_notContent.IsChecked = key.notContetFlag != 0;

            EnableDateListBox(true);
            listBox_date.Items.Clear();
            foreach (EpgSearchDateInfo info in key.dateList)
            {
                listBox_date.Items.Add(new Tuple <string, EpgSearchDateInfo>(
                                           (new DateTime(2000, 1, 2 + info.startDayOfWeek % 7, info.startHour % 24, info.startMin % 60, 0)).ToString("ddd HH\\:mm") +
                                           (new DateTime(2000, 1, 2 + info.endDayOfWeek % 7, info.endHour % 24, info.endMin % 60, 0)).ToString(" ~ ddd HH\\:mm"), info));
            }
            if (listBox_date.Items.Count == 0)
            {
                EnableDateListBox(false);
            }
            checkBox_notDate.IsChecked = key.notDateFlag != 0;

            var keySortedServiceList = new List <long>(key.serviceList);

            keySortedServiceList.Sort();
            ServiceItem firstSelected = null;

            foreach (ServiceItem info in listView_service.Items)
            {
                info.IsSelected = keySortedServiceList.BinarySearch((long)info.ID) >= 0;
                if (firstSelected == null && info.IsSelected)
                {
                    firstSelected = info;
                }
            }
            if (firstSelected != null)
            {
                listView_service.ScrollIntoView(firstSelected);
            }

            comboBox_free.SelectedIndex        = key.freeCAFlag % 3;
            checkBox_chkRecEnd.IsChecked       = key.chkRecEnd != 0;
            textBox_chkRecDay.Text             = (key.chkRecDay >= 40000 ? key.chkRecDay % 10000 : key.chkRecDay).ToString();
            checkBox_chkRecNoService.IsChecked = key.chkRecDay >= 40000;
        }
Ejemplo n.º 8
0
        private void ReloadProgramViewItemForSearch()
        {
            try
            {
                if (lastChkSID != null && listBox_service.ItemsSource != null)
                {
                    lastChkSID.Clear();
                    foreach (ServiceItem info in serviceList)
                    {
                        if (info.IsSelected == true)
                        {
                            lastChkSID.Add(info.ID, info.ID);
                        }
                    }
                }
                listBox_service.ItemsSource = null;
                serviceList.Clear();

                //番組情報の検索
                List<EpgSearchKeyInfo> keyList = new List<EpgSearchKeyInfo>();
                keyList.Add(setViewInfo.SearchKey);
                List<EpgEventInfo> list = new List<EpgEventInfo>();

                cmd.SendSearchPg(keyList, ref list);

                //サービス毎のリストに変換
                serviceEventList.Clear();
                foreach (EpgEventInfo eventInfo in list)
                {
                    UInt64 id = CommonManager.Create64Key(eventInfo.original_network_id, eventInfo.transport_stream_id, eventInfo.service_id);
                    EpgServiceEventInfo serviceInfo = null;
                    if (serviceEventList.ContainsKey(id) == false)
                    {
                        if (ChSet5.Instance.ChList.ContainsKey(id) == false)
                        {
                            //サービス情報ないので無効
                            continue;
                        }
                        serviceInfo = new EpgServiceEventInfo();
                        serviceInfo.serviceInfo = CommonManager.ConvertChSet5To(ChSet5.Instance.ChList[id]);

                        serviceEventList.Add(id, serviceInfo);
                    }
                    else
                    {
                        serviceInfo = serviceEventList[id];
                    }
                    serviceInfo.eventList.Add(eventInfo);
                }

                foreach (UInt64 id in viewCustServiceList)
                {
                    if (serviceEventList.ContainsKey(id) == true)
                    {
                        ServiceItem item = new ServiceItem();
                        item.ServiceInfo = serviceEventList[id].serviceInfo;
                        item.IsSelected = true;
                        if (lastChkSID != null)
                        {
                            if (lastChkSID.ContainsKey(id) == false)
                            {
                                item.IsSelected = false;
                            }
                        }
                        serviceList.Add(item);
                    }
                }
                if (lastChkSID == null)
                {
                    lastChkSID = new Dictionary<ulong, ulong>();
                }

                listBox_service.ItemsSource = serviceList;

                UpdateEventList();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
            }
        }
Ejemplo n.º 9
0
        private void ReloadProgramViewItem()
        {
            try
            {
                if (lastChkSID != null && listBox_service.ItemsSource != null)
                {
                    lastChkSID.Clear();
                    foreach (ServiceItem info in serviceList)
                    {
                        if (info.IsSelected == true)
                        {
                            lastChkSID.Add(info.ID, info.ID);
                        }
                    }
                } 
                listBox_service.ItemsSource = null;
                serviceList.Clear();

                foreach (UInt64 id in viewCustServiceList)
                {
                    if (CommonManager.Instance.DB.ServiceEventList.ContainsKey(id) == true)
                    {
                        ServiceItem item = new ServiceItem();
                        item.ServiceInfo = CommonManager.Instance.DB.ServiceEventList[id].serviceInfo;
                        item.IsSelected = true;
                        if (lastChkSID != null)
                        {
                            if (lastChkSID.ContainsKey(id) == false)
                            {
                                item.IsSelected = false;
                            }
                        }
                        serviceList.Add(item);
                    }
                }
                if (lastChkSID == null)
                {
                    lastChkSID = new Dictionary<ulong, ulong>();
                }

                listBox_service.ItemsSource = serviceList;

                UpdateEventList();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
            }
        }
Ejemplo n.º 10
0
        public SearchKeyDescView()
        {
            InitializeComponent();
            try
            {
                if (Settings.Instance.NoStyle == 1)
                {
                    button_content_add.Style = null;
                    button_content_del.Style = null;
                    button_all_on.Style = null;
                    button_video_on.Style = null;
                    button_bs_on.Style = null;
                    button_cs_on.Style = null;
                    button_tere_on.Style = null;
                    button_1seg_on.Style = null;
                    button_other_on.Style = null;
                    button_all_off.Style = null;
                    button_bs_on2.Style = null;
                    button_cs_on2.Style = null;
                    button_tere_on2.Style = null;
                    button_1seg_on2.Style = null;
                    button_other_on2.Style = null;
                    button_date_del.Style = null;
                    button_timeAdd.Style = null;
                    button_weekAdd.Style = null;
                }

                foreach (ChSet5Item info in ChSet5.Instance.ChList.Values)
                {
                    ServiceItem item = new ServiceItem();

                    item.ServiceInfo = CommonManager.ConvertChSet5To(info);
                    serviceList.Add(item);
                    serviceDict.Add((Int64)item.ID, item);
                }
                listView_service.ItemsSource = serviceList;

                comboBox_content.DataContext = CommonManager.Instance.ContentKindDictionary.Values;
                comboBox_content.SelectedIndex = 0;

                comboBox_time_sw.DataContext = CommonManager.Instance.DayOfWeekDictionary.Values;
                comboBox_time_sw.SelectedIndex = 0;
                comboBox_time_sh.DataContext = CommonManager.Instance.HourDictionary.Values;
                comboBox_time_sh.SelectedIndex = 0;
                comboBox_time_sm.DataContext = CommonManager.Instance.MinDictionary.Values;
                comboBox_time_sm.SelectedIndex = 0;
                comboBox_time_ew.DataContext = CommonManager.Instance.DayOfWeekDictionary.Values;
                comboBox_time_ew.SelectedIndex = 6;
                comboBox_time_eh.DataContext = CommonManager.Instance.HourDictionary.Values;
                comboBox_time_eh.SelectedIndex = 23;
                comboBox_time_em.DataContext = CommonManager.Instance.MinDictionary.Values;
                comboBox_time_em.SelectedIndex = 59;
                comboBox_week_sh.DataContext = CommonManager.Instance.HourDictionary.Values;
                comboBox_week_sh.SelectedIndex = 0;
                comboBox_week_sm.DataContext = CommonManager.Instance.MinDictionary.Values;
                comboBox_week_sm.SelectedIndex = 0;
                comboBox_week_eh.DataContext = CommonManager.Instance.HourDictionary.Values;
                comboBox_week_eh.SelectedIndex = 23;
                comboBox_week_em.DataContext = CommonManager.Instance.MinDictionary.Values;
                comboBox_week_em.SelectedIndex = 59;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
            }
        }
Ejemplo n.º 11
0
        private void ReloadProgramViewItem(bool enablePrev, bool enableNext)
        {
            try
            {
                if (listBox_service.ItemsSource != null)
                {
                    foreach (ServiceItem info in listBox_service.ItemsSource)
                    {
                        lastChkSID[info.ID] = info.IsSelected;
                    }
                }
                listBox_service.ItemsSource = null;
                var serviceList = new List <ServiceItem>();

                //特殊なサービス指定の展開と重複除去
                var viewIDList = new List <ulong>();
                foreach (ulong id in setViewInfo.ViewServiceList)
                {
                    IEnumerable <EpgServiceAllEventInfo> sel =
                        id == (ulong)CustomEpgTabInfo.SpecialViewServices.ViewServiceDttv ?
                        serviceEventList.Values.Where(info => ChSet5.IsDttv(info.serviceInfo.ONID)) :
                        id == (ulong)CustomEpgTabInfo.SpecialViewServices.ViewServiceBS ?
                        serviceEventList.Values.Where(info => ChSet5.IsBS(info.serviceInfo.ONID)) :
                        id == (ulong)CustomEpgTabInfo.SpecialViewServices.ViewServiceCS ?
                        serviceEventList.Values.Where(info => ChSet5.IsCS(info.serviceInfo.ONID)) :
                        id == (ulong)CustomEpgTabInfo.SpecialViewServices.ViewServiceCS3 ?
                        serviceEventList.Values.Where(info => ChSet5.IsCS3(info.serviceInfo.ONID)) :
                        id == (ulong)CustomEpgTabInfo.SpecialViewServices.ViewServiceOther ?
                        serviceEventList.Values.Where(info => ChSet5.IsOther(info.serviceInfo.ONID)) : null;
                    if (sel == null)
                    {
                        if (viewIDList.Contains(id) == false)
                        {
                            viewIDList.Add(id);
                        }
                        continue;
                    }
                    foreach (EpgServiceInfo info in DBManager.SelectServiceEventList(sel).Select(allInfo => allInfo.serviceInfo))
                    {
                        if (viewIDList.Contains(CommonManager.Create64Key(info.ONID, info.TSID, info.SID)) == false)
                        {
                            viewIDList.Add(CommonManager.Create64Key(info.ONID, info.TSID, info.SID));
                        }
                    }
                }
                for (int i = 0; i < viewIDList.Count;)
                {
                    //TSIDが同じでSIDが逆順のときは正順にする
                    int skip = i + 1;
                    while (viewIDList.Count > skip &&
                           viewIDList[skip] >> 16 == viewIDList[skip - 1] >> 16 &&
                           (viewIDList[skip] & 0xFFFF) < (viewIDList[skip - 1] & 0xFFFF))
                    {
                        skip++;
                    }
                    for (int j = skip - 1; j >= i; j--)
                    {
                        ulong id = viewIDList[j];
                        if (serviceEventList.ContainsKey(id))
                        {
                            var item = new ServiceItem(serviceEventList[id].serviceInfo);
                            item.IsSelected = lastChkSID.ContainsKey(id) == false || lastChkSID[id];
                            serviceList.Add(item);
                        }
                    }
                    i = skip;
                }
                listBox_service.ItemsSource = serviceList;
                button_prev.IsEnabled       = enablePrev;
                button_next.IsEnabled       = enableNext;

                UpdateEventList();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Ejemplo n.º 12
0
        public void SetSearchKey(EpgSearchKeyInfo key)
        {
            comboBox_andKey.Text         = Regex.Replace(key.andKey, @"^(?:\^!\{999\})?(?:C!\{999\})?(?:D!\{1[0-9]{8}\})?", "");
            comboBox_notKey.Text         = key.notKey;
            checkBox_regExp.IsChecked    = key.regExpFlag != 0;
            checkBox_aimai.IsChecked     = key.aimaiFlag != 0;
            checkBox_titleOnly.IsChecked = key.titleOnlyFlag != 0;
            var match = Regex.Match(key.andKey, @"^((?:\^!\{999\})?)((?:C!\{999\})?)((?:D!\{1[0-9]{8}\})?)");

            checkBox_keyDisabled.IsChecked = match.Groups[1].Value.Length > 0;
            checkBox_case.IsChecked        = match.Groups[2].Value.Length > 0;
            uint dur = 0;

            if (match.Groups[3].Value.Length > 0)
            {
                dur = uint.Parse(match.Groups[3].Value.Substring(3, 9));
            }
            textBox_chkDurationMin.Text = (dur / 10000 % 10000).ToString();
            textBox_chkDurationMax.Text = (dur % 10000).ToString();

            EnableContentListBox(true);
            listBox_content.Items.Clear();
            foreach (EpgContentData item in key.contentList)
            {
                ushort contentKey = (ushort)(item.content_nibble_level_1 << 8 | item.content_nibble_level_2);
                if (CommonManager.Instance.ContentKindDictionary.ContainsKey(contentKey))
                {
                    listBox_content.Items.Add(CommonManager.Instance.ContentKindDictionary[contentKey]);
                }
                else
                {
                    //未知のジャンル
                    listBox_content.Items.Add(new ContentKindInfo("?", "?", item.content_nibble_level_1, item.content_nibble_level_2));
                }
            }
            if (listBox_content.Items.Count == 0)
            {
                EnableContentListBox(false);
            }
            checkBox_notContent.IsChecked = key.notContetFlag != 0;

            EnableDateListBox(true);
            listBox_date.Items.Clear();
            foreach (EpgSearchDateInfo info in key.dateList)
            {
                DateItem item = new DateItem();
                item.DateInfo = info;
                listBox_date.Items.Add(item);
            }
            if (listBox_date.Items.Count == 0)
            {
                EnableDateListBox(false);
            }
            checkBox_notDate.IsChecked = key.notDateFlag != 0;

            var keySortedServiceList = new List <long>(key.serviceList);

            keySortedServiceList.Sort();
            ServiceItem firstSelected = null;

            foreach (ServiceItem info in listView_service.ItemsSource)
            {
                info.IsSelected = keySortedServiceList.BinarySearch((long)info.ID) >= 0;
                if (firstSelected == null && info.IsSelected)
                {
                    firstSelected = info;
                }
            }
            if (firstSelected != null)
            {
                listView_service.ScrollIntoView(firstSelected);
            }

            comboBox_free.SelectedIndex        = key.freeCAFlag % 3;
            checkBox_chkRecEnd.IsChecked       = key.chkRecEnd != 0;
            textBox_chkRecDay.Text             = (key.chkRecDay >= 40000 ? key.chkRecDay % 10000 : key.chkRecDay).ToString();
            checkBox_chkRecNoService.IsChecked = key.chkRecDay >= 40000;
        }
Ejemplo n.º 13
0
        private void ReloadProgramViewItemForSearch()
        {
            try
            {
                if (lastChkSID != null && listBox_service.ItemsSource != null)
                {
                    lastChkSID.Clear();
                    foreach (ServiceItem info in serviceList)
                    {
                        if (info.IsSelected == true)
                        {
                            lastChkSID.Add(info.ID, info.ID);
                        }
                    }
                }
                listBox_service.ItemsSource = null;
                serviceList.Clear();

                //番組情報の検索
                List <EpgSearchKeyInfo> keyList = new List <EpgSearchKeyInfo>();
                keyList.Add(setViewInfo.SearchKey);
                List <EpgEventInfo> list = new List <EpgEventInfo>();

                cmd.SendSearchPg(keyList, ref list);

                //サービス毎のリストに変換
                serviceEventList.Clear();
                foreach (EpgEventInfo eventInfo in list)
                {
                    UInt64 id = CommonManager.Create64Key(eventInfo.original_network_id, eventInfo.transport_stream_id, eventInfo.service_id);
                    EpgServiceEventInfo serviceInfo = null;
                    if (serviceEventList.ContainsKey(id) == false)
                    {
                        if (ChSet5.Instance.ChList.ContainsKey(id) == false)
                        {
                            //サービス情報ないので無効
                            continue;
                        }
                        serviceInfo             = new EpgServiceEventInfo();
                        serviceInfo.serviceInfo = CommonManager.ConvertChSet5To(ChSet5.Instance.ChList[id]);

                        serviceEventList.Add(id, serviceInfo);
                    }
                    else
                    {
                        serviceInfo = serviceEventList[id];
                    }
                    serviceInfo.eventList.Add(eventInfo);
                }

                foreach (UInt64 id in viewCustServiceList)
                {
                    if (serviceEventList.ContainsKey(id) == true)
                    {
                        ServiceItem item = new ServiceItem();
                        item.ServiceInfo = serviceEventList[id].serviceInfo;
                        item.IsSelected  = true;
                        if (lastChkSID != null)
                        {
                            if (lastChkSID.ContainsKey(id) == false)
                            {
                                item.IsSelected = false;
                            }
                        }
                        serviceList.Add(item);
                    }
                }
                if (lastChkSID == null)
                {
                    lastChkSID = new Dictionary <ulong, ulong>();
                }

                listBox_service.ItemsSource = serviceList;

                UpdateEventList();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
            }
        }