void OTHER_VALUE_STREAM_CLASS::Initialise() // DESCRIPTION : Initialise the base class. // PRECONDITIONS : // POSTCONDITIONS : // EXCEPTIONS : // NOTES : //<<=========================================================================== { // constructor activities file_versionM = OV_HEADER_VERSION3; data_sourceM = GENERATE; SetLogger(NULL); bits_allocatedM = 0; lengthM = 0; file_offsetM = 0; length_offsetM = 0; rowsM = 0; columnsM = 0; start_valueM = 0; rows_incrementM = 0; columns_incrementM = 0; rows_sameM = 0; columns_sameM = 0; UID_CLASS transfer_syntax = IMPLICIT_VR_LITTLE_ENDIAN; SetMemoryTransferSyntax(transfer_syntax); SetFileTransferSyntax(transfer_syntax); }
int main(int argc, char *argv[]) { QApplication a(argc, argv); QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8")); QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8")); //设置日志接口 QFileLogger::InitLog(); SetLogger(new QFileLogger); QFile styleSheet("./../qssfiles/style.qss"); if(!styleSheet.open(QIODevice::ReadOnly)) { qWarning("style sheet load fail!"); QMessageBox::warning(NULL, QObject::tr("警告"), QObject::tr("布局文件打开失败,页面无法正常布局")); } a.setStyleSheet(styleSheet.readAll()); setGlobalValue(Maintain::LaneIp, "192.168.26.219"); setGlobalValue(Maintain::LanePassword, "1q2w3e"); setGlobalValue(Maintain::LaneUser, "root"); AutoUpdate updateSoftware; if(!updateSoftware.softWareUpdate()) { int code=QMessageBox::warning(NULL,QObject::tr("软件更新"),QObject::tr("软件更新失败:%1") .arg(updateSoftware.getErrorMessage()),QMessageBox::Ok); if(code==QMessageBox::Ok) return -1; } FormMain w; LogMsg("RSU",QObject::tr("12skl;ghsirhgpuisrhgiuhipaeru")); w.show(); return a.exec(); }
void FieldTest::testConstructorRightResults() { HTMLLogger Logger; Logger.Init("log.html","MainLog"); SetLogger(&Logger); // Простая маленькая корректно сформированная карта, содержащая все типы символов. const char* pathToMap = "tests/res/testmaps/OrdinaryCorrectMap"; Field field(pathToMap); /* * Сравнение того, * как карта считалась в объект с теми символами, * которые мы сами считываем из файла. */ // Проверяем, что совпадают размеры int curLen; // Длина считываемой строки int maxLen = 0; int numOfLines = 0; std::ifstream mapFile(pathToMap); std::string line; while(std::getline(mapFile, line)) { // Нахождение размера по X // Поиск максимальной длины curLen = line.length(); if(curLen > maxLen) { maxLen = curLen; } // Поэлементное сравнение считанной карты и файла std::string::iterator itr = line.begin(); std::string::iterator endItr = line.end(); int i = 0; for(; itr != endItr; itr++) { CPPUNIT_ASSERT( *itr == field.getXY(i++, numOfLines) ); } // Нахождение размера по Y numOfLines++; } std::pair<int, int> fieldSize = field.getSize(); CPPUNIT_ASSERT(fieldSize.first == maxLen); CPPUNIT_ASSERT(fieldSize.second == numOfLines); }
TEST_F(CheckpointTests, CheckpointScanTest) { logging::LoggingUtil::RemoveDirectory("pl_checkpoint", false); auto &txn_manager = concurrency::TransactionManagerFactory::GetInstance(); txn_manager.BeginTransaction(); // Create a table and wrap it in logical tile size_t tile_group_size = TESTS_TUPLES_PER_TILEGROUP; size_t table_tile_group_count = 3; // table has 3 tile groups std::unique_ptr<storage::DataTable> target_table( ExecutorTestsUtil::CreateTable(tile_group_size)); ExecutorTestsUtil::PopulateTable(target_table.get(), tile_group_size * table_tile_group_count, false, false, false); txn_manager.CommitTransaction(); auto cid = txn_manager.GetNextCommitId() - 1; LOG_INFO("Scan with cid = %d. MaxCommittedCid = %d", (int) cid, (int) txn_manager.GetMaxCommittedCid()); auto schema = target_table->GetSchema(); std::vector<oid_t> column_ids; column_ids.resize(schema->GetColumnCount()); std::iota(column_ids.begin(), column_ids.end(), 0); // create checkpoint auto &checkpoint_manager = logging::CheckpointManager::GetInstance(); checkpoint_manager.Configure(CHECKPOINT_TYPE_NORMAL, true, 1); checkpoint_manager.DestroyCheckpointers(); checkpoint_manager.InitCheckpointers(); auto checkpointer = checkpoint_manager.GetCheckpointer(0); auto simple_checkpointer = reinterpret_cast<logging::SimpleCheckpoint *>(checkpointer); simple_checkpointer->SetLogger(new logging::WriteAheadBackendLogger()); simple_checkpointer->SetStartCommitId(cid); simple_checkpointer->Scan(target_table.get(), DEFAULT_DB_ID); // verify results auto records = simple_checkpointer->GetRecords(); EXPECT_EQ(records.size(), TESTS_TUPLES_PER_TILEGROUP * table_tile_group_count); for (unsigned int i = 0; i < records.size(); i++) { EXPECT_EQ(records[i]->GetType(), LOGRECORD_TYPE_WAL_TUPLE_INSERT); } }
void iAFoamCharacterizationItemBinarization::executeBinarization() { iAConnector con; con.SetImage(m_pImageData); QScopedPointer<iAProgress> pObserver(new iAProgress()); connect(pObserver.data(), SIGNAL(pprogress(const int&)), this, SLOT(slotObserver(const int&))); auto filter = iAFilterRegistry::Filter("Binary Thresholding"); filter->SetLogger(iAConsoleLogger::Get()); filter->SetProgress(pObserver.data()); filter->AddInput(&con); QMap<QString, QVariant> parameters; parameters["Lower threshold"] = m_usLowerThreshold; parameters["Upper threshold"] = m_usUpperThreshold; parameters["Inside value"] = 0; parameters["Outside value"] = 1; filter->Run(parameters); m_pImageData->DeepCopy(filter->Output()[0]->GetVTKImage()); m_pImageData->CopyInformationFromPipeline(filter->Output()[0]->GetVTKImage()->GetInformation()); }
void iAFoamCharacterizationItemBinarization::executeOtzu() { iAConnector con; con.SetImage(m_pImageData); QScopedPointer<iAProgress> pObserver(new iAProgress()); connect(pObserver.data(), SIGNAL(progress(const int&)), this, SLOT(slotObserver(const int&))); auto filter = iAFilterRegistry::Filter("Otsu Threshold"); filter->SetLogger(iAConsoleLogger::Get()); filter->SetProgress(pObserver.data()); filter->AddInput(&con); QMap<QString, QVariant> parameters; parameters["Remove peaks"] = false; parameters["Number of histogram bins"] = m_uiOtzuHistogramBins; parameters["Outside value"] = 1; parameters["Inside value"] = 0; filter->Run(parameters); m_pImageData->DeepCopy(filter->Output()[0]->GetVTKImage()); m_pImageData->CopyInformationFromPipeline(filter->Output()[0]->GetVTKImage()->GetInformation()); }
CGPIBDevice::CGPIBDevice(CLogger *p) { SetLogger(p); m_strLogHeader = _T(" [GPIB] "); m_nDev = -1; m_hGPIBDLL = NULL; m_Pibsta = NULL; m_Piberr = NULL; m_Pibcntl = NULL; ibdev = NULL; ibln = NULL; ibwrt = NULL; ibrd = NULL; ibrsp = NULL; ibonl = NULL; ibeos = NULL; ibeot = NULL; ibtmo = NULL; ibppc = NULL; ibpad = NULL; ibsad = NULL; ibrpp = NULL; ibwait = NULL; ibloc = NULL; ibpct = NULL; ibtrg = NULL; ibclr = NULL; ibconfig = NULL; ibask = NULL; ibcac = NULL; FindLstn = NULL; ibfind = NULL; ibsic = NULL; Log(_T("GPIB driver created")); }
static void OnWindowCreate(HWND hWnd){ RECT rc; HWND hEdit; // create edit for logger hEdit = CreateWindowEx(0, _T("EDIT"), NULL, WS_CHILD|WS_VISIBLE|WS_VSCROLL|WS_BORDER |ES_LEFT|ES_MULTILINE|ES_AUTOVSCROLL|ES_READONLY, 520, 0, 480, 450, hWnd, NULL, NULL, NULL); if(hEdit != NULL){ SetLogger(hEdit); SendMessage(hEdit, WM_SETTEXT, 0, (LPARAM)_T("..........emulator.......\r\n")); } // create buttons rc.top = 30; rc.bottom = 60; rc.left = 280; rc.right = 380; CreateButton(hWnd, _T("Enter"), rc, EMULATOR_BUTTON_ENTER); rc.top = 70; rc.bottom = 100; CreateButton(hWnd, _T("Escape"), rc, EMULATOR_BUTTON_ESCAPE); rc.top = 30; rc.bottom = 60; rc.left = 390; rc.right = 490; CreateButton(hWnd, _T("Up"), rc, EMULATOR_BUTTON_UP); rc.top = 70; rc.bottom = 100; CreateButton(hWnd, _T("Down"), rc, EMULATOR_BUTTON_DOWN); rc.top = 190; rc.bottom = 220; rc.left = 280; rc.right = 380; CreateButton(hWnd, _T("EnterUp"), rc, EMULATOR_BUTTON_ENTERUP); rc.top = 230; rc.bottom = 260; CreateButton(hWnd, _T("EnterDown"), rc, EMULATOR_BUTTON_ENTERDOWN); rc.top = 190; rc.bottom = 220; rc.left = 390; rc.right = 490; CreateButton(hWnd, _T("EscUp"), rc, EMULATOR_BUTTON_ESCAPEUP); rc.top = 230; rc.bottom = 260; CreateButton(hWnd, _T("EscDown"), rc, EMULATOR_BUTTON_ESCAPEDOWN); rc.top = 360; rc.bottom = 390; rc.left = 280; rc.right = 380; CreateButton(hWnd, _T("Message"), rc, EMULATOR_BUTTON_MESSAGE); rc.left = 390; rc.right = 490; CreateButton(hWnd, _T("Call"), rc, EMULATOR_BUTTON_CALL); return ; }
void Log::Uninitialize() { SetLogger(nullptr); }
bool Log::Initialize() { SetLogger(new FileLogger()); return true; }