home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR15 / BM105.ZIP / FORMAT.TXT < prev    next >
Text File  |  1993-12-08  |  13KB  |  365 lines

  1. CASE- TAB-T MARG+1,77
  2.  
  3. Bike Manager (TM)
  4. Copyright (C) 1991, 1992 Joern Yngve Dahl-Stamnes
  5. All rights reserved.
  6.  
  7. e-mail: dahls@fysel.unit.no
  8.  
  9. Database file format, version 1.05.
  10. -----------------------------------
  11.  
  12. NOTE: The modification done in version 1.05 adds new fields to the database
  13. file. The program can read databases created by version 1.04 without
  14. problems. But version 1.04 of the program cannot read a database created by
  15. version 1.05.
  16.  
  17. The database is an ASCII file which can be typed out to the screen, printed
  18. out on a printer or you can edit it in any editor. However, before you begin
  19. edit a database file, you should know about the format of the file.
  20.  
  21. The header is the first part of the file. It consist of setup data, record
  22. counts etc. A typical header:
  23.  
  24. 09-02-92 11:39.26 rev=12
  25. 3 - 3 : 0 0 0 0 1 f9f
  26. 3 5 6 10 2
  27. 3 5 6 10 0 0 0
  28. 1 1 1 2 0 0
  29.  
  30. The first line contain the date/time for last saving and the revision count
  31. (increased by one for each save operation). This line will be printed out in
  32. the window when retrieving the file. The next line have 10 fields which are
  33. setup data:
  34.  
  35.     1: Date format number (0 - 9).
  36.     2: Date separation sign (single character).
  37.     3: Time format number (0 - 3).
  38.     4: Time separation sign (single character).
  39.  
  40.     Measurement types (0 = metric, 1 = nonmetric):
  41.     5: distance
  42.     6: height
  43.     7: length
  44.     8: speed
  45.     9: temperature
  46.  
  47.     10: Option flags (32 bit value in hex format)
  48.  
  49. Line three contain, in order, the number of bikes, trails, training types,
  50. training entries and calendar messages written in the database. Line four
  51. contain the values used when new bikes, trails, training types or training
  52. entries are created. This line should not be modified. The last line in the
  53. header is flags that tells if rating, personal information and heart rate
  54. monitor (HRM) information is present in the database. When these flags are
  55. set to 1, these informations are present. 0 mean that they are not present.
  56. The 4th number in line 5 tells the number of calendar messages in the
  57. database (stored at the end of the database file).
  58.  
  59. The three 0's in line 4 and the two 0's 5 shall always be 0. These are just
  60. spare values for futhure use.
  61.  
  62. If there is an error in on of the header lines, the error message "read
  63. error, level=N", the number N gives the number of the line where the error
  64. was found. If you get this error message while retrieving a database, check
  65. the header line where the error occured.
  66.  
  67. In the following sections all information that are related to a bike, a
  68. trail etc. are enclosed in {} parenteses. If one of these are missing, the
  69. record cannot be read. In worst case the database cannot be read by the
  70. program. The general format of each field are as follow:
  71.  
  72.     single_character_code=data, ...
  73. or
  74.     single_character_code=data <End Of Line>
  75. or
  76.     single_character_code=data}
  77.  
  78. All fields will begin with a letter (case sensitive) followed by a equival
  79. sign (=) and then the data. For integer and float values, there might be
  80. leading spaces, which will be ignored. A comma or a }-parentese will follow
  81. the data exept for the data at the end of a line when there is more data on
  82. the next line (the } parentese terminate the current record). All strings
  83. must be quoted by double quotes (") (note 1).
  84.  
  85. Each field are described belowe. The [?] tell the type of data, where ? can
  86. be as follow: 
  87.  
  88.     b: Boolean flags (0 or 1).
  89.     i: Integer values.
  90.     f: Float values.
  91.     s: Quoted strings (note 1).
  92.     x: Hex bitmask values (no leading 0x).
  93.  
  94.  
  95.  
  96. The next section of the database file is the personal information fields.
  97. This section is only present if it has been defined. Flag 2 in line 5 in
  98. the header must be 1 if this section is present. Example:
  99.  
  100. #
  101. # personal data
  102. #
  103. {n="Grey LeHound", a="Earth, The Solar System"
  104. p="+123-132-1123", y=1968, s=1, h=182.0}
  105.  
  106.     n: [s] Your personal name.
  107.     a: [s] Your home address.
  108.     p: [s] Your phone number.
  109.     y: [i] Year of birth.
  110.     s: [b] Your sex, 1 = male, 0 = female.
  111.     h: [f] Your height.
  112.  
  113.  
  114.  
  115. If flag 3 in line 5 in the header is 1, then the next section is the heart
  116. rate monitor data:
  117.  
  118. #
  119. # HRM data
  120. #
  121. {n="Polar Accurex",  s="12345", f=f, l=3}
  122.  
  123.     n: [s] The montor brand name.
  124.     s: [s] Serial number.
  125.     f: [x] Bitmask flags.
  126.     l: [i] Number of laptimes if the monitor got a stopwatch.
  127.  
  128.  
  129.  
  130. The bike section:
  131.  
  132. #
  133. # Bike data
  134. #
  135. {I=1, n="C'dale R1000", b="Cannondale", m="R1000", s="123456789"
  136. S=54.00, y=(1992,1992), X=1
  137. d={Description text}
  138. C={b="Cateye", m="Micro cc-6000"
  139. o=17, s="123456", z=( 208,207.70)}, G=(0)}
  140. {I=2, n="C'dale V2000", b="Cannondale", m="Delta V 2000", s="123456789"
  141. S=48.00, y=(1992,1992), X=0
  142. d={Mountain bike}
  143. C={b="Cateye", m="vectra cc-7000"
  144. s="12345", z=( 204,204.00)}, G=(0)}
  145. {I=3, n="Trek", b="Trek", m="750", s="123456789"
  146. S=19.00, y=(1990,1992), X=0
  147. d={Description text¡
  148. Up to 20 lines of 60 characters each}
  149. C={}, G=(0)}
  150.  
  151.     I: [i] Unique identifier for the bike. No bikes must have the same ID.
  152.     n: [s] The bike name that will appare in the menues.
  153.     b: [s] Brand name.
  154.     m: [s] Model name.
  155.     s: [s] Serial number.
  156.     S: [f] Frame size.
  157.     d: [s] Description text (note 1).
  158.     y: [i] Production year, purchase year (enclosed in () parenteses).
  159.     C: Optionaly (C={} if not used), contain bike computer data:
  160.         b: [s] Brand name.
  161.         m: [s] Model name.
  162.         o: [x] Option mask.
  163.         s: [s] Serial number.
  164.         z: [f] (Setting, actual setting).
  165.     G: Gearing data, (0) if none, othervise:
  166.         field 1: [i] No. of chainwheels.
  167.         field 2: [i] No. of cogs.
  168.         field 3: [f] The wheel size.
  169.         field 4-N: [i] no. of teeths on freewheel followed by the cogs.
  170.     A: [x] Attribute mask.
  171.     X: [x] Preference mask.
  172.  
  173. If a bike doesn't got any computer, the argument to the C field should be
  174. '{}' (see example above).
  175.  
  176.  
  177.  
  178. The trail data follows the bike data section:
  179.  
  180. #
  181. # Trail data
  182. #
  183. {I=5, n="Around the corner!", m="none", A=210.1, a=(100,20), l= 100.00, s=5,
  184. X=0, M=0, d={no comments}}
  185. {I=3, n="Paris - Bouraix", m="France", A=10540.0, a=(9999,9), l=1234.00, s=9,
  186. X=1, M=0, d={Description text for this trail.¡
  187. Can consist of up to 20 lines each 60 characters long.}}
  188. {I=1, n="Paris - Brest - Paris", m="France", A=850.3, a=(400,100), l=1260.00,
  189. s=9, X=3, M=1, d={Trail description...}}
  190. {I=4, n="To work and back home again", m="none", A=210.0, a=(120,30), l=15.60,
  191. s=1, X=0, M=0, d={To work and back}}
  192. {I=2, n="Trondheim - Oslo", m="Norway", A=2100.0, a=(1033,10), l= 540.00, s=9,
  193. X=0, M=0, d={The Great Trail of Strength.}}
  194.  
  195.     I: [i] Unique identifier, no trails must have the same ID.
  196.     n: [s] Trail name which you find in the menues.
  197.     m: [i] Map reference.
  198.     A: [f] Total Accumulated Altitude given in meters (note 2).
  199.     a: [f] (max altitude, min altitude) given in meters (note 2).
  200.     l: [f] Trail length, given in km (note 2).
  201.     s: [i] Skill rate (0 - 9).
  202.     d: [s] Description (note 1).
  203.     X: [x] Preference mask.
  204.     M: [b] Multiple stage trail.
  205.  
  206.  
  207.  
  208. Then comes the training data section:
  209.  
  210. #
  211. # Training data
  212. #
  213. {I=6, n="Commuting", v=(  0.00,  0.00,  0.00), z=(0,0)
  214. h=(  0.0,  0.0), X=0
  215. d={description text}}
  216. {I=4, n="Group training", v=( 50.00, 60.00, 50.00), z=(175,155)
  217. h=(150, 5.0), X=0}
  218. {I=3, n="Offroad training", v=( 30.00, 60.00, 60.00), z=(180,150)
  219. h=(155, 10.0), X=0}
  220. {I=2, n="Road training", v=( 50.00, 60.00, 30.00), z=(180,150)
  221. h=(155, 7.5), X=1}
  222. {I=5, n="Team Time Trial", v=( 90.00, 30.00, 90.00), z=(185,155)
  223. h=(175, 10.0), X=7}
  224. {I=1, n="Time Trial", v=( 90.00, 20.00, 90.00), z=(185,150)
  225. h=(178, 5.0), X=0
  226. d={Training type description text¡
  227. Can have up to 20 lines with 60 characters each.}}
  228.  
  229.     I: [i] Unique identifier, no training type must have the same ID.
  230.     d: [s] Description text (note 1).
  231.     h: [f] (Average heart rate, deviation in %).
  232.     n: [s] Training type name.
  233.     v: [f] (Speed value, Endurance value, Power value).
  234.     z: [i] HRM Target zone (Max,Min).
  235.     X: [x] Preference mask.
  236.  
  237.  
  238.  
  239. The next section is the rating section. The flag 1 on line 5 in the header
  240. must be 1 if this section is present:
  241.  
  242. #
  243. # Rating data
  244. #
  245. {l=1, h=6
  246. d={very light¡
  247. light¡
  248. normal¡
  249. a little bit hard¡
  250. hard¡
  251. very hard}}
  252.  
  253.     l: [i] Low rating value.
  254.     h: [i] High rating value.
  255.     d: [s] Rating description (note 1).
  256.  
  257.  
  258.  
  259. Now comes the biggest section which contain all the training data entries:
  260.  
  261. #
  262. # Log data
  263. #
  264. {I=001, D=(1992,1,12), R=(3,6,4,2), t=  4215, o=(   0.0,   0.0), l=  15.60
  265. T=( 14.0, 12.0), r=(60,21,149), z=(145,175)
  266. d={Notes about the workout etc.¡
  267. Up to 20 lines with maximum 60 characters each.}}
  268. #
  269. {I=002, D=(1992,1,16), R=(3,6,4,2), t=  4512, o=(   0.0,   0.0), l=  15.60
  270. T=(  9.0,  7.0)
  271. d={just another trip to work!}}
  272.  
  273.     I: [i] Unique identifier, no training data entries must have the same ID.
  274.     A: [f] Total accumulated altitude in meter (note 2).
  275.     D: [i] Training date (year,month,day).
  276.     R: [i] References (bike ID, training type ID, trail ID, Rating value).
  277.     t: [f] Training time.
  278.     o: [f] ODO value (before,after) given in km (ntoe 2).
  279.     l: [f] Training distance (trip distance) given in km (note 2).
  280.     h: [f] Optionaly, HRM data: (time over TZ, in TZ, under TZ).
  281.     r: [i] Optionaly, HRM data: Recovery data (recover time,recover factor
  282.            and average heart rate).
  283.     z: [i] Optionaly, HRM data: Target zone (low,high).
  284.     c: [f] Optionaly, Correction factor.
  285.     X: [x] Mask value (not used, for futhure expansion 8-).
  286.     T: [f] Temperature, (max,min) given in celcius (note 2).
  287.     d: [s] Description, freetext (note 1).
  288.  
  289. The correction factor is used to correct for the wheel setting on your
  290. bike computer. The values in the 'o' and the 'l' fields are multiplied
  291. with this value when the data are processed (note that the data for
  292. these fields in the database file are what you punched in). The z field
  293. (HRM target zone values) are fields which are copied into the data entry
  294. when it is created. The source is the training type that the user
  295. select. Field I must be present before the training data entry is legal.
  296. The X field are not in use in the current version of Bike Manager.
  297.  
  298.  
  299.  
  300. The second last section is the goal records:
  301.  
  302. #
  303. # Goal data
  304. #
  305. {T=1, n="test-1", r=(1), l= 2000.0, D=(1992,1,1,1992,6,1)}
  306. {T=1, n="test-2", r=(1), l=10000.0, D=(1992,1,1,1992,12,31)}
  307.  
  308.     T: [i] Type of goal, the number correspond to the menu you get when you
  309.        define a goal (range 1 - 4).
  310.     n: [s] The goal name.
  311.     r: [i] Bike or training IDs. Note the parenteses.
  312.        (ie: "r=(1)" or "r=(1,4,5)").
  313.     l: [f] Length field given in km (note 2).
  314.     D: [i] Date range (from year, -month, -day, to year, -month, -day).
  315.        Only valid for goal type 1, 2 and 4.
  316.     P: [i] Date range (from year, -week, to year, -week).
  317.        Only valid for goal type 3.
  318.     c: [i] Count, valid only for goal type 2.
  319.  
  320. Note that some of the fields are only valid for some goal types. Mixing
  321. fields that are used by different goal types will cause unpredictable
  322. results.
  323.  
  324.  
  325.  
  326. If there is any calendar messages in the database, they are located at the
  327. end of the file. The number of these messages are stored as the 4th value in
  328. line 5 in the header. A typical section of calendar messages in a database
  329. file may look like this:
  330.  
  331. #
  332. # Calendar messages data
  333. #
  334. {D=(1993,3,22), X=0, d="Time to get the racer out on the road... "}
  335. {D=(1993,6,19), X=0, d="The Great Trial of Strength              "}
  336.  
  337.     D: [i] Message date (year,month,day).
  338.     X: [x] Message options (not currently used).
  339.     d: [s] The message.
  340.  
  341.  
  342.  
  343. note 1:
  344. -------
  345. Since the description text for trails and training data entries can consist
  346. of more than one line, the format of the description may look like this:
  347.  
  348. d={this is line 1¡
  349. this is line 2¡
  350. this is line 3, the last one}
  351.  
  352. Note that these lines are not quoted, and the each line (exept for the
  353. last line) is terminated by ASCII character 173. Any quote will be
  354. treated as a part of the text.
  355.  
  356. note 2:
  357. -------
  358.  
  359. All values for length, distance, height and temperature are internaly stored
  360. as metric values regardless of what the user prefer. If the user select
  361. non-metric values, the metric values are converted to non-metric when they
  362. are printed out.
  363.  
  364. ---- end-of-file
  365.