Exemple #1
0
        private async Task LoadAsync()
        {
            Permission userPermission;

            (Model, Owner, userPermission) = await Api.GetEntryAsync(EntryId);

            UpdateOriginal();

            Log.Debug($"Entry user permission '{userPermission}'.");
            Permissions.IsEditable = UserState.IsEditable && userPermission == Permission.Write;
            Permissions.IsOwner    = UserState.UserId == Owner.Id;

            Markers.Clear();
            foreach (var location in Model.Locations)
            {
                Markers.Add(new MapMarkerModel
                {
                    Latitude   = location.Latitude,
                    Longitude  = location.Longitude,
                    Altitude   = location.Altitude,
                    IsEditable = true
                });
            }

            if (Log.IsDebugEnabled())
            {
                Log.Debug($"Load, markers: {Markers.Count}, entry locations: {Model.Locations.Count}.");
                Log.Debug(Json.Serialize(Markers));
            }
        }
        public override IThing FittingMarker(object data)
        {
            if (data == null)
            {
                return(null);
            }
            var marker = base.FittingMarker(data);

            if (marker != null)
            {
                return(marker);
            }

            var graph = this.Graph.ThingGraph();

            if (graph == null)
            {
                return(null);
            }

            marker = graph.GetByData(data).FirstOrDefault();
            if (marker != null && !Markers.Contains(marker))
            {
                Markers.Add(marker);
            }

            return(marker);
        }
Exemple #3
0
 public void MarkersAddRange(Dictionary <string, Type> markers)
 {
     foreach (var marker in markers)
     {
         Markers.Add(marker.Key, marker.Value);
     }
 }
Exemple #4
0
        public void AddMarker(bool editText = false, int?frame = null)
        {
            // feos: we specify the selected frame if we call this from TasView, otherwise marker should be added to the emulated frame
            var markerFrame = frame ?? Global.Emulator.Frame;

            if (editText)
            {
                InputPrompt i = new InputPrompt
                {
                    Text          = "Marker for frame " + markerFrame,
                    TextInputType = InputPrompt.InputType.Text,
                    Message       = "Enter a message",
                    InitialValue  =
                        Markers.IsMarker(markerFrame) ?
                        Markers.PreviousOrCurrent(markerFrame).Message :
                        ""
                };
                var result = i.ShowHawkDialog();
                if (result == DialogResult.OK)
                {
                    Markers.Add(new TasMovieMarker(markerFrame, i.PromptText));
                    UpdateValues();
                }
            }
            else
            {
                Markers.Add(new TasMovieMarker(markerFrame, ""));
                UpdateValues();
            }
        }
Exemple #5
0
        void AddExplosion(vec2 Pos, vec2 Size)
        {
            vec2 size = vec(1.266f, 1.35f) * Size * CellWorldSize;

            Markers.Add(new Marker(this, Pos, size, ExsplosionSprite, -1f, frames: ExplosionSpriteSheet.AnimLength, DrawOrder: DrawOrder.AfterTiles, frame_length: .066f));
            Markers.Add(new Marker(this, Pos, size, ExsplosionSprite, -1f, frames: ExplosionSpriteSheet.AnimLength, DrawOrder: DrawOrder.AfterUnits, frame_length: .066f, alpha: 1));
        }
Exemple #6
0
        internal void MoveMarker(int?index, double latitude, double longitude, double?altitude)
        {
            if (!IsEditable)
            {
                return;
            }

            Log.Debug($"MoveMarker: {index?.ToString() ?? "<null>"}, {latitude}, {longitude}, {altitude}");

            MapMarkerModel marker;

            if (index == null)
            {
                Markers.Add(marker = new MapMarkerModel()
                {
                    IsEditable = true
                });
            }
            else
            {
                marker = Markers[index.Value];
            }

            if (marker.IsEditable)
            {
                marker.Latitude  = latitude;
                marker.Longitude = longitude;
                marker.Altitude  = altitude;
                MarkersChanged?.Invoke();
            }
        }
