• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ settings类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中settings的典型用法代码示例。如果您正苦于以下问题:C++ settings类的具体用法?C++ settings怎么用?C++ settings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了settings类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: displayNumber

void displayNumber(bigNumber &bn, settings &user, bool exact, bool stats)
{
	if (exact)
		bn.printNumber();

	else
	{
		int actualDigits = bn.getDigitCount() - (PRECISION-bn.getDecimalCount());
		
		if (user.getPercent())
		{
			bn.printPercent(user.getRound());
		}
					
		else 
		{
		    bn.printNumber(user.getRound());
		}

		if (user.getShowDigits() && stats==true)
		{
			cout << endl;
			cout << "Digits: ";
			if (bn<1 && bn > -1 && bn != 0)
				cout << actualDigits - 1;

			else cout << actualDigits;

			cout << "\nDecimal places: " << bn.getDecimalCount();
			cout << "\nBase: " << bn.getBase();
		}
	}
}
开发者ID:eindacor,项目名称:utilities,代码行数:33,代码来源:main.cpp


示例2: validate

void validator::validate(const settings& s) {
    if (s.modeling().target().empty()) {
        BOOST_LOG_SEV(lg, error) << missing_target;
        BOOST_THROW_EXCEPTION(configuration_error(missing_target));
    }

    const auto cpp(s.cpp());
    if (cpp.split_project()) {
        if (cpp.include_directory().empty() || cpp.source_directory().empty()) {
            BOOST_LOG_SEV(lg, error) << missing_source_include;
            BOOST_THROW_EXCEPTION(configuration_error(missing_source_include));
        }

        if (!cpp.project_directory().empty()) {
            BOOST_LOG_SEV(lg, error) << unexpected_project_dir;
            BOOST_THROW_EXCEPTION(configuration_error(unexpected_project_dir));
        }
    } else {
        if (!cpp.include_directory().empty() || !cpp.source_directory().empty()) {
            BOOST_LOG_SEV(lg, error) << unexpected_source_include;
            BOOST_THROW_EXCEPTION(configuration_error(unexpected_source_include));
        }

        if (cpp.project_directory().empty()) {
            BOOST_LOG_SEV(lg, error) << missing_project_dir;
            BOOST_THROW_EXCEPTION(configuration_error(missing_project_dir));
        }
    }
}
开发者ID:,项目名称:,代码行数:29,代码来源:


示例3: proxy

channel::channel(threadpool& pool, asio::socket_ptr socket,
    const settings& settings)
  : proxy(pool, socket, settings.identifier),
    nonce_(0),
    version_({ 0 }),
    located_start_(null_hash),
    located_stop_(null_hash),
    revival_handler_(nullptr),
    expiration_(alarm(pool, pseudo_randomize(settings.channel_expiration()))),
    inactivity_(alarm(pool, settings.channel_inactivity())),
    revival_(alarm(pool, settings.channel_revival())),
    CONSTRUCT_TRACK(channel, LOG_NETWORK)
{
}
开发者ID:zauguin,项目名称:libbitcoin,代码行数:14,代码来源:channel.cpp


示例4:

void
ssl_context::init(settings const &s) {

	context_.set_options(asio::ssl::context::default_workarounds);

	std::string cacert = s.ssl_cacert_file_name();
	if (!cacert.empty()) {
		context_.load_verify_file(cacert.c_str());
	}

	std::string cert = s.ssl_cert_file_name();
	if (!cert.empty()) {
		//context_.use_certificate_file(cert.c_str(), asio::ssl::context::pem);
		context_.use_certificate_chain_file(cert.c_str());
		context_.use_private_key_file(cert.c_str(), asio::ssl::context::pem);
	}
}
开发者ID:GunioRobot,项目名称:xiva,代码行数:17,代码来源:ssl_context.cpp


示例5:

