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

instctrl.h File Reference

communication with the instrument control programm More...

#include "serial.h"
#include "semaphore.h"
#include <time.h>
#include <sys/types.h>
#include <unistd.h>

Go to the source code of this file.

Defines

#define __instctrl_h   1
#define instctrl_status_idle   0
#define instctrl_status_ok   1
#define instctrl_status_busy   2
#define instctrl_status_fail   3

Functions

int instctrl_parse_statusfile ()
 parses the statusfile of the instrument control program.
char * instctrl_status_message (int code)
 retruns a string corresponding to status code defined in instctrl.h.
int instctrl_send_commands ()
 sends commands from the command queue to the instrument control program
void instctrl_set_telescopefocus (long focus)
 queues the command to set the telescope focus.
int instctrl_parse_filterfile ()
 parses the filterlistfile
instctrl_status_struct instctrl_get_status ()
 returns the current status of the instrument control.
void instctrl_set_filters (struct instctrl_filterlist_struct input)
 updates the filterlist.
void instctrl_set_filter (char *filter)
 queues the command to set a filter.
instctrl_filterlist_struct instctrl_get_filters ()
 returns the filterlist.
volatile double instctrl_get_tel_focus ()
 returns the current focus of the telescope.
void ui_instctrl_numbers_changed (struct instctrl_status_struct)
 called by instctrl.c whenever its status numbers have changed.
void ui_instctrl_strings_changed (struct instctrl_status_struct)
 called by instctrl.c whenever its status strings have changed.
void ui_instctrl_statuslight_changed (struct instctrl_status_struct)
 called by instctrl.c whenever its status light has changed.
void ui_instctrl_filters_changed (struct instctrl_filterlist_struct)
 called by instctrl.c whenever the list of filters has changed.
void instctrl_init ()
 (constructor) initialzes the communcation with the instrument control program.
void instctrl_set_status_async (struct instctrl_status_struct input)
 sets the status of the instrument control (for internal use by instctrl.c only).
void instctrl_set_filenames (struct instctrl_filename_struct input)
 sets the names of the files to be used to communicate with the instrument control program

Variables

sem_t instctrl_sem
sem_t instctrl_status_sem
sem_t instctrl_filters_sem


Detailed Description

communication with the instrument control programm

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

struct instctrl_filterlist_struct instctrl_get_filters  ) 
 

returns the filterlist.

Returns:
void This function returns the filterlist

struct instctrl_status_struct instctrl_get_status  ) 
 

returns the current status of the instrument control.

Returns:
instctrl_status_struct a struct describing the current status of the instrument control
This function returns a struct describing the current status of the ínstrument control.

volatile double instctrl_get_tel_focus  ) 
 

returns the current focus of the telescope.

Returns:
instctrl_status_struct a struct describing the current status of the instrument control
This function returns the current focus of the telescope.

void instctrl_init  ) 
 

(constructor) initialzes the communcation with the instrument control program.

Returns:
void
This function initialzes the communcation with the instrument control program. It has to be called before any other function of this file is called.

int instctrl_parse_filterfile  ) 
 

parses the filterlistfile

Returns:
integer an error code
This function parses the filterlistfile and calls instctrl_set_filters with its result.

int instctrl_parse_statusfile  ) 
 

parses the statusfile of the instrument control program.

Returns:
void This function parses the statusfile of the instrument control program.

int instctrl_send_commands  ) 
 

sends commands from the command queue to the instrument control program

Returns:
integer an error code
This function sends commands from the command queue to the instrument control program. It checks if the file if it wants to write its command to still exists and writes it only if this is the case. The instrument control program deletes the corresponding file after it read it, allows this function to write the next command. This function is called by a timer.

void instctrl_set_filenames struct instctrl_filename_struct  input  ) 
 

sets the names of the files to be used to communicate with the instrument control program

Parameters:
input a struct contraining the filename to be used
Returns:
void
This function sets the names of the files to be used to communicate with the instrument control program

void instctrl_set_filter char *  filter  ) 
 

queues the command to set a filter.

Parameters:
filter a string, the name of the filter to be set
Returns:
integer an error code
This function queues the command to set a filter

void instctrl_set_filters struct instctrl_filterlist_struct  input  ) 
 

updates the filterlist.

Parameters:
input the filterlist received from the instrument control program
Returns:
void This function parses and updates the filterlist. It checks if the filterlist actually changed and send respective information to the user interface if this is the case.

void instctrl_set_status_async struct instctrl_status_struct  input  ) 
 

sets the status of the instrument control (for internal use by instctrl.c only).

Parameters:
input a instctrl_status_struct representing the status to be set.
Returns:
void This function sets the status of the instrument control without repecting instctrl_status_sem. This function for internal use by instctrl.c only. To set the instctrl status use instctrl_set_status.

void instctrl_set_telescopefocus long  focus  ) 
 

queues the command to set the telescope focus.

Parameters:
focus the new focus.
Returns:
integer an error code
This function queues the command to set the telescope focus

char* instctrl_status_message int  code  ) 
 

retruns a string corresponding to status code defined in instctrl.h.

Parameters:
code the status code
Returns:
char* the message string (pango markup)
This function retruns a string corresponding to status code defined in instctrl.h.

void ui_instctrl_filters_changed struct instctrl_filterlist_struct  filterlist  ) 
 

called by instctrl.c whenever the list of filters has changed.

Parameters:
filters the fitler list (an array, it end is marked by the entry with Null sting as name)
Returns:
void
This function is called by instctrl.c whenever the list of filters has changed. It is declared as an abstract function in instctrl.h and implemented here.

void ui_instctrl_numbers_changed struct instctrl_status_struct  input  ) 
 

called by instctrl.c whenever its status numbers have changed.

Parameters:
input a structure describing the current status of instctrl.c
Returns:
void
This function is called by instctrl.c whenever its status numbers have changed. It is declared as an abstract function in instctrl.h and implemented here.

void ui_instctrl_statuslight_changed struct instctrl_status_struct  input  ) 
 

called by instctrl.c whenever its status light has changed.

Parameters:
input a structure describing the current status of instctrl.c
Returns:
void
This function is called by instctrl.c whenever its status status light changed. It is declared as an abstract function in instctrl.h and implemented here.

void ui_instctrl_strings_changed struct instctrl_status_struct  input  ) 
 

called by instctrl.c whenever its status strings have changed.

Parameters:
input a structure describing the current status of instctrl.c
Returns:
void
This function is called by instctrl.c whenever its status strings have changed. It is declared as an abstract function in instctrl.h and implemented here.


Variable Documentation

sem_t instctrl_filters_sem
 

a semaphore procteting instctrl_status

sem_t instctrl_sem
 

a semaphore protecting instctrl_list

sem_t instctrl_status_sem
 

a semaphore procteting instctrl_status


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