Merge pull request #51 from mrkraimer/master

several changes
This commit is contained in:
Marty Kraimer
2018-09-28 07:00:34 -04:00
committed by GitHub
5 changed files with 10 additions and 27 deletions

View File

@@ -23,7 +23,6 @@
#include <pv/event.h>
#include <pv/lock.h>
#include <pv/pvData.h>
#include <pv/pvCopy.h>
#include <pv/pvTimeStamp.h>
#include <pv/timeStamp.h>
#include <pv/pvAlarm.h>
@@ -1185,7 +1184,7 @@ private:
PvaClientChannelPtr const & pvaClientChannel,
epics::pvData::PVStructurePtr const &pvRequest);
void checkGetState();
void checkConnectState();
enum GetConnectState {connectIdle,connectActive,connected};
PvaClient::weak_pointer pvaClient;
@@ -1354,7 +1353,7 @@ private :
PvaClientChannelPtr const & pvaClientChannel,
epics::pvData::PVStructurePtr const &pvRequest);
void checkPutState();
void checkConnectState();
enum PutConnectState {connectIdle,connectActive,connected};
PvaClient::weak_pointer pvaClient;

View File

@@ -198,7 +198,6 @@ void PvaClientChannel::channelStateChange(
<< " " << Channel::ConnectionStateNames[connectionState]
<< endl;
}
bool waitingForConnect = false;
if(connectState==connectActive) waitingForConnect = true;
if(connectionState!=Channel::CONNECTED) {

View File

@@ -115,16 +115,16 @@ PvaClientGet::~PvaClientGet()
}
void PvaClientGet::checkGetState()
void PvaClientGet::checkConnectState()
{
if(PvaClient::getDebug()) {
cout << "PvaClientGet::checkGetState"
cout << "PvaClientGet::checkConnectState"
<< " channelName " << pvaClientChannel->getChannel()->getChannelName()
<< endl;
}
if(!pvaClientChannel->getChannel()->isConnected()) {
string message = string("channel ") + pvaClientChannel->getChannel()->getChannelName()
+ " PvaClientGet::checkGetState channel not connected ";
+ " PvaClientGet::checkConnectState channel not connected ";
throw std::runtime_error(message);
}
if(connectState==connectIdle) {
@@ -334,7 +334,7 @@ PvaClientGetDataPtr PvaClientGet::getData()
<< " channelName " << pvaClientChannel->getChannel()->getChannelName()
<< endl;
}
checkGetState();
checkConnectState();
if(getState==getIdle) get();
return pvaClientData;
}

View File

@@ -436,16 +436,6 @@ bool PvaClientMonitor::poll()
<< endl;
}
checkMonitorState();
if(!isStarted) {
string message = string("channel ") + pvaClientChannel->getChannel()->getChannelName()
+ " PvaClientMonitor::poll illegal state ";
throw std::runtime_error(message);
}
if(userPoll) {
string message = string("channel ") + pvaClientChannel->getChannel()->getChannelName()
+ " PvaClientMonitor::poll did not release last";
throw std::runtime_error(message);
}
monitorElement = monitor->poll();
if(!monitorElement) return false;
userPoll = true;
@@ -483,11 +473,6 @@ void PvaClientMonitor::releaseEvent()
<< " channelName " << pvaClientChannel->getChannel()->getChannelName()
<< endl;
}
if(!isStarted) {
string message = string("channel ") + pvaClientChannel->getChannel()->getChannelName()
+ " PvaClientMonitor::releaseEvent monitor not started ";
throw std::runtime_error(message);
}
if(!userPoll) {
string message = string("channel ") + pvaClientChannel->getChannel()->getChannelName()
+ " PvaClientMonitor::releaseEvent did not call poll";

View File

@@ -119,10 +119,10 @@ PvaClientPut::~PvaClientPut()
}
void PvaClientPut::checkPutState()
void PvaClientPut::checkConnectState()
{
if(PvaClient::getDebug()) {
cout << "PvaClientPut::checkPutState"
cout << "PvaClientPut::checkConnectState"
<< " channelName " << pvaClientChannel->getChannel()->getChannelName()
<< endl;
}
@@ -385,7 +385,7 @@ void PvaClientPut::issuePut()
if(putState==getActive || putState==putActive) {
string message = string("channel ")
+ pvaClientChannel->getChannel()->getChannelName()
+ "PvaClientPut::issueGet get or put aleady active ";
+ "PvaClientPut::issuePut get or put aleady active ";
throw std::runtime_error(message);
}
putState = putActive;
@@ -421,7 +421,7 @@ PvaClientPutDataPtr PvaClientPut::getData()
<< " channelName " << pvaClientChannel->getChannel()->getChannelName()
<< endl;
}
checkPutState();
checkConnectState();
if(putState==putIdle) get();
return pvaClientData;
}