Commit 8baac8a9 authored by Pavel Vainerman's avatar Pavel Vainerman

update TODO (и небольшая правка кода)

parent fbf7cb84
...@@ -46,6 +46,11 @@ SQL: ...@@ -46,6 +46,11 @@ SQL:
Debug: Debug:
- дописать в codegen документацию по запуску и управлению логами через LogServer - дописать в codegen документацию по запуску и управлению логами через LogServer
HTTP API:
- запрос списка заказчиков по конкретным датчикам
- запрос о том, кто последний сохранил указанный датчик
Version 2.5 Version 2.5
============ ============
- smonit запись значений в файл (csv?,sqlite?,gnuplot) - smonit запись значений в файл (csv?,sqlite?,gnuplot)
......
...@@ -64,25 +64,16 @@ long pyUInterface::getValue( long id )throw(UException) ...@@ -64,25 +64,16 @@ long pyUInterface::getValue( long id )throw(UException)
using namespace uniset; using namespace uniset;
UniversalIO::IOType t = conf->getIOType(id); UniversalIO::IOType t = conf->getIOType(id);
if( t == UniversalIO::UnknownIOType )
try
{
switch(t)
{
case UniversalIO::DI:
case UniversalIO::DO:
case UniversalIO::AI:
case UniversalIO::AO:
return uInterface->getValue(id);
break;
default:
{ {
ostringstream e; ostringstream e;
e << "(getValue): Unknown iotype for id=" << id; e << "(getValue): Unknown iotype for id=" << id;
throw UException(e.str()); throw UException(e.str());
} }
}
try
{
return uInterface->getValue(id);
} }
catch( UException& ex ) catch( UException& ex )
{ {
...@@ -105,26 +96,19 @@ void pyUInterface::setValue( long id, long val, long supplier )throw(UException) ...@@ -105,26 +96,19 @@ void pyUInterface::setValue( long id, long val, long supplier )throw(UException)
if( !conf || !uInterface ) if( !conf || !uInterface )
throw USysError(); throw USysError();
UniversalIO::IOType t = conf->getIOType(id); using namespace uniset;
try
{
switch(t)
{
case UniversalIO::DI:
case UniversalIO::DO:
case UniversalIO::AI:
case UniversalIO::AO:
uInterface->setValue(id, val, supplier);
break;
default: UniversalIO::IOType t = conf->getIOType(id);
if( t == UniversalIO::UnknownIOType )
{ {
ostringstream e; ostringstream e;
e << "(setValue): Unknown iotype for id=" << id; e << "(setValue): Unknown iotype for id=" << id;
throw UException(e.str()); throw UException(e.str());
} }
}
try
{
uInterface->setValue(id, val, supplier);
} }
catch( UException& ex ) catch( UException& ex )
{ {
......
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