Exemple #7
0
        void AddBuildBuildingEffect(vec2 GridCoord)
        {
            vec2 size = 6 * vec(1.266f, 1.35f) * CellWorldSize;
            vec2 pos  = GridToWorldCood(floor(GridCoord)) + new vec2(CellWorldSize.x, -CellWorldSize.y) / 2;

            Markers.Add(new Marker(this, pos, size, Assets.SmokeTexture, -1f, frames: 4, DrawOrder: DrawOrder.AfterUnits, alpha: 1, dsize_dt: vec(.01f, .01f)));
        }
Exemple #8
0
        public void BuildAutomaticPoints()
        {
            ClearAll();

            if (!IntervalSettings.isAuto)
            {
                Markers.Add(((IntervalSettings.PointsQuantity - 1) / 2) + 1);
                CenterFrequencys.Add(IntervalSettings.HandCenterFrequency);
            }
            else
            {
                if (IntervalSettings.FrequencyInnerStep <= 0)
                {
                    MessageBox.Show("ШАГ СКАНИРОВАНИЯ ДОЛЖЕН БЫТЬ БОЛЬШЕ 0");
                    return;
                }

                if (IntervalSettings.FrequencyStart > IntervalSettings.FrequencyStop)
                {
                    MessageBox.Show("КОНЕЦ ДИАПАЗОНА ДОЛЖЕН БЫТЬ БОЛЬШЕ НАЧАЛА ДИАПАЗОНА");
                    return;
                }

                long CurrentCenterFrequency;

                long innerStepQuantity = (IntervalSettings.FrequencyStop - IntervalSettings.FrequencyStart) / IntervalSettings.FrequencyInnerStep;

                if (innerStepQuantity <= IntervalSettings.PointsQuantity - 1)
                {
                    IntervalSettings.Span = IntervalSettings.FrequencyStop - IntervalSettings.FrequencyStart;

                    CurrentCenterFrequency = IntervalSettings.FrequencyStart + IntervalSettings.Span / 2;

                    CenterFrequencys.Add(CurrentCenterFrequency);

                    for (int counter = 0; counter <= innerStepQuantity; counter++)
                    {
                        Markers.Add(counter * ((IntervalSettings.PointsQuantity - 1) / (int)innerStepQuantity));
                    }
                }
                else
                {
                    IntervalSettings.Span = (IntervalSettings.PointsQuantity - 1) * IntervalSettings.FrequencyInnerStep;

                    CurrentCenterFrequency = IntervalSettings.FrequencyStart + IntervalSettings.Span / 2;
                    CenterFrequencys.Add(CurrentCenterFrequency);

                    while ((CurrentCenterFrequency + IntervalSettings.Span / 2) < IntervalSettings.FrequencyStop)
                    {
                        CurrentCenterFrequency += IntervalSettings.Span;
                        CenterFrequencys.Add(CurrentCenterFrequency);
                    }

                    for (int counter = 0; counter <= innerStepQuantity; counter++)
                    {
                        Markers.Add(counter);
                    }
                }
            }
        }
Exemple #9
0
 public void DuplicatePlot(ShipTrackGmapPlotViewModel vm)
 {
     foreach (var marker in vm.Markers)
     {
         Markers.Add(marker);
     }
 }
Exemple #10
0
        void AddSummonUnitEffect(vec2 GridCoord)
        {
            vec2 size = vec(1.266f, 1.35f) * 2 * CellWorldSize;
            vec2 pos  = GridToWorldCood(floor(GridCoord)) + new vec2(CellWorldSize.x, -CellWorldSize.y) / 2;

            Markers.Add(new Marker(this, pos, size, Assets.MagicTexture, -1f, frames: 4, DrawOrder: DrawOrder.AfterTiles, dsize_dt: vec(.002f, .002f)));
            Markers.Add(new Marker(this, pos, size, Assets.MagicTexture, -1f, frames: 4, DrawOrder: DrawOrder.AfterUnits, dsize_dt: vec(.002f, .002f), alpha: 1));
        }
