void Foam::fixedFluxPressureFvPatchScalarField::updateCoeffs()
{
    if (updated())
    {
        return;
    }

    const fvPatchField<vector>& Up =
        patch().lookupPatchField<volVectorField, vector>(UName_);

    const surfaceScalarField& phi =
        db().lookupObject<surfaceScalarField>(phiName_);

    fvsPatchField<scalar> phip =
        patch().patchField<surfaceScalarField, scalar>(phi);

    if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
    {
        const fvPatchField<scalar>& rhop =
            patch().lookupPatchField<volScalarField, scalar>(rhoName_);

        phip /= rhop;
    }

    const fvPatchField<scalar>& rAp =
        patch().lookupPatchField<volScalarField, scalar>("(1|A("+UName_+"))");

    if (adjoint_)
    {
        gradient() = ((patch().Sf() & Up) - phip)/patch().magSf()/rAp;
    }
    else
    {
        gradient() = (phip - (patch().Sf() & Up))/patch().magSf()/rAp;
    }

    fixedGradientFvPatchScalarField::updateCoeffs();
}
Пример #2
0
void LiveStream::updateFrame()
{
    if (state() < Connecting || !m_thread || !m_thread->isRunning())
        return;

    if (++m_fpsUpdateCnt == int(1.5*renderTimerFps))
    {
        m_fps = m_fpsUpdateHits/1.5;
        m_fpsUpdateCnt = m_fpsUpdateHits = 0;
    }

    if (!m_thread || !m_thread->hasWorker())
        return;

    LiveStreamFrame *sf = m_thread->frameToDisplay();
    if (!sf) // no new frame
        return;

    delete m_frame;
    m_frame = sf;

    m_fpsUpdateHits++;

    if (state() == Connecting)
        setState(Streaming);
    m_frameInterval.restart();

    QMutexLocker locker(&m_currentFrameMutex);
    bool sizeChanged = (m_currentFrame.width() != sf->avFrame()->width ||
                        m_currentFrame.height() != sf->avFrame()->height);

    m_currentFrame = QImage(sf->avFrame()->data[0], sf->avFrame()->width, sf->avFrame()->height,
                            sf->avFrame()->linesize[0], QImage::Format_RGB32).copy();

    if (sizeChanged)
        emit streamSizeChanged(m_currentFrame.size());
    emit updated();
}
Пример #3
0
dspDetailedInventoryHistoryByLocation::dspDetailedInventoryHistoryByLocation(QWidget* parent, const char* name, Qt::WFlags fl)
    : XWidget(parent, name, fl)
{
    setupUi(this);

    connect(_print, SIGNAL(clicked()), this, SLOT(sPrint()));
    connect(_invhist, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*)));
    connect(_query, SIGNAL(clicked()), this, SLOT(sFillList()));
    connect(_location, SIGNAL(newID(int)), this, SLOT(sPopulateLocationInfo(int)));
    connect(_warehouse, SIGNAL(updated()), this, SLOT(sPopulateLocations()));

    _transType->append(cTransAll,       tr("All Transactions")       );
    _transType->append(cTransReceipts,  tr("Receipts")               );
    _transType->append(cTransIssues,    tr("Issues")                 );
    _transType->append(cTransShipments, tr("Shipments")              );
    _transType->append(cTransAdjCounts, tr("Adjustments and Counts") );

    if (_metrics->value("Application") != "PostBooks")
        _transType->append(cTransTransfers, tr("Transfers")              );

    _transType->append(cTransScraps,    tr("Scraps")                 );
    _transType->setCurrentIndex(0);

    _invhist->addColumn(tr("Date"), (_dateColumn + 30), Qt::AlignRight, true, "invhist_transdate");
    _invhist->addColumn(tr("Type"),       _transColumn, Qt::AlignCenter,true, "invhist_transtype");
    _invhist->addColumn(tr("Order #"),    _orderColumn, Qt::AlignLeft,  true, "ordernumber");
    _invhist->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft,  true, "item_number");
    _invhist->addColumn(tr("Lot/Serial #"), -1,         Qt::AlignLeft,  true, "lotserial");
    _invhist->addColumn(tr("UOM"),          _uomColumn, Qt::AlignCenter,true, "invhist_invuom");
    _invhist->addColumn(tr("Trans-Qty"),    _qtyColumn, Qt::AlignRight, true, "transqty");
    _invhist->addColumn(tr("Qty. Before"),  _qtyColumn, Qt::AlignRight, true, "qohbefore");
    _invhist->addColumn(tr("Qty. After"),   _qtyColumn, Qt::AlignRight, true, "qohafter");

    _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), TRUE);
    _dates->setEndNull(tr("Latest"),     omfgThis->endOfTime(),   TRUE);

    sPopulateLocations();
}
void LinearTransferFunctionWidget::mouseMoveEvent(QMouseEvent * event)
{
  QWidget::mouseMoveEvent(event);

  if(selectedPointIndex != -1) {
    QPointF widgetMousePoint = event->posF();
    QPointF mousePoint = widgetPointToPoint(widgetMousePoint);

    // Clamp x value.
    if(selectedPointIndex == 0) {

      // the first point must have x == 0.
      mousePoint.rx() = 0.;
    }
    else if(selectedPointIndex == points.size() - 1) {

      // The last point must have x == 1.
      mousePoint.rx() = 1.;
    }
    else {

      // Intermediate points must have x between their neighbors.
      mousePoint.rx() = std::max(mousePoint.x(), points[selectedPointIndex - 1].x());
      mousePoint.rx() = std::min(mousePoint.x(), points[selectedPointIndex + 1].x());
    }

    // Clamp y value.
    mousePoint.ry() = std::min(mousePoint.y(), 1.);
    mousePoint.ry() = std::max(mousePoint.y(), 0.);

    points[selectedPointIndex] = mousePoint;

    repaint();

    if(updateDuringChange == true)
      emit updated();
  }
}
Пример #5
0
void Process::setStatus(Status const status)
{
   if (m_status == status) return;
   m_status = status;

   switch (m_status) {
      case NotRunning:
         break;
      case Queued:
         m_submitTime = QTime::currentTime().toString("h:mm:ss");
         break;
      case Running:
         m_timer.start();
         break;
      case Suspended:
         m_timer.stop();
         break;
      case Killed:
         m_timer.stop();
         break;
      case Error:
         m_timer.stop();
         finished();
         break;
      case Finished:
         m_timer.stop();
         finished();
         break;
      case Copying:
         QLOG_ERROR() << "Process::setStatus called while Copying";
         break;
      case Unknown:
         m_timer.stop();
         break;
   }

   updated();
}
Пример #6
0
void User::update(const protobufs::UserStats &stats, const QList<Map*> &map_pool, const QMap<int, Division*> &divisions)
{
	this->state_ = ErosUserState::Known;
	this->username_ = QString::fromStdString(stats.username());
	this->id_ = stats.id();
    this->ladder_stats_global_ = new UserLadderStats(this, stats.wins(), stats.losses(), stats.forfeits(), stats.walkovers(), stats.points(), stats.mmr() * 100, stats.placements_remaining(), divisions[stats.division()], stats.division_rank());
	this->division_ = this->ladder_stats_global_->division();
	this->search_radius_ = stats.search_radius();
	for (int i = 0; i < stats.region_size(); i++)
	{
		const protobufs::UserRegionStats &region = stats.region(i);
        this->ladder_stats_[(ErosRegion)region.region()] = new UserLadderStats(this, region.wins(), region.losses(), region.forfeits(), region.walkovers(), region.points(), region.mmr() * 100, region.placements_remaining(), divisions[region.division()], region.division_rank());
	}

	this->vetoes_.clear();

	for (int i = 0; i < stats.vetoes_size(); i++)
	{
		const protobufs::Map &map_buffer = stats.vetoes(i);
		for (int j = 0; j < map_pool.size(); j++)
		{
			if (map_pool[j]->battleNetId() == map_buffer.battle_net_id() && map_pool[j]->region() == map_buffer.region())
			{
				this->vetoes_ << map_pool[j];
				break;
			}
		}
	}

	if (this->first_update_)
	{
		this->first_update_ = false;
	} 
	else
	{
		emit updated(this);
	}	
}
Пример #7
0
PackageModel::PackageModel( QObject* parent )
    : QAbstractItemModel( parent )
    , storage( 0 )
{
    networked = AbstractPackageController::factory( AbstractPackageController::network, this );
    installed = AbstractPackageController::factory( AbstractPackageController::installed, this );

    // can only have a max of 15 top level items
    rootItems << installed << networked;    //this must stay in sync with installedIndex
    //and networkedIndex

    for ( int i = 0; i < rootItems.count(); i++ )
        connect( rootItems[i], SIGNAL(updated()),
                 this, SLOT(controllerUpdate()) );
    connect( networked, SIGNAL(packageInstalled(InstallControl::PackageInfo)),
             installed, SLOT(addPackage(InstallControl::PackageInfo)) );
    connect( networked, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
             this, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)));
    connect( networked, SIGNAL(rowsRemoved(QModelIndex,int,int)),
             this, SIGNAL(rowsRemoved(QModelIndex,int,int)));
    connect( networked, SIGNAL(packageInstalled(InstallControl::PackageInfo)),
             this, SLOT(packageInstalled(InstallControl::PackageInfo)) );
    connect( networked, SIGNAL(serverStatus(QString)),
             this, SLOT(serverStatusUpdated(QString)) );

    // can only have a max of 4 columns, if more are needed, change the
    // macros used for PackageModel::index(...) below
    // columnHeads << "Name" << "Size";

    QStorageMetaInfo *s = QStorageMetaInfo::instance();
    connect( s, SIGNAL(disksChanged()),
             this, SLOT(publishTargets()) );
    connect( this, SIGNAL(targetsUpdated(QStringList)),
             installed, SLOT(reloadInstalledLocations(QStringList)) );

    if ( !QDir( Qtopia::packagePath() ).exists() )
        QDir::root().mkpath( Qtopia::packagePath() );
}
Пример #8
0
CustomerSelector::CustomerSelector(QWidget *pParent, const char *pName) : QWidget(pParent, pName)
{
  setupUi(this);

  setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));

  _select->setCurrentIndex(All);
  _cust->setId(-1);
  _customerTypes->setId(-1);
  _customerType->setText("");

  connect(_select,SIGNAL(currentIndexChanged(int)), this, SIGNAL(updated()));
  connect(_select,SIGNAL(currentIndexChanged(int)), this, SIGNAL(newState(int)));
  connect(_cust,                SIGNAL(newId(int)), this, SIGNAL(updated()));
  connect(_cust,                SIGNAL(newId(int)), this, SIGNAL(newCustId(int)));
  connect(_customerTypes,         SIGNAL(newID(int)), this, SIGNAL(updated()));
  connect(_customerTypes,         SIGNAL(newID(int)), this, SIGNAL(newCustTypeId(int)));
  connect(_customerType,   SIGNAL(editingFinished()), this, SIGNAL(updated()));
  connect(_customerType,   SIGNAL(editingFinished()), this, SLOT(sTypePatternFinished()));
  connect(_customerType,SIGNAL(textChanged(QString)), this, SIGNAL(newTypePattern(QString)));

  setFocusProxy(_select);
}
Пример #9
0
//==================================================
// == Set An Option's  Value
void XSettingsModel::set_value(QString option, QString value)
{
	//qDebug() << "set " << option << _loading;
	if(_loading){
		return;
	}
	//= Find item matching the "option"
	QList<QStandardItem *>items = findItems(option, Qt::MatchExactly,C_OPTION);
	//qDebug() << "opts" << items;

	//TODO handle error if not found

	//= Get/update the "enabled" item in the same row
	QStandardItem *vItem = item(items[0]->row(),C_VALUE);
	vItem->setText(value);

	QStandardItem *eItem = item(items[0]->row(),C_ENABLED);



	emit upx(option, eItem->text() == "1",  value);
	emit updated(get_fgfs_list());
}
Пример #10
0
//==================================================
// == Set An Option Enabled or Disabled
void XSettingsModel::set_enabled(QString option, bool enabled)
{
	//qDebug() << "set " << option << _loading;
	if(_loading){
		return;
	}
	//= Find item matching the "option"
	QList<QStandardItem *>items = findItems(option, Qt::MatchExactly,C_OPTION);
	//qDebug() << "opts" << items;

	//TODO handle error if not found

	//= Get/update the "enabled" item in the same row
	QStandardItem *eItem = item(items[0]->row(),C_ENABLED);
	eItem->setText(enabled ? "1" : "0");

	set_row_bg(items[0]->row(), enabled ? QColor(200,255,200) : QColor(240,240,240));

	QStandardItem *vItem = item(items[0]->row(),C_VALUE);

	emit upx(option, enabled, vItem->text());
	emit updated(get_fgfs_list());
}
void Foam::SRFFreestreamVelocityFvPatchVectorField::updateCoeffs()
{
    if (updated())
    {
        return;
    }

    // Get reference to the SRF model
    const SRF::SRFModel& srf =
        db().lookupObject<SRF::SRFModel>("SRFProperties");

    scalar time = this->db().time().value();
    scalar theta = time*mag(srf.omega().value());

    refValue() =
        cos(theta)*UInf_ + sin(theta)*(srf.axis() ^ UInf_)
      - srf.velocity(patch().Cf());

    // Set the inlet-outlet choice based on the direction of the freestream
    valueFraction() = 1.0 - pos(refValue() & patch().Sf());

    mixedFvPatchField<vector>::updateCoeffs();
}
Пример #12
0
int
Scene::erase(int index)
{
    if(index < 0 || index >= m_entries.size())
        return -1;

    Scene_item* item = m_entries[index];
  Q_EMIT itemAboutToBeDestroyed(item);
    delete item;
    m_entries.removeAt(index);

  selected_item = -1;

  QAbstractListModel::beginResetModel();
  Q_EMIT updated();
  QAbstractListModel::endResetModel();

    if(--index >= 0)
        return index;
    if(!m_entries.isEmpty())
        return 0;
    return -1;
}
Пример #13
0
maintainShipping::maintainShipping(QWidget* parent, const char* name, Qt::WFlags fl)
    : QMainWindow(parent, name, fl)
{
  setupUi(this);

  (void)statusBar();

  connect(_ship, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*,QTreeWidgetItem*)));
  connect(_warehouse, SIGNAL(updated()), this, SLOT(sFillList()));

  _ship->setRootIsDecorated(TRUE);
  _ship->addColumn(tr("Shipment #"),      _orderColumn, Qt::AlignLeft   );
  _ship->addColumn(tr("Order/Line #"),     _itemColumn, Qt::AlignRight  );
  _ship->addColumn(tr("Prnt'ed"),          _dateColumn, Qt::AlignCenter );
  _ship->addColumn(tr("Cust./Item #"),     _itemColumn, Qt::AlignLeft   );
  _ship->addColumn(tr("Name/Description"), -1,          Qt::AlignLeft   );
  _ship->addColumn(tr("Ship Via"),         _itemColumn, Qt::AlignLeft   );
  _ship->addColumn(tr("UOM"),              _uomColumn,  Qt::AlignLeft   );
  _ship->addColumn(tr("Qty. At Ship"),     _qtyColumn,  Qt::AlignRight  );
  _ship->addColumn(tr("Hold Type"),                 0,  Qt::AlignCenter );

  sFillList();
}
Пример #14
0
uninvoicedShipments::uninvoicedShipments(QWidget* parent, const char* name, Qt::WindowFlags fl)
    : XWidget(parent, name, fl)
{
  setupUi(this);

  connect(_print, SIGNAL(clicked()), this, SLOT(sPrint()));
  connect(_close, SIGNAL(clicked()), this, SLOT(close()));
  connect(_showUnselected, SIGNAL(toggled(bool)), this, SLOT(sFillList()));
  connect(_shipitem, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*)));
  connect(_warehouse, SIGNAL(updated()), this, SLOT(sFillList()));

  _shipitem->setRootIsDecorated(true);
  _shipitem->addColumn(tr("Order/Line #"),           _itemColumn, Qt::AlignRight,  true,  "orderline" );
  _shipitem->addColumn(tr("Cust./Item Number"),      _itemColumn, Qt::AlignLeft,   true,  "custitem"  );
  _shipitem->addColumn(tr("Cust. Name/Description"), -1,          Qt::AlignLeft,   true,  "custdescrip"  );
  _shipitem->addColumn(tr("UOM"),                    _uomColumn,  Qt::AlignLeft,   true,  "uom_name"  );
  _shipitem->addColumn(tr("Shipped"),                _qtyColumn,  Qt::AlignRight,  true,  "shipped" );
  _shipitem->addColumn(tr("Approved"),               _qtyColumn,  Qt::AlignRight,  true,  "selected" );
  
  connect(omfgThis, SIGNAL(billingSelectionUpdated(int, int)), this, SLOT(sFillList()));

  sFillList();
}
void Foam::SRFcylindricalInletVelocityFvPatchVectorField::updateCoeffs()
{
    if (updated())
    {
        return;
    }

    vector hatAxis = axis_/mag(axis_); // unit vector of axis of rotation

    vectorField r = (patch().Cf() - centre_); // defining vector origin to face centre

    vectorField d =  r - (hatAxis & r)*hatAxis; // subtract out axial-component

    vectorField dhat = d/mag(d); // create unit-drection vector

    vectorField tangVelo =  (tangentVelocity_)*(hatAxis)^dhat; // tangentialVelocity * zhat X rhat

    // If relative, include the effect of the SRF
    if (relative_)
    {
        // Get reference to the SRF Model
	const SRF::SRFModel& srf =
	     db().lookupObject<SRF::SRFModel>("SRFProperties");

        // Determine patch velocity due to SRF
	const vectorField SRFVelocity = srf.velocity(patch().Cf());

	operator==(-SRFVelocity + tangVelo + hatAxis*axialVelocity_ + radialVelocity_*dhat); // combine components into vector form
    }
    // If absolute, simply supply the inlet value as a fixed value
    else
    {
        operator==(tangVelo + hatAxis*axialVelocity_ + radialVelocity_*dhat);
    }

    fixedValueFvPatchField<vector>::updateCoeffs();
}
void temperatureDirectedInletOutletVelocityFvPatchVectorField::updateCoeffs()
{
    if (updated())
    {
        return;
    }

    const vectorField& C = patch().Cf();
    vectorField rotationVelocity = omega_ ^ C;
    vectorField inletDirCCS = inletDir_/mag(inletDir_);
    vectorField inletDir(inletDirCCS);

    if (cylindricalCCS_)
    {
        scalar radius;
        forAll(C, facei)
        {
            radius = sqrt(sqr(C[facei].x())+ sqr(C[facei].y()));
            inletDir[facei].z() = inletDirCCS[facei].z();

            if (radius > 0.0)
            {
                inletDir[facei].x() =
                    (C[facei].x()*inletDirCCS[facei].x()
                    - C[facei].y()*inletDirCCS[facei].y())/radius;

                inletDir[facei].y() =
                    (C[facei].y()*inletDirCCS[facei].x()
                    + C[facei].x()*inletDirCCS[facei].y())/radius;
            }
            else
            {
                inletDir[facei].x() = 0.0;
                inletDir[facei].y() = 0.0;
            }
        }
    }
Пример #17
0
void Simulation::move(VelocityControl *control) {
    if (!m_motionModel || !m_sensorModel) {
        return;
    }

    pfcpp::OdometryMotionModelSampler motion_model(m_motionModel->params());

    pfcpp::BeamSensorModel sensor_model(
        {m_sensorModel->maxRange(),
         {m_sensorModel->a0(), m_sensorModel->a1(), m_sensorModel->a2(), m_sensorModel->a3()},
         m_sensorModel->sigma(),
         m_sensorModel->lambda()});
    pfcpp::VelocityMotionModelSampler movement;
    pimpl->robot_pos = movement(pimpl->robot_pos, *control);

    std::vector<double> actual_measument;
    std::vector<pfcpp::maps::ShapesMap::Position> sense_points;
    std::tie(actual_measument, sense_points) = flatworld::measurement_with_coords(
        pimpl->robot_pos, pimpl->map, m_mcl->numberOfBeams(), m_sensorModel->maxRange());
    auto expected_measument = [&](auto p) {
        return flatworld::measurement(p, pimpl->map, m_mcl->numberOfBeams(),
                                      m_sensorModel->maxRange());
    };

    pimpl->pf([&](auto p) { return sensor_model(actual_measument, expected_measument(p)); },
              [&](auto p) { return motion_model(p, movement(p, *control)); });

    m_sensorBeams.clear();
    for (auto p : sense_points) {
        m_sensorBeams.push_back(std::make_shared<PointW>(QPointF{std::get<0>(p), std::get<1>(p)}));
    }

    m_currentPose->setPosition({pimpl->robot_pos.x, pimpl->robot_pos.y});

    updateParticlesList();
    emit updated();
}
Пример #18
0
locations::locations(QWidget* parent, const char* name, Qt::WFlags fl)
  : XWidget(parent, name, fl)
{
  setupUi(this);


  // signals and slots connections
  connect(_print, SIGNAL(clicked()), this, SLOT(sPrint()));
  connect(_new, SIGNAL(clicked()), this, SLOT(sNew()));
  connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit()));
  connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete()));
  connect(_close, SIGNAL(clicked()), this, SLOT(close()));
  connect(_location, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool)));
  connect(_view, SIGNAL(clicked()), this, SLOT(sView()));
  connect(_warehouse, SIGNAL(updated()), this, SLOT(sFillList()));

  _location->addColumn(tr("Site"),        _whsColumn,  Qt::AlignCenter, true,  "warehous_code" );
  _location->addColumn(tr("Name"),        _itemColumn, Qt::AlignLeft,   true,  "name"   );
  _location->addColumn(tr("Description"), -1,          Qt::AlignLeft,   true,  "locationname"   );
  _location->addColumn(tr("Netable"),     80,          Qt::AlignCenter, true,  "netable" );
  _location->addColumn(tr("Restricted"),  80,          Qt::AlignCenter, true,  "restricted" );

  if (_privileges->check("MaintainLocations"))
  {
    connect(_location, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool)));
    connect(_location, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool)));
    connect(_location, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick()));
  }
  else
  {
    _new->setEnabled(FALSE);
    connect(_location, SIGNAL(itemSelected(int)), _view, SLOT(animateClick()));
  }

  sFillList();
}
Пример #19
0
SurfaceAnimatorDialog::SurfaceAnimatorDialog(Layer::Molecule* molecule) :
    QDialog(QApplication::activeWindow()), m_molecule(molecule), m_loop(false),
    m_bounce(false), m_updateBonds(false), m_animator(0)
{
    m_dialog.setupUi(this);
    m_colorPositive = Preferences::PositiveSurfaceColor();
    m_colorNegative = Preferences::NegativeSurfaceColor();
    setPositiveColor(m_colorPositive);
    setNegativeColor(m_colorNegative);
    m_dialog.playbackBox->setEnabled(false);

    m_dialog.speedSlider->setValue(25);

    on_speedSlider_valueChanged(25);
    m_dialog.transparencySlider->setValue(100);

    connect(this, SIGNAL(pushAnimators(AnimatorList const&)),
            m_molecule, SIGNAL(pushAnimators(AnimatorList const&)));

    connect(this, SIGNAL(popAnimators(AnimatorList const&)),
            m_molecule, SIGNAL(popAnimators(AnimatorList const&)));

    connect(this, SIGNAL(updated()), m_molecule, SIGNAL(softUpdate()));
}
Пример #20
0
dspBacklogByItem::dspBacklogByItem(QWidget* parent, const char* name, Qt::WFlags fl)
    : XMainWindow(parent, name, fl)
{
  setupUi(this);

  (void)statusBar();

  connect(_item, SIGNAL(newId(int)), this, SLOT(sFillList()));
  connect(_print, SIGNAL(clicked()), this, SLOT(sPrint()));
  connect(_showPrices, SIGNAL(toggled(bool)), this, SLOT(sHandlePrices(bool)));
  connect(_soitem, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*)));
  connect(_warehouse, SIGNAL(updated()), this, SLOT(sFillList()));

  _item->setType(ItemLineEdit::cSold);
  _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), TRUE);
  _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), TRUE);

  _soitem->addColumn(tr("S/O #"),            _orderColumn,      Qt::AlignLeft   );
  _soitem->addColumn(tr("#"),                _seqColumn,        Qt::AlignCenter );
  _soitem->addColumn(tr("Customer"),         -1,                Qt::AlignLeft   );
  _soitem->addColumn(tr("Ordered"),          _dateColumn,       Qt::AlignCenter );
  _soitem->addColumn(tr("Scheduled"),        _dateColumn,       Qt::AlignCenter );
  _soitem->addColumn(tr("Qty. UOM"),         _qtyColumn,        Qt::AlignRight  );
  _soitem->addColumn(tr("Ordered"),          _qtyColumn,        Qt::AlignRight  );
  _soitem->addColumn(tr("Shipped"),          _qtyColumn,        Qt::AlignRight  );
  _soitem->addColumn(tr("Balance"),          _qtyColumn,        Qt::AlignRight  );
  if (_privileges->check("ViewCustomerPrices") || _privileges->check("MaintainCustomerPrices"))
    _soitem->addColumn(tr("Ext. Price"),     _bigMoneyColumn,   Qt::AlignRight  );

  _showPrices->setEnabled(_privileges->check("ViewCustomerPrices") || _privileges->check("MaintainCustomerPrices"));

  if (! _showPrices->isChecked())
    _soitem->hideColumn(AMOUNT_COL);

  _item->setFocus();
}
Пример #21
0
void
LM::HeapRoster::handle_up (LmConnection* connection_,
			   const std::string name_)
{
  connection = connection_;
  name = name_;

  { // populate the roster
    LmMessage* roster_request = lm_message_new_with_sub_type (NULL, LM_MESSAGE_TYPE_IQ, LM_MESSAGE_SUB_TYPE_GET);
    LmMessageNode* node = lm_message_node_add_child (lm_message_get_node (roster_request), "query", NULL);
    lm_message_node_set_attributes (node, "xmlns", "jabber:iq:roster", NULL);
    lm_connection_send_with_reply (connection, roster_request,
				   build_message_handler (boost::bind (&LM::HeapRoster::handle_initial_roster_reply, this, _1, _2)), NULL);
    lm_message_unref (roster_request);
  }
  { // initial presence push
    LmMessage* presence_push = lm_message_new (NULL, LM_MESSAGE_TYPE_PRESENCE);
    lm_connection_send (connection, presence_push, NULL);
    lm_message_unref (presence_push);
  }

  on_personal_details_updated (); // fake, but if we start as dnd, we want it known
  updated ();
}
Пример #22
0
void KisGmicUpdater::finishedDownload(QNetworkReply*reply)
{
    if(reply->error() != QNetworkReply::NoError)
    {
        dbgPlugins << "NetworkReply error : " << reply->errorString();
    }

    dbgPlugins << "bytes available: " << reply->bytesAvailable();
    dbgPlugins << reply->url() << " finished";

    QString path = KGlobal::dirs()->saveLocation("gmic_definitions");
    QString fileName = reply->url().path().split("/").last();

    QByteArray data = reply->readAll();

    QString tmpfilePath = path + fileName + QString(".cimgz");
    QFile out(tmpfilePath);
    out.open(QIODevice::WriteOnly);
    out.write(data);
    out.close();

    QString filePathDst = path + fileName;

    std::FILE *file = std::fopen(tmpfilePath.toUtf8().constData(),"rb");
    cimg_library::CImg<unsigned char> buffer;
    buffer.load_cimg(file);
    buffer.save_raw(filePathDst.toUtf8().constData());
    std::fclose(file);

    if (!QFile::remove(tmpfilePath))
    {
        dbgPlugins << "Cannot delete " << tmpfilePath;
    }

    emit updated();
}
Пример #23
0
bool QNetworkManagerSettingsConnection::setConnections()
{
    if (!isValid())
        return false;

    QDBusConnection dbusConnection = QDBusConnection::systemBus();
    bool allOk = true;
    if (!dbusConnection.connect(service(),
                               interfacepath,
                               QLatin1String(NM_DBUS_IFACE_SETTINGS_CONNECTION),
                               QLatin1String("Updated"),
                               this, SIGNAL(updated()))) {
        allOk = false;
    }

    if (!dbusConnection.connect(service(),
                               interfacepath,
                               QLatin1String(NM_DBUS_IFACE_SETTINGS_CONNECTION),
                               QLatin1String("Removed"),
                               this, SIGNAL(slotSettingsRemoved()))) {
        allOk = false;
    }
    return allOk;
}
Пример #24
0
/*
 *  Constructs a dspPurchaseReqsByItem as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 */
