Exemple #1
0
        public GXGraphItemForm(GXGraphItemCollection items, List <GXKeyValuePair <GXDLMSObject, GXDLMSCaptureObject> > columns, GXDLMSDevice device)
        {
            InitializeComponent();
            GraphItemEditor_SizeChanged(null, null);
            GraphItemList.OwnerDraw = true;
            Items = items;
            int            pos    = 0;
            List <string>  colors = GetColors();
            GXManufacturer man    = device.Manufacturers.FindByIdentification(device.Manufacturer);

            foreach (var it in columns)
            {
                GXDLMSObject obj   = it.Key;
                int          index = it.Value.AttributeIndex;
                if (!GXHelpers.IsNumeric(obj.GetDataType(index)) || (index > 0 && ((index & 0x8) != 0 || (index & 0x10) != 0)))
                {
                    continue;
                }
                GXGraphItem item = items.Find(obj.LogicalName, index);
                if (item == null)
                {
                    item                = new GXGraphItem();
                    item.LogicalName    = obj.LogicalName;
                    item.Color          = Color.FromName(colors[pos++]);
                    item.AttributeIndex = index;
                    items.Add(item);
                }
                string     desc = obj.Description;
                GXObisCode code = man.ObisCodes.FindByLN(obj.ObjectType, obj.LogicalName, null);
                if (code != null)
                {
                    desc = code.Description;
                }
                ListViewItem tmp = GraphItemList.Items.Add(obj.LogicalName + " " + desc);
                tmp.Tag = item;
            }
        }
Exemple #2
0
 public GXObisCodeGraphItem()
 {
     GraphItems = new GXGraphItemCollection();
 }