private static void BeaconPacketHandler_BeaconDataReceived(BeaconData data) { if (grafanaFileWriter != null) { grafanaFileWriter.AddData(data); } }
public override void SetBeacon(BeaconData beacon) { if (beacon.Type == 21) { currentRainIntensity = beacon.Optional; } }
//---------------------------------------------------- // Has the User Exited the Beacon //---------------------------------------------------- void OnExitBeacon(BeaconData t) { print("See Ya " + t.beaconid); FindObjectOfType <TouchManager>().hideTuner(); //FindObjectOfType<AudioManager>().Stop(t.beaconid); }
/// <summary> /// 地上子を越えたときに呼び出される関数 /// </summary> /// <param name="beacon">車上子で受け取った情報</param> internal override void SetBeacon(BeaconData beacon) { beacon_type_.Add(beacon.Type); beacon_sig_.Add(beacon.Signal.Aspect); beacon_dist_.Add(beacon.Signal.Distance); beacon_opt_.Add(beacon.Optional); }
public async Task <BeaconGeolocation> FindGeolocationByBeaconData(BeaconData beaconData, Map map = null) { if (map == null) { var beaconId = await _mapServiceClient.GetBeaconIdByBeaconDataAsync(beaconData).ConfigureAwait(false); if (beaconId == null) { return(null); } map = await _mapServiceClient.GetMapByBeaconIdAsync(beaconId.Value).ConfigureAwait(false); if (map == null) { return(null); } } var nearestNode = map.Nodes.FirstOrDefault(x => x.BeaconData == beaconData); if (nearestNode == null) { return(null); } return(new BeaconGeolocation( map: map, nearestNode: nearestNode, nearestBeacon: beaconData)); }
/// <summary>Is called when a beacon is passed.</summary> /// <param name="beacon">The beacon data.</param> internal override void SetBeacon(BeaconData beacon) { switch (beacon.Type) { case 30: // --- TASC pattern --- int distance = beacon.Optional / 1000; this.Distance = (double)distance; if (this.State == States.Normal) { this.State = States.Pattern; } break; case 31: // --- TASC home doors --- this.HomeDoors = true; break; case 32: // --- TASC pattern --- int minimumCars = beacon.Optional / 1000000; int maximumCars = (beacon.Optional / 10000) % 100; if (this.Train.Specs.Cars >= minimumCars & this.Train.Specs.Cars <= maximumCars | minimumCars == 0 & maximumCars == 0) { this.Distance = beacon.Optional % 10000; if (this.State == States.Normal) { this.State = States.Pattern; } } break; } }
private void HandleNotify(IntPtr eventDataHandle, MDP_NOTIFY_TYPE nType, IntPtr beaconlogPtr, IntPtr beacondataArray, uint count, IntPtr context) { var data = BeaconData.FromNativePointerArray(beacondataArray, count, _eventData); BeaconLog beaconLog = null; switch (nType) { case MDP_NOTIFY_TYPE.MDP_NOTIFY_SELECT: case MDP_NOTIFY_TYPE.MDP_NOTIFY_INSERT: beaconLog = new BeaconLog(beaconlogPtr, _eventData); Insert(beaconLog, data); break; case MDP_NOTIFY_TYPE.MDP_NOTIFY_CLEAR: Clear(); break; case MDP_NOTIFY_TYPE.MDP_NOTIFY_DELETE: case MDP_NOTIFY_TYPE.MDP_NOTIFY_UPDATE: /* not handled */ break; } if (NotifyHandlers != null) { NotifyHandlers(nType, beaconLog, data, _eventData); } }
internal void SetBeacon(BeaconData beacons) { foreach (Device device in devices.Values) { device.SetBeacon(beacons); } }
public BeaconAdvertisement(BeaconData beaconData, sbyte txPower, short rssi, DateTimeOffset timestamp) { BeaconData = beaconData; TxPower = txPower; Rssi = rssi; Timestamp = timestamp; }
protected override void SetBeacon(BeaconData beacon) { if (AI != null) { AI.SetBeacon(beacon); } pipeProxy.SetBeacon(beacon); }
// --- static functions --- /// <summary>Gets the frequency a beacon is transmitting at, or 0 if not recognized.</summary> /// <param name="beacon">The beacon.</param> /// <returns>The frequency the beacon is transmitting at, or 0 if not recognized.</returns> internal static int GetFrequencyFromBeacon(BeaconData beacon) { /* * Frequency-based beacons encode the frequency as the * beacon type in KHz and have the following optional data: * * siii * |\_/ * | \- idle frequency (KHz) * \--- signal aspect * * or * * -1 * always active * * If the aspect of the signal the beacon is attached to * matches the aspect encoded in the optional data, the * beacon transmits at its active frequency. Otherwise, * the beacon transmits at its idle frequency. * * If the optional data is -1, the beacon always transmits * at its active frequency. * */ if (beacon.Type >= 73) { if (beacon.Optional == -1) { return(beacon.Type); } else { int beaconAspect = beacon.Optional / 1000; if (beaconAspect >= 10) { beaconAspect = 0; } int signalAspect = beacon.Signal.Aspect; if (signalAspect >= 10) { signalAspect = 0; } if (beaconAspect == signalAspect) { return(beacon.Type); } else { int idle = beacon.Optional % 1000; return(idle); } } } else { return(0); } }
public void SetBeacon(BeaconData beacon) { ATSPlugin.Cpp.ATS_BEACONDATA beaconData = new ATSPlugin.Cpp.ATS_BEACONDATA(); beaconData.Signal = beacon.Signal.Aspect; beaconData.Type = beacon.Type; beaconData.Distance = (float)beacon.Signal.Distance; beaconData.Optional = beacon.Optional; ATSPlugin.Cpp.SetBeaconData(beaconData); }
public Node(int id, string title, string description, BeaconData beaconData, NodeType type, PointU position, int navigationId) { Id = id; Title = title; Description = description; BeaconData = beaconData; Type = type; Position = position; NavigationId = navigationId; }
// --- private functions --- /// <summary>Updates the location of the farthest known red signal from the specified beacon.</summary> /// <param name="beacon">The beacon that holds the distance to a known red signal.</param> private void UpdateRedSignalLocation(BeaconData beacon) { if (beacon.Signal.Distance < 1200.0) { double signalLocation = this.Train.State.Location + beacon.Signal.Distance; if (signalLocation > this.RedSignalLocation) { this.RedSignalLocation = signalLocation; } } }
/// <summary> /// 地上子を越えたときに呼び出される関数 /// </summary> /// <param name="beacon">車上子で受け取った情報</param> internal override void SetBeacon(BeaconData beacon) { switch (beacon.Type) { case 100: SetAdjLoc(beacon.Optional); break; default: break; } }
internal override void SetBeacon(BeaconData beacon) { if (beacon.Type == 33) //Distance to stop point { atoReceivedData = beacon.Optional; } //Central Line ATP if (beacon.Type == 6) { atoReceivedData = beacon.Optional % 1000; } }
protected override void SetBeacon(BeaconData beacon) { try { Win32BeaconData win32Beacon; win32Beacon.Type = beacon.Type; win32Beacon.Signal = beacon.Signal.Aspect; win32Beacon.Distance = (float)beacon.Signal.Distance; win32Beacon.Optional = beacon.Optional; Win32SetBeaconData(ref win32Beacon.Type); } catch (Exception ex) { base.LastException = ex; throw; } }
// Use this for initialization void Start() { estimoteBeaconData = new List <BeaconData>(); estimoteUnity = FindObjectOfType <EstimoteUnity>(); if (estimoteUnity == null) { GameObject go = Instantiate(Resources.Load("EstimoteUnity") as GameObject); estimoteUnity = go.GetComponent <EstimoteUnity>(); } nullBeaconData = new BeaconData(-1, -1, null); estimoteUnity.OnDidRangeBeacons += RecordBeaconData; //start scanning after a second Invoke("StartScanning", 1); }
protected override void SetBeacon(BeaconData beacon) { #if !DEBUG try { #endif this.Api.SetBeacon(beacon); #if !DEBUG } catch (Exception ex) { base.LastException = ex; throw; } #endif }
internal static void ProcessBeacon(BeaconData beacon, int[] panel) { if (beacon.Type >= 0) { if (beacon.Type == SpeedLimit) { SafetySystem.SpeedLimit = beacon.Optional; } else { PanelManager.OnBeacon(beacon.Type, panel); ATSSoundManager.OnBeacon(beacon.Type); } } }
public void OnNext(BeaconScanResult value) { var list = value.Signals.Where(s => s.Rssi >= RssiTreshold) .Select(b => BeaconData.FromAddress(b.UUID) .Add(new BeaconItem[] { new BeaconItem { Rssi = b.Rssi, Time = value.Time } })); foreach (var s in list) { telemetry.Append(s); } ranger.OnNext(telemetry); }
public async Task <int?> GetBeaconIdByBeaconDataAsync(BeaconData beaconId) { var response = await _httpClient.GetAsync($"/json?action=getBeaconId&uuid={beaconId.Uuid}&major={beaconId.Major}&minor={beaconId.Minor}").ConfigureAwait(false); if (response.StatusCode == HttpStatusCode.NotFound) { return(null); } var responseString = await response.Content.ReadAsStringAsync().ConfigureAwait(false); var beaconIdDto = JsonConvert.DeserializeObject <BeaconIdDto>(responseString); return(beaconIdDto.BeaconId); }
/// <summary> /// コンストラクタ /// </summary> public CommanderMonitor() { this.Beacon = new List <BeaconData>(); for (int index = 0; index < 3; index++) { BeaconData beacon = new BeaconData(); this.Beacon.Add(beacon); } this.MelodyMode = new MelodyMode(); this.LightMode = new LightMode(); this.LastStartDate = new DateTimeData(); this.CurrentSequence = new SequenceType(); this.MapMovedValue = new IntStatus(); this.SystemError = new ErrorState(); }
public void SetBeacon(BeaconData beacon) { try { Win32BeaconData win32Beacon; win32Beacon.Type = beacon.Type; win32Beacon.Signal = beacon.Signal.Aspect; win32Beacon.Distance = (float)beacon.Signal.Distance; win32Beacon.Optional = beacon.Optional; Win32SetBeaconData(ref win32Beacon.Type); } catch (Exception ex) { Callback.ReportError(ex.ToString()); } }
internal override void SetBeacon(BeaconData beacon) { // if (this.Train == TrainManager.PlayerTrain) { // Game.AddDebugMessage("beacon signal aspect " + beacon.Signal.Aspect.ToString(), 3.0); // Game.AddDebugMessage("Beacon, type=" + beacon.Type.ToString() + ", data=" + beacon.Optional.ToString(), 3.0); // } try { this.Api.SetBeacon(beacon); } catch (Exception ex) { base.LastException = ex; throw; } }
internal override void SetBeacon(BeaconData beacon) { if (beacon.Type == 31) //Target and safety track speeds { train.atpTrackTargetSpeed = (int)(beacon.Optional / 1000); train.atpTrackSafetySpeed = (int)(beacon.Optional % 1000); } if (beacon.Type == 32) //Upcoming target and safety track speeds { train.atpTrackNextSpeedPosition = (int)(beacon.Optional / 1000000) + currentLocation; train.atpTrackNextTargetSpeed = (int)((int)(beacon.Optional / 1000) % 1000); train.atpTrackNextSafetySpeed = (int)(beacon.Optional % 1000); } if (beacon.Type == 33) //Distance to stop point { upcomingStopLocation = beacon.Optional + currentLocation; } }
/// <summary>Is called when a beacon is passed.</summary> /// <param name="beacon">The beacon data.</param> internal override void SetBeacon(BeaconData beacon) { if (this.State != States.Disabled & this.State != States.Initializing) { switch (beacon.Type) { case 0: // --- Sx long --- if (beacon.Signal.Aspect == 0) { if (this.State == States.Chime | this.State == States.Normal) { this.AlarmCountdown = DurationOfAlarm; this.State = States.Alarm; UpdateRedSignalLocation(beacon); } } break; case 1: // --- Sx immediate stop --- if (beacon.Signal.Aspect == 0) { if (this.State == States.Chime | this.State == States.Normal | this.State == States.Alarm) { this.State = States.Emergency; } } break; case 2: // --- accidental departure --- if (beacon.Signal.Aspect == 0 & (beacon.Optional == 0 | beacon.Optional >= this.Train.Specs.Cars)) { if (this.State == States.Chime | this.State == States.Normal | this.State == States.Alarm) { this.State = States.Emergency; } } break; } } }