예제 #1
0
        private void editSymbolPropertiesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // get the currently selected symbol
            object o = gridView4.GetFocusedRow();
            if (o != null)
            {
                if (o is DataRowView)
                {
                    DataRowView dr = (DataRowView)o;
                    frmRealtimeSymbolSelect symsel = new frmRealtimeSymbolSelect();
                    symsel.SetCollection(m_RealtimeSymbolCollection);
                    symsel.SetCorrectionFactor(GetCorrectionFactor(dr["SYMBOLNAME"].ToString()));
                    symsel.SetCorrectionOffset(GetCorrectionOffset(dr["SYMBOLNAME"].ToString()));
                    symsel.SetSelectedSymbol(dr["SYMBOLNAME"].ToString());
                    if (symsel.ShowDialog() == DialogResult.OK)
                    {
                        // first remove it from the list
                        CastRemoveFromListEvent(dr.Row["SYMBOLNAME"].ToString());
                        // now alter the symbols properties
                        CastAddToListEvent(symsel.GetSelectedSymbol(), symsel.GetSelectedCorrectionFactor(), symsel.GetSelectedCorrectionOffset(), true);

                    }

                }

            }
        }
예제 #2
0
        private void addSymbolToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // show a list of symbols that the user can add (only 1 and 2 byte values in where SRAM address > 0)
            if (m_RealtimeSymbolCollection != null)
            {
                // show the selection screen with a lookupedit control
                // if ok, cast an event to have it added to the realtime list
                frmRealtimeSymbolSelect symsel = new frmRealtimeSymbolSelect();
                symsel.SetCollection(m_RealtimeSymbolCollection);
                if (symsel.ShowDialog() == DialogResult.OK)
                {
                    //<GS-27072010> todo: add code to save user data here!
                    // cast event
                    CastAddToListEvent(symsel.GetSelectedSymbol(), symsel.GetSelectedCorrectionFactor(), symsel.GetSelectedCorrectionOffset(), true);
                    // and add it to the list directly (don't wait for the symbol to be present in the data stream)
                    AddSymbolToDataTable(symsel.GetSelectedSymbol(), GetSymbolLength(symsel.GetSelectedSymbol()));

                }
            }
        }