Skip to content

Commit

Permalink
updating Centos Docker to match master
Browse files Browse the repository at this point in the history
  • Loading branch information
rlancaste committed Jul 14, 2018
2 parents 9f26e69 + 3698b11 commit 80015a9
Show file tree
Hide file tree
Showing 23 changed files with 308 additions and 271 deletions.
30 changes: 14 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2
jobs:
build_stretch:
docker:
- image: jochym/indi-stretch
- image: jochym/indi-docker:stretch
steps:
- checkout
- run:
Expand All @@ -15,7 +15,7 @@ jobs:

build_buster:
docker:
- image: jochym/indi-buster
- image: jochym/indi-docker:buster
steps:
- checkout
- run:
Expand All @@ -27,7 +27,7 @@ jobs:

build_artful:
docker:
- image: jochym/indi-artful
- image: jochym/indi-docker:artful
steps:
- checkout
- run:
Expand All @@ -39,7 +39,7 @@ jobs:

build_bionic:
docker:
- image: jochym/indi-bionic
- image: jochym/indi-docker:bionic
steps:
- checkout
- run:
Expand All @@ -51,7 +51,7 @@ jobs:

build_clang4:
docker:
- image: jochym/indi-artful
- image: jochym/indi-docker:artful
environment:
CC: clang
CXX: clang++
Expand All @@ -66,7 +66,7 @@ jobs:

build_clang5:
docker:
- image: jochym/indi-bionic
- image: jochym/indi-docker:bionic
environment:
CC: clang
CXX: clang++
Expand All @@ -81,7 +81,7 @@ jobs:

build_fedora:
docker:
- image: jochym/indi-fedora
- image: jochym/indi-docker:fedora
steps:
- checkout
- run:
Expand All @@ -93,7 +93,7 @@ jobs:

build_centos:
docker:
- image: jochym/indi-centos
- image: jochym/indi-docker:centos
steps:
- checkout
- run:
Expand All @@ -105,7 +105,7 @@ jobs:

build_opensuse:
docker:
- image: jochym/indi-opensuse
- image: jochym/indi-docker:opensuse
steps:
- checkout
- run:
Expand All @@ -123,19 +123,17 @@ workflows:
- build_artful
- build_stretch
- build_fedora
# - build_clang4
- build_opensuse
- build_bionic:
requires:
- build_artful
- build_buster:
requires:
- build_stretch
# - build_clang5:
# requires:
# - build_clang4
- build_centos:
requires:
- build_fedora
- build_opensuse:
requires:
- build_fedora
# - build_clang4
# - build_clang5:
# requires:
# - build_clang4
9 changes: 4 additions & 5 deletions 3rdparty/indi-mi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ include(GNUInstallDirs)

set(UDEVRULES_INSTALL_DIR "/lib/udev/rules.d" CACHE STRING "Base directory for udev rules")

find_package(CFITSIO REQUIRED)
find_package(INDI REQUIRED)
find_package(USB1 REQUIRED)
find_package(Threads REQUIRED)
Expand All @@ -21,7 +20,6 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/indi_miccd.xml.cmake ${CMAKE_CURRENT_
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${INDI_INCLUDE_DIR})
include_directories(${CFITSIO_INCLUDE_DIR})

#if (CMAKE_SYSTEM_PROCESSOR MATCHES "armv6l")
# set(MILIB ${CMAKE_CURRENT_SOURCE_DIR}/libgxccdarmv6.bin)
Expand All @@ -36,7 +34,9 @@ include_directories(${CFITSIO_INCLUDE_DIR})
#endif ()

