Exemple #1
0
void ScopeINDI::serverConnected()
{
    // After connection to the server
    // set option to receive only the messages, no blob
    setBLOBMode(B_NEVER, INDIMountName.mb_str(wxConvUTF8), NULL);
    modal = true; 
    // wait for the device port property
    wxLongLong msec;
    msec = wxGetUTCTimeMillis();
    while ((!scope_port) && wxGetUTCTimeMillis() - msec < 2 * 1000) {
	::wxSafeYield();
    }
    // Set the port, this must be done before to try to connect the device
    if (scope_port && INDIMountPort.Length()) {  // the mount port is not mandatory
	char* porttext = (const_cast<char*>((const char*)INDIMountPort.mb_str()));
	scope_port->tp->text = porttext;
	sendNewText(scope_port); 
    }
    // Connect the mount device
    connectDevice(INDIMountName.mb_str(wxConvUTF8));
    
    msec = wxGetUTCTimeMillis();
    while (modal && wxGetUTCTimeMillis() - msec < 5 * 1000) {
	::wxSafeYield();
    }
    modal = false;
    // In case we not get all the required properties or connection to the device failed
    if( ready) {
       Scope::Connect();
    }
    else {
       Disconnect();
    }
}
void LIB_MANAGER_ADAPTER::Sync( bool aForce, std::function<void(int, int, const wxString&)> aProgressCallback )
{
    wxLongLong nextUpdate = wxGetUTCTimeMillis() + (PROGRESS_INTERVAL_MILLIS / 2);

    int libMgrHash = m_libMgr->GetHash();

    if( !aForce && m_lastSyncHash == libMgrHash )
        return;

    m_lastSyncHash = libMgrHash;
    int i = 0, max = GetLibrariesCount();

    // Process already stored libraries
    for( auto it = m_tree.Children.begin(); it != m_tree.Children.end(); /* iteration inside */ )
    {
        const wxString& name = it->get()->Name;

        if( wxGetUTCTimeMillis() > nextUpdate )
        {
            aProgressCallback( i, max, name );
            nextUpdate = wxGetUTCTimeMillis() + PROGRESS_INTERVAL_MILLIS;
        }

        if( !m_libMgr->LibraryExists( name, true ) )
        {
            it = deleteLibrary( it );
            continue;
        }
        else if( m_libMgr->GetLibraryHash( name ) != m_libHashes[name] )
        {
            updateLibrary( *(CMP_TREE_NODE_LIB*) it->get() );
        }

        ++it;
        ++i;
    }

    // Look for new libraries
    for( const auto& libName : m_libMgr->GetLibraryNames() )
    {
        if( m_libHashes.count( libName ) == 0 )
        {
            if( wxGetUTCTimeMillis() > nextUpdate )
            {
                aProgressCallback( i++, max, libName );
                nextUpdate = wxGetUTCTimeMillis() + PROGRESS_INTERVAL_MILLIS;
            }

            SYMBOL_LIB_TABLE_ROW* library = m_libMgr->GetLibrary( libName );

            auto& lib_node = m_tree.AddLib( libName, library->GetDescr() );
            updateLibrary( lib_node );
            m_tree.AssignIntrinsicRanks();
        }
    }
}
Exemple #3
0
wxLongLong wxGetUTCTimeUSec()
{
#if defined(__WINDOWS__)
    FILETIME ft;
    ::GetSystemTimeAsFileTime(&ft);

    // FILETIME is in 100ns or 0.1us since 1601-01-01, transform to us since
    // 1970-01-01.
    wxLongLong t(ft.dwHighDateTime, ft.dwLowDateTime);
    t /= 10;
    t -= wxLL(11644473600000000); // Unix - Windows epochs difference in us.
    return t;
#else // non-MSW

#ifdef HAVE_GETTIMEOFDAY
    timeval tv;
    if ( wxGetTimeOfDay(&tv) != -1 )
    {
        wxLongLong val(tv.tv_sec);
        val *= MICROSECONDS_PER_SECOND;
        val += tv.tv_usec;
        return val;
    }
#endif // HAVE_GETTIMEOFDAY

    // Fall back to lesser precision function.
    return wxGetUTCTimeMillis()*MICROSECONDS_PER_MILLISECOND;
#endif // MSW/!MSW
}
Exemple #4
0
void SuggestionsSidebarBlock::UpdateSuggestionsForItem(CatalogItemPtr item)
{
    if (!item)
        return;

    long long now = wxGetUTCTimeMillis().GetValue();
    long long delta = now - m_lastUpdateTime;
    m_lastUpdateTime = now;

    if (delta < 100)
    {
        // User is probably holding arrow down and going through the list as crazy
        // and not really caring for the suggestions. Throttle them a bit and call
        // this code after a small delay. Notice that this may repeat itself several
        // times, only continuing through to show suggestions after the dust settled
        // and the user didn't change the selection for a few milliseconds.
        if (!m_suggestionsTimer.IsRunning())
            m_suggestionsTimer.StartOnce(110);
        return;
    }

    m_pendingQueries = 0;

    auto srclang = m_parent->GetCurrentSourceLanguage();
    auto lang = m_parent->GetCurrentLanguage();
    if (!srclang.IsValid() || !lang.IsValid() || srclang == lang)
    {
        OnQueriesFinished();
        return;
    }

    QueryAllProviders(item);
}
Exemple #5
0
size_t PlayListStep::GetPosition() const
{
    int msPerFrame = 1000;
    PlayListItem* timesource = GetTimeSource(msPerFrame);

    size_t frameMS;
    if (timesource != nullptr)
    {
        frameMS = timesource->GetPositionMS();
    }
    else
    {
        auto now = wxGetUTCTimeMillis();
        if (_pause == 0)
        {
            frameMS = (now - _startTime).ToLong();
        }
        else
        {
            frameMS = (now - _startTime - (now - _pause)).ToLong();
        }
    }

    return frameMS;
}
Exemple #6
0
bool PlayListStep::Frame(wxByte* buffer, size_t size)
{
    int msPerFrame = 1000;
    PlayListItem* timesource = GetTimeSource(msPerFrame);

    if (msPerFrame == 0)
    {
        msPerFrame = 50;
    }

    size_t frameMS;
    if (timesource != nullptr)
    {
        frameMS = timesource->GetPositionMS();
    }
    else
    {
        frameMS = (wxGetUTCTimeMillis() - _startTime).ToLong();
    }

    for (auto it = _items.begin(); it != _items.end(); ++it)
    {
        (*it)->Frame(buffer, size, frameMS, msPerFrame);
    }

    if (timesource != nullptr)
    {
        return timesource->Done();
    }
    else
    {
        return frameMS >= GetLengthMS();
    }
}
// Returns elapsed time in milliseconds
long wxGetElapsedTime(bool resetTimer)
{
    wxLongLong oldTime = wxStartTime;
    wxLongLong newTime = wxGetUTCTimeMillis();

    if ( resetTimer )
        wxStartTime = newTime;

    return (newTime - oldTime).GetLo();
}
bool lms7suiteApp::OnInit()
{
    wxInitAllImageHandlers();
    wxBitmap splashBitmap = wxBITMAP_PNG_FROM_DATA(splash);
    wxSplashScreen* splash = new wxSplashScreen(splashBitmap,
        wxSPLASH_CENTRE_ON_SCREEN,
        6000, NULL, -1, wxDefaultPosition, wxDefaultSize,
        wxSIMPLE_BORDER | wxSTAY_ON_TOP);
    wxYield(); //linux needs this to load splash image
    wxLongLong t1 = wxGetUTCTimeMillis();
    LMS7SuiteAppFrame* frame = new LMS7SuiteAppFrame(0L);
#ifndef NDEBUG
    std::cout << "Create time " << (wxGetUTCTimeMillis() - t1).ToString() << " ms\n";
#endif
    splash->Destroy();
    frame->SetIcon(wxICON(LMS_ICO));
    frame->Show();
    return true;
}
Exemple #9
0
void PlayListStep::Restart()
{
    static log4cpp::Category &logger_base = log4cpp::Category::getInstance(std::string("log_base"));
    logger_base.info("Playlist step %s restarting.", (const char*)GetNameNoTime().c_str());

    _startTime = wxGetUTCTimeMillis();
    for (auto it = _items.begin(); it != _items.end(); ++it)
    {
        (*it)->Restart();
    }
}
wxLongLong wxStopWatch::GetCurrentClockValue() const
{
#ifdef __WINDOWS__
    LARGE_INTEGER counter;
    ::QueryPerformanceCounter(&counter);
    return counter.QuadPart;
#elif defined(HAVE_GETTIMEOFDAY)
    return wxGetUTCTimeUSec();
#else // !HAVE_GETTIMEOFDAY
    return wxGetUTCTimeMillis();
#endif // __WINDOWS__/HAVE_GETTIMEOFDAY/else
}
Exemple #11
0
void Camera_INDIClass::serverConnected()
{
    // After connection to the server
    // set option to receive blob and messages for the selected CCD
    setBLOBMode(B_ALSO, INDICameraName.mb_str(wxConvUTF8), INDICameraBlobName.mb_str(wxConvUTF8));
    modal = true;
    // wait for the device port property
    wxLongLong msec;
    msec = wxGetUTCTimeMillis();
    while ((!camera_port) && wxGetUTCTimeMillis() - msec < 1 * 1000) {
        ::wxSafeYield();
    }
    // Set the port, this must be done before to try to connect the device
    if (camera_port && INDICameraPort.Length()) {  // the camera port is not mandatory
        char* porttext = (const_cast<char*>((const char*)INDICameraPort.mb_str()));
        camera_port->tp->text = porttext;
        sendNewText(camera_port);
    }
    // Connect the camera device
    connectDevice(INDICameraName.mb_str(wxConvUTF8));

    msec = wxGetUTCTimeMillis();
    while (modal && wxGetUTCTimeMillis() - msec < 5 * 1000) {
        ::wxSafeYield();
    }
    modal = false;
    // In case we not get all the required properties or connection to the device failed
    if(ready)
    {
        Connected = true;
        m_hasGuideOutput = (pulseGuideNS_prop && pulseGuideEW_prop);
    }
    else {
        pFrame->Alert(_("Cannot connect to camera ")+INDICameraName);
        Connected = false;
        Disconnect();
    }
}
Exemple #12
0
void PlayListStep::Pause(bool pause)
{
    static log4cpp::Category &logger_base = log4cpp::Category::getInstance(std::string("log_base"));

    if (pause)
    {
        _pause = wxGetUTCTimeMillis();
        logger_base.info("Playlist step %s pausing.", (const char*)GetNameNoTime().c_str());
    }
    else
    {
        logger_base.info("Playlist step %s unpausing.", (const char*)GetNameNoTime().c_str());
        _pause = 0;
    }

    for (auto it = _items.begin(); it != _items.end(); ++it)
    {
        (*it)->Pause(pause);
    }
}
Exemple #13
0
void RadarCanvas::OnMouseWheel(wxMouseEvent &event) {
  int delta = event.GetWheelDelta();
  int rotation = event.GetWheelRotation();

  wxLongLong now = wxGetUTCTimeMillis();

  LOG_INFO(wxT("BR24radar_pi: %s Mouse range wheel %d / %d"), m_ri->m_name.c_str(), rotation, delta);

  if (rotation) {
    if (m_pi->m_settings.reverse_zoom) {
      rotation = -rotation;
    }
    if (rotation > ZOOM_SENSITIVITY && m_last_mousewheel_zoom_in < now - ZOOM_TIME) {
      LOG_INFO(wxT("BR24radar_pi: %s Mouse zoom in"), m_ri->m_name.c_str());
      m_ri->AdjustRange(+1);
      m_last_mousewheel_zoom_in = now;
    } else if (rotation < -1 * ZOOM_SENSITIVITY && m_last_mousewheel_zoom_out < now - ZOOM_TIME) {
      LOG_INFO(wxT("BR24radar_pi: %s Mouse zoom out"), m_ri->m_name.c_str());
      m_ri->AdjustRange(-1);
      m_last_mousewheel_zoom_out = now;
    }
  }
}
// starts the global timer
void wxStartTimer()
{
    wxStartTime = wxGetUTCTimeMillis();
}
void frControlPanel::BuildContent(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& size)
{
    wxLongLong t1 = wxGetUTCTimeMillis();
    Freeze();
	//(*Initialize(frControlPanel)
	wxFlexGridSizer* FlexGridSizer1;

	Create(parent, wxID_ANY, _("Control panel"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE|wxSTATIC_BORDER, _T("wxID_ANY"));
	SetMinSize(wxSize(1000,600));
	FlexGridSizer1 = new wxFlexGridSizer(2, 1, 0, 0);
	FlexGridSizer1->AddGrowableCol(0);
	FlexGridSizer1->AddGrowableRow(0);
	pcSPIS = new wxNotebook(this, ID_NOTEBOOK1, wxDefaultPosition, wxSize(900,500), wxNO_FULL_REPAINT_ON_RESIZE, _T("ID_NOTEBOOK1"));
	m_Customer = new pnlCustomer(pcSPIS, ID_PANEL2, wxDefaultPosition, wxSize(621,263), wxTAB_TRAVERSAL, _T("ID_PANEL2"));
	m_top = new pnlTop(pcSPIS, ID_PANEL3, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL3"));
	m_TxPLL = new pnlTxPLL(pcSPIS, ID_PANEL4, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL4"));
	m_RxPLL = new pnlRxPLL(pcSPIS, ID_PANEL5, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL5"));
	m_TxLPF = new pnlTxLPF(pcSPIS, ID_PANEL6, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL6"));
	m_TxRF = new pnlTxRF(pcSPIS, ID_PANEL7, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL7"));
	m_RxLPF = new pnlRxLPF(pcSPIS, ID_PANEL8, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL8"));
	m_RxVGA2 = new pnlRxVGA2(pcSPIS, ID_PANEL9, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL9"));
	m_RxFE = new pnlRxFE(pcSPIS, ID_PANEL10, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL10"));
	m_ADDC = new pnlADDC(pcSPIS, ID_PANEL11, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL11"));
	m_Board = new pnlSi5351C(pcSPIS, ID_PANEL13, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL13"));
	m_ADF = new pnlADF(pcSPIS, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL1"));
	pcSPIS->AddPage(m_Customer, _("System"), false);
	pcSPIS->AddPage(m_top, _("Top"), false);
	pcSPIS->AddPage(m_TxPLL, _("Tx PLL + DSM"), false);
	pcSPIS->AddPage(m_RxPLL, _("Rx PLL + DSM"), false);
	pcSPIS->AddPage(m_TxLPF, _("Tx LPF"), false);
	pcSPIS->AddPage(m_TxRF, _("Tx RF"), false);
	pcSPIS->AddPage(m_RxLPF, _("Rx LPF"), false);
	pcSPIS->AddPage(m_RxVGA2, _("Rx VGA2"), false);
	pcSPIS->AddPage(m_RxFE, _("Rx FE"), false);
	pcSPIS->AddPage(m_ADDC, _("ADC / DAC"), false);
	pcSPIS->AddPage(m_Board, _("Clock Gen"), false);
	pcSPIS->AddPage(m_ADF, _("ADF4002"), false);
	FlexGridSizer1->Add(pcSPIS, 1, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	lbMsgs = new wxRichTextCtrl(this, ID_RICHTEXTCTRL1, _("Text"), wxDefaultPosition, wxDefaultSize, wxRE_MULTILINE, wxDefaultValidator, _T("ID_RICHTEXTCTRL1"));
		wxRichTextAttr rchtxtAttr_1;
	lbMsgs->SetMinSize(wxSize(-1,100));
	FlexGridSizer1->Add(lbMsgs, 1, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	SetSizer(FlexGridSizer1);
	MenuBar1 = new wxMenuBar();
	Menu1 = new wxMenu();
	mnuNew = new wxMenuItem(Menu1, ID_MENUITEM1, _("New project"), wxEmptyString, wxITEM_NORMAL);
	Menu1->Append(mnuNew);
	mnuOpen = new wxMenuItem(Menu1, ID_MENUITEM2, _("Open project"), wxEmptyString, wxITEM_NORMAL);
	Menu1->Append(mnuOpen);
	mnuSave = new wxMenuItem(Menu1, ID_MENUITEM3, _("Save"), wxEmptyString, wxITEM_NORMAL);
	Menu1->Append(mnuSave);
	mnuSaveAs = new wxMenuItem(Menu1, ID_MENUITEM4, _("Save as"), wxEmptyString, wxITEM_NORMAL);
	Menu1->Append(mnuSaveAs);
	Menu1->AppendSeparator();
	mnuReadRVF_rfif = new wxMenuItem(Menu1, ID_MENUITEM9, _("Save to HEX"), wxEmptyString, wxITEM_NORMAL);
	Menu1->Append(mnuReadRVF_rfif);
	Menu1->AppendSeparator();
	mnuChipToGUI = new wxMenuItem(Menu1, ID_MENUITEM10, _("Chip --> GUI"), wxEmptyString, wxITEM_NORMAL);
	Menu1->Append(mnuChipToGUI);
	MenuBar1->Append(Menu1, _("File"));
	Menu2 = new wxMenu();
	mnuAutoDwnld = new wxMenuItem(Menu2, ID_MENUITEM5, _("Auto Download"), wxEmptyString, wxITEM_CHECK);
	Menu2->Append(mnuAutoDwnld);
	mnuAutoDwnld->Check(true);
	mnuRefClk = new wxMenuItem(Menu2, ID_MENUITEM6, _("Reference Clock"), wxEmptyString, wxITEM_NORMAL);
	Menu2->Append(mnuRefClk);
	CommunicationSettings1 = new wxMenuItem(Menu2, ID_MENUITEM7, _("Communication Settings"), wxEmptyString, wxITEM_NORMAL);
	Menu2->Append(CommunicationSettings1);
	MenuBar1->Append(Menu2, _("Options"));
	Menu3 = new wxMenu();
	RegisterTest1 = new wxMenuItem(Menu3, ID_MENUITEM8, _("Registers test"), wxEmptyString, wxITEM_NORMAL);
	Menu3->Append(RegisterTest1);
	MenuBar1->Append(Menu3, _("Tools"));
	Menu4 = new wxMenu();
	mnuAbout = new wxMenuItem(Menu4, ID_MENUITEM11, _("About..."), wxEmptyString, wxITEM_NORMAL);
	Menu4->Append(mnuAbout);
	MenuBar1->Append(Menu4, _("Help"));
	SetMenuBar(MenuBar1);
	ToolBar1 = new wxToolBar(this, ID_TOOLBAR1, wxDefaultPosition, wxDefaultSize, wxTB_HORIZONTAL|wxTB_HORZ_TEXT|wxNO_BORDER, _T("ID_TOOLBAR1"));
	ToolBarItem1 = ToolBar1->AddTool(ID_TOOLBARITEM1, _("New"), wxArtProvider::GetBitmap(wxART_MAKE_ART_ID_FROM_STR(_T("wxART_NEW")),wxART_TOOLBAR), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString);
	ToolBarItem2 = ToolBar1->AddTool(ID_TOOLBARITEM2, _("Open"), wxArtProvider::GetBitmap(wxART_MAKE_ART_ID_FROM_STR(_T("wxART_FILE_OPEN")),wxART_TOOLBAR), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString);
	ToolBarItem3 = ToolBar1->AddTool(ID_TOOLBARITEM3, _("Save"), wxArtProvider::GetBitmap(wxART_MAKE_ART_ID_FROM_STR(_T("wxART_FILE_SAVE")),wxART_TOOLBAR), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString);
	ToolBar1->AddSeparator();
	tbtnDownload = ToolBar1->AddTool(ID_TOOLBARITEM4, _("Send configuration"), wxNullBitmap, wxNullBitmap, wxITEM_NORMAL, _("Send all configuration"), wxEmptyString);
	ToolBar1->Realize();
	SetToolBar(ToolBar1);
	dlgOpen = new wxFileDialog(this, _("Select file"), wxEmptyString, wxEmptyString, wxFileSelectorDefaultWildcardStr, wxFD_DEFAULT_STYLE, wxDefaultPosition, wxDefaultSize, _T("wxFileDialog"));
	sbMain = new wxStatusBar(this, ID_STATUSBAR1, 0, _T("ID_STATUSBAR1"));
	int __wxStatusBarWidths_1[3] = { 10, -10, -10 };
	int __wxStatusBarStyles_1[3] = { wxSB_NORMAL, wxSB_NORMAL, wxSB_NORMAL };
	sbMain->SetFieldsCount(3,__wxStatusBarWidths_1);
	sbMain->SetStatusStyles(3,__wxStatusBarStyles_1);
	SetStatusBar(sbMain);
	static const char *Image1_XPM[] = {
	"22 22 3 1",
	". c #FF0000",
	"X c #0000FF",
	"_ c None",
	"______________________",
	"______________________",
	"______......._________",
	"_______.......________",
	"_______..___..._______",
	"_______..____.._______",
	"_______..____.._______",
	"_______..____.._______",
	"_______..____.._______",
	"_______..___..._______",
	"_______.......________",
	"______......._________",
	"_________XXX__________",
	"_________XXX__________",
	"_________XXX__________",
	"_________XXX__________",
	"_______XXXXXXX________",
	"________XXXXX_________",
	"_________XXX__________",
	"__________X___________",
	"______________________",
	"______________________"
	};
	Image1 = new wxImage(Image1_XPM);
	Image1_BMP = new wxBitmap(Image1_XPM);
	FlexGridSizer1->Fit(this);
	FlexGridSizer1->SetSizeHints(this);

	Connect(ID_MENUITEM1,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&frControlPanel::OnmnuNewSelected);
	Connect(ID_MENUITEM2,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&frControlPanel::OnmnuOpenSelected);
	Connect(ID_MENUITEM3,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&frControlPanel::OnmnuSaveSelected);
	Connect(ID_MENUITEM4,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&frControlPanel::OnmnuSaveAsSelected);
	Connect(ID_MENUITEM9,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&frControlPanel::OnmnuReadRVF_rfifSelected);
	Connect(ID_MENUITEM10,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&frControlPanel::OnmnuChipToGUISelected);
	Connect(ID_MENUITEM5,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&frControlPanel::OnmnuAutoDwnldSelected1);
	Connect(ID_MENUITEM6,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&frControlPanel::OnmnuRefClkSelected1);
	Connect(ID_MENUITEM7,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&frControlPanel::OnCommunicationSettings1Selected1);
	Connect(ID_MENUITEM8,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&frControlPanel::OnRegisterTest1Selected);
	Connect(ID_MENUITEM11,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&frControlPanel::OnmnuAboutSelected);
	Connect(ID_TOOLBARITEM1,wxEVT_COMMAND_TOOL_CLICKED,(wxObjectEventFunction)&frControlPanel::OnmnuNewSelected);
	Connect(ID_TOOLBARITEM2,wxEVT_COMMAND_TOOL_CLICKED,(wxObjectEventFunction)&frControlPanel::OnmnuOpenSelected);
	Connect(ID_TOOLBARITEM3,wxEVT_COMMAND_TOOL_CLICKED,(wxObjectEventFunction)&frControlPanel::OnmnuSaveSelected);
	Connect(ID_TOOLBARITEM4,wxEVT_COMMAND_TOOL_CLICKED,(wxObjectEventFunction)&frControlPanel::OntbtnDownloadClicked);
	Connect(wxID_ANY,wxEVT_CLOSE_WINDOW,(wxObjectEventFunction)&frControlPanel::OnClose);
	//*)

	//Set image for download all tool button
	ToolBar1->SetToolNormalBitmap(ID_TOOLBARITEM4, wxBitmap(*Image1));

	SetTitle("ctr_6002dr2 - ZIPPER EDITION");

	t1 = wxGetUTCTimeMillis();
	// Clear Messages
	lbMsgs->Clear();
	m_top->Initialize();
	m_RxLPF->Initialize(m_ADDC);
	m_TxLPF->Initialize(NULL);
	m_TxRF->Initialize();
	m_RxVGA2->Initialize();
	m_RxFE->Initialize();
	m_TxPLL->Initialize();
	m_RxPLL->Initialize();
	m_ADDC->Initialize();
	m_Customer->Initialize();
	t1 = wxGetUTCTimeMillis();
	// m_frmBoard->Initialize();

	// Project by default
	Thaw();
	setCurrentFileName("untitled.prj");

#ifndef CUSTOMER_MODE
	//double Freq = ReadRefClkFromReg();
	//ShowReferenceClk(Freq);
#endif

#ifdef CUSTOMER_MODE
	if (FileExists(ChangeFileExt(Application->ExeName, ".prj")))
	{
		if (!FileIsNotEmpty(ChangeFileExt(Application->ExeName, ".prj")))
		{
			ShowMessage("Configuration file is corrupt.\n\n\
        Contact Lime Microsystems\n\
        Unit 57 Surrey Tech Centre Occam Road\n\
        The Surrey Research Park Guildford Surrey\n\
        GU2 7YG\n\n\
        Tel: +44 (0)1483 684801, +44(0)142 8653335\n\
        Fax: +44(0) 1428656662\n\n\
		[email protected]");
			Application->Terminate();
		};

		setCurrentFileName(ChangeFileExt(Application->ExeName, ".prj"));
		LoadConfiguration(m_sFileName);
		tbtnDownload->Click();
	}
Exemple #16
0
wxLongLong wxGetLocalTimeMillis()
{
    return wxGetUTCTimeMillis() - wxGetTimeZone()*MILLISECONDS_PER_SECOND;
}