Skip to content

coner-tech/coner-timer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

coner-timer

Capture times from hardware timers

Build Status codecov

Library

  • Capture times from hardware timers connected by USB/serial port
  • Supports JACircuits time encoding

Usage:

Maven dependency:

<dependency>
    <groupId>org.coner</groupId>
    <artifactId>coner-timer-library</artifactId>
</dependency>

Start logging times:

val reader = PureJavaCommTimerInputReader(
     pureJavaComm = PureJavaCommWrapper(),
     appName = "coner-timer-cli",
     port = "ttyUSB0"
)
val timer = Timer(
    controller = TimerInputReaderController(reader = reader),
    rawInputWriter = FileAppendingOutputWriter(rawInputLogFile),
    mapper = JACTimerInputMapper(),
    mappedInputWriter = PrintlnTimerOutputWriter<FinishTriggerElapsedTimeOnly>(),
)
timer.start()
// receive some times on your hardware timer connected to ttyUSB0

// when you're ready to stop receiving times
timer.stop()

CLI

A functional reference app demonstrating time capture with the Coner Timer library.

Build and run

Prerequisites:

  • JDK 8

Produce a build:

./mvnw clean package

List available ports:

java -jar cli/target/coner-timer-cli-*.jar port list

Capture times from hardware timer on ttyUSB0, log raw input to raw-input.log, and echo formatted times to console:

java -jar cli/target/coner-timer-cli-*.jar port capture --raw-log raw-input.log ttyUSB0

Replay times in raw-input.log as input, and echo formatted times to console:

java -jar cli/target/coner-timer-cli-*.jar file replay raw-input.log

About

Connect timing hardware to Coner

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages