Commit 9263e5a0 authored by Pavel Vainerman's avatar Pavel Vainerman

Merge branch 'master' of eterbook:/var/git/uniset into newRTUExchange

Conflicts: conf/uniset.spec extentions/IOControl/IOControl.cc extentions/SharedMemory/SharedMemory.cc
parents c1b4f4bc 6eb79ccc
......@@ -2,7 +2,11 @@
Name: uniset
Version: 0.96
<<<<<<< HEAD:conf/uniset.spec
Release: eter6
=======
Release: eter9
>>>>>>> 6eb79ccca4b348cddaa393aae9cb34b9fcf2a001:conf/uniset.spec
Summary: UniSet
License: GPL
Group: Development/C++
......@@ -177,10 +181,17 @@ Libraries needed to develop for uniset extentions
%_bindir/rtustate
%_bindir/%name-rtuexchange
%_bindir/%name-smemory
%_bindir/%name-smviewer
%changelog
<<<<<<< HEAD:conf/uniset.spec
* Wed May 20 2009 Pavel Vainerman <pv@altlinux.ru> 0.96-eter5
=======
* Tue Apr 21 2009 Pavel Vainerman <pv@etersoft.ru> 0.96-eter6
- new build
* Tue Apr 21 2009 Pavel Vainerman <pv@etersoft.ru> 0.96-eter5
>>>>>>> 6eb79ccca4b348cddaa393aae9cb34b9fcf2a001:conf/uniset.spec
- new build
* Mon Apr 06 2009 Pavel Vainerman <pv@altlinux.ru> 0.96-eter4
......
......@@ -192,6 +192,7 @@ AC_CONFIG_FILES([Makefile
extentions/MBTCPMaster/libUniSetMBTCPMaster.pc
extentions/LogicProcessor/Makefile
extentions/LogicProcessor/libUniSetLogicProcessor.pc
extentions/SMViewer/Makefile
extentions/SharedMemory/Makefile
extentions/SharedMemory/libUniSetSharedMemory.pc
extentions/SharedMemoryPlus/Makefile])
......
......@@ -4,7 +4,7 @@
if HAVE_EXTENTIONS
SUBDIRS = lib include SharedMemory IOControl RTUExchange LogicProcessor \
ModbusSlave MBTCPMaster
ModbusSlave MBTCPMaster SMViewer
#SharedMemoryPlus
#UDPExchange
......
bin_PROGRAMS = @PACKAGE@-smviewer
@PACKAGE@_smviewer_LDADD = $(SIGC_LIBS) $(top_builddir)/lib/libUniSet.la \
$(top_builddir)/extentions/lib/libUniSetExtentions.la
@PACKAGE@_smviewer_CPPFLAGS = $(SIGC_CFLAGS) -I$(top_builddir)/extentions/include
@PACKAGE@_smviewer_SOURCES = SMViewer.cc main.cc
/*! $Id*/
//--------------------------------------------------------------------------------
#include "SMViewer.h"
#include "Extentions.h"
//--------------------------------------------------------------------------------
using namespace UniSetTypes;
using namespace std;
using namespace UniSetTypes;
using namespace UniSetExtentions;
//--------------------------------------------------------------------------------
SMViewer::SMViewer( UniSetTypes::ObjectId shmID ):
SViewer(conf->getControllersSection(),true)
{
shm = new SMInterface(shmID,&ui,DefaultObjectId,0);
}
// --------------------------------------------------------------------------
SMViewer::~SMViewer()
{
delete shm;
}
// --------------------------------------------------------------------------
void SMViewer::run()
{
IOController_i::DSensorInfoSeq_var dmap = shm->getDigitalSensorsMap();
IOController_i::ASensorInfoSeq_var amap = shm->getAnalogSensorsMap();
IONotifyController_i::ThresholdsListSeq_var tlst = shm->getThresholdsList();
try
{ updateDSensors(dmap,getSharedMemoryID());
}catch(...){};
try
{ updateASensors(amap,getSharedMemoryID());
}catch(...){}
try
{ updateThresholds(tlst,getSharedMemoryID());
}catch(...){}
}
// --------------------------------------------------------------------------
/*! $Id$ */
//--------------------------------------------------------------------------------
#ifndef _SMVIEWER_H
#define _SMVIEWER_H
//--------------------------------------------------------------------------------
#include <string>
#include "SViewer.h"
#include "SMInterface.h"
//--------------------------------------------------------------------------------
class SMViewer:
public SViewer
{
public:
SMViewer( UniSetTypes::ObjectId shmID );
virtual ~SMViewer();
void run();
protected:
private:
SMInterface* shm;
UniversalInterface ui;
};
// --------------------------------------------------------------------------
#endif
// --------------------------------------------------------------------------
#include <iostream>
#include "Configuration.h"
#include "SMViewer.h"
#include "Extentions.h"
// -----------------------------------------------------------------------------
using namespace UniSetTypes;
using namespace UniSetExtentions;
using namespace std;
// -----------------------------------------------------------------------------
int main( int argc, char **argv )
{
try
{
if( argc>1 && (!strcmp(argv[1],"--help") || !strcmp(argv[1],"-h")) )
{
cout << "--smemory-id objectName - SharedMemory objectID. Default: read from <SharedMemory>" << endl;
cout << "--confile filename - configuration file. Default: configure.xml" << endl;
return 0;
}
string confile = UniSetTypes::getArgParam( "--confile", argc, argv, "configure.xml" );
conf = new Configuration( argc, argv, confile );
ObjectId shmID = DefaultObjectId;
string sID = conf->getArgParam("--smemory-id");
if( !sID.empty() )
shmID = conf->getControllerID(sID);
else
shmID = getSharedMemoryID();
if( shmID == DefaultObjectId )
{
cerr << sID << "? SharedMemoryID not found in " << conf->getControllersSection() << " section" << endl;
return 1;
}
SMViewer smv(shmID);
smv.run();
}
catch( Exception& ex )
{
cout << "(main):" << ex << endl;
}
catch(...)
{
cout << " !!!!"<< endl;
}
return 0;
}
// ------------------------------------------------------------------------------------------
......@@ -411,7 +411,7 @@ void SharedMemory::fastSaveValue(const IOController_i::SensorInfo& si, CORBA::Lo
SharedMemory* SharedMemory::init_smemory( int argc, char* argv[] )
{
string dfile = conf->getArgParam("--datfile",conf->getConfFileName());
dlog[Debug::INFO] << "(smemory): datfile = " << dfile << endl;
if( dfile[0]!='.' && dfile[0]!='/' )
dfile = conf->getConfDir() + dfile;
......
......@@ -124,6 +124,7 @@ void NCRestorer_XML::read_list( UniXML& xml, xmlNode* node, IONotifyController*
try
{
IOController::UniDigitalIOInfo dinf(inf);
dinf.real_state = dinf.state;
dsRegistration(ic,dinf,true);
}
catch(Exception& ex)
......@@ -622,7 +623,8 @@ void NCRestorer_XML::build_depends( UniXML& xml, xmlNode* node, IONotifyControll
{
mydepinfo.dit->second.blocked = blk_set;
mydepinfo.dit->second.block_state = (bool)block_val;
mydepinfo.dit->second.real_state = mydepinfo.dit->second.state;
mydepinfo.dit->second.state = defval;
mydepinfo.dit->second.real_state = defval;
if( blk_set )
mydepinfo.dit->second.state = (bool)block_val;
}
......
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