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); }
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); }
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); }
public bool GetSelected(out WatchEntry entry) { entry = null; if (watchOut.SelectedRows.Count == 0) { return(false); } entry = addressWatchList[watchOut.SelectedRows[0].Index]; return(entry.addressAvail); }
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); }
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); }
public bool GetSelected(out WatchEntry entry) { entry = null; if (watchOut.SelectedRows.Count == 0) return false; entry = addressWatchList[watchOut.SelectedRows[0].Index]; return entry.addressAvail; }
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; }