示例#1
0
        public List <IRFrame> GetFrames(int format, IRFrameParam param)
        {
            List <IRFrame> frameList = new List <IRFrame>();

            if (this.DataList != null && this.DataList.Count > 0)
            {
                List <int> startIndexes = GetFrameStartIndexes(format, param, this.DataList);
                for (int i = 0; i < startIndexes.Count; i++)
                {
                    IRFrame          frame;
                    List <PulseData> datalist = new List <PulseData>();
                    if (i == startIndexes.Count - 1)
                    {
                        for (int j = startIndexes[i]; j < this.DataList.Count; j++)
                        {
                            datalist.Add(this.DataList[j]);
                        }
                    }
                    else
                    {
                        for (int j = startIndexes[i]; j < startIndexes[i + 1]; j++)
                        {
                            datalist.Add(this.DataList[j]);
                        }
                    }
                    frame = new IRFrame(format, param, datalist);
                    if (frame.ValueValid == false)
                    {
                        frameList.Clear();
                        break;
                    }
                    else
                    {
                        frameList.Add(frame);
                    }
                }
            }

            return(frameList);
        }
示例#2
0
 public IRFrame(int format, IRFrameParam param, List <PulseData> dataList)
 {
     this.ValueValid = false;
     this.DataList   = dataList;
     if (param == null)
     {
         this.Format = format;
         if (defaultParamDic.ContainsKey(format) == true)
         {
             this.FrameParam = defaultParamDic[format];
         }
         else
         {
             this.FrameParam = defaultParamDic[FORMAT_DENKYO];
         }
     }
     else
     {
         this.Format     = format;
         this.FrameParam = param;
     }
     MakeValue();
 }
示例#3
0
 public IRFrame(int format, IRFrameParam param, IRFrameValue value)
 {
     if (param == null)
     {
         this.Format = format;
         if (defaultParamDic.ContainsKey(format) == true)
         {
             this.FrameParam = defaultParamDic[format];
         }
         else
         {
             this.FrameParam = defaultParamDic[FORMAT_DENKYO];
         }
     }
     else
     {
         this.Format     = format;
         this.FrameParam = param;
     }
     if (value != null)
     {
         if (value.ValueList != null && value.ValueList.Count > 0)
         {
             this.Value      = value;
             this.ValueValid = true;
         }
         else
         {
             this.ValueValid = false;
         }
     }
     else
     {
         this.ValueValid = false;
     }
 }
示例#4
0
        public static void UpdateDefaultParamDic()
        {
            if (defaultParamDic.ContainsKey(FORMAT_OTHER))
            {
                defaultParamDic.Remove(FORMAT_OTHER);
            }
            IRFrameParam param = new IRFrameParam(MaiRimokon.Properties.Settings.Default.OtherCarrierHigh,
                                                  MaiRimokon.Properties.Settings.Default.OtherCarrierLow,
                                                  MaiRimokon.Properties.Settings.Default.OtherLeaderHigh,
                                                  MaiRimokon.Properties.Settings.Default.OtherLeaderLow,
                                                  MaiRimokon.Properties.Settings.Default.OtherPulse0Modulation,
                                                  MaiRimokon.Properties.Settings.Default.OtherPulse0High,
                                                  MaiRimokon.Properties.Settings.Default.OtherPulse0Low,
                                                  MaiRimokon.Properties.Settings.Default.OtherPulse1Modulation,
                                                  MaiRimokon.Properties.Settings.Default.OtherPulse1High,
                                                  MaiRimokon.Properties.Settings.Default.OtherPulse1Low,
                                                  MaiRimokon.Properties.Settings.Default.OtherStopHigh,
                                                  MaiRimokon.Properties.Settings.Default.OtherStopLow,
                                                  MaiRimokon.Properties.Settings.Default.OtherFrameInterval,
                                                  MaiRimokon.Properties.Settings.Default.OtherRepeatHigh,
                                                  MaiRimokon.Properties.Settings.Default.OtherRepeatLow);

            defaultParamDic.Add(FORMAT_OTHER, param);
        }
