]> git.stg.codes - stg.git/commitdiff
Merge branch 'stg-2.409'
authorMaxim Mamontov <faust.madf@gmail.com>
Tue, 19 Jul 2016 17:42:17 +0000 (20:42 +0300)
committerMaxim Mamontov <faust.madf@gmail.com>
Tue, 19 Jul 2016 17:42:17 +0000 (20:42 +0300)
.gitignore
projects/sgconv/build
projects/stargazer/plugins/configuration/sgconfig/configproto.cpp
projects/stargazer/plugins/store/firebird/firebird_store_tariffs.cpp
projects/stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp
projects/stargazer/settings_impl.h
stglibs/pinger.lib/Makefile

index ea5489c2714f430eef37c4450c8cfc33864057ed..0b882f23e0fa4c5019174f70b0d80db752672eb5 100644 (file)
@@ -23,5 +23,6 @@ Makefile.conf
 projects/convertor/convertor
 projects/rscriptd/rscriptd
 projects/sgconf/sgconf
+projects/sgconf_xml/sgconf_xml
 doc/xmlrpc-doc/book
 doc/help/book
index 1bc23718283273258ff76eaaca402b2592ebb7d9..3c2f3f91367aae62e8cf88fdf6c9b47cc1e17228 100755 (executable)
@@ -72,7 +72,6 @@ printf "       Building sgconv for $sys $release\n"
 printf "#############################################################################\n"
 
 STG_LIBS="logger.lib
-          locker.lib
           crypto.lib
           common.lib
           conffiles.lib
index f012fa1a7e6c1a192ddc5b8beb6691f7c62a117b..f5a57a48ca11a6c377620b0892481335d4e3f7ef 100644 (file)
@@ -83,7 +83,6 @@ int CONFIGPROTO::Prepare()
     sigaddset(&sigmask, SIGUSR1);
     sigaddset(&sigmask, SIGHUP);
     pthread_sigmask(SIG_BLOCK, &sigmask, &oldmask);
-
     m_listenSocket = socket(PF_INET, SOCK_STREAM, 0);
 
     if (m_listenSocket < 0)
index 5e61cabbe451e42f43a62d653077002c00d4e005..138a9ed92a8a72a2c13086b168e0ccf286165b0e 100644 (file)
 #include "firebird_store.h"
 #include "stg/ibpp.h"
 
+namespace
+{
+
+const int pt_mega = 1024 * 1024;
+
+}
+
 //-----------------------------------------------------------------------------
 int FIREBIRD_STORE::GetTariffsList(std::vector<std::string> * tariffsList) const
 {
@@ -304,8 +311,8 @@ try
     st->Get(7, td->dirPrice[dir].priceNightB);
     td->dirPrice[dir].priceNightB /= 1024*1024;
     st->Get(8, td->dirPrice[dir].threshold);
-    if (std::fabs(td->dirPrice[dir].priceDayA - td->dirPrice[dir].priceNightA) < 1.0e-3 &&
-        std::fabs(td->dirPrice[dir].priceDayB - td->dirPrice[dir].priceNightB) < 1.0e-3)
+    if (std::fabs(td->dirPrice[dir].priceDayA - td->dirPrice[dir].priceNightA) < 1.0e-3 / pt_mega &&
+        std::fabs(td->dirPrice[dir].priceDayB - td->dirPrice[dir].priceNightB) < 1.0e-3 / pt_mega)
         {
         td->dirPrice[dir].singlePrice = true;
         }
index dabc06db5586a9c5232eebef51fd66936f123986..045411b1499f822400cfc860831a1ebd6661d1d9 100644 (file)
 #include "postgresql_store.h"
 #include "stg/locker.h"
 
+namespace
+{
+
+const int pt_mega = 1024 * 1024;
+
+}
+
 //-----------------------------------------------------------------------------
 int POSTGRESQL_STORE::GetTariffsList(std::vector<std::string> * tariffsList) const
 {
@@ -568,8 +575,8 @@ for (int i = 0; i < std::min(tuples, DIR_NUM); ++i)
         tuple >> td->dirPrice[dir].mNight;
         }
 
-    if (std::fabs(td->dirPrice[dir].priceDayA - td->dirPrice[dir].priceNightA) > 1.0e-3 &&
-        std::fabs(td->dirPrice[dir].priceDayB - td->dirPrice[dir].priceNightB) > 1.0e-3)
+    if (std::fabs(td->dirPrice[dir].priceDayA - td->dirPrice[dir].priceNightA) < 1.0e-3 / pt_mega &&
+        std::fabs(td->dirPrice[dir].priceDayB - td->dirPrice[dir].priceNightB) < 1.0e-3 / pt_mega)
         {
         td->dirPrice[dir].singlePrice = true;
         }
index ec8c9cb17d22c72bdd115fb68470a024131109fb..20d82869983fc78e1871814645eec496d874a169 100644 (file)
@@ -42,7 +42,6 @@
 
 #include "stg/settings.h"
 #include "stg/common.h"
-#include "stg/logger.h"
 #include "stg/module_settings.h"
 
 //-----------------------------------------------------------------------------
index c8c09b3e7ec258005800aefbb153cb94a255a5d9..803f7ac4edffd2464652fe8547937b35b0f42bad 100644 (file)
@@ -10,8 +10,7 @@ INCS = pinger.h
 
 LIBS = $(LIB_THREAD)
 
-LIB_INCS = -I ../locker.lib/include \
-          -I ../common.lib/include
+LIB_INCS = -I ../common.lib/include
 
 include ../Makefile.in