Ejemplo n.º 1
0
bool ScopeINDI::Connect()
{
    // If not configured open the setup dialog
    if (INDIMountName == wxT("INDI Mount")) {
        SetupDialog();
    }
    // define server to connect to.
    setServer(INDIhost.mb_str(wxConvUTF8), INDIport);
    // Receive messages only for our mount.
    watchDevice(INDIMountName.mb_str(wxConvUTF8));
    // Connect to server.
    if (connectServer()) {
        return !ready;
    }
    else {
        // last chance to fix the setup
        SetupDialog();
        setServer(INDIhost.mb_str(wxConvUTF8), INDIport);
        watchDevice(INDIMountName.mb_str(wxConvUTF8));
        if (connectServer()) {
            return !ready;
        }
        else {
            return true;
        }
    }
}
Ejemplo n.º 2
0
bool Camera_INDIClass::Connect(const wxString& camId)
{
    // If not configured open the setup dialog
    if (strcmp(INDICameraName,"INDI Camera")==0) CameraSetup();
    // define server to connect to.
    setServer(INDIhost.mb_str(wxConvUTF8), INDIport);
    // Receive messages only for our camera.
    watchDevice(INDICameraName.mb_str(wxConvUTF8));
    // Connect to server.
    if (connectServer()) {
        return !ready;
    }
    else {
        // last chance to fix the setup
        CameraSetup();
        setServer(INDIhost.mb_str(wxConvUTF8), INDIport);
        watchDevice(INDICameraName.mb_str(wxConvUTF8));
        if (connectServer()) {
            return !ready;
        }
        else {
            return true;
        }
    }
}