# N.B. Launchpad fails with armv6 version. Testing armv7
if (CMAKE_SYSTEM_PROCESSOR MATCHES "armv+")
if (APPLE)
set(MILIB ${CMAKE_CURRENT_SOURCE_DIR}/libgxccdmac.bin)
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "armv+")
set(MILIB ${CMAKE_CURRENT_SOURCE_DIR}/libgxccdarmv7.bin)
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
set(MILIB ${CMAKE_CURRENT_SOURCE_DIR}/libgxccdarmv8.bin)
Expand All @@ -55,8 +55,7 @@ set(indi_miccd_SRCS

add_executable(indi_mi_ccd ${indi_miccd_SRCS})

target_link_libraries(indi_mi_ccd ${INDI_LIBRARIES} ${CFITSIO_LIBRARIES}
${MILIB} ${USB1_LIBRARIES} rt)
target_link_libraries(indi_mi_ccd ${INDI_LIBRARIES} ${MILIB} ${USB1_LIBRARIES} rt)

if(THREADS_HAVE_PTHREAD_ARG)
target_compile_options(indi_mi_ccd "-pthread")
Expand Down
4 changes: 0 additions & 4 deletions 3rdparty/indi-mi/README
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ Requirements

You need to install both indi and indi-devel to build this package.

+ cfitsio

cfitsio-devel is required to compile support for FITS.

+ libusb-1

libusb-1 is required.
Expand Down
Binary file added 3rdparty/indi-mi/libgxccdmac.bin
Binary file not shown.
132 changes: 86 additions & 46 deletions 3rdparty/indi-shelyak/indi_shelyakalpy_spectrograph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ bool ShelyakAlpy::initProperties()
IUFillSwitch(&LampS[1], "ARNE", "ArNe", ISS_OFF);
IUFillSwitch(&LampS[2], "TUNGSTEN", "Tungsten", ISS_OFF);
IUFillSwitchVector(&LampSP, LampS, 3, getDeviceName(), "CALIB_LAMPS", "Calibration lamps", CALIBRATION_UNIT_TAB, IP_RW, ISR_ATMOST1, 0, IPS_IDLE);


//--------------------------------------------------------------------------------
// Options
Expand Down Expand Up @@ -165,17 +166,26 @@ bool ShelyakAlpy::Connect()
return false;
}
DEBUGF(INDI::Logger::DBG_SESSION, "%s is online.", getDeviceName());
resetLamps();

lastLampOn = "None";

return true;
}

