Example #1
0
void CippsRun::PrepareParameters()
{
    len = 0;
    SetParams((CippsDemoDoc*)m_pDocSrc ,pSrc , m_lenSrc,  len);
    SetParams((CippsDemoDoc*)m_pDocSrc2,pSrc2, m_lenSrc2, len);
    SetParams((CippsDemoDoc*)m_pDocSrc3,pSrc3, m_lenSrc3, len);
    SetParams((CippsDemoDoc*)m_pDocDst ,pDst , m_lenDst);
    SetParams((CippsDemoDoc*)m_pDocDst2,pDst2, m_lenDst2);
}
Example #2
0
void CippsRun::ResetInplaceParms()
{
   if (m_pDocSrc3)
      SetParams((CippsDemoDoc*)m_pDocSrc3,pSrc3,m_lenSrc3);
   else if (m_pDocSrc2)
      SetParams((CippsDemoDoc*)m_pDocSrc2,pSrc2,m_lenSrc2);
   else
      SetParams((CippsDemoDoc*)m_pDocSrc,pSrc,m_lenSrc);
}
Example #3
0
void CippsRun::SetInplaceParms()
{
   if (m_pDocSrc3)
      SetParams(&m_InplaceVector,pSrc3,m_lenSrc3);
   else if (m_pDocSrc2)
      SetParams(&m_InplaceVector,pSrc2,m_lenSrc2);
   else
      SetParams(&m_InplaceVector,pSrc,m_lenSrc);
}
Example #4
0
    void ParsedDRICmd::MakeParamList()
    {
        // [ ][(]param[,] param2[)]
        // [ ][=]param
         
        if (CDebugMode) std::cout << "MakeParamList" << std::endl;

        m_cmd = m_cmd.trimmed();

        QStringList params;
       
        // if it's option's parameter, which starts with COptInit
        if ( m_cmd.startsWith(COptInit) )
        {
            m_cmd = m_cmd.remove(0, 1).trimmed();
            if ( m_cmd.isEmpty() ) ThrowSepErrorMsg("Missing property's parameter after", 
                                                        COptInit);
            // even is there is too many params will be syntax exception
            SetParams( QStringList(m_cmd) );
            m_actType = PropertyWrite;
            return;
        }

        // if there are method's parameters, 
        // which start with CMethodInitBegin and end with CMethodInitEnd
        if ( m_cmd.startsWith(CMethodInitBegin) )
        {
            if ( !m_cmd.endsWith(CMethodInitEnd) )
            {
                ThrowSepErrorMsg("Parameter's list does not end with", CMethodInitEnd);
            }
            // remove separators
            m_cmd = m_cmd.mid(1, m_cmd.size() - 2);
            m_actType = MethodCall;
        }

        // try split with using CParamSep
        if ( m_cmd.trimmed().endsWith(CParamSep) )
        {
            ThrowErrorMsg("Missing property's parameter after", CParamSep);
        }
        SplitWithQuotesConsideration(m_cmd, CParamSep, params, false);
        if (params.size() > 1) 
        {
            SetParams(params);
            m_actType = MethodCall;
            return;
        }

        // try split with using CSep
        SplitWithQuotesConsideration(m_cmd, CSep, params);
        SetParams(params);
        if (params.size() > 1) m_actType = MethodCall;
    }
