Example #1
0
void
FwdTransform(FFT_DATA_TYPE *ddata,BigInt Num,size_t NumLen)
{
PutNumIntoFFTNum(ddata, Num, NumLen);
StartTimer(FFTTime);
RFFT(ddata,CalcFFTLen(NumLen),1);
StopTimer(FFTTime);
}
Example #2
0
BOOL CSendingDialog::DestroyWindow()
{
    DeleteAll();

    StopTimer();

    return CBaseDialog::DestroyWindow();
}
Example #3
0
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                             %
%                                                                             %
%                                                                             %
%   R e s e t T i m e r                                                       %
%                                                                             %
%                                                                             %
%                                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  ResetTimer() resets the stopwatch.
%
%  The format of the ResetTimer method is:
%
%      void ResetTimer(TimerInfo *time_info)
%
%  A description of each parameter follows.
%
%    o  time_info: Timer statistics structure.
%
*/
MagickExport void ResetTimer(TimerInfo *time_info)
{
  assert(time_info != (TimerInfo *) NULL);
  assert(time_info->signature == MagickSignature);
  StopTimer(time_info);
  time_info->elapsed.stop=0.0;
  time_info->user.stop=0.0;
}
Example #4
0
void TimeHandler::resetTimer(TimeCanal canal)
{
	if (isRunning(canal))
	{
		StopTimer(canal);
		startTimer(canal);
	}
}
Example #5
0
/*****************************************************************************
 * FUNCTION
 *  csb_frm_testtool_callback
 * DESCRIPTION
 *  Callback to take snap shots one by one (non-blocking)
 * PARAMETERS
 *  void
 * RETURNS
 *  U16
 *****************************************************************************/
