Example #1
0
PUBLIC bool removeRec(cchar *tableName, cchar *key)
{
    if (ediRemoveRec(getDatabase(), tableName, key) < 0) {
        feedback("error", "Cannot delete %s", stitle(tableName));
        return 0;
    }
    feedback("info", "Deleted %s", stitle(tableName));
    return 1;
}
int 
main(int argc, char** argv) 
{
	const int 		 clockrate[] = {CTL_KERN, KERN_CLOCKRATE};
	struct clockinfo 	 ci;
	size_t 			 size;
	const char		*dev;
	const char		*pin;
	struct gpio_pin_op 	 feedback_op;

	if (argc != 3)
		errx(1, "need 2 arguments (device, pin)");

	dev = argv[1];
	pin = argv[2];

	/* try sysctl before detaching */
	size = sizeof(struct clockinfo);
	if (sysctl(clockrate, 2, &ci, &size, NULL, 0) < 0)
		err(1, "sysctl kern.clockrate failed");

	memset(&feedback_op, 0, sizeof(struct gpio_pin_op));
	strlcpy(feedback_op.gp_name, pin, GPIOPINMAXNAME);

	/* try gpio ioctl before detaching */
	feedback(dev, &feedback_op);
	feedback(dev, &feedback_op);
#if !DEBUG
	daemon(0, 0);
#endif

	useconds_t sleep_time = (useconds_t)(1000000 / (ci.stathz * 2));
	unsigned int busy_ticks = 0;
	for (;;) {
#if DEBUG
		printf("%u ", busy_ticks);
		fflush(stdout);
#endif
		busy_ticks += get_busy_ticks();
		if (busy_ticks == 0) {
			usleep(2 * sleep_time);
		} else {
			feedback(dev, &feedback_op);
			usleep(sleep_time);
			feedback(dev, &feedback_op);
			usleep(sleep_time);
			if (busy_ticks < ci.stathz)
				busy_ticks--;
			else
				busy_ticks /= 2;
		}
	}

	return 0;
}
Example #3
0
PUBLIC bool updateRec(EdiRec *rec)
{
    if (!rec) {
        feedback("error", "Cannot save record");
        return 0;
    }
    setRec(rec);
    if (ediUpdateRec(getDatabase(), rec) < 0) {
        feedback("error", "Cannot save %s", stitle(rec->tableName));
        return 0;
    }
    feedback("info", "Saved %s", stitle(rec->tableName));
    return 1;
}
void QAudioInputPrivate::resume()
{
    if(deviceState == QAudio::SuspendedState) {
        deviceState = QAudio::ActiveState;
        for(int i=0; i<buffer_size/period_size; i++) {
            result = waveInAddBuffer(hWaveIn, &waveBlocks[i], sizeof(WAVEHDR));
            if(result != MMSYSERR_NOERROR) {
                qWarning("QAudioInput: failed to setup block %d,err=%d",i,result);
                errorState = QAudio::OpenError;
                deviceState = QAudio::StoppedState;
                emit stateChanged(deviceState);
                return;
            }
        }

        mutex.lock();
        waveFreeBlockCount = buffer_size/period_size;
        mutex.unlock();

        waveCurrentBlock = 0;
        header = 0;
        resuming = true;
        waveInStart(hWaveIn);
        QTimer::singleShot(20,this,SLOT(feedback()));
        emit stateChanged(deviceState);
    }
}
Example #5
0
void putValue(void* aAdr, uint8_t aPType, int32_t* aValue)
{
    union {
        void*     adr; 
        uint8_t*  u8Adr;
        uint16_t* u16Adr;
        //        uint32_t* u32Adr;
    } a;

    a.adr = aAdr;
    if (ISEEADR(aPType))
    {
        if (IS8BIT(aPType))
            eeprom_update_byte(aAdr, ISSIGNED(aPType) ? (int8_t) *aValue : (uint8_t) *aValue);
        else if(IS16BIT(aPType))
            eeprom_update_word(aAdr, ISSIGNED(aPType) ? (int16_t) *aValue : (uint16_t) *aValue);
#ifdef WITH_EE32VALUES
        else if(IS32BIT(aPType))
            eeprom_update_dword(aAdr, ISSIGNED(aPType) ? *aValue : (uint32_t) *aValue);
#endif
    } else if (ISRAMADR(aPType))
    {
        if (IS8BIT(aPType))
            *a.u8Adr = ISSIGNED(aPType) ? (int8_t) *aValue : (uint8_t) *aValue;
        else if(IS16BIT(aPType))
            *a.u16Adr = ISSIGNED(aPType) ? (int16_t) *aValue : (uint32_t) *aValue;
#ifdef WITH_EE32VALUES
        else if(IS32BIT(aPType))
            *a.u32Adr = ISSIGNED(aPType) ?  *aValue : (uint32_t) *aValue;
#endif
    }
    feedback(1, BLINK_MEDIUM, WITH_LED1);
} // getValue
Example #6
0
    void CachedPlanRunner::updateCache() {
        _updatedCache = true;

        // We're done.  Update the cache.
        PlanCache* cache = PlanCache::get(_canonicalQuery->ns());

        // TODO: Is this an error?
        if (NULL == cache) { return; }

        // TODO: How do we decide this?
        bool shouldRemovePlan = false;

        if (shouldRemovePlan) {
            if (!cache->remove(*_canonicalQuery, *_cachedQuery->solution)) {
                warning() << "Cached plan runner couldn't remove plan from cache.  Maybe"
                    " somebody else did already?";
                return;
            }
        }

        // We're done running.  Update cache.
        auto_ptr<CachedSolutionFeedback> feedback(new CachedSolutionFeedback());
        feedback->stats = _exec->getStats();
        cache->feedback(*_canonicalQuery, *_cachedQuery->solution, feedback.release());
    }
