mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
Add new fild and titleblock "Function group"
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5622 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -94,6 +94,13 @@ void SearchAndReplaceWorker::replaceDiagram(QList<Diagram *> diagram_list)
|
||||
} else {
|
||||
new_properties.machine = m_titleblock_properties.machine;
|
||||
}
|
||||
}if (!m_titleblock_properties.funcgroup.isEmpty())
|
||||
{
|
||||
if (m_titleblock_properties.funcgroup == eraseText()) {
|
||||
new_properties.funcgroup.clear();
|
||||
} else {
|
||||
new_properties.funcgroup = m_titleblock_properties.funcgroup;
|
||||
}
|
||||
}
|
||||
if (!m_titleblock_properties.locmach.isEmpty())
|
||||
{
|
||||
|
||||
@@ -47,6 +47,7 @@ TitleBlockProperties ReplaceFolioWidget::titleBlockProperties() const
|
||||
prop.author = ui->m_author_le->text();
|
||||
prop.filename = ui->m_file_le ->text();
|
||||
prop.machine = ui->m_mach ->text();
|
||||
prop.funcgroup= ui->m_group_f ->text();
|
||||
prop.locmach = ui->m_loc ->text();
|
||||
prop.indexrev = ui->m_indice ->text();
|
||||
prop.folio = ui->m_folio_le ->text();
|
||||
@@ -79,6 +80,7 @@ void ReplaceFolioWidget::setTitleBlockProperties(const TitleBlockProperties &pro
|
||||
ui->m_author_le->setText (properties.author);
|
||||
ui->m_file_le ->setText (properties.filename);
|
||||
ui->m_mach ->setText (properties.machine);
|
||||
ui->m_group_f ->setText (properties.funcgroup);
|
||||
ui->m_loc ->setText (properties.locmach);
|
||||
ui->m_indice ->setText (properties.indexrev);
|
||||
ui->m_folio_le ->setText (properties.folio);
|
||||
@@ -167,6 +169,11 @@ void ReplaceFolioWidget::on_m_mach_cb_clicked() {
|
||||
ui->m_mach->setDisabled(ui->m_mach_cb->isChecked());
|
||||
}
|
||||
|
||||
void ReplaceFolioWidget::on_m_group_f_cb_clicked() {
|
||||
ui->m_group_f->setText(ui->m_group_f_cb->isChecked() ? SearchAndReplaceWorker::eraseText() : QString());
|
||||
ui->m_group_f->setDisabled(ui->m_group_f_cb->isChecked());
|
||||
}
|
||||
|
||||
void ReplaceFolioWidget::on_m_loc_cb_clicked() {
|
||||
ui->m_loc->setText(ui->m_loc_cb->isChecked() ? SearchAndReplaceWorker::eraseText() : QString());
|
||||
ui->m_loc->setDisabled(ui->m_loc_cb->isChecked());
|
||||
@@ -176,3 +183,5 @@ void ReplaceFolioWidget::on_m_indice_cb_clicked() {
|
||||
ui->m_indice->setText(ui->m_indice_cb->isChecked() ? SearchAndReplaceWorker::eraseText() : QString());
|
||||
ui->m_indice->setDisabled(ui->m_indice_cb->isChecked());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -48,10 +48,15 @@ class ReplaceFolioWidget : public QWidget
|
||||
void on_m_file_cb_clicked();
|
||||
void on_m_folio_cb_clicked();
|
||||
void on_m_mach_cb_clicked();
|
||||
void on_m_group_f_cb_clicked();
|
||||
void on_m_loc_cb_clicked();
|
||||
void on_m_indice_cb_clicked();
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
Ui::ReplaceFolioWidget *ui;
|
||||
DiagramContextWidget *m_diagram_context_widget = nullptr;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>449</width>
|
||||
<height>389</height>
|
||||
<height>431</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -305,6 +305,23 @@ Les variables suivantes sont utilisables :
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="2" colspan="2">
|
||||
<widget class="QLineEdit" name="m_group_f"/>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Groupe fonctionnel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="4">
|
||||
<widget class="QCheckBox" name="m_group_f_cb">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
||||
@@ -187,6 +187,7 @@ namespace autonum
|
||||
str.replace("%{auxiliary1}", dc.value("auxiliary1").toString());
|
||||
str.replace("%{auxiliary2}", dc.value("auxiliary2").toString());
|
||||
str.replace("%{machine-manufacturer-reference}", dc.value("machine-manufacturer-reference").toString());
|
||||
str.replace("%{function-group}", dc.value("function-group").toString());
|
||||
str.replace("%{location}", dc.value("location").toString());
|
||||
str.replace("%{function}", dc.value("function").toString());
|
||||
str.replace("%{void}", QString());
|
||||
@@ -210,6 +211,7 @@ namespace autonum
|
||||
m_assigned_label.replace("%id", QString::number(m_diagram->folioIndex()+1));
|
||||
m_assigned_label.replace("%total", QString::number(m_diagram->border_and_titleblock.folioTotal()));
|
||||
m_assigned_label.replace("%M", m_diagram -> border_and_titleblock.machine());
|
||||
m_assigned_label.replace("%FG",m_diagram ->border_and_titleblock.funcgroup());
|
||||
m_assigned_label.replace("%LM", m_diagram -> border_and_titleblock.locmach());
|
||||
|
||||
QSettings settings;
|
||||
@@ -426,6 +428,9 @@ namespace autonum
|
||||
else if (type == "machine") {
|
||||
formula.append("%M");
|
||||
}
|
||||
else if (type == "funcgroup") {
|
||||
formula.append("%FG");
|
||||
}
|
||||
else if (type == "locmach") {
|
||||
formula.append("%LM");
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ QStringList NumerotationContext::itemAt(const int i) const {
|
||||
* @return all type use to numerotation
|
||||
*/
|
||||
QString NumerotationContext::validRegExpNum () const {
|
||||
return ("unit|unitfolio|ten|tenfolio|hundred|hundredfolio|string|idfolio|folio|machine|locmach|elementline|elementcolumn|elementprefix");
|
||||
return ("unit|unitfolio|ten|tenfolio|hundred|hundredfolio|string|idfolio|folio|machine|funcgroup|locmach|elementline|elementcolumn|elementprefix");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -128,6 +128,11 @@ void NumerotationContextCommands::setNumStrategy(const QString &str) {
|
||||
strategy_ = new MachineNum (diagram_);
|
||||
return;
|
||||
}
|
||||
|
||||
else if (str=="funcgroup"){
|
||||
strategy_ = new FuncgroupNum (diagram_);
|
||||
return;
|
||||
}
|
||||
else if (str=="locmach"){
|
||||
strategy_ = new LocmachNum (diagram_);
|
||||
return;
|
||||
@@ -529,6 +534,39 @@ NumerotationContext MachineNum::previous(const NumerotationContext &nc, const in
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
FuncgroupNum::FuncgroupNum (Diagram *d):
|
||||
NumStrategy (d)
|
||||
{}
|
||||
|
||||
/**
|
||||
* @brief FuncgroupNum::toRepresentedString
|
||||
* @return the represented string of folio
|
||||
*/
|
||||
QString FuncgroupNum::toRepresentedString(const QString str) const {
|
||||
Q_UNUSED(str);
|
||||
return "%FG";
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief FuncgroupNum::next
|
||||
* @return the next NumerotationContext nc at position i
|
||||
*/
|
||||
NumerotationContext FuncgroupNum::next (const NumerotationContext &nc, const int i) const {
|
||||
return (nextString(nc, i));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief FuncgroupNum::previous
|
||||
* @return the previous NumerotationContext nc at posiiton i
|
||||
*/
|
||||
NumerotationContext FuncgroupNum::previous(const NumerotationContext &nc, const int i) const {
|
||||
return (nextString(nc, i));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
|
||||
@@ -150,6 +150,15 @@ class MachineNum: public NumStrategy
|
||||
NumerotationContext previous (const NumerotationContext &, const int) const override;
|
||||
};
|
||||
|
||||
class FuncgroupNum: public NumStrategy
|
||||
{
|
||||
public:
|
||||
FuncgroupNum (Diagram *);
|
||||
QString toRepresentedString(const QString) const override;
|
||||
NumerotationContext next (const NumerotationContext &, const int) const override;
|
||||
NumerotationContext previous (const NumerotationContext &, const int) const override;
|
||||
};
|
||||
|
||||
class LocmachNum: public NumStrategy
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -59,6 +59,7 @@ NumPartEditorW::NumPartEditorW (NumerotationContext &context, int i, int type, Q
|
||||
else if (strl.at(0)=="idfolio") setType(NumPartEditorW::idfolio);
|
||||
else if (strl.at(0)=="folio") setType(NumPartEditorW::folio);
|
||||
else if (strl.at(0)=="machine") setType(NumPartEditorW::machine);
|
||||
else if (strl.at(0)=="funcgroup") setType(NumPartEditorW::funcgroup);
|
||||
else if (strl.at(0)=="locmach") setType(NumPartEditorW::locmach);
|
||||
else if (strl.at(0)=="elementline") setType(NumPartEditorW::elementline);
|
||||
else if (strl.at(0)=="elementcolumn") setType(NumPartEditorW::elementcolumn);
|
||||
@@ -91,12 +92,12 @@ void NumPartEditorW::setVisibleItems()
|
||||
{
|
||||
items << tr("Chiffre 1") << tr("Chiffre 1 - Folio") << tr("Chiffre 01")
|
||||
<< tr("Chiffre 01 - Folio") << tr("Chiffre 001") << tr("Chiffre 001 - Folio")
|
||||
<< tr("Texte") << tr("N° folio") << tr("Folio") << tr("Machine") << tr("Locmach");
|
||||
<< tr("Texte") << tr("N° folio") << tr("Folio") << tr("Machine") << tr("Funcgroup") << tr("Locmach");
|
||||
}
|
||||
else
|
||||
items << tr("Chiffre 1") << tr("Chiffre 1 - Folio") << tr("Chiffre 01")
|
||||
<< tr("Chiffre 01 - Folio") << tr("Chiffre 001") << tr("Chiffre 001 - Folio")
|
||||
<< tr("Texte") << tr("N° folio") << tr("Folio") << tr("Machine") << tr("Locmach")
|
||||
<< tr("Texte") << tr("N° folio") << tr("Folio") << tr("Machine") << tr("Funcgroup") << tr("Locmach")
|
||||
<< tr("Element Line") << tr("Element Column") << tr("Element Prefix");
|
||||
ui->type_cb->insertItems(0,items);
|
||||
}
|
||||
@@ -139,6 +140,9 @@ NumerotationContext NumPartEditorW::toNumContext() {
|
||||
case machine:
|
||||
type_str = "machine";
|
||||
break;
|
||||
case funcgroup:
|
||||
type_str = "funcgroup";
|
||||
break;
|
||||
case locmach:
|
||||
type_str = "locmach";
|
||||
break;
|
||||
@@ -164,7 +168,7 @@ NumerotationContext NumPartEditorW::toNumContext() {
|
||||
* @return true if value field isn't empty or if type is folio
|
||||
*/
|
||||
bool NumPartEditorW::isValid() {
|
||||
if (type_ == folio || type_ == idfolio || type_ == elementline || type_ == machine || type_ == locmach ||
|
||||
if (type_ == folio || type_ == idfolio || type_ == elementline || type_ == machine || type_ == funcgroup || type_ == locmach ||
|
||||
type_ == elementcolumn || type_ == elementprefix) {return true;}
|
||||
else if(ui -> value_field -> text().isEmpty()) {return false;}
|
||||
else return true;
|
||||
@@ -195,6 +199,8 @@ void NumPartEditorW::on_type_cb_activated(int) {
|
||||
setType(folio);
|
||||
else if (ui->type_cb->currentText() == tr("Machine"))
|
||||
setType(machine);
|
||||
else if (ui->type_cb->currentText() == tr("Funcgroup"))
|
||||
setType(funcgroup);
|
||||
else if (ui->type_cb->currentText() == tr("Locmach"))
|
||||
setType(locmach);
|
||||
else if (ui->type_cb->currentText() == tr("Element Line"))
|
||||
@@ -234,7 +240,7 @@ void NumPartEditorW::setType(NumPartEditorW::type t, bool fnum) {
|
||||
//if @t is a numeric type and preview type @type_ isn't a numeric type
|
||||
//or @fnum is true, we set numeric behavior
|
||||
if ( ((t==unit || t==unitfolio || t==ten || t==tenfolio || t==hundred || t==hundredfolio) &&
|
||||
(type_==string || type_==folio || type_==machine || type_==locmach ||type_==idfolio ||
|
||||
(type_==string || type_==folio || type_==machine || type_ ==funcgroup || type_==locmach ||type_==idfolio ||
|
||||
type_==elementcolumn || type_==elementline || type_==elementprefix))
|
||||
|| fnum) {
|
||||
ui -> value_field -> clear();
|
||||
@@ -244,7 +250,7 @@ void NumPartEditorW::setType(NumPartEditorW::type t, bool fnum) {
|
||||
ui -> increase_spinBox -> setValue(1);
|
||||
}
|
||||
//@t isn't a numeric type
|
||||
else if (t == string || t == folio || t == idfolio || t == elementline || t == machine || t == locmach ||
|
||||
else if (t == string || t == folio || t == idfolio || t == elementline || t == machine || t == funcgroup ||t == locmach ||
|
||||
t == elementcolumn || t == elementprefix) {
|
||||
ui -> value_field -> clear();
|
||||
ui -> increase_spinBox -> setDisabled(true);
|
||||
@@ -260,6 +266,12 @@ void NumPartEditorW::setType(NumPartEditorW::type t, bool fnum) {
|
||||
ui -> value_field -> setDisabled(true);
|
||||
ui -> increase_spinBox -> setDisabled(true);
|
||||
}
|
||||
|
||||
else if (t==funcgroup) {
|
||||
ui -> value_field -> setDisabled(true);
|
||||
ui -> increase_spinBox -> setDisabled(true);
|
||||
}
|
||||
|
||||
else if (t==locmach) {
|
||||
ui -> value_field -> setDisabled(true);
|
||||
ui -> increase_spinBox -> setDisabled(true);
|
||||
@@ -311,6 +323,8 @@ void NumPartEditorW::setCurrentIndex(NumPartEditorW::type t) {
|
||||
i = ui->type_cb->findText(tr("Folio"));
|
||||
else if (t == machine)
|
||||
i = ui->type_cb->findText(tr("Machine"));
|
||||
else if (t == funcgroup)
|
||||
i = ui->type_cb->findText(tr("Funcgroup"));
|
||||
else if (t == locmach)
|
||||
i = ui->type_cb->findText(tr("Locmach"));
|
||||
else if (t == elementline)
|
||||
|
||||
@@ -42,7 +42,7 @@ class NumPartEditorW : public QWidget
|
||||
~NumPartEditorW() override;
|
||||
|
||||
enum type {unit,unitfolio,ten,tenfolio, hundred, hundredfolio,
|
||||
string,idfolio,folio,machine,locmach,
|
||||
string,idfolio,folio,machine,funcgroup,locmach,
|
||||
elementline,elementcolumn,elementprefix,
|
||||
};
|
||||
NumerotationContext toNumContext();
|
||||
|
||||
@@ -242,7 +242,8 @@ TitleBlockProperties BorderTitleBlock::exportTitleBlock() {
|
||||
ip.title = title();
|
||||
ip.filename = fileName();
|
||||
ip.machine = machine();
|
||||
ip.locmach = locmach();
|
||||
ip.funcgroup = funcgroup();
|
||||
ip.locmach = locmach();
|
||||
ip.indexrev = indexrev();
|
||||
ip.version = version();
|
||||
ip.folio = folio();
|
||||
@@ -265,6 +266,7 @@ void BorderTitleBlock::importTitleBlock(const TitleBlockProperties &ip) {
|
||||
setTitle(ip.title);
|
||||
setFileName(ip.filename);
|
||||
setMachine(ip.machine);
|
||||
setFuncgroup(ip.funcgroup);
|
||||
setLocMach(ip.locmach);
|
||||
setIndicerev(ip.indexrev);
|
||||
setVersion(QET::displayedVersion);
|
||||
@@ -716,6 +718,7 @@ void BorderTitleBlock::updateDiagramContextForTitleBlock(const DiagramContext &i
|
||||
context.addValue("title", btb_title_);
|
||||
context.addValue("filename", btb_filename_);
|
||||
context.addValue("machine", btb_machine_);
|
||||
context.addValue("funcgroup", btb_funcgroup_);
|
||||
context.addValue("locmach", btb_locmach_);
|
||||
context.addValue("indexrev", btb_indexrev_);
|
||||
context.addValue("version", btb_version_);
|
||||
|
||||
@@ -101,6 +101,8 @@ class BorderTitleBlock : public QObject
|
||||
QString machine() const { return(btb_machine_); }
|
||||
/// @return the value of the title block "Locmach" field
|
||||
QString locmach() const { return(btb_locmach_); }
|
||||
/// @return the value of the title block "Funcgroup" field
|
||||
QString funcgroup() const { return(btb_funcgroup_); }
|
||||
/// @return the value of the revision index block "Folio" field
|
||||
QString indexrev() const { return(btb_indexrev_); }
|
||||
|
||||
@@ -156,6 +158,7 @@ class BorderTitleBlock : public QObject
|
||||
void setFolioData(int, int, const QString& = nullptr, const DiagramContext & = DiagramContext());
|
||||
/// @param author the new value of the "File" field
|
||||
void setMachine(const QString &machine) { btb_machine_ = machine; }
|
||||
void setFuncgroup(const QString &funcgroup) { btb_locmach_ = funcgroup; }
|
||||
void setLocMach(const QString &locmach) { btb_locmach_ = locmach; }
|
||||
void setIndicerev(const QString &indexrev){ btb_indexrev_ = indexrev; }
|
||||
void setFileName(const QString &filename) { btb_filename_ = filename; }
|
||||
@@ -238,6 +241,7 @@ class BorderTitleBlock : public QObject
|
||||
QString btb_title_;
|
||||
QString btb_folio_;
|
||||
QString btb_machine_;
|
||||
QString btb_funcgroup_;
|
||||
QString btb_locmach_;
|
||||
QString btb_indexrev_;
|
||||
QString btb_final_folio_;
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
* auxiliary1 -> auxiliary 1 of element
|
||||
* auxiliary2 -> auxiliary 2 of element
|
||||
* machine-manufacturer-reference -> reference of the manufacturer machine
|
||||
* function-group -> Function group
|
||||
* provider -> the provider of the element
|
||||
* function -> the function of element
|
||||
* location -> the location of the element
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include <QPainter>
|
||||
#include "qetapp.h"
|
||||
|
||||
qreal DiagramFolioList::colWidths[7] = {0.05, 0.50, 0.10, 0.10, 0.05, 0.10, 0.10};
|
||||
qreal DiagramFolioList::colWidths[8] = {0.05, 0.40, 0.10, 0.10, 0.10, 0.05, 0.10, 0.10};
|
||||
|
||||
/**
|
||||
* @brief DiagramFolioList::DiagramFolioList
|
||||
@@ -94,6 +94,7 @@ void DiagramFolioList::drawBackground(QPainter *p, const QRectF &r)
|
||||
diagram_list[i] -> title(),
|
||||
diagram_list[i] -> border_and_titleblock.finalfolio(),
|
||||
diagram_list[i] -> border_and_titleblock.machine(),
|
||||
diagram_list[i] -> border_and_titleblock.funcgroup(),
|
||||
diagram_list[i] -> border_and_titleblock.locmach(),
|
||||
diagram_list[i] -> border_and_titleblock.indexrev(),
|
||||
diagram_list[i] -> border_and_titleblock.date().toString(Qt::SystemLocaleShortDate));
|
||||
@@ -102,6 +103,7 @@ void DiagramFolioList::drawBackground(QPainter *p, const QRectF &r)
|
||||
diagram_list[i] -> title(),
|
||||
QString::number(diagram_list[i] ->folioIndex()+1),
|
||||
diagram_list[i] -> border_and_titleblock.machine(),
|
||||
diagram_list[i] -> border_and_titleblock.funcgroup(),
|
||||
diagram_list[i] -> border_and_titleblock.locmach(),
|
||||
diagram_list[i] -> border_and_titleblock.indexrev(),
|
||||
diagram_list[i] -> border_and_titleblock.date().toString(Qt::SystemLocaleShortDate));
|
||||
@@ -120,7 +122,7 @@ void DiagramFolioList::drawBackground(QPainter *p, const QRectF &r)
|
||||
* @param row_rect rectangle where we must draw the new row
|
||||
*/
|
||||
void DiagramFolioList::fillRow(QPainter *qp, const QRectF &row_rect, const QString& author, const QString& title,
|
||||
const QString& folio, const QString& machine, const QString& loc, const QString& indexrev, const QString& date)
|
||||
const QString& folio, const QString& machine, const QString& funcgroup, const QString& loc, const QString& indexrev, const QString& date)
|
||||
{
|
||||
qreal x = row_rect.topLeft().x();
|
||||
qreal y = row_rect.topLeft().y();
|
||||
@@ -174,42 +176,50 @@ void DiagramFolioList::fillRow(QPainter *qp, const QRectF &row_rect, const QStri
|
||||
qp -> drawText(QRectF(x, y, colWidths[3]*row_rect.width(), row_rect.height()), Qt::AlignCenter, machine);
|
||||
x += colWidths[2]*row_rect.width();
|
||||
|
||||
|
||||
if (origFontMetrics.width(loc) > 0.95*colWidths[3]*row_rect.width())
|
||||
workingFont.setPointSizeF(origFontSize * 0.95*colWidths[3]*row_rect.width() / origFontMetrics.width(loc));
|
||||
if (origFontMetrics.width(funcgroup) > 0.95*colWidths[3]*row_rect.width())
|
||||
workingFont.setPointSizeF(origFontSize * 0.95*colWidths[3]*row_rect.width() / origFontMetrics.width(funcgroup));
|
||||
else
|
||||
workingFont.setPointSizeF(origFontSize);
|
||||
qp -> setFont(workingFont);
|
||||
qp -> drawText(QRectF(x, y, colWidths[3]*row_rect.width(), row_rect.height()), Qt::AlignCenter, loc);
|
||||
qp -> drawText(QRectF(x, y, colWidths[3]*row_rect.width(), row_rect.height()), Qt::AlignCenter, funcgroup);
|
||||
x += colWidths[3]*row_rect.width();
|
||||
|
||||
|
||||
if (origFontMetrics.width(indexrev) > 0.95*colWidths[4]*row_rect.width())
|
||||
workingFont.setPointSizeF(origFontSize * 0.95*colWidths[4]*row_rect.width() / origFontMetrics.width(indexrev));
|
||||
if (origFontMetrics.width(loc) > 0.95*colWidths[4]*row_rect.width())
|
||||
workingFont.setPointSizeF(origFontSize * 0.95*colWidths[4]*row_rect.width() / origFontMetrics.width(loc));
|
||||
else
|
||||
workingFont.setPointSizeF(origFontSize);
|
||||
qp -> setFont(workingFont);
|
||||
qp -> drawText(QRectF(x, y, colWidths[4]*row_rect.width(), row_rect.height()), Qt::AlignCenter, indexrev);
|
||||
qp -> drawText(QRectF(x, y, colWidths[4]*row_rect.width(), row_rect.height()), Qt::AlignCenter, loc);
|
||||
x += colWidths[4]*row_rect.width();
|
||||
|
||||
|
||||
if (origFontMetrics.width(indexrev) > 0.95*colWidths[5]*row_rect.width())
|
||||
workingFont.setPointSizeF(origFontSize * 0.95*colWidths[5]*row_rect.width() / origFontMetrics.width(indexrev));
|
||||
else
|
||||
workingFont.setPointSizeF(origFontSize);
|
||||
qp -> setFont(workingFont);
|
||||
qp -> drawText(QRectF(x, y, colWidths[5]*row_rect.width(), row_rect.height()), Qt::AlignCenter, indexrev);
|
||||
x += colWidths[5]*row_rect.width();
|
||||
|
||||
|
||||
|
||||
|
||||
if (origFontMetrics.width(author) > 0.95*colWidths[5]*row_rect.width())
|
||||
workingFont.setPointSizeF(origFontSize * 0.95*colWidths[5]*row_rect.width() / origFontMetrics.width(author));
|
||||
if (origFontMetrics.width(author) > 0.95*colWidths[6]*row_rect.width())
|
||||
workingFont.setPointSizeF(origFontSize * 0.95*colWidths[6]*row_rect.width() / origFontMetrics.width(author));
|
||||
else
|
||||
workingFont.setPointSizeF(origFontSize);
|
||||
qp -> setFont(workingFont);
|
||||
qp -> drawText(QRectF(x, y, colWidths[6]*row_rect.width(), row_rect.height()), Qt::AlignCenter, author);
|
||||
x += colWidths[5]*row_rect.width();
|
||||
x += colWidths[6]*row_rect.width();
|
||||
|
||||
|
||||
if (origFontMetrics.width(date) > 0.95*colWidths[6]*row_rect.width())
|
||||
workingFont.setPointSizeF(origFontSize * 0.95*colWidths[6]*row_rect.width() / origFontMetrics.width(date));
|
||||
if (origFontMetrics.width(date) > 0.95*colWidths[7]*row_rect.width())
|
||||
workingFont.setPointSizeF(origFontSize * 0.95*colWidths[7]*row_rect.width() / origFontMetrics.width(date));
|
||||
else
|
||||
workingFont.setPointSizeF(origFontSize);
|
||||
qp -> setFont(workingFont);
|
||||
qp -> drawText(QRectF(x, y, colWidths[6]*row_rect.width(), row_rect.height()), Qt::AlignCenter, date);
|
||||
qp -> drawText(QRectF(x, y, colWidths[7]*row_rect.width(), row_rect.height()), Qt::AlignCenter, date);
|
||||
}
|
||||
|
||||
void DiagramFolioList::buildGrid(QPainter *qp, const QRectF &rect, int rows, int tables, qreal colWidths[])
|
||||
@@ -220,7 +230,7 @@ void DiagramFolioList::buildGrid(QPainter *qp, const QRectF &rect, int rows, int
|
||||
list_rectangles_.clear();
|
||||
|
||||
qreal sum = 0;
|
||||
for (int i = 0; i < 7; i++ )
|
||||
for (int i = 0; i < 8; i++ )
|
||||
sum += colWidths[i];
|
||||
if ( sum < 0.99 || sum > 1.01 ) {
|
||||
qDebug() << "Invalid input: Column widths do not sum to 1";
|
||||
@@ -230,7 +240,7 @@ void DiagramFolioList::buildGrid(QPainter *qp, const QRectF &rect, int rows, int
|
||||
qreal tablesSpacing = rect.height() * 0.02;
|
||||
qreal tableWidth = (rect.width() - tablesSpacing*(tables+1) ) / tables;
|
||||
qreal rowHeight = (rect.height() - 2*tablesSpacing) / rows;
|
||||
int cols = 7;//colWidths.size();
|
||||
int cols = 8;//colWidths.size();
|
||||
|
||||
qreal x0 = tablesSpacing + rect.topLeft().x();
|
||||
qreal y0 = tablesSpacing + rect.topLeft().y();
|
||||
@@ -265,12 +275,13 @@ void DiagramFolioList::fillHeader(QPainter *qp, const QRectF &row_RectF) {
|
||||
QString titleTranslatable(QObject::tr("Titre"));
|
||||
QString folioTranslatable(QObject::tr("Folio"));
|
||||
QString machineTranslatable(QObject::tr("Installation"));
|
||||
QString funcgroupTranslatable(QObject::tr("Groupe fonctionnel"));
|
||||
QString locTranslatable(QObject::tr("Localisation"));
|
||||
QString indexrevTranslatable(QObject::tr("Rev"));
|
||||
QString dateTranslatable(QObject::tr("Date"));
|
||||
|
||||
qp->save();
|
||||
qp->setFont(QETApp::diagramTextsFont(13));
|
||||
fillRow(qp, row_RectF, authorTranslatable, titleTranslatable, folioTranslatable, machineTranslatable, locTranslatable, indexrevTranslatable, dateTranslatable);
|
||||
fillRow(qp, row_RectF, authorTranslatable, titleTranslatable, folioTranslatable, machineTranslatable, funcgroupTranslatable, locTranslatable, indexrevTranslatable, dateTranslatable);
|
||||
qp->restore();
|
||||
}
|
||||
|
||||
@@ -31,13 +31,13 @@ class DiagramFolioList : public Diagram
|
||||
void setId(int i) {id = i;}
|
||||
int getId() const {return id;}
|
||||
|
||||
static qreal colWidths[7];
|
||||
static qreal colWidths[8];
|
||||
|
||||
protected:
|
||||
void drawBackground(QPainter *, const QRectF &) override;
|
||||
|
||||
private:
|
||||
void fillRow(QPainter *, const QRectF &, const QString&, const QString&, const QString&, const QString&, const QString&, const QString&, const QString&);
|
||||
void fillRow(QPainter *, const QRectF &, const QString&, const QString&, const QString&, const QString&, const QString&, const QString&, const QString&, const QString&);
|
||||
void buildGrid(QPainter *, const QRectF &, int, int, qreal[]);
|
||||
void fillHeader(QPainter *, const QRectF &);
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ void ElementPropertiesEditorWidget::updateTree()
|
||||
*/
|
||||
void ElementPropertiesEditorWidget::populateTree()
|
||||
{
|
||||
QStringList keys{"label", "comment", "description", "designation", "manufacturer", "manufacturer-reference", "provider", "machine-manufacturer-reference"};
|
||||
QStringList keys{"label", "comment", "description", "designation", "manufacturer", "manufacturer-reference", "provider", "function-group", "machine-manufacturer-reference"};
|
||||
|
||||
for(const QString& key : keys)
|
||||
{
|
||||
|
||||
@@ -100,6 +100,7 @@ QString nomenclature::getNomenclature()
|
||||
""+ QObject::tr("M001") +";" //:Don't translate this text! //ID for auxiliary field 1
|
||||
""+ QObject::tr("M002") +";" //:Don't translate this text! //ID for auciliary field 2
|
||||
""+ QObject::tr("N001")+";" //:Don't translate this text! //ID for internal number
|
||||
""+ QObject::tr("N002")+";" //:Don't translate this text! //ID for Function group
|
||||
""+ QObject::tr("O001")+";" //:Don't translate this text! //ID for location
|
||||
""+ QObject::tr("P001") +"\n"; //:Don't translate this text! //ID for function
|
||||
data += QObject::tr("N° de folio") +";"
|
||||
@@ -118,6 +119,7 @@ QString nomenclature::getNomenclature()
|
||||
""+ QObject::tr("Bloc auxiliaire 1") +";"
|
||||
""+ QObject::tr("Bloc auxiliaire 2") +";"
|
||||
""+ QObject::tr("Machine-reference") +";"
|
||||
""+ QObject::tr("Function-group") +";"
|
||||
""+ QObject::tr("Localisation") +";"
|
||||
""+ QObject::tr("Fonction") +"\n";
|
||||
|
||||
@@ -177,6 +179,7 @@ QString nomenclature::getElementInfo(Element *elmt) {
|
||||
info += autonum::AssignVariables::formulaToLabel(elmt_info["auxiliary1"].toString(), elmt->rSequenceStruct(), elmt->diagram(), elmt) + ";";
|
||||
info += autonum::AssignVariables::formulaToLabel(elmt_info["auxiliary2"].toString(), elmt->rSequenceStruct(), elmt->diagram(), elmt) + ";";
|
||||
info += autonum::AssignVariables::formulaToLabel(elmt_info["machine-manufacturer-reference"].toString(), elmt->rSequenceStruct(), elmt->diagram(), elmt) + ";";
|
||||
info += autonum::AssignVariables::formulaToLabel(elmt_info["function-group"].toString(), elmt->rSequenceStruct(), elmt->diagram(), elmt) + ";";
|
||||
info += autonum::AssignVariables::formulaToLabel(elmt_info["location"].toString(), elmt->rSequenceStruct(), elmt->diagram(), elmt) + ";";
|
||||
info += autonum::AssignVariables::formulaToLabel(elmt_info["function"].toString(), elmt->rSequenceStruct(), elmt->diagram(), elmt) + "\n";
|
||||
|
||||
|
||||
@@ -303,6 +303,7 @@ QStringList QETApp::elementInfoKeys()
|
||||
<< "auxiliary1"
|
||||
<< "auxiliary2"
|
||||
<< "machine-manufacturer-reference"
|
||||
<< "function-group"
|
||||
<< "location"
|
||||
<< "function"
|
||||
<< "tension-protocol";
|
||||
@@ -329,6 +330,7 @@ QString QETApp::elementTranslatedInfoKey(const QString &info)
|
||||
else if (info == "auxiliary1") return tr("Bloc auxiliaire 1");
|
||||
else if (info == "auxiliary2") return tr("Bloc auxiliaire 2");
|
||||
else if (info == "machine-manufacturer-reference") return tr("Numéro interne");
|
||||
else if (info == "function-group") return tr("Groupe fonctionnel");
|
||||
else if (info == "location") return tr("Localisation");
|
||||
else if (info == "function") return tr("Fonction");
|
||||
else if (info == "tension-protocol") return tr("Tension / Protocole");
|
||||
@@ -354,6 +356,7 @@ QString QETApp::elementInfoToVar(const QString &info)
|
||||
else if (info == "auxiliary1") return QString("%{auxiliary1}");
|
||||
else if (info == "auxiliary2") return QString("%{auxiliary2}");
|
||||
else if (info == "machine-manufacturer-reference") return QString("%{machine-manufacturer-reference}");
|
||||
else if (info == "function-group" ) return QString("%{function-group}");
|
||||
else if (info == "location") return QString("%{location}");
|
||||
else if (info == "function") return QString("%{function}");
|
||||
else if (info == "tension-protocol") return QString("%{tension-protocol}");
|
||||
|
||||
@@ -437,7 +437,8 @@ QString TitleBlockTemplateCellWidget::defaultVariablesString() const {
|
||||
"<li>%{date} : date du folio</li>"
|
||||
"<li>%{title} : titre du folio</li>"
|
||||
"<li>%{filename} : nom de fichier du projet</li>"
|
||||
"<li>%{machine} : nom du groupe fonctionnel du projet</li>"
|
||||
"<li>%{machine} : nom du projet</li>"
|
||||
"<li>%{funcgroup} : nom du groupe fonctionnel du projet</li>"
|
||||
"<li>%{locmach} : nom de la localisation dans le groupe fonctionnel du projet</li>"
|
||||
"<li>%{indexrev} : indice de révision du folio</li>"
|
||||
"<li>%{version} : version du logiciel</li>"
|
||||
|
||||
@@ -48,6 +48,7 @@ bool TitleBlockProperties::operator==(const TitleBlockProperties &ip) {
|
||||
ip.date == date &&\
|
||||
ip.filename == filename &&\
|
||||
ip.machine == machine &&\
|
||||
ip.funcgroup == funcgroup &&\
|
||||
ip.locmach == locmach &&\
|
||||
ip.indexrev == indexrev &&\
|
||||
ip.version == version &&\
|
||||
@@ -78,6 +79,7 @@ void TitleBlockProperties::toXml(QDomElement &e) const {
|
||||
e.setAttribute("title", title);
|
||||
e.setAttribute("filename", filename);
|
||||
e.setAttribute("machine", machine);
|
||||
e.setAttribute("funcgroup", funcgroup);
|
||||
e.setAttribute("locmach", locmach);
|
||||
e.setAttribute("indexrev",indexrev);
|
||||
e.setAttribute("version", version);
|
||||
@@ -108,6 +110,7 @@ void TitleBlockProperties::fromXml(const QDomElement &e) {
|
||||
if (e.hasAttribute("title")) title = e.attribute("title");
|
||||
if (e.hasAttribute("filename")) filename = e.attribute("filename");
|
||||
if (e.hasAttribute("machine")) machine = e.attribute("machine");
|
||||
if (e.hasAttribute("funcgroup")) funcgroup = e.attribute("funcgroup");
|
||||
if (e.hasAttribute("locmach")) locmach = e.attribute("locmach");
|
||||
if (e.hasAttribute("indexrev")) indexrev = e.attribute("indexrev");
|
||||
if (e.hasAttribute("version")) version = e.attribute("version");
|
||||
@@ -141,6 +144,7 @@ void TitleBlockProperties::toSettings(QSettings &settings, const QString &prefix
|
||||
settings.setValue(prefix + "author", author);
|
||||
settings.setValue(prefix + "filename", filename);
|
||||
settings.setValue(prefix + "machine", machine);
|
||||
settings.setValue(prefix + "funcgroup", funcgroup);
|
||||
settings.setValue(prefix + "locmach", locmach);
|
||||
settings.setValue(prefix + "indexrev", indexrev);
|
||||
settings.setValue(prefix + "version", version);
|
||||
@@ -163,6 +167,7 @@ void TitleBlockProperties::fromSettings(QSettings &settings, const QString &pref
|
||||
author = settings.value(prefix + "author").toString();
|
||||
filename = settings.value(prefix + "filename").toString();
|
||||
machine = settings.value(prefix + "machine").toString();
|
||||
funcgroup= settings.value(prefix + "funcgroup").toString();
|
||||
locmach = settings.value(prefix + "locmach").toString();
|
||||
indexrev = settings.value(prefix + "indexrev").toString();
|
||||
version = settings.value(prefix + "version").toString();
|
||||
|
||||
@@ -55,6 +55,7 @@ class TitleBlockProperties {
|
||||
QDate date; ///< Date (displayed by the default template)
|
||||
QString filename; ///< Filename (displayed by the default template)
|
||||
QString machine; ///< Machine (displayed by the default template)
|
||||
QString funcgroup; ///< Function group (displayed by the default template)
|
||||
QString locmach; ///< Location(displayed by the default template)
|
||||
QString indexrev; ///< Revision Index (displayed by the default template)
|
||||
QString version; ///< Version (displayed by the default template)
|
||||
|
||||
@@ -319,18 +319,18 @@ void PotentialSelectorDialog::on_buttonBox_accepted()
|
||||
}
|
||||
|
||||
//Check if formula of the new potential have incompatible variable with folio report
|
||||
QRegularExpression rx ("%sequf_|%seqtf_|%seqhf_|%id|%F|%M|%LM");
|
||||
QRegularExpression rx ("%sequf_|%seqtf_|%seqhf_|%id|%F|%M|%FG|%LM");
|
||||
foreach(ConductorProperties cp, m_properties_list)
|
||||
{
|
||||
if (cp.m_formula.contains(rx))
|
||||
{
|
||||
QStringList forbidden_str;
|
||||
forbidden_str << "%sequf_" << "%seqtf_" << "%seqhf_" << "%id" << "%F" << "%M" << "%LM";
|
||||
forbidden_str << "%sequf_" << "%seqtf_" << "%seqhf_" << "%id" << "%F" << "%M" << "%FG" << "%LM";
|
||||
|
||||
QString text(tr("La formule du nouveau potentiel contient des variables incompatibles avec les reports de folio.\n"
|
||||
"Veuillez saisir une formule compatible pour ce potentiel.\n"
|
||||
"Les variables suivantes sont incompatibles :\n"
|
||||
"%sequf_ %seqtf_ %seqhf_ %id %F %M %LM"));
|
||||
"%sequf_ %seqtf_ %seqhf_ %id %F %M %FG %LM"));
|
||||
FormulaAssistantDialog fag(this);
|
||||
fag.setForbiddenVariables(forbidden_str);
|
||||
fag.setText(text);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
<height>421</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -32,14 +32,7 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="label_">
|
||||
<property name="text">
|
||||
<string>Vous pouvez définir un label personnalisé pour les reports de folio.
|
||||
Créer votre propre texte en vous aidant des variables suivantes :
|
||||
%f : le numéro de folio
|
||||
%F: le label de folio
|
||||
%M: Machine
|
||||
%LM: Location
|
||||
%l : le numéro de ligne
|
||||
%c : le numéro de colonne</string>
|
||||
<string><html><head/><body><p>Vous pouvez définir un label personnalisé pour les reports de folio.</p><p>Créer votre propre texte en vous aidant des variables suivantes :</p><p>%f : le numéro de folio </p><p>%F: le label de folio</p><p>%M: Machine </p><p>%FG: Groupe fonctionnel</p><p>%LM: Location</p><p>%l : le numéro de ligne</p><p>%c : le numéro de colonne</p></body></html></string>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>false</bool>
|
||||
|
||||
@@ -97,6 +97,7 @@ void TitleBlockPropertiesWidget::setProperties(const TitleBlockProperties &prope
|
||||
ui -> m_author_le -> setText (properties.author);
|
||||
ui -> m_file_le -> setText (properties.filename);
|
||||
ui -> m_mach -> setText (properties.machine);
|
||||
ui -> m_group_f -> setText (properties.funcgroup);
|
||||
ui -> m_loc -> setText (properties.locmach);
|
||||
ui -> m_indice -> setText (properties.indexrev);
|
||||
ui -> m_folio_le -> setText (properties.folio);
|
||||
@@ -155,7 +156,8 @@ TitleBlockProperties TitleBlockPropertiesWidget::properties() const {
|
||||
prop.author = ui -> m_author_le -> text();
|
||||
prop.filename = ui -> m_file_le -> text();
|
||||
prop.machine = ui -> m_mach -> text();
|
||||
prop.locmach = ui -> m_loc -> text();
|
||||
prop.funcgroup = ui -> m_group_f -> text();
|
||||
prop.locmach = ui -> m_loc -> text();
|
||||
prop.indexrev = ui -> m_indice -> text();
|
||||
prop.folio = ui -> m_folio_le -> text();
|
||||
prop.display_at = ui -> m_display_at_cb -> currentIndex() == 0 ? Qt::BottomEdge : Qt::RightEdge;
|
||||
@@ -196,6 +198,7 @@ TitleBlockProperties TitleBlockPropertiesWidget::propertiesAutoNum(QString autoN
|
||||
prop.author = ui -> m_author_le -> text();
|
||||
prop.filename = ui -> m_file_le -> text();
|
||||
prop.machine = ui -> m_mach -> text();
|
||||
prop.funcgroup = ui -> m_group_f -> text();
|
||||
prop.locmach = ui -> m_loc -> text();
|
||||
prop.indexrev = ui -> m_indice -> text();
|
||||
prop.folio = "%autonum";
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true"> </string>
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../qelectrotech.qrc">
|
||||
@@ -93,7 +93,7 @@
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true"> </string>
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../qelectrotech.qrc">
|
||||
@@ -220,7 +220,7 @@
|
||||
<item row="9" column="1">
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="text">
|
||||
<string>Indice Rev</string>
|
||||
<string>Indice Rev:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -373,10 +373,20 @@ Les variables suivantes sont utilisables :
|
||||
<item row="8" column="1">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>Localisation</string>
|
||||
<string>Localisation:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Groupe fonctionnel:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="3">
|
||||
<widget class="QLineEdit" name="m_group_f"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
||||
@@ -2,6 +2,14 @@
|
||||
<ui version="4.0">
|
||||
<class>XRefPropertiesWidget</class>
|
||||
<widget class="QWidget" name="XRefPropertiesWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>459</width>
|
||||
<height>662</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
@@ -187,6 +195,7 @@
|
||||
%l : le numéro de ligne
|
||||
%c : le numéro de colonne
|
||||
%M: Installation
|
||||
%FG: Groupe fonctionnel
|
||||
%LM: Localisation </string>
|
||||
</property>
|
||||
</widget>
|
||||
|
||||
Reference in New Issue
Block a user