Example #1
0
        public void LogUpdateMotorEvent(Motor motor)
        {
            var log = new Settings
                {
                    Active = motor.Activated,
                    Direction = (motor.Rotation == RotationDirection.Clockwise ? "Clockwise" : "AntiClockwise"),
                    Speed = motor.Speed
                };

            using(var session = _factory.OpenSession())
            {
                using(var transaction = session.BeginTransaction())
                {
                    session.SaveOrUpdate(log);
                    transaction.Commit();
                }
            }
        }
Example #2
0
 private void UpdateMotorHandler(Motor obj)
 {
     Speed = obj.Speed;
     Activated = obj.Activated;
     Rotation = obj.Rotation;
 }
Example #3
0
 private void UpdateMotorHandler(Motor obj)
 {
     throw new System.NotImplementedException();
 }
Example #4
0
 public void ActivateMoterHandler(Motor motor)
 {
     SystemSounds.Asterisk.Play();
 }