Example #5
0
//---------------------------------------------------------------------------
bool __fastcall TCustomCommandDialog::Execute(TCustomCommandType & Command)
{
  CommandEdit->Items = CustomWinConfiguration->History[L"CustomCommand"];
  if (CommandEdit->Items->Count == 0)
  {
    for (int i = 0; i < FCustomCommandList->Count; i++)
    {
      CommandEdit->Items->Add(FCustomCommandList->Commands[i]->Name);
    }
  }

  DescriptionEdit->Text = Command.Name;
  FOrigDescription = Command.Name;
  CommandEdit->Text = Command.Command;
  SetParams(Command.Params);
  if (FMode != ccmAdHoc)
  {
    SetShortCutCombo(ShortCutCombo, Command.ShortCut);
  }

  bool Result = (ShowModal() == DefaultResult(this));
  if (Result)
  {
    GetCommand(Command);

    CommandEdit->SaveToHistory();
    CustomWinConfiguration->History[L"CustomCommand"] = CommandEdit->Items;
  }
  return Result;
}
Example #6
0
TiltedCylinderIF::TiltedCylinderIF(const Real&     a_radius,
                                   const RealVect& a_direction,
                                   const RealVect& a_point,
                                   const bool&     a_inside)
{
  SetParams(a_radius,a_direction,a_point,a_inside);
}
Example #7
0
unsigned int APIENTRY pngBindF(FILE *file, int mipmap, int trans, pngInfo *info, int wrapst, int minfilter, int magfilter) {
      unsigned int id = SetParams(wrapst, magfilter, minfilter);

      if (id != 0 && pngLoadF(file, mipmap, trans, info))
            return id;
      return 0;
}
Example #8
0
int xmain(int argc, char **argv)
	{
    MuscleContext *ctx = getMuscleContext();
#if	WIN32
// Multi-tasking does not work well in CPU-bound
// console apps running under Win32.
// Reducing the process priority allows GUI apps
// to run responsively in parallel.
	SetPriorityClass(GetCurrentProcess(), BELOW_NORMAL_PRIORITY_CLASS);
#endif
	ctx->muscle.g_argc = argc;
	ctx->muscle.g_argv = argv;

	SetNewHandler();
	SetStartTime();
	ProcessArgVect(argc - 1, argv + 1);
	SetParams();
	SetLogFile();

	//extern void TestSubFams(const char *);
	//TestSubFams(g_pstrInFileName);
	//return 0;

	if (ctx->params.g_bVersion)
		{
		printf(MUSCLE_LONG_VERSION "\n");
		exit(EXIT_SUCCESS);
		}

	if (!ctx->params.g_bQuiet)
		//Credits();

	if (MissingCommand() && isatty(0))
		{
		Usage();
		exit(EXIT_SUCCESS);
		}

	if (ctx->params.g_bCatchExceptions)
		{
		try
			{
			Run();
			}
		catch (...)
			{
			OnException();
			exit(EXIT_Except);
			}
		}
	else
		Run();

#ifdef _CRTDBG_MAP_ALLOC
    delete ctx;
    _CrtDumpMemoryLeaks(); //to Output window of MSVC
#endif

	exit(EXIT_Success);
	}
