Пример #1
0
        private void ChannelMapGrid_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0 || e.RowIndex >= channel_map_.Count)
            {
                return;
            }
            ChannelMapEntryWrapper entry_wrapper = channel_map_[e.RowIndex];

            switch (ColumnIndexToEnum(e.ColumnIndex))
            {
            case ColumnEnum.Run:
                // GO button was clicked.  Figure out what entry it was, and apply the selected action.
                try
                {
                    entry_wrapper.RunSelectedAction();
                }
                catch (Exception exc)
                {
                    StringBuilder err_description = new StringBuilder();
                    err_description.AppendLine("An error occurred running selected action for channel: ");
                    err_description.AppendLine(entry_wrapper.SerializeForDebug());
                    new ErrorReporter.ErrorReportingForm(err_description.ToString(), exc);
                }
                break;

            case ColumnEnum.ChangeListing:
                DialogResult dr = new ListingSelectionForm(entry_wrapper).ShowDialog();
                ChannelMapGrid.InvalidateRow(e.RowIndex);
                break;
            }
        }
Пример #2
0
        void OnChannelMapEntryWrapperStatusChanged(object sender, EventArgs e)
        {
            ChannelMapEntryWrapper wrapper = (ChannelMapEntryWrapper)sender;
            int index = channel_map_.IndexOf(wrapper);

            ChannelMapGrid.InvalidateRow(index);
        }
Пример #3
0
        private void ChannelMapGrid_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
        {
            ChannelMapEntryWrapper entry_wrapper = channel_map_[e.RowIndex];
            ChannelMapEntry        entry         = entry_wrapper.MapEntry;

            switch (ColumnIndexToEnum(e.ColumnIndex))
            {
            case ColumnEnum.Number:
                e.Value = entry.Number;
                break;

            case ColumnEnum.Callsign:
                e.Value = entry.Callsign;
                break;

            case ColumnEnum.Physical:
                e.Value = entry.PhysicalChannel;
                break;

            case ColumnEnum.Status:
                e.Value = entry_wrapper.QAMStatus;
                break;

            case ColumnEnum.OTA:
                e.Value = entry_wrapper.ExistsAsOTA;
                break;

            case ColumnEnum.Listing:
            {
                List <Service> listings = entry_wrapper.listings;
                switch (listings.Count)
                {
                case 1:
                    e.Value = listings[0];
                    break;

                case 0:
                    e.Value = "None selected";
                    break;

                default:
                    e.Value = "Multiple selected!!";
                    break;
                }
            }
            break;

            case ColumnEnum.Action:
                e.Value = entry_wrapper.selected_action;
                break;
            }
        }
Пример #4
0
 private void InitChannelMapGrid()
 {
     Dictionary <int, ChannelMapEntry> .ValueCollection map_entries = ChannelMapParser.channel_map.Values;
     Console.WriteLine("Cross referencing channel map with EPG data and checking status of equivalent QAM channels");
     channel_map_ = new List <ChannelMapEntryWrapper>();
     foreach (ChannelMapEntry entry in ChannelMapParser.channel_map.Values)
     {
         Console.Write("{0} ", entry.Number);
         channel_map_.Add(ChannelMapEntryWrapper.CreateOrGetWrapperForEntry(entry));
     }
     foreach (ChannelMapEntryWrapper wrapper in channel_map_)
     {
         wrapper.StatusChanged += new EventHandler(OnChannelMapEntryWrapperStatusChanged);
     }
     ChannelMapEntryWrapper.SelectDefaultActions();
     ChannelMapGrid.RowCount = channel_map_.Count;
     SortGrid();
 }
Пример #5
0
        private void ChannelMapGrid_CellToolTipTextNeeded(object sender, DataGridViewCellToolTipTextNeededEventArgs e)
        {
            if (e.RowIndex < 0 || e.RowIndex >= channel_map_.Count)
            {
                return;
            }
            ChannelMapEntryWrapper entry_wrapper = channel_map_[e.RowIndex];

            switch (ColumnIndexToEnum(e.ColumnIndex))
            {
            case ColumnEnum.Status:
                switch (entry_wrapper.QAMStatus)
                {
                case QAMChannelStatus.ConflictingCCFirst:
                    e.ToolTipText = "Another CableCARD™ channel with different EIA info is merged with this one, but the sources for this one are earlier in the merged channel.";
                    break;

                case QAMChannelStatus.ConflictingCCNotFirst:
                    e.ToolTipText = "Another CableCARD™ channel with different EIA info is merged with this one, and the sources for the other channel are earlier in the merged channel.";
                    break;

                case QAMChannelStatus.ExistingDupeCCard:
                    e.ToolTipText = "QAM source(s) matching this channel exist but are merged with another CableCARD™ channel.";
                    break;

                case QAMChannelStatus.ExistingUnmerged:
                    e.ToolTipText = "QAM source(s) matching this channel exist but are not merged with this or other CableCARD™ channels.";
                    break;

                case QAMChannelStatus.IncorrectQAM:
                    e.ToolTipText = "A QAM channel is merged with this one, but it does not match the QAM channel number and program ID for this channel from the channel map.";
                    break;

                case QAMChannelStatus.NoCCChannelOrQAM:
                    e.ToolTipText = "The CableCARD™ channel does not exist in your guide, and neither does a corresponding QAM channel.";
                    break;

                case QAMChannelStatus.NoCCChannelWithQAM:
                    e.ToolTipText = "The CableCARD™ channel does not exist in your guide, but a QAM channel with matching EIA number does.";
                    break;

                case QAMChannelStatus.NotExisting:
                    e.ToolTipText = "QAM sources for this channel do not yet exist in your guide.  This is expected if the channel is encrypted.";
                    break;

                case QAMChannelStatus.OTAOnly:
                    e.ToolTipText = "QAM sources for this channel do not exist in your guide, and a channel with matching callsign exists in your local OTA lineup, so it should probably be there as ClearQAM.";
                    break;

                case QAMChannelStatus.ProperlyMerged:
                    e.ToolTipText = "QAM channel for this CableCARD™ channel already exists and is properly merged with it.";
                    break;

                case QAMChannelStatus.ProperlyMergedWithExtraneousCCard:
                    e.ToolTipText = "Both a matching QAM channel and CableCARD™ sources improperly using the EIA channel number are merged with this channel.  These erroneous CableCARD™ sources should be removed as they will occupy a tuner until reboot if MCE tries to use them.";
                    break;
                }
                break;

            case ColumnEnum.Action:
                e.ToolTipText = ChannelMapEntryWrapper.GetCorrectiveActionDescription(entry_wrapper.selected_action);
                break;
            }
        }
Пример #6
0
 private void RecommendedActionButton_Click(object sender, EventArgs e)
 {
     ChannelMapEntryWrapper.SelectDefaultActions();
     ChannelMapGrid.Invalidate(true);
 }
Пример #7
0
 private void NoActionButton_Click(object sender, EventArgs e)
 {
     ChannelMapEntryWrapper.ClearSelectedActions();
     ChannelMapGrid.Invalidate(true);
 }