minor: added some English comments

This commit is contained in:
plc-user 2025-03-13 21:05:21 +01:00
parent eeb453f120
commit 757df90951
5 changed files with 19 additions and 3 deletions

View File

@ -1153,7 +1153,7 @@ void DiagramView::editSelection()
QGraphicsItem *item = m_diagram->selectedItems().first(); QGraphicsItem *item = m_diagram->selectedItems().first();
//We use dynamic_cast instead of qgraphicsitem_cast for QetGraphicsItem //We use dynamic_cast instead of qgraphicsitem_cast for QetGraphicsItem
//because they haven't got they own type(). //because they haven't got their own type().
//Use qgraphicsitem_cast will have weird behavior for this class. //Use qgraphicsitem_cast will have weird behavior for this class.
if (IndependentTextItem *iti = qgraphicsitem_cast<IndependentTextItem *>(item)) if (IndependentTextItem *iti = qgraphicsitem_cast<IndependentTextItem *>(item))
iti -> edit(); iti -> edit();

View File

@ -32,6 +32,10 @@
en orientation. Si la chaine fait plusieurs caracteres, seul le en orientation. Si la chaine fait plusieurs caracteres, seul le
premier est pris en compte. En cas d'incoherence, Qet::North est premier est pris en compte. En cas d'incoherence, Qet::North est
retourne. retourne.
Used to convert a string of characters (n, s, e or w)
into orientation. If the string is made up of several characters,
only the only the first is taken into account. In the event of an
inconsistency, Qet::North is returned.
@param s Chaine de caractere cense representer une orientation @param s Chaine de caractere cense representer une orientation
@return l'orientation designee par la chaine de caractere @return l'orientation designee par la chaine de caractere
*/ */
@ -60,6 +64,7 @@ QString Qet::orientationToString(Qet::Orientation o) {
/** /**
Indique si deux orientations de Borne sont sur le meme axe (Vertical / Horizontal). Indique si deux orientations de Borne sont sur le meme axe (Vertical / Horizontal).
Indicates whether two terminal orientations are on the same axis (Vertical / Horizontal).
@param a La premiere orientation de Borne @param a La premiere orientation de Borne
@param b La seconde orientation de Borne @param b La seconde orientation de Borne
@return Un booleen a true si les deux orientations de bornes sont sur le meme axe @return Un booleen a true si les deux orientations de bornes sont sur le meme axe

View File

@ -1597,7 +1597,7 @@ void QETDiagramEditor::slot_updateUndoStack()
/** /**
@brief QETDiagramEditor::slot_updateComplexActions @brief QETDiagramEditor::slot_updateComplexActions
Manage the actions who need some conditions to be enable or not. Manage the actions that need some conditions to be enabled or not.
This method does nothing if there is no project opened This method does nothing if there is no project opened
*/ */
void QETDiagramEditor::slot_updateComplexActions() void QETDiagramEditor::slot_updateComplexActions()
@ -1633,7 +1633,7 @@ void QETDiagramEditor::slot_updateComplexActions()
int selected_elements_count = dc.count(DiagramContent::Elements); int selected_elements_count = dc.count(DiagramContent::Elements);
m_find_element->setEnabled(selected_elements_count == 1); m_find_element->setEnabled(selected_elements_count == 1);
//Action that need items (elements, conductors, texts...) selected, to be enabled //Actions that need items (elements, conductors, texts...) selected, to be enabled
bool copiable_items = dc.hasCopiableItems(); bool copiable_items = dc.hasCopiableItems();
bool deletable_items = dc.hasDeletableItems(); bool deletable_items = dc.hasDeletableItems();
m_cut -> setEnabled(!ro && copiable_items); m_cut -> setEnabled(!ro && copiable_items);

View File

@ -384,9 +384,11 @@ void Conductor::generateConductorPath(const QPointF &p1, Qet::Orientation o1, co
points << depart0; points << depart0;
// prolongement de la borne de depart // prolongement de la borne de depart
// extend start terminal
points << depart; points << depart;
// commence le vrai trajet // commence le vrai trajet
// starts the real path
if (depart.y() < arrivee.y()) { if (depart.y() < arrivee.y()) {
// trajet descendant // trajet descendant
if ((ori_depart == Qet::North && (ori_arrivee == Qet::South || ori_arrivee == Qet::West)) || (ori_depart == Qet::East && ori_arrivee == Qet::West)) { if ((ori_depart == Qet::North && (ori_arrivee == Qet::South || ori_arrivee == Qet::West)) || (ori_depart == Qet::East && ori_arrivee == Qet::West)) {

View File

@ -37,6 +37,7 @@ const qreal Terminal::Z = 1000;
/** /**
@brief Terminal::init @brief Terminal::init
Methode privee pour initialiser la borne. Methode privee pour initialiser la borne.
Private method to initialize the terminal.
@param number of terminal @param number of terminal
@param name of terminal @param name of terminal
@param hiddenName @param hiddenName
@ -92,17 +93,25 @@ Terminal::~Terminal() {
est bien un Element, cette fonction renvoie l'orientation par rapport a est bien un Element, cette fonction renvoie l'orientation par rapport a
la scene de la borne, en tenant compte du fait que l'element ait pu etre la scene de la borne, en tenant compte du fait que l'element ait pu etre
pivote. Sinon elle renvoie son sens normal. pivote. Sinon elle renvoie son sens normal.
Used to find out the orientation of the terminal. If the terminal's parent
is in fact an Element, this function returns the orientation of the
terminal with respect to the scene, taking into account the angle of
rotation. scene, taking into account the fact that the element may have
been rotated. Otherwise it returns its normal direction.
@return L'orientation actuelle de la Terminal. @return L'orientation actuelle de la Terminal.
*/ */
Qet::Orientation Terminal::orientation() const Qet::Orientation Terminal::orientation() const
{ {
if (Element *elt = qgraphicsitem_cast<Element *>(parentItem())) { if (Element *elt = qgraphicsitem_cast<Element *>(parentItem())) {
// orientations actuelle et par defaut de l'element // orientations actuelle et par defaut de l'element
// current and default element orientations
int ori_cur = elt -> orientation(); int ori_cur = elt -> orientation();
if (ori_cur == 0) return(d->m_orientation); if (ori_cur == 0) return(d->m_orientation);
else { else {
// calcul l'angle de rotation implique par l'orientation de l'element parent // calcul l'angle de rotation implique par l'orientation de l'element parent
// angle de rotation de la borne sur la scene, divise par 90 // angle de rotation de la borne sur la scene, divise par 90
// calculates the angle of rotation implied by the orientation of the parent
// element angle of rotation of the terminal on the scene, divided by 90
int angle = ori_cur + d->m_orientation; int angle = ori_cur + d->m_orientation;
while (angle >= 4) angle -= 4; while (angle >= 4) angle -= 4;
return((Qet::Orientation)angle); return((Qet::Orientation)angle);