void csb_frm_testtool_callback(void)
{
    /*----------------------------------------------------------*/
    /* Local Variables                                          */
    /*----------------------------------------------------------*/
	BOOL error_code = TRUE;

    /*----------------------------------------------------------*/
    /* Code Body                                                */
    /*----------------------------------------------------------*/

	StopTimer(CSB_AUTO_MODE_TIMER_ID);

    /* Lock the buffer as we dont want to display the category screens */
    gdi_layer_lock_frame_buffer();

    /* ASSERT if the entryFuncPtr is NULL */
    ASSERT(g_CSB_struct.pscreen_info[g_csb_index].entryFuncPtr != NULL);
    /* Call the category as the buffer must built before calling csb_frm_save_screen_shot */
    g_CSB_struct.pscreen_info[g_csb_index].entryFuncPtr();

    /* Unlock the buffer as it is already built */
    gdi_layer_unlock_frame_buffer();

    /* API to create the file path and save the LAYER contents in JPEG format */
    error_code = (BOOL)csb_frm_save_screen_shot((U32)g_csb_index);

    if (error_code == FALSE)
    {
        /* Clear the key events */
        ClearKeyEvents();
        DisplayPopup((PU8) GetString(STR_ID_CSB_JPEG_FAIL_TEXT), IMG_GLOBAL_ERROR, 1, CSB_NOTIFY_DURATION, 0);
        DeleteUptoScrID(SCR_ID_CSB_TESTTOOL_SCR_ID);
		return;
    }

	/* Show processing screen till all the screenshots are taken */
    TestToolProcessingScr(STR_ID_CSB_PROCESSING_TEXT);

    g_csb_index++;

    /* Delete the screens from History, as all the screens are getting added in History */
    DeleteUptoScrID(SCR_ID_CSB_TESTTOOL_SCR_ID);
	DeleteScreenIfPresent(SCR_ID_CSB_DUMMY_SCR_ID);

	if(g_csb_index < TOTAL_CATEGORY_SCREENS)
	{
		EntryCSBTestToolRun();
	}
	else
	{
		g_csb_index = 0;
		/* Once all the category screenshots are taken, show the DONE pop-up */
		DisplayPopup((PU8) GetString(STR_ID_CSB_TESTTOOL_PASS), IMG_GLOBAL_ACTIVATED, 1, CSB_NOTIFY_DURATION, 0);
		DeleteUptoScrID(SCR_ID_CSB_TESTTOOL_SCR_ID);
	}
	
}
Example #6
0
bool CNetDDESvrApp::OnClose()
{
	// Start the background timer.
	StopTimer(m_nTimerID);

	// Close the listening socket.
	m_oSvrSocket.Close();

	// Close all client connections...
	for (size_t i = 0; i < m_aoConnections.Size(); ++i)
	{
		try
		{
			CNetDDESvrSocket* pConnection = m_aoConnections[i]; 

			if (pConnection->IsOpen())
			{
				// Delete the conversation list.
				for (size_t j = 0; j < pConnection->m_aoNetConvs.Size(); ++j)
					m_pDDEClient->DestroyConversation(pConnection->m_aoNetConvs[j]->m_pSvrConv);

				if (App.m_bTraceNetConns)
					App.Trace(TXT("NETDDE_SERVER_DISCONNECT:"));

				// Send disconnect message.
				CNetDDEPacket oPacket(CNetDDEPacket::NETDDE_SERVER_DISCONNECT);

				pConnection->SendPacket(oPacket);

				// Update stats.
				++m_nPktsSent;
			}
		}
		catch (Core::Exception& /*e*/)
		{
		}
	}

	// Close all client connections.
	m_aoConnections.DeleteAll();

	// Unnitialise the DDE client.
	m_pDDEClient->RemoveListener(this);
	m_pDDEClient.reset();

	// Empty the link cache.
	m_oLinkCache.Purge();

	// Terminate WinSock.
	CWinSock::Cleanup();

	// Save settings.
	SaveConfig();

	App.Trace(TXT("SERVER_STATUS: Server stopped"));

	return true;
}
Example #7
0
int main() {
  SIM_SLEEP_OFF();

  // some variables
  int corenum   = RigelGetCoreNum();
  int threadnum = RigelGetThreadNum();
	int numcores  = RigelGetNumCores();
  int numthreads = RigelGetNumThreads();
  int th_per_core    = RigelGetNumThreadsPerCore();
  int th_per_cluster = RigelGetNumThreadsPerCluster();

  int rows_per_thread = SIZE / numthreads; // statically divide work up
  int start = rows_per_thread * threadnum;
  int end   = start + rows_per_thread;
  int i=0, j=0;

  // setup on thread 0
  if(threadnum == 0) {

    BARRIER_INIT(&bi);

    // init values
    for(i=0;i<SIZE;i++){
      for(j=0;j<SIZE;j++){
        MATRIX[j][i] = j; 
      }
      VECTOR[i] = i;
      RESULT[i] = 0xbeef;
    }

    //printf("rpf:%d numthreads:%d\n", rows_per_thread, numthreads);
    ClearTimer(0);
    // get started
    StartTimer(0);
    atomic_flag_set(&Init_Flag);
  }

  // wait for core 0 to finish setup
  atomic_flag_spin_until_set(&Init_Flag);

  // do the work
  for( i=start; i<end; i++ ) {
    RESULT[i] = MVM(i);  
  }

  BARRIER_ENTER(&bi);

  // cleanup on thread 0
  if(threadnum == 0) {
    StopTimer(0);
    // print results
    for(i=0; i<SIZE; i++) {
      RigelPrint(RESULT[i]);
    }
  }

  return 1;
}
Example #8
0
/*****************************************************************************
 * FUNCTION
 *  mmi_jmms_uc_cancel_mms_sending_for_usb
 * DESCRIPTION
 *  Function is used to cancel mms sending
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_jmms_uc_cancel_mms_sending_for_usb(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    JC_UINT32 msg_id = 0;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    PRINT_INFORMATION_2(MMI_TRACE_INFO, "%s", "mmi_jmms_uc_cancel_mms_sending_for_usb");
    msg_id = mmi_jmms_uc_get_msg_id_from_msg_handle(g_jmms_context->msg_handle);

    /* it means mms encapsulation or sending has sarted */
    if (msg_id > 0)
    {
        mmi_jmms_uc_error_struct error_data = {0, };

        PRINT_INFORMATION_2(MMI_TRACE_INFO, "%s", "Stop MMS Sending");
        if (g_jmms_context->reference_id)
        {
            mmi_jmms_communication_state_node_struct *comm_node_p = NULL;

            PRINT_INFORMATION_2(MMI_TRACE_INFO, "%s%d", "Stoping MMS Sending: ", g_jmms_context->reference_id);

            comm_node_p = mmi_jmms_get_comm_state(g_jmms_context, g_jmms_context->reference_id);

            if (comm_node_p && comm_node_p->callback)
            {
                error_data.error_code = -1;
                error_data.communication_handle_p = comm_node_p;
                comm_node_p->callback(MMS_SENDING_ERROR_CALLBACK, (void*)&error_data);
                /* this is done to stop MMS_COMMUNICATION_STOP_CALLBACK from being executed */
                comm_node_p->callback = NULL;
                mmi_jmms_free_message_header();
                mmi_jmms_free_comm_node(g_jmms_context, g_jmms_context->reference_id);
            }

            jdi_CommunicationStopReq(g_jmms_context->comm_handle, g_jmms_context->reference_id);
            jdi_CommunicationFreeReference(g_jmms_context->comm_handle, g_jmms_context->reference_id);
        }
        else if (g_jmms_context->msg_handle)
        {
            msg_id = mmi_jmms_uc_get_msg_id_from_msg_handle(g_jmms_context->msg_handle);
            if (msg_id > 0)
            {
                PRINT_INFORMATION_2(MMI_TRACE_INFO, "%s", "Stoping MMS Encapsulation: ");
                StopTimer(JMMS_ASYNC_SEND_TIMER);
                if (g_jmms_context->ext_cb)
                {
                    error_data.error_code = -1;
                    error_data.communication_handle_p = NULL;
                    g_jmms_context->ext_cb(MMS_SENDING_ERROR_CALLBACK, (void*)&error_data);
                }
            }
        }
    }
}
void HandleSwitchingObject(uint8_t switchingObject) {
	uint8_t delay_factor;
	uint8_t delayBaseIndex;
	if (switchingObject) {
		/* Switching On */
		StopTimer();
		/* Starting brightness */
		uint8_t indexSwitchingOnBrightness = mem_ReadByte(APP_SWITCH_ON_BRIGHTNESS) & 0x0F;
		// indexSwitchingOnBrightness &= 0b00001111;
		SetSwitchingOnBrightness(indexSwitchingOnBrightness);
		/* Soft-On ? */
		delay_factor = mem_ReadByte(APP_SOFT_ON_FACTOR_CH1);
		if (delay_factor == 0) {
			/* Soft-On no */
			DirectJumpToOneColor();
		} else {
			/* Soft-On yes */
			delayBaseIndex = mem_ReadByte(APP_SOFT_ON_BASE) & 0x07;
			dimmTimerReload = (pgm_read_dword(&delay_bases[delayBaseIndex])) * (uint16_t) delay_factor;
			StartDimming();
			FillOffsetArray(dimmingStepsBetweenLeds);
		}
	} else {
		/* Switching Off */
		StopTimer();
		color[RED_HUE].lastShutoffValue = color[RED_HUE].destinationValue;
		color[GREEN_SAT].lastShutoffValue = color[GREEN_SAT].destinationValue;
		color[BLUE_VAL].lastShutoffValue = color[BLUE_VAL].destinationValue;
		color[RED_HUE].destinationValue = 0;
		color[GREEN_SAT].destinationValue = 0;
		color[BLUE_VAL].destinationValue = 0;
		/* Soft-Off ? */
		delay_factor = mem_ReadByte(APP_SOFT_OFF_FACTOR_CH1);
		if (delay_factor == 0) {
			/* Soft-Off no */
			DirectJumpToOneColor();
		} else {
			/* Soft-Off yes */
			delayBaseIndex = mem_ReadByte(APP_SOFT_OFF_BASE) & 0x07;
			dimmTimerReload = (pgm_read_dword(&delay_bases[delayBaseIndex])) * (uint16_t) delay_factor;
			StartDimming();
			FillOffsetArray(dimmingStepsBetweenLeds);
		}
	}		
}
Example #10
0
    void IOHandler::onEOM() noexcept
    {

        if(mRequestQueue)
        {
            mRequestQueue->enqueue(LogicHandlerRequest(StopTimer(),this));
        }

    }