Example #7
0
bool handle_snapshots (sqlite3 *db)
// Looks at the snapshot databases mentioned in the maintenance database.
// If one needs to be optimized, it does that, and returns true.
{
  // Get the databases.
  vector <string> databases_in_database;
  {
    SqliteReader reader(0);
    sqlite3_exec(db, "select distinct filename from snapshots;", reader.callback, &reader, NULL);
    databases_in_database = reader.string0;
  }
  
  // Go through the databases.
  for (unsigned int database = 0; database < databases_in_database.size(); database++) {

    // Optimize it.
    printf ("Optimize snapshot at %s\n", databases_in_database[database].c_str());
    fflush (stdout);
    trim_snapshots (databases_in_database[database]);
    // Remove this database from the maintenance database.
    gchar * sql;
    sql = g_strdup_printf("delete from snapshots where filename = '%s';", double_apostrophy (databases_in_database[database]).c_str());
    sqlite3_exec(db, sql, NULL, NULL, NULL);
    g_free(sql);
    // Feedback.
    feedback ();
    // Return true since something was done.
    return true;

  }
  // Return false since nothing was done.
  return false;  
}
/************************Systick_interrupt_0.1ms******************************************/
void SysTick_Handler(void)
{
	SysTicker ++;
	//actuator
	LFL_2_execute(1);
	LFL_1_execute(1);
	LFL_0_execute(1);
	
	LHL_2_execute(1);
	LHL_1_execute(1);
	LHL_0_execute(1);
	
	RFL_2_execute(1);
	RFL_1_execute(1);
	RFL_0_execute(1);
	
	RHL_2_execute(1);
	RHL_1_execute(1);
	RHL_0_execute(1);
		
	//feedback
	feedback (10);
	X360_X1_Analog (10);
	//timer
	timer (10);
}
Example #9
0
void CursesAction::activate() {
    feedback();

    if(_activateWait)
        return;
    _activateWait = true;
}
Example #10
0
    void CachedPlanRunner::updateCache() {
        _updatedCache = true;

        if (_killed) {
            return;
        }

        Database* db = cc().database();
        // XXX: We need to check for NULL because this is called upon
        // destruction of the CachedPlanRunner. In some cases, the db
        // or collection could be dropped without kill() being called
        // on the runner (for example, timeout of a ClientCursor holding
        // the runner).
        if (NULL == db) { return; }
        Collection* collection = db->getCollection(_canonicalQuery->ns());
        if (NULL == collection) { return; }
        PlanCache* cache = collection->infoCache()->getPlanCache();

        std::auto_ptr<PlanCacheEntryFeedback> feedback(new PlanCacheEntryFeedback());
        // XXX: what else can we provide here?
        feedback->stats.reset(_exec->getStats());
        feedback->score = PlanRanker::scoreTree(feedback->stats.get());

        Status fbs = cache->feedback(*_canonicalQuery, feedback.release());

        if (!fbs.isOK()) {
            QLOG() << _canonicalQuery->ns() << ": Failed to update cache with feedback: "
                   << fbs.toString() << " - "
                   << "(query: " << _canonicalQuery->getQueryObj()
                   << "; sort: " << _canonicalQuery->getParsed().getSort()
                   << "; projection: " << _canonicalQuery->getParsed().getProj()
                   << ") is no longer in plan cache.";
        }
    }