bool ShelyakAlpy::Disconnect()
{
{
//set default state at disconnection: set off lamps
resetLamps();
sleep(1); // wait for the calibration unit to actually flip the switch

tty_disconnect(PortFD);
DEBUGF(INDI::Logger::DBG_SESSION, "%s is offline.", getDeviceName());
return true;
}

/* Handle a request to change a switch. */

bool ShelyakAlpy::ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n)
{
if (!strcmp(dev, getDeviceName())) // check if the message is for our device
Expand All @@ -186,7 +196,9 @@ bool ShelyakAlpy::ISNewSwitch(const char *dev, const char *name, ISState *states
for (int i=0; i<n; i++)
{
ISwitch *s = IUFindSwitch(&LampSP, names[i]);

if (states[i] != s->s) { // check if state has changed

bool rc = calibrationUnitCommand(COMMANDS[states[i]],PARAMETERS[names[i]]);
if (!rc) LampSP.s = IPS_ALERT;
}
Expand All @@ -201,6 +213,7 @@ bool ShelyakAlpy::ISNewSwitch(const char *dev, const char *name, ISState *states
return INDI::DefaultDevice::ISNewSwitch(dev, name, states, names, n); // send it to the parent classes
}


/* Handle a request to change text. */
bool ShelyakAlpy::ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n)
{
Expand All @@ -218,72 +231,99 @@ bool ShelyakAlpy::ISNewText (const char *dev, const char *name, char *texts[], c
return INDI::DefaultDevice::ISNewText(dev, name, texts, names, n);
}

/* Construct a command and send it to the spectrograph. It doesn't return
* anything so we have to sleep until we know it has flipped the switch.
*/
bool ShelyakAlpy::calibrationUnitCommand(char command, char parameter)
/* Construct a reset command*/
bool ShelyakAlpy::resetLamps()
{
int rc, nbytes_written;

char reset[3] = {'0','0',0x0a};
//clean alpy configuration. Reset all.
if ((rc = tty_write(PortFD, reset, 3, &nbytes_written)) != TTY_OK)

{
char errmsg[MAXRBUF];
tty_error_msg(rc, errmsg, MAXRBUF);
DEBUGF(INDI::Logger::DBG_ERROR, "error: %s.", errmsg);
return false;
} else {
DEBUGF(INDI::Logger::DBG_SESSION, "sent on serial: %s.", reset);

}
sleep(1); // wait for the calibration unit to actually flip the switch
sleep(0.5); // wait for the calibration unit to actually flip the switch
int rc, nbytes_written;
char c[3] = {'0','0',0x0a};



if (parameter==0x33){ //special for dark : have to put both lamps on
char cmd[6] = {0x31,0x31,0x0a,0x32,0x31,0x0a};//"11\n21\n"
if(command==0x31){

if ((rc = tty_write(PortFD, cmd, 6, &nbytes_written)) != TTY_OK)
if ((rc = tty_write(PortFD, c, 3, &nbytes_written)) != TTY_OK)

{
char errmsg[MAXRBUF];
tty_error_msg(rc, errmsg, MAXRBUF);
DEBUGF(INDI::Logger::DBG_ERROR, "error: %s.", errmsg);
return false;
} else {
DEBUGF(INDI::Logger::DBG_SESSION, "sent on serial: %s.", cmd);
DEBUGF(INDI::Logger::DBG_SESSION, "sent on serial: %s.", c);

}
sleep(1); // wait for the calibration unit to actually flip the switch

return true;
} else {
return true;
}
}


} else {
char c[3] = {parameter,command,0x0a};

if ((rc = tty_write(PortFD, c, 3, &nbytes_written)) != TTY_OK)

{
char errmsg[MAXRBUF];
tty_error_msg(rc, errmsg, MAXRBUF);
DEBUGF(INDI::Logger::DBG_ERROR, "error: %s.", errmsg);
return false;
} else {
DEBUGF(INDI::Logger::DBG_SESSION, "sent on serial: %s.", c);
/* Construct a command and send it to the spectrograph. It doesn't return
* anything so we have to sleep until we know it has flipped the switch.
*/
bool ShelyakAlpy::calibrationUnitCommand(char command, char parameter)
{
int rc, nbytes_written;

}
sleep(1); // wait for the calibration unit to actually flip the switch
if (parameter==0x33){ //special for dark : have to put both lamps on
char cmd[6] = {0x31,0x31,0x0a,0x32,0x31,0x0a};//"11\n21\n"
if(command==0x31){
DEBUGF(INDI::Logger::DBG_SESSION, "sent on serial: %s.", "on allume dark");
lastLampOn = "Dark";
char c[3] = {parameter,command,0x0a};

if ((rc = tty_write(PortFD, c, 3, &nbytes_written)) != TTY_OK)

{
char errmsg[MAXRBUF];
tty_error_msg(rc, errmsg, MAXRBUF);
DEBUGF(INDI::Logger::DBG_ERROR, "error: %s.", errmsg);
return false;
} else {
DEBUGF(INDI::Logger::DBG_SESSION, "sent on serial: %s.", c);

}
sleep(1); // wait for the calibration unit to actually flip the switch


if ((rc = tty_write(PortFD, cmd, 6, &nbytes_written)) != TTY_OK)

{
char errmsg[MAXRBUF];
tty_error_msg(rc, errmsg, MAXRBUF);
DEBUGF(INDI::Logger::DBG_ERROR, "error: %s.", errmsg);
return false;
} else {
DEBUGF(INDI::Logger::DBG_SESSION, "sent on serial: %s.", cmd);

}
sleep(1); // wait for the calibration unit to actually flip the switch
return true;
} else {
DEBUGF(INDI::Logger::DBG_SESSION, "sent on serial: %s.", "on éteient dark");
resetLamps();
lastLampOn = "None";
return true;
}
}



} else { //other lamps
char c[3] = {parameter,command,0x0a};

if (lastLampOn.compare("None")==0){ //doesn't work should change state only when
if ((rc = tty_write(PortFD, c, 3, &nbytes_written)) != TTY_OK)

{
char errmsg[MAXRBUF];
tty_error_msg(rc, errmsg, MAXRBUF);
DEBUGF(INDI::Logger::DBG_ERROR, "error: %s.", errmsg);
return false;
} else {
DEBUGF(INDI::Logger::DBG_SESSION, "sent on serial: %s.", c);

}
sleep(1); // wait for the calibration unit to actually flip the switch
return true;
} else {return true;}
}

}
6 changes: 4 additions & 2 deletions 3rdparty/indi-shelyak/indi_shelyakalpy_spectrograph.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
//On serial connection
//11\n : calib lamp on
//21\n : flat lamp on
//if 11 ans 21 : dark on
//if 11 and 21 : dark on
//(and the opposite, 10, 20)
//00\n : shut off all

Expand Down Expand Up @@ -76,8 +76,10 @@ class ShelyakAlpy : public INDI::DefaultDevice
INumberVectorProperty SettingsNP;
INumber SettingsN[2];

std::string lastLampOn;

bool calibrationUnitCommand(char command, char parameter);

bool resetLamps();
};

#endif // SHELYAKALPY_SPECTROGRAPH_H
6 changes: 6 additions & 0 deletions debian/libindi-all/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
indi-full (1.7.4) bionic; urgency=medium

* Minor release.

-- Jasem Mutlaq <[email protected]> Thu, 19 Jul 2018 09:30:00 +0300

indi-full (1.7.3) bionic; urgency=medium

* Minor release.
Expand Down
6 changes: 6 additions & 0 deletions debian/libindi/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
libindi (1.7.4) bionic; urgency=medium

* Minor release.

-- Jasem Mutlaq <[email protected]> Thu, 19 Jul 2018 09:30:00 +0300

libindi (1.7.3) bionic; urgency=medium

* Minor release.
Expand Down
Loading

0 comments on commit 80015a9

Please sign in to comment.