diff --git a/configuration/docker-compose.yml b/configuration/docker-compose.yml index 61f61926d..3ac32dd28 100755 --- a/configuration/docker-compose.yml +++ b/configuration/docker-compose.yml @@ -15,6 +15,13 @@ services: volumes: - ./mysql/localhost.sql:/docker-entrypoint-initdb.d/localhost.sql - ./mysql/port_drayage.sql:/docker-entrypoint-initdb.d/port_drayage.sql + # The following 3 volumes are used for C1T. By default the standard "port_drayage.sql" file + # will be loaded. Comment out the "port_drayage.sql" file above and uncomment the following + # three files to enable the C1T sql files to be loaded. The container volumes MUST be reset + # to allow for this change, which can be done with "docker compose down -v" + #- ./mysql/garage_port_drayage/port_drayage.sql:/docker-entrypoint-initdb.d/port_drayage.sql + #- ./mysql/garage_port_drayage/port_drayage_lane1.sql:/docker-entrypoint-initdb.d/port_drayage_lane1.sql + #- ./mysql/garage_port_drayage/port_drayage_lane2.sql:/docker-entrypoint-initdb.d/port_drayage_lane2.sql - mysql-datavolume:/var/lib/mysql php: diff --git a/configuration/mysql/garage_port_drayage/README.md b/configuration/mysql/garage_port_drayage/README.md new file mode 100644 index 000000000..0b1efbf17 --- /dev/null +++ b/configuration/mysql/garage_port_drayage/README.md @@ -0,0 +1,18 @@ +# C1T Garage Actions +These are Port Drayage actions created the CDA1Tenth functionality and specifically tailored for the Turner Fairbank Highway Research Center's Saxton Laboratory garage demonstration. + +## Instructions +Replace the port_drayage.sql file in docker-compose.yml with the files in this directory. +``` +db: + image: mysql:8.0 + volumes: + - ./mysql/garage_port_drayage/port_drayage.sql:/docker-entrypoint-initdb.d/port_drayage.sql + - ./mysql/garage_port_drayage/port_drayage_lane1.sql:/docker-entrypoint-initdb.d/port_drayage_lane1.sql + - ./mysql/garage_port_drayage/port_drayage_lane2.sql:/docker-entrypoint-initdb.d/port_drayage_lane2.sql +``` + +## Reference Layout +The following diagram displays the C1T Port Drayage layout used in the Saxton Garage. The above SQL files should be selected based on if the first (port_drayage_lane1.sql) or second (port_drayage_lane2.sql) lane will be used for the Port Pickup action. + +![Alt text](docs/garage_diagram.PNG) \ No newline at end of file diff --git a/configuration/mysql/garage_port_drayage/docs/garage_diagram.PNG b/configuration/mysql/garage_port_drayage/docs/garage_diagram.PNG new file mode 100644 index 000000000..71872f3eb Binary files /dev/null and b/configuration/mysql/garage_port_drayage/docs/garage_diagram.PNG differ diff --git a/configuration/mysql/garage_port_drayage/port_drayage.sql b/configuration/mysql/garage_port_drayage/port_drayage.sql new file mode 100644 index 000000000..0e111bd22 --- /dev/null +++ b/configuration/mysql/garage_port_drayage/port_drayage.sql @@ -0,0 +1,49 @@ +-- MySQL 8.0 for Linux amd64 (x86_64) and arm64 (aarch64) +-- +-- Host: 127.0.0.1 Database: PORT_DRAYAGE +-- ------------------------------------------------------ +-- Server version 7.6.0 +-- Current Database: `PORT_DRAYAGE` +-- + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `PORT_DRAYAGE` /*!40100 DEFAULT CHARACTER SET latin1 */; + +USE `PORT_DRAYAGE`; + +-- +-- Table structure for table `first_action` +-- + +DROP TABLE IF EXISTS `first_action`; +CREATE TABLE `first_action` ( + `cmv_id` varchar(20) NOT NULL, + `cargo_id` varchar(20) DEFAULT NULL, + `destination_lat` decimal(9,7) NOT NULL, + `destination_long` decimal(9,7) NOT NULL, + `operation` varchar(20) NOT NULL, + `action_id` varchar(36) NOT NULL, + `next_action` varchar(36) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +LOCK TABLES `first_action` WRITE; +INSERT INTO `first_action` VALUES ('C1T-1','NULL',-2.3,0.7,'ENTER_STAGING_AREA','one','two'); +UNLOCK TABLES; + +-- +-- Table structure for table `freight` +-- + +DROP TABLE IF EXISTS `freight`; +CREATE TABLE `freight` ( + `cmv_id` varchar(20) NOT NULL, + `cargo_id` varchar(20) DEFAULT NULL, + `destination_lat` decimal(9,7) NOT NULL, + `destination_long` decimal(9,7) NOT NULL, + `operation` varchar(20) NOT NULL, + `action_id` varchar(36) NOT NULL, + `next_action` varchar(36) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +LOCK TABLES `freight` WRITE; +INSERT INTO `freight` VALUES ('C1T-1','NULL',-0.4,-0.4,'EXIT_PORT','zero','one'),('C1T-1','NULL',-2.3,0.7,'ENTER_STAGING_AREA','one','two'),('C1T-1','CARGO_A',-3.4,-1.4,'PICKUP','two','three'),('C1T-1','CARGO_A',-3.4,-3.4,'EXIT_STAGING_AREA','three','four'),('C1T-1','CARGO_A',-3.4,-5.4,'ENTER_PORT','four','five'),('C1T-1','CARGO_A',-0.4,-6.4,'DROPOFF','five','six'),('C1T-1','CARGO_B',2.6,-4.7,'PICKUP','six','seven'),('C1T-1','CARGO_B',0.4,-3.4,'PORT_CHECKPOINT','seven','eight'),('C1T-1','CARGO_B',-0.3,0.2,'EXIT_PORT','eight','nine'); +UNLOCK TABLES; diff --git a/configuration/mysql/garage_port_drayage/port_drayage_lane1.sql b/configuration/mysql/garage_port_drayage/port_drayage_lane1.sql new file mode 100644 index 000000000..6f99b950c --- /dev/null +++ b/configuration/mysql/garage_port_drayage/port_drayage_lane1.sql @@ -0,0 +1,49 @@ +-- MySQL 8.0 for Linux amd64 (x86_64) and arm64 (aarch64) +-- +-- Host: 127.0.0.1 Database: PORT_DRAYAGE +-- ------------------------------------------------------ +-- Server version 7.6.0 +-- Current Database: `PORT_DRAYAGE` +-- + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `PORT_DRAYAGE` /*!40100 DEFAULT CHARACTER SET latin1 */; + +USE `PORT_DRAYAGE`; + +-- +-- Table structure for table `first_action` +-- + +DROP TABLE IF EXISTS `first_action`; +CREATE TABLE `first_action` ( + `cmv_id` varchar(20) NOT NULL, + `cargo_id` varchar(20) DEFAULT NULL, + `destination_lat` decimal(9,7) NOT NULL, + `destination_long` decimal(9,7) NOT NULL, + `operation` varchar(20) NOT NULL, + `action_id` varchar(36) NOT NULL, + `next_action` varchar(36) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +LOCK TABLES `first_action` WRITE; +INSERT INTO `first_action` VALUES ('C1T-1','NULL',-2.3,0.7,'ENTER_STAGING_AREA','one','two'); +UNLOCK TABLES; + +-- +-- Table structure for table `freight` +-- + +DROP TABLE IF EXISTS `freight`; +CREATE TABLE `freight` ( + `cmv_id` varchar(20) NOT NULL, + `cargo_id` varchar(20) DEFAULT NULL, + `destination_lat` decimal(9,7) NOT NULL, + `destination_long` decimal(9,7) NOT NULL, + `operation` varchar(20) NOT NULL, + `action_id` varchar(36) NOT NULL, + `next_action` varchar(36) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +LOCK TABLES `freight` WRITE; +INSERT INTO `freight` VALUES ('C1T-1','NULL',-0.4,-0.4,'EXIT_PORT','zero','one'),('C1T-1','NULL',-2.3,0.7,'ENTER_STAGING_AREA','one','two'),('C1T-1','CARGO_A',-3.4,-1.4,'PICKUP','two','three'),('C1T-1','CARGO_A',-3.4,-3.4,'EXIT_STAGING_AREA','three','four'),('C1T-1','CARGO_A',-3.4,-5.4,'ENTER_PORT','four','five'),('C1T-1','CARGO_A',-0.4,-6.4,'DROPOFF','five','six'),('C1T-1','CARGO_B',1.6,-4.7,'PICKUP','six','seven'),('C1T-1','CARGO_B',0.4,-3.4,'PORT_CHECKPOINT','seven','eight'),('C1T-1','CARGO_B',-0.3,0.2,'EXIT_PORT','eight','nine'); +UNLOCK TABLES; diff --git a/configuration/mysql/garage_port_drayage/port_drayage_lane2.sql b/configuration/mysql/garage_port_drayage/port_drayage_lane2.sql new file mode 100644 index 000000000..0e111bd22 --- /dev/null +++ b/configuration/mysql/garage_port_drayage/port_drayage_lane2.sql @@ -0,0 +1,49 @@ +-- MySQL 8.0 for Linux amd64 (x86_64) and arm64 (aarch64) +-- +-- Host: 127.0.0.1 Database: PORT_DRAYAGE +-- ------------------------------------------------------ +-- Server version 7.6.0 +-- Current Database: `PORT_DRAYAGE` +-- + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `PORT_DRAYAGE` /*!40100 DEFAULT CHARACTER SET latin1 */; + +USE `PORT_DRAYAGE`; + +-- +-- Table structure for table `first_action` +-- + +DROP TABLE IF EXISTS `first_action`; +CREATE TABLE `first_action` ( + `cmv_id` varchar(20) NOT NULL, + `cargo_id` varchar(20) DEFAULT NULL, + `destination_lat` decimal(9,7) NOT NULL, + `destination_long` decimal(9,7) NOT NULL, + `operation` varchar(20) NOT NULL, + `action_id` varchar(36) NOT NULL, + `next_action` varchar(36) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +LOCK TABLES `first_action` WRITE; +INSERT INTO `first_action` VALUES ('C1T-1','NULL',-2.3,0.7,'ENTER_STAGING_AREA','one','two'); +UNLOCK TABLES; + +-- +-- Table structure for table `freight` +-- + +DROP TABLE IF EXISTS `freight`; +CREATE TABLE `freight` ( + `cmv_id` varchar(20) NOT NULL, + `cargo_id` varchar(20) DEFAULT NULL, + `destination_lat` decimal(9,7) NOT NULL, + `destination_long` decimal(9,7) NOT NULL, + `operation` varchar(20) NOT NULL, + `action_id` varchar(36) NOT NULL, + `next_action` varchar(36) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +LOCK TABLES `freight` WRITE; +INSERT INTO `freight` VALUES ('C1T-1','NULL',-0.4,-0.4,'EXIT_PORT','zero','one'),('C1T-1','NULL',-2.3,0.7,'ENTER_STAGING_AREA','one','two'),('C1T-1','CARGO_A',-3.4,-1.4,'PICKUP','two','three'),('C1T-1','CARGO_A',-3.4,-3.4,'EXIT_STAGING_AREA','three','four'),('C1T-1','CARGO_A',-3.4,-5.4,'ENTER_PORT','four','five'),('C1T-1','CARGO_A',-0.4,-6.4,'DROPOFF','five','six'),('C1T-1','CARGO_B',2.6,-4.7,'PICKUP','six','seven'),('C1T-1','CARGO_B',0.4,-3.4,'PORT_CHECKPOINT','seven','eight'),('C1T-1','CARGO_B',-0.3,0.2,'EXIT_PORT','eight','nine'); +UNLOCK TABLES;