Exemple #11
0
        void AddSummonAreaEffect(vec2 pos, vec2 area)
        {
            vec2 cell_size = 2 * (1 / DataGroup.GridSize);
            vec2 size      = vec(1.266f, 1.35f) * area * cell_size;

            Markers.Add(new Marker(this, pos, size, Assets.MagicTexture, alpha_fade: -1.5f, frames: 4, frame_length: .1375f, DrawOrder: DrawOrder.AfterTiles, dsize_dt: .65f * size));
            Markers.Add(new Marker(this, pos, size, Assets.MagicTexture, alpha_fade: -1.5f, frames: 4, frame_length: .1375f, DrawOrder: DrawOrder.AfterUnits, dsize_dt: .65f * size, alpha: 1));
        }
Exemple #12
0
        public override void StartNewRecording()
        {
            ClearTasprojExtras();
            Markers.Add(0, StartsFromSavestate ? "Savestate" : "Power on");
            ChangeLog = new TasMovieChangeLog(this);

            base.StartNewRecording();
        }
Exemple #13
0
        /// <summary>
        /// Adds a textMarker to the Markers list
        /// </summary>
        /// <param name="list">Entries that will be binded to the TextMarker</param>
        /// <param name="author">Author of the TextMarker</param>
        /// <param name="message">Message of the Textmarker</param>
        /// <returns></returns>
        public TextMarker AddTextMarker(List <LogEntry> list,
                                        string author,
                                        string message)
        {
            var marker = new TextMarker(list, author, message);

            Markers.Add(marker);
            return(marker);
        }
Exemple #14
0
        private bool Get3DSettings()
        {
            bool getstatus = mProtocol.Get3Dsettings();

            if (getstatus)
            {
                mUpAxis = mProtocol.Settings3D.axisUpwards;

                Rotation.ECoordinateAxes xAxis, yAxis, zAxis;
                Rotation.GetCalibrationAxesOrder(mUpAxis, out xAxis, out yAxis, out zAxis);

                mCoordinateSystemChange = Rotation.GetAxesOrderRotation(xAxis, yAxis, zAxis);

                // Save marker settings
                mMarkers.Clear();
                foreach (Settings3DLabel marker in mProtocol.Settings3D.labels3D)
                {
                    LabeledMarker newMarker = new LabeledMarker();
                    newMarker.Label    = marker.Name;
                    newMarker.Position = Vector3.zero;
                    newMarker.Color.r  = (marker.ColorRGB) & 0xFF;
                    newMarker.Color.g  = (marker.ColorRGB >> 8) & 0xFF;
                    newMarker.Color.b  = (marker.ColorRGB >> 16) & 0xFF;

                    newMarker.Color /= 255;

                    newMarker.Color.a = 1F;

                    Markers.Add(newMarker);
                }

                // Save bone settings
                if (mProtocol.Settings3D.bones != null)
                {
                    Bones.Clear();

                    //Save bone settings
                    foreach (var settingsBone in mProtocol.Settings3D.bones)
                    {
                        Bone bone = new Bone();
                        bone.From       = settingsBone.from;
                        bone.FromMarker = GetMarker(settingsBone.from);
                        bone.To         = settingsBone.to;
                        bone.ToMarker   = GetMarker(settingsBone.to);
                        bone.Color.r    = (settingsBone.color) & 0xFF;
                        bone.Color.g    = (settingsBone.color >> 8) & 0xFF;
                        bone.Color.b    = (settingsBone.color >> 16) & 0xFF;
                        bone.Color     /= 255;
                        bone.Color.a    = 1F;
                        mBones.Add(bone);
                    }
                }

                return(true);
            }
            return(false);
        }
Exemple #15
0
 private void BuildForTangerine()
 {
     int[]    markerFrames = { 0, 10, 20, 30, 40 };
     string[] makerIds     = { "Normal", "Focus", "Press", "Release", "Disable" };
     for (var i = 0; i < 5; i++)
     {
         Markers.Add(new Marker(makerIds[i], markerFrames[i], MarkerAction.Stop));
     }
 }
Exemple #16
0
 private void LoadPoints(IEnumerable <string> lines)
 {
     foreach (var line in lines)
     {
         var fields = line.Split(';');
         Markers.Add(new Marker {
             Id = fields[2], Description = fields[3]
         });
     }
 }
