Exemplo n.º 1
0
 private void btnAddSymbol_Click(object sender, EventArgs e)
 {
     // add a user defined symbol
     frmEditRealtimeSymbol frmeditsymbol = new frmEditRealtimeSymbol();
     frmeditsymbol.Symbols = m_symbols;
     if (frmeditsymbol.ShowDialog() == DialogResult.OK)
     {
         AddSymbolToRealTimeList(frmeditsymbol.Varname, frmeditsymbol.Symbolnumber, frmeditsymbol.MinimumValue, frmeditsymbol.MaximumValue, frmeditsymbol.OffsetValue, frmeditsymbol.CorrectionValue, frmeditsymbol.Description, (uint)GetSymbolAddressSRAM(m_symbols, frmeditsymbol.Varname), true);
     }
 }
Exemplo n.º 2
0
        private void EditSelectedSymbol()
        {
            //TODO: edit symbol parameters
            int[] selrows = ViewRealtime.GetSelectedRows();
            if (selrows.Length == 1)
            {
                DataRow dr = ViewRealtime.GetDataRow(Convert.ToInt32(selrows.GetValue(0)));
                frmEditRealtimeSymbol frmeditsymbol = new frmEditRealtimeSymbol();
                frmeditsymbol.Symbols = m_symbols;
                frmeditsymbol.Symbolname = dr["SymbolName"].ToString();
                frmeditsymbol.Varname = dr["SymbolName"].ToString();
                frmeditsymbol.Description = dr["Description"].ToString();
                frmeditsymbol.MinimumValue = Convert.ToDouble(dr["Minimum"]);
                frmeditsymbol.MaximumValue = Convert.ToDouble(dr["Maximum"]);
                frmeditsymbol.OffsetValue = Convert.ToDouble(dr["Offset"]);
                frmeditsymbol.CorrectionValue = Convert.ToDouble(dr["Correction"]);

                if (frmeditsymbol.ShowDialog() == DialogResult.OK)
                {
                    // UPDATE the edited symbol
                    AddSymbolToRealTimeList(frmeditsymbol.Varname, frmeditsymbol.Symbolnumber, frmeditsymbol.MinimumValue, frmeditsymbol.MaximumValue, frmeditsymbol.OffsetValue, frmeditsymbol.CorrectionValue, frmeditsymbol.Description, (uint)GetSymbolAddressSRAM(m_symbols, frmeditsymbol.Varname), true);
                }
            }
        }
Exemplo n.º 3
0
        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            try
            {
                int[] records = ViewRealtime.GetSelectedRows();
                if (records.Length == 1)
                {
                    DataRowView drv = (DataRowView)ViewRealtime.GetRow((int)records.GetValue(0));
                    frmEditRealtimeSymbol frmeditsymbol = new frmEditRealtimeSymbol();
                    frmeditsymbol.Symbols = m_symbols;
                    frmeditsymbol.Symbolname = drv.Row["SymbolName"].ToString();
                    frmeditsymbol.MinimumValue = Convert.ToDouble(drv.Row["Minimum"]);
                    frmeditsymbol.MaximumValue = Convert.ToDouble(drv.Row["Maximum"]);
                    frmeditsymbol.Description = drv.Row["Description"].ToString();
                    frmeditsymbol.OffsetValue = Convert.ToDouble(drv.Row["Offset"]);
                    frmeditsymbol.CorrectionValue = Convert.ToDouble(drv.Row["Correction"]);
                    if (frmeditsymbol.ShowDialog() == DialogResult.OK)
                    {
                        drv.Row["SymbolName"] = frmeditsymbol.Symbolname;
                        drv.Row["Minimum"] = frmeditsymbol.MinimumValue;
                        drv.Row["Maximum"] = frmeditsymbol.MaximumValue;
                        drv.Row["Description"] = frmeditsymbol.Description;
                        drv.Row["Offset"] = frmeditsymbol.OffsetValue;
                        drv.Row["Correction"] = frmeditsymbol.CorrectionValue;
                    }

                }
            }
            catch (Exception E)
            {
                logger.Debug(E.Message);
            }
        }