Gurux.DLMS.UI.Net-master1216

所属分类:其他行业
开发工具:C#
文件大小:219KB
下载次数:7
上传日期:2017-04-06 17:47:01
上 传 者tpsxr
说明:  DLMS协议通迅,采用分布式设计,界面使用库的形式进行,方便操作
(DLMS agreement newsletter, USES the distributed design, interface using a library form, convenient operation)

文件列表:
LICENSE (18046, 2016-12-15)
development (0, 2016-12-15)
development\GXDLMSActionScheduleView.Designer.cs (10823, 2016-12-15)
development\GXDLMSActionScheduleView.cs (3607, 2016-12-15)
development\GXDLMSActionScheduleView.resx (6672, 2016-12-15)
development\GXDLMSActivityCalendarView.Designer.cs (28715, 2016-12-15)
development\GXDLMSActivityCalendarView.cs (8504, 2016-12-15)
development\GXDLMSActivityCalendarView.resx (6672, 2016-12-15)
development\GXDLMSAssociationLogicalNameView.Designer.cs (9503, 2016-12-15)
development\GXDLMSAssociationLogicalNameView.cs (4829, 2016-12-15)
development\GXDLMSAssociationLogicalNameView.resx (6672, 2016-12-15)
development\GXDLMSAssociationShortNameView.Designer.cs (7741, 2016-12-15)
development\GXDLMSAssociationShortNameView.cs (6029, 2016-12-15)
development\GXDLMSAssociationShortNameView.resx (6672, 2016-12-15)
development\GXDLMSAutoAnswerView.Designer.cs (14746, 2016-12-15)
development\GXDLMSAutoAnswerView.cs (4067, 2016-12-15)
development\GXDLMSAutoAnswerView.resx (6672, 2016-12-15)
development\GXDLMSAutoConnectView.Designer.cs (12965, 2016-12-15)
development\GXDLMSAutoConnectView.cs (3460, 2016-12-15)
development\GXDLMSAutoConnectView.resx (6672, 2016-12-15)
development\GXDLMSClockView.Designer.cs (14863, 2016-12-15)
development\GXDLMSClockView.cs (5850, 2016-12-15)
development\GXDLMSClockView.resx (6672, 2016-12-15)
development\GXDLMSDataView.Designer.cs (7258, 2016-12-15)
development\GXDLMSDataView.cs (3294, 2016-12-15)
development\GXDLMSDataView.resx (6672, 2016-12-15)
development\GXDLMSDemandRegisterView.Designer.cs (16579, 2016-12-15)
development\GXDLMSDemandRegisterView.cs (4223, 2016-12-15)
development\GXDLMSDemandRegisterView.resx (6672, 2016-12-15)
development\GXDLMSDisconnectControlView.Designer.cs (10314, 2016-12-15)
development\GXDLMSDisconnectControlView.cs (3282, 2016-12-15)
development\GXDLMSDisconnectControlView.resx (6672, 2016-12-15)
development\GXDLMSExtendedRegisterView.Designer.cs (10983, 2016-12-15)
development\GXDLMSExtendedRegisterView.cs (3745, 2016-12-15)
development\GXDLMSExtendedRegisterView.resx (6672, 2016-12-15)
development\GXDLMSGprsSetupView.Designer.cs (19214, 2016-12-15)
development\GXDLMSGprsSetupView.cs (4106, 2016-12-15)
... ...

See An [Gurux](http://www.gurux.org/ "Gurux") for an overview. Join the Gurux Community or follow [@Gurux](https://twitter.com/guruxorg "@Gurux") for project updates. Gurux.DLMS library is a high-performance .NET component that helps you to read you DLMS/COSEM compatible electricity, gas or water meters. We have try to make component so easy to use that you do not need understand protocol at all. For more info check out [Gurux.DLMS](http://www.gurux.fi/index.php?q=Gurux.DLMS "Gurux.DLMS"). Gurux.DLMS.UI =========================== Purpose of Gurux.DLMS.UI is help to create user interface for DLMS applications. First you need to create Panel where UI is shown. In this example we name it as UIPanel. You can create DLMS views at the run time, but usually it's better to create them all and update panel when user selects next COSEM object. You can create all UI objects like this. ```csharp //All UI objects are save on views dictionary. Dictionary views = new Dictionary(); foreach (Type type in typeof(GXDLMSDataView).Assembly.GetTypes()) { GXDLMSViewAttribute[] att = (GXDLMSViewAttribute[])type.GetCustomAttributes(typeof(GXDLMSViewAttribute), true); if (!type.IsInterface && typeof(IGXDLMSView).IsAssignableFrom(type)) { IGXDLMSView view = Activator.CreateInstance(type) as IGXDLMSView; Form f = view as Form; f.TopLevel = false; f.TopMost = false; f.FormBorderStyle = FormBorderStyle.None; f.Dock = DockStyle.Fill; f.Width = UIPanel.Width; f.Height = UIPanel.Height; views.Add(att[0].DLMSType, view); } } ``` When we want to show UI for selected COSEM object we can do it like this: ```csharp //Clear old view. foreach (Control it in UIPanel.Controls) { it.Hide(); } UIPanel.Controls.Clear(); //Select new COSEM object. In this example we select clock. GXDLMSClock clock = new GXDLMSClock(); IGXDLMSView selectedView = views[clock]; selectedView.Target = clock; GXDlmsUi.UpdateProperties(clock, selectedView); //Add DLMS COSEM view to UI panel. UIPanel.Controls.Add((Form)selectedView); Show UI. ((Form)selectedView).Show(); ```

近期下载者

相关文件


收藏者