Exemple #17
0
        public void SetDefaultValues(Node NodeOne, Node NodeTwo)
        {
            Y          = (NodeOne.Y + NodeTwo.Y) / 2;
            XStart     = Drawing.GetSizeF(NodeOne).Width / 2 / Converter.Scale;
            XEnd       = Drawing.GetSizeF(NodeTwo).Width / 2 / Converter.Scale;
            LinePoints = RefreshPoints(NodeOne, NodeTwo);

            Markers.Add(Utils.MarkerType.Center, new PointF((CenterE.X + End.X) / 2, Converter.YYtoJJ(Y)));
            Markers.Add(Utils.MarkerType.CenterStart, new PointF(Start.X, (Start.Y + CenterS.Y) / 2));
            Markers.Add(Utils.MarkerType.CenterEnd, new PointF(End.X, (End.Y + CenterE.Y) / 2));
        }
Exemple #18
0
 private void AddMarker(MapPin pin)
 {
     using (var op = new MarkerOptions())
     {
         op.SetTitle(pin.Label);
         op.SetPosition(pin.Position.ToLatLng());
         op.SetIcon(BitmapDescriptorFactory.DefaultMarker(pin.Color.ToAndroidMarkerHue()));
         var marker = NativeMap.AddMarker(op);
         pin.Id = marker.Id;
         Markers.Add(pin, marker);
     }
 }
        public override void SetMarkers(IGraph <IVisual, IVisualEdge> source)
        {
            this.Markers = new IThing[] {  };
            var graph = source.ThingGraph();

            if (graph != null)
            {
                SetMarkers(graph.Markers());
                if (!this.Markers.Contains(DefaultMarker) && DefaultMarker != null)
                {
                    Markers.Add(DefaultMarker);
                }
            }
        }
Exemple #20
0
        private void AddMarker(Marker marker)
        {
            if (marker is Polyline)
            {
                AddPolyline(marker as Polyline);
                return;
            }
            MarkerAnnotation annotation = new MarkerAnnotation(marker);

            Control.AddAnnotation(annotation);
            Markers.Add(marker, annotation);

            marker.PropertyChanged += Marker_PropertyChanged;
        }
Exemple #21
0
        public bool AddMarker(Marker marker)
        {
            Markers.Add(marker);

            if (Markers.Count > 2 && Markers[0].Bounds.IntersectsWith(Markers[Markers.Count - 1].Bounds))
            {
                ContourReady = true;
                Markers.RemoveAt(Markers.Count - 1);

                return(true);
            }

            return(false);
        }
Exemple #22
0
        private void CalculateMarkers()
        {
            Markers.Clear();

            Markers.Add(new ZeroLine(_context, Resource.Drawable.zeroline1, (int)Grid.EndWidth, (int)Grid.StartWidth, (int)(Grid.Height / 2.3)));
            Markers.Add(new ZeroLine(_context, Resource.Drawable.zeroline2, (int)Grid.EndWidth, (int)Grid.StartWidth, (int)(Grid.Height / 1.7)));

            Markers.Add(new YMarker(_context, Resource.Drawable.markera, Grid.EndWidth, (int)(Grid.Height / 3)));
            Markers.Add(new YMarker(_context, Resource.Drawable.markerb, Grid.EndWidth, (int)(Grid.Height * 0.75)));

            Markers.Add(new TriggerMarker(_context, Resource.Drawable.markertriggerup, Resource.Drawable.markertriggerdown, Grid.EndWidth, (int)(Grid.Height / 4)));

            Markers.Add(new XMarker(_context, Resource.Drawable.marker1, (int)Grid.EndHeight, (int)(Grid.Width / 3)));
            Markers.Add(new XMarker(_context, Resource.Drawable.marker2, (int)Grid.EndHeight, (int)(Grid.Width * 0.75)));
        }
        public override IThing CreateMarker(object data)
        {
            if (Transformer != null)
            {
                var marker = Transformer.ThingFactory.CreateItem(data);

                if (!Markers.Contains(marker))
                {
                    Markers.Add(marker);
                }

                return(marker);
            }
            return(null);
        }
