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


C++ Gate::set_Coord_From_outC方法代码示例

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


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

示例1: OnLButtonDown


//.........这里部分代码省略.........
		if (pDoc->isSelected) {
			pDoc->locked = TRUE;
			if (pDoc->objectType == GATE_TYPE)
			{
				Gate *Gtemp;
				Gtemp = NULL;

				switch (pDoc->objectName)
				{
				case AND_GATE:
					Gtemp = new andGate(dec_x, dec_y);

					break;
				case OR_GATE:
					Gtemp = new orGate(dec_x, dec_y);
					break;
				case NAND_GATE:
					Gtemp = new nandGate(dec_x, dec_y);
					break;
				case NOR_GATE:
					Gtemp = new norGate(dec_x, dec_y);
					break;
				case XOR_GATE:
					Gtemp = new xorGate(dec_x, dec_y);
					break;
				case NOT_GATE:
					Gtemp = new notGate(dec_x, dec_y);
					break;
				}

				temp = Gtemp; // delete ¿ëÀ¸·Î ÇÊ¿äÇÔ.

				if (Gtemp != NULL) {
					Gtemp->set_Coord_From_outC(dec_x, dec_y);

					pDoc->currBox->logicInfo.push_back(Gtemp);
					pDoc->CheckPoint();
				}
			}
			else if (pDoc->objectType == WIRING_TYPE)
			{
				Pin *Ptemp = NULL;
				Clock *Ctemp = NULL;
				Out	*Otemp = NULL;
				Sevenseg *Stemp = NULL;
				temp = NULL;

				switch (pDoc->objectName)
				{
				case PIN:
					Ptemp = new Pin(dec_x, dec_y);
					temp = Ptemp;
					//¶óÀ̺귯¸® »óÀÚ¿¡ ´ëÇÑ ÀÔ·Â À§Ä¡¸¦ ã¾ÆÁØ´Ù.
					break;

				case CLOCK:
					Ctemp = new Clock(dec_x, dec_y);
					temp = Ctemp;

					break;

				case OUTPIN:
					Otemp = new Out(dec_x, dec_y);
					temp = Otemp;
					break;
				case SEG7:
开发者ID:zzong2006,项目名称:LogicSimulator,代码行数:67,代码来源:CircuitView.cpp

示例2: OnEditPaste

void CCircuitView::OnEditPaste()
{
	if (PASTED || CUTED) {
		CLogicSimulatorDoc *pDoc = (CLogicSimulatorDoc *)GetDocument();

		for (int i = 0; i < pDoc->currBox->store.name.size(); i++)
		{
			LogicObject* temp;
			int dec_x = pDoc->currBox->store.dec.x, dec_y = pDoc->currBox->store.dec.y;

			if (pDoc->currBox->store.type.at(i) == GATE_TYPE)
			{
				Gate *Gtemp;
				Gtemp = NULL;

				switch (pDoc->currBox->store.name.at(i))
				{
				case AND_GATE:
					Gtemp = new andGate(dec_x, dec_y);
					break;
				case OR_GATE:
					Gtemp = new orGate(dec_x, dec_y);
					break;
				case NAND_GATE:
					Gtemp = new nandGate(dec_x, dec_y);
					break;
				case NOR_GATE:
					Gtemp = new norGate(dec_x, dec_y);
					break;
				case XOR_GATE:
					Gtemp = new xorGate(dec_x, dec_y);
					break;
				case NOT_GATE:
					Gtemp = new notGate(dec_x, dec_y);
					break;
				}

				temp = Gtemp; // delete ¿ëÀ¸·Î ÇÊ¿äÇÔ.

				if (Gtemp != NULL) {
					Gtemp->set_Coord_From_outC(dec_x, dec_y);
				}
			}
			else if (pDoc->currBox->store.type.at(i) == WIRING_TYPE)
			{
				Pin *Ptemp = NULL;
				Clock *Ctemp = NULL;
				Out	*Otemp = NULL;
				Sevenseg *Stemp = NULL;
				temp = NULL;

				switch (pDoc->currBox->store.name.at(i))
				{
				case PIN:
					Ptemp = new Pin(dec_x, dec_y);
					temp = Ptemp;
					//¶óÀ̺귯¸® »óÀÚ¿¡ ´ëÇÑ ÀÔ·Â À§Ä¡¸¦ ã¾ÆÁØ´Ù.
					break;

				case CLOCK:
					Ctemp = new Clock(dec_x, dec_y);
					temp = Ctemp;

					break;

				case OUTPIN:
					Otemp = new Out(dec_x, dec_y);
					temp = Otemp;
					break;
				case SEG7:
					Stemp = new Sevenseg(dec_x, dec_y);
					temp = Stemp;


				}

				if (temp != NULL) {
					temp->set_outputCoord(dec_x, dec_y);
					temp->set_Coord_From_outC(dec_x, dec_y);

					//Ãâ·ÂÇÉÀº Ãâ·Â ¼±ÀÌ ¾ø´Ù.
					//7 segµµ ¸¶Âù°¡ÁöÀÓ.

				}
			}
			else if (pDoc->currBox->store.type.at(i) == FLIPFLOP_TYPE)
			{
				FlipFlop *Ftemp = NULL;

				switch (pDoc->currBox->store.name.at(i))
				{
				case D_FF:
					Ftemp = new DFlipFlop(dec_x, dec_y);
					break;
				case JK_FF:
					Ftemp = new JKFlipFlop(dec_x, dec_y);
					break;
				case T_FF:
					Ftemp = new TFlipFlop(dec_x, dec_y);
					break;
//.........这里部分代码省略.........
开发者ID:zzong2006,项目名称:LogicSimulator,代码行数:101,代码来源:CircuitView.cpp


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