BEGIN_UGEN_NAMESPACE #include "ugen_BrownNoise.h" BrownNoiseUGenInternal::BrownNoiseUGenInternal() throw() : UGenInternal(NoInputs), //random((unsigned int)this * 123463463UL + 423815L + rand(455563)), random(rand(0x7fffffff)), currentValue(random.nextBiFloat()) { initValue(currentValue); }
BEGIN_UGEN_NAMESPACE #include "ugen_Impulse.h" ImpulseUGenInternal::ImpulseUGenInternal(Impulse_InputsWithTypesOnly) throw() : UGenInternal(NumInputs), currentPhase(1.f) { inputs[Freq] = freq; initValue(1.f); }
BEGIN_UGEN_NAMESPACE #include "ugen_TableOsc.h" #include "../../core/ugen_Constants.h" TableOscUGenInternal::TableOscUGenInternal(UGen const& freq, const float initialPhase, Buffer const& table) throw() : UGenInternal(NumInputs), table_(table), wavetableSize(table_.size()), wavetable(table_.getData(0)), currentPhase((initialPhase < 0.f) || (initialPhase >= 1.f) ? 0.f : initialPhase * wavetableSize) { ugen_assert(initialPhase >= 0.f && initialPhase <= 1.f); inputs[Freq] = freq; initValue(lookupIndex(currentPhase)); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); initWidget(); initTableView(); readAndSetStyleSheet(); this->setWindowIcon(QIcon(":/Resources/img/logo.ico")); timer = NULL; retSize = ""; startValue = true; timer = new QTimer(this); _sql = new MysqlQuery(); _sql->openMysql(DATABASE_NAME); exePath = QCoreApplication::applicationDirPath(); QString imagePath = exePath; logPath = exePath; logPath.append("/yqclog.log"); imagePath.append("/image/" ); QDir dir(imagePath); if(!dir.exists()) dir.mkpath(imagePath); initValue(); // connect(timer, &QTimer::timeout, this, &MainWindow::timeOver); _instance = new VlcInstance(VlcCommon::args(), this); _player = new VlcMediaPlayer(_instance); _player->setVideoWidget(ui->widget_mp4Video); ui->widget_mp4Video->setMediaPlayer(_player); ui->widget_mp4Volume->setMediaPlayer(_player); ui->widget_mp4Volume->setVolume(50); ui->widget_mp4Seek->setMediaPlayer(_player); ui->pushButton_stop->setEnabled(false); }
LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { // set icons HICON hIcon = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON)); SetIcon(hIcon, TRUE); HICON hIconSmall = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON)); SetIcon(hIconSmall, FALSE); // register object for message filtering and idle updates CMessageLoop* pLoop = _Module.GetMessageLoop(); ATLASSERT(pLoop != NULL); pLoop->AddMessageFilter(this); pLoop->AddIdleHandler(this); UIAddChildWindowContainer(m_hWnd); initValue(); LoadSetting(); InitDB(); initPreviewDlg(); initDH(); initBottomButton(); initTimeLabel(); initSlide(); initCradleButton(); //默认选中channel 0 FocusChannel(0); //默认布局 SetPreviewDlgLayout(PREVIEWLAYOUT4,0); //计时器 时钟 SetTimer(1,1000); //录像 SetTimer(2,1000); SetWindowPos(NULL,0,0,1000,700,SWP_SHOWWINDOW); CenterWindow(); RegisterStreamDirectReadCallback(StreamDirectReadCallback, this); updateSetting(); return TRUE; }
BEGIN_UGEN_NAMESPACE #include "ugen_EnvGen.h" #include "../basics/ugen_InlineUnaryOps.h" #include "../basics/ugen_InlineBinaryOps.h" #include "../core/ugen_Constants.h" EnvGenUGenInternal::EnvGenUGenInternal(Env const& env, const UGen::DoneAction doneAction) throw() : ReleasableUGenInternal(0), env_(env), doneAction_(doneAction), currentValue(0.0), stepsUntilTarget(0), shouldDeleteValue(doneAction_ == UGen::DeleteWhenDone) { currentValue = env_.getLevels().getSampleUnchecked(0); setSegment(0, UGen::getSampleRate()); initValue(currentValue); }
BEGIN_UGEN_NAMESPACE #include "ugen_Lines.h" #include "ugen_EnvGen.h" #include "../basics/ugen_Thru.h" //=============================== LLine ====================================== LLineUGenInternal::LLineUGenInternal(const float start, const float end, const float duration, const UGen::DoneAction doneAction) throw() : UGenInternal(0), start_(start), end_(end), duration_(duration), currentValue(start_), increment((end - start) * UGen::getReciprocalSampleRate() / duration), doneAction_(doneAction), shouldDeleteValue(doneAction_ == UGen::DeleteWhenDone) { // assert if duration is negative? initValue(currentValue); }
IDiaSourceFilePtrInterpreter<EncodingT>::IDiaSourceFilePtrInterpreter(const IDiaSourceFilePtr& object) { initValue(object); }
Field::Field(std::string name, unsigned short length): myLength(length), myValue(0), myActive(false) { initValue(); }
void IDiaEnumLineNumbersPtrInterpreter<EncodingT>::setValue(IDiaEnumLineNumbersPtr const& object) { tidyValue(); initValue(object); }
IDiaEnumLineNumbersPtrInterpreter<EncodingT>::IDiaEnumLineNumbersPtrInterpreter(const IDiaEnumLineNumbersPtrInterpreter<EncodingT>& rhs) { initValue(rhs.value()); }
void HistogramOpenCV::setWeightHistImage(int w){ weightHistImage=w; initValue(); }
void HistogramOpenCV::setBinCount(int bin){ grayBins=bin; initValue(); }
DEBUG_VALUEInterpreter<EncodingT>::DEBUG_VALUEInterpreter(const DEBUG_VALUE& object) { initValue(object); }
IDiaSourceFilePtrInterpreter<EncodingT>::IDiaSourceFilePtrInterpreter(const IDiaSourceFilePtrInterpreter<EncodingT>& rhs) { initValue(rhs.value()); }
void DEBUG_VALUEInterpreter<EncodingT>::setValue(DEBUG_VALUE const& object) { tidyValue(); initValue(object); }
DEBUG_VALUEInterpreter<EncodingT>::DEBUG_VALUEInterpreter(const DEBUG_VALUEInterpreter<EncodingT>& rhs) { initValue(rhs.value()); }
void IDiaSourceFilePtrInterpreter<EncodingT>::setValue(IDiaSourceFilePtr const& object) { tidyValue(); initValue(object); }
QProg::QProg(QWidget *parent) : QWidget(parent) { initValue(); }
HistogramOpenCV::HistogramOpenCV() { initValue(); }
JNIEXPORT jint JNICALL Java_org_secmem_remoteroid_universal_natives_FrameHandlerU_getFrameBuffer (JNIEnv * env, jobject thiz, jbyteArray jByte, jint pixelformat){ int i,j,k; int Dst; int ret; unsigned char *pFrame, *buf; int *intbuf, *intpFrame0, *intpFrame1; // uint16_t *int16_buf; if(disinfo.initialized == false){ int i; i = initValue(pixelformat); if(i>=0){ return i; } } else { fd = open("/dev/graphics/fb0", O_RDONLY); if(fd<0) { return FB_FAIL; } } pFrame = (unsigned char *)mmap(0,finfo.smem_len, PROT_READ, MAP_PRIVATE, fd,0); if(pFrame == MAP_FAILED){ close(fd); return MMAP_FAIL; } intpFrame0 = (int *) pFrame; intpFrame1 = (int *) (pFrame+finfo.smem_len/2); buf = (unsigned char *) malloc(disinfo.fullbyte); intbuf = (int *) buf; if(disinfo.pixelFormat == PIXEL_UNKNOWN) return FORMAT_UNKNOWN; else if(disinfo.pixelFormat == PIXEL_ARGB_8888){ for(i=0; i<disinfo.height; i++){ for(j=0; j<disinfo.width; j++){ k = *(intpFrame0+(i*disinfo.width*4)+(j*2)); *(intbuf+(i*disinfo.width)+j) = k; } } } else if(disinfo.pixelFormat == PIXEL_XBGR_8888){ for(i=0; i<disinfo.height; i++){ for(j=0; j<disinfo.width; j++){ k = *(intpFrame0+(i*disinfo.width*4)+(j*2)); Dst = k & 0xff00ff00; Dst += (k & 0x00ff0000) >> 16; Dst += (k & 0x000000ff) << 16; *(intbuf+(i*disinfo.width)+j) = Dst; } } } else{ return FORMAT_VALUE_FAIL;
void HistogramOpenCV::setHeightHistImage(int h){ heightHistImage=h; initValue(); }
/* ---------------------------------------------------------------------------------------------------- *\ isIncKeepLastReachability(): If the last result is unsat, put the inductive invariant into the last frame. isIncContinueOnLastSolver(): Reset the solver. \* ---------------------------------------------------------------------------------------------------- */ void V3VrfMPDR::startVerify(const uint32_t& p) { vrfRestart: // Check Shared Results if (_sharedBound && V3NtkUD == _sharedBound->getBound(p)) return; // Clear Verification Results clearResult(p); if (profileON()) _totalStat->start(); // Consistency Check consistencyCheck(); assert (!_constr.size()); if (!reportUnsupportedInitialState()) return; // Initialize Backup Frames for (uint32_t i = 0; i < _pdrBackup.size(); ++i) delete _pdrBackup[i]; _pdrBackup.clear(); if (_pdrFrame.size()) { if (isIncKeepLastReachability()) { // Backup frames in the order: ..., 2, 1, INF assert (_pdrFrame.size() > 1); _pdrBackup.reserve(_pdrFrame.size() - 1); for (uint32_t i = _pdrFrame.size() - 2; i > 0; --i) _pdrBackup.push_back(_pdrFrame[i]); _pdrBackup.push_back(_pdrFrame.back()); delete _pdrFrame[0]; } else { for (uint32_t i = 0; i < _pdrFrame.size(); ++i) delete _pdrFrame[i]; } _pdrFrame.clear(); } // Initialize Other Members if (!isIncKeepLastReachability()) _pdrPriority.clear(); _pdrActCount = 0; if (_pdrBad) delete _pdrBad; _pdrBad = 0; if (_pdrGen) delete _pdrGen; _pdrGen = 0; if (dynamic_cast<V3BvNtk*>(_vrfNtk)) { _pdrGen = new V3AlgBvGeneralize(_handler); assert (_pdrGen); _pdrSim = dynamic_cast<V3AlgBvSimulate*>(_pdrGen); assert (_pdrSim); } else { _pdrGen = new V3AlgAigGeneralize(_handler); assert (_pdrGen); _pdrSim = dynamic_cast<V3AlgAigSimulate*>(_pdrGen); assert (_pdrSim); } V3NetVec simTargets(1, _vrfNtk->getOutput(p)); _pdrSim->reset(simTargets); // Initialize Pattern Input Size assert (p < _result.size()); assert (p < _vrfNtk->getOutputSize()); const V3NetId& pId = _vrfNtk->getOutput(p); assert (V3NetUD != pId); _pdrSize = _vrfNtk->getInputSize() + _vrfNtk->getInoutSize(); // Initialize Parameters const string flushSpace = string(100, ' '); uint32_t proved = V3NtkUD, fired = V3NtkUD; struct timeval inittime, curtime; gettimeofday(&inittime, NULL); // Initialize Signal Priority List if (_pdrPriority.size() != _vrfNtk->getLatchSize()) _pdrPriority.resize(_vrfNtk->getLatchSize(), 0); // Initialize Solver if (_pdrSvr && !isIncContinueOnLastSolver()) { delete _pdrSvr; _pdrSvr = 0; } initializeSolver(); // Initialize Bad Cube _pdrBad = new V3MPDRCube(0); assert (_pdrBad); _pdrBad->setState(V3NetVec(1, pId)); // Initialize Frame 0 if (_vrfNtk->getLatchSize()) _pdrFrame.push_back(new V3MPDRFrame(_pdrSvr->setImplyInit())); // R0 = I0 else _pdrFrame.push_back(new V3MPDRFrame(_pdrSvr->reserveFormula())); assert (_pdrFrame.back()->getActivator()); assert (_pdrFrame.size() == 1); // Initialize Frame INF if (_pdrBackup.size()) { _pdrFrame.push_back(_pdrBackup.back()); _pdrBackup.pop_back(); addFrameInfoToSolver(1); } else _pdrFrame.push_back(new V3MPDRFrame(_pdrSvr->reserveFormula())); assert (_pdrFrame.back()->getActivator()); assert (_pdrFrame.size() == 2); // Check Shared Invariants if (_sharedInv) { V3NetTable sharedInv; _sharedInv->getInv(sharedInv); for (uint32_t i = 0; i < sharedInv.size(); ++i) { V3MPDRCube* const inv = new V3MPDRCube(0); assert (inv); inv->setState(sharedInv[i]); addBlockedCube(make_pair(getPDRFrame(), inv)); } } // Continue on the Last Depth while (_pdrBackup.size() && (getIncLastDepthToKeepGoing() > getPDRFrame())) { _pdrFrame.push_back(_pdrFrame.back()); // Keep frame INF the last frame _pdrFrame[_pdrFrame.size() - 2] = _pdrBackup.back(); _pdrBackup.pop_back(); addFrameInfoToSolver(_pdrFrame.size() - 2); } // Start PDR Based Verification V3MPDRCube* badCube = 0; while (true) { // Check Time Bounds gettimeofday(&curtime, NULL); if (_maxTime < getTimeUsed(inittime, curtime)) break; // Check Shared Results if (_sharedBound && (V3NtkUD == _sharedBound->getBound(p))) break; // Check Shared Networks if (_sharedNtk) { V3NtkHandler* const sharedNtk = _sharedNtk->getNtk(_handler); if (sharedNtk) { setIncKeepLastReachability(true); setIncContinueOnLastSolver(false); setIncLastDepthToKeepGoing(getPDRDepth()); _handler = sharedNtk; _vrfNtk = sharedNtk->getNtk(); goto vrfRestart; } } // Find a Bad Cube as Initial Proof Obligation badCube = getInitialObligation(); // SAT(R ^ T ^ !p) if (!badCube) { if (!isIncKeepSilent() && intactON()) { if (!endLineON()) Msg(MSG_IFO) << "\r" + flushSpace + "\r"; Msg(MSG_IFO) << setw(3) << left << getPDRDepth() << " :"; const uint32_t j = (_pdrFrame.size() > 25) ? _pdrFrame.size() - 25 : 0; if (j) Msg(MSG_IFO) << " ..."; for (uint32_t i = j; i < _pdrFrame.size(); ++i) Msg(MSG_IFO) << " " << _pdrFrame[i]->getCubeList().size(); if (svrInfoON()) { Msg(MSG_IFO) << " ("; _pdrSvr->printInfo(); Msg(MSG_IFO) << ")"; } Msg(MSG_IFO) << endl; // Always Endline At the End of Each Frame } if (_sharedBound) _sharedBound->updateBound(p, getPDRFrame()); // Push New Frame _pdrFrame.push_back(_pdrFrame.back()); // Renders F Infinity to be the last in _pdrFrame if (_pdrBackup.size()) { _pdrFrame[_pdrFrame.size() - 2] = _pdrBackup.back(); _pdrBackup.pop_back(); addFrameInfoToSolver(_pdrFrame.size() - 2); } else _pdrFrame[_pdrFrame.size() - 2] = new V3MPDRFrame(_pdrSvr->reserveFormula()); // New Frame if (propagateCubes()) { proved = getPDRDepth(); break; } if (_maxDepth <= (getPDRFrame() - 1)) break; } else { badCube = recursiveBlockCube(badCube); if (badCube) { fired = getPDRDepth(); break; } // Interactively Show the Number of Bad Cubes in Frames if (!isIncKeepSilent() && intactON()) { if (!endLineON()) Msg(MSG_IFO) << "\r" + flushSpace + "\r"; Msg(MSG_IFO) << setw(3) << left << getPDRDepth() << " :"; const uint32_t j = (_pdrFrame.size() > 25) ? _pdrFrame.size() - 25 : 0; if (j) Msg(MSG_IFO) << " ..."; for (uint32_t i = j; i < _pdrFrame.size(); ++i) Msg(MSG_IFO) << " " << _pdrFrame[i]->getCubeList().size(); if (svrInfoON()) { Msg(MSG_IFO) << " ("; _pdrSvr->printInfo(); Msg(MSG_IFO) << ")"; } if (endLineON()) Msg(MSG_IFO) << endl; else Msg(MSG_IFO) << flush; } } } // Report Verification Result if (!isIncKeepSilent() && reportON()) { if (intactON()) { if (endLineON()) Msg(MSG_IFO) << endl; else Msg(MSG_IFO) << "\r" << flushSpace << "\r"; } if (V3NtkUD != proved) Msg(MSG_IFO) << "Inductive Invariant found at depth = " << ++proved; else if (V3NtkUD != fired) Msg(MSG_IFO) << "Counter-example found at depth = " << ++fired; else Msg(MSG_IFO) << "UNDECIDED at depth = " << _maxDepth; if (usageON()) { gettimeofday(&curtime, NULL); Msg(MSG_IFO) << " (time = " << setprecision(5) << getTimeUsed(inittime, curtime) << " sec)" << endl; } if (profileON()) { _totalStat->end(); Msg(MSG_IFO) << *_initSvrStat << endl; Msg(MSG_IFO) << *_solveStat << endl; Msg(MSG_IFO) << *_generalStat << endl; Msg(MSG_IFO) << *_propagateStat << endl; Msg(MSG_IFO) << *_ternaryStat << endl; Msg(MSG_IFO) << *_totalStat << endl; } } // Record CounterExample Trace or Invariant if (V3NtkUD != fired) { // Record Counter-Example // Compute PatternCount const V3MPDRCube* traceCube = badCube; assert (traceCube); assert (existInitial(traceCube->getState())); uint32_t patternCount = 0; while (_pdrBad != traceCube) { traceCube = traceCube->getNextCube(); ++patternCount; } V3CexTrace* const cex = new V3CexTrace(patternCount); assert (cex); _result[p].setCexTrace(cex); assert (_result[p].isCex()); // Set Pattern Value traceCube = badCube; assert (traceCube); assert (existInitial(traceCube->getState())); while (_pdrBad != traceCube) { if (_pdrSize) cex->pushData(traceCube->getInputData()); traceCube = traceCube->getNextCube(); assert (traceCube); } // Set Initial State Value if (_pdrInitValue.size()) { V3BitVecX initValue(_pdrInitValue.size()); for (uint32_t i = 0; i < badCube->getState().size(); ++i) { assert (initValue.size() > badCube->getState()[i].id); if (badCube->getState()[i].cp) initValue.set0(badCube->getState()[i].id); else initValue.set1(badCube->getState()[i].id); } for (uint32_t i = 0; i < _pdrInitValue.size(); ++i) if (_pdrInitConst[i]) { if (_pdrInitValue[i]) initValue.set0(i); else initValue.set1(i); } cex->setInit(initValue); } // Delete Cubes on the Trace const V3MPDRCube* lastCube; traceCube = badCube; while (_pdrBad != traceCube) { lastCube = traceCube->getNextCube(); delete traceCube; traceCube = lastCube; } // Check Common Results if (isIncVerifyUsingCurResult()) checkCommonCounterexample(p, *cex); } else if (V3NtkUD != proved) { // Record Inductive Invariant _result[p].setIndInv(_vrfNtk); assert (_result[p].isInv()); // Put the Inductive Invariant to Frame INF uint32_t f = 1; for (; f < getPDRDepth(); ++f) if (!_pdrFrame[f]->getCubeList().size()) break; assert (f < getPDRDepth()); for (uint32_t i = 1 + f; i < getPDRFrame(); ++i) { const V3MPDRCubeList& cubeList = _pdrFrame[i]->getCubeList(); V3MPDRCubeList::const_iterator it; for (it = cubeList.begin(); it != cubeList.end(); ++it) addBlockedCube(make_pair(getPDRFrame(), *it)); _pdrFrame[i]->clearCubeList(); delete _pdrFrame[i]; } // Remove Empty Frames _pdrFrame.back()->removeSelfSubsumed(); _pdrFrame[f] = _pdrFrame.back(); while ((1 + f) != _pdrFrame.size()) _pdrFrame.pop_back(); // Check Common Results if (isIncVerifyUsingCurResult()) { const V3MPDRCubeList& invCubeList = _pdrFrame.back()->getCubeList(); V3NetTable invList; invList.clear(); invList.reserve(invCubeList.size()); for (V3MPDRCubeList::const_iterator it = invCubeList.begin(); it != invCubeList.end(); ++it) invList.push_back((*it)->getState()); checkCommonProof(p, invList, false); } } }
HistogramOpenCV::HistogramOpenCV(Mat gray){ grayFrame=gray; initValue(); }
IDiaEnumLineNumbersPtrInterpreter<EncodingT>::IDiaEnumLineNumbersPtrInterpreter(const IDiaEnumLineNumbersPtr& object) { initValue(object); }