public override int GetHashCode()
        {
            int hashCode = 718353637;

            if (Uid != null)
            {
                hashCode += Uid.GetHashCode();
            }

            if (Cadence != null)
            {
                hashCode += Cadence.GetHashCode();
            }

            if (Periods != null)
            {
                hashCode += Periods.GetHashCode();
            }

            if (RecurringPriceMoney != null)
            {
                hashCode += RecurringPriceMoney.GetHashCode();
            }

            if (Ordinal != null)
            {
                hashCode += Ordinal.GetHashCode();
            }

            return(hashCode);
        }
示例#2
0
 public void calcIsSpeaking()
 {
     if (Math.Abs(averageVolume) > ThresholdIsSpeaking)
     {
         if (isSpeaking == false)
         {
             startedSpeaking = DateTime.Now;
             previousValue   = voiceCadence;
         }
         isSpeaking    = true;
         isNotSpeaking = false;
     }
     else
     {
         if (isSpeaking)
         {
             if (isNotSpeaking == false)
             {
                 stoppedSpeaking = DateTime.Now;
                 isNotSpeaking   = true;
             }
             TimeSpan pausedtime = new TimeSpan(stoppedSpeaking.Ticks);
             TimeSpan now        = new TimeSpan(DateTime.Now.Ticks);
             if (now.TotalMilliseconds - pausedtime.TotalMilliseconds > ThresholdPauseStartTime)
             {
                 startedPause  = stoppedSpeaking;
                 isSpeaking    = false;
                 previousValue = voiceCadence;
             }
         }
     }
 }
示例#3
0
        public async Task <IPaste> Create(string Username, string Password)
        {
            Cadence Cadence = new Cadence(Username, Password);
            await Cadence.GetToken();

            return(Cadence);
        }
 protected void ToString(List <string> toStringOutput)
 {
     toStringOutput.Add($"Uid = {(Uid == null ? "null" : Uid == string.Empty ? "" : Uid)}");
     toStringOutput.Add($"Cadence = {(Cadence == null ? "null" : Cadence.ToString())}");
     toStringOutput.Add($"Periods = {(Periods == null ? "null" : Periods.ToString())}");
     toStringOutput.Add($"RecurringPriceMoney = {(RecurringPriceMoney == null ? "null" : RecurringPriceMoney.ToString())}");
     toStringOutput.Add($"Ordinal = {(Ordinal == null ? "null" : Ordinal.ToString())}");
 }
示例#5
0
 public void SetAttack(float t)
 {
     attackTime    = t;
     attackValue   = 0f;
     attackCadence =
         t <= 1f ? Cadence.Snappy :
         t <= 10f ? Cadence.Normal :
         Cadence.Hesitant;
 }
示例#6
0
        private Cadence CadenceBuilder(string value)
        {
            Console.WriteLine("value: " + value);
            Cadence cadence = new Cadence(0, 0, 0);

            cadence.CoupParCoup = int.Parse(value.Split('/')[0]);
            cadence.SemiAuto    = int.Parse(value.Split('/')[1]);
            cadence.Automatique = int.Parse(value.Split('/')[2]);
            Console.WriteLine("cadence: " + cadence.ToString());
            return(cadence);
        }
