ezws2ps

From Wiki
Jump to: navigation, search

Overview

ezws2ps is a Windows application that converts an EzWinScore match database to a Practiscore match file that can be directly imported into Practiscore.

The EzWinScore match database may contain match competitors, stage definitions, and scores. Checkboxes allow selecting which information is transferred. Built-in help describes how to transfer the resulting Practiscore match file from the Windows computer to an Apple or Android device.

System Requirements

ezws2ps is a standalone Windows executable, and should run on Windows NT and up, on either x86 or x64 processors. The program can either be run as a normal Windows program, or it can be run from a DOS shell (cmd.exe, for example) if you prefer a command line environment.

The only requirement ezws2ps has is that EzWinScore already be installed on the same machine. ezws2ps uses ODBC to read the EzWinScore match database, which requires the Adaptive Server Anywhere 9.0 SQL engine installed by the EzWinScore installer.

Downloading

The latest version is available from https://dl.dropbox.com/u/12548441/ezws2ps.zip

The zip file contains the ezws2ps.exe program and a README.txt file.

Installing

To install ezws2ps, either download ezws2ps.exe directly to your desktop, or ezws2ps.zip from the link above and extract it to your desktop. That's it! No installer, no DLLs, nothing!

Uninstalling

To remove ezws2ps, simply delete the ezws2ps.exe file. Note that ezws2ps remembers the last EzWinScore match database and Practiscore file names, along with which conversion options were selected, and where the window was position on the screen. To do this, it writes several entries into the system registry under HKEY_CURRENT_USER\Software\JCWren\ezws2ps. If you don't know what this means, don't worry about it. If you're the really obsessive type, you can use regedit.exe or regedt32.exe to remove HKEY_CURRENT_USER\Software\JCWren and everything under it.

Usage

GUI

To use ezws2ps's GUI interface, double-click on the program to start it. A window will open that should look similar to the image below:


ezws2ps.png

Use the upper 'Browse' button (or Alt-B) to open the file selection window. Navigate to where the EzWinScore match database is stored, and either double-click the match database name, or click the name once, then the 'Open' button. NOTE: EzWinScore must NOT be running when you use ezws2ps. It doesn't know how to share nicely, and will cause ezws2ps to report that the match database cannot be found.

Use the lower 'Browse' button (or Alt-R) to select the directory and file name where the resulting Practiscore match file should be saved.

Use the 'Include Competitors', 'Include Stages' and 'Include Scores' checkboxes to select what information is to be transferred. When ezws2ps is run the first time, the 'Include Competitors' and 'Include Stages' checkboxes will be checked, and 'Include Scores' will not. It is not a problem if competitors do not exist in the EzWinScore match database and the 'Include Competitors' box is checked. The same applies for the 'Include Stages' and 'Include Scores' checkboxes. If 'Include Competitors' or 'Include Stages' is un-checked, the 'Include Scores' option will be grayed out (Practiscore requires both the competitors and stage definitions to be present for scores to exist). If both 'Include Competitors' and 'Include Stages' are un-checked, the 'Convert' button will be grayed out.

Once the EzWinScore match database, Practiscore match file, and checkboxes are selected, click the 'Convert' button (or Alt-C) to convert the match database. The cursor will change to an hourglass, and you may notice the taskbar flash as the Adaptive Server Anywhere SQL server loads (this happens when EzWinScore is started also). After the conversion completes, the hourglass will change back to a regular cursor and the 'Conversion not yet performed' status will reflect the number of competitors, stages and scores transferred.

To close the program, either click the 'X' in the upper right-hand corner of the window, or use Alt-F4. Go to this section for transferring the Practiscore match file to Apple or Android devices.

Command Line

The command line is for those of us that just don't like using a GUI, or use a batch file for conversion. For this, I'm going to assume a basic familiarity with command lines in general. I'll use cmd.exe for the commands, but note that running under the Cygwin bash shell works just as well. You'll need to know what directory ezws2ps.exe is in, and where the EzWinScore match database to be converted is.

