/// <summary> /// Initializes a new instance of the <see cref="OperationalTransconductanceAmplifier"/> class. /// </summary> /// <param name="name">The name.</param> public Multiplexer(string name) : base(name) { Pins.Add(new[] { "zero", "a" }, "The '0' input.", new Vector2(-5, -4), new Vector2(-1, 0)); Pins.Add(new[] { "one", "b" }, "The '1' input.", new Vector2(-5, 4), new Vector2(-1, 0)); Pins.Add(new[] { "o", "out" }, "The output.", new Vector2(5, 0), new Vector2(1, 0)); }
private void FavAddressSearch_OnSelectedAction(object sender, EventArgs e) { if (sender is AddressesSearch asS) { if (asS.SelectedAddress == null) { return; } var currPin = Pins?.FirstOrDefault(); if (currPin != null) { Pins.Clear(); currPin.Location = new Location(asS.SelectedAddress.Lat, asS.SelectedAddress.Lon); Pins.Add(currPin); } else { if (!Locations.Any(p => p.Address == asS.SelectedAddress)) { Pins.Clear(); Pins.Add(new Pushpin() { Location = new Location(asS.SelectedAddress.Lat, asS.SelectedAddress.Lon), Content = Tools.CreateIcon((Editing == null) ? PackIconKind.Plus : PackIconKind.Edit) }); } } if (!(currPin != null && (Math.Abs(currPin.Location.Latitude - asS.SelectedAddress.Lat) < 1 || Math.Abs(currPin.Location.Longitude - asS.SelectedAddress.Lon) < 1))) { FavMap.Center = new Location(asS.SelectedAddress.Lat, asS.SelectedAddress.Lon); } } }
/// <summary> /// Handle the capability messages. There will be one such message for each pin /// </summary> public void Handle(CapabilityMessage message) { var pin = new Pin(message); // Add it to the collection Pins.Add(pin); }
public async Task LoadData() { await Task.Delay(200); var stores = await _appService.GetStoreInfo(); if (stores != null) { StoreList = new ObservableCollection <StoreInfo>(stores); foreach (var store in stores) { if (store.Latitude.HasValue && store.Longitude.HasValue) { Pins.Add(new Pin() { Type = PinType.Place, Label = store.Store_Name, Address = store.Address, Icon = BitmapDescriptorFactory.FromBundle(GlobalSettings.AppConst.StorePinImage), Position = new Xamarin.Forms.GoogleMaps.Position(store.Latitude.Value, store.Longitude.Value) }); } MessagingCenter.Send(Pins, MessagingCenterKeys.OnDrawMapsPin); } } }
/// <summary> /// Initializes a new instance of the <see cref="Or"/> class. /// </summary> /// <param name="name">The name.</param> public Xor(string name) : base(name) { Pins.Add(new[] { "a", "in1" }, "First input.", new Vector2(-5.31, 2), new Vector2(-1, 0)); Pins.Add(new[] { "b", "in2" }, "Second input.", new Vector2(-5.31, -2), new Vector2(-1, 0)); Pins.Add(new[] { "o", "out" }, "Output.", new Vector2(6, 0), new Vector2(1, 0)); }
/// <summary> /// Initializes a new instance of the <see cref="BipolarPnpTransistor"/> class. /// </summary> /// <param name="name">The name.</param> public BipolarPnpTransistor(string name) : base(name) { Pins.Add(new[] { "c", "collector" }, "The collector.", new Vector2(-8, 0), new Vector2(-1, 0)); Pins.Add(new[] { "b", "base" }, "The base.", new Vector2(0, 6), new Vector2(0, 1)); Pins.Add(new[] { "e", "emitter" }, "The emitter.", new Vector2(8, 0), new Vector2(1, 0)); }
/// <summary> /// Initializes a new instance of the <see cref="Resistor"/> class. /// </summary> /// <param name="name">The name.</param> public Resistor(string name) : base(name) { Pins.Add(new[] { "p", "pos", "a" }, "The positive pin.", new Vector2(-8, 0), new Vector2(-1, 0)); Pins.Add(new[] { "c", "ctrl" }, "The controlling pin.", new Vector2(0, 8), new Vector2(0, 1)); Pins.Add(new[] { "n", "neg", "b" }, "The negative pin.", new Vector2(8, 0), new Vector2(1, 0)); }
public void getUniqueCoordinatesByType(IEnumerable <VisualActivity> activities, ActivityType type) { if (activities == null) { throw new ArgumentNullException("Activities is null"); } var activitiesForType = from activity in activities where activity.Summary.Type == type select activity; VisualActivities = activitiesForType; foreach (var visualActivity in VisualActivities) { if (visualActivity == null || visualActivity.StartLat == null || visualActivity.StartLong == null) { continue; } updateNumVisits(visualActivity); addCoordinate(visualActivity); } foreach (var coordinate in NumVisits.Keys) { Pin pin = new Pin(); pin.Location = coordinate; pin.Text = Convert.ToString(NumVisits[coordinate]); Pins.Add(pin); } }
private async Task GetUserHives(string uid) { if (Connectivity.NetworkAccess != NetworkAccess.Internet) { await _pageDialogService.DisplayAlertAsync("No Internet", "Please check your internet connection and try again.", "Ok"); return; } var userHives = await _firebaseHelper.GetAllUserHives(uid); if (Pins.Any()) { Pins.Clear(); } foreach (var hive in userHives) { Pins.Add(new Pin() { Label = hive.HiveName, Position = new Position(hive.HiveLocation.Latitude, hive.HiveLocation.Longitude), Icon = BitmapDescriptorFactory.FromBundle("map_pin.png"), IsDraggable = true }); } }
/// <summary> /// Initializes a new instance of the <see cref="OperationalTransconductanceAmplifier"/> class. /// </summary> /// <param name="name">The name.</param> public OperationalTransconductanceAmplifier(string name) : base(name) { Pins.Add(new[] { "n" }, "The negative input.", new Vector2(-5, -4), new Vector2(-1, 0)); Pins.Add(new[] { "p" }, "The positive input.", new Vector2(-5, 4), new Vector2(-1, 0)); Pins.Add(new[] { "o", "out" }, "The output.", new Vector2(5, 0), new Vector2(1, 0)); }
public void GetGeolocation() { var position1 = new Position(6.248754, -75.596131); var pin1 = new Pin { Type = PinType.Place, Position = position1, Label = "Casa", Address = "Mi Casa" }; Pins.Add(pin1); var position2 = new Position(6.233063, -75.604972); var pin2 = new Pin { Type = PinType.Place, Position = position2, Label = "Los Molinos", Address = "C.C Los Molinos" }; Pins.Add(pin2); var position3 = new Position(6.229012, -75.593821); var pin3 = new Pin { Type = PinType.Place, Position = position3, Label = "Pau", Address = "Casa Pau" }; Pins.Add(pin3); }
public NodePin <T> ChangePinType <T>(NodePin pin) { NodeEditor.Assertions.IsTrue(Pins.Contains(pin), string.Format("'{0}' does not contains pin '{1}'.", Name, pin.Name)); if (Pins.Contains(pin)) { var replacementPin = new NodePin <T>(pin.Name, pin.Index, this); Pins.Remove(pin); // Replace old pin with the new pin at the same index as the old pin. var targetList = pin.IsInput ? InputPins : OutputPins; targetList.Insert(targetList.IndexOf(pin), replacementPin); targetList.Remove(pin); Pins.Add(replacementPin); NodeEditor.Logger.Log <Node>("Swapped pin '{0}' of type '{1}' for type '{2}'", replacementPin.Name, pin.WrappedType, replacementPin.WrappedType); PinChanged.InvokeSafe(new NodePinChangedEvent(pin, replacementPin)); return(replacementPin); } return(null); }
public void DrawPath(IEnumerable <GeoPoint> path, IEnumerable <Pin> pins = null, GeoPoint center = null, double distance = 1.0, bool clear = true) { if (clear) { RouteCoordinates.Clear(); } var cor = path.Select(x => new Position(x.Lat, x.Lon)); RouteCoordinates.AddRange(cor); Pins.Clear(); if (pins != null) { foreach (var p in pins.Where(x => x != null)) { Pins.Add(p); } } if (center != null) { MoveToRegion(MapSpan.FromCenterAndRadius(center, Distance.FromMiles(distance))); } }
public T GetOrAddPin <T>(Action <T> factory, string id, GraphValueType type = null) where T : IPin, new() { if (string.IsNullOrEmpty(id)) { var pins = Pins.Where(p => p.Id.StartsWith("#")).ToList(); id = "#" + (pins.Count == 0?0:pins.Max(p => int.Parse(p.Id.TrimStart('#'))) + 1); } else { var pin = Pins.FirstOrDefault(p => p.Id == id); if (pin is T tp) { return(tp); } } var newPin = new T { Id = id, Group = this, }; if (type != null) { newPin.ValueType = type; } factory?.Invoke(newPin); Pins.Add(newPin); return(newPin); }
/// <summary> /// Construct a port expander with the supplied number of pins /// </summary> /// <param name="numPins">the number of pins of this port expander</param> public PortExpander(int numPins) { for (var i = 0; i < numPins; i++) { Pins.Add(new PortExpanderPin(this, i)); } }
private void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { if (e.Action == NotifyCollectionChangedAction.Reset) { Pins.Clear(); } if (e.OldItems != null) { foreach (CustomPin pin in e.OldItems) { Pins.Remove(pin.Pin); pin.Pin.PropertyChanged -= OnPropertyChanged; } } if (e.NewItems != null) { foreach (CustomPin pin in e.NewItems) { Pins.Add(pin.Pin); pin.Pin.PropertyChanged += OnPropertyChanged; } } }
public void GetGeolotation() { var position1 = new Position(6.2652880, -75.5098530); var pin1 = new Pin { Type = PinType.Place, Position = position1, Label = "Pin1", Address = "prueba pin1" }; Pins.Add(pin1); var position2 = new Position(6.2652880, -75.4598530); var pin2 = new Pin { Type = PinType.Place, Position = position2, Label = "Pin2", Address = "prueba pin2" }; Pins.Add(pin2); var position3 = new Position(6.2652880, -75.4898530); var pin3 = new Pin { Type = PinType.Place, Position = position3, Label = "Pin3", Address = "prueba pin3" }; Pins.Add(pin3); }
public G_ExportPin() : base(ContentView.GetNextIndex("P")) { Width = 1; Height = 4; Pin = new G_Pin(this, "IN"); Pins.Add(Pin); Direction = Direction.Left; }
/// <summary> /// Construct a new MCP23008 /// </summary> /// <param name="i2c">The I2c bus to use</param> /// <param name="address">The address to use</param> /// <param name="speedKHz">The speed, in KHz, to use</param> public Mcp23008(I2C i2c, byte address, int speedKHz = 100) { dev = new SMBusDevice(address, i2c, speedKHz); for (var i = 0; i < 8; i++) { Pins.Add(new Pin(this, i)); } }
/// <summary> /// Initializes a new instance of the <see cref="SwitchSinglePoleDoubleThrow"/> class. /// </summary> /// <param name="name">The name.</param> public SwitchSinglePoleDoubleThrow(string name) : base(name) { Pins.Add(new[] { "p" }, "The pole pin.", new Vector2(-8, 0), new Vector2(-1, 0)); Pins.Add(new[] { "c", "ctrl" }, "The controlling pin.", new Vector2(0, 6), new Vector2(0, 1)); Pins.Add(new[] { "t1" }, "The first throwing pin.", new Vector2(8, 4), new Vector2(1, 0)); Pins.Add(new[] { "t2" }, "The second throwing pin.", new Vector2(8, -4), new Vector2(1, 0)); }
/// <summary> /// Initializes a new instance of the <see cref="Pmos"/> class. /// </summary> /// <param name="name">The name.</param> public Pmos(string name) : base(name) { Pins.Add(new[] { "d", "drain" }, "The drain.", new Vector2(8, 0), new Vector2(1, 0)); Pins.Add(new[] { "g", "gate" }, "The gate.", new Vector2(0, 11), new Vector2(0, 1)); Pins.Add(new[] { "b", "bulk" }, "The bulk.", new Vector2(0, 0), new Vector2(0, -1)); Pins.Add(new[] { "s", "source" }, "The source.", new Vector2(-8, 0), new Vector2(-1, 0)); }
/// <summary> /// Construct a new PCA9685 /// </summary> /// <param name="i2c">The i2c port this chip is attached to</param> /// <param name="address">The 7-bit address to use</param> /// <param name="speed">The speed, in kHz, to use with this chip</param> public Pca9685(I2C i2c, byte address, int speed = 100) { dev = new SMBusDevice(address, i2c, speed); for (var i = 0; i < 16; i++) { Pins.Add(new Pin(this, i)); } updateConfig(); }
/// <summary> /// Initializes a new instance of the <see cref="Opamp"/> class. /// </summary> /// <param name="name">The name.</param> public Opamp(string name) : base(name) { Pins.Add(new[] { "n" }, "The negative input.", new Vector2(-8, -4), new Vector2(-1, 0)); Pins.Add(new[] { "p" }, "The positive input.", new Vector2(-8, 4), new Vector2(-1, 0)); Pins.Add(new[] { "vn" }, "The power supply on the negative input side.", new Vector2(0, -6), new Vector2(0, -1)); Pins.Add(new[] { "vp" }, "The power supply on the positive input side.", new Vector2(0, 6), new Vector2(0, 1)); Pins.Add(new[] { "o", "out" }, "The output.", new Vector2(8, 0), new Vector2(1, 0)); }
private void OnPropertyChanged(object sender, PropertyChangedEventArgs e) { // We should be able to just replace the changed pin, but rebuild is required to force map refresh Pins.Clear(); foreach (var pin in Items) { Pins.Add(pin.Pin); } }
public ShaderOutputNode(ShaderEditorGraph graph, ShaderOutputDesc desc) : base(graph) { this.CanBeDeleted = false; Pins.Add(new ShaderNodePinDesc(this, null, ShaderNodePinType.TYPE_FLOAT4, 0, "Diffuse", "The Diffuse component of the shader.", false)); Pins.Add(new ShaderNodePinDesc(this, null, ShaderNodePinType.TYPE_FLOAT4, 1, "Emissive", "The Emissive component of the shader", false)); Pins.Add(new ShaderNodePinDesc(this, null, ShaderNodePinType.TYPE_FLOAT, 2, "Roughness", "The Roughness component of the shader.", false)); Pins.Add(new ShaderNodePinDesc(this, null, ShaderNodePinType.TYPE_FLOAT, 3, "Metalness", "The Metalness component of the shader.", false)); Pins.Add(new ShaderNodePinDesc(this, null, ShaderNodePinType.TYPE_FLOAT3, 4, "Normal", "The Normal component of the shader.", false)); }
private void showRoute() { var routePoints = GooglePolylineCoder.DecodeGooglePolyline(webOrder.RouteMetrics); var polyline = new Polyline(); polyline.StrokeColor = Color.Blue; polyline.StrokeWidth = 5f; //polyline.Tag = "POLYLINE"; // Can set any object foreach (var point in routePoints) { polyline.Positions.Add(new Position(point.Lat, point.Lon)); } var positions = routePoints.Select(rp => new Position(rp.Lat, rp.Lon)).ToList(); CenterMapFromPositions = positions; Polylines.Clear(); Polylines.Add(polyline); var startPoint = routePoints.FirstOrDefault(); var endPin = routePoints.LastOrDefault(); var startPin = new Pin { Position = new Position(startPoint.Lat, startPoint.Lon), IsDraggable = false, IsVisible = true, Label = "Старт", Address = webOrder.SrcAddress.StreetOrPlace + ", " + webOrder.SrcAddress.House, Type = PinType.Place }; var assembly = typeof(ConfirmOrderPage).GetTypeInfo().Assembly; var stream = assembly.GetManifestResourceStream($"taxi.Images.start_s.png"); startPin.Icon = BitmapDescriptorFactory.FromStream(stream); var finishPin = new Pin { Position = new Position(endPin.Lat, endPin.Lon), IsDraggable = false, IsVisible = true, Label = "Финиш", Type = PinType.Place, Address = webOrder.DstAddresses[0].StreetOrPlace + ", " + webOrder.DstAddresses[0].House }; stream = assembly.GetManifestResourceStream($"taxi.Images.finish_s.png"); finishPin.Icon = BitmapDescriptorFactory.FromStream(stream); Pins.Add(startPin); Pins.Add(finishPin); }
private async void UpdateListCart(object sender, EventArgs e) { if (Driver.Current == null) { return; } var result = await DataService.GetDriverOrdersOnMap(); if (result == null || result.Status != 0) { return; } Device.BeginInvokeOnMainThread(() => { //list of showing pins in map var availablePins = new List <OrderPin>(); foreach (var r in result.Data) { if (!availableStatus.Contains(r.OrderStatus)) { continue; } var existPin = Pins.FirstOrDefault(x => x.Id == r.OrderId); string namePin = r.OrderStatus == Enums.OrderStatus.NewOrder ? "red_pin" : "green_pin"; if (existPin == null) { existPin = new OrderPin { Id = r.OrderId, Position = new Position(r.Latitude, r.Longitude), Title = "Order No:" + r.OrderId, Image = Device.OnPlatform(namePin, namePin, string.Empty), ShowCallout = true, }; Pins.Add(existPin); } else { existPin.Image = Device.OnPlatform(namePin, namePin, string.Empty); } availablePins.Add(existPin); } //delete older pins for (int i = 0; i < Pins.Count; i++) { if (availablePins.FirstOrDefault(x => x.Id == Pins[i].Id) == null) { if (Pins != null) { Pins.RemoveAt(i); i--; } } } }); }
private void UpdatePins(ref PinsState state, StringBuilder data) { if (data[0] != ' ') { state = PinsState.Idle; } switch (state) { case PinsState.Idle: { if (data[0] == ' ') { break; } var str = BoardUtil.SplitLine(data, 3); if (str[2] == null) { break; } if (str[0] == "Part") { skipPart = false; var part = new Part(); part.Name = str[1]; part.Side = GetSide(str[2]); part.FirstPin = Pins.Count; if (Parts.Count > 0 && part.Name == Parts[Parts.Count - 1].Name) { skipPart = true; break; } Parts.Add(part); state = PinsState.PartPinEntry; } } break; // ' 1 1 0.1138 0.0701 1 MIC_GND 3' case PinsState.PartPinEntry: if (!skipPart) { var str = BoardUtil.SplitLine(data, 6); var pin = new Pin(); //pin.PartIndex = Parts.Count-1; var loc = new Vector2(); loc.X = ParseDouble(str[2]); loc.Y = ParseDouble(str[3]); pin.Location = loc; pin.Name = str[5]; pin.Net = -1; Pins.Add(pin); Parts[Parts.Count - 1].PinCount++; } break; } }
public void UpdatePins(IEnumerable <IMapModel> items) { Pins.Clear(); Items.Clear(); foreach (var item in items) { Items.Add(item); Pins.Add(item.AsPin()); } }
public G_Pulse() : base("Pulse") { Delay = 1; Color_Line = new Color4(0.8f, 0.5f, 0.2f, 1f); Width = 2; Height = 3; Pin = new G_Pin(this, "IN"); Pins.Add(Pin); OnMouseDownEvent += G_Switch_OnMouseDownEvent;; }