#include <GeomValidators_FeatureKind.h>
#include <GeomValidators_ShapeType.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
//=================================================================================================
bool BuildPlugin_ValidatorBaseForBuild::isValid(const AttributePtr& theAttribute,
{
// Get base objects list.
if(theAttribute->attributeType() != ModelAPI_AttributeSelectionList::typeId()) {
- Events_Error::send("Error: BuildPlugin_ValidatorBaseForBuild does not support attribute type \""
- + theAttribute->attributeType() + "\"\n Only \"" + ModelAPI_AttributeSelectionList::typeId()
- + "\" supported.");
+ std::string aMsg = "Error: BuildPlugin_ValidatorBaseForBuild does not support attribute type '%1'\nOnly '%2' is supported.";
+ Events_InfoMessage("BuildPlugin_Validators", aMsg).
+ arg(theAttribute->attributeType()).arg(ModelAPI_AttributeSelectionList::typeId()).send();
return false;
}
AttributeSelectionListPtr aSelectionList =
{
// Get attribute.
if(theArguments.size() != 1) {
- Events_Error::send("Error: BuildPlugin_ValidatorBaseForWire should be used only with "
- "1 parameter (ID of base objects list).");
+ std::string aMsg = "Error: BuildPlugin_ValidatorBaseForWire should be used only with 1 parameter (ID of base objects list).";
+ Events_InfoMessage("BuildPlugin_Validators", aMsg).send();
return false;
}
AttributeSelectionListPtr aSelectionList = theFeature->selectionList(theArguments.front());
{
// Get attribute.
if(theArguments.size() != 1) {
- Events_Error::send("Error: BuildPlugin_ValidatorBaseForFace should be used only with "
- "1 parameter (ID of base objects list).");
+ std::string aMsg = "Error: BuildPlugin_ValidatorBaseForFace should be used only with "
+ "1 parameter (ID of base objects list).";
+ Events_InfoMessage("BuildPlugin_Validators", aMsg).send();
return false;
}
AttributeSelectionListPtr aSelectionList = theFeature->selectionList(theArguments.front());
std::string& theError) const
{
if(theArguments.size() != 1) {
- Events_Error::send("Error: BuildPlugin_ValidatorSubShapesSelection should be used only with "
- "1 parameter(Sketch feature id).");
+ std::string aMsg = "Error: BuildPlugin_ValidatorSubShapesSelection should be used only with "
+ "1 parameter(Sketch feature id).";
+ Events_InfoMessage("BuildPlugin_Validators", aMsg).send();
return false;
}
// Get base objects list.
if(theAttribute->attributeType() != ModelAPI_AttributeSelectionList::typeId()) {
- Events_Error::send("Error: BuildPlugin_ValidatorSubShapesSelection does not support attribute type \""
- + theAttribute->attributeType() + "\"\n Only \"" + ModelAPI_AttributeSelectionList::typeId()
- + "\" supported.");
+ std::string aMsg = "Error: BuildPlugin_ValidatorSubShapesSelection does not support attribute type \""
+ "%1\"\n Only \"%2\" supported.";
+ Events_InfoMessage("BuildPlugin_Validators", aMsg).
+ arg(theAttribute->attributeType()).arg(ModelAPI_AttributeSelectionList::typeId()).send();
return false;
}
AttributeSelectionListPtr aSelectionList =
#include <ModelAPI_ResultBody.h>
#include <ModelAPI_ResultConstruction.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
#include <GeomAPI_PlanarEdges.h>
#include <GeomAPI_ShapeExplorer.h>
if(theActionId == "add_contour") {
return addContour();
} else {
- Events_Error::send("Error: Feature \"" + getKind() + "\" does not support action \"" + theActionId + "\".");
+ std::string aMsg = "Error: Feature \"%1\" does not support action \"%2\".";
+ Events_InfoMessage("BuildPlugin_Wire", aMsg).arg(getKind()).arg(theActionId).send();
}
return false;
// Get base objects list.
AttributeSelectionListPtr aSelectionList = selectionList(BASE_OBJECTS_ID());
if(aSelectionList->size() == 0) {
- Events_Error::send("Error: Empty selection list.");
+ Events_InfoMessage("BuildPlugin_Wire", "Error: Empty selection list.").send();
return false;
}
}
if(!isAnyContourAdded) {
- Events_Error::send("Error: Contours already closed or no contours found for selected edges.");
+ Events_InfoMessage("BuildPlugin_Wire",
+ "Error: Contours already closed or no contours found for selected edges.").send();
return false;
}
#include <Config_Keywords.h>
#include "Config_Common.h"
-#include <Events_Error.h>
#include <Events_InfoMessage.h>
#include <Config_Common.h>
#include <Config_ModuleReader.h>
#include <Config_FeatureReader.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
const std::string& thePluginConfig)
{
if (myFeaturesInFiles.count(theFeatureName)) {
- std::string anErrorMsg = "Can not register feature '" + theFeatureName + "' in plugin '"
- + thePluginConfig + "'. There is a feature with the same ID.";
- Events_Error::send(anErrorMsg);
+ std::string anErrorMsg = "Can not register feature '%1' in plugin '%2'."
+ " There is a feature with the same ID.";
+ Events_InfoMessage("Config_ModuleReader", anErrorMsg).arg(theFeatureName).arg(thePluginConfig).send();
return;
}
Py_XDECREF(pvalue);
Py_XDECREF(ptraceback);
}
- Events_Error::send(anErrorMsg);
+ Events_InfoMessage("Config_ModuleReader", anErrorMsg).send();
}
/* release python thread */
anErrorMsg += ": " + std::string(dlerror());
#endif
std::cerr << anErrorMsg << std::endl;
- Events_Error::send(anErrorMsg);
+ Events_InfoMessage("Config_ModuleReader", anErrorMsg).send();
}
}
#include "Config_XMLReader.h"
#include "Config_Common.h"
+#include <fstream>
+#include <ostream>
+
class Config_TSReader : public Config_XMLReader
{
public:
//******************************************************************************
//******************************************************************************
Config_Translator::Translator Config_Translator::myTranslator;
+#ifdef _DEBUG
+#ifdef MISSED_TRANSLATION
+Config_Translator::Translator Config_Translator::myMissed;
+#endif
+#endif
bool Config_Translator::load(const std::string& theFileName)
{
if (theParams.size() > 0) {
aMsg = insertParameters(aMsg, theParams);
}
+#ifdef _DEBUG
+#ifdef MISSED_TRANSLATION
+ myMissed[theContext][theMessage] = "";
+#endif
+#endif
return aMsg;
}
+
+#ifdef _DEBUG
+#ifdef MISSED_TRANSLATION
+void Config_Translator::saveMissedTranslations()
+{
+ if (myMissed.size() == 0)
+ return;
+
+ char* aPath = getenv("ROOT_DIR");
+#ifdef WIN32
+ std::string aFile = aPath + std::string("\\MissedTranslation.ts");
+#else
+ std::string aFile = aPath + std::string("/MissedTranslation.ts");
+#endif
+ std::ofstream oFStream;
+
+ // Delete old file
+ int aa = remove(aFile.c_str());
+
+ oFStream.open(aFile, std::ofstream::out | std::ofstream::app);
+ if (oFStream.is_open()) {
+ Translator::const_iterator aContIt;
+ Dictionary::const_iterator aDictIt;
+ std::string aContext;
+ std::string aSrc;
+ Dictionary aDict;
+
+ oFStream << "<TS version=\"2.0\">" << std::endl;
+ for(aContIt = myMissed.cbegin(); aContIt != myMissed.cend(); aContIt++) {
+ oFStream << "<context>" << std::endl;
+
+ aContext = aContIt->first;
+ oFStream << " <name>" << aContext << "</name>" << std::endl;
+
+ aDict = aContIt->second;
+ for(aDictIt = aDict.cbegin(); aDictIt != aDict.cend(); aDictIt++) {
+ oFStream << " <message>" << std::endl;
+ aSrc = aDictIt->first;
+
+ oFStream << " <source>" << aSrc << "</source>" << std::endl;
+ oFStream << " <translation>" << "</translation>" << std::endl;
+
+ oFStream << " </message>" << std::endl;
+ }
+ oFStream << "</context>" << std::endl;
+ }
+
+ oFStream << "</TS>" << std::endl;
+ oFStream.close();
+ }
+}
+#endif
+#endif
#include <string>
#include <map>
+#define MISSED_TRANSLATION
+
/**
* \class Config_Translator
* \ingroup Config
const std::string& theMessage,
const std::list<std::string>& theParams = std::list<std::string>());
+#ifdef _DEBUG
+#ifdef MISSED_TRANSLATION
+ static CONFIG_EXPORT void saveMissedTranslations();
+#endif
+#endif
+
+
private:
static Translator myTranslator;
+
+#ifdef _DEBUG
+#ifdef MISSED_TRANSLATION
+ static Translator myMissed;
+#endif
+#endif
};
#endif
\ No newline at end of file
#include <Config_PropManager.h>
#include <Events_Loop.h>
-#include <Events_Error.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <Config_PropManager.h>
#include <Events_Loop.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
myDocumentPath = prefix + FSEP + theXmlFileName;
std::ifstream aTestFile(myDocumentPath);
if (!aTestFile)
- Events_Error::send("Unable to open " + myDocumentPath);
+ Events_InfoMessage("Config_XMLReader", "Unable to open %1").arg(myDocumentPath).send();
aTestFile.close();
}
#include <ModelAPI_Feature.h>
#include <ModelAPI_ResultConstruction.h>
-#include <Events_Error.h>
-
#include <GeomValidators_BodyShapes.h>
#include <GeomValidators_FeatureKind.h>
#include <GeomValidators_ShapeType.h>
#include <GeomAbs_SurfaceType.hxx>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
#include <QString>
#include <QMap>
if (MyFaceTypes.find(aType) != MyFaceTypes.end())
return MyFaceTypes[aType];
- Events_Error::send("Face type defined in XML is not implemented!");
+ Events_InfoMessage("GeomValidators_Face", "Face type defined in XML is not implemented!").send();
return GeomAbs_Plane;
}
#include <ModelAPI_AttributeSelectionList.h>
#include <ModelAPI_AttributeReference.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
#include <string>
#include <map>
if (MyShapeTypes.find(aType) != MyShapeTypes.end())
return MyShapeTypes[aType];
- Events_Error::send("Shape type defined in XML is not implemented!");
+ Events_InfoMessage("Shape type defined in XML is not implemented!").send();
return AnyShape;
}
#include <ModelAPI_Result.h>
#include <Events_Message.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
#include <memory>
Events_Loop::loop()->send(aMsg);
} else if (theMessage.get()) {
- Events_Error::send(
- std::string("InitializationPlugin_Plugin::processEvent: unhandled message caught: ")
- + theMessage->eventID().eventText());
+ Events_InfoMessage("InitializationPlugin_Plugin",
+ "InitializationPlugin_Plugin::processEvent: unhandled message caught: %1")
+ .arg(theMessage->eventID().eventText()).send();
}
}
#include <ModelAPI_Tools.h>
#include <GeomAPI_Shape.h>
#include <GeomAPI_PlanarEdges.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
#include <TNaming_Selector.hxx>
#include <TNaming_NamedShape.hxx>
if (aResult) {
aContext = aResult->shape()->impl<TopoDS_Shape>();
} else {
- Events_Error::send("A result with shape is expected");
+ Events_InfoMessage("Model_AttributeSelection", "A result with shape is expected").send();
return;
}
}
#include <GeomData_Point2D.h>
#include <GeomData_Dir.h>
#include <Events_Loop.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
#include <TDataStd_Name.hxx>
#include <TDataStd_AsciiString.hxx>
anAttr->setObject(myObject);
anAttr->setID(theID);
} else {
- Events_Error::send("Can not create unknown type of attribute " + theAttrType);
+ Events_InfoMessage("Model_Data", "Can not create unknown type of attribute %1").arg(theAttrType).send();
}
return aResult;
}
{
execState(ModelAPI_StateExecFailed);
if (theSend) {
- Events_Error::send(theError);
+ Events_InfoMessage("Model_Data", theError).send();
}
TDataStd_AsciiString::Set(myLab, theError.c_str());
}
#include <ModelAPI_ResultBody.h>
#include <Events_Loop.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
#include <TDataStd_Integer.hxx>
#include <TDataStd_Comment.hxx>
aStatus = anApp->Open(aPath, aLoaded);
} catch (Standard_Failure) {
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- Events_Error::send(
- std::string("Exception in opening of document: ") + aFail->GetMessageString());
+ Events_InfoMessage("Model_Document",
+ "Exception in opening of document: %1").arg(aFail->GetMessageString()).send();
return false;
}
bool isError = aStatus != PCDM_RS_OK;
if (isError) {
switch (aStatus) {
case PCDM_RS_UnknownDocument:
- Events_Error::send(std::string("Can not open document"));
+ Events_InfoMessage("Model_Document", "Can not open document").send();
break;
case PCDM_RS_AlreadyRetrieved:
- Events_Error::send(std::string("Can not open document: already opened"));
+ Events_InfoMessage("Model_Document", "Can not open document: already opened").send();
break;
case PCDM_RS_AlreadyRetrievedAndModified:
- Events_Error::send(
- std::string("Can not open document: already opened and modified"));
+ Events_InfoMessage("Model_Document",
+ "Can not open document: already opened and modified").send();
break;
case PCDM_RS_NoDriver:
- Events_Error::send(std::string("Can not open document: driver library is not found"));
+ Events_InfoMessage("Model_Document", "Can not open document: driver library is not found").send();
break;
case PCDM_RS_UnknownFileDriver:
- Events_Error::send(std::string("Can not open document: unknown driver for opening"));
+ Events_InfoMessage("Model_Document", "Can not open document: unknown driver for opening").send();
break;
case PCDM_RS_OpenError:
- Events_Error::send(std::string("Can not open document: file open error"));
+ Events_InfoMessage("Model_Document", "Can not open document: file open error").send();
break;
case PCDM_RS_NoVersion:
- Events_Error::send(std::string("Can not open document: invalid version"));
+ Events_InfoMessage("Model_Document", "Can not open document: invalid version").send();
break;
case PCDM_RS_NoModel:
- Events_Error::send(std::string("Can not open document: no data model"));
+ Events_InfoMessage("Model_Document", "Can not open document: no data model").send();
break;
case PCDM_RS_NoDocument:
- Events_Error::send(std::string("Can not open document: no document inside"));
+ Events_InfoMessage("Model_Document", "Can not open document: no document inside").send();
break;
case PCDM_RS_FormatFailure:
- Events_Error::send(std::string("Can not open document: format failure"));
+ Events_InfoMessage("Model_Document", "Can not open document: format failure").send();
break;
case PCDM_RS_TypeNotFoundInSchema:
- Events_Error::send(std::string("Can not open document: invalid object"));
+ Events_InfoMessage("Model_Document", "Can not open document: invalid object").send();
break;
case PCDM_RS_UnrecognizedFileFormat:
- Events_Error::send(std::string("Can not open document: unrecognized file format"));
+ Events_InfoMessage("Model_Document", "Can not open document: unrecognized file format").send();
break;
case PCDM_RS_MakeFailure:
- Events_Error::send(std::string("Can not open document: make failure"));
+ Events_InfoMessage("Model_Document", "Can not open document: make failure").send();
break;
case PCDM_RS_PermissionDenied:
- Events_Error::send(std::string("Can not open document: permission denied"));
+ Events_InfoMessage("Model_Document", "Can not open document: permission denied").send();
break;
case PCDM_RS_DriverFailure:
- Events_Error::send(std::string("Can not open document: driver failure"));
+ Events_InfoMessage("Model_Document", "Can not open document: driver failure").send();
break;
default:
- Events_Error::send(std::string("Can not open document: unknown error"));
+ Events_InfoMessage("Model_Document", "Can not open document: unknown error").send();
break;
}
}
aStatus = anApp->SaveAs(myDoc, aPath);
} catch (Standard_Failure) {
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- Events_Error::send(
- std::string("Exception in saving of document: ") + aFail->GetMessageString());
+ Events_InfoMessage("Model_Document",
+ "Exception in saving of document: %1").arg(aFail->GetMessageString()).send();
return false;
}
bool isDone = aStatus == PCDM_SS_OK || aStatus == PCDM_SS_No_Obj;
if (!isDone) {
switch (aStatus) {
case PCDM_SS_DriverFailure:
- Events_Error::send(std::string("Can not save document: save driver-library failure"));
+ Events_InfoMessage("Model_Document", "Can not save document: save driver-library failure").send();
break;
case PCDM_SS_WriteFailure:
- Events_Error::send(std::string("Can not save document: file writing failure"));
+ Events_InfoMessage("Model_Document", "Can not save document: file writing failure").send();
break;
case PCDM_SS_Failure:
default:
- Events_Error::send(std::string("Can not save document"));
+ Events_InfoMessage("Model_Document", "Can not save document").send();
break;
}
}
aFile.Copy(aDestination);
theResults.push_back(aDestinationDir.ToCString());
} else {
- Events_Error::send(
- std::string("Can not open file ") + aSubPath.ToCString() + " for saving");
+ Events_InfoMessage("Model_Document",
+ "Can not open file %1 for saving").arg(aSubPath.ToCString()).send();
}
}
} else { // simply save opened document
#include <ModelAPI_Tools.h>
#include <Events_Loop.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
#include <TDataStd_Integer.hxx>
#include <TDataStd_Comment.hxx>
}
if (!theRefs.empty() && isSendError) {
- Events_Error::send(
- "Feature '" + theFeature->data()->name() + "' is used and can not be deleted");
+ Events_InfoMessage("Model_Objects",
+ "Feature '%1' is used and can not be deleted").arg(theFeature->data()->name()).send();
}
}
if (!aPassedMovedFrom || !aPassedMovedTo) {// not found: unknown situation
if (!aPassedMovedFrom) {
static std::string aMovedFromError("The moved feature is not found");
- Events_Error::send(aMovedFromError);
+ Events_InfoMessage("Model_Objects", aMovedFromError).send();
} else {
static std::string aMovedToError("The 'after' feature for movement is not found");
- Events_Error::send(aMovedToError);
+ Events_InfoMessage("Model_Objects", aMovedToError).send();
}
return;
}
TCollection_AsciiString(Handle(TDataStd_Comment)::DownCast(aLabIter.Value())->Get())
.ToCString(), anOwner);
if (!aFeature.get()) { // somethig is wrong, most probably, the opened document has invalid structure
- Events_Error::send("Invalid type of object in the document");
+ Events_InfoMessage("Model_Objects", "Invalid type of object in the document").send();
aLabIter.Value()->Label().ForgetAllAttributes();
continue;
}
theFeature->attributeChanged("expression"); // just produce a value
break;
} else {
- Events_Error::send(std::string("Unknown type of result is found in the document:") +
- TCollection_AsciiString(aGroup->Get()).ToCString());
+ Events_InfoMessage("Model_Objects", "Unknown type of result is found in the document:")
+ .arg(TCollection_AsciiString(aGroup->Get()).ToCString()).send();
}
}
if (aNewBody && !aNewBody->data()->isDeleted()) {
#include "Model_SelectionNaming.h"
#include "Model_Document.h"
#include <ModelAPI_Feature.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
#include <TopoDS_Iterator.hxx>
#include <TopoDS.hxx>
}
if (MyShapeTypes.find(theType) != MyShapeTypes.end())
return MyShapeTypes[theType];
- Events_Error::send("Shape type defined in XML is not implemented!");
+ Events_InfoMessage("Model_SelectionNaming", "Shape type defined in XML is not implemented!").send();
return TopAbs_SHAPE;
}
#include <Model_Validator.h>
#include <ModelAPI_Events.h>
#include <Events_Loop.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
#include <Config_FeatureMessage.h>
#include <Config_AttributeMessage.h>
#include <Config_ValidatorMessage.h>
if (myPlugins.find(theFeatureID) != myPlugins.end()) {
std::pair<std::string, std::string>& aPlugin = myPlugins[theFeatureID]; // plugin and doc kind
if (!aPlugin.second.empty() && aPlugin.second != theDocOwner->kind()) {
- Events_Error::send(
- string("Feature '") + theFeatureID + "' can be created only in document '"
- + aPlugin.second + "' by the XML definition");
+ Events_InfoMessage("Model_Session",
+ "Feature '%1' can be created only in document '%2' by the XML definition")
+ .arg(theFeatureID).arg(aPlugin.second).send();
return FeaturePtr();
}
myCurrentPluginName = aPlugin.first;
if (myPluginObjs.find(myCurrentPluginName) != myPluginObjs.end()) {
FeaturePtr aCreated = myPluginObjs[myCurrentPluginName]->createFeature(theFeatureID);
if (!aCreated) {
- Events_Error::send(
- string("Can not initialize feature '") + theFeatureID + "' in plugin '"
- + myCurrentPluginName + "'");
+ Events_InfoMessage("Model_Session",
+ "Can not initialize feature '%1' in plugin '%2'")
+ .arg(theFeatureID).arg(myCurrentPluginName).send();
}
return aCreated;
} else {
- Events_Error::send(string("Can not load plugin '") + myCurrentPluginName + "'");
+ Events_InfoMessage("Model_Session","Can not load plugin '%1'").arg(myCurrentPluginName).send();
}
} else {
- Events_Error::send(string("Feature '") + theFeatureID + "' not found in any plugin");
+ Events_InfoMessage("Model_Session","Feature '%1' not found in any plugin").arg(theFeatureID).send();
}
return FeaturePtr(); // return nothing
}
} else { // create/update/delete
if (myCheckTransactions && !isOperation())
- Events_Error::send("Modification of data structure outside of the transaction");
+ Events_InfoMessage("Model_Session", "Modification of data structure outside of the transaction").send();
// if part is deleted, make the root as the current document (on undo of Parts creations)
static const Events_ID kDeletedEvent = Events_Loop::eventByName(EVENT_OBJECT_DELETED);
if (theMessage->eventID() == kDeletedEvent) {
#include <GeomDataAPI_Point2D.h>
#include <Events_Loop.h>
#include <Events_LongOp.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
#include <Config_PropManager.h>
using namespace std;
} else {
int aCount = myProcessed[theFeature];
if (aCount > 100) { // too many repetition of processing (in VS it may crash on 330 with stack overflow)
- Events_Error::send(
- "Feature '" + theFeature->data()->name() + "' is updated in infinitive loop");
+ Events_InfoMessage("Model_Update",
+ "Feature '%1' is updated in infinitive loop").arg(theFeature->data()->name()).send();
return false;
}
myProcessed[theFeature] = aCount + 1;
}
} catch(...) {
aState = ModelAPI_StateExecFailed;
- Events_Error::send(
- "Feature " + theFeature->getKind() + " has failed during the execution");
+ Events_InfoMessage("Model_Update",
+ "Feature %1 has failed during the execution").arg(theFeature->getKind()).send();
}
// The macro feature has to be deleted in any case even its execution is failed
myWaitForFinish.insert(theFeature);
#include <ModelAPI_Feature.h>
#include <Model_Data.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
void Model_ValidatorsFactory::registerValidator(const std::string& theID,
ModelAPI_Validator* theValidator)
{
if (myIDs.find(theID) != myIDs.end()) {
- Events_Error::send(std::string("Validator ") + theID + " is already registered");
+ Events_InfoMessage("Model_Validator", "Validator %1 is already registered").arg(theID).send();
} else {
myIDs[theID] = theValidator;
}
AttrValidators::const_iterator aValidatorsIt = aFeatureIt->second.cbegin();
for (; aValidatorsIt != aFeatureIt->second.cend(); aValidatorsIt++) {
if (!validator(aValidatorsIt->first)) {
- Events_Error::send(std::string("Validator ") + aValidatorsIt->first + " was not registered");
+ Events_InfoMessage("Model_Validator", "Validator %1 was not registered")
+ .arg(aValidatorsIt->first).send();
} else {
theValidators.push_back(std::make_pair(aValidatorsIt->first, aValidatorsIt->second));
}
AttrValidators::const_iterator aValidatorsIt = anAttrIt->second.cbegin();
for (; aValidatorsIt != anAttrIt->second.cend(); aValidatorsIt++) {
if (!validator(aValidatorsIt->first)) {
- Events_Error::send(std::string("Validator ") + aValidatorsIt->first + " was not registered");
+ Events_InfoMessage("Model_Validator", "Validator %1 was not registered")
+ .arg(aValidatorsIt->first).send();
} else {
theValidators.push_back(std::make_pair(aValidatorsIt->first, aValidatorsIt->second));
}
#include <ModelAPI_Attribute.h>
#include <ModelAPI_Data.h>
//#include <ModelAPI_AttributeValidator.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
void ModuleBase_FilterFactory::registerFilter(const std::string& theID,
ModuleBase_Filter* theFilter)
{
if (myIDs.find(theID) != myIDs.end()) {
- Events_Error::send(std::string("Filter ") + theID + " is already registered");
+ Events_InfoMessage("ModuleBase_FilterFactory", "Filter %1 is already registered").arg(theID).send();
} else {
myIDs[theID] = theFilter;
}
std::map<std::string, ModuleBase_Filter*>::const_iterator aFound = myIDs.find(
aValIter->first);
if (aFound == myIDs.end()) {
- Events_Error::send(std::string("Filter ") + aValIter->first + " was not registered");
+ Events_InfoMessage("ModuleBase_FilterFactory", "Filter %1 was not registered")
+ .arg(aValIter->first).send();
} else {
ModuleBase_Filter* aFilter = aFound->second;
aFilter->setArguments(aValIter->second);
#include <ModelAPI_ResultConstruction.h>
#include <GeomAPI_PlanarEdges.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
#include <Events_Loop.h>
#include <BRep_Builder.hxx>
AIS_Shape::Compute(thePresentationManager, thePresentation, theMode);
if (!aReadyToDisplay) {
- Events_Error::throwException("An empty AIS presentation: ModuleBase_ResultPrs");
+ Events_InfoMessage("ModuleBase_ResultPrs", "An empty AIS presentation: ModuleBase_ResultPrs").send();
static const Events_ID anEvent = Events_Loop::eventByName(EVENT_EMPTY_AIS_PRESENTATION);
ModelAPI_EventCreator::get()->sendUpdated(myResult, anEvent);
}
#include <TopoDS_Iterator.hxx>
#include <GeomDataAPI_Point2D.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
#include <Config_PropManager.h>
QString aType = theType.toLower();
if (MyShapeTypes.contains(aType))
return MyShapeTypes[aType];
- Events_Error::send("Shape type defined in XML is not implemented!");
+ Events_InfoMessage("ModuleBase_Tools", "Shape type defined in XML is not implemented!").send();
return TopAbs_SHAPE;
}
#include <Config_WidgetAPI.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
#include <QStringList>
if (!myPanelToCreator.contains(aKey))
myPanelToCreator[aKey] = theCreator;
else {
- Events_Error::send("The" + aKey + " panel XML definition has been already \
-used by another widget creator");
+ Events_InfoMessage("ModuleBase_WidgetCreatorFactory",
+ "The %1 panel XML definition has been already used by another widget creator").arg(aKey).send();
}
}
if (!myCreators.contains(aKey))
myCreators[aKey] = theCreator;
else {
- Events_Error::send("The" + aKey + " widget XML definition has been already \
-used by another widget creator");
+ Events_InfoMessage("ModuleBase_WidgetCreatorFactory",
+ "The %1 widget XML definition has been already used by another widget creator").arg(aKey).send();
}
}
if (!myPageToCreator.contains(aKey))
myPageToCreator[aKey] = theCreator;
else {
- Events_Error::send("The" + aKey + " page XML definition has been already \
-used by another widget creator");
+ Events_InfoMessage("ModuleBase_WidgetCreatorFactory",
+ "The %1 page XML definition has been already used by another widget creator").arg(aKey).send();
}
}
}
#include <ModelAPI_AttributeValidator.h>
#include <Config_WidgetAPI.h>
-#include <Events_Error.h>
#include <GeomAPI_Shape.h>
#include <ParametersPlugin_Parameter.h>
#include <ParametersPlugin_PyInterp.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
#include <ModelAPI_AttributeDouble.h>
#include <ModelAPI_AttributeInteger.h>
} else if (theMessage->eventID() == kReplaceParameterEvent) {
processReplaceParameterEvent(theMessage);
} else {
- Events_Error::send(std::string("ParametersPlugin python interpreter, unhandled message caught: ")
- + theMessage->eventID().eventText());
+ Events_InfoMessage("ParametersPlugin_EvalListener",
+ "ParametersPlugin python interpreter, unhandled message caught: ")
+ .arg(theMessage->eventID().eventText()).send();
}
}
#include <SketchSolver_ConstraintMovement.h>
#ifdef _DEBUG
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
#include <ModelAPI_AttributeRefList.h>
#include <ModelAPI_ResultConstruction.h>
#include <SketchSolver_Error.h>
ResultConstructionPtr aRC =
std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aRefAttr->object());
if (!aRC)
- Events_Error::send(SketchSolver_Error::NEED_OBJECT_NOT_FEATURE(), this);
+ Events_InfoMessage("SketchSolver_Builder", SketchSolver_Error::NEED_OBJECT_NOT_FEATURE(), this).send();
}
continue;
}
ResultConstructionPtr aRC =
std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(*aListIter);
if (*aListIter && !aRC)
- Events_Error::send(SketchSolver_Error::NEED_OBJECT_NOT_FEATURE(), this);
+ Events_InfoMessage("SketchSolver_Builder", SketchSolver_Error::NEED_OBJECT_NOT_FEATURE(), this).send();
}
}
}
#include <SketchSolver_Error.h>
#include <SketchSolver_Manager.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
#include <Events_Loop.h>
#include <ModelAPI_AttributeString.h>
#include <ModelAPI_Events.h>
if (!aConstraint->error().empty()) {
if (aConstraint->error() == SketchSolver_Error::NOT_INITIALIZED())
return false; // some attribute are not initialized yet, don't show message
- Events_Error::send(aConstraint->error(), this);
+ Events_InfoMessage("SketchSolver_Group", aConstraint->error(), this).send();
}
myConstraints[theConstraint] = aConstraint;
#include <TopExp.hxx>
#include <BRep_Tool.hxx>
-#include <Events_Error.h>
-
#define PI 3.1415926535897932
IMPLEMENT_STANDARD_HANDLE(SketcherPrs_Angle, AIS_AngleDimension_);
#include <GeomAPI_Dir.h>
#include <GeomAPI_Pnt2d.h>
-#include <Events_Error.h>
-
#include <SketchPlugin_Constraint.h>
#include <Graphic3d_AspectMarker3d.hxx>
#include <SketchPlugin_Constraint.h>
-#include "Events_Error.h"
-
#include <Graphic3d_AspectLine3d.hxx>
#include <Prs3d_Root.hxx>
#include "SketcherPrs_DimensionStyleListener.h"
#include "SketcherPrs_Tools.h"
-#include <Events_Error.h>
#include <Events_Loop.h>
SketcherPrs_DimensionStyleListener::SketcherPrs_DimensionStyleListener()
#include <SketchPlugin_Constraint.h>
-#include "Events_Error.h"
-
#include <Graphic3d_AspectLine3d.hxx>
#include <Prs3d_Root.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Prs3d_Root.hxx>
-#include <Events_Error.h>
-
IMPLEMENT_STANDARD_HANDLE(SketcherPrs_HVDirection, SketcherPrs_SymbolPrs);
IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_HVDirection, SketcherPrs_SymbolPrs);
#include <SketchPlugin_Point.h>
#include <SketchPlugin_Circle.h>
-#include <Events_Error.h>
-
#include <GeomDataAPI_Point2D.h>
#include <GeomAPI_Pnt.h>
#include <GeomAPI_XYZ.h>
#include <SketchPlugin_Constraint.h>
-#include "Events_Error.h"
-
#include <Graphic3d_AspectLine3d.hxx>
#include <Prs3d_Root.hxx>
#include <SketchPlugin_Circle.h>
#include <SketchPlugin_Arc.h>
-#include <Events_Error.h>
-
#include <GeomDataAPI_Point2D.h>
#include <GeomAPI_Pnt2d.h>
#include <GeomAPI_Circ.h>
#include <GeomAPI_Vertex.h>
#include <GeomAPI_Curve.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
#include <Graphic3d_ArrayOfSegments.hxx>
#include <Graphic3d_BndBox4f.hxx>
// The icon for constraint is not found
static const char aMsg[] = "Error! constraint images are not found";
cout<<aMsg<<endl;
- Events_Error::send(aMsg);
+ Events_InfoMessage("SketcherPrs_SymbolPrs", aMsg).send();
myIconsMap[iconName()] = Handle(Image_AlienPixMap)();
return Handle(Image_AlienPixMap)();
}
#include <XGUI_SelectionMgr.h>
#include <Events_Loop.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
#include <ModelAPI_Session.h>
#include <ModelAPI_Events.h>
if (myShortcuts.contains(theKeySequence)) {
QString aMessage = tr("Shortcut %1 is already defined. Ignore.");
aMessage = aMessage.arg(theKeySequence.toString());
- Events_Error::send(aMessage.toStdString());
+ Events_InfoMessage("XGUI_ActionsMgr", aMessage.toStdString()).send();
return QKeySequence();
}
myShortcuts.append(theKeySequence);
#include <ModelAPI_Session.h>
#include <Config_PropManager.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
#include <vector>
#include <QColor>
// all AIS objects, where the color is not set, are in black.
// The color should be defined in XML or set in the attribute
theColor = Config_PropManager::color("Visualization", "object_default_color", "#000000");
- Events_Error::send("A default color is not defined in the preferences for this kind of result");
+ Events_InfoMessage("XGUI_CustomPrs",
+ "A default color is not defined in the preferences for this kind of result").send();
}
}
#include <Config_DataModelReader.h>
#include <Events_Loop.h>
-#include <Events_Error.h>
#include <QIcon>
#include <QBrush>
#include <ModelAPI_Session.h>
#include <ModelAPI_Document.h>
#include <ModelAPI_Tools.h>
-#include <Events_Error.h>
#include <ModuleBase_Tools.h>
#include <ModelAPI_ResultPart.h>
#include <ModelAPI_CompositeFeature.h>
#include <ModelAPI_Tools.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
#include <GeomAPI_Shape.h>
QString aErrMsg(QObject::tr("Selected parameter can not be renamed to: %1. \
There is a parameter with the same name. Its value is: %2.").arg(qPrintable(theName)).arg(aValue));
// We can not use here a dialog box for message - it will crash editing process in ObjectBrowser
- Events_Error::send(aErrMsg.toStdString());
+ Events_InfoMessage("XGUI_Tools", aErrMsg.toStdString()).send();
return false;
}
}
//#include <PartSetPlugin_Part.h>
#include <Events_Loop.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
#include <Events_LongOp.h>
#include <ModuleBase_FilterFactory.h>
//******************************************************
XGUI_Workshop::~XGUI_Workshop(void)
{
+#ifdef _DEBUG
+#ifdef MISSED_TRANSLATION
+ // Save Missed translations
+ Config_Translator::saveMissedTranslations();
+#endif
+#endif
+
delete myDisplayer;
delete myDataModelXMLReader;
}
std::string aFeatureKind = aFeature->getKind();
foreach (ModuleBase_ModelWidget* aWidget, aWidgets) {
if (!aWidget->attributeID().empty() && !aFeature->attribute(aWidget->attributeID()).get()) {
- std::string anErrorMsg = "The feature '" + aFeatureKind + "' has no attribute '"
- + aWidget->attributeID() + "' used by widget '"
- + aWidget->metaObject()->className() + "'.";
- Events_Error::send(anErrorMsg);
+ std::string anErrorMsg = "The feature '%1' has no attribute '%2' used by widget '%3'.";
+ Events_InfoMessage("XGUI_Workshop", anErrorMsg)
+ .arg(aFeatureKind).arg(aWidget->attributeID()).arg(aWidget->metaObject()->className()).send();
myPropertyPanel->cleanContent();
return;
}
if (!err.isEmpty()) {
if (desktop()) {
- Events_Error::send(err.toStdString());
+ Events_InfoMessage("XGUI_Workshop", err.toStdString()).send();
} else {
qWarning(qPrintable(err));
}
#include <ModelAPI_Tools.h>
#include <Events_Loop.h>
-#include <Events_Error.h>
#include <Events_LongOp.h>
#include <ModuleBase_IWorkshop.h>
{
//Initialize event listening
Events_Loop* aLoop = Events_Loop::loop();
- //aLoop->registerListener(this, Events_Error::errorID()); //!< Listening application errors.
aLoop->registerListener(this, Events_InfoMessage::errorID()); //!< Listening application errors.
aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OPERATION_LAUNCHED));
aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
<context>
<name>XGUI_DataTree</name>
<message>
- <location filename="XGUI_ObjectsBrowser.cpp" line="161"/>
+ <location filename="XGUI_ObjectsBrowser.cpp" line="160"/>
<source>History change</source>
<translation type="unfinished"></translation>
</message>
<context>
<name>XGUI_ObjectsBrowser</name>
<message>
- <location filename="XGUI_ObjectsBrowser.cpp" line="343"/>
+ <location filename="XGUI_ObjectsBrowser.cpp" line="342"/>
<source>Part set</source>
<translation type="unfinished"></translation>
</message>
<context>
<name>XGUI_Workshop</name>
<message>
- <location filename="XGUI_Workshop.cpp" line="302"/>
- <location filename="XGUI_Workshop.cpp" line="356"/>
+ <location filename="XGUI_Workshop.cpp" line="309"/>
+ <location filename="XGUI_Workshop.cpp" line="363"/>
<source>Undo</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="303"/>
- <location filename="XGUI_Workshop.cpp" line="356"/>
+ <location filename="XGUI_Workshop.cpp" line="310"/>
+ <location filename="XGUI_Workshop.cpp" line="363"/>
<source>Undo last command</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="306"/>
+ <location filename="XGUI_Workshop.cpp" line="313"/>
<source>INF_DESK_TOOLBAR_STANDARD</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="312"/>
- <location filename="XGUI_Workshop.cpp" line="365"/>
+ <location filename="XGUI_Workshop.cpp" line="319"/>
+ <location filename="XGUI_Workshop.cpp" line="372"/>
<source>Redo</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="312"/>
- <location filename="XGUI_Workshop.cpp" line="365"/>
+ <location filename="XGUI_Workshop.cpp" line="319"/>
+ <location filename="XGUI_Workshop.cpp" line="372"/>
<source>Redo last command</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="329"/>
+ <location filename="XGUI_Workshop.cpp" line="336"/>
<source>Export native...</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="329"/>
+ <location filename="XGUI_Workshop.cpp" line="336"/>
<source>Export the current document into a native file</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="334"/>
+ <location filename="XGUI_Workshop.cpp" line="341"/>
<source>Import native...</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="334"/>
+ <location filename="XGUI_Workshop.cpp" line="341"/>
<source>Import native file</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="346"/>
- <location filename="XGUI_Workshop.cpp" line="835"/>
+ <location filename="XGUI_Workshop.cpp" line="353"/>
+ <location filename="XGUI_Workshop.cpp" line="841"/>
<source>Save</source>
<extracomment>Title of the dialog which asks user if he wants to save study in existing non-empty folder</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="346"/>
+ <location filename="XGUI_Workshop.cpp" line="353"/>
<source>Save the document</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="351"/>
+ <location filename="XGUI_Workshop.cpp" line="358"/>
<source>Save as...</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="351"/>
+ <location filename="XGUI_Workshop.cpp" line="358"/>
<source>Save the document into a file</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="379"/>
+ <location filename="XGUI_Workshop.cpp" line="386"/>
<source>Open...</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="379"/>
+ <location filename="XGUI_Workshop.cpp" line="386"/>
<source>Open a new document</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="383"/>
+ <location filename="XGUI_Workshop.cpp" line="390"/>
<source>Preferences</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="383"/>
+ <location filename="XGUI_Workshop.cpp" line="390"/>
<source>Edit preferences</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="387"/>
+ <location filename="XGUI_Workshop.cpp" line="394"/>
<source>Exit</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="387"/>
+ <location filename="XGUI_Workshop.cpp" line="394"/>
<source>Exit application</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="697"/>
- <location filename="XGUI_Workshop.cpp" line="753"/>
+ <location filename="XGUI_Workshop.cpp" line="703"/>
+ <location filename="XGUI_Workshop.cpp" line="759"/>
<source>Save current file</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="698"/>
+ <location filename="XGUI_Workshop.cpp" line="704"/>
<source>The document is modified, save before opening another?</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="709"/>
+ <location filename="XGUI_Workshop.cpp" line="715"/>
<source>Select directory</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="714"/>
+ <location filename="XGUI_Workshop.cpp" line="720"/>
<source>Warning</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="714"/>
+ <location filename="XGUI_Workshop.cpp" line="720"/>
<source>Unable to open the file.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="753"/>
+ <location filename="XGUI_Workshop.cpp" line="759"/>
<source>The document is modified, save before exit?</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="819"/>
+ <location filename="XGUI_Workshop.cpp" line="825"/>
<source>Select directory to save files...</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="821"/>
+ <location filename="XGUI_Workshop.cpp" line="827"/>
<source>Directories (*)</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="836"/>
+ <location filename="XGUI_Workshop.cpp" line="842"/>
<source>The directory already contains some files, save anyway?</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="969"/>
+ <location filename="XGUI_Workshop.cpp" line="975"/>
<source>Information about module "%1" doesn't exist.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="1100"/>
+ <location filename="XGUI_Workshop.cpp" line="1106"/>
<source>Object browser</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="1432"/>
+ <location filename="XGUI_Workshop.cpp" line="1438"/>
<source>Unused features are the following: %1.
These features will be deleted.
Would you like to continue?</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="1470"/>
+ <location filename="XGUI_Workshop.cpp" line="1476"/>
<source>All features are relevant, there is nothing to be deleted</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="1970"/>
+ <location filename="XGUI_Workshop.cpp" line="1976"/>
<source>Find results</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="1971"/>
+ <location filename="XGUI_Workshop.cpp" line="1977"/>
<source>Results not found</source>
<translation type="unfinished"></translation>
</message>