Exemple #1
0
static QString GetDescription(const EnvironmentModification &env)
{
  QString ret;

  if(env.mod == EnvMod::Append)
    ret = QFormatStr("Append %1 with %2 using %3").arg(env.name).arg(env.value).arg(ToQStr(env.sep));
  else if(env.mod == EnvMod::Prepend)
    ret = QFormatStr("Prepend %1 with %2 using %3").arg(env.name).arg(env.value).arg(ToQStr(env.sep));
  else
    ret = QFormatStr("Set %1 to %2").arg(env.name).arg(env.value);

  return ret;
}
Exemple #2
0
bool CAppParams::IsPrintingAllowed(QString& Msg)
{
  Msg = "";
  if (MRW_WithinWizard)
     Msg = QFormatStr(LOAD_STRING(IDS_NOT_COMPLETED), WIZARD_TITLE(IDS_RR_WIZARD), "Ok", WIZARD_TITLE(IDS_RR_WIZARD));
  return !(MRW_WithinWizard);
}
Exemple #3
0
/*
// Save recover parameters to a binary file
void CAppParams::SaveRecoverBinFile(void)
{
  TRecoverFileStruct RecoverFileStruct;

  CQFileWithCheckSum FileWithChecksum(QConvertPath(m_AppFilePath + RECOVER_FILE_NAME));

  memcpy(&(RecoverFileStruct.Signature),RECOVER_FILE_SIGNATURE,sizeof(RecoverFileStruct.Signature));
  RecoverFileStruct.SliceNum = SliceNumber;
  RecoverFileStruct.ZPosition = LastSliceZPosition;
  RecoverFileStruct.ModelHeight = ModelHeight.Value();
  RecoverFileStruct.LastSliceSizeType = LastSliceSizeType.Value();

  try
  {
    FileWithChecksum.BeginWrite();
    FileWithChecksum.Write((BYTE*)&RecoverFileStruct,sizeof(RecoverFileStruct));
    FileWithChecksum.EndWrite();

  } catch(EQException& Err)
    {
      QMonitor.ErrorMessage(Err.GetErrorMsg());
    }
}

// Load recover parameters from binary file
void CAppParams::LoadRecoverBinFile(void)
{
  CQFileWithCheckSum FileWithChecksum(QConvertPath(m_AppFilePath + RECOVER_FILE_NAME));
  TRecoverFileStruct RecoverFileStruct;

  try
  {
    if(FileWithChecksum.BeginRead() == Q_NO_ERROR)
    {
      FileWithChecksum.Read((BYTE *)&RecoverFileStruct,sizeof(RecoverFileStruct));
      FileWithChecksum.EndRead();

      // Assign to parameters
	  SliceNumber = RecoverFileStruct.SliceNum;
	  LastSliceZPosition = RecoverFileStruct.ZPosition;
	  ModelHeight = RecoverFileStruct.ModelHeight;
	  LastSliceSizeType = RecoverFileStruct.LastSliceSizeType;
    }
  } catch(EQException& Err)
    {
      QMonitor.ErrorMessage(Err.GetErrorMsg());
    }
}*/

bool CAppParams::IsPrintingAllowed(QString& Msg)
{
  Msg = "";
  if (MRW_WithinWizard)
     Msg = QFormatStr(LOAD_STRING(IDS_NOT_COMPLETED), WIZARD_TITLE(IDS_RR_WIZARD), "Ok", WIZARD_TITLE(IDS_RR_WIZARD));
  return !(MRW_WithinWizard);
}

void CAppParams::ChamberTankModeChangeObserver(CQParameterBase *Param,TGenericCockie Cockie)
{
	//Instance->ChamberTankRelation.DisableObservers();
	CAppParams *Instance = reinterpret_cast<CAppParams *>(Cockie);
	for(int i=0;i<NUMBER_OF_CHAMBERS_INCLUDING_WASTE*TOTAL_NUMBER_OF_CONTAINERS_INCLUDING_WASTE;i++)
		Instance->ChamberTankRelation[i] = ChamberTankRelationArr[Instance->TanksOperationMode][i];
	//Instance->ChamberTankRelation.EnableObservers();
}

void CAppParams::ChamberTankModeSaveObserver(CQParameterBase *Param,TGenericCockie Cockie)
{
    CAppParams *Instance = reinterpret_cast<CAppParams *>(Cockie);
	Instance->SaveSingleParameter(&Instance->ChamberTankRelation);
}
#ifndef PARAMS_EXP_IMP /*{*/
void CAppParams::ThermistorsModeChangeObserver(CQParameterBase *Param,TGenericCockie Cockie)
{
	CAppParams *Instance = reinterpret_cast<CAppParams *>(Cockie);

	if(Instance->ThermistorsOperationMode > SUPPORT_LOW_MODEL_HIGH_THERMISTORS_MODE)
		return;

	for(int i = 0; i < NUM_OF_CHAMBERS_THERMISTORS; i++)
		Instance->ActiveThermistors[i] = 0;

	switch(Instance->ThermistorsOperationMode)
	{
		case HIGH_THERMISTORS_MODE:
		{
			Instance->ActiveThermistors[SUPPORT_M3_CHAMBER_THERMISTOR] = 1;
		    Instance->ActiveThermistors[M1_M2_CHAMBER_THERMISTOR]      = 1;
			break;
		}

		case LOW_THERMISTORS_MODE:
		{
			Instance->ActiveThermistors[SUPPORT_CHAMBER_THERMISTOR] = 1;
			Instance->ActiveThermistors[M1_CHAMBER_THERMISTOR]      = 1;
			Instance->ActiveThermistors[M2_CHAMBER_THERMISTOR]      = 1;
			Instance->ActiveThermistors[M3_CHAMBER_THERMISTOR]      = 1;
			break;
		}

		case SUPPORT_HIGH_MODEL_LOW_THERMISTORS_MODE:
		{
			Instance->ActiveThermistors[SUPPORT_M3_CHAMBER_THERMISTOR] = 1;
			Instance->ActiveThermistors[M1_CHAMBER_THERMISTOR]         = 1;
			Instance->ActiveThermistors[M2_CHAMBER_THERMISTOR]         = 1;
			break;
		}

		case SUPPORT_LOW_MODEL_HIGH_THERMISTORS_MODE:
		{
			Instance->ActiveThermistors[SUPPORT_CHAMBER_THERMISTOR] = 1;
			Instance->ActiveThermistors[M1_M2_CHAMBER_THERMISTOR]   = 1;
			Instance->ActiveThermistors[M3_CHAMBER_THERMISTOR]      = 1;
			break;
        }
	}
	Instance->SaveSingleParameter(&Instance->ActiveThermistors);
	FrontEndInterface->UpdateStatus(FE_HEADS_OPERATION_MODE,0,true);
	CQLog::Write(LOG_TAG_GENERAL,QFormatStr("ThermistorsOperationMode value is: %s",Instance->ThermistorsOperationMode.GetValueStringList()[Instance->ThermistorsOperationMode].c_str()));
}
// Destructor
CQ2RTApplication::~CQ2RTApplication(void)
{
	CAppGlobalDefs::DeInit();

	if(CHECK_NOT_EMULATION(CAppParams::Instance()->DataCard_Emulation))
	{
		DWORD dwStatus = EdenPCI_DeInit();
		CQLog::Write(LOG_TAG_PRINT, QFormatStr("EdenPCI_DeInit(), dwStatus: %s", Stat2Str(dwStatus)));
	}

	CAppParams::DeInit();
	CModesManager::DeInit();
#ifdef OBJET_MACHINE
	CBatchNoTable::GetInstance()->DeInit();
	CActionsHistoryTable::GetInstance()->DeInit();
#endif
	DeInitLogFile();
}
Exemple #5
0
rdcstr CaptureContext::TempCaptureFilename(const rdcstr &appname)
{
  QString folder = Config().TemporaryCaptureDirectory;

  QDir dir(folder);

  if(folder.isEmpty() || !dir.exists())
  {
    dir = QDir(QDir::tempPath());

    dir.mkdir(lit("RenderDoc"));

    dir = QDir(dir.absoluteFilePath(lit("RenderDoc")));
  }

  return dir.absoluteFilePath(
      QFormatStr("%1_%2.rdc")
          .arg(appname)
          .arg(QDateTime::currentDateTimeUtc().toString(lit("yyyy.MM.dd_HH.mm.ss"))));
}
Exemple #6
0
void PythonContext::executeFile(const QString &filename)
{
  QFile f(filename);

  if(!f.exists())
  {
    emit exception(lit("FileNotFoundError"), tr("No such file or directory: %1").arg(filename), -1,
                   {});
    return;
  }

  if(f.open(QIODevice::ReadOnly | QIODevice::Text))
  {
    QByteArray py = f.readAll();

    executeString(filename, QString::fromUtf8(py));
  }
  else
  {
    emit exception(lit("IOError"), QFormatStr("%1: %2").arg(f.errorString()).arg(filename), -1, {});
  }
}
Exemple #7
0
// Interface functions to the FIFO
TQErrCode FIFOPCI_WriteAsync(PBYTE Buffer,unsigned BufferLength)
{
  DWORD dwStatus = WD_STATUS_SUCCESS;
  if (BufferLength * sizeof(DWORD) > SIZE_OF_NON_PAGED_BUFFER)
    return Q2RT_FIFOPCI_BUFFER_LENGTH_ERROR;

  if(gEmulationMode)
    return Q_NO_ERROR;

  FIFOPCI_MasterReset();
  gbFIFOStartFlag = TRUE;

#if defined(USE_KERNEL_PLUGIN) /*{*/
  dwStatus = EdenPCI_InitParamsForISR(BufferLength);
  CQLog::Write(LOG_TAG_PRINT,QFormatStr("dwStatus: %s", Stat2Str(dwStatus)));

  if (WD_STATUS_SUCCESS != dwStatus)
     return Q2RT_KERNEL_PLUGIN_FAILURE;

  /* copy the buffer to the non paged buffer */
  memcpy(EdenPCI_GetNonPagedBuffer(), Buffer, BufferLength * sizeof(DWORD));
#else /* } USE_KERNEL_PLUGIN { */

  bFIFOUnderrunError = 0;
  FIFOPCI_InitParamsForISR((PULONG) Buffer, BufferLength);

#endif /* } USE_KERNEL_PLUGIN */
  FIFOPCI_MasterReset();
  EdenPCISystem_INTREnable(LOCAL_FIFO);
  if (gFIFOFullEvent.WaitFor(FIFO_FULL_EVENT_TIMEOUT) == QLib::wrSignaled) // write GO On
     EdenPCI_WriteDWORD(AD_PCI_BAR2, FIFO_GO_REG, 0x01);
  else
     return Q2RT_FIFO_EVENT_TIMEOUT;

  return Q_NO_ERROR;
}/* FIFOPCI_WriteAsync */
QString CQ2RTApplication::GetTagDictionary()
{
  QString TagDictionary = "---------------------------------------------------------\n";
  TagDictionary += "Tags dictionary:\n";
  TagDictionary += QFormatStr("<%d>",LOG_TAG_GENERAL) + " - General\n";
  TagDictionary += QFormatStr("<%d>",LOG_TAG_PROCESS) + " - Layer process\n";
  TagDictionary += QFormatStr("<%d>",LOG_TAG_HOST_COMM) + " - Host communication\n";
  TagDictionary += QFormatStr("<%d>",LOG_TAG_PRINT) + " - Printing\n";
  TagDictionary += QFormatStr("<%d>",LOG_TAG_MOTORS) + " - Motors\n";
  TagDictionary += QFormatStr("<%d>",LOG_TAG_HEAD_HEATERS) + " - Head heating\n";
  TagDictionary += QFormatStr("<%d>",LOG_TAG_TRAY_HEATERS) + " - Tray heating\n";
  TagDictionary += QFormatStr("<%d>",LOG_TAG_UV_LAMPS) + " - UV lamps\n";
  TagDictionary += QFormatStr("<%d>",LOG_TAG_EOL) + " - End-of-liquid\n";
  TagDictionary += QFormatStr("<%d>",LOG_TAG_HEAD_FILLING) + " - Head filling\n";
  TagDictionary += QFormatStr("<%d>",LOG_TAG_HEAD_VACUUM) + " - Head vacuum\n";
  TagDictionary += QFormatStr("<%d>",LOG_TAG_AMBIENT) + " - Ambient temperature\n";
  TagDictionary += QFormatStr("<%d>",LOG_TAG_POWER) + " - Power\n";
  TagDictionary += QFormatStr("<%d>",LOG_TAG_HEAD_FILLING_THERMISTORS) + " - Head filling thermistor readings\n";
  TagDictionary += QFormatStr("<%d>",LOG_TAG_HASP) + " - HASP\n";
  TagDictionary += QFormatStr("<%d>",LOG_TAG_ROLLER_SUCTION_SYSTEM) + " - Roller Suction System\n";
  TagDictionary += QFormatStr("<%d>",LOG_TAG_RACCOON) + " - Raccoon System";
  TagDictionary += QFormatStr("<%d>",LOG_TAG_OBJET_MACHINE) + " - Objet machine log\n";
  TagDictionary += QFormatStr("<%d>",LOG_TAG_SERVICE) + " - Customer Service Log\n";
  TagDictionary += "---------------------------------------------------------";

  return TagDictionary;
}
// Application init function (override)
bool CQ2RTApplication::AppInit(void)
{
	if(QFileSystemInit() != Q_NO_ERROR)
		QMonitor.WarningMessage("Can not initialize file system");
#ifdef OS_VXWORKS
	else
	{
		// Set starting work directory
		if(QChangeDirectory(APPLICATION_FILE_PATH) != Q_NO_ERROR)
			QMonitor.WarningMessage("Can not change directory to application directory");
	}

	AppFilePath.Value() = APPLICATION_FILE_PATH;
#endif

	// Set high priority for this process (windows only)
#ifdef OS_WINDOWS
	SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS);
