From f30c74942867f0505ce53afcc9a0c47c853938cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B5=D0=BB=D0=B8=D0=BF=D0=B5=D0=BD=D0=BA=D0=BE=20?= =?UTF-8?q?=D0=98=D0=B2=D0=B0=D0=BD?= Date: Wed, 13 Jul 2016 13:40:33 +0000 Subject: [PATCH] git-svn-id: svn://db.shs.com.ru/libs@98 a8b55f48-bf90-11e4-a774-851b48703e85 --- CMakeLists.txt | 2 +- cd_utils/CMakeLists.txt | 5 +- cd_utils/cdutils_core.cpp | 94 +++++++++++++++++++++++++++++++----- cd_utils/cdutils_core.h | 20 +++++++- cd_utils/cdutils_k.cpp | 55 +++++++++++++++++++++ cd_utils/cdutils_k.h | 41 ++++++++++++++++ cd_utils/cdutils_k_types.cpp | 77 +++++++++++++++++++++++++++++ cd_utils/cdutils_k_types.h | 40 ++++++++------- cd_utils/cdutilstest.cpp | 34 ++++++++++++- qad_graphic/graphic.cpp | 14 ++++++ 10 files changed, 346 insertions(+), 36 deletions(-) create mode 100644 cd_utils/cdutils_k.cpp create mode 100644 cd_utils/cdutils_k.h create mode 100644 cd_utils/cdutils_k_types.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index b1723be..f784462 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ set(PIP_FOLDERS "." "core" "containers" "thread" "system" "io" "console" "math" foreach(F ${PIP_FOLDERS}) set(PIP_INCLUDES ${PIP_INCLUDES} "../pip/src/${F}") endforeach(F) -set(LIST_LIBS pip qad_widgets qad_utils qad_application qad_blockview qad_graphic qad_sql_table piqt mbricks kx_utils piqt_utils touch_widgets qglview) +set(LIST_LIBS pip qad_widgets qad_utils qad_application qad_blockview qad_graphic qad_sql_table piqt mbricks cd_utils kx_utils piqt_utils touch_widgets qglview) foreach(L ${LIST_LIBS}) add_subdirectory(${L}) include_directories(${L}) diff --git a/cd_utils/CMakeLists.txt b/cd_utils/CMakeLists.txt index ebd073e..d7a0fd8 100644 --- a/cd_utils/CMakeLists.txt +++ b/cd_utils/CMakeLists.txt @@ -15,8 +15,8 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wall") if (DEBUG) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3") endif () -set(CPPS_UTILS "cdutils_core.cpp") -set(HDRS_UTILS "cdutils_core.h") +set(CPPS_UTILS "cdutils_core.cpp" "cdutils_k_types.cpp" "cdutils_k.cpp") +set(HDRS_UTILS "cdutils_core.h" "cdutils_k_types.h" "cdutils_k.h") if (DEFINED ENV{QNX_HOST}) add_library(${PROJECT_NAME} STATIC ${CPPS_UTILS} ${HDRS_UTILS}) else () @@ -25,6 +25,7 @@ endif () target_link_libraries(${PROJECT_NAME} ${PIP_LIBRARY}) add_executable(cdutilsngtest "cdutilstest.cpp") +add_definitions(-DCDPULT) target_link_libraries(cdutilsngtest ${PIP_LIBRARY} ${PROJECT_NAME}) # if (NOT DEFINED ENV{QNX_HOST}) diff --git a/cd_utils/cdutils_core.cpp b/cd_utils/cdutils_core.cpp index eef6e45..c525cad 100644 --- a/cd_utils/cdutils_core.cpp +++ b/cd_utils/cdutils_core.cpp @@ -1,21 +1,24 @@ #include "cdutils_core.h" +#include "piconfig.h" using namespace CDUtils; -static const char connection_config[] = -"include = ip.conf\n\ +const char Core::app_config[] = +"include = cd_ip.conf\n\ +port_rec = 2\n\ +port_send = 1\n\ [connection]\n\ -device.c = eth://UDP:127.0.0.1:36102:127.0.0.1:36101 #s\n\ +device.c = eth://UDP:127.0.0.1:3610${port_rec}:127.0.0.1:3610${port_send} #s\n\ device.c.disconnectTimeout = 3.00000000 #f\n\ -device.k = eth://UDP:127.0.0.1:26102:127.0.0.1:26101 #s\n\ +device.k = eth://UDP:127.0.0.1:2610${port_rec}:127.0.0.1:2610${port_send} #s\n\ device.k.disconnectTimeout = 3.00000000 #f\n\ -device.x = eth://UDP:127.0.0.1:16102:127.0.0.1:16101 #s\n\ +device.x = eth://UDP:127.0.0.1:1610${port_rec}:127.0.0.1:1610${port_send} #s\n\ device.x.disconnectTimeout = 3.00000000 #f\n\ -device.c_eth = eth://UDP:${ip_kx}:36102:${ip_kxpult}:36101 #s\n\ +device.c_eth = eth://UDP:${ip_app}:3610${port_rec}:${ip_pult}:3610${port_send} #s\n\ device.c_eth.disconnectTimeout = 3.00000000 #f\n\ -device.k_eth = eth://UDP:${ip_kx}:26102:${ip_kxpult}:26101 #s\n\ +device.k_eth = eth://UDP:${ip_app}:2610${port_rec}:${ip_pult}:2610${port_send} #s\n\ device.k_eth.disconnectTimeout = 3.00000000 #f\n\ -device.x_eth = eth://UDP:${ip_kx}:16102:${ip_kxpult}:16101 #s\n\ +device.x_eth = eth://UDP:${ip_app}:1610${port_rec}:${ip_pult}:1610${port_send} #s\n\ device.x_eth.disconnectTimeout = 3.00000000 #f\n\ channel.0.from = c_eth #s\n\ channel.0.to = c #s\n\ @@ -24,8 +27,29 @@ channel.1.to = k #s\n\ channel.2.from = x_eth #s\n\ channel.2.to = x #s\n\ []\n\ -connectionmodel = AAAWNHja7ZbfShtBFMa/Xf9UrYLSXnqhErxrdSNYKBRXEMQbEVGhBBRJgob4J6SxSZBC38ELb32UBR/AV/ARfAP9MjmzyQ7TGGkaGzeznMycmTNnZn/zLRkAH5HGOc74ZNkqIac8YBhwLlk7tEHUi1trP7KwHqCN+AhLLeYHpqC7HEeFqbLygJal3XHfPjxE2/kX69UxYK32en62vnqwIXvJwOr7m1JLvPZZ3tGmBR0ErSNYXY20gbuPvxl/eSaKuxxY/RC/xPfxdwb/3u8o7u+w+iF+ie/j7wj+IBXFH+zD6mvcOr7L+PXW3xz+nIH7KLD6If4c+urvIP6qgb96Y/VD/NW/xa/W5rj7SeImg2Jg5nRlji7M4dwJk1U9jzaOAz4lVFHgHUuOsjEHo9IXnrceXJe+cbXQGQ5xak3wgTYG9ZPnSlmudWykuo7sJ8OYn7zppa3pDnS6PUn1FQt8dnkYW2wncMmpBYblUcEv9iSxDA+LrM3RAi5wwhzNUZ6xtW+Rtzzl9TPTGtOAkSAlCeZpc5yc48cQvdPusK+G7pzbKVlST6gT90ciX9Rgk8TnZdIYyigyWUntEGrHRbYPkWkIq0k0CfSCaCqvIRqvLdF48RONX7jvBdGkX0M0S22JZik2opk1RaP/Ev8gmttOimalTdG816fsElE0xdULxJLSabatYvEoii/4zGOvm2fIpdV4jISi7zH/uVDy3RVK8hmhJGMolAR6QSiV7grFe0YoMbivPAGq7YwD" -; +connectionmodel = AAAWNHja7ZbfShtBFMa/Xf9UrYLSXnqhErxrdSNYKBRXEMQbEVGhBBRJgob4J6SxSZBC38ELb32UBR/AV/ARfAP9MjmzyQ7TGGkaGzeznMycmTNnZn/zLRkAH5HGOc74ZNkqIac8YBhwLlk7tEHUi1trP7KwHqCN+AhLLeYHpqC7HEeFqbLygJal3XHfPjxE2/kX69UxYK32en62vnqwIXvJwOr7m1JLvPZZ3tGmBR0ErSNYXY20gbuPvxl/eSaKuxxY/RC/xPfxdwb/3u8o7u+w+iF+ie/j7wj+IBXFH+zD6mvcOr7L+PXW3xz+nIH7KLD6If4c+urvIP6qgb96Y/VD/NW/xa/W5rj7SeImg2Jg5nRlji7M4dwJk1U9jzaOAz4lVFHgHUuOsjEHo9IXnrceXJe+cbXQGQ5xak3wgTYG9ZPnSlmudWykuo7sJ8OYn7zppa3pDnS6PUn1FQt8dnkYW2wncMmpBYblUcEv9iSxDA+LrM3RAi5wwhzNUZ6xtW+Rtzzl9TPTGtOAkSAlCeZpc5yc48cQvdPusK+G7pzbKVlST6gT90ciX9Rgk8TnZdIYyigyWUntEGrHRbYPkWkIq0k0CfSCaCqvIRqvLdF48RONX7jvBdGkX0M0S22JZik2opk1RaP/Ev8gmttOimalTdG816fsElE0xdULxJLSabatYvEoii/4zGOvm2fIpdV4jISi7zH/uVDy3RVK8hmhJGMolAR6QSiV7grFe0YoMbivPAGq7YwD\n\ +"; + +const char Core::pult_config[] = +"include = cd_ip.conf\n\ +port_rec = 1\n\ +port_send = 2\n\ +[connection]\n\ +device.c = eth://UDP:127.0.0.1:3610${port_rec}:127.0.0.1:3610${port_send} #s\n\ +device.c.disconnectTimeout = 3.00000000 #f\n\ +device.k = eth://UDP:127.0.0.1:2610${port_rec}:127.0.0.1:2610${port_send} #s\n\ +device.k.disconnectTimeout = 3.00000000 #f\n\ +device.x = eth://UDP:127.0.0.1:1610${port_rec}:127.0.0.1:1610${port_send} #s\n\ +device.x.disconnectTimeout = 3.00000000 #f\n\ +device.c_eth = eth://UDP:${ip_pult}:3610${port_rec}:${ip_app}:3610${port_send} #s\n\ +device.c_eth.disconnectTimeout = 3.00000000 #f\n\ +device.k_eth = eth://UDP:${ip_pult}:2610${port_rec}:${ip_app}:2610${port_send} #s\n\ +device.k_eth.disconnectTimeout = 3.00000000 #f\n\ +device.x_eth = eth://UDP:${ip_pult}:1610${port_rec}:${ip_app}:1610${port_send} #s\n\ +device.x_eth.disconnectTimeout = 3.00000000 #f\n\ +[]\n\ +connectionmodel = AAAWNHja7ZbfShtBFMa/Xf9UrYLSXnqhErxrdSNYKBRXEMQbEVGhBBRJgob4J6SxSZBC38ELb32UBR/AV/ARfAP9MjmzyQ7TGGkaGzeznMycmTNnZn/zLRkAH5HGOc74ZNkqIac8YBhwLlk7tEHUi1trP7KwHqCN+AhLLeYHpqC7HEeFqbLygJal3XHfPjxE2/kX69UxYK32en62vnqwIXvJwOr7m1JLvPZZ3tGmBR0ErSNYXY20gbuPvxl/eSaKuxxY/RC/xPfxdwb/3u8o7u+w+iF+ie/j7wj+IBXFH+zD6mvcOr7L+PXW3xz+nIH7KLD6If4c+urvIP6qgb96Y/VD/NW/xa/W5rj7SeImg2Jg5nRlji7M4dwJk1U9jzaOAz4lVFHgHUuOsjEHo9IXnrceXJe+cbXQGQ5xak3wgTYG9ZPnSlmudWykuo7sJ8OYn7zppa3pDnS6PUn1FQt8dnkYW2wncMmpBYblUcEv9iSxDA+LrM3RAi5wwhzNUZ6xtW+Rtzzl9TPTGtOAkSAlCeZpc5yc48cQvdPusK+G7pzbKVlST6gT90ciX9Rgk8TnZdIYyigyWUntEGrHRbYPkWkIq0k0CfSCaCqvIRqvLdF48RONX7jvBdGkX0M0S22JZik2opk1RaP/Ev8gmttOimalTdG816fsElE0xdULxJLSabatYvEoii/4zGOvm2fIpdV4jISi7zH/uVDy3RVK8hmhJGMolAR6QSiV7grFe0YoMbivPAGq7YwD\n\ +"; int __Core_Initializer__::count_(0); @@ -52,19 +76,65 @@ __Core_Initializer__::~__Core_Initializer__() { -Core::Core() { + +Core::Core(const char * conf) { CONNECTU(&connection, dataReceivedEvent, this, dataReceived); - PIString s(connection_config); + PIString s(conf); connection.configureFromString(&s); connection.start(); + k_[1] = KType(1, "123", "120+3", "comment"); + k_[2] = KType(2, "1", "2", "comm"); + k_[4] = KType(4, "-0.6", "-6/10", "mment"); + k_.section(10)[5] = KType(5, "8", "2*2*2", "88"); + k_.section(10).section(50)[100] = KType(100, "8", "2*2*2", "88"); + k_.section(11)[3] = KType(3, "1", "1", "88"); + k_.section(11)[4] = KType(4, "0", "0", "88"); + k_.section(11)[6] = KType(6, "0", "0", "88"); + //piCout << s; +} + + +void Core::k_rec(const PIByteArray & data) { + +} + + +void Core::x_rec(const PIByteArray & data) { + +} + + +void Core::c_rec(const PIByteArray & data) { + +} + + +void Core::k_write(PIIODevice * d) { + k_.write(d, PIString()); +} + + +void Core::k_read(PIIODevice * d) { + PIConfig conf(d, PIIODevice::ReadOnly); + k_.read(&(conf.rootEntry())); } void CDUtils::Core::dataReceived(const PIString & from, const PIByteArray & data) { piCout << from << data; + if (data.size_s() < 4) return; + if (from == "k") k_rec(data); + if (from == "x") x_rec(data); + if (from == "c") c_rec(data); } void Core::K_Send() { + piCoutObj << "K_Send"; +} + + +void Core::K_Request() { + piCoutObj << "K_Request"; } diff --git a/cd_utils/cdutils_core.h b/cd_utils/cdutils_core.h index ab2538e..e31c4c2 100644 --- a/cd_utils/cdutils_core.h +++ b/cd_utils/cdutils_core.h @@ -27,16 +27,32 @@ class Core: public PIObject public: static Core * instance() {return __Core_Initializer__::__instance__;} + EVENT(K_Sended) EVENT(K_Received) EVENT_HANDLER(void, K_Send); + EVENT_HANDLER(void, K_Request); + + KSection k_; + + void k_write(PIIODevice * d); + void k_read(PIIODevice * d); private: - Core(); + Core(const char * conf = +#ifdef CDPULT + pult_config +#else + app_config +#endif + ); EVENT_HANDLER2(void, dataReceived, const PIString &, from, const PIByteArray &, data); + void k_rec(const PIByteArray & data); + void x_rec(const PIByteArray & data); + void c_rec(const PIByteArray & data); + static const char app_config[], pult_config[]; PIConnection connection; - KSection k_plain; PIMap > k_sections; // [enum KSection][index] = CDUtils::KSection }; diff --git a/cd_utils/cdutils_k.cpp b/cd_utils/cdutils_k.cpp new file mode 100644 index 0000000..e9018ae --- /dev/null +++ b/cd_utils/cdutils_k.cpp @@ -0,0 +1,55 @@ +#include "cdutils_k.h" +#include "cdutils_core.h" + +using namespace CDUtils; + + +KInterface::KInterface() { + core = Core::instance(); + CONNECTU(core, K_Sended, this, sended); + CONNECTU(core, K_Received, this, received); +} + + +bool KInterface::test(int v) { + return core->k_.test(v); +} + + +KType & KInterface::operator [](int v) { + return core->k_[v]; +} + + +const KType KInterface::operator [](int v) const { + return core->k_[v]; +} + + +KSection & KInterface::section(int v) { + return core->k_.section(v); +} + + +const KSection KInterface::section(int v) const { + return core->k_.section(v); +} + + +void KInterface::send() { + core->K_Send(); +} + +void KInterface::request() { + core->K_Request(); +} + + +void KInterface::write(PIIODevice * d) { + core->k_write(d); +} + + +void KInterface::read(PIIODevice * d) { + core->k_read(d); +} diff --git a/cd_utils/cdutils_k.h b/cd_utils/cdutils_k.h new file mode 100644 index 0000000..dc8f073 --- /dev/null +++ b/cd_utils/cdutils_k.h @@ -0,0 +1,41 @@ +#ifndef CDUTILS_K_H +#define CDUTILS_K_H + +#include "cdutils_k_types.h" +#include "piobject.h" + + +namespace CDUtils { + +class Core; + + +class KInterface: public PIObject +{ + PIOBJECT(CDUtils::KInterface) +public: + KInterface(); + + bool test(int v); + KType & operator [](int v); + const KType operator [](int v) const; + KSection & section(int v); + const KSection section(int v) const; + + EVENT(sended) + EVENT(received) + EVENT_HANDLER(void, send); + EVENT_HANDLER(void, request); + void write(PIIODevice * d); + void read(PIIODevice * d); +private: + Core * core; + +}; + + +static KInterface K; + +} + +#endif // CDUTILS_K_H diff --git a/cd_utils/cdutils_k_types.cpp b/cd_utils/cdutils_k_types.cpp new file mode 100644 index 0000000..a13d892 --- /dev/null +++ b/cd_utils/cdutils_k_types.cpp @@ -0,0 +1,77 @@ +#include "cdutils_k_types.h" +#include "piconfig.h" + +using namespace CDUtils; + + +KType::KType() { + index_ = -1; + value_d = 0.; + value_i = 0; + value_b = false; +} + + +KType::KType(int i, const PIString & v, const PIString & f, const PIString & c) { + index_ = i; + value_s = v; + formula_ = f; + comment_ = c; + value_d = v.toDouble(); + value_i = v.toInt(); + value_b = v.toBool(); +} + + +void KSection::write(PIIODevice * d, const PIString & prefix) { + if (!d) return; + if (k.isEmpty() && s.isEmpty()) return; + PIString l; + if (!k.isEmpty()) { + if (prefix.isEmpty()) l = "[k]"; + else l = "[" + prefix + ".k]"; + l += "\n"; + d->write(l.toByteArray()); + PIMap::iterator i; + for (i = k.begin(); i != k.end(); ++i) { + KType & ck(i.value()); + l.clear(); + l << ck.index() << ".f = " << ck.formula() << " #s " << ck.comment() << "\n"; + l << ck.index() << ".v = " << ck.value() << "\n"; + d->write(l.toByteArray()); + } + } + if (!s.isEmpty()) { + if (prefix.isEmpty()) l = "s"; + else l = prefix + ".s"; + PIMap::iterator j; + for (j = s.begin(); j != s.end(); ++j) { + j.value().write(d, l + "." + PIString::fromNumber(j.key())); + } + } + if (prefix.isEmpty()) { + l = "[]\n"; + d->write(l.toByteArray()); + } +} + + +void KSection::read(const void * ep) { + k.clear(); + s.clear(); + PIConfig::Entry & e(*(PIConfig::Entry*)ep); + PIConfig::Entry & kl = e.getValue("k"); + for (int i = 0; i < kl.childCount(); ++i) { + const PIConfig::Entry * ke(kl.child(i)); + int kid = ke->name().toInt(); + k[kid] = KType(kid, ke->getValue("v").value(), ke->getValue("f").value(), ke->getValue("f").comment()); + } + PIConfig::Entry & sl = e.getValue("s"); + for (int i = 0; i < sl.childCount(); ++i) { + const PIConfig::Entry * se(sl.child(i)); + int sid = se->name().toInt(); + KSection cs; + cs.read(se); + s[sid] = cs; + } +} diff --git a/cd_utils/cdutils_k_types.h b/cd_utils/cdutils_k_types.h index fa5e259..5137d91 100644 --- a/cd_utils/cdutils_k_types.h +++ b/cd_utils/cdutils_k_types.h @@ -2,26 +2,18 @@ #define CDUTILS_K_TYPES_H #include "pistring.h" +#include "pimap.h" + +class PIIODevice; namespace CDUtils { class KType { public: - KType() { - value_d = 0.; - value_i = 0; - value_b = false; - } - KType(const PIString & v, const PIString & f, const PIString & c) { - value_s = v; - formula_ = f; - comment_ = c; - value_d = v.toDouble(); - value_i = v.toInt(); - value_b = v.toBool(); - } - + KType(); + KType(int i, const PIString & v, const PIString & f, const PIString & c); + int index() const {return index_;} PIString value() const {return value_s;} PIString formula() const {return formula_;} PIString comment() const {return comment_;} @@ -32,6 +24,7 @@ public: operator double() const {return value_d;} private: + int index_; PIString value_s, formula_, comment_; double value_d; int value_i; @@ -42,18 +35,31 @@ private: class KSection { friend class Core; + friend class KInterface; public: + KSection() {} + bool test(int v) {return k.value(v).toBool();} - KType operator [](int v) const {return k[v];} + KType & operator [](int v) {return k[v];} + const KType operator [](int v) const {return k[v];} + KSection & section(int v) {return s[v];} + const KSection section(int v) const {return s[v];} private: - KSection(PIMap k_ = PIMap()) {k = k_;} + KSection(PIMap k_, PIMap s_) { + k = k_; + s = s_; + } + void write(PIIODevice * d, const PIString & prefix = PIString()); + void read(const void * ep); PIMap k; + PIMap s; }; - } +inline PICout operator <<(PICout s, const CDUtils::KType & v) {s.space(); s.setControl(0, true); s << "K[" << v.index() << "] = " << v.value(); s.restoreControl(); return s;} + #endif // CDUTILS_K_TYPES_H diff --git a/cd_utils/cdutilstest.cpp b/cd_utils/cdutilstest.cpp index ffcb7bf..aecb2d3 100644 --- a/cd_utils/cdutilstest.cpp +++ b/cd_utils/cdutilstest.cpp @@ -1,12 +1,42 @@ -#include "cdutils_core.h" +#include "cdutils_k.h" #include "piethernet.h" +#include "piiostring.h" int main(int argc, char *argv[]) { PIEthernet eth; eth.send("127.0.0.1:16102", PIByteArray("data\n", 5)); eth.send("127.0.0.1:26102", PIByteArray("data\n", 5)); eth.send("127.0.0.1:36102", PIByteArray("data\n", 5)); - piMSleep(1000); + PIString s = "[k]\n\ + 1.f = 120+3 #s comment\n\ + 1.v = 123\n\ + 2.f = 2 #s comm\n\ + 2.v = 1\n\ + 4.f = -6/10 #s mment\n\ + 4.v = -0.6\n\ + [s.10.k]\n\ + 5.f = 2*2*2\n\ + 5.v = 8 #s 88\n\ + [s.10.s.50.k]\n\ + 100.f = 2*2*2\n\ + 100.v = 8 #s 88\n\ + [s.11.k]\n\ + 3.f = 1\n\ + 3.v = 1 #s 88 \n\ + 4.f = 0\n\ + 4.v = 0 #s 88 \n\ + 6.f = 0\n\ + 6.v = 0 #s 881 \n\ + []\n\ +"; + PIIOString ios(&s); + CDUtils::K.read(&ios); + + s.clear(); + PIIOString iosw(&s); + CDUtils::K.write(&iosw); + piCout << s; + //piMSleep(1000); //CDUtils::Core::instance()->test(); return 0; } diff --git a/qad_graphic/graphic.cpp b/qad_graphic/graphic.cpp index 1235bd0..069ad99 100644 --- a/qad_graphic/graphic.cpp +++ b/qad_graphic/graphic.cpp @@ -881,6 +881,13 @@ void Graphic::drawGrid() { painter->drawText(cx - rect.width() - dx, cy, str.first); } } + cy = real2canvasY(0.); + if (cy >= 0 && cy <= (hei + 5)) { + QPen _p(grid_pen); + _p.setStyle(Qt::SolidLine); + painter->setPen(_p); + painter->drawLine(gbx, cy, cwid, cy); + } if (hasLblY) { painter->setPen(text_color); painter->save(); @@ -923,6 +930,13 @@ void Graphic::drawGrid() { } } } + cx = real2canvasX(0.); + if (cx <= cwid && cx >= gbx) { + QPen _p(grid_pen); + _p.setStyle(Qt::SolidLine); + painter->setPen(_p); + painter->drawLine(cx, hei + 5, cx, 0); + } } else { int cur_scl[7] = {0,0,0,0,0,0,0}; step = splitRangeDate(range, wid / gridx / font_sz.width() * 1.4, &df, cur_scl);