Beispiel #1
0
        private void CbMouthPositions_SelectedValueChanged(object sender, EventArgs e)
        {
            // Determine Mouth Position
            int           value         = (int)cbMouthPositions.SelectedValue;
            MouthPosition mouthPosition = (MouthPosition)value;

            // Set Mouth Position
            TextToSpeech_MouthPositionChange(mouthPosition);
        }
Beispiel #2
0
        private void TextToSpeech_MouthPositionChange(MouthPosition mouthPosition)
        {
            switch (mouthPosition)
            {
            case MouthPosition.Closed:
                this.led5a.Visible = false;
                this.led5b.Visible = false;
                this.led5c.Visible = false;
                this.led4a.Visible = false;
                this.led4b.Visible = false;
                this.led2a.Visible = false;
                this.led2b.Visible = false;
                this.led2c.Visible = false;
                this.led1a.Visible = false;
                this.led1b.Visible = false;
                break;

            case MouthPosition.Open1:
                this.led5a.Visible = false;
                this.led5b.Visible = false;
                this.led5c.Visible = false;
                this.led4a.Visible = false;
                this.led4b.Visible = false;
                this.led2a.Visible = true;
                this.led2b.Visible = true;
                this.led2c.Visible = true;
                this.led1a.Visible = false;
                this.led1b.Visible = false;
                break;

            case MouthPosition.Open2:
                this.led5a.Visible = false;
                this.led5b.Visible = false;
                this.led5c.Visible = false;
                this.led4a.Visible = false;
                this.led4b.Visible = false;
                this.led2a.Visible = true;
                this.led2b.Visible = true;
                this.led2c.Visible = true;
                this.led1a.Visible = true;
                this.led1b.Visible = true;
                break;

            case MouthPosition.Open3:
                this.led5a.Visible = true;
                this.led5b.Visible = true;
                this.led5c.Visible = true;
                this.led4a.Visible = false;
                this.led4b.Visible = false;
                this.led2a.Visible = true;
                this.led2b.Visible = true;
                this.led2c.Visible = true;
                this.led1a.Visible = true;
                this.led1b.Visible = true;
                break;

            case MouthPosition.Open4:
                this.led5a.Visible = false;
                this.led5b.Visible = false;
                this.led5c.Visible = false;
                this.led4a.Visible = true;
                this.led4b.Visible = true;
                this.led2a.Visible = true;
                this.led2b.Visible = true;
                this.led2c.Visible = true;
                this.led1a.Visible = true;
                this.led1b.Visible = true;
                break;

            case MouthPosition.LittleOoh:
                this.led5a.Visible = true;
                this.led5b.Visible = true;
                this.led5c.Visible = true;
                this.led4a.Visible = false;
                this.led4b.Visible = false;
                this.led2a.Visible = true;
                this.led2b.Visible = true;
                this.led2c.Visible = true;
                this.led1a.Visible = false;
                this.led1b.Visible = false;
                break;

            case MouthPosition.BigSmile:
                this.led5a.Visible = true;
                this.led5b.Visible = true;
                this.led5c.Visible = true;
                this.led4a.Visible = true;
                this.led4b.Visible = true;
                this.led2a.Visible = true;
                this.led2b.Visible = true;
                this.led2c.Visible = true;
                this.led1a.Visible = true;
                this.led1b.Visible = true;
                break;

            /*case MouthPosition.BigOoh:
             *  this.led5a.Visible = true;
             *  this.led5b.Visible = true;
             *  this.led5c.Visible = true;
             *  this.led4a.Visible = false;
             *  this.led4b.Visible = false;
             *  this.led2a.Visible = true;
             *  this.led2b.Visible = true;
             *  this.led2c.Visible = true;
             *  this.led1a.Visible = true;
             *  this.led1b.Visible = true;
             *  break;*/
            case MouthPosition.LittleFrown:
                this.led5a.Visible = true;
                this.led5b.Visible = true;
                this.led5c.Visible = true;
                this.led4a.Visible = false;
                this.led4b.Visible = false;
                this.led2a.Visible = false;
                this.led2b.Visible = false;
                this.led2c.Visible = false;
                this.led1a.Visible = false;
                this.led1b.Visible = false;
                break;

            case MouthPosition.BigFrown:
                this.led5a.Visible = true;
                this.led5b.Visible = true;
                this.led5c.Visible = true;
                this.led4a.Visible = false;
                this.led4b.Visible = false;
                this.led2a.Visible = false;
                this.led2b.Visible = false;
                this.led2c.Visible = false;
                this.led1a.Visible = true;
                this.led1b.Visible = true;
                break;

            default:
                throw new NotImplementedException();
            }

            // F*****g Duuuuuuuh
            if (Program.Started && Program.Engine != null)
            {
                Program.Engine.Machine.SerialPortController.SendCommand(90 + (int)mouthPosition);
            }
        }
Beispiel #3
0
 public void SetMouthPosition(MouthPosition mouthPosition)
 {
     TextToSpeech_MouthPositionChange(mouthPosition);
 }