Example #9
0
CEasingCurve::CEasingCurve ( const CEasingCurve& a_rfOther )
{
    m_pImplementation = new CEasingCurve_Impl ( a_rfOther.GetType () );
    double fPeriod, fAmplitude, fOvershoot;
    a_rfOther.GetParams ( fPeriod, fAmplitude, fOvershoot );
    SetParams ( fPeriod, fAmplitude, fOvershoot );
}
Example #10
0
OculusHud::OculusHud()
    : post_unwarp(true), handler(*this)
{
    InitialiseOculus();
    InitialiseFramebuffer();
    InitialiseShader();

    // Make this the default fullscreen view
    DisplayBase().AddDisplay(*this);
    SetBounds(Attach::Pix(0),Attach::Pix(HMD.VResolution),Attach::Pix(0),Attach::Pix(HMD.HResolution));
    handler.SetHandler(&pangolin::StaticHandler);
    View::SetHandler(&handler);

    // Initialise per-eye views / parameters
    for(int i=0; i<2; ++i) {
        int hw = HMD.HResolution/2;
        eyeview[i].SetBounds(Attach::Pix(0),Attach::Pix(HMD.VResolution),Attach::Pix(i*hw),Attach::Pix((1+i)*hw));
        this->AddDisplay(eyeview[i]);
    }

    // Setup default projection parameters
    const OVR::Util::Render::DistortionConfig& Distortion = stereo.GetDistortionConfig();
    const float ppos = HMD.HResolution * Distortion.XCenterOffset / 4.0f;
    SetParams(204.4, ppos, 0.177, -0.083);

    common.SetHandler(&pangolin::StaticHandler);
    this->AddDisplay(common);

    T_oc = IdentityMatrix();

    pangolin::SetFullscreen();
}
Example #11
0
int EvalCommand ::	Execute( ALib::CommandLine & cmd ) {

	GetSkipOptions( cmd );
	IOManager io( cmd );
	CSVRow row;

	mDiscardInput = cmd.HasFlag( FLAG_DISCARD );
	GetExpressions( cmd );

	while( io.ReadCSV( row ) ) {
		if ( Skip( io, row ) ) {
			continue;
		}
		if ( ! Pass( io, row ) ) {
			SetParams( row, io );
			if ( mDiscardInput ) {
				row.clear();
			}
			Evaluate( row );
		}

		io.WriteRow( row );
	}

	return 0;
}
Example #12
0
NETCLASS::NETCLASS( BOARD* aParent, const wxString& aName, const NETCLASS* initialParameters ) :
    m_Parent( aParent ),
    m_Name( aName )
{
    // use initialParameters if not NULL, else set the initial
    // parameters from boardDesignSettings (try to change this)
    SetParams( initialParameters );
}
Example #13
0
CEasingCurve&  CEasingCurve::operator=( const CEasingCurve& a_rfOther )
{
    SetType ( a_rfOther.GetType () );
    double fPeriod, fAmplitude, fOvershoot;
    a_rfOther.GetParams ( fPeriod, fAmplitude, fOvershoot );
    SetParams ( fPeriod, fAmplitude, fOvershoot );
    return *this;
}
Example #14
0
void CUIListItemServer::Init(LIST_SRV_ITEM& params, float x, float y, float width, float height)
{
	CUIWindow::Init(x,y,width,height);

	SetTextColor(params.color);
	SetFont(params.font);

	float offset = 0.0f;

	m_icon.Init(offset, 0, params.size.icon, height);
	offset += params.size.icon;

	m_server.Init(offset, 0, params.size.server, height);
//	m_server.SetText(*params.info.server);
	offset += params.size.server;

	m_map.Init(offset, 0, params.size.map, height);
//	m_map.SetText(*params.info.map);
	offset += params.size.map;

	m_game.Init(offset, 0, params.size.game, height);
//	m_game.SetText(*params.info.game);
	offset += params.size.game;

	m_players.Init(offset, 0, params.size.players, height);
//	m_players.SetText(*params.info.players);
	offset += params.size.players;

	m_ping.Init(offset, 0, params.size.ping, height);
//	m_ping.SetText(*params.info.ping);
	offset += params.size.ping;

	m_version.Init(offset, 0, params.size.version, height);

	float icon_size = CUITextureMaster::GetTextureHeight("ui_icon_password");
//	if (params.info.icons.pass)
//	{
	m_iconPass.Init(0,0,icon_size,icon_size);
	m_iconPass.InitTexture("ui_icon_password");
//	}
//	if (params.info.icons.dedicated)
//	{
	m_iconDedicated.Init(icon_size,0,icon_size,icon_size);
	m_iconDedicated.InitTexture("ui_icon_dedicated");
//	}
	
//	if (params.info.icons.punkbuster)
//	{
	m_iconPunkBuster.Init(icon_size*2,0,icon_size,icon_size);
	m_iconPunkBuster.InitTexture("ui_icon_punkbuster");
//	}

	SetParams(params);



	m_srv_info = params;
}
Example #15
0
NullPlannerFactored::NullPlannerFactored(size_t horizon, FactoredDecPOMDPDiscreteInterface* p)
{
    PlanningUnitMADPDiscreteParameters params;
    params.SetComputeAll(false);

    SetParams(params);
    SetProblem(p);
    SetHorizon(horizon);
}
Example #16
0
//---------------------------------------------------------------------------
void __fastcall TCustomCommandDialog::CommandEditSetData(
  THistoryComboBox * /*Sender*/, Pointer Data)
{
  int IData = reinterpret_cast<int>(Data);
  if (FLAGSET(IData, ccSet))
  {
    SetParams(IData & ~ccSet);
  }
}
void MixerControl::Start(SeqEvent *evt)
{
    oscOn = 0;
    SetParams((VarParamEvent *)evt);

    if (im == 0)
        return;

    mix = im->GetMixer();
    if (mix == 0)
        return;

    switch (func)
    {
    case mixSetInpLvl:
        mix->ChannelVolume(inChnl, frLvl);
        break;
    case mixSetPanPos:
        mix->ChannelPan(inChnl, panType, frLvl);
        break;
    case mixSetSendLvl:
        mix->FxLevel(fxUnit, inChnl, frLvl);
        break;
    case mixSetFxLvl:
        mix->FxReceive(fxUnit, frLvl);
        break;
    case mixSetFxPan:
        mix->FxPan(fxUnit, panTrig, frLvl);
        break;
    case mixRampInpLvl:
    case mixRampPanPos:
    case mixRampSendLvl:
    case mixRampFxLvl:
    case mixRampFxPan:
        rmp.InitSegTick(tickCount, frLvl, toLvl);
        break;
    case mixOscilInpLvl:
    case mixOscilPanPos:
    case mixOscilSendLvl:
    case mixOscilFxLvl:
    case mixOscilFxPan:
        oscOn = 1;
        if (frLvl < toLvl)
        {
            swpRng = toLvl - frLvl;
            swpOffs = frLvl;
        }
        else
        {
            swpRng = frLvl - toLvl;
            swpOffs = toLvl;
        }
        osc.Reset(0);
        break;
    }
}
Example #18
0
void Tower::SetType(int newType)
{
	type = newType;

	switch (type)
	{
		default:
			SetParams(2*TILESIZE, 1, 32);
	};
};
void DIALOG_GENDRILL::UpdateConfig()
{
    SetParams();

    m_config->Write( ZerosFormatKey, m_ZerosFormat );
    m_config->Write( MirrorKey, m_Mirror );
    m_config->Write( MinimalHeaderKey, m_MinimalHeader );
    m_config->Write( UnitDrillInchKey, m_UnitDrillIsInch );
    m_config->Write( DrillOriginIsAuxAxisKey, m_DrillOriginIsAuxAxis );
    m_config->Write( DrillMapFileTypeKey, m_mapFileType );
}
 ///////////////////////////////////////////////////////////////////////
 ///  Function: On_WM_COMMAND_IDC_TRUE_WindowMessage
 ///
 ///    Author: $author$
 ///      Date: 5/11/2012
 ///////////////////////////////////////////////////////////////////////
 virtual LRESULT On_WM_COMMAND_IDC_TRUE_WindowMessage
 (HWND hWnd,
  UINT msg,
  WPARAM wParam,
  LPARAM lParam) 
 {
     LRESULT lResult = FALSE;
     SetParams();
     GetParams();
     return lResult;
 }
