Esempio n. 1
0
 private void ToggleTool(HandGestureState currentState, HandGestureState previousState, bool right)
 {
     if (currentState == HandGestureState.DragSelection)
     {
         if (right)
         {
             DragToggleHelper(true, ref rightCurrentPositionMarker, ref rightStartingPoint, _rightHandSkeleton, ref rightStickActive);
             //rightCurrentPositionMarker.position = rightStartingPoint.position = _rightHandSkeleton.Bones[(int)BoneId.Hand_ThumbTip].Transform.position;
             //rightCurrentPositionMarker.rotation = rightStartingPoint.rotation = _rightControllerMarker.transform.rotation;
             //rightStickActive = true;
             //AtomicSelection.Instance.BeginTransformation(true);
         }
         else
         {
             DragToggleHelper(true, ref leftCurrentPositionMarker, ref leftStartingPoint, _leftHandSkeleton, ref leftStickActive);
             //leftCurrentPositionMarker.position = leftStartingPoint.position = _leftHandSkeleton.Bones[(int)BoneId.Hand_ThumbTip].Transform.position;
             //leftCurrentPositionMarker.rotation = leftStartingPoint.rotation = _leftControllerMarker.transform.rotation;
             //leftStickActive = true;
             //AtomicSelection.Instance.BeginTransformation(false);
         }
         ToggleTranslateToolVisibility(true, right);
         ToggleTranslateToolColliders(true, right);
         BeginTranslationDrag?.Invoke((right) ? Hand.Right : Hand.Left);
         ADM.QLog("begin drag");
     }
     else if (previousState == HandGestureState.DragSelection && currentState != HandGestureState.DragSelection)
     {
         DisengageTranslationTool(right);
     }
 }
Esempio n. 2
0
        public ActionResult DeleteConfirmed(int id)
        {
            ADM aDM = db.ADMs.Find(id);

            db.ADMs.Remove(aDM);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 3
0
 public ActionResult Edit([Bind(Include = "ADMID,ADMAccount,pass")] ADM aDM)
 {
     if (ModelState.IsValid)
     {
         db.Entry(aDM).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(aDM));
 }
Esempio n. 4
0
        private void btnVoltarFornecedorADM_Click(object sender, EventArgs e)
        {
            Form adm = new ADM();

            Hide();
            adm.ShowDialog();
            if (adm.IsDisposed)
            {
                Close();
            }
        }
Esempio n. 5
0
        public ActionResult Create([Bind(Include = "ADMID,ADMAccount,pass")] ADM aDM)
        {
            if (ModelState.IsValid)
            {
                db.ADMs.Add(aDM);
                db.SaveChanges();
                AuthenController.CreateAccount(aDM.ADMAccount, aDM.pass, "Admin");
                return(RedirectToAction("Index"));
            }

            return(View(aDM));
        }
Esempio n. 6
0
        // GET: ADMs/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ADM aDM = db.ADMs.Find(id);

            if (aDM == null)
            {
                return(HttpNotFound());
            }
            return(View(aDM));
        }