dspPurchaseReqsByItem::dspPurchaseReqsByItem(QWidget* parent, const char* name, Qt::WFlags fl)
    : XMainWindow(parent, name, fl)
{
  setupUi(this);

  (void)statusBar();

  // signals and slots connections
  connect(_print, SIGNAL(clicked()), this, SLOT(sPrint()));
  connect(_item, SIGNAL(newId(int)), this, SLOT(sFillList()));
  connect(_close, SIGNAL(clicked()), this, SLOT(close()));
  connect(_item, SIGNAL(valid(bool)), _print, SLOT(setEnabled(bool)));
  connect(_pr, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*,QTreeWidgetItem*)));
  connect(_warehouse, SIGNAL(updated()), this, SLOT(sFillList()));
  connect(_item, SIGNAL(warehouseIdChanged(int)), _warehouse, SLOT(setId(int)));
  connect(_item, SIGNAL(newId(int)), _warehouse, SLOT(findItemSites(int)));

  _pr->addColumn(tr("Status"),       _statusColumn, Qt::AlignCenter, true,  "pr_status" );
  _pr->addColumn(tr("Parent Order"), -1,            Qt::AlignLeft,   true,  "parent"   );
  _pr->addColumn(tr("Due Date"),     _dateColumn,   Qt::AlignCenter, true,  "pr_duedate" );
  _pr->addColumn(tr("Qty."),         _qtyColumn,    Qt::AlignRight,  true,  "pr_qtyreq"  );
  
  connect(omfgThis, SIGNAL(purchaseRequestsUpdated()), this, SLOT(sFillList()));
}
Пример #25
0
bool QNetworkManagerSettingsConnection::setConnections()
{
    if(!isValid() )
        return false;

    bool allOk = false;
    if(!QDBusConnection::systemBus().connect(d->service, d->path,
                           QLatin1String(NM_DBUS_IFACE_SETTINGS_CONNECTION), QLatin1String("NewConnection"),
                           this, SIGNAL(updated(QNmSettingsMap)))) {
        allOk = true;
    }

    nmDBusHelper = new QNmDBusHelper(this);
    connect(nmDBusHelper, SIGNAL(pathForSettingsRemoved(const QString &)),
            this,SIGNAL(removed( const QString &)));

    if (!QDBusConnection::systemBus().connect(d->service, d->path,
                           QLatin1String(NM_DBUS_IFACE_SETTINGS_CONNECTION), QLatin1String("Removed"),
                           nmDBusHelper, SIGNAL(slotSettingsRemoved()))) {
        allOk = true;
    }

    return allOk;
}
void rotatingTotalPressureFvPatchScalarField::updateCoeffs()
{
    if (updated())
    {
        return;
    }

    if (!this->db().objectRegistry::found(UName()))
    {
        // U not available, do not update
        totalPressureFvPatchScalarField::updateCoeffs();

        return;
    }

    vector axisHat = omega_/mag(omega_);
    vectorField rotationVelocity =
        omega_ ^ (patch().Cf() - axisHat*(axisHat & patch().Cf()));

    vectorField Up = lookupPatchField<volVectorField, vector>(UName())
        + rotationVelocity;

    totalPressureFvPatchScalarField::updateCoeffs(Up);
}
Пример #27
0
maintainShipping::maintainShipping(QWidget* parent, const char* name, Qt::WFlags fl)
    : XWidget(parent, name, fl)
{
    setupUi(this);

//  (void)statusBar();

    connect(_ship, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*,QTreeWidgetItem*)));
    connect(_warehouse, SIGNAL(updated()), this, SLOT(sFillList()));

    _ship->setRootIsDecorated(TRUE);
    _ship->addColumn(tr("Shipment #"),      _orderColumn, Qt::AlignLeft,  true, "shiphead_number");
    _ship->addColumn(tr("Order Type"),     _statusColumn, Qt::AlignLeft,  true, "ordertype");
    _ship->addColumn(tr("Order/Line #"),     _itemColumn, Qt::AlignRight, true, "linenumber");
    _ship->addColumn(tr("Printed"),          _dateColumn, Qt::AlignCenter,true, "sfstatus");
    _ship->addColumn(tr("Cust./Item #"),     _itemColumn, Qt::AlignLeft,  true, "dest");
    _ship->addColumn(tr("Name/Description"), -1,          Qt::AlignLeft,  true, "description");
    _ship->addColumn(tr("Ship Via"),         _itemColumn, Qt::AlignLeft,  true, "shiphead_shipvia");
    _ship->addColumn(tr("UOM"),              _uomColumn,  Qt::AlignLeft,  true, "uom_name");
    _ship->addColumn(tr("Qty. At Ship"),     _qtyColumn,  Qt::AlignRight, true, "shipqty");
    _ship->addColumn(tr("Hold Type"),                 0,  Qt::AlignCenter,true, "holdtype");

    sFillList();
}
Пример #28
0
CGAL::Three::Scene_item*
Scene::replaceItem(Scene::Item_id index, CGAL::Three::Scene_item* item, bool emit_item_about_to_be_destroyed)
{
    if(index < 0 || index >= m_entries.size())
        return 0;

    if(emit_item_about_to_be_destroyed) {
    Q_EMIT itemAboutToBeDestroyed(m_entries[index]);
    }

    connect(item, SIGNAL(itemChanged()),
            this, SLOT(itemChanged()));
    std::swap(m_entries[index], item);
    if ( item->isFinite() && !item->isEmpty() &&
         m_entries[index]->isFinite() && !m_entries[index]->isEmpty() &&
         item->bbox()!=m_entries[index]->bbox() )
    {
    Q_EMIT updated_bbox();
    }
  Q_EMIT updated();
    itemChanged(index);
    Q_EMIT restoreCollapsedState();
    return item;
}
Пример #29
0
/*
 *  Constructs a uninvoicedShipments as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 */
