Top Level Namespace
Defined Under Namespace
Modules: AudienceAdminSeperation, ConfigHelper, DefaultStyles, Enumerable, LegacyFirmware, MainHelper, NewFirmware, RaceHelper, RacerHelper, Sequel, Subclasses, TournamentHelper, Units Classes: AddForFunToRaces, Array, CategoryController, ConfigController, CreateCategories, CreateCategorizations, CreateRacers, CreateRaces, CreateTournaments, Dummy2Database, Dummy3Database, DummyConnection, DummyDatabase, DummyDataset, DummyModelBased, DummyMummyDatabase, DummyMummyDataset, ErrorSettingLength, FalseClass, FalseStart, Fixnum, Float, Hash, Integer, Main, MissingArduinoError, MockDatabase, MockDataset, NilClass, Numeric, Object, Proc, RaceController, RaceData, RacerController, SchemaDummyDatabase, Sensor, String, Symbol, TournamentController, TrueClass, UnitsError
Constant Summary collapse
- Infinity =
1/0.0
- LIB_DIR =
lib_dir
- TITLE =
['title']
- SKIN =
['skin']
- RACE_TRACK =
(["progress_bars", "clock"].detect { |track| track == ['track'] } || "progress_bars").to_sym
- USABLE_HEIGHT =
['usable_window_height'].to_i.nonzero?||nil
- HEIGHT =
[height,550].max
- WIDTH =
['window_width'].to_i.nonzero?||(width.to_i-50)
- HEIGHT_AUDIENCE =
['audience_window_height'].to_i.nonzero? || HEIGHT
- WIDTH_AUDIENCE =
['audience_window_width'].to_i.nonzero? || WIDTH
- BACKGROUND_COLOR =
Shoes::COLORS[:black]
- BACKGROUND_IMAGE =
rgb(0,0,0,0)
- MENU_BACKGROUND_IMAGE =
rgb(0,0,0,0)
- UNIT_SYSTEM =
(['units'] == 'standard') ? :mph : :kph
- UNIT_SYSTEM_STR =
(['units'] == 'standard') ? "mph" : "km/h"
- MILLIS_PER_FRAME =
RaceData contains some useful methods for parsing and storing race data packets from the Arduino
The packets are in the structure [email protected]#
TIME is an string representing 32-bit millis(), DATA is a block of characters encoding one HEX nibble per byte, to which we've added 128 to remain string-friendly The first data byte corresponds to the tick status at TIME The second to TIME + RACE_FRAME_LENGTH (typically 2ms here) Subsequent correspond to TIME + x, where x is the index of the byte in the data section
Each HEX nibble represents the tick status of each sensor during the 1-2ms period to which it corresponds
parseStringToRaceData takes this data and puts the times into arrays for each racer redTicks indicates that Red ticked at 0, 10, 18 and 24 milliseconds, respectively redTicks.size * rollercircumference == current distance for red
MILLIS_PER_FRAME should correspond to the Arduino – currently ~2ms, but can be a float to make minor corrections…
2.0
- POSTGRES_URL =
database objects for running adapter specs ADO_DB = Sequel.connect(:adapter => 'ado', :driver => “Access Driver (*.mdb); DBQ=c:\Nwind.mdb”) INFORMIX_DB = Sequel.connect('informix://localhost/mydb') INTEGRATION_URL = 'sqlite:/' MYSQL_USER = 'root' MYSQL_URL = “mysql://#MYSQL_USER@localhost/sandbox” MYSQL_SOCKET_FILE = '/tmp/mysql.sock' ORACLE_DB = Sequel.connect('oracle://hr:[email protected]/XE')
'postgres://postgres:[email protected]:5432/reality_spec'
- MSSQL_URL =
'jdbc:sqlserver://localhost;integratedSecurity=true;database=sandbox'
- MSSQL_DB =
Sequel.connect(ENV['SEQUEL_MSSQL_SPEC_DB']||MSSQL_URL)
- INTEGRATION_DB =
Sequel.sqlite('', :loggers=>[sql_logger], :quote_identifiers=>false)
- MYSQL_USER =
'root'
- MYSQL_URL =
(ENV['SEQUEL_MY_SPEC_DB']||"mysql://#{MYSQL_USER}@localhost/sandbox")
- MYSQL_DB =
Sequel.connect(MYSQL_URL)
- MYSQL_SOCKET_FILE =
'/tmp/mysql.sock'
- MYSQL_URI =
URI.parse(MYSQL_DB.uri)
- ORACLE_DB =
Sequel.connect('oracle://hr:[email protected]/XE')
- SQLITE_URL =
'sqlite:/'
- SQLITE_DB =
Sequel.connect(ENV['SEQUEL_SQLITE_SPEC_DB']||SQLITE_URL)
- FIREBIRD_URL =
'firebird://sysdba:[email protected]/reality_spec'
- FIREBIRD_DB =
Sequel.connect(ENV['SEQUEL_FB_SPEC_DB']||FIREBIRD_URL)
- INFORMIX_DB =
Sequel.connect('informix://localhost/mydb')
- POSTGRES_DB =
Sequel.connect(ENV['SEQUEL_PG_SPEC_DB']||POSTGRES_URL)
- CONNECTION_POOL_DEFAULTS =
{:pool_timeout=>5, :pool_sleep_time=>0.001, :pool_reuse_connections=>:allow, :pool_convert_exceptions=>true, :max_connections=>4}
- MIGRATION_001 =
%[ class CreateSessions < Sequel::Migration def up create(1111) end def down drop(1111) end end ]
- MIGRATION_002 =
%[ class CreateNodes < Sequel::Migration def up create(2222) end def down drop(2222) end end ]
- MIGRATION_003 =
%[ class CreateUsers < Sequel::Migration def up create(3333) end def down drop(3333) end end ]
- MIGRATION_005 =
%[ class CreateAttributes < Sequel::Migration def up create(5555) end def down drop(5555) end end ]
- ALT_MIGRATION_001 =
%[ class CreateAltBasic < Sequel::Migration def up create(11111) end def down drop(11111) end end ]
- ALT_MIGRATION_003 =
%[ class CreateAltAdvanced < Sequel::Migration def up create(33333) end def down drop(33333) end end ]
- SQL_BEGIN =
'BEGIN'
- SQL_ROLLBACK =
'ROLLBACK'
- SQL_COMMIT =
'COMMIT'
- DATABASE_PATH =
File.join(LIB_DIR,'opensprints_data.db')
Instance Method Summary collapse
Instance Method Details
#clear_sqls ⇒ Object
15 16 17 |
# File 'lib/sequel/spec/integration/spec_helper.rb', line 15 def clear_sqls $sqls.clear end |