- Added bridge functions to histmemsec to make it look more like histmem

- Modifed many modules using histmem to work also with histmemsec
- Extended tasker with task names and task groups
- There is a new taskobj which allows to list tasks and to interact with them.
- Task now supports running Tcl functions as tasks
- There is a new experimental sctcomtask module which allows to define communication
  tasks against a scriptcontext. This is a new feature which should facilitate
  writing sequential scripts using asynchronous communication.
- A fix to make spss7 work when there are no switches
- ORION support for single X. TRICS measures crystals hanging down, ORION
  standing up


SKIPPED:
	psi/ease.c
	psi/faverage.c
	psi/jvlprot.c
	psi/make_gen
	psi/pardef.c
	psi/polterwrite.c
	psi/psi.c
	psi/sinq.c
	psi/spss7.c
This commit is contained in:
koennecke
2012-12-20 11:32:33 +00:00
parent 4f560552c4
commit 86e246416b
57 changed files with 2025 additions and 290 deletions

78
sctcomtask.h Normal file
View File

@ -0,0 +1,78 @@
/**
* This is another approach at using the scriptcontext system. It introduces
* the concept of a communication task which is executed against a device serializer,
* accessed via a given ScriptContext. Clients can:
* - Create CommTasks
* - Figure out their state
* - Retrieve reply data
* - wait for a ComTask to finish.
*
* The the purpose sctcomtask will keep a cache of pending and finished communications.
* Old runs will be deleted periodically. Nevertheless the cache can be listed in order
* to figure out what happened.
*
* The intended use is for C-code or scripts to interact in a serial manner with
* the asynchronous communication system implemented in devser and ascon. As a
* standalone implementation would share tons of code with scriptcontext, this has
* been implemented as an add on module to scriptcontext.
*
* copyright: see file COPYRIGHT
*
* Mark Koennecke, December 2012
*/
#ifndef __SCTCOMTASK
#define __SCTCOMTASK
#include <sics.h>
typedef struct ComTaskManager ComTaskManager;
typedef enum {
eWaiting,
eRunning,
eFinished,
eUnknown
} ComTaskState;
/**
* Standard SIS installation function
*/
int SctMakeComTask(SConnection * con, SicsInterp * sics,
void *object, int argc, char *argv[]);
/*============================ client interface section ===========================*/
/**
* Start a communication task
* @param manager the communication task manager to start the communication with
* @param priority The priority of the task
* @param sendData The data to send to the device
* @return A positive com task ID on success, -1 on failure.
*/
int StartComTask(ComTaskManager *manager, char *priority, char *sendData);
/**
* Retrive the state of a communication task
* @param manager the communication task manager
* @param comTaskID The ID of the communication task to test
* @return The state of the task
*/
ComTaskState GetComTaskState(ComTaskManager *manager, int comTaskID);
/**
* Retrive the reply of a communication task
* @param manager the communication task manager
* @param comTaskID The ID of the communication task to test
* @param length An output parameter set to the length of the data returned
* @return NULL when this is called erroneously, the reply data else. The client is
* not supposed to delete the reply data. On the other hand, the client cannot rely
* on the data to be available for ever. Make a copy if long term storage of the reply
* data is necessary.
*/
const char *GetComTaskReply(ComTaskManager *manager, int comTaskID, int *length);
/**
* Wait for a communication task to finish
* @param manager the communication task manager
* @param comTaskID The ID of the communication task to test
* Please note that eventual timeouts are handled by devser and ascon.
*/
void ComTaskWait(ComTaskManager *manager, int comTaskID);
#endif