/* UC PSSSP program (apss.h)                by Ganping Chen, July. 1992    */

/***************************************************************************/
/*                                                                         */
/*                   PSSSP program APSS struct declaration                 */
/*                   =====================================                 */
/*                                                                         */
/***************************************************************************/

#ifndef _APSS_H_ 
#define _APSS_H_ 

/* (1) APSS Model #1 */
/* ================= */

void  sampling(void) ;
void  control(float XSftemp) ;
void initall(void) ; 

/*     data struct        */

struct apss_data_m1 {

int	busNo;        		/* bus # to which the APSS connected      */
	
double	T_sample      		/* APSS sampling interval                 */
       ,T_compute;    		/* APSS computation interval for control  */

};
typedef  struct apss_data_m1  APSSDAT1;
typedef  APSSDAT1             *APSSDAT1PTR;
   
/*      variable struct     */

struct msgin_m1 {		     /* sampled data structure		   */
	long	mtype;	     	     /* message type ( = APSS busNo )	   */
   	struct {		     /* sampled data at the sampling time  */
   		double Omega         /* generator speed                    */
   		      ,dOmega        /* derivative of speed (dOmega/dt)    */
   		      ,Pe            /* generator electric power           */
   	              ,dPe;          /*	accelerating power (Pm - Pe)       */
		double Upss ;	     /* system input at sampling point	   */
				     /* used for parameter identification  */
   	} datain ;
} ;
   
   typedef  struct msgin_m1  MSGIN1 ;
   typedef  MSGIN1          *MSGIN1PTR ;

struct msgout_m1 {		     /* control data structure		   */
	long   mtype;	     	     /* message type ( = APSS busNo )	   */
   	struct {		     /* control data at the control time   */
   		double Upss;         /* control signal sent back from APSS */
   	} dataout ;
} ;

   typedef  struct msgout_m1  MSGOUT1 ;
   typedef  MSGOUT1	     *MSGOUT1PTR ;
   


#endif // _APSS_H_