Example #11
0
// -------------------------------------------------------------------
// Reset
// -------------------------------------------------------------------
void UDPManager::Reset()
{
	StopTimer();
	currentAttempt = 1;
	inited = false;
	initSuccess = false;
	locked = false;
	packetId  = 0;
}
static void avk_framework_auto_test_done(void)
{
    g_avk_framework_fw_ctx.avk_framework_stop_auto_process = MMI_TRUE;
    if (g_avk_framework_fw_ctx.avk_framework_foreground)
    {
        StopTimer(AVK_FRAMEWORK_AUTO_CASE_TIME_DONE);
        StartTimer(AVK_FRAMEWORK_AUTO_CASE_TIME_DONE,0,avk_framework_auto_test_done_cb);        
    }        
}
Example #13
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QFont f("Helvetica",10);
    this->setFont(f);

    LifeField = 0;
    OptionGroup = 0;
    GroupLayout = 0;
    isSimulationOn = false;
    LifeCount = 0;
    IterationCount = 0;


    WindowLayout= new QHBoxLayout;

    QWidget * mycentralwidget = new QWidget;
    mycentralwidget->setLayout(WindowLayout);

    this->setCentralWidget(mycentralwidget);
    this->setWindowTitle("Gra w Życie");

    connect(this, SIGNAL(CellsChanged(int,int)), &Algorithm, SLOT(NewDimension(int,int)));
    connect(&Algorithm, SIGNAL(CellChanged(int,int,bool)),this, SLOT(FeedCell(int,int,bool)));
    connect(&Algorithm, SIGNAL(ChangeStatus(int,int)), this, SLOT(StatusUpdate(int,int)));
    connect(this, SIGNAL(CellsChanged(int,int,bool)), &Algorithm, SLOT(CellModified(int,int,bool)));
    connect(this, SIGNAL(FeedsChanger(int)), &Algorithm, SLOT(FeedsStatus(int)));
    //connect(&Algorithm, SIGNAL(Clear()),this, SLOT(CleanNow()));

    InitLifeField();
    InitGroupBox();
    RowsChanged();
    ColumnsChanged();


