Commit 5d449bc8 authored by Pavel Vainerman's avatar Pavel Vainerman

(python): подправил UConnector, убрал лишнюю проверку iotype

parent a193958d
......@@ -67,25 +67,9 @@ long UConnector::getValue( long id, long node )throw(UException)
if( node == UTypes::DefaultID )
node = conf->getLocalNode();
UniversalIO::IOType t = conf->getIOType(id);
try
{
switch(t)
{
case UniversalIO::DI:
case UniversalIO::DO:
case UniversalIO::AI:
case UniversalIO::AO:
return ui->getValue(id,node);
break;
default:
{
ostringstream e;
e << "(getValue): Unknown iotype for id=" << id;
throw UException(e.str());
}
}
return ui->getValue(id,node);
}
catch( UException& ex )
{
......@@ -112,25 +96,9 @@ void UConnector::setValue( long id, long val, long node )throw(UException)
if( node == UTypes::DefaultID )
node = conf->getLocalNode();
UniversalIO::IOType t = conf->getIOType(id);
try
{
switch(t)
{
case UniversalIO::DI:
case UniversalIO::DO:
case UniversalIO::AI:
case UniversalIO::AO:
ui->setValue(id,val,node);
break;
default:
{
ostringstream e;
e << "(setValue): Unknown iotype for id=" << id;
throw UException(e.str());
}
}
ui->setValue(id,val,node);
}
catch( UException& ex )
{
......
......@@ -37,7 +37,8 @@ if __name__ == "__main__":
print "getValue exception: " + str(e.getError())
try:
print "setValue: %d=%d" % (14,setValue(14,22))
print "setValue: %d=%d" % (14,22)
setValue(14,22)
except UException, e:
print "setValue exception: " + str(e.getError())
......
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