-- MySQL dump 9.10
--
-- Host: localhost    Database: config
-- ------------------------------------------------------
-- Server version	4.0.18-max-nt

--
-- Table structure for table `aio`
--

CREATE TABLE aio (
  branchline varchar(32) NOT NULL default '',
  name varchar(32) NOT NULL default '',
  wagoNum int(11) NOT NULL default '0',
  outputAddress int(11) default NULL,
  inputAddress int(11) default NULL,
  scale double(16,4) default NULL,
  offset double(16,4) default NULL,
  type varchar(32) default NULL,
  isEnabled int(11) NOT NULL default '1',
  createDate timestamp(14) NOT NULL,
  PRIMARY KEY  (branchline,name,isEnabled)
) TYPE=InnoDB;

--
-- Table structure for table `collimator`
--

CREATE TABLE collimator (
  branchline varchar(32) NOT NULL default '',
  name varchar(32) NOT NULL default '',
  size double(16,4) NOT NULL default '0.0000',
  num int(11) default NULL,
  isEnabled int(11) NOT NULL default '1',
  createDate timestamp(14) NOT NULL,
  PRIMARY KEY  (branchline,name,isEnabled)
) TYPE=InnoDB;

--
-- Table structure for table `detector`
--

CREATE TABLE detector (
  branchline varchar(32) NOT NULL default '',
  adc varchar(16) NOT NULL default 'fast',
  beamCenterX double(16,4) NOT NULL default '94.0000',
  beamCenterY double(16,4) NOT NULL default '99.3000',
  bigEndian int(11) NOT NULL default '1',
  checkStatus int(11) NOT NULL default '0',
  colXfer int(11) NOT NULL default '1152',
  detectorSn int(11) NOT NULL default '423',
  hasJ5trigger int(11) NOT NULL default '1',
  pixelSize double(16,4) NOT NULL default '0.0816',
  rowXfer int(11) NOT NULL default '1152',
  saveRawImage int(11) NOT NULL default '0',
  sizeX int(11) NOT NULL default '188',
  sizeY int(11) NOT NULL default '188',
  isEnabled int(11) NOT NULL default '1',
  createDate timestamp(14) NOT NULL,
  PRIMARY KEY  (branchline,isEnabled)
) TYPE=InnoDB;

--
-- Table structure for table `generalparam`
--

CREATE TABLE generalparam (
  branchline varchar(32) NOT NULL default '',
  device varchar(32) NOT NULL default 'device',
  name varchar(32) NOT NULL default '',
  value varchar(64) NOT NULL default 'value',
  isEnabled int(11) NOT NULL default '1',
  createDate timestamp(14) NOT NULL,
  PRIMARY KEY  (branchline,device,name,isEnabled)
) TYPE=InnoDB;

--
-- Table structure for table `io`
--

CREATE TABLE io (
  branchline varchar(32) NOT NULL default '',
  name varchar(32) NOT NULL default '',
  wagoNum int(11) NOT NULL default '0',
  outputAddress int(11) default NULL,
  offName varchar(32) NOT NULL default 'out',
  onName varchar(32) NOT NULL default 'in',
  offAddress int(11) default NULL,
  onAddress int(11) default NULL,
  extra varchar(32) default NULL,
  defState varchar(32) default NULL,
  isEnabled int(11) NOT NULL default '1',
  grouping varchar(32) default NULL,
  numInGroup int(11) default NULL,
  createDate timestamp(14) NOT NULL,
  PRIMARY KEY  (branchline,name,isEnabled)
) TYPE=InnoDB;

--
-- Table structure for table `iointerlock`
--

CREATE TABLE iointerlock (
  branchline varchar(32) NOT NULL default '',
  name varchar(32) NOT NULL default '',
  isOnInterlock int(11) NOT NULL default '1',
  lockName varchar(32) NOT NULL default 'Rotate',
  lockState varchar(32) NOT NULL default 'up',
  lockName2 varchar(32) default NULL,
  lockState2 varchar(32) default NULL,
  isEnabled int(11) NOT NULL default '1',
  createDate timestamp(14) NOT NULL
) TYPE=InnoDB;

--
-- Table structure for table `ipaddress`
--

CREATE TABLE ipaddress (
  branchline varchar(32) NOT NULL default '',
  name varchar(32) NOT NULL default '',
  address varchar(32) NOT NULL default '192.168.0.0',
  port int(11) default NULL,
  isEnabled int(11) NOT NULL default '1',
  createDate timestamp(14) NOT NULL,
  PRIMARY KEY  (branchline,name,isEnabled)
) TYPE=InnoDB;

