Esempio n. 1
0
Core::GeneratedFiles
        EmptyProjectWizard::generateFiles(const QWizard *w,
                                        QString * /*errorMessage*/) const
{
    const EmptyProjectWizardDialog *wizard = qobject_cast< const EmptyProjectWizardDialog *>(w);
    const QtProjectParameters params = wizard->parameters();
    const QString projectPath = params.projectPath();
    const QString profileName = Core::BaseFileWizard::buildFileName(projectPath, params.name, profileSuffix());

    Core::GeneratedFile profile(profileName);
    return Core::GeneratedFiles() << profile;
}
Esempio n. 2
0
void ProfileDialog::slotOk()
{
    const int index = mListView->itemIndex(mListView->selectedItem());
    if(index < 0)
        return; // none selected

    assert((unsigned int)index < mProfileList.count());

    KConfig profile(*mProfileList.at(index), true, false);
    emit profileSelected(&profile);
    KDialogBase::slotOk();
}
Esempio n. 3
0
bool MFolderFromProfile::Rename(const String& newName)
{
   CHECK( !m_folderName.empty(), false, _T("can't rename the root pseudo-folder") );

   String path = m_folderName.BeforeLast(_T('/')),
          name = m_folderName.AfterLast(_T('/'));

   String newFullName = path;
   if ( !path.empty() )
      newFullName += _T('/');
   newFullName += newName;

   // we can't use Exists() here as it tries to read a value from the config
   // group newFullName and, as a side effect of this, creates this group, so
   // Profile::Rename() below will then fail!
#if 0
   if ( Exists(newFullName) )
   {
      wxLogError(_("Cannot rename folder '%s' to '%s': the folder with "
                   "the new name already exists."),
                   m_folderName.c_str(), newName.c_str());

      return false;
   }
#endif // 0

   Profile_obj profile(path);
   CHECK( profile, false, _T("panic in MFolder: no profile") );
   if ( !profile->Rename(name, newName) )
   {
      wxLogError(_("Cannot rename folder '%s' to '%s': the folder with "
                   "the new name already exists."),
                   m_folderName.c_str(), newName.c_str());

      return false;
   }

   String oldName = m_folderName;
   m_folderName = newFullName;

   // TODO: MFolderCache should just subscribe to "Rename" events...
   MFolderCache::RenameAll(oldName, newFullName);

   // notify everybody about the change of the folder name
   MEventManager::Send(
     new MEventFolderTreeChangeData(oldName,
                                    MEventFolderTreeChangeData::Rename,
                                    newFullName)
     );

   return true;
}
Esempio n. 4
0
/**
 * Calculate CBC encryption or decryption cost
 *
 * @v cipher			Cipher algorithm
 * @v key_len			Length of key
 * @v op			Encryption or decryption operation
 * @ret cost			Cost (in cycles per byte)
 */
static unsigned long cbc_cost ( struct cipher_algorithm *cipher,
				size_t key_len,
				void ( * op ) ( struct cipher_algorithm *cipher,
						void *ctx, const void *src,
						void *dst, size_t len ) ) {
	static uint8_t random[8192]; /* Too large for stack */
	uint8_t key[key_len];
	uint8_t iv[cipher->blocksize];
	uint8_t ctx[cipher->ctxsize];
	union profiler profiler;
	unsigned long long elapsed;
	unsigned long cost;
	unsigned int i;
	int rc;

	/* Fill buffer with pseudo-random data */
	srand ( 0x1234568 );
	for ( i = 0 ; i < sizeof ( random ) ; i++ )
		random[i] = rand();
	for ( i = 0 ; i < sizeof ( key ) ; i++ )
		key[i] = rand();
	for ( i = 0 ; i < sizeof ( iv ) ; i++ )
		iv[i] = rand();

	/* Initialise cipher */
	rc = cipher_setkey ( cipher, ctx, key, key_len );
	assert ( rc == 0 );
	cipher_setiv ( cipher, ctx, iv );

	/* Time operation */
	profile ( &profiler );
	op ( cipher, ctx, random, random, sizeof ( random ) );
	elapsed = profile ( &profiler );

	/* Round to nearest whole number of cycles per byte */
	cost = ( ( elapsed + ( sizeof ( random ) / 2 ) ) / sizeof ( random ) );

	return cost;
}
Core::GeneratedFiles SubdirsProjectWizard::generateFiles(const QWizard *w,
                                                         QString * /*errorMessage*/) const
{
    const SubdirsProjectWizardDialog *wizard = qobject_cast< const SubdirsProjectWizardDialog *>(w);
    const QtProjectParameters params = wizard->parameters();
    const QString projectPath = params.projectPath();
    const QString profileName = Core::BaseFileWizardFactory::buildFileName(projectPath, params.fileName, profileSuffix());

    Core::GeneratedFile profile(profileName);
    profile.setAttributes(Core::GeneratedFile::OpenProjectAttribute | Core::GeneratedFile::OpenEditorAttribute);
    profile.setContents(QLatin1String("TEMPLATE = subdirs\n"));
    return Core::GeneratedFiles() << profile;
}
Esempio n. 6
0
    Profile *ProfileManager::find_load_profile(const std::string &name)
    {
        auto loaded = profile(name);
        if (loaded != nullptr)
        {
            return loaded;
        }

        std::string path("profiles/");
        path += name;
        path += ".lua";
        return ProfileLuaSerialiser::deserialise(path);
    }
