Exemplo n.º 1
0
            public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
            {
                if (destType == typeof(string) && value is RealtimeSymbolHelper)
                {
                    // Cast the value to an Employee type
                    RealtimeSymbolHelper pp = (RealtimeSymbolHelper)value;

                    return(pp.Varname + ", " + pp.Start_address + ", " + pp.Length);
                }
                return(base.ConvertTo(context, culture, value, destType));
            }
Exemplo n.º 2
0
 public void Remove(RealtimeSymbolHelper value)
 {
     List.Remove(value);
 }
Exemplo n.º 3
0
 public bool Contains(RealtimeSymbolHelper value)
 {
     // If value is not of type Int16, this will return false.
     return(List.Contains(value));
 }
Exemplo n.º 4
0
 public int IndexOf(RealtimeSymbolHelper value)
 {
     return(List.IndexOf(value));
 }
Exemplo n.º 5
0
 public void Insert(int index, RealtimeSymbolHelper value)
 {
     List.Insert(index, value);
 }
Exemplo n.º 6
0
 public bool Contains(RealtimeSymbolHelper value)
 {
     // If value is not of type Int16, this will return false.
     return (List.Contains(value));
 }
Exemplo n.º 7
0
 public int Add(RealtimeSymbolHelper value)
 {
     return(List.Add(value));
 }
Exemplo n.º 8
0
 public int Add(RealtimeSymbolHelper value)
 {
     return (List.Add(value));
 }
Exemplo n.º 9
0
 public void Remove(RealtimeSymbolHelper value)
 {
     List.Remove(value);
 }
Exemplo n.º 10
0
 public void Insert(int index, RealtimeSymbolHelper value)
 {
     List.Insert(index, value);
 }
Exemplo n.º 11
0
 public int IndexOf(RealtimeSymbolHelper value)
 {
     return (List.IndexOf(value));
 }
Exemplo n.º 12
0
        private Color GetGraphColor(string symbolname)
        {
            Color retval = Color.White;
            if (_colorCollection.Count == 0)
            {
                RegistryKey SoftwareKey = Registry.CurrentUser.CreateSubKey("Software");
                RegistryKey ManufacturerKey = SoftwareKey.CreateSubKey("MattiasC");
                RegistryKey SuiteKey = ManufacturerKey.CreateSubKey("T7SuitePro");
                using (RegistryKey Settings = SuiteKey.CreateSubKey("SymbolColors"))
                {
                    if (Settings != null)
                    {
                        string[] vals = Settings.GetValueNames();
                        foreach (string a in vals)
                        {
                            try
                            {
                                // a = symbolname

                                RealtimeSymbolHelper ch = new RealtimeSymbolHelper();
                                ch.Color = ColorTranslator.FromWin32(Convert.ToInt32(Settings.GetValue(a)));
                                ch.Varname = a;
                                _colorCollection.Add(ch);
                            }
                            catch (Exception E)
                            {
                                Console.WriteLine("error retrieving registry settings: " + E.Message);
                            }

                        }
                    }
                }
            }

            foreach (RealtimeSymbolHelper ch in _colorCollection)
            {
                if (ch.Varname == symbolname)
                {
                    return ch.Color;
                }
            }
            // load graphcolors into table and lookup from there

            /*symbolname = symbolname.ToUpper();
            if (symbolname == "In.v_Vehicle") retval = Color.LightGreen;
            else if (symbolname == "In.p_AirInlet") retval = Color.Red;
            else if (symbolname == "P_MANIFOLD10") retval = Color.Red;
            else if (symbolname == "ActualIn.T_AirInlet") retval = Color.LightBlue;
            else if (symbolname == "ActualIn.T_Engine") retval = Color.LightGray;
            else if (symbolname == "AD_SOND") retval = Color.Yellow;
            else if (symbolname == "AD_EGR") retval = Color.GreenYellow;
            else if (symbolname == "ActualIn.n_Engine") retval = Color.Gold;
            else if (symbolname == "INSPTID_MS10") retval = Color.Firebrick;
            else if (symbolname == "GEAR") retval = Color.Purple;
            else if (symbolname == "APC_DECRESE") retval = Color.LightPink;
            else if (symbolname == "Out.fi_Ignition") retval = Color.LightSeaGreen;
            else if (symbolname == "P_FAK") retval = Color.LightYellow;
            else if (symbolname == "I_FAK") retval = Color.LightSteelBlue;
            else if (symbolname == "D_FAK") retval = Color.AntiqueWhite;
            else if (symbolname == "REGL_TRYCK") retval = Color.RosyBrown;
            else if (symbolname == "MAX_TRYCK") retval = Color.Pink;
            else if (symbolname == "Out.PWM_BoostCntrl") retval = Color.PaleGreen;
            else if (symbolname == "REG_KON_APC") retval = Color.PapayaWhip;
            else if (symbolname == "MEDELTROT") retval = Color.SpringGreen;
            else if (symbolname == "TORT_MIN") retval = Color.Silver;
            else if (symbolname == "KNOCK_MAP_OFFSET") retval = Color.DarkTurquoise;
            else if (symbolname == "KNOCK_OFFSETT1234") retval = Color.Aqua;
            else if (symbolname == "KNOCK_AVERAGE") retval = Color.Orange;
            else if (symbolname == "KNOCK_AVERAGE_LIMIT") retval = Color.OliveDrab;
            else if (symbolname == "KNOCK_LEVEL") retval = Color.OrangeRed;
            else if (symbolname == "KNOCK_MAP_LIM") retval = Color.Navy;
            else if (symbolname == "KNOCK_LIM") retval = Color.Moccasin;
            else if (symbolname == "KNOCK_REF_LEVEL") retval = Color.SeaShell;
            else if (symbolname == "LKNOCK_OREF_LEVEL") retval = Color.MistyRose;
            else if (symbolname == "SPIK_COUNT") retval = Color.Brown;
            else if (symbolname == "KNOCK_DIAG_LEVEL") retval = Color.Chartreuse;// (groter maken)
            else if (symbolname == "KNOCK_ANG_DEC!") retval = Color.DarkGoldenrod;*/
            return retval;
        }