Kstars

dslrlens.cpp
1/*
2 SPDX-FileCopyrightText: 2021 Jasem Mutlaq
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#include "oal/dslrlens.h"
8#include <QJsonObject>
9
10void OAL::DSLRLens::setDSLRLens(const QString &_id, const QString &_model, const QString &_vendor, double _focalLength, double _focalRatio)
11{
12 m_Id = _id;
13 m_Model = _model;
14 m_Vendor = _vendor;
15 m_FocalLength = _focalLength;
16 m_FocalRatio = _focalRatio;
17
18 m_Name = QString("%1 %2 %3@F/%4").arg(m_Vendor, m_Model, QString::number(m_FocalLength, 'f', 0), QString::number(m_FocalRatio, 'f', 1));
19}
20
21QJsonObject OAL::DSLRLens::toJson() const
22{
23 return
24 {
25 {"id", m_Id},
26 {"model", m_Model},
27 {"vendor", m_Vendor},
28 {"name", m_Name},
29 {"focal_length", m_FocalLength},
30 {"focal_ratio", m_FocalRatio},
31 };
32}
QString arg(Args &&... args) const const
QString number(double n, char format, int precision)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:38:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.