void
threaded_listener::init(settings const &s) {
	if (!empty()) {
		boost::function<void()> f = boost::bind(&threaded_listener::thread_func, this);
		unsigned short threads = s.listener_threads();
		for (unsigned short i = 0; i < threads; ++i) {
			create_thread(f);
		}
	}
}
开发者ID:Leonya,项目名称:xiva,代码行数:10,代码来源:threaded_listener.cpp


示例6: start

void protocol_ping::start(const settings& settings)
{
    protocol_timer::start(settings.channel_heartbeat(),
        BIND1(send_ping, _1));

    SUBSCRIBE2(ping, handle_receive_ping, _1, _2);

    // Send initial ping message by simulating first heartbeat.
    set_event(error::success);
}
开发者ID:zauguin,项目名称:libbitcoin,代码行数:10,代码来源:protocol_ping.cpp


示例7:

void
threaded_listener::init(settings const &s) {
    if (!empty()) {
        unsigned short threads = s.listener_threads();
        if (!threads) {
            threads = 1;
        }
        for (unsigned int i = 0; i < threads; ++i) {
            items_.push_back(boost::shared_ptr<queue_type>(new queue_type()));
            boost::function<void()> f = boost::bind(&threaded_listener::thread_func, this, i);
            create_thread(f);
        }
    }
}
开发者ID:highpower,项目名称:xiva,代码行数:14,代码来源:threaded_listener.cpp


示例8: template_factory

void protocol_version::start(const settings& settings, size_t height,
                             event_handler handler)
{
    const auto self = template_factory(authority(), settings, nonce(), height);

    // The synchronizer is the only object that is aware of completion.
    const auto handshake_complete =
        BIND2(handle_handshake_complete, _1, handler);

    protocol_timer::start(settings.channel_handshake(),
                          synchronize(handshake_complete, 3, NAME));

    SUBSCRIBE2(version, handle_receive_version, _1, _2);
    SUBSCRIBE2(verack, handle_receive_verack, _1, _2);
    SEND1(self, handle_version_sent, _1);
}
开发者ID:zauguin,项目名称:libbitcoin,代码行数:16,代码来源:protocol_version.cpp


示例9: numberFromVector

bigNumber numberFromVector(vector<int> &vec, bool neg, int dec, settings &user)
{
	bigNumber temp;
	temp.setBase(user.getBase());

	for (int i=0; i<vec.size(); i++)
	{
		int numberToUse = vec.at(vec.size()-i-1);
		int locationToSet = PRECISION + i;
		temp.setDigit(locationToSet, numberToUse);
	}
	
	if (neg)
		temp.setNegative();

	temp.divideByTen(dec);

	return temp;
}
开发者ID:eindacor,项目名称:utilities,代码行数:19,代码来源:main.cpp


示例10: solve

