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); } }
public SearchKeyView() { InitializeComponent(); foreach (string info in Settings.Instance.AndKeyList) { comboBox_andKey.Items.Add(info); } foreach (string info in Settings.Instance.NotKeyList) { comboBox_notKey.Items.Add(info); } EnableContentListBox(false); foreach (ushort id in CommonManager.Instance.ContentKindList) { comboBox_content.Items.Add(new ContentKindInfo() { Nibble1 = (byte)(id >> 8), Nibble2 = (byte)id }); } comboBox_content.SelectedIndex = 0; EnableDateListBox(false); comboBox_time_sw.ItemsSource = Enumerable.Range(0, 7).Select(i => (new DateTime(2000, 1, 2 + i)).ToString("ddd")); comboBox_time_sw.SelectedIndex = 0; comboBox_time_sh.ItemsSource = Enumerable.Range(0, 24); comboBox_time_sh.SelectedIndex = 0; comboBox_time_sm.ItemsSource = Enumerable.Range(0, 60); comboBox_time_sm.SelectedIndex = 0; comboBox_time_ew.ItemsSource = Enumerable.Range(0, 7).Select(i => (new DateTime(2000, 1, 2 + i)).ToString("ddd")); comboBox_time_ew.SelectedIndex = 6; comboBox_time_eh.ItemsSource = Enumerable.Range(0, 24); comboBox_time_eh.SelectedIndex = 23; comboBox_time_em.ItemsSource = Enumerable.Range(0, 60); comboBox_time_em.SelectedIndex = 59; comboBox_week_sh.ItemsSource = Enumerable.Range(0, 24); comboBox_week_sh.SelectedIndex = 0; comboBox_week_sm.ItemsSource = Enumerable.Range(0, 60); comboBox_week_sm.SelectedIndex = 0; radioButton_week.IsChecked = true; foreach (ChSet5Item info in ChSet5.Instance.ChListSelected) { if (ChSet5.IsCS3(info.ONID)) { button_cs3.Visibility = Visibility.Visible; } listView_service.Items.Add(new ServiceItem(CommonManager.ConvertChSet5To(info))); } }
public SearchKeyView() { InitializeComponent(); foreach (string info in Settings.Instance.AndKeyList) { comboBox_andKey.Items.Add(info); } foreach (string info in Settings.Instance.NotKeyList) { comboBox_notKey.Items.Add(info); } EnableContentListBox(false); comboBox_content.ItemsSource = CommonManager.Instance.ContentKindList; comboBox_content.SelectedIndex = 0; EnableDateListBox(false); comboBox_time_sw.ItemsSource = CommonManager.Instance.DayOfWeekArray; comboBox_time_sw.SelectedIndex = 0; comboBox_time_sh.ItemsSource = Enumerable.Range(0, 24); comboBox_time_sh.SelectedIndex = 0; comboBox_time_sm.ItemsSource = Enumerable.Range(0, 60); comboBox_time_sm.SelectedIndex = 0; comboBox_time_ew.ItemsSource = CommonManager.Instance.DayOfWeekArray; comboBox_time_ew.SelectedIndex = 6; comboBox_time_eh.ItemsSource = Enumerable.Range(0, 24); comboBox_time_eh.SelectedIndex = 23; comboBox_time_em.ItemsSource = Enumerable.Range(0, 60); comboBox_time_em.SelectedIndex = 59; comboBox_week_sh.ItemsSource = Enumerable.Range(0, 24); comboBox_week_sh.SelectedIndex = 0; comboBox_week_sm.ItemsSource = Enumerable.Range(0, 60); comboBox_week_sm.SelectedIndex = 0; radioButton_week.IsChecked = true; var serviceList = new List <ServiceItem>(); foreach (ChSet5Item info in ChSet5.Instance.ChListSelected) { if (ChSet5.IsCS3(info.ONID)) { button_cs3.Visibility = Visibility.Visible; } serviceList.Add(new ServiceItem(CommonManager.ConvertChSet5To(info))); } listView_service.ItemsSource = serviceList; }
/// <summary> /// baseTimeから1週間分(EventBaseTimeをしきい値とし、このとき上限なし)のEPGデータを検索する /// </summary> public ErrCode SearchWeeklyEpgData(DateTime baseTime, EpgSearchKeyInfo key, out Dictionary <ulong, EpgServiceAllEventInfo> list) { list = null; List <EpgEventInfo> eventList; List <EpgEventInfo> arcList = null; ErrCode ret = SearchPg(new List <EpgSearchKeyInfo>() { key }, out eventList); if (ret == ErrCode.CMD_SUCCESS) { ret = ErrCode.CMD_ERR; baseTime = baseTime > EventBaseTime ? EventBaseTime : baseTime; arcList = new List <EpgEventInfo>(); //1週間分の過去番組情報 var param = new SearchPgParam(); param.keyList = new List <EpgSearchKeyInfo>() { key }; param.enumStart = baseTime.ToFileTime(); param.enumEnd = baseTime.AddDays(baseTime < EventBaseTime ? 7 : 14).ToFileTime(); try { CommonManager.CreateSrvCtrl().SendSearchPgArc(param, ref arcList); ret = ErrCode.CMD_SUCCESS; } catch { } } if (ret == ErrCode.CMD_SUCCESS) { list = new Dictionary <ulong, EpgServiceAllEventInfo>(); //サービス毎のリストに変換 foreach (EpgEventInfo info in eventList) { if (baseTime < EventBaseTime ? (info.StartTimeFlag != 0 && info.start_time >= baseTime && info.start_time < baseTime.AddDays(7)) : (info.StartTimeFlag == 0 || info.start_time >= baseTime)) { ulong id = CommonManager.Create64Key(info.original_network_id, info.transport_stream_id, info.service_id); EpgServiceAllEventInfo allInfo; if (list.TryGetValue(id, out allInfo) == false) { if (ChSet5.Instance.ChList.ContainsKey(id) == false) { //サービス情報ないので無効 continue; } allInfo = new EpgServiceAllEventInfo(CommonManager.ConvertChSet5To(ChSet5.Instance.ChList[id])); if (serviceEventList.ContainsKey(id)) { //リモコンキー情報を補完 allInfo.serviceInfo.remote_control_key_id = serviceEventList[id].serviceInfo.remote_control_key_id; } list.Add(id, allInfo); } allInfo.eventList.Add(info); } } foreach (EpgEventInfo info in arcList) { ulong id = CommonManager.Create64Key(info.original_network_id, info.transport_stream_id, info.service_id); EpgServiceAllEventInfo allInfo; if (list.TryGetValue(id, out allInfo) == false) { if (ChSet5.Instance.ChList.ContainsKey(id) == false) { //サービス情報ないので無効 continue; } allInfo = new EpgServiceAllEventInfo(CommonManager.ConvertChSet5To(ChSet5.Instance.ChList[id])); if (serviceEventList.ContainsKey(id)) { //リモコンキー情報を補完 allInfo.serviceInfo.remote_control_key_id = serviceEventList[id].serviceInfo.remote_control_key_id; } list.Add(id, allInfo); } allInfo.eventArcList.Add(info); } } return(ret); }
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); } }
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); } }
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); } }