Example #11
0
//-----------------------------------------------------------------------------
// SDEditor class implementation
//-----------------------------------------------------------------------------
SDEditor::SDEditor (AudioEffect *effect)
 : AEffEditor (effect), mpWin(NULL), mLock(false)
{
  SetObjectClass(_T("SDEditor"));

  nuiAttribute<float>* pDelayAttrib = new nuiValueAttribute<float>(_T("Delay"), effect->getParameter(kDelay));
  pDelayAttrib->SetEditor(CreateEditor);
  pDelayAttrib->SetFormater(DelayFormater);
  nuiAttrib<float> delay(this, pDelayAttrib);
  mSlotSink.Connect(delay.GetChangedSignal(), nuiMakeDelegate(this, &SDEditor::SetDelay));
  AddAttribute(pDelayAttrib);

  nuiAttribute<float>* pFeedbackAttrib = new nuiValueAttribute<float>(_T("Feedback"), effect->getParameter(kFeedBack));
  pFeedbackAttrib->SetEditor(CreateEditor);
  pFeedbackAttrib->SetFormater(FeedbackFormater);
  nuiAttrib<float> feedback(this, pFeedbackAttrib);
  mSlotSink.Connect(feedback.GetChangedSignal(), nuiMakeDelegate(this, &SDEditor::SetFeedback));
  AddAttribute(pFeedbackAttrib);

  nuiAttribute<float>* pOutAttrib = new nuiValueAttribute<float>(_T("Out"), effect->getParameter(kOut));
  pOutAttrib->SetEditor(CreateEditor);
  pOutAttrib->SetFormater(OutFormater);
  nuiAttrib<float> out(this, pOutAttrib);
  mSlotSink.Connect(out.GetChangedSignal(), nuiMakeDelegate(this, &SDEditor::SetOut));
  AddAttribute(pOutAttrib);

  mMainRect.top = 0;
  mMainRect.left = 0;
  mMainRect.bottom = 240;
  mMainRect.right = 320;
  effect->setEditor(this);
}
Example #12
0
File: user.c Project: leemit/esp
/*
    Action to login a user. Redirects to /public/login.esp if login fails
 */
