当前位置: 首页>>代码示例>>C++>>正文


C++ Gate类代码示例

本文整理汇总了C++中Gate的典型用法代码示例。如果您正苦于以下问题:C++ Gate类的具体用法?C++ Gate怎么用?C++ Gate使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Gate类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: gate

void Circuit::dumpCircuit()
{
    cout<<endl;
    cout<<"  Gate Name\tGate Level"<<endl;
    cout<<"========================================="<<endl;
    for( unsigned i = 0; i< numGate(); ++i )
    {
        Gate g = gate( i );
        cout<< "  " << g.name() << '\t' ;
        cout<< g.level() << '\t' ;
        //cout<< bitset<32>( value[i] ) <<'\t';
        cout<< endl;
    }

    cout<<endl;
    cout<<"  WireID\tWire Name\tType    \tValue"<<endl;
    cout<<"======================================================================================="<<endl;
    for( unsigned j = 0; j< numWire(); ++j )
    {
        Wire w = wire( j );
        cout<< "  "<< j << "\t\t";
        cout<< w.name() << "\t\t";
        cout<< setiosflags(ios::left) << setw(8) << w.type() <<'\t';
        if( w.type() != "UNUSED" )
            cout<< bitset<32>( w.valueSet() )<<'\t';
        else
            cout<<"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"<<'\t';
        cout<<endl;
    }
}
开发者ID:bhb811340,项目名称:SoCV_fp,代码行数:30,代码来源:circuit.cpp

示例2: print_io

bool CirMgr::print_io(){
    cout << "========= PRINT_IO =========" << endl; 
    cout << "GATE:" << endl;
    for(size_t i=0 ; i<GateList[0].size() ; ++i){
        cout << "(" << i << ")";
        cout << " ID = " << GateList[0][i]->getId();
        cout << ", Type = " << GateList[0][i]->getType();
        cout << ", Fanin0 = " << GateList[0][i]->getFin0()->getId();
        if(GateList[0][i]->getFin1()!=0)
            cout << ", Fanin1 = " << GateList[0][i]->getFin1()->getId();
        cout << ", Fanout = " << GateList[0][i]->getFout()->getId();
        cout << endl;
    }

    cout << "WIRE: " << endl;
    for(size_t i=0 ; i<WireList[0].size() ; ++i){
        cout << "(" << i << ")";
        cout << " ID = " << WireList[0][i]->getId();
        if(WireList[0][i]->getFin()!=0){
            cout << ", Fanin = " << WireList[0][i]->getFin()->getId() << " (";
            Gate* gate = WireList[0][i]->getFin();
            cout << " " << gate->getFin0()->getId();
            if(gate->getFin1()!=0)
                cout << " " << gate->getFin1()->getId();
            cout << " )";
        }
        cout << endl;
    }
    cout << endl;
    return true;
}
开发者ID:jackie840129,项目名称:CAD2016,代码行数:31,代码来源:cirMgr.cpp

示例3: tracker_thunk

ACE_THR_FUNC_RETURN Gate::
tracker_thunk (void* arg)
{
  Gate* a = reinterpret_cast<Gate*> (arg);
  a->tracker ();
  return 0;
}
开发者ID:asdlei00,项目名称:ACE,代码行数:7,代码来源:Gate.cpp

示例4: CreateGate

static void CreateGate( int flag, const AcDbObjectId& host, const AcGePoint3d& pt, double angle )
{
    Gate* pGate;
    switch( flag )
    {
    case 1:
        pGate = new PermanentGate( pt, angle );  // 永久风门
        break;
    case 2:
        pGate = new TemporaryGate( pt, angle );  // 临时风门
        break;
    case 3:
        pGate = new DoubleGate( pt, angle );    // 双向风门
        break;

    case 4:
        pGate = new BalanceGate( pt, angle ); // 平衡风门
        break;

    default:
        pGate = 0;
    }

    if( pGate == 0 ) return;

    pGate->setRelatedGE( host );

    if( !ArxUtilHelper::PostToModelSpace( pGate ) ) delete pGate;
}
开发者ID:kanbang,项目名称:myexercise,代码行数:29,代码来源:DrawVent.cpp

示例5: FaultActivate

bool Atpg::FaultActivate() { // TODO: TDF support 
    Gate *fg = &cir_->gates_[current_fault_->gate_]; 
    int fline = current_fault_->line_; 

    if (fline) { // input stuck fault on GUT. 
        Value v = impl_->GetVal(fg->fis_[fline-1]); 
        if (v==X) { // faulted input at X? 
            Value objv = (current_fault_->type_==Fault::SA0 
                || current_fault_->type_==Fault::STR)?H:L;
            current_obj_.first = fg->fis_[fline-1]; 
            current_obj_.second = objv; 
        }
        else { 
            Value objv = fg->getOutputCtrlValue(); 
            if (objv==X) assert(0); //NOT, PO, PPO, TODO: XOR, XNOR
            current_obj_.first = fg->id_; 
            current_obj_.second = objv; 
            return true; 
        }
    }
    else { 
        Value objv = (current_fault_->type_==Fault::SA0 
            || current_fault_->type_==Fault::STR)?H:L;
        current_obj_.first = fg->id_; 
        current_obj_.second = objv; 
        return true; 
    }
}
开发者ID:xenia-cjen,项目名称:atpg,代码行数:28,代码来源:atpg.cpp

