public virtual ActionResult Input()
        {
            try
            {
                using (var bodyStream = new StreamReader(Request.Body))
                {
                    var     bodyText = bodyStream.ReadToEndAsync().GetAwaiter().GetResult();
                    dynamic json     = JsonConvert.DeserializeObject(bodyText);
                    var     action   = CodecFactory.GetCodecAction((string)json.Action);
                    // if action not found
                    if (action == null)
                    {
                        return(Json(ReturnResult <string> .Fail("Action not found")));
                    }

                    //TODO: add parameters
                    var tile = Tile.FromStrings(new Triplet <string>(
                                                    json.Inputs.X, json.Inputs.Y, json.Inputs.Z),
                                                new IntegerTileSerializer());

                    var result = action.DoAction(tile);
                    return(Json(result.GetStrings(TileSerializerFactory.GetDefaultSerizlizer())));
                }
            }
            catch (Exception ex)
            {
                return(Json(ReturnResult <string> .Fail(ex.Message)));
            }
        }
        public override ActionResult LayerPanel()
        {
            dynamic obj = CodecBaseController.GetJsonObject(Request.InputStream);

            string name  = JsonHelper.CastTo <string>(obj.name);
            int    layer = JsonHelper.CastTo <int>(obj.layer);

            var layersGroup = new List <PanelViewModel>();

            var CodecActionDic = (Dictionary <int, ICodecAction>)Session[ConstantCodecActionDic];

            _codecAction = CodecActionDic == null ? null : (CodecActionDic.ContainsKey(layer) ? CodecActionDic[layer] : null);

            if (_codecAction == null)
            {
                return(PartialView("_Layers", layersGroup));
            }

            if (name.Equals(Constants.DECODE_NAME_RECONSTRUCTEDFRAME))
            {
                return(DecodedImage(layer));
            }

            // gets the action with the same name as the argument
            var action = _codecAction.SubActions.SingleOrDefault(c => c.Name.Equals(name));

            if (action == null || action.Result == null)
            {
                return(PartialView("_Layers", layersGroup));
            }

            // create layers accroding to the given layer.
            // This is different with others
            string           idPrefix   = name.Replace(' ', '-').Replace('/', '-') + "-input-layer-" + layer;
            var              layerPanel = new PanelViewModel(idPrefix, "Layer " + layer);
            Tile             result     = action.Result.FirstOrDefault();
            Triplet <string> triplet    = result.GetStrings(TileSerializerFactory.GetDefaultSerizlizer());
            var              tabx       = new TabViewModel {
                Id = idPrefix + "-Y", Title = "Y", Content = triplet.X, Editable = false
            };
            var taby = new TabViewModel {
                Id = idPrefix + "-Cb", Title = "Cb", Content = triplet.Y, Editable = false
            };
            var tabz = new TabViewModel {
                Id = idPrefix + "-Cr", Title = "Cr", Content = triplet.Z, Editable = false
            };

            layerPanel.Tabs = new List <TabViewModel> {
                tabx, taby, tabz
            };
            layersGroup.Add(layerPanel);

            return(PartialView("_Layers", layersGroup));
        }
        public override ActionResult LayerPanel([FromBody] LayerPanelRequest request)
        {
            var layersGroup = new List <PanelViewModel>();

            try
            {
                var CodecActionDic = this.HttpContext.Session.Get <Dictionary <int, ICodecAction> >(ConstantCodecActionDic);
                _codecAction = CodecActionDic == null ? null : (CodecActionDic.ContainsKey(request.layer) ? CodecActionDic[request.layer] : null);

                if (_codecAction == null)
                {
                    return(PartialView("_Layers", layersGroup));
                }

                if (request.name.Equals(Constants.DECODE_NAME_RECONSTRUCTEDFRAME))
                {
                    return(DecodedImage(request.layer));
                }

                // gets the action with the same name as the argument
                var action = _codecAction.SubActions.SingleOrDefault(c => c.Name.Equals(request.name));
                if (action == null || action.Result == null)
                {
                    return(PartialView("_Layers", layersGroup));
                }

                // create layers accroding to the given layer.
                // This is different with others
                string           idPrefix   = request.name.Replace(' ', '-').Replace('/', '-') + "-input-layer-" + request.layer;
                var              layerPanel = new PanelViewModel(idPrefix, "Layer " + request.layer);
                Tile             result     = action.Result.FirstOrDefault();
                Triplet <string> triplet    = result.GetStrings(TileSerializerFactory.GetDefaultSerizlizer());
                var              tabx       = new TabViewModel {
                    Id = idPrefix + "-Y", Title = "Y", Content = triplet.X, Editable = false
                };
                var taby = new TabViewModel {
                    Id = idPrefix + "-Cb", Title = "Cb", Content = triplet.Y, Editable = false
                };
                var tabz = new TabViewModel {
                    Id = idPrefix + "-Cr", Title = "Cr", Content = triplet.Z, Editable = false
                };
                layerPanel.Tabs = new List <TabViewModel> {
                    tabx, taby, tabz
                };
                layersGroup.Add(layerPanel);
            }
            catch (Exception ex)
            {
                return(Json(ReturnResult <string> .Fail(ex.Message)));
            }

            return(PartialView("_Layers", layersGroup));
        }
        public virtual ActionResult LayerPanel([FromBody] LayerPanelRequest request)
        {
            if (request.name.Equals(Constants.DECODE_NAME_RECONSTRUCTEDFRAME))
            {
                return(DecodedImage());
            }

            var layers = new List <PanelViewModel>();

            try
            {
                var action = _codecAction.SubActions.FirstOrDefault(c => c.Name.Equals(request.name));
                if (action == null || action.Result == null)
                {
                    return(PartialView("_Layers", layers));
                }

                for (int index = 0; index < action.Result.Length; index++)
                {
                    string           idPrefix = request.name.Replace(' ', '-') + "-layer-" + index;
                    var              layer    = new PanelViewModel(idPrefix, "Layer " + index);
                    Tile             result   = action.Result[index];
                    Triplet <string> triplet  = result.GetStrings(TileSerializerFactory.GetDefaultSerizlizer());
                    var              tabx     = new TabViewModel {
                        Id = idPrefix + "-Y", Title = "Y", Content = triplet.X, Editable = false
                    };
                    var taby = new TabViewModel {
                        Id = idPrefix + "-Cb", Title = "Cb", Content = triplet.Y, Editable = false
                    };
                    var tabz = new TabViewModel {
                        Id = idPrefix + "-Cr", Title = "Cr", Content = triplet.Z, Editable = false
                    };
                    layer.Tabs = new List <TabViewModel> {
                        tabx, taby, tabz
                    };
                    layers.Add(layer);
                }
            }
            catch (Exception ex)
            {
                return(Json(ReturnResult <string> .Fail(ex.Message)));
            }

            return(PartialView("_Layers", layers));
        }