static void loginUser() {
    if (httpLogin(getConn(), param("username"), param("password"))) {
        redirect("/index.esp");
    } else {
        feedback("error", "Invalid Login");
        redirect("/public/login.esp");
    }       
}
static void destroy(struct rvce_encoder *enc)
{
	enc->task_info(enc, 0x00000001, 0, 0, 0);

	feedback(enc);

	RVCE_BEGIN(0x02000001); // destroy
	RVCE_END();
}
void MasterController::slaveOdometryCallback(const nav_msgs::Odometry::ConstPtr& msg)
{
    // Pose slave
    Eigen::Matrix<double,3,1> euler=Eigen::Quaterniond(msg->pose.pose.orientation.w,
                                    msg->pose.pose.orientation.x,
                                    msg->pose.pose.orientation.y,
                                    msg->pose.pose.orientation.z).matrix().eulerAngles(2, 1, 0);
    double yaw = euler(0,0);
    double pitch = euler(1,0);
    double roll = euler(2,0);
    if(!init_slave_readings)
    {
        previous_pose_slave << msg->pose.pose.position.x,
                            msg->pose.pose.position.y,
                            msg->pose.pose.position.z,
                            roll-previous_pose_slave(3,0),
                            pitch-previous_pose_slave(4,0),
                            yaw; // should be relative
        // std::cout << "previous_pose_slave:" << previous_pose_slave(5,0) << " yaw:" << yaw << std::endl;
        // std::cout << "yaw:" << yaw << " yaw previous:" << yaw_slave_previous << std::endl;
        yaw_slave_previous=yaw;
        init_slave_readings=true;
        return;
    }
    else
    {
        // lastPositionUpdate = ros::Time::now().toSec();
        current_pose_slave << msg->pose.pose.position.x,
                           msg->pose.pose.position.y,
                           msg->pose.pose.position.z,
                           roll-previous_pose_slave(3,0),
                           pitch-previous_pose_slave(4,0),
                           yaw_slave_previous; // should be relative
        // std::cout << "current_pose_slave:" << current_pose_slave(5,0) << " yaw_slave_previous:" << yaw_slave_previous << std::endl;
        // std::cout << current_pose_slave(0,0) << std::endl ;
        // std::cout << current_pose_slave(1,0) << std::endl ;
        // std::cout << current_pose_slave(2,0) << std::endl ;
        // std::cout << current_pose_slave(3,0) << std::endl ;
        // std::cout << current_pose_slave(4,0) << std::endl ;
        // std::cout << current_pose_slave(5,0) << std::endl ;
        // double test = current_pose_slave(5,0) ;
        // std::cout << "yaw:" << yaw << " yaw previous:" << yaw_slave_previous << std::endl;
        // std::cout << "current_pose_slave:" << test << " previous_pose_slave previous:" << previous_pose_slave(5,0) << std::endl;
        // std::cout << "yaw TO DEG:" << yaw*RAD_TO_DEG << " yaw previous TO DEG:" << yaw_slave_previous * RAD_TO_DEG << std::endl;
        // std::cout << "current_pose_slave TO DEG (((:" << current_pose_slave(5,0)*RAD_TO_DEG << " previous_pose_slave previous TO DEG )))):" << previous_pose_slave(5,0) * RAD_TO_DEG << std::endl;
        yaw_slave_previous=yaw;
    }
    current_velocity_slave << msg->twist.twist.linear.x,
                           msg->twist.twist.linear.y,
                           msg->twist.twist.linear.z,
                           msg->twist.twist.angular.x,
                           msg->twist.twist.angular.y,
                           msg->twist.twist.angular.z;
    slave_new_readings=true;
    feedback();
    previous_pose_slave=current_pose_slave;
}
Example #15
0
void QAudioOutputPrivate::resume()
{
    if(deviceState == QAudio::SuspendedState) {
        deviceState = QAudio::ActiveState;
        errorState = QAudio::NoError;
        waveOutRestart(hWaveOut);
        QTimer::singleShot(10, this, SLOT(feedback()));
        emit stateChanged(deviceState);
    }
}
Example #16
0
int main(int argc, char **argv)
{
  int n, m,p,q, nb, level, nn, i, input;
  double *points,*planes;
  FILE *ifp, *ofp;
  
  if(argc!=3)
  {
     printf("\n%s\n\n",
	    "Usage: ts_feedback input_file output_file");
     exit(1);
  }
    ifp=fopen(argv[1], "r"); /*open for reading*/
    ofp=fopen(argv[2], "w"); /*open for writing*/

  fscanf(ifp, "%d", &n);
  printf("The number of the internal states for the given plant (A, B, C) n = %d\n", n);
  fscanf(ifp, "%d", &m);  
  printf( "The system's input dimension m = %d.\n", m);
  fscanf(ifp, "%d", &p);
  printf( "The system's output dimension p = %d.\n", p);
  fscanf(ifp, "%d", &q);
  printf( "The number of the internal states for the dynamic compensators q = %d.\n", q);
  fscanf(ifp, "%d", &nb);
  printf("Give the number of maps wanted (<0 for all) : %d ", nb);

  fscanf(ifp, "%d", &level);
  printf( "\nType 0, 1, 2, or 3 to select output level :\n");
  printf( "  0. no intermediate output;\n");
  printf( "  1. only final determinant validation;\n");
  printf( "  2. + validation of all intermediate determinants;\n");
  printf( "  3. + intermediate output of all path trackers.\n");
  printf( "The amount of the intermediate output: %d\n", level);

  fscanf(ifp, "%d", &input);
  printf("Type 0, 1, 2 to select input :\n"); 
  printf("  0. interactive input of real numbers\n");
  printf("  1. interactive input of complex numbers\n");
  printf("  2. random input of complex numbers\n");  
  printf("  3. random input of real numbers\n");
  printf("  4. interactive input of real numbers for matrices and complex numbers for poles\n");
  printf("The selected input is: %d\n", input);    

  nn = m*p + q*(m+p);
  if(nn<(n+q))
  {
     printf("\n%s\n", "Overdetermined, no feedback laws.");
     exit(1);
  }
  srand(time(NULL));
  feedback(n, m, p, q, nb, level, nn, input, argv[1], argv[2]);

  return 0;
}
Example #17
0
static void retractPackage() {
    EdiRec      *rec;
    cchar       *password, *name;

    name = param("name");
    password = param("password");

    if (!name || !*name || !password || !*password) {
        sendResult(feedback("error", "Missing name or password parameters"));
        return;
    }
    if ((rec = readRecWhere("pak", "name", "==", name)) == 0) {
        sendResult(feedback("error", "Cannot find package"));
        return;

    } else if (!mprCheckPassword(password, getField(rec, "password"))) {
        sendResult(feedback("error", "Invalid password"));
        return;
    }
    sendResult(removeRec("pak", rec->id));
}
// SLAVE MEASUREMENTS
void SlaveController::slaveOdometryCallback(const nav_msgs::Odometry::ConstPtr& msg)
{
    // Pose slave
    Eigen::Matrix<double,3,1> euler=Eigen::Quaterniond(msg->pose.pose.orientation.w,
                                                       msg->pose.pose.orientation.x,
                                                       msg->pose.pose.orientation.y,
                                                       msg->pose.pose.orientation.z).matrix().eulerAngles(2, 1, 0);
    double yaw = euler(0,0);
    double pitch = euler(1,0);
    double roll = euler(2,0);

    if(!init_slave_readings)
    {
        previous_pose_slave << msg->pose.pose.position.x,
                msg->pose.pose.position.y,
                msg->pose.pose.position.z,
                roll-previous_pose_slave(3,0),
                pitch-previous_pose_slave(4,0),
                yaw; // should be relative
        //std::cout << "yaw:" << yaw << " yaw previous:" << yaw_slave_previous << std::endl;

        yaw_slave_previous=yaw;
        init_slave_readings=true;
        return;
    }
    else
    {
        current_pose_slave << msg->pose.pose.position.x,
                msg->pose.pose.position.y,
                msg->pose.pose.position.z,
                roll-previous_pose_slave(3,0),
                pitch-previous_pose_slave(4,0),
                yaw-yaw_slave_previous; // should be relative
        //std::cout << "yaw:" << yaw << " yaw previous:" << yaw_slave_previous << std::endl;

        yaw_slave_previous=yaw;
    }

    current_velocity_slave << msg->twist.twist.linear.x,
            msg->twist.twist.linear.y,
            msg->twist.twist.linear.z,
            msg->twist.twist.angular.x,
            msg->twist.twist.angular.y,
            msg->twist.twist.angular.z;

    slave_new_readings=true;
    feedback();
    previous_pose_slave=current_pose_slave;

}
Example #19
0
//========
void CFrameActionsRecorder::flush()
{
	//H_AUTO(R2_CFrameActionsRecorder_flush)
	if (_Flushing) return;
	if (!_FrameActions.isNewActionBeingRecorded()) return;
	_Flushing = true;
	CClientInstantActionFeedBack feedback(_DMC);
	_FrameActions.setDMC(&feedback);
	_FrameActions.endAction();
	_FrameActions.clear();
	_FrameActions.setDMC(NULL);
	_FrameActions.newSingleAction(ucstring());
	_Flushing = false;
}
Example #20
0
PUBLIC bool canUser(cchar *abilities, bool warn)
{
    HttpStream    *stream;

    stream = getStream();
    if (httpCanUser(stream, abilities)) {
        return 1;
    }
    if (warn) {
        setStatus(HTTP_CODE_UNAUTHORIZED);
        sendResult(feedback("error", "Access Denied. Insufficient Privilege."));
    }
    return 0;
}
 static algorithm_feedback run( native_input_mesh_type const & native_input_mesh, input_segmentation_type const & input_segmentation,
                  native_output_mesh_type & native_output_mesh, output_segmentation_type & output_segmentation,
                  settings_type settings )
 {
     algorithm_feedback feedback( result_of::algorithm_info<algorithm_tag>::name() );
     vgmodeler::hull_adaptor adaptor;
 
     if (!settings.cell_size.is_ignored())
         adaptor.maxsize() = settings.cell_size();
     
     adaptor.process( native_input_mesh, input_segmentation, native_output_mesh, output_segmentation );
     
     feedback.set_success(); 
     return feedback;
 }
