Esempio n. 1
0
void ScopeINDI::serverConnected()
{
    // After connection to the server
    // set option to receive only the messages, no blob
    setBLOBMode(B_NEVER, INDIMountName.mb_str(wxConvUTF8), NULL);
    modal = true; 
    // wait for the device port property
    wxLongLong msec;
    msec = wxGetUTCTimeMillis();
    while ((!scope_port) && wxGetUTCTimeMillis() - msec < 2 * 1000) {
	::wxSafeYield();
    }
    // Set the port, this must be done before to try to connect the device
    if (scope_port && INDIMountPort.Length()) {  // the mount port is not mandatory
	char* porttext = (const_cast<char*>((const char*)INDIMountPort.mb_str()));
	scope_port->tp->text = porttext;
	sendNewText(scope_port); 
    }
    // Connect the mount device
    connectDevice(INDIMountName.mb_str(wxConvUTF8));
    
    msec = wxGetUTCTimeMillis();
    while (modal && wxGetUTCTimeMillis() - msec < 5 * 1000) {
	::wxSafeYield();
    }
    modal = false;
    // In case we not get all the required properties or connection to the device failed
    if( ready) {
       Scope::Connect();
    }
    else {
       Disconnect();
    }
}
Esempio n. 2
0
void Camera_INDIClass::serverConnected()
{
    // After connection to the server
    // set option to receive blob and messages for the selected CCD
    setBLOBMode(B_ALSO, INDICameraName.mb_str(wxConvUTF8), INDICameraBlobName.mb_str(wxConvUTF8));
    modal = true;
    // wait for the device port property
    wxLongLong msec;
    msec = wxGetUTCTimeMillis();
    while ((!camera_port) && wxGetUTCTimeMillis() - msec < 1 * 1000) {
        ::wxSafeYield();
    }
    // Set the port, this must be done before to try to connect the device
    if (camera_port && INDICameraPort.Length()) {  // the camera port is not mandatory
        char* porttext = (const_cast<char*>((const char*)INDICameraPort.mb_str()));
        camera_port->tp->text = porttext;
        sendNewText(camera_port);
    }
    // Connect the camera device
    connectDevice(INDICameraName.mb_str(wxConvUTF8));

    msec = wxGetUTCTimeMillis();
    while (modal && wxGetUTCTimeMillis() - msec < 5 * 1000) {
        ::wxSafeYield();
    }
    modal = false;
    // In case we not get all the required properties or connection to the device failed
    if(ready)
    {
        Connected = true;
        m_hasGuideOutput = (pulseGuideNS_prop && pulseGuideEW_prop);
    }
    else {
        pFrame->Alert(_("Cannot connect to camera ")+INDICameraName);
        Connected = false;
        Disconnect();
    }
}
Esempio n. 3
0
void IndiGui::serverConnected()
{
    setBLOBMode(B_NEVER, "", NULL);
    ready = true;
}