Пример #5
0
        public virtual ActionResult LayerPanel()
        {
            dynamic obj = CodecBaseController.GetJsonObject(Request.InputStream);

            string name = JsonHelper.CastTo <string>(obj.name);

            if (name.Equals(Constants.DECODE_NAME_RECONSTRUCTEDFRAME))
            {
                return(DecodedImage());
            }

            var layers = new List <PanelViewModel>();

            // gets the action with the same name as the argument
            var action = _codecAction.SubActions.SingleOrDefault(c => c.Name.Equals(name));

            if (action == null || action.Result == null)
            {
                return(PartialView("_Layers", layers));
            }

            for (int index = 0; index < action.Result.Length; index++)
            {
                string           idPrefix = name.Replace(' ', '-') + "-layer-" + index;
                var              layer    = new PanelViewModel(idPrefix, "Layer " + index);
                Tile             result   = action.Result[index];
                Triplet <string> triplet  = result.GetStrings(TileSerializerFactory.GetDefaultSerizlizer());
                var              tabx     = new TabViewModel {
                    Id = idPrefix + "-Y", Title = "Y", Content = triplet.X, Editable = false
                };
                var taby = new TabViewModel {
                    Id = idPrefix + "-Cb", Title = "Cb", Content = triplet.Y, Editable = false
                };
                var tabz = new TabViewModel {
                    Id = idPrefix + "-Cr", Title = "Cr", Content = triplet.Z, Editable = false
                };
                layer.Tabs = new List <TabViewModel> {
                    tabx, taby, tabz
                };
                layers.Add(layer);
            }

            return(PartialView("_Layers", layers));
        }
        public virtual ActionResult InputPanel([FromBody] LayerPanelRequest request)
        {
            var layers = new List <PanelViewModel>();

            try
            {
                // gets the action with the same name as the argument
                var action = _codecAction.SubActions.FirstOrDefault(c => c.Name.Equals(request.name));
                if (action == null || action.Input == null)
                {
                    return(PartialView("_Layers", layers));
                }

                for (int index = 0; index < action.Input.Length; index++)
                {
                    string           idPrefix = request.name.Replace(' ', '-').Replace('/', '-') + "-input-layer-" + index;
                    var              layer    = new PanelViewModel(idPrefix, "Layer " + index);
                    Tile             result   = action.Input[index];
                    Triplet <string> triplet  = result.GetStrings(TileSerializerFactory.GetDefaultSerizlizer());
                    var              tabx     = new TabViewModel {
                        Id = idPrefix + "-Y", Title = "Y", Content = triplet.X, Editable = true
                    };
                    var taby = new TabViewModel {
                        Id = idPrefix + "-Cb", Title = "Cb", Content = triplet.Y, Editable = true
                    };
                    var tabz = new TabViewModel {
                        Id = idPrefix + "-Cr", Title = "Cr", Content = triplet.Z, Editable = true
                    };
                    layer.Tabs = new List <TabViewModel> {
                        tabx, taby, tabz
                    };
                    layers.Add(layer);
                }
            }
            catch (Exception ex)
            {
                return(Json(ReturnResult <string> .Fail(ex.Message)));
            }

            return(PartialView("_Layers", layers));
        }