Example #22
0
void ObjectController::_handleBroadcast(uint64 targetId, Message* message, ObjectControllerCmdProperties* cmdProperties)
{
    int8 rawData[128];
    rawData[0] = 0;
    BString msgString;
    message->getStringUnicode16(msgString);
    msgString.convert(BSTRType_ANSI);

    // Remove current command and leadig white space.
    msgString = skipToNextField(msgString);

    BString feedback(this->handleBroadcast(msgString));
    sprintf(rawData,"%s: [%s]", cmdProperties->mCommandStr.getAnsi(), feedback.getAnsi());
    this->sendAdminFeedback(rawData);
}
bool AudioModulePanel :: code (PrologElement * parameters, PrologResolution * resolution) {
	if (parameters -> isEarth ()) return remove ();
	PrologElement * x = 0, * y = 0;
	PrologElement * refresher = 0;
	while (parameters -> isPair ()) {
		PrologElement * el = parameters -> getLeft ();
		if (el -> isNumber ()) if (x == 0) x = el; else y = el;
		if (el -> isEarth ()) refresher = el;
		parameters = parameters -> getRight ();
	}
	if (refresher != 0) {feedback (); update (); return true;}
	if (x == 0 || y == 0) return true;
	location = point (x -> getNumber (), y -> getNumber ());
	reposition ();
	return true;
}
Example #24
0
    void CachedPlanStage::updatePlanCache() {
        std::unique_ptr<PlanCacheEntryFeedback> feedback(new PlanCacheEntryFeedback());
        feedback->stats.reset(getStats());
        feedback->score = PlanRanker::scoreTree(feedback->stats.get());

        PlanCache* cache = _collection->infoCache()->getPlanCache();
        Status fbs = cache->feedback(*_canonicalQuery, feedback.release());
        if (!fbs.isOK()) {
            LOG(5) << _canonicalQuery->ns() << ": Failed to update cache with feedback: "
                   << fbs.toString() << " - "
                   << "(query: " << _canonicalQuery->getQueryObj()
                   << "; sort: " << _canonicalQuery->getParsed().getSort()
                   << "; projection: " << _canonicalQuery->getParsed().getProj()
                   << ") is no longer in plan cache.";
        }
    }