Esempio n. 7
0
ParseTree* parseFile(ParserContext& context)
{
	gUniqueNames.clear();
	gUniqueTypes.clear();
	gUniqueExpressions.clear();

	SemaContext& globals = *new SemaContext(context, getAllocator(context));
	SemaNamespace& walker = *new SemaNamespace(globals);
	ParserGeneric<SemaNamespace> parser(context, walker);

	cpp::symbol_sequence<cpp::declaration_seq> result(NULL);
	try
	{
		ProfileScope profile(gProfileParser);
		PROFILESCOPE_ENABLECOLLECTION(profile2);
		PARSE_SEQUENCE(parser, result);
	}
	catch(ParseError&)
	{
	}
	catch(SemanticError&)
	{
		printPosition(parser.context.getErrorPosition());
		std::cout << "caught SemanticError" << std::endl;
		throw;
	}
	catch(SymbolsError&)
	{
		printPosition(parser.context.getErrorPosition());
		std::cout << "caught SymbolsError" << std::endl;
		throw;
	}
	catch(TypeError& e)
	{
		e.report();
	}
	if(!context.finished())
	{
		printError(parser);
	}
	dumpProfile(gProfileIo);
	dumpProfile(gProfileWave);
	dumpProfile(gProfileParser);
	dumpProfile(gProfileLookup);
	dumpProfile(gProfileDiagnose);
	dumpProfile(gProfileAllocator);
	dumpProfile(gProfileIdentifier);
	dumpProfile(gProfileTemplateId);

	return result.get();
}
int test_basic_profile_population() {
    int fails=0;
    pstrudel::Profile   profile(0);
    std::vector<double> raw_data{3, 7, 9, 10};
    profile.set_data(raw_data.begin(), raw_data.end());
    raw_data.insert(raw_data.begin(), 0); // profile generation adds '0'
    fails += platypus::testing::compare_equal(
            raw_data,
            profile.get_profile(raw_data.size()),
            __FILE__,
            __LINE__,
            "incorrect raw-data sized profile");
    return fails;
}
int test_basic_profile_interpolation() {
    int fails=0;
    pstrudel::Profile   profile(0);
    std::vector<double> raw_data{3, 7, 9, 10};
    profile.set_data(raw_data.begin(), raw_data.end());
    std::vector<double> expected{0, 1.5, 3, 5, 7, 8, 9, 9.5, 10};
    fails += platypus::testing::compare_equal(
            expected,
            profile.get_profile(raw_data.size() * 2),
            __FILE__,
            __LINE__,
            "incorrect interpolated profile");
    return fails;
}
sk_sp<GrFragmentProcessor> GrCircleBlurFragmentProcessor::Make(GrResourceProvider* resourceProvider,
                                                               const SkRect& circle, float sigma) {
    float solidRadius;
    float textureRadius;
    sk_sp<GrTextureProxy> profile(create_profile_texture(resourceProvider, circle, sigma,
                                                         &solidRadius, &textureRadius));
    if (!profile) {
        return nullptr;
    }
    return sk_sp<GrFragmentProcessor>(new GrCircleBlurFragmentProcessor(resourceProvider,
                                                                        circle,
                                                                        textureRadius, solidRadius,
                                                                        std::move(profile)));
}
Esempio n. 11
0
//static
QPixmap KThumb::getImage(KUrl url, int frame, int width, int height)
{
    Mlt::Profile profile(KdenliveSettings::current_profile().toUtf8().constData());
    QPixmap pix(width, height);
    if (url.isEmpty()) return pix;

    //"<mlt><playlist><producer resource=\"" + url.path() + "\" /></playlist></mlt>");
    //Mlt::Producer producer(profile, "xml-string", tmp);
    Mlt::Producer *producer = new Mlt::Producer(profile, url.path().toUtf8().constData());
    double swidth = (double) profile.width() / profile.height();
    pix = QPixmap::fromImage(getFrame(producer, frame, (int) (height * swidth + 0.5), width, height));
    delete producer;
    return pix;
}
Esempio n. 12
0
/** \brief function to test a pkttype_t
 */
