mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
terminal function can be edited, edted value is applied to element
This commit is contained in:
@@ -85,12 +85,28 @@ class RealTerminal
|
||||
|
||||
ElementData::TerminalType type() const {
|
||||
if (m_element) {
|
||||
return m_element->elementData().m_terminal_type;
|
||||
return m_element->elementData().terminalType();
|
||||
} else {
|
||||
return ElementData::TTGeneric;
|
||||
}
|
||||
}
|
||||
|
||||
ElementData::TerminalFunction function() const {
|
||||
if (m_element) {
|
||||
return m_element->elementData().terminalFunction();
|
||||
} else {
|
||||
return ElementData::TFGeneric;
|
||||
}
|
||||
}
|
||||
|
||||
bool led() const {
|
||||
if (m_element) {
|
||||
return m_element->elementData().terminalLed();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief elementUuid
|
||||
* @return if this real terminal is an element
|
||||
@@ -585,7 +601,9 @@ RealTerminalData TerminalStrip::realTerminalData(int real_terminal_index)
|
||||
if (real_terminal->isElement()) {
|
||||
rtd.Xref_ = autonum::AssignVariables::genericXref(real_terminal->element());
|
||||
}
|
||||
rtd.type_ = real_terminal->type();
|
||||
rtd.type_ = real_terminal->type();
|
||||
rtd.function_ = real_terminal->function();
|
||||
rtd.led_ = real_terminal->led();
|
||||
rtd.is_element = real_terminal->isElement();
|
||||
|
||||
return rtd;
|
||||
@@ -632,6 +650,15 @@ QSharedPointer<PhysicalTerminal> TerminalStrip::physicalTerminal(QSharedPointer<
|
||||
return pt;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TerminalStrip::elementForRealTerminal
|
||||
* @param rt
|
||||
* @return the element associated to \p rt, the returned element can be nullptr;
|
||||
*/
|
||||
Element *TerminalStrip::elementForRealTerminal(QSharedPointer<RealTerminal> rt) const {
|
||||
return rt.data()->element();
|
||||
}
|
||||
|
||||
/************************************************************************************/
|
||||
/************************************************************************************/
|
||||
/************************************************************************************/
|
||||
|
||||
Reference in New Issue
Block a user