예제 #1
0
void Ur5MessageDecoder::pushState(QByteArray data,Ur5State &state)
{
    if(data.size() == 251)
    {
        setJointData(removeHeader(data),state);
    }
    if(data.size() == 53)
    {
        setCartData(removeHeader(data),state);
    }
}
예제 #2
0
RDButtonDialog::RDButtonDialog(QString station_name,
			       const QString &label_template,
			       RDCartDialog *cart_dialog,const QString &svcname,
			       QWidget *parent)
  : QDialog(parent,"",true)
{
  //
  // Fix the Window Size
  //
  setMinimumWidth(sizeHint().width());
  setMaximumWidth(sizeHint().width());
  setMinimumHeight(sizeHint().height());
  setMaximumHeight(sizeHint().height());

  setCaption(tr("Edit Button"));
  edit_station_name=station_name;
  edit_label_template=label_template;
  edit_cart_dialog=cart_dialog;
  edit_svcname=svcname;

  //
  // Create Fonts
  //
  QFont font=QFont("Helvetica",12,QFont::Normal);
  font.setPixelSize(12);
  QFont label_font=QFont("Helvetica",12,QFont::Bold);
  label_font.setPixelSize(12);
  QFont button_font=QFont("Helvetica",14,QFont::Bold);
  button_font.setPixelSize(14);
  QFont counter_font=QFont("Helvetica",24,QFont::Bold);
  counter_font.setPixelSize(24);

  //
  // Button Label
  //
  edit_label_edit=new QLineEdit(this,"edit_label_edit");
  edit_label_edit->setGeometry(60,10,300,20);
  edit_label_edit->setFont(font);
  QLabel *label=new QLabel(edit_label_edit,tr("Label:"),
			   this,"edit_label_label");
  label->setGeometry(10,12,45,16);
  label->setFont(label_font);
  label->setAlignment(Qt::AlignRight);

  //
  // Button Cart
  //
  edit_cart_edit=new QLineEdit(this,"edit_cart_edit");
  edit_cart_edit->setGeometry(60,34,300,20);
  edit_cart_edit->setFont(font);
  edit_cart_edit->setReadOnly(true);
  label=new QLabel(edit_cart_edit,tr("Cart:"),this,"edit_cart_label");
  label->setGeometry(10,36,45,16);
  label->setFont(label_font);
  label->setAlignment(Qt::AlignRight);

  //
  // Set Cart Button
  //
  QPushButton *button=new QPushButton(this,"cart_button");
  button->setGeometry(55,60,80,50);
  button->setFont(label_font);
  button->setText(tr("Set\nCart"));
  connect(button,SIGNAL(clicked()),this,SLOT(setCartData()));
  
  //
  // Clear Button
  //
  button=new QPushButton(this,"cart_button");
  button->setGeometry(145,60,80,50);
  button->setFont(label_font);
  button->setText(tr("Clear"));
  connect(button,SIGNAL(clicked()),this,SLOT(clearCartData()));
  
  //
  // Color Button
  //
  edit_color_button=new QPushButton(this,"edit_color_button");
  edit_color_button->setGeometry(sizeHint().width()-135,60,80,50);
  edit_color_button->setFont(label_font);
  edit_color_button->setText(tr("Set\nColor"));
  connect(edit_color_button,SIGNAL(clicked()),this,SLOT(setColorData()));
  
  //
  //  Ok Button
  //
  button=new QPushButton(this,"ok_button");
  button->setGeometry(sizeHint().width()-180,sizeHint().height()-60,80,50);
  button->setDefault(true);
  button->setFont(label_font);
  button->setText(tr("&OK"));
  connect(button,SIGNAL(clicked()),this,SLOT(okData()));

  //
  //  Cancel Button
  //
  button=new QPushButton(this,"cancel_button");
  button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,80,50);
  button->setFont(label_font);
  button->setText(tr("&Cancel"));
  connect(button,SIGNAL(clicked()),this,SLOT(cancelData()));
}