uninvoicedShipments::uninvoicedShipments(QWidget* parent, const char* name, Qt::WFlags fl)
    : XMainWindow(parent, name, fl)
{
  setupUi(this);

  // signals and slots connections
  connect(_print, SIGNAL(clicked()), this, SLOT(sPrint()));
  connect(_close, SIGNAL(clicked()), this, SLOT(close()));
  connect(_showUnselected, SIGNAL(toggled(bool)), this, SLOT(sFillList()));
  connect(_coship, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*)));
  connect(_warehouse, SIGNAL(updated()), this, SLOT(sFillList()));

  _coship->setRootIsDecorated(TRUE);
  _coship->addColumn(tr("Order/Line #"),           _itemColumn, Qt::AlignRight );
  _coship->addColumn(tr("Cust./Item Number"),      _itemColumn, Qt::AlignLeft  );
  _coship->addColumn(tr("Cust. Name/Description"), -1,          Qt::AlignLeft  );
  _coship->addColumn(tr("UOM"),                    _uomColumn,  Qt::AlignLeft  );
  _coship->addColumn(tr("Shipped"),                _qtyColumn,  Qt::AlignRight );
  _coship->addColumn(tr("Selected"),               _qtyColumn,  Qt::AlignRight );
  
  connect(omfgThis, SIGNAL(billingSelectionUpdated(int, int)), this, SLOT(sFillList()));

  sFillList();
}
Пример #30
0
Mpris::Mpris(QObject *p)
    : QObject(p)
    , pos(-1)
{
    QDBusConnection::sessionBus().registerService("org.mpris.MediaPlayer2.cantata");

    new PlayerAdaptor(this);
    new MediaPlayer2Adaptor(this);

    QDBusConnection::sessionBus().registerObject("/org/mpris/MediaPlayer2", this, QDBusConnection::ExportAdaptors);
    connect(this, SIGNAL(setRandom(bool)), MPDConnection::self(), SLOT(setRandom(bool)));
    connect(this, SIGNAL(setRepeat(bool)), MPDConnection::self(), SLOT(setRepeat(bool)));
    connect(this, SIGNAL(setSeekId(qint32, quint32)), MPDConnection::self(), SLOT(setSeekId(qint32, quint32)));
    connect(this, SIGNAL(setVolume(int)), MPDConnection::self(), SLOT(setVolume(int)));

//    connect(MPDConnection::self(), SIGNAL(currentSongUpdated(const Song &)), this, SLOT(updateCurrentSong(const Song &)));
    connect(MPDStatus::self(), SIGNAL(updated()), this, SLOT(updateStatus()));
    if (mprisPath.isEmpty()) {
        mprisPath=QLatin1String(CANTATA_REV_URL);
        mprisPath.replace(".", "/");
        mprisPath="/"+mprisPath+"/Track/%1";
    }
    connect(CurrentCover::self(), SIGNAL(coverFile(const QString &)), this, SLOT(updateCurrentCover(const QString &)));
}