this->setMinimumSize(700, 480);

    connect(ColumnChanger, SIGNAL(valueChanged(int)), this, SLOT(ColumnsChanged()));
    connect(RowChanger, SIGNAL(valueChanged(int)), this, SLOT(RowsChanged()));
    connect(Quiter, SIGNAL(clicked()), qApp, SLOT(quit()));
    connect(Generator, SIGNAL(clicked()),this, SLOT(GenerateField()) );
    connect(Cleaner, SIGNAL(clicked()),this, SLOT(CleanNow()));
    connect(LifeField, SIGNAL(cellClicked(int, int)), this, SLOT(FeedCell(int, int)));
    connect(Starter,SIGNAL(clicked()),this ,SLOT(SimulationTrigger()));
    connect(OneMove,SIGNAL(clicked()),&Algorithm ,SLOT(SingleStep()));
    connect(comboBox, SIGNAL(activated(QString)), this, SLOT(Prepared(QString)));

    connect(this,SIGNAL(StartSimulation()), &Algorithm, SLOT(SetTimer()));
    connect(this, SIGNAL(StopSimulation()),&Algorithm, SLOT(StopTimer()));


    qsrand(QTime::currentTime().msecsTo(QTime(0,0,0,0)));

}
Example #14
0
TTTimer::~TTTimer() {
	// stop the timer
	StopTimer();
	// close handle
	uv_close((uv_handle_t*)TimerHnd.Val, NULL);
	// cleanup after it
	uv_timer_req_t* _TimerHnd = (uv_timer_req_t*)TimerHnd.Val;
	free(_TimerHnd);
}
Example #15
0
void
AnimationFrame::OnCmd_anim_next_beat_timer(wxTimerEvent& event)
{
	// next_beat could come from the timer.  If so, stop the timer.
	if (mAnimationView && !mAnimationView->NextBeat())
	{
		StopTimer();
	}
}
Example #16
0
/**
 * Function that will send a request to the receiver asking for their game status.
 */	