示例#5
0
        private List <int> GetFrameStartIndexes(int format, IRFrameParam param, List <PulseData> dataList)
        {
            List <int> ret        = new List <int>();
            bool       firstFrame = true;
            bool       high       = false;
            bool       stop       = false;
            int        i          = 0;
            int        time       = 0;

            while (i < dataList.Count)
            {
                PulseData data = dataList[i];
                if (firstFrame == true)
                {
                    if (data.Value == 1)
                    {
                        ret.Add(i);
                        time       = time + data.MicroSecond;
                        firstFrame = false;
                        i++;
                        if (i < dataList.Count)
                        {
                            if (dataList[i].Value == 0)
                            {
                                time = time + dataList[i].MicroSecond;
                                high = false;
                                i++;
                            }
                            else
                            {
                                ret.Clear();
                                break;
                            }
                        }
                        else
                        {
                            ret.Clear();
                            break;
                        }
                    }
                    else
                    {
                        i++;
                    }
                }
                else
                {
                    if (data.Value == 1 && high == true)
                    {
                        ret.Clear();
                        break;
                    }
                    if (data.Value == 0 && high == false)
                    {
                        ret.Clear();
                        break;
                    }
                    if (data.Value == 1)
                    {
                        if (stop == false)
                        {
                            time = time + data.MicroSecond;
                        }
                        else
                        {
                            ret.Add(i);
                            stop = false;
                            time = data.MicroSecond;
                        }
                        high = true;
                        i++;
                    }
                    else
                    {
                        time = time + data.MicroSecond;
                        high = false;
                        if (param.FrameInterval > 0)
                        {
                            if (time > param.FrameInterval - (int)((float)param.FrameInterval * 0.2F))
                            {
                                stop = true;
                            }
                            if (format != IRFrame.FORMAT_NEC)
                            {
                                i++;
                            }
                            else
                            {
                                break;
                            }
                        }
                        else if (param.StopLow > 0)
                        {
                            if (data.MicroSecond > param.StopLow - (int)((float)param.StopLow * 0.2F) &&
                                data.MicroSecond < param.StopLow + (int)((float)param.StopLow * 0.2F))
                            {
                                stop = true;
                            }
                            i++;
                        }
                        else
                        {
                            ret.Clear();
                            break;
                        }
                    }
                }
            }

            return(ret);
        }