Open cmd.exe, and change to either the directory containing ezws2ps.exe or the directory containing the EzWinScore match database. For this example, I will assume that ezws2ps.exe is in the directory cmd.exe defaulted to when started (in my case, it's 'C:\Users\jcw'), and that the EzWinScore match database is in 'C:\Users\jcw\Documents\USPSA'.

To get command line help, use 'ezws2ps -h'. This will print out a short page of help. Below is an abbreviated version of the help page:

EZWS2PS -i <ezws_database> -o <practiscore_match> [OPTIONS...]

  -? | --help                   - This help list
  -i | --input                  - EZWS database file name
  -o | --output                 - Practiscore match output file name
  -c | --competitors            - Include competitors from EZWS (default)
  -C | --no-competitors         - Do not include competitors from EZWS
  -d | --deleted-competitors    - Include deleted competitors (default)
  -D | --no-deleted-competitors - Do not include deleted competitors
  -s | --stages                 - Include stages from EZWS (default)
  -S | --no-stages              - Do not include stages from EZWS
  -l | --deleted-stages         - Include deleted stages (default)
  -L | --no-deleted-stages      - Do not include deleted stages
  -p | --scores                 - Include any scores from EZWS
  -P | --no-scores              - Do not included scores from EZWS (default)
  -q | --quiet                  - Do not display conversion statistics
  -v | --version                - Display program version information

To convert the EzWinScore match database with default options (include competitors and stages, but not scores), use:

C:\Users\jcw>ezws2ps -i Documents\USPSA\CGC_2012-10-13.db -o CGC_2012-10-13.psc

The 'C:\Users\jcw>' isn't typed, of course. That's cmd.exe displaying what directory we're currently in.

Transferring To Practiscore

Regardless of which platform you use, there are a number of ways to transfer the Practiscore match file to the scoring device. Which method used is determined by what type of device is being used and what resources for that device are available.

Android

Dropbox

If you're not familiar with Dropbox, it's an excellent program for sharing files between many platforms and devices (Windows, Mac, Linux, Android, iOS and Blackberry). It's free, and comes with 2GB of storage.
Pros: Very quick to distribute a match.
Cons: Requires internet access, and your Dropbox account may be present on club scoring devices (unless you sync the scoring devices against your personal phone).
  • Copy the Practiscore match file to a Dropbox folder
  • Open Dropbox on the Android device
  • Touch and hold the match file name
  • Touch 'Export'
  • Touch 'Save to SD card'
  • Touch 'Export'
  • Touch the 'Home' button
  • Start Practiscore
  • Touch 'Sync'
  • Touch 'Import Match'
  • Touch the match file name
  • Touch 'Select'
  • Touch 'Close' after the 'Success' dialog appears

SD Card

If an SD card is available, and an adapter to connect it to a PC, the Practiscore match file can be copied to the SD card, then the SD card inserted in the device. The assumption will be made that the match file has already been copied to the root (top level) directory of the SD card, and the SD card has already inserted into the Android device.
Pros: No internet access required.
Cons: Handling a tiny little SD card, requires SD card adapter for PC.
  • Start Practiscore
  • Touch 'Sync'
  • Touch 'Import Match'
  • Touch the match file name
  • Touch 'Select'
  • Touch 'Close' after the 'Success' dialog appears

USB (non-NOOK Simple Touch devices)

Most Android devices (phones & tables) have an SD card installed. The Practiscore match file can be copied to the SD card, and then imported from within Practiscore.
Pros: Very quick to distribute a match.
Cons: Requires a USB cable.
  • Connect the Android device to the PC with a USB cable
  • Touch 'Turn on USB storage' on the device after it appears
  • Touch 'OK' on the device
  • Double-click 'My Computer' on the PC's desktop (or Start->Computer)
  • Double-click the drive letter the attached Android device presents itself as ('Removeable Disk (G:)', for example)
  • Copy the Practiscore match file to this directory
  • Right-click on the drive letter, and select 'Eject'
  • After the 'Safe To Remove Hardware' message box appears on the PC, disconnect the USB cable
  • Start Practiscore on the Android device
  • Touch 'Sync'
  • Touch 'Import Match'
  • Touch the match file name
  • Touch 'Select'
  • Touch 'Close' after the 'Success' dialog appears

USB (NOOK Simple Touch devices)

This method works well if an SD card is not installed in the NST (we don't because it's just an added cost and something else to lose). The procedure is similar to the above, but the file is copied to a different directory.
Pros: Quick to distribute a match.
Cons: Requires a USB cable.
  • Connect the NST to the PC with a USB cable
  • Double-click 'My Computer' on the PC's desktop (or Start->Computer)
  • The NST will appear as two drives under 'My Computer'
  • Double-click the drive letter named 'NOOK'
  • Double-click into the 'My Files' folder
  • Double-click into the 'Documents' folder
  • Copy the Practiscore match file to this directory
  • Click the 'Back' button to go back to the 'My Files' directory
  • Click the 'Back' button again to go back to the 'NOOK' directory
  • Click the 'Back' button again to display the drives in the system
  • Right-click on the NOOK drive letter, and select 'Eject'
  • After the 'Safe To Remove Hardware' message box appears on the PC, disconnect the USB cable
  • Start Practiscore on the Android device
  • Touch 'Sync'
  • Touch 'Import Match'
  • Touch the match file name
  • Touch 'Select'
  • Touch 'Close' after the 'Success' dialog appears

Web Browser

This method currently fails under Practiscore 1.0.12 and earlier.
The match file can be uploaded to any internet-based web hosting service available, and downloaded from there through the browser on the Android device. This works well if internet service is available at the range (usually not, where I shoot), but just feels cumbersome.
An easier and more direct method is to install a web server (I like nginx) on the same machine as EzWinScore. The match file is copied into the document root of the web server, then browsed with the Android device. While this does make the assumption that a WiFi network is available at the range, if multiple devices running Practiscore are being used to score the match, there's likely to be a WiFi access point present.
If the machine running EzWinScore is on the same network as the NST, and a web browser is installed (I like nginx), the match file can be imported into Practiscore by downloading it from the web server.
Pros: No cables needed
Cons: Assumes a WiFi network or hotspot (with or without internet access) is available.
  • Copy the match file to the web server's document root
  • Open the web browser on the NST
  • Type the IP address of the machine running the web server
  • Touch the match file name
  • Touch 'ActivityImportPSC'
  • (need to finish this, after the feature works correctly)

Apple (iOS)

Dropbox

Email

Web Browser

Notes

ezws2ps is written in straight "C", using the MinGW-32 compiler. For the JSON handling, it uses the Jansson library. To produce the Practiscore .psc file (which is actually just a zip file with two JSON files in it), zlib with modifications to compile under mingw-32 is used. ResEdit was used to create the resource file for the application. All compilation takes place from the command line, using a Makefile.

No GUI development for me, thanks!

Versions

  • 1.0.7
  • Fixed issue of no competitors in .psc file when competitors & stages checked, but no stages are defined in EzWinScore
  • 1.0.6
  • Added exporting address, city, state, ZIP code from EzWinScore to PractiScore (however, PractiScore only supports the state, and only in iOS versions 1.661 and above)
  • 1.0.5
  • Added support to convert EZWS multi-gun matches.
  • Fixed error in stage creation when targets don't all have same number of hits.
  • 1.0.4
  • Fixed an issue with multi-string times in scores not being correctly copied to the PractiScore .psc file when 'Include Scores' is checked.
  • Added knowledge of classifier stages so when a classifier is present, the hits per target is known instead of inferred. This issue affected classifiers CM99-02, CM99-09 and CM99-63 not having the number of hits on each target defined correctly.
  • Added support for target type. If target type is defined as Classic in EzWinScore, then 'Classic Targets (No B Zone)' is checked in PractiScore.
  • Added support to force target NPMs to number of hits per target when scoring is fixed time (PractiScore iOS already did this internally, not sure about Android, but it's the "correct" way to define the stage).
  • 1.0.3
  • Minor internal code clean-ups that didn't affect users
  • 1.0.2
  • Fixed issue with times written to .psc file being local time instead of UTC
  • 1.0.1
  • Initial public release
  • 1.0.0
  • Initial release (never made public)