#include <string>
#include <map>
-#define MISSED_TRANSLATION
+//#define MISSED_TRANSLATION
/**
* \class Config_Translator
kResultBodyType = "Bodies"
aPartSize = self.Part.size(kResultBodyType)
if aPartSize == 0:
- EventsAPI.Events_Error_send("No results in the active document")
+ EventsAPI.Events_InfoMessage("ExportFeature","No results in the active document").send()
return
anObjList = [self.Part.object(kResultBodyType, idx) for idx in xrange(aPartSize)]
Events_MessageGroup.h
Events_Listener.h
Events_Loop.h
- Events_Error.h
Events_LongOp.h
Events_InfoMessage.h
)
Events_MessageGroup.cpp
Events_Listener.cpp
Events_Loop.cpp
- Events_Error.cpp
Events_LongOp.cpp
)
%module EventsAPI
%{
#include "Events.h"
- #include "Events_Error.h"
+ #include "Events_InfoMessage.h"
#include "Events_Message.h"
%}
// all supported interfaces
%include "Events_Message.h"
-%include "Events_Error.h"
+%include "Events_InfoMessage.h"
+++ /dev/null
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-/*
- * Events_Error.cpp
- *
- * Created on: Apr 28, 2014
- * Author: sbh
- */
-
-#include <Events_Error.h>
-#include <Events_Loop.h>
-
-#define THROW_EMPTY_AIS_EXCEPTION
-
-Events_Error::Events_Error(const std::string& theDescription, const void* theSender)
- : Events_Message(Events_Error::errorID(), theSender)
-{
- myDescription = theDescription;
-}
-
-Events_Error::~Events_Error()
-{
-}
-
-Events_ID Events_Error::errorID()
-{
- Events_Loop* aLoop = Events_Loop::loop();
- return aLoop->eventByName("ApplicationError");
-}
-
-const char* Events_Error::description() const
-{
- return myDescription.c_str();
-}
-
-void Events_Error::send(const std::string& theDescription, const void* theSender)
-{
- std::shared_ptr<Events_Message> aNewOne =
- std::shared_ptr<Events_Message>(new Events_Error(theDescription, theSender));
- Events_Loop::loop()->send(aNewOne);
-}
-
-void Events_Error::throwException(const std::string& theDescription)
-{
-#ifdef THROW_EMPTY_AIS_EXCEPTION
- Events_Error::send(
- std::string("An exception: ") + theDescription);
-#endif
-}
+++ /dev/null
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-/*
- * Events_Error.h
- *
- * Created on: Apr 28, 2014
- * Author: sbh
- */
-
-#ifndef EVENTS_ERROR_H_
-#define EVENTS_ERROR_H_
-
-#include <Events.h>
-#include <Events_Message.h>
-
-#include <string>
-
-/**\class Events_Error
- * \ingroup EventsLoop
- * \brief An error message event.
- *
- * Is generated by any algorithm or GUI of the application to inform the user about
- * the problem. In GUI mode all such errors are collected in the message log window.
- */
-class Events_Error : public Events_Message
-{
- std::string myDescription; ///< the description of the error
-
-public:
- /// default destructor
- EVENTS_EXPORT virtual ~Events_Error();
-
- /// Identifier of this event (one for all errors)
- EVENTS_EXPORT static Events_ID errorID();
- /// Specific error string
- EVENTS_EXPORT const char* description() const;
- /// Allows to send an error quickly: it creates and sends the error object automatically
- EVENTS_EXPORT static void send(const std::string& theDescription, const void* theSender = 0);
-
- /// Throws a C++ exception about using an empty AIS object
- /// \param theDescription an exception information
- EVENTS_EXPORT static void throwException(const std::string& theDescription);
-
-protected:
- /// Default constructor. Use "send" message for generation an error.
- EVENTS_EXPORT Events_Error(const std::string& theDescription, const void* theSender = 0);
-};
-
-#endif /* EVENTS_ERROR_H_ */
<message>
<location filename="ParametersPlugin_WidgetParamsMgr.cpp" line="165"/>
<source>Name</source>
- <translation>Имя</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location filename="ParametersPlugin_WidgetParamsMgr.cpp" line="165"/>
<source>Equation</source>
- <translation>Выражение</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location filename="ParametersPlugin_WidgetParamsMgr.cpp" line="165"/>
<source>Result</source>
- <translation>Результат</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location filename="ParametersPlugin_WidgetParamsMgr.cpp" line="165"/>
<source>Comment</source>
- <translation>Коментарий</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location filename="ParametersPlugin_WidgetParamsMgr.cpp" line="188"/>
<source>Parameters</source>
- <translation type="unfinished">Параметры</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location filename="ParametersPlugin_WidgetParamsMgr.cpp" line="194"/>
<source>Features</source>
- <translation>Объекты</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location filename="ParametersPlugin_WidgetParamsMgr.cpp" line="213"/>
<source>Add</source>
- <translation>Добавить</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location filename="ParametersPlugin_WidgetParamsMgr.cpp" line="217"/>
<source>Insert</source>
- <translation>Вставить</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location filename="ParametersPlugin_WidgetParamsMgr.cpp" line="221"/>
<source>Remove</source>
- <translation>Удалить</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location filename="ParametersPlugin_WidgetParamsMgr.cpp" line="258"/>
<location filename="ParametersPlugin_WidgetParamsMgr.cpp" line="698"/>
<source>Warning</source>
- <translation>Предупреждение</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location filename="ParametersPlugin_WidgetParamsMgr.cpp" line="420"/>
<source>Name %1 already exists.</source>
- <translation>Имя %1 уже существует.</translation>
- </message>
-</context>
-<context>
- <name>QObject</name>
- <message>
- <source>Parameters</source>
- <translation type="obsolete">Параметры</translation>
+ <translation type="unfinished"></translation>
</message>
</context>
</TS>
#include <ModelAPI_Session.h>
#include <ModelAPI_ResultCompSolid.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
#include <Events_Loop.h>
#include <GeomAPI_IPresentable.h>
}
if (!aReadyToDisplay) {
- Events_Error::throwException("An empty AIS presentation: PartSet_OperationPrs");
+ Events_InfoMessage("PartSet_OperationPrs",
+ "An empty AIS presentation: PartSet_OperationPrs").send();
std::shared_ptr<Events_Message> aMsg = std::shared_ptr<Events_Message>(
new Events_Message(Events_Loop::eventByName(EVENT_EMPTY_OPERATION_PRESENTATION)));
Events_Loop::loop()->send(aMsg);
#include <ModelAPI_ResultConstruction.h>
#include <GeomAPI_PlanarEdges.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
#include <Events_Loop.h>
#include <SketchPlugin_SketchEntity.h>
}
if (!aReadyToDisplay) {
- Events_Error::throwException("An empty AIS presentation: PartSet_ResultSketchPrs");
+ Events_InfoMessage("PartSet_ResultSketchPrs", "An empty AIS presentation: PartSet_ResultSketchPrs").send();
static const Events_ID anEvent = Events_Loop::eventByName(EVENT_EMPTY_AIS_PRESENTATION);
ModelAPI_EventCreator::get()->sendUpdated(myResult, anEvent);
}
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="en_US">
-<context>
+ <context>
+ <name>Sketch</name>
+ <message>
+ <source>Model_FeatureValidator: Attribute "DirX" is not initialized.</source>
+ <translation>Select a plane for the sketch</translation>
+ </message>
+ <message>
+ <source>Model_FeatureValidator: Attribute "Features" is not initialized.</source>
+ <translation>Sketch objects are not defined</translation>
+ </message>
+ </context>
+
+ <context>
+ <name>SketchCircle</name>
+ <message>
+ <source>CircleRadius - GeomValidators_Positive: Double is not positive.</source>
+ <translation>Set a positive number for the radius value</translation>
+ </message>
+ <message>
+ <source>Model_FeatureValidator: Attribute "CircleCenter" is not initialized.</source>
+ <translation>Select a center point</translation>
+ </message>
+ </context>
+
+ <context>
+ <name>SketchConstraintHorizontal</name>
+ <message>
+ <source>Model_FeatureValidator: Attribute "ConstraintEntityA" is not initialized.</source>
+ <translation>Select a line for the constraint</translation>
+ </message>
+ <message>
+ <source>ModelAPI_StateInvalidArgument</source>
+ <translation>Wrong object is selected</translation>
+ </message>
+ </context>
+
+ <context>
+ <name>SketchConstraintPerpendicular</name>
+ <message>
+ <source>Model_FeatureValidator: Attribute "ConstraintEntityA" is not initialized.</source>
+ <translation>Select first line for the perpendicular constraint</translation>
+ </message>
+ <message>
+ <source>Model_FeatureValidator: Attribute "ConstraintEntityB" is not initialized.</source>
+ <translation>Select second line for the perpendicular constraint</translation>
+ </message>
+ </context>
+
+ <context>
+ <name>SketchConstraintRadius</name>
+ <message>
+ <source>Model_FeatureValidator: Attribute "ConstraintEntityA" is not initialized.</source>
+ <translation>Select a circle for the radius definition</translation>
+ </message>
+ </context>
+
+ <context>
<name>SketchConstraintVertical</name>
<message>
- <source>Model_FeatureValidator: Attribute "ConstraintEntityA" is not initialized.</source>
- <translation>Select a line for the constraint definition.</translation>
+ <source>ModelAPI_StateInvalidArgument</source>
+ <translation>Wrong object is selected</translation>
+ </message>
+ <message>
+ <source>Model_FeatureValidator: Attribute "ConstraintEntityA" is not initialized.</source>
+ <translation>Select a line for the constraint</translation>
+ </message>
+ </context>
+
+ <context>
+ <name>SketchLine</name>
+ <message>
+ <source>GeomValidators_Different: Attributes StartPoint and EndPoint are equal.</source>
+ <translation>Drag mouse pointer to select an end point</translation>
</message>
<message>
- <source>ModelAPI_StateInvalidArgument</source>
- <translation>Wrong argument for the constraint</translation>
+ <source>Model_FeatureValidator: Attribute "EndPoint" is not initialized.</source>
+ <translation>Click to select an end point for the line</translation>
</message>
-</context>
+ </context>
</TS>
#include <ModelAPI_AttributeDouble.h>
#include <ModelAPI_Events.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
#include <GeomDataAPI_Point2D.h>
#include <GeomAPI_Lin2d.h>
void sendEmptyPresentationError(ModelAPI_Feature* theFeature, const std::string theError)
{
- Events_Error::throwException("An empty AIS presentation: SketcherPrs_LengthDimension");
+ Events_InfoMessage("SketcherPrs_Tools", "An empty AIS presentation: SketcherPrs_LengthDimension").send();
static const Events_ID anEvent = Events_Loop::eventByName(EVENT_EMPTY_AIS_PRESENTATION);
std::shared_ptr<ModelAPI_Object> aConstraintPtr(theFeature);
ModelAPI_EventCreator::get()->sendUpdated(aConstraintPtr, anEvent);