Example #25
0
File: app.c Project: embedthis/esp
/*
    Common base run for every request.
 */
static void commonBase(HttpStream *stream)
{
    cchar   *uri;

    if (!httpIsAuthenticated(stream)) {
        /*
            Access to certain pages are permitted without authentication so the user can login and logout.
         */
        uri = getUri();
        if (sstarts(uri, "/public/") || smatch(uri, "/user/login") || smatch(uri, "/user/logout")) {
            return;
        }
        feedback("error", "Access Denied. Login required.");
        redirect("/public/login.esp");
    }
}
Example #26
0
bool handle_git_repositories (sqlite3 *db)
// Looks at the git repositories mentioned in the database.
// If one needs to be optimized, it does that, and returns true.
{
  // Get the git repository directories from the database.
  vector <string> repositories_in_database;
  {
    SqliteReader reader(0);
    sqlite3_exec(db, "select distinct directory from gitrepos;", reader.callback, &reader, NULL);
    repositories_in_database = reader.string0;
  }

  // Go through the repositories.
  for (unsigned int repo = 0; repo < repositories_in_database.size(); repo++) {
    
    // If the repository was committed, it should get optimized.
    // Store shell commands in the database for later execution.
    printf ("Optimize git repository at %s\n", repositories_in_database[repo].c_str());
    fflush (stdout);
    char *sql;
    // Prune all unreachable objects from the object database.
    sql = g_strdup_printf("insert into commands values ('%s', 'git prune');", double_apostrophy (repositories_in_database[repo]).c_str());
    sqlite3_exec(db, sql, NULL, NULL, NULL);
    // Cleanup unnecessary files and optimize the local repository.
    sql = g_strdup_printf("insert into commands values ('%s', 'git gc');", double_apostrophy (repositories_in_database[repo]).c_str());
    sqlite3_exec(db, sql, NULL, NULL, NULL);
    // Remove extra objects that are already in pack files.
    sql = g_strdup_printf("insert into commands values ('%s', 'git prune-packed');", double_apostrophy (repositories_in_database[repo]).c_str());
    sqlite3_exec(db, sql, NULL, NULL, NULL);
    // Pack unpacked objects in the repository.
    sql = g_strdup_printf("insert into commands values ('%s', 'git repack');", double_apostrophy (repositories_in_database[repo]).c_str());
    sqlite3_exec(db, sql, NULL, NULL, NULL);
    g_free(sql);
    // Remove any mention of this repository from the database.
    sql = g_strdup_printf("delete from gitrepos where directory = '%s';", double_apostrophy (repositories_in_database[repo]).c_str());
    sqlite3_exec(db, sql, NULL, NULL, NULL);
    g_free(sql);
    // Feedback.
    feedback ();
    // Return true since something was done.
    return true;
   
  }

  // Return false since nothing was done.
  return false;  
}
Example #27
0
//-----------------------------------------------------------------------------
bool SDEditor::open (void *ptr)
{
	// !!! always call this !!!
	AEffEditor::open (ptr);

  nuiContextInfo ctxinfo;
  nglWindowInfo wininfo;
#ifdef WIN32
  wininfo.OSInfo.Parent = (HWND)ptr;
#else
  wininfo.OSInfo.Parent = (WindowRef)ptr;
#endif
  wininfo.Width = mMainRect.right;
  wininfo.Height = mMainRect.bottom;

  mpWin = new nuiMainWindow(ctxinfo, wininfo);
  mpWin->SetState(nglWindow::eShow);

  nuiVBox* pBox = new nuiVBox();
  pBox->SetExpand(nuiExpandShrinkAndGrow);
  nuiImage* pBg = new nuiImage(_T("rsrc:/decorations/image.png"));
  pBg->SetAlpha(.3f);
  pBg->SetPosition(nuiCenter);
  nuiRect r(0, 0, mMainRect.right, mMainRect.bottom);
  r.Scale(0.1f, 0.1f);
  pBg->SetLayout(r);
  pBg->SetLayoutAnimationDuration(3.0f);
  pBg->SetLayoutAnimationEasing(nuiEasingElasticOut<500>);

  mpWin->AddChild(pBg);
  mpWin->AddChild(pBox);
  nuiLabel* pLabel = new nuiLabel(_T("Simple NUI VST Plugin"));
  pLabel->SetFont(nuiFont::GetFont(24));
  pLabel->SetBorder(0, 4);
  pBox->AddCell(pLabel, nuiCenter);
  nuiAttrib<float> delay(GetAttribute(_T("Delay")));
  nuiAttrib<float> feedback(GetAttribute(_T("Feedback")));
  nuiAttrib<float> out(GetAttribute(_T("Out")));
  pBox->AddCell(delay.GetEditor());
  pBox->SetCellExpand(1, nuiExpandShrinkAndGrow);
  pBox->AddCell(feedback.GetEditor());
  pBox->SetCellExpand(2, nuiExpandShrinkAndGrow);
  pBox->AddCell(out.GetEditor());
  pBox->SetCellExpand(3, nuiExpandShrinkAndGrow);

	return true;
}
    void CachedPlanRunner::updateCache() {
        _updatedCache = true;

        Database* db = cc().database();
        verify(NULL != db);
        Collection* collection = db->getCollection(_canonicalQuery->ns());
        verify(NULL != collection);
        PlanCache* cache = collection->infoCache()->getPlanCache();

        std::auto_ptr<PlanCacheEntryFeedback> feedback(new PlanCacheEntryFeedback());
        // XXX: what else can we provide here?
        feedback->stats.reset(_exec->getStats());
        feedback->score = PlanRanker::scoreTree(feedback->stats.get());

        Status fbs = cache->feedback(*_canonicalQuery, feedback.release());

        if (!fbs.isOK()) {
            // XXX: what should happen here?
            warning() << "Failed to update cache with feedback: " << fbs.toString() << endl;
        }
    }
