Пример #1
0
        public override void CreateUXBase(string formTitle)
        {
            base.CreateUXBase(formTitle);

            // KPI Form
            //tKPIForm = new TheFormInfo(TheThing.GetSafeThingGuid(MyBaseThing, "AzureKPI_ID"), eEngineName.NMIService, "Azure Receiver: KPIs", tDataSource) { IsNotAutoLoading = true };

            //var tFlds = TheNMIEngine.AddStandardForm(MyBaseThing, MyBaseThing.FriendlyName, 18, "AzureKPI_ID");
            //var tKPIForm = tFlds["Form"] as TheFormInfo;
            //(tFlds["DashIcon"] as TheDashPanelInfo).PropertyBag=new ThePropertyBag() { "Visibility=false" };

            TheNMIEngine.AddSmartControl(MyBaseThing, MyForm, eFieldType.CollapsibleGroup, 300, 2, 0, String.Format("Receiver KPIs: {0}", MyBaseThing.FriendlyName), null, new nmiCtrlCollapsibleGroup()
            {
                DoClose = true, ParentFld = 3, TileWidth = 6, IsSmall = true
            });

            TheNMIEngine.AddFields(MyConnectionThingsForm, new List <TheFieldInfo>
            {
                new TheFieldInfo()
                {
                    FldOrder = 13, DataItem = "EventFormat", Flags = 2, Type = eFieldType.ComboBox, Header = "Data Serializer", FldWidth = 3, PropertyBag = new ThePropertyBag()
                    {
                        "Options=" + TheEventConverters.GetDisplayNamesAsSemicolonSeperatedList()
                    }
                },
            });


            TheNMIEngine.AddSmartControl(MyBaseThing, MyForm, eFieldType.Number, 308, 0, 0, "Events Received", nameof(ReceiveCount), new ThePropertyBag()
            {
                "ParentFld=300", "TileHeight=1", "TileWidth=6", "FldWidth=4"
            });
            TheNMIEngine.AddSmartControl(MyBaseThing, MyForm, eFieldType.DateTime, 309, 0, 0, "Last Receive", nameof(LastReceiveTime), new ThePropertyBag()
            {
                "ParentFld=300", "TileHeight=1", "TileWidth=6", "FldWidth=4"
            });
            TheNMIEngine.AddSmartControl(MyBaseThing, MyForm, eFieldType.Number, 310, 0, 0, "Receive Errors", nameof(ReceiveErrorCount), new ThePropertyBag()
            {
                "ParentFld=300", "TileHeight=1", "TileWidth=6", "FldWidth=4"
            });

            // Add link to KPIs to AzureConnection form
            //TheNMIEngine.AddSmartControl(MyBaseThing, MyForm , eFieldType.TileButton, 12, 2, 0xF0, "Show KPIs", null, new nmiCtrlTileButton() { ParentFld=3, NoTE=true, OnClick=$"TTS:{tKPIForm.cdeMID}", ClassName="cdeTransitButton"  });
        }
Пример #2
0
        public override bool CreateUX()
        {
            if (mIsUXInitCalled)
            {
                return(false);
            }
            mIsUXInitCalled = true;

            base.CreateUXBase("Mesh Receiver");
            if (MyForm != null)
            {
                MyForm.DeleteByOrder(11);
                MyForm.DeleteByOrder(24); //Removes the ADDRES Field from the Form
                //TheNMIEngine.AddSmartControl(MyBaseThing, MyForm, eFieldType.CollapsibleGroup, 40, 2, 0xC0, "Advanced Configurations...", null, ThePropertyBag.Create(new nmiCtrlCollapsibleGroup() { DoClose = true }));//() { "TileWidth=6", "Format=Advanced Configurations", "Style=font-size:26px;text-align: left" });
                //TheNMIEngine.AddSmartControl(MyBaseThing, MyForm, eFieldType.Password, 41, 7, 0xC0, "Connection String", TheAzureConnectionHelper.strConnectionString, new ThePropertyBag() { "ParentFld=40", "TileWidth=6", "TileHeight=1", "HideMTL=true" });
                //TheNMIEngine.AddSmartControl(MyBaseThing, MyForm, eFieldType.SingleEnded, 42, 7, 0xC0, "Event Hub Name", TheAzureConnectionHelper.strEventHubName, new ThePropertyBag() { "ParentFld=40", "TileWidth=6", "TileHeight=1" });
                //TheNMIEngine.AddSmartControl(MyBaseThing, MyForm, eFieldType.SingleEnded, 43, 0, 0xC0, "Event Hub Address:", "Address", new ThePropertyBag() { "ParentFld=40", "TileHeight=1", "TileWidth=6" });
                //TheNMIEngine.AddSmartControl(MyBaseThing, MyForm, eFieldType.SingleEnded, 44, 7, 0xC0, "Consumer Group", strConsumerGroup, new ThePropertyBag() { "ParentFld=40", "TileWidth=6", "TileHeight=1" });
                //TheNMIEngine.AddSmartControl(MyBaseThing, MyForm, eFieldType.Password, 45, 7, 0xC0, "Storage Connection String (Checkpoints)", strStorageConnectionString, new ThePropertyBag() { "ParentFld=40", "TileWidth=6", "TileHeight=1", "HideMTL=true" });
                //TheNMIEngine.AddSmartControl(MyBaseThing, tMyForm, eFieldType.SingleCheck, 46, 3, 0xC0, "Preserve Order for all Things", "PreserveSendOrderAllThings", new ThePropertyBag() { "TileWidth=6", "TileHeight=1" });

                TheNMIEngine.AddSmartControl(MyBaseThing, MyForm, eFieldType.ComboBox, 24, 2, 0xC0, "Receiver Event Converter", nameof(ReceiverEventConverter), new nmiCtrlComboBox {
                    ParentFld = 20, DefaultValue = TheEventConverters.GetDisplayName(typeof(JSonObjectEventConverter)), Options = TheEventConverters.GetDisplayNamesAsSemicolonSeperatedList()
                });
                TheNMIEngine.AddSmartControl(MyBaseThing, MyForm, eFieldType.SingleEnded, 30, 2, 0xC0, "Property for Sender Time:", nameof(SenderTimePropertyName), new ThePropertyBag()
                {
                    "ParentFld=20", "TileHeight=1", "TileWidth=6"
                });
                TheNMIEngine.AddSmartControl(MyBaseThing, MyForm, eFieldType.SingleEnded, 40, 2, 0xC0, "Property for Time Drift:", nameof(TimeDriftPropertyName), new ThePropertyBag()
                {
                    "ParentFld=20", "TileHeight=1", "TileWidth=6"
                });
#if CDEPUBSUB
                TheNMIEngine.AddSmartControl(MyBaseThing, MyForm, eFieldType.SingleEnded, 45, 2, 0xC0, "PubSub Topic", nameof(PubSubTopic), new ThePropertyBag()
                {
                    "ParentFld=20", "TileHeight=1", "TileWidth=6"
                });
#endif
                //TheNMIEngine.AddSmartControl(MyBaseThing, MyForm, eFieldType.Number, 310, 0, 0, "Last Received", nameof(LastReceiveTime), new ThePropertyBag() { "ParentFld=300", "TileHeight=1", "TileWidth=6", "FldWidth=4" });

                mIsUXInitialized = true;
                return(true);
            }
            return(false);
        }