solution solve(string &c, bigNumber previous, settings &user)
{
    c += '$';
    PTYPE pType=ERROR;
    
    vector<int> first;
    vector<int> second;
    bigNumber bn1;
    bigNumber bn2;
    bigNumber temp;
    
    bn1.setBase(user.getBase());
    bn2.setBase(user.getBase());
    temp.setBase(user.getBase());

    int decimalCount1=0;
    int decimalCount2=0;
    int commaNumbers=0;
    int numbers=0;

    bool decimal=false;
	bool comma=false;
	bool negative1=false;
	bool negative2=false;
    bool done=false;
	bool printExact=false;
	bool printStats=false;

    bigNumber* targetBN = &bn1;
    vector<int>* targetVec = &first;
    int* targetDec = &decimalCount1;
	bool* targetNegative = &negative1;
    
    int counter = c.size();
    
    for (int i=0; i<counter; i++)
    {
        if (checkWord(c, i, "pi"))
        {
            if (numbers>0 || comma==true || decimal==true)
            {
                RETURN_ERROR;
            }
            
            else
            {
                string piString(PI);
		
				for (int piMarker=PRECISION; piMarker>=0; piMarker--)
				{
					char piChar = '0';
					int piNum = piString[PRECISION-piMarker] - piChar;
				
					(*targetVec).push_back(piNum);
				}
                
                done=true;
				*targetDec = PRECISION;
                
                numbers += (PRECISION+1);
                counter += 2;
                i += 2;
            }
        }
        
        if (checkWord(c, i, "theta"))
        {
            if (numbers>0 || comma==true || decimal==true)
            {
                RETURN_ERROR;
            }
            
            else
            {
                string thetaString(THETA);
		
				for (int thetaMarker=PRECISION; thetaMarker>=0; thetaMarker--)
				{
					char thetaChar = '0';
					int thetaNum = thetaString[PRECISION-thetaMarker] - thetaChar;
				
					(*targetVec).push_back(thetaNum);
				}
                
                done=true;
				*targetDec = PRECISION;
                
                numbers += (PRECISION+1);
                counter += 5;
                i += 5;
            }
        }
        
		//if it isn't a space, number, symbol, end marker, or decimal point, return error
		if (checkSpace(c[i])==false && 
			isNumber(c[i], user)==false && 
			isSymbol(c[i])==false && 
			c[i] != '$' && 
			c[i] != ',' && 
			c[i] != '.')
//.........这里部分代码省略.........
开发者ID:eindacor,项目名称:utilities,代码行数:101,代码来源:main.cpp


示例11: modifySettings

void modifySettings(settings &user)
{
    cout << endl;
    string setI;
    string setS;
    bool invalid=false;
    int intSet=0;
    
    do
    {
		intSet=0;
        invalid=false;
        setI.clear();
        
        cout << "Enter desired precision: ";
        std::getline(cin, setI);
        
        for (int i=0; i<setI.size(); i++)
        {
			int target = setI.size()-i-1;
			
            if (checkNumber(setI[target]) < 0 || checkNumber(setI[target]) > 9)
            {
                cout << "Invalid entry" << endl << endl;
                invalid=true;
                break;
            }
            
            else intSet += (checkNumber(setI[target]) * pow(10, i));
        }
        
        if (invalid==false)
        {
            if (intSet>PRECISION)
            {
                cout << "Invalid entry (precision must be between 0 and " << PRECISION << ")" << endl << endl;
                invalid=true;
            }
            
            else 
            {
                user.setRound(intSet);
            }
        }
    } while (invalid==true);
    
    do
    {
		intSet=0;
        invalid=false;
        setI.clear();
        
        cout << "Enter desired base: ";
        std::getline(cin, setI);
        
        for (int i=0; i<setI.size(); i++)
        {
			int target = setI.size()-i-1;
			
            if (checkNumber(setI[target]) < 0 || checkNumber(setI[target]) > 9 )
            {
                cout << "Invalid entry" << endl << endl;
                invalid=true;
                break;
            }
            
            else intSet += (checkNumber(setI[target]) * pow(10, i));
        }
    
        
        if (invalid==false)
        {
            if (intSet < 2 || intSet > 36)
            {
                cout << "Invalid entry (base must be between 2 and 36)" << endl << endl;
                invalid=true;
            }
            
            else 
            {
                user.setBase(intSet);
            }
        }
        
    } while (invalid==true);
    
    for (;;)
    {
      
        if (user.getPercent())
        {
            setS.clear();
            cout << "Turn off percentages? ";
            std::getline(cin, setS);
            
            if (setS=="yes" || setS=="y")
            {
                user.percentOff();
                break;
            }
//.........这里部分代码省略.........
开发者ID:eindacor,项目名称:utilities,代码行数:101,代码来源:main.cpp


示例12: atoi

//
// processDisk() - called when a disk is discovered and properly located
//                 on P2.  This routine does everything that the Chapr can
//                 do with a flash drive, like update the name of the Chapr.
//
void VDIP::processDisk(portConfig *portConfigBuffer)
{    
     char buf[BIGENOUGH];

     // check that it's in port two (beep annoyingly otherwise)

     if(portConfigBuffer->port == 1) {

       // read through VDIP stuff looking for a text file with the name, personality etc.

       // PLEASE NOTE -- FILE NAMES MUST BE FEWER THAN 8 CHARACTERS

       // get the new name of the ChapR

       if(readFile("name.txt", buf, BIGENOUGH)){
         if (buf[EEPROM_NAMELENGTH - 1] == '\0'){
           myEEPROM.setName(buf);
         }
       }

       // get the new personality

       if(readFile("person.txt", buf, BIGENOUGH)){
         byte newNum = (byte) atoi(buf);
         if (newNum > 0 && newNum <= EEPROM_LASTPERSON){
           myEEPROM.setPersonality(newNum);
         }
       }

       // get the power-down timeout

       if(readFile("timeout.txt", buf, BIGENOUGH)){
         byte newNum = (byte) atoi(buf);
         if (newNum >= 0 && newNum <= EEPROM_MAXTIMEOUT){
         myEEPROM.setTimeout(newNum);
         }
       }

       // get the lag time

       if(readFile("lag.txt", buf, BIGENOUGH)){
         byte newNum = (byte) atoi(buf);
         if (newNum >= 0 && newNum <= EEPROM_MAXLAG){
         myEEPROM.setSpeed(newNum);
         }
       }

       // get the user mode

       if(readFile("mode.txt", buf, BIGENOUGH)){
         byte newNum = (byte) atoi(buf);
         if (newNum >= 0 && newNum <= EEPROM_MAXMODE){
         myEEPROM.setMode(newNum);
         }
       }
       
       // allows user to determine number of seconds in autonomous, teleOp and endgame (ChapR3 of EEPROM)
       // zero for either mode skips the mode

       if(readFile("mConfig.txt",buf, BIGENOUGH)){
	 char *ptr = buf;
	 for (int i = 0; i < 3; i++){
	   switch(i){
	   case 0: myEEPROM.setAutoLen(atoi(ptr));break;
	   case 1: myEEPROM.setTeleLen(atoi(ptr));break;
	   case 2: myEEPROM.setEndLen(atoi(ptr));break;
	   }
	   while (*ptr != '\r' && *ptr != '\0' && *ptr != '\n'){
	     ptr++;
	   }
	   while (*ptr == '\r' && *ptr == '\n'){
	     ptr++;
	   }
	   if (*ptr == '\0'){
	     break;
	   }
	 }
       }
     

       // contains the settings for the digital I/O pins (for FRC, aka ChapR3 of EEPROM)
     
       if (readFile("dgtlIn.txt", buf, BIGENOUGH)){
	 byte newNum = 0;
	 
	 for (int i = 0, ptr = 0; i < 8; i++){
	   byte bit = (buf[ptr] == '1')?1:0;
	   newNum |= bit<<i;
	   while (buf[ptr] != '\r' && buf[ptr] != '\0' && buf[ptr] != '\n'){
	     ptr++;
	   }
	   while (buf[ptr] == '\r' || buf[ptr] == '\n'){
	     ptr++;
	   }
	   if (buf[ptr] == '\0'){
//.........这里部分代码省略.........
开发者ID:ChapResearch,项目名称:ChapR,代码行数:101,代码来源:VDIP.cpp


示例13: note_sequence

    note_sequence(settings &set) {
      if (set.note_mode() == settings::note_mode_list) {
        impl_.reset(new detail::listed_sqeuence(
              set.concert_pitch(),
              set.note_list().begin(), set.note_list().end(),
              set.note_list().size()));
      }
      else {
        assert(set.note_mode() == settings::note_mode_start);
        trc("using a start note and distance");
        int start_offset = parse_note(set.start_note().c_str());

        int stop_offset;
        if (! set.end_note().empty()) {
          stop_offset = parse_note(set.end_note().c_str());
        }
        else if (set.num_notes() >= 0) {
          stop_offset = start_offset + set.num_notes() * set.note_distance();
        }
        else {
          stop_offset = start_offset + 12;
        }

        int step = set.note_distance();
        if (start_offset > stop_offset && step > 0) {
          std::cerr << "warning: making the step negative since the end note is lower than the start note." << std::endl;
          step = -step;
        }
        else if (start_offset < stop_offset && step < 0) {
          std::cerr << "warning: making the step positive since the end note is higher than the start note." << std::endl;
          step = -step;
        }

        trc("start: " << start_offset);
        trc("stop:  " << stop_offset);
        trc("step:  " << step);

        impl_.reset(
          new detail::generated_sequence(
            set.concert_pitch(), start_offset, stop_offset, step
          )
        );
        trc("done");
        assert(impl_.get());
      }
    }
开发者ID:bnkr,项目名称:tune,代码行数:46,代码来源:note_sequence.hpp


示例14: isNumber

bool isNumber(char const &c, settings &user)
{
	return (checkNumber(c) >= 0 && checkNumber(c) <= (user.getBase()-1) );
}
开发者ID:eindacor,项目名称:utilities,代码行数:4,代码来源:main.cpp


示例15: TEST_CASE

#include "nexus.hpp"
#include <boost/uuid/uuid_generators.hpp>

namespace koi {
	struct masterstate;
};

TEST_CASE("elector/promote", "test successful node promotion") {
	using namespace koi;
	using namespace std;
	using namespace boost;
	using namespace boost::posix_time;

	std::vector<std::string> configs;
	configs << "../test/test.conf";
	settings cfg;
	char app[] = "koi";
	char* argv[1] = { app };
	bool ok = cfg.boot(configs, false);
	REQUIRE(ok);

	net::io_service io_service;

	nexus ro(io_service, cfg);

	elector a(ro);
	ok = a.init(microsec_clock::universal_time());
	REQUIRE(ok);

	a.start();
开发者ID:gsson,项目名称:koi,代码行数:30,代码来源:elector_test.cpp


示例16: changeBase

bool changeBase(string &c, settings &user)
{
	if (c == "base 2" || c == "base2" || c == "binary")
	{
		user.setBase(2);
		return true;
	}
	
	if (c == "base 3" || c == "base3" || c == "ternary")
	{
		user.setBase(3);
		return true;
	}

	if (c == "base 4" || c == "base4" || c == "quaternary")
	{
		user.setBase(4);
		return true;
	}

	if (c == "base 5" || c == "base5" || c == "quinary")
	{
		user.setBase(5);
		return true;
	}

	if (c == "base 6" || c == "base6" || c == "senary")
	{
		user.setBase(6);
		return true;
	}

	if (c == "base 7" || c == "base7" || c == "septenary")
	{
		user.setBase(7);
		return true;
	}

	if (c == "base 8" || c == "base8" || c == "octonary")
	{
		user.setBase(8);
		return true;
	}

	if (c == "base 9" || c == "base9" || c == "nonary")
	{
		user.setBase(9);
		return true;
	}

	if (c == "base 10" || c == "base10" || c == "decimal")
	{
		user.setBase(10);
		return true;
	}

	if (c == "base 11" || c == "base11" || c == "undenary")
	{
		user.setBase(11);
		return true;
	}

	if (c == "base 12" || c == "base12" || c == "dozenal" || c == "duodecimal")
	{
		user.setBase(12);
		return true;
	}

	if (c == "base 13" || c == "base13" || c == "tridecimal")
	{
		user.setBase(13);
		return true;
	}

	if (c == "base 14" || c == "base14" || c == "quattuordecimal")
	{
		user.setBase(14);
		return true;
	}

	if (c == "base 15" || c == "base15" || c == "quindecimal")
	{
		user.setBase(15);
		return true;
	}

	if (c == "base 16" || c == "base16" || c == "sexadecimal" || c == "hexadecimal")
	{
		user.setBase(16);
		return true;
	}

	if (c == "base 17" || c == "base17" || c == "septendecimal")
	{
		user.setBase(17);
		return true;
	}

	if (c == "base 18" || c == "base18" || c == "octodecimal")
	{
//.........这里部分代码省略.........
开发者ID:eindacor,项目名称:utilities,代码行数:101,代码来源:main.cpp


示例17: make_wu_headers

int make_wu_headers(tapeheader_t tapeheader[],workunit wuheader[],
                    buffer_pos_t *start_of_wu) {
  int procid=getpid();
  int i,j,startframe=start_of_wu->frame;
  double receiver_freq;
  int bandno;
  SCOPE_STRING *lastpos;
  FILE *tmpfile;
  char tmpstr[256];
  char buf[64];
  static int HaveConfigTable=0;
  static ReceiverConfig_t ReceiverConfig;   
  static receiver_config r;
  static settings s;

  if(!HaveConfigTable) {
    sprintf(buf,"where s4_id=%d",gregorian?AOGREG_1420:AO_1420);
    r.fetch(std::string(buf));
    ReceiverConfig.ReceiverID=r.s4_id;
    strlcpy(ReceiverConfig.ReceiverName,r.name,
           sizeof(ReceiverConfig.ReceiverName));
    ReceiverConfig.Latitude=r.latitude;
    ReceiverConfig.Longitude=r.longitude;
    ReceiverConfig.WLongitude=-r.longitude;
    ReceiverConfig.Elevation=r.elevation;
    ReceiverConfig.Diameter=r.diameter;
    ReceiverConfig.BeamWidth=r.beam_width;
    ReceiverConfig.CenterFreq=r.center_freq;
    ReceiverConfig.AzOrientation=r.az_orientation;
    for (i=0;i<(sizeof(ReceiverConfig.ZenCorrCoeff)/sizeof(ReceiverConfig.ZenCorrCoeff[0]));i++) {
      ReceiverConfig.ZenCorrCoeff[i]=r.zen_corr_coeff[i];
      ReceiverConfig.AzCorrCoeff[i]=r.az_corr_coeff[i];
    }
    HaveConfigTable=1;
  }
  sprintf(buf,"where active=%d",app.id);
  if (!s.fetch(std::string(buf))) {
    log_messages.printf(SCHED_MSG_LOG::MSG_CRITICAL,"Unable to find active settings for app.id=%d\n",app.id);
    exit(1);
  }
  if (s.receiver_cfg->id != r.id) {
    log_messages.printf(SCHED_MSG_LOG::MSG_CRITICAL,"Receiver config does not match settings (%d != %d)\n",s.receiver_cfg->id, r.id);
    exit(1);
  }
  s.recorder_cfg->fetch();
  s.splitter_cfg->fetch();
  s.analysis_cfg->fetch();
  if (!strncmp(s.splitter_cfg->data_type,"encoded",
     std::min(static_cast<size_t>(7),sizeof(s.splitter_cfg->data_type)))) {
    noencode=0;
  } else {
      noencode=1;
  }

  workunit_grp wugrp;
  sprintf(wugrp.name,"%s.%ld.%d.%ld.%d",tapeheader[startframe].name,
    procid, 
    (current_record-TAPE_RECORDS_IN_BUFFER)*8+startframe,
    start_of_wu->byte,s.id);
  wugrp.receiver_cfg=r;
  wugrp.recorder_cfg=s.recorder_cfg;
  wugrp.splitter_cfg=s.splitter_cfg;
  wugrp.analysis_cfg=s.analysis_cfg;

  wugrp.data_desc.start_ra=tapeheader[startframe+1].telstr.ra;
  wugrp.data_desc.start_dec=tapeheader[startframe+1].telstr.dec;
  wugrp.data_desc.end_ra=tapeheader[startframe+TAPE_FRAMES_PER_WU].telstr.ra;
  wugrp.data_desc.end_dec=tapeheader[startframe+TAPE_FRAMES_PER_WU].telstr.dec;
  wugrp.data_desc.nsamples=NSAMPLES;
  wugrp.data_desc.true_angle_range=0;
  {
    double sample_rate=tapeheader[startframe].samplerate/NSTRIPS;
    /* startframe+1 contains the first valid RA and Dec */
    TIME st=tapeheader[startframe+1].telstr.st;
    TIME et=tapeheader[startframe+TAPE_FRAMES_PER_WU].telstr.st;
    double diff=(et-st).jd*86400.0;
    for (j=2;j<TAPE_FRAMES_PER_WU;j++) {
      wugrp.data_desc.true_angle_range+=angdist(tapeheader[startframe+j-1].telstr,tapeheader[startframe+j].telstr);
    }
    wugrp.data_desc.true_angle_range*=(double)wugrp.data_desc.nsamples/(double)sample_rate/diff;
    if (wugrp.data_desc.true_angle_range==0) wugrp.data_desc.true_angle_range=1e-10;
  }
  // Calculate the number of unique signals that could be found in a workunit.
  // We will use these numbers to calculate thresholds.
  double numgauss=2.36368e+08/wugrp.data_desc.true_angle_range;
  double numpulse=std::min(4.52067e+10/wugrp.data_desc.true_angle_range,2.00382e+11);
  double numtrip=std::min(3.25215e+12/wugrp.data_desc.true_angle_range,1.44774e+13);

  

  // Calculate a unique key to describe this analysis config.
  long keyuniq=floor(std::min(wugrp.data_desc.true_angle_range*100,1000.0)+0.5)+
    s.analysis_cfg.id*1024.0;
  if ((keyuniq>(13*1024)) ||(keyuniq<12*1024)) {
     log_messages.printf(SCHED_MSG_LOG::MSG_CRITICAL,"Invalid keyuniq value!\n");
     log_messages.printf(SCHED_MSG_LOG::MSG_CRITICAL,"%d %d %f\n",keyuniq,s.analysis_cfg.id,wugrp.data_desc.true_angle_range);
     exit(1);
  }

  keyuniq*=-1;
//.........这里部分代码省略.........
开发者ID:Rytiss,项目名称:native-boinc-for-android,代码行数:101,代码来源:wufiles.cpp


示例18: config

	void texture::config(const settings& settings_)
	{
		settings_.apply(*this);
	}
开发者ID:KitoHo,项目名称:rpcs3,代码行数:4,代码来源:GLHelpers.cpp


示例19: tree_deflector

 /// Construct object
 /// @param stars A list containing the stars to be put into the tree
 /// @param config A settings object from which all settings will be read
 tree_deflector(const std::vector<star>& stars, const settings& config)
 : _tree(stars, config.get_opening_angle())
 {
 }
开发者ID:illuhad,项目名称:nanolens,代码行数:7,代码来源:lens_plane.hpp


示例20: MatchReset

//
// Loop() - for the NXT-RobotC pesonality, a message is sent out for each
//		loop through the Arduino code.  The message is simply the
//		appropriately formatted BT message with the translation of
//		the Gamepads and inclusion of the button.
//
void Personality_0::Loop(BT *bt, Gamepad *g1, Gamepad *g2)
{
     byte	msgbuff[64];	// max size of a BT message
     int	size;

     // if we're not connected to Bluetooth, then ingore the loop
     if (!bt->connected()) {
          enabled = false;
	  if (isMatchActive()){
	    MatchReset();
	  }
	  return;
     }
       
     // only deal with matchmode when it is active

     if (isMatchActive()){
	     MatchLoopProcess((void *)bt);	// mode is set in the match callback above
     } else {
	     mode = myEEPROM.getMode();		// mode is set by the EEPROM setting
     }

     // first convert the gamepad data and button to the robotC structure
     size = robotcTranslate(msgbuff,enabled,g1,g2, mode);

     // then compose a NXT mailbox message (for BT transport) with that data
     // this routine operates within the given buffer.  Note that the
     // mailbox used is #0.
     size = nxtBTMailboxMsgCompose(0,msgbuff,size);

     // then send it over BT, again, operating on the message buffer
     (void)bt->btWrite(msgbuff,size);
}
开发者ID:ChapResearch,项目名称:ChapR,代码行数:39,代码来源:personality_0.cpp



注:本文中的settings类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ sfv_t类代码示例发布时间:2022-05-31
下一篇:
C++ set_type类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap