mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2026-06-11 02:09:03 -04:00
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:
+19
-9
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user