Exemple #1
0
 public override int GetHashCode()
 {
     unchecked
     {
         return((base.GetHashCode() * 397) ^ MoveInfoCollection.GetHashCode());
     }
 }
Exemple #2
0
        public static void Test()
        {
            foreach (string SerialPortItem in SerialCom.GetSerialPorts())
            {
                Console.WriteLine(SerialPortItem);
            }

            Stepper CurrentStepper = new Stepper("COM4");

            MoveInfoCollection MySequence = new MoveInfoCollection();

            MySequence.AddItem(new MoveInfo(EDirection.Clockwise, 20, 1));
            //MySequence.AddItem(new MoveInfo(EDirection.Clockwise, 20, 0.8));
            //MySequence.AddItem(new MoveInfo(EDirection.Clockwise, 20, 0.6));
            //MySequence.AddItem(new MoveInfo(EDirection.Clockwise, 20, 1));
            //MySequence.AddItem(new MoveInfo(EDirection.Clockwise, 4500, 0.2));
            //MySequence.AddItem(new MoveInfo(EDirection.Clockwise, 100, 0.5));
            //MySequence.AddItem(new MoveInfo(EDirection.CounterClockwise, 4690, 0));

            for (int i = 1; i <= 10; i++)
            {
                TChrono NewChrono = new TChrono();
                NewChrono.Start();
                Task.Run(() => CurrentStepper.Execute(MySequence)).Wait();
                Console.WriteLine($"Execution time = {NewChrono.ElapsedTime.TotalMilliseconds}");
            }
            //Task.Run(() => CurrentStepper.Execute(new MoveInfo(EDirection.Clockwise, 5, 100))).Wait();
        }
Exemple #3
0
 public bool Equals(MoveEventArgs <TEntity> other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(base.Equals(other) && MoveInfoCollection.Equals(other.MoveInfoCollection));
 }