Exemple #24
0
            public MarkerGroup(CacheBase Cache, int Address)
            {
                EndianReader Reader = Cache.Reader;

                Reader.SeekTo(Address);

                Name = Cache.Strings.GetItemByID(Reader.ReadInt32());

                int iCount  = Reader.ReadInt32();
                int iOffset = Reader.ReadInt32() - Cache.Magic;

                for (int i = 0; i < iCount; i++)
                {
                    Markers.Add(new Marker(Cache, iOffset + 48 * i));
                }
            }
Exemple #25
0
 public OverworldMap() : base()
 {
     _eventAggregator.Subscribe(this);
     MapProvider              = new OverworldMapProvider();
     Position                 = new PointLatLng(0, 0);
     Manager.Mode             = AccessMode.ServerOnly;
     DragButton               = MouseButton.Left;
     MouseWheelZoomType       = MouseWheelZoomType.MousePositionWithoutCenter;
     ShowCenter               = false;
     MinZoom                  = 0;
     MaxZoom                  = 6;
     IgnoreMarkerOnMouseWheel = true;
     Overlay                  = new LocationBorderOverlay(new PointLatLng(90, -180));
     Markers.Add(Overlay);
     OnMapZoomChanged        += OverworldMap_OnMapZoomChanged;
     PreviewMouseDoubleClick += OverworldMap_PreviewMouseDoubleClick;
 }
        protected override void LoadFields(ZipStateLoader bl, bool preload)
        {
            LoadBk2Fields(bl, preload);

            if (!preload)
            {
                if (MovieService.IsCurrentTasVersion(Header[HeaderKeys.MovieVersion]))
                {
                    LoadTasprojExtras(bl);
                }
                else
                {
                    Session.PopupMessage("The current .tasproj is not compatible with this version of BizHawk! .tasproj features failed to load.");
                    Markers.Add(0, StartsFromSavestate ? "Savestate" : "Power on");
                }
            }
        }
Exemple #27
0
        private async Task LoadAsync()
        {
            Entries = await Api.GetMapListAsync();

            Markers.Clear();
            foreach (var entry in Entries)
            {
                Markers.Add(new MapMarkerModel()
                {
                    Latitude  = entry.Location.Latitude,
                    Longitude = entry.Location.Longitude,
                    Altitude  = entry.Location.Altitude,
                    Title     = entry.Title
                });
            }

            IsLoading = false;
        }
Exemple #28
0
        /// <summary>
        /// Adds new marker rule
        /// </summary>
        /// <param name="item">The item.</param>
        public void Add(IRegexMarker item)
        {
            if (item == null)
            {
                return;
            }

            if (item.marker == null)
            {
                //item.marker = defaultMarker;
            }
            if (!Index.ContainsKey(item.marker))
            {
                Index.Add(item.marker, item);
            }

            Markers.Add(item);
        }
Exemple #29
0
            public MarkerGroup(CacheBase Cache, int Address)
            {
                EndianReader Reader = Cache.Reader;

                Reader.SeekTo(Address);

                Name = Reader.ReadNullTerminatedString(32);
                Reader.ReadInt16();

                Reader.SeekTo(Address + 0x34);

                int iCount  = Reader.ReadInt32();
                int iOffset = Reader.ReadInt32() - Cache.Magic;

                for (int i = 0; i < iCount; i++)
                {
                    Markers.Add(new Marker(Cache, iOffset + 32 * i));
                }
            }
Exemple #30
0
 public void CreateMarker(int type, MultiVShared.Vector3 position, MultiVShared.Vector3 rotation, MultiVShared.Vector3 dir, MultiVShared.Vector3 scale, int r, int g, int b, int a,
                          int netHandle)
 {
     if (!Markers.ContainsKey(netHandle))
     {
         Markers.Add(netHandle, new MarkerProperties()
         {
             MarkerType = type,
             Position   = position,
             Rotation   = rotation,
             Direction  = dir,
             Scale      = scale,
             Red        = r,
             Green      = g,
             Blue       = b,
             Alpha      = (byte)a,
         });
     }
 }