示例#7
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Time != null)
         {
             hashCode = hashCode * 59 + Time.GetHashCode();
         }
         if (Distance != null)
         {
             hashCode = hashCode * 59 + Distance.GetHashCode();
         }
         if (Latlng != null)
         {
             hashCode = hashCode * 59 + Latlng.GetHashCode();
         }
         if (Altitude != null)
         {
             hashCode = hashCode * 59 + Altitude.GetHashCode();
         }
         if (VelocitySmooth != null)
         {
             hashCode = hashCode * 59 + VelocitySmooth.GetHashCode();
         }
         if (Heartrate != null)
         {
             hashCode = hashCode * 59 + Heartrate.GetHashCode();
         }
         if (Cadence != null)
         {
             hashCode = hashCode * 59 + Cadence.GetHashCode();
         }
         if (Watts != null)
         {
             hashCode = hashCode * 59 + Watts.GetHashCode();
         }
         if (Temp != null)
         {
             hashCode = hashCode * 59 + Temp.GetHashCode();
         }
         if (Moving != null)
         {
             hashCode = hashCode * 59 + Moving.GetHashCode();
         }
         if (GradeSmooth != null)
         {
             hashCode = hashCode * 59 + GradeSmooth.GetHashCode();
         }
         return(hashCode);
     }
 }
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is SubscriptionPhase other &&
                   ((Uid == null && other.Uid == null) || (Uid?.Equals(other.Uid) == true)) &&
                   ((Cadence == null && other.Cadence == null) || (Cadence?.Equals(other.Cadence) == true)) &&
                   ((Periods == null && other.Periods == null) || (Periods?.Equals(other.Periods) == true)) &&
                   ((RecurringPriceMoney == null && other.RecurringPriceMoney == null) || (RecurringPriceMoney?.Equals(other.RecurringPriceMoney) == true)) &&
                   ((Ordinal == null && other.Ordinal == null) || (Ordinal?.Equals(other.Ordinal) == true)));
        }
示例#9
0
        //probably should be called from rulesAnalizer
        public void calcSpeakingTime()
        {
            TimeSpan speaking = new TimeSpan(startedSpeaking.Ticks);
            TimeSpan now      = new TimeSpan(DateTime.Now.Ticks);

            if (now.TotalMilliseconds - speaking.TotalMilliseconds < ThresholdShortSpeakingTime)
            {
                voiceCadence = Cadence.shortSpeakingTime;
            }
            else if (now.TotalMilliseconds - speaking.TotalMilliseconds < ThresholdIsSpeakingLongTime)
            {
                voiceCadence = Cadence.goodSpeakingTime;
            }
            else if (now.TotalMilliseconds - speaking.TotalMilliseconds < ThresholdIsSpeakingVeryLongTime)
            {
                voiceCadence = Cadence.longSpeakingTime;
            }
            else
            {
                voiceCadence = Cadence.veryLongSpeakingTime;
            }
        }
示例#10
0
        //probably should be called from rulesAnalizer
        public void calcPausingTime()
        {
            TimeSpan pausing = new TimeSpan(startedPause.Ticks);
            TimeSpan now     = new TimeSpan(DateTime.Now.Ticks);

            if (now.TotalMilliseconds - pausing.TotalMilliseconds < ThresholdShortPause)
            {
                voiceCadence = Cadence.shortPause;
            }
            else if (now.TotalMilliseconds - pausing.TotalMilliseconds < ThresholdIsLongPauseTime)
            {
                voiceCadence = Cadence.goodPause;
            }
            else if (now.TotalMilliseconds - pausing.TotalMilliseconds < ThresholdIsVeryLongPauseTime)
            {
                voiceCadence = Cadence.longPause;
            }
            else
            {
                voiceCadence = Cadence.veryLongPause;
            }
        }
示例#11
0
 public void Show(Cadence cadence, HeartRate heartRate, Stamina stamina)
 {
     cadenceTMP.text   = cadence.ToString();
     heartRateTMP.text = heartRate.ToString();
     staminaTMP.text   = stamina.ToString();
 }