#endif

	// Init application parameters manager
	if(! CAppParams::Init(AppFilePath.Value() + LOAD_STRING(IDS_CONFIGS_DIRNAME)))
		return false;
	// Initialize the global error handler
	CErrorHandler::Init();

	// Initialize the log file
	InitLogFile();

	// Create a mini-sequencer object
	m_MiniSequencer = new CMiniSequencer("AppMiniSequencer");

	// Initilize the modes manager
	CModesManager::Init(CAppParams::Instance(), AppFilePath.Value(), m_MiniSequencer);

	CAppParams::Instance()->EnableDisableSaveEvents(true);

	InitFrontEnd();
	CModesManager::Instance()->EnterMode(DEFAULT_MODE, DEFAULT_MODES_DIR);
	CModesManager::Instance()->EnterMode(OPERATION_MODE_NAME(CAppParams::Instance()->PipesOperationMode), GENERAL_MODES_DIR);

	// Initilize the maintenance counters system
	CMaintenanceCounters::Init(NUM_OF_MAINTENANCE_COUNTERS, AppFilePath.Value() + LOAD_STRING(IDS_CONFIGS_DIRNAME) + "Maintenance.dat");
	SetMaintenanceCountersDefaultWarnings();
	CMaintenanceCounters::GetInstance()->LoadFromFile();
	SetMachineSinceDateParam(); //OBJET_MACHINE
	ApplyParametersChange();

	// Initialize the data card
	if(CHECK_NOT_EMULATION(CAppParams::Instance()->DataCard_Emulation))
	{
		DWORD dwStatus = EdenPCISystem_Init();
		if(dwStatus != WD_STATUS_SUCCESS)
		{
			m_IsPciCardInitialized = false;
			CQLog::Write(LOG_TAG_PRINT, QFormatStr("Data PCI card problem, dwStatus: %s", Stat2Str(dwStatus)));
			QMonitor.WarningMessage(QFormatStr("Data PCI card problem: %s", Stat2Str(dwStatus)));
		}
		else
		{
			m_IsPciCardInitialized = true;
			SetFIFOUnderrunErrorCallback(FIFOUnderrunErrorCallback, NULL);
		}
	}

	// Initialize communication related components
	InitCommComponents();

	m_LayerProcess   = new CLayerProcess;
	m_HostComm = new CHostComm;

	// Create a mini-sequencer object

	// Create other system objects

	m_MachineManager = new CMachineManager;
	m_Tester         = new CTester;

	// Initialize BIT system
	m_BITManager = new CBITManager;
	AppBIT::Init();
	RefreshBIT();

