| | |
| | | |
| | | CGlass::~CGlass() |
| | | { |
| | | |
| | | reset(); |
| | | } |
| | | |
| | | void CGlass::reset() |
| | |
| | | CPath* CGlass::getPath() |
| | | { |
| | | return m_pPath; |
| | | } |
| | | |
| | | std::string CGlass::getPathDescription() |
| | | { |
| | | std::string strOut, strPath; |
| | | char szBuffer[256]; |
| | | |
| | | CPath* pTemp = m_pPath; |
| | | while (pTemp != nullptr) { |
| | | pTemp->getSimpleDescription(strPath); |
| | | strOut.append(strPath); |
| | | |
| | | pTemp = pTemp->getNext(); |
| | | if (pTemp != nullptr) { |
| | | strOut.append(" -> "); |
| | | } |
| | | } |
| | | |
| | | return strOut; |
| | | } |
| | | |
| | | CPath* CGlass::getPathWithEq(unsigned int nEqId, unsigned int nUnit) |
| | |
| | | { |
| | | m_tEnd = std::chrono::system_clock::now(); |
| | | } |
| | | |
| | | void CGlass::addParams(std::vector<CParam>& params) |
| | | { |
| | | m_params.insert(m_params.end(), params.begin(), params.end()); |
| | | } |
| | | |
| | | std::vector<CParam>& CGlass::getParams() |
| | | { |
| | | return m_params; |
| | | } |
| | | |
| | | std::string CGlass::getParamsDescription() |
| | | { |
| | | std::string strOut; |
| | | |
| | | char szBuffer[256]; |
| | | for (auto p : m_params) { |
| | | if (!strOut.empty()) strOut.append(","); |
| | | if (p.getValueType() == PVT_INT) { |
| | | sprintf_s(szBuffer, 256, "%s:%d", p.getName().c_str(), p.getIntValue()); |
| | | } |
| | | else if (p.getValueType() == PVT_DOUBLE) { |
| | | sprintf_s(szBuffer, 256, "%s:%f", p.getName().c_str(), p.getDoubleValue()); |
| | | } |
| | | strOut.append(szBuffer); |
| | | } |
| | | |
| | | return strOut; |
| | | } |
| | | } |