/// <summary> /// Constructor /// </summary> static MultiplyOperation() { PinDescriptor src1 = new PinDescriptor(BinaryMathOperation.AllFormats, "Operand 1 (Left)"); PinDescriptor src2 = new PinDescriptor(BinaryMathOperation.AllFormats, "Operand 2 (Right)"); IPinRelation req = new PinMultipliable(src1, src2); inputDesc = new PinsDescriptor(req, src1, src2); }
static CompareOperation() { PinDescriptor in1 = new PinDescriptor(ComparableFormat, "First operand of compare."); PinDescriptor in2 = new PinDescriptor(ComparableFormat, "Second operand of compare."); inputDesc = new PinsDescriptor( new PinEqual(in1, in2), in1, in2); }
static BranchOperation() { PinDescriptor b = new PinDescriptor(PinFormat.Bool, "Branch value."); PinDescriptor in1 = new PinDescriptor(AllFormats, "True branch value."); PinDescriptor in2 = new PinDescriptor(AllFormats, "False branch value."); inputDesc = new PinsDescriptor( new PinEqual(in1, in2), in1, in2); }
/// <summary> /// A static constructor. /// </summary> static BinaryMathOperation() { // Input descriptor. PinDescriptor in1 = new PinDescriptor(BinaryMathOperation.AllFormats, "Source 1"); PinDescriptor in2 = new PinDescriptor(BinaryMathOperation.AllFormats, "Source 2"); IPinRelation req = new PinEqual(in1, in2); InputDesc = new PinsDescriptor(req, in1, in2); }
/// <summary> /// A static constructor. /// </summary> static DotProductOperation() { // Input descriptor. PinDescriptor in1 = new PinDescriptor(DotProductOperation.InputFormats, "Source 1"); PinDescriptor in2 = new PinDescriptor(DotProductOperation.InputFormats, "Source 2"); IPinRelation req = new PinEqual(in1, in2); InputDesc = new PinsDescriptor(req, in1, in2); }
private bool CheckVisiblePinByTags(PinDescriptor pin) { bool byMyMarker, byWifi, byNowOpen; byNowOpen = !NowOpenSelected || pin.NowOpen; byWifi = !WifiSelected || pin.WiFi; byMyMarker = !pin.Personal || MyMarkerSelected; return(byMyMarker && byWifi && byNowOpen); }
public void BindInputs(params Pin[] pins) { // We validate. InputDescriptor.ValidateThrow(pins); // We bind them. inputs = new SortedList <PinComponent, Pin>(); for (uint i = 0; i < InputDescriptor.Count; i++) { PinDescriptor desc = InputDescriptor[i]; inputs.Add(desc.Component, pins[i]); } }
public void LoadPins(MapSpan region) { if (ApplicationSettings.LoadingMarkers || !ApplicationSettings.PinCategories.Any()) { return; } Device.BeginInvokeOnMainThread(() => { ApplicationSettings.LoadingMarkers = true; }); var p1 = new Position(region.Center.Latitude + region.LatitudeDegrees, region.Center.Longitude - region.LongitudeDegrees); var p2 = new Position(region.Center.Latitude - region.LatitudeDegrees, region.Center.Longitude + region.LongitudeDegrees); var categories = ApplicationSettings.GetAllCAtegories(); var pinToRemove = ApplicationSettings.LoadedPins.Pins.Where(p => p.Personal).ToList(); foreach (var item in pinToRemove) { item.IsVisible = false; ApplicationSettings.LoadedPins.Pins.Remove(item); } var fromServer = ApplicationSettings.Service.GetSessionMarkers(p1, p2); var pinsFromServer = fromServer.Select( item => { var rootCategory = categories.FirstOrDefault(c => c.Id == item.CategoriesBranch.LastOrDefault()); var baseCategory = categories.FirstOrDefault(c => c.Id == item.CategoriesBranch.FirstOrDefault()); var pin = new PinDescriptor(item) { Pin = { DefaultPinColor = rootCategory?.Color ?? CustomColors.Orange, Subtitle = rootCategory?.Name ?? string.Empty, Type = baseCategory?.Name ?? string.Empty } }; return(pin); }); ApplicationSettings.LoadedPins.Pins.AddRange( pinsFromServer.Where(pfs => ApplicationSettings.LoadedPins.Pins.All(lp => lp.Pin.Id != pfs.Pin.Id))); ApplicationSettings.LoadedPins.MapRegions.Add(region); Device.BeginInvokeOnMainThread(() => { ApplicationSettings.LoadingMarkers = false; }); UpdatePinsVisible(); }
static LoadOperation() { PinDescriptor texture = new PinDescriptor(new PinFormat[] { PinFormat.Texture1D, PinFormat.BufferTexture, PinFormat.Texture1DArray, PinFormat.Texture2D, PinFormat.Texture2DArray, PinFormat.Texture3D }, "Texture"); PinDescriptor addr = new PinDescriptor(new PinFormat[] { PinFormat.Integerx2, PinFormat.Integerx3, PinFormat.Integerx4 }, "Address"); PinDescriptor offset = new PinDescriptor(new PinFormat[] { PinFormat.Integer, PinFormat.Integerx2, PinFormat.Integerx3 }, true, "Offset"); inputDesc = new PinsDescriptor(new IPinRelation[] { new PinTextureMipmappedAddressable(texture, addr), new PinTextureAddressable(texture, offset), }, texture, addr, offset); }
static SampleOperation() { PinDescriptor sampler = new PinDescriptor(PinFormat.Sampler, "Sampler"); PinDescriptor texture = new PinDescriptor(new PinFormat[] { PinFormat.Texture1D, PinFormat.BufferTexture, PinFormat.Texture1DArray, PinFormat.Texture2D, PinFormat.Texture2DArray, PinFormat.Texture3D }, "Texture"); PinDescriptor addr = new PinDescriptor(new PinFormat[] { PinFormat.Float, PinFormat.Floatx2, PinFormat.Floatx3 }, "Address"); PinDescriptor offset = new PinDescriptor(new PinFormat[] { PinFormat.Integer, PinFormat.Integerx2, PinFormat.Integerx3 }, true, "Offset"); inputDesc = new PinsDescriptor(new IPinRelation[] { new PinTextureAddressable(texture, addr), new PinTextureAddressable(texture, offset), }, sampler, texture, addr, offset); }