示例6: NOT_NULL

void FileStreamerThread::processQuit(volatile Request *request)
{
	NOT_NULL(request);

	ExitChain::quit();
	Gate *gate = request->gate;
	delete request;
	gate->open();
}
开发者ID:Mesagoppinmypants,项目名称:NGELinux,代码行数:9,代码来源:FileStreamerThread.cpp

示例7: textcolor

	void RadarScreen::Refresh()	{

		int x, y;
		EifIterator  GateIt;
		EifIterator FlightPathIt;
		EifIterator AtLandmarkIt;
		Gate *CrntGate;
		AtLandmark *CrntAtLndmrk;
		FlightPath *CrntFlightPath;


		//Draw Boundary
		window
			(
			winleft_c   - POSITION_WIDTH,
			wintop_c    - POSITION_HEIGHT,
			winright_c  + POSITION_WIDTH,
			winbottom_c + POSITION_HEIGHT
			);

		textcolor (BOUNDARY_TEXT_COLOUR);
		textbackground (BOUNDARY_BACK_COLOUR);

		clrscr();

		// DrawGates
		GateIt = Gates_c.Iterator();
		while (!GateIt.Finished())	{
			CrntGate = Gates_c.Item (GateIt);

			x = CrntGate->GrndPos().X() * POSITION_WIDTH + 1;
			if (CrntGate->GrndPos().X() == MAX_X)	{
				x++;
			}
			y = (MAX_Y - CrntGate->GrndPos().Y() + 1) * POSITION_HEIGHT;

			gotoxy (x, y);
			cprintf (PRINT_GATE);
			cprintf ("%d", CrntGate->ID());


			GateIt.Forth();
		}

		// Draw radar screen
		Select();
		clrscr();

		for (x = MIN_FIELD_X; x <= MAX_FIELD_X; x++)	{
			for (y = MIN_FIELD_Y; y <= MAX_FIELD_Y; y++)	{
				 PrintBackPosition (Position (x,y));

			}
			assert (True);
		}
	}
开发者ID:paulanthonywilson,项目名称:airtrafficcontrol,代码行数:56,代码来源:RADARSCR.CPP

示例8: lua_pushGate

void lua_pushGate( lua_State* L, const Gate& g )
{
    lua_newtable   ( L );
    lua_pushnumber ( L, g.getMean() );
    lua_setfield   ( L, -2, "mean" );
    lua_pushnumber ( L, g.getStdDev() );
    lua_setfield   ( L, -2, "stdDev" );
    lua_pushinteger( L, g.getSource() );
    lua_setfield   ( L, -2, "source" );
    lua_pushinteger( L, g.getID() );
    lua_setfield   ( L, -2, "id" );
}
开发者ID:drkvogel,项目名称:retrasst,代码行数:12,代码来源:Gate.cpp

示例9: SetImage

Gate::Gate(Coordinate pos) {
	top = true;
	SetImage( Image::Get("Resources/Graphics/gate1_top.png") );
	
	// Create the PartnerID Gate
	Gate* partner = new Gate(this->GetID());
	partnerID = partner->GetID();
	exitID = 0;
	SpriteManager::Instance()->Add((Sprite*)partner);

	// Set both Position and Angle at the same time
	SetWorldPosition(pos);
	SetAngle( float( rand() %360 ) );
}
开发者ID:ebos,项目名称:Epiar,代码行数:14,代码来源:gate.cpp

示例10: CrntColumn_c

	ATCInput::ATCInput (Traffic *Traff_i, Landmarks *Lmarks_i) :

		//Screen initialisations
		ATCScreen
			(
			1,
			46,
			60,
			50,
			ATC_TEXT_MODE,
			BLACK,
			WHITE
			),
		CrntColumn_c (1),

		Traff_c (Traff_i),
		Gates_c (True),
		Airports_c (True),
		Beacons_c (True),
		NextProcess_c (&GetPlane),
		IsCmndToCollect_c (False),
		LastCmnd_c (NULL)
			{
		int GateIx, AirportIx, BeaconIx;
		Gate *CrntGate;
		Airport *CrntAirport;
		Beacon *CrntBeacon;


		for (GateIx = 0; GateIx < Lmarks_i->NoOfGates(); GateIx++)	{
			CrntGate = Lmarks_i->AllGates() [GateIx];

			Gates_c.Add (CrntGate, CrntGate->ID());
		}

		for (AirportIx = 0; AirportIx < Lmarks_i->NoOfAirports(); AirportIx++)	{
			CrntAirport = Lmarks_i->AllAirports() [AirportIx];

			Airports_c.Add (CrntAirport, CrntAirport->ID());
		}

		for (BeaconIx = 0; BeaconIx < Lmarks_i->NoOfBeacons(); BeaconIx++)	{
			CrntBeacon = Lmarks_i->AllBeacons() [BeaconIx];

			Beacons_c.Add (CrntBeacon, CrntBeacon->ID());
		}
	}
