Exemple #1
0
void imageViewer::setParam(QString templateFn,bool usesTemplate,int width,int height)
{
  targetWidth=width;
  targetHeight=height;
  templateFileName=templateFn;
  useTemplate=usesTemplate;
  applyTemplate();
  displayImage();
}
Exemple #2
0
TEST(Heli, SimpleTest)
{
  MODEL_RESET();
  applyTemplate(TMPL_HELI_SETUP);
  anaInValues[ELE_STICK] = 1024;
  evalFlightModeMixes(e_perout_mode_normal, 0);
  EXPECT_EQ(chans[0], -CHANNEL_MAX);
  EXPECT_EQ(chans[1], CHANNEL_MAX/2);
  EXPECT_EQ(chans[1], CHANNEL_MAX/2);
}
Exemple #3
0
void modelDefaultWrite(uint8_t id)
{
  memset(&g_model, 0, sizeof(ModelData));
	setNameP(g_model.name,PSTR(STR_MODEL));
//  strncpy_P(g_model.name,PSTR(STR_MODEL), 10);
	div_t qr ;
	qr = div( id+1, 10 ) ;
  g_model.name[5]='0'+qr.quot;
  g_model.name[6]='0'+qr.rem;
#ifdef VERSION3
  g_model.modelVersion = 3 ;
#else
  g_model.modelVersion = 2 ;
#endif
	g_model.trimInc = 2 ;

#ifdef NO_TEMPLATES
  applyTemplate(); //default 4 channel template
#else
  applyTemplate(0); //default 4 channel template
#endif
  theFile.writeRlc(FILE_MODEL(id),FILE_TYP_MODEL,(uint8_t*)&g_model,sizeof(g_model),200);
}
Exemple #4
0
void modelDefault(uint8_t id)
{
  memset(&g_model, 0, sizeof(SKYModelData));
  strncpy_P(g_model.name,PSTR(STR_MODEL), 10 );
  g_model.name[5]='0'+(id+1)/10;
  g_model.name[6]='0'+(id+1)%10;
	g_model.modelVersion = MDSKYVERS;
	g_model.trimInc = 1 ;

  applyTemplate(0) ; //default 4 channel template
  memcpy(ModelNames[id+1], g_model.name, sizeof(g_model.name));
	g_model.protocol = PROTO_OFF ;
	g_model.xprotocol = PROTO_OFF ;
	eeDirty(EE_MODEL) ;
}
Exemple #5
0
void modelDefault(uint8_t id)
{
  memset(&g_model, 0, sizeof(SKYModelData));
  strncpy_P(g_model.name,PSTR(STR_MODEL), 10 );
  g_model.name[5]='0'+(id+1)/10;
  g_model.name[6]='0'+(id+1)%10;
	g_model.modelVersion = MDSKYVERS;
	g_model.trimInc = 2 ;

  applyTemplate(0); //default 4 channel template

	// Set all mode trims to be copies of FM0
	for ( uint32_t i = 0 ; i < MAX_MODES ; i += 1 )
	{
		g_model.phaseData[i].trim[0] = TRIM_EXTENDED_MAX + 1 ;
		g_model.phaseData[i].trim[1] = TRIM_EXTENDED_MAX + 1 ;
		g_model.phaseData[i].trim[2] = TRIM_EXTENDED_MAX + 1 ;
		g_model.phaseData[i].trim[3] = TRIM_EXTENDED_MAX + 1 ;
	}
}
Exemple #6
0
uint  imageViewer:: setSizeRatio(int sizeRatio,bool usesCompression)
{
  if(!usesCompression) return sourceImage.byteCount();
  compressionRatio=sizeRatio;
  return applyTemplate();
}