Main Page | Class List | Directories | File List | Class Members | File Members

background.h File Reference

Background threads. More...

#include "semaphore.h"
#include <time.h>

Go to the source code of this file.

Defines

#define __background_h   1

Functions

void init_background_tasks (void)
 starts all background threads
int done_background_tasks (void)
 stops all background threads
int ccu_receive_command (char *cmd, int timeout)
 sends a single byte to the CCD controller.
int ccu_send_command (char *cmd)
 sends a command to the CCD controller.
void task_terminal_suspend (void)
 suspends the thread for user interface interaction
void terminal_add_item (char *str, char *str2)
int ccu_send_byte (int byte)
 sends a single byte to the CCD controller.
void background_start_download (char *)
 starts the threaded download of the database (firmware) into to CCD Controller
void ui_timer (void)
 called by background.c approximately each 0.05 seconds.
int background_anything_except_acquire_running (void)
 checks whether any background process (except the acquisition process) is running, that has got anything to do with the CCD Controller
int background_anything_running (void)
 checks whether any background process is running, that has got anything to do with the CCD Controller
int main_init_everything ()
 main intializer

Variables

sem_t gtk_sem
int command_block
volatile int readout_is_running
volatile int exposure_is_running
volatile int download_is_running
volatile int readout_is_stopped
volatile int exposure_is_stopped
float background_exposuretime
long int background_bytes_comming
long int background_bytes_red
double background_time_begin
volatile int acquire_is_running
volatile int postproc_is_running
volatile int acquire_restart
volatile int acquire_stop
char acquire_stop_string [1000]
char download_filename [1000]
char postproc_filename [1000]
int background_acquisitions_done
volatile int background_retries
volatile int download_start
volatile int zero_volt_start
volatile int gui_clock
volatile int auto_is_running
volatile int auto_stop
volatile int zero_volt_is_running


Detailed Description

Background threads.

Copyright (C) 2001-2003 Dirk Huenniger (dhun@astro.uni-bonn.de)

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.


Function Documentation

int background_anything_except_acquire_running void   ) 
 

checks whether any background process (except the acquisition process) is running, that has got anything to do with the CCD Controller

Returns:
1 if at least one such process is running, 0 otherwise
This function checks whether any background process (except the acquisition process) is running that has got anything to do with the CCD Controller

int background_anything_running void   ) 
 

checks whether any background process is running, that has got anything to do with the CCD Controller

Returns:
1 if at least such one process is running, 0 otherwise
This function checks whether any background process is running that has got anything to do with the CCD Controller

void background_start_download char *  dummy  ) 
 

starts the threaded download of the database (firmware) into to CCD Controller

Parameters:
dummy the name of the database file to be loaded into the CCD Controller
Returns:
void
This function starts the threaded download of the database (firmware) into to CCD Controller

int ccu_receive_command char *  cmd,
int  timeout
 

sends a single byte to the CCD controller.

Parameters:
byte to be send
Returns:
error code
This function sends a single byte to the CCD controller.

int ccu_send_byte int  byte  ) 
 

sends a single byte to the CCD controller.

Parameters:
byte to be send
Returns:
error code
This function sends a single byte to the CCD controller.

int ccu_send_command char *  cmd  ) 
 

sends a command to the CCD controller.

Parameters:
cmd command to be send
Returns:
error code
This function sends a command to the CCD controller. The commands H 10, H 11 and H 12 are blocked.

int done_background_tasks void   ) 
 

stops all background threads

Returns:
void
This function stops all background threads

void init_background_tasks void   ) 
 

starts all background threads

Returns:
void
This function starts all background threads

int main_init_everything  ) 
 

main intializer

Returns:
void
This function initializes the full gboccia system. So this is the constructor of gboccia.

void task_terminal_suspend void   ) 
 

suspends the thread for user interface interaction

Returns:
void
suspends the thread for user interface interaction

void ui_timer void   ) 
 

called by background.c approximately each 0.05 seconds.

Returns:
void
This function is called by background.c approximately each 0.05 seconds. It is declared as an abstract function in background.h and implemented here.


Variable Documentation

volatile int acquire_is_running
 

1 if the acquisition thread is running

volatile int acquire_restart
 

set to 1 in order to ask the acquisition threat to (re)start

volatile int acquire_stop
 

set to 1 in order to ask the acquisition threat to stop

char acquire_stop_string[1000]
 

a string describing why the readout thread was stopped

volatile int auto_is_running
 

1 if the auto thread is running

volatile int auto_stop
 

set to 1 in order to ask the auto threat to stop

int background_acquisitions_done
 

the number of acquistions done

float background_exposuretime
 

the exposuretime of to be passed to the exposure thread

volatile int background_retries
 

the number of retries to read new data from the USB Kernel driver

double background_time_begin
 

the time when the exposure thread was started

int command_block
 

if this is not 0, any command to be sent to the ccu will be blocked

char download_filename[1000]
 

the name of the Database (firmware) to be loaded into the CCU

volatile int download_is_running
 

1 if the Databese (firmware) download into the CCU is running

volatile int download_start
 

set to 1 in order to start the download of the Database (firmware) into the CCD Controller

volatile int exposure_is_running
 

1 if the exposure thread is active, 0 otherwise, set to 0 in order to ask the the thread to stop

volatile int exposure_is_stopped
 

1 if the exposure thread was stopped

volatile int gui_clock
 

a counter couinting from one to 20 once pers second

char postproc_filename[1000]
 

the name of the fitsfile to be postprocessed

volatile int postproc_is_running
 

1 if the fits file postprocessing thread is running

volatile int readout_is_running
 

1 if the readout thread is active, 0 otherwise

volatile int readout_is_stopped
 

1 if the readout thread was stopped, set to 0 in order to ask the the thread to stop

volatile int zero_volt_is_running
 

1 if the zero volt thread is running

volatile int zero_volt_start
 

set to 1 in order to start the zero Volt Sequence in the CCU


Generated on Fri Dec 16 22:23:36 2005 for gboccia by  doxygen 1.4.2