Esempio n. 7
0
        public void TestMethod1()
        {
            var tree = new GPTree();

            var root = new ADF {
                FunctionName = "ADF0", Children = new GPNode[2]
            };

            tree.Child = root;

            var c1 = new ADM {
                FunctionName = "ADM1", Parent = root, Children = new GPNode[2]
            };
            var c11 = new ADF {
                FunctionName = "ADF11", Parent = c1
            };
            var c12 = new DummyERC {
                FunctionName = "ERC12", Parent = c1
            };

            c1.Children[0] = c11;
            c1.Children[1] = c12;

            var c2 = new ADM {
                FunctionName = "ADM2", Parent = root, Children = new GPNode[1]
            };
            var c21 = new ADF {
                FunctionName = "ADF21", Parent = c2
            };

            c2.Children[0] = c21;

            root.Children    = new GPNode[3];
            root.Children[0] = c1;
            root.Children[1] = c2;
            root.Children[2] = new DummyERC {
                Parent = root
            };

            // nodesearch (0=All, 1=Terminals, 2=Nonterminals)
            foreach (GPNode node in tree.Descendants(nodesearch: GPNode.NODESEARCH_ALL))
            {
                var nodeName = node.Name;
                var t1       = node.Parent != null;
                var t2       = ((GPNode)node.Parent)?.Parent != null;
                var tabs     = t2 ? 2 : t1 ? 1 : 0;
                var s        = (tabs == 2 ? "\t\t" : tabs == 1 ? "\t" : "") + $"{nodeName}";
                Console.WriteLine(s);
            }
        }
        private void ToggleTool(HandGestureState currentState, HandGestureState previousState, bool right)
        {
            if (currentState == HandGestureState.DragSelection &&
                (previousState == HandGestureState.Selection || previousState == HandGestureState.Neutral))
            {
                if (right && !rightStickActive)
                {
                    rightCurrentPositionMarker.position = rightStartingPoint.position = rightStartingPoint.position = _rightHandSkeleton.Bones[(int)BoneId.Hand_ThumbTip].Transform.position;
                    rightStartingPoint.rotation         = _rightControllerMarker.transform.rotation;
                    currentRightUpAxis = rightStartingPoint.up;
                    rightCurrentPositionMarker.rotation = currentPivot.rotation;
                    rightStickActive = true;
                    AtomicSelection.Instance.BeginTransformation(true);
                    BeginRotationGearToggler(true);
                    ToggleVisibility(true, true);
                    ToggleColliders(true, true);
                    BeginRotationDrag?.Invoke(Hand.Right);
                    //ADM.QLog("begin drag");
                }
                else if (!right && !leftStickActive)
                {
                    leftCurrentPositionMarker.position = leftStartingPoint.position = _leftHandSkeleton.Bones[(int)BoneId.Hand_ThumbTip].Transform.position;
                    leftStartingPoint.rotation         = _leftControllerMarker.transform.rotation;
                    currentLeftUpAxis = leftStartingPoint.up;
                    leftCurrentPositionMarker.rotation = currentPivot.rotation;
                    leftStickActive = true;
                    AtomicSelection.Instance.BeginTransformation(false);
                    BeginRotationGearToggler(false);
                    ToggleVisibility(true, false);
                    ToggleColliders(true, false);
                    BeginRotationDrag?.Invoke(Hand.Left);
                    //ADM.QLog("begin drag");
                }
            }
            else if (currentState == HandGestureState.Stop)
            {
                if (right)
                {
                    DisengageRotationTool(true, ref rightStickActive, ref rightLineRenderer);
                }
                else
                {
                    DisengageRotationTool(false, ref leftStickActive, ref leftLineRenderer);
                }

                EndRotationDrag?.Invoke((right) ? Hand.Right : Hand.Left);
                ADM.QLog("end drag");
            }
        }
Esempio n. 9
0
 /// <summary>
 /// handler for all console output for hand input
 /// </summary>
 private void ILog(string text, bool right)
 {
     if (_debuggingEnabled)
     {
         if (right)
         {
             rightDebugOutput.text = text;
         }
         else
         {
             leftDebugOutput.text = text;
         }
         ADM.QLog(text);
         Debug.Log(text);
     }
 }
Esempio n. 10
0
        public void ADM_ReadPdfFile(string fileName)
        {
            string Linea;
            string Observaciones;
            ADM    oADM = null;

            try
            {
                if (!File.Exists(fileName))
                {
                    return;
                }

                listADM = new List <ADM>();

                StreamReader fileReader = new StreamReader(fileName);
                fileReader.ReadLine();
                while ((Linea = fileReader.ReadLine()) != null)
                {
                    string[] Columnas   = Linea.Split(new char[] { '|' });
                    long     BilleteADM = 0;
                    if (long.TryParse(Columnas[3], out BilleteADM))
                    {
                        Observaciones = Linea;
                        while (Observaciones.IndexOf("||") > -1)
                        {
                            Observaciones = Observaciones.Replace("||", "|");
                        }
                        if (Observaciones.Substring(Observaciones.Length - 1) == "|")
                        {
                            Observaciones = Observaciones.Substring(0, Observaciones.Length - 1);
                        }
                        oADM = new ADM {
                            Billete = BilleteADM, Observaciones = Observaciones
                        };
                        listADM.Add(oADM);
                    }
                }

                fileReader.Close();
            }
            catch (Exception Exception1)
            {
                MessageBox.Show("Error: " + Exception1.Message + "\nfileName: " + fileName, "Error");
            }
        }
