コード例 #1
0
ファイル: PinTest.cs プロジェクト: UnBiHealth/fisiogame
 void GenerateEvent()
 {
     var n = new Notify(PinDriver.UPDATE_EVENT_NAME, PinDriver.DRIVER_NAME);
     n.AddParameter(PinDriver.PIN_PARAM_NAME, "punch");
     n.AddParameter(PinDriver.VALUE_PARAM_NAME, newValue.ToString());
     uOS.gateway.Notify(n, uOS.gateway.currentDevice);
 }
コード例 #2
0
ファイル: PinTest.cs プロジェクト: UnBiHealth/fisiogame
 void GenerateRepetitionsEvent()
 {
     var n = new Notify(PinDriver.UPDATE_EVENT_NAME, PinDriver.DRIVER_NAME);
     n.AddParameter(PinDriver.PIN_PARAM_NAME, "repetitions");
     n.AddParameter(PinDriver.VALUE_PARAM_NAME, 20.ToString());
     uOS.gateway.Notify(n, uOS.gateway.currentDevice);
     Debug.Log("Repetitions event");
 }
コード例 #3
0
ファイル: PinDriver.cs プロジェクト: UnBiHealth/fisiogame
 private void FireDriverEvent(string pinName, string eventKey, object newValue)
 {
     HashSet<UpDevice> listeners;
     lock (_lock)
     {
         if (!driverListeners.TryGetValue(pinName, out listeners))
             return;
     }
     Notify n = new Notify(eventKey, DRIVER_NAME, instanceId);
     n.AddParameter(PIN_PARAM_NAME, pinName);
     if (UPDATE_EVENT_NAME.Equals(eventKey))
         n.AddParameter(VALUE_PARAM_NAME, newValue.ToString());
     foreach (var device in listeners)
         gateway.Notify(n, device);
 }