git-svn-id: svn://db.shs.com.ru/libs@395 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2018-06-04 13:34:16 +00:00
parent cd63546e74
commit 700e331cb9
6 changed files with 21 additions and 2 deletions

View File

@@ -217,6 +217,12 @@ void CDCore::stop() {
} }
void CDCore::release() {
stop();
connection.removeAllDevices();
}
void CDCore::startX(double freq) { void CDCore::startX(double freq) {
//piCout << "start x" << x_timer.isRunning() << freq; //piCout << "start x" << x_timer.isRunning() << freq;
if (!x_timer.isRunning()) if (!x_timer.isRunning())
@@ -225,7 +231,7 @@ void CDCore::startX(double freq) {
void CDCore::stopX() { void CDCore::stopX() {
x_timer.stop(); x_timer.stop(true);
} }

View File

@@ -63,6 +63,7 @@ public:
void initPult(); void initPult();
void init(const PIString & configuration, bool pult = false); void init(const PIString & configuration, bool pult = false);
void stop(); void stop();
void release();
void startX(double freq = 20.); void startX(double freq = 20.);
void stopX(); void stopX();
void sendCommand(const CDType & c); void sendCommand(const CDType & c);

View File

@@ -125,11 +125,16 @@ bool Interface::configure(const PIString & config) {
} }
void Interface::reinitConnection(const PIString &configuration) { void Interface::reinitConnection(const PIString & configuration) {
core->init(configuration); core->init(configuration);
} }
void Interface::releaseConnection() {
core->release();
}
void Interface::write(PIIODevice * d) { void Interface::write(PIIODevice * d) {
core->cd_write(s, d); core->cd_write(s, d);
} }

View File

@@ -37,6 +37,7 @@ public:
void setFileName(const PIString & _file); void setFileName(const PIString & _file);
bool configure(const PIString & config); bool configure(const PIString & config);
void reinitConnection(const PIString & configuration); void reinitConnection(const PIString & configuration);
void releaseConnection();
void write(PIIODevice * d); void write(PIIODevice * d);
void read(PIIODevice * d); void read(PIIODevice * d);
void parse(PIIODevice * d); void parse(PIIODevice * d);

View File

@@ -139,3 +139,8 @@ QSize preferredIconSize(float x) {
int s = qMax<int>(8, qRound(fontHeight() * x)); int s = qMax<int>(8, qRound(fontHeight() * x));
return QSize(s, s); return QSize(s, s);
} }
double appScale() {
return qMax<double>(fontHeight() / 15., 1.);
}

View File

@@ -120,6 +120,7 @@ QString uniqueName(QString n, const QStringList & names);
int fontHeight(); int fontHeight();
int lineThickness(); int lineThickness();
QSize preferredIconSize(float x = 1.f); QSize preferredIconSize(float x = 1.f);
double appScale();
#endif // QAD_TYPES_H #endif // QAD_TYPES_H