private void monitorSensors(object sender, SensorStatus s) { // Get sensor status setPanelStatus(CycliInterface.Instance().Hrm, hrmPanel); setPanelStatus(CycliInterface.Instance().SpeedCadence, spcdPanel); setPanelStatus(CycliInterface.Instance().Power, powerPanel); }
private void buttonTouch_Click(object sender, RoutedEventArgs e) { if (sensorStatus == SensorStatus.Still) { buttonTouch.Content = "Touching..."; sensorStatus = SensorStatus.Touching; lastTargetTemp = int.Parse(tbTT.Text); tbTT.Text = "34"; } else { buttonTouch.Content = "Touch"; sensorStatus = SensorStatus.Still; tbTT.Text = lastTargetTemp.ToString(); } }
public void OnAccuracyChanged(Android.Hardware.Sensor sensor, SensorStatus accuracy) { }
private void DeviceOnConnected() { status = SensorStatus.CONNECTED; }
//----------------- Constructor and its attributes -----------------// public Elevator(int elevatorId, int elevatorservedFloors, int elevatorFloor, ElevatorStatus elevatorStatus, SensorStatus weightStatus, SensorStatus obstructionStatus, Column elevatorColumn) { id = elevatorId; servedFloors = elevatorservedFloors; floor = elevatorFloor; status = elevatorStatus; weightSensorStatus = weightStatus; obstructionSensorStatus = obstructionStatus; column = elevatorColumn; elevatorDoor = new Door(0, DoorStatus.CLOSED, 0); elevatorDisplay = new Display(0, DisplayStatus.ON, 0); floorDoorsList = new List <Door>(); floorDisplaysList = new List <Display>(); floorRequestButtonsList = new List <Button>(); floorRequestList = new List <int>(); this.createFloorDoorsList(); this.createDisplaysList(); this.createfloorRequestButtonsList(); }
public void OnAccuracyChanged(Sensor sensor, SensorStatus accuracy) { // We don't want to do anything here. }
public void OnAccuracyChanged (Sensor sensor, SensorStatus accuracy) { // throw new NotImplementedException (); }
public void OnAccuracyChanged(Sensor sensor, SensorStatus accuracy) { //Noop }
public void OnAccuracyChanged(Sensor sensor, SensorStatus status) { //do nothing }
public void LoadDataSetting() { var PManager = PreferenceManager.GetDefaultSharedPreferences(this); Color ColorActionBar = Color.ParseColor("#ff4500"); string Theme = PManager.GetString("Theme", "نارنجی-قرمز"); switch (Theme) { case "سبز کبریتی": ColorActionBar = Color.ParseColor("#008b8b"); break; case "نارنجی-قرمز": ColorActionBar = Color.ParseColor("#ff4500"); break; case "خردلی": ColorActionBar = Color.ParseColor("#daa520"); break; case "عسلی پررنگ": ColorActionBar = Color.ParseColor("#d2691e"); break; default: break; } ActionBar.SetBackgroundDrawable(new Android.Graphics.Drawables.ColorDrawable(ColorActionBar)); BtnVPG.Background.SetColorFilter(Color.ParseColor("#808080"), PorterDuff.Mode.Multiply); BtnVPS.Background.SetColorFilter(Color.ParseColor("#808080"), PorterDuff.Mode.Multiply); BtnVPG.SetTextColor(Color.White); BtnVPS.SetTextColor(Color.White); try { bool OnOffDisplay = PManager.GetBoolean("PowerManager", false); if (OnOffDisplay == true) { WLock = dfpowermanager.NewWakeLock(WakeLockFlags.Full, "DoNotSleep"); WLock.Acquire(); } } catch (Exception) { Toast.MakeText(this, "Error Power manager", ToastLength.Short).Show(); } AutoCVib = PManager.GetBoolean("Vibrator", false); AutoCHieght = PManager.GetBoolean("HeightSeng", false); string SmfSpeed = PManager.GetString("SpeedSensor", "متوسط"); switch (SmfSpeed) { case "کم": AutoHanSpeedSensor = SensorStatus.AccuracyLow; break; case "متوسط": AutoHanSpeedSensor = SensorStatus.AccuracyMedium; break; case "زیاد": AutoHanSpeedSensor = SensorStatus.AccuracyHigh; break; default: break; } string SmfPower = PManager.GetString("PowerSensor", "متوسط"); switch (SmfPower) { case "کم": AutoPowerSensor = 1; break; case "متوسط": AutoPowerSensor = 1.1; break; case "زیاد": AutoPowerSensor = 1.25; break; default: break; } string SmfSens = PManager.GetString("SenSensor", "متوسط"); switch (SmfSens) { case "کم": AutoSenSensor = 80; break; case "متوسط": AutoSenSensor = 70; break; case "زیاد": AutoSenSensor = 60; break; case "خیلی کم": AutoSenSensor = 90; break; case "خیلی زیاد": AutoSenSensor = 50; break; default: break; } AutoSRotbat = PManager.GetBoolean("Rotobat", false); string TepWH = PManager.GetString("TepWork", "متعادل"); switch (TepWH) { case "گرم": AutoTypeWork = ETepWork.Low; break; case "متعادل": AutoTypeWork = ETepWork.Medium; break; case "سرد": AutoTypeWork = ETepWork.Top; break; default: break; } string TKh = PManager.GetString("TypeKhak", "معمولی"); switch (TKh) { case "نرم": AutoTypeKhak = ETypeKhak.Low; break; case "معمولی": AutoTypeKhak = ETypeKhak.Medium; break; case "سفت": AutoTypeKhak = ETypeKhak.Top; break; default: break; } }
private void SensorServer_OnSensorStatusEvent(SensorStatus sensorStatus) { _sensorStatusQ.Add(sensorStatus); }
public void OnAccuracyChanged(Sensor sensor, SensorStatus accuracy) { // accuracy に変更があった時の処理 }
public void OnAccuracyChanged (Sensor sensor, SensorStatus accuracy) { Log.Info ("SensorManager", "Sensor accuracy changed"); }
private void InitWorker() { IAsyncAction asyncAction = Windows.System.Threading.ThreadPool.RunAsync( async(workItem) => { int work_index = 0; int distance = 0, sound = 0, light = 0, rotary = 0; SensorStatus button = SensorStatus.Off; SensorStatus buzzer = SensorStatus.Off; while (true) { if (work_index < 5) { rotary = GroveRotary.SensorValue(); button = GroveButton.CurrentState; // RotaryValue = rotary; int level = RotaryValue / 100; if (level > 10) { level = 10; } GroveLedBar.SetLevel((byte)level); buzzer = GroveBuzzer.CurrentState; if (RotaryValue > 1000) { if (buzzer != SensorStatus.On) { GroveBuzzer.ChangeState(SensorStatus.On); } } else { if (buzzer != SensorStatus.Off) { GroveBuzzer.ChangeState(SensorStatus.Off); } } if (button == SensorStatus.On) { RelayOnOff = 1; GroveRelay.ChangeState(SensorStatus.On); } else { RelayOnOff = 0; GroveRelay.ChangeState(SensorStatus.Off); } work_index++; } else { // Read temp & humidity GroveTempHumi.Measure(); LastTemp = GroveTempHumi.TemperatureInCelsius; LastHumi = GroveTempHumi.Humidity; distance = GroveRanger.MeasureInCentimeters(); //System.Diagnostics.Debug.WriteLine(distance); sound = GroveSound.SensorValue(); //System.Diagnostics.Debug.WriteLine(sound); light = GroveLight.SensorValue(); //System.Diagnostics.Debug.WriteLine(light); if (distance > 0 && distance < 100) { ShiftLeft(DistanceList, distance); } ShiftLeft(SoundList, sound); ShiftLeft(LightList, light); work_index = 0; } await Dispatcher.RunAsync( CoreDispatcherPriority.High, () => { if (work_index == 0) { UpdataUISlow(); } else { UpdateUIFast(); } }); //Delay.Milliseconds(100); } } ); }
public void OnAccuracyChanged (Sensor sensor, SensorStatus accuracy) { if (OnAccuracyChangedAction != null) OnAccuracyChangedAction (sensor, accuracy); }
//========================================================================= //===============Methods for Step Detector Sensor Use====================== public void OnAccuracyChanged(Sensor sensor, SensorStatus accuracy) { //We don't do anything here because accuracy isn't changing }
public void OnAccuracyChanged(Sensor sensor, SensorStatus accuracy) { if (sensor.Type == SensorType.MagneticField) { HasInterference = (accuracy < SensorStatus.AccuracyHigh); notifyAccuracyChanged(); } }
//SENSOR LISTENER STUFF public void OnAccuracyChanged(Sensor sensor, [GeneratedEnum] SensorStatus accuracy) { //SensorStatus.Unreliable }
public void OnAccuracyChanged(Sensor sensor, [GeneratedEnum] SensorStatus accuracy) { Log.Error("OnAccuracyChanged=", "OnAccuracyChanged"); }
/// <summary> /// Consume a packet from the buffer if possible, then advance the buffer index. /// </summary> /// <param name="buffer">Byte buffer to decode</param> /// <param name="index">(Ref) Index to read into buffer</param> /// <exception cref="WearableProxyProtocolException">Thrown when a packet cannot be decoded and the buffer /// must be discarded.</exception> /// <exception cref="IndexOutOfRangeException">Thrown when a packet was partially consumed but ran out of /// buffer contents.</exception> public override void ProcessPacket(byte[] buffer, ref int index) { PacketTypeCode packetType = DecodePacketType(buffer, ref index); switch (packetType) { case PacketTypeCode.KeepAlive: { CheckFooter(buffer, ref index); if (KeepAlive != null) { KeepAlive.Invoke(); } break; } case PacketTypeCode.PingQuery: { CheckFooter(buffer, ref index); if (PingQuery != null) { PingQuery.Invoke(); } break; } case PacketTypeCode.PingResponse: { CheckFooter(buffer, ref index); if (PingResponse != null) { PingResponse.Invoke(); } break; } case PacketTypeCode.SensorFrame: { SensorFrame frame = DecodeSensorFrame(buffer, ref index); CheckFooter(buffer, ref index); if (NewSensorFrame != null) { NewSensorFrame.Invoke(frame); } break; } case PacketTypeCode.DeviceList: { Device[] devices = DecodeDeviceList(buffer, ref index); CheckFooter(buffer, ref index); if (DeviceList != null) { DeviceList.Invoke(devices); } break; } case PacketTypeCode.ConnectionStatus: { Device? device; ConnectionState status = DecodeConnectionStatus(buffer, ref index, out device); CheckFooter(buffer, ref index); if (ConnectionStatus != null) { ConnectionStatus.Invoke(status, device); } break; } case PacketTypeCode.SensorStatus: { bool enabled; SensorId sensor = DecodeSensorStatus(buffer, ref index, out enabled); CheckFooter(buffer, ref index); if (SensorStatus != null) { SensorStatus.Invoke(sensor, enabled); } break; } case PacketTypeCode.UpdateIntervalValue: { SensorUpdateInterval rate = DecodeUpdateInterval(buffer, ref index); CheckFooter(buffer, ref index); if (SensorUpdateIntervalValue != null) { SensorUpdateIntervalValue.Invoke(rate); } break; } case PacketTypeCode.GestureStatus: { bool enabled; GestureId gesture = DecodeGestureStatus(buffer, ref index, out enabled); CheckFooter(buffer, ref index); if (GestureStatus != null) { GestureStatus.Invoke(gesture, enabled); } break; } case PacketTypeCode.RotationSourceValue: { RotationSensorSource source = DecodeRotationSource(buffer, ref index); CheckFooter(buffer, ref index); if (RotationSourceValue != null) { RotationSourceValue.Invoke(source); } break; } case PacketTypeCode.SensorControl: case PacketTypeCode.SetRssiFilter: case PacketTypeCode.InitiateDeviceSearch: case PacketTypeCode.StopDeviceSearch: case PacketTypeCode.ConnectToDevice: case PacketTypeCode.DisconnectFromDevice: case PacketTypeCode.QueryConnectionStatus: case PacketTypeCode.QueryUpdateInterval: case PacketTypeCode.SetUpdateInterval: case PacketTypeCode.QuerySensorStatus: case PacketTypeCode.GestureControl: case PacketTypeCode.QueryRotationSource: case PacketTypeCode.SetRotationSource: // This is a known, but contextually-invalid packet type throw new WearableProxyProtocolException(WearableConstants.ProxyProviderInvalidPacketError); default: // This is an unknown or invalid packet type throw new WearableProxyProtocolException(WearableConstants.ProxyProviderInvalidPacketError); } }
void ISensorEventListener.OnAccuracyChanged(Sensor sensor, [GeneratedEnum] SensorStatus accuracy) { }
protected void OnSensorStatusChanged(SensorStatus s) { SensorStatusChangedHandler handler = SensorStatusChanged; if (handler != null) handler(this, s); }
public void OnAccuracyChanged(Sensor sensor, SensorStatus accuracy) { //nothing to do }
public TSensorType ChangeState(SensorStatus newState) { Device.DigitalWrite(Pin, (byte)newState); return(this as TSensorType); }
public void OnAccuracyChanged(Sensor Sensor, SensorStatus accuracy) { accelStrength = (TextView)FindViewById(Resource.Id.accelStrength); //Correlate to ENUMS later... for now just display strong... }
public void OnAccuracyChanged(Sensor Sensor, SensorStatus accuracy) { }
public void OnAccuracyChanged (Sensor sensor, SensorStatus status) { if (sensor == _compass) { } }
public void OnPressureAccuracyChanged(Sensor sensor, [GeneratedEnum] SensorStatus accuracy) { Log.Debug(TAG, "accuracy changed: " + accuracy); }
private void DeviceOnDisConnected() { this.value = "N/A"; status = SensorStatus.DISCONNECTED; }
public void OnAccuracyChanged(Sensor sensor, SensorStatus accuracy) { Log.Info("SensorManager", "Sensor accuracy changed"); }
public void OnAccuracyChanged(Sensor sensor, SensorStatus status) { }
public void OnAccuracyChanged(Sensor sensor, SensorStatus accuracy) { // ignored }
public ILedBar SetLed(byte level, byte led, SensorStatus state) { var buffer = new[] {SetOneCommandAddress, (byte) _pin, led, (byte) state}; _device.DirectAccess.Write(buffer); return this; }
void ISensorEventListener.OnAccuracyChanged(Sensor _, [GeneratedEnum] SensorStatus __) { }
private void OnTick(object sender, object e) { try { // Check the value of the button. string buttonon = button.CurrentState.ToString(); // bool buttonison = buttonon.Equals("On", StringComparison.OrdinalIgnoreCase); System.Diagnostics.Debug.WriteLine("Button is " + buttonon); } catch (Exception ex) { // NOTE: There are frequent exceptions of the following: // WinRT information: Unexpected number of bytes was transferred. Expected: '. Actual: '. // This appears to be caused by the rapid frequency of writes to the GPIO // These are being swallowed here/ // If you want to see the exceptions uncomment the following: // System.Diagnostics.Debug.WriteLine(ex.ToString()); } try { System.Diagnostics.Debug.WriteLine("Brightness: " + brightness.ToString()); // Check the brightness, if it's going to overflow, reset it. if (brightness > 250) { brightness = 0; } // Increase the brightness by 5 points. brightness = brightness + 5; // Write the values to the three LEDs. // USA! Red, White, and Blue! Led1.AnalogWrite(Convert.ToByte(brightness)); } catch (Exception ex) { // NOTE: There are frequent exceptions of the following: // WinRT information: Unexpected number of bytes was transferred. Expected: '. Actual: '. // This appears to be caused by the rapid frequency of writes to the GPIO // These are being swallowed here/ // If you want to see the exceptions uncomment the following: // System.Diagnostics.Debug.WriteLine(ex.ToString()); } try { // Check the value of the button. string buttonon = button.CurrentState.ToString(); bool buttonison = buttonon.Equals("On", StringComparison.OrdinalIgnoreCase); // Check the state of the buzzer. This is just to output to debug! SensorStatus status = buzzer.CurrentState; bool buzzeron = status.ToString().Equals("On", StringComparison.OrdinalIgnoreCase); // Print out Diagnostics. System.Diagnostics.Debug.WriteLine("Button is " + buttonon); System.Diagnostics.Debug.WriteLine("Buzzer is " + status.ToString()); // If the Button is on . . . . if (buttonison) { buzzer.ChangeState(GrovePi.Sensors.SensorStatus.On); } else { buzzer.ChangeState(GrovePi.Sensors.SensorStatus.Off); } try { // Check the value of the button, turn it into a string. string sensorvalue = light1.SensorValue().ToString(); System.Diagnostics.Debug.WriteLine("light is " + sensorvalue); } catch (Exception ex) { // NOTE: There are frequent exceptions of the following: // WinRT information: Unexpected number of bytes was transferred. Expected: '. Actual: '. // This appears to be caused by the rapid frequency of writes to the GPIO // These are being swallowed here/ // If you want to see the exceptions uncomment the following: // System.Diagnostics.Debug.WriteLine(ex.ToString()); } } catch (Exception ex) { // NOTE: There are frequent exceptions of the following: // WinRT information: Unexpected number of bytes was transferred. Expected: '. Actual: '. // This appears to be caused by the rapid frequency of writes to the GPIO // These are being swallowed here/ // If you want to see the exceptions uncomment the following: // System.Diagnostics.Debug.WriteLine(ex.ToString()); } //Task.Delay(100).Wait(); // Delay 0.1 second // We need to make sure we delay here. If we don't, we won't be able to read // the LCD Screen. try { // First, output to the LCD Display. display.SetText("Light:" + light1.SensorValue()).SetBacklightRgb(255, 50, 255); // Then output to the debug window. System.Diagnostics.Debug.WriteLine("Hello from Dexter Industries!"); } catch (Exception ex) { // NOTE: There are frequent exceptions of the following: // WinRT information: Unexpected number of bytes was transferred. Expected: '. Actual: '. // This appears to be caused by the rapid frequency of writes to the GPIO // These are being swallowed here/ // If you want to see the exceptions uncomment the following: // System.Diagnostics.Debug.WriteLine(ex.ToString()); } try { // Check the value of the Ultrasonic Sensor string sensorvalue = distance1.MeasureInCentimeters().ToString(); System.Diagnostics.Debug.WriteLine("Ultrasonic reads " + sensorvalue); } catch (Exception ex) { // NOTE: There are frequent exceptions of the following: // WinRT information: Unexpected number of bytes was transferred. Expected: '. Actual: '. // This appears to be caused by the rapid frequency of writes to the GPIO // These are being swallowed here/ // If you want to see the exceptions uncomment the following: // System.Diagnostics.Debug.WriteLine(ex.ToString()); } }
void ISensorEventListener.OnAccuracyChanged(Sensor sensor, SensorStatus accuracy) { }
protected void OnSensorStatusChanged(SensorStatus s) { SensorStatusChangedHandler handler = SensorStatusChanged; SensorStatusEventArgs e = new SensorStatusEventArgs(); e.Status = s; if (handler != null) handler(this, e); }
/// <summary> /// Called when the accuracy of a sensor has changed. /// </summary> /// <param name="sensor">To be added.</param> /// <param name="accuracy">The new accuracy of this sensor</param> /// <since version="Added in API level 3" /> /// <remarks> /// <para tool="javadoc-to-mdoc"> /// Called when the accuracy of a sensor has changed. /// </para> /// <para tool="javadoc-to-mdoc"> /// See /// <c> /// <see cref="T:Android.Hardware.SensorManager" /> /// </c> /// for details. /// </para> /// <para tool="javadoc-to-mdoc"> /// <format type="text/html"> /// <a /// href="http://developer.android.com/reference/android/hardware/SensorEventListener.html#onAccuracyChanged(android.hardware.Sensor, int)" /// target="_blank"> /// [Android Documentation] /// </a> /// </format> /// </para> /// </remarks> void ISensorEventListener.OnAccuracyChanged(Sensor sensor, SensorStatus accuracy) { // throw new NotImplementedException (); }
public void OnAccuracyChanged(Sensor sensor, [GeneratedEnum] SensorStatus accuracy) { //doesn't have to do anything? }
public void OnAccuracyChanged(Sensor sensor, [GeneratedEnum] SensorStatus accuracy) { }
public void OnAccuracyChanged(Sensor sensor, [GeneratedEnum] SensorStatus accuracy) { //throw new NotImplementedException(); }
public void OnAccuracyChanged(Sensor sensor, SensorStatus accuracy) { if (_sensorAccuracyChangedCallback != null) _sensorAccuracyChangedCallback(accuracy); }
public void OnAccuracyChanged(Sensor sensor, SensorStatus accuracy) { //do nothing }
public void OnAccuracyChanged (Sensor sensor, SensorStatus accuracy) { //do nothing here }
public void OnAccuracyChanged(Sensor sensor, [GeneratedEnum] SensorStatus accuracy) { //System.Diagnostics.Debug.WriteLine(accuracy); }
public void OnAccuracyChanged(Sensor sensor, [GeneratedEnum] SensorStatus accuracy) => AccuracyChangedHandler?.Invoke(sensor, accuracy);
/// <summary> /// Updates the List. /// </summary> private void updateSensorList() { double top = 0; foreach (DataTable table in set.Tables) { foreach (DataRow row in table.Rows) { Sensor[] senses = SensorManager.getAllSensors(); Sensor sens = (Sensor)row.ItemArray[2]; Boolean inList = false; SensorStatus status = SensorStatus.AVAILABLE; //Check if Sensor is in CurrentlyConnectedList foreach (Sensor sin in senses) { if (sin.getIdentifier().Equals(sens.getIdentifier())) { inList = true; break; } } if (!inList) { status = SensorStatus.AVAILABLE; } else { DataRow found = assigned.Rows.Find(sens.getIdentifier()); object[] array = found.ItemArray; array[1] = true; found.ItemArray = array; sens = (Sensor)array[2]; status = SensorStatus.CONNECTED; } SensorListItem listItem = new SensorListItem(sens); //listItem.setStatus(status); //listItem.Location = new System.Drawing.Point(0, top); top += listItem.Height + 10; listItem.MouseLeftButtonUp += new MouseButtonEventHandler(SensorListItemCLick); //listItem.MouseClick += new MouseEventHandler(ClickListItem); this.Panel.Children.Add(listItem); } } foreach (DataRow row in assigned.Rows) { if (!(Boolean)row.ItemArray[1]) { Sensor sens = (Sensor)row.ItemArray[2]; SensorListItem listItem = new SensorListItem(sens); listItem.MouseLeftButtonUp += new MouseButtonEventHandler(SensorListItemCLick); //listItem.Location = new System.Drawing.Point(0, top); top += listItem.Height + 10; Panel.Children.Add(listItem); //listItem.setStatus(SensorStatus.CONNECTED); } } if (Panel.Children.Count == 0) { SensorMock mock = new SensorMock(); mock.setName("No Sensors found"); mock.setDeviceIdentifier(""); Panel.Children.Add(new SensorListItem(mock)); } }
public SensorStatusChangedEventArgs(SensorStatus Status) { this.Status = Status; }
// Used to manage async calls back to the UI protected void StatusChanged(object sender, SensorStatus s) { syncContext.Post(StatusChangedUI, s); }
public void OnAccuracyChanged(Sensor sensor, SensorStatus accuracy) { // We dont care }