예제 #1
0
void STSimView::slot_run_finished(bool result) {
	Q_UNUSED(result)
	updatePlots();
	if (!ui.blockview->block()) {
		if (currentBlockNumber()>0) {
			//setCurrentBlockNumber(0);
		}
	}
}
예제 #2
0
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void StatsGenODFWidget::extractStatsData(int index, StatsData* statsData, unsigned int phaseType)
{
  VectorOfFloatArray arrays;
  if(phaseType == DREAM3D::PhaseType::PrimaryPhase)
  {
    PrimaryStatsData* pp = PrimaryStatsData::SafePointerDownCast(statsData);
    arrays = pp->getODF_Weights();
  }
  if(phaseType == DREAM3D::PhaseType::PrecipitatePhase)
  {
    PrecipitateStatsData* pp = PrecipitateStatsData::SafePointerDownCast(statsData);
    arrays = pp->getODF_Weights();
  }
  if(phaseType == DREAM3D::PhaseType::TransformationPhase)
  {
    TransformationStatsData* tp = TransformationStatsData::SafePointerDownCast(statsData);
    arrays = tp->getODF_Weights();
  }
  if (arrays.size() > 0)
  {
    QVector<float> e1(static_cast<int>(arrays[0]->getNumberOfTuples()));
    ::memcpy( e1.data(), arrays[0]->getVoidPointer(0), sizeof(float)*e1.size() );

    QVector<float> e2(static_cast<int>(arrays[1]->getNumberOfTuples()));
    ::memcpy( e2.data(), arrays[1]->getVoidPointer(0), sizeof(float)*e2.size() );

    QVector<float> e3(static_cast<int>(arrays[2]->getNumberOfTuples()));
    ::memcpy( e3.data(), arrays[2]->getVoidPointer(0), sizeof(float)*e3.size() );

    QVector<float> weights(static_cast<int>(arrays[3]->getNumberOfTuples()));
    ::memcpy( weights.data(), arrays[3]->getVoidPointer(0), sizeof(float)*weights.size() );

    QVector<float> sigmas(static_cast<int>(arrays[4]->getNumberOfTuples()));
    ::memcpy( sigmas.data(), arrays[4]->getVoidPointer(0), sizeof(float)*sigmas.size() );

    // Convert from Radians to Degrees for the Euler Angles
    for(int i = 0; i < e1.size(); ++i)
    {
      e1[i] = e1[i] * 180.0f / M_PI;
      e2[i] = e2[i] * 180.0f / M_PI;
      e3[i] = e3[i] * 180.0f / M_PI;
    }

    if(e1.size() > 0)
    {
      // Load the data into the table model
      m_ODFTableModel->setTableData(e1, e2, e3, weights, sigmas);
    }
  }
  // Write the MDF Data if we have that functionality enabled
  if (m_MDFWidget != NULL)
  {
    m_MDFWidget->extractStatsData(index, statsData, phaseType);
  }
  updatePlots();
}
예제 #3
0
ScorbotConsole::ScorbotConsole(OptionManager& mgr, 
    const std::string& descrName,
    const std::string& tagName) :
	ModelComponent(mgr, descrName, tagName)
{
	jointStringMap[ScorbotIce::Base]     = "Base";
	jointStringMap[ScorbotIce::Shoulder] = "Shoulder";
	jointStringMap[ScorbotIce::Elbow]    = "Elbow";
	jointStringMap[ScorbotIce::Wrist1]   = "Wrist1";
	jointStringMap[ScorbotIce::Wrist2]   = "Wrist2";
	jointStringMap[ScorbotIce::Gripper]  = "Gripper";
	jointStringMap[ScorbotIce::Slider]   = "Slider";

	itsSettings = new QSettings("iLab", "ScorbotConsole");

	itsMaxPlotLength = 100;

	int IceError = false;
	try
	{
		int argc = 1;
		char* argv[1];
		argv[0] = new char[128];
		sprintf(argv[0], "app-ScorbotConsole");
		ic = Ice::initialize(argc, argv);
		Ice::ObjectPrx base = ic->stringToProxy(
				"ScorbotServer:default -p 10000 -h ihead");
		itsScorbot = ScorbotIce::ScorbotPrx::checkedCast(base);
		if(!itsScorbot)
			throw "Invalid Proxy";
	}
	catch(const Ice::Exception& ex)
	{
		std::cerr << ex << std::endl;
		IceError = true;
	}
	catch(const char* msg)
	{
		std::cerr << msg << std::endl;
		IceError = false;
	}

	if(IceError)
		exit(-1);


	itsScorbotThread = new ScorbotInterfaceThread(this,&itsScorbot);
	connect(itsScorbotThread, SIGNAL(gotGravityCompensation(float)), this, SLOT(gotGravityCompensation(float)));
	connect(itsScorbotThread, SIGNAL(gotEncoderVal(int, int)), this, SLOT(gotEncoderVal(int, int)));
	connect(itsScorbotThread, SIGNAL(gotPWMVal(int, float)), this, SLOT(gotPWMVal(int, float)));
	connect(itsScorbotThread, SIGNAL(gotTargetPos(int, int)), this, SLOT(gotTargetPos(int, int)));
	connect(itsScorbotThread, SIGNAL(updatedAllValues()), this, SLOT(updatePlots()));
}
CFrequencyPlotContainer::CFrequencyPlotContainer(QWidget *pParent) :
  QWidget(pParent),
  mpRegistry(0),
  mpVBoxLayout(new QVBoxLayout(this)),
  mpTimer(new QTimer(this)) {
  setLayout(mpVBoxLayout);
  mpVBoxLayout->setSpacing(2);
  mpVBoxLayout->addStretch(1);

  /// update function of the plot is called periodically
  connect(mpTimer, SIGNAL(timeout()), this, SLOT(updatePlots()));
  // start update timer
  mpTimer->start(500);
};
예제 #5
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    simulator = new RSTrainSimulator();
    number_of_vehicles = 0;
    train_pos = 0;
    ui->plotArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
    ui->plotArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
    getter = simulator->getGetterAndLogger();
    timer = new QTimer();
    connect(timer, SIGNAL(timeout()), this, SLOT(updatePlots()));
    plotList = new QStringList;
    plotList->clear();
}
예제 #6
0
void STSimView::slot_scrollbar_value_changed() {
	m_current_block_number=ui.scrollbar->value();
	updatePlots();
}
예제 #7
0
void STSimView::setCurrentBlockNumber(long val) {
	m_current_block_number=val;
	ui.scrollbar->setValue(m_current_block_number);
	updatePlots();
}
예제 #8
0
void Server::readFromStdout()
{
    info = (QString)systemInfo->readAllStandardOutput();

    //strip off unnecessary output
    info.remove(0, 21);
    info.chop(3);

    if(!initialised)
    {
        //get the user name from the remote machine
        QString userName = info.section(":", 7, 7);
        userName.remove(0, 1);
        userName.chop(16);

        //indication of old yarp version where server does not recognise --sysinfo flag
        if(userName=="")
        {
            info.clear();
            supportedYarpVersion = false;
        }
        else
        {
            supportedYarpVersion = true;
        }

        initialised = true;
    }

    //add modules to server information
    QString moduleInfo;
    moduleInfo.append("Aquila modules: ");
    for(int i=0; i<modules.size(); i++)
    {
        moduleInfo.append(modules.at(i) + QString(" "));
    }

    if(modules.size()==0)
    {
        moduleInfo.append("no modules detected");
    }

    info.prepend(moduleInfo + QString("\n\n"));

    //show warning message in case the server runs unsupported yarp version
    if(!supportedYarpVersion)
    {
        info.append("This system appears to be running an older version of YARP that is not fully supported.\nPlease make sure that you run at least version ");
        info.append(minimumYarpVersion);
        stopAutoUpdate();
    }

    //set the text
    ui->textEdit_generalInfo->setText(info);

    //retrieve cpu and memory usage
    QString tmp = info;
    tmp.remove(0, tmp.indexOf("Cpu load Ins.: ")+15);
    tmp.remove(tmp.indexOf("\n"), tmp.size());
    cpuUsage = tmp.toInt();
    tmp = info;
    tmp.remove(0, tmp.indexOf("Memory total : ")+15);
    tmp.remove(tmp.indexOf("M"), tmp.size());
    totalMemory = tmp.toInt();
    tmp = info;
    tmp.remove(0, tmp.indexOf("Memory free  : ")+15);
    tmp.remove(tmp.indexOf("M"), tmp.size());
    freeMemory = tmp.toInt();

    //update cpu and memory usage plots
    updatePlots();
}
void IndirectFitPlotPresenter::updatePlotSpectrum(int spectrum) {
  m_view->setPlotSpectrum(spectrum);
  setActiveSpectrum(static_cast<std::size_t>(spectrum));
  updatePlots();
  updateFitRangeSelector();
}