示例#6
0
        public MaiRimoconData ConvertXmlToData(MainForm mainForm, MaiRControlValue.ValueChangedHandler handler)
        {
            MaiRimoconData data = new MaiRimoconData();

            if (this.Valid == true)
            {
                XmlNode node = doc.SelectSingleNode("/rimokoninfo/title");
                if (node != null)
                {
                    data.Title = node.InnerText;
                }

                node = doc.SelectSingleNode("/rimokoninfo/description");
                if (node != null)
                {
                    data.Description = node.InnerText;
                }

                XmlNodeList panelNodeList = doc.SelectNodes("/rimokoninfo/panelinfo");
                if (panelNodeList != null)
                {
                    List <IMaiRPanel> panelList = new List <IMaiRPanel>();
                    for (int i = 0; i < panelNodeList.Count; i++)
                    {
                        try
                        {
                            XmlNodeList        buttonNodeList = panelNodeList.Item(i).SelectNodes("buttoninfo");
                            List <IMaiRButton> buttonList     = new List <IMaiRButton>();
                            if (buttonNodeList != null)
                            {
                                for (int j = 0; j < buttonNodeList.Count; j++)
                                {
                                    int            format    = IRFrame.FORMAT_DENKYO;
                                    List <IRFrame> frameList = new List <IRFrame>();
                                    try
                                    {
                                        XmlNodeList frameNodeList = buttonNodeList.Item(j).SelectNodes("irinfo");
                                        if (frameNodeList != null)
                                        {
                                            for (int k = 0; k < frameNodeList.Count; k++)
                                            {
                                                node = frameNodeList.Item(k).SelectSingleNode("format");
                                                if (k == 0)
                                                {
                                                    format = Convert.ToInt32(node.InnerText);
                                                }
                                                int format2 = Convert.ToInt32(node.InnerText);
                                                node = frameNodeList.Item(k).SelectSingleNode("carrierhigh");
                                                int carrierHigh = Convert.ToInt32(node.InnerText);

                                                node = frameNodeList.Item(k).SelectSingleNode("carrierlow");
                                                int carrierLow = Convert.ToInt32(node.InnerText);

                                                node = frameNodeList.Item(k).SelectSingleNode("leaderhigh");
                                                int leaderHigh = Convert.ToInt32(node.InnerText);

                                                node = frameNodeList.Item(k).SelectSingleNode("leaderlow");
                                                int leaderLow = Convert.ToInt32(node.InnerText);

                                                node = frameNodeList.Item(k).SelectSingleNode("pulse0modulation");
                                                int pulse0Modulation = Convert.ToInt32(node.InnerText);

                                                node = frameNodeList.Item(k).SelectSingleNode("pulse0high");
                                                int pulse0High = Convert.ToInt32(node.InnerText);

                                                node = frameNodeList.Item(k).SelectSingleNode("pulse0low");
                                                int pulse0Low = Convert.ToInt32(node.InnerText);

                                                node = frameNodeList.Item(k).SelectSingleNode("pulse1modulation");
                                                int pulse1Modulation = Convert.ToInt32(node.InnerText);

                                                node = frameNodeList.Item(k).SelectSingleNode("pulse1high");
                                                int pulse1High = Convert.ToInt32(node.InnerText);

                                                node = frameNodeList.Item(k).SelectSingleNode("pulse1low");
                                                int pulse1Low = Convert.ToInt32(node.InnerText);

                                                node = frameNodeList.Item(k).SelectSingleNode("stophigh");
                                                int stopHigh = Convert.ToInt32(node.InnerText);

                                                node = frameNodeList.Item(k).SelectSingleNode("stoplow");
                                                int stopLow = Convert.ToInt32(node.InnerText);

                                                node = frameNodeList.Item(k).SelectSingleNode("frameinterval");
                                                int frameInterval = Convert.ToInt32(node.InnerText);

                                                node = frameNodeList.Item(k).SelectSingleNode("repeathigh");
                                                int repeatHigh = Convert.ToInt32(node.InnerText);

                                                node = frameNodeList.Item(k).SelectSingleNode("repeatlow");
                                                int repeatLow = Convert.ToInt32(node.InnerText);

                                                node = frameNodeList.Item(k).SelectSingleNode("data");
                                                List <byte> dataList = new List <byte>();
                                                for (int l = 0; l < node.InnerText.Length; l = l + 2)
                                                {
                                                    byte b = Convert.ToByte(node.InnerText.Substring(l, 2), 16);
                                                    dataList.Add(b);
                                                }

                                                node = frameNodeList.Item(k).SelectSingleNode("len");
                                                int len = Convert.ToInt32(node.InnerText);

                                                if (dataList.Count > 0 && len > 0)
                                                {
                                                    IRFrameParam param = new IRFrameParam(carrierHigh, carrierLow,
                                                                                          leaderHigh, leaderLow,
                                                                                          pulse0Modulation, pulse0High, pulse0Low,
                                                                                          pulse1Modulation, pulse1High, pulse1Low,
                                                                                          stopHigh, stopLow,
                                                                                          frameInterval,
                                                                                          repeatHigh, repeatLow);
                                                    IRFrameValue value = new IRFrameValue();
                                                    value.ValueList   = dataList;
                                                    value.ValueLength = len;
                                                    IRFrame frame = new IRFrame(format2, param, value);
                                                    frameList.Add(frame);
                                                }
                                            }
                                        }
                                    }
                                    catch
                                    {
                                    }
                                    node = buttonNodeList.Item(j).SelectSingleNode("type");
                                    int buttontype = Convert.ToInt32(node.InnerText);

                                    node = buttonNodeList.Item(j).SelectSingleNode("upperlabel");
                                    String upperlabel = node.InnerText;

                                    node = buttonNodeList.Item(j).SelectSingleNode("innerlabel");
                                    String innerlabel = node.InnerText;

                                    node = buttonNodeList.Item(j).SelectSingleNode("color");
                                    int color = Convert.ToInt32(node.InnerText);

                                    node = buttonNodeList.Item(j).SelectSingleNode("longpush");
                                    bool longpush = Convert.ToBoolean(node.InnerText);

                                    node = buttonNodeList.Item(j).SelectSingleNode("disable");
                                    bool disable = Convert.ToBoolean(node.InnerText);

                                    MaiRButtonView buttonView = new MaiRButtonView();
                                    switch (buttontype)
                                    {
                                    case (int)MaiRControlValue.ButtonType.Type1:
                                        buttonView.Type = MaiRControlValue.ButtonType.Type1;
                                        break;

                                    case (int)MaiRControlValue.ButtonType.Type2:
                                        buttonView.Type = MaiRControlValue.ButtonType.Type2;
                                        break;

                                    case (int)MaiRControlValue.ButtonType.Type3:
                                        buttonView.Type = MaiRControlValue.ButtonType.Type3;
                                        break;
                                    }
                                    buttonView.UpperLabel = upperlabel;
                                    buttonView.InnerLabel = innerlabel;
                                    switch (color)
                                    {
                                    case (int)MaiRControlValue.ButtonColor.Default:
                                        buttonView.Color = MaiRControlValue.ButtonColor.Default;
                                        break;

                                    case (int)MaiRControlValue.ButtonColor.Blue:
                                        buttonView.Color = MaiRControlValue.ButtonColor.Blue;
                                        break;

                                    case (int)MaiRControlValue.ButtonColor.Red:
                                        buttonView.Color = MaiRControlValue.ButtonColor.Red;
                                        break;

                                    case (int)MaiRControlValue.ButtonColor.Green:
                                        buttonView.Color = MaiRControlValue.ButtonColor.Green;
                                        break;

                                    case (int)MaiRControlValue.ButtonColor.Yellow:
                                        buttonView.Color = MaiRControlValue.ButtonColor.Yellow;
                                        break;
                                    }
                                    buttonView.LongPush = longpush;
                                    buttonView.Disable  = disable;
                                    buttonView.Frames   = frameList;

                                    buttonList.Add(buttonView);
                                }
                            }
                            node = panelNodeList.Item(i).SelectSingleNode("title");
                            String title = node.InnerText;
                            node = panelNodeList.Item(i).SelectSingleNode("type");
                            int paneltype = Convert.ToInt32(node.InnerText);
                            switch (paneltype)
                            {
                            case (int)MaiRControlValue.PanelType.Type1:
                                MaiRPanel1View panel1view = new MaiRPanel1View(mainForm);
                                panel1view.Title         = title;
                                panel1view.ButtonItems   = buttonList;
                                panel1view.ValueChanged += handler;
                                panelList.Add(panel1view);
                                break;

                            case (int)MaiRControlValue.PanelType.Type2:
                                MaiRPanel2View panel2view = new MaiRPanel2View(mainForm);
                                panel2view.Title         = title;
                                panel2view.ButtonItems   = buttonList;
                                panel2view.ValueChanged += handler;
                                panelList.Add(panel2view);
                                break;

                            case (int)MaiRControlValue.PanelType.Type3:
                                MaiRPanel3View panel3view = new MaiRPanel3View(mainForm);
                                panel3view.Title         = title;
                                panel3view.ButtonItems   = buttonList;
                                panel3view.ValueChanged += handler;
                                panelList.Add(panel3view);
                                break;

                            case (int)MaiRControlValue.PanelType.Type4:
                                MaiRPanel4View panel4view = new MaiRPanel4View(mainForm);
                                panel4view.Title         = title;
                                panel4view.ButtonItems   = buttonList;
                                panel4view.ValueChanged += handler;
                                panelList.Add(panel4view);
                                break;
                            }
                        }
                        catch
                        {
                        }
                    }
                    data.PanelItems = panelList;
                }
            }
            return(data);
        }