开发者ID:paulanthonywilson,项目名称:airtrafficcontrol,代码行数:47,代码来源:IN1.CPP

示例11: evalGates

void PWSCircuit::
evalGates(const vector<int>& start, const vector<int>& end)
{
  // We don't deal with input gates.
  for (size_t lNum= 1; lNum < end.size(); lNum++)
  {
    CircuitLayer& prevLayer = getGatePosLayer(lNum - 1);
    CircuitLayer& layer = getGatePosLayer(lNum);

    int gNumStart = start.size() > lNum ? start[lNum] : 0;
    for (int gNum = gNumStart; gNum < end[lNum]; gNum++)
    {
      Gate rop = layer.gate(gNum);
      rop.computeGateValue(prevLayer.gate(rop.wiring.in1), prevLayer.gate(rop.wiring.in2));
    }
  }
}
开发者ID:PickXu,项目名称:pantry,代码行数:17,代码来源:pws_circuit.cpp

示例12: SetImage

/**\brief Creates a Top Gate as well as a Bottom Gate automatically
 * \todo Remove the SpriteManager Instance access.
 */
Gate::Gate(Coordinate pos, string _name) {
	top = true;
	SetImage( Image::Get("Resources/Graphics/gate1_top.png") );
	
	// Create the PartnerID Gate
	Gate* partner = new Gate(GetID());
	partnerID = partner->GetID();
	exitID = 0;
	SpriteManager::Instance()->Add((Sprite*)partner);

	// Set both Position and Angle at the same time
	SetWorldPosition(pos);
	SetAngle( float( rand() %360 ) );

	if( _name == "" ) {
		stringstream val_ss;
		val_ss << GetID();
		val_ss >> _name;
	}
开发者ID:DuMuT6p,项目名称:Epiar,代码行数:22,代码来源:gate.cpp

示例13: calcOutput

		int calcOutput()
		{
			Gate* ptr = pHead;
			while( ptr != null )
			{
				for( int i = 0; i < ptr->numInputs; i++ )
				{
					if( ptr->pInputs[i]->isDefined == DEFINED_BY_CALC )
					{
						ptr->pInputs[i]->isDefined = NOT_DEFINED;
					}
				}
				ptr = ptr->nextGate;
			}

			int dummy; // TODO : Overload GetID func
			Gate* outputGate = getGateIDFromSerial(outputSerial, &dummy);
			return outputGate->GetOutput();
		}
开发者ID:ShootingKing-AM,项目名称:DigitalCircuitSimulator,代码行数:19,代码来源:Source.cpp

示例14: computeDelay

int Net::computeDelay()
{
  if(drivers->size() == 0) {
    return 0; // Input gate
  }
  int cumulativeMaxVal = 0;
  for(vector<Gate*>::iterator it=drivers->begin(); it!=drivers->end(); it++) {
    Gate *g = *it;
    
    // Find max values of the gate's nets
    int maxVal = 0;
    for(vector<Net*>::iterator jt=g->getInputs()->begin(); jt!=g->getInputs()->end(); jt++) {
      maxVal = max(maxVal, (*jt)->computeDelay());
    }
    
    cumulativeMaxVal = max(cumulativeMaxVal, maxVal + g->getDelay());
  }
	return cumulativeMaxVal;
}
开发者ID:dgsmith,项目名称:Verilog-Simulator,代码行数:19,代码来源:net.cpp

示例15: if

/* Detects the destination component of the connection */
bool AddConnection::DetectDestinationComponent() {
	Component* comp = mAppManager->GetOutput()->GetComponentAtPin(mGfxInfo.x2, mGfxInfo.y2);

	if (comp == NULL || comp == mSrcPin->GetGate()) {
		return false;
	}
	else if (dynamic_cast<Gate*>(comp) != NULL) {
		Gate* gate = (Gate*)comp;
		mDstPinIndex = gate->GetInputPinIndex(mGfxInfo.x2, mGfxInfo.y2);
		gate->GetInputPinCoordinates(mGfxInfo.x2, mGfxInfo.y2, mDstPinIndex);
		mDstPin = gate->GetInputPin(mDstPinIndex);

		if (mDstPin == NULL || mDstPin->IsFull()) {
			return false;
		}

		return true;
	}

	return false;
}
开发者ID:OmarBazaraa,项目名称:Logic-Simulator,代码行数:22,代码来源:AddConnection.cpp


注:本文中的Gate类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。