Пример #1
0
void InstanceSettingsPage::on_javaTestBtn_clicked()
{
	checker.reset(new JavaChecker());
	connect(checker.get(), SIGNAL(checkFinished(JavaCheckResult)), this,
			SLOT(checkFinished(JavaCheckResult)));
	checker->path = ui->javaPathTextBox->text();
	checker->performCheck();
}
Пример #2
0
QString ConnectionTester::findDefaultGateway()
{
    emit checkStarted(DefaultGateway);
    QString gw = d->findDefaultGateway();
    emit checkFinished(DefaultGateway, !gw.isNull() && gw != "0.0.0.0", gw);
    return gw;
}
Пример #3
0
QString ConnectionTester::localIpAddress()
{
    emit checkStarted(LocalIpAddress);
    QString ip = d->localIpAddress();
    emit checkFinished(LocalIpAddress, !ip.isNull(), ip);
    return ip;
}
Пример #4
0
QString ConnectionTester::publicIpAddress()
{
    emit checkStarted(PublicIpAddress);
    QString ip = d->publicIpAddress();
    emit checkFinished(PublicIpAddress, !ip.isNull(), ip);
    return ip;
}
Пример #5
0
//Cook A's thread
//executes everything cook A does
void chefFun(void *ptr) {

    // Initialize info for the chef
    Data *chef = (Data *) ptr;
    printf("Chef %i: Initialized.\n", chef->ID);
    int j;
    int m_temp ;

    while(1) {

        // If the recipe returned is a dummy recipe, there are no more recipes
        // left and the chef can end
        if(recipesIndex == MAXRECIPES && (chef->step == -1)) {
            printf("Chef %i: Out of tasks to do\n", chef->ID);
            return;
        }
        takeRecipe(chef);
        checkChefs(chef);
        updateArea(chef);
        clearAreas(chef);
        executeInArea(chef);
        checkFinished(chef);

    }

}
Пример #6
0
void WuZiChessBoard::mousePressEvent(QMouseEvent *event)
{    
    if(m_bFinished)
    {
        return;
    }

    int X = (event->x()-m_delta+0.5*m_rowWidth)/m_rowWidth;
    int Y = (event->y()-m_delta+0.5*m_rowWidth)/m_rowWidth;

    if(X<=m_rows && Y<=m_rows)
    {
        m_mutex.lock();

        if(m_chessPieces[X][Y]!=0)
        {
            m_mutex.unlock();
            return;
        }
        Step step(X, Y);
        m_vecSteps.push_back(step);
        m_chessPieces[X][Y] = m_turn;
        m_turn *= -1;        
        checkFinished();
        drawChessPiece(X, Y);
        update();

        m_mutex.unlock();
    }


}
Пример #7
0
QString ConnectionTester::findDefaultDNS()
{
    emit checkStarted(DefaultDns);
    QString dns = d->findDefaultDNS();
    emit checkFinished(DefaultDns, !dns.isNull(), dns);
    return dns;
}
Пример #8
0
bool ConnectionTester::checkOnline()
{
    emit checkStarted(ActiveInterface);
    QNetworkConfigurationManager mgr;
    bool online = mgr.isOnline();
    emit checkFinished(ActiveInterface, online, QVariant::fromValue(online));
    return online;
}
Пример #9
0
void Executor::waitRecvReq(int timestamp, const NodeID &sender) {
  std::unique_lock<std::mutex> lk(nodeMu_);
  VLOG(1) << obj_.id() << ": wait request " << timestamp << " from " << sender;
  auto rnode = getRNode(sender);
  recvReqCond_.wait(lk, [this, rnode, timestamp]() {
    return checkFinished(rnode, timestamp, false);
  });
}
Пример #10
0
ComplexTab::ComplexTab(QWidget* parent) : QWidget(parent) {
  setupUi(this);

  mThreads = nThreadsSpinBox->value();

  for(int i=0; i<16; ++i)
    connect(plotter->getImageRendererThread(i), SIGNAL(rendered()), plotter, SLOT(checkFinished()));
}
Пример #11
0
bool ConnectionTester::canPing(ConnectionTester::TestType testType, const QString &host)
{
    int avgPing = 0;
    emit checkStarted(testType);
    bool success = d->canPing(host, &avgPing);
    emit checkFinished(testType, success, QVariant::fromValue(avgPing));
    return success;
}
void CWizDocumentStatusCheckThread::downloadData(const QString& strUrl)
{
    QNetworkAccessManager net;
    QNetworkReply* reply = net.get(QNetworkRequest(strUrl));

    QEventLoop loop;
    loop.connect(reply, SIGNAL(finished()), SLOT(quit()));
    loop.exec();

    if (reply->error()) {
        Q_EMIT checkFinished(QString(), QStringList());
        reply->deleteLater();
        return;
    }

    rapidjson::Document d;
    d.Parse<0>(reply->readAll().constData());
    if (d.IsArray())
    {
        QStringList strList;
        QTextCodec* codec = QTextCodec::codecForName("UTF-8");
        QTextDecoder* encoder = codec->makeDecoder();
        for (rapidjson::SizeType i = 0; i < d.Size(); i++)
        {
            const rapidjson::Value& u = d[i];
            strList.append(encoder->toUnicode(u.GetString(), u.GetStringLength()));
        }
        //
        {
            QMutexLocker lock(&m_mutexWait);
            if (strUrl.indexOf(m_strGUID) != -1)
            {
                emit checkFinished(m_strGUID, strList);
            }
            else
            {
                needRecheck();
            }
        }
        reply->deleteLater();
        return;
    }
    Q_EMIT checkFinished(QString(), QStringList());
    reply->deleteLater();
}
Пример #13
0
void Executor::waitSentReq(int timestamp) {
  std::unique_lock<std::mutex> lk(nodeMu_);
  VLOG(1) << obj_.id() << ": wait sent request " << timestamp;
  const NodeID &recver = sentReqs_[timestamp].recver_;
  CHECK(recver.size());
  auto rnode = getRNode(recver);
  sentReqCond_.wait(lk, [this, rnode, timestamp]() {
    return checkFinished(rnode, timestamp, true);
  });
}
Пример #14
0
void JavaCheckerJob::start()
{
	QLOG_INFO() << m_job_name.toLocal8Bit() << " started.";
	m_running = true;
	for (auto iter : javacheckers)
	{
		javaresults.append(JavaCheckResult());
		connect(iter.get(), SIGNAL(checkFinished(JavaCheckResult)), SLOT(partFinished(JavaCheckResult)));
		iter->performCheck();
	}
}
Пример #15
0
void WizUpgradeChecker::_check(const QString& strUrl)
{
    QNetworkReply* reply = m_net->get(QNetworkRequest(strUrl));
    WizAutoTimeOutEventLoop loop(reply);
    loop.exec();

    QUrl possibleRedirectedUrl = reply->attribute(QNetworkRequest::RedirectionTargetAttribute).toUrl();
    m_redirectedUrl = redirectUrl(possibleRedirectedUrl, m_redirectedUrl);

    if (!m_redirectedUrl.isEmpty()) {
        // redirect to download server.
        QString strVersion;
        QRegExp regexp("(\\d{4}-\\d{2}-\\d{2})");
        if (regexp.indexIn(m_redirectedUrl.toString()) == -1) {
            Q_EMIT checkFinished(false);
            return;
        }

        strVersion = regexp.cap(0);

        int y = strVersion.split("-").at(0).toInt();
        int m = strVersion.split("-").at(1).toInt();
        int d = strVersion.split("-").at(2).toInt();

        QDate dateUpgrade(y, m, d);

        QFileInfo fi(::WizGetAppFileName());
        QDate dateLocal = fi.created().date();

        if (dateUpgrade > dateLocal) {
            TOLOG(QObject::tr("INFO: Upgrade is avaliable, version time: %1").arg(dateUpgrade.toString()));
            Q_EMIT checkFinished(true);
        } else {
            TOLOG(QObject::tr("INFO: Local version is up to date"));
            Q_EMIT checkFinished(false);
        }
    } else {
        TOLOG(QObject::tr("ERROR: Check upgrade failed"));
        Q_EMIT checkFinished(false);
    }
}
Пример #16
0
void
MainWindow::silentlyCheckForUpdates() {
  auto forceUpdateCheck = mtx::sys::get_environment_variable("FORCE_UPDATE_CHECK") == "1";

  if (!forceUpdateCheck && !Util::Settings::get().m_checkForUpdates)
    return;

  auto lastCheck = Util::Settings::get().m_lastUpdateCheck;
  if (!forceUpdateCheck && lastCheck.isValid() && (lastCheck.addDays(1) >= QDateTime::currentDateTime()))
    return;

  auto thread = new UpdateCheckThread(this);

  connect(thread, SIGNAL(checkFinished(mtx::gui::UpdateCheckStatus, mtx_release_version_t)), this, SLOT(updateCheckFinished(mtx::gui::UpdateCheckStatus, mtx_release_version_t)));

  thread->start();
}
Пример #17
0
void WebUpdater::updateConfigDownloaded ()
{
	QNetworkReply *reply_ = qobject_cast <QNetworkReply *> (sender());
	assert (reply_);

	if (reply_->error() != QNetworkReply::NoError) {
		lastError_ = CheckError;
		errorText_ = reply_->errorString();
		++currentUrl_;
		getUpdateConfig_p ();
	} else {
		updateConfig_ = reply_->readAll ();
	}

	emit stateChanged (CheckFinishedState);

	emit checkFinished ();
}
Пример #18
0
void WuZiChessBoard::cancelLast()
{
    m_mutex.lock();

    if(m_vecSteps.size()!=0)
    {
        Step lastStep = m_vecSteps.back();
        m_chessPieces[lastStep.x][lastStep.y] = 0;
        eraseChessPiece(lastStep.x, lastStep.y);
        m_vecSteps.pop_back();
        m_turn *= -1;
        m_bFinished = false;
        checkFinished();
        update();
    }

    m_mutex.unlock();
}
AvailableUpdateInfoDialog::AvailableUpdateInfoDialog(QWidget *parent)
  : QDialog{parent, Qt::Dialog | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint}
  , ui{new Ui::AvailableUpdateInfoDialog}
{
  // Setup UI controls.
  ui->setupUi(this);

  setWindowTitle(QY("Online check for updates"));
  setChangeLogContent(Q(""));
  ui->status->setText(QY("Downloading release information"));

  auto thread = new UpdateCheckThread(parent);

  connect(thread, SIGNAL(checkFinished(mtx::gui::UpdateCheckStatus, mtx_release_version_t)), this, SLOT(updateCheckFinished(mtx::gui::UpdateCheckStatus, mtx_release_version_t)));
  connect(thread, SIGNAL(releaseInformationRetrieved(std::shared_ptr<pugi::xml_document>)),  this, SLOT(setReleaseInformation(std::shared_ptr<pugi::xml_document>)));

  thread->start();
}
Пример #20
0
void KAudio::setSignals(bool sigs)
{
  if (sigs) {
    if (!finishTimer) {
      finishTimer = new QTimer(this);
      connect   ( finishTimer, SIGNAL(timeout()), this , SLOT(checkFinished()) );
      finishTimer->start(100);
      currentId = KeysChunk->sync_id;
    }
  }
  else {
    if (finishTimer) {
      disconnect( finishTimer );
      finishTimer->stop();
      delete finishTimer;
      finishTimer = 0;
    }
  }
}
Пример #21
0
int main()
{
	srand(time(NULL));
	int devices[DEVICE_COUNT][RUN_COUNT];
	int colcount = 0;
	int i=0;
	int j=0;
	for(j=0; j < RUN_COUNT; j++) // Initialize
		for(i=0; i < DEVICE_COUNT; i++)
			devices[i][j] = 0;
	for(j = 0; j < RUN_COUNT; j++, colcount=0)
		for(i = 0; checkFinished(devices, j, i) == false; i++)
			if(getSendCount(devices,j, i) > 1){
				collisionOccured(devices,j, i, colcount);
				colcount++;
			}
	for(i=0; i < DEVICE_COUNT; i++) // Prints the average for each device
		printf("Average for device %d: %d slot wait over %d runs\n", i+1,calculateAverage(devices,i), RUN_COUNT);
	sortRunsByFinishTime(devices); // Sort by finish time
	for(i=0; i < DEVICE_COUNT; i++) // Average time to complete by order of completion
		printf("Average for place %d: %d slot wait over %d runs\n", i+1,calculateAverage(devices,i), RUN_COUNT);
}
Пример #22
0
void WizUpgradeChecker::checkUpgrade()
{
    QString strApiUrl = WizApiEntry::standardCommandUrl("download_server");

    if (!m_net.get()) {
        m_net = std::make_shared<QNetworkAccessManager>();
    }

    QNetworkReply* reply = m_net->get(QNetworkRequest(strApiUrl));
    WizAutoTimeOutEventLoop loop(reply);
    loop.exec();

    if (loop.error() != QNetworkReply::NoError)
    {
        Q_EMIT checkFinished(false);
        return;
    }

    QString strCheckUrl = QString::fromUtf8(loop.result().constData());
    strCheckUrl += strUpgradeUrlParam;

    _check(strCheckUrl);
}
Пример #23
0
McoStatus TechkonDialog::DoEvents(short item, Point clickPoint, WindowCode *wc, int32 *numwc, void **data, Boolean &changed)
{
UserItemUPP myfilter;
Str255		theString;
short		itemtype;
Handle		cn1,sliderControl;
Rect		r;
short		part;
Point		mpoint;
int32		next_patch;
McoStatus	status;
WindowPtr	oldp;
int32		temp;
double 		m=1;

	GetPort(&oldp);
	SetPort(dp);

	Changed = FALSE;
	*numwc = 0;
	status = MCO_SUCCESS;

	if (isPressed(0x38)) m = 10;

	if (item != -1) {
		if ((item == TIMER_ITEM ) && (doc->tcom)) // a timer event has occured
			{   
			_last_tick_time2 = TickCount();
			if (_waiting)
				{
				if (!doc->tcom->IsBufferEmpty())	// has a strip been read in
					{
					changed = TRUE; 
					// check to see if a strip has been read in 
					if (doc->tcom->IsDataPresent()) 
						{
						doc->needsSave = TRUE;
						GetDItem ( dp,ids[Message], &itemtype, (Handle*)&cn1, &r );
						GetIndString(theString,Message_List_ID,4);
						SetIText(cn1,theString);
						readInPatches();
						Changed = TRUE;
						next_patch = findNextPatch();
						if (next_patch == -1)
							{
							GetDItem ( dp,ids[Message], &itemtype, (Handle*)&cn1, &r );
							GetIndString(theString,Message_List_ID,5);
							SetIText(cn1,theString);
							_done == TRUE;
							_waiting = FALSE;
							Disable(dp,ids[Redo]);
							Disable(dp,ids[Start]);
							Disable(dp,ids[Cancel]);
							Enable(dp,ids[Save_as]);	
							Enable(dp,OK);			
							}
						else
							{
							GetDItem ( dp,ids[Message], &itemtype, (Handle*)&cn1, &r );
							GetIndString(theString,Message_List_ID,7);
							SetIText(cn1,theString);
							}
						}
					}
				checkFinished();
				}
			}
		else if (item == ids[Slider])   // the slider has been adjusted
			{
			GetMouse(&mpoint);
			do {
				current_patch = GetSlider(mpoint,ids[Slider]);
				ShowPatchScroll(current_patch);
				SetSheetStripText();
				current_sheet = current_patch/(patch_per_strip*strip_per_sheet);
				current_strip = (current_patch - current_sheet*(patch_per_strip*strip_per_sheet))/patch_per_strip;	
				GetMouse(&mpoint);
				} while ( StillDown ( ) );
			checkError((current_patch/patch_per_strip)*patch_per_strip);
			//_waiting = 0;
			Enable(dp,ids[Redo]);
			SetSheetStripText();
			}
		else if (item == ids[Start]) // start or stop reading
			{
			status = MCO_SUCCESS;
			if (_first) 
				{
				
				status = doc->tcom->Calibrate();
				playSound(EndColumnNum);
				if (status != MCO_SUCCESS) 
					{
					McoMessAlert(MCO_FAIL_CALIB,0L);
					status = MCO_SUCCESS;
					goto bail;
					}
				}
			if (status == MCO_SUCCESS)
				{
				_waiting = 1;	
				current_patch = findNextPatch();  // reset the display, current patch, sheet, strip, and text
				ShowPatch(current_patch); // display the window
				current_sheet = current_patch/(patch_per_strip*strip_per_sheet);
				current_strip = (current_patch - current_sheet*(patch_per_strip*strip_per_sheet))/patch_per_strip;
				Disable(dp,ids[Start]);	 
				GetDItem ( dp,ids[Message], &itemtype, (Handle*)&cn1, &r );
				GetIndString(theString,Message_List_ID,7);
				SetIText(cn1,theString);
				SetSheetStripText();		
				_first = 0;
				}
			status = MCO_SUCCESS;
			}
		else if (item == ids[Save_as])
			{
			StorePatches();
			doc->patchtype = patchtype;
			doc->handle_save_datafile(patchD);
			ShowPatch(current_patch);
			}
		else if (item == ids[VoiceSet]) 
			{
			GetDItem(dp, ids[VoiceSet], &itemtype, (Handle*)&cn1, &r );
			voice_set = GetCtlValue((ControlHandle)cn1);
			}
		else if (item == ids[Strip_Rect])
			{
			GlobalToLocal(&clickPoint);
			temp = whichPatch(clickPoint);
			if (temp != -1)
				{
				current_patch = temp;
				current_disp = current_patch-current_top;
				GetDItem ( dp, ids[Slider], &itemtype, (Handle*)&sliderControl, &r );
				SetCtlValue ( (ControlHandle)sliderControl,current_patch);
				ShowPatch(current_patch);
				SetSheetStripText();
				}
			}
		else if (item == ids[Redo]) // Reread a strip
			{
			_waiting = 1;		   // reset the display, current patch, sheet, strip, and text
			Disable(dp,ids[Redo]);
			Disable(dp,ids[Start]);	 
			GetDItem ( dp,ids[Message], &itemtype, (Handle*)&cn1, &r );
			GetIndString(theString,Message_List_ID,7);
			SetIText(cn1,theString);
			}
		else if (item == OK)
			{
			StorePatches();
			doc->copyWaiting(patchD);
			doc->patchtype = patchtype;
			//doc->needsSave = TRUE;
			*numwc = 1;
			wc[0].code = WE_Close_Window;
			wc[0].wintype = WinType;
			wc[0].winnum = WinNum;
			wc[0].doc = doc;
			}
		else if (item == Cancel)
			{
			*numwc = 1;
			wc[0].code = WE_Close_Window;
			wc[0].wintype = WinType;
			wc[0].winnum = WinNum;
			wc[0].doc = doc;
			}
		}
bail:		
		
	SetPort(oldp);
	changed = Changed;
	return status;	    	
}
Пример #24
0
// =======================================================
void procReadBufferFromImage(void *ptr) // Thread which will read data from image file
{
  char cBuf[BUFFER_BLOCK_SIZE]; 
  DWORD dwRes;
  int nRes;

  CParam *param;
  CImage *image;
  CImageBase *cid;
  int nFd;
  
  param = (CParam *)ptr;
  image = param -> image;
  cid = image -> getImageDisk();
  g_nDebugThreadBufferW = getpid();
  nFd = param->nFd;

  BEGIN;

  g_nThreadState = THREAD_RUNNING;
  g_bSpaceOnDisk = true;
  g_nThreadError = 0;
  dwRes = 0;
  //g_nEss = 0;

  do
    {
      checkFinished(nFd);

      dwRes = cid->read((void*)cBuf, sizeof(cBuf));
      if (dwRes != sizeof(cBuf))
	showDebug(1, "EOF: dwRes=%lu and sizeof(cBuf)=%lu\n", dwRes, (DWORD)sizeof(cBuf));

      checkFinished(nFd);
      
      //if (dwRes < sizeof(cBuf))
      //showDebug(1, "EOF2: dwRes=%lu and total=%lu\n", dwRes, (DWORD)sizeof(cBuf));
      if (dwRes > 0)
	{
          if (dwRes != sizeof(cBuf))
            {
              showDebug(1, "unexpected end of file...\n");
	      showDebug(1, "%ld missing bytes\n", sizeof(cBuf)-dwRes);
	      memset(cBuf+dwRes, 0, sizeof(cBuf)-dwRes);
/* FIXME	      dwRes = sizeof(cBuf); */
	    }
	  nRes = write(nFd, cBuf, dwRes);
	  if (nRes == -1)
	    {
	      // MBD
	      showDebug(1, "ERRORX\n");
	    }
	}
      else
	{
	  showDebug(1, "cid->read() returned 0\n");
	}	
    }
  while ((dwRes == sizeof(cBuf))); // && (g_nThreadState != THREAD_ASKEXIT));

  showDebug(1, "EXIT procReadBufferFromImage after while and g_nThreadState=%d\n", g_nThreadState);

  close(nFd);
  g_nThreadState = THREAD_EOF;
  //g_bFinished = false;
  RETURN;
}
void ApplicationUpdateChecker::setCheckFinished()
{
    m_isChecking = false;
    m_checkFinished = true;
    emit checkFinished();
}
Пример #26
0
SpChInDialog::SpChInDialog(ProfileDoc *dc,RawData *pD):TableDialog(dc,pD)
{
	short		iType;
	Handle		iHandle;
	Handle		sHandle;
	Rect 		iRect, r,pRect,tRect;	
	UserItemUPP box3D;
	
	QDErr		error;
	GDHandle	oldGD;
	GWorldPtr	oldGW;
	RGBColor	c,oldbackcolor,oldforecolor;
	WindowPtr	oldP;
	OSErr		err;
	int32 		i,wi,hi;
	double		w,h;
	short		spc_ids[] = SPC_IDS;
	McoStatus  	state;
	int 		papernum;
	
	for (i=0; i<NumInputIDS; i++) ids[i] = spc_ids[i];

	WinType = StripDialog;
	WinNum = 0;

	setDialog(Input_Dialog);
	frame_button(ids[Ok_Box]);	

	
	SetSheetStripText();
	
	// Added by James, 3D the box
	threeD_box(ids[ThreeDBox]);
	
	// initialize comminications with the specrolino
	state = doc->openInputDevice(0,0,0);	
	if (state != MCO_SUCCESS) McoErrorAlert(state);

	w = patchD->patches.width;
	h = patchD->patches.height;
	
	if (patchD->type == CMYKPatches) papernum = 0;
	else if (patchD->type == RGBPatches) papernum = patchD->format.total;
	
	if (doc->tcom != 0L) ((SpectroChart*)(doc->tcom))->setUpPatches(patchD->patches.columns,patchD->patches.rows,w,h,patchD->patches.starting,patchD->patches.direction,papernum);

	if (doc->tcom->device_num != DT_GretagTable) 
		{
		McoErrorAlert(MCO_FAILURE);
		}
	
	// initialize the big gworld 
	GetDItem (dp, ids[Strip_Rect], &iType, (Handle*)&iHandle, &iRect);
	tRect = iRect;
	OffsetRect(&tRect,-iRect.left,-iRect.top);
	error = NewGWorld( &BigGW, 32, &tRect, 0, 0, 0 );
	if (error != 0) 
		{
		delete this;
		return;
		} 
	GetGWorld(&oldGW,&oldGD);
	SetGWorld(BigGW,nil);	
	
	
//	GetBackColor(&oldbackcolor);
	GetForeColor(&oldforecolor);
	c.red = 65535;
	c.green = 65535;
	c.blue = 65535;
	RGBBackColor(&c);
	c.red = 0;
	c.green = 0;
	c.blue = 0;
	RGBForeColor(&c);		
//	EraseRect( &tRect );
	
	SetGWorld(oldGW,oldGD);	
//	RGBBackColor(&oldbackcolor);
	RGBForeColor(&oldforecolor);	

//	SetPort(oldP);
		
	GetDItem (dp, ids[Patch_Rect], &iType, (Handle*)&iHandle, &pRect);
	num_display_patch = (iRect.bottom-iRect.top)/(pRect.bottom-pRect.top);
	top_patch = 0;
	
	current_top = current_patch - 2*num_display_patch/3;
	current_bottom = current_top + num_display_patch - 1;
	if (current_top < 0) 
		{
		current_top = 0;
		current_bottom = current_top + num_display_patch - 1;
		}
	if (current_bottom >= total_patches-1)
		{
		current_bottom = total_patches - 1;
		current_top = current_bottom - num_display_patch + 1;
		}
	
	current_disp = 2*num_display_patch/3;
	
	init();	
	getpatchRGB();
	dtype = DType_Density;
	
	Disable(dp,ids[Redo]);

	
	GetDItem (dp, ids[Slider], &iType, (Handle*)&iHandle, &pRect);
	SetCtlMin((ControlHandle)iHandle,0);
	SetCtlMax((ControlHandle)iHandle,total_patches-1);
	
	
	if (ids[VoiceSet] > -1)
		{
		GetDItem(dp, ids[VoiceSet], &iType, (Handle*)&iHandle, &pRect);
		SetCtlValue((ControlHandle)iHandle,1);
		}	
	//voice_set = 1;
	
	if (ids[Lift] > -1) HideDItem(dp,ids[Lift]);
	
	checkFinished();
	DrawWindow();
}	
Пример #27
0
void CParser::parsingDirective()
{
    CDirectiveParser::AddToken();
    checkFinished();
}
Пример #28
0
void CParser::parsingRule()
{
    CRuleParser::AddToken();
    checkFinished();
}
Пример #29
0
TechkonDialog::TechkonDialog(ProfileDoc *dc,RawData *pD):InputDialog(dc,pD,1)
{
	short		iType;
	Handle		iHandle;
	Handle		sHandle;
	Rect 		iRect, r,pRect,tRect;	
	UserItemUPP  box3D;
	
	QDErr		error;
	GDHandle	oldGD;
	GWorldPtr	oldGW;
	RGBColor	c,oldbackcolor,oldforecolor;
	WindowPtr	oldP;
	OSErr			err;
	int32 		i,wi,hi;
	double w,h;
	short		gtsl_ids[] = GTSL_IDS;
	Str255		theString;
	PixMapHandle	bigPixMap;
	McoStatus  	state;
	
	for (i=0; i<NumInputIDS; i++) ids[i] = gtsl_ids[i];

	WinType = TechkonWindow;
	WinNum = 0;

	setDialog(Input_Dialog);
	frame_button(ids[Ok_Box]);	

	

	
	// Added by James, 3D the box
	threeD_box(ids[ThreeDBox]);
	
	HideDItem(dp,ids[Redo]);
	
	GetDItem ( dp,ids[Message], &iType, (Handle*)&iHandle, &iRect );
	GetIndString(theString,Message_List_ID,6);
	SetIText(iHandle,theString);
	
	Scramble = FALSE;	
	
	if (Scramble)
		{
		voice_set = 1;
		}	
	else
		{
		Disable(dp,ids[VoiceSet]);
		voice_set = 2;
		}

	// initialize comminications with the device
	state = doc->openInputDevice(0,0,0);
	if (state != MCO_SUCCESS) McoErrorAlert(state);
	
	// initialize the big gworld 
	GetDItem (dp, ids[Strip_Rect], &iType, (Handle*)&iHandle, &iRect);
	tRect = iRect;
	OffsetRect(&tRect,-iRect.left,-iRect.top);
	error = NewGWorld( &BigGW, 32, &tRect, 0, 0, 0 );
	if (error != 0) 
		{
		delete this;
		return;
		} 
	GetGWorld(&oldGW,&oldGD);
	SetGWorld(BigGW,nil);	
	
	
//	GetBackColor(&oldbackcolor);
	GetForeColor(&oldforecolor);
	c.red = 65535;
	c.green = 65535;
	c.blue = 65535;
	RGBBackColor(&c);
	c.red = 0;
	c.green = 0;
	c.blue = 0;
	RGBForeColor(&c);		
	bigPixMap = GetGWorldPixMap ( BigGW );
	if (LockPixels ( bigPixMap ))	EraseRect( &tRect );
	
	SetGWorld(oldGW,oldGD);	
//	RGBBackColor(&oldbackcolor);
	RGBForeColor(&oldforecolor);	

//	SetPort(oldP);
		
	GetDItem (dp, ids[Patch_Rect], &iType, (Handle*)&iHandle, &pRect);
	num_display_patch = (iRect.bottom-iRect.top)/(pRect.bottom-pRect.top);
	top_patch = 0;
						
//init the static members
	//current_patch = total_patches-1;
	//current_patch = 0;
	current_patch = 0;
	current_strip = 0;
	current_sheet = 0;
 		
 	_done = 0;
 	_waiting = 0;
	
	
	SetSheetStripText();
	
	current_top = current_patch - 2*num_display_patch/3;
	current_bottom = current_top + num_display_patch - 1;
	if (current_top < 0) 
		{
		current_top = 0;
		current_bottom = current_top + num_display_patch - 1;
		}
	if (current_bottom >= total_patches-1)
		{
		current_bottom = total_patches - 1;
		current_top = current_bottom - num_display_patch + 1;
		}
	
	current_disp = 2*num_display_patch/3;
	
	init();	
	getpatchRGB();
	
	
	Disable(dp,ids[Redo]);

	
	GetDItem (dp, ids[Slider], &iType, (Handle*)&iHandle, &pRect);
	SetCtlMin((ControlHandle)iHandle,0);
	SetCtlMax((ControlHandle)iHandle,total_patches-1);
	
	GetDItem(dp, ids[VoiceSet], &iType, (Handle*)&iHandle, &pRect);
	SetCtlValue((ControlHandle)iHandle,1);
	//voice_set = 1;
	checkFinished();
	DrawWindow();
}	
Пример #30
0
void CParser::parsingQualifier()
{
    CQualifierParser::AddToken();
    checkFinished();
}