void CScabbyQueenDealer::CheckPlayerStatus()
	{
	// Tell the Receiver that we want their game status
	StopTimer();
	iGameStatus = EGameStatusRequest;
	iSendMode = ESendCheckRecvStatus;
	BaseSendTo(iGameStatus, iRemoteNames[iPlayerToken]);
	StartTimer(KMaxSendTime);
	}
Example #17
0
static void ResetSY6522(SY6522_AY8910* pMB)
{
	memset(&pMB->sy6522,0,sizeof(SY6522));

	if(pMB->nTimerStatus)
		StopTimer(pMB);

	pMB->nAYCurrentRegister = 0;
}
Example #18
0
void CTimer::StartTimer(unsigned long int Interval, bool bAutoRestart)
{
    m_bAutoRestart = bAutoRestart;
    if (m_TimerID != 0)
    {
        StopTimer();
    }
    m_TimerID = SDL_AddTimer(Interval, &TimerCallback, this);
}
Example #19
0
void AdcStop()
{
	StopTimer();
	g_adc_elapsed_time = GetTime();
	g_adcStatus = 2;

	ADC_StopConversion(ADC3);
	ADC_StopConversion(ADC4);
}
Example #20
0
void
AnimationFrame::OnCmdReanimate(wxCommandEvent& event)
{
	StopTimer();
	mErrorMarkers.clear();
	if (mAnimationView)
	{
		mAnimationView->Generate();
	}
}
Example #21
0
void Sig1HandlerFunction(int)
{
    extern void StopTimer ();
    StopTimer ();

    sigaction(SIGUSR2, &sig2handler, NULL);
    sigaction(SIGUSR1, &oldsig1handler, NULL);
    sigsetmask (0);
    raise(SIGUSR1);
}
Example #22
0
void TooltipManager::Reset()
{
    StopTimer();

    if (icon_)
        icon_->HideTooltip();

    icon_ = AbstractLauncherIcon::Ptr();
    skip_timeout_ = false;
}
Example #23
0
int CTimer::RestartTimer(double first, double interval){
	//时间间隔有变化 。
	if(m_first != first || m_interval != interval){
		NLOG_INFO("Timer [%s] Restarted [first:%.3lf, interval:%.3lf]", m_name, first, interval);
		StopTimer();
		return StartTimer(first, interval);
	}

	return 0;
}
Example #24
0
void InitTimer ( void )
{
    struct sigaction sa ;

    memset ( &sa , 0 , sizeof (sa ) ) ;
    sa.sa_handler = & timer_handler ;
    sigaction ( SIGALRM , &sa , NULL ) ;

    StopTimer ( ) ;
}
HRESULT CControlSurfaceProbePropPage::Deactivate()
{
	if (NULL == m_hWnd)
		return E_UNEXPECTED;

	StopTimer();

	DestroyMFCDialog();
	return S_OK;
}
Example #26
0
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                             %
%                                                                             %
%                                                                             %
%   G e t U s e r T i m e                                                     %
%                                                                             %
%                                                                             %
%                                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  GetUserTime() returns the User time (user and system) by the operating
%  system (in seconds) between the start and stop events. If the stopwatch is
%  still running, it is stopped first.
%
%  The format of the GetUserTime method is:
%
%      double GetUserTime(TimerInfo *time_info)
%
%  A description of each parameter follows.
%
%    o  time_info: Timer statistics structure.
%
*/
MagickExport double GetUserTime(TimerInfo *time_info)
{
  assert(time_info != (TimerInfo *) NULL);
  assert(time_info->signature == MagickSignature);
  if (time_info->state == UndefinedTimerState)
    return(0.0);
  if (time_info->state == RunningTimerState)
    StopTimer(time_info);
  return(time_info->user.total);
}
Example #27
0
		void MusicRenderer::RenderToSpeaker()
		{
			SoundEvent currentSoundEvent;

			unsigned int duration = m_header.Duration[m_difficulty] * 1000 + 1000;
			std::vector<SoundEvent>::size_type eventCtr = 0, totalEvents = m_soundEvents->size();
			unsigned int elapsed = 0;
			int percentage = 0;

			printf("0%%");

			BeginTimer();
			while(elapsed < duration)
			{
				if(eventCtr < totalEvents)
				{
					currentSoundEvent = m_soundEvents->at(eventCtr);

					if(currentSoundEvent.Time <= elapsed)
					{
						if(currentSoundEvent.NoteType != 3)
						{
							int sampleIndex = -1;
							if(currentSoundEvent.NoteType == 4)
								sampleIndex = GetSample(currentSoundEvent.RefID + 1000);
							else
								sampleIndex = GetSample(currentSoundEvent.RefID);

							if(sampleIndex >= 0)
							{
								Sample sample = m_samples->at(sampleIndex);
								FMOD_RESULT result = m_fmod->playSound(FMOD_CHANNEL_FREE, sample.Data, false, 0);
							}
						}

						eventCtr++;
					}
				}

				m_fmod->update();
				UpdateTimer();
				elapsed = GetElapsedTime();

				if(percentage < 10)
					printf("\b\b");
				else if(percentage < 100)
					printf("\b\b\b");
				else printf("\b\b\b\b");

				percentage = (int)((float)elapsed / (float)duration * 100.f);
				printf("%d%%", percentage);
			}

			StopTimer();
		}
