コード例 #1
0
        public bool EditWatchDialog(WatchEntry entry)
        {
            DialogResult dr;

            this.inputAddress.Text = WatchList.addressToString(entry.address);
            this.inputName.Text    = entry.name;
            switch (entry.dataSize)
            {
            case WatchDataSize.Bit8:
                this.DType.SelectedIndex = 0;
                break;

            case WatchDataSize.Bit16:
                this.DType.SelectedIndex = 1;
                break;

            case WatchDataSize.SingleFp:
                this.DType.SelectedIndex = 3;
                break;

            default:
                this.DType.SelectedIndex = 2;
                break;
            }

            dr = this.ShowDialog();
            return(dr == DialogResult.OK);
        }
コード例 #2
0
ファイル: WatchDialog.cs プロジェクト: PokeAcer549/geckowii
        public bool EditWatchDialog(WatchEntry entry)
        {
            DialogResult dr;

            this.inputAddress.Text = WatchList.addressToString(entry.address);
            this.inputName.Text = entry.name;
            switch (entry.dataSize)
            {
                case WatchDataSize.Bit8:
                    this.DType.SelectedIndex = 0;
                    break;
                case WatchDataSize.Bit16:
                    this.DType.SelectedIndex = 1;
                    break;
                case WatchDataSize.SingleFp:
                    this.DType.SelectedIndex = 3;
                    break;
                default:
                    this.DType.SelectedIndex = 2;
                    break;
            }
            
            dr = this.ShowDialog();
            return (dr == DialogResult.OK);
        }
コード例 #3
0
        private string ParseValue(uint peekValue, WatchDataSize dataSize, uint add, WatchEntry entry)
        {
            string pOutput = string.Empty;
            uint   val;
            float  floatV;

            switch (dataSize)
            {
            case WatchDataSize.Bit8:
                switch (add)
                {
                case 0:
                    val = ((peekValue & 0xFF000000) >> 24);
                    break;

                case 1:
                    val = ((peekValue & 0x00FF0000) >> 16);
                    break;

                case 2:
                    val = ((peekValue & 0x0000FF00) >> 8);
                    break;

                default:
                    val = ((peekValue & 0x000000FF) >> 0);
                    break;
                }
                entry.lastValue = val;
                pOutput         = GlobalFunctions.toHex(val, 2);
                break;

            case WatchDataSize.Bit16:
                switch (add)
                {
                case 0:
                    val = ((peekValue & 0xFFFF0000) >> 16);
                    break;

                default:
                    val = ((peekValue & 0x0000FFFF) >> 0);
                    break;
                }
                entry.lastValue = val;
                pOutput         = GlobalFunctions.toHex(val, 4);
                break;

            case WatchDataSize.Bit32:
                entry.lastValue = peekValue;
                pOutput         = GlobalFunctions.toHex(peekValue);
                break;

            default:
                entry.lastValue = peekValue;
                floatV          = GlobalFunctions.UIntToSingle(peekValue);
                pOutput         = floatV.ToString("G6");
                break;
            }
            return(pOutput);
        }
コード例 #4
0
 public bool GetSelected(out WatchEntry entry)
 {
     entry = null;
     if (watchOut.SelectedRows.Count == 0)
     {
         return(false);
     }
     entry = addressWatchList[watchOut.SelectedRows[0].Index];
     return(entry.addressAvail);
 }
コード例 #5
0
        public void UpdateEntry(String name, UInt32[] address, WatchDataSize dataSize)
        {
            if (watchOut.SelectedRows.Count == 0)
            {
                return;
            }

            int index = watchOut.SelectedRows[0].Index;

            String dType;

            switch (dataSize)
            {
            case WatchDataSize.Bit8:
                dType = "8 bit";
                break;

            case WatchDataSize.Bit16:
                dType = "16 bit";
                break;

            case WatchDataSize.Bit32:
                dType = "32 bit";
                break;

            default:
                dType = "Single";
                break;
            }

            watchOut.Rows[index].Cells[0].Value = name;
            watchOut.Rows[index].Cells[1].Value = "????????";
            watchOut.Rows[index].Cells[2].Value = dType;
            watchOut.Rows[index].Cells[3].Value = "????????";

            addressWatchList[index] = new WatchEntry(name, address, dataSize);
        }
コード例 #6
0
ファイル: watchlist.cs プロジェクト: PokeAcer549/geckowii
        public void UpdateEntry(String name, UInt32[] address, WatchDataSize dataSize)
        {
            if (watchOut.SelectedRows.Count == 0)
                return;

            int index = watchOut.SelectedRows[0].Index;
            
            String dType;
            switch (dataSize)
            {
                case WatchDataSize.Bit8:
                    dType = "8 bit";
                    break;
                case WatchDataSize.Bit16:
                    dType = "16 bit";
                    break;
                case WatchDataSize.Bit32:
                    dType = "32 bit";
                    break;
                default:
                    dType = "Single";
                    break;
            }

            watchOut.Rows[index].Cells[0].Value = name;
            watchOut.Rows[index].Cells[1].Value = "????????";
            watchOut.Rows[index].Cells[2].Value = dType;
            watchOut.Rows[index].Cells[3].Value = "????????";

            addressWatchList[index] = new WatchEntry(name, address, dataSize);
        }
コード例 #7
0
ファイル: watchlist.cs プロジェクト: PokeAcer549/geckowii
 public bool GetSelected(out WatchEntry entry)
 {
     entry = null;
     if (watchOut.SelectedRows.Count == 0)
         return false;
     entry = addressWatchList[watchOut.SelectedRows[0].Index];
     return entry.addressAvail;
 }
コード例 #8
0
ファイル: watchlist.cs プロジェクト: PokeAcer549/geckowii
 private String ParseValue(UInt32 peekValue,WatchDataSize dataSize, UInt32 add, WatchEntry entry)
 {
     String pOutput="";
     UInt32 val;
     Single floatV;
     switch (dataSize)
     {
         case WatchDataSize.Bit8:
             switch (add)
             {
                  case 0: val = ((UInt32)(peekValue & 0xFF000000) >> 24);
                     break;
                  case 1: val = ((UInt32)(peekValue & 0x00FF0000) >> 16);
                     break;
                  case 2: val = ((UInt32)(peekValue & 0x0000FF00) >> 8);
                     break;
                 default: val = ((UInt32)(peekValue & 0x000000FF) >> 0);
                     break;
             }
             entry.lastValue = val;
             pOutput = GlobalFunctions.toHex(val, 2);
             break;
         case WatchDataSize.Bit16:
             switch (add)
             {
                 case 0: val = ((UInt32)(peekValue & 0xFFFF0000) >> 16);
                     break;
                 default: val = ((UInt32)(peekValue & 0x0000FFFF) >> 0);
                     break;                        
             }
             entry.lastValue = val;
             pOutput = GlobalFunctions.toHex(val, 4);
             break;
         case WatchDataSize.Bit32:
             entry.lastValue = peekValue;
             pOutput = GlobalFunctions.toHex(peekValue);
             break;
         default:
             entry.lastValue = peekValue;
             floatV = GlobalFunctions.UIntToSingle(peekValue);
             pOutput = floatV.ToString("G6");
             break;
     }
     return pOutput;
 }