From e345a93cbce7dbb6d56a10e71010337e2aedf588 Mon Sep 17 00:00:00 2001 From: "Sean C. Rhea" Date: Thu, 7 Sep 2006 00:11:06 +0000 Subject: [PATCH] moving things around; won't build for now --- compare_rows.pl | 83 ------------------------ notes.txt | 75 --------------------- Makefile => src/cmd/Makefile | 0 cpint-cmd.c => src/cmd/cpint.c | 0 intervals.pl => src/cmd/intervals.pl | 0 ptdl.c => src/cmd/ptdl.c | 0 ptpk.c => src/cmd/ptpk.c | 0 ptunpk.c => src/cmd/ptunpk.c | 0 smooth.pl => src/cmd/smooth.pl | 0 {gui => src/gui}/AllPlot.cpp | 0 {gui => src/gui}/AllPlot.h | 0 {gui => src/gui}/ChooseCyclistDialog.cpp | 0 {gui => src/gui}/ChooseCyclistDialog.h | 0 {gui => src/gui}/DownloadRideDialog.cpp | 0 {gui => src/gui}/DownloadRideDialog.h | 0 {gui => src/gui}/GoldenCheetah.pro | 0 {gui => src/gui}/MainWindow.cpp | 0 {gui => src/gui}/MainWindow.h | 0 {gui => src/gui}/RawFile.cpp | 0 {gui => src/gui}/RawFile.h | 0 {gui => src/gui}/RideItem.cpp | 0 {gui => src/gui}/RideItem.h | 0 {gui => src/gui}/Settings.h | 0 {gui => src/gui}/TODO | 0 {gui => src/gui}/addqt.sh | 0 {gui => src/gui}/main.cpp | 0 {gui => src/gui}/mkdmg.sh | 0 cpint.c => src/lib/cpint.c | 0 cpint.h => src/lib/cpint.h | 0 pt.c => src/lib/pt.c | 0 pt.h => src/lib/pt.h | 0 test.sh | 30 --------- 32 files changed, 188 deletions(-) delete mode 100755 compare_rows.pl delete mode 100644 notes.txt rename Makefile => src/cmd/Makefile (100%) rename cpint-cmd.c => src/cmd/cpint.c (100%) rename intervals.pl => src/cmd/intervals.pl (100%) rename ptdl.c => src/cmd/ptdl.c (100%) rename ptpk.c => src/cmd/ptpk.c (100%) rename ptunpk.c => src/cmd/ptunpk.c (100%) rename smooth.pl => src/cmd/smooth.pl (100%) rename {gui => src/gui}/AllPlot.cpp (100%) rename {gui => src/gui}/AllPlot.h (100%) rename {gui => src/gui}/ChooseCyclistDialog.cpp (100%) rename {gui => src/gui}/ChooseCyclistDialog.h (100%) rename {gui => src/gui}/DownloadRideDialog.cpp (100%) rename {gui => src/gui}/DownloadRideDialog.h (100%) rename {gui => src/gui}/GoldenCheetah.pro (100%) rename {gui => src/gui}/MainWindow.cpp (100%) rename {gui => src/gui}/MainWindow.h (100%) rename {gui => src/gui}/RawFile.cpp (100%) rename {gui => src/gui}/RawFile.h (100%) rename {gui => src/gui}/RideItem.cpp (100%) rename {gui => src/gui}/RideItem.h (100%) rename {gui => src/gui}/Settings.h (100%) rename {gui => src/gui}/TODO (100%) rename {gui => src/gui}/addqt.sh (100%) rename {gui => src/gui}/main.cpp (100%) rename {gui => src/gui}/mkdmg.sh (100%) rename cpint.c => src/lib/cpint.c (100%) rename cpint.h => src/lib/cpint.h (100%) rename pt.c => src/lib/pt.c (100%) rename pt.h => src/lib/pt.h (100%) delete mode 100755 test.sh diff --git a/compare_rows.pl b/compare_rows.pl deleted file mode 100755 index 6c6684fe4..000000000 --- a/compare_rows.pl +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/perl -w -# -# $Id: compare_rows.pl,v 1.1 2006/05/12 21:50:51 srhea Exp $ -# -# Copyright (c) 2006 Russ Cox (rsc@swtch.com) and Sean Rhea (srhea@srhea.net) -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., 51 -# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -# - -use strict; - -if ($#ARGV < 1) { - print STDERR "usage: compare_rows.pl [column]\n"; - exit 1; -} - -my $file1 = $ARGV[0]; -my $file2 = $ARGV[1]; -my $start_col = 0; -my $stop_col = 8; -if ($#ARGV >= 2) { - my $stop_col = $ARGV[2]; - my $start_col = $stop_col - 1; -} - -open(FILE1, $file1) or die "Couldn't open $file1\n"; -open(FILE2, $file2) or die "Couldn't open $file2\n"; - -my $row = 0; -while() { - ++$row; - $_ =~ s/^\s+//; - my @cols1 = split /\s+/, $_; - my $row2 = ; - if ($row2) { - my @cols2 = split /\s+/, $row2; - my $col; - for ($col = $start_col; $col < $stop_col; ++$col) { - if (($cols1[$col] =~ m/[0-9.]+/) && ($cols2[$col] =~ m/[0-9.]+/)) { - if ($col == 0) { - # Times are sometimes off by a bit; just make sure they're - # within a tenth of a percent. - if (($cols1[$col] * 0.999 > $cols2[$col]) - || ($cols1[$col] * 1.001 < $cols2[$col])) { - print "$file1: @cols1\n"; - print "$file2: @cols2\n"; - } - } - else { - # All other columns should match exactly. - if ($cols1[$col] != $cols2[$col]) { - print "$file1: @cols1\n"; - print "$file2: @cols2\n"; - } - } - } - elsif (!($cols1[$col] eq $cols2[$col])) { - print "$file1: @cols1\n"; - print "$file2: @cols2\n"; - } - } - } - else { - print "$file1 is longer.\n"; - } -} - -if () { - print "$file2 is longer.\n"; -} - diff --git a/notes.txt b/notes.txt deleted file mode 100644 index 7a30ab8ee..000000000 --- a/notes.txt +++ /dev/null @@ -1,75 +0,0 @@ - -Version header: - -sometimes bytes added before 0x56 - -00 56 45 52 20 30 .VER 0 -32 2e 32 31 20 50 2.21 P -52 4f 00 00 00 00 RO.... -00 00 00 00 00 00 ...... -00 00 00 00 0d 0a ....\r\n - - -Data: - -Get 12 packets of 1542 (0x606) bytes each. -Where is that encoded? - -Each row is 6 bytes. -Rows that start with 0x8? are the data for one period. - -Column Meaning Format -1 ??? -2, n1 torque 4 most sig bits, N m -2, n2 km/h 4 most sig bits, 0x24000 / value * 0.1 -3 torque 8 least sig bits, N m -4 km/h 8 least sig bits, 0x24000 / value * 0.1 -5 Cadence 1-byte integer -6 Heartrate 1-byte integer - - -First row is always: - -57 56 55 64 02 15 - -Base period in thousands of a minute = 0x15... - - -A row starting with 0x60 encodes the time of day that measurements started. -This is always the second record in the stream. Also, when the computer goes -to sleep and then wakes up again, it writes one of these records first. - -Example: 60 06 04 9c 2a 30 - -byte 2 year -byte 3 month -byte 4, bottom 5 bits day -byte 5, bottom 5 bits hour -byte 6, bottom 6 bits minute - -top 3 bits of byte 4 followed by top 3 bits of byte 5 is pretty close to the -right seconds value, but not perfect... - - -A row starting with 0x40 encodes: - - bytes 2-3 the wheel circumference in mm - byte 4 the interval number - byte 5 the recording interval, where - - byte value interval - 0x0 1 - 0x1 2 - 0x3 5 - 0x7 10 - 0x17 30 - -Example: - -40 08 30 02 07 00 - wheel size in mm = 0x0830 - interval 2 - recording interval 10 - - - diff --git a/Makefile b/src/cmd/Makefile similarity index 100% rename from Makefile rename to src/cmd/Makefile diff --git a/cpint-cmd.c b/src/cmd/cpint.c similarity index 100% rename from cpint-cmd.c rename to src/cmd/cpint.c diff --git a/intervals.pl b/src/cmd/intervals.pl similarity index 100% rename from intervals.pl rename to src/cmd/intervals.pl diff --git a/ptdl.c b/src/cmd/ptdl.c similarity index 100% rename from ptdl.c rename to src/cmd/ptdl.c diff --git a/ptpk.c b/src/cmd/ptpk.c similarity index 100% rename from ptpk.c rename to src/cmd/ptpk.c diff --git a/ptunpk.c b/src/cmd/ptunpk.c similarity index 100% rename from ptunpk.c rename to src/cmd/ptunpk.c diff --git a/smooth.pl b/src/cmd/smooth.pl similarity index 100% rename from smooth.pl rename to src/cmd/smooth.pl diff --git a/gui/AllPlot.cpp b/src/gui/AllPlot.cpp similarity index 100% rename from gui/AllPlot.cpp rename to src/gui/AllPlot.cpp diff --git a/gui/AllPlot.h b/src/gui/AllPlot.h similarity index 100% rename from gui/AllPlot.h rename to src/gui/AllPlot.h diff --git a/gui/ChooseCyclistDialog.cpp b/src/gui/ChooseCyclistDialog.cpp similarity index 100% rename from gui/ChooseCyclistDialog.cpp rename to src/gui/ChooseCyclistDialog.cpp diff --git a/gui/ChooseCyclistDialog.h b/src/gui/ChooseCyclistDialog.h similarity index 100% rename from gui/ChooseCyclistDialog.h rename to src/gui/ChooseCyclistDialog.h diff --git a/gui/DownloadRideDialog.cpp b/src/gui/DownloadRideDialog.cpp similarity index 100% rename from gui/DownloadRideDialog.cpp rename to src/gui/DownloadRideDialog.cpp diff --git a/gui/DownloadRideDialog.h b/src/gui/DownloadRideDialog.h similarity index 100% rename from gui/DownloadRideDialog.h rename to src/gui/DownloadRideDialog.h diff --git a/gui/GoldenCheetah.pro b/src/gui/GoldenCheetah.pro similarity index 100% rename from gui/GoldenCheetah.pro rename to src/gui/GoldenCheetah.pro diff --git a/gui/MainWindow.cpp b/src/gui/MainWindow.cpp similarity index 100% rename from gui/MainWindow.cpp rename to src/gui/MainWindow.cpp diff --git a/gui/MainWindow.h b/src/gui/MainWindow.h similarity index 100% rename from gui/MainWindow.h rename to src/gui/MainWindow.h diff --git a/gui/RawFile.cpp b/src/gui/RawFile.cpp similarity index 100% rename from gui/RawFile.cpp rename to src/gui/RawFile.cpp diff --git a/gui/RawFile.h b/src/gui/RawFile.h similarity index 100% rename from gui/RawFile.h rename to src/gui/RawFile.h diff --git a/gui/RideItem.cpp b/src/gui/RideItem.cpp similarity index 100% rename from gui/RideItem.cpp rename to src/gui/RideItem.cpp diff --git a/gui/RideItem.h b/src/gui/RideItem.h similarity index 100% rename from gui/RideItem.h rename to src/gui/RideItem.h diff --git a/gui/Settings.h b/src/gui/Settings.h similarity index 100% rename from gui/Settings.h rename to src/gui/Settings.h diff --git a/gui/TODO b/src/gui/TODO similarity index 100% rename from gui/TODO rename to src/gui/TODO diff --git a/gui/addqt.sh b/src/gui/addqt.sh similarity index 100% rename from gui/addqt.sh rename to src/gui/addqt.sh diff --git a/gui/main.cpp b/src/gui/main.cpp similarity index 100% rename from gui/main.cpp rename to src/gui/main.cpp diff --git a/gui/mkdmg.sh b/src/gui/mkdmg.sh similarity index 100% rename from gui/mkdmg.sh rename to src/gui/mkdmg.sh diff --git a/cpint.c b/src/lib/cpint.c similarity index 100% rename from cpint.c rename to src/lib/cpint.c diff --git a/cpint.h b/src/lib/cpint.h similarity index 100% rename from cpint.h rename to src/lib/cpint.h diff --git a/pt.c b/src/lib/pt.c similarity index 100% rename from pt.c rename to src/lib/pt.c diff --git a/pt.h b/src/lib/pt.h similarity index 100% rename from pt.h rename to src/lib/pt.h diff --git a/test.sh b/test.sh deleted file mode 100755 index 88f54c85f..000000000 --- a/test.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -# -# $Id: test.sh,v 1.2 2006/05/14 14:17:21 srhea Exp $ -# -# Copyright (c) 2006 Russ Cox (rsc@swtch.com) and Sean Rhea (srhea@srhea.net) -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., 51 -# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -# - -grep 'Rider' $1.xml | sed -e 's/<[^>]*>/ /g' > win -if ! ./ptunpk -c < $1.raw | grep -v '^#' > mac -then - echo "Failed to unpack $1.raw"; - exit 1 -fi -./compare_rows.pl win mac $2 -rm win mac -