Example #21
0
//------------------------------------------------------------------------
void CProjectile::SerializeSpawnInfo(TSerialize ser)
{
	ser.Value("hostId", m_hostId, 'eid');
	ser.Value("ownerId", m_ownerId, 'eid');
	ser.Value("weaponId", m_weaponId, 'eid');
	ser.Value("pos", m_initial_pos, 'wrld');
	ser.Value("dir", m_initial_dir, 'dir0');
	ser.Value("vel", m_initial_vel, 'vel0');

	if(ser.IsReading())
		SetParams(m_ownerId, m_hostId, m_weaponId, m_damage, m_hitTypeId, m_damageDropPerMeter, m_damageDropMinDisSqr);
}
Example #22
0
File: pr_08_1.c Project: qnu/mdoch
int main (int argc, char **argv)
{
  GetNameList (argc, argv);
  PrintNameList (stdout);
  SetParams ();
  SetupJob ();
  moreCycles = 1;
  while (moreCycles) {
    SingleStep ();
    if (stepCount >= stepLimit) moreCycles = 0;
  }
}
Example #23
0
void GraphBox::OnOK(wxCommandEvent& WXUNUSED(event))
{
	long stringnum;
	wxString snum, text;

	graph = graphwin->graphset[0]->plot[0];

	SetParams();
	
	graphwin->UpdateScroll();
	diagbox->Write(text.Format("colourstring %s\n", ColourString(graph->strokecolour)));
}
Example #24
0
		inline CCamera()
		{
			m_vPos.Set( 0, 0, 10 );

			m_qOrient.vDir.x = 0;
			m_qOrient.vDir.y = 0;
			m_qOrient.vDir.z = 0;
			m_qOrient.fAngle = 1;

			m_vAngles.Set( 0, 0, 0 );

			SetParams(34.516f, 800, 600, 1, 200);
		}