示例#7
0
        private void PropSaveButton_Click(object sender, EventArgs e)
        {
            if (this.formatComboBox.SelectedIndex == 4)
            {
                IRFrameParam defaultParam = IRFrame.GetDefaultParam(IRFrame.FORMAT_OTHER);
                int          leaderHigh   = 0;
                if (Int32.TryParse(this.leaderHighTextBox.Text, out leaderHigh) == false)
                {
                    leaderHigh = defaultParam.LeaderHigh;
                    this.leaderHighTextBox.Text = Convert.ToString(leaderHigh);
                }
                MaiRimokon.Properties.Settings.Default.OtherLeaderHigh = leaderHigh;

                int leaderLow = 0;
                if (Int32.TryParse(this.leaderLowTextBox.Text, out leaderLow) == false)
                {
                    leaderLow = defaultParam.LeaderLow;
                    this.leaderLowTextBox.Text = Convert.ToString(leaderLow);
                }
                MaiRimokon.Properties.Settings.Default.OtherLeaderLow = leaderLow;

                int pulse0High = 0;
                if (Int32.TryParse(this.pulse0HighTextBox.Text, out pulse0High) == false)
                {
                    pulse0High = defaultParam.Pulse0High;
                    this.pulse0HighTextBox.Text = Convert.ToString(pulse0High);
                }
                MaiRimokon.Properties.Settings.Default.OtherPulse0High = pulse0High;

                int pulse0Low = 0;
                if (Int32.TryParse(this.pulse0LowTextBox.Text, out pulse0Low) == false)
                {
                    pulse0Low = defaultParam.Pulse0Low;
                    this.pulse0LowTextBox.Text = Convert.ToString(pulse0Low);
                }
                MaiRimokon.Properties.Settings.Default.OtherPulse0Low = pulse0Low;

                int pulse1High = 0;
                if (Int32.TryParse(this.pulse1HighTextBox.Text, out pulse1High) == false)
                {
                    pulse1High = defaultParam.Pulse1High;
                    this.pulse1HighTextBox.Text = Convert.ToString(pulse1High);
                }
                MaiRimokon.Properties.Settings.Default.OtherPulse1High = pulse1High;

                int pulse1Low = 0;
                if (Int32.TryParse(this.pulse1LowTextBox.Text, out pulse1Low) == false)
                {
                    pulse1Low = defaultParam.Pulse1Low;
                    this.pulse1LowTextBox.Text = Convert.ToString(pulse1Low);
                }
                MaiRimokon.Properties.Settings.Default.OtherPulse1Low = pulse1Low;

                int stopHigh = 0;
                if (Int32.TryParse(this.stopHighTextBox.Text, out stopHigh) == false)
                {
                    stopHigh = defaultParam.StopHigh;
                    this.stopHighTextBox.Text = Convert.ToString(stopHigh);
                }
                MaiRimokon.Properties.Settings.Default.OtherStopHigh = stopHigh;

                int stopLow = 0;
                if (Int32.TryParse(this.stopLowTextBox.Text, out stopLow) == false)
                {
                    stopLow = defaultParam.StopLow;
                    this.stopLowTextBox.Text = Convert.ToString(stopLow);
                }
                MaiRimokon.Properties.Settings.Default.OtherStopLow = stopLow;

                int repeatHigh = 0;
                if (Int32.TryParse(this.repeatHighTextBox.Text, out repeatHigh) == false)
                {
                    repeatHigh = defaultParam.RepeatHigh;
                    this.repeatHighTextBox.Text = Convert.ToString(repeatHigh);
                }
                MaiRimokon.Properties.Settings.Default.OtherRepeatHigh = repeatHigh;

                int repeatLow = 0;
                if (Int32.TryParse(this.repeatLowTextBox.Text, out repeatLow) == false)
                {
                    repeatLow = defaultParam.RepeatLow;
                    this.repeatLowTextBox.Text = Convert.ToString(repeatLow);
                }
                MaiRimokon.Properties.Settings.Default.OtherRepeatLow = repeatLow;

                int frameInterval = 0;
                if (Int32.TryParse(this.frameIntervalTextBox.Text, out frameInterval) == false)
                {
                    frameInterval = defaultParam.FrameInterval;
                    this.frameIntervalTextBox.Text = Convert.ToString(frameInterval);
                }
                MaiRimokon.Properties.Settings.Default.OtherFrameInterval = frameInterval;
                MaiRimokon.Properties.Settings.Default.Save();
                IRFrame.UpdateDefaultParamDic();
            }
        }
