/*********************** * Constructor **********************/ ObjectManager::ObjectManager( const TiXmlElement *root, const IntRect &mapRect, int tileSize, lua_State *L ) : m_mapRect( mapRect ), m_tileSize( tileSize ) { Object::SetMapRect( mapRect ); Object::SetTileSize( tileSize ); LoadData( root, L ); }
bool LoadTemplate::ProcessLoad() { ClearData(); if (!LoadData()) return false; AfterLoadData(); // 完成数据加载后整理数据 return true; }
BOOL CPropPageSMS::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) { // TODO: Add your specialized code here and/or call the base class if (PSN_SETACTIVE == ((LPNMHDR)lParam)->code) { // just changed tabs LoadData(); } // return TRUE; return CPropertyPage::OnNotify(wParam, lParam, pResult); }
void BlockEditDialog::OnReadNext(void) { ASSERT(fpDiskFS != NULL); if (fBlock == fpDiskFS->GetDiskImg()->GetNumBlocks() - 1) return; fBlock++; SetSpinner(IDC_DISKEDIT_TRACKSPIN, fBlock); LoadData(); }
BOOL ConfigFile::Create(CTSTR lpConfigFile) { strFileName = lpConfigFile; if(LoadFile(XFILE_CREATEALWAYS)) LoadData(); else return 0; return 1; }
BOOL ConfigFile::Open(CTSTR lpConfigFile, BOOL bOpenAlways) { strFileName = lpConfigFile; if(LoadFile(bOpenAlways ? XFILE_OPENALWAYS : XFILE_OPENEXISTING)) LoadData(); else return 0; return 1; }
BOOL CDialogFramesRecording::OnInitDialog() { CDialog::OnInitDialog(); LoadData(); bCurrentCheckRecordFrames = m_bCheckRecordFrames; UpdateEnableControls(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
bool ff::LoadData<ff::String>(IDataReader *pReader, StringOut data) { DWORD nBytes = 0; assertRetVal(LoadData(pReader, nBytes), false); const BYTE* sz = LoadBytes(pReader, (size_t)nBytes); assertRetVal(sz, false); data.assign((const wchar_t *)sz, (nBytes / sizeof(wchar_t)) - 1); return true; }
//****************************************************** void cCutSet::Finished() { disconnect(CLoadThread,SIGNAL(Set(int,QString)),this,SLOT(Set(int,QString))); disconnect(CLoadThread,SIGNAL(Finished()),this,SLOT(Finished())); mFiles.clear(); pushButtonCut1->setEnabled(true); pushButtonBrowse1->setEnabled(true); lineEditDirectory->setEnabled(true); LoadData(); }
//----------------------------------------------------------------------------- // MAIN //----------------------------------------------------------------------------- int main (int argc, char *argv[]) { struct rect_list_element *list_head; int ret_code; list_head = NULL; ret_code = LoadData (list_head); if (ret_code != TRUE) return -1; SortRectangleList (list_head); DeleteRectangleList (list_head); return 0; }
//--------------------------------------------------------------------------- void LoadDataInAllPages(int idstud) { if (dllInstances) { for (int i=0;i<dllInstances->Count;i++) { dllInstance=dllInstances->Items[i]; LoadData = (TLoadData *)GetProcAddress(dllInstance, "_LoadData"); if (LoadData) LoadData(DefIniFileName,idstud,(TForm*)(Pages->Items[i])); } } }
//------------------------------------------------------------------------------ // MultiPathSetupPanel(wxWindow *parent, const StringArray &pathNames) //------------------------------------------------------------------------------ MultiPathSetupPanel::MultiPathSetupPanel(wxWindow *parent, const StringArray &pathNames) : wxPanel(parent) { for (UnsignedInt i=0; i<pathNames.size(); i++) mPathNames.Add(pathNames[i].c_str()); Create(); LoadData(); mHasDataChanged = false; }
BOOL CCommonSetDlg::OnInitDialog() { CDialog::OnInitDialog(); // TODO: 在此添加额外的初始化 m_Grid.SetEditable(FALSE); SetGlobalVal(); LoadData(); return TRUE; // return TRUE unless you set the focus to a control // 异常: OCX 属性页应返回 FALSE }
/** \fn GalleryView::MenuSettings(MythMenu *) * \brief Adds a new settings menu entry into the main menu * \param mainMenu Parent that will hold the menu entry * \return void */ void GalleryView::MenuSettings() { GalleryConfig *config = new GalleryConfig(m_mainStack, "galleryconfig"); connect(config, SIGNAL(configSaved()), this, SLOT(LoadData())); if (config->Create()) { m_mainStack->AddScreen(config); } else delete config; }
void CMakeHelpTab::OnReload(wxCommandEvent& event) { wxUnusedVar(event); wxASSERT(m_plugin->GetCMake()); if(!m_plugin->GetCMake()->IsOk()) { wxMessageBox(_("CMake application path is invalid!"), wxMessageBoxCaptionStr, wxOK | wxCENTER | wxICON_ERROR); return; } LoadData(true); }
BOOL KActiveSettings::Init() { BOOL bResult = false; BOOL bRetCode = false; bRetCode = LoadData(); KGLOG_PROCESS_ERROR(bRetCode); bResult = true; Exit0: return bResult; }
BOOL KPlayerValueInfoList::Init() { BOOL bResult = false; BOOL bRetCode = false; bRetCode = LoadData(); KGLOG_PROCESS_ERROR(bRetCode); bResult = true; Exit0: return bResult; }
BOOL DiskEditDialog::PreTranslateMessage(MSG* pMsg) { if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN) { //LOGI("RETURN!"); LoadData(); return TRUE; } return CDialog::PreTranslateMessage(pMsg); }
BOOL CSettingGitConfig::OnInitDialog() { ISettingsPropPage::OnInitDialog(); m_cSafeCrLf.AddString(_T("")); m_cSafeCrLf.AddString(_T("false")); m_cSafeCrLf.AddString(_T("true")); m_cSafeCrLf.AddString(_T("warn")); AdjustControlSize(IDC_CHECK_AUTOCRLF); AdjustControlSize(IDC_CHECK_QUOTEPATH); AdjustControlSize(IDC_CHECK_INHERIT_NAME); AdjustControlSize(IDC_CHECK_INHERIT_EMAIL); AdjustControlSize(IDC_CHECK_INHERIT_KEYID); GITSETTINGS_ADJUSTCONTROLSIZE InitGitSettings(this, false, &m_tooltips); if (!m_bGlobal || m_bIsBareRepo) this->GetDlgItem(IDC_EDITLOCALGITCONFIG)->EnableWindow(TRUE); else this->GetDlgItem(IDC_EDITLOCALGITCONFIG)->EnableWindow(FALSE); if (m_bIsBareRepo) { this->GetDlgItem(IDC_EDITLOCALGITCONFIG)->SetWindowText(CString(MAKEINTRESOURCE(IDS_PROC_GITCONFIG_EDITLOCALGONCFIG))); this->GetDlgItem(IDC_EDITTGITCONFIG)->SetWindowText(CString(MAKEINTRESOURCE(IDS_PROC_GITCONFIG_VIEWTGITCONFIG))); } if (!CAppUtils::IsAdminLogin()) { ((CButton *)this->GetDlgItem(IDC_EDITSYSTEMGITCONFIG))->SetShield(TRUE); this->GetDlgItem(IDC_VIEWSYSTEMGITCONFIG)->ShowWindow(SW_SHOW); } if (PathIsDirectory(g_Git.GetGitGlobalXDGConfigPath())) this->GetDlgItem(IDC_EDITGLOBALXDGGITCONFIG)->ShowWindow(SW_SHOW); this->UpdateData(FALSE); if (m_UserName.IsEmpty() && m_UserEmail.IsEmpty()) { // preselect "global" and remove check in "inherit" checkboxes if no username and email are set on first open m_iConfigSource = CFG_SRC_GLOBAL; CheckRadioButton(IDC_RADIO_SETTINGS_EFFECTIVE, IDC_RADIO_SETTINGS_SYSTEM, IDC_RADIO_SETTINGS_EFFECTIVE + m_iConfigSource); m_cSaveTo.SelectString(0, CString(MAKEINTRESOURCE(IDS_CONFIG_GLOBAL))); LoadData(); m_bInheritUserName = FALSE; m_bInheritEmail = FALSE; EnDisableControls(); } return TRUE; }
void MultiversoSkipGramMixture::TrainNeuralNetwork() { std::queue<DataBlock*>datablock_queue; int data_block_count = 0; multiverso::Multiverso::BeginTrain(); for (int curr_epoch = 0; curr_epoch < m_option->epoch; ++curr_epoch) { m_reader->Open(m_option->train_file); while (1) { ++data_block_count; DataBlock *data_block = new (std::nothrow)DataBlock(); assert(data_block != nullptr); clock_t start = clock(); LoadData(data_block, m_reader, m_option->data_block_size); if (data_block->Size() <= 0) { delete data_block; break; } multiverso::Log::Info("Rank%d Load%d^thDataBlockTime:%lfs\n", m_process_id, data_block_count, (clock() - start) / (double)CLOCKS_PER_SEC); multiverso::Multiverso::BeginClock(); PushDataBlock(datablock_queue, data_block); multiverso::Multiverso::EndClock(); } m_reader->Close(); multiverso::Multiverso::BeginClock(); DataBlock *output_data_block = new DataBlock(); //Add a special data_block for dumping model files output_data_block->AddTable(kInputEmbeddingTableId); output_data_block->AddTable(kEmbeddingOutputTableId); output_data_block->AddTable(kWordSensePriorTableId); output_data_block->SetEpochId(curr_epoch); ++data_block_count; multiverso::Multiverso::PushDataBlock(output_data_block); multiverso::Multiverso::EndClock(); } multiverso::Log::Info("Rank %d pushed %d blocks\n", multiverso::Multiverso::ProcessRank(), data_block_count); multiverso::Multiverso::EndTrain(); //After EndTrain, all the datablock are done, //we remove all the datablocks RemoveDoneDataBlock(datablock_queue); }
bool RSSEditor::Create(void) { QMutexLocker locker(&m_lock); // Load the theme for this screen bool foundtheme = LoadWindowFromXML("netvision-ui.xml", "rsseditor", this); if (!foundtheme) return false; bool err = false; UIUtilE::Assign(this, m_sites, "sites", &err); UIUtilE::Assign(this, m_new, "new", &err); UIUtilE::Assign(this, m_delete, "delete", &err); UIUtilE::Assign(this, m_edit, "edit", &err); UIUtilW::Assign(this, m_image, "preview"); UIUtilW::Assign(this, m_title, "title"); UIUtilW::Assign(this, m_desc, "description"); UIUtilW::Assign(this, m_url, "url"); UIUtilW::Assign(this, m_author, "author"); if (err) { LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'rsseditor'"); return false; } connect(m_sites, SIGNAL(itemClicked(MythUIButtonListItem*)), this, SLOT(SlotEditSite(void))); connect(m_delete, SIGNAL(Clicked(void)), SLOT(SlotDeleteSite(void))); connect(m_edit, SIGNAL(Clicked(void)), SLOT(SlotEditSite(void))); connect(m_new, SIGNAL(Clicked(void)), SLOT(SlotNewSite(void))); connect(m_sites, SIGNAL(itemSelected(MythUIButtonListItem *)), SLOT(SlotItemChanged(void))); BuildFocusList(); LoadData(); if (m_sites->GetCount() == 0) SetFocusWidget(m_new); else SlotItemChanged(); return true; }
void TextureManager::ReloadAssets() { const ResourcePool<Texture>::Iterator end = resPool->End(); for(ResourcePool<Texture>::Iterator iter = resPool->Begin(); iter != end; ++iter) { Texture *tex = iter.Ptr(); Rid rid = tex->rid; if(rid != RID_NONE) { tex->~Texture(); new(tex) Texture(); LoadData(tex, rid); } } }
void CItemCommerceSearchView::OnBnClickedCancel() { // TODO: 在此添加控件通知处理程序代码 UpdateData(TRUE); LoadData(); LoadDisplay(); m_iTotalCount = 0; m_bSearch = FALSE; if(m_pResult->State == adStateOpen) m_pResult->Close(); UpdateData(FALSE); }
void Asset::Load(UID id) { if (!o2Assets.IsAssetExist(id)) { GetAssetsLogStream()->Error("Failed to load asset by id (" + (String)id + "): asset isn't exist"); return; } mMeta->mId = id; mPath = o2Assets.GetAssetPath(id); LoadMeta(GetMetaFullPath()); LoadData(GetDataFullPath()); }
void ConfigFile::Remove(CTSTR lpSection, CTSTR lpKey) { assert(lpSection); assert(lpKey); TSTR lpTemp = lpFileData, lpEnd = &lpFileData[dwLength], lpSectionStart; DWORD dwSectionNameSize = slen(lpSection), dwKeyNameSize = slen(lpKey); BOOL bInSection = 0; do { lpTemp = sstr(lpTemp, TEXT("\n[")); if(!lpTemp) break; lpTemp += 2; if((scmpi_n(lpTemp, lpSection, dwSectionNameSize) == 0) && (lpTemp[dwSectionNameSize] == ']')) { bInSection = 1; lpSectionStart = lpTemp = schr(lpTemp, '\n')+1; break; } }while(lpTemp < lpEnd); if(!bInSection) return; //not possible, usually. do { if(*lpTemp == '[') return; else if(bInSection && (*(LPWORD)lpTemp != '//')) { if((scmpi_n(lpTemp, lpKey, dwKeyNameSize) == 0) && (lpTemp[dwKeyNameSize] == '=')) { TSTR lpNextLine = schr(lpTemp, '\n')+1; XFile file(strFileName, XFILE_WRITE, XFILE_CREATEALWAYS); file.Write("\xEF\xBB\xBF", 3); file.WriteAsUTF8(&lpFileData[2], DWORD(lpTemp-lpFileData-2)); file.WriteAsUTF8(lpNextLine, slen(lpNextLine)-2); file.Close(); if(LoadFile(XFILE_OPENEXISTING)) LoadData(); return; } } lpTemp = schr(lpTemp, '\n')+1; }while(lpTemp < lpEnd); }
BOOL CSetProgsAdvDlg::OnInitDialog() { CResizableStandAloneDialog::OnInitDialog(); ExtendFrameIntoClientArea(IDC_GROUP); m_aeroControls.SubclassOkCancel(this); m_ToolListCtrl.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER); m_ToolListCtrl.DeleteAllItems(); int c = ((CHeaderCtrl*)(m_ToolListCtrl.GetDlgItem(0)))->GetItemCount()-1; while (c>=0) m_ToolListCtrl.DeleteColumn(c--); SetWindowTheme(m_ToolListCtrl.GetSafeHwnd(), L"Explorer", NULL); CString temp; temp.LoadString(IDS_PROGS_EXTCOL); m_ToolListCtrl.InsertColumn(0, temp); temp.LoadString(IDS_PROGS_TOOLCOL); m_ToolListCtrl.InsertColumn(1, temp); m_ToolListCtrl.SetRedraw(FALSE); int mincol = 0; int maxcol = ((CHeaderCtrl*)(m_ToolListCtrl.GetDlgItem(0)))->GetItemCount()-1; int col; for (col = mincol; col <= maxcol; col++) { m_ToolListCtrl.SetColumnWidth(col,LVSCW_AUTOSIZE_USEHEADER); } m_ToolListCtrl.SetRedraw(TRUE); temp.LoadString(m_sType == L"Diff" ? IDS_DLGTITLE_ADV_DIFF : IDS_DLGTITLE_ADV_MERGE); SetWindowText(temp); LoadData(); UpdateData(FALSE); EnableBtns(); AddAnchor(IDC_GROUP, TOP_LEFT, BOTTOM_RIGHT); AddAnchor(IDC_TOOLLISTCTRL, TOP_LEFT, BOTTOM_RIGHT); AddAnchor(IDC_ADDTOOL, BOTTOM_LEFT); AddAnchor(IDC_EDITTOOL, BOTTOM_LEFT); AddAnchor(IDC_REMOVETOOL, BOTTOM_LEFT); AddAnchor(IDC_RESTOREDEFAULTS, BOTTOM_LEFT); AddAnchor(IDOK, BOTTOM_RIGHT); AddAnchor(IDCANCEL, BOTTOM_RIGHT); return TRUE; }
double NoiseEstimator::estimate(Reads& treads, Reads& creads) { vector<chr_t> chroms; size_t chromNum; double l1Ratio = 1; double l2Ratio = 1; LoadData(chroms, treads, creads, chromNum); SortAndDedup(chroms); initializeSrandUsingCurrentTime(); mNR.setFragmentSize(mFragSize); return mNR.ComputeNoiseRate(chroms, chromNum, l1Ratio, l2Ratio); }
void ECHARM_process_bethe_bloch_tables::DoOnParticle(ECHARM_strip* strip,ECHARM_particle* part,ECHARM_info_save*){ fEnergyLossEld = 0; float energy = part->GetMom()->GetModule(); int index = -1; if(fValueMap_dEdX_eld.empty()==true){ std::cout << "Value Not Found" << std::endl; LoadData(strip); } if(fValueMap_dEdX_eld.empty()!=true){ auto it = std::find(fValueMap_dE.begin(), fValueMap_dE.end(), energy); if (it == fValueMap_dE.end()){ auto upper = std::upper_bound(fValueMap_dE.begin(), fValueMap_dE.end(), energy); index = upper - fValueMap_dE.begin(); float y0 = fValueMap_dEdX_nud[index-1]; float y1 = fValueMap_dEdX_nud[index]; float x0 = fValueMap_dE[index-1]; float x1 = fValueMap_dE[index]; fEnergyLossNud = y0 + (energy - x0)/(x1 - x0)*(y1-y0); y0 = fValueMap_dEdX_eld[index-1]; y1 = fValueMap_dEdX_eld[index]; fEnergyLossEld = y0 + (energy - x0)/(x1 - x0)*(y1-y0); } else{ index = (it - fValueMap_dE.begin()); fEnergyLossNud = fValueMap_dEdX_nud[index]; fEnergyLossEld = fValueMap_dEdX_eld[index]; } } else{ return; } float loss = (fEnergyLossEld * ComputeAvgElD(strip,part)) + (fEnergyLossNud * ComputeAvgAtD(strip,part)); loss *= part->GetStepLength(); double vMomVar = energy - loss; if(vMomVar < 0.) vMomVar = 0.; part->GetMom()->ScaleModule(vMomVar); }
void Asset::Load() { if (mMeta->mId == 0) mMeta->mId = o2Assets.GetAssetId(mPath); if (mMeta->mId == 0 || !o2Assets.IsAssetExist(mMeta->mId)) { GetAssetsLogStream()->Error("Failed to load asset (" + mPath + " - " + (String)mMeta->mId + "): isn't exist"); return; } LoadMeta(GetMetaFullPath()); LoadData(GetDataFullPath()); }
void Asset::Load(const String& path) { mPath = path; mMeta->mId = o2Assets.GetAssetId(path); if (mMeta->mId == 0) { GetAssetsLogStream()->Error("Failed to load asset by path (" + mPath + "): asset isn't exist"); return; } LoadMeta(GetMetaFullPath()); LoadData(GetDataFullPath()); }