Example #25
0
//------------------------------------------------------------------------
void CProjectile::SerializeSpawnInfo( TSerialize ser )
{
	ser.Value("hostId", m_hostId, 'eid');
	ser.Value("ownerId", m_ownerId, 'eid');
	ser.Value("weaponId", m_weaponId, 'eid');
	ser.Value("fmId", m_fmId, 'fmod');
	ser.Value("pos", m_initial_pos, 'wrld');
	ser.Value("dir", m_initial_dir, 'dir0');
	ser.Value("vel", m_initial_vel, 'vel0');
	ser.Value("tracked", m_tracked, 'bool');

	if (ser.IsReading())
		SetParams(m_ownerId, m_hostId, m_weaponId, m_fmId, m_damage, m_hitTypeId);
}
Example #26
0
int main (int argc, char **argv)
{
  GetNameList (argc, argv);
  //PrintNameList (stdout);
  SetParams ();
  SetupJob ();
  moreCycles = 1;
  eventCount = 0;
  while (moreCycles) {
    SingleEvent ();
    ++ eventCount;
    if (eventCount >= limitEventCount) moreCycles = 0;
  }
}
//========================================================================
// Constructor
//========================================================================
CDetourInfo::CDetourInfo( char* szParams, eCallingConv conv )
{
	if( !szParams )
	{
		m_szParams = NULL;
		m_iOffsets = NULL;
		return;
	}

	// Store calling convention
	m_eConv = conv;

	SetParams( szParams );
}
CprsErr TextCompressor::CompressPlain(char* dest, int& dlen, char* src, int slen, int ver, int lev)
{
	if((dest == NULL) || (src == NULL) || (dlen <= 0) || (slen <= 0))
		return CPRS_ERR_PAR;
	if((ver < 0) || (ver > 2) || (lev < 1) || (lev > 9))
		return CPRS_ERR_VER;

	if(ver == 0) return CompressCopy(dest, dlen, src, slen);

	// save version and level of compression
	dest[0] = (char)ver;
	dest[1] = (char)lev;
	int dpos = 2;
	CprsErr err = CPRS_SUCCESS;

	// PPM
	if((ver == 1) || (ver == 2)) {
		int clen;
		PPMParam param;
		SetParams(param, ver, lev, slen);

		// leave place in 'dest' for the array of 'dpos' of data parts
		int n = (int)split.size() - 1;
		int* dpos_tab = (int*) (dest + dpos);
		dpos += n * sizeof(int);

		PPM* ppm = NULL;
		PPM::ModelType mt = ((ver == 1) ? PPM::ModelSufTree : PPM::ModelWordGraph);

		// loop: build next PPM model, compress next part of the data
		for(int i = 0; i < n; i++) {
			ppm = new PPM((uchar*)src, split[i], mt, param);

			clen = dlen - dpos;
			err = ppm->Compress(dest + dpos, clen, (uchar*)src + split[i], split[i+1] - split[i]);
			delete ppm;
			if(err) break;

			dpos_tab[i] = dpos;
			dpos += clen;
		}
	}

	// is it better to simply copy the source data?
	if(((err == CPRS_ERR_BUF) || (dpos >= slen)) && (dlen >= slen + 1))
		return CompressCopy(dest, dlen, src, slen);

	dlen = dpos;
	return err;
}
Example #29
0
    bool JackNetAdapter::Init()
    {
        jack_log("JackNetAdapter::Init");

        //init network connection
        if (!JackNetSlaveInterface::Init()) {
            jack_error("JackNetSlaveInterface::Init() error...");
            return false;
        }

        //then set global parameters
        if (!SetParams()) {
            jack_error("SetParams error...");
            return false;
        }

        //set buffers
        if (fCaptureChannels > 0) {
            fSoftCaptureBuffer = new sample_t*[fCaptureChannels];
            for (int port_index = 0; port_index < fCaptureChannels; port_index++) {
                fSoftCaptureBuffer[port_index] = new sample_t[fParams.fPeriodSize];
                fNetAudioCaptureBuffer->SetBuffer(port_index, fSoftCaptureBuffer[port_index]);
            }
        }

        if (fPlaybackChannels > 0) {
            fSoftPlaybackBuffer = new sample_t*[fPlaybackChannels];
            for (int port_index = 0; port_index < fPlaybackChannels; port_index++) {
                fSoftPlaybackBuffer[port_index] = new sample_t[fParams.fPeriodSize];
                fNetAudioPlaybackBuffer->SetBuffer(port_index, fSoftPlaybackBuffer[port_index]);
            }
        }

        //set audio adapter parameters
        SetAdaptedBufferSize(fParams.fPeriodSize);
        SetAdaptedSampleRate(fParams.fSampleRate);

        // Will do "something" on OSX only...
        fThread.SetParams(GetEngineControl()->fPeriod, GetEngineControl()->fComputation, GetEngineControl()->fConstraint);

        if (fThread.AcquireSelfRealTime(GetEngineControl()->fClientPriority) < 0) {
            jack_error("AcquireSelfRealTime error");
        } else {
            set_threaded_log_function();
        }

        //init done, display parameters
        SessionParamsDisplay(&fParams);
        return true;
    }
