private string[] MsgBinaryFormer(VibrationIDFlag.HandIndex handIndex, string power, VibrationIDFlag.FingerIndex[] fingerIndexs)
        {
            string msgBinaryH = VibrationIDFlag.VibrationHeader.H + "000000";
            string msgBinaryL = VibrationIDFlag.VibrationHeader.L + "000000";

            for (int i = 0; i < fingerIndexs.Length; i++)
            {
                if (fingerDataDict.TryGetValue(GetFingerDataDicKey(handIndex, fingerIndexs[i]), out FingerData fingerData))
                {
                    if (fingerData.header == VibrationIDFlag.VibrationHeader.H)
                    {
                        msgBinaryH = EditBinaryMsg(msgBinaryH, fingerData.index, power);
                        //Debug.Log("msgBinaryH : " + msgBinaryH);
                    }
                    else if (fingerData.header == VibrationIDFlag.VibrationHeader.L)
                    {
                        msgBinaryL = EditBinaryMsg(msgBinaryL, fingerData.index, power);
                        // Debug.Log("msgBinaryL : " + msgBinaryL);
                    }
                }
            }

            Debug.Log("msgBinaryH : " + msgBinaryH);
            Debug.Log("msgBinaryL : " + msgBinaryL);

            return(new string[] { msgBinaryH, msgBinaryL });
        }
 public void FingerVibration(VibrationIDFlag.HandIndex p_handIndex, string power, VibrationIDFlag.FingerIndex[] fingers)
 {
     string[] formedMsgArray = MsgBinaryFormer(p_handIndex, power, fingers);
     if (formedMsgArray != null)
     {
         foreach (string msg in formedMsgArray)
         {
             QueueMsg(new VibrationDataSet(msg, p_handIndex));
         }
     }
 }
 public void FullHandVibration(VibrationIDFlag.HandIndex p_handIndex, string power)
 {
     QueueMsg(new VibrationDataSet(FullHandMsgBinaryFormer("00", power), p_handIndex));
     QueueMsg(new VibrationDataSet(FullHandMsgBinaryFormer("01", power), p_handIndex));
 }
 private VibrationSerialPort GetSerialPortByHandIndex(VibrationIDFlag.HandIndex p_handIndex)
 {
     return((p_handIndex == VibrationIDFlag.HandIndex.Right) ? RightHandPort : LeftHandPort);
 }
 public VibrationDataSet(string content, VibrationIDFlag.HandIndex handIndex)
 {
     this.content   = content;
     this.handIndex = handIndex;
 }
        private string GetFingerDataDicKey(VibrationIDFlag.HandIndex handIndex, VibrationIDFlag.FingerIndex fingerIndex)
        {
            string handIndexValue = ((int)handIndex).ToString(), fingerIndexValue = ((int)fingerIndex).ToString();

            return(handIndexValue + fingerIndexValue);
        }