nunit_res_t	pkttype_testclass_t::comparison(const nunit_testclass_ftor_t &testclass_ftor) throw()
{
	// log to debug
	KLOG_DBG("enter");
	// set variable
	pkttype_profile_t	profile(10, 2, pkttype_profile_t::UINT32);
	nunit_pkttype_t		pkttype = nunit_pkttype_t(profile).PKT_REQUEST();
	// do some comparison
	NUNIT_ASSERT( pkttype == pkttype.PKT_REQUEST() );
	NUNIT_ASSERT( pkttype != pkttype.PKT_REPLY() );
	NUNIT_ASSERT( pkttype <  pkttype.PKT_REPLY() );
	// return no error
	return NUNIT_RES_OK;
}
Esempio n. 13
0
 void GateInit(RTC::Manager* manager)
 {
   int i;
   for (i = 0; strlen(gate_spec[i]) != 0; i++);
   char** spec_intl = new char*[i + 1];
   for (int j = 0; j < i; j++) {
     spec_intl[j] = (char *)_(gate_spec[j]);
   }
   spec_intl[i] = (char *)"";
   coil::Properties profile((const char **)spec_intl);
   manager->registerFactory(profile,
                            RTC::Create<Gate>,
                            RTC::Delete<Gate>);
 }
Esempio n. 14
0
 void PulseAudioInputInit(RTC::Manager* manager)
 {
   int i;
   for (i = 0; strlen(pulseaudioinput_spec[i]) != 0; i++);
   char** spec_intl = new char*[i + 1];
   for (int j = 0; j < i; j++) {
     spec_intl[j] = _((char *)pulseaudioinput_spec[j]);
   }
   spec_intl[i] = (char *)"";
   coil::Properties profile((const char **)spec_intl);
   manager->registerFactory(profile,
                          RTC::Create<PulseAudioInput>,
                          RTC::Delete<PulseAudioInput>);
 }
Esempio n. 15
0
/** \brief Construct a bt_io_write_t request
 */