示例#12
0
        /// <summary>
        /// Returns true if StreamSet instances are equal
        /// </summary>
        /// <param name="other">Instance of StreamSet to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(StreamSet other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Time == other.Time ||
                     Time != null &&
                     Time.Equals(other.Time)
                     ) &&
                 (
                     Distance == other.Distance ||
                     Distance != null &&
                     Distance.Equals(other.Distance)
                 ) &&
                 (
                     Latlng == other.Latlng ||
                     Latlng != null &&
                     Latlng.Equals(other.Latlng)
                 ) &&
                 (
                     Altitude == other.Altitude ||
                     Altitude != null &&
                     Altitude.Equals(other.Altitude)
                 ) &&
                 (
                     VelocitySmooth == other.VelocitySmooth ||
                     VelocitySmooth != null &&
                     VelocitySmooth.Equals(other.VelocitySmooth)
                 ) &&
                 (
                     Heartrate == other.Heartrate ||
                     Heartrate != null &&
                     Heartrate.Equals(other.Heartrate)
                 ) &&
                 (
                     Cadence == other.Cadence ||
                     Cadence != null &&
                     Cadence.Equals(other.Cadence)
                 ) &&
                 (
                     Watts == other.Watts ||
                     Watts != null &&
                     Watts.Equals(other.Watts)
                 ) &&
                 (
                     Temp == other.Temp ||
                     Temp != null &&
                     Temp.Equals(other.Temp)
                 ) &&
                 (
                     Moving == other.Moving ||
                     Moving != null &&
                     Moving.Equals(other.Moving)
                 ) &&
                 (
                     GradeSmooth == other.GradeSmooth ||
                     GradeSmooth != null &&
                     GradeSmooth.Equals(other.GradeSmooth)
                 ));
        }
 //probably should be called from rulesAnalizer
 public void calcSpeakingTime()
 {
     TimeSpan speaking = new TimeSpan(startedSpeaking.Ticks);
     TimeSpan now = new TimeSpan(DateTime.Now.Ticks);
     
     if (now.TotalMilliseconds - speaking.TotalMilliseconds < ThresholdShortSpeakingTime)
     {
         voiceCadence = Cadence.shortSpeakingTime;
     }
     else if(now.TotalMilliseconds-speaking.TotalMilliseconds<ThresholdIsSpeakingLongTime)
     {
         voiceCadence = Cadence.goodSpeakingTime;
     }
     else if(now.TotalMilliseconds-speaking.TotalMilliseconds<ThresholdIsSpeakingVeryLongTime)
     {
         voiceCadence = Cadence.longSpeakingTime;
     }
     else 
     {
         voiceCadence = Cadence.veryLongSpeakingTime;
     }
 }
 public void calcIsSpeaking()
 {
     if (Math.Abs(averageVolume) > ThresholdIsSpeaking)
     {
         if(isSpeaking==false)
         {
             startedSpeaking = DateTime.Now;
             previousValue = voiceCadence;
         }
         isSpeaking = true;
         isNotSpeaking=false;
     }
     else
     {
         if(isSpeaking)
         {
             if(isNotSpeaking==false)
             {
                 stoppedSpeaking = DateTime.Now;
                 isNotSpeaking=true;
             }
             TimeSpan pausedtime = new TimeSpan(stoppedSpeaking.Ticks);
             TimeSpan now = new TimeSpan(DateTime.Now.Ticks);
             if (now.TotalMilliseconds - pausedtime.TotalMilliseconds > ThresholdPauseStartTime)
             {
                 startedPause = stoppedSpeaking;
                 isSpeaking = false;
                 previousValue = voiceCadence;
             }
         }
         
     }
 }
 //probably should be called from rulesAnalizer
 public void calcPausingTime()
 {
     TimeSpan pausing = new TimeSpan(startedPause.Ticks);
     TimeSpan now = new TimeSpan(DateTime.Now.Ticks);
     if (now.TotalMilliseconds - pausing.TotalMilliseconds < ThresholdShortPause)
     {
         voiceCadence = Cadence.shortPause;
     }
     else if (now.TotalMilliseconds - pausing.TotalMilliseconds < ThresholdIsLongPauseTime)
     {
         voiceCadence = Cadence.goodPause;
     }
     else if (now.TotalMilliseconds - pausing.TotalMilliseconds < ThresholdIsVeryLongPauseTime)
     {
         voiceCadence = Cadence.longPause;
     }
     else
     {
         voiceCadence = Cadence.veryLongPause;
     }
 }
示例#16
0
 public override string ToString()
 {
     return(Time.ToString(@"hh\:mm\:ss") + sep + Altitude.ToString("N1") + sep + Velocity.ToString("N2") + sep + Cadence.ToString("N0") + sep + Grade.ToString("N2")
            + sep + Heartrate.ToString("N0") + sep + Temperature.ToString("N1") + sep + Distance.ToString("N3") + sep + Moving);
 }