Exemplo n.º 1
0
 public string activeBeansToString() //is this really dead? I think it's used in the debugg screen
 {
     /*
      * Converts the current master bean list to XML and spits it out in a string
      */
     return(CVRT.objectToXMLString(bActive));
 }
Exemplo n.º 2
0
        /// <summary>
        /// generates a list of undefined variables for arduino sketches
        /// </summary>
        /// <returns></returns>
        private string codeVariables_ArduinoUno()
        {
            string variableText = "";

            //there may be a bug in this loop, i had a note saying there was but i can't get it to break now.
            foreach (TElement t in broadcast.transmission.TElementList)
            {
                if (t.type != "byte")// || t.elementName == "trigger") //don't really want to use trigger in case someone uses that name in their code but you can't change anything to be type byte[]
                {
                    //variableText = String.Concat(variableText, CVRT.getDataTypeForArduinoUno(t) + " " + t.elementName + "=" + t.elementValueAsText + ";" + Environment.NewLine);


                    variableText = String.Concat(variableText, CVRT.getDataTypeForArduinoUno(t) + " " + t.elementName + ";" + Environment.NewLine);
                }
            }


            return(variableText);
        }
        //constructor overloads
        public Broadcast_Connection_Settings(Form1 mf) // create new mode. will overload this for the edit mode.
        {
            InitializeComponent();

            timerTransmissionDGVUpdater.Interval = 50;
            timerTransmissionDGVUpdater.Start();

            //setup USB port boxes
            string[] serialPorts = System.IO.Ports.SerialPort.GetPortNames();
            cbUSBPort.Items.AddRange(serialPorts);
            cbUSBBaud.Items.Add(2400);
            cbUSBBaud.Items.Add(4800);
            cbUSBBaud.Items.Add(9600);
            cbUSBBaud.Items.Add(14400);
            cbUSBBaud.Items.Add(19200);
            cbUSBBaud.Items.Add(28800);
            cbUSBBaud.Items.Add(38400);
            cbUSBBaud.Items.Add(57600);
            cbUSBBaud.Items.Add(115200);

            //cbUSBPort.SelectedIndex = 0;
            cbUSBBaud.SelectedIndex = 8;

            form1 = mf;
            //setting defaults

            //connectionType = 0;
            //triggerCheck();
            newChecker = true;
            broadcast  = new Broadcast(form1);
            TElement_Constant triggerElement = new TElement_Constant("trigger", CVRT.getBytes("#"));

            broadcast.transmission.AddTElement(triggerElement);
            dgvTransmission.AutoGenerateColumns = false;
            this.dgvTransmission.DataSource     = broadcast.transmission.TElementList;
        }
 private void btnCheckTransmission_Click(object sender, EventArgs e)
 {
     MessageBox.Show(CVRT.getString(broadcast.transmission.ProvideTransmission));
     //MessageBox.Show(CVRT.GetIntAsString(broadcast.transmission.ProvideTransmission));
     this.UpdateTransDGV();
 }
Exemplo n.º 5
0
        } //when the SEND CHECKBOX on the main for is clicked

        public void forceSendString(string outgoing)
        {
            connection.ForceSendThings(CVRT.getBytes(outgoing));
            form1.updateConsole("sent:" + outgoing + Environment.NewLine);
        }//For sending console commands