/************************Systick_interrupt_0.1ms******************************************/
void SysTick_Handler(void)
{
	SysTicker ++;
	//actuator
	LFL_1_execute(1);
	LFL_2_execute(1);
	LFL_3_execute(1);
	
	LHL_1_execute(1);
	LHL_2_execute(1);
	LHL_3_execute(1);
	
	RFL_1_execute(1);
	RFL_2_execute(1);
	RFL_3_execute(1);
	
	RHL_1_execute(1);
	RHL_2_execute(1);
	RHL_3_execute(1);
		
	//feedback
	feedback (10);
}
Example #30
0
void rechenraum::createFeedbackObjects()
{

    cerr << "createFeedbackObjects()" << endl;

    coDoPoints *feedinfo;
    feedinfo = new coDoPoints(feedback_info->getObjName(), 0);
    ////////////////////////////////////////////////////////////////////
    // add the current parameter values as feedback parameters
    int i = 0;

    coFeedback feedback("TangiblePosition");
    feedback.addString("Rechenraum");

    // the others only if used
    for (i = 0; i < p_nobjects->getValue(); i++)
    {
        feedback.addPara(p_cubes_pos[i]);
        feedback.addPara(p_cubes_size[i]);
    }
    feedback.apply(feedinfo);
    feedback_info->setCurrentObject(feedinfo);
}