Esempio n. 1
0
 private void TimerSerial_Tick(object sender, EventArgs e)
 {
     if (SerialPort.GetPortNames().Length != comboBoxSerial.Items.Count)
     {
         comboBoxSerial.Items.Clear();
         comboBoxSerial.Items.AddRange(SerialPort.GetPortNames());
         comboBoxSerial.SelectedIndex = comboBoxSerial.Items.Count - 1;
     }
     if (comboBoxSerial.Items.Count == 0)
     {
         buttonConnect.Enabled = false;
     }
     else
     {
         buttonConnect.Enabled = true;
     }
     labelSpeedX.Text        = "X: " + Vx.ToString();
     labelSpeedY.Text        = "Y: " + Vy.ToString();
     labelSpeedZ.Text        = "Z: " + Rw.ToString();
     labelMA.Text            = "MA: " + dataVal[0];
     labelMB.Text            = "MB: " + dataVal[1];
     labelMC.Text            = "MC: " + dataVal[2];
     labelMD.Text            = "MD: " + dataVal[3];
     labelStepperHeight.Text = "H: " + dataVal[4];
     labelServo.Text         = "S: " + dataVal[5];
     labelP.Text             = "P: " + dataVal[6];
     labelI.Text             = "I: " + dataVal[7];
     textBoxP.Text           = "P: " + P.ToString();
     textBoxI.Text           = "I: " + I.ToString();
     textBoxStpHeight.Text   = StepperHeight.ToString();
 }
Esempio n. 2
0
 void SetSendContent()
 {
     textBoxSend.Text = "(" + Vx.ToString() + " " +
                        Vy.ToString() + " " +
                        Rw.ToString() + " " +
                        StepperHeight.ToString() + " " +
                        pulleyAState.ToString() + " " +
                        pulleyBState.ToString() + " " +
                        pulleyCState.ToString() + " " +
                        pulleyCHook.ToString() + " " +
                        P.ToString() + " " +
                        I.ToString() + ")";
     return;
 }
Esempio n. 3
0
        /// <summary>
        ///     Shows the release notes.
        /// </summary>
        /// <remarks></remarks>
        private void ShowReleaseNotes()
        {
            Stream s = GetReleaseNotes();

            if (s == null)
            {
                return;
            }
            Rw.LoadReleaseNotes(s);
            if (Rw.IsVisible)
            {
                Rw.Activate();
            }
            Rw.Show();
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (gvComm.SelectedIndex > -1)
            {
                System.Text.StringBuilder x = new System.Text.StringBuilder();
                foreach (GridViewRow Rw in gvSendBy.Rows)
                {
                    if ((Rw.FindControl("chkSendBy") as CheckBox).Checked)
                    {
                        x.Append(string.Format("{0}:", gvSendBy.DataKeys[Rw.DataItemIndex].Value));
                    }
                }

                odsSendBy.UpdateParameters["SendBy"].DefaultValue = x.ToString();
                odsSendBy.Update();
                iMsg.ShowMsg("Thank You! Your settings have been saved.", true);
            }
            else
            {
                iMsg.ShowErr("Sorry! Please select contact information before saving settings.", true);
            }
        }
Esempio n. 5
0
 public bool IsRW()
 {
     return(Rw.Equals("R/W"));
 }
Esempio n. 6
0
 /// <summary>
 ///     Handles the Closed event of the AppletWindowBase control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs" /> instance containing the event data.</param>
 /// <remarks></remarks>
 private void AppletWindowBaseClosed(object sender, EventArgs e)
 {
     Rw.Close();
 }
Esempio n. 7
0
        public object GetTotal(int column, string group)
        {
            object ColType = this.ColumnHeaders[column].TotalFunction;

            if (ColType == null)
            {
                return(null);
            }
            else if (ColType is QuickFunctions)
            {
                QuickFunctions TotType = (QuickFunctions)ColType;
                switch (TotType)
                {
                // Funciones varias
                case QuickFunctions.TotalName:
                    if (group == null)
                    {
                        return("TOTAL");
                    }
                    else
                    {
                        return("Subtotal " + group);
                    }

                // Funciones que cuentan
                case QuickFunctions.Count:
                    if (group == null)
                    {
                        return(this.Rows.Count);
                    }
                    else
                    {
                        decimal ResCount = 0;
                        foreach (Row Rw in this.Rows)
                        {
                            if (group == Rw.GetFormattedGroup())
                            {
                                ResCount++;
                            }
                        }
                        return(ResCount);
                    }

                // Funciones que suman
                default:
                    decimal ResSum = 0;
                    foreach (Row Rw in this.Rows)
                    {
                        if (group == null || group == Rw.GetFormattedGroup())
                        {
                            decimal CellValue = System.Convert.ToDecimal(Rw.Cells[column].Content);
                            switch (TotType)
                            {
                            case QuickFunctions.Sum:
                                ResSum += CellValue;
                                break;

                            case QuickFunctions.SumNegatives:
                                if (CellValue < 0)
                                {
                                    ResSum += CellValue;
                                }
                                break;

                            case QuickFunctions.SumPositives:
                                if (CellValue > 0)
                                {
                                    ResSum += CellValue;
                                }
                                break;
                            }
                        }
                    }
                    return(ResSum);
                }
            }
            else
            {
                return(ColType.ToString());
            }
        }