2020-08-31 04:03:41 +08:00
|
|
|
#ifndef CALKIT_H
|
|
|
|
#define CALKIT_H
|
|
|
|
|
|
|
|
#include "touchstone.h"
|
2020-11-08 21:30:19 +08:00
|
|
|
#include "Util/qpointervariant.h"
|
2022-08-26 06:46:53 +08:00
|
|
|
#include "calstandard.h"
|
2022-08-29 04:06:16 +08:00
|
|
|
#include "savable.h"
|
2021-10-21 19:00:34 +08:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <complex>
|
2020-11-08 21:30:19 +08:00
|
|
|
#include <QDir>
|
2020-08-31 04:03:41 +08:00
|
|
|
|
2022-08-29 04:06:16 +08:00
|
|
|
class Calkit : public Savable
|
2020-08-31 04:03:41 +08:00
|
|
|
{
|
|
|
|
friend class CalkitDialog;
|
|
|
|
public:
|
|
|
|
Calkit();
|
2022-03-17 19:53:13 +08:00
|
|
|
Calkit(const Calkit&) = default;
|
2020-11-08 21:30:19 +08:00
|
|
|
Calkit& operator=(const Calkit& other)
|
|
|
|
{
|
2021-10-11 00:50:14 +08:00
|
|
|
this->manufacturer = other.manufacturer;
|
|
|
|
this->serialnumber = other.serialnumber;
|
|
|
|
this->description = other.description;
|
2022-08-26 06:46:53 +08:00
|
|
|
this->standards = other.standards;
|
2020-11-08 21:30:19 +08:00
|
|
|
return *this;
|
|
|
|
}
|
2020-08-31 04:03:41 +08:00
|
|
|
|
2020-10-03 19:01:59 +08:00
|
|
|
class SOLT {
|
2020-08-31 04:03:41 +08:00
|
|
|
public:
|
|
|
|
std::complex<double> Open;
|
|
|
|
std::complex<double> Short;
|
|
|
|
std::complex<double> Load;
|
|
|
|
std::complex<double> ThroughS11, ThroughS12, ThroughS21, ThroughS22;
|
|
|
|
};
|
|
|
|
|
2020-10-03 19:01:59 +08:00
|
|
|
class TRL {
|
|
|
|
public:
|
|
|
|
bool reflectionIsNegative;
|
|
|
|
std::complex<double> ThroughS11, ThroughS12, ThroughS21, ThroughS22;
|
|
|
|
};
|
|
|
|
|
2020-11-11 02:16:16 +08:00
|
|
|
void toFile(QString filename);
|
|
|
|
static Calkit fromFile(QString filename);
|
2022-01-02 03:11:03 +08:00
|
|
|
void edit(std::function<void(void)> updateCal = nullptr);
|
2020-10-03 19:01:59 +08:00
|
|
|
|
2022-08-27 21:28:45 +08:00
|
|
|
std::vector<CalStandard::Virtual *> getStandards() const;
|
|
|
|
|
2022-08-29 04:06:16 +08:00
|
|
|
virtual nlohmann::json toJSON() override;
|
|
|
|
virtual void fromJSON(nlohmann::json j) override;
|
|
|
|
|
2020-08-31 04:03:41 +08:00
|
|
|
private:
|
2022-08-27 01:25:24 +08:00
|
|
|
void clearStandards();
|
2021-10-11 00:50:14 +08:00
|
|
|
QString manufacturer, serialnumber, description;
|
2022-08-26 06:46:53 +08:00
|
|
|
std::vector<CalStandard::Virtual*> standards;
|
2020-08-31 04:03:41 +08:00
|
|
|
|
2022-01-16 00:00:57 +08:00
|
|
|
const std::vector<Savable::SettingDescription> descr = {{
|
2021-10-11 00:50:14 +08:00
|
|
|
{&manufacturer, "Manufacturer", ""},
|
|
|
|
{&serialnumber, "Serialnumber", ""},
|
|
|
|
{&description, "Description", ""},
|
2020-11-08 21:30:19 +08:00
|
|
|
}};
|
2020-08-31 04:03:41 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CALKIT_H
|