示例#8
0
        private void AnalysisButton_Click(object sender, EventArgs e)
        {
            this.analysisButton.Enabled = false;
            if (this.reader == null || this.reader.DataList == null || this.reader.DataList.Count == 0)
            {
                this.messageLabel2.Text     = "データ未取得";
                this.analysisButton.Enabled = true;
                return;
            }
            int format;

            if (this.formatComboBox.SelectedIndex == 0)
            {
                format = IRFrame.FORMAT_NEC;
            }
            else if (this.formatComboBox.SelectedIndex == 1)
            {
                format = IRFrame.FORMAT_SONY;
            }
            else if (this.formatComboBox.SelectedIndex == 2)
            {
                format = IRFrame.FORMAT_DENKYO;
            }
            else if (this.formatComboBox.SelectedIndex == 3)
            {
                format = IRFrame.FORMAT_UNIDEN;
            }
            else if (this.formatComboBox.SelectedIndex == 4)
            {
                format = IRFrame.FORMAT_OTHER;
            }
            else
            {
                format = IRFrame.FORMAT_DENKYO;
            }
            IRFrameParam defaultParam = IRFrame.GetDefaultParam(format);
            int          leaderHigh   = 0;

            if (Int32.TryParse(this.leaderHighTextBox.Text, out leaderHigh) == false)
            {
                leaderHigh = defaultParam.LeaderHigh;
                this.leaderHighTextBox.Text = Convert.ToString(leaderHigh);
            }
            int leaderLow = 0;

            if (Int32.TryParse(this.leaderLowTextBox.Text, out leaderLow) == false)
            {
                leaderLow = defaultParam.LeaderLow;
                this.leaderLowTextBox.Text = Convert.ToString(leaderLow);
            }
            int pulse0High = 0;

            if (Int32.TryParse(this.pulse0HighTextBox.Text, out pulse0High) == false)
            {
                pulse0High = defaultParam.Pulse0High;
                this.pulse0HighTextBox.Text = Convert.ToString(pulse0High);
            }
            int pulse0Low = 0;

            if (Int32.TryParse(this.pulse0LowTextBox.Text, out pulse0Low) == false)
            {
                pulse0Low = defaultParam.Pulse0Low;
                this.pulse0LowTextBox.Text = Convert.ToString(pulse0Low);
            }
            int pulse1High = 0;

            if (Int32.TryParse(this.pulse1HighTextBox.Text, out pulse1High) == false)
            {
                pulse1High = defaultParam.Pulse1High;
                this.pulse1HighTextBox.Text = Convert.ToString(pulse1High);
            }
            int pulse1Low = 0;

            if (Int32.TryParse(this.pulse1LowTextBox.Text, out pulse1Low) == false)
            {
                pulse1Low = defaultParam.Pulse1Low;
                this.pulse1LowTextBox.Text = Convert.ToString(pulse1Low);
            }
            int stopHigh = 0;

            if (Int32.TryParse(this.stopHighTextBox.Text, out stopHigh) == false)
            {
                stopHigh = defaultParam.StopHigh;
                this.stopHighTextBox.Text = Convert.ToString(stopHigh);
            }
            int stopLow = 0;

            if (Int32.TryParse(this.stopLowTextBox.Text, out stopLow) == false)
            {
                stopLow = defaultParam.StopLow;
                this.stopLowTextBox.Text = Convert.ToString(stopLow);
            }
            int repeatHigh = 0;

            if (Int32.TryParse(this.repeatHighTextBox.Text, out repeatHigh) == false)
            {
                repeatHigh = defaultParam.RepeatHigh;
                this.repeatHighTextBox.Text = Convert.ToString(repeatHigh);
            }
            int repeatLow = 0;

            if (Int32.TryParse(this.repeatLowTextBox.Text, out repeatLow) == false)
            {
                repeatLow = defaultParam.RepeatLow;
                this.repeatLowTextBox.Text = Convert.ToString(repeatLow);
            }
            int frameInterval = 0;

            if (Int32.TryParse(this.frameIntervalTextBox.Text, out frameInterval) == false)
            {
                frameInterval = defaultParam.FrameInterval;
                this.frameIntervalTextBox.Text = Convert.ToString(frameInterval);
            }
            IRFrameParam param = new IRFrameParam(defaultParam.CarrierHigh,
                                                  defaultParam.CarrierLow,
                                                  leaderHigh,
                                                  leaderLow,
                                                  defaultParam.Pulse0Modulation,
                                                  pulse0High,
                                                  pulse0Low,
                                                  defaultParam.Pulse1Modulation,
                                                  pulse1High,
                                                  pulse1Low,
                                                  stopHigh,
                                                  stopLow,
                                                  frameInterval,
                                                  repeatHigh,
                                                  repeatLow);

            this.frames = this.reader.GetFrames(format, param);
            if (this.frames == null || this.frames.Count == 0)
            {
                this.messageLabel2.Text = "解析失敗";
                this.framesTextBox.Text = "";
            }
            else
            {
                this.Format             = format;
                this.messageLabel2.Text = "";
                StringBuilder sb = new StringBuilder();
                for (int i = 0; i < this.frames.Count; i++)
                {
                    IRFrame frame = this.frames[i];
                    sb.Append("Frame" + i + ": ");
                    switch (frame.Format)
                    {
                    case IRFrame.FORMAT_NEC:
                        sb.Append("フォーマット=NEC, ");
                        break;

                    case IRFrame.FORMAT_SONY:
                        sb.Append("フォーマット=SONY, ");
                        break;

                    case IRFrame.FORMAT_DENKYO:
                        sb.Append("フォーマット=家電協, ");
                        break;

                    case IRFrame.FORMAT_UNIDEN:
                        sb.Append("フォーマット=ユニデン, ");
                        break;

                    case IRFrame.FORMAT_OTHER:
                        sb.Append("フォーマット=その他, ");
                        break;
                    }
                    sb.Append("リーダHigh=" + frame.FrameParam.LeaderHigh + ", ");
                    sb.Append("リーダLow=" + frame.FrameParam.LeaderLow + ", ");
                    sb.Append("Value=");
                    foreach (byte dat in frame.Value.ValueList)
                    {
                        string hex = Convert.ToString(dat, 16);
                        if (hex.Length < 2)
                        {
                            hex = "0" + hex;
                        }
                        sb.Append(hex);
                    }
                    sb.Append(", ");
                    sb.Append("ValueLen=" + frame.Value.ValueLength + "bit, ");
                    sb.Append("ストップHigh=" + frame.FrameParam.StopHigh + ", ");
                    sb.Append("ストップLow=" + frame.FrameParam.StopLow + ", ");
                    sb.AppendLine("フレーム間隔=" + frame.FrameParam.FrameInterval);
                }
                this.framesTextBox.Text = sb.ToString();
            }
            this.analysisButton.Enabled = true;
        }
示例#9
0
 public IRFrame(int format, IRFrameParam param)
     : this(format, param, (List <PulseData>)null)
 {
 }