コード例 #1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (emg_ != null)
            {
                hash ^= Emg.GetHashCode();
            }
            if (orientation_ != null)
            {
                hash ^= Orientation.GetHashCode();
            }
            if (gyroscope_ != null)
            {
                hash ^= Gyroscope.GetHashCode();
            }
            if (accelerometer_ != null)
            {
                hash ^= Accelerometer.GetHashCode();
            }
            if (Gesture != global::Ubii.DataStructure.HandGestureType.Rest)
            {
                hash ^= Gesture.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
コード例 #2
0
ファイル: MyoEvent.cs プロジェクト: timkaiser/MiMeMal
        public override int GetHashCode()
        {
            int hash = 1;

            if (emg_ != null)
            {
                hash ^= Emg.GetHashCode();
            }
            if (orientation_ != null)
            {
                hash ^= Orientation.GetHashCode();
            }
            if (gyroscope_ != null)
            {
                hash ^= Gyroscope.GetHashCode();
            }
            if (accelerometer_ != null)
            {
                hash ^= Accelerometer.GetHashCode();
            }
            if (Gesture != 0)
            {
                hash ^= Gesture.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
コード例 #3
0
 public void MergeFrom(MyoEvent other)
 {
     if (other == null)
     {
         return;
     }
     if (other.emg_ != null)
     {
         if (emg_ == null)
         {
             Emg = new global::Ubii.DataStructure.Vector8();
         }
         Emg.MergeFrom(other.Emg);
     }
     if (other.orientation_ != null)
     {
         if (orientation_ == null)
         {
             Orientation = new global::Ubii.DataStructure.Quaternion();
         }
         Orientation.MergeFrom(other.Orientation);
     }
     if (other.gyroscope_ != null)
     {
         if (gyroscope_ == null)
         {
             Gyroscope = new global::Ubii.DataStructure.Vector3();
         }
         Gyroscope.MergeFrom(other.Gyroscope);
     }
     if (other.accelerometer_ != null)
     {
         if (accelerometer_ == null)
         {
             Accelerometer = new global::Ubii.DataStructure.Vector3();
         }
         Accelerometer.MergeFrom(other.Accelerometer);
     }
     if (other.Gesture != global::Ubii.DataStructure.HandGestureType.Rest)
     {
         Gesture = other.Gesture;
     }
     _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 }
コード例 #4
0
 public MyoGym(string accelerometerMQTTURL, string gyroscopeMQTTURL, string emgMQTTURL)
 {
     AccelerometerSensor = new Accelerometer(accelerometerMQTTURL, 200, 25, new IFeature[] {
         new HjorthParameters(1, 2, 3),
         new StandardDeviation(1, 2, 3),
         new Mean(1, 2, 3),
         new Min(1, 2, 3),
         new Max(1, 2, 3),
         new Percentile(5, 1, 2, 3),
         new Percentile(10, 1, 2, 3),
         new Percentile(25, 1, 2, 3),
         new Percentile(50, 1, 2, 3),
         new Percentile(75, 1, 2, 3),
         new Percentile(90, 1, 2, 3),
         new Percentile(95, 1, 2, 3),
         new ZeroCrossing(1, 2, 3),
         new MeanCrossing(1, 2, 3),
         new Entropy(1, 2, 3),
         new Correlation(1, 2),
         new Correlation(1, 3),
         new Correlation(2, 3),
     });
     GyroscopeSensor = new Gyroscope(gyroscopeMQTTURL, 200, 25, new IFeature[] {
         new HjorthParameters(1, 2, 3),
         new StandardDeviation(1, 2, 3),
         new Mean(1, 2, 3),
         new Min(1, 2, 3),
         new Max(1, 2, 3),
         new Percentile(5, 1, 2, 3),
         new Percentile(10, 1, 2, 3),
         new Percentile(25, 1, 2, 3),
         new Percentile(50, 1, 2, 3),
         new Percentile(75, 1, 2, 3),
         new Percentile(90, 1, 2, 3),
         new Percentile(95, 1, 2, 3),
         new ZeroCrossing(1, 2, 3),
         new MeanCrossing(1, 2, 3),
         new Entropy(1, 2, 3),
     });
     EmgSensor = new Emg(emgMQTTURL, 200, 25, new IFeature[] {
         new StandardDeviation(1, 2, 3, 4, 5, 6, 7, 8),
         new Mean(1, 2, 3, 4, 5, 6, 7, 8),
         new Min(1, 2, 3, 4, 5, 6, 7, 8),
         new Max(1, 2, 3, 4, 5, 6, 7, 8),
         new Median(1, 2, 3, 4, 5, 6, 7, 8),
         new Percentile(5, 1, 2, 3, 4, 5, 6, 7, 8),
         new Percentile(10, 1, 2, 3, 4, 5, 6, 7, 8),
         new Percentile(25, 1, 2, 3, 4, 5, 6, 7, 8),
         new Percentile(50, 1, 2, 3, 4, 5, 6, 7, 8),
         new Percentile(75, 1, 2, 3, 4, 5, 6, 7, 8),
         new Percentile(90, 1, 2, 3, 4, 5, 6, 7, 8),
         new Percentile(95, 1, 2, 3, 4, 5, 6, 7, 8),
         new SumLargerThan(25, 1, 2, 3, 4, 5, 6, 7, 8),
         new SumLargerThan(50, 1, 2, 3, 4, 5, 6, 7, 8),
         new SumLargerThan(100, 1, 2, 3, 4, 5, 6, 7, 8),
     });
     RequiredSensors = new List <string>()
     {
         "/i5/myo/accelerometer",
         "/i5/myo/gyroscope",
         "/i5/myo/emg",
     };
 }