--
-- Table structure for table `motor`
--

CREATE TABLE motor (
  branchline varchar(32) NOT NULL default '',
  name varchar(32) NOT NULL default '',
  type varchar(16) NOT NULL default 'Pmac',
  pmacNum int(11) NOT NULL default '0',
  motorNum int(11) NOT NULL default '0',
  offset double(16,4) NOT NULL default '0.0000',
  scale double(16,4) NOT NULL default '1.0000',
  units varchar(32) default NULL,
  min double(16,4) default NULL,
  max double(16,4) default NULL,
  speed double default NULL,
  inPosition double default NULL,
  outPosition double default NULL,
  killDelay double(16,4) default NULL,
  brakeMvar int(11) default NULL,
  isEnabled int(11) NOT NULL default '1',
  createDate timestamp(14) NOT NULL,
  PRIMARY KEY  (branchline,name,isEnabled)
) TYPE=InnoDB;

--
-- Table structure for table `questarbutton`
--

CREATE TABLE questarbutton (
  row int(11) NOT NULL default '0',
  col int(11) NOT NULL default '0',
  cmd varchar(10) NOT NULL default '',
  text varchar(32) NOT NULL default '',
  PRIMARY KEY  (row,col)
) TYPE=InnoDB;

--
-- Table structure for table `session`
--

CREATE TABLE session (
  branchline varchar(32) NOT NULL default '',
  name varchar(32) NOT NULL default '',
  start varchar(64) NOT NULL default '/prod/DCS/bin/name',
  IPaddress varchar(32) default NULL,
  logfile varchar(64) default NULL,
  HasPipeArg int(11) default NULL,
  HasPipeFile int(11) default NULL,
  SleepSeconds int(11) default NULL,
  num int(11) default NULL,
  isEnabled int(11) NOT NULL default '1',
  createDate timestamp(14) NOT NULL,
  PRIMARY KEY  (branchline,name,isEnabled)
) TYPE=InnoDB;

--
-- Table structure for table `stage`
--

CREATE TABLE stage (
  branchline varchar(16) NOT NULL default '',
  name varchar(16) NOT NULL default 'X stage',
  offset int(11) NOT NULL default '0',
  scale int(11) NOT NULL default '500',
  wagoInChan int(11) NOT NULL default '2',
  wagoOutChan int(11) NOT NULL default '0',
  motorNum int(11) NOT NULL default '1',
  A int(11) NOT NULL default '300',
  V int(11) NOT NULL default '500000',
  E int(11) NOT NULL default '1000',
  KD int(11) NOT NULL default '100',
  KI int(11) NOT NULL default '28',
  KL int(11) NOT NULL default '20',
  KP int(11) NOT NULL default '150',
  createDate timestamp(14) NOT NULL,
  isEnabled int(11) NOT NULL default '1',
  PRIMARY KEY  (branchline,name,isEnabled)
) TYPE=InnoDB;

--
-- Table structure for table `updates`
--

CREATE TABLE updates (
  branchline varchar(32) NOT NULL default '',
  tbl varchar(32) NOT NULL default '',
  name varchar(32) NOT NULL default '',
  old_value varchar(32) NOT NULL default '',
  createDate timestamp(14) NOT NULL
) TYPE=InnoDB;

--
-- Table structure for table `videoswitch`
--

CREATE TABLE videoswitch (
  branchline varchar(32) NOT NULL default '',
  name varchar(32) NOT NULL default '',
  command varchar(32) NOT NULL default 'CLOSE 100',
  num int(11) default NULL,
  isEnabled int(11) NOT NULL default '1',
  createDate timestamp(14) NOT NULL,
  PRIMARY KEY  (branchline,name,isEnabled)
) TYPE=InnoDB;

--
-- Table structure for table `zoom`
--

CREATE TABLE zoom (
  branchline varchar(32) NOT NULL default '',
  name varchar(32) NOT NULL default '',
  xCenter int(11) NOT NULL default '0',
  yCenter int(11) NOT NULL default '0',
  xScale double(16,4) NOT NULL default '0.0000',
  yScale double(16,4) NOT NULL default '0.0000',
  num int(11) NOT NULL default '0',
  isEnabled int(11) NOT NULL default '1',
  createDate timestamp(14) NOT NULL,
  PRIMARY KEY  (branchline,name,isEnabled)
) TYPE=InnoDB;