Example #28
0
int main()
{
  StartTimer();

  for (size_t i = 0; i < TESTINTERATIONS; ++i)
  {
    for (size_t j = 0; j < TESTSIZE; ++j)
    {
      std::pair<Stdmap::iterator, bool> ok = stdmap.insert(std::make_pair(uint64_t(j), uint16_t(j)));
    }

    for (size_t j = 0; j < TESTSIZE; ++j)
    {
      stdmap.erase(j);
    }
  }

  uint64_t time;

  time = StopTimer();
  std::cout << "STD Time = " << time << "ms\n";

  StartTimer();

  for (size_t i = 0; i < TESTINTERATIONS; ++i)
  {
    for (size_t j = 0; j < TESTSIZE; ++j)
    {
      std::pair<Etlmap::iterator, bool> ok = etlmap.insert(std::make_pair(uint64_t(j), uint16_t(j)));
    }

    for (size_t j = 0; j < TESTSIZE; ++j)
    {
      etlmap.erase(j);
    }
  }

  time = StopTimer();
  std::cout << "ETL Time = " << time << "ms\n";

  return 0;
}
Example #29
0
  virtual void RemoveRefreshDriver(nsRefreshDriver* aDriver)
  {
    LOG("[%p] RemoveRefreshDriver %p", this, aDriver);

    NS_ASSERTION(mRefreshDrivers.Contains(aDriver), "RemoveRefreshDriver for a refresh driver that's not in the list!");
    mRefreshDrivers.RemoveElement(aDriver);

    if (mRefreshDrivers.Length() == 0) {
      StopTimer();
    }
  }
MainWindow::~MainWindow()
{
	if (brush)
	{
		DeleteObject(brush);
	}

	StopTimer();

	SAFE_DELETE(m_pPlayer);
}