home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / MISC / EDUCATIO / DIVECOMP.ZIP / DIVECOMP.SH < prev    next >
SHell self-extracting ARchive  |  1990-12-16  |  32.9 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: SHell self-extracting ARchive (archive/shar).

You can browse this item here: DIVECOMP.SH

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert SHell self-extracting ARchive (archive/shar) magic Supported
1% dexvert Stanford Graphics slide Show (other/stanfordGraphicsSlideShow) ext Unsupported
1% dexvert Text File (text/txt) fallback Supported
100% file ASCII text default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/329 Shell Archive Format default
100% detectItEasy Format: plain text[LF] default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 23 20 54 68 69 73 20 69 | 73 20 61 20 73 68 65 6c |# This i|s a shel|
|00000010| 6c 20 61 72 63 68 69 76 | 65 2e 20 20 52 65 6d 6f |l archiv|e. Remo|
|00000020| 76 65 20 61 6e 79 74 68 | 69 6e 67 20 62 65 66 6f |ve anyth|ing befo|
|00000030| 72 65 20 74 68 69 73 20 | 6c 69 6e 65 2c 0a 23 20 |re this |line,.# |
|00000040| 74 68 65 6e 20 75 6e 70 | 61 63 6b 20 69 74 20 62 |then unp|ack it b|
|00000050| 79 20 73 61 76 69 6e 67 | 20 69 74 20 69 6e 20 61 |y saving| it in a|
|00000060| 20 66 69 6c 65 20 61 6e | 64 20 74 79 70 69 6e 67 | file an|d typing|
|00000070| 20 22 73 68 20 66 69 6c | 65 22 2e 0a 23 0a 23 20 | "sh fil|e"..#.# |
|00000080| 57 72 61 70 70 65 64 20 | 62 79 20 44 61 76 65 20 |Wrapped |by Dave |
|00000090| 57 61 6c 6c 65 72 20 3c | 64 61 76 65 40 68 70 64 |Waller <|dave@hpd|
|000000a0| 73 74 6d 61 3e 20 6f 6e | 20 57 65 64 20 44 65 63 |stma> on| Wed Dec|
|000000b0| 20 31 32 20 31 36 3a 34 | 32 3a 33 32 20 31 39 39 | 12 16:4|2:32 199|
|000000c0| 30 0a 23 0a 23 20 54 68 | 69 73 20 61 72 63 68 69 |0.#.# Th|is archi|
|000000d0| 76 65 20 63 6f 6e 74 61 | 69 6e 73 3a 0a 23 09 4e |ve conta|ins:.#.N|
|000000e0| 61 76 79 09 09 45 64 67 | 65 09 09 42 75 68 6c 6d |avy..Edg|e..Buhlm|
|000000f0| 61 6e 6e 09 48 75 67 67 | 69 6e 73 09 09 0a 23 09 |ann.Hugg|ins...#.|
|00000100| 64 69 76 65 63 6f 6d 70 | 2e 63 09 6d 61 6b 65 66 |divecomp|.c.makef|
|00000110| 69 6c 65 09 73 61 6d 70 | 6c 65 5f 70 72 6f 66 09 |ile.samp|le_prof.|
|00000120| 72 65 76 5f 68 69 73 74 | 6f 72 79 09 0a 23 0a 0a |rev_hist|ory..#..|
|00000130| 4c 41 4e 47 3d 22 22 3b | 20 65 78 70 6f 72 74 20 |LANG="";| export |
|00000140| 4c 41 4e 47 0a 50 41 54 | 48 3d 2f 62 69 6e 3a 2f |LANG.PAT|H=/bin:/|
|00000150| 75 73 72 2f 62 69 6e 3a | 24 50 41 54 48 3b 20 65 |usr/bin:|$PATH; e|
|00000160| 78 70 6f 72 74 20 50 41 | 54 48 0a 0a 65 63 68 6f |xport PA|TH..echo|
|00000170| 20 78 20 2d 20 4e 61 76 | 79 0a 63 61 74 20 3e 4e | x - Nav|y.cat >N|
|00000180| 61 76 79 20 3c 3c 27 40 | 45 4f 46 27 0a 35 09 31 |avy <<'@|EOF'.5.1|
|00000190| 30 34 0a 31 30 09 38 38 | 0a 32 30 09 37 32 0a 34 |04.10.88|.20.72.4|
|000001a0| 30 09 35 38 0a 38 30 09 | 35 32 0a 31 32 30 09 35 |0.58.80.|52.120.5|
|000001b0| 31 0a 40 45 4f 46 0a 0a | 63 68 6d 6f 64 20 36 34 |1.@EOF..|chmod 64|
|000001c0| 34 20 4e 61 76 79 0a 0a | 65 63 68 6f 20 78 20 2d |4 Navy..|echo x -|
|000001d0| 20 45 64 67 65 0a 63 61 | 74 20 3e 45 64 67 65 20 | Edge.ca|t >Edge |
|000001e0| 3c 3c 27 40 45 4f 46 27 | 0a 73 3a 32 2e 35 0a 35 |<<'@EOF'|.s:2.5.5|
|000001f0| 20 31 30 30 0a 31 31 20 | 38 31 2e 38 0a 31 37 20 | 100.11 |81.8.17 |
|00000200| 37 31 2e 35 0a 32 34 20 | 36 33 2e 37 0a 33 37 20 |71.5.24 |63.7.37 |
|00000210| 35 35 2e 39 0a 36 31 20 | 35 30 2e 37 0a 38 37 20 |55.9.61 |50.7.87 |
|00000220| 34 36 2e 38 0a 31 32 35 | 20 34 33 0a 31 39 37 20 |46.8.125| 43.197 |
|00000230| 33 39 2e 31 0a 32 37 31 | 20 33 36 2e 35 0a 33 39 |39.1.271| 36.5.39|
|00000240| 32 20 33 33 2e 39 0a 34 | 38 30 20 33 33 2e 30 0a |2 33.9.4|80 33.0.|
|00000250| 40 45 4f 46 0a 0a 63 68 | 6d 6f 64 20 36 34 34 20 |@EOF..ch|mod 644 |
|00000260| 45 64 67 65 0a 0a 65 63 | 68 6f 20 78 20 2d 20 42 |Edge..ec|ho x - B|
|00000270| 75 68 6c 6d 61 6e 6e 0a | 63 61 74 20 3e 42 75 68 |uhlmann.|cat >Buh|
|00000280| 6c 6d 61 6e 6e 20 3c 3c | 27 40 45 4f 46 27 0a 32 |lmann <<|'@EOF'.2|
|00000290| 2e 36 35 09 31 31 34 0a | 37 2e 39 34 09 39 31 0a |.65.114.|7.94.91.|
|000002a0| 31 32 2e 32 09 37 37 0a | 31 38 2e 35 09 37 30 0a |12.2.77.|18.5.70.|
|000002b0| 32 36 2e 35 09 36 35 0a | 33 37 09 35 38 0a 35 33 |26.5.65.|37.58.53|
|000002c0| 09 35 34 0a 37 39 09 35 | 33 0a 31 31 34 09 35 33 |.54.79.5|3.114.53|
|000002d0| 0a 31 34 36 09 35 31 0a | 31 38 35 09 35 31 0a 32 |.146.51.|185.51.2|
|000002e0| 33 38 09 34 38 0a 33 30 | 34 09 34 33 0a 33 39 37 |38.48.30|4.43.397|
|000002f0| 09 34 33 0a 35 30 33 09 | 34 33 0a 36 33 35 09 34 |.43.503.|43.635.4|
|00000300| 33 0a 40 45 4f 46 0a 0a | 63 68 6d 6f 64 20 36 34 |3.@EOF..|chmod 64|
|00000310| 34 20 42 75 68 6c 6d 61 | 6e 6e 0a 0a 65 63 68 6f |4 Buhlma|nn..echo|
|00000320| 20 78 20 2d 20 48 75 67 | 67 69 6e 73 0a 63 61 74 | x - Hug|gins.cat|
|00000330| 20 3e 48 75 67 67 69 6e | 73 20 3c 3c 27 40 45 4f | >Huggin|s <<'@EO|
|00000340| 46 27 0a 35 09 31 30 32 | 2e 30 0a 31 30 09 38 35 |F'.5.102|.0.10.85|
|00000350| 2e 30 0a 32 30 09 36 37 | 2e 35 0a 34 30 09 35 34 |.0.20.67|.5.40.54|
|00000360| 2e 35 0a 38 30 09 34 37 | 2e 35 0a 31 32 30 09 34 |.5.80.47|.5.120.4|
|00000370| 33 2e 30 0a 40 45 4f 46 | 0a 0a 63 68 6d 6f 64 20 |3.0.@EOF|..chmod |
|00000380| 36 34 34 20 48 75 67 67 | 69 6e 73 0a 0a 65 63 68 |644 Hugg|ins..ech|
|00000390| 6f 20 78 20 2d 20 64 69 | 76 65 63 6f 6d 70 2e 63 |o x - di|vecomp.c|
|000003a0| 0a 63 61 74 20 3e 64 69 | 76 65 63 6f 6d 70 2e 63 |.cat >di|vecomp.c|
|000003b0| 20 3c 3c 27 40 45 4f 46 | 27 0a 2f 2a 20 24 48 65 | <<'@EOF|'./* $He|
|000003c0| 61 64 65 72 3a 20 64 69 | 76 65 63 6f 6d 70 2e 63 |ader: di|vecomp.c|
|000003d0| 2c 76 20 32 2e 35 20 39 | 30 2f 31 32 2f 31 32 20 |,v 2.5 9|0/12/12 |
|000003e0| 31 35 3a 33 30 3a 30 32 | 20 64 61 76 65 20 45 78 |15:30:02| dave Ex|
|000003f0| 70 20 24 0a 20 20 20 24 | 4c 6f 67 3a 09 64 69 76 |p $. $|Log:.div|
|00000400| 65 63 6f 6d 70 2e 63 2c | 76 20 24 0a 20 2a 20 52 |ecomp.c,|v $. * R|
|00000410| 65 76 69 73 69 6f 6e 20 | 32 2e 35 20 20 39 30 2f |evision |2.5 90/|
|00000420| 31 32 2f 31 32 20 20 31 | 35 3a 33 30 3a 30 32 20 |12/12 1|5:30:02 |
|00000430| 20 31 35 3a 33 30 3a 30 | 32 20 20 64 61 76 65 20 | 15:30:0|2 dave |
|00000440| 28 44 61 76 65 20 57 61 | 6c 6c 65 72 29 0a 20 2a |(Dave Wa|ller). *|
|00000450| 20 53 65 65 20 66 69 6c | 65 20 22 72 65 76 5f 68 | See fil|e "rev_h|
|00000460| 69 73 74 6f 72 79 22 20 | 66 6f 72 20 69 6e 66 6f |istory" |for info|
|00000470| 72 6d 61 74 69 6f 6e 20 | 6f 6e 20 6e 65 77 20 66 |rmation |on new f|
|00000480| 65 61 74 75 72 65 73 2e | 0a 20 2a 20 0a 20 2a 20 |eatures.|. * . * |
|00000490| 52 65 76 69 73 69 6f 6e | 20 32 2e 34 20 20 39 30 |Revision| 2.4 90|
|000004a0| 2f 31 31 2f 32 37 20 20 | 31 35 3a 33 30 3a 30 33 |/11/27 |15:30:03|
|000004b0| 20 20 31 35 3a 33 30 3a | 30 33 20 20 64 61 76 65 | 15:30:|03 dave|
|000004c0| 20 28 44 61 76 65 20 57 | 61 6c 6c 65 72 29 0a 20 | (Dave W|aller). |
|000004d0| 2a 20 6e 65 77 20 66 65 | 61 74 75 72 65 73 3a 0a |* new fe|atures:.|
|000004e0| 20 2a 20 0a 20 2a 20 2d | 20 74 69 73 73 75 65 20 | * . * -| tissue |
|000004f0| 6c 6f 61 64 69 6e 67 20 | 67 72 61 70 68 20 6e 6f |loading |graph no|
|00000500| 77 20 63 6f 6d 70 72 65 | 73 73 65 73 20 77 68 65 |w compre|sses whe|
|00000510| 6e 20 74 69 73 73 75 65 | 20 6c 6f 61 64 69 6e 67 |n tissue| loading|
|00000520| 20 65 78 63 65 65 64 73 | 0a 20 2a 20 20 20 31 30 | exceeds|. * 10|
|00000530| 30 25 2c 20 74 6f 20 61 | 20 73 63 61 6c 65 20 6f |0%, to a| scale o|
|00000540| 66 20 30 2d 32 30 30 25 | 2e 20 52 65 73 63 61 6c |f 0-200%|. Rescal|
|00000550| 65 73 20 74 6f 20 30 2d | 31 30 30 25 20 77 68 65 |es to 0-|100% whe|
|00000560| 6e 20 61 6c 6c 20 63 6f | 6d 70 61 72 74 6d 65 6e |n all co|mpartmen|
|00000570| 74 73 0a 20 2a 20 20 20 | 61 72 65 20 3c 3d 20 31 |ts. * |are <= 1|
|00000580| 30 30 25 2e 0a 20 2a 20 | 0a 20 2a 20 2d 20 43 6f |00%.. * |. * - Co|
|00000590| 6d 70 61 72 74 6d 65 6e | 74 73 20 63 61 6e 20 6e |mpartmen|ts can n|
|000005a0| 6f 77 20 62 65 20 64 69 | 73 70 6c 61 79 65 64 20 |ow be di|splayed |
|000005b0| 61 73 20 61 62 73 6f 6c | 75 74 65 20 70 72 65 73 |as absol|ute pres|
|000005c0| 73 75 72 65 20 69 6e 20 | 28 75 6e 69 74 73 29 20 |sure in |(units) |
|000005d0| 73 65 61 0a 20 2a 20 20 | 20 77 61 74 65 72 2c 20 |sea. * | water, |
|000005e0| 69 6e 73 74 65 61 64 20 | 6f 66 20 25 20 6c 6f 61 |instead |of % loa|
|000005f0| 64 69 6e 67 2e 20 44 65 | 66 61 75 6c 74 20 69 73 |ding. De|fault is|
|00000600| 20 6c 6f 61 64 69 6e 67 | 20 67 72 61 70 68 2c 20 | loading| graph, |
|00000610| 61 62 73 6f 6c 75 74 65 | 0a 20 2a 20 20 20 70 72 |absolute|. * pr|
|00000620| 65 73 73 75 72 65 20 63 | 61 6e 20 62 65 20 73 65 |essure c|an be se|
|00000630| 6c 65 63 74 65 64 20 61 | 74 20 72 75 6e 74 69 6d |lected a|t runtim|
|00000640| 65 20 77 69 74 68 20 2d | 50 20 6f 70 74 69 6f 6e |e with -|P option|
|00000650| 2e 20 57 68 69 6c 65 20 | 74 68 65 20 70 72 6f 67 |. While |the prog|
|00000660| 72 61 6d 0a 20 2a 20 20 | 20 69 73 20 72 75 6e 6e |ram. * | is runn|
|00000670| 69 6e 67 2c 20 75 73 65 | 72 20 63 61 6e 20 74 6f |ing, use|r can to|
|00000680| 67 67 6c 65 20 62 65 74 | 77 65 65 6e 20 74 68 65 |ggle bet|ween the|
|00000690| 20 74 77 6f 20 6d 6f 64 | 65 73 20 62 79 20 74 79 | two mod|es by ty|
|000006a0| 70 69 6e 67 20 27 74 27 | 20 28 74 68 69 73 0a 20 |ping 't'| (this. |
|000006b0| 2a 20 20 20 6f 6e 6c 79 | 20 77 6f 72 6b 73 20 77 |* only| works w|
|000006c0| 68 69 6c 65 20 63 61 6c | 63 75 6c 61 74 69 6f 6e |hile cal|culation|
|000006d0| 73 20 61 72 65 20 74 61 | 6b 69 6e 67 20 70 6c 61 |s are ta|king pla|
|000006e0| 63 65 2c 20 6e 6f 74 20 | 77 68 69 6c 65 20 77 61 |ce, not |while wa|
|000006f0| 69 74 69 6e 67 20 66 6f | 72 0a 20 2a 20 20 20 69 |iting fo|r. * i|
|00000700| 6e 70 75 74 29 2e 20 53 | 63 61 6c 65 20 61 6c 6f |nput). S|cale alo|
|00000710| 6e 67 20 74 68 65 20 74 | 6f 70 20 69 73 20 63 61 |ng the t|op is ca|
|00000720| 6c 69 62 72 61 74 65 64 | 20 69 6e 20 28 75 6e 69 |librated| in (uni|
|00000730| 74 73 29 20 73 65 61 20 | 77 61 74 65 72 20 61 62 |ts) sea |water ab|
|00000740| 73 6f 6c 75 74 65 2e 0a | 20 2a 20 0a 20 2a 20 2d |solute..| * . * -|
|00000750| 20 44 75 72 69 6e 67 20 | 63 61 6c 63 75 6c 61 74 | During |calculat|
|00000760| 69 6f 6e 2c 20 64 65 70 | 74 68 20 63 61 6e 20 62 |ion, dep|th can b|
|00000770| 65 20 61 64 6a 75 73 74 | 65 64 20 75 70 20 6f 72 |e adjust|ed up or|
|00000780| 20 64 6f 77 6e 20 75 73 | 69 6e 67 20 74 68 65 20 | down us|ing the |
|00000790| 75 70 20 61 6e 64 0a 20 | 2a 20 20 20 64 6f 77 6e |up and. |* down|
|000007a0| 20 61 72 72 6f 77 20 6b | 65 79 73 20 6f 6e 20 74 | arrow k|eys on t|
|000007b0| 68 65 20 6b 65 79 62 6f | 61 72 64 2e 20 46 6f 72 |he keybo|ard. For|
|000007c0| 20 65 78 61 6d 70 6c 65 | 2c 20 69 66 20 74 68 65 | example|, if the|
|000007d0| 20 70 72 6f 67 72 61 6d | 20 69 73 20 63 61 6c 63 | program| is calc|
|000007e0| 75 6c 61 74 69 6e 67 0a | 20 2a 20 20 20 61 20 64 |ulating.| * a d|
|000007f0| 69 76 65 20 6c 65 76 65 | 6c 20 6f 66 20 36 30 20 |ive leve|l of 60 |
|00000800| 66 65 65 74 20 66 6f 72 | 20 35 30 20 6d 69 6e 75 |feet for| 50 minu|
|00000810| 74 65 73 2c 20 74 68 65 | 20 64 65 70 74 68 20 63 |tes, the| depth c|
|00000820| 61 6e 20 62 65 20 61 64 | 6a 75 73 74 65 64 20 75 |an be ad|justed u|
|00000830| 70 20 6f 72 0a 20 2a 20 | 20 20 64 6f 77 6e 20 62 |p or. * | down b|
|00000840| 79 20 70 72 65 73 73 69 | 6e 67 20 74 68 65 20 61 |y pressi|ng the a|
|00000850| 72 72 6f 77 20 6b 65 79 | 73 2e 20 41 64 6a 75 73 |rrow key|s. Adjus|
|00000860| 74 6d 65 6e 74 73 20 61 | 72 65 20 6d 61 64 65 20 |tments a|re made |
|00000870| 69 6e 20 69 6e 63 72 65 | 6d 65 6e 74 73 0a 20 2a |in incre|ments. *|
|00000880| 20 20 20 65 71 75 61 6c | 20 74 6f 20 74 68 65 20 | equal| to the |
|00000890| 64 65 70 74 68 20 69 6e | 63 72 65 6d 65 6e 74 20 |depth in|crement |
|000008a0| 69 6e 20 74 68 65 20 64 | 69 76 65 20 70 72 6f 66 |in the d|ive prof|
|000008b0| 69 6c 65 20 64 69 73 70 | 6c 61 79 2e 0a 20 2a 20 |ile disp|lay.. * |
|000008c0| 0a 20 2a 20 2d 20 49 66 | 20 63 6f 6d 70 61 72 74 |. * - If| compart|
|000008d0| 6d 65 6e 74 73 20 61 72 | 65 20 6f 76 65 72 6c 6f |ments ar|e overlo|
|000008e0| 61 64 65 64 2c 20 74 68 | 65 20 70 72 6f 67 72 61 |aded, th|e progra|
|000008f0| 6d 20 63 61 6e 20 22 61 | 75 74 6f 64 65 63 6f 6d |m can "a|utodecom|
|00000900| 70 72 65 73 73 22 20 62 | 79 0a 20 2a 20 20 20 65 |press" b|y. * e|
|00000910| 6e 74 65 72 69 6e 67 20 | 61 20 64 65 70 74 68 20 |ntering |a depth |
|00000920| 6f 66 20 27 64 27 20 69 | 6e 20 69 6e 74 65 72 61 |of 'd' i|n intera|
|00000930| 63 74 69 76 65 20 6d 6f | 64 65 2e 20 54 68 65 20 |ctive mo|de. The |
|00000940| 70 72 6f 67 72 61 6d 20 | 77 69 6c 6c 20 74 68 65 |program |will the|
|00000950| 6e 0a 20 2a 20 20 20 6d | 6f 76 65 20 75 70 20 74 |n. * m|ove up t|
|00000960| 6f 20 74 68 65 20 63 65 | 69 6c 69 6e 67 20 76 61 |o the ce|iling va|
|00000970| 6c 75 65 20 61 6e 64 20 | 22 72 69 64 65 22 20 69 |lue and |"ride" i|
|00000980| 74 20 75 6e 74 69 6c 20 | 61 6c 6c 20 74 68 65 20 |t until |all the |
|00000990| 63 6f 6d 70 61 72 74 6d | 65 6e 74 73 0a 20 2a 20 |compartm|ents. * |
|000009a0| 20 20 61 72 65 20 3c 3d | 31 30 30 25 20 6c 6f 61 | are <=|100% loa|
|000009b0| 64 69 6e 67 2e 0a 20 2a | 20 0a 20 2a 20 2d 20 57 |ding.. *| . * - W|
|000009c0| 68 65 6e 20 64 69 73 70 | 6c 61 79 69 6e 67 20 63 |hen disp|laying c|
|000009d0| 6f 6d 70 61 72 74 6d 65 | 6e 74 20 6c 6f 61 64 69 |ompartme|nt loadi|
|000009e0| 6e 67 2c 20 70 72 65 73 | 73 75 72 65 20 76 61 6c |ng, pres|sure val|
|000009f0| 75 65 73 20 61 72 65 20 | 69 6e 20 28 75 6e 69 74 |ues are |in (unit|
|00000a00| 73 29 20 53 57 41 0a 20 | 2a 20 20 20 69 6e 73 74 |s) SWA. |* inst|
|00000a10| 65 61 64 20 6f 66 20 46 | 53 57 41 2e 20 28 4f 66 |ead of F|SWA. (Of|
|00000a20| 20 63 6f 75 72 73 65 2c | 20 69 66 20 74 68 65 20 | course,| if the |
|00000a30| 75 6e 69 74 73 20 61 72 | 65 20 66 65 65 74 2c 20 |units ar|e feet, |
|00000a40| 74 68 65 6e 20 74 68 65 | 20 76 61 6c 75 65 73 0a |then the| values.|
|00000a50| 20 2a 20 20 20 2a 61 72 | 65 2a 20 46 53 57 41 29 | * *ar|e* FSWA)|
|00000a60| 2e 0a 20 2a 20 0a 20 2a | 20 2d 20 53 74 61 74 73 |.. * . *| - Stats|
|00000a70| 20 6c 69 6e 65 20 64 75 | 72 69 6e 67 20 6f 76 65 | line du|ring ove|
|00000a80| 72 6c 6f 61 64 69 6e 67 | 20 6e 6f 77 20 64 69 73 |rloading| now dis|
|00000a90| 70 6c 61 79 73 20 61 20 | 6d 6f 72 65 20 6d 65 61 |plays a |more mea|
|00000aa0| 6e 69 6e 67 66 75 6c 20 | 6d 65 73 73 61 67 65 0a |ningful |message.|
|00000ab0| 20 2a 20 20 20 72 65 67 | 61 72 64 69 6e 67 20 63 | * reg|arding c|
|00000ac0| 65 69 6c 69 6e 67 20 61 | 6e 64 20 64 65 63 6f 6d |eiling a|nd decom|
|00000ad0| 70 72 65 73 73 69 6f 6e | 20 74 69 6d 65 2e 0a 20 |pression| time.. |
|00000ae0| 2a 20 0a 20 2a 20 52 65 | 76 69 73 69 6f 6e 20 32 |* . * Re|vision 2|
|00000af0| 2e 31 20 20 39 30 2f 31 | 31 2f 32 31 20 20 31 31 |.1 90/1|1/21 11|
|00000b00| 3a 33 33 3a 35 37 20 20 | 31 31 3a 33 33 3a 35 37 |:33:57 |11:33:57|
|00000b10| 20 20 64 61 76 65 20 28 | 44 61 76 65 20 57 61 6c | dave (|Dave Wal|
|00000b20| 6c 65 72 29 0a 20 2a 20 | 43 68 61 6e 67 65 64 20 |ler). * |Changed |
|00000b30| 53 55 4e 20 69 66 64 65 | 66 73 20 74 6f 20 62 65 |SUN ifde|fs to be|
|00000b40| 20 6d 61 63 72 6f 20 53 | 49 4d 50 4c 45 20 69 6e | macro S|IMPLE in|
|00000b50| 73 74 65 61 64 2e 2e 2e | 20 4d 61 6b 65 66 69 6c |stead...| Makefil|
|00000b60| 65 20 68 61 73 20 62 65 | 65 6e 0a 20 2a 20 6d 6f |e has be|en. * mo|
|00000b70| 64 69 66 69 65 64 20 61 | 73 20 77 65 6c 6c 2e 20 |dified a|s well. |
|00000b80| 53 69 6e 63 65 20 53 75 | 6e 20 75 73 65 72 73 20 |Since Su|n users |
|00000b90| 63 61 6e 20 6e 6f 77 20 | 63 6f 6d 70 69 6c 65 20 |can now |compile |
|00000ba0| 77 69 74 68 20 66 75 6c | 6c 20 53 56 49 44 0a 20 |with ful|l SVID. |
|00000bb0| 2a 20 63 75 72 73 65 73 | 20 66 75 6e 63 74 69 6f |* curses| functio|
|00000bc0| 6e 61 6c 69 74 79 2c 20 | 69 74 20 73 65 65 6d 65 |nality, |it seeme|
|00000bd0| 64 20 75 6e 6e 65 63 65 | 73 73 61 72 79 20 74 6f |d unnece|ssary to|
|00000be0| 20 72 65 6d 6f 76 65 20 | 74 68 65 20 72 65 76 65 | remove |the reve|
|00000bf0| 72 73 65 0a 20 2a 20 76 | 69 64 65 6f 20 62 65 6c |rse. * v|ideo bel|
|00000c00| 6c 73 20 61 6e 64 20 77 | 68 69 73 74 6c 65 73 20 |ls and w|histles |
|00000c10| 66 6f 72 20 66 6f 72 20 | 74 68 65 6d 2e 20 48 6f |for for |them. Ho|
|00000c20| 77 65 76 65 72 2c 20 74 | 68 69 73 20 66 75 6e 63 |wever, t|his func|
|00000c30| 74 69 6f 6e 61 6c 69 74 | 79 0a 20 2a 20 69 73 20 |tionalit|y. * is |
|00000c40| 72 65 74 61 69 6e 65 64 | 20 61 73 20 61 20 22 73 |retained| as a "s|
|00000c50| 69 6d 70 6c 65 22 20 76 | 65 72 73 69 6f 6e 20 6f |imple" v|ersion o|
|00000c60| 66 20 74 68 65 20 70 72 | 6f 67 72 61 6d 20 66 6f |f the pr|ogram fo|
|00000c70| 72 20 74 68 6f 73 65 20 | 74 68 61 74 20 64 6f 20 |r those |that do |
|00000c80| 6e 6f 74 0a 20 2a 20 68 | 61 76 65 20 72 65 76 65 |not. * h|ave reve|
|00000c90| 72 73 65 20 76 69 64 65 | 6f 20 61 6e 64 20 75 6e |rse vide|o and un|
|00000ca0| 64 65 72 6c 69 6e 65 20 | 63 61 70 61 62 69 6c 69 |derline |capabili|
|00000cb0| 74 69 65 73 20 6f 6e 20 | 74 68 65 69 72 20 74 65 |ties on |their te|
|00000cc0| 72 6d 69 6e 61 6c 73 2e | 0a 20 2a 20 0a 20 2a 20 |rminals.|. * . * |
|00000cd0| 52 65 76 69 73 69 6f 6e | 20 32 2e 30 20 20 39 30 |Revision| 2.0 90|
|00000ce0| 2f 31 31 2f 32 31 20 20 | 31 31 3a 31 31 3a 33 30 |/11/21 |11:11:30|
|00000cf0| 20 20 31 31 3a 31 31 3a | 33 30 20 20 64 61 76 65 | 11:11:|30 dave|
|00000d00| 20 28 44 61 76 65 20 57 | 61 6c 6c 65 72 29 0a 20 | (Dave W|aller). |
|00000d10| 2a 20 42 75 67 20 66 69 | 78 65 73 3a 0a 20 2a 20 |* Bug fi|xes:. * |
|00000d20| 0a 20 2a 20 2d 20 69 6e | 63 6f 6d 70 61 74 69 62 |. * - in|compatib|
|00000d30| 6c 65 20 74 79 70 65 63 | 61 73 74 69 6e 67 20 69 |le typec|asting i|
|00000d40| 6e 20 73 65 76 65 72 61 | 6c 20 70 6c 61 63 65 73 |n severa|l places|
|00000d50| 20 6d 61 64 65 20 74 68 | 65 20 70 72 6f 67 72 61 | made th|e progra|
|00000d60| 6d 20 66 61 69 6c 0a 20 | 2a 20 20 20 77 69 74 68 |m fail. |* with|
|00000d70| 20 63 65 72 74 61 69 6e | 20 6d 6f 64 65 6c 20 66 | certain| model f|
|00000d80| 69 6c 65 73 2e 0a 20 2a | 20 0a 20 2a 20 2d 20 4c |iles.. *| . * - L|
|00000d90| 6f 67 69 63 61 6c 20 65 | 72 72 6f 72 20 69 6e 20 |ogical e|rror in |
|00000da0| 74 68 65 20 73 61 6d 70 | 6c 65 20 70 65 72 69 6f |the samp|le perio|
|00000db0| 64 20 64 65 74 65 72 6d | 69 6e 61 74 69 6f 6e 20 |d determ|ination |
|00000dc0| 61 6c 67 6f 72 69 74 68 | 6d 2e 0a 20 2a 20 0a 20 |algorith|m.. * . |
|00000dd0| 2a 20 45 6e 68 61 6e 63 | 65 6d 65 6e 74 73 3a 0a |* Enhanc|ements:.|
|00000de0| 20 2a 20 0a 20 2a 20 2d | 20 61 64 64 65 64 20 63 | * . * -| added c|
|00000df0| 61 70 61 62 69 6c 69 74 | 79 20 74 6f 20 64 69 73 |apabilit|y to dis|
|00000e00| 70 6c 61 79 20 64 65 70 | 74 68 20 69 6e 20 61 72 |play dep|th in ar|
|00000e10| 62 69 74 72 61 72 79 20 | 75 6e 69 74 73 2e 20 44 |bitrary |units. D|
|00000e20| 65 66 61 75 6c 74 20 69 | 73 0a 20 2a 20 20 20 66 |efault i|s. * f|
|00000e30| 65 65 74 2e 20 55 6e 69 | 74 73 20 61 72 65 20 73 |eet. Uni|ts are s|
|00000e40| 70 65 63 69 66 69 65 64 | 20 69 6e 20 65 69 74 68 |pecified| in eith|
|00000e50| 65 72 20 61 20 70 72 6f | 66 69 6c 65 20 66 69 6c |er a pro|file fil|
|00000e60| 65 20 6f 6e 20 74 68 65 | 20 66 69 72 73 74 20 6c |e on the| first l|
|00000e70| 69 6e 65 0a 20 2a 20 20 | 20 6f 72 20 77 69 74 68 |ine. * | or with|
|00000e80| 20 74 68 65 20 2d 75 20 | 6f 70 74 69 6f 6e 2e 20 | the -u |option. |
|00000e90| 54 6f 20 75 73 65 20 61 | 20 64 69 66 66 65 72 65 |To use a| differe|
|00000ea0| 6e 74 20 75 6e 69 74 20 | 73 79 73 74 65 6d 2c 20 |nt unit |system, |
|00000eb0| 74 68 65 20 75 73 65 72 | 20 6d 75 73 74 0a 20 2a |the user| must. *|
|00000ec0| 20 20 20 73 75 70 70 6c | 79 20 74 68 65 20 75 6e | suppl|y the un|
|00000ed0| 69 74 20 6e 61 6d 65 20 | 61 6e 64 20 61 20 75 6e |it name |and a un|
|00000ee0| 69 74 20 63 6f 6e 76 65 | 72 73 69 6f 6e 20 66 61 |it conve|rsion fa|
|00000ef0| 63 74 6f 72 20 74 68 61 | 74 20 72 65 70 72 65 73 |ctor tha|t repres|
|00000f00| 65 6e 74 73 0a 20 2a 20 | 20 20 75 6e 69 74 73 2f |ents. * | units/|
|00000f10| 66 74 2e 20 46 6f 72 20 | 65 78 61 6d 70 6c 65 2c |ft. For |example,|
|00000f20| 20 74 6f 20 64 69 73 70 | 6c 61 79 20 69 6e 20 66 | to disp|lay in f|
|00000f30| 61 74 68 6f 6d 73 2c 20 | 74 68 65 20 75 73 65 72 |athoms, |the user|
|00000f40| 20 77 6f 75 6c 64 20 74 | 79 70 65 0a 20 2a 20 0a | would t|ype. * .|
|00000f50| 20 2a 20 20 20 64 69 76 | 65 63 6f 6d 70 20 2d 6d | * div|ecomp -m|
|00000f60| 45 64 67 65 20 2d 75 66 | 61 74 68 6f 6d 73 3a 30 |Edge -uf|athoms:0|
|00000f70| 2e 31 36 36 37 0a 20 2a | 20 0a 20 2a 20 20 20 54 |.1667. *| . * T|
|00000f80| 68 65 72 65 20 61 72 65 | 20 36 20 66 65 65 74 20 |here are| 6 feet |
|00000f90| 69 6e 20 61 20 66 61 74 | 68 6f 6d 2c 20 6f 72 20 |in a fat|hom, or |
|00000fa0| 31 2f 36 3d 30 2e 31 36 | 36 37 20 66 61 74 68 6f |1/6=0.16|67 fatho|
|00000fb0| 6d 73 20 70 65 72 20 66 | 6f 6f 74 2e 20 46 6f 72 |ms per f|oot. For|
|00000fc0| 20 6d 65 74 65 72 73 2c | 0a 20 2a 20 20 20 74 68 | meters,|. * th|
|00000fd0| 65 20 73 70 65 63 69 66 | 69 63 61 74 69 6f 6e 20 |e specif|ication |
|00000fe0| 77 6f 75 6c 64 20 62 65 | 20 2d 75 6d 65 74 65 72 |would be| -umeter|
|00000ff0| 73 3a 30 2e 33 30 34 38 | 2c 20 6f 72 20 2d 75 6d |s:0.3048|, or -um|
|00001000| 3a 30 2e 33 2c 20 65 74 | 63 2e 0a 20 2a 20 0a 20 |:0.3, et|c.. * . |
|00001010| 2a 20 20 20 54 68 65 20 | 75 6e 69 74 20 73 70 65 |* The |unit spe|
|00001020| 63 69 66 69 63 61 74 69 | 6f 6e 20 69 73 20 77 72 |cificati|on is wr|
|00001030| 69 74 74 65 6e 20 69 6e | 74 6f 20 61 6e 20 6f 75 |itten in|to an ou|
|00001040| 74 70 75 74 20 70 72 6f | 66 69 6c 65 2c 20 73 6f |tput pro|file, so|
|00001050| 20 74 68 61 74 20 74 68 | 65 0a 20 2a 20 20 20 63 | that th|e. * c|
|00001060| 6f 72 72 65 63 74 20 75 | 6e 69 74 73 20 61 72 65 |orrect u|nits are|
|00001070| 20 75 73 65 64 20 77 68 | 65 6e 20 75 73 69 6e 67 | used wh|en using|
|00001080| 20 74 68 65 20 70 72 6f | 66 69 6c 65 2e 20 55 6e | the pro|file. Un|
|00001090| 69 74 73 20 73 70 65 63 | 69 66 69 65 64 20 69 6e |its spec|ified in|
|000010a0| 20 61 0a 20 2a 20 20 20 | 70 72 6f 66 69 6c 65 20 | a. * |profile |
|000010b0| 66 69 6c 65 20 6f 76 65 | 72 72 69 64 65 20 63 6f |file ove|rride co|
|000010c0| 6d 6d 61 6e 64 20 6c 69 | 6e 65 20 73 70 65 63 69 |mmand li|ne speci|
|000010d0| 66 69 63 61 74 69 6f 6e | 2e 0a 20 2a 20 0a 20 2a |fication|.. * . *|
|000010e0| 20 2d 20 61 64 64 65 64 | 20 6c 6f 67 67 69 6e 67 | - added| logging|
|000010f0| 20 63 61 70 61 62 69 6c | 69 74 79 2e 20 41 20 6c | capabil|ity. A l|
|00001100| 6f 67 20 66 69 6c 65 20 | 63 61 6e 20 62 65 20 73 |og file |can be s|
|00001110| 70 65 63 69 66 69 65 64 | 20 77 69 74 68 20 74 68 |pecified| with th|
|00001120| 65 20 2d 6c 0a 20 2a 20 | 20 20 6f 70 74 69 6f 6e |e -l. * | option|
|00001130| 2c 20 61 6e 64 20 74 68 | 65 20 70 72 6f 67 72 61 |, and th|e progra|
|00001140| 6d 20 77 69 6c 6c 20 77 | 72 69 74 65 20 74 68 65 |m will w|rite the|
|00001150| 20 61 6c 6c 6f 77 65 64 | 20 6e 69 74 72 6f 67 65 | allowed| nitroge|
|00001160| 6e 20 25 61 67 65 20 66 | 6f 72 0a 20 2a 20 20 20 |n %age f|or. * |
|00001170| 65 61 63 68 20 63 6f 6d | 70 61 72 74 6d 65 6e 74 |each com|partment|
|00001180| 20 61 74 20 65 61 63 68 | 20 73 61 6d 70 6c 65 20 | at each| sample |
|00001190| 70 65 72 69 6f 64 20 69 | 6e 74 6f 20 74 68 65 20 |period i|nto the |
|000011a0| 6c 6f 67 20 66 69 6c 65 | 2e 20 41 20 68 65 61 64 |log file|. A head|
|000011b0| 65 72 0a 20 2a 20 20 20 | 63 6f 6e 74 61 69 6e 69 |er. * |containi|
|000011c0| 6e 67 20 69 6e 66 6f 72 | 6d 61 74 69 6f 6e 20 72 |ng infor|mation r|
|000011d0| 65 67 61 72 64 69 6e 67 | 20 74 68 65 20 6d 6f 64 |egarding| the mod|
|000011e0| 65 6c 2c 20 73 61 6d 70 | 6c 65 20 70 65 72 69 6f |el, samp|le perio|
|000011f0| 64 2c 20 61 6e 64 20 64 | 65 70 74 68 0a 20 2a 20 |d, and d|epth. * |
|00001200| 20 20 75 6e 69 74 20 75 | 73 65 64 20 69 73 20 69 | unit u|sed is i|
|00001210| 6e 69 74 69 61 6c 6c 79 | 20 77 72 69 74 74 65 6e |nitially| written|
|00001220| 20 69 6e 74 6f 20 74 68 | 65 20 66 69 6c 65 20 62 | into th|e file b|
|00001230| 65 66 6f 72 65 20 74 68 | 65 20 73 69 6d 75 6c 61 |efore th|e simula|
|00001240| 74 69 6f 6e 0a 20 2a 20 | 20 20 62 65 67 69 6e 73 |tion. * | begins|
|00001250| 2e 20 54 6f 20 6d 61 6b | 65 20 61 20 6c 6f 67 20 |. To mak|e a log |
|00001260| 6f 66 20 61 20 63 6f 6d | 70 75 74 65 72 20 72 75 |of a com|puter ru|
|00001270| 6e 2c 20 74 79 70 65 0a | 20 2a 20 0a 20 2a 20 20 |n, type.| * . * |
|00001280| 20 64 69 76 65 63 6f 6d | 70 20 2d 6d 42 75 68 6c | divecom|p -mBuhl|
|00001290| 6d 61 6e 20 2d 75 6d 65 | 74 65 72 73 3a 30 2e 33 |man -ume|ters:0.3|
|000012a0| 20 2d 6c 6c 6f 67 2e 62 | 75 68 6c 6d 61 6e 0a 20 | -llog.b|uhlman. |
|000012b0| 2a 20 0a 20 2a 20 0a 20 | 2a 20 52 65 76 69 73 69 |* . * . |* Revisi|
|000012c0| 6f 6e 20 31 2e 39 20 20 | 39 30 2f 31 31 2f 32 30 |on 1.9 |90/11/20|
|000012d0| 20 20 31 31 3a 32 34 3a | 34 38 20 20 31 31 3a 32 | 11:24:|48 11:2|
|000012e0| 34 3a 34 38 20 20 64 61 | 76 65 20 28 44 61 76 65 |4:48 da|ve (Dave|
|000012f0| 20 57 61 6c 6c 65 72 29 | 0a 20 2a 20 42 75 67 20 | Waller)|. * Bug |
|00001300| 66 69 78 65 73 3a 0a 20 | 2a 20 20 20 20 20 20 2d |fixes:. |* -|
|00001310| 20 6c 6f 67 69 63 61 6c | 20 65 72 72 6f 72 73 20 | logical| errors |
|00001320| 69 6e 20 72 65 61 64 69 | 6e 67 20 73 61 6d 70 6c |in readi|ng sampl|
|00001330| 65 20 70 65 72 69 6f 64 | 20 66 72 6f 6d 20 73 70 |e period| from sp|
|00001340| 65 63 69 66 69 65 64 20 | 73 6f 75 72 63 65 73 0a |ecified |sources.|
|00001350| 20 2a 20 20 20 20 20 20 | 2d 20 75 70 64 61 74 65 | * |- update|
|00001360| 5f 64 69 76 65 5f 70 72 | 6f 66 69 6c 65 28 29 20 |_dive_pr|ofile() |
|00001370| 72 6f 75 74 69 6e 65 20 | 68 61 64 61 20 72 6f 75 |routine |hada rou|
|00001380| 6e 64 69 6e 67 20 65 72 | 72 6f 72 20 69 6e 20 74 |nding er|ror in t|
|00001390| 68 65 0a 20 2a 20 20 20 | 20 20 20 20 20 63 6f 64 |he. * | cod|
|000013a0| 65 20 74 68 61 74 20 63 | 6f 6d 70 72 65 73 73 65 |e that c|ompresse|
|000013b0| 73 20 74 68 65 20 64 69 | 73 70 6c 61 79 2e 0a 20 |s the di|splay.. |
|000013c0| 2a 20 0a 20 2a 20 45 6e | 68 61 6e 63 65 6d 65 6e |* . * En|hancemen|
|000013d0| 74 73 3a 0a 20 2a 20 0a | 20 2a 20 20 20 20 20 20 |ts:. * .| * |
|000013e0| 2d 20 6e 65 77 20 70 72 | 6f 66 69 6c 65 20 66 69 |- new pr|ofile fi|
|000013f0| 6c 65 20 66 6f 72 6d 61 | 74 2e 20 50 72 6f 66 69 |le forma|t. Profi|
|00001400| 6c 65 73 20 61 72 65 20 | 6e 6f 77 20 73 74 6f 72 |les are |now stor|
|00001410| 65 64 20 61 73 20 64 65 | 70 74 68 2d 64 75 72 61 |ed as de|pth-dura|
|00001420| 74 69 6f 6e 0a 20 2a 20 | 20 20 20 20 20 20 20 70 |tion. * | p|
|00001430| 61 69 72 73 2c 20 69 6e | 73 74 65 61 64 20 6f 66 |airs, in|stead of|
|00001440| 20 64 69 73 63 72 65 74 | 65 20 73 61 6d 70 6c 65 | discret|e sample|
|00001450| 73 2e 20 54 68 69 73 20 | 65 6c 69 6d 69 6e 61 74 |s. This |eliminat|
|00001460| 65 73 20 74 68 65 20 6e | 65 65 64 20 66 6f 72 0a |es the n|eed for.|
|00001470| 20 2a 20 20 20 20 20 20 | 20 20 73 61 6d 70 6c 65 | * | sample|
|00001480| 20 70 65 72 69 6f 64 20 | 73 70 65 63 69 66 69 63 | period |specific|
|00001490| 61 74 69 6f 6e 20 69 6e | 20 74 68 65 20 70 72 6f |ation in| the pro|
|000014a0| 66 69 6c 65 20 66 69 6c | 65 2c 20 61 6e 64 20 6d |file fil|e, and m|
|000014b0| 61 6b 65 73 20 74 68 65 | 0a 20 2a 20 20 20 20 20 |akes the|. * |
|000014c0| 20 20 20 66 69 6c 65 20 | 6d 6f 72 65 20 63 6f 6d | file |more com|
|000014d0| 70 61 63 74 20 61 6e 64 | 20 65 61 73 69 65 72 20 |pact and| easier |
|000014e0| 74 6f 20 72 65 61 64 2e | 20 49 20 68 61 76 65 20 |to read.| I have |
|000014f0| 77 72 69 74 74 65 6e 20 | 61 20 66 69 6c 74 65 72 |written |a filter|
|00001500| 0a 20 2a 20 20 20 20 20 | 20 20 20 27 63 76 74 70 |. * | 'cvtp|
|00001510| 72 6f 66 27 20 74 6f 20 | 63 6f 6e 76 65 72 74 20 |rof' to |convert |
|00001520| 66 72 6f 6d 20 74 68 65 | 20 6f 6c 64 20 66 6f 72 |from the| old for|
|00001530| 6d 61 74 20 74 6f 20 74 | 68 65 20 6e 65 77 20 66 |mat to t|he new f|
|00001540| 6f 72 6d 61 74 2c 20 73 | 6f 0a 20 2a 20 20 20 20 |ormat, s|o. * |
|00001550| 20 20 20 20 61 6e 79 20 | 65 78 69 73 74 69 6e 67 | any |existing|
|00001560| 20 70 72 6f 66 69 6c 65 | 73 20 74 68 61 74 20 70 | profile|s that p|
|00001570| 65 6f 70 6c 65 20 68 61 | 76 65 20 63 61 6e 20 62 |eople ha|ve can b|
|00001580| 65 20 65 61 73 69 6c 79 | 20 63 6f 6e 76 65 72 74 |e easily| convert|
|00001590| 65 64 2e 0a 20 2a 20 0a | 20 2a 20 20 20 20 20 20 |ed.. * .| * |
|000015a0| 20 20 50 72 6f 66 69 6c | 65 73 20 63 72 65 61 74 | Profil|es creat|
|000015b0| 65 64 20 77 69 74 68 20 | 74 68 65 20 2d 6f 20 6f |ed with |the -o o|
|000015c0| 70 74 69 6f 6e 20 69 6e | 20 69 6e 74 65 72 61 63 |ption in| interac|
|000015d0| 74 69 76 65 20 6d 6f 64 | 65 20 61 72 65 20 77 72 |tive mod|e are wr|
|000015e0| 69 74 74 65 6e 0a 20 2a | 20 20 20 20 20 20 20 20 |itten. *| |
|000015f0| 69 6e 20 74 68 65 20 6e | 65 77 20 66 6f 72 6d 61 |in the n|ew forma|
|00001600| 74 2e 0a 20 2a 20 0a 20 | 2a 20 52 65 76 69 73 69 |t.. * . |* Revisi|
|00001610| 6f 6e 20 31 2e 38 20 20 | 39 30 2f 31 31 2f 31 36 |on 1.8 |90/11/16|
|00001620| 20 20 31 36 3a 33 33 3a | 34 35 20 20 31 36 3a 33 | 16:33:|45 16:3|
|00001630| 33 3a 34 35 20 20 64 61 | 76 65 20 28 44 61 76 65 |3:45 da|ve (Dave|
|00001640| 20 57 61 6c 6c 65 72 29 | 0a 20 2a 20 43 6c 65 61 | Waller)|. * Clea|
|00001650| 6e 65 64 20 75 70 20 72 | 6f 75 6e 64 69 6e 67 20 |ned up r|ounding |
|00001660| 61 6c 67 6f 72 69 74 68 | 6d 20 66 6f 72 20 64 65 |algorith|m for de|
|00001670| 70 74 68 20 70 72 6f 66 | 69 6c 65 3b 20 61 64 64 |pth prof|ile; add|
|00001680| 65 64 20 72 6f 75 6e 64 | 20 75 70 20 74 6f 0a 20 |ed round| up to. |
|00001690| 2a 20 63 6f 6d 70 61 72 | 74 6d 65 6e 74 20 62 61 |* compar|tment ba|
|000016a0| 72 20 67 72 61 70 68 20 | 64 69 73 70 6c 61 79 2c |r graph |display,|
|000016b0| 20 73 6f 20 74 68 61 74 | 20 69 74 20 72 65 61 64 | so that| it read|
|000016c0| 73 20 31 30 30 25 20 70 | 72 6f 70 65 72 6c 79 3b |s 100% p|roperly;|
|000016d0| 0a 20 2a 20 46 69 78 65 | 64 20 73 63 61 6c 65 20 |. * Fixe|d scale |
|000016e0| 67 72 61 70 68 69 63 20 | 61 74 20 74 6f 70 20 6f |graphic |at top o|
|000016f0| 66 20 63 6f 6d 70 61 72 | 74 6d 65 6e 74 20 62 61 |f compar|tment ba|
|00001700| 72 20 67 72 61 70 68 20 | 28 69 74 20 77 61 73 20 |r graph |(it was |
|00001710| 6f 66 66 0a 20 2a 20 62 | 79 20 6f 6e 65 20 63 68 |off. * b|y one ch|
|00001720| 61 72 61 63 74 65 72 20 | 70 6f 73 69 74 69 6f 6e |aracter |position|
|00001730| 20 74 6f 20 74 68 65 20 | 72 69 67 68 74 2c 20 63 | to the |right, c|
|00001740| 6f 6e 74 72 69 62 75 74 | 69 6e 67 20 74 6f 74 68 |ontribut|ing toth|
|00001750| 65 20 62 61 72 73 20 6e | 6f 74 0a 20 2a 20 62 65 |e bars n|ot. * be|
|00001760| 69 6e 67 20 61 74 20 31 | 30 30 25 20 76 69 73 75 |ing at 1|00% visu|
|00001770| 61 6c 6c 79 20 77 68 65 | 6e 20 74 68 65 79 20 61 |ally whe|n they a|
|00001780| 63 74 75 61 6c 6c 79 20 | 77 65 72 65 29 2e 0a 20 |ctually |were).. |
|00001790| 2a 20 0a 20 2a 20 52 65 | 76 69 73 69 6f 6e 20 31 |* . * Re|vision 1|
|000017a0| 2e 37 20 20 39 30 2f 31 | 31 2f 31 36 20 20 31 30 |.7 90/1|1/16 10|
|000017b0| 3a 33 34 3a 32 36 20 20 | 31 30 3a 33 34 3a 32 36 |:34:26 |10:34:26|
|000017c0| 20 20 64 61 76 65 20 28 | 44 61 76 65 20 57 61 6c | dave (|Dave Wal|
|000017d0| 6c 65 72 29 0a 20 2a 20 | 41 64 64 65 64 20 61 62 |ler). * |Added ab|
|000017e0| 69 6c 69 74 79 20 74 6f | 20 73 70 65 63 69 66 79 |ility to| specify|
|000017f0| 20 64 69 66 66 65 72 65 | 6e 74 20 73 61 6d 70 6c | differe|nt sampl|
|00001800| 65 20 70 65 72 69 6f 64 | 73 2e 20 53 61 6d 70 6c |e period|s. Sampl|
|00001810| 65 20 70 65 72 69 6f 64 | 20 28 27 73 27 20 69 6e |e period| ('s' in|
|00001820| 0a 20 2a 20 74 68 65 20 | 73 6f 75 72 63 65 29 20 |. * the |source) |
|00001830| 69 73 20 73 70 65 63 69 | 66 69 65 64 20 69 6e 20 |is speci|fied in |
|00001840| 74 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 20 6d 61 |the foll|owing ma|
|00001850| 6e 6e 65 72 20 28 64 65 | 63 72 65 61 73 69 6e 67 |nner (de|creasing|
|00001860| 20 70 72 65 63 65 64 65 | 6e 63 65 29 3a 0a 20 2a | precede|nce):. *|
|00001870| 20 0a 20 2a 20 20 20 20 | 20 20 20 20 20 20 20 20 | . * | |
|00001880| 31 29 20 76 69 61 20 63 | 6f 6d 6d 61 6e 64 20 6c |1) via c|ommand l|
|00001890| 69 6e 65 20 6f 70 74 69 | 6f 6e 0a 20 2a 20 20 20 |ine opti|on. * |
|000018a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 45 78 61 6d | | Exam|
|000018b0| 70 6c 65 3a 20 64 69 76 | 65 63 6f 6d 70 20 2d 6d |ple: div|ecomp -m|
|000018c0| 45 64 67 65 20 2d 6f 6d | 79 70 72 6f 66 20 2d 73 |Edge -om|yprof -s|
|000018d0| 32 2e 35 0a 20 2a 20 0a | 20 2a 20 20 20 20 20 20 |2.5. * .| * |
|000018e0| 20 20 20 20 20 20 20 20 | 20 55 6e 69 74 73 20 61 | | Units a|
|000018f0| 72 65 20 69 6e 20 6d 69 | 6e 75 74 65 73 0a 20 2a |re in mi|nutes. *|
|00001900| 20 0a 20 2a 20 20 20 20 | 20 20 20 20 20 20 20 20 | . * | |
|00001910| 32 29 20 46 72 6f 6d 20 | 77 69 74 68 69 6e 20 61 |2) From |within a|
|00001920| 20 70 72 6f 66 69 6c 65 | 20 66 69 6c 65 2e 20 54 | profile| file. T|
|00001930| 68 65 20 66 69 72 73 74 | 20 6c 69 6e 65 20 63 61 |he first| line ca|
|00001940| 6e 20 6f 70 74 69 6f 6e | 61 6c 6c 79 0a 20 2a 20 |n option|ally. * |
|00001950| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 73 70 | | sp|
|00001960| 65 63 69 66 69 79 20 61 | 20 73 61 6d 70 6c 65 20 |ecifiy a| sample |
|00001970| 72 61 74 65 2c 20 69 66 | 20 69 74 20 68 61 73 20 |rate, if| it has |
|00001980| 74 68 65 20 66 6f 72 6d | 20 22 73 3a 3c 72 61 74 |the form| "s:<rat|
|00001990| 65 3e 22 2e 0a 20 2a 20 | 20 20 20 20 20 20 20 20 |e>".. * | |
|000019a0| 20 20 20 20 20 20 45 78 | 61 6d 70 6c 65 3a 20 41 | Ex|ample: A|
|000019b0| 20 70 72 6f 66 69 6c 65 | 20 74 68 61 74 20 63 6f | profile| that co|
|000019c0| 6e 74 61 69 6e 73 20 32 | 20 6d 69 6e 75 74 65 20 |ntains 2| minute |
|000019d0| 73 61 6d 70 6c 65 73 20 | 77 6f 75 6c 64 0a 20 2a |samples |would. *|
|000019e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 6c | | l|
|000019f0| 6f 6f 6b 20 6c 69 6b 65 | 0a 20 2a 20 0a 20 2a 20 |ook like|. * . * |
|00001a00| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 73 3a | | s:|
|00001a10| 32 2e 30 0a 20 2a 20 20 | 20 20 20 20 20 20 20 20 |2.0. * | |
|00001a20| 20 20 20 20 20 36 30 0a | 20 2a 20 20 20 20 20 20 | 60.| * |
|00001a30| 20 20 20 20 20 20 20 20 | 20 36 30 0a 20 2a 20 20 | | 60. * |
|00001a40| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 36 30 0a | | 60.|
|00001a50| 20 2a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | * | |
|00001a60| 20 36 30 0a 20 2a 20 20 | 20 20 20 20 20 20 20 20 | 60. * | |
|00001a70| 20 20 20 20 20 2e 0a 20 | 2a 20 20 20 20 20 20 20 | .. |* |
|00001a80| 20 20 20 20 20 20 20 20 | 2e 0a 20 2a 20 20 20 20 | |.. * |
|00001a90| 20 20 20 20 20 20 20 20 | 20 20 20 2e 0a 20 2a 20 | | .. * |
|00001aa0| 0a 20 2a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. * | |
|00001ab0| 20 20 28 74 68 65 20 65 | 6c 6c 69 70 73 65 73 20 | (the e|llipses |
|00001ac0| 5b 2e 2e 2e 5d 20 61 72 | 65 20 6e 6f 74 20 70 61 |[...] ar|e not pa|
|00001ad0| 72 74 20 6f 66 20 74 68 | 65 20 66 69 6c 65 29 2e |rt of th|e file).|
|00001ae0| 20 27 64 69 76 65 63 6f | 6d 70 27 0a 20 2a 20 20 | 'diveco|mp'. * |
|00001af0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 6e 6f 77 | | now|
|00001b00| 20 61 75 74 6f 6d 61 74 | 69 63 61 6c 6c 79 20 77 | automat|ically w|
|00001b10| 72 69 74 65 73 20 74 68 | 65 20 73 61 6d 70 6c 65 |rites th|e sample|
|00001b20| 20 70 65 72 69 6f 64 20 | 69 6e 74 6f 20 65 76 65 | period |into eve|
|00001b30| 72 79 20 70 72 6f 66 69 | 6c 65 0a 20 2a 20 20 20 |ry profi|le. * |
|00001b40| 20 20 20 20 20 20 20 20 | 20 20 20 20 69 74 20 67 | | it g|
|00001b50| 65 6e 65 72 61 74 65 73 | 20 76 69 61 20 74 68 65 |enerates| via the|
|00001b60| 20 2d 6f 20 6f 70 74 69 | 6f 6e 2e 0a 20 2a 20 0a | -o opti|on.. * .|
|00001b70| 20 2a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 33 | * | 3|
|00001b80| 29 20 46 72 6f 6d 20 61 | 20 6d 6f 64 65 6c 20 66 |) From a| model f|
|00001b90| 69 6c 65 2e 20 46 6f 72 | 6d 61 74 20 69 73 20 74 |ile. For|mat is t|
|00001ba0| 68 65 20 73 61 6d 65 20 | 61 73 20 61 20 70 72 6f |he same |as a pro|
|00001bb0| 66 69 6c 65 20 66 69 6c | 65 2e 0a 20 2a 20 20 20 |file fil|e.. * |
|00001bc0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 54 68 65 | | The|
|00001bd0| 20 6d 6f 73 74 20 62 61 | 73 69 63 20 63 6f 6d 6d | most ba|sic comm|
|00001be0| 61 6e 64 2c 20 22 64 69 | 76 65 63 6f 6d 70 20 2d |and, "di|vecomp -|
|00001bf0| 6d 45 64 67 65 22 2c 20 | 66 6f 72 20 69 6e 73 74 |mEdge", |for inst|
|00001c00| 61 6e 63 65 2c 0a 20 2a | 20 20 20 20 20 20 20 20 |ance,. *| |
|00001c10| 20 20 20 20 20 20 20 20 | 77 69 6c 6c 20 63 61 75 | |will cau|
|00001c20| 73 65 20 74 68 65 20 63 | 6f 6d 70 75 74 65 72 20 |se the c|omputer |
|00001c30| 74 6f 20 75 73 65 20 74 | 68 65 20 70 72 6f 70 65 |to use t|he prope|
|00001c40| 72 20 73 61 6d 70 6c 69 | 6e 67 20 72 61 74 65 0a |r sampli|ng rate.|
|00001c50| 20 2a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | * | |
|00001c60| 20 20 66 6f 72 20 74 68 | 65 20 45 64 67 65 2e 20 | for th|e Edge. |
|00001c70| 41 6c 73 6f 2c 20 61 6e | 79 20 70 72 6f 66 69 6c |Also, an|y profil|
|00001c80| 65 73 20 67 65 6e 65 72 | 61 74 65 73 20 77 69 74 |es gener|ates wit|
|00001c90| 68 20 74 68 69 73 20 6d | 6f 64 65 6c 0a 20 2a 20 |h this m|odel. * |
|00001ca0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 77 | | w|
|00001cb0| 69 6c 6c 20 68 61 76 65 | 20 74 68 65 20 63 6f 72 |ill have| the cor|
|00001cc0| 72 65 63 74 20 73 61 6d | 70 6c 69 6e 67 20 76 61 |rect sam|pling va|
|00001cd0| 6c 75 65 20 77 68 65 6e | 20 75 73 65 64 20 69 6e |lue when| used in|
|00001ce0| 20 64 69 66 66 65 72 65 | 6e 74 0a 20 2a 20 20 20 | differe|nt. * |
|00001cf0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 6d 6f 64 | | mod|
|00001d00| 65 6c 73 2e 0a 20 2a 20 | 0a 20 2a 20 20 20 20 20 |els.. * |. * |
|00001d10| 20 20 20 20 20 20 20 20 | 34 29 20 44 65 66 61 75 | |4) Defau|
|00001d20| 6c 74 3a 20 31 20 6d 69 | 6e 75 74 65 2e 0a 20 2a |lt: 1 mi|nute.. *|
|00001d30| 20 0a 20 2a 20 52 65 76 | 69 73 69 6f 6e 20 31 2e | . * Rev|ision 1.|
|00001d40| 36 20 20 39 30 2f 31 31 | 2f 31 34 20 20 31 37 3a |6 90/11|/14 17:|
|00001d50| 33 36 3a 35 32 20 20 31 | 37 3a 33 36 3a 35 32 20 |36:52 1|7:36:52 |
|00001d60| 20 64 61 76 65 20 28 44 | 61 76 65 20 57 61 6c 6c | dave (D|ave Wall|
|00001d70| 65 72 29 0a 20 2a 20 41 | 64 64 65 64 20 63 6f 6d |er). * A|dded com|
|00001d80| 70 69 6c 65 20 74 69 6d | 65 20 63 68 65 63 6b 73 |pile tim|e checks|
|00001d90| 20 74 6f 20 6d 6f 64 69 | 66 79 20 63 75 72 73 65 | to modi|fy curse|
|00001da0| 73 20 62 65 68 61 76 69 | 6f 72 20 74 6f 20 61 63 |s behavi|or to ac|
|00001db0| 63 6f 6d 6f 64 61 74 65 | 0a 20 2a 20 69 6e 63 6f |comodate|. * inco|
|00001dc0| 6d 70 6c 65 74 65 20 63 | 75 72 73 65 73 20 6c 69 |mplete c|urses li|
|00001dd0| 62 72 61 72 79 20 6f 6e | 20 53 75 6e 2f 4f 53 2e |brary on| Sun/OS.|
|00001de0| 20 43 6f 6e 74 72 6f 6c | 6c 69 6e 67 20 74 69 73 | Control|ling tis|
|00001df0| 73 75 65 20 69 73 20 68 | 69 67 68 6c 69 67 68 74 |sue is h|ighlight|
|00001e00| 65 64 0a 20 2a 20 77 69 | 74 68 20 61 20 70 72 65 |ed. * wi|th a pre|
|00001e10| 63 65 64 69 6e 67 20 27 | 2a 27 20 69 6e 73 74 65 |ceding '|*' inste|
|00001e20| 61 64 20 6f 66 20 72 65 | 76 65 72 73 65 20 76 69 |ad of re|verse vi|
|00001e30| 64 65 6f 2c 20 64 65 69 | 6c 69 6e 67 20 6d 65 73 |deo, dei|ling mes|
|00001e40| 73 61 67 65 20 64 6f 65 | 73 20 6e 6f 74 0a 20 2a |sage doe|s not. *|
|00001e50| 20 61 70 70 65 61 72 20 | 69 6e 20 72 65 76 65 72 | appear |in rever|
|00001e60| 73 65 20 76 69 64 65 6f | 20 77 68 65 6e 20 74 69 |se video| when ti|
|00001e70| 73 73 75 65 20 4d 20 76 | 61 6c 75 65 73 20 61 72 |ssue M v|alues ar|
|00001e80| 65 20 65 78 63 65 65 64 | 65 64 2c 20 61 6e 64 20 |e exceed|ed, and |
|00001e90| 74 69 73 73 75 65 0a 20 | 2a 20 62 61 72 20 67 72 |tissue. |* bar gr|
|00001ea0| 61 70 68 20 69 73 20 63 | 6f 6d 70 6f 73 65 64 20 |aph is c|omposed |
|00001eb0| 6f 66 20 27 23 27 20 63 | 68 61 72 61 63 74 65 72 |of '#' c|haracter|
|00001ec0| 73 20 69 6e 73 74 65 61 | 64 20 6f 66 20 72 65 76 |s instea|d of rev|
|00001ed0| 65 72 73 65 20 76 69 64 | 65 6f 0a 20 2a 20 73 70 |erse vid|eo. * sp|
|00001ee0| 61 63 65 73 2e 20 4e 6f | 74 20 71 75 69 74 65 20 |aces. No|t quite |
|00001ef0| 61 73 20 70 72 65 74 74 | 79 20 61 73 20 74 68 65 |as prett|y as the|
|00001f00| 20 66 75 6c 6c 20 63 75 | 72 73 65 73 20 76 65 72 | full cu|rses ver|
|00001f10| 73 69 6f 6e 2c 20 62 75 | 74 20 74 68 61 74 27 73 |sion, bu|t that's|
|00001f20| 20 77 68 61 74 0a 20 2a | 20 79 6f 75 20 67 65 74 | what. *| you get|
|00001f30| 20 69 66 20 79 6f 75 27 | 72 65 20 72 75 6e 6e 69 | if you'|re runni|
|00001f40| 6e 67 20 6f 6e 20 61 20 | 53 75 6e 2e 0a 20 2a 20 |ng on a |Sun.. * |
|00001f50| 0a 20 2a 20 4f 72 69 67 | 69 6e 61 6c 20 67 72 61 |. * Orig|inal gra|
|00001f60| 70 68 69 63 61 6c 20 66 | 75 6e 63 74 69 6f 6e 61 |phical f|unctiona|
|00001f70| 6c 69 74 79 20 69 73 20 | 6d 61 69 6e 74 61 69 6e |lity is |maintain|
|00001f80| 65 64 20 66 6f 72 20 6f | 74 68 65 72 20 70 6c 61 |ed for o|ther pla|
|00001f90| 74 66 6f 72 6d 73 2e 0a | 20 2a 20 0a 20 2a 20 52 |tforms..| * . * R|
|00001fa0| 65 76 69 73 69 6f 6e 20 | 31 2e 35 20 20 39 30 2f |evision |1.5 90/|
|00001fb0| 31 31 2f 31 34 20 20 31 | 33 3a 35 38 3a 34 33 20 |11/14 1|3:58:43 |
|00001fc0| 20 31 33 3a 35 38 3a 34 | 33 20 20 64 61 76 65 20 | 13:58:4|3 dave |
|00001fd0| 28 44 61 76 65 20 57 61 | 6c 6c 65 72 29 0a 20 2a |(Dave Wa|ller). *|
|00001fe0| 20 41 64 64 65 64 20 74 | 68 65 20 66 6f 6c 6c 6f | Added t|he follo|
|00001ff0| 77 69 6e 67 20 66 65 61 | 74 75 72 65 73 3a 0a 20 |wing fea|tures:. |
|00002000| 2a 20 0a 20 2a 20 2d 20 | 44 65 63 6f 6d 70 72 65 |* . * - |Decompre|
|00002010| 73 73 69 6f 6e 20 63 61 | 6c 63 75 6c 61 74 69 6f |ssion ca|lculatio|
|00002020| 6e 20 61 6e 64 20 69 6e | 64 69 63 61 74 69 6f 6e |n and in|dication|
|00002030| 20 76 69 61 20 6e 64 6c | 28 29 0a 20 2a 20 2d 20 | via ndl|(). * - |
|00002040| 69 6e 67 61 73 2f 6f 75 | 74 67 61 73 20 69 6e 64 |ingas/ou|tgas ind|
|00002050| 69 63 61 74 6f 72 20 6e | 78 74 20 74 6f 20 65 61 |icator n|xt to ea|
|00002060| 63 68 20 63 6f 6d 70 61 | 72 74 6d 65 6e 74 20 6e |ch compa|rtment n|
|00002070| 75 6d 62 65 72 0a 20 2a | 20 2d 20 66 75 6c 6c 20 |umber. *| - full |
|00002080| 22 62 6f 74 74 6f 6d 20 | 74 69 6d 65 72 22 20 66 |"bottom |timer" f|
|00002090| 75 6e 63 74 69 6f 6e 73 | 20 28 69 2e 65 2e 20 64 |unctions| (i.e. d|
|000020a0| 69 76 65 20 23 2c 20 62 | 6f 74 74 6f 6d 20 74 69 |ive #, b|ottom ti|
|000020b0| 6d 65 2c 20 73 75 72 66 | 61 63 65 20 69 6e 74 29 |me, surf|ace int)|
|000020c0| 0a 20 2a 20 0a 20 2a 20 | 46 69 78 65 64 20 74 68 |. * . * |Fixed th|
|000020d0| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 62 75 67 73 |e follow|ing bugs|
|000020e0| 3a 0a 20 2a 20 0a 20 2a | 20 2d 20 77 6f 75 6c 64 |:. * . *| - would|
|000020f0| 20 72 75 6e 20 66 6f 72 | 65 76 65 72 20 69 66 20 | run for|ever if |
|00002100| 64 75 72 61 74 69 6f 6e | 20 6f 66 20 30 20 65 6e |duration| of 0 en|
|00002110| 74 65 72 65 64 20 69 6e | 20 69 6e 74 65 72 61 63 |tered in| interac|
|00002120| 74 69 76 65 20 6d 6f 64 | 65 2e 0a 20 2a 20 20 20 |tive mod|e.. * |
|00002130| 50 72 6f 67 72 61 6d 20 | 6e 6f 77 20 72 65 6a 65 |Program |now reje|
|00002140| 63 74 73 20 73 75 63 68 | 20 61 6e 20 65 6e 74 72 |cts such| an entr|
|00002150| 79 2c 20 61 6e 64 20 61 | 73 6b 73 20 66 6f 72 20 |y, and a|sks for |
|00002160| 64 65 70 74 68 20 61 6e | 64 20 64 75 72 61 74 69 |depth an|d durati|
|00002170| 6f 6e 0a 20 2a 20 20 20 | 61 67 61 69 6e 2e 0a 20 |on. * |again.. |
|00002180| 2a 20 0a 20 2a 20 2d 20 | 43 6f 6e 74 72 6f 6c 6c |* . * - |Controll|
|00002190| 69 6e 67 20 74 69 73 73 | 75 65 20 69 6e 64 69 63 |ing tiss|ue indic|
|000021a0| 61 74 69 6f 6e 20 6c 61 | 67 67 65 64 20 6f 6e 65 |ation la|gged one|
|000021b0| 20 73 61 6d 70 6c 65 20 | 62 65 68 69 6e 64 20 61 | sample |behind a|
|000021c0| 63 74 75 61 6c 20 76 61 | 6c 75 65 3b 0a 20 2a 20 |ctual va|lue;. * |
|000021d0| 20 20 46 69 78 65 64 2e | 0a 20 2a 20 0a 20 2a 20 | Fixed.|. * . * |
|000021e0| 2d 20 44 69 76 65 20 70 | 72 6f 66 69 6c 65 20 67 |- Dive p|rofile g|
|000021f0| 72 61 70 68 20 6e 6f 77 | 20 72 6f 75 6e 64 73 20 |raph now| rounds |
|00002200| 75 70 20 74 6f 20 74 68 | 65 20 6e 65 61 72 65 73 |up to th|e neares|
|00002210| 74 20 64 65 70 74 68 20 | 69 6e 63 72 65 6d 65 6e |t depth |incremen|
|00002220| 74 2e 0a 20 2a 20 0a 20 | 2a 20 52 65 76 69 73 69 |t.. * . |* Revisi|
|00002230| 6f 6e 20 31 2e 34 20 20 | 39 30 2f 31 31 2f 31 33 |on 1.4 |90/11/13|
|00002240| 20 20 31 36 3a 33 38 3a | 34 39 20 20 31 36 3a 33 | 16:38:|49 16:3|
|00002250| 38 3a 34 39 20 20 64 61 | 76 65 20 28 44 61 76 65 |8:49 da|ve (Dave|
|00002260| 20 57 61 6c 6c 65 72 29 | 0a 20 2a 20 46 69 78 65 | Waller)|. * Fixe|
|00002270| 64 20 75 70 20 74 68 65 | 20 63 6f 6d 6d 65 6e 74 |d up the| comment|
|00002280| 73 2e 0a 20 2a 20 0a 20 | 2a 20 52 65 76 69 73 69 |s.. * . |* Revisi|
|00002290| 6f 6e 20 31 2e 33 20 20 | 39 30 2f 31 31 2f 31 33 |on 1.3 |90/11/13|
|000022a0| 20 20 31 35 3a 31 31 3a | 34 38 20 20 31 35 3a 31 | 15:11:|48 15:1|
|000022b0| 31 3a 34 38 20 20 64 61 | 76 65 20 28 44 61 76 65 |1:48 da|ve (Dave|
|000022c0| 20 57 61 6c 6c 65 72 29 | 0a 20 2a 20 49 6e 69 74 | Waller)|. * Init|
|000022d0| 69 61 6c 20 63 68 65 63 | 6b 69 6e 3b 20 73 74 61 |ial chec|kin; sta|
|000022e0| 72 74 65 64 20 75 73 69 | 6e 67 20 52 43 53 20 74 |rted usi|ng RCS t|
|000022f0| 6f 20 6b 65 65 70 20 74 | 72 61 63 6b 20 6f 66 20 |o keep t|rack of |
|00002300| 72 65 76 69 73 69 6f 6e | 73 2e 20 54 68 69 73 0a |revision|s. This.|
|00002310| 20 2a 20 72 65 76 69 73 | 69 6f 6e 20 61 6c 73 6f | * revis|ion also|
|00002320| 20 66 69 78 65 73 20 61 | 20 62 75 67 20 77 69 74 | fixes a| bug wit|
|00002330| 68 20 74 68 65 20 63 6f | 64 65 20 74 68 61 74 20 |h the co|de that |
|00002340| 72 65 61 64 73 20 69 6e | 20 68 61 6c 66 20 74 69 |reads in| half ti|
|00002350| 6d 65 73 20 66 72 6f 6d | 20 6d 6f 64 65 6c 0a 20 |mes from| model. |
|00002360| 2a 20 66 69 6c 65 73 20 | 2d 2d 20 74 68 65 79 20 |* files |-- they |
|00002370| 77 65 72 65 20 73 74 6f | 72 65 64 20 61 73 20 74 |were sto|red as t|
|00002380| 79 70 65 20 27 69 6e 74 | 27 2c 20 77 68 69 63 68 |ype 'int|', which|
|00002390| 20 63 72 65 61 74 65 64 | 20 70 72 6f 62 6c 65 6d | created| problem|
|000023a0| 73 20 66 6f 72 0a 20 2a | 20 66 73 63 61 6e 66 20 |s for. *| fscanf |
|000023b0| 69 66 20 74 68 65 20 68 | 61 6c 66 20 74 69 6d 65 |if the h|alf time|
|000023c0| 73 20 77 65 72 65 20 66 | 6c 6f 61 74 73 2e 20 43 |s were f|loats. C|
|000023d0| 68 61 6e 67 65 64 20 74 | 68 65 20 61 72 72 61 79 |hanged t|he array|
|000023e0| 20 27 68 61 6c 66 5b 5d | 27 20 74 6f 0a 20 2a 20 | 'half[]|' to. * |
|000023f0| 74 79 70 65 20 27 66 6c | 6f 61 74 27 2e 0a 20 2a |type 'fl|oat'.. *|
|00002400| 20 20 2a 2f 0a 0a 2f 2a | 20 64 69 76 65 20 63 6f | */../*| dive co|
|00002410| 6d 70 75 74 65 72 20 73 | 69 6d 75 6c 61 74 6f 72 |mputer s|imulator|
|00002420| 2c 20 62 79 20 44 61 76 | 65 20 57 61 6c 6c 65 72 |, by Dav|e Waller|
|00002430| 20 28 64 61 76 65 77 40 | 68 70 64 73 74 6d 61 2e | (davew@|hpdstma.|
|00002440| 68 70 2e 63 6f 6d 29 0a | 0a 3d 3d 3d 3d 3d 3d 3d |hp.com).|.=======|
|00002450| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00002460| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00002470| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00002480| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00002490| 3d 0a 41 63 6b 6e 6f 77 | 6c 65 67 6d 65 6e 74 73 |=.Acknow|legments|
|000024a0| 3a 0a 0a 4d 75 63 68 20 | 74 68 61 6e 6b 73 20 74 |:..Much |thanks t|
|000024b0| 6f 20 45 72 69 63 20 57 | 69 6c 6c 69 61 6d 73 20 |o Eric W|illiams |
|000024c0| 28 73 61 72 67 6f 6e 40 | 70 6f 72 74 69 61 2e 73 |(sargon@|portia.s|
|000024d0| 74 61 6e 66 6f 72 64 2e | 65 64 75 29 20 66 6f 72 |tanford.|edu) for|
|000024e0| 20 68 69 73 0a 6f 75 74 | 73 74 61 6e 64 69 6e 67 | his.out|standing|
|000024f0| 20 63 6f 6e 74 72 69 62 | 75 74 69 6f 6e 20 74 6f | contrib|ution to|
|00002500| 20 74 68 65 20 6e 64 6c | 28 29 20 72 6f 75 74 69 | the ndl|() routi|
|00002510| 6e 65 20 74 6f 20 69 6e | 63 6f 72 70 6f 72 61 74 |ne to in|corporat|
|00002520| 65 20 63 65 69 6c 69 6e | 67 73 0a 61 6e 64 20 64 |e ceilin|gs.and d|
|00002530| 65 63 6f 6d 70 72 65 73 | 73 69 6f 6e 20 74 69 6d |ecompres|sion tim|
|00002540| 65 73 2e 20 20 48 69 73 | 20 73 75 70 70 6f 72 74 |es. His| support|
|00002550| 20 61 6e 64 20 74 69 6d | 65 6c 79 20 72 65 76 69 | and tim|ely revi|
|00002560| 65 77 73 2f 62 75 67 20 | 72 65 70 6f 72 74 73 0a |ews/bug |reports.|
|00002570| 68 61 76 65 20 62 65 65 | 6e 20 65 78 74 72 65 6d |have bee|n extrem|
|00002580| 65 6c 79 20 68 65 6c 70 | 66 75 6c 2e 20 20 54 68 |ely help|ful. Th|
|00002590| 61 6e 6b 73 2c 20 45 72 | 69 63 21 0a 3d 3d 3d 3d |anks, Er|ic!.====|
|000025a0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000025b0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000025c0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000025d0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000025e0| 3d 3d 3d 3d 0a 0a 54 68 | 69 73 20 70 72 6f 67 72 |====..Th|is progr|
|000025f0| 61 6d 20 73 69 6d 75 6c | 61 74 65 73 20 61 20 6d |am simul|ates a m|
|00002600| 75 6c 74 69 2d 63 6f 6d | 70 61 72 74 6d 65 6e 74 |ulti-com|partment|
|00002610| 20 6d 6f 64 65 6c 20 64 | 69 76 65 20 63 6f 6d 70 | model d|ive comp|
|00002620| 75 74 65 72 2c 20 62 61 | 73 65 64 0a 75 70 6f 6e |uter, ba|sed.upon|
|00002630| 20 6d 6f 64 69 66 69 65 | 64 20 48 61 6c 64 61 6e | modifie|d Haldan|
|00002640| 65 61 6e 20 74 69 73 73 | 75 65 20 61 62 73 6f 70 |ean tiss|ue absop|
|00002650| 74 69 6f 6e 20 6d 6f 64 | 65 6c 73 2e 20 20 54 68 |tion mod|els. Th|
|00002660| 65 20 6e 75 6d 62 65 72 | 20 6f 66 0a 63 6f 6d 70 |e number| of.comp|
|00002670| 61 72 74 6d 65 6e 74 73 | 20 61 6e 64 20 74 68 65 |artments| and the|
|00002680| 69 72 20 63 6f 72 72 65 | 73 70 6f 6e 64 69 6e 67 |ir corre|sponding|
|00002690| 20 63 6f 6e 73 74 61 6e | 74 73 20 61 72 65 20 6e | constan|ts are n|
|000026a0| 6f 74 20 62 75 69 6c 74 | 20 69 6e 74 6f 20 74 68 |ot built| into th|
|000026b0| 65 0a 70 72 6f 67 72 61 | 6d 2c 20 62 75 74 20 6d |e.progra|m, but m|
|000026c0| 75 73 74 20 62 65 20 6c | 6f 61 64 65 64 20 61 74 |ust be l|oaded at|
|000026d0| 20 72 75 6e 74 69 6d 65 | 2c 20 61 6c 6c 6f 77 69 | runtime|, allowi|
|000026e0| 6e 67 20 74 68 65 20 70 | 72 6f 67 72 61 6d 20 74 |ng the p|rogram t|
|000026f0| 6f 0a 73 69 6d 75 6c 61 | 74 65 20 6d 6f 73 74 20 |o.simula|te most |
|00002700| 64 69 76 65 20 63 6f 6d | 70 75 74 65 72 73 20 6f |dive com|puters o|
|00002710| 6e 20 74 68 65 20 6d 61 | 72 6b 65 74 20 74 6f 64 |n the ma|rket tod|
|00002720| 61 79 2e 0a 0a 53 75 62 | 73 65 71 75 65 6e 74 20 |ay...Sub|sequent |
|00002730| 64 65 72 69 76 61 74 69 | 6f 6e 20 6f 66 20 65 71 |derivati|on of eq|
|00002740| 75 61 74 69 6f 6e 73 20 | 61 73 20 66 6f 75 6e 64 |uations |as found|
|00002750| 20 69 6e 20 74 68 65 20 | 63 6f 6d 6d 65 6e 74 73 | in the |comments|
|00002760| 20 62 65 6c 6f 77 20 77 | 65 72 65 0a 64 6f 6e 65 | below w|ere.done|
|00002770| 20 62 79 20 6d 79 73 65 | 6c 66 2c 20 61 73 20 49 | by myse|lf, as I|
|00002780| 20 73 69 74 20 68 65 72 | 65 20 61 74 20 77 6f 72 | sit her|e at wor|
|00002790| 6b 2c 20 75 73 69 6e 67 | 20 6f 6e 6c 79 20 6d 79 |k, using| only my|
|000027a0| 20 6d 65 6d 6f 72 79 3b | 0a 74 68 65 72 65 66 6f | memory;|.therefo|
|000027b0| 72 65 2c 20 74 68 69 73 | 20 69 6e 69 74 69 61 6c |re, this| initial|
|000027c0| 20 70 61 73 73 20 61 74 | 20 74 68 65 20 73 69 6d | pass at| the sim|
|000027d0| 75 6c 61 74 69 6f 6e 20 | 6d 61 79 20 63 6f 6e 74 |ulation |may cont|
|000027e0| 61 69 6e 20 73 6f 6d 65 | 20 65 72 72 6f 72 73 0a |ain some| errors.|
|000027f0| 74 68 61 74 20 49 20 77 | 69 6c 6c 20 68 61 76 65 |that I w|ill have|
|00002800| 20 74 6f 20 66 69 78 20 | 6c 61 74 65 72 2c 20 61 | to fix |later, a|
|00002810| 66 74 65 72 20 49 20 68 | 61 76 65 20 68 61 64 20 |fter I h|ave had |
|00002820| 74 69 6d 65 20 74 6f 20 | 72 65 76 69 65 77 20 74 |time to |review t|
|00002830| 68 65 0a 70 65 72 74 69 | 6e 65 6e 74 20 6d 61 74 |he.perti|nent mat|
|00002840| 65 72 69 61 6c 20 61 74 | 20 68 6f 6d 65 2e 20 20 |erial at| home. |
|00002850| 53 75 72 70 72 69 73 69 | 6e 67 6c 79 20 65 6e 6f |Surprisi|ngly eno|
|00002860| 75 67 68 2c 20 69 74 20 | 73 65 65 6d 73 20 74 6f |ugh, it |seems to|
|00002870| 20 77 6f 72 6b 0a 70 72 | 65 74 74 79 20 61 63 63 | work.pr|etty acc|
|00002880| 75 72 61 74 65 6c 79 2c | 20 62 61 73 65 64 20 75 |urately,| based u|
|00002890| 70 6f 6e 20 6d 79 20 65 | 78 70 65 72 69 65 6e 63 |pon my e|xperienc|
|000028a0| 65 20 77 69 74 68 20 6d | 79 20 4f 52 43 41 20 44 |e with m|y ORCA D|
|000028b0| 65 6c 70 69 2e 20 20 48 | 61 76 65 0a 66 75 6e 21 |elpi. H|ave.fun!|
|000028c0| 0a 0a 09 20 20 20 54 69 | 73 73 75 65 20 68 61 6c |... Ti|ssue hal|
|000028d0| 66 74 69 6d 65 73 20 69 | 6e 20 67 65 6e 65 72 61 |ftimes i|n genera|
|000028e0| 6c 20 65 78 70 72 65 73 | 73 20 74 68 65 20 74 69 |l expres|s the ti|
|000028f0| 6d 65 20 69 74 20 74 61 | 6b 65 73 20 66 6f 72 20 |me it ta|kes for |
|00002900| 61 0a 09 20 20 20 74 69 | 73 73 75 65 20 74 6f 20 |a.. ti|ssue to |
|00002910| 65 69 74 68 65 72 20 61 | 62 73 6f 72 62 20 6f 72 |either a|bsorb or|
|00002920| 20 72 65 6c 65 61 73 65 | 20 6e 69 74 72 6f 67 65 | release| nitroge|
|00002930| 6e 20 73 75 63 68 20 74 | 68 61 74 20 74 68 65 0a |n such t|hat the.|
|00002940| 09 20 20 20 74 69 73 73 | 75 65 20 69 73 20 35 30 |. tiss|ue is 50|
|00002950| 25 20 65 71 75 61 6c 69 | 7a 65 64 20 74 6f 20 74 |% equali|zed to t|
|00002960| 68 65 20 70 72 65 73 73 | 75 72 65 20 64 69 66 66 |he press|ure diff|
|00002970| 65 72 65 6e 74 69 61 6c | 20 62 65 74 77 65 65 6e |erential| between|
|00002980| 0a 09 20 20 20 74 68 65 | 20 61 6d 62 69 65 6e 74 |.. the| ambient|
|00002990| 20 6e 69 74 72 6f 67 65 | 6e 20 70 72 65 73 73 75 | nitroge|n pressu|
|000029a0| 72 65 20 61 6e 64 20 74 | 68 65 20 74 69 73 73 75 |re and t|he tissu|
|000029b0| 65 20 6e 69 74 72 6f 67 | 65 6e 0a 09 20 20 20 70 |e nitrog|en.. p|
|000029c0| 72 65 73 73 75 72 65 2e | 20 54 68 69 73 20 75 70 |ressure.| This up|
|000029d0| 74 61 6b 65 20 6f 72 20 | 6f 75 74 67 61 73 73 69 |take or |outgassi|
|000029e0| 6e 67 20 6f 62 65 79 73 | 20 61 6e 20 61 73 79 6d |ng obeys| an asym|
|000029f0| 70 74 6f 74 69 63 0a 09 | 20 20 20 65 78 70 6f 6e |ptotic..| expon|
|00002a00| 65 6e 74 69 61 6c 2c 20 | 6e 61 6d 65 6c 79 20 69 |ential, |namely i|
|00002a10| 66 20 61 6d 62 69 65 6e | 74 20 70 72 65 73 73 75 |f ambien|t pressu|
|00002a20| 72 65 20 69 73 20 50 41 | 2c 20 61 6e 64 20 69 6e |re is PA|, and in|
|00002a30| 69 74 69 61 6c 20 74 69 | 73 73 75 65 0a 09 20 20 |itial ti|ssue.. |
|00002a40| 20 70 72 65 73 73 75 72 | 65 20 69 73 20 50 54 30 | pressur|e is PT0|
|00002a50| 2c 20 74 68 65 6e 20 74 | 68 65 20 74 69 73 73 75 |, then t|he tissu|
|00002a60| 65 20 70 72 65 73 73 75 | 72 65 20 61 73 20 61 20 |e pressu|re as a |
|00002a70| 66 75 6e 63 74 69 6f 6e | 20 6f 66 0a 09 20 20 20 |function| of.. |
|00002a80| 74 69 6d 65 20 69 73 20 | 65 78 70 72 65 73 73 65 |time is |expresse|
|00002a90| 64 20 61 73 2c 0a 0a 09 | 20 20 20 50 54 20 3d 20 |d as,...| PT = |
|00002aa0| 50 54 30 20 2b 20 28 50 | 41 20 2d 20 50 54 30 29 |PT0 + (P|A - PT0)|
|00002ab0| 28 31 20 2d 20 65 5e 28 | 2d 6b 74 29 29 0a 0a 09 |(1 - e^(|-kt))...|
|00002ac0| 20 20 20 77 68 65 72 65 | 20 6b 20 3d 20 2d 6c 6e | where| k = -ln|
|00002ad0| 28 30 2e 35 29 2f 54 20 | 20 20 20 20 3d 20 30 2e |(0.5)/T | = 0.|
|00002ae0| 36 39 33 31 2f 54 0a 09 | 09 20 09 20 20 20 20 20 |6931/T..|. . |
|00002af0| 20 20 68 61 6c 66 20 20 | 20 20 20 20 20 20 20 20 | half | |
|00002b00| 20 68 61 6c 66 0a 0a 09 | 20 20 20 54 68 69 73 20 | half...| This |
|00002b10| 66 6f 72 6d 75 6c 61 20 | 68 6f 6c 64 73 20 74 72 |formula |holds tr|
|00002b20| 75 65 20 66 6f 72 20 73 | 74 61 74 69 63 20 63 6f |ue for s|tatic co|
|00002b30| 6e 64 69 74 69 6f 6e 73 | 3b 20 69 2e 65 2e 20 50 |nditions|; i.e. P|
|00002b40| 41 20 64 6f 65 73 0a 09 | 20 20 20 6e 6f 74 20 63 |A does..| not c|
|00002b50| 68 61 6e 67 65 2e 20 49 | 6e 20 72 65 61 6c 69 74 |hange. I|n realit|
|00002b60| 79 2c 20 61 20 64 69 76 | 65 72 20 77 69 6c 6c 20 |y, a div|er will |
|00002b70| 70 72 6f 62 61 62 6c 79 | 20 62 65 20 63 6f 6e 74 |probably| be cont|
|00002b80| 69 6e 75 6f 75 73 6c 79 | 0a 09 20 20 20 63 68 61 |inuously|.. cha|
|00002b90| 6e 67 69 6e 67 20 64 65 | 70 74 68 2c 20 61 6e 64 |nging de|pth, and|
|00002ba0| 20 74 68 65 72 65 66 6f | 72 65 20 50 41 20 69 73 | therefo|re PA is|
|00002bb0| 20 63 68 61 6e 67 69 6e | 67 20 61 6c 73 6f 2e 20 | changin|g also. |
|00002bc0| 41 0a 09 20 20 20 72 65 | 61 73 6f 6e 61 62 6c 65 |A.. re|asonable|
|00002bd0| 20 61 70 70 72 6f 78 69 | 6d 61 74 69 6f 6e 20 6f | approxi|mation o|
|00002be0| 66 20 63 6f 6e 74 69 6e | 6f 75 73 20 50 54 20 76 |f contin|ous PT v|
|00002bf0| 61 6c 75 65 73 20 63 61 | 6e 20 62 65 0a 09 20 20 |alues ca|n be.. |
|00002c00| 20 63 61 6c 63 75 6c 61 | 74 65 64 20 62 79 20 73 | calcula|ted by s|
|00002c10| 61 6d 70 6c 69 6e 67 20 | 50 41 20 61 74 20 64 69 |ampling |PA at di|
|00002c20| 73 63 72 65 74 65 20 69 | 6e 74 65 72 76 61 6c 73 |screte i|ntervals|
|00002c30| 2c 20 61 6e 64 20 61 70 | 70 6c 79 69 6e 67 0a 09 |, and ap|plying..|
|00002c40| 20 20 20 74 68 65 20 61 | 62 6f 76 65 20 66 6f 72 | the a|bove for|
|00002c50| 6d 75 6c 61 20 6f 76 65 | 72 20 74 68 65 20 70 72 |mula ove|r the pr|
|00002c60| 65 63 65 64 69 6e 67 20 | 73 61 6d 70 6c 65 20 69 |eceding |sample i|
|00002c70| 6e 74 65 72 76 61 6c 2c | 20 74 68 65 6e 0a 09 20 |nterval,| then.. |
|00002c80| 20 20 73 74 61 72 74 69 | 6e 67 20 6f 76 65 72 20 | starti|ng over |
|00002c90| 77 69 74 68 20 61 20 6e | 65 77 20 50 41 20 61 6e |with a n|ew PA an|
|00002ca0| 64 20 50 54 30 20 66 6f | 72 20 74 68 65 20 6e 65 |d PT0 fo|r the ne|
|00002cb0| 78 74 20 69 6e 74 65 72 | 76 61 6c 0a 09 20 20 20 |xt inter|val.. |
|00002cc0| 62 61 73 65 64 20 75 70 | 6f 6e 20 74 68 65 20 63 |based up|on the c|
|00002cd0| 61 6c 63 75 6c 61 74 69 | 6f 6e 2e 0a 0a 09 20 20 |alculati|on.... |
|00002ce0| 20 49 6e 20 74 68 69 73 | 20 73 69 6d 75 6c 61 74 | In this| simulat|
|00002cf0| 65 64 20 63 6f 6d 70 75 | 74 65 72 2c 20 77 65 20 |ed compu|ter, we |
|00002d00| 61 73 73 75 6d 65 20 64 | 61 74 61 70 6f 69 6e 74 |assume d|atapoint|
|00002d10| 73 20 61 72 65 20 72 65 | 63 6f 72 64 65 64 0a 09 |s are re|corded..|
|00002d20| 20 20 20 6f 6e 65 20 70 | 65 72 20 6d 69 6e 75 74 | one p|er minut|
|00002d30| 65 2e 20 53 69 6e 63 65 | 20 74 68 65 20 68 61 6c |e. Since| the hal|
|00002d40| 66 74 69 6d 65 73 20 61 | 72 65 20 65 78 70 72 65 |ftimes a|re expre|
|00002d50| 73 73 65 64 20 69 6e 20 | 6d 69 6e 75 74 65 73 2c |ssed in |minutes,|
|00002d60| 0a 09 20 20 20 74 68 65 | 20 61 62 6f 76 65 20 66 |.. the| above f|
|00002d70| 6f 72 6d 75 6c 61 20 63 | 61 6e 20 62 65 20 72 65 |ormula c|an be re|
|00002d80| 64 75 63 65 20 74 6f 20 | 61 6e 20 61 64 6a 75 73 |duce to |an adjus|
|00002d90| 74 6d 65 6e 74 20 61 74 | 20 65 61 63 68 0a 09 20 |tment at| each.. |
|00002da0| 20 20 73 61 6d 70 6c 65 | 20 74 68 61 74 20 63 6f | sample| that co|
|00002db0| 6e 73 69 73 74 73 20 6f | 66 20 74 68 65 20 66 6f |nsists o|f the fo|
|00002dc0| 6c 6c 6f 77 69 6e 67 3a | 0a 0a 09 20 20 20 50 54 |llowing:|... PT|
|00002dd0| 6e 65 77 20 3d 20 50 54 | 6c 61 73 74 20 2b 20 4b |new = PT|last + K|
|00002de0| 28 50 41 20 2d 20 50 54 | 6c 61 73 74 29 0a 0a 09 |(PA - PT|last)...|
|00002df0| 20 20 20 77 68 65 72 65 | 20 4b 20 3d 20 28 31 20 | where| K = (1 |
|00002e00| 2d 20 65 5e 28 2d 6b 2a | 31 29 29 20 3d 20 31 2d |- e^(-k*|1)) = 1-|
|00002e10| 65 5e 28 2d 6b 29 20 3d | 20 31 20 2d 20 28 31 2f |e^(-k) =| 1 - (1/|
|00002e20| 65 5e 6b 29 20 3d 0a 0a | 09 09 09 09 20 20 20 31 |e^k) =..|.... 1|
|00002e30| 20 2d 20 28 30 2e 35 29 | 5e 28 31 2f 54 20 20 20 | - (0.5)|^(1/T |
|00002e40| 20 29 0a 09 09 09 09 09 | 09 20 68 61 6c 66 0a 09 | )......|. half..|
|00002e50| 20 20 20 0a 09 20 20 20 | 4e 6f 74 65 20 74 68 61 | .. |Note tha|
|00002e60| 74 20 74 68 65 20 4b 20 | 76 61 6c 75 65 20 69 73 |t the K |value is|
|00002e70| 20 64 65 70 65 6e 64 61 | 6e 74 20 75 70 6f 6e 20 | dependa|nt upon |
|00002e80| 63 6f 6e 73 69 73 74 65 | 6e 63 79 20 62 65 74 77 |consiste|ncy betw|
|00002e90| 65 65 6e 0a 09 20 20 20 | 74 68 65 20 75 6e 69 74 |een.. |the unit|
|00002ea0| 73 20 6f 66 20 74 68 65 | 20 63 6f 6d 70 61 72 74 |s of the| compart|
|00002eb0| 6d 65 6e 74 20 68 61 6c | 66 20 74 69 6d 65 20 61 |ment hal|f time a|
|00002ec0| 6e 64 20 74 68 65 20 63 | 6f 6d 70 75 74 65 72 0a |nd the c|omputer.|
|00002ed0| 09 20 20 20 73 61 6d 70 | 6c 65 20 70 65 72 69 6f |. samp|le perio|
|00002ee0| 64 2e 20 53 70 65 63 69 | 66 69 63 61 6c 6c 79 2c |d. Speci|fically,|
|00002ef0| 20 74 68 65 20 61 62 6f | 76 65 20 66 6f 72 6d 75 | the abo|ve formu|
|00002f00| 6c 61 20 6f 6e 6c 79 20 | 61 70 70 6c 69 65 73 0a |la only |applies.|
|00002f10| 09 20 20 20 69 66 20 74 | 68 65 20 73 61 6d 70 6c |. if t|he sampl|
|00002f20| 65 20 70 65 72 69 6f 64 | 20 69 73 20 31 20 75 6e |e period| is 1 un|
|00002f30| 69 74 20 6f 66 20 74 68 | 65 20 68 61 6c 66 20 74 |it of th|e half t|
|00002f40| 69 6d 65 20 75 6e 69 74 | 20 28 69 6e 20 74 68 69 |ime unit| (in thi|
|00002f50| 73 0a 09 20 20 20 63 61 | 73 65 20 6d 69 6e 75 74 |s.. ca|se minut|
|00002f60| 65 73 29 2e 20 46 6f 72 | 20 61 6e 20 61 72 62 69 |es). For| an arbi|
|00002f70| 74 72 61 72 79 20 73 61 | 6d 70 6c 65 20 70 65 72 |trary sa|mple per|
|00002f80| 69 6f 64 20 73 2c 20 74 | 68 65 20 66 6f 72 6d 75 |iod s, t|he formu|
|00002f90| 6c 61 0a 09 20 20 20 66 | 6f 72 20 74 68 65 20 4b |la.. f|or the K|
|00002fa0| 20 76 61 6c 75 65 20 69 | 73 0a 0a 09 20 20 20 4b | value i|s... K|
|00002fb0| 20 3d 20 31 20 2d 20 28 | 30 2e 35 29 5e 28 73 2f | = 1 - (|0.5)^(s/|
|00002fc0| 54 20 20 20 20 29 0a 09 | 09 09 20 20 20 20 20 68 |T )..|.. h|
|00002fd0| 61 6c 66 0a 0a 09 20 20 | 20 54 68 65 20 64 69 76 |alf... | The div|
|00002fe0| 65 20 63 6f 6d 70 75 74 | 65 72 20 73 69 6d 75 6c |e comput|er simul|
|00002ff0| 61 74 6f 72 20 63 61 6c | 63 75 6c 61 74 65 73 20 |ator cal|culates |
|00003000| 74 68 65 20 4b 20 76 61 | 6c 75 65 73 20 6f 6e 0a |the K va|lues on.|
|00003010| 09 20 20 20 73 74 61 72 | 74 75 70 2c 20 77 69 74 |. star|tup, wit|
|00003020| 68 20 74 68 65 20 73 61 | 6d 70 6c 65 20 70 65 72 |h the sa|mple per|
|00003030| 69 6f 64 20 27 73 27 20 | 62 65 69 6e 67 20 74 61 |iod 's' |being ta|
|00003040| 6b 65 6e 20 66 72 6f 6d | 20 74 68 65 0a 09 20 20 |ken from| the.. |
|00003050| 20 66 6f 6c 6c 6f 77 69 | 6e 67 20 73 6f 75 72 63 | followi|ng sourc|
|00003060| 65 73 2c 20 69 6e 20 6f | 72 64 65 72 20 6f 66 20 |es, in o|rder of |
|00003070| 64 65 63 72 65 61 73 69 | 6e 67 20 70 72 69 6f 72 |decreasi|ng prior|
|00003080| 69 74 79 3a 0a 0a 09 20 | 20 20 31 29 20 61 20 73 |ity:... | 1) a s|
|00003090| 61 6d 70 6c 65 20 70 65 | 72 69 6f 64 20 73 70 65 |ample pe|riod spe|
|000030a0| 63 69 66 69 65 64 20 6f | 6e 20 74 68 65 20 63 6f |cified o|n the co|
|000030b0| 6d 6d 61 6e 64 20 6c 69 | 6e 65 20 77 69 74 68 20 |mmand li|ne with |
|000030c0| 74 68 65 0a 09 20 20 20 | 20 20 20 2d 73 20 6f 70 |the.. | -s op|
|000030d0| 74 69 6f 6e 0a 0a 09 20 | 20 20 32 29 20 41 20 73 |tion... | 2) A s|
|000030e0| 61 6d 70 6c 65 20 70 65 | 72 69 6f 64 20 73 70 65 |ample pe|riod spe|
|000030f0| 63 69 66 69 65 64 20 69 | 6e 20 61 20 70 72 6f 66 |cified i|n a prof|
|00003100| 69 6c 65 20 66 69 6c 65 | 2e 20 54 68 69 73 20 6d |ile file|. This m|
|00003110| 75 73 74 0a 09 20 20 20 | 20 20 20 74 61 6b 65 20 |ust.. | take |
|00003120| 70 72 65 63 65 64 65 6e | 63 65 20 6f 76 65 72 20 |preceden|ce over |
|00003130| 61 20 73 61 6d 70 6c 65 | 20 70 65 72 69 6f 64 20 |a sample| period |
|00003140| 69 6e 20 61 20 6d 6f 64 | 65 6c 20 66 69 6c 65 2c |in a mod|el file,|
|00003150| 0a 09 20 20 20 20 20 20 | 6f 74 68 65 72 77 69 73 |.. |otherwis|
|00003160| 65 20 74 68 65 20 6e 75 | 6d 62 65 72 20 6f 66 20 |e the nu|mber of |
|00003170| 73 61 6d 70 6c 65 73 20 | 69 6e 20 74 68 65 20 66 |samples |in the f|
|00003180| 69 6c 65 20 77 69 6c 6c | 20 6e 6f 74 0a 09 20 20 |ile will| not.. |
|00003190| 20 20 20 20 6d 61 74 63 | 68 20 74 68 65 20 64 69 | matc|h the di|
|000031a0| 76 65 20 70 72 6f 66 69 | 6c 65 20 69 6e 20 72 65 |ve profi|le in re|
|000031b0| 61 6c 20 74 69 6d 65 2e | 20 49 6e 20 6f 72 64 65 |al time.| In orde|
|000031c0| 72 20 74 6f 20 63 6f 6d | 70 61 72 65 0a 09 20 20 |r to com|pare.. |
|000031d0| 20 20 20 20 64 69 66 66 | 65 72 65 6e 74 20 6d 6f | diff|erent mo|
|000031e0| 64 65 6c 73 2c 20 74 68 | 65 20 73 61 6d 65 20 73 |dels, th|e same s|
|000031f0| 61 6d 70 6c 69 6e 67 20 | 70 65 72 69 6f 64 20 6d |ampling |period m|
|00003200| 75 73 74 20 62 65 20 75 | 73 65 64 0a 09 20 20 20 |ust be u|sed.. |
|00003210| 20 20 20 66 6f 72 20 61 | 20 73 69 6e 67 6c 65 20 | for a| single |
|00003220| 70 72 6f 66 69 6c 65 2e | 0a 0a 09 20 20 20 33 29 |profile.|... 3)|
|00003230| 20 41 20 73 61 6d 70 6c | 65 20 70 65 72 69 6f 64 | A sampl|e period|
|00003240| 20 73 70 65 63 69 66 69 | 65 64 20 69 6e 20 74 68 | specifi|ed in th|
|00003250| 65 20 6d 6f 64 65 6c 20 | 66 69 6c 65 0a 0a 09 20 |e model |file... |
|00003260| 20 20 34 29 20 54 68 65 | 20 64 65 66 61 75 6c 74 | 4) The| default|
|00003270| 20 73 61 6d 70 6c 65 20 | 70 65 72 69 6f 64 20 6f | sample |period o|
|00003280| 66 20 31 20 73 65 63 6f | 6e 64 0a 0a 09 20 20 20 |f 1 seco|nd... |
|00003290| 2a 2f 0a 0a 63 68 61 72 | 20 73 63 61 6c 65 31 30 |*/..char| scale10|
|000032a0| 30 5b 5d 3d 22 20 31 30 | 7c 20 32 30 7c 20 33 30 |0[]=" 10|| 20| 30|
|000032b0| 7c 20 34 30 7c 20 35 30 | 7c 20 36 30 7c 20 37 30 || 40| 50|| 60| 70|
|000032c0| 7c 20 38 30 7c 20 39 30 | 7c 31 30 30 7c 20 20 25 || 80| 90||100| %|
|000032d0| 20 41 6c 6c 6f 77 65 64 | 20 4e 32 22 3b 0a 63 68 | Allowed| N2";.ch|
|000032e0| 61 72 20 73 63 61 6c 65 | 32 30 30 5b 5d 3d 22 20 |ar scale|200[]=" |
|000032f0| 32 30 7c 20 34 30 7c 20 | 36 30 7c 20 38 30 7c 31 |20| 40| |60| 80|1|
|00003300| 30 30 7c 31 32 30 7c 31 | 34 30 7c 31 36 30 7c 31 |00|120|1|40|160|1|
|00003310| 38 30 7c 32 30 30 7c 20 | 20 25 20 41 6c 6c 6f 77 |80|200| | % Allow|
|00003320| 65 64 20 4e 32 22 3b 0a | 0a 23 69 6e 63 6c 75 64 |ed N2";.|.#includ|
|00003330| 65 20 3c 73 74 64 69 6f | 2e 68 3e 0a 23 69 6e 63 |e <stdio|.h>.#inc|
|00003340| 6c 75 64 65 20 3c 63 75 | 72 73 65 73 2e 68 3e 0a |lude <cu|rses.h>.|
|00003350| 0a 23 64 65 66 69 6e 65 | 20 4e 43 4f 4d 50 09 09 |.#define| NCOMP..|
|00003360| 32 34 0a 23 64 65 66 69 | 6e 65 20 4f 4e 45 5f 41 |24.#defi|ne ONE_A|
|00003370| 54 4d 5f 46 53 57 09 33 | 33 2e 30 0a 23 64 65 66 |TM_FSW.3|3.0.#def|
|00003380| 69 6e 65 20 50 4e 32 09 | 09 30 2e 37 39 0a 23 64 |ine PN2.|.0.79.#d|
|00003390| 65 66 69 6e 65 20 4f 4e | 45 5f 41 54 4d 5f 46 53 |efine ON|E_ATM_FS|
|000033a0| 57 5f 4e 32 09 50 4e 32 | 20 2a 20 4f 4e 45 5f 41 |W_N2.PN2| * ONE_A|
|000033b0| 54 4d 5f 46 53 57 0a 23 | 64 65 66 69 6e 65 20 4c |TM_FSW.#|define L|
|000033c0| 4e 5f 48 41 4c 46 09 09 | 2d 30 2e 36 39 33 31 0a |N_HALF..|-0.6931.|
|000033d0| 23 64 65 66 69 6e 65 20 | 49 4e 46 20 09 09 33 32 |#define |INF ..32|
|000033e0| 30 30 30 09 09 2f 2a 20 | 66 6f 72 20 6e 64 6c 28 |000../* |for ndl(|
|000033f0| 29 20 2a 2f 0a 23 64 65 | 66 69 6e 65 20 44 45 4c |) */.#de|fine DEL|
|00003400| 54 41 4d 09 09 31 2e 30 | 09 09 2f 2a 20 74 65 6d |TAM..1.0|../* tem|
|00003410| 70 6f 72 61 72 79 20 66 | 69 78 20 2a 2f 0a 23 64 |porary f|ix */.#d|
|00003420| 65 66 69 6e 65 20 53 48 | 4f 57 5f 4c 4f 41 44 49 |efine SH|OW_LOADI|
|00003430| 4e 47 09 30 0a 23 64 65 | 66 69 6e 65 20 53 48 4f |NG.0.#de|fine SHO|
|00003440| 57 5f 46 53 57 41 09 31 | 0a 0a 2f 2a 20 53 6f 6d |W_FSWA.1|../* Som|
|00003450| 65 20 6f 62 73 63 75 72 | 65 20 76 61 72 69 61 62 |e obscur|e variab|
|00003460| 6c 65 20 6e 61 6d 65 73 | 20 61 6e 64 20 74 68 65 |le names| and the|
|00003470| 69 72 20 6d 65 61 6e 69 | 6e 67 73 3a 0a 0a 09 62 |ir meani|ngs:...b|
|00003480| 74 09 42 6f 74 74 6f 6d | 20 54 69 6d 65 0a 0a 09 |t.Bottom| Time...|
|00003490| 73 69 09 53 75 72 66 61 | 63 65 20 49 6e 74 65 72 |si.Surfa|ce Inter|
|000034a0| 76 61 6c 0a 0a 09 63 66 | 09 43 6f 6d 70 72 65 73 |val...cf|.Compres|
|000034b0| 73 69 6f 6e 20 66 61 63 | 74 6f 72 20 28 66 6f 72 |sion fac|tor (for|
|000034c0| 20 63 6f 6d 70 72 65 73 | 73 69 6e 67 20 70 72 6f | compres|sing pro|
|000034d0| 66 69 6c 65 20 64 69 73 | 70 6c 61 79 29 0a 0a 09 |file dis|play)...|
|000034e0| 64 69 09 44 65 70 74 68 | 20 49 6e 63 72 65 6d 65 |di.Depth| Increme|
|000034f0| 6e 74 20 28 66 6f 72 20 | 70 72 6f 66 69 6c 65 20 |nt (for |profile |
|00003500| 64 69 73 70 6c 61 79 29 | 0a 0a 2a 2f 0a 0a 69 6e |display)|..*/..in|
|00003510| 74 20 63 66 3d 31 2c 20 | 64 75 72 61 74 69 6f 6e |t cf=1, |duration|
|00003520| 3d 30 2c 20 73 61 6d 70 | 6c 65 73 3d 30 2c 20 6e |=0, samp|les=0, n|
|00003530| 3d 30 2c 20 63 6f 6e 74 | 72 6f 6c 6c 69 6e 67 5f |=0, cont|rolling_|
|00003540| 74 69 73 73 75 65 2c 20 | 6c 69 6e 65 73 3d 32 34 |tissue, |lines=24|
|00003550| 2c 0a 09 63 65 69 6c 69 | 6e 67 2c 20 64 69 76 65 |,..ceili|ng, dive|
|00003560| 3d 31 2c 20 6d 6f 64 65 | 3d 53 48 4f 57 5f 4c 4f |=1, mode|=SHOW_LO|
|00003570| 41 44 49 4e 47 2c 20 6c | 6f 67 6d 6f 64 65 3d 53 |ADING, l|ogmode=S|
|00003580| 48 4f 57 5f 4c 4f 41 44 | 49 4e 47 2c 0a 09 64 65 |HOW_LOAD|ING,..de|
|00003590| 63 6f 6d 6f 64 65 3d 30 | 2c 20 77 69 64 74 68 3d |comode=0|, width=|
|000035a0| 38 30 3b 0a 0a 66 6c 6f | 61 74 20 62 74 3d 30 2e |80;..flo|at bt=0.|
|000035b0| 30 2c 20 73 69 3d 30 2e | 30 2c 20 61 70 6e 32 3d |0, si=0.|0, apn2=|
|000035c0| 4f 4e 45 5f 41 54 4d 5f | 46 53 57 5f 4e 32 2c 20 |ONE_ATM_|FSW_N2, |
|000035d0| 68 61 6c 66 5b 4e 43 4f | 4d 50 5d 2c 20 75 63 66 |half[NCO|MP], ucf|
|000035e0| 3d 31 2e 30 2c 20 64 69 | 2c 0a 09 64 65 70 74 68 |=1.0, di|,..depth|
|000035f0| 2c 20 4b 76 61 6c 75 65 | 73 5b 4e 43 4f 4d 50 5d |, Kvalue|s[NCOMP]|
|00003600| 2c 20 4d 76 61 6c 75 65 | 73 5b 4e 43 4f 4d 50 5d |, Mvalue|s[NCOMP]|
|00003610| 2c 20 63 5b 4e 43 4f 4d | 50 5d 2c 20 73 3d 30 2e |, c[NCOM|P], s=0.|
|00003620| 30 2c 0a 09 64 65 70 74 | 68 5f 72 65 63 6f 72 64 |0,..dept|h_record|
|00003630| 5b 38 31 39 32 5d 3b 0a | 0a 64 6f 75 62 6c 65 20 |[8192];.|.double |
|00003640| 63 65 69 6c 28 29 2c 20 | 66 6c 6f 6f 72 28 29 2c |ceil(), |floor(),|
|00003650| 20 70 6f 77 28 29 2c 20 | 65 78 70 28 29 2c 20 6c | pow(), |exp(), l|
|00003660| 6f 67 28 29 3b 0a 66 6c | 6f 61 74 20 6c 6f 61 64 |og();.fl|oat load|
|00003670| 69 6e 67 28 29 3b 0a 63 | 68 61 72 20 62 75 66 5b |ing();.c|har buf[|
|00003680| 31 32 38 5d 2c 20 75 6e | 69 74 73 74 72 5b 31 36 |128], un|itstr[16|
|00003690| 5d 2c 20 73 63 61 6c 65 | 31 30 30 46 53 57 41 5b |], scale|100FSWA[|
|000036a0| 38 30 5d 2c 20 73 63 61 | 6c 65 32 30 30 46 53 57 |80], sca|le200FSW|
|000036b0| 41 5b 38 30 5d 3b 0a 0a | 63 68 61 72 20 72 65 76 |A[80];..|char rev|
|000036c0| 69 73 69 6f 6e 5b 5d 3d | 22 24 48 65 61 64 65 72 |ision[]=|"$Header|
|000036d0| 3a 20 64 69 76 65 63 6f | 6d 70 2e 63 2c 76 20 32 |: diveco|mp.c,v 2|
|000036e0| 2e 35 20 39 30 2f 31 32 | 2f 31 32 20 31 35 3a 33 |.5 90/12|/12 15:3|
|000036f0| 30 3a 30 32 20 64 61 76 | 65 20 45 78 70 20 24 22 |0:02 dav|e Exp $"|
|00003700| 3b 0a 0a 46 49 4c 45 20 | 2a 70 72 6f 66 69 6c 65 |;..FILE |*profile|
|00003710| 3d 4e 55 4c 4c 2c 20 2a | 6f 75 74 66 69 6c 65 3d |=NULL, *|outfile=|
|00003720| 4e 55 4c 4c 2c 20 2a 6c | 6f 67 66 69 6c 65 3d 4e |NULL, *l|ogfile=N|
|00003730| 55 4c 4c 3b 0a 0a 6d 61 | 69 6e 28 61 72 67 63 2c |ULL;..ma|in(argc,|
|00003740| 61 72 67 76 29 0a 69 6e | 74 20 61 72 67 63 3b 0a |argv).in|t argc;.|
|00003750| 63 68 61 72 20 2a 61 72 | 67 76 5b 5d 3b 0a 7b 09 |char *ar|gv[];.{.|
|00003760| 0a 09 46 49 4c 45 20 2a | 6d 6f 64 65 6c 3d 4e 55 |..FILE *|model=NU|
|00003770| 4c 4c 2c 20 2a 66 6f 70 | 65 6e 28 29 3b 0a 09 69 |LL, *fop|en();..i|
|00003780| 6e 74 20 69 2c 20 6f 70 | 74 3b 0a 09 63 68 61 72 |nt i, op|t;..char|
|00003790| 20 2a 67 65 74 65 6e 76 | 28 29 2c 20 2a 65 6e 76 | *getenv|(), *env|
|000037a0| 73 74 72 2c 20 2a 63 70 | 74 72 2c 20 2a 73 74 72 |str, *cp|tr, *str|
|000037b0| 63 70 79 28 29 2c 20 2a | 73 74 72 63 68 72 28 29 |cpy(), *|strchr()|
|000037c0| 2c 20 6d 6e 61 6d 65 5b | 33 32 5d 3b 0a 09 63 68 |, mname[|32];..ch|
|000037d0| 61 72 20 2a 73 74 72 63 | 61 74 28 29 3b 0a 09 66 |ar *strc|at();..f|
|000037e0| 6c 6f 61 74 20 67 65 74 | 5f 73 61 6d 70 6c 65 28 |loat get|_sample(|
|000037f0| 29 2c 20 64 75 6d 6d 79 | 3b 0a 09 64 6f 75 62 6c |), dummy|;..doubl|
|00003800| 65 20 61 74 6f 66 28 29 | 3b 0a 09 65 78 74 65 72 |e atof()|;..exter|
|00003810| 6e 20 63 68 61 72 20 2a | 6f 70 74 61 72 67 3b 0a |n char *|optarg;.|
|00003820| 0a 09 73 74 72 63 70 79 | 28 75 6e 69 74 73 74 72 |..strcpy|(unitstr|
|00003830| 2c 22 66 74 22 29 3b 0a | 0a 09 2f 2a 20 66 69 6e |,"ft");.|../* fin|
|00003840| 64 20 6f 75 74 20 68 6f | 77 20 6d 61 6e 79 20 6c |d out ho|w many l|
|00003850| 69 6e 65 73 20 64 69 73 | 70 6c 61 79 20 68 61 73 |ines dis|play has|
|00003860| 20 2a 2f 0a 0a 09 69 66 | 20 28 28 65 6e 76 73 74 | */...if| ((envst|
|00003870| 72 3d 67 65 74 65 6e 76 | 28 22 4c 49 4e 45 53 22 |r=getenv|("LINES"|
|00003880| 29 29 21 3d 30 29 20 6c | 69 6e 65 73 3d 61 74 6f |))!=0) l|ines=ato|
|00003890| 69 28 65 6e 76 73 74 72 | 29 3b 0a 09 69 66 20 28 |i(envstr|);..if (|
|000038a0| 28 65 6e 76 73 74 72 3d | 67 65 74 65 6e 76 28 22 |(envstr=|getenv("|
|000038b0| 57 49 44 54 48 22 29 29 | 21 3d 30 29 20 77 69 64 |WIDTH"))|!=0) wid|
|000038c0| 74 68 3d 61 74 6f 69 28 | 65 6e 76 73 74 72 29 3b |th=atoi(|envstr);|
|000038d0| 0a 0a 09 2f 2a 20 70 72 | 6f 63 65 73 73 20 63 6f |.../* pr|ocess co|
|000038e0| 6d 6d 61 6e 64 20 6c 69 | 6e 65 20 6f 70 74 69 6f |mmand li|ne optio|
|000038f0| 6e 73 20 2a 2f 0a 0a 09 | 77 68 69 6c 65 20 28 28 |ns */...|while ((|
|00003900| 6f 70 74 3d 67 65 74 6f | 70 74 28 61 72 67 63 2c |opt=geto|pt(argc,|
|00003910| 61 72 67 76 2c 22 70 3a | 6d 3a 6f 3a 73 3a 75 3a |argv,"p:|m:o:s:u:|
|00003920| 6c 3a 50 22 29 29 21 3d | 45 4f 46 29 20 7b 0a 09 |l:P"))!=|EOF) {..|
|00003930| 09 73 77 69 74 63 68 28 | 6f 70 74 29 20 7b 0a 09 |.switch(|opt) {..|
|00003940| 09 09 63 61 73 65 20 27 | 70 27 3a 0a 09 09 09 09 |..case '|p':.....|
|00003950| 69 66 20 28 28 70 72 6f | 66 69 6c 65 3d 66 6f 70 |if ((pro|file=fop|
|00003960| 65 6e 28 6f 70 74 61 72 | 67 2c 22 72 22 29 29 3d |en(optar|g,"r"))=|
|00003970| 3d 4e 55 4c 4c 29 20 7b | 0a 09 09 09 09 09 70 65 |=NULL) {|......pe|
|00003980| 72 72 6f 72 28 6f 70 74 | 61 72 67 29 3b 0a 09 09 |rror(opt|arg);...|
|00003990| 09 09 09 65 78 69 74 28 | 31 29 3b 0a 09 09 09 09 |...exit(|1);.....|
|000039a0| 7d 0a 09 09 09 09 62 72 | 65 61 6b 3b 0a 09 09 09 |}.....br|eak;....|
|000039b0| 63 61 73 65 20 27 6d 27 | 3a 0a 09 09 09 09 69 66 |case 'm'|:.....if|
|000039c0| 20 28 28 6d 6f 64 65 6c | 3d 66 6f 70 65 6e 28 6f | ((model|=fopen(o|
|000039d0| 70 74 61 72 67 2c 22 72 | 22 29 29 3d 3d 4e 55 4c |ptarg,"r|"))==NUL|
|000039e0| 4c 29 20 7b 0a 09 09 09 | 09 09 20 70 65 72 72 6f |L) {....|.. perro|
|000039f0| 72 28 6f 70 74 61 72 67 | 29 3b 0a 09 09 09 09 09 |r(optarg|);......|
|00003a00| 20 65 78 69 74 28 31 29 | 3b 0a 09 09 09 09 7d 0a | exit(1)|;.....}.|
|00003a10| 09 09 09 09 73 74 72 63 | 70 79 28 6d 6e 61 6d 65 |....strc|py(mname|
|00003a20| 2c 6f 70 74 61 72 67 29 | 3b 0a 09 09 09 09 62 72 |,optarg)|;.....br|
|00003a30| 65 61 6b 3b 0a 09 09 09 | 63 61 73 65 20 27 6f 27 |eak;....|case 'o'|
|00003a40| 3a 0a 09 09 09 09 69 66 | 20 28 28 6f 75 74 66 69 |:.....if| ((outfi|
|00003a50| 6c 65 3d 66 6f 70 65 6e | 28 6f 70 74 61 72 67 2c |le=fopen|(optarg,|
|00003a60| 22 77 22 29 29 3d 3d 4e | 55 4c 4c 29 20 7b 0a 09 |"w"))==N|ULL) {..|
|00003a70| 09 09 09 09 70 65 72 72 | 6f 72 28 6f 70 74 61 72 |....perr|or(optar|
|00003a80| 67 29 3b 0a 09 09 09 09 | 09 65 78 69 74 28 31 29 |g);.....|.exit(1)|
|00003a90| 3b 0a 09 09 09 09 7d 0a | 09 09 09 09 62 72 65 61 |;.....}.|....brea|
|00003aa0| 6b 3b 0a 09 09 09 63 61 | 73 65 20 27 73 27 3a 0a |k;....ca|se 's':.|
|00003ab0| 09 09 09 09 73 20 3d 20 | 61 74 6f 66 28 6f 70 74 |....s = |atof(opt|
|00003ac0| 61 72 67 29 3b 0a 09 09 | 09 09 62 72 65 61 6b 3b |arg);...|..break;|
|00003ad0| 0a 09 09 09 63 61 73 65 | 20 27 75 27 3a 0a 09 09 |....case| 'u':...|
|00003ae0| 09 09 63 70 74 72 20 3d | 20 73 74 72 63 68 72 28 |..cptr =| strchr(|
|00003af0| 6f 70 74 61 72 67 2c 28 | 69 6e 74 29 27 3a 27 29 |optarg,(|int)':')|
|00003b00| 3b 0a 09 09 09 09 2a 63 | 70 74 72 20 3d 20 27 5c |;.....*c|ptr = '\|
|00003b10| 30 27 3b 0a 09 09 09 09 | 75 63 66 20 3d 20 61 74 |0';.....|ucf = at|
|00003b20| 6f 66 28 63 70 74 72 2b | 31 29 3b 0a 09 09 09 09 |of(cptr+|1);.....|
|00003b30| 73 74 72 63 70 79 28 75 | 6e 69 74 73 74 72 2c 20 |strcpy(u|nitstr, |
|00003b40| 6f 70 74 61 72 67 29 3b | 0a 09 09 09 09 62 72 65 |optarg);|.....bre|
|00003b50| 61 6b 3b 0a 09 09 09 63 | 61 73 65 20 27 6c 27 3a |ak;....c|ase 'l':|
|00003b60| 0a 09 09 09 09 69 66 20 | 28 28 6c 6f 67 66 69 6c |.....if |((logfil|
|00003b70| 65 3d 66 6f 70 65 6e 28 | 6f 70 74 61 72 67 2c 22 |e=fopen(|optarg,"|
|00003b80| 77 22 29 29 3d 3d 4e 55 | 4c 4c 29 20 7b 0a 09 09 |w"))==NU|LL) {...|
|00003b90| 09 09 09 70 65 72 72 6f | 72 28 6f 70 74 61 72 67 |...perro|r(optarg|
|00003ba0| 29 3b 0a 09 09 09 09 09 | 65 78 69 74 28 31 29 3b |);......|exit(1);|
|00003bb0| 0a 09 09 09 09 7d 0a 09 | 09 09 09 62 72 65 61 6b |.....}..|...break|
|00003bc0| 3b 0a 09 09 09 63 61 73 | 65 20 27 50 27 3a 0a 09 |;....cas|e 'P':..|
|00003bd0| 09 09 09 6d 6f 64 65 3d | 6c 6f 67 6d 6f 64 65 3d |...mode=|logmode=|
|00003be0| 53 48 4f 57 5f 46 53 57 | 41 3b 0a 09 09 09 09 62 |SHOW_FSW|A;.....b|
|00003bf0| 72 65 61 6b 3b 0a 09 09 | 09 09 0a 09 09 7d 0a 09 |reak;...|.....}..|
|00003c00| 7d 0a 0a 09 69 66 20 28 | 61 72 67 63 20 3d 3d 20 |}...if (|argc == |
|00003c10| 31 29 20 7b 0a 09 09 66 | 70 72 69 6e 74 66 28 73 |1) {...f|printf(s|
|00003c20| 74 64 65 72 72 2c 20 22 | 56 61 6c 69 64 20 6f 70 |tderr, "|Valid op|
|00003c30| 74 69 6f 6e 73 20 61 72 | 65 3a 5c 6e 22 29 3b 0a |tions ar|e:\n");.|
|00003c40| 09 09 66 70 72 69 6e 74 | 66 28 73 74 64 65 72 72 |..fprint|f(stderr|
|00003c50| 2c 20 22 20 2d 6d 3c 66 | 6e 61 6d 65 3e 20 20 20 |, " -m<f|name> |
|00003c60| 20 20 20 20 20 4d 6f 64 | 65 6c 20 66 69 6c 65 2e | Mod|el file.|
|00003c70| 20 20 52 45 51 55 49 52 | 45 44 2e 5c 6e 22 29 3b | REQUIR|ED.\n");|
|00003c80| 0a 09 09 66 70 72 69 6e | 74 66 28 73 74 64 65 72 |...fprin|tf(stder|
|00003c90| 72 2c 20 22 20 2d 70 3c | 66 6e 61 6d 65 3e 20 20 |r, " -p<|fname> |
|00003ca0| 20 20 20 20 20 20 49 6e | 70 75 74 20 70 72 6f 66 | In|put prof|
|00003cb0| 69 6c 65 20 66 69 6c 65 | 6e 61 6d 65 5c 6e 22 29 |ile file|name\n")|
|00003cc0| 3b 0a 09 09 66 70 72 69 | 6e 74 66 28 73 74 64 65 |;...fpri|ntf(stde|
|00003cd0| 72 72 2c 20 22 20 2d 6f | 3c 66 6e 61 6d 65 3e 20 |rr, " -o|<fname> |
|00003ce0| 20 20 20 20 20 20 20 4f | 75 74 70 75 74 20 66 69 | O|utput fi|
|00003cf0| 6c 65 6e 61 6d 65 20 66 | 6f 72 20 64 69 76 65 20 |lename f|or dive |
|00003d00| 70 72 6f 66 69 6c 65 5c | 6e 22 29 3b 0a 09 09 66 |profile\|n");...f|
|00003d10| 70 72 69 6e 74 66 28 73 | 74 64 65 72 72 2c 20 22 |printf(s|tderr, "|
|00003d20| 20 2d 6c 3c 66 6e 61 6d | 65 3e 20 20 20 20 20 20 | -l<fnam|e> |
|00003d30| 20 20 4f 75 74 70 75 74 | 20 6c 6f 67 66 69 6c 65 | Output| logfile|
|00003d40| 20 66 69 6c 65 6e 61 6d | 65 2e 20 20 6c 6f 67 66 | filenam|e. logf|
|00003d50| 69 6c 65 20 69 73 20 64 | 65 70 74 68 20 61 6e 64 |ile is d|epth and|
|00003d60| 20 4e 32 20 76 73 20 74 | 69 6d 65 2e 5c 6e 22 29 | N2 vs t|ime.\n")|
|00003d70| 3b 0a 09 09 66 70 72 69 | 6e 74 66 28 73 74 64 65 |;...fpri|ntf(stde|
|00003d80| 72 72 2c 20 22 20 2d 73 | 3c 66 6c 6f 61 74 3e 20 |rr, " -s|<float> |
|00003d90| 20 20 20 20 20 20 20 53 | 61 6d 70 6c 65 20 70 65 | S|ample pe|
|00003da0| 72 69 6f 64 20 28 69 6e | 20 6d 69 6e 75 74 65 73 |riod (in| minutes|
|00003db0| 29 5c 6e 22 29 3b 0a 09 | 09 66 70 72 69 6e 74 66 |)\n");..|.fprintf|
|00003dc0| 28 73 74 64 65 72 72 2c | 20 22 20 2d 75 3c 6e 61 |(stderr,| " -u<na|
|00003dd0| 6d 65 3e 3a 3c 66 6c 6f | 61 74 3e 20 44 65 70 74 |me>:<flo|at> Dept|
|00003de0| 68 20 75 6e 69 74 73 2e | 20 20 28 6e 65 77 2d 75 |h units.| (new-u|
|00003df0| 6e 69 74 29 2a 3c 66 6c | 6f 61 74 3e 20 3d 20 31 |nit)*<fl|oat> = 1|
|00003e00| 20 66 74 5c 6e 22 29 3b | 0a 09 09 66 70 72 69 6e | ft\n");|...fprin|
|00003e10| 74 66 28 73 74 64 65 72 | 72 2c 20 22 20 2d 50 20 |tf(stder|r, " -P |
|00003e20| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 44 69 | | Di|
|00003e30| 73 70 6c 61 79 20 63 6f | 6d 70 61 72 74 6d 65 6e |splay co|mpartmen|
|00003e40| 74 73 20 61 73 20 28 75 | 6e 69 74 73 29 53 57 41 |ts as (u|nits)SWA|
|00003e50| 5c 6e 22 29 3b 0a 09 09 | 65 78 69 74 28 30 29 3b |\n");...|exit(0);|
|00003e60| 0a 09 7d 0a 0a 09 69 66 | 20 28 6d 6f 64 65 6c 3d |..}...if| (model=|
|00003e70| 3d 4e 55 4c 4c 29 20 7b | 0a 09 09 66 70 72 69 6e |=NULL) {|...fprin|
|00003e80| 74 66 28 73 74 64 65 72 | 72 2c 20 22 59 6f 75 20 |tf(stder|r, "You |
|00003e90| 6d 75 73 74 20 73 70 65 | 63 69 66 79 20 61 20 6d |must spe|cify a m|
|00003ea0| 6f 64 65 6c 20 77 69 74 | 68 20 74 68 65 20 5c 22 |odel wit|h the \"|
|00003eb0| 2d 6d 5c 22 20 6f 70 74 | 69 6f 6e 5c 6e 22 29 3b |-m\" opt|ion\n");|
|00003ec0| 0a 09 09 65 78 69 74 28 | 30 29 3b 0a 09 7d 20 0a |...exit(|0);..} .|
|00003ed0| 0a 09 2f 2a 20 63 68 65 | 63 6b 20 70 72 6f 66 69 |../* che|ck profi|
|00003ee0| 6c 65 20 66 6f 72 20 64 | 65 70 74 68 20 75 6e 69 |le for d|epth uni|
|00003ef0| 74 20 73 70 65 63 69 66 | 69 63 61 74 69 6f 6e 20 |t specif|ication |
|00003f00| 2a 2f 0a 0a 09 69 66 20 | 28 70 72 6f 66 69 6c 65 |*/...if |(profile|
|00003f10| 29 0a 09 09 69 66 28 66 | 73 63 61 6e 66 28 70 72 |)...if(f|scanf(pr|
|00003f20| 6f 66 69 6c 65 2c 22 75 | 3a 25 5b 5e 3a 5d 3a 25 |ofile,"u|:%[^:]:%|
|00003f30| 66 22 2c 75 6e 69 74 73 | 74 72 2c 26 75 63 66 29 |f",units|tr,&ucf)|
|00003f40| 3d 3d 30 29 0a 09 09 09 | 72 65 77 69 6e 64 28 70 |==0)....|rewind(p|
|00003f50| 72 6f 66 69 6c 65 29 3b | 0a 0a 09 2f 2a 20 63 68 |rofile);|.../* ch|
|00003f60| 65 63 6b 20 6d 6f 64 65 | 6c 20 66 69 6c 65 20 66 |eck mode|l file f|
|00003f70| 6f 72 20 73 61 6d 70 6c | 69 6e 67 20 70 65 72 69 |or sampl|ing peri|
|00003f80| 6f 64 20 2a 2f 0a 0a 09 | 69 66 20 28 66 73 63 61 |od */...|if (fsca|
|00003f90| 6e 66 28 6d 6f 64 65 6c | 2c 22 73 3a 25 66 22 2c |nf(model|,"s:%f",|
|00003fa0| 28 73 3d 3d 30 3f 26 73 | 3a 26 64 75 6d 6d 79 29 |(s==0?&s|:&dummy)|
|00003fb0| 29 3d 3d 30 29 20 72 65 | 77 69 6e 64 28 6d 6f 64 |)==0) re|wind(mod|
|00003fc0| 65 6c 29 3b 0a 0a 09 69 | 66 20 28 73 20 3d 3d 20 |el);...i|f (s == |
|00003fd0| 30 2e 30 29 20 73 20 3d | 20 31 2e 30 3b 20 2f 2a |0.0) s =| 1.0; /*|
|00003fe0| 20 64 65 66 61 75 6c 74 | 20 2a 2f 0a 0a 09 2f 2a | default| */.../*|
|00003ff0| 20 73 65 74 20 75 70 20 | 74 68 65 20 70 72 65 73 | set up |the pres|
|00004000| 73 75 72 65 20 73 63 61 | 6c 65 73 20 2a 2f 0a 0a |sure sca|les */..|
|00004010| 09 66 6f 72 20 28 69 3d | 31 3b 20 69 3c 31 31 3b |.for (i=|1; i<11;|
|00004020| 20 69 2b 2b 29 20 7b 0a | 09 09 73 70 72 69 6e 74 | i++) {.|..sprint|
|00004030| 66 28 62 75 66 2c 22 25 | 33 64 7c 22 2c 28 69 6e |f(buf,"%|3d|",(in|
|00004040| 74 29 28 69 2a 31 30 2a | 75 63 66 29 29 3b 0a 09 |t)(i*10*|ucf));..|
|00004050| 09 73 74 72 63 61 74 28 | 73 63 61 6c 65 31 30 30 |.strcat(|scale100|
|00004060| 46 53 57 41 2c 62 75 66 | 29 3b 0a 09 09 73 70 72 |FSWA,buf|);...spr|
|00004070| 69 6e 74 66 28 62 75 66 | 2c 22 25 33 64 7c 22 2c |intf(buf|,"%3d|",|
|00004080| 28 69 6e 74 29 28 69 2a | 32 30 2a 75 63 66 29 29 |(int)(i*|20*ucf))|
|00004090| 3b 0a 09 09 73 74 72 63 | 61 74 28 73 63 61 6c 65 |;...strc|at(scale|
|000040a0| 32 30 30 46 53 57 41 2c | 62 75 66 29 3b 0a 09 7d |200FSWA,|buf);..}|
|000040b0| 0a 0a 09 73 70 72 69 6e | 74 66 28 62 75 66 2c 22 |...sprin|tf(buf,"|
|000040c0| 20 20 25 73 20 73 65 61 | 20 77 61 74 65 72 20 61 | %s sea| water a|
|000040d0| 62 73 2e 22 2c 20 75 6e | 69 74 73 74 72 29 3b 0a |bs.", un|itstr);.|
|000040e0| 09 73 74 72 63 61 74 28 | 73 63 61 6c 65 31 30 30 |.strcat(|scale100|
|000040f0| 46 53 57 41 2c 62 75 66 | 29 3b 0a 09 73 74 72 63 |FSWA,buf|);..strc|
|00004100| 61 74 28 73 63 61 6c 65 | 32 30 30 46 53 57 41 2c |at(scale|200FSWA,|
|00004110| 62 75 66 29 3b 0a 0a 09 | 2f 2a 20 72 65 61 64 20 |buf);...|/* read |
|00004120| 69 6e 20 74 68 65 20 63 | 6f 6d 70 75 74 65 72 20 |in the c|omputer |
|00004130| 6d 6f 64 65 6c 20 2a 2f | 0a 0a 09 6e 20 3d 20 30 |model */|...n = 0|
|00004140| 3b 0a 09 77 68 69 6c 65 | 28 66 73 63 61 6e 66 28 |;..while|(fscanf(|
|00004150| 6d 6f 64 65 6c 2c 20 22 | 25 66 20 25 66 22 2c 20 |model, "|%f %f", |
|00004160| 26 68 61 6c 66 5b 6e 5d | 2c 20 26 4d 76 61 6c 75 |&half[n]|, &Mvalu|
|00004170| 65 73 5b 6e 5d 29 20 21 | 3d 20 45 4f 46 29 20 7b |es[n]) !|= EOF) {|
|00004180| 0a 09 09 4b 76 61 6c 75 | 65 73 5b 6e 5d 20 3d 20 |...Kvalu|es[n] = |
|00004190| 31 2e 30 20 2d 20 70 6f | 77 28 28 64 6f 75 62 6c |1.0 - po|w((doubl|
|000041a0| 65 29 30 2e 35 2c 20 28 | 64 6f 75 62 6c 65 29 28 |e)0.5, (|double)(|
|000041b0| 73 2f 68 61 6c 66 5b 6e | 5d 29 29 3b 0a 09 09 6e |s/half[n|]));...n|
|000041c0| 2b 2b 3b 0a 09 7d 0a 09 | 66 63 6c 6f 73 65 28 6d |++;..}..|fclose(m|
|000041d0| 6f 64 65 6c 29 3b 0a 0a | 09 69 66 20 28 70 72 6f |odel);..|.if (pro|
|000041e0| 66 69 6c 65 20 26 26 20 | 6f 75 74 66 69 6c 65 29 |file && |outfile)|
|000041f0| 20 7b 0a 09 09 66 70 72 | 69 6e 74 66 28 73 74 64 | {...fpr|intf(std|
|00004200| 65 72 72 2c 22 2d 6f 20 | 6f 70 74 69 6f 6e 20 63 |err,"-o |option c|
|00004210| 61 6e 20 6f 6e 6c 79 20 | 62 65 20 75 73 65 64 20 |an only |be used |
|00004220| 69 6e 20 69 6e 74 65 72 | 61 63 74 69 76 65 20 6d |in inter|active m|
|00004230| 6f 64 65 2e 5c 6e 22 29 | 3b 0a 09 09 65 78 69 74 |ode.\n")|;...exit|
|00004240| 28 31 29 3b 0a 09 7d 0a | 0a 09 2f 2a 20 70 75 74 |(1);..}.|../* put|
|00004250| 20 74 68 65 20 64 65 70 | 74 68 20 75 6e 69 74 20 | the dep|th unit |
|00004260| 69 6e 74 6f 20 74 68 65 | 20 6f 75 74 66 69 6c 65 |into the| outfile|
|00004270| 20 69 66 20 74 68 65 72 | 65 20 69 73 20 6f 6e 65 | if ther|e is one|
|00004280| 20 2a 2f 0a 0a 09 69 66 | 20 28 6f 75 74 66 69 6c | */...if| (outfil|
|00004290| 65 29 20 66 70 72 69 6e | 74 66 28 6f 75 74 66 69 |e) fprin|tf(outfi|
|000042a0| 6c 65 2c 22 75 3a 25 73 | 3a 25 2e 34 66 5c 6e 22 |le,"u:%s|:%.4f\n"|
|000042b0| 2c 75 6e 69 74 73 74 72 | 2c 75 63 66 29 3b 0a 0a |,unitstr|,ucf);..|
|000042c0| 09 2f 2a 20 49 66 20 6c | 6f 67 67 69 6e 67 2c 20 |./* If l|ogging, |
|000042d0| 77 72 69 74 65 20 74 68 | 65 20 68 65 61 64 65 72 |write th|e header|
|000042e0| 20 69 6e 74 6f 20 74 68 | 65 20 6c 6f 67 66 69 6c | into th|e logfil|
|000042f0| 65 20 2a 2f 0a 0a 09 69 | 66 20 28 6c 6f 67 66 69 |e */...i|f (logfi|
|00004300| 6c 65 29 20 7b 0a 09 09 | 66 70 72 69 6e 74 66 28 |le) {...|fprintf(|
|00004310| 6c 6f 67 66 69 6c 65 2c | 22 4d 6f 64 65 6c 3a 20 |logfile,|"Model: |
|00004320| 25 73 20 20 20 53 61 6d | 70 6c 65 20 70 65 72 69 |%s Sam|ple peri|
|00004330| 6f 64 3a 20 25 66 20 6d | 69 6e 5c 6e 5c 6e 22 2c |od: %f m|in\n\n",|
|00004340| 0a 09 09 09 6d 6e 61 6d | 65 2c 20 73 29 3b 0a 09 |....mnam|e, s);..|
|00004350| 09 69 66 20 28 6c 6f 67 | 6d 6f 64 65 3d 3d 53 48 |.if (log|mode==SH|
|00004360| 4f 57 5f 4c 4f 41 44 49 | 4e 47 29 0a 09 09 09 66 |OW_LOADI|NG)....f|
|00004370| 70 72 69 6e 74 66 28 6c | 6f 67 66 69 6c 65 2c 22 |printf(l|ogfile,"|
|00004380| 44 65 70 74 68 5c 74 25 | 25 20 41 6c 6c 6f 77 65 |Depth\t%|% Allowe|
|00004390| 64 20 4e 69 74 72 6f 67 | 65 6e 5c 6e 28 25 73 29 |d Nitrog|en\n(%s)|
|000043a0| 5c 74 22 2c 0a 09 09 09 | 09 75 6e 69 74 73 74 72 |\t",....|.unitstr|
|000043b0| 29 3b 0a 09 09 65 6c 73 | 65 20 66 70 72 69 6e 74 |);...els|e fprint|
|000043c0| 66 28 6c 6f 67 66 69 6c | 65 2c 22 44 65 70 74 68 |f(logfil|e,"Depth|
|000043d0| 5c 74 43 6f 6d 70 61 72 | 74 6d 65 6e 74 20 70 72 |\tCompar|tment pr|
|000043e0| 65 73 73 75 72 65 73 20 | 28 25 73 20 73 65 61 20 |essures |(%s sea |
|000043f0| 77 61 74 65 72 20 61 62 | 73 2e 29 5c 6e 28 25 73 |water ab|s.)\n(%s|
|00004400| 29 5c 74 22 2c 20 75 6e | 69 74 73 74 72 2c 20 75 |)\t", un|itstr, u|
|00004410| 6e 69 74 73 74 72 29 3b | 0a 09 09 66 6f 72 20 28 |nitstr);|...for (|
|00004420| 69 3d 30 3b 20 69 3c 6e | 3b 20 69 2b 2b 29 20 66 |i=0; i<n|; i++) f|
|00004430| 70 72 69 6e 74 66 28 6c | 6f 67 66 69 6c 65 2c 22 |printf(l|ogfile,"|
|00004440| 63 25 30 32 64 20 20 20 | 22 2c 69 2b 31 29 3b 0a |c%02d |",i+1);.|
|00004450| 09 09 66 70 72 69 6e 74 | 66 28 6c 6f 67 66 69 6c |..fprint|f(logfil|
|00004460| 65 2c 22 5c 6e 22 29 3b | 0a 09 7d 0a 0a 09 2f 2a |e,"\n");|..}.../*|
|00004470| 20 64 65 74 65 72 6d 69 | 6e 65 20 74 68 65 20 64 | determi|ne the d|
|00004480| 65 70 74 68 20 69 6e 63 | 72 65 6d 65 6e 74 20 75 |epth inc|rement u|
|00004490| 73 65 64 20 69 6e 20 74 | 68 65 20 70 72 6f 66 69 |sed in t|he profi|
|000044a0| 6c 65 20 64 69 73 70 6c | 61 79 20 2a 2f 0a 0a 09 |le displ|ay */...|
|000044b0| 66 6f 72 20 28 64 69 3d | 75 63 66 2a 35 3b 20 75 |for (di=|ucf*5; u|
|000044c0| 63 66 2a 32 30 30 2f 64 | 69 20 3e 20 6c 69 6e 65 |cf*200/d|i > line|
|000044d0| 73 2d 6e 2d 34 3b 20 64 | 69 2b 3d 75 63 66 2a 35 |s-n-4; d|i+=ucf*5|
|000044e0| 29 3b 0a 0a 09 2f 2a 20 | 69 6e 69 74 69 61 6c 69 |);.../* |initiali|
|000044f0| 7a 65 20 74 69 73 73 75 | 65 20 4e 32 20 6c 65 76 |ze tissu|e N2 lev|
|00004500| 65 6c 73 20 2a 2f 0a 0a | 09 66 6f 72 20 28 69 3d |els */..|.for (i=|
|00004510| 30 3b 20 69 3c 4e 43 4f | 4d 50 3b 20 69 2b 2b 29 |0; i<NCO|MP; i++)|
|00004520| 20 63 5b 69 5d 20 3d 20 | 4f 4e 45 5f 41 54 4d 5f | c[i] = |ONE_ATM_|
|00004530| 46 53 57 5f 4e 32 3b 0a | 0a 09 2f 2a 20 69 6e 69 |FSW_N2;.|../* ini|
|00004540| 74 69 61 6c 69 7a 65 20 | 74 68 65 20 64 69 73 70 |tialize |the disp|
|00004550| 6c 61 79 20 2a 2f 0a 0a | 09 69 6e 69 74 5f 64 69 |lay */..|.init_di|
|00004560| 73 70 6c 61 79 28 29 3b | 0a 09 75 70 64 61 74 65 |splay();|..update|
|00004570| 5f 64 69 73 70 6c 61 79 | 28 29 3b 0a 0a 09 66 6f |_display|();...fo|
|00004580| 72 20 28 3b 3b 29 20 7b | 0a 0a 09 09 67 65 74 5f |r (;;) {|....get_|
|00004590| 73 61 6d 70 6c 65 28 29 | 3b 0a 0a 09 09 2f 2a 20 |sample()|;..../* |
|000045a0| 75 70 64 61 74 65 20 74 | 69 6d 65 20 76 61 6c 75 |update t|ime valu|
|000045b0| 65 73 20 2a 2f 0a 0a 09 | 09 69 66 20 28 64 65 70 |es */...|.if (dep|
|000045c0| 74 68 20 3e 20 33 29 20 | 7b 0a 0a 09 09 09 2f 2a |th > 3) |{...../*|
|000045d0| 20 61 6c 6c 20 64 65 70 | 74 68 73 20 3e 33 66 74 | all dep|ths >3ft|
|000045e0| 20 61 72 65 20 63 6f 75 | 6e 74 65 64 20 61 73 20 | are cou|nted as |
|000045f0| 62 6f 74 74 6f 6d 20 74 | 69 6d 65 20 2a 2f 0a 0a |bottom t|ime */..|
|00004600| 09 09 09 69 66 20 28 28 | 73 69 20 3e 20 30 2e 30 |...if ((|si > 0.0|
|00004610| 29 20 26 26 20 28 73 69 | 20 3c 20 35 2e 30 29 29 |) && (si| < 5.0))|
|00004620| 20 7b 0a 0a 09 09 09 09 | 2f 2a 20 57 65 20 6d 75 | {......|/* We mu|
|00004630| 73 74 20 61 63 63 6f 75 | 6e 74 20 66 6f 72 20 62 |st accou|nt for b|
|00004640| 72 69 65 66 20 70 65 72 | 69 6f 64 73 20 6f 66 0a |rief per|iods of.|
|00004650| 09 09 09 09 73 75 72 66 | 61 63 69 6e 67 20 64 75 |....surf|acing du|
|00004660| 72 69 6e 67 20 74 68 65 | 20 64 69 76 65 2e 20 54 |ring the| dive. T|
|00004670| 68 65 20 73 75 72 66 61 | 63 65 0a 09 09 09 09 69 |he surfa|ce.....i|
|00004680| 6e 74 65 72 76 61 6c 20 | 63 6f 75 6e 74 65 72 20 |nterval |counter |
|00004690| 73 74 61 72 74 73 20 69 | 6d 6d 65 64 69 61 74 65 |starts i|mmediate|
|000046a0| 6c 79 20 75 70 6f 6e 0a | 09 09 09 09 61 73 63 65 |ly upon.|....asce|
|000046b0| 6e 64 69 6e 67 20 74 6f | 20 64 65 70 74 68 73 20 |nding to| depths |
|000046c0| 73 68 61 6c 6c 6f 77 65 | 72 20 74 68 61 6e 20 33 |shallowe|r than 3|
|000046d0| 0a 09 09 09 09 66 65 65 | 74 2c 20 79 65 74 20 69 |.....fee|t, yet i|
|000046e0| 66 20 74 68 65 20 64 69 | 76 65 72 20 72 65 74 75 |f the di|ver retu|
|000046f0| 72 6e 73 20 74 6f 20 64 | 65 70 74 68 73 0a 09 09 |rns to d|epths...|
|00004700| 09 09 64 65 65 70 65 72 | 20 74 68 61 6e 20 33 20 |..deeper| than 3 |
|00004710| 66 65 65 74 20 77 69 74 | 68 69 6e 20 35 20 6d 69 |feet wit|hin 5 mi|
|00004720| 6e 75 74 65 73 2c 20 74 | 68 65 0a 09 09 09 09 74 |nutes, t|he.....t|
|00004730| 69 6d 65 20 65 6c 61 70 | 73 65 64 20 61 73 20 73 |ime elap|sed as s|
|00004740| 75 72 66 61 63 65 20 69 | 6e 74 65 72 76 61 6c 20 |urface i|nterval |
|00004750| 6d 75 73 74 20 62 65 0a | 09 09 09 09 61 64 64 65 |must be.|....adde|
|00004760| 64 20 69 6e 74 6f 20 74 | 68 65 20 62 6f 74 74 6f |d into t|he botto|
|00004770| 6d 20 74 69 6d 65 20 76 | 61 6c 75 65 2c 20 61 6e |m time v|alue, an|
|00004780| 64 0a 09 09 09 09 74 68 | 65 20 73 75 72 66 61 63 |d.....th|e surfac|
|00004790| 65 20 69 6e 74 65 72 76 | 61 6c 20 72 65 73 65 74 |e interv|al reset|
|000047a0| 20 74 6f 20 30 20 2a 2f | 0a 0a 09 09 09 09 62 74 | to 0 */|......bt|
|000047b0| 20 2b 3d 20 73 69 20 2b | 20 73 3b 0a 09 09 09 09 | += si +| s;.....|
|000047c0| 73 69 20 3d 20 30 2e 30 | 3b 0a 09 09 09 7d 0a 09 |si = 0.0|;....}..|
|000047d0| 09 09 65 6c 73 65 20 69 | 66 20 28 73 69 20 3d 3d |..else i|f (si ==|
|000047e0| 20 30 2e 30 29 20 62 74 | 2b 3d 73 3b 20 2f 2a 20 | 0.0) bt|+=s; /* |
|000047f0| 6e 6f 20 69 6e 74 65 72 | 6d 65 64 69 61 74 65 0a |no inter|mediate.|
|00004800| 09 09 09 09 09 09 20 20 | 20 73 75 72 66 61 63 65 |...... | surface|
|00004810| 20 69 6e 74 65 72 76 61 | 6c 20 74 6f 0a 09 09 09 | interva|l to....|
|00004820| 09 09 09 20 20 20 61 63 | 63 6f 75 6e 74 20 66 6f |... ac|count fo|
|00004830| 72 20 2a 2f 0a 0a 09 09 | 09 65 6c 73 65 20 69 66 |r */....|.else if|
|00004840| 20 28 73 69 20 3e 20 35 | 2e 30 29 20 7b 09 20 20 | (si > 5|.0) {. |
|00004850| 20 2f 2a 20 65 6c 73 65 | 20 74 68 65 20 64 69 76 | /* else| the div|
|00004860| 65 72 20 68 61 73 0a 09 | 09 09 09 09 09 20 20 20 |er has..|..... |
|00004870| 62 65 65 6e 20 6f 6e 20 | 74 68 65 20 73 75 72 66 |been on |the surf|
|00004880| 61 63 65 0a 09 09 09 09 | 09 09 20 20 20 66 6f 72 |ace.....|.. for|
|00004890| 20 6d 6f 72 65 20 74 68 | 61 6e 20 35 0a 09 09 09 | more th|an 5....|
|000048a0| 09 09 09 20 20 20 6d 69 | 6e 75 74 65 73 2c 20 73 |... mi|nutes, s|
|000048b0| 6f 20 77 65 20 74 72 65 | 61 74 0a 09 09 09 09 09 |o we tre|at......|
|000048c0| 09 20 20 20 74 68 69 73 | 20 61 73 20 61 20 6e 65 |. this| as a ne|
|000048d0| 77 20 64 69 76 65 0a 09 | 09 09 09 09 09 20 20 20 |w dive..|..... |
|000048e0| 2a 2f 0a 09 09 09 09 64 | 69 76 65 2b 2b 3b 0a 09 |*/.....d|ive++;..|
|000048f0| 09 09 09 62 74 3d 73 3b | 0a 09 09 09 09 73 69 3d |...bt=s;|.....si=|
|00004900| 30 2e 30 3b 0a 09 09 09 | 7d 0a 09 09 7d 0a 09 09 |0.0;....|}...}...|
|00004910| 65 6c 73 65 20 73 69 2b | 3d 73 3b 20 2f 2a 20 65 |else si+|=s; /* e|
|00004920| 6c 73 65 20 74 68 65 20 | 64 69 76 65 72 20 69 73 |lse the |diver is|
|00004930| 20 73 74 69 6c 6c 20 73 | 68 61 6c 6c 6f 77 65 72 | still s|hallower|
|00004940| 20 74 68 61 6e 0a 09 09 | 09 20 20 20 20 33 20 66 | than...|. 3 f|
|00004950| 65 65 74 3b 20 75 70 64 | 61 74 65 20 74 68 65 20 |eet; upd|ate the |
|00004960| 73 75 72 66 61 63 65 20 | 69 6e 74 65 72 76 61 6c |surface |interval|
|00004970| 20 63 6f 75 6e 74 65 72 | 0a 09 09 09 20 20 20 20 | counter|.... |
|00004980| 2a 2f 0a 09 09 73 61 6d | 70 6c 65 73 2b 2b 3b 0a |*/...sam|ples++;.|
|00004990| 0a 09 09 2f 2a 20 75 70 | 64 61 74 65 20 61 6d 62 |.../* up|date amb|
|000049a0| 69 65 6e 74 20 4e 32 20 | 70 72 65 73 73 75 72 65 |ient N2 |pressure|
|000049b0| 20 2a 2f 0a 0a 09 09 61 | 70 6e 32 20 3d 20 50 4e | */....a|pn2 = PN|
|000049c0| 32 2a 28 64 65 70 74 68 | 2b 4f 4e 45 5f 41 54 4d |2*(depth|+ONE_ATM|
|000049d0| 5f 46 53 57 29 3b 0a 0a | 09 09 2f 2a 20 75 70 64 |_FSW);..|../* upd|
|000049e0| 61 74 65 20 74 69 73 73 | 75 65 20 28 63 6f 6d 70 |ate tiss|ue (comp|
|000049f0| 61 72 74 6d 65 6e 74 29 | 20 4e 32 20 6c 65 76 65 |artment)| N2 leve|
|00004a00| 6c 73 20 2a 2f 0a 0a 09 | 09 75 70 64 61 74 65 5f |ls */...|.update_|
|00004a10| 74 69 73 73 75 65 73 28 | 29 3b 0a 0a 09 09 2f 2a |tissues(|);..../*|
|00004a20| 20 63 68 65 63 6b 20 69 | 66 20 74 68 65 72 65 20 | check i|f there |
|00004a30| 68 61 73 20 62 65 65 6e | 20 61 20 63 68 61 72 61 |has been| a chara|
|00004a40| 63 74 65 72 20 69 6e 70 | 75 74 20 2a 2f 0a 0a 09 |cter inp|ut */...|
|00004a50| 09 73 77 69 74 63 68 20 | 28 67 65 74 63 68 28 29 |.switch |(getch()|
|00004a60| 29 20 7b 0a 09 09 09 63 | 61 73 65 20 27 74 27 3a |) {....c|ase 't':|
|00004a70| 0a 09 09 09 09 6d 6f 64 | 65 20 3d 0a 09 09 09 09 |.....mod|e =.....|
|00004a80| 20 20 20 28 6d 6f 64 65 | 3d 3d 53 48 4f 57 5f 4c | (mode|==SHOW_L|
|00004a90| 4f 41 44 49 4e 47 3f 53 | 48 4f 57 5f 46 53 57 41 |OADING?S|HOW_FSWA|
|00004aa0| 3a 53 48 4f 57 5f 4c 4f | 41 44 49 4e 47 29 3b 0a |:SHOW_LO|ADING);.|
|00004ab0| 09 09 09 09 62 72 65 61 | 6b 3b 0a 0a 09 09 09 63 |....brea|k;.....c|
|00004ac0| 61 73 65 20 27 71 27 3a | 0a 09 09 09 09 64 65 63 |ase 'q':|.....dec|
|00004ad0| 6f 6d 6f 64 65 20 3d 20 | 30 3b 20 2f 2a 20 72 65 |omode = |0; /* re|
|00004ae0| 73 65 74 20 76 61 72 73 | 20 74 68 61 74 20 63 61 |set vars| that ca|
|00004af0| 75 73 65 20 2a 2f 0a 09 | 09 09 09 64 75 72 61 74 |use */..|...durat|
|00004b00| 69 6f 6e 20 3d 20 30 3b | 20 2f 2a 20 63 6f 6e 74 |ion = 0;| /* cont|
|00004b10| 69 6e 75 6f 75 73 20 63 | 61 6c 63 75 6c 61 74 69 |inuous c|alculati|
|00004b20| 6f 6e 20 2a 2f 0a 09 09 | 09 09 62 72 65 61 6b 3b |on */...|..break;|
|00004b30| 0a 0a 09 09 09 63 61 73 | 65 20 4b 45 59 5f 44 4f |.....cas|e KEY_DO|
|00004b40| 57 4e 3a 0a 09 09 09 09 | 64 65 70 74 68 20 2b 3d |WN:.....|depth +=|
|00004b50| 20 64 69 3b 0a 09 09 09 | 09 62 72 65 61 6b 3b 0a | di;....|.break;.|
|00004b60| 0a 09 09 09 63 61 73 65 | 20 4b 45 59 5f 55 50 3a |....case| KEY_UP:|
|00004b70| 0a 09 09 09 09 64 65 70 | 74 68 20 2d 3d 20 64 69 |.....dep|th -= di|
|00004b80| 3b 0a 09 09 09 09 62 72 | 65 61 6b 3b 0a 09 09 7d |;.....br|eak;...}|
|00004b90| 0a 0a 09 09 2f 2a 20 72 | 65 70 61 69 6e 74 20 74 |..../* r|epaint t|
|00004ba0| 68 65 20 64 69 73 70 6c | 61 79 20 2a 2f 0a 0a 09 |he displ|ay */...|
|00004bb0| 09 75 70 64 61 74 65 5f | 64 69 73 70 6c 61 79 28 |.update_|display(|
|00004bc0| 29 3b 0a 09 09 75 70 64 | 61 74 65 5f 64 69 76 65 |);...upd|ate_dive|
|00004bd0| 5f 70 72 6f 66 69 6c 65 | 28 29 3b 0a 09 09 72 65 |_profile|();...re|
|00004be0| 66 72 65 73 68 28 29 3b | 0a 0a 09 09 2f 2a 20 69 |fresh();|..../* i|
|00004bf0| 66 20 6c 6f 67 67 69 6e | 67 2c 20 77 72 69 74 65 |f loggin|g, write|
|00004c00| 20 65 6e 74 72 79 20 2a | 2f 0a 0a 09 09 69 66 20 | entry *|/....if |
|00004c10| 28 6c 6f 67 66 69 6c 65 | 29 20 7b 0a 09 09 09 66 |(logfile|) {....f|
|00004c20| 70 72 69 6e 74 66 28 6c | 6f 67 66 69 6c 65 2c 22 |printf(l|ogfile,"|
|00004c30| 25 2e 31 66 5c 74 22 2c | 20 75 63 66 2a 64 65 70 |%.1f\t",| ucf*dep|
|00004c40| 74 68 29 3b 0a 09 09 09 | 66 6f 72 20 28 69 3d 30 |th);....|for (i=0|
|00004c50| 3b 20 69 3c 6e 3b 20 69 | 2b 2b 29 20 7b 0a 09 09 |; i<n; i|++) {...|
|00004c60| 09 09 69 66 20 28 6c 6f | 67 6d 6f 64 65 20 3d 3d |..if (lo|gmode ==|
|00004c70| 20 53 48 4f 57 5f 4c 4f | 41 44 49 4e 47 29 0a 09 | SHOW_LO|ADING)..|
|00004c80| 09 09 09 09 66 70 72 69 | 6e 74 66 28 6c 6f 67 66 |....fpri|ntf(logf|
|00004c90| 69 6c 65 2c 22 25 2d 35 | 64 20 22 2c 0a 09 09 09 |ile,"%-5|d ",....|
|00004ca0| 09 09 09 28 69 6e 74 29 | 28 31 30 30 2a 6c 6f 61 |...(int)|(100*loa|
|00004cb0| 64 69 6e 67 28 69 29 29 | 29 3b 0a 09 09 09 09 65 |ding(i))|);.....e|
|00004cc0| 6c 73 65 20 66 70 72 69 | 6e 74 66 28 6c 6f 67 66 |lse fpri|ntf(logf|
|00004cd0| 69 6c 65 2c 22 25 2d 35 | 2e 31 66 20 22 2c 20 63 |ile,"%-5|.1f ", c|
|00004ce0| 5b 69 5d 29 3b 0a 09 09 | 09 7d 0a 09 09 09 66 70 |[i]);...|.}....fp|
|00004cf0| 72 69 6e 74 66 28 6c 6f | 67 66 69 6c 65 2c 22 5c |rintf(lo|gfile,"\|
|00004d00| 6e 22 29 3b 0a 09 09 7d | 0a 09 7d 0a 7d 0a 0a 75 |n");...}|..}.}..u|
|00004d10| 70 64 61 74 65 5f 64 69 | 73 70 6c 61 79 28 29 0a |pdate_di|splay().|
|00004d20| 7b 0a 09 2f 2a 20 75 70 | 64 61 74 65 20 74 68 65 |{../* up|date the|
|00004d30| 20 73 74 61 74 73 20 6c | 69 6e 65 20 66 69 72 73 | stats l|ine firs|
|00004d40| 74 2e 20 53 69 6e 63 65 | 20 74 68 65 20 63 6f 6e |t. Since| the con|
|00004d50| 74 72 6f 6c 6c 69 6e 67 | 20 74 69 73 73 75 65 20 |trolling| tissue |
|00004d60| 69 73 0a 09 66 6f 75 6e | 64 20 69 6e 20 74 68 65 |is..foun|d in the|
|00004d70| 20 6e 64 6c 28 29 20 72 | 6f 75 74 69 6e 65 20 77 | ndl() r|outine w|
|00004d80| 68 69 63 68 20 69 73 20 | 63 61 6c 6c 65 64 20 62 |hich is |called b|
|00004d90| 79 20 74 68 65 20 75 70 | 64 61 74 65 5f 73 74 61 |y the up|date_sta|
|00004da0| 74 73 28 29 0a 09 72 6f | 75 74 69 6e 65 2c 20 69 |ts()..ro|utine, i|
|00004db0| 74 20 6d 75 73 74 20 62 | 65 20 63 61 6c 6c 65 64 |t must b|e called|
|00004dc0| 20 62 65 66 6f 72 65 20 | 74 68 65 20 74 69 73 73 | before |the tiss|
|00004dd0| 75 65 20 67 72 61 70 68 | 20 69 73 20 72 65 70 61 |ue graph| is repa|
|00004de0| 69 6e 74 65 64 2e 0a 09 | 2a 2f 0a 0a 09 75 70 64 |inted...|*/...upd|
|00004df0| 61 74 65 5f 73 74 61 74 | 73 28 29 3b 0a 09 75 70 |ate_stat|s();..up|
|00004e00| 64 61 74 65 5f 6e 64 6c | 5f 6c 69 6d 69 74 73 28 |date_ndl|_limits(|
|00004e10| 29 3b 0a 0a 09 69 66 20 | 28 6d 6f 64 65 20 3d 3d |);...if |(mode ==|
|00004e20| 20 53 48 4f 57 5f 4c 4f | 41 44 49 4e 47 29 20 64 | SHOW_LO|ADING) d|
|00004e30| 69 73 70 6c 61 79 5f 6c | 6f 61 64 69 6e 67 28 29 |isplay_l|oading()|
|00004e40| 3b 0a 09 65 6c 73 65 20 | 64 69 73 70 6c 61 79 5f |;..else |display_|
|00004e50| 66 73 77 61 28 29 3b 0a | 7d 0a 0a 75 70 64 61 74 |fswa();.|}..updat|
|00004e60| 65 5f 74 69 73 73 75 65 | 73 28 29 0a 7b 0a 09 69 |e_tissue|s().{..i|
|00004e70| 6e 74 20 69 3b 0a 0a 09 | 66 6f 72 20 28 69 3d 30 |nt i;...|for (i=0|
|00004e80| 3b 20 69 3c 6e 3b 20 69 | 2b 2b 29 20 2f 2a 20 6e |; i<n; i|++) /* n|
|00004e90| 20 3d 3d 20 6e 75 6d 62 | 65 72 20 6f 66 20 63 6f | == numb|er of co|
|00004ea0| 6d 70 61 72 74 6d 65 6e | 74 73 20 2a 2f 0a 09 09 |mpartmen|ts */...|
|00004eb0| 63 5b 69 5d 20 3d 20 63 | 5b 69 5d 20 2b 20 28 61 |c[i] = c|[i] + (a|
|00004ec0| 70 6e 32 20 2d 20 63 5b | 69 5d 29 2a 4b 76 61 6c |pn2 - c[|i])*Kval|
|00004ed0| 75 65 73 5b 69 5d 3b 0a | 7d 0a 0a 75 70 64 61 74 |ues[i];.|}..updat|
|00004ee0| 65 5f 73 74 61 74 73 28 | 29 0a 7b 0a 09 69 6e 74 |e_stats(|).{..int|
|00004ef0| 20 6c 69 6d 69 74 3b 0a | 09 66 6c 6f 61 74 20 74 | limit;.|.float t|
|00004f00| 69 6d 65 5f 74 6f 5f 73 | 75 72 66 61 63 65 28 29 |ime_to_s|urface()|
|00004f10| 3b 0a 09 63 68 61 72 20 | 2a 73 68 6f 77 74 69 6d |;..char |*showtim|
|00004f20| 65 28 29 2c 20 62 75 66 | 31 5b 31 36 5d 2c 20 62 |e(), buf|1[16], b|
|00004f30| 75 66 32 5b 31 36 5d 2c | 20 62 75 66 33 5b 31 36 |uf2[16],| buf3[16|
|00004f40| 5d 3b 0a 0a 09 6d 6f 76 | 65 28 6e 2b 32 2c 31 35 |];...mov|e(n+2,15|
|00004f50| 29 3b 0a 09 63 6c 72 74 | 6f 65 6f 6c 28 29 3b 0a |);..clrt|oeol();.|
|00004f60| 09 6c 69 6d 69 74 20 3d | 20 6e 64 6c 28 61 70 6e |.limit =| ndl(apn|
|00004f70| 32 29 3b 0a 0a 09 73 70 | 72 69 6e 74 66 28 62 75 |2);...sp|rintf(bu|
|00004f80| 66 2c 20 22 44 69 76 65 | 3a 20 25 64 20 20 44 65 |f, "Dive|: %d De|
|00004f90| 70 74 68 3a 20 25 2e 31 | 66 20 25 73 20 20 42 54 |pth: %.1|f %s BT|
|00004fa0| 3a 20 25 73 22 2c 0a 09 | 09 64 69 76 65 2c 20 75 |: %s",..|.dive, u|
|00004fb0| 63 66 2a 64 65 70 74 68 | 2c 20 75 6e 69 74 73 74 |cf*depth|, unitst|
|00004fc0| 72 2c 20 20 73 68 6f 77 | 74 69 6d 65 28 62 75 66 |r, show|time(buf|
|00004fd0| 31 2c 62 74 29 29 3b 0a | 09 61 64 64 73 74 72 28 |1,bt));.|.addstr(|
|00004fe0| 62 75 66 29 3b 0a 09 6d | 6f 76 65 28 6e 2b 33 2c |buf);..m|ove(n+3,|
|00004ff0| 31 35 29 3b 0a 09 63 6c | 72 74 6f 65 6f 6c 28 29 |15);..cl|rtoeol()|
|00005000| 3b 0a 09 69 66 20 28 6c | 69 6d 69 74 20 3e 3d 20 |;..if (l|imit >= |
|00005010| 30 29 20 7b 0a 09 09 73 | 70 72 69 6e 74 66 28 62 |0) {...s|printf(b|
|00005020| 75 66 2c 22 4e 44 4c 3a | 20 25 73 20 20 53 66 63 |uf,"NDL:| %s Sfc|
|00005030| 20 49 6e 74 3a 20 25 73 | 22 2c 0a 09 09 09 73 68 | Int: %s|",....sh|
|00005040| 6f 77 74 69 6d 65 28 62 | 75 66 32 2c 28 66 6c 6f |owtime(b|uf2,(flo|
|00005050| 61 74 29 6c 69 6d 69 74 | 29 2c 20 73 68 6f 77 74 |at)limit|), showt|
|00005060| 69 6d 65 28 62 75 66 33 | 2c 73 69 29 29 3b 0a 09 |ime(buf3|,si));..|
|00005070| 09 61 64 64 73 74 72 28 | 62 75 66 29 3b 0a 09 7d |.addstr(|buf);..}|
|00005080| 0a 09 65 6c 73 65 20 7b | 0a 09 09 61 74 74 72 6f |..else {|...attro|
|00005090| 6e 28 41 5f 52 45 56 45 | 52 53 45 29 3b 0a 09 09 |n(A_REVE|RSE);...|
|000050a0| 73 70 72 69 6e 74 66 28 | 62 75 66 2c 22 43 65 69 |sprintf(|buf,"Cei|
|000050b0| 6c 69 6e 67 3a 20 25 2e | 31 66 20 25 73 22 2c 20 |ling: %.|1f %s", |
|000050c0| 75 63 66 2a 63 65 69 6c | 69 6e 67 2c 0a 09 09 09 |ucf*ceil|ing,....|
|000050d0| 75 6e 69 74 73 74 72 29 | 3b 0a 09 09 61 64 64 73 |unitstr)|;...adds|
|000050e0| 74 72 28 62 75 66 29 3b | 0a 09 09 73 70 72 69 6e |tr(buf);|...sprin|
|000050f0| 74 66 28 62 75 66 2c 22 | 20 54 69 6d 65 20 74 6f |tf(buf,"| Time to|
|00005100| 20 73 75 72 66 61 63 65 | 3a 20 25 73 22 2c 0a 09 | surface|: %s",..|
|00005110| 09 09 73 68 6f 77 74 69 | 6d 65 28 62 75 66 31 2c |..showti|me(buf1,|
|00005120| 74 69 6d 65 5f 74 6f 5f | 73 75 72 66 61 63 65 28 |time_to_|surface(|
|00005130| 29 29 29 3b 0a 09 09 61 | 64 64 73 74 72 28 62 75 |)));...a|ddstr(bu|
|00005140| 66 29 3b 0a 09 09 61 74 | 74 72 6f 66 66 28 41 5f |f);...at|troff(A_|
|00005150| 52 45 56 45 52 53 45 29 | 3b 0a 09 7d 0a 7d 0a 0a |REVERSE)|;..}.}..|
|00005160| 75 70 64 61 74 65 5f 64 | 69 76 65 5f 70 72 6f 66 |update_d|ive_prof|
|00005170| 69 6c 65 28 29 0a 7b 0a | 09 69 6e 74 20 69 2c 20 |ile().{.|.int i, |
|00005180| 6a 2c 20 78 2c 20 79 3b | 0a 0a 09 2f 2a 20 75 70 |j, x, y;|.../* up|
|00005190| 64 61 74 65 20 74 68 65 | 20 64 69 76 65 20 70 72 |date the| dive pr|
|000051a0| 6f 66 69 6c 65 20 64 69 | 73 70 6c 61 79 20 2a 2f |ofile di|splay */|
|000051b0| 0a 0a 09 69 66 20 28 73 | 61 6d 70 6c 65 73 2f 63 |...if (s|amples/c|
|000051c0| 66 20 3e 20 36 30 29 20 | 7b 0a 0a 09 09 2f 2a 20 |f > 60) |{..../* |
|000051d0| 65 72 61 73 65 20 61 6e | 64 20 63 6f 6d 70 72 65 |erase an|d compre|
|000051e0| 73 73 20 64 69 73 70 6c | 61 79 20 2a 2f 0a 0a 09 |ss displ|ay */...|
|000051f0| 09 66 6f 72 20 28 69 3d | 6e 2b 35 3b 20 69 3c 6c |.for (i=|n+5; i<l|
|00005200| 69 6e 65 73 3b 20 69 2b | 2b 29 20 7b 0a 09 09 09 |ines; i+|+) {....|
|00005210| 6d 6f 76 65 28 69 2c 31 | 30 29 3b 0a 09 09 09 63 |move(i,1|0);....c|
|00005220| 6c 72 74 6f 65 6f 6c 28 | 29 3b 0a 09 09 7d 0a 0a |lrtoeol(|);...}..|
|00005230| 09 09 63 66 20 2a 3d 32 | 3b 0a 09 09 66 6f 72 20 |..cf *=2|;...for |
|00005240| 28 69 3d 31 3b 20 69 3c | 73 61 6d 70 6c 65 73 3b |(i=1; i<|samples;|
|00005250| 20 69 2b 3d 63 66 29 20 | 7b 0a 09 09 09 78 20 3d | i+=cf) |{....x =|
|00005260| 20 31 30 2b 69 2f 63 66 | 3b 0a 09 09 09 79 20 3d | 10+i/cf|;....y =|
|00005270| 20 6e 2b 35 2b 28 69 6e | 74 29 63 65 69 6c 28 28 | n+5+(in|t)ceil((|
|00005280| 64 6f 75 62 6c 65 29 75 | 63 66 2a 64 65 70 74 68 |double)u|cf*depth|
|00005290| 5f 72 65 63 6f 72 64 5b | 69 5d 2f 64 69 29 3b 0a |_record[|i]/di);.|
|000052a0| 09 09 09 6d 6f 76 65 28 | 28 79 3e 3d 6c 69 6e 65 |...move(|(y>=line|
|000052b0| 73 3f 6c 69 6e 65 73 2d | 31 3a 79 29 2c 78 29 3b |s?lines-|1:y),x);|
|000052c0| 0a 09 09 09 61 64 64 63 | 68 28 28 79 3e 3d 6c 69 |....addc|h((y>=li|
|000052d0| 6e 65 73 3f 27 76 27 3a | 27 2a 27 29 29 3b 0a 09 |nes?'v':|'*'));..|
|000052e0| 09 7d 0a 09 7d 0a 0a 09 | 78 20 3d 20 31 30 2b 73 |.}..}...|x = 10+s|
|000052f0| 61 6d 70 6c 65 73 2f 63 | 66 3b 0a 09 79 20 3d 20 |amples/c|f;..y = |
|00005300| 6e 2b 35 2b 63 65 69 6c | 28 28 64 6f 75 62 6c 65 |n+5+ceil|((double|
|00005310| 29 75 63 66 2a 64 65 70 | 74 68 2f 64 69 29 3b 0a |)ucf*dep|th/di);.|
|00005320| 09 6d 6f 76 65 28 28 79 | 3e 3d 6c 69 6e 65 73 3f |.move((y|>=lines?|
|00005330| 6c 69 6e 65 73 2d 31 3a | 79 29 2c 78 29 3b 0a 09 |lines-1:|y),x);..|
|00005340| 61 64 64 63 68 28 28 79 | 3e 3d 6c 69 6e 65 73 3f |addch((y|>=lines?|
|00005350| 27 76 27 3a 27 2a 27 29 | 29 3b 0a 0a 09 64 65 70 |'v':'*')|);...dep|
|00005360| 74 68 5f 72 65 63 6f 72 | 64 5b 73 61 6d 70 6c 65 |th_recor|d[sample|
|00005370| 73 5d 20 3d 20 64 65 70 | 74 68 3b 0a 7d 0a 0a 75 |s] = dep|th;.}..u|
|00005380| 70 64 61 74 65 5f 6e 64 | 6c 5f 6c 69 6d 69 74 73 |pdate_nd|l_limits|
|00005390| 28 29 0a 7b 0a 09 69 6e | 74 20 69 3b 0a 09 69 6e |().{..in|t i;..in|
|000053a0| 74 20 74 3b 0a 09 66 6c | 6f 61 74 20 64 3b 0a 09 |t t;..fl|oat d;..|
|000053b0| 66 6c 6f 61 74 20 70 3b | 0a 09 63 68 61 72 20 62 |float p;|..char b|
|000053c0| 75 66 5b 31 30 5d 3b 0a | 0a 09 66 6f 72 20 28 69 |uf[10];.|..for (i|
|000053d0| 3d 6e 2b 35 3b 20 69 3c | 6c 69 6e 65 73 3b 20 69 |=n+5; i<|lines; i|
|000053e0| 2b 2b 29 20 7b 0a 09 09 | 64 20 3d 20 28 69 2d 6e |++) {...|d = (i-n|
|000053f0| 2d 35 29 2a 64 69 2f 75 | 63 66 3b 09 09 2f 2a 20 |-5)*di/u|cf;../* |
|00005400| 64 65 70 74 68 20 69 6e | 20 66 65 65 74 20 2a 2f |depth in| feet */|
|00005410| 0a 09 09 70 20 3d 20 30 | 2e 37 39 20 2a 20 28 64 |...p = 0|.79 * (d|
|00005420| 20 2b 20 33 33 2e 30 29 | 3b 09 09 2f 2a 20 70 6e | + 33.0)|;../* pn|
|00005430| 32 20 61 74 20 64 65 70 | 74 68 20 20 2a 2f 0a 09 |2 at dep|th */..|
|00005440| 09 74 20 3d 20 6e 64 6c | 28 70 29 3b 09 09 09 2f |.t = ndl|(p);.../|
|00005450| 2a 20 63 6f 6d 70 75 74 | 65 20 6c 69 6d 69 74 73 |* comput|e limits|
|00005460| 20 2a 2f 0a 09 09 69 66 | 20 28 74 3c 30 29 20 74 | */...if| (t<0) t|
|00005470| 3d 30 3b 0a 0a 09 09 6d | 6f 76 65 28 69 2c 30 29 |=0;....m|ove(i,0)|
|00005480| 3b 0a 09 09 69 66 20 28 | 74 20 3e 3d 20 49 4e 46 |;...if (|t >= INF|
|00005490| 29 20 7b 0a 09 09 09 61 | 64 64 73 74 72 28 22 49 |) {....a|ddstr("I|
|000054a0| 4e 46 22 29 3b 0a 09 09 | 7d 20 65 6c 73 65 20 69 |NF");...|} else i|
|000054b0| 66 20 28 74 20 3e 3d 20 | 31 30 30 30 29 20 7b 0a |f (t >= |1000) {.|
|000054c0| 09 09 09 61 64 64 73 74 | 72 28 22 2a 2a 2a 22 29 |...addst|r("***")|
|000054d0| 3b 0a 09 09 7d 20 65 6c | 73 65 20 69 66 20 28 74 |;...} el|se if (t|
|000054e0| 3e 30 29 20 7b 0a 09 09 | 09 73 70 72 69 6e 74 66 |>0) {...|.sprintf|
|000054f0| 28 62 75 66 2c 22 25 33 | 64 22 2c 74 29 3b 0a 09 |(buf,"%3|d",t);..|
|00005500| 09 09 61 64 64 73 74 72 | 28 62 75 66 29 3b 0a 09 |..addstr|(buf);..|
|00005510| 09 7d 20 65 6c 73 65 20 | 61 64 64 73 74 72 28 22 |.} else |addstr("|
|00005520| 20 20 20 22 29 3b 0a 09 | 7d 0a 09 74 20 3d 20 6e | ");..|}..t = n|
|00005530| 64 6c 28 61 70 6e 32 29 | 3b 20 20 20 20 2f 2a 20 |dl(apn2)|; /* |
|00005540| 6c 65 61 76 65 20 61 6c | 6c 20 74 68 65 20 67 6c |leave al|l the gl|
|00005550| 6f 62 61 6c 73 20 61 74 | 20 74 68 65 20 72 69 67 |obals at| the rig|
|00005560| 68 74 20 76 61 6c 75 65 | 73 20 2a 2f 0a 7d 0a 0a |ht value|s */.}..|
|00005570| 64 69 73 70 6c 61 79 5f | 6c 6f 61 64 69 6e 67 28 |display_|loading(|
|00005580| 29 0a 7b 0a 09 69 6e 74 | 20 69 2c 20 6a 2c 20 6b |).{..int| i, j, k|
|00005590| 2c 20 74 65 6d 70 2c 20 | 6f 76 65 72 3b 0a 09 2f |, temp, |over;../|
|000055a0| 2a 20 69 66 20 6f 76 65 | 72 70 72 65 73 73 75 72 |* if ove|rpressur|
|000055b0| 65 20 6f 6e 20 61 6e 79 | 20 74 69 73 73 75 65 2c |e on any| tissue,|
|000055c0| 20 63 68 61 6e 67 65 20 | 74 68 65 20 73 63 61 6c | change |the scal|
|000055d0| 65 20 74 6f 20 30 20 2d | 20 32 30 30 25 20 2a 2f |e to 0 -| 200% */|
|000055e0| 0a 0a 09 66 6f 72 20 28 | 6f 76 65 72 3d 69 3d 30 |...for (|over=i=0|
|000055f0| 3b 20 69 3c 6e 3b 20 69 | 2b 2b 29 20 69 66 20 28 |; i<n; i|++) if (|
|00005600| 63 5b 69 5d 20 3e 20 4d | 76 61 6c 75 65 73 5b 69 |c[i] > M|values[i|
|00005610| 5d 29 20 6f 76 65 72 3d | 31 3b 0a 09 6d 6f 76 65 |]) over=|1;..move|
|00005620| 28 30 2c 31 30 29 3b 0a | 09 63 6c 72 74 6f 65 6f |(0,10);.|.clrtoeo|
|00005630| 6c 28 29 3b 0a 09 69 66 | 20 28 6f 76 65 72 29 20 |l();..if| (over) |
|00005640| 61 64 64 73 74 72 28 73 | 63 61 6c 65 32 30 30 29 |addstr(s|cale200)|
|00005650| 3b 0a 09 65 6c 73 65 20 | 61 64 64 73 74 72 28 73 |;..else |addstr(s|
|00005660| 63 61 6c 65 31 30 30 29 | 3b 0a 0a 09 2f 2a 20 64 |cale100)|;.../* d|
|00005670| 69 73 70 6c 61 79 20 74 | 69 73 73 75 65 20 73 61 |isplay t|issue sa|
|00005680| 74 75 72 61 74 69 6f 6e | 20 2a 2f 0a 0a 09 66 6f |turation| */...fo|
|00005690| 72 20 28 69 3d 30 3b 20 | 69 3c 6e 3b 20 69 2b 2b |r (i=0; |i<n; i++|
|000056a0| 29 20 7b 20 2f 2a 20 6e | 20 3d 3d 20 6e 75 6d 62 |) { /* n| == numb|
|000056b0| 65 72 20 6f 66 20 63 6f | 6d 70 61 72 74 6d 65 6e |er of co|mpartmen|
|000056c0| 74 73 20 2a 2f 0a 0a 09 | 09 2f 2a 20 64 69 73 70 |ts */...|./* disp|
|000056d0| 6c 61 79 20 74 68 65 20 | 63 6f 6d 70 61 72 74 6d |lay the |compartm|
|000056e0| 65 6e 74 20 6e 75 6d 62 | 65 72 2c 20 68 69 67 68 |ent numb|er, high|
|000056f0| 6c 69 67 68 74 69 6e 67 | 20 69 66 20 69 74 0a 09 |lighting| if it..|
|00005700| 09 69 73 20 74 68 65 20 | 63 6f 6e 74 72 6f 6c 6c |.is the |controll|
|00005710| 69 6e 67 20 74 69 73 73 | 75 65 2e 20 2a 2f 0a 0a |ing tiss|ue. */..|
|00005720| 23 69 66 64 65 66 20 53 | 49 4d 50 4c 45 0a 09 09 |#ifdef S|IMPLE...|
|00005730| 6d 6f 76 65 28 31 2b 69 | 2c 36 29 3b 0a 09 09 69 |move(1+i|,6);...i|
|00005740| 66 20 28 69 3d 3d 63 6f | 6e 74 72 6f 6c 6c 69 6e |f (i==co|ntrollin|
|00005750| 67 5f 74 69 73 73 75 65 | 29 20 73 70 72 69 6e 74 |g_tissue|) sprint|
|00005760| 66 28 62 75 66 2c 22 2a | 25 64 22 2c 69 2b 31 29 |f(buf,"*|%d",i+1)|
|00005770| 3b 0a 09 09 65 6c 73 65 | 20 73 70 72 69 6e 74 66 |;...else| sprintf|
|00005780| 28 62 75 66 2c 22 20 25 | 64 22 2c 69 2b 31 29 3b |(buf," %|d",i+1);|
|00005790| 0a 23 65 6c 73 65 0a 09 | 09 6d 6f 76 65 28 31 2b |.#else..|.move(1+|
|000057a0| 69 2c 37 29 3b 0a 09 09 | 69 66 20 28 69 3d 3d 63 |i,7);...|if (i==c|
|000057b0| 6f 6e 74 72 6f 6c 6c 69 | 6e 67 5f 74 69 73 73 75 |ontrolli|ng_tissu|
|000057c0| 65 29 20 61 74 74 72 6f | 6e 28 41 5f 52 45 56 45 |e) attro|n(A_REVE|
|000057d0| 52 53 45 29 3b 0a 09 09 | 73 70 72 69 6e 74 66 28 |RSE);...|sprintf(|
|000057e0| 62 75 66 2c 22 25 64 22 | 2c 69 2b 31 29 3b 0a 23 |buf,"%d"|,i+1);.#|
|000057f0| 65 6e 64 69 66 0a 09 09 | 61 64 64 73 74 72 28 62 |endif...|addstr(b|
|00005800| 75 66 29 3b 0a 23 69 66 | 6e 64 65 66 20 53 49 4d |uf);.#if|ndef SIM|
|00005810| 50 4c 45 0a 09 09 61 74 | 74 72 6f 66 66 28 41 5f |PLE...at|troff(A_|
|00005820| 52 45 56 45 52 53 45 29 | 3b 0a 23 65 6e 64 69 66 |REVERSE)|;.#endif|
|00005830| 0a 0a 09 09 2f 2a 20 64 | 69 73 70 6c 61 79 20 74 |..../* d|isplay t|
|00005840| 68 65 20 69 6e 67 61 73 | 2f 6f 75 74 67 61 73 20 |he ingas|/outgas |
|00005850| 69 6e 64 69 63 61 74 6f | 72 20 66 6f 72 20 74 68 |indicato|r for th|
|00005860| 65 0a 09 09 63 6f 6d 70 | 61 72 74 6d 65 6e 74 2e |e...comp|artment.|
|00005870| 20 49 6e 67 61 73 2f 6f | 75 74 67 61 73 20 69 6e | Ingas/o|utgas in|
|00005880| 64 69 63 61 74 6f 72 20 | 69 73 20 61 64 6a 75 73 |dicator |is adjus|
|00005890| 74 65 64 20 74 6f 20 33 | 20 64 65 63 69 6d 61 6c |ted to 3| decimal|
|000058a0| 0a 09 09 70 6c 61 63 65 | 20 61 63 63 75 72 61 63 |...place| accurac|
|000058b0| 79 2e 20 2a 2f 0a 0a 09 | 09 6d 6f 76 65 28 31 2b |y. */...|.move(1+|
|000058c0| 69 2c 39 29 3b 0a 09 09 | 74 65 6d 70 20 3d 20 28 |i,9);...|temp = (|
|000058d0| 61 70 6e 32 20 2d 20 63 | 5b 69 5d 29 20 2a 20 31 |apn2 - c|[i]) * 1|
|000058e0| 30 30 30 2e 30 3b 0a 09 | 09 69 66 20 28 74 65 6d |000.0;..|.if (tem|
|000058f0| 70 20 3e 20 30 29 20 61 | 64 64 63 68 28 27 3e 27 |p > 0) a|ddch('>'|
|00005900| 29 3b 0a 09 09 69 66 20 | 28 74 65 6d 70 20 3d 3d |);...if |(temp ==|
|00005910| 20 30 29 20 61 64 64 63 | 68 28 27 20 27 29 3b 0a | 0) addc|h(' ');.|
|00005920| 09 09 69 66 20 28 74 65 | 6d 70 20 3c 20 30 29 20 |..if (te|mp < 0) |
|00005930| 61 64 64 63 68 28 27 3c | 27 29 3b 0a 0a 09 09 2f |addch('<|');..../|
|00005940| 2a 20 63 6c 65 61 72 20 | 74 68 65 20 62 61 72 20 |* clear |the bar |
|00005950| 62 65 66 6f 72 65 20 64 | 69 73 70 6c 61 79 69 6e |before d|isplayin|
|00005960| 67 20 74 68 65 20 6e 65 | 77 20 76 61 6c 75 65 20 |g the ne|w value |
|00005970| 2a 2f 0a 0a 09 09 6d 6f | 76 65 28 31 2b 69 2c 31 |*/....mo|ve(1+i,1|
|00005980| 30 29 3b 0a 09 09 63 6c | 72 74 6f 65 6f 6c 28 29 |0);...cl|rtoeol()|
|00005990| 3b 0a 0a 09 09 6b 20 3d | 20 63 65 69 6c 28 66 6c |;....k =| ceil(fl|
|000059a0| 6f 6f 72 28 28 64 6f 75 | 62 6c 65 29 28 31 30 30 |oor((dou|ble)(100|
|000059b0| 30 2e 30 20 2a 20 6c 6f | 61 64 69 6e 67 28 69 29 |0.0 * lo|ading(i)|
|000059c0| 29 29 20 2a 20 28 6f 76 | 65 72 3d 3d 30 3f 30 2e |)) * (ov|er==0?0.|
|000059d0| 30 34 3a 30 2e 30 32 29 | 29 3b 0a 0a 23 69 66 6e |04:0.02)|);..#ifn|
|000059e0| 64 65 66 20 53 49 4d 50 | 4c 45 0a 09 09 61 74 74 |def SIMP|LE...att|
|000059f0| 72 6f 6e 28 41 5f 52 45 | 56 45 52 53 45 20 7c 20 |ron(A_RE|VERSE | |
|00005a00| 41 5f 55 4e 44 45 52 4c | 49 4e 45 29 3b 0a 23 65 |A_UNDERL|INE);.#e|
|00005a10| 6e 64 69 66 0a 09 09 73 | 70 72 69 6e 74 66 28 62 |ndif...s|printf(b|
|00005a20| 75 66 2c 22 20 25 34 2e | 32 66 22 2c 75 63 66 2a |uf," %4.|2f",ucf*|
|00005a30| 63 5b 69 5d 29 3b 0a 09 | 09 66 6f 72 20 28 6a 3d |c[i]);..|.for (j=|
|00005a40| 30 3b 20 6a 3c 6b 3b 20 | 6a 2b 2b 29 20 7b 0a 09 |0; j<k; |j++) {..|
|00005a50| 09 09 69 66 20 28 6a 3d | 3d 28 77 69 64 74 68 2d |..if (j=|=(width-|
|00005a60| 31 31 2d 73 74 72 6c 65 | 6e 28 62 75 66 29 29 29 |11-strle|n(buf)))|
|00005a70| 20 7b 0a 09 09 09 09 61 | 64 64 63 68 28 27 3e 27 | {.....a|ddch('>'|
|00005a80| 29 3b 0a 09 09 09 09 62 | 72 65 61 6b 3b 0a 09 09 |);.....b|reak;...|
|00005a90| 09 7d 09 0a 23 69 66 64 | 65 66 20 53 49 4d 50 4c |.}..#ifd|ef SIMPL|
|00005aa0| 45 0a 09 09 09 69 66 20 | 28 6a 3c 28 6f 76 65 72 |E....if |(j<(over|
|00005ab0| 3d 3d 30 3f 34 30 3a 32 | 30 29 29 20 61 64 64 63 |==0?40:2|0)) addc|
|00005ac0| 68 28 27 23 27 29 3b 0a | 23 65 6c 73 65 0a 09 09 |h('#');.|#else...|
|00005ad0| 09 69 66 20 28 6a 3c 28 | 6f 76 65 72 3d 3d 30 3f |.if (j<(|over==0?|
|00005ae0| 34 30 3a 32 30 29 29 20 | 61 64 64 63 68 28 27 20 |40:20)) |addch(' |
|00005af0| 27 29 3b 0a 23 65 6e 64 | 69 66 0a 09 09 09 65 6c |');.#end|if....el|
|00005b00| 73 65 20 61 64 64 63 68 | 28 27 2a 27 29 3b 0a 09 |se addch|('*');..|
|00005b10| 09 7d 0a 23 69 66 6e 64 | 65 66 20 53 49 4d 50 4c |.}.#ifnd|ef SIMPL|
|00005b20| 45 0a 09 09 61 74 74 72 | 6f 66 66 28 41 5f 52 45 |E...attr|off(A_RE|
|00005b30| 56 45 52 53 45 20 7c 20 | 41 5f 55 4e 44 45 52 4c |VERSE | |A_UNDERL|
|00005b40| 49 4e 45 29 3b 0a 23 65 | 6e 64 69 66 0a 09 09 61 |INE);.#e|ndif...a|
|00005b50| 64 64 73 74 72 28 62 75 | 66 29 3b 0a 09 7d 0a 7d |ddstr(bu|f);..}.}|
|00005b60| 0a 0a 0a 64 69 73 70 6c | 61 79 5f 66 73 77 61 28 |...displ|ay_fswa(|
|00005b70| 29 0a 7b 0a 09 69 6e 74 | 20 69 2c 20 6a 2c 20 6b |).{..int| i, j, k|
|00005b80| 2c 20 74 65 6d 70 2c 20 | 6f 76 65 72 2c 20 4d 6d |, temp, |over, Mm|
|00005b90| 61 72 6b 65 72 3b 0a 09 | 2f 2a 20 69 66 20 6f 76 |arker;..|/* if ov|
|00005ba0| 65 72 70 72 65 73 73 75 | 72 65 20 6f 6e 20 61 6e |erpressu|re on an|
|00005bb0| 79 20 74 69 73 73 75 65 | 2c 20 63 68 61 6e 67 65 |y tissue|, change|
|00005bc0| 20 74 68 65 20 73 63 61 | 6c 65 20 74 6f 20 30 20 | the sca|le to 0 |
|00005bd0| 2d 20 32 30 30 25 20 2a | 2f 0a 0a 09 66 6f 72 20 |- 200% *|/...for |
|00005be0| 28 6f 76 65 72 3d 69 3d | 30 3b 20 69 3c 6e 3b 20 |(over=i=|0; i<n; |
|00005bf0| 69 2b 2b 29 20 69 66 20 | 28 63 5b 69 5d 20 3e 20 |i++) if |(c[i] > |
|00005c00| 31 30 30 2e 30 29 20 6f | 76 65 72 3d 31 3b 0a 09 |100.0) o|ver=1;..|
|00005c10| 6d 6f 76 65 28 30 2c 31 | 30 29 3b 0a 09 63 6c 72 |move(0,1|0);..clr|
|00005c20| 74 6f 65 6f 6c 28 29 3b | 0a 09 69 66 20 28 6f 76 |toeol();|..if (ov|
|00005c30| 65 72 29 20 61 64 64 73 | 74 72 28 73 63 61 6c 65 |er) adds|tr(scale|
|00005c40| 32 30 30 46 53 57 41 29 | 3b 0a 09 65 6c 73 65 20 |200FSWA)|;..else |
|00005c50| 61 64 64 73 74 72 28 73 | 63 61 6c 65 31 30 30 46 |addstr(s|cale100F|
|00005c60| 53 57 41 29 3b 0a 0a 09 | 2f 2a 20 64 69 73 70 6c |SWA);...|/* displ|
|00005c70| 61 79 20 63 6f 6d 70 61 | 72 74 6d 65 6e 74 20 4e |ay compa|rtment N|
|00005c80| 32 20 6c 65 76 65 6c 73 | 20 69 6e 20 46 53 57 41 |2 levels| in FSWA|
|00005c90| 20 2a 2f 0a 0a 09 66 6f | 72 20 28 69 3d 30 3b 20 | */...fo|r (i=0; |
|00005ca0| 69 3c 6e 3b 20 69 2b 2b | 29 20 7b 20 2f 2a 20 6e |i<n; i++|) { /* n|
|00005cb0| 20 3d 3d 20 6e 75 6d 62 | 65 72 20 6f 66 20 63 6f | == numb|er of co|
|00005cc0| 6d 70 61 72 74 6d 65 6e | 74 73 20 2a 2f 0a 0a 09 |mpartmen|ts */...|
|00005cd0| 09 2f 2a 20 64 69 73 70 | 6c 61 79 20 74 68 65 20 |./* disp|lay the |
|00005ce0| 63 6f 6d 70 61 72 74 6d | 65 6e 74 20 6e 75 6d 62 |compartm|ent numb|
|00005cf0| 65 72 2c 20 68 69 67 68 | 6c 69 67 68 74 69 6e 67 |er, high|lighting|
|00005d00| 20 69 66 20 69 74 0a 09 | 09 69 73 20 74 68 65 20 | if it..|.is the |
|00005d10| 63 6f 6e 74 72 6f 6c 6c | 69 6e 67 20 74 69 73 73 |controll|ing tiss|
|00005d20| 75 65 2e 20 2a 2f 0a 0a | 23 69 66 64 65 66 20 53 |ue. */..|#ifdef S|
|00005d30| 49 4d 50 4c 45 0a 09 09 | 6d 6f 76 65 28 31 2b 69 |IMPLE...|move(1+i|
|00005d40| 2c 36 29 3b 0a 09 09 69 | 66 20 28 69 3d 3d 63 6f |,6);...i|f (i==co|
|00005d50| 6e 74 72 6f 6c 6c 69 6e | 67 5f 74 69 73 73 75 65 |ntrollin|g_tissue|
|00005d60| 29 20 73 70 72 69 6e 74 | 66 28 62 75 66 2c 22 2a |) sprint|f(buf,"*|
|00005d70| 25 64 22 2c 69 2b 31 29 | 3b 0a 09 09 65 6c 73 65 |%d",i+1)|;...else|
|00005d80| 20 73 70 72 69 6e 74 66 | 28 62 75 66 2c 22 20 25 | sprintf|(buf," %|
|00005d90| 64 22 2c 69 2b 31 29 3b | 0a 23 65 6c 73 65 0a 09 |d",i+1);|.#else..|
|00005da0| 09 6d 6f 76 65 28 31 2b | 69 2c 37 29 3b 0a 09 09 |.move(1+|i,7);...|
|00005db0| 69 66 20 28 69 3d 3d 63 | 6f 6e 74 72 6f 6c 6c 69 |if (i==c|ontrolli|
|00005dc0| 6e 67 5f 74 69 73 73 75 | 65 29 20 61 74 74 72 6f |ng_tissu|e) attro|
|00005dd0| 6e 28 41 5f 52 45 56 45 | 52 53 45 29 3b 0a 09 09 |n(A_REVE|RSE);...|
|00005de0| 73 70 72 69 6e 74 66 28 | 62 75 66 2c 22 25 64 22 |sprintf(|buf,"%d"|
|00005df0| 2c 69 2b 31 29 3b 0a 23 | 65 6e 64 69 66 0a 09 09 |,i+1);.#|endif...|
|00005e00| 61 64 64 73 74 72 28 62 | 75 66 29 3b 0a 23 69 66 |addstr(b|uf);.#if|
|00005e10| 6e 64 65 66 20 53 49 4d | 50 4c 45 0a 09 09 61 74 |ndef SIM|PLE...at|
|00005e20| 74 72 6f 66 66 28 41 5f | 52 45 56 45 52 53 45 29 |troff(A_|REVERSE)|
|00005e30| 3b 0a 23 65 6e 64 69 66 | 0a 0a 09 09 2f 2a 20 64 |;.#endif|..../* d|
|00005e40| 69 73 70 6c 61 79 20 74 | 68 65 20 69 6e 67 61 73 |isplay t|he ingas|
|00005e50| 2f 6f 75 74 67 61 73 20 | 69 6e 64 69 63 61 74 6f |/outgas |indicato|
|00005e60| 72 20 66 6f 72 20 74 68 | 65 0a 09 09 63 6f 6d 70 |r for th|e...comp|
|00005e70| 61 72 74 6d 65 6e 74 2e | 20 49 6e 67 61 73 2f 6f |artment.| Ingas/o|
|00005e80| 75 74 67 61 73 20 69 6e | 64 69 63 61 74 6f 72 20 |utgas in|dicator |
|00005e90| 69 73 20 61 64 6a 75 73 | 74 65 64 20 74 6f 20 33 |is adjus|ted to 3|
|00005ea0| 20 64 65 63 69 6d 61 6c | 0a 09 09 70 6c 61 63 65 | decimal|...place|
|00005eb0| 20 61 63 63 75 72 61 63 | 79 2e 20 2a 2f 0a 0a 09 | accurac|y. */...|
|00005ec0| 09 6d 6f 76 65 28 31 2b | 69 2c 39 29 3b 0a 09 09 |.move(1+|i,9);...|
|00005ed0| 74 65 6d 70 20 3d 20 28 | 61 70 6e 32 20 2d 20 63 |temp = (|apn2 - c|
|00005ee0| 5b 69 5d 29 20 2a 20 31 | 30 30 30 2e 30 3b 0a 09 |[i]) * 1|000.0;..|
|00005ef0| 09 69 66 20 28 74 65 6d | 70 20 3e 20 30 29 20 61 |.if (tem|p > 0) a|
|00005f00| 64 64 63 68 28 27 3e 27 | 29 3b 0a 09 09 69 66 20 |ddch('>'|);...if |
|00005f10| 28 74 65 6d 70 20 3d 3d | 20 30 29 20 61 64 64 63 |(temp ==| 0) addc|
|00005f20| 68 28 27 20 27 29 3b 0a | 09 09 69 66 20 28 74 65 |h(' ');.|..if (te|
|00005f30| 6d 70 20 3c 20 30 29 20 | 61 64 64 63 68 28 27 3c |mp < 0) |addch('<|
|00005f40| 27 29 3b 0a 0a 09 09 2f | 2a 20 63 6c 65 61 72 20 |');..../|* clear |
|00005f50| 74 68 65 20 62 61 72 20 | 62 65 66 6f 72 65 20 64 |the bar |before d|
|00005f60| 69 73 70 6c 61 79 69 6e | 67 20 74 68 65 20 6e 65 |isplayin|g the ne|
|00005f70| 77 20 76 61 6c 75 65 20 | 2a 2f 0a 0a 09 09 6d 6f |w value |*/....mo|
|00005f80| 76 65 28 31 2b 69 2c 31 | 30 29 3b 0a 09 09 63 6c |ve(1+i,1|0);...cl|
|00005f90| 72 74 6f 65 6f 6c 28 29 | 3b 0a 0a 09 09 4d 6d 61 |rtoeol()|;....Mma|
|00005fa0| 72 6b 65 72 20 3d 20 63 | 65 69 6c 28 28 64 6f 75 |rker = c|eil((dou|
|00005fb0| 62 6c 65 29 28 4d 76 61 | 6c 75 65 73 5b 69 5d 2a |ble)(Mva|lues[i]*|
|00005fc0| 28 6f 76 65 72 3d 3d 30 | 3f 30 2e 34 3a 30 2e 32 |(over==0|?0.4:0.2|
|00005fd0| 29 29 29 3b 0a 09 09 6b | 20 3d 20 63 65 69 6c 28 |)));...k| = ceil(|
|00005fe0| 28 64 6f 75 62 6c 65 29 | 28 63 5b 69 5d 2a 28 6f |(double)|(c[i]*(o|
|00005ff0| 76 65 72 3d 3d 30 3f 30 | 2e 34 3a 30 2e 32 29 29 |ver==0?0|.4:0.2))|
|00006000| 29 3b 0a 09 09 09 0a 0a | 23 69 66 6e 64 65 66 20 |);......|#ifndef |
|00006010| 53 49 4d 50 4c 45 0a 09 | 09 61 74 74 72 6f 6e 28 |SIMPLE..|.attron(|
|00006020| 41 5f 52 45 56 45 52 53 | 45 20 7c 20 41 5f 55 4e |A_REVERS|E | A_UN|
|00006030| 44 45 52 4c 49 4e 45 29 | 3b 0a 23 65 6e 64 69 66 |DERLINE)|;.#endif|
|00006040| 0a 09 09 66 6f 72 20 28 | 6a 3d 30 3b 20 6a 3c 6b |...for (|j=0; j<k|
|00006050| 3b 20 6a 2b 2b 29 20 7b | 0a 09 09 09 69 66 20 28 |; j++) {|....if (|
|00006060| 6a 3d 3d 28 77 69 64 74 | 68 2d 31 31 29 29 20 7b |j==(widt|h-11)) {|
|00006070| 0a 09 09 09 09 61 64 64 | 63 68 28 27 3e 27 29 3b |.....add|ch('>');|
|00006080| 0a 09 09 09 09 62 72 65 | 61 6b 3b 0a 09 09 09 7d |.....bre|ak;....}|
|00006090| 09 0a 23 69 66 64 65 66 | 20 53 49 4d 50 4c 45 0a |..#ifdef| SIMPLE.|
|000060a0| 09 09 09 69 66 20 28 6a | 3c 4d 6d 61 72 6b 65 72 |...if (j|<Mmarker|
|000060b0| 29 20 61 64 64 63 68 28 | 27 23 27 29 3b 0a 23 65 |) addch(|'#');.#e|
|000060c0| 6c 73 65 0a 09 09 09 69 | 66 20 28 6a 3c 4d 6d 61 |lse....i|f (j<Mma|
|000060d0| 72 6b 65 72 29 20 61 64 | 64 63 68 28 27 20 27 29 |rker) ad|dch(' ')|
|000060e0| 3b 0a 23 65 6e 64 69 66 | 0a 09 09 09 65 6c 73 65 |;.#endif|....else|
|000060f0| 20 61 64 64 63 68 28 27 | 2a 27 29 3b 0a 09 09 7d | addch('|*');...}|
|00006100| 0a 23 69 66 6e 64 65 66 | 20 53 49 4d 50 4c 45 0a |.#ifndef| SIMPLE.|
|00006110| 09 09 61 74 74 72 6f 66 | 66 28 41 5f 52 45 56 45 |..attrof|f(A_REVE|
|00006120| 52 53 45 20 7c 20 41 5f | 55 4e 44 45 52 4c 49 4e |RSE | A_|UNDERLIN|
|00006130| 45 29 3b 0a 23 65 6e 64 | 69 66 0a 09 7d 0a 7d 0a |E);.#end|if..}.}.|
|00006140| 0a 69 6e 69 74 5f 64 69 | 73 70 6c 61 79 28 29 0a |.init_di|splay().|
|00006150| 7b 0a 09 69 6e 74 20 69 | 3b 0a 09 69 6e 69 74 73 |{..int i|;..inits|
|00006160| 63 72 28 29 3b 0a 0a 09 | 2f 2a 20 73 65 74 20 6e |cr();...|/* set n|
|00006170| 6f 64 65 6c 61 79 20 6d | 6f 64 65 20 66 6f 72 20 |odelay m|ode for |
|00006180| 69 6e 70 75 74 20 70 72 | 6f 63 65 73 73 69 6e 67 |input pr|ocessing|
|00006190| 20 2a 2f 0a 0a 09 6e 6f | 64 65 6c 61 79 28 73 74 | */...no|delay(st|
|000061a0| 64 73 63 72 2c 54 52 55 | 45 29 3b 0a 09 6b 65 79 |dscr,TRU|E);..key|
|000061b0| 70 61 64 28 73 74 64 73 | 63 72 2c 54 52 55 45 29 |pad(stds|cr,TRUE)|
|000061c0| 3b 0a 0a 09 2f 2a 20 70 | 72 69 6e 74 20 74 68 65 |;.../* p|rint the|
|000061d0| 20 73 61 74 75 72 61 74 | 69 6f 6e 20 25 61 67 65 | saturat|ion %age|
|000061e0| 20 73 63 61 6c 65 20 2a | 2f 0a 0a 09 6d 6f 76 65 | scale *|/...move|
|000061f0| 28 30 2c 31 30 29 3b 0a | 09 69 66 20 28 6d 6f 64 |(0,10);.|.if (mod|
|00006200| 65 3d 3d 53 48 4f 57 5f | 4c 4f 41 44 49 4e 47 29 |e==SHOW_|LOADING)|
|00006210| 20 61 64 64 73 74 72 28 | 73 63 61 6c 65 31 30 30 | addstr(|scale100|
|00006220| 29 3b 0a 09 65 6c 73 65 | 20 61 64 64 73 74 72 28 |);..else| addstr(|
|00006230| 73 63 61 6c 65 31 30 30 | 46 53 57 41 29 3b 0a 0a |scale100|FSWA);..|
|00006240| 09 2f 2a 20 6c 61 62 65 | 6c 20 74 68 65 20 44 69 |./* labe|l the Di|
|00006250| 76 65 20 70 72 6f 66 69 | 6c 65 20 67 72 61 70 68 |ve profi|le graph|
|00006260| 20 2a 2f 0a 0a 09 6d 6f | 76 65 28 6e 2b 33 2c 30 | */...mo|ve(n+3,0|
|00006270| 29 3b 0a 09 61 64 64 73 | 74 72 28 22 4e 44 4c 20 |);..adds|tr("NDL |
|00006280| 20 44 65 70 74 68 22 29 | 3b 0a 09 6d 6f 76 65 28 | Depth")|;..move(|
|00006290| 6e 2b 34 2c 30 29 3b 0a | 09 61 64 64 73 74 72 28 |n+4,0);.|.addstr(|
|000062a0| 22 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 22 29 3b 0a 0a |"-------|---");..|
|000062b0| 09 2f 2a 20 63 72 65 61 | 74 65 20 74 68 65 20 64 |./* crea|te the d|
|000062c0| 69 76 65 20 70 72 6f 66 | 69 6c 65 20 64 69 73 70 |ive prof|ile disp|
|000062d0| 6c 61 79 20 2a 2f 0a 0a | 09 66 6f 72 20 28 69 3d |lay */..|.for (i=|
|000062e0| 6e 2b 35 3b 20 69 3c 6c | 69 6e 65 73 3b 20 69 2b |n+5; i<l|ines; i+|
|000062f0| 2b 29 20 7b 0a 09 09 6d | 6f 76 65 28 69 2c 34 29 |+) {...m|ove(i,4)|
|00006300| 3b 0a 09 09 73 70 72 69 | 6e 74 66 28 62 75 66 2c |;...spri|ntf(buf,|
|00006310| 22 25 35 2e 31 66 7c 22 | 2c 28 69 2d 6e 2d 35 29 |"%5.1f|"|,(i-n-5)|
|00006320| 2a 64 69 29 3b 0a 09 09 | 61 64 64 73 74 72 28 62 |*di);...|addstr(b|
|00006330| 75 66 29 3b 0a 09 7d 0a | 7d 0a 0a 66 6c 6f 61 74 |uf);..}.|}..float|
|00006340| 20 67 65 74 5f 73 61 6d | 70 6c 65 28 29 0a 7b 0a | get_sam|ple().{.|
|00006350| 09 66 6c 6f 61 74 20 74 | 61 72 67 65 74 5f 64 65 |.float t|arget_de|
|00006360| 70 74 68 3b 0a 09 64 6f | 75 62 6c 65 20 61 74 6f |pth;..do|uble ato|
|00006370| 66 28 29 3b 0a 09 77 68 | 69 6c 65 20 28 64 75 72 |f();..wh|ile (dur|
|00006380| 61 74 69 6f 6e 20 3d 3d | 20 30 29 20 7b 0a 09 09 |ation ==| 0) {...|
|00006390| 69 66 20 28 21 70 72 6f | 66 69 6c 65 29 20 7b 0a |if (!pro|file) {.|
|000063a0| 0a 09 09 09 2f 2a 20 63 | 68 65 63 6b 20 66 6f 72 |..../* c|heck for|
|000063b0| 20 61 75 74 6f 64 65 63 | 6f 6d 70 72 65 73 73 69 | autodec|ompressi|
|000063c0| 6f 6e 20 6d 6f 64 65 20 | 2a 2f 0a 0a 09 09 09 69 |on mode |*/.....i|
|000063d0| 66 20 28 64 65 63 6f 6d | 6f 64 65 29 20 7b 0a 09 |f (decom|ode) {..|
|000063e0| 09 09 09 69 66 20 28 63 | 65 69 6c 69 6e 67 20 3d |...if (c|eiling =|
|000063f0| 3d 20 30 29 20 64 65 63 | 6f 6d 6f 64 65 20 3d 20 |= 0) dec|omode = |
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.