Example #30
0
void
AutoMounter::ReadSettings()
{
#if _INCLUDES_CLASS_DEVICE_MAP
	BPath directoryPath;

	if (FSFindTrackerSettingsDir(&directoryPath) != B_OK)
		return;
	
	BPath path(directoryPath);
	path.Append(kAutoMounterSettings);
	fPrefsFile.SetTo(path.Path(), O_RDWR);
	
	if (fPrefsFile.InitCheck() != B_OK) {
		// no prefs file yet, create a new one

		BDirectory dir(directoryPath.Path());
		dir.CreateFile(kAutoMounterSettings, &fPrefsFile);
		return;
	}

	ssize_t settingsSize = (ssize_t)fPrefsFile.Seek(0, SEEK_END);
	if (settingsSize == 0)
		return;

	ASSERT(settingsSize != 0);
	char *buffer = new char[settingsSize];
	
	fPrefsFile.Seek(0, 0);
	if (fPrefsFile.Read(buffer, (size_t)settingsSize) != settingsSize) {
		PRINT(("error reading automounter settings\n"));
		delete [] buffer;
		return;
	}

	BMessage message('stng');
	status_t result = message.Unflatten(buffer);
	
	if (result != B_OK) {
		PRINT(("error %s unflattening settings, size %d\n", strerror(result), 
			settingsSize));
		delete [] buffer;
		return;
	}
	
	delete [] buffer;
//	PRINT(("done unflattening settings\n"));
	SetParams(&message, true);
#endif
}