#ifdef OBJET_MACHINE
	CActionsHistoryTable::GetInstance()->Init();
#endif

	// Protect "Show incoming slices" menu
	// ------------------------------------------------------------------------
	Chasp hasp(ChaspFeature::fromFeature(INT_FROM_RESOURCE(IDN_HASP_INCOMING_SLICES_PROTECTION_FEATURE)));
	try
	{
		haspStatus status = hasp.login(HASP_OBJET_VENDOR_CODE, HASP_LOCAL_SCOPE);
		bool show = false;
		if(HASP_SUCCEEDED(status))
		{
			show = true;
		}
		else
		{
			show = false;
		}
		m_MachineManager->GetMachineSequencer()->HandleIncomingSlicesProtection(show);
	}
	__finally
	{
		hasp.logout();
	}

	// ------------------------------------------------------------------------
	 // Enable m_SolubleSupportAllowed flag
	// ------------------------------------------------------------------------

	TLicensedMaterialsList MaterialsList  = CBackEndInterface::Instance()->GetLicensedMaterialsList();

	for(TLicensedMaterialsList::iterator it = MaterialsList.begin() ; it != MaterialsList.end() ; it++)
	{
		if( it->MaterialName == "SUP707" || it->MaterialName == "SUP706" )
		{
			SetSupportReplacementAllowed(true);
			break;
		}
	}
	// ------------------------------------------------------------------------

	// ------------------------------------------------------------------------

	// Enable m_QATestsAllowed flag
	// ------------------------------------------------------------------------
	Chasp hasp1(ChaspFeature::fromFeature(INT_FROM_RESOURCE(IDN_HASP_QA_TESTS_ALLOWED_FEATURE)));
	try
	{
		haspStatus status = hasp1.login(HASP_OBJET_VENDOR_CODE, HASP_LOCAL_SCOPE);
		bool enable = false;
		if(HASP_SUCCEEDED(status))
		{
			enable = true;
		}
		else
		{
			enable = false;
		}
		SetQATestsAllowed(enable);
	}
	__finally
	{
		hasp1.logout();
	}
	// ------------------------------------------------------------------------

#ifndef EMULATION_ONLY
	//HASP feature number is generated from application version, for example Connex500 ver 57.1 - HASP feature: 571
	ChaspFeature feature = ChaspFeature::fromFeature(GetHaspFeatureNum());
	CHaspInterfaceWrapper::Init(feature, LOG_TAG_HASP, m_MachineManager->GetMachineSequencer()->HandleHaspStatus);
#else
	CHaspInterfaceWrapper::Init();
#endif

	LogThreadsProperties();

	try
	{
		m_timeoutTimer = new TTimer(NULL); //bug 5950
	}
	catch(std::bad_alloc& ba)
	{
		m_timeoutTimer = NULL;
		CQLog::Write(LOG_TAG_GENERAL, "m_timeoutTimer - Memory allocation failed: %s", ba.what());
	}

	QMonitor.SetServiceCallsCheckingMsgSafety(
	    CFrontEndInterface::IsWizardRunning,
	    CFrontEndInterface::CancelWizard);
	return true;
}
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;
	}
}
Exemple #11
0
QString PythonContext::versionString()
{
  return QFormatStr("%1.%2.%3").arg(PY_MAJOR_VERSION).arg(PY_MINOR_VERSION).arg(PY_MICRO_VERSION);
}