Example #1
0
bool CContainersDispatcher::SendNotification(TContainerIdentifyNotificationMessage &Message)
{
	int count = 0;

#ifdef _DEBUG	
	QString event;
	if(Message.MessageBody.EventType == TANK_INSERTED)
		event = "Inserted";
	else if(Message.MessageBody.EventType == TANK_REMOVED)
		event = "Removed";
	else if(Message.MessageBody.EventType == TANK_UPDATE_CONSUMPTION)
		event = "Consumption updated";
	else
		event = "Incorrect event type";	

	count = m_SMContainerIDEventQueue->ItemsCount;
	QString str = QFormatStr("ContainersDispatcher::SendNotification. m_SMContainerIDEventQueue->ItemsCount: %d, Tank: %s (%d), Event: %s",
												count,
												TankToStr(Message.TankIndex).c_str(),
												Message.TankIndex, event.c_str());
	CQLog::Write(LOG_TAG_RACCOON, str.c_str());
#endif	                                   

	if(m_SMContainerIDEventQueue->Send(Message, QMsToTicks(DISPATCHER_QUEUE_SEND_TIMEOUT)) == QLib::wrTimeout)
	{
		count = m_SMContainerIDEventQueue->ItemsCount;
		CQLog::Write(LOG_TAG_RACCOON, QFormatStr("Container Tag ID queue timeout. m_SMContainerIDEventQueue->ItemsCount: %d", count));
		throw EContainer("Container Tag ID queue timeout");
    }

    return true;
}
void SendMPDialog::updatePropSelector()
{
    LOCK(cs_tally);

    uint32_t nextPropIdMainEco = GetNextPropertyId(true);  // these allow us to end the for loop at the highest existing
    uint32_t nextPropIdTestEco = GetNextPropertyId(false); // property ID rather than a fixed value like 100000 (optimization)
    QString spId = ui->propertyComboBox->itemData(ui->propertyComboBox->currentIndex()).toString();
    ui->propertyComboBox->clear();

    for (unsigned int propertyId = 1; propertyId < nextPropIdMainEco; propertyId++) {
        if ((global_balance_money[propertyId] > 0) || (global_balance_reserved[propertyId] > 0)) {
            std::string spName = getPropertyName(propertyId);
            std::string spId = strprintf("%d", propertyId);
            if(spName.size()>23) spName=spName.substr(0,23) + "...";
            spName += " (#" + spId + ")";
            if (isPropertyDivisible(propertyId)) { spName += " [D]"; } else { spName += " [I]"; }
            ui->propertyComboBox->addItem(spName.c_str(),spId.c_str());
        }
    }
    for (unsigned int propertyId = 2147483647; propertyId < nextPropIdTestEco; propertyId++) {
        if ((global_balance_money[propertyId] > 0) || (global_balance_reserved[propertyId] > 0)) {
            std::string spName = getPropertyName(propertyId);
            std::string spId = strprintf("%d", propertyId);
            if(spName.size()>23) spName=spName.substr(0,23)+"...";
            spName += " (#" + spId + ")";
            if (isPropertyDivisible(propertyId)) { spName += " [D]"; } else { spName += " [I]"; }
            ui->propertyComboBox->addItem(spName.c_str(),spId.c_str());
        }
    }
    int propIdx = ui->propertyComboBox->findData(spId);
    if (propIdx != -1) { ui->propertyComboBox->setCurrentIndex(propIdx); }
}
Example #3
0
// Initialize the log file
void CQ2RTApplication::InitLogFile(void)
{
	CQLog::SetMaxNumberOfLogFiles(CAppParams::Instance()->MaxLogFilesNumber);
	// Force Directory creation
	ForceDirectories((AppFilePath.Value() + "Log").c_str());
	CQLog::Init(MAX_LOG_FILE_SIZE, LAST_LOG_TAG, AppFilePath.Value() + "Log\\",
	            AppFilePath.Value() + "Log\\" + GetLastLogFileName(), LogFileChangeEventHandler);

	CQEncryptedLog::Init(2 * MAX_LOG_FILE_SIZE, LAST_LOG_TAG, AppFilePath.Value() + "Configs\\",
              AppFilePath.Value() + "Configs\\follow - up log.txt",NULL);

	CQEncryptedLog::EnableEchoToMonitor(false);
	CQEncryptedLog::EnableDisableTag(LOG_TAG_GENERAL, true);
	CQEncryptedLog::EnableDisableTag(LOG_TAG_HASP, true);
  
	CQEncryptedLog::Write(LOG_TAG_GENERAL, "---------------------------------------------------------");

#if defined(OS_WINDOWS) && !defined(EDEN_CL)
	QString HelloMsg = (QString)APPLICATION_NAME + " is up (version: " + QGetAppVersionStr() + " Build: " +
	                   GetVersionDate() + " " + GetVersionTime() + ")";
#else
	QString HelloMsg = "1 - Eden is up (version: " + QGetAppVersionStr() + " Build: " + __DATE__ + " " + __TIME__ ")";
#endif

	CQLog::EnableDisableTag(LOG_TAG_GENERAL, true);
	CQLog::Write(LOG_TAG_GENERAL, HelloMsg.c_str());
	CQEncryptedLog::Write(LOG_TAG_GENERAL, HelloMsg.c_str());
	CQLog::WriteUnformatted("---------------------------------------------------------");
	IsLogFileInit = true;
}
Example #4
0
// Constructor
CHTML_ReportFile::CHTML_ReportFile(const QString FileName, const QString DirName):m_StrList(NULL)
{
  // If directory doesn't exist, create it
  QString OutputDir = Q2RTApplication->AppFilePath.Value() + DirName;
  if (DirectoryExists(OutputDir.c_str()) == false)
	ForceDirectories(OutputDir.c_str()); // Force Directory creation

  m_ReportFileName = Q2RTApplication->AppFilePath.Value() + FileName;
}
// -----------------------------------------------------------------------------
//  Read the data part of the ANG file
// -----------------------------------------------------------------------------
void CSVGrainDataReader::readData(const QString& line, int row, size_t i)
{
  /* When reading the data there should be at least 8 cols of data. There may even
   * be 11 columns of data. The column names should be the following:
   * Grain ID
   * phi1
   * phi
   * phi2
   *
   *
   */
  float  p1, p, p2, eq, ba, ca, o3;

  int gid, obb, nn, sg;

  m_NumFeatures = sscanf(line.c_str(), "%d,%f,%f,%f,%f,%f,%f,%f,%d,%d,%d", &gid, &p1, &p, &p2, &eq, &ba, &ca, &o3, &obb, &nn, &sg);


  m_GrainId[row] = gid;
  m_Phi1[row] = p1;
  m_Phi[row] = p;
  m_Phi2[row] = p2;
  m_EquivDiam[row] = eq;
  m_B_Over_A[row] = ba;
  m_C_Over_A[row] = ca;
  m_Omega3[row] = o3;
  m_OutsideBoundingBox[row] = obb;
  m_NumNeighbors[row] = nn;
  m_SurfaceGrain[row] = sg;
}
Example #6
0
//Special T axis command
TQErrCode CMotorsDummy::GoToTAxisState(int State)
{
   QString StateString;

#ifdef CHECK_MOV
   if(AxisUnderMovement[AXIS_T])
      {
      CQLog::Write(LOG_TAG_MOTORS,"GoTo T Axis State is under movement");
      return Q2RT_FATAL_ERROR;
      }
#endif

   AxisUnderMovement[AXIS_T] = true;

   switch(State)
      {
      case PURGE_TANK_CLOSED: StateString="Tank Closed";break;
      case PURGE_TANK_IN_PURGE_POSITION:StateString="Purge position";break;
      case PURGE_TANK_IN_WIPE_POSITIOND:StateString="Wipe position";break;
      default:
         break;
      }

   //Reset solicited position to 0, in case Axis T will be moved manually (without the next bit of code solicited position will be the same as previous manually moved)
   long PosInSteps = 0;
   UpdateAxisLocation(AXIS_T, PosInSteps);
   KeepAxisSolicitedLocation(AXIS_T, PosInSteps);
   FrontEndInterface->UpdateStatus(FE_CURRENT_X_AXIS_POSITION+AXIS_T, (int)PosInSteps);
   m_LastSolicitedPositions[AXIS_T] = GetAxisSolicitedLocation(PosInSteps);

   CQLog::Write(LOG_TAG_MOTORS,"Go To T Axis State = %s",StateString.c_str() );   
   return Q_NO_ERROR;
}
void DebugEmitterComponent::LoadModel(QString path, AssetManager* assetMgr)
{
	if (assetMgr)
	{
		_assetManager = assetMgr;

		if (assetMgr->LoadModel(path.c_str(), path.c_str()))
		{
			auto asset = assetMgr->GetModel(path.c_str());

			if (asset)
				_model = asset->model;
			else
				_model = nullptr;
		}
	}
}
Example #8
0
void CQ2RTApplication::PrintLogMessage(int MessageID, TGenericCockie Cockie)
{
	CEdenProtocolClient *InstancePtr = reinterpret_cast<CEdenProtocolClient *>(Cockie);
	QString PrintMessage = InstancePtr->Name() + " :Retry Message: " +
	                       InstancePtr->ConvertMessageToString(MessageID) +
	                       " (0x" + QIntToHex((const int)MessageID, 2) + ")";
	CQLog::Write(LOG_TAG_GENERAL, PrintMessage.c_str());
}
Example #9
0
void QtHistory::replayItem(int id) {
	if (id != 0){
	HistoryMementoCollection * collection = _cHistory.getHistory().getHistoryMementoCollection();
	HistoryMemento* memento = collection->getMemento(id);
	QString data = QString::fromStdString(memento->getData());

	QtWengoPhone * qtWengoPhone = (QtWengoPhone *) _cHistory.getCWengoPhone().getPresentation();
	//VOXOX - CJC - 2009.06.10 
	QtVoxMessageBox box(_historyWidget->getWidget());
	box.setWindowTitle("VoxOx - Call History");
	box.setText(tr("Do you want to call %1?").arg(formatName(memento->getPeer(), _isWengoAccountConnected)));
	box.setStandardButtons(QMessageBox::Yes | QMessageBox::No );


	/*QMessageBox mb(tr("@[email protected] - Call History"),
		tr("Do you want to call %1?").arg(formatName(memento->getPeer(), _isWengoAccountConnected)),
		QMessageBox::Question,
		QMessageBox::Yes | QMessageBox::Default,
		QMessageBox::No | QMessageBox::Escape,
		QMessageBox::NoButton, _historyWidget->getWidget());*/

	switch (memento->getState()) {
	case HistoryMemento::OutgoingSmsOk:
	case HistoryMemento::OutgoingSmsNok: {
		//Retrieve info & configure the Sms widget
		std::string data = _cHistory.getMementoData(id);
		QString text = QString::fromUtf8(data.c_str(), data.size());
		QString phoneNumber = QString::fromStdString(_cHistory.getMementoPeer(id));

		//Test existance of Sms (available only if a WengoAccount has been created)
		QtSms * sms = qtWengoPhone->getQtSms();
		if (sms) {
			sms->setText(text);
			sms->setPhoneNumber(phoneNumber);
			sms->getWidget()->show();
		}
		break;
	}

	case HistoryMemento::OutgoingCall:
	case HistoryMemento::IncomingCall:
	case HistoryMemento::MissedCall:
	case HistoryMemento::RejectedCall:
		if (box.exec() == QMessageBox::Yes) {
			_cHistory.replay(id);
		}
		break;

	case HistoryMemento::ChatSession:
		_chatLogViewer = new QtChatLogViewer(NULL, *qtWengoPhone, data );
		_chatLogViewer->restartChat();
		break;

	default:
		break;
		}
	}
}
Example #10
0
void AFramework::MTempMaster::msg(const QString & s, const uint32 ms) const{
    m_lcd->clear();
    if(s.isEmpty()){
        m_lcd->write("NULL POINTER");
        while(1);
    }else{
        m_lcd->write(s.c_str());    
    }
    System::delay(ms);
    return;
}
Example #11
0
void __fastcall TRFIDForm::GetTagButtonClick(TObject *Sender)
{
  int num_of_tags = 0;
  unsigned __int64 tagsList[MAX_TAGS];

  //m_RFIDInstance->EnableSampling(m_rdrNum,m_Channel);

  // Get the last read tags list:
  m_RFIDInstance->GetTags( m_rdrNum
						 , m_Channel
                         , tagsList
                         , &num_of_tags);

  if (num_of_tags != 1)
    return;

  m_TagAccess[m_rdrNum]->SetTagID(tagsList[0]);

  QString TagStr = m_RFIDInstance->GetTagIDAsString(tagsList[0]);
  TagIDPanel->Caption = TagStr.c_str();
}
void CPathLib::DeleteFiles(std::list<std::string> *pFiles, std::list<bool> *pResults)
#endif
{
#ifdef QT
	QList<QString>::iterator itFiles;
	QString sFilename;
#else
	std::list<std::string>::iterator itFiles;
	std::string sFilename;
#endif

	if(pFiles == NULL)
		return;

	if(pResults == NULL)
		return;

	pResults->clear();

	for(itFiles = pFiles->begin(); itFiles != pFiles->end(); itFiles++)
	{
		sFilename = CompletePath(*itFiles);

#ifdef QT
		if(remove(sFilename.toStdString().c_str()) != 0)
#else
		if(remove(sFilename.c_str()) != 0)
#endif
		{
			pResults->push_back(false);
		}
		else
		{
			pResults->push_back(true);
		}
	}
}
Example #13
0
void __fastcall TRFIDForm::EnterPasswordClick(TObject *Sender)
{
  time_t rawtime;
  struct tm * timeinfo;

  time ( &rawtime );
  timeinfo = localtime ( &rawtime );
  int res = timeinfo->tm_mday*timeinfo->tm_mday+(timeinfo->tm_mon+1)*(timeinfo->tm_mon+1)+timeinfo->tm_year;
  QString str = "TESTER" + QIntToStr(res);
  if(strcmp(str.c_str(),PasswordMaskEdit->Text.c_str())==0)
  {
	  PasswordMaskEdit->Clear();
	  IncorrectPass->Visible = false;
	  m_validPass = true;
	  
	  SecurityGroup->Visible = true;
	  SecurityGroup->Enabled = true;

	  SettingWeightLabel->Visible = true;
	  InitialWeightEdit->Visible  = true;
	  InitialWeightEdit->Enabled  = true;

	  ProtocolNumberGroup->Visible = true;
	  //ProtocolNumberGroup->Enabled = true;
	  TagVersionEdit->Visible = true;

	  ErrorCodeGroup->Visible = true;
	  ErrorCodeEdit->Visible = true;
	  //ErrorCodeGroup->Enabled = true;
  }
  else
  {
	  IncorrectPass->Visible = true;
	  m_validPass = true;
  }
}
void Widget::SaveAs()
{
    // Choix du chemin d'enregistrement
    QString file = QFileDialog::getSaveFileName(this,"Enregister", QString(), ".csv");

    // Enregistrement
    QFile saveCSV(file +".csv");

    if (saveCSV.open(QFile::WriteOnly))
    {
        QTextStream out(&saveCSV);

        QString PhoneNumber = "Phone Number";
        QString GroupName = "Group Name";

        out << "Name" << "," << PhoneNumber << ","  << "Expenses" << "," << GroupName << "," << "Mail" << "," << "Type" << "\n";

        for (vector<Group>::iterator it = Groups.begin() ; it != Groups.end(); ++it)
        {

            Group tmpGroup = *it;

            for (size_t i=0; i < tmpGroup.size(); ++i) {

                // operate the payback first
                tmpGroup[i].operatePayback(tmpGroup.expensesPerPerson());
                // display the values


                string Name = tmpGroup[i].getName();
                string Phone = tmpGroup[i].getPhone();
                float Expenses = tmpGroup[i].getExpenses();
                string GroupName = it->getName();
                string Mail = tmpGroup[i].getMail();
                int Statut = tmpGroup[i].getStatut();

                QString QName = QString(Name.c_str());
                QString QPhone = QString(Phone.c_str());
                QString QExpenses;
                QExpenses.setNum(Expenses);
                QString QGroupName = QString(GroupName.c_str());
                QString QMail = QString(Mail.c_str());

                QString QStatut;

                if (Statut == 0){

                    QStatut = "Donnateur";

                }
                else{
                    QStatut = "Membre";
                }


                out << QName << "," << QPhone << "," << QExpenses << "," << QGroupName << "," << QMail << "," << QStatut << "\n";

            }


        }
    }
}
Example #15
0
void ReadiumJSApi::loadJS(QString jScript)
{

#if 0	
	QAxObject* doc = WebBrowser->querySubObject("Document()");
	//IDispatch* Disp;
	IDispatch* winDoc = NULL;
	IHTMLDocument2* document = NULL;

	//332C4425-26CB-11D0-B483-00C04FD90119 IHTMLDocument2
	//25336920-03F9-11CF-8FD0-00AA00686F13 HTMLDocument
	doc->queryInterface(QUuid("{332C4425-26CB-11D0-B483-00C04FD90119}"), (void**)(&winDoc));
	if (winDoc) {
		document = NULL;
		winDoc->QueryInterface(IID_IHTMLDocument2, (void**)&document);
		IHTMLWindow2 *window = NULL;
		document->get_parentWindow(&window);
		QAxObject* documentWin = new QAxObject(document, WebBrowser);
		QAxObject* jScriptWin = new QAxObject(window, WebBrowser);
		//connect(jScriptWin, SIGNAL(exception(int, QString, QString, QString)), this, SLOT(printWinException(int, QString, QString, QString)));
		//jScriptInitialized = true;

		QVariantList params;
		//params.append(javaScript);
		//params.append("alert('Hi')");
		params.append("JScript");
		//QVariant result = jScriptWin->dynamicCall("execScript(QString, QString)", params);
		VARIANT var;
		QString strCode = jScript;
		QString stringLang("JScript");
		BSTR bstrCode = SysAllocString(strCode.toStdWString().c_str());
		BSTR bstrLang = SysAllocString(stringLang.toStdWString().c_str());
		window->execScript(bstrCode, bstrLang, &var);
		SysFreeString(bstrCode);
		SysFreeString(bstrLang);
		document->Release();
		winDoc->Release();
	}
	else {
		//qDebug() << "COULD NOT GET DOCUMENT OBJECT! Aborting";
	}
#else
	if (WebBrowser)
	{
		CComPtr<IDispatch> pDispDoc = WebBrowser->get_Document();
		CComQIPtr<IHTMLDocument2> pHtmlDoc(pDispDoc);
		if (pHtmlDoc)
		{
			CComPtr<IHTMLWindow2>    pMainWin2;
			pHtmlDoc->get_parentWindow(&pMainWin2);

			if (pMainWin2)
			{
				CComVariant    vtRv(0);
				CComBSTR bsCode = jScript.c_str() /*L"alert (\" Hi !\");"*/, bsLang = L"JavaScript";
				HRESULT hr = pMainWin2->execScript(bsCode, bsLang, &vtRv);

				if (!SUCCEEDED(hr))
				{
					//AfxMessageBox(L"Error executing script");
				}
			}
		}
	}


	//QAxObject* qv = WebBrowser->querySubObject("Document()");
	//QAxObject* qv1 = qv->querySubObject("parentWindow");
	//QString script = "(function(){" + jScript + "})()";
	//qDebug() << script;

	/*{
	QString filename = "Data.txt";
	QFile file(filename);
	if (file.open(QIODevice::ReadWrite)) {
	QTextStream stream(&file);
	stream << script << endl;
	}
	file.close();
	}*/

	//QVariantList params;
	//params.append("alert('hello')");
	//params.append("JScript");
	//QVariant result = qv1->dynamicCall("execScript(QString, QString)", params);
	//qv1->dynamicCall("execScript(Qstring)", script, "javascript");
	//qv1->dynamicCall("execScript(Qstring, QString)", script, "JScript");	//, "javascript"
	//qv1->deleteLater();
	//qv->deleteLater();

	//Log.i(TAG, "loadJS: "+jScript);
	//mJSLoader.loadJS("javascript:(function(){" + jScript + "})()");
	//pWebBrowser->dynamicCall(script);

#endif
}
Example #16
0
// Sends message notifying cartridge insertion or removal
void CContainer::UpdateTankStatus(int TankIndex, TTagIdentificationEventType Status, const unsigned int Weight, const unsigned int SliceNum)
{
    TContainerIdentifyNotificationMessage Msg;
    memset(&Msg, 0, sizeof(TContainerIdentifyNotificationMessage));

    Msg.TankIndex             = static_cast<TTankIndex>(TankIndex);
    Msg.MessageBody.EventType = Status;
    Msg.MessageBody.Weight    = Weight;
    Msg.MessageBody.SliceNum  = SliceNum;
    Msg.MessageBody.TimeStamp = QGetTicks();

    m_ContainerDispatcher->SendNotification(Msg);

    QString StatusStr = "";
    switch(Status)
    {
        case TANK_INSERTED:
            StatusStr = "inserted";
            break;

        case TANK_REMOVED:
            StatusStr = "removed";
            break;

        case TANK_UPDATE_CONSUMPTION:
            StatusStr = QFormatStr("accumulating weight %d mGr for consumption update", Weight);
            break;
    }

    CQLog::Write(LOG_TAG_RACCOON, QFormatStr("Cartridge %s (%d) %s", TankToStr(static_cast<TTankIndex>(TankIndex)).c_str(), TankIndex, StatusStr.c_str()));
}
Example #17
0
void CQ2RTApplication::ExecFileSafe(QString FileName, bool ClearDictionary)
{
	QPythonIntegratorDM->ExecFileSafe(FileName.c_str(), ClearDictionary);
}
Example #18
0
int TCartridgeErrorForm::OpenCartridgeErrorDialog(int DlgType, TChamberIndex Chamber)
{
	if(!VALIDATE_CHAMBER_INCLUDING_WASTE(Chamber))
		return 0;

	m_Chamber = Chamber;
	m_DlgType = DlgType;

	m_SecondsCounter = 0;
	m_MinutesCounter = 0;
	m_HoursCounter   = 0;

	QString tmp;

	int i = FIRST_TANK_INCLUDING_WASTE_TYPE;

	//Add first cartridge string
	try
	{
		// Following while may throw the exception if there's no tank associated with 'Chamber'.
		while(m_BackEndInterface->IsChambersTank(Chamber, i) == false)
		{
			if(i>=LAST_TANK_INCLUDING_WASTE_TYPE)
				throw EQException(QFormatStr("No tank is associated with M%d chamber.", Chamber));
			i++;
		}
		// Showing an "MRW was not completed" error-dialog is done at the catch block below.
		// (identified by a segment with "UNDEFINED" material)
		/*if (TYPE_CHAMBER_WASTE != m_Chamber)
		  if (QString(CAppParams::Instance()->TypesArrayPerPipe[(TTankIndex)i]).compare("UNDEFINED") == 0)
			throw EQException("MRW was not completed"); */

		if(TYPE_CHAMBER_WASTE == m_Chamber)
		{
			tmp = TankToStr((TTankIndex)i) + " cartridge"; // cartridge in "singular".

			if(DlgType == FE_INSERT_CARTRIDGE)
			{
				ErrorLabel->Caption = "Waste cartridge removal has been detected";
				tmp = "insert " + tmp;
			}
			else
			{
				ErrorLabel->Caption = "Waste cartridge is full";
				tmp = "empty " + tmp;
			}
		}
		else
		{
			int AssociatedCartridges = CAppParams::Instance()->CartridgeRedundancy+1; //Num of cartridges associated to chamber
			QString ChamberMaterial = CAppParams::Instance()->TypesArrayPerChamber[m_Chamber];
			bool AdditionalMaterial = false;
			//Create the string with the relevant cartridges
			for(int t=0; t<AssociatedCartridges && i<LAST_TANK_INCLUDING_WASTE_TYPE; t++,i++)
			{
				//check that the cartridge has the same material as the its chamber
				if(ChamberMaterial.compare(CAppParams::Instance()->TypesArrayPerPipe[i]) == 0)
				{
					if(m_BackEndInterface->IsChambersTank(Chamber, i))
					{
						if(!AdditionalMaterial) //first entrance
						{
							tmp = TankToStr((TTankIndex)i);
							AdditionalMaterial = true;
						}
						else
							tmp+= " and/or " + TankToStr((TTankIndex)i);
					}
				}
			}
			tmp = tmp + " cartridge(s)"; // cartridge in "plural".
			ErrorLabel->Caption         = (QString(CAppParams::Instance()->TypesArrayPerChamber[m_Chamber]) + " Material Required").c_str();
			tmp = ((FE_INSERT_CARTRIDGE == DlgType) ? "Insert " : "Replace ") + tmp;
		}
		InstructionsLabel->Caption    = QFormatStr("%s\nor press 'Stop' to terminate printing",tmp.c_str()).c_str();
	}
	catch(EQException& Exception)
	{
		ErrorLabel->Caption = "No cartridge may be used";
		InstructionsLabel->Caption = Exception.GetErrorMsg().c_str();
	}
	catch(...)
	{
		ErrorLabel->Caption = "No cartridge may be used";
		InstructionsLabel->Caption = QFormatStr(LOAD_STRING(IDS_NOT_COMPLETED), WIZARD_TITLE(IDS_RR_WIZARD), StopButton->Caption.c_str(), WIZARD_TITLE(IDS_RR_WIZARD)).c_str();
	}

	this->Caption = "Elapsed Time 00:00:00";
	ErrorLabel->Width             = this->Width;
	ErrorLabel->Left              = 0;
	InstructionsLabel->Width      = this->Width;
	InstructionsLabel->Left       = 0;
	CartridgeStatusTimer->Enabled = true;
	CartridgeStatusTimer->Interval = 500;  // should be >= DELAY_BETWEEN_EACH_OCB_STATUS_VERIFICATION_MIL  that is defined in OCBStatus.cpp
	ElapsedTimeTimer->Enabled     = true;
	m_ReadyForPrint               = false;
	m_TanksStatus.clear();

	for(int t = FIRST_TANK_TYPE; t < LAST_TANK_TYPE; t++)
		if(m_BackEndInterface->IsChambersTank(m_Chamber, t))
			m_TanksStatus[(TTankIndex)t] = TANK_OUT;

	UpdateTanksState();

	//window is already opened
	if(Visible)  //bug 5954
		return 0;

	if(m_Modal)
	{
		return ShowModal();
	}
	else
	{
		Show();
		return Q_NO_ERROR;
	}
}