Esempio n. 11
0
 private void DisengageTranslationTool(bool right)
 {
     ToggleTranslateToolVisibility(false, right);
     ToggleTranslateToolColliders(false, right);
     if (right)
     {
         rightLineRenderer.SetPositions(new Vector3[] { Vector3.zero, Vector3.zero, Vector3.zero, Vector3.zero, Vector3.zero });
         rightStickActive = false;
         AtomicSelection.Instance.CompleteTransformation(true);
     }
     else
     {
         leftLineRenderer.SetPositions(new Vector3[] { Vector3.zero, Vector3.zero, Vector3.zero, Vector3.zero, Vector3.zero });
         leftStickActive = false;
         AtomicSelection.Instance.CompleteTransformation(false);
     }
     EndTranslationDrag?.Invoke((right) ? Hand.Right : Hand.Left);
     ADM.QLog("end drag");
 }
Esempio n. 12
0
        public void BSP_ReadPdfFile(string fileName)
        {
            int    page = 0, index = 0;
            string currentText = "";

            BSP_Ticket         oBSP_Ticket         = null;
            BSP_Ticket_Detalle oBSP_Ticket_Detalle = null;

            Companias       companias          = new Companias();
            List <Compania> lstCompanias       = companias.GetAll();
            Compania        oCompaniaActual    = null;
            string          strFinCompania     = "";
            List <Compania> lstNuevasCompanias = new List <Compania>();

            Conceptos       conceptos       = new Conceptos();
            List <Concepto> lstConceptos    = conceptos.GetAll();
            Concepto        oConceptoActual = null;
            string          strFinConcepto  = "";

            BSP_Rg Tipo       = BSP_Rg.Ambas;
            int    CompaniaID = 0;

            string Linea = "";

            try
            {
                if (File.Exists(fileName))
                {
                    semanaToImport.TicketsBSP = new List <BSP_Ticket>();

                    PdfReader pdfReader = new PdfReader(fileName);
                    for (page = pageStart; page <= pdfReader.NumberOfPages; page++)
                    {
                        currentText = "";
                        currentText = PdfTextExtractor.GetTextFromPage(pdfReader, page, new SimpleTextExtractionStrategy());
                        currentText = Encoding.UTF8.GetString(ASCIIEncoding.Convert(Encoding.Default, Encoding.UTF8, Encoding.Default.GetBytes(currentText)));

                        string[] arrLineas = currentText.Split(new char[] { '\n' });
                        if (BSPActions.EsAnalisisDeVenta(ref arrLineas))
                        {
                            string strTipo = arrLineas[3].Substring(21, 30).Trim();
                            Tipo = BSP_Rg.Ambas;
                            if (strTipo == "DOMESTICO")
                            {
                                Tipo = BSP_Rg.Doméstico;
                            }
                            else if (strTipo == "INTERNACIONAL")
                            {
                                Tipo = BSP_Rg.Internacional;
                            }

                            if (Tipo != BSP_Rg.Ambas)                               //Si no estoy en el resumen final
                            {
                                for (index = 10; index < arrLineas.Length; index++) //10: Salteo cabecera
                                {
                                    Linea = arrLineas[index];
                                    if (Linea.Trim() != "")
                                    {
                                        if (oCompaniaActual == null && index == 10 && Linea.Length >= 3 && int.TryParse(Linea.Substring(0, 3), out CompaniaID)) //Si no estoy dentro de una compañía aerea...
                                        {
                                            oCompaniaActual = lstCompanias.Find(x => x.ID == CompaniaID);
                                            if (oCompaniaActual == null)
                                            {
                                                oCompaniaActual = new Compania()
                                                {
                                                    ID = CompaniaID, Nombre = Linea.Substring(4).Trim()
                                                };
                                                companias.Insertar(oCompaniaActual);
                                                lstCompanias.Add(oCompaniaActual);
                                                lstNuevasCompanias.Add(oCompaniaActual);
                                            }
                                            strFinCompania = "TOT " + Linea.Substring(4).Trim();
                                        }
                                        else if (Linea.Length >= strFinCompania.Length && Linea.Substring(0, strFinCompania.Length) == strFinCompania) //Si estoy en el cierre de la compañía aerea...
                                        {
                                            oCompaniaActual = null;
                                        }
                                        else if (oConceptoActual == null) //Si estoy en la compañía aerea y no estoy dentro de un concepto...
                                        {
                                            oConceptoActual = lstConceptos.Find(x => x.Nombre.Length <= Linea.Length && x.Nombre.ToUpper() == Linea.Substring(0, x.Nombre.Length));
                                            if (oConceptoActual != null)
                                            {
                                                strFinConcepto = "TOT " + (oConceptoActual.Nombre.Length >= 21 ? oConceptoActual.Nombre.Substring(0, 21) : oConceptoActual.Nombre).Trim().ToUpper();
                                            }
                                        }
                                        else if (Linea.Length >= strFinConcepto.Length && Linea.Substring(0, strFinConcepto.Length) == strFinConcepto) //Si estoy en la compañía aerea y estoy en el cierre de un concepto
                                        {
                                            oConceptoActual = null;
                                        }
                                        else if (BSPActions.EsNuevoTicket(Linea)) //Si estoy en la compañía aerea y estoy en el concepto, y si los primeros 10 caracteres son long...
                                        {
                                            if (oBSP_Ticket != null)
                                            {
                                                semanaToImport.TicketsBSP.Add(oBSP_Ticket);
                                                oBSP_Ticket = null;
                                            }
                                            oBSP_Ticket          = BSPActions.GetTicket(Linea, semanaToImport.Periodo.Year);
                                            oBSP_Ticket.Concepto = oConceptoActual;
                                            oBSP_Ticket.Compania = oCompaniaActual;
                                            oBSP_Ticket.Rg       = Tipo;

                                            oBSP_Ticket_Detalle = BSPActions.GetTicketDetalle(Linea);

                                            //ACM y ADM
                                            if (listACM != null && oConceptoActual.Tipo == 'C')
                                            {
                                                ACM oACM = listACM.Find(x => x.Billete == oBSP_Ticket.Billete);
                                                if (oACM != null)
                                                {
                                                    oBSP_Ticket_Detalle.Observaciones += (string.IsNullOrEmpty(oBSP_Ticket_Detalle.Observaciones) ? "" : "|") + oACM.Observaciones;
                                                }
                                            }
                                            if (listADM != null && oConceptoActual.Tipo == 'D')
                                            {
                                                ADM oADM = listADM.Find(x => x.Billete == oBSP_Ticket.Billete);
                                                if (oADM != null)
                                                {
                                                    oBSP_Ticket_Detalle.Observaciones += (string.IsNullOrEmpty(oBSP_Ticket_Detalle.Observaciones) ? "" : "|") + oADM.Observaciones;
                                                }
                                            }

                                            oBSP_Ticket.Detalle.Add(oBSP_Ticket_Detalle);
                                            oBSP_Ticket_Detalle = null;
                                        }
                                        else if (oBSP_Ticket != null)
                                        {
                                            oBSP_Ticket_Detalle = BSPActions.GetTicketDetalle(Linea);
                                            oBSP_Ticket.Detalle.Add(oBSP_Ticket_Detalle);
                                            oBSP_Ticket_Detalle = null;
                                        }
                                    }
                                }
                            }
                            else
                            {
                                Linea = arrLineas[10];
                                string strMoneda = Linea.Substring(("MONEDA: ").Length, 3);
                                Moneda Moneda    = strMoneda == "ARS" ? Moneda.Peso : Moneda.Dolar;
                                foreach (BSP_Ticket bsp_ticket in semanaToImport.TicketsBSP.Where(x => x.Moneda == null))
                                {
                                    bsp_ticket.Moneda = Moneda;
                                }
                                if (oBSP_Ticket != null)
                                {
                                    oBSP_Ticket.Moneda = Moneda;
                                }
                            }
                        }
                    }
                    if (oBSP_Ticket != null)
                    {
                        semanaToImport.TicketsBSP.Add(oBSP_Ticket);
                        oBSP_Ticket = null;
                    }
                    semanaToImport.TicketsBSP = semanaToImport.TicketsBSP.OrderBy(x => x.Compania.Codigo).ThenBy(x => x.Billete).ToList();
                    semanaToImport.BSPCargado = true;
                    pdfReader.Close();
                    if (lstNuevasCompanias.Count > 0)
                    {
                        string mensaje = "Se han encontrado Compañías Aéreas que no estaban registradas en el sistema:\n\n";
                        lstNuevasCompanias.ForEach(x => mensaje += "ID: " + x.ID + " | Nombre: " + x.Nombre + "\n");
                        mensaje += "\nÉstas han sido guardadas automáticamente, pero el código alfanumérico deberá ser ingresado manualmente.\n";
                        mensaje += "Por favor, ingrese al \"ABM de Compañías\" y complete la información solicitada.\n";
                        mensaje += "Muchas gracias.";
                        MessageBox.Show(mensaje, "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
            }
            catch (Exception Exception1)
            {
                TextToFile.Errores(TextToFile.Error(Exception1));
                MessageBox.Show("Error: " + Exception1.Message + "\nfileName: " + fileName + "\npage: " + page + "\nline: " + index, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                companias.CloseConnection();
                conceptos.CloseConnection();
            }
        }
    void Update()
    {
        //ADM.QLog("current right hand state: " + currentRightHandGestureState);
        //ADM.QLog("current left hand state: " + currentLeftHandGestureState);
        #region thumb
        if (OVRInput.GetDown(OVRInput.Touch.One, Controller.RTouch))
        {
            ADM.QLog("Got right thumb touch.");
            rightHandState |= TouchStates.thumb;
            UpdateHandState(true);
            StartCoroutine(HoldThresholdTrigger(true, TouchStates.thumb, TouchStateIndex.thumb, Time.time));
        }

        if (OVRInput.GetUp(OVRInput.Touch.One, Controller.RTouch))
        {
            ADM.QLog("Got right thumb touch release.");
            rightHandState &= ~TouchStates.thumb;
            UpdateHandState(true);
            rightHeldLong[(int)TouchStateIndex.thumb] = false;
            RefreshHeldLongState?.Invoke(true, rightHeldLong);
        }

        if (OVRInput.GetDown(OVRInput.Touch.One, Controller.LTouch))
        {
            ADM.QLog("Got left thumb touch.");
            leftHandState |= TouchStates.thumb;
            UpdateHandState(false);
            StartCoroutine(HoldThresholdTrigger(false, TouchStates.thumb, TouchStateIndex.thumb, Time.time));
        }

        if (OVRInput.GetUp(OVRInput.Touch.One, Controller.LTouch))
        {
            ADM.QLog("Got left thumb touch release.");
            leftHandState &= ~TouchStates.thumb;
            UpdateHandState(false);
            leftHeldLong[(int)TouchStateIndex.thumb] = false;
            RefreshHeldLongState?.Invoke(true, rightHeldLong);
        }
        #endregion thumb

        #region pointer
        if (OVRInput.GetDown(OVRInput.Touch.PrimaryIndexTrigger, Controller.LTouch))
        {
            ADM.QLog("Got left index finger touch.");
            leftHandState |= TouchStates.pointer;
            UpdateHandState(false);
            StartCoroutine(HoldThresholdTrigger(false, TouchStates.pointer, TouchStateIndex.pointer, Time.time));
        }

        if (OVRInput.GetUp(OVRInput.Touch.PrimaryIndexTrigger, Controller.LTouch))
        {
            ADM.QLog("Got left index finger touch release.");
            leftHandState &= ~TouchStates.pointer;
            UpdateHandState(false);
            leftHeldLong[(int)TouchStateIndex.pointer] = false;
            RefreshHeldLongState?.Invoke(true, rightHeldLong);
        }

        if (OVRInput.GetDown(OVRInput.Touch.PrimaryIndexTrigger, Controller.RTouch))
        {
            ADM.QLog("Got right index finger touch.");
            rightHandState |= TouchStates.pointer;
            UpdateHandState(true);
            StartCoroutine(HoldThresholdTrigger(true, TouchStates.pointer, TouchStateIndex.pointer, Time.time));
        }

        if (OVRInput.GetUp(OVRInput.Touch.PrimaryIndexTrigger, Controller.RTouch))
        {
            ADM.QLog("Got right index finger touch release.");
            rightHandState &= ~TouchStates.pointer;
            UpdateHandState(true);
            rightHeldLong[(int)TouchStateIndex.pointer] = false;
            RefreshHeldLongState?.Invoke(true, rightHeldLong);
        }
        #endregion pointer

        #region grip
        if (OVRInput.GetDown(OVRInput.Button.PrimaryHandTrigger, Controller.LTouch))
        {
            ADM.QLog("Got left grip touch.");
            leftHandState |= TouchStates.middle;
            UpdateHandState(false);
            StartCoroutine(HoldThresholdTrigger(false, TouchStates.middle, TouchStateIndex.middle, Time.time));
        }

        if (OVRInput.GetUp(OVRInput.Button.PrimaryHandTrigger, Controller.LTouch))
        {
            ADM.QLog("Got left grip touch release.");
            leftHandState &= ~TouchStates.middle;
            UpdateHandState(false);
            leftHeldLong[(int)TouchStateIndex.middle] = false;
            RefreshHeldLongState?.Invoke(true, rightHeldLong);
        }

        if (OVRInput.GetDown(OVRInput.Button.PrimaryHandTrigger, Controller.RTouch))
        {
            ADM.QLog("Got right grip touch.");
            rightHandState |= TouchStates.middle;
            UpdateHandState(true);
            StartCoroutine(HoldThresholdTrigger(true, TouchStates.middle, TouchStateIndex.middle, Time.time));
        }

        if (OVRInput.GetUp(OVRInput.Button.PrimaryHandTrigger, Controller.RTouch))
        {
            ADM.QLog("Got right grip touch release.");
            rightHandState &= ~TouchStates.middle;
            UpdateHandState(true);
            rightHeldLong[(int)TouchStateIndex.middle] = false;
            RefreshHeldLongState?.Invoke(true, rightHeldLong);
        }
        #endregion grip

        #region rotation
        if (currentRightHandGestureState == HandGestureState.DragSelection &&
            ((Vector3.Dot(Vector3.up, RightMarker.Instance.transform.up) < 0.75f && currentRightRotationState == RotationState.lowerCase) ||
             (Vector3.Dot(Vector3.up, RightMarker.Instance.transform.right) < 0.75f && currentRightRotationState == RotationState.upperCase) ||
             (Vector3.Dot(Vector3.up, -1 * RightMarker.Instance.transform.right) < 0.75f && currentRightRotationState == RotationState.specialCharacters) ||
             (Vector3.Dot(_selectionRightStartingMarker.transform.forward, RightMarker.Instance.transform.right) < 0.75f && currentRightRotationState == RotationState.numbers))
            )
        {
            // ADM.QLog("Right rotation state just changed.");
            UpdateRotationState(true);
        }

        if (currentLeftHandGestureState == HandGestureState.DragSelection &&
            ((Vector3.Dot(Vector3.up, LeftMarker.Instance.transform.up) < 0.75f && currentLeftRotationState == RotationState.lowerCase) ||
             (Vector3.Dot(Vector3.up, -1 * LeftMarker.Instance.transform.right) < 0.75f && currentLeftRotationState == RotationState.upperCase) ||
             (Vector3.Dot(Vector3.up, LeftMarker.Instance.transform.right) < 0.75f && currentLeftRotationState == RotationState.specialCharacters) ||
             (Vector3.Dot(_selectionLeftStartingMarker.transform.forward, -1 * LeftMarker.Instance.transform.right) < 0.75f && currentLeftRotationState == RotationState.numbers))
            )
        {
            // ADM.QLog("Left rotation state just changed.");
            UpdateRotationState(false);
        }
        #endregion rotation
    }
    void UpdateRotationState(bool right)
    {
        RotationState previousRotationState = (right) ? currentRightRotationState : currentLeftRotationState;

        if (right)
        {
            if (Vector3.Dot(Vector3.up, RightMarker.Instance.transform.up) >= 0.75f)
            {
                currentRightRotationState = RotationState.lowerCase;
            }

            if (Vector3.Dot(Vector3.up, RightMarker.Instance.transform.right) >= 0.75f)
            {
                currentRightRotationState = RotationState.upperCase;
            }

            if (Vector3.Dot(Vector3.up, -1 * RightMarker.Instance.transform.right) >= 0.75f)
            {
                currentRightRotationState = RotationState.specialCharacters;
            }

            if ((rightHandState & TouchStates.middle) != 0 &&
                Vector3.Dot(
                    RightMarker.Instance.transform.right,
                    _selectionRightStartingMarker.transform.forward
                    ) > 0.75
                )
            {
                currentRightRotationState = RotationState.numbers;
            }

            RightRotationStateChanged?.Invoke(currentRightRotationState, previousRotationState);
        }
        else
        {
            //ADM.QLog(string.Format("Input Left Rotation Results - " +
            //    "lowercase condition: {0} " +
            //    "uppercase condition: {1} " +
            //    "special char condition: {2} " +
            //    "numbers condition: {3}",
            //    Vector3.Dot(Vector3.up, LeftMarker.Instance.transform.up),
            //    Vector3.Dot(Vector3.up, -1 * LeftMarker.Instance.transform.right),
            //    Vector3.Dot(Vector3.up, LeftMarker.Instance.transform.right),
            //    Vector3.Dot(-1 * LeftMarker.Instance.transform.right, _selectionLeftStartingMarker.transform.forward)
            //    ));
            if (Vector3.Dot(Vector3.up, LeftMarker.Instance.transform.up) >= 0.75f)
            {
                currentLeftRotationState = RotationState.lowerCase;
            }

            if (Vector3.Dot(Vector3.up, -1 * LeftMarker.Instance.transform.right) >= 0.75f)
            {
                currentLeftRotationState = RotationState.upperCase;
            }

            if (Vector3.Dot(Vector3.up, LeftMarker.Instance.transform.right) >= 0.75f)
            {
                currentLeftRotationState = RotationState.specialCharacters;
            }

            if ((leftHandState & TouchStates.middle) != 0 &&
                Vector3.Dot(-1 * LeftMarker.Instance.transform.right, _selectionLeftStartingMarker.transform.forward) > 0.75f)
            {
                currentLeftRotationState = RotationState.numbers;
            }

            ADM.QLog("Left new rotation state: " + currentLeftRotationState);
            LeftRotationStateChanged?.Invoke(currentLeftRotationState, previousRotationState);
        }
    }
        /// <summary>
        /// Ratchet loop that handles state when the hand snaps on/off the root position of the gizmo during drag
        /// </summary>
        private IEnumerator ToggleRotationGear(bool right)
        {
            bool firstTimeOnly = true;

            if (right)
            {
                if (!AtomicModeController.Instance.HasFlag(AtomicModeController.Instance.currentRightMode, TransformMode.Rotate))
                {
                    yield break;
                }
                while (rightStickActive)
                {
                    yield return(new WaitUntil(() => (_rightMarkerDistanceMagnitude > _gearThreshold || !rightStickActive)));

                    if (!rightStickActive ||
                        !AtomicModeController.Instance.HasFlag(AtomicModeController.Instance.currentRightMode, TransformMode.Rotate))
                    {
                        yield break;
                    }
                    _rightSurfaceLockMarker.position = GetStartingArrowPoint(true);
                    rightRotationGearEngaged         = true;

                    if (firstTimeOnly)
                    {
                        CalculateRotationOffset(true);
                        firstTimeOnly = false;
                    }

                    rightStartingLocalRoll = RightMarker.Instance.transform.parent.localEulerAngles.z;

                    ADM.QLog("right gear on");

                    yield return(new WaitUntil(() => (_rightMarkerDistanceMagnitude < _gearThreshold || !rightStickActive)));


                    rightStartingLocalRoll           = 0;
                    rightRotationGearEngaged         = false;
                    _rightSurfaceLockMarker.position = rightStartingPoint.position;
                    _rightSurfaceLockMarker.rotation = rightStartingPoint.rotation;
                    ADM.QLog("right gear off");
                }
                _rightSurfaceLockMarker.position = rightStartingPoint.position;
                _rightSurfaceLockMarker.rotation = rightStartingPoint.rotation;
            }
            else
            {
                if (!AtomicModeController.Instance.HasFlag(AtomicModeController.Instance.currentLeftMode, TransformMode.Rotate))
                {
                    yield break;
                }

                while (leftStickActive)
                {
                    yield return(new WaitUntil(() => (_leftMarkerDistanceMagnitude > _gearThreshold || !leftStickActive)));

                    if (!leftStickActive ||
                        !AtomicModeController.Instance.HasFlag(AtomicModeController.Instance.currentLeftMode, TransformMode.Rotate))
                    {
                        yield break;
                    }
                    _leftSurfaceLockMarker.position = GetStartingArrowPoint(false);
                    leftRotationGearEngaged         = true;

                    if (firstTimeOnly)
                    {
                        CalculateRotationOffset(false);
                        firstTimeOnly = false;
                    }

                    leftStartingLocalRoll = LeftMarker.Instance.transform.parent.localEulerAngles.z;

                    ADM.QLog("left gear on");

                    yield return(new WaitUntil(() => (_leftMarkerDistanceMagnitude < _gearThreshold || !leftStickActive)));


                    leftStartingLocalRoll           = 0;
                    leftRotationGearEngaged         = false;
                    _leftSurfaceLockMarker.position = leftStartingPoint.position;
                    _leftSurfaceLockMarker.rotation = leftStartingPoint.rotation;
                    ADM.QLog("left gear off");
                }
                _leftSurfaceLockMarker.position = leftStartingPoint.position;
                _leftSurfaceLockMarker.rotation = leftStartingPoint.rotation;
            }
        }