Subversion Repositories shark

Rev

Blame | Last modification | View Log | RSS feed

/*
 * Project: S.Ha.R.K.
 *
 * Coordinators:
 *   Giorgio Buttazzo    <giorgio@sssup.it>
 *   Paolo Gai           <pj@gandalf.sssup.it>
 *
 * Authors     :
 *   Paolo Gai           <pj@gandalf.sssup.it>
 *   Massimiliano Giorgi <massy@gandalf.sssup.it>
 *   Luca Abeni          <luca@gandalf.sssup.it>
 *   (see the web pages for full authors list)
 *
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
 *
 * http://www.sssup.it
 * http://retis.sssup.it
 * http://shark.sssup.it
 */



/**
 ------------
 CVS :        $Id: const.h,v 1.1.1.1 2002-09-02 09:37:45 pj Exp $

 File:        $File$
 Revision:    $Revision: 1.1.1.1 $
 Last update: $Date: 2002-09-02 09:37:45 $
 ------------
**/


/*
 * Copyright (C) 2000 Marco Dallera and Marco Fiocca
 *
 * 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; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */


/*
 *              AUTO
 *
 * Another Unuseful Track simulatOr
 *
 * Authors: Marco Dallera
 *          Marco Fiocca
 *
 */


/* ------------------ */
/*  Useful constants  */
/* ------------------ */

#ifndef __CONST_H_

#define __CONST_H_

/* Screen dimensions */
#define SCREEN_WIDTH  800
#define SCREEN_HEIGHT 600
#define SCREEN_BIT_COLORS 8

/* Visible area */
#define TEL_WIDTH  50
#define TEL_HEIGHT 50

/* Car dimensions */
#define CAR_WIDTH  12
#define CAR_HEIGHT 12
#define CAR_W   8
#define CAR_H   10

/* Track dimensions */
#define TRACK_WIDTH  500
#define TRACK_HEIGHT 500

/* Track position */
#define TRACK_X1        0
#define TRACK_Y1        0
#define TRACK_X2        TRACK_X1+TRACK_WIDTH-1
#define TRACK_Y2        TRACK_Y1+TRACK_HEIGHT-1

/* Max number of car on track */
#define MAX_CAR_NUMBER  10
#define DRIVERS_NUMBER  20
#define MAX_DRIVER_NAME_LENGTH 20
#define MAX_TRACK_NAME_LENGTH   20
#define TRACK_NUMBER    4

/* Lap direction */
#define CLOCK           0
#define ANTICLOCK       1

/* Information display coords */
#define CMD_WIDTH       TRACK_WIDTH
#define CMD_HEIGHT      (SCREEN_HEIGHT-TRACK_HEIGHT-3)

/* Car position limits */
#define MIN_CAR_X  (TRACK_X1 + CAR_WIDTH/2  + 4)
#define MIN_CAR_Y  (TRACK_Y1 + CAR_HEIGHT/2 + 4)
#define MAX_CAR_X  (TRACK_X2 - CAR_WIDTH/2  - 4)
#define MAX_CAR_Y  (TRACK_Y2 - CAR_HEIGHT/2 - 4)

/* Road constants */
#define LEFT_ONLY               10
#define RIGHT_ONLY              11
#define ROAD_OK                 12
#define NO_ROAD                 13

/* Collision constants */
#define COLLISION_LEFT  20
#define COLLISION_RIGHT 21
#define COLLISION_BACK  22
#define NO_COLL 0

/* CAB constants */
#define ROAD_MSG_DIM    sizeof(road_info)
#define ROAD_MSG_READER 4

#define CAR_MSG_DIM     sizeof(car_status)
#define CAR_MSG_READER  5

/* Tasks parameters */
#define SENSOR_WCET     3000
#define SENSOR_PERIOD  40000
#define CONTROL_WCET    1000
#define CONTROL_PERIOD 40000

#endif