Example #1
0
        private async Task LoadAsync(Guid?id = null)
        {
            SpaceList = new List <Space>();
            SpaceList.Add(new Space()
            {
                Id = Guid.Empty, Name = "None"
            });
            SpaceList.AddRange(await DigitalTwinsHelper.GetSpacesAsync(_cache, Loggers.SilentLogger));

            //SpaceList = await DigitalTwinsHelper.GetSpacesAsync(_cache, Loggers.SilentLogger);

            SpaceTypeList = await DigitalTwinsHelper.GetTypesAsync(Models.Types.SpaceType, _cache, Loggers.SilentLogger, onlyEnabled : true);

            SpaceSubTypeList = await DigitalTwinsHelper.GetTypesAsync(Models.Types.SpaceSubtype, _cache, Loggers.SilentLogger, onlyEnabled : true);

            SpaceStatusList = await DigitalTwinsHelper.GetTypesAsync(Models.Types.SpaceStatus, _cache, Loggers.SilentLogger, onlyEnabled : true);

            if (id != null)
            {
                this.SelectedSpaceItem = await DigitalTwinsHelper.GetSpaceAsync((Guid)id, _cache, Loggers.SilentLogger, false);

                this.UDFList = await DigitalTwinsHelper.GetUDFsBySpaceIdAsync((Guid)id, _cache, Loggers.SilentLogger, false);

                this.Blobs = await DigitalTwinsHelper.GetBlobsAsync((Guid)id, _cache, Loggers.SilentLogger, true);

                this.AvailableProperties = await DigitalTwinsHelper.GetPropertyKeysForSpace((Guid)id, _cache, Loggers.SilentLogger);
            }
            else
            {
                this.SelectedSpaceItem   = new Space();
                this.UDFList             = new List <UserDefinedFunction>();
                this.Blobs               = new List <BlobContent>();
                this.AvailableProperties = new List <PropertyKey>();
            }
        }
Example #2
0
 private async Task LoadAsync()
 {
     SpaceTypeList = new List <Models.Type>();
     SpaceTypeList.Add(new Models.Type()
     {
         Name = "All"
     });
     SpaceTypeList.AddRange(await DigitalTwinsHelper.GetTypesAsync(Models.Types.SpaceType, _cache, Loggers.SilentLogger, onlyEnabled: true));
 }
        private async Task LoadAsync()
        {
            SpaceList = await DigitalTwinsHelper.GetSpacesAsync(_cache, Loggers.SilentLogger);

            DataTypeList = await DigitalTwinsHelper.GetTypesAsync(Models.Types.SensorDataType, _cache, Loggers.SilentLogger, onlyEnabled : true);

            DataUnitTypeList = await DigitalTwinsHelper.GetTypesAsync(Models.Types.SensorDataUnitType, _cache, Loggers.SilentLogger, onlyEnabled : true);

            DataSubTypeList = await DigitalTwinsHelper.GetTypesAsync(Models.Types.SensorDataSubtype, _cache, Loggers.SilentLogger, onlyEnabled : true);
        }
Example #4
0
        private async Task LoadAsync(Guid?id = null)
        {
            SpaceList = await DigitalTwinsHelper.GetSpacesAsync(_cache, Loggers.SilentLogger);

            DeviceTypeList = await DigitalTwinsHelper.GetTypesAsync(Models.Types.DeviceType, _cache, Loggers.SilentLogger, onlyEnabled : true);

            DeviceSubTypeList = await DigitalTwinsHelper.GetTypesAsync(Models.Types.DeviceSubtype, _cache, Loggers.SilentLogger, onlyEnabled : true);

            if (id != null)
            {
                this.SelectedDeviceItem = await DigitalTwinsHelper.GetDeviceAsync((Guid)id, _cache, Loggers.SilentLogger, false);
            }
        }
Example #5
0
        private async Task LoadAsync(Guid?id = null)
        {
            switch (_parentType)
            {
            case ParentType.Space:
            {
                BlobContentTypeList = await DigitalTwinsHelper.GetTypesAsync(
                    Models.Types.SpaceBlobType, _cache, Loggers.SilentLogger, onlyEnabled : true);

                BlobContentSubTypeList = await DigitalTwinsHelper.GetTypesAsync(
                    Models.Types.SpaceBlobSubtype, _cache, Loggers.SilentLogger, onlyEnabled : true);

                break;
            }

            case ParentType.Device:
            {
                BlobContentTypeList = await DigitalTwinsHelper.GetTypesAsync(
                    Models.Types.DeviceBlobType, _cache, Loggers.SilentLogger, onlyEnabled : true);

                BlobContentSubTypeList = await DigitalTwinsHelper.GetTypesAsync(
                    Models.Types.DeviceBlobSubtype, _cache, Loggers.SilentLogger, onlyEnabled : true);

                break;
            }

            case ParentType.Sensor:
            {
                BlobContentTypeList = await DigitalTwinsHelper.GetTypesAsync(
                    Models.Types.SensorDataType, _cache, Loggers.SilentLogger, onlyEnabled : true);

                BlobContentSubTypeList = await DigitalTwinsHelper.GetTypesAsync(
                    Models.Types.DeviceBlobSubtype, _cache, Loggers.SilentLogger, onlyEnabled : true);

                break;
            }
            }

            if (id != null)
            {
                this.SelectedBlobContentItem = await DigitalTwinsHelper.GetBlobAsync((Guid)id, _cache, Loggers.SilentLogger, true);
            }
            else
            {
                SelectedBlobContentItem = new BlobContent();
            }
            this.SelectedBlobContentItem.ParentType = _parentType;
        }
        private async Task LoadAsync(Guid?id = null, Guid?spaceId = null)
        {
            ConditionTargetList = new List <string>
            {
                "Sensor",
                "SensorDevice",
                "SensorSpace"
            };

            ConditionComparisonList = new List <string>
            {
                "Equals",
                "NotEquals",
                "Contains"
            };

            SensorDataTypeList = await DigitalTwinsHelper.GetTypesAsync(Types.SensorDataType, _cache, Loggers.SilentLogger, true);

            if (id != null)
            {
                this.SelectedMatcher = await DigitalTwinsHelper.GetMatcherAsync((Guid)id, _cache, Loggers.SilentLogger, false);
            }
            else
            {
                // if we are back from the creation of a MatcherCondition, we reload the working Matcher
                Matcher matcher = (Matcher)CacheHelper.GetFromCache(_cache, Guid.Empty, Context.Matcher);
                if (matcher == null)
                {
                    matcher = new Matcher()
                    {
                        SpaceId = (Guid)spaceId
                    };
                    CacheHelper.AddInCache(_cache, matcher, matcher.Id, Context.Matcher);
                }
                this.SelectedMatcher          = matcher;
                this.SelectedMatcherCondition = new MatcherCondition();
            }
        }