#ifndef CALKIT_H #define CALKIT_H #include "touchstone.h" #include "Util/qpointervariant.h" #include "calstandard.h" #include "savable.h" #include "scpi.h" #include "LibreCAL/caldevice.h" #include #include #include class Calkit : public Savable, public SCPINode { friend class CalkitDialog; friend class LibreCALDialog; public: Calkit(); Calkit(const Calkit&) = default; Calkit& operator=(const Calkit& other) { this->manufacturer = other.manufacturer; this->serialnumber = other.serialnumber; this->description = other.description; this->standards = other.standards; return *this; } class SOLT { public: std::complex Open; std::complex Short; std::complex Load; std::complex ThroughS11, ThroughS12, ThroughS21, ThroughS22; }; class TRL { public: bool reflectionIsNegative; std::complex ThroughS11, ThroughS12, ThroughS21, ThroughS22; }; void toFile(QString filename); static Calkit fromFile(QString filename); void edit(std::function updateCal = nullptr); std::vector getStandards() const; void addStandard(CalStandard::Virtual* s); virtual nlohmann::json toJSON() override; virtual void fromJSON(nlohmann::json j) override; private: void clearStandards(); QString manufacturer, serialnumber, description; std::vector standards; const std::vector descr = {{ {&manufacturer, "Manufacturer", ""}, {&serialnumber, "Serialnumber", ""}, {&description, "Description", ""}, }}; }; #endif // CALKIT_H