Пример #7
0
        public virtual ActionResult Input()
        {
            dynamic json = GetJsonObject(Request.InputStream);

            var action = CodecFactory.GetCodecAction((string)json.Action);

            // if action not found
            if (action == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.NotFound));
            }

            //TODO: add parameters

            var tile = Tile.FromStrings(new Triplet <string>(
                                            json.Inputs.X, json.Inputs.Y, json.Inputs.Z),
                                        new IntegerTileSerializer());

            var result = action.DoAction(tile);

            return(Json(result.GetStrings(TileSerializerFactory.GetDefaultSerizlizer())));
        }
        private List <PanelViewModel> GenerateLayers(string name, Tile[] layerData, bool editable)
        {
            var layers    = new List <PanelViewModel>();
            var formedstr = name.Replace(' ', '-').Replace('/', '-');

            if ((!name.Equals(Constants.PENCODE_NAME_RLGRSRLENCODE)) || editable)
            {
                for (int index = 0; index < layerData.Length; index++)
                {
                    string           idPrefix = editable ? formedstr + "-input-layer-" + index : formedstr + "-output-layer-" + index;
                    var              layer    = new PanelViewModel(idPrefix, "Layer " + index);
                    Tile             result   = layerData[index];
                    Triplet <string> triplet  = result.GetStrings(TileSerializerFactory.GetDefaultSerizlizer());
                    var              tabx     = new TabViewModel {
                        Id = idPrefix + "-Y", Title = "Y", Content = triplet.X, Editable = editable
                    };
                    var taby = new TabViewModel {
                        Id = idPrefix + "-Cb", Title = "Cb", Content = triplet.Y, Editable = editable
                    };
                    var tabz = new TabViewModel {
                        Id = idPrefix + "-Cr", Title = "Cr", Content = triplet.Z, Editable = editable
                    };
                    layer.Tabs = new List <TabViewModel> {
                        tabx, taby, tabz
                    };
                    layers.Add(layer);
                }
            }
            else
            {
                // first Pass
                string           idPrefix = editable ? formedstr + "-input-layer-0" : formedstr + "-output-layer-0";
                var              layer    = new PanelViewModel(idPrefix, "Layer 0");
                Tile             result   = layerData[0];
                Triplet <string> triplet  = result.GetStrings(TileSerializerFactory.GetDefaultSerizlizer());
                var              tabx     = new TabViewModel {
                    Id = idPrefix + "-Y", Title = "Y", Content = triplet.X, Editable = editable
                };
                var taby = new TabViewModel {
                    Id = idPrefix + "-Cb", Title = "Cb", Content = triplet.Y, Editable = editable
                };
                var tabz = new TabViewModel {
                    Id = idPrefix + "-Cr", Title = "Cr", Content = triplet.Z, Editable = editable
                };
                layer.Tabs = new List <TabViewModel> {
                    tabx, taby, tabz
                };
                layers.Add(layer);
                // layers
                for (int index = 1; index < layerData.Length; index += 2)
                {
                    idPrefix = editable ? formedstr + "-input-layer-" + index : formedstr + "-output-layer-" + index;
                    layer    = new PanelViewModel(idPrefix, "Layer " + (index + 1) / 2);

                    result  = layerData[index];
                    triplet = result.GetStrings(TileSerializerFactory.GetDefaultSerizlizer());
                    tabx    = new TabViewModel {
                        Id = idPrefix + "-Y", Title = "Y", Content = triplet.X, Editable = editable
                    };
                    taby = new TabViewModel {
                        Id = idPrefix + "-Cb", Title = "Cb", Content = triplet.Y, Editable = editable
                    };
                    tabz = new TabViewModel {
                        Id = idPrefix + "-Cr", Title = "Cr", Content = triplet.Z, Editable = editable
                    };

                    Tile             raw        = layerData[index + 1];
                    Triplet <string> rawTriplet = raw.GetStrings(TileSerializerFactory.GetDefaultSerizlizer());
                    var rawx = new TabViewModel {
                        Id = idPrefix + "-raw-Y", Title = "Y Raw Data", Content = rawTriplet.X, Editable = editable
                    };
                    var rawy = new TabViewModel {
                        Id = idPrefix + "-raw-Cb", Title = "Cb Raw Data", Content = rawTriplet.Y, Editable = editable
                    };
                    var rawz = new TabViewModel {
                        Id = idPrefix + "-raw-Cr", Title = "Cr Raw Data", Content = rawTriplet.Z, Editable = editable
                    };

                    layer.Tabs = new List <TabViewModel> {
                        tabx, rawx, taby, rawy, tabz, rawz
                    };
                    layers.Add(layer);
                }
            }
            return(layers);
        }
 public override ActionResult Index()
 {
     if (Session == null || Session[IsValid] == null || ((bool)Session[IsValid]) == false)
     {
         // Clear Session data if the data is not valid
         Session[ConstantDAS]            = null;
         Session[ConstantCodecActionDic] = null;
         Session[DecodePreviousFrame]    = null;
         Session[ConstantDASDic]         = null;
         Session[PreviousFrameDic]       = null;
         var viewModel = new RFXPDecodeViewModel(0);
         Session[ModelKey] = viewModel;
         LoadFromSession();
         return(View(_viewModel));
     }
     else
     {
         Session[IsValid] = false;
         Dictionary <int, ICodecAction> SessionCodecActionDic = (Dictionary <int, ICodecAction>)Session[ConstantCodecActionDic];
         if (SessionCodecActionDic != null)
         {
             // put the inputs in the viewbag
             var inputList = new List <string[]>();
             for (int i = 1; i < SessionCodecActionDic.Keys.Count; i++)
             {
                 Triplet <string> encodedData = SessionCodecActionDic[i].SubActions.FirstOrDefault().Input[0].GetStrings(TileSerializerFactory.GetDefaultSerizlizer());
                 Triplet <string> rawData     = SessionCodecActionDic[i].SubActions.FirstOrDefault().Input[1].GetStrings(TileSerializerFactory.GetDefaultSerizlizer());
                 var components = new List <string>
                 {
                     encodedData.X, rawData.X, encodedData.Y, rawData.Y, encodedData.Z, rawData.Z
                 };
                 inputList.Add(components.ToArray());
             }
             if (inputList.Count > 0)
             {
                 ViewBag.Inputs = inputList;
             }
         }
         return(View(_viewModel));
     }
 }
        public override ActionResult InputPanel()
        {
            // TODO: Extract Common with function Panel
            dynamic obj = CodecBaseController.GetJsonObject(Request.InputStream);

            string name  = JsonHelper.CastTo <string>(obj.name);
            int    layer = JsonHelper.CastTo <int>(obj.layer);

            var layersGroup = new List <PanelViewModel>();

            var CodecActionDic = (Dictionary <int, ICodecAction>)Session[ConstantCodecActionDic];

            _codecAction = CodecActionDic == null ? null : (CodecActionDic.ContainsKey(layer) ? CodecActionDic[layer] : null);

            if (_codecAction == null)
            {
                return(PartialView("_Layers", layersGroup));
            }

            // gets the action with the same name as the argument
            var action = _codecAction.SubActions.SingleOrDefault(c => c.Name.Equals(name));

            if (action == null || action.Input == null)
            {
                return(PartialView("_Layers", layersGroup));
            }

            // create layers accroding to the given layer.
            // This is different with others
            string idPrefix   = name.Replace(' ', '-').Replace('/', '-') + "-output-layer-" + layer;
            var    layerPanel = new PanelViewModel(idPrefix, "Layer " + layer);

            if (action.Input.Length > 1 && layer > 0)
            {
                Tile             input      = action.Input[0];
                Tile             rawInput   = action.Input[1];
                Triplet <string> triplet    = input.GetStrings(TileSerializerFactory.GetDefaultSerizlizer());
                Triplet <string> rawTriplet = rawInput.GetStrings(TileSerializerFactory.GetDefaultSerizlizer());
                var tabx = new TabViewModel {
                    Id = idPrefix + "-Y", Title = "Y", Content = triplet.X, Editable = true
                };
                var tabrawx = new TabViewModel {
                    Id = idPrefix + "-YRaw", Title = "Y Raw Data", Content = rawTriplet.X, Editable = true
                };
                var taby = new TabViewModel {
                    Id = idPrefix + "-Cb", Title = "Cb", Content = triplet.Y, Editable = true
                };
                var tabrawy = new TabViewModel {
                    Id = idPrefix + "-CbRaw", Title = "Cb Raw Data", Content = rawTriplet.Y, Editable = true
                };
                var tabz = new TabViewModel {
                    Id = idPrefix + "-Cr", Title = "Cr", Content = triplet.Z, Editable = true
                };
                var tabrawz = new TabViewModel {
                    Id = idPrefix + "-CrRaw", Title = "Cr Raw Data", Content = rawTriplet.Z, Editable = true
                };

                layerPanel.Tabs = new List <TabViewModel> {
                    tabx, tabrawx, taby, tabrawy, tabz, tabrawz
                };
                layersGroup.Add(layerPanel);
            }
            else
            {
                Tile             input   = action.Input.FirstOrDefault();
                Triplet <string> triplet = input.GetStrings(TileSerializerFactory.GetDefaultSerizlizer());
                var tabx = new TabViewModel {
                    Id = idPrefix + "-Y", Title = "Y", Content = triplet.X, Editable = true
                };
                var taby = new TabViewModel {
                    Id = idPrefix + "-Cb", Title = "Cb", Content = triplet.Y, Editable = true
                };
                var tabz = new TabViewModel {
                    Id = idPrefix + "-Cr", Title = "Cr", Content = triplet.Z, Editable = true
                };
                layerPanel.Tabs = new List <TabViewModel> {
                    tabx, taby, tabz
                };
                layersGroup.Add(layerPanel);
            }

            return(PartialView("_Layers", layersGroup));
        }
        public override ActionResult Index()
        {
            if (this.HttpContext.Session.Get <bool>(IsValid) == false)
            {
                // Clear Session data if the data is not valid
                this.HttpContext.Session.SetObject(ConstantDAS, null);
                this.HttpContext.Session.SetObject(ConstantCodecActionDic, null);
                this.HttpContext.Session.SetObject(DecodePreviousFrame, null);
                this.HttpContext.Session.SetObject(ConstantDASDic, null);
                this.HttpContext.Session.SetObject(PreviousFrameDic, null);

                var viewModel = new RFXPDecodeViewModel(0);
                this.HttpContext.Session.SetObject(ModelKey, viewModel);
                LoadFromSession();
                return(View(_viewModel));
            }
            else
            {
                this.HttpContext.Session.SetObject(IsValid, false);

                Dictionary <int, ICodecAction> SessionCodecActionDic = this.HttpContext.Session.Get <Dictionary <int, ICodecAction> >(ConstantCodecActionDic);
                if (SessionCodecActionDic != null)
                {
                    // put the inputs in the viewbag
                    var inputList = new List <string[]>();
                    for (int i = 1; i < SessionCodecActionDic.Keys.Count; i++)
                    {
                        Triplet <string> encodedData = SessionCodecActionDic[i].SubActions.FirstOrDefault().Input[0].GetStrings(TileSerializerFactory.GetDefaultSerizlizer());
                        Triplet <string> rawData     = SessionCodecActionDic[i].SubActions.FirstOrDefault().Input[1].GetStrings(TileSerializerFactory.GetDefaultSerizlizer());
                        var components = new List <string>
                        {
                            encodedData.X, rawData.X, encodedData.Y, rawData.Y, encodedData.Z, rawData.Z
                        };
                        inputList.Add(components.ToArray());
                    }
                    if (inputList.Count > 0)
                    {
                        ViewBag.Inputs = inputList;
                    }
                }
                return(View(_viewModel));
            }
        }
        public override ActionResult InputPanel([FromBody] LayerPanelRequest request)
        {
            // TODO: Extract Common with function Panel
            var layersGroup = new List <PanelViewModel>();

            try
            {
                var CodecActionDic = this.HttpContext.Session.Get <Dictionary <int, ICodecAction> >(ConstantCodecActionDic);
                _codecAction = CodecActionDic == null ? null : (CodecActionDic.ContainsKey(request.layer) ? CodecActionDic[request.layer] : null);

                if (_codecAction == null)
                {
                    return(PartialView("_Layers", layersGroup));
                }

                // gets the action with the same name as the argument
                var action = _codecAction.SubActions.SingleOrDefault(c => c.Name.Equals(request.name));
                if (action == null || action.Input == null)
                {
                    return(PartialView("_Layers", layersGroup));
                }

                // create layers accroding to the given layer.
                // This is different with others
                string idPrefix   = request.name.Replace(' ', '-').Replace('/', '-') + "-output-layer-" + request.layer;
                var    layerPanel = new PanelViewModel(idPrefix, "Layer " + request.layer);
                if (action.Input.Length > 1 && request.layer > 0)
                {
                    Tile             input      = action.Input[0];
                    Tile             rawInput   = action.Input[1];
                    Triplet <string> triplet    = input.GetStrings(TileSerializerFactory.GetDefaultSerizlizer());
                    Triplet <string> rawTriplet = rawInput.GetStrings(TileSerializerFactory.GetDefaultSerizlizer());
                    var tabx = new TabViewModel {
                        Id = idPrefix + "-Y", Title = "Y", Content = triplet.X, Editable = true
                    };
                    var tabrawx = new TabViewModel {
                        Id = idPrefix + "-YRaw", Title = "Y Raw Data", Content = rawTriplet.X, Editable = true
                    };
                    var taby = new TabViewModel {
                        Id = idPrefix + "-Cb", Title = "Cb", Content = triplet.Y, Editable = true
                    };
                    var tabrawy = new TabViewModel {
                        Id = idPrefix + "-CbRaw", Title = "Cb Raw Data", Content = rawTriplet.Y, Editable = true
                    };
                    var tabz = new TabViewModel {
                        Id = idPrefix + "-Cr", Title = "Cr", Content = triplet.Z, Editable = true
                    };
                    var tabrawz = new TabViewModel {
                        Id = idPrefix + "-CrRaw", Title = "Cr Raw Data", Content = rawTriplet.Z, Editable = true
                    };

                    layerPanel.Tabs = new List <TabViewModel> {
                        tabx, tabrawx, taby, tabrawy, tabz, tabrawz
                    };
                    layersGroup.Add(layerPanel);
                }
                else
                {
                    Tile             input   = action.Input.FirstOrDefault();
                    Triplet <string> triplet = input.GetStrings(TileSerializerFactory.GetDefaultSerizlizer());
                    var tabx = new TabViewModel {
                        Id = idPrefix + "-Y", Title = "Y", Content = triplet.X, Editable = true
                    };
                    var taby = new TabViewModel {
                        Id = idPrefix + "-Cb", Title = "Cb", Content = triplet.Y, Editable = true
                    };
                    var tabz = new TabViewModel {
                        Id = idPrefix + "-Cr", Title = "Cr", Content = triplet.Z, Editable = true
                    };
                    layerPanel.Tabs = new List <TabViewModel> {
                        tabx, taby, tabz
                    };
                    layersGroup.Add(layerPanel);
                }
            }
            catch (Exception ex)
            {
                return(Json(ReturnResult <string> .Fail(ex.Message)));
            }

            return(PartialView("_Layers", layersGroup));
        }