示例#1
0
        private void UpdateSensor(double?temp)
        {
            //await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(
            //    CoreDispatcherPriority.Normal,
            //    () =>
            //    {
            //        _output.Text = text;

            //        // Feel free to add more UI stuff here! :-)
            //    });
            SensorUpdated?.Invoke(this, temp?.ToString());
        }
示例#2
0
        private void TDSensorEvent(IntPtr protocol, IntPtr model, int id, int dataType, IntPtr value, int timestamp, int callbackId, IntPtr context)
        {
            string parsedProtocol = Marshal.PtrToStringAnsi(protocol);
            string parsedModel    = Marshal.PtrToStringAnsi(model);
            string parsedValue    = Marshal.PtrToStringAnsi(value);

            SensorUpdateEventArgs eventArgs = new SensorUpdateEventArgs
            {
                Value = new SensorValue
                {
                    SensorID  = id,
                    Type      = (SensorValueType)dataType,
                    Value     = parsedValue,
                    Timestamp = timestamp.ToLocalDateTime()
                }
            };

            SensorUpdated.Trigger(this, eventArgs);
        }
示例#3
0
 private void UpdateSensor(double?temp)
 {
     SensorUpdated?.Invoke(this, temp?.ToString());
 }