bt_io_write_t *	bt_io_cache_t::write_ctor(const file_range_t &totfile_range, const datum_t &data2write
					, bt_io_write_cb_t *callback, void *userptr)	throw()
{
	// if write-thru, simply forward to the subio_vapi
	if( profile().write_thru() ){
		// remove all bt_io_cache_block_t contained in this totfile_range
		// - NOTE: this ensure that previously-read data will not remain 
		block_remove_included_in(totfile_range);
		// simply return a write on the subio_vapi
		return subio_vapi()->write_ctor(totfile_range, data2write, callback, userptr);
	}
	// else it is write-delayed, and so use the bt_io_cache_write_t
	return nipmem_new bt_io_cache_write_t(this, totfile_range, data2write, callback, userptr);
}
Esempio n. 16
0
static void TH135LoadProfile()
{
#define LoadAddress(N) { TCHAR addrStr[16]; \
	s_##N = profile.ReadString(_T("Address"), _T(#N), _T(""), addrStr, sizeof addrStr); \
	if (!::StrToIntEx(addrStr, STIF_SUPPORT_HEX, reinterpret_cast<int *>(&s_##N))) s_##N = Default_##N;  }
#define LoadChar(N) profile.ReadString(_T("TH135"), _T(#N), Default_##N, s_##N, sizeof s_##N)

	Minimal::ProcessHeapPath profPath = g_appPath;
	CProfileIO profile(profPath /= _T("TH135Addr.ini"));
	LoadChar(WindowClass);
	LoadChar(WindowCaption);

	LoadAddress(CoreBase);
}
Esempio n. 17
0
void main(int argc, char** argv){
	gint isStd=1;
	gint suiteSize=0;
	if(argc>=2){
		isStd=atoi(argv[1]);
		if(argc>=3){
			TESTCASEDIR=argv[2];
			if(argc>=4){
				CURRDIR=argv[3];
				if(argc>=5){
					timeout_sec=atof(argv[4]);
					if(argc>=6){
						suiteSize=atoi(argv[5]);
					
					}
				}
				else{
					timeout_sec=TIMEOUT;
				}
			}
			else{
				CURRDIR=DEFAULT_CURR_DIR;
				timeout_sec=TIMEOUT;
			}
		}
		else{
			TESTCASEDIR=DEFAULT_TESTCASES_DIR;
			CURRDIR=DEFAULT_CURR_DIR;
			timeout_sec=TIMEOUT;
		}
	}
	else{
		isStd=1;
		CURRDIR=DEFAULT_CURR_DIR;
		TESTCASEDIR=DEFAULT_TESTCASES_DIR;
		timeout_sec=TIMEOUT;
	}

	randomUtility=g_rand_new();
	logfp=fopen("memoryLog.txt", "w+");
	readTestcases();
fprintf(logfp, "timeout_sec=%lf\n", timeout_sec);
fflush(logfp);
	double time=0, time_usr=0, time_sys=0, memory=0, correctness=0;
	profile(&time_usr, &time_sys, &memory, &correctness, suiteSize, isStd);
	freeTestcases();
	fclose(logfp);
	g_rand_free(randomUtility);
}
void BronchoscopyRegistrationWidget::setup()
{
	mOptions = profile()->getXmlSettings().descend("bronchoscopyregistrationwidget");

	mSelectMeshWidget = StringPropertySelectMesh::New(mServices->patient());
	mSelectMeshWidget->setValueName("Centerline: ");

	//this->initializeTrackingService();

	connect(mServices->patient().get(),&PatientModelService::patientChanged,this,&BronchoscopyRegistrationWidget::clearDataOnNewPatient);

	mProcessCenterlineButton = new QPushButton("Process centerline");
	connect(mProcessCenterlineButton, SIGNAL(clicked()), this, SLOT(processCenterlineSlot()));
	mProcessCenterlineButton->setToolTip(this->defaultWhatsThis());

//	mBronchoscopeRegistrationPtr = BronchoscopeRegistrationPtr(new BronchoscopePositionProjection());
//	mProjectionCenterlinePtr->createMaxDistanceToCenterlineOption(mOptions.getElement());

	mRegisterButton = new QPushButton("Register");
	connect(mRegisterButton, SIGNAL(clicked()), this, SLOT(registerSlot()));
	mRegisterButton->setToolTip(this->defaultWhatsThis());

	mRecordTrackingWidget = new RecordTrackingWidget(mOptions.descend("recordTracker"),
													 mServices->acquisition(), mServices,
													 "bronc_path",
													 this);
	mRecordTrackingWidget->getSessionSelector()->setHelp("Select bronchoscope path for registration");
	mRecordTrackingWidget->getSessionSelector()->setDisplayName("Bronchoscope path");

	mVerticalLayout->setMargin(0);
	mVerticalLayout->addWidget(new DataSelectWidget(mServices->view(), mServices->patient(), this, mSelectMeshWidget));

	this->selectSubsetOfBranches(mOptions.getElement());
	this->createMaxNumberOfGenerations(mOptions.getElement());
	this->useLocalRegistration(mOptions.getElement());
	this->createMaxLocalRegistrationDistance(mOptions.getElement());

//	PropertyPtr maxLocalRegistrationDistance = mProjectionCenterlinePtr->getMaxLocalRegistrationDistanceOption();

	mVerticalLayout->addWidget(new CheckBoxWidget(this, mUseSubsetOfGenerations));
	mVerticalLayout->addWidget(createDataWidget(mServices->view(), mServices->patient(), this, mMaxNumberOfGenerations));
	mVerticalLayout->addWidget(mProcessCenterlineButton);
	mVerticalLayout->addWidget(mRecordTrackingWidget);
	mVerticalLayout->addWidget(new CheckBoxWidget(this, mUseLocalRegistration));
	mVerticalLayout->addWidget(createDataWidget(mServices->view(), mServices->patient(), this, mMaxLocalRegistrationDistance));
	mVerticalLayout->addWidget(mRegisterButton);

	mVerticalLayout->addStretch();
}
Esempio n. 19
0
/** \brief Start the operation
 */
bt_err_t	bt_io_cache_t::start(bt_io_cache_pool_t *m_cache_pool
				, bt_io_vapi_t *m_subio_vapi)	throw()
{
	// copy the parameter
	this->m_cache_pool	= m_cache_pool;
	this->m_subio_vapi	= m_subio_vapi;

	// link this object from the bt_io_cache_pool_t
	m_cache_pool->cache_dolink(this);

	// start the cleaning_timeout
	cleaning_timeout.start(profile().cleaning_max_delay(), this, NULL );
	// return no error
	return bt_err_t::OK;
}
Esempio n. 20
0
void KImportDlg::slotBrowse()
{
  // determine what the browse prefix should be from the current profile

  MyMoneyQifProfile tmpprofile;
  tmpprofile.loadProfile("Profile-" + profile());

  QUrl file = QFileDialog::getOpenFileUrl(this, i18n("Import File..."), QUrl("kfiledialog:///kmymoney-import"),
      i18n("Import files (%1);;All files (%2)", tmpprofile.filterFileType(), "*")
  );

  if (!file.isEmpty()) {
    m_qlineeditFile->setText(file.toDisplayString(QUrl::PreferLocalFile));
  }
}
Esempio n. 21
0
//---------------------------------------------------------------------
void line_profile_aa::set(double center_width, double smoother_width) {
  double base_val = 1.0;
  if (center_width == 0.0) center_width = 1.0 / subpixel_scale;
  if (smoother_width == 0.0) smoother_width = 1.0 / subpixel_scale;

  double width = center_width + smoother_width;
  if (width < m_min_width) {
    double k = width / m_min_width;
    base_val *= k;
    center_width /= k;
    smoother_width /= k;
  }

  value_type* ch = profile(center_width + smoother_width);

  unsigned subpixel_center_width = unsigned(center_width * subpixel_scale);
  unsigned subpixel_smoother_width = unsigned(smoother_width * subpixel_scale);

  value_type* ch_center = ch + subpixel_scale * 2;
  value_type* ch_smoother = ch_center + subpixel_center_width;

  unsigned i;

  unsigned val = m_gamma[unsigned(base_val * aa_mask)];
  ch = ch_center;
  for (i = 0; i < subpixel_center_width; i++) {
    *ch++ = (value_type)val;
  }

  for (i = 0; i < subpixel_smoother_width; i++) {
    *ch_smoother++ = m_gamma[unsigned(
        (base_val - base_val * (double(i) / subpixel_smoother_width)) *
        aa_mask)];
  }

  unsigned n_smoother = profile_size() - subpixel_smoother_width -
                        subpixel_center_width - subpixel_scale * 2;

  val = m_gamma[0];
  for (i = 0; i < n_smoother; i++) {
    *ch_smoother++ = (value_type)val;
  }

  ch = ch_center;
  for (i = 0; i < subpixel_scale * 2; i++) {
    *--ch = *ch_center++;
  }
}
Esempio n. 22
0
    virtual void on_draw()
    {
        int width = rbuf_window().width();
        int height = rbuf_window().height();

        typedef agg::renderer_base<pixfmt> renderer_base;
        typedef agg::renderer_scanline_aa_solid<renderer_base> renderer_solid;

        pixfmt pixf(rbuf_window());
        renderer_base rb(pixf);
        renderer_solid r(rb);
        rb.clear(agg::rgba(1,1,1));

        agg::trans_affine mtx;
        mtx *= agg::trans_affine_translation(-g_base_dx, -g_base_dy);
        mtx *= agg::trans_affine_scaling(g_scale, g_scale);
        mtx *= agg::trans_affine_rotation(g_angle + agg::pi);
        mtx *= agg::trans_affine_skewing(g_skew_x/1000.0, g_skew_y/1000.0);
        mtx *= agg::trans_affine_translation(width/2, height/2);

        if(m_scanline.status())
        {
            agg::conv_stroke<agg::path_storage> stroke(g_path);
            stroke.width(m_width_slider.value());
            stroke.line_join(agg::round_join);
            agg::conv_transform<agg::conv_stroke<agg::path_storage> > trans(stroke, mtx);
            agg::render_all_paths(g_rasterizer, g_scanline, r, trans, g_colors, g_path_idx, g_npaths);
        }
        else
        {
            typedef agg::renderer_outline_aa<renderer_base> renderer_type;
            typedef agg::rasterizer_outline_aa<renderer_type> rasterizer_type;

            double w = m_width_slider.value() * mtx.scale();

            agg::line_profile_aa profile(w, agg::gamma_none());
            renderer_type ren(rb, profile);
            rasterizer_type ras(ren);

            agg::conv_transform<agg::path_storage> trans(g_path, mtx);

            ras.render_all_paths(trans, g_colors, g_path_idx, g_npaths);
        }


        agg::render_ctrl(g_rasterizer, g_scanline, rb, m_width_slider);
        agg::render_ctrl(g_rasterizer, g_scanline, rb, m_scanline);
    }
Esempio n. 23
0
bool ProfileDatabase::loadParsedDatabase(const pugi::xml_document &doc)
{
    LOG4CPLUS_TRACE_METHOD(msLogger, __PRETTY_FUNCTION__ );
    if (EDB_NORMAL_OK != mDbState)
    {
        LOG4CPLUS_ERROR(msLogger, "parsing state error");
        return false;
    }
    pugi::xml_node profs = doc.child("profiles");

    for (pugi::xml_node_iterator it = profs.begin(); it != profs.end(); ++it)
    {
        LOG4CPLUS_INFO(msLogger, "Profile adding");
        Profile::Uid profileUid = Profile::Uid(it->child_value("uid"));
        Profile::ApiUid apiUid = Profile::ApiUid(it->child_value("api-uid"));
        std::string name = it->child_value("name");
        Profile::Uid complement = Profile::Uid(it->child_value("complement"));
        if ("" == profileUid.value() || "" == apiUid.value() || "" == complement.value() || "" == name)
        {
            LOG4CPLUS_WARN(msLogger, "Profile adding error\nProfile UID: " + profileUid.value() +
                    ", API UID: " + apiUid.value() + ", Complement UID: " + complement.value() +
                    ", name: " + name);
            continue;
        }
        ProfileInfo profile(profileUid, apiUid, complement, name);

        pugi::xml_node libs = it->child("libs");
        for (pugi::xml_node_iterator sit = libs.begin(); sit != libs.end(); ++sit)
        {
            std::string pathToLib = mRootFolderPath + (std::string)sit->attribute("path").value();
            UInt32 version = atoi(sit->attribute("version").value());
            std::string platform = sit->attribute("platform").value();
            profile.addLib(ProfileLibInfo(version, pathToLib, platform));
        }

        ProfileInfoMap::iterator mit = mProfiles.find(profile.uid());
        if (mProfiles.end() == mit)
        {
            mProfiles.insert(std::make_pair(profile.uid(), profile));
            LOG4CPLUS_INFO(msLogger, "Added profile into profiles map, profile UID: " + profile.uid().value());
        }
        else
        {
            LOG4CPLUS_WARN(msLogger, "Error: UID repetition: " + profile.uid().value());
        }
    }
    return true;
}
Esempio n. 24
0
void
FBAggGlue::render()
{
//    GNASH_REPORT_FUNCTION;

    if (_drawbounds.size() == 0 ) {
        log_error(_("No Drawbounds set in %s!"), __FUNCTION__);
        return; // nothing to do..
    }

    _device->swapBuffers();
    
#ifdef DEBUG_SHOW_FPS
    profile();
#endif
}    
void CCShader::use()
{
#if defined PROFILEON
    CCProfiler profile( "CCShader::use()" );
#endif

#ifdef QT
    program->bind();
#else
	glUseProgram( program );
#endif
    
    DEBUG_OPENGL();
    
    CCRefreshRenderAttributes();
}
Esempio n. 26
0
/** \brief function to test a pkttype_t
 */
nunit_res_t	pkttype_testclass_t::serial_consistency(const nunit_testclass_ftor_t &testclass_ftor) throw()
{
	pkttype_profile_t	profile(10, 16, pkttype_profile_t::UINT16);
	nunit_pkttype_t		pkttype_toserial = nunit_pkttype_t(profile).PKT_REQUEST();
	nunit_pkttype_t		pkttype_unserial(profile);
	serial_t		serial;
	// log to debug
	KLOG_DBG("enter");
	// do the serial/unserial
	serial << pkttype_toserial;
	serial >> pkttype_unserial;
	// test the serialization consistency
	NUNIT_ASSERT( pkttype_toserial == pkttype_unserial );
	// return no error
	return NUNIT_RES_OK;
}
Esempio n. 27
0
void ContentBlockingDialog::editProfile()
{
	const QModelIndex index(m_ui->profilesViewWidget->currentIndex().sibling(m_ui->profilesViewWidget->currentIndex().row(), 0));
	ContentBlockingProfile *profile(ContentBlockingManager::getProfile(index.data(Qt::UserRole).toString()));

	if (profile)
	{
		const ContentBlockingProfile::ProfileCategory category(profile->getCategory());
		ContentBlockingProfileDialog dialog(this, profile);

		if (dialog.exec() == QDialog::Accepted)
		{
			updateModel(profile, (category != profile->getCategory()));
		}
	}
}
void CCCameraBase::updateVisibleObjects()
{	
#if defined PROFILEON
    CCProfiler profile( "CCCameraBase::updateVisibleObjects()" );
#endif
    
    // Update visible objects
    if( visiblesList )
    {
        CCScanVisibleCollideables( frustum, *visiblesList );
    }
    else
    {
        CCOctreeScanVisibleCollideables( frustum );
    }
}
Esempio n. 29
0
QString Controller::saveXML(const QString& filename, Service* service)
{
    Consumer c(profile(), "xml", filename.toUtf8().constData());
    Service s(service? service->get_service() : m_producer->get_service());
    if (!s.is_valid())
        return "";
    int ignore = s.get_int("ignore_points");
    if (ignore)
        s.set("ignore_points", 0);
    c.set("time_format", "clock");
    c.connect(s);
    c.start();
    if (ignore)
        s.set("ignore_points", ignore);
    return QString::fromUtf8(c.get(filename.toUtf8().constData()));
}
Esempio n. 30
0
int main(int argc, char *argv[])
{
    struct GModule *module;
    struct
    {
	struct Option *map;
	struct Option *line;
	struct Option *null_str;
    } parms;
    struct Flag *coord;

    G_gisinit(argv[0]);

    module = G_define_module();
    G_add_keyword(_("raster"));
    G_add_keyword(_("transect"));
    module->description =
	_("Outputs raster map layer values lying along "
	  "user defined transect line(s).");

    parms.map = G_define_standard_option(G_OPT_R_MAP);
    parms.map->description = _("Raster map to be queried");

    parms.line = G_define_option();
    parms.line->key = "line";
    parms.line->key_desc = "east,north,azimuth,distance";
    parms.line->type = TYPE_STRING;
    parms.line->description = _("Transect definition");
    parms.line->required = YES;
    parms.line->multiple = YES;

    parms.null_str = G_define_standard_option(G_OPT_M_NULL_VALUE);
    parms.null_str->answer = "*";

    coord = G_define_flag();
    coord->key = 'g';
    coord->description =
	_("Output easting and northing in first two columns of four column output");

    if (G_parser(argc, argv))
	exit(EXIT_FAILURE);

    return profile(coord->answer,
		   parms.map->answer,
		   parms.null_str->answer,
		   parms.line->answers) != 0;
}