Commit 0863a5f9 authored by Pavel Vainerman's avatar Pavel Vainerman

Перенёс испрвления из другой рабочей ветки.

parent 92f74164
......@@ -1259,9 +1259,9 @@ end_private(false)
if( smTestID == DefaultObjectId )
smTestID = getSMTestID();
activateTimeout = conf->getArgPInt("--" + argprefix + "activate-timeout", 40000);
activateTimeout = conf->getArgPInt("--" + argprefix + "activate-timeout", 90000);
int msec = conf->getArgPInt("--" + argprefix + "startup-timeout", 30000);
int msec = conf->getArgPInt("--" + argprefix + "startup-timeout", 50000);
ptStartUpTimeout.setTiming(msec);
// ===================== <variables> =====================
......@@ -1730,9 +1730,9 @@ askPause(uniset_conf()->getPIntProp(cnode,"askPause",2000))
vmonit(smReadyTimeout);
vmonit(activateTimeout);
activateTimeout = conf->getArgPInt("--" + argprefix + "activate-timeout", 40000);
activateTimeout = conf->getArgPInt("--" + argprefix + "activate-timeout", 90000);
int msec = conf->getArgPInt("--" + argprefix + "startup-timeout", 30000);
int msec = conf->getArgPInt("--" + argprefix + "startup-timeout", 60000);
ptStartUpTimeout.setTiming(msec);
}
......
......@@ -8,4 +8,9 @@ libUniSet2Extensions_la_LIBADD = $(SIGC_LIBS) $(POCO_LIBS) $(top_builddir)/lib
libUniSet2Extensions_la_SOURCES = Extensions.cc SMInterface.cc Calibration.cc SingleProcess.cc \
IOBase.cc DigitalFilter.cc PID.cc MTR.cc VTypes.cc UObject_SK.cc
UObject_SK.cc: $(top_builddir)/Utilities/codegen/*.xsl
$(SHEL) $(top_builddir)/Utilities/codegen/uniset2-codegen -l $(top_builddir)/Utilities/codegen -n UObject --no-main $(top_builddir)/Utilities/codegen/tests/uobject.src.xml
mv -f UObject_SK.h ../include/
include $(top_builddir)/include.mk
......@@ -75,7 +75,7 @@ namespace uniset
namespace UHttp
{
// текущая версия API
const std::string UHTTP_API_VERSION = "v0";
const std::string UHTTP_API_VERSION="v01";
/*! интерфейс для объекта выдающего json-данные */
class IHttpRequest
......
......@@ -4430,6 +4430,58 @@ fail:
}
SWIGINTERN PyObject *_wrap_ShortIOInfo_supplier_node_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
UTypes::ShortIOInfo *arg1 = (UTypes::ShortIOInfo *) 0 ;
long arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
long val2 ;
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OO:ShortIOInfo_supplier_node_set",&obj0,&obj1)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_UTypes__ShortIOInfo, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ShortIOInfo_supplier_node_set" "', argument " "1"" of type '" "UTypes::ShortIOInfo *""'");
}
arg1 = reinterpret_cast< UTypes::ShortIOInfo * >(argp1);
ecode2 = SWIG_AsVal_long(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ShortIOInfo_supplier_node_set" "', argument " "2"" of type '" "long""'");
}
arg2 = static_cast< long >(val2);
if (arg1) (arg1)->supplier_node = arg2;
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_ShortIOInfo_supplier_node_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
UTypes::ShortIOInfo *arg1 = (UTypes::ShortIOInfo *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
long result;
if (!PyArg_ParseTuple(args,(char *)"O:ShortIOInfo_supplier_node_get",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_UTypes__ShortIOInfo, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ShortIOInfo_supplier_node_get" "', argument " "1"" of type '" "UTypes::ShortIOInfo *""'");
}
arg1 = reinterpret_cast< UTypes::ShortIOInfo * >(argp1);
result = (long) ((arg1)->supplier_node);
resultobj = SWIG_From_long(static_cast< long >(result));
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_new_ShortIOInfo(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
UTypes::ShortIOInfo *result = 0 ;
......@@ -5403,6 +5455,8 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"ShortIOInfo_tv_nsec_get", _wrap_ShortIOInfo_tv_nsec_get, METH_VARARGS, NULL},
{ (char *)"ShortIOInfo_supplier_set", _wrap_ShortIOInfo_supplier_set, METH_VARARGS, NULL},
{ (char *)"ShortIOInfo_supplier_get", _wrap_ShortIOInfo_supplier_get, METH_VARARGS, NULL},
{ (char *)"ShortIOInfo_supplier_node_set", _wrap_ShortIOInfo_supplier_node_set, METH_VARARGS, NULL},
{ (char *)"ShortIOInfo_supplier_node_get", _wrap_ShortIOInfo_supplier_node_get, METH_VARARGS, NULL},
{ (char *)"new_ShortIOInfo", _wrap_new_ShortIOInfo, METH_VARARGS, NULL},
{ (char *)"delete_ShortIOInfo", _wrap_delete_ShortIOInfo, METH_VARARGS, NULL},
{ (char *)"ShortIOInfo_swigregister", ShortIOInfo_swigregister, METH_VARARGS, NULL},
......
......@@ -168,6 +168,8 @@ class ShortIOInfo:
__swig_getmethods__["tv_nsec"] = _pyUniSet.ShortIOInfo_tv_nsec_get
__swig_setmethods__["supplier"] = _pyUniSet.ShortIOInfo_supplier_set
__swig_getmethods__["supplier"] = _pyUniSet.ShortIOInfo_supplier_get
__swig_setmethods__["supplier_node"] = _pyUniSet.ShortIOInfo_supplier_node_set
__swig_getmethods__["supplier_node"] = _pyUniSet.ShortIOInfo_supplier_node_get
def __init__(self):
this = _pyUniSet.new_ShortIOInfo()
......
......@@ -22,8 +22,11 @@
// -------------------------------------------------------------------------
using namespace std;
using namespace Poco::Net;
using namespace uniset;
using namespace UHttp;
// -------------------------------------------------------------------------
namespace uniset
{
using namespace UHttp;
// -------------------------------------------------------------------------
UHttpRequestHandler::UHttpRequestHandler(std::shared_ptr<IHttpRequestRegistry> _registry ):
registry(_registry)
......@@ -166,4 +169,6 @@ Poco::JSON::Object::Ptr IHttpRequest::httpRequest( const string& req, const Poco
throw uniset::SystemError(err.str());
}
// -------------------------------------------------------------------------
} // end of namespace uniset
// -------------------------------------------------------------------------
#endif
......@@ -21,8 +21,10 @@
#include "Exceptions.h"
// -------------------------------------------------------------------------
using namespace Poco::Net;
using namespace uniset;
using namespace UHttp;
// -------------------------------------------------------------------------
namespace uniset
{
using namespace UHttp;
// -------------------------------------------------------------------------
UHttpServer::UHttpServer(std::shared_ptr<IHttpRequestRegistry>& supplier, const std::string& _host, int _port ):
......@@ -76,4 +78,6 @@ std::shared_ptr<DebugStream> UHttpServer::log()
return mylog;
}
// -------------------------------------------------------------------------
} // end of namespace uniset
// -------------------------------------------------------------------------
#endif // #ifndef DISABLE_REST_API
......@@ -203,7 +203,7 @@ namespace uniset
if( mylog.is_crit() )
mylog.crit() << err.str() << endl;
throw SystemError( err.str() );
throw uniset::SystemError( err.str() );
}
try
......@@ -219,7 +219,18 @@ namespace uniset
if( mylog.is_crit() )
mylog.crit() << err.str() << endl;
throw SystemError( err.str() );
throw uniset::SystemError( err.str() );
}
catch( std::exception& ex )
{
ostringstream err;
err << myname << "(evprepare): " << ex.what();
if( mylog.is_crit() )
mylog.crit() << err.str() << endl;
throw uniset::SystemError( err.str() );
}
sock->setBlocking(false);
......
......@@ -386,6 +386,7 @@ src/Communications/TCP/UTCPStream.cc
src/Communications/TCP/UTCPSocket.cc
src/Communications/TCP/USocket.cc
src/Communications/Http/UHttpRequestHandler.cc
src/Communications/Http/UHttpServer.cc
src/Communications/ComPort.cc
src/Communications/ComPort485F.cc
src/Communications/Makefile.am
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment