diff --git a/README.md b/README.md index dc75d5f..d69d4a0 100644 --- a/README.md +++ b/README.md @@ -9,22 +9,22 @@ Written in [Cinder](https://libcinder.org/), an opensource C++ library for creat ## Using the Application #### Requirements -* Requires OS X version 10.7 and up. -* PC requires Windows 7 and up. +* Requires (±mac)OS X version 10.7 and up. +* PC requires Windows 7 and up #### Installation 1. Download the latest [SilverSprints](https://github.com/cwhitney/SilverSprint/releases/latest) for your operating system. 2. In the downlaoded zip file, there is an `Arduino` folder with software you'll need to load onto the OpenSprints hardware. Detailed instructions on how to do this can be found here: [http://cwhitney.github.io/SilverSprint/installation.html](http://cwhitney.github.io/SilverSprint/installation.html). #### App Settings -1. Go to the Settings page by clicking the gear icon or pressing Command + 3. +1. Go to the Settings page by clicking the gear icon or pressing Command + 3 2. Set the roller diameter as the distance from the magnet to the center of the roller multiplied by 2. 3. Choose the number of racers competing from 1-4. 4. If SilverSprints detects an Arduino connected it will show a checkmark, otherwise it will display an X. #### Roster -1. Go to the Roster page by clicking the list icon or pressing Command + 2. -2. Set all active participants' names. +1. Go to the Roster page by clicking the list icon or pressing Command + 2 +2. Set all active participants names #### Race 1. Click the START button to begin a race. @@ -38,10 +38,10 @@ In the event of a crash, a log file will be created in a folder called "logs" in Please attach this file when asking for support along with any other relevant information. ## Code Setup -1. Clone the repo with all of its submodules with: `git clone https://github.com/cwhitney/SilverSprint.git --depth 1 --recursive` -2. Build Cinder for your platform [OS X](https://libcinder.org/docs/guides/mac-setup/index.html) - [Windows](https://libcinder.org/docs/guides/windows-setup/index.html). -If you're having trouble building Cinder, it may be missing some of its dependencies. You may need to run `git submodule update --init --recursive` to make sure Cinder has all of its submodules. -3. The structure of the repo is like so: +1. Clone the repo with all of it's sumodules with: `git clone https://github.com/cwhitney/SilverSprint.git --depth 1 --recursive` +1. Build Cinder (with Cinder-OpenCV) for your platform [(±mac)OS X](https://libcinder.org/docs/guides/mac-setup/index.html) - [Windows](https://libcinder.org/docs/guides/windows-setup/index.html). +If you're having trouble building Cinder, it may be missing some of it's dependencies. You may need to run `git submodule update --init --recursive` to make sure Cinder has all of it's submodules. +2. The structure of the repo is like so: ``` Root @@ -50,10 +50,12 @@ Root - SilverSprints - libs - Cinder + - blocks + - Cinder-OpenCV ``` -4. Update Arduino if necessary. (See above.) -5. Open the project file for your platform. It will be in `apps/SilverSprints/xcode/SilverSprint.xcodeproj` for OS X, and `apps/SilverSprints/vs2015` for PC. -6. Build SilverSprints. There are no external dependencies aside from Cinder itself. +3. Update Arduino if necessary. (See above) +4. Open the project file for your platform. It will be in `apps/SilverSprint/xcode/SilverSprint.xcodeproj` for OSX, and `apps/SilverSprint/vs2015` for PC. +5. Build Silversprints. There are no external dependencies aside from Cinder itself. ## Credits diff --git a/apps/Silversprints/src/app/GFXMain.cpp b/apps/Silversprints/src/app/GFXMain.cpp index 631f530..9751cd2 100644 --- a/apps/Silversprints/src/app/GFXMain.cpp +++ b/apps/Silversprints/src/app/GFXMain.cpp @@ -41,7 +41,11 @@ GFXMain::~GFXMain(){ void GFXMain::setup(){ // INIT -------------------------------------------------------------- mSerialReader = std::make_shared(); - CsvLogger::instance().setHeaders({"Timestamp", "Event", "Racer 1", "Racer 2", "Racer 3", "Racer 4"}); + if(Model::instance().getCurrentRaceType() == Model::RACE_TYPE::RACE_TYPE_DISTANCE){ + CsvLogger::instance().setHeaders({"Timestamp", "Event", "Racer 1", "Distance 1", "Racer 2", "Distance 2", "Racer 3", "Distance 3", "Racer 4", "Distance 4"}); + } else { + CsvLogger::instance().setHeaders({"Timestamp", "Event", "Racer 1", "Time 1", "Racer 2", "Time 2", "Racer 3", "Time 3", "Racer 4", "Time 4"}); + } // VIEWS -------------------------------------------------------------- mNav = std::make_shared(); @@ -91,24 +95,36 @@ void GFXMain::onRaceFinished() { // If it's a distance race, log the times if(Model::instance().getCurrentRaceType() == Model::RACE_TYPE::RACE_TYPE_DISTANCE){ CsvLogger::instance().log(CsvLogger::RACE_FINISH_DISTANCE, + Model::instance().playerData[0]->player_name, sb::utils::millisToTimestamp(Model::instance().playerData[0]->finishTimeMillis), + Model::instance().playerData[1]->player_name, sb::utils::millisToTimestamp(Model::instance().playerData[1]->finishTimeMillis), + Model::instance().playerData[2]->player_name, sb::utils::millisToTimestamp(Model::instance().playerData[2]->finishTimeMillis), + Model::instance().playerData[3]->player_name, sb::utils::millisToTimestamp(Model::instance().playerData[3]->finishTimeMillis)); } // If it's a time race, log the distance else { if(Model::instance().getUsesKph()){ CsvLogger::instance().log(CsvLogger::RACE_FINISH_TIME, + Model::instance().playerData[0]->player_name, Model::instance().playerData[0]->getDistanceMeters(), + Model::instance().playerData[1]->player_name, Model::instance().playerData[1]->getDistanceMeters(), + Model::instance().playerData[2]->player_name, Model::instance().playerData[2]->getDistanceMeters(), + Model::instance().playerData[3]->player_name, Model::instance().playerData[3]->getDistanceMeters()); }else{ CsvLogger::instance().log(CsvLogger::RACE_FINISH_TIME, + Model::instance().playerData[0]->player_name, Model::instance().playerData[0]->getDistanceFeet(), + Model::instance().playerData[1]->player_name, Model::instance().playerData[1]->getDistanceFeet(), + Model::instance().playerData[2]->player_name, Model::instance().playerData[2]->getDistanceFeet(), + Model::instance().playerData[3]->player_name, Model::instance().playerData[3]->getDistanceFeet()); } } diff --git a/apps/Silversprints/xcode/SilverSprint.xcodeproj/project.pbxproj b/apps/Silversprints/xcode/SilverSprint.xcodeproj/project.pbxproj index f298821..cd5993a 100644 --- a/apps/Silversprints/xcode/SilverSprint.xcodeproj/project.pbxproj +++ b/apps/Silversprints/xcode/SilverSprint.xcodeproj/project.pbxproj @@ -555,7 +555,7 @@ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0820; + LastUpgradeCheck = 1000; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SilverSprint" */; compatibilityVersion = "Xcode 3.2"; @@ -631,6 +631,7 @@ C01FCF4B08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; DEAD_CODE_STRIPPING = YES; @@ -657,6 +658,7 @@ C01FCF4C08A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; @@ -687,14 +689,23 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CINDER_PATH = "../../..//libs/Cinder"; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "c++11"; CLANG_CXX_LIBRARY = "libc++"; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -723,14 +734,23 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CINDER_PATH = "../../..//libs/Cinder"; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "c++11"; CLANG_CXX_LIBRARY = "libc++"; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; diff --git a/libs/Cinder b/libs/Cinder index 4bc734c..0634d15 160000 --- a/libs/Cinder +++ b/libs/Cinder @@ -1 +1 @@ -Subproject commit 4bc734cba1e30fafd24cd24ab6e20b9e93c92ab3 +Subproject commit 0634d151a33b849d3284402a905e736e49fb50f1