Cleaned up remaining exception related code in rigclass.h and .cpp

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3249 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Edson W. R. Pereira
2013-05-01 12:21:19 +00:00
parent 61321abd9d
commit 8ea1f5f2a5
4 changed files with 35 additions and 116 deletions
+19 -9
View File
@@ -48,16 +48,9 @@ static int hamlibpp_freq_event(RIG *rig, vfo_t vfo, freq_t freq, rig_ptr_t arg)
return ((Rig*)rig->state.obj)->FreqEvent(vfo, freq, arg);
}
Rig::Rig(rig_model_t rig_model) {
Rig::Rig()
{
rig_set_debug_level( RIG_DEBUG_WARN);
theRig = rig_init(rig_model);
if (!theRig)
THROW(new RigException ("Rig initialization error"));
caps = theRig->caps;
theRig->callbacks.freq_event = &hamlibpp_freq_event;
theRig->state.obj = (rig_ptr_t)this;
}
Rig::~Rig() {
@@ -66,6 +59,23 @@ Rig::~Rig() {
caps = NULL;
}
int Rig::init(rig_model_t rig_model)
{
int initOk;
theRig = rig_init(rig_model);
if (!theRig)
initOk = false;
else
initOk = true;
caps = theRig->caps;
theRig->callbacks.freq_event = &hamlibpp_freq_event;
theRig->state.obj = (rig_ptr_t)this;
return initOk;
}
int Rig::open(void) {
return rig_open(theRig);
}