public void UpdateDiscussionStates(string text) { RotateStatus stat = new RotateStatus(); if (text.Equals("start session")) { stat.chngMsg(1); } else if (text.Equals("join session")) { stat.chngMsg(2); } else if (text.Equals("think idea")) { stat.chngMsg(3); } else if (text.Equals("share idea")) { stat.chngMsg(4); } else if (text.Equals("reset")) { stat.chngMsg(0); } }
/// <summary> /// Start fast rotation in the specified direction /// </summary> /// <param name="aSpeed">The speed with which to move. The sign indicates the direction. A value of 0 indicates to stop /// the rotation /// </param> public void Rotate(double aSpeed) { Int32 controllerSpeed = (Int32)(aSpeed / SiderialTrackingSpeed); if (controllerSpeed == 0) { syLog.LogMessage("Rotate", "Stop Rotation"); // This is a stop command if (rotateStatus == null) { // We are not rotating. Ignore the command syLog.LogMessage("Rotate", "Ignoring stop rotate while not rotating"); return; } // Stop the rotation SendCommand(rotateStatus.moveOffCommand); // Restore the old situation FastRate = rotateStatus.oldFastSpeed; if (rotateStatus.wasTracking) { IsTracking = true; } rotateStatus = null; } else { // Start rotation. syLog.LogMessage("Rotate", "Start Rotation speed = " + controllerSpeed); // First gather the current status rotateStatus = new RotateStatus(); rotateStatus.wasTracking = IsTracking; rotateStatus.oldFastSpeed = FastSpeed; AxisCommands onCommmand; if (aSpeed >= 0) { onCommmand = AxisCommands.RightOn; rotateStatus.moveOffCommand = AxisCommands.RightOff; } else { aSpeed = -aSpeed; onCommmand = AxisCommands.LeftOn; rotateStatus.moveOffCommand = AxisCommands.LeftOff; } IsTracking = false; FastRate = controllerSpeed; SendCommand(AxisCommands.FastOn); SendCommand(onCommmand); } }