commit 979c196eb6eaffbfc92518e7cd42d8bfabde9d5e Author: Stephen Hicks Date: Fri Jul 5 15:00:12 2013 -0500 Added source file to repo as received from AA6YQ diff --git a/.MDT b/.MDT new file mode 100644 index 0000000..e8d15f3 Binary files /dev/null and b/.MDT differ diff --git a/ARRL.DX b/ARRL.DX new file mode 100644 index 0000000..05faa26 --- /dev/null +++ b/ARRL.DX @@ -0,0 +1,423 @@ +! ARRL DXCC COUNTRIES LIST For MMLOG +! +AP ;AP-AS,6P-6S ;PAKISTAN ;AS ;E +!A1 ;A1 ;ABU AIL ;AS +A2 ;A2,8O ;BOTSWANA ;AF ;B +A3 ;A3 ;TONGA ;OC ;N +A4 ;A4 ;OMAN ;AS ;D +A5 ;A5 ;BHUTAN ;AS ;F +A6 ;A6 ;UNITED ARAB ;AS ;D +A7 ;A7 ;QATAR ;AS ;C +A9 ;A9 ;BAHRAIN ;AS ;C +BV9P ;BV9P\,BQ9P\ ;PRATAS IS. ;AS ;H +BV ;BV ;TAIWAN ;AS ;H +BS7 ;BS7H\ ;SCARBOROUGH REEF ;AS ;H +BY ;BA-BZ,3H-3U,B1-B9 ;CHINA ;AS ;H +CE0X ;CE0X,XQ0X-XR0X,CE0AA ;SAN FELIX IS. ;SA ;R +CE0Z ;CE0Z,CE0I,CE0OGZ,XQ0Z-XR0Z,XQ0I-XR0I,CE0/JA7XYE; FERNANDEZ ;SA ;R +CE0 ;CE0,XQ0-XR0 ;EASTER IS. ;SA ;T +CE ;CA-CE,XQ-XR,3G ;CHILE ;SA ;Q +CM ;CL-CM,CO,T4 ;CUBA ;NA ;R +CN ;CN,5C-5G ;MOROCCO ;AF ;Z +CP ;CP ;BOLIVIA ;SA ;Q +CT3 ;CS3,CT3,CR9 ;MADEIRAI IS.(PORTUGAL) ;AF ;Z +CU ;CU ;AZORES IS.(PORTUGAL) ;EU ;Z +CT ;CQ-CU ;PORTUGAL ;EU ;Z +CY9 ;CY9,CY0SPI ;ST PAUL IS. ;NA ;Q +CY0 ;CY0 ;SABLE IS. ;NA ;Q +CX ;CV-CX ;URUGUAY ;SA ;P +C2 ;C2 ;NAURU ;OC ;M +C3 ;C3 ;ANDORRA ;EU ;A +C5 ;C5 ;THE GAMBIA ;AF ;Z +C6 ;C6 ;BAHAMA IS. ;NA ;R +C8 ;C8-C9 ;MOZAMBIQUE ;AF ;B +DL ;DA-DR,Y2-Y9 ;GERMANY ;EU ;A +DU ;DU-DZ,4D-4I ;PHILIPPINES ;OC ;H +D2 ;D2-D3 ;ANGOLA ;AF ;A +D4 ;D4 ;CAPE VERDE ;AF ;A +D6 ;D6 ;COMOROS ;AF ;C +EA6 ;EA6-EH6,AM6-AO6 ;BALEARIC ;EU ;A +EA8 ;EA8-EH8,AM8-AO8 ;CANARY ;AF ;A +EA9 ;EA9-EH9,AM9-AO9 ;CEUTA & MELILLA(SPAIN) ;AF ;A +EA ;EA-EH,AM-AO ;SPAIN ;EU ;A +EI ;EI-EJ ;IRELAND ;EU ;Z +EK ;EK ;ARMENIA (ex UG) ;AS ;D +EL ;EL,5L-5M,A8,D5,6Z ;LIBERIA ;AF ;Z +EP ;EP-EQ,HN,9B-9D ;IRAN ;AS ;c +ER ;ER ;MOLDOVA (ex UO) ;EU ;C +ES ;ES ;ESTONIA ;EU ;C +ET ;ET,9E-9F ;ETHIOPIA ;AF ;C +EU ;EU-EW ;BELARUS (ex UC) ;EU ;C +EX ;EX ;KYRGYZSTAN (ex UM) ;AS ;F +EY ;EY ;TAJIKISTAN (ex UJ) ;AS ;F +EZ ;EZ ;TURKMENISTAN (ex UH) ;AS ;F +E4 ;E4 ;PALESTINE ;AS ;B +E3 ;E3 ;ERITREA ;AF ;C +FG ;FG ;GUADELOUPE ;NA ;Q +FH ;FH ;MAYOTTE ;AF ;C +FJ ;FJ,FS ;SAINT MARTIN ;NA ;Q +FK ;FK,TX8 ;NEW CALEDONIA ;OC ;L +FM ;FM ;MARTINIQUE ;NA ;Q +FO/C ;FO0X,FO0AAA ;CLIPPERTON IS. ;NA ;T +FO ;FO ;FRENCH POLYNESIA ;OC ;W +FO/A ;FO ;AUSTRAL IS ;OC ;W +FO/M ;FO ;MARQUESAS IS ;OC ;W +FP ;FP ;ST.PIERRE & MIQUELON IS. ;NA ;Q +FR/J ;FR*/J,FR*/E ;JUAN DE NOVA & EUROPA IS. ;AF ;C +FR/G ;FR*/G ;GLORIOSO IS. ;AF ;C +FR/T ;FR*/T ;TROMELIN ;AF ;C +FR ; ;REUNION IS. ;AF ;C +FR/? ;FR ;REUNION IS. /GLORIOSO IS. /JUAN DE NOVA & EUROPA ;AF ;C +FT5W ;FT8W,FT2W,FT4W,FT5W,FT0W ;CROZET IS. ;AF ;C +FT5X ;FT8X,FT2X,FT4X,FT5X,FT0X ;KERGUELEN IS. ;AF ;E +FT5Z ;FT8Z,FT2Z,FT4Z,FT5Z,FT0Z ;AMSTERDAM & ST PAUL IS. ;AF ;E +FW ;FW ;WALLIS & FUTUNA IS. ;OC ;M +FY ;FY ;FRENCH GUIANA ;SA ;P +F ;F,HW-HY,TM,TO-TQ ;FRANCE ;EU ;A +GD ;GD,GT,MA6-MB6,2A6,MD ;ISLE OF MAN ;EU ;Z +GI ;GI,GN,MA5-MB5,2A5,MI ;NORTHERN IRELAND ;EU ;Z +GJ ;GH,GJ,MA7-MB7,2A7,MJ ;JERSEY ;EU ;Z +GM ;GM,GS,MA3-MB3,2A3,MM ;SCOTLAND ;EU ;Z +GU ;GU,GP,MA8-MB8,2A8,MG ;GUERNSEY ;EU ;Z +GW ;GW,GC,MA4-MB4,2A4,MW ;WALES,U.K ;EU ;Z +G ;G,2,M ;ENGLAND(U.K) ;EU ;Z +HA ;HA,HG ;HUNGARY ;EU ;A +HB0 ;HB0,HE0 ;LIECHTENSTEIN ;EU ;A +HB ;HB,HE,4U1VIC ;SWITZERLAND ;EU ;A +HC8 ;HC8-HD8 ;GALAPAGOS IS.(ECUADOR) ;SA ;R +HC ;HC,HD ;ECUADOR ;SA ;R +HH ;HH,4V ;HAITI ;NA ;R +HI ;HI ;DOMINICAN REPUBLIC ;NA ;R +HK0/M ;HK0M,5J0M,HK0TU ;MALPELO IS. ;NA ;R +HK0/A ;HK0,5J0 ;SAN ANDRES ;NA ;R +HK ;HJ-HK,5J-5K ;COLOMBIA ;SA ;R +HL ;HL,DS-DT,6K-6N,D7-D9,KL9 ;REPUBLIC OF KOREA (SOUTH KOREA) ;AS ;I +HP ;HO-HP,3E-3F,H3,H8-H9 ;PANAMA ;NA ;R +HR ;HQ-HR ;HONDURAS ;NA ;S +HS ;HS,E2 ;THAILAND ;AS ;G +HV ;HV ;VATICAN ;EU ;A +HZ ;HZ,7Z-8Z ;SAUDI ARABIA ;AS ;C +H40 ;H40 ;TEMOTU IS ;OC ;L +H4 ;H4 ;SOLOMON IS. ;OC ;L +IS ;IS,IM0,IU0 ;SARDINIA ;EU ;A +I ;I ;ITALY ;EU ;A +JD1/M ;JD1YAA,JD1BIY ;MINAMI TORISHIMA ;OC ;I +JD1 ;JD1BIC ;OGASAWARA ;AS ;I +JD1/? ;JD1 ;OGASAWARA, /MINAMI TORISHIMA ;I +JA ;JA-JS,7J-7N,8J-8N ;JAPAN ;AS ;I +JT ;JT-JV ;MONGOLIA ;AS ;H +JW ;JW ;SVALBARD IS. ;EU ;A +JX ;JX ;JA MAYEN IS. ;EU ;Z +JY ;JY ;JORDAN ;AS ;B +J2 ;J2 ;DJIBOUTI ;AF ;C +J3 ;J3 ;GRENADA ;NA ;Q +J5 ;J5 ;GUINEA-BISSAU ;AF ;Z +J6 ;J6 ;ST LUCIA ;NA ;Q +J7 ;J7 ;DOMINICA ;NA ;Q +J8 ;J8 ;ST VINCENT & DEPENDENCIES ;NA ;Q +KC4 ;8J1R?\,R1A,FB8Y,CE9A,ZL5,Y88,Y90ANT,ZS8BBB,ZS8AAA,KC4AAC,KC4USV,Y73SOP,KC4AAA,KC4USB,KC4USX,3G9A,3Y9WT,8J1RY,AT0A,IA0PS,OR4,XS7ANT,Y83ANT,ZL0AIC,ZS7ANT,VK0DS,KC4AAE ;ANTARCTICA ;AN +KC6 ;T8,KC6??\ ;(WESTERN CAROLINE IS.) BELAU ;OC ;I +KG4 ;KG4??\ ;GUANTANAMO BAY ;NA ;R +KH0 ;AH0,KH0,NH0,WH0 ;MARIANA IS. ;OC ;K +KH1 ;AH1,KH1,NH1,WH1 ;BAKER & HOWLAND IS. ;OC ;X +KH2 ;AH2,KH2,NH2,WH2 ;GUAM ;OC ;K +KH3 ;AH3,KH3,NH3,WH3 ;JOHNSTON IS. ;OC ;X +KH4 ;AH4,KH4,NH4,WH4 ;MIDWAY IS. ;OC ;M +KH5K ;AH5K,KH5K,NH5K,WH5K ;KINGMAN REEF ;OC ;W +KH5 ;AH5,KH5,NH5,WH5 ;PALMYRA & JARVIS ;OC ;W +KH7K ;AH7K,KH7K,NH7K,WH7K ;KURE IS. ;OC ;M +KH6 ;AH6-AH7,KH6-KH7,NH6-NH7,WH6-WH7 ;HAWAIIAN IS. ;OC ;W +KH8 ;AH8,KH8,NH8,WH8 ;AMERICAN SAMOA ;OC ;W +KH9 ;AH9,KH9,NH9,WH9 ;WAKE IS. ;OC ;L +KL7 ;AL,KL0-KL8,NL,WL ;ALASKA ;NA ;W +KP1 ;KP1,NP1,WP1 ;NAVASSA IS. ;NA ;Q +KP2 ;KP2,NP2,WP2 ;AM.VIRGIN IS. ;NA ;Q +KP4 ;KP3-KP4,NP3-NP4,WP3-WP4 ;PUERTO RICO ;NA ;Q +KP5 ;KP5,NP5,WP5 ;DESECHEO IS. ;NA ;Q +W ;AA6-AK6,K6,N6,W6,K?6,N?6,W?6 ;U.S.A. ;NA ;U +W ;AA7-AK7,K7,N7,W7,K?7,N?7,W?7 ;U.S.A. ;NA ;T +W ;AA0-AK0,K0,N0,W0,K?0,N?0,W?0,AA5-AK5,K5,N5,W5,K?5,N?5,W?5,AA9-AK9,K9,N9,W9,K?9,N?9,W?9 ;U.S.A. ;NA ;S +W ;AA-AL,K,N,W,4U1WB ;U.S.A. ;NA ;R +LA ;LA-LN ;NORWAY ;EU ;A +LU ;LO-LW,AY-AZ,L2-L9 ;ARGENTINA ;SA ;P +LX ;LX ;LUXEMBOURG ;EU ;A +LY ;LY ;LITHUANIA ;EU ;C +LZ ;LZ ;BULGARIA ;EU ;B +OA ;OA-OC,4T ;PERU ;SA ;R +OD ;OD ;LEBANON ;AS ;B +OE ;OE ;AUSTRIA ;EU ;A +OH0 ;OH0,OF0 ;ALAND IS. ;EU ;B +OJ0 ;OJ0 ;MARKET REEF ;EU ;B +OH ;OF-OJ ;FINLAND ;EU ;B +OK ;OK-OL ;CZECH REPUBLIC ;EU ;A +OM ;OM ;SLOVAK REPUBLIC ;EU ;A +ON ;ON-OT ;BELGIUM ;EU ;A +OX ;OX ;GREENLAND ;NA ;Q +OY ;OY ;FAROES ;EU ;Z +OZ ;OU-OZ,XP,5P-5Q ;DENMARK ;EU ;A +PJ8 ;PJ5-PJ8,PJ0J,PJ1F ;SINT MAARTEN ;NA ;Q +PJ9 ;PJ ;NETHERLANDS ANTILLES ;SA ;Q +PA ;PA-PI ;NETHERLANDS ;EU ;A +PY0/S ;PP0S-PY0S,ZV0S-ZZ0S,PY0DX,PT0MI,PS0WH-PT0WH,PY0RO,PW0PP,PP0ZS-PY0ZS ;ST PETER ;SA ;P +PY0/T ;PP0T-PY0T,ZV0T-ZZ0T ;TRINDADE ;SA ;P +PY0 ;PP0-PY0,ZV0-ZZ0 ;FERNANDO DE NORONHA ;SA ;P +PY ;PP-PY,ZV-ZZ ;BRAZIL ;SA ;P +PZ ;PZ ;SURINAM ;SA ;Q +P2 ;P2 ;PAPUA NEW GUINEA ;OC ;K +P4 ;P4 ;ARUBA ;SA ;Q +P5 ;P5-P9,HM ;NORTH KOREA (DPRK) ;AS ;I +R1/MVI ;4J1FS,R1M,*/MVI,MVI/* ;MALYJ VYSOTSKIJ IS. (ex 4J1) ;EU ;C +R1/FJL ;R1F,*/FJL,FJL/* ;FRANZ JOSEPH LAND (ex UA1/4K2) ;EU ;C +SM ;SA-SM,7S-8S ;SWEDEN ;EU ;A +SP ;SN-SR,HF,3Z ;POLAND ;EU ;A +!ST0 ;ST0,6T0-6U0 ;SOUTHEN SUDAN ;AF ;B +ST ;ST,6T-6U ;SUDAN ;AF ;B +SU ;SU,6A-6B ;EGYPT ;AF ;B +SV/A ;SY1MA,SV*/A,*/SV/A ;MT ATHOS ;EU ;B +SV5 ;SV5-SZ5,J45 ;DODECANESE IS. ;EU ;B +SV9 ;SV9-SZ9,J49 ;CRETE ;EU ;B +SV ;SV-SZ,J4 ;GREECE ;EU ;B +S2 ;S2-S3 ;BANGLADESH ;AS ;F +S5 ;S5 ;SLOVENIA (ex YU3) ;EU ;A +S7 ;S7 ;SEYCHELLES ;AF ;C +S9 ;S9 ;SAO TOME & PRINCIPE ;AF ;B +S0 ;S0 ;WESTERN SAHARA ;AF ;Z +TA ;TA1-TC1,YM1 ;TURKEY (EU) ;EU ;C +TA ;TA2-TA9,TB2-TB9,TC2-TC9,YM2-YM9;TURKEY (AS) ;AS ;C +TF ;TF ;ICELAND ;EU ;Z +TG ;TG,TD ;GUATEMALA ;NA ;S +TI9 ;TI9,TE9 ;COCOS IS. ;NA ;S +TI ;TI,TE ;COSTA RICA ;NA ;S +TJ ;TJ ;CAMEROON ;AF ;A +TK ;TK ;CORSICA ;EU ;A +TL ;TL ;CENTRAL AFRICAN REP ;AF ;A +TN ;TN ;CONGO ;AF ;A +TR ;TR ;GABON ;AF ;A +TT ;TT ;CHAD ;AF ;A +TU ;TU ;IVORY COAST ;AF ;Z +TY ;TY ;BENIN ;AF ;Z +TX0 ;TX0 ;CHESTERFIELD IS. ;OC ;L +TZ ;TZ ;MALI ;AF ;Z +T2 ;T2 ;TUVALU ;OC ;M +T30 ;T30 ;WEST KIRIBATI(GILBERT IS.) ;OC ;X +T31 ;T31 ;CENTRAL KIRIBATI(BRITISH PHOENIX IS.) ;OC ;X +T32 ;T32 ;EAST KIRIBATI(LINE IS.) ;OC ;W +T33 ;T33 ;BANABA IS(OCEAN IS.) ;OC ;M +T5 ;T5,6O ;SOMALIA ;AF ;C +T7 ;T7 ;SAN MARINO ;EU ;A +T9 ;T9 ;BOSNIA-HERZEGOVINA (ex YU4,4N4) ;EU ;A +UJ ;UJ-UM ;UZBEKISTAN (ex UI) ;AS ;E +UN ;UN-UQ ;KAZAKHSTAN (ex UL) ;AS ;E +UR ;UR-UZ,EM-EO ;UKRAINE (ex UB) ;EU ;B +UA2 ;U?2,R?2 ;KALININGRAD ;EU ;C +UA/EU ;U?1-U?6,R?1-R?6,U1-U6,R1-R6 ;EUROPEAN RUSSIA ;EU ;C +UA/AS ;U?9,R?9,U9,R9 ;ASIATIC RUSSIA ;AS ;E +UA/AS ;U?8,U?0,R?8,R?0,U8,U0,R8,R0 ;ASIATIC RUSSIA ;AS ;I +VE ;VA7-VG7,VX7,CF7-CK7,XJ7-XO7,VY1 ;CANADA ;NA ;U +VE ;VA6-VG6,VX6,CF6-CK6,XJ6-XO6,VA5-VG5,VX5,CF5-CK5,XJ5-XO5 ;CANADA ;NA ;T +VE ;VA4-VG4,VX4,CF4-CK4,XJ4-XO4 ;CANADA ;NA ;S +VE ;VA3-VG3,VX3,CF3-CK3,XJ3-XO3,VA2-VG2,VX2,CF2-CK2,XJ2-XO2 ;CANADA ;NA ;R +VE ;VA-VG,VO,VX-VY,CF-CK,CY-CZ,XJ-XO ;CANADA ;NA ;Q +VK9L ;VK9L,AX9L ;LORD HOWE IS. ;OC ;L +VK9M ;VK9JW,VK9ZR,VK9MR,VK9ZM ;MELLISH REEF ;OC ;K +VK9N ;VK9N,AX9N ;NORFOLK IS. ;OC ;L +VK9W ;VK9Z,AX9Z,VK9TR ;WILLIS IS. ;OC ;K +VK9X ;VK9X,AX9X ;CHRISTMAS IS. ;OC ;H +VK9C ;VK9Y,AX9Y,VK9WB,VK9EW ;COCOS-KEELING IS. ;OC ;H +VK9? ;VK9 ;COCOS-KEELING IS., /LORD HOWE IS., /MELLISH IS., /NORFOLK IS., /WILLIS IS., /CHRISTMAS IS. ;OC ;K +VK0/M ;VK0AE,VK0GC,VK0WH ;MACQUARIE ;OC ;K +VK0/H ;VK0HM,VK0HI,VK0CW,VK0DA,VK0IR ;HEARD IS. ;AF ;E +VK0/? ;VK0 ;HEARD IS., /MACQUARIE IS. +VK ;VH-VN,VZ,AX ;AUSTRALIA ;OC ;K +VP2E ;VP2E,VP25E ;ANGUILLA ;NA ;Q +VP2M ;VP2M ;MONTSERRAT ;NA ;Q +VP2V ;VP2V ;BRITISH VIRGIN IS. ;NA ;Q +VP5 ;VP5 ;TURKS & CAICOS IS. ;NA ;R +VP8/G ;VP8BUB,VP8CDJ,VP8SGP ;SOUTH GEORGIA ;SA ;P +VP8/O ;LU1Z,VP8BXK ;SOUTH ORKNEY ;SA ;P +VP8/S ;LU2Z,4K1F,CX0XY,HF0POL,LU5ZI,ZX0ECF,VP8CQS,VP8CQR,LZ0A ;SOUTH SHETLAND ;SA ;P +VP8/SW ;VP8SSI ;SOUTH SANDWICH IS. ;SA ;P +VP8 ;VP8CSA ;FALKLAND IS. ;SA ;Q +VP8/? ;VP8,LU?Z ;FALKLAND IS., /SOUTH GEORGIA IS., /SOUTH ORKNEY IS., /SOUTH SANDWICH IS., /SOUTH SHETLAND IS. ;SA ;P +VP9 ;VP9 ;BERMUDA IS. ;NA +VQ9 ;VQ9 ;CHAGOS IS. ;AF ;E +VR6 ;VR6,VP6 ;PITCAIRN IS. ;OC ;U +VR2 ;VS6,VS96,VS97,VR97,VR98,VR2 ;HONG KONG ;AS ;H +VU/A ;VU2JPS ;ANDAMAN & NICOBAR IS. ;AS ;e +VU/L ; ;LACCADIVE IS. ;AS ;e +VU ; ;INDIA ;AS ;e +VU/? ;VT-VW,AT-AW,8T-8Y ;INDIA, /ANDAMAN & NICOBAR IS., /LACCADIVE IS. ;AS ;e +V2 ;V2 ;ANTIGUA & BARBUDA ;NA ;Q +V3 ;V3 ;BELIZE ;NA ;S +V4 ;V4 ;ST KITTS & NEVIS ;NA ;Q +V5 ;V5 ;NAMIBIA ;AF ;B +V6 ;V6 ;MICRONESIA(E CAROLINE IS.) ;OC ;L +V7 ;V7 ;MARSHALL IS. ;OC ;M +V8 ;V8 ;BRUNEI ;OC ;H +XF4 ;XA4-XI4,4A4-4C4,6D4-6J4 ;REVILLA GIGEDO ;NA ;T +XE ;XA-XI,4A-4C,6D-6J ;MEXICO ;NA ;S +XT ;XT ;BURKINA-FASO ;AF ;Z +XU ;XU ;CAMBODIA ;AS ;G +XV ;XV,3W ;VIETNAM ;AS ;G +XW ;XW ;LAOS ;AS ;G +XX9 ;XX9 ;MACAO ;AS ;H +XZ ;XY-XZ,1Z ;MYANMAR ;AS ;f +YA ;YA,T6 ;AFGHANISTAN ;AS ;d +YB ;YB-YH,JZ,PK-PO,7A-7I,8A-8I ;INDONESIA ;OC ;H +YI ;YI ;IRAQ ;AS ;C +YJ ;YJ ;VANUATU ;OC ;L +YK ;YK,6C ;SYRIA ;AS ;B +YL ;YL,UQ ;LATVIA ;EU ;C +YN ;YN,HT,H6-H7 ;NICARAGUA ;NA ;S +YO ;YO-YR ;ROMANIA ;EU ;B +YS ;YS,HU ;EL SALVADOR ;NA ;S +YU ;YT,YU,YZ,4N-4O ;YUGOSLAVIA ;EU ;A +YV0 ;YV0-YY0,4M0 ;AVES IS. ;NA ;Q +YV ;YV-YY,4M ;VENEZUELA ;SA ;Q +ZA ;ZA ;ALBANIA ;EU ;A +ZB ;ZB ;GIBRALTAR ;EU ;A +ZC ;ZC ;UK SOVEREIGN BASES ON CYPRUS ;AS ;B +ZD7 ;ZD7 ;ST HELENA ;AF ;Z +ZD8 ;ZD8 ;ASCENSION IS. ;AF ;Z +ZD9 ;ZD9 ;TRISTAN DE CUNHA & GOUGH IS. ;AF ;Z +ZF ;ZF ;CAYMAN IS. ;NA ;R +ZK1/N ;ZK1CQ,ZK1RS,ZK1BY,ZK1WL,ZK1XP,ZK1XY ;NORTH COOK IS. ;OC ;W +ZK1/S ; ;SOUTH COOK IS ;OC ;W +ZK1/? ;ZK1 ;NORTH COOK IS., /SOUTH COOK IS. ;OC ;W +ZK2 ;ZK2 ;NIUE ;OC ;X +ZK3 ;ZK3 ;TOKELAU IS. ;OC ;X +ZL7 ;ZL7-ZM7 ;CHATHAM IS. ;OC ;M +ZL8 ;ZL8-ZM8 ;KERMADEC IS. ;OC ;M +ZL9 ;ZL9-ZM9 ;AUKLAND & CAMPBELL IS. ;OC ;M +ZL ;ZL-ZM ;NEW ZEALAND ;OC ;M +ZP ;ZP ;PARAGUAY ;SA ;Q +ZS8 ;ZS8MI,ZT8M-ZU8M,ZR8M,ZS8IR ;PRINCE EDWARD & MARION IS. ;AF ;B +!ZS9 ;ZS9 ;WALVIS BAY ;AF +ZS ;ZR-ZU ;REP OF SOUTH AFRICA ;AF ;B +Z2 ;Z2 ;ZIMBABWE ;AF ;B +Z3 ;Z3 ;MACEDONIA (ex YU5,4N5) ;EU ;A +1A0 ;1A0 ;SOVEREIGN MILLITARY ORDER OF MALTA ;EU ;A +1S ;1S,9M0,9M6OO ;SPRATLY IS. ;AS ;H +3A ;3A ;MONACO ;EU ;A +3B6 ;3B6-3B7 ;AGALEGA & ST BRANDON IS. ;AF ;C +3B8 ;3B8 ;MAURITIUS IS. ;AF ;C +3B9 ;3B9 ;RODRIGUEZ IS. ;AF ;C +3C0 ;3C0 ;ANNOBON IS. ;AF ;A +3C ;3C ;EQUATORIAL GUINEA ;AF ;A +3D2/C ;3D2CR,3D2WV,3D2HL,3D2VT,3D2AM,3D2CU,3D2CT ;CONWAY REEF ;OC ;M +3D2/R ;3D2XX,3D2RJ,3D2XV,3D2XR,3D2AP,3D2RO,3D2OQ,3D2RW ;ROTUMA IS ;OC ;M +3D2 ;3D2 ;FIJI IS. ;OC ;M +3DA ;3DA ;SWAZILAND ;AF ;B +3V ;3V,TS ;TUNISIA ;AF ;A +3X ;3X ;GUINEA ;AF ;Z +3Y ;3Y1VC,3Y5X ;BOUVET ;AF ;Z +3Y/P ;3Y1EE,3Y2GV ;PETER 1 IS. ;AN ;S +3Y/? ;3Y ;BOUVET, /PETER 1 IS. ;AF,AN +4J ;4J-4K ;AZERBAIJAN (ex UD) ;AS ;F +4L ;4L ;GEORGIA (ex UF) ;AS ;F +4S ;4P-4S ;SRI LANKA ;AS ;e +4U1/U ;4U1U,4U43-4U44,4U45UN ;UN HEADQUATERS NEW YORK ;NA ;R +4U1/I ;4U?ITU ;ITU GENEVA ;EU ;A +4U1/? ;4U ;UN HEADQUATERS NEW YORK, /ITU GENEVA, etc +!4W ;4W ;YEMEN :AS +4W ;4W ;EAST TIMOR ;OC ;H +4X ;4X,4Z ;ISRAEL ;AS ;B +5A ;5A ;LIBYA ;AF ;B +5B ;5B,C4,H2,P3 ;CYPRUS ;AS ;B +5H ;5H-5I ;TANZANIA ;AF ;C +5N ;5N-5O ;NIGERIA ;AF ;A +5R ;5R-5S,6X ;MADAGASCAR ;AF ;C +5T ;5T ;MAURITANIA ;AF ;Z +5U ;5U ;NIGER ;AF ;A +5V ;5V ;TOGO ;AF ;Z +5W ;5W ;WESTERN SAMOA ;OC ;X +5X ;5X ;UGANDA ;AF ;C +5Y ;5Y-5Z ;KENYA ;AF ;C +6W ;6V-6W ;SENEGAL ;AF ;Z +6Y ;6Y ;JAMAICA ;NA ;R +7O ;7O ;REP OF YEMEN ;AS ;C +7P ;7P ;LESOTHO ;AF ;B +7Q ;7Q ;MALAWI ;AF ;B +7X ;7T-7Y ;ALGERIA ;AF ;Z +8P ;8P ;BARBADOS ;NA ;Q +8Q ;8Q ;MALDIVES ;AS,AF ;E +8R ;8R ;GUYANA ;SA ;P +9A ;9A ;CROATIA (ex YU2) ;EU ;A +9G ;9G ;GHANA ;AF ;Z +9H ;9H ;MALTA ;EU ;A +9J ;9I-9J ;ZAMBIA ;AF ;B +9K ;9K ;KUWAIT ;AS ;C +9L ;9L ;SIERRA LEONE ;AF ;Z +9M2 ;9M2,9M4,9W2,9W4 ;WEST MALAYSIA ;AS ;H +9M6 ;9M6,9M8,9W6,9W8 ;EAST MALAYSIA ;OC ;H +9N ;9N ;NEPAL ;AS ;e +9Q ;9O-9T ;ZAIRE ;AF ;B +9U ;9U ;BURUNDI ;AF ;B +9V ;9V,S6 ;SINGAPORE ;AS ;H +9X ;9X ;RWANDA ;AF ;B +9Y ;9Y-9Z ;TRINIDAD & TOBAGO ;SA ;Q +$END +!---------------------------------------------------------------------------- +!ƒtƒ@ƒCƒ‹‚ÌŒ`Ž® +! ƒJƒ“ƒgƒŠ–¼ ; ƒJƒ“ƒgƒŠŽ¯•ÊŽq ; ‚p‚s‚g ; ‘å—¤–¼ ; ƒ^ƒCƒ€ƒ][ƒ“ +! +!œ@s‚Ìæ“ª‚̂̓Rƒƒ“ƒgƒR[ƒh,<$>‚ÍI—¹ƒR[ƒh +!œ@ƒJƒ“ƒgƒŠ–¼‚Í‚W•¶ŽšˆÈ“àB +!œ@ƒJƒ“ƒgƒŠŽ¯•ÊŽq‚Í<,>‚Å‹æØ‚Á‚Ä•¡”ŒÂ‹Lq‰ÂB +!œ@‚p‚s‚g‚Í”CˆÓ‚Ì•¶Žš—ñ +!œ@‘å—¤–¼‚Í NA, SA, EU, OC, AF, AS, AN +!œ ƒ^ƒCƒ€ƒ][ƒ“‚ÍA`ZiJ‚𜂭j‚Å‹Lq‚·‚éB¬•¶Žš‚Í{‚R‚O•ª +!œ º°ÄÞ‚Í”CˆÓ‚̈ʒu‚É‚ ‚Á‚Ä‚à—Ç‚¢ +!œ@‚Ps‚Q‚T‚T•¶ŽšˆÈ“àB +!œ@’è‹`‚·‚ésiƒRƒƒ“ƒgs‚𜂭j‚ÍÅ‘å‚T‚P‚Qs‚܂Š+!œ@‚±‚̃tƒ@ƒCƒ‹‚ðƒlƒbƒg“™‚Å—¬’Ê‚³‚¹‚éꇂÍAÅŒã‚Ì•ÏX—š—ð‚ɒljÁ‹LÚ‚·‚é +! ‚±‚Æ‚ð‚¨Š©‚ß‚µ‚Ü‚·B +! +!ƒJƒ“ƒgƒŠŽ¯•ÊŽq +! 1.ƒvƒŠƒtƒBƒbƒNƒXiƒR[ƒ‹ƒTƒCƒ“j‚Ì—…—ñ +! 9M2,9M4,9W2,9W4 +! JD1YAA,JD1BIY +! ¦ ƒR[ƒ‹ƒTƒCƒ“‚ª’Z‚¢ê‡‚ÍI’[‹L†i\j‚ð•t‰Á‚µ‚½‚Ù‚¤‚ª—Ç‚¢ +! BV9P ¨ BV9PA‚àŠÜ‚Ü‚ê‚é +! BV9P\ ¨ BV9P‚Ì‚Ý +! +! 2.”͈͂̎w’è +! DA-DR,Y2-Y9 +! EA6-EH6,AM6-AO6 +! ”͈͓͂¯‚¶ˆÊ’u‚Ì‚Pƒ–Š‚Ì‚Ý‚ð¸‡‚Å‹Lq +! JA-JS EA6-EH6 OK +! JS-JA(~‡) EA6-EH7(‚Qƒ–Š) NG +! +! 3.ƒƒCƒ‹ƒhƒJ[ƒhi”͈͂̕¡‡‰Âj +! U?1-U?6,R?1-R?6 +! SV*/A,*/SV/A +! =‚·‚ׂĂ̕¶Žš, <*>=‚·‚ׂĂ̕¶Žš—ñ +! +! 4.ʼn‚É’è‹`‚µ‚½‚Ù‚¤‚ª—D悳‚ê‚é +! JD1/M ;JD1YAA ; MINAMI TORISHIMA ;OC +! JA ;JA-JS ; JAPAN ;AS +! ã‹L‚Ì—á‚Å‚ÍJD1YAA‚ÍJA-JS‚É‚àŠÜ‚Ü‚ê‚邪A‚»‚Ì‘O‚ÉJD1/M‚Ì’è‹` +! ‚ª‚ ‚é‚̂ł»‚¿‚炪—D悳‚ê‚é +! +!<<<•ÏX—š—ð>>> +! Jan 15, 1996 - BV9P’ljÁ JE3HHT +! Feb 15, 1996 - BS7H’ljÁ JE3HHT +! Aug. 4, 1998 - VR98’ljÁ@JQ3UDL +! Aug. 4, 1998 - TA(AS)•ÏX@JQ3UDL +! Nov. 15, 1998 - BQ9P’ljÁ@JQ3UDL +! Feb. 7, 1999 - FO0/M’ljÁ@JQ3UDL +! Feb. 7, 1999 - FO0/A’ljÁ@JQ3UDL +! Feb. 7, 1999 - H40’ljÁ@JQ3UDL +! Jul. 10, 1999 - E4’ljÁ@ JQ3UDL +! Nov. 15. 1999 - 9M6OO’ljÁ JQ3UDL +! Nov. 20. 1999 - B1-B9’ljÁ JQ3UDL +! Jan. 06. 2000 - ST0íœ JE3HHT +! Feb. 15. 2000 - VR6‚ÉVP6’ljÁ JE3HHT +! Mar. 03. 2000 - FO0X‚ÉFO0AAA’ljÁ JE3HHT +! Mar. 20. 2000 - FO0X=>FO/C,FO0/M=>FO/M,FO0/A=>FO/A‚É•ÏX JQ3UDL +! Mar. 20. 2000 - 4W’ljÁ JQ3UDL +! Mar. 21. 2000 - TX0’ljÁ JE3HHT +! Jan. 07. 2001 - P2‚͈͕̔ÏX JQ3UDL +! Jan. 08. 2001 - KG4”͈͕ÏX JQ3UDL +! Jan. 08. 2001 - LZ0A’ljÁ JQ3UDL + \ No newline at end of file diff --git a/App.ico b/App.ico new file mode 100644 index 0000000..f3368fd Binary files /dev/null and b/App.ico differ diff --git a/App2.ico b/App2.ico new file mode 100644 index 0000000..3b5b5c1 Binary files /dev/null and b/App2.ico differ diff --git a/CLX.cpp b/CLX.cpp new file mode 100644 index 0000000..83b33ca --- /dev/null +++ b/CLX.cpp @@ -0,0 +1,82 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "math.h" +#include "CLX.h" + +///---------------------------------------------------------------- +/// •¡‘f”‰‰ŽZƒNƒ‰ƒX +void CLX::Div(const CLX &ref) +{ + double R, J, D; + R = r * ref.r + j * ref.j; + J = j * ref.r - r * ref.j; + D = ref.r * ref.r + ref.j * ref.j; + if( D ){ + r = R/D; + j = J/D; + } + else { + r = R >= 0 ? 1e100 : -1e100; + j = J >= 0 ? 1e100 : -1e100; + } +} + +CLX CLX::Sqrt(void) +{ + CLX a; + + double R, ST; + R = sqrt(sqrt(r*r + j*j)); + ST = 0; + if( r ) ST = atan2(j, r)/2.0; + a.r = R*cos(ST); + a.j = R*sin(ST); + return a; +} + +CLX operator+(const double R, const CLX &ref) +{ + CLX a(R); + a+=ref; + return a; +} +CLX operator-(const double R, const CLX &ref) +{ + CLX a(R); + a-=ref; + return a; +} +CLX operator*(const double R, const CLX &ref) +{ + CLX a(R); + a*=ref; + return a; +} +CLX operator/(const double R, const CLX &ref) +{ + CLX a(R); + a/=ref; + return a; +} +#pragma package(smart_init) diff --git a/CLX.h b/CLX.h new file mode 100644 index 0000000..2c8ff3e --- /dev/null +++ b/CLX.h @@ -0,0 +1,181 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------------- +#ifndef CLXH +#define CLXH +//--------------------------------------------------------------------------- +///---------------------------------------------------------------- +/// •¡‘f”‰‰ŽZƒNƒ‰ƒX +class CLX { +public: + double r; + double j; + inline CLX(void){}; + inline CLX(const double R){ + r = R; + j = 0; + }; + inline CLX(const double R, const double J){ + r = R; + j = J; + }; + inline CLX(CLX &ref){ + r = ref.r; + j = ref.j; + }; + inline void Add(const CLX &ref){ + r += ref.r; + j += ref.j; + }; + inline void Add(const double &R){ + r += R; + }; + inline void Sub(const CLX &ref){ + r -= ref.r; + j -= ref.j; + }; + inline void Sub(const double &R){ + r -= R; + }; + inline double Abs(void){ + return sqrt(r * r + j * j); + }; + inline double vAbs(void){ + return r * r + j * j; + }; + inline void Mul(CLX &z, const CLX &ref){ + z.r = r * ref.r - j * ref.j; + z.j = r * ref.j + j * ref.r; + } + inline void Mul(const CLX &ref){ + CLX z; + z.r = r * ref.r - j * ref.j; + z.j = r * ref.j + j * ref.r; + r = z.r; j = z.j; + }; + void Div(const CLX &ref); + inline void Mul(const double &R){ + r *= R; j *= R; + } + inline void Div(const double &R){ + r /= R; j /= R; + } + CLX Sqrt(void); + inline void PhDiff(CLX &z, const CLX &ref){ + z.r = r * ref.r + j * ref.j; + z.j = j * ref.r - r * ref.j; + + }; + inline double Phase(void){ + if( r && j ){ + return atan2(j, r); + } + else { + return 0; + } + }; + inline BOOL IsSame(const CLX &ref){ + return ((r == ref.r) && (j == ref.j)); + }; + inline CLX& operator=(const CLX &ref){ + if( this != &ref ){ + r = ref.r; + j = ref.j; + } + return *this; + }; + inline CLX& operator+=(const CLX &ref){ + Add(ref); + return *this; + }; + inline CLX& operator+=(const double R){ + Add(R); + return *this; + }; + inline CLX& operator-=(const CLX &ref){ + Sub(ref); + return *this; + }; + inline CLX& operator-=(const double R){ + Sub(R); + return *this; + }; + inline CLX& operator*=(const CLX &ref){ + Mul(ref); + return *this; + }; + inline CLX& operator*=(const double R){ + Mul(R); + return *this; + }; + inline CLX& operator/=(const CLX &ref){ + Div(ref); + return *this; + }; + inline CLX& operator/=(const double R){ + Div(R); + return *this; + }; + inline CLX operator+(const CLX &ref) const { + CLX a(r, j); + a+=ref; + return a; + }; + inline CLX operator+(const double R) const { + CLX a(r, j); + a+=R; + return a; + }; + inline CLX operator-(const CLX &ref) const { + CLX a(r, j); + a-=ref; + return a; + }; + inline CLX operator-(const double R) const { + CLX a(r, j); + a-=R; + return a; + }; + inline CLX operator*(const CLX &ref) const { + CLX a(r, j); + a*=ref; + return a; + }; + inline CLX operator*(const double R) const { + CLX a(r, j); + a*=R; + return a; + }; + inline CLX operator/(const CLX &ref) const { + CLX a(r, j); + a/=ref; + return a; + }; + inline CLX operator/(const double R) const { + CLX a(r, j); + a/=R; + return a; + }; + friend CLX operator+(const double R, const CLX &ref); + friend CLX operator-(const double R, const CLX &ref); + friend CLX operator*(const double R, const CLX &ref); + friend CLX operator/(const double R, const CLX &ref); +}; +#endif diff --git a/COPYING.LESSER.txt b/COPYING.LESSER.txt new file mode 100644 index 0000000..02bbb60 --- /dev/null +++ b/COPYING.LESSER.txt @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. \ No newline at end of file diff --git a/COPYING.txt b/COPYING.txt new file mode 100644 index 0000000..20d40b6 --- /dev/null +++ b/COPYING.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file diff --git a/ClockAdj.cpp b/ClockAdj.cpp new file mode 100644 index 0000000..b3705fe --- /dev/null +++ b/ClockAdj.cpp @@ -0,0 +1,449 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "ClockAdj.h" +#include "Main.h" +//--------------------------------------------------------------------- +#pragma resource "*.dfm" +//TClockAdjDlg *ClockAdjDlg; +static int s_Gain = 0x0108; +//--------------------------------------------------------------------- +__fastcall TClockAdjDlg::TClockAdjDlg(TComponent* AOwner) + : TForm(AOwner) +{ + FormStyle = ((TForm *)AOwner)->FormStyle; + pBitmap = new Graphics::TBitmap(); + pBitmap->Width = PaintBox->Width; + pBitmap->Height = PaintBox->Height; +// pBitmap->Palette = MmttyWd->UsrPal; + + switch(SampType){ + case 0: + UpDown->Max = 11599; + UpDown->Min = 10000; + break; + case 1: + UpDown->Max = 9999; + UpDown->Min = 7000; + break; + case 2: + UpDown->Max = 6999; + UpDown->Min = 5000; + break; + case 3: + UpDown->Max = 12500; + UpDown->Min = 11600; + break; + } + TRect rc; + int XL = 0; + int XR = pBitmap->Width - 1; + int YT = 0; + int YB = pBitmap->Height - 1; + rc.Left = XL; + rc.Right = XR; + rc.Top = YT; + rc.Bottom = YB+1; + TCanvas *cp = pBitmap->Canvas; + cp->Brush->Color = clBlack; + cp->FillRect(rc); + + m_CursorX = XR - 20; + + pDem = NULL; + pTick = NULL; + Font->Name = ((TForm *)AOwner)->Font->Name; + Font->Charset = ((TForm *)AOwner)->Font->Charset; + cp->Font->Name = ((TForm *)AOwner)->Font->Name; + cp->Font->Charset = ((TForm *)AOwner)->Font->Charset; + cp->Font->Color = clWhite; + cp->Font->Size = 10; + int FH = cp->TextHeight("A"); + int Y = 5; + if( Font->Charset != SHIFTJIS_CHARSET ){ + Caption = "Calibrating the Sound Card with a Time Standard Broadcast Station"; +// "Adjust Sampling Frequency using an off-air time signal"; +// Caption = "Adjust Sampling freq. (Recive WWV tick sound on Mark freq.)"; + CancelBtn->Caption = "Cancel"; + + cp->TextOut(10, Y, "1.Tune your radio to WWV or another 1-second tick standard. Set the radio display"); Y+=FH; + cp->TextOut(10, Y, " to the carrier frequency."); Y+=FH; + cp->TextOut(10, Y, "2.Wait for about three minutes. If you are using 11025 Hz. calibration, you should"); Y+=FH; + cp->TextOut(10, Y, " see two lines of marks (vertical or slanted), corresponding to the 1-second tick"); Y+=FH; + cp->TextOut(10, Y, " sound bursts transmitted by the time-standard broadcast station. You will see only"); Y+=FH; + cp->TextOut(10, Y, " one line with 8000 Hz. or 6000 Hz."); Y+=FH; + cp->TextOut(10, Y, "3.Right-click to move the vertical green line to the tick line. This allows you to"); Y+=FH; + cp->TextOut(10, Y, " compare the tick line to vertical."); Y+=FH; + cp->TextOut(10, Y, "4.Left-click a low tick burst mark (bottom one if possible), and move the cursor to"); Y+=FH; + cp->TextOut(10, Y, " the top of the line. You will see a yellow line on the display."); Y+=FH; + cp->TextOut(10, Y, "5.Overlay the yellow line with the tick mark line, and left-click a high burst mark"); Y+=FH; + cp->TextOut(10, Y, " (top one if possible)."); Y+=FH; + cp->TextOut(10, Y, "6.This will automatically put the correct clock frequency in the adjust window."); Y+=FH; + cp->TextOut(10, Y, "7.Click OK to leave the setup display and to memorize the new value."); Y+=FH; + cp->TextOut(10, Y, "8.Restart MMTTY for the new clock value to take effect."); + +#if 0 + cp->TextOut(10, 10, "1.Receive WWV in AM or SSB mode. Tune the radio to the carrier frequency."); + cp->TextOut(10, 30, "2.Let this adjustment display run for a few minutes, and look for one or two"); + cp->TextOut(10, 50, " almost-vertical lines of dots. If you do not see this, wait for up to ten minutes."); + cp->TextOut(10, 70, "3.If your sound card clock is far out of adjustment, the lines will be very slanted."); + cp->TextOut(10, 90, "4.Click the 1st point on the slanted line."); + cp->TextOut(10,110, "5.And then click the 2nd point on the same line. The value of clock will be revised"); + cp->TextOut(10,130, " automatically. If there is distance of 1st point and 2nd point, precision is better."); + cp->TextOut(10,160, "If the first degree of slant is very big, please repeat once again, because an error"); + cp->TextOut(10,180, "remains a little."); + cp->TextOut(10,200, "WWV - 2.5, 5, 10MHz // GBR - 60KHz // RWM - 4.996, 9.996, 14.996MHz"); + cp->TextOut(10,240, "Left click - Start adjustment"); + cp->TextOut(10,260, "Right click - Move vertical cursor"); +#endif + } + else { + cp->TextOut(10, Y, "1.JJY‚ðAM‚Ü‚½‚ÍSSB‚ÅŽóM‚µA‚±‚̉æ–ʂ̉º‚É‚ ‚éMark‚É1000Hz‚Ü‚½‚Í"); Y+=FH; + cp->TextOut(10, Y, " 1600Hz‚ðݒ肵‚Ü‚·."); Y+=FH; + cp->TextOut(10, Y, "2.SSB‚Ìꇂ͂P•bƒ`ƒbƒN‰¹‚ªMark‚Éd‚È‚é‚æ‚¤‚ÉŽóMŽü”g”‚ð’²®‚µ‚Ü‚·."); Y+=FH; + cp->TextOut(10, Y, "3.‚µ‚΂炭ŽóM‚µ‚Äc‚Ü‚½‚͎΂߃‰ƒCƒ“‚ª•\ަ‚³‚ê‚é‚Ì‚ð‘Ò‚¿‚Ü‚·i”•ªj."); Y+=FH; + cp->TextOut(10, Y, "4.ü‚ª‚’¼‚Ìꇂ̓NƒƒbƒN’l‚ͳŠm‚Å‚·BŽÎ‚߂ɂȂÁ‚Ä‚¢‚éꇂÍA"); Y+=FH; + cp->TextOut(10, Y, " ‚»‚̎΂ßü‚Ìʼn‚Ì’[“_‚ðƒNƒŠƒbƒN‚µ‚Ü‚·."); Y+=FH; + cp->TextOut(10, Y, "5.X‚É“¯‚¶ŽÎ‚ßü‚Ì”½‘Α¤‚Ì’[“_‚ðƒNƒŠƒbƒN‚·‚邯ƒNƒƒbƒN’l‚ªŽ©“®“I‚É"); Y+=FH; + cp->TextOut(10, Y, " ݒ肳‚ê‚Ü‚·.i2“_ŠÔ‚Ì‹——£‚ª’·‚¢‚Ù‚¤‚ª³Šm‚Å‚·j"); Y+=FH; + cp->TextOut(10, Y, "ŒXŽÎ‚ª”ñí‚ɑ傫‚¢ê‡Aã‹L‚̎葱‚«‚ð‚à‚¤ˆê“xŒJ‚è•Ô‚µ‚ĉº‚³‚¢."); Y+=FH+FH; + cp->TextOut(10, Y, "JJY‚Ì‘ã‚í‚è‚ÉAJMH,JMG‚ȂǂÌFAX•ú‘—‚Ì0.5•b–ˆ‚̃fƒbƒhƒZƒNƒ^‚ð—˜—p‚µ‚Ä‚à"); Y+=FH; + cp->TextOut(10, Y, "OK‚̂悤‚Å‚·."); Y+=FH; + cp->TextOut(10, Y, "¶ƒNƒŠƒbƒN - ’²®‚ÌŠJŽn"); Y+=FH; + cp->TextOut(10, Y, "‰EƒNƒŠƒbƒN - ‚’¼ƒJ[ƒ\ƒ‹ˆÚ“®"); + } + m_agcMax = 8192; + m_agcMin = 0; + m_agcSumMax = 8192 * AGCAVG; + m_Point = 0; +// SBHelp->Visible = !JanHelp.IsEmpty(); + SBHelp->Visible = FALSE; +} +//--------------------------------------------------------------------- +__fastcall TClockAdjDlg::~TClockAdjDlg() +{ + pDem = NULL; + pTick = NULL; + pBitmap->Palette = NULL; + delete pBitmap; + pBitmap = NULL; +} +//--------------------------------------------------------------------------- +// Œ»Ý‚̘_—ƒpƒŒƒbƒg‚ð•Ô‚·iTControl::GetPalette‚̃I[ƒoƒ‰ƒCƒhŠÖ”j +HPALETTE __fastcall TClockAdjDlg::GetPalette(void) +{ + pBitmap->Palette = MmttyWd->UsrPal; + return MmttyWd->UsrPal; +} +//--------------------------------------------------------------------------- +void __fastcall TClockAdjDlg::UpdateTB(void) +{ + TBGAIN->Enabled = !SBAGC->Down; + LG->Font->Color = SBAGC->Down ? clGrayText : clBlack; +} +//--------------------------------------------------------------------- +void __fastcall TClockAdjDlg::UpdatePPM(void) +{ + int d = ((UpDown->Position - SampBase) * 1000000.0 / SampBase) + 0.5; + + char bf[64]; + sprintf(bf, "%d ppm", d); + LPPM->Caption = bf; +} +//--------------------------------------------------------------------- +int __fastcall TClockAdjDlg::Execute(TSound *p, double &Samp) +{ + pSound = p; + pDem = &p->FSKDEM; + pTick = &pDem->Tick; + pTick->m_Samp = int(Samp); + InitColorTable(clBlack, clWhite); + MmttyWd->ReqPaletteChange(); + if( (Samp > UpDown->Max) || (Samp < UpDown->Max) ){ + Samp = SampFreq; + } + EditClock->Text = int(Samp); + UpDown->Position = SHORT(Samp); + pDem->Tick.Init(); + pDem->m_Tick = 1; + m_DisEvent++; + double SaveMarkFreq = pDem->GetMarkFreq(); + double SaveSpaceFreq = pDem->GetSpaceFreq(); + int SaveAFC = sys.m_AFC; + int SaveBPF = pSound->m_bpf; + int SaveType = pSound->FSKDEM.m_type; + pSound->m_bpf = 0; + sys.m_AFC = 0; + if( SaveType == 2 ) pSound->FSKDEM.m_type = 0; + UDMark->Position = 1000; + pDem->SetMarkFreq(1000.0); + pDem->SetSpaceFreq(1200.0); + TBGAIN->Position = s_Gain & 0x00ff; + SBAGC->Down = s_Gain & 0xff00 ? 1 : 0; + UpdateTB(); + m_DisEvent--; + UpdatePPM(); + int r = ShowModal(); + InitColorTable(sys.m_ColorLow, sys.m_ColorHigh); + s_Gain = (s_Gain & 0x00ff) | (SBAGC->Down ? 0x0100 : 0); + pDem->m_Tick = 0; + pDem->SetMarkFreq(SaveMarkFreq); + pDem->SetSpaceFreq(SaveSpaceFreq); + sys.m_AFC = SaveAFC; + pSound->m_bpf = SaveBPF; + pSound->FSKDEM.m_type = SaveType; + MmttyWd->ReqPaletteChange(); + if( r == IDOK ){ + Samp = UpDown->Position; + return TRUE; + } + else { + return FALSE; + } +} +//--------------------------------------------------------------------- +void __fastcall TClockAdjDlg::TimerTimer(TObject *Sender) +{ + if( pBitmap == NULL ) return; + if( pDem == NULL ) return; + if( pTick == NULL ) return; + + int *p = pTick->GetData(); + if( p == NULL ) return; + + TCanvas *tp = pBitmap->Canvas; + TRect rc; + int XL = 0; + int XR = pBitmap->Width - 1; + int YT = 0; + int YB = pBitmap->Height - 1; + rc.Left = XL; + rc.Right = XR; + rc.Top = YT; + rc.Bottom = YB+1; + + TRect src(rc); + src.Bottom--; + rc.Top++; + tp->CopyRect(rc, tp, src); + + int mx = -MAXINT; + int mi = MAXINT; + int x, xx, d; + double k1 = 16384.0/double(m_agcMax - m_agcMin); + double k2; + if( SBAGC->Down ){ + k2 = 128.0 / 16384.0; + } + else { + k2 = (128.0 * (s_Gain & 0x00ff)) / (4096 * 16); + } + for( x = 0; x < XR; x++){ + xx = (x * pTick->m_Samp)/pBitmap->Width; + d = p[xx]; + if( mx < d ) mx = d; + if( mi > d ) mi = d; + if( SBAGC->Down ){ + d -= m_agcMin; + if( m_agcMax > 0 ) d = double(d) * k1; + } + d = double(d) * k2; + + if( d >= 128 ) d = 127; + if( d <= 0 ) d = 0; + tp->Pixels[x][0] = TColor(ColorTable[127-d] | sys.d_PaletteMask); + } + m_agcSumMax -= m_agcMax; + m_agcSumMax += mx; + if( m_agcSumMax < (4096*AGCAVG) ) m_agcSumMax = (4096*AGCAVG); + m_agcMax = m_agcSumMax / AGCAVG; + m_agcMin = mi; + if( m_agcMin > 2048 ) m_agcMin = 2048; + m_PointY++; + PaintBox->Canvas->Draw(0, 0, (TGraphic*)pBitmap); + PaintCursor(); +#if 0 + PaintBox->Canvas->Font->Color = clWhite; + char bf[128]; + sprintf(bf, "curMax:%d", mx); + PaintBox->Canvas->TextOut( 500, 200, bf ); + sprintf(bf, "agcMax:%d", m_agcMax); + PaintBox->Canvas->TextOut( 500, 220, bf ); + sprintf(bf, "agcMin:%d", m_agcMin); + PaintBox->Canvas->TextOut( 500, 240, bf ); + sprintf(bf, "SumMax:%d", m_agcSumMax); + PaintBox->Canvas->TextOut( 500, 260, bf ); +#endif +} +//--------------------------------------------------------------------------- +void __fastcall TClockAdjDlg::DrawMessage(LPCSTR p) +{ + int xr = PaintBox->Canvas->TextWidth(p); + int xl = (PaintBox->Width - xr)/2; + xr += xl; + int FH = PaintBox->Canvas->TextHeight(p); + int VC = PaintBox->Height - FH; + PaintBox->Canvas->Pen->Color = clWhite; + PaintBox->Canvas->Brush->Color = clBlack; + PaintBox->Canvas->RoundRect(xl-10, VC-FH, xr+10, VC+FH, 10, 10); + PaintBox->Canvas->Font->Color = clWhite; + PaintBox->Canvas->TextOut(xl, VC-FH/2, p); +} +//--------------------------------------------------------------------------- +void __fastcall TClockAdjDlg::PaintCursor(void) +{ + PaintBox->Canvas->Pen->Color = clLime; + PaintBox->Canvas->Pen->Style = psDot; + PaintBox->Canvas->MoveTo(m_CursorX, 0); + int rop = ::SetROP2(PaintBox->Canvas->Handle, R2_MASKPENNOT); + PaintBox->Canvas->LineTo(m_CursorX, pBitmap->Height - 1); + ::SetROP2((HDC)PaintBox->Canvas, rop); + if( m_Point ){ + PaintBox->Canvas->Pen->Color = clYellow; + PaintBox->Canvas->Pen->Style = psSolid; + PaintBox->Canvas->MoveTo(m_PointX, m_PointY); + ::SetROP2(PaintBox->Canvas->Handle, R2_MASKPENNOT); + PaintBox->Canvas->LineTo(m_PointX2, m_PointY2); + ::SetROP2((HDC)PaintBox->Canvas, rop); + char bf[256]; + if( Font->Charset != SHIFTJIS_CHARSET ){ + sprintf( bf, "OK : Left button, Cancel : Right button Clock=%.1lf", GetPointSamp()); + } + else { + sprintf( bf, "Œˆ’è : ¶ƒ{ƒ^ƒ“, ’†Ž~ : ‰Eƒ{ƒ^ƒ“ Clock=%.1lf", GetPointSamp()); + } + DrawMessage(bf); + if( PaintBox->Cursor != crCross ) PaintBox->Cursor = crCross; + } + else { + if( PaintBox->Cursor != crDefault ) PaintBox->Cursor = crDefault; + } +} +//--------------------------------------------------------------------------- +void __fastcall TClockAdjDlg::UpDownClick(TObject *Sender, TUDBtnType Button) +{ + if( pTick == NULL ) return; + + pTick->m_Samp = UpDown->Position; + UpdatePPM(); +} +//--------------------------------------------------------------------------- +void __fastcall TClockAdjDlg::PaintBoxPaint(TObject *Sender) +{ + PaintBox->Canvas->Draw(0, 0, (TGraphic*)pBitmap); + PaintCursor(); +} +//--------------------------------------------------------------------------- +void __fastcall TClockAdjDlg::PaintBoxMouseUp(TObject *Sender, + TMouseButton Button, TShiftState Shift, int X, int Y) +{ + if( Button == mbLeft ){ + if( m_Point ){ + m_Point = 0; + if( m_PointY2 != m_PointY ){ + int newc = int(GetPointSamp() + 0.5); + pTick->m_Samp = newc; + UpDown->Position = SHORT(newc); + ModalResult = mrOk; + } + } + else { + m_PointX2 = m_PointX = X; + m_PointY2 = m_PointY = Y; + m_Point = 1; + } + } + else if( m_Point ){ + m_Point = 0; + } + else { + m_CursorX = X; + } + PaintBox->Canvas->Draw(0, 0, (TGraphic*)pBitmap); + PaintCursor(); +} +//--------------------------------------------------------------------------- +void __fastcall TClockAdjDlg::MarkFreqChange(TObject *Sender) +{ + if( m_DisEvent ) return; + + int dd; + if( sscanf(AnsiString(MarkFreq->Text).c_str(), "%lu", &dd ) == 1){ //JA7UDE 0428 + if( (dd >= 300) && (dd <= 2700) ){ + m_DisEvent++; + UDMark->Position = SHORT(dd); + pDem->SetMarkFreq(dd); + pDem->SetSpaceFreq(dd + 200); + m_DisEvent--; + } + } +} +//--------------------------------------------------------------------------- +void __fastcall TClockAdjDlg::TBGAINChange(TObject *Sender) +{ + s_Gain = (s_Gain & 0xff00) | TBGAIN->Position; +} +//--------------------------------------------------------------------------- +void __fastcall TClockAdjDlg::UDMarkClick(TObject *Sender, TUDBtnType Button) +{ + if( m_DisEvent ) return; + + pDem->SetMarkFreq(UDMark->Position); + pDem->SetSpaceFreq(UDMark->Position + 200); +} +//--------------------------------------------------------------------------- +void __fastcall TClockAdjDlg::SBAGCClick(TObject *Sender) +{ + UpdateTB(); +} +//--------------------------------------------------------------------------- +double __fastcall TClockAdjDlg::GetPointSamp(void) +{ + if( m_PointY == m_PointY2 ) return pTick->m_Samp; + double d = (m_PointX2 - m_PointX); + d = d * pTick->m_Samp / pBitmap->Width; + d /= (m_PointY - m_PointY2); + d += pTick->m_Samp; + return d; +} +//--------------------------------------------------------------------------- +void __fastcall TClockAdjDlg::PaintBoxMouseMove(TObject *Sender, + TShiftState Shift, int X, int Y) +{ + if( m_Point ){ + m_PointX2 = X; + m_PointY2 = Y; + PaintBox->Canvas->Draw(0, 0, (TGraphic*)pBitmap); + PaintCursor(); + } +} +//--------------------------------------------------------------------------- +void __fastcall TClockAdjDlg::SBHelpClick(TObject *Sender) +{ +#if 1 + ShowHtmlHelp(); +#else + ShowHelp(25); +#endif +} +//--------------------------------------------------------------------------- diff --git a/ClockAdj.dfm b/ClockAdj.dfm new file mode 100644 index 0000000..63c84a0 Binary files /dev/null and b/ClockAdj.dfm differ diff --git a/ClockAdj.h b/ClockAdj.h new file mode 100644 index 0000000..66458e2 --- /dev/null +++ b/ClockAdj.h @@ -0,0 +1,118 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//---------------------------------------------------------------------------- +#ifndef ClockAdjH +#define ClockAdjH +//---------------------------------------------------------------------------- +/* JA7UDE 0428 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +*/ +#include "Comlib.h" +#include "sound.h" +#include +#include +#include +#include +#include +#include +//---------------------------------------------------------------------------- +#define AGCAVG 4 +//---------------------------------------------------------------------------- +class TClockAdjDlg : public TForm +{ +__published: + TButton *OKBtn; + TButton *CancelBtn; + TPanel *Panel; + TPaintBox *PaintBox; + TEdit *EditClock; + TLabel *Label1; + TUpDown *UpDown; + TTimer *Timer; + TComboBox *MarkFreq; + TLabel *Label2; + TLabel *LPPM; + TTrackBar *TBGAIN; + TUpDown *UDMark; + TSpeedButton *SBAGC; + TLabel *LG; + TSpeedButton *SBHelp; + void __fastcall TimerTimer(TObject *Sender); + void __fastcall UpDownClick(TObject *Sender, TUDBtnType Button); + void __fastcall PaintBoxPaint(TObject *Sender); + void __fastcall PaintBoxMouseUp(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y); + + void __fastcall MarkFreqChange(TObject *Sender); + void __fastcall TBGAINChange(TObject *Sender); + + void __fastcall UDMarkClick(TObject *Sender, TUDBtnType Button); + void __fastcall SBAGCClick(TObject *Sender); + void __fastcall PaintBoxMouseMove(TObject *Sender, TShiftState Shift, int X, + int Y); + + void __fastcall SBHelpClick(TObject *Sender); +private: + Graphics::TBitmap *pBitmap; + TSound *pSound; + CFSKDEM *pDem; + CTICK *pTick; + + int m_DisEvent; + + int m_agcMin; + int m_agcMax; + int m_agcSumMax; + + DYNAMIC HPALETTE __fastcall GetPalette(void); + void __fastcall UpdateTB(void); + void __fastcall UpdatePPM(void); + void __fastcall PaintCursor(void); + int m_CursorX; + + void __fastcall DrawMessage(LPCSTR p); + double __fastcall GetPointSamp(void); + int m_Point; + int m_PointX; + int m_PointY; + int m_PointX2; + int m_PointY2; + + AnsiString m_Help; +public: + virtual __fastcall TClockAdjDlg(TComponent* AOwner); + __fastcall TClockAdjDlg::~TClockAdjDlg(); + + int __fastcall Execute(TSound *p, double &Samp); +}; +//---------------------------------------------------------------------------- +//extern TClockAdjDlg *ClockAdjDlg; +//---------------------------------------------------------------------------- +#endif diff --git a/ComLib.cpp b/ComLib.cpp new file mode 100644 index 0000000..048053d --- /dev/null +++ b/ComLib.cpp @@ -0,0 +1,3590 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba, Dave Bernstein +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "ComLib.h" +#include "rtty.h" +#include "LogFile.h" +//--------------------------------------------------------------------------- +enum TFontPitch { fpDefault, fpVariable, fpFixed }; //JA7UDE 0427 +//--------------------------------------------------------------------------- +//#define SYSMB 1 // MessageBox 0-Application, 1-System +// +char BgnDir[256]; // ‹N“®ƒfƒBƒŒƒNƒgƒŠ +char LogDir[256]; // ŽóM‹L˜^‚̃fƒBƒŒƒNƒgƒŠ +char OutFileDir[256]; // ƒeƒLƒXƒg‘—Mƒtƒ@ƒCƒ‹‚̃fƒBƒGƒNƒgƒŠ +char MMLogDir[256]; // MMLOGƒtƒ@ƒCƒ‹‚̃fƒBƒŒƒNƒgƒŠ +char ExtLogDir[256]; // ƒGƒNƒXƒ|[ƒgƒtƒ@ƒCƒ‹‚̃fƒBƒŒƒNƒgƒŠ +char RecDir[256]; // ˜^‰¹ƒtƒ@ƒCƒ‹‚̃fƒBƒŒƒNƒgƒŠ +AnsiString JanHelp; + +int WinNT; +int WinVista; //AA6YQ 1.66G + +int FSKCount; +int FSKCount1; +int FSKCount2; +int FSKDeff; + +double SampFreq = 11025.0; // ƒTƒ“ƒvƒŠƒ“ƒOŽü”g” +double SampBase = 11025.0; +double DemSamp = 11025.0*0.5; +int DemOver = 1; +int SampType = 0; +int SampSize = 1024; +int FFT_SIZE=2048; + +SYSSET sys; +LCID lcid; // ƒƒP[ƒ‹î•ñ +DWORD ColorTable[128]; +int DisPaint; +int Remote; +//--------------------------------------------------------------------------- +void __fastcall ShowHtmlHelp(LPCSTR pContext) +{ + char bf[512]; + + sprintf(bf, "%s%s", BgnDir, sys.m_HTMLHelp.c_str()); + FILE *fp; + if( (fp = fopen(bf, "rb"))!=NULL ){ + fclose(fp); + + HWND hd; + if( Screen->ActiveForm != NULL ){ + hd = Screen->ActiveForm->Handle; + } + else { + hd = Application->MainForm->Handle; + } + + if( !strcmpi(GetEXT(bf), "HLP") ){ + ::WinHelp(hd, bf, HELP_FINDER, 0); + } + else if( !strcmpi(GetEXT(bf), "CHM") ){ + if( pContext ){ + char cmd[512]; + sprintf(cmd, "HH.EXE %s::/%s", bf, pContext); + ::WinExec(cmd, SW_SHOWDEFAULT); + } + else { + ::ShellExecute(hd, "open", bf, NULL, NULL, SW_SHOWDEFAULT); + } + } + else { + CWebRef WebRef; + WebRef.ShowHTML(bf); + } + } + else if((sys.m_WinFontCharset != SHIFTJIS_CHARSET )){ + ErrorMB( "'%s' was not found.\r\n\r\nPlease search in the MMTTY English Web Site.", sys.m_HTMLHelp.c_str()); + } + else { + ErrorMB( "'%s'‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ.\r\n\r\nMMTTY English Web Site ‚©‚çƒ_ƒEƒ“ƒ[ƒh‚µ‚ĉº‚³‚¢.", sys.m_HTMLHelp.c_str()); + } +} +#if 0 // Delete by JE3HHT on 29.Sep.2010 +void ShowHelp(int index) +{ + if( !JanHelp.IsEmpty() ){ + HWND hd; + if( Screen->ActiveForm != NULL ){ + hd = Screen->ActiveForm->Handle; + } + else { + hd = Application->MainForm->Handle; + } + if( index != -1 ){ + ::WinHelp(hd, JanHelp.c_str(), HELP_CONTEXT, index); + } + else { + ::WinHelp(hd, JanHelp.c_str(), HELP_FINDER, 0); + } + } +} +#endif +//--------------------------------------------------------------------------- +void InitSampType(void) +{ + if( SampFreq >= 11600.0 ){ + SampType = 3; + SampBase = 12000.0; + DemSamp = SampFreq * 0.5; + DemOver = 1; + FFT_SIZE = 2048; + SampSize = (12000*1024)/11025; + } + else if( SampFreq >= 10000.0 ){ + SampType = 0; + SampBase = 11025.0; + DemSamp = SampFreq * 0.5; + DemOver = 1; + FFT_SIZE = 2048; + SampSize = 1024; + } + else if( SampFreq >= 7000.0 ){ + SampType = 1; + SampBase = 8000.0; + DemSamp = SampFreq; + DemOver = 0; + FFT_SIZE = 1024; + SampSize = (8000*1024)/11025; + } + else if( SampFreq >= 5000.0 ){ + SampType = 2; + SampBase = 6000.0; + DemSamp = SampFreq; + DemOver = 0; + FFT_SIZE = 1024; + SampSize = (6000*1024)/11025; + } +} +//--------------------------------------------------------------------------- +int IsFile(LPCSTR pName) +{ + if( FileExists( pName ) ) //JA7UDE 0428 + return 1; + else + return 0; + /* + FILE *fp; + fp = fopen(pName, "rb"); + if( fp != NULL ){ + fclose(fp); + return 1; + } + else { + return 0; + } + */ +} +//--------------------------------------------------------------------------- +int SetTimeOffsetInfo(int &Hour, int &Min) +{ + TIME_ZONE_INFORMATION tz; + + int off; + switch(GetTimeZoneInformation(&tz)){ + case TIME_ZONE_ID_STANDARD: + off = tz.StandardBias; + break; + case TIME_ZONE_ID_DAYLIGHT: + off = tz.DaylightBias; + break; + default: + return FALSE; + } + if( off >= 0 ){ + Hour = -(off / 60); + Min = (off % 60); + } + else { + off = -off; + Hour = off / 60; + Min = off % 60; + } + return TRUE; +} +//--------------------------------------------------------------------------- +void AddjustOffset(SYSTEMTIME *tp) +{ + if( sys.m_TimeOffset || sys.m_TimeOffsetMin ){ +//typedef struct _SYSTEMTIME { /* st */ +// WORD wYear; +// WORD wMonth; +// WORD wDayOfWeek; +// WORD wDay; +// WORD wHour; +// WORD wMinute; +// WORD wSecond; +// WORD wMilliseconds; +//} SYSTEMTIME; + + + LPCSTR mt; + int Hour = tp->wHour; + int Min = tp->wMinute; + Min += sys.m_TimeOffsetMin; + if( Min >= 60 ){ + Hour++; + Min -= 60; + } + else if( Min < 0 ){ + Hour--; + Min += 60; + } + tp->wMinute = WORD(Min); + Hour += sys.m_TimeOffset; + if( Hour >= 24 ){ + tp->wHour = WORD(Hour - 24); + tp->wDay++; + if( tp->wYear % 4 ){ + mt = MONN; + } + else { + mt = MONU; + } + if( tp->wDay > mt[tp->wMonth] ){ + tp->wDay = 1; + tp->wMonth++; + if( tp->wMonth > 12 ){ + tp->wMonth = 1; + tp->wYear++; + } + } + } + else if( Hour < 0 ){ + tp->wHour = WORD(Hour + 24); + tp->wDay--; + if( tp->wDay < 1 ){ + tp->wMonth--; + if( tp->wMonth < 1 ){ + tp->wMonth = 12; + tp->wYear--; + } + if( tp->wYear % 4 ){ + tp->wDay = MONN[tp->wMonth]; + } + else { + tp->wDay = MONU[tp->wMonth]; + } + } + } + else { + tp->wHour = WORD(Hour); + } + } +} +//--------------------------------------------------------------------------- +void GetUTC(SYSTEMTIME *tp) +{ + ::GetSystemTime(tp); + AddjustOffset(tp); +} +//--------------------------------------------------------------------------- +void GetLocal(SYSTEMTIME *tp) +{ + ::GetLocalTime(tp); + AddjustOffset(tp); +} +//--------------------------------------------------------------------------- +LPSTR StrDupe(LPCSTR s) +{ + LPSTR p = new char[strlen(s)+1]; + strcpy(p, s); + return p; +} + +//--------------------------------------------------------------------------- +void InitColorTable(TColor cl, TColor ch) +{ + int br = (ch & 0x000000ff); + int bg = (ch & 0x0000ff00) >> 8; + int bb = (ch & 0x00ff0000) >> 16; + int er = (cl & 0x000000ff); + int eg = (cl & 0x0000ff00) >> 8; + int eb = (cl & 0x00ff0000) >> 16; + + int brw = er - br + 1; + int bgw = eg - bg + 1; + int bbw = eb - bb + 1; + int r, g, b; + + ColorTable[0] = DWORD( br | (bg<<8) | (bb<<16) ); + int i; + for( i = 1; i < 127; i++ ){ + r = (br + (i * brw/128)) & 0x000000ff; + g = (bg + (i * bgw/128)) & 0x000000ff; + b = (bb + (i * bbw/128)) & 0x000000ff; + ColorTable[i] = DWORD( r | (g<<8) | (b<<16) ); + } + ColorTable[127] = DWORD( er | (eg<<8) | (eb<<16) ); +} + +const DEFKEYTBL KEYTBL[]={ + { VK_F1, "F1" }, + { VK_F2, "F2" }, + { VK_F3, "F3" }, + { VK_F4, "F4" }, + { VK_F5, "F5" }, + { VK_F6, "F6" }, + { VK_F7, "F7" }, + { VK_F8, "F8" }, + { VK_F9, "F9" }, + { VK_F10, "F10" }, + { VK_F11, "F11" }, + { VK_F12, "F12" }, + + { VK_LEFT, "©"}, + { VK_RIGHT, "¨"}, + { VK_UP, "ª"}, + { VK_DOWN, "«"}, + { VK_PRIOR, "PageUp"}, + { VK_NEXT, "PageDown"}, + { VK_HOME, "Home" }, + { VK_END, "End" }, + { VK_INSERT, "Insert" }, + { VK_DELETE, "Delete" }, + { VK_HELP, "Help" }, + { VK_ESCAPE, "ESC" }, + { VK_PAUSE, "PAUSE" }, + + + { VK_F1 | 0x400, "Shift+F1" }, + { VK_F2 | 0x400, "Shift+F2" }, + { VK_F3 | 0x400, "Shift+F3" }, + { VK_F4 | 0x400, "Shift+F4" }, + { VK_F5 | 0x400, "Shift+F5" }, + { VK_F6 | 0x400, "Shift+F6" }, + { VK_F7 | 0x400, "Shift+F7" }, + { VK_F8 | 0x400, "Shift+F8" }, + { VK_F9 | 0x400, "Shift+F9" }, + { VK_F10 | 0x400, "Shift+F10" }, + { VK_F11 | 0x400, "Shift+F11" }, + { VK_F12 | 0x400, "Shift+F12" }, + + { VK_LEFT | 0x400, "Shift+©"}, + { VK_RIGHT | 0x400, "Shift+¨"}, + { VK_UP | 0x400, "Shift+ª"}, + { VK_DOWN | 0x400, "Shift+«"}, + { VK_PRIOR | 0x400, "Shift+PageUp"}, + { VK_NEXT | 0x400, "Shift+PageDown"}, + { VK_HOME | 0x400, "Shift+Home" }, + { VK_END | 0x400, "Shift+End" }, + { VK_INSERT | 0x400, "Shift+Insert" }, + { VK_DELETE | 0x400, "Shift+Delete" }, + { VK_HELP | 0x400, "Shift+Help" }, + { VK_ESCAPE | 0x400, "Shift+ESC" }, + { VK_PAUSE | 0x400, "Shift+PAUSE" }, + + { VK_F1 | 0x100, "Ctrl+F1" }, + { VK_F2 | 0x100, "Ctrl+F2" }, + { VK_F3 | 0x100, "Ctrl+F3" }, + { VK_F4 | 0x100, "Ctrl+F4" }, + { VK_F5 | 0x100, "Ctrl+F5" }, + { VK_F6 | 0x100, "Ctrl+F6" }, + { VK_F7 | 0x100, "Ctrl+F7" }, + { VK_F8 | 0x100, "Ctrl+F8" }, + { VK_F9 | 0x100, "Ctrl+F9" }, + { VK_F10 | 0x100, "Ctrl+F10" }, + { VK_F11 | 0x100, "Ctrl+F11" }, + { VK_F12 | 0x100, "Ctrl+F12" }, + { '1' | 0x100, "Ctrl+1" }, + { '2' | 0x100, "Ctrl+2" }, + { '3' | 0x100, "Ctrl+3" }, + { '4' | 0x100, "Ctrl+4" }, + { '5' | 0x100, "Ctrl+5" }, + { '6' | 0x100, "Ctrl+6" }, + { '7' | 0x100, "Ctrl+7" }, + { '8' | 0x100, "Ctrl+8" }, + { '9' | 0x100, "Ctrl+9" }, + { '0' | 0x100, "Ctrl+0" }, + { 'A' | 0x100, "Ctrl+A" }, + { 'B' | 0x100, "Ctrl+B" }, + { 'C' | 0x100, "Ctrl+C" }, + { 'D' | 0x100, "Ctrl+D" }, + { 'E' | 0x100, "Ctrl+E" }, + { 'F' | 0x100, "Ctrl+F" }, + { 'G' | 0x100, "Ctrl+G" }, +// { 'H' | 0x100, "Ctrl+H" }, +// { 'I' | 0x100, "Ctrl+I" }, + { 'K' | 0x100, "Ctrl+K" }, + { 'L' | 0x100, "Ctrl+L" }, +// { 'M' | 0x100, "Ctrl+M" }, + { 'N' | 0x100, "Ctrl+N" }, + { 'O' | 0x100, "Ctrl+O" }, + { 'P' | 0x100, "Ctrl+P" }, + { 'Q' | 0x100, "Ctrl+Q" }, + { 'R' | 0x100, "Ctrl+R" }, + { 'S' | 0x100, "Ctrl+S" }, + { 'T' | 0x100, "Ctrl+T" }, + { 'U' | 0x100, "Ctrl+U" }, + { 'V' | 0x100, "Ctrl+V" }, + { 'W' | 0x100, "Ctrl+W" }, + { 'X' | 0x100, "Ctrl+X" }, + { 'Y' | 0x100, "Ctrl+Y" }, + { 'Z' | 0x100, "Ctrl+Z" }, + + { VK_LEFT | 0x100, "Ctrl+©"}, + { VK_RIGHT | 0x100, "Ctrl+¨"}, + { VK_UP | 0x100, "Ctrl+ª"}, + { VK_DOWN | 0x100, "Ctrl+«"}, + { VK_PRIOR | 0x100, "Ctrl+PageUp"}, + { VK_NEXT | 0x100, "Ctrl+PageDown"}, + { VK_HOME | 0x100, "Ctrl+Home" }, + { VK_END | 0x100, "Ctrl+End" }, + { VK_INSERT | 0x100, "Ctrl+Insert" }, + { VK_DELETE | 0x100, "Ctrl+Delete" }, + { VK_HELP | 0x100, "Ctrl+Help" }, + { VK_ESCAPE | 0x100, "Ctrl+ESC" }, + + { VK_F1 | 0x200, "Alt+F1" }, + { VK_F2 | 0x200, "Alt+F2" }, + { VK_F3 | 0x200, "Alt+F3" }, + { VK_F4 | 0x200, "Alt+F4" }, + { VK_F5 | 0x200, "Alt+F5" }, + { VK_F6 | 0x200, "Alt+F6" }, + { VK_F7 | 0x200, "Alt+F7" }, + { VK_F8 | 0x200, "Alt+F8" }, + { VK_F9 | 0x200, "Alt+F9" }, + { VK_F10 | 0x200, "Alt+F10" }, + { VK_F11 | 0x200, "Alt+F11" }, + { VK_F12 | 0x200, "Alt+F12" }, + { '1' | 0x200, "Alt+1" }, + { '2' | 0x200, "Alt+2" }, + { '3' | 0x200, "Alt+3" }, + { '4' | 0x200, "Alt+4" }, + { '5' | 0x200, "Alt+5" }, + { '6' | 0x200, "Alt+6" }, + { '7' | 0x200, "Alt+7" }, + { '8' | 0x200, "Alt+8" }, + { '9' | 0x200, "Alt+9" }, + { '0' | 0x200, "Alt+0" }, + { 'A' | 0x200, "Alt+A" }, + { 'B' | 0x200, "Alt+B" }, + { 'C' | 0x200, "Alt+C" }, + { 'D' | 0x200, "Alt+D" }, + { 'E' | 0x200, "Alt+E" }, + { 'F' | 0x200, "Alt+F" }, + { 'G' | 0x200, "Alt+G" }, + { 'H' | 0x200, "Alt+H" }, + { 'I' | 0x200, "Alt+I" }, + { 'K' | 0x200, "Alt+K" }, + { 'L' | 0x200, "Alt+L" }, + { 'M' | 0x200, "Alt+M" }, + { 'N' | 0x200, "Alt+N" }, + { 'O' | 0x200, "Alt+O" }, + { 'P' | 0x200, "Alt+P" }, + { 'Q' | 0x200, "Alt+Q" }, + { 'R' | 0x200, "Alt+R" }, + { 'S' | 0x200, "Alt+S" }, + { 'T' | 0x200, "Alt+T" }, + { 'U' | 0x200, "Alt+U" }, + { 'V' | 0x200, "Alt+V" }, + { 'W' | 0x200, "Alt+W" }, + { 'X' | 0x200, "Alt+X" }, + { 'Y' | 0x200, "Alt+Y" }, + { 'Z' | 0x200, "Alt+Z" }, + + { VK_LEFT | 0x200, "Alt+©"}, + { VK_RIGHT | 0x200, "Alt+¨"}, + { VK_UP | 0x200, "Alt+ª"}, + { VK_DOWN | 0x200, "Alt+«"}, + { VK_PRIOR | 0x200, "Alt+PageUp"}, + { VK_NEXT | 0x200, "Alt+PageDown"}, + { VK_HOME | 0x200, "Alt+Home" }, + { VK_END | 0x200, "Alt+End" }, + { VK_INSERT | 0x200, "Alt+Insert" }, + { VK_DELETE | 0x200, "Alt+Delete" }, + { VK_HELP | 0x200, "Alt+Help" }, + { VK_ESCAPE | 0x200, "Alt+ESC" }, + { VK_PAUSE | 0x200, "Alt+PAUSE" }, + { 0, "" }, +}; +//--------------------------------------------------------------------------- +LPCSTR ToDXKey(LPCSTR s) +{ + if( (sys.m_WinFontCharset != SHIFTJIS_CHARSET) && *s ){ + LPSTR p; + static char bf[32]; + strcpy(bf, s); + if( (p = strstr(bf, "©"))!=NULL ){ + strcpy(p, "ArrowLeft"); + return bf; + } + else if( (p = strstr(bf, "¨"))!=NULL ){ + strcpy(p, "ArrowRight"); + return bf; + } + else if( (p = strstr(bf, "«"))!=NULL ){ + strcpy(p, "ArrowDown"); + return bf; + } + else if( (p = strstr(bf, "ª"))!=NULL ){ + strcpy(p, "ArrowUp"); + return bf; + } + } + return s; +} +//--------------------------------------------------------------------------- +LPCSTR ToJAKey(LPCSTR s) +{ + if( (sys.m_WinFontCharset != SHIFTJIS_CHARSET) && *s ){ + LPSTR p; + static char bf[32]; + strcpy(bf, s); + if( (p = strstr(bf, "ArrowLeft"))!=NULL ){ + strcpy(p, "©"); + return bf; + } + else if( (p = strstr(bf, "ArrowRight"))!=NULL ){ + strcpy(p, "¨"); + return bf; + } + else if( (p = strstr(bf, "ArrowDown"))!=NULL ){ + strcpy(p, "«"); + return bf; + } + else if( (p = strstr(bf, "ArrowUp"))!=NULL ){ + strcpy(p, "ª"); + return bf; + } + } + return s; +} +//--------------------------------------------------------------------------- +LPCSTR GetKeyName(WORD Key) +{ + int i; + for( i = 0; KEYTBL[i].Key; i++ ){ + if( Key == KEYTBL[i].Key ){ + break; + } + } + return ToDXKey(KEYTBL[i].pName); +} +//--------------------------------------------------------------------------- +WORD GetKeyCode(LPCSTR pName) +{ + LPCSTR p = ToJAKey(pName); + int i; + for( i = 0; KEYTBL[i].Key; i++ ){ + if( !strcmp(p, KEYTBL[i].pName) ) break; + } + return KEYTBL[i].Key; +} +//--------------------------------------------------------------------------- +LPCSTR __fastcall ConvAndChar(LPSTR t, LPCSTR p) +{ + LPSTR s = t; + + while(*p){ + if( *p == '&' ){ + *t++ = *p; + } + *t++ = *p++; + } + *t = 0; + return s; +} +//--------------------------------------------------------------------------- +int SetTBValue(double d, double dmax, int imax) +{ + if( d ){ + int dd = int(sqrt(d * dmax * dmax / imax) + 0.5); + if( dd > imax ) dd = imax; + return dd; + } + else { + return 0; + } +} + +double GetTBValue(int d, double dmax, int imax) +{ + return (d * d) * imax/ (dmax * dmax); +} + +LPUSTR jstrupr(LPUSTR s) +{ + LPUSTR p = s; + int kf; + + for( kf = 0; *p; p++ ){ + if( kf ){ + kf = 0; + } + else if( _mbsbtype((unsigned char *)p, 0) == _MBC_LEAD ){ + kf = 1; + } + else { + *p = (unsigned char)toupper(*p); + } + } + return s; +} +/*#$% +=============================================================== + Žž‚ð’²®‚·‚é +--------------------------------------------------------------- + t : Žž(UTC) + c : Žž·ƒR[ƒh +--------------------------------------------------------------- + ƒ[ƒJƒ‹ƒ^ƒCƒ€ +--------------------------------------------------------------- + A-Z + a-z +30min +=============================================================== +*/ +WORD AdjustRolTimeUTC(WORD tim, char c) +{ + const char tdf[]={ +/* A B C D E F G H I J K L M N O P Q R S T U V W X Y Z */ + 1,2,3,4,5,6,7,8,9,9,10,11,12,23,22,21,20,19,18,17,16,15,14,13,12,0 + }; + int cc; + + cc = toupper(c); + if( (cc >= 'A')&&(cc <= 'Z') ){ + // JST to UTC +#if 0 + if( tim >= (9*60*30) ){ + tim -= WORD(9 * 60 * 30); + } + else { + tim += WORD(15 * 60 * 30); + } +#endif + tim /= WORD(30); + tim += WORD(tdf[cc-'A'] * 60); + if( c >= 'a' ) tim += WORD(30); + while( tim >= (24 * 60) ){ + tim -= WORD(24 * 60); + } + tim *= WORD(30); + if( !tim ) tim++; + } + else { + tim = 0; + } + return tim; +} +///---------------------------------------------------------------- +/// ƒEƒBƒ“ƒhƒE‚ðƒNƒ‰ƒCƒAƒ“ƒgƒZƒ“ƒ^[‚É‚·‚é +void FormCenter(TForm *tp, int XW, int YW) +{ + int top = (YW - tp->Height)/2; + int left = (XW - tp->Width)/2; + if( top < 0 ) top = 0; + if( left < 0 ) left = 0; + tp->Top = top; + tp->Left = left; +} +//--------------------------------------------------------------------------- +void __fastcall SetGroupEnabled(TGroupBox *gp) +{ + int enb = gp->Enabled; + TControl *tp; + int i; + for( i = 0; i < gp->ControlCount; i++ ){ + tp = gp->Controls[i]; + if( tp != NULL ){ + tp->Enabled = enb; + if( tp->ClassNameIs("TGroupBox") ){ + SetGroupEnabled((TGroupBox *)tp); + } + } + } + gp->Font->Color = gp->Enabled ? clBlack : clGrayText; + for( i = 0; i < gp->ControlCount; i++ ){ + tp = gp->Controls[i]; + if( tp != NULL ){ + if( tp->ClassNameIs("TComboBox") ){ + ((TComboBox *)tp)->SelLength = 0; + } + } + } +} +//--------------------------------------------------------------------------- +void SetButtonCaption(TSpeedButton *tb, AnsiString &as, int maxlen, int fontsize, TColor col) +{ + char bf[256]; + ConvAndChar(bf, as.c_str()); + int len = strlen(as.c_str()); + if( (!len) || (len <= maxlen) ){ + fontsize = fontsize + sys.m_BtnFontAdjSize; + } + else { + int size = fontsize * maxlen * 1.1 / len; + if( size < 6 ) size = 6; + fontsize = size + sys.m_BtnFontAdjSize; + } + tb->Font->Size = fontsize; + tb->Font->Color = col; +// if( tb->Caption != bf ) tb->Caption = bf; + tb->Caption = bf; +} +/*#$% +======================================================== + ÅŒã‚Ì•¶ŽšƒR[ƒh‚ð•Ô‚· +-------------------------------------------------------- + p : •¶Žš—ñ‚̃|ƒCƒ“ƒ^ +-------------------------------------------------------- + •¶ŽšƒR[ƒh +-------------------------------------------------------- +======================================================== +*/ +char *lastp(char *p) +{ + if( *p ){ + for( ; *p; p++ ); + p--; + return(p); + } + else { + return(p); + } +} +/*#$% +======================================================== + ––”ö‚̃Xƒy[ƒX‚Æ‚s‚`‚a‚ðŽæ‚é +-------------------------------------------------------- + s : •¶Žš—ñ‚̃|ƒCƒ“ƒ^ +-------------------------------------------------------- + •¶Žš—ñ‚̃|ƒCƒ“ƒ^ +-------------------------------------------------------- +======================================================== +*/ +char *clipsp(char *s) +{ + char *p; + + if( *s ){ + for( p = lastp(s); p >= s; p-- ){ + if( (*p == ' ')||(*p == 0x09) ){ + *p = 0; + } + else { + break; + } + } + } + return(s); +} +//--------------------------------------------------------------------------- +LPCSTR _strdmcpy(LPSTR t, LPCSTR p, char c) +{ + for( ; *p && (*p != c); p++, t++ ) *t = *p; + *t = 0; + if( *p == c ) p++; + return(p); +} +const char *StrDlmCpy(char *t, const char *p, char Dlm, int len) +{ + const char _tt1[]="[{(¢<"; + const char _tt2[]="]})£>"; + const char *pp; + int r = FALSE; + + char Key; + if( (pp = strchr(_tt2, Dlm))!=NULL ){ + Key = _tt1[pp - _tt2]; + } + else { + Key = 0; + } + int f, k; + for( f = k = 0; *p; p++ ){ + if( k ){ // Š¿Žš‚QƒoƒCƒg–Ú + k = 0; + } + else if( _mbsbtype((const unsigned char *)p, 0) == _MBC_LEAD ){ // Š¿Žš‚PƒoƒCƒg–Ú + k = 1; + } + else if( *p == Key ){ + f++; + } + else if( *p == Dlm ){ + if( f ){ + f--; + } + else { + r = TRUE; + p++; + break; + } + } + if( len ){ + *t++ = *p; + len--; + } + } + *t = 0; + return (r == TRUE) ? p : NULL; +} + +const char *StrDlmCpyK(char *t, const char *p, char Dlm, int len) +{ + const char _tt1[]="[{(¢<"; + const char _tt2[]="]})£>"; + const char *pp; + int r = FALSE; + + char Key; + if( (pp = strchr(_tt2, Dlm))!=NULL ){ + Key = _tt1[pp - _tt2]; + } + else { + Key = 0; + } + int f, k; + for( f = k = 0; *p; p++ ){ + if( k ){ // Š¿Žš‚QƒoƒCƒg–Ú + k = 0; + } + else if( _mbsbtype((const unsigned char *)p, 0) == _MBC_LEAD ){ // Š¿Žš‚PƒoƒCƒg–Ú + k = 1; + } + else if( (pp = strchr(_tt1, *p))!=NULL ){ + Key = _tt2[pp - _tt1]; + f++; + } + else if( f && (*p == Key) ){ + f--; + Key = 0; + } + else if( *p == Dlm ){ + if( !f ){ + r = TRUE; + p++; + break; + } + } + if( len ){ + *t++ = *p; + len--; + } + } + *t = 0; + return (r == TRUE) ? p : NULL; +} +//--------------------------------------------------------------------------- +void StrCopy(LPSTR t, LPCSTR s, int n) +{ + for( ; *s && n; n--, s++, t++){ + *t = *s; + } + *t = 0; +} +//--------------------------------------------------------------------------- +char LastC(LPCSTR p) +{ + char c = 0; + + if( *p ){ + c = *(p + strlen(p) - 1); + } + return c; +} + +/*#$% +======================================================== + Šg’£Žq‚𓾂é +-------------------------------------------------------- + p : •¶Žš—ñ‚̃|ƒCƒ“ƒ^ +-------------------------------------------------------- + •¶ŽšƒR[ƒh +-------------------------------------------------------- +======================================================== +*/ +LPCSTR GetEXT(LPCSTR Fname) +{ + if( *Fname ){ + LPCSTR p = Fname + (strlen(Fname) - 1); + for( ; p > Fname; p-- ){ + if( *p == '.' ) return p+1; + } + } + return ""; +} + +void SetEXT(LPSTR pName, LPSTR pExt) +{ + if( *pName ){ + LPSTR p; + + for( p = &pName[strlen(pName)-1]; p >= pName; p-- ){ + if( *p == '.' ){ + strcpy(p, pExt); + return; + } + } + strcat(pName, pExt); + } +} + +void SetCurDir(LPSTR t, int size) +{ + if( !::GetCurrentDirectory(size-1, t) ){ + *t = 0; + } + else { + if( LastC(t) != '\\' ){ + strcat(t, "\\"); + } + } +} + +void SetDirName(LPSTR t, LPCSTR pName) +{ + char drive[_MAX_DRIVE]; + char dir[_MAX_DIR]; + char name[_MAX_FNAME]; + char ext[_MAX_EXT]; + AnsiString Dir; + + ::_splitpath( pName, drive, dir, name, ext ); + Dir = drive; + Dir += dir; + strncpy(t, Dir.c_str(), 128); +} + +LPCSTR StrDbl(double d) +{ + static char bf[64]; + LPSTR p; + + sprintf(bf, "%lf", d); + for( p = &bf[strlen(bf)-1]; p >= bf; p-- ){ + if( (*p == '0')&&(*(p-1)!='.') ){ + *p = 0; + } + else { + break; + } + } + return bf; +} + +LPCSTR StrDblE(double d) +{ + static char bf[32]; + + sprintf(bf, "%le", d); + return bf; +} + +double ReadDoubleIniFile(TMemIniFile *p, LPCSTR c1, LPCSTR c2, double d) +{ + AnsiString cs = StrDblE(d); + AnsiString rs = p->ReadString(c1, c2, cs); + if( sscanf(rs.c_str(), "%lf", &d) != 1 ) d = 0.0; + return d; +} + +void WriteDoubleIniFile(TMemIniFile *p, LPCSTR c1, LPCSTR c2, double d) +{ + AnsiString cs = StrDblE(d); + p->WriteString(c1, c2, cs); +} + +///---------------------------------------------------------------- +/// ƒRƒƒ“ƒg‚ðíœiƒXƒy[ƒX‚¨‚æ‚Ñ‚s‚`‚a‚àíœj +/// +void ClipLF(LPSTR sp) +{ + for( ; *sp; sp++ ){ + if( (*sp == LF)||(*sp == CR) ){ + *sp = 0; + break; + } + } +} + +LPSTR FillSpace(LPSTR s, int n) +{ + LPSTR p = s; + int i = 0; + for( ; *p && (i < n); i++, p++ ); + for( ; i < n; i++, p++ ){ + *p = ' '; + } + *p = 0; + return s; +} +///---------------------------------------------------------------- +/// ƒzƒƒCƒgƒXƒy[ƒX‚̃XƒLƒbƒv +/// +LPSTR SkipSpace(LPSTR sp) +{ + for( ; *sp; sp++ ){ + if( (*sp != ' ')&&(*sp != TAB) ) break; + } + return sp; +} + +LPCSTR SkipSpace(LPCSTR sp) +{ + for( ; *sp; sp++ ){ + if( (*sp != ' ')&&(*sp != TAB) ) break; + } + return sp; +} + +///---------------------------------------------------------------- +/// ƒfƒŠƒ~ƒbƒ^•ª‰ð‚ðs‚¤ +/// +LPSTR StrDlm(LPSTR &t, LPSTR p) +{ + return StrDlm(t, p, ','); +} + +///---------------------------------------------------------------- +/// ƒfƒŠƒ~ƒbƒ^•ª‰ð‚ðs‚¤ +/// +LPSTR StrDlm(LPSTR &t, LPSTR p, char c) +{ + int f, k; + LPSTR d1=NULL; + LPSTR d2=NULL; + + t = p; + f = k = 0; + while(*p){ + if( k ){ // Š¿Žš‚QƒoƒCƒg–Ú + k = 0; + } + else if( _mbsbtype((const unsigned char *)p, 0) == _MBC_LEAD ){ // Š¿Žš‚PƒoƒCƒg–Ú + k = 1; + } + else if( *p == 0x22 ){ + if( !f ){ + if( d1 == NULL ) d1 = p+1; + f++; + } + else { + d2 = p; + f--; + } + } + else if( !f && (*p == c) ){ + *p = 0; + p++; + break; + } + p++; + } + if( (d1!=NULL)&&(d2!=NULL) ){ + if( ((t+1)==d1) && ( ((p-2)==d2)||((p-1)==d2) ) ){ + t = d1; + *d2 = 0; + } + } + return(p); +} + +///---------------------------------------------------------------- +/// +void ChgString(LPSTR t, char a, char b) +{ + for( ; *t; t++ ){ + if( *t == a ) *t = b; + } +} + +///---------------------------------------------------------------- +/// +void DelChar(LPSTR t, char a) +{ + for( ; *t; t++ ){ + if( *t == a ){ + strcpy(t, t+1); + t--; + } + } +} + +/*#$% +======================================================== + ƒfƒVƒ}ƒ‹ƒAƒXƒL[‚ð”’l‚ɕϊ·‚·‚é +-------------------------------------------------------- + p : •¶Žš—ñ‚̃|ƒCƒ“ƒ^ + n : •ÏŠ·Œ…” +-------------------------------------------------------- + ”’l +-------------------------------------------------------- +======================================================== +*/ +int atoin(const char *p, int n) +{ + int d; + + for( d = 0; *p && n; p++, n-- ){ + d *= 10; + d += (*p & 0x0f); + } + return(d); +} +/*#$% +======================================================== + ‚P‚UiƒAƒXƒL[‚ð”’l‚ɕϊ·‚·‚é +-------------------------------------------------------- + p : •¶Žš—ñ‚̃|ƒCƒ“ƒ^ + n : •ÏŠ·Œ…” +-------------------------------------------------------- + ”’l +-------------------------------------------------------- +======================================================== +*/ +int htoin(const char *p, int n) +{ + if( *p == 'x' ) return 0; + int d; + + for( d = 0; *p && n; p++, n-- ){ + d = d << 4; + d += (*p & 0x0f); + if( *p >= 'A' ) d += 9; + } + return(d); +} +///---------------------------------------------------------------- +HWND GetMBHandle(int &flag) +{ + HWND hd; + if( Screen->ActiveForm != NULL ){ + hd = Screen->ActiveForm->Handle; + } + else { + hd = NULL; + } + flag = MB_SETFOREGROUND; + if( Remote ) flag |= MB_TOPMOST; + flag |= (hd == NULL) ? MB_TASKMODAL : MB_APPLMODAL; + return hd; +} +///---------------------------------------------------------------- +/// ƒƒbƒZ[ƒW‚Ì•\ަ +/// +void InfoMB(LPCSTR fmt, ...) +{ + va_list pp; + char bf[1024]; + + va_start(pp, fmt); + vsprintf( bf, fmt, pp ); + va_end(pp); + + int flag; + HWND hd = GetMBHandle(flag); + DisPaint = TRUE; + flag |= (MB_OK | MB_ICONINFORMATION); + Application->NormalizeTopMosts(); + ::MessageBox(hd, bf, "MMTTY", flag); + Application->RestoreTopMosts(); + DisPaint = FALSE; +} +///---------------------------------------------------------------- +/// ƒGƒ‰[ƒƒbƒZ[ƒW‚Ì•\ަ +/// +void ErrorMB(LPCSTR fmt, ...) +{ + va_list pp; + char bf[1024]; + + va_start(pp, fmt); + vsprintf( bf, fmt, pp ); + va_end(pp); + + int flag; + HWND hd = GetMBHandle(flag); + DisPaint = TRUE; + flag |= (MB_OK | MB_ICONEXCLAMATION); + Application->NormalizeTopMosts(); + ::MessageBox(hd, bf, (sys.m_WinFontCharset != SHIFTJIS_CHARSET) ? "Error":"´×°", flag); + Application->RestoreTopMosts(); + DisPaint = FALSE; +} + +///---------------------------------------------------------------- +/// ŒxƒƒbƒZ[ƒW‚Ì•\ަ +/// +void WarningMB(LPCSTR fmt, ...) +{ + va_list pp; + char bf[1024]; + + va_start(pp, fmt); + vsprintf( bf, fmt, pp ); + va_end(pp); + + int flag; + HWND hd = GetMBHandle(flag); + DisPaint = TRUE; + flag |= (MB_OK | MB_ICONEXCLAMATION); + Application->NormalizeTopMosts(); + ::MessageBox(hd, bf, (sys.m_WinFontCharset != SHIFTJIS_CHARSET)?"Warning":"Œx", flag); + Application->RestoreTopMosts(); + DisPaint = FALSE; +} + +///---------------------------------------------------------------- +/// ŽÀs‘I‘ðƒƒbƒZ[ƒW‚Ì•\ަ +/// +int YesNoMB(LPCSTR fmt, ...) +{ + va_list pp; + char bf[1024]; + + va_start(pp, fmt); + vsprintf( bf, fmt, pp ); + va_end(pp); + + int flag; + HWND hd = GetMBHandle(flag); + DisPaint = TRUE; + if( Screen->ActiveForm != NULL ) NormalWindow(Screen->ActiveForm); + flag |= (MB_YESNO | MB_ICONQUESTION); + Application->NormalizeTopMosts(); + int r = ::MessageBox(hd, bf, "MMTTY", flag); + Application->RestoreTopMosts(); + DisPaint = FALSE; + return r; +} + +///---------------------------------------------------------------- +/// ŽÀs‘I‘ðƒƒbƒZ[ƒW‚Ì•\ަ +/// +int YesNoCancelMB(LPCSTR fmt, ...) +{ + va_list pp; + char bf[1024]; + + va_start(pp, fmt); + vsprintf( bf, fmt, pp ); + va_end(pp); + + int flag; + HWND hd = GetMBHandle(flag); + DisPaint = TRUE; + flag |= (MB_YESNOCANCEL | MB_ICONQUESTION); + Application->NormalizeTopMosts(); + int r = ::MessageBox(hd, bf, "MMTTY", flag); + Application->RestoreTopMosts(); + DisPaint = FALSE; + return r; +} + +///---------------------------------------------------------------- +/// ŽÀs‘I‘ðƒƒbƒZ[ƒW‚Ì•\ަ +/// +int OkCancelMB(LPCSTR fmt, ...) +{ + va_list pp; + char bf[1024]; + + va_start(pp, fmt); + vsprintf( bf, fmt, pp ); + va_end(pp); + + int flag; + HWND hd = GetMBHandle(flag); + DisPaint = TRUE; + flag |= (MB_OKCANCEL | MB_ICONQUESTION); + Application->NormalizeTopMosts(); + int r = ::MessageBox(hd, bf, "MMTTY", flag); + Application->RestoreTopMosts(); + DisPaint = FALSE; + return r; +} +int RemoveL2(LPSTR t, LPSTR ss, LPCSTR pKey, int size) +{ + char c; + int k; + LPCSTR pp; + LPSTR s; + const char _tt1[]="[{(¢<"; + const char _tt2[]="]})£>"; + + int len = strlen(pKey); + char ac = ';'; + for( k = 0, s = ss; *s; s++ ){ + if( k ){ // Š¿Žš‚QƒoƒCƒg–Ú + k = 0; + ac = 0x1e; + } + else if( _mbsbtype((const unsigned char *)s, 0) == _MBC_LEAD ){ // Š¿Žš‚PƒoƒCƒg–Ú + k = 1; + if( (len >= 2) && (strchr(" ,./;:*\t[{(¢<]})£>", ac)!=NULL) && (!strnicmp(s, pKey, len)) ){ + pp = s + len; + if( (pp = strchr(_tt1, *pp))!=NULL ){ + c = _tt2[pp - _tt1]; + if( *(s+len+1) ){ + StrDlmCpy(t, s+len+1, c, size); + if( *t ){ + strcpy((ac == ' ')?(s-1):s, s+len+2+strlen(t)); + return TRUE; + } + } + } + } + } + else if( (strchr(" ,./;:*\t\x1e[{(¢<]})£>", ac)!=NULL) && (!strnicmp(s, pKey, len)) ){ + pp = s + len; + if( (pp = strchr(_tt1, *pp))!=NULL ){ + c = _tt2[pp - _tt1]; + if( *(s+len+1) ){ + StrDlmCpy(t, s+len+1, c, size); + if( *t ){ + strcpy((ac == ' ')?(s-1):s, s+len+2+strlen(t)); + return TRUE; + } + } + } + ac = *s; + } + else { + ac = *s; + } + } + return FALSE; +} + +void AddL2(LPSTR t, LPCSTR pKey, LPCSTR s, UCHAR c1, UCHAR c2, int size) +{ + if( *s ){ + int len = strlen(t); + int lenkey = strlen(pKey); + int lenData = strlen(s); + if( (len + lenkey + lenData + 2) < size ){ + t += len; + if( len ) *t++ = ' '; + if( *pKey ){ + strcpy(t, pKey); + t += lenkey; + } + *t++ = c1; + strcpy(t, s); + t += lenData; + *t++ = c2; + *t = 0; + } + } +} +///---------------------------------------------------------------- +/// ”Žš‚ªŠÜ‚Ü‚ê‚é‚©‚Ç‚¤‚©’²‚ׂé +/// +int IsNumbs(LPCSTR p) +{ + for( ; *p; p++ ){ + if( isdigit(*p) ) return 1; + } + return 0; +} +///---------------------------------------------------------------- +/// ”Žš‚ªŠÜ‚Ü‚ê‚é‚©‚Ç‚¤‚©’²‚ׂé +/// +int IsAlphas(LPCSTR p) +{ + for( ; *p; p++ ){ + if( isalpha(*p) ) return 1; + } + return 0; +} +///---------------------------------------------------------------- +/// RST‚©‚Ç‚¤‚©’²‚ׂé +/// +int IsRST(LPCSTR p) +{ + if( strlen(p) < 3 ) return 0; + if( (*p < '1') || (*p > '5') ) return 0; + p++; + if( (*p < '1') || (*p > '9') ) return 0; + p++; + if( (*p < '1') || (*p > '9') ) return 0; + return 1; +} +///---------------------------------------------------------------- +int IsCallChar(char c) +{ + if( !isalpha(c) && !isdigit(c) && (c != '/') ) return 0; + if( islower(c) ) return 0; + return 1; +} +///---------------------------------------------------------------- +/// ƒR[ƒ‹ƒTƒCƒ“‚©‚Ç‚¤‚©’²‚ׂé +/// +int IsCall(LPCSTR p) +{ + int l = strlen(p); + if( l > 16 ) return 0; + if( l < 3 ) return 0; + if( isdigit(*p) ){ // 擪‚ª”Žš + if( l <= 3 ) return 0; // 3•¶ŽšˆÈ‰º‚ÌŽžNG + if( isdigit(*(p+1)) ) return 0; // 2•¶Žš–Ú‚ª”Žš‚ÌŽžNG + } + if( isdigit(LastC(p)) ){ // Ōオ”Žš + if( l <= 4 ) return 0; // ‚S•¶ŽšˆÈ‰º‚ÌŽžNG +// if( !strchr(p, '/')==NULL ) return0; // /‚ªŠÜ‚Ü‚ê‚Ä‚¢‚È‚¢ŽžNG +// if( p[l-2] != '/' ) return 0; // ÅŒã‚Ì‚P‚‘O‚ª/ˆÈŠO‚ÌŽžNG + } + int i; + for( i = 0; i < l-1; i++, p++ ){ + if( isdigit(*p) ) return 1; // ”Žš‚ªŠÜ‚Ü‚ê‚Ä‚¢‚ê‚ÎOK + } + return 0; +} +///---------------------------------------------------------------- +/// –¼‘O‚©‚Ç‚¤‚©’²‚ׂé +/// +int IsName(LPCSTR p) +{ + if( strlen(p) >= MLNAME ) return 0; + for( ; *p; p++ ){ + if( !isalpha(*p) ) return 0; + } + return 1; +} +/*#$% +====================================================== + ‚i‚`‚Æ‚c‚w‚Ì‹æ•Ê‚ð‚·‚é +------------------------------------------------------ + s : ƒR[ƒ‹ƒTƒCƒ“•¶Žš—ñ‚̃|ƒCƒ“ƒ^ +------------------------------------------------------ + 1 : JA + 0 : DX (JD1 INCLUDEED) +------------------------------------------------------ +====================================================== +*/ +int IsJA(const char *s) +{ + if( (!strcmp(s, "8J1RL"))||(!strcmp(s, "8J1RM"))||(strstr(s, "/JD1")!=NULL) ){ + return(0); + } + else if( strchr(s, '/') ){ + char bf[MLCALL+1]; + StrCopy(bf, s, MLCALL); + char *p; + char *t; + for( p = bf; *p; ){ + p = StrDlm(t, p, '/'); + if( *t ){ + if( (strlen(t) >= 2) && isdigit((unsigned char)LastC(t)) ){ + if( *t == 'J' ){ + t++; + if( *t == 'D' ) return(0); + if( (*t >= 'A')&&(*t <= 'S' ) ) return(1); + } + else if( *t == '7' ){ + t++; + if( (*t >= 'J')&&(*t <= 'N' ) ) return(1); + } + else if( *t == '8' ){ + t++; + if( (*t >= 'J')&&(*t <= 'N' ) ) return(1); + } + else { + return 0; + } + } + } + } + } + if( *s == 'J' ){ + s++; + if( *s == 'D' ) return(0); + if( (*s >= 'A')&&(*s <= 'S' ) ) return(1); + } + else if( *s == '7' ){ + s++; + if( (*s >= 'J')&&(*s <= 'N' ) ) return(1); + } + else if( *s == '8' ){ + s++; + if( (*s >= 'J')&&(*s <= 'N' ) ) return(1); + } + return(0); +} +/*#$% +====================================================== + ƒR[ƒ‹ƒTƒCƒ“‚ðƒNƒŠƒbƒv‚·‚é +------------------------------------------------------ + s : ƒR[ƒ‹ƒTƒCƒ“•¶Žš—ñ‚̃|ƒCƒ“ƒ^ +------------------------------------------------------ + ƒNƒŠƒbƒvƒR[ƒ‹‚̃|ƒCƒ“ƒ^ +------------------------------------------------------ +====================================================== +*/ +LPCSTR ClipCall(LPCSTR s) +{ + static char bf[MLCALL+1]; + LPCSTR p1, p2; + + if( (p1=strchr(s, '/'))!=NULL ){ + if( (p2=strchr(p1+1, '/'))!=NULL ){ /* ‚R•ªŠ„ */ + if( (int(strlen(p2+1)) < int((p2 - p1)+1)) || (!IsCall(p2+1)) ){ /* ÅŒã‚æ‚è“r’†‚ª’·‚¢ */ + if( ((p2-p1) < (p1-s))||(!IsCall(p1+1)) ){ /* “r’†‚æ‚èʼn‚ª’·‚¢ */ + StrCopy(bf, s, MLCALL); + *strchr(bf, '/') = 0; + return(bf); + } + else { + strcpy(bf, p1+1); + *strchr(bf, '/') = 0; + return(bf); + } + } + else if( int(strlen(p2+1)) < int((p1 - s)+1) ){ /* ÅŒã‚æ‚èʼn‚ª’·‚¢ */ + StrCopy(bf, s, MLCALL); + *strchr(bf, '/') = 0; + return(bf); + } + else { + return(p2+1); + } + } + else { /* ‚Q•ªŠ„ */ + if( (int(strlen(p1+1)) < int((p1 - s)+1)) || (!IsCall(p1+1)) ){ + StrCopy(bf, s, MLCALL); + *strchr(bf, '/') = 0; + return(bf); + } + else { + return(p1+1); + } + } + } + else { + return(s); + } +} + +/*#$% +====================================================== + ƒ|[ƒ^ƒuƒ‹•\‹L‚𒲂ׂé +------------------------------------------------------ + p : ƒR[ƒ‹ƒTƒCƒ“•¶Žš—ñ‚̃|ƒCƒ“ƒ^ +------------------------------------------------------ + ”’l‚̃|ƒCƒ“ƒ^ +------------------------------------------------------ +====================================================== +*/ +static LPSTR chkptb(LPSTR p) +{ + if( *p ){ + p = lastp(p); + if( isdigit(*p) && ((*(p-1))=='/') ){ + return(p); + } + } + return(NULL); +} + +/*#$% +====================================================== + ƒ|[ƒ^ƒuƒ‹•\‹L‚Ì“ü‚ê‘Ö‚¦ +------------------------------------------------------ + s : ƒR[ƒ‹ƒTƒCƒ“•¶Žš—ñ‚̃|ƒCƒ“ƒ^ +------------------------------------------------------ +------------------------------------------------------ + Œ³‚Ì•¶Žš—ñ‚ð”j‰ó‚·‚é +====================================================== +*/ +void chgptb(LPSTR s) +{ + LPSTR p, t; + + if( (p = chkptb(s))!=NULL ){ + t = p; + for( p--; p > s; p-- ){ + if( isdigit(*p) ){ + *p = *t; + t--; + *t = 0; + break; + } + } + } +} + +/*#$% +====================================================== + ƒR[ƒ‹ƒTƒCƒ“‚©‚çƒJƒ“ƒgƒŠ‚ÌŒ³‚ðƒNƒŠƒbƒv‚·‚é +------------------------------------------------------ + s : ƒR[ƒ‹ƒTƒCƒ“•¶Žš—ñ‚̃|ƒCƒ“ƒ^ +------------------------------------------------------ + ƒJƒ“ƒgƒŠ‚̃|ƒCƒ“ƒ^ +------------------------------------------------------ +====================================================== +*/ +LPCSTR ClipCC(LPCSTR s) +{ + static char bf[MLCALL+1]; + LPSTR p, t; + + StrCopy(bf, s, MLCALL); + chgptb(bf); /* ƒ|[ƒ^ƒuƒ‹•\‹L‚Ì“ü‚ê‘Ö‚¦ */ + for( p = bf; *p; ){ + if( *p ){ + p = StrDlm(t, p, '/'); + if( (strlen(t) > 1) && (isdigit(*t) || isdigit(LastC(t))) ) return(t); + } + } + for( p = bf; *p; ){ + if( *p ){ + p = StrDlm(t, p, '/'); + if( (strlen(t) > 1) && (*t!='Q') && strcmp(t, "MM") ) return(t); + } + } + return ClipCall(s); +} + +///---------------------------------------------------------------- +/// •¶Žš—ñ•ÏŠ· +/// +void Yen2CrLf(AnsiString &ws, AnsiString cs) +{ + ws = ""; + LPCSTR p; + int f; + int dlm = 0; + + p = cs.c_str(); + if( *p == 0x22 ){ + p++; + dlm++; + } + for( f = 0; *p; p++ ){ + if( f ){ + f = 0; + ws += *p; + } + else if( _mbsbtype((const unsigned char *)p, 0) == _MBC_LEAD ){ + f = 1; + ws += *p; + } + else if( *p == '\\' ){ + switch(*(p+1)){ + case 'r': + ws += "\r"; + p++; + break; + case 'n': + ws += "\n"; + p++; + break; + case '\\': + ws += "\\"; + p++; + break; + default: + p++; + ws += *p; + break; + } + } + else if( !dlm || (*p!=0x22) || *(p+1) ){ + ws += *p; + } + } +} + +void CrLf2Yen(AnsiString &ws, AnsiString cs) +{ + ws = "\x22"; + LPCSTR p; + + for( p = cs.c_str(); *p; p++ ){ + if( *p == 0x0d ){ + ws += "\\r"; + } + else if( *p == 0x0a ){ + ws += "\\n"; + } + else if( *p == '\\' ){ + ws += "\\\\"; + } + else { + ws += *p; + } + } + ws += "\x22"; +} + + +//--------------------------------------------------------------------------- +// ƒŠƒXƒg‚Ö‚Ì’èŒ^ƒƒbƒZ[ƒW‚Ì“o˜^ií‚ÉÅV‚ªæ“ª‚ɂȂéj +void EntryMsg(AnsiString ttl, AnsiString as, WORD Key) +{ + if( ttl.IsEmpty() ) return; + if( as.IsEmpty() ) return; + int i, j; + + // ŒŸõ + for( i = 0; i < MSGLISTMAX; i++ ){ + if( sys.m_MsgName[i].IsEmpty() ) break; + if( sys.m_MsgName[i] == ttl ) break; + } + // ˆê’v‚µ‚½‚à‚Ì‚ðíœ + for( j = i; j < (MSGLISTMAX - 1); j++ ){ + if( sys.m_MsgName[j].IsEmpty() ) break; + sys.m_MsgList[j] = sys.m_MsgList[j+1]; + sys.m_MsgName[j] = sys.m_MsgName[j+1]; + sys.m_MsgKey[j] = sys.m_MsgKey[j+1]; + } + // ‘S‘Ì‚ð‚P‚ÂŒã‚ë‚É‚¸‚ç‚· + for( j = MSGLISTMAX - 1; j > 0; j-- ){ + sys.m_MsgList[j] = sys.m_MsgList[j-1]; + sys.m_MsgName[j] = sys.m_MsgName[j-1]; + sys.m_MsgKey[j] = sys.m_MsgKey[j-1]; + } + sys.m_MsgName[0] = ttl; + sys.m_MsgList[0] = as; + sys.m_MsgKey[0] = Key; +} + +//--------------------------------------------------------------------------- +// ƒRƒ“ƒ{‚a‚n‚w‚É•¶Žš—ñ‚ðÝ’è‚·‚é +void SetComboBox(TComboBox *pCombo, LPCSTR pList) +{ + pCombo->Clear(); + LPSTR s = strdup(pList); + LPSTR p = s; + LPSTR t; + while(*p){ + p = StrDlm(t, p); + clipsp(t); + t = SkipSpace(t); + if( *t ) pCombo->Items->Add(t); + } + free(s); +} + +//--------------------------------------------------------------------------- +// ƒRƒ“ƒ{‚a‚n‚w‚É•¶Žš—ñ‚ðÝ’è‚·‚é +void GetComboBox(AnsiString &as, TComboBox *pCombo) +{ + as = ""; + int i; + for( i = 0; i < pCombo->Items->Count; i++ ){ + if( i ) as += ','; + as += pCombo->Items->Strings[i]; + } +} +//--------------------------------------------------------------------------- +// ƒOƒŠƒbƒh‚ÌŠÔŠu‚ðÝ’è‚·‚é +void SetGridWidths(TStringGrid *pGrid, LPCSTR pList) +{ + LPSTR s = strdup(pList); + LPSTR p = s; + LPSTR t; + int i; + for( i = 0; (i < pGrid->ColCount) && *p; i++ ){ + p = StrDlm(t, p); + clipsp(t); + t = SkipSpace(t); + if( *t ){ + int w = atoin(t, -1); + pGrid->ColWidths[i] = w; + } + } + free(s); +} +//--------------------------------------------------------------------------- +// ƒOƒŠƒbƒh‚ÌŠÔŠu‚ð“ǂ݂±‚Þ +void GetGridWidths(AnsiString &as, TStringGrid *pGrid) +{ + as = ""; + int i; + for( i = 0; i < pGrid->ColCount; i++ ){ + if( i ) as += ','; + as += pGrid->ColWidths[i]; + } +} + +int FontStyle2Code(TFontStyles style) +{ + int code = 0; + + TFontStyles fa; + TFontStyles fb; + + fa << fsBold; + fb << fsBold; + fa *= style; + if( fa == fb ) code |= FSBOLD; + fa >> fsBold; + fb >> fsBold; + fa << fsItalic; + fb << fsItalic; + fa *= style; + if( fa == fb ) code |= FSITALIC; + return code; +} + +TFontStyles Code2FontStyle(int code) +{ + TFontStyles fs; + + if( code & FSBOLD ) fs << fsBold; + if( code & FSITALIC ) fs << fsItalic; + return fs; +} + +static int FontZH; +static int FontZW; +static int FontZOX; +static int FontZOY; + +LPCSTR GetZeroCode(void) +{ + static char bf[3]; + bf[2] = 0; + switch(sys.m_FontCharset){ + case SHIFTJIS_CHARSET: + bf[0] = 0x83; + bf[1] = 0xd3; + break; + case HANGEUL_CHARSET: + bf[0] = 0xa8; // 0xa9 + bf[1] = 0xaa; + break; + case CHINESEBIG5_CHARSET: // ‘ä˜p + bf[0] = 0xa3; + bf[1] = 0x58; + break; + case 134: // ’†‘ŒêŠÈ—ª + bf[0] = 0xa6; + bf[1] = 0xd5; + break; + default: + bf[0] = char('Ø'); + bf[1] = 0; + break; + } + return bf; +} + +void DrawChar(TCanvas *pCanvas, int x, int y, char c) +{ + char bf[3]; + bf[1] = 0; + int size = 0; + if( (c == '0') && sys.m_FontZero ){ + strcpy(bf, GetZeroCode()); + if( bf[1] ){ + size = pCanvas->Font->Size; + pCanvas->Font->Size = size * 7 / 8; + x += FontZOX; + y += FontZOY; + } + } + else { + bf[0] = c; + } + + ::SetBkMode(pCanvas->Handle, TRANSPARENT); + pCanvas->TextOut(x, y, bf); + if( size ){ + pCanvas->Font->Size = size; + } +} + +//--------------------------------------------------------------------------- +void TopWindow(TForm *tp) +{ + if( tp->FormStyle == fsStayOnTop ){ + ::SetWindowPos(tp->Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); + } +} +void NormalWindow(TForm *tp) +{ + if( tp->FormStyle == fsStayOnTop ){ + ::SetWindowPos(tp->Handle, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); + } +} +//--------------------------------------------------------------------------- +// ƒƒCƒ“‰æ–Ê•\ަˆ—ƒNƒ‰ƒX +CPrintText::CPrintText() +{ + pPaintBox = NULL; + pCanvas = NULL; + pBitmap = NULL; + + m_TX = 0; + + m_Scroll = 0; + m_Top = 0; + m_Line = 0; + m_Col = 0; + m_Count = 0; + m_WriteLine = 0; + m_DisEvent = 0; + m_fp = NULL; + memset(pList, 0, sizeof(pList)); + memset(pColList, 0, sizeof(pColList)); +} + +CPrintText::~CPrintText() +{ + int i; + for( i = 0; i < TEXTLINEMAX; i++ ){ + if( pList[i] != NULL ) delete[] pList[i]; //JA7UDE 0428 + pList[i] = NULL; + if( pColList[i] != NULL ) delete[] pColList[i]; //JA7UDE 0428 + pColList[i] = NULL; + } +} + +void CPrintText::Clear(void) +{ + m_Top = 0; + m_Line = 0; + m_Col = 0; + m_Count = 0; + m_WriteLine = 0; + + int i; + for( i = 0; i < TEXTLINEMAX; i++ ){ + *pList[i] = char(i ? -1 : 0); + } + for( i = 0; i < TEXTLINEMAX; i++ ){ + *pColList[i] = 0; + } + if( pScroll != NULL ) pScroll->Enabled = FALSE; + if( pPaintBox != NULL ) pPaintBox->Invalidate(); +} + +void CPrintText::CursorOff(void) +{ + if( m_Cursor ){ + DrawCursor(0); + } +} + +void CPrintText::CursorOn() +{ + if( m_Cursor ){ + DrawCursor(1); + } +} + +void CPrintText::DrawCursor(int sw) +{ + if( GetPos(m_Line) != m_WriteLine ) return; + + TRect rc; + + rc.Left = m_Col * m_FW + 1; + rc.Right = rc.Left + m_FW - 1; + rc.Bottom = (m_Line * m_FH) + m_FH - 1; + rc.Top = rc.Bottom - 3; + + if( sw ){ + pCanvas->Brush->Color = sys.m_ColorRX; + pCanvas->FillRect(rc); + } + else { + if( pBitmap != NULL ){ + pCanvas->Brush->Bitmap = pBitmap; + } + else { + pCanvas->Brush->Color = sys.m_ColorRXBack; + } + pCanvas->FillRect(rc); +// pCanvas->Font->Color = sys.m_ColorRX; + if( (pList[m_WriteLine] != NULL) && (*pList[m_WriteLine]!=-1) ){ + LPSTR p = pList[m_WriteLine]; + LPSTR pc = pColList[m_WriteLine]; + if( int(strlen(p)) > m_Col ){ + pCanvas->Font->Color = pc[m_Col] ? sys.m_ColorRXTX : sys.m_ColorRX; + DrawChar(pCanvas, m_Col * m_FW, m_Line * m_FH, p[m_Col]); + } + } + } +} + +void CPrintText::SetCursor(int sw) +{ + if( m_Cursor != sw ){ + DrawCursor(sw); + m_Cursor = sw; + } +} + +void CPrintText::AdjZero(void) +{ + if( pCanvas == NULL ) return; + + LPCSTR p = GetZeroCode(); + if( sys.m_FontZero && (*(p+1)) ){ + pCanvas->Font->Size = sys.m_FontSize * 7 / 8; + FontZH = pCanvas->TextHeight(p) + sys.m_FontAdjY; + FontZW = pCanvas->TextWidth(p) + sys.m_FontAdjX; + FontZOX = (m_FW - FontZW)/2; + FontZOY = (m_FH - FontZH)/2; + } + pCanvas->Font->Size = sys.m_FontSize; +} + +void CPrintText::SetPaintBox(TPaintBox *tp, TScrollBar *sp) +{ + pPaintBox = tp; + pScroll = sp; + + pScroll->Align = alRight; + pScroll->EnableAlign(); + pCanvas = pPaintBox->Canvas; + + if( !sys.m_FontName.IsEmpty() ){ + pPaintBox->Font->Name = sys.m_FontName; + pCanvas->Font->Name = sys.m_FontName; + } + pPaintBox->Font->Charset = BYTE(sys.m_FontCharset); + pCanvas->Font->Charset = BYTE(sys.m_FontCharset); + + TFontStyles fs = Code2FontStyle(sys.m_FontStyle); + pPaintBox->Font->Style = fs; + pCanvas->Font->Style = fs; + + pPaintBox->Font->Pitch = fpFixed; + pCanvas->Font->Pitch = fpFixed; + LPCSTR p = GetZeroCode(); + if( sys.m_FontZero && (*(p+1)) ){ + pPaintBox->Font->Size = sys.m_FontSize * 7 / 8; + pCanvas->Font->Size = sys.m_FontSize * 7 / 8; + FontZH = pCanvas->TextHeight(p) + sys.m_FontAdjY; + FontZW = pCanvas->TextWidth(p) + sys.m_FontAdjX; + } + + pPaintBox->Font->Size = sys.m_FontSize; + pCanvas->Font->Size = sys.m_FontSize; + + m_FH = pCanvas->TextHeight("M") + sys.m_FontAdjY; + m_FW = pCanvas->TextWidth("M") + sys.m_FontAdjX; + if( sys.m_FontZero && (*(p+1)) ){ + FontZOX = (m_FW - FontZW)/2; + FontZOY = (m_FH - FontZH)/2; + } + m_LineMax = pPaintBox->Height / m_FH; + int OldColMax = m_ColMax; + if( Remote ){ + m_ColMax = 80; + } + else { + m_ColMax = pPaintBox->Width / m_FW; + } + m_DestRC.Left = 0; m_DestRC.Right = pPaintBox->Width - 1; + m_SourceRC.Left = 0; m_SourceRC.Right = pPaintBox->Width - 1; + m_FillRC.Left = 0; m_FillRC.Right = pPaintBox->Width - 1; + + m_DestRC.Top = 0; m_DestRC.Bottom = m_FH * (m_LineMax - 1); + m_SourceRC.Top = m_FH; m_SourceRC.Bottom = m_FH * m_LineMax; + m_FillRC.Top = m_FH * (m_LineMax - 1); m_FillRC.Bottom = m_FH * m_LineMax; + if( pBitmap != NULL ){ + pCanvas->Brush->Bitmap = pBitmap; + } + else { + pCanvas->Brush->Color = sys.m_ColorRXBack; + } + + if( m_ColMax != OldColMax ){ + int i; + int CopyLen = (m_ColMax > OldColMax) ? OldColMax : m_ColMax; + for( i = 0; i < TEXTLINEMAX; i++ ){ + if( pList[i] != NULL ){ + LPSTR p = new char[m_ColMax + 1]; + StrCopy(p, pList[i], CopyLen); + delete pList[i]; + pList[i] = p; + + p = new char[m_ColMax + 1]; + memcpy(p, pColList[i], CopyLen); + delete pColList[i]; + pColList[i] = p; + } + else { + pList[i] = new char[m_ColMax + 1]; + *pList[i] = char(i ? -1 : 0); + pColList[i] = new char[m_ColMax + 1]; + *pColList[i] = 0; + } + } + } + if( m_Col >= m_ColMax ){ + m_Col = m_ColMax - 1; + } + if( m_Count >= m_LineMax ){ + m_Line = m_LineMax - 1; + m_Top = AdjustPos(m_WriteLine - m_LineMax + 1); + if( GetPos(m_Line+1) == m_WriteLine ){ + m_DisEvent++; + pScroll->Max = m_Count - m_LineMax + 1; + pScroll->Position = pScroll->Max; + pScroll->LargeChange = WORD(m_LineMax * 2 / 3); + pScroll->SmallChange = 1; + pScroll->Enabled = TRUE; + m_DisEvent--; + } + } + else { + m_Line = m_WriteLine; + m_Top = 0; + pScroll->Enabled = FALSE; + } + pPaintBox->Invalidate(); +} + +void CPrintText::Scroll(void) +{ + if( !pPaintBox->Visible ) return; + +#if 1 + if( ::GetForegroundWindow() != Application->MainForm->Handle ){ + pPaintBox->Invalidate(); +// Application->MainForm->Caption = "Invalidate"; + } + else { + pCanvas->CopyRect(m_DestRC, pCanvas, m_SourceRC); + pCanvas->FillRect(m_FillRC); +// Application->MainForm->Caption = "CopyRect"; + } +#else + pCanvas->CopyRect(m_DestRC, pCanvas, m_SourceRC); + pCanvas->FillRect(m_FillRC); +#endif +} + +//------------------------------------------ +// 0: / ‚Å•ª—£‚µ‚È‚¢ +// 1: / ‚Å•ª—£ +void CPrintText::GetText(LPSTR t, int x, int y, int sw) +{ + char *bp = new char[m_ColMax * 3 + 1]; + + *t = 0; + int col = (x / m_FW) + m_ColMax; + int line = y / m_FH; + + int pos = GetPos(line); + + memset(bp, 0, m_ColMax * 3 + 1); + + memcpy(bp, pList[GetBefore(pos)], m_ColMax); + if( (*bp == -1) || ((int)strlen(bp) < m_ColMax) ){ + memset(bp, 0, m_ColMax); + } + + memcpy(bp+m_ColMax, pList[pos], m_ColMax); + if( bp[m_ColMax] == -1 ) bp[m_ColMax] = 0; + int len = strlen(&bp[m_ColMax]); + memset(&bp[m_ColMax + len], 0, m_ColMax - len); + + memcpy(bp+m_ColMax+m_ColMax, pList[GetNext(pos)], m_ColMax); + if( bp[m_ColMax+m_ColMax] == -1 ){ + bp[m_ColMax+m_ColMax] = 0; + } + + LPSTR p; + for( p = &bp[col]; p >= bp; p-- ){ + if( !isalpha(*p) && !isdigit(*p) && ((*p != '/')||sw) && ((sw != 2) || (*p != ':')) ){ + break; + } + } + p++; + if( isalpha(*p) || isdigit(*p) ){ + strcpy(t, p); + for( p = t; *p; p++ ){ + if( !isalpha(*p) && !isdigit(*p) && ((*p != '/')||sw) && ((sw != 2) || (*p != ':')) ){ + *p = 0; + break; + } + } + } + delete bp; +} + +//------------------------------------------ +int CPrintText::GetText(LPSTR t, int y) +{ + if( y > m_Count ) return 0; + + y = AdjustPos(m_WriteLine - y); + if( *pList[y] ){ + if( *pColList[y] ){ + return 0; + } + else { + strcpy(t, pList[y]); + } + } + else { + *t = 0; + } + return 1; +} + +void CPrintText::ShiftText(int x, int y) +{ + CRTTY rtty; + + int col = x / m_FW; + int line = y / m_FH; + + int pos = GetPos(line); + + LPSTR s = pList[pos]; + if( *s == -1 ) return; + if( (int)strlen(s) <= col ) return; + + LPSTR p; + for( p = &s[col-1]; p >= s; p-- ){ + if( *p != ' ' ){ + *p = rtty.InvShift(*p); + } + else { + break; + } + } + for( p = &s[col]; *p; p++ ){ + if( *p != ' ' ){ + *p = rtty.InvShift(*p); + } + else { + break; + } + } + pPaintBox->Invalidate(); +} + +void CPrintText::GetString(AnsiString &as) +{ + as = ""; + + LPSTR p; + int l = m_WriteLine; + if( m_Count < TEXTLINEMAX ){ + l = m_WriteLine - m_Count - 1; + } + l = AdjustPos(l); + do { + l = GetNext(l); + p = pList[l]; + if( *p != -1 ){ + as += pList[l]; + as += "\r\n"; + } + }while((l != m_WriteLine)); +} + +void CPrintText::PaintCanvas(void) +{ + if( pCanvas == NULL ) return; + + CursorOff(); + int i, j, x, y; + LPSTR p, pc; +// pCanvas->Font->Color = sys.m_ColorRX; + for( y = i = 0; i <= m_Line; i++, y += m_FH ){ + p = pList[GetPos(i)]; + pc = pColList[GetPos(i)]; + if( *p != -1 ){ + for( x = j = 0; j < m_ColMax; j++, x += m_FW, p++, pc++ ){ + if( *p ){ + pCanvas->Font->Color = *pc ? sys.m_ColorRXTX : sys.m_ColorRX; + DrawChar(pCanvas, x, y, *p); + } + else { + break; + } + } + } + else { + break; + } + } + CursorOn(); +} + +void CPrintText::IncCount(void) +{ + m_WriteLine = GetNext(m_WriteLine); + *(pList[m_WriteLine]) = 0; + *(pList[GetNext(m_WriteLine)]) = -1; + if( m_Count < TEXTLINEMAX ){ + m_Count++; + if( m_Count >= m_LineMax ){ + if( GetPos(m_Line+1) == m_WriteLine ){ + m_DisEvent++; + pScroll->Max = m_Count - m_LineMax + 1; + pScroll->Position = pScroll->Max; + pScroll->LargeChange = WORD(m_LineMax * 2 / 3); + pScroll->SmallChange = 1; + pScroll->Enabled = TRUE; + m_DisEvent--; + } + } + } + if( m_Count >= m_LineMax ){ + if( GetPos(m_Line+1) == m_WriteLine ){ + m_Top = GetNext(m_Top); + } + } +} + +void CPrintText::ScrollBarChange(void) +{ + if( m_DisEvent ) return; + + int n = pScroll->Max - pScroll->Position; + if( n > (TEXTLINEMAX - m_LineMax - 1) ) n = TEXTLINEMAX - m_LineMax - 1; + m_Top = m_WriteLine - m_LineMax - n + 1; + while( m_Top < 0 ) m_Top += TEXTLINEMAX; + while( m_Top >= TEXTLINEMAX ) m_Top -= TEXTLINEMAX; + if( pScroll->Max == pScroll->Position ){ + m_DisEvent++; + int max = m_Count - m_LineMax + 1; + pScroll->SetParams(max, 0, max); + m_DisEvent--; + } + pPaintBox->Invalidate(); +} + +void CPrintText::ScrollBarUp(int page) +{ + if( pScroll->Enabled == TRUE ){ + if( pScroll->Position ){ + int n; + if( page == 0 ){ + n = 1; + } + else if( page == 1 ){ + n = m_LineMax/2; + } + else { + n = pScroll->Position; + } + if( pScroll->Position < n ) n = pScroll->Position; + pScroll->Position = pScroll->Position - n; + } + } +} + +void CPrintText::ScrollBarDown(int page) +{ + if( pScroll->Enabled == TRUE ){ + if( pScroll->Position != pScroll->Max ){ + int n; + if( page == 0 ){ + n = 1; + } + else if( page == 1 ){ + n = m_LineMax/2; + } + else { + n = pScroll->Max - pScroll->Position; + } + if( (pScroll->Position + n) > pScroll->Max ) n = pScroll->Max - pScroll->Position; + pScroll->Position = pScroll->Position + n; + } + } +} + +void CPrintText::TrigTimeStampImm(LPCSTR pName) +{ + if( m_fp == NULL ) return; + + m_TimeStampTrig = 0; + m_TrigName = pName; + if( sys.m_TimeStampUTC ){ + GetUTC(&m_TrigTime); + } + else { + GetLocal(&m_TrigTime); + } + m_TimeStampTrig = 1; + + if( m_Col ){ + WriteFile("\r\n"); + } + WriteTimeStamp(); +} + +void CPrintText::TrigTimeStamp(LPCSTR pName, int sw) +{ + if( !sw && (m_fp == NULL) ) return; + + m_TimeStampTrig = 0; + m_TrigName = pName; + if( sys.m_TimeStampUTC ){ + GetUTC(&m_TrigTime); + } + else { + GetLocal(&m_TrigTime); + } + m_TimeStampTrig = 1; + if( sw ){ + m_TimeStampTrig = 0; + char bf[256]; + LPCSTR p; + + if( m_Col ){ + PutChar(0x0d); + PutChar(0x0a); + } + sprintf(bf, "<%02u%02u%02u %02u:%02u:%02u %s>\r\n", + m_TrigTime.wYear % 100, m_TrigTime.wMonth, m_TrigTime.wDay, + m_TrigTime.wHour, m_TrigTime.wMinute, m_TrigTime.wSecond, + m_TrigName.c_str() + ); + for( p = bf; *p; p++ ){ + PutChar(*p); + } + } + else if( !m_Col ){ + WriteTimeStamp(); + } +} + +void CPrintText::WriteTimeStamp(void) +{ + if( m_fp == NULL ) return; + + char bf[256]; + + if( m_TimeStampTrig ){ + m_TimeStampTrig = 0; + sprintf(bf, "<%02u%02u%02u %02u:%02u:%02u %s>\r\n", + m_TrigTime.wYear % 100, m_TrigTime.wMonth, m_TrigTime.wDay, + m_TrigTime.wHour, m_TrigTime.wMinute, m_TrigTime.wSecond, + m_TrigName.c_str() + ); + WriteFile(bf); + } +//typedef struct _SYSTEMTIME { /* st */ +// WORD wYear; +// WORD wMonth; +// WORD wDayOfWeek; +// WORD wDay; +// WORD wHour; +// WORD wMinute; +// WORD wSecond; +// WORD wMilliseconds; +//} SYSTEMTIME; +} + +void CPrintText::WriteFile(LPCSTR p) +{ + if( m_fp == NULL ) return; + + for( ; *p; p++ ){ + WriteFile(*p); + } +} + +void CPrintText::WriteFile(char c) +{ + if( m_fp != NULL ){ + fputc(c & 0x007f, m_fp); + } +} + +void CPrintText::PutChar(char c) +{ + int show = (GetPos(m_Line) == m_WriteLine) ? 1 : 0; + + CursorOff(); + if( c == 0x0a ){ + if( m_Scroll != 'o' ){ + WriteFile("\r\n"); + WriteTimeStamp(); + IncCount(); + m_Col = 0; + if( show ){ + m_Line++; + if( m_Line >= m_LineMax ){ + m_Line--; + Scroll(); + } + m_Scroll = c; + } + } + else { + m_Scroll = 0; + } + } + else if( c == 0x0d ){ + if( m_Scroll != 'o' ){ + m_Col = 0; + m_Scroll = c; + } + } + else if( c ){ + if( m_Scroll ){ + if( m_Scroll == 0x0d ){ + PutChar(0x0a); + CursorOff(); + m_Scroll = 0; + } + m_Col = 0; + m_Scroll = 0; + } + LPSTR pt = pList[m_WriteLine]; + WriteFile(c); + pt[m_Col] = c; + pt[m_Col + 1] = 0; + LPSTR pc = pColList[m_WriteLine]; + pc[m_Col] = BYTE(m_TX); + if( show ){ + pCanvas->Font->Color = m_TX ? sys.m_ColorRXTX : sys.m_ColorRX; + DrawChar(pCanvas, m_Col * m_FW, m_Line * m_FH, c); + } + m_Col++; + if( m_Col >= m_ColMax ){ + m_Col = 0; + IncCount(); + if( show ){ + m_Line++; + if( m_Line >= m_LineMax ){ + WriteFile("\r\n"); + WriteTimeStamp(); + m_Line--; + Scroll(); + } + m_Scroll = 'o'; + } + } + } + CursorOn(); +} + +void CPrintText::MakeLogName(void) +{ + char bf[256]; + +//typedef struct _SYSTEMTIME { /* st */ +// WORD wYear; +// WORD wMonth; +// WORD wDayOfWeek; +// WORD wDay; +// WORD wHour; +// WORD wMinute; +// WORD wSecond; +// WORD wMilliseconds; +//} SYSTEMTIME; + + SYSTEMTIME st; + + GetLocal(&st); + sprintf(bf, "%s%02u%02u%02u.txt", LogDir, st.wYear % 100, st.wMonth, st.wDay); + sys.m_LogName = bf; +} + +void CPrintText::OpenLogFile(void) +{ + CloseLogFile(); + if( sys.m_LogName.IsEmpty() ) return; + if( !sys.m_log ) return; + + m_fp = fopen(sys.m_LogName.c_str(), "ab"); + if( m_fp == NULL ){ + ErrorMB( "%s ‚ªƒI[ƒvƒ“‚Å‚«‚Ü‚¹‚ñ.", sys.m_LogName.c_str() ); + return; + } + fprintf(m_fp, "\r\n"); +} + +void CPrintText::CloseLogFile(void) +{ + if( m_fp != NULL ){ + if( fclose(m_fp) ){ + m_fp = NULL; + ErrorMB( "%s ‚ª³‚µ‚­ì¬‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½.", sys.m_LogName.c_str() ); + } + m_fp = NULL; + } +} + +//--------------------------------------------------------------------------- +// ƒL[“ü—͉æ–Ê•\ަˆ—ƒNƒ‰ƒX +CFifoEdit::CFifoEdit() +{ + pPaintBox = NULL; + pCanvas = NULL; + pScroll = NULL; + pBitmap = NULL; + + m_DispTop = 0; + m_Line = 0; + m_WriteLine = 0; + m_WriteCol = 0; + m_ReadLine = 0; + m_ReadCol = 0; + m_DisEvent = 0; + m_Cursor = 1; + memset(pList, 0, sizeof(pList)); +} + +CFifoEdit::~CFifoEdit() +{ + int i; + for( i = 0; i < FIFOLINEMAX; i++ ){ + if( pList[i] != NULL ) delete[] pList[i]; + pList[i] = NULL; + } +} + +void CFifoEdit::CursorOff(void) +{ + if( m_Cursor ){ + DrawCursor(0); + } +} + +void CFifoEdit::CursorOn() +{ + if( m_Cursor ){ + DrawCursor(1); + } +} + +void CFifoEdit::DrawCursor(int sw) +{ + if( m_WriteLine > (m_DispTop + m_Line) ) return; + + TRect rc; + + rc.Left = m_WriteCol * m_FW + 1; + rc.Right = rc.Left + m_FW - 1; + rc.Bottom = (m_Line * m_FH) + m_FH - 1; + rc.Top = rc.Bottom - 3; + + if( sw ){ + pCanvas->Brush->Color = sys.m_ColorIN; + pCanvas->FillRect(rc); + } + else { + if( pBitmap != NULL ){ + pCanvas->Brush->Bitmap = pBitmap; + } + else { + pCanvas->Brush->Color = sys.m_ColorINBack; + } + pCanvas->FillRect(rc); + pCanvas->Font->Color = sys.m_ColorIN; + if( m_WriteLine >= FIFOLINEMAX ) return; + if( (pList[m_WriteLine] != NULL) && (*pList[m_WriteLine]!=-1) ){ + LPSTR p = pList[m_WriteLine]; + if( int(strlen(p)) > m_WriteCol ){ + DrawChar(pCanvas, m_WriteCol * m_FW, m_Line * m_FH, p[m_WriteCol]); + } + } + } +} + +void CFifoEdit::SetCursor(int sw) +{ + if( m_Cursor != sw ){ + DrawCursor(sw); + m_Cursor = sw; + } +} + +void CFifoEdit::SetPaintBox(TPaintBox *tp, TScrollBar *sp) +{ + pPaintBox = tp; + pScroll = sp; + + pScroll->Align = alRight; + pScroll->EnableAlign(); + pCanvas = pPaintBox->Canvas; + + if( !sys.m_FontName.IsEmpty() ){ + pPaintBox->Font->Name = sys.m_FontName; + pCanvas->Font->Name = sys.m_FontName; + } + + TFontStyles fs = Code2FontStyle(sys.m_FontStyle); + pPaintBox->Font->Style = fs; + pCanvas->Font->Style = fs; + + pPaintBox->Font->Charset = BYTE(sys.m_FontCharset); + pCanvas->Font->Charset = BYTE(sys.m_FontCharset); + pPaintBox->Font->Pitch = fpFixed; + pCanvas->Font->Pitch = fpFixed; + pPaintBox->Font->Size = sys.m_FontSize; + pCanvas->Font->Size = sys.m_FontSize; + + m_FH = pCanvas->TextHeight("M") + sys.m_FontAdjY; + m_FW = pCanvas->TextWidth("M") + sys.m_FontAdjX; + + m_LineMax = pPaintBox->Height / m_FH; + int OldColMax = m_ColMax; + if( Remote ){ + m_ColMax = 80; + } + else { + m_ColMax = pPaintBox->Width / m_FW; + } + m_DestRC.Left = 0; m_DestRC.Right = pPaintBox->Width - 1; + m_SourceRC.Left = 0; m_SourceRC.Right = pPaintBox->Width - 1; + m_FillRC.Left = 0; m_FillRC.Right = pPaintBox->Width - 1; + + m_DestRC.Top = 0; m_DestRC.Bottom = m_FH * (m_LineMax - 1); + m_SourceRC.Top = m_FH; m_SourceRC.Bottom = m_FH * m_LineMax; + m_FillRC.Top = m_FH * (m_LineMax - 1); m_FillRC.Bottom = m_FH * m_LineMax; + if( pBitmap != NULL ){ + pCanvas->Brush->Bitmap = pBitmap; + } + else { + pCanvas->Brush->Color = sys.m_ColorINBack; + } + + if( OldColMax != m_ColMax ){ + int i; + int CopyLen = (m_ColMax > OldColMax) ? OldColMax : m_ColMax; + for( i = 0; i < FIFOLINEMAX; i++ ){ + if( pList[i] != NULL ){ + LPSTR p = new char[m_ColMax + 1]; + StrCopy(p, pList[i], CopyLen); + delete pList[i]; + pList[i] = p; + } + else { + pList[i] = new char[m_ColMax + 1]; + *pList[i] = 0; + } + } + } + if( m_WriteCol >= m_ColMax ){ + m_WriteCol = m_ColMax - 1; + } + if( m_WriteLine >= m_LineMax ){ + m_Line = m_LineMax - 1; + m_DispTop = m_WriteLine - m_LineMax + 1; + } + else { + m_Line = m_WriteLine; + m_DispTop = 0; + } + UpdateScroll(); + pPaintBox->Invalidate(); +} + +void CFifoEdit::Scroll(void) +{ + pCanvas->CopyRect(m_DestRC, pCanvas, m_SourceRC); + pCanvas->FillRect(m_FillRC); +} + +void CFifoEdit::PaintCanvas(void) +{ + if( pCanvas == NULL ) return; + + CursorOff(); + int i, j, x, y, line; + LPSTR p; + line = m_DispTop; + for( i = y = 0; i <= m_Line; i++, line++, y += m_FH ){ + if( line >= FIFOLINEMAX ) break; + p = pList[line]; + for( x = j = 0; j < m_ColMax; j++, x += m_FW, p++ ){ + if( *p ){ + ::SetBkMode(pCanvas->Handle, TRANSPARENT); + if( (line < m_ReadLine) || + ((line == m_ReadLine) && (j < m_ReadCol) ) + ){ + pCanvas->Font->Color = sys.m_ColorINTX; + } + else { + pCanvas->Font->Color = sys.m_ColorIN; + } + DrawChar(pCanvas, x, y, *p); + } + else { + break; + } + } + } + CursorOn(); +} + +void CFifoEdit::ScrollBarChange(void) +{ + if( m_DisEvent ) return; + + int n = pScroll->Max - pScroll->Position; + m_DispTop = m_WriteLine - m_LineMax - n + 1; + if( m_DispTop < 0 ) m_DispTop = 0; + if( m_DispTop > (m_WriteLine - m_LineMax) ) m_DispTop = m_WriteLine - m_LineMax + 1; + if( pScroll->Max == pScroll->Position ){ // ÅIs‚ÌŽž + m_DisEvent++; + int max = m_WriteLine - m_LineMax + 1; + pScroll->SetParams(max, 0, max); + m_DisEvent--; + } + pPaintBox->Invalidate(); +} + +void CFifoEdit::ScrollBarUp(int page) +{ + if( pScroll->Enabled == TRUE ){ + if( pScroll->Position ){ + int n; + if( page == 0 ){ + n = 1; + } + else if( page == 1 ){ + n = m_LineMax/2; + } + else { + n = pScroll->Position; + } + if( pScroll->Position < n ) n = pScroll->Position; + pScroll->Position = pScroll->Position - n; + } + } +} + +void CFifoEdit::ScrollBarDown(int page) +{ + if( pScroll->Enabled == TRUE ){ + if( pScroll->Position != pScroll->Max ){ + int n; + if( page == 0 ){ + n = 1; + } + else if( page == 1 ){ + n = m_LineMax/2; + } + else { + n = pScroll->Max - pScroll->Position; + } + if( (pScroll->Position + n) > pScroll->Max ) n = pScroll->Max - pScroll->Position; + pScroll->Position = pScroll->Position + n; + } + } +} + +//--------------------------------------------------------------- +// ƒXƒNƒ[ƒ‹ƒo[‚ÌXV +void CFifoEdit::UpdateScroll(void) +{ + m_DisEvent++; + if( m_WriteLine >= m_LineMax ){ + int max = m_WriteLine - m_LineMax + 1; + pScroll->SetParams(max, 0, max); + pScroll->LargeChange = WORD(m_LineMax * 2 / 3); + pScroll->SmallChange = 1; + pScroll->Enabled = TRUE; + } + else if( pScroll->Enabled ){ + pScroll->Enabled = FALSE; + } + m_DisEvent--; +} +//--------------------------------------------------------------- +// ‚·‚ׂăNƒŠƒA‚·‚é +void CFifoEdit::Clear(void) +{ + m_Line = 0; // ‰æ–Ê“à‚ÌsˆÊ’u + + m_DispTop = 0; // •\ަƒgƒbƒvs‚̈ʒu + + m_WriteLine = 0; // ‘‚«‚±‚Ýs‚̈ʒu + m_WriteCol = 0; // ‘‚«‚±‚݃Jƒ‰ƒ€ˆÊ’u + + m_ReadLine = 0; // Žæ‚肾‚µs‚̈ʒu + m_ReadCol = 0; // Žæ‚肾‚µƒJƒ‰ƒ€ˆÊ’u + + int i; + for( i = 0; i < FIFOLINEMAX; i++ ){ + memset(pList[i], 0, m_ColMax); + } + if( pScroll != NULL ) pScroll->Enabled = FALSE; + if( pPaintBox != NULL ) pPaintBox->Invalidate(); +} + +//--------------------------------------------------------------- +// 擪‚©‚ç‚Ì•¶Žš—ñ‚ð”ñ”j‰ó‚ÅŽæ‚èo‚· +void CFifoEdit::GetString(AnsiString &as) +{ + as = ""; + for( int i = 0; i <= m_WriteLine; i++ ){ + if( i ) as += "\r\n"; + if( i >= FIFOLINEMAX ) break; + if( *pList[i] ) as += pList[i]; + } +} +//--------------------------------------------------------------- +// Žæ‚肾‚µ‰Â”\‚È•¶Žš”‚𓾂é +int CFifoEdit::GetLen(void) +{ + int mr = m_ReadLine; + int n = 0; + while(mr < m_WriteLine){ + n += strlen(pList[mr]); + mr++; + } + n += (m_WriteCol - m_ReadCol); + return n; +} +//--------------------------------------------------------------- +// ÅŒã‚Ì•¶Žš‚𓾂é +char CFifoEdit::GetLastChar(void) +{ + if( m_ReadLine > m_WriteLine ) return 0; // ‘—o•¶Žš‚È‚µ + if( m_ReadLine == m_WriteLine ){ // “¯ˆês‚ÌŽž + if( m_WriteCol <= m_ReadCol ) return 0; // ‘—o•¶Žš‚È‚µ + } + if( !m_WriteCol ) return 0x0a; + + LPSTR p; + p = pList[m_WriteLine]; + p += m_WriteCol - 1; + return *p; +} +//--------------------------------------------------------------- +// ƒXƒy[ƒX‚ªŠÜ‚Ü‚ê‚Ä‚¢‚é‚©‚Ç‚¤‚©’²‚ׂé +int CFifoEdit::IsSAS(int sw) +{ + if( m_ReadLine > m_WriteLine ) return 1; // ‘—o•¶Žš‚È‚µ + if( m_ReadLine == m_WriteLine ){ // “¯ˆês‚ÌŽž + if( m_WriteCol <= m_ReadCol ) return 1; // ‘—o•¶Žš‚È‚µ + } + if( m_ReadLine < m_WriteLine ) return 1; // •¡”s‚̂Ƃ« + + + LPSTR p; + p = pList[m_ReadLine]; + p += m_ReadCol; + if( sw ){ + for( ; *p; p++ ){ + if( *p == '\\' ) return 1; + } + return 0; + } + if( !*p ) return 1; + for( ; *p; p++ ){ + if( *p == ' ' ) return 1; + if( *p == '\\' ) return 1; + } + return 0; +} +//--------------------------------------------------------------- +// 擪‚Ìˆê•¶Žš‚ðŽæ‚èo‚· +char CFifoEdit::GetChar(void) +{ + LPSTR p; + char c; + + if( m_ReadLine > m_WriteLine ) return -1; // ‘—o•¶Žš‚È‚µ + if( m_ReadLine == m_WriteLine ){ // “¯ˆês‚ÌŽž + if( m_WriteCol <= m_ReadCol ) return -1; // ‘—o•¶Žš‚È‚µ + } + + p = pList[m_ReadLine]; + p += m_ReadCol; + + if( !*p ){ // ‰üs + if( m_ReadCol ){ + c = *(p-1); + if( ((c == '_')||(c == '~')) && (m_ReadCol == m_ColMax) ){ + m_ReadLine++; + m_ReadCol = 0; + return 0; + } + } + c = 0x0d; + m_ReadLine++; + m_ReadCol = 0; + } + else { + if( *p == '%' ){ // “ÁŽê‹L† + if( (m_ReadLine >= m_WriteLine) && (m_WriteCol <= (m_ReadCol + 1)) ){ + return 0; // ‘—M•Û—¯ + } + } + c = *p; + if( (m_ReadLine >= m_DispTop) && (m_ReadLine <= (m_DispTop + m_ColMax - 1)) ){ + pCanvas->Font->Color = sys.m_ColorINTX; + ::SetBkMode(pCanvas->Handle, TRANSPARENT); + DrawChar(pCanvas, m_ReadCol * m_FW, (m_ReadLine - m_DispTop) * m_FH, c); + } + m_ReadCol++; + } + return c; +} + +//--------------------------------------------------------------- +// 擪‚Ìˆê•¶Žš‚Ì”ñ”j‰ó‚ÉŽæ‚èo‚· +LPCSTR CFifoEdit::GetCurLine(void) +{ + return pList[m_WriteLine]; +} + +//--------------------------------------------------------------- +// ƒoƒbƒNƒXƒy[ƒXˆ— +int CFifoEdit::BackSpace(void) +{ + if( m_ReadLine > m_WriteLine ) return FALSE; // ‘—o•¶Žš‚È‚µ + if( m_ReadLine == m_WriteLine ){ // “¯ˆês‚ÌŽž + if( m_WriteCol <= m_ReadCol ) return FALSE; // ‘—o•¶Žš‚È‚µ + } + if( m_WriteCol ){ + m_WriteCol--; + } + else { + m_WriteLine--; + if( m_DispTop ){ + m_DispTop--; + } + else { + m_Line--; + } + m_WriteCol = strlen(pList[m_WriteLine]); + if( m_WriteCol >= m_ColMax ) m_WriteCol--; + UpdateScroll(); + } + LPSTR p = pList[m_WriteLine]; + p += m_WriteCol; + *p = 0; + pPaintBox->Invalidate(); + return TRUE; +} + +//--------------------------------------------------------------- +// 1sƒoƒbƒNƒXƒy[ƒXˆ— +int CFifoEdit::LineBackSpace(void) +{ + if( m_ReadLine > m_WriteLine ) return FALSE; // ‘—o•¶Žš‚È‚µ + if( m_ReadLine == m_WriteLine ){ // “¯ˆês‚ÌŽž + if( m_WriteCol <= m_ReadCol ) return FALSE; // ‘—o•¶Žš‚È‚µ + } + + if( m_WriteCol ){ + while(m_WriteCol){ + if( BackSpace() == FALSE ) return FALSE; + } + return TRUE; + } + else { + return BackSpace(); + } +} + +//--------------------------------------------------------------- +// 擪‚Ì‚Ps‚ð–•Á‚·‚é +int CFifoEdit::DeleteTop(void) +{ + if( m_ReadLine ){ // ‘—oÏ‚Ý + int i; + for( i = 0; i < (FIFOLINEMAX - 1); i++ ){ + strcpy(pList[i], pList[i+1]); + } + *pList[i] = 0; + m_ReadLine--; + m_WriteLine--; + if( m_WriteLine <= (m_DispTop + m_Line) ){ + m_DispTop--; + } + else { + pPaintBox->Invalidate(); + } + return TRUE; + } + else { + return FALSE; + } +} + +void CFifoEdit::PutChar(char c) +{ + int show = (m_WriteLine > (m_DispTop + m_Line)) ? 0 : 1; + + if( show && (c == 0x08) ){ // BS‚ÌŽž + if( BackSpace() == TRUE ) return; + c = 'X'; + } + if( m_WriteLine >= FIFOLINEMAX ){ // ƒoƒbƒtƒ@ƒtƒ‹‚ÌŽž + if( DeleteTop() == FALSE ) return; + } + CursorOff(); + if( c != 0x0a ){ // LF‚͈—‚µ‚È‚¢ + if( c == 0x0d ){ + m_WriteLine++; + m_WriteCol = 0; + if( show ){ // •\ަ’†‚ÌŽž + m_Line++; + if( m_Line >= m_LineMax ){ + m_Line--; + Scroll(); + m_DispTop++; + UpdateScroll(); + } + } + } + else { + LPSTR pt = pList[m_WriteLine]; + pt[m_WriteCol] = c; + pt[m_WriteCol + 1] = 0; + if( show ){ + pCanvas->Font->Color = sys.m_ColorIN; + ::SetBkMode(pCanvas->Handle, TRANSPARENT); + DrawChar(pCanvas, m_WriteCol * m_FW, m_Line * m_FH, c); + } + m_WriteCol++; + if( m_WriteCol >= m_ColMax ){ + m_WriteCol = 0; + m_WriteLine++; + if( show ){ // •\ަ’†‚ÌŽž + m_Line++; + if( m_Line >= m_LineMax ){ + m_Line--; + Scroll(); + m_DispTop++; + UpdateScroll(); + } + } + } + } + } + CursorOn(); +} + +void CFifoEdit::PutText(LPCSTR p) +{ + for( ; *p; p++ ){ + if( *p != 0x0a ){ + PutChar(*p); + } + } +} + +///---------------------------------------------------------------- +/// CAlignƒNƒ‰ƒX +void CAlign::InitControl(TControl *p, TControl *pB, TFont *pF /*= NULL*/) +{ + tp = p; + OTop = p->Top; + OLeft = p->Left; + OWidth = p->Width; + OHeight = p->Height; + if( pF != NULL ){ + fp = pF; + OFontHeight = pF->Height; + } + + BTop = pB->Top; + BLeft = pB->Left; + BWidth = pB->ClientWidth; + BHeight = pB->ClientHeight; +} + +void CAlign::InitControl(TControl *p, RECT *rp, TFont *pF /*= NULL*/) +{ + tp = p; + OTop = p->Top; + OLeft = p->Left; + OWidth = p->Width; + OHeight = p->Height; + if( pF != NULL ){ + fp = pF; + OFontHeight = pF->Height; + } + + BTop = rp->top; + BLeft = rp->left; + BWidth = rp->right - rp->left + 1; + BHeight = rp->bottom - rp->top + 1; +} + +void CAlign::NewAlign(TControl *pB) +{ + double Sx = double(pB->ClientWidth)/double(BWidth); + double Sy = double(pB->ClientHeight)/double(BHeight); + tp->SetBounds(int(OLeft * Sx), int(OTop * Sy), int(OWidth * Sx), int(OHeight * Sy)); + if( fp != NULL ){ + if( Sx > Sy ) Sx = Sy; + fp->Height = int(OFontHeight * Sx) - sys.m_FontAdjSize; + m_FontAdj = Sx; + if( tp->ClassNameIs("TComboBox") ){ + ((TComboBox *)tp)->SelLength = 0; + } + } +} + +void CAlign::NewAlign(TControl *pB, double hx) +{ + double Sx = double(pB->ClientWidth)/double(BWidth); + double Sy = double(pB->ClientHeight)/double(BHeight); + Sy *= hx; + tp->SetBounds(int(OLeft * Sx), int(OTop * Sy), int(OWidth * Sx), int(OHeight * Sy)); + if( fp != NULL ){ + if( Sx > Sy ) Sx = Sy; + fp->Height = int(OFontHeight * Sx) - sys.m_FontAdjSize; + m_FontAdj = Sx; + if( tp->ClassNameIs("TComboBox") ){ + ((TComboBox *)tp)->SelLength = 0; + } + } +} + +void CAlign::NewFont(AnsiString &FontName, BYTE Charset, TFontStyles fs) +{ + if( fp != NULL ){ + fp->Name = FontName; + fp->Charset = Charset; + fp->Style = fs; + if( tp->ClassNameIs("TComboBox") ){ + ((TComboBox *)tp)->SelLength = 0; + } + } +} +///---------------------------------------------------------------- +/// CAlignListƒNƒ‰ƒX +CAlignList::CAlignList(void) +{ + Max = 0; + Cnt = 0; + AlignList = NULL; +} + +CAlignList::~CAlignList(){ + if( AlignList != NULL ){ + for( int i = 0; i < Cnt; i++ ){ + delete AlignList[i]; + } + delete[] AlignList; + AlignList = NULL; + } +} + +void CAlignList::Alloc(void) +{ + if( Cnt >= Max ){ + Max = Max ? Max * 2 : 16; + CAlign **np = (CAlign **)new BYTE[sizeof(CAlign*) * Max]; + if( AlignList != NULL ){ + for( int i = 0; i < Cnt; i++ ){ + np[i] = AlignList[i]; + } + delete[] AlignList; + } + AlignList = np; + } + AlignList[Cnt] = new CAlign; +} +void CAlignList::EntryControl(TControl *tp, TControl *pB, TFont *pF /*= NULL*/) +{ + Alloc(); + AlignList[Cnt]->InitControl(tp, pB, pF); + Cnt++; +} + +void CAlignList::EntryControl(TControl *tp, RECT *rp, TFont *pF /*= NULL*/){ + Alloc(); + AlignList[Cnt]->InitControl(tp, rp, pF); + Cnt++; +} + +void CAlignList::NewAlign(TControl *pB) +{ + if( AlignList == NULL ) return; + for( int i = 0; i < Cnt; i++ ){ + AlignList[i]->NewAlign(pB); + } +} + +double CAlignList::GetFontAdj(TControl *pB) +{ + for( int i = 0; i < Cnt; i++ ){ + if( AlignList[i]->GetControl() == pB ){ + return AlignList[i]->GetFontAdj(); + } + } + return 1.0; +} + +void CAlignList::NewAlign(TControl *pB, TControl *pS, double hx) +{ + for( int i = 0; i < Cnt; i++ ){ + if( AlignList[i]->GetControl() == pS ){ + AlignList[i]->NewAlign(pB, hx); + break; + } + } +} +void CAlignList::NewFont(AnsiString &FontName, BYTE Charset, TFontStyles fs) +{ + if( AlignList == NULL ) return; + for( int i = 0; i < Cnt; i++ ){ + AlignList[i]->NewFont(FontName, Charset, fs); + } +} + +///---------------------------------------------------------------- +/// CAlignGridƒNƒ‰ƒX +void CAlignGrid::InitGrid(TStringGrid *p) +{ + BWidth = p->Width; + BHeight = p->Height; + BRowHeight = p->DefaultRowHeight; + Max = p->ColCount; + bp = new int[Max]; + for( int i = 0; i < Max; i++ ){ + bp[i] = p->ColWidths[i]; + } +} + +void CAlignGrid::NewAlign(TStringGrid *p) +{ + double Sx = double(p->Width)/double(BWidth); + double Sy = double(p->Height)/double(BHeight); + p->DefaultRowHeight = int(BRowHeight * Sy); + for( int i = 0; (i < Max) && (i < p->ColCount); i++ ){ + p->ColWidths[i] = int(bp[i] * Sx); + } +} + + +///------------------------------------------------------ +/// +///CWebRef ƒNƒ‰ƒX +/// +void MakeCommand(LPSTR t, LPCSTR s, LPCSTR p) +{ + for( ;*s; s++ ){ + if( *s == '%' ){ + s++; + if( *s == '%' ){ + *t++ = '%'; + } + else if( (p != NULL) && (*s == '1') ){ + strcpy(t, p); + t += strlen(t); + p = NULL; + } + } + else { + *t++ = *s; + } + } + *t = 0; + if( p != NULL ){ + *t++ = ' '; + strcpy(t, p); + } +} + +CWebRef::CWebRef() +{ + HTML = ""; + + HKEY hkey=NULL; /* ƒI[ƒvƒ“ ƒL[‚̃nƒ“ƒhƒ‹ */ + + char bf[512], name[512]; + ULONG namelen, len; + if( !RegOpenKeyEx(HKEY_CLASSES_ROOT, "http", 0, KEY_READ, &hkey) ){ + if( !RegOpenKeyEx(hkey, "shell", 0, KEY_READ, &hkey) ){ + if( !RegOpenKeyEx(hkey, "open", 0, KEY_READ, &hkey) ){ + if( !RegOpenKeyEx(hkey, "command", 0, KEY_READ, &hkey) ){ + namelen = sizeof(name); + len = sizeof(bf); + if( !::RegEnumValue(hkey, 0, name, &namelen, NULL, + NULL, (LPBYTE)bf, &len) ){ + HTML = bf; + } + } + } + } + } + ::RegCloseKey(hkey); +} + +void CWebRef::ShowHTML(LPCSTR url) +{ + char cmd[1024]; + MakeCommand(cmd, HTML.c_str(), url); + ::WinExec(cmd, SW_SHOWDEFAULT); +} + + +///------------------------------------------------------ +/// +///CWaitCursor ƒNƒ‰ƒX +/// +CWaitCursor::CWaitCursor() +{ + sv = Screen->Cursor; + Screen->Cursor = crHourGlass; +} + +CWaitCursor::~CWaitCursor() +{ + Screen->Cursor = sv; +} + +void CWaitCursor::Delete(void) +{ + Screen->Cursor = sv; +} + +void CWaitCursor::Wait(void) +{ + Screen->Cursor = crHourGlass; +} + +///------------------------------------------------------- +/// CRecentMenuƒNƒ‰ƒX + +CRecentMenu::CRecentMenu() +{ + InsPos = 0; + Max = RECMENUMAX; + int i; + for( i = 0; i < RECMENUMAX; i++ ){ + Caption[i] = ""; + Items[i] = NULL; + } + Items[i] = NULL; +} +void CRecentMenu::Init(int pos, TMenuItem *pmenu, int max) +{ + InsPos = pos; + pMenu = pmenu; + Max = max; +} +void CRecentMenu::Init(TMenuItem *pi, TMenuItem *pmenu, int max) +{ + Init(pmenu->IndexOf(pi), pmenu, max); +} +int CRecentMenu::GetCount(void) +{ + int i, n; + for( i = n = 0; i < RECMENUMAX; i++, n++ ){ + if( Caption[i].IsEmpty() ) break; + } + return n; +} +LPCSTR CRecentMenu::GetItemText(int n) +{ + if( (n >= 0) && (n < RECMENUMAX) ){ + return Caption[n].c_str(); + } + else { + return NULL; + } +} +void CRecentMenu::SetItemText(int n, LPCSTR p) +{ + if( (n >= 0) && (n < RECMENUMAX) ){ + Caption[n] = p; + } +} +int CRecentMenu::IsAdd(LPCSTR pNew) +{ + return strcmp(Caption[0].c_str(), pNew); +} +void CRecentMenu::Add(LPCSTR pNew) +{ + if( !IsAdd(pNew) ) return; + int i; + for( i = 1; i < RECMENUMAX; i++ ){ + if( !strcmp(pNew, Caption[i].c_str()) ){ + for( ; i < (RECMENUMAX - 1); i++ ){ + Caption[i] = Caption[i+1]; + } + Caption[i] = ""; + break; + } + } + for( i = RECMENUMAX - 1; i > 0; i-- ){ + Caption[i] = Caption[i-1]; + } + Caption[0] = pNew; +} +void CRecentMenu::Delete(LPCSTR pName) +{ + int i; + for( i = 0; i < RECMENUMAX; i++ ){ + if( !strcmp(pName, Caption[i].c_str()) ){ + for( ; i < (RECMENUMAX - 1); i++ ){ + Caption[i] = Caption[i+1]; + } + Caption[i] = ""; + break; + } + } +} +void CRecentMenu::ExtFilter(LPCSTR pExt) +{ + int i, j; + + for( i = 0; i < RECMENUMAX; i++ ){ + if( (!Caption[i].IsEmpty()) && strcmpi(GetEXT(Caption[i].c_str()), pExt) ){ + for( j = i; j < (RECMENUMAX - 1); j++ ){ + Caption[j] = Caption[j+1]; + } + Caption[j] = ""; + i--; + } + } +} +void CRecentMenu::Clear(void) +{ + Delete(); + for( int i = 0; i < RECMENUMAX; i++ ){ + Caption[i] = ""; + } +} +void CRecentMenu::Insert(TObject *op, Classes::TNotifyEvent pEvent) +{ + int n = GetCount(); + int i; + int pos = InsPos; + if( n > Max ) n = Max; + char bf[256]; + for( i = 0; i < n; i++, pos++ ){ + Items[i] = new TMenuItem((TComponent *)op); + sprintf(bf, "&%d %s", (i + 1) % 10, Caption[i].c_str()); + Items[i]->Caption = bf; + Items[i]->OnClick = pEvent; + pMenu->Insert(pos, Items[i]); + } + if( n ){ + Items[i] = new TMenuItem((TComponent *)op); + Items[i]->Caption = "-"; + Items[i]->OnClick = NULL; + pMenu->Insert(pos, Items[n]); + } +} +void CRecentMenu::Delete(void) +{ + for( int i = 0; i < RECMENUMAX+1; i++ ){ + if( Items[i] != NULL ){ + pMenu->Delete(InsPos); + Items[i] = NULL; + } + } +} +int CRecentMenu::FindItem(TMenuItem *mp) +{ + for( int i = 0; i < RECMENUMAX; i++ ){ + if( Items[i] == mp ){ + return i; + } + } + return -1; +} +LPCSTR CRecentMenu::FindItemText(TMenuItem *mp) +{ + return GetItemText(FindItem(mp)); +} + +void KeyEvent(const short *p) +{ + for( ; *p; p++ ){ + keybd_event(BYTE(*p), 0, *p&0x8000 ? KEYEVENTF_KEYUP : 0, 0); + } +} + diff --git a/ComLib.h b/ComLib.h new file mode 100644 index 0000000..22deafc --- /dev/null +++ b/ComLib.h @@ -0,0 +1,752 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba, Dave Bernstein +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +#ifndef ComLibH +#define ComLibH +/* JA7UDE 0427 */ +#include +#include +#include //JA7UDE 0427 +#include +#include +#include +#include +#include +#include +#include + +#define VERID "Ver1.68" //AA6YQ 1.65D->1.66G, JE3HHT 1.67 +#define VERBETA "A" +#define VERTTL2 "MMTTY "VERID VERBETA +#define VERTTL VERTTL2" (C) JE3HHT 2000-2010." + +#define SETUPTITLE "Setup MMTTY "VERID VERBETA //AA6YQ 1.66C +#define SETUPTITLEREMOTE "Setup "VERID VERBETA //AA6YQ 1.66C + +#define SHIFTL 10 +#define MARKL 300 +#define SPACEH 2700 +#define XYCOLLECT 512 // XY-Scope ‚̃f[ƒ^ŽûWƒTƒCƒY + +#define REMMENU 1 +#define REMCTRL 2 +#define REMSHOWOFF 4 +#define REMNOMOVE 8 +#define REMNOPTT 16 +#define REMNOCNV 32 +#define REMVIATX 64 +#define REMDISFOCUS 128 +#define REMDISSHARED 256 +#define REMDISSTAYONTOP 512 + +#define FSBOLD 1 +#define FSITALIC 2 + +enum { + txSound, + txTXD, + txTXDOnly, +}; + +extern int WinNT; +extern int WinVista; //AA6YQ 1.66G + +extern int FSKCount; +extern int FSKCount1; +extern int FSKCount2; +extern int FSKDeff; + +extern LCID lcid; // ƒƒP[ƒ‹î•ñ +extern int DisPaint; +extern int Remote; + +extern double SampFreq; // ƒTƒ“ƒvƒŠƒ“ƒOŽü”g” +extern double SampBase; +extern double DemSamp; +extern int SampType; +extern int DemOver; +extern int FFT_SIZE; +extern int SampSize; + +extern char BgnDir[256]; +extern char LogDir[256]; +extern char OutFileDir[256]; +extern char MMLogDir[256]; +extern char ExtLogDir[256]; +extern char RecDir[256]; // ˜^‰¹ƒtƒ@ƒCƒ‹‚̃fƒBƒŒƒNƒgƒŠ + +extern AnsiString JanHelp; + +extern const char MONN[]; +extern const char MONU[]; + +#ifndef LPCUSTR +typedef const unsigned char * LPCUSTR; +typedef unsigned char * LPUSTR; +#endif + +extern DWORD ColorTable[128]; + +#define ABS(c) (((c)<0)?(-(c)):(c)) +#define AN(p) (sizeof(p)/sizeof(*(p))) +#define CR 0x0d +#define LF 0x0a +#define TAB '\t' + +typedef struct { + WORD Key; + LPCSTR pName; +}DEFKEYTBL; +extern const DEFKEYTBL KEYTBL[]; + +enum { + kkRcvLog, + kkFileOut, + kkSaveRx, + + kkOpenLog, + kkFlush, + + kkRecTime, + kkRec, + kkPlay, + kkPlayPos, // Ctrl+A + kkPlayStop, + kkScope, + kkLogList, + kkQSOData, + kkOption, + kkLogOption, + kkPanel, + kkExtCmd1, + kkExtCmd2, + kkExtCmd3, + kkExtCmd4, + kkExtReset, + kkExtSusp, + + kkFIG, + kkUOS, + kkTX, // F9 + kkTXOFF, // F8 + kkQSO, + kkCall, // Ctrl+C + kkName, // Ctrl+N + kkQTH, // Ctrl+Q + kkRST, // Ctrl+R + kkFind, // Ctrl+F + kkClear, // F1 + + kkInUp, + kkInDown, + kkInPUp, + kkInPDown, + kkInHome, + kkInEnd, + kkRxUp, + kkRxDown, + kkRxPUp, + kkRxPDown, + kkRxHome, + kkRxEnd, + + kkCharWaitLeft, + kkCharWaitRight, + kkDiddleWaitLeft, + kkDiddleWaitRight, + + kkInHeightUp, + kkInHeightDown, + + kkMyRST, + kkInitBox, + + kkTxLTR, + kkTxFIG, + + kkDecShift, + kkIncShift, + kkToggleShift, + kkClrRxWindow, + kkFreq, + kkRun, + kkPaste, + kkTNC, + kkMac, + kkEntTX, + kkWordWrap, + kkOnQSO, + kkOffQSO, + kkCAPTURE, + + kkPro1, + kkPro2, + kkPro3, + kkPro4, + kkPro5, + kkPro6, + kkPro7, + kkPro8, + kkProDef, + kkProRet, + + kkCList, + kkEOF, +}; +#define MSGLISTMAX 64 +typedef struct { + WORD m_SysKey[kkEOF]; + + int m_SoundPriority; + int m_SoundDevice; + int m_SoundOutDevice; //AA6YQ 1.66 + int m_SoundStereo; + int m_SoundFifoRX; + int m_SoundFifoTX; + AnsiString m_SoundMMW; + + AnsiString m_Call; + AnsiString m_User[16]; + AnsiString m_UserName[16]; + WORD m_UserKey[16]; + WORD m_UserEditKey[16]; + TColor m_UserCol[16]; + int m_UserTimer[16]; + int m_SBFontSize; + int m_SBINFontSize; + + AnsiString m_FontName; + int m_FontAdjX; + int m_FontAdjY; + int m_FontSize; + int m_FontCharset; + int m_FontZero; + int m_FontStyle; + + int m_FontAdjSize; + int m_BtnFontAdjSize; + + int m_WindowState; + + AnsiString m_MsgName[MSGLISTMAX]; + AnsiString m_MsgList[MSGLISTMAX]; + WORD m_MsgKey[MSGLISTMAX]; + + AnsiString m_InBtn[4]; + AnsiString m_InBtnName[4]; + WORD m_InBtnKey[4]; + TColor m_InBtnCol[4]; + int m_MacroImm; + + AnsiString m_ExtCmd[4]; + + AnsiString m_TxRxName; + int m_TxRxInv; + int m_txuos; + int m_dblsft; + + int m_lmsbpf; + + double m_DefMarkFreq; + double m_DefShift; + int m_DefStopLen; // 0-1Bit, 1-1.42 + + int m_echo; + + int m_AFC; + int m_FixShift; + int m_AFCSQ; + double m_AFCTime; + double m_AFCSweep; + int m_AFCNet; + + int m_TxNet; + int m_Rev; + int m_TxDisRev; + + double m_LimitGain; + + int m_log; + int m_logTimeStamp; + int m_ShowTimeStamp; + int m_TimeStampUTC; + int m_AutoTimeOffset; + int m_TimeOffset; + int m_TimeOffsetMin; + int m_LogLink; + + AnsiString m_LogName; + + int m_TxPort; // 0-Sound, 1-DTR, 2-TXD + int m_TxdStop; + int m_TxdJob; + int m_TxFixShift; + int m_CodeSet; + int m_DisTX; + + int m_Palette; + DWORD d_PaletteMask; + + int m_XYInv; + + TColor m_ColorRXBack; + TColor m_ColorRX; + TColor m_ColorRXTX; + TColor m_ColorINBack; + TColor m_ColorIN; + TColor m_ColorINTX; + + TColor m_ColorLow; + TColor m_ColorHigh; + + TColor m_ColorXY; + + AnsiString m_WinFontName; + BYTE m_WinFontCharset; + int m_WinFontStyle; + AnsiString m_BtnFontName; + BYTE m_BtnFontCharset; + int m_BtnFontStyle; + + int m_FFTGain; + int m_FFTResp; + double m_SampFreq; + double m_TxOffset; + + AnsiString m_HTMLHelp; + AnsiString m_Help; + AnsiString m_HelpLog; + AnsiString m_HelpDigital; + AnsiString m_HelpFontName; + BYTE m_HelpFontCharset; + int m_HelpFontSize; + int m_HelpNotePad; + + int m_CharLenFile; + int m_DisWindow; + int m_StayOnTop; + int m_MemWindow; + + int m_LWait; + AnsiString m_LogGridWidths; + AnsiString m_QSOGridWidths; + + int m_DefFix45; +}SYSSET; + +extern SYSSET sys; + +#define TEXTLINEMAX 512 +class CPrintText +{ +private: + TPaintBox *pPaintBox; + TScrollBar *pScroll; + TCanvas *pCanvas; + Graphics::TBitmap *pBitmap; + + LPSTR pList[TEXTLINEMAX]; + LPSTR pColList[TEXTLINEMAX]; + + int m_jisfont; + + int m_Top; + int m_Line; + int m_WriteLine; + int m_Col; + int m_Count; + + int m_FH; + int m_FW; + int m_LineMax; + int m_ColMax; + + int m_Scroll; + + TRect m_DestRC; + TRect m_SourceRC; + TRect m_FillRC; + + int m_Cursor; + int m_DisEvent; + + int m_TX; + + int m_TimeStampTrig; + SYSTEMTIME m_TrigTime; + AnsiString m_TrigName; + + FILE *m_fp; + + void Scroll(void); + void DrawCursor(int sw); + void CursorOff(void); + void CursorOn(); + void WriteTimeStamp(void); + +public: + CPrintText(); + ~CPrintText(); + + inline void SetTX(int sw){ + m_TX = sw; + }; + inline void SetBitmap(Graphics::TBitmap *p){ + pBitmap = p; + }; + inline int GetPos(int n){ + n += m_Top; + if( n >= TEXTLINEMAX ) n -= TEXTLINEMAX; + return n; + }; + inline int GetNext(int n){ + n++; + if( n >= TEXTLINEMAX ) n = 0; + return n; + }; + inline int GetBefore(int n){ + n--; + if( n < 0 ) n = TEXTLINEMAX - 1; + return n; + }; + inline int AdjustPos(int n){ + while( n < 0 ) n+= TEXTLINEMAX; + while( n >= TEXTLINEMAX ) n -= TEXTLINEMAX; + return n; + }; + void Clear(); + + void IncCount(void); + void SetPaintBox(TPaintBox *tp, TScrollBar *sp); + void AdjZero(void); + + void PutChar(char c); + void GetString(AnsiString &as); + void PaintCanvas(void); + void SetCursor(sw); + void GetText(LPSTR t, int x, int y, int sw); + int GetText(LPSTR t, int y); + void ShiftText(int x, int y); + + void ScrollBarChange(void); + void ScrollBarUp(int page); + void ScrollBarDown(int page); + void WriteFile(char c); + void WriteFile(LPCSTR p); + void MakeLogName(void); + void OpenLogFile(void); + void CloseLogFile(void); + void TrigTimeStamp(LPCSTR pName, int sw = 0); + void TrigTimeStampImm(LPCSTR pName); +}; + +#define FIFOLINEMAX 128 +class CFifoEdit +{ + TPaintBox *pPaintBox; + TScrollBar *pScroll; + TCanvas *pCanvas; + Graphics::TBitmap *pBitmap; + + LPSTR pList[FIFOLINEMAX]; + + int m_Line; // ‰æ–Ê“à‚ÌsˆÊ’u + + int m_DispTop; // •\ަƒgƒbƒvs‚̈ʒu + int m_DispLast; // •\ަÅIs‚̈ʒu + + int m_WriteLine; // ‘‚«‚±‚Ýs‚̈ʒu + + int m_ReadLine; // Žæ‚肾‚µs‚̈ʒu + int m_ReadCol; // Žæ‚肾‚µƒJƒ‰ƒ€ˆÊ’u + + int m_FH; + int m_FW; + int m_LineMax; + + TRect m_DestRC; + TRect m_SourceRC; + TRect m_FillRC; + + int m_Cursor; + int m_DisEvent; +public: + int m_ColMax; + int m_WriteCol; // ‘‚«‚±‚݃Jƒ‰ƒ€ˆÊ’u +private: + void Scroll(void); + void DrawCursor(int sw); + void CursorOff(void); + void CursorOn(); + int DeleteTop(void); + void UpdateScroll(void); + int BackSpace(void); + +public: + CFifoEdit(); + ~CFifoEdit(); + + inline void SetBitmap(Graphics::TBitmap *p){ + pBitmap = p; + }; + void Clear(void); + void GetString(AnsiString &as); + + int GetLen(void); + char GetChar(void); + LPCSTR GetCurLine(void); + char GetLastChar(void); + + + void SetPaintBox(TPaintBox *tp, TScrollBar *sp); + void PutChar(char c); + void PutText(LPCSTR p); + void PaintCanvas(void); + void SetCursor(sw); + void ScrollBarChange(void); + void ScrollBarUp(int page); + void ScrollBarDown(int page); + int LineBackSpace(void); + int IsSAS(int sw); +}; + +///--------------------------------------------------------- +/// ƒRƒ“ƒgƒ[ƒ‹‚̃Aƒ‰ƒCƒ“‚ÌŠÇ—ƒNƒ‰ƒX +class CAlign +{ +public: + int BTop, BLeft; + int BWidth, BHeight; + int OTop, OLeft; + int OWidth, OHeight; + int OFontHeight; + double m_FontAdj; + + TControl *tp; + TFont *fp; +public: + inline CAlign(void){ + tp = NULL; + fp = NULL; + m_FontAdj = 1.0; + }; + inline ~CAlign(){ + }; + void InitControl(TControl *p, TControl *pB, TFont *pF = NULL); + void InitControl(TControl *p, RECT *rp, TFont *pF = NULL); + void NewAlign(TControl *pB); + inline double GetFontAdj(void){return fabs(m_FontAdj);}; + inline TControl *GetControl(void){return tp;}; + void NewAlign(TControl *pB, double hx); + void NewFont(AnsiString &FontName, BYTE Charset, TFontStyles fs); +}; + +///--------------------------------------------------------- +/// ƒRƒ“ƒgƒ[ƒ‹‚̃Aƒ‰ƒCƒ“‚ÌŠÇ—ƒNƒ‰ƒX +class CAlignList +{ +private: + int Max; + int Cnt; + CAlign **AlignList; + void Alloc(void); +public: + CAlignList(void); + ~CAlignList(); + void EntryControl(TControl *tp, TControl *pB, TFont *pF = NULL); + void EntryControl(TControl *tp, RECT *rp, TFont *pF = NULL); + void NewAlign(TControl *pB); + double GetFontAdj(TControl *pB); + void NewAlign(TControl *pB, TControl *pS, double hx); + void NewFont(AnsiString &FontName, BYTE Charset, TFontStyles fs); +}; + +class CAlignGrid +{ +private: + int BWidth; + int BHeight; + int BRowHeight; + + int Max; + int *bp; +public: + inline CAlignGrid(void){ + Max = 0; + bp = NULL; + }; + inline ~CAlignGrid(){ + if( bp != NULL ){ + delete bp; + } + }; + void InitGrid(TStringGrid *p); + void NewAlign(TStringGrid *p); +}; + +class CWebRef +{ +private: + AnsiString HTML; +public: + CWebRef(); + inline bool IsHTML(void){ + return !HTML.IsEmpty(); + }; + void ShowHTML(LPCSTR url); +}; + +class CWaitCursor +{ +private: + TCursor sv; +public: + CWaitCursor(); + ~CWaitCursor(); + void Delete(void); + void Wait(void); +}; + +///------------------------------------------------------- +/// CRecentMenuƒNƒ‰ƒX +#define RECMENUMAX 4 // ˆ—‚Å‚«‚éÅ‘å‚Ì” +class CRecentMenu +{ +private: +public: + int InsPos; // ƒƒjƒ…[‘}“üˆÊ’u‚̔Ԇ + int Max; // ˆ—‚·‚é” + AnsiString Caption[RECMENUMAX]; + TMenuItem *pMenu; + TMenuItem *Items[RECMENUMAX+1]; + +public: + CRecentMenu(); + void Init(int pos, TMenuItem *pmenu, int max); + void Init(TMenuItem *pi, TMenuItem *pmenu, int max); + int GetCount(void); + LPCSTR GetItemText(int n); + void SetItemText(int n, LPCSTR p); + int IsAdd(LPCSTR pNew); + void Add(LPCSTR pNew); + void ExtFilter(LPCSTR pExt); + void Clear(void); + void Insert(TObject *op, Classes::TNotifyEvent pEvent); + void Delete(void); + void Delete(LPCSTR pName); + int FindItem(TMenuItem *mp); + LPCSTR FindItemText(TMenuItem *mp); +}; + +void __fastcall ShowHtmlHelp(LPCSTR pContext = NULL); +//void ShowHelp(int index); +void InitSampType(void); +LPCSTR __fastcall ConvAndChar(LPSTR t, LPCSTR p); + +void GetUTC(SYSTEMTIME *tp); +void GetLocal(SYSTEMTIME *tp); +LPSTR StrDupe(LPCSTR s); + +void InitColorTable(TColor cl, TColor ch); +LPCSTR GetKeyName(WORD Key); +WORD GetKeyCode(LPCSTR pName); +LPCSTR ToDXKey(LPCSTR s); +LPCSTR ToJAKey(LPCSTR s); + +int SetTBValue(double d, double dmax, int imax); +double GetTBValue(int d, double dmax, int imax); +LPUSTR jstrupr(LPUSTR s); +inline LPSTR jstrupr(LPSTR s){return (LPSTR)jstrupr(LPUSTR(s));}; + +int IsFile(LPCSTR pName); +int SetTimeOffsetInfo(int &Hour, int &Min); +WORD AdjustRolTimeUTC(WORD tim, char c); +void __fastcall SetGroupEnabled(TGroupBox *gp); +void SetButtonCaption(TSpeedButton *tb, AnsiString &as, int maxlen, int fontsize, TColor col); +void FormCenter(TForm *tp, int XW, int YW); +char *lastp(char *p); +char *clipsp(char *s); +LPCSTR _strdmcpy(LPSTR t, LPCSTR p, char c); +const char *StrDlmCpy(char *t, const char *p, char Dlm, int len); +const char *StrDlmCpyK(char *t, const char *p, char Dlm, int len); +void StrCopy(LPSTR t, LPCSTR s, int n); +char LastC(LPCSTR p); +LPCSTR GetEXT(LPCSTR Fname); +void SetEXT(LPSTR pName, LPSTR pExt); +void SetCurDir(LPSTR t, int size); +void SetDirName(LPSTR t, LPCSTR pName); +LPCSTR StrDbl(double d); +LPCSTR StrDblE(double d); +double ReadDoubleIniFile(TMemIniFile *p, LPCSTR c1, LPCSTR c2, double d); +void WriteDoubleIniFile(TMemIniFile *p, LPCSTR c1, LPCSTR c2, double d); +void ClipLF(LPSTR sp); +LPSTR FillSpace(LPSTR s, int n); +LPSTR SkipSpace(LPSTR sp); +LPCSTR SkipSpace(LPCSTR sp); +LPSTR StrDlm(LPSTR &t, LPSTR p); +LPSTR StrDlm(LPSTR &t, LPSTR p, char c); +void ChgString(LPSTR t, char a, char b); +void DelChar(LPSTR t, char a); +int atoin(const char *p, int n); +int htoin(const char *p, int n); +void InfoMB(LPCSTR fmt, ...); +void ErrorMB(LPCSTR fmt, ...); +void WarningMB(LPCSTR fmt, ...); +int YesNoMB(LPCSTR fmt, ...); +int YesNoCancelMB(LPCSTR fmt, ...); +int OkCancelMB(LPCSTR fmt, ...); + +int RemoveL2(LPSTR t, LPSTR ss, LPCSTR pKey, int size); +void AddL2(LPSTR t, LPCSTR pKey, LPCSTR s, UCHAR c1, UCHAR c2, int size); + +void Yen2CrLf(AnsiString &ws, AnsiString cs); +void CrLf2Yen(AnsiString &ws, AnsiString cs); + +void EntryMsg(AnsiString ttl, AnsiString as, WORD Key); //JA7UDE 0428 +void SetComboBox(TComboBox *pCombo, LPCSTR pList); +void GetComboBox(AnsiString &as, TComboBox *pCombo); +void SetGridWidths(TStringGrid *pGrid, LPCSTR pList); +void GetGridWidths(AnsiString &as, TStringGrid *pGrid); + +int IsNumbs(LPCSTR p); +int IsAlphas(LPCSTR p); +int IsRST(LPCSTR p); +int IsCallChar(char c); +int IsCall(LPCSTR p); +int IsName(LPCSTR p); +int IsJA(const char *s); +LPCSTR ClipCall(LPCSTR s); +LPCSTR ClipCC(LPCSTR s); + +/* JA7UDE 0427 +inline LPUSTR StrDlm(LPUSTR &t, LPUSTR p, char c){return (LPUSTR)StrDlm(LPSTR(t), LPSTR(p), c);}; +inline LPUSTR StrDlm(LPUSTR &t, LPUSTR p){return (LPUSTR)StrDlm(LPSTR(t), LPSTR(p));}; +inline LPUSTR StrDlm(LPUSTR &t, LPSTR p, char c){return (LPUSTR)StrDlm(LPSTR(t), p, c);}; +inline LPUSTR StrDlm(LPUSTR &t, LPSTR p){return (LPUSTR)StrDlm(LPSTR(t), p);}; +*/ + +void TopWindow(TForm *tp); +void NormalWindow(TForm *tp); + +int FontStyle2Code(TFontStyles style); +TFontStyles Code2FontStyle(int code); + +void KeyEvent(const short *p); +#endif + diff --git a/Comm.cpp b/Comm.cpp new file mode 100644 index 0000000..4d14584 --- /dev/null +++ b/Comm.cpp @@ -0,0 +1,632 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "Comm.h" +#include "ComLib.h" + +#define WAITSTAT 0 + +#define DEFFSOUND 3 + +COMMPARA COMM; +void InitCOMMPara(void) +{ + COMM.change = 1; +} + +__fastcall CComm::CComm(bool CreateSuspended) + : TThread(CreateSuspended) +{ + m_CreateON = FALSE; // ƒNƒŠƒGƒCƒgƒtƒ‰ƒO + m_Command = 0; + m_fHnd = NULL; // ƒtƒ@ƒCƒ‹ƒnƒ“ƒhƒ‹ + m_inv = 0; + m_Execute = 0; + m_txwp = m_txrp = m_txcnt = 0; + m_TxEnb = 0; + + m_figout = 0; + m_idle = 0; + m_WaitTimerCount = 0; + m_nextcount = 0; + + pMod = NULL; + m_pEXT = NULL; +} + +void __fastcall CComm::WaitTXD(int w) +{ + if( w ){ +#if 0 + ULONG tim = ::GetTickCount(); + ULONG w = ((pMod->m_ReCount*(pMod->m_BitLen + 1.5) ) + (w * pMod->m_ReCount/3)) * 1000 / SampFreq; + tim += w; + if( w > 10 )::Sleep(w - 10); + while(tim >= ::GetTickCount()) ::Sleep(0); +#else + ::Sleep(((pMod->m_ReCount*(pMod->m_BitLen + 1.5) ) + (w * pMod->m_ReCount/3)) * 1000 / SampFreq); +#endif + } +} + +void __fastcall CComm::NextBuf(void) +{ + m_txrp++; + if( m_txrp >= COMM_TXBUFSIZE ){ + m_txrp = 0; + } + m_txcnt--; + FSKCount1++; + FSKCount--; +} + +void __fastcall CComm::EnbTX(int sw) +{ + m_TxEnb = 0; + if( !sw ){ + FSKCount1 = 1000; + FSKCount2 = 0; + } + else { + m_WaitTimerCount = 4; + m_FirstGaurd = TRUE; + FSKCount1 = 0; + FSKCount2 = 0; + FSKDeff = 0; + } + m_txwp = m_txrp = m_txcnt = 0; + FSKCount = 0; + m_figout = 0; + m_idle = 0; + m_TxEnb = sw; +} + +void __fastcall CComm::Timer(void) +{ + if( m_CreateON ){ + if( sys.m_TxPort ){ + if( m_fHnd == NULL ) return; + if( !m_TxEnb ) return; + if( m_DisDiddle != pMod->m_DisDiddle ){ + m_DisDiddle = pMod->m_DisDiddle; + } + } + } +} +//----------------------------------------------------------------- +// DTR‚Å•„†‘—M—p +void __fastcall CComm::OutData(BYTE d) +{ + const BYTE tbl[]={ + 0x00, 0x10, 0x08, 0x18, // 00000 10000 01000 11000 + 0x04, 0x14, 0x0c, 0x1c, // 00100 10100 01100 11100 + 0x02, 0x12, 0x0a, 0x1a, // 00010 10010 01010 11010 + 0x06, 0x16, 0x0e, 0x1e, // 00110 10110 01110 11110 + 0x01, 0x11, 0x09, 0x19, // 00001 10001 01001 11001 + 0x05, 0x15, 0x0d, 0x1d, // 00101 10101 01101 11101 + 0x03, 0x13, 0x0b, 0x1b, // 00011 10011 01011 11011 + 0x07, 0x17, 0x0f, 0x1f, // 00111 10111 01111 11111 + }; + if( m_CreateON == FALSE ) return; + + if( pMod->m_BitLen <= 6 ){ + d = tbl[d & 0x001f]; + } + + if( sys.m_TxdJob >= 2 ){ + if( m_nextcount ){ + while( m_nextcount >= ::GetTickCount() ){ + if( m_Command == COMM_CLOSE ) return; + ::Sleep(1); + } + } + m_nextcount = ::GetTickCount() + m_addcount; + } + if( m_pEXT != NULL ){ + m_pEXT->PutChar(d); + } + else { + TransmitCommChar(m_fHnd, d); + } +#if BITDEBUG + m_bitCountA = GetTickCount() - m_bitCount; + m_bitCount = GetTickCount(); +#endif +} +//--------------------------------------------------------------------------- +void __fastcall CComm::Execute() +{ + m_Execute = 1; + int BitLen = pMod->m_BitLen; + //---- ƒXƒŒƒbƒh‚̃R[ƒh‚ð‚±‚±‚É‹Lq ---- +// Priority = tpLower; + while(1){ +_try:; + if( Terminated == TRUE ){ + return; + } + if( m_Command == COMM_CLOSE ){ + m_Command = 0; + return; + } + if( m_CreateON == TRUE ){ + if( !m_TxEnb ){ + ::Sleep(10); + } + else if( !TxBusy() ){ + if( m_FirstGaurd ){ // ʼn‚̃K[ƒhŽžŠÔ‚ÌŠm•Û + m_FirstGaurd = 0; + ::Sleep(250); + if( m_DisDiddle == -1 ) m_DisDiddle = 0; + } + else if( m_txcnt && (FSKDeff <= DEFFSOUND) ){ // ‘—Mƒf[ƒ^‚ ‚è + m_DisDiddle = pMod->m_DisDiddle; + m_Data = m_txbuf[m_txrp]; + if( m_figout && (m_fig == 0x1b) && (m_Data != 0x1f) ){ + m_Data = 0x1b; + } + else { + switch(m_Data){ + case 0xff: // Mark + ::Sleep((pMod->m_ReCount * 3 * 1000) / SampFreq); + NextBuf(); + goto _try; + case 0xfe: // ƒLƒƒƒŠƒA’f‘± + NextBuf(); + goto _try; + case 0xfd: // disable diddle + m_DisDiddle = 0; + NextBuf(); + goto _try; + case 0xfc: // enable diddle + m_DisDiddle = 1; + NextBuf(); + goto _try; + case 0x1b: + case 0x1f: + m_fig = m_Data; + break; + } + NextBuf(); + } + m_figout = 0; + if( !pMod->m_CharWaitDiddle ){ + WaitTXD(pMod->m_CharWait); + } + m_WaitTimerCount = 4; + OutData(m_Data); + } + else if( (BitLen < 6) && ((FSKDeff > DEFFSOUND) || (pMod->m_diddle && !m_DisDiddle)) ){ + if( FSKDeff > DEFFSOUND ){ + WaitTXD(pMod->m_CharWait); + } + else if( (sys.m_LWait == 2) || !pMod->m_WaitTimer || m_WaitTimerCount ){ + if( !pMod->m_CharWaitDiddle ){ + if( sys.m_LWait == 2 ){ + WaitTXD(pMod->m_CharWait); + } + else if( pMod->m_DiddleWait ){ + WaitTXD(pMod->m_DiddleWait); + } + } + } + m_idle = 1; + switch(pMod->m_diddle){ + case 1: // BLK + if( pMod->m_RandomDiddle && !(rand() & 3) ){ + m_Data = 0x1f; + if( pMod->m_BitLen <= 6 ) m_figout = 1; + } + else { + m_Data = 0x00; + } + break; + default: // LTR + if( pMod->m_RandomDiddle && !(rand() & 3) ){ + m_Data = 0x00; + } + else { + m_Data = 0x1f; + if( pMod->m_BitLen <= 6 ) m_figout = 1; + } + break; + } + if( m_WaitTimerCount ) m_WaitTimerCount--; + OutData(m_Data); + } + else { + if( !m_idle ){ + ::Sleep((pMod->m_ReCount * pMod->m_BitLen)*1000/SampFreq); + } + m_idle = 1; + } + ::Sleep(10); + } + else { + ::Sleep(1); + } + } + else { + ::Sleep(10); + } + } +} +/*#$% +============================================================== + ’ÊM‰ñü‚ðƒNƒ[ƒY‚·‚é +-------------------------------------------------------------- +-------------------------------------------------------------- +-------------------------------------------------------------- +============================================================== +*/ +void __fastcall CComm::Close(void) +{ + if( m_CreateON == TRUE ){ + if( m_Execute ){ + m_TxEnb = 0; + m_Command = COMM_CLOSE; // ƒXƒŒƒbƒhI—¹ƒRƒ}ƒ“ƒh + Priority = tpNormal; //ƒXƒŒƒbƒh‚Í’Êí‚Ì—Dæ“x‚Å‚ ‚é +#if 0 + DWORD tim = GetTickCount(); + while( m_Command && (GetTickCount() < (tim + 3000)) ){ // ƒXƒŒƒbƒhI—¹‘Ò‚¿ + ::Sleep(1); + } +#else + WaitFor(); +#endif + FSKCount1+=1000; + } + if( m_pEXT != NULL ){ + delete m_pEXT; + m_pEXT = NULL; + } + else { + ::CloseHandle(m_fHnd); + } + m_CreateON = FALSE; + } +} +void __fastcall CComm::ReqClose(void) +{ + if( m_CreateON == TRUE ){ + if( m_Execute ){ + m_TxEnb = 0; + m_Command = COMM_CLOSE; // ƒXƒŒƒbƒhI—¹ƒRƒ}ƒ“ƒh + Priority = tpNormal; //ƒXƒŒƒbƒh‚Í’Êí‚Ì—Dæ“x‚Å‚ ‚é + FSKCount1+=1000; + } + } +} +void __fastcall CComm::WaitClose(void) +{ + if( m_CreateON == TRUE ){ + if( m_Execute && m_Command ){ +#if 0 + DWORD tim = GetTickCount(); + while( GetTickCount() < (tim + 3000) ){ // 1[s]‚̃EƒGƒCƒg + if( !m_Command ) break; + ::Sleep(1); + } +#else + WaitFor(); +#endif + } + if( m_pEXT != NULL ){ + delete m_pEXT; + m_pEXT = NULL; + } + else { + ::CloseHandle(m_fHnd); + } + m_CreateON = FALSE; + } +} +/*#$% +============================================================== + ’ÊM‰ñü‚ðƒI[ƒvƒ“‚·‚é +-------------------------------------------------------------- +PortName : ‰ñü‚Ì–¼‘O +pCP : COMMPARA‚̃|ƒCƒ“ƒ^iƒkƒ‹‚ÌŽž‚̓fƒtƒHƒ‹ƒg‚ʼnŠú‰»j +RBufSize : ŽóMƒoƒbƒtƒ@‚̃TƒCƒY(default=2048) +TBufSize : ‘—Mƒoƒbƒtƒ@‚̃TƒCƒY(default=2048) +-------------------------------------------------------------- +TRUE/FALSE +-------------------------------------------------------------- +============================================================== +*/ +BOOL __fastcall CComm::Open(LPCTSTR PortName, int inv, COMMPARA *cp) +{ + + if( m_CreateON == TRUE ) Close(); + m_Execute = 0; + m_fHnd = ::CreateFile( PortName, GENERIC_READ | GENERIC_WRITE, + 0, NULL, + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, + NULL + ); + if( m_fHnd == INVALID_HANDLE_VALUE ){ + m_pEXT = new CEXTFSK(PortName); + if( m_pEXT->IsLib() ){ + LONG para; + if( cp != NULL ){ + para = (cp->Baud << 16); + para |= cp->Stop; + para |= (cp->BitLen << 2); + } + else { + para = (45 << 16); + } + m_pEXT->Open(para); + m_CreateON = TRUE; + return TRUE; + } + else { + delete m_pEXT; + m_pEXT = NULL; + } + return FALSE; + } + m_inv = inv; + // setup device buffers + if( ::SetupComm( m_fHnd, DWORD(1024), DWORD(2) ) == FALSE ){ + ::CloseHandle(m_fHnd); + return FALSE; + } + + // purge any information in the buffer + ::PurgeComm( m_fHnd, PURGE_TXABORT | PURGE_RXABORT | PURGE_TXCLEAR | PURGE_RXCLEAR ); + + // set up for overlapped I/O + COMMTIMEOUTS TimeOut; + + TimeOut.ReadIntervalTimeout = 0xffffffff; + TimeOut.ReadTotalTimeoutMultiplier = 0; + TimeOut.ReadTotalTimeoutConstant = 0; + TimeOut.WriteTotalTimeoutMultiplier = 0; + TimeOut.WriteTotalTimeoutConstant = 20000; +// TimeOut.WriteTotalTimeoutConstant = 1; + if( !::SetCommTimeouts( m_fHnd, &TimeOut ) ){ + ::CloseHandle( m_fHnd ); + return FALSE; + } + ::GetCommState( m_fHnd, &m_dcb ); + m_dcb.BaudRate = (cp != NULL) ? cp->Baud : 9600; + m_dcb.fBinary = TRUE; + m_dcb.ByteSize = BYTE((cp != NULL) ? cp->BitLen : 8); + m_dcb.Parity = BYTE((cp != NULL) ? cp->Parity : NOPARITY); + m_dcb.StopBits = BYTE((cp != NULL ) ? cp->Stop : ONESTOPBIT); +// Application->MainForm->Caption = int(cp ? cp->Stop == TWOSTOPBITS : FALSE); + m_dcb.XonChar = 0x11; // XON + m_dcb.XoffChar = 0x13; // XOFF + m_dcb.fParity = 0; + m_dcb.fOutxCtsFlow = FALSE; + m_dcb.fInX = m_dcb.fOutX = FALSE; + m_dcb.fOutxDsrFlow = FALSE; + m_dcb.EvtChar = 0x0d; + + m_dcb.fRtsControl = m_inv ? RTS_CONTROL_ENABLE : RTS_CONTROL_DISABLE; // ‘—M‹ÖŽ~ + m_dcb.fDtrControl = m_inv ? DTR_CONTROL_ENABLE : DTR_CONTROL_DISABLE; // ‘—M‹ÖŽ~ + +// m_dcb.fTXContinueOnXoff = TRUE; + m_dcb.XonLim = USHORT(1024/4); // 1/4 of RBufSize + m_dcb.XoffLim = USHORT(1024*3/4); // 3/4 of RBufSize + m_dcb.DCBlength = sizeof( DCB ); + + if( m_dcb.StopBits != ONESTOPBIT ){ + m_addcount = DWORD((1000.0/double(m_dcb.BaudRate)) * double(m_dcb.ByteSize + 2.7)); + } + else { + m_addcount = DWORD((1000.0/double(m_dcb.BaudRate)) * double(m_dcb.ByteSize + 2.2)); + } +#if 0 // debug + m_dcb.BaudRate = 9600; + m_dcb.ByteSize = 8; +#endif + + if( !::SetCommState( m_fHnd, &m_dcb ) ){ + ::CloseHandle( m_fHnd ); + return FALSE; + } + + // get any early notifications + if( !::SetCommMask( m_fHnd, EV_RXFLAG ) ){ + ::CloseHandle(m_fHnd); + return FALSE; + } + m_CreateON = TRUE; + return TRUE; +} +//----------------------------------------------------------------- +// PTTØ‚è‘Ö‚¦—p +void __fastcall CComm::SetTXRX(int sw) +{ + if( m_CreateON == FALSE ) return; + + if( m_inv ) sw = sw ? 0 : 1; + if( m_pEXT != NULL ){ + m_pEXT->SetPTT(sw); + } + else if( sw ){ + ::EscapeCommFunction(m_fHnd, SETRTS); + ::EscapeCommFunction(m_fHnd, SETDTR); + } + else { + ::EscapeCommFunction(m_fHnd, CLRRTS); + ::EscapeCommFunction(m_fHnd, CLRDTR); + } +} +#if 0 +//----------------------------------------------------------------- +// DTR‚Å•„†‘—M—p +void __fastcall CComm::SetDTR(int sw) +{ + if( m_CreateON == FALSE ) return; + + if( sw ){ + ::EscapeCommFunction(m_fHnd, SETDTR); + } + else { + ::EscapeCommFunction(m_fHnd, CLRDTR); + } +} +#endif +//----------------------------------------------------------------- +// ‘—MƒrƒW[‚©‚Ç‚¤‚©’²‚ׂé TRUE : ‘—MƒrƒW[ó‘Ô +int __fastcall CComm::TxBusy(void) +{ + if( m_CreateON == FALSE ) return 0; + + if( m_pEXT != NULL ){ + return m_pEXT->IsTxBusy(); + } + else { + COMSTAT ComStat; + DWORD dwErrorFlags; + + ClearCommError( m_fHnd, &dwErrorFlags, &ComStat ); + return ComStat.fTxim; + } +} + +/*#$% +============================================================== + ’ÊM‰ñü‚Ƀf[ƒ^‚ð‘—M‚·‚é +-------------------------------------------------------------- +-------------------------------------------------------------- +-------------------------------------------------------------- +============================================================== +*/ +void __fastcall CComm::PutChar(BYTE c) +{ + if( (m_CreateON == TRUE) && m_Execute ){ + if( m_txcnt < COMM_TXBUFSIZE ){ + m_txbuf[m_txwp] = c; + m_txwp++; + if( m_txwp >= COMM_TXBUFSIZE ) m_txwp = 0; + m_txcnt++; + m_idle = 0; + FSKCount++; + } + } +} + +#if 0 +/*#$% +============================================================== + ŽóMƒoƒbƒtƒ@“à‚ÌŠi”[ƒf[ƒ^’·‚𓾂é +-------------------------------------------------------------- +-------------------------------------------------------------- + ƒf[ƒ^‚Ì’·‚³ +-------------------------------------------------------------- +============================================================== +*/ +DWORD CComm::RecvLen(void) +{ + if( m_pEXT != NULL ){ + return m_pEXT->IsEmpty(0) ? 0 : 1; + } + else { + COMSTAT ComStat; + DWORD dwErrorFlags; + + ::ClearCommError( m_fHnd, &dwErrorFlags, &ComStat ); + return ComStat.cbInQue; + } +} +#endif + +/******************************************************************* + EXTFSK.DLL +*******************************************************************/ +__fastcall CEXTFSK::CEXTFSK(LPCSTR pName) +{ + char Name[128]; + sprintf(Name, "%s.%s", pName, strcmpi(pName, "EXTFSK") ? "fsk" : "dll"); + fextfskOpen = NULL; + fextfskClose = NULL; + fextfskIsTxBusy = NULL; + fextfskPutChar = NULL; + fextfskSetPTT = NULL; + + m_hLib = ::LoadLibrary(Name); + if( m_hLib != NULL ){ + fextfskOpen = (extfskOpen)GetProc("_extfskOpen"); + fextfskClose = (extfskClose)GetProc("_extfskClose"); + fextfskIsTxBusy = (extfskIsTxBusy)GetProc("_extfskIsTxBusy"); + fextfskPutChar = (extfskPutChar)GetProc("_extfskPutChar"); + fextfskSetPTT = (extfskSetPTT)GetProc("_extfskSetPTT"); + } +} + +//--------------------------------------------------------------------- +__fastcall CEXTFSK::~CEXTFSK() +{ + if( m_hLib != NULL ){ + Close(); + ::FreeLibrary(m_hLib); + m_hLib = NULL; + } +} + +//--------------------------------------------------------------------- +FARPROC CEXTFSK::GetProc(LPCSTR pName) +{ + FARPROC fn = ::GetProcAddress(m_hLib, pName+1); + if( fn == NULL ){ + fn = ::GetProcAddress(m_hLib, pName); + } + return fn; +} + +long __fastcall CEXTFSK::Open(long para) +{ + if( !m_hLib || !fextfskOpen ) return FALSE; + return fextfskOpen(para); +} + +void __fastcall CEXTFSK::Close(void) +{ + if( !m_hLib || !fextfskClose ) return; + fextfskClose(); +} + +long __fastcall CEXTFSK::IsTxBusy(void) +{ + if( !m_hLib || !fextfskIsTxBusy ) return FALSE; + return fextfskIsTxBusy(); +} + +void __fastcall CEXTFSK::PutChar(BYTE c) +{ + if( !m_hLib || !fextfskPutChar ) return; + fextfskPutChar(c); +} + +void __fastcall CEXTFSK::SetPTT(long tx) +{ + if( !m_hLib || !fextfskSetPTT ) return; + fextfskSetPTT(tx); +} + + diff --git a/Comm.h b/Comm.h new file mode 100644 index 0000000..cd86dbf --- /dev/null +++ b/Comm.h @@ -0,0 +1,162 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +///---------------------------------------------------------- +/// ‚q‚r‚Q‚R‚Q‚b’ÊMƒNƒ‰ƒX +/// +/// (C) JE3HHT Makoto.Mori +/// +//--------------------------------------------------------------------------- +#ifndef CommH +#define CommH +#include "rtty.h" +//--------------------------------------------------------------------------- +#include +//--------------------------------------------------------------------------- +#define CR 0x0d +#define LF 0x0a +#define COMM_CLOSE 1 + +typedef struct { + int change; + + int Baud; + int BitLen; + int Stop; + int Parity; +}COMMPARA; +extern COMMPARA COMM; + +typedef long (__stdcall *extfskOpen)(long para); +typedef void (__stdcall *extfskClose)(void); +typedef long (__stdcall *extfskIsTxBusy)(void); +typedef void (__stdcall *extfskPutChar)(BYTE c); +typedef void (__stdcall *extfskSetPTT)(long tx); + +class CEXTFSK +{ +private: + //HANDLE m_hLib; + HINSTANCE m_hLib; //JA7UDE 0427 + extfskOpen fextfskOpen; + extfskClose fextfskClose; + extfskIsTxBusy fextfskIsTxBusy; + extfskPutChar fextfskPutChar; + extfskSetPTT fextfskSetPTT; +private: + FARPROC GetProc(LPCSTR pName); + +public: + __fastcall CEXTFSK(LPCSTR pName); + __fastcall ~CEXTFSK(); + long __fastcall IsLib(void){return m_hLib != NULL;}; + long __fastcall Open(long para); + void __fastcall Close(void); + long __fastcall IsTxBusy(void); + void __fastcall PutChar(BYTE c); + void __fastcall SetPTT(long tx); +}; + +#define COMM_TXBUFSIZE MODBUFMAX +class CComm : public TThread +{ +public: + BOOL m_CreateON; // ƒNƒŠƒGƒCƒgƒtƒ‰ƒO + volatile int m_Command; + int m_Execute; + DCB m_dcb; // ‚c‚b‚a + HANDLE m_fHnd; // ƒtƒ@ƒCƒ‹ƒnƒ“ƒhƒ‹ + int m_inv; + + int m_TxEnb; + char m_txbuf[COMM_TXBUFSIZE]; + int m_txcnt; + int m_txwp; + int m_txrp; + + int m_idle; + + BYTE m_Data; + BYTE m_fig; + int m_DisDiddle; + int m_FirstGaurd; + + int m_WaitTimerCount; + + int m_figout; + CFSKMOD *pMod; + + DWORD m_nextcount; + DWORD m_addcount; +#if BITDEBUG + int m_bitCount; + int m_bitCountA; +#endif + + CEXTFSK *m_pEXT; +protected: + void virtual __fastcall Execute(); +private: + void __fastcall NextBuf(void); + void __fastcall WaitTXD(int w); + void __fastcall OutData(BYTE d); +public: + __fastcall CComm(bool CreateSuspended); + __fastcall ~CComm(){ + Close(); + }; + inline BOOL __fastcall IsOpen(void){ + return m_CreateON; + }; + inline void __fastcall SetInv(int inv){m_inv = inv;}; + BOOL __fastcall Open(LPCTSTR PortName, int inv, COMMPARA *cp); + void __fastcall Close(void); + void __fastcall ReqClose(void); + void __fastcall WaitClose(void); + void __fastcall SetTXRX(int sw); +// void __fastcall SetDTR(int sw); + int __fastcall TxBusy(void); +// void Out(BYTE d); + void __fastcall PutChar(BYTE c); + void __fastcall EnbTX(int sw); + void __fastcall Timer(void); + inline __fastcall GetBufCount(void){ + return m_txcnt; + }; + void __fastcall DisDiddle(int sw){ + m_DisDiddle = sw; + }; + void __fastcall InitTxBuf(void){ + m_txwp = m_txrp = m_txcnt = 0; + FSKCount1 = 0; + FSKCount2 = 0; + FSKCount = 0; + FSKDeff = 0; + }; +// DWORD RecvLen(void); +}; + +void InitCOMMPara(void); +#endif + + + + + + diff --git a/ConvDef.cpp b/ConvDef.cpp new file mode 100644 index 0000000..179b4f0 --- /dev/null +++ b/ConvDef.cpp @@ -0,0 +1,393 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "ConvDef.h" +//--------------------------------------------------------------------- +#pragma resource "*.dfm" +//TConvDefDlg *ConvDefDlg; +//--------------------------------------------------------------------- +__fastcall TConvDefDlg::TConvDefDlg(TComponent* AOwner) + : TForm(AOwner) +{ + FormStyle = ((TForm *)AOwner)->FormStyle; + Font->Name = ((TForm *)AOwner)->Font->Name; + Font->Charset = ((TForm *)AOwner)->Font->Charset; + if( Font->Charset != SHIFTJIS_CHARSET ){ + Caption = "Define Conversion"; + ConvSel->Caption = "Delimiter Type"; + ConvSel->Items->Strings[0] = "comma(,)"; + ConvSel->Items->Strings[1] = "TAB"; + ConvSel->Items->Strings[2] = "NONE"; + LConv->Caption = "Conv."; + CheckDBL->Caption = "Double"; + GrpRef->Caption = "Ref."; + SBBack->Caption = "<"; + SBNext->Caption = ">"; + CancelBtn->Caption = "Cancel"; + InitBtn->Caption = "All Del"; + UpBtn->Caption = "Up"; + DownBtn->Caption = "Down"; + InitMax->Caption = "Init Max"; + } + + Grid->RowCount = TEXTCONVMAX + 1; + m_Mode = 0; + m_Bgn = m_End = m_Cur = 0; + m_DisEvent = 0; +} +//--------------------------------------------------------------------- +void __fastcall TConvDefDlg::UpdateUI(int n) +{ + SBBack->Enabled = m_Cur > m_Bgn ? TRUE : FALSE; + SBNext->Enabled = m_Cur < m_End ? TRUE : FALSE; + UpBtn->Enabled = (n > 0) ? TRUE : FALSE; + DownBtn->Enabled = (n < TEXTCONVMAX - 1) ? TRUE : FALSE; + CheckDBL->Enabled = m_Mode && (ConvSel->ItemIndex < 2); +} +//--------------------------------------------------------------------- +void __fastcall TConvDefDlg::GridDrawCell(TObject *Sender, int Col, int Row, + TRect &Rect, TGridDrawState State) +{ + char bf[1024]; + SDMMLOG sd; + + Grid->Canvas->FillRect(Rect); + int X = Rect.Left + 4; + int Y = Rect.Top + 2; + + if( Row ){ + Row--; + bf[0] = 0; + switch(Col){ + case 0: // Key + strcpy(bf, Conv[Row].Key.c_str()); + break; + case 1: // Size + if( !Conv[Row].Key.IsEmpty() && (Conv[Row].Key != "%EOD") ){ + sprintf(bf, "%u", Conv[Row].w); + } + break; + case 2: // Data + if( m_Mode ){ + if( !Conv[Row].Key.IsEmpty() && (Conv[Row].Key != "%EOD") ){ + Log.GetData(&sd, m_Cur); + MMLOG2Text(bf, &sd, Conv[Row].Key); + } + } + else { + strcpy(bf, m_line[Row].c_str()); + } + break; + } + Grid->Canvas->TextOut(X, Y, bf); + } + else if( Font->Charset != SHIFTJIS_CHARSET ){ + LPCSTR _tte[]={ + "Conv.","Max","Ref.", + }; + Grid->Canvas->TextOut(X, Y, _tte[Col]); + } + else { // ƒ^ƒCƒgƒ‹ + LPCSTR _tt[]={ + "•ÏŠ·Ž®","Max","ŽQÆ", + }; + Grid->Canvas->TextOut(X, Y, _tt[Col]); + } +} +//--------------------------------------------------------------------- +void __fastcall TConvDefDlg::SetupComBox(void) +{ + m_DisEvent++; + ConvText->Clear(); + int i; + for( i = 0; ConvTbl[i] != NULL; i++ ){ + ConvText->Items->Add(ConvTbl[i]); + } + m_DisEvent--; +} +//--------------------------------------------------------------------- +int __fastcall TConvDefDlg::Execute(TCONV *tp, int &delm, int &utc, int &dbl, int b, int e) +{ + m_DisEvent++; + int i; + for( i = 0; i < TEXTCONVMAX; i++ ){ + Conv[i].Key = tp[i].Key; + Conv[i].w = tp[i].w; + } + m_Mode = 1; + m_Cur = m_Bgn = b; + m_End = e; + CheckUTC->Checked = utc; + ConvSel->ItemIndex = delm; + CheckDBL->Checked = dbl; + SetupComBox(); + ConvText->Text = Conv[0].Key; + UpdateUI(Grid->Row - 1); + m_DisEvent--; + if( ShowModal() == IDOK ){ + for( i = 0; i < TEXTCONVMAX; i++ ){ + tp[i].Key = Conv[i].Key; + tp[i].w = Conv[i].w; + } + delm = ConvSel->ItemIndex; + utc = CheckUTC->Checked; + dbl = CheckDBL->Checked; + return TRUE; + } + else { + return FALSE; + } +} +//--------------------------------------------------------------------- +int __fastcall TConvDefDlg::Execute(TCONV *tp, int &delm, int &utc, int &dbl, LPCSTR pName) +{ + m_DisEvent++; + int i; + for( i = 0; i < TEXTCONVMAX; i++ ){ + Conv[i].Key = tp[i].Key; + Conv[i].w = tp[i].w; + } + m_Mode = 0; + CheckUTC->Checked = utc; + ConvSel->ItemIndex = delm; + CheckDBL->Checked = dbl; + SetupComBox(); + ConvText->Text = Conv[0].Key; + LoadText(pName); + UpdateUI(Grid->Row - 1); + UpdateLine(); + m_DisEvent--; + if( ShowModal() == IDOK ){ + for( i = 0; i < TEXTCONVMAX; i++ ){ + tp[i].Key = Conv[i].Key; + tp[i].w = Conv[i].w; + } + delm = ConvSel->ItemIndex; + utc = CheckUTC->Checked; + dbl = CheckDBL->Checked; + return TRUE; + } + else { + return FALSE; + } +} +//--------------------------------------------------------------------- +void __fastcall TConvDefDlg::LoadText(LPCSTR pName) +{ + FILE *fp; + char bf[2048]; + + m_Cur = m_Bgn = m_End = 0; + if( (fp = fopen(pName, "rt")) != NULL ){ + while(!feof(fp)){ + if( fgets(bf, sizeof(bf), fp) != NULL ){ + ClipLF(bf); + m_text[m_End] = bf; + m_End++; + if( m_End >= PREREADMAX ) break; + } + } + fclose(fp); + } + if( m_End ) m_End--; +} +//--------------------------------------------------------------------- +void __fastcall TConvDefDlg::UpdateLine(void) +{ + char rbf[2048]; + + StrCopy(rbf, m_text[m_Cur].c_str(), 2043); + + char bf[512]; + char dlm = ConvSel->ItemIndex ? TAB : ','; + LPSTR p, t; + + int i; + p = rbf; + for( i = 0; i < TEXTCONVMAX; i++ ){ + if( ConvSel->ItemIndex == 2 ){ + StrCopy(bf, p, Conv[i].w); + p += strlen(bf); + t = bf; + } + else { + p = StrDlm(t, p, dlm); + } + clipsp(t); + t = SkipSpace(t); + m_line[i] = t; + } +} +//--------------------------------------------------------------------------- +void __fastcall TConvDefDlg::ConvTextChange(TObject *Sender) +{ + if( m_DisEvent ) return; + + m_DisEvent++; + if( Grid->Row ){ + int Row = Grid->Row - 1; + Conv[Row].Key = ConvText->Text; + Grid->Invalidate(); + } + m_DisEvent--; +} +//--------------------------------------------------------------------------- +void __fastcall TConvDefDlg::GridSelectCell(TObject *Sender, int Col, int Row, + bool &CanSelect) +{ + if( m_DisEvent ) return; + + m_DisEvent++; + if( Row ){ + Row--; + ConvText->Text = Conv[Row].Key; + UpdateUI(Row); + } + m_DisEvent--; +} +//--------------------------------------------------------------------------- +void __fastcall TConvDefDlg::SBBackClick(TObject *Sender) +{ + if( m_Cur > m_Bgn ){ + m_Cur--; + UpdateUI(Grid->Row - 1); + if( !m_Mode ) UpdateLine(); + Grid->Invalidate(); + } +} +//--------------------------------------------------------------------------- +void __fastcall TConvDefDlg::SBNextClick(TObject *Sender) +{ + if( m_Cur < m_End ){ + m_Cur++; + UpdateUI(Grid->Row - 1); + if( !m_Mode ) UpdateLine(); + Grid->Invalidate(); + } +} +//--------------------------------------------------------------------------- +void __fastcall TConvDefDlg::GridGetEditText(TObject *Sender, int ACol, + int ARow, AnsiString &Value) +{ + char bf[512]; + + if( ARow ) ARow--; + bf[0] = 0; + switch(ACol){ + case 0: // Key + strcpy(bf, Conv[ARow].Key.c_str()); + break; + case 1: // Size + if( !Conv[ARow].Key.IsEmpty() && (Conv[ARow].Key != "%EOD") ){ + sprintf(bf, "%u", Conv[ARow].w); + } + break; + case 2: // Data + break; + } + Value = bf; +} +//--------------------------------------------------------------------------- +void __fastcall TConvDefDlg::GridSetEditText(TObject *Sender, int ACol, + int ARow, const AnsiString Value) +{ + int d; + + if( ARow ) ARow--; + switch(ACol){ + case 0: // Key + Conv[ARow].Key = Value; + Grid->Invalidate(); + break; + case 1: // Size + sscanf(Value.c_str(), "%u", &d); + if( (d >= 0) && (d<=256) ){ + Conv[ARow].w = d; + if( !m_Mode ){ + UpdateLine(); + Grid->Invalidate(); + } + } + break; + case 2: // Data + break; + } +} +//--------------------------------------------------------------------------- +void __fastcall TConvDefDlg::InitBtnClick(TObject *Sender) +{ + if( YesNoMB( ( Font->Charset != SHIFTJIS_CHARSET ) ? "Delete All setup. Are you sure?":"‚·‚ׂĂ̒è‹`‚ðÁ‹Ž‚µ‚Ü‚·‚©H" ) == IDYES ){ + for( int i = 0; i < TEXTCONVMAX; i++ ){ + Conv[i].Key = ""; + Conv[i].w = 0; + } + Grid->Invalidate(); + } +} +//--------------------------------------------------------------------------- +void __fastcall TConvDefDlg::UpBtnClick(TObject *Sender) +{ + int n = Grid->Row - 1; + if( n ){ + TCONV td = Conv[n]; + Conv[n] = Conv[n-1]; + Conv[n-1] = td; + Grid->Row--; + UpdateUI(Grid->Row - 1); + Grid->Invalidate(); + } +} +//--------------------------------------------------------------------------- +void __fastcall TConvDefDlg::DownBtnClick(TObject *Sender) +{ + int n = Grid->Row - 1; + + if( n < (TEXTCONVMAX - 1) ){ + TCONV td = Conv[n]; + Conv[n] = Conv[n+1]; + Conv[n+1] = td; + Grid->Row++; + UpdateUI(Grid->Row - 1); + Grid->Invalidate(); + } +} +//--------------------------------------------------------------------------- +void __fastcall TConvDefDlg::InitMaxClick(TObject *Sender) +{ + if( YesNoMB( ( Font->Charset != SHIFTJIS_CHARSET )?"Delete All Length. Are you sure?":"‚·‚ׂĂ̕¶Žš—ñ’·‚̧ŒÀ‚𖳂­‚µ‚Ü‚·‚©H" ) == IDYES ){ + for( int i = 0; i < TEXTCONVMAX; i++ ){ + Conv[i].w = 0; + } + Grid->Invalidate(); + } +} +//--------------------------------------------------------------------------- +void __fastcall TConvDefDlg::ConvSelClick(TObject *Sender) +{ + UpdateUI(Grid->Row-1); + if( !m_Mode ){ + UpdateLine(); + Grid->Invalidate(); + } +} +//--------------------------------------------------------------------------- diff --git a/ConvDef.dfm b/ConvDef.dfm new file mode 100644 index 0000000..8ebf9f5 Binary files /dev/null and b/ConvDef.dfm differ diff --git a/ConvDef.h b/ConvDef.h new file mode 100644 index 0000000..568f538 --- /dev/null +++ b/ConvDef.h @@ -0,0 +1,105 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//---------------------------------------------------------------------------- +#ifndef ConvDefH +#define ConvDefH +//---------------------------------------------------------------------------- +/* JA7UDE 0428 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +*/ +//---------------------------------------------------------------------------- +#include "LogConv.h" +//---------------------------------------------------------------------------- +#define PREREADMAX 100 +class TConvDefDlg : public TForm +{ +__published: + TButton *OKBtn; + TButton *CancelBtn; + TStringGrid *Grid; + TComboBox *ConvText; + TLabel *LConv; + TGroupBox *GrpRef; + TSpeedButton *SBBack; + TSpeedButton *SBNext; + TRadioGroup *ConvSel; + TButton *InitBtn; + TButton *UpBtn; + TButton *DownBtn; + TButton *InitMax; + TCheckBox *CheckUTC; + TCheckBox *CheckDBL; + void __fastcall GridDrawCell(TObject *Sender, int Col, int Row, TRect &Rect, + TGridDrawState State); + void __fastcall ConvTextChange(TObject *Sender); + void __fastcall GridSelectCell(TObject *Sender, int Col, int Row, + bool &CanSelect); + void __fastcall SBBackClick(TObject *Sender); + void __fastcall SBNextClick(TObject *Sender); + + + void __fastcall GridGetEditText(TObject *Sender, int ACol, int ARow, + AnsiString &Value); + void __fastcall GridSetEditText(TObject *Sender, int ACol, int ARow, + const AnsiString Value); + void __fastcall InitBtnClick(TObject *Sender); + void __fastcall UpBtnClick(TObject *Sender); + void __fastcall DownBtnClick(TObject *Sender); + void __fastcall InitMaxClick(TObject *Sender); + void __fastcall ConvSelClick(TObject *Sender); +private: + TCONV Conv[TEXTCONVMAX]; + + int m_Mode; + int m_DisEvent; + + int m_Bgn; + int m_End; + int m_Cur; + + void __fastcall UpdateUI(int n); + void __fastcall SetupComBox(void); + + AnsiString m_text[PREREADMAX]; + AnsiString m_line[TEXTCONVMAX]; + + void __fastcall LoadText(LPCSTR pName); + void __fastcall UpdateLine(void); + +public: + virtual __fastcall TConvDefDlg(TComponent* AOwner); + + int __fastcall Execute(TCONV *tp, int &delm, int &utc, int &dbl, int b, int e); + int __fastcall Execute(TCONV *tp, int &delm, int &utc, int &dbl, LPCSTR pName); +}; +//---------------------------------------------------------------------------- +//extern TConvDefDlg *ConvDefDlg; +//---------------------------------------------------------------------------- +#endif diff --git a/EditDlg.cpp b/EditDlg.cpp new file mode 100644 index 0000000..0c98cb5 --- /dev/null +++ b/EditDlg.cpp @@ -0,0 +1,428 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "EditDlg.h" +#include "MacroKey.h" +//--------------------------------------------------------------------- +#pragma resource "*.dfm" +//TEditDlgBox *EditDlgBox; +//--------------------------------------------------------------------- +__fastcall TEditDlgBox::TEditDlgBox(TComponent* AOwner) + : TForm(AOwner) +{ + FormStyle = ((TForm *)AOwner)->FormStyle; + Font->Name = ((TForm *)AOwner)->Font->Name; + Font->Charset = ((TForm *)AOwner)->Font->Charset; + Memo->Font->Name = sys.m_BtnFontName; + Memo->Font->Charset = sys.m_BtnFontCharset; + m_JobSel = 0; + m_DisEvent = 0; + m_CurIndex = -1; + m_MacroSet = 0; + + ShortCutName->Clear(); + int i; + ShortCutName->Items->Add("NULL"); + for( i = 0; KEYTBL[i].Key; i++ ){ + ShortCutName->Items->Add(ToDXKey(KEYTBL[i].pName)); + } + if( Font->Charset != SHIFTJIS_CHARSET ){ + Caption = "Assign Macro"; + CancelBtn->Caption = "Cancel"; + LShort->Caption = "ShortCut"; + LEntryName->Caption = "Name"; + DelBtn->Caption = "Del"; + NewNameBtn->Caption = "New Name"; + TxBtn->Caption = "TX(F9)"; + } +// SBHelp->Visible = !JanHelp.IsEmpty(); + SBHelp->Visible = FALSE; + TxBtn->Enabled = !(sys.m_DisTX&1); +} +//--------------------------------------------------------------------- +int __fastcall TEditDlgBox::Execute(AnsiString &as, WORD &nKey, TColor *pcol, int *Intval, int set) +{ + m_MacroSet = set; + m_DisEvent++; + if( ButtonName->Text.IsEmpty() ){ + ButtonName->Visible = FALSE; + LEntryName->Visible = FALSE; + } + else { + ButtonName->Visible = TRUE; + } + EntryName->Visible = FALSE; + DelBtn->Visible = FALSE; + NewNameBtn->Visible = FALSE; + Memo->Text = as; + if( pcol != NULL ){ + PanelCol->Visible = TRUE; + LCol->Visible = TRUE; + PanelCol->Color = *pcol; + } + if( Intval != NULL ){ + LMInt->Visible = TRUE; + EMInt->Visible = TRUE; + UDInt->Visible = TRUE; + LMUN->Visible = TRUE; + UDInt->Position = SHORT(*Intval); + } + ShortCutName->Text = GetKeyName(nKey); + if( ShowModal() == IDOK ){ + as = Memo->Text; + nKey = GetKeyCode(AnsiString(ShortCutName->Text).c_str()); //JA7UDE 0428 + if( pcol != NULL ){ + *pcol = PanelCol->Color; + } + if( Intval != NULL ){ + *Intval = UDInt->Position; + } + return TRUE; + } + else { + return FALSE; + } +} +//--------------------------------------------------------------------- +void __fastcall TEditDlgBox::UpdateUI(void) +{ + if( EntryName->Visible != FALSE ){ + NewNameBtn->Enabled = (m_CurIndex >= 0) ? TRUE : FALSE; + DelBtn->Enabled = (m_CurIndex >= 0) ? TRUE : FALSE; + OKBtn->Enabled = ((!EntryName->Text.IsEmpty()) && (!Memo->Text.IsEmpty()) && Memo->Modified) ? TRUE : FALSE; + } +} +//--------------------------------------------------------------------- +int __fastcall TEditDlgBox::EditMsg(void) +{ + Caption = (Font->Charset != SHIFTJIS_CHARSET) ? "Edit Message":"’èŒ^ƒƒbƒZ[ƒW‚Ì•ÒW"; + + ButtonName->Visible = FALSE; + EntryName->Visible = TRUE; + DelBtn->Visible = TRUE; + NewNameBtn->Visible = TRUE; + + if(Font->Charset != SHIFTJIS_CHARSET){ + CancelBtn->Caption = "Close"; + OKBtn->Caption = "Assign"; + } + else { + CancelBtn->Caption = "•‚¶‚é"; + OKBtn->Caption = "“o˜^"; + } + + UpdateList(); +// EntryName->SetFocus(); + Memo->Clear(); + if( !sys.m_MsgName[0].IsEmpty() ){ + Memo->Text = sys.m_MsgList[0]; + m_CurIndex = 0; + } + UpdateUI(); + m_MacroSet = 0; + if( ShowModal() == IDOK ){ + return TRUE; + } + else { + return FALSE; + } +} +//--------------------------------------------------------------------------- +void __fastcall TEditDlgBox::UpdateList(void) +{ + m_DisEvent++; + EntryName->Clear(); + int i; + for( i = 0; i < MSGLISTMAX; i++ ){ + if( sys.m_MsgName[i].IsEmpty() ) break; + EntryName->Items->Add(sys.m_MsgName[i]); + } + if( !sys.m_MsgName[0].IsEmpty() ){ + EntryName->Text = sys.m_MsgName[0]; + } + ShortCutName->Text = GetKeyName(sys.m_MsgKey[0]); + m_DisEvent--; +} + +void __fastcall TEditDlgBox::EntryNameChange(TObject *Sender) +{ + if( m_DisEvent ) return; + + m_DisEvent++; + AnsiString ttl = EntryName->Text; + AnsiString as; + m_CurIndex = -1; + ShortCutName->Text = "NULL"; + int i; + for( i = 0; i < MSGLISTMAX; i++ ){ + if( sys.m_MsgName[i].IsEmpty() ) break; + if( sys.m_MsgName[i] == ttl ){ + as = sys.m_MsgList[i]; + Memo->Clear(); + Memo->Text = as; + m_CurIndex = i; + ShortCutName->Text = GetKeyName(sys.m_MsgKey[i]); + break; + } + } + if( (m_CurIndex == -1) && (!EntryName->Text.IsEmpty()) && (!Memo->Text.IsEmpty()) ) Memo->Modified = TRUE; + UpdateUI(); + m_DisEvent--; +} +//--------------------------------------------------------------------------- +void __fastcall TEditDlgBox::NewNameBtnClick(TObject *Sender) +{ + //AnsiString ttl = EntryName->Text; //JA7UDE 0428 + UnicodeString ttl = EntryName->Text; //JA7UDE 0428 + if( InputQuery("MMTTY", (Font->Charset != SHIFTJIS_CHARSET) ? "Input Name":"“o˜^–¼iƒƒbƒZ[ƒW‚̕ʖ¼j‚ð“ü—Í", ttl) == TRUE ){ + if( ttl.IsEmpty() ){ + ttl = "–³‘è"; + } + sys.m_MsgName[m_CurIndex] = ttl; + EntryName->Text = ttl; + } + UpdateUI(); +} +//--------------------------------------------------------------------------- +void __fastcall TEditDlgBox::DelBtnClick(TObject *Sender) +{ + if( YesNoMB((Font->Charset != SHIFTJIS_CHARSET)?"Delete [%s]. Are you sure?":"[%s]‚ðƒŠƒXƒg‚©‚ç휂µ‚Ü‚·.\r\n\r\n‚æ‚낵‚¨‚Ü‚Á‚©H", EntryName->Text.c_str()) == IDYES ){ + int i; + for( i = m_CurIndex; i < (MSGLISTMAX - 1); i++ ){ + if( sys.m_MsgName[i].IsEmpty() ) break; + sys.m_MsgList[i] = sys.m_MsgList[i+1]; + sys.m_MsgName[i] = sys.m_MsgName[i+1]; + sys.m_MsgKey[i] = sys.m_MsgKey[i+1]; + } + sys.m_MsgName[i] = ""; + sys.m_MsgList[i] = ""; + sys.m_MsgKey[i] = 0; + if( m_CurIndex ) m_CurIndex--; + if( m_CurIndex >= 0 ){ + EntryName->Text = sys.m_MsgName[m_CurIndex]; + Memo->Text = sys.m_MsgList[m_CurIndex]; + ShortCutName->Text = GetKeyName(sys.m_MsgKey[m_CurIndex]); + } + else { + EntryName->Text = ""; + Memo->Clear(); + ShortCutName->Text = ""; + } + UpdateList(); + } +} +//--------------------------------------------------------------------------- +void __fastcall TEditDlgBox::MemoChange(TObject *Sender) +{ + if( m_DisEvent ) return; + + UpdateUI(); +} +//--------------------------------------------------------------------------- +void __fastcall TEditDlgBox::OKBtnClick(TObject *Sender) +{ + if( EntryName->Visible == FALSE ){ + ModalResult = mrOk; + return; + } + if( EntryName->Text.IsEmpty() ) return; + if( Memo->Text.IsEmpty() ) return; + if( YesNoMB((Font->Charset != SHIFTJIS_CHARSET)?"Assign text to [%s]. Are you sure?":"[%s]‚ÉŒ»Ý‚̃eƒLƒXƒg‚ð’è‹`‚µ‚Ü‚·.\r\n\r\n‚æ‚낵‚¨‚Ü‚Á‚©H", EntryName->Text.c_str()) == IDYES ){ + EntryMsg(AnsiString(EntryName->Text), AnsiString(Memo->Text), GetKeyCode(AnsiString(ShortCutName->Text).c_str())); //JA7UDE 0428 + Memo->Modified = FALSE; + } + UpdateUI(); +} +//--------------------------------------------------------------------------- +void __fastcall TEditDlgBox::ShortCutNameChange(TObject *Sender) +{ + if( m_DisEvent ) return; + + Memo->Modified = TRUE; + UpdateUI(); +} +//--------------------------------------------------------------------------- +void __fastcall TEditDlgBox::TxBtnClick(TObject *Sender) +{ + if( Memo->Text.IsEmpty() ) return; + if( sys.m_DisTX&1 ) return; + + m_JobSel = 1; + ModalResult = mrOk; +} +//--------------------------------------------------------------------------- +void __fastcall TEditDlgBox::FormKeyDown(TObject *Sender, WORD &Key, + TShiftState Shift) +{ + switch(Key){ + case VK_F9: + Key = 0; + TxBtnClick(NULL); + break; + case VK_ESCAPE: + Key = 0; + ModalResult = mrCancel; + break; + } +} +//--------------------------------------------------------------------------- +void __fastcall TEditDlgBox::FormKeyUp(TObject *Sender, WORD &Key, + TShiftState Shift) +{ + switch(Key){ + case VK_F9: + Key = 0; + break; + case VK_ESCAPE: + break; + } +} +//--------------------------------------------------------------------------- +void __fastcall TEditDlgBox::ClearBtnClick(TObject *Sender) +{ + if( YesNoMB((Font->Charset != SHIFTJIS_CHARSET)?"Clear text and shortcut. Are you sure?":"ƒeƒLƒXƒg‚ƃVƒ‡[ƒgƒJƒbƒg‚ð‰Šú‰»‚µ‚Ü‚·.\r\n\r\n‚æ‚낵‚¨‚Ü‚Á‚©H") == IDYES ){ + Memo->Text = ""; + ShortCutName->Text = "NULL"; + UDInt->Position = 0; + } +} +//--------------------------------------------------------------------------- +void __fastcall TEditDlgBox::PanelColClick(TObject *Sender) +{ + ColorDialog->Color = PanelCol->Color; + NormalWindow(this); + if( ColorDialog->Execute() == TRUE ){ + PanelCol->Color = ColorDialog->Color; + } + TopWindow(this); +} +//--------------------------------------------------------------------------- +int __fastcall TEditDlgBox::CheckLast(LPCSTR s, char c) +{ + LPCSTR p = s + strlen(s) - 1; + for( ; p >= s; p-- ){ + if( *p == c ) return 1; + if( isalpha(*p) || (*p == '%') ) return 0; + } + return 0; +} +//--------------------------------------------------------------------------- +int __fastcall TEditDlgBox::CheckTop(LPCSTR s, char c) +{ + LPCSTR p = s; + for( ; *p; p++ ){ + if( *p == c ) return 1; + if( isalpha(*p) || (*p == '%') ) return 0; + } + return 0; +} +//--------------------------------------------------------------------------- +void __fastcall TEditDlgBox::DeleteSpace(void) +{ + AnsiString ws = Memo->Text.c_str(); + LPSTR p = ws.c_str(); + AnsiString as; + LPSTR bp = new char[strlen(p)+1]; + + LPSTR t = bp; + for( ; *p; p++ ){ + if( *p != CR ){ + if( *p == LF ){ + *t = 0; + clipsp(bp); + if( *bp ) as += bp; + as += "\r\n"; + t = bp; + } + else { + *t++ = *p; + } + } + } + *t = 0; + if( *bp ){ + clipsp(bp); + if( *bp ) as += bp; + } + p = as.c_str(); + t = lastp(p); + if( (*t == LF)||(*t == CR) ){ + for( ; t >= p; t-- ){ + if( (*t == LF)||(*t == CR) ){ + *t = 0; + } + else { + break; + } + } + t++; + *t++ = CR; + *t = LF; + } + Memo->Text = p; + Memo->Modified = TRUE; + delete bp; +} +//--------------------------------------------------------------------------- +void __fastcall TEditDlgBox::ComBtnClick(TObject *Sender) +{ + TMacroKeyDlg *pBox = new TMacroKeyDlg(this); + AnsiString as, bs; + LPCSTR p; + int r = pBox->Execute(as, m_MacroSet); + switch(r){ + case 1: + Memo->SetFocus(); + for( p = as.c_str(); *p; p++ ){ + ::PostMessage(Memo->Handle, WM_CHAR, *p, 0); + } + break; + case 2: // ÅŒã‚ɒljÁ + bs = Memo->Text; + if( !CheckLast(bs.c_str(), *as.c_str()) ){ + bs += as.c_str(); + Memo->Text = bs; + Memo->Modified = TRUE; + } + break; + case 3: // 擪‚ɒljÁ + if( !CheckTop(AnsiString(Memo->Text).c_str(), *as.c_str()) ){ //JA7UDE 0428 + as += Memo->Text.c_str(); + Memo->Text = as.c_str(); + Memo->Modified = TRUE; + } + break; + case -1: // s––‚̃Xƒy[ƒX‚ðíœ + DeleteSpace(); + break; + } + delete pBox; + UpdateUI(); + Memo->SetFocus(); +} +//--------------------------------------------------------------------------- +void __fastcall TEditDlgBox::SBHelpClick(TObject *Sender) +{ + ShowHtmlHelp(); +} +//--------------------------------------------------------------------------- diff --git a/EditDlg.dfm b/EditDlg.dfm new file mode 100644 index 0000000..5a1ae4e Binary files /dev/null and b/EditDlg.dfm differ diff --git a/EditDlg.h b/EditDlg.h new file mode 100644 index 0000000..edb0698 --- /dev/null +++ b/EditDlg.h @@ -0,0 +1,102 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//---------------------------------------------------------------------------- +#ifndef EditDlgH +#define EditDlgH +//---------------------------------------------------------------------------- +//JA7UDE 0427 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ComLib.h" +#include +#include +//---------------------------------------------------------------------------- +class TEditDlgBox : public TForm +{ +__published: + TButton *OKBtn; + TButton *CancelBtn; + TMemo *Memo; + TLabel *LEntryName; + TComboBox *EntryName; + TButton *DelBtn; + TButton *NewNameBtn; + TEdit *ButtonName; + TLabel *LShort; + TComboBox *ShortCutName; + TButton *TxBtn; + TButton *ClearBtn; + TPanel *PanelCol; + TColorDialog *ColorDialog; + TLabel *LCol; + TLabel *LMInt; + TUpDown *UDInt; + TLabel *LMUN; + TComboBox *EMInt; + TButton *ComBtn; + TSpeedButton *SBHelp; + void __fastcall EntryNameChange(TObject *Sender); + void __fastcall NewNameBtnClick(TObject *Sender); + void __fastcall DelBtnClick(TObject *Sender); + void __fastcall MemoChange(TObject *Sender); + void __fastcall OKBtnClick(TObject *Sender); + + + void __fastcall ShortCutNameChange(TObject *Sender); + void __fastcall TxBtnClick(TObject *Sender); + + void __fastcall FormKeyDown(TObject *Sender, WORD &Key, TShiftState Shift); + void __fastcall FormKeyUp(TObject *Sender, WORD &Key, TShiftState Shift); + void __fastcall ClearBtnClick(TObject *Sender); + void __fastcall PanelColClick(TObject *Sender); + void __fastcall ComBtnClick(TObject *Sender); + void __fastcall SBHelpClick(TObject *Sender); +private: + int m_DisEvent; + int m_CurIndex; + int m_MacroSet; + + void __fastcall UpdateList(void); + void __fastcall UpdateUI(void); + + int __fastcall CheckLast(LPCSTR s, char c); + int __fastcall CheckTop(LPCSTR s, char c); + void __fastcall DeleteSpace(void); + +public: + virtual __fastcall TEditDlgBox(TComponent* AOwner); + int __fastcall Execute(AnsiString &as, WORD &nKey, TColor *pcol, int *Intval, int set); + int __fastcall EditMsg(void); + + int m_JobSel; +}; +//---------------------------------------------------------------------------- +//extern TEditDlgBox *EditDlgBox; +//---------------------------------------------------------------------------- +#endif diff --git a/Fft.cpp b/Fft.cpp new file mode 100644 index 0000000..e84e73c --- /dev/null +++ b/Fft.cpp @@ -0,0 +1,712 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +#include +#pragma hdrstop + +#include +#include "fft.h" +#include "ComLib.h" + +#define PI 3.1415926535897932384626433832795 +#define PI2 (2*PI) + +#define SCALEADJ_1 (-5.5) +#define SCALEADJ_2 (-6.5) +#define SCALEADJ_3 (-7.8) +#define SCALEADJ_4 (-9.0) +#define LOGADJ (2.81458e4) + +#define SCALEPOW_1 (1.0/4.0) +#define SCALEPOW_ADJ_1 0.0018 +#define SCALEPOW_2 (1.0/5.0) +#define SCALEPOW_ADJ_2 0.008 +#define SCALEPOW_3 (1.0/6.0) +#define SCALEPOW_ADJ_3 0.022 +#define SCALEPOW_4 (1.0/7.0) +#define SCALEPOW_ADJ_4 0.048 +//------------------------------------------------- +// ‚e‚e‚sˆ—ƒNƒ‰ƒX +CFFT::CFFT() +{ + m_FFTDIS = 0; + memset(m_fft, 0, sizeof(m_fft)); + m_CollectFFTBuf = new double[FFT_BUFSIZE]; + memset(m_CollectFFTBuf, 0, sizeof(double)*FFT_BUFSIZE); + m_CollectFFT = 0; + m_CollectFFTCount = 0; + m_tWindow = new double[FFT_BUFSIZE]; + //m_tSinCos = new double[FFT_BUFSIZE/2]; + m_tSinCos = new double[FFT_BUFSIZE/2+8]; //JA7UDE 0428 + m_Work = new int[SQRT_FFT_SIZE+2]; + memset(m_Work, 0, sizeof(int[SQRT_FFT_SIZE+2])); + pStgBuf = new double[FFT_BUFSIZE]; + m_Work[0] = 0; + makewt(FFT_SIZE/4, m_Work, m_tSinCos); + makect(FFT_SIZE/4, m_Work, m_tSinCos + m_Work[0]); + for(int i = 0; i < FFT_SIZE; i++){ + pStgBuf[i] = 1.0; + m_tWindow[i] = (0.5 - 0.5*cos( (PI2*i)/(FFT_SIZE-1) )); //ƒnƒjƒ“ƒO‘‹ + } + m_StgSize = 1; + m_StgScale = 1.0; + m_StgK = 0.0; + m_StgSW = FALSE; + m_CollectFlag = 0; +} + +//------------------------------------------------- +// ‚e‚e‚sˆ—ƒNƒ‰ƒX‚ÌĉŠú‰» +void CFFT::InitFFT(void) +{ + m_CollectFFT = 0; + m_CollectFFTCount = 0; + memset(m_CollectFFTBuf, 0, sizeof(double)*FFT_SIZE); + m_CollectFFT = 0; + m_CollectFFTCount = 0; + memset(m_Work, 0, sizeof(int[SQRT_FFT_SIZE+2])); + makewt(FFT_SIZE/4, m_Work, m_tSinCos); + makect(FFT_SIZE/4, m_Work, m_tSinCos + m_Work[0]); + for(int i = 0; i < FFT_SIZE; i++){ + pStgBuf[i] = 1.0; + m_tWindow[i] = (0.5 - 0.5*cos( (PI2*i)/(FFT_SIZE-1) )); //ƒnƒjƒ“ƒO‘‹ + } + m_StgSize = 1; + m_StgScale = 1.0; + m_StgK = 0.0; + m_StgSW = FALSE; + m_CollectFlag = 0; +} + +//------------------------------------------------- +CFFT::~CFFT() +{ + if( m_CollectFFTBuf ){ + delete[] m_CollectFFTBuf; + m_CollectFFTBuf = NULL; + } + if(pStgBuf){ + delete[] pStgBuf; + pStgBuf = NULL; + } + if(m_Work){ + delete[] m_Work; + m_Work = NULL; + } + if(m_tSinCos){ + delete[] m_tSinCos; + m_tSinCos = NULL; + } + if(m_tWindow){ + delete[] m_tWindow; + m_tWindow = NULL; + } +} + +//------------------------------------------------- +// ƒf[ƒ^ŽûWiƒXƒŒƒbƒhŠO‚ÅŽÀs‚·‚éj +void CFFT::TrigFFT(void) +{ + m_CollectFFTCount = 0; + m_CollectFFT = 0; // ŽŸ‚ÌŽûW‚ðƒgƒŠƒK +} +//------------------------------------------------- +// ƒf[ƒ^ŽûWiƒXƒŒƒbƒh“à‚ÅŽÀs‚·‚éj +void CFFT::CollectFFT(double *lp, int size) +{ + if( !m_CollectFFT ){ + if( (size + m_CollectFFTCount) > FFT_SIZE ){ + size = FFT_SIZE - m_CollectFFTCount; + } + memcpy(&m_CollectFFTBuf[m_CollectFFTCount], lp, sizeof(double)*size); + m_CollectFFTCount += size; + if( m_CollectFFTCount >= FFT_SIZE ){ + m_CollectFFTCount = 0; + m_CollectFFT = 1; + } + } +} +//------------------------------------------------- +// ƒf[ƒ^ŽûWiƒXƒŒƒbƒhŠO‚ÅŽÀs‚·‚éj +void CFFT::CalcFFT(int size, double gain, int stg) +{ + Calc(m_CollectFFTBuf, size, gain, stg, m_fft); +} + +void CFFT::makewt(int nw, int *ip, double *w) +{ + int nwh, j; + double delta, x, y; + + ip[0] = nw; + ip[1] = 1; + if(nw > 2){ + nwh = nw >> 1; + delta = atan(1.0) / nwh; + w[0] = 1; + w[1] = 0; + w[nwh] = cos(delta * nwh); + w[nwh + 1] = w[nwh]; + for(j = 2; j < nwh; j += 2){ + x = cos(delta * j); + y = sin(delta * j); + w[j] = x; + w[j + 1] = y; + w[nw - j] = y; + w[nw - j + 1] = x; + } + bitrv2(nw, ip + 2, w); + } +} +//------------------------------------------------- +// ƒf[ƒ^‚̈—‰» +void CFFT::makect(int nc, int *ip, double *c) +{ + int nch, j; + double delta; + + ip[1] = nc; + if(nc > 1){ + nch = nc >> 1; + delta = atan(1.0) / nch; + c[0] = cos(delta * nch); + c[nch] = 0.5 * c[0]; + for(j = 1; j < nch; j++){ + c[j] = 0.5 * cos(delta * j); + c[nc - j] = 0.5 * sin(delta * j); + } + } +} +//------------------------------------------------- +// ƒf[ƒ^‚̈—‰» +void CFFT::bitrv2(int n, int *ip, double *a) +{ + int j, j1, k, k1, l, m, m2; + double xr, xi; + + ip[0] = 0; + l = n; + m = 1; + while((m << 2) < l){ + l >>= 1; + for (j = 0; j < m; j++) { + ip[m + j] = ip[j] + l; + } + m <<= 1; + } + if((m << 2) > l){ + for (k = 1; k < m; k++) { + for (j = 0; j < k; j++) { + j1 = (j << 1) + ip[k]; + k1 = (k << 1) + ip[j]; + xr = a[j1]; + xi = a[j1 + 1]; + a[j1] = a[k1]; + a[j1 + 1] = a[k1 + 1]; + a[k1] = xr; + a[k1 + 1] = xi; + } + } + } else { + m2 = m << 1; + for(k = 1; k < m; k++){ + for(j = 0; j < k; j++){ + j1 = (j << 1) + ip[k]; + k1 = (k << 1) + ip[j]; + xr = a[j1]; + xi = a[j1 + 1]; + a[j1] = a[k1]; + a[j1 + 1] = a[k1 + 1]; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += m2; + k1 += m2; + xr = a[j1]; + xi = a[j1 + 1]; + a[j1] = a[k1]; + a[j1 + 1] = a[k1 + 1]; + a[k1] = xr; + a[k1 + 1] = xi; + } + } + } +} +//------------------------------------------------- +void CFFT::cftfsub(int n, double *a, double *w) +{ + int j, j1, j2, j3, l; + double x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i; + + l = 2; + if(n > 8){ + cft1st(n, a, w); + l = 8; + while((l << 2) < n){ + cftmdl(n, l, a, w); + l <<= 2; + } + } + if((l << 2) == n){ + for(j = 0; j < l; j += 2){ + j1 = j + l; + j2 = j1 + l; + j3 = j2 + l; + x0r = a[j] + a[j1]; + x0i = a[j + 1] + a[j1 + 1]; + x1r = a[j] - a[j1]; + x1i = a[j + 1] - a[j1 + 1]; + x2r = a[j2] + a[j3]; + x2i = a[j2 + 1] + a[j3 + 1]; + x3r = a[j2] - a[j3]; + x3i = a[j2 + 1] - a[j3 + 1]; + a[j] = x0r + x2r; + a[j + 1] = x0i + x2i; + a[j2] = x0r - x2r; + a[j2 + 1] = x0i - x2i; + a[j1] = x1r - x3i; + a[j1 + 1] = x1i + x3r; + a[j3] = x1r + x3i; + a[j3 + 1] = x1i - x3r; + } + } else { + for(j = 0; j < l; j += 2){ + j1 = j + l; + x0r = a[j] - a[j1]; + x0i = a[j + 1] - a[j1 + 1]; + a[j] += a[j1]; + a[j + 1] += a[j1 + 1]; + a[j1] = x0r; + a[j1 + 1] = x0i; + } + } +} +//------------------------------------------------- +void CFFT::cft1st(int n, double *a, double *w) +{ + int j, k1, k2; + double wk1r, wk1i, wk2r, wk2i, wk3r, wk3i; + double x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i; + + x0r = a[0] + a[2]; + x0i = a[1] + a[3]; + x1r = a[0] - a[2]; + x1i = a[1] - a[3]; + x2r = a[4] + a[6]; + x2i = a[5] + a[7]; + x3r = a[4] - a[6]; + x3i = a[5] - a[7]; + a[0] = x0r + x2r; + a[1] = x0i + x2i; + a[4] = x0r - x2r; + a[5] = x0i - x2i; + a[2] = x1r - x3i; + a[3] = x1i + x3r; + a[6] = x1r + x3i; + a[7] = x1i - x3r; + wk1r = w[2]; + x0r = a[8] + a[10]; + x0i = a[9] + a[11]; + x1r = a[8] - a[10]; + x1i = a[9] - a[11]; + x2r = a[12] + a[14]; + x2i = a[13] + a[15]; + x3r = a[12] - a[14]; + x3i = a[13] - a[15]; + a[8] = x0r + x2r; + a[9] = x0i + x2i; + a[12] = x2i - x0i; + a[13] = x0r - x2r; + x0r = x1r - x3i; + x0i = x1i + x3r; + a[10] = wk1r * (x0r - x0i); + a[11] = wk1r * (x0r + x0i); + x0r = x3i + x1r; + x0i = x3r - x1i; + a[14] = wk1r * (x0i - x0r); + a[15] = wk1r * (x0i + x0r); + k1 = 0; + for(j = 16; j < n; j += 16){ + k1 += 2; + k2 = k1 << 1; + wk2r = w[k1]; + wk2i = w[k1 + 1]; + wk1r = w[k2]; + wk1i = w[k2 + 1]; + wk3r = wk1r - 2 * wk2i * wk1i; + wk3i = 2 * wk2i * wk1r - wk1i; + x0r = a[j] + a[j + 2]; + x0i = a[j + 1] + a[j + 3]; + x1r = a[j] - a[j + 2]; + x1i = a[j + 1] - a[j + 3]; + x2r = a[j + 4] + a[j + 6]; + x2i = a[j + 5] + a[j + 7]; + x3r = a[j + 4] - a[j + 6]; + x3i = a[j + 5] - a[j + 7]; + a[j] = x0r + x2r; + a[j + 1] = x0i + x2i; + x0r -= x2r; + x0i -= x2i; + a[j + 4] = wk2r * x0r - wk2i * x0i; + a[j + 5] = wk2r * x0i + wk2i * x0r; + x0r = x1r - x3i; + x0i = x1i + x3r; + a[j + 2] = wk1r * x0r - wk1i * x0i; + a[j + 3] = wk1r * x0i + wk1i * x0r; + x0r = x1r + x3i; + x0i = x1i - x3r; + a[j + 6] = wk3r * x0r - wk3i * x0i; + a[j + 7] = wk3r * x0i + wk3i * x0r; + wk1r = w[k2 + 2]; + wk1i = w[k2 + 3]; + wk3r = wk1r - 2 * wk2r * wk1i; + wk3i = 2 * wk2r * wk1r - wk1i; + x0r = a[j + 8] + a[j + 10]; + x0i = a[j + 9] + a[j + 11]; + x1r = a[j + 8] - a[j + 10]; + x1i = a[j + 9] - a[j + 11]; + x2r = a[j + 12] + a[j + 14]; + x2i = a[j + 13] + a[j + 15]; + x3r = a[j + 12] - a[j + 14]; + x3i = a[j + 13] - a[j + 15]; + a[j + 8] = x0r + x2r; + a[j + 9] = x0i + x2i; + x0r -= x2r; + x0i -= x2i; + a[j + 12] = -wk2i * x0r - wk2r * x0i; + a[j + 13] = -wk2i * x0i + wk2r * x0r; + x0r = x1r - x3i; + x0i = x1i + x3r; + a[j + 10] = wk1r * x0r - wk1i * x0i; + a[j + 11] = wk1r * x0i + wk1i * x0r; + x0r = x1r + x3i; + x0i = x1i - x3r; + a[j + 14] = wk3r * x0r - wk3i * x0i; + a[j + 15] = wk3r * x0i + wk3i * x0r; + } +} +//------------------------------------------------- +void CFFT::cftmdl(int n, int l, double *a, double *w) +{ + int j, j1, j2, j3, k, k1, k2, m, m2; + double wk1r, wk1i, wk2r, wk2i, wk3r, wk3i; + double x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i; + + m = l << 2; + for(j = 0; j < l; j += 2){ + j1 = j + l; + j2 = j1 + l; + j3 = j2 + l; + x0r = a[j] + a[j1]; + x0i = a[j + 1] + a[j1 + 1]; + x1r = a[j] - a[j1]; + x1i = a[j + 1] - a[j1 + 1]; + x2r = a[j2] + a[j3]; + x2i = a[j2 + 1] + a[j3 + 1]; + x3r = a[j2] - a[j3]; + x3i = a[j2 + 1] - a[j3 + 1]; + a[j] = x0r + x2r; + a[j + 1] = x0i + x2i; + a[j2] = x0r - x2r; + a[j2 + 1] = x0i - x2i; + a[j1] = x1r - x3i; + a[j1 + 1] = x1i + x3r; + a[j3] = x1r + x3i; + a[j3 + 1] = x1i - x3r; + } + wk1r = w[2]; + for(j = m; j < l + m; j += 2){ + j1 = j + l; + j2 = j1 + l; + j3 = j2 + l; + x0r = a[j] + a[j1]; + x0i = a[j + 1] + a[j1 + 1]; + x1r = a[j] - a[j1]; + x1i = a[j + 1] - a[j1 + 1]; + x2r = a[j2] + a[j3]; + x2i = a[j2 + 1] + a[j3 + 1]; + x3r = a[j2] - a[j3]; + x3i = a[j2 + 1] - a[j3 + 1]; + a[j] = x0r + x2r; + a[j + 1] = x0i + x2i; + a[j2] = x2i - x0i; + a[j2 + 1] = x0r - x2r; + x0r = x1r - x3i; + x0i = x1i + x3r; + a[j1] = wk1r * (x0r - x0i); + a[j1 + 1] = wk1r * (x0r + x0i); + x0r = x3i + x1r; + x0i = x3r - x1i; + a[j3] = wk1r * (x0i - x0r); + a[j3 + 1] = wk1r * (x0i + x0r); + } + k1 = 0; + m2 = m << 1; + for(k = m2; k < n; k += m2){ + k1 += 2; + k2 = k1 << 1; + wk2r = w[k1]; + wk2i = w[k1 + 1]; + wk1r = w[k2]; + wk1i = w[k2 + 1]; + wk3r = wk1r - 2 * wk2i * wk1i; + wk3i = 2 * wk2i * wk1r - wk1i; + for(j = k; j < l + k; j += 2){ + j1 = j + l; + j2 = j1 + l; + j3 = j2 + l; + x0r = a[j] + a[j1]; + x0i = a[j + 1] + a[j1 + 1]; + x1r = a[j] - a[j1]; + x1i = a[j + 1] - a[j1 + 1]; + x2r = a[j2] + a[j3]; + x2i = a[j2 + 1] + a[j3 + 1]; + x3r = a[j2] - a[j3]; + x3i = a[j2 + 1] - a[j3 + 1]; + a[j] = x0r + x2r; + a[j + 1] = x0i + x2i; + x0r -= x2r; + x0i -= x2i; + a[j2] = wk2r * x0r - wk2i * x0i; + a[j2 + 1] = wk2r * x0i + wk2i * x0r; + x0r = x1r - x3i; + x0i = x1i + x3r; + a[j1] = wk1r * x0r - wk1i * x0i; + a[j1 + 1] = wk1r * x0i + wk1i * x0r; + x0r = x1r + x3i; + x0i = x1i - x3r; + a[j3] = wk3r * x0r - wk3i * x0i; + a[j3 + 1] = wk3r * x0i + wk3i * x0r; + } + wk1r = w[k2 + 2]; + wk1i = w[k2 + 3]; + wk3r = wk1r - 2 * wk2r * wk1i; + wk3i = 2 * wk2r * wk1r - wk1i; + for(j = k + m; j < l + (k + m); j += 2){ + j1 = j + l; + j2 = j1 + l; + j3 = j2 + l; + x0r = a[j] + a[j1]; + x0i = a[j + 1] + a[j1 + 1]; + x1r = a[j] - a[j1]; + x1i = a[j + 1] - a[j1 + 1]; + x2r = a[j2] + a[j3]; + x2i = a[j2 + 1] + a[j3 + 1]; + x3r = a[j2] - a[j3]; + x3i = a[j2 + 1] - a[j3 + 1]; + a[j] = x0r + x2r; + a[j + 1] = x0i + x2i; + x0r -= x2r; + x0i -= x2i; + a[j2] = -wk2i * x0r - wk2r * x0i; + a[j2 + 1] = -wk2i * x0i + wk2r * x0r; + x0r = x1r - x3i; + x0i = x1i + x3r; + a[j1] = wk1r * x0r - wk1i * x0i; + a[j1 + 1] = wk1r * x0i + wk1i * x0r; + x0r = x1r + x3i; + x0i = x1i - x3r; + a[j3] = wk3r * x0r - wk3i * x0i; + a[j3 + 1] = wk3r * x0i + wk3i * x0r; + } + } +} +//--------------------------------------------------------------------------- +void CFFT::Calc(double * InBuf, int size, double gain, int stg, int* OutBuf) +{ + if( m_FFTDIS ) return; // for math error + m_FFTDIS++; + int i; + + if( stg > 1 ){ + m_StgSW = TRUE; + } + else { + m_StgSW = FALSE; + } + m_StgSize = stg; + if( stg ){ + m_StgScale = 1.0 / double(m_StgSize); + m_StgK = 1.0 - m_StgScale; + } + else { + m_StgScale = 1.0; + m_StgK = 0.0; + } + double *dp = InBuf; + for(i=0; i < FFT_SIZE; i++, dp++){ + if( *dp > 32768.0 ){ + *dp = 32768.0; + } + else if( *dp < -32768.0 ){ + *dp = -32768.0; + } + (*dp) *= m_tWindow[i]; + } + bitrv2(FFT_SIZE, m_Work + 2, InBuf); + cftfsub(FFT_SIZE, InBuf, m_tSinCos); + rftfsub(FFT_SIZE, InBuf, m_Work[1], m_tSinCos + m_Work[0]); + for( i = 0, dp = pStgBuf; i <= size; i++, dp+=2 ){ + OutBuf[i] = int((gain * (*dp))); + } + m_FFTDIS--; +} +//--------------------------------------------------------------------------- +void CFFT::rftfsub(int n, double *a, int nc, double *c) +{ + int j, k, kk, ks, m; + double wkr, wki, xr, xi, yr, yi; + double d; + + ks = (nc << 2) / n; + kk = 0; + m = n >> 1; + j = n - 2; + if(m_StgSW){ + for (k = 2; k <= m; k += 2, j -= 2 ){ + kk += ks; + wkr = 0.5 - c[nc - kk]; + wki = c[kk]; + xr = a[k] - a[j]; + xi = a[k + 1] + a[j + 1]; + yr = wkr * xr - wki * xi; + yi = wkr * xi + wki * xr; + a[k] -= yr; + xi = a[k]*a[k]; + a[k+1] -= yi; + xi += ( a[k+1]*a[k+1]); + a[j] += yr; + xr = a[j]*a[j]; + a[j+1] -= yi; + xr += (a[j+1]*a[j+1]); + if( xi <= 0 ) xi = 0.0001; + if( xi >= 1e38 ) xi = 1e38; + if( xr <= 0 ) xr = 0.0001; + if( xr >= 1e38 ) xr = 1e38; + if( FFT_SIZE == 1024 ){ + xi *= 4; + xr *= 4; + } + switch(sys.m_FFTGain){ + case 0: + pStgBuf[k] = m_StgK*pStgBuf[k] + m_StgScale*(log10(xi+LOGADJ) + SCALEADJ_1); + pStgBuf[j] = m_StgK*pStgBuf[j] + m_StgScale*(log10(xr+LOGADJ) + SCALEADJ_1); + break; + case 1: + pStgBuf[k] = m_StgK*pStgBuf[k] + m_StgScale*(log10(xi+LOGADJ) + SCALEADJ_2); + pStgBuf[j] = m_StgK*pStgBuf[j] + m_StgScale*(log10(xr+LOGADJ) + SCALEADJ_2); + break; + case 2: + pStgBuf[k] = m_StgK*pStgBuf[k] + m_StgScale*(log10(xi+LOGADJ) + SCALEADJ_3); + pStgBuf[j] = m_StgK*pStgBuf[j] + m_StgScale*(log10(xr+LOGADJ) + SCALEADJ_3); + break; + case 3: + pStgBuf[k] = m_StgK*pStgBuf[k] + m_StgScale*(log10(xi+LOGADJ) + SCALEADJ_4); + pStgBuf[j] = m_StgK*pStgBuf[j] + m_StgScale*(log10(xr+LOGADJ) + SCALEADJ_4); + break; + case 4: + d = xi * 32e-10; + pStgBuf[k] = m_StgK*pStgBuf[k] + m_StgScale*d; + d = xr * 32e-10; + pStgBuf[j] = m_StgK*pStgBuf[j] + d; + break; + case 5: + d = xi * 96e-10; + pStgBuf[k] = m_StgK*pStgBuf[k] + m_StgScale*d; + d = xr * 96e-10; + pStgBuf[j] = m_StgK*pStgBuf[j] + d; + break; + case 6: + d = xi * 256e-10; + pStgBuf[k] = m_StgK*pStgBuf[k] + m_StgScale*d; + d = xr * 256e-10; + pStgBuf[j] = m_StgK*pStgBuf[j] + d; + break; + default: + d = xi * 256e-10; + pStgBuf[k] = m_StgK*pStgBuf[k] + m_StgScale*d; + d = xr * 256e-10; + pStgBuf[j] = m_StgK*pStgBuf[j] + d; + break; + } + } + } + else { + for (k = 2; k <= m; k += 2, j -= 2 ){ + kk += ks; + wkr = 0.5 - c[nc - kk]; + wki = c[kk]; + xr = a[k] - a[j]; + xi = a[k + 1] + a[j + 1]; + yr = wkr * xr - wki * xi; + yi = wkr * xi + wki * xr; + a[k] -= yr; + xi = a[k]*a[k]; + a[k+1] -= yi; + xi += ( a[k+1]*a[k+1]); + a[j] += yr; + xr = a[j]*a[j]; + a[j+1] -= yi; + xr += (a[j+1]*a[j+1]); + if( xi <= 0 ) xi = 0.0001; + if( xi >= 1e38 ) xi = 1e38; + if( xr <= 0 ) xr = 0.0001; + if( xr >= 1e38 ) xr = 1e38; + if( FFT_SIZE == 1024 ){ + xi *= 4; + xr *= 4; + } + switch(sys.m_FFTGain){ + case 0: + pStgBuf[k] = log10(xi+LOGADJ)+SCALEADJ_1; + pStgBuf[j] = log10(xr+LOGADJ)+SCALEADJ_1; + break; + case 1: + pStgBuf[k] = log10(xi+LOGADJ)+SCALEADJ_2; + pStgBuf[j] = log10(xr+LOGADJ)+SCALEADJ_2; + break; + case 2: + pStgBuf[k] = log10(xi+LOGADJ)+SCALEADJ_3; + pStgBuf[j] = log10(xr+LOGADJ)+SCALEADJ_3; + break; + case 3: + pStgBuf[k] = log10(xi+LOGADJ)+SCALEADJ_4; + pStgBuf[j] = log10(xr+LOGADJ)+SCALEADJ_4; + break; + case 4: + pStgBuf[k] = xi * 32e-10; + pStgBuf[j] = xr * 32e-10; + break; + case 5: + pStgBuf[k] = xi * 96e-10; + pStgBuf[j] = xr * 96e-10; + break; + case 6: + pStgBuf[k] = xi * 256e-10; + pStgBuf[j] = xr * 256e-10; + break; + default: + pStgBuf[k] = xi * 256e-10; + pStgBuf[j] = xr * 256e-10; + break; + } + } + } + pStgBuf[FFT_SIZE/2] = pStgBuf[(FFT_SIZE/2) - 2]; +} + diff --git a/Fft.h b/Fft.h new file mode 100644 index 0000000..779635e --- /dev/null +++ b/Fft.h @@ -0,0 +1,68 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +#ifndef FFT_H +#define FFT_H +//--------------------------------------------------------------------------- +#define FFT_BUFSIZE 2048 +#define SQRT_FFT_SIZE 46//sqrt(2048) + +class CFFT +{ +public: + CFFT(); + virtual ~CFFT(); + void InitFFT(void); + + int m_CollectFFT; + void CollectFFT(double *lp, int size); + void CalcFFT(int size, double gain, int stg); + void TrigFFT(void); + void ClearBuf(void){ + memset(m_fft, 0, sizeof(m_fft)); + memset(pStgBuf, 0, sizeof(double[FFT_BUFSIZE])); + TrigFFT(); + }; + int m_FFTDIS; + int m_fft[2048]; +private: + void Calc(double * InBuf, int size, double gain, int stg, int* OutBuf); + BOOL m_StgSW; + int m_StgSize; + double m_StgScale; + double m_StgK; + + int m_CollectFlag; + int m_CollectFFTCount; + double *m_CollectFFTBuf; + + double *m_tSinCos; + double *m_tWindow; + double *pStgBuf; + int *m_Work; + void makewt(int nw, int *ip, double *w); + void makect(int nc, int *ip, double *c); + void bitrv2(int n, int *ip, double *a); + void cftfsub(int n, double *a, double *w); + void rftfsub(int n, double *a, int nc, double *c); + void cft1st(int n, double *a, double *w); + void cftmdl(int n, int l, double *a, double *w); +}; + +#endif diff --git a/FreqDisp.cpp b/FreqDisp.cpp new file mode 100644 index 0000000..c24aee9 --- /dev/null +++ b/FreqDisp.cpp @@ -0,0 +1,205 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "FreqDisp.h" +//--------------------------------------------------------------------- +#pragma resource "*.dfm" +//TFreqDispDlg *FreqDispDlg; +//--------------------------------------------------------------------- +__fastcall TFreqDispDlg::TFreqDispDlg(TComponent* AOwner) + : TForm(AOwner) +{ + FormStyle = ((TForm *)AOwner)->FormStyle; + Font->Name = ((TForm *)AOwner)->Font->Name; + Font->Charset = ((TForm *)AOwner)->Font->Charset; + + m_H1 = NULL; + m_Tap1 = 0; + m_Over1 = 1; + m_H2 = NULL; + m_Tap2 = 0; + m_Over2 = 1; + m_Max = 0; + + pBitmap = new Graphics::TBitmap(); + pBitmap->Width = PaintBox->Width; + pBitmap->Height = PaintBox->Height; + if( Font->Charset != SHIFTJIS_CHARSET ){ + CancelBtn->Caption = "Close"; + BwBtn->Caption = "Width"; + Caption = "frequency characteristic"; + } +} +__fastcall TFreqDispDlg::~TFreqDispDlg() +{ + delete pBitmap; +} +//--------------------------------------------------------------------- +void __fastcall TFreqDispDlg::Execute(const double *H, int Tap, int Over) +{ + m_type = 0; + m_H1 = H; + m_Tap1 = Tap; + m_Over1 = Over; + m_Tap2 = 0; + ShowModal(); +} +//--------------------------------------------------------------------- +void __fastcall TFreqDispDlg::Execute(const double *H1, const double *H2, int Tap, int Over) +{ + m_type = 0; + m_H1 = H1; + m_Tap1 = Tap; + m_Over1 = Over; + m_H2 = H2; + m_Tap2 = Tap; + m_Over2 = Over; + ShowModal(); +} +//--------------------------------------------------------------------- +void __fastcall TFreqDispDlg::Execute(const double *H1, int Tap1, const double *H2, int Tap2, int Over) +{ + m_type = 4; + m_H1 = H1; + m_Tap1 = Tap1; + m_Over1 = Over; + m_H2 = H2; + m_Tap2 = Tap2; + m_Over2 = Over; + ShowModal(); +} +//--------------------------------------------------------------------- +void __fastcall TFreqDispDlg::Execute(double a10, double b11, double b12, double a20, double b21, double b22, int Over) +{ + m_type = 1; + m_Over1 = Over; + m_a10 = a10; + m_b11 = b11; + m_b12 = b12; + m_a20 = a20; + m_b21 = b21; + m_b22 = b22; + ShowModal(); +} +//--------------------------------------------------------------------- +void __fastcall TFreqDispDlg::Execute(CIIR *ip, int Over, double max) +{ + m_type = 2; + m_piir = ip; + m_Over1 = Over; + m_Max = max; + ShowModal(); +} +//--------------------------------------------------------------------- +void __fastcall TFreqDispDlg::Execute(const double *H, int Tap, int Over, double max) +{ + m_type = 3; + m_H1 = H; + m_Tap1 = Tap; + m_Over1 = Over; + m_Tap2 = 0; + m_Max = max; + ShowModal(); +} +//--------------------------------------------------------------------- +void __fastcall TFreqDispDlg::PaintBoxPaint(TObject *Sender) +{ + if( m_type == 0 ){ // FIR + if( Timer->Enabled ){ + memcpy(m_HT, m_H1, sizeof(double)*(m_Tap1+1)); + DrawGraph(pBitmap, m_HT, m_Tap1, m_Over1, m_Max, 1, clBlue); + if( m_Tap2 ){ + memcpy(m_HT, m_H2, sizeof(double)*(m_Tap2+1)); + DrawGraph(pBitmap, m_HT, m_Tap2, m_Over1, m_Max, 0, clRed); + } + } + else { + DrawGraph(pBitmap, m_H1, m_Tap1, m_Over1, m_Max, 1, clBlue); + if( m_Tap2 ){ + DrawGraph(pBitmap, m_H2, m_Tap2, m_Over2, m_Max, 0, clRed); + } + } + } + else if( m_type == 1 ){ // IIR Tank + DrawGraphIIR(pBitmap, m_a10, 0, 0, -m_b11, -m_b12, m_Over1, m_Max, 1, clBlue); + DrawGraphIIR(pBitmap, m_a20, 0, 0, -m_b21, -m_b22, m_Over1, m_Max, 0, clRed); + } + else if( m_type == 2 ){ // IIR +#if 1 + DrawGraphIIR(pBitmap, m_piir, m_Over1, m_Max, 1, clBlue); +#else + CIIR iir; + iir.MakeIIR(2600, SampFreq, 10, 0, 0); + m_Max = 6000.0; + DrawGraphIIR(pBitmap, &iir, 1, m_Max, 1, clBlue); +#endif + } + else if( m_type == 3 ){ // FIR-Avg + DrawGraph(pBitmap, m_H1, m_Tap1, m_Over1, m_Max, 1, clBlue); + } + else if( m_type == 4 ){ // two-FIR + DrawGraph2(pBitmap, m_H1, m_Tap1, m_H2, m_Tap2, m_Over1, m_Max, 1, clBlue); + } + PaintBox->Canvas->Draw(0, 0, (TGraphic*)pBitmap); +} +//--------------------------------------------------------------------------- +void __fastcall TFreqDispDlg::BwBtnClick(TObject *Sender) +{ + if( m_type >= 2 ){ + switch(m_Max){ + case 100: + m_Max = 200; + break; + case 200: + m_Max = 400; + break; + case 400: + m_Max = 800; + break; + case 800: + m_Max = 3000; + break; + default: + m_Max = 100; + break; + } + } + else { + switch(m_Max){ + case 3000: + m_Max = 4000; + break; + case 4000: + m_Max = 6000; + break; + case 6000: + m_Max = 2000; + break; + default: + m_Max = 3000; + break; + } + } + PaintBoxPaint(NULL); +} +//--------------------------------------------------------------------------- diff --git a/FreqDisp.dfm b/FreqDisp.dfm new file mode 100644 index 0000000..6b7aaf9 Binary files /dev/null and b/FreqDisp.dfm differ diff --git a/FreqDisp.h b/FreqDisp.h new file mode 100644 index 0000000..698479b --- /dev/null +++ b/FreqDisp.h @@ -0,0 +1,84 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//---------------------------------------------------------------------------- +#ifndef FreqDispH +#define FreqDispH +//---------------------------------------------------------------------------- +/* JA7UDE 0428 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +*/ +//---------------------------------------------------------------------------- +#include "fir.h" +//---------------------------------------------------------------------------- +class TFreqDispDlg : public TForm +{ +__published: + TButton *CancelBtn; + TPanel *Panel; + TPaintBox *PaintBox; + TTimer *Timer; + TButton *BwBtn; + void __fastcall PaintBoxPaint(TObject *Sender); + + void __fastcall BwBtnClick(TObject *Sender); +private: + Graphics::TBitmap *pBitmap; + + int m_type; + double m_a10, m_a20; + double m_b11, m_b12; + double m_b21, m_b22; + + CIIR *m_piir; + + const double *m_H1; + int m_Tap1; + int m_Over1; + const double *m_H2; + int m_Tap2; + int m_Over2; + + double m_HT[TAPMAX+1]; +public: + virtual __fastcall TFreqDispDlg(TComponent* AOwner); + __fastcall ~TFreqDispDlg(); + + void __fastcall Execute(const double *H, int Tap, int Over); + void __fastcall Execute(const double *H1, const double *H2, int Tap, int Over); + void __fastcall Execute(const double *H1, int Tap1, const double *H2, int Tap2, int Over); + void __fastcall Execute(double a10, double b11, double b12, double a20, double b21, double b22, int Over); + void __fastcall Execute(CIIR *ip, int Over, double max); + void __fastcall Execute(const double *H, int Tap, int Over, double max); + + int m_Max; +}; +//---------------------------------------------------------------------------- +//extern TFreqDispDlg *FreqDispDlg; +//---------------------------------------------------------------------------- +#endif diff --git a/HISTORY.TXT b/HISTORY.TXT new file mode 100644 index 0000000..94d7519 --- /dev/null +++ b/HISTORY.TXT @@ -0,0 +1,230 @@ +MMTTY‚Ì•ÏX—š—ð + +[V1.00 2000-06-30] +‰‰ñŒöŠJ + +[V1.01 -> V1.10 2000-07-08] +ƒTƒEƒ“ƒhƒJ[ƒh‚̃oƒbƒtƒ@ƒTƒCƒYÝ’è‚ð’ljÁ +ƒ}ƒjƒ…ƒAƒ‹‚̈ꕔ‹LÚ˜R‚ê‚ðC³ +‘—M‰æ–ʂ̃TƒCƒY‚ðINIƒtƒ@ƒCƒ‹‚É‹L‰¯ +ƒƒO‹@”\‚ð’ljÁ +ˆê•”‚Ì256FƒrƒfƒIƒAƒ_ƒvƒ^‚ÅWaterFall‚ª³‚µ‚­•\ަ‚Å‚«‚È‚¢ƒoƒO‚ðC³ +‘O’uƒtƒBƒ‹ƒ^‚ð’ljÁ +Ý’è‰æ–ʂɃtƒBƒ‹ƒ^“Á«•\ަ‚̒ljÁ +ƒƒCƒ“‰æ–Ê‚ÉÏ•ªŠíiLPFj‚ÌÝ’èƒ{ƒbƒNƒX‚ð”z’u +WaterFall,ŽóM‰æ–Ê,‘—M‰æ–Ê‚ÌF‚ÌÝ’è‚ð’ljÁ +V‚µ‚¢ƒƒOƒtƒ@ƒCƒ‹‚̃I[ƒvƒ“‚ðŽÀsŒã‚ÉŒŸõ‚ª‚Å‚«‚È‚­‚È‚éƒoƒO‚ðC³ +FSK‘—M‚̑ΉžiTnx JA7DHJj +ƒfƒ‚ƒWƒ…ƒŒ[ƒ^“ü—Í•”‚É“K‰žƒtƒBƒ‹ƒ^iLMSj‚ð“ü‚ê‚ê‚邿‚¤‚É‚µ‚½ +FSK(TXD)o—͂̑—oƒrƒbƒg‚ª‹t‡‚ɂȂÁ‚Ä‚¢‚½ƒoƒO‚ðC³iTnx JA7DHJj +‚»‚Ì‘¼Aׂ©‚¢“_‚ÌC³‚Ǝ኱‚Ì‹@”\’ljÁ + +[V1.11 -> V1.20 2000-07-13] +PTT§Œäƒ|[ƒg‚ÉCOM5`COM8‚ð’ljÁ(Tnx JH3XDO) +ƒ}ƒNƒ‚¨‚æ‚Ñ’èŒ^ƒƒbƒZ[ƒW‚̕ϊ·Žq‚Éu%gv‚Æu%fv‚ð’ljÁ +QSOƒƒO‚̃eƒLƒXƒgƒtƒ@ƒCƒ‹‚ւ̃GƒNƒXƒ|[ƒg‹@”\‚ð’ljÁ +QSOƒƒO‚̃eƒLƒXƒgƒtƒ@ƒCƒ‹‚©‚ç‚̃Cƒ“ƒ|[ƒg‹@”\‚ð’ljÁ +FSK(TXD)‰^—pŽž‚Ì‘—ŽóØ‚è‘Ö‚¦‚̃oƒO‚ÌC³(Tnx JA1FQI) +•¶ŽšƒEƒCƒGƒgADiddleƒEƒGƒCƒg‚ð’ljÁ(Tnx JA1IQV) +•\ަƒƒjƒ…[‚ÉuŽóM‰æ–ʂ̃NƒŠƒAv‚ð’ljÁ(Tnx JG3LGD) +LMS“®ì‚̉ü‘P +V1.14‚Å”­¶‚µ‚½‚ ‚éðŒ‚Å‹N“®‚Å‚«‚È‚­‚È‚éƒoƒO‚ÌC³ +ƒ}ƒNƒƒ{ƒ^ƒ“‚̃Vƒ‡[ƒgƒJƒbƒgƒL[‚ÌŠ„‚è“–‚Ä(Tnx JA1IQV) +Ž©“®‚ÅŽóM‚É–ß‚éÛ‚Ì”÷–­‚ȃ^ƒCƒ~ƒ“ƒO‚ðC³ +LOG200ƒf[ƒ^ƒtƒ@ƒCƒ‹‚Æ‚Ì‘ŠŒÝ•ÏŠ·‚ð’ljÁ +‚w‚xƒXƒR[ƒv•\ަ‚ð’ljÁ(Tnx JA1IQV) +Žü”g”•Ù•ÊŠí‚̃fƒtƒHƒ‹ƒg‚ðFIRŒ^BPF‚©‚çIIRŒ^‹¤UŠí‚É•ÏX +XYƒXƒR[ƒvAƒ}[ƒNŽü”g”‚ð…•½‚É‚µ‚½(Tnx JA1IQV) +XYƒXƒR[ƒv•\ަ‚ð‰ü‘P +ƒfƒ‚ƒWƒ…ƒŒ[ƒ^‚ÉƒŠƒ~ƒbƒ^ƒAƒ“ƒv‚ð’ljÁ(Tnx 7L1CUH, JA1IQV) +ƒfƒ‚ƒWƒ…ƒŒ[ƒ^‚ÌAGC‹@”\‚ð”pŽ~ + +[V1.21 -> V1.30 2000-07-23] +ƒTƒEƒ“ƒh‚Ì‹L˜^‚ÆÄ¶‹@”\‚ð’ljÁiTnx 7L1CUHj +IIRŒ^‹¤UŠí‚ÌŽü”g”“Á«•\ަ‚ð’ljÁ +XY-Scope‚Ì•\ަƒTƒCƒY‚ð‘I‘ð‰Â”\‚É‚µ‚½ +LMS‚ÉInviŒë·M†o—Íj‚ð’ljÁ +ƒTƒEƒ“ƒh‚̘^‰¹EĶ‹@”\‚ð‹­‰» +ƒTƒEƒ“ƒhÄ¶Žž‚ɃTƒEƒ“ƒhƒJ[ƒh‚ÉM†‚ðo—Í‚·‚邿‚¤‚É‚µ‚½ +PLL•ûŽ®‚̃fƒ‚ƒWƒ…ƒŒ[ƒ^‚̒ljÁ +ĶˆÊ’uÝ’è‰æ–Ê‚ð’ljÁ +•¶ŽšƒEƒCƒGƒgADiddleƒEƒGƒCƒg‚̃Xƒ‰ƒCƒh‚ðAŒ^ƒ{ƒŠƒ…[ƒ€‚É•ÏX +ƒIƒVƒƒXƒR[ƒv‰æ–Ê‚ÉuPlayvƒ{ƒ^ƒ“‚ð’ljÁ +MMTTY‚ÌM†ˆ—‚̉ðàudigital.txtv‚ð’ljÁ +DTR‚Ö‚Ì•„†ƒf[ƒ^o—Í‘I‘ð‚ð”pŽ~iŽ|‚­“­‚©‚È‚¢j +Turbo Hamlogƒf[ƒ^ƒtƒ@ƒCƒ‹‚Æ‚Ì‘ŠŒÝ•ÏŠ·‚ð’ljÁ +ƒVƒ‡[ƒgƒJƒbƒgƒL[‚̃JƒXƒ^ƒ}ƒCƒY‚ð’ljÁ(Tnx 7L1CUH) +ƒƒO‹@”\‚̎኱‚Ì‹­‰» +ƒ}ƒNƒ‚Ìæ“ª‚Æ––”ö‚̃Xƒy[ƒX‚ª‹L˜^‚Å‚«‚È‚¢ƒoƒO‚ÌC³(Tnx 7L1CUH) +Ý’è‰æ–Ê‚ÉSoundˆ—Priority‚Ì‘I‘ð‚ð’ljÁ(Tnx JH1SWD) +Priority‚̃fƒtƒHƒ‹ƒg‚ðuCriticalv¨uHighestv‚É•ÏX(Tnx JH1SWD) +Hamlog->MMTTY‚ÅMyRST‚̕ϊ·‚ÌT”²‚¯‚ðC³(Tnx JH1SWD) +‹N“®Žž‚̃TƒEƒ“ƒhƒJ[ƒhƒI[ƒvƒ“‚ÌƒŠƒgƒ‰ƒC‚ð’ljÁ(Tnx JA6VAG) +Rx-Stopƒrƒbƒg‚̃fƒtƒHƒ‹ƒg‚ð1.42bit -> 1bit‚É•ÏX +Hamlog->MMTTY•ÏŠ·‚̈ꕔ‚̃oƒO‚ðC³(Tnx JH1SWD) +ƒRƒ“ƒgƒ[ƒ‹ƒpƒlƒ‹•\ަ‚ÌOn/Off‚̒ljÁ +ƒRƒ“ƒgƒ[ƒ‹ƒpƒlƒ‹ƒTƒCƒY‚Ì‘I‘ð‚ð’ljÁ +‚»‚Ì‘¼×‚©‚¢“_‚̉ü‘P + +[V1.31 -> V1.40 2000-07-30] +ƒƒOƒtƒ@ƒCƒ‹‚̕ϊ·“®ì‚ð‰ü‘P(Tnx JH1SWD) +–â‚¢‡‚킹ƒƒbƒZ[ƒW‚ð‰ü‘P(Tnx JH1SWD) +ƒvƒƒOƒ‰ƒ€ƒƒjƒ…[‚̒ljÁ(Tnx JH1SWD, JA1IQV) +ŠO•”ƒvƒƒOƒ‰ƒ€ŽÀsŽž‚̃JƒŒƒ“ƒgƒfƒBƒŒƒNƒgƒŠ‚ðÝ’è(Tnx JH1SWD) +ƒXƒPƒ‹ƒ`“®ì‚̎኱‚̉ü‘P +‰pŒêƒ‚[ƒh‚ð’ljÁ(Tnx HL1AQ) +’ᑬCPU‚Ì‚½‚ß‚ÌLocalEchoƒIƒvƒVƒ‡ƒ“‚ð’ljÁ +ƒ}ƒNƒƒeƒLƒXƒg‚ð‘—M‰æ–ÊŒo—R‚Åo—Í‚·‚éƒIƒvƒVƒ‡ƒ“‚ð’ljÁ(Tnx JA1IQV) +ˆê”Ôʼn‚̃ƒOƒf[ƒ^‹L˜^‚ŃGƒ‰[‚ɂȂéƒoƒO‚ðC³ +ƒƒO‚ÌUTC•\ަ(TimeZone‘I‘ð)‚ð’ljÁ +‰‰ñ‹N“®Žž‚ÌŒ¾Œê–â‚¢‡‚킹‚ð”pŽ~iŽ©“®”»’è‚É•ÏXj +XYScope‚̉ñ“]•ûŒü‚ð‹t‚É‚·‚éƒIƒvƒVƒ‡ƒ“‚ð’ljÁ(Tnx JA9AVA) +ƒXƒPƒ‹ƒ`“®ì‚̉ü‘P +WaitDiddleOutƒIƒvƒVƒ‡ƒ“‚ð’ljÁ +Limitƒ{ƒ^ƒ“‚ð”pŽ~ +NETƒ{ƒ^ƒ“‚̒ljÁ +DXƒ{ƒ^ƒ“‚̃fƒtƒHƒ‹ƒgƒQƒCƒ“‚ð100‚É•ÏX +ƒ}ƒEƒX‚Å‚ÌMyRSTŽæ‚肱‚݂ɃRƒ“ƒeƒXƒgƒ‚[ƒh‚ð’ljÁ +Control PanelƒTƒCƒY‚ÉLarge‚ð’ljÁ(Tnx JE8LWZ) +SQƒŒƒxƒ‹•\ަ‚ðSQ-OFFŽž‚É‚à“®ì‚·‚邿‚¤‚É‚µ‚½ +AFC‚ÌShift•ÏXƒAƒ‹ƒSƒŠƒYƒ€‚ÉHAMƒ‚[ƒh‚ð’ljÁ +NETƒ{ƒ^ƒ“‚Ì“®ì•s‹ï‡‚ðC³ +Šeƒ}ƒNƒƒ{ƒ^ƒ“‚Ì•ÒW‚ɃVƒ‡[ƒgƒJƒbƒgƒL[‚ðŠ„‚è“–‚ĉ”\‚É‚µ‚½(Tnx JA1IQV) +ƒ}ƒNƒŽQƃL[ƒ[ƒh‚Éu%sv‚ð’ljÁ(Tnx JH3XDO) +‚»‚Ì‘¼×‚©‚¢“_‚̉ü‘P + +[V1.41 -> V1.50 2000-08-08] +Ï•ªŠí‚ÉIIR-LPF‚ð’ljÁ +Ï•ªŠí‚Ì“Á«Šm”Fƒ{ƒ^ƒ“‚ð’ljÁ +XYScope•\ަ‚̈—•iŽ¿‚Ì‘I‘ð‚ð’ljÁ +XYScope•\ަ‚ÌƒŠƒ~ƒbƒ^[‚Å‚ÌˆÊ‘Š˜c‚݂ɂæ‚é‰e‹¿‚ðŠÉ˜a +ƒŠƒ~ƒbƒ^[‚ÌuOver Samplingv‚Ì‘I‘ð‚ð’ljÁ(ŽQƨDigital.txt) +ƒTƒEƒ“ƒhƒJ[ƒh‚̃NƒƒbƒN•â³’l‚ðÝ’è‰Â”\‚É‚µ‚½(Tnx JA1WSK) +ƒNƒƒbƒN•ⳂÅJJY‚Ì‚P•bƒ`ƒbƒN‰¹‚ð—˜—p‰Â”\‚É‚µ‚½(Tnx JA1WSK) +FSK‘—M(TXD)Žž‚ÉUART‚̃^ƒCƒ~ƒ“ƒO‚Å‘—M‚Å‚«‚é‘I‘ð‚ð’ljÁ +Diddle ONŽž‚ÉŽóM‚Ö‚ÌØ‚è‘Ö‚¦‚ª’x‚ê‚Ä‚¢‚½“_‚ð‰ü‘P +Diddle‚ÌuWaitTimerv‚ð’ljÁ(Tnx JA1IQV) +LTR/FIGƒR[ƒh‚Ì‹­§o—Í‚ð’ljÁ(Tnx JA1IQV) +’èŒ^ƒƒbƒZ[ƒWŽQƃL[ƒ[ƒh‚Éu^v‚ð’ljÁ(Tnx JA1IQV) +’ᑬCPUŽž‚É–â‚¢‡‚킹ƒƒbƒZ[ƒW•\ަ‚ª’x‚ê‚é‚̂𭂵‰ü‘P +‚»‚Ì‘¼×‚©‚¢“_‚̉ü‘P + +[V1.51 2000-08-08] +Pentium75MHz‚ł̑€ì‰ž“š‚ð­‚µ‰ü‘P +•s—vi–³ˆÓ–¡j‚ÈÝ’èƒXƒCƒbƒ`‚Ì”pŽ~ +ƒTƒXƒyƒ“ƒhŽž‚ÌCPUŽžŠÔ‚ðX‚ɉð•ú +ƒ}ƒjƒ…ƒAƒ‹i–{‘j‚Ɉ—ŒyŒ¸‰»‚̈’u‚ð‹LÚ + +[V1.52 2000-08-10] +ƒL[‘€ì‚É‚æ‚éƒVƒtƒg••ÏX‹@”\‚ð’ljÁ(Tnx JA3KWZ) +AFC‚̃Aƒ‹ƒSƒŠƒYƒ€‚ÉuFSKv‚ð’ljÁ(Tnx JA3KWZ) +ƒ}ƒNƒŽQƃL[ƒ[ƒh‚Éu~vu[vu]v‚ð’ljÁ +‘—MØ‚è‘Ö‚¦’¼Œã‚ÌDiddle‘—o‚ð0.25•bŠÔ‹ÖŽ~ +ׂ©‚¢“_‚ÌC³ + +[V1.53 2000-08-12] +AFC‚ÌHAM,FSK‚̃Aƒ‹ƒSƒŠƒYƒ€‚ɃVƒtƒg•220Hz/240Hz‚ð’ljÁ +FFT‚̃QƒCƒ“‘I‘ð‚ð’ljÁ +ׂ©‚¢“_‚ÌC³ + +[V1.54 2000-08-13] +uCtrl+BSvƒL[‚Å–¢‘—M‚Ì1s‚ðÁ‹Ž‚Å‚«‚邿‚¤‚É‚µ‚½(Tnx JA1IQV) +ƒ}ƒNƒŽQƃL[ƒ[ƒh‚Ìæ“ª‚É‹Lq‚·‚éu#v‚ð’ljÁ(JH8WIG) +ƒ}ƒNƒŽQƃL[ƒ[ƒh‚Éu%Ev‚ð’ljÁ(Tnx JA1IQV) +‘—M‰æ–ʂł̃L[ƒ[ƒhŽQÆ“®ì‚Éu‘¦Žž•ÏŠ·v‚ð’ljÁ(Tnx JG1GGU) + +[V1.55 2000-08-15] +Diddle‚̃fƒtƒHƒ‹ƒg‚ðuNONEv‚©‚çuLTRv‚É•ÏX(Tnx K6STI) +uDisable Revvi‘—MŽž‚ÉRev‚𖳌ø‚É‚·‚éj‚ð’ljÁ(Tnx W6/G0AZT) +’èŒ^ƒƒbƒZ[ƒW‚̃hƒƒbƒvƒŠƒXƒg‚Ì•\ަ”‚ð‚P‚U‚É‘‚₵‚½(Tnx JE4CIL) + +[V1.56 2000-08-20] +MMTTY.TXT“à‚ÌDsubƒsƒ“”Ô†‚ÌŒë‚è‚ðC³(Tnx MMTTY-Gropu) +ƒ}[ƒNŽü”g”‚̉ºŒÀ‚ð300Hz‚É•ÏX(Tnx MMTTY-Group) +uŽóM‰æ–ʂ̃NƒŠƒAv‚ɃVƒ‡[ƒgƒJƒbƒg‚ð’è‹`‚Å‚«‚邿‚¤‚É‚µ‚½(Tnx MMTTY-Group) +uESCv‚ðƒVƒ‡[ƒgƒJƒbƒgƒL[‚ÌƒŠƒXƒg‚ɒljÁ(Tnx MMTTY-Group) +ADIFƒtƒ@ƒCƒ‹‚ւ̃GƒNƒXƒ|[ƒg‚ð’ljÁ(Tnx JA5HRE, MMTTY-Group) +ƒ^ƒCƒ€ƒXƒ^ƒ“ƒv‚ðUTC•\ަ‚Å‚«‚邿‚¤‚É‚µ‚½(Tnx MMTTY-Group) +QSOƒf[ƒ^•\ަ‚ÅUTC•\ަ‚Å‚«‚È‚©‚Á‚½ƒoƒO‚ðC³(Tnx MMTTY-Group) +599ƒ{ƒ^ƒ“‚ð”pŽ~‚µ‘ã‚í‚è‚Ƀoƒ“ƒhƒ{ƒbƒNƒX‚ð”z’u + +[V1.57 2000-08-24] +ƒR[ƒ‹ƒTƒCƒ“ƒNƒŠƒbƒNŽž‚É‘¦ŒŸõ‚·‚邿‚¤‚É•ÏX(Tnx MMTTY-Group) +ƒ[ƒh’PˆÊ‚ł̕¶Žš‚Ì‘—M‚ð’ljÁ(Tnx MMTTY-Group) +ƒRƒeƒ“ƒXƒg‚̃‰ƒ“ƒjƒ“ƒOƒ‚[ƒh‚ÆS&Pƒ‚[ƒh‚ð’ljÁ(Tnx MMTTY-Group) +‰pŒê”Å—p‚ÉSetup Helpƒƒjƒ…[‚ÆHTML Help•\ަ‹@”\‚ð’ljÁ(Tnx MMTTY-Group) + +[V1.58 2000-09-07] +‰pŒê”Å—p‚ÉWindows Help‚̃AƒNƒZƒX‹@”\‚ð’ljÁ(Tnx KX2A) +ƒ}ƒNƒƒL[ƒ[ƒh‚Éu%Dv‚Æu%Tv‚ð’ljÁ(Tnx MMTTY-Group) +ƒ}ƒNƒƒL[ƒ[ƒh‚Ìu~v‚Æu_v‚Ì“®ì‚ð‰ü‘P(Tnx MMTTY-Group) +DXƒ{ƒ^ƒ“‚ð휂µATCƒ{ƒ^ƒ“‚ð’ljÁ +’èŒ^ƒƒbƒZ[ƒWŽQƃL[ƒ[ƒh‚Éu#v‚ð’ljÁ(Tnx MMTTY-Group) + +[V1.59 2000-10-15] +‘¦Žž•ÏŠ·Žž‚Å‚àu%Fv‚Æu%Lv‚Íí‚É‘—MŽž‚ɕϊ·‚·‚邿‚¤‚ɉü‘P(Tnx JA1IQV) +“ú–{Œê”Å‚ÉRTTY BASICS‚̃wƒ‹ƒvƒ|ƒCƒ“ƒ^‚ð’ljÁiTnx W7TI, JA7UDEj +ƒ}ƒEƒX‚ł̎æ‚肱‚Ý‚ÉCQ/RJƒ‚[ƒh‚ð’ljÁiTnx JA1IQV, K5YGj +ƒRƒ“ƒeƒXƒgƒ‚[ƒhŽž‚̃}ƒEƒX‚ł̎æ‚肱‚Ý“®ì‚̉ü‘PiTnx JA1IQVj +Hamlog‚Ƃ̕ϊ·‚Ń‚[ƒh‚ð’è‹`‰Â”\‚É‚µ‚½iTnx JE4CIL, 7L1CUHj +ADIF‚Ö‚ÌRSTo—͂̃fƒtƒHƒ‹ƒg“®ì‚ð•ÏXiTnx MMTTY-Groupj +TNC–Í‹[ƒ‚[ƒh‚ð’ljÁ +ƒeƒLƒXƒgƒtƒ@ƒCƒ‹‘—M‚Ì•¶Žš”§ŒÀ‚ð‚È‚­‚µ‚½iTnx MMTTY-Groupj +ƒŠƒ‚[ƒgƒ‚[ƒh‚ð’ljÁiTnx K4CYj +ŽžŽæ“¾‚ɃIƒtƒZƒbƒg‚ðÝ’è‚Å‚«‚邿‚¤‚É‚µ‚½iTnx JR3KFX) +ƒEƒCƒ“ƒhƒEƒTƒCƒY‚ƈʒu‚ðƒIƒvƒVƒ‡ƒ“‚Å‹L‰¯‰Â”\‚É‚µ‚½iTnx MMTTY-Groupj +ƒ}ƒNƒƒ{ƒ^ƒ“‚ÉF‚ð’è‹`‰Â”\‚É‚µ‚½iTnx MMTTY-Groupj +TXƒ{ƒ^ƒ“‘€ìŽž‚ÉŽ©“®‰üs‚ðo—͂ł«‚邿‚¤‚É‚µ‚½iTnx JH1BIHj +ƒ}ƒNƒƒ{ƒ^ƒ“(16ŒÂ)•\ަ‚ðON/OFF‰Â”\‚É‚µ‚½ +ƒƒCƒ“‰æ–Ê‚©‚ç'BW'‚ðƒNƒŠƒbƒN‚µ‚ÄBaud‚ð‘€ì‰Â”\‚É‚µ‚½iTnx MMTTY-Groupj +ƒTƒEƒ“ƒhƒJ[ƒh‚ÌID”Ô†‚ðÝ’è‚Å‚«‚邿‚¤‚É‚µ‚½iTnx MMTTY-Groupj +“ú•t‚Ì•\Œ»‚ð‘I‘ð‚Å‚«‚邿‚¤‚É‚µ‚½iTnx MMTTY-Groupj +PTT§Œä‚ÉRadioCommand‚ð’ljÁiTnx KB2EOQ, JA1WSK, MMTTY-Groupj +ƒ}ƒNƒƒ{ƒ^ƒ“(16ŒÂ)‚ÉƒŠƒs[ƒg‹@”\‚ð’ljÁiTnx MMTTY-Groupj +TXƒ{ƒ^ƒ“‚ÌŽ©“®‰üsݒ肪INIƒtƒ@ƒCƒ‹‚ɃZ[ƒu‚Å‚«‚È‚¢ƒoƒO‚ðC³iTnx JA1IQVj +ƒTƒEƒ“ƒhƒJ[ƒh‚̃Tƒ“ƒvƒŠƒ“ƒOŽü”g”‚ð•ÏX‰Â”\‚É‚µ‚½ +LMS‚Ì‘ã‚í‚è‚Ƀmƒbƒ`ƒtƒBƒ‹ƒ^‚ð‘I‘ð‚Å‚«‚邿‚¤‚É‚µ‚½ +ƒ}[ƒNŽü”g”‚̃hƒƒbƒvƒŠƒXƒg‚É1275Hz‚ð’ljÁ(Tnx JA1ADN) +'%D'ƒ}ƒNƒ‚Ìo—Í‘Ž®‚ð“ú•tŒ`Ž®‚Å•ÏX‰Â”\‚É‚µ‚½ +ƒ}ƒNƒƒ{ƒ^ƒ“‚̉¡‚P—ñ•À‚Ñ•\ަ‚ð’ljÁ(Tnx MMTTY Group) +FSK‚Ìo—̓^ƒCƒ~ƒ“ƒO‚ð‰ü‘P +‚Q‚‚̃mƒbƒ`Žü”g”‚ðŽg—p‚Å‚«‚邿‚¤‚É‚µ‚½ +ƒƒO‚̃eƒLƒXƒgƒCƒ“ƒ|[ƒg‚̃oƒO‚ÌC³(Tnx MMTTY Group) +YYYYŒ`Ž®‚̃oƒO‚ÌC³(Tnx MMTTY Group) + +[V1.60 2000-12-17] +ƒL[ƒ{[ƒh‚̃[ƒhƒ‰ƒbƒv‹@”\‚ð’ljÁ(Tnx JH1BIH) +ƒŠƒ‚[ƒgƒ‚[ƒh‚̉ü‘P(Tnx K4CY, MMTTY group) +ƒ}ƒNƒ’è‹`‰æ–Ê‚ÉuCommandsvƒ{ƒ^ƒ“‚ð’ljÁ(Tnx MMTTY group) +ŽóM‰æ–ʂ̑—M•¶Žš‚ÉF‚ð’è‹`‰Â”\‚É‚µ‚½(Tnx MMTTY group) +ADIFƒtƒ@ƒCƒ‹‚̃Cƒ“ƒ|[ƒg‚ð’ljÁ(Tnx MMTTY-Group) +USB-Comƒ|[ƒg‘Îô‚ÅFSK-TXD‚̈—•û–@‚Ì‘I‘ð‚ð’ljÁ(Tnx KD6AZN, JA7UDE, MMTTY-Group) +OnQSO,OffQSO,Capture‚̃Vƒ‡[ƒgƒJƒbƒg’è‹`‚̒ljÁ(Tnx JA1WSK, MMTTY-Group) +ƒ}ƒNƒƒL[ƒ[ƒh‚Éu%Mvu%tv‚ð’ljÁ(Tnx MMTTY-Group) +•¶ŽšƒtƒHƒ“ƒg‚ɃXƒ^ƒCƒ‹‚ð“K—p(Tnx MMTTY-Group) +‰pŒêƒ‚[ƒhŽž‚ÉJCC/JCG‰æ–Ê‚ÌQTH‚ð‰pŒê‚Å•\‹L‚·‚é(Tnx MMTTY-Group) +FFTƒEƒCƒ“ƒhƒEã‚̃mƒbƒ`Žü”g”ˆÊ’u‚Ƀ}[ƒJ[‚ð•\ަ(Tnx MMTTY-Group) +RadioCommand‚ÉVFOƒ|[ƒŠƒ“ƒO‹@”\‚ð’ljÁ(Tnx JA1WSK, KX2A, MMTTY-Group) +ƒXƒeƒŒƒIƒ‚[ƒh‚ŃTƒEƒ“ƒhƒJ[ƒh‚ðˆµ‚¤ƒIƒvƒVƒ‡ƒ“‚ð’ljÁ(Tnx MMTTY-Group) + +[V1.61 2001-01-26] +ŽžƒIƒtƒZƒbƒg‚É•ª‚ð’ljÁiTnx MMTTY-Groupj +ƒŠƒ‚[ƒgƒ‚[ƒh‚̉ü‘PiTnx K4CY, Zakanaka-Groupj +DSP•”•ª‚̈—‘¬“x‚̉ü‘P +WindowsNT/2000‚ł̃ƒbƒN‚Ì–â‘è‚ð‰ðŒˆiTnx MMTTY-Groupj +‘—MŽž‚ÌuAlways fix shiftvƒIƒvƒVƒ‡ƒ“‚ð’ljÁiTnx K4CYj +VFOƒ|[ƒŠƒ“ƒO‚ÉKenwood‚ð’ljÁiTnx MMTTY-Groupj +ƒvƒƒtƒ@ƒCƒ‹ƒƒjƒ…[‚̒ljÁ +ƒNƒƒbƒN’²®‰æ–ʂ̑€ì‰ü‘P +TNCƒGƒ~ƒ…ƒŒ[ƒVƒ‡ƒ“‚ÉuBaudot modemv‚ð’ljÁ +ŽžƒIƒtƒZƒbƒg‚Éu‰ÄŽžŠÔ’²®‚Ì–³Ž‹v‚ð’ljÁiTnx K4CYj +ƒƒO‚̃GƒNƒXƒ|[ƒg‚ÉuCabrillo filev‚ð’ljÁiTnx W6/G0AZT, MMTTY-Groupj + +[V1.62 2001-09-22] +•œ’²Ší‚ÌƒŠƒ~ƒbƒ^‚ÉAGCƒIƒvƒVƒ‡ƒ“‚ð’ljÁ +ƒŠƒ‚[ƒgƒ‚[ƒh‚̉ü‘P (Tnx to K4CY, JK1IQK and MMTTY group) +VFOƒ|[ƒŠƒ“ƒO‚ÉFT1000D‚ð’ljÁ(Tnx to MMTTY group) +VFOƒ|[ƒŠƒ“ƒO‚ÉFT920‚ð’ljÁ(Tnx to MMTTY group) +Turbo Hamlog‚Æ‚ÌƒŠƒAƒ‹ƒ^ƒCƒ€ƒŠƒ“ƒN‚ð’ljÁ(Tnx to JG1MOU) +‚»‚Ì‘¼Aׂ©‚¢ƒoƒO‚ÌC³‚Ɖü‘P + \ No newline at end of file diff --git a/Hamlog5.cpp b/Hamlog5.cpp new file mode 100644 index 0000000..36a8c3c --- /dev/null +++ b/Hamlog5.cpp @@ -0,0 +1,632 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "ComLib.h" +#include "LogFile.h" +#include "Hamlog5.h" +#include "LogConv.h" +//-------------------------------------------- +const LPCSTR g_Hamlog5Key[]={ + "CALLS", "IGN", "DATE", "TIME", "CODE", "GL", "QSL", "FLAG", "HIS", "MY", + "FREQ", "MODE", "NAME", "QTH", "RMK1", "RMK2", NULL +}; +const BYTE g_Hamlog5Len[]={ + 8, 12, 4, 2, 6, 6, 3, 2, 3, 3, + 7, 4, 12, 28, 54, 54, 0 +}; +//-------------------------------------------- +void __fastcall GetHamlog5FieldsLen(AnsiString &as) +{ + as = ""; + for( int i = 8; i < 15; i++ ){ + if( i > 8 ) as += ","; + as += Log.m_LogSet.m_Hamlog5Len[i]; + } +} +//-------------------------------------------- +void __fastcall SetHamlog5FieldsLen(AnsiString &as) +{ + LPSTR pBF = StrDupe(as.c_str()); + LPSTR p, t; + p = pBF; + for( int i = 8; i < 15; i++ ){ + p = StrDlm(t, p); + Log.m_LogSet.m_Hamlog5Len[i] = BYTE(atoin(t, -1)); + } + delete[] pBF; +} +//-------------------------------------------- +//ƒRƒ“ƒXƒgƒ‰ƒNƒ^ +CHamlog5::CHamlog5() +{ + m_fCreate = FALSE; + m_RecMax = 0; // ƒŒƒR[ƒh” + m_FilMax = 0; // ƒtƒB[ƒ‹ƒh” + m_RecWidth = 0; // ƒŒƒR[ƒh‚Ì• + m_FilOff = 0; // ƒwƒbƒ_ƒIƒtƒZƒbƒg + m_bp = NULL; + m_OpenFlag = FALSE; + m_WriteFlag = FALSE; // ‘‚«ž‚݃tƒ‰ƒO +} + +//-------------------------------------------- +//ƒfƒXƒgƒ‰ƒNƒ^ +CHamlog5::~CHamlog5() +{ + Close(); +} + +//-------------------------------------------- +//ƒwƒbƒ_ƒf[ƒ^ƒZƒbƒgƒAƒbƒv +BOOL CHamlog5::SetupHeader(void) +{ + if( fread(&m_Head, 1, sizeof(m_Head), m_fp)!=sizeof(m_Head) ){ + return FALSE; // ˆÙ‚È‚éƒtƒH[ƒ}ƒbƒg + } + + if( (m_Head.Type != 0x03)&&(m_Head.Type != 0x1a ) ) return FALSE; + + m_RecMax = m_Head.RecMax; + m_FilOff = m_Head.FilOff; + m_RecWidth = m_Head.RecWidth; + if( !m_FilOff ) return FALSE; + + hamlog5DBRHD slot; + ULONG fPos; + for( m_FilMax = 0; m_FilMax < HamlogDBMAX; m_FilMax++ ){ + fPos = (32L*m_FilMax)+32L; + if( fPos > ULONG(m_FilOff) ) break; + if( fread(&slot, 1, sizeof(slot), m_fp)!=sizeof(slot) ) break; + if( slot.Name[0] == 0x0d ) break; + slot.Name[10] = 0; + m_StrTable[m_FilMax] = slot.Name; + m_TypeTable[m_FilMax] = slot.Type; + m_LenTable[m_FilMax] = USHORT(slot.Len); + } + for( int i = 8; (i < 15) && (i < m_FilMax); i++ ){ + Log.m_LogSet.m_Hamlog5Len[i] = m_LenTable[i]; + } + +// if( (m_Head.Type == 0x1a) && !m_RecMax ){ +// m_RecMax = (m_fStatus.m_size - ULONG(m_FilOff)) / ULONG(m_RecWidth); +// } + + USHORT i; + USHORT Pos = 1; + for( i = 0; i < m_FilMax; i++ ){ + m_PosTable[i] = Pos; + Pos += m_LenTable[i]; + } + return TRUE; +} + +//-------------------------------------------- +//ƒwƒbƒ_ƒf[ƒ^ì¬ +BOOL CHamlog5::MakeHeader(const LPCSTR _NT[], const BYTE _LT[]) +{ + hamlog5DBRHD slot; + + memset(&m_Head, 0, sizeof(m_Head)); + fseek(m_fp, 0, SEEK_SET); + fwrite(&m_Head, 1, sizeof(m_Head), m_fp); + m_FilOff = sizeof(m_Head); + m_RecWidth = 1; + for( m_FilMax = 0; _LT[m_FilMax]; m_FilMax++ ){ + memset(&slot, 0, sizeof(slot)); + strcpy(slot.Name, _NT[m_FilMax]); + slot.Len = _LT[m_FilMax]; + slot.Type = 'C'; + fwrite(&slot, 1, sizeof(slot), m_fp); + m_PosTable[m_FilMax] = m_RecWidth; + m_RecWidth += USHORT(_LT[m_FilMax]); + m_FilOff += USHORT(sizeof(slot)); + m_StrTable[m_FilMax] = _NT[m_FilMax]; + m_TypeTable[m_FilMax] = 'C'; + m_LenTable[m_FilMax] = USHORT(_LT[m_FilMax]); + } + char Term = 0x0d; + fwrite(&Term, 1, 1, m_fp); + m_FilOff++; + m_Head.Type = 3; + SYSTEMTIME st; + ::GetLocalTime(&st); + m_Head.Year = BYTE(st.wYear % 100); + m_Head.Mon = BYTE(st.wMonth); + m_Head.Day = BYTE(st.wDay); + m_Head.RecMax = 0; + m_Head.FilOff = m_FilOff; + m_Head.RecWidth = m_RecWidth; + fseek(m_fp, 0, SEEK_SET); + fwrite(&m_Head, 1, sizeof(m_Head), m_fp); + return TRUE; +} + +//-------------------------------------------- +//ƒI[ƒvƒ“ +BOOL CHamlog5::Open(LPCSTR Name, BOOL fMsg) +{ + if( (m_OpenFlag == TRUE) ) Close(); + m_WriteFlag = FALSE; // ‘‚«ž‚݃tƒ‰ƒO + if( (m_fp = fopen(Name, "rb")) == NULL ){ + if( fMsg ) ErrorMB("%s‚ªƒI[ƒvƒ“‚Å‚«‚Ü‚¹‚ñ.", Name); + return FALSE; // ƒtƒ@ƒCƒ‹‚ªƒI[ƒvƒ“‚Å‚«‚È‚¢ + } + m_OpenFlag = TRUE; + m_fCreate = FALSE; + if( SetupHeader() == FALSE ){ + Close(); + if( fMsg ) ErrorMB("ƒtƒ@ƒCƒ‹ƒtƒH[ƒ}ƒbƒg‚ª”Fޝ‚Å‚«‚Ü‚¹‚ñ."); + return FALSE; + } + if( m_bp ) delete[] m_bp; + m_bp = new char[m_RecWidth]; + if( Seek(0) == FALSE ){ + Close(); + if( fMsg ) ErrorMB("ƒf[ƒ^[ƒŒƒR[ƒh‚ª‘¶Ý‚µ‚Ü‚¹‚ñ."); + return FALSE; + } + return TRUE; +} + +//-------------------------------------------- +//ƒI[ƒvƒ“ +BOOL CHamlog5::Create(LPCSTR Name) +{ + if( (m_OpenFlag == TRUE) ) Close(); + m_WriteFlag = FALSE; // ‘‚«ž‚݃tƒ‰ƒO + if( (m_fp = fopen(Name, "wb")) == NULL ){ + ErrorMB("%s‚ð쬂ł«‚Ü‚¹‚ñ.", Name); + return FALSE; // ƒtƒ@ƒCƒ‹‚ªƒI[ƒvƒ“‚Å‚«‚È‚¢ + } + m_OpenFlag = TRUE; + m_fCreate = TRUE; + if( MakeHeader(g_Hamlog5Key, Log.m_LogSet.m_Hamlog5Len) == FALSE ){ + Close(); + ErrorMB("%s‚ð쬂ł«‚Ü‚¹‚ñ.", Name); + return FALSE; + } + if( m_bp ) delete[] m_bp; + m_bp = new char[m_RecWidth]; + return TRUE; +} + +//-------------------------------------------- +//ƒNƒ[ƒY +void CHamlog5::Close(void) +{ + if( m_OpenFlag == TRUE ){ + Update(); + if( m_RecMax != m_Head.RecMax ){ // ƒf[ƒ^‚ª’ljÁ‚³‚ê‚Ä‚¢‚é + m_Head.RecMax = m_RecMax; + fseek(m_fp, 0, SEEK_SET); + fwrite(&m_Head, 1, sizeof(m_Head), m_fp); + } + int r = fclose(m_fp); + m_fp = NULL; + if( r && m_fCreate ){ + ErrorMB("ƒtƒ@ƒCƒ‹‚Ì쬂Ɏ¸”s‚µ‚Ü‚µ‚½."); + } + m_OpenFlag = FALSE; + } + if( m_bp != NULL ){ + delete[] m_bp; + m_bp = NULL; + } +} + +//-------------------------------------------- +//ƒŒƒR[ƒhƒV[ƒN +BOOL CHamlog5::Seek(ULONG Index) +{ + if( m_OpenFlag == FALSE ) return FALSE; + if( Update() == FALSE ) return FALSE; + m_Index = Index; + m_Pos = (Index * ULONG(m_RecWidth)) + ULONG(m_FilOff); + fseek(m_fp, m_Pos, SEEK_SET); + if( Index < m_RecMax ){ + if( fread(m_bp, 1, m_RecWidth, m_fp) != ULONG(m_RecWidth) ){ + return FALSE; + } + } + else { + memset(m_bp, ' ', m_RecWidth); + } + return TRUE; +} + +//-------------------------------------------- +//ƒ}[ƒN‚̃`ƒFƒbƒN +BOOL CHamlog5::IsData(void) +{ + return (*m_bp == ' ') ? TRUE : FALSE; +} + +//-------------------------------------------- +//ƒf[ƒ^‚̓ǂݞ‚Ý +BOOL CHamlog5::GetData(USHORT SubIndex, AnsiString &cs) +{ + char bf[1024]; + + if( SubIndex >= m_FilMax ) return FALSE; + + int len = m_LenTable[SubIndex]; + if( len >= 1023 ) len = 1023; + StrCopy(bf, m_bp + m_PosTable[SubIndex], len); + cs = bf; + return TRUE; +} +//-------------------------------------------- +//ƒf[ƒ^‚̓ǂݞ‚Ý +BOOL CHamlog5::GetData(USHORT SubIndex, LPSTR pStore) +{ + if( SubIndex >= m_FilMax ) return FALSE; + + int len = m_LenTable[SubIndex]; + if( len >= 1023 ) len = 1023; + StrCopy(pStore, m_bp + m_PosTable[SubIndex], len); + return TRUE; +} + +//-------------------------------------------- +//ƒf[ƒ^‚̓ǂݞ‚Ý +int CHamlog5::GetData(USHORT SubIndex, LPBYTE pData, int len) +{ + if( SubIndex >= m_FilMax ) return 0; + + int rlen = m_LenTable[SubIndex]; + if( rlen >= 1023 ) rlen = 1023; + if( rlen > len ) rlen = len; + memcpy(pData, m_bp + m_PosTable[SubIndex], rlen); + return rlen; +} + +//-------------------------------------------- +//ƒf[ƒ^‚Ì‘‚«ž‚Ýiƒoƒbƒtƒ@‚ðXV‚·‚é‚Ì‚Ýj +BOOL CHamlog5::SetData(USHORT SubIndex, LPCSTR p) +{ + if( SubIndex >= m_FilMax ) return FALSE; + + int len = m_LenTable[SubIndex]; + LPSTR t; + int i; + for( i = 0, t = m_bp + m_PosTable[SubIndex]; i < len; i++, t++ ){ + if( *p ){ + *t = *p++; + } + else { + *t = ' '; + } + } + m_WriteFlag = TRUE; + return TRUE; +} +//-------------------------------------------- +//ƒf[ƒ^‚Ì‘‚«ž‚Ýiƒoƒbƒtƒ@‚ðXV‚·‚é‚Ì‚Ýj +BOOL CHamlog5::SetBinary(USHORT SubIndex, LPBYTE p) +{ + if( SubIndex >= m_FilMax ) return FALSE; + + int len = m_LenTable[SubIndex]; + LPSTR t; + int i; + for( i = 0, t = m_bp + m_PosTable[SubIndex]; i < len; i++, t++ ){ + *t = *p++; + } + m_WriteFlag = TRUE; + return TRUE; +} + +//-------------------------------------------- +//ƒf[ƒ^‚Ì‘‚«ž‚Ýiƒoƒbƒtƒ@‚Ì“à—e‚𔽉f‚³‚¹‚éj +BOOL CHamlog5::Update(void) +{ + if( m_OpenFlag == FALSE ) return FALSE; + + if( m_WriteFlag == TRUE ){ + m_WriteFlag = FALSE; + fseek(m_fp, m_Pos, SEEK_SET); + fwrite(m_bp, 1, m_RecWidth, m_fp); + if( m_Index >= m_RecMax ){ + m_RecMax++; + } + } + return TRUE; +} +//-------------------------------------------- +//ƒf[ƒ^‚̃fƒR[ƒh +void CHamlog5::DecodeData(SDMMLOG *sp) +{ + memset(sp, 0, sizeof(SDMMLOG)); + char bf[1024]; + + + int YY, MM, DD, HH, mm; + GetData(itemhamlog5DATE, LPBYTE(bf), 4); + YY = bf[1]; + MM = bf[2]; + DD = bf[3]; + GetData(itemhamlog5TIME, LPBYTE(bf), 2); + HH = bf[0]; + mm = bf[1] & 0x7f; + if( bf[1] & 0x80 ){ + UTCtoJST(YY, MM, DD, HH); + } + sp->year = BYTE(YY); + sp->date = WORD(MM * 100 + DD); + sp->btime = WORD(((HH * 60 + mm) * 30)); + if(!sp->btime) sp->btime++; + + USHORT usFlag; // ƒR[ƒ‹ƒTƒCƒ“‚ÌŒ`Ž® + GetData(itemhamlog5FLAG, LPBYTE(&usFlag), sizeof(usFlag)); + + LPSTR t, p; + AnsiString call; + if( (usFlag & bithamlog5DX) && (usFlag & bithamlog5RevOdr) ){ // KH6/JE3HHT + AnsiString Add; + GetData(itemhamlog5IGN, bf); + p = bf; + if( *p != ' ' ){ + p = StrDlm(t, p, ' '); + Add = t; + } + p = SkipSpace(p); + p = StrDlm(t, p, '/'); + call = t; + GetData(itemhamlog5CALLS, bf); clipsp(bf); + if( !call.IsEmpty() ) call += '/'; + call += SkipSpace(bf); + call += Add; + if( *p ){ + call += '/'; + call += p; + } + } + else { // JE3HHT/KH6 + GetData(itemhamlog5CALLS, bf); clipsp(bf); + call = SkipSpace(bf); + GetData(itemhamlog5IGN, bf); + p = bf; + if( *p != ' ' ){ + p = StrDlm(t, p, ' '); + call += t; + } + p = SkipSpace(p); + if( *p ){ + call += '/'; + call += p; + } + } + + StrCopy(sp->call, call.c_str(), MLCALL); + GetData(itemhamlog5HIS, bf); clipsp(bf); + StrCopy(sp->ur, bf, MLRST); + GetData(itemhamlog5MY, bf); clipsp(bf); + StrCopy(sp->my, bf, MLRST); + GetData(itemhamlog5MODE, bf); clipsp(bf); + Log.SetMode(sp, bf); + GetData(itemhamlog5FREQ, bf); clipsp(bf); + Log.SetFreq(sp, bf); + GetData(itemhamlog5NAME, bf); clipsp(bf); + StrCopy(sp->name, bf, MLNAME); + GetData(itemhamlog5QTH, bf); clipsp(bf); + StrCopy(sp->qth, bf, MLQTH); + + GetData(itemhamlog5RMK1, bf); + SetMMLOGKey(sp, bf); + clipsp(bf); + StrCopy(sp->rem, SkipSpace(bf), MLREM); + GetData(itemhamlog5RMK2, bf); + SetMMLOGKey(sp, bf); + clipsp(bf); + StrCopy(sp->qsl, SkipSpace(bf), MLQSL); + GetData(itemhamlog5QSL, LPBYTE(bf), 3); + sprintf(&bf[32], "QSL[%.3s]", bf); + Log.SetOptStr(2, sp, &bf[32]); + if( bf[0] == 'N' ){ + sp->send = 'N'; + } + else if( bf[1] == ' ' ){ // –¢”­‘— + if( (bf[0] == 'J')||(bf[0] == ' ') ){ + sp->send = 0; + } + else { + sp->send = BYTE(tolower(bf[0])); + } + } + else { // ”­‘—Ï‚Ý + sp->send = BYTE(toupper(bf[1])); + } + sp->recv = bf[2]; + if( sp->recv == ' ' ) sp->recv = 0; + GetData(itemhamlog5CODE, LPBYTE(bf), 6); clipsp(bf); + StrCopy(sp->opt1, bf, 6); + GetData(itemhamlog5GL, LPBYTE(bf), 6); clipsp(bf); + StrCopy(sp->opt2, bf, 6); + if( !sp->etime ) sp->etime = sp->btime; +} +//-------------------------------------------- +//ƒf[ƒ^‚̃Gƒ“ƒR[ƒh +void CHamlog5::EncodeData(SDMMLOG *sp) +{ + char bf[1024]; + + int YY = sp->year; + int MM = sp->date / 100; + int DD = sp->date % 100; + int tim = sp->btime / 30; + int HH = tim / 60; + int mm = tim % 60; + switch(Log.m_LogSet.m_THTZ){ + case 0: + if( !IsJA(sp->call) ){ + JSTtoUTC(YY, MM, DD, HH); + mm |= 0x80; + } + break; + case 1: + JSTtoUTC(YY, MM, DD, HH); + mm |= 0x80; + break; + default: + break; + } + bf[0] = BYTE(YY > 50 ? 19 : 20); + bf[1] = BYTE(YY); + bf[2] = BYTE(MM); + bf[3] = BYTE(DD); + SetBinary(itemhamlog5DATE, LPBYTE(bf)); + bf[0] = BYTE(HH); + bf[1] = BYTE(mm); + SetBinary(itemhamlog5TIME, LPBYTE(bf)); + + SetData(itemhamlog5NAME, sp->name); + SetData(itemhamlog5CODE, sp->opt1); + SetData(itemhamlog5GL, sp->opt2); + SetData(itemhamlog5QTH, sp->qth); + strcpy(bf, Log.GetModeString(sp->mode)); + SetData(itemhamlog5MODE, bf); + strcpy(bf, Log.GetFreqString(sp->band, sp->fq)); + SetData(itemhamlog5FREQ, bf); + + SetData(itemhamlog5HIS, sp->ur); + SetData(itemhamlog5MY, sp->my); + + AnsiString REM1, REM2; + REM1 = sp->rem; + REM2 = sp->qsl; + int l = GetLMode(sp->mode); + if( sp->ur[l] ) AddMMLOGKey(REM1, REM2, &sp->ur[l], "SN"); + if( sp->my[l] ) AddMMLOGKey(REM1, REM2, &sp->my[l], "RN"); + + if( sp->etime ){ + tim = sp->etime / 30; + sprintf(bf, "%02u%02u", tim / 60, tim % 60); + AddMMLOGKey(REM1, REM2, bf, "END"); + } + if( sp->env ){ + sprintf(bf, "%u", sp->env); + AddMMLOGKey(REM1, REM2, bf, "ENV"); + } + AddMMLOGKey(REM1, REM2, sp->pow, "POW"); + if( sp->cq ){ + bf[0] = sp->cq; bf[1] = 0; + AddMMLOGKey(REM1, REM2, bf, "M"); + } + strcpy(bf, Log.GetOptStr(2, sp)); + char rbf[32]; + char qsl[3]; + if(RemoveL2(rbf, bf, "QSL", sizeof(rbf)-1) == TRUE){ + qsl[0] = rbf[0]; + qsl[1] = rbf[1]; + qsl[2] = rbf[2]; + } + else { + qsl[2] = sp->recv; + if( !qsl[2] ) qsl[2] = ' '; + if( sp->send == 'N' ){ + qsl[0] = 'N'; + qsl[1] = ' '; + } + else if( !sp->send ){ + qsl[0] = 'J'; + qsl[1] = ' '; + } + else if( (sp->send >= 0x60)||(sp->send == '?') ){ + qsl[0] = BYTE(toupper(sp->send)); + qsl[1] = ' '; + } + else if( isalpha(sp->send) ){ + qsl[0] = sp->send; + qsl[1] = '*'; + } + else { + qsl[0] = 'J'; + qsl[1] = sp->send; + } + } + SetData(itemhamlog5QSL, qsl); + SetData(itemhamlog5RMK1, REM1.c_str()); + SetData(itemhamlog5RMK2, REM2.c_str()); + + BOOL fJA = IsJA(sp->call); + USHORT usFlag = USHORT(fJA ? 0 : bithamlog5DX); + AnsiString Calls, Ign; + strcpy(bf, sp->call); + LPSTR pp, p2, t; + t = bf; + if( (pp = strchr(bf, '/')) != NULL ){ // KH6/JE3HHT or JE3HHT/KH6 ‚ÌŒ`Ž® + *pp = 0; + pp++; + int LenC = strlen(t); + int LenP = strlen(pp); + if( (p2 = strchr(pp, '/')) != NULL ){ // KH6/JE3HHT/P JE3HHT/QRP/3 + // t = KH6, pp = JE3HHT, p2 = P + *p2 = 0; p2++; + if( fJA ){ + Calls = t; + Ign = pp; + Ign += "/"; + Ign += p2; + } + else { + Calls = pp; + Ign = t; + Ign += "/"; + Ign += p2; + usFlag |= bithamlog5RevOdr; + } + } + else { + if( LenC < LenP ){ + Calls = pp; + Ign = t; + if( usFlag ) usFlag |= bithamlog5RevOdr; + } + else { + Calls = t; + Ign = pp; + if( usFlag ) usFlag |= bithamlog5NorOdr; + } + } + } + else { + Calls = sp->call; + } + SetBinary(itemhamlog5FLAG, LPBYTE(&usFlag)); + SetData(itemhamlog5CALLS, Calls.c_str()); + LPCSTR pCall = Calls.c_str(); + memset(bf, ' ', 12); bf[13] = 0; + l = strlen(pCall); + if( l > 8 ){ + pCall += 8; + l -= 8; + memcpy(bf, pCall, l); + } + l = strlen(Ign.c_str()); + if( l ){ + if( l > 12 ) l = 12; + memcpy(&bf[12 - l], Ign.c_str(), l); + } + SetData(itemhamlog5IGN, bf); +} + diff --git a/Hamlog5.h b/Hamlog5.h new file mode 100644 index 0000000..4f26a1a --- /dev/null +++ b/Hamlog5.h @@ -0,0 +1,119 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +#ifndef Hamlog5H +#define Hamlog5H + +// MMQSL—pHamlog Ver5‚̃hƒ‰ƒCƒo + +#include "ComLib.h" +#include "LogFile.h" +extern const LPCSTR g_Hamlog5Key[]; +extern const BYTE g_Hamlog5Len[]; + +typedef enum { + itemhamlog5CALLS, + itemhamlog5IGN, + itemhamlog5DATE, + itemhamlog5TIME, + itemhamlog5CODE, + itemhamlog5GL, + itemhamlog5QSL, + itemhamlog5FLAG, + itemhamlog5HIS, + itemhamlog5MY, + itemhamlog5FREQ, + itemhamlog5MODE, + itemhamlog5NAME, + itemhamlog5QTH, + itemhamlog5RMK1, + itemhamlog5RMK2, +}HAMLOG5_ITEMS; + +#define bithamlog5DX 8 +#define bithamlog5NorOdr 1 +#define bithamlog5RevOdr 2 + +#pragma pack(1) +typedef struct { + BYTE Type; + BYTE Year; + BYTE Mon; + BYTE Day; + ULONG RecMax; + USHORT FilOff; + USHORT RecWidth; + BYTE dm1[20]; +}hamlog5DBHD; +typedef struct { + char Name[11]; + BYTE Type; + BYTE dm1[4]; + BYTE Len; + BYTE dm2[15]; +}hamlog5DBRHD; +#pragma pack() + +#define HamlogDBMAX 16 +class CHamlog5 +{ +private: + BOOL m_fCreate; + hamlog5DBHD m_Head; // ƒwƒbƒ_î•ñ + ULONG m_RecMax; // ƒŒƒR[ƒh” + USHORT m_FilMax; // ƒtƒB[ƒ‹ƒh” + USHORT m_RecWidth; // ƒŒƒR[ƒh‚Ì• + USHORT m_FilOff; // ƒwƒbƒ_ƒIƒtƒZƒbƒg + FILE *m_fp; + AnsiString m_StrTable[HamlogDBMAX]; // ƒe[ƒuƒ‹–¼‚Ì”z—ñ + USHORT m_PosTable[HamlogDBMAX]; // ƒtƒB[ƒ‹ƒhˆÊ’u‚Ì”z—ñ + USHORT m_LenTable[HamlogDBMAX]; // ƒtƒB[ƒ‹ƒh’·‚³‚Ì”z—ñ + char m_TypeTable[HamlogDBMAX]; // Œ^î•ñ‚Ì”z—ñ + BOOL m_OpenFlag; // ƒtƒ@ƒCƒ‹ƒI[ƒvƒ“ƒtƒ‰ƒO + + ULONG m_Index; // ƒV[ƒNŽž‚̃Cƒ“ƒfƒbƒNƒX + ULONG m_Pos; // ƒV[ƒNŽž‚̃tƒ@ƒCƒ‹ˆÊ’u + LPSTR m_bp; // ƒoƒbƒtƒ@‚̃|ƒCƒ“ƒ^ + BOOL m_WriteFlag; // ‘‚«ž‚݃tƒ‰ƒO + BOOL SetupHeader(void); // ƒwƒbƒ_ƒZƒbƒgƒAƒbƒv + BOOL MakeHeader(const LPCSTR _NT[], const BYTE _LT[]); +public: + CHamlog5(); + ~CHamlog5(); + BOOL Open(LPCSTR Name, BOOL fMsg); + BOOL Create(LPCSTR Name); + void Close(void); + inline ULONG GetRCount(void){return m_RecMax;}; + inline USHORT GetFCount(void){return m_FilMax;}; + AnsiString *GetStrBase(void){return m_StrTable;}; + BOOL Seek(ULONG Index); + BOOL IsData(void); + BOOL GetData(USHORT SubIndex, AnsiString &cs); + BOOL GetData(USHORT SubIndex, LPSTR pStore); + BOOL SetData(USHORT SubIndex, LPCSTR p); + BOOL SetBinary(USHORT SubIndex, LPBYTE p); + int GetData(USHORT SubIndex, LPBYTE pData, int len); + BOOL Update(void); + void DecodeData(SDMMLOG *sp); + void EncodeData(SDMMLOG *sp); +}; + +void __fastcall GetHamlog5FieldsLen(AnsiString &as); +void __fastcall SetHamlog5FieldsLen(AnsiString &as); +#endif diff --git a/InputWin.cpp b/InputWin.cpp new file mode 100644 index 0000000..1c0d0ec --- /dev/null +++ b/InputWin.cpp @@ -0,0 +1,70 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "InputWin.h" +//--------------------------------------------------------------------- +#pragma resource "*.dfm" +//--------------------------------------------------------------------- +__fastcall TInputWinDlg::TInputWinDlg(TComponent* AOwner) + : TForm(AOwner) +{ + if( AOwner == NULL ) return; + FormStyle = ((TForm *)AOwner)->FormStyle; + Font->Name = ((TForm *)AOwner)->Font->Name; + Font->Charset = ((TForm *)AOwner)->Font->Charset; + if( Font->Charset != SHIFTJIS_CHARSET ){ + CancelBtn->Caption = "Cancel"; + } +} + +//--------------------------------------------------------------------- +int InputMB(LPCSTR pTitle, LPCSTR pMsg, AnsiString &as) +{ + TForm *fp; + if( Screen->ActiveForm != NULL ){ + fp = Screen->ActiveForm; + } + else if( Application->MainForm != NULL ){ + fp = Application->MainForm; + } + else { + fp = NULL; + } + + TInputWinDlg *pBox = new TInputWinDlg(fp); + pBox->LMsg->Caption = pMsg; + pBox->Caption = pTitle; + pBox->Edit->Text = as.c_str(); + int r = FALSE; + if( pBox->ShowModal() == IDOK ){ + as = pBox->Edit->Text.c_str(); + r = TRUE; + } + delete pBox; + return r; +} +//--------------------------------------------------------------------- + + + + diff --git a/InputWin.dfm b/InputWin.dfm new file mode 100644 index 0000000..b355eff Binary files /dev/null and b/InputWin.dfm differ diff --git a/InputWin.h b/InputWin.h new file mode 100644 index 0000000..b7f08bc --- /dev/null +++ b/InputWin.h @@ -0,0 +1,50 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//---------------------------------------------------------------------------- +#ifndef InputWinH +#define InputWinH +//---------------------------------------------------------------------------- +//JA7UDE 0427 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//---------------------------------------------------------------------------- +class TInputWinDlg : public TForm +{ +__published: + TButton *OKBtn; + TButton *CancelBtn; + TEdit *Edit; + TLabel *LMsg; +private: +public: + virtual __fastcall TInputWinDlg(TComponent* AOwner); +}; +int InputMB(LPCSTR pTitle, LPCSTR pMsg, AnsiString &as); +//---------------------------------------------------------------------------- +//---------------------------------------------------------------------------- +#endif diff --git a/LogConv.cpp b/LogConv.cpp new file mode 100644 index 0000000..5144f51 --- /dev/null +++ b/LogConv.cpp @@ -0,0 +1,2232 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------------- +#include +#pragma hdrstop + +#include +#include "LogConv.h" +#include "country.h" +//#include "main.h" +#include "InputWin.h" +CLogText LogText; +//*************************************************************************** +// CLogConv Šî–{ ƒNƒ‰ƒX +CLogConv::CLogConv() +{ + m_Mode = 0; + m_fp = NULL; +} + +CLogConv::~CLogConv() +{ +} +//*************************************************************************** +// CLogText ƒNƒ‰ƒX +CLogText::CLogText() +{ + m_Type = 0; + m_Double = 0; + m_Delm = 0; + m_err = 0; + m_UTC = (lcid != LANG_JAPANESE) ? 1 : 0; + int i; + for( i = 0; i < TEXTCONVMAX; i++ ){ + m_tConv[i].Key = ""; + m_tConv[i].w = 0; + } + m_tConv[0].Key = "%YYYY-MM-DD"; + m_tConv[1].Key = "%HHMM"; + m_tConv[2].Key = "%EHHMM"; + m_tConv[3].Key = "%CALL"; + m_tConv[4].Key = "%HIS"; + m_tConv[5].Key = "%MY"; + m_tConv[6].Key = "%FREQ"; + m_tConv[7].Key = "%MODE"; + m_tConv[8].Key = "%POWER"; + m_tConv[9].Key = "%NAME"; + m_tConv[10].Key = "%QTH"; + m_tConv[11].Key = "%REM"; + m_tConv[12].Key = "%QSL"; + m_tConv[13].Key = "%S"; + m_tConv[14].Key = "%R"; + m_tConv[15].Key = "%EOD"; + for( i = 0; i < TEXTCONVMAX; i++ ){ + m_rConv[i] = m_tConv[i]; + } +} +//--------------------------------------------------------------------------- +// ƒeƒLƒXƒgƒtƒ@ƒCƒ‹‚̃I[ƒvƒ“ +int CLogText::Open(LPCSTR pName) +{ + Close(); + m_Mode = 0; + m_err = 0; + + m_fp = fopen(pName, "rt"); + + if( m_fp != NULL ){ + setvbuf(m_fp, NULL, _IOFBF, 16384); + m_FileName = pName; + m_Mode = 0; + return TRUE; + } + else { + ErrorMB( (sys.m_WinFontCharset!= SHIFTJIS_CHARSET) ? "Can't open '%s'":"'%s'‚ªƒI[ƒvƒ“‚Å‚«‚Ü‚¹‚ñ.", pName); + return FALSE; + } +} +//--------------------------------------------------------------------------- +// ƒeƒLƒXƒgƒtƒ@ƒCƒ‹‚Ìì¬ +int CLogText::Create(LPCSTR pName) +{ + Close(); + m_Mode = 1; + + m_fp = fopen(pName, "wt"); + if( m_fp != NULL ){ + setvbuf(m_fp, NULL, _IOFBF, 16384); + m_FileName = pName; + m_Mode = 0; + return TRUE; + } + else { + ErrorMB( (sys.m_WinFontCharset!= SHIFTJIS_CHARSET) ? "Can't write to '%s'":"'%s'‚ªì¬‚Å‚«‚Ü‚¹‚ñ.", pName); + return FALSE; + } +} +//--------------------------------------------------------------------------- +// ƒeƒLƒXƒgƒtƒ@ƒCƒ‹‚̃I[ƒvƒ“ +int CLogText::Close(void) +{ + int r = 0; + if( m_fp != NULL ){ + r = fclose(m_fp); + m_fp = NULL; + if( r ){ + ErrorMB((sys.m_WinFontCharset!= SHIFTJIS_CHARSET) ? "Can't close '%s'":"'%s'‚ª³‚µ‚­ƒNƒ[ƒY‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½.", m_FileName.c_str()); + } + else if( m_Mode ){ + InfoMB((sys.m_WinFontCharset!= SHIFTJIS_CHARSET) ? "Done (write to '%s')":"'%s'‚Ö‚Ì‘‚«‚±‚Ý‚ðI—¹‚µ‚Ü‚µ‚½.", m_FileName.c_str()); + } + } + return r ? FALSE : TRUE; +} +//--------------------------------------------------------------------------- +// ƒeƒLƒXƒgƒtƒ@ƒCƒ‹‚̓ǂÝo‚µ +int CLogText::Read(SDMMLOG *sp) +{ + if( !IsOpen() ) return FALSE; + + if( !feof(m_fp) ){ + if( fgets(m_bf, sizeof(m_bf), m_fp) != NULL ){ + ClipLF(m_bf); + return Text2MMLOG(sp, m_bf, m_err); + } + else { + return FALSE; + } + } + else { + return FALSE; + } +} +//--------------------------------------------------------------------------- +// o—͕ϊ· +int CLogText::Write(SDMMLOG *sp) +{ + if( !IsOpen() ) return FALSE; + + MMLOG2Text(m_bf, sp); + fputs(m_bf, m_fp); + fputs("\n", m_fp); + return ferror(m_fp) ? FALSE : TRUE; +} + +const LPCSTR ConvTbl[]={ + "%NULL", + "%YYYY-MM-DD", "%YY-MM-DD", "%YYYY/MM/DD", "%YY/MM/DD", + "%DD MON, YYYY","%YYMMDD", "%YYYYMMDD", + "%YY", "%YYYY", "%MM", "%MON", "%MON2", "%DD", "%HHMM", "%HH:MM","%HH:MM:SS", + "%EHHMM", "%EHH:MM", "%EHH:MM:SS", "%CALL", + "%M", "%MY", "%HIS", "%MYRST", "%HISRST", "%MYNR", "%HISNR", "%FREQ", "%KHZ", + "%MBAND", "%MODE", "%POWER", "%NAME", "%QTH", "%REM", "%QSL", + "%S", "%R", "%ENV", "%OPT1", "%OPT2", "%USR1", "%USR2", + "%EOD", + NULL, +}; + +const char *MONT1[]={"","JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"}; +const char *MONT2[]={"","Jan.","Feb.","Mar.","Apr.","May","June","July","Aug.","Sept.","Oct.","Nov.","Dec."}; + +//--------------------------------------------------------------------------- +void MMLOG2Text(LPSTR t, SDMMLOG *sp, AnsiString &Key) +{ + int tim, l; + + if( Key == "%YYYY-MM-DD" ){ + sprintf(t, "%04u-%02u-%02u", YEAR(sp->year), sp->date/100, sp->date%100); + } + else if( Key == "%YY-MM-DD" ){ + sprintf(t, "%2u-%02u-%02u", sp->year, sp->date/100, sp->date%100); + } + else if( Key == "%YYYY/MM/DD" ){ + sprintf(t, "%04u/%02u/%02u", YEAR(sp->year), sp->date/100, sp->date%100); + } + else if( Key == "%YY/MM/DD" ){ + sprintf(t, "%2u/%02u/%02u", sp->year, sp->date/100, sp->date%100); + } + else if( Key == "%DD MON, YYYY" ){ + sprintf(t, "%02u %s, %04u", sp->date%100, MONT1[sp->date/100], YEAR(sp->year)); + } + else if( Key == "%YYYYMMDD" ){ + sprintf(t, "%04u%02u%02u", YEAR(sp->year), sp->date/100, sp->date%100); + } + else if( Key == "%YYMMDD" ){ + sprintf(t, "%02u%02u%02u", sp->year, sp->date/100, sp->date%100); + } + else if( Key == "%YY" ){ + sprintf(t, "%02u", sp->year); + } + else if( Key == "%YYYY" ){ + sprintf(t, "%04u", YEAR(sp->year)); + } + else if( Key == "%MM" ){ + sprintf(t, "%02u", sp->date / 100); + } + else if( Key == "%MON" ){ + strcpy(t, MONT1[sp->date/100]); + } + else if( Key == "%MON2" ){ + strcpy(t, MONT2[sp->date/100]); + } + else if( Key == "%DD" ){ + sprintf(t, "%02u", sp->date % 100); + } + else if( Key == "%HHMM" ){ + if( sp->btime ){ + tim = sp->btime / 30; + sprintf(t, "%02u%02u", tim / 60, tim % 60); + } + else { + *t = 0; + } + } + else if( Key == "%HH:MM" ){ + if( sp->btime ){ + tim = sp->btime / 30; + sprintf(t, "%02u:%02u", tim / 60, tim % 60); + } + else { + *t = 0; + } + } + else if( Key == "%HH:MM:SS" ){ + if( sp->btime ){ + tim = sp->btime / 30; + sprintf(t, "%02u:%02u:%02u", tim / 60, tim % 60, (sp->btime * 2) % 60); + } + else { + *t = 0; + } + } + else if( Key == "%EHHMM" ){ + if( sp->etime ){ + tim = sp->etime / 30; + sprintf(t, "%02u%02u", tim / 60, tim % 60); + } + else { + *t = 0; + } + } + else if( Key == "%EHH:MM" ){ + if( sp->etime ){ + tim = sp->btime / 30; + sprintf(t, "%02u:%02u", tim / 60, tim % 60); + } + else { + *t = 0; + } + } + else if( Key == "%EHH:MM:SS" ){ + if( sp->etime ){ + tim = sp->btime / 30; + sprintf(t, "%02u:%02u:%02u", tim / 60, tim % 60, (sp->etime * 2) % 60); + } + else { + *t = 0; + } + } + else if( Key == "%CALL" ){ + strcpy(t, sp->call); + } + else if( Key == "%M" ){ + *t = sp->send; + *(t+1) = 0; + } + else if( Key == "%HIS" ){ + strcpy(t, sp->ur); + } + else if( Key == "%MY" ){ + strcpy(t, sp->my); + } + else if( Key == "%HISRST" ){ + StrCopy(t, sp->ur, GetLMode(sp->mode)); + } + else if( Key == "%MYRST" ){ + StrCopy(t, sp->my, GetLMode(sp->mode)); + } + else if( Key == "%HISNR" ){ + l = GetLMode(sp->mode); + if( (int)strlen(sp->ur) >= l ){ + strcpy(t, &sp->ur[l]); + } + else { + *t = 0; + } + } + else if( Key == "%MYNR" ){ + l = GetLMode(sp->mode); + if( (int)strlen(sp->my) >= l ){ + strcpy(t, &sp->my[l]); + } + else { + *t = 0; + } + } + else if( Key == "%FREQ" ){ + strcpy(t, Log.GetFreqString(sp->band, sp->fq)); + } + else if( Key == "%MBAND" ){ + strcpy(t, FreqTomBand(sp)); + } + else if( Key == "%KHZ" ){ + char bf[32]; + double dd; + strcpy(bf, Log.GetFreqString(sp->band, sp->fq)); + sscanf(bf, "%lf", &dd); + sprintf(t, "%.2lf", dd * 1000.0); + } + else if( Key == "%MODE" ){ + strcpy(t, Log.GetModeString(sp->mode)); + } + else if( Key == "%POWER" ){ + strcpy(t, sp->pow); + } + else if( Key == "%NAME" ){ + strcpy(t, sp->name); + } + else if( Key == "%QTH" ){ + strcpy(t, sp->qth); + } + else if( Key == "%REM" ){ + strcpy(t, sp->rem); + } + else if( Key == "%QSL" ){ + strcpy(t, sp->qsl); + } + else if( Key == "%S" ){ + *t = sp->send; + *(t+1) = 0; + } + else if( Key == "%R" ){ + *t = sp->recv; + *(t+1) = 0; + } + else if( Key == "%ENV" ){ + sprintf(t, "%u", sp->env); + } + else if( Key == "%OPT1" ){ + strcpy(t, sp->opt1); + } + else if( Key == "%OPT2" ){ + strcpy(t, sp->opt2); + } + else if( Key == "%USR1" ){ + strcpy(t, Log.GetOptStr(2, sp)); + } + else if( Key == "%USR2" ){ + strcpy(t, Log.GetOptStr(3, sp)); + } + else if( (Key == "%EOD")||(Key == "%NULL") ){ + *t = 0; + } + else { + strcpy(t, Key.c_str()); + } +} +//--------------------------------------------------------------------------- +// 1s‚Ìo—͕ϊ· +void CLogText::MMLOG2Text(LPSTR t, SDMMLOG *sp) +{ + char bf[512]; + char dlm = m_Delm ? TAB : ','; + + if( m_UTC ) JSTtoUTC(sp); + int i; + for( i = 0; i < TEXTCONVMAX; i++ ){ + if( (!m_tConv[i].Key.IsEmpty())&&(m_tConv[i].Key != "%EOD") ){ + ::MMLOG2Text(bf, sp, m_tConv[i].Key); + switch(m_Delm){ + case 0: // CSV + case 1: // TAB + if( i ) *t++ = dlm; + if( m_Double || (strchr(bf, dlm) != NULL) ) *t++ = 0x22; + if( m_tConv[i].w ){ + StrCopy(t, bf, m_tConv[i].w); + } + else { + strcpy(t, bf); + } + t += strlen(t); + if( m_Double || (strchr(bf, dlm) != NULL) ) *t++ = 0x22; + break; + default: // Format Text + if( m_tConv[i].w ){ + StrCopy(t, bf, m_tConv[i].w); + FillSpace(t, m_tConv[i].w); + } + else { + strcpy(t, bf); + } + t += strlen(t); + break; + } + } + else { + break; + } + } + *t = 0; +} +//--------------------------------------------------------------------------- +int GetMonth(LPCSTR p) +{ + for( int i = 1; i <=12; i++ ){ + if( !strcmpi(MONT1[i], p) ) return i; + if( !strcmpi(MONT2[i], p) ) return i; + } + return 0; +} +//--------------------------------------------------------------------------- +int Text2MMLOG(SDMMLOG *sp, LPCSTR s, AnsiString &Key) +{ + int y, m, d, h; + int tim; + + if( (Key == "%YYYY-MM-DD")||(Key == "%YY-MM-DD") ){ + if( sscanf(s, "%u-%u-%u", &y, &m, &d) != 3 ) return FALSE; + sp->year = BYTE(y % 100); + sp->date = WORD(m * 100 + d); + } + else if( (Key == "%YYYY/MM/DD")||(Key == "%YY/MM/DD") ){ + if( sscanf(s, "%u/%u/%u", &y, &m, &d) != 3 ) return FALSE; + sp->year = BYTE(y % 100); + sp->date = WORD(m * 100 + d); + } + else if( Key == "%DD MON, YYYY" ){ + d = atoin(s, 2); + s += 3; + char bf[4]; + StrCopy(bf, s, 3); + m = GetMonth(bf); + s = SkipSpace(s+1); + y = atoin(s, -1); + sp->year = BYTE(y % 100); + sp->date = WORD(m * 100 + d); + } + else if( Key == "%YYYYMMDD" ){ + y = atoin(s, 4); s += 4; + m = atoin(s, 2); s += 2; + d = atoin(s, 2); + sp->year = BYTE(y % 100); + sp->date = WORD(m * 100 + d); + } + else if( Key == "%YYMMDD" ){ + y = atoin(s, 2); s += 2; + m = atoin(s, 2); s += 2; + d = atoin(s, 2); + sp->year = BYTE(y % 100); + sp->date = WORD(m * 100 + d); + } + else if( (Key == "%YY")||(Key == "%YYYY") ){ + if( sscanf(s, "%u", &y) != 1 ) return FALSE; + sp->year = BYTE(y % 100); + } + else if( Key == "%MM" ){ + if( sscanf(s, "%u", &m) != 1 ) return FALSE; + sp->date = WORD((sp->date % 100) + m * 100); + } + else if( (Key == "%MON")||(Key == "%MON2") ){ + m = GetMonth(s); + sp->date = WORD((sp->date % 100) + m * 100); + } + else if( Key == "%DD" ){ + if( sscanf(s, "%u", &d) != 1 ) return FALSE; + sp->date = WORD(((sp->date / 100) * 100) + d); + } + else if( Key == "%HHMM" ){ + if( *s ){ + if( sscanf(s, "%u", &d) != 1 ) return FALSE; + h = d / 100; + m = d % 100; + tim = (h * 60 + m) * 30; + if( !tim ) tim++; + sp->btime = WORD(tim); + } + } + else if( (Key == "%HH:MM")||(Key == "%HH:MM:SS") ){ + if( *s ){ + if( sscanf(s, "%u:%u:%u", &h, &m, &d ) != 3 ){ + d = 0; + if( sscanf(s, "%u:%u", &h, &m) != 2 ) return FALSE; + } + tim = (h * 60 + m) * 30 + (d / 2); + if( !tim ) tim++; + sp->btime = WORD(tim); + } + } + else if( Key == "%EHHMM" ){ + if( *s ){ + if( sscanf(s, "%u", &d) != 1 ) return FALSE; + h = d / 100; + m = d % 100; + tim = (h * 60 + m) * 30; + if( !tim ) tim++; + sp->etime = WORD(tim); + } + } + else if( (Key == "%EHH:MM")||(Key == "%EHH:MM:SS") ){ + if( *s ){ + if( sscanf(s, "%u:%u:%u", &h, &m, &d ) != 3 ){ + d = 0; + if( sscanf(s, "%u:%u", &h, &m) != 2 ) return FALSE; + } + tim = (h * 60 + m) * 30 + (d / 2); + if( !tim ) tim++; + sp->etime = WORD(tim); + } + } + else if( Key == "%CALL" ){ + if( sp->call[0] ){ + char bf[256]; + sprintf(bf, "%s/%s", sp->call, s); + StrCopy(sp->call, bf, MLCALL); + } + else { + StrCopy(sp->call, s, MLCALL); + } + } + else if( Key == "%M" ){ + sp->send = *s; + } + else if( (Key == "%HIS")||(Key == "%HISRST") ){ + StrCopy(sp->ur, s, MLRST); + } + else if( (Key == "%MY")||(Key=="%MYRST") ){ + StrCopy(sp->my, s, MLRST); + } + else if( Key == "%FREQ" ){ + Log.SetFreq(sp, s); + } + else if( Key == "%MBAND" ){ + mBandToBand(sp, s); + } + else if( Key == "%KHZ" ){ + double dd; + sscanf(s, "%lf", &dd); + char bf[32]; + sprintf(bf, "%.03lf", dd / 1000.0); + Log.SetFreq(sp, bf); + } + else if( Key == "%MODE" ){ + Log.SetMode(sp, s); + } + else if( Key == "%POWER" ){ + StrCopy(sp->pow, s, MLPOW); + } + else if( Key == "%NAME" ){ + StrCopy(sp->name, s, MLNAME); + } + else if( Key == "%QTH" ){ + StrCopy(sp->qth, s, MLQTH); + } + else if( Key == "%REM" ){ + StrCopy(sp->rem, s, MLREM); + } + else if( Key == "%QSL" ){ + StrCopy(sp->qsl, s, MLQSL); + } + else if( Key == "%S" ){ + sp->send = *s; + } + else if( Key == "%R" ){ + sp->recv = *s; + } + else if( Key == "%ENV" ){ + if( sscanf(s, "%u", &d) != 1 ) return FALSE; + sp->env = WORD(d); + } + else if( Key == "%OPT1" ){ + StrCopy(sp->opt1, s, MLOPT); + } + else if( Key == "%OPT2" ){ + StrCopy(sp->opt2, s, MLOPT); + } + else if( Key == "%USR1" ){ + Log.SetOptStr(2, sp, s); + } + else if( Key == "%USR2" ){ + Log.SetOptStr(3, sp, s); + } + else if( (Key != "%EOD")&&(Key != "%NULL") ){ + if( Key != s ){ + return FALSE; + } + } + return TRUE; +} +//--------------------------------------------------------------------------- +// 1s‚Ì“ü—͕ϊ· +int CLogText::Text2MMLOG(SDMMLOG *sp, LPSTR p, int &err) +{ + char bf[512]; + char dlm = m_Delm ? TAB : ','; + LPSTR t; + + memset(sp, 0, sizeof(SDMMLOG)); + int i; + for( i = 0; i < TEXTCONVMAX; i++ ){ + if( (!m_rConv[i].Key.IsEmpty())&&(m_rConv[i].Key != "%EOD") ){ + if( m_Delm == 2 ){ + StrCopy(bf, p, m_rConv[i].w); + p += strlen(bf); + t = bf; + } + else { + p = StrDlm(t, p, dlm); + } + clipsp(t); + t = SkipSpace(t); + if( ::Text2MMLOG(sp, t, m_rConv[i].Key ) == FALSE ){ + if( !err ){ + ErrorMB((sys.m_WinFontCharset!= SHIFTJIS_CHARSET) ? "An error occurred with conversion type [%s]." : "•ÏŠ·Ž®[%s]‚ŃGƒ‰[‚ª”­¶‚µ‚Ü‚µ‚½.", m_rConv[i].Key.c_str() ); + } + err++; + } + } + else { + break; + } + } + if( !sp->etime ) sp->etime = sp->btime; + if( m_UTC ) UTCtoJST(sp); + return err ? FALSE : TRUE; +} +// +// +//*************************************************************************** +// CLog200 ƒNƒ‰ƒX +CLog200::CLog200() +{ + m_Type = 1; + m_err = 0; +} +//--------------------------------------------------------------------------- +// LOG200ƒtƒ@ƒCƒ‹‚̃I[ƒvƒ“ +int CLog200::Open(LPCSTR pName) +{ + Close(); + m_Index = 0; + m_err = 0; + + m_fp = fopen(pName, "rb"); + if( m_fp != NULL ){ + m_FileName = pName; + m_Mode = 0; + return TRUE; + } + else { + ErrorMB("'%s'‚ªƒI[ƒvƒ“‚Å‚«‚Ü‚¹‚ñ.", pName); + return FALSE; + } +} +//--------------------------------------------------------------------------- +// LOG200ƒtƒ@ƒCƒ‹‚Ìì¬ +int CLog200::Create(LPCSTR pName) +{ + Close(); + m_Mode = 1; + m_err = 0; + + int add = 0; + if( (m_fp = fopen(pName, "rb"))!=NULL ){ + fclose(m_fp); + m_fp = NULL; + add = 1; + char BackName[256]; + strcpy(BackName, pName); + SetEXT(BackName, ".BAK"); + int r = YesNoCancelMB( "'%s'‚ÍŠù‚É‘¶Ý‚µ‚Ä‚¢‚Ü‚·.\r\n‚l‚l‚s‚s‚x‚Í‚±‚̃tƒ@ƒCƒ‹‚Ƀf[ƒ^‚ð’ljÁ‚µ‚Ü‚·.\r\n\r\n" + "‚±‚Ì‘€ì‚ðŽÀs‚·‚é‘O‚ÉŒ³‚̃ƒOƒtƒ@ƒCƒ‹‚̃oƒbƒNƒAƒbƒvƒtƒ@ƒCƒ‹\r\n\r\n" + "'%s' -> '%s'\r\n\r\n‚ð쬂µ‚Ü‚·‚©H\r\n\r\n" + "[d—v]\r\n”O‚Ì‚½‚߂ɃoƒbƒNƒAƒbƒv‚ð쬂·‚鎖‚ð‚¨Š©‚ß‚µ‚Ü‚·.", pName, pName, BackName); + if( r == IDYES ){ + CWaitCursor w; + if( ::CopyFile(pName, BackName, FALSE) == FALSE ){ + ErrorMB("ƒoƒbƒNƒAƒbƒv‚Ì쬂Ɏ¸”s‚µ‚Ü‚µ‚½.\r\n‚±‚̈—‚Í’†’f‚³‚ê‚Ü‚·.Œ³‚̃ƒOƒtƒ@ƒCƒ‹‚Í•ÏX‚³‚ê‚Ü‚¹‚ñ."); + return FALSE; + } + } + else if( r == IDCANCEL ){ + return FALSE; + } + } + m_fp = fopen(pName, add ? "ab":"wb"); + if( m_fp != NULL ){ + m_FileName = pName; + m_Mode = 0; + return TRUE; + } + else { + ErrorMB( "'%s'‚ªì¬‚Å‚«‚Ü‚¹‚ñ.", pName); + return FALSE; + } +} +//--------------------------------------------------------------------------- +// LOG200ƒtƒ@ƒCƒ‹‚̃Nƒ[ƒY +int CLog200::Close(void) +{ + int r = 0; + if( m_fp != NULL ){ + r = fclose(m_fp); + m_fp = NULL; + if( r ){ + ErrorMB("'%s'‚ª³‚µ‚­ƒNƒ[ƒY‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½.", m_FileName.c_str()); + } + else if( m_Mode ){ + InfoMB("'%s'‚ւ̒ljÁ‚ðI—¹‚µ‚Ü‚µ‚½.", m_FileName.c_str()); + } + } + return r ? FALSE : TRUE; +} +//--------------------------------------------------------------------------- +// LOG200 -> MMLOG ƒtƒH[ƒ}ƒbƒg‚̕ϊ· +void LOG200toMMLOG(SDMMLOG *sp, LPSTR s) +{ + LPSTR t; + int y, m, d, h, tim; + char bf[256]; + + memset(sp, 0, sizeof(SDMMLOG)); + s = StrDlm(t, s, 0x1e); /* DATE */ + y = atoin(t, 2); t += 2; + m = atoin(t, 2); t += 2; + d = atoin(t, 2); + sp->year = BYTE(y % 100); + sp->date = WORD(m * 100 + d); + + s = StrDlm(t, s, 0x1e); /* BGN */ + d = atoin(t, 4); + h = d / 100; + m = d % 100; + tim = (h * 60 + m) * 30; + if( !tim ) tim++; + sp->btime = WORD(tim); + + s = StrDlm(t, s, 0x1e); /* END */ + d = atoin(t, 4); + h = d / 100; + m = d % 100; + tim = (h * 60 + m) * 30; + if( !tim ) tim++; + sp->etime = WORD(tim); + + s = StrDlm(t, s, 0x1e); /* CALL */ + clipsp(t); + StrCopy(sp->call, t, MLCALL); + + s = StrDlm(t, s, 0x1e); /* FREQ */ + if( LastC(t) == '.' ){ + *lastp(t) = 0; + } + Log.SetFreq(sp, t); + + s = StrDlm(t, s, 0x1e); /* MODE */ + Log.SetMode(sp, t); + + s = StrDlm(t, s, 0x1e); /* RST */ + clipsp(t); + StrCopy(sp->ur, t, MLRST); + + s = StrDlm(t, s, 0x1e); /* MyRST*/ + clipsp(t); + StrCopy(sp->my, t, MLRST); + + s = StrDlm(t, s, 0x1e); /* QTH */ + clipsp(t); + StrCopy(sp->qth, t, MLQTH); + + s = StrDlm(t, s, 0x1e); /* NAME */ + clipsp(t); + StrCopy(sp->name, t, MLNAME); + + s = StrDlm(t, s, 0x1e); /* RIG */ + clipsp(t); + LPSTR pRIG = t; + + s = StrDlm(t, s, 0x1e); /* CONTEST */ + clipsp(t); + LPSTR pContest = t; + + s = StrDlm(t, s, 0x1e); /* Rem */ + clipsp(t); + + if( (strlen(sp->call) == 15) && (RemoveL2(bf, t, "CALL", sizeof(bf)-1) == TRUE) ){ + StrCopy(sp->call, bf, MLCALL); + } + if( RemoveL2(bf, t, "POW", sizeof(bf)-1) == TRUE ){ + StrCopy(sp->pow, bf, MLPOW); + } + if( RemoveL2(bf, t, "ENV", sizeof(bf)-1) == TRUE ){ + sp->env = WORD(atoin(bf, -1)); + } + if( RemoveL2(bf, t, "M", sizeof(bf)-1) == TRUE ){ + sp->cq = bf[0]; + } + if( RemoveL2(bf, t, "OPT1", sizeof(bf)-1) == TRUE ){ + StrCopy(sp->opt1, bf, MLOPT); + } + if( RemoveL2(bf, t, "OPT2", sizeof(bf)-1) == TRUE ){ + StrCopy(sp->opt2, bf, MLOPT); + } + if( RemoveL2(bf, t, "USR1", sizeof(bf)-1) == TRUE ){ + Log.SetOptStr(2, sp, bf); + } + if( RemoveL2(bf, t, "USR2", sizeof(bf)-1) == TRUE ){ + Log.SetOptStr(3, sp, bf); + } + if( RemoveL2(bf, t, "MQSL", sizeof(bf)-1) == TRUE ){ + StrCopy(sp->qsl, bf, MLQSL); + } + clipsp(t); + t = SkipSpace(t); + StrCopy(sp->rem, t, MLREM); + + s = StrDlm(t, s, 0x1e); /* MyQTH*/ + if( *t ) AddL2(sp->qsl, "MyQTH", t, '[', ']', MLQSL); + + s = StrDlm(t, s, 0x1e); /* MyRig*/ + if( *t ) AddL2(sp->qsl, "MyRIG", t, '[', ']', MLQSL); + + s = StrDlm(t, s, 0x1e); /* Send */ + sp->send = *t; + StrDlm(t, s, 0x1e); /* Recv */ + sp->recv = *t; + + if( *pRIG ) AddL2(sp->qsl, "RIG", pRIG, '[', ']', MLQSL); + if( *pContest ) AddL2(sp->qsl, "TEST", pContest, '[', ']', MLQSL); +} +//--------------------------------------------------------------------------- +// LOG200ƒtƒ@ƒCƒ‹‚̓ǂÝo‚µ +int CLog200::Read(SDMMLOG *sp) +{ + if( !IsOpen() ) return FALSE; + + if( fread(m_bf, 1, 200, m_fp) == 200 ){ + LOG200toMMLOG(sp, m_bf); + m_Index++; + return TRUE; + } + else { + return FALSE; + } +} + +//--------------------------------------------------------------------------- +// MMLOG -> LOG200ƒtƒH[ƒ}ƒbƒg•ÏŠ· +void MMLOGtoLOG200(LPSTR t, SDMMLOG *sp, int &err) +{ + LPSTR s = t; + int h, m; + char bf[256]; + + memset(t, ' ', 200); + // YYMMDD + sprintf(t, "%02u%02u%02u\x1e", sp->year, sp->date / 100, sp->date % 100); + t += strlen(t); + // BGN(HHMM) + h = sp->btime / 1800; + m = (sp->btime % 1800) / 30; + sprintf(t, "%02u%02u\x1e", h, m); + t += strlen(t); + // END + h = sp->etime / 1800; + m = (sp->etime % 1800) / 30; + sprintf(t, "%02u%02u\x1e", h, m); + t += strlen(t); + // CALL + StrCopy(t, sp->call, 15); // 15•¶Žš‚ɧŒÀ‚³‚ê‚Ä‚¢‚é + t += strlen(t); + *t++ = 0x1e; + // FREQ + sprintf(bf, "%s", Log.GetFreqString(sp->band, sp->fq)); + if( bf[0] ){ + double dd; + if( sscanf(bf, "%lf", &dd) == 1 ){ + sprintf(bf, "%.3lf", dd); + } + } + strcpy(t, bf); + t += strlen(t); + *t++ = 0x1e; + // MODE + sprintf(t, "%s\x1e", Log.GetModeString(sp->mode)); + t += strlen(t); + // HisRST + sprintf(t, "%s\x1e", sp->ur); + t += strlen(t); + // MyRST + sprintf(t, "%s\x1e", sp->my); + t += strlen(t); + // QTH + sprintf(t, "%s\x1e", sp->qth); + t += strlen(t); + // NAME + sprintf(t, "%s\x1e", sp->name); + t += strlen(t); + // RIG + if( RemoveL2(bf, sp->qsl, "Rig", sizeof(bf)-1) == TRUE ){ + strcpy(t, bf); + } + *t++ = 0x1e; + // CONTEST + if( RemoveL2(bf, sp->qsl, "TEST", sizeof(bf)-1) == TRUE ){ + strcpy(t, bf); + } + *t++ = 0x1e; + char MyRig[200]; + char MyQTH[200]; + MyRig[0] = MyQTH[0] = 0; + if( RemoveL2(bf, sp->qsl, "MyRig", sizeof(bf)-1) == TRUE ){ + strcpy(MyRig, bf); + } + if( RemoveL2(bf, sp->qsl, "MyQTH", sizeof(bf)-1) == TRUE ){ + strcpy(MyQTH, bf); + } + clipsp(sp->qsl); + LPSTR p = SkipSpace(sp->qsl); + + // REM + strcpy(bf, sp->rem); + char bbf[128]; + if( strlen(sp->call) > 11 ){ + AddL2(bf, "CALL", sp->call, '[', ']', MLQSL); + } + if( sp->cq ){ + bbf[0] = sp->cq; bbf[1] = 0; + AddL2(bf, "M", bbf, '[', ']', MLQSL); + } + if( sp->pow[0] ) AddL2(bf, "POW", sp->pow, '[', ']', MLQSL); + if( sp->env ){ + sprintf(bbf, "%u", sp->env); + AddL2(bf, "ENV", bbf, '[', ']', MLQSL); + } + if( sp->opt1[0] ) AddL2(bf, "OPT1", sp->opt1, '[', ']', MLQSL); + if( sp->opt2[0] ) AddL2(bf, "OPT2", sp->opt2, '[', ']', MLQSL); + LPCSTR pp = Log.GetOptStr(2, sp); + if( *pp ) AddL2(bf, "USR1", pp, '[', ']', MLQSL); + pp = Log.GetOptStr(3, sp); + if( *pp ) AddL2(bf, "USR2", pp, '[', ']', MLQSL); + + if( *p ) AddL2(bf, "MQSL", p, '[', ']', MLQSL); + int len = (t - s) + strlen(bf) + 1 + strlen(MyQTH) + 1 + strlen(MyRig) + 1 + 2; + if( len >= 199 ){ + if( !err ){ + err++; + WarningMB("•ÏŠ·‚µ‚½Œ‹‰Ê‚ªLOG200ƒŒƒR[ƒh’·‚ð‰z‚¦‚Ü‚µ‚½.\r\n\r\nƒŠƒ}[ƒNƒtƒB[ƒ‹ƒh‚Ì’·‚³‚ð’²®‚µ‚Ü‚·."); + } + len -= 199; + bf[strlen(bf)-len] = 0; + } + + sprintf(t, "%s\x1e", bf); + t += strlen(t); + + // MyQTH + sprintf(t, "%s\x1e", MyQTH); + t += strlen(t); + // MyRIG + sprintf(t, "%s\x1e", MyRig); + t += strlen(t); + // S + if( sp->send ) *t++ = sp->send; + *t++ = 0x1e; + // R + if( sp->recv ) *t++ = sp->recv; + *t = 0x1e; + + s[198] = '\r'; s[199] = '\n'; +} +//--------------------------------------------------------------------------- +// LOG200ƒtƒ@ƒCƒ‹‚Ì‘‚«‚±‚Ý +int CLog200::Write(SDMMLOG *sp) +{ + if( !IsOpen() ) return FALSE; + + MMLOGtoLOG200(m_bf, sp, m_err); + if( fwrite(m_bf, 1, 200, m_fp) != 200 ){ + ErrorMB("'%s'‚É‘‚«ž‚Ý’†‚ɃGƒ‰[‚ª”­¶‚µ‚Ü‚µ‚½.", m_FileName.c_str()); + return FALSE; + } + else { + m_Index++; + return TRUE; + } +} +// +// +//*************************************************************************** +// CHamLog ƒNƒ‰ƒX +//--------------------------------------------------------------------------- +CHamLog::CHamLog() +{ + m_Type = 2; + m_err = 0; + + m_DBRName = ""; // DBRƒtƒ@ƒCƒ‹‚Ì–¼‘O + m_dbrfp = NULL; // DBRƒtƒ@ƒCƒ‹‚̃tƒ@ƒCƒ‹ƒ|ƒCƒ“ƒ^ +} +//--------------------------------------------------------------------------- +//--------------------------------------------------------------------------- +// HamLogƒtƒ@ƒCƒ‹‚̃I[ƒvƒ“ +int CHamLog::Open(LPCSTR pName) +{ + Close(); + m_Index = 0; + m_err = 0; + m_Mode = 0; + + m_fp = fopen(pName, "rb"); // DBS‚̃I[ƒvƒ“ + + if( m_fp == NULL ){ + ErrorMB( "'%s'‚ªƒI[ƒvƒ“‚Å‚«‚Ü‚¹‚ñ.", pName); + return FALSE; + } + m_FileName = pName; + if( (fread(&m_hd, 1, sizeof(m_hd), m_fp)!=sizeof(m_hd)) || + (m_hd.Memo != 0x1a) || + (m_hd.HeadLen != 449) || + (m_hd.DataLen != sizeof(m_RecBuf)) + ){ + fclose(m_fp); + m_fp = NULL; + ErrorMB("—\Šú‚µ‚È‚¢ƒtƒ@ƒCƒ‹Œ`Ž®‚Å‚·."); + return FALSE; + } + char dbrName[256]; + strcpy(dbrName, pName); + SetEXT(dbrName, ".DBR"); + m_DBRName = dbrName; + m_dbrfp = fopen(dbrName, "rb"); + if( m_dbrfp == NULL ){ + WarningMB( "'%s'‚ªƒI[ƒvƒ“‚Å‚«‚Ü‚¹‚ñ.", dbrName); + } + else if( fread(&m_dbrhd, 1, sizeof(m_dbrhd), m_dbrfp)!=sizeof(m_dbrhd) ){ + ErrorMB( "'%s'‚ª³í‚ɓǂ݂±‚߂܂¹‚ñ. ˆ—‚ð’†’f‚µ‚Ü‚·.", dbrName); + fclose(m_fp); + m_fp = NULL; + fclose(m_dbrfp); + m_dbrfp = NULL; + return FALSE; + } + + if( Seek(0) == FALSE ){ + Close(); + ErrorMB("ʼn‚̃ŒƒR[ƒh‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ."); + return FALSE; + } + return TRUE; +} + +int CHamLog::Close(void) +{ + int r = 0; + if( m_fp != NULL ){ + if( m_Mode ){ // ‘‚«‚±‚Ý + fseek(m_fp, 0, SEEK_SET); + if( fwrite(&m_hd, 1, sizeof(m_hd), m_fp) != sizeof(m_hd) ) r = 1; + } + if( fclose(m_fp) ) r = 1;; + m_fp = NULL; + } + if( m_dbrfp != NULL ){ + if( m_Mode ){ + fseek(m_dbrfp, 0, SEEK_SET); + if( fwrite(&m_dbrhd, 1, sizeof(m_dbrhd), m_dbrfp) != sizeof(m_dbrhd) ) r = 1; + } + if( fclose(m_dbrfp) ) r = 1; + m_dbrfp = NULL; + } + if( r ){ + ErrorMB("ƒtƒ@ƒCƒ‹‚̃Nƒ[ƒY‚ÉŽ¸”s‚µ‚Ü‚µ‚½."); + } + else if( m_Mode ){ + InfoMB("'%s'‚ւ̒ljÁ‚ðI—¹‚µ‚Ü‚µ‚½.", m_FileName.c_str()); + } + return r ? FALSE : TRUE; +} + +//--------------------------------------------------------------------------- +// HamLogƒtƒ@ƒCƒ‹‚Ìì¬ +int CHamLog::Create(LPCSTR pName) +{ + Close(); + m_Mode = 1; + m_err = 0; + + char dbrName[256]; + strcpy(dbrName, pName); + SetEXT(dbrName, ".DBR"); + + int add = 0; + if( (m_fp = fopen(pName, "rt"))!=NULL ){ + fclose(m_fp); + add = 1; + char BackNameDBS[256]; + strcpy(BackNameDBS, pName); + SetEXT(BackNameDBS, ".$BS"); + char BackNameDBR[256]; + strcpy(BackNameDBR, dbrName); + SetEXT(BackNameDBR, ".$BR"); + int r = YesNoCancelMB( "'%s'‚ÍŠù‚É‘¶Ý‚µ‚Ä‚¢‚Ü‚·. ƒf[ƒ^‚Í‚±‚̃tƒ@ƒCƒ‹‚ɒljÁ‚³‚ê‚Ü‚·.\r\n\r\n‚±‚Ì‘€ì‚ðŽÀs‚·‚é‘O‚ÉŒ³‚̃ƒOƒtƒ@ƒCƒ‹‚̃oƒbƒNƒAƒbƒvƒtƒ@ƒCƒ‹\r\n\r\n'%s'->'%s'\r\n'%s'->'%s'\r\n\r\n‚ð쬂µ‚Ü‚·‚©H\r\n\r\n" + "[d—v]\r\n”O‚Ì‚½‚߂ɃoƒbƒNƒAƒbƒv‚ð쬂·‚鎖‚ð‚¨Š©‚ß‚µ‚Ü‚·.", pName, pName, BackNameDBS, dbrName, BackNameDBR); + if( r == IDYES ){ + CWaitCursor w; + if( ::CopyFile(pName, BackNameDBS, FALSE) == FALSE ){ + ErrorMB("ƒoƒbƒNƒAƒbƒv‚Ì쬂Ɏ¸”s‚µ‚Ü‚µ‚½.\r\n‚±‚̈—‚Í’†’f‚³‚ê‚Ü‚·.Œ³‚̃ƒOƒtƒ@ƒCƒ‹‚Í•ÏX‚³‚ê‚Ü‚¹‚ñ."); + return FALSE; + } + if( ::CopyFile(dbrName, BackNameDBR, FALSE) == FALSE ){ + ErrorMB("ƒoƒbƒNƒAƒbƒv‚Ì쬂Ɏ¸”s‚µ‚Ü‚µ‚½.\r\n‚±‚̈—‚Í’†’f‚³‚ê‚Ü‚·.Œ³‚̃ƒOƒtƒ@ƒCƒ‹‚Í•ÏX‚³‚ê‚Ü‚¹‚ñ."); + return FALSE; + } + } + else if( r == IDCANCEL ){ + return FALSE; + } + } + m_fp = fopen(pName, add ? "r+b":"wb"); + if( m_fp == NULL ){ + ErrorMB( "'%s'‚ªƒI[ƒvƒ“‚Å‚«‚Ü‚¹‚ñ.", pName); + return FALSE; + } + m_dbrfp = fopen(dbrName, add ? "r+b":"wb"); + if( m_dbrfp == NULL ){ + ErrorMB( "'%s'‚ªƒI[ƒvƒ“‚Å‚«‚Ü‚¹‚ñ.", dbrName); + return FALSE; + } + + if( add ){ // ’ljÁ‚ÌŽž + if( (fread(&m_hd, 1, sizeof(m_hd), m_fp)!=sizeof(m_hd)) || + (m_hd.Memo != 0x1a) || + (m_hd.HeadLen != 449) || + (m_hd.DataLen != sizeof(m_RecBuf)) + ){ + fclose(m_fp); + m_fp = NULL; + fclose(m_dbrfp); + m_dbrfp = NULL; + ErrorMB("'%s'‚Í—\Šú‚µ‚È‚¢ƒtƒ@ƒCƒ‹Œ`Ž®‚Å‚·.", pName); + return FALSE; + } + if( (fread(&m_dbrhd, 1, sizeof(m_dbrhd), m_dbrfp)!=sizeof(m_dbrhd)) || + (m_dbrhd.Memo != 0x1a) || + (m_dbrhd.term != 0x1a) + ){ + fclose(m_fp); + m_fp = NULL; + fclose(m_dbrfp); + m_dbrfp = NULL; + ErrorMB("'%s'‚Í—\Šú‚µ‚È‚¢ƒtƒ@ƒCƒ‹Œ`Ž®‚Å‚·.", dbrName); + return FALSE; + } + fseek(m_dbrfp, 0, SEEK_END); // DBR‚ÌÅŒã‚Ɉړ® + } + else { // V‹K‚ÌŽž + MakeHD(); + } + m_FileName = pName; + m_Mode = 1; + m_DBRName = dbrName; + m_Index = m_hd.Max; + return TRUE; +} + +//---------------------------------------------------------------------- +int CHamLog::Seek(DWORD Index) +{ + long Pos = 449 + (Index * sizeof(m_RecBuf)); + if( fseek(m_fp, Pos, SEEK_SET) ) return FALSE; + m_Index = Index; + return TRUE; +} + +//---------------------------------------------------------------------- +//‚g‚`‚l‚k‚n‚f‚̃wƒbƒ_‚ðì¬ +BOOL CHamLog::MakeHD(void) +{ + memset(&m_hd, 0, sizeof(m_hd)); + memset(&m_dbrhd, 0, sizeof(m_dbrhd)); + m_hd.Memo = 0x1a; + SYSTEMTIME st; + ::GetLocal(&st); + m_hd.YY = BYTE(st.wYear % 100); + m_hd.MM = BYTE(st.wMonth); + m_hd.DD = BYTE(st.wDay); + m_hd.Max = 0; + memcpy(&m_dbrhd, &m_hd, sizeof(m_hd)); + m_hd.HeadLen = 449; + m_hd.DataLen = sizeof(m_RecBuf); + if( fwrite(&m_hd, 1, sizeof(m_hd), m_fp) != sizeof(m_hd) ) return FALSE; + + LPCSTR _Name[]={"CALLS","IGN","POTBL","CODE","GL","FREQ","MODE","NAME","QSL","DATE","TIME","RST","OFS"}; + BYTE _Len[]={6, 1, 3, 6, 6, 4, 3, 12, 3, 3, 2, 4, 4, 0}; + DBSLOT slot; + for( int i = 0; _Len[i]; i++ ){ + memset(&slot, 0, sizeof(slot)); + strcpy(slot.Name, _Name[i]); + slot.Type = 'C'; + slot.Len = _Len[i]; + if( fwrite(&slot, 1, sizeof(slot), m_fp)!=sizeof(slot) ) return FALSE; + } + slot.Name[0] = 0x0d; + if( fwrite(&slot, 1, 1, m_fp)!=1 ) return FALSE; + + m_dbrhd.m1 = 1; + m_dbrhd.term = 0x1a; + if( fwrite(&m_dbrhd, 1, sizeof(m_dbrhd), m_dbrfp)!=sizeof(m_dbrhd) ) return FALSE; + return TRUE; +} + +//--------------------------------------------------------------------------- +// HamLogƒtƒ@ƒCƒ‹‚̓ǂÝo‚µ +int CHamLog::Read(SDMMLOG *sp) +{ + if( !IsOpen() ) return FALSE; + + Seek(m_Index); + if( fread(&m_RecBuf, 1, sizeof(m_RecBuf), m_fp) == sizeof(m_RecBuf) ){ + HAMLOGtoMMLOG(sp, &m_RecBuf, m_dbrfp); + m_Index++; + return TRUE; + } + else { + return FALSE; + } +} +//--------------------------------------------------------------------------- +// HamLogƒtƒ@ƒCƒ‹‚Ì‘‚«‚±‚Ý +int CHamLog::Write(SDMMLOG *sp) +{ + if( !IsOpen() ) return FALSE; + + if( MMLOGtoHAMLOG(&m_RecBuf, sp, m_dbrfp) == FALSE ){ + ErrorMB("'%s'‚É‘‚«ž‚Ý’†‚ɃGƒ‰[‚ª”­¶‚µ‚Ü‚µ‚½.", m_DBRName.c_str()); + return FALSE; + } + Seek(m_hd.Max); + if( fwrite(&m_RecBuf, 1, sizeof(m_RecBuf), m_fp) != sizeof(m_RecBuf) ){ + ErrorMB("'%s'‚É‘‚«ž‚Ý’†‚ɃGƒ‰[‚ª”­¶‚µ‚Ü‚µ‚½.", m_FileName.c_str()); + return FALSE; + } + else { + m_hd.Max++; + m_dbrhd.Max++; + return TRUE; + } +} +//---------------------------------------------------------------------- +//‚g‚`‚l‚k‚n‚f‚ÌŽü”g”‹L˜^•ûŽ®‚ð’Êí‚Ì•¶Žš—ñ‚ɕϊ· +void DecBand(LPSTR t, BYTE *pBand) +{ + if( pBand[3] & 0x80 ){ // ‚T`‚V•¶Žš‚Ì•¶Žš—ñ + int DotPos = pBand[3] & 0x7f; + int Len = (DotPos >> 3) & 0x07; + DotPos &= 0x07; + LPSTR p = t; + wsprintf(p, "%-7lu", (*((LONG *)pBand) & 0x00ffffffL)); + if( Len < 4 ){ // Ver3.19‚܂ł̋L˜^•ûŽ® + for(int i = 6; i > 3; i--){ + if(p[i]>'0'){ + break; + } + else if(p[i] == '0'){ + p[i] = ' '; + } + } + } + else { + if( Len < 6 ) p[6] = ' '; + if( Len == 4 ) p[5] = ' '; + } + p[DotPos] = '.'; + p[8] = 0; + } + else { // ‚»‚Ì‚Ü‚Ü + StrCopy(t, (LPCSTR)pBand, 4); + } + clipsp(t); + if( LastC(t) == '.' ){ + *lastp(t) = 0; + } +} + +void SetMMLOGKey(SDMMLOG *sp, LPSTR bf) +{ + char rbf[512]; + + if( RemoveL2(rbf, bf, "ToRadio", sizeof(rbf)-1) == TRUE ){ + StrCopy(sp->call, rbf, MLCALL); + } + else if( RemoveL2(rbf, bf, "CALL", sizeof(rbf)-1) == TRUE ){ + StrCopy(sp->call, rbf, MLCALL); + } + + if( RemoveL2(rbf, bf, "ENV", sizeof(rbf)-1) == TRUE ){ + sp->env = WORD(atoin(rbf, -1)); + } + if( RemoveL2(rbf, bf, "END", sizeof(rbf)-1) == TRUE ){ + int tim = atoin(rbf, -1); + int hh = tim / 100; + int mm = tim % 100; + sp->etime = WORD((hh * 60 + mm) * 30); + if( !sp->etime ) sp->etime++; + } + if( RemoveL2(rbf, bf, "POW", sizeof(rbf)-1) == TRUE ){ + StrCopy(sp->pow, rbf, MLPOW); + } + if( RemoveL2(rbf, bf, "M", sizeof(rbf)-1) == TRUE ){ + sp->cq = rbf[0]; + } + if( RemoveL2(rbf, bf, "SN", sizeof(rbf)-1) == TRUE ){ + int l = GetLMode(sp->mode); + if( l ) sp->ur[l] = 0; + strcat(sp->ur, rbf); + } + if( RemoveL2(rbf, bf, "RN", sizeof(rbf)-1) == TRUE ){ + int l = GetLMode(sp->mode); + if( l ) sp->my[l] = 0; + strcat(sp->my, rbf); + } +} +//--------------------------------------------------------------------------- +// HamLog -> MMLOG ƒtƒH[ƒ}ƒbƒg‚̕ϊ· +void HAMLOGtoMMLOG(SDMMLOG *sp, SDHAMLOG *hp, FILE *dbrfp) +{ + int CallOrder = 0; + char bf[512]; + + memset(sp, 0, sizeof(SDMMLOG)); + DecBand(bf, (BYTE *)hp->freq); + Log.SetFreq(sp, bf); + + StrCopy(bf, hp->mode, 3); + clipsp(bf); + if( !strcmp(bf, Log.m_LogSet.m_THRTTY.c_str()) || !strcmp(bf, "RTY") || !strcmp(bf, "TTY") || !strcmp(bf, "RTT") ){ + strcpy(bf, "RTTY"); + } + else if( !strcmp(bf, Log.m_LogSet.m_THSSTV.c_str()) || !strcmp(bf, "STV")|| !strcmp(bf, "SST") ){ + strcpy(bf, "SSTV"); + } + else if( !strcmp(bf, "FTV") ){ + strcpy(bf, "FSTV"); + } + Log.SetMode(sp, bf); + + StrCopy(sp->name, hp->name, 12); + clipsp(sp->name); + + sprintf(sp->ur, "%02u", BYTE(hp->hiss[0])); + if( hp->hiss[1] != ' ' ) sp->ur[2] = hp->hiss[1]; + + sprintf(sp->my, "%02u", BYTE(hp->myrs[0])); + if( hp->myrs[1] != ' ' ) sp->my[2] = hp->myrs[1]; + + int YY, MM, DD, HH, mm; + YY = hp->date[0] & 0x007f; + YY %= 100; + MM = hp->date[1]; + DD = hp->date[2]; + HH = hp->time[0]; + mm = hp->time[1] & 0x7f; + if( hp->time[1] & 0x80 ){ + UTCtoJST(YY, MM, DD, HH); + } + sp->year = BYTE(YY); + sp->date = WORD(MM * 100 + DD); + sp->btime = WORD(((HH * 60 + mm) * 30)); + if(!sp->btime) sp->btime++; + + if( hp->ofs && (dbrfp != NULL) ){ + FHDDBR fhdbr; + if( fseek(dbrfp, hp->ofs, SEEK_SET) ) goto _ex; + if( fread(&fhdbr, 1, sizeof(fhdbr), dbrfp) != sizeof(fhdbr) ){ + goto _ex; + } + if( fhdbr.LenQTH ){ + if( fread(bf, 1, fhdbr.LenQTH, dbrfp)!=size_t(fhdbr.LenQTH) ){ + goto _ex; + } + bf[fhdbr.LenQTH] = 0; + clipsp(bf); + StrCopy(sp->qth, bf, MLQTH); + } + if( fhdbr.LenREM1 ){ + if( fread(bf, 1, fhdbr.LenREM1, dbrfp)!=size_t(fhdbr.LenREM1) ){ + goto _ex; + } + bf[fhdbr.LenREM1] = 0; + SetMMLOGKey(sp, bf); + clipsp(bf); + if( strstr(bf, "$DX" ) != NULL ) CallOrder = 1; + StrCopy(sp->rem, SkipSpace(bf), MLREM); + } + if( fhdbr.LenREM2 ){ + if( fread(bf, 1, fhdbr.LenREM2, dbrfp)!=size_t(fhdbr.LenREM2) ){ + goto _ex; + } + bf[fhdbr.LenREM2] = 0; + SetMMLOGKey(sp, bf); + clipsp(bf); + if( strstr(bf, "$DX" ) != NULL ) CallOrder = 1; + StrCopy(sp->qsl, SkipSpace(bf), MLQSL); + } + } +_ex:; + sprintf(bf, "QSL[%.3s]", hp->qsl); + Log.SetOptStr(2, sp, bf); + if( hp->qsl[0] == 'N' ){ + sp->send = 'N'; + } + else if( hp->send[0] == ' ' ){ // –¢”­‘— + if( (hp->qsl[0] == 'J')||(hp->qsl[0] == ' ') ){ + sp->send = 0; + } + else { + sp->send = BYTE(tolower(hp->qsl[0])); + } + } + else { // ”­‘—Ï‚Ý + sp->send = BYTE(toupper(hp->send[0])); + } + sp->recv = hp->rcv[0]; + if( sp->recv == ' ' ) sp->recv = 0; + + StrCopy(sp->opt1, hp->code, 6); + StrCopy(sp->opt2, hp->glid, 6); + + if( !sp->call[0] ){ + if( CallOrder && (hp->potbl[0] != ' ') ){ /* KH6/JE3HHT‚ÌŒ`Ž® */ + StrCopy(bf, hp->potbl, 3); + clipsp(bf); + strcat(sp->call, bf); + if( sp->call[0] ) strcat(sp->call, "/"); + StrCopy(bf, hp->calls, 7); + clipsp(bf); + strcat(sp->call, bf); + } + else { /* JE3HHT/KH6‚ÌŒ`Ž® */ + StrCopy(bf, hp->calls, 7); + clipsp(bf); + strcat(sp->call, bf); + if( hp->potbl[0] != ' ' ){ + if( sp->call[0] ) strcat(sp->call, "/"); + StrCopy(bf, hp->potbl, 3); + clipsp(bf); + strcat(sp->call, bf); + } + } + } + if( !sp->etime ) sp->etime = sp->btime; +} +//---------------------------------------------------------------------- +//•¶Žš—ñ‚̃Rƒs[iƒkƒ‹‚̓Zƒbƒg‚³‚ê‚È‚¢j +void SpaceCopy(LPSTR t, LPCSTR s, int n) +{ + for( ; n && *s; s++, t++, n-- ){ + *t = *s; + } +} +//---------------------------------------------------------------------- +//‚q‚r‚s•¶Žš—ñ‚ð‚g‚`‚l‚k‚n‚fŒ`Ž®‚ɕϊ·‚µ‚ÄŠi”[ +void SetRST(char *pRST, LPCSTR p, BYTE mode) +{ + char rs[3]; + int rst; + + StrCopy(rs, p, 2); + if( sscanf(rs, "%d", &rst) == 1 ){ + *pRST = BYTE(rst); + } + else { + *pRST = 59; + } + if( strlen(p) < 3 ) return; + if( GetLMode(mode) == 2 ) return; + pRST[1] = *(p+2); +} +//---------------------------------------------------------------------- +//Žü”g”‚Ì•¶Žš—ñ‚ð‚g‚`‚l‚k‚n‚f‚ÌŽü”g”‹L˜^•ûŽ®‚ɕϊ· +void EncBand(BYTE *pBand, LPCSTR pStr) +{ + char bf[32]; + StrCopy(bf, pStr, 7); + + int Len = strlen(bf); + if( Len <= 4 ){ + memset(pBand, ' ', 4); + SpaceCopy(LPSTR(pBand), bf, 4); + } + else { + LPSTR p = strchr(bf, '.'); + int DotPos; + if( p != NULL ){ + DotPos = p - bf; + *p = '0'; + } + else { + DotPos = Len; + } + long Freq; + sscanf(bf, "%lu", &Freq); + *(ULONG *)pBand = Freq; + pBand[3] = BYTE(0x0080 | (Len << 3) | DotPos); + } +} + +void AddMMLOGKey(AnsiString &REM1, AnsiString &REM2, LPCSTR s, LPCSTR pKey) +{ + if( !*s ) return; + + int len1 = strlen(REM1.c_str()); + int len2 = strlen(REM2.c_str()); + int len = strlen(s); + if( pKey == NULL ){ + len++; + } + else { + len += strlen(pKey) + 3; + } + AnsiString *ap; + if( (len2 + len) < 54 ){ + ap = &REM2; + } + else if( (len1 + len) < 54 ){ + ap = &REM1; + } + else { + return; + } + if( !ap->IsEmpty() ){ + *ap += " "; + } + if( pKey != NULL ){ + *ap += pKey; + *ap += '['; + } + *ap += s; + if( pKey != NULL ){ + *ap += ']'; + } +} +//--------------------------------------------------------------------------- +// MMLOG -> HamLog ƒtƒH[ƒ}ƒbƒg‚̕ϊ· +int MMLOGtoHAMLOG(SDHAMLOG *hp, SDMMLOG *sp, FILE *dbrfp) +{ + char bf[512]; + + int CallOrder = FALSE; + memset(hp, ' ', sizeof(SDHAMLOG)); + int YY = sp->year; + int MM = sp->date / 100; + int DD = sp->date % 100; + int tim = sp->btime / 30; + int HH = tim / 60; + int mm = tim % 60; + switch(Log.m_LogSet.m_THTZ){ + case 0: + if( !IsJA(sp->call) ){ + JSTtoUTC(YY, MM, DD, HH); + mm |= 0x80; + } + break; + case 1: + JSTtoUTC(YY, MM, DD, HH); + mm |= 0x80; + break; + default: + break; + } + hp->date[0] = BYTE(YY < 50 ? YY + 128 : YY); + hp->date[1] = BYTE(MM); + hp->date[2] = BYTE(DD); + hp->time[0] = BYTE(HH); + hp->time[1] = BYTE(mm); + + SpaceCopy(hp->name, sp->name, 12); + SpaceCopy(hp->code, sp->opt1, 6); + SpaceCopy(hp->glid, sp->opt2, 6); + AnsiString QTH = sp->qth; + AnsiString REM1 = sp->rem; + AnsiString REM2 = sp->qsl; + + strcpy(bf, sp->call); + LPSTR pp, p2, t; + t = bf; + if( (pp = strchr(bf, '/')) != NULL ){ // KH6/JE3HHT or JE3HHT/KH6 ‚ÌŒ`Ž® + *pp = 0; + pp++; + int LenC = strlen(t); + int LenP = strlen(pp); + if( ((p2 = strchr(pp, '/')) != NULL)|| + (LenC > 7) || + (LenP > 7) || + ((LenC > LenP) && (LenP>3)) || + ((LenC < LenP) && (LenC>3)) + ){ + // HAMLOG‚ł͕\Œ»‚Å‚«‚È‚¢•\‹L‚Ìê‡ + AddMMLOGKey(REM1, REM2, sp->call, "ToRadio"); + if( p2 != NULL ){ + *p2 = 0; + LenP = strlen(pp); + } + } + if( LenC < LenP ){ + p2 = t; + t = pp; + pp = p2; + CallOrder = TRUE; + } + SpaceCopy(hp->potbl, pp, 3); + } + else if( strlen(t) > 7 ){ + AddMMLOGKey(REM1, REM2, sp->call, "ToRadio"); + } + SpaceCopy(hp->calls, t, 7); + strcpy(bf, Log.GetModeString(sp->mode)); + if( !strcmp(bf, "RTTY") ){ + StrCopy(bf, Log.m_LogSet.m_THRTTY.c_str(), 3); + } + else if( !strcmp(bf, "SSTV") ){ + StrCopy(bf, Log.m_LogSet.m_THSSTV.c_str(), 3); + } + else if( !strcmp(bf, "FSTV") ){ + strcpy(bf, "FTV"); + } + else if( !strcmp(bf, "BPSK") ){ + strcpy(bf, "PSK"); + } + else if( !strcmp(bf, "QPSK") ){ + strcpy(bf, "PSK"); + } + SpaceCopy(hp->mode, bf, 3); + SetRST(hp->hiss, sp->ur, sp->mode); + SetRST(hp->myrs, sp->my, sp->mode); + + int l = GetLMode(sp->mode); + if( sp->ur[l] ) AddMMLOGKey(REM1, REM2, &sp->ur[l], "SN"); + if( sp->my[l] ) AddMMLOGKey(REM1, REM2, &sp->my[l], "RN"); + + strcpy(bf, Log.GetFreqString(sp->band, sp->fq)); + EncBand((BYTE *)hp->freq, bf); + + + if( CallOrder && (!strstr(sp->rem, "$DX")) && (!strstr(sp->qsl, "$DX")) ){ + AddMMLOGKey(REM1, REM2, "$DX", NULL); + } + + if( sp->etime ){ + tim = sp->etime / 30; + sprintf(bf, "%02u%02u", tim / 60, tim % 30); + AddMMLOGKey(REM1, REM2, bf, "END"); + } + if( sp->env ){ + sprintf(bf, "%u", sp->env); + AddMMLOGKey(REM1, REM2, bf, "ENV"); + } + AddMMLOGKey(REM1, REM2, sp->pow, "POW"); + if( sp->cq ){ + bf[0] = sp->cq; bf[1] = 0; + AddMMLOGKey(REM1, REM2, bf, "M"); + } + strcpy(bf, Log.GetOptStr(2, sp)); + char rbf[32]; + if(RemoveL2(rbf, bf, "QSL", sizeof(rbf)-1) == TRUE){ + hp->qsl[0] = rbf[0]; + hp->send[0] = rbf[1]; + hp->rcv[0] = rbf[2]; + } + else { + hp->rcv[0] = sp->recv; + if( !hp->rcv[0] ) hp->rcv[0] = ' '; + if( sp->send == 'N' ){ + hp->qsl[0] = 'N'; + hp->send[0] = ' '; + } + else if( !sp->send ){ + hp->qsl[0] = 'J'; + hp->send[0] = ' '; + } + else if( (sp->send >= 0x60)||(sp->send == '?') ){ + hp->qsl[0] = BYTE(toupper(sp->send)); + hp->send[0] = ' '; + } + else if( isalpha(sp->send) ){ + hp->qsl[0] = sp->send; + hp->send[0] = '*'; + } + else { + hp->qsl[0] = 'J'; + hp->send[0] = sp->send; + } + } + + if( !QTH.IsEmpty() || !REM1.IsEmpty() || !REM2.IsEmpty() ){ + FHDDBR fhdbr; + memset(&fhdbr, 0, sizeof(fhdbr)); + hp->ofs = ftell(dbrfp); + fhdbr.LenQTH = BYTE(strlen(QTH.c_str())); + fhdbr.LenREM1 = BYTE(strlen(REM1.c_str())); + fhdbr.LenREM2 = BYTE(strlen(REM2.c_str())); + if( fhdbr.LenQTH > 28 ){ + fhdbr.LenQTH = 28; + } + if( fhdbr.LenREM1 > 54 ){ + fhdbr.LenREM1 = 54; + } + if( fhdbr.LenREM2 > 54 ){ + fhdbr.LenREM2 = 54; + } + if( fwrite(&fhdbr, 1, sizeof(fhdbr), dbrfp) != sizeof(fhdbr) ) return FALSE; + if( fhdbr.LenQTH ){ + if( fwrite(QTH.c_str(), 1, fhdbr.LenQTH, dbrfp) != size_t(fhdbr.LenQTH) ) return FALSE; + } + if( fhdbr.LenREM1 ){ + if( fwrite(REM1.c_str(), 1, fhdbr.LenREM1, dbrfp) != size_t(fhdbr.LenREM1) ) return FALSE; + } + if( fhdbr.LenREM2 ){ + if( fwrite(REM2.c_str(), 1, fhdbr.LenREM2, dbrfp) != size_t(fhdbr.LenREM2) ) return FALSE; + } + } + else { + hp->ofs = 0L; + } + return TRUE; +} + +//*************************************************************************** +// CLogADIF ƒNƒ‰ƒX +CLogADIF::CLogADIF() +{ + m_bf[sizeof(m_bf)-1] = 0; +} +//--------------------------------------------------------------------------- +// ADIFƒtƒ@ƒCƒ‹‚̃I[ƒvƒ“ +int CLogADIF::Open(LPCSTR pName) +{ + Close(); + m_Mode = 0; + + m_p = NULL; + m_conv = 1; + m_fp = fopen(pName, "rt"); + if( m_fp != NULL ){ + setvbuf(m_fp, NULL, _IOFBF, 16384); + m_FileName = pName; + m_Mode = 0; + return TRUE; + } + else { + ErrorMB((sys.m_WinFontCharset!= SHIFTJIS_CHARSET) ? "Can't open '%s'": "'%s'‚ªƒI[ƒvƒ“‚Å‚«‚Ü‚¹‚ñ.", pName); + return FALSE; + } +} +//--------------------------------------------------------------------------- +// ADIFƒtƒ@ƒCƒ‹‚Ìì¬ +int CLogADIF::Create(LPCSTR pName) +{ + Close(); + m_Mode = 1; + + m_fp = fopen(pName, "wt"); + if( m_fp != NULL ){ + setvbuf(m_fp, NULL, _IOFBF, 16384); + m_FileName = pName; + m_Mode = 1; + fprintf(m_fp, "ADIF Export from %s\n", VERTTL); + fprintf(m_fp, "\n\n"); + return TRUE; + } + else { + ErrorMB( (sys.m_WinFontCharset!= SHIFTJIS_CHARSET) ? "Can't write to '%s'":"'%s'‚ªì¬‚Å‚«‚Ü‚¹‚ñ.", pName); + return FALSE; + } +} +//--------------------------------------------------------------------------- +// ƒeƒLƒXƒgƒtƒ@ƒCƒ‹‚̃I[ƒvƒ“ +int CLogADIF::Close(void) +{ + int r = 0; + if( m_fp != NULL ){ + r = fclose(m_fp); + m_fp = NULL; + if( r ){ + ErrorMB((sys.m_WinFontCharset!= SHIFTJIS_CHARSET) ? "Can't write to '%s'":"'%s'‚ª³‚µ‚­ƒNƒ[ƒY‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½.", m_FileName.c_str()); + } + else if( m_Mode ){ + InfoMB((sys.m_WinFontCharset!= SHIFTJIS_CHARSET) ? "Done (write to '%s')":"'%s'‚Ö‚Ì‘‚«‚±‚Ý‚ðI—¹‚µ‚Ü‚µ‚½.", m_FileName.c_str()); + } + } + return r ? FALSE : TRUE; +} +const char *_mb[]={ + "","160m","80m","80m","40m","30m","20m","17m","15m","12m","10m","6m", + "2m","70cm","23cm","13cm","6cm","3cm","3cm","1.25cm","6mm", + "4mm","2mm","1mm","65m","1.25m",NULL, +}; +//--------------------------------------------------------------------------- +// ADIFƒtƒ@ƒCƒ‹‚̓ǂÝo‚µ +void CLogADIF::SetData(SDMMLOG *sp, LPCSTR pKey, LPSTR pData) +{ + int l; + + if( !strcmpi(pKey, "CALL") ){ + StrCopy(sp->call, pData, MLCALL); + } + else if( !strcmpi(pKey, "QSO_DATE") ){ + sp->year = BYTE(atoin(pData, 4) % 100); + sp->date = WORD(atoin(pData+4, 4)); + } + else if( !strcmpi(pKey, "TIME_ON") ){ + int hh, mm, ss; + hh = atoin(pData, 2); + mm = atoin(pData+2, 2); + ss = pData[4] ? atoin(pData+4, 2) : 0; + sp->btime = WORD((hh * 60 + mm) * 30 + ss); + if( !sp->btime ) sp->btime++; + } + else if( !strcmpi(pKey, "TIME_OFF") ){ + int hh, mm, ss; + hh = atoin(pData, 2); + mm = atoin(pData+2, 2); + ss = pData[4] ? atoin(pData+4, 2) : 0; + sp->btime = WORD((hh * 60 + mm) * 30 + ss); + if( !sp->etime ) sp->btime++; + } + else if( !strcmpi(pKey, "FREQ") ){ + Log.SetFreq(sp, pData); + } + else if( !strcmpi(pKey, "BAND") ){ + if( !sp->band ){ + int i; + for( i = 1; _mb[i] != NULL; i++ ){ + if( !strcmpi(_mb[i], pData) ) break; + } + if( _mb[i] == NULL ) i = 0; + sp->band = BYTE(i); + } + } + else if( !strcmpi(pKey, "MODE") ){ + Log.SetMode(sp, pData); + } + else if( !strcmpi(pKey, "TX_PWR") ){ + StrCopy(sp->pow, pData, MLPOW); + } + else if( !strcmpi(pKey, "RST_SENT") ){ + if( sp->ur[0] ){ + char bf[MLRST+1]; + strcpy(bf, sp->ur); + StrCopy(sp->ur, pData, MLRST); + l = strlen(sp->ur); + StrCopy(&sp->ur[l], bf, MLRST - l); + } + else { + StrCopy(sp->ur, pData, MLRST); + } + } + else if( !strcmpi(pKey, "RST_RCVD") ){ + if( sp->my[0] ){ + char bf[MLRST+1]; + strcpy(bf, sp->my); + StrCopy(sp->my, pData, MLRST); + l = strlen(sp->my); + StrCopy(&sp->my[l], bf, MLRST - l); + } + else { + StrCopy(sp->my, pData, MLRST); + } + } + else if( !strcmpi(pKey, "STX") ){ + l = strlen(sp->ur); + StrCopy(&sp->ur[l], pData, MLRST - l); + } + else if( !strcmpi(pKey, "SRX") ){ + l = strlen(sp->my); + StrCopy(&sp->my[l], pData, MLRST - l); + } + else if( !strcmpi(pKey, "QSL_SENT") ){ + if( *pData == ' ' ) *pData = 0; + sp->send = *pData; + } + else if( !strcmpi(pKey, "QSL_RCVD") ){ + if( *pData == ' ' ) *pData = 0; + sp->recv = *pData; + } + else if( !strcmpi(pKey, "NAME") ){ + StrCopy(sp->name, pData, MLNAME); + } + else if( !strcmpi(pKey, "QTH") ){ + StrCopy(sp->qth, pData, MLQTH); + } + else if( !strcmpi(pKey, "COMMENT") ){ + StrCopy(sp->rem, pData, MLREM); + } + else if( !strcmpi(pKey, "QSLMSG") ){ + StrCopy(sp->qsl, pData, MLQSL); + } + else if( !strcmpi(pKey, "CONT") ){ + StrCopy(sp->opt2, pData, MLOPT); + } + else if( !strcmpi(pKey, "QSL_VIA") ){ + AddL2(sp->qsl, "QSL", pData, '[', ']', MLQSL); + } +} +//--------------------------------------------------------------------------- +void CLogADIF::AdjustData(SDMMLOG *sp) +{ + if( !sp->etime ) sp->etime = sp->btime; + UTCtoJST(sp); + if( sp->call[0] ){ + LPCSTR pCC = ClipCC(sp->call); + Log.SetOptStr(0, sp, Cty.GetCountry(pCC)); + if( !sp->opt2[0] ) Log.SetOptStr(1, sp, Cty.GetCont(pCC)); + } + if( !sp->ur[0] ) StrCopy(sp->ur, "599", GetLMode(sp->mode)); + if( !sp->my[0] ) StrCopy(sp->my, "599", GetLMode(sp->mode)); +} +//--------------------------------------------------------------------------- +// ADIFƒtƒ@ƒCƒ‹‚̓ǂÝo‚µ +int CLogADIF::Read(SDMMLOG *sp) +{ + if( !IsOpen() ) return FALSE; + + LPSTR p, t, tt; + char bf[1024]; + + while(1){ + if( (m_p == NULL) || !(*m_p) ){ + if( !feof(m_fp) ){ + if( fgets(m_bf, sizeof(m_bf), m_fp) != NULL ){ + ClipLF(m_bf); + m_p = m_bf; + } + else if( sp->btime && sp->call[0] && m_conv ){ + AdjustData(sp); + m_p = NULL; + return TRUE; + } + else { + return FALSE; + } + } + else { + return FALSE; + } + } + m_p = SkipSpace(m_p); + if( *m_p == '<' ){ + m_p = StrDlm(p, m_p+1, '>'); + p = StrDlm(t, p, ':'); + p = StrDlm(tt, p, ':'); + bf[0] = 0; + int n = *tt ? atoin(tt, -1) : 0; + if( (n >= 0) && (n < 1023) && (n <= (int)strlen(m_p)) ){ + if( n ) memcpy(bf, m_p, n); + bf[n] = 0; + } + if( !strcmpi(t, "EOR") ){ + if( m_conv ){ + AdjustData(sp); + return TRUE; + } + } + if( !strcmpi(t, "EOH") ){ + m_conv = 1; + } + else if( m_conv ){ + SetData(sp, t, bf); +#if 0 + FILE *fp = fopen("F:\\TEST.TXT", "at"); + fprintf(fp, "%s:%s\n", t, bf); + fclose(fp); +#endif + m_p += n; + } + } + else if( *m_p ){ + m_p++; + } + } +} +//--------------------------------------------------------------------------- +void CLogADIF::OutF(int &col, FILE *fp, LPCSTR fmt, ...) +{ + va_list pp; + char bf[512]; + + va_start(pp, fmt); + vsprintf(bf, fmt, pp ); + va_end(pp); + if( col ){ + fputs(" ", fp); + col++; + } + int l = strlen(bf); + if( (col + l) > 80 ){ + fputs("\n", fp); + col = 0; + } + fputs(bf, fp); + col += l; +} +//--------------------------------------------------------------------------- +// o—͕ϊ· +// +//KD4MUL 19930921 223558 150000 +//3.690 80M CW 100 599 +//599 Y N ROY STRUNK +//KY FIRST CW CONTACT WB4TXW +int CLogADIF::Write(SDMMLOG *sp) +{ + if( !IsOpen() ) return FALSE; + + int col = 0; + JSTtoUTC(sp); + OutF(col, m_fp, "%s", strlen(sp->call), sp->call); + OutF(col, m_fp, "%04u%02u%02u", YEAR(sp->year), sp->date/100, sp->date%100); + int tim = sp->btime / 30; + OutF(col, m_fp, "%02u%02u%02u", tim/60, tim%60, (sp->btime % 30)*2); + tim = sp->etime / 30; + OutF(col, m_fp, "%02u%02u%02u", tim/60, tim%60, (sp->etime % 30)*2); + LPCSTR p = Log.GetFreqString(sp->band, sp->fq); + if( *p ) OutF(col, m_fp, "%s", strlen(p), p); + p = _mb[sp->band]; + if( *p ) OutF(col, m_fp, "%s", strlen(p), p); + p = Log.GetModeString(sp->mode); + if( *p ) OutF(col, m_fp, "%s", strlen(p), p); + if( sp->pow[0] ) OutF(col, m_fp, "%s", strlen(sp->pow), sp->pow); + int l = GetLMode(sp->mode); + if( Log.m_LogSet.m_ClipRSTADIF ){ + if( sp->ur[l] ) OutF(col, m_fp, "%s", strlen(&sp->ur[l]), &sp->ur[l]); + if( sp->my[l] ) OutF(col, m_fp, "%s", strlen(&sp->my[l]), &sp->my[l]); + sp->ur[GetLMode(sp->mode)] = 0; + sp->my[GetLMode(sp->mode)] = 0; + } + if( sp->ur[0] ) OutF(col, m_fp, "%s", strlen(sp->ur), sp->ur); + if( sp->my[0] ) OutF(col, m_fp, "%s", strlen(sp->my), sp->my); + if( sp->send ) OutF(col, m_fp, "%c", sp->send); + if( sp->recv ) OutF(col, m_fp, "%c", sp->recv); + if( sp->name[0] ) OutF(col, m_fp, "%s", strlen(sp->name), sp->name); + if( sp->qth[0] ) OutF(col, m_fp, "%s", strlen(sp->qth), sp->qth); + if( sp->rem[0] ) OutF(col, m_fp, "%s", strlen(sp->rem), sp->rem); + if( sp->opt2[0] ) OutF(col, m_fp, "%s", strlen(sp->opt2), sp->opt2); + + if( sp->qsl[0] ){ + char via[MLQSL+1]; + char qsl[MLQSL+1]; + StrCopy(qsl, sp->qsl, MLQSL); + if( !RemoveL2(via, qsl, "QSL", sizeof(via)-1) ){ + via[0] = 0; + } + if( qsl[0] ) OutF(col, m_fp, "%s", strlen(qsl), qsl); + if( via[0] ) OutF(col, m_fp, "%s", strlen(via), via); + } + OutF(col, m_fp, "\n"); + return ferror(m_fp) ? FALSE : TRUE; +} + + +//*************************************************************************** +// CLogCabrillo ƒNƒ‰ƒX +CLogCabrillo::CLogCabrillo() +{ + m_bf[sizeof(m_bf)-1] = 0; +} +//--------------------------------------------------------------------------- +// LogCabrilloƒtƒ@ƒCƒ‹‚̃I[ƒvƒ“ +int CLogCabrillo::Open(LPCSTR pName) +{ + Close(); + m_Mode = 0; + + m_p = NULL; + m_SNR = ""; + m_fp = fopen(pName, "rt"); + if( m_fp != NULL ){ + setvbuf(m_fp, NULL, _IOFBF, 16384); + m_FileName = pName; + m_Mode = 0; + return TRUE; + } + else { + ErrorMB((sys.m_WinFontCharset!= SHIFTJIS_CHARSET) ? "Can't open '%s'": "'%s'‚ªƒI[ƒvƒ“‚Å‚«‚Ü‚¹‚ñ.", pName); + return FALSE; + } +} +//--------------------------------------------------------------------------- +// LogCabrilloƒtƒ@ƒCƒ‹‚Ìì¬ +int CLogCabrillo::Create(LPCSTR pName) +{ + Close(); + m_Mode = 1; + + m_fp = fopen(pName, "wt"); + if( m_fp != NULL ){ + setvbuf(m_fp, NULL, _IOFBF, 16384); + m_FileName = pName; + m_Mode = 1; + fprintf( m_fp, "START-OF-LOG: 2.0\n"); + fprintf( m_fp, "ARRL-SECTION: \n" ); + fprintf( m_fp, "CONTEST: <== e.g. ARRL-RTTY, CQ-WW-RTTY, CQ-WPX-RTTY, BARTG-SPRINT, BARTG-RTTY\n"); + fprintf( m_fp, "CALLSIGN: %s\n", sys.m_Call.c_str() ); + fprintf( m_fp, "CATEGORY: <== e.g. SINGLE-OP ALL HIGH, SINGLE-OP-ASSISTED 20M LOW\n" ); + fprintf( m_fp, "CLAIMED-SCORE: \n"); + fprintf( m_fp, "OPERATORS:\n" ); + fprintf( m_fp, "CLUB:\n" ); + fprintf( m_fp, "NAME: <== your name\n" ); + fprintf( m_fp, "ADDRESS: <== your postal address\n" ); + fprintf( m_fp, "SOAPBOX: \n" ); + fprintf( m_fp, "CREATED-BY: %s\n", VERTTL2); + return TRUE; + } + else { + ErrorMB( (sys.m_WinFontCharset!= SHIFTJIS_CHARSET) ? "Can't write to '%s'":"'%s'‚ªì¬‚Å‚«‚Ü‚¹‚ñ.", pName); + return FALSE; + } +} +//--------------------------------------------------------------------------- +// ƒeƒLƒXƒgƒtƒ@ƒCƒ‹‚̃I[ƒvƒ“ +int CLogCabrillo::Close(void) +{ + int r = 0; + if( m_fp != NULL ){ + fprintf(m_fp, "END-OF-LOG:\n"); + r = fclose(m_fp); + m_fp = NULL; + if( r ){ + ErrorMB((sys.m_WinFontCharset!= SHIFTJIS_CHARSET) ? "Can't write to '%s'":"'%s'‚ª³‚µ‚­ƒNƒ[ƒY‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½.", m_FileName.c_str()); + } + else if( m_Mode ){ + InfoMB((sys.m_WinFontCharset!= SHIFTJIS_CHARSET) ? "Done (write to '%s')\r\n\r\nMMTTY did only make QSO section.\r\nEdit to the contest name, category, your name and address, etc... in the file.":"'%s'‚Ö‚Ì‘‚«‚±‚Ý‚ðI—¹‚µ‚Ü‚µ‚½.\r\n\r\nMMTTY‚ÍQSOƒZƒNƒVƒ‡ƒ“‚µ‚©ì¬‚µ‚Ü‚¹‚ñB\r\nƒRƒ“ƒeƒXƒg–¼AŽQ‰ÁƒJƒeƒSƒŠ“™‚ð•ÒW‚µ‚Ä‚­‚¾‚³‚¢.", m_FileName.c_str()); + sprintf(m_bf, "NOTEPAD.EXE %s", m_FileName.c_str()); + WinExec(m_bf, SW_SHOWDEFAULT); + } + } + return r ? FALSE : TRUE; +} +//--------------------------------------------------------------------------- +// LogCabrilloƒtƒ@ƒCƒ‹‚̓ǂÝo‚µ +int CLogCabrillo::Read(SDMMLOG *sp) +{ + return FALSE; +} +//--------------------------------------------------------------------------- +// o—͕ϊ· +// +int CLogCabrillo::Write(SDMMLOG *sp) +{ + if( !IsOpen() ) return FALSE; +// "","1.9","3.5","3.8","7","10","14","18","21","24","28","50", +// "144","430","1200","2400","5600","10.1G","10.4G","24G","47G", +// "75G","142G","248G","4630","220",NULL, + const char *_bandc[]={ + "??","1800","3500","3500","7000","10000","14000","18000","21000","24000","28000", + "A", "B","D","E","F","H","I","J","K","M", + "N","P","R","?","C",NULL, + }; + +// "CW","SSB","AM","FM","RTTY","PAC","FAX","SSTV","ATV","TV","FSTV", +// "A1","A2","A3","A3A","A3H","A3J","A4","A5","A5C","A5J", +// "A9","A9C","F1","F2","F3","F4","F5","F9","P0","P1", +// "P2D","P2E","P2F","P3D","P3E","P3F","P9", +// "U1","U2","U3","U4", +// "PSK","BPSK","QPSK","HELL","MFSK", + const char *_modec[]={ + "??", + "CW","PH","PH","FM","RY","RY","??","TV","TV","TV","TV", + "CW","CW","PH","PH","PH","PH","??","??","??","??", + "??","??","RY","RY","FM","??","??","??", + "??","??","??","??","??","??","??","??","??", + "??","??","??","??", + "RY","RY","RY","CW","RY", + NULL, + }; + + JSTtoUTC(sp); + int tim = sp->btime / 30; + char SNO[MLRST+1]; + char RNO[MLRST+1]; + int mno = sp->mode >= MODEMAX ? 0 : sp->mode; + int len = GetLMode(BYTE(mno)); + strcpy(SNO, &sp->ur[len]); + strcpy(RNO, &sp->my[len]); + sp->ur[len] = 0; + sp->my[len] = 0; + if( !SNO[0] ){ + if( m_SNR.IsEmpty() ){ + int r; + if( sys.m_WinFontCharset!= SHIFTJIS_CHARSET ){ + r = InputMB("Does not exist the Sent-NR information", "Enter contest number which you sent", m_SNR); + } + else { + r = InputMB("Sent-NRî•ñ‚ª‘¶Ý‚µ‚Ü‚¹‚ñ", "Sent-NR‚ð“ü—Í‚µ‚ĉº‚³‚¢", m_SNR); + } + if( r == FALSE ) return FALSE; + } + strcpy(SNO, m_SNR.c_str()); + } +/* + KHz MODE DATE UTC MYCALL SENT NR HISCALL RCVD NR TXID +------------------------------1234567890123 123 123456 1234567890123 123 123456 +QSO: nnnnn RY YYYY-MM-DD HHMM JE1CKA 599 13 DX NN7NN 599 03 NV 0 +1234 12345 12 1234567890 1234 1234567890123 123 12 123 1234567890123 123 12 12 1 +*/ + fprintf( m_fp, "QSO:%6s %2s %04u-%02u-%02u %02u%02u %-13s %-3s %-6s %-13s %-3s %-6s\n", + _bandc[sp->band], _modec[mno], + (sp->year <= 50) ? sp->year + 2000 : sp->year + 1900, + sp->date / 100, sp->date % 100, + tim/60, tim%60, sys.m_Call.c_str(), + sp->ur, SNO, + sp->call, sp->my, RNO + ); + return ferror(m_fp) ? FALSE : TRUE; +} + diff --git a/LogConv.h b/LogConv.h new file mode 100644 index 0000000..8d4b510 --- /dev/null +++ b/LogConv.h @@ -0,0 +1,248 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------------- +#ifndef LogConvH +#define LogConvH +#include "LogFile.h" + +extern const char *MONT1[]; +extern const char *MONT2[]; +//************************************************************* +// ƒƒO•ÏŠ·‚ÌŠî–{ƒNƒ‰ƒX +// +class CLogConv +{ +protected: + int m_Type; // 0-TEXT, 1-LOG200, 2-HAMLOG, 3-DBASE + int m_Mode; // 0-Read, 1-Write + FILE *m_fp; + + AnsiString m_FileName; // •ÏŠ·’†‚̃tƒ@ƒCƒ‹–¼ +public: + CLogConv(); + virtual ~CLogConv(); + virtual int IsOpen(void){return m_fp != NULL ? 1 : 0;}; + virtual int Open(LPCSTR pName)=0; + virtual int Create(LPCSTR pName)=0; + virtual int Close(void)=0; + virtual int Read(SDMMLOG *sp)=0; + virtual int Write(SDMMLOG *sp)=0; +}; + +#define TEXTCONVMAX 64 +typedef struct { + int w; + AnsiString Key; +}TCONV; + +//************************************************************* +// ƒeƒLƒXƒgƒtƒ@ƒCƒ‹ƒAƒNƒZƒX‚̃Nƒ‰ƒX +// +class CLogText : public CLogConv +{ +public: + int m_Double; + int m_Delm; + TCONV m_rConv[TEXTCONVMAX]; + TCONV m_tConv[TEXTCONVMAX]; + int m_UTC; + int m_err; +protected: + char m_bf[2048]; // ƒtƒ@ƒCƒ‹ƒoƒbƒtƒ@ + +private: + int Text2MMLOG(SDMMLOG *sp, LPSTR p, int &err); + void MMLOG2Text(LPSTR t, SDMMLOG *sp); + +public: + CLogText(); + virtual int Open(LPCSTR pName); + virtual int Create(LPCSTR pName); + virtual int Close(void); + virtual int Read(SDMMLOG *sp); + virtual int Write(SDMMLOG *sp); + +}; + +void MMLOG2Text(LPSTR t, SDMMLOG *sp, AnsiString &Key); +int Text2MMLOG(SDMMLOG *sp, LPCSTR s, AnsiString &Key); +extern const LPCSTR ConvTbl[]; +extern CLogText LogText; + +//************************************************************* +// ‚k‚n‚f‚Q‚O‚Oƒtƒ@ƒCƒ‹ƒAƒNƒZƒX‚̃Nƒ‰ƒX +// +#define LOG200WIDTH 200 +class CLog200 : public CLogConv +{ +public: + int m_Index; + int m_err; +protected: + char m_bf[200]; // ƒtƒ@ƒCƒ‹ƒoƒbƒtƒ@ +private: +public: + CLog200(); + virtual int Open(LPCSTR pName); + virtual int Create(LPCSTR pName); + virtual int Close(void); + virtual int Read(SDMMLOG *sp); + virtual int Write(SDMMLOG *sp); +}; + +//************************************************************* +// ‚g‚`‚l‚k‚n‚fƒtƒ@ƒCƒ‹ƒAƒNƒZƒX‚̃Nƒ‰ƒX +// +#pragma option -a- // ƒpƒbƒN‚ÌŽwަ +typedef struct { + char Memo; // 03h=ÒǪ́°ÙÄÞ–³‚µ 83h=ÒǪ́°ÙÄÞ—L‚èiHAMLOG‚Å‚Í 1Ahj + char YY, MM, DD; // ÅIXV”NŒŽ“ú + long Max; // Úº°ÄÞŒ” + WORD HeadLen; // ͯÀÞ‚Ì’·‚³iHAMLOG.DBS‚Í 449j + WORD DataLen; // Úº°ÄÞ‚Ì’·‚³iHAMLOG.DBS‚Í 58j + char dummy[20]; // 00h +}DBSHD; + +typedef struct { + char Memo; // 03h=ÒǪ́°ÙÄÞ–³‚µ 83h=ÒǪ́°ÙÄÞ—L‚èiHAMLOG‚Å‚Í 1Ahj + char YY, MM, DD; // ÅIXV”NŒŽ“ú + long Max; // Úº°ÄÞŒ” + char dm1; + char m1; // 01h + char dm2; + char dummy[21]; // 00h + char dummy2[255-32]; // 00h + char term; // 1ah +}DBRHD; + +typedef struct { + char Name[11]; + BYTE Type; + BYTE dm1[4]; + BYTE Len; + BYTE dm2[15]; +}DBSLOT; + +typedef struct { + char del[1]; /* 휃}[ƒN */ + char calls[7]; /* º°Ù»²Ý */ + char potbl[3]; /* ˆÚ“®´Ø± */ + char code[6]; /* JCCº°ÄÞ */ + char glid[6]; /* ¸ÞدÄÞÛ¹°À° */ + char freq[4]; /* Žü”g” */ + char mode[3]; /* Ó°ÄÞ */ + char name[12]; /* Ž–¼ */ + char qsl [1]; /* QSL via */ + char send[1]; /* QSL SEND */ + char rcv[1]; /* QSL RCV */ + char date[3]; /* “ú•t */ + char time[2]; /* ŽžŠÔ */ + char hiss[2]; /* HIS RST */ + char myrs[2]; /* MY RST */ + long ofs; /* HAMLOG.DBR µÌ¾¯Ä±ÄÞÚ½ */ +}SDHAMLOG; + +typedef struct { /* DBR‚̃tƒB[ƒ‹ƒhˆÊ’uƒf[ƒ^ */ + BYTE LenQTH; + BYTE LenREM1; + BYTE LenREM2; +}FHDDBR; +#pragma option -a. // ƒpƒbƒN‰ðœ‚ÌŽwަ + +class CHamLog : public CLogConv +{ +public: + int m_Index; + int m_err; +protected: + DBSHD m_hd; // DBSƒwƒbƒ_ + SDHAMLOG m_RecBuf; // ƒŒƒR[ƒhƒoƒbƒtƒ@ + + AnsiString m_DBRName; // DBRƒtƒ@ƒCƒ‹‚Ì–¼‘O + FILE *m_dbrfp; // DBRƒtƒ@ƒCƒ‹‚̃tƒ@ƒCƒ‹ƒ|ƒCƒ“ƒ^ + DBRHD m_dbrhd; // DBRƒwƒbƒ_ +private: + int Seek(DWORD Index); + BOOL MakeHD(void); + +public: + CHamLog(); + virtual int Open(LPCSTR pName); + virtual int Create(LPCSTR pName); + virtual int Close(void); + virtual int Read(SDMMLOG *sp); + virtual int Write(SDMMLOG *sp); +}; + +void HAMLOGtoMMLOG(SDMMLOG *sp, SDHAMLOG *hp, FILE *dbrfp); +int MMLOGtoHAMLOG(SDHAMLOG *hp, SDMMLOG *sp, FILE *dbrfp); +void AddMMLOGKey(AnsiString &REM1, AnsiString &REM2, LPCSTR s, LPCSTR pKey); +void SetMMLOGKey(SDMMLOG *sp, LPSTR bf); + +//************************************************************* +// ADIFƒAƒNƒZƒX‚̃Nƒ‰ƒX +// +class CLogADIF : public CLogConv +{ +public: +protected: + char m_bf[1024]; // ƒtƒ@ƒCƒ‹ƒoƒbƒtƒ@ + LPSTR m_p; + int m_conv; +private: + void MMLOG2ADIF(LPSTR t, SDMMLOG *sp); + void SetData(SDMMLOG *sp, LPCSTR pKey, LPSTR pData); + void AdjustData(SDMMLOG *sp); + void OutF(int &col, FILE *fp, LPCSTR fmt, ...); + +public: + CLogADIF(); + virtual int Open(LPCSTR pName); + virtual int Create(LPCSTR pName); + virtual int Close(void); + virtual int Read(SDMMLOG *sp); + virtual int Write(SDMMLOG *sp); + +}; + +//************************************************************* +// Cabrillo ƒAƒNƒZƒX‚̃Nƒ‰ƒX +// +class CLogCabrillo : public CLogConv +{ +public: +protected: + char m_bf[1024]; // ƒtƒ@ƒCƒ‹ƒoƒbƒtƒ@ + LPSTR m_p; + AnsiString m_SNR; +private: + void MMLOG2Cabrillo(LPSTR t, SDMMLOG *sp); + void AdjustData(SDMMLOG *sp); + +public: + CLogCabrillo(); + virtual int Open(LPCSTR pName); + virtual int Create(LPCSTR pName); + virtual int Close(void); + virtual int Read(SDMMLOG *sp); + virtual int Write(SDMMLOG *sp); +}; + +#endif diff --git a/LogFile.cpp b/LogFile.cpp new file mode 100644 index 0000000..d892d9c --- /dev/null +++ b/LogFile.cpp @@ -0,0 +1,1660 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------------- +#include +#pragma hdrstop + +#include +#include +#include +#include +#include "LogFile.h" +#include "Hamlog5.h" +CLogFile Log; + + +//--------------------------------------------------------------------------- +// MMLOG Constant +// +enum BD { /* ƒoƒ“ƒh‚̔Ԇ */ + B_NULL, + B_19, + B_35, + B_38, + B_7, + B_10, + B_14, + B_18, + B_21, + B_24, + B_28, + B_50, + B_144, + B_430, + B_1200, + B_2400, + B_5600, + B_101G, + B_104G, + B_24G, + B_47G, + B_75G, + B_142G, + B_248G, + B_4630, + B_220, + B_SAT, +}; + +const char *_mBand[]={ + "","160","80","75","40","30","20","17","15","12","10","6", + "2","430","1200","2400","5600","10.1G","10.4G","24G","47G", + "75G","142G","248G","4630","220",NULL, +}; +const char *_band[]={ + "","1.9","3.5","3.8","7","10","14","18","21","24","28","50", + "144","430","1200","2400","5600","10.1G","10.4G","24G","47G", + "75G","142G","248G","4630","220",NULL, +}; +static const char *_mode[]={ + "", + "CW","SSB","AM","FM","RTTY","PAC","FAX","SSTV","ATV","TV","FSTV", + "A1","A2","A3","A3A","A3H","A3J","A4","A5","A5C","A5J", + "A9","A9C","F1","F2","F3","F4","F5","F9","P0","P1", + "P2D","P2E","P2F","P3D","P3E","P3F","P9", + "U1","U2","U3","U4", + "PSK","BPSK","QPSK","HELL","MFSK", + NULL, +}; +const char lmode[]={ + 3, 3, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, + 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, + 3, 3, 3, 3, 3, +}; +const char MONN[]={31,31,28,31,30,31,30,31,31,30,31,30,31}; +const char MONU[]={31,31,29,31,30,31,30,31,31,30,31,30,31}; +//--------------------------------------------------------------------------- +// CIndexƒNƒ‰ƒX +int GetLMode(BYTE m) +{ + if( m < MODEMAX ){ + return lmode[m]; + } + else { + return 3; + } +} +//--------------------------------------------------------------------------- +// CIndexƒNƒ‰ƒX +CIndex::CIndex() +{ + m_IndexMax = 0; // Šm•Û’†‚̃Cƒ“ƒfƒbƒNƒX‚Ì” + m_IndexCnt = 0; // Œ»Ý‚̃Cƒ“ƒfƒbƒNƒX‚Ì” + pIndex = NULL; // ƒCƒ“ƒfƒbƒNƒX—̈æ‚̃|ƒCƒ“ƒ^(16ƒoƒCƒgƒCƒ“ƒfƒbƒNƒX) + pMult = NULL; +} +CIndex::~CIndex() +{ + if( pIndex != NULL ){ + delete[] pIndex; + pIndex = NULL; + } + if( pMult != NULL ){ + delete[] pMult; + pMult = NULL; + } +} +void CIndex::AllocIndex(int n) +{ + if( n >= m_IndexMax ){ + int max = m_IndexMax ? (m_IndexMax * 2) : 32768; + LPSTR np = new char[16*max]; + if( pIndex != NULL ){ + memcpy(np, pIndex, m_IndexCnt*16); + delete pIndex; + } + pIndex = np; + m_IndexMax = max; + } +} + +void CIndex::ClearIndex(void) +{ + m_IndexCnt = 0; +} + +void CIndex::WriteIndex(LPCSTR pCall, int n) +{ + AllocIndex(n); + memcpy(&pIndex[n*16], pCall, 16); + if( n >= m_IndexCnt ) m_IndexCnt = n + 1; +} + +void CIndex::ReadIndex(LPSTR pCall, int n) +{ + memcpy(pCall, &pIndex[n*16], 16); + pCall[16] = 0; +} + +LPSTR CIndex::PointIndex(int n) +{ + return &pIndex[n*16]; +} + +void CIndex::AddBlock(LPCSTR p, int len) +{ + int n = len/16; + AllocIndex(n + m_IndexCnt); + memcpy(&pIndex[m_IndexCnt*16], p, len); + m_IndexCnt += n; +} +//--------------------------------------------------------------------------- +int CIndex::ReadIndex(int handle, FHD *hp) +{ + int r = TRUE; + int BUFSIZE=32768; + + CWaitCursor w; + if( lseek(handle, (hp->size * (ULONG)sizeof(SDMMLOG)) + FHDOFF, SEEK_SET) != -1L ){ + if( hp->hash != 2 ){ // 16ƒoƒCƒgƒCƒ“ƒfƒbƒNƒX‚ƈقȂé + if( hp->hash ){ // 2ƒoƒCƒgƒCƒ“ƒfƒbƒNƒX‚̃XƒLƒbƒv + lseek(handle, hp->size * 2, SEEK_CUR); + } + r = FALSE; + } + else { // 16ƒoƒCƒgƒCƒ“ƒfƒbƒNƒX + LPSTR bp = new char[BUFSIZE]; + int len = hp->size * 16; + int rlen, wlen; + while(len){ + rlen = (len > BUFSIZE) ? BUFSIZE : len; + wlen = read(handle, bp, rlen); + if( rlen != wlen ){ + r = FALSE; + break; + } + AddBlock(bp, wlen); + len -= wlen; + } + delete bp; + } + if( pMult == NULL ) pMult = new BYTE[32768]; + read(handle, pMult, hp->mlt); + } + else { + r = FALSE; + } + return r; +} + +void CIndex::MakeIndex(int handle, FHD *hp) +{ + CWaitCursor w; + + lseek(handle, (ULONG)FHDOFF, SEEK_SET); + ClearIndex(); + + FHD fh; + memset(&fh, 0, sizeof(fh)); + + int i, rlen; + SDMMLOG sd; + for( i = 0; i < hp->size; i++ ){ + rlen = read(handle, &sd, sizeof(sd)); + if( rlen != sizeof(sd) ) break; + WriteIndex(sd.call, i); + if( sd.mode >= MODEMAX ){ + int m = sd.mode - MODEMAX; + int f = 0; + int n; + char sbf[7]; + StrCopy(sbf, hp->mode[m], 6); + for( n = 0; (n < UMODEMAX) && fh.mode[n][0] ; n++ ){ + char tbf[7]; + StrCopy(tbf, fh.mode[n], 6); + if( !strcmp(sbf, tbf) ){ + if( m != n ){ + f++; + sd.mode = BYTE(n + MODEMAX); + break; + } + } + } + if( !fh.mode[n][0] ){ + StrCopy(fh.mode[n], sbf, 6); + if( m != n ){ + sd.mode = BYTE(n + MODEMAX); + f++; + } + } + if( f ){ + lseek( handle, -long(sizeof(sd)), SEEK_CUR); + write(handle, &sd, sizeof(sd)); + } + } + } + memcpy(hp->mode, fh.mode, sizeof(fh.mode)); + lseek( handle, (hp->size * (ULONG)sizeof(SDMMLOG)) + FHDOFF, SEEK_SET); + hp->hash = 2; // 16ƒoƒCƒgƒCƒ“ƒfƒbƒNƒX +} + +//--------------------------------------------------------------------------- +int CIndex::WriteIndex(int handle, FHD *hp) +{ + int r = TRUE; + int BUFSIZE=32768; + + CWaitCursor w; + + if( lseek(handle, (hp->size * (ULONG)sizeof(SDMMLOG)) + FHDOFF, SEEK_SET) != -1L ){ + hp->hash = 2; + int len = hp->size * 16; + int vlen, wlen; + LPSTR cp = pIndex; + while(len){ + wlen = (len > BUFSIZE) ? BUFSIZE : len; + vlen = write(handle, cp, wlen); + if( wlen != vlen ) r = FALSE; + len -= vlen; + cp += vlen; + } + if( pMult != NULL ){ + write(handle, pMult, hp->mlt); + } + } + else { + r = FALSE; + } + return r; +} + +//--------------------------------------------------------------------------- +// CLogFindƒNƒ‰ƒX +CLogFind::CLogFind() +{ + m_FindCnt = 0; + pFindTbl = new int[FINDMAX]; +} +//--------------------------------------------------------------------------- +CLogFind::~CLogFind() +{ + delete[] pFindTbl; + pFindTbl = NULL; +} +//--------------------------------------------------------------------------- +int CLogFind::Add(int n) +{ + if( m_FindCnt >= FINDMAX ) return 0; + + for( int i = 0; i < m_FindCnt; i++ ){ + if( pFindTbl[i] == n ) return 0; + } + pFindTbl[m_FindCnt] = n; + m_FindCnt++; + return 1; +} +//--------------------------------------------------------------------------- +void CLogFind::Ins(int n) +{ + if( m_FindCnt >= FINDMAX ) return; + + int i; + for( i = 0; i < m_FindCnt; i++ ){ + if( pFindTbl[i] == n ) return; + } + for( i = m_FindCnt - 1; i > 0; i-- ){ + pFindTbl[i] = pFindTbl[i-1]; + } + pFindTbl[0] = n; + m_FindCnt++; + m_FindCmp1Max++; + m_FindCmp2Max++; + m_FindStr1Max++; + m_FindStr2Max++; +} +//--------------------------------------------------------------------------- +// CLogFileƒNƒ‰ƒX +CLogFile::CLogFile() +{ + memset(&m_sd, 0, sizeof(SDMMLOG)); + memset(&m_bak, 0, sizeof(SDMMLOG)); + + m_Open = 0; // ƒI[ƒvƒ“ƒtƒ‰ƒO + m_EditFlag = 0; + m_Handle = 0; + memset(&m_fhd, 0, sizeof(m_fhd)); // Œ»ÝƒI[ƒvƒ“’†‚̃tƒ@ƒCƒ‹ƒwƒbƒ_ + MakePathName("TEMP.MDT"); + m_CurNo = 0; + + // LogSet ‚̃fƒtƒHƒ‹ƒg + + m_LogSet.m_TimeZone = 'I'; // JA + + m_LogSet.m_UpperName = 0; // ‘å•¶Žš‚ւ̕ϊ· + m_LogSet.m_UpperQTH = 0; // ‘å•¶Žš‚ւ̕ϊ· + m_LogSet.m_UpperREM = 0; // ‘å•¶Žš‚ւ̕ϊ· + m_LogSet.m_UpperQSL = 0; // ‘å•¶Žš‚ւ̕ϊ· + + m_LogSet.m_DefMyRST = 0; // 0-OFF, 1-ON + m_LogSet.m_Contest = 0; + + m_LogSet.m_CopyFreq = 0; // 0-Band, 1-Freq + m_LogSet.m_CopyHis = 0; // 0-599, 1-599001, 2-599UTC + m_LogSet.m_CopyName = 1; // 0-OFF, 1-ON + m_LogSet.m_CopyQTH = 1; // 0-OFF, 1-ON + m_LogSet.m_CopyREM = 0; // 0-OFF, 1-ON + m_LogSet.m_CopyQSL = 1; // 0-OFF, 1-ON + m_LogSet.m_CopyREMB4 = 0; // 0-OFF, 1-ON + + m_LogSet.m_AutoSave = TRUE; + m_LogSet.m_QSOMacroFlag = 0; + m_LogSet.m_CheckBand = 1; + m_LogSet.m_QSOMacro[0] = 1; + m_LogSet.m_QSOMacro[1] = 1; + m_LogSet.m_QSOMacro[2] = 1; + m_LogSet.m_QSOMacro[3] = 0; + m_LogSet.m_QSOMacro[4] = 0; + m_LogSet.m_QSOMacroStr[0] = "\r\n %c %c UR %R-%N-%N BK\r\n\\"; + m_LogSet.m_QSOMacroStr[1] = "\r\nQSL TU QRZ? DE %m %m K\r\n\\"; + m_LogSet.m_QSOMacroStr[2] = "\r\n %c SRI QSO B4 QRZ? DE %m %m K\r\n\\"; + m_LogSet.m_QSOMacroStr[3] = "\r\nDE %m %m K\r\n\\"; + m_LogSet.m_QSOMacroStr[4] = "\r\n %c %R-%N-%N TU\r\n\\"; + memset(&m_LogSet.m_QSOMacroKey, 0, sizeof(m_LogSet.m_QSOMacroKey)); + + m_LogSet.m_THRTTY = "RTY"; + m_LogSet.m_THSSTV = "STV"; + m_LogSet.m_THTZ = 0; + m_LogSet.m_ClipRSTADIF = 1; + m_LogSet.m_DateType = 0; + + m_LogSet.m_Backup = TRUE; + memcpy(m_LogSet.m_Hamlog5Len, g_Hamlog5Len, 17); +} + +CLogFile::~CLogFile() +{ + Close(); +} + +void CLogFile::ReadIniFile(LPCSTR pKey, TMemIniFile *pIniFile) +{ + char bf[64]; + + m_LogSet.m_DateType = pIniFile->ReadInteger(pKey, "DateType", m_LogSet.m_DateType); + m_LogSet.m_TimeZone = (char)pIniFile->ReadInteger(pKey, "TimeZone", m_LogSet.m_TimeZone); + + m_LogSet.m_UpperName = pIniFile->ReadInteger(pKey, "UpperName", m_LogSet.m_UpperName); + m_LogSet.m_UpperQTH = pIniFile->ReadInteger(pKey, "UpperQTH", m_LogSet.m_UpperQTH); + m_LogSet.m_UpperREM = pIniFile->ReadInteger(pKey, "UpperREM", m_LogSet.m_UpperREM); + m_LogSet.m_UpperQSL = pIniFile->ReadInteger(pKey, "UpperQSL", m_LogSet.m_UpperQSL); + + m_LogSet.m_DefMyRST = pIniFile->ReadInteger(pKey, "DefMyRST", m_LogSet.m_DefMyRST); + m_LogSet.m_Contest = pIniFile->ReadInteger(pKey, "Contest", m_LogSet.m_Contest); + + m_LogSet.m_CopyFreq = pIniFile->ReadInteger(pKey, "CopyFreq", m_LogSet.m_CopyFreq); + m_LogSet.m_CopyHis = pIniFile->ReadInteger(pKey, "CopyHis", m_LogSet.m_CopyHis); + m_LogSet.m_CopyName = pIniFile->ReadInteger(pKey, "CopyName", m_LogSet.m_CopyName); + m_LogSet.m_CopyQTH = pIniFile->ReadInteger(pKey, "CopyQTH", m_LogSet.m_CopyQTH); + m_LogSet.m_CopyREM = pIniFile->ReadInteger(pKey, "CopyREM", m_LogSet.m_CopyREM); + m_LogSet.m_CopyQSL = pIniFile->ReadInteger(pKey, "CopyQSL", m_LogSet.m_CopyQSL); + m_LogSet.m_CopyREMB4 = pIniFile->ReadInteger(pKey, "CopyREMB4", m_LogSet.m_CopyREMB4); + + m_LogSet.m_CheckBand = pIniFile->ReadInteger(pKey, "CheckBand", m_LogSet.m_CheckBand); + + m_LogSet.m_AutoSave = pIniFile->ReadInteger(pKey, "AutoSave", m_LogSet.m_AutoSave); + m_LogSet.m_QSOMacroFlag = pIniFile->ReadInteger(pKey, "QSOMacroFlag", m_LogSet.m_QSOMacroFlag); + AnsiString as, ws; + int i; + for( i = 0; i < 5; i++ ){ + sprintf(bf, "QSOMacro%u", i+1); + m_LogSet.m_QSOMacro[i] = pIniFile->ReadInteger(pKey, bf, m_LogSet.m_QSOMacro[i]); + sprintf(bf, "QSOMacroKey%u", i+1); + m_LogSet.m_QSOMacroKey[i] = (WORD)pIniFile->ReadInteger(pKey, bf, m_LogSet.m_QSOMacroKey[i]); + sprintf(bf, "QSOMacroStr%u", i+1); + CrLf2Yen(ws, m_LogSet.m_QSOMacroStr[i]); + as = pIniFile->ReadString(pKey, bf, ws); + Yen2CrLf(m_LogSet.m_QSOMacroStr[i], as); + } + m_LogSet.m_THRTTY = pIniFile->ReadString(pKey, "THRTTY", m_LogSet.m_THRTTY); + m_LogSet.m_THSSTV = pIniFile->ReadString(pKey, "THSSTV", m_LogSet.m_THSSTV); + m_LogSet.m_THTZ = pIniFile->ReadInteger(pKey, "THTZ", m_LogSet.m_THTZ); + m_LogSet.m_ClipRSTADIF = pIniFile->ReadInteger(pKey, "ClipRSTADIF", m_LogSet.m_ClipRSTADIF); + + m_LogSet.m_Backup = pIniFile->ReadInteger(pKey, "Backup", m_LogSet.m_Backup); + AnsiString ss; + GetHamlog5FieldsLen(ss); + as = pIniFile->ReadString(pKey, "TH5Fields", ss); + SetHamlog5FieldsLen(as); +} + +void CLogFile::WriteIniFile(LPCSTR pKey, TMemIniFile *pIniFile) +{ + char bf[64]; + + pIniFile->WriteInteger(pKey, "TimeZone", m_LogSet.m_TimeZone); + pIniFile->WriteInteger(pKey, "DateType", m_LogSet.m_DateType); + + pIniFile->WriteInteger(pKey, "UpperName", m_LogSet.m_UpperName); + pIniFile->WriteInteger(pKey, "UpperQTH", m_LogSet.m_UpperQTH); + pIniFile->WriteInteger(pKey, "UpperREM", m_LogSet.m_UpperREM); + pIniFile->WriteInteger(pKey, "UpperQSL", m_LogSet.m_UpperQSL); + + pIniFile->WriteInteger(pKey, "DefMyRST", m_LogSet.m_DefMyRST); + pIniFile->WriteInteger(pKey, "Contest", m_LogSet.m_Contest); + + pIniFile->WriteInteger(pKey, "CopyFreq", m_LogSet.m_CopyFreq); + pIniFile->WriteInteger(pKey, "CopyHis", m_LogSet.m_CopyHis); + pIniFile->WriteInteger(pKey, "CopyName", m_LogSet.m_CopyName); + pIniFile->WriteInteger(pKey, "CopyQTH", m_LogSet.m_CopyQTH); + pIniFile->WriteInteger(pKey, "CopyREM", m_LogSet.m_CopyREM); + pIniFile->WriteInteger(pKey, "CopyQSL", m_LogSet.m_CopyQSL); + pIniFile->WriteInteger(pKey, "CopyREMB4", m_LogSet.m_CopyREMB4); + + pIniFile->WriteInteger(pKey, "CheckBand", m_LogSet.m_CheckBand); + + pIniFile->WriteInteger(pKey, "AutoSave", m_LogSet.m_AutoSave); + pIniFile->WriteInteger(pKey, "QSOMacroFlag", m_LogSet.m_QSOMacroFlag); + AnsiString as; + int i; + for( i = 0; i < 5; i++ ){ + sprintf(bf, "QSOMacro%u", i+1); + pIniFile->WriteInteger(pKey, bf, m_LogSet.m_QSOMacro[i]); + sprintf(bf, "QSOMacroKey%u", i+1); + pIniFile->WriteInteger(pKey, bf, m_LogSet.m_QSOMacroKey[i]); + sprintf(bf, "QSOMacroStr%u", i+1); + CrLf2Yen(as, m_LogSet.m_QSOMacroStr[i]); + pIniFile->WriteString(pKey, bf, as); + } + pIniFile->WriteString(pKey, "THRTTY", m_LogSet.m_THRTTY); + pIniFile->WriteString(pKey, "THSSTV", m_LogSet.m_THSSTV); + pIniFile->WriteInteger(pKey, "THTZ", m_LogSet.m_THTZ); + pIniFile->WriteInteger(pKey, "ClipRSTADIF", m_LogSet.m_ClipRSTADIF); + + pIniFile->WriteInteger(pKey, "Backup", m_LogSet.m_Backup); + GetHamlog5FieldsLen(as); + pIniFile->WriteString(pKey, "TH5Fields", as); +} + +void CLogFile::MakeIndex(void) +{ + if( !m_Open ) return; + + m_Index.MakeIndex(m_Handle, &m_fhd); + m_EditFlag = 1; +} + +void CLogFile::MakePathName(LPCSTR pName) +{ + char bf[256]; + + m_Name = pName; + sprintf(bf, "%s%s", MMLogDir, pName); + SetEXT(bf, ".MDT"); + m_FileName = bf; +} + +void CLogFile::MakeName(LPCSTR pPathName) +{ + if( pPathName != m_FileName.c_str() ) m_FileName = pPathName; + + char drive[_MAX_DRIVE]; + char dir[_MAX_DIR]; + char name[_MAX_FNAME]; + char ext[_MAX_EXT]; + AnsiString Dir; + + ::_splitpath( pPathName, drive, dir, name, ext ); + Dir = drive; + Dir += dir; + m_Name = name; + m_Name += ext; + if( Dir.IsEmpty() ){ + if( !MMLogDir[0] ) strcpy(MMLogDir, BgnDir); + MakePathName(m_Name.c_str()); + } + else { + strncpy(MMLogDir, Dir.c_str(), 128); + } +} + +void CLogFile::DoBackup(void) +{ + if( !Log.m_LogSet.m_Backup ) return; + if( m_FileName.IsEmpty() ) return; + + FILE *sfp = fopen(m_FileName.c_str(), "rb"); + if( sfp == NULL ) return; + + char tname[256]; + strcpy(tname, m_FileName.c_str()); + SetEXT(tname, "_BAK.MDT"); + FILE *tfp = fopen(tname, "rb"); + if( tfp != NULL ){ + long slen = filelength(fileno(sfp)); + long tlen = filelength(fileno(tfp)); + fclose(tfp); + if( slen <= tlen ){ + fclose(sfp); + return; + } + } + fclose(sfp); + ::CopyFile(m_FileName.c_str(), tname, FALSE); +} + +int CLogFile::Close(void) +{ + int r = TRUE; + if( m_Open ){ + if( m_EditFlag ){ + if( m_fhd.size ){ + SDMMLOG sd; + + GetData(&sd, m_fhd.size - 1); + if( !sd.date || !sd.btime ){ + DeleteLast(); + } + } + chsize(m_Handle, (m_fhd.size * (ULONG)sizeof(SDMMLOG))+(ULONG)FHDOFF ); + m_Index.WriteIndex(m_Handle, &m_fhd); // ƒCƒ“ƒfƒbƒNƒX‚ÌŠi”[ + lseek(m_Handle, 0L, SEEK_SET); + if( write( m_Handle, &m_fhd, sizeof(m_fhd) ) != sizeof(m_fhd) ){ + ErrorMB("'%s'‚É‘‚«‚±‚Ý‚ª‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½.", m_FileName.c_str()); + r = FALSE; + } + } + if( close(m_Handle) ){ + if( r != FALSE ){ + ErrorMB("'%s'‚É‘‚«‚±‚Ý‚ª‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½.", m_FileName.c_str()); + r = FALSE; + } + } +// if( !m_fhd.size ) unlink(m_FileName.c_str()); // 0Œ‚ÌŽž‚ÍÁ‹Ž + m_Open = 0; + } + m_EditFlag = 0; + m_Index.ClearIndex(); + return r; +} + +void CLogFile::InitHeader(void) +{ + memset(&m_fhd, 0, sizeof(m_fhd)); + strcpy(m_fhd.id, MMLOGID); + m_fhd.size = 0L; + m_fhd.mlt = 0; +} + +int CLogFile::Open(LPCSTR pName, BOOL fNew) +{ + CWaitCursor w; + Close(); + InitHeader(); + + if( pName == NULL ) pName = m_FileName.c_str(); + int omode = O_RDWR|O_BINARY; // ‰‰ñ‚ÍV‹K쬂Ȃµ‚ŃI[ƒvƒ“ + int n = 0; + while(1){ + if( (m_Handle = open(pName, omode, S_IREAD|S_IWRITE)) > 0 ){ + if( read(m_Handle, &m_fhd, sizeof(m_fhd)) == sizeof(m_fhd) ){ + if( !strcmp(m_fhd.id, MMLOGID) ){ + if( m_Index.ReadIndex(m_Handle, &m_fhd) != TRUE ){ + m_Index.MakeIndex(m_Handle, &m_fhd); + } + m_Open = 1; + MakeName(pName); + m_Find.Clear(); + SetLastPos(); + memcpy(&m_asd, &m_sd, sizeof(m_asd)); + return TRUE; + } + else { + close(m_Handle); + ErrorMB("'%s' is not a correct format.", pName); + } + } + else if( omode & O_CREAT ){ // V‹Kƒtƒ@ƒCƒ‹@2‰ñ–ڂ̃pƒX‚Ì‚Ý + InitHeader(); + if( write(m_Handle, &m_fhd, sizeof(m_fhd)) != sizeof(m_fhd) ){ + close(m_Handle); + ErrorMB("Cannot open '%s'.", pName); + } + else { + m_Open = 1; + MakeName(pName); + m_Index.ClearIndex(); + m_Find.Clear(); + SetLastPos(); + memcpy(&m_asd, &m_sd, sizeof(m_asd)); + return TRUE; + } + } + else { // Šù‘¶‚̃tƒBƒAƒ‹ + close(m_Handle); + ErrorMB("Cannot open '%s'.", pName); + } + return FALSE; + } + // ƒI[ƒvƒ“ƒGƒ‰[‚Ìê‡ + if( !(omode & O_CREAT) && (errno == ENOENT) ){ // ‚P‰ñ–ڂŃtƒ@ƒCƒ‹‚ª‘¶Ý‚µ‚È‚¢ê‡ + n++; + if( n >= 2 ){ + if( fNew ){ + if( YesNoMB((sys.m_WinFontCharset != SHIFTJIS_CHARSET) ? "Log file (%s) does not exist, create it ?" : "ƒƒOƒtƒ@ƒCƒ‹(%s)‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ. V‹K‚É쬂µ‚Ü‚·‚© ?", pName) != IDYES ) return FALSE; + } + omode |= O_CREAT; // 2‰ñ–Ú‚ÍV‹K쬕t‚«‚ŃI[ƒvƒ“ + } + else { + ::Sleep(1000); + } + } + else if( IsFile(pName) && (GetFileAttributes(pName) & FILE_ATTRIBUTE_READONLY) ){ + ErrorMB("'%s' is read-only.", pName); + return FALSE; + } + else { + ErrorMB("Cannot open '%s'.", pName); + return FALSE; + } + } +} + +void CLogFile::InitCur(void) +{ + SetLastPos(); +} + +void CLogFile::SetLastPos(void) +{ + m_CurNo = m_fhd.size; + memset(&m_sd, 0, sizeof(SDMMLOG)); + + int n = m_CurNo - 1; + if( n >= 0 ){ + SDMMLOG sd; + + GetData(&sd, n); + if( !sd.etime ){ + m_CurNo = n; + memcpy(&m_sd, &sd, sizeof(SDMMLOG)); + } + } + else { + m_sd.band = B_14; + m_sd.mode = 5; + m_sd.env = 1; + } + CopyAF(); + m_CurChg = 0; +} + +int CLogFile::GetData(SDMMLOG *sp, int n) +{ + if( !m_Open || (n >= m_fhd.size) ){ + memset(sp, 0, sizeof(SDMMLOG)); + if( !n ){ + m_sd.band = B_14; + m_sd.mode = 5; + } + return FALSE; + } + if( lseek(m_Handle, (ULONG)FHDOFF + ((ULONG)n * (ULONG)sizeof(SDMMLOG)), SEEK_SET) == -1L ){ + memset(sp, 0, sizeof(SDMMLOG)); + return FALSE; + } + if( read( m_Handle, sp, sizeof(SDMMLOG) ) != sizeof(SDMMLOG) ){ + memset(sp, 0, sizeof(SDMMLOG)); + return FALSE; + } + else { + return TRUE; + } +} + +int CLogFile::PutData(SDMMLOG *sp, int n) +{ + if( !m_Open ){ + if( m_FileName.IsEmpty() ){ + ErrorMB("ƒƒOƒtƒ@ƒCƒ‹‚Ì–¼‘O‚ª’è‹`‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ."); + return FALSE; + } + if( Open(m_FileName.c_str()) != TRUE ) return FALSE; + } + if( lseek(m_Handle, (ULONG)FHDOFF + ((ULONG)n * (ULONG)sizeof(SDMMLOG)), SEEK_SET) == -1L ){ + ErrorMB( "'%s'‚Ö‚Ì‘‚«‚±‚݂Ɏ¸”s‚µ‚Ü‚µ‚½.", m_FileName.c_str()); + return FALSE; + } + if( write( m_Handle, sp, sizeof(SDMMLOG) ) != sizeof(SDMMLOG) ){ + ErrorMB( "'%s'‚Ö‚Ì‘‚«‚±‚݂Ɏ¸”s‚µ‚Ü‚µ‚½.", m_FileName.c_str()); + return FALSE; + } + else { + m_EditFlag = 1; + if( m_CurNo == n ) m_CurChg = 1; + if( n >= m_fhd.size ) m_fhd.size = n + 1; + m_Index.WriteIndex(sp->call, n); + } + return TRUE; +} + +LPCSTR CLogFile::GetOptStr(int n, SDMMLOG *sp) +{ + switch(n){ + case 0: + return sp->opt1; + case 1: + return sp->opt2; + case 2: + if( !sp->ur[MLRST-MLOPT-1] && sp->ur[MLRST-MLOPT] ){ + return &sp->ur[MLRST-MLOPT]; + } + else { + return ""; + } + case 3: + if( !sp->my[MLRST-MLOPT-1] && sp->my[MLRST-MLOPT] ){ + return &sp->my[MLRST-MLOPT]; + } + else { + return ""; + } + default: + return ""; + } +} + +void CLogFile::SetOptStr(int n, SDMMLOG *sp, LPCSTR pOpt) +{ + switch(n){ + case 0: + StrCopy(sp->opt1, pOpt, MLOPT); + jstrupr(sp->opt1); + break; + case 1: + StrCopy(sp->opt2, pOpt, MLOPT); + jstrupr(sp->opt2); + break; + case 2: + if( *pOpt ){ + StrCopy(&sp->ur[MLRST-MLOPT], pOpt, MLOPT); + jstrupr(&sp->ur[MLRST-MLOPT]); + sp->ur[MLRST-MLOPT-1] = 0; + } + else if( !sp->ur[MLRST-MLOPT-1] ){ + sp->ur[MLRST-MLOPT] = 0; + } + break; + case 3: + if( *pOpt ){ + StrCopy(&sp->my[MLRST-MLOPT], pOpt, MLOPT); + jstrupr(&sp->my[MLRST-MLOPT]); + sp->my[MLRST-MLOPT-1] = 0; + } + else if( !sp->my[MLRST-MLOPT-1] ){ + sp->my[MLRST-MLOPT] = 0; + } + break; + default: + break; + } +} + +void CLogFile::SetHisUTC(void) +{ + if( m_LogSet.m_CopyHis == 2 ){ + int tim; + char bf[MLRST+1]; + _strdmcpy(bf, m_sd.ur, '-'); + if( m_sd.btime ){ + tim = m_sd.btime / 30; + if( tim >= (9 * 60) ){ + tim -= 9 * 60; + } + else { + tim += 15 * 60; + } + } + else { + GetUTC(&m_UTC); + tim = m_UTC.wHour * 60 + m_UTC.wMinute; + } + char bbf[16]; + sprintf(bbf, "-%02u%02u", tim/60, tim%60); + strcat(bf, bbf); + strcpy(m_sd.ur, bf); + } +} + +void CLogFile::SetHisRST(SDMMLOG *sp) +{ + int n; + + switch(m_LogSet.m_CopyHis){ + case 0: + if( sp == NULL ){ + strcpy(m_sd.ur, "599"); + } + else { + strcpy(m_sd.ur, sp->ur); + memcpy(m_sd.ur, "599", 3); + } + break; + case 1: + case 2: + if( sp == NULL ){ + strcpy(m_sd.ur, "599001"); + } + else { + if( sp->ur[0] ){ + char bf[MLRST+1]; + _strdmcpy(bf, &sp->ur[3], '-'); + n = atoin(bf, -1); + } + else { + n = 0; + } + n++; + if( n >= 10000 ){ + sprintf(m_sd.ur, "599%04u", n); + } + else { + sprintf(m_sd.ur, "599%03u", n); + } + } + if( m_LogSet.m_CopyHis == 2 ) SetHisUTC(); + break; + } +} + +void CLogFile::CopyAF(void) +{ + int n = m_CurNo - 1; + if( n >= 0 ){ + SDMMLOG sd; + GetData(&sd, n); + if( !m_sd.band ){ + m_sd.band = sd.band; + if( m_LogSet.m_CopyFreq ){ + m_sd.fq = sd.fq; + } + else { + m_sd.fq = 0; + } + } + if( !m_sd.env ){ + m_sd.env = sd.env; + } + if( !m_sd.pow[0] ){ + strcpy(m_sd.pow, sd.pow); + } + if( !m_sd.ur[0] ){ + SetHisRST(&sd); + } + if( m_LogSet.m_CopyREMB4 ){ + strcpy(m_sd.rem, sd.rem); + } + } + else { + if( !m_sd.band ){ + m_sd.band = B_14; + m_sd.fq = 0; + } + if( !m_sd.env ){ + m_sd.env = 1; + } + if( !m_sd.ur[0] ){ + SetHisRST(NULL); + } + } + if( !m_sd.mode ) m_sd.mode = 5; // RTTY + if( m_LogSet.m_DefMyRST ){ + if( !m_sd.my[0] ){ + strcpy(m_sd.my, "599"); + } + } +} + +static int _cmpdate(SDMMLOG *s, SDMMLOG *t) +{ + int r = YEAR(s->year) - YEAR(t->year); + if( r ) return r; + r = s->date - t->date; + if( r ) return r; + return s->btime - t->btime; +} + +void CLogFile::SortDate(int bb, int eb) +{ + int gap, i, j, em; + SDMMLOG sd1, sd2; + + CWaitCursor w; + if( bb != eb ){ + em = eb - bb; + for( gap = (em + 1)/2; gap > 0; gap /= 2 ){ + for( i = gap; i <= em; i++ ){ + for( j = i - gap; j >= 0; j -= gap ){ + GetData(&sd1, bb+j); + GetData(&sd2, bb+j+gap); + if( _cmpdate(&sd1, &sd2) <= 0 ) break; + PutData(&sd1, bb+j+gap); + PutData(&sd2, bb+j); + } + } + } + } + m_EditFlag = 1; +} + +int CLogFile::FindSameBand(void) +{ + if( !m_sd.call[0] ) return 0; + char call[MLCALL+1]; + SDMMLOG sd; + + int i; + for( i = 0; i < m_Find.GetCount(); i++ ){ + m_Index.ReadIndex(call, m_Find.pFindTbl[i]); + if( !strcmp(call, m_sd.call) ){ + GetData(&sd, m_Find.pFindTbl[i]); + if( (sd.band == m_sd.band)&&(sd.mode == m_sd.mode) ) return 1; + } + } + return 0; +} + +void CLogFile::FindStrSet(CLogFind *fp, LPCSTR pCall) +{ + if( !*pCall ) return; + if( fp->GetCount() >= FINDMAX ) return; + char call[MLCALL+1]; + + int i; + for( i = m_fhd.size - 1; i >= 0; i-- ){ + m_Index.ReadIndex(call, i); + if( strstr(call, pCall)!=NULL ){ + fp->Add(i); + if( fp->GetCount() >= FINDMAX ) break; + } + } +} + +int CLogFile::FindCmpSet(CLogFind *fp, LPCSTR pCall) +{ + if( fp->GetCount() >= FINDMAX ) return 0; + char call[MLCALL+1]; + + int i; + for( i = m_fhd.size - 1; i >= 0; i-- ){ + if( *pCall ){ + m_Index.ReadIndex(call, i); + if( !strcmp(call, pCall) ){ + fp->Write(i); + } + } + else { + fp->Write(i); + } + if( fp->GetCount() >= FINDMAX ) break; + } + return fp->GetCount(); +} + +int CLogFile::FindClipSet(CLogFind *fp, LPCSTR pCall) +{ + if( !*pCall ) return 0; + if( fp->GetCount() >= FINDMAX ) return 0; + char call[MLCALL+1]; + + int i; + for( i = m_fhd.size - 1; i >= 0; i-- ){ + m_Index.ReadIndex(call, i); + if( !strcmp(ClipCall(call), pCall) ){ + fp->Add(i); + } + if( fp->GetCount() >= FINDMAX ) break; + } + return fp->GetCount(); +} + +int CLogFile::FindSet(CLogFind *fp, LPCSTR pCall) +{ + fp->SetText(pCall); + fp->Clear(); + int r = FindCmpSet(fp, pCall); + fp->m_FindCmp1Max = fp->m_FindCnt; + char clipcall[MLCALL+1]; + strcpy(clipcall, ClipCall(pCall)); + if( FindClipSet(fp, clipcall) ){ + r = 1; + } + fp->m_FindCmp2Max = fp->m_FindCnt; + FindStrSet(fp, pCall); + fp->m_FindStr1Max = fp->m_FindStr2Max = fp->m_FindCnt; + if( strcmp(pCall, clipcall) ){ + FindStrSet(fp, clipcall); + fp->m_FindStr2Max = fp->m_FindCnt; + } + return r; +} + +int CLogFile::Find(LPCSTR pCall, int b, int dir) +{ + if( !m_fhd.size ) return -1; + char call[MLCALL+1]; + + int i; + if( dir ){ + for( i = b; i >= 0; i-- ){ + m_Index.ReadIndex(call, i); + if( strstr(call, pCall) != NULL ) return i; + } + } + else { + for( i = b; i < m_fhd.size; i++ ){ + m_Index.ReadIndex(call, i); + if( strstr(call, pCall) != NULL ) return i; + } + } + return -1; +} + +int CLogFile::IsAlready(LPCSTR pCall) +{ + if( !m_fhd.size ) return -1; + char call[MLCALL+1]; + + for( int i = m_CurNo; i >= 0; i-- ){ + m_Index.ReadIndex(call, i); + if( !strcmp(call, pCall) ) return i; + } + return -1; +} + +void CLogFile::DeleteAll(void) +{ + m_fhd.size = 0; + m_CurNo = m_fhd.size; + m_CurChg = 1; + m_EditFlag = 1; +} + +void CLogFile::DeleteLast(void) +{ + if( m_fhd.size ){ + m_fhd.size--; + } + m_CurNo = m_fhd.size; + m_CurChg = 1; + m_EditFlag = 1; +} + +void CLogFile::Delete(int top, int end) +{ + if( !m_fhd.size ) return; + + if( end >= (m_fhd.size - 1) ){ // ÅŒã‚Ü‚Å휂·‚éê‡ + m_fhd.size = top; + m_CurNo = m_fhd.size; + } + else { // “r’†‚ð휂·‚éê‡ + int i, j; + SDMMLOG sd; + for( i = top, j = end + 1; j < m_fhd.size; i++, j++ ){ + GetData(&sd, j); + PutData(&sd, i); + } + m_fhd.size -= end - top + 1; + m_CurNo = m_fhd.size; + } + SetLastPos(); + m_CurChg = 1; + m_EditFlag = 1; +} + +void CLogFile::Insert(int n, SDMMLOG *sp) +{ + if( n >= m_fhd.size ){ // ÅIˆÊ’u‚Ìꇂ͒ljÁ‚Æ“¯‚¶ + PutData(sp, n); + m_CurNo++; + } + else { // “r’†‚ð휂·‚éê‡ + int i, j; + SDMMLOG sd; + i = m_fhd.size; + j = i - 1; + for( ; i > n; i--, j-- ){ + GetData(&sd, j); + PutData(&sd, i); + } + PutData(sp, n); + m_CurNo++; + m_CurChg = 0; + } + m_EditFlag = 1; +} + +LPCSTR CLogFile::GetDateString(SDMMLOG *sp, int sw) +{ + static char bf[12]; + + if( sp->date ){ + switch(sw){ + case 1: // yyyy-mm-dd + sprintf(bf, "%04u.%02u.%02u", YEAR(sp->year), sp->date/100, sp->date%100); + break; + case 2: // dd-mm-yy + sprintf(bf, "%02u.%02u.%02u", sp->date%100, sp->date/100, sp->year); + break; + case 3: // dd-mm-yyyy + sprintf(bf, "%02u.%02u.%04u", sp->date%100, sp->date/100, YEAR(sp->year)); + break; + case 4: // mm-dd-yy + sprintf(bf, "%02u.%02u.%02u", sp->date/100, sp->date%100, sp->year); + break; + case 5: // mm-dd-yyyy + sprintf(bf, "%02u.%02u.%04u", sp->date/100, sp->date%100, YEAR(sp->year)); + break; + default: // yy-mm-dd + sprintf(bf, "%02u.%02u.%02u", sp->year, sp->date/100, sp->date%100); + break; + } + } + else { + bf[0] = 0; + } + return bf; +} + +LPCSTR CLogFile::GetTimeString(WORD d) +{ + static char bf[8]; + + if( d ){ + d = WORD(d / 30); + sprintf(bf, "%02u%02u", d / 60, d % 60); + } + else { + bf[0] = 0; + } + return bf; +} + +LPCSTR CLogFile::GetModeString(BYTE m) +{ + if( m < MODEMAX ){ + return _mode[m]; + } + else { + m -= BYTE(MODEMAX); + StrCopy(m_modebuf, m_fhd.mode[m], 6); + return m_modebuf; + } +} + +void CLogFile::SetMode(SDMMLOG *sp, LPCSTR s) +{ + if( !*s ){ + sp->mode = 0; + return; + } + + int n; + const char **t; + char bf[7]; + StrCopy(bf, s, 6); + jstrupr(bf); + s = bf; + int len = strlen(s); + for( n = 0, t = _mode; *t != NULL; t++, n++ ){ + if( !strcmp(*t, s) ){ + sp->mode = BYTE(n); + return; + } + } + for( n = 0; (n < UMODEMAX) && m_fhd.mode[n][0] ; n++ ){ + char vbf[7]; + StrCopy(vbf, m_fhd.mode[n], 6); + if( !strcmp(vbf, s) ){ + sp->mode = BYTE(n + MODEMAX); + return; + } + } + if( n < UMODEMAX ){ + if( len < 6 ){ + strcpy(m_fhd.mode[n], s); + } + else { + memcpy(m_fhd.mode[n], s, 6); + } + sp->mode = BYTE(n + MODEMAX); + } + else { + sp->mode = 0; + } +} + +LPCSTR CLogFile::GetFreqString(BYTE b, short fq) +{ + static char bf[12]; + int d; + + if( fq < 0 ){ + sprintf( bf, "%s/%s", _band[b], _band[-fq]); + return(bf); + } + else if( fq ){ + switch(b){ + case 0: + return ""; + case B_19: /* 1.9 */ + if( fq == 800 ){ + strcpy(bf, "1.8"); + } + else { + sprintf( bf, "1.%03u", fq ); + } + break; + case B_35: /* 3.5 */ + sprintf( bf, "3.%03u", fq ); + break; + case B_38: /* 3.8 */ + sprintf( bf, "3.%03u", fq ); + break; + case B_1200: + d = 1240 + (fq / 100); + sprintf( bf, "%u.%02u", d, fq % 100 ); + break; + case B_2400: + d = 2350 + (fq / 100); + sprintf( bf, "%u.%02u", d, fq % 100 ); + break; + case B_220: + d = 220 + (fq / 1000); + sprintf( bf, "%u.%03u", d, fq % 1000 ); + break; + default: + if( b <= B_24 ){ + sprintf( bf, "%s.%03u", _band[b], fq ); + } + else if( b <= B_430 ){ + d = atoin(_band[b], -1) + (fq / 1000); + sprintf( bf, "%u.%03u", d, fq % 1000 ); + } + else { + return(_band[b]); + } + break; + } + return(bf); + } + else { + return(_band[b]); + } +} + +/*#$% +=============================================================== + ƒoƒ“ƒh”Ô†‚𓾂é +--------------------------------------------------------------- + p : •¶Žš—ñ‚̃|ƒCƒ“ƒ^ +--------------------------------------------------------------- +--------------------------------------------------------------- +=============================================================== +*/ +static BYTE _bandno_(LPCSTR p) +{ + char n; + const char **t; + + for( n = 0, t = _band; *t != NULL; t++, n++ ){ + if( !strcmp(*t, p) ) return(n); + } + return(0); +} + +/*#$% +=============================================================== + ƒoƒ“ƒh”Ô†‚𓾂é +--------------------------------------------------------------- + p : •¶Žš—ñ‚̃|ƒCƒ“ƒ^ +--------------------------------------------------------------- +--------------------------------------------------------------- +=============================================================== +*/ +void CLogFile::SetFreq(SDMMLOG *sp, LPCSTR p) +{ + BYTE n; + char ub[16], db[16]; + int ud, d; + + sp->fq = 0; + if( strchr(p, '/' )!=NULL ){ + p = _strdmcpy(ub, p, '/'); + if( (n = _bandno_(ub))!= 0 ){ + if( (sp->fq = _bandno_(p))!= 0 ){ + sp->fq = SHORT(-sp->fq); + sp->band = n; + return; + } + } + sp->band = 0; + return; + } + if( (n = _bandno_(p))!= 0 ){ + sp->band = n; + return; + } + if( strchr(p, '.')!=NULL ){ + p = _strdmcpy(ub, p, '.'); + memset(db, 0, 4); + strcpy(db, p); + db[3] = 0; + for( n = 0; n < 3; n++ ){ + if( !db[n] ) db[n] = '0'; + } + ud = atoin(ub, -1); + d = atoin(db, -1); + } + else { + ud = atoin(p, -1); + d = 0; + } + if( ud == 1 ){ + sp->fq = SHORT(d); + sp->band = B_19; + } + else if( ud == 3 ){ + sp->fq = SHORT(d); + if( d >= 700 ){ + n = B_38; + } + else { + n = B_35; + } + sp->band = n; + } + else if( (ud >= 7) && (ud <= 24) ){ + sp->fq = SHORT(d); + if( (n = _bandno_(ub))!= 0 ){ + sp->band = n; + return; + } + sp->fq = 0; + sp->band = 0; + } + else if( (ud >= 28)&&(ud <= 29) ){ + sp->fq = SHORT(((ud - 28) * 1000) + d); + sp->band = B_28; + } + else if( (ud >= 50)&&(ud <= 54) ){ + sp->fq = SHORT(((ud - 50) * 1000) + d); + sp->band = B_50; + } + else if( (ud >= 144) && (ud <= 147) ){ + sp->fq = SHORT(((ud - 144) * 1000) + d); + sp->band = B_144; + } + else if( (ud >= 430) && (ud <= 440) ){ + sp->fq = SHORT(((ud - 430) * 1000) + d); + sp->band = B_430; + } + else if( (ud >= 220) && (ud <= 225) ){ + sp->fq = SHORT(((ud - 220) * 1000) + d); + sp->band = B_220; + } + else if( (ud >= 1240) && (ud <= 1300) ){ + sp->fq = SHORT(((ud - 1240) * 100) + (d/10)); + sp->band = B_1200; + } + else if( (ud >= 2350) && (ud <= 2450) ){ + sp->fq = SHORT(((ud - 2350) * 100) + (d/10)); + sp->band = B_2400; + } + else { + sp->band = 0; + } +} + +int CLogFile::ReadAscii(SDMMLOG *sp, LPSTR p) +{ + LPSTR t; + int y, m, d; + + memset(sp, 0, sizeof(SDMMLOG)); + p = StrDlm(t, p); /* DATE */ + if( sscanf(t, "%u.%u.%u", &y, &m, &d )!=3 ) return FALSE; + sp->year = BYTE(y%100); + sp->date = WORD((m * 100) + d); + p = StrDlm(t, p); /* BGN */ + if( sscanf(t, "%u.%u", &d, &y) != 2 ){ + d = atoin(t, -1); + y = 0; + } + m = d / 100; + d = d % 100; + y /= 2; + sp->btime = WORD((((m * 60) + d) * 30) + y); + p = StrDlm(t, p); /* CALL */ + StrCopy(sp->call, t, MLCALL); + p = StrDlm(t, p); /* UR */ + StrCopy(sp->ur, t, MLRST); + p = StrDlm(t, p); /* MY */ + StrCopy(sp->my, t, MLRST); + p = StrDlm(t, p); /* BAND */ + SetFreq(sp, t); + p = StrDlm(t, p); /* MODE */ + SetMode(sp, t); + p = StrDlm(t, p); /* POW */ + StrCopy(sp->pow, t, MLPOW); + p = StrDlm(t, p); /* NAME */ + StrCopy(sp->name, t, MLNAME); + p = StrDlm(t, p); /* QTH */ + StrCopy(sp->qth, t, MLQTH); + p = StrDlm(t, p); /* REM */ + StrCopy(sp->rem, t, MLREM); + p = StrDlm(t, p); /* QSL */ + StrCopy(sp->qsl, t, MLQSL); + p = StrDlm(t, p); /* ETIME*/ + d = atoin(t, -1); + m = d / 100; + d = d % 100; + sp->etime = WORD(((m * 60) + d) * 30); + p = StrDlm(t, p); /* S */ + sp->send = *t; + p = StrDlm(t, p); /* R */ + sp->recv = *t; + p = StrDlm(t, p); /* M */ + sp->cq = *t; + p = StrDlm(t, p); /* ENV */ + sp->env = WORD(atoin(t, -1)); + p = StrDlm(t, p); /* OPT1 */ + StrCopy(sp->opt1, t, MLOPT); + p = StrDlm(t, p); /* OPT2 */ + StrCopy(sp->opt2, t, MLOPT); + p = StrDlm(t, p); /* USR1 */ + if( *t ) SetOptStr(2, sp, t); + StrDlm(t, p); /* USR2 */ + if( *t ) SetOptStr(3, sp, t); + return TRUE; +} + +void JSTtoUTC(int &Year, int &Mon, int &Day, int &Hour) +{ + + Hour -= 9; + if( Hour < 0 ){ + Hour += 24; + Day--; + if( Day < 1 ){ + Mon--; + if( Mon < 1 ){ + Mon = 12; + if( Year ){ + Year--; + } + else { + Year = 99; + } + } + if( Year % 4 ){ + Day = MONN[Mon]; + } + else { + Day = MONU[Mon]; + } + } + } +} + +void JSTtoUTC(SDMMLOG *sp) +{ + int Year = sp->year; + int Mon = sp->date / 100; + int Day = sp->date % 100; + int Hour = sp->btime / (60*30); + if( sp->date || sp->btime ){ + JSTtoUTC(Year, Mon, Day, Hour); + sp->year = BYTE(Year); + sp->date = WORD(Mon * 100 + Day); + sp->btime = WORD((sp->btime % 1800) + (Hour * 1800)); + } + if( sp->etime ){ + // JST to UTC + if( sp->etime >= (9*60*30) ){ + sp->etime -= WORD(9 * 60 * 30); + } + else { + sp->etime += WORD(15 * 60 * 30); + } + if( !sp->etime ) sp->etime++; + } +} + +void UTCtoJST(int &Year, int &Mon, int &Day, int &Hour) +{ + LPCSTR mt; + + Hour += 9; + if( Hour >= 24 ){ + Hour -= 24; + Day++; + if( Year % 4 ){ + mt = MONN; + } + else { + mt = MONU; + } + if( Day > mt[Mon] ){ + Day = 1; + Mon++; + if( Mon > 12 ){ + Mon = 1; + Year++; + if( Year >= 100 ) Year = 0; + } + } + } +} + +void UTCtoJST(SDMMLOG *sp) +{ + int Year = sp->year; + int Mon = sp->date / 100; + int Day = sp->date % 100; + int Hour = sp->btime / (60*30); + if( sp->date || sp->btime ){ + UTCtoJST(Year, Mon, Day, Hour); + sp->year = BYTE(Year); + sp->date = WORD(Mon * 100 + Day); + sp->btime = WORD((sp->btime % 1800) + (Hour * 1800)); + } + if( sp->etime ){ + // UTC to JST + if( sp->etime >= (15*60*30) ){ + sp->etime -= WORD(15 * 60 * 30); + } + else { + sp->etime += WORD(9 * 60 * 30); + } + if( !sp->etime ) sp->etime++; + } +} + +void mBandToBand(SDMMLOG *sp, LPCSTR p) +{ + int m; + + sp->fq = 0; + if( !strcmpi(p, "SAT") ){ + sp->band = 0; + } + else if( sscanf(p, "%u", &m) == 1 ){ + switch(m){ + case 2: + sp->band = B_144; + break; + case 6: + sp->band = B_50; + break; + case 10: + sp->band = B_28; + break; + case 12: + sp->band = B_24; + break; + case 15: + sp->band = B_21; + break; + case 17: + sp->band = B_18; + break; + case 20: + sp->band = B_14; + break; + case 30: + sp->band = B_10; + break; + case 40: + sp->band = B_7; + break; + case 75: + sp->band = B_38; + break; + case 80: + sp->band = B_35; + break; + case 160: + sp->band = B_19; + sp->fq = 800; + break; + } + } +} + +LPCSTR FreqTomBand(SDMMLOG *sp) +{ + return _mBand[sp->band]; +} + + diff --git a/LogFile.h b/LogFile.h new file mode 100644 index 0000000..7ec4880 --- /dev/null +++ b/LogFile.h @@ -0,0 +1,287 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------------- +#ifndef LogFileH +#define LogFileH + +#include "ComLib.h" +//--------------------------------------------------------------------------- +#define MMLOGID "MMLOG DATA Ver1.00\032" + +enum { + testOFF, + testON, + testCQRJ, + testPED, + testBARTG, +}; + +typedef struct { // Log‚Ì“®ìƒIƒvƒVƒ‡ƒ“ + char m_TimeZone; // •\ަ—pƒ^ƒCƒ€ƒ][ƒ“ + + int m_UpperName; // ‘å•¶Žš‚ւ̕ϊ· + int m_UpperQTH; // ‘å•¶Žš‚ւ̕ϊ· + int m_UpperREM; // ‘å•¶Žš‚ւ̕ϊ· + int m_UpperQSL; // ‘å•¶Žš‚ւ̕ϊ· + + int m_DefMyRST; // 0-OFF, 1-ON + int m_Contest; // 0-OFF, 1-ON + + int m_CopyFreq; // 0-Band, 1-Freq + int m_CopyHis; // 0-599, 1-599001, 2-599UTC + int m_CopyName; // 0-OFF, 1-ON + int m_CopyQTH; // 0-OFF, 1-ON + int m_CopyREM; // 0-OFF, 1-ON + int m_CopyQSL; // 0-OFF, 1-ON + int m_CopyREMB4; // 0-OFF, 1-ON + + int m_AutoSave; // Ž©“®ƒZ[ƒu + + int m_QSOMacroFlag; // 0-OFF, 1-ON + int m_CheckBand; // “¯ˆêƒoƒ“ƒh‚Å‚Ìd•¡‚ðƒ`ƒFƒbƒN + int m_QSOMacro[5]; // 0-Run 1st, 1-Run 2nd, 2-Run Dupe, 3-S&P 1st, 4-S&P 2nd + WORD m_QSOMacroKey[5]; + AnsiString m_QSOMacroStr[5]; + + AnsiString m_THRTTY; + AnsiString m_THSSTV; + int m_ClipRSTADIF; + int m_DateType; + int m_THTZ; + + int m_Backup; + BYTE m_Hamlog5Len[17]; +}LOGSET; + +#define MLCALL 16 /* º°Ù»²Ý‚Ì’·‚³ */ +#define MLRST 20 /* RSTƒiƒ“ƒo‚Ì’·‚³ */ +#define MLREM 56 /* ‹LŽ–‚Ì’·‚³ */ +#define MLNAME 16 /* –¼‘O‚Ì’·‚³ */ +#define MLQTH 28 /* ‚p‚s‚g‚Ì’·‚³ */ +#define MLQSL 54 /* ‚p‚r‚k‚Ì’·‚³ */ +#define MLPOW 4 /* “d—Í */ +#define MLOPT 8 /* ƒIƒvƒVƒ‡ƒ“ */ + +#define MODEMAX 48 + +#define YEAR(c) (((c)<50)?(2000+(c)):(1900+(c))) + +#pragma option -a- // ƒpƒbƒN‚ÌŽwަ +typedef struct { /* ‚l‚l‚k‚n‚fƒf[ƒ^Œ`Ž® */ + BYTE year; /* ”N */ + WORD date; /* “ú•t */ + WORD btime; /* ŠJŽnŽž */ + WORD etime; /* I—¹Žž */ + char call[MLCALL+1]; /* º°Ù»²Ý */ + char ur[MLRST+1]; /* T ØÎß°Ä */ + char my[MLRST+1]; /* R ØÎß°Ä */ + BYTE band; /* ÊÞÝÄÞ */ + SHORT fq; /* Žü”g” */ + BYTE mode; /* Ó°ÄÞ */ + char pow[MLPOW+1]; /* “d—Í */ + char name[MLNAME+1]; /* –¼‘O */ + char qth[MLQTH+1]; /* QTH */ + char qsl[MLQSL+1]; /* QSL */ + char send; /* QSL ‘—M */ + char recv; /* QSL ŽóM */ + char cq; /* cq/call */ + WORD env; /* Ž©‹ÇŠÂ‹« */ + char rem[MLREM+1]; /* ‹LŽ– */ + char opt1[MLOPT+1]; /* µÌß¼®Ý */ + char opt2[MLOPT+1]; /* µÌß¼®Ý2 */ +}SDMMLOG; + +#define FHDOFF 256 /* 擪‚̃wƒbƒ_‚̃IƒtƒZƒbƒg */ +#define UMODEMAX 32 +typedef struct { + char id[20]; /* ƒtƒ@ƒCƒ‹ƒo[ƒWƒ‡ƒ“ */ + char dmy[4]; /* ƒ_ƒ~[—̈æ */ + USHORT mlt; /* ƒ}ƒ‹ƒ`î•ñ‚̃TƒCƒY */ + char td; /* Žž·ƒR[ƒh */ + char hash; /* ƒnƒbƒVƒ…ƒf[ƒ^Ši”[ƒtƒ‰ƒO */ + long size; /* ƒf[ƒ^ƒTƒCƒY */ + char master; /* ƒ}ƒXƒ^[ƒtƒ@ƒCƒ‹ƒtƒ‰ƒO */ + char dm2[15]; /* ƒ_ƒ~[‚Q */ + char mode[UMODEMAX][6]; /* ƒ†[ƒU’è‹`ƒ‚[ƒh */ +}FHD; +#pragma option -a. // ƒpƒbƒN‰ðœ‚ÌŽwަ + +class CIndex +{ +private: + int m_IndexMax; // Šm•Û’†‚̃Cƒ“ƒfƒbƒNƒX‚Ì” + int m_IndexCnt; // Œ»Ý‚̃Cƒ“ƒfƒbƒNƒX‚Ì” + LPSTR pIndex; // ƒCƒ“ƒfƒbƒNƒX—̈æ‚̃|ƒCƒ“ƒ^(16ƒoƒCƒgƒCƒ“ƒfƒbƒNƒX) + BYTE *pMult; // ƒ}ƒ‹ƒ`î•ñ‚̃|ƒCƒ“ƒ^ +public: + CIndex(); + ~CIndex(); + void AllocIndex(int n); + void ClearIndex(void); + void WriteIndex(LPCSTR pCall, int n); + void ReadIndex(LPSTR pCall, int n); + LPSTR PointIndex(int n); + void AddBlock(LPCSTR p, int len); + int ReadIndex(int handle, FHD *hp); + void MakeIndex(int handle, FHD *hp); + int WriteIndex(int handle, FHD *hp); + + +}; + +#define FINDMAX 32768 +class CLogFind +{ +public: + int m_FindCnt; + int m_FindCmp1Max; + int m_FindCmp2Max; + int m_FindStr1Max; + int m_FindStr2Max; + + int *pFindTbl; + AnsiString m_FindStr; +public: + CLogFind(); + ~CLogFind(); + inline int GetCount(void){return m_FindCnt;}; + inline void Clear(void){ + m_FindCnt = m_FindCmp1Max = m_FindCmp2Max = m_FindStr1Max = m_FindStr2Max = 0; + }; + int Add(int n); + void Ins(int n); + + inline void Write(int n){ + pFindTbl[m_FindCnt] = n; + m_FindCnt++; + }; + inline void SetText(LPCSTR p){ + if( p != m_FindStr.c_str() ){ + m_FindStr = p; + } + }; + inline LPCSTR GetText(void){ + return m_FindStr.c_str(); + }; + inline void ClearText(void){ + m_FindStr = ""; + }; +}; + +class CLogFile +{ +private: + int m_Open; // ƒI[ƒvƒ“ƒtƒ‰ƒO + int m_EditFlag; // •ÒWƒtƒ‰ƒO + int m_Handle; // ƒtƒ@ƒCƒ‹ƒnƒ“ƒhƒ‹ + CIndex m_Index; // Œ»ÝƒI[ƒvƒ“’†‚̃Cƒ“ƒfƒbƒNƒX + FHD m_fhd; // Œ»ÝƒI[ƒvƒ“’†‚̃tƒ@ƒCƒ‹ƒwƒbƒ_ + AnsiString m_Name; // ƒƒOƒtƒ@ƒCƒ‹‚Ì–¼‘O + char m_modebuf[8]; +public: + AnsiString m_FileName; // ƒƒOƒtƒ@ƒCƒ‹‚Ì–¼‘Oiƒtƒ‹ƒpƒXj + + int m_CurNo; + int m_CurChg; + SDMMLOG m_sd; + SDMMLOG m_bak; + SDMMLOG m_asd; + + CLogFind m_Find; // ƒJƒŒƒ“ƒgŒŸõƒf[ƒ^ + LOGSET m_LogSet; + SYSTEMTIME m_UTC; +private: + void SetHisRST(SDMMLOG *sp); + void InitHeader(void); + +public: + CLogFile(); + ~CLogFile(); + + void DoBackup(void); + int Open(LPCSTR pName, BOOL fNew); + int Open(LPCSTR pName){Open(pName, TRUE); return 0;}; //JA7UDE 0428 + int Close(void); + + void ReadIniFile(LPCSTR pKey, TMemIniFile *pIniFile); + void WriteIniFile(LPCSTR pKey, TMemIniFile *pIniFile); + + void MakeIndex(void); + + inline IsEdit(void){return m_EditFlag;}; + void MakePathName(LPCSTR pName); + void MakeName(LPCSTR pName); + inline LPCSTR GetName(void){return m_Name.c_str();}; + + inline int GetCount(void){return m_fhd.size;}; + inline int IsOpen(void){return m_Open;}; + int GetData(SDMMLOG *sp, int n); + int PutData(SDMMLOG *sp, int n); + + LPCSTR GetDateString(SDMMLOG *sp, int sw); + inline LPCSTR GetDateString(SDMMLOG *sp){ return GetDateString(sp, m_LogSet.m_DateType); }; + LPCSTR GetTimeString(WORD d); + + + LPCSTR GetModeString(BYTE m); + void SetMode(SDMMLOG *sp, LPCSTR s); + + LPCSTR GetFreqString(BYTE b, short fq); + void SetFreq(SDMMLOG *sp, LPCSTR p); + LPCSTR GetOptStr(int n, SDMMLOG *sp); + void SetOptStr(int n, SDMMLOG *sp, LPCSTR pOpt); + + void CopyAF(void); + void SetHisUTC(void); + + void SortDate(int bb, int eb); + int FindSameBand(void); + + void FindStrSet(CLogFind *fp, LPCSTR pCall); + int FindCmpSet(CLogFind *fp, LPCSTR pCall); + int FindClipSet(CLogFind *fp, LPCSTR pCall); + int FindSet(CLogFind *fp, LPCSTR pCall); + int Find(LPCSTR pCall, int b, int dir); + int IsAlready(LPCSTR pCall); + void DeleteAll(void); + void DeleteLast(void); + void Delete(int top, int end); + void Insert(int n, SDMMLOG *sp); + + void InitCur(void); + void SetLastPos(void); + + int ReadAscii(SDMMLOG *sp, LPSTR p); + +}; + +void JSTtoUTC(int &Year, int &Mon, int &Day, int &Hour); +void JSTtoUTC(SDMMLOG *sp); +void UTCtoJST(int &Year, int &Mon, int &Day, int &Hour); +void UTCtoJST(SDMMLOG *sp); +void mBandToBand(SDMMLOG *sp, LPCSTR p); +LPCSTR FreqTomBand(SDMMLOG *sp); +int GetLMode(BYTE m); + +extern CLogFile Log; +extern const char MONN[]; +extern const char MONU[]; +#endif + diff --git a/LogList.cpp b/LogList.cpp new file mode 100644 index 0000000..285945d --- /dev/null +++ b/LogList.cpp @@ -0,0 +1,1169 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "LogList.h" +#include "QsoDlg.h" +#include "TextEdit.h" +#include "LogConv.h" +#include "ConvDef.h" +#include "LogSet.h" +#include "country.h" +#include "Hamlog5.h" +#include "TH5Len.h" +//--------------------------------------------------------------------- +#pragma resource "*.dfm" +//TLogListDlg *LogListDlg; +//--------------------------------------------------------------------- +__fastcall TLogListDlg::TLogListDlg(TComponent* AOwner) + : TForm(AOwner) +{ + FormStyle = ((TForm *)AOwner)->FormStyle; + Font->Name = ((TForm *)AOwner)->Font->Name; + Font->Charset = ((TForm *)AOwner)->Font->Charset; + if( Font->Charset != SHIFTJIS_CHARSET ){ + Grid->Font->Name = ((TForm *)AOwner)->Font->Name; + Grid->Font->Charset = ((TForm *)AOwner)->Font->Charset; + KFile->Caption = "File(&F)"; + KEdit->Caption = "Edit(&E)"; + KFind->Caption = "Find(&S)"; + KOpt->Caption = "Option(&O)"; + KHelp->Caption = "Help(&H)"; + + KOpen->Caption = "Open LogData File(&O)..."; + KFlush->Caption = "Save data now(&M)"; + KReIndex->Caption = "Make Index"; + KMTextRead->Caption = "Load MMLOG TextFile(&R)..."; + KMTextWrite->Caption = "Save selected range to MMLOG TextFile(&W)..."; + KImport->Caption = "Import"; + KImportText->Caption = "Text File..."; + KImportLog200->Caption = "Log200 File..."; + KImportHamlog->Caption = "Hamlog File..."; + KImportADIF->Caption = "ADIF File..."; + KExport->Caption = "Export selected range"; + KExportText->Caption = "Text File..."; + KExportADIF->Caption = "ADIF File..."; + KExportLog200->Caption = "Log200 File..."; + KExportHamlog->Caption = "Hamlog File..."; + KExportCabrillo->Caption = "Cabrillo file..."; + KExit->Caption = "Return to MMTTY(&X)"; + + KDelCur->Caption = "Cut"; + KInsCur->Caption = "Insert"; + KSelAll->Caption = "Select All"; + KDelSel->Caption = "Delete selected range"; + KSortDate->Caption = "Sort(Date/Time)"; + + KTop->Caption = "Move Top"; + KBottom->Caption = "Move Last"; + KFindTop->Caption = "Search forward..."; + KFindBottom->Caption = "Search backward..."; + KFindConT->Caption = "Search forward again"; + KFindConB->Caption = "Search backward again"; + + KLogOpt->Caption = "Setup Logging..."; + } + if( JanHelp.IsEmpty() ){ + KHlpLog->Caption = sys.m_HelpLog.c_str(); + } + else { + KHlpLog->Caption = "MMTTY Log"; + } + KExportCabrillo->Visible = FALSE; // Delete by JE3HHT on Sep.2010 + + int CX = ::GetSystemMetrics(SM_CXFULLSCREEN); + int CY = ::GetSystemMetrics(SM_CYFULLSCREEN); + if( (CX < Width)||(CY < Height) ){ + Top = 0; + Left = 0; + Width = CX; + Height = CY; + } + m_DateWidth = Grid->ColWidths[0]; + FormCenter(this, CX, CY); + if( Owner != NULL ){ + WindowState = ((TForm *)Owner)->WindowState; + } + SetTimeZone(); +} +//--------------------------------------------------------------------------- +void __fastcall TLogListDlg::SetTimeZone(void) +{ + switch(Log.m_LogSet.m_TimeZone){ + case 'I': + if( lcid == LANG_KOREAN ){ + m_TimeZone = "KST"; + } + else { + m_TimeZone = "JST"; + } + break; + default: + m_TimeZone = "UTC"; + break; + } + if(Log.m_LogSet.m_DateType & 1){ + Grid->ColWidths[0] = (m_DateWidth * 10) / 8; + } + else { + Grid->ColWidths[0] = m_DateWidth; + } +} +//--------------------------------------------------------------------------- +// ƒAƒCƒhƒ‹ˆ— +void __fastcall TLogListDlg::OnIdle(TObject *Sender, bool &Done) +{ + UpdateMenu(); +} +void __fastcall TLogListDlg::UpdateLogCount(int sw) +{ + + Grid->RowCount = Log.GetCount() + 2; + + if( sw ){ + Grid->Row = Log.GetCount() + 1; + AdjustTopRow(); + char bf[256]; + if(Font->Charset != SHIFTJIS_CHARSET){ + sprintf(bf, "%s - [%u QSO data(s)]", Log.m_FileName.c_str(), Log.GetCount()); + } + else { + sprintf(bf, "%s - [%uŒ‚̃f[ƒ^‚ª‚ ‚è‚Ü‚·]", Log.m_FileName.c_str(), Log.GetCount()); + } + Caption = bf; + } + Grid->Col = 0; + Grid->Invalidate(); +} + +void __fastcall TLogListDlg::AdjustTopRow(void) +{ + int GridLine = Grid->GridHeight/Grid->RowHeights[1] - 1; + int Top = Grid->Row - GridLine + 1; + if( Top < 1 ) Top = 1; + Grid->TopRow = Top; + Grid->Invalidate(); +} + +void __fastcall TLogListDlg::Execute(void) +{ + if( !Log.IsOpen() ){ + Log.Open(NULL); + } + Application->OnIdle = OnIdle; + UpdateLogCount(1); + if( !sys.m_LogGridWidths.IsEmpty() ){ + SetGridWidths(Grid, sys.m_LogGridWidths.c_str()); + } + ShowModal(); + GetGridWidths(sys.m_LogGridWidths, Grid); +} +//--------------------------------------------------------------------- +void __fastcall TLogListDlg::GridDrawCell(TObject *Sender, int Col, int Row, + TRect &Rect, TGridDrawState State) +{ + char bf[256]; + SDMMLOG sd; + +#if 0 + if( (Row >= Grid->Selection.Top)&&(Row <= Grid->Selection.Bottom) ){ + Grid->Canvas->Brush->Color = clBlue; + Grid->Canvas->Font->Color = clWhite; + } +#endif + + Grid->Canvas->FillRect(Rect); + int X = Rect.Left + 4; + int Y = Rect.Top + 2; + + if( Row ){ + Row--; + bf[0] = 0; + if( Row < Log.GetCount() ){ + Log.GetData(&sd, Row); + } + else { + memset(&sd, 0, sizeof(SDMMLOG)); + } + if( Log.m_LogSet.m_TimeZone != 'I' ){ + JSTtoUTC(&sd); + } + switch(Col){ + case 0: // Date + strcpy(bf, Log.GetDateString(&sd)); + break; + case 1: // Time + strcpy(bf, Log.GetTimeString(sd.btime)); + break; + case 2: // Call + strcpy(bf, sd.call); + break; + case 3: // M + bf[0] = sd.cq; + bf[1] = 0; + break; + case 4: // HisRST + strcpy(bf, sd.ur); + break; + case 5: // MyRST + strcpy(bf, sd.my); + break; + case 6: // Band + strcpy(bf, Log.GetFreqString(sd.band, sd.fq)); + break; + case 7: // Mode + strcpy(bf, Log.GetModeString(sd.mode)); + break; + case 8: // Pow + strcpy(bf, sd.pow); + break; + case 9: // Name + strcpy(bf, sd.name); + break; + case 10: // QTH + strcpy(bf, sd.qth); + break; + case 11: // S + bf[0] = sd.send; + bf[1] = 0; + break; + case 12: // R + bf[0] = sd.recv; + bf[1] = 0; + break; + case 13: // REM + strcpy(bf, sd.rem); + break; + case 14: // QSL + strcpy(bf, sd.qsl); + break; + case 15: // etime; + strcpy(bf, Log.GetTimeString(sd.etime)); + break; + case 16: // Env + if( sd.env ) sprintf(bf, "%u", sd.env); + break; + case 17: // Opt1 + strcpy(bf, sd.opt1); + break; + case 18: // Opt2 + strcpy(bf, sd.opt2); + break; + case 19: // Usr1 + strcpy(bf, Log.GetOptStr(2, &sd)); + break; + case 20: // Usr2 + strcpy(bf, Log.GetOptStr(3, &sd)); + break; + } + Grid->Canvas->TextRect(Rect, X, Y, bf); + } + else { // ƒ^ƒCƒgƒ‹ + LPCSTR _tt[]={ + "Date","JST","Call","M", "His","My","Band","Mode","Pow","Name","QTH","S","R", + "REM","QSL", "End", "Env", "Opt1", "Opt2", "Usr1", "Usr2", + }; + if( Col == 1 ){ + Grid->Canvas->TextRect(Rect, X, Y, m_TimeZone.c_str()); + } + else { + Grid->Canvas->TextRect(Rect, X, Y, _tt[Col]); + } + } + +} +//--------------------------------------------------------------------------- +// ƒŠƒ^[ƒ“ƒL[‚̈— +void __fastcall TLogListDlg::GridKeyPress(TObject *Sender, char &Key) +{ + if( Key == 0x0d ){ + GridDblClick(NULL); + Key = 0; + } +} +//--------------------------------------------------------------------------- +void __fastcall TLogListDlg::UpdateMenu(void) +{ + int f = Log.IsOpen(); + KFlush->Enabled = f && Log.IsEdit(); + KDelCur->Enabled = f && (Grid->Row <= Log.GetCount()) && (Grid->Row >= 1); + KInsCur->Enabled = f && (Grid->Row <= Log.GetCount()) && (Grid->Row >= 1); + KDelSel->Enabled = f && (Grid->Selection.Top < Grid->Selection.Bottom); + KTop->Enabled = f && Log.GetCount(); + KBottom->Enabled = f && Log.GetCount(); + KFindTop->Enabled = f && Log.GetCount(); + KFindBottom->Enabled = f && Log.GetCount(); + KFindConT->Enabled = f && Log.GetCount(); + KFindConB->Enabled = f && Log.GetCount(); + KSortDate->Enabled = f && Log.GetCount() && (Grid->Selection.Top < Grid->Selection.Bottom); + KSelAll->Enabled = f && Log.GetCount(); + KMTextRead->Enabled = f; + KMTextWrite->Enabled = f && Log.GetCount() && (Grid->Selection.Top <= Log.GetCount()); + KExport->Enabled = f && Log.GetCount() && (Grid->Selection.Top <= Log.GetCount()); + KReIndex->Enabled = f; +} +//--------------------------------------------------------------------------- +void __fastcall TLogListDlg::KOpenClick(TObject *Sender) +{ + OpenDialog->Options << ofCreatePrompt; + OpenDialog->Options >> ofFileMustExist; + if(Font->Charset != SHIFTJIS_CHARSET){ + OpenDialog->Title = "Open LogData File"; + OpenDialog->Filter = "MMLOG Data File(*.mdt)|*.mdt|"; + } + else { + OpenDialog->Title = "ƒƒOƒtƒ@ƒCƒ‹‚̃I[ƒvƒ“"; + OpenDialog->Filter = "MMLOG Data File(*.mdt)|*.mdt|"; + } + OpenDialog->FileName = ""; + OpenDialog->DefaultExt = "mdt"; + OpenDialog->InitialDir = MMLogDir; + NormalWindow(this); + if( OpenDialog->Execute() == TRUE ){ + Log.Close(); + Log.MakeName(AnsiString(OpenDialog->FileName).c_str()); //JA7UDE 0428 + Log.Open(NULL); + UpdateLogCount(1); + } + TopWindow(this); +} +//--------------------------------------------------------------------------- +void __fastcall TLogListDlg::KFlushClick(TObject *Sender) +{ + Log.Close(); + Log.Open(NULL); + UpdateLogCount(0); +} +//--------------------------------------------------------------------------- +void __fastcall TLogListDlg::KDelCurClick(TObject *Sender) +{ + int n = Grid->Row - 1; + SDMMLOG sd; + Log.GetData(&sd, n); + memcpy(&Log.m_bak, &sd, sizeof(SDMMLOG)); + Log.Delete(n, n); + UpdateLogCount(0); +} +//--------------------------------------------------------------------------- +void __fastcall TLogListDlg::KInsCurClick(TObject *Sender) +{ + int n = Grid->Row - 1; + Log.Insert(n, &Log.m_bak); + UpdateLogCount(0); +} +//--------------------------------------------------------------------------- +void __fastcall TLogListDlg::KDelSelClick(TObject *Sender) +{ + if( YesNoMB( (Font->Charset != SHIFTJIS_CHARSET)?"Delete Selection.(will not be able to restore) Are you sure?":"Œ»Ý‘I‘ð‚³‚ê‚Ä‚¢‚é”͈͂ð휂µ‚Ü‚·.휂µ‚½“à—e‚Í•œŒ³‚Å‚«‚Ü‚¹‚ñ\r\n\r\n‚æ‚낵‚¨‚Ü‚Á‚©H") == IDYES ){ + int top = Grid->Selection.Top - 1; + int end = Grid->Selection.Bottom - 1; + Log.Delete(top, end); + UpdateLogCount(0); + Grid->Row = top + 1; + } +} +//--------------------------------------------------------------------------- +void __fastcall TLogListDlg::KExitClick(TObject *Sender) +{ + ModalResult = mrOk; +} +//--------------------------------------------------------------------------- +void __fastcall TLogListDlg::KFindTopClick(TObject *Sender) +{ + if( m_FindCall.IsEmpty() || (Sender == KFindTop) ){ + UnicodeString as = m_FindCall; //JA7UDE 0428 + if( InputQuery("MMTTY", (Font->Charset != SHIFTJIS_CHARSET)?"Callsign":"ŒŸõ‚·‚éƒR[ƒ‹ƒTƒCƒ“", as) == FALSE ) return; //JA7UDE 0428 + //jstrupr(as.c_str()); + as = as.UpperCase(); + m_FindCall = as; + } + int n = Log.Find(m_FindCall.c_str(), Grid->Row, 0); + if( n >= 0 ){ + Grid->Row = n + 1; + } + else if( Font->Charset != SHIFTJIS_CHARSET ){ + WarningMB("'%s' was not found", m_FindCall.c_str()); + } + else { + WarningMB("'%s'‚ÍŒ©‚‚©‚è‚Ü‚¹‚ñ‚Å‚µ‚½.", m_FindCall.c_str()); + } +} +//--------------------------------------------------------------------------- +void __fastcall TLogListDlg::KFindBottomClick(TObject *Sender) +{ + if( m_FindCall.IsEmpty() || (Sender == KFindBottom) ){ + UnicodeString as = m_FindCall; + if( InputQuery("MMTTY", (Font->Charset != SHIFTJIS_CHARSET)?"Callsign":"ŒŸõ‚·‚éƒR[ƒ‹ƒTƒCƒ“", as) == FALSE ) return; //JA7UDE 0428 + //jstrupr(as.c_str()); + as = as.UpperCase(); + m_FindCall = as; + } + int n = Log.Find(m_FindCall.c_str(), Grid->Row - 2, 1); + if( n >= 0 ){ + Grid->Row = n + 1; + } + else if( Font->Charset != SHIFTJIS_CHARSET ){ + WarningMB("'%s' was not found", m_FindCall.c_str()); + } + else { + WarningMB("'%s'‚ÍŒ©‚‚©‚è‚Ü‚¹‚ñ‚Å‚µ‚½.", m_FindCall.c_str()); + } +} +//--------------------------------------------------------------------------- +void __fastcall TLogListDlg::KTopClick(TObject *Sender) +{ + Grid->Row = 1; + Grid->TopRow = 1; +} +//--------------------------------------------------------------------------- +void __fastcall TLogListDlg::KBottomClick(TObject *Sender) +{ + Grid->Row = Log.GetCount() + 1; + AdjustTopRow(); +} +//--------------------------------------------------------------------------- +void __fastcall TLogListDlg::KSortDateClick(TObject *Sender) +{ + if( YesNoMB( (Font->Charset != SHIFTJIS_CHARSET)?"This job may need long time. Are you sure?":"‚±‚̈—‚̓ƒ`ƒƒƒ“ƒRŽžŠÔ‚ª‚©‚©‚é‚©‚à’m‚ê‚Ü‚¹‚ñ.\r\n\r\n‚æ‚낵‚¨‚Ü‚Á‚©H" ) == IDYES ){ + int top = Grid->Selection.Top - 1; + int end = Grid->Selection.Bottom - 1; + if( top == end ){ + top = 0; + end = Log.GetCount() - 1; + } + Log.SortDate(top, end); + Grid->Invalidate(); + } +} +//--------------------------------------------------------------------------- +void __fastcall TLogListDlg::GridDblClick(TObject *Sender) +{ + int n = Grid->Row - 1; + if( (n >= 0) && (n < Log.GetCount()) ){ + TQSODlgBox *pBox = new TQSODlgBox(this); + SDMMLOG sd; + Log.GetData(&sd, n); + CLogFind Find; + + Log.FindSet(&Find, sd.call); + + pBox->Execute(&Find, &sd, n); + Grid->Invalidate(); + delete pBox; + } +} +//--------------------------------------------------------------------------- +// ‚l‚l‚k‚n‚fƒeƒLƒXƒgƒtƒ@ƒCƒ‹‚̃[ƒh +void __fastcall TLogListDlg::KMTextReadClick(TObject *Sender) +{ + OpenDialog->Options >> ofCreatePrompt; + OpenDialog->Options << ofFileMustExist; + if( Font->Charset != SHIFTJIS_CHARSET ){ + OpenDialog->Title = "Load MMLOG Text file"; + OpenDialog->Filter = "MMLOG Text Files(*.log)|*.log|"; + } + else { + OpenDialog->Title = "MMLOGƒeƒLƒXƒgƒtƒ@ƒCƒ‹‚̃[ƒh"; + OpenDialog->Filter = "MMLOGƒeƒLƒXƒgƒtƒ@ƒCƒ‹(*.log)|*.log|"; + } + OpenDialog->FileName = ""; + OpenDialog->DefaultExt = "log"; + OpenDialog->InitialDir = MMLogDir; + NormalWindow(this); + if( OpenDialog->Execute() == TRUE ){ + LoadMmlogText(AnsiString(OpenDialog->FileName).c_str()); //JA7UDE 0428 + } + TopWindow(this); +} +//--------------------------------------------------------------------------- +void __fastcall TLogListDlg::KMTextWriteClick(TObject *Sender) +{ + SaveDialog->Options << ofOverwritePrompt; + if( Font->Charset != SHIFTJIS_CHARSET ){ + SaveDialog->Title = "Save MMLOG Text File"; + SaveDialog->Filter = "MMLOG Text Files(*.log)|*.log|"; + } + else { + SaveDialog->Title = "MMLOGƒeƒLƒXƒgƒtƒ@ƒCƒ‹‚Ìì¬"; + SaveDialog->Filter = "MMLOGƒeƒLƒXƒgƒtƒ@ƒCƒ‹(*.log)|*.log|"; + } + char bf[256]; + strcpy(bf, Log.GetName()); + SetEXT(bf, ".log"); + SaveDialog->FileName = bf; + SaveDialog->DefaultExt = "log"; + SaveDialog->InitialDir = MMLogDir; + NormalWindow(this); + if( SaveDialog->Execute() == TRUE ){ + SaveMmlogText(AnsiString(SaveDialog->FileName).c_str()); //JA7UDE 0428 + } + TopWindow(this); +} +//--------------------------------------------------------------------------- +int __fastcall TLogListDlg::SureRead(void) +{ + int r; + if( Font->Charset != SHIFTJIS_CHARSET ){ + r = YesNoCancelMB("MMTTY has QSO data(s) already. Add QSO data from file?\r\n\r\n\tAdded to the end\r\n\tOverwrite\r\n\t(All the current data are deleted, and replaced by the read data)\r\n\tAbort this function"); + } + else { + r = YesNoCancelMB("Œ»ÝMMTTY‚ɃƒOƒf[ƒ^‚ª‘¶Ý‚µ‚Ü‚·. ’ljÁ“ǂ݂±‚Ý‚µ‚Ü‚·‚©H\r\n\r\n<‚Í‚¢>\tŒ»Ý‚̃ƒOƒf[ƒ^‚ÌÅŒã‚ɓǂݞ‚ñ‚¾ƒf[ƒ^‚ª’ljÁ‚³‚ê‚é.\r\n<‚¢‚¢‚¦>\tŒ»Ý‚̃ƒOƒf[ƒ^‚Í‘S‚Ä휂³‚ê“ǂݞ‚ñ‚¾ƒf[ƒ^‚É’u‚«Š·‚í‚é.\r\n<·¬Ý¾Ù>\tˆ—’†Ž~"); + } + switch(r){ + case IDCANCEL: + return 0; + case IDNO: + if( Font->Charset != SHIFTJIS_CHARSET ){ + r = OkCancelMB("Delete All QSO data(s)...(will not be able to restore) Are you sure?"); + } + else { + r = OkCancelMB("Œ»ÝMMTTY‚ª•ÛŽ‚µ‚Ä‚¢‚郃Oƒf[ƒ^‚ð‘S‚ÄŽ¸‚¢‚Ü‚·.\r\n\r\n‚Ù‚ñ‚܂ɂ¦‚¦‚Å‚Á‚©H"); + } + switch(r){ + case IDOK: + Log.DeleteAll(); + break; + case IDCANCEL: + return 0; + } + break; + default: + break; + } + return 1; +} +//--------------------------------------------------------------------------- +void __fastcall TLogListDlg::LoadMmlogText(LPCSTR pName) +{ + char bf[1024]; + + if( Log.GetCount() ){ + if( !SureRead() ) return; + } + FILE *fp = fopen(pName, "rt"); + if( fp != NULL ){ + int r = IDNO; + if( Font->Charset != SHIFTJIS_CHARSET ){ + r = YesNoMB("This function exists for compatibility with old software which handle JST.\r\n\r\nAre recorded data UTC?"); + } + CWaitCursor w; + SDMMLOG sd; + while(!feof(fp)){ + if( fgets(bf, 1023, fp) != NULL ){ + ClipLF(bf); + if( bf[0] ){ + if( Log.ReadAscii(&sd, bf) == TRUE ){ + if( r == IDYES ) UTCtoJST(&sd); + Log.PutData(&sd, Log.GetCount()); + } + } + } + } + fclose(fp); + } + else if( Font->Charset != SHIFTJIS_CHARSET ){ + ErrorMB("Can't open '%s'", pName); + } + else { + ErrorMB( "'%s'‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ.", pName); + } + UpdateLogCount(1); +} +//--------------------------------------------------------------------------- +void __fastcall TLogListDlg::SaveMmlogText(LPCSTR pName) +{ + FILE *fp = fopen(pName, "wt"); + if( fp != NULL ){ + int r = IDNO; + if( Font->Charset != SHIFTJIS_CHARSET ){ + r = YesNoMB("This function exists for compatibility with old software which handle JST.\r\n\r\nDo you want UTC?"); + } + SDMMLOG sd; + int b = Grid->Selection.Top - 1; + int e = Grid->Selection.Bottom - 1; + if( e >= Log.GetCount() ) e--; + int i; + CWaitCursor w; + for( i = b; i <= e; i++ ){ + Log.GetData(&sd, i); + if( r == IDYES ) JSTtoUTC(&sd); + fprintf(fp, "\042%s\042,\042%s.%02u\042,\042%s\042,\042%s\042,\042%s\042,\042%s\042,", + Log.GetDateString(&sd, 0), + Log.GetTimeString(sd.btime), (sd.btime % 30 * 2), + sd.call, sd.ur, sd.my, + Log.GetFreqString(sd.band, sd.fq) + ); + + fprintf(fp, "\042%s\042,\042%s\042,\042%s\042,\042%s\042,\042%s\042,\042%s\042,", + Log.GetModeString(sd.mode), + sd.pow, sd.name, sd.qth, sd.rem, sd.qsl + ); + fprintf(fp, "\042%s\042,\042%.1s\042,\042%.1s\042,\042%.1s\042,\042%u\042,", + Log.GetTimeString(sd.etime), + &sd.send, &sd.recv, &sd.cq, sd.env + ); + fprintf(fp, "\042%s\042,\042%s\042,", sd.opt1, sd.opt2 ); + fprintf(fp, "\042%s\042,", Log.GetOptStr(2, &sd)); + fprintf(fp, "\042%s\042\n", Log.GetOptStr(3, &sd)); + if( ferror(fp) ) break; + } + if( fclose(fp) ){ + ErrorMB( Font->Charset != SHIFTJIS_CHARSET ? "Can't save to '%s'" : "'%s'‚ª³‚µ‚­ì¬‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½.", pName); + } + } + else if( Font->Charset != SHIFTJIS_CHARSET ){ + ErrorMB("Can't save to '%s'", pName); + } + else { + ErrorMB( "'%s'‚ªì¬‚Å‚«‚Ü‚¹‚ñ.", pName); + } +} +//--------------------------------------------------------------------------- +void __fastcall TLogListDlg::KSelAllClick(TObject *Sender) +{ + TGridRect gRect; + gRect.Top = 1; + gRect.Bottom = Grid->RowCount - 1; + gRect.Left = 0; + gRect.Right = 20; + + Grid->Selection = gRect; +} +//--------------------------------------------------------------------------- +void __fastcall TLogListDlg::KHlpLogClick(TObject *Sender) +{ + if( JanHelp.IsEmpty() ){ + ShowHelp(this, sys.m_HelpLog.c_str()); + } + else { + ShowHtmlHelp("logging.htm"); + } +} +//--------------------------------------------------------------------------- +void __fastcall TLogListDlg::KReIndexClick(TObject *Sender) +{ + Log.MakeIndex(); +} +//--------------------------------------------------------------------------- +int __fastcall TLogListDlg::LoadText(LPCSTR pName) +{ + TConvDefDlg *pBox = new TConvDefDlg(this); + int r = pBox->Execute(LogText.m_rConv, LogText.m_Delm, LogText.m_UTC, LogText.m_Double, pName); + delete pBox; + if( r == FALSE ) return FALSE; + + if( Log.GetCount() ){ + if( !SureRead() ) return FALSE; + } + + if( LogText.Open(pName) ){ + SDMMLOG sd; + CWaitCursor w; + while(LogText.Read(&sd)==TRUE){ + Log.PutData(&sd, Log.GetCount()); + } + LogText.Close(); + } + else { + UpdateLogCount(1); + return FALSE; + } + UpdateLogCount(1); + return TRUE; +} +//--------------------------------------------------------------------------- +int __fastcall TLogListDlg::SaveText(LPCSTR pName) +{ + int b = Grid->Selection.Top - 1; + int e = Grid->Selection.Bottom - 1; + if( e >= Log.GetCount() ) e--; + + TConvDefDlg *pBox = new TConvDefDlg(this); + int r = pBox->Execute(LogText.m_tConv, LogText.m_Delm, LogText.m_UTC, LogText.m_Double, b, e); + delete pBox; + if( r == FALSE ) return FALSE; + if( LogText.Create(pName) ){ + SDMMLOG sd; + int i; + CWaitCursor w; + for( i = b; i <= e; i++ ){ + Log.GetData(&sd, i); + if( LogText.Write(&sd) == FALSE ) break; + } + LogText.Close(); + } + return TRUE; +} +//--------------------------------------------------------------------------- +void __fastcall TLogListDlg::KExportTextClick(TObject *Sender) +{ + SaveDialog->Options << ofOverwritePrompt; + if( Font->Charset != SHIFTJIS_CHARSET ){ + SaveDialog->Title = "Save Text File"; + SaveDialog->Filter = "Text Files(*.csv;*.txt)|*.csv;*.txt|"; + } + else { + SaveDialog->Title = "ƒeƒLƒXƒgƒtƒ@ƒCƒ‹‚Ìì¬"; + SaveDialog->Filter = "ƒeƒLƒXƒgƒtƒ@ƒCƒ‹(*.csv;*.txt)|*.csv;*.txt|"; + } + char bf[256]; + strcpy(bf, Log.GetName()); + SetEXT(bf, ".csv"); + SaveDialog->FileName = bf; + SaveDialog->DefaultExt = "csv"; + SaveDialog->InitialDir = ExtLogDir; + NormalWindow(this); + if( SaveDialog->Execute() == TRUE ){ + SaveText(AnsiString(SaveDialog->FileName).c_str()); //JA7UDE 0428 + SetDirName(ExtLogDir, AnsiString(SaveDialog->FileName).c_str()); //JA7UDE 0428 + } + TopWindow(this); +} +//--------------------------------------------------------------------------- +void __fastcall TLogListDlg::KImportTextClick(TObject *Sender) +{ + OpenDialog->Options >> ofCreatePrompt; + OpenDialog->Options >> ofFileMustExist; + if( Font->Charset != SHIFTJIS_CHARSET ){ + OpenDialog->Title = "Load Text File"; + OpenDialog->Filter = "Text File(*.csv;*.txt)|*.csv;*.txt|"; + } + else { + OpenDialog->Title = "ƒeƒLƒXƒgƒtƒ@ƒCƒ‹‚̃[ƒh"; + OpenDialog->Filter = "ƒeƒLƒXƒgƒtƒ@ƒCƒ‹(*.csv;*.txt)|*.csv;*.txt|"; + } + OpenDialog->FileName = ""; + OpenDialog->DefaultExt = "csv"; + OpenDialog->InitialDir = ExtLogDir; + NormalWindow(this); + if( OpenDialog->Execute() == TRUE ){ + LoadText(AnsiString(OpenDialog->FileName).c_str()); //JA7UDE 0428 + SetDirName(ExtLogDir, AnsiString(OpenDialog->FileName).c_str()); //JA7UDE 0428 + } + TopWindow(this); +} +//--------------------------------------------------------------------------- +int __fastcall TLogListDlg::LoadLog200(LPCSTR pName) +{ + if( Log.GetCount() ){ + if( !SureRead() ) return FALSE; + } + + CLog200 log200; + if( log200.Open(pName) ){ + SDMMLOG sd; + CWaitCursor w; + while(log200.Read(&sd)==TRUE){ + Log.PutData(&sd, Log.GetCount()); + } + log200.Close(); + } + else { + UpdateLogCount(1); + return FALSE; + } + UpdateLogCount(1); + return TRUE; +} +//--------------------------------------------------------------------------- +int __fastcall TLogListDlg::SaveLog200(LPCSTR pName) +{ + int b = Grid->Selection.Top - 1; + int e = Grid->Selection.Bottom - 1; + if( e >= Log.GetCount() ) e--; + + CLog200 log200; + if( log200.Create(pName) ){ + SDMMLOG sd; + int i; + CWaitCursor w; + for( i = b; i <= e; i++ ){ + Log.GetData(&sd, i); + if( log200.Write(&sd) == FALSE ) break; + } + log200.Close(); + } + return TRUE; +} +//--------------------------------------------------------------------------- +void __fastcall TLogListDlg::KExportLog200Click(TObject *Sender) +{ + SaveDialog->Options << ofOverwritePrompt; + if( Font->Charset != SHIFTJIS_CHARSET ){ + SaveDialog->Title = "Save LOG200 Data file"; + SaveDialog->Filter = "LOG200 Data File(*.l2)|*.l2|"; + } + else { + SaveDialog->Title = "LOG200ƒf[ƒ^ƒtƒ@ƒCƒ‹‚Ìì¬"; + SaveDialog->Filter = "LOG200ƒf[ƒ^ƒtƒ@ƒCƒ‹(*.l2)|*.l2|"; + } + char bf[256]; + strcpy(bf, Log.GetName()); + SetEXT(bf, ".l2"); + SaveDialog->FileName = bf; + SaveDialog->DefaultExt = "l2"; + SaveDialog->InitialDir = ExtLogDir; + NormalWindow(this); + if( SaveDialog->Execute() == TRUE ){ + SaveLog200(AnsiString(SaveDialog->FileName).c_str()); //JA7UDE 0428 + SetDirName(ExtLogDir, AnsiString(SaveDialog->FileName).c_str()); //JA7UDE 0428 + } + TopWindow(this); +} +//--------------------------------------------------------------------------- +void __fastcall TLogListDlg::KImportLog200Click(TObject *Sender) +{ + OpenDialog->Options >> ofCreatePrompt; + OpenDialog->Options >> ofFileMustExist; + if( Font->Charset != SHIFTJIS_CHARSET ){ + OpenDialog->Title = "Load LOG200 Data File"; + OpenDialog->Filter = "LOG200 Data File(*.l2)|*.l2|"; + } + else { + OpenDialog->Title = "LOG200ƒf[ƒ^ƒtƒ@ƒCƒ‹‚̃[ƒh"; + OpenDialog->Filter = "LOG200ƒf[ƒ^ƒtƒ@ƒCƒ‹(*.l2)|*.l2|"; + } + OpenDialog->FileName = ""; + OpenDialog->DefaultExt = "l2"; + OpenDialog->InitialDir = ExtLogDir; + NormalWindow(this); + if( OpenDialog->Execute() == TRUE ){ + LoadLog200(AnsiString(OpenDialog->FileName).c_str()); //JA7UDE 0428 + SetDirName(ExtLogDir, AnsiString(OpenDialog->FileName).c_str()); //JA7UDE 0428 + } + TopWindow(this); +} +//--------------------------------------------------------------------------- +int __fastcall TLogListDlg::LoadHamLog(LPCSTR pName) +{ + if( Log.GetCount() ){ + if( !SureRead() ) return FALSE; + } + + CHamLog HamLog; + if( HamLog.Open(pName) ){ + SDMMLOG sd; + CWaitCursor w; + while(HamLog.Read(&sd)==TRUE){ + Log.PutData(&sd, Log.GetCount()); + } + HamLog.Close(); + } + else { + UpdateLogCount(1); + return FALSE; + } + UpdateLogCount(1); + return TRUE; +} +//--------------------------------------------------------------------------- +int __fastcall TLogListDlg::LoadHamLog5(LPCSTR pName) +{ + if( Log.GetCount() ){ + if( !SureRead() ) return FALSE; + } + + CHamlog5 HamLog; + if( HamLog.Open(pName, TRUE) ){ + SDMMLOG sd; + CWaitCursor w; + DWORD Pos; + for( Pos = 0; Pos < HamLog.GetRCount(); Pos++ ){ + if( HamLog.Seek(Pos) ){ + HamLog.DecodeData(&sd); + Log.PutData(&sd, Log.GetCount()); + } + } + HamLog.Close(); + } + else { + UpdateLogCount(1); + return FALSE; + } + UpdateLogCount(1); + return TRUE; +} +//--------------------------------------------------------------------------- +int __fastcall TLogListDlg::SaveHamLog(LPCSTR pName) +{ + int b = Grid->Selection.Top - 1; + int e = Grid->Selection.Bottom - 1; + if( e >= Log.GetCount() ) e--; + + CHamLog HamLog; + if( HamLog.Create(pName) ){ + SDMMLOG sd; + int i; + CWaitCursor w; + for( i = b; i <= e; i++ ){ + Log.GetData(&sd, i); + if( HamLog.Write(&sd) == FALSE ) break; + } + HamLog.Close(); + } + return TRUE; +} +//--------------------------------------------------------------------------- +int __fastcall TLogListDlg::SaveHamLog5(LPCSTR pName) +{ + int b = Grid->Selection.Top - 1; + int e = Grid->Selection.Bottom - 1; + if( e >= Log.GetCount() ) e--; + + + char master[256]; + SetDirName(master, pName); + strcat(master, "HAMLOG.HDB"); + CHamlog5 HamLog; + if( HamLog.Open(master, FALSE) ){ // ƒtƒB[ƒ‹ƒhî•ñ‚ð“ǂݞ‚Þ + HamLog.Close(); + } + else { // ƒtƒB[ƒ‹ƒhî•ñ‚ð–â‚¢‡‚킹 + TTH5LenDlg *pBox = new TTH5LenDlg(this); + if( !pBox->Execute() ){ + return FALSE; + } + } + + if( HamLog.Create(pName) ){ + SDMMLOG sd; + int i; + int n = 0; + CWaitCursor w; + for( i = b; i <= e; i++, n++ ){ + Log.GetData(&sd, i); + HamLog.Seek(n); + HamLog.EncodeData(&sd); + if( HamLog.Update() == FALSE ) break; + } + HamLog.Close(); + } + return TRUE; +} +//--------------------------------------------------------------------------- +void __fastcall TLogListDlg::KImportHamlogClick(TObject *Sender) +{ + OpenDialog->Options >> ofCreatePrompt; + OpenDialog->Options >> ofFileMustExist; + if( Font->Charset != SHIFTJIS_CHARSET ){ + OpenDialog->Title = "Load HamLog Data File"; + OpenDialog->Filter = "HamLog Data File(*.hdb;*.dbs)|*.hdb;*.dbs|"; + } + else { + OpenDialog->Title = "HamLogƒf[ƒ^ƒtƒ@ƒCƒ‹‚̃[ƒh"; + OpenDialog->Filter = "HamLogƒf[ƒ^ƒtƒ@ƒCƒ‹(*.hdb;*.dbs)|*.hdb;*.dbs|"; + } + OpenDialog->FileName = ""; + OpenDialog->DefaultExt = "hdb"; + OpenDialog->InitialDir = ExtLogDir; + NormalWindow(this); + if( OpenDialog->Execute() == TRUE ){ + LPCSTR pName = AnsiString(OpenDialog->FileName).c_str(); //JA7UDE 0428 + if( !strcmpi(GetEXT(pName), "HDB") ){ + LoadHamLog5(pName); + } + else { + LoadHamLog(pName); + } + SetDirName(ExtLogDir, pName); + } + TopWindow(this); +} +//--------------------------------------------------------------------------- +void __fastcall TLogListDlg::KExportHamlogClick(TObject *Sender) +{ + SaveDialog->Options << ofOverwritePrompt; + if( Font->Charset != SHIFTJIS_CHARSET ){ + SaveDialog->Title = "Save HAMLOG Data File"; + SaveDialog->Filter = "HAMLOG (Ver5) Data File(*.hdb)|*.hdb|HAMLOG Data File(*.dbs)|*.dbs|"; + } + else { + SaveDialog->Title = "HAMLOGƒf[ƒ^ƒtƒ@ƒCƒ‹‚Ìì¬"; + SaveDialog->Filter = "HAMLOG (Ver5) ƒf[ƒ^ƒtƒ@ƒCƒ‹(*.hdb)|*.hdb|HAMLOGƒf[ƒ^ƒtƒ@ƒCƒ‹(*.dbs)|*.dbs|"; + } + char bf[256]; + strcpy(bf, Log.GetName()); + SetEXT(bf, ".hdb"); + SaveDialog->FileName = bf; + SaveDialog->DefaultExt = "hdb"; + SaveDialog->InitialDir = ExtLogDir; + NormalWindow(this); + if( SaveDialog->Execute() == TRUE ){ + LPCSTR pName = AnsiString(SaveDialog->FileName).c_str(); //JA7UDE 0428 + if( !strcmpi(GetEXT(pName), "HDB") ){ + SaveHamLog5(pName); + } + else { + SaveHamLog(pName); + } + SetDirName(ExtLogDir, pName); + } + TopWindow(this); +} +//--------------------------------------------------------------------------- +void __fastcall TLogListDlg::KLogOptClick(TObject *Sender) +{ + TLogSetDlg *pBox = new TLogSetDlg(this); + pBox->Execute(); + delete pBox; + SetTimeZone(); + Grid->Invalidate(); +} +//--------------------------------------------------------------------------- +int __fastcall TLogListDlg::SaveADIF(LPCSTR pName) +{ + int b = Grid->Selection.Top - 1; + int e = Grid->Selection.Bottom - 1; + if( e >= Log.GetCount() ) e--; + + CLogADIF logADIF; + if( logADIF.Create(pName) ){ + SDMMLOG sd; + int i; + CWaitCursor w; + for( i = b; i <= e; i++ ){ + Log.GetData(&sd, i); + if( logADIF.Write(&sd) == FALSE ) break; + } + logADIF.Close(); + } + return TRUE; +} +//--------------------------------------------------------------------------- +int __fastcall TLogListDlg::LoadADIF(LPCSTR pName) +{ + if( Log.GetCount() ){ + if( !SureRead() ) return FALSE; + } + + CLogADIF logADIF; + if( logADIF.Open(pName) ){ + SDMMLOG sd; + memset(&sd, 0, sizeof(sd)); + CWaitCursor w; + while(logADIF.Read(&sd)==TRUE){ + Log.PutData(&sd, Log.GetCount()); + memset(&sd, 0, sizeof(sd)); + } + logADIF.Close(); + } + else { + UpdateLogCount(1); + return FALSE; + } + UpdateLogCount(1); + return TRUE; +} +//--------------------------------------------------------------------------- +void __fastcall TLogListDlg::KExportADIFClick(TObject *Sender) +{ + SaveDialog->Options << ofOverwritePrompt; + if( Font->Charset != SHIFTJIS_CHARSET ){ + SaveDialog->Title = "Save ADIF File"; + SaveDialog->Filter = "ADIF Files(*.adi)|*.adi|"; + } + else { + SaveDialog->Title = "ADIF ƒtƒ@ƒCƒ‹‚Ìì¬"; + SaveDialog->Filter = "ADIF ƒtƒ@ƒCƒ‹(*.adi)|*.adi|"; + } + char bf[256]; + strcpy(bf, Log.GetName()); + SetEXT(bf, ".adi"); + SaveDialog->FileName = bf; + SaveDialog->DefaultExt = "adi"; + SaveDialog->InitialDir = ExtLogDir; + NormalWindow(this); + if( SaveDialog->Execute() == TRUE ){ + SaveADIF(AnsiString(SaveDialog->FileName).c_str()); //JA7UDE 0428 + SetDirName(ExtLogDir, AnsiString(SaveDialog->FileName).c_str()); //JA7UDE 0428 + } + TopWindow(this); +} +//--------------------------------------------------------------------------- +void __fastcall TLogListDlg::KImportADIFClick(TObject *Sender) +{ + OpenDialog->Options >> ofCreatePrompt; + OpenDialog->Options >> ofFileMustExist; + if( Font->Charset != SHIFTJIS_CHARSET ){ + OpenDialog->Title = "Load ADIF File"; + OpenDialog->Filter = "ADIF Files(*.adi;*.txt)|*.adi;*.txt|"; + } + else { + OpenDialog->Title = "ADIF ƒtƒ@ƒCƒ‹‚̃[ƒh"; + OpenDialog->Filter = "ADIF ƒtƒ@ƒCƒ‹(*.adi;*.txt)|*.adi;*.txt|"; + } + OpenDialog->FileName = ""; + OpenDialog->DefaultExt = "adi"; + OpenDialog->InitialDir = ExtLogDir; + NormalWindow(this); + if( OpenDialog->Execute() == TRUE ){ + LoadADIF(AnsiString(OpenDialog->FileName).c_str()); //JA7UDE 0428 + SetDirName(ExtLogDir, AnsiString(OpenDialog->FileName).c_str()); //JA7UDE 0428 + } + TopWindow(this); +} +//--------------------------------------------------------------------------- +int __fastcall TLogListDlg::SaveCabrillo(LPCSTR pName) +{ + int b = Grid->Selection.Top - 1; + int e = Grid->Selection.Bottom - 1; + if( e >= Log.GetCount() ) e--; + + CLogCabrillo logCabrillo; + if( logCabrillo.Create(pName) ){ + SDMMLOG sd; + int i; + CWaitCursor w; + for( i = b; i <= e; i++ ){ + Log.GetData(&sd, i); + if( logCabrillo.Write(&sd) == FALSE ) break; + } + logCabrillo.Close(); + } + return TRUE; +} +//--------------------------------------------------------------------------- +void __fastcall TLogListDlg::KExportCabrilloClick(TObject *Sender) +{ + SaveDialog->Options << ofOverwritePrompt; + if( Font->Charset != SHIFTJIS_CHARSET ){ + SaveDialog->Title = "Save Cabrillo File"; + SaveDialog->Filter = "Cabrillo Files(*.txt)|*.txt|"; + } + else { + SaveDialog->Title = "Cabrillo ƒtƒ@ƒCƒ‹‚Ìì¬"; + SaveDialog->Filter = "Cabrillo ƒtƒ@ƒCƒ‹(*.txt)|*.txt|"; + } + char bf[256]; + strcpy(bf, Log.GetName()); + SetEXT(bf, ".txt"); + SaveDialog->FileName = bf; + SaveDialog->DefaultExt = "txt"; + SaveDialog->InitialDir = ExtLogDir; + NormalWindow(this); + if( SaveDialog->Execute() == TRUE ){ + SaveCabrillo(AnsiString(SaveDialog->FileName).c_str()); //JA7UDE 0428 + SetDirName(ExtLogDir, AnsiString(SaveDialog->FileName).c_str()); //JA7UDE 0428 + } + TopWindow(this); +} +//--------------------------------------------------------------------------- diff --git a/LogList.dfm b/LogList.dfm new file mode 100644 index 0000000..acb583b Binary files /dev/null and b/LogList.dfm differ diff --git a/LogList.h b/LogList.h new file mode 100644 index 0000000..9d0ab43 --- /dev/null +++ b/LogList.h @@ -0,0 +1,159 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//---------------------------------------------------------------------------- +#ifndef LogListH +#define LogListH +//---------------------------------------------------------------------------- +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//---------------------------------------------------------------------------- +#include "LogFile.h" +#include +#include +#include +//---------------------------------------------------------------------------- +class TLogListDlg : public TForm +{ +__published: + TStringGrid *Grid; + TMainMenu *MainMenu; + TMenuItem *KFile; + TMenuItem *KOpen; + TOpenDialog *OpenDialog; + TMenuItem *KEdit; + TMenuItem *KFlush; + TMenuItem *KDelCur; + TMenuItem *KDelSel; + TMenuItem *N1; + TMenuItem *KExit; + TMenuItem *KFind; + TMenuItem *KFindTop; + TMenuItem *KFindBottom; + TMenuItem *KFindConT; + TMenuItem *KFindConB; + TMenuItem *N2; + TMenuItem *KTop; + TMenuItem *KBottom; + TMenuItem *N3; + TMenuItem *KSortDate; + TMenuItem *KInsCur; + TMenuItem *N4; + TMenuItem *N5; + TMenuItem *KMTextRead; + TMenuItem *KMTextWrite; + TSaveDialog *SaveDialog; + TMenuItem *KSelAll; + TMenuItem *KHelp; + TMenuItem *KHlpLog; + TMenuItem *N6; + TMenuItem *KReIndex; + TMenuItem *N7; + TMenuItem *KExport; + TMenuItem *KExportText; + TMenuItem *KImport; + TMenuItem *KImportText; + TMenuItem *KImportLog200; + TMenuItem *KExportLog200; + TMenuItem *KImportHamlog; + TMenuItem *KExportHamlog; + TMenuItem *KLogOpt; + TMenuItem *KOpt; + TMenuItem *KExportADIF; + TMenuItem *KImportADIF; + TMenuItem *KExportCabrillo; + void __fastcall GridDrawCell(TObject *Sender, int Col, int Row, + TRect &Rect, TGridDrawState State); + + void __fastcall GridKeyPress(TObject *Sender, char &Key); + void __fastcall KOpenClick(TObject *Sender); + void __fastcall KFlushClick(TObject *Sender); + void __fastcall KDelCurClick(TObject *Sender); + void __fastcall KDelSelClick(TObject *Sender); + void __fastcall KExitClick(TObject *Sender); + void __fastcall KFindTopClick(TObject *Sender); + void __fastcall KFindBottomClick(TObject *Sender); + void __fastcall KTopClick(TObject *Sender); + void __fastcall KBottomClick(TObject *Sender); + void __fastcall KSortDateClick(TObject *Sender); + + void __fastcall GridDblClick(TObject *Sender); + void __fastcall KInsCurClick(TObject *Sender); + void __fastcall KMTextReadClick(TObject *Sender); + void __fastcall KMTextWriteClick(TObject *Sender); + void __fastcall KSelAllClick(TObject *Sender); + void __fastcall KHlpLogClick(TObject *Sender); + void __fastcall KReIndexClick(TObject *Sender); + + void __fastcall KExportTextClick(TObject *Sender); + void __fastcall KImportTextClick(TObject *Sender); + void __fastcall KExportLog200Click(TObject *Sender); + void __fastcall KImportLog200Click(TObject *Sender); + void __fastcall KImportHamlogClick(TObject *Sender); + void __fastcall KExportHamlogClick(TObject *Sender); + void __fastcall KLogOptClick(TObject *Sender); + void __fastcall KExportADIFClick(TObject *Sender); + void __fastcall KImportADIFClick(TObject *Sender); + void __fastcall KExportCabrilloClick(TObject *Sender); +private: + void __fastcall AdjustTopRow(void); + void __fastcall UpdateLogCount(int sw); + void __fastcall UpdateMenu(void); + void __fastcall OnIdle(TObject *Sender, bool &Done); + + int __fastcall SureRead(void); + + void __fastcall LoadMmlogText(LPCSTR pName); + void __fastcall SaveMmlogText(LPCSTR pName); + int __fastcall LoadText(LPCSTR pName); + int __fastcall SaveText(LPCSTR pName); + int __fastcall LoadLog200(LPCSTR pName); + int __fastcall SaveLog200(LPCSTR pName); + int __fastcall LoadHamLog(LPCSTR pName); + int __fastcall SaveHamLog(LPCSTR pName); + int __fastcall LoadHamLog5(LPCSTR pName); + int __fastcall SaveHamLog5(LPCSTR pName); + + int __fastcall LoadADIF(LPCSTR pName); + int __fastcall SaveADIF(LPCSTR pName); + + int __fastcall SaveCabrillo(LPCSTR pName); + + AnsiString m_FindCall; + + void __fastcall SetTimeZone(void); + AnsiString m_TimeZone; + int m_DateWidth; +public: + virtual __fastcall TLogListDlg(TComponent* AOwner); + + void __fastcall TLogListDlg::Execute(void); +}; +//---------------------------------------------------------------------------- +//extern TLogListDlg *LogListDlg; +//---------------------------------------------------------------------------- +#endif diff --git a/LogSet.cpp b/LogSet.cpp new file mode 100644 index 0000000..7a50a3e --- /dev/null +++ b/LogSet.cpp @@ -0,0 +1,337 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "LogSet.h" +#include "EditDlg.h" +#include "country.h" +#include "Loglink.h" +//--------------------------------------------------------------------- +#pragma resource "*.dfm" +//TLogSetDlg *LogSetDlg; +static int PageIndex = 0; +//--------------------------------------------------------------------- +__fastcall TLogSetDlg::TLogSetDlg(TComponent* AOwner) + : TForm(AOwner) +{ + m_DisEvent = TRUE; + FormStyle = ((TForm *)AOwner)->FormStyle; + Font->Name = ((TForm *)AOwner)->Font->Name; + Font->Charset = ((TForm *)AOwner)->Font->Charset; + if( Font->Charset != SHIFTJIS_CHARSET ){ + TabConv->Caption = "Conversion"; + TabMisc->Caption = "Misc"; + CancelBtn->Caption = "Cancel"; + Caption = "Setup Logging"; + TabFlag->Caption = "Input"; + TabMacro->Caption = "QSO Button"; + GrpConv->Caption = "Convert UpperCase"; + GrpCopy->Caption = "Copy Before Data"; + CopyFreq->Caption = "Copy Band or Freq."; + CopyFreq->Items->Strings[0] = "Copy Band"; + CopyFreq->Items->Strings[1] = "Copy Freq."; + DefMyRST->Caption = "599 Default"; + CBBackup->Caption = "Make backup"; + + MacroFlag->Caption = "Auto Macro"; + CheckBand->Caption = "Check SameBand"; + AutoZone->Caption = "Ignore daylight saving"; + CBRemC->Visible = FALSE; + GB9->Caption = "Mode"; + } + if( lcid == LANG_KOREAN ){ + TimeZone->Items->Strings[0] = "Korea"; + } + else { + TimeZone->Items->Strings[0] = "Japan"; + } + SBHelp->Visible = !JanHelp.IsEmpty(); + + m_MMList.QueryList("MML"); + for( int i = 0; i < m_MMList.GetCount(); i++ ){ + CBMMLink->Items->Add(m_MMList.GetItemName(i)); + } +} +//--------------------------------------------------------------------- +void __fastcall TLogSetDlg::UpdateUI(void) +{ + int f = !AutoZone->Checked; + TimeOff->Enabled = f; + MinOff->Enabled = f; + UDOffset->Enabled = f; + UDMin->Enabled = f; + ClearOff->Enabled = f; + CBPoll->Enabled = RGLink->ItemIndex; + CBMMLink->Enabled = (RGLink->ItemIndex == 2) ? TRUE : FALSE; + LT->Enabled = CBMMLink->Enabled; +} +//--------------------------------------------------------------------- +int __fastcall TLogSetDlg::Execute(void) +{ + int i; + for( i = 0; i < 5; i++ ){ + m_MacroStr[i] = Log.m_LogSet.m_QSOMacroStr[i]; + m_MacroKey[i] = Log.m_LogSet.m_QSOMacroKey[i]; + } + UpperName->Checked = Log.m_LogSet.m_UpperName; + UpperQTH->Checked = Log.m_LogSet.m_UpperQTH; + UpperREM->Checked = Log.m_LogSet.m_UpperREM; + UpperQSL->Checked = Log.m_LogSet.m_UpperQSL; + + DefMyRST->Checked = Log.m_LogSet.m_DefMyRST; + Contest->ItemIndex = Log.m_LogSet.m_Contest; + + CopyFreq->ItemIndex = Log.m_LogSet.m_CopyFreq; + CopyHis->ItemIndex = Log.m_LogSet.m_CopyHis; + CopyName->Checked = Log.m_LogSet.m_CopyName; + CopyQTH->Checked = Log.m_LogSet.m_CopyQTH; + CopyREM->Checked = Log.m_LogSet.m_CopyREM; + CopyQSL->Checked = Log.m_LogSet.m_CopyQSL; + CBRemC->Checked = Log.m_LogSet.m_CopyREMB4; + CBBackup->Checked = Log.m_LogSet.m_Backup; + + if( Log.m_LogSet.m_TimeZone != 'I' ){ + TimeZone->ItemIndex = 1; + } + else { + TimeZone->ItemIndex = 0; + } + AutoSave->Checked = Log.m_LogSet.m_AutoSave; + MacroFlag->Checked = Log.m_LogSet.m_QSOMacroFlag; + CheckBand->Checked = Log.m_LogSet.m_CheckBand; + Macro1->Checked = Log.m_LogSet.m_QSOMacro[0]; + Macro2->Checked = Log.m_LogSet.m_QSOMacro[1]; + Macro3->Checked = Log.m_LogSet.m_QSOMacro[2]; + Macro4->Checked = Log.m_LogSet.m_QSOMacro[3]; + Macro5->Checked = Log.m_LogSet.m_QSOMacro[4]; + + THRTTY->Text = Log.m_LogSet.m_THRTTY; + THSSTV->Text = Log.m_LogSet.m_THSSTV; + THTZ->ItemIndex = Log.m_LogSet.m_THTZ; + ClipRSTADIF->Checked = Log.m_LogSet.m_ClipRSTADIF; + DateType->ItemIndex = Log.m_LogSet.m_DateType; + AutoZone->Checked = sys.m_AutoTimeOffset; + UDOffset->Position = short(sys.m_TimeOffset); + UDMin->Position = short(sys.m_TimeOffsetMin); + RGLink->ItemIndex = sys.m_LogLink; + CBPoll->Checked = LogLink.IsPolling(); + CBPTT->Checked = LogLink.GetPTTEnabled(); + CBMMLink->ItemIndex = CBMMLink->Items->IndexOf(LogLink.GetItemName()); + if( m_MMList.GetCount() ){ + RGLink->Controls[2]->Enabled = TRUE; + if( CBMMLink->ItemIndex < 0 ){ + CBMMLink->ItemIndex = 0; + } + } + else { + RGLink->Controls[2]->Enabled = FALSE; + } + + if( (PageIndex >= 0) && (PageIndex < Page->PageCount) ){ + if( Page->Pages[PageIndex]->TabVisible == FALSE ){ + PageIndex = 0; + } + Page->ActivePage = Page->Pages[PageIndex]; + } + int r = FALSE; + UpdateUI(); + m_DisEvent = FALSE; + if( ShowModal() == IDOK ){ + Log.m_LogSet.m_UpperName = UpperName->Checked; + Log.m_LogSet.m_UpperQTH = UpperQTH->Checked; + Log.m_LogSet.m_UpperREM = UpperREM->Checked; + Log.m_LogSet.m_UpperQSL = UpperQSL->Checked; + + Log.m_LogSet.m_DefMyRST = DefMyRST->Checked; + Log.m_LogSet.m_Contest = Contest->ItemIndex; + + Log.m_LogSet.m_CopyFreq = CopyFreq->ItemIndex; + Log.m_LogSet.m_CopyHis = CopyHis->ItemIndex; + Log.m_LogSet.m_CopyName = CopyName->Checked; + Log.m_LogSet.m_CopyQTH = CopyQTH->Checked; + Log.m_LogSet.m_CopyREM = CopyREM->Checked; + Log.m_LogSet.m_CopyQSL = CopyQSL->Checked; + Log.m_LogSet.m_CopyREMB4 = ( Font->Charset != SHIFTJIS_CHARSET ) ? 0 : CBRemC->Checked; + Log.m_LogSet.m_Backup = CBBackup->Checked; + + if( TimeZone->ItemIndex ){ + Log.m_LogSet.m_TimeZone = 'Z'; + } + else { + Log.m_LogSet.m_TimeZone = 'I'; + } + + Log.m_LogSet.m_AutoSave = AutoSave->Checked; + Log.m_LogSet.m_QSOMacroFlag = MacroFlag->Checked; + Log.m_LogSet.m_CheckBand = CheckBand->Checked; + Log.m_LogSet.m_QSOMacro[0] = Macro1->Checked; + Log.m_LogSet.m_QSOMacro[1] = Macro2->Checked; + Log.m_LogSet.m_QSOMacro[2] = Macro3->Checked; + Log.m_LogSet.m_QSOMacro[3] = Macro4->Checked; + Log.m_LogSet.m_QSOMacro[4] = Macro5->Checked; + + for( i = 0; i < 5; i++ ){ + Log.m_LogSet.m_QSOMacroStr[i] = m_MacroStr[i]; + Log.m_LogSet.m_QSOMacroKey[i] = m_MacroKey[i]; + } + Log.m_LogSet.m_THRTTY = THRTTY->Text; + Log.m_LogSet.m_THSSTV = THSSTV->Text; + Log.m_LogSet.m_THTZ = THTZ->ItemIndex; + Log.m_LogSet.m_ClipRSTADIF = ClipRSTADIF->Checked; + Log.m_LogSet.m_DateType = DateType->ItemIndex; + + sys.m_AutoTimeOffset = AutoZone->Checked; + sys.m_TimeOffset = UDOffset->Position; + sys.m_TimeOffsetMin = UDMin->Position; + if( sys.m_AutoTimeOffset ){ + SetTimeOffsetInfo(sys.m_TimeOffset, sys.m_TimeOffsetMin); + } + sys.m_LogLink = RGLink->ItemIndex; + LogLink.SetPolling(CBPoll->Checked); + LogLink.SetPTTEnabled(CBPTT->Checked); + if( CBMMLink->ItemIndex >= 0 ){ + LogLink.SetItemName(AnsiString(CBMMLink->Items->Strings[CBMMLink->ItemIndex]).c_str()); //JA7UDE 0428 + } + r = TRUE; + } + for( PageIndex = 0; PageIndex < Page->PageCount; PageIndex++ ){ + if( Page->ActivePage == Page->Pages[PageIndex] ) break; + } + return r; +} +//--------------------------------------------------------------------- +void __fastcall TLogSetDlg::MacroBtnClick(int n) +{ + if( n >= 0 ){ + TEditDlgBox *pBox = new TEditDlgBox(this); + pBox->ButtonName->Text = ""; + pBox->Execute(m_MacroStr[n], m_MacroKey[n], NULL, NULL, 2); + delete pBox; + } +} +//--------------------------------------------------------------------- +void __fastcall TLogSetDlg::MacroBtn1Click(TObject *Sender) +{ + MacroBtnClick(0); +} +//--------------------------------------------------------------------------- +void __fastcall TLogSetDlg::MacroBtn2Click(TObject *Sender) +{ + MacroBtnClick(1); +} +//--------------------------------------------------------------------------- +void __fastcall TLogSetDlg::MacroBtn3Click(TObject *Sender) +{ + MacroBtnClick(2); +} +//--------------------------------------------------------------------------- +void __fastcall TLogSetDlg::MacroBtn4Click(TObject *Sender) +{ + MacroBtnClick(3); +} +//--------------------------------------------------------------------------- +void __fastcall TLogSetDlg::MacroBtn5Click(TObject *Sender) +{ + MacroBtnClick(4); +} +//--------------------------------------------------------------------------- +void __fastcall TLogSetDlg::ClearOffClick(TObject *Sender) +{ + if( m_DisEvent ) return; + + UDOffset->Position = 0; + UDMin->Position = 0; +} +//--------------------------------------------------------------------------- +void __fastcall TLogSetDlg::AutoZoneClick(TObject *Sender) +{ + if( m_DisEvent ) return; + + if( AutoZone->Checked ){ + int hour, min; + SetTimeOffsetInfo(hour, min); + UDOffset->Position = short(hour); + UDMin->Position = short(min); + } + UpdateUI(); +} +//--------------------------------------------------------------------------- +void __fastcall TLogSetDlg::SBHelpClick(TObject *Sender) +{ +#if 1 + ShowHtmlHelp("logging.htm"); +#else + int n; + + if( Page->ActivePage == TabMacro ){ + n = 20; + } + else { + n = 18; + } + ShowHelp(n); +#endif +} +//--------------------------------------------------------------------------- +void __fastcall TLogSetDlg::ContestClick(TObject *Sender) +{ + if( m_DisEvent ) return; + + m_DisEvent++; + switch(Contest->ItemIndex){ + case testOFF: + CopyHis->ItemIndex = 0; + DefMyRST->Checked = FALSE; + MacroFlag->Checked = FALSE; + break; + case testON: + CopyHis->ItemIndex = 1; + DefMyRST->Checked = TRUE; + MacroFlag->Checked = TRUE; + break; + case testCQRJ: + CopyHis->ItemIndex = 0; + DefMyRST->Checked = TRUE; + MacroFlag->Checked = TRUE; + break; + case testPED: + CopyHis->ItemIndex = 0; + DefMyRST->Checked = TRUE; + MacroFlag->Checked = TRUE; + break; + case testBARTG: + CopyHis->ItemIndex = 2; + DefMyRST->Checked = TRUE; + MacroFlag->Checked = TRUE; + break; + } + m_DisEvent--; +} +//--------------------------------------------------------------------------- +void __fastcall TLogSetDlg::RGLinkClick(TObject *Sender) +{ + if( m_DisEvent ) return; + + UpdateUI(); +} +//--------------------------------------------------------------------------- + diff --git a/LogSet.dfm b/LogSet.dfm new file mode 100644 index 0000000..c5bf59a Binary files /dev/null and b/LogSet.dfm differ diff --git a/LogSet.h b/LogSet.h new file mode 100644 index 0000000..ecb43ca --- /dev/null +++ b/LogSet.h @@ -0,0 +1,138 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//---------------------------------------------------------------------------- +#ifndef LogSetH +#define LogSetH +//---------------------------------------------------------------------------- +//JA7UDE 0427 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//---------------------------------------------------------------------------- +#include "LogFile.h" +#include "MMLink.h" +//---------------------------------------------------------------------------- +class TLogSetDlg : public TForm +{ +__published: + TButton *OKBtn; + TButton *CancelBtn; + TPageControl *Page; + TTabSheet *TabFlag; + TGroupBox *GrpConv; + TCheckBox *UpperName; + TCheckBox *UpperQTH; + TCheckBox *UpperREM; + TCheckBox *UpperQSL; + TGroupBox *GrpCopy; + TCheckBox *CopyName; + TCheckBox *CopyQTH; + TCheckBox *CopyREM; + TCheckBox *CopyQSL; + TTabSheet *TabMacro; + TCheckBox *MacroFlag; + TGroupBox *GroupBox3; + TGroupBox *GroupBox4; + TCheckBox *Macro1; + TCheckBox *Macro2; + TCheckBox *Macro3; + TCheckBox *Macro4; + TCheckBox *Macro5; + TButton *MacroBtn1; + TButton *MacroBtn2; + TButton *MacroBtn3; + TButton *MacroBtn4; + TButton *MacroBtn5; + TCheckBox *CheckBand; + TRadioGroup *CopyHis; + TRadioGroup *CopyFreq; + TGroupBox *GroupBox5; + TCheckBox *DefMyRST; + TRadioGroup *TimeZone; + TRadioGroup *Contest; + TLabel *Label1; + TTabSheet *TabConv; + TGroupBox *GroupBox1; + TGroupBox *GroupBox2; + TCheckBox *ClipRSTADIF; + TTabSheet *TabMisc; + TGroupBox *GTime; + TEdit *TimeOff; + TUpDown *UDOffset; + TRadioGroup *DateType; + TEdit *MinOff; + TUpDown *UDMin; + TLabel *Label4; + TLabel *Label5; + TButton *ClearOff; + TCheckBox *AutoSave; + TCheckBox *AutoZone; + TSpeedButton *SBHelp; + TCheckBox *CBRemC; + TGroupBox *GB6; + TRadioGroup *RGLink; + TCheckBox *CBPoll; + TRadioGroup *THTZ; + TComboBox *CBMMLink; + TLabel *LT; + TCheckBox *CBBackup; + TCheckBox *CBPTT; + TGroupBox *GB9; + TLabel *Label2; + TLabel *Label3; + TEdit *THRTTY; + TEdit *THSSTV; + void __fastcall MacroBtn1Click(TObject *Sender); + void __fastcall MacroBtn2Click(TObject *Sender); + void __fastcall MacroBtn3Click(TObject *Sender); + void __fastcall MacroBtn4Click(TObject *Sender); + void __fastcall MacroBtn5Click(TObject *Sender); + void __fastcall ClearOffClick(TObject *Sender); + void __fastcall AutoZoneClick(TObject *Sender); + void __fastcall SBHelpClick(TObject *Sender); + void __fastcall ContestClick(TObject *Sender); + void __fastcall RGLinkClick(TObject *Sender); +private: + int m_DisEvent; + AnsiString m_MacroStr[5]; + WORD m_MacroKey[5]; + CMMList m_MMList; + + void __fastcall MacroBtnClick(int n); + void __fastcall UpdateUI(void); + +public: + virtual __fastcall TLogSetDlg(TComponent* AOwner); + + int __fastcall Execute(void); + +}; +//---------------------------------------------------------------------------- +//extern TLogSetDlg *LogSetDlg; +//---------------------------------------------------------------------------- +#endif diff --git a/Loglink.cpp b/Loglink.cpp new file mode 100644 index 0000000..4980bcd --- /dev/null +++ b/Loglink.cpp @@ -0,0 +1,864 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------------- +#include +#pragma hdrstop + +#define MMSSTV 0 // MMTTY‚Å‚Í0 +#if MMSSTV +#include "Main.h" +#endif + +#include "LogLink.h" +CLogLink LogLink; +//--------------------------------------------------------------------------- +// CLogLinkƒNƒ‰ƒX +CLogLink::CLogLink() +{ + m_Enabled = FALSE; + m_Count = m_Count2 = 0; + m_hLog = NULL; + m_hLogIn = NULL; + m_CStat = 0; + m_hApp = NULL; + m_hMain = NULL; + m_Error = 0; + m_1stSession = TRUE; + m_fHLV5 = TRUE; + + m_Polling = 1; + m_PTTEnabled = FALSE; + + m_AStat = FALSE; + m_MMStat = FALSE; + m_pLink = NULL; + m_strMode[0] = 0; +} + +CLogLink::~CLogLink() +{ + CloseMMLink(); +} +//--------------------------------------------------------------------------- +void __fastcall CLogLink::CloseMMLink(void) +{ + if( m_pLink != NULL ){ + delete m_pLink; + m_pLink = NULL; + } +} +//--------------------------------------------------------------------------- +// ‘—M—pƒEƒCƒ“ƒhƒEƒnƒ“ƒhƒ‹‚ÌÝ’è +void CLogLink::SetHandle(HWND hMain, UINT uMsg) +{ + m_hMain = hMain; + m_uMsg = uMsg; + m_hApp = Application->Handle; + if( m_pLink == NULL ) return; + m_pLink->SetHandle(hMain, uMsg); +} +//--------------------------------------------------------------------------- +BOOL __fastcall CLogLink::IsLink(void) +{ + switch(m_Enabled){ + case 1: + return m_hLog != NULL ? TRUE : FALSE; + case 2: + return m_MMStat; + default: + return FALSE; + } +} +//--------------------------------------------------------------------------- +LPCSTR __fastcall CLogLink::GetSessionName(void) +{ + switch(m_Enabled){ + case 1: +// return "Turbo HAMLOG/Win"; + return m_AppName.c_str(); + case 2: + if( m_pLink == NULL ) return NULL; + return m_pLink->GetSessionName(); + default: + return NULL; + } +} +//--------------------------------------------------------------------------- +// ƒŠƒ“ƒN‚Ì‹–‰ÂÝ’è +void CLogLink::UpdateLink(int sw) +{ + if( (m_Enabled != sw) || + ((m_pLink != NULL) && strcmp(m_ItemName.c_str(), m_pLink->GetItemName()) ) + ){ + m_Enabled = sw; + switch(sw){ + case 0: + m_hLog = NULL; + m_hLogIn = NULL; + CloseMMLink(); + break; + case 1: + m_Count = 0; + m_Error = 0; + CloseMMLink(); + break; + case 2: + m_Count = 0; + m_Error = 0; + if( !m_pLink ){ + m_pLink = new CMMLink(m_hMain, m_uMsg); + } + m_pLink->Open(m_ItemName.c_str()); + break; + } + } +} +//--------------------------------------------------------------------------- +// ƒR[ƒ‹ƒTƒCƒ“‚𕪗£ +static void DevCall(AnsiString &CALL, AnsiString &PTB, LPCSTR pCall) +{ + char bf[1024]; + + CALL = ""; + PTB = ""; + strcpy(bf, pCall); + LPSTR pp, p2, t; + t = bf; + if( (pp = strchr(bf, '/')) != NULL ){ // KH6/JE3HHT or JE3HHT/KH6 ‚ÌŒ`Ž® + *pp = 0; + pp++; + int LenC = strlen(t); + int LenP = strlen(pp); + if( ((p2 = strchr(pp, '/')) != NULL)|| + (LenC > 7) || + (LenP > 7) || + ((LenC > LenP) && (LenP>3)) || + ((LenC < LenP) && (LenC>3)) + ){ + // HAMLOG‚ł͕\Œ»‚Å‚«‚È‚¢•\‹L‚Ìê‡ + if( p2 != NULL ){ + *p2 = 0; + LenP = strlen(pp); + } + } + if( LenC < LenP ){ + p2 = t; + t = pp; + pp = p2; + } + PTB = pp; + } + CALL = t; +} +//--------------------------------------------------------------------------- +static void __fastcall SetHamlogMode(LPSTR bf) +{ + if( !strcmp(bf, "RTTY") ){ + StrCopy(bf, Log.m_LogSet.m_THRTTY.c_str(), 3); + } + else if( !strcmp(bf, "SSTV") ){ + StrCopy(bf, Log.m_LogSet.m_THSSTV.c_str(), 3); + } + else if( !strcmp(bf, "GMSK") ){ + strcpy(bf, "MSK"); + } + else if( !strcmp(bf, "FSTV") ){ + strcpy(bf, "FTV"); + } + else if( !strcmp(bf, "BPSK") ){ + strcpy(bf, "PSK"); + } + else if( !strcmp(bf, "QPSK") ){ + strcpy(bf, "PSK"); + } +} +//--------------------------------------------------------------------------- +// MM -> HamLog ƒtƒH[ƒ}ƒbƒg‚̈ꊇ•ÏŠ· +static void MMtoHAMLOG(LPSTR tp, SDMMLOG *sp, BOOL fHLV5) +{ + char bf[512]; + + AnsiString DATE; + AnsiString TIME; + + int CallOrder = FALSE; + + if( sp->btime ){ + int YY = sp->year; + int MM = sp->date / 100; + int DD = sp->date % 100; + int tim = sp->btime / 30; + int HH = tim / 60; + int mm = tim % 60; + char tz = 'J'; + switch(Log.m_LogSet.m_THTZ){ + case 0: + if( !IsJA(sp->call) ){ + JSTtoUTC(YY, MM, DD, HH); + tz = 'U'; + } + break; + case 1: + JSTtoUTC(YY, MM, DD, HH); + tz = 'U'; + break; + default: + break; + } + sprintf(bf, "%02u/%02u/%02u", YY, MM, DD); + DATE = bf; + sprintf(bf, "%02u:%02u%c", HH, mm, tz); + TIME = bf; + } + + AnsiString NAME = sp->name; + AnsiString QTH = sp->qth; + AnsiString REM1 = sp->rem; + AnsiString REM2 = sp->qsl; + + AnsiString CALL; + AnsiString PTB; + + if( fHLV5 ){ // Ver 5.00ˆÈ~ + CALL = sp->call; + } + else { // Ver 4.xx + strcpy(bf, sp->call); + LPSTR pp, p2, t; + t = bf; + if( (pp = strchr(bf, '/')) != NULL ){ // KH6/JE3HHT or JE3HHT/KH6 ‚ÌŒ`Ž® + *pp = 0; + pp++; + int LenC = strlen(t); + int LenP = strlen(pp); + if( ((p2 = strchr(pp, '/')) != NULL)|| + (LenC > 7) || + (LenP > 7) || + ((LenC > LenP) && (LenP>3)) || + ((LenC < LenP) && (LenC>3)) + ){ + // HAMLOG‚ł͕\Œ»‚Å‚«‚È‚¢•\‹L‚Ìê‡ + AddMMLOGKey(REM1, REM2, sp->call, "ToRadio"); + if( p2 != NULL ){ + *p2 = 0; + LenP = strlen(pp); + } + } + if( LenC < LenP ){ + p2 = t; + t = pp; + pp = p2; + CallOrder = TRUE; + } + PTB = pp; + } + else if( strlen(t) > 7 ){ + AddMMLOGKey(REM1, REM2, sp->call, "ToRadio"); + } + CALL = t; + } + strcpy(bf, Log.GetModeString(sp->mode)); + if( !fHLV5 ){ + SetHamlogMode(bf); + } + AnsiString MODE = bf; + + AnsiString HIS, MY; + int l = GetLMode(sp->mode); + if( fHLV5 ){ + HIS = sp->ur; + MY = sp->my; + } + else { + strcpy(bf, sp->ur); + bf[l] = 0; + HIS = bf; + strcpy(bf, sp->my); + bf[l] = 0; + MY = bf; + } + if( sp->ur[l] ) AddMMLOGKey(REM1, REM2, &sp->ur[l], "SN"); + if( sp->my[l] ) AddMMLOGKey(REM1, REM2, &sp->my[l], "RN"); + + strcpy(bf, Log.GetFreqString(sp->band, sp->fq)); + AnsiString FREQ = bf; + + if( !fHLV5 ){ + if( CallOrder && (!strstr(sp->rem, "$DX")) && (!strstr(sp->qsl, "$DX")) ){ + AddMMLOGKey(REM1, REM2, "$DX", NULL); + } + } + + if( sp->etime ){ + int tim = sp->etime / 30; + sprintf(bf, "%02u%02u", tim / 60, tim % 60); + AddMMLOGKey(REM1, REM2, bf, "END"); + } + if( sp->env ){ + sprintf(bf, "%u", sp->env); + AddMMLOGKey(REM1, REM2, bf, "ENV"); + } + AddMMLOGKey(REM1, REM2, sp->pow, "POW"); + if( sp->cq ){ + bf[0] = sp->cq; bf[1] = 0; + AddMMLOGKey(REM1, REM2, bf, "M"); + } + AnsiString CODE; + if( (strlen(sp->opt1) >= 3) && isdigit(sp->opt1[0]) && isdigit(sp->opt1[1]) ){ + CODE = sp->opt1; + } + sprintf(bf, "%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n", + CALL.c_str(), PTB.c_str(), DATE.c_str(), TIME.c_str(), + HIS.c_str(), MY.c_str(), FREQ.c_str(), MODE.c_str(), CODE.c_str(), "", "", + NAME.c_str(), QTH.c_str(), REM1.c_str(), REM2.c_str() + ); + strcpy(tp, bf); +} + +//--------------------------------------------------------------------------- +// ƒEƒCƒ“ƒhƒEƒtƒH[ƒJƒX‚ðŽ©g‚É–ß‚· +void CLogLink::Foreground(void) +{ + if( m_Enabled != 1 ) return; + + ::SetWindowPos(m_hApp, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); + ::SetFocus(m_hApp); +} +//--------------------------------------------------------------------------- +// ƒƒO‚ÌƒŠƒ“ƒN‚̃`ƒFƒbƒN +BOOL CLogLink::CheckLink(void) +{ + if( m_Error ) return FALSE; + + switch(m_Enabled){ + case 1: + { + HWND hLog = ::FindWindow("TThwin", NULL); + if( hLog != m_hLog ){ + if( hLog ){ + m_AppVer = 0; + char bf[128]; + LPSTR p; + ::GetWindowText(hLog, bf, sizeof(bf)); + clipsp(bf); + m_AppName = bf; + if( (p = strstr(bf, "Ver")) != NULL ){ + p += 3; + LPSTR t; + for( t = p; *t; t++ ){ + if( (*t != '.') && !isdigit(*t) ) break; + } + *t = 0; + double d; + if( sscanf(p, "%lf", &d) == 1 ){ + m_AppVer = d * 100; + } + } + else { + m_Count = 1000/LINKINTERVAL; + return FALSE; + } + m_fHLV5 = (m_AppVer >= 500); + } + m_hLog = hLog; + m_CStat = TRUE; + } + return m_hLog != NULL ? TRUE : FALSE; + } + case 2: + { + if( m_pLink == NULL ) return FALSE; + m_MMStat = m_pLink->IsConnected(); + if( m_MMStat != m_AStat ){ + m_AStat = m_MMStat; + m_CStat = TRUE; + } + return m_MMStat; + } + default: + return FALSE; + } +} +//--------------------------------------------------------------------------- +// ’èŠú“I‚ȃƒO‚ÌƒŠƒ“ƒN‚ÌŠÄŽ‹(200ms–ˆ‚ɃR[ƒ‹) +BOOL CLogLink::TimerLogLink(void) +{ + if( !m_Enabled ) return FALSE; + + if( !m_Count ){ + m_Count = 5000/LINKINTERVAL; // 5[s]–ˆ‚̃`ƒFƒbƒN + BOOL f = m_hLog != NULL; + CheckLink(); + if( m_hLog && !f ) m_1stSession = TRUE; + } + m_Count--; + if( m_CStat ){ + m_CStat = 0; + return TRUE; + } + else { + return FALSE; + } +} +//--------------------------------------------------------------------------- +// ’èŠú“I‚ÈŽü”g”ƒ|[ƒŠƒ“ƒO +void CLogLink::EventGetFreq(void) +{ + if( !m_Polling ) return; + + if( !m_Count2 ){ + m_Count2 = 2000/LINKINTERVAL; // 2[s]–ˆ‚̃`ƒFƒbƒN + switch(m_Enabled){ + case 1: + { + if( m_hLog == NULL ) return; + int af = Application->Active; + m_cds.dwData = 106; + m_cds.cbData = 0; + m_cds.lpData = NULL; + ::SendMessage(m_hLog, WM_COPYDATA, WPARAM(m_hMain), LPARAM(&m_cds)); + if( af && m_1stSession ) Foreground(); + m_1stSession = FALSE; + } + break; + case 2: + if( m_pLink == NULL ) return; + m_pLink->EventVFO(); + break; + } + } + m_Count2--; +} +//--------------------------------------------------------------------------- +// Žü”g”‚ÌÝ’è +void CLogLink::SetFreq(LPSTR pFreq) +{ + if( !CheckLink() ) return; + + switch(m_Enabled){ + case 1: + m_cds.dwData = 6; + m_cds.cbData = strlen(pFreq); + m_cds.lpData = pFreq; + m_hLogIn = (HWND)::SendMessage(m_hLog, WM_COPYDATA, WPARAM(m_hApp), LPARAM(&m_cds)); + break; + case 2: + if( m_pLink == NULL ) return; + m_pLink->SetFreq(pFreq); + break; + } +} +//--------------------------------------------------------------------------- +// ƒ‚[ƒh‚ÌÝ’è +void CLogLink::SetMode(LPCSTR pMode) +{ + if( !CheckLink() ) return; + + switch(m_Enabled){ + case 1: + if( pMode && (pMode != m_strMode) ){ + StrCopy(m_strMode, pMode, sizeof(m_strMode)-1); + if( !m_fHLV5 ){ + SetHamlogMode(m_strMode); + } + } + if( m_strMode[0] ){ + m_cds.dwData = 7; + m_cds.cbData = strlen(m_strMode); + m_cds.lpData = m_strMode; + m_hLogIn = (HWND)::SendMessage(m_hLog, WM_COPYDATA, WPARAM(m_hApp), LPARAM(&m_cds)); + } + break; + case 2: +// if( m_pLink == NULL ) return; +// m_pLink->SetMode(pMode); + break; + } +} +//--------------------------------------------------------------------------- +void __fastcall CLogLink::SetPTT(int ptt) +{ + if( !m_PTTEnabled ) return; + if( !CheckLink() ) return; + switch(m_Enabled){ + case 1: + { + int af = Application->Active; + m_cds.dwData = ptt ? 23 : 24; + m_cds.cbData = 0; + m_cds.lpData = NULL; + ::SendMessage(m_hLog, WM_COPYDATA, af ? WPARAM(m_hApp) : NULL, LPARAM(&m_cds)); + if( af && m_1stSession ) Foreground(); + m_1stSession = FALSE; + } + break; + case 2: + if( !m_pLink ) return; + m_pLink->SetPTT(ptt); + break; + } +} +//--------------------------------------------------------------------------- +// ƒNƒŠƒA +void CLogLink::Clear(void) +{ + if( !CheckLink() ) return; + + switch(m_Enabled){ + case 1: + { + int af = Application->Active; + m_cds.dwData = 16; + m_cds.cbData = 0; + m_cds.lpData = NULL; + m_hLogIn = (HWND)::SendMessage(m_hLog, WM_COPYDATA, af ? WPARAM(m_hApp) : NULL, LPARAM(&m_cds)); +// m_hLogIn = (HWND)::SendMessage(m_hLog, WM_COPYDATA, NULL, LPARAM(&m_cds)); + if( !::IsWindow(m_hLogIn) ){ + m_hLog = NULL; + m_CStat = TRUE; + m_Error = TRUE; + } + if( af ) Foreground(); + break; + } + case 2: + m_QueryCall = ""; + if( m_pLink == NULL ) return; + m_pLink->Clear(); + break; + } +} +//--------------------------------------------------------------------------- +// Hamlog‚ɃtƒH[ƒJƒX‚ðÝ’è +void CLogLink::SetFocus(void) +{ + if( m_Enabled != 1 ) return; + if( m_hLog == NULL ) return; + if( m_hLogIn == NULL ) return; + + ::SetForegroundWindow(m_hLogIn); +} +//--------------------------------------------------------------------------- +// ƒR[ƒ‹ƒTƒCƒ“‚Ì“]‘— +void CLogLink::SetCall(LPSTR pCall, int sw) +{ + if( !CheckLink() ) return; + + switch(m_Enabled){ + case 1: + { + int af = Application->Active; + Clear(); + if( m_hLog == NULL ) return; +#if MMSSTV + MultProc(); +#endif + + AnsiString CALL; + AnsiString PTB; + + if( m_fHLV5 ){ + CALL = pCall; + m_cds.dwData = IsJA(pCall) ? 26 : 25; + m_cds.cbData = 0; + m_cds.lpData = NULL; + m_hLogIn = (HWND)::SendMessage(m_hLog, WM_COPYDATA, WPARAM(m_hApp), LPARAM(&m_cds)); + m_cds.dwData = 0; + if( sw ) m_cds.dwData |= THW_ENTER; + m_cds.cbData = strlen(CALL.c_str()); + m_cds.lpData = CALL.c_str(); + m_hLogIn = (HWND)::SendMessage(m_hLog, WM_COPYDATA, WPARAM(m_hApp), LPARAM(&m_cds)); + } + else { + DevCall(CALL, PTB, pCall); + m_cds.dwData = 0; + if( sw ) m_cds.dwData |= THW_ENTER; + m_cds.cbData = strlen(CALL.c_str()); + m_cds.lpData = CALL.c_str(); + m_hLogIn = (HWND)::SendMessage(m_hLog, WM_COPYDATA, WPARAM(m_hApp), LPARAM(&m_cds)); +#if MMSSTV + MultProc(); +#endif + m_cds.dwData = 1; + if( sw ) m_cds.dwData |= THW_ENTER; + m_cds.cbData = strlen(PTB.c_str()); + m_cds.lpData = PTB.c_str(); + m_hLogIn = (HWND)::SendMessage(m_hLog, WM_COPYDATA, WPARAM(m_hApp), LPARAM(&m_cds)); + } + if( af ) Foreground(); + } + case 2: + m_QueryCall = pCall; + if( m_pLink == NULL ) return; + m_pLink->Query(pCall); + break; + } +} +//--------------------------------------------------------------------------- +// ƒR[ƒ‹ƒTƒCƒ“‚ÌŒŸõ +void CLogLink::FindCall(LPSTR pCall) +{ + if( !CheckLink() ) return; + + switch(m_Enabled){ + case 1: + { + int af = Application->Active; + SetCall(pCall, FALSE); + if( m_hLog == NULL ) return; +#if MMSSTV + MultProc(); +#endif + m_cds.dwData = 17; + m_cds.cbData = 0; + m_cds.lpData = NULL; + ::SendMessage(m_hLog, WM_COPYDATA, WPARAM(m_hApp), LPARAM(&m_cds)); + +#if MMSSTV + MultProc(); +#endif + + m_cds.dwData = 115; + m_cds.cbData = 0; + m_cds.lpData = NULL; + ::SendMessage(m_hLog, WM_COPYDATA, WPARAM(m_hMain), LPARAM(&m_cds)); + if( af ) Foreground(); + } + break; + case 2: + m_QueryCall = pCall; + if( m_pLink == NULL ) return; + m_pLink->Query(pCall); + break; + } +} +//--------------------------------------------------------------------------- +// ƒƒO‚Ì‹L˜^ +// 0-ƒf[ƒ^‚ÌÝ’è‚Ì‚Ý +// 1-ƒf[ƒ^‚ÌÝ’è‚ÆRETƒL[/–â‚¢‡‚킹‚ÌŽÀs(QSO‚ÌŠJŽnŽž) +// 2-‘‚«‚±‚Ý‚ðŽÀs(QSO‚ÌI—¹Žž) +void CLogLink::Write(SDMMLOG *sp, int sw) +{ + if( !CheckLink() ) return; + + switch(m_Enabled){ + case 1: + { + int af = Application->Active; + if( m_fHLV5 && (sw == 1) ){ + m_cds.dwData = IsJA(sp->call) ? 26 : 25; + m_cds.cbData = 0; + m_cds.lpData = NULL; + m_hLogIn = (HWND)::SendMessage(m_hLog, WM_COPYDATA, WPARAM(m_hApp), LPARAM(&m_cds)); + m_cds.dwData = 0; + m_cds.cbData = strlen(sp->call); + m_cds.lpData = sp->call; + m_hLogIn = (HWND)::SendMessage(m_hLog, WM_COPYDATA, WPARAM(m_hApp), LPARAM(&m_cds)); + } + char bf[1024]; + MMtoHAMLOG(bf, sp, m_fHLV5); + m_cds.dwData = 15; + if( sw ) m_cds.dwData |= THW_ENTER; + m_cds.cbData = strlen(bf); + m_cds.lpData = bf; + m_hLogIn = (HWND)::SendMessage(m_hLog, WM_COPYDATA, WPARAM(m_hApp), LPARAM(&m_cds)); + +#if MMSSTV + MultProc(); +#endif + switch(sw){ + case 1: + m_cds.dwData = 115; + m_cds.cbData = 0; + m_cds.lpData = NULL; + ::SendMessage(m_hLog, WM_COPYDATA, WPARAM(m_hMain), LPARAM(&m_cds)); + break; + case 2: + m_cds.dwData = 18 | THW_SAVEBOX_OFF; + m_cds.cbData = 0; + m_cds.lpData = NULL; + ::SendMessage(m_hLog, WM_COPYDATA, WPARAM(m_hApp), LPARAM(&m_cds)); + break; + } + if( af ) Foreground(); + } + break; + case 2: + if( m_pLink == NULL ) return; + m_QueryCall = sp->call; + m_pLink->LogWrite(sp, sw); + break; + } +} +//--------------------------------------------------------------------------- +int __fastcall GetLFCount(LPCSTR p) +{ + int n = 0; + for(; *p; p++ ){ + if( *p == LF ) n++; + } + return n; +} +//--------------------------------------------------------------------------- +// Hamlog‚©‚ç‚Ì•ÔMƒƒbƒZ[ƒW‚©‚çName,QTH,REM1‚𓾂é +int CLogLink::AnaData(SDMMLOG *sp, COPYDATASTRUCT *cp) +{ + BOOL r = FALSE; + + char bf[1024]; + int len = cp->cbData; + if( len >= 1023 ) len = 1023; + if( len && (cp->lpData != NULL) ){ + StrCopy(bf, LPCSTR(cp->lpData), len); + int lfLen = GetLFCount(bf); + LPSTR t, p; + if( len < 10 ){ // Žü”g”î•ñ + if( m_Polling ){ + t = SkipSpace(bf); ClipLF(t); clipsp(t); + if( *t ){ + Log.SetFreq(&Log.m_sd, t); + r = 106; + } + } + } + else if( lfLen >= 10 ){ // ŒŸõŒ‹‰Êî•ñ + p = StrDlm(t, bf, LF); // Call + p = StrDlm(t, p, LF); // PTB + p = StrDlm(t, p, LF); // Date + p = StrDlm(t, p, LF); // Time + p = StrDlm(t, p, LF); // His + p = StrDlm(t, p, LF); // My + p = StrDlm(t, p, LF); // Freq + p = StrDlm(t, p, LF); // Mode + p = StrDlm(t, p, LF); // Code + t = SkipSpace(t); ClipLF(t); clipsp(t); + if( *t ){ + StrCopy(sp->opt1, t, MLOPT); + r = 115; + } + p = StrDlm(t, p, LF); // GL + p = StrDlm(t, p, LF); // QSL + p = StrDlm(t, p, LF); // Name + if( !sp->name[0] ){ + t = SkipSpace(t); ClipLF(t); clipsp(t); + if( *t ){ + StrCopy(sp->name, t, MLNAME); + r = 115; + } + } + p = StrDlm(t, p, LF); // QTH +// if( !sp->qth[0] ){ + if( !sp->qth[0] || !IsJA(sp->call) ){ + t = SkipSpace(t); ClipLF(t); clipsp(t); + if( *t ){ + StrCopy(sp->qth, t, MLQTH); + r = 115; + } + } + StrDlm(t, p, LF); // REM1 + if( !sp->rem[0] ){ + t = SkipSpace(t); ClipLF(t); clipsp(t); + if( *t ){ + StrCopy(sp->rem, t, MLREM); + r = 115; + } + } + } + } + return r; +} +//--------------------------------------------------------------------------- +void __fastcall CLogLink::NotifySession(LPCSTR pSession) +{ + if( m_pLink == NULL ) return; + + m_pLink->NotifySession(pSession); + CheckLink(); +} +//--------------------------------------------------------------------------- +int __fastcall CLogLink::QReturn(SDMMLOG *sp, const mmLOGDATA *pLog) +{ + if( pLog == NULL ) return FALSE; + int r = FALSE; + + mmLOGDATA logdata; + memcpy(&logdata, pLog, sizeof(logdata)); + + if( stricmp(logdata.m_Call, m_QueryCall.c_str()) ) return FALSE; + LPSTR t; + if(!sp->name[0] ){ + t = SkipSpace(logdata.m_Name); ClipLF(t); clipsp(t); + if( *t ){ + StrCopy(sp->name, t, MLNAME); + r = TRUE; + } + } + if( !sp->qth[0] ){ + t = SkipSpace(logdata.m_QTH); ClipLF(t); clipsp(t); + if( *t ){ + StrCopy(sp->qth, t, MLQTH); + r = TRUE; + } + } + if( !sp->rem[0] ){ + t = SkipSpace(logdata.m_Note); ClipLF(t); clipsp(t); + if( *t ){ + StrCopy(sp->rem, t, MLREM); + r = TRUE; + } + } + return r; +} +//--------------------------------------------------------------------------- +void __fastcall CLogLink::SetTime(SYSTEMTIME *tp, int sw) +{ + if( m_pLink == NULL ) return; + + m_pLink->SetTime(tp, sw); +} +//--------------------------------------------------------------------------- +LPCSTR __fastcall CLogLink::GetItemName(void) +{ + return m_ItemName.c_str(); +} +//--------------------------------------------------------------------------- +void __fastcall CLogLink::SetItemName(LPCSTR pName) +{ + m_ItemName = pName; +} +//--------------------------------------------------------------------------- +void __fastcall CLogLink::LoadMMLink(TMemIniFile *pIni) +{ + m_ItemName = pIni->ReadString("MMLink", "Name", ""); +} +//--------------------------------------------------------------------------- +void __fastcall CLogLink::SaveMMLink(TMemIniFile *pIni) +{ + pIni->WriteString("MMLink", "Name", m_ItemName); +} +//--------------------------------------------------------------------------- +BOOL __fastcall CLogLink::IsCopyData(void) +{ + if( m_Enabled != 2 ) return FALSE; + if( !m_pLink ) return FALSE; + return (m_pLink->GetCaps() & capWMCOPYDATA); +} +//--------------------------------------------------------------------------- + diff --git a/Loglink.h b/Loglink.h new file mode 100644 index 0000000..b274288 --- /dev/null +++ b/Loglink.h @@ -0,0 +1,123 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------------- +#ifndef LogLinkH +#define LogLinkH + +#include +#include +#include + +#include "ComLib.h" +#include "LogConv.h" +#include "MMLink.h" + +#define LINKINTERVAL 200 + +//------------ Command of Hamlog ------------- +#define THW_ENTER 0x10000 +#define THW_FOCUS 0x20000 +#define THW_SAVEBOX_ON 0x40000 +#define THW_SAVEBOX_OFF 0x80000 +#define THW_APPLIHWND 0x100000 + +//--------------------------------------------------------------------------- +// CLogLinkƒNƒ‰ƒX +class CLogLink +{ +private: + int m_Enabled; // ƒŠƒ“ƒN‚Ì‹–‰Â + int m_Polling; // Žü”g”ƒ|[ƒŠƒ“ƒO + BOOL m_PTTEnabled; // PTTƒRƒ“ƒgƒ[ƒ‹ + BOOL m_1stSession; + + HWND m_hLog; // HamlogƒvƒƒOƒ‰ƒ€‚̃nƒ“ƒhƒ‹ + HWND m_hLogIn; // Hamlog“ü—̓EƒCƒ“ƒhƒE‚̃nƒ“ƒhƒ‹ + + COPYDATASTRUCT m_cds; // ƒCƒ“ƒ^[ƒtƒF[ƒX\‘¢‘Ì + int m_Count; // ŠÄŽ‹ƒJƒEƒ“ƒ^ + int m_CStat; // ó‘Ô•ÏXƒZƒ}ƒtƒH + int m_Count2; // ƒ|[ƒŠƒ“ƒOƒJƒEƒ“ƒ^ + + HWND m_hMain; // ƒƒCƒ“‰æ–ʂ̃EƒCƒ“ƒhƒEƒnƒ“ƒhƒ‹ + HWND m_hApp; // ƒAƒvƒŠƒP[ƒVƒ‡ƒ“‚̃EƒCƒ“ƒhƒEƒnƒ“ƒhƒ‹ + BOOL m_fHLV5; // Hamlog Ver 5.0 + + int m_Error; + + AnsiString m_ItemName; + AnsiString m_QueryCall; + AnsiString m_AppName; + int m_AppVer; + int m_MMStat; + int m_AStat; + UINT m_uMsg; + + char m_strMode[16]; +public: + CMMLink *m_pLink; +private: + void __fastcall CloseMMLink(void); + +public: + CLogLink(); + ~CLogLink(); + void SetHandle(HWND hMain, UINT uMsg); + BOOL IsEnabled(void){return m_Enabled;}; + void UpdateLink(int sw); + void Foreground(void); + BOOL IsError(void){return m_Error;}; + void ClearError(void){m_Error = 0;}; + BOOL __fastcall IsLink(void); + LPCSTR __fastcall GetSessionName(void); + + BOOL CheckLink(void); + BOOL TimerLogLink(void); + void Clear(void); + void SetFocus(void); + void SetCall(LPSTR pCall, int sw); + void FindCall(LPSTR pCall); + void Write(SDMMLOG *sp, int sw); + int AnaData(SDMMLOG *sp, COPYDATASTRUCT *cp); + + BOOL IsPolling(void){return m_Polling;}; + void SetPolling(int sw){m_Polling = sw;}; + void EventGetFreq(void); + void SetFreq(LPSTR pFreq); + void SetMode(LPCSTR pMode); + void __fastcall SetPTT(int ptt); + + void __fastcall SetTime(SYSTEMTIME *tp, int sw); + +public: + void __fastcall LoadMMLink(TMemIniFile *pIni); + void __fastcall SaveMMLink(TMemIniFile *pIni); + void __fastcall NotifySession(LPCSTR pSession); + int __fastcall QReturn(SDMMLOG *sp, const mmLOGDATA *pLog); + LPCSTR __fastcall GetItemName(void); + void __fastcall SetItemName(LPCSTR pName); + BOOL __fastcall IsCopyData(void); + + inline BOOL __fastcall GetPTTEnabled(void){return m_PTTEnabled;}; + inline void __fastcall SetPTTEnabled(BOOL e){m_PTTEnabled = e;}; +}; +extern CLogLink LogLink; +#endif + diff --git a/MMCG.DEF b/MMCG.DEF new file mode 100644 index 0000000..7c76346 --- /dev/null +++ b/MMCG.DEF @@ -0,0 +1,1546 @@ +!=========================================================================== +! ‚`‚i‚`”Ô†’è‹`ƒtƒ@ƒCƒ‹ For MMCG.EXE +! +!¦ ‚±‚̃tƒ@ƒCƒ‹‚ð•ÏX‚µ‚½ê‡‚ÍuMMCG.BINv‚ðÁ‹Ž‚µ‚ÄuMMCG.EXEv‚ð +! ‹N“®‚µ‚ĉº‚³‚¢BV‚µ‚¢uMMCG.BINv‚ª¶¬‚³‚ê‚Ü‚·B +! +!¦@“ǂ݂Í<,>‚Å‹æØ‚Á‚Ä•¡”ŒÂ‹Lq‚·‚鎖‚ª‚Å‚«‚Ü‚·B‚Ђ炪‚È‚âƒJƒ^ƒJƒi +! ‚ð‹Lq‚µ‚Ä‚à—Ç‚¢‚Å‚µ‚傤B +! +! —á> 2509 ‚’ÎŽs TAKATUKI,‚½‚©‚‚«,ƒ^ƒJƒcƒL,À¶Â· +! +! ‚½‚¾‚µA‚ ‚Ü‚èƒtƒ@ƒCƒ‹ƒTƒCƒY‚ª‘å‚«‚­‚È‚é‚ÆAƒŒƒXƒ|ƒ“ƒX‚ªˆ«‚­‚È‚è +! ‚Ü‚·‚̂ŒˆÓ‚ª•K—v‚Å‚·B +! +!¦@‚±‚̃tƒ@ƒCƒ‹‚ðƒlƒbƒg“™‚É—¬’Ê‚³‚¹‚éꇂÍA•ÏX—š—ð‚ð’ljÁ‹LÚ‚·‚é +! Ž–‚ð‚¨Š©‚ß‚µ‚Ü‚·B +! +!<<<•ÏX—š—ð>>> +! Feb 4, 1996 - 1029(‚ ‚«‚é–ìŽs)’ljÁ JE3HHT +! Jun 5, 1997 - 0134(–kL“‡Žs)’ljÁ JE3HHT +! Jun 5, 1997 - 2212(‹ž“c•ÓŽs)’ljÁ JE3HHT +! Jan 10, 2000 - 0135,1231,1343,1422,2722,4029’ljÁ +! SBAE=>SABAE,SINNANJO=>SINNANYOU,UDO=>UTO +! 27017,01029Á–Å @@@JQ3UDL +!========================================================================== +01 % HOKKAIDO +0101 ŽD–yŽs SAPPORO +0102 ˆ®ìŽs ASAHIKAWA +0103 ¬’MŽs OTARU +0104 ”ŸŠÙŽs HAKODATE +0105 Žº—–Žs MURORAN +0106 ‹ú˜HŽs KUSIRO +0107 ‘ÑLŽs OBIHIRO +0108 –kŒ©Žs KITAMI +0109 —[’£Žs YUBARI +0110 ŠâŒ©‘òŽs IWAMIZAWA +0111 –Ô‘–Žs ABASIRI +0112 —¯–GŽs RUMOI +0113 “Ϭ–qŽs TOMAKOMAI +0114 ’t“àŽs WAKKANAI +0115 ”ü‰SŽs BIBAI +0116 ˆ°•ÊŽs ASIBETU +0117 ]•ÊŽs EBETU +0118 Ô•½Žs AKABIRA +0119 –ä•ÊŽs MONBETU +0120 Žm•ÊŽs SIBETU +0121 –¼ŠñŽs NAYORO +0122 ŽOŠ}Žs MIKASA +0123 ªŽºŽs NEMURO +0124 çÎŽs CITOSE +0125 ‘êìŽs TAKIKAWA +0126 »ìŽs SUNAGAWA +0127 ‰ÌŽu“àŽs UTASINAI +0128 [ìŽs FUKAGAWA +0129 •x—Ç–ìŽs FURANO +0130 “o•ÊŽs NOBORIBETU +0131 Œb’ëŽs ENIWA +0132 ‹T“cŽs* +0133 ˆÉ’BŽs DATE +0134 –kL“‡Žs KITAHIROSIMA +0135 ÎŽëŽs ISIKARI +01001 ˆ¢Š¦ŒS AKAN +01002 ‘«ŠñŒS ASYORO +01003 ŒúŠÝŒS AKKESI +01004 Œú“cŒS ATUTA +01005 –Ô‘–ŒS ABASIRI +01006 ˆ¸“cŒS(ŒãŽu) ABUTA +01007 ˆ¸“cŒS(’_U) ABUTA +01008 ÎŽëŒS ISIKARI +01009 ˆé’JŒS ISOYA +01010 Šâ“àŒS IWANAI +01011 —LŽìŒS USU +01012 ‰ÌŠüŒS* +01013 ‰Y‰ÍŒS URAKAWA +01014 ‰J—³ŒS URYU +01015 Ž}KŒS ESASI +01016 ‰œKŒS OKUSIRI +01017 ”E˜HŒS* +01018 ‰Í¼ŒS KASAI +01019 ‰Í“ŒŒS KATOU +01020 Š’ŒËŒS KABATO +01021 ãˆéŒS KAMIISO +01022 ãìŒS(\Ÿ) KAMIKAWA +01023 ãìŒS(ãì) KAMIKAWA +01024 ‹T“cŒS KAMEDA +01025 Š•”ŒS KAYABE +01026 ìãŒS KAWAKAMI +01027 ‹ú˜HŒS KUSIRO +01028 ‹v‰“ŒS KUDO +01029 ŽD–yŒS* +01030 —lŽ—ŒS SAMANI +01031 ¹—¬ŒS SARU +01032 ÓàŒS SIZUNAI +01033 •W’ÃŒS SIBETU +01034 “‡–qŒS SIMAMAKI +01035 Ï’OŒS SYAKOTAN +01036 ŽÎ—¢ŒS SYARI +01037 ”’˜VŒS SIRAOI +01038 ”’fŒS SIRANUKA +01039 Žõ“sŒS SUTTU +01040 £’IŒS SETANA +01041 @’JŒS SOUYA +01042 ‹ó’mŒS(‹ó’m) SOUCI +01043 ‹ó’mŒS(ãì) SOUCI +01044 çÎŒS* +01045 “V‰–ŒS(—¯–G) TESIO +01046 “V‰–ŒS(@’J) TESIO +01047 \ŸŒS TOKACI +01048 í˜CŒS TOKORO +01049 “Ï‘OŒS TOMAMAE +01050 ’†ìŒS(ãì) NAKAGAWA +01051 ’†ìŒS(\Ÿ) NAKAGAWA +01052 VŠ¥ŒS NIIKABUTU +01053 Ž¢ŽuŒS NISI +01054 ªŽºŒS* +01055 –ì•tŒS NOTUKE +01056 ‰ÔçŒS* +01057 •l‰vŒS HAMAMASU +01058 ”ü‘ŒS* +01059 •OŽRŒS HIYAMA +01060 L”öŒS HIRO +01061 ‘¾˜EŒS* +01062 ŒÃ‰FŒS FURU +01063 ŒÃ•½ŒS FURUBIRA +01064 –yòŒS HOROIZUMI +01065 –y•ÊŒS* +01066 ‘–ÑŒS MASIKE +01067 ¼‘OŒS MATUMAE +01068 ŽOÎŒS MITUISI +01069 –Ú—œŒS MENASI +01070 –ä•ÊŒS MONBETU +01071 ŽR‰zŒS YAMAKOSI +01072 —[’£ŒS YUBARI +01073 —E•¥ŒS(’_U) YUFUTU +01074 —E•¥ŒS(ãì) YUFUTU +01075 —]ŽsŒS YOICI +01076 —˜KŒS RISIRI +01077 —¯–GŒS RUMOI +01078 —ç•¶ŒS REBUN +010101 ŽD–yŽs’†‰›‹æ CYUO +010102 ŽD–yŽs–k‹æ KITA +010103 ŽD–yŽs“Œ‹æ HIGASI +010104 ŽD–yŽs”’΋æ SIROISI +010105 ŽD–yŽs–L•½‹æ TOYOHIRA +010106 ŽD–yŽs“ì‹æ MINAMI +010107 ŽD–yŽs¼‹æ NISI +010108 ŽD–yŽsŒú•Ê‹æ ATUBETU +010109 ŽD–yŽsŽèˆî‹æ TEINE +02 % AOMORI +0201 ÂXŽs AOMORI +0202 O‘OŽs HIROSAKI +0203 ”ªŒËŽs HACINOHE +0204 •ÎŽs KUROISI +0205 ŒÜŠìŒ´Žs GOSYOGAWARA +0206 \˜a“cŽs TOWADA +0207 ŽO‘òŽs MISAWA +0208 ‚Þ‚ÂŽs MUTU +02001 ã–kŒS KAMIKITA +02002 –k’ÃŒyŒS KITATUGARU +02003 ŽOŒËŒS SANNOHE +02004 ‰º–kŒS SIMOKITA +02005 ’†’ÃŒyŒS NAKATUGARU +02006 ¼’ÃŒyŒS NISITUGARU +02007 “Œ’ÃŒyŒS HIGASITUGARU +02008 “ì’ÃŒyŒS MINAMITUGARU +03 % IWATE +0301 ·‰ªŽs MORIOKA +0302 Š˜ÎŽs KAMAISI +0303 ‹{ŒÃŽs MIYAKO +0304 ˆêŠÖŽs ICINOSEKI +0305 ‘å‘D“nŽs OOFUNATO,OFUNATO +0306 …‘òŽs MIZUSAWA +0307 ‰ÔŠªŽs HANAMAKI +0308 –kãŽs KITAKAMI +0309 ‹vŽœŽs KUJI +0310 ‰“–ìŽs TOONO,TONO +0311 —¤‘O‚“cŽs RIKUZENTAKADA +0312 ]ŽhŽs ESASI +0313 “ñŒËŽs NINOHE +03001 ’_‘òŒS ISAWA +03002 ŠâŽèŒS IWATE +03003 ]ŽhŒS* +03004 㕈ɌS KAMIHEI +03005 ‹ãŒËŒS KUNOHE +03006 ‹CåŒS KESEN +03007 ‰º•ˆɌS SIMOHEI +03008 އ”gŒS SIWA +03009 ¼”ÖˆäŒS NISIIWAI +03010 “ñŒËŒS NINOHE +03011 •BŠÑŒS HIENUKI +03012 “Œ”ÖˆäŒS HIGASIIWAI +03013 ˜a‰êŒS WAGA +04 % AKITA +0401 H“cŽs AKITA +0402 ”\‘ãŽs NOSIRO +0403 ‘åŠÙŽs OODATE,ODATE +0404 ‰¡ŽèŽs YOKOTE +0405 –{‘‘Žs HONJO +0406 ’jŽ­Žs OGA +0407 “’‘òŽs YUZAWA +0408 ‘å‹ÈŽs OOMAGARI,OMAGARI +0409 Ž­ŠpŽs KAZUNO +04001 —YŸŒS OGACI +04002 Ž­ŠpŒS KAZUNO +04003 ‰Í•ÓŒS KAWABE +04004 –kH“cŒS KITAAKITA +04005 å–kŒS SENBOKU +04006 •½Ž­ŒS HIRAKA +04007 “ìH“cŒS MINAMIAKITA +04008 ŽR–{ŒS YAMAMOTO +04009 —R—˜ŒS YURI +05 % YAMAGATA +0501 ŽRŒ`Žs YAMAGATA +0502 •Ä‘òŽs YOBEZAWA +0503 ’߉ªŽs TURUOKA +0504 Žð“cŽs SAKATA +0505 V¯Žs SINJO +0506 Ц‰Í]Žs SAGAE +0507 ãŽRŽs KAMINOYAMA +0508 ‘ºŽRŽs MURAYAMA +0509 ’·ˆäŽs NAGAI +0510 “V“¶Žs TENDO +0511 “ŒªŽs HIGASINE +0512 ”ö‰Ô‘òŽs OBANAZAWA +0513 “ì—zŽs NANYO +05001 –OŠCŒS AKUMI +05002 –k‘ºŽRŒS KITAMURAYAMA +05003 ¼’uŽ’ŒS NISIOKITAMA +05004 ¼“cìŒS NISITAGAWA +05005 ¼‘ºŽRŒS NISIMURAYAMA +05006 “Œ’uŽ’ŒS HIGASIOKITAMA +05007 “Œ“cìŒS HIGASITAGAWA +05008 “Œ‘ºŽRŒS HIGASIMURAYAMA +05009 “ì’uŽ’ŒS* +05010 “쑺ŽRŒS* +05011 ÅãŒS MOGAMI +06 % MIYAGI +0601 å‘äŽs SENDAI +0602 ΊªŽs ISINOMAKI +0603 ‰–Š˜Žs SIOGAMA +0604 ŒÃìŽs FURUKAWA +0605 ‹CåÀŽs KESENNUMA +0606 ”’ÎŽs SIROISI +0607 –¼ŽæŽs NATORI +0608 Šp“cŽs KAKUDA +0609 ‘½‰êéŽs TAGAJO +0610 òŽs* +0611 ŠâÀŽs IWANUMA +06001 ˆÉ‹ïŒS IGU +06002 ‰²Ž­ŒS OSIKA +06003 Š “cŒS KATUTA +06004 ‰Á”üŒS KAMI +06005 ŒIŒ´ŒS KURIHARA +06006 •ìŒS KUROKAWA +06007 Žu“cŒS SIDA +06008 ŽÄ“cŒS SIBATA +06009 ‹Ê‘¢ŒS TAMATUKURI +06010 ‰““cŒS TOODA,TODA +06011 “o•ÄŒS TOME +06012 –¼ŽæŒS* +06013 ‹{éŒS MIYAGI +06014 –{‹gŒS MOTOYOSI +06015 “¶ŒS MONO +06016 ˜j—ŒS WATARI +060101 å‘äŽs—t‹æ AOBA +060102 å‘äŽs‹{é–ì‹æ MIYAGINO +060103 å‘äŽsŽá—Ñ‹æ WAKABAYASI +060104 å‘äŽs‘¾”’‹æ TAIHAKU +060105 å‘äŽsò‹æ IZUMI +07 % FUKUSIMA +0701 •Ÿ“‡Žs FUKUSIMA +0702 ‰ï’ÎἎs AIZUWAKAMATU +0703 ŒSŽRŽs KOORIYAMA,KORIYAMA +0704 •½Žs* +0705 ”’‰ÍŽs SIRAKAWA +0706 Œ´’¬Žs HARAMACI +0707 {‰êìŽs SUKAGAWA +0708 Šì‘½•ûŽs KITAKATA +0709 í”ÖŽs* +0710 ”ÖéŽs* +0711 ‘Š”nŽs SOUMA +0712 “à‹½Žs* +0713 –Ü—ˆŽs* +0714 “ñ–{¼Žs NIHONMATU +0715 ‚¢‚í‚«Žs IWAKI +0716 Žá¼Žs* +07001 ˆÀÏŒS* +07002 ˆÀ’BŒS ADACI +07003 ÎìŒS ISIKAWA +07004 ÎéŒS* +07005 Šâ£ŒS IWASE +07006 ‘åÀŒS OONUMA,ONUMA +07007 ‰ÍÀŒS KAWANUMA +07008 –k‰ï’ÃŒS KITAAIZU +07009 M•vŒS* +07010 ‘Š”nŒS SOMA +07011 ˆÉ’BŒS DATE +07012 “c‘ºŒS TAMURA +07013 ¼”’‰ÍŒS NISISIRAKAWA +07014 “Œ”’ìŒS HIGASISIRAKAWA +07015 ‘o—tŒS FUTABA +07016 “ì‰ï’ÃŒS MINAMIAIZU +07017 –ë–ƒŒS YAMA +08 % NIIGATA +0801 VŠƒŽs NIIGATA +0802 ’·‰ªŽs NAGAOKA +0803 ‚“cŽs* +0804 ŽOðŽs SANJO +0805 ”èŽs KASIWAZAKI +0806 V”­“cŽs SIBATA +0807 V’ÃŽs NIITU +0808 ¬ç’JŽs OJIYA +0809 ‰Á–ÎŽs KAMO +0810 \“ú’¬Žs TOOKAMACI,TOKAMACI +0811 Œ©•Žs MITUKE +0812 ‘ºãŽs MURAKAMI +0813 ‰Žs TUBAME +0814 ’¼]’ÃŽs* +0815 “È”öŽs TOCIO +0816 Ž…‹›ìŽs ITOIGAWA +0817 VˆäŽs ARAI +0818 ŒÜòŽs GOSEN +0819 —¼’ÃŽs RYOTU +0820 ”’ªŽs SIRONE +0821 –L‰hŽs TOYOSAKA +0822 ã‰zŽs JOETU +08001 Šâ‘DŒS IWAFUNE +08002 Š ‰HŒS KARIWA +08003 –k‹›ÀŒS KITAUONUMA +08004 –kŠ—Œ´ŒS KITAKANBARA +08005 ŒÃŽuŒS KOSI +08006 ²“nŒS SADO +08007 ŽO“‡ŒS SANTOU +08008 ’†‹›ÀŒS NAKAUONUMA +08009 ’†Š—Œ´ŒS NAKAKANBARA +08010 ’†ŒzéŒS NAKAKUBIKI +08011 ¼Š—Œ´ŒS NISIKANBARA +08012 ¼ŒzéŒS NISIKUBIKI +08013 “ŒŠ—Œ´ŒS HIGASIKANBARA +08014 “ŒŒzéŒS HIGASIKUBIKI +08015 “ì‹›ÀŒS MINAMIUONUMA +08016 “슗Œ´ŒS MINAMIKANBARA +09 % NAGANO +0901 ’·–ìŽs NAGANO +0902 ¼–{Žs MATUMOTO +0903 ã“cŽs UEDA +0904 ‰ª’JŽs OKAYA +0905 ”Ñ“cŽs IIDA +0906 z–KŽs SUWA +0907 {âŽs SUZAKA +0908 ¬”Žs KOMORO +0909 ˆÉ“ߎs INE +0910 ‹îƒ–ªŽs KOMAGANE +0911 ’†–ìŽs NAKANO +0912 ‘å’¬Žs OOMACI,OMACI +0913 ”ÑŽRŽs IIYAMA +0914 Š–ìŽs CINO +0915 ‰–KŽs SIOJIRI +0916 ŽÂƒmˆäŽs* +0917 XûŽs KOUSYOKU +0918 ²‹vŽs SAKU +09001 ãˆÉ“ߌS KAMIINA +09002 よäŒS KAMITAKAI +09003 ã…“àŒS KAMIMINOCI +09004 –Ø‘]ŒS KISO +09005 –kˆÀ“ÜŒS KITAAZUMI +09006 –k²‹vŒS KITASAKU +09007 X‹‰ŒS SARASINA +09008 ‰ºˆÉ“ߌS SIMOINA +09009 ‰º‚ˆäŒS SIMOTAKAI +09010 ‰º…“àŒS SIMOMINOCI +09011 z–KŒS SUWA +09012 ¬Œ§ŒS CISAGATA +09014 û‰ÈŒS HANISINA +09015 “Œ’}–€ŒS HIGASICIKUMA +09016 “ìˆÀ“ÜŒS MINAMIAZUMI +09017 “첋vŒS MINAMISAKU +10 % TOUKYO,TOKYO +1001 ‚Q‚R‹æ TOUKYO,TOKYO +1002 ”ª‰¤ŽqŽs HACIOJI +1003 —§ìŽs TACIKAWA +1004 •‘ –ìŽs MUSASINO +1005 ŽO‘éŽs MITAKA +1006 ”~Žs OUME +1007 •{’†Žs FUCYU +1008 º“‡Žs AKISIMA +1009 ’²•zŽs CYOFU +1010 ’¬“cŽs MACIDA +1011 ¬‹àˆäŽs KOGANEI +1012 ¬•½Žs KODAIRA +1013 “ú–ìŽs HINO +1014 “Œ‘ºŽRŽs HIGASIMURAYAMA +1015 ‘•ªŽ›Žs KOKUBUNJI +1016 ‘—§Žs KUNITACI +1017 •Û’JŽs HOUYA +1018 “c–³Žs TANASI +1019 •Ÿ¶Žs FUSSA +1020 ]Žs KOMAE +1021 “Œ‘å˜aŽs HIGASIYAMATO +1022 ´£Žs KIYOSE +1023 “Œ‹v—¯•ÄŽs HIGASIKURUME +1024 •‘ ‘ºŽRŽs MUSASIMURAYAMA +1025 ‘½–€Žs TAMA +1026 ˆîéŽs INAGI +1027 HìŽs AKIGAWA +1028 ‰H‘ºŽs HAMURA +1029 ‚ ‚«‚é–ìŽs AKIRUNO +10001 –k‘½–€ŒS* +10002 ¼‘½–€ŒS NISITAMA +10003 “쑽–€ŒS* +10004 ‘哇Žx’¡ OOSIMA,OSIMA +10005 ŽO‘îŽx’¡ MIYAKE +10006 ”ªäŽx’¡ HACIJO +10007 ¬Š}Œ´Žx’¡ OGASAWARA +100101 “Œ‹ž“sç‘ã“c‹æ CIYODA +100102 “Œ‹ž“s’†‰›‹æ CYUO +100103 “Œ‹ž“s`‹æ MINATO +100104 “Œ‹ž“sVh‹æ SINJUKU +100105 “Œ‹ž“s•¶‹ž‹æ BUNKYO +100106 “Œ‹ž“s‘䓌‹æ TAITOU +100107 “Œ‹ž“s–n“c‹æ SUMIDA +100108 “Œ‹ž“s]“Œ‹æ KOUTOU +100109 “Œ‹ž“s•iì‹æ SINAGAWA +100110 “Œ‹ž“s–Ú•‹æ MEGURO +100111 “Œ‹ž“s‘å“c‹æ OOTA,OTA +100112 “Œ‹ž“s¢“c’J‹æ SETAGAYA +100113 “Œ‹ž“sa’J‹æ SIBUYA +100114 “Œ‹ž“s’†–ì‹æ NAKANO +100115 “Œ‹ž“s™•À‹æ SUGINAMI +100116 “Œ‹ž“s–L“‡‹æ TOSIMA +100117 “Œ‹ž“s–k‹æ KITA +100118 “Œ‹ž“srì‹æ ARAKAWA +100119 “Œ‹ž“s”‹´‹æ ITABASI +100120 “Œ‹ž“s—û”n‹æ NERIMA +100121 “Œ‹ž“s‘«—§‹æ ADACI +100122 “Œ‹ž“sŠ‹ü‹æ KATUSIKA +100123 “Œ‹ž“s]ŒËì‹æ EDOGAWA +11 % KANAGAWA +1101 ‰¡•lŽs YOKOHAMA +1102 ‰¡{‰êŽs YOKOSUKA +1103 ìèŽs KAWASAKI +1104 •½’ËŽs HIRATUKA +1105 Š™‘qŽs KAMAKURA +1106 “¡‘òŽs FUJISAWA +1107 ¬“cŒ´Žs ODAWARA +1108 Šƒ–èŽs CIGASAKI +1109 €ŽqŽs ZUSI +1110 ‘Š–ÍŒ´Žs SAGAMIHARA +1111 ŽO‰YŽs MIURA +1112 `–ìŽs HADANO +1113 Œú–ØŽs ATUGI +1114 ‘å˜aŽs YAMATO +1115 ˆÉ¨Œ´Žs ISEHARA +1116 ŠC˜V–¼Žs EBINA +1117 ÀŠÔŽs ZAMA +1118 “ì‘«•¿Žs MINAMIASIGARA +1119 ˆ»£Žs AYASE +11001 ˆ¤bŒS AIKOU +11002 ‘«•¿ãŒS ASIGARAKAMI +11003 ‘«•¿‰ºŒS ASIGARASIMO +11004 ‚ÀŒS KOUZA +11005 ’ËvˆäŒS TUKUI +11006 ’†ŒS NAKA +11007 ŽO‰YŒS MIURA +110101 ‰¡•lŽs’ߌ©‹æ TURUMI +110102 ‰¡•lŽs_“Þì‹æ KANAGAWA +110103 ‰¡•lŽs¼‹æ NISI +110104 ‰¡•lŽs’†‹æ NAKA +110105 ‰¡•lŽs“ì‹æ MINAMI +110106 ‰¡•lŽs•Û“yƒ–’J‹æ HODOGAYA +110107 ‰¡•lŽsˆéŽq‹æ ISOGO +110108 ‰¡•lŽs‹à‘ò‹æ KANAZAWA +110109 ‰¡•lŽs`–k‹æ KOUHOKU +110110 ‰¡•lŽsŒË’Ë‹æ TOTUKA +110111 ‰¡•lŽs`“ì‹æ KOUNAN +110112 ‰¡•lŽsˆ®‹æ ASAHI +110113 ‰¡•lŽs—΋æ MIDORI +110114 ‰¡•lŽs£’J‹æ SEYA +110115 ‰¡•lŽs‰h‹æ SAKAE +110116 ‰¡•lŽsò‹æ IZUMI +110117 ‰¡•lŽs—t‹æ AOBA +110118 ‰¡•lŽs“s’}‹æ TUZUKI +110301 ìèŽsìè‹æ KAWASAKI +110302 ìèŽsK‹æ SAIWAI +110303 ìèŽs’†Œ´‹æ NAKAHARA +110304 ìèŽs‚’Ëæ TAKATU +110305 ìèŽs‘½–€‹æ TAMA +110306 ìèŽs‹{‘O‹æ MIYAMAE +110307 ìèŽs–ƒ¶‹æ ASAO +12 % CIBA +1201 ç—tŽs CIBA +1202 ’¶ŽqŽs CYOSI +1203 ŽsìŽs ICIKAWA +1204 ‘D‹´Žs FUNABASI +1205 ŠÙŽRŽs TATEYAMA +1206 –ØX’ÃŽs KISARAZU +1207 ¼ŒËŽs MATUDO +1208 –ì“cŽs NODA +1209 ²Œ´Žs SAWARA +1210 –ÎŒ´Žs BOBARA +1211 ¬“cŽs NARITA +1212 ²‘qŽs SAKURA +1213 “Œ‹àŽs TOUGANE +1214 ”ª“úŽsêŽs YOKAICIBA +1215 ˆ®Žs ASAHI +1216 KŽu–ìŽs NARASINO +1217 ”Žs KASIWA +1218 Ÿ‰YŽs KATUURA +1219 ŽsŒ´Žs ICIHARA +1220 —¬ŽRŽs NAGAREYAMA +1221 ”ªç‘ãŽs YACIYO +1222 ‰ä‘·ŽqŽs ABIKO +1223 Š›ìŽs KAMOGAWA +1224 ŒN’ÃŽs KIMITU +1225 Š™ƒ–’JŽs KAMAGAYA +1226 •x’ÃŽs FUTTU +1227 ‰YˆÀŽs URAYASU +1228 ŽlŠX“¹Žs YOTUKAIDO +1229 ‘³ƒ–‰YŽs SODEGAURA +1230 ”ªŠXŽs YACIMATA +1231 ˆó¼Žs@@@@@INZAI +12001 ˆÀ–[ŒS AWA +12002 ˆÎ‹÷ŒS ISUMI +12003 ŽsŒ´ŒS* +12004 ˆó׌S INBA +12005 ŠCãŒS KAIJO +12006 ŽæŒS KATORI +12007 ŒN’ÃŒS* +12008 ŽR•ŒS SANBU +12009 ‘xºŒS SOSA +12010 ç—tŒS* +12011 ’·¶ŒS CYOSEI +12012 “ŒŠ‹üŒS HIGASIKATUSIKA +120101 ç—tŽs’†‰›‹æ CYUO +120102 ç—tŽs‰ÔŒ©ì‹æ HANAMIGAWA +120103 ç—tŽsˆî–Ñ‹æ INAGE +120104 ç—tŽsŽá—t‹æ WAKABA +120105 ç—tŽs—΋æ MIDORI +120106 ç—tŽs”ü•l‹æ MIHAMA +13 % SAITAMA +1301 ‰Y˜aŽs URAWA +1302 ì‰zŽs KAWAGOE +1303 ŒF’JŽs KUMAGAYA +1304 ìŒûŽs KAWAGUCI +1305 ‘å‹{Žs OOMIYA,OMIYA +1306 s“cŽs GYODA +1307 ’•ƒŽs CICIBU +1308 Š‘òŽs TOKOROZAWA +1309 ”Ñ”\Žs HANNO +1310 ‰Á{Žs KAZO +1311 –{¯Žs HONJO +1312 “Œ¼ŽRŽs HIGASIMATUYAMA +1313 Šâ’ÎŽs IWATUKI +1314 t“ú•”Žs KASUKABE +1315 ‹·ŽRŽs SAYAMA +1316 ‰H¶Žs HANYU +1317 ƒ‘ƒŽs KOUNOSU +1318 [’JŽs FUKAYA +1319 ã”öŽs AGEO +1320 —^–ìŽs YONO +1321 ‘‰ÁŽs SOKA +1322 ‰z’JŽs KOSIGAYA +1323 ˜nŽs WARABI +1324 ŒË“cŽs TODA +1325 “üŠÔŽs IRUMA +1326 ”µƒ–’JŽs HATOGAYA +1327 ’©‰àŽs ASAKA +1328 Žu–ØŽs SIKI +1329 ˜aŒõŽs WAKOU +1330 VÀŽs NIIZA +1331 ‰±ìŽs OKEGAWA +1332 ‹vŠìŽs KUKI +1333 –k–{Žs KITAMOTO +1334 ”ª’ªŽs YASIO +1335 㕟‰ªŽs KAMIFUKUOKA +1336 •xŽmŒ©Žs FUJIMI +1337 ŽO‹½Žs MISATO +1338 ˜@“cŽs HASUDA +1339 âŒËŽs SAKADO +1340 KŽèŽs SATTE +1341 ’߃P“‡Žs TURUGASIMA +1342 “ú‚Žs HIDAKA +1343 ‹gìŽs@@@@@YOSIKAWA +13001 “üŠÔŒS IRUMA +13002 ‘å—¢ŒS OOSATO,OSATO +13003 –k‘«—§ŒS KITAADACI +13004 –kŠ‹üŒS KITAKATUSIKA +13005 –ké‹ÊŒS KITASAITAMA +13006 Ž™‹ÊŒS KODAMA +13007 ’•ƒŒS CICIBU +13008 ”äŠéŒS HIKI +13009 “ìé‹ÊŒS MINAMISAITAMA +14 % IBARAKI +1401 …ŒËŽs MITO +1402 “ú—§Žs HITACI +1403 “y‰YŽs TUCIURA +1404 ŒÃ‰ÍŽs KOGA +1405 ΉªŽs ISIOKA +1406 ‰ºŠÙŽs SIMODATE +1407 Œ‹éŽs YUKI +1408 —³ƒ–èŽs RYUGASAKI +1409 “߉ϖ©Žs* +1410 ‰ºÈŽs SIMOTUMA +1411 …ŠC“¹Žs MITUKAIDO +1412 í—¤‘¾“cŽs HITACIOOTA +1413 Ÿ“cŽs* +1414 ‚”‹Žs TAKAHAGI +1415 –kˆïéŽs KITAIBARAKI +1416 Š}ŠÔŽs KASAMA +1417 ŽæŽèŽs TORIDE +1418 ŠâˆäŽs IWAI +1419 ‹‹vŽs USIKU +1420 ‚‚­‚ÎŽs TUKUBA +1421 ‚Ђ½‚¿‚È‚©Žs HITACINAKA +1422 Ž­“ˆŽs@@@@@KASIMA +14001 ˆî•~ŒS INASIKI +14002 Ž­“‡ŒS KASIMA +14003 –k‘Š”nŒS KITASOMA +14004 ‹vŽœŒS KUJI +14005 ‰Ž“‡ŒS SASIMA +14006 ‘½‰êŒS TAGA +14007 ’}”gŒS TUKUBA +14008 “߉όS NAKA +14009 s•ûŒS NAMEGATA +14010 VŽ¡ŒS NIIHARI +14011 ¼ˆïéŒS NISIIBARAKI +14012 “ŒˆïéŒS HIGASIIBARAKI +14013 ^•ÇŒS MAKABE +14014 Œ‹éŒS YUKI +15 % TOCIGI +1501 ‰F“s‹{Žs UTUNOMIYA +1502 ‘«—˜Žs ASIKAGA +1503 “È–ØŽs TOCIGI +1504 ²–ìŽs SANO +1505 Ž­ÀŽs KANUMA +1506 “úŒõŽs NIKKO +1507 ¡ŽsŽs IMAICI +1508 ¬ŽRŽs OYAMA +1509 ^‰ªŽs MOOKA +1510 ‘å“cŒ´Žs OOTAWARA,OTAWARA +1511 –î”ÂŽs YAITA +1512 •ˆéŽs KUROISO +15001 ‘«—˜ŒS* +15002 ˆÀ‘hŒS ASO +15003 ã“s‰êŒS KAMITUGA +15004 ‰Í“àŒS KAWACI +15005 ‰–’JŒS SIOYA +15006 ‰º“s‰êŒS SIMOTUGA +15007 “ß{ŒS NASU +15008 –F‰êŒS HAGA +16 % GUNMA +1601 ‘O‹´Žs MAEBASI +1602 ‚èŽs TAKASAKI +1603 ‹Ë¶Žs KIRYU +1604 ˆÉ¨èŽs ISEZAKI +1605 ‘¾“cŽs OOTA,OTA +1606 À“cŽs NUMATA +1607 ŠÙ—ÑŽs TATEBAYASI +1608 aìŽs SIBUKAWA +1609 “¡‰ªŽs FUJIOKA +1610 •x‰ªŽs TOMIOKA +1611 ˆÀ’†Žs ANNAKA +16001 ŒáÈŒS AGATUMA +16002 ‰O•XŒS USUI +16003 —WŠyŒS OURA +16004 ŠÃŠyŒS KANRA +16005 –kŒQ”nŒS KITAGUNMA +16006 ŒQ”nŒS GUNMA +16007 ²”gŒS SAWA +16008 ¨‘½ŒS SETA +16009 ‘½–ìŒS TANO +16010 —˜ªŒS TONE +16011 V“cŒS NITTA +16012 ŽR“cŒS YAMADA +17 % YAMANASI +1701 b•{Žs KOUFU,KOFU +1702 •xŽm‹g“cŽs FUJIYOSIDA +1703 ‰–ŽRŽs ENZAN +1704 “s—¯Žs TURU +1705 ŽR—œŽs YAMANASI +1706 ‘匎Žs OOTUKI,OTUKI +1707 ”BèŽs NIRASAKI +17001 –k‹–€ŒS KITAKOMA +17002 –k“s—¯ŒS KITATURU +17003 ’†‹–€ŒS NAKAKOMA +17004 ¼”ª‘ãŒS NISIYATUSIRO +17005 “Œ”ª‘ãŒS HIGASIYATUSIRO +17006 “ŒŽR—œŒS HIGASIYAMANASI +17007 “ì‹–€ŒS MINAMIKOMA +17008 “ì“s—¯ŒS MINAMITURU +18 % SIZUOKA +1801 ɪŽs SIZUOKA +1802 •l¼Žs HAMAMATU +1803 À’ÃŽs NUMAZU +1804 ´…Žs SIMIZU +1805 ”MŠCŽs ATAMI +1806 ŽO“‡Žs MISIMA +1807 •xŽm‹{Žs FUJINOMIYA +1808 ˆÉ“ŒŽs ITOU +1809 “‡“cŽs SIMADA +1810 ‹gŒ´Žs* +1811 ”Ö“cŽs IWATA +1812 Ä’ÃŽs YAIZU +1813 •xŽmŽs FUJI +1814 Š|ìŽs KAKEGAWA +1815 “¡Ž}Žs FUJIEDA +1816 Œä“aêŽs GOTENBA +1817 ‘܈äŽs FUKUROI +1818 “V—³Žs TENRYU +1819 •l–kŽs HAMAKITA +1820 ‰º“cŽs SIMODA +1821 ž–ìŽs SUSONO +1822 ŒÎ¼Žs KOSAI +18001 ˆÀ”{ŒS* +18002 ˆø²ŒS INASA +18003 ˆÁŒ´ŒS IHARA +18004 ”Ö“cŒS IWATA +18005 ¬Š}ŒS OGASA +18006 ‰ê–ÎŒS KAMO +18007 Žu‘¾ŒS SIDA +18008 Žü’qŒS SYUCI +18009 x“ŒŒS SUNTOU +18010 “c•ûŒS TAGATA +18011 YŒ´ŒS HAIBARA +18012 •l–¼ŒS HAMANA +18013 •xŽmŒS FUJI +19 % GIFU +1901 Šò•ŒŽs GIFU +1902 ‘åŠ_Žs OOGAKI,OGAKI +1903 ‚ŽRŽs TAKAYAMA +1904 ‘½Ž¡Œ©Žs TAJIMI +1905 ŠÖŽs SEKI +1906 ’†’ÃìŽs NAKATUGAWA +1907 ”ü”ZŽs MINO +1908 ˜QŽs MIZUNAMI +1909 ‰H“‡Žs HASIMA +1910 Œb“ߎs ENA +1911 ”ü”Z‰Á–ÎŽs MINOKAMO +1912 “yŠòŽs TOKI +1913 Še–±Œ´Žs KAKAMIGAHARA +1914 ‰ÂŽ™Žs KANI +19001 ˆÀ”ªŒS ANPACI +19002 ˆî—tŒS* +19003 —K”ãŒS IBI +19004 Œb“ߌS ENA +19005 ‘å–ìŒS OONO,ONO +19006 ŠC’ÃŒS KAIZU +19007 ‰ÂŽ™ŒS KANI +19008 ‰Á–ÎŒS KAMO +19009 ŒSãŒS GUJO +19010 “yŠòŒS TOKI +19011 ‰H“‡ŒS HASIMA +19012 •s”jŒS FUWA +19013 ‰v“cŒS MASITA +19014 •‹VŒS MUGI +19015 –{‘ƒŒS MOTOSU +19016 ŽRŒ§ŒS YAMAGATA +19017 —{˜VŒS YORO +19018 ‹géŒS YOSIKI +20 % AICI +2001 –¼ŒÃ‰®Žs NAGOYA +2002 –L‹´Žs TOYOHASI +2003 ‰ªèŽs OKAZAKI +2004 ˆê‹{Žs ICINOMIYA +2005 £ŒËŽs SETO +2006 ”¼“cŽs HANDA +2007 t“úˆäŽs KASUGAI +2008 –LìŽs TOYOKAWA +2009 ’Ó‡Žs TUSIMA +2010 •É“ìŽs HEKINAN +2011 Š ’JŽs KARIYA +2012 –L“cŽs TOYODA +2013 ˆÀéŽs ANJO +2014 ¼”öŽs NISIO +2015 Š—ŒSŽs KAMAGORI +2016 Œ¢ŽRŽs INUYAMA +2017 튊Žs TOKONAME +2018 ŽçŽRŽs* +2019 ]“ìŽs KOUNAN +2020 ”ö¼Žs BISAI +2021 ¬–qŽs KOMAKI +2022 ˆî‘òŽs INAZAWA +2023 VéŽs SINSIRO +2024 “ŒŠCŽs TOUKAI,TOKAI +2025 ‘å•{Žs OOBU,OBU +2026 ’m‘½Žs CITA +2027 ‚•lŽs TAKAHAMA +2028 ’m—§Žs CIRYU +2029 ”ö’£ˆ®Žs OWARIASAHI +2030 Šâ‘qŽs IWAKURA +2031 –L–¾Žs TOYOAKE +2032 “úiŽs NISSIN +20001 ˆ¤’mŒS AICI +20002 ˆ­”üŒS ATUMI +20003 ŠC•”ŒS AMA +20004 –kÝŠyŒS KITASITARA +20005 ’m‘½ŒS CITA +20006 ’†“‡ŒS NAKASIMA +20007 ¼t“úˆäŒS NISIKASUGAI +20008 ¼‰Á–ÎŒS NISIKAMO +20009 ’O‰HŒS NIWA +20010 Šz“cŒS NUKATA +20011 —tŒIŒS HAGURI +20012 ”¦“¤ŒS HAZU +20013 “Œt“úˆäŒS* +20014 “Œ‰Á–ÎŒS HIGASIKAMO +20015 •ÉŠCŒS* +20016 •ó”ÑŒS HOI +20017 “ìÝŠyŒS MINAMISITARA +20018 ”ª–¼ŒS* +200101 –¼ŒÃ‰®ŽsçŽí‹æ CIKUSA +200102 –¼ŒÃ‰®Žs“Œ‹æ HIGASI +200103 –¼ŒÃ‰®Žs–k‹æ KITA +200104 –¼ŒÃ‰®Žs¼‹æ NISI +200105 –¼ŒÃ‰®Žs’†‘º‹æ NAKAMURA +200106 –¼ŒÃ‰®Žs’†‹æ NAKA +200107 –¼ŒÃ‰®Žsº˜a‹æ SYOUWA +200108 –¼ŒÃ‰®Žs•䋿 MIZUHO +200109 –¼ŒÃ‰®Žs”M“c‹æ ATUTA +200110 –¼ŒÃ‰®Žs’†ì‹æ NAKAGAWA +200111 –¼ŒÃ‰®Žs`‹æ MINATO +200112 –¼ŒÃ‰®Žs“ì‹æ MINAMI +200113 –¼ŒÃ‰®ŽsŽçŽR‹æ MORIYAMA +200114 –¼ŒÃ‰®Žs—΋æ MIDORI +200115 –¼ŒÃ‰®Žs–¼“Œ‹æ MEITOU +200116 –¼ŒÃ‰®Žs“V”’‹æ TENPAKU +21 % MIE +2101 ’ÃŽs TU +2102 Žl“úŽsŽs YOKKAICI +2103 ˆÉ¨Žs ISE +2104 ¼ãŽs MATUSAKA +2105 ŒK–¼Žs KUWANA +2106 ã–ìŽs UENO +2107 —鎭Žs SUZUKA +2108 –¼’£Žs NABARI +2109 ”ö˜hŽs OWASE +2110 ‹TŽRŽs KAMEYAMA +2111 ’¹‰HŽs TOBA +2112 ŒF–ìŽs KUMANO +2113 ‹v‹Žs HISAI +2114 ‰FŽ¡ŽR“cŽs* +21001 ˆÀŒ|ŒS AGE +21002 ˆÀ”ZŒS* +21003 ˆ¢ŽRŒS AYAMA +21004 ”Ñ“ìŒS IINAN +21005 ˆêŽuŒS ICISI +21006 ˆõ•ÙŒS INABE +21007 ‰ÍŒ|ŒS* +21008 –k–´˜KŒS KITAMURO +21009 ŒK–¼ŒS KUWANA +21010 Žu–€ŒS SIMA +21011 —鎭ŒS SUZUKA +21012 ‘½‹CŒS TAKI +21013 –¼‰êŒS NAGA +21014 ŽOdŒS MIE +21015 “ì–´˜KŒS MINAMIMURO +21016 “x‰ïŒS WATARAI +22 % KYOUTO,KYOTO +2201 ‹ž“sŽs KYOUTO,KYOTO +2202 •Ÿ’mŽRŽs FUKUCIYAMA +2203 •‘’ߎs MAIZURU +2204 ˆ»•”Žs AYABE +2205 ‰FŽ¡Žs UJI +2206 ‹{’ÃŽs MIYAZU +2207 ‹T‰ªŽs KAMEOKA +2208 é—zŽs JOYO +2209 ’·‰ª‹žŽs NAGAOKAKYO +2210 Œü“úŽs MUKOU +2211 ”ª”¦Žs YAWATA +2212 ‹ž“c•ÓŽs KYOTANABE +22001 “V“cŒS AMATA +22002 ‰½Ž­ŒS* +22003 ‰³ŒPŒS OTOKUNI +22004 ‰Á²ŒS KASA +22005 –kŒK“cŒS KITAKUWADA +22006 ‹v¢ŒS KUZE +22007 ŒF–ìŒS KUMANO +22008 ‘ŠŠyŒS SOURAKU,SORAKU +22009 ’|–ìŒS TAKENO +22010 ’ÔŠìŒS TUZUKI +22011 ’†ŒS NAKA +22012 ‘DˆäŒS FUNAI +22013 “ìŒK“cŒS* +22014 —^ŽÓŒS YOSA +220101 ‹ž“sŽs–k‹æ KITA +220102 ‹ž“sŽs㋞‹æ KAMIKYO +220103 ‹ž“sŽs¶‹ž‹æ SAKYO +220104 ‹ž“sŽs’†‹ž‹æ NAKAKYO +220105 ‹ž“sŽs“ŒŽR‹æ HIGASIYAMA +220106 ‹ž“sŽs‰º‹ž‹æ SIMOKYO +220107 ‹ž“sŽs“ì‹æ MINAMI +220108 ‹ž“sŽs‰E‹ž‹æ UKYO +220109 ‹ž“sŽs•šŒ©‹æ FUSIMI +220110 ‹ž“sŽsŽR‰È‹æ YAMASINA +220111 ‹ž“sŽs¼‹ž‹æ NISIKYO +23 % SIGA +2301 ‘å’ÃŽs OOTU,OTU +2302 •FªŽs HIKONE +2303 ’·•lŽs NAGAHAMA +2304 ‹ß]”ª”¦Žs OOMIHACIMAN,OMIHACIMAN +2305 ”ª“úŽsŽs YOKAICI +2306 ‘’ÃŽs KUSATU +2307 ŽçŽRŽs MORIYAMA +23001 ˆÉŒS IKA +23002 Œ¢ãŒS INUKAMI +23003 ˆ¤’mŒS ECI +23004 Š—¶ŒS GAMO +23005 _èŒS KANZAKI +23006 ŒI‘¾ŒS KURITA +23007 b‰êŒS KOUKA +23008 â“cŒS SAKATA +23009 Ž ‰êŒS SIGA +23010 ‚“‡ŒS TAKASIMA +23011 “ŒóˆäŒS HIGASIASAI +23012 –ìFŒS YASU +24 % NARA +2401 “Þ—ÇŽs NARA +2402 ‘å˜a‚“cŽs YAMATOTAKADA +2403 ‘å˜aŒSŽRŽs YAMATOKORIYAMA +2404 “V—Žs TENRI +2405 Š€Œ´Žs KASIHARA +2406 ÷ˆäŽs SAKURAI +2407 ŒÜžŠŽs GOJO +2408 ŒäŠŽs GOSE +2409 ¶‹îŽs IKOMA +2410 ŽÅŽs KASIBA +24001 ¶‹îŒS IKOMA +24002 ‰F‘ÉŒS UDA +24003 ‰F’qŒS* +24004 –kŠ‹éŒS KITAKATURAGI +24005 ˆééŒS SIKI +24006 “YãŒS SOEKAMI +24007 ‚ŽsŒS TAKAICI +24008 “슋éŒS* +24009 ŽR•ÓŒS YAMABE +24010 ‹g–ìŒS YOSINO +25 % OOSAKA,OSAKA +2501 ‘åãŽs OOSAKA,OSAKA +2502 äŽs SAKAI +2503 ŠÝ˜a“cŽs KISIWADA +2504 –L’†Žs TOYONAKA +2505 •zŽ{Žs* +2506 ’r“cŽs IKEDA +2507 “cŽs SUITA +2508 ò‘å’ÃŽs IZUMIOTU +2509 ‚’ÎŽs TAKATUKI +2510 ŠL’ËŽs KAIZUKA +2511 ŽçŒûŽs MORIGUCI +2512 –‡•ûŽs HIRAKATA +2513 ˆï–ØŽs IBARAKI +2514 ”ª”öŽs YAO +2515 ò²–ìŽs IZUMISANO +2516 •x“c—ÑŽs TONDABAYASI +2517 Q‰®ìŽs NEYAGAWA +2518 ‰Í“à’·–ìŽs KAWACINAGANO +2519 –‡‰ªŽs* +2520 ‰Í“àŽs* +2521 ¼Œ´Žs MATUBARA +2522 ‘哌Žs DAITOU +2523 ˜aòŽs IZUMI +2524 –¥–ÊŽs MINO +2525 ”Œ´Žs KASIWARA +2526 ‰H‰g–ìŽs HABIKINO +2527 –å^Žs KADOMA +2528 Û’ÃŽs SETTU +2529 “¡ˆäŽ›Žs FUJIIDERA +2530 ‚ÎŽs TAKAISI +2531 “Œ‘åãŽs HIGASIOSAKA +2532 ò“ìŽs SENNAN +2533 Žlð“ëŽs SIJONAWATE +2534 Œð–ìŽs KATANO +2535 ‘åã‹·ŽRŽs OOSAKASAYAMA,OSAKASAYAMA +2536 ã“ìŽs HANNAN +25001 –k‰Í“àŒS* +25002 ò“ìŒS SENNAN +25003 ò–kŒS SENBOKU +25004 –L”\ŒS TOYONO +25005 ’†‰Í“àŒS* +25006 ŽO“‡ŒS MISIMA +25007 “ì‰Í“àŒS MINAMIKAWACI +250101 ‘åãŽs–k‹æ KITA +250102 ‘åãŽs“s“‡‹æ MIYAKOJIMA +250103 ‘åãŽs•Ÿ“‡‹æ FUKUSIMA +250104 ‘åãŽsŸ‰Ô‹æ KONOHANA +250105 ‘åãŽs“Œ‹æ* +250106 ‘åãŽs¼‹æ NISI +250107 ‘åãŽs`‹æ MINATO +250108 ‘åãŽs‘峋æ TAISYO +250109 ‘åãŽs“V‰¤Ž›‹æ TENNOUJI,TENNOJI +250110 ‘åãŽs“ì‹æ* +250111 ‘åãŽs˜Q‘¬‹æ NANIWA +250112 ‘åãŽs‘å—„‹æ* +250113 ‘åãŽs¼—„ì‹æ NISIYODOGAWA +250114 ‘åãŽs“Œ—„ì‹æ HIGASIYODOGAWA +250115 ‘åãŽs“Œ¬‹æ HIGASINARI +250116 ‘åãŽs¶–ì‹æ IKUNO +250117 ‘åãŽsˆ®‹æ ASAHI +250118 ‘åãŽs铌‹æ JOTO +250119 ‘åãŽsˆ¢”{–ì‹æ ABENO +250120 ‘åãŽsZ‹g‹æ SUMIYOSI +250121 ‘åãŽs“ŒZ‹g‹æ HIGASISUMIYOSI +250122 ‘åãŽs¼¬‹æ NISINARI +250123 ‘åãŽs—„ì‹æ YODOGAWA +250124 ‘åãŽs’ߌ©‹æ TURUMI +250125 ‘åãŽsZ”V]‹æ SUMINOE +250126 ‘åãŽs•½–ì‹æ HIRANO +250127 ‘åãŽs’†‰›‹æ CYUO +26 % WAKAYAMA +2601 ˜a‰ÌŽRŽs WAKAYAMA +2602 V‹{Žs SINGU +2603 ŠC“ìŽs KAINAN +2604 “c•ÓŽs TANABE +2605 Œä–VŽs GOBO +2606 ‹´–{Žs HASIMOTO +2607 —L“cŽs ARIDA +26001 —L“cŒS ARIDA +26002 ˆÉ“sŒS ITO +26003 ŠC‘ŒS KAISO +26004 “߉êŒS NAGA +26005 ¼–´˜KŒS NISIMURO +26006 “Œ–´˜KŒS HIGASIMURO +26007 “ú‚ŒS HIDAKA +27 % HYOGO +2701 _ŒËŽs KOUBE,KOBE +2702 •P˜HŽs HIMEJI +2703 “òèŽs AMAGASAKI +2704 –¾ÎŽs AKASI +2705 ¼‹{Žs NISINOMIYA +2706 F–{Žs SUMOTO +2707 ˆ°‰®Žs ASIYA +2708 ˆÉ’OŽs ITAMI +2709 ‘жŽs AIOI +2710 –L‰ªŽs TOYOOKA +2711 ‰ÁŒÃìŽs KAKOGAWA +2712 —´–ìŽs TATUNO +2713 Ô•äŽs AKO +2714 ¼˜eŽs NISIWAKI +2715 •ó’ËŽs TAKARAZUKA +2716 ŽO–ØŽs MIKI +2717 ‚»Žs TAKASAGO +2718 켎s KAWANISI +2719 ¬–ìŽs ONO +2720 ŽO“cŽs SANDA +2721 ‰Á¼Žs KASAI +2722 ŽÂŽRŽs SASAYAMA +27001 Ô•äŒS AKO +27002 ’©—ˆŒS ASAGO +27003 —L”nŒS* +27004 oÎŒS IZUSI +27005 —K•ÛŒS IBO +27006 ˆó“ìŒS* +27007 ‰ÁŒÃŒS KAKO +27008 ‰Á¼ŒS* +27009 ‰Á“ŒŒS KATOU +27010 ì•ÓŒS KAWABE +27011 _èŒS KANZAKI +27012 éèŒS KINOSAKI +27013 ²—pŒS SAYO +27014 ü–ŒS SIKAMA +27015 ޳ˆ¾ŒS SISO +27016 ‘½‰ÂŒS TAKA +27017 ‘½‹IŒS* +27018 ’Ö¼ŒS TUNA +27019 •XãŒS HIKAMI +27020 ”ü•ûŒS MIKATA +27021 ”ü”XŒS MINO +27022 ŽOŒ´ŒS MIHARA +27023 •ŒÉŒS* +27024 —{•ƒŒS YABU +270101 _ŒËŽs“Œ“勿 HIGASINADA +270102 _ŒËŽs“勿 NADA +270103 _ŒËŽs•ºŒÉ‹æ HYOGO +270104 _ŒËŽs’·“c‹æ NAGATA +270105 _ŒËŽs{–‹æ SUMA +270106 _ŒËŽs‚…‹æ TARUMI +270107 _ŒËŽs–k‹æ KITA +270108 _ŒËŽs’†‰›‹æ CYUO +270109 _ŒËŽs¼‹æ NISI +28 % TOYAMA +2801 •xŽRŽs TOYAMA +2802 ‚‰ªŽs TAKAOKA +2803 V–©Žs SINMINATO +2804 ‹›’ÃŽs UOZU +2805 •XŒ©Žs HIMI +2806 ŠŠìŽs NAMERIKAWA +2807 ••”Žs KUROBE +2808 áè”gŽs TONAMI +2809 ¬–î•”Žs OYABE +28001 ŽË…ŒS IMIZU +28002 ãVìŒS KAMINIIKAWA +28003 ‰ºVìŒS SIMONIIKAWA +28004 ’†VìŒS NAKANIIKAWA +28005 ¼“v”gŒS NISITONAMI +28006 •w•‰ŒS NEI +28007 •XŒ©ŒS* +28008 “Œ“v”gŒS HIGASITONAMI +29 % FUKUI +2901 •ŸˆäŽs FUKUI +2902 “Ö‰êŽs TURUGA +2903 •¶Žs TAKEFU +2904 ¬•lŽs OBAMA +2905 ‘å–ìŽs OONO,ONO +2906 ŸŽRŽs KATUYAMA +2907 ŽI]Žs SABAE +29001 ‘«‰HŒS ASUWA +29002 ¡—§ŒS IMADATE +29003 ‘å”ÑŒS OOI,OI +29004 ‘å–ìŒS OONO,ONO +29005 ‰“•~ŒS ONYU +29006 âˆäŒS SAKAI +29007 “Ö‰êŒS* +29008 “ìðŒS NANJO +29009 ’O¶ŒS NYU +29010 ŽO•ûŒS MIKATA +29011 ‹g“cŒS YOSIDA +30 % ISIKAWA +3001 ‹à‘òŽs KANAZAWA +3002 ޵”öŽs NANAO +3003 ¬¼Žs KOMATU +3004 —Ö“‡Žs WAJIMA +3005 ŽìFŽs SUZU +3006 ‰Á‰êŽs KAGA +3007 ‰HîŽs HAKUI +3008 ¼”CŽs MATUTOU +30001 ÎìŒS ISIKAWA +30002 ]ÀŒS ENUMA +30003 Ž­“‡ŒS KASIMA +30004 ‰Í–kŒS KAHOKU +30005 ŽìFŒS SUZU +30006 ”\”üŒS NOMI +30007 ‰HîŒS HAKUI +30008 –PŽŠŒS FUGESI +31 % OKAYAMA +3101 ‰ªŽRŽs OKAYAMA +3102 ‘q•~Žs KURASIKI +3103 ’ÃŽRŽs TUYAMA +3104 ‹Ê–ìŽs TAMANO +3105 Ž™“‡Žs* +3106 ‹Ê“‡Žs* +3107 Š}‰ªŽs KASAOKA +3108 ¼‘厛Žs* +3109 ˆäŒ´Žs IBARA +3110 ‘ŽÐŽs SOJA +3111 ‚—ÀŽs TAKAHASI +3112 VŒ©Žs NIIMI +3113 ”õ‘OŽs BIZEN +31001 ‰p“cŒS AIDA +31002 Ô”ÖŒS AKAIWA +31003 óŒûŒS ASAKUCI +31004 ˆ¢“NŒS ATETU +31005 —W‹vŒS OKU +31006 ¬“cŒS ODA +31007 Ÿ“cŒS KATUTA +31008 ìãŒS KAWAKAMI +31009 ‹g”õŒS KIBI +31010 ‹v•ÄŒS KUME +31011 Ž™“‡ŒS KOJIMA +31012 ŒãŒŽŒS SITUKI +31013 㓹ŒS* +31014 ã–[ŒS JOBO +31015 “sŒEŒS TUKUBO +31016 “Ï“cŒS TOMATA +31017 ^’ëŒS MANIWA +31018 Œä’ÃŒS MITU +31019 ˜a‹CŒS WAKE +32 % SIMANE +3201 ¼]Žs MATUE +3202 •l“cŽs HAMADA +3203 o‰_Žs IZUMO +3204 ‰v“cŽs MASUDA +3205 ‘å“cŽs OODA,ODA +3206 ˆÀ—ˆŽs YASUGI +3207 ]’ÃŽs KOUZU +3208 •½“cŽs HIRATA +32001 ˆÀ”ZŒS* +32002 ŠCŽmŒS* +32003 ”ÑÎŒS IISI +32004 —W’qŒS OCI +32005 ‘匴ŒS OHARA +32006 ‰BŠòŒS OKI +32007 ‰¸’nŒS* +32008 Ž­‘«ŒS KANOASI +32009 Žü‹gŒS* +32010 ’m•vŒS* +32011 “߉êŒS NAKA +32012 m‘½ŒS NITA +32013 “ô–€ŒS NIMA +32014 ”\‹`ŒS NOGI +32015 ”ôìŒS HIKAWA +32016 ”ü”ZŒS MINO +32017 ”ª‘©ŒS YATUKA +33 % YAMAGUCI +3301 ŽRŒûŽs YAMAGUCI +3302 ‰ºŠÖŽs SIMONOSEKI +3303 ‰F•”Žs UBE +3304 ”‹Žs HAGI +3305 “¿ŽRŽs TOKUYAMA +3306 –h•{Žs BOFU +3307 ‰º¼Žs KUDAMATU +3308 Šâ‘Žs IWAKUNI +3309 ¬–ì“cŽs ONODA +3310 ŒõŽs HIKARI +3311 ’·–åŽs NAGATO +3312 –öˆäŽs YANAI +3313 ”ü”IŽs MINE +3314 V“ì—zŽs SINNANYOU +33001 Œú‹·ŒS ASA +33002 ˆ¢•ŒS ABU +33003 ‘哇ŒS OOSIMA,OSIMA +33004 ‘å’ÃŒS OOTU,OTU +33005 ‹è‰ÏŒS KUGA +33006 ŒF–ÑŒS KUMAGE +33007 ²”gŒS SABA +33008 “s”ZŒS TUNO +33009 –L‰YŒS TOYOURA +33010 ”ü”IŒS MINE +33011 ‹g•~ŒS YOSIKI +34 % TOTTORI +3401 ’¹ŽæŽs TOTTORI +3402 ‘q‹gŽs KURAYOSI +3403 •ÄŽqŽs YONAGO +3404 ‹«`Žs SAKAIMINATO +34001 Šâ”üŒS IWAMI +34002 ‹C‚ŒS KETAKA +34003 ¼”ŒŒS SAIHAKU +34004 “Œ”ŒŒS TOUHAKU +34005 “ú–ìŒS HINO +34006 ”ª“ªŒS YAZU +35 % HIROSIMA +3501 L“‡Žs HIROSIMA +3502 ŒàŽs KURE +3503 ’|Œ´Žs TAKEHARA +3504 ŽOŒ´Žs MIHARA +3505 ”ö“¹Žs ONOMICI +3506 ˆö“‡Žs INNOSIMA +3507 ¼‰iŽs* +3508 •ŸŽRŽs FUKUYAMA +3509 •{’†Žs FUCYU +3510 ŽOŽŸŽs MIYOSI +3511 ¯Œ´Žs SYOBARA +3512 ‘å’|Žs OOTAKE,OTAKE +3513 “ŒL“‡Žs HIGASIHIROSIMA +3514 “ù“úŽsŽs HATUKAICI +35001 ˆÀŒ|ŒS AKI +35002 ˆÀ²ŒS* +35003 ˆ°•iŒS ASINA +35004 ‰ê–ÎŒS KAMO +35005 b“zŒS KOUNU +35006 ²”ŒŒS SAEKI +35007 _ÎŒS JINSEKI +35008 ¢—…ŒS SERA +35009 ‚“cŒS TAKATA +35010 –L“cŒS TOYOTA +35011 ÀŒGŒS NUMAKUMA +35012 ”ä”kŒS HIBA +35013 [ˆÀŒS FUKAYASU +35014 ‘oŽOŒS FUTAMI +35015 Œä’²ŒS MITUGI +35016 ŽRŒ§ŒS YAMAGATA +350101 L“‡Žs’†‹æ NAKA +350102 L“‡Žs“Œ‹æ HIGASI +350103 L“‡Žs“ì‹æ MINAMI +350104 L“‡Žs¼‹æ NISI +350105 L“‡ŽsˆÀ²“ì‹æ ASAMINAMI +350106 L“‡ŽsˆÀ²–k‹æ ASAKITA +350107 L“‡ŽsˆÀŒ|‹æ AKI +350108 L“‡Žs²”Œ‹æ SAEKI +36 % KAGAWA +3601 ‚¼Žs TAKAMATU +3602 ŠÛ‹TŽs MARUGAME +3603 âoŽs SAKAIDE +3604 ‘P’ÊŽ›Žs ZENTUJI +3605 ŠÏ‰¹Ž›Žs KANONJI +36001 ˆ»‰ÌŒS AYAUTA +36002 ‘åìŒS OOKAWA,OKAWA +36003 ìŒS KAGAWA +36004 –Ø“cŒS KITA +36005 ¬“¤ŒS SYOZU +36006 ’‡‘½“xŒS NAKATADO +36007 ŽO–LŒS MITOYO +37 % TOKUSIMA +3701 “¿“‡Žs TOKUSIMA +3702 ––åŽs NARUTO +3703 ¬¼“‡Žs KOMATUSIMA +3704 ˆ¢“ìŽs ANAN +37001 ˆ¢”gŒS AWA +37002 ”–ìŒS ITANO +37003 –ƒAŒS OE +37004 ŠC•”ŒS KAIFU +37005 Ÿ‰YŒS KATUURA +37006 “߉êŒS NAKA +37007 –¼¼ŒS MYOZAI +37008 –¼“ŒŒS MYODO +37009 ”ü”nŒS MIMA +37010 ŽODŒS MIYOSI +38 % EHIME +3801 ¼ŽRŽs MATUYAMA +3802 ¡Ž¡Žs IMABARI +3803 ‰F˜a“‡Žs UWAJIMA +3804 ”ª”¦•lŽs YAWATAHAMA +3805 V‹•lŽs NIHAMA +3806 ¼ðŽs SAIJO +3807 ‘åFŽs OOZU,OZU +3808 ˆÉ—\ŽO“‡Žs IYOMISIMA +3809 ì”V]Žs KAWANOE +3810 ˆÉ—\Žs IYO +3811 –kðŽs HOJO +3812 “Œ—\Žs TOUYO +38001 ˆÉ—\ŒS IYO +38002 ‰F–€ŒS UMA +38003 ‰z’qŒS OCI +38004 ‰·òŒS ONSEN +38005 ã•‚ŒŠŒS KAMIUKENA +38006 Šì‘½ŒS KITA +38007 –k‰F˜aŒS KITAUWA +38008 ŽüŒKŒS SYUSO +38009 V‹ŒS* +38010 ¼‰F˜aŒS NISIUWA +38011 “Œ‰F˜aŒS HIGASIUWA +38012 “ì‰F˜aŒS MINAMIUWA +39 % KOUCI,KOCI +3901 ‚’mŽs KOUCI,KOCI +3902 ŽºŒËŽs MUROTO +3903 ˆÀŒ|Žs AKI +3904 “y²Žs TOSA +3905 {èŽs SUSAKI +3906 ’†‘ºŽs NAKAMURA +3907 h–ÑŽs SUKUMO +3908 “y²´…Žs TOSASIMIZU +3909 “쑎s NANGOKU +39001 ŒáìŒS AGAWA +39002 ˆÀŒ|ŒS AKI +39003 ”üŒS KAMI +39004 ‚‰ªŒS TAKAOKA +39005 “y²ŒS TOSA +39006 ’·‰ªŒS NAGAOKA +39007 ”¦‘½ŒS HATA +40 % FUKUOKA +4001 •Ÿ‰ªŽs FUKUOKA +4002 ¬‘qŽs* +4003 –åŽiŽs* +4004 ”ª”¦Žs* +4005 ŒË”¨Žs* +4006 Žá¼Žs* +4007 ‹v—¯•ÄŽs KURUME +4008 ‘å–´“cŽs OOMUTA,OMUTA +4009 ’¼•ûŽs NOOGATA,NOGATA +4010 ”Ñ’ËŽs IIZUKA +4011 “cìŽs TAGAWA +4012 –öìŽs YANAGAWA +4013 ŠÃ–ØŽs AMAGI +4014 ŽR“cŽs YAMADA +4015 ”ª—Žs YAME +4016 ’}ŒãŽs CIKUGO +4017 ‘åìŽs OOKAWA,OKAWA +4018 s‹´Žs YUKUHASI +4019 –L‘OŽs BUZEN +4020 ’†ŠÔŽs NAKAMA +4021 –k‹ãBŽs KITAKYUSYU +4022 ¬ŒSŽs OGOORI,OGORI +4023 t“úŽs KASUGA +4024 ’}އ–ìŽs CIKUSINO +4025 ‘å–ìéŽs OONOJO,ONOJO +4026 @‘œŽs MUNAKATA +4027 ‘¾É•{Žs DAZAIFU +4028 ‘OŒ´Žs MAEBARU +4029 ŒÃ‰êŽs@@@@@KOGA +40001 ’©‘qŒS ASAKURA +40002 Ž…“‡ŒS ITOSIMA +40003 •‚‰HŒS UKIHA +40004 ‰“‰êŒS ONGA +40005 ””‰®ŒS KASUYA +40006 ‰Ã•äŒS KAHO +40007 ˆÆŽèŒS TEKURA +40008 ‘—ÇŒS* +40009 “cìŒS TAGAWA +40010 ’}އŒS CIKUSI +40011 ’zãŒS CIKUJO +40012 ŽOˆäŒS MII +40013 ŽO’rŒS MIIKE +40014 ŽOàkŒS MIZUMA +40015 ‹ž“sŒS MIYAKO +40016 @‘œŒS MUNAKATA +40017 ŽR–åŒS YAMATO +40018 ”ª—ŒS YAME +400101 •Ÿ‰ªŽs“Œ‹æ HIGASI +400102 •Ÿ‰ªŽs”Ž‘½‹æ HAKATA +400103 •Ÿ‰ªŽs’†‰›‹æ CYUO +400104 •Ÿ‰ªŽs“ì‹æ MINAMI +400105 •Ÿ‰ªŽs¼‹æ NISI +400106 •Ÿ‰ªŽsé“ì‹æ JYOUNAN,JYONAN +400107 •Ÿ‰ªŽs‘—Ç‹æ SAWARA +402101 –k‹ãBŽs–åŽi‹æ MOJI +402102 –k‹ãBŽsŽá¼‹æ WAKAMATU +402103 –k‹ãBŽsŒË”¨‹æ TOBATA +402104 –k‹ãBŽs¬‘q–k‹æ KOKURAKITA +402105 –k‹ãBŽs¬‘q“ì‹æ KOKURAMINAMI +402106 –k‹ãBŽs”ª”¦“Œ‹æ YAHATAHIGASI +402107 –k‹ãBŽs”ª”¦¼‹æ YAHATANISI +41 % SAGA +4101 ²‰êŽs SAGA +4102 “‚’ÃŽs KARATU +4103 ’¹²Žs TOSU +4104 ‘½‹vŽs TAKU +4105 ˆÉ–œ—¢Žs IMARI +4106 •—YŽs TAKEO +4107 Ž­“‡Žs KASIMA +41001 ¬éŒS OGI +41002 _éŒS KANZAKI +41003 ‹n“‡ŒS KISIMA +41004 ²‰êŒS SAGA +41005 ¼¼‰YŒS NISIMATUURA +41006 “Œ¼‰YŒS HIGASIMATUURA +41007 “¡’ÃŒS FUJITU +41008 ŽO—{ŠîŒS MIYAKI +42 % NAGASAKI +4201 ’·èŽs NAGASAKI +4202 ²¢•ÛŽs SASEBO +4203 “‡Œ´Žs SIMABARA +4204 ŠÐ‘Žs ISAHAYA +4205 ‘呺Žs OOMURA,OMURA +4206 •Ÿ]Žs FUKUE +4207 •½ŒËŽs HIRADO +4208 ¼‰YŽs MATUURA +42001 ˆëŠòŒS IKI +42002 ㌧ŒS KAMIAGATA +42003 –k‚—ˆŒS KITATAKAKI +42004 –k¼‰YŒS KITAMATUURA +42005 ‰ºŒ§ŒS SIMOAGATA +42006 ¼”Þ‹nŒS NISISONOGI +42007 “Œ”Þ‹nŒS HIGASISONOGI +42008 “ì‚—ˆŒS MINAMITAKAKI +42009 “켉YŒS MINAMIMATUURA +43 % KUMAMOTO +4301 ŒF–{Žs KUMAMOTO +4302 ”ª‘ãŽs YATUSIRO +4303 l‹gŽs HITOYOSI +4304 r”öŽs ARAO +4305 …–“Žs MINAMATA +4306 ‹Ê–¼Žs TAMANA +4307 –{“nŽs HONDO +4308 ŽRŽ­Žs YAMAGA +4309 ‹[Žs USIBUKA +4310 ‹e’rŽs KIKUCI +4311 ‰F“yŽs UTO +43001 ˆ°–kŒS ASIKITA +43002 ˆ¢‘hŒS ASO +43003 “V‘ŒS AMAKUSA +43004 ‰F“yŒS UTO +43005 ã‰véŒS KAMIMASIKI +43006 Ž­–{ŒS KAMOTO +43007 ‹e’rŒS KIKUCI +43008 ‹…–ŒS KUMA +43009 ‰º‰véŒS SIMOMASIKI +43010 ‹Ê–¼ŒS TAMANA +43011 –O‘õŒS* +43012 ”ª‘ãŒS YATUSIRO +44 % OOITA,OITA +4401 ‘啪Žs OOITA,OITA +4402 •Ê•{Žs BEPPU +4403 ’†’ÃŽs NAKATU +4404 “ú“cŽs HITA +4405 ²”ŒŽs SAIKI +4406 ‰P‹nŽs USUKI +4407 ’ËvŒ©Žs TUKUMI +4408 ’|“cŽs TAKEDA +4409 ’ßèŽs* +4410 –LŒã‚“cŽs BUNGOTAKADA +4411 ‹n’zŽs KITUKI +4412 ‰F²Žs USA +44001 ‰F²ŒS USA +44002 ‘啪ŒS OOITA,OITA +44003 ‘å–ìŒS OONO,ONO +44004 –kŠC•”ŒS KITAAMABE +44005 ‹èŽìŒS KUSU +44006 ‰º–ÑŒS SIMOGE +44007 ’¼“üŒS NAOIRI +44008 ¼‘“ŒŒS NISIKUNISAKI +44009 ‘¬Œ©ŒS HAYAMI +44010 “Œ‘“ŒŒS HIGASIKUNISAKI +44011 “ú“cŒS HITA +44012 “ìŠC•”ŒS MINAMIAMABE +45 % MIYAZAKI +4501 ‹{èŽs MIYAZAKI +4502 “séŽs MIYAKONOJO +4503 ‰„‰ªŽs NOBEOKA +4504 “ú“ìŽs NICINAN +4505 ¬—ÑŽs KOBAYASI +4506 “úŒüŽs HYUGA +4507 ‹øŠÔŽs KUSIMA +4508 ¼“sŽs SAITO +4509 ‚¦‚т̎s EBINO +45001 –k”Œ§ŒS KITAMOROKATA +45002 Ž™“’ŒS KOYU +45003 ¼‰P‹nŒS NISIUSUKI +45004 ¼”Œ§ŒS NISIMOROKATA +45005 “Œ‰P‹nŒS HIGASIUSUKI +45006 “Œ”Œ§ŒS HIGASIMOROKATA +45007 “ì“߉όS MINAMINAKA +45008 ‹{èŒS MIYAZAKI +46 % KAGOSIMA +4601 Ž­Ž™“‡Žs KAGOSIMA +4602 ì“àŽs SENDAI +4603 Ž­‰®Žs KANOYA +4604 –èŽs MAKURAZAKI +4605 ‹ø–Ø–ìŽs KUSIKINO +4606 ˆ¢‹vªŽs AKUNE +4607 o…Žs IZUMI +4608 –¼£Žs NAZE +4609 ‘åŒûŽs OOKUCI,OKUCI +4610 ŽwhŽs IBUSUKI +4611 ‰Á¢“cŽs KASEDA +4612 ‘•ªŽs KOKUBU +4613 ’JŽRŽs* +4614 ¼”V•\Žs NISINOOMOTE +4615 ‚…Žs TARUMIZU +46001 ˆ¦—ÇŒS AIRA +46002 ˆÉ²ŒS ISA +46003 o…ŒS IZUMI +46004 —KhŒS IBUSUKI +46005 ‘哇ŒS OOSIMA,OSIMA +46006 Ž­Ž™“‡ŒS KAGOSIMA +46007 ì•ÓŒS KAWANABE +46008 ŠÌ‘®ŒS KIMOTUKI +46009 ŒF–ÑŒS KUMAGE +46010 ŽF–€ŒS SATUMA +46011 ‘]‰—ŒS SOO +46012 “ú’uŒS HIOKI +47 % OKINAWA +4701 “ß”eŽs NAHA +4702 ÎìŽs ISIKAWA +4703 •½—ÇŽs HIRARA +4704 Ί_Žs ISIGAKI +4705 ƒRƒUŽs* +4706 ‹X–ì˜pŽs GINOWAN +4707 ‹ïŽuìŽs GUSIKAWA +4708 –¼ŒìŽs NAGO +4709 ‰Y“YŽs URASOE +4710 Ž…–žŽs ITOMAN +4711 ‰«“êŽs OKINAWA +47001 ‘“ªŒS KUNIGAMI +47002 “‡KŒS SIMAJIRI +47003 ’†“ªŒS NAKAGAMI +47004 ‹{ŒÃŒS MIYAKO +47005 ”ªdŽRŒS YAEYAMA + \ No newline at end of file diff --git a/MMlink.cpp b/MMlink.cpp new file mode 100644 index 0000000..aaec5e7 --- /dev/null +++ b/MMlink.cpp @@ -0,0 +1,408 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "MMLink.h" +//--------------------------------------------------------------------------- +__fastcall CMMList::CMMList(void) +{ + m_pList = NULL; +} +//--------------------------------------------------------------------------- +__fastcall CMMList::~CMMList() +{ + delete m_pList; +} +//--------------------------------------------------------------------------- +int __fastcall CMMList::QueryList(LPCSTR pFilter) +{ + if( m_pList == NULL ) m_pList = new TStringList; + m_pList->Clear(); + m_FilterLen = strlen(pFilter); + + HANDLE hFind; + WIN32_FIND_DATA fd; + + char Name[MAX_PATH]; + sprintf(Name, "%s*.%s", BgnDir, pFilter); + hFind = ::FindFirstFile(Name, &fd); + if( hFind != INVALID_HANDLE_VALUE ){ + while(1){ + m_pList->Add(fd.cFileName); + if( !FindNextFile(hFind, &fd) ) break; + } + ::FindClose(hFind); + } + return m_pList->Count; +} +//--------------------------------------------------------------------------- +LPCSTR __fastcall CMMList::GetItemName(int n) +{ + if( n < 0 ) return NULL; + if( n >= m_pList->Count ) return NULL; + + m_Name = m_pList->Strings[n].c_str(); + LPSTR p = lastp(m_Name.c_str()); + p -= m_FilterLen; + *p = 0; + return m_Name.c_str(); +} +//--------------------------------------------------------------------------- +LPCSTR __fastcall CMMList::GetFileName(int n) +{ + if( n < 0 ) return NULL; + if( n >= m_pList->Count ) return NULL; + + m_Name = m_pList->Strings[n]; + return m_Name.c_str(); +} +//--------------------------------------------------------------------------- +int __fastcall CMMList::IndexOf(LPCSTR pKey) +{ + for( int i = 0; i < m_pList->Count; i++ ){ + if( !strcmpi(GetItemName(i), pKey) ) return i; + } + return -1; +} +//*************************************************************************** +// CMMLink class +//--------------------------------------------------------------------------- +__fastcall CMMLink::CMMLink(HWND hWnd, UINT uMsg) +{ + m_hLib = NULL; + m_hWnd = hWnd; + m_uMsg = uMsg; + m_Caps = 0; +} +//--------------------------------------------------------------------------- +__fastcall CMMLink::~CMMLink() +{ + Close(); +} +//--------------------------------------------------------------------------- +void __fastcall CMMLink::FreeLib(void) +{ + if( m_hLib ){ + FreeLibrary(m_hLib); + m_hLib = NULL; + } +} +//--------------------------------------------------------------------------- +FARPROC __fastcall CMMLink::GetProc(LPCSTR pName) +{ + if( !m_hLib ) return NULL; + + FARPROC fn = ::GetProcAddress(m_hLib, pName+1); + if( fn == NULL ){ + fn = ::GetProcAddress(m_hLib, pName); + if( fn == NULL ) FreeLib(); + } + return fn; +} +//--------------------------------------------------------------------------- +void __fastcall CMMLink::Close(void) +{ + if( IsLib() ){ + fmmlClose(); + FreeLib(); + } + m_Connected = FALSE; +} +//--------------------------------------------------------------------------- +BOOL __fastcall CMMLink::Open(LPCSTR pItemName) +{ + Close(); + + m_ItemName = pItemName; + m_SessionName = m_ItemName; + char LibName[MAX_PATH]; + if( !*GetEXT(pItemName) ){ + sprintf(LibName, "%s.mml", pItemName); + pItemName = LibName; + } + + m_hLib = ::LoadLibrary(pItemName); + if( m_hLib ){ + + fmmlOpen = (tmmlOpen)GetProc("_mmlOpen"); + fmmlClose = (tmmlClose)GetProc("_mmlClose"); + fmmlSetHandle = (tmmlSetHandle)GetProc("_mmlSetHandle"); + fmmlIsCap = (tmmlIsCap)GetProc("_mmlIsCap"); + fmmlIsConnected = (tmmlIsConnected)GetProc("_mmlIsConnected"); + fmmlGetSessionName = (tmmlGetSessionName)GetProc("_mmlGetSessionName"); + fmmlQuery = (tmmlQuery)GetProc("_mmlQuery"); + fmmlSetFreq = (tmmlSetFreq)GetProc("_mmlSetFreq"); + fmmlLog = (tmmlLog)GetProc("_mmlLog"); + fmmlLogClear = (tmmlLogClear)GetProc("_mmlLogClear"); + fmmlSetPTT = (tmmlSetPTT)GetProc("_mmlSetPTT"); + fmmlOnCopyData = (tmmlOnCopyData)GetProc("_mmlOnCopyData"); + fmmlEventVFO = (tmmlEventVFO)GetProc("_mmlEventVFO"); + + if( m_hLib ){ + if( fmmlOpen(m_hWnd, m_uMsg) ){ + m_Caps = fmmlIsCap(); + } + else { + FreeLib(); + } + } + } + return IsLib(); +} +//--------------------------------------------------------------------------- +void __fastcall CMMLink::SetHandle(HWND hWnd, UINT uMsg) +{ + m_hWnd = hWnd; + m_uMsg = uMsg; + if( !IsLib() ) return; + fmmlSetHandle(hWnd, m_uMsg); +} +//--------------------------------------------------------------------------- +void __fastcall CMMLink::NotifySession(LPCSTR pSession) +{ + if( pSession ){ + m_Connected = TRUE; + m_SessionName = pSession; + } + else { + m_Connected = FALSE; + } +} +//--------------------------------------------------------------------------- +BOOL __fastcall CMMLink::IsConnected(void) +{ + if( !IsLib() ) return FALSE; + if( m_Caps & capNOTIFYSESSION ) return m_Connected; + return fmmlIsConnected(); +} +//--------------------------------------------------------------------------- +LPCSTR __fastcall CMMLink::GetSessionName(void) +{ + if( !IsLib() ) return NULL; + if( m_Caps & capNOTIFYSESSION ) return m_SessionName.c_str(); + return fmmlGetSessionName(); +} +//--------------------------------------------------------------------------- +void __fastcall CMMLink::Query(LPCSTR pCall) +{ + if( !IsLib() ) return; + fmmlQuery(pCall); +} +//--------------------------------------------------------------------------- +void __fastcall CMMLink::SetFreq(LPCSTR pFreq) +{ + if( !IsLib() ) return; + fmmlSetFreq(pFreq); +} +//--------------------------------------------------------------------------- +void __fastcall CMMLink::SetPTT(int ptt) +{ + if( !IsLib() ) return; + fmmlSetPTT(ptt); +} +//--------------------------------------------------------------------------- +void __fastcall CMMLink::LogWrite(SDMMLOG *sp, int sw) +{ + if( !IsLib() ) return; + mmLOGDATA ml; + ConvFormat(&ml, sp); + fmmlLog(&ml, sw); +} +//--------------------------------------------------------------------------- +void __fastcall CMMLink::Clear(void) +{ + if( !IsLib() ) return; + fmmlLogClear(); +} +//--------------------------------------------------------------------------- +void __fastcall CMMLink::EventVFO(void) +{ + if( !IsLib() ) return; + fmmlEventVFO(); +} +//--------------------------------------------------------------------------- +LONG __fastcall CMMLink::OnCopyData(HWND hSender, const COPYDATASTRUCT *pcds) +{ + if( !IsLib() ) return FALSE; + if( !(m_Caps & capWMCOPYDATA) ) return FALSE; + return fmmlOnCopyData(hSender, pcds); +} +//--------------------------------------------------------------------------- +void __fastcall CMMLink::SetTime(SYSTEMTIME *tp, int sw) +{ + if( sw ){ + m_TimeLogOFF = *tp; + } + else { + m_TimeLogON = *tp; + } +} +//--------------------------------------------------------------------------- +void __fastcall CMMLink::ConvFormat(mmLOGDATA *pLog, const SDMMLOG *sp) +{ + memset(pLog, 0, sizeof(mmLOGDATA)); + + if( sp->btime ) pLog->m_TimeLogON = m_TimeLogON; + if( sp->etime ) pLog->m_TimeLogOFF = m_TimeLogOFF; + StrCopy(pLog->m_Call, sp->call, sizeof(pLog->m_Call)- 1); + strcpy(pLog->m_Mode, Log.GetModeString(sp->mode)); + strcpy(pLog->m_Freq, Log.GetFreqString(sp->band, sp->fq)); + memcpy(pLog->m_His, sp->ur, sizeof(pLog->m_His)); + memcpy(pLog->m_My, sp->my, sizeof(pLog->m_My)); + StrCopy(pLog->m_Name, sp->name, sizeof(pLog->m_Name)- 1); + StrCopy(pLog->m_QTH, sp->qth, sizeof(pLog->m_QTH)- 1); + StrCopy(pLog->m_Pow, sp->pow, sizeof(pLog->m_Pow)- 1); + StrCopy(pLog->m_Note, sp->rem, sizeof(pLog->m_Note)- 1); + StrCopy(pLog->m_QSL, sp->qsl, sizeof(pLog->m_QSL)- 1); + StrCopy(pLog->m_DXCC, sp->opt1, sizeof(pLog->m_DXCC)- 1); + StrCopy(pLog->m_Cont, sp->opt2, sizeof(pLog->m_Cont)- 1); + pLog->m_QSLS = sp->send; + pLog->m_QSLR = sp->recv; +} + + +//*************************************************************************** +// CMMRadio class +//--------------------------------------------------------------------------- +__fastcall CMMRadio::CMMRadio(HWND hWnd, UINT uMsg) +{ + m_hLib = NULL; + m_hWnd = hWnd; + m_uMsg = uMsg; +} +//--------------------------------------------------------------------------- +__fastcall CMMRadio::~CMMRadio() +{ + Close(); +} +//--------------------------------------------------------------------------- +void __fastcall CMMRadio::FreeLib(void) +{ + if( m_hLib ){ + FreeLibrary(m_hLib); + m_hLib = NULL; + } +} +//--------------------------------------------------------------------------- +FARPROC __fastcall CMMRadio::GetProc(LPCSTR pName) +{ + if( !m_hLib ) return NULL; + + FARPROC fn = ::GetProcAddress(m_hLib, pName+1); + if( fn == NULL ){ + fn = ::GetProcAddress(m_hLib, pName); + if( fn == NULL ) FreeLib(); + } + return fn; +} +//--------------------------------------------------------------------------- +void __fastcall CMMRadio::Close(void) +{ + if( IsLib() ){ + fmmrpClose(); + FreeLib(); + } +} +//--------------------------------------------------------------------------- +BOOL __fastcall CMMRadio::Open(LPCSTR pItemName) +{ + Close(); + + m_ItemName = pItemName; + char LibName[MAX_PATH]; + if( !*GetEXT(pItemName) ){ + sprintf(LibName, "%s.mmr", pItemName); + pItemName = LibName; + } + m_hLib = ::LoadLibrary(pItemName); + if( m_hLib ){ + + fmmrpOpen = PROC(mmrpOpen); + fmmrpClose = PROC(mmrpClose); + fmmrpSetHandle = PROC(mmrpSetHandle); + fmmrpGetStatus = PROC(mmrpGetStatus); + fmmrpSetPTT = PROC(mmrpSetPTT); + fmmrpPutChar = PROC(mmrpPutChar); + fmmrpGetChar = PROC(mmrpGetChar); + fmmrpPolling = PROC(mmrpPolling); + fmmrpGetFreq = PROC(mmrpGetFreq); + fmmrpGetDefCommand = PROC(mmrpGetDefCommand); + + if( m_hLib ){ + if( !fmmrpOpen(m_hWnd, m_uMsg) ){ + FreeLib(); + } + } + } + return IsLib(); +} +//--------------------------------------------------------------------------- +void __fastcall CMMRadio::SetHandle(HWND hWnd, UINT uMsg) +{ + m_hWnd = hWnd; + m_uMsg = uMsg; + if( !IsLib() ) return; + fmmrpSetHandle(hWnd, uMsg); +} +//--------------------------------------------------------------------------- +void __fastcall CMMRadio::SetPTT(int ptt) +{ + if( !IsLib() ) return; + fmmrpSetPTT(ptt); +} +//--------------------------------------------------------------------------- +void __fastcall CMMRadio::PutChar(BYTE c) +{ + if( !IsLib() ) return; + fmmrpPutChar(c); +} +//--------------------------------------------------------------------------- +BYTE __fastcall CMMRadio::GetChar(void) +{ + if( !IsLib() ) return 0; + return fmmrpGetChar(); +} +//--------------------------------------------------------------------------- +DWORD __fastcall CMMRadio::GetStatus(void) +{ + if( !IsLib() ) return 0; + return fmmrpGetStatus(); +} +//--------------------------------------------------------------------------- +void __fastcall CMMRadio::Polling(void) +{ + if( !IsLib() ) return; + fmmrpPolling(); +} +//--------------------------------------------------------------------------- +DWORD __fastcall CMMRadio::GetFreq(void) +{ + if( !IsLib() ) return 0; + return fmmrpGetFreq(); +} +//--------------------------------------------------------------------------- +DWORD __fastcall CMMRadio::GetDefCommand(void) +{ + if( !IsLib() ) return 0; + return fmmrpGetDefCommand(); +} + diff --git a/MMlink.h b/MMlink.h new file mode 100644 index 0000000..fd2755e --- /dev/null +++ b/MMlink.h @@ -0,0 +1,154 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + + +#ifndef MMLinkH +#define MMLinkH + +#include "ComLib.h" +#include "LogConv.h" +#include "mml.h" +#include "mmrp.h" + +#define PROC(Key) ((t##Key)GetProc("_" #Key)) + +class CMMList +{ +private: + TStringList *m_pList; + AnsiString m_Name; + int m_FilterLen; +public: + __fastcall CMMList(void); + __fastcall ~CMMList(); +public: // List functions + int __fastcall QueryList(LPCSTR pFilter); + int __fastcall GetCount(void){return m_pList->Count;}; + LPCSTR __fastcall GetItemName(int n); + LPCSTR __fastcall GetFileName(int n); + int __fastcall IndexOf(LPCSTR pKey); + inline BOOL __fastcall IsQuery(void){return m_pList != NULL;}; +}; + +class CMMLink +{ +private: + AnsiString m_ItemName; + + HWND m_hWnd; + UINT m_uMsg; + + //HANDLE m_hLib; + HINSTANCE m_hLib; //ja7ude 0522 + DWORD m_Caps; + + int m_Connected; + AnsiString m_SessionName; + + SYSTEMTIME m_TimeLogON; + SYSTEMTIME m_TimeLogOFF; +private: + tmmlOpen fmmlOpen; + tmmlClose fmmlClose; + tmmlSetHandle fmmlSetHandle; + tmmlIsCap fmmlIsCap; + tmmlIsConnected fmmlIsConnected; + tmmlGetSessionName fmmlGetSessionName; + tmmlQuery fmmlQuery; + tmmlSetFreq fmmlSetFreq; + tmmlLog fmmlLog; + tmmlLogClear fmmlLogClear; + tmmlSetPTT fmmlSetPTT; + tmmlOnCopyData fmmlOnCopyData; + tmmlEventVFO fmmlEventVFO; +private: + void __fastcall FreeLib(void); + FARPROC __fastcall GetProc(LPCSTR pName); + void __fastcall ConvFormat(mmLOGDATA *pLog, const SDMMLOG *sp); +public: + __fastcall CMMLink(HWND hWnd, UINT uMsg); + __fastcall ~CMMLink(); +public: // LogLink functions + BOOL __fastcall Open(LPCSTR pLibName); + void __fastcall Close(void); + void __fastcall SetHandle(HWND hWnd, UINT uMsg); + inline BOOL __fastcall IsLib(void){ return (m_hLib != NULL);}; + inline LPCSTR __fastcall GetItemName(void){return m_ItemName.c_str();}; + + void __fastcall NotifySession(LPCSTR pSession); + + BOOL __fastcall IsConnected(void); + LPCSTR __fastcall GetSessionName(void); + void __fastcall Query(LPCSTR pCall); + void __fastcall SetFreq(LPCSTR pFreq); + void __fastcall SetPTT(int ptt); + void __fastcall LogWrite(SDMMLOG *sp, int sw); + void __fastcall Clear(void); + void __fastcall EventVFO(void); + LONG __fastcall OnCopyData(HWND hSender, const COPYDATASTRUCT *pcds); + inline DWORD __fastcall GetCaps(void){return m_Caps;}; + void __fastcall SetTime(SYSTEMTIME *tp, int sw); + +}; + + +class CMMRadio +{ +private: + AnsiString m_ItemName; + + //HANDLE m_hLib; //ja7ude 0522 + HINSTANCE m_hLib; + HWND m_hWnd; + UINT m_uMsg; + +private: + tmmrpSetHandle fmmrpSetHandle; + tmmrpOpen fmmrpOpen; + tmmrpClose fmmrpClose; + tmmrpGetStatus fmmrpGetStatus; + tmmrpSetPTT fmmrpSetPTT; + tmmrpPutChar fmmrpPutChar; + tmmrpGetChar fmmrpGetChar; + tmmrpPolling fmmrpPolling; + tmmrpGetFreq fmmrpGetFreq; + tmmrpGetDefCommand fmmrpGetDefCommand; + +private: + void __fastcall FreeLib(void); + FARPROC __fastcall GetProc(LPCSTR pName); +public: + __fastcall CMMRadio(HWND hWnd, UINT uMsg); + __fastcall ~CMMRadio(); +public: + void __fastcall SetHandle(HWND hWnd, UINT uMsg); + BOOL __fastcall Open(LPCSTR pLibName); + void __fastcall Close(void); + inline BOOL __fastcall IsLib(void){ return (m_hLib != NULL);}; + inline LPCSTR __fastcall GetItemName(void){return m_ItemName.c_str();}; + + void __fastcall SetPTT(int ptt); + void __fastcall PutChar(BYTE c); + BYTE __fastcall GetChar(void); + DWORD __fastcall GetStatus(void); + void __fastcall Polling(void); + DWORD __fastcall GetFreq(void); + DWORD __fastcall GetDefCommand(void); +}; +#endif diff --git a/MacroKey.cpp b/MacroKey.cpp new file mode 100644 index 0000000..3a7c357 --- /dev/null +++ b/MacroKey.cpp @@ -0,0 +1,193 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "MacroKey.h" +//--------------------------------------------------------------------- +#pragma resource "*.dfm" +//TMacroKeyDlg *MacroKeyDlg; +MACKEY mackeycom[]={ + {1, "_","ƒ}[ƒNM†‚Ì‘—M","Transmit a mark signal"}, + {1, "~","AFSKƒLƒƒƒŠƒA’âŽ~","Stop AFSK carrier"}, + {1, "[","Diddle‚̋֎~","Disable diddle"}, + {1, "]","Diddle‚Ì‹–‰Â","Enable diddle"}, + {1, "%m","My callsign", NULL}, + {1, "%c","His/her callsign", NULL}, + {1, "%r","His/her RST", NULL}, + {1, "%n","His/her name", NULL}, + {1, "%q","His/her QTH", NULL}, + {1, "%s","My RST", NULL}, + {1, "%R","His/her RST‚ÌRST•”•ª‚Ì‚Ý","Only the RST part of his/her RST"}, + {1, "%N","His/her RST‚̃Rƒ“ƒeƒXƒgƒiƒ“ƒo•”•ª‚Ì‚Ý","Only the contest number part of his/her RST"}, + {1, "%M","My RST‚̃Rƒ“ƒeƒXƒgƒiƒ“ƒo•”•ª‚Ì‚Ý","Only the contest number part of my RST"}, + {1, "%g","GOOD MORNING/AFTERNOON/EVENING", NULL}, + {1, "%f","GM/GA/GE", NULL}, + {1, "%L","LTRƒR[ƒh‚Ì‹­§‘—M","Force transmit LTR code"}, + {1, "%F","FIGƒR[ƒh‚Ì‹­§‘—M","Force transmit FIG code"}, + {1, "%D","UTC date (e.g., 2000-SEP-05)", NULL}, + {1, "%T","UTC time (e.g., 12:34)", NULL}, + {1, "%t","UTC time (e.g., 1234)", NULL}, + {1, "%x","Only the 1st number(001) for BARTG", NULL}, + {1, "%y","Only the 2nd number(UTC) for BARTG", NULL}, + {1, "%{","CWID (e.g., %{DE %m})", NULL}, + {-1, "","", ""}, + {0, NULL, NULL}, +}; +MACKEY mackeybtn[]={ + {3, "\\","擪‚É‹Lq‚µ‚ÄTxWindowŒo—R‚Å‘—M","Sends via the TX window (at the top)"}, + {2, "\\","––”ö‚É‹Lq‚µ‚ÄŽóM‚ÉØ‚è‚©‚¦‚é","Switches to receive (at the last)"}, + {3, "#","擪‚É‹Lq‚µ‚ÄTxWindow‚É‘S•¶‚ðƒRƒs[","Copies the message to the TX window (at the top)"}, + {2, "#","––”ö‚É‹Lq‚µ‚ÄŒJ‚è•Ô‚µ","Repeats the macro (at the last)"}, + {0, NULL, NULL}, +}; +MACKEY mackeymsg[]={ + {3, "\\","擪‚É‹Lq‚µ‚ÄTxWindow‚ðƒNƒŠƒA","Clears the TX window (at the top)"}, + {2, "\\","––”ö‚É‹Lq‚µ‚ÄŽóM‚ÉØ‚è‚©‚¦‚é","Switches to receive (at the last)"}, + {3, "#","擪‚É‹Lq‚µ‚Ä‘—M‚ÉØ‚è‚©‚¦‚é","Switches to transmit (at the top)"}, + {1, "^","–ñ‚P•bŠÔ‚Ì’âŽ~","Wait for 1 second"}, + {0, NULL, NULL}, +}; +MACKEY mackeyusr[]={ + {2, "\\","––”ö‚É‹Lq‚µ‚ÄŽóM‚ÉØ‚è‚©‚¦‚é","Switches to receive (at the last)"}, + {0, NULL, NULL}, +}; +static int PosPos; //JA7UDE 0428 +static int TopPos; +//--------------------------------------------------------------------- +__fastcall TMacroKeyDlg::TMacroKeyDlg(TComponent* AOwner) + : TForm(AOwner) +{ + FormStyle = ((TForm *)AOwner)->FormStyle; + Font->Name = ((TForm *)AOwner)->Font->Name; + Font->Charset = ((TForm *)AOwner)->Font->Charset; + if( Font->Charset != SHIFTJIS_CHARSET ){ + CancelBtn->Caption = "Cancel"; + } +} +//--------------------------------------------------------------------- +void __fastcall TMacroKeyDlg::UpdateUI(int row) +{ + int r = row - 1; + if( r >= 0 ){ + r = mackey[r].r; + if( r == -1 ){ + OKBtn->Caption = (Font->Charset != SHIFTJIS_CHARSET) ? "Execute" : "ŽÀs"; + } + else { + OKBtn->Caption = (Font->Charset != SHIFTJIS_CHARSET) ? "Insert" : "‘}“ü"; + } + OKBtn->Enabled = TRUE; + } + else { + OKBtn->Caption = (Font->Charset != SHIFTJIS_CHARSET) ? "Insert" : "‘}“ü"; + OKBtn->Enabled = FALSE; + } +} +//--------------------------------------------------------------------- +int __fastcall TMacroKeyDlg::AddMacKey(MACKEY *mp, int n) +{ + for( ; mp->r; mp++, n++ ){ + mackey[n] = *mp; + } + return n; +} +//--------------------------------------------------------------------- +int __fastcall TMacroKeyDlg::Execute(AnsiString &as, int sw) +{ + int n = 0; + switch(sw){ + case 0: + n = AddMacKey(mackeymsg, n); + break; + case 1: + n = AddMacKey(mackeybtn, n); + break; + case 2: + n = AddMacKey(mackeyusr, n); + break; + } + n = AddMacKey(mackeycom, n); + Grid->RowCount = 1 + n; + if( (PosPos > 0) && (PosPos < Grid->RowCount) ){ + Grid->Row = PosPos; + Grid->TopRow = TopPos; + } + UpdateUI(Grid->Row); + int r = ShowModal(); + PosPos = Grid->Row; + TopPos = Grid->TopRow; + if( r == IDOK ){ + if( PosPos ){ + r = PosPos - 1; + as = mackey[r].pKey; + return mackey[r].r; + } + } + return 0; +} +//--------------------------------------------------------------------- +void __fastcall TMacroKeyDlg::GridDrawCell(TObject *Sender, int Col, int Row, + TRect &Rect, TGridDrawState State) +{ + char bf[256]; + + Grid->Canvas->FillRect(Rect); + int X = Rect.Left + 4; + int Y = Rect.Top + 2; + + if( Row ){ + Row--; + bf[0] = 0; + LPCSTR pCom; + switch(Col){ + case 0: + strcpy(bf, mackey[Row].pKey); + break; + case 1: + if( Font->Charset != SHIFTJIS_CHARSET ){ + pCom = mackey[Row].pEng; + if( pCom == NULL ){ + pCom = mackey[Row].pJpn; + } + } + else { + pCom = mackey[Row].pJpn; + } + strcpy(bf, pCom); + break; + } + Grid->Canvas->TextOut(X, Y, bf); + } + else { // ƒ^ƒCƒgƒ‹ + LPCSTR _tt[]={ + "Key","Comments", + }; + Grid->Canvas->TextOut(X, Y, _tt[Col]); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMacroKeyDlg::GridSelectCell(TObject *Sender, int Col, + int Row, bool &CanSelect) +{ + UpdateUI(Row); +} +//--------------------------------------------------------------------------- diff --git a/MacroKey.dfm b/MacroKey.dfm new file mode 100644 index 0000000..d00cb24 Binary files /dev/null and b/MacroKey.dfm differ diff --git a/MacroKey.h b/MacroKey.h new file mode 100644 index 0000000..f90f95f --- /dev/null +++ b/MacroKey.h @@ -0,0 +1,71 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//---------------------------------------------------------------------------- +#ifndef MacroKeyH +#define MacroKeyH +//---------------------------------------------------------------------------- +/* JA7UDE 0428 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +*/ +#include +#include +#include +#include +//---------------------------------------------------------------------------- +typedef struct { + int r; + LPCSTR pKey; + LPCSTR pJpn; + LPCSTR pEng; +}MACKEY; + +class TMacroKeyDlg : public TForm +{ +__published: + TButton *OKBtn; + TButton *CancelBtn; + TStringGrid *Grid; + void __fastcall GridDrawCell(TObject *Sender, int Col, int Row, TRect &Rect, + TGridDrawState State); + void __fastcall GridSelectCell(TObject *Sender, int Col, int Row, + bool &CanSelect); +private: + MACKEY mackey[32]; + int __fastcall AddMacKey(MACKEY *mp, int n); + void __fastcall UpdateUI(int row); + +public: + virtual __fastcall TMacroKeyDlg(TComponent* AOwner); + + int __fastcall Execute(AnsiString &as, int sw); +}; +//---------------------------------------------------------------------------- +//extern TMacroKeyDlg *MacroKeyDlg; +//---------------------------------------------------------------------------- +#endif diff --git a/Main.cpp b/Main.cpp new file mode 100644 index 0000000..1e87491 --- /dev/null +++ b/Main.cpp @@ -0,0 +1,9893 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba, Dave Bernstein +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +#include "clipbrd.hpp" +#include + +#include "MMSYSTEM.H" +#include "Main.h" +#include "Scope.h" +#include "Option.h" +#include "EditDlg.h" +#include "TextEdit.h" +#include "LogList.h" +#include "LogLink.h" +#include "QsoDlg.h" +#include "Country.h" +#include "Mmcg.h" +#include "VerDsp.h" +#include "LogConv.h" +#include "PlayDlg.h" +#include "ShortCut.h" +#include "LogSet.h" +#include "SetHelp.h" +#include "TncSet.h" +#include "InputWin.h" + +//--------------------------------------------------------------------------- +#pragma resource "*.dfm" +TMmttyWd *MmttyWd; +UINT MSG_MMTTY; +HWND APP_HANDLE; +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::OnMSG(tagMSG &Msg, bool &Handled) +{ +/* +Msg.hwnd := Handle; +Msg.message := WM_KEYDOWN; +Msg.wParam := Message.WParam; +Msg.lParam := Message.LParam;*/ + if( Msg.message != MSG_MMTTY ) return; + + RemoteMMTTY(Msg); + Handled = true; +} +//ƒEƒCƒ“ƒhƒEƒƒbƒZ[ƒW‚̃nƒ“ƒhƒ‰--------------------------------------------- +void __fastcall TMmttyWd::WndProc(TMessage &Message) +{ + switch(Message.Msg){ + case WM_COPYDATA: + WndCopyData(Message); + break; + case CM_CTNC: + OnTncEvent(Message); + break; + default: + TForm::WndProc(Message); + break; + } +} +//--------------------------------------------------------------------------- +// WM_COPYDATA‚̈— +void __fastcall TMmttyWd::WndCopyData(TMessage &Message) +{ + COPYDATASTRUCT *cp = (COPYDATASTRUCT *)Message.LParam; + if( LogLink.IsCopyData() ){ + Message.Result = LogLink.m_pLink->OnCopyData(HWND(Message.WParam), cp); + return; + } + switch(cp->dwData){ + case 0: + case 1: // Hamlog‚©‚ç‚Ì•ÔM + if( sys.m_LogLink != 1 ) return; + switch(LogLink.AnaData(&Log.m_sd, cp)){ + case 115: + UpdateTextData(); + break; + case 106: + Freq->Text = Log.GetFreqString(Log.m_sd.band, Log.m_sd.fq); + break; + } + Message.Result = TRUE; + break; + case 0x80001212: // Žü”g”ƒf[ƒ^‚ÌŽw’è + if( cp->cbData && (cp->lpData != NULL) ){ + char bf[16]; + int len = cp->cbData; + if( len > 15 ) len = 15; + memcpy(bf, cp->lpData, len); + bf[len] = 0; + Freq->Text = bf; + } + Message.Result = TRUE; + break; + default: + Message.Result = FALSE; + break; + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::OnActivate(TObject *Sender) +{ + if( m_OptionDialog ) return; + if( Remote & REMDISFOCUS ) return; + if( APP_HANDLE != HWND_BROADCAST ) ::SetForegroundWindow(APP_HANDLE); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::OnRestore(TObject *Sender) +{ + if( m_OptionDialog ) return; + if( Remote & REMSHOWOFF ){ + if( APP_HANDLE != HWND_BROADCAST ){ + if( !(Remote & REMDISFOCUS) ) ::SetForegroundWindow(APP_HANDLE); + Hide(); + } + } +} +//--------------------------------------------------------------------------- +__fastcall TMmttyWd::TMmttyWd(TComponent* Owner) + : TForm(Owner) +{ + ::VirtualLock(this, sizeof(TMmttyWd)); + ::VirtualLock(&sys, sizeof(sys)); + + pSound = NULL; + pAndyMenu = NULL; + pTnc = NULL; + pRadio = NULL; + pComm = NULL; + p_SendFileDlg = NULL; + hMap = NULL; + pMap = NULL; + MSG_MMTTY=0; + APP_HANDLE = HWND_BROADCAST; + + lcid = GetThreadLocale() & 0x00ff; + if( lcid != LANG_JAPANESE ){ + sys.m_WinFontName = "Times New Roman"; + sys.m_WinFontCharset = ANSI_CHARSET; + sys.m_BtnFontName = "Courier New"; + sys.m_BtnFontCharset = ANSI_CHARSET; + sys.m_FontName = "Courier New"; + sys.m_FontCharset = ANSI_CHARSET; + Log.m_LogSet.m_TimeZone = 'Z'; + sys.m_TimeStampUTC = 1; + sys.m_HTMLHelp = "KB2EOQ.htm"; + KENT->Checked = FALSE; + sys.m_LWait = 2; + sys.m_LogLink = 0; + } + else { + sys.m_WinFontName = "‚l‚r ‚oƒSƒVƒbƒN"; + sys.m_WinFontCharset = SHIFTJIS_CHARSET; + sys.m_BtnFontName = "‚l‚r ƒSƒVƒbƒN"; + sys.m_BtnFontCharset = SHIFTJIS_CHARSET; + sys.m_FontName = "‚l‚r ƒSƒVƒbƒN"; + sys.m_FontCharset = SHIFTJIS_CHARSET; + sys.m_TimeStampUTC = 0; + sys.m_HTMLHelp = ""; + KENT->Checked = TRUE; + sys.m_LWait = 0; + sys.m_LogLink = 1; + } + sys.m_WinFontStyle = 0; + sys.m_BtnFontStyle = 0; + sys.m_Help = "Mmtty.txt"; + sys.m_HelpLog = "Mmttylog.txt"; + sys.m_HelpDigital = "Digital.txt"; + sys.m_HelpFontName = "‚l‚r ƒSƒVƒbƒN"; + sys.m_HelpFontCharset = SHIFTJIS_CHARSET; + sys.m_HelpFontSize = 10; + sys.m_HelpNotePad = 0; + + DWORD dwVersion = ::GetVersion(); + if( dwVersion < 0x80000000 ){ + + //AA6YQ 1.66G distinguish Vista from XP + + OSVERSIONINFO osvi; + + ZeroMemory(&osvi, sizeof(OSVERSIONINFO)); + osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + + GetVersionEx(&osvi); + if (osvi.dwMajorVersion == 5) { + WinNT = TRUE; + WinVista=FALSE; + } + else { + WinNT = FALSE; + WinVista=TRUE; + } + } + else { + WinNT = FALSE; + WinVista=FALSE; + } + + EntryAlignControl(); + InitCOMMPara(); + InitTNCPara(); + InitRADIOPara(); + sys.m_DefFix45 = TRUE; + m_BARTGTimer = 0; + m_XYSize = 0; + m_XYQuality = 0; + m_PanelSize = 2; + m_DemType = -1; + m_LpfType = -1; + m_InitFirst = TRUE; + DisPaint = TRUE; + m_MacroStat = 0; + m_Macro = 0; + m_filemode = -1; + m_PaletteQuery = 0; + m_ReqRecv = 0; + m_NameQTH = 0; + m_Ctrl = 0; + m_ReqPaletteChange = 0; + m_FifoOutTimer = 0; + m_Dupe = 0; + m_Running = 0; + m_SendWay = 0; + m_DisAlign = 0; + m_BefHeight = ClientHeight; + m_Baud = m_ShowBaud = 0; + m_RemoteTimer = 0; + m_RemoteDelay = 0; + m_OptionDialog = 0; + m_hOptionWnd = NULL; + m_MacTimer = 0; + m_FIGTimer = 0; + Remote = 0; + m_pRemOpenName = NULL; + m_PttTimerCount = 0; + m_PttTimer = 60; + + InitRemoteStat(); + + m_RxMarkFreq = 2125.0; + m_RxSpaceFreq = 2125.0+170.0; + + StartOption(); + + pBitmapFFTIN = new Graphics::TBitmap(); + pBitmapFFTIN->Width = PBoxFFTIN->Width; + pBitmapFFTIN->Height = PBoxFFTIN->Height; + + pBitmapWater = new Graphics::TBitmap(); + pBitmapWater->Width = PBoxWater->Width; + pBitmapWater->Height = PBoxWater->Height; + + pBitmapXY = new Graphics::TBitmap(); + pBitmapXY->Width = PBoxXY->Width; + pBitmapXY->Height = PBoxXY->Height; + + pBitmapSQ = new Graphics::TBitmap(); + pBitmapSQ->Width = PBoxSQ->Width; + pBitmapSQ->Height = PBoxSQ->Height; + + pBitmapRx = NULL; + pBitmapIn = NULL; + + sys.m_DisTX = 0; + sys.m_DisWindow = 0; + sys.m_StayOnTop = 0; + sys.m_WindowState = wsNormal; + int i; + char bf[256]; + for( i = 0; i < 16; i++ ){ + sprintf(bf, "M%u", i+1); + sys.m_UserName[i] = bf; + sys.m_User[i] = ""; + sys.m_UserKey[i] = 0; + sys.m_UserEditKey[i] = 0; + sys.m_UserCol[i] = clBlack; + sys.m_UserTimer[i] = 0; + } + sys.m_User[0] = "__\r\n%c DE %m %m K\r\n_\\"; + sys.m_UserName[0] = "1X2"; + sys.m_User[1] = "__\r\n%c %c DE %m %m %m K\r\n_\\"; + sys.m_UserName[1] = "2X3"; + sys.m_User[2] = "__\r\nDE %m %m %m K\r\n_\\"; + sys.m_UserName[2] = "DE3"; + sys.m_User[3] = "__\r\nQSL UR 599-599 TU\r\n_\\"; + sys.m_UserName[3] = "UR599"; + sys.m_User[4] = "__\r\nOK TNX %n\r\nUR %r %r NAME MAKO %c DE %m TU SK\r\n_\\"; + sys.m_UserName[4] = "QANS"; + sys.m_User[8] = "\\\r\n73 TU SK SK\r\n%{TU}\\"; + sys.m_UserName[8] = "SK"; + sys.m_User[9] = "[__~~__~\\"; + sys.m_UserName[9] = "EE"; + sys.m_User[12] = "\r\nRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRY#"; + sys.m_UserName[12] = "RY"; + sys.m_User[14] = "__\r\nRYRY CQ CQ CQ DE %m %m %m\r\nRYRY CQ CQ CQ DE %m %m %m PSE K\r\n_\\"; + sys.m_UserName[14] = "CQ2"; + sys.m_User[15] = "__\r\nRYRY CQ CQ CQ DE %m %m %m PSE K\r\n_\\"; + sys.m_UserName[15] = "CQ1"; + + sys.m_UserKey[0] = '1'+0x100; + sys.m_UserKey[1] = '2'+0x100; + sys.m_UserKey[2] = '3'+0x100; + sys.m_UserKey[3] = '4'+0x100; + sys.m_UserKey[4] = '5'+0x100; + sys.m_UserKey[5] = '6'+0x100; + sys.m_UserKey[6] = '7'+0x100; + sys.m_UserKey[7] = '8'+0x100; + sys.m_UserKey[8] = '9'+0x100; + sys.m_UserKey[9] = VK_F10; + sys.m_UserKey[10] = VK_F11; + sys.m_UserKey[11] = VK_F12; + sys.m_UserKey[14] = VK_F7; + sys.m_UserKey[15] = VK_F6; + + sys.m_MsgList[0] = "\\__\r\nRGR %c DE %m %g DEAR %n\r\nTHANK YOU FOR THE NICE REPORT.\r\nYOU ARE %r %r %r IN OSAKA OSAKA OSAKA\r\nMY NAME IS MAKO MAKO MAKO\r\nHOW COPY? BTU %c DE %m KN\r\n_\\"; + sys.m_MsgList[1] = "\\__\\"; + sys.m_MsgList[2] = "\\__\r\nTNX AGAIN DEAR %n CU SK\r\n__\\"; + sys.m_MsgList[3] = "\\__\r\nOK DEAR %n\r\nMANY THANK YOU FOR THE NICE QSO.\r\nI AM LOOKING FORWARD TO SEE YOU AGAIN ON CW AND PSK31.\r\nCUL! AND BEST 73\r\n%c DE %m TU SK SK..\r\n__"; + sys.m_MsgList[4] = "\\__\r\nRGR %c DE %m ALL OK DEAR %n\r\nTHANK YOU FOR THE NICE REPORT.\r\n\r\nI AM RUNNING 50W 50W INTO A SMALL LOOP ANTENNA(ONLY 90CM DIA!)\r\n\r\nRTTY MODEM IS HOMEMADE SOFTWARE ON WINDOWS-95 SOUNDBLASTER.\r\n\r\nTHANK YOU FOR THE NICE QSO DEAR %n\r\nMY QSL IS OK VIA THE BURO.\r\n\r\nHOW? BTU %c DE %m KN\r\n_\\"; + sys.m_MsgList[5] = "\\__\r\n%c %c DE %m %g\r\nTHANK YOU FOR YOUR CALL. I AM GLAD TO SEE YOU ON RTTY.\r\nYOU ARE %r %r %r IN OSAKA OSAKA OSAKA\r\nMY NAME IS MAKO MAKO MAKO\r\nHOW COPY? BTU %c %c DE %m KN\r\n_\\"; + sys.m_MsgList[6] = "\\__\r\nRGR %c DE %m ALL OK DEAR %n\r\nTHANK YOU FOR THE NICE INFO.\r\n\r\nI AM RUNNING 50W 50W INTO A SMALL LOOP ANTENNA(ONLY 90CM DIA!)\r\n\r\nRTTY MODEM IS HOMEMADE SOFTWARE ON WINDOWS-95 SOUNDBLASTER.\r\n\r\nTHANK YOU FOR THE NICE QSO DEAR %n\r\nMY QSL IS OK VIA THE BURO.\r\n\r\nHOW? BTU %c DE %m KN\r\n_\\"; + sys.m_MsgList[7] = "\\__\r\nRGR TNX %n\r\nUR %r %r %r NAME IS MAKO MAKO MAKO\r\nHOW? BTU %c DE %m KN\r\n_\\"; + sys.m_MsgList[8] = "\\__\r\nOK DEAR %n\r\nTNX FB QSO, CUL BEST 73 %c DE %m TU SK..\r\n__\\"; + + sys.m_MsgName[0] = "AF CALL1"; + sys.m_MsgName[1] = "FINAL3"; + sys.m_MsgName[2] = "FINAL2"; + sys.m_MsgName[3] = "FINAL"; + sys.m_MsgName[4] = "AF CQ2 (GEAR)"; + sys.m_MsgName[5] = "AF CQ1"; + sys.m_MsgName[6] = "AF CALL2 (GEAR)"; + sys.m_MsgName[7] = "AF CALL1 (QUICK)"; + sys.m_MsgName[8] = "FINAL (QUICK)"; + + sys.m_MsgKey[0] = VK_F1 + 0x100; + sys.m_MsgKey[1] = VK_F2 + 0x100; + sys.m_MsgKey[2] = VK_F3 + 0x100; + sys.m_MsgKey[3] = VK_F4 + 0x100; + sys.m_MsgKey[4] = VK_F5 + 0x100; + sys.m_MsgKey[5] = VK_F6 + 0x100; + sys.m_MsgKey[6] = VK_F7 + 0x100; + sys.m_MsgKey[7] = VK_F8 + 0x100; + sys.m_MsgKey[8] = VK_F9 + 0x100; + + sys.m_InBtn[0] = "%c DE %m"; + sys.m_InBtnName[0] = "1X1"; + sys.m_InBtn[1] = "DEAR %n"; + sys.m_InBtnName[1] = "DEAR"; + sys.m_InBtn[2] = "\__\r\nRGR %c DE %m ALL OK DEAR %n\r\n"; + sys.m_InBtnName[2] = "ANS"; + sys.m_InBtn[3] = "BTU %c DE %m KN\r\n_\\"; + sys.m_InBtnName[3] = "BTU"; + sys.m_InBtnKey[0] = VK_F2; + sys.m_InBtnKey[1] = VK_F3; + sys.m_InBtnKey[2] = VK_F4; + sys.m_InBtnKey[3] = VK_F5; + sys.m_InBtnCol[0] = clBlack; + sys.m_InBtnCol[1] = clBlack; + sys.m_InBtnCol[2] = clBlack; + sys.m_InBtnCol[3] = clBlack; + + sys.m_MacroImm = 0; + + sys.m_ExtCmd[0] = ""; + sys.m_ExtCmd[1] = ""; + sys.m_ExtCmd[2] = ""; + sys.m_ExtCmd[3] = ""; + + KExtCmd1->Caption = "G3PLX PSK31SBW"; + KExtCmd2->Caption = "IZ8BLY Hellschreiber"; + + sys.m_FontAdjSize = 0; + sys.m_BtnFontAdjSize = 0; + + memset(sys.m_SysKey, 0, sizeof(sys.m_SysKey)); + sys.m_SysKey[kkPlayPos] = 'A' + 0x100; + sys.m_SysKey[kkScope] = 'O' + 0x100; + sys.m_SysKey[kkLogList] = 'L' + 0x100; + sys.m_SysKey[kkQSOData] = 'D' + 0x100; + + sys.m_SysKey[kkTX] = VK_F9; + sys.m_SysKey[kkTXOFF] = VK_F8; + sys.m_SysKey[kkCall] = 'C' + 0x100; + sys.m_SysKey[kkName] = 'N' + 0x100; + sys.m_SysKey[kkQTH] = 'Q' + 0x100; + sys.m_SysKey[kkRST] = 'R' + 0x100; + sys.m_SysKey[kkFreq] = 'B' + 0x100; + sys.m_SysKey[kkFind] = 'F' + 0x100; + sys.m_SysKey[kkClear] = VK_F1; + + sys.m_SysKey[kkInHome] = VK_HOME; + sys.m_SysKey[kkInEnd] = VK_END; + + sys.m_SysKey[kkRxPUp] = VK_PRIOR; + sys.m_SysKey[kkRxPDown] = VK_NEXT; + + sys.m_SysKey[kkInHeightUp]= VK_UP | 0x100; + sys.m_SysKey[kkInHeightDown] = VK_DOWN | 0x100; + + sys.m_SysKey[kkPanel] = 'C' + 0x200; + sys.m_SysKey[kkTxLTR] = 'L' + 0x200; + + sys.m_SysKey[kkDecShift] = VK_LEFT + 0x200; + sys.m_SysKey[kkIncShift] = VK_RIGHT + 0x200; + sys.m_SysKey[kkToggleShift] = 'T' + 0x200; + + sys.m_SysKey[kkCList] = 'F' + 0x200; + + sys.m_Call = "NOCALL"; + sys.m_TxRxName = "NONE"; + sys.m_TxRxInv = 0; + + sys.m_TxNet = 1; + sys.m_Rev = 0; + sys.m_TxDisRev = 0; + sys.m_TxPort = txSound; + sys.m_TxdJob = 0; + sys.m_TxFixShift = 0; + sys.m_echo = 1; + + sys.m_FFTGain = 1; + sys.m_FFTResp = 2; + + sys.m_ColorRXBack = clWhite; + sys.m_ColorRX = clBlack; + sys.m_ColorRXTX = clRed; + sys.m_ColorINBack = clWhite; + sys.m_ColorIN = clBlack; + sys.m_ColorINTX = clRed; + + sys.m_ColorLow = clBlack; + sys.m_ColorHigh = clWhite; + + sys.m_ColorXY = clWhite; + + sys.m_SoundFifoRX = 12; + sys.m_SoundFifoTX = 4; + sys.m_SoundDevice = -1; + sys.m_SoundOutDevice=-1; //AA6YQ 1.66 + sys.m_SoundPriority = 1; + sys.m_SoundStereo = 0; + + sys.m_txuos = 1; + sys.m_dblsft = 0; + + sys.m_AFC = 1; + sys.m_FixShift = 1; + sys.m_AFCTime = 8.0; + sys.m_AFCSweep = 1.0; + sys.m_AFCSQ = 32; + + sys.m_LimitGain = 200.0; + + sys.m_DefMarkFreq = 2125.0; + sys.m_DefShift = 170.0; + sys.m_DefStopLen = 0; + + sys.m_log = 0; + sys.m_LogName = ""; + sys.m_logTimeStamp = 1; + sys.m_ShowTimeStamp = 1; + +// sys.m_FontName = "‚l‚r ƒSƒVƒbƒN"; +// sys.m_FontCharset = SHIFTJIS_CHARSET; + sys.m_FontAdjX = 0; + sys.m_FontAdjY = 0; + sys.m_FontSize = 10; + sys.m_FontZero = 1; + sys.m_FontStyle = 0; + + sys.m_FontAdjSize = 0; + + sys.d_PaletteMask = 0x00000000; + sys.m_Palette = 0; + + sys.m_XYInv = 0; + + sys.m_SBFontSize = SBM1->Font->Size; + sys.m_SBINFontSize = SBIN1->Font->Size; + KHint->Checked = TRUE; + + sys.m_CharLenFile = 1024; + + sys.m_AutoTimeOffset = 0; + sys.m_TimeOffset = 0; + sys.m_TimeOffsetMin = 0; +// Panel2->Top = GroupBox1->Height + 1; // ŽóM‰æ–ʃTƒCƒY‚Ì’²® + UpdatePanel(); + LogLink.SetHandle(Handle, CM_CMML); + + ReadSampFreq(); + pSound = new TSound(TRUE); + WriteProfile(1025, "Default", TRUE); // ƒfƒtƒHƒ‹ƒgƒpƒ‰ƒ[ƒ^‚Ì‹L‰¯ + ReadRegister(); + WriteProfile(1026, "Return to the startup", TRUE); // ƒfƒtƒHƒ‹ƒgƒpƒ‰ƒ[ƒ^‚Ì‹L‰¯ + sprintf(bf, "%s"HELPNAME_A, BgnDir); + if( (sys.m_HTMLHelp == HELPNAME_A)||(sys.m_HTMLHelp == HELPNAME_B) ){ + sys.m_HTMLHelp = ""; + } + if( IsFile(bf) ){ + sys.m_HTMLHelp = HELPNAME_A; + JanHelp = bf; + } + else { + sprintf(bf, "%s"HELPNAME_B, BgnDir); + if( IsFile(bf) ){ + sys.m_HTMLHelp = HELPNAME_B; + JanHelp = bf; + } + } +#if 0 + if( !strcmpi(GetEXT(sys.m_HTMLHelp.c_str()), "HLP") || !strcmpi(GetEXT(sys.m_HTMLHelp.c_str()), "CHM") ){ + sprintf(bf, "%s%s", BgnDir, sys.m_HTMLHelp.c_str()); + if( (fp = fopen(bf, "rb"))!=NULL ){ + fclose(fp); + JanHelp = bf; + } + } +#endif +#if 0 + sprintf(bf, "%sReadme.txt", BgnDir); + fp = fopen(bf, "rb"); + if( fp != NULL ){ + fclose(fp); + } + else { + KMHelp->Remove(KRM); + } +#endif + + if( sys.m_AutoTimeOffset ) SetTimeOffsetInfo(sys.m_TimeOffset, sys.m_TimeOffsetMin); + AddHelpMenu(); + UpdateSystemFont(); + + InitColorTable(sys.m_ColorLow, sys.m_ColorHigh); + PrintText.SetPaintBox(PBoxRx, ScrollBarRx); + FifoEdit.SetPaintBox(PBoxIn, ScrollBarIn); + PrintText.SetCursor(1); + rtty.SetCodeSet(); rttysub.SetCodeSet(); + + if( sys.m_log ){ + PrintText.MakeLogName(); + PrintText.OpenLogFile(); + if( sys.m_logTimeStamp ) PrintText.TrigTimeStamp("MMTTY Startup"); + } + m_DisEvent = 1; + if( !Remote ){ + UpdateMsgList(); + UpdateItem(); + UpdateMacro(); + UpdateMacroShow(0); + UpdateUI(); + UpdateLMS(); + UpdateRecentMenu(); + UpdateRev(); + UpdateShortCut(TRUE); + UpdateStayOnTop(); + UpdateLWait(); + } + if( !Remote ){ + if( int(WindowState) != sys.m_WindowState ) WindowState = TWindowState(sys.m_WindowState); + } + Application->OnIdle = OnIdle; + if( Remote ){ + sys.m_DisTX = 0; + UpdateRemort(); + UpdateItem(); + UpdateUI(); + UpdateLMS(); + UpdateStayOnTop(); + if( Remote & REMSHOWOFF ){ + Application->ShowMainForm = FALSE; + FormPaint(NULL); + } + else if( Remote & REMNOMOVE ){ + Application->ShowMainForm = FALSE; + FormPaint(NULL); + } + } + ReadProfileList(); +} + +__fastcall TMmttyWd::~TMmttyWd() +{ + if( hMap != NULL ){ + if( pMap != NULL ){ + ::UnmapViewOfFile(pMap); + } + ::CloseHandle(hMap); + hMap = NULL; + } + pMap = NULL; +} + +void __fastcall TMmttyWd::StartOption(void) +{ + AnsiString as = ParamStr(0).c_str(); + SetDirName(BgnDir, as.c_str()); + m_strCommonMemory = "MMTTY"; + m_cRemoteTimeout = 100; + + for( int i = 0; i <= ParamCount(); i++ ){ + as = ParamStr(i).c_str(); + LPCSTR p = as.c_str(); + if( as == "-r" ){ + Remote = 0x80000000|REMMENU|REMCTRL; + ClientWidth = 640; + ClientHeight = 180; + } + else if( as == "-u" ){ + Remote = 0x80000000|REMCTRL; + ClientWidth = 640; + ClientHeight = 150; + } + else if( as == "-s" ){ + Remote = 0x80000000|REMMENU; + ClientWidth = 300; + ClientHeight = 180; + } + else if( as == "-t" ){ + Remote = 0x80000000; + ClientWidth = 300; + ClientHeight = 150; + } + else if( as == "-f" ){ + BorderStyle = bsSingle; + } + else if( as == "-m" ){ + Remote = 0x80000000 | REMSHOWOFF; + } + else if( as == "-d" ){ + if( Remote ){ + BorderStyle = bsNone; + Remote |= REMNOMOVE; + } + } + else if( as == "-p" ){ + if( Remote ){ + Remote |= REMNOPTT; + } + } + else if( as == "-n" ){ + if( Remote ){ + Remote |= REMNOCNV; + } + } + else if( as == "-a" ){ + if( Remote ) Remote |= REMDISSTAYONTOP; + } + else if( !strncmp(p, "-h", 2) ){ + p += 2; + APP_HANDLE = (HWND)htoin(p, -1); + if( !APP_HANDLE ){ + APP_HANDLE = HWND_BROADCAST; + } + } + else if( !strncmp(p, "-C", 2) ){ + p += 2; + if( *p ){ + m_strCommonMemory = p; + } + } + else if( !strncmp(p, "-T", 2) ){ + p += 2; + if( *p ){ + m_cRemoteTimeout = atoin(p, -1) * 10; + } + } + } + strcpy(LogDir, BgnDir); + strcpy(OutFileDir, BgnDir); + strcpy(MMLogDir, BgnDir); + strcpy(ExtLogDir, BgnDir); + strcpy(RecDir, BgnDir); +} + +void __fastcall TMmttyWd::UpdateComarray(void) +{ + if( pMap == NULL ) return; + + if( pMap->title[0] ){ + Caption = pMap->title; + } + if( pMap->comName[0] ){ + sys.m_TxRxName = pMap->comName; + COMM.change = 1; + } + else { + StrCopy(pMap->comName, sys.m_TxRxName.c_str(), sizeof(pMap->comName)); + } + if( pMap->comRadio[0] ){ + StrCopy(RADIO.StrPort, pMap->comRadio, sizeof(RADIO.StrPort)-1); + RADIO.change = 1; + } + else { + StrCopy(pMap->comRadio, RADIO.StrPort, sizeof(pMap->comRadio)-1); + } + OpenCloseCom(); +} + +void __fastcall TMmttyWd::UpdateRemort(void) +{ + if( Remote ){ + MSG_MMTTY=::RegisterWindowMessage("MMTTY"); + + if( KPanel->Checked == FALSE ){ + KPanel->Checked = TRUE; + UpdateControlPanel(); + } + if( KFFT->Checked == FALSE ){ + KFFT->Checked = TRUE; + KFFTClick(NULL); + } + BorderIcons >> biSystemMenu >> biMinimize >> biMaximize >> biHelp; + KMFile->Visible = FALSE; + KMEdit->Visible = FALSE; + KExtCmd->Visible = FALSE; + KMHelp->Visible = FALSE; + + KPanel->Visible = FALSE; + KPanelSize->Visible = FALSE; + N11->Visible = FALSE; + KMac->Visible = FALSE; + N18->Visible = FALSE; + KFFT->Visible = FALSE; + KClrRx->Visible = FALSE; + N6->Visible = FALSE; + KOS->Visible = FALSE; + KHint->Visible = FALSE; + KLog->Visible = FALSE; + KQSO->Visible = FALSE; + N8->Visible = FALSE; + N3->Visible = FALSE; + + KVol->Visible = FALSE; + KVolIn->Visible = FALSE; + KTest->Visible = FALSE; + N15->Visible = FALSE; + KSend->Visible = FALSE; + KENT->Visible = FALSE; + KWP->Visible = FALSE; + N19->Visible = FALSE; + KRun->Visible = FALSE; + KPttTim->Visible = FALSE; + N4->Visible = FALSE; + KTX->Visible = FALSE; + N25->Visible = FALSE; + KTNC->Visible = FALSE; + KOptLog->Visible = FALSE; + GroupM->Visible = FALSE; + if( !(Remote & REMCTRL) ){ + GroupDem->Visible = FALSE; + GroupCtr->Visible = FALSE; + } + if( !(Remote & REMMENU) ){ + KView->Visible = FALSE; + KMOpt->Visible = FALSE; + KS->Visible = FALSE; + if( !(Remote & REMCTRL) ){ + Application->OnActivate = OnActivate; + } + } + if( Remote & REMSHOWOFF ){ + Application->OnActivate = OnRestore; + } + + Application->OnMessage = OnMSG; + Caption = (Remote >= 2) ? "RTTY Indicator":"RTTY Control panel"; + m_RemoteTimer = m_cRemoteTimeout; // Changed 50 to 100 by JE3HHT on Sep.2010 + FirstFileMapping(); + OnKeyDown = NULL; + OnKeyPress = NULL; + OnKeyUp = NULL; + } +} + +void __fastcall TMmttyWd::FirstFileMapping(void) +{ + if( hMap != NULL ) return; + + hMap = ::OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, m_strCommonMemory.c_str()); + if( hMap != NULL ){ + pMap = (COMARRAY *)::MapViewOfFile(hMap, FILE_MAP_ALL_ACCESS, 0, 0, 0); + pMap->smpFreq = pMap->smpFFT ? 8000 : SampFreq; + UpdateComarray(); + pMap->flagFFT = 0; + pMap->flagXY = 0; + strcpy(pMap->verMMTTY, VERID); + double err; + switch(SampType){ + case 1: + err = (SampFreq - 8000.0) * 1.0e6/8000.0; + break; + case 2: + err = (SampFreq - 6000.0) * 1.0e6/6000.0; + break; + case 3: + err = (SampFreq - 12000.0) * 1.0e6/12000.0; + break; + default: + err = (SampFreq - 11025.0) * 1.0e6/11025.0; + break; + } + pMap->errorClock = err + 0.5; + pMap->smpDemFreq = DemSamp + 0.5; + } + Application->Title = Caption.c_str(); +} + +void __fastcall TMmttyWd::UpdateSystemFont(void) +{ + TFontStyles fsw = Code2FontStyle(sys.m_WinFontStyle); + TFontStyles fsb = Code2FontStyle(sys.m_BtnFontStyle); + if( (sys.m_WinFontName != Font->Name)|| + (sys.m_WinFontCharset != Font->Charset)|| + (fsw != Font->Style)|| + (sys.m_BtnFontName != SBM1->Font->Name)|| + (sys.m_BtnFontCharset != SBM1->Font->Charset)|| + (fsb != SBM1->Font->Style) + ){ + + Font->Name = sys.m_WinFontName; + Font->Charset = sys.m_WinFontCharset; + Font->Style = fsw; + + AlignMain.NewFont(sys.m_WinFontName, sys.m_WinFontCharset, fsw); + AlignTop.NewFont(sys.m_WinFontName, sys.m_WinFontCharset, fsw); + AlignQSO.NewFont(sys.m_WinFontName, sys.m_WinFontCharset, fsw); + AlignStat.NewFont(sys.m_WinFontName, sys.m_WinFontCharset, fsw); + + for( int i = 0; i < 16; i++ ){ + GetSB(i)->Font->Name = sys.m_BtnFontName; + GetSB(i)->Font->Charset = sys.m_BtnFontCharset; + GetSB(i)->Font->Style = fsb; + } + SBIN1->Font->Name = sys.m_BtnFontName; + SBIN1->Font->Charset = sys.m_BtnFontCharset; + SBIN1->Font->Style = fsb; + SBIN2->Font->Name = sys.m_BtnFontName; + SBIN2->Font->Charset = sys.m_BtnFontCharset; + SBIN2->Font->Style = fsb; + SBIN3->Font->Name = sys.m_BtnFontName; + SBIN3->Font->Charset = sys.m_BtnFontCharset; + SBIN3->Font->Style = fsb; + SBIN4->Font->Name = sys.m_BtnFontName; + SBIN4->Font->Charset = sys.m_BtnFontCharset; + SBIN4->Font->Style = fsb; + HisCall->Font->Name = sys.m_BtnFontName; + HisCall->Font->Charset = sys.m_BtnFontCharset; + HisCall->Font->Style = fsb; + HisName->Font->Name = sys.m_BtnFontName; + HisName->Font->Charset = sys.m_BtnFontCharset; + HisName->Font->Style = fsb; + HisQTH->Font->Name = sys.m_BtnFontName; + HisQTH->Font->Charset = sys.m_BtnFontCharset; + HisQTH->Font->Style = fsb; + HisRST->Font->Name = sys.m_BtnFontName; + HisRST->Font->Charset = sys.m_BtnFontCharset; + HisRST->Font->Style = fsb; + MyRST->Font->Name = sys.m_BtnFontName; + MyRST->Font->Charset = sys.m_BtnFontCharset; + MyRST->Font->Style = fsb; + Freq->Font->Name = sys.m_BtnFontName; + Freq->Font->Charset = sys.m_BtnFontCharset; + Freq->Font->Style = fsb; + } + if( Font->Charset != SHIFTJIS_CHARSET ){ + KMFile->Caption = "File(&F)"; + KMEdit->Caption = "Edit(&E)"; + KView->Caption = "View(&V)"; + KMOpt->Caption = "Option(&O)"; + KExtCmd->Caption = "Program(&P)"; + KS->Caption = "Profiles(&S)"; + KMHelp->Caption = "Help(&H)"; +// File Nenu for english + KRcvLog->Caption = "Log Rx file(&L)"; + KFileOut->Caption = "Send Text(&S)..."; + KSaveRx->Caption = "RxWindow to file(&T)..."; + KOpenLog->Caption = "Open LogData file(&O)..."; + KFlush->Caption = "Save data now(&M)"; + KRxTime->Caption = "Record WAVE(mmv) immediately (&A)"; + KRxRec->Caption = "Record WAVE(mmv) (&W) as..."; + KRxPlay->Caption = "Play WAVE(mmv) (&R)..."; + KRxPos->Caption = "Seek Play position..."; + KRxTop->Caption = "Rewind Play/Record(&B)"; + KRxPause->Caption = "Pause Play/Record(&P)"; + KRxStop->Caption = "Close Play/Record(&Z)"; + KExit->Caption = "Exit MMTTY(&X)"; + + KPaste->Caption = "Paste to TxWindow(&P)"; + KMacro->Caption = "Edit Macro Buttons(&M)..."; + KMsg->Caption = "Edit Messages(&C)..."; + + KShortCut->Caption = "Assign ShortCut Keys(&K)..."; + + KPanelSize->Caption = "Control Panel Size"; + KMac->Caption = "Macro Buttons"; + KFFT->Caption = "FFT Display"; + KFFTFW->Caption = "FFT Width"; + KFFTGain->Caption = "FFT Sensitivity"; + KFFTR->Caption = "FFT Response"; + KXYScopeSize->Caption = "XYScope Size"; + KXYScopeQuality->Caption = "XYScope Quality"; + KOS->Caption = "Scope"; + KClrRx->Caption = "Clear Rx Window"; + KHint->Caption = "Show Button Hint"; + KLog->Caption = "LogData List..."; + KQSO->Caption = "Current QSO Data..."; + + KVol->Caption = "Soundcard output level(&V)..."; + KVolIn->Caption = "Soundcard input level(&I)..."; + KTest->Caption = "Test"; + KSend->Caption = "Way to send(&S)"; + KSChar->Caption = "CHARACTER OUT"; + KSWord->Caption = "WORD OUT"; + KSLine->Caption = "LINE OUT"; + KENT->Caption = "Auto send CR/LF with TX button"; + KTX->Caption = "Disable transmission"; + KWP->Caption = "Word wrap on keyboard"; + KRun->Caption = "Running mode"; + KPttTim->Caption = "PTT Timer(&P)..."; + KTNC->Caption = "Setup TNC emulation(&T)..."; + KOptLog->Caption = "Setup Logging(&L)..."; + KOption->Caption = Remote ? "Setup(&O)...":"Setup MMTTY(&O)..."; + + KSDel->Caption = "Delete Menu"; + KSEnt->Caption = "Assign Menu"; + KSSV->Caption = "Save to file(&S)"; + KSLD->Caption = "Load from file(&L)"; + KExtEnt->Caption = "Assign Menu"; + KExtDel->Caption = "Delete Menu"; + + KExtReset->Caption = "Resume(&R)"; + KExtSusp->Caption = "Suspend(&S)"; + + KSetHelp->Caption = "Setup Help(&S)..."; + KWebHHT->Caption = "JE3HHT WebSite (Japanese)"; + KWebJARTS->Caption = "JARTS WebSite"; + KDispVer->Caption = "About MMTTY(&A)"; + + KRM->Caption = "Version-up information"; + + KRO->Caption = "Options of Received-log"; + KROF->Caption = "Folder..."; + KROT->Caption = "Log time stamp"; + KROTU->Caption = "Time stamp is UTC"; + KROTD->Caption = "Show time stamp in the RX window"; + } + KHlpTxt->Caption = sys.m_Help.c_str(); + KHlpLog->Caption = sys.m_HelpLog.c_str(); + KHlpDig->Caption = sys.m_HelpDigital.c_str(); + SBTX->Font->Color = clRed; +} + +void __fastcall TMmttyWd::ReqPaletteChange(void) +{ + if( UsrPal != NULL ){ // 256FƒAƒ_ƒvƒ^[‚ÌŽž + ClosePalette(); + m_ReqPaletteChange = 1; + } +} + +void __fastcall TMmttyWd::UpdateColor(void) +{ + PanelRx->Color = sys.m_ColorRXBack; + PanelIn->Color = sys.m_ColorINBack; + if( UsrPal != NULL ){ // 256FƒAƒ_ƒvƒ^[‚ÌŽž + ClosePalette(); + m_ReqPaletteChange = 1; + } + else { + PBoxWater->Invalidate(); + PBoxXY->Invalidate(); + PBoxRx->Invalidate(); + PBoxIn->Invalidate(); + } +} +//--------------------------------------------------------------------------- +// ƒAƒCƒhƒ‹ˆ— +void __fastcall TMmttyWd::OnIdle(TObject *Sender, bool &Done) +{ + if( Log.IsOpen() ){ + if( Log.m_CurChg ){ + Log.SetLastPos(); + UpdateTextData(); + Log.m_CurChg = 0; + SBQSO->Down = Log.m_sd.btime ? 1 : 0; + } + } + UpdateUI(); + TimerFocus(); + if( m_ReqPaletteChange ){ + m_ReqPaletteChange = 0; + if( sys.m_Palette ){ + if( UsrPal == NULL ){ + SetColorIndex(); + } + } + else { + if( UsrPal != NULL ){ + ClosePalette(); + } + } + if( UsrPal != NULL ){ + m_PaletteTimer = 3; + } + } +} +#if 0 +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::TopWindow(void) +{ + if( FormStyle == fsStayOnTop ){ + ::SetWindowPos(Handle, HWND_TOPMOST, Left, Top, Width, Height, SWP_NOMOVE|SWP_NOSIZE); + } +} +#endif +//--------------------------------------------------------------------------- +// ƒRƒ“ƒgƒ[ƒ‹ƒpƒlƒ‹‚Ì’²® +void __fastcall TMmttyWd::UpdateXY2(void) +{ + int w; + if( m_XYSize ){ + w = PanelWater->Top - PanelFFT->Top + PanelWater->Height; + } + else { + w = PanelFFT->Height - 1; + } + if( PanelTop->Visible ){ + if( PanelXY->Parent != PanelTop ){ + PanelXY->Visible = FALSE; + PanelRx->RemoveControl(PanelXY); + PanelTop->InsertControl(PanelXY); + PanelXY->Parent = PanelTop; + PanelXY->Visible = KXYScope->Checked; + } + PanelXY->SetBounds(PanelFFT->Left + PanelFFT->Width - w, PanelFFT->Top, w, w); + } + else { + if( PanelXY->Parent != PanelRx ){ + PanelXY->Visible = FALSE; + PanelTop->RemoveControl(PanelXY); + PanelRx->InsertControl(PanelXY); + PanelXY->Parent = PanelRx; + PanelXY->Visible = KXYScope->Checked; + } + PanelXY->SetBounds(PBoxRx->Width - PanelXY->Width, PBoxRx->Top, w, w); + } +} +//--------------------------------------------------------------------------- +// ƒRƒ“ƒgƒ[ƒ‹ƒpƒlƒ‹‚Ì’²® +void __fastcall TMmttyWd::UpdateControlPanel(void) +{ + if( KPanel->Checked != PanelTop->Visible ){ + PanelTop->Visible = KPanel->Checked; + PanelRx->Top = (PanelQSO->Top + PanelQSO->Height); + PanelRx->Height = PanelStat->Top - (PanelQSO->Top + PanelQSO->Height); + PrintText.SetPaintBox(PBoxRx, ScrollBarRx); + UpdateXY2(); + if( Remote ) PostApp(TXM_HEIGHT, Height); + } +} +//--------------------------------------------------------------------------- +// ŽóM‰æ–ʂ̃TƒCƒY’²® +void __fastcall TMmttyWd::UpdatePanel(void) +{ + PanelRx->Top = (PanelQSO->Top + PanelQSO->Height); + PanelRx->Height = PanelStat->Top - (PanelQSO->Top + PanelQSO->Height); + PrintText.SetPaintBox(PBoxRx, ScrollBarRx); + FifoEdit.SetPaintBox(PBoxIn, ScrollBarIn); +} +//--------------------------------------------------------------------------- +// ƒƒOƒpƒlƒ‹‚Ì’²® +void __fastcall TMmttyWd::AlignLogPanel(void) +{ + AlignQSO.NewAlign(PanelQSO); + if( Log.m_LogSet.m_Contest && (Log.m_LogSet.m_Contest != testPED) ){ + int wname = HisName->Width; + int wrst = HisRST->Width; + int nname = wname * 7 / 16; + HisName->Width = nname; + HisQTH->Width = nname; + int off = (wname - nname)/2; + int nrst = wrst + off; + LMY->Left -= off * 2; + MyRST->Left -= off * 2; + LHIS->Left -= off; + HisRST->Left -= off; + HisRST->Width = nrst; + MyRST->Width = nrst; + } +} +//--------------------------------------------------------------------------- +// ƒTƒCƒY•ÏXƒCƒxƒ“ƒg +void __fastcall TMmttyWd::FormResize(TObject *Sender) +{ + if( Timer->Enabled == FALSE ) return; + if( pSound == NULL ) return; + if( m_DisAlign ) return; + if( Remote & REMSHOWOFF ) return; + + if( Remote ){ // ƒŠƒ‚[ƒgŽž + PanelRx->Visible = FALSE; + PanelIn->Visible = FALSE; + PanelStat->Visible = FALSE; + PanelQSO->Visible = FALSE; + PanelTop->Height = ClientHeight; + AlignTop.NewAlign(PanelTop); + if( !(Remote & REMCTRL) ){ + if( PanelFFT->Top != 0 ){ + PanelFFT->Height += PanelFFT->Top; + PanelFFT->Top = 0; + PanelXY->Top = 0; + PanelWater->Height = PanelTop->ClientHeight - PanelWater->Top; + } + } + UpdatePanel(); + if( GroupCtr->Visible == FALSE ){ + PanelFFT->Left = GroupCtr->Left; + PanelWater->Left = GroupCtr->Left; + PanelFFT->Width = ClientWidth - GroupCtr->Left - 2; + PanelWater->Width = ClientWidth - GroupCtr->Left - 2; + } + else if( GroupM->Visible == FALSE ){ + PanelFFT->Left = GroupM->Left; + PanelWater->Left = GroupM->Left; + PanelFFT->Width = ClientWidth - GroupM->Left - 2; + PanelWater->Width = ClientWidth - GroupM->Left - 2; + } + else { + PanelFFT->Left = GroupM->Left + GroupM->Width + 2; + PanelWater->Left = GroupM->Left + GroupM->Width + 2; + PanelFFT->Width = ClientWidth - PanelFFT->Left - 2; + PanelWater->Width = ClientWidth - PanelWater->Left - 2; + } + } + else { // ƒXƒ^ƒ“ƒhƒAƒ[ƒ“Žž + if( PanelIn->Align == alNone ){ + m_DisAlign++; + PanelMac->Align = alTop; + PanelIn->Align = alBottom; + PanelStat->Align = alBottom; + ClientHeight = m_BefHeight; + m_DisAlign--; + } + else { + m_BefHeight = ClientHeight; + } + PanelTop->Visible = TRUE; + AlignMain.NewAlign(this); + switch(m_PanelSize){ + case 0: + AlignMain.NewAlign(this, PanelTop, 0.75); + break; + case 1: + AlignMain.NewAlign(this, PanelTop, 0.9); + break; + case 3: + AlignMain.NewAlign(this, PanelTop, 1.25); + break; + default: + break; + } + UpdatePanel(); + AlignTop.NewAlign(PanelTop); +#if 1 + AlignLogPanel(); +#else + AlignQSO.NewAlign(PanelQSO); +#endif + AlignStat.NewAlign(PanelQSO); + if( GroupCtr->Visible == FALSE ){ + PanelFFT->Left = GroupCtr->Left; + PanelWater->Left = GroupCtr->Left; + PanelFFT->Width = ClientWidth - GroupCtr->Left - 2; + PanelWater->Width = ClientWidth - GroupCtr->Left - 2; + } + else if( GroupM->Visible == FALSE ){ + PanelFFT->Left = GroupM->Left; + PanelWater->Left = GroupM->Left; + PanelFFT->Width = ClientWidth - GroupM->Left - 2; + PanelWater->Width = ClientWidth - GroupM->Left - 2; + } + else { + PanelFFT->Left = GroupM->Left + GroupM->Width + 2; + PanelWater->Left = GroupM->Left + GroupM->Width + 2; + PanelFFT->Width = ClientWidth - PanelFFT->Left - 2; + PanelWater->Width = ClientWidth - PanelWater->Left - 2; + } + if( PanelMac->Visible == TRUE ){ + TSpeedButton *tp; + double w = double(PanelMac->ClientWidth - 12)/16; + double a = 0; + for( int i = 0; i < 16; i++, a += w ){ + if( i && (!(i % 4)) ) a += 4.0; + tp = GetSB(i); + tp->Top = 0; + tp->Height = PanelMac->ClientHeight; + tp->Left = int(a); + tp->Width = int(w); + } + } + } + if( UsrPal != NULL ){ + ClosePalette(); + m_ReqPaletteChange = 1; + } + delete pBitmapFFTIN; + delete pBitmapWater; + delete pBitmapSQ; +// delete pBitmapXY; + pBitmapFFTIN = new Graphics::TBitmap(); + pBitmapFFTIN->Width = PBoxFFTIN->Width; + pBitmapFFTIN->Height = PBoxFFTIN->Height; + + pBitmapWater = new Graphics::TBitmap(); + pBitmapWater->Width = PBoxWater->Width; + pBitmapWater->Height = PBoxWater->Height; + + pBitmapSQ = new Graphics::TBitmap(); + pBitmapSQ->Width = PBoxSQ->Width; + pBitmapSQ->Height = PBoxSQ->Height; + + UpdateXYScope(); +#if 0 + pBitmapXY = new Graphics::TBitmap(); + pBitmapXY->Width = PBoxXY->Width; + pBitmapXY->Height = PBoxXY->Height; +#endif + + if( pSound != NULL ){ + pSound->DrawFFT(pBitmapFFTIN, 1, KXYScope->Checked ? PBoxXY->Width : 0); + pSound->DrawFFTWater(pBitmapWater, 1, KXYScope->Checked ? PBoxXY->Width : 0); + DrawSQ(); + } + UpdateMacro(); + UpdateControlPanel(); + + // ƒXƒ^[ƒ“ƒhƒAƒ[ƒ“Žž‚̃EƒCƒ“ƒhƒE‹ÖŽ~ˆ— + if( sys.m_DisWindow && (!Remote) ){ + m_DisAlign++; + PanelMac->Align = alNone; + PanelIn->Align = alNone; + PanelStat->Align = alNone; + ClientHeight = PanelTop->Height; + m_DisAlign--; + } +} +//--------------------------------------------------------------------------- +// ƒTƒCƒY•ÏXƒRƒ“ƒgƒ[ƒ‹‚Ì“o˜^ +void __fastcall TMmttyWd::EntryAlignControl(void) +{ + AlignMain.EntryControl(PanelTop, this, NULL); + AlignMain.EntryControl(PanelMac, this, NULL); + AlignMain.EntryControl(PanelQSO, this, NULL); + AlignMain.EntryControl(PanelStat, this, NULL); + +// ƒgƒbƒvƒpƒlƒ‹‚Ì“o˜^ + AlignTop.EntryControl(GroupCtr, PanelTop, GroupCtr->Font); + AlignTop.EntryControl(SBTXOFF, PanelTop, SBTXOFF->Font); + AlignTop.EntryControl(SBTX, PanelTop, SBTX->Font); + AlignTop.EntryControl(SBFIG, PanelTop, SBFIG->Font); + AlignTop.EntryControl(SBUOS, PanelTop, SBUOS->Font); + AlignTop.EntryControl(GroupDem, PanelTop, GroupDem->Font); + AlignTop.EntryControl(GroupM, PanelTop, GroupM->Font); + AlignTop.EntryControl(Label1, PanelTop, Label1->Font); + AlignTop.EntryControl(Label2, PanelTop, Label2->Font); + AlignTop.EntryControl(Label3, PanelTop, Label3->Font); + AlignTop.EntryControl(Label4, PanelTop, Label4->Font); + AlignTop.EntryControl(LLPF, PanelTop, LLPF->Font); + AlignTop.EntryControl(Label7, PanelTop, Label7->Font); + AlignTop.EntryControl(LTap, PanelTop, LTap->Font); + AlignTop.EntryControl(LHZ, PanelTop, LHZ->Font); + AlignTop.EntryControl(SBRev, PanelTop, SBRev->Font); + AlignTop.EntryControl(SBDem, PanelTop, SBDem->Font); + AlignTop.EntryControl(SBHAM, PanelTop, SBHAM->Font); + AlignTop.EntryControl(SBATC, PanelTop, SBATC->Font); + AlignTop.EntryControl(SBNET, PanelTop, SBNET->Font); + AlignTop.EntryControl(SBSQ, PanelTop, SBSQ->Font); + AlignTop.EntryControl(SBAFC, PanelTop, SBAFC->Font); + AlignTop.EntryControl(SBBPF, PanelTop, SBBPF->Font); + AlignTop.EntryControl(SBLMS, PanelTop, SBLMS->Font); + AlignTop.EntryControl(MarkFreq, PanelTop, MarkFreq->Font); + AlignTop.EntryControl(ShiftFreq, PanelTop, ShiftFreq->Font); + AlignTop.EntryControl(DemoBox1, PanelTop, DemoBox2->Font); + AlignTop.EntryControl(DemoBox2, PanelTop, DemoBox2->Font); + AlignTop.EntryControl(PanelSQ, PanelTop, NULL); + AlignTop.EntryControl(PanelFFT, PanelTop, NULL); + AlignTop.EntryControl(PanelWater, PanelTop, NULL); + AlignTop.EntryControl(PanelXY, PanelTop, NULL); + for( int i =0; i < 16; i++ ){ + AlignTop.EntryControl(GetSB(i), PanelTop, GetSB(i)->Font); + } + +// QSOƒpƒlƒ‹‚Ì“o˜^ + AlignQSO.EntryControl(LCall, PanelQSO, LCall->Font); + AlignQSO.EntryControl(HisCall, PanelQSO, HisCall->Font); + AlignQSO.EntryControl(LName, PanelQSO, LName->Font); + AlignQSO.EntryControl(HisName, PanelQSO, HisName->Font); + AlignQSO.EntryControl(HisQTH, PanelQSO, HisQTH->Font); + AlignQSO.EntryControl(LHIS, PanelQSO, LHIS->Font); + AlignQSO.EntryControl(HisRST, PanelQSO, HisRST->Font); + AlignQSO.EntryControl(LMY, PanelQSO, LMY->Font); + AlignQSO.EntryControl(MyRST, PanelQSO, MyRST->Font); + AlignQSO.EntryControl(SBQSO, PanelQSO, SBQSO->Font); + AlignQSO.EntryControl(SBData, PanelQSO, SBData->Font); + AlignQSO.EntryControl(SBInit, PanelQSO, SBInit->Font); + AlignQSO.EntryControl(SBFind, PanelQSO, SBFind->Font); + AlignQSO.EntryControl(Freq, PanelQSO, Freq->Font); + +// “ü—̓{ƒ^ƒ“ƒpƒlƒ‹‚Ì“o˜^ + AlignStat.EntryControl(SBINClear, PanelStat, SBINClear->Font); + AlignStat.EntryControl(SBIN1, PanelStat, SBIN1->Font); + AlignStat.EntryControl(SBIN2, PanelStat, SBIN2->Font); + AlignStat.EntryControl(SBIN3, PanelStat, SBIN3->Font); + AlignStat.EntryControl(SBIN4, PanelStat, SBIN4->Font); + AlignStat.EntryControl(MsgList, PanelStat, MsgList->Font); + AlignStat.EntryControl(SBINEdit, PanelStat, SBINEdit->Font); + AlignStat.EntryControl(LWait, PanelStat, LWait->Font); + AlignStat.EntryControl(TBCharWait, PanelStat, NULL); + + int CX = ::GetSystemMetrics(SM_CXFULLSCREEN); + int CY = ::GetSystemMetrics(SM_CYFULLSCREEN); +// int CX = ::GetSystemMetrics(SM_CXSCREEN); +// int CY = ::GetSystemMetrics(SM_CYSCREEN); + if( (CX < Width)||(CY < Height) ){ + Top = 0; + Left = 0; + Width = CX; + Height = CY; + } + PanelTop->Align = alTop; + PanelMac->Align = alTop; + PanelQSO->Align = alTop; + PanelRx->Align = alTop; + PanelIn->Align = alBottom; + PanelStat->Align = alBottom; + FormCenter(this, CX, CY); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::UpdateStayOnTop(void) +{ + TFormStyle fs = (sys.m_StayOnTop || Remote) ? fsStayOnTop : fsNormal; + if( FormStyle != fs ){ + AnsiString asMarkFreq; + GetComboBox(asMarkFreq, MarkFreq); + AnsiString asShiftFreq; + GetComboBox(asShiftFreq, ShiftFreq); + AnsiString asHisRST; + GetComboBox(asHisRST, HisRST); + + FormStyle = fs; + if( Remote && (Remote & REMDISSTAYONTOP) ){ + FormStyle = fsNormal; + } + if( pTnc != NULL ) pTnc->UpdateHandle(Handle); + LogLink.SetHandle(Handle, CM_CMML); + if( pRadio ) pRadio->UpdateHandle(Handle, CM_CMMR); + + SetComboBox(MarkFreq, asMarkFreq.c_str()); + SetComboBox(ShiftFreq, asShiftFreq.c_str()); + SetComboBox(HisRST, asHisRST.c_str()); + SetComboBox(MyRST, asHisRST.c_str()); + UpdateItem(); + } +// if( pRadio != NULL ) pRadio->UpdateHandle(Handle); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::UpdateTitle(void) +{ + if( Remote ) return; + char bf[512]; + if( IsCall(sys.m_Call.c_str()) ){ + sprintf(bf, "%s (%s) - "VERTTL2, sys.m_Call.c_str(), Log.GetName() ); + } + else { + strcpy(bf, VERTTL2); + } + if( Log.m_LogSet.m_QSOMacroFlag ){ // Auto running Macro + strcat(bf, m_Running ? " (Running mode)":" (S&P mode)"); + } + if( SampType ){ + char bbf[64]; + sprintf(bbf, " [based on %.lfHz]", SampBase); + strcat(bf, bbf); + } + if( LogLink.IsLink() ){ + char bbf[64]; + sprintf(bbf, " [Link to %s]", LogLink.GetSessionName()); + strcat(bf, bbf); + } + Caption = bf; + UpdateCallsign(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::UpdateItem(void) +{ + m_DisEvent++; + UpdateTitle(); + SBUOS->Down = rtty.m_uos; + SBFIG->Down = rtty.m_fig; + + SBSQ->Down = pSound->FSKDEM.GetSQ(); + + SBRev->Down = sys.m_Rev; + KTest->Checked = pSound->m_Test; + KXYScope->Checked = pSound->FSKDEM.m_XYScope; + + SBATC->Down = pSound->FSKDEM.m_atc; + SBNET->Down = sys.m_TxNet; + KFFT->Checked = pSound->m_FFTSW; + SBAFC->Down = sys.m_AFC; + SBBPF->Down = pSound->m_bpf; + SBLMS->Down = pSound->m_lmsbpf; + KPttTim->Checked = m_PttTimer ? 1 : 0; + UpdateLWait(); + + if( pRadio != NULL ) pRadio->SetMarkFreq(pSound->FSKDEM.GetMarkFreq()); + MarkFreq->Text = pSound->FSKDEM.GetMarkFreq(); + ShiftFreq->Text = pSound->FSKDEM.GetSpaceFreq() - pSound->FSKDEM.GetMarkFreq(); + SelectCombo(TRUE); + if( pComm != NULL ) pComm->SetInv(sys.m_TxRxInv); + UpdateUI(); +// UpdateXYScope(); + UpdateLimit(); + m_DisEvent--; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::UpdateFSK(void) +{ + if( sys.m_TxPort ) OpenClosePTT(); + if( (TNC.Type == 2) && (pTnc!=NULL) && !pTnc->IsMMT() ) OpenCloseTNC(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::OpenCloseCom(void) +{ + if( COMM.change || TNC.change || RADIO.change ){ + if( COMM.change && strcmp(sys.m_TxRxName.c_str(), "NONE") ){ + if( pTnc != NULL ){ + TNC.change = 1; + pTnc->Close(); + delete pTnc; + pTnc = NULL; + } + if( pRadio != NULL ){ + RADIO.change = 1; + pRadio->Close(); + delete pRadio; + pRadio = NULL; + } + } + if( RADIO.change && strcmp(RADIO.StrPort, "NONE") ){ + if( pTnc != NULL ){ + TNC.change = 1; + pTnc->Close(); + delete pTnc; + pTnc = NULL; + } + } + if( COMM.change ){ + if( pComm != NULL ){ + delete pComm; + pComm = NULL; + } + OpenClosePTT(); + } + if( RADIO.change || ((pRadio == NULL)&&strcmp(RADIO.StrPort, "NONE")) ){ + OpenCloseRadio(); + } + if( TNC.change || ((pTnc == NULL)&&strcmp(TNC.StrPort, "NONE")) ){ + OpenCloseTNC(); + } + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SetFSKPara(COMMPARA *cp) +{ + cp->Baud = int(pSound->FSKDEM.GetBaudRate() + 0.5); + cp->BitLen = pSound->FSKDEM.m_BitLen; + // 0-1bit, 1-1.5bit, 2-2bit, 3-1.5bit, 4-1.5bit +//ƒf[ƒ^’·5‚ƃXƒgƒbƒv ƒrƒbƒg2‚Ì‘g‚݇‚킹‚Í–³Œø‚Å‚·B +//ƒf[ƒ^’·6¤ 7¤ 8‚ƃXƒgƒbƒv ƒrƒbƒg1.5‚Ƃ̑g‚݇‚킹‚à–³Œø‚Å‚·B + switch(pSound->FSKMOD.m_StopLen){ + case 2: + cp->Stop = (cp->BitLen >= 6) ? TWOSTOPBITS : ONE5STOPBITS; + break; + case 1: + case 3: + case 4: + cp->Stop = (cp->BitLen >= 6) ? TWOSTOPBITS : ONE5STOPBITS; + break; + default: + cp->Stop = ONESTOPBIT; + break; + } + switch(pSound->FSKDEM.m_Parity){ + case 1: // Even + cp->Parity = EVENPARITY; + break; + case 2: // Odd + cp->Parity = ODDPARITY; + break; + case 3: // 1 + cp->Parity = MARKPARITY; + break; + case 4: // 0 + default: + cp->Parity = NOPARITY; + break; + } + if(cp->BitLen == 5){ + if( cp->Stop == ONE5STOPBITS ) cp->Stop = TWOSTOPBITS; + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::OpenClosePTT(void) +{ + if( !COMM.change ) return; + COMM.change = 0; + + if( pComm != NULL ){ + delete pComm; + pComm = NULL; + } + if( !strcmp(sys.m_TxRxName.c_str(), "NONE") ){ + if( (pMap != NULL) && !(Remote & REMDISSHARED) ) strcpy(pMap->comName, "NONE"); + } + else { + COMMPARA cm; + SetFSKPara(&cm); + pComm = new CComm(TRUE); + + //AA6YQ 1.66 enable use of 2-digit com ports per http://support.microsoft.com/kb/115831/EN-US/ + char *ComPort = new char[33]; + + if(!strncmp(sys.m_TxRxName.c_str(), "COM", 3) ){ //strncmp returns 0 if match + //AA6YQ 1.66 but only if we're opening a COM port + StrCopy(ComPort,"\\\\.\\"); + StrCat(ComPort,sys.m_TxRxName.c_str()); + } + else { + //AA6YQ 1.66 as opposed to, say, EXTFSK + StrCopy(ComPort,sys.m_TxRxName.c_str()); + } + + if( sys.m_TxPort && !strncmp(sys.m_TxRxName.c_str(), "COM", 3) ){ + if( pComm->Open(ComPort, sys.m_TxRxInv, NULL) ){ + pComm->SetTXRX(0); + pComm->Close(); + } + } + + if( pComm->Open(ComPort, sys.m_TxRxInv, sys.m_TxPort ? &cm : NULL) ){ + pComm->pMod = &pSound->FSKMOD; + pComm->EnbTX(SBTX->Down); + if( sys.m_TxPort ) pComm->Resume(); // Txd‘—Mƒ^ƒXƒN‚ð“®ì‚³‚¹‚é + } + else { + if( sys.m_TxPort && (cm.BitLen == 5) && (cm.Stop == TWOSTOPBITS) ){ + cm.Stop = ONE5STOPBITS; // set 1.5bits + if( pComm->Open(ComPort, sys.m_TxRxInv, &cm) == TRUE ){ + pComm->pMod = &pSound->FSKMOD; + pComm->EnbTX(SBTX->Down); + pComm->Resume(); // Txd‘—Mƒ^ƒXƒN‚ð“®ì‚³‚¹‚é + goto _noerr; + } + } + delete pComm; + pComm = NULL; + if( !Remote || !m_RemoteTimer ){ + ErrorMB( (Font->Charset != SHIFTJIS_CHARSET)? "Cannot open '%s'":"'%s'‚ªƒI[ƒvƒ“‚Å‚«‚Ü‚¹‚ñ.", sys.m_TxRxName.c_str()); + } + } +_noerr:; + if( (pMap != NULL) && !(Remote & REMDISSHARED) ) StrCopy(pMap->comName, sys.m_TxRxName.c_str(), sizeof(pMap->comName)-1); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::UpdateMacro(void) +{ + int FontSize = sys.m_SBINFontSize * AlignStat.GetFontAdj(SBIN1); + SetButtonCaption(SBIN1, sys.m_InBtnName[0], 6, FontSize, sys.m_InBtnCol[0]); + SetButtonCaption(SBIN2, sys.m_InBtnName[1], 6, FontSize, sys.m_InBtnCol[1]); + SetButtonCaption(SBIN3, sys.m_InBtnName[2], 6, FontSize, sys.m_InBtnCol[2]); + SetButtonCaption(SBIN4, sys.m_InBtnName[3], 6, FontSize, sys.m_InBtnCol[3]); + FontSize = sys.m_SBFontSize * AlignTop.GetFontAdj(SBM1); + if( !KMac->Checked ) FontSize = sys.m_SBFontSize * (PanelMac->Width / 792.0); + for( int i = 0; i < 16; i++ ){ + SetButtonCaption(GetSB(i), sys.m_UserName[i], KMac->Checked ? 4 : 5, FontSize, sys.m_UserCol[i]); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::UpdateLimit(void) +{ + if( SBTX->Down && (sys.m_echo != 2) ){ + pSound->FSKDEM.m_Limit = 0; + } + else { + pSound->FSKDEM.m_Limit = 1; + pSound->FSKDEM.m_LimitGain = sys.m_LimitGain; + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::UpdateLMS(void) +{ + SBLMS->Caption = pSound->m_lms.m_Type ? "Not." : "LMS"; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::UpdateUI(void) +{ + m_DisEvent++; + SBAFC->Enabled = KFFT->Checked; + SBQSO->Enabled = !HisCall->Text.IsEmpty(); + SBFind->Enabled = !HisCall->Text.IsEmpty(); + if( m_NameQTH ){ + if( HisName->Visible == TRUE ){ + LName->Caption = "QTH"; + HisName->Visible = FALSE; + HisQTH->Visible = TRUE; + } + } + else { + if( HisName->Visible == FALSE ){ + LName->Caption = "Name"; + HisName->Visible = TRUE; + HisQTH->Visible = FALSE; + } + } + int i; + for( i = 0; i < 16; i++ ){ + GetSB(i)->Enabled = !sys.m_User[i].IsEmpty(); + } + if( pSound != NULL ){ + if( (m_DemType != pSound->FSKDEM.m_type)|| + (m_LpfType != pSound->FSKDEM.m_lpf)|| + (m_Baud != m_ShowBaud) + ){ + m_DemType = pSound->FSKDEM.m_type; + m_LpfType = pSound->FSKDEM.m_lpf; + switch(pSound->FSKDEM.m_type){ + case 0: + GroupDem->Caption = "Demodulator (IIR)"; + LTap->Caption = m_Baud ? "Baud":"BW"; + LHZ->Visible = m_Baud ? FALSE : TRUE; + LLPF->Caption = m_LpfType ? "LPF" : "AV."; + break; + case 1: + GroupDem->Caption = "Demodulator (FIR)"; + LTap->Caption = m_Baud ? "Baud":"Tap"; + LHZ->Visible = FALSE; + LLPF->Caption = m_LpfType ? "LPF" : "AV."; + break; + case 2: + GroupDem->Caption = "Demodulator (PLL)"; + LTap->Caption = m_Baud ? "Baud":"VCO"; + LHZ->Visible = FALSE; + LLPF->Caption = "Loop"; + break; + case 3: + GroupDem->Caption = "Demodulator (FFT)"; + LTap->Caption = m_Baud ? "Baud":"Tones"; + LHZ->Visible = FALSE; + LLPF->Caption = m_LpfType ? "LPF" : "AV."; + break; + } + SelectCombo(TRUE); + } + if( m_filemode != pSound->WaveFile.m_mode ){ + m_filemode = pSound->WaveFile.m_mode; + switch(m_filemode){ + case 0: + KRxRec->Checked = FALSE; + KRxTime->Checked = FALSE; + KRxRec->Enabled = TRUE; + KRxTime->Enabled = TRUE; + KRxPlay->Enabled = TRUE; + KRxStop->Enabled = FALSE; + KRxPause->Enabled = FALSE; + KRxTop->Enabled = FALSE; + KRxPos->Enabled = FALSE; + break; + case 1: + KRxPlay->Enabled = FALSE; + KRxTime->Enabled = FALSE; + KRxRec->Enabled = FALSE; + KRxStop->Enabled = TRUE; + KRxPause->Enabled = TRUE; + KRxTop->Enabled = TRUE; + KRxPos->Enabled = TRUE; + break; + case 2: + KRxPlay->Enabled = FALSE; + KRxTime->Enabled = FALSE; + KRxRec->Enabled = FALSE; + KRxStop->Enabled = TRUE; + KRxPause->Enabled = TRUE; + KRxTop->Enabled = TRUE; + KRxPos->Enabled = FALSE; + break; + } + } + KRxPause->Checked = pSound->WaveFile.m_pause; + } + if( Remote ){ + RemoteStat(); + } + else { + SBTX->Enabled = !(sys.m_DisTX&1); + } + m_DisEvent--; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::FormCloseQuery(TObject *Sender, bool &CanClose) +{ + CanClose = TRUE; + Timer->Enabled = FALSE; + CWaitCursor wait; + if( Remote && m_OptionDialog ){ + HWND hWnd; + for( int i = Screen->FormCount - 1; i >= 0; i-- ){ + hWnd = Screen->Forms[i]->Handle; + if( hWnd ){ + if( hWnd != Handle ) ::SendMessage(hWnd, WM_CLOSE, 0, 0); + } + else { + break; + } + } + } + if( pComm != NULL ) pComm->ReqClose(); + if( pTnc != NULL ) pTnc->ReqClose(); + if( pRadio != NULL ) pRadio->ReqClose(); + if( pSound != NULL ){ + pSound->WaveFile.FileClose(); + ToRX(1); + pSound->ReqStop(); + Log.Close(); + Log.DoBackup(); + if( sys.m_logTimeStamp ) PrintText.TrigTimeStampImm("MMTTY Close"); + PrintText.CloseLogFile(); + WriteRegister(); + pSound->WaitStop(); + delete pSound; + pSound = NULL; +#if USEPAL + ClosePalette(); +#endif + if( pBitmapRx != NULL ){ + delete pBitmapRx; + pBitmapRx = NULL; + } + if( pBitmapIn != NULL ){ + delete pBitmapIn; + pBitmapIn = NULL; + } + delete pBitmapFFTIN; + delete pBitmapWater; + delete pBitmapXY; + delete pBitmapSQ; + pBitmapFFTIN = NULL; + pBitmapWater = NULL; + pBitmapXY = NULL; + pBitmapSQ = NULL; + } + if( p_SendFileDlg != NULL ){ + delete p_SendFileDlg; + p_SendFileDlg = NULL; + } + if( pTnc != NULL ){ + pTnc->WaitClose(); + delete pTnc; + pTnc = NULL; + } + if( pRadio != NULL ){ + pRadio->WaitClose(); + delete pRadio; + pRadio = NULL; + } + if( pComm != NULL ){ + pComm->WaitClose(); + delete pComm; + pComm = NULL; + } + ::VirtualUnlock(&sys, sizeof(sys)); + ::VirtualUnlock(this, sizeof(TMmttyWd)); +} +//--------------------------------------------------------------------------- +// ƒŒƒWƒXƒgƒŠ‚©‚ç‚̓ǂÝo‚µ +void __fastcall TMmttyWd::ReadSampFreq(void) +{ + char bf[256]; + AnsiString as, ws; + + sprintf(bf, "%sMmtty.ini", BgnDir); + TMemIniFile *pIniFile = new TMemIniFile(bf); + + SampFreq = ReadDoubleIniFile(pIniFile, "SoundCard", "SampFreq", SampFreq); + sys.m_TxOffset = ReadDoubleIniFile(pIniFile, "SoundCard", "TxOffset", 0); +#if 0 + if( (SampFreq > 12500.0) || (SampFreq < 10000.0) ) SampFreq = 11025.0; +#else + if( (SampFreq > 12500.0) || (SampFreq < 5000.0) ) SampFreq = 11025.0; + InitSampType(); +#endif + sys.m_SampFreq = SampFreq; + delete pIniFile; +} +//--------------------------------------------------------------------------- +// ƒŒƒWƒXƒgƒŠ‚©‚ç‚̓ǂÝo‚µ +void __fastcall TMmttyWd::ReadCombList(TMemIniFile *tp, AnsiString &as, LPCSTR pKey, LPCSTR pDef) +{ + as = tp->ReadString("ComboList", pKey, pDef); + if( as.IsEmpty() ) as = pDef; +} +//--------------------------------------------------------------------------- +// ƒŒƒWƒXƒgƒŠ‚©‚ç‚̓ǂÝo‚µ +void __fastcall TMmttyWd::ReadRegister(void) +{ + char bf[256]; + AnsiString as, ws; + + sprintf(bf, "%sMmtty.ini", BgnDir); + TMemIniFile *pIniFile = new TMemIniFile(bf); + + ReadCombList(pIniFile, as, "Mark", "2125,2000,1700,1445,1275,1170,1000,915"); + SetComboBox(MarkFreq, as.c_str()); + ReadCombList(pIniFile, as, "Shift", "23,85,160,170,182,200,240,350,425,850"); + SetComboBox(ShiftFreq, as.c_str()); + ReadCombList(pIniFile, m_asBaud, "Baud", "22,45,45.45,50,56,75,100,110,150,200,300"); + ReadCombList(pIniFile, as, "RST", "599,579,569,559,449,339,448,337,225,111"); + SetComboBox(HisRST, as.c_str()); + SetComboBox(MyRST, as.c_str()); + ReadCombList(pIniFile, m_asIIRBW, "IIRBW", "15,20,25,30,35,40,45,50,60,70,80,90,100,150,200"); + ReadCombList(pIniFile, m_asVCOGain, "VCO", "1.0,1.2,1.5,2.0,2.5,3.0,3.25,3.5,3.75,4.0,4.5,5.0,8.0"); + ReadCombList(pIniFile, m_asLoopFC, "LoopFC", "30,40,50,80,100,150,200,250,300,350,400,450,500,600,800,1000"); + m_asSmooth = "20,22.5,25,30,35,40,45,50,60,70,80,100,150,200,300,600"; + m_asFilterTap = "24,48,56,64,72,80,96,128,144,192,256,386,512"; + + sys.m_LogGridWidths = pIniFile->ReadString("Grid", "Log", ""); + sys.m_QSOGridWidths = pIniFile->ReadString("Grid", "QSO", ""); + + KHint->Checked = pIniFile->ReadInteger("Button", "Hint", KHint->Checked); + + sys.m_HTMLHelp = pIniFile->ReadString("Help", "HTML", sys.m_HTMLHelp); + sys.m_Help = pIniFile->ReadString("Help", "MMTTY", sys.m_Help); + sys.m_HelpLog = pIniFile->ReadString("Help", "MMTTYLOG", sys.m_HelpLog); + sys.m_HelpDigital = pIniFile->ReadString("Help", "DIGITAL", sys.m_HelpDigital); + sys.m_HelpFontName = pIniFile->ReadString("Help", "FontName", sys.m_HelpFontName); + sys.m_HelpFontCharset = (BYTE)pIniFile->ReadInteger("Help", "FontCharset", sys.m_HelpFontCharset); + sys.m_HelpFontSize = pIniFile->ReadInteger("Help", "FontSize", sys.m_HelpFontSize); + sys.m_HelpNotePad = pIniFile->ReadInteger("Help", "UseNotePad", sys.m_HelpNotePad); + + sys.m_WindowState = pIniFile->ReadInteger("Window", "WindowState", sys.m_WindowState); + sys.m_DisWindow = pIniFile->ReadInteger("Window", "Disable", sys.m_DisWindow); + sys.m_StayOnTop = pIniFile->ReadInteger("Window", "StayOnTop", sys.m_StayOnTop); + if( Remote ){ + if( !(Remote & REMSHOWOFF) ){ + Top = pIniFile->ReadInteger("Window", "WindowTop", Top); + Left = pIniFile->ReadInteger("Window", "WindowLeft", Left); + if( Remote & REMCTRL ){ + Width = pIniFile->ReadInteger("Window", "WindowWidth", Width); + } + else { + Width = pIniFile->ReadInteger("Window", "WindowWidthS", Width); + } + if( Remote & REMMENU ){ + Height = pIniFile->ReadInteger("Window", "WindowHeightRM", Height); + } + else { + Height = pIniFile->ReadInteger("Window", "WindowHeightR", Height); + } + } + } + else { + KMac->Checked = pIniFile->ReadInteger("Window", "ShowMacro", KMac->Checked); + GroupM->Visible = KMac->Checked; + sys.m_MemWindow = pIniFile->ReadInteger("Window", "MemoryWindow", sys.m_MemWindow); + if( sys.m_MemWindow ){ + Top = pIniFile->ReadInteger("Window", "WindowTopN", Top); + Left = pIniFile->ReadInteger("Window", "WindowLeftN", Left); + Width = pIniFile->ReadInteger("Window", "WindowWidthN", Width); + if( !sys.m_DisWindow ){ + Height = pIniFile->ReadInteger("Window", "WindowHeightN", Height); + } + } + } + + sys.m_WinFontName = pIniFile->ReadString("WindowFont", "Name", sys.m_WinFontName); + sys.m_WinFontCharset = (BYTE)pIniFile->ReadInteger("WindowFont", "Charset", sys.m_WinFontCharset); + sys.m_WinFontStyle = pIniFile->ReadInteger("WindowFont", "Style", sys.m_WinFontStyle); + sys.m_FontAdjSize = pIniFile->ReadInteger("WindowFont", "Adjust", sys.m_FontAdjSize); + sys.m_BtnFontName = pIniFile->ReadString("ButtonFont", "Name", sys.m_BtnFontName); + sys.m_BtnFontCharset = (BYTE)pIniFile->ReadInteger("ButtonFont", "Charset", sys.m_BtnFontCharset); + sys.m_BtnFontStyle = pIniFile->ReadInteger("ButtonFont", "Style", sys.m_BtnFontStyle); + sys.m_BtnFontAdjSize = pIniFile->ReadInteger("ButtonFont", "Adjust", sys.m_BtnFontAdjSize); + + sys.m_FontName = pIniFile->ReadString("Font", "Name", sys.m_FontName); + sys.m_FontSize = pIniFile->ReadInteger("Font", "Size", sys.m_FontSize); + sys.m_FontAdjX = pIniFile->ReadInteger("Font", "AdjX", sys.m_FontAdjX); + sys.m_FontAdjY = pIniFile->ReadInteger("Font", "AdjY", sys.m_FontAdjY); + sys.m_FontCharset = pIniFile->ReadInteger("Font", "Charset", sys.m_FontCharset); + sys.m_FontZero = pIniFile->ReadInteger("Font", "Zero", sys.m_FontZero); + sys.m_FontStyle = pIniFile->ReadInteger("Font", "Style", sys.m_FontStyle); + + KPanel->Checked = pIniFile->ReadInteger("Define", "ControlPanel", 1); + pSound->m_FFTSW = pIniFile->ReadInteger("Define", "FFT", pSound->m_FFTSW); + pSound->m_FFTFW = pIniFile->ReadInteger("Define", "FFTFW", pSound->m_FFTFW); + sys.m_FFTGain = pIniFile->ReadInteger("Define", "FFTGain", sys.m_FFTGain); + sys.m_FFTResp = pIniFile->ReadInteger("Define", "FFTResp", sys.m_FFTResp); + rtty.m_uos = pIniFile->ReadInteger("Define", "UOS", rtty.m_uos); + sys.m_CodeSet = pIniFile->ReadInteger("Define", "CodeSet", sys.m_CodeSet); + pSound->FSKDEM.m_XYScope = pIniFile->ReadInteger("Define", "XYScope", pSound->FSKDEM.m_XYScope); + KXYScope->Checked = pSound->FSKDEM.m_XYScope; + m_XYSize = pIniFile->ReadInteger("Define", "XYScopeSize", m_XYSize); + m_XYQuality = pIniFile->ReadInteger("Define", "XYQuality", m_XYQuality); + sys.m_XYInv = pIniFile->ReadInteger("Define", "XYScopeReverse", sys.m_XYInv); + + m_PanelSize = pIniFile->ReadInteger("Define", "PanelSize", m_PanelSize); + + sys.m_AFC = pIniFile->ReadInteger("Define", "AFC", sys.m_AFC); + sys.m_FixShift = pIniFile->ReadInteger("Define", "AFCFixShift", sys.m_FixShift); + sys.m_AFCSQ = pIniFile->ReadInteger("Define", "AFCSQ", sys.m_AFCSQ); + sys.m_AFCTime = ReadDoubleIniFile(pIniFile, "Define", "AFCTime", sys.m_AFCTime); + sys.m_AFCSweep = ReadDoubleIniFile(pIniFile, "Define", "AFCSweep", sys.m_AFCSweep); + + KENT->Checked = pIniFile->ReadInteger("Define", "AutoCR", KENT->Checked); + KWP->Checked = pIniFile->ReadInteger("Define", "WardWarp", KWP->Checked); + m_SendWay = pIniFile->ReadInteger("Define", "SendWay", m_SendWay); + m_Running = pIniFile->ReadInteger("Define", "Running", m_Running); + m_PttTimer = pIniFile->ReadInteger("Define", "PttTimer", m_PttTimer); + sys.m_TxNet = pIniFile->ReadInteger("Define", "TxNet", sys.m_TxNet); + sys.m_TxDisRev = pIniFile->ReadInteger("Define", "TxDisRev", sys.m_TxDisRev); + sys.m_LimitGain = ReadDoubleIniFile(pIniFile, "Define", "LimitDxGain", sys.m_LimitGain); + pSound->FSKDEM.m_LimitOverSampling = pIniFile->ReadInteger("Define", "LimitOverSampling", pSound->FSKDEM.m_LimitOverSampling); + pSound->FSKDEM.m_LimitAGC = pIniFile->ReadInteger("Define", "LimitAGC", pSound->FSKDEM.m_LimitAGC); + pSound->FSKDEM.m_atc = pIniFile->ReadInteger("Define", "ATC", pSound->FSKDEM.m_atc); + pSound->FSKDEM.m_atcMark.m_Max = pIniFile->ReadInteger("Define", "ATCTime", pSound->FSKDEM.m_atcMark.m_Max); + pSound->FSKDEM.m_atcSpace.m_Max = pSound->FSKDEM.m_atcMark.m_Max; + + pSound->FSKDEM.m_majority = pIniFile->ReadInteger("Define", "Majority", pSound->FSKDEM.m_majority); + pSound->FSKDEM.m_ignoreFream = pIniFile->ReadInteger("Define", "IgnoreFreamError", pSound->FSKDEM.m_ignoreFream); + + pSound->FSKDEM.SetSQ(pIniFile->ReadInteger("Define", "SQ", pSound->FSKDEM.GetSQ())); + pSound->FSKDEM.SetSQLevel(ReadDoubleIniFile(pIniFile, "Define", "SQLevel", pSound->FSKDEM.GetSQLevel())); + + sys.m_DefFix45 = pIniFile->ReadInteger("Define", "DefFix45", sys.m_DefFix45); + sys.m_DefMarkFreq = ReadDoubleIniFile(pIniFile, "Define", "DefMarkFreq", sys.m_DefMarkFreq); + sys.m_DefShift = ReadDoubleIniFile(pIniFile, "Define", "DefShift", sys.m_DefShift); + sys.m_DefStopLen = pIniFile->ReadInteger("Define", "DefStopLen", sys.m_DefStopLen); + pSound->FSKDEM.m_StopLen = sys.m_DefStopLen + 3; + pSound->FSKMOD.m_StopLen = sys.m_DefStopLen + 3; + + pSound->FSKMOD.SetOutputGain(ReadDoubleIniFile(pIniFile, "Define", "OutputGain", pSound->FSKMOD.GetOutputGain())); + + sys.m_Rev = pIniFile->ReadInteger("Define", "Rev", sys.m_Rev); + + sys.m_echo = pIniFile->ReadInteger("Define", "TXLoop", sys.m_echo); + pSound->FSKMOD.m_bpf = pIniFile->ReadInteger("Define", "TXBPF", pSound->FSKMOD.m_bpf); + pSound->FSKMOD.m_bpftap = pIniFile->ReadInteger("Define", "TXBPFTAP", pSound->FSKMOD.m_bpftap); + + pSound->FSKMOD.m_lpf = pIniFile->ReadInteger("Define", "TXLPF", pSound->FSKMOD.m_lpf); + pSound->FSKMOD.SetLPFFreq(ReadDoubleIniFile(pIniFile, "Define", "TXLPFFreq", pSound->FSKMOD.GetLPFFreq())); + + sys.m_LWait = pIniFile->ReadInteger("Define", "TXWaitType", sys.m_LWait); + pSound->FSKMOD.m_CharWait = pIniFile->ReadInteger("Define", "TXCharWait", pSound->FSKMOD.m_CharWait); + pSound->FSKMOD.m_DiddleWait = pIniFile->ReadInteger("Define", "TXDiddleWait", pSound->FSKMOD.m_DiddleWait); + pSound->FSKMOD.m_CharWaitDiddle = pIniFile->ReadInteger("Define", "TXCharWaitDiddle", pSound->FSKMOD.m_CharWaitDiddle); + pSound->FSKMOD.m_RandomDiddle = pIniFile->ReadInteger("Define", "TXRandomDiddle", pSound->FSKMOD.m_RandomDiddle); + pSound->FSKMOD.m_WaitTimer = pIniFile->ReadInteger("Define", "TXWaitTimerDiddle", pSound->FSKMOD.m_WaitTimer); + + pSound->FSKDEM.SetSpaceFreq(ReadDoubleIniFile(pIniFile, "Define", "SpaceFreq", pSound->FSKDEM.GetSpaceFreq())); + pSound->FSKDEM.SetMarkFreq(ReadDoubleIniFile(pIniFile, "Define", "MarkFreq", pSound->FSKDEM.GetMarkFreq())); + pSound->FSKMOD.SetMarkFreq(pSound->FSKDEM.GetSetMarkFreq()); + pSound->FSKMOD.SetSpaceFreq(pSound->FSKDEM.GetSetSpaceFreq()); + m_RxMarkFreq = pSound->FSKDEM.GetMarkFreq(); + m_RxSpaceFreq = pSound->FSKDEM.GetSpaceFreq(); + pSound->m_bpf = pIniFile->ReadInteger("Define", "RXBPF", pSound->m_bpf); + pSound->m_bpftap = pIniFile->ReadInteger("Define", "RXBPFTAP", pSound->m_bpftap); + pSound->m_bpfafc = pIniFile->ReadInteger("Define", "RXBPFAFC", pSound->m_bpfafc); + pSound->m_bpffw = ReadDoubleIniFile(pIniFile, "Define", "RXBPFFW", pSound->m_bpffw); + + pSound->m_lmsbpf = pIniFile->ReadInteger("Define", "RXlms", pSound->m_lmsbpf); + pSound->m_lms.m_lmsDelay = pIniFile->ReadInteger("Define", "RXlmsDelay", pSound->m_lms.m_lmsDelay); + pSound->m_lms.m_lmsMU2 = ReadDoubleIniFile(pIniFile, "Define", "RXlmsMU2", pSound->m_lms.m_lmsMU2); + pSound->m_lms.m_lmsGM = ReadDoubleIniFile(pIniFile, "Define", "RXlmsGM", pSound->m_lms.m_lmsGM); + pSound->m_lms.m_lmsAGC = pIniFile->ReadInteger("Define", "RXlmsAGC", pSound->m_lms.m_lmsAGC); + pSound->m_lms.m_lmsInv = pIniFile->ReadInteger("Define", "RXlmsInv", pSound->m_lms.m_lmsInv); + pSound->m_lms.m_Tap = pIniFile->ReadInteger("Define", "RXlmsTAP", pSound->m_lms.m_Tap); + pSound->m_lms.m_NotchTap = pIniFile->ReadInteger("Define", "RXNotchTAP", pSound->m_lms.m_NotchTap); + pSound->m_lms.m_bpf = pIniFile->ReadInteger("Define", "RXlmsBPF", pSound->m_lms.m_bpf); + pSound->m_lms.m_Type = pIniFile->ReadInteger("Define", "RXlmsType", pSound->m_lms.m_Type); + pSound->m_lms.m_lmsNotch = pIniFile->ReadInteger("Define", "RXlmsNotch", pSound->m_lms.m_lmsNotch); + pSound->m_lms.m_lmsNotch2 = pIniFile->ReadInteger("Define", "RXlmsNotch2", pSound->m_lms.m_lmsNotch2); + pSound->m_lms.m_twoNotch = pIniFile->ReadInteger("Define", "RXlmsTwoNotch", pSound->m_lms.m_twoNotch); + if( !pSound->m_lmsbpf && pSound->m_lms.m_twoNotch ) pSound->m_lms.m_lmsNotch = pSound->m_lms.m_lmsNotch2 = 0; + + pSound->CalcBPF(); + + int verfftdem = pIniFile->ReadInteger("Define", "VERFFTDEM", 0); + pSound->FSKDEM.m_type = pIniFile->ReadInteger("Define", "DEMTYPE", pSound->FSKDEM.m_type); + pSound->FSKDEM.SetBaudRate(ReadDoubleIniFile(pIniFile, "Define", "BaudRate", pSound->FSKDEM.GetBaudRate())); + pSound->FSKDEM.m_lpf = pIniFile->ReadInteger("Define", "SmoozType", pSound->FSKDEM.m_lpf); + pSound->FSKDEM.m_Phase.m_TONES = pIniFile->ReadInteger("Define", "FFTTones", pSound->FSKDEM.m_Phase.m_TONES); + if( verfftdem < VERFFTDEM ){ + pSound->FSKDEM.m_Phase.m_TONES = 4; + } + pSound->FSKDEM.m_lpfOrder = pIniFile->ReadInteger("Define", "SmoozOrder", pSound->FSKDEM.m_lpfOrder); + pSound->FSKDEM.SetLPFFreq(ReadDoubleIniFile(pIniFile, "Define", "SmoozIIR", pSound->FSKDEM.m_lpffreq)); + pSound->FSKDEM.SetSmoozFreq(ReadDoubleIniFile(pIniFile, "Define", "Smooz", pSound->FSKDEM.GetSmoozFreq())); + sys.m_SoundFifoRX = pIniFile->ReadInteger("Define", "SoundRxFifo", sys.m_SoundFifoRX ); + sys.m_SoundFifoTX = pIniFile->ReadInteger("Define", "SoundTxFifo", sys.m_SoundFifoTX ); + if( sys.m_SoundFifoRX > WAVE_FIFO_MAX ) sys.m_SoundFifoRX = WAVE_FIFO_MAX; + if( sys.m_SoundFifoTX > WAVE_FIFO_MAX ) sys.m_SoundFifoTX = WAVE_FIFO_MAX; + sys.m_SoundPriority = pIniFile->ReadInteger("Define", "SoundPriority", sys.m_SoundPriority); + sys.m_SoundDevice = pIniFile->ReadInteger("Define", "SoundDevice", sys.m_SoundDevice); + sys.m_SoundOutDevice = pIniFile->ReadInteger("Define", "SoundOutDevice", sys.m_SoundDevice); //AA6YQ 1.66 + sys.m_SoundMMW = pIniFile->ReadString("Define", "SoundMMW", sys.m_SoundMMW); + pSound->m_IDDevice = sys.m_SoundDevice; + pSound->m_IDOutDevice=sys.m_SoundOutDevice; + sys.m_SoundStereo = pIniFile->ReadInteger("Define", "SoundStereo", sys.m_SoundStereo); + pSound->InitWFX(); + pSound->FSKDEM.SetFilterTap(pIniFile->ReadInteger("Define", "Tap", pSound->FSKDEM.GetFilterTap())); + pSound->FSKDEM.m_iirfw = pIniFile->ReadInteger("Define", "IIRBW", pSound->FSKDEM.m_iirfw); + pSound->FSKDEM.SetIIR(pSound->FSKDEM.m_iirfw); + + pSound->FSKDEM.m_pll.SetVcoGain(ReadDoubleIniFile(pIniFile, "Define", "pllVcoGain", pSound->FSKDEM.m_pll.m_vcogain)); + pSound->FSKDEM.m_pll.m_loopOrder = pIniFile->ReadInteger("Define", "pllLoopOrder", pSound->FSKDEM.m_pll.m_loopOrder); + pSound->FSKDEM.m_pll.m_loopFC = ReadDoubleIniFile(pIniFile, "Define", "pllLoopFC", pSound->FSKDEM.m_pll.m_loopFC); + pSound->FSKDEM.m_pll.m_outOrder = pIniFile->ReadInteger("Define", "pllOutOrder", pSound->FSKDEM.m_pll.m_outOrder); + pSound->FSKDEM.m_pll.m_outFC = ReadDoubleIniFile(pIniFile, "Define", "pllOutFC", pSound->FSKDEM.m_pll.m_outFC); + pSound->FSKDEM.m_pll.MakeLoopLPF(); + pSound->FSKDEM.m_pll.MakeOutLPF(); + + pSound->FSKMOD.m_diddle = pIniFile->ReadInteger("Define", "Diddle", pSound->FSKMOD.m_diddle); + + sys.m_TxPort = pIniFile->ReadInteger("Define", "TxPort", sys.m_TxPort); + sys.m_TxdJob = pIniFile->ReadInteger("Define", "TxdJob", sys.m_TxdJob); + sys.m_TxFixShift = pIniFile->ReadInteger("Define", "TxFixShift", sys.m_TxFixShift); + sys.m_TxRxName = pIniFile->ReadString("Define", "PTT", sys.m_TxRxName); + sys.m_TxRxInv = pIniFile->ReadInteger("Define", "InvPTT", sys.m_TxRxInv); + sys.m_txuos = pIniFile->ReadInteger("Define", "TXUOS", sys.m_txuos); + sys.m_MacroImm = pIniFile->ReadInteger("Define", "MacroImm", sys.m_MacroImm); + sys.m_CharLenFile = pIniFile->ReadInteger("Define", "CharLenFile", sys.m_CharLenFile); + sys.m_DisTX = pIniFile->ReadInteger("Define", "DisTX", sys.m_DisTX); + + sys.m_Call = pIniFile->ReadString("Define", "Call", sys.m_Call); + + sys.m_log = pIniFile->ReadInteger("Log", "Switch", sys.m_log); + sys.m_logTimeStamp = pIniFile->ReadInteger("Log", "TimeStamp", sys.m_logTimeStamp); + sys.m_TimeStampUTC = pIniFile->ReadInteger("Log", "TimeStampUTC", sys.m_TimeStampUTC); + sys.m_AutoTimeOffset = pIniFile->ReadInteger("Log", "AutoUTCOffset", sys.m_AutoTimeOffset); + sys.m_TimeOffset = pIniFile->ReadInteger("Log", "UTCOffset", sys.m_TimeOffset); + sys.m_TimeOffsetMin = pIniFile->ReadInteger("Log", "UTCOffsetMin", sys.m_TimeOffsetMin); + sys.m_LogLink = pIniFile->ReadInteger("Log", "LogLink", sys.m_LogLink); + LogLink.LoadMMLink(pIniFile); + LogLink.SetPolling(pIniFile->ReadInteger("Log", "LinkPoll", 0)); + LogLink.SetPTTEnabled(pIniFile->ReadInteger("Log", "LinkPTT", FALSE)); + as = pIniFile->ReadString("Log", "PathName", LogDir); + + strcpy(LogDir, as.c_str()); + as = pIniFile->ReadString("Dir", "OutFile", OutFileDir); + strcpy(OutFileDir, as.c_str()); + + sys.m_ShowTimeStamp = pIniFile->ReadInteger("Log", "ShowTimeStamp", sys.m_ShowTimeStamp); + + Log.m_FileName = pIniFile->ReadString("LogFile", "Name", Log.m_FileName); + Log.MakeName(Log.m_FileName.c_str()); + + sys.m_Palette = pIniFile->ReadInteger("WaterFall", "Palette", sys.m_Palette); + + + PanelIn->Height = pIniFile->ReadInteger("Input", "Height", PanelIn->Height); + + sys.m_ColorRXBack = (TColor)pIniFile->ReadInteger("Color", "RXBack", sys.m_ColorRXBack); + sys.m_ColorRX = (TColor)pIniFile->ReadInteger("Color", "RXChar", sys.m_ColorRX); + sys.m_ColorRXTX = (TColor)pIniFile->ReadInteger("Color", "RXTXChar", sys.m_ColorRX); + sys.m_ColorINBack = (TColor)pIniFile->ReadInteger("Color", "INBack", sys.m_ColorINBack); + sys.m_ColorIN = (TColor)pIniFile->ReadInteger("Color", "INChar", sys.m_ColorIN); + sys.m_ColorINTX = (TColor)pIniFile->ReadInteger("Color", "INTXChar", sys.m_ColorINTX); + + sys.m_ColorLow = (TColor)pIniFile->ReadInteger("Color", "WaterLow", sys.m_ColorLow); + sys.m_ColorHigh = (TColor)pIniFile->ReadInteger("Color", "WaterHigh", sys.m_ColorHigh); + + sys.m_ColorXY = (TColor)pIniFile->ReadInteger("Color", "XYScope", sys.m_ColorXY); + + + int i; + for(i = 0; i < kkEOF; i++ ){ + sprintf(bf, "S%d", i+1); + sys.m_SysKey[i] = (WORD)pIniFile->ReadInteger("SysKey", bf, sys.m_SysKey[i]); + } + for(i = 0; i < 4; i++ ){ + sprintf(bf, "M%d", i+1); + sys.m_InBtnCol[i] = (TColor)pIniFile->ReadInteger("InBtnCol", bf, sys.m_InBtnCol[i]); + sys.m_InBtnKey[i] = (WORD)pIniFile->ReadInteger("InBtnKey", bf, sys.m_InBtnKey[i]); + sys.m_InBtnName[i] = pIniFile->ReadString("InBtnName", bf, sys.m_InBtnName[i]); + CrLf2Yen(ws, sys.m_InBtn[i]); + as = pIniFile->ReadString("InBtn", bf, ws); + Yen2CrLf(sys.m_InBtn[i], as); + } + + for( i = 0; i < 16; i++ ){ + sprintf(bf, "M%d", i+1); + sys.m_UserTimer[i] = pIniFile->ReadInteger("MacroTimer", bf, sys.m_UserTimer[i]); + sys.m_UserCol[i] = (TColor)pIniFile->ReadInteger("MacroCol", bf, sys.m_UserCol[i]); + sys.m_UserKey[i] = (WORD)pIniFile->ReadInteger("MacroKey", bf, sys.m_UserKey[i]); + sys.m_UserEditKey[i] = (WORD)pIniFile->ReadInteger("MacroEditKey", bf, sys.m_UserEditKey[i]); + sys.m_UserName[i] = pIniFile->ReadString("MacroName", bf, sys.m_UserName[i]); + CrLf2Yen(ws, sys.m_User[i]); + as = pIniFile->ReadString("Macro", bf, ws); + Yen2CrLf(sys.m_User[i], as); + } + for( i = 0; i < MSGLISTMAX; i++ ){ + sprintf(bf, "M%d", i+1); + sys.m_MsgKey[i] = (WORD)pIniFile->ReadInteger("MsgKey", bf, sys.m_MsgKey[i]); + sys.m_MsgName[i] = pIniFile->ReadString("MsgName", bf, sys.m_MsgName[i]); + if( !sys.m_MsgName[i].IsEmpty() ){ + CrLf2Yen(ws, sys.m_MsgList[i]); + as = pIniFile->ReadString("MsgList", bf, ws); + if( as.IsEmpty() ) break; + Yen2CrLf(sys.m_MsgList[i], as); + } + } + for( ; i < MSGLISTMAX; i++ ){ + sys.m_MsgKey[i] = 0; + sys.m_MsgName[i] = ""; + } + + as = pIniFile->ReadString("Dir", "ExtLog", ExtLogDir); + strcpy(ExtLogDir, as.c_str()); + for( i = 0; i < TEXTCONVMAX; i++ ){ + sprintf(bf, "WDEF%d", i+1); + LogText.m_tConv[i].Key = pIniFile->ReadString("ExtConv", bf, LogText.m_tConv[i].Key); + sprintf(bf, "WLEN%d", i+1); + LogText.m_tConv[i].w = pIniFile->ReadInteger("ExtConv", bf, LogText.m_tConv[i].w); + } + for( i = 0; i < TEXTCONVMAX; i++ ){ + sprintf(bf, "RDEF%d", i+1); + LogText.m_rConv[i].Key = pIniFile->ReadString("ExtConv", bf, LogText.m_rConv[i].Key); + sprintf(bf, "RLEN%d", i+1); + LogText.m_rConv[i].w = pIniFile->ReadInteger("ExtConv", bf, LogText.m_rConv[i].w); + } + as = pIniFile->ReadString("Dir", "RecSound", RecDir); + strcpy(RecDir, as.c_str()); + + for( i = 0; i < RECMENUMAX; i++ ){ + sprintf(bf, "File%d", i + 1); + as = pIniFile->ReadString("Recent File", bf, ""); + RecentMenu.SetItemText(i, as.c_str()); + } + Log.ReadIniFile("LogSet", pIniFile); + + KExtCmd1->Caption = pIniFile->ReadString("Program", "Name1", KExtCmd1->Caption); + sys.m_ExtCmd[0] = pIniFile->ReadString("Program", "Command1", sys.m_ExtCmd[0]); + KExtCmd2->Caption = pIniFile->ReadString("Program", "Name2", KExtCmd2->Caption); + sys.m_ExtCmd[1] = pIniFile->ReadString("Program", "Command2", sys.m_ExtCmd[1]); + KExtCmd3->Caption = pIniFile->ReadString("Program", "Name3", KExtCmd3->Caption); + sys.m_ExtCmd[2] = pIniFile->ReadString("Program", "Command3", sys.m_ExtCmd[2]); + KExtCmd4->Caption = pIniFile->ReadString("Program", "Name4", KExtCmd4->Caption); + sys.m_ExtCmd[3] = pIniFile->ReadString("Program", "Command4", sys.m_ExtCmd[3]); + UpdateExtProgram(); + LoadTNCSetup(pIniFile); + LoadRADIOSetup(pIniFile); + + if( !Remote ){ + for( i = 0; i < CALLLISTMAX; i++ ){ + sprintf(bf, "Item%d", i+1); + as = pIniFile->ReadString("Calls", bf, ""); + if( as.IsEmpty() ) break; + LPSTR p; + for( p = as.c_str(); *p; p++ ){ + if( *p == '_' ) *p = '\t'; + } + TMenuItem *pm = new TMenuItem(this); + pm->Caption = as.c_str(); + pm->RadioItem = FALSE; + pm->OnClick = KCClick; + pm->Checked = FALSE; + pm->Enabled = TRUE; + PopupC->Items->Add(pm); + } + } + +//AA6YQ option, Added by JE3HHT on Sep.2010 + CAA6YQ *pAA6YQ = &pSound->FSKDEM.m_AA6YQ; + pAA6YQ->m_fEnabled = pIniFile->ReadInteger("AA6YQ", "Enabled", pAA6YQ->m_fEnabled); + pAA6YQ->m_bpfTaps = pIniFile->ReadInteger("AA6YQ", "TapsBPF", pAA6YQ->m_bpfTaps); + pAA6YQ->m_bpfFW = ReadDoubleIniFile(pIniFile, "AA6YQ", "WidthBPF", pAA6YQ->m_bpfFW); + pAA6YQ->m_befTaps = pIniFile->ReadInteger("AA6YQ", "TapsBEF", pAA6YQ->m_befTaps); + pAA6YQ->m_befFW = ReadDoubleIniFile(pIniFile, "AA6YQ", "WidthBEF", pAA6YQ->m_befFW); + pAA6YQ->m_afcERR = ReadDoubleIniFile(pIniFile, "AA6YQ", "afcERR", pAA6YQ->m_afcERR); + int verAA6YQ = pIniFile->ReadInteger("AA6YQ", "Version", 0); + if( verAA6YQ < VERAA6YQ ){ + pAA6YQ->m_bpfTaps = 512; + pAA6YQ->m_befTaps = 256; + } + if( pAA6YQ->m_fEnabled ) pAA6YQ->Create(); + delete pIniFile; +} + +//--------------------------------------------------------------------------- +// ƒŒƒWƒXƒgƒŠ‚Ö‚Ì‘‚«ž‚Ý +void __fastcall TMmttyWd::WriteRegister(void) +{ + char bf[256]; + sprintf(bf, "%sMmtty.ini", BgnDir); + + try{ + + TMemIniFile *pIniFile = new TMemIniFile(bf); + + WriteDoubleIniFile(pIniFile, "SoundCard", "SampFreq", sys.m_SampFreq); + WriteDoubleIniFile(pIniFile, "SoundCard", "TxOffset", sys.m_TxOffset); + + AnsiString as; + GetComboBox(as, MarkFreq); + if( !as.IsEmpty() ) pIniFile->WriteString("ComboList", "Mark", as); + GetComboBox(as, ShiftFreq); + if( !as.IsEmpty() ) pIniFile->WriteString("ComboList", "Shift", as); + if( !as.IsEmpty() ) pIniFile->WriteString("ComboList", "Baud", m_asBaud); + GetComboBox(as, HisRST); + if( !as.IsEmpty() ) pIniFile->WriteString("ComboList", "RST", as); + if( !as.IsEmpty() ) pIniFile->WriteString("ComboList", "IIRBW", m_asIIRBW); + if( !as.IsEmpty() ) pIniFile->WriteString("ComboList", "VCO", m_asVCOGain); + if( !as.IsEmpty() ) pIniFile->WriteString("ComboList", "LoopFC", m_asLoopFC); + + pIniFile->WriteString("Grid", "Log", sys.m_LogGridWidths); + pIniFile->WriteString("Grid", "QSO", sys.m_QSOGridWidths); + + pIniFile->WriteString("Help", "HTML", sys.m_HTMLHelp); + pIniFile->WriteString("Help", "MMTTY", sys.m_Help); + pIniFile->WriteString("Help", "MMTTYLOG", sys.m_HelpLog); + pIniFile->WriteString("Help", "DIGITAL", sys.m_HelpDigital); + pIniFile->WriteString("Help", "FontName", sys.m_HelpFontName); + pIniFile->WriteInteger("Help", "FontCharset", sys.m_HelpFontCharset); + pIniFile->WriteInteger("Help", "FontSize", sys.m_HelpFontSize); + pIniFile->WriteInteger("Help", "UseNotePad", sys.m_HelpNotePad); + + if( Remote ){ + if( !(Remote & REMSHOWOFF) ){ + pIniFile->WriteInteger("Window", "WindowTop", Top); + pIniFile->WriteInteger("Window", "WindowLeft", Left); + if( Remote & REMCTRL ){ + pIniFile->WriteInteger("Window", "WindowWidth", Width); + } + else { + pIniFile->WriteInteger("Window", "WindowWidthS", Width); + } + if( Remote & REMMENU ){ + pIniFile->WriteInteger("Window", "WindowHeightRM", Height); + } + else { + pIniFile->WriteInteger("Window", "WindowHeightR", Height); + } + } + } + else { + pIniFile->WriteInteger("Window", "WindowState", WindowState); + pIniFile->WriteInteger("Window", "ShowMacro", KMac->Checked); + pIniFile->WriteInteger("Window", "MemoryWindow", sys.m_MemWindow); + if( (WindowState == wsNormal) && sys.m_MemWindow ){ + pIniFile->WriteInteger("Window", "WindowTopN", Top); + pIniFile->WriteInteger("Window", "WindowLeftN", Left); + pIniFile->WriteInteger("Window", "WindowWidthN", Width); + if( !sys.m_DisWindow ){ + pIniFile->WriteInteger("Window", "WindowHeightN", Height); + } + } + } + pIniFile->WriteInteger("Window", "Disable", sys.m_DisWindow); + pIniFile->WriteInteger("Window", "StayOnTop", sys.m_StayOnTop); + + pIniFile->WriteString("WindowFont", "Name", sys.m_WinFontName); + pIniFile->WriteInteger("WindowFont", "Charset", sys.m_WinFontCharset); + pIniFile->WriteInteger("WindowFont", "Style", sys.m_WinFontStyle); + pIniFile->WriteInteger("WindowFont", "Adjust", sys.m_FontAdjSize); + pIniFile->WriteString("ButtonFont", "Name", sys.m_BtnFontName); + pIniFile->WriteInteger("ButtonFont", "Charset", sys.m_BtnFontCharset); + pIniFile->WriteInteger("ButtonFont", "Style", sys.m_BtnFontStyle); + pIniFile->WriteInteger("ButtonFont", "Adjust", sys.m_BtnFontAdjSize); + + pIniFile->WriteString("Font", "Name", sys.m_FontName); + pIniFile->WriteInteger("Font", "Size", sys.m_FontSize); + pIniFile->WriteInteger("Font", "AdjX", sys.m_FontAdjX); + pIniFile->WriteInteger("Font", "AdjY", sys.m_FontAdjY); + pIniFile->WriteInteger("Font", "Charset", sys.m_FontCharset); + pIniFile->WriteInteger("Font", "Zero", sys.m_FontZero); + pIniFile->WriteInteger("Font", "Style", sys.m_FontStyle); + + pIniFile->WriteInteger("Define", "ControlPanel", KPanel->Checked); + pIniFile->WriteInteger("Button", "Hint", KHint->Checked); + pIniFile->WriteInteger("Define", "FFT", pSound->m_FFTSW); + pIniFile->WriteInteger("Define", "FFTFW", pSound->m_FFTFW); + pIniFile->WriteInteger("Define", "FFTGain", sys.m_FFTGain); + pIniFile->WriteInteger("Define", "FFTResp", sys.m_FFTResp); + pIniFile->WriteInteger("Define", "UOS", rtty.m_uos); + pIniFile->WriteInteger("Define", "CodeSet", sys.m_CodeSet); + pIniFile->WriteInteger("Define", "XYScope", pSound->FSKDEM.m_XYScope); + pIniFile->WriteInteger("Define", "XYScopeSize", m_XYSize); + pIniFile->WriteInteger("Define", "XYScopeReverse", sys.m_XYInv); + pIniFile->WriteInteger("Define", "XYQuality", m_XYQuality); + pIniFile->WriteInteger("Define", "PanelSize", m_PanelSize); + + pIniFile->WriteInteger("Define", "AFC", sys.m_AFC); + pIniFile->WriteInteger("Define", "AFCFixShift", sys.m_FixShift); + pIniFile->WriteInteger("Define", "AFCSQ", sys.m_AFCSQ); + WriteDoubleIniFile(pIniFile, "Define", "AFCTime", sys.m_AFCTime); + WriteDoubleIniFile(pIniFile, "Define", "AFCSweep", sys.m_AFCSweep); + + pIniFile->WriteInteger("Define", "AutoCR", KENT->Checked); + pIniFile->WriteInteger("Define", "WardWarp", KWP->Checked); + pIniFile->WriteInteger("Define", "SendWay", m_SendWay); + pIniFile->WriteInteger("Define", "Running", m_Running); + pIniFile->WriteInteger("Define", "PttTimer", m_PttTimer); + pIniFile->WriteInteger("Define", "TxNet", sys.m_TxNet); + pIniFile->WriteInteger("Define", "TxDisRev", sys.m_TxDisRev); + WriteDoubleIniFile(pIniFile, "Define", "LimitDxGain", sys.m_LimitGain); + pIniFile->WriteInteger("Define", "LimitOverSampling", pSound->FSKDEM.m_LimitOverSampling); + pIniFile->WriteInteger("Define", "LimitAGC", pSound->FSKDEM.m_LimitAGC); + pIniFile->WriteInteger("Define", "ATC", pSound->FSKDEM.m_atc); + pIniFile->WriteInteger("Define", "ATCTime", pSound->FSKDEM.m_atcMark.m_Max); + + pIniFile->WriteInteger("Define", "Majority", pSound->FSKDEM.m_majority); + pIniFile->WriteInteger("Define", "IgnoreFreamError", pSound->FSKDEM.m_ignoreFream); + + pIniFile->WriteInteger("Define", "SQ", pSound->FSKDEM.GetSQ()); + WriteDoubleIniFile(pIniFile, "Define", "SQLevel", pSound->FSKDEM.GetSQLevel()); + + + pIniFile->WriteInteger("Define", "DefFix45", sys.m_DefFix45); + WriteDoubleIniFile(pIniFile, "Define", "DefMarkFreq", sys.m_DefMarkFreq); + WriteDoubleIniFile(pIniFile, "Define", "DefShift", sys.m_DefShift); + pIniFile->WriteInteger("Define", "DefStopLen", sys.m_DefStopLen); + + WriteDoubleIniFile(pIniFile, "Define", "OutputGain", pSound->FSKMOD.GetOutputGain()); + + pIniFile->WriteInteger("Define", "Rev", sys.m_Rev); + + + WriteDoubleIniFile(pIniFile, "Define", "SpaceFreq", pSound->FSKDEM.GetSpaceFreq()); + WriteDoubleIniFile(pIniFile, "Define", "MarkFreq", pSound->FSKDEM.GetMarkFreq()); + + pIniFile->WriteInteger("Define", "VERFFTDEM", VERFFTDEM); + pIniFile->WriteInteger("Define", "DEMTYPE", pSound->FSKDEM.m_type); + WriteDoubleIniFile(pIniFile, "Define", "BaudRate", pSound->FSKDEM.GetBaudRate()); + pIniFile->WriteInteger("Define", "SmoozType", pSound->FSKDEM.m_lpf); + pIniFile->WriteInteger("Define", "SmoozOrder", pSound->FSKDEM.m_lpfOrder); + WriteDoubleIniFile(pIniFile, "Define", "SmoozIIR", pSound->FSKDEM.m_lpffreq); + WriteDoubleIniFile(pIniFile, "Define", "Smooz", pSound->FSKDEM.GetSmoozFreq()); + pIniFile->WriteInteger("Define", "FFTTones", pSound->FSKDEM.m_Phase.m_TONES); + pIniFile->WriteInteger("Define", "SoundRxFifo", sys.m_SoundFifoRX ); + pIniFile->WriteInteger("Define", "SoundTxFifo", sys.m_SoundFifoTX ); + pIniFile->WriteInteger("Define", "SoundPriority", sys.m_SoundPriority); + pIniFile->WriteInteger("Define", "SoundDevice", sys.m_SoundDevice); + pIniFile->WriteInteger("Define", "SoundOutDevice", sys.m_SoundOutDevice); //AA6YQ 1.66 + pIniFile->WriteInteger("Define", "SoundStereo", sys.m_SoundStereo); + pIniFile->WriteString("Define", "SoundMMW", sys.m_SoundMMW); + + pIniFile->WriteInteger("Define", "Tap", pSound->FSKDEM.GetFilterTap()); + pIniFile->WriteInteger("Define", "IIRBW", pSound->FSKDEM.m_iirfw); + + pIniFile->WriteInteger("Define", "Diddle", pSound->FSKMOD.m_diddle); + + pIniFile->WriteInteger("Define", "TxPort", sys.m_TxPort); + pIniFile->WriteInteger("Define", "TxdJob", sys.m_TxdJob); + pIniFile->WriteInteger("Define", "TxFixShift", sys.m_TxFixShift); + pIniFile->WriteString("Define", "PTT", sys.m_TxRxName); + pIniFile->WriteInteger("Define", "InvPTT", sys.m_TxRxInv); + pIniFile->WriteInteger("Define", "TXUOS", sys.m_txuos); + pIniFile->WriteInteger("Define", "MacroImm", sys.m_MacroImm); + pIniFile->WriteInteger("Define", "CharLenFile", sys.m_CharLenFile); + pIniFile->WriteInteger("Define", "DisTX", (sys.m_DisTX & 2) ? sys.m_DisTX : 0); + pIniFile->WriteInteger("Define", "TXLoop", sys.m_echo); + pIniFile->WriteInteger("Define", "TXBPF", pSound->FSKMOD.m_bpf); + pIniFile->WriteInteger("Define", "TXBPFTAP", pSound->FSKMOD.m_bpftap); + + pIniFile->WriteInteger("Define", "TXLPF", pSound->FSKMOD.m_lpf); + WriteDoubleIniFile(pIniFile, "Define", "TXLPFFreq", pSound->FSKMOD.GetLPFFreq()); + + pIniFile->WriteInteger("Define", "TXWaitType", sys.m_LWait); + pIniFile->WriteInteger("Define", "TXCharWait", pSound->FSKMOD.m_CharWait); + pIniFile->WriteInteger("Define", "TXDiddleWait", pSound->FSKMOD.m_DiddleWait); + pIniFile->WriteInteger("Define", "TXCharWaitDiddle", pSound->FSKMOD.m_CharWaitDiddle); + pIniFile->WriteInteger("Define", "TXRandomDiddle", pSound->FSKMOD.m_RandomDiddle); + pIniFile->WriteInteger("Define", "TXWaitTimerDiddle", pSound->FSKMOD.m_WaitTimer); + + pIniFile->WriteInteger("Define", "RXBPF", pSound->m_bpf); + pIniFile->WriteInteger("Define", "RXBPFTAP", pSound->m_bpftap); + pIniFile->WriteInteger("Define", "RXBPFAFC", pSound->m_bpfafc); + WriteDoubleIniFile(pIniFile, "Define", "RXBPFFW", pSound->m_bpffw); + + pIniFile->WriteInteger("Define", "RXlms", pSound->m_lmsbpf); + pIniFile->WriteInteger("Define", "RXlmsDelay", pSound->m_lms.m_lmsDelay); + WriteDoubleIniFile(pIniFile, "Define", "RXlmsMU2", pSound->m_lms.m_lmsMU2); + WriteDoubleIniFile(pIniFile, "Define", "RXlmsGM", pSound->m_lms.m_lmsGM); + pIniFile->WriteInteger("Define", "RXlmsInv", pSound->m_lms.m_lmsInv); + pIniFile->WriteInteger("Define", "RXlmsAGC", pSound->m_lms.m_lmsAGC); + pIniFile->WriteInteger("Define", "RXlmsTAP", pSound->m_lms.m_Tap); + pIniFile->WriteInteger("Define", "RXNotchTAP", pSound->m_lms.m_NotchTap); + pIniFile->WriteInteger("Define", "RXlmsBPF", pSound->m_lms.m_bpf); + pIniFile->WriteInteger("Define", "RXlmsType", pSound->m_lms.m_Type); + pIniFile->WriteInteger("Define", "RXlmsNotch", pSound->m_lms.m_lmsNotch); + pIniFile->WriteInteger("Define", "RXlmsNotch2", pSound->m_lms.m_lmsNotch2); + pIniFile->WriteInteger("Define", "RXlmsTwoNotch", pSound->m_lms.m_twoNotch); + + WriteDoubleIniFile(pIniFile, "Define", "pllVcoGain", pSound->FSKDEM.m_pll.m_vcogain); + pIniFile->WriteInteger("Define", "pllLoopOrder", pSound->FSKDEM.m_pll.m_loopOrder); + WriteDoubleIniFile(pIniFile, "Define", "pllLoopFC", pSound->FSKDEM.m_pll.m_loopFC); + pIniFile->WriteInteger("Define", "pllOutOrder", pSound->FSKDEM.m_pll.m_outOrder); + WriteDoubleIniFile(pIniFile, "Define", "pllOutFC", pSound->FSKDEM.m_pll.m_outFC); + + pIniFile->WriteString("Define", "Call", sys.m_Call); + + pIniFile->WriteInteger("Log", "Switch", sys.m_log); + pIniFile->WriteInteger("Log", "TimeStamp", sys.m_logTimeStamp); + pIniFile->WriteInteger("Log", "TimeStampUTC", sys.m_TimeStampUTC); + pIniFile->WriteInteger("Log", "AutoUTCOffset", sys.m_AutoTimeOffset); + pIniFile->WriteInteger("Log", "UTCOffset", sys.m_TimeOffset); + pIniFile->WriteInteger("Log", "UTCOffsetMin", sys.m_TimeOffsetMin); + pIniFile->WriteInteger("Log", "LogLink", sys.m_LogLink); + pIniFile->WriteInteger("Log", "LinkPoll", LogLink.IsPolling()); + pIniFile->WriteInteger("Log", "LinkPTT", LogLink.GetPTTEnabled()); + LogLink.SaveMMLink(pIniFile); + pIniFile->WriteString("Log", "PathName", LogDir); + + pIniFile->WriteString("Dir", "OutFile", OutFileDir); + + pIniFile->WriteInteger("Log", "ShowTimeStamp", sys.m_ShowTimeStamp); + + pIniFile->WriteString("LogFile", "Name", Log.m_FileName); + + + pIniFile->WriteInteger("WaterFall", "Palette", sys.m_Palette); + + pIniFile->WriteInteger("Input", "Height", PanelIn->Height); + + pIniFile->WriteInteger("Color", "RXBack", sys.m_ColorRXBack); + pIniFile->WriteInteger("Color", "RXChar", sys.m_ColorRX); + pIniFile->WriteInteger("Color", "RXTXChar", sys.m_ColorRXTX); + pIniFile->WriteInteger("Color", "INBack", sys.m_ColorINBack); + pIniFile->WriteInteger("Color", "INChar", sys.m_ColorIN); + pIniFile->WriteInteger("Color", "INTXChar", sys.m_ColorINTX); + + pIniFile->WriteInteger("Color", "WaterLow", sys.m_ColorLow); + pIniFile->WriteInteger("Color", "WaterHigh", sys.m_ColorHigh); + pIniFile->WriteInteger("Color", "XYScope", sys.m_ColorXY); + + AnsiString ws; + + int i; + for(i = 0; i < kkEOF; i++ ){ + sprintf(bf, "S%d", i+1); + pIniFile->WriteInteger("SysKey", bf, sys.m_SysKey[i]); + } + for(i = 0; i < 4; i++ ){ + sprintf(bf, "M%d", i+1); + pIniFile->WriteInteger("InBtnCol", bf, sys.m_InBtnCol[i]); + pIniFile->WriteInteger("InBtnKey", bf, sys.m_InBtnKey[i]); + pIniFile->WriteString("InBtnName", bf, sys.m_InBtnName[i]); + CrLf2Yen(ws, sys.m_InBtn[i]); + pIniFile->WriteString("InBtn", bf, ws); + } + + for( i = 0; i < 16; i++ ){ + sprintf(bf, "M%d", i+1); + pIniFile->WriteInteger("MacroTimer", bf, sys.m_UserTimer[i]); + pIniFile->WriteInteger("MacroCol", bf, sys.m_UserCol[i]); + pIniFile->WriteInteger("MacroKey", bf, sys.m_UserKey[i]); + pIniFile->WriteInteger("MacroEditKey", bf, sys.m_UserEditKey[i]); + pIniFile->WriteString("MacroName", bf, sys.m_UserName[i]); + CrLf2Yen(ws, sys.m_User[i]); + pIniFile->WriteString("Macro", bf, ws); + } + + for( i = 0; i < MSGLISTMAX; i++ ){ + sprintf(bf, "M%d", i+1); + pIniFile->WriteInteger("MsgKey", bf, sys.m_MsgKey[i]); + if( !sys.m_MsgName[i].IsEmpty() ){ + pIniFile->WriteString("MsgName", bf, sys.m_MsgName[i]); + CrLf2Yen(ws, sys.m_MsgList[i]); + pIniFile->WriteString("MsgList", bf, ws); + } + else { // Á‹Ž—p + pIniFile->WriteString("MsgList", bf, ""); + pIniFile->WriteString("MsgName", bf, ""); + break; + } + } + pIniFile->WriteString("Dir", "ExtLog", ExtLogDir); + for( i = 0; i < TEXTCONVMAX; i++ ){ + sprintf(bf, "WDEF%d", i+1); + pIniFile->WriteString("ExtConv", bf, LogText.m_tConv[i].Key); + sprintf(bf, "WLEN%d", i+1); + pIniFile->WriteInteger("ExtConv", bf, LogText.m_tConv[i].w); + } + for( i = 0; i < TEXTCONVMAX; i++ ){ + sprintf(bf, "RDEF%d", i+1); + pIniFile->WriteString("ExtConv", bf, LogText.m_rConv[i].Key); + sprintf(bf, "RLEN%d", i+1); + pIniFile->WriteInteger("ExtConv", bf, LogText.m_rConv[i].w); + } + pIniFile->WriteString("Dir", "RecSound", RecDir); + for( i = 0; i < RecentMenu.GetCount(); i++ ){ + sprintf(bf, "File%d", i + 1); + pIniFile->WriteString("Recent File", bf, RecentMenu.GetItemText(i)); + } + Log.WriteIniFile("LogSet", pIniFile); + + pIniFile->WriteString("Program", "Name1", KExtCmd1->Caption); + pIniFile->WriteString("Program", "Command1", sys.m_ExtCmd[0]); + pIniFile->WriteString("Program", "Name2", KExtCmd2->Caption); + pIniFile->WriteString("Program", "Command2", sys.m_ExtCmd[1]); + pIniFile->WriteString("Program", "Name3", KExtCmd3->Caption); + pIniFile->WriteString("Program", "Command3", sys.m_ExtCmd[2]); + pIniFile->WriteString("Program", "Name4", KExtCmd4->Caption); + pIniFile->WriteString("Program", "Command4", sys.m_ExtCmd[3]); + + SaveTNCSetup(pIniFile); + SaveRADIOSetup(pIniFile); + + if( !Remote ){ + for( i = 0; i < PopupC->Items->Count; i++ ){ + sprintf(bf, "Item%d", i+1); + char bbf[64]; + StrCopy(bbf, AnsiString(PopupC->Items->Items[i]->Caption).c_str(), 63); //JA7UDE 0427 + LPSTR p; + for( p = bbf; *p; p++ ){ + if( *p == '\t' ) *p = '_'; + } + pIniFile->WriteString("Calls", bf, bbf); + } + } + +//AA6YQ option, Added by JE3HHT on Sep.2010 + CAA6YQ *pAA6YQ = &pSound->FSKDEM.m_AA6YQ; + pIniFile->WriteInteger("AA6YQ", "Version", VERAA6YQ); + pIniFile->WriteInteger("AA6YQ", "Enabled", pAA6YQ->m_fEnabled); + pIniFile->WriteInteger("AA6YQ", "TapsBPF", pAA6YQ->m_bpfTaps); + WriteDoubleIniFile(pIniFile, "AA6YQ", "WidthBPF", pAA6YQ->m_bpfFW); + pIniFile->WriteInteger("AA6YQ", "TapsBEF", pAA6YQ->m_befTaps); + WriteDoubleIniFile(pIniFile, "AA6YQ", "WidthBEF", pAA6YQ->m_befFW); + WriteDoubleIniFile(pIniFile, "AA6YQ", "afcERR", pAA6YQ->m_afcERR); + + pIniFile->UpdateFile(); + delete pIniFile; + + } + catch(...){ + ErrorMB((Font->Charset != SHIFTJIS_CHARSET)?"Cannot update MMTTY.INI":"MMTTY.INI‚ðXV‚Å‚«‚Ü‚¹‚ñ."); + } +} +//--------------------------------------------------------------------------- +int __fastcall TMmttyWd::IsTxIdle(void) +{ + if( sys.m_TxPort ){ + if( !pSound->FSKMOD.IsIdle() ) return 0; + if( pComm != NULL ){ + return pComm->m_idle; + } + return 1; + } + else { + return pSound->FSKMOD.IsIdle(); + } +} +//--------------------------------------------------------------------------- +int __fastcall TMmttyWd::GetTxBufCount(void) +{ + int r = pSound->FSKMOD.GetBufCount(); + if( sys.m_TxPort && (pComm != NULL) ){ + int rr = pComm->GetBufCount(); + if( rr > r ) r = rr; + } + return r; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::RecvJob(void) +{ + char c; + while(1){ + int d = pSound->FSKDEM.GetData(); + if( d < 0 ){ + break; + } + switch(pSound->FSKDEM.m_BitLen){ + case 7: + d &= 0x007f; + case 8: + if( d || Remote & REMNOCNV ){ + if( d ) PrintText.PutChar(char(d)); + PutTNC(char(d)); + } + break; + case 6: + default: + if( d >= 0 ){ + if( Remote ){ + if( Remote & REMNOCNV ) PutTNC(BYTE(d)); + } + else { + if( TNC.Type == 2 ) PutTNC(BYTE(d)); + } + c = rtty.ConvAscii(d); + if( c ){ + PrintText.PutChar(c); + if( Remote ){ + if( !(Remote & REMNOCNV) ) PutTNC(c); + } + else { + if( TNC.Type != 2 ) PutTNC(c); + } + } + else { + if( SBFIG->Down != rtty.m_fig ){ + SBFIG->Down = rtty.m_fig; + if( Remote ) PostApp(TXM_FIGEVENT, rtty.m_fig); + } + } + } + else { + break; + } + break; + } + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::TimerTimer(TObject *Sender) +{ + if( pSound == NULL ) return; + + if( DisPaint != TRUE ){ + if( KXYScope->Checked && (DrawXY() == TRUE) ){ + PBoxXYPaint(NULL); + } + if( Remote && (pMap != NULL) ){ + if( !(Remote & REMDISSHARED) ){ + pMap->flagLostSound = pSound->m_Err; + pMap->flagOverflow = SBTX->Down ? 0 : pSound->FSKDEM.m_OverFlow; + pMap->txBuffCount = (Remote & REMVIATX) ? FifoEdit.GetLen() : GetTxBufCount(); + } + if( Remote & REMSHOWOFF ){ + if( pSound->m_Err ) pSound->m_Err--; + pSound->FSKDEM.m_OverFlow = 0; + } + } + if( pSound->DrawFFT(pBitmapFFTIN, 0, KXYScope->Checked ? PBoxXY->Width : 0) ){ + if( pTnc ){ + pTnc->NotifyFFT(pSound->fftIN.m_fft); + } + if( Remote && (pMap != NULL) ){ + if( !pMap->flagFFT ){ + SetRemoteFFT(); + } + } + PBoxFFTINPaint(NULL); + if( pSound->m_FFTSW ){ + if( pSound->DrawFFTWater(pBitmapWater, 0, KXYScope->Checked ? PBoxXY->Width : 0) ){ + PBoxWaterPaint(NULL); + } + if( sys.m_AFC && (!SBTX->Down || (sys.m_echo == 2)) ){ + if( !MarkFreq->DroppedDown && !ShiftFreq->DroppedDown ){ + if( pSound->DoAFC() ){ + m_DisEvent++; + MarkFreq->Text = pSound->FSKDEM.GetMarkFreq(); + ShiftFreq->Text = pSound->FSKDEM.GetSpaceFreq() - pSound->FSKDEM.GetMarkFreq(); + if( pRadio != NULL ) pRadio->SetMarkFreq(pSound->FSKDEM.GetMarkFreq()); + m_DisEvent--; + RemoteFreq(); + } + } + } + } + } + if( pSound->fftIN.m_FFTDIS ){ + m_DisEvent++; + KFFT->Checked = FALSE; + pSound->m_FFTSW = 0; + pSound->fftIN.InitFFT(); + UpdateUI(); + m_DisEvent--; + } + } + DrawSQ(); + PBoxSQPaint(NULL); + RecvJob(); + if( p_SendFileDlg != NULL ){ + if( SBTX->Down ){ + int r = p_SendFileDlg->Timer(GetTxBufCount()); + if( r ){ + delete p_SendFileDlg; + p_SendFileDlg = NULL; + if( r == 2 ){ + pSound->FSKMOD.DeleteTXBuf(); + if( pComm != NULL ) pComm->InitTxBuf(); + } + } + } + else { + delete p_SendFileDlg; + p_SendFileDlg = NULL; + } + } + if( SBTX->Down ){ + if( IsTxIdle() ){ + if( m_Macro ){ + switch(m_MacroStat){ + case 1: // ŽóMØ‚è‘Ö‚¦ + if( m_MacTimer && (m_MacRetry >= 1) && (m_MacRetry <= 16) ){ + if( sys.m_UserTimer[m_MacRetry-1] ){ + m_MacTimer = (sys.m_UserTimer[m_MacRetry-1] * 100) + GetTickCount(); + } + else { + ClearMacroTimer(); + } + } + m_MacroStat = 0; + m_Macro = 0; + ToRX(0); + break; + case 2: // ŒJ‚è•Ô‚µ + OutputStr(m_NowStr.c_str()); + break; + default: + m_MacroStat = 0; + m_Macro = 0; + break; + } + } + if( m_PttTimer && m_PttTimerCount ){ + if( DWORD(m_PttTimerCount) <= ::GetTickCount() ){ + SBTX->Down = FALSE; + SBTXClick(NULL); + UpdatePttTimer(); + } + } + } + else if( m_PttTimer ){ + UpdatePttTimer(); + } + if( pComm != NULL ) pComm->Timer(); + } + else if( m_MacTimer && m_MacRetry ){ + if( DWORD(m_MacTimer) <= GetTickCount() ){ + m_MacTimer = 0; + if( m_MacRetry ){ + MacBtnExec(m_MacRetry-1); + } + } + } + else if( KTest->Checked ){ + if( pSound->FSKMOD.GetBufCount() < 3 ){ + const char TestData[]="\r\nRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRY\r\n" + "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\r\n" + "-?:$!&'().,;/\x22"; + + OutputStr(TestData); + } + } + if( SBTX->Down && (!m_Macro) && (!m_FifoOutTimer) ){ + while( pSound->FSKMOD.GetBufCount() <= 2 ){ + if( !m_ReqRecv ){ + if( m_SendWay == 1 ){ + if( !FifoEdit.IsSAS(0) ) break; + } + else if( m_SendWay == 2 ){ + if( !FifoEdit.IsSAS(1) ) break; + } + } + char bf[3]; +_try:; + bf[1] = 0; + bf[0] = FifoEdit.GetChar(); + if( bf[0] != -1 ){ + if( bf[0] && (bf[0] != '#') ){ + if( bf[0] == '%' ){ + bf[1] = FifoEdit.GetChar(); + bf[2] = 0; + if( bf[1] == '{' ){ + char bbf[1024]; + bbf[0] = '%'; bbf[1] = '{'; + LPSTR t = &bbf[2]; + while(FifoEdit.GetLen()){ + *t = FifoEdit.GetChar(); + if( *t == '}' ){ + t++; + break; + } + t++; + } + *t = 0; + OutputStr(bbf); + } + else { + OutputStr(bf); + } + } + else if( bf[0] == '^' ){ + m_FifoOutTimer = KXYScope->Checked ? 10 : 5; + break; + } + else { + OutputStr(bf); + if( bf[0] == 0x0d ){ + bf[0] = 0x0a; + OutputStr(bf); + } + if( (bf[0] == '_')||(bf[0] =='~') ){ + if( pSound->FSKMOD.GetBufCount() <= 10 ) goto _try; + } + } + } + } + else if( m_ReqRecv && IsTxIdle() ){ + if( (pSound->FSKMOD.m_AmpVal == 1) && (sys.m_TxPort != 2) ){ + pSound->FSKMOD.m_AmpVal = 0; + } + else { + ToRX(0); + } + break; + } + else { + break; + } + if( FifoEdit.GetLen() < 2 ) break; + } + } + if( m_PaletteTimer ){ // 256FƒrƒfƒI‚ÌŽž + m_PaletteTimer--; + if( !m_PaletteTimer ){ + PBoxWater->Invalidate(); + PBoxXY->Invalidate(); + PBoxRx->Invalidate(); + PBoxIn->Invalidate(); + } + } + if( m_FifoOutTimer ) m_FifoOutTimer--; + if( Remote ){ + if( m_RemoteTimer ){ + m_RemoteTimer--; + if( !m_RemoteTimer ){ + Close(); + } + else if( !(m_RemoteTimer % 5) ){ + FirstFileMapping(); + ::PostMessage(APP_HANDLE, MSG_MMTTY, TXM_THREAD, ::GetCurrentThreadId()); + ::PostMessage(APP_HANDLE, MSG_MMTTY, TXM_HANDLE, (DWORD)Handle); + } + } + if( m_pRemOpenName != NULL ){ + HWND hwnd = ::FindWindow(m_OptionDialog ? NULL : "TForm", m_pRemOpenName); + if( hwnd != NULL ){ + ::ShowWindow(hwnd, SW_HIDE); + ::SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_SHOWWINDOW); + ::ShowWindow(hwnd, SW_SHOW); + m_pRemOpenName = NULL; + } + } + } + else { + if( LogLink.IsEnabled() ){ + if( LogLink.TimerLogLink() ){ + UpdateLogLink(); + } + if( LogLink.IsPolling() && LogLink.IsLink() && !SBTX->Down ){ + LogLink.EventGetFreq(); + } + } + if( Log.m_LogSet.m_CopyHis == 2 ){ + if( !m_BARTGTimer ){ + m_BARTGTimer = 15; + UpdateBARTG(); + } + m_BARTGTimer--; + } + } + if( pRadio != NULL ){ + pRadio->Timer(SBTX->Down, Timer->Interval); + if( pRadio->IsFreqChange(AnsiString(Freq->Text).c_str()) ){ //JA7UDE 0428 + Freq->Text = pRadio->GetFreq(); + if( !Remote ){ + Log.SetFreq(&Log.m_sd, AnsiString(Freq->Text).c_str()); //JA7UDE 0428 + } + if( Remote || (pTnc && pTnc->IsMMT()) ){ + double fq = 0; + if( sscanf(AnsiString(Freq->Text).c_str(), "%lf", &fq) == 1 ){ //JA7UDE 0428 + int freq = int(fq * 1000.0); + if( Remote ) ::PostMessage(APP_HANDLE, MSG_MMTTY, TXM_RADIOFREQ, freq); + if( pTnc && pTnc->IsMMT() ) pTnc->GetNMMT()->m_radiofreq = freq; + } + } + } + } + if( pTnc != NULL ){ + OnTncEvent(); + pTnc->Notify(); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::UpdateBARTG(void) +{ + if( !SBQSO->Down && !SBTX->Down ){ + SYSTEMTIME st; + GetUTC(&st); + if( st.wMinute != Log.m_UTC.wMinute ){ + Log.SetHisUTC(); + HisRST->Text = Log.m_sd.ur; + } + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::ClearMacroTimer(void) +{ + if( m_MacTimer ){ // ƒ}ƒNƒ‘—M‚Ì‹­§“I‚È’†Ž~ + m_MacTimer = 0; + GetSB(m_MacRetry-1)->Down = FALSE; + if( (pSound != NULL) && pSound->m_Tx ) ToRX(1); + } + UpdatePttTimer(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::UpdateLogLink(void) +{ + if( !Remote ){ + LogLink.UpdateLink(sys.m_LogLink); + UpdateTitle(); + } +} +//--------------------------------------------------------------------------- +// æs•ÒWƒpƒbƒh‚Ì•\ަ +// ƒtƒH[ƒJƒX‚Ì’²® +void __fastcall TMmttyWd::AdjustFocus(void) +{ + if( !Visible ) return; + if( !Application->Active ) return; + if( Remote ){ +// Application->Active = FALSE; + if( m_OptionDialog || (m_pRemOpenName != NULL) ){ + return; + } + if( Remote & REMSHOWOFF ) return; + if( Remote & REMDISFOCUS ) return; + if( (APP_HANDLE != HWND_BROADCAST) && (Application->Active == TRUE) ){ + ::SetForegroundWindow(APP_HANDLE); + } + } + else if( PanelRx->Visible ){ + PanelRx->SetFocus(); + FifoEdit.SetCursor(1); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::TimerFocus(void) +{ + if( !Visible ) return; + if( !Application->Active ) return; + if( Remote ){ + if( ActiveControl != PanelFFT ){ +// if( Remote & REMDISFOCUS ) return; + if( MarkFreq->DroppedDown ) return; + if( ShiftFreq->DroppedDown ) return; + if( DemoBox1->DroppedDown ) return; + if( DemoBox2->DroppedDown ) return; + if( PanelFFT->Visible ) PanelFFT->SetFocus(); + } + } + else if( ActiveControl != PanelRx ){ + FifoEdit.SetCursor(0); + if( MarkFreq->DroppedDown ) return; + if( ShiftFreq->DroppedDown ) return; + if( DemoBox1->DroppedDown ) return; + if( DemoBox2->DroppedDown ) return; + if( MsgList->DroppedDown ) return; + if( HisCall->Focused() ) return; + if( HisName->Focused() ) return; + if( HisQTH->Focused() ) return; + if( ActiveControl == HisRST ) return; + if( ActiveControl == MyRST ) return; + if( ActiveControl == Freq ) return; + AdjustFocus(); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::PBoxFFTINPaint(TObject *Sender) +{ + if( PBoxFFTIN->Visible ){ + PBoxFFTIN->Canvas->Draw(0, 0, (TGraphic*)pBitmapFFTIN); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::PBoxWaterPaint(TObject *Sender) +{ + if( PBoxWater->Visible ){ + PBoxWater->Canvas->Draw(0, 0, (TGraphic*)pBitmapWater); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::UpdateRev(void) +{ + int txrev = sys.m_Rev; + if( sys.m_TxDisRev ) txrev = 0; + pSound->FSKMOD.SetRev(txrev); + int rxrev = sys.m_Rev; + if( SBTX->Down && (sys.m_echo != 2) ) rxrev = txrev; + pSound->FSKDEM.SetRev(rxrev); +#if 0 + if( !SBTX->Down || !sys.m_TxDisRev ){ + pSound->FSKDEM.SetRev(sys.m_Rev); + pSound->FSKMOD.SetRev(sys.m_Rev); + } + else { + pSound->FSKDEM.SetRev(0); + pSound->FSKMOD.SetRev(0); + } +#endif +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SBRevClick(TObject *Sender) +{ + sys.m_Rev = SBRev->Down; + UpdateRev(); + AdjustFocus(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SBDemClick(TObject *Sender) +{ + if( m_DisEvent ) return; + + pSound->FSKDEM.m_type++; + if( pSound->FSKDEM.m_type >= 4 ) pSound->FSKDEM.m_type = 0; + AdjustFocus(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SBFIGClick(TObject *Sender) +{ + if( m_DisEvent ) return; + + rtty.m_fig = SBFIG->Down; + if( Remote ) PostApp(TXM_FIGEVENT, rtty.m_fig); + AdjustFocus(); +} +void __fastcall TMmttyWd::SBAFCClick(TObject *Sender) +{ + if( m_DisEvent ) return; + + sys.m_AFC = SBAFC->Down; + AdjustFocus(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SBATCClick(TObject *Sender) +{ + if( m_DisEvent ) return; + + pSound->FSKDEM.m_atc = SBATC->Down; + AdjustFocus(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SBNETClick(TObject *Sender) +{ + if( m_DisEvent ) return; + + sys.m_TxNet = SBNET->Down; + if( SBTX->Down ){ + UpdateNet(); + } + AdjustFocus(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SBBPFClick(TObject *Sender) +{ + if( m_DisEvent ) return; + + pSound->m_bpf = SBBPF->Down; + if( SBBPF->Down ) pSound->CalcBPF(); + AdjustFocus(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SBLMSClick(TObject *Sender) +{ + if( m_DisEvent ) return; + + pSound->m_lmsbpf = SBLMS->Down; + if( SBLMS->Down ){ + pSound->CalcBPF(); + } + else if( pSound->m_lms.m_twoNotch ){ + pSound->m_lms.m_lmsNotch = pSound->m_lms.m_lmsNotch2 = 0; + } + RemoteFreq(); + AdjustFocus(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SBLMSMouseDown(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y) +{ + if( Button == mbRight ){ + pSound->m_lms.m_Type = pSound->m_lms.m_Type ? 0 : 1; + UpdateLMS(); + SBLMSClick(NULL); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SBSQClick(TObject *Sender) +{ + if( m_DisEvent ) return; + + pSound->FSKDEM.SetSQ(SBSQ->Down); + UpdateUI(); + AdjustFocus(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::MarkFreqChange(TObject *Sender) +{ + if( m_DisEvent ) return; + + double sf; + sscanf(AnsiString(MarkFreq->Text).c_str(), "%lf", &sf); //JA7UDE 0428 + if( (sf >= MARKL) && (sf < SPACEH) ){ + double sft = pSound->FSKDEM.GetSpaceFreq() - pSound->FSKDEM.GetMarkFreq(); + pSound->FSKDEM.SetMarkFreq(sf); + pSound->FSKMOD.SetMarkFreq(sf); + if( pRadio != NULL ) pRadio->SetMarkFreq(sf); + sf += sft; + pSound->FSKDEM.SetSpaceFreq(sf); + pSound->FSKMOD.SetSpaceFreq(sf); + if( SBBPF->Down || SBLMS->Down ) pSound->CalcBPF(); + } + RemoteFreq(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SetShift(double sf) +{ + if( (sf >= SHIFTL) && (sf < 1500.0) ){ + if( sys.m_FixShift == 3 ){ + double sfq = pSound->FSKDEM.GetSpaceFreq(); + double mfq = pSound->FSKDEM.GetMarkFreq(); + mfq = ((mfq + sfq - sf) * 0.5); + mfq = double(int(mfq + 0.5)); + pSound->FSKDEM.SetMarkFreq(mfq); + pSound->FSKMOD.SetMarkFreq(mfq); + if( pRadio != NULL ) pRadio->SetMarkFreq(mfq); + m_DisEvent--; + MarkFreq->Text = mfq; + m_DisEvent++; + } + double f = pSound->FSKDEM.GetMarkFreq() + sf; + m_DisEvent++; + if( f >= (DemSamp*0.5) ){ + f = 1445.0; + MarkFreq->Text = f; + pSound->FSKDEM.SetMarkFreq(f); + pSound->FSKMOD.SetMarkFreq(f); + if( pRadio != NULL ) pRadio->SetMarkFreq(f); + f += sf; + pSound->FSKDEM.SetSpaceFreq(f); + pSound->FSKMOD.SetSpaceFreq(f); + } + else { + pSound->FSKDEM.SetSpaceFreq(f); + pSound->FSKMOD.SetSpaceFreq(f); + } + if( SBBPF->Down || SBLMS->Down ) pSound->CalcBPF(); + RemoteFreq(); + m_DisEvent--; + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::ShiftFreqChange(TObject *Sender) +{ + if( m_DisEvent ) return; + + double sf; + sscanf(AnsiString(ShiftFreq->Text).c_str(), "%lf", &sf); //JA7UDE + SetShift(sf); +} +//--------------------------------------------------------------------------- +// ƒNƒCƒbƒNƒVƒtƒgƒ`ƒFƒ“ƒW +void __fastcall TMmttyWd::Label3Click(TObject *Sender) +{ + if( m_DisEvent ) return; + + double sf; + sscanf(AnsiString(ShiftFreq->Text).c_str(), "%lf", &sf); + if( sf < 185.0 ){ + sf = 200; + } + else if( sf < 210.0 ){ + sf = 220; + } + else if( sf < 250.0 ){ + sf = 350; + } + else if( sf < 400.0 ){ + sf = 450; + } + else { + sf = 170; + } +// sf = (sf < 185.0) ? 200 : 170; + m_DisEvent++; + ShiftFreq->Text = sf; + SetShift(sf); + m_DisEvent--; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SBUOSClick(TObject *Sender) +{ + if( m_DisEvent ) return; + + rtty.m_uos = SBUOS->Down; + AdjustFocus(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KTestClick(TObject *Sender) +{ + if( m_DisEvent ) return; + + ClearMacroTimer(); + KTest->Checked = KTest->Checked ? 0 : 1; + + if( KTest->Checked ){ + rtty.ClearTX(); + pSound->FSKMOD.ClearTXBuf(); + pSound->FSKMOD.SetBaudRate(pSound->FSKDEM.GetBaudRate()); + pSound->FSKMOD.SetMarkFreq(pSound->FSKDEM.GetMarkFreq()); + pSound->FSKMOD.SetSpaceFreq(pSound->FSKDEM.GetSpaceFreq()); + pSound->FSKMOD.SetRev(pSound->FSKDEM.GetRev()); + if( pComm != NULL ) pComm->EnbTX(1); + } + else if( !SBTX->Down ){ + if( pComm != NULL ) pComm->EnbTX(0); + } + pSound->m_Test = KTest->Checked; + UpdateUI(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::TBCharWaitChange(TObject *Sender) +{ + if( m_DisEvent ) return; + + switch(sys.m_LWait){ + case 1: + pSound->FSKMOD.m_DiddleWait = GetTBValue(TBCharWait->Position, 50, 50) + 0.5; + break; + default: + pSound->FSKMOD.m_CharWait = GetTBValue(TBCharWait->Position, 50, 50) + 0.5; + break; + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::LTapClick(TObject *Sender) +{ + m_Baud = m_Baud ? FALSE : TRUE; + UpdateUI(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::PBoxRxPaint(TObject *Sender) +{ + static int flag = 0; + + if( Remote ) return; + + if( PBoxRx->Canvas->ClipRect.Top ){ + if( !flag ){ + PBoxRx->Invalidate(); + flag++; + } + } + else { + flag = 0; + } + if( UsrPal != NULL ){ + PBoxRx->Canvas->Brush->Bitmap = pBitmapRx; + TRect rc; + + rc.Top = 0; + rc.Left = 0; + rc.Right = PBoxRx->Width; + rc.Bottom = PBoxRx->Height; + PBoxRx->Canvas->Brush->Bitmap = pBitmapRx; + PBoxRx->Canvas->FillRect(rc); + } + PrintText.PaintCanvas(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::PBoxInPaint(TObject *Sender) +{ + static int flag = 0; + + if( Remote ) return; + if( PBoxIn->Canvas->ClipRect.Top ){ + if( !flag ){ + PBoxIn->Invalidate(); + flag++; + } + } + else { + flag = 0; + } + if( UsrPal != NULL ){ + PBoxIn->Canvas->Brush->Bitmap = pBitmapIn; + TRect rc; + + rc.Top = 0; + rc.Left = 0; + rc.Right = PBoxIn->Width; + rc.Bottom = PBoxIn->Height; + PBoxIn->Canvas->Brush->Bitmap = pBitmapIn; + PBoxIn->Canvas->FillRect(rc); + } + FifoEdit.PaintCanvas(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::FormPaint(TObject *Sender) +{ + if( m_InitFirst == TRUE ){ + m_InitFirst = FALSE; + UpdateColor(); + int f1stInst = FALSE; + if( !Remote ){ + if( (sys.m_Call == "NOCALL") || sys.m_Call.IsEmpty() ){ + f1stInst = TRUE; + AnsiString as = ""; + if( sys.m_Call != "NOCALL" ){ + as = sys.m_Call; + } + if( InputMB("MMTTY", (Font->Charset != SHIFTJIS_CHARSET)?"Please enter your callsign":"‚ ‚È‚½‚̃R[ƒ‹ƒTƒCƒ“‚ð“ü—Í‚µ‚ĉº‚³‚¢.", as) == TRUE ){ + if( !as.IsEmpty() ){ + char bf[MLCALL+1]; + StrCopy(bf, as.c_str(), MLCALL); + jstrupr(bf); + sys.m_Call = bf; + Log.MakePathName(ClipCall(bf)); + UpdateItem(); + } + } + } + char bf[256]; + sprintf(bf, "%sARRL.DX", BgnDir); + Cty.Load(bf); + sprintf(bf, "%sMMCG.DEF", BgnDir); + mmcg.LoadDef(bf); + } + pSound->DrawFFT(pBitmapFFTIN, 1, KXYScope->Checked ? PBoxXY->Width : 0); + pSound->DrawFFTWater(pBitmapWater, 1, KXYScope->Checked ? PBoxXY->Width : 0); + + if( !Remote ){ + if( !f1stInst ) Log.DoBackup(); + Log.Open(NULL, !f1stInst); // ƒJƒŒƒ“ƒgƒƒOƒtƒ@ƒCƒ‹‚̃I[ƒvƒ“ + LogLink.UpdateLink(sys.m_LogLink); + } + UpdateTextData(); + if( Log.m_sd.btime ) SBQSO->Down = TRUE; + OpenCloseCom(); + pSound->Resume(); + m_DisEvent = 0; + if( Remote ){ + ::PostMessage(APP_HANDLE, MSG_MMTTY, TXM_THREAD, ::GetCurrentThreadId()); + ::PostMessage(APP_HANDLE, MSG_MMTTY, TXM_HANDLE, (DWORD)Handle); + ::PostMessage(APP_HANDLE, MSG_MMTTY, TXM_START, 0x00000000); + } +#if 0 + FILE *fp = fopen("eremote.txt", "rb"); + while(!feof(fp)){ + char c = fgetc(fp); + PrintText.PutChar(c); + } + fclose(fp); +#endif + DisPaint = FALSE; + } + else if( pSound != NULL ){ + if( pSound->m_susp && (!Remote) ){ + KExtResetClick(NULL); + } + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::ToTX(LPCSTR p) +{ + if( !SBTX->Down ){ + m_ReqRecv = 0; + SBTX->Down = TRUE; + if( p == NULL ){ + XMIT(1); + } + else { + int f = 1; + for( ; *p; p++ ){ + if( (*p == '~') || ((*p == '%') && (*(p+1)=='{')) ){ + f = 0; + break; + } + else if( (*p != '[')&&(*p != ']')&&(*p != '\\')&&(*p != '_') ){ + break; + } + } + XMIT(f); + } + if( !Remote ) AdjustFocus(); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::ToRX(int sw) +{ + if( SBTX->Down ){ + if( pTnc ) pTnc->m_PTT = 0; + if( Remote & REMVIATX ) FifoEdit.Clear(); + if( pComm != NULL ) pComm->DisDiddle(-1); + pSound->FSKMOD.SetDiddleTimer(-1); // Diddle ‹ÖŽ~ + pSound->TrigBCC(); + pSound->FSKMOD.DeleteTXBuf(); + SBTX->Caption = "REQ"; + SBTX->Update(); + if( !sw ){ // ‘—MŠ®—¹‘Ò‚¿ + if( sys.m_TxPort != txTXDOnly ){ + for( int i = 0; (pSound->GetBCC() >= 0) && (i < 200); i++ ){ + RecvJob(); + Sleep(20); + } + } + else { + Sleep(200); + RecvJob(); + } + } + pSound->m_ReqTx = 0; + for( int i = 0; pSound->m_Tx && (i < 200); i++ ){ + RecvJob(); + Sleep(20); + } + m_MacroStat = 0; + m_Macro = 0; + m_ReqRecv = 0; + SBTX->Caption = "TX"; + SBTX->Down = 0; + PrintText.SetTX(0); + if( sys.m_logTimeStamp ) PrintText.TrigTimeStamp("RX", sys.m_ShowTimeStamp); + UpdateRev(); + if( sys.m_echo != 2 ){ + rtty.ClearRX(); + pSound->FSKDEM.ClearRXBuf(); + pSound->m_bpf = SBBPF->Down; + } + UpdateLimit(); + if( pComm != NULL ) pComm->SetTXRX(0); + if( pRadio != NULL ) pRadio->SetPTT(0); + if( pTnc != NULL ) pTnc->SetPTT(0); + LogLink.SetPTT(0); + SBFIG->Down = rtty.m_fig; + if( Remote ) PostApp(TXM_FIGEVENT, rtty.m_fig); + UpdateUI(); + TimerFocus(); + UpdateNet(); + if( Remote ){ + if( (pMap != NULL) && (sys.m_echo != 2) && !(Remote & REMDISSHARED) ){ + memset(pMap->arrayFFT, 0, sizeof(pMap->arrayFFT)); + memset(pMap->arrayX, 0, sizeof(pMap->arrayX)); + memset(pMap->arrayY, 0, sizeof(pMap->arrayY)); + } + PostApp(TXM_PTTEVENT, 0); + } + if( pComm != NULL ) pComm->EnbTX(0); + } + if( !Remote ) AdjustFocus(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::UpdateNet(void) +{ + if( SBTX->Down ){ // ‘—MØ‚è‘Ö‚¦Žž + if( sys.m_TxNet && (!sys.m_TxFixShift) ){ + pSound->FSKMOD.SetMarkFreq(pSound->FSKDEM.GetMarkFreq()); + pSound->FSKMOD.SetSpaceFreq(pSound->FSKDEM.GetSpaceFreq()); + } + else { + m_RxMarkFreq = pSound->FSKDEM.GetMarkFreq(); + m_RxSpaceFreq = pSound->FSKDEM.GetSpaceFreq(); + double mfq; + double sfq; + if( sys.m_TxNet ){ + mfq = pSound->FSKDEM.GetMarkFreq(); + sfq = pSound->FSKDEM.GetSpaceFreq(); + mfq += ((sfq - mfq) - sys.m_DefShift) * 0.5; + } + else { + mfq = sys.m_DefMarkFreq; + } + mfq = int(mfq); + sfq = mfq + sys.m_DefShift; + pSound->FSKMOD.SetMarkFreq(mfq); + pSound->FSKMOD.SetSpaceFreq(sfq); + pSound->FSKDEM.SetMarkFreq(mfq); + pSound->FSKDEM.SetSpaceFreq(sfq); + m_DisEvent++; + MarkFreq->Text = mfq; + ShiftFreq->Text = sys.m_DefShift; + m_DisEvent--; + RemoteFreq(); + } + } + else { // ŽóMØ‚è‘Ö‚¦Žž + if( !sys.m_TxNet || sys.m_TxFixShift ){ + pSound->FSKDEM.SetMarkFreq(m_RxMarkFreq); + pSound->FSKDEM.SetSpaceFreq(m_RxSpaceFreq); + if( pRadio != NULL ) pRadio->SetMarkFreq(m_RxMarkFreq); + m_DisEvent++; + MarkFreq->Text = m_RxMarkFreq; + ShiftFreq->Text = m_RxSpaceFreq - m_RxMarkFreq; + m_DisEvent--; + RemoteFreq(); + } + } +} +//--------------------------------------------------------------------------- +// ‹­§“I‚ÈŽóM +void __fastcall TMmttyWd::SBTXOFFClick(TObject *Sender) +{ + ClearMacroTimer(); + ToRX(1); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::XMIT(int sw) +{ + if( !Remote && (sys.m_DisTX&1) ){ + SBTX->Down = FALSE; + return; + } + m_MacroStat = 0; + m_Macro = 0; + m_ReqRecv = 0; + SBTX->Caption = "REQ"; + SBTX->Update(); + pSound->FSKMOD.ClearTXBuf(); + rtty.ClearTX(); + pSound->FSKMOD.SetBaudRate(pSound->FSKDEM.GetBaudRate()); + UpdateNet(); + UpdateRev(); + if( Remote ) PostApp(TXM_PTTEVENT, 1); + if( pComm != NULL ) pComm->SetTXRX(1); + if( pRadio != NULL ) pRadio->SetPTT(1); + if( pTnc != NULL ) pTnc->SetPTT(1); + LogLink.SetPTT(1); + if( Remote && m_RemoteDelay ) ::Sleep(m_RemoteDelay); + pSound->m_ReqTx = 1; + pSound->FSKMOD.m_Amp.Reset(); + pSound->FSKMOD.m_AmpVal = 1; + pSound->FSKMOD.OutTone(sw, pSound->m_BuffSize); + if( sys.m_echo != 2 ){ + pSound->FSKDEM.ClearRXBuf(); + if( !SBNET->Down ){ + pSound->m_bpf = 0; + } + } +#if 1 + if( sys.m_TxPort != txTXD ){ + for( int i = 0; (!pSound->m_Tx) && (i < 200); i++ ) Sleep(20); +// pSound->FSKMOD.OutTone(sw, pSound->m_BuffSize); + } +#else + for( int i = 0; (!pSound->m_Tx) && (i < 200); i++ ) Sleep(20); + pSound->FSKMOD.OutTone(sw, pSound->m_BuffSize); +#endif + SBTX->Caption = "TX"; + if( sys.m_logTimeStamp ) PrintText.TrigTimeStamp("TX", sys.m_ShowTimeStamp); + if( sys.m_echo != 2 ){ + pSound->FSKDEM.ClearRXBuf(); + } + SBFIG->Down = rtty.m_fig; + if( Remote ) PostApp(TXM_FIGEVENT, rtty.m_fig); + UpdateUI(); + UpdateLimit(); + pSound->FSKMOD.SetDiddleTimer(SampFreq/4); // 0.25s + if( pComm != NULL ) pComm->EnbTX(1); + PrintText.SetTX(1); + UpdatePttTimer(); +#if 0 + if( (sys.m_echo == 2) && sw ){ + pSound->FSKMOD.SetCount(pSound->m_BuffSize * 3); + } +#endif +// pSound->FSKMOD.OutTone(sw, pSound->m_BuffSize); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SBTXClick(TObject *Sender) +{ + ClearMacroTimer(); + if( SBTX->Down ){ + XMIT(1); + if( (!Remote) && KENT->Checked ) OutputStr("\r\n%L"); + } + else if( FifoEdit.GetLen() || ((!IsTxIdle())&& (!m_Macro)) ){ + if( m_ReqRecv ){ + m_ReqRecv = 0; + SBTX->Caption = "TX"; + SBTX->Down = 1; + } + else { + if( (!Remote) && KENT->Checked ){ + char c = FifoEdit.GetLastChar(); + if( (c != 0x0a) && (c != '\\') ) WriteFifoEdit("\r\n"); + } + m_ReqRecv = 1; + SBTX->Caption = "WAIT"; + SBTX->Down = 1; + } + } + else if( (!Remote) && KENT->Checked && (!m_Macro) ){ + OutputStr("\r\n"); + m_ReqRecv = 1; + SBTX->Caption = "WAIT"; + SBTX->Down = 1; + } + else { + SBTX->Down = 1; + ToRX(0); + } + AdjustFocus(); +} +//--------------------------------------------------------------------------- +// ƒL[ƒ{[ƒh +void __fastcall TMmttyWd::PushKey(char Key) +{ + Key = char(toupper(Key)); + if( KWP->Checked && (Key == ' ') ){ + char bf[256]; + ConvString(bf, FifoEdit.GetCurLine(), sizeof(bf)-1, 0); + int len = strlen(bf); + if( (len >= 60) || ((len >= (FifoEdit.m_ColMax * 82/100)) && (!Remote)) ){ + FifoEdit.PutChar(Key); + Key = 0x0d; + } + } + if( (pSound->FSKDEM.m_BitLen <= 6) && (Key != '%') && (Key != 0x08) && (Key != '^') ){ + if( !rttysub.IsChar(rttysub.ConvRTTY(Key)) ){ + return; + } + } + FifoEdit.PutChar(Key); +} +//--------------------------------------------------------------------------- +// ƒL[ƒ{[ƒh +void __fastcall TMmttyWd::FormKeyPress(TObject *Sender, char &Key) +{ + if( HisCall->Focused() ) return; + if( HisName->Focused() ) return; + if( HisQTH->Focused() ) return; + if( ActiveControl == HisRST ) return; + if( ActiveControl == MyRST ) return; + if( ActiveControl == Freq ) return; + if( Key == VK_ESCAPE ) return; + + ClearMacroTimer(); + PushKey(Key); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::FormKeyDown(TObject *Sender, WORD &Key, + TShiftState Shift) +{ + TShiftState sc1, sc2, sa1, sa2, ss1, ss2; + + WORD nKey = WORD(Key & 0x00ff); + sc1 << ssCtrl; + sc2 << ssCtrl; + sc1 *= Shift; + + sa1 << ssAlt; + sa2 << ssAlt; + sa1 *= Shift; + + ss1 << ssShift; + ss2 << ssShift; + ss1 *= Shift; + + if( sc1 == sc2 ){ // Ctrl+Any + nKey |= 0x0100; + } + else if( sa1 == sa2 ){ // Alt + Any + nKey |= 0x0200; + } + else if( ss1 == ss2 ){ // Shift + Any + nKey |= 0x0400; + } + + ClearMacroTimer(); + if( nKey == (VK_BACK | 0x100) ){ + FifoEdit.LineBackSpace(); + Key = 0; + } +// ƒ†[ƒU[’è‹`‰Â”\‚ȃL[ + else if( nKey == sys.m_SysKey[kkUOS] ){ + SBUOS->Down = SBUOS->Down ? 0 : 1; + SBUOSClick(NULL); + Key = 0; + } + else if( nKey == sys.m_SysKey[kkFIG] ){ + SBFIG->Down = SBFIG->Down ? 0 : 1; + SBFIGClick(NULL); + Key = 0; + } + else if( nKey == sys.m_SysKey[kkTX] ){ + SBTX->Down = SBTX->Down ? 0 : 1; + SBTXClick(NULL); + Key = 0; + } + else if( nKey == sys.m_SysKey[kkTXOFF] ){ + SBTXOFFClick(NULL); + Key = 0; + } + else if( nKey == sys.m_SysKey[kkQSO] ){ + if( SBQSO->Enabled ){ + SBQSO->Down = SBQSO->Down ? 0 : 1; + SBQSOClick(NULL); + } + Key = 0; + } + else if( nKey == sys.m_SysKey[kkOnQSO] ){ + QSOIN(); + Key = 0; + } + else if( nKey == sys.m_SysKey[kkOffQSO] ){ + QSOOUT(1); + Key = 0; + } + else if( nKey == sys.m_SysKey[kkCAPTURE] ){ + CallCapture(); + Key = 0; + } + else if( nKey == sys.m_SysKey[kkInitBox] ){ + SBInitClick(NULL); + Key = 0; + } + else if( nKey == sys.m_SysKey[kkCall] ){ + HisCall->SetFocus(); + Key = 0; + } + else if( nKey == sys.m_SysKey[kkName] ){ + m_NameQTH = 0; + UpdateUI(); + HisName->SetFocus(); + Key = 0; + } + else if( nKey == sys.m_SysKey[kkQTH] ){ + m_NameQTH = 1; + UpdateUI(); + HisQTH->SetFocus(); + Key = 0; + } + else if( nKey == sys.m_SysKey[kkRST] ){ + HisRST->SetFocus(); + Key = 0; + } + else if( nKey == sys.m_SysKey[kkMyRST] ){ + MyRST->SetFocus(); + Key = 0; + } + else if( nKey == sys.m_SysKey[kkFreq] ){ + Freq->SetFocus(); + Key = 0; + } + else if( nKey == sys.m_SysKey[kkFind] ){ + SBFindClick(NULL); + Key = 0; + } + else if( nKey == sys.m_SysKey[kkClear] ){ + SBINClearClick(NULL); + Key = 0; + } + else if( nKey == sys.m_SysKey[kkInUp] ){ + FifoEdit.ScrollBarUp(0); + Key = 0; + } + else if( nKey == sys.m_SysKey[kkInDown] ){ + FifoEdit.ScrollBarDown(0); + Key = 0; + } + else if( nKey == sys.m_SysKey[kkInPUp] ){ + FifoEdit.ScrollBarUp(1); + Key = 0; + } + else if( nKey == sys.m_SysKey[kkInPDown] ){ + FifoEdit.ScrollBarDown(1); + Key = 0; + } + else if( nKey == sys.m_SysKey[kkInHome] ){ + FifoEdit.ScrollBarUp(-1); + Key = 0; + } + else if( nKey == sys.m_SysKey[kkInEnd] ){ + FifoEdit.ScrollBarDown(-1); + Key = 0; + } + else if( nKey == sys.m_SysKey[kkRxUp] ){ + PrintText.ScrollBarUp(0); + Key = 0; + } + else if( nKey == sys.m_SysKey[kkRxDown] ){ + PrintText.ScrollBarDown(0); + Key = 0; + } + else if( nKey == sys.m_SysKey[kkRxPUp] ){ + PrintText.ScrollBarUp(1); + Key = 0; + } + else if( nKey == sys.m_SysKey[kkRxPDown] ){ + PrintText.ScrollBarDown(1); + Key = 0; + } + else if( nKey == sys.m_SysKey[kkRxHome] ){ + PrintText.ScrollBarUp(-1); + Key = 0; + } + else if( nKey == sys.m_SysKey[kkRxEnd] ){ + PrintText.ScrollBarDown(-1); + Key = 0; + } + else if( nKey == sys.m_SysKey[kkCharWaitLeft] ){ + int pos = SetTBValue(pSound->FSKMOD.m_CharWait, 50, 50); + pos-=5; + if( pos < 0 ) pos = 0; + int wait = GetTBValue(pos, 50, 50); + if( pSound->FSKMOD.m_CharWait == wait ) wait--; + if( wait < 0 ) wait = 0; + pSound->FSKMOD.m_CharWait = wait; + UpdateLWait(); + Key = 0; +#if 0 + if( TBCharWait->Position ){ + if( TBCharWait->Position > 5 ){ + TBCharWait->Position -= 5; + } + else { + TBCharWait->Position = 0; + } + TBCharWaitChange(NULL); + } + Key = 0; +#endif + } + else if( nKey == sys.m_SysKey[kkCharWaitRight] ){ + int pos = SetTBValue(pSound->FSKMOD.m_CharWait, 50, 50); + pos+=5; + if( pos > 50 ) pos = 50; + int wait = GetTBValue(pos, 50, 50); + if( pSound->FSKMOD.m_CharWait == wait ) wait++; + if( wait > 50 ) wait = 50; + pSound->FSKMOD.m_CharWait = wait; + UpdateLWait(); + Key = 0; +#if 0 + if( TBCharWait->Position < TBCharWait->Max ){ + if( TBCharWait->Position < (TBCharWait->Max - 5) ){ + TBCharWait->Position += 5; + } + else { + TBCharWait->Position = TBCharWait->Max; + } + TBCharWaitChange(NULL); + } + Key = 0; +#endif + } + else if( nKey == sys.m_SysKey[kkDiddleWaitLeft] ){ + int pos = SetTBValue(pSound->FSKMOD.m_DiddleWait, 50, 50); + pos-=5; + if( pos < 0 ) pos = 0; + int wait = GetTBValue(pos, 50, 50); + if( pSound->FSKMOD.m_DiddleWait == wait ) wait--; + if( wait < 0 ) wait = 0; + pSound->FSKMOD.m_DiddleWait = wait; + UpdateLWait(); + Key = 0; + } + else if( nKey == sys.m_SysKey[kkDiddleWaitRight] ){ + int pos = SetTBValue(pSound->FSKMOD.m_DiddleWait, 50, 50); + pos+=5; + if( pos > 50 ) pos = 50; + int wait = GetTBValue(pos, 50, 50); + if( pSound->FSKMOD.m_DiddleWait == wait ) wait++; + if( wait > 50 ) wait = 50; + pSound->FSKMOD.m_DiddleWait = wait; + UpdateLWait(); + Key = 0; + } + else if( nKey == sys.m_SysKey[kkInHeightUp] ){ + if( PanelRx->Height > 50 ){ + PanelIn->Height++; + UpdatePanel(); + } + Key = 0; + } + else if( nKey == sys.m_SysKey[kkInHeightDown] ){ + if( PanelIn->Height > 20 ){ + PanelIn->Height--; + UpdatePanel(); + } + Key = 0; + } + else if( nKey == sys.m_SysKey[kkTxLTR] ){ + if( SBTX->Down ){ + FifoEdit.PutChar('%'); + FifoEdit.PutChar('L'); + } + Key = 0; + } + else if( nKey == sys.m_SysKey[kkTxFIG] ){ + if( SBTX->Down ){ + FifoEdit.PutChar('%'); + FifoEdit.PutChar('F'); + } + Key = 0; + } + else if( nKey == sys.m_SysKey[kkDecShift] ){ + int sf; + sscanf(AnsiString(ShiftFreq->Text).c_str(), "%lu", &sf); //JA7UDE 0428 + sf-=2; + m_DisEvent++; + ShiftFreq->Text = sf; + SetShift(sf); + m_DisEvent--; + Key = 0; + } + else if( nKey == sys.m_SysKey[kkIncShift] ){ + int sf; + sscanf(AnsiString(ShiftFreq->Text).c_str(), "%lu", &sf); //JA7UDE 0428 + sf+=2; + m_DisEvent++; + ShiftFreq->Text = sf; + SetShift(sf); + m_DisEvent--; + Key = 0; + } + else if( nKey == sys.m_SysKey[kkToggleShift] ){ + Label3Click(NULL); + Key = 0; + } + else if( nKey == sys.m_SysKey[kkCList] ){ + HisCallDblClick(NULL); + Key = 0; + } + else if( nKey == sys.m_InBtnKey[0] ){ + SBIN1Click(NULL); + Key = 0; + } + else if( nKey == sys.m_InBtnKey[1] ){ + SBIN2Click(NULL); + Key = 0; + } + else if( nKey == sys.m_InBtnKey[2] ){ + SBIN3Click(NULL); + Key = 0; + } + else if( nKey == sys.m_InBtnKey[3] ){ + SBIN4Click(NULL); + Key = 0; + } + else { + int i; + for( i = 0; i < 16; i++ ){ // ƒ}ƒNƒƒ{ƒ^ƒ“ + if( nKey == sys.m_UserKey[i] ){ + MacBtnExec(i); + Key = 0; + return; + } + } + for( i = 0; i < MSGLISTMAX; i++ ){ // ƒƒbƒZ[ƒWƒŠƒXƒg + if( nKey == sys.m_MsgKey[i] ){ + AnsiString as = sys.m_MsgName[i]; + FindMsgList(as); + Key = 0; + return; + } + } + for( i = 0; i < 5; i++ ){ + if( nKey == Log.m_LogSet.m_QSOMacroKey[i] ){ + if(!Log.m_LogSet.m_QSOMacroStr[i].IsEmpty()){ + ToTX(Log.m_LogSet.m_QSOMacroStr[i].c_str()); + OutputStr(Log.m_LogSet.m_QSOMacroStr[i].c_str()); + return; + } + } + } + for( i = 0; i < 16; i++ ){ // ƒ}ƒNƒ•ÒWƒ{ƒ^ƒ“ + if( nKey == sys.m_UserEditKey[i] ){ + EditMB(i); + Key = 0; + return; + } + } + } +} +//--------------------------------------------------------------------------- +// ƒL[ƒ{[ƒh +void __fastcall TMmttyWd::FormKeyUp(TObject *Sender, WORD &Key, + TShiftState Shift) +{ + int n; + switch(Key){ + case VK_UP: + case VK_DOWN: + case VK_LEFT: + case VK_RIGHT: + FormKeyDown(Sender, Key, Shift); + break; + case VK_TAB: + AdjustFocus(); + n = 4 - (FifoEdit.m_WriteCol % 4); + for( ; n; n-- ) FifoEdit.PutChar(' '); + break; + } + Key = 0; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SetGreetingString(LPSTR t, LPCSTR pCall, int type) +{ + strcpy(t, type ? "" : "HELLO"); + if( !Cty.IsData() ) return; + LPCSTR p = ClipCC(pCall); + if( *p ){ + int n; + if( (n = Cty.GetNoP(p))!=0 ){ + CTL *cp = Cty.GetCTL(n-1); + if( cp->TD != NULL ){ + SYSTEMTIME now; + GetUTC(&now); + + WORD tim = WORD((now.wHour * 60 + now.wMinute) * 30 + now.wSecond/2); + tim = AdjustRolTimeUTC(tim, *cp->TD); + if( tim ){ + tim /= WORD(30); + if( tim < 12*60 ){ + strcpy(t, type ? "GM" : "GOOD MORNING"); + } + else if( tim < 18*60 ){ + strcpy(t, type ? "GA" : "GOOD AFTERNOON"); + } + else { + strcpy(t, type ? "GE" : "GOOD EVENING"); + } + } + } + } + + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::StoreCWID(LPSTR &tt, char c, int &nc, int size) +{ + const USHORT _tbl[]={ + // 0 1 2 3 4 5 6 7 + 0x0005, 0x8005, 0xc005, 0xe005, 0xf005, 0xf805, 0x7805, 0x3805, // 0-7 + // 8 9 : ; < = > ? + 0x1805, 0x0805, 0x0000, 0x0000, 0xe806, 0x7005, 0xA805, 0xcc06, // 8 + // @ A B C D E F G + 0x0000, 0x8002, 0x7004, 0x5004, 0x6003, 0x8001, 0xd004, 0x2003, // @-G + // H I J K L M N O + 0xf004, 0xc002, 0x8004, 0x4003, 0xb004, 0x0002, 0x4002, 0x0003, // H-O + // P Q R S T U V W + 0x9004, 0x2004, 0xa003, 0xe003, 0x0001, 0xc003, 0xe004, 0x8003, // P-W + // X Y Z + 0x6004, 0x4004, 0x3004, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // X-Z + }; + + c = char(toupper(c)); + c &= 0x7f; + int d, nn; + if( c == '/' ){ + d = 0x6805; + nn = d & 0x00ff; + } + else if( c == '@' ){ + d = -1; + nn = 3; + } + else if( (c >= '0') && (c <= 'Z') ){ + c -= '0'; + d = _tbl[c]; + nn = d & 0x00ff; + } + else { + d = -1; + nn = 5; + } + if( d == -1 ){ + nc += nn; + if( nc < (size - 1) ){ + for( ; nn; nn-- ){ + *tt++ = '~'; + } + } + } + else { + for( ; nn; nn-- ){ + if( nc < (size - 5) ){ + *tt++ = '_'; nc++; + if( !(d & 0x8000) ){ + *tt++ = '_'; nc++; + *tt++ = '_'; nc++; + } + *tt++ = '~'; nc++; + d = d << 1; + } + } + } + nc += 2; + if( nc < (size - 1) ){ + *tt++ = '~'; + *tt++ = '~'; + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::ConvString(LPSTR t, LPCSTR p, int size, int sw) +{ + int f = (HisCall->Text.IsEmpty() && Log.m_LogSet.m_Contest); + int n, l; + char bf[256]; + SYSTEMTIME now; + + for( n = 0;*p; p++ ){ + if( *p == '%' ){ + p++; + switch(*p){ + case 'm': + strcpy(t, sys.m_Call.c_str()); + break; + case 'c': + strcpy(t, f ? Log.m_asd.call: AnsiString(HisCall->Text).c_str()); //JA7UDE 0428 + break; + case 'n': + if( HisName->Text.IsEmpty() ){ + strcpy(t, "OM"); + } + else { + strcpy(t, AnsiString(HisName->Text).c_str()); //JA7UDE 0428 + } + break; + case 'q': + strcpy(t, AnsiString(HisQTH->Text).c_str()); //JA7UDE 0428 + break; + case 'r': + strcpy(t, f ? Log.m_asd.ur: AnsiString(HisRST->Text).c_str()); //JA7UDE 0428 + break; + case 's': + strcpy(t, f ? Log.m_asd.my: AnsiString(MyRST->Text).c_str()); //JA7UDE 0428 + break; + case 'R': + strcpy(bf, f ? Log.m_asd.ur: AnsiString(HisRST->Text).c_str()); //JA7UDE 0428 + if( strlen(bf) >= 3 ){ + StrCopy(t, bf, 3); + } + else { + strcpy(t, "599"); + } + break; + case 'N': + strcpy(bf, f ? Log.m_asd.ur: AnsiString(HisRST->Text).c_str()); //JA7UDE 0428 + if( strlen(bf) > 3 ){ + strcpy(t, &bf[3]); + } + else { + *t = 0; + } + break; + case 'M': + strcpy(bf, f ? Log.m_asd.my: AnsiString(MyRST->Text).c_str()); //JA7UDE 0428 + if( strlen(bf) > 3 ){ + strcpy(t, &bf[3]); + } + else { + *t = 0; + } + break; + case 'g': + SetGreetingString(t, AnsiString(HisCall->Text).c_str(), 0); //JA7UDE 0428 + break; + case 'f': + SetGreetingString(t, AnsiString(HisCall->Text).c_str(), 1); //JA7UDE 0428 + break; + case 'L': + if( sw ){ + *t = '%'; + *(t+1) = 'L'; + *(t+2) = 0; + } + else { + *t = 0x1f; + *(t+1) = 0; + } + break; + case 'F': + if( sw ){ + *t = '%'; + *(t+1) = 'F'; + *(t+2) = 0; + } + else { + *t = 0x1b; + *(t+1) = 0; + } + break; + case 'E': + goto _ex; + case 'D': + GetUTC(&now); + switch(Log.m_LogSet.m_DateType){ + case 2: + case 3: + sprintf(t, "%02u-%s-%04u", now.wDay, MONT1[now.wMonth], now.wYear); + break; + case 4: + case 5: + sprintf(t, "%s-%02u-%04u", MONT1[now.wMonth], now.wDay, now.wYear); + break; + default: + sprintf(t, "%04u-%s-%02u", now.wYear, MONT1[now.wMonth], now.wDay); + break; + } + break; + case 'T': + GetUTC(&now); + sprintf(t, "%02u:%02u", now.wHour, now.wMinute); + break; + case 't': + GetUTC(&now); + sprintf(t, "%02u%02u", now.wHour, now.wMinute); + break; + case 'x': + *t = 0; + strcpy(bf, f ? Log.m_asd.ur: AnsiString(HisRST->Text).c_str()); //JA7UDE 0428 + if( strlen(bf) > 3 ){ + LPSTR tt; + StrDlm(tt, &bf[3], '-'); + if( *tt ){ + strcpy(t, tt); + } + } + break; + case 'y': + *t = 0; + strcpy(bf, f ? Log.m_asd.ur: AnsiString(HisRST->Text).c_str()); //JA7UDE 0428 + if( strlen(bf) > 3 ){ + LPSTR p, tt; + p = StrDlm(tt, &bf[3], '-'); + if( *p ){ + strcpy(t, p); + } + } + break; + case '{': + { + p++; + LPSTR tt = t; + int nc = n + 2; + if( nc < (size - 1) ){ + *tt++ = '['; // Disable Diddle + *tt++ = '~'; + } + for( ; *p && *p != '}'; p++ ){ + if( *p == '%' ){ + char src[3]; + src[0] = *p++; + src[1] = *p; + src[2] = 0; + char bbf[1024]; + ConvString(bbf, src, sizeof(bf)-1, 0); + LPCSTR pp; + for( pp = bbf; *pp; pp++ ){ + StoreCWID(tt, *pp, nc, size); + } + } + else { + StoreCWID(tt, *p, nc, size); + } + } + *tt = 0; + } + break; + default: + strcpy(t, "%%"); + break; + } + l = strlen(t); + n += l; + if( n >= (size - 1) ) break; + t += l; + } + else if( sw || (*p != '\\') ){ + *t++ = *p; + n++; + } + if( n >= (size - 1) ) break; + } +_ex:; + *t = 0; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::OutputStr(LPCSTR pOut) +{ + char bf[1024]; + BYTE OutBf[1024]; + + if( m_NowStr.c_str() != pOut ) m_NowStr = pOut; + ConvString(bf, pOut, sizeof(bf), 0); + int i, len; + switch(pSound->FSKMOD.m_BitLen){ + case 7: + case 8: + len = strlen(bf); + for( i = 0; i < len; i++ ){ + pSound->FSKMOD.PutData(bf[i]); + if( pComm != NULL ) pComm->PutChar(bf[i]); + } + break; + case 6: + default: + len = rtty.ConvRTTY(OutBf, bf); + for( i = 0; i < len; i++ ){ + pSound->FSKMOD.PutData(OutBf[i]); + if( pComm != NULL ) pComm->PutChar(OutBf[i]); + } + break; + } + LPCSTR p; + for( p = &pOut[strlen(pOut)-1]; p >= pOut; p-- ){ + if( *p == '\\' ){ + m_MacroStat = 1; + m_Macro = 17; + if( SBTX->Down && (pSound != NULL) ){ + pSound->FSKMOD.SetDiddleTimer(-1); + if( pComm != NULL ) pComm->DisDiddle(-1); + } + } + else if( *p == '#' ){ + m_MacroStat = 2; + m_Macro = 17; + if( pSound != NULL ) pSound->FSKMOD.SetDiddleTimer(0); + if( pComm != NULL ) pComm->DisDiddle(0); + } + else if( (*p != 0x0d) && (*p != 0x0a) ){ + break; + } + } +} +//--------------------------------------------------------------------------- +TSpeedButton *__fastcall TMmttyWd::GetSB(int n) +{ + TSpeedButton *_sb[]={SBM1, SBM2, SBM3, SBM4, SBM5, SBM6, SBM7, + SBM8, SBM9, SBM10, SBM11, SBM12, SBM13, SBM14, SBM15, SBM16}; + if( (n >= 0) && (n < AN(_sb)) ){ + return _sb[n]; + } + else { + return NULL; + } +} +//--------------------------------------------------------------------------- +int __fastcall TMmttyWd::GetMacroIndex(TObject *Sender) +{ + for( int i = 0; i < 16; i++ ){ + TSpeedButton *_sb[]={SBM1, SBM2, SBM3, SBM4, SBM5, SBM6, SBM7, + SBM8, SBM9, SBM10, SBM11, SBM12, SBM13, SBM14, SBM15, SBM16}; + + if( ((TObject *)_sb[i]) == Sender ) return i; + } + return -1; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::MacBtnExec(int n) +{ + ClearMacroTimer(); + if( n >= 0 ){ + if( !sys.m_User[n].IsEmpty() ){ + LPCSTR p = sys.m_User[n].c_str(); + if( *p == '#' ){ + WriteFifoEdit(p+1); + } + else { + ToTX(p); + if( *p == '\\' ){ + WriteFifoEdit(p+1); + } + else { + OutputStr(p); + m_Macro = n + 1; + if( sys.m_UserTimer[n] ){ + m_MacTimer = (sys.m_UserTimer[n] * 100) + GetTickCount(); + m_MacRetry = m_Macro; + } + else { + m_MacTimer = 0; + m_MacRetry = 0; + } + GetSB(n)->Down = m_MacTimer ? TRUE : FALSE; + } + } + } + } + AdjustFocus(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SBMClick(TObject *Sender) +{ + TSpeedButton *tp = (TSpeedButton *)Sender; + if( tp->Down ){ + tp->Down = FALSE; + if( sys.m_DisTX&1 ) return; + MacBtnExec(GetMacroIndex(Sender)); + } + else { + ClearMacroTimer(); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::EditMB(int n) +{ + if( n >= 0 ){ + TEditDlgBox *pBox = new TEditDlgBox(this); + pBox->TxBtn->Visible = TRUE; + pBox->ButtonName->Text = sys.m_UserName[n]; + if( pBox->Execute(sys.m_User[n], sys.m_UserKey[n], &sys.m_UserCol[n], &sys.m_UserTimer[n], 1) == TRUE ){ + if( pBox->m_JobSel ){ + AnsiString as = pBox->Memo->Text.c_str(); + LPCSTR p = as.c_str(); + if( *p == '#' ){ + WriteFifoEdit(p+1); + } + else { + ToTX(p); + if( *p == '\\' ){ + WriteFifoEdit(p+1); + } + else { + OutputStr(p); + m_Macro = n + 1; + m_MacTimer = 0; + } + } + } + else if( !pBox->ButtonName->Text.IsEmpty() ){ + sys.m_UserName[n] = pBox->ButtonName->Text; + } + } + delete pBox; + UpdateMacro(); + UpdateShortCut(FALSE); + TopWindow(this); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SBMMouseUp(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y) +{ + if( Button == mbRight ){ + int n = GetMacroIndex(Sender); + EditMB(n); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::FindCall(void) +{ + CWaitCursor w; + m_Dupe = 0; + StrCopy(Log.m_sd.call, AnsiString(HisCall->Text).c_str(), MLCALL); //JA7UDE 0428 + AddCall(Log.m_sd.call); + if( Log.FindSet(&Log.m_Find, Log.m_sd.call) ){ + Log.SetFreq(&Log.m_sd, AnsiString(Freq->Text).c_str()); //JA7UDE 0428 + SDMMLOG sd; + Log.GetData(&sd, Log.m_Find.pFindTbl[0]); // ˆê”ÔÅV‚̃f[ƒ^ + if( Log.m_Find.m_FindCmp1Max && ((!Log.m_LogSet.m_CheckBand) || Log.FindSameBand()) ){ + m_Dupe = 1; + } + else { + m_Dupe = 0; + } + if( (!SBQSO->Down || !Log.m_sd.name[0] ) && Log.m_LogSet.m_CopyName ) strcpy(Log.m_sd.name, sd.name); + if( (!SBQSO->Down || !Log.m_sd.qth[0] ) && Log.m_LogSet.m_CopyQTH ) strcpy(Log.m_sd.qth, sd.qth); + if( (!SBQSO->Down || !Log.m_sd.rem[0] ) && Log.m_LogSet.m_CopyREM ) strcpy(Log.m_sd.rem, sd.rem); + if( (!SBQSO->Down || !Log.m_sd.qsl[0] ) && Log.m_LogSet.m_CopyQSL ) strcpy(Log.m_sd.qsl, sd.qsl); + UpdateTextData(); + if( SBQSO->Down ){ + Log.m_Find.Ins(Log.m_CurNo); + UpdateTextData(); + Log.PutData(&Log.m_sd, Log.m_CurNo); + } + } + else { + if( !SBQSO->Down && Log.m_LogSet.m_CopyName ) Log.m_sd.name[0] = 0; + if( !SBQSO->Down && Log.m_LogSet.m_CopyQTH ) Log.m_sd.qth[0] = 0; + if( !SBQSO->Down && Log.m_LogSet.m_CopyREM ) Log.m_sd.rem[0] = 0; + if( !SBQSO->Down && Log.m_LogSet.m_CopyQSL ) Log.m_sd.qsl[0] = 0; + UpdateTextData(); + } + LPCSTR pCC = ClipCC(Log.m_sd.call); + Log.SetOptStr(0, &Log.m_sd, Cty.GetCountry(pCC)); + Log.SetOptStr(1, &Log.m_sd, Cty.GetCont(pCC)); + UpdateCallsign(); + if( !SBQSO->Down ){ + LogLink.SetMode("RTTY"); + LogLink.SetFreq(AnsiString(Freq->Text).c_str()); //JA7UDE 0428 + LogLink.FindCall(Log.m_sd.call); + } + else { + LogLink.Write(&Log.m_sd, 1); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SetYourCallsign(LPCSTR pCall) +{ + if( strcmpi(sys.m_Call.c_str(), pCall) ){ + HisCall->Text = pCall; + FindCall(); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SetYourName(LPCSTR pName) +{ + HisName->Text = pName; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SetYourQTH(LPCSTR pQTH) +{ + HisQTH->Text = pQTH; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SetYourRST(LPCSTR pRST) +{ + MyRST->Text = pRST; +} +//--------------------------------------------------------------------------- +static void __fastcall StoreZone(LPSTR t, LPSTR p) +{ + char rst[4]; + char qth[20]; + + rst[0] = qth[0] = 0; + StrCopy(rst, t, 3); + if( !rst[0] ) strcpy(rst, "599"); + if( strlen(t) > 5 ){ + StrCopy(qth, t+5, 20); + } + if( !memcmp(p, "599", 3) ) p+=3; + int d; + sscanf(p, "%u", &d); + sprintf(t, "%s%02u%s", rst, d, qth); +} +//--------------------------------------------------------------------------- +static void __fastcall StoreQTH(LPSTR t, LPSTR p) +{ + char rst[4]; + char zone[3]; + + rst[0] = zone[0] = 0; + StrCopy(rst, t, 3); + if( !rst[0] ) strcpy(rst, "599"); + if( strlen(t) > 3 ){ + StrCopy(zone, t+3, 2); + } + else { + strcpy(zone, " "); + } + sprintf(t, "%s%s%s", rst, zone, p); +} +//--------------------------------------------------------------------------- +static void __fastcall StoreNR(LPSTR t, LPSTR p) +{ + char nr[6]; + StrCopy(nr, p, 5); + if( strlen(nr) < 3 ){ + int n = atoin(nr, -1); + sprintf(nr, "%03u", n); + } + char rst[4]; + char utc[6]; + rst[0] = 0; + LPSTR tt, pp; + pp = StrDlm(tt, t, '-'); + StrCopy(utc, pp, 5); + if( *tt ){ + if( (strlen(tt) > 3) && !utc[0] ){ + int h, m; + sscanf(&tt[3], "%u", &h); + m = h % 100; + h = h / 100; + if( (h >= 0) && (h < 24) && (m >= 0) && (m < 60) ){ + sprintf(utc, "%02u%02u", h, m); + } + } + StrCopy(rst, tt, 3); + } + if( !rst[0] ) strcpy(rst, "599"); + sprintf(t, "%s%s-%s", rst, nr, utc); +} +//--------------------------------------------------------------------------- +static void __fastcall StoreUTC(LPSTR t, LPSTR p) +{ + char rst[MLRST+1]; + char utc[6]; + StrCopy(utc, p, 5); + int h, m; + h = m = 0; + if( sscanf(utc, "%u:%u", &h, &m) != 2 ){ + sscanf(utc, "%u", &h); + m = h % 100; + h = h / 100; + if( (h < 0) || (h >= 24) || (m < 0) || (m >= 60) ){ + StoreNR(t, p); + return; + } + } + sprintf(utc, "%02u%02u", h, m); + rst[0] = 0; + LPSTR tt; + StrDlm(tt, t, '-'); + if( *tt ){ + StrCopy(rst, tt, MLRST); + } + if( !rst[0] ) strcpy(rst, "599"); + sprintf(t, "%s-%s", rst, utc); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::PBoxRxMouseUp(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y) +{ + if( Button == mbMiddle ) return; + char bf[256]; + char bbf[256]; + + ClearMacroTimer(); + AdjustFocus(); + if( Button == mbRight ){ // ‰Eƒ{ƒ^ƒ“ + PrintText.ShiftText(X, Y); + return; + } + PrintText.GetText(bf, X, Y, 0); + if( bf[0] ){ + jstrupr(bf); + if( HisCall->Text.IsEmpty() || (Log.m_LogSet.m_Contest == testPED) ){ + if( strlen(bf) >= 16 ) bf[16] = 0; + SetYourCallsign(bf); + } + else if( Log.m_LogSet.m_Contest ){ // ƒRƒ“ƒeƒXƒg’† + if( (strlen(bf) <= 2) || + !IsCall(bf) || + ((strlen(bf) == 3) && !HisCall->Text.IsEmpty()) + ){ + PrintText.GetText(bf, X, Y, 1); + jstrupr(bf); +// DelChar(bf, '/'); + if( Log.m_LogSet.m_Contest == testCQRJ ){ // CQ/RJ + strcpy(bbf, AnsiString(MyRST->Text).c_str()); //JA7UDE 0428 + if(!IsNumbs(bf)){ // QTH + StoreQTH(bbf, bf); + } + else { // Zone + StoreZone(bbf, bf); + } + } + else if( Log.m_LogSet.m_Contest == testBARTG ){ + strcpy(bbf, AnsiString(MyRST->Text).c_str()); //JA7UDE 0428 + PrintText.GetText(bf, X, Y, 2); + LPSTR p = bf; + for( ; *p && !isdigit(*p); p++ ); + if( *p ){ + if( strchr(p, ':') != NULL ){ + StoreUTC(bbf, p); + } + else if( (strlen(p) <= 3) || (strlen(p) <= 3) || (bbf[4] == '-') ){ + StoreNR(bbf, p); + } + else { + StoreUTC(bbf, p); + } + } + } + else { // Misc + if( (strlen(bf) >= 4) && !memcmp(bf, "599", 3) ){ // 599xx + strcpy(bbf, bf); + } + else if(strlen(AnsiString(MyRST->Text).c_str()) >= 3 ){ //JA7UDE 0428 + strcpy(bbf, AnsiString(MyRST->Text).c_str()); //JA7UDE 0428 + strcpy(&bbf[3], bf); + } + else { + sprintf(bbf, "599%s", bf); + } + } + m_DisEvent++; + MyRST->Text = bbf; + m_DisEvent--; + } + else if( IsCall(bf) ){ + SetYourCallsign(bf); + } + } + else if( IsRST(bf) ){ + if( (!Log.m_LogSet.m_DefMyRST) && SBQSO->Down && !MyRST->Text.IsEmpty() ){ + if( YesNoMB((Font->Charset != SHIFTJIS_CHARSET)? "Change MyRST ?":"MyRST‚ð•ÏX‚µ‚Ü‚·‚©?") != IDYES ) return; + } + SetYourRST(bf); + } + else if( IsCall(bf) ){ + if( strcmpi(bf, sys.m_Call.c_str()) ){ + if( SBQSO->Down && !HisCall->Text.IsEmpty() ){ + if( YesNoMB((Font->Charset != SHIFTJIS_CHARSET)?"Change Callsign?":"ƒR[ƒ‹ƒTƒCƒ“‚ð•ÏX‚µ‚Ü‚·‚©?") != IDYES ) return; + } + SetYourCallsign(bf); + } + } + else if( m_NameQTH ){ + if( SBQSO->Down && !HisQTH->Text.IsEmpty() ){ + if( YesNoMB((Font->Charset != SHIFTJIS_CHARSET)?"Change QTH?":"‚p‚s‚g‚ð•ÏX‚µ‚Ü‚·‚©?") != IDYES ) return; + } + SetYourQTH(bf); + } + else if( IsName(bf) ){ + if( SBQSO->Down && !HisName->Text.IsEmpty() ){ + if( YesNoMB((Font->Charset != SHIFTJIS_CHARSET)?"Change Name?":"–¼‘O‚ð•ÏX‚µ‚Ü‚·‚©?") != IDYES ) return; + } + SetYourName(bf); + } + } + AdjustFocus(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::ScrollBarRxChange(TObject *Sender) +{ + PrintText.ScrollBarChange(); + if( ScrollBarRx->Dragging() == FALSE ){ + TimerFocus(); + } +} + +#if USEPAL +//--------------------------------------------------------------------------- +// Œ»Ý‚̘_—ƒpƒŒƒbƒg‚ð•Ô‚·iTControl::GetPalette‚̃I[ƒoƒ‰ƒCƒhŠÖ”j +HPALETTE __fastcall TMmttyWd::GetPalette(void) +{ + m_PaletteQuery = 1; + if( sys.m_Palette ){ + if( UsrPal == NULL ){ + SetColorIndex(); + } + } + else { + if( UsrPal != NULL ){ + ClosePalette(); + } + } + if( UsrPal != NULL ){ + m_PaletteTimer = 3; + } + return UsrPal; +} +//--------------------------------------------------------------------------- +// ƒpƒŒƒbƒg‚ð휂·‚é +void __fastcall TMmttyWd::ClosePalette(void) +{ + if( UsrPal != NULL ){ + pBitmapWater->Palette = 0; + pBitmapFFTIN->Palette = 0; + pBitmapXY->Palette = 0; + if( pBitmapRx != NULL ) pBitmapRx->Palette = 0; + if( pBitmapIn != NULL ) pBitmapIn->Palette = 0; + ::DeleteObject(UsrPal); + UsrPal = NULL; + sys.d_PaletteMask = 0x00000000; + } + if( pBitmapRx != NULL ){ + PBoxRx->Canvas->Brush->Bitmap = NULL; + PrintText.SetBitmap(NULL); + delete pBitmapRx; + pBitmapRx = NULL; + } + if( pBitmapIn != NULL ){ + PBoxIn->Canvas->Brush->Bitmap = NULL; + FifoEdit.SetBitmap(NULL); + delete pBitmapIn; + pBitmapIn = NULL; + } +} +//--------------------------------------------------------------------------- +// ƒpƒŒƒbƒg‚ð“o˜^‚·‚é +void __fastcall TMmttyWd::SetupPalette(RGBQUAD *pTbl, int max) +{ + struct { /* lgpl */ + WORD palVersion; + WORD palNumEntries; + PALETTEENTRY palPalEntry[256]; + }logpal; + + logpal.palVersion = 0x300; + logpal.palNumEntries = WORD(max); + int n = 0; + for( int i = 0; i < max; i++, n++ ){ + logpal.palPalEntry[i].peRed = pTbl[n].rgbRed; + logpal.palPalEntry[i].peGreen = pTbl[n].rgbGreen; + logpal.palPalEntry[i].peBlue = pTbl[n].rgbBlue; + logpal.palPalEntry[i].peFlags = NULL; //PC_NOCOLLAPSE; /*PC_EXPLICIT;*/ + } + + ClosePalette(); + UsrPal = ::CreatePalette((LOGPALETTE *)&logpal); + if( UsrPal != NULL ){ + sys.d_PaletteMask = 0x02000000; + pBitmapWater->Palette = UsrPal; + pBitmapFFTIN->Palette = UsrPal; + pBitmapXY->Palette = UsrPal; + pBitmapWater->IgnorePalette = FALSE; + pBitmapFFTIN->IgnorePalette = FALSE; + pBitmapXY->IgnorePalette = FALSE; + + pBitmapRx = new Graphics::TBitmap(); + pBitmapRx->Width = 8; + pBitmapRx->Height = 8; + pBitmapRx->Palette = UsrPal; + pBitmapIn = new Graphics::TBitmap(); + pBitmapIn->Width = 8; + pBitmapIn->Height = 8; + pBitmapIn->Palette = UsrPal; + pBitmapRx->IgnorePalette = FALSE; + pBitmapIn->IgnorePalette = FALSE; + for( int y = 0; y < 8; y++ ){ + for( int x = 0; x < 8; x++ ){ + pBitmapRx->Canvas->Pixels[x][y] = TColor(sys.m_ColorRXBack | 0x02000000); + pBitmapIn->Canvas->Pixels[x][y] = TColor(sys.m_ColorINBack | 0x02000000); + } + } + PrintText.SetBitmap(pBitmapRx); + FifoEdit.SetBitmap(pBitmapIn); + PBoxRx->Invalidate(); + PBoxIn->Invalidate(); + } +} +//--------------------------------------------------------------------------- +// ƒJƒ‰[ƒCƒ“ƒfƒbƒNƒX‚ð“o˜^‚·‚é +// 256Color‚̃Jƒ‰[ƒCƒ“ƒfƒbƒNƒX‚Í‚O`‚P‚U‚܂Š+int __fastcall TMmttyWd::EntryColor(RGBQUAD *pTbl, TColor col, int n) +{ + DWORD dd = DWORD(col); // xBGR + + RGBQUAD rq; + + rq.rgbBlue = BYTE(dd>>16); + rq.rgbGreen = BYTE(dd>>8); + rq.rgbRed = BYTE(dd); + rq.rgbReserved = 0; + if( !(n & 0x00ff00) ){ + for( int i = 0; i < 256; i++ ){ + if( (pTbl[i].rgbBlue == rq.rgbBlue) && + (pTbl[i].rgbGreen == rq.rgbGreen) && + (pTbl[i].rgbRed == rq.rgbRed) + ){ + return FALSE; + } + } + } + n &= 0x00ff; + pTbl[n] = rq; + return TRUE; +} +//--------------------------------------------------------------------------- +// ƒrƒbƒgƒ}ƒbƒv‚̃Jƒ‰[ƒe[ƒuƒ‹‚ð“o˜^‚·‚é +void __fastcall TMmttyWd::SetColorIndex(void) +{ + RGBQUAD tbl[256]; + memset(tbl, 0, sizeof(tbl)); + + int n = 0; + if( EntryColor(tbl, sys.m_ColorRXBack, n) ) n++; + if( EntryColor(tbl, sys.m_ColorRX, n) ) n++; + if( EntryColor(tbl, sys.m_ColorRXTX, n) ) n++; + if( EntryColor(tbl, sys.m_ColorINBack, n) ) n++; + if( EntryColor(tbl, sys.m_ColorIN, n) ) n++; + if( EntryColor(tbl, sys.m_ColorINTX, n) ) n++; + if( EntryColor(tbl, sys.m_ColorXY, n) ) n++; + for( int i = 0; i < 128; n++, i++ ){ + tbl[n].rgbRed =(unsigned char)(ColorTable[n]); + tbl[n].rgbGreen=(unsigned char)(ColorTable[n] >> 8); + tbl[n].rgbBlue =(unsigned char)(ColorTable[n] >> 16); + } +#if 0 // ƒJƒ‰[‰‰ŽZ‚ðs‚í‚È‚¢‚̂ŕs—v + + // 16`255‚Í‚·‚ׂĕ + for( ;n < 256; n++ ){ + memset(&tbl[n], 0, sizeof(RGBQUAD)); + } + + // ƒzƒƒCƒgi•K‚¸0xff‚É“o˜^j + EntryColor(tbl, clWhite, 0x01ff); + + // Šî–{F‚Ì“o˜^ + const TColor tt[]={ + clAqua, clBlack, clBlue, clDkGray, clFuchsia, clGray, clGreen, clLime, + clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, + clWhite, clYellow, + clActiveBorder, clActiveCaption, clAppWorkSpace, clBackground, + clBtnFace, clBtnHighlight, clBtnShadow, clBtnText, clCaptionText, + clGrayText, clHighlight, clHighlightText, clInactiveBorder, + clInactiveCaption, clInactiveCaptionText, clMenu, clMenuText, + clScrollBar, clWindow, clWindowFrame, clWindowText, + }; + n = 254; + for( int i = 0; i < (sizeof(tt)/sizeof(TColor)); i++ ){ + if( EntryColor(tbl, tt[i], n) ) n--; + } +#endif + SetupPalette(tbl, n); +} +#endif +//--------------------------------------------------------------------------- +// FFT IN MOUSE Event +void __fastcall TMmttyWd::PBoxFFTINMouseDown(TObject *Sender, + TMouseButton Button, TShiftState Shift, int X, int Y) +{ + if( pSound == NULL ) return; + if( sys.m_echo != 2 ){ + ClearMacroTimer(); + if( SBTX->Down ){ + AdjustFocus(); + return; + } + } + + double mfq = pSound->GetScreenFreq(X, PBoxFFTIN->Width, KXYScope->Checked ? PBoxXY->Width : 0); + if( Button == mbRight ){ + if( pSound->m_lms.m_Type){ + if( !SBLMS->Down ){ + pSound->m_lms.m_lmsNotch2 = 0; + pSound->m_lms.m_lmsNotch = int(mfq + 0.5); + SBLMS->Down = TRUE; + SBLMSClick(NULL); + } + else { + pSound->m_lms.m_lmsNotch2 = pSound->m_lms.m_lmsNotch; + pSound->m_lms.m_lmsNotch = int(mfq + 0.5); + pSound->CalcBPF(); + } + RemoteFreq(); + } + } + else { + mfq = double(int(mfq + 0.5)); + if( fabs(mfq - pSound->FSKDEM.GetMarkFreq()) >= 2 ){ + double sft = pSound->FSKDEM.GetSpaceFreq() - pSound->FSKDEM.GetMarkFreq(); + double sfq = mfq + sft; + if( (mfq >= MARKL) && (sfq <= SPACEH) ){ + pSound->FSKDEM.SetMarkFreq(mfq); + pSound->FSKDEM.SetSpaceFreq(sfq); + if( !SBTX->Down ){ + pSound->FSKMOD.SetMarkFreq(mfq); + pSound->FSKMOD.SetSpaceFreq(sfq); + } + if( pRadio != NULL ) pRadio->SetMarkFreq(mfq); + if( SBBPF->Down || SBLMS->Down ) pSound->CalcBPF(); + RemoteFreq(); + UpdateItem(); + } + } + } + AdjustFocus(); + +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::ScrollBarInChange(TObject *Sender) +{ + if( m_DisEvent ) return; + + FifoEdit.ScrollBarChange(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SBINClearClick(TObject *Sender) +{ + MsgList->Text = ""; + FifoEdit.Clear(); + AdjustFocus(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::WriteFifoEdit(LPCSTR s) +{ + while((*s == '\\')||(*s == '#') ){ + if( *s == '\\' ){ + FifoEdit.Clear(); + } + else if( !SBTX->Down ){ + ToTX(s); + } + s++; + } + LPSTR bp = new char[strlen(s)+1]; + strcpy(bp, s); + LPSTR p; + for( p = bp; *p; p++ ){ // %E ‚ÍI—¹‚ð’è‹`I—¹ + if( (*p == '%') && (*(p+1) == 'E') ){ + *p = 0; + break; + } + } + if( sys.m_MacroImm ){ + char bf[1024]; + ConvString(bf, bp, sizeof(bf), 1); + FifoEdit.PutText(bf); + } + else { + FifoEdit.PutText(bp); + } + delete bp; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SBIN1Click(TObject *Sender) +{ + WriteFifoEdit(sys.m_InBtn[0].c_str()); + AdjustFocus(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SBIN2Click(TObject *Sender) +{ + WriteFifoEdit(sys.m_InBtn[1].c_str()); + AdjustFocus(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SBIN3Click(TObject *Sender) +{ + WriteFifoEdit(sys.m_InBtn[2].c_str()); + AdjustFocus(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SBIN4Click(TObject *Sender) +{ + WriteFifoEdit(sys.m_InBtn[3].c_str()); + AdjustFocus(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SBINMouseUp(int n) +{ + TEditDlgBox *pBox = new TEditDlgBox(this); + pBox->Caption = (Font->Charset != SHIFTJIS_CHARSET)? "Edit Button":"“ü—̓{ƒ^ƒ“•ÒW"; + pBox->ButtonName->Text = sys.m_InBtnName[n]; + if( pBox->Execute(sys.m_InBtn[n], sys.m_InBtnKey[n], &sys.m_InBtnCol[n], NULL, 0) == TRUE ){ + if( !pBox->ButtonName->Text.IsEmpty() ){ + sys.m_InBtnName[n] = pBox->ButtonName->Text; + } + } + delete pBox; + UpdateMacro(); + UpdateShortCut(FALSE); + TopWindow(this); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SBIN1MouseUp(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y) +{ + if( Button == mbRight ) SBINMouseUp(0); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SBIN2MouseUp(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y) +{ + if( Button == mbRight ) SBINMouseUp(1); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SBIN3MouseUp(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y) +{ + if( Button == mbRight ) SBINMouseUp(2); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SBIN4MouseUp(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y) +{ + if( Button == mbRight ) SBINMouseUp(3); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::UpdateMsgList(void) +{ + m_DisEvent++; + MsgList->Clear(); + int i; + for( i = 0; i < MSGLISTMAX; i++ ){ + if( sys.m_MsgName[i].IsEmpty() ) break; + MsgList->Items->Add(sys.m_MsgName[i]); + } + UpdateShortCut(FALSE); + m_DisEvent--; +} +//--------------------------------------------------------------------------- +// ƒVƒ‡[ƒgƒJƒbƒg‚Å’T‚· +void __fastcall TMmttyWd::FindMsgLst(WORD nKey) +{ + for( int i = 0; i < MSGLISTMAX; i++ ){ + if( sys.m_MsgName[i].IsEmpty() ) break; + if( sys.m_MsgKey[i] == nKey ){ + AnsiString as = sys.m_MsgName[i]; + FindMsgList(as); + } + } +} +//--------------------------------------------------------------------------- +// –¼Ì‚Å’T‚· +void __fastcall TMmttyWd::FindMsgList(AnsiString fs) //JA7UDE 0428 +{ + if( m_DisEvent ) return; + m_DisEvent++; + AnsiString as; + int i; + for( i = 0; i < MSGLISTMAX; i++ ){ + if( sys.m_MsgName[i].IsEmpty() ) break; + if( sys.m_MsgName[i] == fs ){ + as = sys.m_MsgList[i]; + WriteFifoEdit(as.c_str()); + EntryMsg(fs, as, sys.m_MsgKey[i]); + MsgList->Text = fs; + break; + } + } + AdjustFocus(); + m_DisEvent--; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::MsgListChange(TObject *Sender) +{ + FindMsgList(AnsiString(MsgList->Text)); //JA7UDE 0428 +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SBINEditClick(TObject *Sender) +{ + TEditDlgBox *pBox = new TEditDlgBox(this); + + pBox->EditMsg(); + delete pBox; + UpdateMsgList(); + TopWindow(this); +} +//--------------------------------------------------------------------------- +// ƒIƒvƒVƒ‡ƒ“ƒƒjƒ…[‚ðŠJ‚­ +void __fastcall TMmttyWd::DoOption(TObject *Sender, int sw) +{ +// CWaitCursor wait; + TOptionDlg *pBox = new TOptionDlg(this); + m_hOptionWnd = pBox->Handle; + + m_DisEvent++; + int fontadj = sys.m_FontAdjSize; + int Palette = sys.m_Palette; + pBox->CheckPalette->Enabled = m_PaletteQuery; + if( Sender == KMacro ){ + PageIndex = 3; + } + int stereo = sys.m_SoundStereo; + int fiforx = sys.m_SoundFifoRX; + int fifotx = sys.m_SoundFifoTX; + double txoffset = sys.m_TxOffset; + AnsiString pttname = sys.m_TxRxName; + AnsiString MMW = sys.m_SoundMMW; + if( Remote ){ + if( sw ) ::EnableWindow(APP_HANDLE, FALSE); + PostApp(TXM_SHOWSETUP, 1); + } + int r = pBox->Execute(&pSound->FSKDEM, &pSound->FSKMOD); + if( Remote && sw ) ::EnableWindow(APP_HANDLE, TRUE); + if( r ){ + RemoteStat(); + if( r == 2 ){ + PrintText.SetPaintBox(PBoxRx, ScrollBarRx); + FifoEdit.SetPaintBox(PBoxIn, ScrollBarIn); + } + PrintText.AdjZero(); + if( pBox->m_ColorChange ){ + InitColorTable(sys.m_ColorLow, sys.m_ColorHigh); + UpdateColor(); + } + if( Palette != sys.m_Palette ){ + if( !sys.m_Palette && (UsrPal != NULL) ){ + ClosePalette(); + } + m_ReqPaletteChange = 1; + } + if( (int(pSound->m_IDDevice) != sys.m_SoundDevice) || + (fiforx != sys.m_SoundFifoRX) || + (fifotx != sys.m_SoundFifoTX) || + (txoffset != sys.m_TxOffset) || + (MMW != sys.m_SoundMMW) || + (stereo != sys.m_SoundStereo) ){ +// pSound->m_IDDevice = sys.m_SoundDevice; + pSound->InitSound(); + } + pSound->TaskPriority(); + UpdateSystemFont(); + if( sys.m_SampFreq != SampFreq ){ + if( Font->Charset != SHIFTJIS_CHARSET ){ + InfoMB( "Please restart %s for the new sampling frequency.", Remote ? "application":"MMTTY"); + } + else { + InfoMB( "V‚µ‚¢ƒTƒ“ƒvƒŠƒ“ƒOŽü”g”‚ð“K—p‚³‚¹‚邽‚ß‚É%s‚ðÄ‹N“®‚µ‚ĉº‚³‚¢.", Remote ? "ƒAƒvƒŠƒP[ƒVƒ‡ƒ“":"MMTTY" ); + } + } + if( (pttname != sys.m_TxRxName) || ((pComm == NULL)&&strcmp(sys.m_TxRxName.c_str(), "NONE")) ){ + COMM.change = 1; + } + if( pRadio != NULL ) pRadio->SetMarkFreq(pSound->FSKDEM.GetMarkFreq()); + rtty.SetCodeSet(); rttysub.SetCodeSet(); + } + delete pBox; + m_hOptionWnd = NULL; + UpdateItem(); + UpdateMacro(); + UpdateLMS(); + UpdateMsgList(); + UpdateLWait(); + if( fontadj != sys.m_FontAdjSize ){ + FormResize(NULL); + } + OpenCloseCom(); + m_DisEvent--; + TopWindow(this); + AdjustFocus(); + if( Remote ) PostApp(TXM_SHOWSETUP, 0); +} +//--------------------------------------------------------------------------- +// ƒIƒvƒVƒ‡ƒ“ƒƒjƒ…[‚ðŠJ‚­ +void __fastcall TMmttyWd::KOptionClick(TObject *Sender) +{ + DoOption(Sender, 0); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::HisCallKeyPress(TObject *Sender, char &Key) +{ + if( (Key == 0x0d)||(Key == 0x1b) ){ + if( (Key == 0x0d) && (Sender == HisCall) ){ + FindCall(); + } + AdjustFocus(); + Key = 0; + } + else { + Key = char(toupper(Key)); + } +} +//--------------------------------------------------------------------------- +// ƒIƒVƒƒXƒR[ƒv•\ަ +void __fastcall TMmttyWd::KOSClick(TObject *Sender) +{ + TTScope *pBox = new TTScope(this); + + m_DisEvent++; + pBox->Execute(&pSound->FSKDEM, &pSound->FSKMOD); + delete pBox; + pSound->FSKDEM.m_Scope = 0; + UpdateItem(); + UpdateMacro(); + UpdateMsgList(); + TopWindow(this); + m_DisEvent--; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KFFTClick(TObject *Sender) +{ + if( m_DisEvent ) return; + + pSound->m_FFTSW = pSound->m_FFTSW ? 0 : 1; + KFFT->Checked = pSound->m_FFTSW; + if( pSound->m_FFTSW ){ + pSound->fftIN.m_FFTDIS = 0; + } + UpdateUI(); + PBoxFFTIN->Invalidate(); + PBoxWater->Invalidate(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KWebHHTClick(TObject *Sender) +{ + WebRef.ShowHTML("http://www33.ocn.ne.jp/~je3hht/"); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KWebJARTSClick(TObject *Sender) +{ + WebRef.ShowHTML("http://jarts.web.fc2.com/"); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KWebGRPClick(TObject *Sender) +{ + WebRef.ShowHTML("http://groups.yahoo.com/group/MMTTY/join"); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KWebENGClick(TObject *Sender) +{ + WebRef.ShowHTML("http://mmhamsoft.amateur-radio.ca/"); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KWebWSKClick(TObject *Sender) +{ + WebRef.ShowHTML("http://home.b01.itscom.net/ja1wsk/"); +} +//--------------------------------------------------------------------------- +// MMTTY.Txt‚Ì•\ަƒƒjƒ…[ +void __fastcall TMmttyWd::KHlpTxtClick(TObject *Sender) +{ + ShowHelp(this, sys.m_Help.c_str()); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KHlpLogClick(TObject *Sender) +{ + ShowHelp(this, sys.m_HelpLog.c_str()); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KHlpDigClick(TObject *Sender) +{ + ShowHelp(this, sys.m_HelpDigital.c_str()); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KW7TIClick(TObject *Sender) +{ + ShowHelp(this, "W7TI.TXT"); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KRMClick(TObject *Sender) +{ + ShowHelp(this, (Font->Charset != SHIFTJIS_CHARSET) ? "EUpdate.txt" : "Update.txt"); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KVolClick(TObject *Sender) +{ + HWND hWnd = ::FindWindow("Volume Control", NULL); + if( hWnd != NULL ){ + ::PostMessage(hWnd, WM_CLOSE, 0, 0); + ::Sleep(200); + } + char cmd[128]; + + //AA6YQ 1.66G + + if (WinVista) { + if (Sender == KVolIn) { + strcpy(cmd, "control.exe mmsys.cpl,,1"); + } + else { + strcpy(cmd, "sndvol.exe"); + } + } + else { + + strcpy(cmd, "SNDVOL32.EXE"); + if( WinNT && (Sender == KVolIn) ) strcat(cmd, " /R"); + } + + WinExec(cmd, SW_SHOW); + + if((!WinVista) && (!WinNT) && (Sender == KVolIn) ){ + CWaitCursor w; + int i; + for( i = 0; i < 30; i++ ){ + ::Sleep(100); + hWnd = ::FindWindow("Volume Control", NULL); + if( hWnd != NULL ) break; + } + if( i < 30 ){ + ::SetForegroundWindow(hWnd); + ::Sleep(100); + const short _tt[]={ + VK_MENU, 'P', 'P'|0x8000, VK_MENU|0x8000, + 'R', 'R'|0x8000, VK_TAB, VK_TAB|0x8000, + VK_DOWN, VK_DOWN|0x8000, VK_RETURN, VK_RETURN|0x8000, + 0 + }; + KeyEvent(_tt); + } + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KRcvLogClick(TObject *Sender) +{ + sys.m_log = sys.m_log ? 0 : 1; + PrintText.MakeLogName(); + PrintText.OpenLogFile(); + if( sys.m_logTimeStamp ) PrintText.TrigTimeStamp("Start Logging"); +} +//--------------------------------------------------------------------------- +int __fastcall TMmttyWd::OutputFile(LPCSTR pName) +{ +#if 1 + if( p_SendFileDlg != NULL ){ + delete p_SendFileDlg; + p_SendFileDlg = NULL; + } + p_SendFileDlg = new TSendFileDlg(this); + if( p_SendFileDlg->Start(pName, Top + (Height - ClientHeight) + PanelStat->Top) == FALSE ){ + delete p_SendFileDlg; + p_SendFileDlg = NULL; + } + else { + ToTX(NULL); + } +#else + char bf[2048]; + AnsiString in; + FILE *fp; + + CWaitCursor w; + if( (fp = fopen(pName, "rt"))!=NULL ){ + while(!feof(fp)){ + if( fgets(bf, 2048, fp) != NULL ){ + ClipLF(bf); + in += bf; + in += "\r\n"; + } + } + fclose(fp); + } + else { + ErrorMB((Font->Charset != SHIFTJIS_CHARSET) ? "'%s' was not found":"'%s'‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ.", pName); + return FALSE; + } + ToTX(in.c_str()); + OutputStr(in.c_str()); +#endif + return TRUE; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KFileOutClick(TObject *Sender) +{ + OpenDialog->Options >> ofCreatePrompt; + OpenDialog->Options << ofFileMustExist; + if(Font->Charset != SHIFTJIS_CHARSET){ + OpenDialog->Title = "Open Text file for TX"; + OpenDialog->Filter = "Text files(*.txt)|*.txt|All files(*.*)|*.*|"; + } + else { + OpenDialog->Title = "‘—M‚·‚éƒeƒLƒXƒgƒtƒ@ƒCƒ‹‚ðŠJ‚­"; + OpenDialog->Filter = "ƒeƒLƒXƒgƒtƒ@ƒCƒ‹(*.txt)|*.txt|‚·‚ׂẴtƒ@ƒCƒ‹(*.*)|*.*|"; + } + OpenDialog->FileName = ""; + OpenDialog->DefaultExt = "txt"; + OpenDialog->InitialDir = OutFileDir; + DisPaint = TRUE; + NormalWindow(this); + if( OpenDialog->Execute() == TRUE ){ + if( OutputFile(AnsiString(OpenDialog->FileName).c_str()) == TRUE ){ //JA7UDE 0428 + SetDirName(OutFileDir, AnsiString(OpenDialog->FileName).c_str()); //JA7UDE 0428 + } + } + TopWindow(this); + DisPaint = FALSE; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KSaveRxClick(TObject *Sender) +{ + if( (Font->Charset != SHIFTJIS_CHARSET) ){ + SaveDialog->Title = "Write Text file"; + SaveDialog->Filter = "Text files(*.txt)|*.txt|"; + } + else { + SaveDialog->Title = "ƒeƒLƒXƒgƒtƒ@ƒCƒ‹‚Ìì¬"; + SaveDialog->Filter = "ƒeƒLƒXƒgƒtƒ@ƒCƒ‹(*.txt)|*.txt|"; + } + SaveDialog->FileName = "Recv.txt"; + SaveDialog->DefaultExt = "txt"; + SaveDialog->InitialDir = OutFileDir; + DisPaint = TRUE; + NormalWindow(this); + if( SaveDialog->Execute() == TRUE ){ + CWaitCursor w; + AnsiString as; + PrintText.GetString(as); + FILE *fp = fopen(AnsiString(SaveDialog->FileName).c_str(), "wb"); //JA7UDE 0428 + if( fp != NULL ){ + fputs(as.c_str(), fp); + if( fclose(fp) ){ + ErrorMB( (Font->Charset != SHIFTJIS_CHARSET) ? "Write Error to '%s'":"'%s'‚ɳ‚µ‚­‘‚«‚±‚߂܂¹‚ñ‚Å‚µ‚½.", SaveDialog->FileName.c_str()); + } + else { + SetDirName(OutFileDir, AnsiString(SaveDialog->FileName).c_str()); //JA7UDE 0428 + } + } + else { + ErrorMB((Font->Charset != SHIFTJIS_CHARSET)?"Write Error to '%s'": "'%s'‚ð쬂ł«‚Ü‚¹‚ñ.", SaveDialog->FileName.c_str()); + } + } + TopWindow(this); + DisPaint = FALSE; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KExitClick(TObject *Sender) +{ + Close(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KLogClick(TObject *Sender) +{ + DisPaint = TRUE; + TLogListDlg *pBox = new TLogListDlg(this); + pBox->Execute(); + Application->OnIdle = OnIdle; + delete pBox; + UpdateItem(); + UpdateLogLink(); + AdjustFocus(); + TopWindow(this); + DisPaint = FALSE; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::UpdateLogData(void) +{ + StrCopy(Log.m_sd.call, AnsiString(HisCall->Text).c_str(), MLCALL); //JA7UDE 0428 + jstrupr(Log.m_sd.call); + StrCopy(Log.m_sd.name, AnsiString(HisName->Text).c_str(), MLNAME); //JA7UDE 0428 + StrCopy(Log.m_sd.qth, AnsiString(HisQTH->Text).c_str(), MLQTH); //JA7UDE 0428 + StrCopy(Log.m_sd.my, AnsiString(MyRST->Text).c_str(), MLRST); //JA7UDE 0428 + jstrupr(Log.m_sd.my); + StrCopy(Log.m_sd.ur, AnsiString(HisRST->Text).c_str(), MLRST); //JA7UDE 0428 + jstrupr(Log.m_sd.ur); + Log.SetFreq(&Log.m_sd, AnsiString(Freq->Text).c_str()); //JA7UDE 0428 +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::UpdateTextData(void) +{ + HisCall->Text = Log.m_sd.call; + HisName->Text = Log.m_sd.name; + HisQTH->Text = Log.m_sd.qth; + HisRST->Text = Log.m_sd.ur; + MyRST->Text = Log.m_sd.my; + Freq->Text = Log.GetFreqString(Log.m_sd.band, Log.m_sd.fq); + Log.m_CurChg = 0; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KQSOClick(TObject *Sender) +{ + UpdateLogData(); + if( strcmp(Log.m_Find.GetText(), Log.m_sd.call) ){ + CWaitCursor w; + Log.FindSet(&Log.m_Find, Log.m_sd.call); + } + TQSODlgBox *pBox = new TQSODlgBox(this); + if( pBox->Execute(&Log.m_Find, &Log.m_sd, Log.m_CurNo) == TRUE ){ + UpdateTextData(); + LogLink.Write(&Log.m_sd, 0); + } + delete pBox; + TopWindow(this); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::UpdateCallsign(void) +{ + if( HisCall->Text.IsEmpty() ) m_Dupe = 0; + HisCall->Font->Color = m_Dupe ? clRed : clBlack; + LCall->Font->Color = m_Running ? clRed : clBlack; + KRun->Checked = m_Running; +} +//--------------------------------------------------------------------------- +typedef struct { + int cnt; + int v; + char call[MLCALL+1]; +}CLDT; +//--------------------------------------------------------------------------- +static int _cmp(const void *s, const void *t) +{ + const CLDT *sp = (const CLDT *)s; + const CLDT *tp = (const CLDT *)t; + if( sp->cnt != tp->cnt ){ + return tp->cnt - sp->cnt; + } + else { + return tp->v - sp->v; + } +} +//--------------------------------------------------------------------------- +static int IsNGCall(LPCSTR s) +{ + LPCSTR tt[]={ + "PSE","QTH","QSO","KKK","NAME",NULL + }; + for( int i = 0; tt[i] != NULL; i++ ){ + if( !strcmp(s, tt[i]) ) return 1; + } + return 0; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::CallCapture(void) +{ + CLDT list[16]; + char bf[1024]; + + LPSTR p, t, tt; + int n = 0; + int max = 0; + memset(list, 0, sizeof(list)); + while(PrintText.GetText(bf, n) && (max < 16) ){ + n++; + p = bf; + int l = 0; + while(*p){ + p = StrDlm(t, p, ' '); + + for( ; *t && (!IsCallChar(*t)); t++ ); + for( tt = t; *tt && IsCallChar(*tt); tt++); + *tt = 0; + + if( (strlen(t) >= 3) && IsAlphas(t) && (strlen(t) < MLCALL) && ((strlen(t)<=7)||(strchr(t, '/')!=NULL)) ){ + if( !IsNGCall(t) && strcmp(t, sys.m_Call.c_str()) ){ + if( HisCall->Text.IsEmpty() || strcmp(t, AnsiString(HisCall->Text).c_str()) ){ //JA7UDE 0428 + int j; + for( j = 0; j < max; j++ ){ + if( !strcmp(t, list[j].call) ){ + list[j].cnt++; + break; + } + } + if( j == max ){ + if( max < 16 ){ + strcpy(list[max].call, t); + list[max].cnt = 1; + list[max].v = l - (n*4); + if( !IsCall(t) ){ + list[max].cnt -= 128; + } + if( Log.IsAlready(t) != -1 ){ + list[max].cnt -= 64; + } + max++; + l++; + } + } + } + } + } + } + } + if( max ){ + qsort(list, max, sizeof(CLDT), _cmp); + HisCall->Text = list[0].call; +#if 0 + FILE *fp = fopen("F:\\LOG.TXT", "wt"); + for( int i = 0; i < max; i++ ){ + fprintf(fp, "[%s]\t%d,%d\n", list[i].call, list[i].cnt, list[i].v); + } + fclose(fp); +#endif + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::QSOIN(void) +{ + if( HisCall->Text.IsEmpty() ){ + CallCapture(); + } + if( HisCall->Text.IsEmpty() ) return; + SBQSO->Down = TRUE; + ClearMacroTimer(); + UpdateLogData(); + SYSTEMTIME now; + char bf[256]; + GetUTC(&now); + int Year = now.wYear % 100; + int Month = now.wMonth; + int Day = now.wDay; + int Hour = now.wHour; + UTCtoJST(Year, Month, Day, Hour); + LogLink.SetTime(&now, 0); + + Log.m_sd.cq = m_Running ? 'A' : 'C'; + Log.m_sd.year = char(Year % 100); + Log.m_sd.date = WORD(Month * 100 + Day); + Log.m_sd.btime = WORD((Hour * 60 + now.wMinute) * 30 + now.wSecond/2); + if( !Log.m_sd.btime ) Log.m_sd.btime++; + CWaitCursor w; + if( Log.FindSet(&Log.m_Find, Log.m_sd.call) ){ + SDMMLOG sd; + Log.GetData(&sd, Log.m_Find.pFindTbl[0]); // ˆê”ÔÅV‚̃f[ƒ^ + if( !Log.m_sd.name[0] && Log.m_LogSet.m_CopyName ) strcpy(Log.m_sd.name, sd.name); + if( !Log.m_sd.qth[0] && Log.m_LogSet.m_CopyQTH ) strcpy(Log.m_sd.qth, sd.qth); + if( !Log.m_sd.rem[0] && Log.m_LogSet.m_CopyREM ) strcpy(Log.m_sd.rem, sd.rem); + if( !Log.m_sd.qsl[0] && Log.m_LogSet.m_CopyQSL ) strcpy(Log.m_sd.qsl, sd.qsl); + } + Log.CopyAF(); + if( Log.m_sd.call[0] ){ + LPCSTR pCC = ClipCC(Log.m_sd.call); + Log.SetOptStr(0, &Log.m_sd, Cty.GetCountry(pCC)); + Log.SetOptStr(1, &Log.m_sd, Cty.GetCont(pCC)); + } + if( Log.m_LogSet.m_CopyHis == 2 ) Log.SetHisUTC(); + UpdateTextData(); + if( Log.PutData(&Log.m_sd, Log.m_CurNo) == FALSE ){ + SBQSO->Down = FALSE; + } + + if( Log.m_Find.m_FindCmp1Max && ((!Log.m_LogSet.m_CheckBand) || Log.FindSameBand()) ){ + m_Dupe = 1; + } + else { + m_Dupe = 0; + } + if( Log.m_LogSet.m_QSOMacroFlag ){ // Auto running Macro + if( m_Running ){ // Running + if( m_Dupe ){ + if( Log.m_LogSet.m_QSOMacro[2] && !Log.m_LogSet.m_QSOMacroStr[2].IsEmpty() ){ + ToTX(Log.m_LogSet.m_QSOMacroStr[2].c_str()); + OutputStr(Log.m_LogSet.m_QSOMacroStr[2].c_str()); + } + } + else { + if( Log.m_LogSet.m_QSOMacro[0] && !Log.m_LogSet.m_QSOMacroStr[0].IsEmpty() ){ + ToTX(Log.m_LogSet.m_QSOMacroStr[0].c_str()); + OutputStr(Log.m_LogSet.m_QSOMacroStr[0].c_str()); + } + } + } + else { // S & P + if( Log.m_LogSet.m_QSOMacro[3] && !Log.m_LogSet.m_QSOMacroStr[3].IsEmpty() ){ + ToTX(Log.m_LogSet.m_QSOMacroStr[3].c_str()); + OutputStr(Log.m_LogSet.m_QSOMacroStr[3].c_str()); + } + } + } + + Log.m_Find.Ins(Log.m_CurNo); + Log.m_CurChg = 0; + sprintf(bf, "Start QSO With %s", Log.m_sd.call); + PrintText.TrigTimeStamp(bf); + LogLink.Write(&Log.m_sd, 1); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::QSOOUT(int sw) +{ + if( sw && !SBQSO->Down ){ + if( Log.m_LogSet.m_QSOMacroFlag ){ // Auto running Macro + if( m_Running ){ // Running + if( Log.m_LogSet.m_QSOMacro[1] && !Log.m_LogSet.m_QSOMacroStr[1].IsEmpty() ){ + ToTX(Log.m_LogSet.m_QSOMacroStr[1].c_str()); + OutputStr(Log.m_LogSet.m_QSOMacroStr[1].c_str()); + } + } + else { // S & P + if( Log.m_LogSet.m_QSOMacro[4] && !Log.m_LogSet.m_QSOMacroStr[4].IsEmpty() ){ + ToTX(Log.m_LogSet.m_QSOMacroStr[4].c_str()); + OutputStr(Log.m_LogSet.m_QSOMacroStr[4].c_str()); + } + } + } + return; + } + SBQSO->Down = FALSE; + ClearMacroTimer(); + UpdateLogData(); + SYSTEMTIME now; + char bf[256]; + GetUTC(&now); + int Year = now.wYear % 100; + int Month = now.wMonth; + int Day = now.wDay; + int Hour = now.wHour; + UTCtoJST(Year, Month, Day, Hour); + LogLink.SetTime(&now, 1); + + Log.m_sd.cq = m_Running ? 'A' : 'C'; + Log.m_sd.etime = WORD((Hour * 60 + now.wMinute) * 30 + now.wSecond/2); + if( !Log.m_sd.etime ) Log.m_sd.etime++; + int r; + if( !Log.m_sd.ur[0] ){ + if( Log.m_LogSet.m_Contest == 3 ){ + strcpy(Log.m_sd.ur, "599"); + r = IDYES; + } + else if( (Font->Charset != SHIFTJIS_CHARSET) ){ + r = YesNoCancelMB("No HisRST... Are you sure?"); + } + else { + r = YesNoCancelMB("HisRST‚ªÝ’肳‚ê‚Ä‚¢‚Ü‚¹‚ñ.\r\n\r\n‚±‚̃f[ƒ^‚ð—LŒø‚É‚µ‚Ü‚·‚©H"); + } + switch(r){ + case IDCANCEL: + Log.m_sd.etime = 0; + SBQSO->Down = TRUE; + return; + case IDNO: + Log.DeleteLast(); + Log.m_Find.Clear(); + Log.InitCur(); + UpdateTextData(); + AutoLogSave(); + return; + default: + break; + } + } + if( !Log.m_sd.my[0] ){ + if( Log.m_LogSet.m_Contest == 3 ){ + strcpy(Log.m_sd.my, "599"); + r = IDYES; + } + else if( (Font->Charset != SHIFTJIS_CHARSET) ){ + r = YesNoCancelMB("No MyRST... Are you sure?"); + } + else { + r = YesNoCancelMB("MyRST‚ªÝ’肳‚ê‚Ä‚¢‚Ü‚¹‚ñ.\r\n\r\n‚±‚̃f[ƒ^‚ð—LŒø‚É‚µ‚Ü‚·‚©H"); + } + switch(r){ + case IDCANCEL: + Log.m_sd.etime = 0; + SBQSO->Down = TRUE; + return; + case IDNO: + Log.DeleteLast(); + Log.m_Find.Clear(); + Log.InitCur(); + UpdateTextData(); + AutoLogSave(); + return; + default: + break; + } + } + if( !Log.m_sd.ur[0] || !Log.m_sd.my[0] ){ // –³Œøƒf[ƒ^ + Log.m_sd.send = 'I'; + } + Log.PutData(&Log.m_sd, Log.m_CurNo); + LogLink.Write(&Log.m_sd, 2); + sprintf(bf, "Exit QSO With %s %s %s %s", + Log.m_sd.call, Log.m_sd.ur, Log.m_sd.my, Log.m_sd.name, Log.GetFreqString(Log.m_sd.band, Log.m_sd.fq) + ); + PrintText.TrigTimeStamp(bf); + + if( Log.m_LogSet.m_QSOMacroFlag ){ // Auto running Macro + if( m_Running ){ // Running + if( Log.m_LogSet.m_QSOMacro[1] && !Log.m_LogSet.m_QSOMacroStr[1].IsEmpty() ){ + ToTX(Log.m_LogSet.m_QSOMacroStr[1].c_str()); + OutputStr(Log.m_LogSet.m_QSOMacroStr[1].c_str()); + } + } + else { // S & P + if( Log.m_LogSet.m_QSOMacro[4] && !Log.m_LogSet.m_QSOMacroStr[4].IsEmpty() ){ + ToTX(Log.m_LogSet.m_QSOMacroStr[4].c_str()); + OutputStr(Log.m_LogSet.m_QSOMacroStr[4].c_str()); + } + } + } + + memcpy(&Log.m_asd, &Log.m_sd, sizeof(Log.m_asd)); + Log.m_CurNo++; + Log.m_CurChg = 0; + Log.m_Find.Clear(); + Log.InitCur(); + UpdateTextData(); + AutoLogSave(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SBQSOClick(TObject *Sender) +{ + ClearMacroTimer(); + UpdateLogData(); + SYSTEMTIME now; + char bf[256]; + GetUTC(&now); + int Year = now.wYear % 100; + int Month = now.wMonth; + int Day = now.wDay; + int Hour = now.wHour; + UTCtoJST(Year, Month, Day, Hour); + + Log.m_sd.cq = m_Running ? 'A' : 'C'; + if( SBQSO->Down ){ // Start QSO + LogLink.SetTime(&now, 0); + Log.m_sd.year = char(Year % 100); + Log.m_sd.date = WORD(Month * 100 + Day); + Log.m_sd.btime = WORD((Hour * 60 + now.wMinute) * 30 + now.wSecond/2); + if( !Log.m_sd.btime ) Log.m_sd.btime++; + CWaitCursor w; + if( Log.FindSet(&Log.m_Find, Log.m_sd.call) ){ + SDMMLOG sd; + Log.GetData(&sd, Log.m_Find.pFindTbl[0]); // ˆê”ÔÅV‚̃f[ƒ^ + if( !Log.m_sd.name[0] && Log.m_LogSet.m_CopyName ) strcpy(Log.m_sd.name, sd.name); + if( !Log.m_sd.qth[0] && Log.m_LogSet.m_CopyQTH ) strcpy(Log.m_sd.qth, sd.qth); + if( !Log.m_sd.rem[0] && Log.m_LogSet.m_CopyREM ) strcpy(Log.m_sd.rem, sd.rem); + if( !Log.m_sd.qsl[0] && Log.m_LogSet.m_CopyQSL ) strcpy(Log.m_sd.qsl, sd.qsl); + } + Log.CopyAF(); + if( Log.m_sd.call[0] ){ + LPCSTR pCC = ClipCC(Log.m_sd.call); + Log.SetOptStr(0, &Log.m_sd, Cty.GetCountry(pCC)); + Log.SetOptStr(1, &Log.m_sd, Cty.GetCont(pCC)); + } + if( Log.m_LogSet.m_CopyHis == 2 ) Log.SetHisUTC(); + UpdateTextData(); + if( Log.PutData(&Log.m_sd, Log.m_CurNo) == FALSE ){ + SBQSO->Down = FALSE; + } + + if( Log.m_Find.m_FindCmp1Max && ((!Log.m_LogSet.m_CheckBand) || Log.FindSameBand()) ){ + m_Dupe = 1; + } + else { + m_Dupe = 0; + } + if( Log.m_LogSet.m_QSOMacroFlag ){ // Auto running Macro + if( m_Running ){ // Running + if( m_Dupe ){ + if( Log.m_LogSet.m_QSOMacro[2] && !Log.m_LogSet.m_QSOMacroStr[2].IsEmpty() ){ + ToTX(Log.m_LogSet.m_QSOMacroStr[2].c_str()); + OutputStr(Log.m_LogSet.m_QSOMacroStr[2].c_str()); + } + } + else { + if( Log.m_LogSet.m_QSOMacro[0] && !Log.m_LogSet.m_QSOMacroStr[0].IsEmpty() ){ + ToTX(Log.m_LogSet.m_QSOMacroStr[0].c_str()); + OutputStr(Log.m_LogSet.m_QSOMacroStr[0].c_str()); + } + } + } + else { // S & P + if( Log.m_LogSet.m_QSOMacro[3] && !Log.m_LogSet.m_QSOMacroStr[3].IsEmpty() ){ + ToTX(Log.m_LogSet.m_QSOMacroStr[3].c_str()); + OutputStr(Log.m_LogSet.m_QSOMacroStr[3].c_str()); + } + } + } + + Log.m_Find.Ins(Log.m_CurNo); + Log.m_CurChg = 0; + sprintf(bf, "Start QSO With %s", Log.m_sd.call); + PrintText.TrigTimeStamp(bf); + LogLink.Write(&Log.m_sd, 1); + } + else { // Finish QSO + LogLink.SetTime(&now, 1); + Log.m_sd.etime = WORD((Hour * 60 + now.wMinute) * 30 + now.wSecond/2); + if( !Log.m_sd.etime ) Log.m_sd.etime++; + int r; + if( !Log.m_sd.ur[0] ){ + if( Log.m_LogSet.m_Contest == 3 ){ + strcpy(Log.m_sd.ur, "599"); + r = IDYES; + } + else if( (Font->Charset != SHIFTJIS_CHARSET) ){ + r = YesNoCancelMB("No HisRST... Are you sure?"); + } + else { + r = YesNoCancelMB("HisRST‚ªÝ’肳‚ê‚Ä‚¢‚Ü‚¹‚ñ.\r\n\r\n‚±‚̃f[ƒ^‚ð—LŒø‚É‚µ‚Ü‚·‚©H"); + } + switch(r){ + case IDCANCEL: + Log.m_sd.etime = 0; + SBQSO->Down = TRUE; + return; + case IDNO: + Log.DeleteLast(); + Log.m_Find.Clear(); + Log.InitCur(); + UpdateTextData(); + AutoLogSave(); + return; + default: + break; + } + } + if( !Log.m_sd.my[0] ){ + if( Log.m_LogSet.m_Contest == 3 ){ + strcpy(Log.m_sd.my, "599"); + r = IDYES; + } + else if( (Font->Charset != SHIFTJIS_CHARSET) ){ + r = YesNoCancelMB("No MyRST... Are you sure?"); + } + else { + r = YesNoCancelMB("MyRST‚ªÝ’肳‚ê‚Ä‚¢‚Ü‚¹‚ñ.\r\n\r\n‚±‚̃f[ƒ^‚ð—LŒø‚É‚µ‚Ü‚·‚©H"); + } + switch(r){ + case IDCANCEL: + Log.m_sd.etime = 0; + SBQSO->Down = TRUE; + return; + case IDNO: + Log.DeleteLast(); + Log.m_Find.Clear(); + Log.InitCur(); + UpdateTextData(); + AutoLogSave(); + return; + default: + break; + } + } + if( !Log.m_sd.ur[0] || !Log.m_sd.my[0] ){ // –³Œøƒf[ƒ^ + Log.m_sd.send = 'I'; + } + Log.PutData(&Log.m_sd, Log.m_CurNo); + LogLink.Write(&Log.m_sd, 2); + sprintf(bf, "Exit QSO With %s %s %s %s", + Log.m_sd.call, Log.m_sd.ur, Log.m_sd.my, Log.m_sd.name, Log.GetFreqString(Log.m_sd.band, Log.m_sd.fq) + ); + PrintText.TrigTimeStamp(bf); + + if( Log.m_LogSet.m_QSOMacroFlag ){ // Auto running Macro + if( m_Running ){ // Running + if( Log.m_LogSet.m_QSOMacro[1] && !Log.m_LogSet.m_QSOMacroStr[1].IsEmpty() ){ + ToTX(Log.m_LogSet.m_QSOMacroStr[1].c_str()); + OutputStr(Log.m_LogSet.m_QSOMacroStr[1].c_str()); + } + } + else { // S & P + if( Log.m_LogSet.m_QSOMacro[4] && !Log.m_LogSet.m_QSOMacroStr[4].IsEmpty() ){ + ToTX(Log.m_LogSet.m_QSOMacroStr[4].c_str()); + OutputStr(Log.m_LogSet.m_QSOMacroStr[4].c_str()); + } + } + } + + memcpy(&Log.m_asd, &Log.m_sd, sizeof(Log.m_asd)); + Log.m_CurNo++; + Log.m_CurChg = 0; + Log.m_Find.Clear(); + Log.InitCur(); + UpdateTextData(); + AutoLogSave(); + } +} +//--------------------------------------------------------------------------- +// ƒoƒ“ƒh‚Ì•ÏX +void __fastcall TMmttyWd::FreqChange(TObject *Sender) +{ + if( m_DisEvent ) return; + + Log.SetFreq(&Log.m_sd, AnsiString(Freq->Text).c_str()); //JA7UDE 0428 + LogLink.SetFreq(AnsiString(Freq->Text).c_str()); //JA7UDE 0428 + if( !HisCall->Text.IsEmpty() ){ + FindCall(); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SBFindClick(TObject *Sender) +{ + if( !Log.IsOpen() ){ + if( Log.Open(NULL, TRUE) == FALSE ){ + return; + } + } + FindCall(); + TQSODlgBox *pBox = new TQSODlgBox(this); + pBox->ShowFind(&Log.m_Find); + delete pBox; + TopWindow(this); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SBFindMouseDown(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y) +{ + if( (Button == mbRight) && (!HisCall->Text.IsEmpty()) ){ + FindCall(); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::HisCallChange(TObject *Sender) +{ + Log.m_Find.ClearText(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::LNameClick(TObject *Sender) +{ + m_NameQTH = m_NameQTH ? 0 : 1; + UpdateUI(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SBInitClick(TObject *Sender) +{ + AnsiString as = Freq->Text; + if( SBQSO->Down ){ + int r; + if( Log.m_LogSet.m_Contest ){ + r = IDYES; + } + else { + r = YesNoMB( (Font->Charset != SHIFTJIS_CHARSET) ? "Delete on this QSO. Are you sure?":"‚±‚ÌQSO‚𖳌ø‚É‚µ‚Ü‚·‚©H" ); + } + if( r == IDYES ){ + Log.DeleteLast(); + Log.m_Find.Clear(); + Log.InitCur(); + SBQSO->Down = FALSE; + UpdateTextData(); + } + } + else { + Log.InitCur(); + Log.m_sd.call[0] = 0; + Log.m_sd.name[0] = 0; + Log.m_sd.qth[0] = 0; + UpdateTextData(); + } + if( !as.IsEmpty() ){ + Freq->Text = as; + Log.SetFreq(&Log.m_sd, as.c_str()); + } +#if 0 + HisCall->Text = ""; + HisName->Text = ""; + HisQTH->Text = ""; + MyRST->Text = ""; + HisRST->Text = Log.m_sd.ur; + UpdateLogData(); +#endif + LogLink.Clear(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::PBoxInClick(TObject *Sender) +{ + ClearMacroTimer(); + AdjustFocus(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SBHAMClick(TObject *Sender) +{ + CFSKMOD *mp = &pSound->FSKMOD; + CFSKDEM *dp = &pSound->FSKDEM; + dp->SetMarkFreq(sys.m_DefMarkFreq); + mp->SetMarkFreq(sys.m_DefMarkFreq); + dp->SetSpaceFreq(sys.m_DefMarkFreq + sys.m_DefShift); + mp->SetSpaceFreq(sys.m_DefMarkFreq + sys.m_DefShift); + if( pRadio != NULL ) pRadio->SetMarkFreq(sys.m_DefMarkFreq); + if( SBBPF->Down || SBLMS->Down ) pSound->CalcBPF(); + if( sys.m_TxPort ){ + if( sys.m_DefFix45 ){ + if( dp->GetBaudRate() != 45.45 ) COMM.change = 1; + } + if( dp->m_BitLen != 5 ) COMM.change = 1; + if( dp->m_StopLen != (sys.m_DefStopLen + 3) ) COMM.change = 1; + if( dp->m_Parity != 0 ) COMM.change = 1; + } + if( sys.m_DefFix45 ) dp->SetBaudRate(45.45); + dp->m_BitLen = 5; + dp->m_StopLen = sys.m_DefStopLen + 3; + dp->m_Parity = 0; + if( sys.m_DefFix45 ) mp->SetBaudRate(45.45); + mp->m_BitLen = 5; + mp->m_StopLen = sys.m_DefStopLen + 3; + mp->m_Parity = 0; + UpdateFSK(); + UpdateItem(); + AdjustFocus(); + RemoteStat(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KOpenLogClick(TObject *Sender) +{ + OpenDialog->Options << ofCreatePrompt; + OpenDialog->Options >> ofFileMustExist; + if( (Font->Charset != SHIFTJIS_CHARSET) ){ + OpenDialog->Title = "Open LogData File"; + OpenDialog->Filter = "MMLOG Data Files(*.mdt)|*.mdt|"; + } + else { + OpenDialog->Title = "ƒƒOƒtƒ@ƒCƒ‹‚̃I[ƒvƒ“"; + OpenDialog->Filter = "MMLOGƒf[ƒ^ƒtƒ@ƒCƒ‹(*.mdt)|*.mdt|"; + } + OpenDialog->FileName = ""; + OpenDialog->DefaultExt = "mdt"; + OpenDialog->InitialDir = MMLogDir; + NormalWindow(this); + if( OpenDialog->Execute() == TRUE ){ + Log.Close(); + Log.DoBackup(); + Log.MakeName(AnsiString(OpenDialog->FileName).c_str()); //JA7UDE 0428 + Log.Open(NULL, TRUE); + UpdateItem(); + KLogClick(NULL); + } + TopWindow(this); + AdjustFocus(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::AutoLogSave(void) +{ + if( Log.IsOpen() && Log.m_LogSet.m_AutoSave && Log.IsEdit() ) KFlushClick(NULL); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KFlushClick(TObject *Sender) +{ + Log.Close(); + Log.Open(NULL, TRUE); + AdjustFocus(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KFFTWAClick(TObject *Sender) +{ + pSound->m_FFTFW = 0; + pSound->DrawFFT(pBitmapFFTIN, 1, KXYScope->Checked ? PBoxXY->Width : 0); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KFFTW05Click(TObject *Sender) +{ + pSound->m_FFTFW = 1; + pSound->DrawFFT(pBitmapFFTIN, 1, KXYScope->Checked ? PBoxXY->Width : 0); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KFFTW1Click(TObject *Sender) +{ + pSound->m_FFTFW = 2; + pSound->DrawFFT(pBitmapFFTIN, 1, KXYScope->Checked ? PBoxXY->Width : 0); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KFFTW15Click(TObject *Sender) +{ + pSound->m_FFTFW = 3; + pSound->DrawFFT(pBitmapFFTIN, 1, KXYScope->Checked ? PBoxXY->Width : 0); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KFFTW2Click(TObject *Sender) +{ + pSound->m_FFTFW = 4; + pSound->DrawFFT(pBitmapFFTIN, 1, KXYScope->Checked ? PBoxXY->Width : 0); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KFFTW3Click(TObject *Sender) +{ + pSound->m_FFTFW = 5; + pSound->DrawFFT(pBitmapFFTIN, 1, KXYScope->Checked ? PBoxXY->Width : 0); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::FormShow(TObject *Sender) +{ + if( Remote & REMSHOWOFF ){ + Hide(); + } + else { + AdjustFocus(); + } +} +//--------------------------------------------------------------------------- +// HisRST Box +void __fastcall TMmttyWd::KDispVerClick(TObject *Sender) +{ + TVerDspDlg *pBox = new TVerDspDlg(this); + pBox->ShowModal(); + delete pBox; + TopWindow(this); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KClrRxClick(TObject *Sender) +{ + PrintText.Clear(); +} +//--------------------------------------------------------------------------- +int __fastcall TMmttyWd::DrawXY(void) +{ + if( pSound == NULL ) return FALSE; + + TCanvas *pCanvas = pBitmapXY->Canvas; + CScope *mp = &pSound->FSKDEM.m_XYScopeMark; + CScope *sp = &pSound->FSKDEM.m_XYScopeSpace; + + TRect rc; + int XL = 0; + int XR = pBitmapXY->Width - 1; + int YT = 0; + int YB = pBitmapXY->Height - 1; + int XC = XR/2; + int YC = YB/2; + rc.Left = XL; + rc.Right = XR; + rc.Top = YT; + rc.Bottom = YB+1; + pCanvas->Brush->Color = clBlack; + pCanvas->FillRect(rc); + + if( !pSound->FSKDEM.m_XYScope ) return FALSE; + if( !sp->GetFlag() ) return FALSE; + + + double dmax = 0; + double dm, ds; + int i, x, y; + + if( Remote && (pMap != NULL) && !(Remote & REMDISSHARED) ){ + if( !pMap->flagXY ){ +#if 1 + double *pm = mp->pScopeData; + double *ps = sp->pScopeData; + LONG *tm = pMap->arrayX; + LONG *ts = pMap->arrayY; + if( pSound->FSKDEM.m_Limit ){ + for( i = 0; i < XYCOLLECT; i++ ){ + *tm++ = LONG(*pm++); + *ts++ = LONG(*ps++); + } + } + else { + for( i = 0; i < XYCOLLECT; i++ ){ + *tm++ = LONG(*pm++) * 16384/2048; + *ts++ = LONG(*ps++) * 16384/2048; + } + } +#else + if( pSound->FSKDEM.m_Limit ){ + for( i = 0; i < XYCOLLECT; i++, pm++, ps++ ){ + pMap->arrayX[i] = int(mp->pScopeData[i]); + pMap->arrayY[i] = int(sp->pScopeData[i]); + } + } + else { + for( i = 0; i < XYCOLLECT; i++ ){ + pMap->arrayX[i] = int(mp->pScopeData[i]) * 16384/2048; + pMap->arrayY[i] = int(sp->pScopeData[i]) * 16384/2048; + } + } +#endif + pMap->flagXY = 1; + } + } + if( Remote & REMSHOWOFF ){ + pSound->FSKDEM.m_XYScope = 0; + mp->Collect(XYCOLLECT); + sp->Collect(XYCOLLECT); + pSound->FSKDEM.m_XYScope = 1; + return FALSE; + } + if( pTnc && pTnc->IsMMT() ){ + pTnc->NotifyXY(mp->pScopeData, sp->pScopeData); + } + + double *pm = mp->pScopeData; + double *ps = sp->pScopeData; + for( i = 0; i < XYCOLLECT; i++, pm++, ps++ ){ + dm = fabs(*pm); + ds = fabs(*ps); + if( dmax < dm ) dmax = dm; + if( dmax < ds ) dmax = ds; + } + if( pSound->FSKDEM.m_Limit ){ + if( dmax < 16384.0 ) dmax = 16384.0; + } + else { + if( dmax < 2048.0 ) dmax = 2048.0; + } + int YW = YC * 0.8; + int XW = XC * 0.8; + TColor col = TColor(sys.m_ColorXY | sys.d_PaletteMask); + pCanvas->Pen->Color = col; + + const double _mt[]={1.25, 1.20, 1.20, 1.25}; + double sc; + + double SX = (XW / dmax); + double SY = (YW / dmax); + double dmt[8], dst[8]; + pm = mp->pScopeData; + ps = sp->pScopeData; + int inv = sys.m_XYInv; + if( pSound->FSKDEM.m_type == 1 ) inv = inv ? 0 : 1; + switch(m_XYQuality){ + case 0: + if( inv ){ + for( i = 0; i < XYCOLLECT; i++, pm++, ps++ ){ + x = XC + (*pm * SX); + y = YC - (*ps * SY); + pCanvas->Pixels[x][y] = col; + } + } + else { + for( i = 0; i < XYCOLLECT; i++, pm++, ps++ ){ + x = XC + (*pm * SX); + y = YC + (*ps * SY); + pCanvas->Pixels[x][y] = col; + } + } + break; + case 1: + i2m.Clear(); + i2s.Clear(); + sc = _mt[SampType]; + if( pSound->FSKDEM.GetMarkFreq() < 1600 ) sc *= 0.9; + SX *= sc; + SY *= sc; + for( i = 0; i < XYCOLLECT; i++, pm++, ps++ ){ + dm = *pm; + ds = *ps; + if( inv ) ds = -ds; + i2m.Do(dmt, dm); + i2s.Do(dst, ds); + x = XC + (dmt[0] * SX); + y = YC + (dst[0] * SY); + pCanvas->Pixels[x][y] = col; + x = XC + (dmt[1] * SX); + y = YC + (dst[1] * SY); + pCanvas->Pixels[x][y] = col; + } + break; + case 2: + i4m.Clear(); + i4s.Clear(); + for( i = 0; i < XYCOLLECT; i++, pm++, ps++ ){ + dm = *pm; + ds = *ps; + if( inv ) ds = -ds; + i4m.Do(dmt, dm); + i4s.Do(dst, ds); + x = XC + (dmt[0] * SX); + y = YC + (dst[0] * SY); + pCanvas->Pixels[x][y] = col; + x = XC + (dmt[1] * SX); + y = YC + (dst[1] * SY); + pCanvas->Pixels[x][y] = col; + x = XC + (dmt[2] * SX); + y = YC + (dst[2] * SY); + pCanvas->Pixels[x][y] = col; + x = XC + (dmt[3] * SX); + y = YC + (dst[3] * SY); + pCanvas->Pixels[x][y] = col; + } + break; + default: + i8m.Clear(); + i8s.Clear(); + for( i = 0; i < XYCOLLECT; i++, pm++, ps++ ){ + dm = *pm; + ds = *ps; + if( inv ) ds = -ds; + i8m.Do(dmt, dm); + i8s.Do(dst, ds); + x = XC + (dmt[0] * SX); + y = YC + (dst[0] * SY); + pCanvas->Pixels[x][y] = col; + x = XC + (dmt[1] * SX); + y = YC + (dst[1] * SY); + pCanvas->Pixels[x][y] = col; + x = XC + (dmt[2] * SX); + y = YC + (dst[2] * SY); + pCanvas->Pixels[x][y] = col; + x = XC + (dmt[3] * SX); + y = YC + (dst[3] * SY); + pCanvas->Pixels[x][y] = col; + x = XC + (dmt[4] * SX); + y = YC + (dst[4] * SY); + pCanvas->Pixels[x][y] = col; + x = XC + (dmt[5] * SX); + y = YC + (dst[5] * SY); + pCanvas->Pixels[x][y] = col; + x = XC + (dmt[6] * SX); + y = YC + (dst[6] * SY); + pCanvas->Pixels[x][y] = col; + x = XC + (dmt[7] * SX); + y = YC + (dst[7] * SY); + pCanvas->Pixels[x][y] = col; + } + break; + } + pSound->FSKDEM.m_XYScope = 0; + mp->Collect(XYCOLLECT); + sp->Collect(XYCOLLECT); + pSound->FSKDEM.m_XYScope = 1; + return TRUE; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::UpdateXYScope(void) +{ + if( KXYScope->Checked ){ + if( UsrPal != NULL ){ + ClosePalette(); + m_ReqPaletteChange = 1; + } + PanelXY->Visible = TRUE; + Timer->Interval = 100; + pBitmapXY->Palette = 0; + delete pBitmapXY; + int w; + if( m_XYSize ){ + w = PanelWater->Top - PanelFFT->Top + PanelWater->Height; + KXYBig->Checked = TRUE; + } + else { + w = PanelFFT->Height - 1; + KXYSmall->Checked = TRUE; + } + int left = PanelFFT->Left + PanelFFT->Width - w; + PanelXY->SetBounds(left, PanelFFT->Top, w, w); + pBitmapXY = new Graphics::TBitmap(); + pBitmapXY->Width = PBoxXY->Width; + pBitmapXY->Height = PBoxXY->Height; + if( UsrPal != NULL ){ + pBitmapXY->Palette = UsrPal; + } + } + else { + if( m_XYSize ){ + KXYBig->Checked = TRUE; + } + else { + KXYSmall->Checked = TRUE; + } + PanelXY->Visible = FALSE; + Timer->Interval = 200; + } + if( pSound == NULL ) return; + UpdateXY2(); + if( KXYScope->Checked ){ + DrawXY(); + if( !(Remote & REMSHOWOFF) ){ + PBoxXYPaint(NULL); + } + pSound->FSKDEM.m_XYScopeMark.Collect(XYCOLLECT); + pSound->FSKDEM.m_XYScopeSpace.Collect(XYCOLLECT); + } + pSound->FSKDEM.m_XYScope = KXYScope->Checked; + UpdateXYQuality(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KXYScopeClick(TObject *Sender) +{ + KXYScope->Checked = KXYScope->Checked ? 0 : 1; + UpdateXYScope(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::PBoxXYPaint(TObject *Sender) +{ + if( PBoxXY->Visible ){ + PBoxXY->Canvas->Draw(0, 0, (TGraphic*)pBitmapXY); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KRxRecClick(TObject *Sender) +{ + if( (Font->Charset != SHIFTJIS_CHARSET) ){ + SaveDialog->Title = "Record MMTTY Sound file"; + SaveDialog->Filter = "MMTTY Sound Files(*.mmv)|*.mmv|"; + } + else { + SaveDialog->Title = "MMTTYƒTƒEƒ“ƒhƒtƒ@ƒCƒ‹‚Ìì¬"; + SaveDialog->Filter = "MMTTYƒTƒEƒ“ƒhƒtƒ@ƒCƒ‹(*.mmv)|*.mmv|"; + } + SaveDialog->FileName = "Recv.mmv"; + SaveDialog->DefaultExt = "mmv"; + SaveDialog->InitialDir = RecDir; + DisPaint = TRUE; + NormalWindow(this); + if( SaveDialog->Execute() == TRUE ){ + pSound->WaveFile.Rec(AnsiString(SaveDialog->FileName).c_str()); //JA7UDE 0428 + if( pSound->WaveFile.m_mode == 2 ){ + KRxRec->Checked = TRUE; + RecentAdd(AnsiString(pSound->WaveFile.m_FileName).c_str(), TRUE); //JA7UDE 0428 + } + SetDirName(RecDir, AnsiString(SaveDialog->FileName).c_str()); //JA7UDE 0428 + } + TopWindow(this); + DisPaint = FALSE; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KRxPlayClick(TObject *Sender) +{ + OpenDialog->Options >> ofCreatePrompt; + OpenDialog->Options << ofFileMustExist; + if( (Font->Charset != SHIFTJIS_CHARSET) ){ + OpenDialog->Title = "Play MMTTY Sound file"; + OpenDialog->Filter = "MMTTY Sound Files(*.mmv)|*.mmv|"; + } + else { + OpenDialog->Title = "MMTTYƒTƒEƒ“ƒhƒtƒ@ƒCƒ‹‚ÌĶ"; + OpenDialog->Filter = "MMTTYƒTƒEƒ“ƒhƒtƒ@ƒCƒ‹(*.mmv)|*.mmv|"; + } + OpenDialog->FileName = ""; + OpenDialog->DefaultExt = "mmv"; + OpenDialog->InitialDir = RecDir; + DisPaint = TRUE; + NormalWindow(this); + if( OpenDialog->Execute() == TRUE ){ + pSound->WaveFile.Play(AnsiString(OpenDialog->FileName).c_str()); //JA7UDE 0428 + SetDirName(RecDir, AnsiString(OpenDialog->FileName).c_str()); //JA7UDE 0428 + } + DisPaint = FALSE; + if( pSound->WaveFile.m_mode == 1 ){ + KRxPosClick(NULL); + RecentAdd(pSound->WaveFile.m_FileName.c_str(), TRUE); + } + TopWindow(this); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KRxStopClick(TObject *Sender) +{ + pSound->WaveFile.FileClose(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KXYSmallClick(TObject *Sender) +{ + m_XYSize = 0; + UpdateXYScope(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KXYBigClick(TObject *Sender) +{ + m_XYSize = 1; + UpdateXYScope(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KRxTimeClick(TObject *Sender) +{ + SYSTEMTIME now; + GetLocal(&now); + + char bf[256]; + sprintf(bf, "%s%02u%02u%02u%02u.mmv", RecDir, now.wMonth, now.wDay, now.wHour, now.wMinute); + pSound->WaveFile.Rec(bf); + if( pSound->WaveFile.m_mode == 2 ){ + KRxTime->Checked = TRUE; + RecentAdd(pSound->WaveFile.m_FileName.c_str(), TRUE); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KRxPauseClick(TObject *Sender) +{ + pSound->WaveFile.m_pause = pSound->WaveFile.m_pause ? 0 : 1; + KRxPause->Checked = TRUE; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KRxTopClick(TObject *Sender) +{ + pSound->WaveFile.Rewind(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KRxPosClick(TObject *Sender) +{ + TPlayDlgBox *pBox = new TPlayDlgBox(this); + + pBox->Execute(&pSound->WaveFile); + delete pBox; + TopWindow(this); +} +//--------------------------------------------------------------------------- +// Recent Menu Click +void __fastcall TMmttyWd::OnRecentClick(TObject *Sender) +{ + LPCSTR pName = RecentMenu.FindItemText((TMenuItem *)Sender); + if( pName != NULL ){ + char bf[256]; + strcpy(bf, pName); + RecentAdd(bf, pSound->WaveFile.Play(bf)); + if( pSound->WaveFile.m_mode == 1 ){ + KRxPosClick(NULL); + } + } +} +//--------------------------------------------------------------------------- +// Recent Menu Click +void __fastcall TMmttyWd::RecentAdd(LPCSTR pNew, int f) +{ + if( RecentMenu.IsAdd(pNew) ){ + RecentMenu.Delete(); + if( f != FALSE ){ + RecentMenu.Add(pNew); + } + else { + RecentMenu.Delete(pNew); + } + RecentMenu.Insert(NULL, OnRecentClick); + } +} +//--------------------------------------------------------------------------- +// Recent Menu Update +void __fastcall TMmttyWd::UpdateRecentMenu(void) +{ + RecentMenu.Delete(); + RecentMenu.Init(KExit, KMFile, RECMENUMAX); + RecentMenu.ExtFilter("MMV"); + RecentMenu.Insert(NULL, OnRecentClick); +} + +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KShortCutClick(TObject *Sender) +{ + if(Font->Charset != SHIFTJIS_CHARSET){ + SetMenuName("RcvLog", AnsiString(KRcvLog->Caption).c_str()); //JA7UDE 0428 + SetMenuName("FileOut", AnsiString(KFileOut->Caption).c_str()); //JA7UDE 0428 + SetMenuName("SaveRx", AnsiString(KSaveRx->Caption).c_str()); //JA7UDE 0428 + SetMenuName("OpenLog", AnsiString(KOpenLog->Caption).c_str()); //JA7UDE 0428 + SetMenuName("Flush", AnsiString(KFlush->Caption).c_str()); //JA7UDE 0428 + SetMenuName("RecTime", AnsiString(KRxTime->Caption).c_str()); //JA7UDE 0428 + SetMenuName("Rec", AnsiString(KRxRec->Caption).c_str()); //JA7UDE 0428 + SetMenuName("Play", AnsiString(KRxPlay->Caption).c_str()); //JA7UDE 0428 + SetMenuName("PlayPos", AnsiString(KRxPos->Caption).c_str()); //JA7UDE 0428 + SetMenuName("PlayStop", AnsiString(KRxStop->Caption).c_str()); //JA7UDE 0428 + SetMenuName("Paste", AnsiString(KPaste->Caption).c_str()); //JA7UDE 0428 + SetMenuName("MacBtn", AnsiString(KMac->Caption).c_str()); //JA7UDE 0428 + SetMenuName("RUN", AnsiString(KRun->Caption).c_str()); //JA7UDE 0428 + SetMenuName("Scope", AnsiString(KOS->Caption).c_str()); //JA7UDE 0428 + SetMenuName("ClrRxWindow", AnsiString(KClrRx->Caption).c_str()); //JA7UDE 0428 + SetMenuName("LogList", AnsiString(KLog->Caption).c_str()); //JA7UDE 0428 + SetMenuName("QSOData", AnsiString(KQSO->Caption).c_str()); //JA7UDE 0428 + SetMenuName("EntTX", AnsiString(KENT->Caption).c_str()); //JA7UDE 0428 + SetMenuName("WordWrap", AnsiString(KWP->Caption).c_str()); //JA7UDE 0428 + SetMenuName("TNC", AnsiString(KTNC->Caption).c_str()); //JA7UDE 0428 + SetMenuName("Option", AnsiString(KOption->Caption).c_str()); //JA7UDE 0428 + SetMenuName("LogOpt", AnsiString(KOptLog->Caption).c_str()); //JA7UDE 0428 + SetMenuName("ExtReset", AnsiString(KExtReset->Caption).c_str()); //JA7UDE 0428 + SetMenuName("ExtSusp", AnsiString(KExtSusp->Caption).c_str()); //JA7UDE 0428 + + SetMenuName("TxUp", "ScrollUp TxWindow"); + SetMenuName("TxDown", "ScrollDown TxWindow"); + SetMenuName("TxPUp", "PageUp TxWindow"); + SetMenuName("TxPDown", "PageDown TxWindow"); + SetMenuName("TxHome", "MoveTop TxWindow"); + SetMenuName("TxEnd", "MoveBottom TxWindow"); + + SetMenuName("RxUp", "ScrollUp RxWindow"); + SetMenuName("RxDown", "ScrollDown RxWindow"); + SetMenuName("RxPUp", "PageUp RxWindow"); + SetMenuName("RxPDown", "PageDown RxWindow"); + SetMenuName("RxHome", "MoveTop RxWindow"); + SetMenuName("RxEnd", "MoveBottom RxWindow"); + + SetMenuName("CharWaitL", "Left Char Wait"); + SetMenuName("CharWaitR", "Right Char Wait"); + SetMenuName("DiddleWaitL", "Left Diddle Wait"); + SetMenuName("DiddleWaitR", "Right Diddle Wait"); + + SetMenuName("TxHeightUp", "HeightUp TxWindow"); + SetMenuName("TxHeightDown", "HeightDown TxWindow"); + + SetMenuName("TxLTR", "Tx LTR"); + SetMenuName("TxFIG", "Tx FIG"); + + SetMenuName("DecShift", "Dec. Shift width"); + SetMenuName("IncShift", "Inc. Shift width"); + SetMenuName("ChangeShift", "Change Shift (170/200/220/350/450)"); + } + + TShortCutDlg *pBox = new TShortCutDlg(this); + pBox->Execute(); + delete pBox; + UpdateShortCut(TRUE); + TopWindow(this); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SetHint(TControl *tp, WORD Key) +{ + if( Key && KHint->Checked ){ + char bf[128]; + sprintf(bf, "ShortCut %s", GetKeyName(Key)); + tp->ShowHint = TRUE; + tp->Hint = bf; + } + else { + tp->Hint = ""; + tp->ShowHint = FALSE; + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SetShortCut(TMenuItem *mp, WORD Key) +{ + if( Key && (!Remote) ){ + if( Key & 0x100 ){ + mp->ShortCut = ShortCut(WORD(Key&0x00ff), TShiftState() << ssCtrl); + } + else if( Key & 0x200 ){ + mp->ShortCut = ShortCut(WORD(Key&0x00ff), TShiftState() << ssAlt); + } + else if( Key & 0x400 ){ + mp->ShortCut = ShortCut(WORD(Key&0x00ff), TShiftState() << ssShift); + } + else { + mp->ShortCut = ShortCut(Key, TShiftState()); + } + } + else { + mp->ShortCut = ShortCut(0, TShiftState()); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::UpdateShortCut(BOOL bMenu) +{ + if( bMenu ){ + SetShortCut(KRcvLog, sys.m_SysKey[kkRcvLog]); + SetShortCut(KFileOut, sys.m_SysKey[kkFileOut]); + SetShortCut(KSaveRx, sys.m_SysKey[kkSaveRx]); + + SetShortCut(KOpenLog, sys.m_SysKey[kkOpenLog]); + SetShortCut(KFlush, sys.m_SysKey[kkFlush]); + + SetShortCut(KRxTime, sys.m_SysKey[kkRecTime]); + SetShortCut(KRxRec, sys.m_SysKey[kkRec]); + SetShortCut(KRxPlay, sys.m_SysKey[kkPlay]); + SetShortCut(KRxPos, sys.m_SysKey[kkPlayPos]); + SetShortCut(KRxStop, sys.m_SysKey[kkPlayStop]); + + SetShortCut(KRun, sys.m_SysKey[kkRun]); + + SetShortCut(KPaste, sys.m_SysKey[kkPaste]); + SetShortCut(KPanel, sys.m_SysKey[kkPanel]); + SetShortCut(KMac, sys.m_SysKey[kkMac]); + SetShortCut(KOS, sys.m_SysKey[kkScope]); + SetShortCut(KClrRx, sys.m_SysKey[kkClrRxWindow]); + SetShortCut(KLog, sys.m_SysKey[kkLogList]); + SetShortCut(KQSO, sys.m_SysKey[kkQSOData]); + + SetShortCut(KENT, sys.m_SysKey[kkEntTX]); + SetShortCut(KWP, sys.m_SysKey[kkWordWrap]); + SetShortCut(KTNC, sys.m_SysKey[kkTNC]); + SetShortCut(KOption, sys.m_SysKey[kkOption]); + SetShortCut(KOptLog, sys.m_SysKey[kkLogOption]); + + SetShortCut(KS1, sys.m_SysKey[kkPro1]); + SetShortCut(KS2, sys.m_SysKey[kkPro2]); + SetShortCut(KS3, sys.m_SysKey[kkPro3]); + SetShortCut(KS4, sys.m_SysKey[kkPro4]); + SetShortCut(KS5, sys.m_SysKey[kkPro5]); + SetShortCut(KS6, sys.m_SysKey[kkPro6]); + SetShortCut(KS7, sys.m_SysKey[kkPro7]); + SetShortCut(KS8, sys.m_SysKey[kkPro8]); + SetShortCut(KSDEF, sys.m_SysKey[kkProDef]); + SetShortCut(KSRET, sys.m_SysKey[kkProRet]); + + SetShortCut(KExtCmd1, sys.m_SysKey[kkExtCmd1]); + SetShortCut(KExtCmd2, sys.m_SysKey[kkExtCmd2]); + SetShortCut(KExtCmd3, sys.m_SysKey[kkExtCmd3]); + SetShortCut(KExtCmd4, sys.m_SysKey[kkExtCmd4]); + SetShortCut(KExtReset, sys.m_SysKey[kkExtReset]); + SetShortCut(KExtSusp, sys.m_SysKey[kkExtSusp]); + } + + SetHint(SBData, sys.m_SysKey[kkQSOData]); + SetHint(SBFIG, sys.m_SysKey[kkFIG]); + SetHint(SBUOS, sys.m_SysKey[kkUOS]); + + SetHint(SBTX, sys.m_SysKey[kkTX]); + SetHint(SBTXOFF, sys.m_SysKey[kkTXOFF]); + SetHint(SBQSO, sys.m_SysKey[kkQSO]); + SetHint(SBInit, sys.m_SysKey[kkInitBox]); + SetHint(HisCall, sys.m_SysKey[kkCall]); + SetHint(HisName, sys.m_SysKey[kkName]); + SetHint(HisQTH, sys.m_SysKey[kkQTH]); + SetHint(HisRST, sys.m_SysKey[kkRST]); + SetHint(MyRST, sys.m_SysKey[kkMyRST]); + SetHint(Freq, sys.m_SysKey[kkFreq]); + SetHint(SBFind, sys.m_SysKey[kkFind]); + SetHint(SBINClear, sys.m_SysKey[kkClear]); + + SetHint(SBIN1, sys.m_InBtnKey[0]); + SetHint(SBIN2, sys.m_InBtnKey[1]); + SetHint(SBIN3, sys.m_InBtnKey[2]); + SetHint(SBIN4, sys.m_InBtnKey[3]); + int i; + for( i = 0; i < 16; i++ ){ + SetHint(GetSB(i), sys.m_UserKey[i]); + } + Application->ShowHint = KHint->Checked; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KHintClick(TObject *Sender) +{ + KHint->Checked = KHint->Checked ? 0 : 1; + UpdateShortCut(FALSE); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KOptLogClick(TObject *Sender) +{ + TLogSetDlg *pBox = new TLogSetDlg(this); + int contest = Log.m_LogSet.m_Contest; + pBox->Execute(); + delete pBox; + UpdateTitle(); + UpdateLogLink(); + if( contest != Log.m_LogSet.m_Contest ){ + AlignLogPanel(); + } + TopWindow(this); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KPanelClick(TObject *Sender) +{ + KPanel->Checked = KPanel->Checked ? 0 : 1; + UpdateControlPanel(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KPanelSmallClick(TObject *Sender) +{ + if( m_PanelSize ){ + m_PanelSize = 0; + FormResize(NULL); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KPanelBigClick(TObject *Sender) +{ + if( m_PanelSize != 2 ){ + m_PanelSize = 2; + FormResize(NULL); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KPanelMediumClick(TObject *Sender) +{ + if( m_PanelSize != 1 ){ + m_PanelSize = 1; + FormResize(NULL); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KPanelSuperClick(TObject *Sender) +{ + if( m_PanelSize != 3 ){ + m_PanelSize = 3; + FormResize(NULL); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::UpdateExtProgram(void) +{ + KExtEnt1->Caption = KExtCmd1->Caption; + KExtDel1->Caption = KExtCmd1->Caption; + KExtEnt2->Caption = KExtCmd2->Caption; + KExtDel2->Caption = KExtCmd2->Caption; + KExtEnt3->Caption = KExtCmd3->Caption; + KExtDel3->Caption = KExtCmd3->Caption; + KExtEnt4->Caption = KExtCmd4->Caption; + KExtDel4->Caption = KExtCmd4->Caption; + KExtCmd1->Enabled = !sys.m_ExtCmd[0].IsEmpty(); + KExtCmd2->Enabled = !sys.m_ExtCmd[1].IsEmpty(); + KExtCmd3->Enabled = !sys.m_ExtCmd[2].IsEmpty(); + KExtCmd4->Enabled = !sys.m_ExtCmd[3].IsEmpty(); + KExtDel1->Enabled = !sys.m_ExtCmd[0].IsEmpty(); + KExtDel2->Enabled = !sys.m_ExtCmd[1].IsEmpty(); + KExtDel3->Enabled = !sys.m_ExtCmd[2].IsEmpty(); + KExtDel4->Enabled = !sys.m_ExtCmd[3].IsEmpty(); + SetExtMenuName(0, AnsiString(KExtCmd1->Caption).c_str()); //JA7UDE 0428 + SetExtMenuName(1, AnsiString(KExtCmd2->Caption).c_str()); //JA7UDE 0428 + SetExtMenuName(2, AnsiString(KExtCmd3->Caption).c_str()); //JA7UDE 0428 + SetExtMenuName(3, AnsiString(KExtCmd4->Caption).c_str()); //JA7UDE 0428 +#if 0 + HICON ic = ::ExtractIcon(HInstance, sys.m_ExtCmd[0].c_str(), 0); +// ::DrawIcon(PBoxRx->Canvas->Handle, 0, 0, ic); + static Graphics::TBitmap *pbmp = NULL; + if( pbmp == NULL ) pbmp = new Graphics::TBitmap; + pbmp->Height = GetMenuCheckMarkDimensions(); + pbmp->Width = GetMenuCheckMarkDimensions(); + ::DrawIcon(pbmp->Canvas->Handle, 0, 0, ic); + ::SetMenuItemBitmaps(KExtCmd1->Handle, 0, 0, pbmp->Handle, pbmp->Handle); +#endif +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KExtEntClick(int n, TMenuItem *mp) +{ + AnsiString as = mp->Caption; + int r; + if(Font->Charset != SHIFTJIS_CHARSET){ + r = InputMB("Assign External Program", "Input Menu text", as); + } + else { + r = InputMB("ŠO•”ƒvƒƒOƒ‰ƒ€“o˜^", "ƒƒjƒ…[‚É•\ަ‚·‚é–¼‘O‚ð“ü—Í‚µ‚ĉº‚³‚¢.", as); + } + if( r == TRUE ){ + OpenDialog->Options >> ofCreatePrompt; + OpenDialog->Options << ofFileMustExist; + if( (Font->Charset != SHIFTJIS_CHARSET) ){ + OpenDialog->Title = "Select External Program"; + OpenDialog->Filter = "Program files(*.exe;*.lnk)|*.exe;*.lnk|All Files(*.*)|*.*|"; + } + else { + OpenDialog->Title = "ŽÀs‚·‚éƒvƒƒOƒ‰ƒ€‚ð‘I‘ð"; + OpenDialog->Filter = "ƒvƒƒOƒ‰ƒ€ƒtƒ@ƒCƒ‹(*.exe;*.lnk)|*.exe;*.lnk|‚·‚ׂẴtƒ@ƒCƒ‹(*.*)|*.*|"; + } + OpenDialog->FileName = sys.m_ExtCmd[n]; + OpenDialog->DefaultExt = "exe"; + OpenDialog->InitialDir = "\\"; + DisPaint = TRUE; + NormalWindow(this); + if( OpenDialog->Execute() == TRUE ){ + sys.m_ExtCmd[n] = OpenDialog->FileName; + mp->Caption = as; + UpdateExtProgram(); + } + TopWindow(this); + DisPaint = FALSE; + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KExtEnt1Click(TObject *Sender) +{ + KExtEntClick(0, KExtCmd1); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KExtEnt2Click(TObject *Sender) +{ + KExtEntClick(1, KExtCmd2); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KExtEnt3Click(TObject *Sender) +{ + KExtEntClick(2, KExtCmd3); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KExtEnt4Click(TObject *Sender) +{ + KExtEntClick(3, KExtCmd4); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KExtCmdClick(int n) +{ + KExtSuspClick(NULL); + + char bf[256]; + SetDirName(bf, sys.m_ExtCmd[n].c_str()); + ::SetCurrentDirectory(bf); + ::WinExec(sys.m_ExtCmd[n].c_str(), SW_SHOWDEFAULT); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KExtCmd1Click(TObject *Sender) +{ + KExtCmdClick(0); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KExtCmd2Click(TObject *Sender) +{ + KExtCmdClick(1); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KExtCmd3Click(TObject *Sender) +{ + KExtCmdClick(2); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KExtCmd4Click(TObject *Sender) +{ + KExtCmdClick(3); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KExtResetClick(TObject *Sender) +{ + CWaitCursor wait; + pSound->m_suspack = 0; + pSound->m_susp = 0; + for( int i = 0; (i < 20) && !pSound->m_suspack; i++ ) ::Sleep(100); + if( pSound->m_susp ) return; + COMM.change = 1; + RADIO.change = 1; + TNC.change = 1; + OpenCloseCom(); + ::SetCurrentDirectory(BgnDir); + Log.Close(); + Log.Open(NULL, TRUE); + DisPaint = FALSE; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KExtSuspClick(TObject *Sender) +{ + CWaitCursor wait; + pSound->m_suspack = 0; + pSound->m_susp = 1; + if( pComm != NULL ){ + delete pComm; + pComm = NULL; + } + if( pRadio != NULL ){ + delete pRadio; + pRadio = NULL; + } + if(pTnc != NULL ){ + delete pTnc; + pTnc = NULL; + } + Log.Close(); + Log.Open(NULL, TRUE); + int i; + for( i = 0; (i < 20) && !pSound->m_suspack; i++ ) ::Sleep(100); + pSound->m_suspack = 0; + DisPaint = TRUE; + if( !(Remote & REMSHOWOFF) ){ + Application->Minimize(); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KExtDel1Click(TObject *Sender) +{ + KExtCmd1->Caption = "External 1"; + sys.m_ExtCmd[0] = ""; + UpdateExtProgram(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KExtDel2Click(TObject *Sender) +{ + KExtCmd2->Caption = "External 2"; + sys.m_ExtCmd[1] = ""; + UpdateExtProgram(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KExtDel3Click(TObject *Sender) +{ + KExtCmd3->Caption = "External 3"; + sys.m_ExtCmd[2] = ""; + UpdateExtProgram(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KExtDel4Click(TObject *Sender) +{ + KExtCmd4->Caption = "External 4"; + sys.m_ExtCmd[3] = ""; + UpdateExtProgram(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::DrawSQ(void) +{ + if( pSound == NULL ) return; + + TCanvas *pCanvas = pBitmapSQ->Canvas; + + TRect rc; + int XL = 0; + int XR = pBitmapSQ->Width - 1; + int YT = 0; + int YB = pBitmapSQ->Height - 1; + rc.Left = XL; + rc.Right = XR; + rc.Top = YT; + rc.Bottom = YB+1; + if( !(Remote & REMSHOWOFF) ){ + pCanvas->Brush->Color = clBlack; + pCanvas->FillRect(rc); + } + + rc.Left = XL; + int over = 0; + if( pSound->FSKDEM.m_Limit ){ + rc.Right = pSound->FSKDEM.m_avgdeff * XR / (10.0 * SQSCALE); + if( (pSound->FSKDEM.GetSQLevel() * 10.0) > pSound->FSKDEM.m_avgdeff ){ + pCanvas->Brush->Color = clGray; + } + else { + pCanvas->Brush->Color = clLime; + over = 1; + if( !m_FIGTimer && SBFIG->Down ){ + SBFIG->Down = FALSE; + SBFIGClick(NULL); + } + m_FIGTimer = 1000/Timer->Interval; + } + if( m_FIGTimer ) m_FIGTimer--; + RemoteSigLevel(pSound->FSKDEM.m_avgdeff/10.0); + } + else { + rc.Right = pSound->FSKDEM.m_avgdeff * XR / SQSCALE; + if( pSound->FSKDEM.GetSQLevel() > pSound->FSKDEM.m_avgdeff ){ + pCanvas->Brush->Color = clGray; + } + else { + pCanvas->Brush->Color = clLime; + over = 1; + } + RemoteSigLevel(pSound->FSKDEM.m_avgdeff); + } + if( Remote & REMSHOWOFF ) return; + if( !SBSQ->Down ){ + pCanvas->Brush->Color = clLime; + } + + if( rc.Right > XR ) rc.Right = XR; + rc.Top = YT; + rc.Bottom = YB+1; + pCanvas->FillRect(rc); + rc.Right = pSound->FSKDEM.GetSQLevel() * XR / SQSCALE; + rc.Left = rc.Right; + rc.Right++; + rc.Top = YT; + rc.Bottom = YB+1; + pCanvas->Brush->Color = over ? clBlack : clWhite; + pCanvas->FillRect(rc); +#if BITDEBUG + double tim = pSound->FSKDEM.m_bitCountA * 1000.0/DemSamp; +#if TXDDEBUG + if( pComm == NULL ) return; + char bf[32]; + pCanvas->Brush->Color = clWhite; + pCanvas->Font->Color = clBlack; + pCanvas->Font->Size = 12; + sprintf(bf, "%lu", pComm->m_bitCountA); + pCanvas->TextOut(0, 0, bf); +#else + if( over && (tim >= 140) && (tim < 400) ){ + char bf[32]; + pCanvas->Brush->Color = clWhite; + pCanvas->Font->Color = clBlack; + pCanvas->Font->Size = 12; +// sprintf(bf, "%05lf", pSound->FSKDEM.m_avgdeff); + sprintf(bf, "%.1lf", pSound->FSKDEM.m_bitCountA * 1000.0/DemSamp); + pCanvas->TextOut(0, 0, bf); + } +#endif +#endif +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::PBoxSQMouseDown(TObject *Sender, + TMouseButton Button, TShiftState Shift, int X, int Y) +{ + pSound->FSKDEM.SetSQLevel(X * SQSCALE / (pBitmapSQ->Width - 1)); + if( !SBSQ->Down ){ + DrawSQ(); + PBoxSQPaint(NULL); + } + AdjustFocus(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::PBoxSQPaint(TObject *Sender) +{ + if( PBoxSQ->Visible ){ + PBoxSQ->Canvas->Draw(0, 0, (TGraphic*)pBitmapSQ); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::LLPFClick(TObject *Sender) +{ + if( pSound == NULL ) return; + + switch(m_DemType){ + case 0: + case 1: + pSound->FSKDEM.m_lpf = pSound->FSKDEM.m_lpf ? 0 : 1; + UpdateItem(); + break; + default: + break; + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::UpdateXYQuality(void) +{ + switch(m_XYQuality){ + case 0: + KXYQuality1->Checked = TRUE; + break; + case 1: + KXYQuality2->Checked = TRUE; + break; + case 2: + KXYQuality3->Checked = TRUE; + break; + default: + KXYQuality4->Checked = TRUE; + break; + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KXYQuality1Click(TObject *Sender) +{ + m_XYQuality = 0; + UpdateXYQuality(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KXYQuality2Click(TObject *Sender) +{ + m_XYQuality = 1; + UpdateXYQuality(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KXYQuality3Click(TObject *Sender) +{ + m_XYQuality = 2; + UpdateXYQuality(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KXYQuality4Click(TObject *Sender) +{ + m_XYQuality = 3; + UpdateXYQuality(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KFFTGLClick(TObject *Sender) +{ + sys.m_FFTGain = 0; + pSound->fftIN.ClearBuf(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KFFTGMClick(TObject *Sender) +{ + sys.m_FFTGain = 1; + pSound->fftIN.ClearBuf(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KFFTGHClick(TObject *Sender) +{ + sys.m_FFTGain = 2; + pSound->fftIN.ClearBuf(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KFFTGTClick(TObject *Sender) +{ + sys.m_FFTGain = 3; + pSound->fftIN.ClearBuf(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KFFTGS1Click(TObject *Sender) +{ + sys.m_FFTGain = 4; + pSound->fftIN.ClearBuf(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KFFTGS2Click(TObject *Sender) +{ + sys.m_FFTGain = 5; + pSound->fftIN.ClearBuf(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KFFTGS3Click(TObject *Sender) +{ + sys.m_FFTGain = 6; + pSound->fftIN.ClearBuf(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KFFTGS4Click(TObject *Sender) +{ + sys.m_FFTGain = 7; + pSound->fftIN.ClearBuf(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::LCallClick(TObject *Sender) +{ + m_Running = m_Running ? 0 : 1; + UpdateTitle(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KSetHelpClick(TObject *Sender) +{ + DisPaint = TRUE; + TSetHelpBox *pBox = new TSetHelpBox(this); + + if( pBox->Execute() == TRUE ){ + AddHelpMenu(); + UpdateSystemFont(); + } + delete pBox; + TopWindow(this); + DisPaint = FALSE; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::AddHelpMenu(void) +{ + if( (sys.m_HTMLHelp == HELPNAME_A) || (sys.m_HTMLHelp == HELPNAME_B) ){ + if( KMHelp->Items[0]->OnClick != KAndyHelp ){ + KMHelp->Delete(0); + KMHelp->Delete(0); + KMHelp->Delete(0); + KMHelp->Delete(0); + KMHelp->Delete(0); + KMHelp->Delete(0); + pAndyMenu = new TMenuItem(NULL); + pAndyMenu->Caption = "MMTTY Help"; + pAndyMenu->OnClick = KAndyHelp; + KMHelp->Insert(0, pAndyMenu); + } + } + else if( !sys.m_HTMLHelp.IsEmpty() ){ + if( KMHelp->Items[0]->OnClick == KAndyHelp ){ + KMHelp->Delete(0); + } + else { + pAndyMenu2 = new TMenuItem(NULL); + pAndyMenu2->Caption = "-"; + pAndyMenu2->OnClick = NULL; + KMHelp->Insert(0, pAndyMenu2); + } + char bf[256]; + pAndyMenu = new TMenuItem(NULL); + if( !strcmpi(GetEXT(sys.m_HTMLHelp.c_str()), "HLP") ){ + sprintf(bf, "MMTTY Help (%s)", sys.m_HTMLHelp.c_str()); + } + else { + sprintf(bf, "HTML Help (%s)", sys.m_HTMLHelp.c_str()); + } + pAndyMenu->Caption = bf; + pAndyMenu->OnClick = KAndyHelp; + KMHelp->Insert(0, pAndyMenu); + } + else { + if( KMHelp->Items[0]->OnClick == KAndyHelp ){ + KMHelp->Delete(0); + KMHelp->Delete(0); + } + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KAndyHelp(TObject *Sender) +{ +#if 1 + ShowHtmlHelp(); +#else + char bf[512]; + + sprintf(bf, "%s%s", BgnDir, sys.m_HTMLHelp.c_str()); + FILE *fp; + if( (fp = fopen(bf, "rb"))!=NULL ){ + fclose(fp); + if( !strcmpi(GetEXT(bf), "HLP") ){ + ::WinHelp(Handle, bf, HELP_FINDER, 0); + } + else if( !strcmpi(GetEXT(bf), "CHM") ){ + ::ShellExecute(Handle, "open", bf, NULL, NULL, SW_SHOWDEFAULT); + } + else { + WebRef.ShowHTML(bf); + } + } + else if((sys.m_WinFontCharset != SHIFTJIS_CHARSET )){ + ErrorMB( "'%s' was not found.\r\n\r\nPlease search in the MMTTY English Web Site.", sys.m_HTMLHelp.c_str()); + } + else { + ErrorMB( "'%s'‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ.\r\n\r\nMMTTY English Web Site ‚©‚çƒ_ƒEƒ“ƒ[ƒh‚µ‚ĉº‚³‚¢.", sys.m_HTMLHelp.c_str()); + } +#endif +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KSCharClick(TObject *Sender) +{ + m_SendWay = 0; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KSWordClick(TObject *Sender) +{ + m_SendWay = 1; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KSLineClick(TObject *Sender) +{ + m_SendWay = 2; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KFFTRSClick(TObject *Sender) +{ + sys.m_FFTResp = 3; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KFFTRMClick(TObject *Sender) +{ + sys.m_FFTResp = 2; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KFFTRFClick(TObject *Sender) +{ + sys.m_FFTResp = 1; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KPasteClick(TObject *Sender) +{ + TClipboard *pClip = new TClipboard; + + + //char bf[1024]; + WideChar bf[1024]; //JA7UDE 0428 + + pClip->Open(); + pClip->GetTextBuf(bf, sizeof(bf)); + pClip->Close(); + delete pClip; + //jstrupr(bf); + _wcsupr(bf); //JA7UDE 0428 + char bbf[1024]; + wcstombs( bbf, bf, wcslen(bf) ); + WriteFifoEdit(bbf); + AdjustFocus(); +} +//--------------------------------------------------------------------------- +// TNCƒf[ƒ^ŽóM‚̃Cƒxƒ“ƒg +void __fastcall TMmttyWd::OnTncEvent(TMessage &Message) +{ + if( pTnc == NULL ) return; + switch(Message.WParam){ + case MMTMSG_CHAR: + Message.Result = pTnc->PutRxFifo(BYTE(Message.LParam)); + break; + case MMTMSG_PTT: + RxCommon(Message.LParam ? TNC_PTTON : TNC_PTTOFF); + break; + case MMTMSG_COMMON: + RxCommon(BYTE(Message.LParam)); + break; + case MMTMSG_CLEARFIFO: + if( Message.LParam ){ + pTnc->ClearTxFifo(); + } + else { + pTnc->ClearRxFifo(); + } + break; + case MMTMSG_SETSWITCH: + Message.LParam &= ~0x00008000; + RemoteSwitch(Message.LParam); + break; + case MMTMSG_SETVIEW: + RemoteView(Message.LParam); + break; + case MMTMSG_CHARTXW: + if( Message.LParam != LF ) PushKey(char(Message.LParam)); + Message.Result = FifoEdit.GetLen(); + break; + case MMTMSG_WRITETXW: + if( !Message.LParam ) break; + WriteFifoEdit(LPCSTR(Message.LParam)); + Message.Result = FifoEdit.GetLen(); + break; + case MMTMSG_SETFREQ: + { + m_DisEvent++; + int mfq = LOWORD(Message.LParam); + int sfq = HIWORD(Message.LParam); + MarkFreq->Text = mfq; + pSound->FSKDEM.SetMarkFreq(mfq); + pSound->FSKDEM.SetSpaceFreq(sfq); + ShiftFreq->Text = sfq - mfq; + m_DisEvent--; + MarkFreqChange(NULL); + } + break; + case MMTMSG_SETBAUD: + { + int dd = Message.LParam; + if( (dd >= 2000) && (dd < 60000) ){ + pSound->FSKDEM.SetBaudRate(double(dd)/100.0); + pSound->FSKMOD.SetBaudRate(double(dd)/100.0); + SelectCombo(FALSE); + UpdateFSK(); + } + } + break; + case MMTMSG_SETSQ: + pSound->FSKDEM.SetSQLevel(Message.LParam); + break; + case MMTMSG_SETNOTCH: + pSound->m_lms.m_lmsNotch2 = HIWORD(Message.LParam); + pSound->m_lms.m_lmsNotch = LOWORD(Message.LParam); + if( SBLMS->Down ) pSound->CalcBPF(); + RemoteFreq(); + break; + case MMTMSG_SETDEFFREQ: + sys.m_DefMarkFreq = LOWORD(Message.LParam); + sys.m_DefShift = HIWORD(Message.LParam); + break; + case MMTMSG_SETPTTTIMER: + m_PttTimer = Message.LParam; + UpdatePttTimer(); + KPttTim->Checked = m_PttTimer ? 1 : 0; + break; + case MMTMSG_SETTNCTYPE: + TNC.Type = LOWORD(Message.LParam); + if( TNC.Type >= 3 ) TNC.Type = 0; + TNC.TncMode = HIWORD(Message.LParam); + if( TNC.Type == 2 ){ + TNC.TncMode = 0; + } + else if( TNC.TncMode ){ + CmdKAM(""); + } + break; + case MMTMSG_SETPRIORITY: + Message.Result = ::SetThreadPriority((HANDLE)pTnc->Handle, Message.LParam); + break; + case MMTMSG_SETLENGTH: + if( (Message.LParam >= 5) && (Message.LParam <= 8) ){ + pSound->FSKDEM.m_BitLen = Message.LParam; + pSound->FSKMOD.m_BitLen = Message.LParam; + UpdateFSK(); + } + break; + case MMTMSG_GETPROFILENAME: + Message.Result = NULL; + if( (Message.LParam >= 0) && (Message.LParam < 8) ){ + TMenuItem *tp = GetKS(Message.LParam); + if( tp->Enabled ){ + Message.Result = (DWORD)tp->Caption.c_str(); + } + } + break; + case MMTMSG_LOADPROFILE: + ReadProfile(Message.LParam, NULL); + UpdateItem(); + break; + case MMTMSG_SAVEPROFILE: + if( !Message.LParam ) break; + { + char bf[1024]; + StrCopy(bf, LPCSTR(Message.LParam), sizeof(bf)-1); + LPSTR t, p; + p = StrDlm(t, bf); + int n = atoin(t, -1); + if( (n >= 0) && (n < 8) ){ + TMenuItem *tp = GetKS(n); + LPCSTR dp; + if( *p ){ + dp = p; + } + else { + char bbf[32]; + sprintf(bbf, "Profile %d", n + 1); + dp = bbf; + } + tp->Caption = dp; + tp->Enabled = *p; + WriteProfile(n, dp, *p); + UpdateProfile(); + } + } + break; + case MMTMSG_SETRESO: + { + MSG msg; + msg.wParam = RXM_SETRESO; + msg.lParam = Message.LParam; + RemoteMMTTY(msg); + } + break; + case MMTMSG_SETLPF: + { + MSG msg; + msg.wParam = RXM_SETLPF; + msg.lParam = Message.LParam; + RemoteMMTTY(msg); + } + break; + default: + OnTncEvent(); + Message.Result = FALSE; + break; + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SetNMMT(void) +{ + if( pTnc->IsMMT() ){ + NMMT *pNMMT = pTnc->GetNMMT(); + pNMMT->m_notch1 = pSound->m_lms.m_lmsNotch; + pNMMT->m_notch2 = pSound->m_lms.m_lmsNotch2; + pNMMT->m_txbuflen = GetTxBufCount() + strlen(m_TNCStg.c_str()); + pNMMT->m_codeswitch = GetRemoteSwitch(); + pNMMT->m_codeview = GetRemoteView(); + pNMMT->m_txwlen = FifoEdit.GetLen(); + pNMMT->m_baud = pSound->FSKDEM.GetBaudRate() * 100; + pNMMT->m_bitlength = pSound->FSKDEM.m_BitLen; + pNMMT->m_modetnc = MAKELONG(TNC.Type, TNC.TncMode); + pNMMT->m_fig = rtty.m_fig; + pNMMT->m_defmark = sys.m_DefMarkFreq; + pNMMT->m_defshift = sys.m_DefShift; + } +} +//--------------------------------------------------------------------------- +// TNCƒf[ƒ^ŽóM‚̃Cƒxƒ“ƒg +// +void __fastcall TMmttyWd::OnTncEvent(void) +{ + if( pTnc == NULL ) return; + + UpdateTNCPTT(); + SetNMMT(); + int txbuflen = GetTxBufCount(); + if( SBTX->Down && (TNC.flwXON || TNC.flwCTS) ){ + if( txbuflen >= (MODBUFMAX*3/4) ) return; + } + char c; + while(pTnc->m_rxcnt){ + c = pTnc->m_rxbuf[pTnc->m_rxrp]; + pTnc->m_rxrp++; + if( pTnc->m_rxrp >= sizeof(pTnc->m_rxbuf) ) pTnc->m_rxrp = 0; + pTnc->m_rxcnt--; + if( !RxCommon(c) ){ + switch(TNC.Type){ + case 0: + RxTnc241(c); + break; + case 1: + RxKAM(c); + break; + case 2: + if( SBTX->Down ){ + pSound->FSKMOD.PutData(BYTE(c)); + } + break; + } + } + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::UpdateTNCPTT(void) +{ + if( TNC.Type == 2 ){ + if( pTnc->m_PTT ){ + if( !SBTX->Down ) ToTX(""); + } + else { + if( SBTX->Down && IsTxIdle() ) ToRX(0); + } + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::TncConvers(void) +{ + if( TNC.TncMode ){ + switch(TNC.Type){ + case 0: + pTnc->OutStr("K\r"); + CmdTnc241("K"); + break; + case 1: + pTnc->OutStr("RTTY\r"); + CmdKAM("RTTY"); + break; + } + } + TNC.TncMode = 0; +} +//--------------------------------------------------------------------------- +BOOL __fastcall TMmttyWd::RxCommon(BYTE c) +{ + BOOL r = TRUE; + switch(c){ + case TNC_PTTON: + ClearMacroTimer(); + TncConvers(); + if( TNC.Type == 2 ){ + pTnc->m_PTT = TRUE; + UpdateTNCPTT(); + } + else { + if( m_TNCStg.IsEmpty() ){ + ToTX(NULL); + } + else { + ToTX(m_TNCStg.c_str()); + OutputStr(m_TNCStg.c_str()); + m_TNCStg = ""; + } + } + break; + case TNC_PTTOFF: + ClearMacroTimer(); + TncConvers(); + if( TNC.Type == 2 ){ + pTnc->m_PTT = FALSE; + UpdateTNCPTT(); + } + else { + ToRX(1); + m_TNCStg = ""; + } + break; + case TNC_PTTFLUSH: + ClearMacroTimer(); + TncConvers(); + if( IsTxIdle() ){ + if( TNC.Type == 2 ){ + pTnc->m_PTT = FALSE; + UpdateTNCPTT(); + } + else { + ToRX(0); + } + } + else { + m_ReqRecv = 1; + } + break; + case TNC_CLEARBUF: + pSound->FSKMOD.DeleteTXBuf(); + m_TNCStg = ""; + break; + case TNC_AFCON: + SBAFC->Down = TRUE; + SBAFCClick(NULL); + break; + case TNC_AFCOFF: + SBAFC->Down = FALSE; + SBAFCClick(NULL); + break; + case TNC_NETON: + SBNET->Down = TRUE; + SBNETClick(NULL); + break; + case TNC_NETOFF: + SBNET->Down = FALSE; + SBNETClick(NULL); + break; + case TNC_REVON: + SBRev->Down = TRUE; + SBRevClick(NULL); + break; + case TNC_REVOFF: + SBRev->Down = FALSE; + SBRevClick(NULL); + break; + case TNC_HAM: + SBHAMClick(NULL); + break; + case TNC_ECHOON: + TNC.Echo = 2; + break; + case TNC_ECHOOFF: + TNC.Echo = 0; + break; + case TNC_CANCELPTTFLUSH: + m_ReqRecv = 0; + break; + default: + r = FALSE; + break; + } + return r; +} +void __fastcall TMmttyWd::RxTnc241(char c) +{ + char bf[256]; + + switch(c){ + case 0x12: // Ctrl+R + if( TNC.TncMode ) pTnc->OutStr("\r"); + RxCommon(TNC_PTTOFF); +// ToRX(0); +// TNC.TncMode = 0; +// m_TNCStg = ""; + break; + case 0x14: // Ctrl+T + if( TNC.TncMode ) pTnc->OutStr("\r"); + RxCommon(TNC_PTTON); +// TNC.TncMode = 0; +// ToTX(NULL); +// if( !m_TNCStg.IsEmpty() ){ +// OutputStr(m_TNCStg.c_str()); +// m_TNCStg = ""; +// } + break; + case 0x03: + if( TNC.TncMode ) pTnc->OutStr("\r"); + TNC.TncMode = 1; + pTnc->OutStr("\rcmd:"); + m_TNCStg = ""; + break; + case 0x04: // Ctrl+D + RxCommon(TNC_PTTFLUSH); +// if( IsTxIdle() ){ +// ToRX(0); +// } +// else { +// m_ReqRecv = 1; +// } +// TNC.TncMode = 0; + break; + case 0x18: // Ctrl+X + RxCommon(TNC_CLEARBUF); +// pSound->FSKMOD.DeleteTXBuf(); +// m_TNCStg = ""; + break; + default: + if( TNC.TncMode ){ // Commandƒ‚[ƒh + if( TNC.Echo ) pTnc->PutChar(c); + m_cmdTNC.WriteChar(c); + if( m_cmdTNC.LoadText(bf, sizeof(bf)) ){ + CmdTnc241(bf); + } + } + else { // ƒƒbƒZ[ƒWƒ‚[ƒh + if( TNC.Echo == 1 ) pTnc->PutChar(c); + if( (c != LF) && (c != '#') ){ + bf[0] = c; + bf[1] = 0; + if( SBTX->Down ){OutputStr(bf);}else {m_TNCStg += bf[0];} + if( c == CR ){ + bf[0] = LF; + if( SBTX->Down ){OutputStr(bf);}else {m_TNCStg += bf[0];} + } + } + } + break; + } +} +void __fastcall TMmttyWd::RxKAM(char c) +{ + char bf[256]; + static int MODE; + int dd; + + switch(c){ + case 0x03: // Ctrl+C + if( TNC.TncMode ){ + pTnc->OutStr("cmd:"); + m_TNCStg = ""; + } + else { + MODE = 1; + } + break; + case 0x0e: // Ctrl+N + OutputStr("%F"); + break; + case 0x0c: // Ctrl+L + OutputStr("%L"); + break; + case 0x18: // Ctrl+X + RxCommon(TNC_CLEARBUF); +// pSound->FSKMOD.DeleteTXBuf(); +// m_TNCStg = ""; + break; + default: + if( TNC.TncMode ){ // Commandƒ‚[ƒh + if( TNC.Echo ) pTnc->PutChar(c); + m_cmdTNC.WriteChar(c); + if( m_cmdTNC.LoadText(bf, sizeof(bf)) ){ + CmdKAM(bf); + } + } + else if( MODE ){ + MODE = 0; + c = char(toupper(c)); + switch(c){ + case 'S': // shift change + SetShift(170.0); + m_DisEvent++; + ShiftFreq->Text = pSound->FSKDEM.GetSpaceFreq() - pSound->FSKDEM.GetMarkFreq(); + m_DisEvent--; + sscanf(AnsiString(ShiftFreq->Text).c_str(), "%d", &dd); //JA7UDE 0428 + pTnc->OutStr("-170 SHIFT-"); + break; + case 'I': // revers shift + SBRev->Down = SBRev->Down ? 0 : 1; + SBRevClick(NULL); + break; + case 'T': // TX + RxCommon(TNC_PTTON); +// ToTX(NULL); +// if( !m_TNCStg.IsEmpty() ){ +// OutputStr(m_TNCStg.c_str()); +// m_TNCStg = ""; +// } + break; + case 'R': // RX + RxCommon(TNC_PTTOFF); +// ToRX(0); +// m_TNCStg = ""; + break; + case 'E': // RX after TX + RxCommon(TNC_PTTFLUSH); +// if( IsTxIdle() ){ +// ToRX(0); +// } +// else { +// m_ReqRecv = 1; +// } + break; + case 'X': // To cmd + pTnc->OutStr("cmd:"); + TNC.TncMode = 1; + m_TNCStg = ""; + break; + default: + if( isdigit(c) ){ + const int tbl[]={ + 45, 45, 50, 57, 75, 100, 110, 150, 200, 300 + }; + dd = tbl[c & 0x0f]; + pSound->FSKDEM.SetBaudRate(dd != 45 ? dd : 45.45); + pSound->FSKMOD.SetBaudRate(dd != 45 ? dd : 45.45); + SelectCombo(FALSE); + } + } + } + else { // ƒƒbƒZ[ƒWƒ‚[ƒh + if( TNC.Echo == 1 ) pTnc->PutChar(c); + if( (c != LF) && (c != '#') ){ + bf[0] = c; + bf[1] = 0; + if( SBTX->Down ){OutputStr(bf);}else {m_TNCStg += bf[0];} + if( c == CR ){ + bf[0] = LF; + if( SBTX->Down ){OutputStr(bf);}else {m_TNCStg += bf[0];} + } + } + } + break; + } +} +void __fastcall TMmttyWd::CmdTnc241(LPSTR p) +{ + int dd; + + jstrupr(p); + LPSTR pCmd; + p = SkipSpace(StrDlm(pCmd, SkipSpace(p), ' ')); + if( !strcmp(pCmd, "MODE") ){ + TNC.TncMode = 2; + pTnc->OutLine("MODE was TTY R"); + } + else if( !strcmp(pCmd, "SHIFT") ){ + pTnc->OutLine("SHIFT was %s", ShiftFreq->Text.c_str()); + if( !strcmp(p, "M") ){ + dd = 170; + } + else { + sscanf(p, "%d", &dd); + } + SetShift(double(dd)); + m_DisEvent++; + ShiftFreq->Text = pSound->FSKDEM.GetSpaceFreq() - pSound->FSKDEM.GetMarkFreq(); + m_DisEvent--; + } + else if( !strcmp(pCmd, "RXREV") || !strcmp(pCmd, "TXREV") ){ + pTnc->OutLine("%s was %s", pCmd, SBRev->Down ? "OFF":"ON"); + if( !strcmp(p, "ON" ) ){ + SBRev->Down = 0; + SBRevClick(NULL); + } + else { + SBRev->Down = 1; + SBRevClick(NULL); + } + } + else if( !strcmp(pCmd, "RTBAUD") ){ + pTnc->OutLine("RTBAUD was %u", int(pSound->FSKDEM.GetBaudRate())); + sscanf(p, "%d", &dd); + if( (dd >= 20) && (dd < 600) ){ + pSound->FSKDEM.SetBaudRate(dd != 45 ? dd : 45.45); + pSound->FSKMOD.SetBaudRate(dd != 45 ? dd : 45.45); + SelectCombo(FALSE); + } + } + else if( !strcmp(pCmd, "K") ){ + TNC.TncMode = 0; + m_TNCStg = ""; + } + if( TNC.TncMode ){ + if( TNC.TncMode == 1 ){ + pTnc->OutStr("cmd:"); + } + else { + pTnc->OutStr("tty:"); + } + } + else { + pTnc->OutStr("\r"); + } +} +void __fastcall TMmttyWd::CmdKAM(LPSTR p) +{ + int dd; + + jstrupr(p); + LPSTR pCmd; + p = SkipSpace(StrDlm(pCmd, SkipSpace(p), ' ')); + if( !strcmp(pCmd, "RTTY") ){ + TNC.TncMode = 0; + pTnc->OutLine("-RTTY %u-", int(pSound->FSKDEM.GetBaudRate())); + m_TNCStg = ""; + } + else if( !strcmp(pCmd, "SPACE") ){ + pTnc->OutLine("SPACE was %s", pSound->FSKDEM.GetSpaceFreq()); + sscanf(p, "%d", &dd); + pSound->FSKDEM.SetSpaceFreq(dd); + pSound->FSKMOD.SetSpaceFreq(dd); + UpdateUI(); + } + else if( !strcmp(pCmd, "MARK") ){ + pTnc->OutLine("MARK was %s", pSound->FSKDEM.GetMarkFreq()); + sscanf(p, "%d", &dd); + pSound->FSKDEM.SetMarkFreq(dd); + pSound->FSKMOD.SetMarkFreq(dd); + if( pRadio != NULL ) pRadio->SetMarkFreq(dd); + UpdateUI(); + } + if( TNC.TncMode ){ + pTnc->OutStr("cmd:"); + } + else { + pTnc->OutStr("\r"); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::PutTNC(char c) +{ + if( (pTnc != NULL) && !TNC.TncMode ){ + if( !SBTX->Down || ((TNC.Echo == 2) && (TNC.Type != 2)) || ((TNC.Type==2)&&(sys.m_echo==2)) ){ + pTnc->PutChar(c); + } + } + if( Remote ){ + PostApp(TXM_CHAR, (unsigned char)c); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::OpenCloseTNC(void) +{ + if( pTnc != NULL ) delete pTnc; + pTnc = NULL; + TNC.change = 0; + KTNC->Checked = FALSE; + if( Remote ) return; + + if( strcmp(TNC.StrPort, "NONE" ) ){ + COMMPARA cm; + SetFSKPara(&cm); + pTnc = new CCtnc(TRUE); + pTnc->Open(&TNC, Handle, CM_CTNC, &cm); + if( (TNC.Type == 2) && (pTnc->m_CreateON != TRUE) ){ + if( (cm.BitLen == 5) && (cm.Stop == TWOSTOPBITS) ){ + cm.Stop = ONE5STOPBITS; // set 1.5bits + pTnc->Open(&TNC, Handle, CM_CTNC, &cm); + } + } + if( pTnc->m_CreateON != TRUE ){ + delete pTnc; + pTnc = NULL; + ErrorMB( (Font->Charset != SHIFTJIS_CHARSET)? "Cannot open '%s' for TNC":"TNC–Í‹[ƒ|[ƒg'%s'‚ªƒI[ƒvƒ“‚Å‚«‚Ü‚¹‚ñ.", TNC.StrPort); + } + else { + sys.m_DisTX &= ~1; + KTNC->Checked = TRUE; + if( TNC.Type != 2 ){ + pTnc->OutStr("\r\n" VERTTL "\r\n%sTNC emulation.\r\n", pTnc->IsMMT() ? "Custom " : ""); + if( !pTnc->IsMMT() ){ + if( TNC.Type ){ + pTnc->OutStr("Command 'RTTY'\r\n"); + pTnc->OutStr("To RX: Ctrl+C,R\r\n"); + pTnc->OutStr("To TX: Ctrl+C,T\r\n"); + } + else { + pTnc->OutStr("Command 'K'\r\n"); + pTnc->OutStr("To RX: Ctrl+R\r\n"); + pTnc->OutStr("To TX: Ctrl+T\r\n"); + } + } + pTnc->OutStr("\r\ncmd:"); + TNC.TncMode = 1; + } + else { + TNC.TncMode = 0; + } + m_TNCStg = ""; + SetNMMT(); + RemoteFreq(); + } + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KTNCClick(TObject *Sender) +{ + TTNCSetDlg *pBox = new TTNCSetDlg(this); + + if( pBox->Execute() == TRUE ){ + FormResize(NULL); + UpdateStayOnTop(); + OpenCloseCom(); + } + delete pBox; + TopWindow(this); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::RemoteFreq(void) +{ + if( !Remote && !pTnc ) return; + + int mark, space; + + if( SBTX->Down && (sys.m_echo != 2) ){ + mark = DWORD(pSound->FSKMOD.GetMarkFreq()); + space = DWORD(pSound->FSKMOD.GetSpaceFreq()); + } + else { + mark = DWORD(pSound->FSKDEM.GetMarkFreq()); + space = DWORD(pSound->FSKDEM.GetSpaceFreq()); + } + if( pTnc && pTnc->IsMMT() ){ + pTnc->NotifyFreq(mark, space); + } + if( !Remote ) return; + if( m_RemoteMark != mark ){ + PostApp(TXM_MARK, mark); + m_RemoteMark = mark; + } + if( m_RemoteSpace != space ){ + PostApp(TXM_SPACE, space); + m_RemoteSpace = space; + } + mark = pSound->m_lms.m_lmsNotch + (pSound->m_lms.m_lmsNotch2 << 16); + if( mark != m_RemoteNotch ){ + PostApp(TXM_NOTCH, mark); + m_RemoteNotch = mark; + } + if( int(sys.m_DefShift) != m_RemoteDefShift ){ + PostApp(TXM_DEFSHIFT, sys.m_DefShift); + m_RemoteDefShift = sys.m_DefShift; + } +} +//--------------------------------------------------------------------------- +DWORD __fastcall TMmttyWd::GetRemoteSwitch(void) +{ + DWORD d = pSound->FSKDEM.m_type & 0x03; //b0-b1 + d |= SBAFC->Down ? 0x0004 : 0; //b2 + d |= SBNET->Down ? 0x0008 : 0; //b3 + d |= SBATC->Down ? 0x0010 : 0; //b4 + d |= SBBPF->Down ? 0x0020 : 0; //b5 + d |= SBLMS->Down ? 0x0040 : 0; //b6 + d |= SBSQ->Down ? 0x0080 : 0; //b7 + d |= SBRev->Down ? 0x0100 : 0; //b8 + d |= SBUOS->Down ? 0x0200 : 0; //b9 + d |= (sys.m_FixShift << 10); //b10-b11 + d |= pSound->FSKDEM.m_lpf ? 0x1000 : 0; //b12 + d |= pSound->m_lms.m_Type ? 0x2000 : 0; //b13 + d |= pSound->m_lms.m_twoNotch ? 0x4000 : 0; // b14 + d |= (Remote & REMVIATX) ? 0x8000 : 0; // b15 + d |= KWP->Checked ? 0x10000 : 0; // b16 + d |= (m_SendWay << 17); // b17-b18 + // Added by JE3HHT on Sep.2010 + d |= pSound->FSKDEM.m_AA6YQ.m_fEnabled ? 0x80000 : 0; // b19 + return d; +} +//--------------------------------------------------------------------------- +DWORD __fastcall TMmttyWd::GetRemoteView(void) +{ + DWORD d = pSound->m_FFTFW & 0x0007; // 0000000000000xxx + d |= ((sys.m_FFTGain&0x0003) << 4); // 0000000000xx0000 + d |= ((sys.m_FFTResp - 1) << 6); // 00000000xx000000 + d |= (m_XYSize << 8); // 0000000x00000000 + d |= (m_XYQuality << 10); // 0000xx0000000000 + d |= KXYScope->Checked ? 0x1000 : 0; // 000x000000000000 + d |= ((sys.m_FFTGain&0x000c) << 11); // 0xx0000000000000 + return d; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::RemoteStat(void) +{ + int d; + if( Remote ){ + d = Width + (Height << 16); + if( m_RemoteHeight != d ){ + PostApp(TXM_HEIGHT, d); + m_RemoteHeight = d; + } + d = DWORD(pSound->FSKDEM.GetBaudRate() * 100); + if( m_RemoteBaud != d ){ + PostApp(TXM_BAUD, d); + m_RemoteBaud = d; + } + } + RemoteFreq(); // MMT‚Ì‚½‚߂ɌĂÑo‚µ‚Ü‚· + if( !Remote ) return; + d = GetRemoteSwitch(); + if( m_RemoteSwitch != d ){ + PostApp(TXM_SWITCH, d); + m_RemoteSwitch = d; + } + d = GetRemoteView(); + if( m_RemoteView != d ){ + PostApp(TXM_VIEW, d); + m_RemoteView = d; + } + d = DWORD(pSound->FSKDEM.m_iirfw) + (DWORD(pSound->FSKDEM.GetFilterTap()) << 16); + if( m_RemoteIIR != d ){ + PostApp(TXM_RESO, d); + m_RemoteIIR = d; + } + d = DWORD(pSound->FSKDEM.GetSmoozFreq())+(DWORD(pSound->FSKDEM.m_lpffreq) << 16); + if( m_RemoteLPF != d ){ + PostApp(TXM_LPF, d); + m_RemoteLPF = d; + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::RemoteSwitch(DWORD d) +{ + pSound->FSKDEM.m_type = d & 0x0003; + pSound->m_lms.m_Type = d & 0x2000 ? 1 : 0; UpdateLMS(); + pSound->m_lms.m_twoNotch = d & 0x4000 ? 1 : 0; + SBAFC->Down = d & 0x0004 ? 1 : 0; SBAFCClick(NULL); + SBNET->Down = d & 0x0008 ? 1 : 0; SBNETClick(NULL); + SBATC->Down = d & 0x0010 ? 1 : 0; SBATCClick(NULL); + SBBPF->Down = d & 0x0020 ? 1 : 0; SBBPFClick(NULL); + SBLMS->Down = d & 0x0040 ? 1 : 0; SBLMSClick(NULL); + SBSQ->Down = d & 0x0080 ? 1 : 0; pSound->FSKDEM.SetSQ(SBSQ->Down); + SBRev->Down = d & 0x0100 ? 1 : 0; SBRevClick(NULL); + SBUOS->Down = d & 0x0200 ? 1 : 0; SBUOSClick(NULL); + sys.m_FixShift = (d >> 10) & 0x0003; + pSound->FSKDEM.m_lpf = d & 0x1000 ? 1 : 0; + if( d & 0x8000 ){ Remote |= REMVIATX;} else { Remote &= ~REMVIATX;} + KWP->Checked = d & 0x10000 ? 1 : 0; + m_SendWay = (d >> 17) & 0x03; + + // Added by JE3HHT on Sep.2010 + int f = (d & 0x80000) ? 1 : 0; // b19 + if( f != pSound->FSKDEM.m_AA6YQ.m_fEnabled ){ + pSound->FSKDEM.m_AA6YQ.m_fEnabled = f; + if( f ) pSound->FSKDEM.m_AA6YQ.Create(); + } + UpdateItem(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::RemoteView(DWORD d) +{ + m_DisEvent++; + pSound->m_FFTFW = d & 0x0007; + sys.m_FFTGain = (d >> 4) & 0x0003; + sys.m_FFTGain |= (d >> 11) & 0x000c; + sys.m_FFTResp = ((d >> 6) & 0x0003) + 1; + m_XYSize = (d >> 8) & 0x0001; + m_XYQuality = (d >> 10) & 0x0003; + KXYScope->Checked = d & 0x1000 ? 1 : 0; + UpdateXYScope(); + m_DisEvent--; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::RemoteSigLevel(DWORD d) +{ + if( !Remote && !pTnc ) return; + + DWORD sq = pSound->FSKDEM.GetSQLevel(); + if( Remote ){ + PostApp(TXM_LEVEL, (sq << 16) + d); + } + else if( pTnc ){ + pTnc->NotifyLevel(sq, d); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SetRemoteFFT(void) +{ + if( Remote & REMDISSHARED ) return; + + int i, x; + double smp = pMap->smpFFT ? 8000 : 11025; + if( sys.m_FFTGain >= 4 ){ + if( FFT_SIZE < 2048 ){ + smp *= 0.5; + for( i = 0; i < 2048; i++ ){ + x = (i * smp / SampFreq) + 0.5; + if( x < FFT_SIZE ){ + pMap->arrayFFT[i] = pSound->fftIN.m_fft[x] * 0.1; + } + else { + for( ; i < 2048; i++ ) pMap->arrayFFT[i] = 0; + } + } + pMap->smpFreq = pMap->smpFFT ? 8000 : 11025; + } + else if( SampType || pMap->smpFFT ){ + for( i = 0; i < 2048; i++ ){ + x = (i * smp / SampFreq) + 0.5; + if( x < FFT_SIZE ){ + pMap->arrayFFT[i] = pSound->fftIN.m_fft[x] * 0.1; + } + else { + for( ; i < 2048; i++ ) pMap->arrayFFT[i] = 0; + } + } + pMap->smpFreq = pMap->smpFFT ? 8000 : 11025; + } + else { + for( i = 0; i < 2048; i++ ){ + pMap->arrayFFT[i] = pSound->fftIN.m_fft[i] * 0.1; + } + pMap->smpFreq = SampFreq; + } + } + else { + if( FFT_SIZE < 2048 ){ + smp *= 0.5; + for( i = 0; i < 2048; i++ ){ + x = (i * smp / SampFreq) + 0.5; + if( x < FFT_SIZE ){ + pMap->arrayFFT[i] = pSound->fftIN.m_fft[x]; + } + else { + for( ; i < 2048; i++ ) pMap->arrayFFT[i] = 0; + } + } + pMap->smpFreq = pMap->smpFFT ? 8000 : 11025; + } + else if( SampType || pMap->smpFFT ){ + for( i = 0; i < 2048; i++ ){ + x = (i * smp / SampFreq) + 0.5; + if( x < FFT_SIZE ){ + pMap->arrayFFT[i] = pSound->fftIN.m_fft[x]; + } + else { + for( ; i < 2048; i++ ) pMap->arrayFFT[i] = 0; + } + } + pMap->smpFreq = pMap->smpFFT ? 8000 : 11025; + } + else { + memcpy(pMap->arrayFFT, pSound->fftIN.m_fft, sizeof(pMap->arrayFFT)); + pMap->smpFreq = SampFreq; + } + } + pMap->flagFFT = 1; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::InitRemoteStat(void) +{ + m_RemoteSwitch = -1; + m_RemoteView = -1; + m_RemoteBaud = -1; + m_RemoteHeight = -1; + m_RemoteIIR = -1; + m_RemoteLPF = -1; + m_RemoteMark = -1; + m_RemoteSpace = -1; + m_RemoteNotch = -1; + m_RemoteDefShift = -1; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::RemoteMMTTY(tagMSG &Msg) +{ + char bf[16]; + double d; + int di; + + switch(Msg.wParam){ + case RXM_HANDLE: // ƒEƒCƒ“ƒhƒEƒnƒ“ƒhƒ‹‚Ì’Ê’m + m_RemoteTimer = 0; + APP_HANDLE = (HWND)Msg.lParam; + if( APP_HANDLE != HWND_BROADCAST){ + ::SetForegroundWindow(APP_HANDLE); + InitRemoteStat(); + RemoteStat(); + PostApp(TXM_PTTEVENT, SBTX->Down); + } + break; + case RXM_REQHANDLE: // ƒEƒCƒ“ƒhƒEƒnƒ“ƒhƒ‹‚Ì—v‹ + ::PostMessage(APP_HANDLE, MSG_MMTTY, TXM_HANDLE, (DWORD)Handle); + break; + case RXM_PTT: // ‘—Žó‚ÌØ‚è‘Ö‚¦ + switch(Msg.lParam){ + case 0: + case 5: + if( Remote & REMVIATX ) FifoEdit.Clear(); + ToRX(Msg.lParam ? 0 : 1); + break; + case 1: + if( ((Remote & REMVIATX) && FifoEdit.GetLen()) || !IsTxIdle() ){ + m_ReqRecv = 1; + } + else { + ToRX(0); + } + break; + case 2: + ToTX(NULL); + break; + case 3: + ToTX("~"); + break; + case 4: + if( Remote & REMVIATX ) FifoEdit.Clear(); + pSound->FSKMOD.DeleteTXBuf(); + if( pComm != NULL ) pComm->InitTxBuf(); + break; + } + break; + case RXM_CHAR: + bf[0] = char(Msg.lParam); + if( Remote & REMNOCNV ){ + pSound->FSKMOD.PutData(bf[0]); + } + else if( Remote & REMVIATX ){ + if( bf[0] != LF ) PushKey(bf[0]); + } + else if( bf[0] != '#' ){ + bf[1] = 0; + OutputStr(bf); + } + break; + case RXM_EXIT: + pMap = NULL; + Close(); + break; + case RXM_WINPOS: + Top = Msg.lParam >> 16; + Left = Msg.lParam & 0x0000ffff; + break; + case RXM_WIDTH: + di = Msg.lParam & 0x0000ffff; + if( di > 10 ) Width = di; + di = Msg.lParam >> 16; + if( di > 10 ) Height = di; + break; + case RXM_REQPARA: + InitRemoteStat(); + RemoteStat(); + break; + case RXM_SETBAUD: + if( (Msg.lParam > 10) && (Msg.lParam <= 120000) ){ + d = Msg.lParam; + d /= 100.0; + pSound->FSKMOD.SetBaudRate(d); + pSound->FSKDEM.SetBaudRate(d); + SelectCombo(FALSE); + } + RemoteStat(); + break; + case RXM_SETMARK: + if( (Msg.lParam > 100) && (Msg.lParam < 3000) ){ + d = Msg.lParam; + if( !SBTX->Down || (sys.m_echo != 2) ) pSound->FSKMOD.SetMarkFreq(d); + pSound->FSKDEM.SetMarkFreq(d); + if( pRadio != NULL ) pRadio->SetMarkFreq(d); + if( SBBPF->Down || SBLMS->Down ) pSound->CalcBPF(); + m_DisEvent++; + MarkFreq->Text = int(d); + ShiftFreq->Text = int(pSound->FSKDEM.GetSpaceFreq() - pSound->FSKDEM.GetMarkFreq()); + m_DisEvent--; + } + RemoteStat(); + break; + case RXM_SETSPACE: + if( (Msg.lParam > 100) && (Msg.lParam < 3000) ){ + d = Msg.lParam; + if( !SBTX->Down || (sys.m_echo != 2) ) pSound->FSKMOD.SetSpaceFreq(d); + pSound->FSKDEM.SetSpaceFreq(d); + if( SBBPF->Down || SBLMS->Down ) pSound->CalcBPF(); + m_DisEvent++; + MarkFreq->Text = int(pSound->FSKDEM.GetMarkFreq()); + ShiftFreq->Text = int(pSound->FSKDEM.GetSpaceFreq() - pSound->FSKDEM.GetMarkFreq()); + m_DisEvent--; + } + RemoteStat(); + break; + case RXM_SETSWITCH: + RemoteSwitch(Msg.lParam); + break; + case RXM_SETHAM: + SBHAMClick(NULL); + break; + case RXM_SHOWSETUP: + if( !m_OptionDialog ){ + m_OptionDialog++; + DoOption(NULL, Msg.lParam); + m_OptionDialog--; + ::SetForegroundWindow(APP_HANDLE); + } + else if( m_hOptionWnd ){ + ::SetForegroundWindow(m_hOptionWnd); + } + break; + case RXM_SETVIEW: + RemoteView(Msg.lParam); + break; + case RXM_SETSQLVL: + if( Msg.lParam >= SQSCALE ) Msg.lParam = SQSCALE - 1; + pSound->FSKDEM.SetSQLevel(Msg.lParam); + break; + case RXM_SHOW: + if( Msg.lParam ){ + if( !(Remote & REMSHOWOFF) ){ + Show(); + if( Remote & REMNOMOVE ){ + FormResize(NULL); + } + } + } + else { + Hide(); + } + break; + case RXM_SETFIG: + SBFIG->Down = Msg.lParam; + SBFIGClick(NULL); + break; + case RXM_SETRESO: + { + int f = 0; + di = Msg.lParam & 0x0000ffff; + if( (di > 0) && (di < 500) ){ + pSound->FSKDEM.SetIIR(di); + f = 1; + } + di = Msg.lParam >> 16; + if( (di > 0) && (di <= 512) ){ + pSound->FSKDEM.SetFilterTap(di); + f = 1; + } + if( f ) SelectCombo(FALSE); + } + break; + case RXM_SETLPF: + di = Msg.lParam & 0x0000ffff; + if( (di > 10) && (di < 1000) ){ + pSound->FSKDEM.SetSmoozFreq(di); + } + di = Msg.lParam >> 16; + if( (di > 10) && (di <= 1000) ){ + pSound->FSKDEM.m_lpffreq = di; + } + SelectCombo(FALSE); + break; + case RXM_SETTXDELAY: + di = Msg.lParam & 0x0000ffff; + if( (di >= 0) && (di < 10000) ){ + m_RemoteDelay = di; + } + break; + case RXM_UPDATECOM: + UpdateComarray(); + break; + case RXM_SUSPEND: + if( Msg.lParam ){ + KExtSuspClick(NULL); + if( !(Remote & REMSHOWOFF) ){ + Hide(); + } + } + else { + KExtResetClick(NULL); + if( !(Remote & REMSHOWOFF) ){ + Show(); + } + } + break; + case RXM_NOTCH: + pSound->m_lms.m_lmsNotch2 = pSound->m_lms.m_lmsNotch; + pSound->m_lms.m_lmsNotch = Msg.lParam & 0x0000ffff; + if( SBLMS->Down ) pSound->CalcBPF(); + RemoteFreq(); + break; + case RXM_PROFILE: + RemoteProfile(Msg.lParam); + break; + case RXM_TIMER: + if( Msg.lParam & 0xffff0000 ){ + KPttTimClick(NULL); + } + else { + m_PttTimer = Msg.lParam & 0x0000ffff; + UpdatePttTimer(); + KPttTim->Checked = m_PttTimer ? 1 : 0; + } + break; + case RXM_ENBFOCUS: + if( Msg.lParam ){ + Remote &= ~REMDISFOCUS; + } + else { + Remote |= REMDISFOCUS; + } + break; + case RXM_SETDEFFREQ: + sys.m_DefMarkFreq = LOWORD(Msg.lParam); + sys.m_DefShift = HIWORD(Msg.lParam); + break; + case RXM_SETLENGTH: + if( (Msg.lParam >= 5) && (Msg.lParam <= 8) ){ + pSound->FSKDEM.m_BitLen = Msg.lParam; + pSound->FSKMOD.m_BitLen = Msg.lParam; + UpdateFSK(); + } + break; + case RXM_ENBSHARED: + if( Msg.lParam ){ + Remote &= ~REMDISSHARED; + } + else { + Remote |= REMDISSHARED; + } + break; + case RXM_PTTFSK: // Added by JE3HHT on Sep.2010 + if( sys.m_TxPort != (Msg.lParam & 0x03) ){ + sys.m_TxPort = Msg.lParam & 0x03; + COMM.change = 1; + OpenCloseCom(); + } + break; + default: + break; + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::UpdateMacroShow(int sw) +{ + if( Remote ) return; + + GroupM->Visible = KMac->Checked; + PanelMac->Visible = KMac->Checked ? 0 : 1; + TSpeedButton *tp; + int i; + if( GroupM->Visible == TRUE ){ + if( SBM1->Parent != GroupM ){ + for( i = 0; i < 16; i++ ){ + tp = GetSB(i); + PanelMac->RemoveControl(tp); + GroupM->InsertControl(tp); + tp->Parent = GroupM; + } + } + } + else { + if( SBM1->Parent != PanelMac ){ + for( i = 0; i < 16; i++ ){ + tp = GetSB(i); + GroupM->RemoveControl(tp); + PanelMac->InsertControl(tp); + tp->Parent = PanelMac; + } + } + } + if( sw ){ + PanelMac->Align = alNone; + PanelQSO->Align = alNone; + PanelRx->Align = alNone; + PanelIn->Align = alNone; + PanelStat->Align = alNone; + + PanelMac->Align = alTop; + PanelQSO->Align = alTop; + PanelRx->Align = alTop; + if( !sys.m_DisWindow ){ + PanelIn->Align = alBottom; + PanelStat->Align = alBottom; + } + FormResize(NULL); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KMacClick(TObject *Sender) +{ + KMac->Checked = KMac->Checked ? 0 : 1; + UpdateMacroShow(1); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KENTClick(TObject *Sender) +{ + KENT->Checked = KENT->Checked ? 0 : 1; +} +#if 0 +//--------------------------------------------------------------------------- +// Radioƒf[ƒ^ŽóM‚̃Cƒxƒ“ƒg +// +// pRadio = new CCradio(TRUE); +// pRadio->Open(PortTnc, &ParaTnc, Handle, CM_COMM_UP); +void __fastcall TMmttyWd::CMCradio(TMessage *Message) +{ + if( pRadio == NULL ) return; + + char bf[RADIO_COMBUFSIZE]; + DWORD len = pRadio->RecvLen(); + if( len >= RADIO_COMBUFSIZE ) len = RADIO_COMBUFSIZE; + pRadio->Read((BYTE *)bf, len); +} +#endif +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::OpenCloseRadio(void) +{ + if( !RADIO.change ) return; + if( pRadio != NULL ) delete pRadio; + pRadio = NULL; + RADIO.change = 0; + if( strcmp(RADIO.StrPort, "NONE" ) ){ + pRadio = new CCradio(TRUE); + pRadio->Open(&RADIO, Handle, CM_CMMR, CM_CRADIO); + if( pRadio->m_CreateON != TRUE ){ + delete pRadio; + pRadio = NULL; + if( !Remote || !m_RemoteTimer ){ + ErrorMB( (Font->Charset != SHIFTJIS_CHARSET)? "Can't open '%s' for Radio commands":"RadioƒRƒ}ƒ“ƒhƒ|[ƒg'%s'‚ªƒI[ƒvƒ“‚Å‚«‚Ü‚¹‚ñ.", RADIO.StrPort); + } + } + else { + pRadio->SetMarkFreq(pSound->FSKDEM.GetMarkFreq()); + pRadio->SendCommand(RADIO.CmdInit.c_str()); + if( RADIO.PollScan ){ + m_DisEvent++; + Freq->Text = "???"; + m_DisEvent--; + RADIO.Cmdxx = 0x00; + pRadio->m_ScanAddr = 1; + } + } + } + if( (pMap != NULL) && !(Remote & REMDISSHARED) ) StrCopy(pMap->comRadio, RADIO.StrPort, sizeof(pMap->comRadio)-1); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::HisCallClick(TObject *Sender) +{ + ClearMacroTimer(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::UpdateLWait(void) +{ + if( pSound->FSKMOD.m_CharWaitDiddle ) sys.m_LWait = 3; + m_DisEvent++; + switch(sys.m_LWait){ + case 0: // Char.wait + LWait->Caption = "Char. wait"; + TBCharWait->Position = SetTBValue(pSound->FSKMOD.m_CharWait, 50, 50); + break; + case 1: // Diddle. wait + LWait->Caption = "Diddle wait"; + TBCharWait->Position = SetTBValue(pSound->FSKMOD.m_DiddleWait, 50, 50); + break; + case 2: // Char+Diddle + LWait->Caption = "Both wait"; + TBCharWait->Position = SetTBValue(pSound->FSKMOD.m_CharWait, 50, 50); + break; + case 3: // No diddle wait + LWait->Caption = "Disable wait"; + TBCharWait->Position = SetTBValue(pSound->FSKMOD.m_CharWait, 50, 50); + break; + } + m_DisEvent--; +} +//--------------------------------------------------------------------------- +// Wait‚̃NƒŠƒbƒN +void __fastcall TMmttyWd::LWaitClick(TObject *Sender) +{ + sys.m_LWait++; + if( sys.m_LWait >= 4 ) sys.m_LWait = 0; + pSound->FSKMOD.m_CharWaitDiddle = ( sys.m_LWait == 3 ) ? 1 : 0; + UpdateLWait(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KWPClick(TObject *Sender) +{ + KWP->Checked = KWP->Checked ? 0 : 1; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SBDataMouseDown(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y) +{ + if( Button == mbRight ){ + int n = Log.m_CurNo - 1; + if( n < 0 ){ + KQSOClick(NULL); + return; + } + + TQSODlgBox *pBox = new TQSODlgBox(this); + SDMMLOG sd; + Log.GetData(&sd, n); + CLogFind Find; + + Log.FindSet(&Find, sd.call); + + pBox->Execute(&Find, &sd, n); + delete pBox; + TopWindow(this); + if( !SBQSO->Down && Log.m_CurNo ){ + Log.SetLastPos(); + UpdateTextData(); + } + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::PostApp(WPARAM wParam, LPARAM lParam) +{ + if(APP_HANDLE != HWND_BROADCAST){ + ::PostMessage(APP_HANDLE, MSG_MMTTY, wParam, lParam); + } +} +//--------------------------------------------------------------------------- +TMenuItem *__fastcall TMmttyWd::GetKS(int n) +{ + TMenuItem *__KS[]={ + KS1, KS2, KS3, KS4, KS5, KS6, KS7, KS8, + }; + return __KS[n]; +} +//--------------------------------------------------------------------------- +TMenuItem *__fastcall TMmttyWd::GetKDS(int n) +{ + TMenuItem *__KDS[]={ + KDS1, KDS2, KDS3, KDS4, KDS5, KDS6, KDS7, KDS8, + }; + return __KDS[n]; +} +//--------------------------------------------------------------------------- +TMenuItem *__fastcall TMmttyWd::GetKES(int n) +{ + TMenuItem *__KES[]={ + KES1, KES2, KES3, KES4, KES5, KES6, KES7, KES8, + }; + return __KES[n]; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::UpdateProfile(void) +{ + int i; + for( i = 0; i < 8; i++ ){ + TMenuItem *p = GetKS(i); + GetKDS(i)->Caption = p->Caption; + GetKES(i)->Caption = p->Caption; + GetKDS(i)->Enabled = p->Enabled; + SetProMenuName(i, AnsiString(p->Caption).c_str()); //JA7UDE -428 + } +} +//--------------------------------------------------------------------------- +// ƒŒƒWƒXƒgƒŠ‚©‚ç‚̓ǂÝo‚µ +void __fastcall TMmttyWd::ReadProfileList(void) +{ + char bf[256]; + AnsiString as; + + sprintf(bf, "%sUserPara.ini", BgnDir); + TMemIniFile *pIniFile = new TMemIniFile(bf); + char key[32]; + int i; + for( i = 0; i < 8; i++ ){ + sprintf(key, "Define%d", i); + TMenuItem *p = GetKS(i); + as = pIniFile->ReadString(key, "Name", p->Caption); + p->Caption = as.c_str(); + p->Enabled = pIniFile->ReadInteger(key, "Enabled", p->Enabled); + if( pMap != NULL ){ + StrCopy(pMap->ProfileName[i], p->Enabled ? as.c_str() : "", 63); + } + } + if( pMap != NULL ){ + for( ; i < 16; i++ ){ + sprintf(key, "Define%d", i); + as = pIniFile->ReadString(key, "Name", ""); + StrCopy(pMap->ProfileName[i], as.c_str(), 63); + } + } + delete pIniFile; + UpdateProfile(); +} +//--------------------------------------------------------------------------- +// ƒŒƒWƒXƒgƒŠ‚©‚ç‚̓ǂÝo‚µ +void __fastcall TMmttyWd::ReadProfile(int n, LPCSTR pName) +{ + char bf[256]; + AnsiString as, ws; + + if( n == 1024 ){ + strcpy(bf, pName); + } + else { + sprintf(bf, "%sUserPara.ini", BgnDir); + } + TMemIniFile *pIniFile = new TMemIniFile(bf); + + char key[32]; + sprintf(key, "Define%d", n); + + pSound->Suspend(); + + sys.m_FixShift = pIniFile->ReadInteger(key, "AFCFixShift", sys.m_FixShift); + sys.m_AFC = pIniFile->ReadInteger(key, "AFC", sys.m_AFC); + sys.m_AFCSQ = pIniFile->ReadInteger(key, "AFCSQ", sys.m_AFCSQ); + sys.m_AFCTime = ReadDoubleIniFile(pIniFile, key, "AFCTime", sys.m_AFCTime); + sys.m_AFCSweep = ReadDoubleIniFile(pIniFile, key, "AFCSweep", sys.m_AFCSweep); + + rtty.m_uos = pIniFile->ReadInteger(key, "UOS", rtty.m_uos); + + sys.m_TxNet = pIniFile->ReadInteger(key, "TxNet", sys.m_TxNet); + sys.m_TxDisRev = pIniFile->ReadInteger(key, "TxDisRev", sys.m_TxDisRev); + sys.m_LimitGain = ReadDoubleIniFile(pIniFile, key, "LimitDxGain", sys.m_LimitGain); + pSound->FSKDEM.m_LimitOverSampling = pIniFile->ReadInteger(key, "LimitOverSampling", pSound->FSKDEM.m_LimitOverSampling); + pSound->FSKDEM.m_LimitAGC = pIniFile->ReadInteger(key, "LimitAGC", pSound->FSKDEM.m_LimitAGC); + pSound->FSKDEM.m_atc = pIniFile->ReadInteger(key, "ATC", pSound->FSKDEM.m_atc); + pSound->FSKDEM.m_atcMark.m_Max = pIniFile->ReadInteger(key, "ATCTime", pSound->FSKDEM.m_atcMark.m_Max); + pSound->FSKDEM.m_atcSpace.m_Max = pSound->FSKDEM.m_atcMark.m_Max; + + pSound->FSKDEM.m_majority = pIniFile->ReadInteger(key, "Majority", pSound->FSKDEM.m_majority); + pSound->FSKDEM.m_ignoreFream = pIniFile->ReadInteger(key, "IgnoreFreamError", pSound->FSKDEM.m_ignoreFream); + + pSound->FSKDEM.SetSQ(pIniFile->ReadInteger(key, "SQ", pSound->FSKDEM.GetSQ())); + pSound->FSKDEM.SetSQLevel(ReadDoubleIniFile(pIniFile, key, "SQLevel", pSound->FSKDEM.GetSQLevel())); + + sys.m_DefMarkFreq = ReadDoubleIniFile(pIniFile, key, "DefMarkFreq", sys.m_DefMarkFreq); + sys.m_DefShift = ReadDoubleIniFile(pIniFile, key, "DefShift", sys.m_DefShift); + sys.m_DefStopLen = pIniFile->ReadInteger(key, "DefStopLen", sys.m_DefStopLen); + + pSound->FSKMOD.SetOutputGain(ReadDoubleIniFile(pIniFile, key, "OutputGain", pSound->FSKMOD.GetOutputGain())); + + sys.m_echo = pIniFile->ReadInteger(key, "TXLoop", sys.m_echo); + pSound->FSKMOD.m_bpftap = pIniFile->ReadInteger(key, "TXBPFTAP", pSound->FSKMOD.m_bpftap); + pSound->FSKMOD.m_lpf = pIniFile->ReadInteger(key, "TXLPF", pSound->FSKMOD.m_lpf); + pSound->FSKMOD.SetLPFFreq(ReadDoubleIniFile(pIniFile, key, "TXLPFFreq", pSound->FSKMOD.GetLPFFreq())); + pSound->FSKMOD.CalcBPF(); + + sys.m_LWait = pIniFile->ReadInteger(key, "TXWaitType", sys.m_LWait); + pSound->FSKMOD.m_CharWait = pIniFile->ReadInteger(key, "TXCharWait", pSound->FSKMOD.m_CharWait); + pSound->FSKMOD.m_DiddleWait = pIniFile->ReadInteger(key, "TXDiddleWait", pSound->FSKMOD.m_DiddleWait); + pSound->FSKMOD.m_CharWaitDiddle = pIniFile->ReadInteger(key, "TXCharWaitDiddle", pSound->FSKMOD.m_CharWaitDiddle); + pSound->FSKMOD.m_RandomDiddle = pIniFile->ReadInteger(key, "TXRandomDiddle", pSound->FSKMOD.m_RandomDiddle); + pSound->FSKMOD.m_WaitTimer = pIniFile->ReadInteger(key, "TXWaitTimerDiddle", pSound->FSKMOD.m_WaitTimer); + + sys.m_Rev = pIniFile->ReadInteger(key, "Rev", sys.m_Rev); + + double oldshift = pSound->FSKDEM.GetSpaceFreq() - pSound->FSKDEM.GetMarkFreq(); + double sft = ReadDoubleIniFile(pIniFile, key, "ShiftFreq", oldshift); + double mark = pSound->FSKDEM.GetMarkFreq(); + mark -= (sft - oldshift) * 0.5; + if( sft < oldshift ){ + mark = int(mark); + } + else { + mark = int(mark+0.5); + } + double space = mark + sft; + pSound->FSKDEM.SetSpaceFreq(space); + pSound->FSKDEM.SetMarkFreq(mark); + pSound->FSKMOD.SetMarkFreq(mark); + pSound->FSKMOD.SetSpaceFreq(space); + m_RxMarkFreq = mark; + m_RxSpaceFreq = space; + + pSound->m_bpf = pIniFile->ReadInteger(key, "RXBPF", pSound->m_bpf); + pSound->m_bpftap = pIniFile->ReadInteger(key, "RXBPFTAP", pSound->m_bpftap); + pSound->m_bpfafc = pIniFile->ReadInteger(key, "RXBPFAFC", pSound->m_bpfafc); + pSound->m_bpffw = ReadDoubleIniFile(pIniFile, key, "RXBPFFW", pSound->m_bpffw); + + pSound->m_lmsbpf = pIniFile->ReadInteger(key, "RXlms", pSound->m_lmsbpf); + pSound->m_lms.m_lmsDelay = pIniFile->ReadInteger(key, "RXlmsDelay", pSound->m_lms.m_lmsDelay); + pSound->m_lms.m_lmsMU2 = ReadDoubleIniFile(pIniFile, key, "RXlmsMU2", pSound->m_lms.m_lmsMU2); + pSound->m_lms.m_lmsGM = ReadDoubleIniFile(pIniFile, key, "RXlmsGM", pSound->m_lms.m_lmsGM); + pSound->m_lms.m_lmsAGC = pIniFile->ReadInteger(key, "RXlmsAGC", pSound->m_lms.m_lmsAGC); + pSound->m_lms.m_lmsInv = pIniFile->ReadInteger(key, "RXlmsInv", pSound->m_lms.m_lmsInv); + pSound->m_lms.m_Tap = pIniFile->ReadInteger(key, "RXlmsTAP", pSound->m_lms.m_Tap); + pSound->m_lms.m_NotchTap = pIniFile->ReadInteger(key, "RXNotchTAP", pSound->m_lms.m_NotchTap); + pSound->m_lms.m_bpf = pIniFile->ReadInteger(key, "RXlmsBPF", pSound->m_lms.m_bpf); + pSound->m_lms.m_Type = pIniFile->ReadInteger(key, "RXlmsType", pSound->m_lms.m_Type); + pSound->m_lms.m_lmsNotch = pIniFile->ReadInteger(key, "RXlmsNotch", pSound->m_lms.m_lmsNotch); + pSound->m_lms.m_lmsNotch2 = pIniFile->ReadInteger(key, "RXlmsNotch2", pSound->m_lms.m_lmsNotch2); + pSound->m_lms.m_twoNotch = pIniFile->ReadInteger(key, "RXlmsTwoNotch", pSound->m_lms.m_twoNotch); + if( !pSound->m_lmsbpf && pSound->m_lms.m_twoNotch ) pSound->m_lms.m_lmsNotch = pSound->m_lms.m_lmsNotch2 = 0; + + pSound->CalcBPF(); + + pSound->FSKDEM.m_type = pIniFile->ReadInteger(key, "DEMTYPE", pSound->FSKDEM.m_type); + pSound->FSKDEM.SetBaudRate(ReadDoubleIniFile(pIniFile, key, "BaudRate", pSound->FSKDEM.GetBaudRate())); + pSound->FSKDEM.m_lpf = pIniFile->ReadInteger(key, "SmoozType", pSound->FSKDEM.m_lpf); + pSound->FSKDEM.m_lpfOrder = pIniFile->ReadInteger(key, "SmoozOrder", pSound->FSKDEM.m_lpfOrder); + pSound->FSKDEM.SetLPFFreq(ReadDoubleIniFile(pIniFile, key, "SmoozIIR", pSound->FSKDEM.m_lpffreq)); + pSound->FSKDEM.SetSmoozFreq(ReadDoubleIniFile(pIniFile, key, "Smooz", pSound->FSKDEM.GetSmoozFreq())); + + pSound->FSKDEM.m_BitLen = pIniFile->ReadInteger(key, "TTYBitLen", pSound->FSKDEM.m_BitLen); + pSound->FSKDEM.m_StopLen = pIniFile->ReadInteger(key, "TTYStopLen", pSound->FSKDEM.m_StopLen); + pSound->FSKDEM.m_Parity = pIniFile->ReadInteger(key, "TTYParity", pSound->FSKDEM.m_Parity); + pSound->FSKMOD.m_BitLen = pSound->FSKDEM.m_BitLen; + pSound->FSKMOD.m_StopLen = pSound->FSKDEM.m_StopLen; + pSound->FSKMOD.m_Parity = pSound->FSKDEM.m_Parity; + + pSound->FSKDEM.SetFilterTap(pIniFile->ReadInteger(key, "Tap", pSound->FSKDEM.GetFilterTap())); + pSound->FSKDEM.m_iirfw = pIniFile->ReadInteger(key, "IIRBW", pSound->FSKDEM.m_iirfw); + pSound->FSKDEM.SetIIR(pSound->FSKDEM.m_iirfw); + pSound->FSKDEM.m_Phase.m_TONES = pIniFile->ReadInteger(key, "FFTTones", pSound->FSKDEM.m_Phase.m_TONES); + pSound->FSKDEM.m_Phase.Create(); + + pSound->FSKDEM.m_pll.SetVcoGain(ReadDoubleIniFile(pIniFile, key, "pllVcoGain", pSound->FSKDEM.m_pll.m_vcogain)); + pSound->FSKDEM.m_pll.m_loopOrder = pIniFile->ReadInteger(key, "pllLoopOrder", pSound->FSKDEM.m_pll.m_loopOrder); + pSound->FSKDEM.m_pll.m_loopFC = ReadDoubleIniFile(pIniFile, key, "pllLoopFC", pSound->FSKDEM.m_pll.m_loopFC); + pSound->FSKDEM.m_pll.m_outOrder = pIniFile->ReadInteger(key, "pllOutOrder", pSound->FSKDEM.m_pll.m_outOrder); + pSound->FSKDEM.m_pll.m_outFC = ReadDoubleIniFile(pIniFile, key, "pllOutFC", pSound->FSKDEM.m_pll.m_outFC); + pSound->FSKDEM.m_pll.MakeLoopLPF(); + pSound->FSKDEM.m_pll.MakeOutLPF(); + + pSound->FSKMOD.m_diddle = pIniFile->ReadInteger(key, "Diddle", pSound->FSKMOD.m_diddle); + + sys.m_TxFixShift = pIniFile->ReadInteger(key, "TxFixShift", sys.m_TxFixShift); + sys.m_TxRxInv = pIniFile->ReadInteger(key, "InvPTT", sys.m_TxRxInv); + sys.m_txuos = pIniFile->ReadInteger(key, "TXUOS", sys.m_txuos); + +//AA6YQ option, Added by JE3HHT on Sep.2010 + CAA6YQ *pAA6YQ = &pSound->FSKDEM.m_AA6YQ; + pAA6YQ->m_fEnabled = pIniFile->ReadInteger(key, "AA6YQ.Enabled", 0); // 0 = for old profiles + pAA6YQ->m_bpfTaps = pIniFile->ReadInteger(key, "AA6YQ.TapsBPF", pAA6YQ->m_bpfTaps); + pAA6YQ->m_bpfFW = ReadDoubleIniFile(pIniFile, key, "AA6YQ.WidthBPF", pAA6YQ->m_bpfFW); + pAA6YQ->m_befTaps = pIniFile->ReadInteger(key, "AA6YQ.TapsBEF", pAA6YQ->m_befTaps); + pAA6YQ->m_befFW = ReadDoubleIniFile(pIniFile, key, "AA6YQ.WidthBEF", pAA6YQ->m_befFW); + pAA6YQ->m_afcERR = ReadDoubleIniFile(pIniFile, key, "AA6YQ.afcERR", pAA6YQ->m_afcERR); + int verAA6YQ = pIniFile->ReadInteger(key, "AA6YQ.Version", 0); + if( verAA6YQ < VERAA6YQ ){ + pAA6YQ->m_bpfTaps = 512; + pAA6YQ->m_befTaps = 256; + } + pAA6YQ->Create(); + + pSound->Resume(); + delete pIniFile; + if( Remote ) PostApp(TXM_PROFILE, 0x00000000 + n); + COMM.change = 1; + UpdateFSK(); + RemoteStat(); +} +//--------------------------------------------------------------------------- +// ƒŒƒWƒXƒgƒŠ‚Ö‚Ì‘‚«o‚µ +void __fastcall TMmttyWd::WriteProfile(int n, LPCSTR pName, int Flag) +{ + char bf[256]; + AnsiString as, ws; + + if( n == 1024 ){ + strcpy(bf, pName); + pName = sys.m_Call.c_str(); + } + else { + sprintf(bf, "%sUserPara.ini", BgnDir); + } + try { + + TMemIniFile *pIniFile = new TMemIniFile(bf); + + char key[32]; + sprintf(key, "Define%d", n); + + if( !Flag ){ + pIniFile->EraseSection(key); + pIniFile->WriteInteger(key, "Enabled", Flag); + if( (pMap != NULL) && !(Remote & REMDISSHARED) && (n >= 0) && (n < 16) ){ + pMap->ProfileName[n][0] = 0; + } + } + else { + pIniFile->WriteString(key, "Name", pName); + pIniFile->WriteInteger(key, "Enabled", Flag); + pIniFile->WriteInteger(key, "AFC", sys.m_AFC); + pIniFile->WriteInteger(key, "AFCFixShift", sys.m_FixShift); + pIniFile->WriteInteger(key, "AFCSQ", sys.m_AFCSQ); + WriteDoubleIniFile(pIniFile, key, "AFCTime", sys.m_AFCTime); + WriteDoubleIniFile(pIniFile, key, "AFCSweep", sys.m_AFCSweep); + + pIniFile->WriteInteger(key, "UOS", rtty.m_uos); + + pIniFile->WriteInteger(key, "TxNet", sys.m_TxNet); + pIniFile->WriteInteger(key, "TxDisRev", sys.m_TxDisRev); + WriteDoubleIniFile(pIniFile, key, "LimitDxGain", sys.m_LimitGain); + pIniFile->WriteInteger(key, "LimitOverSampling", pSound->FSKDEM.m_LimitOverSampling); + pIniFile->WriteInteger(key, "LimitAGC", pSound->FSKDEM.m_LimitAGC); + pIniFile->WriteInteger(key, "ATC", pSound->FSKDEM.m_atc); + pIniFile->WriteInteger(key, "ATCTime", pSound->FSKDEM.m_atcMark.m_Max); + + pIniFile->WriteInteger(key, "Majority", pSound->FSKDEM.m_majority); + pIniFile->WriteInteger(key, "IgnoreFreamError", pSound->FSKDEM.m_ignoreFream); + + pIniFile->WriteInteger(key, "SQ", pSound->FSKDEM.GetSQ()); + WriteDoubleIniFile(pIniFile, key, "SQLevel", pSound->FSKDEM.GetSQLevel()); + + WriteDoubleIniFile(pIniFile, key, "DefMarkFreq", sys.m_DefMarkFreq); + WriteDoubleIniFile(pIniFile, key, "DefShift", sys.m_DefShift); + pIniFile->WriteInteger(key, "DefStopLen", sys.m_DefStopLen); + + WriteDoubleIniFile(pIniFile, key, "OutputGain", pSound->FSKMOD.GetOutputGain()); + + pIniFile->WriteInteger(key, "TXLoop", sys.m_echo); + pIniFile->WriteInteger(key, "TXBPFTAP", pSound->FSKMOD.m_bpftap); + + pIniFile->WriteInteger(key, "TXLPF", pSound->FSKMOD.m_lpf); + WriteDoubleIniFile(pIniFile, key, "TXLPFFreq", pSound->FSKMOD.GetLPFFreq()); + + pIniFile->WriteInteger(key, "TXWaitType", sys.m_LWait); + pIniFile->WriteInteger(key, "TXCharWait", pSound->FSKMOD.m_CharWait); + pIniFile->WriteInteger(key, "TXDiddleWait", pSound->FSKMOD.m_DiddleWait); + pIniFile->WriteInteger(key, "TXCharWaitDiddle", pSound->FSKMOD.m_CharWaitDiddle); + pIniFile->WriteInteger(key, "TXRandomDiddle", pSound->FSKMOD.m_RandomDiddle); + pIniFile->WriteInteger(key, "TXWaitTimerDiddle", pSound->FSKMOD.m_WaitTimer); + pIniFile->WriteInteger(key, "Rev", sys.m_Rev); + + WriteDoubleIniFile(pIniFile, key, "ShiftFreq", pSound->FSKDEM.GetSpaceFreq() - pSound->FSKDEM.GetMarkFreq()); + pIniFile->WriteInteger(key, "RXBPF", pSound->m_bpf); + pIniFile->WriteInteger(key, "RXBPFTAP", pSound->m_bpftap); + pIniFile->WriteInteger(key, "RXBPFAFC", pSound->m_bpfafc); + WriteDoubleIniFile(pIniFile, key, "RXBPFFW", pSound->m_bpffw); + + pIniFile->WriteInteger(key, "RXlms", pSound->m_lmsbpf); + pIniFile->WriteInteger(key, "RXlmsDelay", pSound->m_lms.m_lmsDelay); + WriteDoubleIniFile(pIniFile, key, "RXlmsMU2", pSound->m_lms.m_lmsMU2); + WriteDoubleIniFile(pIniFile, key, "RXlmsGM", pSound->m_lms.m_lmsGM); + pIniFile->WriteInteger(key, "RXlmsAGC", pSound->m_lms.m_lmsAGC); + pIniFile->WriteInteger(key, "RXlmsInv", pSound->m_lms.m_lmsInv); + pIniFile->WriteInteger(key, "RXlmsTAP", pSound->m_lms.m_Tap); + pIniFile->WriteInteger(key, "RXNotchTAP", pSound->m_lms.m_NotchTap); + pIniFile->WriteInteger(key, "RXlmsBPF", pSound->m_lms.m_bpf); + pIniFile->WriteInteger(key, "RXlmsType", pSound->m_lms.m_Type); + pIniFile->WriteInteger(key, "RXlmsNotch", pSound->m_lms.m_lmsNotch); + pIniFile->WriteInteger(key, "RXlmsNotch2", pSound->m_lms.m_lmsNotch2); + pIniFile->WriteInteger(key, "RXlmsTwoNotch", pSound->m_lms.m_twoNotch); + + pIniFile->WriteInteger(key, "DEMTYPE", pSound->FSKDEM.m_type); + WriteDoubleIniFile(pIniFile, key, "BaudRate", pSound->FSKDEM.GetBaudRate()); + pIniFile->WriteInteger(key, "TTYBitLen", pSound->FSKDEM.m_BitLen); + pIniFile->WriteInteger(key, "TTYStopLen", pSound->FSKDEM.m_StopLen); + pIniFile->WriteInteger(key, "TTYParity", pSound->FSKDEM.m_Parity); + pIniFile->WriteInteger(key, "SmoozType", pSound->FSKDEM.m_lpf); + pIniFile->WriteInteger(key, "SmoozOrder", pSound->FSKDEM.m_lpfOrder); + WriteDoubleIniFile(pIniFile, key, "SmoozIIR", pSound->FSKDEM.m_lpffreq); + WriteDoubleIniFile(pIniFile, key, "Smooz", pSound->FSKDEM.GetSmoozFreq()); + + pIniFile->WriteInteger(key, "Tap", pSound->FSKDEM.GetFilterTap()); + pIniFile->WriteInteger(key, "IIRBW", pSound->FSKDEM.m_iirfw); + pIniFile->WriteInteger(key, "FFTTones", pSound->FSKDEM.m_Phase.m_TONES); + + WriteDoubleIniFile(pIniFile, key, "pllVcoGain", pSound->FSKDEM.m_pll.m_vcogain); + pIniFile->WriteInteger(key, "pllLoopOrder", pSound->FSKDEM.m_pll.m_loopOrder); + WriteDoubleIniFile(pIniFile, key, "pllLoopFC", pSound->FSKDEM.m_pll.m_loopFC); + pIniFile->WriteInteger(key, "pllOutOrder", pSound->FSKDEM.m_pll.m_outOrder); + WriteDoubleIniFile(pIniFile, key, "pllOutFC", pSound->FSKDEM.m_pll.m_outFC); + + pIniFile->WriteInteger(key, "Diddle", pSound->FSKMOD.m_diddle); + + pIniFile->WriteInteger(key, "TxFixShift", sys.m_TxFixShift); + pIniFile->WriteInteger(key, "InvPTT", sys.m_TxRxInv); + pIniFile->WriteInteger(key, "TXUOS", sys.m_txuos); + +//AA6YQ option, Added by JE3HHT on Sep.2010 + CAA6YQ *pAA6YQ = &pSound->FSKDEM.m_AA6YQ; + pIniFile->WriteInteger(key, "AA6YQ.Version", VERAA6YQ); + pIniFile->WriteInteger(key, "AA6YQ.Enabled", pAA6YQ->m_fEnabled); + pIniFile->WriteInteger(key, "AA6YQ.TapsBPF", pAA6YQ->m_bpfTaps); + WriteDoubleIniFile(pIniFile, key, "AA6YQ.WidthBPF", pAA6YQ->m_bpfFW); + pIniFile->WriteInteger(key, "AA6YQ.TapsBEF", pAA6YQ->m_befTaps); + WriteDoubleIniFile(pIniFile, key, "AA6YQ.WidthBEF", pAA6YQ->m_befFW); + WriteDoubleIniFile(pIniFile, key, "AA6YQ.afcERR", pAA6YQ->m_afcERR); + + } + pIniFile->UpdateFile(); + delete pIniFile; + if( Remote ) PostApp(TXM_PROFILE, (Flag ? 0x00010000 : 0x00020000) + n); + + } + catch(...){ + ErrorMB((Font->Charset != SHIFTJIS_CHARSET)?"Cannot update UserPara.INI":"UserPara.INI‚ðXV‚Å‚«‚Ü‚¹‚ñ."); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::WriteProfile(int n) +{ + AnsiString as; + TMenuItem *tp = NULL; + if( (n >= 0) && (n < 8) ){ + tp = GetKS(n); + as = tp->Caption; + } + else { + char bf[256]; + + sprintf(bf, "%sUserPara.ini", BgnDir); + TMemIniFile *pIniFile = new TMemIniFile(bf); + char key[32]; + sprintf(key, "Define%d", n); + as = pIniFile->ReadString(key, "Name", "User profile"); + delete pIniFile; + } + int r; + if( Font->Charset != SHIFTJIS_CHARSET ){ + r = InputMB("Assign profile", "Profile name", as); + } + else { + r = InputMB("ƒvƒƒtƒ@ƒCƒ‹‚Ì“o˜^", "ƒvƒƒtƒ@ƒCƒ‹‚Ì–¼‘O", as); + } + if( r == TRUE ){ + if( tp != NULL ){ + tp->Caption = as; + tp->Enabled = TRUE; + } + WriteProfile(n, as.c_str(), TRUE); + if( (pMap != NULL) && !(Remote & REMDISSHARED) && (n >= 0) && (n < 16) ){ + StrCopy(pMap->ProfileName[n], as.c_str(), 63); + } + UpdateProfile(); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KESClick(TObject *Sender) +{ + int i; + for( i = 0; i < 8; i++ ){ + TMenuItem *tp = GetKES(i); + if( tp == (TMenuItem *)Sender ){ + WriteProfile(i); + break; + } + } + AdjustFocus(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KDSClick(TObject *Sender) +{ + int i; + for( i = 0; i < 8; i++ ){ + TMenuItem *tp = GetKDS(i); + if( tp == (TMenuItem *)Sender ){ + tp = GetKS(i); + tp->Enabled = FALSE; + char bf[32]; + sprintf(bf, "Profile %d", i + 1); + tp->Caption = bf; + WriteProfile(i, bf, FALSE); + UpdateProfile(); + break; + } + } + AdjustFocus(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KSClick(TObject *Sender) +{ + int i; + for( i = 0; i < 8; i++ ){ + TMenuItem *tp = GetKS(i); + if( tp == (TMenuItem *)Sender ){ + ReadProfile(i, NULL); + UpdateItem(); + break; + } + } + AdjustFocus(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::RemoteProfile(DWORD flag) +{ + char bf[128]; + TMenuItem *tp; + + int n = flag & 0x0000ffff; + switch(flag & 0xffff0000){ + case 0x00000000: + if( ((n >= 0)&&(n <= 15)) || ((n>=1025)&&(n<=1026)) ){ + ReadProfile(n, NULL); + UpdateItem(); + } + break; + case 0x00010000: + if( (n >= 0)&&(n <= 15) ){ + if( pMap != NULL ){ + StrCopy(bf, pMap->ProfileName[n], 63); + } + else { + sprintf(bf, "Remote %d", n + 1); + } + if( n < 8 ){ + tp = GetKS(n); + tp->Caption = bf; + tp->Enabled = TRUE; + } + WriteProfile(n, bf, TRUE); + UpdateProfile(); + } + break; + case 0x00020000: + if( (n >= 0)&&(n <= 15) ){ + sprintf(bf, "Profile %d", n + 1); + if( n < 8 ){ + tp = GetKS(n); + tp->Caption = bf; + tp->Enabled = FALSE; + } + WriteProfile(n, bf, FALSE); + UpdateProfile(); + } + break; + case 0x00030000: + if( !m_OptionDialog ){ + KSLDClick(NULL); + } + break; + case 0x00040000: + if( !m_OptionDialog ){ + KSSVClick(NULL); + } + break; + case 0x00050000: + if( (n >= 0)&&(n <= 15) ){ + WriteProfile(n); + } + break; + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KSSVClick(TObject *Sender) +{ + if( (Font->Charset != SHIFTJIS_CHARSET) ){ + SaveDialog->Title = "Write Profile"; + SaveDialog->Filter = "Profiles(*.pro)|*.pro|"; + } + else { + SaveDialog->Title = "ƒvƒƒtƒ@ƒCƒ‹‚Ìì¬"; + SaveDialog->Filter = "ƒvƒƒtƒ@ƒCƒ‹(*.pro)|*.pro|"; + } + char bf[128]; + sprintf(bf, "%s.pro", ClipCall(sys.m_Call.c_str())); + SaveDialog->FileName = bf; + SaveDialog->DefaultExt = "pro"; + SaveDialog->InitialDir = BgnDir; + DisPaint = TRUE; + NormalWindow(this); + m_OptionDialog++; + if( Remote ){ + m_pRemOpenName = AnsiString(SaveDialog->Title).c_str(); //JA7UDE 0428 + PostApp(TXM_SHOWPROFILE, 1); + } + if( SaveDialog->Execute() == TRUE ){ + CWaitCursor w; + WriteProfile(1024, AnsiString(SaveDialog->FileName).c_str(), TRUE); //JA7UDE 0428 + } + m_pRemOpenName = NULL; + TopWindow(this); + m_OptionDialog--; + DisPaint = FALSE; + AdjustFocus(); + if( Remote ) PostApp(TXM_SHOWPROFILE, 0); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KSLDClick(TObject *Sender) +{ + OpenDialog->Options >> ofCreatePrompt; + OpenDialog->Options << ofFileMustExist; + if(Font->Charset != SHIFTJIS_CHARSET){ + OpenDialog->Title = "Load Profile"; + OpenDialog->Filter = "Profiles(*.pro)|*.pro|All files(*.*)|*.*|"; + } + else { + OpenDialog->Title = "ƒvƒƒtƒ@ƒCƒ‹‚̃[ƒh"; + OpenDialog->Filter = "ƒvƒƒtƒ@ƒCƒ‹(*.pro)|*.pro|‚·‚ׂẴtƒ@ƒCƒ‹(*.*)|*.*|"; + } + OpenDialog->FileName = ""; + OpenDialog->DefaultExt = "pro"; + OpenDialog->InitialDir = BgnDir; + DisPaint = TRUE; + NormalWindow(this); + m_OptionDialog++; + if( Remote ){ + m_pRemOpenName = AnsiString(OpenDialog->Title).c_str(); //JA7UDE 0428 + PostApp(TXM_SHOWPROFILE, 1); + } + if( OpenDialog->Execute() == TRUE ){ + CWaitCursor w; + ReadProfile(1024, AnsiString(OpenDialog->FileName).c_str()); //JA7UDE 0428 + UpdateItem(); + } + m_pRemOpenName = NULL; + TopWindow(this); + m_OptionDialog--; + DisPaint = FALSE; + AdjustFocus(); + if( Remote ) PostApp(TXM_SHOWPROFILE, 0); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KSDEFClick(TObject *Sender) +{ + ReadProfile(1025, NULL); + UpdateItem(); + AdjustFocus(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KSRETClick(TObject *Sender) +{ + ReadProfile(1026, NULL); + UpdateItem(); + AdjustFocus(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KPttTimClick(TObject *Sender) +{ + AnsiString as; + + as = m_PttTimer; + if( InputMB("MMTTY", (Font->Charset != SHIFTJIS_CHARSET)?"Enter PTT timer value(sec). (0 = OFF)":"PTTƒ^ƒCƒ}[ŽžŠÔi•bj‚ð“ü—Í‚µ‚ĉº‚³‚¢. (0 = OFF)", as) == TRUE ){ + if( !as.IsEmpty() ){ + int d; + sscanf(as.c_str(), "%lu", &d); + m_PttTimer = d; + UpdatePttTimer(); + KPttTim->Checked = m_PttTimer ? 1 : 0; + } + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::UpdatePttTimer(void) +{ + m_PttTimerCount = ::GetTickCount() + (m_PttTimer * 1000); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KROFClick(TObject *Sender) +{ + AnsiString as = LogDir; + if( InputMB("MMTTY", (Font->Charset != SHIFTJIS_CHARSET)?"Please enter folder name":"ƒtƒHƒ‹ƒ_–¼‚ð“ü—Í‚µ‚ĉº‚³‚¢.", as) == TRUE ){ + StrCopy(LogDir, as.c_str(), 255); + if( sys.m_log ){ + PrintText.MakeLogName(); + PrintText.OpenLogFile(); + } + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KROTClick(TObject *Sender) +{ + sys.m_logTimeStamp = sys.m_logTimeStamp ? FALSE : TRUE; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KROTUClick(TObject *Sender) +{ + sys.m_TimeStampUTC = sys.m_TimeStampUTC ? FALSE : TRUE; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KROTDClick(TObject *Sender) +{ + sys.m_ShowTimeStamp = sys.m_ShowTimeStamp ? FALSE : TRUE; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KMFileClick(TObject *Sender) +{ + KRcvLog->Checked = sys.m_log; + KROT->Checked = sys.m_logTimeStamp; + KROTU->Checked = sys.m_TimeStampUTC; + KROTD->Checked = sys.m_ShowTimeStamp; + KFlush->Enabled = Log.IsOpen() && Log.IsEdit(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::AddCall(LPCSTR p) +{ + SYSTEMTIME now; + GetLocal(&now); + char bf[128]; + sprintf(bf, "%02u:%02u\t%s", now.wHour, now.wMinute, p); + + int i; + TMenuItem *pm; + for( i = 0; i < PopupC->Items->Count; i++ ){ + pm = PopupC->Items->Items[i]; + if( !strcmp(AnsiString(pm->Caption).c_str()+6, p) ){ //JA7UDE 0428 + if( !i ){ + pm->Caption = bf; + return; + } + else { + PopupC->Items->Delete(i); + break; + } + } + } + pm = new TMenuItem (this); + pm->Caption = bf; + pm->RadioItem = FALSE; + pm->OnClick = KCClick; + pm->Checked = FALSE; + pm->Enabled = TRUE; + if( (i >= PopupC->Items->Count) && (PopupC->Items->Count == CALLLISTMAX) ){ + PopupC->Items->Delete(CALLLISTMAX-1); + } + PopupC->Items->Insert(0, pm); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KCClick(TObject *Sender) +{ + TMenuItem *pm = (TMenuItem *)Sender; + if( strcmp(AnsiString(HisCall->Text).c_str(), (AnsiString(pm->Caption).c_str()+6)) ){ //JA7UDE 0428 + HisCall->Text = pm->Caption.c_str() + 6; + FindCall(); + } +} +//--------------------------------------------------------------------------- +/* +void __fastcall TMmsstv::SBRXIDMouseUp(TObject *Sender, + TMouseButton Button, TShiftState Shift, int X, int Y) +{ + if( Button == mbRight ){ + if( PopupC->Items->Count ){ + TControl *tp = (TControl *)Sender; + PopupC->Popup(Left + GBLog->Left + tp->Left + SBRXID->Width/2, m_MW + Top + GBLog->Top + tp->Top); + } + } +} +*/ +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::HisCallDblClick(TObject *Sender) +{ + if( PopupC->Items->Count ){ + int MW = Height - ClientHeight; + PopupC->Popup(Left + PanelQSO->Left + HisCall->Left + HisCall->Width/2, Top + MW + PanelQSO->Top + HisCall->Top + HisCall->Height/2); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::LCallMouseDown(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y) +{ + if( Button == mbRight ){ + HisCallDblClick(NULL); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SelectCombo(int sw) +{ + m_DisEvent++; + + // DemoBox1‚Ì‘I‘ð + if( m_Baud ){ // Baud•\ަ + if( sw ) SetComboBox(DemoBox1, m_asBaud.c_str()); + DemoBox1->Text = pSound->FSKDEM.GetBaudRate(); + } + else { + switch(pSound->FSKDEM.m_type){ + case 0: // IIR + if( sw ) SetComboBox(DemoBox1, m_asIIRBW.c_str()); + DemoBox1->Text = pSound->FSKDEM.m_iirfw; + break; + case 1: + if( sw ) SetComboBox(DemoBox1, m_asFilterTap.c_str()); + DemoBox1->Text = pSound->FSKDEM.GetFilterTap(); + break; + case 2: + if( sw ) SetComboBox(DemoBox1, m_asVCOGain.c_str()); + DemoBox1->Text = pSound->FSKDEM.m_pll.m_vcogain; + break; + case 3: // FFT + if( sw ) SetComboBox(DemoBox1, "2,3,4,5,6"); + DemoBox1->Text = pSound->FSKDEM.m_Phase.m_TONES; + break; + } + } + + // DemoBox2‚Ì‘I‘ð + switch(pSound->FSKDEM.m_type){ + case 0: // IIR or FIR + case 1: + case 3: + if( sw ) SetComboBox(DemoBox2, "20,22.5,25,30,35,40,45,50,60,70,80,100,150,200,300,600"); + if( pSound->FSKDEM.m_lpf ){ + DemoBox2->Text = pSound->FSKDEM.m_lpffreq; + } + else { + DemoBox2->Text = pSound->FSKDEM.GetSmoozFreq(); + } + break; + case 2: // PLL + if( sw ) SetComboBox(DemoBox2, m_asLoopFC.c_str()); + DemoBox2->Text = pSound->FSKDEM.m_pll.m_loopFC; + break; + } + m_ShowBaud = m_Baud; + m_DisEvent--; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::DemoBox1Change(TObject *Sender) +{ + if( m_DisEvent ) return; + + double d; + sscanf(AnsiString(DemoBox1->Text).c_str(), "%lf", &d); //JA7UDE 0428 + if( m_Baud ){ // Baud + if( d > 0 ){ + if( sys.m_TxPort && (pSound->FSKDEM.GetBaudRate() != d) ) COMM.change = 1; + pSound->FSKDEM.SetBaudRate(d); + pSound->FSKMOD.SetBaudRate(d); + RemoteStat(); + UpdateFSK(); + } + } + else { + switch(pSound->FSKDEM.m_type){ + case 0: // IIR + if( (d > 0) && (d <= 500.0) ){ + pSound->FSKDEM.SetIIR(d); + } + break; + case 1: + { + int di = int(d + 0.1); + if( (di >= 2) && (di <= TAPMAX) ){ + pSound->FSKDEM.SetFilterTap(di); + } + } + break; + case 2: + if( (d > 0) && (d <= 1000.0) ){ + pSound->FSKDEM.m_pll.SetVcoGain(d); + } + break; + case 3: // FFT + if( (d > 2) && (d <= 6.0) ){ + pSound->FSKDEM.m_Phase.SetTones(d); + } + break; + } + } + AdjustFocus(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::DemoBox2Change(TObject *Sender) +{ + if( m_DisEvent ) return; + + double d; + sscanf(AnsiString(DemoBox2->Text).c_str(), "%lf", &d); //JA7UDE 0428 + switch(pSound->FSKDEM.m_type){ + case 0: + case 1: + case 3: + if( (d >= 20.0) && (d <= 1500.0) ){ + if( pSound->FSKDEM.m_lpf ){ + pSound->FSKDEM.SetLPFFreq(d); + } + else { + pSound->FSKDEM.SetSmoozFreq(d); + } + } + break; + case 2: + if( (d > 0) && (d <= 2000.0) ){ + pSound->FSKDEM.m_pll.m_loopFC = d; + pSound->FSKDEM.m_pll.MakeLoopLPF(); + } + break; + } + AdjustFocus(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::CMWheel(TMessage Message) +{ + if( Remote ) return; + + int z = Message.WParam >> 16; + z /= 120; + while( z ){ + if( z > 0 ){ + PrintText.ScrollBarUp(1); + z--; + } + else { + PrintText.ScrollBarDown(1); + z++; + } + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::SBTXMouseDown(TObject *Sender, + TMouseButton Button, TShiftState Shift, int X, int Y) +{ + if( Button == mbRight ){ + KOptionClick(KMacro); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::CMMML(TMessage Message) +{ + if( sys.m_LogLink != 2 ) return; + if( LogLink.m_pLink == NULL ) return; + + switch(Message.WParam){ + case MML_NOTIFYSESSION: + LogLink.NotifySession((LPCSTR)Message.LParam); + UpdateLogLink(); + break; + case MML_QRETURN: + if( !LogLink.IsLink() ) return; + if( LogLink.QReturn(&Log.m_sd, (const mmLOGDATA *)Message.LParam) ){ + UpdateTextData(); + } + break; + case MML_VFO: + if( !LogLink.IsLink() ) return; + if( Message.LParam ){ + Freq->Text = (LPCSTR)Message.LParam; + } + break; + } + Message.Result = TRUE; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::CMMMR(TMessage Message) +{ + if( pRadio == NULL ) return; + + switch(Message.WParam){ + case MMR_DEFCOMMAND: + { + LPCSTR p; + switch(Message.LParam){ + case 1: + p = RADIO.CmdRx.c_str(); + break; + case 2: + p = RADIO.CmdTx.c_str(); + break; + default: + p = RADIO.CmdInit.c_str(); + break; + } + pRadio->SendCommand(p); + } + break; + case MMR_VFO: + pRadio->UpdateFreq(double(Message.LParam)/10000.0); + break; + } + Message.Result = TRUE; +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KTXClick(TObject *Sender) +{ + int dis = (sys.m_DisTX&1) ? FALSE : TRUE; + sys.m_DisTX &= ~1; + sys.m_DisTX |= dis; + if( dis && SBTX->Down ){ + SBTXOFFClick(NULL); + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KMOptClick(TObject *Sender) +{ + KTest->Enabled = !SBTX->Down; + switch(m_SendWay){ + case 0: + KSChar->Checked = TRUE; + break; + case 1: + KSWord->Checked = TRUE; + break; + default: + KSLine->Checked = TRUE; + break; + } + KTX->Checked = (sys.m_DisTX&1); +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KViewClick(TObject *Sender) +{ + switch(m_PanelSize){ + case 0: + KPanelSmall->Checked = TRUE; + break; + case 1: + KPanelMedium->Checked = TRUE; + break; + case 3: + KPanelSuper->Checked = TRUE; + break; + default: + KPanelBig->Checked = TRUE; + break; + } + + switch(sys.m_FFTGain){ + case 0: + KFFTGL->Checked = TRUE; + break; + case 1: + KFFTGM->Checked = TRUE; + break; + case 2: + KFFTGH->Checked = TRUE; + break; + case 3: + KFFTGT->Checked = TRUE; + break; + case 4: + KFFTGS1->Checked = TRUE; + break; + case 5: + KFFTGS2->Checked = TRUE; + break; + case 6: + KFFTGS3->Checked = TRUE; + break; + default: + KFFTGS4->Checked = TRUE; + break; + } + switch(sys.m_FFTResp){ + case 1: + KFFTRF->Checked = TRUE; + break; + case 2: + KFFTRM->Checked = TRUE; + break; + default: + KFFTRS->Checked = TRUE; + break; + } + switch(pSound->m_FFTFW){ + case 0: + KFFTWA->Checked = TRUE; + break; + case 1: + KFFTW05->Checked = TRUE; + break; + case 2: + KFFTW1->Checked = TRUE; + break; + case 3: + KFFTW15->Checked = TRUE; + break; + case 4: + KFFTW2->Checked = TRUE; + break; + default: + KFFTW3->Checked = TRUE; + break; + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmttyWd::KExtCmdClick(TObject *Sender) +{ + KExtReset->Enabled = pSound->m_susp; + KExtSusp->Enabled = !pSound->m_susp; +} +//--------------------------------------------------------------------------- diff --git a/Main.dfm b/Main.dfm new file mode 100644 index 0000000..5099050 Binary files /dev/null and b/Main.dfm differ diff --git a/Main.h b/Main.h new file mode 100644 index 0000000..04aba8f --- /dev/null +++ b/Main.h @@ -0,0 +1,967 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------------- +#ifndef MainH +#define MainH +//--------------------------------------------------------------------------- +//JA7UDE 0427 +#include +#include +#include +#include +//--------------------------------------------------------------------------- +#include "ComLib.h" +#include "Sound.h" +#include "Comm.h" +#include "Ctnc.h" +#include "Cradio.h" +#include +#include +#include +#include +#include +//--------------------------------------------------------------------------- +#include "SendFile.h" +#define USEPAL 1 +#define SQSCALE 1024 // SQ ‚Ì•\ަƒXƒP[ƒ‹ +#define HELPNAME_A "MMTTY.CHM" +#define HELPNAME_B "MMTTY.HLP" +//--------------------------------------------------------------------------- +enum { + RXM_HANDLE=0x0000, // APP -> MMTTY + RXM_REQHANDLE, + RXM_EXIT, + RXM_PTT, + RXM_CHAR, + + RXM_WINPOS, // 5 + RXM_WIDTH, + RXM_REQPARA, + RXM_SETBAUD, + RXM_SETMARK, + + RXM_SETSPACE, // 10 + RXM_SETSWITCH, + RXM_SETHAM, + RXM_SHOWSETUP, + RXM_SETVIEW, + + RXM_SETSQLVL, // 15 + RXM_SHOW, + RXM_SETFIG, + RXM_SETRESO, + RXM_SETLPF, + + RXM_SETTXDELAY, // 20 + RXM_UPDATECOM, + RXM_SUSPEND, + RXM_NOTCH, + RXM_PROFILE, + + RXM_TIMER, // 25 + RXM_ENBFOCUS, + RXM_SETDEFFREQ, + RXM_SETLENGTH, + RXM_ENBSHARED, + + RXM_PTTFSK, // 30 Added by JE3HHT on Sep.2010 +//-------------------------------------- + TXM_HANDLE=0x8000, // MMTTY -> APP + TXM_REQHANDLE, + TXM_START, + TXM_CHAR, + TXM_PTTEVENT, + + TXM_HEIGHT, + TXM_BAUD, + TXM_MARK, + TXM_SPACE, + TXM_SWITCH, + + TXM_VIEW, + TXM_LEVEL, + TXM_FIGEVENT, + TXM_RESO, + TXM_LPF, + + TXM_THREAD, + TXM_PROFILE, + TXM_NOTCH, + TXM_DEFSHIFT, + TXM_RADIOFREQ, + + TXM_SHOWSETUP, + TXM_SHOWPROFILE, +}; +#pragma option -a- // Pack of structer +typedef struct { + LONG smpFreq; // MMTTY->APP + CHAR title[128]; // APP->MMTTY + CHAR comName[16];// APP->MMTTY + LONG smpFFT; // APP->MMTTY 0-11025, 1-8000 + + LONG flagFFT; + LONG arrayFFT[2048]; + LONG flagXY; + LONG arrayX[XYCOLLECT]; + LONG arrayY[XYCOLLECT]; + + CHAR verMMTTY[16]; + CHAR comRadio[16]; + LONG flagLostSound; // ƒTƒEƒ“ƒh‚ðˆê•”ޏ‚Á‚½(->APP) + LONG flagOverflow; // “ü—Í‚ª‘å‚«‰ß‚¬‚é(->APP) + LONG errorClock; // ppm + LONG smpDemFreq; // ƒfƒ‚ƒWƒ…ƒŒ[ƒ^‚̃Tƒ“ƒvƒŠƒ“ƒOŽü”g” + LONG txBuffCount; // ‘—Mƒoƒbƒtƒ@‚Ì–¢‘—M•¶Žš” + CHAR ProfileName[16][64]; +}COMARRAY; +#pragma option -a. + +class TMmttyWd : public TForm +{ +__published: // IDE ŠÇ—‚̃Rƒ“ƒ|[ƒlƒ“ƒg + TTimer *Timer; + TPanel *PanelRx; + TPaintBox *PBoxRx; + TScrollBar *ScrollBarRx; + TPanel *PanelTop; + TMainMenu *MainMenu; + TMenuItem *KMFile; + TGroupBox *GroupCtr; + TSpeedButton *SBFIG; + TSpeedButton *SBUOS; + TGroupBox *GroupDem; + TLabel *Label1; + TLabel *Label2; + TLabel *Label3; + TLabel *Label4; + TLabel *LTap; + TSpeedButton *SBRev; + TSpeedButton *SBHAM; + TSpeedButton *SBATC; + TSpeedButton *SBSQ; + TSpeedButton *SBAFC; + TComboBox *MarkFreq; + TComboBox *ShiftFreq; + TPanel *PanelFFT; + TPaintBox *PBoxFFTIN; + TPanel *PanelWater; + TPaintBox *PBoxWater; + TPanel *PanelQSO; + TPanel *PanelIn; + TPanel *PanelStat; + TLabel *LCall; + TEdit *HisCall; + TLabel *LName; + TEdit *HisName; + TLabel *LHIS; + TComboBox *HisRST; + TComboBox *MyRST; + TSpeedButton *SBQSO; + TPaintBox *PBoxIn; + TScrollBar *ScrollBarIn; + TLabel *LMY; + TSpeedButton *SBINClear; + TSpeedButton *SBIN1; + TSpeedButton *SBIN2; + TSpeedButton *SBIN3; + TSpeedButton *SBIN4; + TComboBox *MsgList; + TSpeedButton *SBINEdit; + TSpeedButton *SBTXOFF; + TSpeedButton *SBTX; + TMenuItem *KMEdit; + TMenuItem *KView; + TMenuItem *KMOpt; + TMenuItem *KMHelp; + TMenuItem *KOption; + TGroupBox *GroupM; + TSpeedButton *SBM1; + TSpeedButton *SBM2; + TSpeedButton *SBM3; + TSpeedButton *SBM4; + TSpeedButton *SBM5; + TSpeedButton *SBM6; + TSpeedButton *SBM7; + TSpeedButton *SBM8; + TSpeedButton *SBM9; + TSpeedButton *SBM10; + TSpeedButton *SBM11; + TSpeedButton *SBM12; + TSpeedButton *SBM13; + TSpeedButton *SBM14; + TSpeedButton *SBM15; + TSpeedButton *SBM16; + TMenuItem *KOS; + TMenuItem *KFFT; + TMenuItem *KMacro; + TMenuItem *KMsg; + TMenuItem *KWebHHT; + TMenuItem *N1; + TMenuItem *KHlpTxt; + TMenuItem *KVol; + TMenuItem *KRcvLog; + TMenuItem *KFileOut; + TOpenDialog *OpenDialog; + TMenuItem *N2; + TMenuItem *KExit; + TMenuItem *N3; + TMenuItem *KLog; + TMenuItem *KQSO; + TSpeedButton *SBFind; + TSpeedButton *SBData; + TEdit *HisQTH; + TSpeedButton *SBInit; + TMenuItem *N5; + TMenuItem *KOpenLog; + TMenuItem *KFlush; + TMenuItem *KTest; + TMenuItem *N4; + TMenuItem *KHlpLog; + TSaveDialog *SaveDialog; + TMenuItem *KSaveRx; + TMenuItem *KFFTFW; + TMenuItem *N6; + TMenuItem *KFFTWA; + TMenuItem *KFFTW1; + TMenuItem *KFFTW2; + TMenuItem *KFFTW3; + TMenuItem *KFFTW05; + TMenuItem *KFFTW15; + TSpeedButton *SBBPF; + TLabel *LLPF; + TLabel *Label7; + TMenuItem *N7; + TMenuItem *KDispVer; + TSpeedButton *SBLMS; + TLabel *LWait; + TTrackBar *TBCharWait; + TMenuItem *N8; + TMenuItem *KClrRx; + TPanel *PanelXY; + TPaintBox *PBoxXY; + TMenuItem *KXYScope; + TLabel *LHZ; + TSpeedButton *SBNET; + TMenuItem *N9; + TMenuItem *KRxRec; + TMenuItem *KRxPlay; + TMenuItem *KRxStop; + TMenuItem *KXYScopeSize; + TMenuItem *KXYSmall; + TMenuItem *KXYBig; + TMenuItem *KRxTime; + TMenuItem *KRxPause; + TSpeedButton *SBDem; + TMenuItem *KRxTop; + TMenuItem *KRxPos; + TMenuItem *KHlpDig; + TMenuItem *KShortCut; + TMenuItem *N10; + TMenuItem *KHint; + TMenuItem *KOptLog; + TMenuItem *KPanel; + TMenuItem *N11; + TMenuItem *KPanelSize; + TMenuItem *KPanelSmall; + TMenuItem *KPanelBig; + TMenuItem *KPanelMedium; + TMenuItem *KExtCmd; + TMenuItem *KExtCmd1; + TMenuItem *KExtCmd2; + TMenuItem *KExtCmd3; + TMenuItem *KExtCmd4; + TMenuItem *N12; + TMenuItem *KExtEnt; + TMenuItem *KExtEnt1; + TMenuItem *KExtEnt2; + TMenuItem *KExtEnt3; + TMenuItem *KExtEnt4; + TMenuItem *N13; + TMenuItem *KExtReset; + TMenuItem *KExtSusp; + TMenuItem *KExtDel; + TMenuItem *KExtDel1; + TMenuItem *KExtDel2; + TMenuItem *KExtDel3; + TMenuItem *KExtDel4; + TPanel *PanelSQ; + TPaintBox *PBoxSQ; + TMenuItem *KPanelSuper; + TMenuItem *KXYScopeQuality; + TMenuItem *KXYQuality1; + TMenuItem *KXYQuality2; + TMenuItem *KXYQuality3; + TMenuItem *KXYQuality4; + TMenuItem *KFFTGain; + TMenuItem *KFFTGL; + TMenuItem *KFFTGM; + TMenuItem *KFFTGH; + TMenuItem *KFFTGT; + TMenuItem *KWebJARTS; + TMenuItem *KWebGRP; + TMenuItem *KWebENG; + TComboBox *Freq; + TMenuItem *N14; + TMenuItem *KSetHelp; + TMenuItem *N15; + TMenuItem *KSend; + TMenuItem *KRun; + TMenuItem *KSChar; + TMenuItem *KSWord; + TMenuItem *KSLine; + TMenuItem *KFFTR; + TMenuItem *KFFTRS; + TMenuItem *KFFTRM; + TMenuItem *KFFTRF; + TMenuItem *KPaste; + TMenuItem *N16; + TMenuItem *KW7TI; + TMenuItem *KWebWSK; + TMenuItem *N17; + TMenuItem *KTNC; + TMenuItem *KRM; + TMenuItem *KMac; + TMenuItem *N18; + TMenuItem *KENT; + TMenuItem *N19; + TMenuItem *N20; + TMenuItem *KFFTGS1; + TMenuItem *KFFTGS2; + TMenuItem *KFFTGS3; + TMenuItem *KFFTGS4; + TPanel *PanelMac; + TMenuItem *KWP; + TMenuItem *KS; + TMenuItem *KS1; + TMenuItem *KS2; + TMenuItem *KS3; + TMenuItem *KS4; + TMenuItem *KS5; + TMenuItem *KS6; + TMenuItem *KS7; + TMenuItem *KS8; + TMenuItem *N21; + TMenuItem *KSDel; + TMenuItem *KSEnt; + TMenuItem *KDS1; + TMenuItem *KDS2; + TMenuItem *KDS3; + TMenuItem *KDS4; + TMenuItem *KDS5; + TMenuItem *KDS6; + TMenuItem *KDS7; + TMenuItem *KDS8; + TMenuItem *KES1; + TMenuItem *KES2; + TMenuItem *KES3; + TMenuItem *KES4; + TMenuItem *KES5; + TMenuItem *KES6; + TMenuItem *KES7; + TMenuItem *KES8; + TMenuItem *N22; + TMenuItem *KSSV; + TMenuItem *KSLD; + TMenuItem *N23; + TMenuItem *KSDEF; + TMenuItem *KSRET; + TMenuItem *KPttTim; + TMenuItem *KVolIn; + TMenuItem *KRO; + TMenuItem *KROT; + TMenuItem *KROF; + TMenuItem *KROTU; + TMenuItem *KROTD; + TMenuItem *N24; + TPopupMenu *PopupC; + TComboBox *DemoBox2; + TComboBox *DemoBox1; + TMenuItem *KTX; + TMenuItem *N25; + void __fastcall FormCloseQuery(TObject *Sender, bool &CanClose); + + void __fastcall PBoxFFTINPaint(TObject *Sender); + void __fastcall PBoxWaterPaint(TObject *Sender); + + void __fastcall SBFIGClick(TObject *Sender); + void __fastcall MarkFreqChange(TObject *Sender); + void __fastcall ShiftFreqChange(TObject *Sender); + + + void __fastcall SBUOSClick(TObject *Sender); + + + + + + + + + void __fastcall PBoxRxPaint(TObject *Sender); + void __fastcall FormPaint(TObject *Sender); + + void __fastcall SBRevClick(TObject *Sender); + + + + + void __fastcall SBATCClick(TObject *Sender); + + + + void __fastcall SBSQClick(TObject *Sender); + + void __fastcall SBTXClick(TObject *Sender); + + + + + void __fastcall FormKeyUp(TObject *Sender, WORD &Key, TShiftState Shift); + + + + + void __fastcall PBoxRxMouseUp(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y); + void __fastcall FormKeyPress(TObject *Sender, char &Key); + + + void __fastcall ScrollBarRxChange(TObject *Sender); + void __fastcall SBAFCClick(TObject *Sender); + + + void __fastcall PBoxInPaint(TObject *Sender); + void __fastcall ScrollBarInChange(TObject *Sender); + void __fastcall SBTXOFFClick(TObject *Sender); + void __fastcall SBINClearClick(TObject *Sender); + void __fastcall SBIN1Click(TObject *Sender); + void __fastcall SBIN2Click(TObject *Sender); + void __fastcall SBIN4Click(TObject *Sender); + void __fastcall SBIN3Click(TObject *Sender); + void __fastcall MsgListChange(TObject *Sender); + void __fastcall SBINEditClick(TObject *Sender); + void __fastcall KOptionClick(TObject *Sender); + void __fastcall HisCallKeyPress(TObject *Sender, char &Key); + void __fastcall SBMClick(TObject *Sender); + void __fastcall KOSClick(TObject *Sender); + void __fastcall KFFTClick(TObject *Sender); + void __fastcall FormResize(TObject *Sender); + + + void __fastcall TimerTimer(TObject *Sender); + + + void __fastcall KWebHHTClick(TObject *Sender); + void __fastcall KHlpTxtClick(TObject *Sender); + void __fastcall KVolClick(TObject *Sender); + + + void __fastcall KRcvLogClick(TObject *Sender); + void __fastcall KFileOutClick(TObject *Sender); + void __fastcall KExitClick(TObject *Sender); + + void __fastcall KLogClick(TObject *Sender); + void __fastcall KQSOClick(TObject *Sender); + void __fastcall SBQSOClick(TObject *Sender); + void __fastcall SBFindClick(TObject *Sender); + void __fastcall HisCallChange(TObject *Sender); + + void __fastcall LNameClick(TObject *Sender); + void __fastcall SBInitClick(TObject *Sender); + void __fastcall PBoxInClick(TObject *Sender); + void __fastcall KTestClick(TObject *Sender); + void __fastcall SBHAMClick(TObject *Sender); + void __fastcall KOpenLogClick(TObject *Sender); + void __fastcall KFlushClick(TObject *Sender); + void __fastcall KHlpLogClick(TObject *Sender); + void __fastcall FormKeyDown(TObject *Sender, WORD &Key, TShiftState Shift); + void __fastcall KSaveRxClick(TObject *Sender); + void __fastcall KFFTWAClick(TObject *Sender); + void __fastcall KFFTW1Click(TObject *Sender); + void __fastcall KFFTW2Click(TObject *Sender); + void __fastcall KFFTW3Click(TObject *Sender); + void __fastcall KFFTW05Click(TObject *Sender); + void __fastcall KFFTW15Click(TObject *Sender); + void __fastcall SBBPFClick(TObject *Sender); + + void __fastcall FormShow(TObject *Sender); + + + void __fastcall KDispVerClick(TObject *Sender); + void __fastcall SBLMSClick(TObject *Sender); + void __fastcall TBCharWaitChange(TObject *Sender); + void __fastcall KClrRxClick(TObject *Sender); + void __fastcall KXYScopeClick(TObject *Sender); + void __fastcall PBoxXYPaint(TObject *Sender); + + void __fastcall SBNETClick(TObject *Sender); + void __fastcall KRxRecClick(TObject *Sender); + void __fastcall KRxPlayClick(TObject *Sender); + void __fastcall KRxStopClick(TObject *Sender); + void __fastcall KXYSmallClick(TObject *Sender); + void __fastcall KXYBigClick(TObject *Sender); + void __fastcall KRxTimeClick(TObject *Sender); + void __fastcall KRxPauseClick(TObject *Sender); + void __fastcall SBDemClick(TObject *Sender); + void __fastcall KRxTopClick(TObject *Sender); + + + void __fastcall KRxPosClick(TObject *Sender); + void __fastcall KHlpDigClick(TObject *Sender); + void __fastcall KShortCutClick(TObject *Sender); + void __fastcall KHintClick(TObject *Sender); + + void __fastcall KOptLogClick(TObject *Sender); + void __fastcall KPanelClick(TObject *Sender); + void __fastcall KPanelSmallClick(TObject *Sender); + void __fastcall KPanelBigClick(TObject *Sender); + void __fastcall KPanelMediumClick(TObject *Sender); + void __fastcall KExtEnt1Click(TObject *Sender); + void __fastcall KExtEnt2Click(TObject *Sender); + void __fastcall KExtEnt3Click(TObject *Sender); + void __fastcall KExtEnt4Click(TObject *Sender); + void __fastcall KExtCmd1Click(TObject *Sender); + void __fastcall KExtCmd2Click(TObject *Sender); + void __fastcall KExtCmd3Click(TObject *Sender); + void __fastcall KExtCmd4Click(TObject *Sender); + void __fastcall KExtResetClick(TObject *Sender); + void __fastcall KExtSuspClick(TObject *Sender); + + + + + void __fastcall KExtDel1Click(TObject *Sender); + void __fastcall KExtDel2Click(TObject *Sender); + void __fastcall KExtDel3Click(TObject *Sender); + void __fastcall KExtDel4Click(TObject *Sender); + void __fastcall SBMMouseUp(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y); + void __fastcall SBIN1MouseUp(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y); + void __fastcall SBIN2MouseUp(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y); + void __fastcall SBIN3MouseUp(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y); + void __fastcall SBIN4MouseUp(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y); + + void __fastcall PBoxSQMouseDown(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y); + void __fastcall PBoxSQPaint(TObject *Sender); + void __fastcall KPanelSuperClick(TObject *Sender); + void __fastcall LLPFClick(TObject *Sender); + void __fastcall KXYQuality3Click(TObject *Sender); + void __fastcall KXYQuality2Click(TObject *Sender); + void __fastcall KXYQuality1Click(TObject *Sender); + void __fastcall KXYQuality4Click(TObject *Sender); + + + void __fastcall Label3Click(TObject *Sender); + void __fastcall KFFTGLClick(TObject *Sender); + void __fastcall KFFTGMClick(TObject *Sender); + void __fastcall KFFTGHClick(TObject *Sender); + void __fastcall KFFTGTClick(TObject *Sender); + void __fastcall KWebJARTSClick(TObject *Sender); + void __fastcall KWebGRPClick(TObject *Sender); + void __fastcall KWebENGClick(TObject *Sender); + void __fastcall LCallClick(TObject *Sender); + void __fastcall KSetHelpClick(TObject *Sender); + + + void __fastcall KSCharClick(TObject *Sender); + void __fastcall KSWordClick(TObject *Sender); + void __fastcall KSLineClick(TObject *Sender); + void __fastcall FreqChange(TObject *Sender); + void __fastcall KFFTRSClick(TObject *Sender); + void __fastcall KFFTRMClick(TObject *Sender); + void __fastcall KFFTRFClick(TObject *Sender); + void __fastcall KPasteClick(TObject *Sender); + void __fastcall KW7TIClick(TObject *Sender); + void __fastcall KWebWSKClick(TObject *Sender); + void __fastcall KTNCClick(TObject *Sender); + void __fastcall KRMClick(TObject *Sender); + + void __fastcall LTapClick(TObject *Sender); + + void __fastcall KMacClick(TObject *Sender); + void __fastcall KENTClick(TObject *Sender); + + void __fastcall KFFTGS1Click(TObject *Sender); + void __fastcall KFFTGS2Click(TObject *Sender); + void __fastcall KFFTGS4Click(TObject *Sender); + void __fastcall KFFTGS3Click(TObject *Sender); + void __fastcall PBoxFFTINMouseDown(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y); + void __fastcall HisCallClick(TObject *Sender); + void __fastcall SBLMSMouseDown(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y); + void __fastcall SBFindMouseDown(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y); + void __fastcall LWaitClick(TObject *Sender); + void __fastcall KWPClick(TObject *Sender); + void __fastcall SBDataMouseDown(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y); + void __fastcall KESClick(TObject *Sender); + void __fastcall KDSClick(TObject *Sender); + void __fastcall KSClick(TObject *Sender); + void __fastcall KSSVClick(TObject *Sender); + void __fastcall KSLDClick(TObject *Sender); + void __fastcall KSDEFClick(TObject *Sender); + void __fastcall KSRETClick(TObject *Sender); + void __fastcall KPttTimClick(TObject *Sender); + + + void __fastcall KROFClick(TObject *Sender); + void __fastcall KROTClick(TObject *Sender); + void __fastcall KROTUClick(TObject *Sender); + void __fastcall KROTDClick(TObject *Sender); + void __fastcall KMFileClick(TObject *Sender); + void __fastcall HisCallDblClick(TObject *Sender); + void __fastcall LCallMouseDown(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y); + void __fastcall DemoBox2Change(TObject *Sender); + void __fastcall DemoBox1Change(TObject *Sender); + + + void __fastcall SBTXMouseDown(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y); + void __fastcall KTXClick(TObject *Sender); + void __fastcall KMOptClick(TObject *Sender); + void __fastcall KViewClick(TObject *Sender); + void __fastcall KExtCmdClick(TObject *Sender); +private: // ƒ†[ƒU[錾 + WAVEFORMAT wfm; + + Graphics::TBitmap *pBitmapFFTIN; + Graphics::TBitmap *pBitmapWater; + Graphics::TBitmap *pBitmapXY; + Graphics::TBitmap *pBitmapSQ; + + Graphics::TBitmap *pBitmapRx; + Graphics::TBitmap *pBitmapIn; + + CAlignList AlignMain; + CAlignList AlignTop; + CAlignList AlignQSO; + CAlignList AlignStat; + + CWebRef WebRef; + + CRTTY rtty; + CRTTY rttysub; + CFifoEdit FifoEdit; + CComm *pComm; + CCtnc *pTnc; + CCradio *pRadio; + + int m_ReqRecv; + int m_DemType; + int m_LpfType; + int m_SendWay; + + double m_RxMarkFreq; + double m_RxSpaceFreq; + void __fastcall UpdateNet(void); + void __fastcall UpdateLogLink(void); + + void __fastcall UpdateColor(void); + + void __fastcall WndProc(TMessage &Message); + void __fastcall WndCopyData(TMessage &Message); + void __fastcall EntryAlignControl(void); + void __fastcall OnIdle(TObject *Sender, bool &Done); + void __fastcall OnMSG(tagMSG &Msg, bool &Handled); + void __fastcall OnActivate(TObject *Sender); + void __fastcall OnRestore(TObject *Sender); + + TSpeedButton *__fastcall GetSB(int n); + int __fastcall GetMacroIndex(TObject *Sender); + void __fastcall UpdateControlPanel(void); + void __fastcall UpdateXY2(void); + void __fastcall AlignLogPanel(void); + void __fastcall UpdatePanel(void); + void __fastcall UpdateItem(void); + void __fastcall UpdateMacro(void); + void __fastcall UpdateLMS(void); + void __fastcall UpdateUI(void); + void __fastcall ReadSampFreq(void); + void __fastcall ReadCombList(TMemIniFile *tp, AnsiString &as, LPCSTR pKey, LPCSTR pDef); + void __fastcall ReadRegister(void); + void __fastcall WriteRegister(void); + void __fastcall StoreCWID(LPSTR &tt, char c, int &nc, int size); + void __fastcall ConvString(LPSTR t, LPCSTR p, int size, int sw); + void __fastcall SetGreetingString(LPSTR t, LPCSTR pCall, int type); + void __fastcall UpdateFSK(void); + void __fastcall OpenCloseCom(void); + + void __fastcall DoOption(TObject *Sender, int sw); + void __fastcall SetFSKPara(COMMPARA *cp); + void __fastcall OpenClosePTT(void); + void __fastcall WriteFifoEdit(LPCSTR p); + void __fastcall PushKey(char Key); + + void __fastcall TimerFocus(void); + void __fastcall XMIT(int sw); + void __fastcall ToTX(LPCSTR p); + void __fastcall ToRX(int sw); + void __fastcall FindMsgList(AnsiString fs); + void __fastcall FindMsgLst(WORD nKey); + void __fastcall UpdateMsgList(void); + int __fastcall OutputFile(LPCSTR pName); + + void __fastcall SetShift(double sf); + void __fastcall UpdateLogData(void); + void __fastcall UpdateTextData(void); + int __fastcall DrawXY(void); + void __fastcall UpdateXYScope(void); + void __fastcall UpdateXYQuality(void); + void __fastcall UpdateCallsign(void); + + void __fastcall RecvJob(void); + + void __fastcall CallCapture(void); + void __fastcall QSOIN(void); + void __fastcall QSOOUT(int sw); + + CINTPXY2 i2m; + CINTPXY2 i2s; + CINTPXY4FIR i4m; + CINTPXY4FIR i4s; + CINTPXY8FIR i8m; + CINTPXY8FIR i8s; + + int m_XYSize; + int m_XYQuality; + int m_PanelSize; + + int m_InitFirst; + int m_DisAlign; + int m_BefHeight; + int m_DisEvent; + int m_MacroStat; + int m_Macro; + int m_PaletteQuery; + int m_NameQTH; + int m_Ctrl; + int m_ReqPaletteChange; + int m_PaletteTimer; + int m_Dupe; + int m_Running; + int m_Baud; + int m_RemoteTimer; + int m_RemoteDelay; + + int m_OptionDialog; + HWND m_hOptionWnd; + + AnsiString m_NowStr; + + int m_filemode; + int m_FifoOutTimer; + + int m_FIGTimer; + void __fastcall UpdateLWait(void); + int __fastcall IsTxIdle(void); + int __fastcall GetTxBufCount(void); + + TMenuItem *pAndyMenu; + TMenuItem *pAndyMenu2; + void __fastcall KAndyHelp(TObject *Sender); + void __fastcall AddHelpMenu(void); + + void __fastcall UpdateTitle(void); + void __fastcall AutoLogSave(void); + +// Profile‚̃Cƒ“ƒvƒŠƒƒ“ƒg + TMenuItem *__fastcall GetKS(int n); + TMenuItem *__fastcall GetKDS(int n); + TMenuItem *__fastcall GetKES(int n); + void __fastcall UpdateProfile(void); + void __fastcall ReadProfileList(void); + void __fastcall ReadProfile(int n, LPCSTR pName); + void __fastcall WriteProfile(int n); + void __fastcall WriteProfile(int n, LPCSTR pName, int Flag); + void __fastcall RemoteProfile(DWORD flag); + LPCSTR m_pRemOpenName; + +#if USEPAL +public: + HPALETTE UsrPal; +private: + HPALETTE OldPal; + void __fastcall ClosePalette(void); + void __fastcall SetupPalette(RGBQUAD *pTbl, int max); + int __fastcall EntryColor(RGBQUAD *pTbl, TColor col, int n); + void __fastcall SetColorIndex(void); + + DYNAMIC HPALETTE __fastcall GetPalette(void); +#endif + + CRecentMenu RecentMenu; + void __fastcall UpdateRecentMenu(void); + void __fastcall RecentAdd(LPCSTR pNew, int f); + void __fastcall OnRecentClick(TObject *Sender); + + void __fastcall SetHint(TControl *tp, WORD Key); + void __fastcall SetShortCut(TMenuItem *mp, WORD Key); + + void __fastcall UpdateExtProgram(void); + void __fastcall KExtEntClick(int n, TMenuItem *mp); + void __fastcall KExtCmdClick(int n); + + void __fastcall SBINMouseUp(int n); + + void __fastcall DrawSQ(void); + + void __fastcall EditMB(int n); + void __fastcall FindCall(void); +// PttTimer‚̃Cƒ“ƒvƒŠƒƒ“ƒg + int m_PttTimer; + int m_PttTimerCount; + void __fastcall UpdatePttTimer(void); + +// ƒtƒ@ƒCƒ‹‘—M‚̃Cƒ“ƒvƒŠƒƒ“ƒg + TSendFileDlg *p_SendFileDlg; + +// BARTG + int m_BARTGTimer; + void __fastcall UpdateBARTG(void); + +public: // ƒ†[ƒU[錾 + __fastcall TMmttyWd(TComponent* Owner); + __fastcall ~TMmttyWd(); + void __fastcall StartOption(void); + + CPrintText PrintText; + TSound *pSound; + + void __fastcall FirstFileMapping(void); + void __fastcall UpdateComarray(void); + void __fastcall UpdateRemort(void); + void __fastcall OutputStr(LPCSTR pOut); + + void __fastcall SetYourCallsign(LPCSTR pCall); + void __fastcall SetYourName(LPCSTR pName); + void __fastcall SetYourQTH(LPCSTR pQTH); + void __fastcall SetYourRST(LPCSTR pRST); + void __fastcall UpdateLimit(void); + + void __fastcall UpdateShortCut(BOOL bMenu); + + void __fastcall UpdateSystemFont(void); + void __fastcall ReqPaletteChange(void); + void __fastcall UpdateRev(void); + void __fastcall PostApp(WPARAM wParam, LPARAM lParam); + +//Macro Intval‚̃Cƒ“ƒvƒŠƒƒ“ƒg + void __fastcall ClearMacroTimer(void); + void __fastcall MacBtnExec(int n); + int m_MacRetry; + int m_MacTimer; + + void __fastcall AdjustFocus(void); + +//ƒR[ƒ‹ƒŠƒXƒg‚̃Cƒ“ƒvƒŠƒƒ“ƒg +#define CALLLISTMAX 32 + void __fastcall AddCall(LPCSTR p); + void __fastcall KCClick(TObject *Sender); + +//•œ’²ŠíƒRƒ“ƒ“ƒ{ƒ{ƒbƒNƒX‚̃Cƒ“ƒvƒŠƒƒ“ƒg + AnsiString m_asFilterTap; + AnsiString m_asVCOGain; + AnsiString m_asIIRBW; + AnsiString m_asBaud; + AnsiString m_asSmooth; + AnsiString m_asLoopFC; + int m_ShowBaud; + void __fastcall SelectCombo(int sw); + +//TNC–Í‹[‹@”\‚̃Cƒ“ƒvƒŠƒƒ“ƒg + void __fastcall OnTncEvent(void); + void __fastcall OpenCloseTNC(void); + void __fastcall UpdateTNCPTT(void); + void __fastcall SetNMMT(void); + void __fastcall TncConvers(void); + BOOL __fastcall RxCommon(BYTE c); + void __fastcall RxTnc241(char c); + void __fastcall RxKAM(char c); + void __fastcall CmdTnc241(LPSTR p); + void __fastcall CmdKAM(LPSTR p); + void __fastcall PutTNC(char c); + void __fastcall UpdateStayOnTop(void); + void __fastcall UpdateMacroShow(int sw); + +//ƒŠƒ‚[ƒg‹@”\‚̃Cƒ“ƒvƒŠƒƒ“ƒg + int m_cRemoteTimeout; + AnsiString m_strCommonMemory; + + HANDLE hMap; + COMARRAY *pMap; + int m_RemoteHeight; + int m_RemoteBaud; + int m_RemoteSwitch; + int m_RemoteView; + int m_RemoteIIR; + int m_RemoteLPF; + int m_RemoteMark; + int m_RemoteSpace; + int m_RemoteNotch; + int m_RemoteDefShift; + + void __fastcall RemoteFreq(void); + void __fastcall InitRemoteStat(void); + DWORD __fastcall GetRemoteSwitch(void); + DWORD __fastcall GetRemoteView(void); + void __fastcall RemoteStat(void); + void __fastcall RemoteSwitch(DWORD d); + void __fastcall RemoteView(DWORD d); + void __fastcall RemoteSigLevel(DWORD d); + void __fastcall RemoteMMTTY(tagMSG &Msg); + void __fastcall SetRemoteFFT(void); +//Radio command‹@”\‚̃Cƒ“ƒvƒŠƒƒ“ƒg + void __fastcall OpenCloseRadio(void); + +// void __fastcall TopWindow(void); + + CTextFifo m_cmdTNC; + AnsiString m_TNCStg; // ‘—M•Û—¯ƒf[ƒ^ +#define CM_CTNC (WM_USER+400) // Hook on WndProc + void __fastcall OnTncEvent(TMessage &Message); + +#define CM_CRADIO (WM_USER+401) +#define CM_CMML (WM_USER+402) +#define CM_CMMR (WM_USER+403) +protected: + void __fastcall CMWheel(TMessage Message); + void __fastcall CMMML(TMessage Message); + void __fastcall CMMMR(TMessage Message); + +BEGIN_MESSAGE_MAP + MESSAGE_HANDLER(WM_MOUSEWHEEL, TMessage, CMWheel) + MESSAGE_HANDLER(CM_CMML, TMessage, CMMML) + MESSAGE_HANDLER(CM_CMMR, TMessage, CMMMR) +END_MESSAGE_MAP(TForm) +}; +//--------------------------------------------------------------------------- +extern TMmttyWd *MmttyWd; +//--------------------------------------------------------------------------- +#endif + diff --git a/MmcgDlg.cpp b/MmcgDlg.cpp new file mode 100644 index 0000000..8790d44 --- /dev/null +++ b/MmcgDlg.cpp @@ -0,0 +1,243 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "MmcgDlg.h" +//--------------------------------------------------------------------- +#pragma resource "*.dfm" +//TMmcgDlgBox *MmcgDlgBox; +//--------------------------------------------------------------------- +__fastcall TMmcgDlgBox::TMmcgDlgBox(TComponent* AOwner) + : TForm(AOwner) +{ + FormStyle = ((TForm *)AOwner)->FormStyle; + Font->Name = ((TForm *)AOwner)->Font->Name; + Font->Charset = ((TForm *)AOwner)->Font->Charset; + + if( Font->Charset != SHIFTJIS_CHARSET ){ + SBInc->Caption = "String"; + SBMask->Caption = "Area"; + CancelBtn->Caption = "Cancel"; + } + + m_DisEvent = 0; +} +//--------------------------------------------------------------------- +void __fastcall TMmcgDlgBox::UpdateCaption(void) +{ + char bf[256]; + + if( Font->Charset != SHIFTJIS_CHARSET ){ + if( mmcg.m_Call[0] ){ + sprintf(bf, "MMCG [%s] Find: %d", mmcg.m_Call, mmcg.m_FindCnt); + } + else { + sprintf(bf, "MMCG Find: %d", mmcg.m_FindCnt); + } + } + else { + if( mmcg.m_Call[0] ){ + sprintf(bf, "MMCG [%s] Œó•â : %d", mmcg.m_Call, mmcg.m_FindCnt); + } + else { + sprintf(bf, "MMCG Œó•â: %d", mmcg.m_FindCnt); + } + } + Caption = bf; +} + +//--------------------------------------------------------------------- +int __fastcall TMmcgDlgBox::Execute(AnsiString &call, AnsiString &qth, AnsiString &op) +{ + StrCopy(mmcg.m_Call, call.c_str(), MLCALL); + mmcg.SetMask(); + SBMask->Down = TRUE; + if( mmcg.m_mask == -1 ) SBMask->Enabled = FALSE; + + char bf[256]; + + bf[0] = 0; + if( isdigit(*op.c_str()) ){ + strcpy(bf, op.c_str()); + } + else if( !qth.IsEmpty() ){ + strcpy(bf, qth.c_str()); + } + m_DisEvent++; + EditYomi->Text = bf; + mmcg.Find(bf); + UpdateCaption(); + m_DisEvent--; + Grid->RowCount = mmcg.m_FindCnt ? mmcg.m_FindCnt + 1 : 2; + if( ShowModal() == IDOK ){ + int n = Grid->Row - 1; + if( (n >= 0)&&(n < mmcg.m_FindCnt) ){ + qth = mmcg.GetQTH(mmcg.m_fp[n]); + op = mmcg.m_fp[n]->Code; + return TRUE; + } + } + return FALSE; +} +//--------------------------------------------------------------------- +void __fastcall TMmcgDlgBox::GridDrawCell(TObject *Sender, int Col, int Row, + TRect &Rect, TGridDrawState State) +{ + char bf[256]; + MMCG *mp; + + Grid->Canvas->FillRect(Rect); + int X = Rect.Left + 4; + int Y = Rect.Top + 2; + + if( Row ){ + Row--; + bf[0] = 0; + if( Row < mmcg.m_FindCnt ){ + mp = mmcg.m_fp[Row]; + } + else { + mp = NULL; + } + switch(Col){ + case 0: // Code + if( mp != NULL ) strcpy(bf, mp->Code); + break; + case 1: // QTH + if( mp != NULL ) strcpy(bf, mmcg.GetQTH(mp)); + break; + case 2: // Key + if( mp != NULL ) strcpy(bf, mp->Key); + break; + } + Grid->Canvas->TextOut(X, Y, bf); + } + else { // ƒ^ƒCƒgƒ‹ + LPCSTR _tt[]={ + "Code","QTH","Key", + }; + Grid->Canvas->TextOut(X, Y, _tt[Col]); + } + +} +//--------------------------------------------------------------------------- +void __fastcall TMmcgDlgBox::EditYomiChange(TObject *Sender) +{ + if( m_DisEvent ) return; + + char bf[256]; + + strcpy(bf, AnsiString(EditYomi->Text).c_str()); + mmcg.Find(bf); + UpdateCaption(); + Grid->RowCount = mmcg.m_FindCnt ? mmcg.m_FindCnt + 1 : 2; + Grid->Invalidate(); +} +//--------------------------------------------------------------------------- +void __fastcall TMmcgDlgBox::EditYomiKeyPress(TObject *Sender, char &Key) +{ + if( Key == 0x20 ){ + EditYomi->Text = ""; + Key = 0; + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmcgDlgBox::EditYomiKeyDown(TObject *Sender, WORD &Key, + TShiftState Shift) +{ + switch(Key){ + case VK_UP: + if( Grid->Row >= 2 ) Grid->Row--; + Key = 0; + break; + case VK_DOWN: + if( Grid->Row < Grid->RowCount - 1 ) Grid->Row++; + Key = 0; + break; + case VK_HOME: + Grid->Row = 1; + Key = 0; + break; + case VK_END: + Grid->Row = Grid->RowCount - 1; + Key = 0; + break; + case VK_F1: + SBInc->Down = SBInc->Down ? 0 : 1; + SBIncClick(NULL); + Key = 0; + break; + case VK_F2: + SBMask->Down = SBMask->Down ? 0 : 1; + SBMaskClick(NULL); + Key = 0; + break; + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmcgDlgBox::EditYomiKeyUp(TObject *Sender, WORD &Key, + TShiftState Shift) +{ + switch(Key){ + case VK_UP: + Key = 0; + break; + case VK_DOWN: + Key = 0; + break; + case VK_HOME: + Key = 0; + break; + case VK_END: + Key = 0; + break; + case VK_F1: + Key = 0; + break; + case VK_F2: + Key = 0; + break; + } +} +//--------------------------------------------------------------------------- +void __fastcall TMmcgDlgBox::SBMaskClick(TObject *Sender) +{ + if( SBMask->Down ){ + mmcg.SetMask(); + } + else { + mmcg.m_mask = -1; + } + EditYomiChange(NULL); +} +//--------------------------------------------------------------------------- +void __fastcall TMmcgDlgBox::SBIncClick(TObject *Sender) +{ + if( SBInc->Down ){ + mmcg.m_sinc = 1; + } + else { + mmcg.m_sinc = 0; + } + EditYomiChange(NULL); +} +//--------------------------------------------------------------------------- diff --git a/MmcgDlg.dfm b/MmcgDlg.dfm new file mode 100644 index 0000000..ef39597 Binary files /dev/null and b/MmcgDlg.dfm differ diff --git a/MmcgDlg.h b/MmcgDlg.h new file mode 100644 index 0000000..d9e197f --- /dev/null +++ b/MmcgDlg.h @@ -0,0 +1,78 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//---------------------------------------------------------------------------- +#ifndef MmcgDlgH +#define MmcgDlgH +//---------------------------------------------------------------------------- +/* JA7UDE 0428 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +*/ +//---------------------------------------------------------------------------- +#include "Mmcg.h" +#include +#include +#include +#include +#include +//---------------------------------------------------------------------------- +class TMmcgDlgBox : public TForm +{ +__published: + TButton *OKBtn; + TButton *CancelBtn; + TStringGrid *Grid; + TEdit *EditYomi; + TSpeedButton *SBMask; + TSpeedButton *SBInc; + void __fastcall GridDrawCell(TObject *Sender, int Col, int Row, TRect &Rect, + TGridDrawState State); + void __fastcall EditYomiChange(TObject *Sender); + + + + + void __fastcall EditYomiKeyDown(TObject *Sender, WORD &Key, TShiftState Shift); + void __fastcall EditYomiKeyUp(TObject *Sender, WORD &Key, TShiftState Shift); + void __fastcall SBMaskClick(TObject *Sender); + void __fastcall SBIncClick(TObject *Sender); + void __fastcall EditYomiKeyPress(TObject *Sender, char &Key); +private: + int m_DisEvent; + + void __fastcall UpdateCaption(void); +public: + virtual __fastcall TMmcgDlgBox(TComponent* AOwner); + + int __fastcall Execute(AnsiString &call, AnsiString &qth, AnsiString &op); +}; +//---------------------------------------------------------------------------- +//extern TMmcgDlgBox *MmcgDlgBox; +//---------------------------------------------------------------------------- +#endif diff --git a/Mmtty English.ini b/Mmtty English.ini new file mode 100644 index 0000000..e695946 --- /dev/null +++ b/Mmtty English.ini @@ -0,0 +1,802 @@ +[SoundCard] +SampFreq=1.102500e+04 +TxOffset=0.000000e+00 + +[ComboList] +Mark=2125,2000,1700,1445,1275,1170,1000,915 +Shift=23,85,160,170,182,200,240,350,425,850 +Baud=22,45,45.45,50,56,75,100,110,150,200,300 +RST=599,579,569,559,449,339,448,337,225,111 +IIRBW=15,20,25,30,35,40,45,50,60,70,80,90,100,150,200 +VCO=1.0,1.2,1.5,2.0,2.5,3.0,3.25,3.5,3.75,4.0,4.5,5.0,8.0 +LoopFC=30,40,50,80,100,150,200,250,300,350,400,450,500,600,800,1000 + +[Grid] +Log= +QSO= + +[Help] +HTML= +MMTTY=Mmtty.txt +MMTTYLOG=Mmttylog.txt +DIGITAL=Digital.txt +FontName=Arial +FontCharset=0 +FontSize=10 +UseNotePad=0 + +[Window] +WindowState=0 +ShowMacro=1 +MemoryWindow=0 +Disable=0 +StayOnTop=0 + +[WindowFont] +Name=Arial +Charset=0 +Style=0 +Adjust=0 + +[ButtonFont] +Name=Arial +Charset=0 +Style=0 +Adjust=0 + +[Font] +Name=Arial +Size=10 +AdjX=0 +AdjY=0 +Charset=0 +Zero=1 +Style=0 + +[Define] +ControlPanel=1 +FFT=1 +FFTFW=0 +FFTGain=1 +FFTResp=2 +UOS=1 +CodeSet=0 +XYScope=0 +XYScopeSize=0 +XYScopeReverse=0 +XYQuality=0 +PanelSize=2 +AFC=0 +AFCFixShift=1 +AFCSQ=32 +AFCTime=8.000000e+00 +AFCSweep=1.000000e+00 +AutoCR=1 +WardWarp=1 +SendWay=0 +Running=0 +PttTimer=60 +TxNet=0 +TxDisRev=0 +LimitDxGain=2.000000e+02 +LimitOverSampling=0 +LimitAGC=1 +ATC=0 +ATCTime=4 +Majority=1 +IgnoreFreamError=1 +SQ=1 +SQLevel=6.000000e+02 +DefFix45=1 +DefMarkFreq=2.125000e+03 +DefShift=1.700000e+02 +DefStopLen=0 +OutputGain=2.457600e+04 +Rev=0 +SpaceFreq=2.295000e+03 +MarkFreq=2.125000e+03 +VERFFTDEM=1 +DEMTYPE=1 +BaudRate=4.545000e+01 +SmoozType=0 +SmoozOrder=5 +SmoozIIR=4.500000e+01 +Smooz=3.000000e+02 +FFTTones=4 +SoundRxFifo=12 +SoundTxFifo=4 +SoundPriority=1 +SoundDevice=2 +SoundOutDevice=5 +SoundStereo=0 +SoundMMW= +Tap=512 +IIRBW=60 +Diddle=2 +TxPort=0 +TxdJob=0 +TxFixShift=0 +PTT=NONE +InvPTT=0 +TXUOS=1 +MacroImm=0 +CharLenFile=1024 +DisTX=0 +TXLoop=1 +TXBPF=1 +TXBPFTAP=48 +TXLPF=0 +TXLPFFreq=1.000000e+02 +TXWaitType=0 +TXCharWait=0 +TXDiddleWait=0 +TXCharWaitDiddle=0 +TXRandomDiddle=0 +TXWaitTimerDiddle=0 +RXBPF=0 +RXBPFTAP=64 +RXBPFAFC=1 +RXBPFFW=2.500000e+02 +RXlms=0 +RXlmsDelay=24 +RXlmsMU2=1.000000e-03 +RXlmsGM=9.998000e-01 +RXlmsInv=0 +RXlmsAGC=1 +RXlmsTAP=512 +RXNotchTAP=192 +RXlmsBPF=0 +RXlmsType=1 +RXlmsNotch=2210 +RXlmsNotch2=0 +RXlmsTwoNotch=0 +pllVcoGain=3.000000e+00 +pllLoopOrder=2 +pllLoopFC=2.500000e+02 +pllOutOrder=4 +pllOutFC=2.000000e+02 +Call=JA7UDE + +[Button] +Hint=1 + +[Log] +Switch=0 +TimeStamp=1 +TimeStampUTC=0 +AutoUTCOffset=0 +UTCOffset=0 +UTCOffsetMin=0 +LogLink=1 +LinkPoll=0 +LinkPTT=0 +PathName= +ShowTimeStamp=1 + +[MMLink] +Name= + +[Dir] +OutFile= +ExtLog= +RecSound= + +[LogFile] +Name= + +[WaterFall] +Palette=0 + +[Input] +Height=97 + +[Color] +RXBack=16777215 +RXChar=0 +RXTXChar=0 +INBack=16777215 +INChar=0 +INTXChar=255 +WaterLow=0 +WaterHigh=16777215 +XYScope=16777215 + +[SysKey] +S1=0 +S2=0 +S3=0 +S4=0 +S5=0 +S6=0 +S7=0 +S8=0 +S9=321 +S10=0 +S11=335 +S12=332 +S13=324 +S14=0 +S15=0 +S16=579 +S17=0 +S18=0 +S19=0 +S20=0 +S21=0 +S22=0 +S23=0 +S24=0 +S25=120 +S26=119 +S27=0 +S28=323 +S29=334 +S30=337 +S31=338 +S32=326 +S33=112 +S34=0 +S35=0 +S36=0 +S37=0 +S38=36 +S39=35 +S40=0 +S41=0 +S42=33 +S43=34 +S44=0 +S45=0 +S46=0 +S47=0 +S48=0 +S49=0 +S50=294 +S51=296 +S52=0 +S53=0 +S54=588 +S55=0 +S56=549 +S57=551 +S58=596 +S59=0 +S60=322 +S61=0 +S62=0 +S63=0 +S64=0 +S65=0 +S66=0 +S67=0 +S68=0 +S69=0 +S70=0 +S71=0 +S72=0 +S73=0 +S74=0 +S75=0 +S76=0 +S77=0 +S78=0 +S79=0 +S80=582 + +[InBtnCol] +M1=0 +M2=0 +M3=0 +M4=0 + +[InBtnKey] +M1=113 +M2=114 +M3=115 +M4=116 + +[InBtnName] +M1=1X1 +M2=DEAR +M3=ANS +M4=BTU + +[InBtn] +M1="%c DE %m" +M2="DEAR %n" +M3="__\r\nRGR %c DE %m ALL OK DEAR %n\r\n" +M4="BTU %c DE %m KN\r\n_\\" + +[MacroTimer] +M1=0 +M2=0 +M3=0 +M4=0 +M5=0 +M6=0 +M7=0 +M8=0 +M9=0 +M10=0 +M11=0 +M12=0 +M13=0 +M14=0 +M15=0 +M16=0 + +[MacroCol] +M1=0 +M2=0 +M3=0 +M4=0 +M5=0 +M6=0 +M7=0 +M8=0 +M9=0 +M10=0 +M11=0 +M12=0 +M13=0 +M14=0 +M15=0 +M16=0 + +[MacroKey] +M1=305 +M2=306 +M3=307 +M4=308 +M5=309 +M6=310 +M7=311 +M8=312 +M9=313 +M10=121 +M11=122 +M12=123 +M13=0 +M14=0 +M15=118 +M16=117 + +[MacroEditKey] +M1=0 +M2=0 +M3=0 +M4=0 +M5=0 +M6=0 +M7=0 +M8=0 +M9=0 +M10=0 +M11=0 +M12=0 +M13=0 +M14=0 +M15=0 +M16=0 + +[MacroName] +M1=1X2 +M2=2X3 +M3=DE3 +M4=UR599 +M5=QANS +M6=M6 +M7=M7 +M8=M8 +M9=SK +M10=EE +M11=M11 +M12=M12 +M13=RY +M14=M14 +M15=CQ2 +M16=CQ1 + +[Macro] +M1="__\r\n%c DE %m %m K\r\n_\\" +M2="__\r\n%c %c DE %m %m %m K\r\n_\\" +M3="__\r\nDE %m %m %m K\r\n_\\" +M4="__\r\nQSL UR 599-599 TU\r\n_\\" +M5="__\r\nOK TNX %n\r\nUR %r %r NAME MAKO %c DE %m TU SK\r\n_\\" +M6="" +M7="" +M8="" +M9="\\\r\n73 TU SK SK\r\n%{TU}\\" +M10="[__~~__~\\" +M11="" +M12="" +M13="\r\nRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRY#" +M14="" +M15="__\r\nRYRY CQ CQ CQ DE %m %m %m\r\nRYRY CQ CQ CQ DE %m %m %m PSE K\r\n_\\" +M16="__\r\nRYRY CQ CQ CQ DE %m %m %m PSE K\r\n_\\" + +[MsgKey] +M1=368 +M2=369 +M3=370 +M4=371 +M5=372 +M6=373 +M7=374 +M8=375 +M9=376 +M10=0 + +[MsgName] +M1=AF CALL1 +M2=FINAL3 +M3=FINAL2 +M4=FINAL +M5=AF CQ2 (GEAR) +M6=AF CQ1 +M7=AF CALL2 (GEAR) +M8=AF CALL1 (QUICK) +M9=FINAL (QUICK) +M10= + +[MsgList] +M1="\\__\r\nRGR %c DE %m %g DEAR %n\r\nTHANK YOU FOR THE NICE REPORT.\r\nYOU ARE %r %r %r IN OSAKA OSAKA OSAKA\r\nMY NAME IS MAKO MAKO MAKO\r\nHOW COPY? BTU %c DE %m KN\r\n_\\" +M2="\\__\\" +M3="\\__\r\nTNX AGAIN DEAR %n CU SK\r\n__\\" +M4="\\__\r\nOK DEAR %n\r\nMANY THANK YOU FOR THE NICE QSO.\r\nI AM LOOKING FORWARD TO SEE YOU AGAIN ON CW AND PSK31.\r\nCUL! AND BEST 73\r\n%c DE %m TU SK SK..\r\n__" +M5="\\__\r\nRGR %c DE %m ALL OK DEAR %n\r\nTHANK YOU FOR THE NICE REPORT.\r\n\r\nI AM RUNNING 50W 50W INTO A SMALL LOOP ANTENNA(ONLY 90CM DIA!)\r\n\r\nRTTY MODEM IS HOMEMADE SOFTWARE ON WINDOWS-95 SOUNDBLASTER.\r\n\r\nTHANK YOU FOR THE NICE QSO DEAR %n\r\nMY QSL IS OK VIA THE BURO.\r\n\r\nHOW? BTU %c DE %m KN\r\n_\\" +M6="\\__\r\n%c %c DE %m %g\r\nTHANK YOU FOR YOUR CALL. I AM GLAD TO SEE YOU ON RTTY.\r\nYOU ARE %r %r %r IN OSAKA OSAKA OSAKA\r\nMY NAME IS MAKO MAKO MAKO\r\nHOW COPY? BTU %c %c DE %m KN\r\n_\\" +M7="\\__\r\nRGR %c DE %m ALL OK DEAR %n\r\nTHANK YOU FOR THE NICE INFO.\r\n\r\nI AM RUNNING 50W 50W INTO A SMALL LOOP ANTENNA(ONLY 90CM DIA!)\r\n\r\nRTTY MODEM IS HOMEMADE SOFTWARE ON WINDOWS-95 SOUNDBLASTER.\r\n\r\nTHANK YOU FOR THE NICE QSO DEAR %n\r\nMY QSL IS OK VIA THE BURO.\r\n\r\nHOW? BTU %c DE %m KN\r\n_\\" +M8="\\__\r\nRGR TNX %n\r\nUR %r %r %r NAME IS MAKO MAKO MAKO\r\nHOW? BTU %c DE %m KN\r\n_\\" +M9="\\__\r\nOK DEAR %n\r\nTNX FB QSO, CUL BEST 73 %c DE %m TU SK..\r\n__\\" +M10= + +[ExtConv] +WDEF1=%YYYY-MM-DD +WLEN1=0 +WDEF2=%HHMM +WLEN2=0 +WDEF3=%EHHMM +WLEN3=0 +WDEF4=%CALL +WLEN4=0 +WDEF5=%HIS +WLEN5=0 +WDEF6=%MY +WLEN6=0 +WDEF7=%FREQ +WLEN7=0 +WDEF8=%MODE +WLEN8=0 +WDEF9=%POWER +WLEN9=0 +WDEF10=%NAME +WLEN10=0 +WDEF11=%QTH +WLEN11=0 +WDEF12=%REM +WLEN12=0 +WDEF13=%QSL +WLEN13=0 +WDEF14=%S +WLEN14=0 +WDEF15=%R +WLEN15=0 +WDEF16=%EOD +WLEN16=0 +WDEF17= +WLEN17=0 +WDEF18= +WLEN18=0 +WDEF19= +WLEN19=0 +WDEF20= +WLEN20=0 +WDEF21= +WLEN21=0 +WDEF22= +WLEN22=0 +WDEF23= +WLEN23=0 +WDEF24= +WLEN24=0 +WDEF25= +WLEN25=0 +WDEF26= +WLEN26=0 +WDEF27= +WLEN27=0 +WDEF28= +WLEN28=0 +WDEF29= +WLEN29=0 +WDEF30= +WLEN30=0 +WDEF31= +WLEN31=0 +WDEF32= +WLEN32=0 +WDEF33= +WLEN33=0 +WDEF34= +WLEN34=0 +WDEF35= +WLEN35=0 +WDEF36= +WLEN36=0 +WDEF37= +WLEN37=0 +WDEF38= +WLEN38=0 +WDEF39= +WLEN39=0 +WDEF40= +WLEN40=0 +WDEF41= +WLEN41=0 +WDEF42= +WLEN42=0 +WDEF43= +WLEN43=0 +WDEF44= +WLEN44=0 +WDEF45= +WLEN45=0 +WDEF46= +WLEN46=0 +WDEF47= +WLEN47=0 +WDEF48= +WLEN48=0 +WDEF49= +WLEN49=0 +WDEF50= +WLEN50=0 +WDEF51= +WLEN51=0 +WDEF52= +WLEN52=0 +WDEF53= +WLEN53=0 +WDEF54= +WLEN54=0 +WDEF55= +WLEN55=0 +WDEF56= +WLEN56=0 +WDEF57= +WLEN57=0 +WDEF58= +WLEN58=0 +WDEF59= +WLEN59=0 +WDEF60= +WLEN60=0 +WDEF61= +WLEN61=0 +WDEF62= +WLEN62=0 +WDEF63= +WLEN63=0 +WDEF64= +WLEN64=0 +RDEF1=%YYYY-MM-DD +RLEN1=0 +RDEF2=%HHMM +RLEN2=0 +RDEF3=%EHHMM +RLEN3=0 +RDEF4=%CALL +RLEN4=0 +RDEF5=%HIS +RLEN5=0 +RDEF6=%MY +RLEN6=0 +RDEF7=%FREQ +RLEN7=0 +RDEF8=%MODE +RLEN8=0 +RDEF9=%POWER +RLEN9=0 +RDEF10=%NAME +RLEN10=0 +RDEF11=%QTH +RLEN11=0 +RDEF12=%REM +RLEN12=0 +RDEF13=%QSL +RLEN13=0 +RDEF14=%S +RLEN14=0 +RDEF15=%R +RLEN15=0 +RDEF16=%EOD +RLEN16=0 +RDEF17= +RLEN17=0 +RDEF18= +RLEN18=0 +RDEF19= +RLEN19=0 +RDEF20= +RLEN20=0 +RDEF21= +RLEN21=0 +RDEF22= +RLEN22=0 +RDEF23= +RLEN23=0 +RDEF24= +RLEN24=0 +RDEF25= +RLEN25=0 +RDEF26= +RLEN26=0 +RDEF27= +RLEN27=0 +RDEF28= +RLEN28=0 +RDEF29= +RLEN29=0 +RDEF30= +RLEN30=0 +RDEF31= +RLEN31=0 +RDEF32= +RLEN32=0 +RDEF33= +RLEN33=0 +RDEF34= +RLEN34=0 +RDEF35= +RLEN35=0 +RDEF36= +RLEN36=0 +RDEF37= +RLEN37=0 +RDEF38= +RLEN38=0 +RDEF39= +RLEN39=0 +RDEF40= +RLEN40=0 +RDEF41= +RLEN41=0 +RDEF42= +RLEN42=0 +RDEF43= +RLEN43=0 +RDEF44= +RLEN44=0 +RDEF45= +RLEN45=0 +RDEF46= +RLEN46=0 +RDEF47= +RLEN47=0 +RDEF48= +RLEN48=0 +RDEF49= +RLEN49=0 +RDEF50= +RLEN50=0 +RDEF51= +RLEN51=0 +RDEF52= +RLEN52=0 +RDEF53= +RLEN53=0 +RDEF54= +RLEN54=0 +RDEF55= +RLEN55=0 +RDEF56= +RLEN56=0 +RDEF57= +RLEN57=0 +RDEF58= +RLEN58=0 +RDEF59= +RLEN59=0 +RDEF60= +RLEN60=0 +RDEF61= +RLEN61=0 +RDEF62= +RLEN62=0 +RDEF63= +RLEN63=0 +RDEF64= +RLEN64=0 + +[LogSet] +TimeZone=73 +DateType=0 +UpperName=0 +UpperQTH=0 +UpperREM=0 +UpperQSL=0 +DefMyRST=0 +Contest=0 +CopyFreq=0 +CopyHis=0 +CopyName=1 +CopyQTH=1 +CopyREM=0 +CopyQSL=1 +CopyREMB4=0 +CheckBand=1 +AutoSave=1 +QSOMacroFlag=0 +QSOMacro1=1 +QSOMacroKey1=0 +QSOMacroStr1="\r\n %c %c UR %R-%N-%N BK\r\n\\" +QSOMacro2=1 +QSOMacroKey2=0 +QSOMacroStr2="\r\nQSL TU QRZ? DE %m %m K\r\n\\" +QSOMacro3=1 +QSOMacroKey3=0 +QSOMacroStr3="\r\n %c SRI QSO B4 QRZ? DE %m %m K\r\n\\" +QSOMacro4=0 +QSOMacroKey4=0 +QSOMacroStr4="\r\nDE %m %m K\r\n\\" +QSOMacro5=0 +QSOMacroKey5=0 +QSOMacroStr5="\r\n %c %R-%N-%N TU\r\n\\" +THRTTY=RTY +THSSTV=STV +THTZ=0 +ClipRSTADIF=1 +Backup=1 +TH5Fields=3,3,7,4,12,28,54 + +[Program] +Name1=&G3PLX PSK31SBW +Command1= +Name2=&IZ8BLY Hellschreiber +Command2= +Name3=&External 3 +Command3= +Name4=E&xternal 4 +Command4= + +[TNC] +PortName=NONE +Type=0 +BaudRate=1200 +BitLen=1 +Stop=0 +Parity=0 +flwXON=1 +flwCTS=0 +Echo=2 + +[RADIO] +PortName=NONE +BaudRate=4800 +BitLen=1 +Stop=1 +Parity=0 +flwXON=0 +flwCTS=0 +usePTT=0 +ByteWait=0 +Cmdxx=0 +CmdInit= +CmdRx=\$000000000F +CmdTx=\$000000010F\w10 +FileGNR= +OpenGNR=0 +PollType=0 +PollInterval=5 +PollOffset=0 + +[AA6YQ] +Version=2 +Enabled=1 +TapsBPF=512 +WidthBPF=3.500000e+01 +TapsBEF=256 +WidthBEF=1.500000e+01 +afcERR=5.000000e+00 + diff --git a/Mmtty Japanese.ini b/Mmtty Japanese.ini new file mode 100644 index 0000000..2fe58fa --- /dev/null +++ b/Mmtty Japanese.ini @@ -0,0 +1,802 @@ +[SoundCard] +SampFreq=1.102500e+04 +TxOffset=0.000000e+00 + +[ComboList] +Mark=2125,2000,1700,1445,1275,1170,1000,915 +Shift=23,85,160,170,182,200,240,350,425,850 +Baud=22,45,45.45,50,56,75,100,110,150,200,300 +RST=599,579,569,559,449,339,448,337,225,111 +IIRBW=15,20,25,30,35,40,45,50,60,70,80,90,100,150,200 +VCO=1.0,1.2,1.5,2.0,2.5,3.0,3.25,3.5,3.75,4.0,4.5,5.0,8.0 +LoopFC=30,40,50,80,100,150,200,250,300,350,400,450,500,600,800,1000 + +[Grid] +Log= +QSO= + +[Help] +HTML= +MMTTY=Mmtty.txt +MMTTYLOG=Mmttylog.txt +DIGITAL=Digital.txt +FontName=‚l‚r ƒSƒVƒbƒN +FontCharset=128 +FontSize=10 +UseNotePad=0 + +[Window] +WindowState=0 +ShowMacro=1 +MemoryWindow=0 +Disable=0 +StayOnTop=0 + +[WindowFont] +Name=‚l‚r ‚oƒSƒVƒbƒN +Charset=128 +Style=0 +Adjust=0 + +[ButtonFont] +Name=‚l‚r ƒSƒVƒbƒN +Charset=128 +Style=0 +Adjust=0 + +[Font] +Name=‚l‚r ƒSƒVƒbƒN +Size=10 +AdjX=0 +AdjY=0 +Charset=128 +Zero=1 +Style=0 + +[Define] +ControlPanel=1 +FFT=1 +FFTFW=0 +FFTGain=1 +FFTResp=2 +UOS=1 +CodeSet=0 +XYScope=0 +XYScopeSize=0 +XYScopeReverse=0 +XYQuality=0 +PanelSize=2 +AFC=0 +AFCFixShift=1 +AFCSQ=32 +AFCTime=8.000000e+00 +AFCSweep=1.000000e+00 +AutoCR=1 +WardWarp=1 +SendWay=0 +Running=0 +PttTimer=60 +TxNet=0 +TxDisRev=0 +LimitDxGain=2.000000e+02 +LimitOverSampling=0 +LimitAGC=1 +ATC=0 +ATCTime=4 +Majority=1 +IgnoreFreamError=1 +SQ=1 +SQLevel=6.000000e+02 +DefFix45=1 +DefMarkFreq=2.125000e+03 +DefShift=1.700000e+02 +DefStopLen=0 +OutputGain=2.457600e+04 +Rev=0 +SpaceFreq=2.295000e+03 +MarkFreq=2.125000e+03 +VERFFTDEM=1 +DEMTYPE=1 +BaudRate=4.545000e+01 +SmoozType=0 +SmoozOrder=5 +SmoozIIR=4.500000e+01 +Smooz=3.000000e+02 +FFTTones=4 +SoundRxFifo=12 +SoundTxFifo=4 +SoundPriority=1 +SoundDevice=2 +SoundOutDevice=5 +SoundStereo=0 +SoundMMW= +Tap=512 +IIRBW=60 +Diddle=2 +TxPort=0 +TxdJob=0 +TxFixShift=0 +PTT=NONE +InvPTT=0 +TXUOS=1 +MacroImm=0 +CharLenFile=1024 +DisTX=0 +TXLoop=1 +TXBPF=1 +TXBPFTAP=48 +TXLPF=0 +TXLPFFreq=1.000000e+02 +TXWaitType=0 +TXCharWait=0 +TXDiddleWait=0 +TXCharWaitDiddle=0 +TXRandomDiddle=0 +TXWaitTimerDiddle=0 +RXBPF=0 +RXBPFTAP=64 +RXBPFAFC=1 +RXBPFFW=2.500000e+02 +RXlms=0 +RXlmsDelay=24 +RXlmsMU2=1.000000e-03 +RXlmsGM=9.998000e-01 +RXlmsInv=0 +RXlmsAGC=1 +RXlmsTAP=512 +RXNotchTAP=192 +RXlmsBPF=0 +RXlmsType=1 +RXlmsNotch=2210 +RXlmsNotch2=0 +RXlmsTwoNotch=0 +pllVcoGain=3.000000e+00 +pllLoopOrder=2 +pllLoopFC=2.500000e+02 +pllOutOrder=4 +pllOutFC=2.000000e+02 +Call=JA7UDE + +[Button] +Hint=1 + +[Log] +Switch=0 +TimeStamp=1 +TimeStampUTC=0 +AutoUTCOffset=0 +UTCOffset=0 +UTCOffsetMin=0 +LogLink=1 +LinkPoll=0 +LinkPTT=0 +PathName=D:\MyProjects\amprog\MMTTY_XE4\.\ +ShowTimeStamp=1 + +[MMLink] +Name= + +[Dir] +OutFile=D:\MyProjects\amprog\MMTTY_XE4\.\ +ExtLog=D:\MyProjects\amprog\MMTTY_XE4\.\ +RecSound=D:\MyProjects\amprog\MMTTY_XE4\.\ + +[LogFile] +Name=D:\MyProjects\amprog\MMTTY_XE4\.MDT + +[WaterFall] +Palette=0 + +[Input] +Height=97 + +[Color] +RXBack=16777215 +RXChar=0 +RXTXChar=0 +INBack=16777215 +INChar=0 +INTXChar=255 +WaterLow=0 +WaterHigh=16777215 +XYScope=16777215 + +[SysKey] +S1=0 +S2=0 +S3=0 +S4=0 +S5=0 +S6=0 +S7=0 +S8=0 +S9=321 +S10=0 +S11=335 +S12=332 +S13=324 +S14=0 +S15=0 +S16=579 +S17=0 +S18=0 +S19=0 +S20=0 +S21=0 +S22=0 +S23=0 +S24=0 +S25=120 +S26=119 +S27=0 +S28=323 +S29=334 +S30=337 +S31=338 +S32=326 +S33=112 +S34=0 +S35=0 +S36=0 +S37=0 +S38=36 +S39=35 +S40=0 +S41=0 +S42=33 +S43=34 +S44=0 +S45=0 +S46=0 +S47=0 +S48=0 +S49=0 +S50=294 +S51=296 +S52=0 +S53=0 +S54=588 +S55=0 +S56=549 +S57=551 +S58=596 +S59=0 +S60=322 +S61=0 +S62=0 +S63=0 +S64=0 +S65=0 +S66=0 +S67=0 +S68=0 +S69=0 +S70=0 +S71=0 +S72=0 +S73=0 +S74=0 +S75=0 +S76=0 +S77=0 +S78=0 +S79=0 +S80=582 + +[InBtnCol] +M1=0 +M2=0 +M3=0 +M4=0 + +[InBtnKey] +M1=113 +M2=114 +M3=115 +M4=116 + +[InBtnName] +M1=1X1 +M2=DEAR +M3=ANS +M4=BTU + +[InBtn] +M1="%c DE %m" +M2="DEAR %n" +M3="__\r\nRGR %c DE %m ALL OK DEAR %n\r\n" +M4="BTU %c DE %m KN\r\n_\\" + +[MacroTimer] +M1=0 +M2=0 +M3=0 +M4=0 +M5=0 +M6=0 +M7=0 +M8=0 +M9=0 +M10=0 +M11=0 +M12=0 +M13=0 +M14=0 +M15=0 +M16=0 + +[MacroCol] +M1=0 +M2=0 +M3=0 +M4=0 +M5=0 +M6=0 +M7=0 +M8=0 +M9=0 +M10=0 +M11=0 +M12=0 +M13=0 +M14=0 +M15=0 +M16=0 + +[MacroKey] +M1=305 +M2=306 +M3=307 +M4=308 +M5=309 +M6=310 +M7=311 +M8=312 +M9=313 +M10=121 +M11=122 +M12=123 +M13=0 +M14=0 +M15=118 +M16=117 + +[MacroEditKey] +M1=0 +M2=0 +M3=0 +M4=0 +M5=0 +M6=0 +M7=0 +M8=0 +M9=0 +M10=0 +M11=0 +M12=0 +M13=0 +M14=0 +M15=0 +M16=0 + +[MacroName] +M1=1X2 +M2=2X3 +M3=DE3 +M4=UR599 +M5=QANS +M6=M6 +M7=M7 +M8=M8 +M9=SK +M10=EE +M11=M11 +M12=M12 +M13=RY +M14=M14 +M15=CQ2 +M16=CQ1 + +[Macro] +M1="__\r\n%c DE %m %m K\r\n_\\" +M2="__\r\n%c %c DE %m %m %m K\r\n_\\" +M3="__\r\nDE %m %m %m K\r\n_\\" +M4="__\r\nQSL UR 599-599 TU\r\n_\\" +M5="__\r\nOK TNX %n\r\nUR %r %r NAME MAKO %c DE %m TU SK\r\n_\\" +M6="" +M7="" +M8="" +M9="\\\r\n73 TU SK SK\r\n%{TU}\\" +M10="[__~~__~\\" +M11="" +M12="" +M13="\r\nRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRY#" +M14="" +M15="__\r\nRYRY CQ CQ CQ DE %m %m %m\r\nRYRY CQ CQ CQ DE %m %m %m PSE K\r\n_\\" +M16="__\r\nRYRY CQ CQ CQ DE %m %m %m PSE K\r\n_\\" + +[MsgKey] +M1=368 +M2=369 +M3=370 +M4=371 +M5=372 +M6=373 +M7=374 +M8=375 +M9=376 +M10=0 + +[MsgName] +M1=AF CALL1 +M2=FINAL3 +M3=FINAL2 +M4=FINAL +M5=AF CQ2 (GEAR) +M6=AF CQ1 +M7=AF CALL2 (GEAR) +M8=AF CALL1 (QUICK) +M9=FINAL (QUICK) +M10= + +[MsgList] +M1="\\__\r\nRGR %c DE %m %g DEAR %n\r\nTHANK YOU FOR THE NICE REPORT.\r\nYOU ARE %r %r %r IN OSAKA OSAKA OSAKA\r\nMY NAME IS MAKO MAKO MAKO\r\nHOW COPY? BTU %c DE %m KN\r\n_\\" +M2="\\__\\" +M3="\\__\r\nTNX AGAIN DEAR %n CU SK\r\n__\\" +M4="\\__\r\nOK DEAR %n\r\nMANY THANK YOU FOR THE NICE QSO.\r\nI AM LOOKING FORWARD TO SEE YOU AGAIN ON CW AND PSK31.\r\nCUL! AND BEST 73\r\n%c DE %m TU SK SK..\r\n__" +M5="\\__\r\nRGR %c DE %m ALL OK DEAR %n\r\nTHANK YOU FOR THE NICE REPORT.\r\n\r\nI AM RUNNING 50W 50W INTO A SMALL LOOP ANTENNA(ONLY 90CM DIA!)\r\n\r\nRTTY MODEM IS HOMEMADE SOFTWARE ON WINDOWS-95 SOUNDBLASTER.\r\n\r\nTHANK YOU FOR THE NICE QSO DEAR %n\r\nMY QSL IS OK VIA THE BURO.\r\n\r\nHOW? BTU %c DE %m KN\r\n_\\" +M6="\\__\r\n%c %c DE %m %g\r\nTHANK YOU FOR YOUR CALL. I AM GLAD TO SEE YOU ON RTTY.\r\nYOU ARE %r %r %r IN OSAKA OSAKA OSAKA\r\nMY NAME IS MAKO MAKO MAKO\r\nHOW COPY? BTU %c %c DE %m KN\r\n_\\" +M7="\\__\r\nRGR %c DE %m ALL OK DEAR %n\r\nTHANK YOU FOR THE NICE INFO.\r\n\r\nI AM RUNNING 50W 50W INTO A SMALL LOOP ANTENNA(ONLY 90CM DIA!)\r\n\r\nRTTY MODEM IS HOMEMADE SOFTWARE ON WINDOWS-95 SOUNDBLASTER.\r\n\r\nTHANK YOU FOR THE NICE QSO DEAR %n\r\nMY QSL IS OK VIA THE BURO.\r\n\r\nHOW? BTU %c DE %m KN\r\n_\\" +M8="\\__\r\nRGR TNX %n\r\nUR %r %r %r NAME IS MAKO MAKO MAKO\r\nHOW? BTU %c DE %m KN\r\n_\\" +M9="\\__\r\nOK DEAR %n\r\nTNX FB QSO, CUL BEST 73 %c DE %m TU SK..\r\n__\\" +M10= + +[ExtConv] +WDEF1=%YYYY-MM-DD +WLEN1=0 +WDEF2=%HHMM +WLEN2=0 +WDEF3=%EHHMM +WLEN3=0 +WDEF4=%CALL +WLEN4=0 +WDEF5=%HIS +WLEN5=0 +WDEF6=%MY +WLEN6=0 +WDEF7=%FREQ +WLEN7=0 +WDEF8=%MODE +WLEN8=0 +WDEF9=%POWER +WLEN9=0 +WDEF10=%NAME +WLEN10=0 +WDEF11=%QTH +WLEN11=0 +WDEF12=%REM +WLEN12=0 +WDEF13=%QSL +WLEN13=0 +WDEF14=%S +WLEN14=0 +WDEF15=%R +WLEN15=0 +WDEF16=%EOD +WLEN16=0 +WDEF17= +WLEN17=0 +WDEF18= +WLEN18=0 +WDEF19= +WLEN19=0 +WDEF20= +WLEN20=0 +WDEF21= +WLEN21=0 +WDEF22= +WLEN22=0 +WDEF23= +WLEN23=0 +WDEF24= +WLEN24=0 +WDEF25= +WLEN25=0 +WDEF26= +WLEN26=0 +WDEF27= +WLEN27=0 +WDEF28= +WLEN28=0 +WDEF29= +WLEN29=0 +WDEF30= +WLEN30=0 +WDEF31= +WLEN31=0 +WDEF32= +WLEN32=0 +WDEF33= +WLEN33=0 +WDEF34= +WLEN34=0 +WDEF35= +WLEN35=0 +WDEF36= +WLEN36=0 +WDEF37= +WLEN37=0 +WDEF38= +WLEN38=0 +WDEF39= +WLEN39=0 +WDEF40= +WLEN40=0 +WDEF41= +WLEN41=0 +WDEF42= +WLEN42=0 +WDEF43= +WLEN43=0 +WDEF44= +WLEN44=0 +WDEF45= +WLEN45=0 +WDEF46= +WLEN46=0 +WDEF47= +WLEN47=0 +WDEF48= +WLEN48=0 +WDEF49= +WLEN49=0 +WDEF50= +WLEN50=0 +WDEF51= +WLEN51=0 +WDEF52= +WLEN52=0 +WDEF53= +WLEN53=0 +WDEF54= +WLEN54=0 +WDEF55= +WLEN55=0 +WDEF56= +WLEN56=0 +WDEF57= +WLEN57=0 +WDEF58= +WLEN58=0 +WDEF59= +WLEN59=0 +WDEF60= +WLEN60=0 +WDEF61= +WLEN61=0 +WDEF62= +WLEN62=0 +WDEF63= +WLEN63=0 +WDEF64= +WLEN64=0 +RDEF1=%YYYY-MM-DD +RLEN1=0 +RDEF2=%HHMM +RLEN2=0 +RDEF3=%EHHMM +RLEN3=0 +RDEF4=%CALL +RLEN4=0 +RDEF5=%HIS +RLEN5=0 +RDEF6=%MY +RLEN6=0 +RDEF7=%FREQ +RLEN7=0 +RDEF8=%MODE +RLEN8=0 +RDEF9=%POWER +RLEN9=0 +RDEF10=%NAME +RLEN10=0 +RDEF11=%QTH +RLEN11=0 +RDEF12=%REM +RLEN12=0 +RDEF13=%QSL +RLEN13=0 +RDEF14=%S +RLEN14=0 +RDEF15=%R +RLEN15=0 +RDEF16=%EOD +RLEN16=0 +RDEF17= +RLEN17=0 +RDEF18= +RLEN18=0 +RDEF19= +RLEN19=0 +RDEF20= +RLEN20=0 +RDEF21= +RLEN21=0 +RDEF22= +RLEN22=0 +RDEF23= +RLEN23=0 +RDEF24= +RLEN24=0 +RDEF25= +RLEN25=0 +RDEF26= +RLEN26=0 +RDEF27= +RLEN27=0 +RDEF28= +RLEN28=0 +RDEF29= +RLEN29=0 +RDEF30= +RLEN30=0 +RDEF31= +RLEN31=0 +RDEF32= +RLEN32=0 +RDEF33= +RLEN33=0 +RDEF34= +RLEN34=0 +RDEF35= +RLEN35=0 +RDEF36= +RLEN36=0 +RDEF37= +RLEN37=0 +RDEF38= +RLEN38=0 +RDEF39= +RLEN39=0 +RDEF40= +RLEN40=0 +RDEF41= +RLEN41=0 +RDEF42= +RLEN42=0 +RDEF43= +RLEN43=0 +RDEF44= +RLEN44=0 +RDEF45= +RLEN45=0 +RDEF46= +RLEN46=0 +RDEF47= +RLEN47=0 +RDEF48= +RLEN48=0 +RDEF49= +RLEN49=0 +RDEF50= +RLEN50=0 +RDEF51= +RLEN51=0 +RDEF52= +RLEN52=0 +RDEF53= +RLEN53=0 +RDEF54= +RLEN54=0 +RDEF55= +RLEN55=0 +RDEF56= +RLEN56=0 +RDEF57= +RLEN57=0 +RDEF58= +RLEN58=0 +RDEF59= +RLEN59=0 +RDEF60= +RLEN60=0 +RDEF61= +RLEN61=0 +RDEF62= +RLEN62=0 +RDEF63= +RLEN63=0 +RDEF64= +RLEN64=0 + +[LogSet] +TimeZone=73 +DateType=0 +UpperName=0 +UpperQTH=0 +UpperREM=0 +UpperQSL=0 +DefMyRST=0 +Contest=0 +CopyFreq=0 +CopyHis=0 +CopyName=1 +CopyQTH=1 +CopyREM=0 +CopyQSL=1 +CopyREMB4=0 +CheckBand=1 +AutoSave=1 +QSOMacroFlag=0 +QSOMacro1=1 +QSOMacroKey1=0 +QSOMacroStr1="\r\n %c %c UR %R-%N-%N BK\r\n\\" +QSOMacro2=1 +QSOMacroKey2=0 +QSOMacroStr2="\r\nQSL TU QRZ? DE %m %m K\r\n\\" +QSOMacro3=1 +QSOMacroKey3=0 +QSOMacroStr3="\r\n %c SRI QSO B4 QRZ? DE %m %m K\r\n\\" +QSOMacro4=0 +QSOMacroKey4=0 +QSOMacroStr4="\r\nDE %m %m K\r\n\\" +QSOMacro5=0 +QSOMacroKey5=0 +QSOMacroStr5="\r\n %c %R-%N-%N TU\r\n\\" +THRTTY=RTY +THSSTV=STV +THTZ=0 +ClipRSTADIF=1 +Backup=1 +TH5Fields=3,3,7,4,12,28,54 + +[Program] +Name1=&G3PLX PSK31SBW +Command1= +Name2=&IZ8BLY Hellschreiber +Command2= +Name3=&External 3 +Command3= +Name4=E&xternal 4 +Command4= + +[TNC] +PortName=NONE +Type=0 +BaudRate=1200 +BitLen=1 +Stop=0 +Parity=0 +flwXON=1 +flwCTS=0 +Echo=2 + +[RADIO] +PortName=NONE +BaudRate=4800 +BitLen=1 +Stop=1 +Parity=0 +flwXON=0 +flwCTS=0 +usePTT=0 +ByteWait=0 +Cmdxx=0 +CmdInit= +CmdRx=\$000000000F +CmdTx=\$000000010F\w10 +FileGNR= +OpenGNR=0 +PollType=0 +PollInterval=5 +PollOffset=0 + +[AA6YQ] +Version=2 +Enabled=1 +TapsBPF=512 +WidthBPF=3.500000e+01 +TapsBEF=256 +WidthBEF=1.500000e+01 +afcERR=5.000000e+00 + diff --git a/Mmtty.ini b/Mmtty.ini new file mode 100644 index 0000000..e695946 --- /dev/null +++ b/Mmtty.ini @@ -0,0 +1,802 @@ +[SoundCard] +SampFreq=1.102500e+04 +TxOffset=0.000000e+00 + +[ComboList] +Mark=2125,2000,1700,1445,1275,1170,1000,915 +Shift=23,85,160,170,182,200,240,350,425,850 +Baud=22,45,45.45,50,56,75,100,110,150,200,300 +RST=599,579,569,559,449,339,448,337,225,111 +IIRBW=15,20,25,30,35,40,45,50,60,70,80,90,100,150,200 +VCO=1.0,1.2,1.5,2.0,2.5,3.0,3.25,3.5,3.75,4.0,4.5,5.0,8.0 +LoopFC=30,40,50,80,100,150,200,250,300,350,400,450,500,600,800,1000 + +[Grid] +Log= +QSO= + +[Help] +HTML= +MMTTY=Mmtty.txt +MMTTYLOG=Mmttylog.txt +DIGITAL=Digital.txt +FontName=Arial +FontCharset=0 +FontSize=10 +UseNotePad=0 + +[Window] +WindowState=0 +ShowMacro=1 +MemoryWindow=0 +Disable=0 +StayOnTop=0 + +[WindowFont] +Name=Arial +Charset=0 +Style=0 +Adjust=0 + +[ButtonFont] +Name=Arial +Charset=0 +Style=0 +Adjust=0 + +[Font] +Name=Arial +Size=10 +AdjX=0 +AdjY=0 +Charset=0 +Zero=1 +Style=0 + +[Define] +ControlPanel=1 +FFT=1 +FFTFW=0 +FFTGain=1 +FFTResp=2 +UOS=1 +CodeSet=0 +XYScope=0 +XYScopeSize=0 +XYScopeReverse=0 +XYQuality=0 +PanelSize=2 +AFC=0 +AFCFixShift=1 +AFCSQ=32 +AFCTime=8.000000e+00 +AFCSweep=1.000000e+00 +AutoCR=1 +WardWarp=1 +SendWay=0 +Running=0 +PttTimer=60 +TxNet=0 +TxDisRev=0 +LimitDxGain=2.000000e+02 +LimitOverSampling=0 +LimitAGC=1 +ATC=0 +ATCTime=4 +Majority=1 +IgnoreFreamError=1 +SQ=1 +SQLevel=6.000000e+02 +DefFix45=1 +DefMarkFreq=2.125000e+03 +DefShift=1.700000e+02 +DefStopLen=0 +OutputGain=2.457600e+04 +Rev=0 +SpaceFreq=2.295000e+03 +MarkFreq=2.125000e+03 +VERFFTDEM=1 +DEMTYPE=1 +BaudRate=4.545000e+01 +SmoozType=0 +SmoozOrder=5 +SmoozIIR=4.500000e+01 +Smooz=3.000000e+02 +FFTTones=4 +SoundRxFifo=12 +SoundTxFifo=4 +SoundPriority=1 +SoundDevice=2 +SoundOutDevice=5 +SoundStereo=0 +SoundMMW= +Tap=512 +IIRBW=60 +Diddle=2 +TxPort=0 +TxdJob=0 +TxFixShift=0 +PTT=NONE +InvPTT=0 +TXUOS=1 +MacroImm=0 +CharLenFile=1024 +DisTX=0 +TXLoop=1 +TXBPF=1 +TXBPFTAP=48 +TXLPF=0 +TXLPFFreq=1.000000e+02 +TXWaitType=0 +TXCharWait=0 +TXDiddleWait=0 +TXCharWaitDiddle=0 +TXRandomDiddle=0 +TXWaitTimerDiddle=0 +RXBPF=0 +RXBPFTAP=64 +RXBPFAFC=1 +RXBPFFW=2.500000e+02 +RXlms=0 +RXlmsDelay=24 +RXlmsMU2=1.000000e-03 +RXlmsGM=9.998000e-01 +RXlmsInv=0 +RXlmsAGC=1 +RXlmsTAP=512 +RXNotchTAP=192 +RXlmsBPF=0 +RXlmsType=1 +RXlmsNotch=2210 +RXlmsNotch2=0 +RXlmsTwoNotch=0 +pllVcoGain=3.000000e+00 +pllLoopOrder=2 +pllLoopFC=2.500000e+02 +pllOutOrder=4 +pllOutFC=2.000000e+02 +Call=JA7UDE + +[Button] +Hint=1 + +[Log] +Switch=0 +TimeStamp=1 +TimeStampUTC=0 +AutoUTCOffset=0 +UTCOffset=0 +UTCOffsetMin=0 +LogLink=1 +LinkPoll=0 +LinkPTT=0 +PathName= +ShowTimeStamp=1 + +[MMLink] +Name= + +[Dir] +OutFile= +ExtLog= +RecSound= + +[LogFile] +Name= + +[WaterFall] +Palette=0 + +[Input] +Height=97 + +[Color] +RXBack=16777215 +RXChar=0 +RXTXChar=0 +INBack=16777215 +INChar=0 +INTXChar=255 +WaterLow=0 +WaterHigh=16777215 +XYScope=16777215 + +[SysKey] +S1=0 +S2=0 +S3=0 +S4=0 +S5=0 +S6=0 +S7=0 +S8=0 +S9=321 +S10=0 +S11=335 +S12=332 +S13=324 +S14=0 +S15=0 +S16=579 +S17=0 +S18=0 +S19=0 +S20=0 +S21=0 +S22=0 +S23=0 +S24=0 +S25=120 +S26=119 +S27=0 +S28=323 +S29=334 +S30=337 +S31=338 +S32=326 +S33=112 +S34=0 +S35=0 +S36=0 +S37=0 +S38=36 +S39=35 +S40=0 +S41=0 +S42=33 +S43=34 +S44=0 +S45=0 +S46=0 +S47=0 +S48=0 +S49=0 +S50=294 +S51=296 +S52=0 +S53=0 +S54=588 +S55=0 +S56=549 +S57=551 +S58=596 +S59=0 +S60=322 +S61=0 +S62=0 +S63=0 +S64=0 +S65=0 +S66=0 +S67=0 +S68=0 +S69=0 +S70=0 +S71=0 +S72=0 +S73=0 +S74=0 +S75=0 +S76=0 +S77=0 +S78=0 +S79=0 +S80=582 + +[InBtnCol] +M1=0 +M2=0 +M3=0 +M4=0 + +[InBtnKey] +M1=113 +M2=114 +M3=115 +M4=116 + +[InBtnName] +M1=1X1 +M2=DEAR +M3=ANS +M4=BTU + +[InBtn] +M1="%c DE %m" +M2="DEAR %n" +M3="__\r\nRGR %c DE %m ALL OK DEAR %n\r\n" +M4="BTU %c DE %m KN\r\n_\\" + +[MacroTimer] +M1=0 +M2=0 +M3=0 +M4=0 +M5=0 +M6=0 +M7=0 +M8=0 +M9=0 +M10=0 +M11=0 +M12=0 +M13=0 +M14=0 +M15=0 +M16=0 + +[MacroCol] +M1=0 +M2=0 +M3=0 +M4=0 +M5=0 +M6=0 +M7=0 +M8=0 +M9=0 +M10=0 +M11=0 +M12=0 +M13=0 +M14=0 +M15=0 +M16=0 + +[MacroKey] +M1=305 +M2=306 +M3=307 +M4=308 +M5=309 +M6=310 +M7=311 +M8=312 +M9=313 +M10=121 +M11=122 +M12=123 +M13=0 +M14=0 +M15=118 +M16=117 + +[MacroEditKey] +M1=0 +M2=0 +M3=0 +M4=0 +M5=0 +M6=0 +M7=0 +M8=0 +M9=0 +M10=0 +M11=0 +M12=0 +M13=0 +M14=0 +M15=0 +M16=0 + +[MacroName] +M1=1X2 +M2=2X3 +M3=DE3 +M4=UR599 +M5=QANS +M6=M6 +M7=M7 +M8=M8 +M9=SK +M10=EE +M11=M11 +M12=M12 +M13=RY +M14=M14 +M15=CQ2 +M16=CQ1 + +[Macro] +M1="__\r\n%c DE %m %m K\r\n_\\" +M2="__\r\n%c %c DE %m %m %m K\r\n_\\" +M3="__\r\nDE %m %m %m K\r\n_\\" +M4="__\r\nQSL UR 599-599 TU\r\n_\\" +M5="__\r\nOK TNX %n\r\nUR %r %r NAME MAKO %c DE %m TU SK\r\n_\\" +M6="" +M7="" +M8="" +M9="\\\r\n73 TU SK SK\r\n%{TU}\\" +M10="[__~~__~\\" +M11="" +M12="" +M13="\r\nRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRY#" +M14="" +M15="__\r\nRYRY CQ CQ CQ DE %m %m %m\r\nRYRY CQ CQ CQ DE %m %m %m PSE K\r\n_\\" +M16="__\r\nRYRY CQ CQ CQ DE %m %m %m PSE K\r\n_\\" + +[MsgKey] +M1=368 +M2=369 +M3=370 +M4=371 +M5=372 +M6=373 +M7=374 +M8=375 +M9=376 +M10=0 + +[MsgName] +M1=AF CALL1 +M2=FINAL3 +M3=FINAL2 +M4=FINAL +M5=AF CQ2 (GEAR) +M6=AF CQ1 +M7=AF CALL2 (GEAR) +M8=AF CALL1 (QUICK) +M9=FINAL (QUICK) +M10= + +[MsgList] +M1="\\__\r\nRGR %c DE %m %g DEAR %n\r\nTHANK YOU FOR THE NICE REPORT.\r\nYOU ARE %r %r %r IN OSAKA OSAKA OSAKA\r\nMY NAME IS MAKO MAKO MAKO\r\nHOW COPY? BTU %c DE %m KN\r\n_\\" +M2="\\__\\" +M3="\\__\r\nTNX AGAIN DEAR %n CU SK\r\n__\\" +M4="\\__\r\nOK DEAR %n\r\nMANY THANK YOU FOR THE NICE QSO.\r\nI AM LOOKING FORWARD TO SEE YOU AGAIN ON CW AND PSK31.\r\nCUL! AND BEST 73\r\n%c DE %m TU SK SK..\r\n__" +M5="\\__\r\nRGR %c DE %m ALL OK DEAR %n\r\nTHANK YOU FOR THE NICE REPORT.\r\n\r\nI AM RUNNING 50W 50W INTO A SMALL LOOP ANTENNA(ONLY 90CM DIA!)\r\n\r\nRTTY MODEM IS HOMEMADE SOFTWARE ON WINDOWS-95 SOUNDBLASTER.\r\n\r\nTHANK YOU FOR THE NICE QSO DEAR %n\r\nMY QSL IS OK VIA THE BURO.\r\n\r\nHOW? BTU %c DE %m KN\r\n_\\" +M6="\\__\r\n%c %c DE %m %g\r\nTHANK YOU FOR YOUR CALL. I AM GLAD TO SEE YOU ON RTTY.\r\nYOU ARE %r %r %r IN OSAKA OSAKA OSAKA\r\nMY NAME IS MAKO MAKO MAKO\r\nHOW COPY? BTU %c %c DE %m KN\r\n_\\" +M7="\\__\r\nRGR %c DE %m ALL OK DEAR %n\r\nTHANK YOU FOR THE NICE INFO.\r\n\r\nI AM RUNNING 50W 50W INTO A SMALL LOOP ANTENNA(ONLY 90CM DIA!)\r\n\r\nRTTY MODEM IS HOMEMADE SOFTWARE ON WINDOWS-95 SOUNDBLASTER.\r\n\r\nTHANK YOU FOR THE NICE QSO DEAR %n\r\nMY QSL IS OK VIA THE BURO.\r\n\r\nHOW? BTU %c DE %m KN\r\n_\\" +M8="\\__\r\nRGR TNX %n\r\nUR %r %r %r NAME IS MAKO MAKO MAKO\r\nHOW? BTU %c DE %m KN\r\n_\\" +M9="\\__\r\nOK DEAR %n\r\nTNX FB QSO, CUL BEST 73 %c DE %m TU SK..\r\n__\\" +M10= + +[ExtConv] +WDEF1=%YYYY-MM-DD +WLEN1=0 +WDEF2=%HHMM +WLEN2=0 +WDEF3=%EHHMM +WLEN3=0 +WDEF4=%CALL +WLEN4=0 +WDEF5=%HIS +WLEN5=0 +WDEF6=%MY +WLEN6=0 +WDEF7=%FREQ +WLEN7=0 +WDEF8=%MODE +WLEN8=0 +WDEF9=%POWER +WLEN9=0 +WDEF10=%NAME +WLEN10=0 +WDEF11=%QTH +WLEN11=0 +WDEF12=%REM +WLEN12=0 +WDEF13=%QSL +WLEN13=0 +WDEF14=%S +WLEN14=0 +WDEF15=%R +WLEN15=0 +WDEF16=%EOD +WLEN16=0 +WDEF17= +WLEN17=0 +WDEF18= +WLEN18=0 +WDEF19= +WLEN19=0 +WDEF20= +WLEN20=0 +WDEF21= +WLEN21=0 +WDEF22= +WLEN22=0 +WDEF23= +WLEN23=0 +WDEF24= +WLEN24=0 +WDEF25= +WLEN25=0 +WDEF26= +WLEN26=0 +WDEF27= +WLEN27=0 +WDEF28= +WLEN28=0 +WDEF29= +WLEN29=0 +WDEF30= +WLEN30=0 +WDEF31= +WLEN31=0 +WDEF32= +WLEN32=0 +WDEF33= +WLEN33=0 +WDEF34= +WLEN34=0 +WDEF35= +WLEN35=0 +WDEF36= +WLEN36=0 +WDEF37= +WLEN37=0 +WDEF38= +WLEN38=0 +WDEF39= +WLEN39=0 +WDEF40= +WLEN40=0 +WDEF41= +WLEN41=0 +WDEF42= +WLEN42=0 +WDEF43= +WLEN43=0 +WDEF44= +WLEN44=0 +WDEF45= +WLEN45=0 +WDEF46= +WLEN46=0 +WDEF47= +WLEN47=0 +WDEF48= +WLEN48=0 +WDEF49= +WLEN49=0 +WDEF50= +WLEN50=0 +WDEF51= +WLEN51=0 +WDEF52= +WLEN52=0 +WDEF53= +WLEN53=0 +WDEF54= +WLEN54=0 +WDEF55= +WLEN55=0 +WDEF56= +WLEN56=0 +WDEF57= +WLEN57=0 +WDEF58= +WLEN58=0 +WDEF59= +WLEN59=0 +WDEF60= +WLEN60=0 +WDEF61= +WLEN61=0 +WDEF62= +WLEN62=0 +WDEF63= +WLEN63=0 +WDEF64= +WLEN64=0 +RDEF1=%YYYY-MM-DD +RLEN1=0 +RDEF2=%HHMM +RLEN2=0 +RDEF3=%EHHMM +RLEN3=0 +RDEF4=%CALL +RLEN4=0 +RDEF5=%HIS +RLEN5=0 +RDEF6=%MY +RLEN6=0 +RDEF7=%FREQ +RLEN7=0 +RDEF8=%MODE +RLEN8=0 +RDEF9=%POWER +RLEN9=0 +RDEF10=%NAME +RLEN10=0 +RDEF11=%QTH +RLEN11=0 +RDEF12=%REM +RLEN12=0 +RDEF13=%QSL +RLEN13=0 +RDEF14=%S +RLEN14=0 +RDEF15=%R +RLEN15=0 +RDEF16=%EOD +RLEN16=0 +RDEF17= +RLEN17=0 +RDEF18= +RLEN18=0 +RDEF19= +RLEN19=0 +RDEF20= +RLEN20=0 +RDEF21= +RLEN21=0 +RDEF22= +RLEN22=0 +RDEF23= +RLEN23=0 +RDEF24= +RLEN24=0 +RDEF25= +RLEN25=0 +RDEF26= +RLEN26=0 +RDEF27= +RLEN27=0 +RDEF28= +RLEN28=0 +RDEF29= +RLEN29=0 +RDEF30= +RLEN30=0 +RDEF31= +RLEN31=0 +RDEF32= +RLEN32=0 +RDEF33= +RLEN33=0 +RDEF34= +RLEN34=0 +RDEF35= +RLEN35=0 +RDEF36= +RLEN36=0 +RDEF37= +RLEN37=0 +RDEF38= +RLEN38=0 +RDEF39= +RLEN39=0 +RDEF40= +RLEN40=0 +RDEF41= +RLEN41=0 +RDEF42= +RLEN42=0 +RDEF43= +RLEN43=0 +RDEF44= +RLEN44=0 +RDEF45= +RLEN45=0 +RDEF46= +RLEN46=0 +RDEF47= +RLEN47=0 +RDEF48= +RLEN48=0 +RDEF49= +RLEN49=0 +RDEF50= +RLEN50=0 +RDEF51= +RLEN51=0 +RDEF52= +RLEN52=0 +RDEF53= +RLEN53=0 +RDEF54= +RLEN54=0 +RDEF55= +RLEN55=0 +RDEF56= +RLEN56=0 +RDEF57= +RLEN57=0 +RDEF58= +RLEN58=0 +RDEF59= +RLEN59=0 +RDEF60= +RLEN60=0 +RDEF61= +RLEN61=0 +RDEF62= +RLEN62=0 +RDEF63= +RLEN63=0 +RDEF64= +RLEN64=0 + +[LogSet] +TimeZone=73 +DateType=0 +UpperName=0 +UpperQTH=0 +UpperREM=0 +UpperQSL=0 +DefMyRST=0 +Contest=0 +CopyFreq=0 +CopyHis=0 +CopyName=1 +CopyQTH=1 +CopyREM=0 +CopyQSL=1 +CopyREMB4=0 +CheckBand=1 +AutoSave=1 +QSOMacroFlag=0 +QSOMacro1=1 +QSOMacroKey1=0 +QSOMacroStr1="\r\n %c %c UR %R-%N-%N BK\r\n\\" +QSOMacro2=1 +QSOMacroKey2=0 +QSOMacroStr2="\r\nQSL TU QRZ? DE %m %m K\r\n\\" +QSOMacro3=1 +QSOMacroKey3=0 +QSOMacroStr3="\r\n %c SRI QSO B4 QRZ? DE %m %m K\r\n\\" +QSOMacro4=0 +QSOMacroKey4=0 +QSOMacroStr4="\r\nDE %m %m K\r\n\\" +QSOMacro5=0 +QSOMacroKey5=0 +QSOMacroStr5="\r\n %c %R-%N-%N TU\r\n\\" +THRTTY=RTY +THSSTV=STV +THTZ=0 +ClipRSTADIF=1 +Backup=1 +TH5Fields=3,3,7,4,12,28,54 + +[Program] +Name1=&G3PLX PSK31SBW +Command1= +Name2=&IZ8BLY Hellschreiber +Command2= +Name3=&External 3 +Command3= +Name4=E&xternal 4 +Command4= + +[TNC] +PortName=NONE +Type=0 +BaudRate=1200 +BitLen=1 +Stop=0 +Parity=0 +flwXON=1 +flwCTS=0 +Echo=2 + +[RADIO] +PortName=NONE +BaudRate=4800 +BitLen=1 +Stop=1 +Parity=0 +flwXON=0 +flwCTS=0 +usePTT=0 +ByteWait=0 +Cmdxx=0 +CmdInit= +CmdRx=\$000000000F +CmdTx=\$000000010F\w10 +FileGNR= +OpenGNR=0 +PollType=0 +PollInterval=5 +PollOffset=0 + +[AA6YQ] +Version=2 +Enabled=1 +TapsBPF=512 +WidthBPF=3.500000e+01 +TapsBEF=256 +WidthBEF=1.500000e+01 +afcERR=5.000000e+00 + diff --git a/MyRIG.rcm b/MyRIG.rcm new file mode 100644 index 0000000..ced32c6 --- /dev/null +++ b/MyRIG.rcm @@ -0,0 +1,8 @@ +[RADIO] +CmdInit=\$0000000000 +CmdRx=\$0000000088 +CmdTx=\$0000000008\w10 +PollType=2 +PollOffset=0 +PollInterval=0 +Cmdxx=04 diff --git a/Option.cpp b/Option.cpp new file mode 100644 index 0000000..3f9dd85 --- /dev/null +++ b/Option.cpp @@ -0,0 +1,1585 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba, Dave Bernstein +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "Option.h" +#include "EditDlg.h" +#include "LogFile.h" +#include "Main.h" +#include "FreqDisp.h" +#include "ClockAdj.h" +#include "radioset.h" +#include "TxdDlg.h" +//--------------------------------------------------------------------- +#pragma resource "*.dfm" +//TAgcSetDlg *AgcSetDlg; +int PageIndex = 0; +static int PageIndexBPF = 0; +//--------------------------------------------------------------------- +__fastcall TOptionDlg::TOptionDlg(TComponent* AOwner) + : TForm(AOwner) +{ + + m_DisEvent = 1; + FormStyle = ((TForm *)AOwner)->FormStyle; + Font->Name = ((TForm *)AOwner)->Font->Name; + Font->Charset = ((TForm *)AOwner)->Font->Charset; + pDem = NULL; + m_FontCharset = SHIFTJIS_CHARSET; + m_FontStyle = 0; + m_ColorChange = 0; + UpdateMacro(); + MarkFreq->Items->Assign(MmttyWd->MarkFreq->Items); + ShiftFreq->Items->Assign(MmttyWd->ShiftFreq->Items); + SetComboBox(IIRFW, MmttyWd->m_asIIRBW.c_str()); + SetComboBox(FilterTap, MmttyWd->m_asFilterTap.c_str()); + SetComboBox(SmoozFreq, MmttyWd->m_asSmooth.c_str()); + SmoozIIR->Items->Assign(SmoozFreq->Items); + SetComboBox(BaudRate, MmttyWd->m_asBaud.c_str()); + SetComboBox(pllVCOGain, MmttyWd->m_asVCOGain.c_str()); + SetComboBox(pllLoopFC, MmttyWd->m_asLoopFC.c_str()); + + //AA6YQ 1.66 + InputSoundcards->Items->BeginUpdate(); + InputSoundcards->Items->Clear(); + for( int i = 0; i < 16; i++ ){ + InputSoundcards->Items->Add(MmttyWd->pSound->GetInputSoundcard(i)); + } + InputSoundcards->Items->EndUpdate(); + + OutputSoundcards->Items->BeginUpdate(); + OutputSoundcards->Items->Clear(); + for( int i = 0; i < 16; i++ ){ + OutputSoundcards->Items->Add(MmttyWd->pSound->GetOutputSoundcard(i)); + } + OutputSoundcards->Items->EndUpdate(); + + + if( Font->Charset != SHIFTJIS_CHARSET ){ + Caption = Remote ? SETUPTITLEREMOTE:SETUPTITLE; //AA6YQ 1.66C + DefBtn->Caption = "Set Default(Demodulator)"; + TabPara->Caption = "Decode"; + TabTx->Caption = "TX"; + TabFont->Caption = "Font/Window"; + TabMisc->Caption = "Misc"; + GrpDisc->Caption = "Discriminator"; + GrpLimit->Caption = "Limit Amp."; + GrpFilter->Caption = "Pre-Filter"; + DemType->Caption = "Type"; + DemType->Items->Strings[0] = "IIR resonator"; + DemType->Items->Strings[1] = "FIR BPF"; + DemType->Items->Strings[2] = "PLL"; + DemBpfBtn->Caption = "Show"; + GrpLPF->Caption = "Smooth LPF"; + LSmooz->Caption = "Order"; + PreBpfBtn->Caption = "Show"; + CheckRXBPFAFC->Caption = "AFC Connection"; + LMU2->Caption = "2µ"; + LGM->Caption = "Gm."; + CancelBtn->Caption = "Cancel"; + LLoopOrder->Caption = "Order"; + LOutOrder->Caption = "Order"; + LBaudRate->Caption = "BaudRate"; + CheckMajority->Caption = "Majority Logic"; + CheckIgnoreFream->Caption = "Ignore framing error"; + BitLen->Caption = "BitLength"; + StopLen->Caption = "StopLength"; + ParitySel->Caption = "Parity"; + DefStopBit->Caption = "Default RxStop bit"; + CheckDblSft->Caption = "Double shift"; + LOutLvl->Caption = "Digital Output"; + LCharW->Caption = "Char. Wait"; + PttInv->Caption = "Invert Logic"; + GrpInBtn->Caption = "Input Button"; + MacroImm->Caption = "Convert Immediately"; + LFont->Caption = "Font"; + FontBtn->Caption = "Ref"; + CheckPalette->Caption = "Use Palette"; + CheckZero->Caption = "slash zero"; + GrpDispAdj->Caption = "Adjust"; + LW->Caption = "Width"; + LH->Caption = "Height"; + XYInv->Caption = "Reverse rotation"; + GrpRx->Caption = "RxWindow"; + GrpIn->Caption = "TxWindow"; + LRXB->Caption = "Back"; + LRXC->Caption = "Char."; + LRXS->Caption = "Char. sent"; + LINB->Caption = "Back"; + LINC->Caption = "Char."; + LINS->Caption = "Char. sent"; + GrpCard->Caption = "Sound Card"; + RGLoop->Caption = "Sound loopback"; + RGLoop->Items->Strings[1] = "Int."; + RGLoop->Items->Strings[2] = "Ext.(SAT)"; + TxPort->Caption = "Tx Port"; + TxPort->Items->Strings[0] = "Sound"; + TxPort->Items->Strings[1] = "Sound + COM-TxD (FSK)"; + + CBFix45->Caption = "Fixes 45.45 baud"; + SBIN1->Font->Name = sys.m_BtnFontName; + SBIN1->Font->Charset = sys.m_BtnFontCharset; + SBIN2->Font->Name = sys.m_BtnFontName; + SBIN2->Font->Charset = sys.m_BtnFontCharset; + SBIN3->Font->Name = sys.m_BtnFontName; + SBIN3->Font->Charset = sys.m_BtnFontCharset; + SBIN4->Font->Name = sys.m_BtnFontName; + SBIN4->Font->Charset = sys.m_BtnFontCharset; + for( int i = 0; i < 16; i++ ){ + GetSB(i)->Font->Name = sys.m_BtnFontName; + GetSB(i)->Font->Charset = sys.m_BtnFontCharset; + } + } + else if( Remote ){ + Caption = "Ý’è‰æ–Ê"; + } + if( Remote ){ + GB5->Visible = FALSE; + GrpInBtn->Visible = FALSE; + LFont->Visible = FALSE; + FontName->Visible = FALSE; + FontBtn->Visible = FALSE; + CheckZero->Visible = FALSE; + GrpDispAdj->Visible = FALSE; + GrpRx->Visible = FALSE; + GrpIn->Visible = FALSE; + MemWin->Visible = FALSE; + if( Remote & REMNOPTT ){ + GPTT->Visible = FALSE; + } + if( Remote & REMSHOWOFF ){ + TabFont->TabVisible = FALSE; + GSFont->Visible = FALSE; + } + if( !(Remote & REMCTRL) ){ + GSFont->Visible = FALSE; + } + } + SBHelp->Visible = !JanHelp.IsEmpty(); + +//AA6YQ 1.66B moved here from TOptionDlg::DevNoDropDown + + m_MMListW.QueryList("MMW"); + for( int i = 0; i < m_MMListW.GetCount(); i++ ){ + DevNo->Items->Add(m_MMListW.GetItemName(i)); + DevOutNo->Items->Add(m_MMListW.GetItemName(i)); + } + +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::UpdateUI(void) +{ + if( PortName->Text == "NONE" ){ + TxPort->Controls[1]->Enabled = FALSE; + TxPort->Controls[2]->Enabled = FALSE; + TxdJob->Visible = FALSE; + } + else { + TxPort->Controls[1]->Enabled = TRUE; + TxPort->Controls[2]->Enabled = TRUE; + TxdJob->Visible = TxPort->ItemIndex ? TRUE : FALSE; + } + switch(DemType->ItemIndex){ + case 0: // IIR + IIRFW->Visible = TRUE; + FilterTap->Visible = FALSE; + Tones->Visible = FALSE; + LTAPFW->Caption = "BW"; + LHZ->Visible = TRUE; + LTAPFW->Visible = TRUE; + DemBpfBtn->Visible = TRUE; + GrpLimit->Enabled = TRUE; + break; + case 1: // FIR + IIRFW->Visible = FALSE; + FilterTap->Visible = TRUE; + Tones->Visible = FALSE; + LTAPFW->Caption = "Tap"; + LHZ->Visible = FALSE; + LTAPFW->Visible = TRUE; + DemBpfBtn->Visible = TRUE; + GrpLimit->Enabled = TRUE; + break; + case 2: + IIRFW->Visible = FALSE; + Tones->Visible = FALSE; + LHZ->Visible = FALSE; + FilterTap->Visible = FALSE; + LTAPFW->Visible = FALSE; + DemBpfBtn->Visible = FALSE; + GrpLimit->Enabled = TRUE; + break; + case 3: // FFT + IIRFW->Visible = FALSE; + FilterTap->Visible = FALSE; + Tones->Visible = TRUE; + LTAPFW->Caption = "Tones"; + LHZ->Visible = FALSE; + LTAPFW->Visible = TRUE; + DemBpfBtn->Visible = FALSE; + GrpLimit->Enabled = FALSE; + break; + } + SetGroupEnabled(GrpLimit); + + if( DemLpf->ItemIndex ){ // IIR + LSmooz->Visible = TRUE; + DemLpfOrder->Visible = TRUE; + SmoozFreq->Visible = FALSE; + SmoozIIR->Visible = TRUE; + LLPF->Caption = "LPF"; +// DispDemLpf->Visible = TRUE; + } + else { // FIR-Avg + LSmooz->Visible = FALSE; + DemLpfOrder->Visible = FALSE; + SmoozFreq->Visible = TRUE; + SmoozIIR->Visible = FALSE; + LLPF->Caption = "Freq"; +// DispDemLpf->Visible = FALSE; + } + int f; + m_DisEvent++; + if( lmsType->Checked ){ + lmsTap->Text = m_NotchTap; + f = FALSE; + } + else { + lmsTap->Text = m_lmsTap; + f = TRUE; + } + m_DisEvent--; + LDelay->Visible = f; + LMU2->Visible = f; + LGM->Visible = f; + lmsDelay->Visible = f; + lmsMU2->Visible = f; + lmsGM->Visible = f; + lmsAGC->Visible = f; + lmsBPF->Visible = f; + lmsInv->Visible = f; + lmsTwo->Visible = !f; + + int dd; + f = (sscanf(AnsiString(DevNo->Text).c_str(), "%d", &dd) == 1 ); //JA7UDE 0428 + GB4->Enabled = f; + SetGroupEnabled(GB4); + Source->Enabled = f; +} +//--------------------------------------------------------------------------- +TSpeedButton *__fastcall TOptionDlg::GetSB(int n) +{ + TSpeedButton *_sb[]={SBM1, SBM2, SBM3, SBM4, SBM5, SBM6, SBM7, + SBM8, SBM9, SBM10, SBM11, SBM12, SBM13, SBM14, SBM15, SBM16}; + if( (n >= 0) && (n < AN(_sb)) ){ + return _sb[n]; + } + else { + return NULL; + } +} +//--------------------------------------------------------------------------- +int __fastcall TOptionDlg::GetMacroIndex(TObject *Sender) +{ + for( int i = 0; i < 16; i++ ){ + TSpeedButton *_sb[]={SBM1, SBM2, SBM3, SBM4, SBM5, SBM6, SBM7, + SBM8, SBM9, SBM10, SBM11, SBM12, SBM13, SBM14, SBM15, SBM16}; + + if( ((TObject *)_sb[i]) == Sender ) return i; + } + return -1; +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::UpdateMacro(void) +{ + SetButtonCaption(SBIN1, sys.m_InBtnName[0], 6, sys.m_SBINFontSize, sys.m_InBtnCol[0]); + SetButtonCaption(SBIN2, sys.m_InBtnName[1], 6, sys.m_SBINFontSize, sys.m_InBtnCol[1]); + SetButtonCaption(SBIN3, sys.m_InBtnName[2], 6, sys.m_SBINFontSize, sys.m_InBtnCol[2]); + SetButtonCaption(SBIN4, sys.m_InBtnName[3], 6, sys.m_SBINFontSize, sys.m_InBtnCol[3]); + for( int i = 0; i < 16; i++ ){ + SetButtonCaption(GetSB(i), sys.m_UserName[i], 4, sys.m_SBFontSize, sys.m_UserCol[i]); + } +} + +//AA6YQ 1.66 +int __fastcall TOptionDlg::IsSoundcard(LPCSTR t) +{ + for( ; ; t++ ){ + if (*t=='\0') { + return 1; + } + else if ((*t<'0')||(*t>'9')){ + return 0; + } + } +} + +int __fastcall TOptionDlg::Execute(CFSKDEM *fp, CFSKMOD *mp) +{ + + pDem = fp; + m_ColorChange = 0; + + m_TxdJob = sys.m_TxdJob; + EditSamp->Text = sys.m_SampFreq; + char bf[32]; + sprintf(bf, "%.2lf", sys.m_TxOffset); + TxOff->Text = bf; + WinFont->Text = sys.m_WinFontName; + m_WinFontCharset = sys.m_WinFontCharset; + m_WinFontStyle = sys.m_WinFontStyle; + MemWin->Checked = sys.m_MemWindow; + + BtnFont->Text = sys.m_BtnFontName; + m_BtnFontCharset = sys.m_BtnFontCharset; + m_BtnFontStyle = sys.m_BtnFontStyle; + + FontAdj->Text = sys.m_FontAdjSize; + BtnFontAdj->Text = sys.m_BtnFontAdjSize; + + DemType->ItemIndex = fp->m_type; + RGLoop->ItemIndex = sys.m_echo; + MacroImm->Checked = sys.m_MacroImm; + + pllVCOGain->Text = fp->m_pll.m_vcogain; + pllLoopOrder->Text = fp->m_pll.m_loopOrder; + pllLoopFC->Text = fp->m_pll.m_loopFC; + pllOutOrder->Text = fp->m_pll.m_outOrder; + pllOutFC->Text = fp->m_pll.m_outFC; + + WaitDiddle->Checked = mp->m_CharWaitDiddle; + TBDiddleWait->Position = SetTBValue(mp->m_DiddleWait, 50, 50); + TBCharWait->Position = SetTBValue(mp->m_CharWait, 50, 50); + + PCRXBack->Color = sys.m_ColorRXBack; + PCRXChar->Color = sys.m_ColorRX; + PCRXTXChar->Color = sys.m_ColorRXTX; + PCINBack->Color = sys.m_ColorINBack; + PCINChar->Color = sys.m_ColorIN; + PCINTx->Color = sys.m_ColorINTX; + PCLow->Color = sys.m_ColorLow; + PCHigh->Color = sys.m_ColorHigh; + PCXY->Color = sys.m_ColorXY; + + TxPort->ItemIndex = sys.m_TxPort; + CBFix45->Checked = sys.m_DefFix45; + DefMarkFreq->Text = sys.m_DefMarkFreq; + DefShift->Text = sys.m_DefShift; + DefStopBit->ItemIndex = sys.m_DefStopLen; + + MarkFreq->Text = fp->GetMarkFreq(); + ShiftFreq->Text = fp->GetSpaceFreq() - fp->GetMarkFreq(); + FilterTap->Text = fp->GetFilterTap(); + IIRFW->Text = fp->m_iirfw; + Tones->Text = fp->m_Phase.m_TONES; + CBAA6YQ->Checked = fp->m_AA6YQ.m_fEnabled; + + SmoozFreq->Text = fp->GetSmoozFreq(); + SmoozIIR->Text = fp->m_lpffreq; + DemLpf->ItemIndex = fp->m_lpf; + DemLpfOrder->Text = fp->m_lpfOrder; + LimitGain->Text = sys.m_LimitGain; + LimitOver->Checked = fp->m_LimitOverSampling; + LimitAGC->Checked = fp->m_LimitAGC; + + CheckInv->Checked = sys.m_Rev; + + BaudRate->Text = fp->GetBaudRate(); + BitLen->ItemIndex = fp->m_BitLen - 5; + StopLen->ItemIndex = fp->m_StopLen; + ParitySel->ItemIndex = fp->m_Parity; + RGC->ItemIndex = sys.m_CodeSet; + + PortName->Text = sys.m_TxRxName; + PttInv->Checked = sys.m_TxRxInv; + + DiddleSel->ItemIndex = mp->m_diddle; + RandomDiddle->Checked = mp->m_RandomDiddle; + WaitTimer->Checked = mp->m_WaitTimer; + + EditCall->Text = sys.m_Call; + + CheckTXUOS->Checked = sys.m_txuos; + CheckTXBPF->Checked = mp->m_bpf; + CheckDblSft->Checked = sys.m_dblsft; + CheckTXLPF->Checked = mp->m_lpf; + TxLpfFreq->Text = mp->GetLPFFreq(); + + TxBpfTap->Text = mp->m_bpftap; + TxDisRev->Checked = sys.m_TxDisRev; + TxFixShift->Checked = sys.m_TxFixShift; + + CheckAFC->Checked = sys.m_AFC; + FixShift->ItemIndex = sys.m_FixShift; + AFCTime->Text = sys.m_AFCTime; + AFCSQ->Text = sys.m_AFCSQ; + AFCSweep->Text = sys.m_AFCSweep; + + ATC->Checked = fp->m_atc; + ATCTime->Text = fp->m_atcMark.m_Max; + + TBOutLvl->Position = int(mp->GetOutputGain()*64.0/32768.0); + + FontName->Text = sys.m_FontName; + FontAdjX->Text = sys.m_FontAdjX; + FontAdjY->Text = sys.m_FontAdjY; + m_FontCharset = sys.m_FontCharset; + m_FontStyle = sys.m_FontStyle; + m_FontSize = sys.m_FontSize; + CheckZero->Checked = sys.m_FontZero; + + CheckPalette->Checked = sys.m_Palette; + + XYInv->Checked = sys.m_XYInv; + + FifoRX->Text = sys.m_SoundFifoRX; + FifoTX->Text = sys.m_SoundFifoTX; + SoundPriority->ItemIndex = sys.m_SoundPriority; + + if( sys.m_SoundDevice == -2 ){ + DevNo->Text = sys.m_SoundMMW; + } + else { + DevNo->Text = sys.m_SoundDevice; + } + + //AA6YQ 1.66 + if( sys.m_SoundOutDevice == -2 ){ + DevOutNo->Text = sys.m_SoundMMW; + } + else { + DevOutNo->Text = sys.m_SoundOutDevice; + } + + //AA6YQ 1.66 + if (IsSoundcard (AnsiString(DevNo->Text).c_str())) { //JA7UDE 0428 + InputSoundcards->ItemIndex = atoi(AnsiString(DevNo->Text).c_str()); //AA6YQ 1.66 //JA7UDE 0428 + } + else { + InputSoundcards->ItemIndex =-1; + } + + //AA6YQ 1.66 + if (IsSoundcard (AnsiString(DevOutNo->Text).c_str())) { //JA7UDE 0428 + OutputSoundcards->ItemIndex = atoi(AnsiString(DevOutNo->Text).c_str()); //AA6YQ 1.66 //JA7UDE 0428 + } + else { + OutputSoundcards->ItemIndex =-1; + } + + Source->ItemIndex = sys.m_SoundStereo; + + SelBPF->Checked = MmttyWd->pSound->m_bpf; + SelLMS->Checked = MmttyWd->pSound->m_lmsbpf; + CheckRXBPFAFC->Checked = MmttyWd->pSound->m_bpfafc; + RxBpfTap->Text = MmttyWd->pSound->m_bpftap; + RxBpfFW->Text = MmttyWd->pSound->m_bpffw; + m_lmsTap = MmttyWd->pSound->m_lms.m_Tap; + m_NotchTap = MmttyWd->pSound->m_lms.m_NotchTap; + // lmsTap->Text = MmttyWd->pSound->m_lms.m_Tap; + lmsType->Checked = MmttyWd->pSound->m_lms.m_Type; + lmsDelay->Text = MmttyWd->pSound->m_lms.m_lmsDelay; + lmsMU2->Text = MmttyWd->pSound->m_lms.m_lmsMU2; + lmsGM->Text = MmttyWd->pSound->m_lms.m_lmsGM; + lmsAGC->Checked = MmttyWd->pSound->m_lms.m_lmsAGC; + lmsInv->Checked = MmttyWd->pSound->m_lms.m_lmsInv; + lmsBPF->Checked = MmttyWd->pSound->m_lms.m_bpf; + lmsTwo->Checked = MmttyWd->pSound->m_lms.m_twoNotch; + + CheckMajority->Checked = fp->m_majority; + CheckIgnoreFream->Checked = fp->m_ignoreFream; + + if( (PageIndex >= 0) && (PageIndex < Page->PageCount) ){ + if( Page->Pages[PageIndex]->TabVisible == FALSE ){ + PageIndex = 0; + } + Page->ActivePage = Page->Pages[PageIndex]; + } + if( (PageIndexBPF >= 0) && (PageIndexBPF < PageBPF->PageCount) ){ + PageBPF->ActivePage = PageBPF->Pages[PageIndexBPF]; + } + UpdateUI(); + m_DisEvent = 0; + int r = ShowModal(); + if( r == IDOK ){ + m_DisEvent++; + double d; + int dd; + + sys.m_TxdJob = m_TxdJob; + sscanf(AnsiString(EditSamp->Text).c_str(), "%lf", &d); //JA7UDE 0428 + if( (d >= 5000.0) && (d <= 12500.0) ){ + sys.m_SampFreq = d; + } + sscanf(AnsiString(TxOff->Text).c_str(), "%lf", &d); //JA7UDE 0428 + sys.m_TxOffset = d; + + sys.m_WinFontName = WinFont->Text; + sys.m_WinFontCharset = m_WinFontCharset; + sys.m_WinFontStyle = m_WinFontStyle; + + sys.m_BtnFontName = BtnFont->Text; + sys.m_BtnFontCharset = m_BtnFontCharset; + sys.m_BtnFontStyle = m_BtnFontStyle; + + if( sscanf(AnsiString(FontAdj->Text).c_str(), "%ld", &dd) == 1 ){ //JA7UDE 0428 + sys.m_FontAdjSize = dd; + } + if( sscanf(AnsiString(BtnFontAdj->Text).c_str(), "%ld", &dd) == 1 ){ //JA7UDE 0428 + sys.m_BtnFontAdjSize = dd; + } + + fp->m_type = DemType->ItemIndex; + sys.m_echo = RGLoop->ItemIndex; + sys.m_MacroImm = MacroImm->Checked; + + sys.m_DefFix45 = CBFix45->Checked; + sscanf(AnsiString(DefMarkFreq->Text).c_str(), "%lf", &d); //JA7UDE 0428 + if( (d >= MARKL) && (d <= SPACEH) ){ + sys.m_DefMarkFreq = d; + } + sscanf(AnsiString(DefShift->Text).c_str(), "%lf", &d); //JA7UDE 0428 + if( (d >= SHIFTL) && (d <= 1500.0) ){ + sys.m_DefShift = d; + } + sys.m_DefStopLen = DefStopBit->ItemIndex; + + sscanf(AnsiString(MarkFreq->Text).c_str(), "%lf", &d); //JA7UDE 0428 + if( (d >= MARKL) && (d <= SPACEH) ){ + fp->SetMarkFreq(d); + mp->SetMarkFreq(d); + } + sscanf(AnsiString(ShiftFreq->Text).c_str(), "%lf", &d); //JA7UDE 0428 + if( (d >= SHIFTL) && (d <= 1500.0) ){ + d += fp->GetMarkFreq(); + fp->SetSpaceFreq(d); + mp->SetSpaceFreq(d); + } + sscanf(AnsiString(FilterTap->Text).c_str(), "%u", &dd); //JA7UDE 0428 + if( dd >= 2 ){ + fp->SetFilterTap(dd); + } + sscanf(AnsiString(IIRFW->Text).c_str(), "%lf", &d); //JA7UDE 0428 + if( d > 0 ){ + fp->SetIIR(d); + } + sscanf(AnsiString(Tones->Text).c_str(), "%u", &dd); //JA7UDE 0428 + if( (dd >= 2) && (dd <= 6) ){ + fp->m_Phase.SetTones(dd); + } + + if( fp->m_AA6YQ.m_fEnabled != CBAA6YQ->Checked ){ + fp->m_AA6YQ.m_fEnabled = CBAA6YQ->Checked; + if( CBAA6YQ->Checked ) fp->m_AA6YQ.Create(); + } + + fp->m_lpf = DemLpf->ItemIndex; + sscanf(AnsiString(DemLpfOrder->Text).c_str(), "%u", &dd); //JA7UDE 0428 + if( (dd >= 1) && (dd <= 32) ){ + fp->m_lpfOrder = dd; + } + + sscanf(AnsiString(SmoozFreq->Text).c_str(), "%lf", &d); //JA7UDE 0428 + if( (d >= 20.0) && (d <= 1500.0) ){ + fp->SetSmoozFreq(d); + } + sscanf(AnsiString(SmoozIIR->Text).c_str(), "%lf", &d); //JA7UDE 0428 + if( (d >= 20.0) && (d <= 1500.0) ){ + fp->SetLPFFreq(d); + } + + sscanf(AnsiString(LimitGain->Text).c_str(), "%lf", &d); //JA7UDE 0428 + if( (d > 0.0) && (d <= 32768.0) ){ + sys.m_LimitGain = d; + } + fp->m_LimitOverSampling = LimitOver->Checked; + fp->m_LimitAGC = LimitAGC->Checked; + MmttyWd->UpdateLimit(); + + + sscanf(AnsiString(BaudRate->Text).c_str(), "%lf", &d); //JA7UDE 0428 + if( d > 0.0 ){ + fp->SetBaudRate(d); + mp->SetBaudRate(d); + } + + sys.m_TxFixShift = TxFixShift->Checked; + sys.m_TxDisRev = TxDisRev->Checked; + sys.m_Rev = CheckInv->Checked; + MmttyWd->UpdateRev(); + + fp->m_BitLen = BitLen->ItemIndex + 5; + fp->m_StopLen = StopLen->ItemIndex; + fp->m_Parity = ParitySel->ItemIndex; + sys.m_CodeSet = RGC->ItemIndex; + + sys.m_TxRxName = PortName->Text; + if( (PortName->Text != "NONE") && !strcmp(AnsiString(PortName->Text).c_str(), RADIO.StrPort) ){ //JA7UDE 0428 + strcpy(RADIO.StrPort, "NONE"); + } + sys.m_TxRxInv = PttInv->Checked; + + mp->m_diddle = DiddleSel->ItemIndex; + mp->m_RandomDiddle = RandomDiddle->Checked; + mp->m_WaitTimer = WaitTimer->Checked; + + char bf[MLCALL+1]; + StrCopy(bf, AnsiString(EditCall->Text).c_str(), MLCALL); //JA7UDE 0428 + jstrupr(bf); + sys.m_Call = bf; + + sys.m_txuos = CheckTXUOS->Checked; + mp->m_bpf = CheckTXBPF->Checked; + sys.m_dblsft = CheckDblSft->Checked; + + mp->m_lpf = CheckTXLPF->Checked; + sscanf(AnsiString(TxLpfFreq->Text).c_str(), "%lf", &d); //JA7UDE 0428 + if( (d >= 20.0) && (d <= 2000.0) ){ + mp->SetLPFFreq(d); + } + + sscanf(AnsiString(TxBpfTap->Text).c_str(), "%u", &dd); //JA7UDE 0428 + if( dd >= 2 ){ + mp->m_bpftap = dd; + mp->CalcBPF(); + } + + sys.m_AFC = CheckAFC->Checked; + sys.m_FixShift = FixShift->ItemIndex; + + sscanf(AnsiString(AFCTime->Text).c_str(), "%lf", &d); //JA7UDE 0428 + if( (d >= 1.0) && (d <= 128.0) ){ + sys.m_AFCTime = d; + } + sscanf(AnsiString(AFCSweep->Text).c_str(), "%lf", &d); //JA7UDE 0428 + if( (d >= 0.01) && (d <= 1.0) ){ + sys.m_AFCSweep = d; + } + sscanf(AnsiString(AFCSQ->Text).c_str(), "%u", &dd); //JA7UDE 0428 + if( dd >= 2 ){ + sys.m_AFCSQ = dd; + } + + fp->m_atc = ATC->Checked; + sscanf(AnsiString(ATCTime->Text).c_str(), "%u", &dd); //JA7UDE 0428 + if( (dd >= 0) && (dd <= 16) ){ + fp->m_atcMark.m_Max = dd; + fp->m_atcSpace.m_Max = dd; + } + + mp->SetOutputGain(TBOutLvl->Position*32768.0/64.0); + + mp->m_BitLen = fp->m_BitLen; + mp->m_StopLen = fp->m_StopLen; + mp->m_Parity = fp->m_Parity; + + r = 1; + if( sys.m_FontName != FontName->Text ){ + sys.m_FontName = FontName->Text; + r = 2; + } + if( sscanf(AnsiString(FontAdjX->Text).c_str(), "%d", &dd) == 1 ){ //JA7UDE 0428 + if( dd != sys.m_FontAdjX ){ + r = 2; + sys.m_FontAdjX = dd; + } + } + if( sscanf(AnsiString(FontAdjY->Text).c_str(), "%d", &dd) == 1 ){ //JA7UDE 0428 + if( dd != sys.m_FontAdjY ){ + r = 2; + sys.m_FontAdjY = dd; + } + } + if( (sys.m_FontCharset != m_FontCharset) || + (sys.m_FontStyle != m_FontStyle) || + (sys.m_FontSize != m_FontSize) + ){ + sys.m_FontCharset = m_FontCharset; + sys.m_FontStyle = m_FontStyle; + sys.m_FontSize = m_FontSize; + r = 2; + } + sys.m_FontZero = CheckZero->Checked; + + sys.m_Palette = CheckPalette->Checked; + + sys.m_XYInv = XYInv->Checked; + + if( sscanf(AnsiString(FifoRX->Text).c_str(), "%u", &dd) == 1 ){ //JA7UDE 0428 + if( (dd >= 2) && (dd <= 16) ){ + sys.m_SoundFifoRX = dd; + } + } + if( sscanf(AnsiString(FifoTX->Text).c_str(), "%u", &dd) == 1 ){ //JA7UDE 0428 + if( (dd >= 2) && (dd <= 16) ){ + sys.m_SoundFifoTX = dd; + } + } + + sys.m_SoundPriority = SoundPriority->ItemIndex; + + if( sscanf(AnsiString(DevNo->Text).c_str(), "%d", &dd) == 1 ){ //JA7UDE 0428 + sys.m_SoundDevice = dd; + } + else { + sys.m_SoundDevice = -2; + sys.m_SoundMMW = DevNo->Text.c_str(); + } + + //AA6YQ 1.66 + if( sscanf(AnsiString(DevOutNo->Text).c_str(), "%d", &dd) == 1 ){ //JA7UDE 0428 + sys.m_SoundOutDevice = dd; + } + else { + sys.m_SoundOutDevice = -2; + sys.m_SoundMMW = DevOutNo->Text.c_str(); + } + + sys.m_SoundStereo = Source->ItemIndex; + + MmttyWd->pSound->m_bpf = SelBPF->Checked; + MmttyWd->pSound->m_lmsbpf = SelLMS->Checked; + MmttyWd->pSound->m_bpfafc = CheckRXBPFAFC->Checked; + if( sscanf(AnsiString(RxBpfTap->Text).c_str(), "%u", &dd) == 1 ){ //JA7UDE 0428 + if( (dd >= 2) && (dd <= 512) ){ + MmttyWd->pSound->m_bpftap = dd; + } + } + if( sscanf(AnsiString(RxBpfFW->Text).c_str(), "%lf", &d) == 1 ){ //JA7UDE 0428 + if( (d >= 0.0) && (d <= 500.0) ){ + MmttyWd->pSound->m_bpffw = d; + } + } + if( sscanf(AnsiString(lmsDelay->Text).c_str(), "%u", &dd) == 1 ){ //JA7UDE 0428 + if( (dd >= 0) && (dd <= DELAYMAX) ){ + MmttyWd->pSound->m_lms.m_lmsDelay = dd; + } + } + MmttyWd->pSound->m_lms.m_Tap = m_lmsTap; + MmttyWd->pSound->m_lms.m_NotchTap = m_NotchTap; + if( sscanf(AnsiString(lmsMU2->Text).c_str(), "%lf", &d) == 1 ){ //JA7UDE 0428 + MmttyWd->pSound->m_lms.m_lmsMU2 = d; + } + if( sscanf(AnsiString(lmsGM->Text).c_str(), "%lf", &d) == 1 ){ //JA7UDE 0428 + MmttyWd->pSound->m_lms.m_lmsGM = d; + } + MmttyWd->pSound->m_lms.m_lmsInv = lmsInv->Checked; + MmttyWd->pSound->m_lms.m_lmsAGC = lmsAGC->Checked; + MmttyWd->pSound->m_lms.m_bpf = lmsBPF->Checked; + MmttyWd->pSound->m_lms.m_Type = lmsType->Checked; + MmttyWd->pSound->m_lms.m_twoNotch = lmsTwo->Checked; + + MmttyWd->pSound->CalcBPF(); + + if( sscanf(AnsiString(pllVCOGain->Text).c_str(), "%lf", &d) == 1 ){ //JA7UDE 0428 + if( d > 0.0 ) fp->m_pll.SetVcoGain(d); + } + if( sscanf(AnsiString(pllLoopOrder->Text).c_str(), "%u", &dd) == 1 ){ //JA7UDE 0428 + if( (dd > 0) && (dd < 32) ) fp->m_pll.m_loopOrder = dd; + } + if( sscanf(AnsiString(pllLoopFC->Text).c_str(), "%lf", &d) == 1 ){ //JA7UDE 0428 + if( d > 0.0 ) fp->m_pll.m_loopFC = d; + } + if( sscanf(AnsiString(pllOutOrder->Text).c_str(), "%u", &dd) == 1 ){ //JA7UDE 0428 + if( (dd > 0) && (dd < 32) ) fp->m_pll.m_outOrder = dd; + } + if( sscanf(AnsiString(pllOutFC->Text).c_str(), "%lf", &d) == 1 ){ + if( d > 0.0 ) fp->m_pll.m_outFC = d; + } + fp->m_pll.MakeLoopLPF(); + fp->m_pll.MakeOutLPF(); + + fp->m_majority = CheckMajority->Checked; + fp->m_ignoreFream = CheckIgnoreFream->Checked; + + sys.m_ColorRXBack = PCRXBack->Color; + sys.m_ColorRX = PCRXChar->Color; + sys.m_ColorRXTX = PCRXTXChar->Color; + sys.m_ColorINBack = PCINBack->Color; + sys.m_ColorIN = PCINChar->Color; + sys.m_ColorINTX = PCINTx->Color; + sys.m_ColorLow = PCLow->Color; + sys.m_ColorHigh = PCHigh->Color; + sys.m_ColorXY = PCXY->Color; + + mp->m_DiddleWait = GetTBValue(TBDiddleWait->Position, 50, 50) + 0.5; + mp->m_CharWait = GetTBValue(TBCharWait->Position, 50, 50) + 0.5; + mp->m_CharWaitDiddle = WaitDiddle->Checked; + + if( PortName->Text == "NONE" ) TxPort->ItemIndex = 0; + if( sys.m_TxPort != TxPort->ItemIndex ) COMM.change = 1; + sys.m_TxPort = TxPort->ItemIndex; + sys.m_MemWindow = MemWin->Checked; + } + else { + r = FALSE; + } + for( PageIndex = 0; PageIndex < Page->PageCount; PageIndex++ ){ + if( Page->ActivePage == Page->Pages[PageIndex] ) break; + } + for( PageIndexBPF = 0; PageIndexBPF < PageBPF->PageCount; PageIndexBPF++ ){ + if( PageBPF->ActivePage == PageBPF->Pages[PageIndexBPF] ) break; + } + return r; +} +//--------------------------------------------------------------------- +void __fastcall TOptionDlg::HamBtnClick(TObject *Sender) +{ + MarkFreq->Text = DefMarkFreq->Text.c_str(); + ShiftFreq->Text = DefShift->Text.c_str(); + BaudRate->Text = 45.45; + BitLen->ItemIndex = 0; + StopLen->ItemIndex = DefStopBit->ItemIndex + 3; + ParitySel->ItemIndex = 0; + if( sys.m_TxPort ) COMM.change = 1; +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::FontBtnClick(TObject *Sender) +{ + FontDialog->Font->Name = FontName->Text; + FontDialog->Font->Size = m_FontSize; + FontDialog->Font->Charset = BYTE(m_FontCharset); + TFontStyles fs = Code2FontStyle(m_FontStyle); + FontDialog->Font->Style = fs; + NormalWindow(this); + if( FontDialog->Execute() == TRUE ){ + m_FontSize = FontDialog->Font->Size; + FontName->Text = FontDialog->Font->Name; + m_FontCharset = FontDialog->Font->Charset; + fs = FontDialog->Font->Style; + m_FontStyle = FontStyle2Code(fs); + } + TopWindow(this); +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::SBMClick(TObject *Sender) +{ + int n = GetMacroIndex(Sender); + if( n >= 0 ){ + TEditDlgBox *pBox = new TEditDlgBox(this); + pBox->ButtonName->Text = sys.m_UserName[n]; + if( pBox->Execute(sys.m_User[n], sys.m_UserKey[n], &sys.m_UserCol[n], &sys.m_UserTimer[n], 1) == TRUE ){ + if( !pBox->ButtonName->Text.IsEmpty() ){ + sys.m_UserName[n] = pBox->ButtonName->Text; + } + } + delete pBox; + UpdateMacro(); + } +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::SBINClick(int n) +{ + TEditDlgBox *pBox = new TEditDlgBox(this); + pBox->Caption = (Font->Charset != SHIFTJIS_CHARSET)? "Edit Button":"“ü—̓{ƒ^ƒ“•ÒW"; //AA6YQ 1.66 + pBox->ButtonName->Text = sys.m_InBtnName[n]; + if( pBox->Execute(sys.m_InBtn[n], sys.m_InBtnKey[n], &sys.m_InBtnCol[n], NULL, 0) == TRUE ){ + if( !pBox->ButtonName->Text.IsEmpty() ){ + sys.m_InBtnName[n] = pBox->ButtonName->Text; + } + } + delete pBox; + UpdateMacro(); +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::SBIN1Click(TObject *Sender) +{ + SBINClick(0); +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::SBIN2Click(TObject *Sender) +{ + SBINClick(1); +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::SBIN3Click(TObject *Sender) +{ + SBINClick(2); +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::SBIN4Click(TObject *Sender) +{ + SBINClick(3); +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::DemBpfBtnClick(TObject *Sender) +{ + if( DemType->ItemIndex ){ + double HBPF1[TAPMAX+1]; + double HBPF2[TAPMAX+1]; + + double mfq; + double sft; + int tap; + sscanf(AnsiString(MarkFreq->Text).c_str(), "%lf", &mfq); //JA7UDE 0428 + sscanf(AnsiString(ShiftFreq->Text).c_str(), "%lf", &sft); //JA7UDE 0428 + double sfq = mfq + sft; + sscanf(AnsiString(FilterTap->Text).c_str(), "%u", &tap); //JA7UDE 0428 + if( !tap ) tap = 2; + + MakeFilter(HBPF1, tap, ffBPF, DemSamp, mfq-pDem->GetFilWidth(tap), mfq+pDem->GetFilWidth(tap), 60, 1.0); + MakeFilter(HBPF2, tap, ffBPF, DemSamp, sfq-pDem->GetFilWidth(tap), sfq+pDem->GetFilWidth(tap), 60, 1.0); + + TFreqDispDlg *pBox = new TFreqDispDlg(this); + pBox->m_Max = 3000; + pBox->Execute(HBPF1, HBPF2, tap, DemOver+1); + delete pBox; + } + else { + double mfq; + double sft; + double sfq; + double fw; + CIIRTANK iirm; + CIIRTANK iirs; + + sscanf(AnsiString(MarkFreq->Text).c_str(), "%lf", &mfq); //JA7UDE 0428 + sscanf(AnsiString(ShiftFreq->Text).c_str(), "%lf", &sft); //JA7UDE 0428 + sscanf(AnsiString(IIRFW->Text).c_str(), "%lf", &fw); //JA7UDE 0428 + sfq = mfq + sft; + iirm.SetFreq(mfq, DemSamp, fw); + iirs.SetFreq(sfq, DemSamp, fw); + + TFreqDispDlg *pBox = new TFreqDispDlg(this); + pBox->m_Max = 3000; + pBox->Execute(iirm.a0, iirm.b1, iirm.b2, iirs.a0, iirs.b1, iirs.b2, DemOver+1); + delete pBox; + } +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::PreBpfBtnClick(TObject *Sender) +{ + CLMS lms; + CLMS lmsbak; + int nowbpf = MmttyWd->pSound->m_bpf; + int nowlms = MmttyWd->pSound->m_lmsbpf; + int nowtap = MmttyWd->pSound->m_bpftap; + int bpfafc = MmttyWd->pSound->m_bpfafc; + + lmsbak.Copy(MmttyWd->pSound->m_lms); + lms.Copy(MmttyWd->pSound->m_lms); + + int tap; + sscanf(AnsiString(RxBpfTap->Text).c_str(), "%u", &tap); //JA7UDE 0428 + if( !tap ) tap = 2; + + MmttyWd->pSound->m_bpftap = tap; + double mfq; + double sft; + double fw; + sscanf(AnsiString(MarkFreq->Text).c_str(), "%lf", &mfq); //JA7UDE 0428 + sscanf(AnsiString(ShiftFreq->Text).c_str(), "%lf", &sft); //JA7UDE 0428 + double sfq = mfq + sft; + sscanf(AnsiString(RxBpfFW->Text).c_str(), "%lf", &fw); //JA7UDE 0428 + + lms.m_Tap = m_lmsTap; + lms.m_NotchTap = m_NotchTap; + sscanf(AnsiString(lmsDelay->Text).c_str(), "%u", &lms.m_lmsDelay); //JA7UDE 0428 + sscanf(AnsiString(lmsMU2->Text).c_str(), "%lf", &lms.m_lmsMU2); //JA7UDE 0428 + sscanf(AnsiString(lmsGM->Text).c_str(), "%lf", &lms.m_lmsGM); //JA7UDE 0428 + lms.m_lmsAGC = lmsAGC->Checked; + lms.m_Type = lmsType->Checked; + lms.m_bpf = lmsBPF->Checked; + lms.m_twoNotch = lmsTwo->Checked; + lms.m_lmsNotch = (mfq + sfq) / 2; + lms.m_lmsNotch2 = mfq - 80; + + MmttyWd->pSound->m_lms.Copy(lms); + MmttyWd->pSound->m_bpf = 1; + MmttyWd->pSound->m_bpfafc = CheckRXBPFAFC->Checked; + MmttyWd->pSound->CalcBPF(mfq, sfq, fw); + + TFreqDispDlg *pBox = new TFreqDispDlg(this); + pBox->Timer->Enabled = TRUE; + if(PageBPF->ActivePage == TabBPF){ + MmttyWd->pSound->m_bpf = 1; + pBox->Execute(MmttyWd->pSound->HBPF, tap, 1); + } + else { + MmttyWd->pSound->m_bpf = SelBPF->Checked; + MmttyWd->pSound->m_lmsbpf = 1; + if( lms.m_Type ){ + if( lms.m_twoNotch ){ + pBox->Timer->Enabled = FALSE; + pBox->Execute(MmttyWd->pSound->m_lms.H, MmttyWd->pSound->m_lms.GetHBPF(), lms.m_NotchTap, 1); + } + else { + pBox->Execute(MmttyWd->pSound->m_lms.H, lms.m_NotchTap, 1); + } + } + else { + pBox->Execute(MmttyWd->pSound->m_lms.H, lms.m_Tap, 1); + } + } + delete pBox; + + MmttyWd->pSound->m_bpf = nowbpf; + MmttyWd->pSound->m_lmsbpf = nowlms; + MmttyWd->pSound->m_bpftap = nowtap; + MmttyWd->pSound->m_bpfafc = bpfafc; + MmttyWd->pSound->m_lms.Copy(lmsbak); + MmttyWd->pSound->CalcBPF(); +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::DispTxBpfClick(TObject *Sender) +{ + double HBPF[TAPMAX+1]; + + double mfq; + double sft; + int tap; + sscanf(AnsiString(MarkFreq->Text).c_str(), "%lf", &mfq); //JA7UDE 0428 + sscanf(AnsiString(ShiftFreq->Text).c_str(), "%lf", &sft); //JA7UDE 0428 + double sfq = mfq + sft; + sscanf(AnsiString(TxBpfTap->Text).c_str(), "%u", &tap); //JA7UDE 0428 + if( !tap ) tap = 2; + + MakeFilter(HBPF, tap, ffBPF, SampFreq, mfq - 150, sfq + 150, 60, 1.0); + + TFreqDispDlg *pBox = new TFreqDispDlg(this); + pBox->Execute(HBPF, tap, 1); + delete pBox; +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::DispDemLpfClick(TObject *Sender) +{ + int order; + double fc; + if( DemLpf->ItemIndex ){ // IIR + sscanf(AnsiString(SmoozIIR->Text).c_str(), "%lf", &fc); //JA7UDE 0428 + if( (fc >= 20.0) && (fc <= 1500.0) ){ + sscanf(AnsiString(DemLpfOrder->Text).c_str(), "%u", &order); //JA7UDE 0428 + if( (order >= 1) && (order <= 32) ){ + CIIR iir; + iir.MakeIIR(fc, DemSamp, order, 0, 1.0); + TFreqDispDlg *pBox = new TFreqDispDlg(this); + pBox->Execute(&iir, DemOver+1, 200.0); + delete pBox; + } + } + } + else { // FIR + sscanf(AnsiString(SmoozFreq->Text).c_str(), "%lf", &fc); //JA7UDE 0428 + if( (fc >= 20.0) && (fc <= 1500.0) ){ + double HLPF[TAPMAX+1]; + + int n = int((DemSamp) / fc + 0.5); + double d = 1 / double(n); + for( int i = 0; i < n; i++ ){ + HLPF[i] = d; + } + TFreqDispDlg *pBox = new TFreqDispDlg(this); + pBox->Execute(HLPF, n-1, DemOver+1, 200.0); + delete pBox; + } + } +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::DispLoopLPFClick(TObject *Sender) +{ + int order; + double fc; + + sscanf(AnsiString(pllLoopFC->Text).c_str(), "%lf", &fc); //JA7UDE 0428 + if( fc > 0.0 ){ + sscanf(AnsiString(pllLoopOrder->Text).c_str(), "%u", &order); //JA7UDE 0428 + if( (order >= 1) && (order <= 32) ){ + CIIR iir; + iir.MakeIIR(fc, DemSamp, order, 0, 1.0); + TFreqDispDlg *pBox = new TFreqDispDlg(this); + pBox->Execute(&iir, DemOver+1, 800); + delete pBox; + } + } +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::DispOutLPFClick(TObject *Sender) +{ + int order; + double fc; + + sscanf(AnsiString(pllOutFC->Text).c_str(), "%lf", &fc); //JA7UDE 0428 + if( fc > 0.0 ){ + sscanf(AnsiString(pllOutOrder->Text).c_str(), "%u", &order); //JA7UDE 0428 + if( (order >= 1) && (order <= 32) ){ + CIIR iir; + iir.MakeIIR(fc, DemSamp, order, 0, 1.0); + TFreqDispDlg *pBox = new TFreqDispDlg(this); + pBox->Execute(&iir, DemOver+1, 800); + delete pBox; + } + } +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::PCRXBackClick(TObject *Sender) +{ + ColorDialog->Color = PCRXBack->Color; + SetCustomColor(); + NormalWindow(this); + if( ColorDialog->Execute() == TRUE ){ + PCRXBack->Color = ColorDialog->Color; + m_ColorChange = 1; + if( PCRXBack->Color != PCINBack->Color ){ + if( YesNoMB( (Font->Charset != SHIFTJIS_CHARSET) ? "Copy the color to InputWindow ?":"‚±‚ÌF‚ð“ü—͉æ–ʂ̔wŒiF‚É‚à“K‰ž‚µ‚Ü‚·‚©H") == IDYES ){ + PCINBack->Color = ColorDialog->Color; + } + } + } + TopWindow(this); +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::PCRXCharClick(TObject *Sender) +{ + ColorDialog->Color = PCRXChar->Color; + SetCustomColor(); + NormalWindow(this); + if( ColorDialog->Execute() == TRUE ){ + PCRXChar->Color = ColorDialog->Color; + m_ColorChange = 1; + } + TopWindow(this); +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::PCRXTXCharClick(TObject *Sender) +{ + ColorDialog->Color = PCRXTXChar->Color; + SetCustomColor(); + NormalWindow(this); + if( ColorDialog->Execute() == TRUE ){ + PCRXTXChar->Color = ColorDialog->Color; + m_ColorChange = 1; + } + TopWindow(this); +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::PCINBackClick(TObject *Sender) +{ + ColorDialog->Color = PCINBack->Color; + SetCustomColor(); + NormalWindow(this); + if( ColorDialog->Execute() == TRUE ){ + PCINBack->Color = ColorDialog->Color; + m_ColorChange = 1; + } + TopWindow(this); +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::PCINCharClick(TObject *Sender) +{ + ColorDialog->Color = PCINChar->Color; + SetCustomColor(); + NormalWindow(this); + if( ColorDialog->Execute() == TRUE ){ + PCINChar->Color = ColorDialog->Color; + m_ColorChange = 1; + } + TopWindow(this); +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::PCINTxClick(TObject *Sender) +{ + ColorDialog->Color = PCINTx->Color; + SetCustomColor(); + NormalWindow(this); + if( ColorDialog->Execute() == TRUE ){ + PCINTx->Color = ColorDialog->Color; + m_ColorChange = 1; + } + TopWindow(this); +} +//--------------------------------------------------------------------- +void __fastcall TOptionDlg::PCLowClick(TObject *Sender) +{ + ColorDialog->Color = PCLow->Color; + SetCustomColor(); + NormalWindow(this); + if( ColorDialog->Execute() == TRUE ){ + PCLow->Color = ColorDialog->Color; + m_ColorChange = 1; + } + TopWindow(this); +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::PCHighClick(TObject *Sender) +{ + ColorDialog->Color = PCHigh->Color; + SetCustomColor(); + NormalWindow(this); + if( ColorDialog->Execute() == TRUE ){ + PCHigh->Color = ColorDialog->Color; + m_ColorChange = 1; + } + TopWindow(this); +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::SetCustomColor(void) +{ + ColorDialog->CustomColors->Text = ""; + AddCustomColor(PCRXBack->Color); + AddCustomColor(PCRXChar->Color); + AddCustomColor(PCINBack->Color); + AddCustomColor(PCINChar->Color); + AddCustomColor(PCINTx->Color); + AddCustomColor(PCLow->Color); + AddCustomColor(PCHigh->Color); + AddCustomColor(PCXY->Color); +} +//--------------------------------------------------------------------- +void __fastcall TOptionDlg::AddCustomColor(TColor col) +{ + char bf[256]; + + sprintf(bf, "Color%c=%06lX", ColorDialog->CustomColors->Count + 'A', DWORD(col) & 0x00ffffff); + ColorDialog->CustomColors->Add(bf); +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::PortNameChange(TObject *Sender) +{ + if( m_DisEvent ) return; + + UpdateUI(); +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::PCXYClick(TObject *Sender) +{ + ColorDialog->Color = PCXY->Color; + SetCustomColor(); + NormalWindow(this); + if( ColorDialog->Execute() == TRUE ){ + PCXY->Color = ColorDialog->Color; + m_ColorChange = 1; + } + TopWindow(this); +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::WinFontBtnClick(TObject *Sender) +{ + FontDialog->Font->Name = WinFont->Text; + FontDialog->Font->Charset = m_WinFontCharset; + TFontStyles fs = Code2FontStyle(m_WinFontStyle); + FontDialog->Font->Style = fs; + NormalWindow(this); + if( FontDialog->Execute() == TRUE ){ + WinFont->Text = FontDialog->Font->Name; + m_WinFontCharset = FontDialog->Font->Charset; + fs = FontDialog->Font->Style; + m_WinFontStyle = FontStyle2Code(fs); + } + TopWindow(this); +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::BtnFontBtnClick(TObject *Sender) +{ + FontDialog->Font->Name = BtnFont->Text; + FontDialog->Font->Charset = m_BtnFontCharset; + TFontStyles fs = Code2FontStyle(m_BtnFontStyle); + FontDialog->Font->Style = fs; + NormalWindow(this); + if( FontDialog->Execute() == TRUE ){ + BtnFont->Text = FontDialog->Font->Name; + m_BtnFontCharset = FontDialog->Font->Charset; + fs = FontDialog->Font->Style; + m_BtnFontStyle = FontStyle2Code(fs); + } + TopWindow(this); +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::JapaneseBtnClick(TObject *Sender) +{ + WinFont->Text = "‚l‚r ‚oƒSƒVƒbƒN"; + m_WinFontCharset = SHIFTJIS_CHARSET; + BtnFont->Text = "‚l‚r ƒSƒVƒbƒN"; + m_BtnFontCharset = SHIFTJIS_CHARSET; + m_WinFontStyle = 0; + m_BtnFontStyle = 0; + FontName->Text = "‚l‚r ƒSƒVƒbƒN"; + m_FontCharset = SHIFTJIS_CHARSET; + m_FontStyle = 0; + if( sys.m_WinFontCharset != SHIFTJIS_CHARSET ){ + Application->MessageBox(L"MMTTY‚ðÄ‹N“®‚·‚邯“ú–{Œêƒ‚[ƒh‚ɂȂè‚Ü‚·.\r\n(Please restart MMTTY for Japanese mode)", L"MMTTY", MB_ICONINFORMATION|MB_OK); //JA7UDE 0428 + } +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::EnglishBtnClick(TObject *Sender) +{ + WinFont->Text = "Times New Roman"; + m_WinFontCharset = ANSI_CHARSET; + BtnFont->Text = "Courier New"; + m_BtnFontCharset = ANSI_CHARSET; + m_WinFontStyle = 0; + m_BtnFontStyle = 0; + FontName->Text = "Courier New"; + m_FontCharset = ANSI_CHARSET; + m_FontStyle = 0; +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::SBClockAdjClick(TObject *Sender) +{ + double d; + sscanf(AnsiString(EditSamp->Text).c_str(), "%lf", &d); //JA7UDE 0428 + if( (d < 5000.0) || (d > 12500.0) ){ + d = sys.m_SampFreq; + } + + TClockAdjDlg *pBox = new TClockAdjDlg(this); + if( pBox->Execute(MmttyWd->pSound, d) == TRUE ){ + EditSamp->Text = d; + } + delete pBox; +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::DefBtnClick(TObject *Sender) +{ + MarkFreq->Text = 2125; + ShiftFreq->Text = 170; + DefMarkFreq->Text = 2125; + DefShift->Text = 170; + DemType->ItemIndex = 0; + IIRFW->Text = 60; + FilterTap->Text = 72; + Tones->Text = 4; + LimitOver->Checked = 0; + LimitGain->Text = 200; + DemLpf->ItemIndex = 0; + SmoozIIR->Text = 45; + DemLpfOrder->Text = 5; + SmoozFreq->Text = 70; + ATC->Checked = FALSE; + ATCTime->Text = 4; + pllVCOGain->Text = 3; + pllLoopOrder->Text = 2; + pllLoopFC->Text = 250; + pllOutOrder->Text = 4; + pllOutFC->Text = 200; + HamBtnClick(NULL); +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::RadioBtnClick(TObject *Sender) +{ + // ƒ‰ƒWƒIƒRƒ“ƒgƒ[ƒ‹ + TRADIOSetDlg *pBox = new TRADIOSetDlg(this); + + if( (PortName->Text != "NONE") && !strcmp(AnsiString(PortName->Text).c_str(), RADIO.StrPort) ){ //JA7UDE 0428 + strcpy(RADIO.StrPort, "NONE"); + RADIO.change = 1; + } + if( pBox->Execute() == TRUE ){ + if( (PortName->Text != "NONE") && !strcmp(AnsiString(PortName->Text).c_str(), RADIO.StrPort) ){ //JA7UDE 0428 + PortName->Text = "NONE"; + } + } + delete pBox; +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::BaudRateChange(TObject *Sender) +{ + if( m_DisEvent ) return; + + if( sys.m_TxPort ) COMM.change = 1; +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::BitLenClick(TObject *Sender) +{ + if( m_DisEvent ) return; + + if( sys.m_TxPort ) COMM.change = 1; +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::TxdJobClick(TObject *Sender) +{ + TTxdDlgBox *pBox = new TTxdDlgBox(this); + m_TxdJob = pBox->Execute(m_TxdJob); + delete pBox; +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::lmsTapChange(TObject *Sender) +{ + if( m_DisEvent ) return; + + int dd; + if( sscanf(AnsiString(lmsTap->Text).c_str(), "%u", &dd) == 1 ){ //JA7UDE 0428 + if( (dd >= 0) && (dd <= 512) ){ + if( lmsType->Checked ){ + m_NotchTap = dd; + } + else { + m_lmsTap = dd; + } + } + } +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::SBHelpClick(TObject *Sender) +{ +/* +Demodulator: demodulatortab.htm +AFC/ATC/PLL: afcatcplltab.htm +Decode: decodetab.htm +TX: txtab.htm +Font/Window: fontwindowtab.htm +Misc: misctab.htm +SoundCard: soundtab.htm +*/ + LPCSTR pContext; + if( Page->ActivePage == TabTx ){ + pContext = "txtab.htm"; + } + else if( Page->ActivePage == TabDem2 ){ + pContext = "afcatcplltab.htm"; + } + else if( Page->ActivePage == TabPara ){ + pContext = "decodetab.htm"; + } + else if( Page->ActivePage == TabFont ){ + pContext = "fontwindowtab.htm"; + } + else if( Page->ActivePage == TabMisc ){ + pContext = "misctab.htm"; + } + else if( Page->ActivePage == TabSound ){ + pContext = "soundtab.htm"; + } + else { + pContext = "demodulatortab.htm"; + } + ShowHtmlHelp(pContext); +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::PortNameDropDown(TObject *Sender) +{ + if( m_DisEvent ) return; + + if( !m_MMList.IsQuery() ){ + m_MMList.QueryList("FSK"); + for( int i = 0; i < m_MMList.GetCount(); i++ ){ + PortName->Items->Add(m_MMList.GetItemName(i)); + } + PortName->DropDownCount = PortName->Items->Count; + } +} +//--------------------------------------------------------------------------- + +void __fastcall TOptionDlg::DevNoDropDown(TObject *Sender) +{ + +//AA6YQ 1.66B - handled in TOptionDlg::TOptionDlg +/* + if( m_DisEvent ) return; + + if( !m_MMListW.IsQuery() ){ + m_MMListW.QueryList("MMW"); + for( int i = 0; i < m_MMListW.GetCount(); i++ ){ + DevNo->Items->Add(m_MMListW.GetItemName(i)); + } + DevNo->DropDownCount = m_MMListW.GetCount() + 5; + } + +*/ +} +//--------------------------------------------------------------------------- + +// Value = 5148 Celeron 1.06GHz 2003/10/22 +void __fastcall TOptionDlg::DemBpfBtnMouseDown(TObject *Sender, + TMouseButton Button, TShiftState Shift, int X, int Y) +{ + if( Button == mbRight ){ + CWaitCursor w; + TSound *pSound = MmttyWd->pSound; + if( pSound->m_ReqSpeedTest ) return; + pSound->m_ReqSpeedTest = 1; + while(pSound->m_ReqSpeedTest) ::Sleep(100); + InfoMB("%u", pSound->m_SpeedValue); + } +} +//--------------------------------------------------------------------------- + +void __fastcall TOptionDlg::DevOutNoDropDown(TObject *Sender) +{ + +//AA6YQ 1.66B - handled in TOptionDlg::TOptionDlg +/* + if( m_DisEvent ) return; + + if( !m_MMListW.IsQuery() ){ + m_MMListW.QueryList("MMW"); + for( int i = 0; i < m_MMListW.GetCount(); i++ ){ + DevOutNo->Items->Add(m_MMListW.GetItemName(i)); + } + DevOutNo->DropDownCount = m_MMListW.GetCount() + 5; + } + + */ +} +//--------------------------------------------------------------------------- + +void __fastcall TOptionDlg::InputSoundcardsClick(TObject *Sender) +{ + //AA6YQ 1.66 + DevNo->ItemIndex = InputSoundcards->ItemIndex+1; +} +//--------------------------------------------------------------------------- + +void __fastcall TOptionDlg::DevNoClick(TObject *Sender) +{ + //AA6YQ 1.66 + if (IsSoundcard (AnsiString(DevNo->Text).c_str())) { //JA7UDE 0428 + InputSoundcards->ItemIndex = atoi(AnsiString(DevNo->Text).c_str()); //AA6YQ 1.66 //JA7UDE 0428 + } + else { + InputSoundcards->ItemIndex =-1; + } +} +//--------------------------------------------------------------------------- + +//--------------------------------------------------------------------------- + +void __fastcall TOptionDlg::OutputSoundcardsClick(TObject *Sender) +{ + //AA6YQ 1.66 + DevOutNo->ItemIndex = OutputSoundcards->ItemIndex+1; +} +//--------------------------------------------------------------------------- + +void __fastcall TOptionDlg::DevOutNoClick(TObject *Sender) +{ + //AA6YQ 1.66 + if (IsSoundcard (AnsiString(DevOutNo->Text).c_str())) { //JA7UDE 0428 + OutputSoundcards->ItemIndex = atoi(AnsiString(DevOutNo->Text).c_str()); //AA6YQ 1.66 //JA7UDE 0428 + } + else { + OutputSoundcards->ItemIndex =-1; + } +} +//--------------------------------------------------------------------------- +void __fastcall TOptionDlg::SBAA6YQClick(TObject *Sender) +{ + TFreqDispDlg *pBox = new TFreqDispDlg(this); + pBox->Timer->Enabled = TRUE; + pBox->m_Max = 3000; + pDem->m_AA6YQ.Create(); + CFIR2 *pBPF = &pDem->m_AA6YQ.m_BPF; + CFIR2 *pBEF = &pDem->m_AA6YQ.m_BEF; + pBox->Execute(pBPF->GetHP(), pBPF->GetTap(), pBEF->GetHP(), pBEF->GetTap(), 1); + delete pBox; +} +//--------------------------------------------------------------------------- + diff --git a/Option.dfm b/Option.dfm new file mode 100644 index 0000000..01f7a19 Binary files /dev/null and b/Option.dfm differ diff --git a/Option.h b/Option.h new file mode 100644 index 0000000..283dd92 --- /dev/null +++ b/Option.h @@ -0,0 +1,393 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//---------------------------------------------------------------------------- +#ifndef OptionH +#define OptionH +//---------------------------------------------------------------------------- +//JA7UDE 0427 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include "MMLink.h" +#include "Rtty.h" +//---------------------------------------------------------------------------- +class TOptionDlg : public TForm +{ +__published: + TButton *OKBtn; + TButton *CancelBtn; + TPageControl *Page; + TTabSheet *TabDem; + TTabSheet *TabPara; + TRadioGroup *BitLen; + TRadioGroup *StopLen; + TRadioGroup *ParitySel; + TComboBox *BaudRate; + TLabel *LBaudRate; + TGroupBox *GrpDisc; + TLabel *L6; + TLabel *L7; + TLabel *LTAPFW; + TComboBox *MarkFreq; + TComboBox *ShiftFreq; + TComboBox *FilterTap; + TLabel *Label9; + TLabel *Label10; + TGroupBox *GrpLPF; + TLabel *LLPF; + TComboBox *SmoozFreq; + TLabel *Label12; + TButton *HamBtn; + TCheckBox *CheckInv; + TTabSheet *TabTx; + TGroupBox *GPTT; + TComboBox *PortName; + TLabel *L13; + TCheckBox *PttInv; + TGroupBox *GB5; + TLabel *L14; + TEdit *EditCall; + TGroupBox *GB6; + TCheckBox *CheckTXUOS; + TTabSheet *TabFont; + TEdit *FontName; + TLabel *LFont; + TGroupBox *GrpDispAdj; + TLabel *LW; + TEdit *FontAdjX; + TEdit *FontAdjY; + TLabel *LH; + TFontDialog *FontDialog; + TButton *FontBtn; + TCheckBox *CheckZero; + TCheckBox *CheckDblSft; + TGroupBox *GB9; + TGroupBox *GB10; + TCheckBox *CheckTXBPF; + TLabel *L25; + TComboBox *TxBpfTap; + TTrackBar *TBOutLvl; + TLabel *LOutLvl; + TSpeedButton *SBM1; + TSpeedButton *SBM2; + TSpeedButton *SBM3; + TSpeedButton *SBM4; + TSpeedButton *SBM8; + TSpeedButton *SBM7; + TSpeedButton *SBM6; + TSpeedButton *SBM5; + TSpeedButton *SBM9; + TSpeedButton *SBM10; + TSpeedButton *SBM11; + TSpeedButton *SBM12; + TSpeedButton *SBM13; + TSpeedButton *SBM14; + TSpeedButton *SBM15; + TSpeedButton *SBM16; + TGroupBox *GrpInBtn; + TSpeedButton *SBIN1; + TSpeedButton *SBIN2; + TSpeedButton *SBIN3; + TSpeedButton *SBIN4; + TTabSheet *TabMisc; + TCheckBox *CheckTXLPF; + TComboBox *TxLpfFreq; + TLabel *Label28; + TLabel *L29; + TGroupBox *GrpFilter; + TButton *DemBpfBtn; + TButton *PreBpfBtn; + TSpeedButton *DispTxBpf; + TCheckBox *CheckMajority; + TCheckBox *CheckIgnoreFream; + TGroupBox *GrpRx; + TLabel *LRXB; + TLabel *LRXC; + TPanel *PCRXBack; + TPanel *PCRXChar; + TColorDialog *ColorDialog; + TGroupBox *GrpIn; + TLabel *LINB; + TLabel *LINC; + TPanel *PCINBack; + TPanel *PCINChar; + TLabel *LINS; + TPanel *PCINTx; + TCheckBox *CheckPalette; + TPanel *PCLow; + TPanel *PCHigh; + TLabel *Label37; + TLabel *Label38; + TRadioGroup *TxPort; + TPageControl *PageBPF; + TTabSheet *TabBPF; + TTabSheet *TabLMS; + TLabel *LDelay; + TComboBox *lmsDelay; + TLabel *LMU2; + TLabel *LGM; + TComboBox *lmsMU2; + TComboBox *lmsGM; + TCheckBox *lmsAGC; + TCheckBox *CheckRXBPFAFC; + TLabel *LFW; + TComboBox *RxBpfFW; + TCheckBox *SelLMS; + TCheckBox *SelBPF; + TLabel *L31; + TComboBox *lmsTap; + TLabel *L30; + TComboBox *RxBpfTap; + TLabel *LCharW; + TTrackBar *TBCharWait; + TLabel *Label40; + TTrackBar *TBDiddleWait; + TCheckBox *lmsBPF; + TComboBox *IIRFW; + TLabel *LHZ; + TTabSheet *TabDem2; + TGroupBox *GB7; + TLabel *Label16; + TLabel *L17; + TLabel *L18; + TCheckBox *CheckAFC; + TGroupBox *GrpLimit; + TLabel *L8; + TComboBox *LimitGain; + TComboBox *AFCTime; + TComboBox *AFCSQ; + TComboBox *AFCSweep; + TRadioGroup *DemType; + TCheckBox *lmsInv; + TGroupBox *GB1; + TLabel *Label1; + TGroupBox *GroupBox17; + TLabel *LLoopOrder; + TComboBox *pllVCOGain; + TComboBox *pllLoopOrder; + TLabel *L3; + TComboBox *pllLoopFC; + TLabel *Label4; + TGroupBox *GroupBox18; + TLabel *LOutOrder; + TLabel *L44; + TLabel *Label45; + TComboBox *pllOutOrder; + TComboBox *pllOutFC; + TRadioGroup *DefStopBit; + TGroupBox *GSFont; + TEdit *WinFont; + TButton *WinFontBtn; + TLabel *L46; + TLabel *L47; + TEdit *BtnFont; + TButton *BtnFontBtn; + TButton *JapaneseBtn; + TButton *EnglishBtn; + TComboBox *FontAdj; + TComboBox *BtnFontAdj; + TGroupBox *GB2; + TPanel *PCXY; + TCheckBox *XYInv; + TCheckBox *WaitDiddle; + TRadioGroup *FixShift; + TRadioGroup *DemLpf; + TLabel *LSmooz; + TComboBox *DemLpfOrder; + TSpeedButton *DispDemLpf; + TComboBox *SmoozIIR; + TSpeedButton *DispLoopLPF; + TSpeedButton *DispOutLPF; + TCheckBox *LimitOver; + TGroupBox *GrpCard; + TLabel *Label27; + TComboBox *FifoRX; + TRadioGroup *SoundPriority; + TGroupBox *GB3; + TSpeedButton *SBClockAdj; + TLabel *Label5; + TGroupBox *GB8; + TRadioGroup *DiddleSel; + TCheckBox *RandomDiddle; + TCheckBox *WaitTimer; + TCheckBox *MacroImm; + TCheckBox *TxDisRev; + TButton *DefBtn; + TGroupBox *GrpATC; + TCheckBox *ATC; + TComboBox *ATCTime; + TLabel *L2; + TCheckBox *MemWin; + TButton *RadioBtn; + TComboBox *EditSamp; + TCheckBox *lmsType; + TCheckBox *lmsTwo; + TLabel *LRXS; + TPanel *PCRXTXChar; + TButton *TxdJob; + TRadioGroup *Source; + TCheckBox *TxFixShift; + TSpeedButton *SBHelp; + TCheckBox *LimitAGC; + TComboBox *FifoTX; + TLabel *L15; + TRadioGroup *RGLoop; + TLabel *L16; + TEdit *TxOff; + TLabel *L1; + TGroupBox *GB4; + TRadioGroup *RGC; + TGroupBox *GroupBox1; + TComboBox *DevNo; + TComboBox *DevOutNo; + TLabel *Label2; + TLabel *Label3; + TTabSheet *TabSound; + TRadioGroup *InputSoundcards; + TRadioGroup *OutputSoundcards; + TComboBox *Tones; + TGroupBox *GB20; + TEdit *DefMarkFreq; + TEdit *DefShift; + TCheckBox *CBFix45; + TCheckBox *CBAA6YQ; + TSpeedButton *SBAA6YQ; + void __fastcall HamBtnClick(TObject *Sender); + + + + + + + + + void __fastcall FontBtnClick(TObject *Sender); + void __fastcall SBMClick(TObject *Sender); + void __fastcall SBIN1Click(TObject *Sender); + void __fastcall SBIN2Click(TObject *Sender); + void __fastcall SBIN3Click(TObject *Sender); + void __fastcall SBIN4Click(TObject *Sender); + + void __fastcall DemBpfBtnClick(TObject *Sender); + void __fastcall PreBpfBtnClick(TObject *Sender); + void __fastcall DispTxBpfClick(TObject *Sender); + void __fastcall PCRXBackClick(TObject *Sender); + void __fastcall PCRXCharClick(TObject *Sender); + void __fastcall PCINBackClick(TObject *Sender); + void __fastcall PCINCharClick(TObject *Sender); + void __fastcall PCINTxClick(TObject *Sender); + void __fastcall PCLowClick(TObject *Sender); + void __fastcall PCHighClick(TObject *Sender); + void __fastcall PortNameChange(TObject *Sender); + + void __fastcall PCXYClick(TObject *Sender); + + + void __fastcall WinFontBtnClick(TObject *Sender); + void __fastcall BtnFontBtnClick(TObject *Sender); + void __fastcall JapaneseBtnClick(TObject *Sender); + void __fastcall EnglishBtnClick(TObject *Sender); + + + + + void __fastcall DispDemLpfClick(TObject *Sender); + void __fastcall DispLoopLPFClick(TObject *Sender); + void __fastcall DispOutLPFClick(TObject *Sender); + void __fastcall SBClockAdjClick(TObject *Sender); + void __fastcall DefBtnClick(TObject *Sender); + void __fastcall RadioBtnClick(TObject *Sender); + + + void __fastcall BaudRateChange(TObject *Sender); + + void __fastcall BitLenClick(TObject *Sender); + void __fastcall PCRXTXCharClick(TObject *Sender); + + void __fastcall TxdJobClick(TObject *Sender); + void __fastcall lmsTapChange(TObject *Sender); + void __fastcall SBHelpClick(TObject *Sender); + + void __fastcall PortNameDropDown(TObject *Sender); + void __fastcall DevNoDropDown(TObject *Sender); + + void __fastcall DemBpfBtnMouseDown(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y); + + + void __fastcall DevOutNoDropDown(TObject *Sender); + + void __fastcall InputSoundcardsClick(TObject *Sender); + void __fastcall OutputSoundcardsClick(TObject *Sender); + + void __fastcall DevNoClick(TObject *Sender); + void __fastcall DevOutNoClick(TObject *Sender); + + void __fastcall SBAA6YQClick(TObject *Sender); +private: + int m_FontCharset; + int m_FontStyle; + int m_FontSize; + + int m_DisEvent; + + CFSKDEM *pDem; + + TSpeedButton *__fastcall GetSB(int n); + int __fastcall GetMacroIndex(TObject *Sender); + void __fastcall UpdateUI(void); + void __fastcall UpdateMacro(void); + void __fastcall SBINClick(int n); + void __fastcall SetCustomColor(void); + void __fastcall AddCustomColor(TColor col); + + int __fastcall IsSoundcard(LPCSTR t); + + BYTE m_WinFontCharset; + BYTE m_BtnFontCharset; + int m_WinFontStyle; + int m_BtnFontStyle; + + int m_TxdJob; + double m_lmsTap; + double m_NotchTap; + CMMList m_MMList; + CMMList m_MMListW; +public: + virtual __fastcall TOptionDlg(TComponent* AOwner); + + int __fastcall Execute(CFSKDEM *fp, CFSKMOD *mp); + int m_ColorChange; +}; +//---------------------------------------------------------------------------- +//extern TAgcSetDlg *AgcSetDlg; +extern int PageIndex; +//---------------------------------------------------------------------------- +#endif diff --git a/PlayDlg.cpp b/PlayDlg.cpp new file mode 100644 index 0000000..0a853e2 --- /dev/null +++ b/PlayDlg.cpp @@ -0,0 +1,102 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "PlayDlg.h" +//--------------------------------------------------------------------- +#pragma resource "*.dfm" +//TPlayDlgBox *PlayDlgBox; +//--------------------------------------------------------------------- +__fastcall TPlayDlgBox::TPlayDlgBox(TComponent* AOwner) + : TForm(AOwner) +{ + FormStyle = ((TForm *)AOwner)->FormStyle; + Font->Name = ((TForm *)AOwner)->Font->Name; + Font->Charset = ((TForm *)AOwner)->Font->Charset; + + pWave = NULL; + m_DisEvent = 0; + + if( Font->Charset != SHIFTJIS_CHARSET ){ + Caption = "Adjust Play position"; + OKBtn->Caption = "Hide"; + StopBtn->Caption = "Stop"; + LRec->Caption = "RecTime"; + LNow->Caption = "NowTime"; + } +} +//--------------------------------------------------------------------- +void __fastcall TPlayDlgBox::UpdateItem(void) +{ + char bf[32]; + + sprintf(bf, "%u[s]", int(pWave->m_length * 0.5 / SampFreq)); + LTime->Caption = bf; + sprintf(bf, "%u[s]", int(pWave->GetPos() * 0.5 / SampFreq)); + LPos->Caption = bf; + m_DisEvent++; + ScrollBar->Max = int(pWave->m_length * 0.5 / SampFreq); + ScrollBar->Position = int(pWave->GetPos() * 0.5 / SampFreq); + CheckPause->Checked = pWave->m_pause; + m_DisEvent--; +} +//--------------------------------------------------------------------- +void __fastcall TPlayDlgBox::Execute(CWaveFile *wp) +{ + pWave = wp; + pWave->m_autopause = 1; + LName->Caption = pWave->m_FileName; + UpdateItem(); + ShowModal(); + pWave->m_autopause = 0; +} +//--------------------------------------------------------------------- +void __fastcall TPlayDlgBox::TimerTimer(TObject *Sender) +{ + UpdateItem(); +} +//--------------------------------------------------------------------------- +void __fastcall TPlayDlgBox::ScrollBarChange(TObject *Sender) +{ + if( m_DisEvent ) return; + + int pos = ScrollBar->Position; + pWave->Seek(pos * SampFreq*2); + if( !CheckPause->Checked ) pWave->m_pause = 0; + char bf[32]; + sprintf(bf, "%u[s]", pos); + LPos->Caption = bf; +} +//--------------------------------------------------------------------------- +void __fastcall TPlayDlgBox::CheckPauseClick(TObject *Sender) +{ + if( m_DisEvent ) return; + + pWave->m_pause = CheckPause->Checked; +} +//--------------------------------------------------------------------------- +void __fastcall TPlayDlgBox::StopBtnClick(TObject *Sender) +{ + pWave->FileClose(); + ModalResult = mrOk; +} +//--------------------------------------------------------------------------- diff --git a/PlayDlg.dfm b/PlayDlg.dfm new file mode 100644 index 0000000..562b357 Binary files /dev/null and b/PlayDlg.dfm differ diff --git a/PlayDlg.h b/PlayDlg.h new file mode 100644 index 0000000..6a6b623 --- /dev/null +++ b/PlayDlg.h @@ -0,0 +1,69 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//---------------------------------------------------------------------------- +#ifndef PlayDlgH +#define PlayDlgH +//---------------------------------------------------------------------------- +//JA7UDE 0427 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Sound.h" +//---------------------------------------------------------------------------- +class TPlayDlgBox : public TForm +{ +__published: + TButton *OKBtn; + TScrollBar *ScrollBar; + TLabel *LRec; + TLabel *LNow; + TLabel *LTime; + TLabel *LPos; + TTimer *Timer; + TLabel *LName; + TCheckBox *CheckPause; + TButton *StopBtn; + void __fastcall TimerTimer(TObject *Sender); + void __fastcall ScrollBarChange(TObject *Sender); + void __fastcall CheckPauseClick(TObject *Sender); + void __fastcall StopBtnClick(TObject *Sender); +private: + CWaveFile *pWave; + + int m_DisEvent; +public: + virtual __fastcall TPlayDlgBox(TComponent* AOwner); + + void __fastcall Execute(CWaveFile *wp); + void __fastcall UpdateItem(void); + +}; +//---------------------------------------------------------------------------- +//extern TPlayDlgBox *PlayDlgBox; +//---------------------------------------------------------------------------- +#endif diff --git a/QsoDlg.cpp b/QsoDlg.cpp new file mode 100644 index 0000000..754ac11 --- /dev/null +++ b/QsoDlg.cpp @@ -0,0 +1,548 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "QsoDlg.h" +#include "Country.h" +#include "MmcgDlg.h" +#include "Main.h" +#include "TextEdit.h" +//--------------------------------------------------------------------- +#pragma resource "*.dfm" +//TQSODlgBox *QSODlgBox; +//--------------------------------------------------------------------- +__fastcall TQSODlgBox::TQSODlgBox(TComponent* AOwner) + : TForm(AOwner) +{ + FormStyle = ((TForm *)AOwner)->FormStyle; + Font->Name = ((TForm *)AOwner)->Font->Name; + Font->Charset = ((TForm *)AOwner)->Font->Charset; + LStat->Font->Name = ((TForm *)AOwner)->Font->Name; + LStat->Font->Charset = ((TForm *)AOwner)->Font->Charset; + m_fp = NULL; + + EditHis->Items->Assign(MmttyWd->HisRST->Items); + EditMy->Items->Assign(MmttyWd->MyRST->Items); + if( Font->Charset != SHIFTJIS_CHARSET ){ + Grid->Font->Name = ((TForm *)AOwner)->Font->Name; + Grid->Font->Charset = ((TForm *)AOwner)->Font->Charset; + Caption = "QSO Data"; + CancelBtn->Caption = "Close"; + OKBtn->Caption = "Write"; + RefBtn->Caption = "ReceiveWindow"; + } + switch(Log.m_LogSet.m_TimeZone){ + case 'I': + if( lcid == LANG_KOREAN ){ + LTimeZone->Caption = "KST"; + } + else { + LTimeZone->Caption = "JST"; + } + break; + default: + LTimeZone->Caption = "UTC"; + break; + } + if( Log.m_LogSet.m_DateType & 1 ){ + Grid->ColWidths[0] = (Grid->ColWidths[0] * 10) / 8; + } + m_EditFlag = 0; +} + +void __fastcall TQSODlgBox::UpdateBtn(void) +{ + OKBtn->Enabled = m_EditFlag; +} + +void __fastcall TQSODlgBox::SetCountry(void) +{ + m_Country = ""; + + if( !Cty.IsData() ) return; + LPCSTR p = ClipCC(m_fp->GetText()); + if( !(*p) ) return; + + SYSTEMTIME now; + GetUTC(&now); + + WORD tim = WORD((now.wHour * 60 + now.wMinute) * 30 + now.wSecond/2); + + int n; + if( (n = Cty.GetNoP(p))!=0 ){ + CTL *cp = Cty.GetCTL(n-1); + char bf[256]; + char tbf[5]; + tbf[0] = 0; + if( cp->TD != NULL ){ + tim = AdjustRolTimeUTC(tim, *cp->TD); + if( tim ){ + tim /= WORD(30); + sprintf(tbf, "%02u%02u%c", tim / 60, tim % 60, *cp->TD); + } + } + sprintf(bf, " %s/%s %s %s", + (cp->Name!=NULL) ? cp->Name : "", + (cp->Cont!=NULL) ? cp->Cont : "", + tbf, + (cp->QTH!=NULL) ? cp->QTH : "" + ); + m_Country = bf; + } +} + +int __fastcall TQSODlgBox::Execute(CLogFind *fp, SDMMLOG *sp, int n) +{ + m_fp = fp; + UpdateTextData(sp, n); + Grid->RowCount = fp->GetCount() ? fp->GetCount() + 1 : 2; +// Grid->TopRow = 1; + Grid->Row = 1; + Grid->Enabled = FALSE; + for( int i = 0; i < fp->GetCount(); i++ ){ + if( n == fp->pFindTbl[i] ){ + Grid->Enabled = TRUE; + Grid->Row = i + 1; + Grid->TopRow = (i > 4) ? Grid->Row - 4 : 1; + break; + } + } + SetCountry(); + char bf[512]; + strcpy(bf, ( Font->Charset != SHIFTJIS_CHARSET ) ? "Initial Data":"QSOƒf[ƒ^‰Šú’l"); + if( Grid->Enabled == TRUE ){ + if( sp->btime ){ + sprintf(bf, "[%s]", fp->GetText()); + strcat(bf, m_Country.c_str()); + } + else if( *fp->GetText() ){ + sprintf(bf, "[%s]", fp->GetText()); + strcat(bf, m_Country.c_str()); + } + } + Caption = bf; + UpdateStat(); + m_EditFlag = 0; + UpdateBtn(); + m_CurNo = n; + if( !sys.m_QSOGridWidths.IsEmpty() ){ + SetGridWidths(Grid, sys.m_QSOGridWidths.c_str()); + } + if( ShowModal() == IDOK ){ + if( m_EditFlag ){ + UpdateCurData(&m_sd); + Log.PutData(&m_sd, m_CurNo); + } + } + GetGridWidths(sys.m_QSOGridWidths, Grid); + if( m_CurNo == n ){ + memcpy(sp, &m_sd, sizeof(SDMMLOG)); + } + else { + Log.GetData(sp, n); + } + return TRUE; +} + +int __fastcall TQSODlgBox::ShowFind(CLogFind *fp) +{ + m_fp = fp; + if( fp->GetCount() ){ + Log.GetData(&m_sd, fp->pFindTbl[0]); + m_CurNo = fp->pFindTbl[0]; + } + else { + memset(&m_sd, 0, sizeof(SDMMLOG)); + OKBtn->Enabled = FALSE; + } + SetCountry(); + char bf[512]; + UpdateTextData(&m_sd, fp->pFindTbl[0]); + Grid->RowCount = fp->GetCount() ? fp->GetCount() + 1 : 2; + Grid->TopRow = 1; + Grid->Row = 1; + sprintf(bf, "[%s]", fp->GetText()); + strcat(bf, m_Country.c_str()); + Caption = bf; + UpdateStat(); + m_EditFlag = 0; + UpdateBtn(); + if( ShowModal() == IDOK ){ + if( m_EditFlag ){ + UpdateCurData(&m_sd); + Log.PutData(&m_sd, m_CurNo); + } + return TRUE; + } + else { + return FALSE; + } +} + +void __fastcall TQSODlgBox::UpdateTextData(SDMMLOG *sp, int n) +{ + m_CurNo = n; + memcpy(&m_sd, sp, sizeof(SDMMLOG)); + UpdateTextData(&m_sd); +} + +void __fastcall TQSODlgBox::UpdateTextData(SDMMLOG *sp) +{ + SDMMLOG sd; + memcpy(&sd, sp, sizeof(SDMMLOG)); + if( Log.m_LogSet.m_TimeZone != 'I' ){ + JSTtoUTC(&sd); + } + EditDate->Text = Log.GetDateString(&sd); + EditBgn->Text = Log.GetTimeString(sd.btime); + EditEnd->Text = Log.GetTimeString(sd.etime); + EditCall->Text = sp->call; + EditName->Text = sp->name; + EditQTH->Text = sp->qth; + EditHis->Text = sp->ur; + EditMy->Text = sp->my; + EditBand->Text = Log.GetFreqString(sp->band, sp->fq); + EditMode->Text = Log.GetModeString(sp->mode); + EditRem->Text = sp->rem; + EditQSL->Text = sp->qsl; + if( sp->env ){ + EditEnv->Text = sp->env; + } + else { + EditEnv->Text = ""; + } + EditOpt1->Text = Log.GetOptStr(0, sp); + EditOpt2->Text = Log.GetOptStr(1, sp); + EditUsr1->Text = Log.GetOptStr(2, sp); + EditUsr2->Text = Log.GetOptStr(3, sp); + EditS->Text = sp->send; + EditR->Text = sp->recv; + EditM->Text = sp->cq; + EditPow->Text = sp->pow; + m_EditFlag = 0; + UpdateBtn(); +} + +void __fastcall TQSODlgBox::UpdateCurData(SDMMLOG *sp) +{ + int y, m, d, h; + + switch(Log.m_LogSet.m_DateType){ + case 2: // dd-mm-yy + case 3: // dd-mm-yyyy + if( sscanf(AnsiString(EditDate->Text).c_str(), "%u.%u.%u", &d, &m, &y) == 3 ){ //JA7UDE 0428 + sp->year = BYTE(y % 100); + sp->date = WORD(m * 100 + d); + } + break; + case 4: // mm-dd-yy + case 5: // mm-dd-yyyy + if( sscanf(AnsiString(EditDate->Text).c_str(), "%u.%u.%u", &m, &d, &y) == 3 ){ //JA7UDE 0428 + sp->year = BYTE(y % 100); + sp->date = WORD(m * 100 + d); + } + break; + default: // yy-mm-dd, yyyy-mm-dd + if( sscanf(AnsiString(EditDate->Text).c_str(), "%u.%u.%u", &y, &m, &d) == 3 ){ //JA7UDE 0428 + sp->year = BYTE(y % 100); + sp->date = WORD(m * 100 + d); + } + break; + } + if( !EditBgn->Text.IsEmpty() ){ + if( sscanf(AnsiString(EditBgn->Text).c_str(), "%u", &d) == 1){ //JA7UDE 0428 + h = d / 100; + m = d % 100; + if( (sp->btime / 30) != (h * 60 + m) ){ + sp->btime = WORD((h * 60 + m) * 30 + 1); + } + } + } + if( !EditEnd->Text.IsEmpty() ){ + if( sscanf(AnsiString(EditEnd->Text).c_str(), "%u", &d) == 1){ //JA7UDE 0428 + h = d / 100; + m = d % 100; + if( (sp->etime / 30) != (h * 60 + m) ){ + sp->etime = WORD((h * 60 + m) * 30 + 1); + } + } + } + StrCopy(sp->call, AnsiString(EditCall->Text).c_str(), MLCALL); //JA7UDE 0428 + jstrupr(sp->call); + StrCopy(sp->name, AnsiString(EditName->Text).c_str(), MLNAME); //JA7UDE 0428 + if( Log.m_LogSet.m_UpperName ) jstrupr(sp->name); + StrCopy(sp->qth, AnsiString(EditQTH->Text).c_str(), MLQTH); //JA7UDE 0428 + if( Log.m_LogSet.m_UpperQTH ) jstrupr(sp->qth); + StrCopy(sp->ur, AnsiString(EditHis->Text).c_str(), MLRST); //JA7UDE 0428 + jstrupr(sp->ur); + StrCopy(sp->my, AnsiString(EditMy->Text).c_str(), MLRST); //JA7UDE 0428 + jstrupr(sp->my); + Log.SetFreq(sp, AnsiString(EditBand->Text).c_str()); //JA7UDE 0428 + Log.SetMode(sp, AnsiString(EditMode->Text).c_str()); //JA7UDE 0428 + StrCopy(sp->rem, AnsiString(EditRem->Text).c_str(), MLREM); //JA7UDE 0428 + if( Log.m_LogSet.m_UpperREM ) jstrupr(sp->rem); + StrCopy(sp->qsl, AnsiString(EditQSL->Text).c_str(), MLQSL); //JA7UDE 0428 + if( Log.m_LogSet.m_UpperQSL ) jstrupr(sp->qsl); + if( sscanf(AnsiString(EditEnv->Text).c_str(), "%u", &d) == 1){ //JA7UDE 0428 + sp->env = WORD(d); + } + else { + sp->env = 0; + } + Log.SetOptStr(0, sp, AnsiString(EditOpt1->Text).c_str()); //JA7UDE 0428 + Log.SetOptStr(1, sp, AnsiString(EditOpt2->Text).c_str()); //JA7UDE 0428 + Log.SetOptStr(2, sp, AnsiString(EditUsr1->Text).c_str()); //JA7UDE 0428 + Log.SetOptStr(3, sp, AnsiString(EditUsr2->Text).c_str()); //JA7UDE 0428 + sp->send = *EditS->Text.c_str(); //JA7UDE 0428 + sp->recv = *EditR->Text.c_str(); //JA7UDE 0428 + sp->cq = *EditM->Text.c_str(); //JA7UDE 0428 + sp->cq = char(toupper(sp->cq)); + StrCopy(sp->pow, AnsiString(EditPow->Text).c_str(), MLPOW); //JA7UDE 0428 + jstrupr(sp->pow); + if( Log.m_LogSet.m_TimeZone != 'I' ){ + UTCtoJST(sp); + } +} +//--------------------------------------------------------------------- +void __fastcall TQSODlgBox::UpdateStat(void) +{ + char bf[256]; + + int cmp1max = m_fp->m_FindCmp1Max; + int cmp2max = m_fp->m_FindCmp2Max; + if( cmp2max && (m_fp->pFindTbl[0] == Log.m_CurNo) ){ + cmp1max--; + cmp2max--; + } + if( Font->Charset != SHIFTJIS_CHARSET ){ + if( !cmp2max ){ + strcpy(bf, "No Data"); + } + else if( cmp1max != cmp2max ){ + sprintf(bf, "Perfect: %u SameCall: %u", cmp1max, cmp2max - cmp1max); + } + else { + sprintf(bf, "Perfect: %u", cmp1max ); + } + } + else { + if( !cmp2max ){ + strcpy(bf, "ˆê’v‚È‚µ"); + } + else if( cmp1max != cmp2max ){ + sprintf(bf, "Š®‘Sˆê’v: %uŒ “¯ˆêƒR[ƒ‹: %uŒ", cmp1max, cmp2max - cmp1max); + } + else { + sprintf(bf, "Š®‘Sˆê’v: %uŒ", cmp1max ); + } + } + LStat->Caption = bf; +} +//--------------------------------------------------------------------- +void __fastcall TQSODlgBox::GridDrawCell(TObject *Sender, int Col, int Row, + TRect &Rect, TGridDrawState State) +{ + char bf[256]; + SDMMLOG sd; + + Grid->Canvas->FillRect(Rect); + int X = Rect.Left + 4; + int Y = Rect.Top + 2; + + if( Row ){ + Row--; + bf[0] = 0; + if( Row < m_fp->GetCount() ){ + Log.GetData(&sd, m_fp->pFindTbl[Row]); + if( ((Row+1) != Grid->Row)||(Col != Grid->Col) ){ + if( m_fp->pFindTbl[Row] == Log.m_CurNo ){ + Grid->Canvas->Font->Color = clLtGray; + } + else if( Row < m_fp->m_FindCmp1Max ){ + Grid->Canvas->Font->Color = clRed; + } + else if( Row < m_fp->m_FindCmp2Max ){ + Grid->Canvas->Font->Color = clGreen; + } + } + if( Log.m_LogSet.m_TimeZone != 'I' ){ + JSTtoUTC(&sd); + } + } + else { + memset(&sd, 0, sizeof(SDMMLOG)); + } + switch(Col){ + case 0: // Date + strcpy(bf, Log.GetDateString(&sd)); + break; + case 1: // Time + strcpy(bf, Log.GetTimeString(sd.btime)); + break; + case 2: // Call + strcpy(bf, sd.call); + break; + case 3: // M + bf[0] = sd.cq; + bf[1] = 0; + break; + case 4: // HisRST + strcpy(bf, sd.ur); + break; + case 5: // MyRST + strcpy(bf, sd.my); + break; + case 6: // Band + strcpy(bf, Log.GetFreqString(sd.band, sd.fq)); + break; + case 7: // Mode + strcpy(bf, Log.GetModeString(sd.mode)); + break; + case 8: // Pow + strcpy(bf, sd.pow); + break; + case 9: // Name + strcpy(bf, sd.name); + break; + case 10: // QTH + strcpy(bf, sd.qth); + break; + case 11: // S + bf[0] = sd.send; + bf[1] = 0; + break; + case 12: // R + bf[0] = sd.recv; + bf[1] = 0; + break; + case 13: // REM + strcpy(bf, sd.rem); + break; + case 14: // QSL + strcpy(bf, sd.qsl); + break; + case 15: // etime; + strcpy(bf, Log.GetTimeString(sd.etime)); + break; + case 16: // Env + if( sd.env ) sprintf(bf, "%u", sd.env); + break; + case 17: // Opt1 + strcpy(bf, sd.opt1); + break; + case 18: // Opt2 + strcpy(bf, sd.opt2); + break; + case 19: // Usr1 + break; + case 20: // Usr2 + break; + } + Grid->Canvas->TextRect(Rect, X, Y, bf); + } + else { // ƒ^ƒCƒgƒ‹ + LPCSTR _tt[]={ + "Date","JST","Call","M", "His","My","Band","Mode","Pow","Name","QTH","S","R", + "REM","QSL", "End", "Env", "Opt1", "Opt2", "Usr1", "Usr2", + }; + if( Col == 1 ){ + Grid->Canvas->TextRect(Rect, X, Y, LTimeZone->Caption); + } + else { + Grid->Canvas->TextRect(Rect, X, Y, _tt[Col]); + } + } +} +//--------------------------------------------------------------------------- +void __fastcall TQSODlgBox::GridSelectCell(TObject *Sender, int Col, int Row, + bool &CanSelect) +{ + int n = Row - 1; + if( n < m_fp->GetCount() ){ + if( m_CurNo != m_fp->pFindTbl[n] ){ + if( m_EditFlag ){ + UpdateCurData(&m_sd); + Log.PutData(&m_sd, m_CurNo); + m_EditFlag = 0; + } + m_CurNo = m_fp->pFindTbl[n]; + Log.GetData(&m_sd, m_CurNo); + UpdateTextData(&m_sd, m_CurNo); + Grid->Invalidate(); + UpdateBtn(); + } + } +} +//--------------------------------------------------------------------------- +void __fastcall TQSODlgBox::SBMMCGClick(TObject *Sender) +{ + TMmcgDlgBox *pBox = new TMmcgDlgBox(this); + + AnsiString call = EditCall->Text; + AnsiString qth = EditQTH->Text; + AnsiString opt = EditOpt1->Text; + if( pBox->Execute( call, qth, opt) == TRUE ){ //JA7UDE 0428 + EditQTH->Text = qth; + EditOpt1->Text = opt; + } + delete pBox; +} +//--------------------------------------------------------------------------- +void __fastcall TQSODlgBox::FormKeyDown(TObject *Sender, WORD &Key, + TShiftState Shift) +{ + if( Key == VK_F7 ){ + Key = 0; + } +} +//--------------------------------------------------------------------------- +void __fastcall TQSODlgBox::FormKeyUp(TObject *Sender, WORD &Key, + TShiftState Shift) +{ + if( Key == VK_F7 ){ + SBMMCGClick(NULL); + Key = 0; + } +} +//--------------------------------------------------------------------------- +void __fastcall TQSODlgBox::RefBtnClick(TObject *Sender) +{ + AnsiString as; + MmttyWd->PrintText.GetString(as); + TTextEditDlg *pBox = new TTextEditDlg(this); + if( Font->Charset != SHIFTJIS_CHARSET ){ + pBox->Memo->Font->Name = sys.m_BtnFontName; + pBox->Memo->Font->Charset = sys.m_BtnFontCharset; + pBox->Execute(as, TRUE, "Receive Window"); + } + else { + pBox->Execute(as, TRUE, "ŽóM‰æ–Ê‹L˜^"); + } + delete pBox; +} +//--------------------------------------------------------------------------- +void __fastcall TQSODlgBox::EditDateChange(TObject *Sender) +{ + m_EditFlag = 1; + UpdateBtn(); +} +//--------------------------------------------------------------------------- diff --git a/QsoDlg.dfm b/QsoDlg.dfm new file mode 100644 index 0000000..9132e69 Binary files /dev/null and b/QsoDlg.dfm differ diff --git a/QsoDlg.h b/QsoDlg.h new file mode 100644 index 0000000..f479fdc --- /dev/null +++ b/QsoDlg.h @@ -0,0 +1,128 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//---------------------------------------------------------------------------- +#ifndef QsoDlgH +#define QsoDlgH +//---------------------------------------------------------------------------- +//JA7UDE 0427 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//---------------------------------------------------------------------------- +#include "LogFile.h" +//---------------------------------------------------------------------------- +class TQSODlgBox : public TForm +{ +__published: + TButton *OKBtn; + TButton *CancelBtn; + TGroupBox *GroupBox1; + TStringGrid *Grid; + TLabel *Label1; + TEdit *EditDate; + TLabel *LTimeZone; + TEdit *EditBgn; + TLabel *Label3; + TEdit *EditEnd; + TLabel *Label4; + TEdit *EditCall; + TLabel *Label5; + TEdit *EditName; + TLabel *Label6; + TEdit *EditQTH; + TLabel *Label7; + TComboBox *EditMy; + TLabel *Label8; + TComboBox *EditHis; + TLabel *Label9; + TComboBox *EditBand; + TLabel *Label10; + TComboBox *EditMode; + TLabel *Label11; + TEdit *EditRem; + TLabel *Label12; + TEdit *EditQSL; + TLabel *Label13; + TLabel *Label14; + TLabel *Label15; + TEdit *EditEnv; + TLabel *Label16; + TEdit *EditOpt1; + TLabel *Label17; + TEdit *EditOpt2; + TLabel *Label18; + TComboBox *EditM; + TComboBox *EditS; + TComboBox *EditR; + TLabel *Label19; + TComboBox *EditPow; + TLabel *LStat; + TLabel *Label20; + TEdit *EditUsr1; + TLabel *Label21; + TEdit *EditUsr2; + TSpeedButton *SBMMCG; + TButton *RefBtn; + void __fastcall GridDrawCell(TObject *Sender, int Col, int Row, TRect &Rect, + TGridDrawState State); + void __fastcall GridSelectCell(TObject *Sender, int Col, int Row, + bool &CanSelect); + + + void __fastcall SBMMCGClick(TObject *Sender); + void __fastcall FormKeyDown(TObject *Sender, WORD &Key, TShiftState Shift); + void __fastcall FormKeyUp(TObject *Sender, WORD &Key, TShiftState Shift); + void __fastcall RefBtnClick(TObject *Sender); + void __fastcall EditDateChange(TObject *Sender); +private: + CLogFind *m_fp; + int m_EditFlag; + + int m_CurNo; + SDMMLOG m_sd; + + AnsiString m_Country; + void __fastcall UpdateBtn(void); + void __fastcall SetCountry(void); + +// CAlignList AlignList; +// void __fastcall EntryAlignControl(void); + void __fastcall UpdateStat(void); + + void __fastcall UpdateTextData(SDMMLOG *sp, int n); + void __fastcall UpdateTextData(SDMMLOG *sp); + void __fastcall UpdateCurData(SDMMLOG *sp); +public: + virtual __fastcall TQSODlgBox(TComponent* AOwner); + int __fastcall Execute(CLogFind *fp, SDMMLOG *sp, int n); + int __fastcall ShowFind(CLogFind *fp); +}; +//---------------------------------------------------------------------------- +//extern TQSODlgBox *QSODlgBox; +//---------------------------------------------------------------------------- +#endif diff --git a/Rtty.cpp b/Rtty.cpp new file mode 100644 index 0000000..4e5ec65 --- /dev/null +++ b/Rtty.cpp @@ -0,0 +1,2620 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "Rtty.h" + +#define LOGFFT FALSE + +CSinTable g_SinTable; + +//--------------------------------------------------------------------------- +// CSinTableƒNƒ‰ƒX +// Added by JE3HHT on Aug.2010 +__fastcall CSinTable::CSinTable() +{ + m_Size = 48000; + m_tSin = new double[m_Size]; + double pi2t = 2 * PI / double(m_Size); + for( int i = 0; i < m_Size; i++ ){ + m_tSin[i] = sin(double(i) * pi2t); + } +} +//--------------------------------------------------------------------------- +__fastcall CSinTable::~CSinTable() +{ + delete[] m_tSin; +} +//--------------------------------------------------------------------------- +CTICK::CTICK() +{ + ptbl[0] = new int[12500]; + ptbl[1] = new int[12500]; + memset(ptbl[0], 0, sizeof(int[12500])); + memset(ptbl[1], 0, sizeof(int[12500])); +} +CTICK::~CTICK() +{ + delete[] ptbl[0]; //JA7UDE 0428 + delete[] ptbl[1]; //JA7UDE 0428 +} +void CTICK::Init(void) +{ + m_wsel = 0; + m_wp = ptbl[0]; + m_wcnt = 0; + m_Trig = 0; +} +void CTICK::Write(double d) +{ + *m_wp = int(d); + m_wp++; + m_wcnt++; + if( m_wcnt >= m_Samp ){ + m_wcnt = 0; + m_wsel++; + m_wsel &= 1; + m_wp = ptbl[m_wsel]; + m_Trig = 1; + } +} +int *CTICK::GetData(void) +{ + if( !m_Trig ) return NULL; + m_Trig = 0; + int sel = m_wsel + 1; + sel &= 1; + return ptbl[sel]; +} +//--------------------------------------------------------------------------- +// VCOƒNƒ‰ƒX +CVCO::CVCO() +{ + m_vlock = 0; + m_SampleFreq = SampFreq; + m_FreeFreq = 1900.0; + m_TableSize = int(SampFreq*2); + pSinTbl = new double[m_TableSize]; + m_c1 = m_TableSize/16.0; + m_c2 = int( double(m_TableSize) * m_FreeFreq / m_SampleFreq ); + m_z = 0; + double pi2t = 2 * PI / double(m_TableSize); + for( int i = 0; i < m_TableSize; i++ ){ + pSinTbl[i] = sin(double(i) * pi2t); + } +} + +CVCO::~CVCO() +{ + if( m_vlock ) ::VirtualUnlock(pSinTbl, sizeof(double)*m_TableSize); + delete[] pSinTbl; +} + +void CVCO::SetGain(double gain) +{ + m_c1 = double(m_TableSize) * gain / m_SampleFreq; +} + +void CVCO::VirtualLock(void) +{ + if( !m_vlock ){ + ::VirtualLock(pSinTbl, sizeof(double)*m_TableSize); + m_vlock = 1; + } +} + +void CVCO::SetSampleFreq(double f) +{ + m_SampleFreq = f; + int size = int(m_SampleFreq*2); + if( m_TableSize != size ){ + if( pSinTbl != NULL ){ + if( m_vlock ) ::VirtualUnlock(pSinTbl, sizeof(double)*m_TableSize); + delete[] pSinTbl; + } + m_TableSize = size; + pSinTbl = new double[m_TableSize]; + if( m_vlock ) ::VirtualLock(pSinTbl, sizeof(double)*m_TableSize); + double pi2t = 2 * PI / double(m_TableSize); + for( int i = 0; i < m_TableSize; i++ ){ + pSinTbl[i] = sin(double(i) * pi2t); + } + } + SetFreeFreq(m_FreeFreq); +} + +void CVCO::SetFreeFreq(double f) +{ + m_FreeFreq = f; + m_c2 = double(m_TableSize) * m_FreeFreq / m_SampleFreq; +} + +void CVCO::InitPhase(void) +{ + m_z = 0; +} + +double CVCO::Do(double d) +{ // -1 to 1 + m_z += (d * m_c1 + m_c2) + 0.5; + while( m_z >= m_TableSize ){ + m_z -= m_TableSize; + } + while( m_z < 0 ){ + m_z += m_TableSize; + } + return pSinTbl[int(m_z)]; +} + +//--------------------------------------------------------------------------- +// VCOXƒNƒ‰ƒX +__fastcall CVCOX::CVCOX() +{ + m_SampleFreq = SampFreq; + m_FreeFreq = 2000.0; + m_TableSize = g_SinTable.m_Size; + m_TableCOS = m_TableSize / 4; + m_c1 = 0.0; + m_c2 = double(m_TableSize) * m_FreeFreq / m_SampleFreq; + m_z = 0.0; +} + +__fastcall CVCOX::~CVCOX() +{ +} + +void __fastcall CVCOX::SetGain(double gain) +{ + m_c1 = double(m_TableSize) * gain / m_SampleFreq; +} + +void __fastcall CVCOX::SetSampleFreq(double f) +{ + m_SampleFreq = f; + SetFreeFreq(m_FreeFreq); +} + +void __fastcall CVCOX::SetFreeFreq(double f) +{ + m_FreeFreq = f; + m_c2 = double(m_TableSize) * m_FreeFreq / m_SampleFreq; + if( f < 1.0 ) m_z = 0; +} + +void __fastcall CVCOX::InitPhase(void) +{ + m_z = 0.0; +} +//------------------------------------------------------------------ +double __fastcall CVCOX::Do(void) +{ + m_z += m_c2; + if( m_z >= m_TableSize ){ + m_z -= m_TableSize; + } + if( m_z < 0 ){ + m_z += m_TableSize; + } + return g_SinTable.m_tSin[int(m_z)]; +} +//------------------------------------------------------------------ +double __fastcall CVCOX::Do(double d) +{ + // -1 to 1 + m_z += (d * m_c1 + m_c2); + while( m_z >= m_TableSize ){ + m_z -= m_TableSize; + } + while( m_z < 0 ){ + m_z += m_TableSize; + } + return g_SinTable.m_tSin[int(m_z)]; +} +//------------------------------------------------------------------ +double __fastcall CVCOX::DoCos(void) +{ + double z = m_z + m_TableCOS; + if(z >= m_TableSize ) z -= m_TableSize; + return g_SinTable.m_tSin[int(z)]; +} + +//--------------------------------------------------------------------------- +// CFSKMODƒNƒ‰ƒX +CFSKMOD::CFSKMOD() +{ + m_SampFreq = sys.m_SampFreq + sys.m_TxOffset; + vco.SetSampleFreq(m_SampFreq); + + memset(ZBPF, 0, sizeof(ZBPF)); + memset(HBPF, 0, sizeof(HBPF)); + m_bpftap = 48; + + m_rp = 0; + m_wp = 0; + m_cnt = 0; + + m_BitLen = 5; + m_StopLen = 4; // 0-1bit, 1-1.5bit, 2-2bit, 3-1.5bit, 4-1.5bit + m_Parity = 0; + m_SumParity = 0; + + m_Data = 0; + m_DataCount = 0; + m_mode = 0; + m_inv = 0; + m_diddle = 2; + m_fig = 0; + m_figout = 0; + + SetBaudRate(45.45); + SetOutputGain(24576.0); + + m_MarkFreq = 2125; + m_SpaceFreq = 2295; + SetMarkFreq(2125); + SetSpaceFreq(2295); + + m_out = 1; + m_bpf = 1; + SetLPFFreq(100.0); + m_lpf = 0; + + m_CharWaitCount = 0; + m_CharWait = 0; + m_DiddleWait = 0; + m_CharWaitDiddle = 0; + + m_idle = 1; + pDem = NULL; + m_RandomDiddle = 0; + m_WaitTimer = 0; + m_WaitTimerCount = 0; + + m_DisDiddle = 0; + + m_AmpVal = 0; +} + +void CFSKMOD::CalcBPF(void) +{ + MakeFilter(HBPF, m_bpftap, ffBPF, SampFreq, m_MarkFreq - 150, m_SpaceFreq + 150, 60, 1.0); +} + +void CFSKMOD::SetMarkFreq(double d) +{ + m_MarkFreq = d; + vco.SetFreeFreq(m_SpaceFreq); + vco.SetGain(m_MarkFreq - m_SpaceFreq); + CalcBPF(); +} + +void CFSKMOD::SetSpaceFreq(double d) +{ + m_SpaceFreq = d; + vco.SetFreeFreq(m_SpaceFreq); + vco.SetGain(m_MarkFreq - m_SpaceFreq); + CalcBPF(); +} + +void CFSKMOD::SetSampFreq(double f) +{ + m_SampFreq = sys.m_SampFreq + sys.m_TxOffset; + vco.SetSampleFreq(m_SampFreq); + SetBaudRate(m_BaudRate); + SetLPFFreq(m_LPFFreq); +} + +void CFSKMOD::SetBaudRate(double b) +{ + if( b >= 1.0 ){ + m_BaudRate = b; + m_Count = m_ReCount = int(m_SampFreq/b + 0.5); + m_Amp.SetMax(m_Count); + } +} + +void CFSKMOD::SetLPFFreq(double f) +{ + m_LPFFreq = f; + avgLPF.SetCount(int(m_SampFreq/f + 0.5)); +} + +void CFSKMOD::PutData(int d) +{ + if( m_cnt < MODBUFMAX ){ + m_idle = 0; + m_Buff[m_wp] = BYTE(d); + m_wp++; + if( m_wp >= MODBUFMAX ) m_wp = 0; + m_cnt++; + } +} + +void CFSKMOD::OutTone(int sw, int bsize) +{ + if( sw ){ + m_out = 1; + m_Count = m_ReCount/2; + } + else { + m_out = -1; + m_Count = m_ReCount * (1 + ((220 * bsize)/(m_SampFreq))); + } +} + +double CFSKMOD::Do(int echo){ + if( m_CharWaitDiddle && m_CharWaitCount ){ + m_CharWaitCount--; + } + if( m_DisDiddle > 0 ) m_DisDiddle--; + if( sys.m_TxPort && m_FSKCount ) m_FSKCount--; + if( !m_Count ){ + m_Count = m_ReCount; + switch(m_mode){ + case 0: // ƒXƒ^[ƒgƒrƒbƒgo—Í + if( sys.m_TxPort == txTXD ) FSKDeff = m_cnt - FSKCount; + if( !m_CharWaitDiddle ){ + if( m_CharWaitCount ){ + m_CharWaitCount--; + m_out = 1; + m_Count = 1; + break; + } + else if( m_CharWait && m_cnt ){ + m_CharWaitCount = m_CharWait * m_ReCount/3; + } + } +_try:; + if( m_cnt && + ((!m_CharWaitDiddle) || (!m_CharWaitCount)) && + ((sys.m_TxPort != txTXD) || (FSKCount <= m_cnt) || (m_FSKCount) || (m_Buff[m_rp]==0xff) || (m_Buff[m_rp]==0xfe) ) + ){ + m_WaitTimerCount = 4; + m_idle = 0; + m_out = 0; + if( m_figout && (m_fig == 0x1b) && (m_Buff[m_rp]!=0x1f) ){ + m_Data = 0x1b; + if( !echo ){ + pDem->WriteData(m_Data); + } + } + else { + if( sys.m_TxPort == txTXDOnly ){ // FSK OnlyŽž‚Ì“¯Šú +#if 0 + while( FSKCount1 == FSKCount2 ){ + ::Sleep(10); + } +#endif + FSKCount2++; + } + m_Data = m_Buff[m_rp]; + if( m_Data == 0xff ){ // ƒ}[ƒNM†‘—M + m_out = 1; + m_Count = m_ReCount * 3; + m_cnt--; + m_rp++; + if( m_rp >= MODBUFMAX ) m_rp = 0; + m_CharWaitCount = 0; + break; + } + else if( m_Data == 0xfe ){ // ƒLƒƒƒŠƒAØ’f + m_out = -1; + m_Count = m_ReCount * 3; + m_cnt--; + m_rp++; + if( m_rp >= MODBUFMAX ) m_rp = 0; + m_CharWaitCount = 0; + break; + } + else if( m_Data == 0xfd ){ // Dis Diddle + m_DisDiddle = -1; + m_cnt--; + m_rp++; + if( m_rp >= MODBUFMAX ) m_rp = 0; + goto _try; + } + else if( m_Data == 0xfc ){ // Enb Diddle + m_DisDiddle = 0; + m_cnt--; + m_rp++; + if( m_rp >= MODBUFMAX ) m_rp = 0; + goto _try; + } + else if( (m_Data == 0x1b)||(m_Data == 0x1f) ){ + m_fig = m_Data; + } + m_cnt--; + m_rp++; + if( m_rp >= MODBUFMAX ) m_rp = 0; + if( !echo ){ + pDem->WriteData(m_Data); + } + } + m_figout = 0; + m_DataCount = m_BitLen; + m_SumParity = 0; + m_mode++; + } + else if( m_Data == 0x00fe ){ + m_idle = 1; + m_out = -1; + m_Count = m_ReCount * 50; + m_Data = 0; + break; + } + else if( (m_BitLen < 6) && ((m_diddle && !m_DisDiddle) || ((sys.m_TxPort == txTXD)&& m_cnt)) ){ +// else if( m_diddle && (!m_DisDiddle || ((sys.m_TxPort == txTXD)&& m_cnt) ) ){ +// else if( m_diddle && !m_DisDiddle ){ +#if 0 + if( sys.m_TxPort == txTXDOnly ){ + ::Sleep((m_ReCount * m_BitLen)*1000/m_SampFreq); + } +#endif + if( !m_cnt ) m_idle = 1; + m_out = 0; + switch(m_diddle){ + case 1: // BLK + if( m_RandomDiddle && !(rand() & 3) ){ + m_Data = 0x1f; + if( m_BitLen <= 6 ) m_figout = 1; + } + else { + m_Data = 0x00; + } + break; + default: // LTR + if( m_RandomDiddle && !(rand() & 3) ){ + m_Data = 0x00; + } + else { + m_Data = 0x1f; + if( m_BitLen <= 6 ) m_figout = 1; + } + break; + } + m_DataCount = m_BitLen; + m_SumParity = 0; + m_mode++; + if( !m_CharWaitDiddle ){ + if( (sys.m_LWait == 2) || m_cnt ){ + m_CharWaitCount = m_CharWait * m_ReCount/3; + } + else if( m_DiddleWait ){ + m_CharWaitCount = m_DiddleWait * m_ReCount/3; + } + else { + m_CharWaitCount = 0; + } + if( sys.m_LWait != 2 ){ + if( m_WaitTimer ){ + if( !m_WaitTimerCount ){ + m_CharWaitCount = 0; + } + else { + m_WaitTimerCount--; + } + } + } + } + } + else { + if( !m_cnt ) m_idle = 1; + m_out = 1; + m_Count = 1; +#if 0 + if( sys.m_TxPort == txTXDOnly ){ + ::Sleep(11); + m_Count = m_ReCount; + } +#endif + } + if( m_CharWaitDiddle && (!m_CharWaitCount) ){ + if( m_Data != 0x1b ){ + m_CharWaitCount = m_CharWait * m_ReCount/3; + } + } + break; + case 1: // •„†o—Í + if( m_DataCount ){ + switch(m_BitLen){ + case 6: + m_out = (m_Data & 0x20) ? 1 : 0; + break; + case 7: + m_out = (m_Data & 0x40) ? 1 : 0; + break; + case 8: + m_out = (m_Data & 0x80) ? 1 : 0; + break; + default: + m_out = (m_Data & 0x10) ? 1 : 0; + break; + } + m_Data = BYTE(m_Data << 1); + m_DataCount--; + if( m_out ) m_SumParity++; + } + else { // ƒXƒgƒbƒvƒrƒbƒg + if( m_Parity ){ + m_mode++; + switch(m_Parity){ + case 1: // Even + m_out = m_SumParity & 1 ? 0 : 1; + break; + case 2: // Odd + m_out = m_SumParity & 1 ? 1 : 0; + break; + case 3: + m_out = 1; + break; + case 4: + m_out = 0; + break; + } + } + else { + m_mode++; + goto _nx; + } + } + break; + case 2: +_nx:; + m_out = 1; + m_mode++; + switch(m_StopLen){ + case 0: // 1bit + m_Count = 1; + break; + case 1: // 1.5bit + case 3: + case 4: + m_Count = (m_ReCount/2) - 1; + break; + case 2: // 2bit + m_Count = m_ReCount - 1; + break; + } + break; + case 3: // ƒXƒgƒbƒvƒrƒbƒgI—¹ + m_mode = 0; + break; + } + } + m_Count--; + double d; + if( m_lpf ){ // GMSK + if( m_inv ){ + d = m_out ? 0 : 1; + } + else { + d = m_out; + } + d = avgLPF.Avg(d); + d = vco.Do(d) * m_OutputGain; + } + else { // AFSK + if( m_inv ){ + d = vco.Do(m_out ? 0 : 1) * m_OutputGain; + } + else { + d = vco.Do(m_out) * m_OutputGain; + } + } + if( m_out < 0 ) d = 0; + if( m_bpf ){ + d = DoFIR(HBPF, ZBPF, d, m_bpftap); + } + return d * m_Amp.Do(m_AmpVal); +} + + +//--------------------------------------------------------------------------- +// CFSKDEMƒNƒ‰ƒX +CFSKDEM::CFSKDEM() +{ + m_OverFlow = 0; + m_lpf = 0; + m_lpfOrder = 5; + SetLPFFreq(40.0); + + m_pll.SetSampleFreq(DemSamp); + m_Phase.SetSampleFreq(DemSamp); + + memset(ZMark, 0, sizeof(ZMark)); + memset(ZSpace, 0, sizeof(ZSpace)); + memset(HMark, 0, sizeof(HMark)); + memset(HSpace, 0, sizeof(HSpace)); + i2 = 0; +// o1 = o2 = 0; + Count = 0; + + SetSmoozFreq(70.0); + avgMark.SetCount(m_Smooz); + avgSpace.SetCount(m_Smooz); + + m_BitLen = 5; + m_StopLen = 4; // 0-1bit, 1-1.5bit, 2-2bit, 3-1bit, 4-1.42bit + m_Parity = 0; + m_SumParity = 0; + + m_mode = 0; + m_DataCount = 0; + + m_inv = 0; + m_sq = 0; + m_SQLevel = 600.0; + m_Tap = 72; + m_FilWidth = GetFilWidth(m_Tap); + + m_wp = 0; + m_rp = 0; + m_BufCount = 0; + + SetBaudRate(45.45); + + m_MarkFreq = 2125; + m_SpaceFreq = 2295; + SetMarkFreq(2125); + SetSpaceFreq(2295); + + m_dMark = 0; + m_dSpace = 0; + + m_Scope = 0; + m_majority = 1; + m_ignoreFream = 0; + m_XYScope = 0; + SetIIR(60.0); + m_Limit = 1; + m_LimitGain = 10.0; + + m_deff = 0; + m_avgdeff = 0; + + m_sqcount = 0; +// SmoozSQ.SetCount(4); + SmoozSQ.SetCount(8); + + m_LimitOverSampling = 0; + + m_Tick = 0; + m_atcPLL.m_Max = 12; + + m_LimitAGC = 1; + m_limitMax = 1; + m_limitMin = -1; + m_d = 0; +} + +void CFSKDEM::SetIIR(double bw) +{ + m_iirfw = bw; + m_iirm.SetFreq(m_AFCMarkFreq, DemSamp, m_iirfw); + m_iirs.SetFreq(m_AFCSpaceFreq, DemSamp, m_iirfw); + m_pll.SetFreeFreq(m_AFCMarkFreq, m_AFCSpaceFreq); +} + +void CFSKDEM::SetBaudRate(double b) +{ + if( b >= 1.0 ){ + m_BaudRate = b; + m_Count = m_ReCount = int(DemSamp/b + 0.5); + } +} + +void CFSKDEM::SetSmoozFreq(double f) +{ + m_SmoozFreq = f; + m_Smooz = int(DemSamp / f + 0.5); + + avgMark.SetCount(m_Smooz); + avgSpace.SetCount(m_Smooz); +} + +void CFSKDEM::SetLPFFreq(double f) +{ + m_lpffreq = f; + LpfMark.MakeIIR(f, DemSamp, m_lpfOrder, 0, 1.0); + LpfSpace.MakeIIR(f, DemSamp, m_lpfOrder, 0, 1.0); +} + +void CFSKDEM::SetMarkFreq(double d) +{ + m_SetMarkFreq = m_AFCMarkFreq = m_MarkFreq = d; + MakeFilter(HMark, m_Tap, ffBPF, DemSamp, m_MarkFreq-m_FilWidth, m_MarkFreq+m_FilWidth, 60, 1.0); + SetIIR(m_iirfw); + m_Phase.SetCarrierFreq(m_AFCMarkFreq); + if( m_AFCSpaceFreq > m_AFCMarkFreq ) m_Phase.SetShift(m_AFCSpaceFreq - m_AFCMarkFreq); + m_AA6YQ.SetMarkFreq(m_AFCMarkFreq); +} + +void CFSKDEM::SetSpaceFreq(double d) +{ + m_SetSpaceFreq = m_AFCSpaceFreq = m_SpaceFreq = d; + MakeFilter(HSpace, m_Tap, ffBPF, DemSamp, m_SpaceFreq-m_FilWidth, m_SpaceFreq+m_FilWidth, 60, 1.0); + SetIIR(m_iirfw); + m_Phase.SetCarrierFreq(m_AFCMarkFreq); + if( m_AFCSpaceFreq > m_AFCMarkFreq ) m_Phase.SetShift(m_AFCSpaceFreq - m_AFCMarkFreq); + m_AA6YQ.SetSpaceFreq(m_AFCSpaceFreq); +} + +void CFSKDEM::AFCMarkFreq(double d) +{ + if( d != m_MarkFreq ){ + m_MarkFreq = d; + if( fabs(d - m_AFCMarkFreq) >= (m_type ? 10.0 : 5.0) ){ + m_AFCMarkFreq = d; + MakeFilter(HMark, m_Tap, ffBPF, DemSamp, m_MarkFreq-m_FilWidth, m_MarkFreq+m_FilWidth, 60, 1.0); + SetIIR(m_iirfw); + m_Phase.SetCarrierFreq(m_AFCMarkFreq); + } + m_AA6YQ.SetMarkFreqByAFC(d); + } +} + +void CFSKDEM::AFCSpaceFreq(double d) +{ + if( d != m_SpaceFreq ){ + m_SpaceFreq = d; + if( fabs(d - m_AFCSpaceFreq) >= (m_type ? 10.0 : 5.0) ){ + m_AFCSpaceFreq = d; + MakeFilter(HSpace, m_Tap, ffBPF, DemSamp, m_SpaceFreq-m_FilWidth, m_SpaceFreq+m_FilWidth, 60, 1.0); + SetIIR(m_iirfw); + } + m_AA6YQ.SetSpaceFreqByAFC(d); + } +} + +double CFSKDEM::GetFilWidth(int tap) +{ + double Width; + + if( tap >= 256 ){ + Width = 20; + } + else if( tap >= 192 ){ + Width = 30; + } + else { + Width = 40; + } + return Width; +} + +void CFSKDEM::SetFilterTap(int tap) +{ + if( tap != m_Tap ){ + m_Tap = tap; + m_FilWidth = GetFilWidth(tap); + MakeFilter(HSpace, m_Tap, ffBPF, DemSamp, m_SpaceFreq-m_FilWidth, m_SpaceFreq+m_FilWidth, 60, 1.0); + MakeFilter(HMark, m_Tap, ffBPF, DemSamp, m_MarkFreq-m_FilWidth, m_MarkFreq+m_FilWidth, 60, 1.0); + } +} + +void CFSKDEM::WriteData(BYTE d) +{ + if( m_BufCount < DEMBUFMAX ){ + m_Buff[m_wp] = d; + m_wp++; + m_BufCount++; + if( m_wp >= DEMBUFMAX ) m_wp = 0; + } +} + +void CFSKDEM::DoFSK(void) +{ + int b; + + if( m_Tick ){ + Tick.Write(m_dMark); + return; + } + if( m_dMark >= m_dSpace ){ // ƒ}[ƒN‚ÌŽž + b = m_inv ? 0 : 1; + } + else { // ƒXƒy[ƒX‚ÌŽž + b = m_inv ? 1 : 0; + } + double deff = fabs(m_dMark - m_dSpace); + +// Adjustment for the level meter, added by JE3HHT (Ver 1.68A) + if( m_AA6YQ.m_fEnabled && (m_type != 3) ){ + deff *= 4; + deff -= 30000; + } +// till end + + if( m_deff < deff ) m_deff = deff; + if( !m_sqcount ){ + m_avgdeff = SmoozSQ.Avg(m_deff); + m_deff = 0; + m_sqcount = DemSamp / 10; + } + m_sqcount--; + + if( m_sq ){ + if( !m_mode ){ + if( m_Limit ){ // ŽóMŽž + if( (m_SQLevel * 10.0) > m_avgdeff ){ + b = 1; + } + } + else { // ‘—MŽž + if( m_SQLevel > m_avgdeff ){ + b = 1; + } + } + } + } +// m_Bit = b; + if( m_Scope ){ + m_ScopeSync.WriteData(m_Count ? 0 : 8192.0); + m_ScopeBit.WriteData(b ? 8192.0 : 0); + } + switch(m_mode){ + case 0: // ƒXƒ^[ƒgƒrƒbƒgŒŸo‘Ò‚¿ + if( !b ){ + m_Count = m_ReCount/2; + if( m_majority ){ + m_mark = m_space = 0; + m_mode = 256; // ‘½”ŒˆƒƒWƒbƒN + } + else { + m_mode++; + } +#if BITDEBUG + m_bitCountA = m_bitCount; + m_bitCount = 0; +#endif + } + else { + m_Count = m_ReCount; + } + break; +// ’Ê탃WƒbƒN‚É‚æ‚é”»’è + case 1: // ƒXƒ^[ƒgƒrƒbƒgŒŸo‘Ò‚¿(Half) + if( b ){ + m_mode = 0; + } + else if( !m_Count ){ + if( m_Scope ){ + m_ScopeSync.UpdateData(-8192.0); // ƒXƒ^[ƒgƒrƒbƒgˆÊ’u + } + m_Count = m_ReCount; + m_Data = 0; + m_DataCount = m_BitLen; + m_SumParity = 0; + m_mode++; + } + break; + case 2: // •„†‹L˜^’† + if( !m_Count ){ + m_Count = m_ReCount; + m_Data = BYTE(m_Data << 1); + m_Data |= BYTE(b); + m_DataCount--; + if( !m_DataCount ){ + if( m_Parity ){ + m_mode++; + } + else { + m_mode += 2; + } + } + if( m_Parity ){ + m_SumParity += b; + } + } + break; + case 3: // ƒpƒŠƒeƒBƒrƒbƒg + if( !m_Count ){ + m_Count = m_ReCount; + m_mode++; + switch(m_Parity){ + case 1: // Even + if( (!(m_SumParity & 1) ^ b) & 1 ) m_mode = 0; // ƒpƒŠƒeƒBƒGƒ‰[ + break; + case 2: // Odd + if( ((m_SumParity & 1) ^ b) & 1 ) m_mode = 0; // ƒpƒŠƒeƒBƒGƒ‰[ + break; + case 3: + if( !b ) m_mode = 0; + break; + case 4: + if( b ) m_mode = 0; + break; + default: + break; + } + if( !m_mode ){ // ƒpƒŠƒeƒBƒGƒ‰[ + m_Count = m_ReCount; + m_mode = 7; + } + } + break; + case 4: // ƒXƒgƒbƒvƒrƒbƒg‚ÌŠm”F + if( !m_Count ){ + if( m_Scope ){ + m_ScopeSync.UpdateData(-4096.0); // StopbitˆÊ’u + } + if( b || m_ignoreFream ){ + if( m_BufCount < DEMBUFMAX ){ + m_Buff[m_wp] = m_Data; + m_wp++; + m_BufCount++; + if( m_wp >= DEMBUFMAX ) m_wp = 0; + } + switch(m_StopLen){ + case 2: // 2bit + m_Count = (m_ReCount * 11/8); // 23/16bitŽžŠÔ‚̃EƒGƒCƒg + break; + case 1: // 1.5bit + m_Count = (m_ReCount * 7/8); // 15/16bitŽžŠÔ‚̃EƒGƒCƒg + break; + case 4: // 1.42bit + m_Count = (m_ReCount * 4/5); // 0.82bitŽžŠÔ‚̃EƒGƒCƒg + break; + case 3: + default: // 1bit + m_Count = (m_ReCount * 3/8); // 7/16bitŽžŠÔ‚̃EƒGƒCƒg + break; + } + m_mode++; + } + if( !b ){ // ƒtƒŒ[ƒ~ƒ“ƒOƒGƒ‰[ + m_mode = 8; + } + } + break; + case 5: // ƒXƒgƒbƒvƒrƒbƒgI—¹‘Ò‚¿ƒ^ƒCƒ}[ + if( !m_Count ){ + if( m_Scope ){ + m_ScopeSync.UpdateData(-4096.0); // StopbitsI—¹ˆÊ’u + } + m_mode++; + } + break; + case 6: // ƒXƒgƒbƒvI—¹‘Ò‚¿ + if( b ){ + m_Count = m_ReCount; + } + else { // ŽŸ‚̃Xƒ^[ƒgƒrƒbƒg + m_Count = m_ReCount/2; + m_mode = 0; + } + break; + case 7: // ƒpƒŠƒeƒBƒGƒ‰[Žž + if( !m_Count ){ + m_ScopeSync.UpdateData(-4096.0); // StopbitˆÊ’u + m_mode--; + } + break; + case 8: // ƒtƒŒ[ƒ~ƒ“ƒOƒGƒ‰[Žž + m_Count = m_ReCount; + if( b ){ + m_mode = 0; + } + break; +// ‘½”ŒˆƒƒWƒbƒN‚É‚æ‚éƒf[ƒ^Žæ‚肱‚Ý + case 256: // ƒXƒ^[ƒgƒrƒbƒgŒŸo‘Ò‚¿(Half) + if( b ){m_mark++;} else {m_space++;} + if( !m_Count ){ + b = (m_mark >= m_space) ? 1 : 0; + if( b ){ + m_mode = 0; + } + else { + if( m_Scope ){ + m_ScopeSync.UpdateData(-8192.0); // ƒXƒ^[ƒgƒrƒbƒgˆÊ’u + } + m_Count = m_ReCount/2; + m_mode++; + } + } + break; + case 257: // ƒXƒ^[ƒgƒrƒbƒgI—¹‘Ò‚¿ + if( !m_Count ){ + if( m_Scope ){ + m_ScopeSync.UpdateData(-8192.0); // ƒXƒ^[ƒgƒrƒbƒgˆÊ’u + } + m_Count = m_ReCount; + m_mark = m_space = 0; + m_Data = 0; + m_DataCount = m_BitLen; + m_SumParity = 0; + m_mode++; + } + break; + case 258: // •„†‹L˜^’† + if( b ){m_mark++;} else {m_space++;} + if( !m_Count ){ + b = (m_mark >= m_space) ? 1 : 0; + m_mark = m_space = 0; + m_Count = m_ReCount; + m_Data = BYTE(m_Data << 1); + m_Data |= BYTE(b); + m_DataCount--; + if( !m_DataCount ){ + if( m_Parity ){ + m_mode++; + } + else { + switch(m_StopLen){ + case 2: // 2bit + case 1: // 1.5bit + case 4: // 1.42bit + break; + case 3: + default: // 1bit + m_Count = m_ReCount * 7 / 8; + break; + } + m_mode += 2; + } + } + if( m_Parity ){ + m_SumParity += b; + } + } + break; + case 259: // ƒpƒŠƒeƒBƒrƒbƒg + if( b ){ + m_mark++; + } + else { + m_space++; + } + if( !m_Count ){ + b = (m_mark >= m_space) ? 1 : 0; + m_mark = m_space = 0; + m_Count = m_ReCount; + m_mode++; + switch(m_Parity){ + case 1: // Even + if( (!(m_SumParity & 1) ^ b) & 1 ) m_mode = 0; // ƒpƒŠƒeƒBƒGƒ‰[ + break; + case 2: // Odd + if( ((m_SumParity & 1) ^ b) & 1 ) m_mode = 0; // ƒpƒŠƒeƒBƒGƒ‰[ + break; + case 3: + if( !b ) m_mode = 0; + break; + case 4: + if( b ) m_mode = 0; + break; + default: + break; + } + if( !m_mode ){ // ƒpƒŠƒeƒBƒGƒ‰[ + m_Count = m_ReCount; + m_mode = 7; + } + else { + switch(m_StopLen){ + case 2: // 2bit + case 1: // 1.5bit + case 4: // 1.42bit + break; + case 3: + default: // 1bit + m_Count = m_ReCount * 7 / 8; + break; + } + } + } + break; + case 260: // ƒXƒgƒbƒvƒrƒbƒg‚ÌŠm”F + if( b ){ + m_mark++; + } + else { + m_space++; + } + if( !m_Count ){ + b = (m_mark >= m_space) ? 1 : 0; + m_mark = m_space = 0; + if( m_Scope ){ + m_ScopeSync.UpdateData(-4096.0); // StopbitˆÊ’u + } + if( b || m_ignoreFream ){ + if( m_BufCount < DEMBUFMAX ){ + m_Buff[m_wp] = m_Data; + m_wp++; + m_BufCount++; + if( m_wp >= DEMBUFMAX ) m_wp = 0; + } + switch(m_StopLen){ + case 2: // 2bit + m_Count = (m_ReCount * 7/8); + break; + case 1: // 1.5bit + m_Count = (m_ReCount * 3/8); + break; + case 4: // 1.42bit + m_Count = (m_ReCount * 2/5); + break; + case 3: + default: // 1bit + m_Count = m_ReCount; + if( m_Scope ){ + m_ScopeSync.UpdateData(-4096.0); // StopbitsI—¹ˆÊ’u + } + m_mode = -1; + break; + } + m_mode++; + } + if( !b ){ // ƒtƒŒ[ƒ~ƒ“ƒOƒGƒ‰[ + m_mode = 8; + } + } + break; + case 261: // ƒXƒgƒbƒvƒrƒbƒgI—¹‘Ò‚¿ƒ^ƒCƒ}[ + if( !m_Count ){ + if( m_Scope ){ + m_ScopeSync.UpdateData(-4096.0); // StopbitsI—¹ˆÊ’u + } + m_mode++; + } + break; + case 262: // ƒXƒgƒbƒvI—¹‘Ò‚¿ + if( b ){ + m_Count = m_ReCount; + } + else { // ŽŸ‚̃Xƒ^[ƒgƒrƒbƒg + m_Count = m_ReCount/2; + m_mode = 0; + } + break; + }; + m_Count--; +#if BITDEBUG + m_bitCount++; +#endif +} + +void CFSKDEM::Do(double d) +{ + if( m_AA6YQ.m_fEnabled ) d = m_AA6YQ.Do(d); + double ds = d; + + if( (d > 24578.0) || (d < -24578.0) ){ + m_OverFlow = 1; + } + if( m_Limit ){ + if( m_LimitAGC ){ + if( m_limitMax < d ) m_limitMax = d; + if( m_limitMin > d ) m_limitMin = d; + if( (d >= 0) && (m_d < 0) ){ + m_limitagc = (m_limitMax - m_limitMin); + if( m_limitagc ){ + m_limitagc = (64.0 * 16384.0)/ m_limitagc; + if( m_limitagc >= 4096.0 ) m_limitagc = 4096; + } + else { + m_limitagc = 200; + } + m_limitMax = 1; + m_limitMin = -1; + } + m_d = d; + if( m_LimitOverSampling ){ + d = OverLimit.Do(d, m_limitagc); + } + else { + d *= m_limitagc; + if( d > 16384.0 ) d = 16384.0; + if( d < -16384.0 ) d = -16384.0; + } + } + else { + if( m_LimitOverSampling ){ + d = OverLimit.Do(d, m_LimitGain); + } + else { + d *= m_LimitGain; + if( d > 16384.0 ) d = 16384.0; + if( d < -16384.0 ) d = -16384.0; + } + } +// if( m_AA6YQ.m_fEnabled ) d *= 0.3333; // Delete by JE3HHT (Ver1.68A) + } + if( (Count & 1) || (!DemOver) ){ + if( DemOver ) d = DECM2.Do(d, i2); // 1/2ƒfƒVƒ[ƒ^ + + switch(m_type){ + case 2: // PLL + { + double dm = m_iirm.Do(d); + double ds = m_iirs.Do(d); + d = m_pll.Do(d); + if( m_XYScope ){ // For XY-Scope + m_XYScopeMark.WriteData(dm); + m_XYScopeSpace.WriteData(ds); + } + if( m_Scope ){ // For Scope + m_ScopeMark[0].WriteData(dm); + m_ScopeSpace[0].WriteData(ds); + } + if( m_Scope ){ + m_ScopeMark[1].WriteData(m_pll.GetOut()); + m_ScopeSpace[1].WriteData(d); + } + d = m_atcPLL.Do(d + 8192.0) - 8192.0; + if( d >= 0 ){ + m_dMark = d; + m_dSpace = 0; + } + else { + m_dMark = 0; + m_dSpace = -d; + } + // •½ŠŠ + if( m_lpf ){ + m_dMark = LpfMark.Do(m_dMark); + m_dSpace = LpfSpace.Do(m_dSpace); + } + else { + m_dMark = avgMark.Avg(m_dMark); + m_dSpace = avgSpace.Avg(m_dSpace); + } + if( m_Scope ){ + m_ScopeMark[2].WriteData(m_dMark); + m_ScopeSpace[2].WriteData(m_dSpace); + } + if( m_atc ){ + m_dMark = m_atcMark.Do(m_dMark); + m_dSpace = m_atcSpace.Do(m_dSpace); + if( m_Scope ){ + m_ScopeMark[3].WriteData(m_dMark); + m_ScopeSpace[3].WriteData(m_dSpace); + } + } + break; + } + case 3: // FFT + { + m_Phase.DoFSK(ds); + m_dMark = m_Phase.m_dm; + m_dSpace = m_Phase.m_ds; + + if( m_XYScope || m_Scope ){ + double dm = m_iirm.Do(d); + double ds = m_iirs.Do(d); + + if( m_XYScope ){ // For XY-Scope + m_XYScopeMark.WriteData(dm); + m_XYScopeSpace.WriteData(ds); + } + if( m_Scope ){ // For Scope + m_ScopeMark[0].WriteData(dm); + m_ScopeSpace[0].WriteData(ds); + } + } + // ŒŸ”g +// m_dMark = fabs(m_dMark); +// m_dSpace = fabs(m_dSpace); + if( m_dMark < 0.0 ) m_dMark = -m_dMark; + if( m_dSpace < 0.0 ) m_dSpace = -m_dSpace; + if( m_Scope ){ + m_ScopeMark[1].WriteData(m_dMark); + m_ScopeSpace[1].WriteData(m_dSpace); + } + // •½ŠŠ + if( m_lpf ){ + m_dMark = LpfMark.Do(m_dMark); + m_dSpace = LpfSpace.Do(m_dSpace); + } + else { + m_dMark = avgMark.Avg(m_dMark); + m_dSpace = avgSpace.Avg(m_dSpace); + } + if( m_Scope ){ + m_ScopeMark[2].WriteData(m_dMark); + m_ScopeSpace[2].WriteData(m_dSpace); + } + if( m_atc ){ + m_dMark = m_atcMark.Do(m_dMark); + m_dSpace = m_atcSpace.Do(m_dSpace); + if( m_Scope ){ + m_ScopeMark[3].WriteData(m_dMark); + m_ScopeSpace[3].WriteData(m_dSpace); + } + } +#if 1 // ‚‘¬ŒvŽZ + m_dMark /= (64*32768.0); + m_dSpace /= (64*32768.0); +#else + m_dMark = m_dMark > 0.0 ? sqrt(m_dMark) : 0.0; + m_dSpace = m_dSpace > 0.0 ? sqrt(m_dSpace) : 0.0; + m_dMark *= (1.0/16.0); + m_dSpace *= (1.0/16.0); +#endif + break; + } + default: + { + if( m_type ){ // FIR + m_dMark = DoFIR(HMark, ZMark, d, m_Tap); + m_dSpace = DoFIR(HSpace, ZSpace, d, m_Tap); + } + else { // IIR + m_dMark = m_iirm.Do(d); + m_dSpace = m_iirs.Do(d); + } + if( m_XYScope ){ // For XY-Scope + m_XYScopeMark.WriteData(m_dMark); + m_XYScopeSpace.WriteData(m_dSpace); + } + if( m_Scope ){ // For Scope + m_ScopeMark[0].WriteData(m_dMark); + m_ScopeSpace[0].WriteData(m_dSpace); + } + // ŒŸ”g +// m_dMark = fabs(m_dMark); +// m_dSpace = fabs(m_dSpace); + if( m_dMark < 0 ) m_dMark = -m_dMark; + if( m_dSpace < 0 ) m_dSpace = -m_dSpace; + if( m_Scope ){ + m_ScopeMark[1].WriteData(m_dMark); + m_ScopeSpace[1].WriteData(m_dSpace); + } + // •½ŠŠ + if( m_lpf ){ + m_dMark = LpfMark.Do(m_dMark); + m_dSpace = LpfSpace.Do(m_dSpace); + } + else { + m_dMark = avgMark.Avg(m_dMark); + m_dSpace = avgSpace.Avg(m_dSpace); + } + if( m_Scope ){ + m_ScopeMark[2].WriteData(m_dMark); + m_ScopeSpace[2].WriteData(m_dSpace); + } + if( m_atc ){ + m_dMark = m_atcMark.Do(m_dMark); + m_dSpace = m_atcSpace.Do(m_dSpace); + if( m_Scope ){ + m_ScopeMark[3].WriteData(m_dMark); + m_ScopeSpace[3].WriteData(m_dSpace); + } + } + break; + } + } + DoFSK(); + } + else { + i2 = d; + } + Count++; +} + +int CFSKDEM::GetData(void) +{ + int r; + if( m_BufCount ){ + r = m_Buff[m_rp]; + m_BufCount--; + m_rp++; + if( m_rp >= DEMBUFMAX ) m_rp = 0; + } + else { + r = -1; + } + return r; +} + + +BCODETBL _TTY[]={ // S-BELL + // 0x20 - 0x7f + {0x04, 2}, {0x16, 1}, {0x11, 1}, {0x00, 2}, // !"# + {0x12, 1}, {0x00, 2}, {0x0b, 1}, {0x1a, 1}, // $%&' + {0x1e, 1}, {0x09, 1}, {0x00, 2}, {0x00, 2}, // ()*+ + {0x06, 1}, {0x18, 1}, {0x07, 1}, {0x17, 1}, // ,-./ + {0x0d, 1}, {0x1d, 1}, {0x19, 1}, {0x10, 1}, // 0123 30-33 + {0x0a, 1}, {0x01, 1}, {0x15, 1}, {0x1c, 1}, // 4567 34-37 + {0x0c, 1}, {0x03, 1}, {0x0e, 1}, {0x0f, 1}, // 89 38-3b + {0x00, 2}, {0x00, 2}, {0x00, 2}, {0x13, 1}, // <=>? 3c-3f + {0x00, 2}, {0x18, 0}, {0x13, 0}, {0x0e, 0}, // @ABC 40-43 + {0x12, 0}, {0x10, 0}, {0x16, 0}, {0x0b, 0}, // DEFG + {0x05, 0}, {0x0c, 0}, {0x1a, 0}, {0x1e, 0}, // HIJK + {0x09, 0}, {0x07, 0}, {0x06, 0}, {0x03, 0}, // LMNO + {0x0d, 0}, {0x1d, 0}, {0x0a, 0}, {0x14, 0}, // PQRS + {0x01, 0}, {0x1c, 0}, {0x0f, 0}, {0x19, 0}, // TUVW + {0x17, 0}, {0x15, 0}, {0x11, 0}, {0x00, 2}, // XYZ[ 58-5b + {0x00, 2}, {0x00, 2}, {0x00, 2}, {0x00, 2}, // \]^_ + {0x00, 2}, {0x18, 0}, {0x13, 0}, {0x0e, 0}, // @ABC 60-63 + {0x12, 0}, {0x10, 0}, {0x16, 0}, {0x0b, 0}, // DEFG + {0x05, 0}, {0x0c, 0}, {0x1a, 0}, {0x1e, 0}, // HIJK + {0x09, 0}, {0x07, 0}, {0x06, 0}, {0x03, 0}, // LMNO + {0x0d, 0}, {0x1d, 0}, {0x0a, 0}, {0x14, 0}, // PQRS + {0x01, 0}, {0x1c, 0}, {0x0f, 0}, {0x19, 0}, // TUVW + {0x17, 0}, {0x15, 0}, {0x11, 0}, {0x00, 2}, // XYZ[ 78-7b + {0x00, 2}, {0x00, 2}, {0x00, 2}, {0x00, 2}, // |{~ +}; + +const char _LTR[32]={ + 0x00, 'T', 0x0d, 'O', ' ', 'H', 'N', 'M', + 0x0a, 'L', 'R', 'G', 'I', 'P', 'C', 'V', + 'E', 'Z', 'D', 'B', 'S', 'Y', 'F', 'X', + 'A', 'W', 'J', 0x00, 'U', 'Q', 'K', 0x00, +}; +const char _FIG[32]={ + 0x00, '5', 0x0d, '9', ' ', 'h', ',', '.', + 0x0a, ')', '4', '&', '8', '0', ':', ';', + '3', '"', '$', '?', 's', '6', '!', '/', + '-', '2', 0x27, 0x00, '7', '1', '(', 0x00, +}; + +CRTTY::CRTTY() +{ + m_outfig = 3; + + m_fig = 0; + m_uos = 0; + + m_txuos = 1; + SetCodeSet(); +} + +void CRTTY::SetCodeSet(void) +{ + memcpy(m_TBL, _TTY, sizeof(m_TBL)); + if( sys.m_CodeSet ){ // J-BELL + m_TBL[7].Code = 0x14; + } +} + +// 11011 FIG +// 11111 LTR +char CRTTY::ConvAscii(int d) +{ + char c = 0; + d &= 0x1f; + if( d == 0x1b ){ // FIG + m_fig = 1; + } + else if( d == 0x1f ){ // LTR + m_fig = 0; + } + else if( m_fig ){ + c = _FIG[d]; + if( sys.m_CodeSet ){ + switch(c){ + case 's': + c = 0x27; + break; + case 0x27: + c = 'j'; + break; + } + } + if( m_uos ){ + switch(c){ + case ' ': +// case 0x0d: +// case 0x0a: + m_fig = 0; + break; + default: + break; + } + } + } + else { + c = _LTR[d]; + } + return c; +} + +int CRTTY::ConvRTTY(char d) +{ + int fig = 2; + int r = 0; + switch(d){ + case '_': + r = 0x00ff; + break; + case '~': + r = 0x00fe; + break; + case '[': + r = 0x00fd; + break; + case ']': + r = 0x00fc; + break; + case 0x0a: + r = 0x08; + break; + case 0x0d: + r = 0x02; + break; + case 0x1b: + r = 0x1b; + fig = 1; + break; + case 0x1f: + r = 0x1f; + fig = 0; + break; + default: + if( d >= 0x20 ){ + d -= char(0x20); + r = m_TBL[d].Code; + fig = m_TBL[d].Fig; + } + break; + } + if( fig != 2 ){ + if( fig != m_outfig ){ + r |= (fig ? 0x1b00 : 0x1f00); + m_outfig = fig; + } + } + else if( r == 0x04 ){ // ƒXƒy[ƒX‚ÌŽž + if( sys.m_txuos && (m_outfig == 1) ) m_outfig = 2; + } + return r; +} + +int CRTTY::ConvRTTY(BYTE *t, LPCSTR p) +{ + int n; + int d; + for( n = 0;*p; p++ ){ + d = ConvRTTY(*p); + if( d & 0x0000ff00 ){ + *t++ = BYTE(d >> 8); + n++; + if( sys.m_dblsft ){ + *t++ = BYTE(d >> 8); + n++; + } + } + *t++ = BYTE(d); + n++; + } + return n; +} + +int CRTTY::GetShift(char d) +{ + int fig = 2; + switch(d){ + default: + if( d >= 0x20 ){ + d -= char(0x20); + fig = m_TBL[d].Fig; + if( !m_TBL[d].Code ){ + fig = 2; + } + } + break; + } + return fig; +} + +char CRTTY::InvShift(char c) +{ + int fs = GetShift(c); + if( (c == 'h') || (c == 's') || (c == 'j') ) fs = 1; + int d = ConvRTTY(c) & 0x001f; + switch(fs){ + case 0: + if( _FIG[d] ){ + c = _FIG[d]; + if( sys.m_CodeSet ){ + switch(c){ + case 's': + c = 0x27; + break; + case 0x27: + c = 'j'; + break; + } + } + } + return c; + case 1: + return _LTR[d] ? _LTR[d] : c; + default: + return c; + } +} + +//-------------------------------------------------------- +// CScopeƒNƒ‰ƒX +CScope::CScope() +{ + m_ScopeSize = SCOPESIZE; + m_DataFlag = 0; + + pScopeData = new double[m_ScopeSize]; + memset(pScopeData, 0, sizeof(double)*m_ScopeSize); +} + +CScope::~CScope() +{ + delete[] pScopeData; +} + +void CScope::WriteData(double d) +{ + if( !m_DataFlag ){ + if( m_wp < m_ScopeSize ){ + pScopeData[m_wp] = d; + m_wp++; + if( m_wp >= m_ScopeSize ){ + m_DataFlag = 1; + } + } + } +} + +void CScope::UpdateData(double d) +{ + if( !m_DataFlag ){ + if( m_wp ){ + pScopeData[m_wp-1] = d; + } + } +} + +void CScope::Collect(int size) +{ + m_DataFlag = 1; + m_ScopeSize = size; + m_wp = 0; + m_DataFlag = 0; +} + + + +//-------------------------------------------------------- +// CNoiseƒNƒ‰ƒX +CNoise::CNoise() +{ + reg = 0x12345; + + memset(Z, 0, sizeof(Z)); + MakeFilter(H, NOISEBPFTAP, ffLPF, SampFreq, 3000.0, 3000.0, 60, 1.0); +}; + +double CNoise::GetNoise(void) +{ + DWORD r = reg >> 1; + if( (reg ^ r) & 1 ){ + r |= 0xffe00000; + } + else { + r &= 0x001fffff; + } + reg = r; + double d = double(reg) / 500000.0; +// return d; + return DoFIR(H, Z, d, NOISEBPFTAP); // ‘ш槌À +} + +//-------------------------------------------------------- +// CSamplePeakƒNƒ‰ƒX +CSamplePeak::CSamplePeak() +{ + memset(Strage, 0, sizeof(Strage)); + m_CurPeak = 0.0; + m_Peak = 0.0; + m_Strage = 8 - 1; + SetBaudRate(45.45); +} + +void CSamplePeak::SetBaudRate(double b) +{ + if( b >= 1.0 ){ + m_ReCount = m_Count = int(DemSamp/b + 0.5); + } +} + +void CSamplePeak::Sync(int Delay) +{ + m_Count = m_ReCount - Delay; + while( m_Count < 0 ) m_Count += m_ReCount; + memcpy(Strage, &Strage[1], sizeof(double)*m_Strage); + Strage[m_Strage] = m_CurPeak; + m_Peak = 0.0; + int i; + for( i = 0; i <= m_Strage; i++ ){ + if( m_Peak < Strage[i] ) m_Peak = Strage[i]; + } + m_CurPeak = 0.0; +} + +int CSamplePeak::Sample(double d) +{ + int r = 0; + + if( m_CurPeak < d ){ + m_CurPeak = d; + if( m_Peak < d ){ + m_Peak = d; + r = 1; + } + } + if( !m_Count ){ + Sync(0); + r = 1; + } + m_Count--; + return r; +} + +//-------------------------------------------------------- +// CAGCƒNƒ‰ƒX +CAGC::CAGC() +{ + m_MaxGain = 2048.0; + m_StepGain = 3.0; + m_MarkGain = 1.0; + m_SpaceGain = 1.0; + m_DeffGain = 12.0; + m_Sync = 1; +} + +void CAGC::Sync(int Delay) +{ + if( m_Sync ){ + Mark.Sync(Delay); + Space.Sync(Delay); + } +} + +double CAGC::SampleMark(double d) +{ + if( Mark.Sample(d) ){ + double gain = Mark.GetPeak(); + if( gain ){ + gain = 8192.0 / gain; + double ugain = m_MarkGain * m_StepGain; + double dgain = m_MarkGain / m_StepGain; + if( ugain < gain ){ + m_MarkGain = ugain; + } + else if( dgain > gain ){ + m_MarkGain = dgain; + } + else { + m_MarkGain = gain; + } + if( m_MarkGain > m_MaxGain ) m_MarkGain = m_MaxGain; + } + else { + m_MarkGain = 1.0; + } + } + return d * m_MarkGain; +} + +double CAGC::SampleSpace(double d) +{ + if( Space.Sample(d) ){ + double gain = Space.GetPeak(); + if( gain ){ + gain = 8192.0 / gain; + double ugain = m_SpaceGain * m_StepGain; + double dgain = m_SpaceGain / m_StepGain; + if( ugain < gain ){ + m_SpaceGain = ugain; + } + else if( dgain > gain ){ + m_SpaceGain = dgain; + } + else { + m_SpaceGain = gain; + } + if( m_SpaceGain > m_MaxGain ) m_SpaceGain = m_MaxGain; + if( m_SpaceGain > m_MarkGain ){ + if( m_SpaceGain > m_MarkGain * m_DeffGain ){ + m_SpaceGain = m_MarkGain * m_DeffGain; + } + } + else { + if( m_SpaceGain * m_DeffGain < m_MarkGain ){ + m_SpaceGain = m_MarkGain / m_DeffGain; + } + } + } + else { + m_SpaceGain = 1.0; + } + } + return d * m_SpaceGain; +} + +//-------------------------------------------------------- +// CATCƒNƒ‰ƒX +CATC::CATC() +{ + m_Low = 0; + m_High = 16384.0; + m_CurLow = MAXDOUBLE; + m_CurHigh = -MAXDOUBLE; + m_Max = 4; + m_Cnt = 0; + int i; + for( i = 0; i < ATCMAX; i++ ){ + m_LowList[i] = m_Low; + m_HighList[i] = m_High; + } + m_iir.MakeIIR(100, DemSamp, 3, 0, 0); +} + +double CATC::Do(double d) +{ + if( m_CurLow > d ) m_CurLow = d; + if( m_CurHigh < d ) m_CurHigh = d; +// if( m_Low > d ) m_Low = d; +// if( m_High < d ) m_High = d; + if( !m_Cnt ){ + m_Cnt = 64; + if( m_CurLow > (ATCC-ATCW) ) m_CurLow = (ATCC-ATCW); + if( m_CurHigh < (ATCC+ATCW) ) m_CurHigh = (ATCC+ATCW); + if( m_Max ){ + memcpy(m_LowList, &m_LowList[1], (m_Max)*sizeof(double)); + memcpy(m_HighList, &m_HighList[1], (m_Max)*sizeof(double)); + } + m_LowList[m_Max] = m_CurLow; + m_HighList[m_Max] = m_CurHigh; + int i; + m_Low = m_LowList[0]; + m_High = m_HighList[0]; + for( i = 1; i <= m_Max; i++ ){ + if( m_Low > m_LowList[i] ) m_Low = m_LowList[i]; + if( m_High < m_HighList[i] ) m_High = m_HighList[i]; + } + m_CurLow = MAXDOUBLE; + m_CurHigh = -MAXDOUBLE; + } + m_Cnt--; + double th = ((m_High + m_Low)*0.5); + th = m_iir.Do(th); + if( m_High > m_Low ){ + d = (d - th) * 1.1 + th; + } + d += (ATCC - th); + return d; +} + +//--------------------------------------------------------------------------- +// CFIRƒNƒ‰ƒX +__fastcall CFIR::CFIR() +{ + m_pZ = NULL; + m_pH = NULL; + m_Tap = 0; +} + +//--------------------------------------------------------------------------- +__fastcall CFIR::~CFIR() +{ + if( m_pZ ) delete[] m_pZ; + if( m_pH ) delete[] m_pH; +} +//--------------------------------------------------------------------------- +void __fastcall CFIR::Create(int tap, int type, double fs, double fcl, double fch, double att, double gain) +{ + m_Tap = tap; + if( m_pZ ) delete[] m_pZ; + if( m_pH ) delete[] m_pH; + m_pZ = new double[tap+1]; + m_pH = new double[tap+1]; + memset(m_pZ, 0, sizeof(double)*(tap+1)); + ::MakeFilter(m_pH, tap, type, fs, fcl, fch, att, gain); +} +//--------------------------------------------------------------------------- +double __fastcall CFIR::Do(double d) +{ + return DoFIR(m_pH, m_pZ, d, m_Tap); +} +//--------------------------------------------------------------------------- +void __fastcall CFIR::SaveCoef(LPCSTR pName) +{ + FILE *fp; + if( (fp = fopen(pName, "wt")) != NULL ){ + int i; + for( i = 0; i <= m_Tap; i++ ){ + fprintf(fp, "H[%u]=%lf\n", i, m_pH[i]); + } + fclose(fp); + } +} + +//--------------------------------------------------------------------------- +// CFIR2ƒNƒ‰ƒX +__fastcall CFIR2::CFIR2() +{ + m_pZ = NULL; + m_pH = NULL; + m_pZP = NULL; + m_W = 0; + m_Tap = 0; + m_fs = 0; +} + +//--------------------------------------------------------------------------- +__fastcall CFIR2::~CFIR2() +{ + if( m_pZ ) delete[] m_pZ; + if( m_pH ) delete[] m_pH; +} +//--------------------------------------------------------------------------- +void __fastcall CFIR2::Delete(void) +{ + if( m_pZ ) delete[] m_pZ; + if( m_pH ) delete[] m_pH; + m_pZ = NULL; + m_pH = NULL; + m_pZP = NULL; + m_W = 0; + m_Tap = 0; + m_fs = 0; +} +//--------------------------------------------------------------------------- +void __fastcall CFIR2::Create(int tap, int type, double fs, double fcl, double fch, double att, double gain) +{ + if( (m_Tap != tap) || !m_pZ || !m_pH ){ + if( m_pZ ) delete[] m_pZ; + m_pZ = new double[(tap+1)*2]; + memset(m_pZ, 0, sizeof(double)*(tap+1)*2); + if( m_pH ) delete[] m_pH; + m_pH = new double[tap+1]; + m_W = 0; + } + m_Tap = tap; + m_TapHalf = tap/2; + m_fs = fs; + ::MakeFilter(m_pH, tap, type, fs, fcl, fch, att, gain); +} +//--------------------------------------------------------------------------- +void __fastcall CFIR2::Create(int tap, double fs, double fcl, double fch) +{ + if( (m_Tap != tap) || !m_pZ || !m_pH ){ + if( m_pZ ) delete[] m_pZ; + m_pZ = new double[(tap+1)*2]; + memset(m_pZ, 0, sizeof(double)*(tap+1)*2); + if( m_pH ) delete[] m_pH; + m_pH = new double[tap+1]; + m_W = 0; + } + m_Tap = tap; + m_TapHalf = tap/2; + m_fs = fs; + ::MakeHilbert(m_pH, tap, fs, fcl, fch); +} +//--------------------------------------------------------------------------- +void __fastcall CFIR2::CreateSamp(int tap, double fs, const double *pSmpFQ) +{ + if( (m_Tap != tap) || !m_pZ || !m_pH ){ + if( m_pZ ) delete[] m_pZ; + m_pZ = new double[(tap+1)*2]; + memset(m_pZ, 0, sizeof(double)*(tap+1)*2); + if( m_pH ) delete[] m_pH; + m_pH = new double[tap+1]; + m_W = 0; + } + + int htap = tap/2; + int i, j; + double *pSamp = new double[tap+1]; + memcpy(pSamp, pSmpFQ, sizeof(double)*(tap/2)); + for( i = 0; i < tap/2; i++ ){ + pSamp[tap-i] = pSamp[i]; + } + pSamp[tap/2] = pSamp[tap/2 - 1]; + double *pH = new double[tap+1]; + double re, fm; + + for( i = 0; i <= htap; i++ ){ + re = 0.0; + for( j = 0; j < tap; j++ ){ + fm = 2.0 * PI * double((i*j)%tap)/double(tap); + re += pSamp[j] * cos(fm); + } + pH[i] = re / tap; + } +#if 0 + fm = 0; + for( i = 0; i <= htap; i++ ){ + fm += pH[i]; + } + fm = 0.5 / fm; + for( i = 0; i <= htap; i++ ){ + pH[i] *= fm; + } +#endif + for( i = 0; i <= htap; i++ ) m_pH[htap-i] = pH[i]; + for( i = 0; i < htap; i++ ) m_pH[tap-i] = m_pH[i]; + delete[] pH; + delete[] pSamp; + + m_Tap = tap; + m_TapHalf = htap; + m_fs = fs; +} +//--------------------------------------------------------------------------- +void __fastcall CFIR2::Clear(void) +{ + if( m_pZ ) memset(m_pZ, 0, sizeof(double)*(m_Tap+1)*2); + m_W = 0; +} +//--------------------------------------------------------------------------- +double __fastcall CFIR2::Do(double d) +{ + double *dp1 = &m_pZ[m_W+m_Tap+1]; + m_pZP = dp1; + *dp1 = d; + m_pZ[m_W] = d; + d = 0; + double *hp = m_pH; + for( int i = 0; i <= m_Tap; i++ ){ + d += (*dp1--) * (*hp++); + } + m_W++; + if( m_W > m_Tap ) m_W = 0; + return d; +} +//--------------------------------------------------------------------------- +double __fastcall CFIR2::Do(double *hp) +{ + double d = 0; + double *dp = m_pZP; + for( int i = 0; i <= m_Tap; i++ ){ + d += (*dp--) * (*hp++); + } + return d; +} +//--------------------------------------------------------------------------- +void __fastcall CFIR2::Do(CLX &z, double d) +{ + double *dp1 = &m_pZ[m_W+m_Tap+1]; + m_pZP = dp1; + *dp1 = d; + m_pZ[m_W] = d; + d = 0; + double *hp = m_pH; + for( int i = 0; i <= m_Tap; i++ ){ + d += (*dp1--) * (*hp++); + } + z.j = d; + z.r = m_pZ[m_W+m_TapHalf+1]; + m_W++; + if( m_W > m_Tap ) m_W = 0; +} + + +//--------------------------------------------------------------------------- +// CFIRXƒNƒ‰ƒX +__fastcall CFIRX::CFIRX() +{ + m_pZ = NULL; + m_pH = NULL; + m_pZP = NULL; + m_W = 0; + m_Tap = 0; + m_fs = 0; +} + +//--------------------------------------------------------------------------- +__fastcall CFIRX::~CFIRX() +{ + if( m_pZ ) delete[] m_pZ; + if( m_pH ) delete[] m_pH; +} +//--------------------------------------------------------------------------- +void __fastcall CFIRX::Create(int tap, int type, double fs, double fcl, double fch, double att, double gain) +{ + if( (m_Tap != tap) || !m_pZ || !m_pH ){ + if( m_pZ ) delete[] m_pZ; + m_pZ = new CLX[(tap+1)*2]; + memset(m_pZ, 0, sizeof(CLX)*(tap+1)*2); + if( m_pH ) delete[] m_pH; + m_pH = new double[tap+1]; + m_W = 0; + } + m_Tap = tap; + m_TapHalf = tap/2; + m_fs = fs; + ::MakeFilter(m_pH, tap, type, fs, fcl, fch, att, gain); +} +//--------------------------------------------------------------------------- +void __fastcall CFIRX::Clear(void) +{ + if( m_pZ ) memset(m_pZ, 0, sizeof(CLX)*(m_Tap+1)*2); + m_W = 0; +} +//--------------------------------------------------------------------------- +void __fastcall CFIRX::Do(CLX &d) +{ + CLX *dp1 = &m_pZ[m_W+m_Tap+1]; + m_pZP = dp1; + *dp1 = d; + m_pZ[m_W] = d; + CLX z = 0; + double *hp = m_pH; + for( int i = 0; i <= m_Tap; i++, dp1-- ){ + z.r += dp1->r * (*hp); + z.j += dp1->j * (*hp++); + } + m_W++; + if( m_W > m_Tap ) m_W = 0; + d = z; +} + +/*============================================================================= + CSlideFFTƒNƒ‰ƒX ƒXƒ‰ƒCƒfƒBƒ“ƒO@FFT +=============================================================================*/ +#define SLIDE_WINDOW_COEFF 0.9999 +__fastcall CSlideFFT::CSlideFFT(void) +{ + m_Length = 0; + m_Base = 0; + m_Tones = 0; + m_kWindow = 0; + m_pBase = NULL; + m_pCur = m_pEnd = NULL; +} + +//-------------------------------------------------------------------------- +__fastcall CSlideFFT::~CSlideFFT() +{ + if( m_pBase ) delete[] m_pBase; +} + +//-------------------------------------------------------------------------- +void __fastcall CSlideFFT::Create(int len, int base, int tones) +{ +#if LOGFFT + FILE *fp = fopen("SLIDERFFT.txt", "wt"); + fprintf(fp, "len=%d, base=%d, tones=%d\n", len, base, tones); + fclose(fp); +#endif + if( !m_pBase || (len != m_Length) ){ + if( m_pBase ) delete[] m_pBase; + m_pBase = new CLX[len]; + } + + memset(m_pBase, 0, sizeof(CLX)*len); + memset(m_tWindow, 0, sizeof(m_tWindow)); + memset(m_tData, 0, sizeof(m_tData)); + + m_Length = len; + m_Base = base; + m_Tones = tones; + + double k = 2.0 * PI / double(len); + for(int i = 0; i < tones; i++){ + m_tWindow[i].r = cos((i+base) * k) * SLIDE_WINDOW_COEFF; + m_tWindow[i].j = sin((i+base) * k) * SLIDE_WINDOW_COEFF; + } + m_kWindow = pow(SLIDE_WINDOW_COEFF, len); + m_pCur = m_pBase; + m_pEnd = &m_pBase[m_Length]; +} + +//-------------------------------------------------------------------------- +CLX* __fastcall CSlideFFT::Do(const CLX &zIn) +{ + CLX z; + + if( m_pCur >= m_pEnd ) m_pCur = m_pBase; + z = *m_pCur; + *m_pCur = zIn; + m_pCur++; + z *= m_kWindow; + + CLX *pData = m_tData; + CLX *pWindow = m_tWindow; + for( int i = 0; i < m_Tones; i++, pData++ ){ + *pData -= z; + *pData += zIn; + *pData *= *pWindow++; + } + return m_tData; +} + +/*============================================================================= + CPHASEƒNƒ‰ƒX +=============================================================================*/ +__fastcall CPHASE::CPHASE() +{ + m_TONES = 4; + m_SHIFT = 170.0; + m_SampleFreq = 11025.0*0.5; + m_CarrierFreq = 1750; + m_MixerFreq = 0; + SetSampleFreq(m_SampleFreq); +} +//-------------------------------------------------------------------------- +void __fastcall CPHASE::ShowPara(void) +{ +/* + if( Application->MainForm ){ + char bf[256]; + sprintf(bf, "Car=%.lf, Shift=%.lf", m_CarrierFreq, m_SHIFT); + Application->MainForm->Caption = bf; + } +*/ +} +//-------------------------------------------------------------------------- +void __fastcall CPHASE::SetSampleFreq(double f) +{ + m_SampleFreq = f; + Create(); +} +//-------------------------------------------------------------------------- +void __fastcall CPHASE::Create(void) +{ +// m_fftSHIFT = m_SHIFT * (m_TONES + 1) / m_TONES; + m_fftSHIFT = m_SHIFT * m_TONES / (m_TONES - 1); + m_SymbolLen = m_TONES * m_SampleFreq / m_fftSHIFT; + m_BASEPOINT = int(CPHASE_BASEFREQ * m_TONES / m_fftSHIFT); + + m_MixerFreq = double(m_BASEPOINT) * m_SampleFreq / m_SymbolLen; + m_VCO.SetSampleFreq(m_SampleFreq); + m_Hilbert.Create(20, m_SampleFreq, 25.0, m_SampleFreq*0.5 - 25.0); + m_Hilbert.Clear(); + SetCarrierFreq(m_CarrierFreq); + m_SlideFFT.Create(int(m_SymbolLen + 0.5), m_BASEPOINT, m_TONES); + m_AGC.SetSampleFreq(m_SampleFreq); + m_AGC.SetCarrierFreq(m_CarrierFreq); +// m_LPF.Create(192, ffBEF, m_SampleFreq, 85.0 - 20, 85.0 + 20, 60, 1.0); +#if LOGFFT + m_fp = fopen("FFT.txt", "wt"); +#endif +// ShowPara(); +} +//-------------------------------------------------------------------------- +void __fastcall CPHASE::SetShift(double f) +{ + m_SHIFT = f; + Create(); +} +//-------------------------------------------------------------------------- +void __fastcall CPHASE::SetCarrierFreq(double f) +{ + m_CarrierFreq = f; + m_VCO.SetFreeFreq(m_CarrierFreq - m_MixerFreq); + m_AGC.SetCarrierFreq(m_CarrierFreq); +// ShowPara(); +} +//-------------------------------------------------------------------------- +CLX* __fastcall CPHASE::Do(double d) +{ + m_Hilbert.Do(m_sig, d); // •¡‘f”‰» + + CLX z; + z.r = m_VCO.Do(); + z.j = m_VCO.DoCos(); + z *= m_sig; // Žü”g”•ÏŠ· + +// m_LPF.Do(z); + return m_SlideFFT.Do(z); +} +//-------------------------------------------------------------------------- +void __fastcall CPHASE::DoFSK(double d) +{ +// d = m_AGC.Do(d); + CLX *pFFT = Do(d); + m_dm = pFFT[0].vAbs(); + m_ds = pFFT[m_TONES-1].vAbs(); + +#if LOGFFT + for( int i = 0; i < m_TONES; i++ ){ + if( i ) fprintf(m_fp, ","); + fprintf(m_fp, "%.0lf", pFFT[i].vAbs()); + } + fprintf(m_fp, "\n"); +#endif +} +//-------------------------------------------------------------------------- +void __fastcall DoAvg(double &av, double in, double factor) +{ + av = av * (1.0 - factor) + (in * factor); +} +//--------------------------------------------------------------------------- +__fastcall CFAVG::CFAVG() +{ + Create(16); +} +//--------------------------------------------------------------------------- +void __fastcall CFAVG::Reset(void) +{ + m_Cnt = 0; + m_Sum = 0; + m_Avg = 0; +} +//--------------------------------------------------------------------------- +void __fastcall CFAVG::Reset(double d) +{ + m_Cnt = m_Max; + m_Sum = d * m_Max; + m_Avg = d; +} +//--------------------------------------------------------------------------- +void __fastcall CFAVG::Create(int max) +{ + m_Max = max; + m_Mul = 1.0 / m_Max; + Reset(); +} +//--------------------------------------------------------------------------- +double __fastcall CFAVG::DoZ(double d) +{ + m_Sum += d; + if( m_Cnt < m_Max ){ + m_Cnt++; + } + else { + m_Sum -= m_Avg; + } + m_Avg = m_Sum * m_Mul; + return m_Avg; +} +//--------------------------------------------------------------------------- +double __fastcall CFAVG::Do(double d) +{ + m_Sum += d; + if( m_Cnt < m_Max ){ + m_Cnt++; + m_Avg = m_Sum / m_Cnt; + } + else { + m_Sum -= m_Avg; + m_Avg = m_Sum * m_Mul; + } + return m_Avg; +} + +//-------------------------------------------------------- +// CAGCƒNƒ‰ƒX +__fastcall CAGCX::CAGCX() +{ + m_fc = 1000.0; + m_MonitorFreq = SampFreq/2048; + m_SampleFreq = SampFreq; + m_CarrierFreq = 1750.0; + m_LimitGain = 0.005; + m_AvgOver.Create(4); + Create(); +} +//-------------------------------------------------------- +void __fastcall CAGCX::Create(void) +{ + m_Count = 0; + m_Max = -1.0; + m_Min = 1.0; + m_d = 0; + m_agc = 1.0; +// m_Level.Create(ffLPF, 0.3, m_MonitorFreq, 3, 0, 0); + SetCarrierFreq(m_CarrierFreq); +} +//-------------------------------------------------------- +void __fastcall CAGCX::SetCarrierFreq(double f) +{ + m_CarrierFreq = f; + if( m_CarrierFreq >= 1000.0 ){ + m_Gain = (m_CarrierFreq / 1000.0); + +/* +500 0.003 333 +1000 0.0035 285 1.0 1.0 +1500 0.005 200 1.4 1.5 +1800 0.006 166 1.71 +2000 0.008 125 2.3 2.0 +2100 0.01 100 2.85 2.1 +2200 0.012 83 3.4 2.2 +2300 0.015 66 4.3 2.3 +2400 0.025 40 7.1 2.4 +2500 0.028 36 7.9 2.5 +2600 0.030 33 8.6 2.6 +*/ + if( m_Gain >= 2.35 ){ + m_Gain *= 7.1 / 2.4; + } + else if( m_Gain >= 2.25 ){ + m_Gain *= 4.3 / 2.3; + } + else if( m_Gain >= 2.15 ){ + m_Gain *= 3.4 / 2.2; + } + else if( m_Gain >= 2.05 ){ + m_Gain *= 2.9 / 2.1; + } + else if( m_Gain >= 1.8 ){ + m_Gain *= 2.3 / 2.2; + } + } + else { + m_Gain = 1.0; + } + SetFC(m_fc); +} +//-------------------------------------------------------- +void __fastcall CAGCX::SetFC(double fc) +{ + m_fc = fc; + if( fc > m_CarrierFreq*0.45 ) fc = m_CarrierFreq*0.45; +// m_LPF.Create(ffLPF, fc, m_CarrierFreq, 1, 0, 0); + m_LPF.MakeIIR(fc, m_CarrierFreq, 1, 0, 0); + m_d = 0; + m_TLimit = m_SampleFreq*0.8/m_CarrierFreq; + m_AvgOver.Reset(1.0); +} +//-------------------------------------------------------- +void __fastcall CAGCX::Reset(void) +{ + m_Max = -1.0; + m_Min = 1.0; + m_agc = 1.0; + m_d = 0; + m_Count = 0; + for( int i = 0; i < 12; i++ ){ + m_LPF.Do(1.0); +// m_Level.Do(0); + } + m_AvgOver.Reset(1.0); +} +//-------------------------------------------------------- +double __fastcall CAGCX::Do(double d) +{ + if( m_Max < d ) m_Max = d; + if( m_Min > d ) m_Min = d; + if( (d >= 0) && (m_d < 0) && (m_Count >= m_TLimit) ){ + double amp = m_Max - m_Min; + if( amp > 0.1 ){ + m_agc = m_LPF.Do(5.0/amp); + if( m_agc >= 1.0 ) m_agc = 1.0; + m_Max = -32768.0; + m_Min = 32768.0; + } + m_Count = 0; + } + m_Count++; + m_d = d; + d *= m_agc; + if( d > 2.5 ){ d = 2.5; } else if( d < -2.5 ){ d = -2.5; } + return d; +} +//-------------------------------------------------------- +BOOL __fastcall CAGCX::GetOver(void) +{ +// 5.0 / (65536 * 0.666) + return (m_AvgOver.Do(m_agc) < 0.0001146); +// return (m_agc < 0.0001146); +} +/******************************************************** +CAMPCONT class by JE3HHT on Sep.2010 +*********************************************************/ +__fastcall CAMPCONT::CAMPCONT() +{ + m_Max = g_SinTable.m_Size / 4; + m_iMax = g_SinTable.m_Size / 4; + m_Cnt = m_Max; + m_S = 0; + SetMax(16); +} +//--------------------------------------------------------------------------- +void __fastcall CAMPCONT::SetMax(int max) +{ + m_ADD = m_Max / double(max); +} +//--------------------------------------------------------------------------- +void __fastcall CAMPCONT::Reset(void) +{ + m_Cnt = m_Max; + m_S = 0; +} +//--------------------------------------------------------------------------- +double __fastcall CAMPCONT::Do(int s) +{ + if( s != m_S ){ + m_Cnt = 0.0; + m_S = s; + } + int r = m_Cnt; + if( r >= m_Max ) return s; + m_Cnt += m_ADD; + if( s ){ + return g_SinTable.m_tSin[r]; + } + else { + return g_SinTable.m_tSin[r+m_iMax]; + } +} +/******************************************************** +CAA6YQ class by JE3HHT on Sep.2010 +*********************************************************/ +__fastcall CAA6YQ::CAA6YQ(void) +{ + m_fEnabled = FALSE; + m_bpfTaps = 512; + m_bpfFW = 35.0; + m_befTaps = 256; + m_befFW = 15.0; + m_afcERR = 5.0; + + m_dblMark = 2125.0; + m_dblSpace = 2295.0; + m_dblMarkAFC = m_dblMark; + m_dblSpaceAFC = m_dblSpace; + Create(); +} +//-------------------------------------------------------- +void __fastcall CAA6YQ::Create(void) +{ + m_BPF.Create(m_bpfTaps, ffBPF, SampFreq, m_dblMark-m_bpfFW, m_dblSpace+m_bpfFW, 60.0, 1.0); + double fc = (m_dblMark + m_dblSpace)/2.0; + m_BEF.Create(m_befTaps, ffBEF, SampFreq, fc-m_befFW, fc+m_befFW, 10.0, 1.0); +} +//-------------------------------------------------------- +void __fastcall CAA6YQ::SetMarkFreq(double f) +{ + m_dblMark = f; + m_dblMarkAFC = f; + if( m_fEnabled ) Create(); +} +//-------------------------------------------------------- +void __fastcall CAA6YQ::SetSpaceFreq(double f) +{ + m_dblSpace = f; + m_dblSpaceAFC = f; + if( m_fEnabled ) Create(); +} +//-------------------------------------------------------- +void __fastcall CAA6YQ::SetMarkFreqByAFC(double f) +{ + m_dblMark = f; + double df = fabs(f - m_dblMarkAFC); + if( df >= m_afcERR ){ + m_dblMarkAFC = f; + if( m_fEnabled ) Create(); + } +} +//-------------------------------------------------------- +void __fastcall CAA6YQ::SetSpaceFreqByAFC(double f) +{ + m_dblSpace = f; + double df = fabs(f - m_dblSpaceAFC); + if( df >= m_afcERR ){ + m_dblSpaceAFC = f; + if( m_fEnabled ) Create(); + } +} +//-------------------------------------------------------- +double __fastcall CAA6YQ::Do(double d) +{ + return m_BEF.Do(m_BPF.Do(d)); +} +//-------------------------------------------------------- + + diff --git a/Rtty.h b/Rtty.h new file mode 100644 index 0000000..054873c --- /dev/null +++ b/Rtty.h @@ -0,0 +1,933 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------------- +#ifndef RttyH +#define RttyH +//--------------------------------------------------------------------------- +#include "Fir.h" +#include "CLX.h" + +#define VERFFTDEM 1 // CPhaseX Version +#define VERAA6YQ 2 // CAA6YQ Version + +#define BITDEBUG 0 // ƒLƒƒƒ‰ƒNƒ^’·‚Ì‘ª’è +#define TXDDEBUG 0 // FSK‚̃Lƒƒƒ‰ƒNƒ^’·‚Ì‘ª’è +#define FSKDEBUG 0 // FSK‚̃fƒoƒbƒOƒ‚[ƒh + +#ifndef SampFreq +extern double SampFreq; +#endif + +//--------------------------------------------------------------------------- +// Added by JE3HHT on Aug.2010 +class CFAVG +{ +private: + double m_Sum; + double m_Avg; + double m_Mul; + int m_Max; + int m_Cnt; +public: + __fastcall CFAVG(); + void __fastcall Reset(void); + void __fastcall Reset(double d); + void __fastcall Create(int max); + double __fastcall DoZ(double d); + double __fastcall Do(double d); + inline double __fastcall GetAvg(void){return m_Avg;}; + inline BOOL __fastcall IsFull(void){return m_Max == m_Cnt;}; + inline BOOL __fastcall IsHalf(void){return m_Max <= (m_Cnt*2);}; + inline int __fastcall GetCount(void){return m_Cnt;}; +}; +//-------------------------------------------------------- +// CAGCƒNƒ‰ƒX +// Added by JE3HHT on Aug.2010 +class CAGCX +{ +private: + double m_Max; + double m_Min; + double m_d; + double m_agc; + + double m_fc; + double m_Gain; + CIIR m_LPF; +// CIIR m_Level; + int m_Count; + int m_TLimit; + CFAVG m_AvgOver; +public: + double m_LimitGain; + double m_MonitorFreq; + double m_CarrierFreq; + double m_SampleFreq; +public: + __fastcall CAGCX(); + void __fastcall Create(void); + inline void __fastcall SetSampleFreq(double f){m_SampleFreq = f; Create();}; + void __fastcall SetCarrierFreq(double f); + void __fastcall SetFC(double fc); + void __fastcall Reset(void); + double __fastcall Do(double d); + inline void __fastcall ResetOver(void){m_AvgOver.Reset(1.0);}; + BOOL __fastcall GetOver(void); +}; + +//--------------------------------------------------------------------------- +class CSinTable +{ +public: + double *m_tSin; + int m_Size; +public: + __fastcall CSinTable(); + __fastcall ~CSinTable(); +}; + +//--------------------------------------------------------------------------- +class CAMPCONT +{ +private: + double m_Max; + double m_Cnt; + double m_ADD; + int m_S; + int m_iMax; +public: + __fastcall CAMPCONT(); + void __fastcall SetMax(int max); + void __fastcall Reset(void); + double __fastcall Do(int d); + + inline __fastcall IsMax(void){return m_Cnt >= m_Max;}; +}; + +//--------------------------------------------------------------------------- +class CTICK +{ +public: + int *ptbl[2]; + int m_wsel; + int *m_wp; + int m_wcnt; + int m_Trig; + int m_Samp; +public: + CTICK(); + ~CTICK(); + void Init(void); + void Write(double d); + inline int GetTrig(void){return m_Trig;}; + int *GetData(void); +}; + + +class CVCO +{ +private: + double m_c1; // VCO‚Ì—˜“¾ + double m_c2; // ƒtƒŠ[ƒ‰ƒ“ƒjƒ“ƒOŽü”g” + int m_z; + + int m_TableSize; + double *pSinTbl; + double m_FreeFreq; + double m_SampleFreq; + int m_vlock; +public: + CVCO(); + ~CVCO(); + void VirtualLock(void); + void InitPhase(void); + void SetGain(double gain); + void SetSampleFreq(double f); + void SetFreeFreq(double f); + double Do(double d); +}; + +//--------------------------------------------------------------------------- +// Added by JE3HHT on Aug.2010 +class CVCOX +{ +private: + double m_c1; // VCO‚Ì—˜“¾ + double m_c2; // ƒtƒŠ[ƒ‰ƒ“ƒjƒ“ƒOŽü”g” + double m_z; + + double m_FreeFreq; + double m_SampleFreq; + int m_TableSize; + double m_TableCOS; +public: + __fastcall CVCOX(); + __fastcall ~CVCOX(); + void __fastcall InitPhase(void); + void __fastcall SetGain(double gain); + void __fastcall SetSampleFreq(double f); + void __fastcall SetFreeFreq(double f); + double __fastcall Do(void); + double __fastcall Do(double d); + double __fastcall DoCos(void); +}; + +class CSmooz{ +private: + double *bp; + int Wp; + int Max; + int Cnt; + inline void IncWp(void){ + Wp++; + if( Wp >= Max ) Wp = 0; + }; + inline double Avg(void){ + double d = 0.0; + int i; + for( i = 0; i < Cnt; i++ ){ + d += bp[i]; + } + if( Cnt ){ + return d/double(Cnt); + } + else { + return 0; + } + }; +public: + inline CSmooz(int max = 60){ + Max = max; + bp = new double[max]; + Cnt = 0; + Wp = 0; + }; + inline ~CSmooz(void){ + delete[] bp; + }; + inline void SetCount(int n){ + double *np = new double[n]; + Max = n; + Cnt = Wp = 0; + double *op = bp; + bp = np; + delete[] op; //JA7UDE 0428 + //delete[] np; //JA7UDE 0428 + }; + inline double Avg(double d){ + bp[Wp] = d; + IncWp(); + if( Cnt < Max ){ + Cnt++; + } + return Avg(); + }; +}; + +//--------------------------------------------------------------------------- +// Added by JE3HHT on Aug.2010 +class CFIR +{ +private: + int m_Tap; + double *m_pZ; + double *m_pH; +public: + __fastcall CFIR(); + __fastcall ~CFIR(); + void __fastcall Create(int tap, int type, double fs, double fcl, double fch, double att, double gain); + double __fastcall Do(double d); + void __fastcall SaveCoef(LPCSTR pName); + inline double __fastcall GetHD(int n){return m_pH[n];}; + inline double *__fastcall GetHP(void){return m_pH;}; + inline int __fastcall GetTap(void){return m_Tap;}; +}; + +//--------------------------------------------------------------------------- +// ƒ_ƒuƒ‹ƒoƒbƒtƒ@‚É‚æ‚éFIRƒtƒBƒ‹ƒ^ +// Added by JE3HHT on Aug.2010 +class CFIR2 +{ +private: + int m_Tap; + int m_TapHalf; + double *m_pZ; + double *m_pH; + double *m_pZP; + + int m_W; + double m_fs; +public: + __fastcall CFIR2(); + __fastcall ~CFIR2(); + void __fastcall Delete(void); + void __fastcall Clear(void); + void __fastcall Create(int tap, int type, double fs, double fcl, double fch, double att, double gain); + void __fastcall Create(int tap, double fs, double fcl, double fch); + void __fastcall CreateSamp(int tap, double fs, const double *pSmpFQ); + double __fastcall Do(double d); + double __fastcall Do(double *hp); + void __fastcall Do(CLX &z, double d); + + inline double __fastcall GetHD(int n){return m_pH[n];}; + inline double *__fastcall GetHP(void){return m_pH;}; + inline int __fastcall GetTap(void){return m_Tap;}; + inline double __fastcall GetSampleFreq(void){return m_fs;}; +}; +//--------------------------------------------------------------------------- +// ƒ_ƒuƒ‹ƒoƒbƒtƒ@‚É‚æ‚éFIRƒtƒBƒ‹ƒ^(•¡‘f”—p) +// Added by JE3HHT on Aug.2010 +class CFIRX +{ +private: + int m_Tap; + int m_TapHalf; + CLX *m_pZ; + double *m_pH; + CLX *m_pZP; + + int m_W; + double m_fs; +public: + __fastcall CFIRX(); + __fastcall ~CFIRX(); + void __fastcall Clear(void); + void __fastcall Create(int tap, int type, double fs, double fcl, double fch, double att, double gain); + void __fastcall Do(CLX &d); + + inline double __fastcall GetHD(int n){return m_pH[n];}; + inline double *__fastcall GetHP(void){return m_pH;}; + inline int __fastcall GetTap(void){return m_Tap;}; + inline double __fastcall GetSampleFreq(void){return m_fs;}; +}; +//--------------------------------------------------------------------------- +// ƒXƒ‰ƒCƒfƒBƒ“ƒOFFT +// Added by JE3HHT on Aug.2010 +class CSlideFFT +{ +private: + int m_Length; + int m_Base; + int m_Tones; + + CLX m_tData[16]; + CLX m_tWindow[16]; + + CLX *m_pCur; + CLX *m_pEnd; + CLX *m_pBase; + + double m_kWindow; +private: +public: + __fastcall CSlideFFT(); + __fastcall ~CSlideFFT(); + + void __fastcall Create(int len, int base, int tones); + CLX* __fastcall Do(const CLX &zIn); +}; + +/*============================================================================= + CPHASEƒNƒ‰ƒX +=============================================================================*/ +#define CPHASE_BASEFREQ 0.0 +class CPHASE +{ +private: +// CFIRX m_LPF; + CVCOX m_VCO; + CFIR2 m_Hilbert; + CAGCX m_AGC; + + FILE *m_fp; +public: + CLX m_sig; + CSlideFFT m_SlideFFT; + + int m_TONES; + double m_SHIFT; + double m_fftSHIFT; + int m_BASEPOINT; + + double m_MixerFreq; + double m_SymbolLen; + double m_CarrierFreq; + double m_SampleFreq; + + double m_dm; + double m_ds; +private: +public: + __fastcall CPHASE(); + void __fastcall Create(void); + void __fastcall SetSampleFreq(double f); + void __fastcall SetCarrierFreq(double f); + inline void __fastcall AddCarrierFreq(double f){ + SetCarrierFreq(m_CarrierFreq + f); + }; + CLX* __fastcall Do(double d); + inline CFIR2* __fastcall GetFIR(void){return &m_Hilbert;}; + + void __fastcall DoFSK(double d); + void __fastcall SetShift(double f); + void __fastcall ShowPara(void); + + inline void SetTones(int n){ + m_TONES = n; + Create(); + } +}; + +class CPLL +{ +private: + CIIR loopLPF; + CIIR outLPF; + + double m_err; + double m_out; + double m_vcoout; + double m_SampleFreq; + double m_FreeFreq; + double m_Shift; +public: + int m_loopOrder; + double m_loopFC; + int m_outOrder; + double m_outFC; + double m_vcogain; +public: + CVCO vco; + inline CPLL(){ + m_err = 0; + m_out = 0; + m_vcoout = 0; + m_vcogain = 3.0; + m_SampleFreq = SampFreq * 0.5; + m_Shift = 170.0; + m_FreeFreq = (2125 + 2295)/2; + m_loopOrder = 2; + m_outOrder = 4; + m_loopFC = 250.0; + m_outFC = 200.0; + SetFreeFreq(2125, 2295); + SetSampleFreq(m_SampleFreq); + }; + inline void SetVcoGain(double g){ + m_vcogain = g; + vco.SetGain(-m_Shift * g); + }; + inline void MakeLoopLPF(void){ + loopLPF.MakeIIR(m_loopFC, m_SampleFreq, m_loopOrder, 0, 0); + } + inline void MakeOutLPF(void){ + outLPF.MakeIIR(m_outFC, m_SampleFreq, m_outOrder, 0, 0); + } + inline void SetFreeFreq(double f1, double f2){ + m_FreeFreq = (f1 + f2)/2.0; + m_Shift = f2 - f1; + vco.SetFreeFreq(m_FreeFreq); + vco.SetGain(-m_Shift * m_vcogain); + } + void SetSampleFreq(double f){ + m_SampleFreq = f; + vco.SetSampleFreq(f); + vco.SetFreeFreq(m_FreeFreq); + SetVcoGain(3.0); + MakeLoopLPF(); + MakeOutLPF(); + }; + double Do(double d){ + d /= 32768.0; + // Loop Filter + m_out = loopLPF.Do(m_err); + // VCO + m_vcoout = vco.Do(m_out); + // ˆÊ‘Š”äŠr + m_err = m_vcoout * d; + return outLPF.Do(m_out) * 32768.0; + }; + inline double GetErr(void){return m_err*32768;}; // Phase Det + inline double GetOut(void){return m_out*32768;}; // Phase Det + inline double GetVco(void){return m_vcoout;}; +}; + + +#define SCOPESIZE 8192 +class CScope +{ +private: + int m_DataFlag; + + int m_wp; + +public: + int m_ScopeSize; + double *pScopeData; + +public: + CScope(); + ~CScope(); + void WriteData(double d); + void UpdateData(double d); + inline int GetFlag(void){m_DataFlag; return 0;}; //JA7UDE 0428 + void Collect(int size); +}; + +#define SAMPLEPEAKMAX 16 +class CSamplePeak +{ +private: + double Strage[SAMPLEPEAKMAX]; + double m_CurPeak; + double m_Peak; + + int m_Strage; + int m_Count; + int m_ReCount; +public: + CSamplePeak(); + + inline int GetStrage(void){ return m_Strage + 1;}; + inline void SetStrage(int n){ + if( n > SAMPLEPEAKMAX ) n = SAMPLEPEAKMAX; + m_Strage = n ? (n - 1) : 0; + }; + double GetPeak(void){return m_Peak;}; + void SetBaudRate(double b); + void Sync(int Delay); + int Sample(double d); +}; + +class CAGC +{ +private: + double m_MarkGain; + double m_SpaceGain; +public: + int m_Sync; + double m_StepGain; + double m_MaxGain; + double m_DeffGain; + CSamplePeak Mark; + CSamplePeak Space; +public: + CAGC(); + void Sync(int Delay); + double SampleMark(double d); + double SampleSpace(double d); + +}; + +#define ATCMAX 17 +#define ATCC (8192.0) +#define ATCW (1024.0) +class CATC +{ +private: + double m_Low; + double m_High; + double m_CurLow; + double m_CurHigh; + double m_LowList[ATCMAX]; + double m_HighList[ATCMAX]; + int m_Cnt; + CIIR m_iir; +public: + int m_Max; +public: + CATC(); + double Do(double d); +}; + +/******************************************************** +CAA6YQ class by JE3HHT on Sep.2010 +*********************************************************/ +class CAA6YQ { // Added by JE3HHT on Sep.2010 +public: + BOOL m_fEnabled; + int m_bpfTaps; + int m_befTaps; + double m_bpfFW; + double m_befFW; + double m_afcERR; + + double m_dblMark; + double m_dblSpace; + double m_dblMarkAFC; + double m_dblSpaceAFC; + + CFIR2 m_BPF; + CFIR2 m_BEF; +private: +public: + __fastcall CAA6YQ(void); + void __fastcall Create(void); + void __fastcall SetMarkFreq(double f); + void __fastcall SetSpaceFreq(double f); + void __fastcall SetMarkFreqByAFC(double f); + void __fastcall SetSpaceFreqByAFC(double f); + double __fastcall Do(double d); +}; + +#define DEMBUFMAX 512 +#define DEMBPFTAP 36 +class CFSKDEM +{ +private: + double HMark[TAPMAX+1]; + double ZMark[TAPMAX+1]; + double HSpace[TAPMAX+1]; + double ZSpace[TAPMAX+1]; + + int Count; // ƒfƒ‚ƒWƒ…ƒŒ[ƒ^ƒfƒBƒXƒpƒbƒ` + double i2; // ƒfƒ‚ƒWƒ…ƒŒ[ƒ^2ndInput + + CDECM2 DECM2; // ƒfƒ‚ƒWƒ…ƒŒ[ƒ^ + + int m_Smooz; + CSmooz avgMark; + CSmooz avgSpace; + + double m_BaudRate; + int m_Count; + int m_ReCount; + + int m_mode; + int m_inv; + int m_sq; + double m_SQLevel; + + int m_Tap; + double m_FilWidth; + double m_MarkFreq; + double m_SpaceFreq; + double m_SetMarkFreq; + double m_SetSpaceFreq; + double m_AFCMarkFreq; + double m_AFCSpaceFreq; + + int m_DataCount; + BYTE m_Data; + + int m_BufCount; + BYTE m_Buff[DEMBUFMAX]; + int m_wp; + int m_rp; + + double m_dMark; + double m_dSpace; + int m_mark; + int m_space; + + double m_SmoozFreq; + + int m_SumParity; + + CIIRTANK m_iirm; + CIIRTANK m_iirs; + + int m_sqcount; + CSmooz SmoozSQ; + + COVERLIMIT OverLimit; +public: + int m_type; + double m_iirfw; + + int m_OverFlow; +// int m_Bit; + int m_Scope; + int m_XYScope; + + int m_BitLen; + int m_StopLen; + int m_Parity; + + int m_majority; // ‘½”ŒˆƒƒWƒbƒN + int m_ignoreFream; // ƒtƒŒ[ƒ~ƒ“ƒOƒGƒ‰[‚Ì–³Ž‹ + + int m_Limit; + int m_LimitAGC; + double m_LimitGain; + + double m_limitMax; + double m_limitMin; + double m_d; + double m_limitagc; + + double m_deff; + double m_avgdeff; + + CScope m_XYScopeMark; + CScope m_XYScopeSpace; + CScope m_ScopeMark[4]; + CScope m_ScopeSpace[4]; + CScope m_ScopeSync; + CScope m_ScopeBit; + + CPLL m_pll; + + int m_lpf; + int m_lpfOrder; + double m_lpffreq; + CIIR LpfMark; + CIIR LpfSpace; + + int m_LimitOverSampling; + int m_Tick; + CTICK Tick; + int m_atc; + CATC m_atcMark; + CATC m_atcSpace; + CATC m_atcPLL; + + CPHASE m_Phase; + CAA6YQ m_AA6YQ; +#if BITDEBUG + int m_bitCount; + int m_bitCountA; +#endif +private: + void DoFSK(void); + + +public: + CFSKDEM(); + void Do(double d); + + inline void ClearMode(void){m_mode = 0;}; + double GetFilWidth(int tap); + + void SetIIR(double b); + + void AFCMarkFreq(double d); + void AFCSpaceFreq(double d); + void SetMarkFreq(double d); + void SetSpaceFreq(double d); + inline double GetMarkFreq(void){return m_MarkFreq;}; + inline double GetSpaceFreq(void){return m_SpaceFreq;}; + inline double GetSetMarkFreq(void){return m_SetMarkFreq;}; + inline double GetSetSpaceFreq(void){return m_SetSpaceFreq;}; + inline double GetAFCMarkFreq(void){return m_AFCMarkFreq;}; + inline double GetAFCSpaceFreq(void){return m_AFCSpaceFreq;}; + inline int GetRev(void){ return m_inv; }; + inline void SetRev(int inv){ m_inv = inv;}; + void SetBaudRate(double b); + inline double GetBaudRate(void){return m_BaudRate;}; + inline double GetSmoozFreq(void){return m_SmoozFreq;}; + inline int GetSmoozCount(void){return m_Smooz;}; + void SetSmoozCount(int n); + void SetSmoozFreq(double f); + void SetLPFFreq(double f); + inline int GetSQ(void){return m_sq;}; + inline void SetSQ(int sq){m_sq = sq;}; + inline double GetSQLevel(void){return m_SQLevel;}; + inline void SetSQLevel(double lvl){m_SQLevel = lvl;}; + + inline int GetFilterTap(void){return m_Tap;}; + void SetFilterTap(int tap); + inline int GetCount(void){return m_BufCount;}; + int GetData(); + inline void ClearRXBuf(void){ + m_BufCount = 0; + m_rp = m_wp = 0; + m_mode = 0; + }; + void WriteData(BYTE d); +}; + +#define MODBUFMAX 2048 +class CFSKMOD +{ +private: + double HBPF[TAPMAX+1]; + double ZBPF[TAPMAX+1]; + + CSmooz avgLPF; + double m_LPFFreq; + double m_SampFreq; + + CVCO vco; + + BYTE m_Buff[MODBUFMAX]; + int m_rp; + int m_wp; + int m_cnt; + + int m_Count; + int m_out; + + int m_inv; + + int m_mode; + int m_DataCount; + + double m_BaudRate; + double m_MarkFreq; + double m_SpaceFreq; + + double m_OutputGain; + + BYTE m_Data; + int m_FSKCount; + + int m_SumParity; + int m_fig; + int m_figout; + + int m_idle; + CFSKDEM *pDem; + +private: +public: + int m_BitLen; + int m_StopLen; + int m_Parity; + int m_diddle; + int m_bpf; + int m_bpftap; + int m_lpf; + + int m_DiddleWait; + int m_CharWait; + int m_CharWaitDiddle; + int m_RandomDiddle; + int m_WaitTimer; + int m_DisDiddle; + int m_CharWaitCount; + int m_WaitTimerCount; + + int m_ReCount; + + int m_CoutCount; + + int m_AmpVal; + CAMPCONT m_Amp; + + CFSKMOD(); + inline int IsIdle(void){return m_idle;}; + inline double GetBaudRate(void){return m_BaudRate;}; + void SetBaudRate(double b); + void CalcBPF(void); + void SetMarkFreq(double d); + void SetSpaceFreq(double d); + void SetSampFreq(double f); + inline void InitPhase(void){ + vco.InitPhase(); + m_mode = 0; + m_CharWaitCount = 0; + m_WaitTimerCount = 4; + m_Data = 0; + memset(ZBPF, 0, (m_bpftap+1) * sizeof(double)); + }; + void OutTone(int sw, int bsize); + inline int GetMode(void){ + return m_mode; + }; + inline double GetMarkFreq(void){return m_MarkFreq;}; + inline double GetSpaceFreq(void){return m_SpaceFreq;}; + inline int GetRev(void){return m_inv;}; + inline void SetRev(int inv){m_inv = inv;}; + inline double GetOutputGain(void){return m_OutputGain;}; + inline void SetOutputGain(double gain){m_OutputGain = gain;}; + inline void SetBPF(int sw){m_bpf = sw;}; + + inline double GetLPFFreq(void){return m_LPFFreq;}; + void SetLPFFreq(double f); + + inline void SetCount(int count){ + m_Count = count; + }; + inline void ClearTXBuf(void){ + m_out = -1; + m_Count = m_ReCount/2; + m_cnt = 0; + m_rp = m_wp = 0; + m_figout = 0; + m_DisDiddle = -1; + m_Data = 0; + m_FSKCount = m_SampFreq * 2; + }; + inline void DeleteTXBuf(void){ + m_cnt = 0; + m_rp = m_wp = 0; + m_figout = 0; + }; + inline int SetDiddleTimer(int n){ + m_DisDiddle = n; + return 0; //JA7UDE 0428 + }; + inline int GetBufCount(void){return m_cnt;}; + void PutData(int d); + double Do(int echo); + inline void SetDem(CFSKDEM *p){pDem = p;}; +}; + +#pragma option -a- // ƒpƒbƒN‚ÌŽwަ +typedef struct { + BYTE Code; + BYTE Fig; +}BCODETBL; +#pragma option -a. // ƒpƒbƒN‰ðœ‚ÌŽwަ + +class CRTTY +{ +private: + int m_outfig; + BCODETBL m_TBL[24*4]; + +public: + int m_fig; + int m_uos; + + int m_txuos; + CRTTY(); + char ConvAscii(int d); + int ConvRTTY(char d); + int ConvRTTY(BYTE *t, LPCSTR p); + inline int IsChar(int d){ + d &= 0x000000ff; + if( !d ) return 0; + if( d == 0x000000ff ) return 0; + return 1; + }; + inline void ClearTX(void){m_outfig = 3;}; + inline void ClearRX(void){m_fig = 0;}; + + int GetShift(char d); + char InvShift(char c); + void SetCodeSet(void); +}; + +#define NOISEBPFTAP 12 +class CNoise // MŒn—ñƒmƒCƒY N=22 (Tap=1) +{ +private: + double H[NOISEBPFTAP+1]; + double Z[NOISEBPFTAP+1]; + + DWORD reg; + +public: + CNoise(); + double GetNoise(void); +}; +#endif diff --git a/Scope.cpp b/Scope.cpp new file mode 100644 index 0000000..52cffbd --- /dev/null +++ b/Scope.cpp @@ -0,0 +1,407 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "Scope.h" +#include "Option.h" +#include "Main.h" +//--------------------------------------------------------------------- +#pragma resource "*.dfm" +//TTScope *TScope; +static int m_SourceSel = 0; +static int m_XW = 2048; +static int m_XOFF = (8192 - m_XW)/2; +static int m_CursorX = m_XOFF+(m_XW/2); +static double m_Gain = 2.0; +//--------------------------------------------------------------------- +__fastcall TTScope::TTScope(TComponent* AOwner) + : TForm(AOwner) +{ + FormStyle = ((TForm *)AOwner)->FormStyle; + Font->Name = ((TForm *)AOwner)->Font->Name; + Font->Charset = ((TForm *)AOwner)->Font->Charset; + if( Font->Charset != SHIFTJIS_CHARSET ){ + Caption = "MMTTY Digital Scope"; + OKBtn->Caption = "Close"; + SrcSel->Caption = "Source"; + SrcSel->Items->Strings[1] = "Det."; + SrcSel->Items->Strings[2] = "LPF"; + SBUpDown->Caption = "+-"; + UpBtn->Caption = "+"; + DownBtn->Caption = "-"; + LeftBtn->Caption = "<-"; + RightBtn->Caption = "->"; + } + + pBitmap = new Graphics::TBitmap(); + pBitmap->Width = PaintBox->Width; + pBitmap->Height = PaintBox->Height; + + TRect rc; + rc.Top = 0; + rc.Bottom = pBitmap->Height; + rc.Left = 0; + rc.Right = pBitmap->Width; + pBitmap->Canvas->Brush->Color = clBlack; + pBitmap->Canvas->FillRect(rc); + + pDem = NULL; + pMod = NULL; + +// m_XW = 2048; +// m_Gain = 1.0; +} +//--------------------------------------------------------------------- +__fastcall TTScope::~TTScope() +{ + delete pBitmap; +} +//--------------------------------------------------------------------- +void __fastcall TTScope::Execute(CFSKDEM *pd, CFSKMOD *pm) +{ + pDem = pd; + pMod = pm; + + SrcSel->ItemIndex = m_SourceSel; + UpdateBtn(); + ShowModal(); +} + +void __fastcall TTScope::TrigNext(void) +{ + pDem->m_Scope = 0; + for( int i = 0; i < 4; i++ ){ + pDem->m_ScopeMark[i].Collect(SCOPESIZE); + pDem->m_ScopeSpace[i].Collect(SCOPESIZE); + } + pDem->m_ScopeSync.Collect(SCOPESIZE); + pDem->m_ScopeBit.Collect(SCOPESIZE); + pDem->m_Scope = 1; +} + +#define GAGEWIDTH 5 + +void __fastcall TTScope::PaintPosition(void) +{ + TCanvas *pCanvas = pBitmap->Canvas; + + TRect rc; + rc.Top = 0; + rc.Bottom = GAGEWIDTH; + rc.Left = 0; + rc.Right = pBitmap->Width; + + pCanvas->Brush->Color = clBlack; + pCanvas->FillRect(rc); + + int xw = (m_XW * rc.Right) / pDem->m_ScopeBit.m_ScopeSize; + int x = (m_XOFF * rc.Right) / pDem->m_ScopeBit.m_ScopeSize; + int xc = (m_CursorX * rc.Right) / pDem->m_ScopeBit.m_ScopeSize; + pCanvas->Brush->Color = clGreen; + rc.Left = x; + rc.Right = x + xw; + pCanvas->FillRect(rc); + + pCanvas->Pen->Color = clYellow; + pCanvas->Pen->Style = psSolid; + pCanvas->MoveTo(xc, rc.Top); + pCanvas->LineTo(xc, rc.Bottom); + + pCanvas->Font->Color = clWhite; + pCanvas->Font->Size = 8; + char bf[32]; + sprintf(bf, "Gain:%.1lf", m_Gain); + ::SetBkMode(pCanvas->Handle, TRANSPARENT); + pCanvas->TextOut(0, 0, bf); +} + +void __fastcall TTScope::PaintScope(CScope *sp, int n) +{ + TRect rc; + + int YW = (pBitmap->Height - GAGEWIDTH) / 4; + rc.Top = (YW * n) + GAGEWIDTH; + rc.Bottom = rc.Top + YW; + rc.Left = 0; + rc.Right = pBitmap->Width; + + TCanvas *pCanvas = pBitmap->Canvas; + + pCanvas->Brush->Color = clBlack; + pCanvas->FillRect(rc); + + if( !sp->GetFlag() ) return; + + if( n < 2 ){ + pCanvas->Pen->Color = clWhite; + pBitmap->Canvas->Pen->Style = psDot; + pCanvas->MoveTo(rc.Left, rc.Top + YW/2); + pCanvas->LineTo(rc.Right, rc.Top + YW/2); + } + + pCanvas->Pen->Color = clWhite; + pBitmap->Canvas->Pen->Style = psSolid; + double d; + int x, y, xx, xe; + double ad = 0; + for( x = 0; x < rc.Right; x++ ){ + xx = (x * m_XW / rc.Right) + m_XOFF; + xe = xx + (m_XW / rc.Right); + if( xe >= sp->m_ScopeSize ) xe = sp->m_ScopeSize - 1; + for( ; xx <= xe; xx++ ){ + d = sp->pScopeData[xx]; + if( n >= 2 ){ + if( d < -8000.0 ){ + d = 8192.0; + pCanvas->Pen->Color = clYellow; + } + else if( d < -4000 ){ + d = 8192.0; + pCanvas->Pen->Color = clBlue; + } + else if( d || (ad == 0) ){ + pCanvas->Pen->Color = clWhite; + } + ad = d; + y = rc.Bottom - int(d * YW/10000.0) - 1; + } + else if( (m_SourceSel == 1) && (MmttyWd->pSound->FSKDEM.m_type == 2) ){ + y = rc.Bottom - int(d * YW * m_Gain/32768.0) - YW/2; + } + else if( m_SourceSel ){ + y = rc.Bottom - int(d * YW * m_Gain/16384.0) - 1; + } + else { + y = rc.Bottom - int(d * YW * m_Gain/32768.0) - YW/2; + } + if( y < rc.Top ) y = rc.Top; + if( y > rc.Bottom ) y = rc.Bottom; + if( x ){ + pCanvas->LineTo(x, y); + } + else { + pCanvas->MoveTo(x, y); + } + } + } +} + +void __fastcall TTScope::PaintCursor(void) +{ + int x = (m_CursorX - m_XOFF) * PaintBox->Width / m_XW; + if( (x >= 0) && (x < PaintBox->Width) ){ + PaintBox->Canvas->Pen->Color = clLime; + PaintBox->Canvas->Pen->Style = psDot; + PaintBox->Canvas->MoveTo(x, 5); + PaintBox->Canvas->LineTo(x, pBitmap->Height - GAGEWIDTH - 5); + } +} + +void __fastcall TTScope::PaintBoxPaint(TObject *Sender) +{ + if( pDem == NULL ) return; + + PaintScope(&pDem->m_ScopeMark[m_SourceSel], 0); + PaintScope(&pDem->m_ScopeSpace[m_SourceSel], 1); + PaintScope(&pDem->m_ScopeBit, 2); + PaintScope(&pDem->m_ScopeSync, 3); + PaintPosition(); + PaintBox->Canvas->Draw(0, 0, (TGraphic*)pBitmap); + PaintCursor(); +} +//--------------------------------------------------------------------------- +void __fastcall TTScope::TimerTimer(TObject *Sender) +{ + if( pDem == NULL ) return; + + if( pDem->m_ScopeBit.GetFlag() ){ + PaintBoxPaint(NULL); + if( SBTrig->Down ){ + SBTrig->Down = FALSE; + } + } +} +//--------------------------------------------------------------------------- +void __fastcall TTScope::SBTrigClick(TObject *Sender) +{ + TrigNext(); +} +//--------------------------------------------------------------------------- +void __fastcall TTScope::UpdateBtn(void) +{ + if( m_XW <= (pDem->m_ScopeBit.m_ScopeSize - 512) ){ + SBUpW->Enabled = TRUE; + } + else { + SBUpW->Enabled = FALSE; + } + if( m_XW >= 1024 ){ + SBDownW->Enabled = TRUE; + } + else { + SBDownW->Enabled = FALSE; + } + if( m_XOFF ){ + LeftBtn->Enabled = TRUE; + } + else { + LeftBtn->Enabled = FALSE; + } + if( (m_XOFF + m_XW) < pDem->m_ScopeBit.m_ScopeSize ){ + RightBtn->Enabled = TRUE; + } + else { + RightBtn->Enabled = FALSE; + } + if( pDem->m_atc ){ + SrcSel->Controls[3]->Enabled = TRUE; + } + else { + SrcSel->Controls[3]->Enabled = FALSE; + if( SrcSel->ItemIndex == 3 ){ + SrcSel->ItemIndex = m_SourceSel = 2; + } + } +} +//--------------------------------------------------------------------------- +void __fastcall TTScope::LeftBtnClick(TObject *Sender) +{ + if( m_XOFF ){ + m_XOFF -= m_XW/4; + if( m_XOFF < 0 ) m_XOFF = 0; + } + UpdateBtn(); +} +//--------------------------------------------------------------------------- +void __fastcall TTScope::RightBtnClick(TObject *Sender) +{ + m_XOFF += m_XW/4; + if( (m_XOFF + m_XW) >= pDem->m_ScopeBit.m_ScopeSize ){ + m_XOFF = pDem->m_ScopeBit.m_ScopeSize - m_XW; + } + UpdateBtn(); +} +//--------------------------------------------------------------------------- +void __fastcall TTScope::AdjXoff(int x) +{ + if( (x >= 0) && (x < PaintBox->Width) ){ + int xoff = x * m_XW / PaintBox->Width + m_XOFF + 1; + m_XOFF += (m_CursorX - xoff); + if( m_XOFF < 0 ){ + m_XOFF = 0; + } + else if( (m_XOFF + m_XW) > pDem->m_ScopeBit.m_ScopeSize ){ + m_XOFF = pDem->m_ScopeBit.m_ScopeSize - m_XW; + } + } + else if( (m_XOFF + m_XW) > pDem->m_ScopeBit.m_ScopeSize ){ + m_XOFF = pDem->m_ScopeBit.m_ScopeSize - m_XW; + } +} +//--------------------------------------------------------------------------- +void __fastcall TTScope::SBDownWClick(TObject *Sender) +{ + int x = (m_CursorX - m_XOFF) * PaintBox->Width / m_XW; + if( m_XW >= 1024 ){ + m_XW -= 512; + AdjXoff(x); + PaintBoxPaint(NULL); + } + UpdateBtn(); +} +//--------------------------------------------------------------------------- +void __fastcall TTScope::SBUpWClick(TObject *Sender) +{ + int x = (m_CursorX - m_XOFF) * PaintBox->Width / m_XW; + if( m_XW <= (pDem->m_ScopeBit.m_ScopeSize - 512) ){ + m_XW += 512; + AdjXoff(x); + PaintBoxPaint(NULL); + } + UpdateBtn(); +} +//--------------------------------------------------------------------------- +void __fastcall TTScope::UpBtnClick(TObject *Sender) +{ + m_Gain *= 1.2; + PaintBoxPaint(NULL); +} +//--------------------------------------------------------------------------- +void __fastcall TTScope::DownBtnClick(TObject *Sender) +{ + m_Gain /= 1.2; + PaintBoxPaint(NULL); +} +//--------------------------------------------------------------------------- +void __fastcall TTScope::PaintBoxMouseDown(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y) +{ + m_CursorX = (X * m_XW / pBitmap->Width) + m_XOFF; + PaintBox->Canvas->Draw(0, 0, (TGraphic*)pBitmap); + PaintCursor(); +} +//--------------------------------------------------------------------------- +void __fastcall TTScope::SBSetClick(TObject *Sender) +{ + TOptionDlg *pBox = new TOptionDlg(this); + + pBox->TabFont->TabVisible = FALSE; + pBox->TabMisc->TabVisible = FALSE; + pBox->Execute(pDem, pMod); + delete pBox; + UpdateBtn(); +} +//--------------------------------------------------------------------------- +void __fastcall TTScope::SrcSelClick(TObject *Sender) +{ + m_SourceSel = SrcSel->ItemIndex; + SBUpDownClick(NULL); +// PaintBoxPaint(NULL); +} +//--------------------------------------------------------------------------- +void __fastcall TTScope::SBUpDownClick(TObject *Sender) +{ + int x; + double d, peak; + peak = 0; + for( x = m_XOFF; x < (m_XOFF + m_XW); x++ ){ + d = fabs(pDem->m_ScopeMark[SrcSel->ItemIndex].pScopeData[x]); + if( peak < d ) peak = d; + d = fabs(pDem->m_ScopeSpace[SrcSel->ItemIndex].pScopeData[x]); + if( peak < d ) peak = d; + } + if( peak ){ + m_Gain = 16384.0 * 0.8 / peak; + } + PaintBoxPaint(NULL); +} +//--------------------------------------------------------------------------- +void __fastcall TTScope::SBPlayClick(TObject *Sender) +{ + if( MmttyWd->pSound->WaveFile.m_mode == 1 ){ + MmttyWd->KRxPosClick(NULL); + } + else { + MmttyWd->KRxPlayClick(NULL); + } +} +//--------------------------------------------------------------------------- diff --git a/Scope.dfm b/Scope.dfm new file mode 100644 index 0000000..24bdc76 Binary files /dev/null and b/Scope.dfm differ diff --git a/Scope.h b/Scope.h new file mode 100644 index 0000000..fd339ea --- /dev/null +++ b/Scope.h @@ -0,0 +1,97 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//---------------------------------------------------------------------------- +#ifndef ScopeH +#define ScopeH +//---------------------------------------------------------------------------- +//JA7UDE 0427 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//---------------------------------------------------------------------------- +#include "rtty.h" +class TTScope : public TForm +{ +__published: + TButton *OKBtn; + TPanel *Panel1; + TPaintBox *PaintBox; + TTimer *Timer; + TSpeedButton *SBTrig; + TButton *LeftBtn; + TButton *RightBtn; + TButton *UpBtn; + TButton *DownBtn; + TButton *SBDownW; + TButton *SBUpW; + TSpeedButton *SBSet; + TRadioGroup *SrcSel; + TButton *SBUpDown; + TSpeedButton *SBPlay; + void __fastcall PaintBoxPaint(TObject *Sender); + void __fastcall TimerTimer(TObject *Sender); + void __fastcall SBTrigClick(TObject *Sender); + void __fastcall LeftBtnClick(TObject *Sender); + void __fastcall RightBtnClick(TObject *Sender); + void __fastcall UpBtnClick(TObject *Sender); + void __fastcall DownBtnClick(TObject *Sender); + + + void __fastcall SBDownWClick(TObject *Sender); + void __fastcall SBUpWClick(TObject *Sender); + + void __fastcall PaintBoxMouseDown(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y); + + void __fastcall SBSetClick(TObject *Sender); + void __fastcall SrcSelClick(TObject *Sender); + void __fastcall SBUpDownClick(TObject *Sender); + void __fastcall SBPlayClick(TObject *Sender); +private: + CFSKDEM *pDem; + CFSKMOD *pMod; + + Graphics::TBitmap *pBitmap; + + void __fastcall UpdateBtn(void); + void __fastcall TrigNext(void); + void __fastcall PaintCursor(void); + void __fastcall AdjXoff(int x); + + +public: + virtual __fastcall TTScope(TComponent* AOwner); + virtual __fastcall ~TTScope(); + + void __fastcall Execute(CFSKDEM *pd, CFSKMOD *pm); + void __fastcall PaintPosition(void); + void __fastcall PaintScope(CScope *sp, int n); +}; +//---------------------------------------------------------------------------- +//extern TTScope *TScope; +//---------------------------------------------------------------------------- +#endif diff --git a/SendFile.cpp b/SendFile.cpp new file mode 100644 index 0000000..d7405b0 --- /dev/null +++ b/SendFile.cpp @@ -0,0 +1,108 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "SendFile.h" +#include "Main.h" +//--------------------------------------------------------------------- +#pragma resource "*.dfm" +//--------------------------------------------------------------------- +__fastcall TSendFileDlg::TSendFileDlg(TComponent* AOwner) + : TForm(AOwner) +{ + Font->Name = ((TForm *)AOwner)->Font->Name; + Font->Charset = ((TForm *)AOwner)->Font->Charset; + if( Font->Charset != SHIFTJIS_CHARSET ){ + Caption = "Sending file"; + AbortBtn->Caption = "Abort"; + Lline->Caption = "Letters per line"; + } + m_fp = NULL; + if( sys.m_CharLenFile < 20 ) sys.m_CharLenFile = 20; + if( sys.m_CharLenFile > 1024 ) sys.m_CharLenFile = 1024; + m_DisEvent = 1; + CharLen->Text = sys.m_CharLenFile; + m_DisEvent = 0; +} +__fastcall TSendFileDlg::~TSendFileDlg() +{ + if( m_fp != NULL ){ + fclose(m_fp); + m_fp = NULL; + } +} +//--------------------------------------------------------------------- +int __fastcall TSendFileDlg::Start(LPCSTR pName, int Y) +{ + m_FileName = pName; + LName->Caption = pName; + m_fp = fopen(pName, "rt"); + if( m_fp != NULL ){ + Show(); + Top = Y; + return TRUE; + } + else { + return FALSE; + } +} +//--------------------------------------------------------------------- +int __fastcall TSendFileDlg::Timer(int buffcnt) +{ + if( m_fp == NULL ){ + return 2; + } + if( feof(m_fp) ){ + fclose(m_fp); + m_fp = NULL; + return 1; + } + if( buffcnt < 10 ){ + char bf[1025]; + if( fgets(bf, sys.m_CharLenFile, m_fp) != NULL ){ + ClipLF(bf); + MmttyWd->OutputStr(bf); + MmttyWd->OutputStr("\r\n"); + } + } + return 0; +} +//--------------------------------------------------------------------- +void __fastcall TSendFileDlg::AbortBtnClick(TObject *Sender) +{ + if( m_fp != NULL ){ + fclose(m_fp); + m_fp = NULL; + } +} +//--------------------------------------------------------------------------- +void __fastcall TSendFileDlg::CharLenChange(TObject *Sender) +{ + if( m_DisEvent ) return; + + int dd; + sscanf(AnsiString(CharLen->Text).c_str(), "%u", &dd); //JA7UDE 0428 + if( (dd >= 20) && (dd <= 1024) ){ + sys.m_CharLenFile = dd; + } +} +//--------------------------------------------------------------------------- diff --git a/SendFile.dfm b/SendFile.dfm new file mode 100644 index 0000000..3dcada0 Binary files /dev/null and b/SendFile.dfm differ diff --git a/SendFile.h b/SendFile.h new file mode 100644 index 0000000..2f34a31 --- /dev/null +++ b/SendFile.h @@ -0,0 +1,60 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//---------------------------------------------------------------------------- +#ifndef SendFileH +#define SendFileH +//---------------------------------------------------------------------------- +//JA7UDE 0427 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "ComLib.h" +//---------------------------------------------------------------------------- +class TSendFileDlg : public TForm +{ +__published: + TButton *AbortBtn; + TLabel *LName; + TComboBox *CharLen; + TLabel *Lline; + void __fastcall AbortBtnClick(TObject *Sender); + void __fastcall CharLenChange(TObject *Sender); +private: + int m_DisEvent; + AnsiString m_FileName; + FILE *m_fp; +public: + virtual __fastcall TSendFileDlg(TComponent* AOwner); + __fastcall ~TSendFileDlg(); + + int __fastcall Start(LPCSTR pName, int Y); + int __fastcall TSendFileDlg::Timer(int buffcnt); +}; +//---------------------------------------------------------------------------- +//extern TSendFileDlg *SendFileDlg; +//---------------------------------------------------------------------------- +#endif diff --git a/SetHelp.cpp b/SetHelp.cpp new file mode 100644 index 0000000..501fd5a --- /dev/null +++ b/SetHelp.cpp @@ -0,0 +1,193 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "SetHelp.h" +//--------------------------------------------------------------------- +#pragma resource "*.dfm" +//TSetHelpBox *SetHelpBox; +//--------------------------------------------------------------------- +__fastcall TSetHelpBox::TSetHelpBox(TComponent* AOwner) + : TForm(AOwner) +{ + FormStyle = ((TForm *)AOwner)->FormStyle; + Font->Name = ((TForm *)AOwner)->Font->Name; + Font->Charset = ((TForm *)AOwner)->Font->Charset; + if( Font->Charset != SHIFTJIS_CHARSET ){ + CancelBtn->Caption = "Cancel"; + NotePad->Caption = "Use NotePad"; + FontBtn->Caption = "Font"; + } +} +//--------------------------------------------------------------------- +int __fastcall TSetHelpBox::Execute(void) +{ + m_HelpFontName = sys.m_HelpFontName; + m_HelpFontCharset = sys.m_HelpFontCharset; + m_HelpFontSize = sys.m_HelpFontSize; + EditHTML->Text = sys.m_HTMLHelp; + EditMMTTY->Text = sys.m_Help; + EditLog->Text = sys.m_HelpLog; + EditDigital->Text = sys.m_HelpDigital; + NotePad->Checked = sys.m_HelpNotePad; + if( ShowModal() == IDOK ){ + sys.m_HelpFontName = m_HelpFontName; + sys.m_HelpFontCharset = m_HelpFontCharset; + sys.m_HelpFontSize = m_HelpFontSize; + + sys.m_HTMLHelp = EditHTML->Text; + sys.m_Help = EditMMTTY->Text; + sys.m_HelpLog = EditLog->Text; + sys.m_HelpDigital = EditDigital->Text; + + sys.m_HelpNotePad = NotePad->Checked; + return TRUE; + } + else { + return FALSE; + } +} +//--------------------------------------------------------------------- +void __fastcall TSetHelpBox::JABtnClick(TObject *Sender) +{ + EditHTML->Text = ""; + EditMMTTY->Text = "Mmtty.txt"; + EditLog->Text = "Mmttylog.txt"; + EditDigital->Text = "Digital.txt"; + m_HelpFontName = "‚l‚r ƒSƒVƒbƒN"; + m_HelpFontCharset = SHIFTJIS_CHARSET; + m_HelpFontSize = 10; +} +//--------------------------------------------------------------------------- +void __fastcall TSetHelpBox::EngBtnClick(TObject *Sender) +{ + EditHTML->Text = "KB2EOQ.htm"; + EditMMTTY->Text = "MmttyE.txt"; + EditLog->Text = "LogE.txt"; + EditDigital->Text = "DigitalE.txt"; + m_HelpFontName = "Courier";//"Courier New"; + m_HelpFontCharset = ANSI_CHARSET; + m_HelpFontSize = 10; +} +//--------------------------------------------------------------------------- +void __fastcall TSetHelpBox::FontBtnClick(TObject *Sender) +{ + FontDialog->Font->Name = m_HelpFontName; + FontDialog->Font->Charset = m_HelpFontCharset; + FontDialog->Font->Size = m_HelpFontSize; + NormalWindow(this); + if( FontDialog->Execute() == TRUE ){ + m_HelpFontName = FontDialog->Font->Name; + m_HelpFontCharset = FontDialog->Font->Charset; + m_HelpFontSize = FontDialog->Font->Size; + } + TopWindow(this); +} +//--------------------------------------------------------------------------- +int TSetHelpBox::SetFileName(AnsiString &as) +{ + OpenDialog->Options >> ofCreatePrompt; + OpenDialog->Options << ofFileMustExist; + if(sys.m_WinFontCharset != SHIFTJIS_CHARSET){ + OpenDialog->Title = "Choose help file"; + OpenDialog->Filter = "Text files(*.txt)|*.txt|All files(*.*)|*.*|"; + } + else { + OpenDialog->Title = "ƒwƒ‹ƒvƒtƒ@ƒCƒ‹‚Ì‘I‘ð"; + OpenDialog->Filter = "ƒeƒLƒXƒgƒtƒ@ƒCƒ‹(*.txt)|*.txt|‚·‚ׂẴtƒ@ƒCƒ‹(*.*)|*.*|"; + } + OpenDialog->FileName = as.c_str(); + OpenDialog->DefaultExt = "txt"; + OpenDialog->InitialDir = BgnDir; + NormalWindow(this); + if( OpenDialog->Execute() == TRUE ){ + char drive[_MAX_DRIVE]; + char dir[_MAX_DIR]; + char name[_MAX_FNAME]; + char ext[_MAX_EXT]; + + ::_splitpath(AnsiString(OpenDialog->FileName).c_str(), drive, dir, name, ext ); //JA7UDE 0428 + as = name; + as += ext; + TopWindow(this); + return TRUE; + } + else { + TopWindow(this); + return FALSE; + } +} +//--------------------------------------------------------------------------- +void __fastcall TSetHelpBox::RefMMTTYClick(TObject *Sender) +{ + AnsiString as = EditMMTTY->Text.c_str(); + if( SetFileName(as) == TRUE ){ + EditMMTTY->Text = as.c_str(); + } +} +//--------------------------------------------------------------------------- +void __fastcall TSetHelpBox::RefLogClick(TObject *Sender) +{ + AnsiString as = EditLog->Text.c_str(); + if( SetFileName(as) == TRUE ){ + EditLog->Text = as.c_str(); + } +} +//--------------------------------------------------------------------------- +void __fastcall TSetHelpBox::RefDigitalClick(TObject *Sender) +{ + AnsiString as = EditDigital->Text.c_str(); + if( SetFileName(as) == TRUE ){ + EditDigital->Text = as.c_str(); + } +} +//--------------------------------------------------------------------------- +void __fastcall TSetHelpBox::RefHTMLClick(TObject *Sender) +{ + OpenDialog->Options >> ofCreatePrompt; + OpenDialog->Options << ofFileMustExist; + if(sys.m_WinFontCharset != SHIFTJIS_CHARSET){ + OpenDialog->Title = "Choose HTML/Windows help file"; + } + else { + OpenDialog->Title = "HTML/Windowsƒwƒ‹ƒvƒtƒ@ƒCƒ‹‚Ì‘I‘ð"; + } + OpenDialog->Filter = "HTML/Windows help files(*.chm;*.htm;*.html;*.hlp)|*.chm;*.htm;*.html;*.hlp"; + OpenDialog->FileName = EditHTML->Text.c_str(); + OpenDialog->DefaultExt = "chm"; + OpenDialog->InitialDir = BgnDir; + NormalWindow(this); + if( OpenDialog->Execute() == TRUE ){ + char drive[_MAX_DRIVE]; + char dir[_MAX_DIR]; + char name[_MAX_FNAME]; + char ext[_MAX_EXT]; + + ::_splitpath(AnsiString(OpenDialog->FileName).c_str(), drive, dir, name, ext ); //JA7UDE 0428 + AnsiString as; + as = name; + as += ext; + EditHTML->Text = as.c_str(); + } + TopWindow(this); +} +//--------------------------------------------------------------------------- diff --git a/SetHelp.dfm b/SetHelp.dfm new file mode 100644 index 0000000..69cd18e Binary files /dev/null and b/SetHelp.dfm differ diff --git a/SetHelp.h b/SetHelp.h new file mode 100644 index 0000000..dc58d1f --- /dev/null +++ b/SetHelp.h @@ -0,0 +1,83 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//---------------------------------------------------------------------------- +#ifndef SetHelpH +#define SetHelpH +//---------------------------------------------------------------------------- +//JA7UDE 0427 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ComLib.h" +#include +//---------------------------------------------------------------------------- +class TSetHelpBox : public TForm +{ +__published: + TButton *OKBtn; + TButton *CancelBtn; + TGroupBox *GroupBox1; + TEdit *EditMMTTY; + TButton *RefMMTTY; + TGroupBox *GroupBox2; + TEdit *EditLog; + TButton *RefLog; + TGroupBox *GroupBox3; + TEdit *EditDigital; + TButton *RefDigital; + TButton *JABtn; + TButton *EngBtn; + TButton *FontBtn; + TFontDialog *FontDialog; + TOpenDialog *OpenDialog; + TCheckBox *NotePad; + TGroupBox *GroupBox4; + TEdit *EditHTML; + TButton *RefHTML; + void __fastcall JABtnClick(TObject *Sender); + void __fastcall EngBtnClick(TObject *Sender); + void __fastcall FontBtnClick(TObject *Sender); + void __fastcall RefMMTTYClick(TObject *Sender); + void __fastcall RefLogClick(TObject *Sender); + void __fastcall RefDigitalClick(TObject *Sender); + void __fastcall RefHTMLClick(TObject *Sender); +private: + int SetFileName(AnsiString &as); + + AnsiString m_HelpFontName; + BYTE m_HelpFontCharset; + int m_HelpFontSize; +public: + virtual __fastcall TSetHelpBox(TComponent* AOwner); + + int __fastcall Execute(void); +}; +//---------------------------------------------------------------------------- +//extern TSetHelpBox *SetHelpBox; +//---------------------------------------------------------------------------- +#endif diff --git a/ShortCut.cpp b/ShortCut.cpp new file mode 100644 index 0000000..ab3a6dc --- /dev/null +++ b/ShortCut.cpp @@ -0,0 +1,408 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "ShortCut.h" +#include "LogFile.h" +//--------------------------------------------------------------------- +#pragma resource "*.dfm" +//TShortCutDlg *ShortCutDlg; +static int CurRow = 0; +static int TopRow = 0; +//--------------------------------------------------------------------- +__fastcall TShortCutDlg::TShortCutDlg(TComponent* AOwner) + : TForm(AOwner) +{ + FormStyle = ((TForm *)AOwner)->FormStyle; + m_DisEvent = 1; + Font->Name = ((TForm *)AOwner)->Font->Name; + Font->Charset = ((TForm *)AOwner)->Font->Charset; + if( Font->Charset != SHIFTJIS_CHARSET ){ + Caption = "Assign ShortCut"; + DelBtn->Caption = "Del"; + CheckBtn->Caption = "Check Dupe"; + OKBtn->Caption = "Close"; + } + ShortCutName->Clear(); + int i; + for( i = 0; KEYTBL[i].Key; i++ ){ + ShortCutName->Items->Add(ToDXKey(KEYTBL[i].pName)); + } + m_DisEvent = 0; + SBHelp->Visible = !JanHelp.IsEmpty(); +} + +typedef struct { + LPCSTR pSys; + LPCSTR pUser; + WORD *pKey; +}DEFTBL; + +DEFTBL def[]={ + {"RcvLog","ŽóM‹L˜^i“ú•t–¼jƒtƒ@ƒCƒ‹", &sys.m_SysKey[kkRcvLog]}, + {"FileOut","ƒeƒLƒXƒgƒtƒ@ƒCƒ‹‘—M", &sys.m_SysKey[kkFileOut]}, + {"SaveRx","ŽóM‰æ–ʂ̓à—e‚ðƒtƒ@ƒCƒ‹‚ɃZ[ƒu", &sys.m_SysKey[kkSaveRx]}, + + {"OpenLog","V‚µ‚¢ƒƒOƒtƒ@ƒCƒ‹‚̃I[ƒvƒ“", &sys.m_SysKey[kkOpenLog]}, + {"Flush","ƒfƒBƒXƒN‚Ƀtƒ‰ƒbƒVƒ…", &sys.m_SysKey[kkFlush]}, + + {"RecTime","ŽóMƒTƒEƒ“ƒh‚ðŽž–¼‚̃tƒ@ƒCƒ‹‚É‹L˜^", &sys.m_SysKey[kkRecTime]}, + {"Rec","ŽóMƒTƒEƒ“ƒh‚ðƒtƒ@ƒCƒ‹‚É‹L˜^", &sys.m_SysKey[kkRec]}, + {"Play","ŽóMƒTƒEƒ“ƒh‚ðƒtƒ@ƒCƒ‹‚©‚çĶ", &sys.m_SysKey[kkPlay]}, + {"PlayPos","ĶˆÊ’u’²®", &sys.m_SysKey[kkPlayPos]}, + {"PlayStop","‹L˜^^Ķ‚ÌI—¹", &sys.m_SysKey[kkPlayStop]}, + + {"Paste","‘—M‰æ–ʂւ̓\‚è•t‚¯", &sys.m_SysKey[kkPaste]}, + {"Panel","Control Panel", &sys.m_SysKey[kkPanel]}, + {"MacBtn","Macro ƒ{ƒ^ƒ“", &sys.m_SysKey[kkMac]}, + {"Scope","ƒIƒVƒƒXƒR[ƒv", &sys.m_SysKey[kkScope]}, + {"ClrRxWindow","ŽóM‰æ–ʂ̃NƒŠƒA", &sys.m_SysKey[kkClrRxWindow]}, + {"LogList","LogList", &sys.m_SysKey[kkLogList]}, + {"QSOData","QSOData", &sys.m_SysKey[kkQSOData]}, + {"EntTX","TXƒ{ƒ^ƒ“‚ÅŽ©“®‰üs‘—M", &sys.m_SysKey[kkEntTX]}, + {"WordWrap","ƒL[ƒ{[ƒh‚̃[ƒhƒ‰ƒbƒv", &sys.m_SysKey[kkWordWrap]}, + {"RUN","ƒ‰ƒ“ƒjƒ“ƒOƒ‚[ƒh", &sys.m_SysKey[kkRun]}, + {"TNC","TNC–Í‹[ƒ‚[ƒhÝ’è", &sys.m_SysKey[kkTNC]}, + {"Option","Ý’è‰æ–Ê", &sys.m_SysKey[kkOption]}, + {"LogOpt","ƒƒOÝ’è‰æ–Ê", &sys.m_SysKey[kkLogOption]}, + + {"Profile1","Profile 1", &sys.m_SysKey[kkPro1]}, + {"Profile2","Profile 2", &sys.m_SysKey[kkPro2]}, + {"Profile3","Profile 3", &sys.m_SysKey[kkPro3]}, + {"Profile4","Profile 4", &sys.m_SysKey[kkPro4]}, + {"Profile5","Profile 5", &sys.m_SysKey[kkPro5]}, + {"Profile6","Profile 6", &sys.m_SysKey[kkPro6]}, + {"Profile7","Profile 7", &sys.m_SysKey[kkPro7]}, + {"Profile8","Profile 8", &sys.m_SysKey[kkPro8]}, + {"ProfileDef","MMTTY default", &sys.m_SysKey[kkProDef]}, + {"ProfileRet","Return to the startup", &sys.m_SysKey[kkProRet]}, + + {"ExtCmd1","External 1", &sys.m_SysKey[kkExtCmd1]}, + {"ExtCmd2","External 2", &sys.m_SysKey[kkExtCmd2]}, + {"ExtCmd3","External 3", &sys.m_SysKey[kkExtCmd3]}, + {"ExtCmd4","External 4", &sys.m_SysKey[kkExtCmd4]}, + {"ExtReset","ƒTƒXƒyƒ“ƒh‚̉ðœ", &sys.m_SysKey[kkExtReset]}, + {"ExtSusp","ƒTƒXƒyƒ“ƒh", &sys.m_SysKey[kkExtSusp]}, + + {"FIG","FIG Button", &sys.m_SysKey[kkFIG]}, + {"UOS","UOS Button", &sys.m_SysKey[kkUOS]}, + {"TX","TX Button", &sys.m_SysKey[kkTX]}, + {"TXOFF","TXOFF Button", &sys.m_SysKey[kkTXOFF]}, + {"QSO","QSO Button", &sys.m_SysKey[kkQSO]}, + {"OnQSO","QSO Button ON", &sys.m_SysKey[kkOnQSO]}, + {"OffQSO","QSO Button OFF", &sys.m_SysKey[kkOffQSO]}, + {"Capture","Capture Callsign", &sys.m_SysKey[kkCAPTURE]}, + {"InitBox","Init Button", &sys.m_SysKey[kkInitBox]}, + {"CALL","Call Box", &sys.m_SysKey[kkCall]}, + {"NAME","Name Box", &sys.m_SysKey[kkName]}, + {"QTH","QTH Box", &sys.m_SysKey[kkQTH]}, + {"RST","HisRST Box", &sys.m_SysKey[kkRST]}, + {"MyRST","MyRST Box", &sys.m_SysKey[kkMyRST]}, + {"Freq","Frequency Box", &sys.m_SysKey[kkFreq]}, + {"Find","Find Button", &sys.m_SysKey[kkFind]}, + {"Clear","Clear Button", &sys.m_SysKey[kkClear]}, + + {"TxUp","“ü—͉æ–Ê ª", &sys.m_SysKey[kkInUp]}, + {"TxDown","“ü—͉æ–Ê «", &sys.m_SysKey[kkInDown]}, + {"TxPUp","“ü—͉æ–Ê ƒy[ƒWª", &sys.m_SysKey[kkInPUp]}, + {"TxPDown","“ü—͉æ–Ê ƒy[ƒW«", &sys.m_SysKey[kkInPDown]}, + {"TxHome","“ü—͉æ–Ê æ“ª", &sys.m_SysKey[kkInHome]}, + {"TxEnd","“ü—͉æ–Ê ––”ö", &sys.m_SysKey[kkInEnd]}, + + {"RxUp","ŽóM‰æ–Ê ª", &sys.m_SysKey[kkRxUp]}, + {"RxDown","ŽóM‰æ–Ê «", &sys.m_SysKey[kkRxDown]}, + {"RxPUp","ŽóM‰æ–Ê ƒy[ƒWª", &sys.m_SysKey[kkRxPUp]}, + {"RxPDown","ŽóM‰æ–Ê ƒy[ƒW«", &sys.m_SysKey[kkRxPDown]}, + {"RxHome","ŽóM‰æ–Ê æ“ª", &sys.m_SysKey[kkRxHome]}, + {"RxEnd","ŽóM‰æ–Ê ––”ö", &sys.m_SysKey[kkRxEnd]}, + + {"CharWaitL","•¶ŽšWait©", &sys.m_SysKey[kkCharWaitLeft]}, + {"CharWaitR","•¶ŽšWait¨", &sys.m_SysKey[kkCharWaitRight]}, + {"DiddleWaitL","DiddleWait©", &sys.m_SysKey[kkDiddleWaitLeft]}, + {"DiddleWaitR","DiddleWait¨", &sys.m_SysKey[kkDiddleWaitRight]}, + + {"TxHeightUp","“ü—͉æ–ÊŠg‘å", &sys.m_SysKey[kkInHeightUp]}, + {"TxHeightDown","“ü—͉æ–Êk¬", &sys.m_SysKey[kkInHeightDown]}, + + {"TxLTR","LTR‘—M", &sys.m_SysKey[kkTxLTR]}, + {"TxFIG","FIG‘—M", &sys.m_SysKey[kkTxFIG]}, + + {"DecShift","SHIFT• ‹·‚ß‚é", &sys.m_SysKey[kkDecShift]}, + {"IncShift","SHIFT• L‚°‚é", &sys.m_SysKey[kkIncShift]}, + {"ChangeShift","SHIFT••ÏX (170/200/220/350/450)", &sys.m_SysKey[kkToggleShift]}, + + {"CallList","Callsign list", &sys.m_SysKey[kkCList]}, +}; + +void SetMenuName(LPCSTR pkey, LPCSTR p) +{ + int i; + for( i = 0; i < AN(def); i++ ){ + if( !strcmp(def[i].pSys, pkey) ){ + def[i].pUser = p; + return; + } + } +} + +void SetExtMenuName(int n, LPCSTR p) +{ + int i; + for( i = 0; i < AN(def); i++ ){ + if( !strcmp(def[i].pSys, "ExtCmd1") ){ + def[i+n].pUser = p; + return; + } + } +} + +void SetProMenuName(int n, LPCSTR p) +{ + int i; + for( i = 0; i < AN(def); i++ ){ + if( !strcmp(def[i].pSys, "Profile1") ){ + def[i+n].pUser = p; + return; + } + } +} + +const DEFTBL *GetDP(int n) +{ +static DEFTBL udef; +static char bf[32]; +static WORD dummy = 0; + + if( n < AN(def) ){ + return &def[n]; + } + n -= AN(def); + if( n < 4 ){ + sprintf(bf, "IN%u", n + 1); + udef.pSys = bf; + udef.pUser = sys.m_InBtnName[n].c_str(); + udef.pKey = &sys.m_InBtnKey[n]; + return &udef; + } + n -= 4; + if( n < 16 ){ + sprintf(bf, "M%u", n + 1); + udef.pSys = bf; + udef.pUser = sys.m_UserName[n].c_str(); + udef.pKey = &sys.m_UserKey[n]; + return &udef; + } + n -= 16; + if( n < MSGLISTMAX ){ + sprintf(bf, "ML%u", n + 1); + udef.pSys = bf; + udef.pUser = sys.m_MsgName[n].c_str(); + udef.pKey = &sys.m_MsgKey[n]; + return &udef; + } + n -= MSGLISTMAX; + if( n < 5 ){ + sprintf(bf, "QM%u", n + 1); + udef.pSys = bf; + udef.pUser = (sys.m_WinFontCharset != SHIFTJIS_CHARSET)?"QSO Button Macro":"QSO Button˜A“®ƒ}ƒNƒ"; + udef.pKey = &Log.m_LogSet.m_QSOMacroKey[n]; + return &udef; + } + n -= 5; + if( n < 16 ){ + sprintf(bf, "MEdit%u", n + 1); + udef.pSys = bf; + udef.pUser = sys.m_UserName[n].c_str(); + udef.pKey = &sys.m_UserEditKey[n]; + return &udef; + } + udef.pSys = ""; + udef.pUser = ""; + udef.pKey = &dummy; + return &udef; +} +//--------------------------------------------------------------------- +void __fastcall TShortCutDlg::UpdateUI(int n) +{ + if( n >= 0 ){ + const DEFTBL *dp = GetDP(n); + m_DisEvent++; + ShortCutName->Text = GetKeyName(*dp->pKey); + m_DisEvent--; + } +} +//--------------------------------------------------------------------- +void __fastcall TShortCutDlg::Execute(void) +{ + Grid->RowCount = AN(def) + 4 + 16 + 64 + 5 + 16 + 1; + if( CurRow ){ + Grid->Row = CurRow; + Grid->TopRow = TopRow; + } + UpdateUI(Grid->Row - 1); + ShowModal(); + CurRow = Grid->Row; + TopRow = Grid->TopRow; +} +//--------------------------------------------------------------------------- +// d•¡‚̃`ƒFƒbƒN +int __fastcall TShortCutDlg::IsDupe(int n) +{ +#if 0 + FILE *fp = fopen("F:\\LIST.TXT", "wt"); + const DEFTBL *dp; + for( int j = 0; j < Grid->RowCount-1; j++ ){ + dp = GetDP(j); + fprintf(fp, "%s : %s\n", dp->pSys, dp->pUser); + } + fclose(fp); +#endif + + WORD ks; + const DEFTBL *s; + const DEFTBL *t; + int j; + s = GetDP(n); + ks = *s->pKey; + if( ks ){ + for( j = 0; j < Grid->RowCount - 1; j++ ){ + if( n != j ){ + t = GetDP(j); + if( t->pKey ){ + if( ks == *t->pKey ){ + return 1; + } + } + } + } + } + return 0; +} +//--------------------------------------------------------------------- +void __fastcall TShortCutDlg::GridDrawCell(TObject *Sender, int Col, + int Row, TRect &Rect, TGridDrawState State) +{ + char bf[256]; + + Grid->Canvas->FillRect(Rect); + int X = Rect.Left + 4; + int Y = Rect.Top + 2; + + if( Row ){ + Row--; + const DEFTBL *dp = GetDP(Row); + bf[0] = 0; + switch(Col){ + case 0: // “à•”–¼ + strcpy(bf, dp->pSys); + break; + case 1: // ƒ†[ƒU–¼ + strcpy(bf, dp->pUser); + break; + case 2: // ƒVƒ‡[ƒgƒJƒbƒg + strcpy(bf, GetKeyName(*dp->pKey)); + if( IsDupe(Row) ){ + Grid->Canvas->Font->Color = clRed; + } + break; + } + Grid->Canvas->TextOut(X, Y, bf); + } + else if( Font->Charset != SHIFTJIS_CHARSET ){ + LPCSTR _tte[]={ + "Internal","Define Name","Key" + }; + Grid->Canvas->TextOut(X, Y, _tte[Col]); + } + else { // ƒ^ƒCƒgƒ‹ + LPCSTR _tt[]={ + "“à•”–¼","ƒ†[ƒU[’è‹`–¼","Š„‚è“–‚ăL[" + }; + Grid->Canvas->TextOut(X, Y, _tt[Col]); + } +} +//--------------------------------------------------------------------------- +void __fastcall TShortCutDlg::GridSelectCell(TObject *Sender, int Col, + int Row, bool &CanSelect) +{ + if( Row ){ + UpdateUI(Row - 1); + } +} +//--------------------------------------------------------------------------- +void __fastcall TShortCutDlg::ShortCutNameChange(TObject *Sender) +{ + if( m_DisEvent ) return; + + m_DisEvent++; + int n = Grid->Row - 1; + if( n >= 0 ){ + const DEFTBL *dp = GetDP(n); + *dp->pKey = GetKeyCode(AnsiString(ShortCutName->Text).c_str()); //JA7UDE 0428 + Grid->Invalidate(); + } + m_DisEvent--; +} +//--------------------------------------------------------------------------- +void __fastcall TShortCutDlg::CheckBtnClick(TObject *Sender) +{ + WORD ks; + AnsiString as; + const DEFTBL *s; + const DEFTBL *t; + int i, j; + for( i = 0; i < Grid->RowCount - 1; i++ ){ + s = GetDP(i); + ks = *s->pKey; + if( ks ){ + as = s->pSys; + for( j = i + 1; j < Grid->RowCount - 1; j++ ){ + t = GetDP(j); + if( t->pKey ){ + if( ks == *t->pKey ){ + Grid->Row = j + 1; + WarningMB((Font->Charset != SHIFTJIS_CHARSET)?"Duplicated key '%s' and '%s'":"'%s' ‚Æ '%s' ‚ªd•¡‚µ‚Ä‚¢‚Ü‚·.", as.c_str(), t->pSys); + return; + } + } + } + } + } + InfoMB( (Font->Charset != SHIFTJIS_CHARSET)?"No duplicated":"d•¡‚·‚éƒVƒ‡[ƒgƒJƒbƒgƒL[‚Í‚ ‚è‚Ü‚¹‚ñ." ); +} +//--------------------------------------------------------------------------- +void __fastcall TShortCutDlg::DelBtnClick(TObject *Sender) +{ + int n = Grid->Row - 1; + if( n >= 0 ){ + const DEFTBL *dp = GetDP(n); + *dp->pKey = 0; + UpdateUI(n); + Grid->Invalidate(); + } +} +//--------------------------------------------------------------------------- +void __fastcall TShortCutDlg::SBHelpClick(TObject *Sender) +{ + ShowHtmlHelp("keyboardshortcuts.htm"); +} +//--------------------------------------------------------------------------- diff --git a/ShortCut.dfm b/ShortCut.dfm new file mode 100644 index 0000000..36b00ae Binary files /dev/null and b/ShortCut.dfm differ diff --git a/ShortCut.h b/ShortCut.h new file mode 100644 index 0000000..08005e1 --- /dev/null +++ b/ShortCut.h @@ -0,0 +1,74 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//---------------------------------------------------------------------------- +#ifndef ShortCutH +#define ShortCutH +//---------------------------------------------------------------------------- +//JA7UDE 0427 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +//---------------------------------------------------------------------------- +#include "ComLib.h" +//---------------------------------------------------------------------------- +class TShortCutDlg : public TForm +{ +__published: + TButton *OKBtn; + TStringGrid *Grid; + TComboBox *ShortCutName; + TButton *CheckBtn; + TButton *DelBtn; + TSpeedButton *SBHelp; + void __fastcall GridDrawCell(TObject *Sender, int Col, int Row, + TRect &Rect, TGridDrawState State); + void __fastcall GridSelectCell(TObject *Sender, int Col, int Row, + bool &CanSelect); + void __fastcall ShortCutNameChange(TObject *Sender); + void __fastcall CheckBtnClick(TObject *Sender); + void __fastcall DelBtnClick(TObject *Sender); + void __fastcall SBHelpClick(TObject *Sender); +private: + int m_DisEvent; + void __fastcall UpdateUI(int n); + int __fastcall IsDupe(int n); + +public: + virtual __fastcall TShortCutDlg(TComponent* AOwner); + + void __fastcall Execute(void); +}; + +void SetMenuName(LPCSTR pkey, LPCSTR p); +void SetExtMenuName(int n, LPCSTR p); +void SetProMenuName(int n, LPCSTR p); +//---------------------------------------------------------------------------- +//extern TShortCutDlg *ShortCutDlg; +//---------------------------------------------------------------------------- +#endif diff --git a/Sound.cpp b/Sound.cpp new file mode 100644 index 0000000..0ccffb8 --- /dev/null +++ b/Sound.cpp @@ -0,0 +1,1351 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba, Dave Bernstein +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------------- +#include +#pragma hdrstop + +#include + +#include "Sound.h" +#include "Main.h" + +WAVEINCAPS InCaps; +WAVEOUTCAPS OutCaps; + +//--------------------------------------------------------------------------- +// ’ˆÓ: VCL ƒIƒuƒWƒFƒNƒg‚̃ƒ\ƒbƒh‚ƃvƒƒpƒeƒB‚ðŽg—p‚·‚é‚É‚Í, Synchronize +// ‚ðŽg‚Á‚½ƒƒ\ƒbƒhŒÄ‚Ño‚µ‚łȂ¯‚ê‚΂Ȃè‚Ü‚¹‚ñBŽŸ‚É—á‚ðŽ¦‚µ‚Ü‚·B +// +// Synchronize(UpdateCaption); +// +// ‚±‚±‚Å, UpdateCaption ‚ÍŽŸ‚̂悤‚É‹Lq‚Å‚«‚Ü‚·B +// +// void __fastcall TSound::UpdateCaption() +// { +// Form1->Caption = "ƒXƒŒƒbƒh‚©‚ç‘‚«Š·‚¦‚Ü‚µ‚½"; +// } +//--------------------------------------------------------------------------- +__fastcall TSound::TSound(bool CreateSuspended) + : TThread(CreateSuspended) +{ + ::VirtualLock(this, sizeof(TSound)); + + if( SampType == 2 ){ + m_FFTWINDOW = (3000 * FFT_SIZE / SampFreq); + } + else { + m_FFTWINDOW = (4000 * FFT_SIZE / SampFreq); + } + m_BuffSize = SampSize; + m_Stop = TRUE; + memset(ZBPF, 0, sizeof(ZBPF)); + memset(HBPF, 0, sizeof(HBPF)); + + m_ReqFifoSize = 0; + m_IDDevice = WAVE_MAPPER; + m_IDOutDevice = WAVE_MAPPER; //AA6YQ 1.6.6 + m_playmode = 0; + m_susp = 0; + m_suspack = 0; + m_bpf = 0; + m_lmsbpf = 0; + m_bpffw = 100.0; + m_bpftap = 56; + m_bpfafc = 1; + CalcBPF(); + + InitWFX(); + m_Test = 0; + m_Noise = 0; + m_FFTSW = 1; + m_FFTFW = 0; + m_Tx = m_ReqTx = 0; + FSKMOD.SetDem(&FSKDEM); + + m_FFTMax = 128; + m_FFTSumMax = 128*2; + + m_WaterMax = 128; + m_WaterSumMax = 128*8; + m_WaterMin = 0; + + m_ReqSpeedTest = 0; +} + +__fastcall TSound::~TSound() +{ + ::VirtualUnlock(this, sizeof(TSound)); +} + +void __fastcall TSound::InitWFX(void) +{ + m_WFX.wFormatTag = WAVE_FORMAT_PCM; + m_WFX.nChannels = WORD(sys.m_SoundStereo ? 2 : 1); + m_WFX.wBitsPerSample = 16; + m_WFX.nSamplesPerSec = int(SampBase); + m_WFX.nBlockAlign = WORD(m_WFX.nChannels *(m_WFX.wBitsPerSample/8)); + m_WFX.nAvgBytesPerSec = m_WFX.nBlockAlign * m_WFX.nSamplesPerSec; + m_WFX.cbSize = 0; + Wave.m_SoundStereo = sys.m_SoundStereo; +} + +void __fastcall TSound::CalcBPF(void) +{ + MakeFilter(HBPF, m_bpftap, ffBPF, SampFreq, FSKDEM.GetMarkFreq() - m_bpffw, FSKDEM.GetSpaceFreq() + m_bpffw, 60, 1.0); + m_lms.SetWindow(FSKDEM.GetMarkFreq(), FSKDEM.GetSpaceFreq()); +} + +void __fastcall TSound::CalcBPF(double fl, double fh, double fw) +{ + MakeFilter(HBPF, m_bpftap, ffBPF, SampFreq, fl - fw, fh + fw, 60, 1.0); + m_lms.SetWindow(fl, fh); +} + +void __fastcall TSound::Stop(void) +{ + if( m_Stop == FALSE ){ + Priority = tpNormal; + Terminate(); + WaitFor(); + Wave.InClose(); + Wave.OutAbort(); + } +} + +void __fastcall TSound::ReqStop(void) +{ + if( m_Stop == FALSE ){ + Priority = tpNormal; + Terminate(); + } +} + +void __fastcall TSound::WaitStop(void) +{ + WaitFor(); + Wave.InClose(); + Wave.OutAbort(); +} + +void __fastcall TSound::InitSound(void) +{ + Suspend(); + FSKMOD.SetSampFreq(SampFreq + sys.m_TxOffset); + InitWFX(); + m_ReqFifoSize = TRUE; + Resume(); +} +//--------------------------------------------------------------------------- +void __fastcall TSound::ErrorMsg(void) +{ + if( m_IDDevice == -2 ){ + InfoMB("Sound I/O failed in the MMW (%s)", sys.m_SoundMMW.c_str()); + } + else { + ErrorMB((sys.m_WinFontCharset != SHIFTJIS_CHARSET)?"Can't open Sound card (%d)":"ƒTƒEƒ“ƒhƒJ[ƒh‚ªƒI[ƒvƒ“‚Å‚«‚Ü‚¹‚ñ.", m_IDDevice); + } +} +//--------------------------------------------------------------------------- +BOOL __fastcall TSound::ReInitSound(void) +{ + if( Terminated == TRUE ) return FALSE; + Wave.OutAbort(); + Wave.InClose(); + InitWFX(); + if( m_Err >= 3 ){ + m_Err = 5; + ::Sleep(100); + } + else { + m_Err++; + } + if( m_Tx || (m_playmode == 1) ){ + if( (sys.m_TxPort != txTXDOnly) || (m_playmode == 1) ){ + if( Wave.OutOpen(&m_WFX, m_IDOutDevice, m_BuffSize) ) return TRUE; //AA6YQ 1.66 + } + } + else { + if( Wave.InOpen(&m_WFX, m_IDDevice, m_BuffSize) ) return TRUE; + } + return FALSE; +} +//--------------------------------------------------------------------------- +int __fastcall TSound::UpdateFifoSize(void) +{ + int r = 2; + if( !m_ReqFifoSize ) return 1; + + int fi = Wave.IsInOpen(); + int fo = Wave.IsOutOpen(); + if( fi ) Wave.InClose(); + if( fo ) Wave.OutAbort(); + Wave.m_InFifoSize = sys.m_SoundFifoRX; + Wave.m_OutFifoSize = sys.m_SoundFifoTX; + m_IDDevice = sys.m_SoundDevice; + m_IDOutDevice = sys.m_SoundOutDevice; //AA6YQ 1.66 + Wave.UpdateDevice(m_IDDevice); + if( fi ){ + if( !Wave.InOpen(&m_WFX, m_IDDevice, m_BuffSize) ) r = FALSE; + } + if( fo ){ + if( !Wave.OutOpen(&m_WFX, m_IDOutDevice, m_BuffSize) ) r = FALSE; //AA6YQ 1.66 + } + TaskPriority(); + m_ReqFifoSize = 0; + return r; +} +//--------------------------------------------------------------------------- +void __fastcall TSound::TaskPriority(void) +{ + switch(sys.m_SoundPriority){ + case 0: + if( Priority != tpNormal ){ + Priority = tpNormal; //ƒXƒŒƒbƒh‚Í’Êí‚Ì—Dæ“x‚Å‚ ‚é + } + break; + case 1: + if( Priority != tpHigher ){ + Priority = tpHigher; //ƒXƒŒƒbƒh‚Ì—Dæ“x‚Í’Êí‚æ‚è‚à 1 ƒ|ƒCƒ“ƒg‚‚¢ + } + break; + case 2: + if( Priority != tpHighest ){ + Priority = tpHighest; //ƒXƒŒƒbƒh‚Ì—Dæ“x‚Í’Êí‚æ‚è‚à 2 ƒ|ƒCƒ“ƒg‚‚¢ + } + break; + default: + if( Priority != tpTimeCritical ){ + Priority = tpTimeCritical; //ƒXƒŒƒbƒh‚Í‚à‚Á‚Æ‚à‚‚¢—Dæ“x‚ðŽæ“¾‚·‚é + } + break; + } +} +//--------------------------------------------------------------------------- +void __fastcall TSound::Execute() +{ + static double Buff[8192]; + double *lp; + int i; + int Len; + + m_Stop = FALSE; + memset(Buff, 0, sizeof(Buff)); + TaskPriority(); + ::Sleep(200); // 200ms + Wave.m_InFifoSize = sys.m_SoundFifoRX; + Wave.m_OutFifoSize = sys.m_SoundFifoTX; + m_IDDevice = sys.m_SoundDevice; + m_IDOutDevice = sys.m_SoundOutDevice; //AA6YQ 1.66 + Wave.UpdateDevice(m_IDDevice); +_init:; + Wave.InClose(); + if( Wave.InOpen(&m_WFX, m_IDDevice, m_BuffSize) != TRUE ){ + int timeout = Wave.GetTimeout() / 200; + for( int i = 0; i < timeout; i++ ){ + ::Sleep(200); + if( Terminated == TRUE ) goto _ex; + if( UpdateFifoSize() == 2 ) goto _init; + if( Wave.InOpen(&m_WFX, m_IDDevice, m_BuffSize) == TRUE ) break; + } + if( Wave.IsInOpen() != TRUE ){ + if( timeout ) ErrorMsg(); + if( Terminated == TRUE ) goto _ex; + int Count = 3000/50; + while(1){ // ‹[Ž—ŽÀs + if( Terminated == TRUE ) goto _ex; + ::Sleep(50); + Wave.PumpMessages(); + if( (m_Tx != m_ReqTx) || m_ReqFifoSize || !Count ){ + Count = 3000/50; + if( UpdateFifoSize() == 2 ) goto _init; + m_Tx = m_ReqTx; + if( Wave.InOpen(&m_WFX, m_IDDevice, m_BuffSize) == TRUE ) break; + } + Count--; + } + m_Tx = 0; + } + } + m_Tx = 0; + Wave.OutAbort(); + Len = m_BuffSize; + while(1){ + if( Terminated == TRUE ) break; + if( Wave.IsInOpen() ){ + if( Wave.InRead(Buff, m_BuffSize) == FALSE ){ + if( !ReInitSound() ) goto _init; + } + } + if( m_playmode && (!m_Tx || (m_playmode != 1))) WaveFile.ReadWrite(Buff, m_BuffSize); + if( Terminated == TRUE ) break; + if( m_Test && !m_Tx ){ + for( i = 0, lp = Buff; i < Len; i++, lp++ ){ + if( m_Test ) *lp += FSKMOD.Do(1); + } + } + if( m_bpf || m_lmsbpf ){ + for( i = 0, lp = Buff; i < Len; i++, lp++ ){ + if( m_bpf ){ + *lp = DoFIR(HBPF, ZBPF, *lp, m_bpftap); + } + if( m_lmsbpf ){ + *lp = m_lms.Do(*lp); + } + } + } + if( m_FFTSW ) fftIN.CollectFFT(Buff, Len); + if( !m_Tx || sys.m_echo ){ + for( i = 0, lp = Buff; i < Len; i++, lp++ ){ + FSKDEM.Do(*lp); + } + } +_skip1:; + if( m_Tx ){ + if( (sys.m_echo == 2) && Wave.IsInBufCritical() && Wave.IsInOpen() ) goto _skip2; + for( i = 0, lp = Buff; i < Len; i++, lp++ ){ + *lp = FSKMOD.Do(sys.m_echo); + if( (m_ReqTx != m_Tx) && !m_ReqTx && (!FSKMOD.GetMode()) ){ + for( ; i < Len; i++, lp++ ) *lp = 0; + break; + } + } + if( (sys.m_TxPort == txTXDOnly) && !Wave.IsInOpen() && (m_ReqTx == m_Tx)){ + if( FSKCount1 <= FSKCount2 ){ + ::Sleep(Len * 1000 / SampFreq); + } + else { + ::Sleep(1); + } + } + } + if( Wave.IsOutOpen() == TRUE ){ + if( Wave.OutWrite(Buff, Len) != TRUE ){ + ReInitSound(); + if( Wave.OutWrite(Buff, Len) != TRUE ){ + if( !ReInitSound() ) goto _init; + } + } + else { + if( (sys.m_echo == 2) && m_Tx && Wave.IsInBufNull() && !Wave.IsOutBufFull() ) goto _skip1; +// if( (sys.m_echo == 2) && m_Tx && !Wave.IsInBufCritical() && !Wave.IsOutBufFull() ) goto _skip1; + } + } +_skip2:; + if( m_Tx != m_ReqTx ){ + if( !m_ReqTx ){ // To RX + Wave.OutAbort(); + fftIN.ClearBuf(); + if( !Wave.IsInOpen() ){ + Wave.m_InFifoSize = sys.m_SoundFifoRX; + Wave.InOpen(&m_WFX, m_IDDevice, m_BuffSize); + FSKDEM.m_OverFlow = 0; + FSKDEM.ClearMode(); + } + m_Tx = m_ReqTx = 0; + Wave.SetPTT(m_Tx); + TaskPriority(); + } + else { // To TX + if( sys.m_echo != 2 ){ + Wave.InClose(); + fftIN.ClearBuf(); + } + FSKMOD.InitPhase(); + FSKMOD.SetCount(m_BuffSize * 3); + if((sys.m_TxPort != txTXDOnly) && (m_playmode != 1) ){ + Wave.m_OutFifoSize = sys.m_SoundFifoTX; + m_IDOutDevice = sys.m_SoundOutDevice; //AA6YQ 1.66 + Wave.OutOpen(&m_WFX, m_IDOutDevice, m_BuffSize); //AA6YQ 1.66 + if( sys.m_echo == 2 ){ + memset(Buff, 0, sizeof(Buff)); + for( i = 0; (i < 4) && !Wave.IsOutBufFull(); i++ ){ + if( Wave.OutWrite(Buff, Len) != TRUE ) break; + } + } + } + if( sys.m_echo != 2 ){ + FSKDEM.m_OverFlow = 0; + FSKDEM.ClearMode(); + } + m_Tx = m_ReqTx; + Wave.SetPTT(m_Tx); + TaskPriority(); + } + if( m_playmode == 1 ) m_playmode = 0; + } + if( m_ReqFifoSize ){ + if( !UpdateFifoSize() ) goto _init; + } + if( (!m_Tx) && (WaveFile.m_mode != m_playmode) ){ + if( WaveFile.m_mode == 1 ){ + Wave.InClose(); + Wave.m_OutFifoSize = sys.m_SoundFifoTX; + m_IDOutDevice = sys.m_SoundOutDevice; //AA6YQ 1.66 + Wave.OutOpen(&m_WFX, m_IDOutDevice, m_BuffSize); //AA6YQ 1.66 + FSKDEM.m_OverFlow = 0; + } + else if( m_playmode == 1 ){ + Wave.OutClose(); + Wave.m_InFifoSize = sys.m_SoundFifoRX; + Wave.InOpen(&m_WFX, m_IDDevice, m_BuffSize); + FSKDEM.m_OverFlow = 0; + } + m_playmode = WaveFile.m_mode; + } + if( m_susp ){ + JobSuspend(); + } + if( m_ReqSpeedTest ){ + JobSpeedTest(); + } + } +_ex:; + Wave.InClose(); + Wave.OutAbort(); + Wave.UpdateDevice(-1); + m_Stop = TRUE; +} +//--------------------------------------------------------------------------- +void __fastcall TSound::JobSuspend(void) +{ + Wave.InClose(); + Wave.OutAbort(); + m_suspack = 1; + Priority = tpNormal; + while(1){ + if( Terminated == TRUE ){ + m_Stop = TRUE; + return; + } + if( m_Tx != m_ReqTx ){ + m_Tx = m_ReqTx; + } + Sleep(100); + Wave.PumpMessages(); + if( !m_susp ){ + for( int i = 0; i < 5; i++ ){ + if( Wave.InOpen(&m_WFX, m_IDDevice, m_BuffSize) == TRUE ) break; + ::Sleep(100); + Wave.PumpMessages(); + } + if( Wave.IsInOpen() ){ + m_suspack = 1; + break; + } + else { + m_susp = 1; + m_suspack = 1; + ErrorMsg(); + } + } + } + TaskPriority(); + m_Tx = 0; + m_playmode = 0; +} +//--------------------------------------------------------------------------- +void __fastcall TSound::JobSpeedTest() +{ + DWORD tc = ::GetTickCount(); +// RTTYMOD.InitTXBuf(); +// RTTYDEM.Stop(); + for( int i = 0; i < 1000000; i++ ){ + FSKMOD.Do(0); + FSKDEM.Do(0); + } + m_SpeedValue = ::GetTickCount() - tc; + m_ReqSpeedTest = 0; +} +//--------------------------------------------------------------------------- +// ƒXƒŒƒbƒh“à‚ŃR[ƒ‹‚µ‚Ă͂¢‚¯‚È‚¢ +#define AFC_PEAKDOWN 128 +int __fastcall TSound::DoAFC(void) +{ + if( !sys.m_AFC ) return 0; + if( sys.m_echo != 2 ){ + if( m_Tx ) return 0; // ‘—M’†‚ÍŽÀs‚µ‚È‚¢ + } + + double mfq = FSKDEM.GetMarkFreq(); + double sfq = FSKDEM.GetSpaceFreq(); + double sft = sfq - mfq; + double sk = sft * 0.5; + + int nb = (sft < 50.0) ? 1 : 0; + int xm = mfq * (FFT_SIZE / SampFreq); + int xs = sfq * (FFT_SIZE / SampFreq); + int xc = int((xs - xm) * sys.m_AFCSweep); + int xe = int(xc * 1.2); + if( nb ) xe = 80 * (FFT_SIZE / SampFreq); + int n = 0; + int avg = 0; + + int x, xx; + int d; + int max1H = -MAXINT; + int m1H = 0; + for( x = 0; x < xc; x++ ){ // Mark Peak + + xx = xm + x; + if( (xx >= 0) && (xx < m_FFTWINDOW) ){ + d = fftIN.m_fft[xx]; + if( max1H < d ){ + max1H = d; + m1H = xx; + } + else if( (d + AFC_PEAKDOWN) < max1H ){ + break; + } + } + } + int max1L = -MAXINT; + int m1L = 0; + for( x = 0; x < xe; x++ ){ // Mark Peak - + xx = xm - x; + if( (xx >= 0) && (xx < m_FFTWINDOW) ){ + d = fftIN.m_fft[xx]; + avg += d; + n++; + if( max1L < d ){ + max1L = d; + m1L = xx; + } + else if( (d + AFC_PEAKDOWN) < max1L ){ + break; + } + } + } + + int max2H = -MAXINT; + int m2H = 0; + for( x = 0; x < xe; x++ ){ // Space Peak + + xx = xs + x; + if( (xx >= 0) && (xx < m_FFTWINDOW) ){ + d = fftIN.m_fft[xx]; + avg += d; + n++; + if( max2H < d ){ + max2H = d; + m2H = xx; + } + else if( (d + AFC_PEAKDOWN) < max2H ){ + break; + } + } + } + + int max2L = -MAXINT; + int m2L = 0; + for( x = 0; x < xc; x++ ){ // Space Peak - + xx = xs - x; + if( (xx >= 0) && (xx < m_FFTWINDOW) ){ + d = fftIN.m_fft[xx]; + if( max2L < d ){ + max2L = d; + m2L = xx; + } + else if( (d + AFC_PEAKDOWN) < max2L ){ + break; + } + } + } + if( n ) avg /= n; + +// m1l - m1h m2l - m2h +#if 0 + FILE *fp = fopen("f:\\test.txt", "at"); + fprintf(fp, "%5u %5u %5u %5u\n", m1L, m1H, m2L, m2H); + fclose(fp); +#endif + + if( nb ){ + if( max1L < max1H ){ max1L = max1H; m1L = m1H; } + if( max1L < max2L ){ max1L = max2L; m1L = m2L; } + if( max1L < max2H ){ max1L = max2H; m1L = m2H; } + max2L = max1L; + m2L = m1L; + } + else if( m1H == m2L ){ + if( max2H > max1L ){ + max1L = max1H; + m1L = m1H; + max2L = max2H; + m2L = m2H; + } + } + else { + if( max1H > max1L ){ + m1L = m1H; + max1L = max1H; + } + if( max2H > max2L ){ + m2L = m2H; + max2L = max2H; + } + } + if( !nb ){ + switch(sys.m_FFTGain){ + case 0: + if( ((max1L - avg) < sys.m_AFCSQ) || ((max2L - avg) < sys.m_AFCSQ) ) return 0; + break; + case 1: + if( ((max1L - avg) < sys.m_AFCSQ*1.2) || ((max2L - avg) < sys.m_AFCSQ*1.2) ) return 0; + break; + case 2: + if( ((max1L - avg) < sys.m_AFCSQ*1.5) || ((max2L - avg) < sys.m_AFCSQ*1.5) ) return 0; + break; + case 3: + if( ((max1L - avg) < sys.m_AFCSQ*1.8) || ((max2L - avg) < sys.m_AFCSQ*1.8) ) return 0; + break; + default: + if( ((max1L - avg) < sys.m_AFCSQ*0.5) || ((max2L - avg) < sys.m_AFCSQ*0.5) ) return 0; + break; + } + } + else { + if( (max1L - avg) < sys.m_AFCSQ*0.5 ) return 0; + } + int ns = m2L - m1L; // ŒŸo‚µ‚½ƒVƒtƒg• + if( !nb ){ + if( ns < int(140.0 * (FFT_SIZE / SampFreq)) ) return 0; + } + if( ns > int(1500.0 * (FFT_SIZE / SampFreq)) ) return 0; + + int os = (sft * (FFT_SIZE / SampFreq)); // Œ»Ý‚̃Vƒtƒg• + double nmfq = m1L * (SampFreq / FFT_SIZE); + double nsfq = m2L * (SampFreq / FFT_SIZE); + int ds = ABS(ns-os); // ƒVƒtƒg•‚Ì· + switch(sys.m_FixShift){ + case 0: // Free + if( nb ) goto _fixed; + if( ((ds <= (os * 1.2)) || nb) && ((nsfq - nmfq) >= 15.0) ){ + if( fabs(nmfq - mfq) >= 2.0 ){ + mfq += (nmfq - mfq)/sys.m_AFCTime; + } + if( fabs(nsfq - sfq) >= 2.0 ){ + sfq += (nsfq - sfq)/sys.m_AFCTime; + } + mfq = double(int(mfq+0.5)); + sfq = double(int(sfq+0.5)); + if( mfq < MARKL ) mfq = MARKL; + if( sfq > SPACEH ) sfq = SPACEH; + Suspend(); + FSKDEM.AFCMarkFreq(mfq); + FSKDEM.AFCSpaceFreq(sfq); + if( m_bpfafc && (FSKDEM.GetAFCMarkFreq() == mfq) && (FSKDEM.GetAFCSpaceFreq() == sfq) ){ + CalcBPF(); + } + Resume(); + return 1; + } + break; + case 1: // Fixed Shift +_fixed:; + if( nb ){ + double fq = (nmfq + nsfq) / 2; + nmfq = fq - sft/2; + nsfq = fq + sft/2; + } + if( ((ds <= (os * 0.25)) || nb) && ((nsfq - nmfq) >= 15.0) ){ + double cfq = (nmfq + nsfq)/2.0; + nmfq = cfq - sk; + if( fabs(nmfq - mfq) >= 2.0 ){ + if( nb && (fabs(nmfq - mfq) < 10.0) ){ + mfq += (nmfq - mfq)/(sys.m_AFCTime * 4.0); + } + else { + mfq += (nmfq - mfq)/sys.m_AFCTime; + } + mfq = double(int(mfq+0.5)); + if( mfq < MARKL ) mfq = MARKL; + if( (mfq + sft) > SPACEH ) mfq = SPACEH - sft; + sfq = mfq + sft; + Suspend(); + FSKDEM.AFCMarkFreq(mfq); + FSKDEM.AFCSpaceFreq(sfq); + if( m_bpfafc && (FSKDEM.GetAFCMarkFreq() == mfq) && (FSKDEM.GetAFCSpaceFreq() == sfq) ){ + CalcBPF(); + } + Resume(); + return 1; + } + } + break; + case 2: // HAM + if( nb ) goto _fixed; + if( (ns >= 140.0*FFT_SIZE/SampFreq) && (ns <= 260.0*FFT_SIZE/SampFreq) ){ + sft = nsfq - nmfq; + if( sft > 230.0 ){ + sft = 240.0; + } + else if( sft > 210.0 ){ + sft = 220.0; + } + else if( sft > 185 ){ + sft = 200.0; + } + else { + sft = 170.0; + } + nsfq = nmfq + sft; + if( fabs(nmfq - mfq) >= 2.0 ){ + mfq += (nmfq - mfq)/sys.m_AFCTime; + } + if( fabs(nsfq - sfq) >= 2.0 ){ + sfq += (nsfq - sfq)/sys.m_AFCTime; + } + mfq = double(int(mfq+0.5)); + sfq = double(int(sfq+0.5)); + if( mfq < MARKL ) mfq = MARKL; + if( sfq > SPACEH ) sfq = SPACEH; + Suspend(); + FSKDEM.AFCMarkFreq(mfq); + FSKDEM.AFCSpaceFreq(sfq); + if( m_bpfafc && (FSKDEM.GetAFCMarkFreq() == mfq) && (FSKDEM.GetAFCSpaceFreq() == sfq) ){ + CalcBPF(); + } + Resume(); + return 1; + } + break; + case 3: // FSK + if( (ns >= 140.0*FFT_SIZE/SampFreq) && (ns <= 260.0*FFT_SIZE/SampFreq) ){ + sft = nsfq - nmfq; + if( sft > 230.0 ){ + sft = 240.0; + } + else if( sft > 210.0 ){ + sft = 220.0; + } + else if( sft > 185 ){ + sft = 200.0; + } + else { + sft = 170.0; + } + nsfq = nmfq + sft; + if( fabs(nmfq - mfq) >= 2.0 ){ + nmfq = mfq + (nmfq - mfq)/sys.m_AFCTime; + } + if( fabs(nsfq - sfq) >= 2.0 ){ + nsfq = sfq + (nsfq - sfq)/sys.m_AFCTime; + } + sft = nsfq - nmfq; + if( sft < 175 ) sft = 170; + if( sft > 195 ) sft = 200; + sft = double(int((sft*0.5)+0.5)); + nmfq = ((sfq + mfq)*0.5) - sft; + nsfq = ((sfq + mfq)*0.5) + sft; + mfq = double(int(nmfq+0.5)); + sfq = double(int(nsfq+0.5)); + if( mfq < MARKL ) mfq = MARKL; + if( sfq > SPACEH ) sfq = SPACEH; + Suspend(); + FSKDEM.AFCMarkFreq(mfq); + FSKDEM.AFCSpaceFreq(sfq); + if( m_bpfafc && (FSKDEM.GetAFCMarkFreq() == mfq) && (FSKDEM.GetAFCSpaceFreq() == sfq) ){ + CalcBPF(); + } + Resume(); + return 1; + } + break; + } + return 0; +} +//--------------------------------------------------------------------------- +double __fastcall TSound::GetScopeRange(double &low, double center, double shift) +{ + double FM; + + switch(m_FFTFW ){ + case 0: // Auto + if( shift >= 800 ){ + FM = 3000 * FFT_SIZE / SampFreq; + low = center - 1500; + } + else if( shift >= 400 ){ + FM = 2000 * FFT_SIZE / SampFreq; + low = center - 1000; + } + else { + FM = 1000 * FFT_SIZE / SampFreq; + low = center - 500; + } + break; + case 1: // 500 + FM = 500 * FFT_SIZE / SampFreq; + low = center - 250; + break; + case 2: // 1000 + FM = 1000 * FFT_SIZE / SampFreq; + low = center - 500; + break; + case 3: // 1500 + FM = 1500 * FFT_SIZE / SampFreq; + low = center - 750; + break; + case 4: // 2000 + FM = 2000 * FFT_SIZE / SampFreq; + low = center - 1000; + break; + default: // 3000 + FM = 3000 * FFT_SIZE / SampFreq; + low = center - 1500; + break; + } + return FM; +} +//--------------------------------------------------------------------------- +// ƒXƒŒƒbƒh“à‚ŃR[ƒ‹‚µ‚Ă͂¢‚¯‚È‚¢ +int __fastcall TSound::DrawFFT(Graphics::TBitmap *pBitmap, int sw, int XRD) +{ + if( m_FFTSW ){ + if( fftIN.m_CollectFFT ){ + switch(sys.m_FFTGain){ + case 0: + fftIN.CalcFFT(m_FFTWINDOW, 30.0, sys.m_FFTResp); + break; + case 1: + fftIN.CalcFFT(m_FFTWINDOW, 34.0, sys.m_FFTResp); + break; + case 2: + fftIN.CalcFFT(m_FFTWINDOW, 42.0, sys.m_FFTResp); + break; + case 3: + fftIN.CalcFFT(m_FFTWINDOW, 54.0, sys.m_FFTResp); + break; + default: + fftIN.CalcFFT(m_FFTWINDOW, (sys.m_echo != 2 && m_Tx) ? 0.02 : 0.1, sys.m_FFTResp); + break; + } + fftIN.TrigFFT(); + } + else if( !sw ){ + return 0; + } + } + if( Remote & REMSHOWOFF ) return 2; + + TCanvas *tp = pBitmap->Canvas; + TRect rc; + int XL = 0; + int XR = pBitmap->Width - 1; + int YT = 0; + int YB = pBitmap->Height - 1; + rc.Left = XL; + rc.Right = XR; + rc.Top = YT; + rc.Bottom = YB+1; + tp->Brush->Color = clBlack; + tp->FillRect(rc); + XR -= XRD; + + int i, x; + if( m_Err || FSKDEM.m_OverFlow ){ + if( m_Err || (!m_Tx && !m_Test) ){ + tp->Font->Color = clWhite; + tp->Font->Size = 10; + char bf[32]; + strcpy(bf, m_Err ? "Lost sound" : "Overflow"); + x = tp->TextWidth(bf); + tp->TextOut(XR - x - 3, 0, bf); + } + FSKDEM.m_OverFlow = 0; + if( m_Err ) m_Err--; + } + if( WaveFile.m_mode ){ + tp->Font->Color = clWhite; + tp->Font->Size = 10; + if( WaveFile.m_pause ){ + tp->TextOut(3, 0, "Pause"); + } + else { + switch(WaveFile.m_mode){ + case 1: + tp->TextOut(3, 0, "Play"); + break; + case 2: + tp->TextOut(3, 0, "Rec."); + break; + } + } + } + double space = FSKDEM.GetSpaceFreq(); + double mark = FSKDEM.GetMarkFreq(); + double shift = fabs(mark - space); + double center = (mark + space)/2.0; + double low; + int FM = GetScopeRange(low, center, shift) + 0.5; + tp->Pen->Color = clYellow; + tp->Pen->Style = psSolid; + x = int(((mark-low)*FFT_SIZE*double(XR)/double(SampFreq*FM)) + 0.5); + tp->MoveTo(x, YT); + tp->LineTo(x, YB); + x = int(((space-low)*FFT_SIZE*double(XR)/double(SampFreq*FM)) + 0.5); + tp->MoveTo(x, YT); + tp->LineTo(x, YB); + + if( sw || (!m_FFTSW) ) return 1; + + int offx = int((low * FFT_SIZE / SampFreq) + ((FM/XR)/2.0) + 0.5); + tp->Pen->Color = clWhite; + + int d; + int max = 0; + double k; + if( sys.m_FFTGain >= 4 ){ + switch(sys.m_FFTGain){ + case 4: + k = double(YB) * 0.85 / m_FFTMax; + break; + case 5: + k = double(YB) * 1.0 / m_FFTMax; + break; + case 6: + k = double(YB) * 1.2 / m_FFTMax; + break; + case 7: + k = double(YB) * 1.5 / m_FFTMax; + break; + } + } + else { + k = double(YB)/256.0; + } + for( i = 0; i < XR; i++ ){ + x = (i * FM)/XR + offx; + if( (x >= 0) && (x < m_FFTWINDOW) ){ + d = fftIN.m_fft[x]; + if( d > max ) max = d; + d *= k; + } + else { + d = 0; + } + if( d >= (YB-YT) ) d = YB - YT - 1; + if( i ){ + tp->LineTo(i, YB-d); + } + else { + tp->MoveTo(i, YB-d); + } + } + if( sys.m_FFTGain >= 4 ){ + m_FFTSumMax -= m_FFTMax; + m_FFTSumMax += max; + if( m_FFTSumMax < 64 ) m_FFTSumMax = 64; + m_FFTMax = m_FFTSumMax / 2; + } + + if( m_lmsbpf && m_lms.m_Type ){ + if( m_lms.m_lmsNotch ){ + tp->Pen->Color = clYellow; + tp->Pen->Style = psSolid; + x = int(((m_lms.m_lmsNotch-low)*FFT_SIZE*double(XR)/double(SampFreq*FM)) + 0.5); + //POINT ary[3]; //JA7UDE 0428 + TPoint ary[3]; //JA7UDE 0428 + ary[0].x = x, ary[0].y = YB; + ary[1].x = x-3, ary[1].y = YB-5; + ary[2].x = x+3, ary[2].y = YB-5; + tp->Brush->Color = clRed; + tp->Polygon(ary, 2); + if( m_lms.m_twoNotch && m_lms.m_lmsNotch2 ){ + x = int(((m_lms.m_lmsNotch2-low)*FFT_SIZE*double(XR)/double(SampFreq*FM)) + 0.5); + ary[0].x = x, ary[0].y = YB; + ary[1].x = x-3, ary[1].y = YB-5; + ary[2].x = x+3, ary[2].y = YB-5; + tp->Brush->Color = clBlue; + tp->Polygon(ary, 2); + } + } + } + return 2; +} + +double __fastcall TSound::GetScreenFreq(int x, int XW, int XRD) +{ + double space = FSKDEM.GetSpaceFreq(); + double mark = FSKDEM.GetMarkFreq(); + double shift = fabs(mark - space); + double center = (mark + space)/2.0; + double low; + double FW = GetScopeRange(low, center, shift) * SampFreq / FFT_SIZE; + return ((x * FW) / (XW-XRD)) + low; +} + +//--------------------------------------------------------------------------- +// ƒXƒŒƒbƒh“à‚ŃR[ƒ‹‚µ‚Ă͂¢‚¯‚È‚¢ +int __fastcall TSound::DrawFFTWater(Graphics::TBitmap *pBitmap, int sw, int XRD) +{ + if( Remote & REMSHOWOFF ) return 2; + TCanvas *tp = pBitmap->Canvas; + TRect rc; + int XL = 0; + int XR = pBitmap->Width - 1; + int YT = 0; + int YB = pBitmap->Height - 1; + rc.Left = XL; + rc.Right = XR; + rc.Top = YT; + rc.Bottom = YB+1; + if( sw ){ + tp->Brush->Color = clBlack; + tp->FillRect(rc); + return 1; + } + int i, x; + int XRR = XR - XRD; + + double space = FSKDEM.GetSpaceFreq(); + double mark = FSKDEM.GetMarkFreq(); + double shift = fabs(mark - space); + double center = (mark + space)/2.0; + double low; + int FM = GetScopeRange(low, center, shift) + 0.5; + + TRect src(rc); + src.Bottom--; + rc.Top++; + tp->CopyRect(rc, tp, src); + + int offx = int((low * FFT_SIZE / SampFreq) + ((FM/XRR)/2.0) + 0.5); + int d; + int mx = -MAXINT; + int mi = 0; + int micnt = 0; + double k1 = 128.0/double(m_WaterMax - m_WaterMin); + for( i = 0; i < XR; i++ ){ + x = (i * FM)/XRR + offx; + if( ((x >= 0) && (x < m_FFTWINDOW)) ){ + d = fftIN.m_fft[x] / 2; + if( mx < d ) mx = d; + mi += d; + micnt++; + + d -= m_WaterMin; + d = double(d) * k1; + + if( d >= 128 ) d = 127; + if( d < 0 ) d = 0; + } + else { + d = 0; + } + tp->Pixels[i][0] = TColor(ColorTable[127-d] | sys.d_PaletteMask); + } + m_WaterSumMax -= m_WaterMax; + m_WaterSumMax += mx; + if( sys.m_FFTGain >= 4 ){ + if( m_WaterSumMax < (16*2) ) m_WaterSumMax = (16*2); + if( m_WaterSumMax > 512 ) m_WaterSumMax = 512; + } + else { + if( m_WaterSumMax < (128*2) ) m_WaterSumMax = (128*2); + } + m_WaterMax = m_WaterSumMax / 8; + if( micnt ){ + m_WaterMin = mi/micnt; + } + if( sys.m_FFTGain >= 4 ){ + if( m_WaterMin >= (m_WaterMax - 4) ) m_WaterMax = m_WaterMin + 4; + } + else { + if( m_WaterMin >= (m_WaterMax - 32) ) m_WaterMax = m_WaterMin + 32; + } + return 2; +} + + +//--------------------------------------------------------------------------- +//AA6YQ 1.6.6 +LPCSTR __fastcall TSound::GetInputSoundcard(unsigned int ID) +{ + + if (MMSYSERR_NOERROR==(waveInGetDevCaps(ID,&InCaps,sizeof(InCaps)))) { + return InCaps.szPname; + } + else { + return ""; + } +} + +//--------------------------------------------------------------------------- +//AA6YQ 1.6.6 +LPCSTR __fastcall TSound::GetOutputSoundcard(unsigned int ID) +{ + + if (MMSYSERR_NOERROR==(waveOutGetDevCaps(ID,&OutCaps,sizeof(OutCaps)))) { + return OutCaps.szPname; + } + else { + return ""; + } +} +//--------------------------------------------------------------------------- + +void __fastcall CWaveFile::ReadWrite(double *s, int size) +{ + SHORT d; + + if( m_Handle != NULL ){ + if( m_mode == 2 ){ // ‘‚«‚±‚Ý + if( !m_pause ){ + for( ; size; s++, size-- ){ + d = SHORT(*s); + if( mmioWrite(m_Handle, (const char*)&d, 2) != 2 ){ + mmioClose(m_Handle, 0); + m_Handle = 0; + m_mode = 0; + break; + } + else { + m_pos += 2; + } + } + } + } + else { // “Ç‚Ýo‚µ + if( m_pause || m_dis ){ + memset(s, 0, sizeof(double)*size); + } + else { + for( ; size; s++, size-- ){ + if( mmioRead(m_Handle, (char *)&d, 2) == 2 ){ + *s = d; + m_pos += 2; + } + else if( m_autopause ){ + m_pause = 1; + break; + } + else { + mmioClose(m_Handle, 0); + m_Handle = 0; + m_mode = 0; + break; + } + } + for( ; size; s++, size-- ){ + *s = 0; + } + } + } + } +} + +__fastcall CWaveFile::CWaveFile() +{ + m_mode = 0; + m_pause = 0; + m_Handle = NULL; + m_dis = 0; + m_autopause = 0; +} + +__fastcall CWaveFile::~CWaveFile() +{ + FileClose(); +} + +void __fastcall CWaveFile::FileClose(void) +{ + m_mode = 0; + m_pause = 0; + if( m_Handle != NULL ){ + mmioClose(m_Handle, 0); + m_Handle = 0; + } +} + +void __fastcall CWaveFile::Rec(LPCSTR pName) +{ + FileClose(); + m_FileName = pName; + m_Handle = mmioOpen(m_FileName.c_str(), NULL, MMIO_CREATE|MMIO_WRITE|MMIO_ALLOCBUF); + if( m_Handle == NULL ){ + ErrorMB( (sys.m_WinFontCharset != SHIFTJIS_CHARSET)?"Can't open '%s'":"'%s'‚ð쬂ł«‚Ü‚¹‚ñ.", pName); + return; + } + m_Head[0] = 0x55; + m_Head[1] = 0xaa; + m_Head[2] = char(SampType); + m_Head[3] = 0; + mmioWrite(m_Handle, (const char *)m_Head, 4); + m_pos = 4; + m_mode = 2; + m_pause = 0; + m_dis = 0; +} + +int SampTable[]={11025, 8000, 6000, 12000, 16000, 18000, 22050, 24000, 44100}; +BOOL __fastcall CWaveFile::Play(LPCSTR pName) +{ + FileClose(); + FILE *fp = fopen(pName, "rb"); + if( fp == NULL ){ + ErrorMB( (sys.m_WinFontCharset != SHIFTJIS_CHARSET)?"Can't open '%s'":"'%s'‚ðƒI[ƒvƒ“‚Å‚«‚Ü‚¹‚ñ.", pName); + return FALSE; + } + m_length = filelength(fileno(fp)); + m_FileName = pName; + fclose(fp); + m_Handle = mmioOpen(m_FileName.c_str(), NULL, MMIO_READ|MMIO_ALLOCBUF); + if( m_Handle == NULL ){ + ErrorMB( (sys.m_WinFontCharset != SHIFTJIS_CHARSET)?"Can't open '%s'":"'%s'‚ðƒI[ƒvƒ“‚Å‚«‚Ü‚¹‚ñ.", pName); + return FALSE; + } + m_pos = 0; + if( mmioRead(m_Handle, (char *)m_Head, 4) == 4 ){ + int type = 0; + if( (m_Head[0] == 0x55)&&(m_Head[1] == 0xaa) ){ + type = m_Head[2]; + m_pos = 4; + m_length -= 4; + } + if( type > 8 ) type = 0; + if( type != SampType ){ + if( YesNoMB( + (sys.m_WinFontCharset != SHIFTJIS_CHARSET) + ? "%s\r\n\r\nThis file has been recorded based on %uHz, play it with sampling conversion?" + : "%s\r\n\r\n‚±‚̃tƒ@ƒCƒ‹‚Í %uHz ƒx[ƒX‚Å‹L˜^‚³‚ê‚Ä‚¢‚Ü‚·. Žü”g”•ÏŠ·‚µ‚ÄĶ‚µ‚Ü‚·‚©H", + m_FileName.c_str(), SampTable[type] ) == IDNO ){ + mmioClose(m_Handle, 0); + m_Handle = 0; + return TRUE; + } + else { + mmioClose(m_Handle, 0); + m_Handle = 0; + char bf[1024]; + strcpy(bf, pName); + SetEXT(bf, ""); + char wName[1024]; + sprintf(wName, "%s_%u.MMV", bf, int(SampBase)); + if( ChangeSampFreq(wName, pName, SampTable[type]) == TRUE ){ + Play(wName); + } + } + } + } + m_mode = 1; + m_pause = 0; + m_dis = 0; + return TRUE; +} + +void __fastcall CWaveFile::Rewind(void) +{ + if( m_Handle != NULL ){ + m_dis++; + if( m_mode == 2 ){ + mmioSeek(m_Handle, 4, SEEK_SET); + m_pos = 4; + } + else { + mmioSeek(m_Handle, 0, SEEK_SET); + m_pos = 0; + } + m_dis--; + } +} + +void __fastcall CWaveFile::Seek(int n) +{ + if( m_Handle != NULL ){ + m_dis++; + if( (m_Head[0] == 0x55)&&(m_Head[1] == 0xaa) ){ + mmioSeek(m_Handle, n + 4, SEEK_SET); + m_pos = n + 4; + } + else { + mmioSeek(m_Handle, n, SEEK_SET); + m_pos = n; + } + m_dis--; + } +} + +long __fastcall CWaveFile::GetPos(void) +{ + if( (m_Head[0] == 0x55)&&(m_Head[1] == 0xaa) ){ + long n = m_pos - 4; + if( n < 0 ) n = 0; + return n; + } + else { + return m_pos; + } +} + +int __fastcall CWaveFile::ChangeSampFreq(LPCSTR tName, LPCSTR pName, int sSamp) +{ + int rr = FALSE; + FILE *fp = fopen(pName, "rb"); + if( fp != NULL ){ + CWaitCursor w; + BYTE head[4]; + memset(head, 0, sizeof(head)); + head[0] = 0x55; + head[1] = 0xaa; + head[2] = char(SampType); + head[3] = 0; + FILE *wfp = fopen(tName, "wb"); + if( wfp != NULL ){ + fwrite(head, 1, 4, wfp); + + int rsize = 16384; + int wsize = rsize * SampBase/double(sSamp); + short *rp = new short[rsize]; + short *wp = new short[wsize]; + CIIR riir; + riir.MakeIIR(2800, sSamp, 8, 0, 0); + CIIR wiir; + wiir.MakeIIR(2800, SampBase, 16, 0, 0); + int rlen, wlen; + short *tp; + int i, r; + while(1){ + rlen = fread(rp, 1, rsize * 2, fp); + if( !rlen ) break; + rlen /= 2; + if( SampBase < sSamp ){ // ƒfƒVƒ[ƒVƒ‡ƒ“ + tp = rp; + for( i = 0; i < rlen; i++, tp++ ){ + *tp = riir.Do(*tp); + } + } + tp = wp; + wlen = rlen * SampBase / sSamp; + if( wlen > wsize ) wlen = wsize; + for( i = 0; i < wlen; i++ ){ + r = int(double(i) * sSamp / SampBase); + *tp++ = wiir.Do(rp[r]); + } + if( fwrite(wp, 1, wlen * 2, wfp) != size_t(wlen * 2) ) break; + } + if( !fclose(wfp) ) rr = TRUE; + delete[] rp; + delete[] wp; + } + fclose(fp); + } + return rr; +} + diff --git a/Sound.h b/Sound.h new file mode 100644 index 0000000..262a263 --- /dev/null +++ b/Sound.h @@ -0,0 +1,171 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba, Dave Bernstein +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------------- +#ifndef FilterH +#define FilterH +//--------------------------------------------------------------------------- +#include + +#include "Wave.h" +#include "fft.h" +#include "rtty.h" +//--------------------------------------------------------------------------- +class CWaveFile +{ +private: + HMMIO m_Handle; + int m_dis; + BYTE m_Head[4]; +public: + long m_length; + long m_pos; + int m_mode; + int m_pause; + int m_autopause; + AnsiString m_FileName; + + __fastcall CWaveFile(); + __fastcall ~CWaveFile(); + void __fastcall FileClose(void); + void __fastcall Rec(LPCSTR pName); + BOOL __fastcall Play(LPCSTR pName); + void __fastcall Rewind(void); + void __fastcall ReadWrite(double *s, int size); + long __fastcall GetPos(void); + void __fastcall Seek(int n); + int __fastcall ChangeSampFreq(LPCSTR tName, LPCSTR pName, int sSamp); +}; + + +class TSound : public TThread +{ +private: + double ZBPF[TAPMAX+1]; + + BOOL m_Stop; + WAVEFORMATEX m_WFX; + + int m_FFTMax; + int m_FFTSumMax; + + int m_WaterMax; + int m_WaterSumMax; + int m_WaterMin; + + CWave Wave; + CNoise Noise; + + int m_ReqFifoSize; + + void __fastcall ErrorMsg(void); + double __fastcall GetScopeRange(double &low, double center, double shift); + void __fastcall ReadWrite(double *s, int size); + int __fastcall UpdateFifoSize(void); + BOOL __fastcall ReInitSound(void); + void __fastcall JobSuspend(void); + +protected: + void __fastcall Execute(); + + +public: + __fastcall TSound(bool CreateSuspended); + __fastcall ~TSound(); + + void __fastcall Stop(void); + void __fastcall ReqStop(void); + void __fastcall WaitStop(void); + void __fastcall TimingWait(void); + + void __fastcall InitSound(void); + double __fastcall GetScreenFreq(int x, int XW, int XRD); + int __fastcall DrawFFT(Graphics::TBitmap *pBitmap, int sw, int XRD); + int __fastcall DrawFFTWater(Graphics::TBitmap *pBitmap, int sw, int XRD); + void __fastcall SetTXRX(int sw); + int __fastcall DoAFC(void); + + void __fastcall CalcBPF(void); + void __fastcall CalcBPF(double fl, double fh, double fw); + void __fastcall TaskPriority(void); + + LPCSTR __fastcall GetInputSoundcard(unsigned int ID); + LPCSTR __fastcall GetOutputSoundcard(unsigned int ID); + + CFSKDEM FSKDEM; + CFSKMOD FSKMOD; + + CWaveFile WaveFile; + + int m_Test; + + void __fastcall FileClose(void); + void __fastcall Rec(LPCSTR pName); + void __fastcall Play(LPCSTR pName); + void __fastcall Rewind(void); + + void __fastcall InitWFX(void); + + UINT m_IDDevice; + UINT m_IDOutDevice; //AA6YQ 1.6.6 + + int m_playmode; + int m_susp; + int m_suspack; + + int m_bpf; + int m_bpftap; + int m_bpfafc; + double m_bpffw; + int m_lmsbpf; + CLMS m_lms; + double HBPF[TAPMAX+1]; + + int m_Tx; + int m_ReqTx; + + CFFT fftIN; + + int m_Err; + int m_BuffSize; + + int m_Noise; + + int m_FFTSW; + int m_FFTFW; + + int m_FFTWINDOW; + + int m_ReqSpeedTest; + DWORD m_SpeedValue; + void __fastcall JobSpeedTest(); + + inline int __fastcall GetOutCount(int sw){ + return (sw ? Wave.GetOutBCC() : Wave.GetOutBC()) * m_BuffSize; + } + inline void __fastcall TrigBCC(void){ + Wave.SetOutBCC(Wave.GetOutBC()); + } + inline int __fastcall GetBCC(void){ + return Wave.GetOutBCC(); + } +}; +//--------------------------------------------------------------------------- +#endif + diff --git a/TH5Len.cpp b/TH5Len.cpp new file mode 100644 index 0000000..69d5bdb --- /dev/null +++ b/TH5Len.cpp @@ -0,0 +1,62 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "TH5Len.h" +#include "ComLib.h" +#include "Hamlog5.h" +//--------------------------------------------------------------------- +#pragma resource "*.dfm" +//TTH5LenDlg *TH5LenDlg; +//--------------------------------------------------------------------- +__fastcall TTH5LenDlg::TTH5LenDlg(TComponent* AOwner) + : TForm(AOwner) +{ + Caption = (sys.m_WinFontCharset != SHIFTJIS_CHARSET) ? "Set fields length" : "ƒtƒB[ƒ‹ƒh’·‚ÌÝ’è"; +} +//--------------------------------------------------------------------- +int __fastcall TTH5LenDlg::Execute(void) +{ + UHis->Position = Log.m_LogSet.m_Hamlog5Len[8]; + UMy->Position = Log.m_LogSet.m_Hamlog5Len[9]; + UFreq->Position = Log.m_LogSet.m_Hamlog5Len[10]; + UMode->Position = Log.m_LogSet.m_Hamlog5Len[11]; + UName->Position = Log.m_LogSet.m_Hamlog5Len[12]; + UQTH->Position = Log.m_LogSet.m_Hamlog5Len[13]; + URem->Position = Log.m_LogSet.m_Hamlog5Len[14]; + if( ShowModal() == IDOK ){ + Log.m_LogSet.m_Hamlog5Len[8] = UHis->Position; + Log.m_LogSet.m_Hamlog5Len[9] = UMy->Position; + Log.m_LogSet.m_Hamlog5Len[10] = UFreq->Position; + Log.m_LogSet.m_Hamlog5Len[11] = UMode->Position; + Log.m_LogSet.m_Hamlog5Len[12] = UName->Position; + Log.m_LogSet.m_Hamlog5Len[13] = UQTH->Position; + Log.m_LogSet.m_Hamlog5Len[14] = URem->Position; + Log.m_LogSet.m_Hamlog5Len[15] = Log.m_LogSet.m_Hamlog5Len[14]; + return TRUE; + } + else { + return FALSE; + } +} +//--------------------------------------------------------------------- + diff --git a/TH5Len.dfm b/TH5Len.dfm new file mode 100644 index 0000000..6457467 Binary files /dev/null and b/TH5Len.dfm differ diff --git a/TH5Len.h b/TH5Len.h new file mode 100644 index 0000000..e4d4758 --- /dev/null +++ b/TH5Len.h @@ -0,0 +1,71 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//---------------------------------------------------------------------------- +#ifndef OCBH +#define OCBH +//---------------------------------------------------------------------------- +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//---------------------------------------------------------------------------- +class TTH5LenDlg : public TForm +{ +__published: + TButton *OKBtn; + TButton *CancelBtn; + TLabel *L1; + TLabel *L2; + TLabel *L3; + TLabel *L4; + TLabel *L5; + TLabel *L6; + TLabel *L7; + TEdit *EHis; + TEdit *EMy; + TEdit *EFreq; + TEdit *EMode; + TEdit *EName; + TEdit *EQTH; + TEdit *ERem; + TUpDown *UHis; + TUpDown *UMy; + TUpDown *UFreq; + TUpDown *UMode; + TUpDown *UName; + TUpDown *UQTH; + TUpDown *URem; +private: +public: + virtual __fastcall TTH5LenDlg(TComponent* AOwner); + + int __fastcall Execute(void); +}; +//---------------------------------------------------------------------------- +//extern PACKAGE TTH5LenDlg *TH5LenDlg; +//---------------------------------------------------------------------------- +#endif diff --git a/TextEdit.cpp b/TextEdit.cpp new file mode 100644 index 0000000..c489fcd --- /dev/null +++ b/TextEdit.cpp @@ -0,0 +1,172 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "ComLib.h" +#include "TextEdit.h" +//--------------------------------------------------------------------------- +enum TFontPitch { fpDefault, fpVariable, fpFixed }; +//--------------------------------------------------------------------- +#pragma resource "*.dfm" +//TTextEditDlg *TextEditDlg; +//--------------------------------------------------------------------- +__fastcall TTextEditDlg::TTextEditDlg(TComponent* AOwner) + : TForm(AOwner) +{ + FormStyle = ((TForm *)AOwner)->FormStyle; + ap = NULL; + Memo->Font->Pitch = fpFixed; + EntryAlignControl(); + Font->Name = ((TForm *)AOwner)->Font->Name; + Font->Charset = ((TForm *)AOwner)->Font->Charset; +// Memo->Font->Name = sys.m_BtnFontName; +// Memo->Font->Charset = sys.m_BtnFontCharset; + if( Font->Charset != SHIFTJIS_CHARSET ){ + CancelBtn->Caption = "Cancel"; + FontBtn->Caption = "Font"; + } +} +//--------------------------------------------------------------------- +int __fastcall TTextEditDlg::Execute(AnsiString &as, int flag, LPCSTR pTitle /* = NULL*/) +{ + CWaitCursor tw; + ap = as.c_str(); + if( flag != TRUE ){ + OKBtn->Visible = FALSE; + CancelBtn->Caption = ( Font->Charset != SHIFTJIS_CHARSET ) ? "Close":"•‚¶‚é"; + Memo->ReadOnly = TRUE; + } + if( pTitle != NULL ){ + Caption = pTitle; + } + tw.Delete(); + int r = ShowModal(); + if( r == IDOK ){ + if( Memo->Modified == FALSE ) return FALSE; + if( flag == TRUE ){ + as = Memo->Text; + } + return TRUE; + } + return FALSE; +} + +void __fastcall TTextEditDlg::FontBtnClick(TObject *Sender) +{ + FontDialog->Font->Assign(Memo->Font); + NormalWindow(this); + if( FontDialog->Execute() == TRUE ){ + CWaitCursor tw; + Memo->Font->Assign(FontDialog->Font); + Memo->Update(); + } + TopWindow(this); +} +//--------------------------------------------------------------------------- +// ƒTƒCƒY•ÏXƒRƒ“ƒgƒ[ƒ‹‚Ì“o˜^ +void __fastcall TTextEditDlg::EntryAlignControl(void) +{ + RECT rc; + rc.left = 0; + rc.top = 0; + rc.right = 792-1; + rc.bottom = 572-1; + + AlignList.EntryControl(OKBtn, &rc, OKBtn->Font); + AlignList.EntryControl(CancelBtn, &rc, CancelBtn->Font); + AlignList.EntryControl(FontBtn, &rc, FontBtn->Font); + AlignList.EntryControl(Memo, &rc, Memo->Font); + + int CX = ::GetSystemMetrics(SM_CXFULLSCREEN); + int CY = ::GetSystemMetrics(SM_CYFULLSCREEN); +// int CX = ::GetSystemMetrics(SM_CXSCREEN); +// int CY = ::GetSystemMetrics(SM_CYSCREEN); + if( (CX < Width)||(CY < Height) ){ + Top = 0; + Left = 0; + Width = CX; + Height = CY; + } + FormCenter(this, CX, CY); + if( Owner != NULL ){ + WindowState = ((TForm *)Owner)->WindowState; + } +} +//--------------------------------------------------------------------------- +void __fastcall TTextEditDlg::FormResize(TObject *Sender) +{ + CWaitCursor tw; + AlignList.NewAlign(this); +} +//--------------------------------------------------------------------------- +void __fastcall TTextEditDlg::FormPaint(TObject *Sender) +{ + if( ap == NULL ) return; + CWaitCursor tw; + Memo->Text = ap; + ap = NULL; + Memo->Update(); +} +//--------------------------------------------------------------------------- +// ƒeƒLƒXƒgƒwƒ‹ƒv‚Ì•\ަ +void __fastcall ShowHelp(TForm *pForm, LPCSTR pName) +{ + char bf[2048]; + char Name[256]; + AnsiString in; + FILE *fp; + + sprintf(Name, "%s%s", BgnDir, pName); + CWaitCursor w; + if( (fp = fopen(Name, "rt"))!=NULL ){ + while(!feof(fp)){ + if( fgets(bf, 2048, fp) != NULL ){ + ClipLF(bf); + in += bf; + in += "\r\n"; + } + } + fclose(fp); + } + else { + if((sys.m_WinFontCharset != SHIFTJIS_CHARSET )){ + ErrorMB( "'%s' was not found.\r\n\r\nPlease search in the MMTTY English Web Site.", Name); + } + else { + ErrorMB( "'%s'‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ.\r\n\r\nMMTTY English Web Site ‚©‚çƒ_ƒEƒ“ƒ[ƒh‚µ‚ĉº‚³‚¢.", Name); + } + return; + } + if( sys.m_HelpNotePad ){ + sprintf( bf, "NOTEPAD.EXE %s", Name); + WinExec(bf, SW_SHOWDEFAULT); + } + else { + TTextEditDlg *Box = new TTextEditDlg(pForm); + Box->Memo->Font->Name = sys.m_HelpFontName; + Box->Memo->Font->Charset = sys.m_HelpFontCharset; + Box->Memo->Font->Size = sys.m_HelpFontSize; + Box->Execute(in, FALSE, pName); + delete Box; + } +} +//--------------------------------------------------------------------------- diff --git a/TextEdit.dfm b/TextEdit.dfm new file mode 100644 index 0000000..7c1faad Binary files /dev/null and b/TextEdit.dfm differ diff --git a/TextEdit.h b/TextEdit.h new file mode 100644 index 0000000..be2f86f --- /dev/null +++ b/TextEdit.h @@ -0,0 +1,69 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//---------------------------------------------------------------------------- +#ifndef TextEditH +#define TextEditH +//---------------------------------------------------------------------------- +//JA7UDE 0427 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//---------------------------------------------------------------------------- +class TTextEditDlg : public TForm +{ +__published: + TButton *OKBtn; + TButton *CancelBtn; + TMemo *Memo; + TButton *FontBtn; + TFontDialog *FontDialog; + void __fastcall FontBtnClick(TObject *Sender); + void __fastcall FormResize(TObject *Sender); + + + + + void __fastcall FormPaint(TObject *Sender); + +private: + int InitFlag; + LPCSTR ap; + + CAlignList AlignList; + void __fastcall EntryAlignControl(void); +public: + virtual __fastcall TTextEditDlg(TComponent* AOwner); + + int __fastcall Execute(AnsiString &as, int flag, LPCSTR pTitle = NULL); +}; +//---------------------------------------------------------------------------- +//extern TTextEditDlg *TextEditDlg; + +extern void __fastcall ShowHelp(TForm *pForm, LPCSTR pName); +//---------------------------------------------------------------------------- +#endif diff --git a/TncSet.cpp b/TncSet.cpp new file mode 100644 index 0000000..4af4794 --- /dev/null +++ b/TncSet.cpp @@ -0,0 +1,125 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "TncSet.h" +//--------------------------------------------------------------------- +#pragma resource "*.dfm" +//--------------------------------------------------------------------- +__fastcall TTNCSetDlg::TTNCSetDlg(TComponent* AOwner) + : TForm(AOwner) +{ + m_DisEvent = 1; + FormStyle = ((TForm *)AOwner)->FormStyle; + Font->Name = ((TForm *)AOwner)->Font->Name; + Font->Charset = ((TForm *)AOwner)->Font->Charset; + if( Font->Charset != SHIFTJIS_CHARSET ){ + Caption = "TNC emulation mode"; + CancelBtn->Caption = "Cancel"; + LMSG->Caption = "Note: Use a null modem cable for connecting to the other PC."; + } + SBHelp->Visible = !JanHelp.IsEmpty(); + m_MMList.QueryList("MMT"); + for( int i = 0; i < m_MMList.GetCount(); i++ ){ + PortName->Items->Insert(1, m_MMList.GetItemName(i)); + } + PortName->DropDownCount = m_MMList.GetCount() + 10; +} +//--------------------------------------------------------------------- +void __fastcall TTNCSetDlg::UpdateUI(void) +{ + m_DisEvent++; + int cf = (m_MMList.IndexOf(AnsiString(PortName->Text).c_str()) < 0); + int f; + if( TNCType->ItemIndex == 2 ){ + f = FALSE; + } + else { + f = cf; + } + for(int i = 0; i < GroupBox1->ControlCount; i++ ){ + if( (GroupBox1->Controls[i]->Name != "PortName") && + (GroupBox1->Controls[i]->Name != "L1") + ){ + GroupBox1->Controls[i]->Enabled = f; + } + } + flwXON->Enabled = f; + flwCTS->Enabled = f; + Echo->Enabled = !(TNCType->ItemIndex == 2); + LMSG->Enabled = cf; + m_DisEvent--; +} +//--------------------------------------------------------------------- +int __fastcall TTNCSetDlg::Execute(void) +{ + PortName->Text = TNC.StrPort; + Baud->Text = TNC.BaudRate; + BitLen->ItemIndex = TNC.BitLen; + Parity->ItemIndex = TNC.Parity; + Stop->ItemIndex = TNC.Stop; + flwXON->Checked = TNC.flwXON; + flwCTS->Checked = TNC.flwCTS; + + Echo->ItemIndex = TNC.Echo; + TNCType->ItemIndex = TNC.Type; + DisWindow->Checked = sys.m_DisWindow; + StayOnTop->Checked = sys.m_StayOnTop; + UpdateUI(); + m_DisEvent = 0; + if( ShowModal() == IDOK ){ + StrCopy(TNC.StrPort, AnsiString(PortName->Text).c_str(), 31); + int dd; + if( sscanf(AnsiString(Baud->Text).c_str(), "%u", &dd) == 1 ){ + TNC.BaudRate = dd; + } + TNC.BitLen = BitLen->ItemIndex; + TNC.Parity = Parity->ItemIndex; + TNC.Stop = Stop->ItemIndex; + TNC.flwXON = flwXON->Checked; + TNC.flwCTS = flwCTS->Checked; + + TNC.Echo = Echo->ItemIndex; + TNC.Type = TNCType->ItemIndex; + sys.m_DisWindow = DisWindow->Checked; + sys.m_StayOnTop = StayOnTop->Checked; + TNC.change = 1; + return TRUE; + } + else { + return FALSE; + } +} + +void __fastcall TTNCSetDlg::TNCTypeClick(TObject *Sender) +{ + if( m_DisEvent ) return; + + UpdateUI(); +} +//--------------------------------------------------------------------------- +void __fastcall TTNCSetDlg::SBHelpClick(TObject *Sender) +{ + ShowHtmlHelp("usemmttyasamodem.htm"); +} +//--------------------------------------------------------------------------- + diff --git a/TncSet.dfm b/TncSet.dfm new file mode 100644 index 0000000..fe1ad48 Binary files /dev/null and b/TncSet.dfm differ diff --git a/TncSet.h b/TncSet.h new file mode 100644 index 0000000..cf3f760 --- /dev/null +++ b/TncSet.h @@ -0,0 +1,81 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//---------------------------------------------------------------------------- +#ifndef TncSetH +#define TncSetH +//---------------------------------------------------------------------------- +/* JA7UDE 0427 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +*/ +//---------------------------------------------------------------------------- +#include "Ctnc.h" +#include +#include +#include +#include +#include +//---------------------------------------------------------------------------- +class TTNCSetDlg : public TForm +{ +__published: + TButton *OKBtn; + TButton *CancelBtn; + TGroupBox *GroupBox1; + TComboBox *PortName; + TLabel *L1; + TLabel *L2; + TComboBox *Baud; + TRadioGroup *BitLen; + TRadioGroup *Stop; + TRadioGroup *Parity; + TRadioGroup *TNCType; + TLabel *LMSG; + TGroupBox *GroupBox3; + TCheckBox *flwXON; + TCheckBox *flwCTS; + TRadioGroup *Echo; + TCheckBox *DisWindow; + TCheckBox *StayOnTop; + TSpeedButton *SBHelp; + void __fastcall TNCTypeClick(TObject *Sender); + void __fastcall SBHelpClick(TObject *Sender); + +private: + int m_DisEvent; + CMMList m_MMList; + + void __fastcall UpdateUI(void); + +public: + virtual __fastcall TTNCSetDlg(TComponent* AOwner); + int __fastcall Execute(void); +}; +//---------------------------------------------------------------------------- +//---------------------------------------------------------------------------- +#endif diff --git a/TxdDlg.cpp b/TxdDlg.cpp new file mode 100644 index 0000000..fa6fa06 --- /dev/null +++ b/TxdDlg.cpp @@ -0,0 +1,58 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "TxdDlg.h" +//--------------------------------------------------------------------- +#pragma resource "*.dfm" +//TTxdDlgBox *TxdDlgBox; +//--------------------------------------------------------------------- +__fastcall TTxdDlgBox::TTxdDlgBox(TComponent* AOwner) + : TForm(AOwner) +{ + FormStyle = ((TForm *)AOwner)->FormStyle; + Font->Name = ((TForm *)AOwner)->Font->Name; + Font->Charset = ((TForm *)AOwner)->Font->Charset; + if( Font->Charset != SHIFTJIS_CHARSET ){ + CancelBtn->Caption = "Cancel"; + LMsg->Caption = "Please try to test B, C, D, if you have a trouble in the USB-COM adaptor. (C)Limiting speed seems to be well."; + TxdJob->Caption = "Processing method"; + TxdJob->Items->Strings[0] = "A: Normal"; + TxdJob->Items->Strings[1] = "B: Polling"; + TxdJob->Items->Strings[2] = "C: Limiting speed"; + TxdJob->Items->Strings[3] = "D: Polling and Limiting speed"; + + } + else { + LMsg->Caption = "FSK‚ªUSBƒVƒŠƒAƒ‹ƒAƒ_ƒvƒ^[‚ų‚µ‚­“®ì‚µ‚È‚¢ê‡‚ÍB, C, D‚ðŽŽ‚µ‚ĉº‚³‚¢B(C)‘—M‘¬“x‚̧ŒÀ‚ª—Ç‚¢‚悤‚Å‚·."; + } +} +//--------------------------------------------------------------------- +int __fastcall TTxdDlgBox::Execute(int sel) +{ + TxdJob->ItemIndex = sel; + if( ShowModal() == IDOK ){ + sel = TxdJob->ItemIndex; + } + return sel; +} + diff --git a/TxdDlg.dfm b/TxdDlg.dfm new file mode 100644 index 0000000..ffccc80 Binary files /dev/null and b/TxdDlg.dfm differ diff --git a/TxdDlg.h b/TxdDlg.h new file mode 100644 index 0000000..155d0d4 --- /dev/null +++ b/TxdDlg.h @@ -0,0 +1,53 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//---------------------------------------------------------------------------- +#ifndef TxdDlgH +#define TxdDlgH +//---------------------------------------------------------------------------- +/* JA7UDE 0428 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +*/ +//---------------------------------------------------------------------------- +class TTxdDlgBox : public TForm +{ +__published: + TButton *OKBtn; + TButton *CancelBtn; + TRadioGroup *TxdJob; + TLabel *LMsg; +private: +public: + virtual __fastcall TTxdDlgBox(TComponent* AOwner); + + int __fastcall Execute(int sel); +}; +//---------------------------------------------------------------------------- +//extern TTxdDlgBox *TxdDlgBox; +//---------------------------------------------------------------------------- +#endif diff --git a/UserPara.ini b/UserPara.ini new file mode 100644 index 0000000..daaa4c1 --- /dev/null +++ b/UserPara.ini @@ -0,0 +1,739 @@ +[Define0] +Name=Standard RTTY +Enabled=1 +AFC=1 +AFCFixShift=1 +AFCSQ=32 +AFCTime=8.000000e+00 +AFCSweep=1.000000e+00 +UOS=1 +TxNet=1 +TxDisRev=0 +LimitDxGain=2.000000e+02 +LimitOverSampling=0 +ATC=0 +ATCTime=4 +Majority=1 +IgnoreFreamError=0 +SQ=1 +SQLevel=6.000000e+02 +DefMarkFreq=2.125000e+03 +DefShift=1.700000e+02 +DefStopLen=0 +OutputGain=2.457600e+04 +TXECHO=0 +TXBPFTAP=48 +TXLPF=0 +TXLPFFreq=1.000000e+02 +TXWaitType=0 +TXCharWait=0 +TXDiddleWait=0 +TXCharWaitDiddle=0 +TXRandomDiddle=0 +TXWaitTimerDiddle=0 +Rev=0 +ShiftFreq=1.700000e+02 +RXBPF=0 +RXBPFTAP=56 +RXBPFAFC=1 +RXBPFFW=1.000000e+02 +RXlms=0 +RXlmsDelay=0 +RXlmsMU2=3.000000e-03 +RXlmsGM=9.999000e-01 +RXlmsAGC=0 +RXlmsInv=0 +RXlmsTAP=56 +RXNotchTAP=72 +RXlmsBPF=1 +RXlmsType=1 +RXlmsNotch=2136 +RXlmsNotch2=0 +RXlmsTwoNotch=0 +DEMTYPE=0 +BaudRate=4.545000e+01 +TTYBitLen=5 +TTYStopLen=4 +TTYParity=0 +SmoozType=0 +SmoozOrder=5 +SmoozIIR=4.000000e+01 +Smooz=7.000000e+01 +Tap=72 +IIRBW=60 +pllVcoGain=3.000000e+00 +pllLoopOrder=2 +pllLoopFC=2.500000e+02 +pllOutOrder=4 +pllOutFC=2.000000e+02 +Diddle=2 +TxFixShift=0 +InvPTT=0 +TXUOS=1 +FFTTones=4 +AA6YQ.Version=2 +AA6YQ.Enabled=0 +AA6YQ.TapsBPF=512 +AA6YQ.WidthBPF=3.500000e+01 +AA6YQ.TapsBEF=256 +AA6YQ.WidthBEF=1.500000e+01 +AA6YQ.afcERR=5.000000e+00 + +[Define1] +Name=Fluttered signals +Enabled=1 +AFC=1 +AFCFixShift=1 +AFCSQ=32 +AFCTime=8.000000e+00 +AFCSweep=1.000000e+00 +UOS=1 +TxNet=1 +TxDisRev=0 +LimitDxGain=2.000000e+02 +LimitOverSampling=0 +ATC=0 +ATCTime=4 +Majority=1 +IgnoreFreamError=0 +SQ=1 +SQLevel=6.000000e+02 +DefMarkFreq=2.125000e+03 +DefShift=1.700000e+02 +DefStopLen=0 +OutputGain=2.457600e+04 +TXECHO=0 +TXBPFTAP=48 +TXLPF=0 +TXLPFFreq=1.000000e+02 +TXWaitType=0 +TXCharWait=0 +TXDiddleWait=0 +TXCharWaitDiddle=0 +TXRandomDiddle=0 +TXWaitTimerDiddle=0 +Rev=0 +ShiftFreq=1.700000e+02 +RXBPF=1 +RXBPFTAP=56 +RXBPFAFC=1 +RXBPFFW=1.000000e+02 +RXlms=0 +RXlmsDelay=0 +RXlmsMU2=3.000000e-03 +RXlmsGM=9.999000e-01 +RXlmsAGC=0 +RXlmsInv=0 +RXlmsTAP=56 +RXNotchTAP=72 +RXlmsBPF=1 +RXlmsType=1 +RXlmsNotch=2136 +RXlmsNotch2=0 +RXlmsTwoNotch=0 +DEMTYPE=0 +BaudRate=4.545000e+01 +TTYBitLen=5 +TTYStopLen=4 +TTYParity=0 +SmoozType=0 +SmoozOrder=5 +SmoozIIR=4.000000e+01 +Smooz=7.000000e+01 +Tap=72 +IIRBW=90 +pllVcoGain=3.000000e+00 +pllLoopOrder=2 +pllLoopFC=2.500000e+02 +pllOutOrder=4 +pllOutFC=2.000000e+02 +Diddle=2 +TxFixShift=0 +InvPTT=0 +TXUOS=1 +FFTTones=4 +AA6YQ.Version=2 +AA6YQ.Enabled=0 +AA6YQ.TapsBPF=512 +AA6YQ.WidthBPF=3.500000e+01 +AA6YQ.TapsBEF=256 +AA6YQ.WidthBEF=1.500000e+01 +AA6YQ.afcERR=5.000000e+00 + +[Define7] +Name=23Hz RTTY (MTTY) +Enabled=1 +AFC=1 +AFCFixShift=1 +AFCSQ=32 +AFCTime=8.000000e+00 +AFCSweep=1.000000e+00 +UOS=1 +TxNet=1 +TxDisRev=0 +LimitDxGain=2.000000e+02 +LimitOverSampling=0 +ATC=0 +ATCTime=4 +Majority=1 +IgnoreFreamError=0 +SQ=1 +SQLevel=6.000000e+02 +DefMarkFreq=2.125000e+03 +DefShift=2.300000e+01 +DefStopLen=0 +OutputGain=2.457600e+04 +TXECHO=0 +TXBPFTAP=48 +TXLPF=0 +TXLPFFreq=1.000000e+02 +TXWaitType=0 +TXCharWait=0 +TXDiddleWait=0 +TXCharWaitDiddle=0 +TXRandomDiddle=0 +TXWaitTimerDiddle=0 +Rev=0 +ShiftFreq=2.300000e+01 +RXBPF=1 +RXBPFTAP=80 +RXBPFAFC=1 +RXBPFFW=0.000000e+00 +RXlms=0 +RXlmsDelay=0 +RXlmsMU2=3.000000e-03 +RXlmsGM=9.999000e-01 +RXlmsAGC=0 +RXlmsInv=0 +RXlmsTAP=56 +RXNotchTAP=72 +RXlmsBPF=1 +RXlmsType=1 +RXlmsNotch=2210 +RXlmsNotch2=0 +RXlmsTwoNotch=0 +DEMTYPE=2 +BaudRate=4.545000e+01 +TTYBitLen=5 +TTYStopLen=3 +TTYParity=0 +SmoozType=0 +SmoozOrder=5 +SmoozIIR=4.000000e+01 +Smooz=7.000000e+01 +Tap=72 +IIRBW=20 +pllVcoGain=3.000000e+00 +pllLoopOrder=2 +pllLoopFC=4.000000e+01 +pllOutOrder=4 +pllOutFC=2.000000e+02 +Diddle=2 +TxFixShift=0 +InvPTT=0 +TXUOS=1 +FFTTones=4 +AA6YQ.Version=2 +AA6YQ.Enabled=0 +AA6YQ.TapsBPF=512 +AA6YQ.WidthBPF=3.500000e+01 +AA6YQ.TapsBEF=256 +AA6YQ.WidthBEF=1.500000e+01 +AA6YQ.afcERR=5.000000e+00 + +[Define2] +Name=Fluttered signals (FIR) +Enabled=1 +AFC=1 +AFCFixShift=1 +AFCSQ=32 +AFCTime=8.000000e+00 +AFCSweep=1.000000e+00 +UOS=1 +TxNet=1 +TxDisRev=0 +LimitDxGain=2.000000e+02 +LimitOverSampling=0 +ATC=0 +ATCTime=4 +Majority=1 +IgnoreFreamError=0 +SQ=1 +SQLevel=6.000000e+02 +DefMarkFreq=2.125000e+03 +DefShift=1.700000e+02 +DefStopLen=0 +OutputGain=2.457600e+04 +TXECHO=0 +TXBPFTAP=48 +TXLPF=0 +TXLPFFreq=1.000000e+02 +TXWaitType=0 +TXCharWait=0 +TXDiddleWait=0 +TXCharWaitDiddle=0 +TXRandomDiddle=0 +TXWaitTimerDiddle=0 +Rev=0 +ShiftFreq=1.700000e+02 +RXBPF=1 +RXBPFTAP=56 +RXBPFAFC=1 +RXBPFFW=1.000000e+02 +RXlms=0 +RXlmsDelay=0 +RXlmsMU2=3.000000e-03 +RXlmsGM=9.999000e-01 +RXlmsAGC=0 +RXlmsInv=0 +RXlmsTAP=56 +RXNotchTAP=72 +RXlmsBPF=1 +RXlmsType=1 +RXlmsNotch=2096 +RXlmsNotch2=0 +RXlmsTwoNotch=0 +DEMTYPE=1 +BaudRate=4.545000e+01 +TTYBitLen=5 +TTYStopLen=4 +TTYParity=0 +SmoozType=0 +SmoozOrder=5 +SmoozIIR=4.000000e+01 +Smooz=7.000000e+01 +Tap=72 +IIRBW=90 +pllVcoGain=3.000000e+00 +pllLoopOrder=2 +pllLoopFC=2.500000e+02 +pllOutOrder=4 +pllOutFC=2.000000e+02 +Diddle=2 +TxFixShift=0 +InvPTT=0 +TXUOS=1 +FFTTones=4 +AA6YQ.Version=2 +AA6YQ.Enabled=0 +AA6YQ.TapsBPF=512 +AA6YQ.WidthBPF=3.500000e+01 +AA6YQ.TapsBEF=256 +AA6YQ.WidthBEF=1.500000e+01 +AA6YQ.afcERR=5.000000e+00 + +[Define1025] +Name=Default +Enabled=1 +AFC=1 +AFCFixShift=1 +AFCSQ=32 +AFCTime=8.000000e+00 +AFCSweep=1.000000e+00 +UOS=0 +TxNet=1 +TxDisRev=0 +LimitDxGain=2.000000e+02 +LimitOverSampling=0 +ATC=0 +ATCTime=4 +Majority=1 +IgnoreFreamError=0 +SQ=0 +SQLevel=6.000000e+02 +DefMarkFreq=2.125000e+03 +DefShift=1.700000e+02 +DefStopLen=0 +OutputGain=2.457600e+04 +TXECHO=0 +TXBPFTAP=48 +TXLPF=0 +TXLPFFreq=1.000000e+02 +TXWaitType=0 +TXCharWait=0 +TXDiddleWait=0 +TXCharWaitDiddle=0 +TXRandomDiddle=0 +TXWaitTimerDiddle=0 +Rev=0 +ShiftFreq=1.700000e+02 +RXBPF=0 +RXBPFTAP=56 +RXBPFAFC=1 +RXBPFFW=1.000000e+02 +RXlms=0 +RXlmsDelay=0 +RXlmsMU2=3.000000e-03 +RXlmsGM=9.999000e-01 +RXlmsAGC=0 +RXlmsInv=0 +RXlmsTAP=56 +RXNotchTAP=72 +RXlmsBPF=1 +RXlmsType=1 +RXlmsNotch=2210 +RXlmsNotch2=0 +RXlmsTwoNotch=0 +DEMTYPE=0 +BaudRate=4.545000e+01 +TTYBitLen=5 +TTYStopLen=4 +TTYParity=0 +SmoozType=0 +SmoozOrder=5 +SmoozIIR=4.000000e+01 +Smooz=7.000000e+01 +Tap=72 +IIRBW=60 +pllVcoGain=3.000000e+00 +pllLoopOrder=2 +pllLoopFC=2.500000e+02 +pllOutOrder=4 +pllOutFC=2.000000e+02 +Diddle=2 +TxFixShift=0 +InvPTT=0 +TXUOS=1 +FFTTones=4 +LimitAGC=1 +TXLoop=1 +AA6YQ.Version=2 +AA6YQ.Enabled=0 +AA6YQ.TapsBPF=512 +AA6YQ.WidthBPF=3.500000e+01 +AA6YQ.TapsBEF=256 +AA6YQ.WidthBEF=1.500000e+01 +AA6YQ.afcERR=5.000000e+00 + +[Define1026] +Name=Return to the startup +Enabled=1 +AFC=0 +AFCFixShift=1 +AFCSQ=32 +AFCTime=8.000000e+00 +AFCSweep=1.000000e+00 +UOS=1 +TxNet=0 +TxDisRev=0 +LimitDxGain=2.000000e+02 +LimitOverSampling=0 +ATC=0 +ATCTime=4 +Majority=1 +IgnoreFreamError=1 +SQ=1 +SQLevel=6.000000e+02 +DefMarkFreq=2.125000e+03 +DefShift=1.700000e+02 +DefStopLen=0 +OutputGain=2.457600e+04 +TXECHO=0 +TXBPFTAP=48 +TXLPF=0 +TXLPFFreq=1.000000e+02 +TXWaitType=0 +TXCharWait=0 +TXDiddleWait=0 +TXCharWaitDiddle=0 +TXRandomDiddle=0 +TXWaitTimerDiddle=0 +Rev=0 +ShiftFreq=1.700000e+02 +RXBPF=0 +RXBPFTAP=64 +RXBPFAFC=1 +RXBPFFW=2.500000e+02 +RXlms=0 +RXlmsDelay=24 +RXlmsMU2=1.000000e-03 +RXlmsGM=9.998000e-01 +RXlmsAGC=1 +RXlmsInv=0 +RXlmsTAP=512 +RXNotchTAP=192 +RXlmsBPF=0 +RXlmsType=1 +RXlmsNotch=2210 +RXlmsNotch2=0 +RXlmsTwoNotch=0 +DEMTYPE=1 +BaudRate=4.545000e+01 +TTYBitLen=5 +TTYStopLen=3 +TTYParity=0 +SmoozType=0 +SmoozOrder=5 +SmoozIIR=4.500000e+01 +Smooz=3.000000e+02 +Tap=512 +IIRBW=60 +pllVcoGain=3.000000e+00 +pllLoopOrder=2 +pllLoopFC=2.500000e+02 +pllOutOrder=4 +pllOutFC=2.000000e+02 +Diddle=2 +TxFixShift=0 +InvPTT=0 +TXUOS=1 +FFTTones=4 +LimitAGC=1 +TXLoop=1 +AA6YQ.Version=2 +AA6YQ.Enabled=1 +AA6YQ.TapsBPF=512 +AA6YQ.WidthBPF=3.500000e+01 +AA6YQ.TapsBEF=256 +AA6YQ.WidthBEF=1.500000e+01 +AA6YQ.afcERR=5.000000e+00 + +[Define3] +Name=Multi-path +Enabled=1 +AFC=1 +AFCFixShift=1 +AFCSQ=32 +AFCTime=8.000000e+00 +AFCSweep=1.000000e+00 +UOS=1 +TxNet=1 +TxDisRev=0 +LimitDxGain=2.000000e+02 +LimitOverSampling=0 +ATC=1 +ATCTime=4 +Majority=1 +IgnoreFreamError=1 +SQ=1 +SQLevel=6.000000e+02 +DefMarkFreq=2.125000e+03 +DefShift=1.700000e+02 +DefStopLen=0 +OutputGain=2.457600e+04 +TXECHO=0 +TXBPFTAP=48 +TXLPF=0 +TXLPFFreq=1.000000e+02 +TXWaitType=0 +TXCharWait=0 +TXDiddleWait=0 +TXCharWaitDiddle=0 +TXRandomDiddle=0 +TXWaitTimerDiddle=0 +Rev=0 +ShiftFreq=1.700000e+02 +RXBPF=0 +RXBPFTAP=56 +RXBPFAFC=1 +RXBPFFW=1.000000e+02 +RXlms=0 +RXlmsDelay=0 +RXlmsMU2=3.000000e-03 +RXlmsGM=9.999000e-01 +RXlmsAGC=0 +RXlmsInv=0 +RXlmsTAP=56 +RXNotchTAP=72 +RXlmsBPF=1 +RXlmsType=1 +RXlmsNotch=2094 +RXlmsNotch2=0 +RXlmsTwoNotch=0 +DEMTYPE=0 +BaudRate=4.545000e+01 +TTYBitLen=5 +TTYStopLen=3 +TTYParity=0 +SmoozType=0 +SmoozOrder=5 +SmoozIIR=4.000000e+01 +Smooz=7.000000e+01 +Tap=72 +IIRBW=90 +pllVcoGain=3.000000e+00 +pllLoopOrder=2 +pllLoopFC=2.500000e+02 +pllOutOrder=4 +pllOutFC=2.000000e+02 +Diddle=2 +TxFixShift=0 +InvPTT=0 +TXUOS=1 +FFTTones=4 +AA6YQ.Version=2 +AA6YQ.Enabled=0 +AA6YQ.TapsBPF=512 +AA6YQ.WidthBPF=3.500000e+01 +AA6YQ.TapsBEF=256 +AA6YQ.WidthBEF=1.500000e+01 +AA6YQ.afcERR=5.000000e+00 + +[Define4] +Name=AA6YQ FIR512 +Enabled=1 +AFC=1 +AFCFixShift=1 +AFCSQ=32 +AFCTime=8.000000e+00 +AFCSweep=1.000000e+00 +UOS=1 +TxNet=0 +TxDisRev=0 +LimitDxGain=2.000000e+02 +LimitOverSampling=0 +LimitAGC=1 +ATC=0 +ATCTime=4 +Majority=1 +IgnoreFreamError=1 +SQ=1 +SQLevel=6.000000e+02 +DefMarkFreq=2.125000e+03 +DefShift=1.700000e+02 +DefStopLen=0 +OutputGain=2.457600e+04 +TXLoop=1 +TXBPFTAP=48 +TXLPF=0 +TXLPFFreq=1.000000e+02 +TXWaitType=0 +TXCharWait=0 +TXDiddleWait=0 +TXCharWaitDiddle=0 +TXRandomDiddle=0 +TXWaitTimerDiddle=0 +Rev=0 +ShiftFreq=1.700000e+02 +RXBPF=0 +RXBPFTAP=64 +RXBPFAFC=1 +RXBPFFW=2.500000e+02 +RXlms=0 +RXlmsDelay=24 +RXlmsMU2=1.000000e-03 +RXlmsGM=9.998000e-01 +RXlmsAGC=1 +RXlmsInv=0 +RXlmsTAP=512 +RXNotchTAP=192 +RXlmsBPF=0 +RXlmsType=1 +RXlmsNotch=2199 +RXlmsNotch2=0 +RXlmsTwoNotch=0 +DEMTYPE=1 +BaudRate=4.545000e+01 +TTYBitLen=5 +TTYStopLen=3 +TTYParity=0 +SmoozType=0 +SmoozOrder=5 +SmoozIIR=4.500000e+01 +Smooz=3.000000e+02 +Tap=512 +IIRBW=60 +FFTTones=4 +pllVcoGain=3.000000e+00 +pllLoopOrder=2 +pllLoopFC=2.500000e+02 +pllOutOrder=4 +pllOutFC=2.000000e+02 +Diddle=2 +TxFixShift=0 +InvPTT=0 +TXUOS=1 +AA6YQ.Version=2 +AA6YQ.Enabled=1 +AA6YQ.TapsBPF=512 +AA6YQ.WidthBPF=3.500000e+01 +AA6YQ.TapsBEF=256 +AA6YQ.WidthBEF=1.500000e+01 +AA6YQ.afcERR=5.000000e+00 + +[Define5] +Name=FFT demodulator +Enabled=1 +AFCFixShift=1 +AFCSQ=32 +AFCTime=8.000000e+00 +AFCSweep=1.000000e+00 +TxNet=1 +TxDisRev=0 +LimitDxGain=2.000000e+02 +LimitOverSampling=0 +ATC=0 +ATCTime=4 +Majority=1 +IgnoreFreamError=1 +SQLevel=6.000000e+02 +DefMarkFreq=2.125000e+03 +DefShift=1.700000e+02 +DefStopLen=0 +OutputGain=2.457600e+04 +TXECHO=0 +TXBPFTAP=48 +TXLPF=0 +TXLPFFreq=1.000000e+02 +TXWaitType=0 +TXCharWait=0 +TXDiddleWait=0 +TXCharWaitDiddle=0 +TXRandomDiddle=0 +TXWaitTimerDiddle=0 +Rev=0 +ShiftFreq=1.700000e+02 +RXBPF=1 +RXBPFTAP=64 +RXBPFAFC=1 +RXBPFFW=2.500000e+02 +RXlmsDelay=0 +RXlmsMU2=3.000000e-03 +RXlmsGM=9.999000e-01 +RXlmsAGC=0 +RXlmsInv=0 +RXlmsTAP=56 +RXlmsBPF=1 +RXlmsType=1 +RXlmsNotch=2203 +RXlmsNotch2=0 +RXlmsTwoNotch=0 +DEMTYPE=3 +BaudRate=4.545000e+01 +SmoozType=0 +SmoozOrder=5 +SmoozIIR=4.000000e+01 +Smooz=7.000000e+01 +Tap=72 +IIRBW=60 +pllVcoGain=3.000000e+00 +pllLoopOrder=2 +pllLoopFC=2.500000e+02 +pllOutOrder=4 +pllOutFC=2.000000e+02 +Diddle=2 +TxFixShift=0 +InvPTT=0 +TXUOS=1 +AFC=1 +UOS=1 +LimitAGC=1 +SQ=1 +TXLoop=1 +RXlms=0 +RXNotchTAP=72 +TTYBitLen=5 +TTYStopLen=4 +TTYParity=0 +FFTTones=4 +AA6YQ.Version=2 +AA6YQ.Enabled=0 +AA6YQ.TapsBPF=512 +AA6YQ.WidthBPF=3.500000e+01 +AA6YQ.TapsBEF=256 +AA6YQ.WidthBEF=1.500000e+01 +AA6YQ.afcERR=5.000000e+00 + +[Define6] +Enabled=0 + diff --git a/VerDsp.cpp b/VerDsp.cpp new file mode 100644 index 0000000..99a7534 --- /dev/null +++ b/VerDsp.cpp @@ -0,0 +1,67 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "VerDsp.h" +#include "ComLib.h" +//--------------------------------------------------------------------- +#pragma resource "*.dfm" +//TVerDspDlg *VerDspDlg; +//--------------------------------------------------------------------- +__fastcall TVerDspDlg::TVerDspDlg(TComponent* AOwner) + : TForm(AOwner) +{ + IconImage->Picture->Assign(Application->Icon); + FormStyle = ((TForm *)AOwner)->FormStyle; + Font->Name = ((TForm *)AOwner)->Font->Name; + Font->Charset = ((TForm *)AOwner)->Font->Charset; +// Version->Font->Name = ((TForm *)AOwner)->Font->Name; +// Version->Font->Charset = ((TForm *)AOwner)->Font->Charset; + LFree->Font->Name = ((TForm *)AOwner)->Font->Name; + LFree->Font->Charset = ((TForm *)AOwner)->Font->Charset; + if( Font->Charset != SHIFTJIS_CHARSET ){ + Caption = "Version Information"; + LFree->Caption = "Free Software"; + LTNX->Font->Size = LTNX->Font->Size - 1; + } + Version->Caption = VERTTL; + LTNX->Caption = + "------ Programming ------\r\n" + "Dave, AA6YQ (updated 1.65D -> 1.66G)\r\n" + "------ Help, FAQ and Remote mode, etc... ------\r\n" + "Jan, KX2A Ken, VE5KC Bill, KB4IJ Andy, K3UK(KB2EOQ)\r\n" + "Bill, K5YG Phil, GU0SUP, Josef, OK2WO Oba, JA7UDE\r\n" + "Bill, W7TI Ed, K4SB Eddie, W6/G0AZT Geoff, G3NPA\r\n" + "Bob, K4CY Eike, DM3ML Antonio, EA1MV Edoardo, I5PAC\r\n" + "Joe, W4TV\r\n" + "------ Japanese friends ------\r\n" + "Fumio, JA1IQV Nori, JA1WSK Oba, JA7UDE\r\n" + "Kaz, 7L1CUH Nobu, JA2BQX Hiro, JH1BIH, Isao JK1IQK\r\n" + "------ Reflector and Web sites ------\r\n" + "MMTTY User's group http://groups.yahoo.com/group/MMTTY/\r\n" + "MMTTY-Web http://mmhamsoft.amateur-radio.ca/\r\n" + "JARTS-Web http://jarts.web.fc2.com/\r\n" + "\r\nAll friends of Radio Amateurs\r\n" + "And my wife Midori, JI3IVL, for her invisible help." + ; +} +//--------------------------------------------------------------------- diff --git a/VerDsp.dfm b/VerDsp.dfm new file mode 100644 index 0000000..28d8115 Binary files /dev/null and b/VerDsp.dfm differ diff --git a/VerDsp.h b/VerDsp.h new file mode 100644 index 0000000..e9833ff --- /dev/null +++ b/VerDsp.h @@ -0,0 +1,52 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//---------------------------------------------------------------------------- +#ifndef VerDspH +#define VerDspH +//---------------------------------------------------------------------------- +//JA7UDE 0427 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//---------------------------------------------------------------------------- +class TVerDspDlg : public TForm +{ +__published: + TButton *OKBtn; + TLabel *Version; + TImage *IconImage; + TLabel *LFree; + TLabel *LTNX; + TLabel *Label1; +private: +public: + virtual __fastcall TVerDspDlg(TComponent* AOwner); +}; +//---------------------------------------------------------------------------- +//extern TVerDspDlg *VerDspDlg; +//---------------------------------------------------------------------------- +#endif diff --git a/Wave.cpp b/Wave.cpp new file mode 100644 index 0000000..d4b911b --- /dev/null +++ b/Wave.cpp @@ -0,0 +1,852 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +#include +#pragma hdrstop + +#include "Wave.h" + +//--------------------------------------------------------------------------- +// ‰Šú‰» +__fastcall CWave::CWave(void) +{ + m_Error = 0; + m_InOpen = m_OutOpen = FALSE; + m_hin = NULL; + m_hout = NULL; + m_InEvent = NULL; + m_OutEvent = NULL; + for( int i = 0; i < WAVE_FIFO_MAX; i++ ){ + m_pInBuff[i] = m_pOutBuff[i] = NULL; + } + m_pOutBase = m_pInBase = NULL; + m_InBuffSize = 1024; + m_OutBuffSize = 1024; + m_OutFirst = FALSE; + m_InFifoSize = 12; + m_OutFifoSize = 4; + m_SoundStereo = 1; + m_pDLL = NULL; + ::InitializeCriticalSection(&m_InCS); + ::InitializeCriticalSection(&m_OutCS); +} + +//--------------------------------------------------------------------------- +// I—¹ŽžŽÀsƒ‹[ƒ`ƒ“ +__fastcall CWave::~CWave() +{ + ::DeleteCriticalSection(&m_InCS); + ::DeleteCriticalSection(&m_OutCS); + if( m_pDLL ){ + delete m_pDLL; + m_pDLL = NULL; + } +} +#if 0 +//--------------------------------------------------------------------------- +// ƒTƒEƒ“ƒhƒJ[ƒh‚Ì–â‚¢‡‚킹 +BOOL __fastcall CWave::IsFormatSupported(LPWAVEFORMATEX pWFX, UINT IDDevice) +{ + return (::waveOutOpen( + NULL, // ptr can be NULL for query + IDDevice, // the device identifier + pWFX, // defines requested format + NULL, // no callback + NULL, // no instance data + WAVE_FORMAT_QUERY // query only, do not open device + ) ? FALSE : TRUE); +} +#endif +//--------------------------------------------------------------------------- +// ƒTƒEƒ“ƒhƒJ[ƒh‚Ì“ü—͂ł̃I[ƒvƒ“ +// WFX.wFormatTag = WAVE_FORMAT_PCM; +// WFX.nChannels = 1; +// WFX.wBitsPerSample = 16; +// WFX.nSamplesPerSec = 11025; +// WFX.nBlockAlign = WORD(WFX.nChannels *(WFX.wBitsPerSample/8)); +// WFX.nAvgBytesPerSec = WFX.nBlockAlign * WFX.nSamplesPerSec; +// WFX.cbSize = 0; +BOOL __fastcall CWave::InOpen(LPWAVEFORMATEX pWFX, UINT IDDevice, DWORD Size) +{ + if( m_pDLL ){ + m_InOpen = m_pDLL->InOpen(pWFX->nSamplesPerSec, Size); + if( !m_InOpen ) PumpMessages(); + return m_InOpen; + } + int i; + + if( m_InOpen ) InClose(); + m_Error = 0; + m_InWait = m_InOver = FALSE; + m_InWP = m_InRP = m_InBC = 0; + m_IWFX = *pWFX; + m_InBuffSize = Size * (m_IWFX.wBitsPerSample/8) * m_IWFX.nChannels; + m_InMemSize = sizeof(WAVEHDR) + m_InBuffSize; + if( m_InMemSize & 3 ) m_InMemSize += 4 - (m_InMemSize & 3); + m_InAllocSize = m_InMemSize * m_InFifoSize; + m_InEvent = ::CreateEvent(NULL, FALSE, FALSE, NULL); + // ƒTƒEƒ“ƒhƒJ[ƒh‚̃I[ƒvƒ“ + if( (m_Error = ::waveInOpen( &m_hin, IDDevice, pWFX, (DWORD)WaveInProc, (DWORD)this, CALLBACK_FUNCTION ) ) != MMSYSERR_NOERROR ){ + InClose(); + return FALSE; + } + // ƒoƒbƒtƒ@‚Ì€”õ + m_pInBase = new char[m_InAllocSize]; + ::VirtualLock(m_pInBase, m_InAllocSize); + memset(m_pInBase, 0, m_InAllocSize); + LPSTR p = m_pInBase; + for( i=0; i < m_InFifoSize; i++, p += m_InMemSize ){ + m_pInBuff[i] = (WAVEHDR *)p; + ((WAVEHDR *)p)->dwBufferLength = m_InBuffSize; + ((WAVEHDR *)p)->dwFlags = 0; + ((WAVEHDR *)p)->dwUser = NULL; + ((WAVEHDR *)p)->dwBytesRecorded = NULL; + ((WAVEHDR *)p)->lpData = p + sizeof(WAVEHDR); + if( (m_Error = ::waveInPrepareHeader(m_hin, (WAVEHDR *)p, sizeof(WAVEHDR)) ) != MMSYSERR_NOERROR ){ + InClose(); + return FALSE; + } + if( (m_Error = ::waveInAddBuffer(m_hin, (WAVEHDR *)p, sizeof(WAVEHDR)) ) != MMSYSERR_NOERROR ){ + InClose(); + return FALSE; + } + } + // Žæ‚肱‚݂̊JŽn + if( (m_Error = ::waveInStart(m_hin) ) != MMSYSERR_NOERROR ){ + InClose(); + return FALSE; + } + m_InOpen = TRUE; + return TRUE; +} +//--------------------------------------------------------------------------- +void __fastcall CWave::InClose() +{ + if( m_pDLL ){ + m_pDLL->InClose(); + m_InOpen = FALSE; + PumpMessages(); + return; + } + int i; + + if(NULL != m_hin){ + ::waveInReset(m_hin); + if( m_pInBase != NULL ){ + for( i=0; i < m_InFifoSize; i++ ){ + if( m_pInBuff[i] != NULL ){ + if( m_pInBuff[i]->dwFlags & WHDR_PREPARED ){ + ::waveInUnprepareHeader(m_hin, m_pInBuff[i], sizeof(WAVEHDR)); + } + } + } + } + ::waveInClose(m_hin); + m_hin = NULL; + if( m_pInBase != NULL ){ + ::VirtualUnlock(m_pInBase, m_InAllocSize); + delete[] m_pInBase; //JA7UDE 0428 + m_pInBase = NULL; + } + } + if(m_InEvent != NULL){ + ::CloseHandle(m_InEvent); + m_InEvent = NULL; + } + m_InOpen = FALSE; +} +//--------------------------------------------------------------------------- +BOOL __fastcall CWave::InRead(double* pData, int Len) +{ + if( m_pDLL ){ + return m_pDLL->InRead(pData, Len); + } + int i; + + if( !m_InOpen ){ + m_Error = 1; + return FALSE; + } + if( m_InOver ){ + m_Error = 1; + InClose(); + return FALSE; + } + + ::EnterCriticalSection(&m_InCS); + if( !m_InBC ){ // ‚Ü‚¾ƒf[ƒ^‚ª‘¶Ý‚µ‚È‚¢Žž + m_InWait++; + ::LeaveCriticalSection(&m_InCS); + // ƒoƒbƒtƒ@‚Ƀf[ƒ^‚ª—­‚Ü‚é‚܂ő҂ + if( ::WaitForSingleObject( m_InEvent, WAVE_TIMEOUT_EVENT ) != WAIT_OBJECT_0 ){ + m_Error = 1; + InClose(); + return FALSE; + } + } + else { + ::LeaveCriticalSection(&m_InCS); + } + // ƒf[ƒ^‚ð•‚“®­”“_‚ɕϊ· + LPWAVEHDR hp = m_pInBuff[m_InRP]; + if( m_IWFX.wBitsPerSample == 16 ){ // 16bits + SHORT *rp = (SHORT *)hp->lpData; + if( m_IWFX.nChannels == 2 ){ + if( m_SoundStereo == 1 ){ // Left + for( i = 0; i < Len; i++, pData++ ){ + *pData = double(*rp++); + rp++; + } + } + else { // Right + for( i = 0; i < Len; i++, pData++ ){ + rp++; + *pData = double(*rp++); + } + } + } + else { + for( i = 0; i < Len; i++, pData++ ){ + *pData = double(*rp++); + } + } + } + else { // 8bits + union { + struct { + BYTE low; + BYTE high; + }bd; + SHORT wd; + }data; + data.bd.low = 0; + BYTE *rp = (BYTE *)hp->lpData; + if( m_IWFX.nChannels == 2 ){ + if( m_SoundStereo == 1 ){ // Left + for( i = 0; i < Len; i++, pData++ ){ + data.bd.high = BYTE((*rp++) - 128); + *pData = double(data.wd); + rp++; + } + } + else { // Right + for( i = 0; i < Len; i++, pData++ ){ + rp++; + data.bd.high = BYTE((*rp++) - 128); + *pData = double(data.wd); + } + } + } + else { + for( i = 0; i < Len; i++, pData++ ){ + data.bd.high = BYTE((*rp++) - 128); + *pData = double(data.wd); + } + } + } + hp->dwBytesRecorded = NULL; + ::waveInAddBuffer(m_hin, hp, sizeof(WAVEHDR)); + m_InBC--; // ‚P–½—߂œWŠJ‚³‚ê‚é‚̂ŠCriticalSection ‚Í•s—v + m_InRP++; + if( m_InRP >= m_InFifoSize){ + m_InRP = 0; + } + return TRUE; +} +//--------------------------------------------------------------------------- +//void CALLBACK WaveProc(hWave, uMsg, dwInstance, dwParam1, dwParam2) +// +//HWAVE hWave; /* ƒEƒF[ƒuƒtƒH[ƒ€ ƒfƒoƒCƒX‚̃nƒ“ƒhƒ‹ */ +//UINT uMsg; /* ‘—‚郃bƒZ[ƒW */ +//DWORD dwInstance; /* ƒCƒ“ƒXƒ^ƒ“ƒX ƒf[ƒ^ */ +//DWORD dwParam1; /* ƒAƒvƒŠƒP[ƒVƒ‡ƒ“’è‹`‚̃pƒ‰ƒ[ƒ^ */ +//DWORD dwParam2; /* ƒAƒvƒŠƒP[ƒVƒ‡ƒ“’è‹`‚̃pƒ‰ƒ[ƒ^ */ +void CALLBACK WaveInProc(HWAVE m_hin, UINT uMsg, CWave* pWave, DWORD dwParam1, DWORD dwParam2 ) +{ + if( uMsg == MM_WIM_DATA ){ + ::EnterCriticalSection(&pWave->m_InCS); + pWave->m_InBC++; + pWave->m_InWP++; + if( pWave->m_InWP >= pWave->m_InFifoSize ) pWave->m_InWP = 0; + if( pWave->m_InBC > pWave->m_InFifoSize ) pWave->m_InOver = TRUE; + if(pWave->m_InWait){ + pWave->m_InWait--; + ::SetEvent(pWave->m_InEvent); + } + ::LeaveCriticalSection(&pWave->m_InCS); + } +} +//--------------------------------------------------------------------------- +// ƒTƒEƒ“ƒhƒJ[ƒh‚Ìo—͂ł̃I[ƒvƒ“ +// WFX.wFormatTag = WAVE_FORMAT_PCM; +// WFX.nChannels = 1; +// WFX.wBitsPerSample = 16; +// WFX.nSamplesPerSec = 11025; +// WFX.nBlockAlign = WORD(WFX.nChannels *(WFX.wBitsPerSample/8)); +// WFX.nAvgBytesPerSec = WFX.nBlockAlign * WFX.nSamplesPerSec; +// WFX.cbSize = 0; +BOOL __fastcall CWave::OutOpen(LPWAVEFORMATEX pWFX, UINT IDDevice, DWORD Size) +{ + if( m_pDLL ){ + m_OutOpen = m_pDLL->OutOpen(pWFX->nSamplesPerSec, Size); + if( !m_OutOpen ) PumpMessages(); + return m_OutOpen; + } + if( m_OutOpen ) OutAbort(); + m_Error = 0; + m_OutBCC = 0x7fffffff; + m_OutWait = FALSE; + m_OutUnder = FALSE; + m_OutWP = m_OutRP = m_OutBC = 0; + m_OWFX = *pWFX; + m_OutBuffSize = Size * (m_OWFX.wBitsPerSample/8) * m_OWFX.nChannels; + m_OutMemSize = sizeof(WAVEHDR) + m_OutBuffSize; + if( m_OutMemSize & 3 ) m_OutMemSize += 4 - (m_OutMemSize & 3); + m_OutAllocSize = m_OutMemSize * m_OutFifoSize; + m_OutEvent = ::CreateEvent(NULL, FALSE,FALSE,NULL); + if( (m_Error = ::waveOutOpen( &m_hout, IDDevice , pWFX, (DWORD)WaveOutProc, (DWORD)this, CALLBACK_FUNCTION ) ) != MMSYSERR_NOERROR ){ + OutAbort(); + return FALSE; + } + if( (m_Error = ::waveOutPause(m_hout))!= MMSYSERR_NOERROR ){ + OutAbort(); + return FALSE; + } + // ƒoƒbƒtƒ@[‚Ì€”õ + m_pOutBase = new char[m_OutAllocSize]; + ::VirtualLock(m_pOutBase, m_OutAllocSize); + memset(m_pOutBase, 0, m_OutAllocSize); + LPSTR p = m_pOutBase; + for(int i = 0; i < m_OutFifoSize; i++, p += m_OutMemSize ){ + m_pOutBuff[i] = (WAVEHDR *)p; + ((WAVEHDR *)p)->dwBufferLength = m_OutBuffSize; + ((WAVEHDR *)p)->dwFlags = 0; + ((WAVEHDR *)p)->dwUser = NULL; + ((WAVEHDR *)p)->dwLoops = NULL; + ((WAVEHDR *)p)->lpData = p + sizeof(WAVEHDR); + if( (m_Error = ::waveOutPrepareHeader(m_hout, (WAVEHDR *)p, sizeof(WAVEHDR)) ) != MMSYSERR_NOERROR ){ + OutAbort(); + return FALSE; + } + } + m_OutOpen = TRUE; + m_OutFirst = TRUE; + return TRUE; +} +#if 0 +//--------------------------------------------------------------------------- +DWORD __fastcall CWave::GetOutVolume(void) +{ + if( !m_OutOpen ){ + return 0x8000; + } + DWORD vol; + ::waveOutGetVolume(m_hout, &vol); + return vol; +} +//--------------------------------------------------------------------------- +BOOL __fastcall CWave::SetOutVolume(DWORD vol) +{ + if( !m_OutOpen ){ + return FALSE; + } + ::waveOutSetVolume(m_hout, vol); + return TRUE; +} +#endif +//--------------------------------------------------------------------------- +BOOL __fastcall CWave::OutWrite(double *pData, int Len) +{ + if( m_pDLL ){ + return m_pDLL->OutWrite(pData, Len); + } + if( !Len ) return 0; + int i; + if( !m_OutOpen ){ + m_Error = 1; + return FALSE; + } + if( m_OutUnder ){ + m_Error = 1; + OutAbort(); + return FALSE; + } + + // ‘—Mƒoƒbƒtƒ@‹ó‚«‘Ò‚¿ + EnterCriticalSection(&m_OutCS); + if( m_OutBC >= m_OutFifoSize ){ + m_OutWait++; + ::LeaveCriticalSection(&m_OutCS); + if( ::WaitForSingleObject( m_OutEvent, WAVE_TIMEOUT_EVENT ) != WAIT_OBJECT_0 ){ + m_Error = 2; + OutAbort(); + return FALSE; + } + } + else { + ::LeaveCriticalSection(&m_OutCS); + } + + // ƒf[ƒ^‚̕ϊ· + LPWAVEHDR hp = m_pOutBuff[m_OutWP]; + if(m_OWFX.wBitsPerSample == 16){ // 16bits + SHORT *wp = (SHORT *)hp->lpData; + if( m_OWFX.nChannels == 2 ){ + for( i = 0; i < Len; i++, pData++ ){ + *wp++ = (SHORT)(*pData); + *wp++ = (SHORT)(*pData); + } + } + else { + for( i = 0; i < Len; i++, pData++ ){ + *wp++ = (SHORT)(*pData); + } + } + } + else { // 8bits + BYTE *wp = (BYTE *)hp->lpData; + union { + struct { + BYTE low; + BYTE high; + }bd; + SHORT wd; + }data; + if( m_OWFX.nChannels == 2 ){ + for( i = 0; i < Len; i++, pData++ ){ + data.wd = (SHORT)((*pData) + 32768); + *wp++ = data.bd.high; + *wp++ = data.bd.high; + } + } + else { + for( i = 0; i < Len; i++, pData++ ){ + data.wd = (SHORT)((*pData) + 32768); + *wp++ = data.bd.high; + } + } + } + ::waveOutWrite(m_hout, hp, sizeof(WAVEHDR) ); + m_OutBC++; // ‚P–½—߂œWŠJ‚³‚ê‚é‚̂ŠCriticalSection ‚Í•s—v + if( m_OutFirst ){ + if( (m_OutBC >= 8) || (m_OutBC >= (m_OutFifoSize-1)) ){ + m_OutFirst = FALSE; + ::waveOutRestart( m_hout ); + } + } + m_OutWP++; + if( m_OutWP >= m_OutFifoSize){ + m_OutWP = 0; + } + return TRUE; +} +//--------------------------------------------------------------------------- +void __fastcall CWave::OutFlush() +{ + if( m_pDLL ){ + m_pDLL->OutFlush(); + return; + } + if(m_hout != NULL){ + // ƒoƒbƒtƒ@‘—M‘Ò‚¿ + while(1){ + ::EnterCriticalSection(&m_OutCS); + if( m_OutBC > 0 ){ // –¢‘—oƒf[ƒ^‚ª‘¶Ý‚·‚éê‡ + m_OutWait++; + ::LeaveCriticalSection(&m_OutCS); + if( ::WaitForSingleObject( m_OutEvent, WAVE_TIMEOUT_EVENT ) != WAIT_OBJECT_0 ){ + m_Error = 2; + break; + } + } + else { + ::LeaveCriticalSection(&m_OutCS); + break; + } + } + } +} +//--------------------------------------------------------------------------- +void __fastcall CWave::OutAbort() +{ + if( m_pDLL ){ + m_pDLL->OutAbort(); + m_OutOpen = FALSE; + PumpMessages(); + return; + } + if(m_hout != NULL){ + ::waveOutReset(m_hout); + ::Sleep(1); // for the timing + // ƒoƒbƒtƒ@‚̉ð•ú + if( m_pOutBase != NULL ){ + for(int i = 0; i < m_OutFifoSize; i++ ){ + if( m_pOutBuff[i] != NULL ){ + if( m_pOutBuff[i]->dwFlags & WHDR_PREPARED ){ + ::waveOutUnprepareHeader(m_hout, m_pOutBuff[i], sizeof(WAVEHDR)); + } + } + } + } + ::waveOutClose(m_hout); + m_hout = NULL; + if( m_pOutBase != NULL ){ + ::VirtualUnlock(m_pOutBase, m_OutAllocSize); + delete[] m_pOutBase; + m_pOutBase = NULL; + } + } + if(m_OutEvent != NULL){ + ::CloseHandle(m_OutEvent); + m_OutEvent = NULL; + } + m_OutOpen = FALSE; +} +//--------------------------------------------------------------------------- +//void CALLBACK WaveProc(hWave, uMsg, dwInstance, dwParam1, dwParam2) +// +//HWAVE hWave; /* ƒEƒF[ƒuƒtƒH[ƒ€ ƒfƒoƒCƒX‚̃nƒ“ƒhƒ‹ */ +//UINT uMsg; /* ‘—‚郃bƒZ[ƒW */ +//DWORD dwInstance; /* ƒCƒ“ƒXƒ^ƒ“ƒX ƒf[ƒ^ */ +//DWORD dwParam1; /* ƒAƒvƒŠƒP[ƒVƒ‡ƒ“’è‹`‚̃pƒ‰ƒ[ƒ^ */ +//DWORD dwParam2; /* ƒAƒvƒŠƒP[ƒVƒ‡ƒ“’è‹`‚̃pƒ‰ƒ[ƒ^ */ +void CALLBACK WaveOutProc(HWAVE m_hout, UINT uMsg, CWave* pWave, DWORD dwParam1, DWORD dwParam2 ) +{ + if( uMsg == WOM_DONE ){ + EnterCriticalSection(&pWave->m_OutCS); + pWave->m_OutBCC--; + pWave->m_OutBC--; + pWave->m_OutRP++; + if( pWave->m_OutRP >= pWave->m_OutFifoSize) pWave->m_OutRP = 0; + if( !pWave->m_OutBC ) pWave->m_OutUnder = TRUE; + if(pWave->m_OutWait){ + pWave->m_OutWait--; + SetEvent(pWave->m_OutEvent); + } + LeaveCriticalSection(&pWave->m_OutCS); + } +} + +//--------------------------------------------------------------------------- +int __fastcall CWave::GetInBC(void) +{ + if( m_pDLL ){ + return m_pDLL->GetInBC(); + } + else { + return m_InBC; + } +} +//--------------------------------------------------------------------------- +int __fastcall CWave::GetOutBC(void) +{ + if( m_pDLL ){ + return m_pDLL->GetOutBC(); + } + else { + return m_OutBC; + } +} +//--------------------------------------------------------------------------- +int __fastcall CWave::GetOutBCC(void) +{ + if( m_pDLL ){ + return m_pDLL->GetOutBCC(); + } + else { + return m_OutBCC; + } +} +//--------------------------------------------------------------------------- +void __fastcall CWave::SetOutBCC(int count) +{ + if( m_pDLL ){ + m_pDLL->SetOutBCC(count); + } + else { + m_OutBCC = count; + } +} +//--------------------------------------------------------------------------- +int __fastcall CWave::IsInBufCritical(void) +{ + if( m_pDLL ){ + return m_pDLL->IsInBufCritical(); + } + else { + return ( m_InBC >= (m_InFifoSize/2) ) ? 1 : 0; + } +} +//--------------------------------------------------------------------------- +int __fastcall CWave::IsOutBufCritical(void) +{ + if( m_pDLL ){ + return m_pDLL->IsOutBufCritical(); + } + else { + return (m_OutBC <= (m_OutFifoSize/2)) ? 1 : 0; + } +} +//--------------------------------------------------------------------------- +int __fastcall CWave::IsOutBufFull(void) +{ + if( m_pDLL ){ + return m_pDLL->IsOutBufFull(); + } + else { + return (m_OutBC >= m_OutFifoSize) ? 1 : 0; + } +} +//--------------------------------------------------------------------------- +void __fastcall CWave::SetPTT(LONG tx) +{ + if( m_pDLL ) m_pDLL->SetPTT(tx); +} +//--------------------------------------------------------------------------- +int __fastcall CWave::GetTimeout(void) +{ + if( m_pDLL ){ + return m_pDLL->GetTimeout(); + } + else { + return 5000; + } +} +//--------------------------------------------------------------------------- +void __fastcall CWave::UpdateDevice(int ID) +{ + if( ID == -2 ){ + if( (m_pDLL == NULL) || m_pDLL->IsNameChange() ){ + if( m_pDLL ) delete m_pDLL; + m_pDLL = new CXWave(sys.m_SoundMMW.c_str()); + } + } + else if( m_pDLL != NULL ){ + delete m_pDLL; + m_pDLL = NULL; + } +} +//--------------------------------------------------------------------------- +void __fastcall CWave::PumpMessages(void) +{ + if( m_pDLL ){ + m_pDLL->PumpMessages(); + } +} + + + +//*************************************************************************** +// CXWave class +//--------------------------------------------------------------------------- +__fastcall CXWave::CXWave(LPCSTR pName) +{ + m_ItemName = pName; + + char Name[MAX_PATH]; + if( !*GetEXT(pName) ){ + wsprintf(Name, "%s.mmw", pName); + pName = Name; + } + + m_hLib = ::LoadLibrary(pName); + if( m_hLib ){ + + fmmwPumpMessages = PROC(mmwPumpMessages); + fmmwSetPTT = PROC(mmwSetPTT); + fmmwGetTimeout = PROC(mmwGetTimeout); + + fmmwInOpen = PROC(mmwInOpen); + fmmwInClose = PROC(mmwInClose); + fmmwInRead = PROC(mmwInRead); + + fmmwGetInExist = PROC(mmwGetInExist); + fmmwIsInCritical = PROC(mmwIsInCritical); + + fmmwOutOpen = PROC(mmwOutOpen); + fmmwOutAbort = PROC(mmwOutAbort); + fmmwOutFlush = PROC(mmwOutFlush); + fmmwOutWrite = PROC(mmwOutWrite); + + fmmwIsOutCritical = PROC(mmwIsOutCritical); + fmmwIsOutFull = PROC(mmwIsOutFull); + fmmwGetOutRemaining = PROC(mmwGetOutRemaining); + fmmwGetOutCounter = PROC(mmwGetOutCounter); + fmmwSetOutCounter = PROC(mmwSetOutCounter); + + + if( !m_hLib ){ + FreeLib(); + } + } +} +//--------------------------------------------------------------------------- +__fastcall CXWave::~CXWave(void) +{ + if( m_hLib ){ + fmmwOutAbort(); + fmmwInClose(); + } + FreeLib(); +} +//--------------------------------------------------------------------------- +FARPROC __fastcall CXWave::GetProc(LPCSTR pName) +{ + if( !m_hLib ) return NULL; + + FARPROC fn = ::GetProcAddress(m_hLib, pName+1); + if( fn == NULL ){ + fn = ::GetProcAddress(m_hLib, pName); + if( fn == NULL ) FreeLib(); + } + return fn; +} +//--------------------------------------------------------------------------- +void __fastcall CXWave::FreeLib(void) +{ + if( m_hLib ){ + FreeLibrary(m_hLib); + m_hLib = NULL; + } +} +//--------------------------------------------------------------------------- +BOOL __fastcall CXWave::IsNameChange(void) +{ + return strcmpi(m_ItemName.c_str(), sys.m_SoundMMW.c_str()); +} +//--------------------------------------------------------------------------- +void __fastcall CXWave::PumpMessages(void) +{ + if( !IsLib() ) return; + + fmmwPumpMessages(); +} +//--------------------------------------------------------------------------- +BOOL __fastcall CXWave::InOpen(int sampfreq, int size) +{ + if( !IsLib() ) return FALSE; + + return fmmwInOpen(sampfreq, size); +} +//--------------------------------------------------------------------------- +void __fastcall CXWave::InClose(void) +{ + if( !IsLib() ) return; + + fmmwInClose(); +} +//--------------------------------------------------------------------------- +BOOL __fastcall CXWave::InRead(double *p, int len) +{ + if( !IsLib() ) return FALSE; + + int r = fmmwInRead(m_InBuff); + if( r ){ + SHORT *s = m_InBuff; + for( int i = 0; i < len; i++ ){ + *p++ = *s++; + } + } + return r; +} +//--------------------------------------------------------------------------- +int __fastcall CXWave::GetInBC(void) +{ + if( !IsLib() ) return 0; + return fmmwGetInExist(); +} +//--------------------------------------------------------------------------- +int __fastcall CXWave::IsInBufCritical(void) +{ + if( !IsLib() ) return 0; + return fmmwIsInCritical(); +} +//--------------------------------------------------------------------------- +BOOL __fastcall CXWave::OutOpen(int sampfreq, int size) +{ + if( !IsLib() ) return FALSE; + return fmmwOutOpen(sampfreq, size); +} +//--------------------------------------------------------------------------- +void __fastcall CXWave::OutFlush(void) +{ + if( !IsLib() ) return; + fmmwOutFlush(); +} +//--------------------------------------------------------------------------- +void __fastcall CXWave::OutAbort(void) +{ + if( !IsLib() ) return; + fmmwOutAbort(); +} +//--------------------------------------------------------------------------- +BOOL __fastcall CXWave::OutWrite(double *p, int len) +{ + if( !IsLib() ) return FALSE; + SHORT *t = m_OutBuff; + for( int i = 0; i < len; i++ ){ + *t++ = *p++; + } + return fmmwOutWrite(m_OutBuff); +} +//--------------------------------------------------------------------------- +int __fastcall CXWave::GetOutBC(void) +{ + if( !IsLib() ) return 0; + return fmmwGetOutRemaining(); +} +//--------------------------------------------------------------------------- +int __fastcall CXWave::GetOutBCC(void) +{ + if( !IsLib() ) return 0; + return fmmwGetOutCounter(); +} +//--------------------------------------------------------------------------- +void __fastcall CXWave::SetOutBCC(int count) +{ + if( !IsLib() ) return; + fmmwSetOutCounter(count); +} +//--------------------------------------------------------------------------- +int __fastcall CXWave::IsOutBufCritical(void) +{ + if( !IsLib() ) return 0; + return fmmwIsOutCritical(); +} +//--------------------------------------------------------------------------- +int __fastcall CXWave::IsOutBufFull(void) +{ + if( !IsLib() ) return 0; + return fmmwIsOutFull(); +} +//--------------------------------------------------------------------------- +void __fastcall CXWave::SetPTT(int tx) +{ + if( !IsLib() ) return; + fmmwSetPTT(tx); +} +//--------------------------------------------------------------------------- +int __fastcall CXWave::GetTimeout(void) +{ + if( !IsLib() ) return 200; + return fmmwGetTimeout(); +} +//--------------------------------------------------------------------------- + + diff --git a/Wave.h b/Wave.h new file mode 100644 index 0000000..488f3b4 --- /dev/null +++ b/Wave.h @@ -0,0 +1,191 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +#ifndef WAVE_H +#define WAVE_H +//--------------------------------------------------------------------------- +#include +#include "mmw.h" +#include "ComLib.h" +//--------------------------------------------------------------------------- +#ifndef PROC +#define PROC(Key) ((t##Key)GetProc("_" #Key)) +#endif +//--------------------------------------------------------------------------- +class CXWave +{ +private: + AnsiString m_ItemName; + //HANDLE m_hLib; + HINSTANCE m_hLib; //ja7ude 0522 + + SHORT m_InBuff[8192]; + SHORT m_OutBuff[8192]; + + tmmwPumpMessages fmmwPumpMessages; + tmmwGetTimeout fmmwGetTimeout; + tmmwSetPTT fmmwSetPTT; + + tmmwInOpen fmmwInOpen; + tmmwInClose fmmwInClose; + tmmwInRead fmmwInRead; + + tmmwGetInExist fmmwGetInExist; + tmmwIsInCritical fmmwIsInCritical; + + tmmwOutOpen fmmwOutOpen; + tmmwOutAbort fmmwOutAbort; + tmmwOutFlush fmmwOutFlush; + tmmwOutWrite fmmwOutWrite; + + tmmwIsOutCritical fmmwIsOutCritical; + tmmwIsOutFull fmmwIsOutFull; + tmmwGetOutRemaining fmmwGetOutRemaining; + tmmwGetOutCounter fmmwGetOutCounter; + tmmwSetOutCounter fmmwSetOutCounter; + +private: + FARPROC __fastcall GetProc(LPCSTR pName); + void __fastcall FreeLib(void); + +public: + __fastcall CXWave(LPCSTR pName); + __fastcall ~CXWave(void); + inline BOOL __fastcall IsLib(void){return m_hLib != NULL;}; + BOOL __fastcall IsNameChange(void); +public: + BOOL __fastcall InOpen(int sampfreq, int size); + void __fastcall InClose(void); + BOOL __fastcall InRead(double *p, int len); + + int __fastcall GetInBC(void); + int __fastcall IsInBufCritical(void); + + BOOL __fastcall OutOpen(int sampfreq, int size); + void __fastcall OutFlush(void); + void __fastcall OutAbort(void); + BOOL __fastcall OutWrite(double *p, int len); +// inline void __fastcall OutClose(void){OutFlush(); OutAbort();}; + + int __fastcall GetOutBC(void); + int __fastcall GetOutBCC(void); + void __fastcall SetOutBCC(int count); + int __fastcall IsOutBufCritical(void); + int __fastcall IsOutBufFull(void); + + void __fastcall SetPTT(int tx); + int __fastcall GetTimeout(void); + void __fastcall PumpMessages(void); +}; +//--------------------------------------------------------------------------- +#define WAVE_TIMEOUT_EVENT 2000 // ƒoƒbƒtƒ@ƒŠƒNƒGƒXƒg‚̃^ƒCƒ€ƒAƒEƒg +#define WAVE_FIFO_MAX 32 // zŠÂƒoƒbƒtƒ@‚ÌÅ‘åŒÂ” +//--------------------------------------------------------------------------- +class CWave +{ + friend void CALLBACK WaveInProc(HWAVE m_hin, UINT uMsg, CWave* pWave, DWORD dwParam1, DWORD dwParam2 ); + friend void CALLBACK WaveOutProc(HWAVE m_hout, UINT uMsg, CWave* pWave, DWORD dwParam1, DWORD dwParam2 ); + +public: + int m_InFifoSize; + int m_OutFifoSize; + int m_SoundStereo; + +private: + LPWAVEHDR m_pInBuff[WAVE_FIFO_MAX]; // “ü—̓oƒbƒtƒ@ + LPWAVEHDR m_pOutBuff[WAVE_FIFO_MAX]; // o—̓oƒbƒtƒ@ + WAVEFORMATEX m_OWFX; // o—̓tƒH[ƒ}ƒbƒg + WAVEFORMATEX m_IWFX; // “ü—̓tƒH[ƒ}ƒbƒg + + CRITICAL_SECTION m_InCS; + CRITICAL_SECTION m_OutCS; + + HANDLE m_InEvent; + HANDLE m_OutEvent; + BOOL m_InWait; + BOOL m_InOver; + BOOL m_OutWait; + BOOL m_OutUnder; + + int m_InWP; + int m_InRP; + + int m_OutWP; + int m_OutRP; + + int m_Error; + BOOL m_InOpen; + BOOL m_OutOpen; + + LPSTR m_pInBase; + LPSTR m_pOutBase; + int m_InBuffSize; + int m_InMemSize; + int m_InAllocSize; + int m_OutBuffSize; + int m_OutMemSize; + int m_OutAllocSize; + BOOL m_OutFirst; + //HWAVE m_hin; + //HWAVE m_hout; + HWAVEIN m_hin; //ja7ude 0522 + HWAVEOUT m_hout; + + volatile int m_InBC; + volatile int m_OutBC; + volatile int m_OutBCC; + + CXWave *m_pDLL; +public: + __fastcall CWave(void); + __fastcall ~CWave(); +// BOOL __fastcall IsFormatSupported(LPWAVEFORMATEX pWFX, UINT IDDevice); + BOOL __fastcall InOpen(LPWAVEFORMATEX pWFX, UINT IDDevice, DWORD Size); + inline __fastcall BOOL IsInOpen(){return m_InOpen;}; + BOOL __fastcall InRead(double *pData, int Len); + void __fastcall InClose(); + BOOL __fastcall OutOpen(LPWAVEFORMATEX pWFX, UINT IDDevice, DWORD Size); + inline __fastcall BOOL IsOutOpen(){return m_OutOpen;}; + BOOL __fastcall OutWrite( double *pData, int Len); + void __fastcall OutFlush(); + void __fastcall OutAbort(); + void __fastcall OutClose(){OutFlush();OutAbort();}; +// DWORD __fastcall GetOutVolume(void); +// BOOL __fastcall SetOutVolume(DWORD vol); + + int __fastcall GetInBC(void); + int __fastcall GetOutBC(void); + int __fastcall GetOutBCC(void); + void __fastcall SetOutBCC(int count); + + inline int __fastcall IsInBufNull(void){return !GetInBC();}; + int __fastcall IsInBufCritical(void); + int __fastcall IsOutBufCritical(void); + int __fastcall IsOutBufFull(void); + + void __fastcall SetPTT(LONG tx); + int __fastcall GetTimeout(void); + void __fastcall UpdateDevice(int ID); + void __fastcall PumpMessages(void); + + +}; +//--------------------------------------------------------------------------- +#endif + diff --git a/_BAK.MDT b/_BAK.MDT new file mode 100644 index 0000000..e8d15f3 Binary files /dev/null and b/_BAK.MDT differ diff --git a/aa6yq.pro b/aa6yq.pro new file mode 100644 index 0000000..8b71e78 --- /dev/null +++ b/aa6yq.pro @@ -0,0 +1,82 @@ +[Define1024] +Name=JE3HHT +Enabled=1 +AFC=1 +AFCFixShift=1 +AFCSQ=32 +AFCTime=8.000000e+00 +AFCSweep=1.000000e+00 +UOS=1 +TxNet=0 +TxDisRev=0 +LimitDxGain=2.000000e+02 +LimitOverSampling=0 +LimitAGC=1 +ATC=0 +ATCTime=4 +Majority=1 +IgnoreFreamError=1 +SQ=1 +SQLevel=6.000000e+02 +DefMarkFreq=2.125000e+03 +DefShift=1.700000e+02 +DefStopLen=0 +OutputGain=2.457600e+04 +TXLoop=1 +TXBPFTAP=48 +TXLPF=0 +TXLPFFreq=1.000000e+02 +TXWaitType=0 +TXCharWait=0 +TXDiddleWait=0 +TXCharWaitDiddle=0 +TXRandomDiddle=0 +TXWaitTimerDiddle=0 +Rev=0 +ShiftFreq=1.700000e+02 +RXBPF=0 +RXBPFTAP=64 +RXBPFAFC=1 +RXBPFFW=2.500000e+02 +RXlms=0 +RXlmsDelay=24 +RXlmsMU2=1.000000e-03 +RXlmsGM=9.998000e-01 +RXlmsAGC=1 +RXlmsInv=0 +RXlmsTAP=512 +RXNotchTAP=192 +RXlmsBPF=0 +RXlmsType=1 +RXlmsNotch=2199 +RXlmsNotch2=0 +RXlmsTwoNotch=0 +DEMTYPE=1 +BaudRate=4.545000e+01 +TTYBitLen=5 +TTYStopLen=3 +TTYParity=0 +SmoozType=0 +SmoozOrder=5 +SmoozIIR=4.500000e+01 +Smooz=3.000000e+02 +Tap=512 +IIRBW=60 +FFTTones=4 +pllVcoGain=3.000000e+00 +pllLoopOrder=2 +pllLoopFC=2.500000e+02 +pllOutOrder=4 +pllOutFC=2.000000e+02 +Diddle=2 +TxFixShift=0 +InvPTT=0 +TXUOS=1 +AA6YQ.Version=2 +AA6YQ.Enabled=1 +AA6YQ.TapsBPF=512 +AA6YQ.WidthBPF=3.500000e+01 +AA6YQ.TapsBEF=256 +AA6YQ.WidthBEF=1.500000e+01 +AA6YQ.afcERR=5.000000e+00 + diff --git a/country.cpp b/country.cpp new file mode 100644 index 0000000..c6880f8 --- /dev/null +++ b/country.cpp @@ -0,0 +1,350 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +/************************************************************************ + ƒJƒ“ƒgƒŠŽ¯•ʈ—ƒ‚ƒWƒ…[ƒ‹ + + Copyright (C) JE3HHT 1993-2000. +************************************************************************/ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "ComLib.h" +#include "Country.h" +#include "string.h" +#include "stdlib.h" + +CCountry Cty; +/*#$% +======================================================== + •¶Žš—ñ‚©‚çŽw’è‚Ì•¶Žš‚ðƒNƒŠƒbƒv‚·‚é +-------------------------------------------------------- + s : •¶Žš—ñ‚̃|ƒCƒ“ƒ^ +-------------------------------------------------------- +-------------------------------------------------------- +======================================================== +*/ +static char *_delchr(char *s, char c) +{ + char *p; + + for( p = s; *p; p++ ){ + if( *p == c ){ + strcpy(p, p+1); + p--; + } + } + return(s); +} + +/*#$% +====================================================== + ˆÙ‚È‚é•¶Žš—ñ‚̃|ƒCƒ“ƒ^‚ð•Ô‚· +------------------------------------------------------ + n : ”͈͔‚ÌŠi”[ˆÊ’u‚̃|ƒCƒ“ƒ^ + t : ƒvƒŠƒtƒBƒbƒNƒX‚̃|ƒCƒ“ƒ^ + p : ƒvƒŠƒtƒBƒbƒNƒX‚̃|ƒCƒ“ƒ^ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +static LPSTR lcmpp(int *n, LPSTR s, LPSTR p) +{ + LPSTR t; + + for( t = s; *p && *t; p++, t++ ){ + if( *p != *t ){ + *n = (*p - *t) + 1; + if( *n > 26 ) *n = 26; + return(t); + } + } + *n = 0; + return(s); +} + +/*#$% +====================================================== + •¶Žš—ñ‚Ì”äŠr‚ðs‚¤ +------------------------------------------------------ + t : ‘ÎÛ•¶Žš—ñ + s : Šî€•¶Žš—ñ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +static int strcmpv(LPCSTR t, LPCSTR s) +{ + for( ; *s; s++, t++ ){ + if( *t != *s ) return(1); + } + return(0); +} + +static int svf; /* Š®‘Sˆê’vƒtƒ‰ƒO */ +/*#$% +================================================================ + ƒvƒŠƒtƒBƒbƒNƒXŒŸõ—p•¶Žš—ñ”äŠr +---------------------------------------------------------------- +---------------------------------------------------------------- +---------------------------------------------------------------- +================================================================ +*/ +static int _strcmp(LPCSTR t, LPCSTR v) +{ +/* printf( "<%s>-<%s>\n", v, t ); */ + for( ; *v; v++, t++ ){ + if( *v == '*' ){ + for( v++; *t && strcmpv(t, v); t++ ); + if( !*t ) return(1); + } + else if( *v == '\\' ){ + if( *t ) return(1); + } + else if( (*v!='?') && (*v != *t) ){ + return(1); + } + } + if( svf && *t ) return(1); + return(0); +} + +/*#$% +====================================================== + ƒRƒ“ƒXƒgƒ‰ƒNƒ^[ +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +CCountry::CCountry() +{ + Init(); +} + +CCountry::~CCountry(void) +{ + Free(); +} + +/*#$% +====================================================== + ‚c‚w‚b‚b’è‹`—̈æ‚ðŠJ•ú‚·‚é +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +void CCountry::Init(void) +{ + cmax = 0; + memset(ctl, 0, sizeof(ctl)); +} + +/*#$% +====================================================== + ‚c‚w‚b‚b’è‹`—̈æ‚ðŠJ•ú‚·‚é +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +void CCountry::Free(void) +{ + int i; + CTL *cp; + for( cp = ctl, i = 0; i < cmax; i++, cp++ ){ + if( cp->Name != NULL ) delete[] cp->Name; + if( cp->Code != NULL ) delete[] cp->Code; + if( cp->QTH != NULL ) delete[] cp->QTH; + if( cp->Cont != NULL ) delete[] cp->Cont; + if( cp->TD != NULL ) delete[] cp->TD; + } + Init(); +} + + +/*#$% +====================================================== + ƒvƒŠƒtƒBƒbƒNƒX‚©‚çƒJƒ“ƒgƒŠƒR[ƒh‚𓾂é +------------------------------------------------------ + p : ƒvƒŠƒtƒBƒbƒNƒX‚̃|ƒCƒ“ƒ^ +------------------------------------------------------ + ƒJƒ“ƒgƒŠƒR[ƒh +------------------------------------------------------ +====================================================== +*/ +int CCountry::GetNo(LPCSTR s) +{ + LPSTR p, pb, t, pp; + int i; + int j; + + if( !*s ) return(0); + for( i = 0; i < cmax; i++ ){ + strcpy(wbf, ctl[i].Code); + for( p = wbf; *p; ){ + p = StrDlm(pb, p, ','); + if( (t = strchr(pb, '-')) != NULL ){ + *t = 0; + t++; + if( (*pb == *s) || (*pb != *t) ){ + for( pp = lcmpp(&j, pb, t); j; (*pp)++, j-- ){ + if( !_strcmp(s, pb) ) return(i+1); + } + } + } + else { + if( !_strcmp(s, pb) ) return(i+1); + } + } + } + return(0); +} + +/*#$% +====================================================== + ƒR[ƒ‹ƒTƒCƒ“‚©‚çƒ|ƒCƒ“ƒ^‚𓾂é +------------------------------------------------------ + p : ƒR[ƒ‹ƒTƒCƒ“‚̃|ƒCƒ“ƒ^ +------------------------------------------------------ + ƒ|ƒCƒ“ƒ^ +------------------------------------------------------ +====================================================== +*/ +int CCountry::GetNoP(LPCSTR p) +{ + int n; + + svf = 1; + if( (n = GetNo(p))!=0 ) return(n); + svf = 0; + if( (n = GetNo(p))!=0 ) return(n); + return(0); +} + +/*#$% +====================================================== + ƒR[ƒ‹ƒTƒCƒ“‚©‚çƒJƒ“ƒgƒŠ–¼‚𓾂é +------------------------------------------------------ + p : ƒR[ƒ‹ƒTƒCƒ“‚̃|ƒCƒ“ƒ^ +------------------------------------------------------ + ƒJƒ“ƒgƒŠ–¼‚̃|ƒCƒ“ƒ^ +------------------------------------------------------ +====================================================== +*/ +LPCSTR CCountry::GetCountry(LPCSTR p) +{ + if( !cmax ) return ""; + int n; + + if( !(*p) ) return("?"); + if( ((n = GetNoP(p))!=0) && (ctl[n-1].Name != NULL) ){ + strcpy(wbf, ctl[n-1].Name); + return(wbf); + } + else { + return("?"); + } +} + +/*#$% +====================================================== + ƒR[ƒ‹ƒTƒCƒ“‚©‚ç‘å—¤–¼‚𓾂é +------------------------------------------------------ + p : ƒR[ƒ‹ƒTƒCƒ“‚̃|ƒCƒ“ƒ^ +------------------------------------------------------ + ƒJƒ“ƒgƒŠ–¼‚̃|ƒCƒ“ƒ^ +------------------------------------------------------ +====================================================== +*/ +LPCSTR CCountry::GetCont(LPCSTR p) +{ + if( !cmax ) return ""; + int n; + + if( !(*p) ) return("?"); + if( ((n = GetNoP(p))!=0) && (ctl[n-1].Cont != NULL) ){ + strcpy(wbf, ctl[n-1].Cont); + return(wbf); + } + else { + return("?"); + } +} + +/*#$% +====================================================== + ‚c‚w‚b‚b’è‹`ƒtƒ@ƒCƒ‹‚ð“ǂݞ‚Þ +------------------------------------------------------ + fm : ƒtƒ@ƒCƒ‹–¼‚̃|ƒCƒ“ƒ^ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +void CCountry::Load(LPCSTR fm) +{ + FILE *fp; + LPCSTR p; + char hbf[512]; + + Free(); + if( (fp = fopen(fm, "rt"))!=NULL ){ + while( !feof(fp) ){ + if( fgets(hbf, 512, fp)!=NULL ){ + if( hbf[0] == '$' ) break; + ClipLF(hbf); + _delchr(hbf, TAB); + if( hbf[0] != '!' ){ + p = StrDlmCpy(wbf, hbf, ';', 512); + clipsp(wbf); + ctl[cmax].Name = StrDupe(wbf); + if( p != NULL ){ + p = StrDlmCpy(wbf, p, ';', 512); + clipsp(wbf); + ctl[cmax].Code = StrDupe(wbf); + } + if( p != NULL ){ + p = StrDlmCpy(wbf, p, ';', 512); + clipsp(wbf); + ctl[cmax].QTH = StrDupe(wbf); + } + if( p != NULL ){ + p = StrDlmCpy(wbf, p, ';', 512); + clipsp(wbf); + ctl[cmax].Cont = StrDupe(wbf); + } + if( p != NULL ){ + StrDlmCpy(wbf, p, ';', 512); + clipsp(wbf); + ctl[cmax].TD = StrDupe(wbf); + } + cmax++; + if( cmax >= CTMAX ) break; + } + } + } + fclose(fp); + } + else { + WarningMB((sys.m_WinFontCharset != SHIFTJIS_CHARSET ) ? "'ARRL.DX' was not found.\r\n\r\nYou cannot use a DXCC function.\r\nThis is not a problem if you do not need it":"'ARRL.DX'‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ.\r\n\r\nDXƒGƒ“ƒeƒBƒeƒB‚ÌŽ©“®”»’è‹@”\‚ÍŽg—p‚Å‚«‚Ü‚¹‚ñ."); + } +} + diff --git a/country.h b/country.h new file mode 100644 index 0000000..0d90430 --- /dev/null +++ b/country.h @@ -0,0 +1,60 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +#ifndef CountryH +#define CountryH + +extern LPSTR StrDupe(LPCSTR s); + +#define CTMAX 512 +typedef struct { + LPSTR Name; + LPSTR Code; + LPSTR QTH; + LPSTR Cont; + LPSTR TD; +}CTL; + +class CCountry +{ +private: + int cmax; + CTL ctl[CTMAX]; + + char wbf[512]; +public: + CCountry(); + ~CCountry(void); + + inline CTL *GetCTL(int n){ return &ctl[n];}; + void Init(void); + void Free(void); + int GetNo(LPCSTR s); + int GetNoP(LPCSTR p); + LPCSTR GetCountry(LPCSTR p); + LPCSTR GetCont(LPCSTR p); + void Load(LPCSTR fm); + inline int IsData(void){ + return cmax; + }; +}; + +extern CCountry Cty; +#endif + diff --git a/cradio.cpp b/cradio.cpp new file mode 100644 index 0000000..0a4dc31 --- /dev/null +++ b/cradio.cpp @@ -0,0 +1,1074 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba, Dave Bernstein +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "Cradio.h" +#include "ComLib.h" + +#define WAITSTAT 0 + +CRADIOPARA RADIO; +void InitRADIOPara(void) +{ + RADIO.change = 1; + strcpy(RADIO.StrPort, "NONE"); // ƒ|[ƒg‚Ì–¼‘O + RADIO.BaudRate = 4800; // ƒ{[ƒŒ[ƒg + RADIO.BitLen = 1; // 0-7Bit, 1-8Bit + RADIO.Stop = 1; // 0-1Bit, 1-2Bit + RADIO.Parity = 0; // 0-PN, 1-PE, 2-PO + RADIO.flwXON = 0; // Xon/Xoff ON + RADIO.flwCTS = 0; // CTS-RTS ON + RADIO.usePTT = 0; + RADIO.Cmdxx = 0; + RADIO.CmdInit = ""; + RADIO.CmdRx = "\\$000000000F"; + RADIO.CmdTx = "\\$000000010F\\w10"; + RADIO.ByteWait = 0; + RADIO.cmdGNR = ""; + RADIO.openGNR = 0; + + RADIO.PollType = 0; + RADIO.PollInterval = 5; + RADIO.PollOffset = 0; + RADIO.PollScan = 0; +} + +void LoadRADIOSetup(TMemIniFile *pIniFile) +{ + AnsiString as = RADIO.StrPort; + as = pIniFile->ReadString("RADIO", "PortName", as); + StrCopy(RADIO.StrPort, as.c_str(), 31); + RADIO.BaudRate = pIniFile->ReadInteger("RADIO", "BaudRate", RADIO.BaudRate); + RADIO.BitLen = pIniFile->ReadInteger("RADIO", "BitLen", RADIO.BitLen); + RADIO.Stop = pIniFile->ReadInteger("RADIO", "Stop", RADIO.Stop); + RADIO.Parity = pIniFile->ReadInteger("RADIO", "Parity", RADIO.Parity); + RADIO.flwXON = pIniFile->ReadInteger("RADIO", "flwXON", RADIO.flwXON); + RADIO.flwCTS = pIniFile->ReadInteger("RADIO", "flwCTS", RADIO.flwCTS); + RADIO.usePTT = pIniFile->ReadInteger("RADIO", "usePTT", RADIO.usePTT); + + RADIO.ByteWait = pIniFile->ReadInteger("RADIO", "ByteWait", RADIO.ByteWait); + + RADIO.Cmdxx = pIniFile->ReadInteger("RADIO", "Cmdxx", RADIO.Cmdxx); + RADIO.CmdInit = pIniFile->ReadString("RADIO", "CmdInit", RADIO.CmdInit); + RADIO.CmdRx = pIniFile->ReadString("RADIO", "CmdRx", RADIO.CmdRx); + RADIO.CmdTx = pIniFile->ReadString("RADIO", "CmdTx", RADIO.CmdTx); + + RADIO.cmdGNR = pIniFile->ReadString("RADIO", "FileGNR", RADIO.cmdGNR); + RADIO.openGNR = pIniFile->ReadInteger("RADIO", "OpenGNR", RADIO.openGNR); + + RADIO.PollType = pIniFile->ReadInteger("RADIO", "PollType", RADIO.PollType); + RADIO.PollInterval = pIniFile->ReadInteger("RADIO", "PollInterval", RADIO.PollInterval); + RADIO.PollOffset = pIniFile->ReadInteger("RADIO", "PollOffset", RADIO.PollOffset); +} +void SaveRADIOSetup(TMemIniFile *pIniFile) +{ + pIniFile->WriteString("RADIO", "PortName", RADIO.StrPort); + pIniFile->WriteInteger("RADIO", "BaudRate", RADIO.BaudRate); + pIniFile->WriteInteger("RADIO", "BitLen", RADIO.BitLen); + pIniFile->WriteInteger("RADIO", "Stop", RADIO.Stop); + pIniFile->WriteInteger("RADIO", "Parity", RADIO.Parity); + pIniFile->WriteInteger("RADIO", "flwXON", RADIO.flwXON); + pIniFile->WriteInteger("RADIO", "flwCTS", RADIO.flwCTS); + pIniFile->WriteInteger("RADIO", "usePTT", RADIO.usePTT); + + pIniFile->WriteInteger("RADIO", "ByteWait", RADIO.ByteWait); + + pIniFile->WriteInteger("RADIO", "Cmdxx", RADIO.Cmdxx); + pIniFile->WriteString("RADIO", "CmdInit", RADIO.CmdInit); + pIniFile->WriteString("RADIO", "CmdRx", RADIO.CmdRx); + pIniFile->WriteString("RADIO", "CmdTx", RADIO.CmdTx); + + pIniFile->WriteString("RADIO", "FileGNR", RADIO.cmdGNR); + pIniFile->WriteInteger("RADIO", "OpenGNR", RADIO.openGNR); + + pIniFile->WriteInteger("RADIO", "PollType", RADIO.PollType); + pIniFile->WriteInteger("RADIO", "PollInterval", RADIO.PollInterval); + pIniFile->WriteInteger("RADIO", "PollOffset", RADIO.PollOffset); +} +//--------------------------------------------------------------------------- +// ’ˆÓ: VCL ƒIƒuƒWƒFƒNƒg‚̃ƒ\ƒbƒh‚ƃvƒƒpƒeƒB‚ðŽg—p‚·‚é‚É‚Í, Synchronize +// ‚ðŽg‚Á‚½ƒƒ\ƒbƒhŒÄ‚Ño‚µ‚łȂ¯‚ê‚΂Ȃè‚Ü‚¹‚ñBŽŸ‚É—á‚ðŽ¦‚µ‚Ü‚·B +// +// Synchronize(UpdateCaption); +// +// ‚±‚±‚Å, UpdateCaption ‚ÍŽŸ‚̂悤‚É‹Lq‚Å‚«‚Ü‚·B +// +// void __fastcall CCradio::UpdateCaption() +// { +// Form1->Caption = "ƒXƒŒƒbƒh‚©‚ç‘‚«Š·‚¦‚Ü‚µ‚½"; +// } +//--------------------------------------------------------------------------- +__fastcall CCradio::CCradio(bool CreateSuspended) + : TThread(CreateSuspended) +{ + m_CreateON = FALSE; // ƒNƒŠƒGƒCƒgƒtƒ‰ƒO + m_fHnd = NULL; // ƒtƒ@ƒCƒ‹ƒnƒ“ƒhƒ‹ + m_wHnd = NULL; // e‚̃EƒCƒ“ƒhƒEƒnƒ“ƒhƒ‹ + m_uMsg = WM_USER; + m_ID = 0; // ƒƒbƒZ[ƒW‚Ì‚h‚c”Ô† + m_Command = 0; // ƒXƒŒƒbƒh‚ւ̃Rƒ}ƒ“ƒh + m_TxAbort = 0; // ‘—M’†Ž~ƒtƒ‰ƒO + m_txwp = m_txrp = m_txcnt = 0; + m_PSKGNRId = 0; + m_OpenGNR = 0; + + m_PollCnt = 0; + m_rxcnt = 0; + m_FreqEvent = 0; + m_Freq[0] = 0; + m_MarkFreq = 2125; + + m_ScanAddr = 0; + m_pRadio = NULL; +} + +//--------------------------------------------------------------------------- +void __fastcall CCradio::Execute() +{ + //---- ƒXƒŒƒbƒh‚̃R[ƒh‚ð‚±‚±‚É‹Lq ---- +// Priority = tpLower; + while(1){ + if( Terminated == TRUE ){ + return; + } + if( m_Command == CRADIO_CLOSE ){ + m_Command = 0; + return; + } + if( m_CreateON == TRUE ){ + if( m_txcnt ){ + if( m_pRadio != NULL ){ + if( !(m_pRadio->GetStatus() & mmrpstatusTXBUSY) ){ + m_pRadio->PutChar(m_txbuf[m_txrp]); + m_txrp++; + if( m_txrp >= RADIO_TXBUFSIZE ){ + m_txrp = 0; + } + m_txcnt--; + } + } + else if( !TxBusy() ){ + DWORD size=0; + ::WriteFile( m_fHnd, &m_txbuf[m_txrp], 1, &size, NULL ); + if( size ){ + m_txrp++; + if( m_txrp >= RADIO_TXBUFSIZE ){ + m_txrp = 0; + } + m_txcnt--; + } + if( RADIO.ByteWait ) ::Sleep(RADIO.ByteWait); + } + ::Sleep(1); + } + else if( m_pRadio != NULL ){ + if( m_pRadio->GetStatus() & mmrpstatusFREQ ){ + long fq = m_pRadio->GetFreq(); + if( fq ) UpdateFreq(double(fq)/1e4); + } + while(m_pRadio->GetStatus() & mmrpstatusRX){ + CatchPoll(m_pRadio->GetChar()); + } + ::Sleep(10); + } + else { + BYTE dmy[256]; + while(1){ + int len = RecvLen(); + if( !len ) break; + if( len >= sizeof(dmy) ) len = sizeof(dmy); + Read(dmy, len); + if( RADIO.PollType ){ + BYTE *p = dmy; + for( ; len; p++, len-- ){ + CatchPoll(*p); + } + } + } + ::Sleep(10); + } + } + else { + ::Sleep(10); + } + } +} +//--------------------------------------------------------------------------- +/*#$% +============================================================== + ’ÊM‰ñü‚ðƒI[ƒvƒ“‚µƒXƒŒƒbƒh‚ðƒAƒNƒeƒBƒu‚É‚·‚é +-------------------------------------------------------------- +PortName : ‰ñü‚Ì–¼‘O +pCP : COMMPARA‚̃|ƒCƒ“ƒ^iƒkƒ‹‚ÌŽž‚̓fƒtƒHƒ‹ƒg‚ʼnŠú‰»j +pWnd : ƒƒbƒZ[ƒW‘—Mæ‚̃EƒCƒ“ƒhƒEƒNƒ‰ƒX‚̃|ƒCƒ“ƒ^iƒkƒ‹‚ÌŽž‚ÍÒ²ÝÌڰѳ²ÝÄÞ³j +nID : ƒf[ƒ^ŽóMŽž‚̃ƒbƒZ[ƒW‚h‚c +RBufSize : ŽóMƒoƒbƒtƒ@‚̃TƒCƒY(default=2048) +TBufSize : ‘—Mƒoƒbƒtƒ@‚̃TƒCƒY(default=2048) +-------------------------------------------------------------- +TRUE/FALSE +-------------------------------------------------------------- +============================================================== +*/ +BOOL CCradio::Open(CRADIOPARA *cp, HWND hwnd, UINT uMsg, UINT nID) +{ + if( m_CreateON == TRUE ) Close(); + m_TxAbort = FALSE; + m_PSKGNRId = 0; + m_OpenGNR = 0; + if( !strcmpi(cp->StrPort, "PSKGNR") || !strcmpi(cp->StrPort, "WD5GNR") || !strcmpi(cp->StrPort, "LOGGER")){ + m_PSKGNRId = ::RegisterWindowMessage("PSKGNRFUNC"); + m_CreateON = TRUE; + if( RADIO.openGNR && (!RADIO.cmdGNR.IsEmpty()) && (strcmpi(cp->StrPort, "LOGGER")) ){ + if( FindWindow("ThunderRT6Main", NULL) == NULL ){ + ::WinExec(RADIO.cmdGNR.c_str(), SW_HIDE); + m_OpenGNR = 1; + } + } + return m_CreateON; + } + + //AA6YQ 1.66 enable use of 2-digit com ports per http://support.microsoft.com/kb/115831/EN-US/ + char *ComPort = new char[33]; + StrCopy(ComPort,"\\\\.\\"); + StrCat(ComPort,cp->StrPort); + + m_fHnd = ::CreateFile(ComPort, GENERIC_READ | GENERIC_WRITE, + 0, NULL, + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, + NULL + ); + m_wHnd = hwnd; + m_uMsg = uMsg; + m_ID = nID; + if( m_fHnd == INVALID_HANDLE_VALUE ) goto _mmr; + // setup device buffers + if( ::SetupComm( m_fHnd, DWORD(RADIO_COMBUFSIZE), DWORD(RADIO_COMBUFSIZE) ) == FALSE ){ + ::CloseHandle(m_fHnd); +_mmr:; + m_pRadio = new CMMRadio(hwnd, uMsg); + if( m_pRadio->Open(cp->StrPort) ){ + m_CreateON = TRUE; + Priority = tpLower; + Resume(); // ƒXƒŒƒbƒh‚ÌŽÀs + return TRUE; + } + else { + delete m_pRadio; + m_pRadio = NULL; + return FALSE; + } + } + + // purge any information in the buffer + ::PurgeComm( m_fHnd, PURGE_TXABORT | PURGE_RXABORT | PURGE_TXCLEAR | PURGE_RXCLEAR ); + + // set up for overlapped I/O + COMMTIMEOUTS TimeOut; + + TimeOut.ReadIntervalTimeout = 0xffffffff; + TimeOut.ReadTotalTimeoutMultiplier = 0; + TimeOut.ReadTotalTimeoutConstant = 0; + TimeOut.WriteTotalTimeoutMultiplier = 0; + TimeOut.WriteTotalTimeoutConstant = 20000; +// TimeOut.WriteTotalTimeoutConstant = 1; + if( !::SetCommTimeouts( m_fHnd, &TimeOut ) ){ + ::CloseHandle( m_fHnd ); + return FALSE; + } + ::GetCommState( m_fHnd, &m_dcb ); + m_dcb.BaudRate = cp->BaudRate; + m_dcb.fBinary = TRUE; + m_dcb.ByteSize = USHORT(cp->BitLen ? 8 : 7); + const UCHAR _tp[]={NOPARITY, EVENPARITY, ODDPARITY}; + m_dcb.Parity = _tp[cp->Parity]; + const UCHAR _ts[]={ONESTOPBIT,TWOSTOPBITS}; + m_dcb.StopBits = _ts[cp->Stop]; + if( cp->usePTT ){ + m_dcb.fRtsControl = RTS_CONTROL_DISABLE; // ‘—M‹ÖŽ~ + m_dcb.fDtrControl = DTR_CONTROL_DISABLE; // ‘—M‹ÖŽ~ + } + else { + m_dcb.fRtsControl = RTS_CONTROL_ENABLE; + } + m_dcb.fOutxCtsFlow = (cp->flwCTS && !cp->usePTT) ? TRUE : FALSE; + m_dcb.fInX = m_dcb.fOutX = cp->flwXON ? TRUE : FALSE; + m_dcb.XonChar = 0x11; + m_dcb.XoffChar = 0x13; + m_dcb.fParity = FALSE; + m_dcb.EvtChar = 0x0d; // dummy setting +// m_dcb.fTXContinueOnXoff = TRUE; + m_dcb.XonLim = USHORT(RADIO_COMBUFSIZE/4); // 1/4 of RBufSize + m_dcb.XoffLim = USHORT(RADIO_COMBUFSIZE*3/4); // 3/4 of RBufSize + m_dcb.DCBlength = sizeof( DCB ); + if( !::SetCommState( m_fHnd, &m_dcb ) ){ + ::CloseHandle( m_fHnd ); + return FALSE; + } + // get any early notifications + if( !::SetCommMask( m_fHnd, EV_RXFLAG ) ){ + ::CloseHandle(m_fHnd); + return FALSE; + } + m_CreateON = TRUE; + Priority = tpLower; + Resume(); // ƒXƒŒƒbƒh‚ÌŽÀs + return TRUE; +} +/*#$% +============================================================== + ’ÊM‰ñü‚ðƒNƒ[ƒY‚·‚é +-------------------------------------------------------------- +-------------------------------------------------------------- +-------------------------------------------------------------- + ƒXƒŒƒbƒh‚ªI—¹‚·‚é‚܂ő҂ +============================================================== +*/ +void CCradio::Close(void) +{ + if( m_CreateON == TRUE ){ + if( m_PSKGNRId ){ + if( (m_OpenGNR || RADIO.change) && RADIO.openGNR ) ::SendMessage(HWND_BROADCAST, m_PSKGNRId, 1 , 0); + m_PSKGNRId = 0; + } + else { + if( m_ID ){ + m_Command = CRADIO_CLOSE; // ƒXƒŒƒbƒhI—¹ƒRƒ}ƒ“ƒh + Priority = tpNormal; //ƒXƒŒƒbƒh‚Í’Êí‚Ì—Dæ“x‚Å‚ ‚é + WaitFor(); + } + if( m_pRadio != NULL ){ + delete m_pRadio; + m_pRadio = NULL; + } + else { + ::CloseHandle(m_fHnd); + } + } + } + m_CreateON = FALSE; + m_TxAbort = TRUE; +} +void CCradio::ReqClose(void) +{ + if( m_CreateON == TRUE ){ + if( m_PSKGNRId ){ + return; + } + else { + if( m_ID ){ + m_Command = CRADIO_CLOSE; // ƒXƒŒƒbƒhI—¹ƒRƒ}ƒ“ƒh + Priority = tpNormal; //ƒXƒŒƒbƒh‚Í’Êí‚Ì—Dæ“x‚Å‚ ‚é + } + } + } +} +void CCradio::WaitClose(void) +{ + if( m_CreateON == TRUE ){ + if( m_PSKGNRId ){ + if( (m_OpenGNR || RADIO.change) && RADIO.openGNR ) ::SendMessage(HWND_BROADCAST, m_PSKGNRId, 1 , 0); + m_PSKGNRId = 0; + } + else { + if( m_ID && m_Command ){ + WaitFor(); + } + if( m_pRadio != NULL ){ + delete m_pRadio; + m_pRadio = NULL; + } + else { + ::CloseHandle(m_fHnd); + } + } + m_CreateON = FALSE; + } + m_TxAbort = TRUE; +} +/*#$% +============================================================== + ŽóMƒoƒbƒtƒ@“à‚ÌŠi”[ƒf[ƒ^’·‚𓾂é +-------------------------------------------------------------- +-------------------------------------------------------------- + ƒf[ƒ^‚Ì’·‚³ +-------------------------------------------------------------- +============================================================== +*/ +DWORD CCradio::RecvLen(void) +{ + COMSTAT ComStat; + DWORD dwErrorFlags; + + ::ClearCommError( m_fHnd, &dwErrorFlags, &ComStat ); + return ComStat.cbInQue; +} + +/*#$% +============================================================== + ‘—MƒrƒW[‚©‚Ç‚¤‚©’²‚ׂé +-------------------------------------------------------------- +-------------------------------------------------------------- + : ‘—MƒrƒW[ó‘Ô +-------------------------------------------------------------- +============================================================== +*/ +int CCradio::TxBusy(void) +{ +#if 0 + COMSTAT ComStat; + DWORD dwErrorFlags; + + if( m_TxAbort ) return FALSE; + ClearCommError( m_fHnd, &dwErrorFlags, &ComStat ); + int f = ComStat.fRlsdHold; + if( f ) return TRUE; + if( m_dcb.fOutxCtsFlow ){ + f |= ComStat.fCtsHold; + } + if( m_dcb.fOutX ){ + f |= ComStat.fXoffHold; + } + return f ? TRUE : FALSE; +#else + COMSTAT ComStat; + DWORD dwErrorFlags; + + ::ClearCommError( m_fHnd, &dwErrorFlags, &ComStat ); + return ComStat.cbOutQue; +#endif +} + +/*#$% +============================================================== + ’ÊM‰ñü‚©‚çƒf[ƒ^‚ðŽæ‚èo‚· +-------------------------------------------------------------- +p : ƒoƒbƒtƒ@‚̃|ƒCƒ“ƒ^ +len : ƒoƒbƒtƒ@‚̃TƒCƒY +-------------------------------------------------------------- +ŽÀÛ‚ÉŽóM‚µ‚½ƒTƒCƒY +-------------------------------------------------------------- +============================================================== +*/ +DWORD CCradio::Read(BYTE *p, DWORD len) +{ + DWORD size=0; + + if( m_CreateON == TRUE ){ + ::ReadFile( m_fHnd, p, len, &size, NULL ); + } + return size; +} + +/*#$% +============================================================== + ’ÊM‰ñü‚Ƀf[ƒ^‚ð‘—M‚·‚é +-------------------------------------------------------------- +-------------------------------------------------------------- +-------------------------------------------------------------- +============================================================== +*/ +void CCradio::PutChar(char c) +{ + if( m_CreateON == TRUE ){ + if( m_PSKGNRId ) return; + if( m_txcnt < RADIO_TXBUFSIZE ){ + m_txbuf[m_txwp] = c; + m_txwp++; + if( m_txwp >= RADIO_TXBUFSIZE ) m_txwp = 0; + m_txcnt++; + } + } +} + +/*#$% +============================================================== + ’ÊM‰ñü‚Ƀf[ƒ^‚ð‘—M‚·‚é +-------------------------------------------------------------- +p : ƒoƒbƒtƒ@‚̃|ƒCƒ“ƒ^ +len : ‘—M‚·‚éƒTƒCƒY +-------------------------------------------------------------- +ŽÀÛ‚É‘—M‚µ‚½ƒTƒCƒY +-------------------------------------------------------------- +============================================================== +*/ +void CCradio::Write(void *s, DWORD len) +{ + if( m_CreateON == TRUE ){ + if( m_PSKGNRId ) return; + char *p; + for( p = (char *)s; len; len--, p++ ){ + PutChar(*p); + } + } +} + +/*#$% +============================================================== + ’ÊM‰ñü‚Ƀf[ƒ^‚ð‘—M‚·‚é +-------------------------------------------------------------- +p : ƒoƒbƒtƒ@‚̃|ƒCƒ“ƒ^ +len : ‘—M‚·‚éƒTƒCƒY +-------------------------------------------------------------- +ŽÀÛ‚É‘—M‚µ‚½ƒTƒCƒY +-------------------------------------------------------------- +============================================================== +*/ +void CCradio::OutStr(LPCSTR fmt, ...) +{ + va_list pp; + char bf[1024]; + + va_start(pp, fmt); + vsprintf( bf, fmt, pp ); + va_end(pp); + Write(bf, strlen(bf)); +} + +void CCradio::OutLine(LPCSTR fmt, ...) +{ + va_list pp; + char bf[1024]; + + va_start(pp, fmt); + vsprintf( bf, fmt, pp ); + va_end(pp); + Write(bf, strlen(bf)); + char r[] = "\r"; //JA7UDE 0428 + Write(r, 1); +} + +void CCradio::SendCommand(LPCSTR p) +{ + int c; + int f; + + for(f = 0; *p; p++){ + if( *p == '\\' ){ + f = 0; + p++; + switch(*p){ + case '$': + f = 1; + continue; + case 'x': + case 'X': + p++; + if( *p == 'x' ){ + c = RADIO.Cmdxx; + } + else { + c = htoin(p, 2); + } + p++; + break; + case 'r': + c = CR; + break; + case 'n': + c = LF; + break; + case 'w': + p++; + c = atoin(p, 2); + if( (c < 0) || (c >= 100) ) c = 100; + if( c ) ::Sleep(c * 10); + p++; + continue; + case '\\': + c = '\\'; + break; + case 'c': // comment + return; + } + } + else if( f ){ + p = SkipSpace(p); + if( *p == 'x' ){ + c = RADIO.Cmdxx; + } + else { + c = htoin(p, 2); + } + p++; + } + else { + c = *p; + } + PutChar(BYTE(c)); + } +} + +void CCradio::SetPTT(int sw) +{ + if( m_PSKGNRId ){ + ::SendMessage(HWND_BROADCAST, m_PSKGNRId, 0 , sw ? 1 : 0); + if( sw ) ::Sleep(50); + } + else { + if( sw ){ + if( m_pRadio != NULL ){ + m_pRadio->SetPTT(sw); + } + else if( RADIO.usePTT ){ + ::EscapeCommFunction(m_fHnd, SETRTS); + ::EscapeCommFunction(m_fHnd, SETDTR); + } + SendCommand(RADIO.CmdTx.c_str()); + } + else { + if( m_pRadio != NULL ){ + m_pRadio->SetPTT(sw); + } + else if( RADIO.usePTT ){ + ::EscapeCommFunction(m_fHnd, CLRRTS); + ::EscapeCommFunction(m_fHnd, CLRDTR); + } + SendCommand(RADIO.CmdRx.c_str()); + } + } +} + +//-------------------------------------------------------- +// Žü”g”‚ª•ω»‚µ‚Ä‚¢‚é‚©‚Ç‚¤‚©’²‚ׂé +int CCradio::IsFreqChange(LPCSTR pFreq) +{ + if( RADIO.PollType ){ + if( m_FreqEvent ) return 1; + if( m_Freq[0] ){ + if( strcmp(m_Freq, pFreq) ) return 1; + } + } + return 0; +} + +//-------------------------------------------------------- +// ƒ^ƒCƒ}[ˆ— +void CCradio::Timer(int tx, int interval) +{ + if( m_CreateON == TRUE ){ + if( m_PSKGNRId ) return; + if( m_pRadio != NULL ){ + if( m_pRadio->GetStatus() & mmrpstatusDEFCMD ){ + LPCSTR p; + switch(m_pRadio->GetDefCommand()){ + case 1: + p = RADIO.CmdTx.c_str(); + break; + case 2: + p = RADIO.CmdRx.c_str(); + break; + default: + p = RADIO.CmdInit.c_str(); + break; + } + SendCommand(p); + m_PollCnt = (5 + RADIO.PollInterval); + } + } + if( (!tx) && RADIO.PollType ){ + if( !m_PollCnt ){ + if( m_pRadio != NULL ) m_pRadio->Polling(); + if( m_ScanAddr ){ // ƒAƒhƒŒƒXƒXƒLƒƒƒ“ + m_PollCnt = 4; + if( m_ScanAddr <= 3 ){ + m_ScanAddr++; + } + else { + RADIO.Cmdxx++; + if( RADIO.Cmdxx >= 0x80 ){ + RADIO.Cmdxx = 0; + } + } + } + else { + m_PollCnt = (5 + RADIO.PollInterval); + } + if( interval ){ + m_PollCnt = m_PollCnt * 100 / interval; + } + switch(RADIO.PollType){ + case RADIO_POLLYAESUHF: + case RADIO_POLLFT1000D: + case RADIO_POLLFT920: + m_rxcnt = 0; + SendCommand("\\$0000000210"); + break; + case RADIO_POLLYAESUVU: + m_rxcnt = 0; + SendCommand("\\$0000000003"); + break; + + //1.66B AA6YQ + case RADIO_POLLFT9000: + case RADIO_POLLFT2000: + case RADIO_POLLFT950: + case RADIO_POLLFT450: + m_rxcnt = 0; + SendCommand("IF;"); + break; + + case RADIO_POLLICOM: + case RADIO_POLLOMNIVI: + m_rxcnt = 0; + SendCommand("\\$FEFExxE003FD"); + break; + case RADIO_POLLICOMN: + case RADIO_POLLOMNIVIN: + if( !m_Freq[0] || m_ScanAddr ){ + m_rxcnt = 0; + SendCommand("\\$FEFExxE003FD"); + } + break; + case RADIO_POLLKENWOOD: + m_rxcnt = 0; + SendCommand("IF;"); + break; + case RADIO_POLLKENWOODN: + if( !m_Freq[0] ){ + m_rxcnt = 0; + SendCommand("AI1;"); + } + break; + case RADIO_POLLJST245: + m_rxcnt = 0; + SendCommand("I\r\n"); + break; + case RADIO_POLLJST245N: + if( !m_Freq[0] ){ + m_rxcnt = 0; + SendCommand("I1\r\nL\r\n"); + } + break; + default: + break; + } + } + m_PollCnt--; + } + } +} + +//-------------------------------------------------------- +// Žü”g”ƒ|[ƒŠƒ“ƒOƒf[ƒ^‚ÌŽóM +void CCradio::CatchPoll(BYTE c) +{ + switch(RADIO.PollType){ + case RADIO_POLLYAESUHF: + case RADIO_POLLFT1000D: + case RADIO_POLLFT920: + if( m_rxcnt < 5 ){ + m_rxbuf[m_rxcnt] = c; + m_rxcnt++; + if( m_rxcnt == 5 ){ + FreqYaesuHF(); + } + } + break; + + //1.66B AA6YQ + case RADIO_POLLFT9000: + case RADIO_POLLFT2000: + case RADIO_POLLFT950: + case RADIO_POLLFT450: + if( m_rxcnt < sizeof(m_rxbuf) ){ + if( (c != 0x0d) && (c != 0x0f) ){ + if( (c != ' ') || m_rxcnt ){ + m_rxbuf[m_rxcnt] = c; // Data + m_rxcnt++; + if( c == ';' ){ + if( (m_rxbuf[0] == 'I') && (m_rxbuf[1]=='F') ){ + if( m_rxcnt >= 13 ) FreqYaesu9K2K(); + } + m_rxcnt = 0; + } + } + } + } + else { + m_rxcnt = 0; + } + break; + + case RADIO_POLLYAESUVU: + if( m_rxcnt < 5 ){ + m_rxbuf[m_rxcnt] = c; + m_rxcnt++; + if( m_rxcnt == 5 ){ + FreqYaesuVU(); + } + } + break; + case RADIO_POLLICOM: + case RADIO_POLLICOMN: + case RADIO_POLLOMNIVI: + case RADIO_POLLOMNIVIN: + switch(m_rxcnt){ + case 0: + if( c == 0xfe ){ + m_rxbuf[m_rxcnt] = c; // ƒvƒŠƒAƒ“ƒuƒ‹ + m_rxcnt++; + } + break; + case 1: + if( c != 0xfe ){ + m_rxbuf[m_rxcnt] = c; // PC-Addr + m_rxcnt++; + } + break; + case 2: + if( (c == RADIO.Cmdxx) || + (m_ScanAddr && c) ){ + m_rxbuf[m_rxcnt] = c; // Radio-Addr + m_rxcnt++; + } + else { + m_rxcnt = 0; + } + break; + case 3: + if( (c == 0x03) || ((c == 0x00)&&((RADIO.PollType == RADIO_POLLICOMN)||(RADIO.PollType == RADIO_POLLOMNIVIN))) ){ + m_rxbuf[m_rxcnt] = c; // Respons-command + m_rxcnt++; + } + else { + m_rxcnt = 0; + } + break; + default: + if( m_rxcnt < sizeof(m_rxbuf) ){ + m_rxbuf[m_rxcnt] = c; // Data + m_rxcnt++; + if( c == 0xfd ){ + if( m_rxcnt >= 9 ){ + FreqICOM(); + if( m_ScanAddr && m_rxbuf[2] ){ + RADIO.Cmdxx = m_rxbuf[2]; + RADIO.PollScan = 0; + m_ScanAddr = 0; + } + } + m_rxcnt = 0; + } + } + else { + m_rxcnt = 0; + } + break; + } + break; + case RADIO_POLLKENWOOD: + case RADIO_POLLKENWOODN: + if( m_rxcnt < sizeof(m_rxbuf) ){ + if( (c != 0x0d) && (c != 0x0f) ){ + if( (c != ' ') || m_rxcnt ){ + m_rxbuf[m_rxcnt] = c; // Data + m_rxcnt++; + if( c == ';' ){ + if( (m_rxbuf[0] == 'I') && (m_rxbuf[1]=='F') ){ + if( m_rxcnt >= 13 ) FreqKenwood(); + } + m_rxcnt = 0; + } + } + } + } + else { + m_rxcnt = 0; + } + break; + case RADIO_POLLJST245: + case RADIO_POLLJST245N: + if( m_rxcnt < sizeof(m_rxbuf) ){ + if( (c == 'I') || m_rxcnt ){ + m_rxbuf[m_rxcnt] = c; // Data + m_rxcnt++; + if( (c == 0x0d) || (c == 0x0f) ){ + if( m_rxcnt >= 12 ) FreqJST245(); + m_rxcnt = 0; + } + } + } + else { + m_rxcnt = 0; + } + break; + default: + break; + } +} +//---------------------------------------------------------- +// Žü”g”‚ÌXV (freq=MHz) +// +void CCradio::UpdateFreq(double freq) +{ + if( freq < 0.001 ) return; + + switch(RADIO.PollOffset){ + case 1: + freq -= m_MarkFreq/1000000.0; + break; + case 2: + freq += m_MarkFreq/1000000.0; + break; + default: + break; + } + + char bf[32]; + sprintf(bf, "%.3lf", freq); + if( strcmp(m_Freq, bf) ){ + strcpy(m_Freq, bf); + m_FreqEvent = 1; + } +} + +void CCradio::FreqYaesuHF(void) +{ + ULONG fq; + fq = m_rxbuf[1]; + fq = fq << 8; + fq |= m_rxbuf[2]; + fq = fq << 8; + fq |= m_rxbuf[3]; + fq = fq << 8; + fq |= m_rxbuf[4]; + + double f; + switch(RADIO.PollType){ + case RADIO_POLLFT1000D: // FT1000D + f = 25600000.0; + break; + case RADIO_POLLFT920: // FT920 + f = 1000000.0; + break; + default: // FT1000MP + f = 1600000.0; + break; + } + + UpdateFreq(double(fq)/f); +} + +void CCradio::FreqYaesuVU(void) +{ + ULONG fq; + fq = m_rxbuf[0] >> 4; + fq *= 10; + fq += m_rxbuf[0] & 0x0f; + fq *= 10; + fq += m_rxbuf[1] >> 4; + fq *= 10; + fq += m_rxbuf[1] & 0x0f; + fq *= 10; + fq += m_rxbuf[2] >> 4; + fq *= 10; + fq += m_rxbuf[2] & 0x0f; + + UpdateFreq( double(fq) / 1000.0 ); +} + +void CCradio::FreqICOM(void) +{ +// 0 1 2 3 4 5 6 7 8 9 +// fe e0 40 03 90 09 02 07 00 fd +// fe e0 40 03 90 09 02 07 fd + + ULONG fq = 0; + if( m_rxbuf[8] != 0xfd ){ + fq = (m_rxbuf[8] >> 4); + fq *= 10; + fq += (m_rxbuf[8] & 0x0f); + } + fq *= 10; + fq += m_rxbuf[7] >> 4; + fq *= 10; + fq += m_rxbuf[7] & 0x0f; + fq *= 10; + fq += m_rxbuf[6] >> 4; + fq *= 10; + fq += m_rxbuf[6] & 0x0f; + fq *= 10; + fq += m_rxbuf[5] >> 4; + fq *= 10; + fq += m_rxbuf[5] & 0x0f; + fq *= 10; + fq += m_rxbuf[4] >> 4; + fq *= 10; + fq += m_rxbuf[4] & 0x0f; + + UpdateFreq(double(fq)/1e6); +} + +void CCradio::FreqKenwood(void) +{ +//0123456789012 +//IF00021155000 +001000 0002000008 ; +//abcdefghijklmnopqrstuvwxyz1234567890 <----@Œ…ˆÊ’u +//c - m Žü”g”@21.155MHz + + ULONG fq = 0; + + m_rxbuf[13] = 0; + if( sscanf((LPCSTR)&m_rxbuf[2], "%lu", &fq) == 1 ){ + if( fq ) UpdateFreq(double(fq)/1e6); + } +} + +//AA6YQ 1.66B +void CCradio::FreqYaesu9K2K(void) +{ +//0123456789012 +//IF00021155000 +001000 0002000008 ; +//abcdefghijklmnopqrstuvwxyz1234567890 <----@Œ…ˆÊ’u +//f - m Žü”g”@21.155MHz + + ULONG fq = 0; + + m_rxbuf[13] = 0; + if( sscanf((LPCSTR)&m_rxbuf[5], "%lu", &fq) == 1 ){ + if( fq ) UpdateFreq(double(fq)/1e6); + } +} + +void CCradio::FreqJST245(void) +{ +// 0 1 2 3 4 5 6 7 8 9 10 11 12 +//@h‚h‚‚‚‚„‚†‚†‚†‚†‚†‚†‚†‚†‚‡h +//@@‚hFƒwƒbƒ_[‹L† +//@@‚FŽg—pƒAƒ“ƒeƒi‚PŒ…i‚P`‚Rj +//@@‚‚Fƒoƒ“ƒh•‚PŒ…i‚O`‚Qj +//@@‚„Fƒ‚[ƒh‚PŒ…i‚O`‚Tj +//@@‚†F‘—ŽóMŽü”g”‚WŒ…i‚O‚O‚P‚O‚O‚O‚O‚O`‚T‚R‚X‚X‚X‚X‚X‚Wj +//@@‚‡F‚`‚f‚b‚PŒ…i‚O`‚Qj + + ULONG fq = 0; + + m_rxbuf[12] = 0; + LPCSTR p = (LPCSTR)&m_rxbuf[4]; + for( ; *p; p++ ) if( !isdigit(*p) ) return; + if( sscanf((LPCSTR)&m_rxbuf[4], "%lu", &fq) == 1 ){ + if( fq ) UpdateFreq(double(fq)/1e6); + } +} + + diff --git a/cradio.h b/cradio.h new file mode 100644 index 0000000..af3a020 --- /dev/null +++ b/cradio.h @@ -0,0 +1,172 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba, Dave Bernstein +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +///---------------------------------------------------------- +/// RadioƒRƒ~ƒjƒ…ƒP[ƒVƒ‡ƒ“ƒNƒ‰ƒX +/// +/// (C) JE3HHT Makoto.Mori +/// +//--------------------------------------------------------------------------- +#ifndef CradioH +#define CradioH +#include "ComLib.h" +#include "mmlink.h" +//--------------------------------------------------------------------------- +#include +typedef struct { + int change; + + char StrPort[32]; // ƒ|[ƒg‚Ì–¼‘O + int BaudRate; // ƒ{[ƒŒ[ƒg + int BitLen; // 0-7Bit, 1-8Bit + int Stop; // 0-1Bit, 1-2Bit + int Parity; // 0-PN, 1-PE, 2-PO + int flwXON; // Xon/Xoff ON + int flwCTS; // CTS-RTS ON + int usePTT; + + long ByteWait; // ƒoƒCƒgŠÔ‚Ì‘—MƒEƒGƒCƒg + + int Cmdxx; + + AnsiString CmdInit; + AnsiString CmdRx; + AnsiString CmdTx; + + AnsiString cmdGNR; + int openGNR; + + int PollType; + int PollInterval; + int PollOffset; + + int PollScan; +}CRADIOPARA; +extern CRADIOPARA RADIO; +//--------------------------------------------------------------------------- +void LoadRADIOSetup(TMemIniFile *pIniFile); +void SaveRADIOSetup(TMemIniFile *pIniFile); +//#define CR 0x0d +//#define LF 0x0a +#define CRADIO_CLOSE 1 +#define RADIO_COMBUFSIZE 4096 +#define RADIO_TXBUFSIZE 256 +#define RADIO_RXBUFSIZE 256 + +enum { + RADIO_POLLNULL, + RADIO_POLLYAESUHF, + RADIO_POLLYAESUVU, + RADIO_POLLICOM, + RADIO_POLLICOMN, + RADIO_POLLOMNIVI, + RADIO_POLLOMNIVIN, + RADIO_POLLKENWOOD, + RADIO_POLLKENWOODN, + RADIO_POLLFT1000D, + RADIO_POLLFT920, + RADIO_POLLJST245, + RADIO_POLLJST245N, + RADIO_POLLFT9000, //1.66B AA6YQ add new radios at end of list as this value is stored in mmtty.ini + RADIO_POLLFT2000, //1.66B AA6YQ + RADIO_POLLFT950, //1.66B AA6YQ + RADIO_POLLFT450, //1.66B AA6YQ +}; + +class CCradio : public TThread +{ +public: + BOOL m_CreateON; // ƒNƒŠƒGƒCƒgƒtƒ‰ƒO + DCB m_dcb; // ‚c‚b‚a + HANDLE m_fHnd; // ƒtƒ@ƒCƒ‹ƒnƒ“ƒhƒ‹ + HWND m_wHnd; // e‚̃EƒCƒ“ƒhƒEƒnƒ“ƒhƒ‹ + UINT m_uMsg; + UINT m_ID; // ƒƒbƒZ[ƒW‚Ì‚h‚c”Ô† + volatile int m_Command; // ƒXƒŒƒbƒh‚ւ̃Rƒ}ƒ“ƒh + BOOL m_TxAbort; // ‘—M’†Ž~ƒtƒ‰ƒO + AnsiString Name; + CMMRadio *m_pRadio; + + int m_PSKGNRId; + int m_OpenGNR; + + char m_txbuf[RADIO_TXBUFSIZE]; + int m_txcnt; + int m_txwp; + int m_txrp; + + int m_PollCnt; + unsigned char m_rxbuf[RADIO_RXBUFSIZE]; + int m_rxcnt; + int m_FreqEvent; + char m_Freq[32]; + int m_MarkFreq; + + int m_ScanAddr; +protected: + void virtual __fastcall Execute(); + BOOL OpenPipe(CRADIOPARA *cp, HWND hwnd, UINT nID); + void CatchPoll(BYTE c); + void FreqYaesuHF(void); + void FreqYaesuVU(void); + void FreqICOM(void); + void FreqKenwood(void); + void FreqYaesu9K2K(void); + void FreqJST245(void); + +public: + __fastcall CCradio(bool CreateSuspended); + __fastcall ~CCradio(){ + Close(); + }; + inline BOOL IsOpen(void){ + return m_CreateON; + }; + inline void UpdateHandle(HWND hwnd, UINT uMsg){ + m_wHnd = hwnd; m_uMsg = uMsg; + }; + BOOL Open(CRADIOPARA *cp, HWND hwnd, UINT uMsg, UINT nID); + void Close(void); + void ReqClose(void); + void WaitClose(void); + DWORD RecvLen(void); + int TxBusy(void); + DWORD Read(BYTE *p, DWORD len); + void Write(void *p, DWORD len); + void PutChar(char c); + void OutStr(LPCSTR fmt, ...); + void OutLine(LPCSTR fmt, ...); + void SendCommand(LPCSTR p); + void SetPTT(int sw); + void Timer(int tx, int interval); + + inline LPCSTR GetFreq(void){ + m_FreqEvent = 0; + return m_Freq; + }; + inline void SetMarkFreq(int f){ + m_MarkFreq = f; + }; + int IsFreqChange(LPCSTR p); + void UpdateFreq(double freq); +}; + +void InitRADIOPara(void); +#endif + diff --git a/ctnc.cpp b/ctnc.cpp new file mode 100644 index 0000000..95fa1de --- /dev/null +++ b/ctnc.cpp @@ -0,0 +1,702 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "Ctnc.h" +#include "ComLib.h" + +#define WAITSTAT 0 + +CTNCPARA TNC; +void InitTNCPara(void) +{ + strcpy(TNC.StrPort, "NONE"); // ƒ|[ƒg‚Ì–¼‘O + TNC.BaudRate = 1200; // ƒ{[ƒŒ[ƒg + TNC.BitLen = 1; // 0-7Bit, 1-8Bit + TNC.Stop = 0; // 0-1Bit, 1-2Bit + TNC.Parity = 0; // 0-PN, 1-PE, 2-PO + TNC.flwXON = 1; // Xon/Xoff ON + TNC.flwCTS = 0; // CTS-RTS ON + + TNC.Echo = 2; + TNC.Type = (lcid != LANG_JAPANESE) ? 1 : 0; // 0-TNC241, 1-KAM + TNC.TncMode = 1; // Command mode + TNC.change = 1; +} +void LoadTNCSetup(TMemIniFile *pIniFile) +{ + AnsiString as = TNC.StrPort; + as = pIniFile->ReadString("TNC", "PortName", as); + StrCopy(TNC.StrPort, as.c_str(), 31); + TNC.Type = pIniFile->ReadInteger("TNC", "Type", TNC.Type); + TNC.BaudRate = pIniFile->ReadInteger("TNC", "BaudRate", TNC.BaudRate); + TNC.BitLen = pIniFile->ReadInteger("TNC", "BitLen", TNC.BitLen); + TNC.Stop = pIniFile->ReadInteger("TNC", "Stop", TNC.Stop); + TNC.Parity = pIniFile->ReadInteger("TNC", "Parity", TNC.Parity); + TNC.flwXON = pIniFile->ReadInteger("TNC", "flwXON", TNC.flwXON); + TNC.flwCTS = pIniFile->ReadInteger("TNC", "flwCTS", TNC.flwCTS); + TNC.Echo = pIniFile->ReadInteger("TNC", "Echo", TNC.Echo); +} +void SaveTNCSetup(TMemIniFile *pIniFile) +{ + pIniFile->WriteString("TNC", "PortName", TNC.StrPort); + pIniFile->WriteInteger("TNC", "Type", TNC.Type); + pIniFile->WriteInteger("TNC", "BaudRate", TNC.BaudRate); + pIniFile->WriteInteger("TNC", "BitLen", TNC.BitLen); + pIniFile->WriteInteger("TNC", "Stop", TNC.Stop); + pIniFile->WriteInteger("TNC", "Parity", TNC.Parity); + pIniFile->WriteInteger("TNC", "flwXON", TNC.flwXON); + pIniFile->WriteInteger("TNC", "flwCTS", TNC.flwCTS); + pIniFile->WriteInteger("TNC", "Echo", TNC.Echo); +} +//--------------------------------------------------------------------------- +// ’ˆÓ: VCL ƒIƒuƒWƒFƒNƒg‚̃ƒ\ƒbƒh‚ƃvƒƒpƒeƒB‚ðŽg—p‚·‚é‚É‚Í, Synchronize +// ‚ðŽg‚Á‚½ƒƒ\ƒbƒhŒÄ‚Ño‚µ‚łȂ¯‚ê‚΂Ȃè‚Ü‚¹‚ñBŽŸ‚É—á‚ðŽ¦‚µ‚Ü‚·B +// +// Synchronize(UpdateCaption); +// +// ‚±‚±‚Å, UpdateCaption ‚ÍŽŸ‚̂悤‚É‹Lq‚Å‚«‚Ü‚·B +// +// void __fastcall CCtnc::UpdateCaption() +// { +// Form1->Caption = "ƒXƒŒƒbƒh‚©‚ç‘‚«Š·‚¦‚Ü‚µ‚½"; +// } +//--------------------------------------------------------------------------- +__fastcall CCtnc::CCtnc(bool CreateSuspended) + : TThread(CreateSuspended) +{ + m_CreateON = FALSE; // ƒNƒŠƒGƒCƒgƒtƒ‰ƒO + m_fHnd = NULL; // ƒtƒ@ƒCƒ‹ƒnƒ“ƒhƒ‹ + m_wHnd = NULL; // e‚̃EƒCƒ“ƒhƒEƒnƒ“ƒhƒ‹ + m_ID = 0; // ƒƒbƒZ[ƒW‚Ì‚h‚c”Ô† + m_Command = 0; // ƒXƒŒƒbƒh‚ւ̃Rƒ}ƒ“ƒh + m_TxAbort = 0; // ‘—M’†Ž~ƒtƒ‰ƒO + ClearTxFifo(); + ClearRxFifo(); + m_timeout = 200; + m_pMMT = NULL; +} +//--------------------------------------------------------------------------- +void __fastcall CCtnc::ClearRxFifo(void) +{ + m_rxwp = m_rxrp = m_rxcnt = 0; +} +//--------------------------------------------------------------------------- +void __fastcall CCtnc::ClearTxFifo(void) +{ + m_txwp = m_txrp = m_txcnt = 0; +} +//--------------------------------------------------------------------------- +const BYTE tbl[]={ + 0x00, 0x10, 0x08, 0x18, // 00000 10000 01000 11000 + 0x04, 0x14, 0x0c, 0x1c, // 00100 10100 01100 11100 + 0x02, 0x12, 0x0a, 0x1a, // 00010 10010 01010 11010 + 0x06, 0x16, 0x0e, 0x1e, // 00110 10110 01110 11110 + 0x01, 0x11, 0x09, 0x19, // 00001 10001 01001 11001 + 0x05, 0x15, 0x0d, 0x1d, // 00101 10101 01101 11101 + 0x03, 0x13, 0x0b, 0x1b, // 00011 10011 01011 11011 + 0x07, 0x17, 0x0f, 0x1f, // 00111 10111 01111 11111 +}; +//--------------------------------------------------------------------------- +BOOL __fastcall CCtnc::PutRxFifo(BYTE c) +{ + if( m_rxcnt >= TNC_RXBUFSIZE ) return FALSE; + if( (TNC.Type == 2) && (cm.BitLen <= 6) ){ + if( m_pMMT && (c >= 0x20) ){ + m_rxbuf[m_rxwp] = c; + } + else { + m_rxbuf[m_rxwp] = tbl[c&0x1f]; + } + } + else { + m_rxbuf[m_rxwp] = c; + } + m_rxwp++; + if( m_rxwp >= (int)sizeof(m_rxbuf) ) m_rxwp = 0; //JA7UDE 0428 + m_rxcnt++; + return TRUE; +} +//--------------------------------------------------------------------------- +void __fastcall CCtnc::Execute() +{ + //---- ƒXƒŒƒbƒh‚̃R[ƒh‚ð‚±‚±‚É‹Lq ---- +// Priority = tpLower; + if( TNC.Type == 2 ){ + m_PTT = GetPTT(); + } + while(1){ + if( Terminated == TRUE ){ + return; + } + if( m_Command == CTNC_CLOSE ){ + m_Command = 0; + return; + } + if( m_CreateON == TRUE ){ + if( m_txcnt ){ + if( !TxBusy() ){ + BYTE d = m_txbuf[m_txrp]; + if( TNC.Type == 2 && (cm.BitLen <= 6) ){ + d = tbl[d & 0x1f]; + } + if( IOPutChar(d) ){ + m_txrp++; + if( m_txrp >= TNC_TXBUFSIZE ){ + m_txrp = 0; + } + m_txcnt--; + } + } + ::Sleep(1); + } + else if( m_rxcnt < (TNC_RXBUFSIZE/2) ){ + int len = RecvLen(); + if( len ){ + BYTE bf[256]; + if( len >= (int)sizeof(bf) ) len = sizeof(bf); + if( len && (m_rxcnt < int(sizeof(m_rxbuf) - len)) ){ + int size = IORead(bf, len); + for( int i = 0; i < size; i++ ){ + PutRxFifo(bf[i]); + } + if( m_wHnd != NULL ){ + PostMessage( m_wHnd, m_ID, MMTMSG_NULL, 0); + } + } + } + ::Sleep(((TNC.Type != 2) || m_pMMT) ? 10 : 1); + } + else { + ::Sleep(10); + } + if( (TNC.Type == 2) && !m_pMMT ){ + BOOL tx = GetPTT(); + if( (tx != m_PTT) && (tx || !m_rxcnt) ){ + m_PTT = tx; + PostMessage(m_wHnd, m_ID, MMTMSG_NULL, 0); + } + ::Sleep(1); + } + } + else { + ::Sleep(20); + } + } +} + +//--------------------------------------------------------------------------- +/*#$% +============================================================== + ’ÊM‰ñü‚ðƒI[ƒvƒ“‚µƒXƒŒƒbƒh‚ðƒAƒNƒeƒBƒu‚É‚·‚é +-------------------------------------------------------------- +PortName : ‰ñü‚Ì–¼‘O +pCP : COMMPARA‚̃|ƒCƒ“ƒ^iƒkƒ‹‚ÌŽž‚̓fƒtƒHƒ‹ƒg‚ʼnŠú‰»j +pWnd : ƒƒbƒZ[ƒW‘—Mæ‚̃EƒCƒ“ƒhƒEƒNƒ‰ƒX‚̃|ƒCƒ“ƒ^iƒkƒ‹‚ÌŽž‚ÍÒ²ÝÌڰѳ²ÝÄÞ³j +nID : ƒf[ƒ^ŽóMŽž‚̃ƒbƒZ[ƒW‚h‚c +RBufSize : ŽóMƒoƒbƒtƒ@‚̃TƒCƒY(default=2048) +TBufSize : ‘—Mƒoƒbƒtƒ@‚̃TƒCƒY(default=2048) +-------------------------------------------------------------- +TRUE/FALSE +-------------------------------------------------------------- +============================================================== +*/ +BOOL __fastcall CCtnc::Open(CTNCPARA *cp, HWND hwnd, UINT nID, COMMPARA *pp) +{ + if( m_CreateON == TRUE ) Close(); + m_TxAbort = FALSE; + m_wHnd = hwnd; + m_ID = nID; + m_fHnd = ::CreateFile(cp->StrPort, GENERIC_READ | GENERIC_WRITE, + 0, NULL, + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, + NULL + ); + if( m_fHnd == INVALID_HANDLE_VALUE ) goto _mmt; + // setup device buffers + if( ::SetupComm( m_fHnd, DWORD(TNC_COMBUFSIZE), DWORD(TNC_COMBUFSIZE) ) == FALSE ){ + ::CloseHandle(m_fHnd); +_mmt:; + m_pMMT = new CMMTnc; + if( m_pMMT->Open(cp->StrPort, m_wHnd, m_ID) ){ + m_CreateON = TRUE; + Priority = tpLower; + Resume(); // ƒXƒŒƒbƒh‚ÌŽÀs + return TRUE; + } + else { + delete m_pMMT; + m_pMMT = NULL; + return FALSE; + } + } + + // purge any information in the buffer + ::PurgeComm( m_fHnd, PURGE_TXABORT | PURGE_RXABORT | PURGE_TXCLEAR | PURGE_RXCLEAR ); + + // set up for overlapped I/O + COMMTIMEOUTS TimeOut; + + TimeOut.ReadIntervalTimeout = 0xffffffff; + TimeOut.ReadTotalTimeoutMultiplier = 0; + TimeOut.ReadTotalTimeoutConstant = 0; + TimeOut.WriteTotalTimeoutMultiplier = 0; + TimeOut.WriteTotalTimeoutConstant = 20000; +// TimeOut.WriteTotalTimeoutConstant = 1; + if( !::SetCommTimeouts( m_fHnd, &TimeOut ) ){ + ::CloseHandle( m_fHnd ); + return FALSE; + } + ::GetCommState( m_fHnd, &m_dcb ); + m_dcb.fBinary = TRUE; + const UCHAR _tp[]={NOPARITY, EVENPARITY, ODDPARITY}; + const UCHAR _ts[]={ONESTOPBIT,TWOSTOPBITS}; + if( TNC.Type == 2 ){ + memcpy(&cm, pp, sizeof(cm)); + m_dcb.BaudRate = pp->Baud; + m_dcb.ByteSize = WORD(pp->BitLen); + m_dcb.Parity = WORD(pp->Parity); + m_dcb.StopBits = WORD(pp->Stop); + m_dcb.fOutxCtsFlow = FALSE; + m_dcb.fInX = m_dcb.fOutX = FALSE; + } + else { + m_dcb.BaudRate = cp->BaudRate; + m_dcb.ByteSize = USHORT(cp->BitLen ? 8 : 7); + m_dcb.Parity = _tp[cp->Parity]; + m_dcb.StopBits = _ts[cp->Stop]; + m_dcb.fOutxCtsFlow = cp->flwCTS ? TRUE : FALSE; + m_dcb.fInX = m_dcb.fOutX = cp->flwXON ? TRUE : FALSE; + } + m_dcb.fRtsControl = RTS_CONTROL_ENABLE; + m_dcb.XonChar = 0x11; + m_dcb.XoffChar = 0x13; + m_dcb.fParity = FALSE; + m_dcb.EvtChar = 0x00; // dummy setting +// m_dcb.fTXContinueOnXoff = TRUE; + m_dcb.XonLim = USHORT(TNC_COMBUFSIZE/4); // 1/4 of RBufSize + m_dcb.XoffLim = USHORT(TNC_COMBUFSIZE*3/4); // 3/4 of RBufSize + m_dcb.DCBlength = sizeof( DCB ); + if( !::SetCommState( m_fHnd, &m_dcb ) ){ + ::CloseHandle( m_fHnd ); + return FALSE; + } + // get any early notifications + if( !::SetCommMask( m_fHnd, EV_RXFLAG ) ){ + ::CloseHandle(m_fHnd); + return FALSE; + } + m_CreateON = TRUE; + Priority = tpLower; + Resume(); // ƒXƒŒƒbƒh‚ÌŽÀs + return TRUE; +} +/*#$% +============================================================== + ’ÊM‰ñü‚ðƒNƒ[ƒY‚·‚é +-------------------------------------------------------------- +-------------------------------------------------------------- +-------------------------------------------------------------- + ƒXƒŒƒbƒh‚ªI—¹‚·‚é‚܂ő҂ +============================================================== +*/ +void __fastcall CCtnc::Close(void) +{ + if( m_CreateON == TRUE ){ + if( m_ID ){ + m_Command = CTNC_CLOSE; // ƒXƒŒƒbƒhI—¹ƒRƒ}ƒ“ƒh + Priority = tpNormal; //ƒXƒŒƒbƒh‚Í’Êí‚Ì—Dæ“x‚Å‚ ‚é + WaitFor(); + } + if( m_pMMT ){ + delete m_pMMT; + m_pMMT = NULL; + } + else { + ::CloseHandle(m_fHnd); + } + m_CreateON = FALSE; + } + m_TxAbort = TRUE; +} +void __fastcall CCtnc::ReqClose(void) +{ + if( m_CreateON == TRUE ){ + if( m_ID ){ + m_Command = CTNC_CLOSE; // ƒXƒŒƒbƒhI—¹ƒRƒ}ƒ“ƒh + Priority = tpNormal; //ƒXƒŒƒbƒh‚Í’Êí‚Ì—Dæ“x‚Å‚ ‚é + } + } +} +void __fastcall CCtnc::WaitClose(void) +{ + if( m_CreateON == TRUE ){ + if( m_ID && m_Command ){ + WaitFor(); + } + if( m_pMMT ){ + delete m_pMMT; + m_pMMT = NULL; + } + else { + ::CloseHandle(m_fHnd); + } + m_CreateON = FALSE; + } + m_TxAbort = TRUE; +} +//---------------------------------------------------------------------- +BOOL __fastcall CCtnc::GetPTT(void) +{ + DWORD d = 0; + BOOL tx = FALSE; + if( !m_pMMT ){ + if( ::GetCommModemStatus(m_fHnd, &d) ){ + tx = (d & MS_CTS_ON) != 0; + } + } + return tx; +} +/*#$% +============================================================== + ŽóMƒoƒbƒtƒ@“à‚ÌŠi”[ƒf[ƒ^’·‚𓾂é +-------------------------------------------------------------- +-------------------------------------------------------------- + ƒf[ƒ^‚Ì’·‚³ +-------------------------------------------------------------- +============================================================== +*/ +DWORD __fastcall CCtnc::RecvLen(void) +{ + if( m_pMMT ){ + return m_pMMT->GetRxLen(); + } + else { + COMSTAT ComStat; + DWORD dwErrorFlags; + + ::ClearCommError( m_fHnd, &dwErrorFlags, &ComStat ); + return ComStat.cbInQue; + } +} + +/*#$% +============================================================== + ‘—MƒrƒW[‚©‚Ç‚¤‚©’²‚ׂé +-------------------------------------------------------------- +-------------------------------------------------------------- +TRUE : ‘—MƒrƒW[ó‘Ô +-------------------------------------------------------------- +============================================================== +*/ +int __fastcall CCtnc::TxBusy(void) +{ + if( m_pMMT ){ + return m_pMMT->IsTxBusy(); + } + else { + COMSTAT ComStat; + DWORD dwErrorFlags; + + ::ClearCommError( m_fHnd, &dwErrorFlags, &ComStat ); + return ComStat.cbOutQue; + } +} + +/*#$% +============================================================== + ’ÊM‰ñü‚©‚çƒf[ƒ^‚ðŽæ‚èo‚· +-------------------------------------------------------------- +p : ƒoƒbƒtƒ@‚̃|ƒCƒ“ƒ^ +len : ƒoƒbƒtƒ@‚̃TƒCƒY +-------------------------------------------------------------- +ŽÀÛ‚ÉŽóM‚µ‚½ƒTƒCƒY +-------------------------------------------------------------- +============================================================== +*/ +int __fastcall CCtnc::IORead(BYTE *p, DWORD len) +{ + DWORD size=0; + + if( m_CreateON == TRUE ){ + if( m_pMMT ){ + for( ; len; len--, size++ ){ + *p++ = m_pMMT->GetChar(); + } + } + else { + ::ReadFile( m_fHnd, p, len, &size, NULL ); + } + } + return size; +} +int __fastcall CCtnc::IOPutChar(BYTE c) +{ + DWORD size=0; + + if( m_CreateON == TRUE ){ + if( m_pMMT ){ + m_pMMT->PutChar(c); + size = 1; + } + else { + ::WriteFile( m_fHnd, &c, 1, &size, NULL ); + } + } + return size; +} + +/*#$% +============================================================== + ’ÊM‰ñü‚Ƀf[ƒ^‚ð‘—M‚·‚é +-------------------------------------------------------------- +-------------------------------------------------------------- +-------------------------------------------------------------- +============================================================== +*/ +void __fastcall CCtnc::PutChar(char c) +{ + if( m_CreateON == TRUE ){ + if( m_txcnt < TNC_TXBUFSIZE ){ + m_txbuf[m_txwp] = c; + m_txwp++; + if( m_txwp >= TNC_TXBUFSIZE ) m_txwp = 0; + m_txcnt++; + } + } +} + +/*#$% +============================================================== + ’ÊM‰ñü‚Ƀf[ƒ^‚ð‘—M‚·‚é +-------------------------------------------------------------- +p : ƒoƒbƒtƒ@‚̃|ƒCƒ“ƒ^ +len : ‘—M‚·‚éƒTƒCƒY +-------------------------------------------------------------- +ŽÀÛ‚É‘—M‚µ‚½ƒTƒCƒY +-------------------------------------------------------------- +============================================================== +*/ +void __fastcall CCtnc::Write(void *s, DWORD len) +{ + if( m_CreateON == TRUE ){ + char *p; + for( p = (char *)s; len; len--, p++ ){ + PutChar(*p); + } + } +} + +/*#$% +============================================================== + ’ÊM‰ñü‚Ƀf[ƒ^‚ð‘—M‚·‚é +-------------------------------------------------------------- +p : ƒoƒbƒtƒ@‚̃|ƒCƒ“ƒ^ +len : ‘—M‚·‚éƒTƒCƒY +-------------------------------------------------------------- +ŽÀÛ‚É‘—M‚µ‚½ƒTƒCƒY +-------------------------------------------------------------- +============================================================== +*/ +void CCtnc::OutStr(LPCSTR fmt, ...) +{ + va_list pp; + char bf[1024]; + + va_start(pp, fmt); + vsprintf( bf, fmt, pp ); + va_end(pp); + Write(bf, strlen(bf)); +} + +void CCtnc::OutLine(LPCSTR fmt, ...) +{ + va_list pp; + char bf[1024]; + + va_start(pp, fmt); + vsprintf( bf, fmt, pp ); + va_end(pp); + Write(bf, strlen(bf)); + char r[] = "\r"; + Write( r, 1 ); + //Write("\r", 1); +} +//--------------------------------------------------------------------------- +void __fastcall CCtnc::SetPTT(int tx) +{ + if( m_pMMT ) m_pMMT->SetPTT(tx); +} +//--------------------------------------------------------------------------- +void __fastcall CCtnc::NotifyFreq(LONG mark, LONG space) +{ + if( m_pMMT ){ + m_pMMT->m_NMMT.m_markfreq = mark; + m_pMMT->m_NMMT.m_spacefreq = space; + } +} +//--------------------------------------------------------------------------- +void __fastcall CCtnc::NotifyLevel(LONG sq, LONG lvl) +{ + if( m_pMMT ){ + m_pMMT->m_NMMT.m_sqlevel = sq; + m_pMMT->m_NMMT.m_siglevel = lvl; + } +} +//============================================================================== +// CMMTnc ƒJƒXƒ^ƒ€TNCƒGƒ~ƒ…ƒŒ[ƒVƒ‡ƒ“ +//============================================================================== +//--------------------------------------------------------------------------- +__fastcall CMMTnc::CMMTnc(void) +{ + m_hLib = NULL; + memset(&m_NMMT, 0, sizeof(m_NMMT)); + m_NMMT.m_sampfreq = SampFreq; + m_NMMT.m_demfreq = DemSamp; + m_QueryResult = 0; +} +//--------------------------------------------------------------------------- +__fastcall CMMTnc::~CMMTnc() +{ + Close(); +} +//--------------------------------------------------------------------------- +void __fastcall CMMTnc::FreeLib(void) +{ + if( m_hLib ){ + FreeLibrary(m_hLib); + m_hLib = NULL; + } +} +//--------------------------------------------------------------------------- +FARPROC __fastcall CMMTnc::GetProc(LPCSTR pName) +{ + if( !m_hLib ) return NULL; + + FARPROC fn = ::GetProcAddress(m_hLib, pName+1); + if( fn == NULL ){ + fn = ::GetProcAddress(m_hLib, pName); + if( fn == NULL ) FreeLib(); + } + return fn; +} +//--------------------------------------------------------------------------- +void __fastcall CMMTnc::Close(void) +{ + if( IsLib() ){ + fmmtClose(); + FreeLib(); + } +} +//--------------------------------------------------------------------------- +BOOL __fastcall CMMTnc::Open(LPCSTR pItemName, HWND hWnd, UINT uMsg) +{ + Close(); + + m_ItemName = pItemName; + char LibName[MAX_PATH]; + if( !*GetEXT(pItemName) ){ + sprintf(LibName, "%s.mmt", pItemName); + pItemName = LibName; + } + m_hLib = ::LoadLibrary(pItemName); + if( m_hLib ){ + + fmmtQueryTnc = PROC(mmtQueryTnc); + fmmtOpen = PROC(mmtOpen); + fmmtClose = PROC(mmtClose); + fmmtSetPTT = PROC(mmtSetPTT); + fmmtPutChar = PROC(mmtPutChar); + fmmtGetChar = PROC(mmtGetChar); + fmmtIsTxBusy = PROC(mmtIsTxBusy); + fmmtGetRxLen = PROC(mmtGetRxLen); + fmmtNotify = PROC(mmtNotify); + fmmtNotifyFFT = PROC(mmtNotifyFFT); + fmmtNotifyXY = PROC(mmtNotifyXY); + + if( m_hLib ){ + m_QueryResult = fmmtQueryTnc((LPLONG)&TNC.Type, (LPLONG)&TNC.Echo); + if( !fmmtOpen(hWnd, uMsg, TNC.Type) ){ + FreeLib(); + } + } + } + return IsLib(); +} +//--------------------------------------------------------------------------- +void __fastcall CMMTnc::SetPTT(int ptt) +{ + if( !IsLib() ) return; + fmmtSetPTT(ptt); +} +//--------------------------------------------------------------------------- +void __fastcall CMMTnc::PutChar(BYTE c) +{ + if( !IsLib() ) return; + fmmtPutChar(c); +} +//--------------------------------------------------------------------------- +BYTE __fastcall CMMTnc::GetChar(void) +{ + if( !IsLib() ) return 0; + return fmmtGetChar(); +} +//--------------------------------------------------------------------------- +BOOL __fastcall CMMTnc::IsTxBusy(void) +{ + if( !IsLib() ) return FALSE; + return fmmtIsTxBusy(); +} +//--------------------------------------------------------------------------- +LONG __fastcall CMMTnc::GetRxLen(void) +{ + if( !IsLib() ) return 0; + return fmmtGetRxLen(); +} +//--------------------------------------------------------------------------- +void __fastcall CMMTnc::Notify(void) +{ + if( !IsLib() ) return; + if( m_QueryResult & ntNOTIFY ) fmmtNotify(&m_NMMT); +} +//--------------------------------------------------------------------------- +void __fastcall CMMTnc::NotifyFFT(const int *pFFT) +{ + if( !IsLib() ) return; + if( m_QueryResult & ntNOTIFYFFT ) fmmtNotifyFFT(pFFT, FFT_SIZE, SampFreq); +} +//--------------------------------------------------------------------------- +void __fastcall CMMTnc::NotifyXY(const double *pX, const double *pY) +{ + if( !IsLib() ) return; + if( !(m_QueryResult & ntNOTIFYXY) ) return; + + LPLONG px = m_XY; + LPLONG py = &m_XY[XYCOLLECT]; + for( int i = 0; i < XYCOLLECT; i++ ){ + *px++ = LONG(*pX++); + *py++ = LONG(*pY++); + } + fmmtNotifyXY(m_XY); +} +//--------------------------------------------------------------------------- diff --git a/ctnc.h b/ctnc.h new file mode 100644 index 0000000..1bcdbbf --- /dev/null +++ b/ctnc.h @@ -0,0 +1,325 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +///---------------------------------------------------------- +/// TNCƒVƒ~ƒ…ƒŒ[ƒVƒ‡ƒ“ƒNƒ‰ƒX +/// +/// (C) JE3HHT Makoto.Mori +/// +//--------------------------------------------------------------------------- +#ifndef CtncH +#define CtncH +#include "ComLib.h" +#include "comm.h" +#include "Mmlink.h" +//--------------------------------------------------------------------------- +#include +typedef struct { + int change; + + char StrPort[32]; // ƒ|[ƒg‚Ì–¼‘O + int BaudRate; // ƒ{[ƒŒ[ƒg + int BitLen; // 0-7Bit, 1-8Bit + int Stop; // 0-1Bit, 1-2Bit + int Parity; // 0-PN, 1-PE, 2-PO + int flwXON; // Xon/Xoff ON + int flwCTS; // CTS-RTS ON + + int Echo; + int Type; // 0-TNC241, 2-KAM + int TncMode; // 0-Message, 1-Cmd, 2-TTy +}CTNCPARA; +extern CTNCPARA TNC; +//--------------------------------------------------------------------------- +enum { + TNC_PTTON = 0x00f0, + TNC_PTTOFF, + TNC_PTTFLUSH, + TNC_CLEARBUF, + TNC_AFCON, + TNC_AFCOFF, + TNC_NETON, + TNC_NETOFF, + TNC_REVON, + TNC_REVOFF, + TNC_HAM, + TNC_ECHOON, + TNC_ECHOOFF, + TNC_CANCELPTTFLUSH, +}; +enum { + MMTMSG_NULL, + MMTMSG_CHAR, + MMTMSG_PTT, + MMTMSG_COMMON, + MMTMSG_CLEARFIFO, + MMTMSG_SETSWITCH, + MMTMSG_SETVIEW, + MMTMSG_CHARTXW, + MMTMSG_WRITETXW, + MMTMSG_SETFREQ, + MMTMSG_SETBAUD, + MMTMSG_SETSQ, + MMTMSG_SETNOTCH, + MMTMSG_SETDEFFREQ, + MMTMSG_SETPTTTIMER, + MMTMSG_SETTNCTYPE, + MMTMSG_SETPRIORITY, + MMTMSG_SETLENGTH, + MMTMSG_SETRESO, + MMTMSG_SETLPF, + MMTMSG_GETPROFILENAME, + MMTMSG_LOADPROFILE, + MMTMSG_SAVEPROFILE, +}; +#pragma pack(push, 1) +typedef struct { + DWORD m_markfreq; + DWORD m_spacefreq; + DWORD m_siglevel; + DWORD m_sqlevel; + DWORD m_txbuflen; + DWORD m_codeswitch; + DWORD m_codeview; + DWORD m_notch1; + DWORD m_notch2; + DWORD m_baud; + DWORD m_bitlength; + DWORD m_txwlen; + DWORD m_sampfreq; + DWORD m_demfreq; + DWORD m_radiofreq; + DWORD m_modetnc; + DWORD m_fig; + DWORD m_defmark; + DWORD m_defshift; + DWORD m_Reserved[45]; +}NMMT; +#pragma pack(pop) +typedef DWORD (__stdcall *tmmtQueryTnc)(LPLONG pType, LPLONG pEcho); +typedef BOOL (__stdcall *tmmtOpen)(HWND hWnd, UINT uMsg, LONG type); +typedef void (__stdcall *tmmtClose)(void); +typedef void (__stdcall *tmmtSetPTT)(LONG tx); +typedef BOOL (__stdcall *tmmtIsTxBusy)(void); +typedef void (__stdcall *tmmtPutChar)(BYTE c); +typedef LONG (__stdcall *tmmtGetRxLen)(void); +typedef BYTE (__stdcall *tmmtGetChar)(void); +typedef void (__stdcall *tmmtNotify)(NMMT *pNMMT); +typedef void (__stdcall *tmmtNotifyFFT)(const int *pFFT, LONG size, LONG sampfreq); +typedef void (__stdcall *tmmtNotifyXY)(const LONG *pXY); +#define ntNOTIFY 1 +#define ntNOTIFYFFT 2 +#define ntNOTIFYXY 4 +class CMMTnc +{ +private: + AnsiString m_ItemName; + + DWORD m_QueryResult; + //HANDLE m_hLib; + HINSTANCE m_hLib; + LONG m_XY[XYCOLLECT*2]; +public: + NMMT m_NMMT; +private: + tmmtQueryTnc fmmtQueryTnc; + tmmtOpen fmmtOpen; + tmmtClose fmmtClose; + tmmtSetPTT fmmtSetPTT; + tmmtIsTxBusy fmmtIsTxBusy; + tmmtPutChar fmmtPutChar; + tmmtGetRxLen fmmtGetRxLen; + tmmtGetChar fmmtGetChar; + tmmtNotify fmmtNotify; + tmmtNotifyFFT fmmtNotifyFFT; + tmmtNotifyXY fmmtNotifyXY; + +private: + void __fastcall FreeLib(void); + FARPROC __fastcall GetProc(LPCSTR pName); +public: + __fastcall CMMTnc(void); + __fastcall ~CMMTnc(); +public: + BOOL __fastcall Open(LPCSTR pLibName, HWND hWnd, UINT uMsg); + void __fastcall Close(void); + inline BOOL __fastcall IsLib(void){ return (m_hLib != NULL);}; + inline LPCSTR __fastcall GetItemName(void){return m_ItemName.c_str();}; + + void __fastcall SetPTT(int ptt); + void __fastcall PutChar(BYTE c); + BYTE __fastcall GetChar(void); + BOOL __fastcall IsTxBusy(void); + LONG __fastcall GetRxLen(void); + void __fastcall Notify(); + void __fastcall NotifyFFT(const int *pFFT); + void __fastcall NotifyXY(const double *pX, const double *pY); +}; + +//--------------------------------------------------------------------------- +void LoadTNCSetup(TMemIniFile *pIniFile); +void SaveTNCSetup(TMemIniFile *pIniFile); +//#define CR 0x0d +//#define LF 0x0a +#define CTNC_CLOSE 1 +#define TNC_COMBUFSIZE 4096 +#define TNC_TXBUFSIZE 1024 +#define TNC_RXBUFSIZE 1024 +class CCtnc : public TThread +{ +public: + BOOL m_CreateON; // ƒNƒŠƒGƒCƒgƒtƒ‰ƒO + DCB m_dcb; // ‚c‚b‚a + HANDLE m_fHnd; // ƒtƒ@ƒCƒ‹ƒnƒ“ƒhƒ‹ + HWND m_wHnd; // e‚̃EƒCƒ“ƒhƒEƒnƒ“ƒhƒ‹ + UINT m_ID; // ƒƒbƒZ[ƒW‚Ì‚h‚c”Ô† + volatile int m_Command; // ƒXƒŒƒbƒh‚ւ̃Rƒ}ƒ“ƒh + BOOL m_TxAbort; // ‘—M’†Ž~ƒtƒ‰ƒO + AnsiString Name; + + char m_txbuf[TNC_TXBUFSIZE]; + int m_txcnt; + int m_txwp; + int m_txrp; + int m_timeout; + + char m_rxbuf[TNC_RXBUFSIZE]; + int m_rxcnt; + int m_rxwp; + int m_rxrp; + + CMMTnc *m_pMMT; + + COMMPARA cm; + BOOL m_PTT; +protected: + void virtual __fastcall Execute(); +public: + __fastcall CCtnc(bool CreateSuspended); + __fastcall ~CCtnc(){ + Close(); + }; + inline BOOL IsOpen(void){ + return m_CreateON; + }; + inline void UpdateHandle(HWND hwnd){ + m_wHnd = hwnd; + }; + BOOL __fastcall Open(CTNCPARA *cp, HWND hwnd, UINT nID, COMMPARA *pp); + void __fastcall Close(void); + void __fastcall ReqClose(void); + void __fastcall WaitClose(void); + BOOL __fastcall GetPTT(void); + DWORD __fastcall RecvLen(void); + int __fastcall TxBusy(void); + int __fastcall IORead(BYTE *p, DWORD len); + int __fastcall IOPutChar(BYTE c); + + void __fastcall ClearRxFifo(void); + void __fastcall ClearTxFifo(void); + BOOL __fastcall PutRxFifo(BYTE c); + void __fastcall Write(void *p, DWORD len); + void __fastcall PutChar(char c); + void OutStr(LPCSTR fmt, ...); + void OutLine(LPCSTR fmt, ...); + + void __fastcall NotifyFreq(LONG mark, LONG space); + void __fastcall SetPTT(int tx); + inline BOOL IsMMT(void){return m_pMMT!=NULL;}; + NMMT* __fastcall GetNMMT(void){return &m_pMMT->m_NMMT;}; + void __fastcall NotifyLevel(LONG sq, LONG lvl); + inline void __fastcall Notify(void){ + if( m_pMMT ) m_pMMT->Notify(); + } + inline void __fastcall NotifyFFT(const int *pFFT){ + if( m_pMMT ) m_pMMT->NotifyFFT(pFFT); + } + inline void __fastcall NotifyXY(const double *pX, const double *pY){ + if( m_pMMT ) m_pMMT->NotifyXY(pX, pY); + } +}; + +void InitTNCPara(void); + +///--------------------------------------------------------- +/// ƒeƒLƒXƒg•¶Žš—ñ‚e‚h‚e‚n +class CTextFifo +{ +private: + LPSTR bp, wp, rp; + int Cnt; + int Max; + int Line; +public: + inline CTextFifo(int max = TNC_COMBUFSIZE){ + Max = max; + bp = new char[Max]; + wp = rp = bp; + Cnt = 0; + Line = 0; + }; + inline ~CTextFifo(){ + delete[] bp; + }; + inline void WriteChar(char c){ + if( Cnt < Max ){ + if( c != LF ){ + *wp = c; + wp++; + if( wp >= (bp+Max) ){ + wp = bp; + } + Cnt++; + } + if( c == CR ){ + Line++; + } + } + } + inline void WriteString(LPCSTR sp){ + for( ; *sp; sp++ ){ + WriteChar(*sp); + } + }; + inline int GetLine(void){ + return Line; + }; + inline int LoadText(LPSTR tp, int len){ + if( !Line ) return FALSE; + while(1){ + char c = *rp; + rp++; + if( rp >= (bp+Max) ) rp = bp; + Cnt--; + + if( c == CR ){ + *tp = 0; + Line--; + break; + } + else if( (len - 1) > 0 ){ + *tp++ = c; + len--; + } + } + return TRUE; + }; +}; +#endif + diff --git a/digital.txt b/digital.txt new file mode 100644 index 0000000..97a65e8 --- /dev/null +++ b/digital.txt @@ -0,0 +1,365 @@ +MMTTY‚̃fƒWƒ^ƒ‹M†ˆ— + + ‰”Å 2000.07.18 JE3HHT X ½ + ‰ü’è 2000.10.19 JE3HHT X ½ + + +@MMTTY‚ÅŽg‚Á‚Ä‚¢‚éŠeM†ˆ—‚ɂ‚¢‚ÄŠÈ’P‚ɉðà‚µ‚Ü‚·B + + +FIRƒtƒBƒ‹ƒ^ +~~~~~~~~~~~~~ + FIR(Finite Impulse Response)ƒtƒBƒ‹ƒ^‚̓fƒWƒ^ƒ‹M†ˆ—‚ÌÅ‚àŠî–{‚ƂȂéƒtƒBƒ‹ƒ^‚ÅAˆê’èŠÔŠu‚ŃTƒ“ƒvƒŠƒ“ƒO‚³‚ꂽ‰ß‹Ž‚̃f[ƒ^‚ÆA‚ ‚éŒvŽZ‚©‚瓾‚ç‚ꂽŒW”‚ð‚»‚ê‚¼‚êŠ|‚¯‡‚킹A‚·‚ׂĂ̑˜a‚𓾂鎖‚É‚æ‚èŽÀŒ»‚Å‚«‚Ü‚·B + +In@--> Z-1 --> Z-1 --> Z-1 --- EEEE Z-1 -- + | | | | + H0 H1 H2 EEEE Hn + | | | | + ------> + ----> + ---------------------> + ----> Out + + uZ-1v‚Í’x‰„Ší‚ð•\‚µA‚±‚ꂪ˜A‘±‚µ‚ăgƒRƒƒeƒ“‚̂悤‚É•À‚ñ‚Å‚¢‚Ü‚·BuH0v`uHnv‚Í‚»‚ꂼ‚ê‚ÌŠ|‚¯‡‚킹‚éŒW”‚ð•\‚µ‚Ü‚·B +@‚±‚̂悤‚ÈŒvŽZ‚ð‚½‚½‚Ýž‚݉‰ŽZiMAC‰‰ŽZj‚ƌĂт܂·B + +@—Ⴆ‚ΉߋŽ10“_‚̃Tƒ“ƒvƒŠƒ“ƒOƒf[ƒ^‚ÉA‚·‚ׂ睂¶ŒW”0.1‚ðŠ|‚¯‡‚킹‚»‚ê‚ð‡Œv‚·‚ê‚ÎA‚»‚ê‚Í10“_‚É‚¨‚¯‚镽‹Ï’l‚ð‹‚߂Ă¢‚邱‚ƂɂȂèAŒ‹‰Ê‚Æ‚µ‚ăXƒ€[ƒWƒ“ƒO‚³‚ꂽLPF‚Æ‚µ‚Ä“­‚­‚±‚ƂɂȂè‚Ü‚·B + +@‚±‚ÌŒW”H0`Hn‚Ì‚»‚ꂼ‚ê‚ÉA‚ ‚é“Á«‚©‚犄‚èo‚³‚ê‚é’liŠó–]‚·‚éŽü”g”“Á«‚̃Cƒ“ƒpƒ‹ƒX‰ž“šj‚ð—^‚¦‚邯A”CˆÓ‚̃tƒBƒ‹ƒ^‚Æ‚µ‚Ä“­‚©‚¹‚鎖‚ª‚Å‚«‚Ü‚·B + +@FIRƒtƒBƒ‹ƒ^‚Í‚»‚Ì–¼‘O‚Ì’Ê‚èƒCƒ“ƒpƒ‹ƒX‰ž“š‚ª—LŒÀŽžŠÔ‚ÅI—¹‚µ‚Ü‚·‚̂Ŕ­U‚É”Y‚Ü‚³‚ê‚éS”z‚ª‚ ‚è‚Ü‚¹‚ñB‚Ü‚½ŒW”‚ð‘ÎÛ«‚É‚·‚éiH0=Hn, H1=Hn-1,¥¥¥j‚±‚Ƃɂæ‚èA’¼üˆÊ‘Š“Á«‚ɂȂèA‚»‚ꂪ‚±‚̃tƒBƒ‹ƒ^‚ÌÅ‘å‚Ì“Á’·‚Å‚à‚ ‚è‚Ü‚·Bˆê•û‰s‚¢“Á«‚𓾂悤‚Æ‚·‚é‚ÆŽŸ”‚ð‘å‚«‚­‚·‚é•K—v‚ª‚ ‚èA‰ž“š‚ª’x‰„‚·‚邯‚¢‚¤Œ‡“_‚ðŽ‚¿‡‚킹‚Ä‚¢‚Ü‚·B + +@ƒfƒWƒ^ƒ‹M†ˆ—‚̃tƒBƒ‹ƒ^‚ÆŒ¾‚¦‚ÎA‚Ü‚¸‚±‚ÌFIRƒtƒBƒ‹ƒ^‚ÌŽ–‚ðŽw‚·‚ÆŽv‚Á‚Ä‚àŠÔˆá‚¢‚È‚¢‚®‚ç‚¢‚É—Ç‚­Žg‚í‚ê‚Ä‚¢‚Ü‚·B + + +IIRƒtƒBƒ‹ƒ^ +~~~~~~~~~~~~~ +@IIR(Infinite Impulse Response)ƒtƒBƒ‹ƒ^‚͈ȉº‚ÉŽ¦‚·‚悤‚É‹AŠÒ‰ñ˜H‚ª‚ ‚èA‚»‚Ì–¼‘O‚Ì’Ê‚èƒCƒ“ƒpƒ‹ƒX‰ž“š‚ª–³ŒÀ‚É‘±‚«‚Ü‚·B‚»‚Ì“®ì‚̓AƒiƒƒO‰ñ˜H‚ÌLCƒtƒBƒ‹ƒ^‚âƒAƒNƒeƒBƒuƒtƒBƒ‹ƒ^‚ȂǂƓ¯‚¶‚Å‚·‚Ì‚ÅA‚±‚¿‚ç‚̂ق¤‚ªOM‚³‚ñ‚ɂ͓éõ‚݂₷‚¢‚©‚à’m‚ê‚Ü‚¹‚ñB + + +In -----+---------------> b0 --+------ Out + | | | + + <- a1 <- Z-1 -> b1 ->+ + | | | + + <- a2 <- Z-2 -> b2 ->+ + +@IIRƒtƒBƒ‹ƒ^‚ÌÝŒv‚ÍA‚Ü‚¸Šó–]‚·‚éŽü”g”“Á«‚̃AƒiƒƒOƒtƒBƒ‹ƒ^‚ðÝŒv‚µA‚»‚ê‚ðƒfƒWƒ^ƒ‹ƒtƒBƒ‹ƒ^‚ÌŒW”‚ɕϊ·‚·‚é•û–@‚ª—Ç‚­Žæ‚ç‚ê‚Ü‚·B‚±‚Ì•û–@‚ł̓AƒiƒƒOƒtƒBƒ‹ƒ^‚Æ“¯—lAƒoƒ^[ƒ[ƒX“Á«‚âƒ`ƒFƒrƒVƒt“Á«‚ðŽ‚½‚¹‚邱‚Æ‚ª‚Å‚«‚Ü‚·B + +@IIRƒtƒBƒ‹ƒ^‚ÌÅ‘å‚Ì“Á’·‚Í­‚È‚¢ŽŸ”‚ʼns‚¢“Á«‚̃tƒBƒ‹ƒ^‚ð쬂ł«‚é“_‚Å‚·B‚Ü‚½‰ž“š’x‚ꂪ­‚È‚¢iŬˆÊ‘ŠjƒVƒXƒeƒ€‚ð\¬‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B +@ˆê•ûˆÊ‘Š“Á«‚Í•½’R‚ł͂Ȃ­AƒAƒiƒƒOƒtƒBƒ‹ƒ^‚Æ“¯—l‚ÌŒQ’x‰„˜c‚Ý‚ª‚ ‚èA‚Ü‚½ŒW”—ÊŽq‰»Œë·iŒvŽZ‹@‚̌꒷§ŒÀ‚É‚æ‚éŠÛ‚ߌë·j‚≉ŽZŒë·iæŽZ‚Ìۂ̌꒷§ŒÀ‚É‚æ‚éŠÛ‚ߌë·j‚̉e‹¿‚ðŽó‚¯‚â‚·‚¢‚Æ‚¢‚¤Œ‡“_‚ðŽ‚¿‡‚킹‚Ä‚¢‚Ü‚·‚Ì‚ÅAŒÅ’謔“_‰‰ŽZ‚̃fƒWƒ^ƒ‹M†ˆ—‚Å‚ÍAIIRƒtƒBƒ‹ƒ^‚Í‚ ‚Ü‚èŽg‚í‚ê‚Ü‚¹‚ñB + + +IIRŒ^‹¤UŠí +~~~~~~~~~~~~~ +@IIRƒtƒBƒ‹ƒ^‚̈êŽí‚Æ‚µ‚ĉº‹L‚̂悤‚È‹¤UŠí‚ð\¬‚Å‚«‚Ü‚·BMMTTY‚ÌŽü”g”•Ù•ÊŠí‚Ì‚P‚‚͂±‚ê‚ðŽg—p‚µ‚Ä‚¢‚Ü‚·B + +In --- b --+---------------------- Out + | | + + <- a1 <- Z-1 + | | + + <- a2 <- Z-2 + +@‚»‚ꂼ‚ê‚ÌŒW”‚ÍA + + a1 = 2‚…‚˜‚(-ƒÎBT)E‚ƒ‚‚“(2ƒÎFT) + a2 = -‚…‚˜‚(-2ƒÎBT) + b = AE‚“‚‰‚Ž(2ƒÎFT) + + F:‹¤UŽü”g”(Hz) + B:Žü”g”‘шæ•(Hz) + T:ƒTƒ“ƒvƒŠƒ“ƒOŠÔŠu(s) = 1/fs + A:ƒQƒCƒ“ + +‚ÅŠÈ’P‚É‹‚߂邱‚Æ‚ª‚Å‚«AIIRƒtƒBƒ‹ƒ^‚ðÝŒv‚·‚éꇂ̂悤‚È‚â‚₱‚µ‚¢ŒvŽZ‚à•s—v‚Å‚·B + + B‚ð0‚É‚·‚邯‹¤U‰ñ˜H‚ÌQ‚ª–³ŒÀ‘å‚ɂȂèAŠ®‘S–³‘¹Ž¸‚ɂȂè‚Ü‚·‚Ì‚ÅAZ-1‚ɉŠú’l‚ð—^‚¦‚Ä‚¨‚¯‚ÎA‚»‚̂܂ܔ­UŠí‚Æ‚µ‚ÄŽg‚¤‚±‚Æ‚à‚Å‚«‚Ü‚·B + + +ŒŸ”gŠí +~~~~~~~~ +@ƒn[ƒhƒEƒGƒA‚ł̓_ƒCƒI[ƒh‚ðŽg‚¢‚Ü‚·‚ªAƒfƒWƒ^ƒ‹M†ˆ—‚Ìꇂ̓}ƒCƒiƒX‚Ì’l‚¾‚¯‚ð‚O‚É‚·‚é‚©A‚»‚̂܂܃vƒ‰ƒX‚É‚·‚éiâ‘Î’l‚𓾂éj‚¾‚¯‚ÅOK‚Å‚·B + + +Ï•ªŠí +~~~~~~~~ +@‚¢‚ë‚¢‚ë‚È•û–@‚ÅŽÀŒ»‚Å‚«‚邯Žv‚¢‚Ü‚·‚ªAMMTTY‚Ìê‡‚Í‰ß‹Ž‚ÌM†‚ðˆê’èŠúŠÔ‚ɂ‚¢‚Ä•½‹Ï‚·‚éFIRƒtƒBƒ‹ƒ^A‚Ü‚½‚̓oƒ^[ƒ[ƒX“Á«(N*6dB/Oct)‚ðŽ‚ÂIIRƒtƒBƒ‹ƒ^‚Ì‚¢‚¸‚ê‚©‚ð‘I‘ð‚Å‚«‚Ü‚·B + +@‚¢‚¸‚ê‚Ì•ûŽ®‚ð‘I‘ð‚µ‚Ä‚àŒ€“I‚ɂ͕ω»‚µ‚È‚¢‚悤‚Å‚·‚ªAŽóM‚·‚éM†‚ÌŽ¿‚É‚æ‚Á‚Ă͔÷–­‚ÉˆÙ‚È‚é‚æ‚¤‚Å‚·B + +@Ý’è‚·‚éƒXƒ€[ƒWƒ“ƒOŽü”g”‚ÍAFIRƒtƒBƒ‹ƒ^‚Ìꇂ͕½‹Ï‚·‚éŽüŠúŠúŠÔ‚Ì‹t”‚Å—^‚¦AIIRƒtƒBƒ‹ƒ^‚Ìꇂ͂»‚̃JƒbƒgƒIƒtŽü”g”‚Å—^‚¦‚Ü‚·‚ªAFIRƒtƒBƒ‹ƒ^‚ÅÝ’è‚·‚éƒXƒ€[ƒWƒ“ƒOŽü”g”‚æ‚è‚ÍAIIRƒtƒBƒ‹ƒ^‚̃JƒbƒgƒIƒtŽü”g”‚Í’á‚­Ý’è‚·‚é•K—v‚ª‚ ‚è‚Ü‚·iÏ•ªŠí‚ÌꇂÌFIRƒtƒBƒ‹ƒ^‚É—^‚¦‚éƒXƒ€[ƒWƒ“ƒOŽü”g”‚Í‚»‚ÌLPF“Á«‚̃JƒbƒgƒIƒtŽü”g”‚ł͂Ȃ­’P‚É•½‹ÏŽüŠú‚Ì‹t”‚Å‚ ‚邱‚Ƃɗ¯ˆÓ‚µ‚ĉº‚³‚¢jB + +@ƒfƒtƒHƒ‹ƒg‚Å‚ÍFIRƒtƒBƒ‹ƒ^‚ɂȂÁ‚Ä‚¢‚Ü‚·‚ªAIIRƒtƒBƒ‹ƒ^‚̂ق¤‚ª—y‚©‚Ɉ—‚ªŒy‚¢‚Å‚·‚Ì‚ÅA‚±‚¿‚ç‚̂ق¤‚ð‘I‘ð‚³‚ê‚é‚Ù‚¤‚ªFB‚©‚à’m‚ê‚Ü‚¹‚ñB’᎟‚Ìꇂ̃JƒbƒgƒIƒtŽü”g”‚Í‚TŽŸ‚ÌꇂÍ40Hz‚®‚ç‚¢A3ŽŸ‚ÌꇂÍ30Hz‚ ‚½‚肪—Ç‚³‚»‚¤‚Å‚·‚ªA‚±‚ê‚ÉŠÖ‚·‚鎄‚ÌŽÀŒ±‚̃Tƒ“ƒvƒ‹”‚Í­‚È‚¢‚Å‚·B + + +VCO +~~~~~ + VCO‚ÍRTTYM†‚̕ϒ²Ší‚âAPLL•ûŽ®‚̃fƒ‚ƒWƒ…ƒŒ[ƒ^‚ÅŽg‚¢‚Ü‚·BƒfƒWƒ^ƒ‹M†ˆ—‚Å‚ÌVCO‚͉º‹L‚̂悤‚È\¬‚ɂȂè‚Ü‚·B + + C2 + | +In --> C1 --+---+-----> sin --> Out + | | + -- Z-1 <- + + C1:VCOƒQƒCƒ“ + C2:ƒtƒŠ[ƒ‰ƒ“ƒjƒ“ƒOŽü”g”‚ðŒˆ’è‚·‚é’l + +@‚±‚̂܂܃vƒƒOƒ‰ƒ€‚·‚邯Z-1‚͂ǂñ‚Ç‚ñ‘å‚«‚È’l‚ɂȂÁ‚Ä‚¢‚«‚Ü‚·‚Ì‚ÅA‚»‚ê‚ð0`2ƒÎ‚܂ł͈̔͂ÅzŠÂ‚·‚邿‚¤‚É‚µ‚Ä‚¨‚«‚Ü‚·(‹ï‘Ì“I‚É‚Í2ƒÎ‚ÅŠ„‚Á‚Ä—]‚è‚ð‹‚߂邩A‚Ü‚½‚Í2ƒÎˆÈã‚ɂȂÁ‚½Žž‚É2ƒÎ‚ðˆø‚¯‚ÎOK‚Å‚·)B +@‚Ü‚½‚PƒTƒ“ƒvƒŠƒ“ƒO–ˆ‚Éusinv‚ðŒvŽZ‚·‚é‚͈̂—‚ÉŽžŠÔ‚ª‚©‚©‚è‰ß‚¬‚Ü‚·‚Ì‚ÅA‚ ‚ç‚©‚¶‚ßusinv‚ðŒvŽZ‚µ‚½‘å‚«‚ȃe[ƒuƒ‹‚ðì‚Á‚Ä‚¨‚«A‚»‚ê‚ðŽQÆ‚·‚é•û–@‚ň—‘¬“x‚𓾂鎖‚ª‚Å‚«‚Ü‚·B + +@ƒfƒWƒ^ƒ‹M†ˆ—‚Å‚ÌVCO‚ÍŽü”g”‚ªˆÀ’肵‚Ä‚¢‚Ü‚·‚Ì‚ÅA‚»‚̂܂ÜFSK‚̕ϒ²Ší‚Æ‚µ‚Ä—˜—p‚µ‚Ä‚à‚Ü‚Á‚½‚­–â‘è‚ ‚è‚Ü‚¹‚ñB + + +PLL +~~~~~ + PLL‚͉º‹L‚ÉŽ¦‚·‚悤‚È\¬‚Å‚±‚ê‚̓AƒiƒƒO‰ñ˜H‚Ƃ܂Á‚½‚­“¯‚¶‚Å‚·BƒfƒWƒ^ƒ‹M†ˆ—‚Å‚ÌˆÊ‘ŠŒŸ”gŠí(Phase Det.)‚ÍA’P‚É—¼ŽÒ‚Ì’l‚ðŠ|‚¯‡‚킹‚邾‚¯‚Å—Ç‚­A‚ƂĂàŠÈ’P‚ÉŽÀŒ»‚Å‚«‚Ü‚·B + +In - Phase Det. -> LoopLPF ---> OutLPF --> Out + | | + | | + +---- VCO <-------+ + +@‚±‚ÌˆÊ‘ŠŒŸ”gŠí‚Ìo—͂ɂ͗¼ŽÒ‚ÌŽü”g”‚̘a‚Æ·‚̬•ª‚ªŒ»‚êA—~‚µ‚¢‚̂ͷ‚̬•ª‚Ȃ̂ÅA‚»‚ê‚ðŽæ‚èo‚·‚½‚ß‚ÉIIRŒ^‚ÌLPF‚Åì‚Á‚½ƒ‹[ƒvƒtƒBƒ‹ƒ^(LoopLPF)‚ð’Ê‚µ‚Ü‚·B‚µ‚©‚µ‚±‚̃tƒBƒ‹ƒ^‚̓‹[ƒv“à‚É‚ ‚邽‚ß‚ÉPLL‚̉ž“š“Á«‚ɑ傫‚­‰e‹¿‚µA‚ ‚Ü‚è‰s‚¢“Á«‚ðŽ‚½‚¹‚邱‚Æ‚ª‚Å‚«‚Ü‚¹‚ñB’Êí‚Í1ŽŸƒtƒBƒ‹ƒ^‚ª—Ç‚­Žg‚í‚ê‚Ü‚·iƒn[ƒhƒEƒGƒA‚Å\¬‚·‚éPLL‚Ƃ܂Á‚½‚­“¯‚¶‚Å‚·jB + ‚µ‚½‚ª‚Á‚Ä‚±‚ꂾ‚¯‚ł͑jŽ~ˆæ‚ÌŒ¸Š—Ê‚ª•s‘«‚µAŠ®‘S‚ɂ͘a‚̬•ª‚𜋎‚Å‚«‚È‚¢‚Ì‚ÅAo—Í•”‚É‚à‚¤‚P‚ÂLPF(OutLPF)‚ð“ü‚ê‚Ä‚»‚ê‚ðŽæ‚èœ‚«‚Ü‚·B + + RTTY‚̃fƒ‚ƒWƒ…ƒŒ[ƒ^‚Æ‚µ‚ÄŽg‚¤ê‡Aƒ‹[ƒvƒtƒBƒ‹ƒ^‚̃JƒbƒgƒIƒtŽü”g”‚̓Vƒtƒg•‚æ‚è‚à‘å‚«‚­‚µ‚Ä‚¨‚©‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñB + +@PLL•ûŽ®‚̃fƒ‚ƒWƒ…ƒŒ[ƒ^‚Í‚‘¬ƒfƒR[ƒh‚ª—v‹‚³‚ê‚éꇂɓK‚µ‚Ä‚¢‚Ü‚·‚ªARTTYM†‚̂悤‚ÉA‚»‚̃{[ƒŒ[ƒg‚ª’x‚¢ê‡‚ÍAŽü”g”•Ù•ÊŠí•ûŽ®‚Ì•û‚ªŒü‚¢‚Ä‚¢‚邿‚¤‚ÉŽv‚¢‚Ü‚·B +@‚µ‚©‚µˆ—‚͂ƂĂàŒy‚­‚Äς݂܂·‚Ì‚ÅAOutLPF‚ÌŽŸ”‚ð‘å‚«‚­‚µA‚»‚ÌŒã‚ÌÏ•ªŠí‚ðIIRŒ^‚É‚·‚ê‚ÎA’x‚¢CPU‚Å‚à“®ì‚µ‚Ü‚·B + + +“K‰žƒtƒBƒ‹ƒ^ +~~~~~~~~~~~~~~ + “K‰žƒtƒBƒ‹ƒ^‚̓fƒWƒ^ƒ‹M†ˆ—‚̉Ԍ`‚Å‚·BˆÈ‰º‚É’Pƒ‰»‚µ‚½\¬—á‚ðŽ¦‚µ‚Ü‚·B + +In ------ ’x‰„Ší@-->ƒgƒ‰ƒ“ƒXƒo[ƒTƒ‹ƒtƒBƒ‹ƒ^ ---> Out + | | | + - (Œë·~2ƒÊ)---------> ŒW”XV(ƒÁ) | + | | + ------------------------------------------- +@(ŽQÆM†) + +@‚Ü‚¸In‚©‚ç‚ÌM†‚ð“K“–‚È’x‰„Ší‚ð’Ê‚µ‚ÄAƒgƒ‰ƒ“ƒXƒo[ƒTƒ‹ƒtƒBƒ‹ƒ^iFIRƒtƒBƒ‹ƒ^j‚É“ü—Í‚µ‚Ü‚·BŽŸ‚Ƀgƒ‰ƒ“ƒXƒo[ƒTƒ‹ƒtƒBƒ‹ƒ^‚ðŒo‚½M†‚ð“ü—ÍM†‚ÆŒ¸ŽZ‚µ‚Ä‚»‚̌뷂ð‹‚ßA‚»‚ê‚ðŒ³‚ÉƒtƒBƒ‹ƒ^‚ÌŒW”‚ðXV‚µ‚Ü‚·B + +@ˆê”ʂɎG‰¹‚Ȃǂ̃‰ƒ“ƒ_ƒ€‚ÈM†‚ÌŽ©ŒÈ‘ŠŠÖŠÖ”‚Í’x‰„‚ª‘å‚«‚­‚È‚é‚ɂ‚ê‚Ä‹}Œƒ‚ÉŒ¸­‚µ‚Ü‚·B‚±‚ê‚É‚æ‚è“ü—Í“_‚Æo—Í“_‚ÌŽG‰¹¬•ª‚Ì‘ŠŠÖ‚Í”ñí‚ɬ‚³‚È’l‚ɂȂè‚Ü‚·Bˆê•û–Ú•W‚Æ‚·‚éŽüŠú“I‚Ȭ•ª‚Ì‘ŠŠÖ‚Í‚ ‚é’ö“x‘å‚«‚È’l‚ɂȂè‚Ü‚·B‚±‚Ì}‚ł͌W”XV‚É‚æ‚èA“ü—Í‚Æo—ÍiŽQÆM†j‚Ì“ñæŒë·‚ª¬‚³‚­‚È‚é‚æ‚¤‚Éì—p‚µ‚Ü‚·‚Ì‚ÅAo—Í“_‚Å‚Í‘ŠŠÖ‚Ì‘å‚«‚Ȭ•ª‚Í‹­’²‚³‚êA‹t‚É‘ŠŠÖ‚Ì¬‚³‚Ȭ•ª‚Í—}§‚³‚ê‚Ä‚¢‚«‚Ü‚·B + +@ÅI“I‚É‚ÍuOutv‚©‚çM†‚ðŽæ‚èo‚¹‚ÎAŽüŠú“I‚ÈM†‚ð‹­’²‚µ‚½ƒmƒCƒYƒXƒ€[ƒT“I‚ÈiƒXƒyƒNƒgƒ‹‹­’²Šíj“®ì‚ɂȂèA‚Ü‚½Œë·M†‚ðo—͂ɂ·‚邯ŽüŠú“I‚ÈM†‚ðŽæ‚èœ‚¢‚½ƒI[ƒgƒmƒbƒ`ƒtƒBƒ‹ƒ^‚Æ‚µ‚Ä“®ì‚µ‚Ü‚·B + + MMTTY‚ÅÝ’è‚Å‚«‚éƒpƒ‰ƒ[ƒ^‚͈ȉº‚Ì’Ê‚è‚Å‚·B + + Tap ƒgƒ‰ƒ“ƒXƒo[ƒTƒ‹ƒtƒBƒ‹ƒ^‚ÌŽŸ” + Delay ‘ŠŠÖ’x‰„Ší‚̌” + 2ƒÊ ‚±‚Ì’l‚ð‘å‚«‚­‚·‚邯‰ž“š‚ª‘¬‚­‚È‚è‚Ü‚·B + ƒÁ ‚±‚Ì’l‚𬂳‚­‚·‚邯Œ¸Š‰ž“š‚ª‘¬‚­‚È‚è‚Ü‚·B + Inv ‚±‚ê‚Ƀ`ƒFƒbƒN‚ð•t‚¯‚邯Œë·M†‚ðo—Í‚µ‚Ü‚·B + AGC ŒW”‚Ì’l‚ª¬‚³‚¢Žž‚Éo—Í‚ð‘å‚«‚­‚µ‚Ü‚·B + BPF ƒfƒtƒHƒ‹ƒg‚ÅBPF“Á«‚ðŽ‚½‚¹‚Ü‚·B + + ƒÊ‚ð‘å‚«‚­‚·‚邯‰ž“š‚ª‘‚Ü‚è‚Ü‚·‚ªAŽû‘©‚µ‚É‚­‚­‚È‚è‚Ü‚·B + ƒÁ‚𬂳‚­‚·‚邯A“ü—ÍM†‚ª–³‚­‚È‚Á‚½Žž‚ÌŠeŒW”‚̉º‚ª‚è‹ï‡‚ª‘‚Ü‚è‚Ü‚·‚ªA‚ ‚܂謂³‚­‚µ‚·‚¬‚邯‹t‚ÉŽû‘©‚µ‚È‚­‚È‚Á‚½‚è”­U‚µ‚½‚肵‚Ü‚·B‚±‚̃Á‚Ì“­‚«‚ðŒ©‚é‚É‚ÍA\•ª‚ÉŽû‘©‚µ‚½ó‘Ô‚Å“ü—ÍM†‚ð“Ë‘RØ‚Á‚Ä‚Ý‚é‚Æ‚æ‚¢‚Å‚µ‚傤B•’Ê‚Í1.0‚æ‚è­‚µ‚¾‚¯¬‚³‚È’l‚ðݒ肵‚Ü‚·B + + AGC‚ÆBPF‚Í–{—ˆ‚ÌLMSƒAƒ‹ƒSƒŠƒYƒ€‚ɂ͂ ‚è‚Ü‚¹‚ñ‚ªARTTY—p‚ÉŽÀŒ±“I‚É•t‚¯‚Ă݂½‚à‚̂ł·BAGC‚ÍŽã‚¢M†‚ÌŽž‚É‚à‚ ‚é’ö“x‚̃tƒBƒ‹ƒ^ƒQƒCƒ“‚ðŠm•Û‚·‚邿‚¤‚É“­‚«ABPF‚̓fƒtƒHƒ‹ƒg‚ÅBPF“Á«‚ðŒy‚­Ž‚½‚¹‚邿‚¤‚É“­‚«‚Ü‚·B + + “K‰žƒtƒBƒ‹ƒ^‚Ì“®ì‹ï‡‚̓ʂƃÁ‚¾‚¯‚ł͂Ȃ­ADelay‚ÆTap‚Ì”‚à–§Ú‚ÉŠÖŒW‚µ‚Ü‚·‚Ì‚ÅA‚±‚ê‚ç‚·‚ׂĂð“K“–‚É’²®‚µ‚ÄŽ©•ªD‚݂̓K‰ž“®ì‚ÉŽdã‚°‚ÄŽg‚Á‚ĉº‚³‚¢B + + ­‚µLMS‚Ì’²®‚ð‚µ‚Ä‚Ý‚Ü‚µ‚½‚ªAŽã‚¢M†‚ł͂ ‚Ü‚èŽ|‚­“­‚©‚È‚¢Ž–‚ª‘½‚­A“®ì‚Í–Ê”’‚¢‚Å‚·‚ªAŽÀۂɂ͖ð‚ɂ͗§‚½‚È‚¢‚©‚à’m‚ê‚Ü‚¹‚ñBHi ŠF‚³‚ñ‚àFX‚ÆŽŽ‚µ‚ÄŽÀŒ±‚µ‚Ă݂ĉº‚³‚¢B—Ç‚¢ƒpƒ‰ƒ[ƒ^‚ªŒ©‚‚©‚Á‚½Žž‚ɂ͂º‚Ћ³‚¦‚Ä‚ËI + + +ƒfƒ‚ƒWƒ…ƒŒ[ƒ^‚Ì\¬ +~~~~~~~~~~~~~~~~~~~~~~ +@ˆÈ‰º‚É‚»‚ꂼ‚ê‚Ì\¬}‚ðŽ¦‚µ‚Ü‚·B + +mŽü”g”•Ù•ÊŠí•ûŽ®n + + (Mark) + +-> ‹¤UŠí -> ŒŸ”g -> Ï•ªŠí - ATC -+ + | | +Sound -> ƒŠƒ~ƒbƒ^ -+ cmp -> 0 or 1 + | (Space) | + +-> ‹¤UŠí -> ŒŸ”g -> Ï•ªŠí - ATC -+ + + +mPLL•ûŽ®n + +Sound -> ƒŠƒ~ƒbƒ^ - Phase Det. > LoopLPF -+-> OutLPF --> Ï•ªŠí --> + | | + | | + +---- VCO <------+ + + + Žü”g”•Ù•ÊŠí•ûŽ®‚ÍAIIRŒ^‹¤UŠí‚Ü‚½‚ÍFIRŒ^BPF‚Ì‚¢‚¸‚ê‚©‚ð‘I‘ð‚·‚é‚±‚Æ‚ª‚Å‚«‚Ü‚·B‚±‚Ì—¼ŽÒ‚Ì“Á«‚̈Ⴂ‚ÍXY-Scope•\ަ‚ð‚·‚é‚ÆŒ°’˜‚É•\‚ê‚Ü‚·‚̂Ŗʔ’‚¢‚ÆŽv‚¢‚Ü‚·BIIRŒ^‹¤UŠí‚ÍLC‹¤U‰ñ˜H‚ɋ߂¢“Á«‚ÅAˆê•ûFIRŒ^BPF‚Í’¼üˆÊ‘Š“Á«‚ª•ÛØ‚³‚ê‚Ü‚·B + + ‚¢‚¸‚ê‚Ìê‡‚à‚±‚Ì‚Q‚‚̋¤UŠíi‚Ü‚½‚ÍBPFj‚Ìo—Í‚ðŒŸ”g‚µ‚½ŒãA‚»‚ꂼ‚ꕽ‹ÏŒ^iFIRŒ^j‚Ü‚½‚ÍIIRŒ^LPF‚Å\¬‚µ‚½Ï•ªŠí‚ð’Ê‚µA‚»‚Ìo—͂̑嬂ð”äŠr‚µ‚Ä‚¢‚Ü‚·B + Ver1.19‚܂ł͌Ÿ”gŠí‚Ì‚ ‚Æ‚ÉAGC‚ð“ü‚ê‚Ä‚¢‚Ü‚µ‚½‚ªA‚ ‚Ü‚èŒø‰Ê‚ª‚È‚©‚Á‚½‚Ì‚ÅAŒ‹‹ÇƒI[ƒ\ƒhƒbƒNƒX‚ÈƒŠƒ~ƒbƒ^ƒAƒ“ƒv‚ð‘O’u‚·‚邿‚¤‚É–ß‚µ‚Ü‚µ‚½B‚Ü‚½Ver1.58‚©‚ç‚ÍATC‚ð’ljÁ‚µ‚Ä‚ ‚è‚Ü‚·B + +@PLL•ûŽ®‚à‹³‰È‘’Ê‚è‚Ì\¬‚Å‚·BXY-Scope‚ð•\ަ‚³‚¹‚邽‚ß‚ÉAIIRŒ^‹¤UŠí‚É‚àM†‚ðƒpƒ‰‚Å“ü‚ê‚Ä‚ ‚è‚Ü‚·‚ªA‚±‚Ì‹¤UŠí‚Ìo—͂̓fƒR[ƒh‚ɂ͊֌W‚µ‚Ü‚¹‚ñB + + ‚¢‚¸‚ê‚ÌꇂàŠeƒpƒ‰ƒ[ƒ^‚ð’²®‚·‚éÛA•\ަƒƒjƒ…[‚ÌuƒIƒVƒƒXƒR[ƒvv‚ð‘I‘ð‚·‚é‚ÆƒIƒVƒƒXƒR[ƒv‰æ–Ê‚ð•\ަ‚µ‚Ü‚·‚Ì‚ÅAuTrigvƒ{ƒ^ƒ“‚ð‰Ÿ‚µ‚ÄŠeM†‚Ìó‘Ô‚ðŠÏ‘ª‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B + ‚±‚̃IƒVƒƒXƒR[ƒv‚Í‚SŒ»Û‚ÅAã‚©‚çƒ}[ƒNŽü”g”M†AƒXƒy[ƒXŽü”g”M†AƒRƒ“ƒpƒŒ[ƒ^‚Ìo—ÍM†AƒfƒR[ƒh“¯Šúƒpƒ‹ƒXM†‚Ì‚S‚‚ð•\ަ‚µ‚Ü‚·B + ƒ}[ƒNŽü”g”M†‚¨‚æ‚уXƒy[ƒXŽü”g”M†‚ÍAuM†Œ¹v‚ðØ‚è‘Ö‚¦‚邱‚Ƃɂæ‚èŠÏ‘ªƒvƒ[ƒu‚̈ʒu‚ªˆÈ‰º‚̂悤‚ÉØ‚è‘Ö‚í‚è‚Ü‚·B + +[Žü”g”•Ù•ÊŠí•ûŽ®‚Ìê‡] + 1.IIRŒ^‹¤UŠí‚Ü‚½‚ÍFIRŒ^BPFo—ÍŒã‚Ì”gŒ` + 2.ŒŸ”gŒã‚Ì”gŒ` + 3.Ï•ªŠí’ʉߌã‚Ì”gŒ` + +[PLL•ûŽ®‚Ìê‡] + 1.IIR‹¤UŠío—ÍŒã‚Ì”gŒ`iƒfƒR[ƒh‚ɂ͊֌W‚µ‚Ü‚¹‚ñj + 2.オLoopLPF‚Ìo—ÍA‰º‚ªOutLPF‚Ìo—Í + 3.Ï•ªŠí’ʉߌã‚Ì”gŒ` + + ƒfƒR[ƒh“¯Šúƒpƒ‹ƒX‚ÍAˆÈ‰º‚̂悤‚ÈF•ª‚¯‚ª‚³‚ê‚Ä‚¢‚Ü‚·B + + ‰©F ƒXƒ^[ƒgƒrƒbƒgŒŸoˆÊ’u + ”’‰© ƒf[ƒ^Žæ‚肱‚݈ʒu + ÂF ƒXƒgƒbƒvƒrƒbƒg—\‘zˆÊ’u + + ƒXƒgƒbƒvƒrƒbƒg‚ª³‚µ‚­ŒŸo‚³‚ê‚½Žž‚ÍAÂFƒpƒ‹ƒX‚Í‚QŒÂ˜A‘±•\ަ‚³‚êA³‚µ‚­ŒŸo‚³‚ê‚È‚©‚Á‚½ŽžiƒtƒŒ[ƒ~ƒ“ƒOƒGƒ‰[Žžj‚ÍA‚PŒÂ‚µ‚©•\ަ‚³‚ê‚Ü‚¹‚ñB + ‚±‚Ì‚QŒÂ–Ú‚ÌÂFƒpƒ‹ƒX‚̓Xƒgƒbƒvƒrƒbƒg‚ÌI—¹—\‘zˆÊ’u‚̂قñ‚Ì­‚µŽè‘O‚Éݒ肵‚Ä‚ ‚èAƒfƒR[ƒ_[‚Í‚±‚̈ʒu‚©‚玟‚̃Xƒ^[ƒgƒrƒbƒg‚ÌŒŸo“®ì‚É“ü‚è‚Ü‚·B“¯Šúƒpƒ‹ƒX‚Íí‚Ƀf[ƒ^‚Ì^’†•t‹ß‚Ɉʒu‚µ‚Ä‚¢‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñB + + ƒIƒvƒVƒ‡ƒ“ƒƒjƒ…[‚ÌÝ’è‰æ–ʂ̃fƒR[ƒhƒy[ƒW‚ÅAu‘½”Œˆ˜_—ƒfƒR[ƒhv‚Ƀ`ƒFƒbƒN‚ð•t‚¯‚Ä‚¢‚éê‡A“¯Šúƒpƒ‹ƒX‚̓f[ƒ^‚̕ω»“_‚Ɉʒu‚·‚邿‚¤‚ɂȂè‚Ü‚·B‚±‚ÌꇃXƒ^[ƒgƒrƒbƒg‚ð•\‚·‰©F‚Ì“¯Šúƒpƒ‹ƒX‚ÍŒŸoˆÊ’u‚ƃf[ƒ^ŠJŽnˆÊ’u‚É‚Q–{•\ަ‚³‚ê‚Ü‚·BƒfƒR[ƒ_[‚Í‚PƒrƒbƒgŠúŠÔ‚ ‚½‚è‚̃}[ƒN‚ƃXƒy[ƒX‚̃Tƒ“ƒvƒ‹”‚𒲂×A‚»‚Ì”‚Ì‘½‚¢‚Ù‚¤‚ðƒf[ƒ^‚Æ‚µ‚ÄŽæ‚肱‚݂܂·B‚±‚Ìê‡ARxStopƒrƒbƒg‚ð‚Pƒrƒbƒg‚É‚µ‚Ä‚¢‚éê‡AÂFƒpƒ‹ƒX‚Íí‚É‚P‚‚µ‚©•\ަ‚³‚ê‚Ü‚¹‚ñB + ‚Ü‚½Ý’è‰æ–ʂ̃fƒR[ƒhƒy[ƒW‚ÅuƒtƒŒ[ƒ~ƒ“ƒOƒGƒ‰[‚Ì–³Ž‹v‚Ƀ`ƒFƒbƒN‚ð•t‚¯‚Ä‚¢‚éê‡AƒtƒŒ[ƒ~ƒ“ƒOƒGƒ‰[‚Í–³Ž‹‚³‚êAƒXƒgƒbƒvƒrƒbƒg‚Ìó‘Ô‚ÉŠÖ‚í‚炸ƒf[ƒ^‚ÍŽæ‚肱‚Ü‚ê‚邿‚¤‚ɂȂè‚Ü‚·B + ƒtƒŒ[ƒ~ƒ“ƒOƒGƒ‰[‚𖳎‹‚·‚邯AƒXƒgƒbƒvƒrƒbƒg‚¾‚¯‚ª—Ž‚¿‚½ê‡‚ೂµ‚­•¶Žš‚Æ‚µ‚Ä•\ަ‚³‚ê‚Ü‚·‚ªA–³M†Žž‚É‚à•¶Žš‚ª•\ަ‚³‚ê‚éŠm—§‚Í‚‚­‚È‚è‚Ü‚·B + + ƒIƒvƒVƒ‡ƒ“ƒƒjƒ…[‚ÌÝ’è‰æ–ʂ̃fƒR[ƒhƒy[ƒW‚ÅAƒ{[ƒŒ[ƒgCƒrƒbƒg’·CƒXƒgƒbƒvƒrƒbƒgCƒpƒŠƒeƒB“™‚̃fƒR[ƒhƒpƒ‰ƒ[ƒ^‚à•ÏX‚Å‚«‚Ü‚·‚ªAƒAƒ}ƒ`ƒ…ƒA‚ÌRTTY‚Ìꇂ̓fƒtƒHƒ‹ƒg(BaudRate=45.45, BitLength=5, RxStop=1 or 1.42, Parity=NONE)‚©‚ç•ÏX‚µ‚È‚¢‚ʼnº‚³‚¢B + +*RxStop=1 ‚Ü‚½‚Í 1.42‚ð‘I‘ð‚µ‚Ä‚àA‘—M‚·‚é•„†‚̃Xƒgƒbƒvƒrƒbƒg‚Í1.5bit‚Å‚·B + + +ƒI[ƒo[ƒTƒ“ƒvƒŠƒ“ƒO +~~~~~~~~~~~~~~~~~~~~~~ +@ƒTƒ“ƒvƒŠƒ“ƒOŽü”g”‚ð“à•”‚Å•ÏX‚·‚éƒI[ƒo[ƒTƒ“ƒvƒŠƒ“ƒOiƒ}ƒ‹ƒ`ƒŒ[ƒgƒVƒXƒeƒ€j‚Æ‚¢‚¤‹Zp‚ªAˆ—‘¬“x‚ð‰Ò‚®‚½‚߂ɃfƒWƒ^ƒ‹M†ˆ—‚ł͂²‚­íޝ“I‚ÉŽg‚í‚ê‚Ä‚¢‚Ü‚·BMMTTY‚̃fƒ‚ƒWƒ…ƒŒ[ƒ^•”‚àƒI[ƒo[ƒTƒ“ƒvƒŠƒ“ƒO‚³‚ê‚Ä‚¢‚Ü‚·BˆÈ‰º‚ɃI[ƒo[ƒTƒ“ƒvƒŠƒ“ƒOƒVƒXƒeƒ€‚Ì\¬}‚ðŽ¦‚µ‚Ü‚·B + + A/D --> LPF --> «M --> ±Ìߨ¹°¼®Ý --> ªL --> LPF --> D/A + + ƒTƒ“ƒvƒŠƒ“ƒOŽü”g”‚ð‰º‚°‚é•”•ª‚ðƒfƒWƒ[ƒ^i«Mj‚ƌĂÑA—Ⴆ‚Î1/2‚É‚·‚éꇂɂÍAƒTƒ“ƒvƒŠƒ“ƒOƒf[ƒ^‚ð‚Q‰ñ‚É‚P‰ñ‚ÆŠÔˆø‚¯‚Ηǂ¢‚킯‚Å‚·‚©‚ç˜b‚ÍŠÈ’P‚Å‚·B +@‚½‚¾‚±‚̂܂܂¾‚Æ“ü—Í•”‚Ì•¨—“I‚ȃTƒ“ƒvƒŠƒ“ƒOŽü”g”‚ð‰º‚°‚é‚̂Ƃ܂Á‚½‚­“¯‚¶‚±‚ƂɂȂèA’á‚¢Žü”g”‚ÅÜ‚è•Ô‚µ˜c‚Ý‚ª”­¶‚µ‚Ä‚µ‚Ü‚¢‚Ü‚·‚Ì‚ÅA‚±‚Ì•”•ª‚Ì‘O‚ɃfƒWƒ^ƒ‹ƒtƒBƒ‹ƒ^‚É‚æ‚éLPF‚ð“ü‚ê‚Ä‚¨‚«‚Ü‚·B + +@ƒTƒ“ƒvƒŠƒ“ƒOŽü”g”‚ðã‚°‚é•”•ª‚̓Cƒ“ƒ^[ƒ|[ƒŒ[ƒ^iªLj‚ƌĂÑA—Ⴆ‚Î2”{‚É‚·‚éꇂɂÍA‚PƒTƒ“ƒvƒŠƒ“ƒO‚Ì“r’†‚Ì“_‚ðì‚ç‚È‚¯‚ê‚΂Ȃç‚È‚¢‚Ì‚ÅA­‚µ“‚»‚¤‚ÉŽv‚¦‚Ü‚·‚ªA‚±‚ê‚͂Ƃ肠‚¦‚¸‚»‚Ì“r’†‚Ì“_‚ðƒGƒCƒ„ƒb‚Æ‚O‚É‚µ‚Ä‚µ‚Ü‚¢AƒTƒ“ƒvƒŠƒ“ƒOŽü”g”‚ð–³—‚â‚èã‚°‚Ä‚¨‚¢‚Ä‚©‚çA‚»‚Ì‚ ‚ƃfƒWƒ^ƒ‹ƒtƒBƒ‹ƒ^‚É‚æ‚éLPF‚ŃXƒ€[ƒWƒ“ƒO‚µ‚ĕ⊮‚µ‚Ü‚·B + +@2”{‚̃I[ƒo[ƒTƒ“ƒvƒŠƒ“ƒO‚ðs‚¤‚±‚Ƃɂæ‚èA—Ⴆ‚ÎFIRŒ^ƒtƒBƒ‹ƒ^‚ł͂»‚ÌŽŸ”‚ª”¼•ª‚Å“¯‚¶“Á«‚̃tƒBƒ‹ƒ^‚𓾂鎖‚ª‚Å‚«‚邿‚¤‚ɂȂè‚Ü‚·B‚Ü‚½‚PƒTƒ“ƒvƒŠƒ“ƒOŠúŠÔ‚ª2”{‚ɂȂè‚Ü‚·‚Ì‚ÅAˆ—‚É‚à—]—T‚ª¶‚Ü‚ê‚Ü‚·B +@‚½‚¾‚µƒAƒvƒŠƒP[ƒVƒ‡ƒ“•”‚ł̃iƒCƒLƒXƒgŽü”g”iˆ—‰Â”\‚ÈŽü”g”=ƒTƒ“ƒvƒŠƒ“ƒOŽü”g”‚Ì1/2j‚Í”¼•ª‚ɂȂè‚Ü‚·‚Ì‚ÅA‚±‚Ì”{—¦‚ɂ͂¨‚Ì‚¸‚ÆŒÀŠE‚ª‚ ‚邱‚ƂɂȂè‚Ü‚·B + + +›ƒŠƒ~ƒbƒ^[‚̈—Žü”g” +~~~~~~~~~~~~~~~~~~~~~~~~ + ƒfƒtƒHƒ‹ƒg‚Å‚ÍƒŠƒ~ƒbƒ^[‚̓Tƒ“ƒvƒŠƒ“ƒOŽü”g”11025Hz‚Å“®ì‚µ‚Ä‚¨‚èA‚±‚Ì•”•ª‚ÅˆÊ‘Š˜c‚Ý‚ª”­¶‚µ‚Ü‚·B‚±‚ê‚̓fƒR[ƒh“®ì‚ɂ͑傫‚­‰e‹¿‚µ‚È‚¢‚悤‚Å‚·‚ªAXYScope‚Ì•\ަ‚ɘc‚݂ƂȂÁ‚ÄŒ»‚ê‚Ü‚·B + + ƒIƒvƒVƒ‡ƒ“ƒƒjƒ…[‚ÌÝ’è‰æ–Ê‚ÅƒŠƒ~ƒbƒ^[‚ÌuOver Samplingv‚̃`ƒFƒbƒN‚ð•t‚¯‚邯AMMTTY‚͈ȉº‚̂悤‚ÉƒŠƒ~ƒbƒ^[‚¾‚¯‚ð‚S”{‚̃Tƒ“ƒvƒŠƒ“ƒOŽü”g”(44100Hz)‚Å“®ì‚³‚¹‚±‚̘c‚Ý‚ðŠÉ˜a‚³‚¹‚Ü‚·B + +Sound --> ªL(4) -> LPF --> Limiter --> LPF -> «M(1/4) --> LimitOut +11025Hz 44100Hz 11025Hz + + CPUƒpƒ[‚É—]—T‚ª‚ ‚éꇂÍAuOver Samplingv‚̃`ƒFƒbƒN‚ð“ü‚ê‚Ä‚¨‚¢‚½‚Ù‚¤‚ªXYScope‚Ì•\ަ‚ª­‚µãY—í‚É‚È‚é‚ÆŽv‚¢‚Ü‚·B + + + ‚Ü‚½‚±‚ê‚Æ‚͕ʂɕ\ަƒƒjƒ…[‚ÌXYScope‚̈—•iŽ¿‚ð‚‚­‚·‚邯AMMTTY‚͈ȉº‚̂悤‚ÉXYScope‚É—^‚¦‚éM†‚̃Tƒ“ƒvƒŠƒ“ƒOŽü”g”‚¾‚¯‚ð‚‚­‚µ‚Ü‚·B + + Mark ---> ªL(N) -> LPF --> X + Space ---> ªL(N) -> LPF --> Y + + ‚±‚̈—‚ÍƒŠƒ~ƒbƒ^‚Å‚ÌˆÊ‘Š˜c‚݂ɑ΂µ‚Ă͌ø‰Ê‚Í‚ ‚è‚Ü‚¹‚ñ‚ªA•\ަ•ª‰ð”\‚ª‚‚Ü‚èXYScope‚ªŒ©‚â‚·‚­‚È‚è‚Ü‚·B + + +FFT +~~~~~ + FFT‚ÍŽQl•¶Œ£‚à‘½‚­A‚±‚±‚Å‚ÍÚ‚µ‚­G‚ê‚Ü‚¹‚ñ‚ªAŽžŠÔ—̈æ‚ÌM†‚ðŽü”g”—̈æi‚Ü‚½‚Í‚»‚Ì‹tj‚ɕϊ·‚·‚é‚̂Ɏg‚í‚êAMMTTY‚ł͎ü”g”ƒXƒyƒNƒgƒ‹•\ަ‚¨‚æ‚ÑWaterFall•\ަ‚ÌÛ‚ÉŽg‚Á‚Ä‚¢‚Ü‚·B +@•’ʂ̑f’¼‚ÈDFTi—£ŽU“Iƒt[ƒŠƒG•ÏŠ·j‚Å‚ÍA—Ⴆ‚ÎN“_‚̉ðÍ‚ðs‚¤ê‡‚ÉN~N‰ñ‚ÌŒvŽZ‚ª•K—v‚Å‚·‚ªAFFT‚ÌꇂÍN‚ð‚Q‚ׂ̂«æ‚É‘I‚Ô‚±‚Ƃɂæ‚èN~log2(N)‰ñ‚ÉŒ¸‚ç‚·‚±‚Æ‚ª‚Å‚«‚Ü‚·B +@ˆÈ‰º‚̑ЂɃTƒ“ƒvƒ‹ƒvƒƒOƒ‰ƒ€‚ªÚ‚Á‚Ä‚¢‚Ü‚·B‘¼‚É‚à”»‚èˆÕ‚­‰ðà‚³‚ꂽ‘Ђª‘½‚­‚ ‚è‚Ü‚·‚̂ł»‚ê‚ç‚ðŽQÆ‚³‚ê‚邯—Ç‚¢‚Å‚µ‚傤B + +Basic‚Ì—á +@ŽO’J ­ºuƒfƒWƒ^ƒ‹ƒtƒBƒ‹ƒ^ƒfƒUƒCƒ“viŠ”jºW“° •½¬‚U”N‚SŒŽ +Pascal‚Ì—á +@ŽOã ’¼Ž÷uƒfƒWƒ^ƒ‹M†ˆ—ƒvƒƒOƒ‰ƒ~ƒ“ƒO“ü–åvCQo”ÅiŠ”j1993 + +@‚È‚¨AMMTTY‚ÌFIRƒtƒBƒ‹ƒ^‚ÌŽü”g”“Á«•\ަ‚ÍFFT‚ł͂Ȃ­DFT‚Ȃ̂ÅAˆ—‚ª‚ƂĂàd‚¢‚Å‚·BHi + + +ƒTƒEƒ“ƒhƒJ[ƒh‚̃x[ƒXƒTƒ“ƒvƒŠƒ“ƒOŽü”g” +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + MMTTY‚̓TƒEƒ“ƒhƒJ[ƒh‚ɑ΂µ‚ăfƒtƒHƒ‹ƒg‚ŃTƒ“ƒvƒŠƒ“ƒOŽü”g”11025Hz‚ðŽw’肵‚Ü‚·B‚±‚ê‚Í‘S‚ẴTƒEƒ“ƒhƒJ[ƒh‚ª•W€‚ŃTƒ|[ƒg‚·‚éÅ‚àˆÀ‘S‚ÈŽü”g”‚Å‚·B +@‚µ‚©‚µ‚ ‚È‚½‚̃TƒEƒ“ƒhƒJ[ƒh‚ª‘Ήž‚·‚é‚È‚ç‚ÎAMMTTY‚ÌClock’l‚ð•ÏX‚µ‚ÄA6000Hz,8000Hz‚Ü‚½‚Í12000Hzƒx[ƒX‚̃Tƒ“ƒvƒŠƒ“ƒOŽü”g”‚ŃTƒEƒ“ƒhƒJ[ƒh‚ð“®ì‚³‚¹‚邱‚Æ‚à‚Å‚«‚Ü‚·B + +@Clockƒx[ƒX’l‚ÆClock”͈ÍAŠe“®ìŽü”g”‚͈ȉº‚̂悤‚ɂȂè‚Ü‚·B + +ƒx[ƒX’l 6000 8000 11025 12000 +----------Clock”͈Í---------------------------------- +Clock‰ºŒÀ 5000 7000 10000 11600 +ClockãŒÀ 6999 9999 11599 12500 +----------Demodulator-------------------------------- +ƒI[ƒo[ƒTƒ“ƒvƒŠƒ“ƒO ‚È‚µ ‚È‚µ 1/2 1/2 +ƒiƒCƒLƒXƒgŽü”g” 3000 4000 2756 3000 +----------Modulator---------------------------------- +ƒiƒCƒLƒXƒgŽü”g” 3000 4000 5513 6000 +----------FFT---------------------------------------- +FFT“_” 1024 1024 2048 2048 +ƒiƒCƒLƒXƒgŽü”g” 3000 4000 5513 6000 +ŽûWŽžŠÔ[ms] 171 128 186 171 +----------XY Scope----------------------------------- +ƒf[ƒ^“_” 512 512 512 512 +ƒiƒCƒLƒXƒgŽü”g” 3000 4000 2756 3000 +ŽûWŽžŠÔ[ms] 85 128 93 85 + +*ƒiƒCƒLƒXƒgŽü”g”=˜_—ƒTƒ“ƒvƒŠƒ“ƒOŽü”g”‚Ì1/2‚ÌŽü”g”iƒfƒWƒ^ƒ‹M†ˆ—‚ÅŒ³‚ÌM†‚É•œŒ³‰Â”\‚Ș_—ŒÀŠEŽü”g”j + + +@—Ⴆ‚Î6000Hzƒx[ƒX‚ð‘I‘ð‚·‚éê‡AƒIƒvƒVƒ‡ƒ“ƒƒjƒ…[‚ÌÝ’è‰æ–Êu‚»‚Ì‘¼vƒy[ƒW‚ÅAƒTƒEƒ“ƒhƒJ[ƒhClock’l‚É6000‚ð‘I‘ð‚µ‚½ŒãAˆê’UMMTTY‚ðI—¹‚µ‚ÄÄ‹N“®‚µ‚ĉº‚³‚¢BˆÈŒãMMTTY‚Í6000Hz‚ŃTƒEƒ“ƒhƒJ[ƒh‚ð“®ì‚³‚¹‚Ü‚·B + Šù‚É‚ ‚½‚È‚ª11025ƒx[ƒX‚ŃNƒƒbƒN•Ⳃðs‚Á‚Ä‚¢‚éê‡AŽŸ‚̂悤‚ÉClock‚ÉÝ’è‚·‚鳊m‚È’l‚ðŒvŽZ‚Å‹‚߂邱‚Æ‚à‚Å‚«‚Ü‚·i’[”‚ÍŽlŽÌŒÜ“ü‚µ‚ĉº‚³‚¢jB + + Clock = ]—ˆ‚Ì•â³Clock’l x Šó–]‚·‚éƒx[ƒX’l / 11025 + +@ƒTƒEƒ“ƒhƒJ[ƒh‚̃x[ƒXŽü”g”‚ð‰º‚°‚邯CPU‚Ö‚Ì•‰‰×‚Í’˜‚µ‚­ŒyŒ¸‚³‚ê‚Ü‚·B“Á‚É6000Hz‚ð‘I‘ð‚µ‚½ê‡‚»‚ÌŒø‰Ê‚ÍŒ°’˜‚Å‚·B + ‚½‚¾‚µƒfƒtƒHƒ‹ƒg‚̃pƒ‰ƒ[ƒ^‚Í11025Hz‚Å’²®‚³‚ê‚Ä‚¢‚邽‚ßA‚ ‚È‚½Ž©g‚Å“®ìƒpƒ‰ƒ[ƒ^‚ðŽáб’²®‚µ‚È‚¯‚ê‚΂Ȃç‚È‚¢ê‡‚ª‚ ‚è‚Ü‚·B + +6000Hzƒx[ƒX‚Ìê‡ +~~~~~~~~~~~~~~~~~~ +@‚Ù‚Æ‚ñ‚ǂ̃pƒ‰ƒ[ƒ^‚Í•ÏX‚µ‚È‚­‚Ä‚à‚»‚̂܂܎g—p‚Å‚«‚Ü‚·BƒTƒEƒ“ƒhƒJ[ƒh‚̃oƒbƒtƒ@ƒTƒCƒY‚̓fƒtƒHƒ‹ƒg‚æ‚è‚àŒ¸­‚³‚¹‚½•û‚ª‘€ì«‚͉ü‘P‚µ‚Ü‚·B +@‘O’uƒtƒBƒ‹ƒ^‚ÆTxBPF‚Ì“Á«‚Í11025Hzƒx[ƒX‚Æ”äŠr‚µ‚ĉs‚­‚È‚è‚Ü‚·‚Ì‚ÅA‚¨D‚Ý‚Ìó‘Ô‚É’²®‚µ‚ĉº‚³‚¢BTap”‚𔼕ª‚É‚·‚邯ƒfƒtƒHƒ‹ƒg‚Ƃقړ¯‚¶“Á«‚𓾂邱‚Æ‚ª‚Å‚«‚Ü‚·B“Á‚ÉTxBPF‚Í‚»‚̂܂܂ł͋·‰ß‚¬‚Ü‚·‚Ì‚ÅTap”‚ðŒ¸­‚³‚¹‚½‚Ù‚¤‚ª—Ç‚¢‚©‚à’m‚ê‚Ü‚¹‚ñB + +8000Hzƒx[ƒX‚Ìê‡ +~~~~~~~~~~~~~~~~~~ +@‚±‚ÌŽü”g”‚͂قƂñ‚ǂ̃TƒEƒ“ƒhƒJ[ƒh‚ÅŽg—p‰Â”\‚̂悤‚Å‚·‚ªAƒfƒ‚ƒWƒ…ƒŒ[ƒ^‚̈—Žü”g”‚ª‚‚­‚È‚è‰ß‚¬‚邽‚ßA6000Hzƒx[ƒX‚Æ”äŠr‚µ‚ÄCPU•‰‰×‚ɑ΂·‚éƒƒŠƒbƒg‚Í‚ ‚Ü‚è‘å‚«‚­‚ ‚è‚Ü‚¹‚ñB + Žü”g”•Ù•ÊŠí‚ÉFIRŒ^BPF‚ð‘I‘ð‚·‚éê‡ATap”‚ð–ñ1.4”{(96ŽŸ‚®‚ç‚¢)‚É‘‰Á‚³‚¹‚é•K—v‚ª‚ ‚é‚©‚à’m‚ê‚Ü‚¹‚ñB‚µ‚©‚µIIRŒ^‹¤UŠí‚Ì“Á«‚͂قƂñ‚Ǖω»‚¹‚¸‚»‚̂܂܂̃pƒ‰ƒ[ƒ^‚ÅŽg—p‚Å‚«‚Ü‚·B +@‚±‚ÌꇂàƒTƒEƒ“ƒhƒJ[ƒh‚̃oƒbƒtƒ@ƒTƒCƒY‚̓fƒtƒHƒ‹ƒg‚æ‚è‚àŒ¸­‚³‚¹‚½‚Ù‚¤‚ª‘€ì«‚͉ü‘P‚µ‚Ü‚·B +@‘O’uƒtƒBƒ‹ƒ^‚ÆTxBPF‚Ì“Á«‚Í11025Hzƒx[ƒX‚Æ”äŠr‚µ‚ĉs‚­‚È‚è‚Ü‚·‚Ì‚ÅA‚¨D‚Ý‚Ìó‘Ô‚É’²®‚µ‚ĉº‚³‚¢BTap”‚ð–ñ0.7”{‚ÉŒ¸­‚³‚¹‚邯ƒfƒtƒHƒ‹ƒg‚Ƃقړ¯‚¶“Á«‚𓾂邱‚Æ‚ª‚Å‚«‚Ü‚·B“Á‚ÉTxBPF‚Í‚»‚̂܂܂łͭ‚µ‹·‰ß‚¬‚Ü‚·‚Ì‚ÅTap”‚ðŒ¸­‚³‚¹‚½‚Ù‚¤‚ª—Ç‚¢‚©‚à’m‚ê‚Ü‚¹‚ñB + +12000Hzƒx[ƒX‚Ìê‡ +~~~~~~~~~~~~~~~~~~~ +@‚·‚ׂẴpƒ‰ƒ[ƒ^‚ð•ÏX‚¹‚¸‚ɂقړ¯“™‚Ì“Á«‚ª“¾‚ç‚ê‚Ü‚·B‚±‚Ìê‡11025Hz‚Æ”äŠr‚µ‚ÄCPU‚Ì•‰‰×‚͎኱㸂µ‚Ü‚·B + + +@ˆÈ‰º‚ÉŠeƒTƒ“ƒvƒŠƒ“ƒOƒx[ƒX‚Å‚ÌMMTTY‚Ì“®ì\¬‚ð®—‚µ‚Ä‚¨‚«‚Ü‚·B + +[ŽóM- 11025/12000] + +---> BPF -> Notch/LMS -> Limitter -> M(1/2) -> Demodulator + ~~~~~~~~~~ 11025/12000 ~~~~~~~~~~~|~~~~~~~ 5513/6000 + +[ŽóM- 6000/8000] + +---> BPF -> Notch/LMS -> Limitter -> Demodulator + ~~~~~~~~~~~~~~~~ 6000/8000 ~~~~~~~~~~~~~~~~ + +[‘—M] +TxLPF ----> VCO ----> TxBPF +~~ 6000/8000/11025/12000 ~~ + + +@‘O’uƒtƒBƒ‹ƒ^AƒŠƒ~ƒbƒ^[ATxLPFATxBPFAFFT“™‚̓fƒ‚ƒWƒ…ƒŒ[ƒ^‚̃I[ƒo[ƒTƒ“ƒvƒŠƒ“ƒO‚Ƃ͖³ŠÖŒW‚Å‚·B‚±‚ê‚ç‚Íí‚É•¨—ƒTƒ“ƒvƒŠƒ“ƒOŽü”g”‚Å“®ì‚µ‚Ü‚·B +@ƒI[ƒo[ƒTƒ“ƒvƒŠƒ“ƒO‚Ì€‚ʼnðà‚µ‚½‚悤‚ÉAƒTƒ“ƒvƒŠƒ“ƒOŽü”g”‚ð‰º‚°‚邯“¯‚¶ŽŸ”‚Å‚à‰s‚¢“Á«‚̃tƒBƒ‹ƒ^‚ª“¾‚ç‚ê‚邱‚Æ‚ðŽv‚¢o‚µ‚ĉº‚³‚¢B•¨—ƒTƒ“ƒvƒŠƒ“ƒOŽü”g”‚ð‰º‚°‚邱‚Æ‚ÍCPU•‰‰×‚ɑ΂µ‚Ĉȉº‚Ì“_‚ÅŒø‰Ê“I‚Å‚· + +EƒTƒ“ƒvƒŠƒ“ƒOŠÔŠu‚ª’·‚­‚È‚é‚̂ł»‚ꂾ‚¯ˆ—‚̃}[ƒWƒ“‚ª‘‚¦‚é +E­‚È‚¢ŽŸ”‚Å“¯‚¶“Á«‚ÌFIRƒtƒBƒ‹ƒ^‚ª\¬‚Å‚«‚é +Eƒfƒ‚ƒWƒ…ƒŒ[ƒ^‚̃I[ƒo[ƒTƒ“ƒvƒŠƒ“ƒOˆ—‚Ì•K—v‚ª‚È‚­‚È‚é + + +@ƒx[ƒXŽü”g”‚É6000Hz‚Ü‚½‚Í12000Hz‚ð‘I‘ð‚µ‚½ê‡Aƒfƒ‚ƒWƒ…ƒŒ[ƒ^‚̃iƒCƒLƒXƒgŽü”g”(3000Hz)‚ÍÅ‚à“K‚µ‚½ó‘ԂɂȂè‚Ü‚·B‚µ‚©‚µƒTƒEƒ“ƒhƒJ[ƒh‚É‚æ‚Á‚Ä‚ÍA‚±‚ê‚ç‚ÌŽü”g”‚ðƒTƒ|[ƒg‚µ‚Ä‚¢‚È‚¢ê‡‚ª‚ ‚èAX‚ÉMMTTY‚ɃGƒ‰[‚ð’Ê’m‚µ‚È‚¢ê‡‚ª‚ ‚è‚Ü‚·‚Ì‚ÅA•K‚¸‘—ŽóM‚ɈÙ킪‚È‚¢‚©Šm”F‚µ‚ĉº‚³‚¢B + +@ˆÙ‚È‚éƒx[ƒXŽü”g”‚Ř^‰¹‚µ‚½MMVƒtƒ@ƒCƒ‹‚ͳ‚µ‚­Ä¶‚Å‚«‚Ü‚¹‚ñB‚Ü‚½ƒx[ƒXŽü”g”‚ð‰º‚°‚邯˜^‰¹‚³‚ê‚éMMVƒtƒ@ƒCƒ‹‚Ì—e—ʂ͓¯‚¶˜^‰¹ŽžŠÔ‚łଂ³‚­‚È‚è‚Ü‚·B + +@6000Hzƒx[ƒX‚ð‘I‘ð‚µ‚½ê‡AƒiƒCƒLƒXƒgŽü”g”‹ß•Ó‚Å‚ÍAD/AƒRƒ“ƒo[ƒ^‚̗뎟ƒz[ƒ‹ƒh“Á«(ƒAƒp[ƒ`ƒƒŒø‰Ê)‚É‚æ‚èo—̓Œƒxƒ‹‚ªÅ‘å4dB’ö“x’ቺ‚·‚é‰Â”\«‚ª‚ ‚è‚Ü‚·B‚‚¢Žü”g”‚ÅL‚¢ƒVƒtƒg•‚ðÝ’è‚·‚邯Aƒ}[ƒNŽü”g”‚ƃXƒy[ƒXŽü”g”‚ŃŒƒxƒ‹·‚ª”­¶‚·‚é‰Â”\«‚ª‚ ‚邱‚Ƃɗ¯ˆÓ‚µ‚ĉº‚³‚¢iƒAƒ}ƒ`ƒ…ƒA–³ü‚ÌRTTY‚ł͂±‚̂悤‚ÈŽg‚¢•û‚Í‚µ‚È‚¢‚̂Ŗâ‘è‚͂Ȃ¢‚ÆŽv‚¢‚Ü‚·jB + + +ÅŒã‚É +~~~~~~~~ + ‰½‚ÆŒ¾‚Á‚Ä‚àƒfƒWƒ^ƒ‹M†ˆ—‚ÍAƒCƒ“ƒs[ƒ_ƒ“ƒX‚ðl—¶‚µ‚È‚­‚Ä—Ç‚¢“_‚ªŠy‚¾‚ÆŽv‚¢‚Ü‚·Bƒf[ƒ^‚ÍŒ³‚Ìó‘Ԃ𑹂Ȃ킸‚ɉ½“x‚Å‚àƒRƒs[‚Å‚«‚Ü‚·‚Ì‚ÅA‚±‚ê‚Ío—̓Cƒ“ƒs[ƒ_ƒ“ƒX‚Oƒ¶‚ÉA“ü—̓Cƒ“ƒs[ƒ_ƒ“ƒX‡ƒ¶‚ðÚ‘±‚µ‚Ä‚¢‚é‚̂Ɠ¯‚¶‚Å‚·B + +@‚Ü‚½¡‰ñ‚̂悤‚É•‚“®¬”“_‰‰ŽZ‚ðŽg‚¤‚ÆAŒÅ’謔“_‰‰ŽZ‚ł͋ê˜J‚·‚éŒW”—ÊŽq‰»Œë·‚≉ŽZŒë·‚É‚æ‚é“Á«—ò‰»‚ð‚ ‚Ü‚è‹C‚É‚µ‚È‚­‚Ä‚·‚݂܂·‚Ì‚ÅA‚Ù‚ÚŒvŽZ’Ê‚è‚ÌŒ‹‰Ê‚ð”äŠr“IŠÈ’P‚É“¾‚鎖‚ª‚Å‚«‚邯Žv‚¢‚Ü‚·B + \ No newline at end of file diff --git a/eremote.txt b/eremote.txt new file mode 100644 index 0000000..d09b197 --- /dev/null +++ b/eremote.txt @@ -0,0 +1,779 @@ +Remote control mode of MMTTY + Written on September 30, 2000 + Lastly updated on September 21, 2010 + By JE3HHT Makoto Mori + Translated into English by JA7UDE Nobuyuki Oba + + This document describes how to utilize the MMTTY remote mode. With this mode, you can make use of the RTTY engine of the MMTTY from your program. + +================ +Revision history +================ + +2010.09.21 Added a start-up option that specifies the startup time limit +2010.09.21 Added a start-up option that specifies the shared memory name +2010.09.19 Added Dual Peak Filter on/off property to the switch information +2010.09.16 Added RXM_PTTFSK +2003.01.30 Added TXM_SHOWSETUP, TXM_SHOWPROFILE +2003.01.28 Added RXM_ENBSHARED +2003.01.28 Added -Z, -a start-up options +January 23, 2003 - Added RXM_ENBFOCUS, RXM_SETDEFFREQ, RXM_SETLENGTH +July 2, 2002 - Added TXM_RADIOFREQ +April 14, 2002 - Added the application disable option to RXM_SHOWSETUP +February 11, 2001 - Added ProfileNames[] into the shared memory (version 1.61 or later) +February 11, 2001 - Added TXM_DEFSHIFT (version 1.61 or later) +February 11, 2001 - Added TXM_NOTCH (version 1.61 or later) +February 11, 2001 - Added RXM_TIMER (version 1.61 or later) +January 5, 2001 - Added the profile function and the variables in the shared memory (version 1.61 or later) +December 23, 2000 - Added the abort function call to immediately clear the TX buffer +December 13, 2000 - Added the transmission mode through the keyboard buffer +November 26, 2000 - Added -n option (since version 1.60) +November 10, 2000 - Added -h option (since version 1.60) +November 08, 2000 - Corrected the size of the title array in the shared memory +November 08, 2000 - Added a VB sample code offered by Bob Furzer K4CY +November 08, 2000 - Added RXM_NOTCH message (since version 1.59a) +November 08, 2000 - Added Notch/LMS switch information (since version 1.59a) + + +============ +Introduction +============ + I have been receiving many emails concerning about the logging and contest utilities of MMTTY. I am afraid I won't be able to accommodate all the requests in my limited time. + + For this reason, I added the TNC emulation mode, which makes the PC running MMTTY act as a TNC. You can control the PC as a TNC by connecting to another PC with a null modem cable. This emulation mode, however, requires two PCs or one PC with three COM ports; it is not a smart implementation. + + I asked Bob Furzer, K4CY, for any good idea. He has quickly proposed a method using a simple inter-process communication (many thanks to Bob). + + This method makes it possible that MMTTY can easily communicate with other applications without using Windows registry. Based on his idea, I added a remote control mode to MMTTY. + + According to the discussion with Bob, I have incrementally added various functions to the mode. You can make full use of these functions by using Windows messages. + + Although I explain the usage of the functions in C, you can use other languages such as Visual Basic because the API should be the same. + +============================= +Receive and transmit messages +============================= + To communicate with MMTTY, you at first get a special message by + +UINT MSG_MMTTY = ::RegisterWindowMessage("MMTTY"); + +From now on, you are going to use this message value. + + To send a message to MMTTY, use the following API function. + + BOOL PostMessage(hwnd, uMsg, wParam, lParam) + HWND hwnd; // The handle of the receiver window + UINT uMsg; // The message to post + WPARAM wParam; // The first parameter of the message + LPARAM lParam; // The second parameter of the message + + To make MMTTY switch to TX, for example, you will send the following message. + + ::PostMessage(MMTTY_Handle, MSG_MMTTY, RXM_PTT, 2); + +You can use the following alternative scheme. + + BOOL PostThreadMessage(dwThreadId, uMsg, wParam, lParam) + DWORD dwThreadId; // Thread ID + UINT uMsg; // Message to post + WPARAM wParam; // The first parameter of the message + LPARAM lParam; // The second parameter of the message + + MMTTY accepts both methods. It should be noted, however, that MMTTY always sends a message to your window handle. + +================== +How to start MMTTY +================== + To communicate with MMTTY, you have to start MMTTY with an option. It is a good idea to start MMTTY by using the CreateProcess or WinExec function. + +MMTTY options + +Available options are: + +Option Button Menu +-t No No + FFT spectrum, Waterfall, and XY scope are displayed. + e.g. MMTTY -t + +Option Button Menu +-s No Yes + Control menus are displayed in addition to the above components. + e.g. MMTTY -s + +Option Button Menu +-u Yes No + Control buttons are displayed. + e.g. MMTTY -u + +Option Button Menu +-r Yes Yes + Control menus are also displayed in addition to the above components. + e.g. MMTTY -r + +Option +-f + The user cannot change the MMTTY window size with a mouse; still you can change the size by using a message. + e.g. MMTTY -r -f + +Option +-d + The MMTTY window does not have a title bar, and therefore, the user cannot change the MMTTY window size and location with a mouse. You can involve the MMTTY window as a control panel in your application window. It should be noted that, if you want to display your windows, such as a pop-up menu and a dialog box, you should keep them on the top of the Z order or turn off the MMTTY window. This option starts MMTTY with turning the MMTTY display off. You have to set the size and location of the MMTTY window and then turn its display on. + e.g. MMTTY -t -d + +Option +-m + MMTTY is iconized. This option is useful when you want to hide the MMTTY window. You can obtain the information on the FFT spectrum and XY scope through the shared memory. + e.g. MMTTY -m + + +Option +-hxxx... + xxx is a Window handle in hexadecimal. When you invoke MMTTY with -h option, MMTTY assumes xxx is the Window handle of your program and sends messages to it without using HWND_BORADCAST. xxx must be in hex. In case you cannot receive HWND_BROADCAST messages, you should use this option. Even with this option, you must notify MMTTY your Window handle when you receive TXM_HANDLE message from MMTTY. + +Option +-n +MMTTY does not translate the received characters to the BAUDOT code. + +Option +-p +MMTTY does not allow users to change the COM setting in the setup window. + +option +-Z + This option allows two or more MMTTY instances running simultaneously + e.g. MMTTY -m -Z +option +-a + This option disables the stay-on-top attribute of the MMTTY window. + +option +-Cxxx +This option specifies the name of the shared memory. xxx = shared memory name string. + +option +-Txxx +This option specifies the startup time limit. xxx = seconds in decimal. + + When MMTTY is invoked with one of these options (-r, -s, -t, -u), it displays the control panel only. The panel is always placed on the top of the window so that you can view it as a part of your program. The panel does not have a window for receive/transmission or logging. + + MMTTY memorizes the window size and position in the MMTTY.INI file. Therefore, you will have the same window size and position when you start MMTTY again, and you do not have to control them. + + The choice of the options is on you. I am going to explain the usage of messages and shared memory, but if you use -r option, you will only have to control TX/RX and character send/receive. If, however, you want to have more flexibility, use -t or -m option. + + +======================= +Exchange window handles +======================= + When MMTTY is invoked with a remote option, it sends the thread ID, window handle and the information on first-time invocation in the broadcast mode. + + ::PostMessage(HWND_BROADCAST, MSG_MMTTY, TXM_THREAD, MMTTY_ThreadId); + ::PostMessage(HWND_BROADCAST, MSG_MMTTY, TXM_HANDLE, MMTTY_Handle); + ::PostMessage(HWND_BROADCAST, MSG_MMTTY, TXM_START, 0x00000000); + + When you receive the message (TXM_HANDLE), you must send the window handle of your program back to MMTTY by + + ::PostMessage(MMTTY_Handle, MSG_MMTTY, TXM_HANDLE, Your_Handle); + + After receiving this message, MMTTY sends the messages only to Your_Handle. If MMTTY does not receive your message for 5 to 10 seconds, it automatically terminates itself. + + The method of receiving messages is dependent on a Compiler. Refer to the manual of your environment. + + +================= +Messages to MMTTY +================= + wParam is the message number. In C, each parameter is sequentially assigned a number. In the following example, 0x0003 is assigned to RXM_PTT. + +enum { + RXM_HANDLE=0x0000, // APP -> MMTTY + RXM_REQHANDLE, + RXM_EXIT, + RXM_PTT, + RXM_CHAR, + + RXM_WINPOS, + RXM_WIDTH, + RXM_REQPARA, + RXM_SETBAUD, + RXM_SETMARK, + + RXM_SETSPACE, + RXM_SETSWITCH, + RXM_SETHAM, + RXM_SHOWSETUP, + RXM_SETVIEW, + + RXM_SETSQLVL, + RXM_SHOW, + RXM_SETFIG, + RXM_SETRESO, + RXM_SETLPF + + RXM_SETTXDELAY, + RXM_UPDATECOM, + RXM_SUSPEND, + RXM_NOTCH, + RXM_PROFILE, + + RXM_TIMER, + RXM_ENBFOCUS, + RXM_SETDEFFREQ, + RXM_SETLENGTH, + RXM_ENBSHARED, + + RXM_PTTFSK, +}; + +1. Notification of the window handle + wParam = RXM_HANDLE + lParam = Your window handle + + When you change your window handle, you must send this message. + +2. Request of the window handle - you do not have to use this message. + wParam = RXM_REQHANDLE + lParam = 0x00000000 + +3. Termination of MMTTY + wParam = RXM_EXIT + lParam = 0x00000000 + + When you terminate your program, you must send this message to terminate MMTTY as well. MMTTY in the remote mode does not have any way to terminate itself. + +4. Switch TX/RX + wParam = RXM_PTT + lParam = 0x00000000 Switch to RX immediately + lParam = 0x00000001 Switch to RX after the transmission is completed + lParam = 0x00000002 Switch to TX + lParam = 0x00000004 Clear the TX buffer + +5. Send character + wParam = RXM_CHAR + lParam = Character code (ASCII) + This message functions only when MMTTY is in TX. + +When Bit 15 of the RXM_SETSWITCH message is 1, MMTTY uses the internal keyboard buffer for sending characters. With the keyboard buffer, you can use the BS code, the transmission buffering (i.e., Character out, Word out, or Line out), and the word-wrap function. +If MMTTY is started with -n option, MMTTY does not perform the ASCII-BAUDOT translation. MMTTY sends the character specified in lParam "as is." In this case, Bit 15 of the RXM_SETSWITCH is ignored. + +6. Move the display position + wParam = RXM_WINPOS + lParam (upper 16 bits) = Y-axis position (screen pixel value) + lParam (lower 16 bits) = X-axis position (screen pixel value) + +7. Resize the display width + wParam = RXM_WIDTH + lParam (upper 16 bits) = Display height (screen pixel value) + lParam (lower 16 bits) = Display width (screen pixel value) + +8. Request of parameters + wParam = RXM_REQPARA + lParam = 0 + + In response to this message, MMTTY sends back all the current parameters. + +9. Setting of baud rate + wParam = RXM_SETBAUD + lParam = Baud rate + + The real baud rate is given by multiplying 0.01 to this value; if lParam=4545 then baud_rate =45.45 for instance + +10. Mark frequency + wParam = RXM_SETMARK + lParam = Mark frequency (Hz) + +11. Space frequency + wParam = RXM_SETSPACE + lParam = Space frequency (Hz) + +12. Switch information (see below for details) + wParam = RXM_SETSWITCH + lParam = Switch information + +13. Set the HAM default + wParam = RXM_SETHAM + lParam = 0x00000000 + +14. Display of the setup window + wParam = RXM_SHOWSETUP + lParam = Disable application (0-OFF, 1-ON) + + If lParam is 1, the calling application does not respond to the keyboard or mouse when the setup window is shown. This is similar to the modal dialog box. + +15. Set of the display information (see below for details) + wParam = RXM_SETVIEW + lParam = Display information + +16. Squelch level + wParam = RXM_SETSQLVL + lParam = squelch level(0-1024) + +17. Display of the control panel (on/off) + wParam = RXM_SHOW + lParam = 0-OFF, 1-ON + +18. Setting of FIG/LTR + wParam = RXM_SETFIG + lParam = 0-LTR, 1-FIG + +19. Parameters of the resonator + wParam = RXM_SETRESO + lParam (lower 16 bits) = IIR BW + lParam (upper 16 bits) = FIR order + +20. Parameters of the integrator + wParam = RXM_SETLPF + lParam (lower 16 bits) = FIR smoothing filter frequency + lParam (upper 16 bits) = IIR-LPF cut-off frequency + +21. Transmission delay - default is 0 msec. + wParam = RXM_SETTXDELAY + lParam = 0 - 10000 (msec) + + MMTTY sends the TXM_PTTEVENT message at the timing of TX/RX switching. You can switch TX/RX PTT by receiving this message. However, you will have to delay the transmission if you have a time lag in switching. This delay could happen if you use the radio command. + +22. Notification of shared memory update + wParam = RXM_UPDATECOM + lParam = 0 + + You send this message to MMTTY when you change comName, comRadio, or title. Upon receiving this message, MMTTY updates these three members. + +23. Suspend + wParam = RXM_SUSPEND + lParam = 0 - restore, 1 - suspend + + lParam = 1: MMTTY releases the resources of the sound card and COM port, and hides itself. lParam = 0: MMTTY obtains the resources of the sound card and COM Port, and unhides itself. + Note that MMTTY will not unhide itself if it is started with the -m option. In case you use the sound card or the COM port by yourself, use this message to suspend MMTTY or terminate MMTTY. + +24. Notch (effective in version 1.59a or later) + wParam = RXM_NOTCH + lParam = Notch frequency (Hz) + +25. Save and load the profile (effective in version 1.61 or later) + wParam = RXM_PROFILE + lParam (lower 16 bits) = Slot number + lParam (upper 16 bits) = 0-Retrieve, 1-Store, 2-Delete, 3-Load, 4-Save, 5-Assign + + You can store the states of the demodulator, decoder, and modulator as the profile. + +Retrieve (upper 16 bits of lParam is 0) + Retrieve the profile from the specified slot. + The name of the profile can be referred to by the shared memory ProfileNames[x]. When you do not use the shared memory, you cannot refer to the name. + + +Store (upper 16 bits of lParam is 1) + Store the profile into the specified slot. + The name of the profile must be preassigned to the ProfileNames[x] of the shared memory. When you do not use the shared memory, MMTTY assigns an appropriate name to it. + + +Delete (upper 16 bits of lParam is 2) + Delete the profile in the specified slot. + + All the profile data are saved into UserPara.ini. For details, refer to "Store and Retrieve the Profile" in the later section of this document. + +Load (upper 16 bits of lParam is 3) + Display the file selection dialog box and load the profile from a file. + +Save (upper 16 bits of lParam is 4) + Display the file selection dialog box and save the profile to a file. + +Assign (upper 16 bits of lParam is 5) + Display the profile definition dialog box and register the profile. + + + It should be noted that you should not use Load/Save if the application is in the state of AlwaysStayOnTop. It is because the file selection dialog box might be hidden behind the application's window. + + +26. PTT timer (available version 1.61 or later) + wParam = RXM_TIMER, + lParam = Timer time (second) + + To turn PTT timer off, put 0 to the Timer time. + +27. Focus change enable/disable (effective in version 1.63A or later) + wParam = RXM_ENBFOCUS + lParam = 0-disable, 1-enable + + This parameter enables and disables the focus change driven by MMTTY. The default is "enable." + +28. Default frequency (effective in version 1.63B or later) + wParam = RXM_SETDEFFREQ + lParam = Upper 16 bits Default shift width [Hz] + lParam = Lower 16 bits Default mark frequency [Hz] + + These parameters specify the default mark frequency and shift width. MMTTY uses these values when the HAM button is depressed or when it is switched to TX with NET OFF. + +29. Bit length (effective in version 1.63B or later) + wParam = RXM_SETLENGTH + lParam = Bit length (5, 6, 7, 8) + + This parameter specifies the bit length of the TX code. Even if 8 bit is selected, code between 0xF0 and 0xFF are used by MMTTY and therefore not transmitted. + +30. Enable/disable the shared memory update (effective in version 1.64 or later) + wParam = RXM_ENBSHARED + lParam = 0-disable, 1-enable + + This parameter enables or disables the update operation to the shared memory. The default is Enabled. + +31. FSK keying via a PTT (Ver1.67B or later) + wParam = RXM_PTTFSK + lParam = 0-NONE, 1-ON(+Sound), 2-ON + + This parameter selects the PTT FSK keying. 0 for AFSK only, 1 for AFSK+FSK, 2 for FSK + +=================== +Messages from MMTTY +=================== + wParam is the message number. In C language, each parameter is assigned a number sequentially . In the following example, 0x8003 is assigned to TXM_CHAR. + +enum { + TXM_HANDLE=0x8000, // MMTTY -> APP + TXM_REQHANDLE, + TXM_START, + TXM_CHAR, + TXM_PTTEVENT, + + TXM_WIDTH, + TXM_BAUD, + TXM_MARK, + TXM_SPACE, + TXM_SWITCH, + + TXM_VIEW, + TXM_LEVEL, + TXM_FIGEVENT, + TXM_RESO, + TXM_LPF, + + TXM_THREAD + TXM_PROFILE, + TXM_NOTCH, + TXM_DEFSHIFT, + TXM_RADIOFREQ, + + TXM_SHOWSETUP, + TXM_SHOWPROFILE, +}; + +1. Notification of the window handle + wParam = TXM_HANDLE + lParam = MMTTY window handle + + MMTTY never changes its window handle but you must overwrite the MMTTY window handle if you receive this message just for sure. + +2. Request of the window handle - this message is not in use now. + wParam = TXM_REQHANDLE + lParam = 0x00000000 + +3. MMTTYstart information + wParam = TXM_START + lParam = 0x00000000 + + When MMTTY is executed for the first time, it sends this message in the broadcast mode (HWND_BROADCAST). + +4. Receive/transmit character + wParam = TXM_CHAR + lParam = Receive/transmit character (ASCII) +If MMTTY is started with -n option, MMTTY does not perform the ASCII-BAUDOT translation. MMTTY puts the received/transmitted character to lParam "as is." + + Every time MMTTY receives or transmits a character, it sends this message. + +5. Event notification of TX/RX switching + wParam = TXM_PTTEVENT + lParam = 0x00000000 MMTTY switches to RX + lParam = 0x00000001 MMTTY switches to TX + +6. Display height + wParam = TXM_WIDTH + lParam (upper 16 bits) = Display height (screen pixel value) + lParam (lower 16 bits) = Display width (screen pixel value) + +7. Baud rate + wParam = TXM_BAUD + lParam = Baud rate ( x 100 ) + (45.45[boo], lParam = 4545) + +8. Mark frequency + wParam = TXM_MARK + lParam = Mark frequency (Hz) + +9. Space frequency + wParam = TXM_SPACE + lParam = Space frequency (Hz) + +10. Switch information (see below for details) + wParam = TXM_SWITCH + lParam = Switch information + +11. Display information (see below for details) + wParam = TXM_VIEW + lParam = Display information + +12. Signal level + wParam = TXM_LEVEL + lParam (upper 16 bits) = squelch level (0-1024) + lParam (lower 16 bits) = signal level + + You can use this message to make an indicator. When you use a shared memory with MMTTY, you are notified the update event by this message. + +13. Notification of the shift state + wParam = TXM_FIGEVENT + lParam = 0-LTR, 1-FIG + +14. Parameters of the resonator + wParam = TXM_RESO + lParam (upper 16 bits) = IIR BW + lParam (lower 16 bits) = FIR order + +15. Parameters of the integrator + wParam = TXM_LPF + lParam (upper 16 bits) = FIR smoothing filter frequency + lParam (lower 16 bits) = IIR LPF cut-off frequency + +16. MMTTY thread ID + wParam = TXM_THREAD + lParam = thread ID + +17. Profile retrieving and storing (effective in version 1.61 or later) + wParam = TXM_PROFILE + lParam (upper 16 bits) = 0-Retrieve, 1-Store, 2-Delete + lParam (lower 16 bits = Slot number + +This event occurs when the profile is retrieved, stored, or deleted. + +18. Notch frequency (available in version 1.61 or later) + wParam = TXM_NOTCH + lParam (upper 16 bits) = Notch 1 frequency + lParam (lower 16 bits9 = Notch 2 frequency + +19. HAM default shift (available in version 1.61 or later ) + wParam = TXM_DEFSHIFT + lParam = shift frequency + +20. VFO polling frequency of RadioCommand (effective in version 1.62C or later) + wParam = TXM_RADIOFREQ + lParam = Frequency (KHz) + +21. Notification of the event of the setup window + wParam = TXM_SHOWSETUP + lParam = 0-closed, 1-opened + +22. Notification of the event of the profile load/save window + wParam = TXM_SHOWPROFILE + lParam = 0-closed, 1-opened + + +================================================ +Bit definition of Switch and Display information +================================================ +[lParam of the switch information] + b0-b1 Demodulator type 0-IIR, 1-FIR, 2-PLL + b2 AFC + b3 NET + b4 ATC + b5 BPF + b6 LMS/Notch + b7 SQ + b8 Rev + b9 UOS + b10-b11 AFC shift algorithm + b12 Integrator type 0-FIR, 1-IIR + b13 LMS or Notch 0-LMS, 1-Notch + b14 0-single notch, 1-two notches + b15 RXM_CHAR method 0-Key buffer OFF, 1-Key buffer ON + b16 Word wrap (effective only when the keyboard buffer is ON) + b17-b18 Way to send (effective only when the keyboard buffer is ON) + 0-Char, 1-Word, 2-Line + b19 Dual Peak Filter 0-OFF, 1-ON + +[lParam of the display information] + b0-b2 Display width of FFT spectrum + b4-b5 FFT gain + b6-b7 FFT response time + b8 XY scope size + b10-b11 XY scope quality + b12 XY scope display on/off + b13 FFT gain test mode + +============= +Shared memory +============= + MMTTY can get you the raw data of the FFT spectrum and XY scope. By this, you can arbitrarily display the FFT spectrum and XY scope in your window. If you use the MMTTY control panel, you need not this data. + + To utilize the shared memory, you must execute the following step before invoking MMTTY. + +#pragma pack(1) // Enable pack of structer (VisualC++) +#pragma option -a- // Enable pack of structer (Borland C++Builder) +typedef struct { + LONG smpFreq; // FFT display sampling frequency (->APP) + CHAR title[128]; // Control panel title (->MMTTY) + CHAR comName[16]; // PTT/FSK port name(->MMTTY) + LONG smpFFT; // 0-11025Hz 1-8000Hz base(->MMTTY) + LONG flagFFT; // FFT update flag (MMTTY <-> APP) + LONG arrayFFT[2048]; // FFT raw data (->APP) + LONG flagXY; // XY scope update flag (MMTTY <-> APP) + LONG arrayX[512]; // Mark signal raw data (->APP) + LONG arrayY[512]; // Space signal raw data (->APP) + CHAR verMMTTY[16]; // MMTTY version number (->APP) + CHAR RadioName[16]; // The port name for radio command (->MMTTY) + LONG flagLostSound; // True if MMTTY has lost the sound (->APP) + LONG flagOverflow; // True if the input level is too high (->APP) + LONG errorClock; // Clock adjustment value for the sound card (ppm) (->APP) + LONG smpDemFreq; // Sampling frequency of the demodulator (->APP) + LONG TxBufCount; // The number of data that have not sent yet and remain in the TX buffer (->APP) + CHAR ProfileName[16][64]; // Profile names + + LONG dummy[2048]; // Reserved +}COMARRAY; +#pragma pack() // Disable pack of structer (VisualC++) +#pragma option -a. // Disable pack of structer (Borland C++Builder) + + The instruction of the structure pack is dependent on a compiler. Make sure that there is no dummy space between members. Of course, you can access each atom with an offset address by declaring the whole struct in byte or long. + +HANDLE hMap; +COMARRAY *pMap = NULL; +hMap = ::CreateFileMapping(HANDLE(0xffffffff), NULL, PAGE_READWRITE, + 0, sizeof(COMARRAY), "MMTTY"); +if( hMap != NULL ){ + pMap = (COMARRAY *)::MapViewOfFile(hMap, FILE_MAP_WRITE, + 0, 0, 0); + if( pMap != NULL ){ + memset(pMap, 0, sizeof(COMARRAY)); // fill memory by 0 + } +} + + When MMTTY is invoked in the remote mode, it tries to open an inter-process shared memory named "MMTTY." If MMTTY successfully opened it, MMTTY then checks the title, comName and comRadio of the shared memory. + + In the title member, you specify the ASCIIZ text string that is appeared in the MMTTY control panel title and the Windows task bar. If the text string is NULL, MMTTY uses the default text string. + In the comName member, you specify the port name for the PTT control in the ASCIIZ format. If it is NULL, MMTTY uses the default port name defined by the user. + In the comRadio member, you specify the port name for the Radio Command in the ASCIIZ format. If it is NULL, MMTTY uses the default port name defined by the user. + + MMTTY periodically updates arrayFFT, arrayX, and arrayY, and then sends the TXM_LEVEL message. At this timing, if flagFFT is 0, MMTTY updates only arrayFFT and puts 1 to flagFFT. In the same manner, if flagXY is 0, MMTTY updates only arrayX and arrayY, and then puts 1 to flagXY. Irrespective of the flags' state, MMTTY periodically sends the TXM_LEVEL message. + + You can obtain the data by using the TXM_LEVEL message or by using the event of your timer. Be sure that flagFFT and flagXY are active. To continuously obtain the data, you must clear flagFFT and flagXY to 0 after you get the array data. + + MMTTY puts the raw data in the shared memory so as not to sacrifice the flexibility of your program. + + The frequency resolution of the FFT depends on the sampling frequency of MMTTY. The sampling frequency is specified by the smpFreq member in the shared memory. The initial value is 11025 Hz, but it can be changed by the user. The maximal amplitude of the FFT data is 256, but it can be a little bit over 256. + + If you want to use 8000 Hz as the sampling frequency base, you put 1 to the smpFFT member. In this case, MMTTY converts the FFT data from 11025 Hz base to 8000 Hz base. + + The XY scope data is constantly given at a half of 11025 Hz base sampling. I do not think you have to pay special attention to it. The amplitude can exceed +-16384. + + The default value of the flagLostSound member is 0, but it is set to non 0 if MMTTY cannot process the decoding operation presumably due to the CPU overload. + The default value of the flagOverflow member is 0, but it is set to non 0 if the input level is too high, that is, the input level exceeds the 3/4 of the maximal level. + These members automatically go back to 0 after the fault condition is cleared. It is a good idea to capture these conditions at the timing of the TXM_LEVEL message. + + The errorClock member has the clock adjustment value in PPM. The user can adjust the soundcard clock in the Setup window. + The smpDemFreq member has the sampling frequency of the MMTTY demodulator. + + The txBufCount member has the number of data that are in the TX buffer. It is a good idea to capture this data at the timing of the TXM_LEVEL message. + + +========================================================== +VB sample code for shared memory access by Bob Furzer K4CY +========================================================== +Here is a sample code for accessing the shared memory from VB. Bob sent me this code for reference (thanks again to Bob). Since I am not familiar with VB, I put the code unmodified. + +DO NOT SEND QUESTIONS ON THIS CODE TO BOB. I CANNOT ANSWER, EITHER. + +Global hMap As Long +Global pMap As Long + +Type COMARRAY + smpFreq As Long + title As String * 64 + comName As String * 8 + smpFFT As Long + flagFFT As Long + arrayFFT(2048) As Long + flagXY As Long + arrayX(512) As Long + arrayY(512) As Long + verMMTTY As String * 8 + dummy(2048) As Long +End Type + +Global SharedMemory As COMARRAY + +Private Sub Form_Load() + + Const PAGE_READWRITE = &H4 + Const SECTION_ALL_ACCESS = &H1 Or &H2 Or &H4 Or &H8 Or &H10 Or &HF0000 + + On Error Resume Next + + MMTTY_MSG = RegisterWindowMessage("MMTTY") + hMap = CreateFileMapping(-1, ByVal 0&, &H4, 0&, 20672, "MMTTY") + If hMap <> 0 Then + pMap = MapViewOfFile(hMap, SECTION_ALL_ACCESS, 0, 0, 0) + If pMap <> 0 Then + ZeroMemory ByVal pMap, 20672 + + SharedMemory.title = "RTTY Engine" & Chr$(0) + SharedMemory.radioName = "NONE" & Chr$(0) + SharedMemory.comName = "NONE" & Chr$(0) + SharedMemory.smpFFT = 1 + SharedMemory.flagFFT = 0 + + CopyMemory ByVal pMap + 4, ByVal SharedMemory.title, Len(SharedMemory.title) + CopyMemory ByVal pMap + 132, ByVal SharedMemory.radioName, Len(SharedMemory.radioName) + CopyMemory ByVal pMap + 12464, ByVal SharedMemory.comName, Len(SharedMemory.comName) + CopyMemory ByVal pMap + 148, VarPtr(SharedMemory.smpFFT), 4 + CopyMemory ByVal pMap + 152, VarPtr(SharedMemory.flagFFT), 4 + + X& = Shell("mmtty -t -h" & Hex$(Me.hwnd)) + MMTTYhWnd = FindWindow(vbNullString, SharedMemory.title) + Form1.Caption = Str$(MMTTYhWnd) + Else + X& = MsgBox("MapViewOfFile API Failed", vbOKOnly, "Catastrophic Error") + End If + Else + X& = MsgBox("CreateFileMapping API falied", vbOKOnly, "Catastrophic error") + End If +End Sub + +Private Sub Form_Unload(Cancel As Integer) + If UnmapViewOfFile(pMap) <> 0 Then Call CloseHandle(hMap) + X = PostMessage(MMTTYhWnd, MMTTY_MSG, 0, 0) +End Sub + +================== +Setup dialogue box +================== + MMTTY has many parameters. You can make MMTTY display the setup dialogue box by sending the RXM_SHOWSETUP message and provide a user with the setup user interface. + You might not be very happy with the dialogue box. However, you will not have to modify your program a lot even if MMTTY changes the demodulator/modulator in the future. + + +================== +Store and Retrieve of the Profile +================== + MMTTY has many parameters. It should not be a convenient way that the user opens the dialog box and changes the parameters' value during the RTTY operation. For this reason, I have added the profile menu in version 1.60B, so that the user can retrieve and store the parameters in a simple way. The profile has the parameters for the demodulator, decoder, and modulator. + + The stand-alone MMTTY has eight slots for the profile saving, while the remote-mode MMTTY has 16 slots (Slots 0 to 15) at maximum. Slots 0 to 7 are common to the stand-alone MMTTY. + + All the parameters in Slots 0 to 15 are stored as Define entries 0 to 15 in UserPara.ini file. + + The application even could modify the parameter in UserPara.ini file and send the RXM_PROFILE message to MMTTY in order to change the specific parameter. It is recommended to use Slot 15 as a temporary slot. + + If you have figured out a parameter set that works effectively for flutter or multi-path, it is a good idea to provide it to the users with your UserPara.ini, which you will include in your distribution package. In UserPara.ini, you can delete the definition lines of parameters that you do not want to change. + + When MMTTY saves the profile in the remote mode, it automatically assigns Remote 1 to Remote 16 to the names of profiles (Name=) in UserPara.ini. If you want to define another entry in UserPara.ini, you can create a specific entry (e.g., RemoteName=) and save a parameter there. MMTTY will not change the entry you have added. + + In case you do not use the shared memory, MMTTY automatically uses the names, Remote 1 - Remote 16, as the default profile names in UserPara.ini. If you define other names in your program, it is a good idea to make your own entry (e.g., RemoteName=) in UserPara.ini and store the data there. MMTTY never changes the entries you added. + + + +=============== +Closing comment +=============== +You may utilize the MMTTY remote mode with your program under the following conditions: + +1) - If you distribute your program as freeware, you can use the MMTTY remote mode and include MMTTY as a part of the distribution. + +2) - If you distribute a commercial program, you can include a code that uses the MMTTY remote mode in your software. However, you cannot include MMTTY as a part of the distribution. + +Authors of the software using the MMTTY remote mode do not have to get permission of JE3HHT - Makoto (Mako) Mori. Feel free to use MMTTY, as it is freeware. + + +73, Mako - JE3HHT + diff --git a/eupdate.txt b/eupdate.txt new file mode 100644 index 0000000..968948d --- /dev/null +++ b/eupdate.txt @@ -0,0 +1,180 @@ +MMTTY version up information + +*********************************************************************** +Revision history Ver1.68 -> Ver1.68A (JE3HHT) +*********************************************************************** +- Fixed RX level inconsistency +- Fixed context-sensitive help problem + +*********************************************************************** +Revision history Ver1.66G -> Ver1.68 (JE3HHT) +*********************************************************************** +- Added an FFT-based demodulator +- Updated the MMTTY web URL +- Added RXM_PTTFSK to the remote mode (Tnx to K4CY) +- Deleted Cabrillo export function +- Added Dual Peak Filter (Tnx to AA6YQ) + +*********************************************************************** +Revision history Ver1.66F -> Ver1.66G (AA6YQ) +*********************************************************************** + +1. Changes to the Main window's Options menu +- Soundcard Output Level works on Vista (tnx to Ken VE5KC) +- Soundcard Input Level works on Vista (tnx to Ken VE5KC) + +*********************************************************************** +Revision history Ver1.65D -> Ver1.66F (AA6YQ) +*********************************************************************** + +Dave, AA6YQ begins updating MMTTY + +1. Changes to the "MMTTY Setup" window + +A. "TX" tab +- renamed the "PTT" panel to "PTT & FSK" (tnx to Joe W4TV) +- added com8 through com16 to the "PTT & FSK" panel's "Port" selector +- clicking a button in the "Input Button" panel from a non-Japanese locale displays a window entitled "Edit Button" (tnx to Joe W + +B. "Misc" tab +- the new "Device Identifiers" panel enables independent selection of soundcard devices for reception ("RX") and transmission ("TX"); any of 16 input and output soundcard devices can be selected (tnx to Gil W0MN and Joe W4TV) +- selecting an "RX" or "TX" device identifier in the "Device Identifiers" panel updates the respective "Reception" or "Transmission" panels shown on the new "Soundcard" tab + +C. "Soundcard" tab (new) +- the "Reception" panel shows all installed soundcard input devices; selecting an input device updates the "RX" selector in the "Misc" tab's "Device Identifiers" panel +- the "Transmission" panel shows all installed soundcard output devices; selecting an output device updates the "TX" selector in the "Misc" tab's "Device Identifiers" panel + +2. Changes to the "Radio Command" window +- added com8 through com16 to the "Port" selector +- added 38400 and 57600 to the "Baud" selector (tnx to Joe W4TV) +- named the selector in the lower-left corner "Group" +- modified the contents of the "Group" selector: + +*** renamed the previous "Yaesu HF? (FT-1000MP,...)" entry to "Yaesu FT 1000D, 1000MP, 920" +*** renamed the previous "Yaesu VU? (FT-736,FT-847)" entry to "Yaesu FT 736, 817, 847, 857, 897" +*** added a "Yaesu FT 9000, 2000, 950, 450" entry (tnx to Joe W4TV and Art W2NRA) +*** renamed the previous "Kenwood" entry to "Kenwood, Elecraft" (tnx to Joe W4TV) + +- renamed the "Commands" panel's "VFO Polling" selector to "Model", and added entries for the Yaesu FT 9000, 2000, 950, and 450 (tnx to Joe W4TV) + +*********************************************************************** +Revision history Ver1.65 -> Ver1.65D +*********************************************************************** +- Added a gateway to Turbo Hamlog/Win version 5 (Tnx to JG1MOU) +- Fixed minor bugs + +*********************************************************************** +Revision history Ver1.64 -> Ver1.65 +*********************************************************************** +- Fixed a bug that caused the uncertain transmission in the remote mode. +- Fixed minor bugs + +*********************************************************************** +Revision history Ver1.63 -> Ver1.64 +*********************************************************************** + +- Improved the TX/RX switching speed in FSK +- Added custom log link +- Added custom RadioCommand +- Added custom sound +- Added custom TNC emulation +- Fixed minor bugs + +*********************************************************************** +Revision history Ver1.62 -> Ver1.63 +*********************************************************************** + +- Improved the low-level sound buffer processing +- Added the full-duplex mode +- Added TX offset for the soundcard +- Supported BARTG contest (serial number + UTC) +- Moved the RX log settings from the setup menu to the File menu +- Added JST245 support in frequency polling +- Added a menu for the version up information +- Added EXTFSK port (EXTFSK.DLL required) +- Added an option to accommodate J-BELL and S-BELL code sets +- Improved the program termination speed +- Supported WM_MOUSEWHEEL message +- Fixed some minor bugs + + +================================== +Improvement on the low-level sound processing +================================== + +The low-level sound processing has been improved. The user can preset the sizes of TX and RX FIFO buffers even independently. If you frequently see "Sound lost" in the spectrum scope window, try increasing the sizes of the FIFO buffers. + +Click on Option, Setup MMTTY, and Misc tab. You will find the drop down list for presetting the sizes at the top left corner of the window. + +* MMTTY now automatically adjusts the buffer size, which was defined in the Setup menu in the previous MMTTY versions. + + +================================ +Full duplex mode +================================ + +Version 1.62B has an option that simultaneously runs the record and play functions of the soundcard, so that it can make the external loop back possible. This is useful for the satellite communication and the monitor of the FSK operation. +Click Option, Setup MMTTY, and Misc tab. Select Ext.(SAT) in the Sound loopback pane to enable the full duplex mode. +The local echo option in the TX window of the Setup MMTTY has been deleted as it would result in the same effect as the no loop back mode. + +The internal linkage of the TX and RX modules for the no loop back, internal loop back, and external loop back modes are as follows: + + + + TxData ---> Modulator ---> Sound Out --> + | + --> RX window + + + + TxData ---> Modulator ---> Sound Out --> + | + --> Demodulator -> RX window + + + + TxData ---> Modulator ---> Sound Out ----> + + -- Sound In <-- + | + --> Demodulator -> RX window + + +=================================== +TX offset +=================================== + +Some soundcards inadvertently have different sampling frequencies in the record (RX) and play (TX) operations. With MMTTY version 1.62A, the user can calibrate the sampling frequency for TX. The parameter to be set in the TX offset is the same as that of MMSSTV. To obtain the precise value of the parameter, you have to use MMSSTV. In the case of RTTY, however, the TX offset is not necessarily very accurate contrary to SSTV. So the simple adjustment procedure shown below should give enough accuracy for RTTY. + +1) Adjust the RX sampling frequency. +2) Click on Option, Setup MMTTY, and Misc tab. Select Ext.(SAT) in the loop back. +3) Connect the output and input of the soundcard, or select "loop-back" or "Stereo/monaural mixer" in the mixer program of the volume control. +4) Adjust the TXOffset so that the twin peaks in the spectrum scope are on the line marker. + +According to my experiences, recent soundcards tend to come into one of the following three categories. + + RX TX TX offset + ~11025 ~11025 0 + ~11025 ~11100 75.00 + ~11100 ~11025 -75.00 + +Therefore, if you find some discrepancy in the spectrum scope, try putting 75.00 or -75.00 in the TXOffset. + +In RTTY, offset frequency 75Hz with respect to base frequency 11025Hz results in 5 to 15Hz frequency discrepancy. The baud rate discrepancy is about 6800ppm (0.68%). RTTY has substantial amount of margin for the discrepancies, so I do not think they are problematic in real QSOs. + + +================================================ +RX log setting moved from the setup menu to the File menu +================================================ +To save the system resources in the remote mode, the settings of the RX log have been moved from the setup menu to the File menu. Click on File and select Options of received-log. + +================== +EXTFSK port +================== +EXTFSK is used for the USB-FSK interface made by JA7UDE Oba. To use the EXTFSK port, select EXTFSK from the PTT port drop-down list in MMTTY Setup window. EXTFSK.DLL must exist in the same folder where MMTTY is installed. For more information, refer to the following web site. + +http://www.archi.is.tohoku.ac.jp/~ooba/ja7ude + + +73, Mako + diff --git a/fir.cpp b/fir.cpp new file mode 100644 index 0000000..09be08b --- /dev/null +++ b/fir.cpp @@ -0,0 +1,2181 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------------- +#include +#pragma hdrstop + +#include +#include "fir.h" + +//------------------------------------------------- +// ‚e‚h‚qƒtƒBƒ‹ƒ^‚Ì‚½‚½‚«ž‚݉‰ŽZ +double __fastcall DoFIR(double *hp, double *zp, double d, int tap) +{ + memcpy(zp, &zp[1], sizeof(double)*tap); + zp[tap] = d; + d = 0.0; + for( int i = 0; i <= tap; i++, hp++, zp++ ){ + d += (*zp) * (*hp); + } + return d; +} +//--------------------------------------------------------------------------- +CIIRTANK::CIIRTANK() +{ + b1 = b2 = a0 = z1 = z2 = 0; + SetFreq(2000.0, SampFreq, 50.0); +} +//--------------------------------------------------------------------------- +void CIIRTANK::SetFreq(double f, double smp, double bw) +{ + double lb1, lb2, la0; + lb1 = 2 * exp(-PI * bw/smp) * cos(2 * PI * f / smp); + lb2 = -exp(-2*PI*bw/smp); + if( bw ){ +#if 0 + const double _gt[]={18.0, 26.0, 20.0, 20.0}; + la0 = sin(2 * PI * f/smp) / (_gt[SampType] * 50 / bw); +#else + la0 = sin(2 * PI * f/smp) / ((smp/6.0) / bw); +#endif + } + else { + la0 = sin(2 * PI * f/smp); + } + b1 = lb1; b2 = lb2; a0 = la0; +} +//--------------------------------------------------------------------------- +double CIIRTANK::Do(double d) +{ + d *= a0; + d += (z1 * b1); + d += (z2 * b2); + z2 = z1; + if( fabs(d) < 1e-37 ) d = 0.0; + z1 = d; + return d; +} +//--------------------------------------------------------------------------- +CLMS::CLMS() +{ + Z = new double[TAPMAX+1]; + H = new double[TAPMAX+1]; + D = new double[DELAYMAX+1]; + memset(Z, 0, sizeof(double[TAPMAX+1])); + memset(H, 0, sizeof(double[TAPMAX+1])); + memset(D, 0, sizeof(double[DELAYMAX+1])); + + m_lmsADJSC = 1.0 / double(32768 * 32768); // ƒXƒP[ƒ‹’²®’l + m_lmsErr = m_lmsMErr = 0; + + m_Type = 1; // 0-LMS, 1-NOTICH + m_lmsNotch = 0; + m_lmsNotch2 = 0; + m_twoNotch = 0; + m_Tap = 56; + m_NotchTap = 72; + m_lmsInv = 0; + m_lmsDelay = 0; // LMS Delay + m_lmsAGC = 0; // LMS AGC + m_lmsMU2 = 0.003; // LMS 2ƒÊ + m_lmsGM = 0.9999; // LMS ƒÁ + m_bpf = 1; + SetWindow(2125, 2125+170); +} + +CLMS::~CLMS() +{ + delete[] D; + delete[] H; + delete[] Z; +} + +void CLMS::Copy(CLMS &other) +{ + m_Type = other.m_Type; + m_Tap = other.m_Tap; + m_NotchTap = other.m_NotchTap; + m_lmsInv = other.m_lmsInv; // LMS InvOutput + m_lmsDelay = other.m_lmsDelay; // LMS Delay + m_lmsAGC = other.m_lmsAGC; // LMS AGC + m_lmsMU2 = other.m_lmsMU2; // LMS 2ƒÊ + m_lmsGM = other.m_lmsGM; // LMS ƒÁ + m_lmsNotch = other.m_lmsNotch; + m_lmsNotch2 = other.m_lmsNotch2; + m_twoNotch = other.m_twoNotch; + m_bpf = other.m_bpf; + SetWindow(m_MarkFreq, m_SpaceFreq); +} + +void CLMS::GetFW(double &fl, double &fh, double fq) +{ + double fw; + if( fq < m_MarkFreq ){ + fw = m_MarkFreq - fq; + if( fw < 80.0 ){ + fw = 15.0; + } + else { + fw *= 0.5; + } + } + else if( fq > m_SpaceFreq ){ + fw = fq - m_SpaceFreq; + if( fw < 80.0 ){ + fw = 15.0; + } + else { + fw *= 0.5; + } + } + else { + fq = (m_MarkFreq + m_SpaceFreq)/2.0; + fw = 15.0; + } + fh = fq + fw; + fl = fq - fw; +} + +void CLMS::SetWindow(double mfq, double sfq) +{ + m_MarkFreq = mfq; + m_SpaceFreq = sfq; + if( m_Type ){ + if( m_lmsNotch && (m_lmsNotch2 == m_lmsNotch) ) m_lmsNotch2 = 0; + double fl, fh; + double c = (m_MarkFreq + m_SpaceFreq)/2; + if( !m_lmsNotch || ((m_lmsNotch >= m_MarkFreq) && (m_lmsNotch <= m_SpaceFreq)) ){ + m_lmsNotch = c; + GetFW(fl, fh, c); + MakeFilter(H, m_NotchTap, ffBEF, SampFreq, fl, fh, 10, 1.0); + if( (m_lmsNotch2 >= m_MarkFreq) && (m_lmsNotch2 <= m_SpaceFreq) ){ + m_lmsNotch2 = 0; + } + if( m_lmsNotch2 ){ + GetFW(fl, fh, m_lmsNotch2); + MakeFilter(HBPF, m_NotchTap, ffBEF, SampFreq, fl, fh, 10, 1.0); + } + } + else { + GetFW(fl, fh, m_lmsNotch); + MakeFilter(H, m_NotchTap, ffBEF, SampFreq, fl, fh, 10, 1.0); + if( (m_lmsNotch2 >= m_MarkFreq) && (m_lmsNotch2 <= m_SpaceFreq) ){ + m_lmsNotch2 = c; + } + if( m_lmsNotch2 ){ + GetFW(fl, fh, m_lmsNotch2); + MakeFilter(HBPF, m_NotchTap, ffBEF, SampFreq, fl, fh, 10, 1.0); + } + } + } + else { + MakeFilter(HBPF, m_Tap, ffBPF, SampFreq, m_MarkFreq - 150, m_SpaceFreq + 150, 60, 0.00002); + } +} +//------------------------------------------------- +// “K‰žƒtƒBƒ‹ƒ^‚̉‰ŽZ +double CLMS::Do(double d) +{ + double a = 0.0; + int i; + double *zp = Z; + double *hp = H; + if( m_Type ){ + if( !m_NotchTap ) return d; // ƒXƒ‹[‚ÌŽž + // ƒmƒbƒ`ƒtƒBƒ‹ƒ^ + memcpy(Z, &Z[1], sizeof(double)*m_NotchTap); + Z[m_NotchTap] = d; + for( i = 0; i <= m_NotchTap; i++, zp++, hp++ ){ + a += (*zp) * (*hp); + } + if( m_lmsNotch2 && m_twoNotch ){ + memcpy(D, &D[1], sizeof(double)*m_NotchTap); + D[m_NotchTap] = a; + zp = D; + hp = HBPF; + a = 0; + for( i = 0; i <= m_NotchTap; i++, zp++, hp++ ){ + a += (*zp) * (*hp); + } + } + return a; + } + else { + if( !m_Tap ) return d; // ƒXƒ‹[‚ÌŽž + // ƒgƒ‰ƒ“ƒXƒo[ƒTƒ‹ƒtƒBƒ‹ƒ^ + memcpy(Z, &Z[1], sizeof(double)*m_Tap); + Z[m_Tap] = D[0]; + for( i = 0; i <= m_Tap; i++, zp++, hp++ ){ + a += (*zp) * (*hp); + } + } + // Œë·ŒvŽZ + m_lmsErr = d - a; + m_lmsMErr = m_lmsErr * m_lmsMU2 * m_lmsADJSC; // lmsADJSC = 1/(32768 * 32768) ƒXƒP[ƒŠƒ“ƒO’²®’l + + // ’x‰„Ší‚̈ړ® + if( m_lmsDelay ) memcpy(D, &D[1], sizeof(double)*m_lmsDelay); + D[m_lmsDelay] = d; + + // ŒW”XV + zp = Z; + hp = H; + if( m_lmsAGC ){ + double sum = 0.0; + for( i = 0; i <= m_Tap; i++, zp++, hp++ ){ + *hp = (m_lmsMErr * (*zp)) + (*hp * m_lmsGM); + if( m_bpf ) *hp += HBPF[i]; + sum += fabs(*hp); + } + if( sum >= 1e-3 ) a /= sum; + } + else { + for( i = 0; i <= m_Tap; i++, zp++, hp++ ){ + *hp = (m_lmsMErr * (*zp)) + (*hp * m_lmsGM); + if( m_bpf ) *hp += HBPF[i]; + } + } + return m_lmsInv ? m_lmsErr : a; +} + +//********************************************************************* +// CDECM2 1/2ƒfƒVƒ[ƒ^ˆ—ƒNƒ‰ƒX +// +CDECM2::CDECM2() +{ + memset(Z1, 0, sizeof(Z1)); + memset(Z2, 0, sizeof(Z2)); + ::MakeFilter(H, 36, ffLPF, SampFreq, 2900, 3000, 70, 1.0); +} + +double CDECM2::Do(double d1, double d2) +{ + memcpy(Z1, &Z1[1], sizeof(double)*18); + memcpy(Z2, &Z2[1], sizeof(double)*17); + Z1[18] = d1; + Z2[17] = d2; + + double a; + a = Z1[0] * H[36]; + a += Z2[0] * H[35]; + a += Z1[1] * H[34]; + a += Z2[1] * H[33]; + a += Z1[2] * H[32]; + a += Z2[2] * H[31]; + a += Z1[3] * H[30]; + a += Z2[3] * H[29]; + a += Z1[4] * H[28]; + a += Z2[4] * H[27]; + a += Z1[5] * H[26]; + a += Z2[5] * H[25]; + a += Z1[6] * H[24]; + a += Z2[6] * H[23]; + a += Z1[7] * H[22]; + a += Z2[7] * H[21]; + a += Z1[8] * H[20]; + a += Z2[8] * H[19]; + a += Z1[9] * H[18]; + a += Z2[9] * H[17]; + a += Z1[10] * H[16]; + a += Z2[10] * H[15]; + a += Z1[11] * H[14]; + a += Z2[11] * H[13]; + a += Z1[12] * H[12]; + a += Z2[12] * H[11]; + a += Z1[13] * H[10]; + a += Z2[13] * H[9]; + a += Z1[14] * H[8]; + a += Z2[14] * H[7]; + a += Z1[15] * H[6]; + a += Z2[15] * H[5]; + a += Z1[16] * H[4]; + a += Z2[16] * H[3]; + a += Z1[17] * H[2]; + a += Z2[17] * H[1]; + a += Z1[18] * H[0]; + return a; +} + +#if 0 +//********************************************************************* +// CDECM2H 1/2ƒfƒVƒ[ƒ^ˆ—ƒNƒ‰ƒX 64tap +// +CDECM2H::CDECM2H() +{ + memset(Z1, 0, sizeof(Z1)); + memset(Z2, 0, sizeof(Z2)); + ::MakeFilter(H, 64, ffLPF, SampFreq, 2900, 3000, 70, 1.0); +} + +double CDECM2H::Do(double d1, double d2) +{ + memcpy(Z1, &Z1[1], sizeof(double)*32); + memcpy(Z2, &Z2[1], sizeof(double)*31); + Z1[32] = d1; + Z2[31] = d2; + + double a; + a = Z1[0] * H[64]; + a += Z2[0] * H[63]; + a += Z1[1] * H[62]; + a += Z2[1] * H[61]; + a += Z1[2] * H[60]; + a += Z2[2] * H[59]; + a += Z1[3] * H[58]; + a += Z2[3] * H[57]; + a += Z1[4] * H[56]; + a += Z2[4] * H[55]; + a += Z1[5] * H[54]; + a += Z2[5] * H[53]; + a += Z1[6] * H[52]; + a += Z2[6] * H[51]; + a += Z1[7] * H[50]; + a += Z2[7] * H[49]; + a += Z1[8] * H[48]; + a += Z2[8] * H[47]; + a += Z1[9] * H[46]; + a += Z2[9] * H[45]; + a += Z1[10] * H[44]; + a += Z2[10] * H[43]; + a += Z1[11] * H[42]; + a += Z2[11] * H[41]; + a += Z1[12] * H[40]; + a += Z2[12] * H[39]; + a += Z1[13] * H[38]; + a += Z2[13] * H[37]; + a += Z1[14] * H[36]; + a += Z2[14] * H[35]; + a += Z1[15] * H[34]; + a += Z2[15] * H[33]; + a += Z1[16] * H[32]; + a += Z2[16] * H[31]; + a += Z1[17] * H[30]; + a += Z2[17] * H[29]; + a += Z1[18] * H[28]; + a += Z2[18] * H[27]; + a += Z1[19] * H[26]; + a += Z2[19] * H[25]; + a += Z1[20] * H[24]; + a += Z2[20] * H[23]; + a += Z1[21] * H[22]; + a += Z2[21] * H[21]; + a += Z1[22] * H[20]; + a += Z2[22] * H[19]; + a += Z1[23] * H[18]; + a += Z2[23] * H[17]; + a += Z1[24] * H[16]; + a += Z2[24] * H[15]; + a += Z1[25] * H[14]; + a += Z2[25] * H[13]; + a += Z1[26] * H[12]; + a += Z2[26] * H[11]; + a += Z1[27] * H[10]; + a += Z2[27] * H[9]; + a += Z1[28] * H[8]; + a += Z2[28] * H[7]; + a += Z1[29] * H[6]; + a += Z2[29] * H[5]; + a += Z1[30] * H[4]; + a += Z2[30] * H[3]; + a += Z1[31] * H[2]; + a += Z2[31] * H[1]; + a += Z1[32] * H[0]; + return a; +} +#endif +#if 0 +//********************************************************************* +// CINTP2 ~2ƒCƒ“ƒ^ƒ|[ƒŒ[ƒ^ˆ—ƒNƒ‰ƒX +// +CINTP2::CINTP2() +{ + memset(Z, 0, sizeof(Z)); + ::MakeFilter(H, 36, ffLPF, SampFreq, 2900, 3000, 70, 2.0); +} + +void CINTP2::Do(double &d1, double &d2, double d) +{ + memcpy(Z, &Z[1], sizeof(double)*18); + Z[18] = d; + + d1 = Z[0] * H[36]; + d2 = Z[1] * H[35]; + d1 += Z[1] * H[34]; + d2 += Z[2] * H[33]; + d1 += Z[2] * H[32]; + d2 += Z[3] * H[31]; + d1 += Z[3] * H[30]; + d2 += Z[4] * H[29]; + d1 += Z[4] * H[28]; + d2 += Z[5] * H[27]; + d1 += Z[5] * H[26]; + d2 += Z[6] * H[25]; + d1 += Z[6] * H[24]; + d2 += Z[7] * H[23]; + d1 += Z[7] * H[22]; + d2 += Z[8] * H[21]; + d1 += Z[8] * H[20]; + d2 += Z[9] * H[19]; + d1 += Z[9] * H[18]; + d2 += Z[10] * H[17]; + d1 += Z[10] * H[16]; + d2 += Z[11] * H[15]; + d1 += Z[11] * H[14]; + d2 += Z[12] * H[13]; + d1 += Z[12] * H[12]; + d2 += Z[13] * H[11]; + d1 += Z[13] * H[10]; + d2 += Z[14] * H[9]; + d1 += Z[14] * H[8]; + d2 += Z[15] * H[7]; + d1 += Z[15] * H[6]; + d2 += Z[16] * H[5]; + d1 += Z[16] * H[4]; + d2 += Z[17] * H[3]; + d1 += Z[17] * H[2]; + d2 += Z[18] * H[1]; + d1 += Z[18] * H[0]; +} + +//********************************************************************* +// CDECM3 1/3ƒfƒVƒ[ƒ^ˆ—ƒNƒ‰ƒX +// +CDECM3::CDECM3() +{ + memset(Z1, 0, sizeof(Z1)); + memset(Z2, 0, sizeof(Z2)); + memset(Z3, 0, sizeof(Z3)); + ::MakeFilter(H, 48, ffLPF, SampFreq, 1300, 3000, 70, 1.0); +} + +double CDECM3::Do(double d1, double d2, double d3) +{ + memcpy(Z1, &Z1[1], sizeof(double)*16); + memcpy(Z2, &Z2[1], sizeof(double)*15); + memcpy(Z3, &Z3[1], sizeof(double)*15); + Z1[16] = d1; + Z2[15] = d2; + Z3[15] = d3; + + double a; + a = Z1[0] * H[48]; + a += Z3[0] * H[47]; + a += Z2[0] * H[46]; + a += Z1[1] * H[45]; + a += Z3[1] * H[44]; + a += Z2[1] * H[43]; + a += Z1[2] * H[42]; + a += Z3[2] * H[41]; + a += Z2[2] * H[40]; + a += Z1[3] * H[39]; + a += Z3[3] * H[38]; + a += Z2[3] * H[37]; + a += Z1[4] * H[36]; + a += Z3[4] * H[35]; + a += Z2[4] * H[34]; + a += Z1[5] * H[33]; + a += Z3[5] * H[32]; + a += Z2[5] * H[31]; + a += Z1[6] * H[30]; + a += Z3[6] * H[29]; + a += Z2[6] * H[28]; + a += Z1[7] * H[27]; + a += Z3[7] * H[26]; + a += Z2[7] * H[25]; + a += Z1[8] * H[24]; + a += Z3[8] * H[23]; + a += Z2[8] * H[22]; + a += Z1[9] * H[21]; + a += Z3[9] * H[20]; + a += Z2[9] * H[19]; + a += Z1[10] * H[18]; + a += Z3[10] * H[17]; + a += Z2[10] * H[16]; + a += Z1[11] * H[15]; + a += Z3[11] * H[14]; + a += Z2[11] * H[13]; + a += Z1[12] * H[12]; + a += Z3[12] * H[11]; + a += Z2[12] * H[10]; + a += Z1[13] * H[9]; + a += Z3[13] * H[8]; + a += Z2[13] * H[7]; + a += Z1[14] * H[6]; + a += Z3[14] * H[5]; + a += Z2[14] * H[4]; + a += Z1[15] * H[3]; + a += Z3[15] * H[2]; + a += Z2[15] * H[1]; + a += Z1[16] * H[0]; + return a; +} + +//********************************************************************* +// CINTP3 ~3ƒCƒ“ƒ^ƒ|[ƒŒ[ƒ^ˆ—ƒNƒ‰ƒX +// +CINTP3::CINTP3() +{ + memset(Z, 0, sizeof(Z)); + ::MakeFilter(H, 48, ffLPF, SampFreq, 1300, 3000, 70, 3.0); +} + +void CINTP3::Do(double &d1, double &d2, double &d3, double d) +{ + memcpy(Z, &Z[1], sizeof(double)*16); + Z[16] = d; + + d1 = Z[0] * H[48]; + d3 = Z[1] * H[47]; + d2 = Z[1] * H[46]; + d1 += Z[1] * H[45]; + d3 += Z[2] * H[44]; + d2 += Z[2] * H[43]; + d1 += Z[2] * H[42]; + d3 += Z[3] * H[41]; + d2 += Z[3] * H[40]; + d1 += Z[3] * H[39]; + d3 += Z[4] * H[38]; + d2 += Z[4] * H[37]; + d1 += Z[4] * H[36]; + d3 += Z[5] * H[35]; + d2 += Z[5] * H[34]; + d1 += Z[5] * H[33]; + d3 += Z[6] * H[32]; + d2 += Z[6] * H[31]; + d1 += Z[6] * H[30]; + d3 += Z[7] * H[29]; + d2 += Z[7] * H[28]; + d1 += Z[7] * H[27]; + d3 += Z[8] * H[26]; + d2 += Z[8] * H[25]; + d1 += Z[8] * H[24]; + d3 += Z[9] * H[23]; + d2 += Z[9] * H[22]; + d1 += Z[9] * H[21]; + d3 += Z[10] * H[20]; + d2 += Z[10] * H[19]; + d1 += Z[10] * H[18]; + d3 += Z[11] * H[17]; + d2 += Z[11] * H[16]; + d1 += Z[11] * H[15]; + d3 += Z[12] * H[14]; + d2 += Z[12] * H[13]; + d1 += Z[12] * H[12]; + d3 += Z[13] * H[11]; + d2 += Z[13] * H[10]; + d1 += Z[13] * H[9]; + d3 += Z[14] * H[8]; + d2 += Z[14] * H[7]; + d1 += Z[14] * H[6]; + d3 += Z[15] * H[5]; + d2 += Z[15] * H[4]; + d1 += Z[15] * H[3]; + d3 += Z[16] * H[2]; + d2 += Z[16] * H[1]; + d1 += Z[16] * H[0]; +} +#endif + + +/********************************************************************** + ‚e‚h‚qƒtƒBƒ‹ƒ^ÝŒvŠÖ” +**********************************************************************/ +/* +==================================================== + ƒxƒbƒZƒ‹ŠÖ” +==================================================== +*/ +static double I0(double x) +{ + double sum, xj; + int j; + + sum = 1.0; + xj = 1.0; + j = 1; + while(1){ + xj *= ((0.5 * x) / (double)j); + sum += (xj*xj); + j++; + if( ((0.00000001 * sum) - (xj*xj)) > 0 ) break; + } + return(sum); +} + +/* +==================================================== + ‚e‚h‚qƒtƒBƒ‹ƒ^‚ÌÝŒv +==================================================== +*/ +void MakeFilter(double *HP, int tap, int type, double fs, double fcl, double fch, double att, double gain) +{ + FIR fir; + + fir.typ = type; + fir.n = tap; + fir.fs = fs; + fir.fcl = fcl; + fir.fch = fch; + fir.att = att; + fir.gain = gain; + MakeFilter(HP, &fir); +} + +void MakeFilter(double *HP, FIR *fp) +{ + int j, m; + double alpha, win, fm, w0, sum; + double *hp; + + if( fp->typ == ffHPF ){ + fp->fc = 0.5*fp->fs - fp->fcl; + } + else if( fp->typ != ffLPF ){ + fp->fc = (fp->fch - fp->fcl)/2.0; + } + else { + fp->fc = fp->fcl; + } + if( fp->att >= 50.0 ){ + alpha = 0.1102 * (fp->att - 8.7); + } + else if( fp->att >= 21 ){ + alpha = (0.5842 * pow(fp->att - 21.0, 0.4)) + (0.07886 * (fp->att - 21.0)); + } + else { + alpha = 0.0; + } + + hp = fp->hp; + sum = PI*2.0*fp->fc/fp->fs; + if( fp->att >= 21 ){ // ƒCƒ“ƒpƒ‹ƒX‰ž“š‚Æ‘‹ŠÖ”‚ðŒvŽZ + for( j = 0; j <= (fp->n/2); j++, hp++ ){ + fm = (double)(2 * j)/(double)fp->n; + win = I0(alpha * sqrt(1.0-(fm*fm)))/I0(alpha); + if( !j ){ + *hp = fp->fc * 2.0/fp->fs; + } + else { + *hp = (1.0/(PI*(double)j))*sin((double)j*sum)*win; + } + } + } + else { // ƒCƒ“ƒpƒ‹ƒX‰ž“š‚̂݌vŽZ + for( j = 0; j <= (fp->n/2); j++, hp++ ){ + if( !j ){ + *hp = fp->fc * 2.0/fp->fs; + } + else { + *hp = (1.0/(PI*(double)j))*sin((double)j*sum); + } + } + } + hp = fp->hp; + sum = *hp++; + for( j = 1; j <= (fp->n/2); j++, hp++ ) sum += 2.0 * (*hp); + hp = fp->hp; + if( sum > 0.0 ){ + for( j = 0; j <= (fp->n/2); j++, hp++ ) (*hp) /= sum; + } + + // Žü”g”•ÏŠ· + + if( fp->typ == ffHPF ){ + hp = fp->hp; + for( j = 0; j <= (fp->n/2); j++, hp++ ) (*hp) *= cos((double)j*PI); + } + else if( fp->typ != ffLPF ){ + w0 = PI * (fp->fcl + fp->fch) / fp->fs; + if( fp->typ == ffBPF ){ + hp = fp->hp; + for( j = 0; j <= (fp->n/2); j++, hp++ ) (*hp) *= 2.0*cos((double)j*w0); + } + else { + hp = fp->hp; + *hp = 1.0 - (2.0 * (*hp)); + for( hp++, j = 1; j <= (fp->n/2); j++, hp++ ) (*hp) *= -2.0*cos((double)j*w0); + } + } + for( m = fp->n/2, hp = &fp->hp[m], j = m; j >= 0; j--, hp-- ){ + *HP++ = (*hp) * fp->gain; + } + for( hp = &fp->hp[1], j = 1; j <= (fp->n/2); j++, hp++ ){ + *HP++ = (*hp) * fp->gain; + } +} + +//--------------------------------------------------------------------------- +//‚e‚h‚qƒtƒBƒ‹ƒ^iƒqƒ‹ƒxƒ‹ƒg•ÏŠ·ƒtƒBƒ‹ƒ^j‚ÌÝŒv +// Added by JE3HHT on Aug.2010 +void __fastcall MakeHilbert(double *H, int N, double fs, double fc1, double fc2) +{ + int L = N / 2; + double T = 1.0 / fs; + + double W1 = 2 * PI * fc1; + double W2 = 2 * PI * fc2; + + // 2*fc2*T*SA((n-L)*W2*T) - 2*fc1*T*SA((n-L)*W1*T) + + double w; + int n; + double x1, x2; + for( n = 0; n <= N; n++ ){ + if( n == L ){ + x1 = x2 = 0.0; + } + else if( (n - L) ){ + x1 = ((n - L) * W1 * T); + x1 = cos(x1) / x1; + x2 = ((n - L) * W2 * T); + x2 = cos(x2) / x2; + } + else { + x1 = x2 = 1.0; + } + w = 0.54 - 0.46 * cos(2*PI*n/(N)); + H[n] = -(2 * fc2 * T * x2 - 2 * fc1 * T * x1) * w; + } + + if( N < 8 ){ + w = 0; + for( n = 0; n <= N; n++ ){ + w += fabs(H[n]); + } + if( w ){ + w = 1.0 / w; + for( n = 0; n <= N; n++ ){ + H[n] *= w; + } + } + } +} + +//--------------------------------------------------------------------- +// Žü”g”“Á«ƒOƒ‰ƒtiƒtƒBƒ‹ƒ^ƒXƒŒƒbƒh“à‚ŃR[ƒ‹‚µ‚Ă͂¢‚¯‚È‚¢j +// +// H(ejƒÖT) = [ƒ°0]Hm cos(mƒÖT) - j[ƒ°1]Hm sin(mƒÖT) +// +void DrawGraph(Graphics::TBitmap *pBitmap, const double *H, int Tap, int Over, int &nmax, int init, TColor col) +{ + int k, x, y; + double f, gdb, g, pi2t, fs; + double max; + char bf[80]; + + TCanvas *tp = pBitmap->Canvas; + TRect rc; + rc.Left = 0; + rc.Right = pBitmap->Width; + rc.Top = 0; + rc.Bottom = pBitmap->Height; + if( init ){ + tp->Brush->Color = clWhite; + tp->FillRect(rc); + } + int LM; // Žü”g”•\ަ‚Ì‚ ‚郉ƒCƒ“” + int DM; // “à•”ü‚Ì” + int MM; // ŽÀü‚ÌŠÔŠu + switch(Over){ + case 2: + max = 3000; + fs = SampFreq/2.0; + break; + case 3: + max = 2000; + fs = SampFreq/3.0; + break; + default: + max = 4000; + fs = SampFreq; + break; + } + if( nmax ){ + max = nmax; + } + else { + nmax = max; + } + switch(nmax){ + case 3000: + LM = 3; + DM = 14; + MM = 5; + break; + case 100: + case 200: + case 2000: + LM = 4; + DM = 19; + MM = 5; + break; + case 400: + case 800: + case 4000: + LM = 4; + DM = 19; + MM = 5; + break; + default: // 6000 + LM = 3; + DM = 11; + MM = 4; + break; + } + int XL = 32; + int XR = pBitmap->Width - 16; + int YT = 16; + int YB = pBitmap->Height - 24; + + int i; + if( init ){ + tp->Pen->Color = clBlack; + tp->Font->Size = 8; + tp->MoveTo(XL, YT); tp->LineTo(XR, YT); tp->LineTo(XR, YB); tp->LineTo(XL, YB); tp->LineTo(XL, YT); + tp->Pen->Color = clGray; + for( i = 0; i < 7; i++ ){ + tp->Pen->Style = (i & 1) ? psSolid : psDot; + y = (int)(double(i + 1) * double(YB - YT)/8.0 + YT); + tp->MoveTo(XL, y); tp->LineTo(XR, y); + } + for( i = 1; i < 5; i++ ){ + y = (int)(double(i) * double(YB - YT)/4.0 + YT); + sprintf( bf, "-%2u", (80 / 4)*i ); + ::SetBkMode(tp->Handle, TRANSPARENT); + tp->TextOut(XL - 6 - tp->TextWidth(bf), y - (tp->TextHeight(bf)/2), bf); + } + strcpy(bf, "dB"); + tp->TextOut(XL - 6 - tp->TextWidth(bf), YT-(tp->TextHeight(bf)/2), bf); + for( i = 1; i <= DM; i++ ){ + tp->Pen->Style = (i % MM) ? psDot : psSolid; + x = (int)(double(i) * double(XR - XL)/double(DM+1) + XL); + tp->MoveTo(x, YT); tp->LineTo(x, YB); + } + for( i = 0; i <= LM; i++ ){ + x = (int)(double(i) * double(XR - XL)/double(LM) + XL); + sprintf(bf, "%4.0lf", (max*i)/LM); + ::SetBkMode(tp->Handle, TRANSPARENT); + tp->TextOut(x - (tp->TextWidth(bf)/2), YB + 6, bf); + } + tp->Pen->Color = clRed; + tp->Pen->Style = psDot; + x = (int)(XL + (fs/2) * (double(XR-XL)/max)); + tp->MoveTo(x, YT); tp->LineTo(x, YB); + + tp->Pen->Color = clBlue; + tp->Pen->Style = psSolid; + } + int ay = 0; + double ra, im; + pi2t = 2.0 * PI / fs; + tp->Pen->Color = col; + for( x = XL, f = 0.0; x < XR; x++, f += (max/double(XR-XL)) ){ + if( Tap ){ + ra = im = 0.0; + for( k = 0; k <= Tap; k++ ){ + ra += H[k] * cos(pi2t*f*k); + if( k ) im -= H[k] * sin(pi2t*f*k); + } + if( ra * im ){ + g = sqrt(ra * ra + im * im); + } + else { + g = 0.0; + } + } + else { + g = 1.0; + } + if( g == 0 ) g = 1.0e-38; + gdb = 20*0.4342944*log(fabs(g)) + 80.0; + if( gdb < 0.0 ) gdb = 0.0; + gdb = (gdb * double(YB-YT))/80.0; + y = YB - (int)gdb; + if( x == XL ){ + tp->MoveTo(x, y); + tp->LineTo(x, y); + } + else { + tp->MoveTo(x-1, ay); + tp->LineTo(x, y); + } + ay = y; + } +} + +void DrawGraph2(Graphics::TBitmap *pBitmap, const double *H1, int Tap1, const double *H2, int Tap2, int Over, int &nmax, int init, TColor col) +{ + int k, x, y; + double f, gdb, g, pi2t, fs; + double max; + char bf[80]; + + TCanvas *tp = pBitmap->Canvas; + TRect rc; + rc.Left = 0; + rc.Right = pBitmap->Width; + rc.Top = 0; + rc.Bottom = pBitmap->Height; + if( init ){ + tp->Brush->Color = clWhite; + tp->FillRect(rc); + } + int LM; // Žü”g”•\ަ‚Ì‚ ‚郉ƒCƒ“” + int DM; // “à•”ü‚Ì” + int MM; // ŽÀü‚ÌŠÔŠu + switch(Over){ + case 2: + max = 3000; + fs = SampFreq/2.0; + break; + case 3: + max = 2000; + fs = SampFreq/3.0; + break; + default: + max = 4000; + fs = SampFreq; + break; + } + if( nmax ){ + max = nmax; + } + else { + nmax = max; + } + switch(nmax){ + case 3000: + LM = 3; + DM = 14; + MM = 5; + break; + case 100: + case 200: + case 2000: + LM = 4; + DM = 19; + MM = 5; + break; + case 400: + case 800: + case 4000: + LM = 4; + DM = 19; + MM = 5; + break; + default: // 6000 + LM = 3; + DM = 11; + MM = 4; + break; + } + int XL = 32; + int XR = pBitmap->Width - 16; + int YT = 16; + int YB = pBitmap->Height - 24; + + int i; + if( init ){ + tp->Pen->Color = clBlack; + tp->Font->Size = 8; + tp->MoveTo(XL, YT); tp->LineTo(XR, YT); tp->LineTo(XR, YB); tp->LineTo(XL, YB); tp->LineTo(XL, YT); + tp->Pen->Color = clGray; + for( i = 0; i < 7; i++ ){ + tp->Pen->Style = (i & 1) ? psSolid : psDot; + y = (int)(double(i + 1) * double(YB - YT)/8.0 + YT); + tp->MoveTo(XL, y); tp->LineTo(XR, y); + } + for( i = 1; i < 5; i++ ){ + y = (int)(double(i) * double(YB - YT)/4.0 + YT); + sprintf( bf, "-%2u", (80 / 4)*i ); + ::SetBkMode(tp->Handle, TRANSPARENT); + tp->TextOut(XL - 6 - tp->TextWidth(bf), y - (tp->TextHeight(bf)/2), bf); + } + strcpy(bf, "dB"); + tp->TextOut(XL - 6 - tp->TextWidth(bf), YT-(tp->TextHeight(bf)/2), bf); + for( i = 1; i <= DM; i++ ){ + tp->Pen->Style = (i % MM) ? psDot : psSolid; + x = (int)(double(i) * double(XR - XL)/double(DM+1) + XL); + tp->MoveTo(x, YT); tp->LineTo(x, YB); + } + for( i = 0; i <= LM; i++ ){ + x = (int)(double(i) * double(XR - XL)/double(LM) + XL); + sprintf(bf, "%4.0lf", (max*i)/LM); + ::SetBkMode(tp->Handle, TRANSPARENT); + tp->TextOut(x - (tp->TextWidth(bf)/2), YB + 6, bf); + } + tp->Pen->Color = clRed; + tp->Pen->Style = psDot; + x = (int)(XL + (fs/2) * (double(XR-XL)/max)); + tp->MoveTo(x, YT); tp->LineTo(x, YB); + + tp->Pen->Color = clBlue; + tp->Pen->Style = psSolid; + } + int ay = 0; + double ra, im; + pi2t = 2.0 * PI / fs; + tp->Pen->Color = col; + for( x = XL, f = 0.0; x < XR; x++, f += (max/double(XR-XL)) ){ + if( Tap1 ){ + ra = im = 0.0; + for( k = 0; k <= Tap1; k++ ){ + ra += H1[k] * cos(pi2t*f*k); + if( k ) im -= H1[k] * sin(pi2t*f*k); + } + if( ra * im ){ + g = sqrt(ra * ra + im * im); + } + else { + g = 0.0; + } + } + else { + g = 1.0; + } + if( Tap2 ){ + ra = im = 0.0; + for( k = 0; k <= Tap2; k++ ){ + ra += H2[k] * cos(pi2t*f*k); + if( k ) im -= H2[k] * sin(pi2t*f*k); + } + if( ra * im ){ + g *= sqrt(ra * ra + im * im); + } + else { + g *= 0.0; + } + } + else { + g *= 1.0; + } + if( g == 0 ) g = 1.0e-38; + gdb = 20*0.4342944*log(fabs(g)) + 80.0; + if( gdb < 0.0 ) gdb = 0.0; + gdb = (gdb * double(YB-YT))/80.0; + y = YB - (int)gdb; + if( x == XL ){ + tp->MoveTo(x, y); + tp->LineTo(x, y); + } + else { + tp->MoveTo(x-1, ay); + tp->LineTo(x, y); + } + ay = y; + } +} + +//--------------------------------------------------------------------- +// Žü”g”“Á«ƒOƒ‰ƒtiƒtƒBƒ‹ƒ^ƒXƒŒƒbƒh“à‚ŃR[ƒ‹‚µ‚Ă͂¢‚¯‚È‚¢j +// +// +void DrawGraphIIR(Graphics::TBitmap *pBitmap, double a0, double a1, double a2, double b1, double b2, int Over, int &nmax, int init, TColor col) +{ + int x, y; + double f, gdb, g, pi2t, pi4t, fs; + double max; + char bf[80]; + + TCanvas *tp = pBitmap->Canvas; + TRect rc; + rc.Left = 0; + rc.Right = pBitmap->Width; + rc.Top = 0; + rc.Bottom = pBitmap->Height; + if( init ){ + tp->Brush->Color = clWhite; + tp->FillRect(rc); + } + int LM; // Žü”g”•\ަ‚Ì‚ ‚郉ƒCƒ“” + int DM; // “à•”ü‚Ì” + int MM; // ŽÀü‚ÌŠÔŠu + switch(Over){ + case 2: + max = 3000; + fs = SampFreq/2.0; + break; + case 3: + max = 2000; + fs = SampFreq/3.0; + break; + default: + max = 4000; + fs = SampFreq; + break; + } + if( nmax ){ + max = nmax; + } + else { + nmax = max; + } + switch(nmax){ + case 3000: + LM = 3; + DM = 14; + MM = 5; + break; + case 100: + case 200: + case 2000: + LM = 4; + DM = 19; + MM = 5; + break; + case 400: + case 800: + case 4000: + LM = 4; + DM = 19; + MM = 5; + break; + default: // 6000 + LM = 3; + DM = 11; + MM = 4; + break; + } + int XL = 32; + int XR = pBitmap->Width - 16; + int YT = 16; + int YB = pBitmap->Height - 24; + + int i; + if( init ){ + tp->Pen->Color = clBlack; + tp->Font->Size = 8; + tp->MoveTo(XL, YT); tp->LineTo(XR, YT); tp->LineTo(XR, YB); tp->LineTo(XL, YB); tp->LineTo(XL, YT); + tp->Pen->Color = clGray; + for( i = 0; i < 5; i++ ){ + tp->Pen->Style = (i & 1) ? psSolid : psDot; + y = (int)(double(i + 1) * double(YB - YT)/6.0 + YT); + tp->MoveTo(XL, y); tp->LineTo(XR, y); + } + for( i = 1; i < 4; i++ ){ + y = (int)(double(i) * double(YB - YT)/3.0 + YT); + sprintf( bf, "-%2u", (60 / 3)*i ); + ::SetBkMode(tp->Handle, TRANSPARENT); + tp->TextOut(XL - 6 - tp->TextWidth(bf), y - (tp->TextHeight(bf)/2), bf); + } + strcpy(bf, "dB"); + tp->TextOut(XL - 6 - tp->TextWidth(bf), YT-(tp->TextHeight(bf)/2), bf); + for( i = 1; i <= DM; i++ ){ + tp->Pen->Style = (i % MM) ? psDot : psSolid; + x = (int)(double(i) * double(XR - XL)/double(DM+1) + XL); + tp->MoveTo(x, YT); tp->LineTo(x, YB); + } + for( i = 0; i <= LM; i++ ){ + x = (int)(double(i) * double(XR - XL)/double(LM) + XL); + sprintf(bf, "%4.0lf", (max*i)/LM); + ::SetBkMode(tp->Handle, TRANSPARENT); + tp->TextOut(x - (tp->TextWidth(bf)/2), YB + 6, bf); + } + tp->Pen->Color = clRed; + tp->Pen->Style = psDot; + x = (int)(XL + (fs/2) * (double(XR-XL)/max)); + tp->MoveTo(x, YT); tp->LineTo(x, YB); + + tp->Pen->Color = clBlue; + tp->Pen->Style = psSolid; + } + int ay = 0; + pi2t = 2.0 * PI / fs; + pi4t = 2.0 * pi2t; + tp->Pen->Color = col; + double A, B, C, D, P, R; + double cosw, sinw, cos2w, sin2w; + for( x = XL, f = 0.0; x < XR; x++, f += (max/double(XR-XL)) ){ + cosw = cos(pi2t*f); + sinw = sin(pi2t*f); + cos2w = cos(pi4t*f); + sin2w = sin(pi4t*f); + A = a0 + a1 * cosw + a2 * cos2w; + B = 1 + b1 * cosw + b2 * cos2w; + C = a1 * sinw + a2 * sin2w; + D = b1 * sinw + b2 * sin2w; + P = A*A + C*C; + R = B*B + D*D; + g = sqrt(P/R); + if( g == 0 ) g = 1.0e-38; + gdb = 20*0.4342944*log(fabs(g)) + 60.0; + if( gdb < 0.0 ) gdb = 0.0; + gdb = (gdb * double(YB-YT))/60.0; + y = YB - (int)gdb; + if( x == XL ){ + tp->MoveTo(x, y); + tp->LineTo(x, y); + } + else { + tp->MoveTo(x-1, ay); + tp->LineTo(x, y); + } + ay = y; + } +} + +//--------------------------------------------------------------------- +// Žü”g”“Á«ƒOƒ‰ƒtiƒtƒBƒ‹ƒ^ƒXƒŒƒbƒh“à‚ŃR[ƒ‹‚µ‚Ă͂¢‚¯‚È‚¢j +// +// +void DrawGraphIIR(Graphics::TBitmap *pBitmap, CIIR *ip, int Over, int &nmax, int init, TColor col) +{ + int x, y; + double f, gdb, g, pi2t, pi4t, fs; + double max; + char bf[80]; + + TCanvas *tp = pBitmap->Canvas; + TRect rc; + rc.Left = 0; + rc.Right = pBitmap->Width; + rc.Top = 0; + rc.Bottom = pBitmap->Height; + if( init ){ + tp->Brush->Color = clWhite; + tp->FillRect(rc); + } + int LM; // Žü”g”•\ަ‚Ì‚ ‚郉ƒCƒ“” + int DM; // “à•”ü‚Ì” + int MM; // ŽÀü‚ÌŠÔŠu + switch(Over){ + case 2: + max = 3000; + fs = SampFreq/2.0; + break; + case 3: + max = 2000; + fs = SampFreq/3.0; + break; + default: + max = 4000; + fs = SampFreq; + break; + } + if( nmax ){ + max = nmax; + } + else { + nmax = max; + } + switch(nmax){ + case 3000: + LM = 3; + DM = 14; + MM = 5; + break; + case 100: + case 200: + case 2000: + LM = 4; + DM = 19; + MM = 5; + break; + case 400: + case 800: + case 4000: + LM = 4; + DM = 19; + MM = 5; + break; + default: // 6000 + LM = 3; + DM = 11; + MM = 4; + break; + } + int XL = 32; + int XR = pBitmap->Width - 16; + int YT = 16; + int YB = pBitmap->Height - 24; + + int i; + if( init ){ + tp->Pen->Color = clBlack; + tp->Font->Size = 8; + tp->MoveTo(XL, YT); tp->LineTo(XR, YT); tp->LineTo(XR, YB); tp->LineTo(XL, YB); tp->LineTo(XL, YT); + tp->Pen->Color = clGray; + for( i = 0; i < 5; i++ ){ + tp->Pen->Style = (i & 1) ? psSolid : psDot; + y = (int)(double(i + 1) * double(YB - YT)/6.0 + YT); + tp->MoveTo(XL, y); tp->LineTo(XR, y); + } + for( i = 1; i < 4; i++ ){ + y = (int)(double(i) * double(YB - YT)/3.0 + YT); + sprintf( bf, "-%2u", (60 / 3)*i ); + ::SetBkMode(tp->Handle, TRANSPARENT); + tp->TextOut(XL - 6 - tp->TextWidth(bf), y - (tp->TextHeight(bf)/2), bf); + } + strcpy(bf, "dB"); + tp->TextOut(XL - 6 - tp->TextWidth(bf), YT-(tp->TextHeight(bf)/2), bf); + for( i = 1; i <= DM; i++ ){ + tp->Pen->Style = (i % MM) ? psDot : psSolid; + x = (int)(double(i) * double(XR - XL)/double(DM+1) + XL); + tp->MoveTo(x, YT); tp->LineTo(x, YB); + } + for( i = 0; i <= LM; i++ ){ + x = (int)(double(i) * double(XR - XL)/double(LM) + XL); + sprintf(bf, "%4.0lf", (max*i)/LM); + ::SetBkMode(tp->Handle, TRANSPARENT); + tp->TextOut(x - (tp->TextWidth(bf)/2), YB + 6, bf); + } + tp->Pen->Color = clRed; + tp->Pen->Style = psDot; + x = (int)(XL + (fs/2) * (double(XR-XL)/max)); + tp->MoveTo(x, YT); tp->LineTo(x, YB); + + tp->Pen->Color = clBlue; + tp->Pen->Style = psSolid; + } + int ay = 0; + pi2t = 2.0 * PI / fs; + pi4t = 2.0 * pi2t; + tp->Pen->Color = col; + double A, B, C, D, P, R; + double cosw, sinw, cos2w, sin2w; + for( x = XL, f = 0.0; x < XR; x++, f += (max/double(XR-XL)) ){ + cosw = cos(pi2t*f); + sinw = sin(pi2t*f); + cos2w = cos(pi4t*f); + sin2w = sin(pi4t*f); + g = 1.0; + double *ap = ip->A; + double *bp = ip->B; + for( i = 0; i < ip->m_order/2; i++, ap += 3, bp += 2 ){ +/* + A = a0 + a1 * cosw + a2 * cos2w; + B = 1 + b1 * cosw + b2 * cos2w; + C = a1 * sinw + a2 * sin2w; + D = b1 * sinw + b2 * sin2w; +*/ + A = bp[0] + bp[1] * cosw + bp[0] * cos2w; + B = 1 + -ap[1] * cosw + -ap[2] * cos2w; + C = bp[1] * sinw + bp[0] * sin2w; + D = -ap[1] * sinw + -ap[2] * sin2w; + P = A*A + C*C; + R = B*B + D*D; + g *= sqrt(P/R); + } + if( ip->m_order & 1 ){ + A = bp[0] + bp[1] * cosw; + B = 1 + -ap[1] * cosw; + C = bp[1] * sinw; + D = -ap[1] * sinw; + P = A*A + C*C; + R = B*B + D*D; + g *= sqrt(P/R); + } + if( g == 0 ) g = 1.0e-38; + gdb = 20*0.4342944*log(fabs(g)) + 60.0; + if( gdb < 0.0 ) gdb = 0.0; + gdb = (gdb * double(YB-YT))/60.0; + y = YB - (int)gdb; + if( x == XL ){ + tp->MoveTo(x, y); + tp->LineTo(x, y); + } + else { + tp->MoveTo(x-1, ay); + tp->LineTo(x, y); + } + ay = y; + } +} + +double asinh(double x) +{ + return log(x + sqrt(x*x+1.0)); +} + +//------------------------------------------------------------------ +// bc : 0-ƒoƒ^[ƒ[ƒX, 1-ƒ`ƒFƒrƒVƒt +// rp : ’ʉ߈æ‚ÌƒŠƒbƒvƒ‹ +void MakeIIR(double *A, double *B, double fc, double fs, int order, int bc, double rp) +{ + double w0, wa, u, zt, x; + int j, n; + + if( bc ){ // ƒ`ƒFƒrƒVƒt + u = 1.0/double(order)*asinh(1.0/sqrt(pow(10.0,0.1*rp)-1.0)); + } + wa = tan(PI*fc/fs); + w0 = 1.0; + n = (order & 1) + 1; + double *pA = A; + double *pB = B; + double d1, d2; + for( j = 1; j <= order/2; j++, pA+=3, pB+=2 ){ + if( bc ){ // ƒ`ƒFƒrƒVƒt + d1 = sinh(u)*cos(n*PI/(2*order)); + d2 = cosh(u)*sin(n*PI/(2*order)); + w0 = sqrt(d1 * d1 + d2 * d2); + zt = sinh(u)*cos(n*PI/(2*order))/w0; + } + else { // ƒoƒ^[ƒ[ƒX + w0 = 1.0; + zt = cos(n*PI/(2*order)); + } + pA[0] = 1 + wa*w0*2*zt + wa*w0*wa*w0; + pA[1] = -2 * (wa*w0*wa*w0 - 1)/pA[0]; + pA[2] = -(1.0 - wa*w0*2*zt + wa*w0*wa*w0)/pA[0]; + pB[0] = wa*w0*wa*w0 / pA[0]; + pB[1] = 2*pB[0]; + n += 2; + } + if( bc && !(order & 1) ){ + x = pow( 1.0/pow(10.0,rp/20.0), 1/double(order/2) ); + pB = B; + for( j = 1; j <= order/2; j++, pB+=2 ){ + pB[0] *= x; + pB[1] *= x; + } + } + if( order & 1 ){ + if( bc ) w0 = sinh(u); + j = (order / 2); + pA = A + (j*3); + pB = B + (j*2); + pA[0] = 1 + wa*w0; + pA[1] = -(wa*w0 - 1)/pA[0]; + pB[0] = wa*w0/pA[0]; + pB[1] = pB[0]; + } +} + +//--------------------------------------------------------------------------- +CIIR::CIIR() +{ + m_order = 0; + A = new double[IIRMAX*3]; + B = new double[IIRMAX*2]; + Z = new double[IIRMAX*2]; + memset(A, 0, sizeof(double[IIRMAX*3])); + memset(B, 0, sizeof(double[IIRMAX*2])); + memset(Z, 0, sizeof(double[IIRMAX*2])); +} + +CIIR::~CIIR() +{ + if( A != NULL ) delete[] A; + if( B != NULL ) delete[] B; + if( Z != NULL ) delete[] Z; +} + +void CIIR::Clear(void) +{ + memset(Z, 0, sizeof(double[IIRMAX*2])); +} + +void CIIR::MakeIIR(double fc, double fs, int order, int bc, double rp) +{ + m_order = order; + m_bc = bc; + m_rp = rp; + ::MakeIIR(A, B, fc, fs, order, bc, rp); +} + +double CIIR::Do(double d) +{ + double *pA = A; + double *pB = B; + double *pZ = Z; + double o; + for( int i = 0; i < m_order/2; i++, pA+=3, pB+=2, pZ+=2 ){ + d += pZ[0] * pA[1] + pZ[1] * pA[2]; + o = d * pB[0] + pZ[0] * pB[1] + pZ[1] * pB[0]; + pZ[1] = pZ[0]; + if( fabs(d) < 1e-37 ) d = 0.0; + pZ[0] = d; + d = o; + } + if( m_order & 1 ){ + d += pZ[0] * pA[1]; + o = d * pB[0] + pZ[0] * pB[0]; + if( fabs(d) < 1e-37 ) d = 0.0; + pZ[0] = d; + d = o; + } + return d; +} + +//********************************************************************* +// CINTPXY XYScope —p ~2ƒCƒ“ƒ^ƒ|[ƒŒ[ƒ^ˆ—ƒNƒ‰ƒX +// +CINTPXY2::CINTPXY2() +{ + iir.MakeIIR(2800, DemSamp * 2.0, 14, 0, 0); +} + +void __fastcall CINTPXY2::Do(double *p, double d) +{ + *p++ = iir.Do(d); + *p = iir.Do(d); +} + +#if 0 +//********************************************************************* +// CINTPXY XYScope —p ~4ƒCƒ“ƒ^ƒ|[ƒŒ[ƒ^ˆ—ƒNƒ‰ƒX +// +CINTPXY4::CINTPXY4() +{ + iir.MakeIIR(2800, DemSamp * 4.0, 24, 0, 0); +} + +void __fastcall CINTPXY4::Do(double *p, double d) +{ + *p++ = iir.Do(d); + *p++ = iir.Do(d); + *p++ = iir.Do(d); + *p = iir.Do(d); +} + +//********************************************************************* +// CINTPXY XYScope —p ~8ƒCƒ“ƒ^ƒ|[ƒŒ[ƒ^ˆ—ƒNƒ‰ƒX +// +CINTPXY8::CINTPXY8() +{ + iir.MakeIIR(2800, DemSamp * 8.0, 30, 0, 0); +} + +void __fastcall CINTPXY8::Do(double *p, double d) +{ + *p++ = iir.Do(d); + *p++ = iir.Do(d); + *p++ = iir.Do(d); + *p++ = iir.Do(d); + *p++ = iir.Do(d); + *p++ = iir.Do(d); + *p++ = iir.Do(d); + *p = iir.Do(d); +} + +//********************************************************************* +// CINTPXYFIR XYScope —p ~2ƒCƒ“ƒ^ƒ|[ƒŒ[ƒ^ˆ—ƒNƒ‰ƒX +// +CINTPXY2FIR::CINTPXY2FIR() +{ + memset(Z, 0, sizeof(Z)); + ::MakeFilter(H, 32, ffLPF, DemSamp * 2.0, 2800, 3000, 40, 1.7); +} + +void CINTPXY2FIR::Do(double *dp, double d) +{ + memcpy(Z, &Z[1], sizeof(double)*16); + Z[16] = d; + + dp[0] = Z[0] * H[32]; + dp[1] = Z[1] * H[31]; + dp[0] += Z[1] * H[30]; + dp[1] += Z[2] * H[29]; + dp[0] += Z[2] * H[28]; + dp[1] += Z[3] * H[27]; + dp[0] += Z[3] * H[26]; + dp[1] += Z[4] * H[25]; + dp[0] += Z[4] * H[24]; + dp[1] += Z[5] * H[23]; + dp[0] += Z[5] * H[22]; + dp[1] += Z[6] * H[21]; + dp[0] += Z[6] * H[20]; + dp[1] += Z[7] * H[19]; + dp[0] += Z[7] * H[18]; + dp[1] += Z[8] * H[17]; + dp[0] += Z[8] * H[16]; + dp[1] += Z[9] * H[15]; + dp[0] += Z[9] * H[14]; + dp[1] += Z[10] * H[13]; + dp[0] += Z[10] * H[12]; + dp[1] += Z[11] * H[11]; + dp[0] += Z[11] * H[10]; + dp[1] += Z[12] * H[9]; + dp[0] += Z[12] * H[8]; + dp[1] += Z[13] * H[7]; + dp[0] += Z[13] * H[6]; + dp[1] += Z[14] * H[5]; + dp[0] += Z[14] * H[4]; + dp[1] += Z[15] * H[3]; + dp[0] += Z[15] * H[2]; + dp[1] += Z[16] * H[1]; + dp[0] += Z[16] * H[0]; +} +#endif + +//********************************************************************* +// CINTPXYFIR XYScope —p ~4ƒCƒ“ƒ^ƒ|[ƒŒ[ƒ^ˆ—ƒNƒ‰ƒX +// +CINTPXY4FIR::CINTPXY4FIR() +{ + memset(Z, 0, sizeof(Z)); + ::MakeFilter(H, 64, ffLPF, DemSamp * 4.0, 2800, 3000, 60, 4.0); +} + +void __fastcall CINTPXY4FIR::Do(double *dp, double d) +{ + memcpy(Z, &Z[1], sizeof(double)*16); + Z[16] = d; + + dp[0] = Z[0] * H[64]; + dp[1] = Z[1] * H[63]; + dp[2] = Z[1] * H[62]; + dp[3] = Z[1] * H[61]; + dp[0] += Z[1] * H[60]; + dp[1] += Z[2] * H[59]; + dp[2] += Z[2] * H[58]; + dp[3] += Z[2] * H[57]; + dp[0] += Z[2] * H[56]; + dp[1] += Z[3] * H[55]; + dp[2] += Z[3] * H[54]; + dp[3] += Z[3] * H[53]; + dp[0] += Z[3] * H[52]; + dp[1] += Z[4] * H[51]; + dp[2] += Z[4] * H[50]; + dp[3] += Z[4] * H[49]; + dp[0] += Z[4] * H[48]; + dp[1] += Z[5] * H[47]; + dp[2] += Z[5] * H[46]; + dp[3] += Z[5] * H[45]; + dp[0] += Z[5] * H[44]; + dp[1] += Z[6] * H[43]; + dp[2] += Z[6] * H[42]; + dp[3] += Z[6] * H[41]; + dp[0] += Z[6] * H[40]; + dp[1] += Z[7] * H[39]; + dp[2] += Z[7] * H[38]; + dp[3] += Z[7] * H[37]; + dp[0] += Z[7] * H[36]; + dp[1] += Z[8] * H[35]; + dp[2] += Z[8] * H[34]; + dp[3] += Z[8] * H[33]; + dp[0] += Z[8] * H[32]; + dp[1] += Z[9] * H[31]; + dp[2] += Z[9] * H[30]; + dp[3] += Z[9] * H[29]; + dp[0] += Z[9] * H[28]; + dp[1] += Z[10] * H[27]; + dp[2] += Z[10] * H[26]; + dp[3] += Z[10] * H[25]; + dp[0] += Z[10] * H[24]; + dp[1] += Z[11] * H[23]; + dp[2] += Z[11] * H[22]; + dp[3] += Z[11] * H[21]; + dp[0] += Z[11] * H[20]; + dp[1] += Z[12] * H[19]; + dp[2] += Z[12] * H[18]; + dp[3] += Z[12] * H[17]; + dp[0] += Z[12] * H[16]; + dp[1] += Z[12] * H[15]; + dp[2] += Z[12] * H[14]; + dp[3] += Z[12] * H[13]; + dp[0] += Z[12] * H[12]; + dp[1] += Z[12] * H[11]; + dp[2] += Z[12] * H[10]; + dp[3] += Z[12] * H[9]; + dp[0] += Z[12] * H[8]; + dp[1] += Z[12] * H[7]; + dp[2] += Z[12] * H[6]; + dp[3] += Z[12] * H[5]; + dp[0] += Z[12] * H[4]; + dp[1] += Z[12] * H[3]; + dp[2] += Z[12] * H[2]; + dp[3] += Z[12] * H[1]; + dp[0] += Z[12] * H[0]; +} + +//********************************************************************* +// CINTPXYFIR XYScope —p ~8ƒCƒ“ƒ^ƒ|[ƒŒ[ƒ^ˆ—ƒNƒ‰ƒX +// +CINTPXY8FIR::CINTPXY8FIR() +{ + memset(Z, 0, sizeof(Z)); + ::MakeFilter(H, 96, ffLPF, DemSamp * 8.0, 2800, 3000, 60, 8.0); +} + +void __fastcall CINTPXY8FIR::Do(double *dp, double d) +{ + memcpy(Z, &Z[1], sizeof(double)*12); + Z[12] = d; + + dp[0] = Z[0] * H[96]; + dp[1] = Z[1] * H[95]; + dp[2] = Z[1] * H[94]; + dp[3] = Z[1] * H[93]; + dp[4] = Z[1] * H[92]; + dp[5] = Z[1] * H[91]; + dp[6] = Z[1] * H[90]; + dp[7] = Z[1] * H[89]; + + dp[0] += Z[1] * H[88]; + dp[1] += Z[2] * H[87]; + dp[2] += Z[2] * H[86]; + dp[3] += Z[2] * H[85]; + dp[4] += Z[2] * H[84]; + dp[5] += Z[2] * H[83]; + dp[6] += Z[2] * H[82]; + dp[7] += Z[2] * H[81]; + + dp[0] += Z[2] * H[80]; + dp[1] += Z[3] * H[79]; + dp[2] += Z[3] * H[78]; + dp[3] += Z[3] * H[77]; + dp[4] += Z[3] * H[76]; + dp[5] += Z[3] * H[75]; + dp[6] += Z[3] * H[74]; + dp[7] += Z[3] * H[73]; + + dp[0] += Z[3] * H[72]; + dp[1] += Z[4] * H[71]; + dp[2] += Z[4] * H[70]; + dp[3] += Z[4] * H[69]; + dp[4] += Z[4] * H[68]; + dp[5] += Z[4] * H[67]; + dp[6] += Z[4] * H[66]; + dp[7] += Z[4] * H[65]; + + dp[0] += Z[4] * H[64]; + dp[1] += Z[5] * H[63]; + dp[2] += Z[5] * H[62]; + dp[3] += Z[5] * H[61]; + dp[4] += Z[5] * H[60]; + dp[5] += Z[5] * H[59]; + dp[6] += Z[5] * H[58]; + dp[7] += Z[5] * H[57]; + + dp[0] += Z[5] * H[56]; + dp[1] += Z[6] * H[55]; + dp[2] += Z[6] * H[54]; + dp[3] += Z[6] * H[53]; + dp[4] += Z[6] * H[52]; + dp[5] += Z[6] * H[51]; + dp[6] += Z[6] * H[50]; + dp[7] += Z[6] * H[49]; + + dp[0] += Z[6] * H[48]; + dp[1] += Z[7] * H[47]; + dp[2] += Z[7] * H[46]; + dp[3] += Z[7] * H[45]; + dp[4] += Z[7] * H[44]; + dp[5] += Z[7] * H[43]; + dp[6] += Z[7] * H[42]; + dp[7] += Z[7] * H[41]; + + dp[0] += Z[7] * H[40]; + dp[1] += Z[8] * H[39]; + dp[2] += Z[8] * H[38]; + dp[3] += Z[8] * H[37]; + dp[4] += Z[8] * H[36]; + dp[5] += Z[8] * H[35]; + dp[6] += Z[8] * H[34]; + dp[7] += Z[8] * H[33]; + + dp[0] += Z[8] * H[32]; + dp[1] += Z[9] * H[31]; + dp[2] += Z[9] * H[30]; + dp[3] += Z[9] * H[29]; + dp[4] += Z[9] * H[28]; + dp[5] += Z[9] * H[27]; + dp[6] += Z[9] * H[26]; + dp[7] += Z[9] * H[25]; + + dp[0] += Z[9] * H[24]; + dp[1] += Z[10] * H[23]; + dp[2] += Z[10] * H[22]; + dp[3] += Z[10] * H[21]; + dp[4] += Z[10] * H[20]; + dp[5] += Z[10] * H[19]; + dp[6] += Z[10] * H[18]; + dp[7] += Z[10] * H[17]; + + dp[0] += Z[10] * H[16]; + dp[1] += Z[11] * H[15]; + dp[2] += Z[11] * H[14]; + dp[3] += Z[11] * H[13]; + dp[4] += Z[11] * H[12]; + dp[5] += Z[11] * H[11]; + dp[6] += Z[11] * H[10]; + dp[7] += Z[11] * H[9]; + + dp[0] += Z[11] * H[8]; + dp[1] += Z[12] * H[7]; + dp[2] += Z[12] * H[6]; + dp[3] += Z[12] * H[5]; + dp[4] += Z[12] * H[4]; + dp[5] += Z[12] * H[3]; + dp[6] += Z[12] * H[2]; + dp[7] += Z[12] * H[1]; + + dp[0] += Z[12] * H[0]; +} + +#if OVERFIR +//********************************************************************* +// CDECM4 1/4ƒfƒVƒ[ƒ^ˆ—ƒNƒ‰ƒX +// +CDECM4::CDECM4() +{ + const double _mt[]={1.11, 1.25, 1.40, 1.11}; + memset(Z1, 0, sizeof(Z1)); + memset(Z2, 0, sizeof(Z2)); + memset(Z3, 0, sizeof(Z3)); + memset(Z4, 0, sizeof(Z4)); + ::MakeFilter(H, 80, ffLPF, SampFreq*4, 2800, 3000, 50, _mt[SampType]); +} + +double __fastcall CDECM4::Do(double *dp) +{ + memcpy(Z1, &Z1[1], sizeof(double)*20); + memcpy(Z2, &Z2[1], sizeof(double)*19); + memcpy(Z3, &Z3[1], sizeof(double)*19); + memcpy(Z4, &Z4[1], sizeof(double)*19); +#if 1 + Z4[19] = *dp++; + Z3[19] = *dp++; + Z2[19] = *dp++; + Z1[20] = *dp; +#else + Z1[20] = *dp++; + Z2[19] = *dp++; + Z3[19] = *dp++; + Z4[19] = *dp; +#endif + double a; + a = Z1[0] * H[80]; + a += Z4[0] * H[79]; + a += Z3[0] * H[78]; + a += Z2[0] * H[77]; + a += Z1[1] * H[76]; + a += Z4[1] * H[75]; + a += Z3[1] * H[74]; + a += Z2[1] * H[73]; + a += Z1[2] * H[72]; + a += Z4[2] * H[71]; + a += Z3[2] * H[70]; + a += Z2[2] * H[69]; + a += Z1[3] * H[68]; + a += Z4[3] * H[67]; + a += Z3[3] * H[66]; + a += Z2[3] * H[65]; + a += Z1[4] * H[64]; + a += Z4[4] * H[63]; + a += Z3[4] * H[62]; + a += Z2[4] * H[61]; + a += Z1[5] * H[60]; + a += Z4[5] * H[59]; + a += Z3[5] * H[58]; + a += Z2[5] * H[57]; + a += Z1[6] * H[56]; + a += Z4[6] * H[55]; + a += Z3[6] * H[54]; + a += Z2[6] * H[53]; + a += Z1[7] * H[52]; + a += Z4[7] * H[51]; + a += Z3[7] * H[50]; + a += Z2[7] * H[49]; + a += Z1[8] * H[48]; + a += Z4[8] * H[47]; + a += Z3[8] * H[46]; + a += Z2[8] * H[45]; + a += Z1[9] * H[44]; + a += Z4[9] * H[43]; + a += Z3[9] * H[42]; + a += Z2[9] * H[41]; + a += Z1[10] * H[40]; + a += Z4[10] * H[39]; + a += Z3[10] * H[38]; + a += Z2[10] * H[37]; + a += Z1[11] * H[36]; + a += Z4[11] * H[35]; + a += Z3[11] * H[34]; + a += Z2[11] * H[33]; + a += Z1[12] * H[32]; + a += Z4[12] * H[31]; + a += Z3[12] * H[30]; + a += Z2[12] * H[29]; + a += Z1[13] * H[28]; + a += Z4[13] * H[27]; + a += Z3[13] * H[26]; + a += Z2[13] * H[25]; + a += Z1[14] * H[24]; + a += Z4[14] * H[23]; + a += Z3[14] * H[22]; + a += Z2[14] * H[21]; + a += Z1[15] * H[20]; + a += Z4[15] * H[19]; + a += Z3[15] * H[18]; + a += Z2[15] * H[17]; + a += Z1[16] * H[16]; + a += Z4[16] * H[15]; + a += Z3[16] * H[14]; + a += Z2[16] * H[13]; + a += Z1[17] * H[12]; + a += Z4[17] * H[11]; + a += Z3[17] * H[10]; + a += Z2[17] * H[9]; + a += Z1[18] * H[8]; + a += Z4[18] * H[7]; + a += Z3[18] * H[6]; + a += Z2[18] * H[5]; + a += Z1[19] * H[4]; + a += Z4[19] * H[3]; + a += Z3[19] * H[2]; + a += Z2[19] * H[1]; + a += Z1[20] * H[0]; + return a; +} + +//********************************************************************* +// CINTP4 x4ƒCƒ“ƒ^ƒ|[ƒŒ[ƒ^ˆ—ƒNƒ‰ƒX +// +CINTP4::CINTP4() +{ + memset(Z, 0, sizeof(Z)); + ::MakeFilter(H, 80, ffLPF, SampFreq*4, 2800, 3000, 50, 4.0); +} + +void __fastcall CINTP4::Do(double *dp, double d) +{ + memcpy(Z, &Z[1], sizeof(double)*20); + Z[20] = d; + + dp[0] = Z[0] * H[80]; + dp[1] = Z[1] * H[79]; + dp[2] = Z[1] * H[78]; + dp[3] = Z[1] * H[77]; + dp[0] += Z[1] * H[76]; + dp[1] += Z[2] * H[75]; + dp[2] += Z[2] * H[74]; + dp[3] += Z[2] * H[73]; + dp[0] += Z[2] * H[72]; + dp[1] += Z[3] * H[71]; + dp[2] += Z[3] * H[70]; + dp[3] += Z[3] * H[69]; + dp[0] += Z[3] * H[68]; + dp[1] += Z[4] * H[67]; + dp[2] += Z[4] * H[66]; + dp[3] += Z[4] * H[65]; + dp[0] += Z[4] * H[64]; + dp[1] += Z[5] * H[63]; + dp[2] += Z[5] * H[62]; + dp[3] += Z[5] * H[61]; + dp[0] += Z[5] * H[60]; + dp[1] += Z[6] * H[59]; + dp[2] += Z[6] * H[58]; + dp[3] += Z[6] * H[57]; + dp[0] += Z[6] * H[56]; + dp[1] += Z[7] * H[55]; + dp[2] += Z[7] * H[54]; + dp[3] += Z[7] * H[53]; + dp[0] += Z[7] * H[52]; + dp[1] += Z[8] * H[51]; + dp[2] += Z[8] * H[50]; + dp[3] += Z[8] * H[49]; + dp[0] += Z[8] * H[48]; + dp[1] += Z[9] * H[47]; + dp[2] += Z[9] * H[46]; + dp[3] += Z[9] * H[45]; + dp[0] += Z[9] * H[44]; + dp[1] += Z[10] * H[43]; + dp[2] += Z[10] * H[42]; + dp[3] += Z[10] * H[41]; + dp[0] += Z[10] * H[40]; + dp[1] += Z[11] * H[39]; + dp[2] += Z[11] * H[38]; + dp[3] += Z[11] * H[37]; + dp[0] += Z[11] * H[36]; + dp[1] += Z[12] * H[35]; + dp[2] += Z[12] * H[34]; + dp[3] += Z[12] * H[33]; + dp[0] += Z[12] * H[32]; + + dp[1] += Z[13] * H[31]; + dp[2] += Z[13] * H[30]; + dp[3] += Z[13] * H[29]; + dp[0] += Z[13] * H[28]; + dp[1] += Z[14] * H[27]; + dp[2] += Z[14] * H[26]; + dp[3] += Z[14] * H[25]; + dp[0] += Z[14] * H[24]; + dp[1] += Z[15] * H[23]; + dp[2] += Z[15] * H[22]; + dp[3] += Z[15] * H[21]; + dp[0] += Z[15] * H[20]; + dp[1] += Z[16] * H[19]; + dp[2] += Z[16] * H[18]; + dp[3] += Z[16] * H[17]; + dp[0] += Z[16] * H[16]; + dp[1] += Z[17] * H[15]; + dp[2] += Z[17] * H[14]; + dp[3] += Z[17] * H[13]; + dp[0] += Z[17] * H[12]; + dp[1] += Z[18] * H[11]; + dp[2] += Z[18] * H[10]; + dp[3] += Z[18] * H[9]; + dp[0] += Z[18] * H[8]; + dp[1] += Z[19] * H[7]; + dp[2] += Z[19] * H[6]; + dp[3] += Z[19] * H[5]; + dp[0] += Z[19] * H[4]; + dp[1] += Z[20] * H[3]; + dp[2] += Z[20] * H[2]; + dp[3] += Z[20] * H[1]; + dp[0] += Z[20] * H[0]; +} +#endif + +//********************************************************************* +// COVERLIMIT ‚•iŽ¿ƒŠƒ~ƒbƒ^ +// +COVERLIMIT::COVERLIMIT() +{ +#if !OVERFIR + iira.MakeIIR(2800, SampFreq * 4.0, 24, 0, 0); + iirb.MakeIIR(2800, SampFreq * 4.0, 24, 0, 0); +#endif +} + +double COVERLIMIT::Do(double d, double lmt) +{ +#if OVERFIR + double dt[4]; + + intp.Do(dt, d); + + dt[0] *= lmt; + if( dt[0] > 16384.0 ) dt[0] = 16384.0; + if( dt[0] < -16384.0 ) dt[0] = -16384.0; + dt[1] *= lmt; + if( dt[1] > 16384.0 ) dt[1] = 16384.0; + if( dt[1] < -16384.0 ) dt[1] = -16384.0; + dt[2] *= lmt; + if( dt[2] > 16384.0 ) dt[2] = 16384.0; + if( dt[2] < -16384.0 ) dt[2] = -16384.0; + dt[3] *= lmt; + if( dt[3] > 16384.0 ) dt[3] = 16384.0; + if( dt[3] < -16384.0 ) dt[3] = -16384.0; + + return decm.Do(dt); +#else + double d1, d2, d3, d4; + + // X4 ƒCƒ“ƒ^[ƒ|[ƒŒ[ƒ^ + d1 = iira.Do(d); + d2 = iira.Do(d); + d3 = iira.Do(d); + d4 = iira.Do(d); + + d1 *= lmt; + if( d1 > 16384.0 ) d1 = 16384.0; + if( d1 < -16384.0 ) d1 = -16384.0; + d2 *= lmt; + if( d2 > 16384.0 ) d2 = 16384.0; + if( d2 < -16384.0 ) d2 = -16384.0; + d3 *= lmt; + if( d3 > 16384.0 ) d3 = 16384.0; + if( d3 < -16384.0 ) d3 = -16384.0; + d4 *= lmt; + if( d4 > 16384.0 ) d4 = 16384.0; + if( d4 < -16384.0 ) d4 = -16384.0; + + // 1/4 ƒfƒVƒ[ƒ^ + iirb.Do(d1); + iirb.Do(d2); + iirb.Do(d3); + return iirb.Do(d4); +#endif +} + +//********************************************************************* +// CDECM2IIR 1/2ƒfƒVƒ[ƒ^ˆ—ƒNƒ‰ƒX +// +CDECM2IIR::CDECM2IIR() +{ + iir.MakeIIR(2900, SampFreq, 12, 0, 0); +} + +double CDECM2IIR::Do(double d1, double d2) +{ + iir.Do(d2); + return iir.Do(d1); +} + +#if 0 +//********************************************************************* +// CHILL ƒqƒ‹ƒxƒ‹ƒg•ÏŠ·ƒNƒ‰ƒX +// +CHILL::CHILL() +{ + memset(Z, 0, sizeof(Z)); + m_tap = 8; + m_htap = m_tap / 2; + m_CenterFreq = 2125 + 170*0.5; + SetSampFreq(SampFreq); + SetFreq(2125, 2125+170); +} + +void CHILL::SetSampFreq(double samp) +{ + m_SampFreq = samp; + m_OUT = 32768.0 * m_SampFreq / (2 * PI * 800); + m_OFF = (2 * PI * m_CenterFreq) / m_SampFreq; +} + +void CHILL::SetFreq(double mark, double space) +{ + m_MarkFreq = mark; + m_SpaceFreq = space; + m_CenterFreq = (mark + space) * 0.5; + m_OFF = (2 * PI * m_CenterFreq) / m_SampFreq; + + MakeFilter(H, m_tap, ffLPF, m_SampFreq, m_CenterFreq, m_CenterFreq, 6, 1.0); + H[m_htap] = 0; + for( int i = 0; i < m_htap; i++ ){ + H[i] = -H[i]; + } + m_A[0] = m_A[1] = m_A[2] = m_A[3] = 0; + m_ph = &Z[m_htap]; +} + +void CHILL::SetMarkFreq(double mark) +{ + SetFreq(mark, m_SpaceFreq); +} + +void CHILL::SetSpaceFreq(double space) +{ + SetFreq(m_MarkFreq, space); +} + +double CHILL::Do(double d) +{ + d = DoFIR(H, Z, d, m_tap); + double a = *m_ph; + if( a ) a = atan2(d, a); + d = a - m_A[0]; + m_A[0] = a; + if( d >= PI ){ + d = d - PI*2; + } + else if( d <= -PI ){ + d = d + PI*2; + } + d += m_OFF; + return d * m_OUT; +} +#endif + + diff --git a/fir.h b/fir.h new file mode 100644 index 0000000..4387f59 --- /dev/null +++ b/fir.h @@ -0,0 +1,321 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------------- +#ifndef firH +#define firH +#include + +//--------------------------------------------------------------------------- +#include "ComLib.h" +#define TAPMAX 512 + +#define PI 3.1415926535897932384626433832795 + +enum { + ffLPF, + ffHPF, + ffBPF, + ffBEF, + ffUSER, + ffLMS, +}; + +typedef struct { + int n; + int typ; + double fs; + double fcl; + double fch; + double att; + double gain; + double fc; + double hp[TAPMAX+1]; /* ŒW””z—ñ */ +}FIR; +void MakeFilter(double *HP, int tap, int type, double fs, double fcl, double fch, double att, double gain); +void MakeFilter(double *HP, FIR *fp); +void __fastcall MakeHilbert(double *H, int N, double fs, double fc1, double fc2); +void DrawGraph(Graphics::TBitmap *pBitmap, const double *H, int Tap, int Over, int &nmax, int init, TColor col); +void DrawGraphIIR(Graphics::TBitmap *pBitmap, double a0, double a1, double a2, double b1, double b2, int Over, int &nmax, int init, TColor col); +void DrawGraph2(Graphics::TBitmap *pBitmap, const double *H1, int Tap1, const double *H2, int Tap2, int Over, int &nmax, int init, TColor col); + +double __fastcall DoFIR(double *hp, double *zp, double d, int tap); + +class CDECM2{ // 36 Tap FIR 1/2 DECM +private: + double Z1[19]; + double Z2[18]; + double H[37]; +public: + CDECM2(); + double Do(double d1, double d2); +}; + +#if 0 +class CDECM2H{ // 64 Tap FIR 1/2 DECM +private: + double Z1[33]; + double Z2[32]; + double H[65]; +public: + CDECM2H(); + double Do(double d1, double d2); +}; +#endif + +#if 0 +class CINTP2{ // 36 Tap FIR x2 INTP +private: + double Z[19]; + double H[37]; +public: + CINTP2(); + void Do(double &d1, double &d2, double d); +}; + +class CDECM3{ // 48 Tap FIR 1/3 DECM +private: + double Z1[17]; + double Z2[16]; + double Z3[16]; + double H[49]; +public: + CDECM3(); + double Do(double d1, double d2, double d3); +}; + +class CINTP3{ // 48 Tap FIR x3 INTP +private: + double Z[17]; + double H[49]; +public: + CINTP3(); + void Do(double &d1, double &d2, double &d3, double d); +}; +#endif + +#define DELAYMAX 4096 +class CLMS +{ +private: + double *Z; // FIR Z Application + double *D; // LMS Delay; + + double m_MarkFreq; // for RTTY + double m_SpaceFreq; // for RTTY + double HBPF[TAPMAX+1]; // for RTTY + + double m_lmsADJSC; // ƒXƒP[ƒ‹’²®’l + double m_lmsErr; // LMS Œë·ƒf[ƒ^ + double m_lmsMErr; // LMS Œë·ƒf[ƒ^i~‚QƒÊj + + void GetFW(double &fl, double &fh, double fq); +public: + int m_Type; + int m_Tap; + int m_NotchTap; // Notch Taps + int m_lmsInv; // LMS InvOutput + int m_lmsDelay; // LMS Delay + int m_lmsAGC; // LMS AGC + double m_lmsMU2; // LMS 2ƒÊ + double m_lmsGM; // LMS ƒÁ + double *H; // ƒAƒvƒŠƒP[ƒVƒ‡ƒ“ƒtƒBƒ‹ƒ^‚ÌŒW” + + int m_lmsNotch; // ƒmƒbƒ`Žü”g” + int m_lmsNotch2; // ƒmƒbƒ`Žü”g” + int m_twoNotch; // ‚Q‚‚߂̃mƒbƒ`‚Ì‹–‰Â + int m_bpf; // For RTTY +public: + CLMS(); + ~CLMS(); + + void Copy(CLMS &other); + double Do(double d); + void SetWindow(double mfq, double sfq); + inline double *GetHBPF(void){return HBPF;}; +}; + +class CIIRTANK +{ +private: + double z1, z2; +public: + double a0; + double b1, b2; +public: + CIIRTANK(); + void SetFreq(double f, double smp, double bw); + double Do(double d); +}; + +#define IIRMAX 16 +class CIIR +{ +private: + double *Z; +public: + double *A; + double *B; + int m_order; + int m_bc; + double m_rp; + CIIR(); + ~CIIR(); + void MakeIIR(double fc, double fs, int order, int bc, double rp); + double Do(double d); + void Clear(void); +}; + +class CINTPXY2{ // IIR x2 INTP for XY Scope +private: + CIIR iir; +public: + CINTPXY2(); + inline void Clear(void){iir.Clear();}; + void __fastcall Do(double *p, double d); +}; + +#if 0 +class CINTPXY4{ // IIR x4 INTP for XY Scope +private: + CIIR iir; +public: + CINTPXY4(); + inline void Clear(void){iir.Clear();}; + void __fastcall Do(double *p, double d); +}; + +class CINTPXY8{ // IIR x8 INTP for XY Scope +private: + CIIR iir; +public: + CINTPXY8(); + inline void Clear(void){iir.Clear();}; + void __fastcall Do(double *p, double d); +}; + +class CINTPXY2FIR{ // 32 Tap FIR x2 INTP +private: + double Z[17]; + double H[33]; +public: + CINTPXY2FIR(); + inline void Clear(void){memset(Z, 0, sizeof(Z));}; + void __fastcall Do(double *p, double d); +}; +#endif + +class CINTPXY4FIR{ // 64 Tap FIR x4 INTP +private: + double Z[17]; + double H[65]; +public: + CINTPXY4FIR(); + inline void Clear(void){memset(Z, 0, sizeof(Z));}; + void __fastcall Do(double *p, double d); +}; + +class CINTPXY8FIR{ // 96 Tap FIR x8 INTP +private: + double Z[13]; + double H[97]; +public: + CINTPXY8FIR(); + inline void Clear(void){memset(Z, 0, sizeof(Z));}; + void __fastcall Do(double *p, double d); +}; + +#define OVERFIR 1 +#if OVERFIR +class CDECM4{ // 80 Tap FIR 1/4 DECM +private: + double Z1[21]; + double Z2[20]; + double Z3[20]; + double Z4[20]; + double H[81]; +public: + CDECM4(); + double __fastcall Do(double *dp); +}; + +class CINTP4{ // 80 Tap FIR x4 INTP +private: + double Z[21]; + double H[81]; +public: + CINTP4(); + inline void Clear(void){memset(Z, 0, sizeof(Z));}; + void __fastcall Do(double *p, double d); +}; +#endif + +class COVERLIMIT{ +private: +#if OVERFIR + CDECM4 decm; + CINTP4 intp; +#else + CIIR iira; + CIIR iirb; +#endif +public: + COVERLIMIT(); + double Do(double d, double lmt); +}; + +class CDECM2IIR{ // IIR 1/2 DECM +private: + CIIR iir; +public: + CDECM2IIR(); + double Do(double d1, double d2); +}; + +#if 0 +#define HILLTAP 48 +class CHILL +{ +public: + double Z[HILLTAP+1]; + double H[HILLTAP+1]; + double m_A[4]; + double m_OFF; + double m_OUT; + double *m_ph; + int m_htap; + int m_tap; + double m_SampFreq; + double m_CenterFreq; + double m_MarkFreq; + double m_SpaceFreq; +public: + CHILL(); + void SetSampFreq(double samp); + void SetFreq(double mark, double space); + void SetMarkFreq(double mark); + void SetSpaceFreq(double space); + + double Do(double d); +}; +#endif + +void DrawGraphIIR(Graphics::TBitmap *pBitmap, CIIR *ip, int Over, int &nmax, int init, TColor col); +#endif + diff --git a/je3hht.pro b/je3hht.pro new file mode 100644 index 0000000..4e32d26 --- /dev/null +++ b/je3hht.pro @@ -0,0 +1,76 @@ +[Define1024] +Name=JE3HHT +Enabled=1 +AFCFixShift=1 +AFCSQ=32 +AFCTime=8.000000e+00 +AFCSweep=1.000000e+00 +TxNet=1 +TxDisRev=0 +LimitDxGain=2.000000e+02 +LimitOverSampling=0 +ATC=0 +ATCTime=4 +Majority=1 +IgnoreFreamError=1 +SQLevel=1.100000e+02 +DefMarkFreq=2.125000e+03 +DefShift=1.700000e+02 +DefStopLen=0 +OutputGain=2.457600e+04 +TXECHO=0 +TXBPFTAP=48 +TXLPF=0 +TXLPFFreq=1.000000e+02 +TXWaitType=0 +TXCharWait=0 +TXDiddleWait=0 +TXCharWaitDiddle=0 +TXRandomDiddle=0 +TXWaitTimerDiddle=0 +Rev=0 +ShiftFreq=1.700000e+02 +RXBPF=1 +RXBPFTAP=64 +RXBPFAFC=1 +RXBPFFW=2.500000e+02 +RXlmsDelay=0 +RXlmsMU2=3.000000e-03 +RXlmsGM=9.999000e-01 +RXlmsAGC=0 +RXlmsInv=0 +RXlmsTAP=56 +RXlmsBPF=1 +RXlmsType=1 +RXlmsNotch=2210 +RXlmsNotch2=0 +RXlmsTwoNotch=0 +DEMTYPE=3 +BaudRate=4.545000e+01 +SmoozType=0 +SmoozOrder=5 +SmoozIIR=4.000000e+01 +Smooz=7.000000e+01 +Tap=72 +IIRBW=60 +pllVcoGain=3.000000e+00 +pllLoopOrder=2 +pllLoopFC=2.500000e+02 +pllOutOrder=4 +pllOutFC=2.000000e+02 +Diddle=2 +TxFixShift=0 +InvPTT=0 +TXUOS=1 +AFC=1 +UOS=1 +LimitAGC=1 +SQ=1 +TXLoop=1 +RXlms=0 +RXNotchTAP=72 +TTYBitLen=5 +TTYStopLen=4 +TTYParity=0 +FFTTones=4 + diff --git a/mmcg.cpp b/mmcg.cpp new file mode 100644 index 0000000..381ee44 --- /dev/null +++ b/mmcg.cpp @@ -0,0 +1,1525 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +/************************************************************************ + MMCG + + Copyright (C) JE3HHT 1993. + Modifed on 2000 for MMTTY by JE3HHT +************************************************************************/ +#include +#pragma hdrstop + +#include "ComLib.h" +#include "Mmcg.h" +#include "string.h" +#include "stdlib.h" +#include "Country.h" + +CMMCG mmcg; + +static LPCSTR ptbl[]={ + "", + "–kŠC“¹", "ÂXŒ§","ŠâŽèŒ§","H“cŒ§","ŽRŒ`Œ§","‹{錧","•Ÿ“‡Œ§","VŠƒŒ§", + "’·–쌧", "“Œ‹ž“s","_“Þ쌧","ç—tŒ§","é‹ÊŒ§","ˆï錧","“È–ØŒ§","ŒQ”nŒ§", + "ŽR—œŒ§","ɪŒ§","Šò•ŒŒ§","ˆ¤’mŒ§","ŽOdŒ§","‹ž“s•{","Ž ‰êŒ§","“Þ—ÇŒ§", + "‘åã•{","˜a‰ÌŽRŒ§","•ºŒÉŒ§","•xŽRŒ§","•ŸˆäŒ§","Î쌧","‰ªŽRŒ§","“‡ªŒ§", + "ŽRŒûŒ§","’¹ŽæŒ§","L“‡Œ§","쌧","“¿“‡Œ§","ˆ¤•QŒ§","‚’mŒ§","•Ÿ‰ªŒ§", + "²‰êŒ§","’·èŒ§","ŒF–{Œ§","‘啪Œ§","‹{茧","Ž­Ž™“‡Œ§","‰«“ꌧ" +}; + +static LPCSTR ptbleng[]={ + "", + "Hokkaido", "Aomori","Iwate","Akita","Yamagata","Miyazaki","Fukushima","Nigata", + "Nagano", "Tokyo","Kanagawa","Chiba","Saitama","Ibaragi","Tochigi","Gunma", + "Yamanashi","Shizuoka","Gifu","Aichi","Mie","Kyoto","Shiga","Nara", + "Osaka","Wakayama","Hyogo","Toyama","Fukui","Ishikawa","Okayama","Shimane", + "Yamaguchi","Tottri","Hiroshima","Kagawa","Tokushima","Ehime","Kochi","Fukuoka", + "Saga","Nagasaki","Kumamoto","Oita","Miyazaki","Kagoshima","Okinawa" +}; + +CMMCG::CMMCG() +{ + m_bp = NULL; + m_Max = 0; + m_Cnt = 0; + m_sinc = 0; + m_mask = -1; +} + +CMMCG::~CMMCG() +{ + Free(); +} + +void CMMCG::Free(void) +{ + if( m_bp != NULL ){ + int i; + MMCG *mp; + + for( mp = m_bp, i = 0; i < m_Cnt; i++, mp++ ){ + if( mp->Code != NULL ) delete[] mp->Code; + if( mp->QTH != NULL ) delete[] mp->QTH; + if( mp->Key != NULL ) delete[] mp->Key; + } + m_bp = NULL; + } + if( m_fp != NULL ){ + delete[] m_fp; + m_fp = NULL; + } + m_Max = m_Cnt = m_FindCnt = 0; +} + +void CMMCG::Alloc(int n) +{ + if( n >= m_Max ){ + int max = m_Max ? m_Max * 2 : 256; + MMCG *np = (MMCG *)new BYTE[sizeof(MMCG) * max]; + if( m_bp != NULL ){ + memcpy(np, m_bp, sizeof(MMCG) * m_Cnt); + delete[] m_bp; + } + m_bp = np; + m_Max = max; + } +} + +/*#$% +====================================================== + ƒ[ƒ}’Ô‚è‚ð’²®‚·‚é +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +LPSTR CMMCG::adjspl(LPSTR p) +{ + static char bf[50]; + LPCSTR tp[]={ + "TSU","TU", + "CHA","CYA", + "CHI","CI", + "CHU","CYU", + "CHO","CYO", + "JYA","JA", + "JYU","JU", + "JYO","JO", + "SHA","SYA", + "SHI","SI", + "SHU","SYU", + "SHE","SYE", + "SHO","SYO", + }; + int i, f; + char *t; + + for( t = bf; *p;){ + for( f = 0, i = 0; i < AN(tp); i+=2 ){ + if( !strncmp(p, tp[i], strlen(tp[i])) ){ + strcpy(t, tp[i+1]); + t += strlen(t); + p += strlen(tp[i]); + f++; + break; + } + } + if( !f ){ + *t++ = *p++; + } + } + *t = 0; + return(bf); +} + +/*#$% +====================================================== + ÅŒã‚̃[ƒ}’Ô‚è‚ÅŒŸõ‹N“®‚ð’f”O‚·‚é +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +int CMMCG::chkspl(LPCSTR p) +{ + static char *tp[]={ + "TS","CH","JY","SH", + }; + int i; + + i = strlen(p); + if( i >= 2 ){ + p += (i-2); + for( i = 0; i < AN(tp); i++ ){ + if( !strcmp(tp[i], p) ) return 0; + } + } + return 1; +} + +/*#$% +====================================================== + •¶Žš—ñ‚ÌÅŒã‚̈ê’v‚𒲂ׂé +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +int CMMCG::LastMatch(LPSTR t, LPSTR s) +{ + t = lastp(t) - strlen(s) + 1; + return !strcmp(t, s); +} + +/*#$% +====================================================== + “ü—Í‚³‚ꂽ‚p‚s‚g‚ð³‹K‰»‚·‚é +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +int CMMCG::NormQth(LPSTR p) +{ + int i; + LPCSTR *cp; + + for( i = 1, cp = &ptbl[1]; i < AN(ptbl); i++, cp++ ){ + if( !strncmp(p, *cp, strlen(*cp)) ){ + if( *(p + strlen(*cp)) ){ + strcpy(p, p + strlen(*cp)); + return 1; + } + } + } + return 0; +} + +/*#$% +====================================================== + ƒGƒŠƒAƒ}ƒXƒN‚ðÝ’è‚·‚é +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +void CMMCG::SetMask(void) +{ + LPCSTR p; + + m_mask = -1; + if( m_Call[0] ){ /* ƒGƒŠƒAƒ}ƒXƒN */ + p = m_Call; + if( (m_Call[0] == '7') && (m_Call[1] != 'J') ){ + m_mask = 1; + p += 3; + } + for( ; *p; p++ ){ + if( isdigit(*(LPUSTR)p) ) m_mask = ((*p) & 0x0f); + } + } +} + +/*#$% +====================================================== + ƒR[ƒh‚©‚猟õ‘ÎÛ‚É‚·‚é‚©‚Ç‚¤‚©’²‚ׂé +------------------------------------------------------ + p : ƒR[ƒh‚̃|ƒCƒ“ƒ^ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +int CMMCG::isfind(LPCSTR p) +{ + const char _tt[]={ + -1, + 8, /* 01 */ + 7, 7, 7, 7, 7, 7, /* 02-07 */ + 0, 0, /* 08-09 */ + 1, 1, 1, 1, 1, 1, 1, 1, /* 10-17 */ + 2, 2, 2, 2, /* 18-21 */ + 3, 3, 3, 3, 3, 3, /* 22-27 */ + 9, 9, 9, /* 28-30 */ + 4, 4, 4, 4, 4, /* 31-35 */ + 5, 5, 5, 5, /* 36-39 */ + 6, 6, 6, 6, 6, 6, 6, 6, /* 40-47 */ + }; + + if( m_mask == -1 ){ + return 1; + } + else { + return( (_tt[atoin(p, 2)] == m_mask) ? 1 : 0 ); + } +} + + +/*#$% +====================================================== + Žw’èˆÊ’u‚Ì•¶Žš‚ÌŽí—ނ𓾂é +------------------------------------------------------ + p : ƒoƒbƒtƒ@‚̃|ƒCƒ“ƒ^ + x : ˆÊ’u +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +int CMMCG::_ischrtyp(char *p, int x) +{ + int xx, jis; + + for( jis = xx = 0; xx < x; xx++, p++ ){ + if( jis ){ + jis = 0; + } + else if( _mbsbtype((unsigned char *)p, 0) == _MBC_LEAD ){ + jis = 1; + } + } + if( jis ){ /* KANJI2 */ + return 2; + } + else if( _mbsbtype((unsigned char *)p, 0) == _MBC_LEAD ){ /* KANJI1 */ + return 1; + } + else { /* ANK */ + return 0; + } +} + +/*#$% +====================================================== + ƒf[ƒ^ƒtƒ@ƒCƒ‹‚ð“ǂݞ‚Þ +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +void CMMCG::LoadDef(LPCSTR pFileName) +{ + FILE *fp; + char hbf[512]; + LPSTR t, p; + + Free(); + if( (fp = fopen(pFileName, "rt"))!=NULL ){ + while( !feof(fp) ){ + if( fgets(hbf, 512, fp)!=NULL ){ + if( hbf[0] == '$' ) break; + ClipLF(hbf); + if( hbf[0] != '!' ){ + p = StrDlm(t, hbf, TAB); + clipsp(t); + Alloc(m_Cnt); + m_bp[m_Cnt].Code = StrDupe(t); + if( p != NULL ){ + p = StrDlm(t, p, TAB); + if( *t == '%' ) *t = 0; + clipsp(t); + m_bp[m_Cnt].QTH = StrDupe(SkipSpace(t)); + } + else { + m_bp[m_Cnt].QTH = StrDupe(""); + } + if( p != NULL ){ + clipsp(p); + m_bp[m_Cnt].Key = StrDupe(SkipSpace(p)); + } + else { + m_bp[m_Cnt].Key = StrDupe(""); + } + m_Cnt++; + } + } + } + fclose(fp); + m_fp = (MMCG **)new BYTE[sizeof(MMCG*)*m_Cnt]; + } + else { + WarningMB((sys.m_WinFontCharset != SHIFTJIS_CHARSET )?"'%s' was not found.\r\n\r\nYou cannot use a JCC/JCG list function.\r\nThis is not a problem if you do not need it":"'%s'‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ.", pFileName); + } +} + +/*#$% +====================================================== + ƒR[ƒh‚©‚猧–¼‚𓾂é +------------------------------------------------------ + code : ƒR[ƒh‚̃|ƒCƒ“ƒ^ +------------------------------------------------------ + Œ§–¼‚̃|ƒCƒ“ƒ^ +------------------------------------------------------ +====================================================== +*/ +LPCSTR CMMCG::getprf(LPCSTR pCode) +{ + int n; + + n = atoin(pCode, 2); + if( sys.m_WinFontCharset != SHIFTJIS_CHARSET ){ + return(ptbleng[n]); + } + else { + return(ptbl[n]); + } +} + +/*#$% +====================================================== + ŒS–¼‚𓾂é +------------------------------------------------------ + p : ’¬‘ºƒR[ƒh‚̃|ƒCƒ“ƒ^ +------------------------------------------------------ + QTH‚̃|ƒCƒ“ƒ^ +------------------------------------------------------ +====================================================== +*/ +void CMMCG::GetGun(LPSTR t, LPCSTR pCode) +{ + strcpy(wbf, pCode); + wbf[5] = 0; + MMCG *mp = m_bp; + int i; + for( i = 0; i < m_Cnt; i++, mp++ ){ + if( !strcmp(mp->Code, wbf) ){ + strcpy(t, mp->QTH); + return; + } + } + *t = 0; +} + +/*#$% +====================================================== + ‚p‚s‚g‚Ì•¶Žš—ñ‚𓾂é +------------------------------------------------------ + cp : ƒf[ƒ^‚̃|ƒCƒ“ƒ^ +------------------------------------------------------ + QTH‚̃|ƒCƒ“ƒ^ +------------------------------------------------------ +====================================================== +*/ +LPCSTR CMMCG::GetQTH(MMCG *mp) +{ + char bf[512]; + + if( sys.m_WinFontCharset != SHIFTJIS_CHARSET ){ + char qth[128]; + strcpy(qth, mp->Key); + LPSTR t; + LPSTR p = qth; + while(*p){ + p = StrDlm(t, p, ','); + } + if( strlen(mp->Code) == 6 ){ + if( isalpha((unsigned char)LastC(mp->Code)) ){ /* ’¬‘ºƒR[ƒh */ + strcpy(bf, t); + strcat(bf, ","); + GetGun(qth, mp->Code); + strcat(bf, qth); + } + else { /* ­—ߎw’è“sŽs */ + strcpy(bf, t); + } + } + else { /* “s“¹•{Œ§‚ð’ljÁ */ + if( *t ){ + sprintf( bf, "%s,%s", t, getprf(mp->Code)); + } + else { + sprintf( bf, "%s", getprf(mp->Code)); + } + } + } + else { + if( strlen(mp->Code) == 6 ){ + if( isalpha((unsigned char)LastC(mp->Code)) ){ /* ’¬‘ºƒR[ƒh */ + GetGun(bf, mp->Code); + strcat(bf, mp->QTH); + } + else { /* ­—ߎw’è“sŽs */ + strcpy(bf, mp->QTH); + } + } + else { /* “s“¹•{Œ§‚ð’ljÁ */ + sprintf( bf, "%s%s", getprf(mp->Code), mp->QTH); + } + } + bf[MLQTH] = 0; + m_QTH = bf; + return m_QTH.c_str(); + + +} + + +/*#$% +====================================================== + ƒf[ƒ^‚ÌŒŸõ‚ðs‚¤i‚·‚ׂÄj +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +void CMMCG::FindAll(void) +{ + MMCG *mp; + int i; + + m_FindCnt = 0; + mp = m_bp; + for( i = 0; i < m_Cnt; i++, mp++ ){ + if( isfind(mp->Code) ){ + m_fp[m_FindCnt] = mp; + m_FindCnt++; + } + } +} + +/*#$% +====================================================== + “¯ˆêƒf[ƒ^‚ª‘¶Ý‚·‚é‚©’²‚ׂé +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +int CMMCG::isEnt(MMCG *mp) +{ + int i; + + for( i = 0; i < m_FindCnt; i++ ){ + if( m_fp[i] == mp ) return 1; + } + return 0; +} + +/*#$% +====================================================== + ƒf[ƒ^‚ÌŒŸõ‚ðs‚¤ +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +void CMMCG::FindQTH(LPSTR pKey) +{ + MMCG *mp; + int i; + int len, kj; + LPSTR t, p; + + kj = _mbsbtype((unsigned char *)pKey, 0) == _MBC_LEAD ? 1 : 0; + if( kj ) NormQth(pKey); + len = strlen(pKey); + m_FindCnt = 0; + mp = m_bp; + char bf[256]; + for( i = 0; i < m_Cnt; i++, mp++ ){ + if( isfind(mp->Code) ){ + if( kj ){ + if( strstr(mp->QTH, pKey) != NULL ){ + m_fp[m_FindCnt] = mp; + m_FindCnt++; + goto _nx; + } + } + strcpy(bf, mp->Key); + for( p = bf; *p; ){ + p = StrDlm(t, p, ','); + if( (!strncmp(t, pKey, len)) || (m_sinc && (strstr(t, pKey)!=NULL)) ){ + m_fp[m_FindCnt] = mp; + m_FindCnt++; + break; + } + } +_nx:; + } + } +} + +/*#$% +====================================================== + ƒf[ƒ^‚ÌŒŸõ‚ðs‚¤ +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +void CMMCG::FindNumb(LPSTR pKey) +{ + MMCG *mp; + int i; + int len; + + m_FindCnt = 0; + len = strlen(pKey); + mp = m_bp; + for( i = 0; i < m_Cnt; i++, mp++ ){ + if( (!strncmp(mp->Code, pKey, len)) || (m_sinc && (strstr(mp->Code, pKey)!=NULL)) ){ + m_fp[m_FindCnt] = mp; + m_FindCnt++; + } + } +} + +/*#$% +====================================================== + ƒf[ƒ^‚ÌŒŸõ‚ðs‚¤ +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +void CMMCG::Find(LPSTR p) +{ + if( *p ){ + if( isdigit(*(LPUSTR)p) ){ + FindNumb(p); + } + else { + jstrupr(p); + if( chkspl(p) ) FindQTH(adjspl(p)); + } + } + else { + FindAll(); + } +} + +#if 0 +/*#$% +====================================================== + ’è‹`—̈æ‚ðŠm•Û‚·‚é +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +int allocdef(int blk) +{ + if( cseg == 0 ){ + if( (cseg=__malloc(blk))!=0 ){ /* ƒƒ‚ƒŠ‚ÌŠm•Û */ + return(NOERR); + } + return(ERR); + } + return(NOERR); +} + +/*#$% +====================================================== + ’è‹`—̈æ‚ðŠJ•ú‚·‚é +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +void freedef(void) +{ + if( cseg ){ + __free(cseg); + cseg = 0; + } +} + +#define XW 60 +#define YW 16 +/*#$% +====================================================== + ŒŸõƒf[ƒ^‚̃ƒjƒ…[•\ަ‚ðƒI[ƒvƒ“‚·‚é +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +VEWP *opencc(void) +{ + cc.xw = XW-1; + cc.yw = YW-1; + cc.x = (crt.hmax-cc.xw+2)/2; + cc.y = (crt.vmax-cc.yw+2)/2; + cc.yt = cc.y; + cc.ye = cc.y + cc.yw; + cc.tb = cc.cy = 0; + cc.xe = cc.x + cc.xw - 1; + if( (cc.vp=openvew(cc.x, cc.y, cc.x+cc.xw, cc.ye, _menuwcol))!=NULL ){ + _dprintf( cc.x, cc.yt, " ŒŸõ>" ); + cc.x++; + cc.y++; +/* _dprintf( cc.x, cc.ye, "’†Ž~, Œˆ’è, <«><ª>‘I‘ð, ¸Ø±, ´Ø±/ALL" );*/ + _dprintf( cc.x, cc.ye, "’†Ž~,Œˆ’è,¸Ø±,ŒŸõ•û–@,´Ø±/ALL" ); + } + return(cc.vp); +} + +/*#$% +====================================================== + ŒŸõƒf[ƒ^‚̃ƒjƒ…[•\ަ‚ðƒNƒ[ƒY‚·‚é +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +void closecc(void) +{ + if( cc.vp ){ + closevew(cc.vp); + cc.vp = NULL; + } +} + +/*#$% +====================================================== + ‚Ps‚Ì•\ަ‚ðs‚¤ +------------------------------------------------------ + y : •\ަˆÊ’u + tp: ƒe[ƒuƒ‹”Ô† +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +static void near dspone(int y, int tp) +{ + CD cd; + int l; + uchar bf[60]; + +/*0123456789012345678901234567890123456789012345678901234567*/ +/*250119__ ‘åã•{__ ‘åãŽsˆ¢”{–ì‹æ______ ABENO______________*/ +/*12345678 12345678 12345678901234567890 1234567890123456789*/ + + _fills(cc.x, y, cc.xe, y); + if( tp < cc.fn ){ + getdat(cc.ctbl[tp], &cd); + l = strlen(cd.code); + _dprintf(cc.x, y, "%-.8s", cd.code ); + _dprintf(cc.x+9, y, "%-.8s", getprf(cd.code)); + if( l == 6 ){ + if( isalpha(lastc(cd.code)) ){ /* ’¬‘º */ + GetGun(bf, cd.code); + } + else { /* §—ß */ + bf[0] = 0; + } + strcat(bf, cd.qth); + _dprintf(cc.x+18, y, "%-.20s", bf ); + } + else { + _dprintf(cc.x+18, y, "%-.20s", cd.qth ); + } + _dprintf(cc.x+39, y, "%-.19s", cd.key ); + } +} + +/*#$% +====================================================== + ŒŸõƒf[ƒ^‚Ì•\ަ‚ð‚·‚é +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +static void near dspcc(void) +{ + int y, cp; + CD cd; + + for( cp = cc.tb, y = cc.y; y < cc.ye; y++, cp++ ){ + dspone(y, cp); + } +} + +/*#$% +====================================================== + ƒJ[ƒ\ƒ‹‚Ì•\ަ +------------------------------------------------------ + sw : 0-OFF, 1-ON +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +static void near ecursor(int sw) +{ + int at; + + at = sw ? _menuccol : CRT_ATTR_NORMAL; + _afill(cc.x, cc.y + cc.cy, cc.xe, cc.y + cc.cy, at ); +} + +/*#$% +====================================================== + ƒJ[ƒ\ƒ‹‚̃Aƒbƒv +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +static void near cup(void) +{ + if( cc.cy ){ + cc.cy--; + } + else if( cc.tb ){ + cc.tb--; + _scrdwn(cc.x, cc.y, cc.xe, cc.ye-1); + dspone(cc.y, cc.tb); + } +} + +/*#$% +====================================================== + ƒJ[ƒ\ƒ‹‚̃_ƒEƒ“ +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +static void near cdown(void) +{ + if( (cc.tb + cc.cy) < (cc.fn - 1) ){ + if( cc.cy < (cc.yw - 2) ){ + cc.cy++; + } + else { + cc.tb++; + _scrup(cc.x, cc.y, cc.xe, cc.ye-1); + dspone(cc.ye-1, cc.tb+cc.cy); + } + } +} + +/*#$% +====================================================== + Žw’èˆÊ’u‚Ö‚Ì‚r‚d‚d‚j +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +static void near cdseek(int tp) +{ + if( tp >= cc.fn ) tp = cc.fn - 1; + if( tp < 0 ) tp = 0; + cc.tb = tp; + cc.cy = 0; + dspcc(); +} + +/*#$% +====================================================== + ƒy[ƒWƒAƒbƒv +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +static void near pup(void) +{ + CD cd; + int tp, m; + + tp = cc.tb + cc.cy; + getdat(cc.ctbl[tp], &cd); + m = atoin(cd.code, 2); + for( tp--; tp >= 0; tp-- ){ + getdat(cc.ctbl[tp], &cd); + if( m != atoin(cd.code, 2) ){ + cdseek(tp); + return; + } + } + cdseek(0); +} + +/*#$% +====================================================== + ƒy[ƒWƒ_ƒEƒ“ +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +static void near pdown(void) +{ + CD cd; + int tp, m; + + tp = cc.tb + cc.cy; + getdat(cc.ctbl[tp], &cd); + m = atoin(cd.code, 2); + for( tp++; tp < cc.fn; tp++ ){ + getdat(cc.ctbl[tp], &cd); + if( m != atoin(cd.code, 2) ){ + cdseek(tp); + return; + } + } + cdseek(32767); +} + +/*#$% +====================================================== + ƒoƒbƒtƒ@“à—e‚Ì•\ަ +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +static void near dspbf(void) +{ + _dprintf(cc.x+5, cc.yt, "%-40s", kbf ); + _dprintf(cc.xe - 15, cc.yt, sinc ? "ŠÜ‚Ý":"擪"); + _dprintf(cc.xe - 10, cc.yt, (m_mask != -1) ? "%u´Ø±" : "ALL ", m_mask ); + _dprintf(cc.xe-4, cc.yt, "%4u", cc.fn ); +} + +/*#$% +====================================================== + ‚l‚l‚b‚f‚̈—‚ðs‚¤ +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +void mmcg(void) +{ + int c; + int xx; + + loaddat(); + if( nosel == 1 ){ + strcpy(kbf, _dspopt(optnmb, &cc.sd)); + findnosel(jstrupr(kbf)); + setdat(); + return; + } + if( opencc() == NULL ) return; + find1st(); + if( nosel == 2 ){ + if( cc.fn == 1 ) setdat(); + closecc(); + return; + } + dspcc(); + xx = strlen(kbf); + _cursor(ON); + while(1){ + dspbf(); + _locate(cc.x+5 + xx, cc.yt); + ecursor(ON); + c = _bgetch(); + ecursor(OFF); + switch(c){ + case K_RU: + pdown(); + break; + case K_RD: + pup(); + break; + case K_UP: + cup(); + break; + case K_DOWN: + cdown(); + break; + case ESC: + goto _ex; + case K_CR: + setdat(); + goto _ex; + case K_BS: + if( xx ){ + xx--; + if( xx && (_ischrtyp(kbf, xx)==2) ) xx--; + kbf[xx] = 0; + find(kbf); + dspcc(); + } + break; + case ' ': + kbf[0] = 0; + xx = 0; + findall(); + dspcc(); + break; + case K_F1: + sinc = sinc ? 0 : 1; + find(kbf); + dspcc(); + break; + case K_F2: + case K_HOME: + if( mask == -1 ){ + setmask(); + } + else { + mask = -1; + } + find(kbf); + dspcc(); + break; + default: + if( (c > 0x0020) && (c <= 0x00ff) ){ + if( xx < 40 ){ + kbf[xx] = c; + xx++; + kbf[xx] = 0; + if( _ischrtyp(kbf, xx-1) != 1 ){ + finds(kbf); + } + dspcc(); + } + } + break; + } + } +_ex:; + closecc(); +} + +/*#$% +====================================================== + ƒf[ƒ^‚ÌŒŸõ‚ðs‚¤i‚·‚ׂÄj +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +void findall(void) +{ + CD cd; + int cp, np; + + cc.tb = cc.cy = cc.fn = 0; + for( cp = 0; cp < cc.cwp; cp = np){ + np = getdat(cp, &cd); + if( isfind(cd.code) ){ + cc.ctbl[cc.fn] = cp; + cc.fn++; + if( cc.fn >= CTMAX ) break; + } + } +} + +/*#$% +====================================================== + “¯ˆêƒf[ƒ^‚ª‘¶Ý‚·‚é‚©’²‚ׂé +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +int isEnt(int n) +{ + int i; + + for( i = 0; i < cc.fn; i++ ){ + if( cc.ctbl[i] == n ){ + return(ON); + } + } + return(OFF); +} + +/*#$% +====================================================== + ƒf[ƒ^‚ÌŒŸõ‚ðs‚¤ +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +void findqth(uchar *key) +{ + CD cd; + int cp, np; + int len, kj; + uchar *t, *p; + + if( (kj = iskanji(*key))!=0 ) NormQth(key); + len = strlen(key); + cc.tb = cc.cy = cc.fn = 0; + for( cp = 0; cp < cc.cwp; cp = np){ + np = getdat(cp, &cd); + if( isfind(cd.code) ){ + if( kj ){ + if( jstrstr(cd.qth, key) != NULL ){ + cc.ctbl[cc.fn] = cp; + cc.fn++; + goto _nx; + } + } + for( p = cd.key; *p; ){ + p = strdm(&t, p); + if( (!strncmp(t, key, len)) || (sinc && (strstr(t, key)!=NULL)) ){ + cc.ctbl[cc.fn] = cp; + cc.fn++; + break; + } + } +_nx:; + if( cc.fn >= CTMAX ) break; + } + if( _bkbhit() ) break; + } +} + +/*#$% +====================================================== + ƒf[ƒ^‚ÌŒŸõ‚ðs‚¤ +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +void findqths(uchar *key) +{ + CD cd; + int cp; + int len, fn, nn, f, kj; + uchar *t, *p; + + if( (kj = iskanji(*key))!=0 ){ + if( NormQth(key) ){ + findqth(key); + return; + } + } + len = strlen(key); + fn = cc.fn; + cc.tb = cc.cy = cc.fn = 0; + f = OFF; + if( lastc(key) == '\\' ){ + f = ON; + *lastp(key) = 0; + } + for( nn = 0; nn < fn; nn++){ + cp = cc.ctbl[nn]; + getdat(cp, &cd); + if( kj ){ + if( jstrstr(cd.qth, key) != NULL ){ + cc.ctbl[cc.fn] = cp; + cc.fn++; + goto _nx; + } + } + for( p = cd.key; *p; ){ + p = strdm(&t, p); + if( f ){ + if( (!strcmp(t, key)) || (sinc && (LastMatch(t,key))) ){ + cc.ctbl[cc.fn] = cp; + cc.fn++; + break; + } + } + else { + if( (!strncmp(t, key, len)) || (sinc && (strstr(t, key)!=NULL)) ){ + cc.ctbl[cc.fn] = cp; + cc.fn++; + break; + } + } + } +_nx:; + if( cc.fn >= CTMAX ) break; + } +} + +/*#$% +====================================================== + ƒf[ƒ^‚ÌŒŸõ‚ðs‚¤ +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +void findnmb(uchar *key) +{ + CD cd; + int cp, np; + int len; + + cc.tb = cc.cy = cc.fn = 0; + len = strlen(key); + for( cp = 0; cp < cc.cwp; cp = np){ + np = getdat(cp, &cd); + if( (!strncmp(cd.code, key, len)) || (sinc && (strstr(cd.code, key)!=NULL)) ){ + cc.ctbl[cc.fn] = cp; + cc.fn++; + if( cc.fn >= CTMAX ) break; + } + } +} + +/*#$% +====================================================== + ƒf[ƒ^‚ÌŒŸõ‚ðs‚¤ +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +void findnmbs(uchar *key) +{ + CD cd; + int cp; + int len, fn, nn, f; + + fn = cc.fn; + cc.tb = cc.cy = cc.fn = 0; + f = OFF; + if( lastc(key) == '\\' ){ + f = ON; + *lastp(key) = 0; + } + len = strlen(key); + for( nn = 0; nn < fn; nn++){ + cp = cc.ctbl[nn]; + getdat(cp, &cd); + if( f ){ + if( (!strcmp(cd.code, key)) || (sinc && LastMatch(cd.code, key)) ){ + cc.ctbl[cc.fn] = cp; + cc.fn++; + } + } + else { + if( (!strncmp(cd.code, key, len)) || (sinc && (strstr(cd.code, key)!=NULL)) ){ + cc.ctbl[cc.fn] = cp; + cc.fn++; + } + } + } + if( f ) strcat(key, "\\"); +} + +/*#$% +====================================================== + ƒf[ƒ^‚ÌŒŸõ‚ðs‚¤ +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +void findnosel(uchar *key) +{ + CD cd; + int cp, np; + + cc.tb = cc.cy = cc.fn = 0; + for( cp = 0; cp < cc.cwp; cp = np){ + np = getdat(cp, &cd); + if( !strcmp(cd.code, key) ){ + cc.ctbl[cc.fn] = cp; + cc.fn++; + break; + } + } +} + +/*#$% +====================================================== + ƒf[ƒ^‚ÌŒŸõ‚ðs‚¤ +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +void find(uchar *p) +{ + dspbf(); + if( *p ){ + if( isdigit(*p) ){ + findnmb(p); + } + else { + jstrupr(p); + if( chkspl(p) ) findqth(adjspl(p)); + } + } + else { + findall(); + } +} + +/*#$% +====================================================== + ƒf[ƒ^‚ÌŒŸõ‚ðs‚¤ +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +void finds(uchar *p) +{ + dspbf(); + if( *p ){ + if( isdigit(*p) ){ + findnmbs(p); + if( !cc.fn ) findnmb(p); + } + else { + jstrupr(p); + if( chkspl(p) ) findqths(adjspl(p)); + } + } + else { + findall(); + } +} + +/*#$% +====================================================== + ʼn‚ÌŒŸõ‚ðs‚¤ +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +void find1st(void) +{ + uchar *p; + uchar far *s; + + setmask(); + kbf[0] = 0; + if( setmac ){ + if( dtname[0] && (ishex(dtname)==NOERR) ){ + s = (uchar far *)htoln(dtname, -1); + for( p = kbf; *s; s++, p++ ){ + *p = *s; + } + *p = 0; + } + } + else { + p = _dspopt(optnmb, &cc.sd); + if( *p && isdigit(*p) ){ + strcpy(kbf, p); + } + else if( cc.sd.qth[0] ){ + strcpy(kbf, cc.sd.qth); + } + } + find(jstrupr(kbf)); +} + +/*#$% +====================================================== + ƒf[ƒ^‚ðƒZƒbƒg‚·‚é +------------------------------------------------------ +------------------------------------------------------ +------------------------------------------------------ +====================================================== +*/ +void setdat(void) +{ + CD cd; + uchar far *t; + uchar *p; + + if( cc.fn ){ + if( !dtname[0] ) return; + getdat(cc.ctbl[cc.tb+cc.cy], &cd); + if( setmac ){ + if( ishex(dtname)!=NOERR ) return; + t = (uchar far *)htoln(dtname,-1); + if( ocpy ){ + for( p = cd.code; *p; p++, t++ ){ + *t = *p; + } + *t = 0; + } + if( qcpy ){ + for( p = getqth(&cd); *p; p++, t++ ){ + *t = *p; + } + *t = 0; + } + } + else { + if( ocpy ) strcpy(_ptropt(optnmb, &cc.sd), cd.code); + if( qcpy ) strcpy(cc.sd.qth, getqth(&cd)); + savedat(); + } + } +} + +/*#$% +================================================================ + ‚Ps‚̃AƒXƒL[ƒZ[ƒu‚̈—‚ðs‚¤ +---------------------------------------------------------------- + fp : ƒtƒ@ƒCƒ‹ƒ|ƒCƒ“ƒ^ + sp : ƒf[ƒ^‚̃|ƒCƒ“ƒ^ +---------------------------------------------------------------- + ERR +---------------------------------------------------------------- +================================================================ +*/ +void _sputdat(uchar *bf, SD *sp) +{ + sinit(bf); + sputf("\042%s\042,\042%s\042,\042%s\042,\042%s\042,\042%s\042,\042%s\042,", + _strydate(sp->year, sp->date), _strtimes(sp->btime), sp->call, sp->ur, sp->my, _strband(sp->band, sp->fq)); + sputf("\042%s\042,\042%s\042,\042%s\042,\042%s\042,\042%s\042,\042%s\042,", + _strmode(sp->mode), sp->pow, sp->name, sp->qth, sp->rem, sp->qsl ); + sputf("\042%s\042,\042%.1s\042,\042%.1s\042,\042%.1s\042,\042%u\042,", _strtime(sp->etime), &sp->send, &sp->recv, &sp->cq, sp->env); + sputf("\042%s\042,\042%s\042,", sp->opt1, sp->opt2 ); + sputf("\042%s\042,", _dspopt(2, sp)); + sputf("\042%s\042", _dspopt(3, sp)); +} + +/*#$% +================================================================ + ‚Ps‚̃AƒXƒL[ƒZ[ƒu‚̈—‚ðs‚¤ +---------------------------------------------------------------- + fp : ƒtƒ@ƒCƒ‹ƒ|ƒCƒ“ƒ^ + sp : ƒf[ƒ^‚̃|ƒCƒ“ƒ^ +---------------------------------------------------------------- + ERR +---------------------------------------------------------------- +================================================================ +*/ +int _fputdat(FILE *fp, SD *sp) +{ + _sputdat(hbf, sp); + fputs(hbf, fp); + fputs("\r\n", fp); + return(ferror(fp)); +} + +/*#$% +================================================================ + ƒAƒXƒL[ƒf[ƒ^‚ð“o˜^‚·‚é +---------------------------------------------------------------- + p : ƒoƒbƒtƒ@‚̃|ƒCƒ“ƒ^ +---------------------------------------------------------------- + ERR +---------------------------------------------------------------- +================================================================ +*/ +int _aputdat(uchar *p, SD *sp) +{ + uchar *t; + int y, m, d; + + _fillmem(sp, sizeof(SD), 0); + p = strdm(&t, p); /* DATE */ + if( sscanf(t, "%u.%u.%u", &y, &m, &d )!=3 ) return(ERR); + sp->year = y; + sp->date = (m * 100) + d; + p = strdm(&t, p); /* BGN */ + if( sscanf(t, "%u.%u", &d, &y) != 2 ){ + d = atoin(t, -1); + y = 0; + } + m = d / 100; + d = d % 100; + y /= 2; + sp->btime = (((m * 60) + d) * 30) + y; + p = strdm(&t, p); /* CALL */ + strcpy(sp->call, t); + p = strdm(&t, p); /* UR */ + strcpy(sp->ur, t); + p = strdm(&t, p); /* MY */ + strcpy(sp->my, t); + p = strdm(&t, p); /* BAND */ + sp->band = _bandno(&sp->fq, t); + p = strdm(&t, p); /* MODE */ + sp->mode = _modeno(t); + p = strdm(&t, p); /* POW */ + strcpy(sp->pow, t); + p = strdm(&t, p); /* NAME */ + strcpy(sp->name, t); + p = strdm(&t, p); /* QTH */ + strcpy(sp->qth, t); + p = strdm(&t, p); /* REM */ + strcpy(sp->rem, t); + p = strdm(&t, p); /* QSL */ + strcpy(sp->qsl, t); + p = strdm(&t, p); /* ETIME*/ + d = atoin(t, -1); + m = d / 100; + d = d % 100; + sp->etime = ((m * 60) + d) * 30; + p = strdm(&t, p); /* S */ + sp->send = *t; + p = strdm(&t, p); /* R */ + sp->recv = *t; + p = strdm(&t, p); /* M */ + sp->cq = *t; + p = strdm(&t, p); /* ENV */ + sp->env = atoin(t, -1); + p = strdm(&t, p); /* OPT1 */ + strcpy(sp->opt1, t); + p = strdm(&t, p); /* OPT2 */ + strcpy(sp->opt2, t); + p = strdm(&t, p); /* USR1 */ + if( *t ) strcpy(_ptropt(2,sp), t); + p = strdm(&t, p); /* USR2 */ + if( *t ) strcpy(_ptropt(3,sp), t); + return(NOERR); +} + +/*#$% +================================================================ + ˆø“nƒf[ƒ^‚ð“ǂݞ‚Þ +---------------------------------------------------------------- +---------------------------------------------------------------- +---------------------------------------------------------------- +================================================================ +*/ +int loaddat(void) +{ + int r; + FILE *fp; + + r = ERR; + _fillmem(&cc.sd, sizeof(SD), 0); + if( !dtname[0] ) return(NOERR); + if( setmac ) return(NOERR); + if( (fp = fopen(dtname, "rt"))!=NULL ){ + if( (fgets(hbf, 256, fp))!=NULL ){ + cliplf(hbf); + _aputdat(hbf, &cc.sd); + r = NOERR; + } + fclose(fp); + } + return(r); +} + +/*#$% +================================================================ + Žw’è‚̃f[ƒ^‚ð‘‚«ž‚Þ +---------------------------------------------------------------- +---------------------------------------------------------------- +---------------------------------------------------------------- +================================================================ +*/ +void savedat(void) +{ + FILE *fp; + + if( (fp = fopen(dtname, "wb"))!=NULL ){ + _fputdat(fp, &cc.sd); + fclose(fp); + } +} +#endif diff --git a/mmcg.h b/mmcg.h new file mode 100644 index 0000000..0d4c1cc --- /dev/null +++ b/mmcg.h @@ -0,0 +1,81 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +#ifndef MmcgH +#define MmcgH +#include "LogFile.h" + +#ifndef LPCUSTR +typedef const unsigned char * LPCUSTR; +typedef unsigned char * LPUSTR; +#endif + +typedef struct { + LPSTR Code; + LPSTR QTH; + LPSTR Key; +}MMCG; + +class CMMCG +{ +private: + int m_Max; // Œ»ÝŠm•Û‚µ‚Ä‚¢‚éƒXƒƒbƒg” + int m_Cnt; // Œ»Ý‹L‰¯‚µ‚Ä‚¢‚éƒXƒƒbƒg” + MMCG *m_bp; // MMCG‚Ì”z—ñ + + + char wbf[512]; + +public: + int m_mask; + int m_sinc; + int m_FindCnt; + MMCG **m_fp; + + AnsiString m_QTH; + char m_Call[MLCALL+1]; +private: + void Free(void); + void Alloc(int n); + LPSTR adjspl(LPSTR p); + int chkspl(LPCSTR p); + int LastMatch(LPSTR t, LPSTR s); + int NormQth(LPSTR p); + int isfind(LPCSTR p); + int _ischrtyp(char *p, int x); + LPCSTR getprf(LPCSTR pCode); + void GetGun(LPSTR t, LPCSTR pCode); + int isEnt(MMCG *mp); + +public: + CMMCG(); + ~CMMCG(); + + void LoadDef(LPCSTR pFileName); + void FindAll(void); + void FindQTH(LPSTR pKey); + void FindNumb(LPSTR pKey); + void Find(LPSTR p); + void SetMask(void); + + LPCSTR GetQTH(MMCG *mp); +}; + +extern CMMCG mmcg; +#endif diff --git a/mml.h b/mml.h new file mode 100644 index 0000000..47af6e1 --- /dev/null +++ b/mml.h @@ -0,0 +1,67 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +#ifndef MML_H +#define MML_H + +#define capNOTIFYSESSION 0x0001 +#define capWMCOPYDATA 0x0002 + +enum { + MML_NOTIFYSESSION, + MML_QRETURN, + MML_VFO, +}; + +#pragma pack(push, 1) +typedef struct { + SYSTEMTIME m_TimeLogON; + SYSTEMTIME m_TimeLogOFF; + char m_Call[16+1]; + char m_Mode[6+1]; // Name of the mode (eg. "RTTY", "SSTV") + char m_Freq[16+1]; // MHz (eg. "14.080") + char m_His[20+1]; // His/Her RST(V) and contest number. + char m_My[20+1]; + char m_Name[16+1]; // His/Her name + char m_QTH[28+1]; // His/Her QTH + char m_Pow[4+1]; + char m_Note[56+1]; // Note + char m_QSL[54+1]; // Note or QSL information + BYTE m_QSLS; // QSL sent + BYTE m_QSLR; // QSL rcvd + char m_DXCC[8+1]; // DXCC keyword (eg. JA, W, VK, etc...) + char m_Cont[8+1]; // The continental keyword (AS/OC/NA/SA/EU/AF) +}mmLOGDATA; +#pragma pack(pop) + + +typedef BOOL (__stdcall *tmmlOpen)(HWND hWnd, UINT uMsg); +typedef void (__stdcall *tmmlClose)(void); +typedef void (__stdcall *tmmlSetHandle)(HWND hWnd, UINT uMsg); +typedef DWORD (__stdcall *tmmlIsCap)(void); +typedef BOOL (__stdcall *tmmlIsConnected)(void); +typedef LPCSTR (__stdcall *tmmlGetSessionName)(void); +typedef void (__stdcall *tmmlQuery)(LPCSTR pCall); +typedef void (__stdcall *tmmlSetFreq)(LPCSTR pFreq); +typedef void (__stdcall *tmmlLog)(const mmLOGDATA *pLog, int sw); +typedef void (__stdcall *tmmlLogClear)(void); +typedef void (__stdcall *tmmlSetPTT)(LONG sw); +typedef LONG (__stdcall *tmmlOnCopyData)(HWND hSender, const COPYDATASTRUCT *pcds); +typedef void (__stdcall *tmmlEventVFO)(void); +#endif diff --git a/mmrp.h b/mmrp.h new file mode 100644 index 0000000..cf36be0 --- /dev/null +++ b/mmrp.h @@ -0,0 +1,43 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +#ifndef MMRP_H +#define MMRP_H + +enum { + MMR_DEFCOMMAND, + MMR_VFO, +}; +#define mmrpstatusRX 0x0001 +#define mmrpstatusTXBUSY 0x0002 +#define mmrpstatusFREQ 0x0004 +#define mmrpstatusDEFCMD 0x0008 + +typedef void (__stdcall *tmmrpSetHandle)(HWND hWnd, UINT uMsg); +typedef LONG (__stdcall *tmmrpOpen)(HWND hWnd, UINT uMsg); +typedef void (__stdcall *tmmrpClose)(void); +typedef DWORD (__stdcall *tmmrpGetStatus)(void); +typedef void (__stdcall *tmmrpSetPTT)(LONG tx); +typedef void (__stdcall *tmmrpPutChar)(BYTE c); +typedef BYTE (__stdcall *tmmrpGetChar)(void); +typedef void (__stdcall *tmmrpPolling)(void); +typedef LONG (__stdcall *tmmrpGetFreq)(void); +typedef LONG (__stdcall *tmmrpGetDefCommand)(void); + +#endif diff --git a/mmtty.bpr b/mmtty.bpr new file mode 100644 index 0000000..bd7db98 --- /dev/null +++ b/mmtty.bpr @@ -0,0 +1,103 @@ +# --------------------------------------------------------------------------- +VERSION = BCB.03 +# --------------------------------------------------------------------------- +!ifndef BCB +BCB = $(MAKEDIR)\.. +!endif +# --------------------------------------------------------------------------- +PROJECT = mmtty.exe +OBJFILES = mmtty.obj Main.obj ComLib.obj fir.obj Sound.obj Rtty.obj Wave.obj Fft.obj \ + Scope.obj Option.obj Comm.obj EditDlg.obj TextEdit.obj LogFile.obj LogList.obj \ + QsoDlg.obj country.obj mmcg.obj MmcgDlg.obj FreqDisp.obj VerDsp.obj LogConv.obj \ + ConvDef.obj PlayDlg.obj ShortCut.obj LogSet.obj ClockAdj.obj SetHelp.obj \ + ctnc.obj TncSet.obj SendFile.obj cradio.obj radioset.obj MacroKey.obj \ + TxdDlg.obj InputWin.obj Loglink.obj MMlink.obj Hamlog5.obj TH5Len.obj CLX.obj +RESFILES = mmtty.res +RESDEPEN = $(RESFILES) Main.dfm Scope.dfm Option.dfm EditDlg.dfm TextEdit.dfm LogList.dfm \ + QsoDlg.dfm MmcgDlg.dfm FreqDisp.dfm VerDsp.dfm ConvDef.dfm PlayDlg.dfm \ + ShortCut.dfm LogSet.dfm ClockAdj.dfm SetHelp.dfm TncSet.dfm SendFile.dfm \ + radioset.dfm MacroKey.dfm TxdDlg.dfm InputWin.dfm TH5Len.dfm +LIBFILES = +LIBRARIES = vcldbx35.lib vcldb35.lib vclx35.lib vcl35.lib +SPARELIBS = vcl35.lib vclx35.lib vcldb35.lib vcldbx35.lib +PACKAGES = vclx35.bpi VCL35.bpi vcldb35.bpi vcldbx35.bpi bcbsmp35.bpi dclocx35.bpi \ + Qrpt35.bpi teeui35.bpi teedb35.bpi tee35.bpi ibsmp35.bpi NMFast35.bpi \ + inetdb35.bpi inet35.bpi +PATHASM = .; +PATHCPP = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +DEFFILE = +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -Hc -w -Ve -d -k- -vi -c -b- -w-par -w-inl -Vx +CFLAG2 = -I$(BCB)\include;$(BCB)\include\vcl -H=$(BCB)\lib\vcl.csm +CFLAG3 = +PFLAGS = -AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE \ + -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$L- -$D- -JPHNV -M +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) -aa -Tpe -x +IFLAGS = +LINKER = ilink32 +# --------------------------------------------------------------------------- +ALLOBJ = c0w32.obj sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mt.lib +# --------------------------------------------------------------------------- +.autodepend + +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1041 +CodePage=932 + +[Debugging] +DebugSourceDirs= + +[Parameters] +RunParams= +HostApplication= + +!endif + +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! + +.pas.hpp: + $(BCB)\BIN\dcc32 $(PFLAGS) { $** } + +.pas.obj: + $(BCB)\BIN\dcc32 $(PFLAGS) { $** } + +.cpp.obj: + $(BCB)\BIN\bcc32 $(CFLAG1) $(CFLAG2) -o$* $* + +.c.obj: + $(BCB)\BIN\bcc32 $(CFLAG1) $(CFLAG2) -o$* $** + +.rc.res: + $(BCB)\BIN\brcc32 $(RFLAGS) $< +#----------------------------------------------------------------------------- + \ No newline at end of file diff --git a/mmtty.cbproj b/mmtty.cbproj new file mode 100644 index 0000000..57bc5ae --- /dev/null +++ b/mmtty.cbproj @@ -0,0 +1,470 @@ + + + {8A19E7D5-B824-4AED-A872-E0689B281994} + CppVCLApplication + mmtty.cpp + True + Debug + 14.6 + Application + VCL + Win32 + 1 + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + 1041 + Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) + rtl.lib;vcl.lib;vclx.lib;dbrtl.lib;vcldb.lib;bdertl.lib;vcldbx.lib + vclx.bpi;rtl.bpi;vcl.bpi;dbrtl.bpi;vcldb.bpi;bdertl.bpi;vcldbx.bpi;bcbsmp.bpi;teeui.bpi;teedb.bpi;tee.bpi;ibsmp.bpi;inetdb.bpi;inet.bpi;$(PackageImports) + true + Windows + .\;$(BDS)\lib;$(BDS)\lib\obj;$(DCC_IncludePath) + $(BDS)\include;$(BDS)\include\vcl;$(BRCC_IncludePath) + true + $(BDS)\include;$(BDS)\include\vcl;$(BCC_IncludePath) + $(BDS)\include;$(BDS)\include\vcl;$(TASM_IncludePath) + . + exe + rtl.lib;vcl.lib;vclx.lib;dbrtl.lib;vcldb.lib;bdertl.lib;vcldbx.lib + None + /w2 + -M + JPHNE + .\;$(BDS)\lib;$(BDS)\lib\obj;$(DCC_UnitSearchPath) + $(BDS)\lib\obj;$(BDS)\lib;$(BDS)\lib\psdk;$(ILINK_LibraryPath) + + + $(BDS)\bin\default_app.manifest + true + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + $(BDSINCLUDE)\windows\vcl;$(IncludePath) + 1033 + -tWM -Vx -d -Ve + mmtty_Icon.ico + + + $(BDSINCLUDE)\windows\vcl;$(IncludePath) + mmtty_Icon.ico + + + true + true + true + $(BDS)\lib\debug;$(ILINK_LibraryPath);$(ILINK_LibraryPath) + DEBUG;$(DCC_Define);$(DCC_Define) + true + Debug_Build + true + true + true + true + Full + -M -V + true + true + false + + + false + false + false + false + None + true + 1033 + _DEBUG;$(BCC_Defines);$(BCC_Defines) + -tWM -Vx -d -Ve -k + + + _DEBUG;$(BCC_Defines);$(BCC_Defines) + + + Release_Build + -M -$O+ + $(BDS)\lib\release;$(ILINK_LibraryPath);$(ILINK_LibraryPath) + + + NDEBUG;$(BCC_Defines);$(BCC_Defines) + -tWM -Vx -d -Ve -r + + + NDEBUG;$(BCC_Defines);$(BCC_Defines) + + + + 9 +
ClockAdjDlg
+ ClockAdj.h + 27 +
+ + 44 + CLX.h + 14 + + + 31 + ComLib.h + 2 + + + 26 + Comm.h + 10 + + + 7 +
ConvDefDlg
+ ConvDef.h + 23 +
+ + 35 + country.h + 17 + + + 4 + cradio.h + 32 + + + 29 + ctnc.h + 1 + + + 41 +
EditDlgBox
+ EditDlg.h + 11 +
+ + 7 + Fft.h + 23 + + + 33 + fir.h + 3 + + + 38 +
FreqDispDlg
+ FreqDisp.h + 20 +
+ + 42 + Hamlog5.h + 13 + + + 36 +
InputWinDlg
+ InputWin.h + 19 +
+ + LogConv.h + 22 + + + 44 + LogFile.h + 14 + + + 37 + Loglink.h + 21 + + + 43 +
LogListDlg
+ LogList.h + 15 +
+ + 26 +
LogSetDlg
+ LogSet.h + 10 +
+ + 34 +
MacroKeyDlg
+ MacroKey.h + 18 +
+ + -1 +
MmttyWd
+ Main.h + 1 +
+ + 34 + mmcg.h + 18 + + + 36 +
MmcgDlgBox
+ MmcgDlg.h + 19 +
+ + 39 + 16 + + + 38 + MMlink.h + 20 + + + 40 + 12 + + + -1 + 0 + + + 40 + 12 + + + 41 + 11 + + + 9 +
OptionDlg
+ Option.h + 27 +
+ + 6 +
PlayDlgBox
+ PlayDlg.h + 24 +
+ + 39 +
QSODlgBox
+ QsoDlg.h + 16 +
+ + 33 +
RADIOSetDlg
+ radioset.h + 3 +
+ + 5 + Rtty.h + 28 + + + 8 +
TScope
+ Scope.h + 25 +
+ + 31 +
SendFileDlg
+ SendFile.h + 2 +
+ + 5 +
SetHelpBox
+ SetHelp.h + 28 +
+ + 8 +
ShortCutDlg
+ ShortCut.h + 25 +
+ + 4 + Sound.h + 32 + + + 42 +
TextEditDlg
+ TextEdit.h + 13 +
+ + 43 +
TH5LenDlg
+ TH5Len.h + 15 +
+ + 30 +
TNCSetDlg
+ TncSet.h + 0 +
+ + 35 +
TxdDlgBox
+ TxdDlg.h + 17 +
+ + 37 +
VerDspDlg
+ VerDsp.h + 21 +
+ + 6 + Wave.h + 24 + + + + + + + + + + + + + + + + + + + + + + + + + + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + +
+ + + + CPlusPlusBuilder.Personality.12 + CppVCLApplication + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1041 + 932 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + False + True + True + + + mmtty.cpp + + + + + True + False + + + 12 + +
diff --git a/mmtty.cbproj.local b/mmtty.cbproj.local new file mode 100644 index 0000000..b3811b7 --- /dev/null +++ b/mmtty.cbproj.local @@ -0,0 +1,2 @@ + + diff --git a/mmtty.cgl b/mmtty.cgl new file mode 100644 index 0000000..3a73065 --- /dev/null +++ b/mmtty.cgl @@ -0,0 +1,19 @@ +Error 00001. 0x400000 (Thread 0x0DF0): +Exception 0xC0000005: Access violation at 0x2B511DC. +Call Tree: + 0x006309D5(=mmtty.exe:0x01:22F9D5) + 0x0062F22A(=mmtty.exe:0x01:22E22A) + 0x0CD0682A(=CG32.DLL:0x01:00582A) + 0x0CD15053(=CG32.DLL:0x01:014053) + 0x0CD1602E(=CG32.DLL:0x01:01502E) + 0x0CD2783E(=CG32.DLL:0x01:02683E) + 0x0CD011BF(=CG32.DLL:0x01:0001BF) + 0x778AD6B2(=ntdll.dll:0x01:03D6B2) + 0x778AD554(=ntdll.dll:0x01:03D554) + 0x754C7A0D(=kernel32.dll:0x01:007A0D) + 0x0063AFFC(=mmtty.exe:0x01:239FFC) + 0x0063A37F(=mmtty.exe:0x01:23937F) + 0x0063A398(=mmtty.exe:0x01:239398) + 0x0063B2D4(=mmtty.exe:0x01:23A2D4) + +------------------------------------------ diff --git a/mmtty.cpp b/mmtty.cpp new file mode 100644 index 0000000..fdf06a3 --- /dev/null +++ b/mmtty.cpp @@ -0,0 +1,94 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +//--------------------------------------------------------------------------- +USEFORM("Main.cpp", MmttyWd); +USEUNIT("ComLib.cpp"); +USEUNIT("fir.cpp"); +USEUNIT("Sound.cpp"); +USEUNIT("Rtty.cpp"); +USEUNIT("Wave.cpp"); +USEUNIT("Fft.cpp"); +USEFORM("Scope.cpp", TScope); +USEFORM("Option.cpp", OptionDlg); +USEUNIT("Comm.cpp"); +USEFORM("EditDlg.cpp", EditDlgBox); +USERES("mmtty.res"); +USEFORM("TextEdit.cpp", TextEditDlg); +USEUNIT("LogFile.cpp"); +USEFORM("LogList.cpp", LogListDlg); +USEFORM("QsoDlg.cpp", QSODlgBox); +USEUNIT("country.cpp"); +USEUNIT("mmcg.cpp"); +USEFORM("MmcgDlg.cpp", MmcgDlgBox); +USEFORM("FreqDisp.cpp", FreqDispDlg); +USEFORM("VerDsp.cpp", VerDspDlg); +USEUNIT("LogConv.cpp"); +USEFORM("ConvDef.cpp", ConvDefDlg); +USEFORM("PlayDlg.cpp", PlayDlgBox); +USEFORM("ShortCut.cpp", ShortCutDlg); +USEFORM("LogSet.cpp", LogSetDlg); +USEFORM("ClockAdj.cpp", ClockAdjDlg); +USEFORM("SetHelp.cpp", SetHelpBox); +USEUNIT("ctnc.cpp"); +USEFORM("TncSet.cpp", TNCSetDlg); +USEFORM("SendFile.cpp", SendFileDlg); +USEUNIT("cradio.cpp"); +USEFORM("radioset.cpp", RADIOSetDlg); +USEFORM("MacroKey.cpp", MacroKeyDlg); +USEFORM("TxdDlg.cpp", TxdDlgBox); +USEFORM("InputWin.cpp", InputWinDlg); +USEUNIT("Loglink.cpp"); +USEUNIT("MMlink.cpp"); +USEFILE("mml.h"); +USEFILE("mmrp.h"); +USEFILE("mmw.h"); +USEUNIT("Hamlog5.cpp"); +USEFORM("TH5Len.cpp", TH5LenDlg); +USEUNIT("CLX.cpp"); +//--------------------------------------------------------------------------- +#define DISDUPE 1 +//--------------------------------------------------------------------------- +WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) +{ +#if DISDUPE + LPSTR pCmd = GetCommandLine(); + if( strstr(pCmd, "-Z") == NULL ){ + HWND hWnd = FindWindow("TMmttyWd", NULL); + if( hWnd != NULL ){ + if( !IsWindowVisible(hWnd) ) return 0; + } + } +#endif + try + { + Application->Initialize(); + Application->CreateForm(__classid(TMmttyWd), &MmttyWd); + Application->Run(); + } + catch (Exception &exception) + { + Application->ShowException(&exception); + } + return 0; +} +//--------------------------------------------------------------------------- diff --git a/mmtty.map b/mmtty.map new file mode 100644 index 0000000..8442e54 --- /dev/null +++ b/mmtty.map @@ -0,0 +1,6 @@ + + Start Length Name Class + 0001:00401000 00037F46CH _TEXT CODE + 0002:00781000 00003A5DCH _DATA DATA + 0003:007BB5DC 0000320D0H _BSS BSS + 0004:00000000 0000000F8H _TLS TLS diff --git a/mmtty.res b/mmtty.res new file mode 100644 index 0000000..17331f7 Binary files /dev/null and b/mmtty.res differ diff --git a/mmtty.tds b/mmtty.tds new file mode 100644 index 0000000..b05fc1f Binary files /dev/null and b/mmtty.tds differ diff --git a/mmtty.txt b/mmtty.txt new file mode 100644 index 0000000..496594e --- /dev/null +++ b/mmtty.txt @@ -0,0 +1,875 @@ +‚l‚l‚s‚s‚x ƒ\ƒtƒgƒEƒGƒAƒ}ƒjƒ…ƒAƒ‹ + + ‰”Å 2000.06.30 JE3HHT X ½ + ‰ü’ù 2002.03.20 JE3HHT X ½ + + +›‚l‚l‚s‚s‚x‚ɂ‚¢‚Ä +~~~~~~~~~~~~~~~~~~~~ + MMTTY‚̓pƒ\ƒRƒ“‚̃TƒEƒ“ƒhƒJ[ƒh‚¾‚¯‚ÅŽÀŒ»‚µ‚½RTTY’ÊM—pƒ\ƒtƒg‚Å‚·B + +EƒTƒEƒ“ƒhƒJ[ƒh‚Ì“üo—͂ɂæ‚èAFSKƒ‚[ƒh‚ʼn^—p‚Å‚«‚é +E”CˆÓ‚ÌCom‰ñü‚ÉPTT§ŒäM†‚ÆFSKƒL[ƒCƒ“ƒO—p‚̃f[ƒ^o—Í‚ª‰Â”\ +Eƒ†[ƒU’è‹`‰Â”\‚ȃ}ƒNƒƒ{ƒ^ƒ“‚P‚UŒÂ +Eƒ†[ƒU’è‹`‰Â”\‚È’èŒ^ƒƒbƒZ[ƒW‚U‚SŒÂ +EŠÈˆÕ‚̃ƒOi‹Æ–±“úŽj‹@”\‚ð‘•”õ‚µ‚Ä‚¢‚é(ŽQƨMMTTYLOG.TXT) +Eƒfƒ‚ƒWƒ…ƒŒ[ƒ^‚Ì•ûŽ®‚Æ“Á«‚ðׂ©‚­Ý’è‚Å‚«‚é +E’²®—p‚̃fƒWƒ^ƒ‹ƒIƒVƒƒXƒR[ƒv“à‘Ÿ +EŽóMƒTƒEƒ“ƒh‚Ì‹L˜^‚ÆÄ¶‚ª‚Å‚«‚é +EƒVƒ‡[ƒgƒJƒbƒgƒL[‚ðƒJƒXƒ^ƒ}ƒCƒY‚Å‚«‚é +ERadioCommand‚É‚æ‚éRig§Œä +ETNCƒGƒ~ƒ…ƒŒ[ƒVƒ‡ƒ“i–Í‹[j‚ÌŽÀs + + +›“®ìŠÂ‹« +~~~~~~~~~~ + Windows95/98/ME,WindowsNT/2000‚Åo—ˆ‚邾‚¯‘¬‚¢‚à‚Ì + 640~400ƒsƒNƒZƒ‹ˆÈã‚̃fƒBƒXƒvƒŒ[ + 16bit Soundcard i8000Hz ` 12000Hz ƒfƒtƒHƒ‹ƒg=11025Hz, 16bitj + +@ƒTƒEƒ“ƒhƒJ[ƒh‚̃AƒNƒZƒX‚ÍWindows‚ÌWaveAPI‚ðŽg‚Á‚Ä‚¢‚Ü‚·‚Ì‚ÅA“¾‚½‚¢‚Ì’m‚ê‚È‚¢ƒJ[ƒh‚Å‚à‚Ü‚¸‘åä•v‚¾‚Ƃ͎v‚¢‚Ü‚·‚ªA‚à‚µ‚©‚·‚邯“®ì‚µ‚È‚¢‚à‚Ì‚ª‚ ‚é‚©‚à’m‚ê‚Ü‚¹‚ñB³í‚É“®ì‚µ‚È‚¢ê‡‚ÍA–{‘‚̌㔼‚É‹LÚ‚µ‚Ä‚ ‚éuƒTƒEƒ“ƒhƒJ[ƒhƒIƒvƒVƒ‡ƒ“v‚ðŽQÆ‚µ‚ĉº‚³‚¢B + + ‚·‚ׂĂÌM†ˆ—‚ÍCPU‚Ì•‚“®¬”“_‰‰ŽZ‚Ås‚Á‚Ä‚¨‚èA‚©‚È‚èd‚¢‚Å‚·‚Ì‚ÅA‚Å‚«‚邾‚¯‘¬‚¢ƒpƒ\ƒRƒ“‚ð‚¨Žg‚¢’¸‚­‚Ù‚¤‚ªFB‚Å‚·B‚¤‚¿‚̃m[ƒgƒpƒ\ƒRƒ“iPentium133MHzj‚ÆAPentium100MHz‚̃fƒBƒXƒNƒgƒbƒv‚ł͈ꉞ‚Ì“®ì‚ðŠm”F‚µ‚Ä‚¢‚Ü‚·‚ªA‚»‚ê‚ð‰º‰ñ‚éCPU‚Ìꇂ͓®ì‚µ‚È‚¢‰Â”\«‚à‚ ‚è‚Ü‚·B + +@CPU‘¬“x‚ªŒµ‚µ‚¢ê‡‚É‚ÍA–{‘‚̌㔼‚É‹LÚ‚µ‚Ä‚ ‚éuˆ—‚ÌŒyŒ¸‰»v‚ðŽQÆ‚µ‚ĉº‚³‚¢B + + +›ƒAƒ“ƒCƒ“ƒXƒg[ƒ‹‚Ì•û–@ +~~~~~~~~~~~~~~~~~~~~~~~~ + MMTTY‚ÍWindows‚̃ŒƒWƒXƒgƒŠ‚ðˆêØ‚³‚í‚è‚Ü‚¹‚ñ‚Ì‚ÅAƒAƒ“ƒCƒ“ƒXƒg[ƒ‹‚·‚éۂ̓tƒ@ƒCƒ‹‚ðÁ‹Ž‚·‚邾‚¯‚ÅOK‚Å‚·BMMTTY.EXE‚ð‹N“®‚·‚邯A‚»‚Ì“¯‚¶ƒtƒHƒ‹ƒ_“à‚ÉuMMTTY.INIv‚ð쬂µ‚Ü‚·‚Ì‚ÅAƒCƒ“ƒXƒg[ƒ‹‚µ‚½Û‚̃tƒHƒ‹ƒ_‘S•”‚ðÁ‹Ž‚·‚邯—Ç‚¢‚Å‚µ‚傤B + +*MMTTY‚Ì“®ì‚ª‚¨‚©‚µ‚­‚È‚Á‚½ê‡‚àAˆê’UuMMTTY.INIv‚ðÁ‹Ž‚µ‚Ä‚©‚ç‚à‚¤ˆê“x‹N“®‚·‚邯‰ü‘P‚·‚é‰Â”\«‚ª‚ ‚è‚Ü‚·B + + +›MMTTY‚̃o[ƒWƒ‡ƒ“ƒAƒbƒv +~~~~~~~~~~~~~~~~~~~~~~~~~ + MMTTY‚ðƒo[ƒWƒ‡ƒ“ƒAƒbƒv‚·‚éê‡A‹Œƒo[ƒWƒ‡ƒ“‚ÌMMTTY‚ð휂·‚é•K—v‚Í‚ ‚è‚Ü‚¹‚ñB‚»‚̂܂Üã‘‚«ƒCƒ“ƒXƒg[ƒ‹‚µ‚ĉº‚³‚¢B‹Œƒo[ƒWƒ‡ƒ“‚ł̂·‚ׂĂÌÝ’è“à—e‚ðŽ¸‚í‚¸‚ÉV‚µ‚¢ƒo[ƒWƒ‡ƒ“‚ɈÚs‚Å‚«‚Ü‚·B + + ‹Œƒo[ƒWƒ‡ƒ“‚Ɋ܂܂ê‚éuMMTTY.INIv‚ð휂µ‚Ä‚µ‚Ü‚¤‚ÆAƒ}ƒNƒ‚â’èŒ^ƒƒbƒZ[ƒW‚Ȃǂ·‚ׂẴ†[ƒUÝ’è‚ðŽ¸‚¢Aˆê‚©‚ço’¼‚µó‘ԂɂȂè‚Ü‚·B + + MMTTY‚Ì•ÏX—š—ð‚ÍuHistory.txtv‚ðŽQÆ‚µ‚ĉº‚³‚¢B + + +›ƒTƒEƒ“ƒhƒJ[ƒh‚Æ‚q‚h‚f‚ÌÚ‘±iAFSK‚Ìê‡j +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Šî–{“I‚ɂ̓TƒEƒ“ƒhƒJ[ƒh‚Ì‚k‚‰‚Ž‚…“ü—͂ɂq‚‰‚‡‚̃Xƒs[ƒJo—Í‚ðA‚Ü‚½ƒTƒEƒ“ƒhƒJ[ƒh‚Ì‚n‚•‚”‚‚•‚”‚ð‚q‚‰‚‡‚Ì‚l‚‰‚ƒ‚Ü‚½‚Í‚c‚‚”‚“ü—Í‚ÉÚ‘±‚µ‚Ü‚·B‚±‚ÌŽžA‚q‚‰‚‡‚Ì‚c‚‚”‚‚Ü‚½‚Í‚l‚h‚bƒ‰ƒCƒ“‚ɂ͂`‚s‚s‚ð“ü‚ê‚ăŒƒxƒ‹‚ð‰º‚°‚鎖‚ð‚¨Š©‚ß‚µ‚Ü‚·B‚`‚s‚s‚È‚µ‚ÅÚ‘±‚µ‚½ê‡‚Í‚q‚‰‚‡‚̃}ƒCƒNƒQƒCƒ“‚Ì’²®‚ªƒNƒŠƒ`ƒJƒ‹‚ÅA‘—M“d”g‚ÌŽ¿‚àˆ«‚­‚È‚è‚Ü‚·B + + ƒTƒEƒ“ƒhƒJ[ƒh ‚q‚h‚f + + Line(or Mic) <---------------- Speaker Out + + Output ------ ATT -----> Rig Data or Mic + +*ƒTƒEƒ“ƒhƒJ[ƒh‚ÌMic“ü—͂ɓü‚ê‚éꇂÍA‚±‚±‚É‚àATT‚ð“ü‚ê‚é•û‚ª—Ç‚¢‚Å‚µ‚傤B + + ‚`‚s‚s‚ÍŽŸ‚̂悤‚ÈŠÈ’P‚È\¬‚Å‚n‚j‚Å‚·B + + Output ------ R1 ------+---- Data/Mic + | +SoundCard‘¤ R2 Rig‘¤ + | + GND ----------------+---- GND + + Data R1 = 1K, R2 = 100 + Mic R1 = 10K, R2 = 100 + +*ã‹L‚̉ñ˜H}‚ɂ͋LÚ‚µ‚Ä‚¢‚Ü‚¹‚ñ‚ªA‰ñ‚螂ݖhŽ~‚Ì‚½‚߂ɓK“–‚ȃpƒXƒRƒ“‚âƒtƒFƒ‰ƒCƒgƒr[ƒY‚ň—‚·‚鎖‚ð‚¨Š©‚ß‚µ‚Ü‚·B +*‚¨Žg‚¢‚ɂȂéRig‚É‚æ‚Á‚Ä’ïR’l‚ðŽáб’²®‚·‚é•K—v‚ª‚ ‚é‚©‚à’m‚ê‚Ü‚¹‚ñB +*”¼ŒÅ’è‚Å’²®‚Å‚«‚邿‚¤‚É‚µ‚Ä‚¨‚­‚ÆRig‚âƒ\ƒtƒg‚Ì‘g‚݇‚킹‚ª•Ï‚í‚Á‚Ä‚àAƒŒƒxƒ‹‚ðŠÈ’P‚É’²®‚Å‚«‚é‚̂łæ‚è•Ö—˜‚¾‚ÆŽv‚¢‚Ü‚·B +*Rig‚̃}ƒjƒ…ƒAƒ‹‚ÉAFSK‰^—p‚ÌꇂƂµ‚Ä‹LÚ‚³‚ê‚Ä‚¢‚邯Žv‚¢‚Ü‚·B + +*FSK‚ʼn^—p‚·‚éꇂÍuFSK‚ʼn^—p‚·‚éê‡v‚ðŽQÆ‚µ‚ĉº‚³‚¢B + + +›‚o‚s‚s§Œä +~~~~~~~~~~~~ + ‚q‚‰‚‡‚Ì‚l‚‰‚ƒ“ü—͂Ƀg[ƒ“‚ð“ü‚ê‚éꇂÍA‚q‚‰‚‡‘¤‚É‚u‚n‚w‚ª”õ‚í‚Á‚Ä‚¢‚ê‚ÎA‚Ƃ肠‚¦‚¸‚»‚ê‚ðŽg‚Á‚Ä‚à—Ç‚¢‚ÆŽv‚¢‚Ü‚·i‚½‚¾‚µƒƒbƒZ[ƒWƒ{ƒbƒNƒX‚ª•\ަ‚³‚ê‚½Žž‚Ƀ|[ƒ“‚Æ‚¢‚¤‰¹‚ªo‚Ĉêu‚¾‚¯‘—Mó‘ԂɂȂé‰Â”\«‚Í‚ ‚è‚Ü‚·BjB + + ‚q‚‰‚‡‚Ì‚c‚‚”‚“ü—͂Ƀg[ƒ“‚ð“ü‚ꂽꇂ͂u‚n‚w‚ªŽg—p‚Å‚«‚Ü‚¹‚ñiŽ„‚Ì‚q‚‰‚‡‚¾‚¯Hj‚Ì‚ÅA‚o‚s‚s§Œä‚ðs‚¤•K—v‚ª¶‚¶‚Ü‚·B + ‚l‚l‚s‚s‚x‚Í‚o‚s‚s§Œä‚Æ‚µ‚ÄA‚q‚r‚Q‚R‚Q‚b‰ñü‚Ì‚q‚s‚r‚Ü‚½‚Í‚c‚s‚q‚ðŽg—p‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B—¼•û“¯‚¶˜_—‚ÅON/OFF‚µ‚Ü‚·‚̂ł¢‚¸‚ê‚ÉÚ‘±‚µ‚Ä‚à‚n‚j‚Å‚·B + +*PTT§Œä‚̉ñü‚̓IƒvƒVƒ‡ƒ“ƒƒjƒ…[‚ÌÝ’è‰æ–Ê‚Ìu‘—Mv‚̂Ƃ±‚ë‚Åݒ肵‚Ü‚·BƒhƒƒbƒvƒŠƒXƒg‚Å‚ÍCOM1`COM8‚µ‚©‘I‘ð‚Å‚«‚Ü‚¹‚ñ‚ªA—Ⴆ‚΃L[ƒ{[ƒh‚©‚çCOM9‚Æ“ü—Í‚µ‚Ä”CˆÓ‚̃|[ƒg–¼‚ðÝ’è‚·‚鎖‚à‚Å‚«‚Ü‚·B + +*Ver1.59ˆÈ~‚ÌMMTTY‚ÍRadio Command‚É‚æ‚éPTT§Œä‚à—˜—p‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·BÚׂ͖{‘‚̌㔼‚ÌuRadio Commmandv‚Ì€‚ðŽQÆ‚µ‚ĉº‚³‚¢B + + + ‚o‚s‚s§Œä‰ñ˜H‚͗Ⴆ‚Έê‚‚̃gƒ‰ƒ“ƒWƒXƒ^‚ðŽg‚Á‚½ŽŸ‚̂悤‚ȉñ˜H‚Å\¬‚Å‚«‚Ü‚·B + + (C)---+---- Rig PTT + Com-RTS -- R1-+---+-(B)< | + (DTR) | | (E) | + D R2 | D + | | | | + Com-GND ------+---+------+----+---- Rig GND + + R1=4.7K, R2=47K, D=1S1588, Tr=2SC1815 + + Dsub(9pin) RTS(7), DTR(4), GND(5), TXD(3) + Dsub(25pin) RTS(4), DTR(20), GND(7), TXD(2) + +*ã‹L‚̉ñ˜H}‚ɂ͋LÚ‚µ‚Ä‚¢‚Ü‚¹‚ñ‚ªA‰ñ‚螂ݖhŽ~‚Ì‚½‚߂ɓK“–‚ȃpƒXƒRƒ“‚âƒtƒFƒ‰ƒCƒgƒr[ƒY‚ň—‚·‚鎖‚ð‚¨Š©‚ß‚µ‚Ü‚·B +*Rig‚̃}ƒjƒ…ƒAƒ‹‚ÉAFSK‰^—p‚ÌꇂƂµ‚Ä‹LÚ‚³‚ê‚Ä‚¢‚邯Žv‚¢‚Ü‚·B + + +›ŽóM•û–@ +~~~~~~~~~~ + Rig‚ÍLSBƒ‚[ƒhiƒpƒPƒbƒgƒ‚[ƒh‚ª‚ ‚éꇂ͂»‚ê‚ðŽg—p‚µ‚Ä‚à—Ç‚¢j‚É‚µ‚Ü‚·BRig‚Ì“s‡‚łǂ¤‚µ‚Ä‚àUSBƒ‚[ƒh‚µ‚©‘—ŽóM‚Å‚«‚È‚¢ê‡‚ÍAƒƒCƒ“‰æ–Ê‚Ìã‚É‚ ‚éuRevv‚̃{ƒ^ƒ“‚ð‰Ÿ‚µ‚Ä‚¨‚«‚Ü‚·B + + RTTY‚̉^—pŽü”g”‚Í + 14.080`14.095 + 21.080`21.095 +‚Ì‚ ‚½‚è‚̂悤‚Å‚·‚Ì‚ÅA‚±‚Ì‚ ‚½‚è‚ðƒƒbƒ`‚µ‚ÄAƒsƒƒsƒ‚Æ‚¢‚¤‰¹‚ð’T‚µ‚Ü‚·B‚Ü‚½–ˆT“ú—j“ú‚̌ߑO‚P‚OŽž‚©‚çA7026•t‹ß(7025`7030‚̂ǂ±‚©)‚ÅJARTS‚̃[ƒ‹ƒR[ƒ‹‚ªs‚í‚ê‚Ä‚¢‚Ü‚·B‚±‚̃[ƒ‹ƒR[ƒ‹‚Í’N‚Å‚à‹CŒy‚ÉŽQ‰Á‚Å‚«‚Ü‚·‚Ì‚ÅAŽóM‚ªŽ|‚­‚¢‚Á‚½‚ç‘—M‚àƒgƒ‰ƒC‚µ‚Ă݂ĉº‚³‚¢B + + ƒsƒƒsƒ‰¹‚ª•·‚±‚¦‚½‚ç‰Eã‚ÌFFTƒXƒR[ƒv‚É‚Q‚‚̃s[ƒN‚ªA‰©F‚Ì‚Q–{ü‚Éd‚È‚é‚æ‚¤‚ÉŽóM‹@‚ÌŽü”g”‚ð‡‚킹‚Ä‚­‚¾‚³‚¢BFFTƒXƒR[ƒv‚Ü‚½‚Í‚·‚®‰º‚ÌWaterFall‚Ŷ‘¤‚̃s[ƒN•”•ª‚ðƒ}ƒEƒX‚ŃNƒŠƒbƒN‚·‚邯A‚»‚ÌŽü”g”‚ªƒ}[ƒNŽü”g”‚Éݒ肳‚ê‚Ü‚·‚Ì‚ÅAAFSK‚ʼn^—p‚µ‚Ä‚¢‚éꇂÍA‚ ‚é’ö“xŽü”g”‚ª‡‚¦‚΂±‚Ì‘€ì‚Å‚l‚l‚s‚s‚x‚̃}[ƒNŽü”g”‚ð•ÏX‚µ‚Ä‚µ‚Ü‚¤‚Ù‚¤‚ªŠÈ’P‚Å‚·B + ‚Ü‚½‚l‚l‚s‚s‚x‚Ì‚`‚e‚b‚ð‚n‚m‚É‚µ‚Ä‚¢‚éꇂ͑½­ƒ‰ƒt‚ɇ‚킹‚Ä‚àAŽ©“®‚ÅŽü”g”‚ð‡‚킹‚Ü‚·B + +*•\ަƒƒjƒ…[‚ÌuXYScopev‚Ƀ`ƒFƒbƒN‚ð•t‚¯‚邯AXYScope‚ª•\ަ‚³‚ê‚Ü‚·‚Ì‚ÅA‚±‚ê‚ðŒ©‚È‚ª‚瓯’²‚ð‡‚킹‚鎖‚à‚Å‚«‚Ü‚·B + + Žü”g”‚ª‡‚¤‚ÆŽóM‰æ–Êi’†‰›‚̉æ–Êj‚É•¶Žš‚ª•\ަ‚³‚ê‚Ü‚·B + + FIGƒP[ƒX‚ÌuSTOPv‚¨‚æ‚ÑuBELLv‚Í•\ަ‚Å‚«‚È‚¢‚Ì‚ÅA‚»‚ꂼ‚ꬕ¶Žš‚Ìuhv‚Æusv‚Å’u‚«Š·‚¦‚Ä•\ަ‚µ‚Ä‚¢‚Ü‚·B + + ‚Ü‚½ŽóM‰æ–Ê“à‚Ì•¶Žš—ñ‚ðƒ}ƒEƒX‚̉Eƒ{ƒ^ƒ“‚ŃNƒŠƒbƒN‚·‚邯A‚»‚Ì•”•ª‚Ì•¶Žš—ñ‚Ì•¶ŽšƒVƒtƒg‚𔽓]‚µ‚ÄÄ•\ަ‚µ‚Ü‚·i‚±‚Ì‹@”\‚̓}ƒEƒX‚̶ƒ{ƒ^ƒ“‚ł͂Ȃ­‰Eƒ{ƒ^ƒ“‚Å‚·jB + + ƒIƒvƒVƒ‡ƒ“ƒƒjƒ…[‚Ìu‚»‚Ì‘¼v‚̃y[ƒW‚ÉAƒTƒEƒ“ƒhƒJ[ƒh‚̃oƒbƒtƒ@ƒTƒCƒY‚ðÝ’è‚·‚é•”•ª‚ª‚ ‚è‚Ü‚·‚Ì‚ÅA“®ì‚·‚é”͈͂Ŭ‚³‚È’l‚ðÝ’è‚·‚邯—Ç‚¢‚Å‚µ‚傤B‚±‚Ì’l‚ð‘å‚«‚­‚·‚邯‰ž“š’x‚ꂪ‘å‚«‚­‚È‚èAŽü”g”‡‚킹‚Ì‘€ì«‚ªˆ«‚­‚È‚è‚Ü‚·B + ‹t‚Ƀpƒ\ƒRƒ“‚Ì‘¬“xã‚Ì–â‘è‚ÅA“®ì‚ªŒµ‚µ‚¢ê‡‚Í‚±‚Ì’l‚ð‘å‚«‚­‚µ‚Ä‚Ý‚é‚Æ—Ç‚¢‚Å‚µ‚傤B + + +›‘—M•û–@ +~~~~~~~~~~ + ƒƒCƒ“‰æ–ʶã‚ÌuTXvƒ{ƒ^ƒ“iF9ƒL[j‚ð‰Ÿ‚·‚Æ‘—Mó‘Ô‚É“ü‚è‚Ü‚·Bˆê”Ô‰º‚̉æ–Ê‚ª‘—M“d•¶‚ð“ü—Í‚·‚鉿–ʂł·i‘—M‰æ–ʂƌĂт܂·jBƒL[‚©‚ç•¶Žš‚ð“ü—Í‚·‚邯A‚»‚ꂪ‘—M‰æ–ʂɕ\ަ‚³‚ꇎŸo—Í‚³‚ê‚Ä‚¢‚«‚Ü‚·B‚±‚ÌŽž•¶Žš‚ªo—Í‚³‚ê‚Ä‚¢‚­‚É]‚Á‚ÄÔF‚ɕςí‚Á‚Ä‚¢‚­‚Í‚¸‚Å‚·B + +*AFSK‚Å‘—M‚·‚éÛ‚ÍRig‚̃Xƒs[ƒ`ƒvƒƒZƒbƒTiƒ}ƒCƒNƒRƒ“ƒvƒŒƒbƒTj‚Íâ‘΂ÉON‚É‚µ‚È‚¢‚ʼnº‚³‚¢B‚Ü‚½ALC‚ª‚©‚©‚ç‚È‚¢‚悤‚É“ü—̓Œƒxƒ‹‚ð’²®‚µ‚ĉº‚³‚¢B + + ‘—M’†‚ÉuTXvƒ{ƒ^ƒ“‚ð‰Ÿ‚·‚ÆŽóMØ‚è‘Ö‚¦—\–ñó‘ԂɂȂèA‘—M‰æ–Ê“à‚Ì‘—M“d•¶‚ª‘S•”o—Í‚³‚ê‚Ä‚©‚çŽóMó‘Ô‚É–ß‚è‚Ü‚·B‹­§“I‚ÉŽóM‚É–ß‚·‚É‚ÍuTXOFFvƒ{ƒ^ƒ“iF8ƒL[j‚ð‰Ÿ‚µ‚Ü‚·B + + ŽóMó‘Ô‚ÅA‘—M‰æ–ʂɂ ‚ç‚©‚¶‚ß•¶Žš‚ð“ü—Í‚µ‚Ä‚¨‚«uTXvƒ{ƒ^ƒ“‚ð‰Ÿ‚µ‚Ä‚»‚ê‚ð‘—M‚³‚¹‚鎖‚à‚Å‚«‚Ü‚·B + + –¢‘—o‚Ì•¶Žš‚ÍuBSvƒL[‚ð‰Ÿ‚µ‚ÄÁ‹Ž‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·‚ªAPSK31‚̂悤‚É‘—Mς݂̕¶Žš‚ðÁ‹Ž‚·‚邱‚Ƃ͂ł«‚Ü‚¹‚ñB‚±‚Ìê‡uBSvƒL[‚ð‰Ÿ‚·‚ÆuXv‚ª‘—M‚³‚ê‚Ü‚·BƒIƒvƒVƒ‡ƒ“ƒƒjƒ…[‚Ìu‘—M•û–@v‚Åuƒ[ƒh’PˆÊv‚ð‘I‘ð‚·‚é‚ÆAƒXƒy[ƒX‚©‰üs‚ð“ü—Í‚·‚é‚܂ł»‚Ì’PŒê‚Ì‘—M‚ª•Û—¯‚³‚ê‚Ü‚·‚Ì‚ÅA•¶Žš‚ÌC³‚ª‚µˆÕ‚­‚È‚è‚Ü‚·B + +*uCtrl+BSvƒL[‚ð‰Ÿ‚·‚ÆA–¢‘—o‚Ì‚Ps‚ðÁ‹Ž‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B + + + ‘—M‰æ–ʂ̂·‚®ã‚É‚ ‚éƒ{ƒ^ƒ“‚ÍAQSO’†‚ÌŒˆ‚܂肫‚Ü‚Á‚½ƒƒbƒZ[ƒW“à—e‚ª’è‹`‚µ‚Ä‚ ‚è‚Ü‚·B‚Ü‚½ƒhƒƒbƒvƒŠƒXƒg‚É‚à’èŒ^ƒƒbƒZ[ƒW‚ð’è‹`‚³‚ê‚Ä‚¢‚Ü‚·‚Ì‚ÅA‚±‚ê‚ç‚ð—˜—p‚µ‚Ä‚­‚¾‚³‚¢B‚à‚¿‚ë‚ñƒ{ƒ^ƒ“‚âƒhƒƒbƒvƒŠƒXƒg‚Ì–¼‘O‚â“à—e‚Í‚»‚ꂼ‚ê•ÏX‰Â”\‚Å‚·B + + ƒ{ƒ^ƒ“‚Ì–¼‘O‚â“à—e‚ð•ÏX‚·‚éꇂÍA•ÒWƒƒjƒ…[‚ÌuMacroƒ{ƒ^ƒ“‚Ì•ÒWv‚ð‘I‘ð‚µA‰æ–Ê“à‚É•\ަ‚³‚ê‚铯‚¶ƒ{ƒ^ƒ“‚ð‰Ÿ‚µ‚ÄA“à—e‚Æ–¼‘O‚ð“o˜^‚µ‚ĉº‚³‚¢B + ƒhƒƒbƒvƒŠƒXƒg‚Ì–¼‘O‚â“à—e‚ð•ÏX‚·‚éꇂÍA‚·‚®‰¡‚ÌuEditvƒ{ƒ^ƒ“‚ð‰Ÿ‚µ‚Ä“à—e‚Æ–¼‘O‚ð“o˜^‚µ‚ĉº‚³‚¢B + +*’è‹`ς݂̃{ƒ^ƒ“‚ðƒ}ƒEƒX‚̉Eƒ{ƒ^ƒ“‚ŃNƒŠƒbƒN‚µ‚Ä•ÒW‰æ–Ê‚ðŒÄ‚Ño‚·‚±‚Æ‚à‚Å‚«‚Ü‚·B + + + ƒ{ƒ^ƒ“‚âƒhƒƒbƒvƒŠƒXƒg‚̃ƒbƒZ[ƒW•¶‚ɂ͎Ÿ‚Ì“Á•ʂȋL†‚ð‹Lq‚Å‚«‚Ü‚·B + + \ ƒƒbƒZ[ƒW‚Ìʼn‚É‹Lq‚µ‚Ä‘—M‰æ–Ê‚ðƒNƒŠƒA‚·‚é + ƒƒbƒZ[ƒW‚ÌÅŒã‚É‹Lq‚µ‚ÄŽóM‚ÉØ‚è‘Ö‚¦‚é + # ƒƒbƒZ[ƒW‚Ìæ“ª‚É‹Lq‚µ‚Ä‘—M‚ÉØ‚è‘Ö‚¦‚é + %c ‘ŠŽè‹Ç‚̃R[ƒ‹ƒTƒCƒ“iCallj + %r ‘ŠŽè‹Ç‚ÌM†‹­“x(HisRST) + %R HisRST‚ÌRST•”•ª + %N HisRST‚̃Rƒ“ƒeƒXƒgƒiƒ“ƒo•”•ª + %M MyRST‚̃Rƒ“ƒeƒXƒgƒiƒ“ƒo•”•ª + %n ‘ŠŽè‹Ç‚Ì–¼‘O(Name) + %q ‘ŠŽè‹Ç‚ÌQTH + %m Ž©•ª‚̃R[ƒ‹ƒTƒCƒ“ + %s Ž©‹Ç‚ÌM†‹­“x(MyRST) + %g HELLO/GOOD MORNING/AFTERNOON/EVENING + %f GM/GA/GE + %L LTRƒR[ƒh‹­§‘—M + %F FIGƒR[ƒh‹­§‘—M + %D UTCŒ»Ý“ú•t (—á 2000-SEP-05) + %T UTCŒ»ÝŽž (—á 17:44) + %t UTCŒ»ÝŽž (—á 1744) + %E ’è‹`‚ÌI—¹ + ^ –ñ‚P•bŠÔ‚̃EƒGƒCƒg + _ ƒ}[ƒNM†‚Ì‘—o + ~ ƒ}[ƒNM†OFFiƒLƒƒƒŠƒA’âŽ~j + [ Diddle‹ÖŽ~ + ] Diddle‹ÖŽ~‚̉ðœ + +*%g‚Æ%f‚Í‘ŠŽè‹Ç‚̃ƒJ[ƒ‹ƒ^ƒCƒ€‚É‚æ‚Á‚ĕω»‚µ‚Ü‚·B +*ƒhƒƒbƒvƒŠƒXƒg‚É•\ަ‚³‚ê‚é–¼‘O‚Íí‚ÉABC‡‚Å‚·B +*ƒhƒƒbƒvƒŠƒXƒg‚É‚ÍÅ‘å‚U‚SŒÂ‚̃ƒbƒZ[ƒW‚ð“o˜^‚Å‚«‚Ü‚·B‚U‚SŒÂ‚ð’´‚¦‚Ä“o˜^‚·‚éê‡AÅ‚àŽQÆŽž‚̌¢ƒƒbƒZ[ƒW‚ªÁ‹Ž‚³‚ê‚Ü‚·B +*ƒhƒƒbƒvƒŠƒXƒg‚̓fƒtƒHƒ‹ƒg‚ÅuCtrl+F1vƒL[`uCtrl+F9vƒL[‚Å‚àŒÄ‚Ño‚·‚±‚Æ‚ª‚Å‚«‚Ü‚·B + +*ƒIƒvƒVƒ‡ƒ“ƒƒjƒ…[‚ÌÝ’è‰æ–Ê‚ÅuƒL[ƒ[ƒh‚Ì‘¦Žž•ÏŠ·v‚̃`ƒFƒbƒN‚ð•t‚¯‚邯A“ü—̓{ƒ^ƒ“‚âƒhƒƒbƒvƒŠƒXƒg‚Ì’è‹`“à—e‚ð‘—M‰æ–ʂɓWŠJ‚·‚éÛA’¼‚¿‚Éã‹L‚ÌŽQƃL[ƒ[ƒh‚ª•ÏŠ·‚³‚ê‚Ü‚·BƒfƒtƒHƒ‹ƒgiƒ`ƒFƒbƒN‚È‚µj‚Å‚ÍA‚»‚Ì•¶Žš‚ª‘—M‚³‚ê‚éۂɕϊ·‚³‚ê‚Ü‚·B + +*‘—M‰æ–ʂ̑傫‚³‚ÍuCtrl+ªvƒL[AuCtrl+«vƒL[‚Å’²®‚Å‚«‚Ü‚·B + + +›•\ަƒtƒHƒ“ƒg‚ÆF +~~~~~~~~~~~~~~~~~~ + ƒIƒvƒVƒ‡ƒ“ƒƒjƒ…[‚ÌÝ’è‰æ–Ê‚ÌuƒtƒHƒ“ƒg/•\ަv‚̃y[ƒW‚ŃtƒHƒ“ƒg‚âF‚ðÝ’è‚·‚鎖‚ª‚Å‚«‚Ü‚·B‚±‚̃tƒHƒ“ƒg‚ÆF‚ÍŽóM‰æ–Ê‚¨‚æ‚Ñ‘—M‰æ–ʂɉe‹¿‚µ‚Ü‚·B‚Ü‚½WaterFall‚ÌF‚ðÝ’è‚·‚邱‚Æ‚à‚Å‚«‚Ü‚·B + + uŽQÆvƒ{ƒ^ƒ“‚ð‰Ÿ‚·‚ƃtƒHƒ“ƒg‚̈ꗗ‚ª•\ަ‚³‚ê‚Ü‚·B‘I‘ð‚·‚éƒtƒHƒ“ƒg‚É‚æ‚Á‚Ăͳ‚µ‚­•\ަ‚³‚ê‚È‚¢ê‡‚à‚ ‚é‚©‚à’m‚ê‚Ü‚¹‚ñB + •¶Žš‚Ì•À‚Ñ‚ª‹·‰ß‚¬‚½‚èL‰ß‚¬‚½‚è‚·‚éꇂÍu•\ަ’²®v‚Ì’l‚ð”÷’²‚µ‚ĉº‚³‚¢Bƒvƒ‰ƒX‚Ì’l‚ðÝ’è‚·‚邯L‚­‚È‚èAƒ}ƒCƒiƒX‚Ì’l‚ðÝ’è‚·‚邯‹·‚­‚È‚è‚Ü‚·B + +*ƒvƒƒ|[ƒVƒ‡ƒiƒ‹ƒtƒHƒ“ƒg‚ð‘I‘ð‚µ‚Ä‚à•¶Žš‚Ì•\ަƒsƒbƒ`‚͌Œ肳‚ê‚Ü‚·B +*ŽÎü•t‚«‚Ì‚O‚͉¢•¶ƒtƒHƒ“ƒg‚Å‚ÍuØvA˜a•¶ƒtƒHƒ“ƒg‚Å‚ÍuƒÓv‚ɕϊ· + ‚µ‚Ä•\ަ‚µ‚Ü‚·B + + WaterFall‚ÌF‚ÍuLv‚ª’á‚¢M†ƒŒƒxƒ‹AuHv‚ª‚‚¢M†ƒŒƒxƒ‹‚ÌF‚ð‚»‚ê‚¼‚êŽw’肵‚Ü‚·BMMTTY‚ÍŽw’肳‚ꂽ‚Q‚‚ÌF‚©‚ç‚P‚Q‚W’iŠK‚ÌŠK’²‚ɕϊ·‚µ‚Ü‚·B‚ ‚½‚è‚Ü‚¦‚Å‚·‚ª—¼ŽÒ‚͂ł«‚邾‚¯ƒRƒ“ƒgƒ‰ƒXƒg‚ª‚ ‚é‚Ù‚¤‚ª”»‚èˆÕ‚­ƒfƒtƒHƒ‹ƒg‚ÌL=•AH=”’‚ªÅ‚à“K‚µ‚Ä‚¢‚邯Žv‚¢‚Ü‚·B + + 256FƒrƒfƒIƒAƒ_ƒvƒ^[‚ðŽg‚Á‚Ä‚¢‚éê‡AuƒpƒŒƒbƒg‚ðŽg‚¤v‚Ƀ`ƒFƒbƒN‚ð•t‚¯‚邯AMMTTY‚ÍŽóM‰æ–ʂ̔wŒiFA‘—M‰æ–ʂ̔wŒiFAWaterFall‚ÌF‚ð‰Â”\‚ÈŒÀ‚èŽw’肳‚ꂽF‚Ɉê’v‚³‚¹‚悤‚ÆŽŽ‚Ý‚Ü‚·B‚½‚¾‚µ•¶ŽšF‚ɂ‚¢‚Ä‚ÍÅ‚àŽw’èF‚ɋ߂¢ƒF‚Å•\ަ‚³‚ê‚Ü‚·B + + +*ƒtƒ‹ƒJƒ‰[ƒrƒfƒIƒAƒ_ƒvƒ^[‚Ìê‡AuƒpƒŒƒbƒg‚ðŽg‚¤v‚͉e‹¿‚µ‚Ü‚¹‚ñB‚·‚ׂĂÌF‚ªí‚ɳ‚µ‚­ÄŒ»‚³‚ê‚Ü‚·B + + +›ƒ}ƒNƒ‘—M +~~~~~~~~~~~~ + ‰æ–Êã‚Ì‚P‚UŒÂ‚̃{ƒ^ƒ“‚̓}ƒNƒƒ{ƒ^ƒ“‚Å‚·B‚±‚±‚É‚ ‚ç‚©‚¶‚߃ƒbƒZ[ƒW‚ð‹L‰¯‚µ‚Ä‚¨‚«Aƒ{ƒ^ƒ“‚ð‰Ÿ‚µ‚Ä‘—M‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B + ƒfƒtƒHƒ‹ƒg‚Å‚ÍM1`M5AM13AM15AM16‚É‚»‚ꂼ‚ꃃbƒZ[ƒW‚ª‹L‰¯‚³‚ê‚Ä‚¢‚Ü‚·‚ªA‚à‚¿‚ë‚ñ‚±‚ê‚ç‚Í“à—e‚ð•ÏX‚·‚鎖‚ª‚Å‚«‚Ü‚·B + + ƒfƒtƒHƒ‹ƒg‚ňȉº‚̃Vƒ‡[ƒgƒJƒbƒgƒL[‚àŽg‚¦‚Ü‚·B + M1 Ctrl+1 + M2 Ctrl+2 + M3 Ctrl+3 + M4 Ctrl+4 + M5 Ctrl+5 + M6 Ctrl+6 + M7 Ctrl+7 + M8 Ctrl+8 + M9 Ctrl+9 + M10 F10 + M11 F11 + M12 F12 + M15 F7 + M16 F6 + + + ƒ{ƒ^ƒ“‚Ì–¼‘O‚â“à—e‚ð•ÏX‚·‚éꇂÍA•ÒWƒƒjƒ…[‚ÌuMacroƒ{ƒ^ƒ“‚Ì•ÒWv‚ð‘I‘ð‚µA‰æ–Ê“à‚É•\ަ‚³‚ê‚铯‚¶ƒ{ƒ^ƒ“‚ð‰Ÿ‚µ‚ÄA“à—e‚Æ–¼‘O‚ð“o˜^‚µ‚ĉº‚³‚¢B + +*’è‹`ς݂̃{ƒ^ƒ“‚ðƒ}ƒEƒX‚̉Eƒ{ƒ^ƒ“‚ŃNƒŠƒbƒN‚µ‚Ä•ÒW‰æ–Ê‚ðŒÄ‚Ño‚·‚±‚Æ‚à‚Å‚«‚Ü‚·B + + ƒƒbƒZ[ƒW‚ɂ͎Ÿ‚Ì“Á•ʂȋL†‚ð‹Lq‚Å‚«‚Ü‚·B + + \ ƒƒbƒZ[ƒW‚Ìæ“ª‚É‹Lq‚µ‚Ä‘—M‰æ–ʂɓWŠJ‚µ‚Ä‘—M‚·‚é + \ ƒƒbƒZ[ƒW‚ÌÅŒã‚É‹Lq‚µ‚ÄŽóM‚ÉØ‚è‘Ö‚¦‚é + # ƒƒbƒZ[ƒW‚Ìæ“ª‚É‹Lq‚µ‚Ä‘—M‰æ–ʂɓWŠJ‚·‚é + # ƒƒbƒZ[ƒW‚ÌÅŒã‚É‹Lq‚µ‚Äæ“ª‚©‚çŒJ‚è•Ô‚µ‘—M‚·‚é + %c ‘ŠŽè‹Ç‚̃R[ƒ‹ƒTƒCƒ“iCallj + %r ‘ŠŽè‹Ç‚ÌM†‹­“x(HisRST) + %R HisRST‚ÌRST•”•ª + %N HisRST‚̃Rƒ“ƒeƒXƒgƒiƒ“ƒo•”•ª + %M MyRST‚̃Rƒ“ƒeƒXƒgƒiƒ“ƒo•”•ª + %n ‘ŠŽè‹Ç‚Ì–¼‘O(Name) + %q ‘ŠŽè‹Ç‚ÌQTH + %m Ž©•ª‚̃R[ƒ‹ƒTƒCƒ“ + %s Ž©‹Ç‚ÌM†‹­“x(MyRST) + %g GOOD MORNING/AFTERNOON/EVENING + %f GM/GA/GE + %L LTRƒR[ƒh‹­§‘—M + %F FIGƒR[ƒh‹­§‘—M + %D UTCŒ»Ý“ú•t (—á 2000-SEP-05) + %T UTCŒ»ÝŽž (—á 17:44) + %t UTCŒ»ÝŽž (—á 1744) + %E ’è‹`I—¹ + _ ƒ}[ƒNM†‚Ì‘—o + ~ ƒ}[ƒNM†OFFiƒLƒƒƒŠƒA’âŽ~j + [ Diddle‹ÖŽ~ + ] Diddle‹ÖŽ~‚̉ðœ + +*%g‚Æ%f‚Í‘ŠŽè‹Ç‚̃ƒJ[ƒ‹ƒ^ƒCƒ€‚É‚æ‚Á‚ĕω»‚µ‚Ü‚·B +*ƒRƒ“ƒeƒXƒgƒiƒ“ƒo‚ð‘—M‚·‚鎞‚͗Ⴆ‚Îu%R-%N-%Nv‚̂悤‚É’è‹`‚µ‚Ä‚¨‚­‚Æ—Ç‚¢‚Å‚µ‚傤B +*—Ⴆ‚΃Rƒ“ƒeƒXƒg‚ȂǂÌÛACQ‚ðŒJ‚è•Ô‚µ‘—M‚µ‚½‚¢ê‡Aƒ}ƒNƒ•ÒW‰æ–Ê‚ÌRepeat‚É‚OˆÈŠO‚Ì’li0.1•b’PˆÊj‚ðݒ肵‚ĉº‚³‚¢BƒŠƒs[ƒg‚̉ðœ‚ÍŽóM‰æ–ʂ܂½‚Í‘—M‰æ–Ê‚ðƒNƒŠƒbƒN‚·‚ê‚ÎOK‚Å‚·B + + ƒ}ƒNƒ‚©‚çŽQÆ‚·‚鑊Žè‹Ç‚̃R[ƒ‹ƒTƒCƒ“‚â–¼‘O‚ȂǂÍAƒƒCƒ“‰æ–Ê’†‰›‚Ì“ü—̓{ƒbƒNƒX‚É“ü—Í‚·‚é‚©A‚Ü‚½‚ÍŽóM‰æ–ʂ̂»‚Ì•¶Žš—ñ‚̈ʒu‚ðƒ}ƒEƒX‚̶ƒ{ƒ^ƒ“‚ŃNƒŠƒbƒN‚µ‚Ä“ü—Í‚·‚邱‚Æ‚à‚Å‚«‚Ü‚·B + + +›FSK‚ʼn^—p‚·‚éê‡ +~~~~~~~~~~~~~~~~~~~ + AFSK‚ł͂Ȃ­FSKiƒTƒEƒ“ƒho—Í‚ðŽg—p‚¹‚¸’¼ÚRig‚ðƒL[ƒCƒ“ƒO‚·‚éj‚ʼn^—p‚·‚éꇂÍAƒIƒvƒVƒ‡ƒ“ƒƒjƒ…[‚ÌÝ’è‰æ–Êu‚»‚Ì‘¼v‚̃y[ƒW‚ÅAo—̓|[ƒg‚ðuSound+Com(TXD)v‚Ü‚½‚ÍuCom(TXD)v‚Éݒ肵‚Ü‚·B‚±‚Ìê‡A‚ ‚ç‚©‚¶‚ßu‘—Mvƒy[ƒW‚ÌuPTTv‚ÉCOM1`COMx‚Ì‚¢‚¸‚ê‚©‚ðݒ肵‚Ä‚¨‚­•K—v‚ª‚ ‚è‚Ü‚·B + +@ˆÈ‰º‚É‚±‚Ì‘I‘ð‚É‚æ‚é“®ì‚̈Ⴂ‚ðŽ¦‚µ‚Ü‚·B + +Sound +@‘—MŽž‚̓TƒEƒ“ƒhƒJ[ƒh‚̃^ƒCƒ~ƒ“ƒO‚Å“®ì‚µATXD‚É•„†‚Ío—Í‚³‚ê‚Ü‚¹‚ñB + +Sound+Com(TXD) +@‘—MŽž‚̓TƒEƒ“ƒhƒJ[ƒh‚̃^ƒCƒ~ƒ“ƒO‚Å“®ì‚µAUART‚ð‰î‚µ‚ÄTXD‚É‚à•„†‚ðo—Í‚µ‚Ü‚·BUART‚ƃTƒEƒ“ƒhƒJ[ƒh‚̃^ƒCƒ~ƒ“ƒO’²®‚Ì‚½‚ß‚ÉADiddleƒR[ƒh‚ð‘}“ü‚·‚éꇂª‚ ‚è‚Ü‚·B + +Com(TXD) +@‘—MŽž‚ÍŠ®‘S‚ÉUART‚̃^ƒCƒ~ƒ“ƒO‚Å“®ì‚µAƒTƒEƒ“ƒhƒJ[ƒh‚Í’âŽ~‚µ‚Ü‚·B + + + TXD‚©‚çŽæ‚èo‚µ‚½M†‚ÍAPTT§Œä‰ñ˜H‚Æ“¯‚¶‰ñ˜H‚ŃL[ƒCƒ“ƒO‰ñ˜H‚ðì‚Á‚½ê‡Aƒm[ƒ}ƒ‹ƒVƒtƒgiRig‘¤‚̓L[ƒI[ƒvƒ“Žž‚ɃXƒy[ƒX‚ª‘—M‚³‚ê‚邯‘z’èj‚ɂȂè‚Ü‚·B + +@FSK‚ʼn^—p‚·‚éꇂÉAFC‚ðON‚É‚·‚邯AMMTTY‚̃}[ƒNŽü”g”‚ª•ω»‚µ‚Ä‚µ‚Ü‚¤‚½‚ß‚ÉA‘ŠŽè‹Ç‚Ƃ̃[ƒƒCƒ“‚ª‚Å‚«‚È‚­‚È‚è‚Ü‚·B‚±‚ê‚ð‰ñ”ð‚·‚é•û–@‚ð–{‘‚̌㔼‚ÉuƒVƒtƒg•‚Ì•ÏX‘€ìv‚Ì€–Ú‚É‹LÚ‚µ‚Ä‚ ‚è‚Ü‚·‚Ì‚ÅA•¹‚¹‚ÄŽQÆ‚µ‚ĉº‚³‚¢B + + +*FSK‰^—p‚ðs‚¤ê‡‚ÍAÝ’è‰æ–Ê‚Ìu‘—Mv‚̃y[ƒW‚ÌuTxBPFv‚âuTxLPFv‚Í–³ŠÖŒW‚Å‚·‚Ì‚ÅA“®ì‘¬“x㌵‚µ‚¢CPU‚ð‚¨Žg‚¢‚ÌꇂÍA‚±‚ê‚ç‚ðOFF‚É‚µ‚Ä‚¨‚­‚±‚Æ‚ð‚¨Š©‚ß‚µ‚Ü‚·B + +*TXD‚©‚ç•„†‚ðo—Í‚µ‚½ê‡AƒƒCƒ“‰æ–Ê‚ÌuRevvƒ{ƒ^ƒ“‚ÍA‘—M‚̃Vƒtƒg‚ɂ͉e‹¿‚µ‚È‚­‚È‚è‚Ü‚·B +*TXD‚©‚ç•„†‚ðo—Í‚µ‚½ê‡AUART‚̧ŒÀ‚©‚ç5’PˆÊ’·‚ÌŽž‚̓Xƒgƒbƒvƒrƒbƒg‚ð2bit‚ɂł«‚Ü‚¹‚ñiƒfƒR[ƒhÝ’è‚Å2bit‚ª‘I‘ð‚³‚ê‚Ä‚¢‚Ä‚à1.5bit‚Å‘—M‚µ‚Ü‚·jB + + + USB-Comƒ|[ƒg‚ðŽg‚¤ê‡‚ÅA³‚µ‚­FSKM†‚ª‘—M‚Å‚«‚È‚¢ê‡‚ÍASound+TXD‚Ü‚½‚ÍTxD‚ð‘I‚ñ‚¾ŒãAuUSB Portv‚̃{ƒ^ƒ“‚ð‰Ÿ‚µ‚Ĉ—‚ð‘I‘ð‚µ‚Ä‰º‚³‚¢B + +[A:’Êí‚̈—(Normal)] + •’ʂ̕û–@‚Å‘—M‚µ‚Ü‚·B +[B:ƒ|[ƒŠƒ“ƒO(Polling)] + Windows‚Ì‘—MƒCƒxƒ“ƒg‚ðŽg—p‚¹‚¸‚Ƀ|[ƒŠƒ“ƒO‚É‚æ‚è‘—M‚µ‚Ü‚·B +[C:‘—M‘¬“x‚̧ŒÀ(Limiting speed)] + ‘—M‘¬“x‚ð§ŒÀ‚µADiddle‚ªƒoƒbƒtƒ@‚É—­‚Ü‚é‚Ì‚ð–hŽ~‚µ‚Ü‚·B +[D:‘—M‘¬“x‚̧ŒÀ‚ƃ|[ƒŠƒ“ƒO(Polling and Limiting speed)] + Windows‚Ì‘—MƒCƒxƒ“ƒg‚ðŽg—p‚¹‚¸‚Ƀ|[ƒŠƒ“ƒO‚É‚æ‚è‘—M‚µ‚Ü‚·B +‚Ü‚½‘—M‘¬“x‚ð§ŒÀ‚µADiddle‚ªƒoƒbƒtƒ@‚É—­‚Ü‚é‚Ì‚ð–hŽ~‚µ‚Ü‚·B + +*Real-Comƒ|[ƒg‚ðŽg‚¤ê‡‚ÍA[A:’Êí‚̈—(Normal)]‚ð‘I‘ð‚µ‚Ä‰º‚³‚¢B +*USB-Comƒ|[ƒg‚ðŽg‚¤ê‡‚ÅA[A:’Êí‚̈—(Normal)]‚ų‚µ‚­“®ì‚µ‚È‚¢ê‡‚ÍA‘¼‚Ì•û–@iB,C,Dj‚ðŽŽ‚µ‚ĉº‚³‚¢B +*Comƒ|[ƒg‚̃I[ƒvƒ“ƒGƒ‰[ƒƒbƒZ[ƒW‚ª•\ަ‚³‚ê‚éê‡A‚»‚̃|[ƒg‚Å‚ÌFSK‘—M‚͂ł«‚Ü‚¹‚ñi‚»‚̃|[ƒg‚ª5ƒrƒbƒg’·‚ðƒTƒ|[ƒg‚µ‚Ä‚¢‚È‚¢‰Â”\«‚ª‚ ‚è‚Ü‚·jB + + +›ƒTƒEƒ“ƒh‚Ì‹L˜^‚ÆÄ¶ +~~~~~~~~~~~~~~~~~~~~~~ + MMTTYƒfƒ‚ƒWƒ…ƒŒ[ƒ^‚Ì’²®‚ðs‚¤ê‡AŽóM‚µ‚½ƒTƒEƒ“ƒh‚ðƒtƒ@ƒCƒ‹‚É‹L˜^‚µ‚Ä‚¨‚«A‚»‚ê‚ðĶ‚µ‚ĉ½“x‚Å‚à“¯‚¶ƒ\[ƒX‚ðŽÀŒ±‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B + ƒTƒEƒ“ƒh‚ð‹L˜^‚·‚éꇂÍAƒtƒ@ƒCƒ‹ƒƒjƒ…[‚ÌuŽóMƒTƒEƒ“ƒh‚ðƒtƒ@ƒCƒ‹‚É‹L˜^v‚ð‘I‘ð‚µ‚Ü‚·B‚Ü‚½‹L˜^‚µ‚½ƒtƒ@ƒCƒ‹‚ðĶ‚·‚éꇂ̓tƒ@ƒCƒ‹ƒƒjƒ…[‚ÌuŽóMƒTƒEƒ“ƒh‚ðƒtƒ@ƒCƒ‹‚©‚çĶv‚ð‘I‘ð‚µ‚Ü‚·B + + Žc”O‚È‚ª‚çAŒ»ó‚ÌMMTTY‚ÍWindows•W€‚ÌWAVEƒtƒ@ƒCƒ‹‚ł͂Ȃ­A“ÆŽ©‚̃tƒH[ƒ}ƒbƒg‚̃tƒ@ƒCƒ‹‚µ‚©ˆµ‚¦‚Ü‚¹‚ñB‚±‚̃tƒ@ƒCƒ‹‚͂ƂĂàƒTƒCƒY‚ª‘å‚«‚­‚È‚è‚Ü‚·‚̂ŃfƒBƒXƒN‚É‚ ‚é’ö“x‚Ì—]—T‚ª•K—v‚Å‚·B + +*‹L˜^’†‚ÍFFT•\ަ“à‚̶ã‚ÉuRec.v‚ð•\ަ‚µ‚Ü‚·B +*Ķ’†‚ÍFFT•\ަ“à‚̉Eã‚ÉuPlayv‚ð•\ަ‚µ‚Ü‚·B +*‹L˜^’†‚ɃfƒBƒXƒN‚ªˆê”t‚É‚È‚é‚ÆŽ©“®“I‚É‹L˜^‚ªI—¹‚µ‚Ü‚·B +*Ķ’†‚Ƀtƒ@ƒCƒ‹‚ªI—¹‚·‚邯ީ“®“I‚ÉĶ‚ÍI—¹‚µ‚Ü‚·B + + +›ƒfƒ‚ƒWƒ…ƒŒ[ƒ^‚ÉÝ’è‚·‚éƒpƒ‰ƒ[ƒ^ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + MMTTY‚͈ȉº‚Ì‚R•ûŽ®‚̃fƒ‚ƒWƒ…ƒŒ[ƒ^‚ð“‹Ú‚µ‚Ä‚¢‚Ü‚·B + + EIIRŒ^‹¤UŠí‚É‚æ‚éŽü”g”•Ù•ÊŠí•ûŽ® + EFIRŒ^BPF‚É‚æ‚éŽü”g”•Ù•ÊŠí•ûŽ® + EPLL•ûŽ® + +@‚¢‚¸‚ê‚Ì•ûŽ®‚ª—D‚ê‚Ä‚¢‚é‚©‚͂͂Á‚«‚è‚Æ‚Í”»‚è‚Ü‚¹‚ñ‚ªAIIRŒ^‹¤UŠí‚ðŽg‚Á‚½Žü”g”•Ù•ÊŠí•ûŽ®‚ª‚Ƃ肠‚¦‚¸–³“‚ÆŽv‚¢‚Ü‚·B + +@‚¢‚¸‚ê‚Ì•ûŽ®‚ðŽg—p‚·‚é‚©‚ÍAƒƒCƒ“‰æ–Ê‚ÌDemodulator˜g‚ÌuTypevƒ{ƒ^ƒ“‚ð‰Ÿ‚·‚©AƒIƒvƒVƒ‡ƒ“ƒƒjƒ…[‚ÌÝ’è‰æ–ʂőI‘ð‚·‚éŽ–‚ª‚Å‚«‚Ü‚·BŒ»Ý‘I‘ð‚³‚ê‚Ä‚¢‚é•ûŽ®‚ªƒƒCƒ“‰æ–Ê‚ÉuDemodulator (IIR)v‚̂悤‚É•\ަ‚³‚ê‚Ü‚·B + +@ƒfƒ‚ƒWƒ…ƒŒ[ƒ^‚Ì\¬‚ÌÚׂÍuDigital.txtv‚ðŽQÆ‚µ‚ĉº‚³‚¢B + + + ƒƒCƒ“‰æ–Êã‚̃fƒ‚ƒWƒ…ƒŒ[ƒ^‚ÉŠÖŒW‚·‚éƒpƒ‰ƒ[ƒ^‚͈ȉº‚Ì’Ê‚è‚Å‚·B + +Demodulator˜g“à + Type ƒfƒ‚ƒWƒ…ƒŒ[ƒ^‚Ì•ûŽ®‚ð‘I‘ð‚µ‚Ü‚·BiƒfƒtƒHƒ‹ƒg=IIRj + + Mark ƒ}[ƒNŽü”g”‚ðݒ肵‚Ü‚·BiƒfƒtƒHƒ‹ƒg=2125j + Shift ƒVƒtƒg•‚ðݒ肵‚Ü‚·BiƒfƒtƒHƒ‹ƒg=170j + Rev ƒ}[ƒN‚ƃXƒy[ƒX‚𔽓]‚µ‚ÄŽóMi‘—Mj‚µ‚Ü‚·(USB—p)B + ATC ATC‚ðON/OFF‚µ‚Ü‚·BiƒfƒtƒHƒ‹ƒg=OFFj + NET ‘—MŽü”g”‚ðŽóMŽü”g”‚ƈê’v‚³‚¹‚Ü‚·BiƒfƒtƒHƒ‹ƒg=ONj + AFC AFC‚ðON/OFF‚µ‚Ü‚·BiƒfƒtƒHƒ‹ƒg=ONj + BPF ‘O’uBPF‚ðON/OFF‚µ‚Ü‚·BiƒfƒtƒHƒ‹ƒg=OFFj + Notch ‘O’u“K‰žƒtƒBƒ‹ƒ^‚ðON/OFF‚µ‚Ü‚·B + LMS ‘O’uƒmƒbƒ`ƒtƒBƒ‹ƒ^‚ðON/OFF‚µ‚Ü‚·B + SQ ƒXƒPƒ‹ƒ`‚ðON/OFF‚µ‚Ü‚·B + ½×²ÄÞ SQ‚̃XƒŒƒbƒVƒ…ƒz[ƒ‹ƒhƒŒƒxƒ‹‚ðݒ肵‚Ü‚·B + HAM ƒ}[ƒNŽü”g”AƒVƒtƒgAƒfƒR[ƒhÝ’è‚ðHAM—p‚É‚µ‚Ü‚·B + +[ˆÈ‰º‚ÍŽü”g”•Ù•ÊŠí•ûŽ®‚Ìê‡] + BW IIR‹¤UŠí‚ÌBW‚ðݒ肵‚Ü‚·BiƒfƒtƒHƒ‹ƒg=60j + Tap FIRŒ^BPF‚ÌŽŸ”‚ðݒ肵‚Ü‚·BiƒfƒtƒHƒ‹ƒg=72j + AV. FIRŒ^Ï•ªŠí‚̃Xƒ€[ƒWƒ“ƒOŽü”g”‚ðݒ肵‚Ü‚·BiƒfƒtƒHƒ‹ƒg=70j + LPF IIR-LPF‚̃JƒbƒgƒIƒtŽü”g”‚ðݒ肵‚Ü‚·BiƒfƒtƒHƒ‹ƒg=40j + +[ˆÈ‰º‚ÍPLL•ûŽ®‚Ìê‡] + VCO VCOƒQƒCƒ“‚ðݒ肵‚Ü‚·BiƒfƒtƒHƒ‹ƒg=3.0j + Loop LoopLPF‚̃JƒbƒgƒIƒtŽü”g”‚ðݒ肵‚Ü‚·BiƒfƒtƒHƒ‹ƒg=250j + + ƒIƒvƒVƒ‡ƒ“ƒƒjƒ…[‚ÌÝ’è‰æ–ʂłÍX‚Ɉȉº‚Ìݒ肪‚Å‚«‚Ü‚·B + + Žü”g”•Ù•ÊŠí‚Ì•ûŽ®‚Æ“®ìƒpƒ‰ƒ[ƒ^ + ƒŠƒ~ƒbƒ^ƒAƒ“ƒv‚̃QƒCƒ“‚ƈ—Žü”g” + Ï•ªŠí‚Ì•ûŽ®‚ƃXƒ€[ƒWƒ“ƒOŽü”g”AŽŸ” + ‘O’uƒtƒBƒ‹ƒ^‚Ì“®ìƒpƒ‰ƒ[ƒ^ + AFC‚Ì“®ìƒpƒ‰ƒ[ƒ^ + PLL‚Ì“®ìƒpƒ‰ƒ[ƒ^ + + +*ƒXƒy[ƒXŽü”g”‚̓}[ƒNŽü”g”‚ɃVƒtƒg•‚ð‰ÁŽZ‚µ‚½Žü”g”‚ɂȂè‚Ü‚·B +*ŽóM‹@‚Í’Êí‚ÍLSBƒ‚[ƒh‚ÅŽg—p‚µ‚Ü‚·B +*Žü”g”•ٕʊ킨‚æ‚ÑPLL‚Í‚Q”{‚̃I[ƒo[ƒTƒ“ƒvƒŠƒ“ƒO‚Å“®ì‚µ‚Ä‚¢‚Ü‚·B]‚Á‚ăiƒCƒLƒXƒgŽü”g”‚Í11025/4=2756Hz‚ɂȂèAƒXƒy[ƒXŽü”g”‚Í‚±‚ê‚æ‚è­‚µ‰º‚ÌŽü”g”i2600Hz•t‹ßj‚ªŽÀ—pŒÀŠE‚Å‚·B +*IIRŒ^‹¤UŠí‚ÌBW‚Í‹¤U‰ñ˜H‚̑ш敂ð•\‚µA‚±‚ê‚𬂳‚­‚·‚邯Q‚ª‚‚­‚È‚è‚Ü‚·B‚ ‚Ü‚èQ‚ð‚‚­‚µ‰ß‚¬‚邯”­U‚µ‚Ü‚·BHi +*IIRŒ^‹¤UŠí‚¨‚æ‚ÑFIRŒ^BPF‚Ì“Á«‚ÍAƒIƒvƒVƒ‡ƒ“ƒƒjƒ…[‚ÌÝ’è‰æ–Ê‚ÅAu“Á«Šm”Fvƒ{ƒ^ƒ“‚ð‰Ÿ‚·‚Æ•\ަ‚³‚ê‚Ü‚·B +*NET‚ðOFF‚É‚·‚é‚ÆÝ’è‰æ–Ê‚ÌuHAM Defaultv‚Åݒ肵‚Ä‚¢‚éƒ}[ƒNŽü”g”‚ƃVƒtƒg•‚É‹­§“I‚ɃZƒbƒg‚µ‚Ä‘—M‚µ‚Ü‚·BNET‚ðON‚É‚·‚邯ŽóMƒ}[ƒNŽü”g”‚ƃVƒtƒg•‚ª‚»‚̂܂ܑ—M‚É“K—p‚³‚ê‚Ü‚·B + + + IIRŒ^‹¤UŠí‚ÌBW‚̓fƒtƒHƒ‹ƒg‚Ì60HziQ=36j‚łͭ‚µ‹·‚¢‚悤‚È‹C‚à‚µ‚Ü‚·‚Ì‚ÅAŽóMM†‚É‚æ‚Á‚Ä‚Í‚à‚¤­‚µL‚°‚ÄiQ‚ð’á‚­‚·‚éj‚Ý‚é‚Ì‚à—Ç‚¢‚©‚à’m‚ê‚Ü‚¹‚ñB + + ƒIƒvƒVƒ‡ƒ“ƒƒjƒ…[‚ÌÝ’è‰æ–Ê‚ÅƒŠƒ~ƒbƒ^ƒAƒ“ƒv‚ÌuOverSamplingv‚ðON‚É‚·‚邯AƒŠƒ~ƒbƒ^ƒAƒ“ƒv‚Å‚ÌˆÊ‘Š˜c‚Ý‚ªŠÉ˜a‚³‚ê‚Ü‚·B‚±‚ê‚ɂ‚¢‚Ä‚ÍuDigital.txtv‚ðŽQÆ‚µ‚ĉº‚³‚¢B + + +›‚`‚e‚b‚ɂ‚¢‚Ä +~~~~~~~~~~~~~~~~ + Žü”g”•Ù•ÊŠí‚Ì‹¤UŠí/BPF“Á«‚ª‚©‚Ȃ苷‚¢‚Ì‚ÅA­‚µ‚Å‚àŽü”g”‚ª‚¸‚ê‚Ä‚¢‚邯Ž|‚­ƒfƒR[ƒh‚Å‚«‚È‚­‚È‚è‚Ü‚·B‚»‚±‚ÅŽ©“®“I‚ÉŽü”g”‚ð‡‚킹‚éAFC‹@”\‚ð•t‚¯‚Ă݂܂µ‚½B + + ‚±‚ÌAFC‚ÍFFT‚É‚æ‚蓾‚ç‚ꂽ“ü—ÍM†‚ÌŽü”g”ƒXƒyƒNƒgƒ‰ƒ€‚ð‰ðÍ‚µ‚ÄŒ»ó‚Ƃ̃YƒŒ‚Ì•â³‚ð‚µ‚Ü‚·‚Ì‚ÅA•\ަƒƒjƒ…[‚ÌuFFT•\ަv‚Ƀ`ƒFƒbƒN‚ª‚‚¢‚Ä‚¢‚È‚¢‚Æ“®ì‚µ‚Ü‚¹‚ñB + “®ì‚Æ‚µ‚Ä‚ÍA–ñ300ms–ˆ‚ɃXƒyƒNƒgƒ‰ƒ€‚ðƒ`ƒFƒbƒN‚µA‚Q‚‚̃s[ƒN‚ð’T‚µ‚Ü‚·B“¾‚ç‚ꂽƒs[ƒN‚ÆŒ»Ý‚̃}[ƒNAƒXƒy[ƒXŽü”g”‚Ì·‚ðŒvŽZ‚µ‚ÄAœX‚ɕⳂµ‚Ä‚¢‚­ŽdŠ|‚¯‚Å‚·B + + ƒYƒŒ‚ð•Ⳃ·‚éÛAŽü”g”•Ù•ÊŠí‚Ì‹¤UŠí‚Ì’†SŽü”g”‚ÍAŒW”ŒvŽZƒ‹[ƒ`ƒ“‚ð‚»‚Ì“s“xŽÀs‚µ‚Ä•ÏX‚µ‚Ä‚¢‚Ü‚·BPLL•ûŽ®‚ÌꇂÍVCO‚̃tƒŠ[ƒ‰ƒ“ƒjƒ“ƒOŽü”g”‚ð•ÏX‚µ‚Ü‚·B + ƒIƒvƒVƒ‡ƒ“ƒƒjƒ…[‚ÌÝ’è‰æ–Ê‚ÅÝ’è‚·‚é‚`‚e‚bŠÖŒW‚̃pƒ‰ƒ[ƒ^‚͈ȉº‚Ì’Ê‚è‚Å‚·B + +EShift ƒVƒtƒg•‚ð•ÏX‚·‚é•û–@‚ð‘I‘ð‚µ‚Ü‚·B +ETime ‚±‚Ì’l‚𬂳‚­‚·‚邯‰ž“š‚ª‘¬‚­‚È‚è‚Ü‚·B +ESQ ‚±‚Ì’l‚𬂳‚­‚·‚邯Žã‚¢M†‚Å‚à“­‚«‚Ü‚·B +ESweep ’²¸‚·‚éŽü”g””͈ÍiƒVƒtƒg•~Sweepj + + Shift‚Ì‘I‘ð‚É‚æ‚é“®ì‚Í‚»‚ꂼ‚êˆÈ‰º‚Ì’Ê‚è‚Å‚·B + + Free §ŒÀ‚È‚µ‚ɕω»‚µ‚Ü‚·B + Fixed Œ»Ý‚Ìó‘ԂŌŒ肳‚ê‚Ü‚·iŽ©“®‚ŕω»‚µ‚Ü‚¹‚ñjB + HAM 170/200/220/240Hz‚ðŽû‘©–Ú•W‚É‚µ‚Ü‚·B + FSK ’†SŽü”g”‚ð•ÏX‚¹‚¸‚ɃVƒtƒg•‚¾‚¯170/200/220/240Hz‚É + Žû‘©‚³‚¹‚Ü‚·B + + SQƒŒƒxƒ‹‚ð‚ ‚Ü‚è¬‚³‚­‚·‚邯A–³M†Žž‚Å‚àƒmƒCƒY‚Ō듮삵‚Ä‚µ‚Ü‚¢‚Ü‚·‚ªA‚±‚ÌꇎóM‹@‚̒ʉߓÁ«‚Ì’†‰›•t‹ß‚ÉŽû‘©‚·‚éŒXŒü‚ª‚ ‚è‚Ü‚·‚Ì‚ÅACWƒtƒBƒ‹ƒ^‚ð“ü‚ê‚Ä‚¢‚éꇂ͂ ‚Ü‚è–â‘è‚͂Ȃ¢‚©‚à’m‚ê‚Ü‚¹‚ñB + +*ƒ}[ƒNŽü”g”‚Í300HzˆÈãAƒXƒy[ƒXŽü”g”‚Í2700HzˆÈ‰º‚̧ŒÀ‚ª‚ ‚è‚Ü‚·B + + +›‘O’uƒtƒBƒ‹ƒ^‚ɂ‚¢‚Ä +~~~~~~~~~~~~~~~~~~~~~~ + ƒƒCƒ“‰æ–ʂ̃fƒ‚ƒWƒ…ƒŒ[ƒ^˜g“à‚ÌBPFƒ{ƒ^ƒ“‚¨‚æ‚ÑNotch/LMSƒ{ƒ^ƒ“‚ð‰Ÿ‚·‚ÆA‰º}‚ÉŽ¦‚·‚悤‚Ƀfƒ‚ƒWƒ…ƒŒ[ƒ^“ü—Í•”‚É‚Q‚‚̃tƒBƒ‹ƒ^‚ð“ü‚ê‚邱‚Æ‚ª‚Å‚«‚Ü‚·B + + Sound ----> BPF ---> Notch/LMS ---> Limiter(Demodulator) + (ON/OFF) (ON/OFF) + + ƒIƒvƒVƒ‡ƒ“ƒƒjƒ…[‚ÌÝ’è‰æ–ʂŃfƒ‚ƒWƒ…ƒŒ[ƒ^‚ÌÝ’èƒy[ƒW‚ðŠJ‚­‚ÆA‚±‚ê‚ç‚̃tƒBƒ‹ƒ^‚ÌÚׂÈݒ肪‚Å‚«‚Ü‚·B + + ‚¢‚¸‚ê‚̃tƒBƒ‹ƒ^‚àAŽü”g”•Ù•ÊŠí‚ÅŽg‚Á‚Ä‚¢‚éƒtƒBƒ‹ƒ^‚Ƃ͈قȂèAƒI[ƒo[ƒTƒ“ƒvƒŠƒ“ƒO‚µ‚Ä‚¢‚Ü‚¹‚ñ‚Ì‚ÅA‚»‚±‚»‚±‚ÌŽŸ”‚ðݒ肵‚È‚¢‚Æ‹}s‚È“Á«‚Í“¾‚ç‚ê‚Ü‚¹‚ñiƒfƒtƒHƒ‹ƒg‚Í­‚µŠÃ–Ú‚Å‚·jB + + u“Á«Šm”Fvƒ{ƒ^ƒ“‚ð‰Ÿ‚·‚ƃtƒBƒ‹ƒ^‚Ì“Á«‚ªŠm”F‚Å‚«‚Ü‚·B“K‰žƒtƒBƒ‹ƒ^iLMSj‚Ìꇂ͓ü—ÍM†‚ɑ΂µ‚ÄAƒtƒBƒ‹ƒ^‚ÌŽü”g”“Á«‚ª•ω»‚µ‚Ä‚¢‚­—lŽq‚àŠÏŽ@‚·‚鎖‚ª‚Å‚«‚Ü‚·B + +---- + ’Pƒ‚ÈFIRŒ^‚ÌBPF‚Å‚·BÝ’è‰æ–Ê‚ÌFW‚Ì’l‚ÆBPF‚̃JƒbƒgƒIƒtŽü”g”‚ÌŠÖŒW‚͈ȉº‚̂悤‚ɂȂè‚Ü‚·B + + ’áˆæƒJƒbƒgƒIƒt ƒ}[ƒNŽü”g” | FW + ‚ˆæƒJƒbƒgƒIƒt ƒXƒy[ƒXŽü”g” { FW + + ŽŸ”iTapj‚𬂳‚­‚µ‚Ä‚¢‚éê‡AFW‚ͬ‚³‚­‚Ä‚à\‚¢‚Ü‚¹‚ñ‚ªAŽŸ”‚ð‘å‚«‚­‚·‚邯ƒJƒbƒgƒIƒtŽü”g”•t‹ß‚ł̓Á«‚ª‹}s‚ɂȂè‚Ü‚·‚Ì‚ÅA‚»‚ê‚ÉŒ©‡‚Á‚½ƒ}[ƒWƒ“‚ð‚Æ‚Á‚Ä‚¨‚­•K—v‚ª‚ ‚è‚Ü‚·B + +---- + ’Pƒ‚ÈFIRŒ^‚ÌBEF‚Å‚·BÝ’è‰æ–Ê‚ÌLMSƒy[ƒW‚ÅuNotchv‚̃`ƒFƒbƒN‚ð•t‚¯‚邯ALMS‚Ì‘ã‚í‚è‚É‚±‚̃tƒBƒ‹ƒ^‚ÉØ‚è‘Ö‚í‚è‚Ü‚·B‚±‚̃tƒBƒ‹ƒ^‚Í“Á’è‚ÌŽü”g”‚ðŒ¸Š‚³‚¹‚Ü‚·‚Ì‚ÅA󋵂ɂæ‚èQRM‚ÉŒø‰Ê‚ð”­Šö‚·‚éꇂª‚ ‚è‚Ü‚·B + WaterFall‚Ü‚½‚ÍFFTƒXƒyƒNƒgƒ‰ƒ€•\ަ‚Ń}ƒEƒX‚̉Eƒ{ƒ^ƒ“‚ŃNƒŠƒbƒN‚·‚邯‚»‚ÌŽü”g”‚Ƀmƒbƒ`Žü”g”‚ðŒÅ’肳‚¹‚邱‚Æ‚ª‚Å‚«‚Ü‚·Bƒ}[ƒN‚ƃXƒy[ƒX‚ÌŠÔ‚ðƒNƒŠƒbƒN‚·‚邯AFC‚ƘA“®‚µ‚Äí‚É’†S‚Ɉʒu‚·‚邿‚¤‚ɂȂè‚Ü‚·B + ‚±‚̃tƒBƒ‹ƒ^‚ÍŽŸ”‚ª¬‚³‚¢‚ÆA–Ú“IM†‚àŒ¸Š‚³‚¹‚Ä‚µ‚Ü‚¢‚Ü‚·‚Ì‚ÅA‚»‚±‚»‚±‚ÌŽŸ”‚ðÝ’è‚·‚é•K—v‚ª‚ ‚é‚©‚à’m‚ê‚Ü‚¹‚ñB + +---- + Leaky LMSiLeast Mean Squarej–@‚É‚æ‚é“K‰žƒtƒBƒ‹ƒ^‚Å‚·BÝ’è‰æ–Ê‚ÌLMSƒy[ƒW‚ÅuNotchv‚̃`ƒFƒbƒN‚ðŠO‚·‚ÆANotch‚Ì‘ã‚í‚è‚ÉLMS‚ÉØ‚è‘Ö‚í‚è‚Ü‚·B + +@‚±‚̃tƒBƒ‹ƒ^‚̓fƒtƒHƒ‹ƒg‚̃pƒ‰ƒ[ƒ^‚ł͋tŒø‰Ê‚ɂȂèŽg—p‚µ‚È‚¢‚Ù‚¤‚ª—Ç‚¢‚悤‚Å‚·BHi@@ÚׂÍuDigital.txtv‚ðŽQÆ‚µ‚ĉº‚³‚¢B + + +›‚`‚s‚b‚ɂ‚¢‚Ä +~~~~~~~~~~~~~~~~ + ‚Ù‚Æ‚ñ‚Ç‚ÌM†‚ÍAƒŠƒ~ƒbƒ^[ƒAƒ“ƒv‚É‚æ‚è“K؂ȃŒƒxƒ‹‚É’²®‚³‚ê‚Ü‚·‚ªAŽóMM†‚ÌŽ¿‚ɂɂæ‚Á‚Ă͔äŠrŠí‚É—^‚¦‚éM†‚ª“K؂ȃŒƒxƒ‹‚ɂȂç‚È‚¢ê‡‚ª‚ ‚è‚Ü‚·B“Á‚ɃGƒR[‚𔺂Á‚½M†‚Í‚±‚ÌŒXŒü‚ªŒ°’˜‚ÅA‚±‚ê‚ð‰ü‘P‚·‚邽‚ß‚ÉATCiAutomatic Threshold Controlj‚ð•t‰Á‚µ‚Ă݂܂µ‚½B + +@ƒIƒvƒVƒ‡ƒ“ƒƒjƒ…[‚ÌÝ’è‰æ–Ê‚ÅATC‚̃pƒ‰ƒ[ƒ^uTimev‚ðÝ’è‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B‚±‚ê‚Í‰ß‹Ž‚ÌM†‚ðŽQÆ‚·‚éŠúŠÔ‚ðˆÓ–¡‚µA‚±‚Ì’l‚ð‘å‚«‚­‚·‚邯AƒXƒŒƒbƒVƒ…ƒz[ƒ‹ƒhƒŒƒxƒ‹’²®‚̉ž“š‚ª’x‚­‚È‚èA¬‚³‚­‚·‚邯‘¬‚­‚È‚è‚Ü‚·B + + ƒfƒtƒHƒ‹ƒg‚ÌÝ’è‚ł̓GƒR[‚ɑ΂µ‚ÄŒø‰Ê‚𓾂邽‚߂ɉž“š‚𑂭ݒ肵‚Ä‚ ‚è‚Ü‚·B]‚Á‚ÄŽóMM†‚ÌŽ¿‚É‚æ‚Á‚Ă͋tŒø‰Ê‚ɂȂéꇂª‚èAƒGƒR[‚ª‚È‚¢ê‡‚ÍATC‚ðOFF‚É‚µ‚Ä‚¨‚¢‚½•û‚ª—Ç‚¢ê‡‚ª‘½‚¢‚ÆŽv‚¢‚Ü‚·B + + +›‘—M‚ÌÝ’è +~~~~~~~~~~~~ + ‘—M‚ɉe‹¿‚·‚éƒpƒ‰ƒ[ƒ^‚ªƒIƒvƒVƒ‡ƒ“ƒƒjƒ…[‚ÌÝ’è‰æ–Ê‚Ìu‘—Mv‚̂Ƃ±‚ë‚É‚ ‚è‚Ü‚·B + +DIDDLE –³‘ÅŒ®Žž‚Ì‘—oƒR[ƒhB +TX UOS ŽóM‘¤‚ÌUOS‚ɑΉž‚µ‚½•ÛŒ¯‘—M‚ðs‚¤B +ƒ_ƒuƒ‹ƒVƒtƒg ƒVƒtƒgƒR[ƒh‚ð2‰ñ‘—M‚·‚éB +TX BPF ‘—MM†‚ÍBPFiFIRŒ^j‚ð’ʉ߂³‚¹‚éiIMD‰ü‘P—pjB +TX LPF ƒfƒWƒ^ƒ‹VCO“ü—Í‚ÍLPF‚ð’ʉ߂³‚¹‚éiIMD‰ü‘P—pjB +PTT PTT§Œäƒ|[ƒg‚Ì‘I‘ð‚Æ˜_—‚ð‘I‘ð‚µ‚Ü‚·B + +*PTT§Œä‚ÍCOM‰ñü‚ÌRTS‚Ü‚½‚ÍDTRi‚Ç‚¿‚ç‚Å‚à—Ç‚¢j‚ðŽg—p‚µ‚Ü‚·B‚±‚ê‚ÍSSTV‚âPSK31‚ȂǂŎg‚í‚ê‚Ä‚¢‚é‚̂Ɠ¯‚¶•û–@‚Å‚·‚Ì‚ÅA“¯‚¶ƒP[ƒuƒ‹‚ª‚»‚̂܂܎g—p‚Å‚«‚邯Žv‚¢‚Ü‚·B + + MMTTY‚̃TƒEƒ“ƒh‘—M‚͈ȉº‚̂悤‚ÈŒn“‚Åo—Í‚³‚ê‚Ü‚·B + + Coder ---> TX LPF ---> Digital VCO ---> TX BPF ---> Sound out + (ON/OFF) (ON/OFF) + + +*TX BPF‚ðON‚É‚·‚邯‘—MƒfƒWƒ^ƒ‹M†‚̑ш悪§ŒÀ‚³‚ê‚Ü‚·B‚½‚¾‚µƒTƒEƒ“ƒhƒJ[ƒhƒAƒiƒƒO•”‚âRig‘¤‚Ì“Á«‚É‚æ‚èAŠ®‘S‚ɂ͊ú‘Ò’Ê‚è‚ÌŒ‹‰Ê‚ɂȂç‚È‚¢ê‡‚à‚ ‚è‚Ü‚·B‚Ü‚½‚±‚̃tƒBƒ‹ƒ^‚̓I[ƒo[ƒTƒ“ƒvƒŠƒ“ƒO‚µ‚Ä‚¢‚È‚¢‚½‚߂ɂ»‚±‚»‚±‚ÌŽŸ”‚ðݒ肵‚È‚¢‚Æ“Á«‚͊­‚È‚è‚Ü‚·B + +*TX LPF‚ðON‚É‚·‚邯Žü”g”‚ªŠŠ‚ç‚©‚ɕΈڂµ‚Ü‚·BƒXƒyƒNƒgƒ‰ƒ€‚ÌW’†Œø‰Ê‚ÍuTX BPFv‚Æ“¯—l‚ÉŠú‘Ò‚Å‚«‚邯Žv‚¢‚Ü‚·B + +*ƒfƒWƒ^ƒ‹o—̓Œƒxƒ‹‚ÍMMTTY‚ªì¬‚·‚éƒTƒEƒ“ƒhM†iVCOo—Íj‚̑傫‚³‚Å‚·BƒXƒ‰ƒCƒh‚ðˆê”Ô‰E‚É‚·‚邯16bitƒtƒ‹ƒXƒCƒ“ƒO‚æ‚è‚à­‚µ‚¾‚¯¬‚³‚È’l‚Åo—Í‚µ‚Ü‚·BƒfƒtƒHƒ‹ƒg‚ł̓TƒEƒ“ƒhƒJ[ƒhƒAƒiƒƒO•”‚ł̘c‚Ý‚ª‹C‚ɂȂÁ‚½‚̂ŭ‚µ¬‚³–Ú‚Éݒ肵‚Ä‚ ‚è‚Ü‚·‚ªA‚ ‚܂謂³‚­‚µ‰ß‚¬‚邯M†‚ÌS/N‚ªˆ«‰»‚µ‚Ü‚·B + +*DisableWait‚ðON‚É‚·‚邯ADiddleWait‚Í–³Œø‚ɂȂèA•¶ŽšƒEƒGƒCƒg’†‚ÉDiddle‚ªo—Í‚³‚ê‚邿‚¤‚ɂȂè‚Ü‚·B + + +›ƒVƒ‡[ƒgƒJƒbƒgƒL[‚̃JƒXƒ^ƒ}ƒCƒY +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + MMTTY‚̓ƒCƒ“‰æ–Êã‚̂قڂ·‚ׂẴVƒ‡[ƒgƒJƒbƒgƒL[‚ɂ‚¢‚ăJƒXƒ^ƒ}ƒCƒY‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B•’i‚¨Žg‚¢‚ÌA‘¼‚Ì’ÊMƒ\ƒtƒg‚ƃVƒ‡[ƒgƒJƒbƒgƒL[‚ð‡‚킹‚Ä‚¨‚­‚ƕ֗˜‚©‚à’m‚ê‚Ü‚¹‚ñB +@ƒL[‚ðƒJƒXƒ^ƒ}ƒCƒY‚·‚é‚É‚ÍA•ÒWƒƒjƒ…[‚ÌuƒVƒ‡[ƒgƒJƒbƒgƒL[‚Ì’è‹`v‚ð‘I‘ð‚µ‚Ü‚·B + +@‚±‚̉æ–ʂŌ»Ý“o˜^‚³‚ê‚Ä‚¢‚éƒVƒ‡[ƒgƒJƒbƒgƒL[‚̈ꗗ•\‚ª•\ަ‚³‚ê‚Ü‚·‚Ì‚ÅAˆê——•\“à‚Ì‹@”\‚ð‘I‘ð‚µ‚Ä‚©‚çA‰º‚̃hƒƒbƒvƒŠƒXƒg‚ŃL[‚ðŠ„‚è“–‚Ă܂·B +@ƒVƒ‡[ƒgƒJƒbƒgƒL[‚ªd•¡‚³‚ê‚ÄŠ„‚è“–‚Ă炽ê‡Aˆê——•\‚ɂ͂»‚̃L[‚ðÔF‚Å•\ަ‚µ‚Ü‚·B‚Ü‚½ud•¡ƒ`ƒFƒbƒNvƒ{ƒ^ƒ“‚ð‰Ÿ‚µ‚Äd•¡‚µ‚Ä‚¢‚È‚¢‚©‚Ç‚¤‚©‚𒲸‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B + +@d•¡‚µ‚ăL[‚ªŠ„‚è“–‚Ä‚ç‚ꂽê‡Aˆê——•\‚Ìã‚É‚ ‚é‹@”\‚̂ق¤‚ªŠT‚Ë—D悳‚ê‚ÄŽÀs‚³‚ê‚Ü‚·‚ªA•K‚¸‚µ‚à‡”Ô’Ê‚è‚ɂ͂Ȃç‚È‚¢ê‡‚à‚ ‚è‚Ü‚·B + + +›ƒVƒtƒg•‚Ì•ÏX‘€ì +~~~~~~~~~~~~~~~~~~~~ +@ƒƒCƒ“‰æ–Ê‚ÌShift‚̃hƒƒbƒvƒŠƒXƒg‚ð‘I‘ð‚µ‚Ä‚àOK‚Å‚·‚ªAˆÈ‰º‚̃L[‘€ì‚É‚æ‚Á‚Ä‚àƒVƒtƒg•‚ð•ÏX‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B +@ƒfƒtƒHƒ‹ƒg‚ł͈ȉº‚̃L[‚ªŠ„‚è“–‚Ä‚ç‚ê‚Ä‚¢‚Ü‚·B + + ƒVƒtƒg•‚ðL‚°‚é Alt+¨ + ƒVƒtƒg•‚ð‹·‚ß‚é Alt+© + ƒVƒtƒg•‚ðƒgƒOƒ‹‚·‚é Alt+T + +@ƒVƒtƒg•‚̃gƒOƒ‹‚Í170Hz‚Æ200Hz‚őւí‚èƒxƒ“ƒ^ƒ“‚É“ü‚ê‘Ö‚í‚èA‚±‚Ì‘€ì‚̓ƒCƒ“‰æ–Ê‚Ì'Shift'‚Ì•¶Žš‚ðƒ}ƒEƒX‚ŃNƒŠƒbƒN‚µ‚Ä‘€ì‚·‚邱‚Æ‚à‚Å‚«‚Ü‚·B + + ‚Ü‚½ƒIƒvƒVƒ‡ƒ“ƒƒjƒ…[‚ÌÝ’è‰æ–Ê‚ÌAFCƒy[ƒW‚ŃVƒtƒg•ÏXƒAƒ‹ƒSƒŠƒYƒ€‚ÉuHAMv‚ð‘I‘ð‚µ‚Ä‚¢‚éê‡AuAFCv‚ðON‚É‚·‚邯ŽóMM†‚É‚æ‚èƒVƒtƒg•‚Í170/200/220/240Hz‚Ì‚¢‚¸‚ê‚©‚ÉŽ©“®“I‚ÉŽû‘©‚³‚ê‚Ü‚·B + +@FSKƒ‚[ƒh‚ʼn^—p‚µ‚Ä‚¢‚éê‡AAFC‚ÌShiftƒAƒ‹ƒSƒŠƒYƒ€‚ÍuFSKv‚ð‘I‘ð‚³‚ê‚邱‚Æ‚ð‚¨Š©‚ß‚µ‚Ü‚·B‚±‚Ìê‡AMMTTY‚ÍAFC‚ÌON/OFF‚ÉŠÖŒW‚È‚­’†SŽü”g”‚ð•ÏX‚¹‚¸‚ɃVƒtƒg•‚ð•ÏX‚·‚邿‚¤‚ɂȂè‚Ü‚·iƒ}[ƒNŽü”g”‚àŽ©“®’²®‚·‚éjB +@‚Ü‚½‚±‚Ìó‘Ô‚ÅAFC‚ðON‚É‚µ‚½ê‡AŽóMM†‚É‚æ‚èAƒVƒtƒg•‚ð170/200/220/240Hz‚Ì‚¢‚¸‚ê‚©‚ÉŽ©“®“I‚ÉŽû‘©‚³‚¹‚Ü‚·‚ªA’†SŽü”g”‚Íí‚É“¯‚¶Žü”g”‚ðˆÛŽ‚µ‚½‚܂܂ł·B + + +›ƒvƒƒtƒ@ƒCƒ‹‚ɂ‚¢‚Ä +~~~~~~~~~~~~~~~~~~~~~~ +@MMTTY‚̓fƒ‚ƒWƒ…ƒŒ[ƒ^Eƒ‚ƒWƒ…ƒŒ[ƒ^EƒfƒR[ƒ_EƒGƒ“ƒR[ƒ_‚É‘½‚­‚̃pƒ‰ƒ[ƒ^‚ðŽ‚¿‚Ü‚·B—Ⴆ‚΃fƒtƒHƒ‹ƒg‚̃fƒ‚ƒWƒ…ƒŒ[ƒ^ƒpƒ‰ƒ[ƒ^‚Í•½‹Ï“I‚ÈM†‚ł̖³“ï‚È’l‚ª‘I‘ð‚³‚ê‚Ä‚¢‚é‚ɉ߂¬‚Ü‚¹‚ñB‚à‚¤Šù‚É‚ ‚È‚½‚ÍŽóM‚·‚éM†‚ÌŽ¿i—Ⴆ‚΃}ƒ‹ƒ`ƒpƒX‚âƒ|[ƒ‰[ƒtƒ‰ƒbƒ^“™j‚É‚æ‚Á‚ÄA‚±‚ê‚çƒpƒ‰ƒ[ƒ^‚ð“K“–‚É•ÏX‚µ‚ÄŽg‚Á‚Ä‚¢‚é‚Í‚¸‚Å‚·B‚Ü‚½•W€‚Ƃ͈قȂéƒVƒtƒgAƒ{[ƒŒ[ƒg‚Ȃǂð•p”ɂɨ‚è‘Ö‚¦‚ÄŽg‚¢‚½‚¢‚©‚à’m‚ê‚Ü‚¹‚ñB + +@ƒvƒƒtƒ@ƒCƒ‹ƒƒjƒ…[‚ðŽg‚¤‚ÆA‚WŒÂ‚̈قȂ郃jƒ…[ƒXƒƒbƒg‚ÉA‚ ‚È‚½‚ª—Ç‚­Žg‚¤ƒpƒ‰ƒ[ƒ^‚ðˆêЇ‚µ‚Ä–¼‘O‚ð•t‚¯‚Ä“o˜^‚Å‚«A‚Ü‚½‚»‚ê‚ðD‚«‚ȂƂ«‚ɌĂÑo‚·‚±‚Æ‚ª‚Å‚«‚Ü‚·B‚Ü‚½”CˆÓ‚̃tƒ@ƒCƒ‹–¼‚ðŽw’肵‚ăpƒ‰ƒ[ƒ^‚̃tƒ@ƒCƒ‹‚ւ̃Z[ƒu‚ƃ[ƒh‚à‚Å‚«‚Ü‚·B + +@ƒvƒƒtƒ@ƒCƒ‹‹@”\‚ðŽg‚¤ê‡AÅ‚àd—v‚È“_‚ÍA‚Ü‚¸Œ»ó‚Ì‚ ‚È‚½‚ª‹C‚É“ü‚Á‚Ä‚¢‚é•W€‚̃pƒ‰ƒ[ƒ^‚ðuMyDefaultv‚̂悤‚È–¼‘O‚Å“o˜^‚µ‚Ä‚¨‚­‚±‚Ƃł·B‚±‚¤‚µ‚Ä‚¨‚¯‚ÎAƒpƒ‰ƒ[ƒ^‚Ì‘g‚݇‚킹‚ª”»‚ç‚È‚­‚È‚Á‚½ê‡‚Å‚àA‚»‚Ìó‘Ô‚É•œ‹A‚³‚¹‚邱‚Æ‚ª‚Å‚«‚Ü‚·B + +@‚Ü‚½MMTTY‚Í•ÏXi“o˜^j‚Å‚«‚È‚¢ŽŸ‚Ì‚Q‚‚̃vƒƒtƒ@ƒCƒ‹‚ðŽ‚¿‚Ü‚·BuMMTTY Defaultv‚ÍA‚ ‚È‚½‚ªˆê”Ôʼn‚ÉMMTTY‚ðƒCƒ“ƒXƒg[ƒ‹‚µ‚½Žž‚ÌMMTTY‚̃fƒtƒHƒ‹ƒg‚̃pƒ‰ƒ[ƒ^‚É–ß‚µ‚Ü‚·BuRerurn to the startupv‚Í¡‰ñMMTTY‚ð‹N“®‚µ‚½Žži‘O‰ñMMTTY‚ðI—¹‚µ‚½Žžj‚̃pƒ‰ƒ[ƒ^‚É–ß‚µ‚Ü‚·B + +*ƒvƒƒtƒ@ƒCƒ‹‚Å‹L‰¯‚Å‚«‚éƒpƒ‰ƒ[ƒ^‚̓fƒ‚ƒWƒ…ƒŒ[ƒ^Eƒ‚ƒWƒ…ƒŒ[ƒ^EƒfƒR[ƒ_EƒGƒ“ƒR[ƒ_‚Ì•”•ª‚ÉŒÀ‚ç‚ê‚Ü‚·B—Ⴆ‚ÎPTT‚âFSKÝ’è‚Ȃǂ͋L‰¯‚³‚ê‚Ü‚¹‚ñB +*ƒvƒƒtƒ@ƒCƒ‹‚ÍuUserPara.inivƒtƒ@ƒCƒ‹‚É‹L‰¯‚³‚ê‚Ü‚·B + + +›‘¼‚̃vƒƒOƒ‰ƒ€‚ÌŽÀs +~~~~~~~~~~~~~~~~~~~~~~ +@‘¼‚̃TƒEƒ“ƒhƒJ[ƒh‚âComƒ|[ƒg‚ð—˜—pƒvƒƒOƒ‰ƒ€‚ðˆêŽž“I‚É“®ì‚³‚¹‚邽‚ß‚ÉAƒvƒƒOƒ‰ƒ€ƒƒjƒ…[‚ðŽg‚Á‚ÄMMTTY‚ðƒTƒXƒyƒ“ƒhó‘Ô‚É‚·‚鎖‚ª‚Å‚«‚Ü‚·B + +@ƒvƒƒOƒ‰ƒ€ƒƒjƒ…[‚Ìã‚©‚ç‚S‚‚̃ƒjƒ…[‚ÉAPSK31‚âHellschreiber‚Ȃǂ̕’i‚¨Žg‚¢‚̃vƒƒOƒ‰ƒ€‚ð“o˜^‚µ‚Ä‚¨‚­‚Æ—Ç‚¢‚Å‚µ‚傤B + +*ƒfƒtƒHƒ‹ƒg‚Å‚Íã‚©‚ç‚Q‚‚̃ƒjƒ…[‚ÉuG3PLX PSK31SBWv‚ÆuIZ8BLY Hellschreiberv‚Ì–¼‘O‚¾‚¯‚ª’è‹`‚³‚ê‚Ä‚¢‚Ü‚·B‚±‚̃ƒjƒ…[‚ðŽÀÛ‚É“®ì‚³‚¹‚é‚É‚ÍAƒvƒƒOƒ‰ƒ€ƒƒjƒ…[‚Ìu“o˜^v‚ð‘I‘ð‚µAŽÀs‚³‚¹‚éƒvƒƒOƒ‰ƒ€(EXEƒtƒ@ƒCƒ‹)‚ð‘I‘ð‚µ‚Ä‚¨‚­•K—v‚ª‚ ‚è‚Ü‚·B + +@‚±‚ê‚ç‚̃ƒjƒ…[‚ð‘I‘ð‚·‚é‚ÆAMMTTY‚ÍCom‰ñü‚ƃTƒEƒ“ƒhƒJ[ƒh‚ÌƒŠƒ\[ƒX‚ð•úŠü‚µŽ©g‚ðŬ‰»ó‘Ô‚É‚µ‚½ŒãA“o˜^‚³‚ê‚Ä‚¢‚éƒvƒƒOƒ‰ƒ€‚ðŽÀs‚µ‚Ü‚·B +@MMTTY‚𕜋A‚³‚¹‚é‚É‚ÍA‚»‚̃vƒƒOƒ‰ƒ€‚ðI—¹‚µ‚½ŒãAWindowsƒ^ƒXƒNƒo[‚ÌuMmttyvƒAƒCƒRƒ“‚ðƒNƒŠƒbƒN‚µ‚ÄŬ‰»‚ð‰ðœ‚µ‚Ü‚·B + +@ƒƒjƒ…[‚É“o˜^‚µ‚Ä‚¢‚È‚¢ƒvƒƒOƒ‰ƒ€‚ðŽÀs‚³‚¹‚½‚¢ê‡‚ÍuƒTƒXƒyƒ“ƒhv‚ð‘I‘ð‚·‚é‚Æ—Ç‚¢‚Å‚µ‚傤BMMTTY‚ÍCom‰ñü‚ƃTƒEƒ“ƒhƒJ[ƒh‚ÌƒŠƒ\[ƒX‚ð•úŠü‚µAŽ©g‚ðŬ‰»ó‘Ô‚É‚µ‚Ü‚·B + +@‘¼‚̃TƒEƒ“ƒhƒJ[ƒh‚âCom‰ñü‚ð—˜—p‚·‚éƒvƒƒOƒ‰ƒ€‚ª“®ì’†‚ÉAMMTTY‚ÌŬ‰»‚ð‰ðœ‚·‚邯AMMTTY‚ŃTƒEƒ“ƒhƒJ[ƒh‚¨‚æ‚ÑCom‰ñü‚̃I[ƒvƒ“ƒGƒ‰[ƒƒbƒZ[ƒW‚ª•\ަ‚³‚ê‚Ü‚·B +@‚±‚Ìê‡AMMTTY‚ÍŽ©“®‚ÅŽ©g‚ðÄ“xŬ‰»‚µ‚Ü‚¹‚ñBMMTTY‚𕜋A‚³‚¹‚é‚É‚ÍA‘¼‚̃vƒƒOƒ‰ƒ€‚ðI—¹‚µ‚½ŒãAMMTTY‚ðŽè“®‚ňê’UŬ‰»‚³‚¹‚é‚©A‚Ü‚½‚̓vƒƒOƒ‰ƒ€ƒƒjƒ…[“à‚ÌuƒTƒXƒyƒ“ƒh‚̉ðœv‚ð‘I‘ð‚·‚é‚Æ—Ç‚¢‚Å‚µ‚傤B + + +›TNC–Í‹[ƒ‚[ƒh +~~~~~~~~~~~~~~ + MMTTY‚ÍTNC‚Ì–Í‹[ƒ‚[ƒh‚ðŽ‚¿‚Ü‚·BƒIƒvƒVƒ‡ƒ“ƒƒjƒ…[‚ÌuTNC‹[Ž—ƒ‚[ƒhv‚ð‘I‘ð‚·‚é‚ÆComƒ|[ƒg‚̃pƒ‰ƒ[ƒ^‚ðÝ’è‚·‚郃jƒ…[‚ª•\ަ‚³‚ê‚Ü‚·‚Ì‚ÅA‚±‚±‚ÅComƒ|[ƒg‚ð—LŒø‚ȃ|[ƒg–¼‚ÉÝ’è‚·‚邯‚±‚Ì‹@”\‚ªƒAƒNƒeƒBƒu‚ɂȂè‚Ü‚·B + + ‚±‚Ì‹@”\‚ðŽg‚¤‚Æ‘¼‚̃pƒ\ƒRƒ“ã‚Å“®ì‚·‚éTNC—p‚Ƀ`ƒ…[ƒjƒ“ƒO‚³‚ꂽƒ^[ƒ~ƒiƒ‹ƒvƒƒOƒ‰ƒ€‚Ü‚½‚̓ƒMƒ“ƒOƒvƒƒOƒ‰ƒ€‚ð—˜—p‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B‚±‚Ìó‘Ô‚Å‚ÍMMTTY‚ÍTNC‚Ƃ܂Á‚½‚­“¯‚¶‚ɂȂè‚Ü‚·B + + ƒpƒ\ƒRƒ“ŠÔ‚ÌÚ‘±‚͗Ⴆ‚Έȉº‚̂悤‚É‚µ‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñB + + PC1(‘¼‚Ì’ÊMƒ\ƒtƒg) PC2(MMTTY) + Com1 -------------- Com1 + ƒNƒƒXƒP[ƒuƒ‹ Com2 ----- Rig PTT and FSK + +@iCom1‚âCom2‚̉ñü”Ô†‚Í”CˆÓ‚Å‚·j + + d—v‚Ȃ̂ÍPC“¯Žm‚ÌÚ‘±‚ɂ͕K‚¸ƒNƒƒXƒP[ƒuƒ‹‚ðŽg—p‚µ‚È‚¯‚ê‚΂Ȃç‚È‚¢“_‚Å‚·BƒXƒgƒŒ[ƒgƒP[ƒuƒ‹‚ðŽg‚¤ê‡‚̓NƒƒX•ÏŠ·ƒAƒ_ƒvƒ^‚ð—˜—p‚³‚ê‚邯—Ç‚¢‚Å‚µ‚傤B + +@–Í‹[‚·‚éTNC‚ÌŽí—Þ‚Æ‚µ‚ÄTNC241iTNC231j‚ÆKAM‚ª‚ ‚è‚Ü‚·B‚¨Žg‚¢‚̃\ƒtƒgƒEƒGƒA‚ªƒTƒ|[ƒg‚µ‚Ä‚¢‚éTNC‚Æ“¯‚¶Ží—Þ‚ð‘I‘ð‚³‚ê‚邯—Ç‚¢‚Å‚µ‚傤B‚à‚¿‚ë‚ñƒ{[ƒŒ[ƒg‚Ȃǂ̉ñüƒpƒ‰ƒ[ƒ^‚Í‘ŠŒÝ‚Å“¯‚¶‚É‚µ‚Ä‚¨‚©‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñB + + +›Radio Command +~~~~~~~~~~~~~~~ +@MMTTY‚ÍDTR/RTS§Œä‚É‚æ‚éPTTˆÈŠO‚ÉARadio Command‚É‚æ‚èPTT‚ðØ‚è‘Ö‚¦‚邱‚Æ‚ª‚Å‚«‚Ü‚·B‚¨Žg‚¢‚ÌRig‚É‚æ‚肱‚̃Rƒ}ƒ“ƒh‚͈قȂè‚Ü‚·‚ªA‘—o‚·‚éƒRƒ}ƒ“ƒh‚ƃfƒBƒŒƒC‚ðŽ©—R‚É’è‹`‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·‚Ì‚ÅARadio Command‚ªŽg—p‚Å‚«‚é‚Ù‚Ú‘S‚Ä‚ÌRig‚Å—˜—p‚·‚邱‚Æ‚ª‚Å‚«‚邯Žv‚¢‚Ü‚·B + +@Radio Command‚ÅŽg—p‚·‚éƒ|[ƒg‚ÍA’Êí‚ÌDTR/RTS§Œä‚ÌPTTƒ|[ƒg‚Ƃ͂܂Á‚½‚­“Æ—§‚µ‚Ä‘¶Ý‚µ‚Ü‚·B]‚Á‚ÄFSK‰^—p‚Æ•À—§‚³‚¹‚邱‚Æ‚à‰Â”\‚Å‚·B + + RadioCommand‚ðŽg‚¤ê‡AƒIƒvƒVƒ‡ƒ“ƒƒjƒ…[‚ÌÝ’è‰æ–Ê‚ðŠJ‚«A‘—MÝ’è‚ÅuRadio commandvƒ{ƒ^ƒ“‚ð‰Ÿ‚µ‚Ü‚·B‚±‚̉æ–ʂŃ|[ƒg–¼‚ðÝ’è‚·‚邯A‚»‚̃|[ƒg‚ªRadio Commandƒ|[ƒg‚Æ‚µ‚Ä“­‚­‚悤‚ɂȂè‚Ü‚·B + +@’è‹`‚Å‚«‚éƒCƒxƒ“ƒg‚͈ȉº‚Ì’Ê‚è‚Å‚·B + Init ‰ñü‚ð‰Šú‰»‚µ‚½’¼Œã‚É‘—M‚³‚ê‚Ü‚·B + Rx ŽóM‚ÉØ‚è‘Ö‚¦‚鎞‚É‘—M‚³‚ê‚Ü‚·B + Tx ‘—M‚ÉØ‚è‘Ö‚¦‚鎞‚É‘—M‚³‚ê‚Ü‚·B + +@‚±‚ê‚ç‚̃Cƒxƒ“ƒg‚É‚ÍAƒfƒtƒHƒ‹ƒg‚ÅYAESU‚ÌFT-1000MP‚̃Rƒ}ƒ“ƒh‚ª’è‹`‚µ‚Ä‚ ‚è‚Ü‚·‚ªAˆÈ‰º‚̃L[ƒ[ƒh‚ðŽg‚Á‚ăRƒ}ƒ“ƒh‚ðŽ©—R‚É•ÏX‚Å‚«‚Ü‚·B + + \$##... ##=00-FF, ‘—M‚·‚é•¡”ƒoƒCƒg‚ð16i”‚Å’è‹`‚·‚é + (—á:\$FE55AA -> FEh,55h,AAh) + \x## ##=00-FF, ‘—M‚·‚é‚PƒoƒCƒg‚ð16i”‚Å’è‹`‚·‚é + (—á:\xFE\x55\xAA -> FEh, 55h, AAh) + \w## ##=00-99, ƒfƒBƒŒƒCŽžŠÔ‚ð10ms’PˆÊ‚Ì10i”‚Å’è‹`‚·‚é + (—á:\w05 -> wait 50ms) + \r ƒLƒƒƒŠƒbƒWƒŠƒ^[ƒ“‚ð‘—M‚·‚é + \n ƒ‰ƒCƒ“ƒtƒB[ƒh‚ð‘—M‚·‚é + \c.... ˆÈ~‚Í‚·‚ׂăRƒƒ“ƒg + \\ '\'•¶Žš‚ð‘—M‚·‚é + ‚»‚Ì‘¼ ‚»‚Ì•¶Žš—ñ‚ð‘—M‚·‚é + + 16i”‚Ì‘ã‚í‚è‚Éxx‚ð‹Lq‚·‚邯A‚»‚Ì•”•ª‚Íxx“ü—̓{ƒbƒNƒX‚Å’è‹`‚µ‚½16i”‚É’u‚«Š·‚í‚è‚Ü‚·B‚±‚̕ϊ·‚ÍICOM‚Ì‹@ŽíƒAƒhƒŒƒX‚ðŽw’è‚·‚éꇂɕ֗˜‚©‚à’m‚ê‚Ü‚¹‚ñB + \$FEFExxE01C0001FD ixx‚Ì•”•ª‚ª’è‹`“à—e‚É’u‚«Š·‚í‚éj + +@“Á’è‚̃Cƒxƒ“ƒg‚ŃRƒ}ƒ“ƒh‚ð‘—o‚µ‚½‚­‚È‚¢ê‡A‚»‚±‚ɂ͉½‚àƒRƒ}ƒ“ƒh‚ð’è‹`‚µ‚È‚¢‚ʼnº‚³‚¢B + ŠeƒCƒxƒ“ƒg‚Ì’è‹`ƒRƒ}ƒ“ƒh‚ÍuSavevƒ{ƒ^ƒ“‚ð‰Ÿ‚µ‚ătƒ@ƒCƒ‹‚ɕۑ¶‚Å‚«‚Ü‚·B‚Ü‚½uLoadvƒ{ƒ^ƒ“‚ð‰Ÿ‚µ‚ĕۑ¶‚µ‚½ƒtƒ@ƒCƒ‹‚©‚ç“ǂݞ‚Þ‚±‚Æ‚ª‚Å‚«‚Ü‚·B + +* AFSK‚ÅPTT§Œä‚ÉRadioCommand‚ðŽg‚¤ê‡A’Êí‚ÌPTTƒ|[ƒgiDTR/RTS§Œäƒ|[ƒgj‚É‚ÍNONE‚ðŽw’肵‚ĉº‚³‚¢i’Êí‚ÌPTTƒ|[ƒg‚ÍŽg—p‚·‚é•K—v‚ª‚ ‚è‚Ü‚¹‚ñjB + +* FSK‚ÅPTT§Œä‚ÉRadioCommand‚ðŽg‚¤ê‡A’Êí‚ÌPTTƒ|[ƒg‚ÌTxd‚ÉFSKƒf[ƒ^‚ªo—Í‚³‚ê‚Ü‚·B‚µ‚½‚ª‚Á‚Ä‚±‚Ìê‡AFSK‚ÆRadioCommand‚Å‚Q‰ñü‚ª•K—v‚ɂȂè‚Ü‚·B + +* ƒfƒBƒŒƒCŽžŠÔ‚ÍTx’è‹`‚̈ê”ÔÅŒã‚É’è‹`‚µ‚Ü‚·BƒfƒtƒHƒ‹ƒg‚Å‚Í\w10(100ms)‚ɂȂÁ‚Ä‚¢‚Ü‚·BMMTTY‚Í‚±‚̃fƒBƒŒƒCˆÈŠO‚É‚àAí‚É‘—MØ‚è‘Ö‚¦Žž‚ɋ͂©‚ȃfƒBƒŒƒCŽžŠÔ‚ðŠm•Û‚µ‚Ü‚·‚Ì‚ÅARig‚É‚æ‚Á‚Ă͂±‚ÌTx’è‹`‚ł̃fƒBƒŒƒC‚Í•s—v‚©‚à’m‚ê‚Ü‚¹‚ñB + + uVFO pollingv‚ðÝ’è‚·‚邯ARadioCommandŒo—R‚ÅRig‚ÌŽü”g”‚ðŽæ‚è‚±‚ÝAƒƒO‚̃oƒ“ƒhî•ñ‚ðŽ©“®“I‚ÉXV‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·BŒ»ó‚ł͂·‚ׂĂÌRig‚ðƒTƒ|[ƒg‚µ‚Ä‚¢‚é‚킯‚ł͂ ‚è‚Ü‚¹‚ñ‚ªA–¢ƒTƒ|[ƒg‚Ì‚à‚ɂɊւµ‚Ăͫ—ˆƒRƒ}ƒ“ƒh‚ª”»–¾‚µ‚½Žž“_‚ŒljÁ‚µ‚½‚¢‚ÆŽv‚¢‚Ü‚·B + uFreq offsetv‚ƃƒO‚ÉÝ’è‚·‚éŽü”g”‚ÌŠÖŒW‚͈ȉº‚Ì’Ê‚è‚Å‚·B + + OFF freq = VFO + LSB freq = VFO - MarkFreq + USB freq = VFO + MarkFreq + + ICOM‚¨‚æ‚ÑTenTec Omni-VI‚Ìê‡AuScan addr.v‚̃`ƒFƒbƒN‚ð•t‚¯‚邯ީ“®“I‚ÉRig‚̃AƒhƒŒƒX‚ð’T‚µ‚Ü‚·Bƒ}ƒ‹ƒ`ƒhƒƒbƒv‚Å‘½”‚ÌRig‚ðÚ‘±‚ð‚µ‚Ä‚¢‚éê‡Aʼn‚ÉŒ©‚‚¯‚½Rig‚̃AƒhƒŒƒX‚Å’âŽ~‚µ‚Ü‚·B + + +›Žž‚̕Ⳡ+~~~~~~~~~~~~ +@MMTTY‚ÍWindows‚©‚çUTCŽž‚ð“ǂݎæ‚è‚Ü‚·B‚±‚ÌŽž‚Í‚ ‚È‚½‚̃pƒ\ƒRƒ“‚Ì’nˆæî•ñA‹Gß’²®Aƒ^ƒCƒ€ƒ][ƒ“‚È‚ÇÝ’è󋵂̉e‹¿‚ðŽó‚¯‚éꇂª‚ ‚è‚Ü‚·B—Ⴆ‚΂ ‚È‚½‚ªƒ[ƒJƒ‹Žž‚ÉUTCŽž‚ðݒ肵‚Ä‚¢‚éꇂȂǂł·B +@‚à‚µŽž‚ª‚¸‚ê‚éê‡AƒƒOÝ’è‰æ–Ê‚Ìu‚»‚Ì‘¼vƒy[ƒW‚ÌuTime offsetv‚ð’²®‚µ‚ĉº‚³‚¢BMMTTY‚Í‚·‚ׂĂ̎ž‚É‚±‚ÌTime offset‚ð“K—p‚µ‚Ü‚·B + + +›ˆ—‚ÌŒyŒ¸‰» +~~~~~~~~~~~~~~ +@MMTTY‚ÍŠeŽí‚ÌÝ’è‚ðƒ†[ƒU‚Ɉς˂Ă¢‚Ü‚·‚ªACPU‚Ö‚Ì•‰’S‚ðŒyŒ¸‚·‚é–Ú“I‚©‚ç‚͈ȉº‚Ìݒ肪—LŒø‚Å‚·i‰º‹LˆÈŠO‚Í‚ ‚܂舗‘¬“x‚ɂ͉e‹¿‚µ‚Ü‚¹‚ñjB + +uÅ‚àŒ€“I‚ÈŒyŒ¸‰»v +@ƒTƒEƒ“ƒhƒJ[ƒh‚̃x[ƒXƒTƒ“ƒvƒŠƒ“ƒOŽü”g”‚É6000Hz‚ð‘I‚т܂·BÚׂÍuDigtal.txtv‚ðŽQÆ‚µ‚ĉº‚³‚¢B + +uŽóMŽž‚̈—ŒyŒ¸‰»v + EÏ•ªŠí‚ÍIIR-LPFƒtƒBƒ‹ƒ^‚ð‘I‘ð‚·‚é + EXYScope‚̈—•iŽ¿‚ðLower‚É‚·‚éiƒfƒtƒHƒ‹ƒg’Ê‚èj + EXYSCope‚ðON‚É‚µ‚È‚¢iƒfƒtƒHƒ‹ƒg’Ê‚èj + Eƒfƒ‚ƒWƒ…ƒŒ[ƒ^‚ÍIIRŒ^‹¤UŠí‚ð‘I‘ð‚·‚éiƒfƒtƒHƒ‹ƒg’Ê‚èj + EƒŠƒ~ƒbƒ^[‚ÌuOverSamplingv‚ÍON‚É‚µ‚È‚¢iƒfƒtƒHƒ‹ƒg’Ê‚èj + EBPF‚âLMS‚ÍON‚É‚µ‚È‚¢iƒfƒtƒHƒ‹ƒg’Ê‚èj + + +u‘—MŽž‚̈—ŒyŒ¸‰»v + ELocalEcho‚ðON‚É‚·‚é + ETxBPF‚ðOFF‚É‚·‚é + ETxLPF‚ðON‚É‚µ‚È‚¢iƒfƒtƒHƒ‹ƒg’Ê‚èj + + +›ƒTƒEƒ“ƒhƒJ[ƒhƒIƒvƒVƒ‡ƒ“ +~~~~~~~~~~~~~~~~~~~~~~~~~~ +@ƒIƒvƒVƒ‡ƒ“ƒƒjƒ…[‚ÌÝ’è‰æ–ʂɃTƒEƒ“ƒhƒJ[ƒhˆ—‚ÉŠÖ‚·‚éݒ耖ڂª‚ ‚è‚Ü‚·B + +uFIFOv +@‚±‚Ì’l‚ð‘å‚«‚­‚·‚邯ˆ—ƒ}[ƒWƒ“‚ª‘‚¦‚Ü‚·BMMTTY‚Æ“¯Žž‚ɕʂ̃vƒƒOƒ‰ƒ€‚ðŽÀs‚·‚éꇂÍA‘å‚«‚ß‚Éݒ肵‚½‚Ù‚¤‚ª—Ç‚¢‚Å‚µ‚傤B + + +uPriorityv +@ƒfƒtƒHƒ‹ƒg‚ł̓TƒEƒ“ƒhˆ—‚É”äŠr“I‚‚¢—D懈ʂð—^‚¦‚Ä‚¢‚Ü‚·‚ªAƒƒCƒ“‰æ–Êã‚Ì‘€ì‰ž“š‚ª’x‚©‚Á‚½‚蔽‰ž‚µ‚È‚¢ê‡‚ª‚ ‚鎞‚É‚ÍA‚±‚ÌPriority‚ð‰º‚°‚Ă݂ĉº‚³‚¢B‚Ü‚½‹t‚É‘—MŽž‚̉¹‚ª“rØ‚ê‚éꇂɂÍAPriority‚ðã‚°‚Ă݂ĉº‚³‚¢BiPentium100MHz‚Å‚àAHigher‚®‚ç‚¢‚Ü‚Å—Ž‚Æ‚µ‚Ä‚à‘åä•v‚̂悤‚Å‚·j + +Normal ƒTƒEƒ“ƒhˆ—‚Í’Êí‚Ì—Dæ“x +Higher ƒTƒEƒ“ƒhˆ—‚Ì—Dæ“x‚Í’Êí‚æ‚è‚à 1 ƒ|ƒCƒ“ƒg‚‚¢ +Highest ƒTƒEƒ“ƒhˆ—‚Ì—Dæ“x‚Í’Êí‚æ‚è‚à 2 ƒ|ƒCƒ“ƒg‚‚¢ +Critical ƒTƒEƒ“ƒhˆ—‚Í‚à‚Á‚Æ‚à‚‚¢—Dæ“x + + +uDevice IDv +@ƒfƒtƒHƒ‹ƒg‚Å‚ÍAMMTTY‚Í‹N“®Žž‚ÉŽg—p‰Â”\‚ȃTƒEƒ“ƒhƒJ[ƒh‚ð’T‚µ‚Ü‚·B‚à‚µ‚ ‚È‚½‚ª•¡”‚̃TƒEƒ“ƒhƒJ[ƒh‚ðƒCƒ“ƒXƒg[ƒ‹‚µ‚Ä‚¨‚èAŽg—p‚·‚éƒJ[ƒh‚ð“Á’肵‚½‚¢ê‡ADevice ID‚ÉID”Ô†‚ðÝ’è‚·‚鎖‚ª‚Å‚«‚Ü‚·B +@’ÊíƒTƒEƒ“ƒhƒJ[ƒh‚ÌID‚Í‚O‚©‚燔ԂɈÖقɊ„‚è“–‚Ä‚ç‚ê‚Ü‚·B-1‚Í“Á•ʂȒl‚ÅAMMTTY‚ªŽg—p‰Â”\‚ȃJ[ƒh‚ð’T‚·‚±‚Æ‚ðˆÓ–¡‚µ‚Ü‚·B + ƒTƒEƒ“ƒhƒJ[ƒh‚ª‚P–‡‚µ‚©‘¶Ý‚µ‚È‚¢ê‡A’Êí‚Í-1‚ðݒ肵‚ĉº‚³‚¢B‚à‚µMMTTY‚ªƒTƒEƒ“ƒhƒJ[ƒh‚ð”Fޝ‚µ‚È‚¢ê‡A0‚ðŽŽ‚µ‚Ă݂ĉº‚³‚¢B + +uSourcev + ƒfƒtƒHƒ‹ƒg‚ł̓TƒEƒ“ƒhƒJ[ƒh‚̓‚ƒmƒ‰ƒ‹iMonojƒ‚[ƒh‚ÅŽg—p‚µ‚Ü‚·B‚à‚µƒTƒEƒ“ƒhƒJ[ƒh‚ÌM†‚Ì“ü—͂܂½‚Ío—Í‚ªŽ|‚­“®ì‚µ‚È‚¢ê‡AuLeftv‚Ü‚½‚ÍuRightv‚ð‘I‘ð‚µAƒTƒEƒ“ƒhƒJ[ƒh‚ðƒXƒeƒŒƒIƒ‚[ƒh‚Å“®ì‚³‚¹‚ĉº‚³‚¢B +@ƒXƒeƒŒƒIƒ‚[ƒh‚Å“®ì‚³‚¹‚½ê‡A‘—MŽž‚Í—¼•û‚̃`ƒƒƒ“ƒlƒ‹‚ÉM†‚ðo—Í‚µ‚Ü‚·‚ªAŽóMŽž‚ÍŽw’肳‚ꂽƒ`ƒƒƒ“ƒlƒ‹‚ÌM†‚݈̂—‚µ‚Ü‚·B + + +uClockv +@MMTTY‚̓TƒEƒ“ƒhƒJ[ƒh‚ɑ΂µ‚ăTƒ“ƒvƒŠƒ“ƒOŽü”g”11025Hz‚ðŽw’肵‚Ü‚·B‚µ‚©‚µƒTƒEƒ“ƒhƒJ[ƒh‚̃NƒƒbƒN¸“x‚Í—]‚賊m‚ł͂Ȃ¢ê‡‚ª‚ ‚邿‚¤‚Å‚·‚Ì‚ÅAMMTTY“à•”‚ł̂·‚ׂĂÌM†ˆ—‚ɑ΂µ‚Ä11025Hz‚Ƃ͈قȂéŽÀ‘ª‚̃Tƒ“ƒvƒŠƒ“ƒOŽü”g”‚ðuClockv‚Æ‚µ‚ÄÝ’è‚Å‚«‚邿‚¤‚É‚µ‚Ä‚ ‚è‚Ü‚·B + +@‚±‚ÌuClockvÝ’è‚ð•ÏX‚µ‚½ê‡Aˆê’UMMTTY‚ðI—¹‚µAÄ‹N“®‚µ‚È‚¢‚ÆŽÀÛ‚ÌM†ˆ—‚̃Tƒ“ƒvƒŠƒ“ƒOŽü”g”‚ɂ͔½‰f‚³‚ê‚Ü‚¹‚ñB + +@ƒTƒ“ƒvƒŠƒ“ƒOŽü”g”‚̌뷂ÍAM†ˆ—‚ɑ΂µ‚Ă͎ü”g”‚̌뷂ƂȂèAƒfƒR[ƒ_[‚ƃGƒ“ƒR[ƒ_[iAFSKj‚ɑ΂µ‚Ă͕„†‘¬“x‚̌뷂ɂȂè‚Ü‚·B +@RTTY‚Ìꇂ͒²•à“¯Šú•„†‚Ȃ̂ÅA•„†‘¬“x‚Ì‹–—eŒë·‚ɂ͂ ‚é’ö“xi–ñ5%j‚̃}[ƒWƒ“‚ª‚ ‚è‚Ü‚·‚ªA‚ ‚Ü‚è‚à‘å‚«‚­‚¸‚ê‚Ä‚¢‚邯ŽóM󋵂ªŒµ‚µ‚¢ê‡‚É•¶Žš‰»‚¯‚ÌŒ´ˆö‚Ì‚P‚‚ɂȂé‰Â”\«‚ª‚ ‚è‚Ü‚·B +@‚µ‚©‚µ‘ŠŽè‹Ç‚Ì•„†‘¬“x‚à‚»‚ñ‚ȂɳŠm‚Ƃ͎v‚¦‚Ü‚¹‚ñ‚Ì‚ÅA‚ ‚Ü‚è_ŒoŽ¿‚ɂȂé•K—v‚à‚È‚¢‚ÆŽv‚¢‚Ü‚·B + +*ƒNƒƒbƒN‚̕Ⳃðs‚¤Û‚ÍAƒpƒ\ƒRƒ“‚Ì“dŒ¹‚ð“ü‚ê‚Ä‚©‚çAƒTƒEƒ“ƒhƒ{[ƒh‚̊­U‚ªˆÀ’è‚·‚é‚Ü‚ÅA‚µ‚΂炭‘Ò‚Á‚Ä‚©‚ç‚â‚Á‚½‚Ù‚¤‚ª—Ç‚¢‚Å‚µ‚傤B + +EŽü”g”ƒJƒEƒ“ƒ^‚ðŽg‚¤ê‡ + + 1)ʼn‚ÌClock‚ª11025Hz‚ɂȂÁ‚Ä‚¢‚é‚Ì‚ðŠm”F‚·‚é + 2)ƒ}[ƒNŽü”g”‚ð2000Hz‚É‚·‚é + 3)Diddle‚ðOFF‚É‚·‚é + 4)TXƒ{ƒ^ƒ“‚ð‰Ÿ‚·i•¶Žš‚Í‘—M‚µ‚È‚¢j + 5)SoundOut‚̃Vƒ“ƒOƒ‹ƒg[ƒ“‚ÌŽü”g”‚ðŒv‘ª‚·‚é + + Œv‘ª‚µ‚½Žü”g”‚ª—Ⴆ‚Î2010Hz‚È‚ç‚ÎAŽÀۂ̃Tƒ“ƒvƒŠƒ“ƒOŽü”g” x ‚Í + + x = 11025 * Œv‘ªŽü”g” / MMTTY‚̃}[ƒNŽü”g” + + = 11025 * 2010 / 2000 = 11080.125 [Hz] + +‚Å‹‚߂邱‚Æ‚ª‚Å‚«‚Ü‚·B‚±‚Ìê‡uClockv‚ɂ͎lŽÒŒÜ“ü‚µ‚Ä11080[Hz]‚ÆÝ’è‚·‚ê‚Î\•ª‚Å‚·B + + +E•W€“d”giJJYj‚ðŽóM‚µ‚Ä’²®‚·‚éê‡ + +@­‚µŽžŠÔ‚ª‚©‚©‚è‚Ü‚·‚ªAJJY‚Ì‚P•bƒ`ƒbƒN‰¹‚ðŽóM‚µ‚Ä’²®‚·‚邱‚Æ‚à‚Å‚«‚Ü‚·B‚±‚Ì•û–@‚Í1HzˆÈ“à‚̸“x‚É’Ç‚¢‚±‚Þ‚±‚Æ‚ª‰Â”\‚Å‚·B + + 1)Ý’è‰æ–ʂ̂»‚Ì‘¼‚̃y[ƒW‚ÌAdjƒ{ƒ^ƒ“‚ð‰Ÿ‚µA’²®—p‚̃EƒCƒ“ƒhƒE + ‚ð•\ަ‚µ‚Ü‚·B + 2)ŽóM‹@‚ðAM‚Ü‚½‚ÍSSBƒ‚[ƒh‚É‚µJJY‚ðŽóM‚µ‚Ü‚·B + 3)SSB‚Ìꇂ͂P•bƒ`ƒbƒN‰¹‚ªƒ}[ƒNŽü”g”‚Éd‚È‚é‚æ‚¤‚ÉŽóM‹@‚Ì + Žü”g”‚ð‡‚킹‚Ü‚·BAM‚Ìꇂ͂قƂñ‚ǂ̎ž‚Å1000Hz‚Ü‚½‚Í1600Hz + ‚ðMark‚ÉÝ’è‚·‚邯Ž|‚­ŽóM‚Å‚«‚é‚Í‚¸‚Å‚·B + 4)‚µ‚΂炭i”•ªjŽóM‚µ‚Ä‚¢‚邯‰æ–Ê‚Éc‚Ü‚½‚͎΂߂Ìü‚ª2–{‚Ü‚½‚Í + ‚P–{•\ަ‚³‚ê‚Ü‚·BiƒTƒ“ƒvƒŠƒ“ƒOƒx[ƒX‚É‚æ‚è–{”‚͈قȂè‚Ü‚·j + 5)‚»‚Ìü‚ª‚’¼‚Ìê‡AƒNƒƒbƒN’l‚ÍŠù‚ɳŠm‚Å‚·‚̂Ŋr³‚·‚é•K—v‚Í + ‚ ‚è‚Ü‚¹‚ñBƒLƒƒƒ“ƒZƒ‹ƒ{ƒ^ƒ“‚ð‰Ÿ‚µ‚Ü‚·B + 6)ŽÎ‚߂ɂȂÁ‚Ä‚¢‚éꇂÍA‚»‚Ìü‚Ì‚¢‚¸‚ê‚©‚Ì’[‚ðƒNƒŠƒbƒN‚µ‚Ü‚·B + 7)‚»‚µ‚Ä“¯‚¶üã‚Ì‹t‘¤‚̂ł«‚邾‚¯‰“‚¢“_‚ðƒNƒŠƒbƒN‚·‚邯Šr³‚Í + Š®—¹‚µ‚Ü‚·B‚Q“_ŠÔ‚Ì‹——£‚ª’·‚¢‚قdzŠm‚ÉŠr³‚Å‚«‚Ü‚·B + +@ʼn‚̃NƒƒbƒN’l‚̌뷂ª‘å‚«‚­Aü‚ÌŒX‚«‚ª‘å‚«‚¢ê‡A­‚µŒë·‚ªŽc—¯‚·‚éꇂª‚ ‚è‚Ü‚·B‚»‚̂悤‚ÈꇂÍA‚à‚¤ˆê“x“¯‚¶Žè‡‚ðŒJ‚è•Ô‚·‚Æ‚æ‚賊m‚ÉŠr³‚Å‚«‚Ü‚·B‚»‚Ìê‡A2‰ñ–ڂ͂قƂñ‚Çü‚ª‚’¼‚ɋ߂¢ó‘ԂɂȂÁ‚Ä‚¢‚é‚Í‚¸‚Å‚·B + ‰æ–Ê“à‚ðƒ}ƒEƒX‚̉Eƒ{ƒ^ƒ“‚ŃNƒŠƒbƒN‚·‚邯‚»‚̈ʒu‚ɃJ[ƒ\ƒ‹‚ªˆÚ“®‚µ‚Ü‚·‚Ì‚ÅA‚»‚ê‚Åcƒ‰ƒCƒ“‚ÌŒX‚«‚ðŠm”F‚µ‚ĉº‚³‚¢B + + 2001”N‚Ìt‚©‚çJJY•ú‘—‚Í’âŽ~‚µ‚Ü‚·B‚»‚Ìꇂ͑“à‚ÌFAX•ú‘—iJMG,JMHj‚Í0.5•b–ˆ‚̃fƒbƒhƒZƒNƒ^ƒ^ƒCƒ~ƒ“ƒO‚ª”ñí‚ɳŠm‚Å‚·‚Ì‚ÅA‚»‚ê‚ð‚Ü‚Á‚½‚­“¯‚¶‚悤‚É—˜—p‚µ‚Ä‚à—Ç‚¢‚Å‚µ‚傤B +@‚È‚¨A‚±‚ÌClock’l‚Í‘¼‚̃TƒEƒ“ƒhƒJ[ƒh‚ð—˜—p‚·‚éƒ\ƒtƒgi—Ⴆ‚ÎPSK31SBW‚ÌSetupj‚É‚à‚»‚̂܂ܗ¬—p‚Å‚«‚邯Žv‚¢‚Ü‚·B•â³’l‚ªppm•\Œ»‚̃\ƒtƒg‚Ìꇂ͎Ÿ‚̂悤‚ɕϊ·‚µ‚Ü‚·i•ÏŠ·‚µ‚½’l‚à‰æ–Ê“à‚É•\ަ‚µ‚Ä‚ ‚è‚Ü‚·jB + + •â³’l[ppm] = (Clock - 11025) * 1000000 / 11025 + + +uTx offsetv + ˜^‰¹iŽóMjŽž‚ÆÄ¶i‘—MjŽž‚ŃTƒEƒ“ƒhƒJ[ƒh‚̃Tƒ“ƒvƒŠƒ“ƒOŽü”g”‚ªˆÙ‚È‚éê‡A‚±‚ÌuTx offsetv‚ðݒ肵‚Ü‚·BÝ’è‚·‚é’l‚ÍMMSSTV‚Ƃ܂Á‚½‚­“¯‚¶‚Å‚·B‚±‚Ì’l‚ð‹‚ß‚é‚É‚ÍMMSSTV‚ð—˜—p‚·‚é•K—v‚ª‚ ‚è‚Ü‚·‚Ì‚ÅAÚׂ͂»‚¿‚ç‚̃}ƒjƒ…ƒAƒ‹‚ðŽQÆ‚µ‚ĉº‚³‚¢B + +@‚µ‚©‚µRTTY‚ÌꇂÍA‚»‚ê‚قdzŠm‚ÉÝ’è‚·‚é•K—v‚Í‚ ‚è‚Ü‚¹‚ñ‚Ì‚ÅAˆÈ‰º‚̊ȕւȕû–@‚ÅŠr³‚µ‚Ä‚à\‚í‚È‚¢‚ÆŽv‚¢‚Ü‚·B + +1)‚Ü‚¸ŽóM‚̃NƒƒbƒN‚ð‡‚í‚Ä‚¨‚«‚Ü‚·B + +2)Ý’è‰æ–Êu‚»‚Ì‘¼vƒy[ƒW‚̃TƒEƒ“ƒhƒ‹[ƒvƒoƒbƒN‚ðuŠO•”(‰q¯’ÊM—p)v‚É‚µ‚Ü‚·B + +3)ƒTƒEƒ“ƒhƒJ[ƒh‚Ìo—͂Ɠü—Í‚ðÚ‘±‚µ‚Ü‚·B‚Ü‚½‚̓{ƒŠƒ…[ƒ€ƒRƒ“ƒgƒ[ƒ‹‚̃~ƒLƒT[ƒvƒƒOƒ‰ƒ€i“ü—̓{ƒŠƒ…[ƒ€ƒRƒ“ƒgƒ[ƒ‹j‚Åuƒ‹[ƒvƒoƒbƒNv‚Ü‚½‚ÍuƒXƒeƒŒƒI/ƒ‚ƒmƒ‰ƒ‹ƒ~ƒLƒT[v‚ð‘I‘ð‚µ‚Ü‚·B + +4)MMTTY‚ð‘—Mó‘Ô‚É‚µAƒXƒyƒNƒgƒ‰ƒ€•\ަ‚ªƒ}[ƒJ[‚Éd‚È‚é‚æ‚¤‚ÉTxOffset‚ð’²®‚µ‚Ü‚·B + +@ŋ߂̃TƒEƒ“ƒhƒJ[ƒh‚̃NƒƒbƒN‚ÌŒXŒü‚Æ‚µ‚Ä‚ÍA + ŽóMŽž ‘—MŽž Tx offset + 11025•t‹ß 11025•t‹ß 0 + 11025•t‹ß 11100•t‹ß 75.00 + 11100•t‹ß 11025•t‹ß -75.00 +‚Ì‚¢‚¸‚ê‚©‚Å‚·‚Ì‚ÅA‚à‚µƒXƒyƒNƒgƒ‰ƒ€•\ަ‚Ŏ኱‚̃YƒŒ‚ªŠm”F‚Å‚«‚éꇂÍATxOffset‚É75.00‚Ü‚½‚Í-75.00‚ðÝ’è‚·‚邯‚Ù‚Ú‡‚¤‚ÆŽv‚¢‚Ü‚·B + +@‚È‚¨RTTY‚Ìê‡A—Ⴆ‚Î11025Hzƒx[ƒX‚ł̃IƒtƒZƒbƒg‚ª75Hz‘¶Ý‚·‚éê‡A‘—Žó‚ÌŽü”g”ƒYƒŒ‚Í5Hz`15Hz‚ɂȂè‚Ü‚·B‚Ü‚½ƒ{[ƒŒ[ƒg‚̃YƒŒ‚Í6800ppm(0.68%)’ö“x‚ɂȂè‚Ü‚·‚ªARTTY‚Ì•ûޮީg‚ªŽ‚ƒ}[ƒWƒ“‚ª‘å‚«‚¢‚½‚ßAŽÀ—pã‚Í–â‘è‚ɂ͂Ȃç‚È‚¢‚ÆŽv‚¢‚Ü‚·B + + +›ƒeƒXƒg‹@”\ +~~~~~~~~~~~~ + ƒIƒvƒVƒ‡ƒ“ƒƒjƒ…[‚ÌuƒeƒXƒgv‚ð‘I‘ð‚·‚é‚ÆAƒeƒXƒgM†‚𶬂µ‚Ä“ü—ÍM†‚ɉÁ‚¦‚Ü‚·B + Rig‚©‚çƒTƒEƒ“ƒhƒJ[ƒh‚ɃmƒCƒY‚ð“ü‚ê‚Ä‚¨‚¯‚ÎAS/N‚̈«‚¢ó‘Ô‚ðƒeƒXƒg‚·‚鎖‚à‚Å‚«‚Ü‚·i‚±‚Ìꇂ̓IƒvƒVƒ‡ƒ“ƒƒjƒ…[‚ÌÝ’è‰æ–Ê‚ÅAƒfƒWƒ^ƒ‹o—̓Œƒxƒ‹‚𬂳‚­‚µ‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñjB + + +›Œ¾Œê +~~~~~~ +@MMTTY‚Í‹N“®Žž‚É‘•Êî•ñ‚ð“ǂݎæ‚è‚Ü‚·B‰‰ñ‹N“®ŽžiMmtty.INI‚ª‘¶Ý‚µ‚È‚¢Žžj‚É‚ÍA‘•Êî•ñ‚ðŒ³‚É‰æ–ʂ̃tƒHƒ“ƒg‚⃃bƒZ[ƒW‚ð‰Šú‰»‚µ‚Ü‚·B + +@‚à‚µ‚ ‚È‚½‚̃pƒ\ƒRƒ“‚É“ú–{ŒêƒtƒHƒ“ƒg‚ªƒCƒ“ƒXƒg[ƒ‹‚³‚ê‚Ä‚¢‚é‚É‚àŠÖ‚í‚炸AMMTTY‚ª‰pŒêƒ‚[ƒh‚Å‹N“®‚³‚ꂽê‡AOptionƒƒjƒ…[‚ÌuSetup MMTTYv‚ð‘I‘ð‚µuMiscvƒy[ƒW‚ÌuJapanesev‚ðƒNƒŠƒbƒN‚µ‚ĉº‚³‚¢BŽŸ‰ñ‚Ì‹N“®Žž‚©‚çMMTTY‚Í“ú–{Œêƒ‚[ƒh‚Å‹N“®‚µ‚Ü‚·B + + +›‚»‚Ì‘¼ +~~~~~~~~ + AFSK‚ʼn^—p‚·‚éꇂÍA•W€‚̃}[ƒNŽü”g”2125Hz‚É‚ ‚܂肱‚¾‚í‚é•K—v‚Í‚ ‚è‚Ü‚¹‚ñBŽ„‚ÌRig‚̃f[ƒ^ƒ‚[ƒh‚ÌꇂÍAŽóMŽž‚̒ʉߓÁ«‚©‚çA2000Hz‚ ‚½‚è‚ÉÝ’è‚·‚é‚Ì‚ªÅ‚à“K‚µ‚Ä‚¢‚Ü‚µ‚½B + ‚½‚¾‚µ‚ ‚Ü‚è’á‰ß‚¬‚邯AFSK‚Å‘—M‚·‚éÛ‚ÉARig‚ÌSSBƒtƒBƒ‹ƒ^‚̃pƒXƒoƒ“ƒh“à‚É‚’²”g‚ª’ʉ߂µ‚Ä‚µ‚Ü‚¤‰Â”\«‚ª‚ ‚è‚Ü‚·‚Ì‚ÅA1800HzˆÈã‚ð‘I‚ñ‚Å‚¨‚­‚Ù‚¤‚ª—Ç‚¢‚ÆŽv‚¢‚Ü‚·B + +*Ý’è‰æ–Ê‚ÌuHam Defaultv‚É‚±‚ÌŽü”g”‚ðݒ肵‚Ä‚¨‚­‚ÆAƒƒCƒ“‰æ–Ê‚ÌuHAMvƒ{ƒ^ƒ“‚âAÝ’è‰æ–Ê‚ÌuHAMvƒ{ƒ^ƒ“‚ð‰Ÿ‚µ‚½Û‚É‚»‚ÌŽü”g”‚ðMarkŽü”g”‚Éݒ肵‚Ü‚·B + +*Rig‚ÍSSBƒ‚[ƒh‚ł͒ÊíƒLƒƒƒŠƒAŽü”g”‚ð•\ަ‚µ‚Ä‚¢‚Ü‚·B—Ⴆ‚ÎLSB‚ÌꇂÍA + +“d”g‚̃}[ƒNŽü”g” Rig‚Ì•\ަŽü”g” | MMTTY‚̃}[ƒNŽü”g”i2125Hzj + +‚ɂȂè‚Ü‚·B + + +›”z•z‚ɂ‚¢‚Ä +~~~~~~~~~~~~~~ +@‚l‚l‚s‚s‚x‚̓tƒŠ[ƒ\ƒtƒg‚Æ‚µ‚ÄŒöŠJ‚µ‚Ü‚·B’˜ìŒ ‚Í‚i‚d‚R‚g‚g‚s‚ªŠŽ‚µ‚Ü‚·‚ªAƒRƒs[AÄ”z•z‚ÉŠÖ‚µ‚ħŒÀ‚ðÝ‚¯‚Ü‚¹‚ñB‚݂Ȃ³‚ñ‚Ì—ÇŽ¯‚ðM—p‚µ‚Ü‚·B–â‚¢‡‚킹‚à•s—v‚Å‚·B‚½‚¾‚µ‚l‚l‚s‚s‚x‚ðŽg—p‚µ‚Ä”­¶‚µ‚½‘¹ŠQ‚ɂ‚¢‚Ă͂¢‚©‚È‚éꇂà•ÛØ‚Å‚«‚Ü‚¹‚ñ‚̂ł²—¹³‰º‚³‚¢B + +@ÅV”ł͈ȉº‚Ì‚t‚q‚k‚©‚çƒ_ƒEƒ“ƒ[ƒh‚Å‚«‚Ü‚·B + +http://plaza27.mbn.or.jp/~je3hht + + +@‚l‚l‚s‚s‚x‚ÉŠÖ‚·‚邲—v–]‚â‚²Ž¿–â‚Í‚i‚d‚R‚g‚g‚sˆ¶‚É—X•Ö‚à‚µ‚­‚ÍE-Mail‚Å‚¨Šè‚¢‚¢‚½‚µ‚Ü‚·iE-Mail:je3hht@jarl.comjB + + +›ÅŒã‚É +~~~~~~~~ + ð”Ni1999j‚©‚çPSK31‚̉^—p‚ðŽn‚߂܂µ‚½‚ªA­‚µã‚ÌŽü”g”‚Å•·‚±‚¦‚éƒsƒƒsƒ‰¹‚ª‚¸‚Á‚Æ‹C‚ɂȂÁ‚Ä‚¢‚Ü‚µ‚½B + ŽóM‚¾‚¯‚Å‚à‚µ‚Ă݂½‚¢‚ÆŽv‚¢‚Ü‚µ‚½‚ªAŽè‚²‚ë‚ȃ‚ƒfƒ€‚à‚È‚­A‚Ü‚¸‚ÍRTTYDEM‚Æ‚¢‚¤ƒfƒ‚ƒWƒ…ƒŒ[ƒ^ŽÀŒ±ƒvƒƒOƒ‰ƒ€‚ðì‚èA‚»‚ÌŒãQSO‚·‚鎖‚ð–Ú“I‚É‚±‚ÌMMTTY‚ðì‚è‚Ü‚µ‚½B + + Ž„‚ÍRTTY‚͂܂Á‚½‚­‚Ì‘fl‚ÅAŒ»ŽÀ‚ÌŽ–—Ç‚­”»‚ç‚È‚©‚Á‚½‚̂ł·‚ªA‚»‚Ì“_‚ÍJARTS(Japanese Amateur Radio Teleprinter Society)‚ÌŠF—l‚©‚炽‚­‚³‚ñ‚ÌŽg—pƒŠƒ|[ƒg‚𒸂­Ž–‚ª‚Å‚«A‘å•ÏŽQl‚É‚³‚¹‚Ä’¸‚¢‚Ä‚¨‚è‚Ü‚·B‚Ç‚¤‚à—L“‚²‚´‚¢‚Ü‚µ‚½B + +JARTS http://www.edsoftz.com/JARTS/index.html + + ‚Ü‚½ˆÈ‰º‚Ì•ûX‚̑傫‚È•—Í‚à“¾‚Ä‚¨‚è‚Ü‚·i‡•s“¯jB + +Fumio JA1IQV RTTY‚ÉŠÖ‚µ‚Ä‘½‚­‚Ì•Œ¾‚𒸂«AŽ„‚ÌRTTY‚ÌŒoŒ±•s‘«‚ð‘å‚¢‚É + •â‚Á‚Ä’¸‚«‚Ü‚µ‚½B +Nori JA1WSK ‰pŒê”łɊւµ‚Ä‚¢‚ë‚¢‚낲”z—¶’¸‚«‚Ü‚µ‚½B‚Ü‚½MMTTY‚ÉŠÖ‚·‚é + ‘f°‚炵‚¢Web‚ð쬂µ‚Ä’¸‚¢‚Ä‚¨‚è‚Ü‚·B +Oba JA7UDE ‚±‚̃wƒ‹ƒv‚Ì–|–ó‚ð‚µ‚Ä’¸‚«‚Ü‚µ‚½B‚Ü‚½‰pŒê”Ńwƒ‹ƒv‚Ì쬂âA + Ž„‚ª‰pŒê‚ª‹êŽè‚Ȃ̂ð•â‚Á‚Ä’¸‚¢‚Ä‚¨‚è‚Ü‚·B”Þ‚ª•‚¯‚Ä‚­‚ê‚È + ‚¯‚ê‚ΉpŒê”ł͊®¬‚µ‚È‚©‚Á‚½‚Å‚µ‚傤B +Bill KB4IJ ƒ[ƒŠƒ“ƒOƒŠƒXƒgƒOƒ‹[ƒv‚ð쬂µ‚Ä‚­‚ê‚Ü‚µ‚½B‚Ü‚½Œ»Ý‰pŒê”Å + ƒwƒ‹ƒvƒ`[ƒ€‚Å‚²•—Í’¸‚¢‚Ä‚¨‚è‚Ü‚·B + http://www.egroups.com/promote/MMTTY +Andy KB2EOQ ‰Šú‚Ì’iŠK‚ʼnpŒê‚̃wƒ‹ƒv‚ðì‚Á‚Ä‚­‚ê‚Ü‚µ‚½B‚Ü‚½Œ»Ý‰pŒê”Å + ƒwƒ‹ƒvƒ`[ƒ€‚Å‚²•—Í’¸‚¢‚Ä‚¨‚è‚Ü‚·B +Ken VE5KC ‰pŒê‚̃z[ƒ€ƒy[ƒW‚ð쬂µ‚Ä‚­‚ê‚Ü‚µ‚½BŒ»Ý‰pŒê”ł̃wƒ‹ƒv + ‚Ì쬂ɂ²•—Í’¸‚¢‚Ä‚¨‚è‚Ü‚·B‚Ü‚½‰pŒê”ÅƒŠƒŠ[ƒX‚ð’S“–‚µ‚Ä + ’¸‚¢‚Ä‚¨‚è‚Ü‚·B + http://www.qsl.net/mmhamsoft/ +Ed K4SB ƒwƒ‹ƒv‚Ì–|–ó(By JA7UDE)‚ðZ³‚µ‚Ä’¸‚«‚Ü‚µ‚½B +Jan KX2A ‰pŒê”ł̃wƒ‹ƒvƒvƒƒWƒFƒNƒg‚ð—§‚¿ã‚°‚Ä’¸‚«A”ނ̂قƂñ‚Ç‚Ì + ŽžŠÔ‚ð”ï‚₵‚ĉpŒê”Ńwƒ‹ƒv쬂Ìì‹Æ‚ð‚µ‚Ä’¸‚«‚Ü‚µ‚½B +Bill K5YG ‰pŒê”ł̃wƒ‹ƒv쬂ւ̂²•—Í‚âAFAQ‚Ìì¬‚ð‚µ‚Ä’¸‚¢‚Ä‚¢‚Ü‚·B + ‚Ü‚½uDigital.txtv‚Ì–|–óiBy JA7UDEj‚Ì“Yí‚à‚µ‚Ä’¸‚«‚Ü‚µ‚½B +Eddie W6/G0AZT ‰pŒê”Å‚ÌFAQ‚Ì쬂ɕ—Í’¸‚«‚Ü‚µ‚½B +Phil GU0SUP ‰pŒê”ł̃wƒ‹ƒv‚Ì쬂ւ̂²•—Í‚ÆAFAQ‚Ì쬂ɕ—Í’¸‚¢‚Ä‚¨‚è + ‚Ü‚·B +Josef OK2WO ƒ`ƒFƒRŒê‚̃wƒ‹ƒv‚ð쬂µ‚Ä‚­‚ê‚Ü‚µ‚½BŽ„‚͔ނÌ쬂µ‚½•¶‘ + ‚ð“ǂނ±‚Ƃ͂ł«‚Ü‚¹‚ñ‚ªA‘f°‚炵‚¢‚ɈႢ‚ ‚è‚Ü‚¹‚ñB +Bill W7TI RTTY BASICS‚Æ‚¢‚¤‘f°‚炵‚¢ƒhƒLƒ…ƒƒ“ƒg‚ð쬂µ‚Ä‚­‚ê‚Ü‚µ‚½B + ‚±‚̃hƒLƒ…ƒƒ“ƒg‚ÍJA7UDE‘å’낳‚ñ‚ª“ú–{Œê‚É–|–󂵂ĉº‚³‚èA + “ú–{Œêƒo[ƒWƒ‡ƒ“‚Å‚àŒ©‚邱‚Æ‚ª‚Å‚«‚Ü‚·B‚º‚Ђ²——‰º‚³‚¢B +Kaz 7L1CUH MMTTY‚Ì“®ìƒeƒXƒg‚âATurbo-Hamlogƒ†[ƒU‚Ì‚½‚ß‚ÌARRL.DX‚Ìì¬ + ‚ȂǑ½‚­‚Ì‚²•—͂𒸂«‚Ü‚µ‚½B +Nobu JA2BQX ADIFƒtƒ@ƒCƒ‹‚©‚çƒRƒ“ƒeƒXƒg‚Ì’ño‘—Þ‚ð쬂·‚éƒvƒƒOƒ‰ƒ€‚ð + 쬂µ‚Ä’¸‚«‚Ü‚µ‚½B +Bob K4CY ƒŠƒ‚[ƒgƒ‚[ƒh‚ÉŠÖ‚·‚é’ñˆÄ‚âƒeƒXƒgA‚Ü‚½ƒŠƒ‚[ƒgƒhƒLƒ…ƒƒ“ƒg + ‚ÉŒfÚ‚·‚邽‚ß‚ÉAVB‚©‚çŽg‚¤ê‡‚̃Tƒ“ƒvƒ‹‚ð’ñ‹Ÿ‚µ‚Ä’¸‚«‚Ü‚µ‚½B +Eike DM3ML ƒhƒCƒcŒê‚̃wƒ‹ƒvƒtƒ@ƒCƒ‹‚ð쬂µ‚Ä’¸‚«‚Ü‚µ‚½B +Antonio EA1MV ƒXƒyƒCƒ“Œê‚̃wƒ‹ƒvƒtƒ@ƒCƒ‹‚ð쬂µ‚Ä’¸‚«‚Ü‚µ‚½B +Edoardo I5PAC ƒCƒ^ƒŠƒAŒê‚̃wƒ‹ƒvƒtƒ@ƒCƒ‹‚ð쬂µ‚Ä’¸‚«‚Ü‚µ‚½B + + +@‚Ü‚½MMTTY-eGroup‚Ì‘½‚­‚Ì•ûX‚Ì‚²•—͂𒸂¢‚Ä‚¨‚è‚Ü‚·B + +@–{“–‚É—L“‚²‚´‚¢‚Ü‚·B + +@“Á‚É Jan KX2A ‚ɂ͉pŒê”Å‚ÌWindows Help‚Ì쬂őå•ςȂ²‹ê˜J‚ð‚¨‚©‚¯‚µ‚Ä‚¨‚è‚Ü‚·B”Þ‚Ì‘f°‚炵‚¢“­‚«‚ƃZƒ“ƒX‚Ì—Ç‚³‚É‚æ‚èA‰pŒê”Ńwƒ‹ƒvƒtƒ@ƒCƒ‹‚̂ق¤‚ªAŽ„‚ªì¬‚µ‚½ƒeƒLƒXƒg‚æ‚è‚à—y‚©‚É‘f°‚炵‚¢‚à‚̂ɂȂè‚Ü‚µ‚½B‚±‚±‚Éd‚˂Ċ´ŽÓ‚̈ӂð•\‚µ‚Ü‚·B—L“ Jan + + + ƒRƒ“ƒeƒXƒg‚ÉŠÖ˜A‚·‚é‹@”\‚à­‚µ‘g‚Ýž‚݂܂µ‚½‚ªA‚Ü‚¾ŽÀ퓊“ü‰ñ”‚ª­‚È‚¢‚Ì‚ÅAŽ|‚­“®ì‚µ‚È‚¢‰Â”\«‚ª‚ ‚è‚Ü‚·B¡Œã‚¨‚¢‚¨‚¢‰ü‘P‚µ‚Ä‚¢‚«‚½‚¢‚ÆŽv‚¢‚Ü‚·B + + + MMTTY‚ð쬂·‚é‚É‚ ‚½‚èRTTY‚ÉŠÖ‚µ‚Ă͈ȉº‚̑ЂðŽQl‚É‚µ‚Ü‚µ‚½B + +EJH1BIH ‘ŠŒ´ а CQ Ham RadiouŒ»‘ã”Å RTTY’´“ü–åvCQo”Å(Š”j1999.3 +EJG2VUQ ˆÀ“¡ °•F CQ Ham RadiouŒ³‘c•¶Žš’ÊM RTTY“ü–åvCQo”Å(Š”j1994.4 + + + ƒfƒWƒ^ƒ‹M†ˆ—‚ÉŠÖ‚µ‚Ă͈ȉº‚̑ЂðŽQl‚É‚µ‚Ü‚µ‚½B + +E”ö’m ”ŽuƒfƒWƒ^ƒ‹EƒtƒBƒ‹ƒ^ÝŒv“ü–åvCQo”Å(Š”j1991.1 +E“c’† Œö’juƒfƒBƒWƒ^ƒ‹’ÊM‹Zp v “ŒŠC‘åŠwo”Å‰ï ‘æ‚R”Å 1992.9.25 +EŽO’J ­ºuƒfƒWƒ^ƒ‹ƒtƒBƒ‹ƒ^ƒfƒUƒCƒ“viŠ”jºW“° •½¬‚U”N‚SŒŽ +EŽOã ’¼Ž÷uƒfƒWƒ^ƒ‹M†ˆ—ƒvƒƒOƒ‰ƒ~ƒ“ƒO“ü–åvCQo”ÅiŠ”j1993 + +›—š—ð +~~~~~~ +uƒo[ƒWƒ‡ƒ“ƒAƒbƒvî•ñv‚ðŽQÆ‚µ‚ĉº‚³‚¢B + \ No newline at end of file diff --git a/mmtty_Icon.ico b/mmtty_Icon.ico new file mode 100644 index 0000000..3b5b5c1 Binary files /dev/null and b/mmtty_Icon.ico differ diff --git a/mmttylog.txt b/mmttylog.txt new file mode 100644 index 0000000..d5e6393 --- /dev/null +++ b/mmttylog.txt @@ -0,0 +1,700 @@ +‚l‚l‚s‚s‚x ƒƒO‹@”\ƒ}ƒjƒ…ƒAƒ‹ + + ‰”Å 2000.07.04 JE3HHT X ½ + ‰ü’ù 2001.09.25 JE3HHT X ½ + + +------------------------------ +›‚l‚l‚s‚s‚x‚̃ƒO‹@”\‚ɂ‚¢‚Ä +------------------------------ + MMTTY‚͂܂¾•sŠ®‘S‚Å‚·‚ªƒƒO‹@”\‚ðŽ‚Á‚Ä‚¢‚Ü‚·BƒƒOƒtƒ@ƒCƒ‹‚ÍMMLOGƒf[ƒ^ƒtƒ@ƒCƒ‹‚ÆŠ®‘S‚ɃRƒ“ƒpƒ`ƒuƒ‹‚Å‚·B + Œ»ó‚Å‚ÍMMTTY‚É‘•”õ‚³‚ê‚Ä‚¢‚郃O‹@”\‚̓R[ƒ‹ƒTƒCƒ“ŒŸõ‚ȂǃƒO‚Æ‚µ‚Ä‚ÌÅ’áŒÀ‚ÉŒÀ‚ç‚ê‚Ä‚¢‚Ü‚·B + + MMTTY‚̃JƒŒƒ“ƒgƒƒOƒtƒ@ƒCƒ‹‚Íí‚É‘O‰ñƒI[ƒvƒ“‚µ‚½ƒƒOƒtƒ@ƒCƒ‹‚Å‚·BMMTTY‚̃^ƒCƒgƒ‹ƒo[‚É•\ަ‚³‚ê‚Ä‚¢‚éŠg’£Žq‚ªuMDTv‚Ì–¼‘O‚ªƒJƒŒƒ“ƒgƒƒOƒtƒ@ƒCƒ‹‚Ì–¼‘O‚Å‚·B + ‚±‚̃tƒ@ƒCƒ‹‚ð•ÏX‚·‚é‚É‚ÍAƒtƒ@ƒCƒ‹ƒƒjƒ…[‚ÌuV‚µ‚¢ƒƒOƒtƒ@ƒCƒ‹‚̃I[ƒvƒ“v‚ð‘I‘ð‚µ‚Ä–¼‘O‚ð“ü—Í‚µ‚Ü‚·B•’ʂ͂ ‚È‚½‚̃R[ƒ‹ƒTƒCƒ“‚𖼑O‚É‚µ‚Ä‚¨‚­‚Æ—Ç‚¢‚Å‚µ‚傤B + +-------------------------------- +›‘ŠŽè‹Ç‚ðŒÄ‚Ño‚·ê‡‚ÌŠî–{‘€ì +-------------------------------- + +1)ŽóM‰æ–ʂɃvƒŠƒ“ƒg‚³‚ê‚Ä‚¢‚éƒR[ƒ‹ƒTƒCƒ“‚ðƒ}ƒEƒX‚̶ƒ{ƒ^ƒ“‚ŃNƒŠƒbƒN‚µAƒR[ƒ‹ƒTƒCƒ“ƒ{ƒbƒNƒX‚É“ü‚ê‚Ü‚·B‚à‚¿‚ë‚ñ‚±‚Ì‘€ì‚ÍŽè“ü—͂łàOK‚Å‚·B +iƒVƒ‡[ƒgƒJƒbƒgCtrl+CƒL[j + +2)‰æ–Êã‚ÌuFindvƒ{ƒ^ƒ“‚ð‰Ÿ‚µ‚ÄA‰ß‹Ž‚ÌQSO‹L˜^‚𒲂ׂ܂·B + +3)‘ŠŽè‹Ç‚ðŒÄ‚Ño‚µA‰ž“š‚ª‚ ‚Á‚½ê‡‚ÍuQSOvƒ{ƒ^ƒ“‚ð‰Ÿ‚µ‚Ü‚·B‚±‚ê‚ŃƒO‚ÉŠJŽnŽž‚ªÝ’肳‚ê‚Ü‚·B + +4)QSO’†‚ɃƒCƒ“‰æ–Ê‚ÌuDatavƒ{ƒ^ƒ“i‚Ü‚½‚ÍCtrl+DƒL[j‚ð‰Ÿ‚µ‚ÄuQSOƒf[ƒ^•ÒW‰æ–Êv‚ðŒÄ‚Ño‚µ•K—v‚È€–Ú‚ð“ü—Í‚µ‚Ü‚·BŽ©•ª‚ª–á‚Á‚½RSTƒŠƒ|[ƒgA‘ŠŽè‹Ç‚Ì–¼‘O‚ÆQTH‚ÍAŽóM‰æ–ʂ̂»‚Ì•”•ª‚ðƒ}ƒEƒX‚ŃNƒŠƒbƒN‚µ‚Ä“ü—Í‚·‚邱‚Æ‚à‚Å‚«‚Ü‚·B + + RSTƒŠƒ|[ƒg ƒVƒ‡[ƒgƒJƒbƒg Ctrl+R + Name ƒVƒ‡[ƒgƒJƒbƒg Ctrl+N + QTH ƒVƒ‡[ƒgƒJƒbƒg Ctrl+Q + +*Name‚ÆQTH‚̃}ƒEƒX‚ł̎æ‚螂݂̓ƒCƒ“‰æ–Êã‚Ì'Name'‚Ì•¶Žš‚ðƒNƒŠƒbƒN‚µ‚ÄØ‚è‘Ö‚¦‚Ü‚·B + +5)QSO‚ªI—¹‚µ‚½‚çAuQSOvƒ{ƒ^ƒ“‚ðÄ“x‰Ÿ‚µ‚Ü‚·B‚±‚ê‚ÅI—¹Žž‚ªÝ’肳‚ê‚Ä‚P‚‚ÌQSO‚ªI—¹‚µ‚Ü‚·B + + +-------------------------------------- +›‘ŠŽè‹Ç‚©‚çŒÄ‚Ño‚³‚ꂽꇂ̊î–{‘€ì +-------------------------------------- + +1)ŽóM‰æ–ʂɃvƒŠƒ“ƒg‚³‚ê‚Ä‚¢‚éƒR[ƒ‹ƒTƒCƒ“‚ðƒ}ƒEƒX‚̶ƒ{ƒ^ƒ“‚ŃNƒŠƒbƒN‚µAƒR[ƒ‹ƒTƒCƒ“ƒ{ƒbƒNƒX‚É“ü‚ê‚Ü‚·B + +2)uQSOvƒ{ƒ^ƒ“‚ð‰Ÿ‚µ‚Ü‚·B‚±‚ê‚ŃƒO‚ÉŠJŽnŽž‚ªÝ’肳‚ê‚Ü‚·B + +3)QSO’†‚ɃƒCƒ“‰æ–Ê‚ÌuDatavƒ{ƒ^ƒ“i‚Ü‚½‚ÍCtrl+DƒL[j‚ð‰Ÿ‚µ‚ÄuQSOƒf[ƒ^•ÒW‰æ–Êv‚ðŒÄ‚Ño‚µ•K—v‚È€–Ú‚ð“ü—Í‚µ‚Ü‚·B + +4)QSO‚ªI—¹‚µ‚½‚çAuQSOvƒ{ƒ^ƒ“‚ðÄ“x‰Ÿ‚µ‚Ü‚·B‚±‚ê‚ÅI—¹Žž‚ª‹L˜^‚³‚ê‚Ä‚P‚‚ÌQSO‚ªI—¹‚µ‚Ü‚·B + + +------------------- +›QSOƒf[ƒ^•ÒW‰æ–Ê +------------------- + QSO’†‚ɃƒCƒ“‰æ–Ê‚ÌuDatavƒ{ƒ^ƒ“i‚Ü‚½‚ÍCtrl+Dj‚ð‰Ÿ‚·‚ÆQSOƒf[ƒ^•ÒW‰æ–Ê‚ð•\ަ‚µ‚Ü‚·B + + ‰æ–ʂ̈ê”Ôã‚̃^ƒCƒgƒ‹s‚É‚Í + +mŒŸõƒR[ƒ‹ƒTƒCƒ“n ƒGƒ“ƒeƒBƒeƒB–¼/‘å—¤–¼ ƒ[ƒJƒ‹Žž QTH + +‚̇‚Å•\ަ‚³‚ê‚Ä‚¢‚Ü‚·B + + ‰æ–ʉº‘¤‚ɂ͌Ÿõ‚µ‚½Œ‹‰Ê‚ªˆê——•\‚Å•\ަ‚³‚ê‚Ä‚¢‚Ü‚·B + + ƒƒCƒ“‰æ–ʂł͔õliRemjAQSLî•ñ‚Ȃǂª“ü—͂ł«‚È‚¢‚Ì‚ÅA‚±‚̉æ–Ê‚ðŒÄ‚Ño‚µ‚Ä“ü—Í‚·‚é•K—v‚ª‚ ‚è‚Ü‚·B + uŽóM‰æ–ÊŽQÆvƒ{ƒ^ƒ“‚ð‰Ÿ‚·‚ÆAŒ»ÝŽóM‚µ‚Ä‚¢‚鉿–ÊiÅ‘å‚T‚P‚Qsj‚ðƒGƒfƒBƒ^•\ަ‚·‚鎖‚ª‚Å‚«AƒJƒbƒg•ƒy[ƒXƒg‘€ìiCtrl+CCCtrl+Vj‚ªŽg—p‚Å‚«‚Ü‚·‚Ì‚ÅA—Ⴆ‚Δõl‚â‚p‚r‚kî•ñ‚Ȃǂ͎óM‚µ‚½ƒeƒLƒXƒg‚©‚çƒJƒbƒg•ƒy[ƒXƒg‚Å‚»‚̂܂ܓ]‹L‚·‚邱‚Æ‚à‚Å‚«‚Ü‚·B + + ‚Ü‚½uJCC/JCGvƒ{ƒ^ƒ“i‚Ü‚½‚ÍF7ƒL[j‚ð‰Ÿ‚·‚ÆAJCC/JCG/AJA‚Ì‘I‘ð“ü—͉æ–Ê‚ª•\ަ‚³‚ê‚Ü‚·‚Ì‚ÅA‘“à‹Ç‚ÉŠÖ‚µ‚Ä‚ÍAƒ[ƒ}Žš’Ô‚è‚ð“ü—Í‚µ‚ÄŒó•â‚ði‚Á‚ÄQTH‚Ì‘I‘ð“ü—Í‚ðs‚¤‚±‚Æ‚à‚Å‚«‚Ü‚·B + + ‰æ–ʉº‘¤‚ÌŒŸõŒ‹‰Ê‚ÍAŒ»Ý“ü—Í’†‚̃f[ƒ^‚ªƒOƒŒ[AŠ®‘S‚Ɉê’v‚µ‚½‚à‚Ì‚ªÔFAŠî–{ƒR[ƒ‹ƒTƒCƒ“‚ªˆê’v‚µ‚½‚à‚Ì‚ª—ÎFA•sŠ®‘S‚Èó‘Ԃňê’v‚µ‚Ä‚¢‚é‚à‚Ì‚ª•F‚Å•\ަ‚³‚ê‚Ü‚·B + +m—án + ŒŸõ‚µ‚½ƒR[ƒ‹ƒTƒCƒ“‚ª KH0/JI3IVL ‚Ìê‡ + KH0/JI3IVL ÔF + KH0/JI3IVL/P —ÎF + JI3IVL —ÎF + JI3IVL/3 —ÎF + ŒŸõ‚µ‚½ƒR[ƒ‹ƒTƒCƒ“‚ª IVL ‚Ìê‡ + KH0/JI3IVL •F + JI3IVL •F + JI3IVL/3 •F + + +-------------- +›ƒƒOˆê——•\ަ +-------------- + •\ަƒƒjƒ…[‚ÌuƒƒOˆê——•\ަvi‚Ü‚½‚ÍCtrl+Lj‚ð‘I‘ð‚·‚é‚ÆAŒ»Ý‚̃ƒO‚É‹L˜^‚³‚ê‚Ä‚¢‚éQSOƒf[ƒ^‚̈ꗗ•\‚ð•\ަ‚µ‚Ü‚·B + ‰ß‹Ž‚̃f[ƒ^‚ðC³‚·‚éꇂÍA‚»‚Ìs‚ðƒ}ƒEƒX‚Ń_ƒuƒ‹ƒNƒŠƒbƒN‚·‚é‚©A‚Ü‚½‚ÍƒŠƒ^[ƒ“ƒL[‚ð‰Ÿ‚µ‚ÄuQSOƒf[ƒ^•ÒW‰æ–Êv‚ðŒÄ‚Ño‚µ‚Ü‚·B + + ƒƒOˆê——•\ަ‰æ–Ê‚É‚àƒƒjƒ…[‚ª‚ ‚èAŒ»ó‚ł͈ȉº‚Ì‹@”\‚ª’è‹`‚³‚ê‚Ä‚¢‚Ü‚·B + + +mƒtƒ@ƒCƒ‹ƒƒjƒ…[n +EV‚µ‚¢ƒƒOƒtƒ@ƒCƒ‹‚̃I[ƒvƒ“ + ƒƒCƒ“‰æ–ʂ̃tƒ@ƒCƒ‹ƒƒjƒ…[‚ÌuV‚µ‚¢ƒƒOƒtƒ@ƒCƒ‹‚̃I[ƒvƒ“v‚Æ“¯‚¶‚Å‚·BƒƒOƒtƒ@ƒCƒ‹‚ð•ÏX‚·‚éꇂɑI‘ð‚µ‚Ü‚·B + +EƒfƒBƒXƒN‚̃tƒ‰ƒbƒVƒ… + ƒƒCƒ“‰æ–ʂ̃tƒ@ƒCƒ‹ƒƒjƒ…[‚ÌuƒfƒBƒXƒN‚̃tƒ‰ƒbƒVƒ…v‚Æ“¯‚¶‚Å‚·B•ÒW’†‚Ì“à—e‚ðƒfƒBƒXƒN‚É‘‚«ž‚ÝAˆê’UƒNƒ[ƒY‚µ‚½ŒãÄ“xƒI[ƒvƒ“‚µ‚Ü‚·B‚±‚̃ƒjƒ…[‚ðŽžXŽÀs‚µ‚ÄA’â“d‚ȂǂŕÒW“à—e‚ðŽ¸‚¤‚Ì‚ð–hŽ~‚µ‚Ü‚·B + +EƒCƒ“ƒfƒbƒNƒXÄ\’z + ŒŸõ—p‚̃R[ƒ‹ƒTƒCƒ“ƒCƒ“ƒfƒbƒNƒX‚ðÄ\’z‚µ‚Ü‚·B•’ʂ̓Cƒ“ƒfƒbƒNƒX‚ª‰ó‚ê‚邱‚Ƃ͂ ‚è‚Ü‚¹‚ñ‚ªAŒŸõ‚ªŽ|‚­s‚¦‚È‚¢ê‡‚ÍŽÀs‚µ‚Ă݂Ă­‚¾‚³‚¢B + +EMMLOGƒeƒLƒXƒgƒtƒ@ƒCƒ‹‚̃[ƒh + MMLOGƒeƒLƒXƒgŒ`Ž®‚̃tƒ@ƒCƒ‹iŠg’£Žq‚ÍLOGj‚ð“ǂ݂±‚݂܂·B + +E‘I‘ð”͈͂ðMMLOGƒeƒLƒXƒgƒtƒ@ƒCƒ‹‚É‘‚«ž‚Ý + MMLOGƒeƒLƒXƒgŒ`Ž®‚̃tƒ@ƒCƒ‹‚ð쬂µ‚ÄAŒ»Ý‘I‘𒆂͈̔͂̓à—e‚ð‘‚«ž‚݂܂·B + +*‘I‘ð‘€ì‚ÍuShift+ªvAuShift+ªvƒL[‚Å‘€ì‚µ‚Ü‚·B + +EƒCƒ“ƒ|[ƒg + ˆÈ‰º‚ÌŒ`Ž®‚̃tƒ@ƒCƒ‹‚ð“ǂ݂±‚݂܂·B + EƒeƒLƒXƒgŒ`Ž® + EADIFŒ`Ž® + ELOG200ƒf[ƒ^ƒtƒ@ƒCƒ‹iL2j + ETurbo HAMLOGƒf[ƒ^ƒtƒ@ƒCƒ‹iDBS, DBRj + +E‘I‘ð”͈͂ðƒGƒNƒXƒ|[ƒg + Œ»Ý‘I‘𒆂͈̔͂ðAˆÈ‰º‚ÌŒ`Ž®‚̃tƒ@ƒCƒ‹‚Éo—Í‚µ‚Ü‚·B + EƒeƒLƒXƒgŒ`Ž® + EADIFŒ`Ž® + ELOG200ƒf[ƒ^ƒtƒ@ƒCƒ‹iL2j + ETurbo HAMLOGƒf[ƒ^ƒtƒ@ƒCƒ‹iDBS, DBRj + + +EMMTTY‚É–ß‚é + ƒƒOˆê——•\‚ðI—¹‚µAMMTTYƒƒCƒ“‰æ–ʂɖ߂è‚Ü‚·B + + +m•ÒWƒƒjƒ…[n + +EƒJ[ƒ\ƒ‹s‚ÌØ‚èŽæ‚è + Œ»Ý‚̃J[ƒ\ƒ‹ˆÊ’u‚Ìs‚ðƒy[ƒXƒgƒoƒbƒtƒ@‚ɕۑ¶‚µAƒƒOã‚©‚ç휂µ‚Ü‚·B + + +EƒJ[ƒ\ƒ‹s‚É‘}“ü + Œ»Ý‚̃J[ƒ\ƒ‹ˆÊ’u‚É‚P‚Âs‚ð‘}“ü‚µAƒy[ƒXƒgƒoƒbƒtƒ@‚Ì“à—e‚ðƒRƒs[‚µ‚Ü‚·B + +E‚·‚ׂđI‘ð + ƒƒO‚ð‚·‚×‚Ä‘I‘ðó‘Ô‚É‚µ‚Ü‚·B + +E‘I‘ð”͈͂ðíœ + Œ»Ý‘I‘ð’†‚Ì”ÍˆÍ‚ð‚·‚×‚Ä휂µ‚Ü‚·B휂µ‚½ƒf[ƒ^‚𕜌³‚·‚邱‚Ƃ͂ł«‚Ü‚¹‚ñ‚Ì‚ÅA’ˆÓ‚µ‚ĉº‚³‚¢B + +E‘I‘ð”͈͂ð“ú•t‚Å•À‚ёւ¦ + Œ»Ý‘I‘𒆂͈̔͂ð“ú•t^Žž‡‚É•À‚ёւ¦‚Ü‚·B + +mŒŸõƒƒjƒ…[n +E擪s‚Ɉړ® + ƒJ[ƒ\ƒ‹‚ðƒƒO‚̈ê”Ôʼn‚Ɉړ®‚µ‚Ü‚·B + +EÅIs‚Ɉړ® + ƒJ[ƒ\ƒ‹‚ðƒƒO‚̈ê”ÔÅŒã‚Ɉړ®‚µ‚Ü‚·B + +E«•ûŒüŒŸõŠJŽn + ƒƒO‚ÌÅIs‚Ì•ûŒü‚ÉŒü‚©‚Á‚ÄŽw’肵‚½ƒR[ƒ‹ƒTƒCƒ“‚ÌŒŸõ‚ðŠJŽn‚µ‚Ü‚·B + +Eª•ûŒüŒŸõŠJŽn + ƒƒO‚Ìæ“ªs‚Ì•ûŒü‚ÉŒü‚©‚Á‚ÄŽw’肵‚½ƒR[ƒ‹ƒTƒCƒ“‚ÌŒŸõ‚ðŠJŽn‚µ‚Ü‚·B + +E«•ûŒüŒŸõ + ƒƒO‚ÌÅIs‚Ì•ûŒü‚ÉŒü‚©‚Á‚Ä‘O‰ñ‚̃R[ƒ‹ƒTƒCƒ“‚ÅŒŸõ‚µ‚Ü‚·B + +Eª•ûŒüŒŸõŠJŽn + ƒƒO‚Ìæ“ªs‚Ì•ûŒü‚ÉŒü‚©‚Á‚Ä‘O‰ñ‚̃R[ƒ‹ƒTƒCƒ“‚ÅŒŸõ‚µ‚Ü‚·B + + +------------------ +›ƒRƒ“ƒeƒXƒg‚Ìê‡ +------------------ +@ˆê‰žƒRƒ“ƒeƒXƒg‚ÉŠÖ˜A‚·‚é‹@”\‚à‘g‚Ýž‚ñ‚Å‚ ‚è‚Ü‚·‚ªA‚Ü‚¾ŽÀ퓊“üŒoŒ±‚ª­‚È‚¢‚Ì‚ÅAŽg‚¢‚É‚­‚¢“_‚ª‚ ‚é‚©‚à’m‚ê‚Ü‚¹‚ñB + +E€”õ +@ƒƒOƒtƒ@ƒCƒ‹‚̓Rƒ“ƒeƒXƒg–ˆ‚ɕʂ̖¼‘O‚É‚µ‚ÄV‚µ‚¢ƒtƒ@ƒCƒ‹‚ðƒI[ƒvƒ“‚µ‚Ü‚·B + +@ƒƒOÝ’è‰æ–Ê‚ðŠJ‚«AˆÈ‰º‚ÌÝ’è‚ð‚µ‚Ü‚·B + +@@“ü—ÍÝ’è + HisRST@ƒRƒ“ƒeƒXƒgƒiƒ“ƒo‚ÌŒ`Ž® + MyRST Contest@ON + +@@QSOƒ{ƒ^ƒ“˜AŒg + Ž©“®ŽÀsƒ}ƒNƒ‹@”\ ON + “¯ˆêƒoƒ“ƒh‚Ìd•¡ƒ`ƒFƒbƒN ON + + [Running] + 1st ON + 2nd ON + Dupe ON + [S&P] + 1st OFF + 2nd OFF + +@HisRST‚Åu599v‚ð‘I‘ð‚µ‚½ê‡Aí‚É“¯‚¶ƒiƒ“ƒo[‚ª‘—M‚³‚ê‚邿‚¤‚ɂȂè‚Ü‚·B‚±‚Ìꇈê”Ôʼn‚̃f[ƒ^‚ÌHisRST‚ɃRƒ“ƒeƒXƒgƒiƒ“ƒo[‚ð“ü‚ê‚Ä‚¨‚©‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñB + +@MyRST‚ÌContest‚ðON‚É‚·‚邯AŽóM‰æ–Ê‚ð¶ƒ}ƒEƒXƒ{ƒ^ƒ“‚ŃNƒŠƒbƒN‚µ‚½ê‡‚ɃR[ƒ‹ƒTƒCƒ“‚ƃRƒ“ƒeƒXƒgƒiƒ“ƒoˆÈŠO‚ÍŽæ‚肱‚߂Ȃ­‚È‚è‚Ü‚·B + +@‚±‚ÌꇃRƒ“ƒeƒXƒgƒiƒ“ƒo[‚ðŽæ‚è‚±‚Þ‚É‚ÍA—Ⴆ‚Î + 599-25-25@‚â@599 25 25 +‚̂悤‚ÈŽóMƒeƒLƒXƒg‚Å‚Íu25v‚Ì•”•ª‚ðƒNƒŠƒbƒN‚µ‚Ü‚·B + +@ŽóM‰æ–Ê‚ðƒNƒŠƒbƒN‚µ‚½ÛAMMTTY‚͉”\‚ÈŒÀ‚èƒR[ƒ‹ƒTƒCƒ“‚ƃRƒ“ƒeƒXƒgƒiƒ“ƒo‚ðŽ©“®‚ÅU‚蕪‚¯‚Ü‚·‚ªA‚±‚Ì”»’è‚ÉŽ¸”s‚·‚é‰Â”\«‚à‚ ‚é‚©‚à’m‚ê‚Ü‚¹‚ñB‚»‚Ìꇂ͎蓮‚Å“ü—Í‚µ‚ĉº‚³‚¢B + +@Œ»ÝŽ©‹Ç‚ªƒ‰ƒ“ƒjƒ“ƒO’†‚©S&P’†‚©‚Ì‹æ•Ê‚ÍAƒƒCƒ“‰æ–Êã‚ÌCall‚Ì•¶Žš‚ðƒNƒŠƒbƒN‚·‚é‚©ƒIƒvƒVƒ‡ƒ“ƒƒjƒ…[‚Ìuƒ‰ƒ“ƒjƒ“ƒOv‚ðON/OFF‚µ‚ÄØ‚è‘Ö‚¦‚邱‚Æ‚ª‚Å‚«‚Ü‚·B + + Running 'Call'‚ªÔF@@ƒ^ƒCƒgƒ‹‚ÉRunning Mode‚ð•\ަ + S&P 'Call'‚ª•F ƒ^ƒCƒgƒ‹‚ÉS&P Mode‚ð•\ަ + + +Eƒ‰ƒ“ƒjƒ“ƒO‚Ìꇂ̑€ì + + 1)ƒ‰ƒ“ƒjƒ“ƒOƒ‚[ƒh‚ð‘I‘ð‚µ‚Ä‚¨‚«‚Ü‚·B + 2)“K“–‚ȃ}ƒNƒƒ{ƒ^ƒ“‚ÅCQ‚ð‘—M‚µA’N‚©‚ɃR[ƒ‹‚³‚ꂽ‚çƒ}ƒEƒX‚Å + ƒR[ƒ‹ƒTƒCƒ“‚ðƒNƒŠƒbƒN‚µ‚ăR[ƒ‹ƒTƒCƒ“ƒ{ƒbƒNƒX‚É“ü‚ê‚Ü‚·B + 3)‘ŠŽè‹Ç‚Ì‘—M‚ªI—¹‚µ‚½Žž“_‚ÅuQSOvƒ{ƒ^ƒ“‚ð‰Ÿ‚µ‚Ü‚·B +@@iuRunning 1stvƒ}ƒNƒ‚ª‘—M‚³‚ê‚Ü‚·j + 4)‘ŠŽè‹Ç‚©‚ç‚̃iƒ“ƒo‚ðƒNƒŠƒbƒN‚µ‚ÄMyRSTƒ{ƒbƒNƒX‚É“ü‚ê‚Ü‚·B +@5)‘ŠŽè‹Ç‚Ì‘—M‚ªI—¹‚µ‚½Žž“_‚ÅuQSOvƒ{ƒ^ƒ“‚ð‰Ÿ‚µ‚Ü‚·B +@@iuRunning 2ndvƒ}ƒNƒ‚ª‘—M‚³‚ê‚Ü‚·j + +@d•¡QSO‚ÌꇂÍ2)‚ÌŽž“_‚ÅuRunning Dupevƒ}ƒNƒ‚ª‘—M‚³‚ê‚Ü‚·‚ªAMMTTY‚ÍŽ©“®‚Å‚ÍQSO‚ðI—¹‚µ‚Ü‚¹‚ñB‚±‚Ìê‡A‚»‚̂܂ÜuInitvƒ{ƒ^ƒ“‚ð‰Ÿ‚µ‚Ä‚»‚̃f[ƒ^‚𖳌ø‚É‚µ‚ĉº‚³‚¢B‚Ü‚½‚ ‚¦‚Äd•¡QSO‚ð‚·‚éꇂɂÍAŽè“®‚Ńiƒ“ƒo[‚ð‘—M‚·‚é•K—v‚ª‚ ‚è‚Ü‚·‚ªA‚±‚̂悤‚ÈꇂɂÍuRunning 1stvƒ}ƒNƒ‚ɃVƒ‡[ƒgƒJƒbƒgƒL[‚ðŠ„‚è“–‚Ăè‚­‚ƕ֗˜‚¾‚ÆŽv‚¢‚Ü‚·B + + +ES&P‚Ìꇂ̑€ì + + 1)S&Pƒ‚[ƒh‚ð‘I‘ð‚µ‚Ä‚¨‚«‚Ü‚·B + 2)“K“–‚ȃ}ƒNƒƒ{ƒ^ƒ“‚ÉuQSL %c UR %R-%N-%N BK\v‚̂悤‚ȃ}ƒNƒ‚ð + “o˜^‚µ‚Ä‚¨‚«‚Ü‚·B +@3)‘ŠŽè‹Ç‚̃R[ƒ‹ƒTƒCƒ“‚ðƒ}ƒEƒX‚ŃNƒŠƒbƒN‚µƒR[ƒ‹ƒTƒCƒ“ƒ{ƒbƒNƒX‚É +@@“ü‚ê‚Ü‚·B +@4)uFindvƒ{ƒ^ƒ“‚ð‰Ÿ‚µŒŸõ‚µ‚Ü‚·B + ‚Ü‚½‚ÍŠù‚ÉQSOς݂Ìꇂ̓{ƒbƒNƒX“à‚̃R[ƒ‹ƒTƒCƒ“‚ªÔF‚Å•\ަ + ‚³‚ê‚Ü‚·‚̂ł»‚ê‚Å”»’f‚·‚邱‚Æ‚à‚Å‚«‚Ü‚·B +@5)‰‚߂Ă̋ǂȂç‚ÎA“K“–‚ȃ}ƒNƒƒ{ƒ^ƒ“‚ð‰Ÿ‚µ‚ăR[ƒ‹‚µ‚Ü‚·B +@6)‰ž“š‚ª‚ ‚Á‚½‚çuQSOvƒ{ƒ^ƒ“‚ð‰Ÿ‚µ‚Ü‚·B +@7)ƒiƒ“ƒo[‚ðƒNƒŠƒbƒN‚µ‚ÄMyRSTƒ{ƒbƒNƒX‚É“ü‚ê‚Ü‚·B + 8)‘ŠŽè‹Ç‚Ì‘—M‚ªI—¹‚µ‚½‚çAƒiƒ“ƒo[‘—M‚ðs‚¤ƒ}ƒNƒƒ{ƒ^ƒ“‚ð‰Ÿ‚µ‚Ä + ƒiƒ“ƒo‚ð‘—M‚µ‚Ü‚·B + 9)‘ŠŽè‹Ç‚©‚ç‚ÌQSL‚ðŽóM‚µ‚½‚çAuQSOvƒ{ƒ^ƒ“‚ð‰Ÿ‚µ‚Ü‚·B + +@S&P‚ÌꇂÍAŒÄ‚Ño‚µ‘¤‚ÉŽžŠÔ“I‚È—]—T‚ª‚ ‚è‚Ü‚·‚Ì‚ÅAQSOƒ{ƒ^ƒ“‚ÆŽ©“®ŽÀsƒ}ƒNƒ‚̘A“®‚ÍŽg‚í‚È‚¢‚Ù‚¤‚ª‘€ì‚ðŽ¸”s‚µ‚È‚¢‚ÆŽv‚¢‚Ü‚·B + + +---------------------------------------- +›Turbo HAMLOG/Win‚Æ‚ÌƒŠƒAƒ‹ƒ^ƒCƒ€ƒŠƒ“ƒN +---------------------------------------- + JG1MOU •l“c‚³‚ñ‚ªì¬‚³‚ꂽTurbo HAMLOG/Win(ˆÈ‰ºHamlog)‚ÆƒŠƒAƒ‹ƒ^ƒCƒ€‚ÉƒŠƒ“ƒN‚ðs‚¤‚±‚Æ‚ª‚Å‚«‚Ü‚·B‚±‚Ì‹@”\‚ðŽg—p‚·‚é‚É‚ÍHamlog‚̃o[ƒWƒ‡ƒ“‚ª4.48eˆÈ~‚ÅMMTTY‚Æ“¯Žž‚ÉŽÀsó‘ԂɂȂ¯‚ê‚΂Ȃè‚Ü‚¹‚ñB + MMTTY‚ÍHamlog‚ÌŒŸo‚ɬŒ÷‚·‚邯ƒƒCƒ“‰æ–ʂ̃^ƒCƒgƒ‹ƒo[‚ÉuLink to Turbo HAMLOG/Winv‚ð•\ަ‚µ‚Ü‚·B + +@Œ»ÝˆÈ‰º‚Ì‹@”\‚ª—˜—p‚Å‚«‚Ü‚·B + +ŒŸõ + MMTTY‚ÌLogƒpƒlƒ‹‚ÌCallƒ{ƒbƒNƒX‚ŃR[ƒ‹ƒTƒCƒ“‚ð“ü‚ê‚ÄEntƒL[‚ð‰Ÿ‚·‚ÆHamlog‚ÌŒŸõ‚ª“¯Žž‚É“­‚«‚Ü‚·BŽóM‰æ–ʂ̃R[ƒ‹ƒTƒCƒ“‚̃NƒŠƒbƒN‘€ì‚É‚æ‚Á‚Ä‚à“¯—l‚Ì“®ì‚ɂȂè‚Ü‚·B + +‹L˜^ +@MMTTY‚ÌQSOƒ{ƒ^ƒ“‚É‚æ‚é’Êí‚̃ƒO‘€ì‚ðs‚¤‚±‚Ƃɂæ‚èAHamlog‚É‚à“¯‚¶ƒf[ƒ^‚ª“¯Žž‚É‹L˜^‚³‚ê‚Ü‚·B + +Žü”g”ƒ|[ƒŠƒ“ƒO + Hamlog‚̃JƒŒƒ“ƒgŽü”g”ƒf[ƒ^‚ð’èŠú“I‚Ƀ|[ƒŠƒ“ƒO‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B‚±‚Ì‹@”\‚ðŽg—p‚·‚éê‡AMMTTY‚ÌuƒƒOÝ’è‰æ–Êv‚Ìu•ÏŠ·vƒy[ƒW‚ÅuLink-Frequency pollingv‚̃`ƒFƒbƒN‚ð“ü‚ê‚ĉº‚³‚¢B + + +@Hamlog‚Æ‚ÌƒŠƒ“ƒN‹@”\‚ðŽg—p‚µ‚½‚­‚È‚¢ê‡‚ÍAMMTTY‚ÌuƒƒOÝ’è‰æ–Êv‚Ìu•ÏŠ·vƒy[ƒW‚ÌuLink-Applicationv‚ðOFF‚Éݒ肵‚ĉº‚³‚¢B + +@‚±‚Ì‹@”\‚ÍŠÖƒnƒ€‚Å•l“c‚³‚ñ‚Æ‹ô‘R‚¨‰ï‚¢‚·‚邱‚Æ‚ª‚Å‚«ŽÀŒ»‚µ‚Ü‚µ‚½B•l“c‚³‚ñ‚ɂ͑å•Ï‚¨¢˜b‚ɂȂè‚Ü‚µ‚½B—L“‚²‚´‚¢‚Ü‚µ‚½B + + +------------------------------------ +›LOG200ƒf[ƒ^ƒtƒ@ƒCƒ‹iL2j‚Ƃ̕ϊ· +------------------------------------ + MMTTY‚ÍAJH3GBD –x–삳‚ñ쬂ÌLOG200‚̃f[ƒ^ƒtƒ@ƒCƒ‹iL2j‚Æ‚Ì‘ŠŒÝ•ÏŠ·‹@”\‚ðŽ‚Á‚Ä‚¢‚Ü‚·B‚½‚¾‚µ×‚©‚¢“_‚ł̃tƒH[ƒ}ƒbƒg‚Ì‘Šˆá‚É‚æ‚èAˆê•”‚Ì€–Ú‚ªŠ®‘S‚É‘ŠŒÝ•ÏŠ·‚Å‚«‚È‚¢ê‡‚ª‚ ‚è‚Ü‚·‚Ì‚ÅAˆÈ‰º‚̎臂Ŏ¦‚·‚悤‚ÉMMTTY‚ÅQSO‚µ‚½ƒf[ƒ^‚¾‚¯‚ðLOG200ƒtƒ@ƒCƒ‹‚É–ß‚·‚±‚Æ‚ð‹­‚­‚¨Š©‚ß‚µ‚Ü‚·B + + LOG200 ¨ MMTTY ŒŸõ‘€ì‚Ì‚½‚߂ɑS•”•ÏŠ·‚·‚é + + LOG200 © MMTTY MMTTY‚ÅQSO‚µ‚½‚à‚Ì‚¾‚¯Šù‘¶‚̃ƒO‚ɒljÁ‚·‚é + +*LOG200ƒtƒ@ƒCƒ‹‚Ƃ̕ϊ·‚ÍAuƒƒOˆê——•\ަ‰æ–Êv‚̃tƒ@ƒCƒ‹ƒƒjƒ…[‚ÌuƒCƒ“ƒ|[ƒgv‚¨‚æ‚ÑuƒGƒNƒXƒ|[ƒgv‚ð‘I‘ð‚µ‚Ü‚·B + +*ƒCƒ“ƒ|[ƒg‚ÌÛ‚Íu’ljÁ‚µ‚Ü‚·‚©Hv‚̃ƒbƒZ[ƒW‚ɑ΂µ‚Äu‚¢‚¢‚¦v‚ð‘I‘ð‚µ‚Ü‚·B + +*uƒGƒNƒXƒ|[ƒgv‚·‚éÛA‚ ‚ç‚©‚¶‚߈ꗗ•\‚ÅAƒ}ƒEƒX‚̶ƒ{ƒ^ƒ“‚ð‰Ÿ‚µ‚È‚ª‚ç㉺‚³‚¹‚é‚©A‚Ü‚½‚ÍuShift+«v,uShift+ªvƒL[‚Å‘€ì‚µ‚ÄA‘‚«ž‚Þƒf[ƒ^‚ð‘I‘ð‚µ‚Ä‚¨‚«‚Ü‚·BMMTTY‚Í‘I‘ð‚³‚ê‚Ä‚¢‚éƒf[ƒ^‚ð–³ðŒ‚ÉŽw’肳‚ꂽƒƒOƒtƒ@ƒCƒ‹‚ɒljÁ‚µ‚Ü‚·B + + LOG200ƒf[ƒ^ƒtƒ@ƒCƒ‹iL2j‚ÆMMLOGƒf[ƒ^ƒtƒ@ƒCƒ‹iMDTj‚ÌŽd—l‚̈Ⴂ‚É‚æ‚èA•ÏŠ·ãˆÈ‰º‚̧–ñ‚ª‚ ‚è‚Ü‚·B + +[MMTTY -> LOG200] + ‘S‚Ä‚Ìî•ñ‚ðŽ¸‚í‚¸‚ɕϊ·‚Å‚«‚Ü‚·BMMTTY‚̈ȉº‚Ì€–Ú‚ÍLOG200‚ÌƒŠƒ}[ƒN—“‚ÉLOG200ƒL[iƒTƒuƒtƒB[ƒ‹ƒhj‚ɕϊ·‚µ‚ÄŠi”[‚³‚ê‚Ü‚·B + + CALL CALL[...] ƒR[ƒ‹ƒTƒCƒ“‚ª15•¶Žš‚ð’´‚¦‚éê‡‚Ì‚Ý + M M[.] + Env ENV[...] + Pow POW[...] + Opt1 OPT1[...] + Opt2 OPT2[...] + Usr1 USR1[...] + Usr2 USR2[...] + QSL MQSL[...] + +*ÅV‚ÌLOG200iƒÀ”Åj‚ł̓R[ƒ‹ƒTƒCƒ“‚Ì‹L˜^‰Â”\‚È’·‚³‚ª]—ˆ‚Ì11•¶Žš‚©‚ç15•¶Žš‚ÉŠg’£‚³‚ê‚Ä‚¢‚Ü‚·B + + ‚Ü‚½MMTTY‚Ì€–ÚQSL“à‚Ɉȉº‚ÌLOG200ƒL[‚ª‚ ‚邯‚«A‚»‚ꂼ‚êLOG200‚ÌŠY“–‚·‚逖ڂɃL[“à‚Ì•¶Žš—ñ‚ªŠi”[‚³‚ê‚Ü‚·B + + RIG[...] RIG + MyQTH[...] MyQTH + MyRIG[...] MyRIG + TEST[...] CONTEST + + +[LOG200 -> MMTTY] + ‹L˜^‚³‚ê‚Ä‚¢‚éƒf[ƒ^‚ªMMLOGƒf[ƒ^ƒtƒ@ƒCƒ‹‚̧ŒÀ‚ð‰z‚¦‚éê‡A‚»‚Ì€–ڂ̈ꕔ‚Ìî•ñ‚ðŽ¸‚¤‰Â”\«‚ª‚ ‚è‚Ü‚·B“Á‚ÉLOG200‚ÌREMARKS—“‚Í”CˆÓ’·‚Ì‹L˜^‚ª‰Â”\‚È‚½‚ß‚Éî•ñ‚ðŽ¸‚¤‰Â”\«‚ª‚‚­A‚Ü‚½sQSL‚ÆrQSL‚àæ“ª‚Ì•¶ŽšˆÈŠO‚ðŽ¸‚¢‚Ü‚·B + + ˆÈ‰º‚Ì€–Ú‚ÍMMTTY‚Ì€–ÚQSL‚ÉALOG200ƒL[‚ɕϊ·‚µ‚ÄŠi”[‚³‚ê‚Ü‚·B + + RIG RIG[...] + MyQTH MyQTH[...] + MyRIG MyRIG[...] + CONTEST TEST[...] + + ‚Ü‚½LOG200‚ÌREMARKS—“‚Ɉȉº‚ÌLOG200ƒL[‚ª‚ ‚邯‚«A‚»‚ꂼ‚êMMTTY‚ÌŠY“–‚·‚逖ڂɃL[“à‚Ì•¶Žš—ñ‚ªŠi”[‚³‚ê‚Ü‚·B + + CALL[...] CALL + M[.] M + ENV[...] Env + POW[...] Pow + OPT1[...] Opt1 + OPT2[...] Opt2 + USR1[...] Usr1 + USR2[...] Usr2 + MQSL[...] QSL + + +------------------------------------------------ +›Turbo HAMLOGƒf[ƒ^ƒtƒ@ƒCƒ‹iDBS, DBRj‚Ƃ̕ϊ· +------------------------------------------------ + MMTTY‚ÍAJG1MOU •l“c‚³‚ñ쬂ÌTurbo Hamlog(ˆÈ‰ºHamlog)‚̃f[ƒ^ƒtƒ@ƒCƒ‹iDBS, DBRj‚Æ‚Ì‘ŠŒÝ•ÏŠ·‹@”\‚ðŽ‚Á‚Ä‚¢‚Ü‚·B + + ˆê‰žHamlog‚Ìê‡A‘S‚Ä‚Ìî•ñ‚𑹂Ȃ킸‚ɕϊ·‚Å‚«‚Ü‚·‚ªA”O‚ׂ̈Ɉȉº‚̎臂Ŏ¦‚·‚悤‚ÉMMTTY‚ÅQSO‚µ‚½ƒf[ƒ^‚¾‚¯‚ðHamlogƒtƒ@ƒCƒ‹‚É–ß‚·‚±‚Æ‚ð‹­‚­‚¨Š©‚ß‚µ‚Ü‚·B + + Hamlog ¨ MMTTY ŒŸõ‘€ì‚Ì‚½‚߂ɑS•”•ÏŠ·‚·‚é + + Hamlog © MMTTY MMTTY‚ÅQSO‚µ‚½‚à‚Ì‚¾‚¯Šù‘¶‚̃ƒO‚ɒljÁ‚·‚é + +*Hamlogƒtƒ@ƒCƒ‹‚Ƃ̕ϊ·‚ÍAuƒƒOˆê——•\ަ‰æ–Êv‚̃tƒ@ƒCƒ‹ƒƒjƒ…[‚ÌuƒCƒ“ƒ|[ƒgv‚¨‚æ‚ÑuƒGƒNƒXƒ|[ƒgv‚ð‘I‘ð‚µ‚Ü‚·B + +*ƒCƒ“ƒ|[ƒg‚ÌÛ‚Íu’ljÁ‚µ‚Ü‚·‚©Hv‚̃ƒbƒZ[ƒW‚ɑ΂µ‚Äu‚¢‚¢‚¦v‚ð‘I‘ð‚µ‚Ü‚·B + +*uƒGƒNƒXƒ|[ƒgv‚·‚éÛA‚ ‚ç‚©‚¶‚߈ꗗ•\‚ÅAƒ}ƒEƒX‚̶ƒ{ƒ^ƒ“‚ð‰Ÿ‚µ‚È‚ª‚ç㉺‚³‚¹‚é‚©A‚Ü‚½‚ÍuShift+«v,uShift+ªvƒL[‚Å‘€ì‚µ‚ÄA‘‚«ž‚Þƒf[ƒ^‚ð‘I‘ð‚µ‚Ä‚¨‚«‚Ü‚·BMMTTY‚Í‘I‘ð‚³‚ê‚Ä‚¢‚éƒf[ƒ^‚ð–³ðŒ‚ÉŽw’肳‚ꂽƒƒOƒtƒ@ƒCƒ‹‚ɒljÁ‚µ‚Ü‚·B + + Hamlogƒf[ƒ^ƒtƒ@ƒCƒ‹iDBS, DBRj‚ÆMMLOGƒf[ƒ^ƒtƒ@ƒCƒ‹iMDTj‚ÌŽd—l‚̈Ⴂ‚É‚æ‚èA•ÏŠ·ãˆÈ‰º‚̧–ñ‚ª‚ ‚è‚Ü‚·B + +[MMTTY -> Hamlog] + MMTTY‚̈ȉº‚Ì€–Ú‚ÍHamlog‚ÌƒŠƒ}[ƒN—“‚ÉLOG200ƒL[iƒTƒuƒtƒB[ƒ‹ƒhj‚ɕϊ·‚µ‚ÄŠi”[‚³‚ê‚Ü‚·B + + CALL ToRadio[...] ƒR[ƒ‹ƒTƒCƒ“‚ª7+3‚Å•\Œ»‚Å‚«‚È‚¢ê‡‚Ì‚Ý + M M[.] + Env ENV[...] + Pow POW[...] + End END[...] + + ƒR[ƒ‹ƒTƒCƒ“‚ªuKH0/JI3IVLv‚̂悤‚ÈŒ`Ž®‚Ìê‡AHamlog‚É‚ÍuJI3IVL/KH0v‚ÌŒ`Ž®‚ÅŠi”[‚µAƒŠƒ}[ƒN—“‚Ì‚¢‚¸‚ê‚©‚Éu$DXv‚Ì•¶Žš—ñ‚ð’ljÁ‚µ‚Ü‚·B +@‘ŠŽè‹Ç‚ªDX‹Ç‚Ìê‡A“ú•t‚ÆŽž‚Íí‚ÉUTC‚ɕϊ·‚µ‚ÄŠi”[‚µ‚Ü‚·B + + ‚Ü‚½MMTTY‚Ì€–ÚUsr1‚Ɉȉº‚ÌLOG200ƒL[‚ª‚ ‚邯‚«A‚»‚ê‚ðHamlog‚ÌQSLî•ñ‚Ì‚R•¶ŽšiM, Send, Rcvj‚ÉŠi”[‚µ‚Ü‚·B + + QSL[...] MSR + +@‚»‚Ì‘¼ˆÈ‰º‚Ì€–ڂ̕ϊ·‚ðs‚¢‚Ü‚·B + + QSL REM2 + Opt1 Code + Opt2 Grid + +@MMTTY‚ÌUsr1‚ÆUsr2‚Ìî•ñ‚Í‚·‚ׂϸ‚¢‚Ü‚·B‚Ü‚½ˆÈ‰º‚ÌMMTTY‚Ì€–ڂ͌㔼‚̈ꕔ‚ðŽ¸‚¤‰Â”\«‚ª‚ ‚è‚Ü‚·iЇŒÊ“à‚͕ϊ·‚É‚æ‚é’·‚³‚̕ω»jB + + MyRST (20->3) + HisRST (20->3) + Name (16->12) + REM (56->54) + Opt1 (8->6) + Opt2 (8->6) + + +[Hamlog -> MMTTY] +@‚·‚ׂĂÌî•ñ‚ðŽ¸‚í‚¸‚ɕϊ·‚Å‚«‚Ü‚·BHamlog‚ÌREMARKS—“‚Ɉȉº‚ÌLOG200ƒL[‚ª‚ ‚邯‚«A‚»‚ꂼ‚êMMTTY‚ÌŠY“–‚·‚逖ڂɃL[“à‚Ì•¶Žš—ñ‚ªŠi”[‚³‚ê‚Ü‚·B + + CALL[...] CALL + ToRadio[...] CALL + M[.] M + ENV[...] Env + POW[...] Pow + END[...] End + +@Hamlog‚ÌQSLî•ñ3•¶Žš‚ÍMMTTY‚ÌUsr1‚Ɉȉº‚ÌŒ`Ž®‚ÅŠi”[‚³‚ê‚Ü‚·B + + MSR QSL[MSR] + + Hamlog‚ÌƒŠƒ}[ƒN—“‚Ì‚¢‚¸‚ê‚©‚Éu$DXv‚Ì•¶Žš—ñ‚ª‘¶Ý‚µAƒR[ƒ‹ƒTƒCƒ“‚ªuJI3IVL/KH0v‚ÌŒ`Ž®‚Ìê‡AMMTTY‚É‚ÍuKH0/JI3IVLv‚ÌŒ`Ž®‚ÅŠi”[‚³‚ê‚Ü‚·B + +@‚»‚Ì‘¼ˆÈ‰º‚Ì€–ڂ̕ϊ·‚ðs‚¢‚Ü‚·B + + Code Opt1 + Grid Opt2 + REM2 QSL + +---------------------------------- +›ƒeƒLƒXƒgƒtƒ@ƒCƒ‹‚ւ̃GƒNƒXƒ|[ƒg +---------------------------------- + ƒtƒ@ƒCƒ‹ƒƒjƒ…[‚Ìu‘I‘ð”͈͂ðƒGƒNƒXƒ|[ƒgv‚ð‘I‘ð‚·‚é‚ÆAŒ»Ý‘I‘𒆂͈̔͂ðƒeƒLƒXƒgƒtƒ@ƒCƒ‹‚Éo—Í‚µ‚Ü‚·B + 쬂·‚éƒeƒLƒXƒgƒtƒ@ƒCƒ‹‚Ì‘Ž®‚ÍŽŸ‚Ì‚R‚‚̂¤‚¿‚Ì‚¢‚¸‚ê‚©‚Å‚·B + + EƒJƒ“ƒ}‹æØ‚èƒeƒLƒXƒgƒtƒ@ƒCƒ‹iCSVŒ`Ž®j + ETAB‹æØ‚èƒeƒLƒXƒgƒtƒ@ƒCƒ‹ + E‹æØ‚è‚È‚µƒeƒLƒXƒgƒtƒ@ƒCƒ‹ + + ‚Ü‚½Å‘å‚U‚SŒÂ‚̃tƒB[ƒ‹ƒh‚ɂ‚¢‚ÄA‚»‚ꂼ‚ê‚̃tƒB[ƒ‹ƒh‚ð‚ǂ̂悤‚ɕϊ·‚·‚é‚©‚ðˆÈ‰º‚̕ϊ·Ž®‚Å’è‹`‚Å‚«‚Ü‚·B + +%NULL ‚±‚̃tƒB[ƒ‹ƒh‚͕ϊ·‚³‚ê‚È‚¢ +%EOD ‚±‚̕ϊ·Ž®ˆÈ~‚̃tƒB[ƒ‹ƒh’è‹`‚Í–³Ž‹‚³‚ê‚é + +%YYYY-MM-DD ”NŒŽ“ú‚ð2000-07-10‚ÌŒ`Ž®‚Å“WŠJ‚·‚é +%YY-MM-DD ”NŒŽ“ú‚ð00-07-10‚ÌŒ`Ž®‚Å“WŠJ‚·‚é +%YYYY/MM/DD ”NŒŽ“ú‚ð2000/07/10‚ÌŒ`Ž®‚Å“WŠJ‚·‚é +%YY/MM/DD ”NŒŽ“ú‚ð00/07/10‚ÌŒ`Ž®‚Å“WŠJ‚·‚é +%YY ”N‚ð00‚ÌŒ`Ž®‚Å“WŠJ‚·‚é +%YYYY ”N‚ð2000‚ÌŒ`Ž®‚Å“WŠJ‚·‚é +%MM ŒŽ‚ð07‚ÌŒ`Ž®‚Å“WŠJ‚·‚é +%MON ŒŽ‚ðJAN,FEB,MAR, ...‚ÌŒ`Ž®‚Å“WŠJ‚·‚é +%MON2 ŒŽ‚ðJan.,Feb.,Mar., ...‚ÌŒ`Ž®‚Å“WŠJ‚·‚é +%DD “ú‚ð10‚ÌŒ`Ž®‚Å“WŠJ‚·‚é +%HHMM ŠJŽnŽž‚ð1234‚ÌŒ`Ž®‚Å“WŠJ‚·‚é +%HH:MM ŠJŽnŽž‚ð12:34‚ÌŒ`Ž®‚Å“WŠJ‚·‚é +%EHHMM I—¹Žž‚ð1234‚ÌŒ`Ž®‚Å“WŠJ‚·‚é +%EHH:MM I—¹Žž‚ð12:34‚ÌŒ`Ž®‚Å“WŠJ‚·‚é +%CALL ƒR[ƒ‹ƒTƒCƒ“‚ð“WŠJ‚·‚é +%M ŒÄ‚Ño‚µƒ}[ƒN‚ð“WŠJ‚·‚é +%MY MyRST‚ð“WŠJ‚·‚é +%HIS HisRST‚ð“WŠJ‚·‚é +%MYRST MyRST‚ðƒ‚[ƒh‚É‚æ‚è’·‚³’²®‚µ‚Ä“WŠJ‚·‚é +%HISRST HisRST‚ðƒ‚[ƒh‚É‚æ‚è’·‚³’²®‚µ‚Ä“WŠJ‚·‚é +%FREQ Žü”g”‚ðMHz’PˆÊ‚Ì•¶Žš—ñ‚Å“WŠJ‚·‚é +%MBAND Žü”g”‚ðƒ[ƒ^[ƒoƒ“ƒh‚Å“WŠJ‚·‚é +%KHZ Žü”g”‚ðKHz’PˆÊ‚Ì•¶Žš—ñ‚Å“WŠJ‚·‚é +%MODE ƒ‚[ƒh‚ð“WŠJ‚·‚é +%POWER “d—Í‚ð“WŠJ‚·‚é +%NAME –¼‘O‚ð“WŠJ‚·‚é +%QTH QTH‚ð“WŠJ‚·‚é +%REM ƒŠƒ}[ƒN‚ð“WŠJ‚·‚é +%QSL QSLî•ñ‚ð“WŠJ‚·‚é +%S QSL”­‘—ƒ}[ƒN‚ð“WŠJ‚·‚é +%R QSLŽó—̃}[ƒN‚ð“WŠJ‚·‚é +%ENV Ž©‹ÇŠÂ‹«•Ï”‚ð“WŠJ‚·‚é +%OPT1 Opt1‚ð“WŠJ‚·‚é +%OPT2 Opt2‚ð“WŠJ‚·‚é +%USR1 Usr1‚ð“WŠJ‚·‚é +%USR2 Usr2‚ð“WŠJ‚·‚é + +ã‹LˆÈŠO‚Ì•¶Žš—ñ‚Í‚»‚Ì•¶Žš—ñ‚ª‚»‚̂܂ܓWŠJ‚³‚ê‚Ü‚·B + + Max‚ðŽw’è‚·‚邯“WŠJ‚·‚é•¶Žš—ñ‚Í‚»‚Ì’·‚³‚ŧŒÀ‚³‚ê‚Ü‚·B‹æØ‚è‚È‚µƒeƒLƒXƒg‚ÌꇂÍMax‚Ì•‚ŌŒ肳‚ê‚Ü‚·B + Max=0‚ÌꇂÍA•¶Žš—ñ‚Ì’·‚³‚̧ŒÀ‚͂Ȃ­‚È‚è‚Ü‚·B‹æØ‚è‚È‚µƒeƒLƒXƒg‚Ìê‡A“WŠJ‚³‚ê‚é•¶Žš—ñ‚Ì•‚͌Œ肳‚ê‚È‚­‚È‚è‚Ü‚·B + + uUTCv‚̃`ƒFƒbƒN‚ð•t‚¯‚邯“ú•t‚ÆŽž‚ÍUTC‚Åo—Í‚³‚ê‚Ü‚·B + uh‚ň͂Þv‚Ƀ`ƒFƒbƒN‚ð•t‚¯‚邯‚·‚ׂẰ–Ú‚ªƒ_ƒuƒ‹•¶Žš‚ň͂܂ê‚Ü‚·B + +---------------------------------- +›ƒeƒLƒXƒgƒtƒ@ƒCƒ‹‚©‚ç‚̃Cƒ“ƒ|[ƒg +---------------------------------- + ƒtƒ@ƒCƒ‹ƒƒjƒ…[‚ÌuƒCƒ“ƒ|[ƒgv‚ð‘I‘ð‚·‚é‚ÆAƒƒOƒf[ƒ^‚ª‹LÚ‚³‚ꂽƒeƒLƒXƒgƒtƒ@ƒCƒ‹‚ðƒ[ƒh‚µ‚Ü‚·i1s‚ɂ͂PQSO•ª‚̃f[ƒ^‚ª‹LÚ‚³‚ê‚Ä‚¢‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñjB + ƒ[ƒh‚·‚éƒeƒLƒXƒgƒtƒ@ƒCƒ‹‚Ì‘Ž®‚ÍŽŸ‚Ì‚R‚‚̂¤‚¿‚Ì‚¢‚¸‚ê‚©‚Å‚·B + + EƒJƒ“ƒ}‹æØ‚èƒeƒLƒXƒgƒtƒ@ƒCƒ‹iCSVŒ`Ž®j + ETAB‹æØ‚èƒeƒLƒXƒgƒtƒ@ƒCƒ‹ + E‹æØ‚è‚È‚µƒeƒLƒXƒgƒtƒ@ƒCƒ‹ + + ‚Ü‚½Å‘å‚U‚SŒÂ‚̃tƒB[ƒ‹ƒh‚ɂ‚¢‚ÄA‚»‚ꂼ‚ê‚̃tƒB[ƒ‹ƒh‚ð‚ǂ̂悤‚ɕϊ·‚·‚é‚©‚ðuƒGƒNƒXƒ|[ƒgv‚ʼnðà‚µ‚½‚̂Ɠ¯‚¶•ÏŠ·Ž®‚Å’è‹`‚Å‚«‚Ü‚·B + + uUTCv‚̃`ƒFƒbƒN‚ð•t‚¯‚邯“ú•t‚ÆŽž‚ÍUTC‚Æ‚µ‚ÄJST‚ɕϊ·‚µ‚ēǂ݂±‚Ü‚ê‚Ü‚·B + + +------------------- +›MMLOG‚Ì‹L˜^ƒf[ƒ^ +------------------- + + MMLOGƒf[ƒ^ƒtƒH[ƒ}ƒbƒg‚ªˆµ‚¤‚±‚Ƃ̂ł«‚éQSOƒf[ƒ^‚͈ȉº‚Ì’Ê‚è‚Å‚·B + + Date - ‹KŠi‰»‚³‚ê‚Ä‚¢‚é(—Ⴆ‚Î95.12.23) + JST(ŠJŽnŽž) - ‹KŠi‰»‚³‚ê‚Ä‚¢‚é(—Ⴆ‚Î2104) + END(I—¹Žž) - ‹KŠi‰»‚³‚ê‚Ä‚¢‚é(—Ⴆ‚Î2104) + Call - 16 ”CˆÓ‚Ì•¶Žš—ñ + M(ŒÄo‚µƒ}[ƒN) - 1 •¶ŽšƒR[ƒh + RST(His,My) - 20 ”CˆÓ‚Ì•¶Žš—ñ + Band - ‹KŠi‰»‚³‚ê‚Ä‚¢‚é(14.025‚̂悤‚È“ü—͉͂”\) + Mode - ‹KŠi‰»‚³‚ê‚Ä‚¢‚é(CW,SSB,AM,FM,RTTY“™) + Pow - 4 •¶Žš—ñ + Name - 16 ”CˆÓ‚Ì•¶Žš—ñ + QTH - 28 ”CˆÓ‚Ì•¶Žš—ñ + Rem - 56 ”CˆÓ‚Ì•¶Žš—ñ + QSL - 54 ”CˆÓ‚Ì•¶Žš—ñ + S(QSL Send) - 1 •¶ŽšƒR[ƒh + R(QSL Recv) - 1 •¶ŽšƒR[ƒh + Env(Ž©‹ÇŠÂ‹«) - 1`65535‚܂ł̔’l + Opt1 - 8 ”CˆÓ‚Ì•¶Žš—ñ + Opt2 - 8 ”CˆÓ‚Ì•¶Žš—ñ + Usr1 - 8 ”CˆÓ‚Ì•¶Žš—ñiHisRST‚Æ‹¤—pj + Usr2 - 8 ”CˆÓ‚Ì•¶Žš—ñiMyRST‚Æ‹¤—pj + + + Šeƒf[ƒ^‚ɂ‚¢‚ĉðà‚µ‚Ü‚·B + +1.“ú•t(Date) +~~~~~~~~~~~~ + “ú•t‚ð“ü—Í‚µ‚Ü‚·BuQSOvƒ{ƒ^ƒ“‚ð‰Ÿ‚·‚ÆŽ©“®“I‚É“ú•t‚Íݒ肳‚ê‚Ü‚·‚Ì‚ÅAŽè“®‚Å“ü—Í‚·‚é•K—v‚͂قƂñ‚Ç‚ ‚è‚Ü‚¹‚ñB + “ü—Í‚·‚é“ú•t‚ÍAuyy.mm.ddv‚ÌŒ`Ž®‚Å‚·B + +95.11.10 ‚P‚X‚X‚T”NA‚P‚PŒŽA‚P‚O“ú + + ƒƒOÝ’è‰æ–Ê‚ÅTimeZone‚ðuJapanv‚É‚µ‚Ä‚¢‚éê‡A“ú•t‚͗Ⴆ‘ŠŽè‹Ç‚ª‚c‚w‚Å‚ ‚Á‚Ä‚àí‚ÉJST‚Å“ü—Í‚µ‚ĉº‚³‚¢B‚Ü‚½TimeZone‚ðuUTCv‚É‚µ‚Ä‚¢‚éê‡‚Í +í‚ÉUTC‚Å“ü—Í‚µ‚ĉº‚³‚¢B +@‚¢‚¸‚ê‚ÌꇂłàMMQSL‚Í‘ŠŽè‹Ç‚ªDX‚Ìꇎ©“®“I‚ÉUTC‚É’²®‚µ‚½“ú•t‚ðˆóü‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B + + +2.ŠJŽnŽž(JST) +~~~~~~~~~~~~~~~ + ŠJŽnŽž‚ð“ü—Í‚µ‚Ü‚·BuQSOvƒ{ƒ^ƒ“‚ð‰Ÿ‚·‚ÆŽ©“®“I‚É“ú•t‚Íݒ肳‚ê‚Ü‚·‚Ì‚ÅAŽè“®‚Å“ü—Í‚·‚é•K—v‚͂قƂñ‚Ç‚ ‚è‚Ü‚¹‚ñB + “ü—Í‚·‚鎞‚ÍAuhhmmv‚ÌŒ`Ž®‚Å‚·B + +2134 ‚Q‚PŽž‚R‚S•ª + + + ƒƒOÝ’è‰æ–Ê‚ÅTimeZone‚ðuJapanv‚É‚µ‚Ä‚¢‚éê‡AŽž‚͗Ⴆ‘ŠŽè‹Ç‚ª‚c‚w‚Å‚ ‚Á‚Ä‚àí‚ÉJST‚Å“ü—Í‚µ‚ĉº‚³‚¢B‚Ü‚½TimeZone‚ðuUTCv‚É‚µ‚Ä‚¢‚éê‡‚Í +í‚ÉUTC‚Å“ü—Í‚µ‚ĉº‚³‚¢B +@‚¢‚¸‚ê‚ÌꇂłàMMQSL‚Í‘ŠŽè‹Ç‚ªDX‚Ìꇎ©“®“I‚ÉUTC‚É’²®‚µ‚½“ú•t‚ðˆóü‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B + + +3.ƒR[ƒ‹ƒTƒCƒ“(Call) +~~~~~~~~~~~~~~~~~~~~ + ‘ŠŽè‹Ç‚̃R[ƒ‹ƒTƒCƒ“‚ð“ü—Í‚µ‚Ü‚·BŽóM‰æ–ʂ̃R[ƒ‹ƒTƒCƒ“•”•ª‚ðƒNƒŠƒbƒN‚·‚邯ީ“®“I‚É“ü—Í‚³‚ê‚Ü‚·‚Ì‚ÅAŽè“®‚Å“ü—Í‚·‚é•K—v‚͂قƂñ‚ǂȂ¢‚Å‚µ‚傤B + + “ü—Í‚·‚éƒR[ƒ‹ƒTƒCƒ“‚͈ȉº‚Ì—á‚ÉŽ¦‚·‚悤‚ɂǂ̂悤‚ÈŒ`Ž®‚Å‚à\‚¢‚Ü‚¹‚ñBÅ‘å‚P‚U•¶Žš‚܂œü—Í‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B + + JI3IVL + JI3IVL/M + JI3IVL/MM + JI3IVL/3 + JI3IVL/P + JI3IVL/QRP + JI3IVL/JD1 + KH0/JI3IVL + SV/JI3IVL/A + R1/JI3IVL/FJL + JI3IVL/JE3HHT + JI3IVL/MAKO + JI3IVL/MAKO/3 + + ƒR[ƒ‹ƒTƒCƒ“‚Í•K‚¸‘å•¶ŽšiƒAƒbƒp[ƒP[ƒXj‚ɕϊ·‚³‚ê‚Ü‚·B + + +4.ŒÄo‚µƒ}[ƒN(M) +~~~~~~~~~~~~~~~~~ + Ž©‹Ç‚ª‘ŠŽè‹Ç‚ðŒÄ‚Ño‚µ‚½‚©AŽ©‹Ç‚ª‘ŠŽè‹Ç‚©‚ç‚ÌŒÄo‚µ‚ɉž“š‚µ‚½‚©‚ð‹L†‚Å“ü—Í‚µ‚Ü‚·B‹L†‚ɂ͉½‚ðŽg—p‚µ‚Ä‚à\‚¢‚Ü‚¹‚ñ‚ªAMMTTY‚ªŽ©“®Ý’è‚·‚é‚͈̂ȉº‚Ì’Ê‚è‚Å‚·B + + C Ž©‹Ç‚ª‘ŠŽè‹Ç‚ðŒÄ‚Ño‚µ‚½iRunningƒ‚[ƒh‚ÌŽžj + A ‘ŠŽè‹Ç‚ªŽ©‹Ç‚ðŒÄ‚Ño‚µ‚½iS&Pƒ‚[ƒh‚ÌŽžj + + ‚±‚Ìî•ñ‚Í•K—v‚ª‚È‚¯‚ê‚Γü—Í‚·‚é•K—v‚Í‚ ‚è‚Ü‚¹‚ñ‚µA‘¼‚Ì®—ƒ}[ƒN‚Æ‚µ‚ÄŽg—p‚µ‚Ä‚à\‚¢‚Ü‚¹‚ñB + + +5.‘ŠŽè‹Ç‚Ì‚q‚r‚s(His) +~~~~~~~~~~~~~~~~~~~~~ + ‘ŠŽè‹Ç‚ÌM†‹­“x‚ð‚q‚r‚s‚Å“ü—Í‚µ‚Ü‚·BƒRƒ“ƒeƒXƒg‚ðl—¶‚µ‚ÄÅ‘å‚Q‚O•¶Žš‚܂œü—͂ł«‚Ü‚·B + + +6.Ž©‹Ç‚Ì‚q‚r‚s(My) +~~~~~~~~~~~~~~~~~~ + i‘ŠŽè‹Ç‚©‚ç“`‚¦‚ç‚ꂽjŽ©‹Ç‚ÌM†‹­“x‚ð‚q‚r‚s‚Å“ü—Í‚µ‚Ü‚·BƒRƒ“ƒeƒXƒg‚ðl—¶‚µ‚ÄÅ‘å‚Q‚O•¶Žš‚܂œü—͂ł«‚Ü‚·B + + +7.ƒoƒ“ƒh‚Ü‚½‚ÍŽü”g”(Band) +~~~~~~~~~~~~~~~~~~~~~~~~~~ + ƒoƒ“ƒh‚Ü‚½‚ÍŽü”g”‚ð“ü—Í‚µ‚Ü‚·BˆÈ‰º‚̃oƒ“ƒhƒR[ƒh‚Ü‚½‚ÍŽü”g””͈͂ð“ü—Í‚·‚鎖‚ª‚Å‚«‚Ü‚·B + + ƒAƒ}ƒ`ƒ…ƒAƒoƒ“ƒh ƒoƒ“ƒhƒR[ƒh “ü—͉”\Žü”g””ÍˆÍ + + ‚PD‚X‚l‚g‚š‘Ñ 1.9 or 1.8 1.000`1.999 + ‚RD‚T‚l‚g‚š‘Ñ 3.5 3.000`3.699 + ‚RD‚W‚l‚g‚š‘Ñ 3.8 3.700`3.999 + ‚V‚l‚g‚š‘Ñ 7 7.000`7.999 + ‚P‚O‚l‚g‚š‘Ñ 10 10.000`10.999 + ‚P‚S‚l‚g‚š‘Ñ 14 14.000`14.999 + ‚P‚W‚l‚g‚š‘Ñ 18 18.000`18.999 + ‚Q‚P‚l‚g‚š‘Ñ 21 21.000`21.999 + ‚Q‚S‚l‚g‚š‘Ñ 24 24.000`24.999 + ‚Q‚W‚l‚g‚š‘Ñ 28 28.000`29.999 + ‚T‚O‚l‚g‚š‘Ñ 50 50.000`53.999 + ‚P‚S‚S‚l‚g‚š‘Ñ 144 144.000`149.999 + ‚S‚R‚O‚l‚g‚š‘Ñ 430 430.000`439.999 + ‚P‚Q‚O‚O‚l‚g‚š‘Ñ 1200 1240.00`1299.99 + ‚Q‚S‚O‚O‚l‚g‚š‘Ñ 2400 2350.00`2449.99 + ‚T‚U‚O‚O‚l‚g‚š‘Ñ 5600 + ‚P‚OD‚P‚f‚g‚š‘Ñ 10.1G + ‚P‚OD‚S‚f‚g‚š‘Ñ 10.4G + ‚Q‚S‚f‚g‚š‘Ñ 24G + ‚S‚V‚f‚g‚š‘Ñ 47G + ‚V‚T‚f‚g‚š‘Ñ 75G + ‚P‚S‚Q‚f‚g‚š‘Ñ 142G + ‚Q‚S‚W‚f‚g‚š‘Ñ 248G + ‚S‚U‚R‚O‚j‚g‚š 4630 + + Žü”g”‚ð“ü—Í‚·‚éꇂÍAã‹L‚ÉŽ¦‚·”͈͂Åu14.025v‚̂悤‚É“ü—Í‚µ‚Ü‚·BŽ„‚ÌꇂÍA•’ʂ̓oƒ“ƒh‚݂̂ð“ü—Í‚µ‚Ä‚¢‚Ü‚·‚ªA‘ŠŽè‚ª’¿‹Ç“™‚Ìꇂ͌ã“ú‚ÌŽQl‚Ì‚½‚߂Ɏü”g”‚܂œü—Í‚µ‚Ä‚¢‚Ü‚·B + + ƒNƒƒXƒoƒ“ƒhi‰q¯j‚ÌꇂÍA<21/144>‚̂悤‚É“ü—Í‚µ‚ĉº‚³‚¢B‚±‚Ìꇃoƒ“ƒhƒR[ƒh‚݂̂̑g‚݇‚킹‚µ‚©“ü—͂ł«‚Ü‚¹‚ñB + + +8.ƒ‚[ƒh(Mode) +~~~~~~~~~~~~~ + ƒ‚[ƒhi“d”gŒ`Ž®j‚ðŽŸ‚Ì‚æ‚¤‚ȃL[ƒ[ƒh‚Å“ü—Í‚µ‚Ü‚·BMMTTY‚Å‚Íí‚ɃfƒtƒHƒ‹ƒg‚ÍRTTY‚ɂȂÁ‚Ä‚¢‚Ü‚·B + + CW,SSB,AM,FM,RTTY,PAC,FAX,SSTV,ATV,TV,FSTV, + A1,A2,A3,A3A,A3H,A3J,A4,A5,A5C,A5J,A9,A9C, + F1,F2,F3,F4,F5,F9, + P0,P1,P2D,P2E,P2F,P3D,P3E,P3F,P9, + PSK, BPSK, QPSK, HELL, MFSK + + +9.‘ŠŽè‹Ç‚Ì–¼‘O(Name) +~~~~~~~~~~~~~~~~~~~~ + ‘ŠŽè‹Ç‚Ì–¼‘O‚ð“ü—Í‚µ‚Ü‚·BÅ‘å‚P‚U•¶Žš‚܂œü—͂ł«‚Ü‚·B‚±‚Ì€–Ú‚ÍŽóM‰æ–Ê“à‚ÌŠY“–‚·‚é•¶Žš—ñ‚ðƒ}ƒEƒX‚ŃNƒŠƒbƒN‚µ‚Ä“ü—Í‚·‚邱‚Æ‚à‚Å‚«‚Ü‚·B + + +10.‘ŠŽè‹Ç‚Ì‚p‚s‚g(QTH) +~~~~~~~~~~~~~~~~~~~~~~ + ‘ŠŽè‹Ç‚Ì‚p‚s‚g‚ð“ü—Í‚µ‚Ü‚·BÅ‘å‚Q‚W•¶Žš‚܂œü—͂ł«‚Ü‚·B‚±‚Ì€–Ú‚ÍŽóM‰æ–Ê“à‚ÌŠY“–‚·‚é•¶Žš—ñ‚ðƒ}ƒEƒX‚ŃNƒŠƒbƒN‚µ‚Ä“ü—Í‚·‚邱‚Æ‚à‚Å‚«‚Ü‚·B + +*ŽóM‰æ–ʂ̃NƒŠƒbƒN“ü—Í‚ÍAƒfƒtƒHƒ‹ƒg‚ÍNAME‚ð“ü—Í‚·‚éó‘ԂɂȂÁ‚Ä‚¢‚Ü‚·‚Ì‚ÅAQTH‚ðƒNƒŠƒbƒN“ü—Í‚·‚éꇂÍAŽóM‰æ–ʂ̂·‚®ã‚Ì'Name'‚Ì•¶Žš‚ðƒNƒŠƒbƒN‚µ‚ÄŽæ‚肱‚Ýæ‚ðØ‚è‘Ö‚¦‚Ä‚­‚¾‚³‚¢B + + +11.”õl(Rem) +~~~~~~~~~~~~ + ‘ŠŽè‹Ç‚ÉЉ‚Ä‚à‚ç‚Á‚½‚v‚w‚â‚q‚h‚fA‚»‚Ì‘¼‚ÌŒðM’†‚Ì“ÁŽê‚Èî•ñ“™‚ð“ü—Í‚µ‚Ü‚·BÅ‘å‚T‚U•¶Žš‚܂œü—͂ł«‚Ü‚·B + + +12.‚p‚r‚kî•ñ(QSL) +~~~~~~~~~~~~~~~~~~ + ‚p‚r‚kƒ}ƒl[ƒWƒƒ‚̃R[ƒ‹ƒTƒCƒ“‚âA‘ŠŽè‹Ç‚ªŽw’肵‚Ä‚«‚½ZŠ‚È‚Ç‚Ì‚p‚r‚kî•ñ‚ð“ü—Í‚µ‚Ü‚·BÅ‘å‚T‚S•¶Žš‚܂œü—͂ł«‚Ü‚·Bƒrƒ…[ƒŒo—R‚Å‚p‚r‚kƒ}ƒl[ƒWƒƒˆ¶‚ɃJ[ƒh‚ð‘—•t‚µ‚½‚¢ê‡‚ÍA‚p‚r‚kƒ}ƒl[ƒWƒƒ‚̃R[ƒ‹ƒTƒCƒ“‚Ìæ“ª‚É<@>‚ð•t‰Á‚µ‚Ä“ü—Í‚µ‚ĉº‚³‚¢BMMQSL‚Í‚±‚̃tƒB[ƒ‹ƒh‚É<@>ƒR[ƒh‚ª‚ ‚éê‡A‚»‚ê‚É‘±‚­ƒR[ƒ‹ƒTƒCƒ“‚ð“]‘—˜g‚Ɉ󎚂·‚邿‚¤‚ɉð“Ç‚µ‚Ü‚·B‚Ü‚½A‚±‚̃tƒB[ƒ‹ƒh‚É<$>,<~>,<^>ƒR[ƒh‚ň͂܂ꂽ•¶Žš—ñ‚ª‚ ‚éê‡A‚»‚ꂼ‚ê‚Ì•¶Žš—ñ‚ð”CˆÓ‚̈ʒu‚É“WŠJ‚·‚邱‚Æ‚à‚Å‚«‚Ü‚·iMMQSL‚ÍKey[...]Œ`Ž®‚Ì•\‹L‚àˆµ‚¤‚±‚Æ‚ª‚Å‚«‚Ü‚·BÚׂÍMMQSL‚̃}ƒjƒ…ƒAƒ‹‚ÌuLOG200ƒL[v‚ðŽQÆ‚µ‚ĉº‚³‚¢jB + + Ž„‚Ìꇂ͈ȉº‚̂悤‚É‹Lq‚µ‚Ä®—‚µ‚Ä‚¢‚Ü‚·B + + @JI3IVL ƒrƒ…[ƒŒo—R‚Ń}ƒl[ƒWƒƒJI3IVL‚É“]‘— + JI3IVL JI3IVL‚ÌZЂɑ—•t + BOX88,MOSCOW,USSR ‹LÚ‚³‚ꂽZЂɑ—•t + CBA95 ‚X‚T”N“x”ŃR[ƒ‹ƒuƒbƒN‚ÌZЂɑ—•t + +¦ ‚p‚r‚kî•ñ‚ÉŒÀ‚炸A”õl‚Æ‚µ‚Ä‚àŽg—p‚Å‚«‚Ü‚·B + + +13.I—¹Žž(End) +~~~~~~~~~~~~~~~~ + I—¹Žž‚ð“ü—Í‚µ‚Ü‚·B“ü—Í‚·‚鎞‚ÍŠJŽnŽž‚Æ“¯‚¶Œ`Ž®‚Å‚·B‚±‚Ì€–Ú‚ÍQSOƒ{ƒ^ƒ“‚ð‰Ÿ‚·‚ÆŽ©“®“I‚Éݒ肳‚ê‚Ü‚·‚̂Ŏ蓮‚Å“ü—Í‚·‚é•K—v‚Í‚ ‚è‚Ü‚¹‚ñB + + +14.‚p‚r‚k”­sƒ}[ƒN(S) +~~~~~~~~~~~~~~~~~~~~~~ + ‚p‚r‚k‚ð”­s‚µ‚½‚©‚Ç‚¤‚©‚ðƒ`ƒFƒbƒN‚·‚éƒ}[ƒN‚Å‚·B‹L†‚݂͂Ȃ³‚ÌŽ©—R‚Å‚·‚ªAŽ„‚Ìꇂ͈ȉº‚̂悤‚É‚µ‚Ä‚¢‚Ü‚·B + + N ‚m‚n ‚p‚r‚k + - ƒrƒ…[ƒŒo—R‚Å“]‘—Ï‚Ý + p ƒyƒ“ƒfƒBƒ“ƒOi‚p‚r‚kƒ}ƒl[ƒWƒƒ•s–¾“™j + d ƒ_ƒCƒŒƒNƒg‚Å‘—•t‚·‚é—\’è + s ‚r‚`‚r‚d‚Ü‚½‚Í‚r‚`‚d‚Å¿‹‚·‚é—\’è + D ƒ_ƒCƒŒƒNƒg‚Å‘—•tÏ‚Ý + S ‚r‚`‚r‚d‚Ü‚½‚Í‚r‚`‚d‚Å¿‹Ï‚Ý + i‰½‚à“ü—Í‚µ‚È‚¢ê‡‚̓rƒ…[ƒŒo—R‚Å“]‘——\’è‚Æ‚µ‚Ĉµ‚Á‚Ä‚¢‚Ü‚·Bj + + +15.‚p‚r‚kŽó—̃}[ƒN(R) +~~~~~~~~~~~~~~~~~~~~~~ + ‚p‚r‚k‚ðŽó—Ì‚µ‚½‚©‚Ç‚¤‚©‚ðƒ`ƒFƒbƒN‚·‚éƒ}[ƒN‚Å‚·B‹L†‚݂͂Ȃ³‚ñ‚ÌŽ©—R‚Å‚·BŽ„‚ÌꇂÍAˆÈ‰º‚̂悤‚È‹L†‚Ń`ƒFƒbƒN‚µ‚Ä‚¢‚Ü‚·B + + - ƒrƒ…[ƒŒo—R‚ÅŽó—Ì + D ƒ_ƒCƒŒƒNƒg‚ÅŽó—Ì + S ‚r‚`‚r‚d‚Ü‚½‚Í‚r‚`‚d‚Å¿‹‚³‚ꂽ + I –³Œø‚ȃJ[ƒhiDXCC‚ɸڼޯĂ³‚ê‚È‚¢“™j + + +16.Ž©‹ÇŠÂ‹«ƒR[ƒh(Env) +~~~~~~~~~~~~~~~~~~~~~~ + Ž©‹Ç‚̉^—pŠÂ‹«‚ð‚P`‚U‚T‚T‚R‚T‚͈̔͂̔’l‚Å“ü—Í‚µ‚Ü‚·B—Ⴆ‚ÎŽ„‚ÌꇂÍAˆ¢”{–ì‚©‚炒΂Ɉø‚Á‰z‚µ‚½‚Ì‚ÅAˆ¢”{–쎞‘ã‚Í‚PA‚’΂©‚ç‚Í‚Q‚̂悤‚É‹L˜^‚µAˆÚ“®‰^—p‚ÌÛ‚É‚ÍA‚»‚̈ړ®’n‚Ì‚i‚b‚bE‚i‚b‚f”Ô†‚ð‹L˜^‚µ‚Ä‚¢‚Ü‚·B‚Ü‚½ƒRƒ“ƒeƒXƒg“™‚ŕʂ̔Ԇ‚ðŠ„‚èU‚é‚Ì‚à—Ç‚¢‚©‚à‚µ‚ê‚Ü‚¹‚ñBŒ‹¥‚ȂǂŎ©•ª‚Ì–¼‘O‚ª•Ï‚í‚Á‚½ê‡‚àA‚±‚̔Ԇ‚ð•ÏX‚·‚邯—Ç‚¢‚Å‚µ‚傤B + + +17.ƒIƒvƒVƒ‡ƒ“‚P(Opt1)^ƒIƒvƒVƒ‡ƒ“‚Q(Opt2) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Žå‚ɃRƒ“ƒeƒXƒg‚ÌۂɃ}ƒ‹ƒ`‚⓾“_‚ð“]‹L‚·‚éƒtƒB[ƒ‹ƒh‚Æ‚µ‚ÄŽg—p‚µ‚Ü‚·BŒ»ó‚ÌMMTTY‚Í‚ÉDXƒGƒ“ƒeƒBƒeƒB–¼A‚ɑ嗤–¼‚ð“]‹L‚·‚邾‚¯‚ÅAƒRƒ“ƒeƒXƒgƒiƒ“ƒo“™‚ðŽ©“®“I‚É“]‹L‚·‚é‹@”\‚Í‘g‚Ýž‚Ü‚ê‚Ä‚¢‚Ü‚¹‚ñB + + +18.ƒ†[ƒU‚P(Usr1)^ƒ†[ƒU‚Q(Usr2) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ‚±‚Ì€–Ú‚Íiƒ†[ƒU‚Q‚ÌꇂÍj‚ÌÅŒã‚Ì‚W•¶Žš‚̗̈æ‚ð‹¤—p‚ÅŽg—p‚·‚é“Á•ʂȀ–Ú‚Å‚·B‚±‚Ì€–ڂɃf[ƒ^‚ð“ü—Í‚µ‚½ŒãA€–Úij‚É‚P‚P•¶ŽšˆÈã‚Ì“ü—Í‚ðs‚¤‚ÆA‚±‚Ì€–Ú‚Ì“à—e‚ÍŽ¸‚í‚ê‚Ü‚·B + ‚Ü‚½€–Úij‚É‚P‚P•¶ŽšˆÈã‚Ì‹LÚ‚ª‚ ‚éꇂÉA‚±‚Ì€–ڂɃf[ƒ^‚ð“ü—Í‚·‚邯Aij‚Ì‚P‚P•¶Žš–ÚˆÈ~‚ðŽ¸‚¢‚Ü‚·B + + ‚±‚Ì€–Ú‚ÍÅ‘å‚W•¶Žš‚܂œü—͂ł«‚Ü‚·B + + Žå‚ɃRƒ“ƒeƒXƒg‚ÌۂɃ}ƒ‹ƒ`‚⓾“_‚ð“]‹L‚·‚éƒtƒB[ƒ‹ƒh‚Æ‚µ‚ÄŽg—p‚µ‚Ü‚·BŒ»ó‚ÌMMTTY‚Í‚±‚̃tƒB[ƒ‹ƒh‚ÉŽ©“®“I‚É“]‹L‚·‚é‹@”\‚ª‘g‚Ýž‚Ü‚ê‚Ä‚¢‚Ü‚¹‚ñD + \ No newline at end of file diff --git a/mmw.h b/mmw.h new file mode 100644 index 0000000..528a77c --- /dev/null +++ b/mmw.h @@ -0,0 +1,46 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +#ifndef MMW_H +#define MMW_H + +typedef void (__stdcall *tmmwPumpMessages)(void); +typedef LONG (__stdcall *tmmwGetTimeout)(void); +typedef void (__stdcall *tmmwSetPTT)(LONG tx); + +typedef LONG (__stdcall *tmmwInOpen)(DWORD sampfreq, DWORD size); +typedef void (__stdcall *tmmwInClose)(void); +typedef BOOL (__stdcall *tmmwInRead)(SHORT *buf); + +typedef LONG (__stdcall *tmmwGetInExist)(void); +typedef BOOL (__stdcall *tmmwIsInCritical)(void); + +typedef LONG (__stdcall *tmmwOutOpen)(DWORD sampfreq, DWORD size); +typedef void (__stdcall *tmmwOutAbort)(void); +typedef void (__stdcall *tmmwOutFlush)(void); +typedef BOOL (__stdcall *tmmwOutWrite)(const SHORT *buf); + +typedef BOOL (__stdcall *tmmwIsOutCritical)(void); +typedef BOOL (__stdcall *tmmwIsOutFull)(void); +typedef LONG (__stdcall *tmmwGetOutRemaining)(void); +typedef LONG (__stdcall *tmmwGetOutCounter)(void); +typedef void (__stdcall *tmmwSetOutCounter)(LONG count); + +#endif + diff --git a/my.res b/my.res new file mode 100644 index 0000000..39cdf0d Binary files /dev/null and b/my.res differ diff --git a/radioset.cpp b/radioset.cpp new file mode 100644 index 0000000..910c63a --- /dev/null +++ b/radioset.cpp @@ -0,0 +1,562 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba, Dave Bernstein +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//--------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "RadioSet.h" +#include "Main.h" +//--------------------------------------------------------------------- +#pragma resource "*.dfm" + +//Define Maker groups; index is used by IsCompatible to select the correct Maker based on PollType (RADIO_POLLx) +LPCSTR __MK[]={ + "Yaesu FT 1000D, 1000MP, 920", //AA6YQ 1.66 cosmetic, MakerIndex=0 + "Yaesu FT 9000, 2000, 950, 450", //AA6YQ 1.66 , MakerIndex=1 + "Yaesu FT 736, 817, 847, 857, 897", //AA6YQ 1.66 cosmetic, MakerIndex=2 + "Icom xx=addr 01-7F", // , MakerIndex=3 + "Ten-Tec Omni VI xx=addr 00-64", // , MakerIndex=4 + "Kenwood, Elecraft ", // , MakerIndex=5 + "JRC JST-245", // , MakerIndex=6 + "Clear", // , MakerIndex=6 + NULL, // , MakerIndex=8 +}; +LPCSTR __MT[][3]={ + {"", "\\$000000000F", "\\$000000010F\\w10" }, + {"", "TX0;", "TX1;\\w10" }, //AA6YQ 1.66 + {"\\$0000000000", "\\$0000000088", "\\$0000000008\\w10" }, + {"", "\\$FEFExxE01C0000FD", "\\$FEFExxE01C0001FD\\w10" }, + {"", "\\$FEFExxE01602FD", "\\$FEFExxE01601FD\\w10" }, + {"", "RX;", "TX;\\w10" }, + {"", "H1\\rX0\\rH0\\r", "H1\\rX1\\rH0\\r\\w10" }, + {"", "", "" }, +}; + +#define MAKER_UNKNOWN 6 + +typedef struct { + LPCSTR pKey; + int r; +}POLLDEF; + +//Define a VFO group for each Maker Index + +const POLLDEF __VT0[]={ + { "NONE", 0 }, + { "FT-1000D", RADIO_POLLFT1000D }, + { "FT-1000MP", RADIO_POLLYAESUHF }, + { "FT-920", RADIO_POLLFT920 }, + { NULL, 0 }, +}; + +const POLLDEF __VT1[]={ + { "NONE", 0 }, + { "FT-9000", RADIO_POLLFT9000 }, //1.66B AA6YQ + { "FT-2000", RADIO_POLLFT2000 }, //1.66B AA6YQ + { "FT-950", RADIO_POLLFT950 }, //1.66B AA6YQ + { "FT-450", RADIO_POLLFT450 }, //1.66B AA6YQ + { NULL, 0 }, +}; + +const POLLDEF __VT2[]={ + { "NONE", 0 }, + { "FT-817, 847, 857, 897", RADIO_POLLYAESUVU }, + { NULL, 0 }, +}; +const POLLDEF __VT3[]={ + { "NONE", 0 }, + { "Icom CI-V", RADIO_POLLICOM }, + { "Icom CI-V (no inquiry)", RADIO_POLLICOMN }, + { NULL, 0 }, +}; +const POLLDEF __VT4[]={ + { "NONE", 0 }, + { "Ten-Tec Omni VI", RADIO_POLLOMNIVI }, + { "Ten-Tec Omni VI (no inquiry)", RADIO_POLLOMNIVIN }, + { NULL, 0 }, +}; +const POLLDEF __VT5[]={ + { "NONE", 0 }, + { "Kenwood, Elecraft", RADIO_POLLKENWOOD }, + { "Kenwood, Elecraft (use auto info)", RADIO_POLLKENWOODN }, + { NULL, 0 }, +}; +const POLLDEF __VT6[]={ + { "NONE", 0 }, + { "JST245", RADIO_POLLJST245 }, + { "JST245 (use auto info)", RADIO_POLLJST245N }, + { NULL, 0 }, +}; + + + +const POLLDEF __VTUNKNOWN[]={ + { "NONE", 0 }, + { "YAESU FT-1000MP", RADIO_POLLYAESUHF }, + { "YAESU FT-1000D", RADIO_POLLFT1000D }, + { "YAESU FT-920", RADIO_POLLFT920 }, + { "YAESU FT-847", RADIO_POLLYAESUVU }, + { "ICOM CI-V", RADIO_POLLICOM }, + { "ICOM CI-V (no inquiry)", RADIO_POLLICOMN }, + { "Ten-Tec Omni VI", RADIO_POLLOMNIVI }, + { "Ten-Tec Omni VI (no inquiry)", RADIO_POLLOMNIVIN }, + { "KENWOOD", RADIO_POLLKENWOOD }, + { "KENWOOD (use auto info)", RADIO_POLLKENWOODN }, + { "JST245", RADIO_POLLJST245 }, + { "JST245 (use auto info)", RADIO_POLLJST245N }, + { "YAESU FT-9000", RADIO_POLLFT9000 }, //1.66B AA6YQ + { "YAESU FT-2000", RADIO_POLLFT2000 }, //1.66B AA6YQ + { "YAESU FT-950", RADIO_POLLFT950 }, //1.66B AA6YQ + { "YAESU FT-450", RADIO_POLLFT450 }, //1.66B AA6YQ + { NULL, 0 }, +}; +const POLLDEF *__VL[]={ + __VT0, __VT1, __VT2, __VT3, __VT4, __VT5, __VT6, __VTUNKNOWN, NULL, +}; +//--------------------------------------------------------------------- +__fastcall TRADIOSetDlg::TRADIOSetDlg(TComponent* AOwner) + : TForm(AOwner) +{ + FormStyle = ((TForm *)AOwner)->FormStyle; + Font->Name = ((TForm *)AOwner)->Font->Name; + Font->Charset = ((TForm *)AOwner)->Font->Charset; + if( Font->Charset != SHIFTJIS_CHARSET ){ + CancelBtn->Caption = "Cancel"; + } + int i; + for( i = 0; __MK[i] != NULL; i++ ){ + Maker->Items->Add(__MK[i]); + } + m_InitWidth = CmdInit->Width; + m_PollType = 0; + m_Maker = 0; + m_MMList.QueryList("MMR"); + for( int i = 0; i < m_MMList.GetCount(); i++ ){ + PortName->Items->Insert(1, m_MMList.GetItemName(i)); + } + PortName->DropDownCount = PortName->Items->Count; + m_DisEvent = 0; +} +//--------------------------------------------------------------------- +void __fastcall TRADIOSetDlg::UpdateUI(void) +{ + int f; + if( !strcmpi(AnsiString(PortName->Text).c_str(), "PSKGNR")|| //JA7UDE 0428 + !strcmpi(AnsiString(PortName->Text).c_str(), "WD5GNR")|| //JA7UDE 0428 + !strcmpi(AnsiString(PortName->Text).c_str(), "LOGGER") ){ //JA7UDE 0428 + GCmd->Visible = FALSE; + if( !strcmpi(AnsiString(PortName->Text).c_str(), "LOGGER") ){ //JA7UDE 0428 + GGNR->Visible = FALSE; +// LTNX->Caption = "Thanks to Bob Furzer (K4CY) who is releasing the fine programs."; + } + else { + GGNR->Visible = TRUE; +// LTNX->Caption = "Thanks to Al Williams (WD5GNR) who is releasing the fine programs."; + } + LGNR->Visible = OpenGNR->Checked; + CmdGNR->Visible = OpenGNR->Checked; + RefBtn->Visible = OpenGNR->Checked; + LPTT->Visible = OpenGNR->Checked; + Maker->Visible = FALSE; + LoadBtn->Visible = FALSE; + SaveBtn->Visible = FALSE; + f = FALSE; + } + else { + GGNR->Visible = FALSE; + GCmd->Visible = TRUE; + Maker->Visible = TRUE; + LoadBtn->Visible = TRUE; + SaveBtn->Visible = TRUE; + f = IsXX(); + Lxx->Visible = f; + Cmdxx->Visible = f; + AddrScan->Visible = f && m_PollType; + if( f ){ + CmdInit->Width = m_InitWidth; + } + else { + CmdInit->Width = CmdRx->Width; + } + f = (m_MMList.IndexOf(AnsiString(PortName->Text).c_str()) < 0) ? TRUE : FALSE; //JA7UDE 0428 + } + Label2->Enabled = f; + Baud->Enabled = f; + BitLen->Enabled = f; + Stop->Enabled = f; + Parity->Enabled = f; + GB3->Enabled = f; + flwXON->Enabled = f; + flwCTS->Enabled = f && (!CBPTT->Checked); + CBPTT->Enabled = f; + Label3->Enabled = f; + ByteWait->Enabled = f; + Label8->Enabled = f; + + SBHelp->Visible = !JanHelp.IsEmpty(); +} +//--------------------------------------------------------------------- +int __fastcall TRADIOSetDlg::Execute(void) +{ + PortName->Text = RADIO.StrPort; + Baud->Text = RADIO.BaudRate; + BitLen->ItemIndex = RADIO.BitLen; + Parity->ItemIndex = RADIO.Parity; + Stop->ItemIndex = RADIO.Stop; + flwXON->Checked = RADIO.flwXON; + flwCTS->Checked = RADIO.flwCTS; + CBPTT->Checked = RADIO.usePTT; + + ByteWait->Text = int(RADIO.ByteWait); + + char bf[32]; + sprintf( bf, "%02X", RADIO.Cmdxx); + Cmdxx->Text = bf; + CmdInit->Text = RADIO.CmdInit; + CmdRx->Text = RADIO.CmdRx; + CmdTx->Text = RADIO.CmdTx; + + CmdGNR->Text = RADIO.cmdGNR; + OpenGNR->Checked = RADIO.openGNR; + m_PollType = RADIO.PollType; + PollInt->Text = (RADIO.PollInterval + 5)/10.0; + FreqOffset->ItemIndex = RADIO.PollOffset; + AddrScan->Checked = RADIO.PollScan; + SetMaker(); + UpdateUI(); + if( ShowModal() == IDOK ){ + StrCopy(RADIO.StrPort, AnsiString(PortName->Text).c_str(), 31); //JA7UDE 0428 + int dd; + if( sscanf(AnsiString(Baud->Text).c_str(), "%u", &dd) == 1 ){ //JA7UDE 0428 + RADIO.BaudRate = dd; + } + RADIO.BitLen = BitLen->ItemIndex; + RADIO.Parity = Parity->ItemIndex; + RADIO.Stop = Stop->ItemIndex; + RADIO.flwXON = flwXON->Checked; + RADIO.flwCTS = flwCTS->Checked; + RADIO.usePTT = CBPTT->Checked; + if( sscanf(AnsiString(ByteWait->Text).c_str(), "%u", &dd) == 1 ){ //JA7UDE 0428 + if( (dd >= 0) && (dd <= 1000) ){ + RADIO.ByteWait = dd; + } + } + if( sscanf(AnsiString(Cmdxx->Text).c_str(), "%X", &dd) == 1 ){ //JA7UDE 0428 + RADIO.Cmdxx = dd & 0x000000ff; + } + RADIO.CmdInit = CmdInit->Text; + RADIO.CmdRx = CmdRx->Text; + RADIO.CmdTx = CmdTx->Text; + + RADIO.cmdGNR = CmdGNR->Text; + RADIO.openGNR = OpenGNR->Checked; + + RADIO.PollType = m_PollType; + double d; + if( sscanf(AnsiString(PollInt->Text).c_str(), "%lf", &d) == 1 ){ //JA7UDE 0428 + if( d >= 0.5 ){ + RADIO.PollInterval = int((d * 10.0) - 5); + if( RADIO.PollInterval < 0 ) RADIO.PollInterval = 0; + } + } + RADIO.PollOffset = FreqOffset->ItemIndex; + RADIO.PollScan = AddrScan->Checked; + RADIO.change = 1; + return TRUE; + } + else { + return FALSE; + } +} +//--------------------------------------------------------------------------- +void __fastcall TRADIOSetDlg::LoadBtnClick(TObject *Sender) +{ +// + TOpenDialog *pBox = MmttyWd->OpenDialog; + pBox->Options >> ofCreatePrompt; + pBox->Options << ofFileMustExist; + if(Font->Charset != SHIFTJIS_CHARSET){ + pBox->Title = "Open command file"; + pBox->Filter = "Command files(*.rcm)|*.rcm|"; + } + else { + pBox->Title = "ƒRƒ}ƒ“ƒh’è‹`ƒtƒ@ƒCƒ‹‚ðŠJ‚­"; + pBox->Filter = "ƒRƒ}ƒ“ƒh’è‹`ƒtƒ@ƒCƒ‹(*.rcm)|*.rcm|"; + } + pBox->FileName = ""; + pBox->DefaultExt = "rcm"; + pBox->InitialDir = BgnDir; + NormalWindow(this); + if( pBox->Execute() == TRUE ){ + CWaitCursor w; + TMemIniFile *pIniFile = new TMemIniFile(pBox->FileName); + CmdInit->Text = pIniFile->ReadString("RADIO", "CmdInit", CmdInit->Text); + CmdRx->Text = pIniFile->ReadString("RADIO", "CmdRx", CmdRx->Text); + CmdTx->Text = pIniFile->ReadString("RADIO", "CmdTx", CmdTx->Text); + Cmdxx->Text = pIniFile->ReadString("RADIO", "Cmdxx", Cmdxx->Text); + m_PollType = pIniFile->ReadInteger("RADIO", "PollType", 0); + FreqOffset->ItemIndex = pIniFile->ReadInteger("RADIO", "PollOffset", 5); + PollInt->Text = (pIniFile->ReadInteger("RADIO", "PollInterval", 0) + 5)/10.0; + AddrScan->Checked = 0; + delete pIniFile; + SetMaker(); + UpdateUI(); + } + TopWindow(this); +} +//--------------------------------------------------------------------------- +void __fastcall TRADIOSetDlg::SaveBtnClick(TObject *Sender) +{ + TSaveDialog *pBox = MmttyWd->SaveDialog; + if( (Font->Charset != SHIFTJIS_CHARSET) ){ + pBox->Title = "Save command file"; + pBox->Filter = "Command files(*.rcm)|*.rcm|"; + } + else { + pBox->Title = "ƒRƒ}ƒ“ƒh’è‹`ƒtƒ@ƒCƒ‹‚Ìì¬"; + pBox->Filter = "ƒRƒ}ƒ“ƒh’è‹`ƒtƒ@ƒCƒ‹(*.rcm)|*.rcm|"; + } + pBox->FileName = "MyRIG.rcm"; + pBox->DefaultExt = "rcm"; + pBox->InitialDir = BgnDir; + NormalWindow(this); + if( pBox->Execute() == TRUE ){ + CWaitCursor w; + TMemIniFile *pIniFile = new TMemIniFile(pBox->FileName); + pIniFile->WriteString("RADIO", "CmdInit", CmdInit->Text); + pIniFile->WriteString("RADIO", "CmdRx", CmdRx->Text); + pIniFile->WriteString("RADIO", "CmdTx", CmdTx->Text); + pIniFile->WriteString("RADIO", "Cmdxx", Cmdxx->Text); + pIniFile->WriteInteger("RADIO", "PollType", m_PollType); + pIniFile->WriteInteger("RADIO", "PollOffset", FreqOffset->ItemIndex); + double d; + int dd = 5; + if( sscanf(AnsiString(PollInt->Text).c_str(), "%lf", &d) == 1 ){ //JA7UDE 0428 + if( d >= 0.5 ){ + dd = int((d * 10.0) - 5); + if( dd < 0 ) dd = 0; + } + } + pIniFile->WriteInteger("RADIO", "PollInterval", dd); + pIniFile->UpdateFile(); + delete pIniFile; + } + TopWindow(this); +} +//--------------------------------------------------------------------------- +int __fastcall TRADIOSetDlg::IsXX(void) +{ + if( strstr(AnsiString(Maker->Text).c_str(), "xx") != NULL ) return 1; //JA7UDE 0428 + if( m_PollType == RADIO_POLLICOM ) return 1; + if( m_PollType == RADIO_POLLICOMN ) return 1; + if( m_PollType == RADIO_POLLOMNIVI ) return 1; + if( m_PollType == RADIO_POLLOMNIVIN ) return 1; + return 0; +} +//--------------------------------------------------------------------------- +int __fastcall TRADIOSetDlg::IsCompatible(int PollType, int MakerIndex) +{ + + if (MakerIndex == 5) { //MakerIndex 5 is Kenwood + if (PollType == 0){ + return 1; + } + else if (PollType == RADIO_POLLKENWOOD) { + return 1; + } + else if (PollType == RADIO_POLLKENWOODN) { + return 1; + } + else { + return 0; + } + } + else if (MakerIndex == 1) { //MakerIndex 1 is Yaesu FT-9000 et al + if (PollType == 0){ + return 1; + } + else if (PollType == RADIO_POLLFT9000) { + return 1; + } + else if (PollType == RADIO_POLLFT2000) { + return 1; + } + else if (PollType == RADIO_POLLFT950) { + return 1; + } + else if (PollType == RADIO_POLLFT450) { + return 1; + } + else { + return 0; + } + + } + else { + return 1; + } +} +//--------------------------------------------------------------------------- +int __fastcall TRADIOSetDlg::IsSame(LPCSTR t, LPCSTR v) +{ + for( ; *v && *t; v++, t++ ){ + if( (*v=='x')&&(*(v+1)=='x') ){ + t++; + v++; + } + else if( (*t == '\\')&&(*(t+1) == 'w') ){ + return 1; + } + else if( (*v == '\\')&&(*(v+1) == 'w') ){ + return 1; + } + else if( *t != *v ){ + return 0; + } + } + return *t != *v ? 0 : 1; +} +//--------------------------------------------------------------------------- +int __fastcall TRADIOSetDlg::GetVFOType(LPCSTR pKey) +{ + for( int i = 0; __VL[i] != NULL; i++ ){ + const POLLDEF *p = __VL[i]; + for( ; p->pKey != NULL; p++ ){ + if( !strcmp(p->pKey, pKey) ) return p->r; + } + } + return 0; +} +//--------------------------------------------------------------------------- +LPCSTR __fastcall TRADIOSetDlg::GetVFOName(int r) +{ + for( int i = 0; __VL[i] != NULL; i++ ){ + const POLLDEF *p = __VL[i]; + for( ; p->pKey != NULL; p++ ){ + if( p->r == r ) return p->pKey; + } + } + return "NONE"; +} +//--------------------------------------------------------------------------- +void __fastcall TRADIOSetDlg::SetVFOList(void) +{ + m_DisEvent++; + const POLLDEF *p = __VL[m_Maker]; + VFOType->Items->Clear(); + for( ; p->pKey != NULL; p++ ){ + VFOType->Items->Add(p->pKey); + } + VFOType->Text = GetVFOName(m_PollType); + m_DisEvent--; +} +//--------------------------------------------------------------------------- +void __fastcall TRADIOSetDlg::SetMaker(void) +{ + int i; + + for( i = 0; __MK[i] != NULL; i++ ){ + if( IsSame(AnsiString(CmdRx->Text).c_str(), __MT[i][1]) && IsSame(AnsiString(CmdTx->Text).c_str(), __MT[i][2]) && IsCompatible (m_PollType,i)){ //AA6YQ 1.66//JA7UDE 0428 + m_DisEvent++; + Maker->Text = __MK[i]; + m_DisEvent--; + m_Maker = i; + SetVFOList(); + return; + } + } + m_Maker = MAKER_UNKNOWN; + m_DisEvent++; + Maker->Text = "Unknown"; + SetVFOList(); + m_DisEvent--; +} + +void __fastcall TRADIOSetDlg::MakerChange(TObject *Sender) +{ + if( m_DisEvent ) return; + + m_PollType = 0; + VFOType->Text = "NONE"; + PollInt->Text = "1"; + AddrScan->Checked = 0; + for( int i = 0; __MK[i] != NULL; i++ ){ + if( Maker->Text == __MK[i] ){ + CmdInit->Text = __MT[i][0]; + CmdRx->Text = __MT[i][1]; + CmdTx->Text = __MT[i][2]; + m_Maker = i; + if( m_Maker == 3 ){ // Ten-Tec Omni-VI + Cmdxx->Text = "04"; + } + SetVFOList(); + break; + } + } + UpdateUI(); +} +//--------------------------------------------------------------------------- +void __fastcall TRADIOSetDlg::PortNameChange(TObject *Sender) +{ + if( m_DisEvent ) return; + + UpdateUI(); +} +//--------------------------------------------------------------------------- +void __fastcall TRADIOSetDlg::RefBtnClick(TObject *Sender) +{ + TOpenDialog *pBox = MmttyWd->OpenDialog; + pBox->Options >> ofCreatePrompt; + pBox->Options << ofFileMustExist; + if(Font->Charset != SHIFTJIS_CHARSET){ + pBox->Title = "Program file"; + pBox->Filter = "Program files(*.exe;*.lnk)|*.exe;*.lnk|"; + } + else { + pBox->Title = "ƒvƒƒOƒ‰ƒ€ƒtƒ@ƒCƒ‹"; + pBox->Filter = "ƒvƒƒOƒ‰ƒ€ƒtƒ@ƒCƒ‹(*.exe;*.lnk)|*.exe;*.lnk|"; + } + pBox->FileName = CmdGNR->Text.c_str(); + pBox->DefaultExt = "exe"; + char bf[256]; + SetDirName(bf, AnsiString(CmdGNR->Text).c_str()); //JA7UDE 0428 + pBox->InitialDir = bf; + NormalWindow(this); + if( pBox->Execute() == TRUE ){ + CmdGNR->Text = pBox->FileName.c_str(); + } + TopWindow(this); +} +//--------------------------------------------------------------------------- +void __fastcall TRADIOSetDlg::VFOTypeChange(TObject *Sender) +{ + if( m_DisEvent ) return; + + m_PollType = GetVFOType(AnsiString(VFOType->Text).c_str()); //JA7UDE 0428 + + UpdateUI(); +} +//--------------------------------------------------------------------------- +void __fastcall TRADIOSetDlg::SBHelpClick(TObject *Sender) +{ + ShowHtmlHelp("radiocommand.htm"); +} +//--------------------------------------------------------------------------- + diff --git a/radioset.dfm b/radioset.dfm new file mode 100644 index 0000000..b2fb8e9 Binary files /dev/null and b/radioset.dfm differ diff --git a/radioset.h b/radioset.h new file mode 100644 index 0000000..10fc7da --- /dev/null +++ b/radioset.h @@ -0,0 +1,127 @@ +//Copyright+LGPL + +//----------------------------------------------------------------------------------------------------------------------------------------------- +// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba, Dave Bernstein +//----------------------------------------------------------------------------------------------------------------------------------------------- +// This file is part of MMTTY. + +// MMTTY is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +// MMTTY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see +// . +//----------------------------------------------------------------------------------------------------------------------------------------------- + + + +//---------------------------------------------------------------------------- +#ifndef RadioSetH +#define RadioSetH +//---------------------------------------------------------------------------- +/* +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +*/ +//---------------------------------------------------------------------------- +#include "Cradio.h" +#include +#include +#include +#include +#include +/* +#include +#include +*/ +//---------------------------------------------------------------------------- +class TRADIOSetDlg : public TForm +{ +__published: + TButton *OKBtn; + TButton *CancelBtn; + TGroupBox *GB1; + TComboBox *PortName; + TLabel *Label1; + TLabel *Label2; + TComboBox *Baud; + TRadioGroup *BitLen; + TRadioGroup *Stop; + TRadioGroup *Parity; + TGroupBox *GB3; + TCheckBox *flwXON; + TCheckBox *flwCTS; + TLabel *Label3; + TComboBox *ByteWait; + TLabel *Label8; + TButton *LoadBtn; + TButton *SaveBtn; + TComboBox *Maker; + TGroupBox *GGNR; + TLabel *LGNR; + TEdit *CmdGNR; + TButton *RefBtn; + TCheckBox *OpenGNR; + TLabel *LPTT; + TGroupBox *GCmd; + TLabel *Label4; + TLabel *Label5; + TLabel *Label6; + TLabel *Lxx; + TLabel *LVFO; + TEdit *CmdInit; + TEdit *CmdRx; + TEdit *CmdTx; + TEdit *Cmdxx; + TComboBox *VFOType; + TRadioGroup *FreqOffset; + TComboBox *PollInt; + TLabel *LInt; + TLabel *LInts; + TCheckBox *AddrScan; + TSpeedButton *SBHelp; + TGroupBox *GB2; + TCheckBox *CBPTT; + TLabel *Label7; + void __fastcall LoadBtnClick(TObject *Sender); + void __fastcall SaveBtnClick(TObject *Sender); + void __fastcall MakerChange(TObject *Sender); + void __fastcall PortNameChange(TObject *Sender); + void __fastcall RefBtnClick(TObject *Sender); + + void __fastcall VFOTypeChange(TObject *Sender); + void __fastcall SBHelpClick(TObject *Sender); + + + +private: + int m_DisEvent; + int __fastcall IsXX(void); + int __fastcall IsSame(LPCSTR v, LPCSTR t); + int __fastcall IsCompatible(int PollType, int MakerIndex); //AA6YQ 1.6.6 + void __fastcall SetMaker(void); + void __fastcall UpdateUI(void); + void __fastcall SetVFOList(void); + int __fastcall GetVFOType(LPCSTR pKey); + LPCSTR __fastcall GetVFOName(int r); + int m_Maker; + int m_PollType; + int m_InitWidth; + CMMList m_MMList; +public: + virtual __fastcall TRADIOSetDlg(TComponent* AOwner); + int __fastcall Execute(void); +}; +//---------------------------------------------------------------------------- +//---------------------------------------------------------------------------- +#endif diff --git a/remote.txt b/remote.txt new file mode 100644 index 0000000..5d562f2 --- /dev/null +++ b/remote.txt @@ -0,0 +1,742 @@ +MMTTY‚ÌƒŠƒ‚[ƒg‹@”\ +(Please look at "Eremote.txt" if you want to read this in English) + + 2000.09.30 ‰”Å JE3HHT X@@½ + 2010.09.21 ‰ü’è JE3HHT X@@½ + +@–{‘‚É‚ÍA‚ ‚È‚½‚̃vƒƒOƒ‰ƒ€‚©‚çMMTTY‚ð§Œä‚·‚é•û–@‚ð‹LÚ‚µ‚Ü‚·B‚ ‚È‚½‚Í‚±‚Ì•û–@‚ðŽg‚Á‚ÄAMMTTY‚ÌRTTYƒTƒEƒ“ƒhƒGƒ“ƒWƒ“‚¾‚¯‚ð‚ ‚È‚½‚̃AƒvƒŠƒP[ƒVƒ‡ƒ“‚©‚ç—˜—p‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B + +-- ‰ü’è—š—ð ----------------------------------------------------- +ƒXƒCƒbƒ`î•ñ +2010.09.21 ‹N“®ƒ^ƒCƒ€ƒAƒEƒgŽžŠÔ‚ðŽw’è‚·‚é‹N“®ƒIƒvƒVƒ‡ƒ“‚ð’ljÁ +2010.09.21 ‹¤—Lƒƒ‚ƒŠ‚Ì–¼‘O‚ðŽw’è‚·‚é‹N“®ƒIƒvƒVƒ‡ƒ“‚ð’ljÁ +2010.09.19 ƒXƒCƒbƒ`î•ñ‚ÉDual Peak Filter‚ð’ljÁ +2010.09.16 RXM_PTTFSK‚̒ljÁ +2003.01.30 TXM_SHOWSETUP, TXM_SHOWPROFILE‚̒ljÁ +2003.01.28 RXM_ENBSHARED‚̒ljÁ +2003.01.28 -Z, -a ‹N“®ƒIƒvƒVƒ‡ƒ“‚ð’ljÁ +2003.01.23 RXM_ENBFOCUS, RXM_SETDEFFREQ, RXM_SETLENGTH‚̒ljÁ +2002.07.02 TXM_RADIOFREQ‚ð’ljÁ +2002.04.14 RXM_SHOWSETUP‚ɃAƒvƒŠƒP[ƒVƒ‡ƒ“‚Ì–³Œø‰»ƒXƒCƒbƒ`‚ð’ljÁ +2000.02.11 ‹¤—Lƒƒ‚ƒŠ‚ÉProfileNames[]‚ð’ljÁ(Ver1.61‚©‚ç) +2000.02.11 TXM_DEFSHIFT‚ð’ljÁ(Ver1.61‚©‚ç) +2000.02.11 TXM_NOTCH‚ð’ljÁ(Ver1.61‚©‚ç) +2000.02.11 RXM_TIMER‚ð’ljÁ(Ver1.61‚©‚ç) +2000.01.05 ‹¤—Lƒƒ‚ƒŠ‚ɕϔ‚ð’ljÁ(Ver1.61‚©‚ç) +2000.01.05 ƒvƒƒtƒB[ƒ‹‹@”\‚̒ljÁ(Ver1.61‚©‚ç) +2000.12.23 ‘—Mƒoƒbƒtƒ@ƒNƒŠƒA‚̒ljÁ(Ver1.61‚©‚ç) +2000.12.13 ƒL[ƒ{[ƒhƒoƒbƒtƒ@Œo—R‚Å‘—M‚Å‚«‚é‹@”\‚ð’ljÁ(Ver1.60‚©‚ç) +2000.11.26 -n‹N“®ƒIƒvƒVƒ‡ƒ“‚ð’ljÁ(Ver1.60‚©‚ç) +2000.11.10 -h‹N“®ƒIƒvƒVƒ‡ƒ“‚ð’ljÁ(Ver1.60‚©‚ç) +2000.11.08 ‹¤—Lƒƒ‚ƒŠ‚Ìtitle‚Ì”z—ñ‚̃TƒCƒY‚ÌŒë‚è‚ðC³ +2000.11.08 Bob Furzer(K4CY)‚©‚ç’ñ‹Ÿ‚³‚ꂽVBƒTƒ“ƒvƒ‹ƒR[ƒh‚ð’ljÁ +2000.11.08 RXM_NOTCHƒƒbƒZ[ƒW‚ð’ljÁ(Ver1.59A‚©‚ç) +2000.11.08 ƒXƒCƒbƒ`î•ñ‚ÌNotch/LMS‚ð’ljÁ(Ver1.59A‚©‚ç) +----------------------------------------------------------------- + +›‚Í‚¶‚ß‚É +~~~~~~~~~~ +@Ž„‚ÍA‘½‚­‚Ì•û‚©‚烃Mƒ“ƒO‚âƒRƒ“ƒeƒXƒg‚ÉŠÖ‚·‚éE-Mail‚ðŽóM‚µ‚Ü‚µ‚½BŽ„‚ÌŽžŠÔ‚ÍŒÀ‚ç‚ê‚Ä‚¢‚邽‚ß‚ÉA‚»‚ê‚ç‚Ì•û‚Ì—v‹‚ð‘‹}‚É–ž‚½‚·‚±‚Ƃ͎„‚Ì”\—͂𒴂¦‚Ä‚¢‚邯l‚¦‚Ü‚µ‚½B + +@‚»‚±‚ÅMMTTY‚𑼂̃vƒƒOƒ‰ƒ€‚©‚ç—˜—p‚Å‚«‚邿‚¤‚ÉA’P‚Ȃ郂ƒfƒ€‚Æ‚·‚鎎‚݂Ɏæ‚è‘g‚݂܂µ‚½B‚Ü‚¸TNCƒGƒ~ƒ…ƒŒ[ƒVƒ‡ƒ“ƒ‚[ƒh‚ð’ljÁ‚µ‚Ü‚µ‚½B‚ ‚È‚½‚Í‚Q‘ä‚̃pƒ\ƒRƒ“‚ðƒNƒƒXƒP[ƒuƒ‹‚ÅÚ‘±‚·‚é‚©A‚Ü‚½‚Í‚P‘ä‚̃pƒ\ƒRƒ“‚Ìã‚Å‚àA‚»‚±‚ɉ¼‘z‚b‚‚ƒ|[ƒg‚ðƒCƒ“ƒXƒg[ƒ‹‚·‚ê‚ÎAMMTTY‚ð‚s‚m‚b‚Æ‚µ‚Ä‘¼‚̃vƒƒOƒ‰ƒ€‚©‚ç—˜—p‚Å‚«‚Ü‚·B + +@‚µ‚©‚µA‚Q‘ä‚̃pƒ\ƒRƒ“‚ð•K—v‚Æ‚·‚邱‚Æ‚ÍA‚±‚Ì‹@”\‚ÌÅ‘å‚ÌŽã“_‚Å‚·B‚Ü‚½‚P‘ä‚̃pƒ\ƒRƒ“ã‚Å“®ì‚³‚¹‚éꇂà‚R‚ˆÈã‚Ì•¨—Comƒ|[ƒg‚ª‘¶Ý‚·‚é‚©A‚Ü‚½‚͉¼‘z‚b‚‚ƒ|[ƒg‚ðƒCƒ“ƒXƒg[ƒ‹‚µ‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñB + +@‚»‚±‚ÅŽ„‚Í Bob Furzer (K4CY) ‚É—Ç‚¢ƒAƒCƒfƒA‚ª‚È‚¢‚©‘Š’k‚µ‚Ü‚µ‚½B”Þ‚Í‚·‚®‚É’Pƒ‚ȃvƒƒZƒXŠÔƒƒbƒZ[ƒW’ÊM‚Ì•û–@‚ð’ñˆÄ‚µ‚Ä‚­‚ê‚Ü‚µ‚½iMany Thanks to BobjB +@‚±‚Ì•û–@‚ðŽg‚¤‚È‚ç‚ÎAWindowsƒŒƒWƒXƒgƒŠ‚ÉˆêØ‚Ì“o˜^‚ð•K—v‚Æ‚¹‚¸A”ñí‚ɃXƒ}[ƒg‚ɃAƒvƒŠƒP[ƒVƒ‡ƒ“ŠÔ‚Ì’ÊM‚ðŽÀŒ»‚Å‚«‚Ü‚·BŽ„‚Í‚³‚Á‚»‚­”ނ̃AƒCƒfƒA‚ɉˆ‚Á‚ÄMMTTY‚É’Pƒ‚ÈƒŠƒ‚[ƒg‹@”\‚ð’ljÁ‚µ‚Ü‚µ‚½B + + ‚»‚ÌŒãABob‚©‚ç‚Ì’ñˆÄ‚É‚æ‚èAœX‚É‹@”\‚ð’ljÁ‚µ‚Ü‚µ‚½B‚ ‚È‚½‚Í‚±‚ê‚ç‚Ì‘S‚Ă̋@”\‚ðŽ©—R‚É—˜—p‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B + +@‚È‚¨–{‘‚ÍCƒvƒƒOƒ‰ƒ~ƒ“ƒO‚ð—á‚ɉðà‚µ‚Ä‚ ‚è‚Ü‚·‚ªA‚à‚¿‚ë‚ñVisualBasic‚ȂǑ¼‚ÌŒ¾Œê‚É‚¨‚¢‚Ä‚à“¯“™‚ÌAPIŒÄ‚Ño‚µ‚ð—p‚¢‚ÄAƒŠƒ‚[ƒg‹@”\‚ðŽg—p‚·‚鎖‚ª‚Å‚«‚é‚Í‚¸‚Å‚·B + + +›ƒƒbƒZ[ƒW’l‚̎擾‚ƃƒbƒZ[ƒW‚Ì‘—M +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +@MMTTY‚Æ’ÊM‚·‚é‚É‚ÍA“Á•ʂȃƒbƒZ[ƒW’l‚ðŽæ“¾‚µ‚Ü‚·B‚±‚Ì•û–@‚ðˆÈ‰º‚ÉŽ¦‚µ‚Ü‚·B + +UINT MSG_MMTTY = ::RegisterWindowMessage("MMTTY"); + +@ˆÈŒã‚ ‚È‚½‚ÍMMTTY‚Ƃ̒ÊM‚É‚¨‚¢‚ÄA‚±‚̃ƒbƒZ[ƒW’l‚ðŽg‚í‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñB + +@MMTTY‚ɃƒbƒZ[ƒW‚ð‘—M‚·‚éê‡AŽŸ‚ÌAPIŠÖ”‚ðŽg—p‚µ‚Ü‚·B + + BOOL PostMessage(hwnd, uMsg, wParam, lParam) + + HWND hwnd; /* Žó‚¯Žæ‚葤‚̃EƒBƒ“ƒhƒE‚̃nƒ“ƒhƒ‹ */ + UINT uMsg; /* ƒ|ƒXƒg‚·‚郃bƒZ[ƒW’l */ + WPARAM wParam; /* ‘æ1ƒƒbƒZ[ƒW ƒpƒ‰ƒ[ƒ^ */ + LPARAM lParam; /* ‘æ2ƒƒbƒZ[ƒW ƒpƒ‰ƒ[ƒ^ */ + + —Ⴆ‚ÎMMTTY‚ð‘—M‚ÉØ‚è‘Ö‚¦‚éꇂÍA + + ::PostMessage(MMTTY_Handle, MSG_MMTTY, RXM_PTT, 2); + +‚̂悤‚É‹Lq‚µ‚Ü‚·B + + ‚Ü‚½‚Í‚ ‚È‚½‚Í + + BOOL PostThreadMessage(dwThreadId, uMsg, wParam, lParam) + DWORD dwThreadId; /* ƒXƒŒƒbƒhID */ + UINT uMsg; /* ƒ|ƒXƒg‚·‚郃bƒZ[ƒW */ + WPARAM wParam; /* ƒƒbƒZ[ƒW‚Ì‘æ1ƒpƒ‰ƒ[ƒ^ */ + LPARAM lParam; /* ƒƒbƒZ[ƒW‚Ì‘æ2ƒpƒ‰ƒ[ƒ^ */ + +‚ðŽg‚¤Ž–‚à‚Å‚«‚Ü‚·BMMTTY‚Í‚¢‚¸‚ê‚Ìꇂೂµ‚­ƒƒbƒZ[ƒW‚ðŽóM‚·‚鎖‚ª‚Å‚«‚Ü‚·B‚½‚¾‚µAMMTTY‚©‚ç‚ ‚È‚½‚ւ̃ƒbƒZ[ƒW‚Ì‘—M‚Íí‚ɃEƒCƒ“ƒhƒEƒnƒ“ƒhƒ‹‚ɑ΂µ‚Ă̂Ýs‚í‚ê‚Ü‚·B + + +›MMTTY‚Ì‹N“®•û–@ +~~~~~~~~~~~~~~~~~ +@‚ ‚È‚½‚ÍMMTTY‚Ƃ̒ÊM‚ðs‚¤ê‡AŽŸ‚Ì‹N“®ƒIƒvƒVƒ‡ƒ“‚É‚æ‚èMMTTY‚ð‹N“®‚µ‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñB‚ ‚È‚½‚̃vƒƒOƒ‰ƒ€“à‚©‚çCreateProcessŠÖ”‚Ü‚½‚ÍWinExecŠÖ”‚É‚æ‚è‹N“®‚·‚é‚Ì‚ª—Ç‚¢‚Å‚µ‚傤B + +MMTTY -r (-f) + + -r : ‘€ìƒ{ƒ^ƒ“‚ ‚èAƒƒjƒ…[‚ ‚è + -s : ‘€ìƒ{ƒ^ƒ“‚È‚µAƒƒjƒ…[‚ ‚è + -t : ‘€ìƒ{ƒ^ƒ“‚È‚µAƒƒjƒ…[‚È‚µ + -u : ‘€ìƒ{ƒ^ƒ“‚ ‚èAƒƒjƒ…[‚È‚µ + -m : í‚ɃAƒCƒRƒ“‰»ó‘Ô‚ð•Û‚Â + + (-f : ƒ}ƒEƒX‘€ì‚ŃTƒCƒY•ÏX•s‰Â) + (-d : ƒ}ƒEƒX‘€ì‚ŃTƒCƒY‚ƈʒu•ÏX•s‰Â) + (-hxxx... : ƒEƒCƒ“ƒhƒEƒnƒ“ƒhƒ‹‚ÌŽw’è xxx=16i”) + (-n : BAUDOT•„†•ÏŠ·‚ðs‚í‚È‚¢j + (-p : Setup window‚ÅComÝ’è‚ð‹ÖŽ~) + (-Z : MMTTY‚Ì•¡”‹N“®‚ð‹–‚·) + (-a : MMTTYƒEƒCƒ“ƒhƒE‚ðStay on top‚É‚µ‚È‚¢) + (-Cxxx : ‹¤—Lƒƒ‚ƒŠ‚Ì–¼‘O, xxx=•¶Žš—ñ) + (-Txxx : MMTTY‹N“®Žž‚̃^ƒCƒ€ƒAƒEƒg, xxx=•b‚Ì‚P‚Oi’l) + +@MMTTY‚Íã‹L‚Ì‚S‚Âi-r, -s, -t, -uj‚Ì‚¢‚¸‚ê‚©‚̃IƒvƒVƒ‡ƒ“‚Å‹N“®‚³‚ê‚邯A•K‚¸ƒRƒ“ƒgƒ[ƒ‹ƒpƒlƒ‹‚݂̂̕\ަ‚ɂȂè‚Ü‚·B‚±‚̃pƒlƒ‹‚Í‚ ‚È‚½‚̃vƒƒOƒ‰ƒ€‚̈ꕔ‚Æ‚µ‚ÄŒ©‚¦‚邿‚¤‚Éí‚É‘OŒiƒEƒCƒ“ƒhƒE‚ɕۂ½‚ê‚Ü‚·B‚±‚Ìó‘Ô‚Å‚ÍMMTTY‚Í‘—Žó‚Ì‚½‚߂̃EƒCƒ“ƒhƒE‚âAƒƒOƒpƒlƒ‹‚ðŽ‚¿‚Ü‚¹‚ñB + + MMTTY‚ÍƒŠƒ‚[ƒgƒ‚[ƒh‚Å‹N“®‚³‚ꂽê‡AŽ©g‚̃EƒCƒ“ƒhƒE‚̈ʒu‚ƃTƒCƒY‚ð•K‚¸INIƒtƒ@ƒCƒ‹‚ɕێ‚µ‚Ü‚·BŽŸ‰ñ‚ÌƒŠƒ‚[ƒg‹N“®‚Å‚Íí‚É‘O‰ñ‚Æ“¯‚¶ˆÊ’uAƒTƒCƒY‚Å•\ަ‚³‚ê‚邿‚¤‚ɂȂè‚Ü‚·B]‚Á‚Ä‚ ‚½‚È‚½‚Í“Á•Ê‚Èꇂ𜂫AMMTTYƒEƒCƒ“ƒhƒE‚̈ʒu‚âƒTƒCƒY‚ð§Œä‚·‚é•K—v‚Í‚ ‚è‚Ü‚¹‚ñB + +@-fƒIƒvƒVƒ‡ƒ“‚ð•t‰Á‚·‚邯MMTTY‚̓†[ƒU‚̃}ƒEƒX‘€ì‚ł̃EƒCƒ“ƒhƒEƒTƒCƒY‚Ì•ÏX‚ð‹ÖŽ~‚µ‚Ü‚·B‚à‚¿‚ë‚ñ‚±‚Ìê‡A‚ ‚È‚½‚̓ƒbƒZ[ƒW‚É‚æ‚èMMTTY‚̃TƒCƒY‚ð’²®‚·‚邱‚Æ‚ª‚«‚ł܂·B + + -dƒIƒvƒVƒ‡ƒ“‚ð•t‰Á‚·‚邯MMTTY‚̓^ƒCƒgƒ‹ƒo[‚ð•\ަ‚µ‚Ü‚¹‚ñB‚±‚Ìó‘Ԃł̓†[ƒU‚É‚æ‚éƒ}ƒEƒX‘€ì‚ł̓pƒlƒ‹‚̈ʒu‚âƒTƒCƒY‚ðˆêØ•ÏX‚Å‚«‚È‚­‚È‚è‚Ü‚·B‚‚܂肠‚È‚½‚̃vƒƒOƒ‰ƒ€‚Ì“s‡‚Ì—Ç‚¢ˆÊ’u‚ƃTƒCƒY‚Ƀpƒlƒ‹‚ðí‚ɌŒ肷‚鎖‚ª‚Å‚«AMMTTY‚̃pƒlƒ‹‚ÍA‚ ‚È‚½‚̃vƒƒOƒ‰ƒ€‚̈ꕔ‚̂悤‚ÉŒ©‚¦‚é‚Í‚¸‚Å‚·B +@‚µ‚©‚µ‚±‚̃pƒlƒ‹‚Ìã‚É‚ ‚È‚½‚̃EƒCƒ“ƒhƒEiƒ|ƒbƒvƒAƒbƒvƒƒjƒ…[‚âƒ_ƒCƒAƒƒOƒ{ƒbƒNƒXj‚ðd‚Ë‚éê‡A‚»‚̃EƒCƒ“ƒhƒE‚ÌZ‡˜‚ðÅãˆÊ‚É’²®‚·‚é‚©A‚Ü‚½‚̓pƒlƒ‹‚Ì•\ަ‚ðOFF‚É‚·‚é•K—v‚ª‚ ‚è‚Ü‚·B + ‚±‚̃IƒvƒVƒ‡ƒ“‚ð•t‰Á‚³‚ꂽê‡AMMTTY‚͉æ–ʂ̕\ަ‚ðOFF‚É‚µ‚½ó‘Ô‚Å‹N“®‚µ‚Ü‚·B‚ ‚È‚½‚ÍMMTTY‚ð“K؂Ȉʒu‚ƃTƒCƒY‚Éݒ肵‚½ŒãA•\ަ‚ðON‚É‚µ‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñB + +@-mƒIƒvƒVƒ‡ƒ“‚ð•t‰Á‚·‚邯MMTTY‚Íí‚ɃAƒCƒRƒ“‰»ó‘Ô‚ðˆÛŽ‚µ‚Ü‚·BMMTTY‚̃Rƒ“ƒgƒ[ƒ‹ƒpƒlƒ‹‚ªA‚ ‚È‚½‚̃vƒƒOƒ‰ƒ€‚ɂƂÁ‚Ďז‚‚ɂȂéꇂ͂±‚̃IƒvƒVƒ‡ƒ“‚ð•t‰Á‚·‚ê‚Ηǂ¢‚Å‚µ‚傤B‚±‚Ìꇂ ‚È‚½‚Í‹¤—Lƒƒ‚ƒŠƒAƒNƒZƒX‚É‚æ‚èMMTTY‚©‚çFFT‚¨‚æ‚ÑXYƒXƒR[ƒv‚̃f[ƒ^‚ðŽæ“¾‚µ‚ ‚È‚½Ž©g‚Å‚»‚ê‚ð•\ަ‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B + + -hƒIƒvƒVƒ‡ƒ“‚ð•t‰Á‚·‚邯MMTTY‚Í‹N“®’¼Œã‚©‚ç‚ ‚È‚½‚̃EƒCƒ“ƒhƒEƒnƒ“ƒhƒ‹‚ªŽw’肳‚ꂽ’l‚Å‚ ‚邯‰¼’肵AHWND_BROADCAST‚ðŽg‚킸‚É‚»‚̃nƒ“ƒhƒ‹‚ɃƒbƒZ[ƒW‚ð‘—M‚µ‚Ü‚·BŽw’è‚·‚é’l‚Í16i”•¶Žš—ñ‚łȂ¯‚ê‚΂Ȃè‚Ü‚¹‚ñB + HWND_BROADCASTƒƒbƒZ[ƒW‚ªŽ|‚­ŽóM‚Å‚«‚È‚¢ê‡A‚±‚̃IƒvƒVƒ‡ƒ“‚ðŽg‚Á‚Ä‹N“®‚·‚邯—Ç‚¢‚Å‚µ‚傤B‚à‚¿‚ë‚ñ‚±‚ÌꇂàATXM_HANDLEƒƒbƒZ[ƒW‚ðŽóM‚µ‚½Žž‚ÍA‚ ‚È‚½‚̃EƒCƒ“ƒhƒEƒnƒ“ƒhƒ‹‚ðMMTTY‚É’Ê’m‚µ‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñB + + + ‚±‚ê‚ç‚Ì‘I‘ð‚Í‚ ‚È‚½‚ªMMTTY‚ð‚ǂ̂悤‚ÉŽg‚¤‚©‚É‚æ‚Á‚ÄŒˆ‚Ü‚è‚Ü‚·B–{‘‚ł͑½‚­‚̃ƒbƒZ[ƒW‚⋤—Lƒƒ‚ƒŠ‚ɂ‚¢‚ĉðà‚µ‚Ü‚·‚ªA‚à‚µ‚ ‚È‚½‚ª-rƒIƒvƒVƒ‡ƒ“‚ðŽg‚¤‚È‚ç‚ÎA‚ ‚È‚½‚Í‘—Žó‚ÌØ‚è‘Ö‚¦‚ÆA•¶Žš‚𑗎󂷂郃bƒZ[ƒW‚¾‚¯‚ðˆ—‚·‚ê‚Ηǂ¢‚Í‚¸‚Å‚·B +@‚µ‚©‚µ‚ ‚È‚½‚̃vƒƒOƒ‰ƒ€‚Å‚æ‚莩—R“x‚𓾂½‚¢‚ÆŽv‚¤‚È‚ç‚ÎA-t‚â-mƒIƒvƒVƒ‡ƒ“‚Å‹N“®‚µA‚æ‚葽‚­‚̃ƒbƒZ[ƒW‚ðˆ—‚µ‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñB + + +›ƒEƒCƒ“ƒhƒEƒnƒ“ƒhƒ‹‚ÌŒðŠ· +~~~~~~~~~~~~~~~~~~~~~~~~~~ +@MMTTY‚ÍƒŠƒ‚[ƒgƒIƒvƒVƒ‡ƒ“‚ª•t‰Á‚³‚ê‚Ä‹N“®‚³‚ê‚邯A‹N“®’¼Œã‚ÉŽ©g‚̃XƒŒƒbƒh”Ô†AƒEƒCƒ“ƒhƒEƒnƒ“ƒhƒ‹‚Ɖ‰ñ‹N“®î•ñ‚ð•ú‘—ƒ‚[ƒh‚Å‘—M‚µ‚Ü‚·B + + ::PostMessage(HWND_BROADCAST, MSG_MMTTY, TXM_THREAD, MMTTY_ThreadId); + ::PostMessage(HWND_BROADCAST, MSG_MMTTY, TXM_HANDLE, MMTTY_Handle); + ::PostMessage(HWND_BROADCAST, MSG_MMTTY, TXM_START, 0x00000000); + +‚ ‚È‚½‚Í‚±‚̃ƒbƒZ[ƒW(TXM_HANDLE)‚ðŽóM‚µ‚½‚çA•K‚¸Ž©g‚̃EƒCƒ“ƒhƒEƒnƒ“ƒhƒ‹‚ðˆÈ‰º‚̂悤‚É‘—‚è•Ô‚µ‚Ä‚­‚¾‚³‚¢B + + ::PostMessage(MMTTY_Handle, MSG_MMTTY, RXM_HANDLE, Your_Handle); + +@MMTTY‚Í‚±‚̃ƒbƒZ[ƒW‚ðŽóM‚·‚邯ˆÈŒãYour_Handle‚ɑ΂µ‚Ă̂݃ƒbƒZ[ƒW‚ð‘—M‚µ‚Ü‚·B‚Ü‚½‹N“®‚³‚ꂽŒãA–ñ‚T•b`‚P‚O•bŒo‰ß‚µ‚Ä‚à‚±‚̃ƒbƒZ[ƒW‚ªŽóM‚Å‚«‚È‚¢ê‡AMMTTY‚ÍŽ©g‚ð‹­§“I‚ÉI—¹‚µ‚Ü‚·B + +@‚ ‚È‚½‚̃vƒƒOƒ‰ƒ€‚ÅMMTTY‚©‚ç‚̃ƒbƒZ[ƒW‚ðŽóM‚·‚éŽdŠ|‚¯‚Í‚¨Žg‚¢‚̃Rƒ“ƒpƒCƒ‰‚É‚æ‚èˆÙ‚È‚è‚Ü‚·B‚»‚ꂼ‚ê‚̃}ƒjƒ…ƒAƒ‹‚ðŽQÆ‚µ‚ĉº‚³‚¢B + + +›MMTTY‚ւ̃ƒbƒZ[ƒW +~~~~~~~~~~~~~~~~~~~~~ + wParam‚ªƒƒbƒZ[ƒW”Ô†‚Å‚·BCŒ¾Œê‚Ìenum•¶‚͈ê”Ôæ“ª‚Å’è‹`‚µ‚½’l‚©‚燔Ԃɒl‚ªƒCƒ“ƒNƒŠƒƒ“ƒg‚³‚ê‚Ü‚·B—Ⴆ‚Έȉº‚Ìê‡ARXM_PTT‚Í0x0003‚ªŠ„‚è“–‚Ä‚ç‚ê‚Ü‚·B + +enum { + RXM_HANDLE=0x0000, // APP -> MMTTY + RXM_REQHANDLE, + RXM_EXIT, + RXM_PTT, + RXM_CHAR, + + RXM_WINPOS, + RXM_WIDTH, + RXM_REQPARA, + RXM_SETBAUD, + RXM_SETMARK, + + RXM_SETSPACE, + RXM_SETSWITCH, + RXM_SETHAM, + RXM_SHOWSETUP, + RXM_SETVIEW, + + RXM_SETSQLVL, + RXM_SHOW, + RXM_SETFIG, + RXM_SETRESO, + RXM_SETLPF, + + RXM_SETTXDELAY, + RXM_UPDATECOM, + RXM_SUSPEND, + RXM_NOTCH, + RXM_PROFILE, + + RXM_TIMER, + RXM_ENBFOCUS, + RXM_SETDEFFREQ, + RXM_SETLENGTH, + RXM_ENBSHARED, + + RXM_PTTFSK, +}; + +1.ƒEƒCƒ“ƒhƒEƒnƒ“ƒhƒ‹‚Ì’Ê’m + wParam = RXM_HANDLE + lParam = ‚ ‚È‚½‚̃EƒCƒ“ƒhƒEƒnƒ“ƒhƒ‹ + +@‚ ‚È‚½‚ÍŽ©g‚̃EƒCƒ“ƒhƒEƒnƒ“ƒhƒ‹‚ð•ÏX‚µ‚½ÛA•K‚¸‚±‚̃ƒbƒZ[ƒW‚ð‘—M‚µ‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñB + + +2.ƒEƒCƒ“ƒhƒEƒnƒ“ƒhƒ‹‚Ì—v‹ + wParam = RXM_REQHANDLE + lParam = 0x00000000 + +@‚±‚̃ƒbƒZ[ƒW‚ÍŽg—p‚·‚é•K—v‚Í‚ ‚è‚Ü‚¹‚ñB + + +3.MMTTY‚ÌI—¹ + wParam = RXM_EXIT + lParam = 0x00000000 + +@‚ ‚È‚½‚Í‚ ‚È‚½‚̃vƒƒOƒ‰ƒ€‚ðI—¹‚·‚鎞A•K‚¸‚±‚̃ƒbƒZ[ƒW‚ð‘—M‚µ‚ÄMMTTY‚ðI—¹‚µ‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñBƒŠƒ‚[ƒgƒ‚[ƒh‚ÌMMTTY‚ÍŽ©•ªŽ©g‚ðI—¹‚³‚¹‚é‘€ì‚ðŽ‚¿‚Ü‚¹‚ñB + + +4.‘—Žó‚ÌØ‚è‘Ö‚¦ + wParam = RXM_PTT + lParam = 0x00000000 ‚½‚¾‚¿‚ÉŽóM‚ÉØ‚è‘Ö‚¦‚é + lParam = 0x00000001 ‘—oŒã‚ÉŽóM‚ÉØ‚è‘Ö‚¦‚é + lParam = 0x00000002 ‘—M‚ÉØ‚è‘Ö‚¦‚é + lParam = 0x00000004 ‘—Mƒoƒbƒtƒ@‚ðƒNƒŠƒA‚·‚é + +5.•¶Žš‚Ì‘—M + wParam = RXM_CHAR + lParam = •¶ŽšƒR[ƒhiASCIIj + +@‚±‚̃ƒbƒZ[ƒW‚ÍMMTTY‚ª‘—Mó‘ԂłȂ¢‚Æ—LŒø‚ł͂ ‚è‚Ü‚¹‚ñ + + RXM_SETSWICHƒƒbƒZ[ƒW‚ÅB15‚É1‚Éݒ肵‚½ê‡AMMTTY‚Í“à•”‚̃L[ƒ{[ƒhƒoƒbƒtƒ@Œo—R‚Å‘—M‚µ‚Ü‚·B‚»‚Ìê‡ABSƒR[ƒh‚â‘—M•û–@(Char.out, Word out, Line out)Aƒ[ƒhƒ‰ƒbƒv‹@”\‚ðŽg—p‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B + + -nƒIƒvƒVƒ‡ƒ“‚ð•t‰Á‚µ‚ÄMMTTY‚ð‹N“®‚µ‚½ê‡ABAUDOT•„†•ÏŠ·‚Ís‚í‚ê‚Ü‚¹‚ñB‚±‚Ìê‡lParam‚ÅŽw’è‚·‚éƒR[ƒh‚ª‚»‚̂܂ܑ—M‚³‚ê‚Ü‚·B‚Ü‚½RXM_SETSWICHƒƒbƒZ[ƒW‚ÌB15‚Í–³Ž‹‚³‚ê‚Ü‚·B + + +6.•\ަˆÊ’u‚Ì•ÏX + wParam = RXM_WINPOS + lParam = ãˆÊ16bit@YÀ•WiƒXƒNƒŠ[ƒ“ƒsƒNƒZƒ‹’lj + ‰ºˆÊ16bit@XÀ•WiƒXƒNƒŠ[ƒ“ƒsƒNƒZƒ‹’lj + +7.ƒpƒlƒ‹ƒTƒCƒY‚Ì•ÏX + wParam = RXM_WIDTH + lParam = ãˆÊ16bit c•iƒXƒNƒŠ[ƒ“ƒsƒNƒZƒ‹’lj + lParam = ‰ºˆÊ16bit ‰¡•iƒXƒNƒŠ[ƒ“ƒsƒNƒZƒ‹’lj + +8.“®ìƒpƒ‰ƒ[ƒ^‚Ì—v‹ + wParam = RXM_REQPARA + lParam = 0 + + +@MMTTY‚Í‚±‚̃ƒbƒZ[ƒW‚ðŽóM‚·‚邯A‚·‚ׂẴpƒ‰ƒ[ƒ^î•ñ‚ð•Ô‘—‚µ‚Ü‚·B + +9.ƒ{[ƒŒ[ƒg‚ÌÝ’è + wParam = RXM_SETBAUD + lParam = ƒ{[ƒŒ[ƒg’l(x100) + +10.ƒ}[ƒNŽü”g”‚ÌÝ’è + wParam = RXM_SETMARK + lParam = ƒ}[ƒNŽü”g”(Hz) + +11.ƒXƒy[ƒXŽü”g”‚ÌÝ’è + wParam = RXM_SETSPACE + lParam = ƒXƒy[ƒXŽü”g”(Hz) + +12.ƒXƒCƒbƒ`î•ñ‚ÌÝ’è + wParam = RXM_SETSWITCH + lParam = ƒXƒCƒbƒ`î•ñiŒãqj + +13.ƒnƒ€ƒfƒtƒHƒ‹ƒg‚ÌÝ’è + wParam = RXM_SETHAM + lParam = 0x00000000 + +14.ƒZƒbƒgƒAƒbƒvƒEƒCƒ“ƒhƒE‚Ì•\ަ + wParam = RXM_SHOWSETUP + lParam = ƒAƒvƒŠƒP[ƒVƒ‡ƒ“‚Ì–³Œø‰»(0-OFF, 1-ON) + +@lParam‚ª‚P‚Ìê‡AƒZƒbƒgƒAƒbƒvƒEƒCƒ“ƒhƒE‚ª•\ަ‚³‚ê‚Ä‚¢‚éŠúŠÔAŒÄ‚Ño‚µ‘¤ƒAƒvƒŠƒP[ƒVƒ‡ƒ“‚𖳌øó‘Ôiƒ}ƒEƒX‚¨‚æ‚уL[ƒCƒxƒ“ƒg‚ɉž“š‚Å‚«‚È‚­‚È‚éj‚É‚µ‚Ü‚·B‚±‚Ì“®ì‚̓‚[ƒ_ƒ‹ƒ_ƒCƒAƒƒOƒ{ƒbƒNƒX‚ÉŽ—‚Ä‚¢‚Ü‚·B + + +15.•\ަî•ñ‚ÌÝ’è + wParam = RXM_SETVIEW + lParam = •\ަî•ñiŒãqj + +16.ƒXƒPƒ‹ƒ`ƒŒƒxƒ‹‚ÌÝ’è + wParam = RXM_SETSQLVL + lParam = ƒXƒPƒ‹ƒ`ƒŒƒxƒ‹(0-1024) + +17.ƒRƒ“ƒgƒ[ƒ‹ƒpƒlƒ‹‚Ì•\ަƒRƒ“ƒgƒ[ƒ‹ + wParam = RXM_SHOW + lParam = 0-OFF, 1-ON + +18.FIG/LTR‚ÌÝ’è + wParam = RXM_SETFIG + lParam = 0-LTR, 1-FIG + +19.‹¤UŠíƒpƒ‰ƒ[ƒ^‚ÌÝ’è + wParam = RXM_SETRESO + lParam = ‰ºˆÊ16bit IIR‚ÌBW’l + lParam = ãˆÊ16bit FIR‚ÌŽŸ” + +20.Ï•ªŠí‚̃pƒ‰ƒ[ƒ^‚ÌÝ’è + wParam = RXM_SETLPF + lParam = ‰ºˆÊ16bit FIRƒXƒ€[ƒWƒ“ƒOƒtƒBƒ‹ƒ^‚ÌŽü”g” + lParam = ãˆÊ16bit IIR-LPF‚̃JƒbƒgƒIƒtŽü”g” + +21.‘—MƒfƒBƒŒ[‚ÌÝ’è + wParam = RXM_SETTXDELAY + lParam = 0 - 10000 (ms) + +@‘—MƒfƒBƒŒ[‚ðݒ肵‚Ü‚·BƒfƒtƒHƒ‹ƒg‚Í‚O‚Å‚·B + +@MMTTY‚ÍTX/RX‚ÌØ‚è‘Ö‚¦ƒ^ƒCƒ~ƒ“ƒO‚ÅTXM_PTTEVENTƒƒbƒZ[ƒW‚ð‘—M‚µ‚Ü‚·B‚ ‚È‚½‚Í‚±‚̃ƒbƒZ[ƒW‚ðŽóM‚µ‚ÄAŽ©•ªŽ©g‚ÅPTT‚ÌØ‚è‘Ö‚¦‚ðs‚¤‚±‚Æ‚ª‚Å‚«‚Ü‚·B‚µ‚©‚µ—Ⴆ‚ÎRadio Command‚̂悤‚ÉØ‚è‘Ö‚¦‚Ɏ኱‚Ì’x‰„‚ª”­¶‚·‚éê‡AMMTTY‚Ì‘—MŠJŽnƒ^ƒCƒ~ƒ“ƒO‚ð­‚µ’x‚ç‚é•K—v‚ª¶‚¶‚Ü‚·B +@‚±‚Ì(RXM_SETTXDELAY)ƒƒbƒZ[ƒW‚Í‚±‚Ì—p“r‚Ì‚½‚߂ɑ¶Ý‚µ‚Ü‚·B + +22.‹¤—Lƒƒ‚ƒŠ‚ÌXV’Ê’m + wParam = RXM_UPDATECOM + lParam = 0 + +@MMTTY‚ð‹N“®ŒãA‹¤—Lƒƒ‚ƒŠ“à‚ÌcomName, comRadio, tilte‚Ì‚¢‚¸‚ê‚©‚ð•ÏX‚µ‚½‚±‚Æ‚ðMMTTY‚É’Ê’m‚µ‚Ü‚·BMMTTY‚Í‚±‚̃ƒbƒZ[ƒW‚ðŽóM‚·‚邯A‚±‚Ì‚R‚‚̃ƒ“ƒo[‚ðÄ“xŽ©g‚É”½‰f‚³‚¹‚Ü‚·B + + +23.ƒTƒXƒyƒ“ƒh + wParam = RXM_SUSPEND + lParam = 0-Restore, 1-Suspend + + lParam‚É‚P‚ðݒ肵‚½ê‡AMMTTY‚̓TƒEƒ“ƒhƒJ[ƒhAComƒ|[ƒg‚ÌƒŠƒ\[ƒX‚ð‰ð•ú‚µ‚ÄŽ©g‚Ì•\ަ‚ðÁ‚µ‚Ü‚·B + lParam‚É‚O‚ðݒ肵‚½ê‡AMMTTY‚̓TƒEƒ“ƒhƒJ[ƒhAComƒ|[ƒg‚ÌƒŠƒ\[ƒX‚ðŽæ“¾‚µŽ©g‚Ì•\ަ‚𕜌³‚µ‚Ü‚·Bi-mƒIƒvƒVƒ‡ƒ“‚Å‹N“®‚³‚ê‚Ä‚¢‚éê‡AMMTTY‚Ì•\ަ‚ÍON‚ɂȂè‚Ü‚¹‚ñj + + ‚ ‚È‚½‚ªƒTƒEƒ“ƒhƒJ[ƒh‚âComƒ|[ƒg‚ðŽ©•ªŽ©g‚ÅŽg—p‚·‚éê‡AMMTTY‚ðI—¹‚³‚¹‚é‚©A‚Ü‚½‚Í‚±‚̃ƒbƒZ[ƒW‚ðŽg—p‚µ‚ÄMMTTY‚ðƒTƒXƒyƒ“ƒhó‘Ô‚É‚µ‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñB + +24.ƒmƒbƒ`Žü”g”‚ÌÝ’è (Ver1.59AˆÈ~‚Å—LŒø) + wParam = RXM_NOTCH + lParam = ƒmƒbƒ`Žü”g”(Hz) + +25.ƒvƒƒtƒB[ƒ‹‚Ì‹L‰¯‚ƌĂÑo‚µ (Ver1.61ˆÈ~‚Å—LŒø) + wParam = RXM_PROFILE + lParam = ãˆÊ16ËÞ¯Ä 0-ŒÄ‚Ño‚µ, 1-‹L‰¯, 2-Á‹Ž, 3-Load, 4-Save, 5-Assign + lParam = ‰ºˆÊ16ËÞ¯Ä ƒXƒƒbƒg”Ô†(0 - 15) + +@‹L‰¯‚Å‚«‚éƒvƒƒtƒB[ƒ‹‚ÍAƒfƒ‚ƒWƒ…ƒŒ[ƒ^AƒfƒR[ƒ_Aƒ‚ƒWƒ…ƒŒ[ƒ^‚Ìó‘Ô‚Å‚·B + +ŒÄ‚Ño‚µ(lParamãˆÊ16bit=0) + Žw’肵‚½ƒXƒƒbƒg”Ô†‚̃pƒ‰ƒ[ƒ^‚ðŒÄ‚Ño‚µAMMTTY‚Éݒ肵‚Ü‚·Bƒvƒƒtƒ@ƒCƒ‹‚Ì–¼‘O‚Í‹¤—Lƒƒ‚ƒŠProfileNames[x]‚ÅŽQÆ‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B‹¤—Lƒƒ‚ƒŠ‚ðŽg—p‚µ‚Ä‚¢‚È‚¢ê‡‚Í–¼‘O‚ðŽQÆ‚·‚邱‚Ƃ͂ł«‚Ü‚¹‚ñB + +‹L‰¯(lParamãˆÊ16bit=1) + Œ»Ý‚ÌMMTTY‚̃pƒ‰ƒ[ƒ^‚ðŽw’肵‚½ƒXƒƒbƒg”Ô†‚É‹L‰¯‚µ‚Ü‚·Bƒvƒƒtƒ@ƒCƒ‹‚Ì–¼‘O‚Í‹¤—Lƒƒ‚ƒŠ‚ÌProfileNames[x]‚É‚ ‚ç‚©‚¶‚ßݒ肵‚Ä‚¨‚©‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñB‹¤—Lƒƒ‚ƒŠ‚ðŽg—p‚µ‚Ä‚¢‚È‚¢ê‡‚ÍMMTTY‚ª“K“–‚È–¼‘O‚ðŠ„‚è“–‚Ă܂·B + +Á‹Ž(lParamãˆÊ16bit=2) + Žw’肵‚½ƒXƒƒbƒg”Ô†‚̃pƒ‰ƒ[ƒ^‚ðÁ‹Ž‚µ‚Ü‚·B + +@‚·‚ׂẴvƒƒtƒB[ƒ‹‚ÍUserPara.iniƒtƒ@ƒCƒ‹‚É‹L‰¯‚³‚ê‚Ü‚·B‚æ‚èÚ‚µ‚¢Žg—p•û–@‚ɂ‚¢‚Ă͌ãq‚ÌuƒvƒƒtƒB[ƒ‹‚Ì‹L‰¯‚ƌĂÑo‚µv‚ðŽQÆ‚µ‚ĉº‚³‚¢B + +Load(lParamãˆÊ16bit=3) +@ƒtƒ@ƒCƒ‹‘I‘ðƒ_ƒCƒAƒƒOƒ{ƒbƒNƒX‚ð•\ަ‚µAƒvƒƒtƒB[ƒ‹‚ð”CˆÓ‚̃tƒ@ƒCƒ‹‚©‚çƒ[ƒh‚µ‚Ü‚·B + +Save(lParamãˆÊ16bit=4) +@ƒtƒ@ƒCƒ‹‘I‘ðƒ_ƒCƒAƒƒOƒ{ƒbƒNƒX‚ð•\ަ‚µAƒvƒƒtƒB[ƒ‹‚ð”CˆÓ‚̃tƒ@ƒCƒ‹‚ɃZ[ƒu‚µ‚Ü‚·B + +Assign(lParamãˆÊ16bit=5) +@ƒvƒƒtƒ@ƒCƒ‹’è‹`ƒ_ƒCƒAƒƒOƒ{ƒbƒNƒX‚ð•\ަ‚µAƒvƒƒtƒB[ƒ‹‚ð“o˜^‚µ‚Ü‚·B + +26.PTTƒ^ƒCƒ}[‚ÌÝ’è (Ver1.61ˆÈ~‚Å—LŒø) + wParam = RXM_TIMER, + lParam = ƒ^ƒCƒ}[ŽžŠÔ(s) + +@ƒ^ƒCƒ}[ŽžŠÔ‚É‚O‚ðÝ’è‚·‚邯ƒ^ƒCƒ}[‹@”\‚ÍOFF‚ɂȂè‚Ü‚·B + +27.ƒtƒH[ƒJƒXƒ`ƒFƒ“ƒW‚Ì‹–‰Â/•s‹–‰Â (Ver1.63AˆÈ~‚Å—LŒø) + wParam = RXM_ENBFOCUS + lParam = 0-•s‹–‰Â, 1-‹–‰Â + + MMTTY‚ªƒAƒvƒŠƒP[ƒVƒ‡ƒ“‚ւ̃tƒH[ƒJƒXƒ`ƒFƒ“ƒW‚ðŽÀs‚·‚é‚©‚Ç‚¤‚©‚ðݒ肵‚Ü‚·BƒfƒtƒHƒ‹ƒg‚Í‹–‰Â‚ɂȂÁ‚Ä‚¢‚Ü‚·B + +28.ƒfƒtƒHƒ‹ƒgŽü”g”‚ÌÝ’è (Ver1.63BˆÈ~‚Å—LŒø) + wParam = RXM_SETDEFFREQ + lParam = ãˆÊ16ËÞ¯Ä ƒfƒtƒHƒ‹ƒg‚̃Vƒtƒg•[Hz] + lParam = ‰ºˆÊ16ËÞ¯Ä ƒfƒtƒHƒ‹ƒg‚̃}[ƒNŽü”g”[Hz] + + ƒfƒtƒHƒ‹ƒg‚̃}[ƒNŽü”g”‚ƃVƒtƒg•‚ðݒ肵‚Ü‚·BMMTTY‚ÍHAMƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ê‚½ŽžA‚Ü‚½‚ÍNET OFF‚Å‘—M‚ÉØ‚è‘Ö‚¦‚½ŽžA‚±‚ÌŽü”g”‚ðŽQÆ‚µ‚Ü‚·B + +29.ƒrƒbƒg’·‚ÌÝ’è(Ver1.63BˆÈ~‚Å—LŒø) + wParam = RXM_SETLENGTH + lParam = ƒrƒbƒg’·(5, 6, 7, 8) + ‘—ŽóM•„†‚̃rƒbƒg’·‚ð•ÏX‚µ‚Ü‚·B8bit‚ð‘I‘ð‚µ‚½ê‡‚Å‚àA•¶ŽšƒR[ƒhF0`FF‚܂łÍMMTTY“à‚Ì“Á•ʂȃRƒ“ƒgƒ[ƒ‹‚ÅŽg—p‚³‚ê“§‰ß‚³‚ê‚Ü‚¹‚ñB + +30.‹¤—Lƒƒ‚ƒŠXV‚Ì‹–‰Â/•s‹–‰Â(Ver1.64ˆÈ~‚Å—LŒø) + wParam = RXM_ENBSHARED + lParam = 0-•s‹–‰Â, 1-‹–‰Â + + ‹¤—Lƒƒ‚ƒŠ‚ÌXV‚ð‚·‚é‚©‚Ç‚¤‚©‚ðݒ肵‚Ü‚·BƒfƒtƒHƒ‹ƒg‚Í‹–‰Â‚ɂȂÁ‚Ä‚¢‚Ü‚·B + +31.PTTƒ|[ƒg‚ÌFSKo—Í(Ver1.67BˆÈ~‚Å—LŒø) + wParam = RXM_PTTFSK + lParam = 0-NONE, 1-ON(+Sound), 2-ON + + PTTƒ|[ƒg‚©‚çFSKM†‚ðo—Í‚·‚é‚©‚Ç‚¤‚©‚ðݒ肵‚Ü‚·B + + +›MMTTY‚©‚ç‚̃ƒbƒZ[ƒW +~~~~~~~~~~~~~~~~~~~~~~ + wParam‚ªƒƒbƒZ[ƒW”Ô†‚Å‚·BCŒ¾Œê‚Ìenum•¶‚͈ê”Ôæ“ª‚Å’è‹`‚µ‚½’l‚©‚燔Ԃɒl‚ªƒCƒ“ƒNƒŠƒƒ“ƒg‚³‚ê‚Ü‚·B—Ⴆ‚Έȉº‚Ìê‡ATXM_CHAR‚Í0x8003‚ªŠ„‚è“–‚Ä‚ç‚ê‚Ü‚·B + +enum { + TXM_HANDLE=0x8000, // MMTTY -> APP + TXM_REQHANDLE, + TXM_START, + TXM_CHAR, + TXM_PTTEVENT, + + TXM_WIDTH, + TXM_BAUD, + TXM_MARK, + TXM_SPACE, + TXM_SWITCH, + + TXM_VIEW, + TXM_LEVEL, + TXM_FIGEVENT, + TXM_RESO, + TXM_LPF, + + TXM_THREAD, + TXM_PROFILE, + TXM_NOTCH, + TXM_DEFSHIFT, + TXM_RADIOFREQ, + + TXM_SHOWSETUP, + TXM_SHOWPROFILE, +}; + +1.ƒEƒCƒ“ƒhƒEƒnƒ“ƒhƒ‹‚Ì’Ê’m + wParam = TXM_HANDLE + lParam = MMTTY‚̃EƒCƒ“ƒhƒEƒnƒ“ƒhƒ‹ + +@MMTTY‚Í‹N“®ŒãAŽ©g‚̃EƒCƒ“ƒhƒEƒnƒ“ƒhƒ‹‚ð•ÏX‚·‚é‰Â”\«‚Í‚ ‚è‚Ü‚¹‚ñ‚ªAˆÀ‘S‚Ì‚½‚ß‚ÉA‚ ‚È‚½‚Í‚±‚̃ƒbƒZ[ƒW‚ðŽóM‚·‚邯•K‚¸MMTTYƒnƒ“ƒhƒ‹î•ñ‚ðã‘‚«‚µ‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñB + +2.ƒEƒCƒ“ƒhƒEƒnƒ“ƒhƒ‹‚Ì—v‹ + wParam = TXM_REQHANDLE + lParam = 0x00000000 + +@‚±‚̃ƒbƒZ[ƒW‚ÍŒ»ÝŽg‚í‚ê‚Ä‚¢‚Ü‚¹‚ñB + +3.MMTTYŠJŽnî•ñ + wParam = TXM_START + lParam = 0x00000000 + +@MMTTY‚ªÅ‰‹N“®‚³‚ê‚½Žž‚É•ú‘—ƒ‚[ƒhiHWND_BROADCASTj‚Å‘—M‚³‚ê‚Ü‚·B + + +4.‘—ŽóM•¶Žš + wParam = TXM_CHAR + lParam = ‘—ŽóM•¶ŽšiASCIIj + +@•¶Žš‚ðŽóMi‘—Mj‚·‚é–ˆ‚É‚±‚̃ƒbƒZ[ƒW‚ª‘—M‚³‚ê‚Ü‚·B + + -nƒIƒvƒVƒ‡ƒ“‚ð•t‰Á‚µ‚ÄMMTTY‚ð‹N“®‚µ‚½ê‡ABAUDOT•„†•ÏŠ·‚Ís‚í‚ê‚Ü‚¹‚ñB‚±‚ÌꇎóMi‘—Mj‚µ‚½ƒR[ƒh‚ª‚»‚̂܂ÜlParam‚Éݒ肳‚ê‚Ü‚·B + + +5.‘—Žó•ÏXƒCƒxƒ“ƒg + wParam = TXM_PTTEVENT + lParam = 0x00000000 ŽóM‚ÉØ‚è‘Ö‚í‚Á‚½ + lParam = 0x00000001 ‘—M‚ÉØ‚è‘Ö‚í‚Á‚½ + +6.ƒpƒlƒ‹ƒTƒCƒYî•ñ + wParam = TXM_WIDTH + lParam = ãˆÊ16bit c•iƒXƒNƒŠ[ƒ“ƒsƒNƒZƒ‹’lj + lParam = ‰ºˆÊ16bit ‰¡•iƒXƒNƒŠ[ƒ“ƒsƒNƒZƒ‹’lj + +7.ƒ{[ƒŒ[ƒgî•ñ + wParam = TXM_BAUD + lParam = ƒ{[ƒŒ[ƒg’l(x100) + +8.ƒ}[ƒNŽü”g”î•ñ + wParam = TXM_MARK + lParam = ƒ}[ƒNŽü”g”(Hz) + +9.ƒXƒy[ƒXŽü”g”î•ñ + wParam = TXM_SPACE + lParam = ƒXƒy[ƒXŽü”g”(Hz) + +10.ƒXƒCƒbƒ`î•ñ + wParam = TXM_SWITCH + lParam = ƒXƒCƒbƒ`î•ñ(Œãq) + +11.•\ަî•ñ + wParam = TXM_VIEW + lParam = •\ަî•ñ(Œãq) + +12.M†ƒŒƒxƒ‹‚Ì’Ê’m + wParam = TXM_LEVEL + lParam = ãˆÊ16bit@ƒXƒPƒ‹ƒ`ƒŒƒxƒ‹(0-1024) + lParam = ‰ºˆÊ16bit@M†ƒŒƒxƒ‹ + +@‚ ‚È‚½‚Í‚±‚̃ƒbƒZ[ƒW‚É‚æ‚背ƒxƒ‹ƒCƒ“ƒfƒBƒP[ƒ^‚ð쬂ł«‚Ü‚·B‚Ü‚½MMTTY‚Ƃ̋¤—Lƒƒ‚ƒŠ‚ðŽg—p‚µ‚Ä‚¢‚éê‡A‚ ‚È‚½‚Í‚±‚̃ƒbƒZ[ƒW‚É‚æ‚è‚»‚ÌXVƒCƒxƒ“ƒg‚𓯎ž‚É“¾‚鎖‚à‚Å‚«‚Ü‚·B + +13.ƒVƒtƒgî•ñ‚Ì’Ê’m + wParam = TXM_FIGEVENT + lParam = 0-LTR, 1-FIG + +14.‹¤UŠíƒpƒ‰ƒ[ƒ^‚Ì’Ê’m + wParam = TXM_RESO + lParam = ‰ºˆÊ16bit IIR‚ÌBW’l + lParam = ãˆÊ16bit FIR‚ÌŽŸ” + +15.Ï•ªŠí‚̃pƒ‰ƒ[ƒ^‚Ì’Ê’m + wParam = TXM_LPF + lParam = ‰ºˆÊ16bit FIRƒXƒ€[ƒWƒ“ƒOƒtƒBƒ‹ƒ^‚ÌŽü”g” + lParam = ãˆÊ16bit IIR-LPF‚̃JƒbƒgƒIƒtŽü”g” + +16.MMTTY‚̃XƒŒƒbƒhID‚Ì’Ê’m + wParam = TXM_THREAD + lParam = ƒXƒŒƒbƒhID”Ô† + +17.ƒvƒƒtƒB[ƒ‹‚Ì‹L‰¯‚ƌĂÑo‚µ‚ÌŽÀsƒCƒxƒ“ƒg (Ver1.61ˆÈ~‚Å—LŒø) + wParam = TXM_PROFILE + lParam = ãˆÊ16ËÞ¯Ä 0-ŒÄ‚Ño‚µ, 1-‹L‰¯, 2-Á‹Ž + lParam = ‰ºˆÊ16ËÞ¯Ä ƒXƒƒbƒg”Ô†(0 - 15) + +@ƒvƒƒtƒB[ƒ‹‚̌ĂÑo‚µA‹L‰¯AÁ‹Ž‚ªŽÀs‚³‚ê‚½Žž‚É”­¶‚·‚éƒCƒxƒ“ƒg‚Å‚·B + +18.ƒmƒbƒ`Žü”g”î•ñ (Ver1.61ˆÈ~‚Å—LŒø) + wParam = TXM_NOTCH + lParam = ãˆÊ16ËÞ¯Ä Notch1 Žü”g” + lParam = ‰ºˆÊ16ËÞ¯Ä Notch2 Žü”g” + +19.HAMƒfƒtƒHƒ‹ƒgƒVƒtƒgî•ñ (Ver1.61ˆÈ~‚Å—LŒø) + wParam = TXM_DEFSHIFT + lParam = ƒVƒtƒgŽü”g” + +20.RadioCommand‚ÌVFOƒ|[ƒŠƒ“ƒOŽü”g” (Ver1.62CˆÈ~‚Å—LŒø) + wParam = TXM_RADIOFREQ + lParam = Žü”g”(KHz) + +21.ƒZƒbƒgƒAƒbƒvƒEƒCƒ“ƒhƒE‚Ì•\ަƒCƒxƒ“ƒg + wParam = TXM_SHOWSETUP + lParam = 0-•‚¶‚½, 1-ŠJ‚¢‚½ + +22.ƒvƒƒtƒ@ƒCƒ‹‚̃[ƒh/ƒZ[ƒuƒEƒCƒ“ƒhƒE‚Ì•\ަƒCƒxƒ“ƒg + wParam = TXM_SHOWPROFILE + lParam = 0-•‚¶‚½, 1-ŠJ‚¢‚½ + + +›lParam‚̃rƒbƒg’è‹` +~~~~~~~~~~~~~~~~~~~~ + +ƒXƒCƒbƒ`î•ñ + b0-b1 ƒ‚ƒfƒ€ƒ^ƒCƒv 0-IIR, 1-FIR, 2-PLL + b2 AFC + b3 NET + b4 ATC + b5 BPF + b6 LMS/Notch + b7 SQ + b8 Rev + b9 UOS + b10-b11 AFCŽž‚̃VƒtƒgƒAƒ‹ƒSƒŠƒYƒ€ + b12 Ï•ªŠí‚Ì•ûŽ® 0-FIR, 1-IIR + b13 LMS/Notch‚ÌØ‚è‘Ö‚¦ 0-LMS, 1-Notch + b14 0-single notch, 1-two notches + b15 RXM_CHAR‚̈— 0-Key buffer OFF, 1-Key buffer ON + b16 Word warp(Key buffer ON‚ÌŽž) + b17-b18 Way to send(Key buffer ON‚ÌŽž) 0-Char, 1-Word, 2-Line + b19 Dual Peak Filter 0-OFF, 1-ON + +•\ަî•ñ + b0-b2 FFT•\ަ• + b4-b5 FFTƒQƒCƒ“ + b6-b7 FFT‰ž“𑬓x + b8 XYƒXƒR[ƒv‚̃TƒCƒY + b10-b11 XYƒXƒR[ƒv‚Ì•iŽ¿ + b12 XYƒXƒR[ƒv•\ަ + b13 FFTƒQƒCƒ“‚ÌTestƒ‚[ƒh + + +›‹¤—Lƒƒ‚ƒŠƒAƒNƒZƒX +~~~~~~~~~~~~~~~~~~~~ +@MMTTY‚ÍAFFT‚¨‚æ‚Ñ‚w‚xƒXƒR[ƒv‚Ì–¢ˆ—‚̃f[ƒ^‚ðA‚ ‚È‚½‚̃vƒƒOƒ‰ƒ€‚Ɉø‚«“n‚·‚±‚Æ‚ª‚Å‚«‚Ü‚·B‚±‚Ì‹@”\‚ðŽg‚¤‚Æ‚ ‚È‚½‚̃vƒƒOƒ‰ƒ€“à‚ÉAFFT•\ަ‚âWaterfallAXYƒXƒR[ƒv“™‚ðŽ©—R‚ɃfƒUƒCƒ“‚Å‚«‚Ü‚·B +@‚à‚µ‚ ‚È‚½‚ªMMTTY‚̃Rƒ“ƒgƒ[ƒ‹ƒpƒlƒ‹‚ð‚»‚Ì‚Ü‚Ü—˜—p‚·‚é‚̂ł ‚ê‚ÎA‚±‚Ì‹@”\‚ðŽg—p‚·‚é•K—v‚Í“Á‚É‚ ‚è‚Ü‚¹‚ñB + +@‚±‚Ì‹@”\‚ðŽg—p‚·‚é‚É‚ÍA‚ ‚È‚½‚ÍMMTTY‚ð‹N“®‚·‚é‘O‚ÉŽŸ‚̎葱‚«‚ðŽÀs‚µ‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñB + +#pragma pack(1) // Enable pack of structer (VisualC++) +#pragma option -a- // Enable pack of structer (Borland C++Builder) +typedef struct { + LONG smpFreq; // FFT‚Ì•\ަƒTƒ“ƒvƒŠƒ“ƒOŽü”g”(->APP) + CHAR title[128]; // ƒRƒ“ƒgƒ[ƒ‹ƒpƒlƒ‹‚̃^ƒCƒgƒ‹(->MMTTY) + CHAR comName[16]; // PTT/FSK‚̃|[ƒg–¼(->MMTTY) + LONG smpFFT; // 0-11025Hz 1-8000Hzƒx[ƒX(->MMTTY) + LONG flagFFT; // FFTXVƒtƒ‰ƒO(MMTTY <-> APP) + LONG arrayFFT[2048]; // FFT¶ƒf[ƒ^(->APP) + LONG flagXY; // XYXVƒtƒ‰ƒO(MMTTY <-> APP) + LONG arrayX[512]; // ƒ}[ƒNM†‚̶ƒf[ƒ^(->APP) + LONG arrayY[512]; // ƒXƒy[ƒXM†‚̶ƒf[ƒ^(->APP) + CHAR verMMTTY[16]; // MMTTY‚̃o[ƒWƒ‡ƒ“”Ô†(->APP) + CHAR RadioName[16]; // RadioCommand‚̃|[ƒg–¼(->MMTTY) + LONG flagLostSound; // ƒTƒEƒ“ƒh‚ðˆê•”ޏ‚Á‚½Žž‚É^(->APP) + LONG flagOverflow; // “ü—Í‚ª‘å‚«‰ß‚¬‚鎞‚É^(->APP) + LONG errorClock; // (ppm) ƒTƒEƒ“ƒhƒJ[ƒhƒNƒƒbƒN•â³’l(->APP) + LONG smpDemFreq; // ƒfƒ‚ƒWƒ…ƒŒ[ƒ^‚̃Tƒ“ƒvƒŠƒ“ƒOŽü”g”(->APP) + LONG TxBufCount; // ‘—Mƒoƒbƒtƒ@“à‚Ì–¢‘—Mƒf[ƒ^”(->APP) + CHAR ProfileName[16][64]; // ƒvƒƒtƒ@ƒCƒ‹–¼ + + LONG dummy[2048]; // —\”õ—̈æ +}COMARRAY; +#pragma pack() // Disable pack of structer (VisualC++) +#pragma option -a. // Disable pack of structer (Borland C++Builder) + + \‘¢‘̂̃pƒbƒN‚ÌŽwަ‚Í‚¨Žg‚¢‚̃Rƒ“ƒpƒCƒ‰‚ňقȂè‚Ü‚·Bƒƒ“ƒo[ŠÔ‚Ƀ_ƒ~[ƒXƒy[ƒX‚ª‘¶Ý‚µ‚È‚¢‚悤‚É‚µ‚ĉº‚³‚¢B‚à‚¿‚ë‚ñ‘S‘Ì‚ðƒoƒCƒg‚⃃“ƒO‚Ì‚P‚‚̑傫‚È”z—ñ‚Æ‚µ‚ÄAƒIƒtƒZƒbƒg‚É‚æ‚èƒAƒNƒZƒX‚·‚鎖‚à‚Å‚«‚Ü‚·B + +@ +HANDLE hMap; +COMARRAY *pMap = NULL; +hMap = ::CreateFileMapping(HANDLE(0xffffffff), NULL, PAGE_READWRITE, + 0, sizeof(COMARRAY), "MMTTY"); +if( hMap != NULL ){ + pMap = (COMARRAY *)::MapViewOfFile(hMap, FILE_MAP_WRITE, + 0, 0, 0); + if( pMap != NULL ){ + memset(pMap, 0, sizeof(COMARRAY)); // fill memory by 0 + } +} + + MMTTY‚ÍƒŠƒ‚[ƒgƒ‚[ƒh‚Å‹N“®‚³‚ꂽê‡A–¼‘O‚ª"MMTTY"‚̃vƒƒZƒXŠÔ‹¤—Lƒƒ‚ƒŠ‚ðƒI[ƒvƒ“‚·‚鎖‚ðŽŽ‚Ý‚Ü‚·B +@‚±‚Ì‹¤—Lƒƒ‚ƒŠ‚̃I[ƒvƒ“‚ɬŒ÷‚·‚邯AMMTTY‚Í‹¤—Lƒƒ‚ƒŠ‚Ìtitle‚ÆcomName‚𒲂ׂ܂·B +@titleƒƒ“ƒo‚É‚ÍAMMTTY‚̃Rƒ“ƒgƒ[ƒ‹ƒpƒlƒ‹‚̃^ƒCƒgƒ‹‚¨‚æ‚ÑWindowsƒ^ƒXƒNƒo[‚É•\ަ‚³‚¹‚é•¶Žš—ñ‚ðASCIIZ•¶Žš—ñ‚ÅŽw’肵‚Ü‚·B‚±‚̃ƒ“ƒo‚ªNULL•¶Žš—ñ‚Ìê‡AMMTTY‚̓fƒtƒHƒ‹ƒg‚̃^ƒCƒgƒ‹‚ðŽg—p‚µ‚Ü‚·B +@comNameƒƒ“ƒo, comRadioƒƒ“ƒo‚É‚ÍAMMTTY‚ÌPTT§Œä‚̃|[ƒg–¼‚ðASCIIZ•¶Žš—ñ‚ÅŽw’肵‚Ü‚·B‚±‚̃ƒ“ƒo‚ªNULL•¶Žš—ñ‚Ìê‡AMMTTY‚̓fƒtƒHƒ‹ƒg‚̃|[ƒg–¼iƒ†[ƒUÝ’è‚É‚æ‚éj‚ðŽg—p‚µ‚Ü‚·B + + MMTTY‚ÍcomName‚ÆcomRadio‚ª‹N“®ŒãAƒZƒbƒgƒAƒbƒvƒ_ƒCƒAƒƒO‘€ì‚É‚æ‚è•ÏX‚³‚ꂽê‡A‚±‚ê‚ç‚Ì‹¤—Lƒƒ‚ƒŠ‚̃ƒ“ƒo‚ðXV‚µ‚Ü‚·B + +@MMTTY‚Í’èŠú“I‚ÉarrayFFT‚¨‚æ‚ÑarrayX, arrayY‚ðXV‚µATXM_LEVELƒƒbƒZ[ƒW‚ð‘—M‚µ‚Ü‚·B +@‚±‚ÌŽžAMMTTY‚ÍflagFFT‚ª‚O‚Ìꇂ¾‚¯arrayFFT‚ðXV‚µAflagFFT‚É‚P‚ðƒZƒbƒg‚µ‚Ü‚·B‚Ü‚½“¯—l‚ÉflagXY‚ª‚O‚Ìꇂ¾‚¯arrayXCarrayY‚ðXV‚µAflagXY‚É‚P‚ðƒZƒbƒg‚µ‚Ü‚·BTXM_LEVELƒƒbƒZ[ƒW‚Í‚±‚ê‚ç‚̃tƒ‰ƒO‚Ìó‘Ô‚ÉŠÖŒW‚È‚­AMMTTY‚Ì“à•”ƒ^ƒCƒ~ƒ“ƒO‚Å•K‚¸‘—M‚³‚ê‚Ü‚·B + +@‚ ‚È‚½‚ÍTXM_LEVELƒƒbƒZ[ƒW‚ÅXVƒCƒxƒ“ƒg‚𓾂邩A‚Ü‚½‚ÍŽ©•ªŽ©g‚Ì’èŠú“I‚ȃ^ƒCƒ}[ƒCƒxƒ“ƒg‚É‚æ‚èA‚±‚ê‚çî•ñ‚ðŽæ“¾‚Å‚«‚Ü‚·B‚»‚ÌÛA•K‚¸flagFFTAflagXY‚ªƒAƒNƒeƒBƒu‚Å‚ ‚鎖‚ðŠm”F‚µ‚ĉº‚³‚¢B‚Ü‚½Œp‘±‚µ‚ăf[ƒ^‚𓾂邽‚ß‚ÉA‚±‚ê‚ç‚Ì”z—ñî•ñ‚ð—˜—p‚µ‚½ŒãA•K‚¸flagFFT‚¨‚æ‚ÑflagXY‚ð‚O‚ɃZƒbƒg‚µ‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñB + + MMTTY‚ÍA‚ ‚È‚½‚̃vƒƒOƒ‰ƒ€‚ÌŽ©—R“x‚ð‘¸d‚·‚邽‚ß‚ÉA‚±‚±‚ÉŠi”[‚·‚éƒf[ƒ^‚ÉŠÖ‚µ‚Ä‘½‚­‚̉ÁH‚ðs‚¢‚Ü‚¹‚ñB + + FFT‚ÌŽü”g”•ª‰ð”\‚ÍMMTTY‚̃Tƒ“ƒvƒŠƒ“ƒOŽü”g”‚Ɉˑ¶‚µ‚Ü‚·BMMTTY‚̃Tƒ“ƒvƒŠƒ“ƒOŽü”g”‚Í‹¤—Lƒƒ‚ƒŠ“à‚ÌsmpFreqƒƒ“ƒo[‚É‚æ‚Á‚Ä•\‚³‚ê‚Ü‚·B‰Šú’l‚Í11025Hz‚Å‚·‚ªAƒ†[ƒUÝ’è‚É‚æ‚è”÷–­‚É•ÏX‚³‚ê‚é‰Â”\«‚ª‚ ‚è‚Ü‚·B + FFTƒf[ƒ^‚ÌU•‚ÌÅ‘å’l‚Í‚Q‚T‚U‚Å‚·‚ªA‚±‚Ì’l‚ðŽáбã‰ñ‚邱‚Æ‚ª‚ ‚蓾‚Ü‚·B + + ‚à‚µ‚ ‚È‚½‚ªFFT‚̃Tƒ“ƒvƒŠƒ“ƒOŽü”g”‚É8000Hzƒx[ƒX‚ðŠó–]‚·‚é‚È‚ç‚ÎsmpFFTƒƒ“ƒo‚É‚P‚ðݒ肵‚ĉº‚³‚¢BMMTTY‚Í11025Hzƒx[ƒX‚ÌFFTƒf[ƒ^‚ðA8000Hzƒx[ƒX‚̃f[ƒ^‚ɕϊ·‚µ‚Ä‹¤—Lƒƒ‚ƒŠ‚ÉŠi”[‚µ‚Ü‚·B + + XYƒf[ƒ^‚Íí‚É11025Hzƒx[ƒXƒTƒ“ƒvƒŠƒ“ƒO‚Ì”¼•ª‚ÌŽü”g”‚É‚æ‚è•\‚³‚ê‚Ü‚·‚ªA‚±‚ÌŽü”g”‚»‚Ì‚à‚̂͂ ‚È‚½‚ɂƂÁ‚Ă͂ ‚Ü‚èˆÓ–¡‚ðŽ‚½‚È‚¢‚Í‚¸‚Å‚·B +@‚Ü‚½‚±‚ÌU•‚ÍAÅ‘å’l‚ª}16384‚ðŽáбã‰ñ‚邱‚Æ‚ª‚ ‚蓾‚Ü‚·B + +@flagLostSoundƒƒ“ƒo‚ÍA’Êí‚O‚Å‚·‚ªAƒTƒEƒ“ƒhƒJ[ƒhˆ—‚ªŠÔ‚ɇ‚í‚È‚©‚Á‚½Žž‚É‚OˆÈŠO‚ɃZƒbƒg‚³‚ê‚Ü‚·B“¯—l‚ÉflagOverflowƒƒ“ƒo‚àA’Êí‚O‚Å‚·‚ªAƒTƒEƒ“ƒh“ü—Í‚ª‰ß‘åiÅ‘å‚Ì3/4‚ð’´‚¦‚邯‚«j‚ɂȂÁ‚½ê‡‚É‚OˆÈŠO‚ɃZƒbƒg‚³‚ê‚Ü‚·B‚¢‚¸‚ê‚àƒGƒ‰[‚ª‰ðÁ‚·‚邯ީ“®“I‚É‚O‚É–ß‚è‚Ü‚·B +@‚±‚ê‚ç‚Ìó‘Ô‚ðŠÄŽ‹‚·‚éꇂÍATXM_LEVELƒƒbƒZ[ƒW‚̃^ƒCƒ~ƒ“ƒO‚ŕ߂܂¦‚é‚Ì‚ª—Ç‚¢‚Å‚µ‚傤B + +@errorClockƒƒ“ƒo[‚̓†[ƒU‚ªƒZƒbƒgƒAƒbƒv‰æ–ʂŃTƒEƒ“ƒhƒJ[ƒh‚̃Gƒ‰[•Ⳃðs‚Á‚½Œ‹‰Ê‚ðAPPM•\Œ»‚ɕϊ·‚µ‚ÄAMMTTY‚Ì‹N“®Žž‚ÉŠi”[‚³‚ê‚Ü‚·B“¯—l‚É +smpDemFreqƒƒ“ƒo[‚̓fƒ‚ƒWƒ…ƒŒ[ƒ^‚ÌŽÀƒTƒ“ƒvƒŠƒ“ƒOŽü”g”‚ð•\‚µ‚Ü‚·B + +@txBufCountƒƒ“ƒo[‚ÍAMMTTY‚Ì‘—Mƒoƒbƒtƒ@“à‚Ì–¢‘—M‚̃f[ƒ^”‚ð•ÛŽ‚µ‚Ü‚·B‚±‚̃f[ƒ^‚ÍTXM_LEVELƒƒbƒZ[ƒW‚̃^ƒCƒ~ƒ“ƒO‚Ŏ擾‚·‚é‚Ì‚ª—Ç‚¢‚Å‚µ‚傤B + + +›VB‚ł̋¤—Lƒƒ‚ƒŠƒAƒNƒZƒXƒTƒ“ƒvƒ‹ By Bob Furzer K4CY +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ˆÈ‰º‚ÉVB‚©‚ç’¼Ú‹¤—Lƒƒ‚ƒŠ‚ðƒAƒNƒZƒX‚·‚éƒTƒ“ƒvƒ‹ƒR[ƒh‚ðŽ¦‚µ‚Ü‚·B‚±‚̃R[ƒh‚ÍBob‚ª‘‚¢‚½‚à‚Ì‚ðŽQl‚ɂƑ—‚Á‚Ä‚«‚Ä‚­‚ꂽ‚à‚̂ł·(Thanks again Bob)BŽ„‚ÍVB‚ð‚Ü‚Á‚½‚­’m‚ç‚È‚¢‚Ì‚ÅA‚·‚×‚Ä‚ð‚»‚Ì‚Ü‚ÜŒfÚ‚µ‚Ü‚·B + +@‚±‚̃Tƒ“ƒvƒ‹‚ÉŠÖ‚·‚鎿–â‚ðBob‚É‘—‚ç‚È‚¢‚ʼnº‚³‚¢B‚Ü‚½Ž„‚à“š‚¦‚邱‚Æ‚ª‚Å‚«‚Ü‚¹‚ñB + +Global hMap As Long +Global pMap As Long + +Type COMARRAY + smpFreq As Long + title As String * 64 + comName As String * 8 + smpFFT As Long + flagFFT As Long + arrayFFT(2048) As Long + flagXY As Long + arrayX(512) As Long + arrayY(512) As Long + verMMTTY As String * 8 + dummy(2048) As Long +End Type + +Global SharedMemory As COMARRAY + +Private Sub Form_Load() + + Const PAGE_READWRITE = &H4 + Const SECTION_ALL_ACCESS = &H1 Or &H2 Or &H4 Or &H8 Or &H10 Or &HF0000 + + On Error Resume Next + + MMTTY_MSG = RegisterWindowMessage("MMTTY") + hMap = CreateFileMapping(-1, ByVal 0&, &H4, 0&, 20672, "MMTTY") + If hMap <> 0 Then + pMap = MapViewOfFile(hMap, SECTION_ALL_ACCESS, 0, 0, 0) + If pMap <> 0 Then + ZeroMemory ByVal pMap, 20672 + + SharedMemory.title = "RTTY Engine" & Chr$(0) + SharedMemory.radioName = "NONE" & Chr$(0) + SharedMemory.comName = "NONE" & Chr$(0) + SharedMemory.smpFFT = 1 + SharedMemory.flagFFT = 0 + + CopyMemory ByVal pMap + 4, ByVal SharedMemory.title, Len(SharedMemory.title) + CopyMemory ByVal pMap + 132, ByVal SharedMemory.radioName, Len(SharedMemory.radioName) + CopyMemory ByVal pMap + 12464, ByVal SharedMemory.comName, Len(SharedMemory.comName) + CopyMemory ByVal pMap + 148, VarPtr(SharedMemory.smpFFT), 4 + CopyMemory ByVal pMap + 152, VarPtr(SharedMemory.flagFFT), 4 + + X& = Shell("mmtty -t -h" & Hex$(Me.hwnd)) + MMTTYhWnd = FindWindow(vbNullString, SharedMemory.title) + Form1.Caption = Str$(MMTTYhWnd) + Else + X& = MsgBox("MapViewOfFile API Failed", vbOKOnly, "Catastrophic Error") + End If + Else + X& = MsgBox("CreateFileMapping API falied", vbOKOnly, "Catastrophic error") + End If +End Sub + +Private Sub Form_Unload(Cancel As Integer) + If UnmapViewOfFile(pMap) <> 0 Then Call CloseHandle(hMap) + X = PostMessage(MMTTYhWnd, MMTTY_MSG, 0, 0) +End Sub + + +›ƒZƒbƒgƒAƒbƒvƒ_ƒCƒAƒƒOƒ{ƒbƒNƒX +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +@MMTTY‚Í”‘½‚­‚̃pƒ‰ƒ[ƒ^‚ðŽ‚¿‚Ü‚·B‚ ‚È‚½‚ÍRXM_SHOWSETUPƒƒbƒZ[ƒW‚É‚æ‚èƒZƒbƒgƒAƒbƒvƒ_ƒCƒAƒƒO‚ð•\ަ‚³‚¹‚ÄA‚±‚̃ZƒbƒeƒBƒ“ƒO‚Ì‚½‚߂̃†[ƒUƒCƒ“ƒ^[ƒtƒF[ƒX‚ðƒ†[ƒU[‚É’ñ‹Ÿ‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B +@‚ ‚È‚½‚Í‚±‚̃_ƒCƒAƒƒOƒ{ƒbƒNƒX‚É•s–ž‚ðŽ‚Â‚©‚à’m‚ê‚Ü‚¹‚ñB‚µ‚©‚µ‚±‚̃_ƒCƒAƒƒOƒ{ƒbƒNƒX‚ðŽg—p‚µ‚Ä‚¢‚éŒÀ‚èAMMTTY‚̃fƒ‚ƒWƒ…ƒŒ[ƒ^[‚⃂ƒWƒ…ƒŒ[ƒ^[‚Ì“®ì‚ª«—ˆC³‚³‚ꂽꇂɂ¨‚¢‚Ä‚àA‚ ‚È‚½‚̃vƒƒOƒ‰ƒ€‚É—^‚¦‚é‰e‹¿‚ðŬŒÀ‚É—}‚¦‚邱‚Æ‚ª‚Å‚«‚Ü‚·B + + +›ƒvƒƒtƒB[ƒ‹‚Ì‹L‰¯‚ƌĂÑo‚µ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + MMTTY‚Í”‘½‚­‚̃pƒ‰ƒ[ƒ^‚ðŽ‚¿‚Ü‚·B‚µ‚©‚µŽÀۂ̉^—pŽž‚ɃZƒbƒgƒAƒbƒvƒ_ƒCƒAƒƒOƒ{ƒbƒNƒX‚ðŠJ‚¢‚Ä‚»‚ê‚ç‚ð•ÏX‚·‚é‚͎̂኱•s•Ö‚³‚ª‚ ‚è‚Ü‚·B + ‚»‚±‚ÅVer1.60B‚©‚ç‚̓vƒƒtƒB[ƒ‹ƒƒjƒ…[‚ð’ljÁ‚µAƒ†[ƒU‚ªƒpƒ‰ƒ[ƒ^ƒZƒbƒg‚ðˆêЇ‚µ‚ÄŽ©—R‚É‹L‰¯EŒÄ‚Ño‚µ‚ðs‚¦‚邿‚¤‚É‚µ‚Ü‚µ‚½B‚±‚±‚É‹L‰¯‚³‚ê‚é‚̂̓fƒ‚ƒWƒ…ƒŒ[ƒ^AƒfƒR[ƒ_Aƒ‚ƒWƒ…ƒŒ[ƒ^‚̃pƒ‰ƒ[ƒ^‚ÉŒÀ‚ç‚ê‚Ü‚·B + +@ƒXƒ^ƒ“ƒhƒAƒƒ“‚ÌMMTTY‚Í‚WŒÂ‚̃vƒƒtƒB[ƒ‹ƒƒjƒ…[ƒXƒƒbƒg‚ðŽ‚¿‚Ü‚·‚ªAƒŠƒ‚[ƒgƒ‚[ƒh‚ł̓Xƒƒbƒg0`ƒXƒƒbƒg15‚Ü‚ÅÅ‘å‚P‚UŒÂ‚܂ł̃vƒƒtƒB[ƒ‹ƒXƒƒbƒg‚ðŽg—p‚Å‚«‚Ü‚·BƒXƒƒbƒg0`ƒXƒƒbƒg7‚ÍMMTTY‚̃ƒjƒ…[‚ňµ‚í‚ê‚é‚̂Ƌ¤’ʂł·B + +@ƒpƒ‰ƒ[ƒ^‚ÍuUserPara.inivƒtƒ@ƒCƒ‹‚ɃXƒƒbƒg0`ƒXƒƒbƒg15‚ªADefine0`Define15‚܂ł̃Gƒ“ƒgƒŠ‚Æ‚µ‚Ä‹L‰¯‚³‚ê‚Ü‚·B +@‚±‚Ì‹@”\‚Ì‘¼‚Ì—˜—p•û–@‚Æ‚µ‚ÄAƒAƒvƒŠƒP[ƒVƒ‡ƒ“‚ÍINIƒtƒ@ƒCƒ‹‚̈ꕔ‚̃pƒ‰ƒ[ƒ^‚ð’¼Ú‘‚«Š·‚¦‚½Œã‚ÉARXM_PROFILEƒƒbƒZ[ƒW‚ðMMTTY‚É‘—M‚µA“Á’è‚̃pƒ‰ƒ[ƒ^‚ð”CˆÓ‚É•ÏX‚·‚邱‚Æ‚à‚Å‚«‚Ü‚·B‚»‚Ìꇂ̓Xƒƒbƒg15iDefine15j‚ðƒeƒ“ƒ|ƒ‰ƒŠ‚̃Xƒƒbƒg‚Æ‚µ‚ÄŽg‚¤‚±‚Æ‚ð‚¨Š©‚ß‚µ‚Ü‚·B + +@‚à‚µ‚ ‚È‚½‚ªƒpƒ‰ƒ[ƒ^ƒZƒbƒg‚É“Á•ʂȒñˆÄi—Ⴆ‚΃tƒ‰ƒbƒ^[‚âƒ}ƒ‹ƒ`ƒpƒX‚É—LŒø‚ȃpƒ‰ƒ[ƒ^j‚ðŽ‚Â‚È‚ç‚ÎA‚»‚̃pƒ‰ƒ[ƒ^‚ð‹L‰¯‚µ‚½UserPara.iniƒtƒ@ƒCƒ‹‚ðA‚ ‚È‚½‚Ì”z•zƒtƒ@ƒCƒ‹‚Ɋ܂߂ÄAƒ†[ƒU‚É‚»‚Ì‹@”\‚ð’ñ‹Ÿ‚·‚邱‚Ƃ͗ǂ¢l‚¦‚Å‚·B‚»‚ÌÛA•ÏX‚µ‚½‚­‚È‚¢ŒÂX‚̃pƒ‰ƒ[ƒ^‚ɂ‚¢‚Ä‚ÍA’P‚É‚»‚̃pƒ‰ƒ[ƒ^’è‹`s‚ðUserPara.ini‚©‚çƒGƒfƒBƒ^‚Å휂µ‚Ä‚¨‚¯‚ÎOK‚Å‚·B + + MMTTY‚ªƒvƒƒtƒB[ƒ‹‚ð‹L˜^‚·‚éÛAUserPara.ini“à‚ÅŠÇ—‚·‚éƒvƒƒtƒB[ƒ‹‚Ì–¼‘OiName=j‚ÍA‹¤—Lƒƒ‚ƒŠ‚ðŽg—p‚µ‚Ä‚¢‚È‚¢ê‡‚ÍŽ©“®“I‚É"Remote 1"`"Remote 16"‚Ì–¼‘O‚ªŠ„‚è“–‚Ä‚ç‚ê‚Ü‚·B‚ ‚È‚½‚̃vƒƒOƒ‰ƒ€“à‚ŕʂ̖¼‘O‚ð’è‹`‚·‚éꇂÍUserPara.ini“à‚É“Á•ʂȃGƒ“ƒgƒŠi—Ⴆ‚Î RemoteName=j‚ð쬂µA‚»‚±‚É‹L˜^‚·‚邿‚¤‚É‚·‚ê‚Ηǂ¢‚Å‚µ‚傤BMMTTY‚Í‚ ‚È‚½‚ª’ljÁ‚µ‚½ƒGƒ“ƒgƒŠ‚Ì“à—e‚ð•ÏX‚µ‚Ü‚¹‚ñB + + +›‚»‚Ì‘¼ +~~~~~~~~ +@ƒŠƒ‚[ƒgƒ‚[ƒh‚ÍAMMTTY.EXE‚݂̂łà‹N“®‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B‚ ‚È‚½‚ª–³—¿ƒ\ƒtƒg‚ð”z•z‚·‚éê‡A‚à‚µ•K—v‚È‚ç‚ÎMMTTY.EXE‚ð‚ ‚È‚½‚̃pƒbƒP[ƒW‚Ɋ܂߂邱‚Æ‚ð‹ÖŽ~‚µ‚Ü‚¹‚ñB‚»‚Ìê‡AŽ„iJE3HHTj‚ւ̘A—‚ÍˆêØ•K—v‚ ‚è‚Ü‚¹‚ñB‚Ç‚¤‚¼Ž©—R‚É‚â‚Á‚ĉº‚³‚¢B‚ ‚È‚½‚̃vƒƒOƒ‰ƒ€‚ÌK‰^‚ð‹F‚è‚Ü‚·B + +73, Mako - JE3HHT + \ No newline at end of file diff --git a/temp.txt b/temp.txt new file mode 100644 index 0000000..33ea5f8 --- /dev/null +++ b/temp.txt @@ -0,0 +1,833 @@ +#include +#pragma hdrstop + +#include "Wave.h" + +//--------------------------------------------------------------------------- +// ‰Šú‰» +__fastcall CWave::CWave(void) +{ + m_Error = 0; + m_InOpen = m_OutOpen = FALSE; + m_hin = NULL; + m_hout = NULL; + m_InEvent = NULL; + m_OutEvent = NULL; + for( int i = 0; i < WAVE_FIFO_MAX; i++ ){ + m_pInBuff[i] = m_pOutBuff[i] = NULL; + } + m_pOutBase = m_pInBase = NULL; + m_InBuffSize = 1024; + m_OutBuffSize = 1024; + m_OutFirst = FALSE; + m_InFifoSize = 12; + m_OutFifoSize = 4; + m_SoundStereo = 1; + m_pDLL = NULL; + ::InitializeCriticalSection(&m_InCS); + ::InitializeCriticalSection(&m_OutCS); +} + +//--------------------------------------------------------------------------- +// I—¹ŽžŽÀsƒ‹[ƒ`ƒ“ +__fastcall CWave::~CWave() +{ + ::DeleteCriticalSection(&m_InCS); + ::DeleteCriticalSection(&m_OutCS); + if( m_pDLL ){ + delete m_pDLL; + m_pDLL = NULL; + } +} +#if 0 +//--------------------------------------------------------------------------- +// ƒTƒEƒ“ƒhƒJ[ƒh‚Ì–â‚¢‡‚킹 +BOOL __fastcall CWave::IsFormatSupported(LPWAVEFORMATEX pWFX, UINT IDDevice) +{ + return (::waveOutOpen( + NULL, // ptr can be NULL for query + IDDevice, // the device identifier + pWFX, // defines requested format + NULL, // no callback + NULL, // no instance data + WAVE_FORMAT_QUERY // query only, do not open device + ) ? FALSE : TRUE); +} +#endif +//--------------------------------------------------------------------------- +// ƒTƒEƒ“ƒhƒJ[ƒh‚Ì“ü—͂ł̃I[ƒvƒ“ +// WFX.wFormatTag = WAVE_FORMAT_PCM; +// WFX.nChannels = 1; +// WFX.wBitsPerSample = 16; +// WFX.nSamplesPerSec = 11025; +// WFX.nBlockAlign = WORD(WFX.nChannels *(WFX.wBitsPerSample/8)); +// WFX.nAvgBytesPerSec = WFX.nBlockAlign * WFX.nSamplesPerSec; +// WFX.cbSize = 0; +BOOL __fastcall CWave::InOpen(LPWAVEFORMATEX pWFX, UINT IDDevice, DWORD Size) +{ + if( m_pDLL ){ + m_InOpen = m_pDLL->InOpen(pWFX->nSamplesPerSec, Size); + if( !m_InOpen ) PumpMessages(); + return m_InOpen; + } + int i; + + if( m_InOpen ) InClose(); + m_Error = 0; + m_InWait = m_InOver = FALSE; + m_InWP = m_InRP = m_InBC = 0; + m_IWFX = *pWFX; + m_InBuffSize = Size * (m_IWFX.wBitsPerSample/8) * m_IWFX.nChannels; + m_InMemSize = sizeof(WAVEHDR) + m_InBuffSize; + if( m_InMemSize & 3 ) m_InMemSize += 4 - (m_InMemSize & 3); + m_InAllocSize = m_InMemSize * m_InFifoSize; + m_InEvent = ::CreateEvent(NULL, FALSE, FALSE, NULL); + // ƒTƒEƒ“ƒhƒJ[ƒh‚̃I[ƒvƒ“ + if( (m_Error = ::waveInOpen( &m_hin, IDDevice, pWFX, (DWORD)WaveInProc, (DWORD)this, CALLBACK_FUNCTION ) ) != MMSYSERR_NOERROR ){ + InClose(); + return FALSE; + } + // ƒoƒbƒtƒ@‚Ì€”õ + m_pInBase = new char[m_InAllocSize]; + ::VirtualLock(m_pInBase, m_InAllocSize); + memset(m_pInBase, 0, m_InAllocSize); + LPSTR p = m_pInBase; + for( i=0; i < m_InFifoSize; i++, p += m_InMemSize ){ + m_pInBuff[i] = (WAVEHDR *)p; + ((WAVEHDR *)p)->dwBufferLength = m_InBuffSize; + ((WAVEHDR *)p)->dwFlags = 0; + ((WAVEHDR *)p)->dwUser = NULL; + ((WAVEHDR *)p)->dwBytesRecorded = NULL; + ((WAVEHDR *)p)->lpData = p + sizeof(WAVEHDR); + if( (m_Error = ::waveInPrepareHeader(m_hin, (WAVEHDR *)p, sizeof(WAVEHDR)) ) != MMSYSERR_NOERROR ){ + InClose(); + return FALSE; + } + if( (m_Error = ::waveInAddBuffer(m_hin, (WAVEHDR *)p, sizeof(WAVEHDR)) ) != MMSYSERR_NOERROR ){ + InClose(); + return FALSE; + } + } + // Žæ‚肱‚݂̊JŽn + if( (m_Error = ::waveInStart(m_hin) ) != MMSYSERR_NOERROR ){ + InClose(); + return FALSE; + } + m_InOpen = TRUE; + return TRUE; +} +//--------------------------------------------------------------------------- +void __fastcall CWave::InClose() +{ + if( m_pDLL ){ + m_pDLL->InClose(); + m_InOpen = FALSE; + PumpMessages(); + return; + } + int i; + + if(NULL != m_hin){ + ::waveInReset(m_hin); + if( m_pInBase != NULL ){ + for( i=0; i < m_InFifoSize; i++ ){ + if( m_pInBuff[i] != NULL ){ + if( m_pInBuff[i]->dwFlags & WHDR_PREPARED ){ + ::waveInUnprepareHeader(m_hin, m_pInBuff[i], sizeof(WAVEHDR)); + } + } + } + } + ::waveInClose(m_hin); + m_hin = NULL; + if( m_pInBase != NULL ){ + ::VirtualUnlock(m_pInBase, m_InAllocSize); + delete[] m_pInBase; //JA7UDE 0428 + m_pInBase = NULL; + } + } + if(m_InEvent != NULL){ + ::CloseHandle(m_InEvent); + m_InEvent = NULL; + } + m_InOpen = FALSE; +} +//--------------------------------------------------------------------------- +BOOL __fastcall CWave::InRead(double* pData, int Len) +{ + if( m_pDLL ){ + return m_pDLL->InRead(pData, Len); + } + int i; + + if( !m_InOpen ){ + m_Error = 1; + return FALSE; + } + if( m_InOver ){ + m_Error = 1; + InClose(); + return FALSE; + } + + ::EnterCriticalSection(&m_InCS); + if( !m_InBC ){ // ‚Ü‚¾ƒf[ƒ^‚ª‘¶Ý‚µ‚È‚¢Žž + m_InWait++; + ::LeaveCriticalSection(&m_InCS); + // ƒoƒbƒtƒ@‚Ƀf[ƒ^‚ª—­‚Ü‚é‚܂ő҂ + if( ::WaitForSingleObject( m_InEvent, WAVE_TIMEOUT_EVENT ) != WAIT_OBJECT_0 ){ + m_Error = 1; + InClose(); + return FALSE; + } + } + else { + ::LeaveCriticalSection(&m_InCS); + } + // ƒf[ƒ^‚ð•‚“®­”“_‚ɕϊ· + LPWAVEHDR hp = m_pInBuff[m_InRP]; + if( m_IWFX.wBitsPerSample == 16 ){ // 16bits + SHORT *rp = (SHORT *)hp->lpData; + if( m_IWFX.nChannels == 2 ){ + if( m_SoundStereo == 1 ){ // Left + for( i = 0; i < Len; i++, pData++ ){ + *pData = double(*rp++); + rp++; + } + } + else { // Right + for( i = 0; i < Len; i++, pData++ ){ + rp++; + *pData = double(*rp++); + } + } + } + else { + for( i = 0; i < Len; i++, pData++ ){ + *pData = double(*rp++); + } + } + } + else { // 8bits + union { + struct { + BYTE low; + BYTE high; + }bd; + SHORT wd; + }data; + data.bd.low = 0; + BYTE *rp = (BYTE *)hp->lpData; + if( m_IWFX.nChannels == 2 ){ + if( m_SoundStereo == 1 ){ // Left + for( i = 0; i < Len; i++, pData++ ){ + data.bd.high = BYTE((*rp++) - 128); + *pData = double(data.wd); + rp++; + } + } + else { // Right + for( i = 0; i < Len; i++, pData++ ){ + rp++; + data.bd.high = BYTE((*rp++) - 128); + *pData = double(data.wd); + } + } + } + else { + for( i = 0; i < Len; i++, pData++ ){ + data.bd.high = BYTE((*rp++) - 128); + *pData = double(data.wd); + } + } + } + hp->dwBytesRecorded = NULL; + ::waveInAddBuffer(m_hin, hp, sizeof(WAVEHDR)); + m_InBC--; // ‚P–½—߂œWŠJ‚³‚ê‚é‚̂ŠCriticalSection ‚Í•s—v + m_InRP++; + if( m_InRP >= m_InFifoSize){ + m_InRP = 0; + } + return TRUE; +} +//--------------------------------------------------------------------------- +//void CALLBACK WaveProc(hWave, uMsg, dwInstance, dwParam1, dwParam2) +// +//HWAVE hWave; /* ƒEƒF[ƒuƒtƒH[ƒ€ ƒfƒoƒCƒX‚̃nƒ“ƒhƒ‹ */ +//UINT uMsg; /* ‘—‚郃bƒZ[ƒW */ +//DWORD dwInstance; /* ƒCƒ“ƒXƒ^ƒ“ƒX ƒf[ƒ^ */ +//DWORD dwParam1; /* ƒAƒvƒŠƒP[ƒVƒ‡ƒ“’è‹`‚̃pƒ‰ƒ[ƒ^ */ +//DWORD dwParam2; /* ƒAƒvƒŠƒP[ƒVƒ‡ƒ“’è‹`‚̃pƒ‰ƒ[ƒ^ */ +void CALLBACK WaveInProc(HWAVE m_hin, UINT uMsg, CWave* pWave, DWORD dwParam1, DWORD dwParam2 ) +{ + if( uMsg == MM_WIM_DATA ){ + ::EnterCriticalSection(&pWave->m_InCS); + pWave->m_InBC++; + pWave->m_InWP++; + if( pWave->m_InWP >= pWave->m_InFifoSize ) pWave->m_InWP = 0; + if( pWave->m_InBC > pWave->m_InFifoSize ) pWave->m_InOver = TRUE; + if(pWave->m_InWait){ + pWave->m_InWait--; + ::SetEvent(pWave->m_InEvent); + } + ::LeaveCriticalSection(&pWave->m_InCS); + } +} +//--------------------------------------------------------------------------- +// ƒTƒEƒ“ƒhƒJ[ƒh‚Ìo—͂ł̃I[ƒvƒ“ +// WFX.wFormatTag = WAVE_FORMAT_PCM; +// WFX.nChannels = 1; +// WFX.wBitsPerSample = 16; +// WFX.nSamplesPerSec = 11025; +// WFX.nBlockAlign = WORD(WFX.nChannels *(WFX.wBitsPerSample/8)); +// WFX.nAvgBytesPerSec = WFX.nBlockAlign * WFX.nSamplesPerSec; +// WFX.cbSize = 0; +BOOL __fastcall CWave::OutOpen(LPWAVEFORMATEX pWFX, UINT IDDevice, DWORD Size) +{ + if( m_pDLL ){ + m_OutOpen = m_pDLL->OutOpen(pWFX->nSamplesPerSec, Size); + if( !m_OutOpen ) PumpMessages(); + return m_OutOpen; + } + if( m_OutOpen ) OutAbort(); + m_Error = 0; + m_OutBCC = 0x7fffffff; + m_OutWait = FALSE; + m_OutUnder = FALSE; + m_OutWP = m_OutRP = m_OutBC = 0; + m_OWFX = *pWFX; + m_OutBuffSize = Size * (m_OWFX.wBitsPerSample/8) * m_OWFX.nChannels; + m_OutMemSize = sizeof(WAVEHDR) + m_OutBuffSize; + if( m_OutMemSize & 3 ) m_OutMemSize += 4 - (m_OutMemSize & 3); + m_OutAllocSize = m_OutMemSize * m_OutFifoSize; + m_OutEvent = ::CreateEvent(NULL, FALSE,FALSE,NULL); + if( (m_Error = ::waveOutOpen( &m_hout, IDDevice , pWFX, (DWORD)WaveOutProc, (DWORD)this, CALLBACK_FUNCTION ) ) != MMSYSERR_NOERROR ){ + OutAbort(); + return FALSE; + } + if( (m_Error = ::waveOutPause(m_hout))!= MMSYSERR_NOERROR ){ + OutAbort(); + return FALSE; + } + // ƒoƒbƒtƒ@[‚Ì€”õ + m_pOutBase = new char[m_OutAllocSize]; + ::VirtualLock(m_pOutBase, m_OutAllocSize); + memset(m_pOutBase, 0, m_OutAllocSize); + LPSTR p = m_pOutBase; + for(int i = 0; i < m_OutFifoSize; i++, p += m_OutMemSize ){ + m_pOutBuff[i] = (WAVEHDR *)p; + ((WAVEHDR *)p)->dwBufferLength = m_OutBuffSize; + ((WAVEHDR *)p)->dwFlags = 0; + ((WAVEHDR *)p)->dwUser = NULL; + ((WAVEHDR *)p)->dwLoops = NULL; + ((WAVEHDR *)p)->lpData = p + sizeof(WAVEHDR); + if( (m_Error = ::waveOutPrepareHeader(m_hout, (WAVEHDR *)p, sizeof(WAVEHDR)) ) != MMSYSERR_NOERROR ){ + OutAbort(); + return FALSE; + } + } + m_OutOpen = TRUE; + m_OutFirst = TRUE; + return TRUE; +} +#if 0 +//--------------------------------------------------------------------------- +DWORD __fastcall CWave::GetOutVolume(void) +{ + if( !m_OutOpen ){ + return 0x8000; + } + DWORD vol; + ::waveOutGetVolume(m_hout, &vol); + return vol; +} +//--------------------------------------------------------------------------- +BOOL __fastcall CWave::SetOutVolume(DWORD vol) +{ + if( !m_OutOpen ){ + return FALSE; + } + ::waveOutSetVolume(m_hout, vol); + return TRUE; +} +#endif +//--------------------------------------------------------------------------- +BOOL __fastcall CWave::OutWrite(double *pData, int Len) +{ + if( m_pDLL ){ + return m_pDLL->OutWrite(pData, Len); + } + if( !Len ) return 0; + int i; + if( !m_OutOpen ){ + m_Error = 1; + return FALSE; + } + if( m_OutUnder ){ + m_Error = 1; + OutAbort(); + return FALSE; + } + + // ‘—Mƒoƒbƒtƒ@‹ó‚«‘Ò‚¿ + EnterCriticalSection(&m_OutCS); + if( m_OutBC >= m_OutFifoSize ){ + m_OutWait++; + ::LeaveCriticalSection(&m_OutCS); + if( ::WaitForSingleObject( m_OutEvent, WAVE_TIMEOUT_EVENT ) != WAIT_OBJECT_0 ){ + m_Error = 2; + OutAbort(); + return FALSE; + } + } + else { + ::LeaveCriticalSection(&m_OutCS); + } + + // ƒf[ƒ^‚̕ϊ· + LPWAVEHDR hp = m_pOutBuff[m_OutWP]; + if(m_OWFX.wBitsPerSample == 16){ // 16bits + SHORT *wp = (SHORT *)hp->lpData; + if( m_OWFX.nChannels == 2 ){ + for( i = 0; i < Len; i++, pData++ ){ + *wp++ = (SHORT)(*pData); + *wp++ = (SHORT)(*pData); + } + } + else { + for( i = 0; i < Len; i++, pData++ ){ + *wp++ = (SHORT)(*pData); + } + } + } + else { // 8bits + BYTE *wp = (BYTE *)hp->lpData; + union { + struct { + BYTE low; + BYTE high; + }bd; + SHORT wd; + }data; + if( m_OWFX.nChannels == 2 ){ + for( i = 0; i < Len; i++, pData++ ){ + data.wd = (SHORT)((*pData) + 32768); + *wp++ = data.bd.high; + *wp++ = data.bd.high; + } + } + else { + for( i = 0; i < Len; i++, pData++ ){ + data.wd = (SHORT)((*pData) + 32768); + *wp++ = data.bd.high; + } + } + } + ::waveOutWrite(m_hout, hp, sizeof(WAVEHDR) ); + m_OutBC++; // ‚P–½—߂œWŠJ‚³‚ê‚é‚̂ŠCriticalSection ‚Í•s—v + if( m_OutFirst ){ + if( (m_OutBC >= 8) || (m_OutBC >= (m_OutFifoSize-1)) ){ + m_OutFirst = FALSE; + ::waveOutRestart( m_hout ); + } + } + m_OutWP++; + if( m_OutWP >= m_OutFifoSize){ + m_OutWP = 0; + } + return TRUE; +} +//--------------------------------------------------------------------------- +void __fastcall CWave::OutFlush() +{ + if( m_pDLL ){ + m_pDLL->OutFlush(); + return; + } + if(m_hout != NULL){ + // ƒoƒbƒtƒ@‘—M‘Ò‚¿ + while(1){ + ::EnterCriticalSection(&m_OutCS); + if( m_OutBC > 0 ){ // –¢‘—oƒf[ƒ^‚ª‘¶Ý‚·‚éê‡ + m_OutWait++; + ::LeaveCriticalSection(&m_OutCS); + if( ::WaitForSingleObject( m_OutEvent, WAVE_TIMEOUT_EVENT ) != WAIT_OBJECT_0 ){ + m_Error = 2; + break; + } + } + else { + ::LeaveCriticalSection(&m_OutCS); + break; + } + } + } +} +//--------------------------------------------------------------------------- +void __fastcall CWave::OutAbort() +{ + if( m_pDLL ){ + m_pDLL->OutAbort(); + m_OutOpen = FALSE; + PumpMessages(); + return; + } + if(m_hout != NULL){ + ::waveOutReset(m_hout); + ::Sleep(1); // for the timing + // ƒoƒbƒtƒ@‚̉ð•ú + if( m_pOutBase != NULL ){ + for(int i = 0; i < m_OutFifoSize; i++ ){ + if( m_pOutBuff[i] != NULL ){ + if( m_pOutBuff[i]->dwFlags & WHDR_PREPARED ){ + ::waveOutUnprepareHeader(m_hout, m_pOutBuff[i], sizeof(WAVEHDR)); + } + } + } + } + ::waveOutClose(m_hout); + m_hout = NULL; + if( m_pOutBase != NULL ){ + ::VirtualUnlock(m_pOutBase, m_OutAllocSize); + delete[] m_pOutBase; + m_pOutBase = NULL; + } + } + if(m_OutEvent != NULL){ + ::CloseHandle(m_OutEvent); + m_OutEvent = NULL; + } + m_OutOpen = FALSE; +} +//--------------------------------------------------------------------------- +//void CALLBACK WaveProc(hWave, uMsg, dwInstance, dwParam1, dwParam2) +// +//HWAVE hWave; /* ƒEƒF[ƒuƒtƒH[ƒ€ ƒfƒoƒCƒX‚̃nƒ“ƒhƒ‹ */ +//UINT uMsg; /* ‘—‚郃bƒZ[ƒW */ +//DWORD dwInstance; /* ƒCƒ“ƒXƒ^ƒ“ƒX ƒf[ƒ^ */ +//DWORD dwParam1; /* ƒAƒvƒŠƒP[ƒVƒ‡ƒ“’è‹`‚̃pƒ‰ƒ[ƒ^ */ +//DWORD dwParam2; /* ƒAƒvƒŠƒP[ƒVƒ‡ƒ“’è‹`‚̃pƒ‰ƒ[ƒ^ */ +void CALLBACK WaveOutProc(HWAVE m_hout, UINT uMsg, CWave* pWave, DWORD dwParam1, DWORD dwParam2 ) +{ + if( uMsg == WOM_DONE ){ + EnterCriticalSection(&pWave->m_OutCS); + pWave->m_OutBCC--; + pWave->m_OutBC--; + pWave->m_OutRP++; + if( pWave->m_OutRP >= pWave->m_OutFifoSize) pWave->m_OutRP = 0; + if( !pWave->m_OutBC ) pWave->m_OutUnder = TRUE; + if(pWave->m_OutWait){ + pWave->m_OutWait--; + SetEvent(pWave->m_OutEvent); + } + LeaveCriticalSection(&pWave->m_OutCS); + } +} + +//--------------------------------------------------------------------------- +int __fastcall CWave::GetInBC(void) +{ + if( m_pDLL ){ + return m_pDLL->GetInBC(); + } + else { + return m_InBC; + } +} +//--------------------------------------------------------------------------- +int __fastcall CWave::GetOutBC(void) +{ + if( m_pDLL ){ + return m_pDLL->GetOutBC(); + } + else { + return m_OutBC; + } +} +//--------------------------------------------------------------------------- +int __fastcall CWave::GetOutBCC(void) +{ + if( m_pDLL ){ + return m_pDLL->GetOutBCC(); + } + else { + return m_OutBCC; + } +} +//--------------------------------------------------------------------------- +void __fastcall CWave::SetOutBCC(int count) +{ + if( m_pDLL ){ + m_pDLL->SetOutBCC(count); + } + else { + m_OutBCC = count; + } +} +//--------------------------------------------------------------------------- +int __fastcall CWave::IsInBufCritical(void) +{ + if( m_pDLL ){ + return m_pDLL->IsInBufCritical(); + } + else { + return ( m_InBC >= (m_InFifoSize/2) ) ? 1 : 0; + } +} +//--------------------------------------------------------------------------- +int __fastcall CWave::IsOutBufCritical(void) +{ + if( m_pDLL ){ + return m_pDLL->IsOutBufCritical(); + } + else { + return (m_OutBC <= (m_OutFifoSize/2)) ? 1 : 0; + } +} +//--------------------------------------------------------------------------- +int __fastcall CWave::IsOutBufFull(void) +{ + if( m_pDLL ){ + return m_pDLL->IsOutBufFull(); + } + else { + return (m_OutBC >= m_OutFifoSize) ? 1 : 0; + } +} +//--------------------------------------------------------------------------- +void __fastcall CWave::SetPTT(LONG tx) +{ + if( m_pDLL ) m_pDLL->SetPTT(tx); +} +//--------------------------------------------------------------------------- +int __fastcall CWave::GetTimeout(void) +{ + if( m_pDLL ){ + return m_pDLL->GetTimeout(); + } + else { + return 5000; + } +} +//--------------------------------------------------------------------------- +void __fastcall CWave::UpdateDevice(int ID) +{ + if( ID == -2 ){ + if( (m_pDLL == NULL) || m_pDLL->IsNameChange() ){ + if( m_pDLL ) delete m_pDLL; + m_pDLL = new CXWave(sys.m_SoundMMW.c_str()); + } + } + else if( m_pDLL != NULL ){ + delete m_pDLL; + m_pDLL = NULL; + } +} +//--------------------------------------------------------------------------- +void __fastcall CWave::PumpMessages(void) +{ + if( m_pDLL ){ + m_pDLL->PumpMessages(); + } +} + + + +//*************************************************************************** +// CXWave class +//--------------------------------------------------------------------------- +__fastcall CXWave::CXWave(LPCSTR pName) +{ + m_ItemName = pName; + + char Name[MAX_PATH]; + if( !*GetEXT(pName) ){ + wsprintf(Name, "%s.mmw", pName); + pName = Name; + } + + m_hLib = ::LoadLibrary(pName); + if( m_hLib ){ + + fmmwPumpMessages = PROC(mmwPumpMessages); + fmmwSetPTT = PROC(mmwSetPTT); + fmmwGetTimeout = PROC(mmwGetTimeout); + + fmmwInOpen = PROC(mmwInOpen); + fmmwInClose = PROC(mmwInClose); + fmmwInRead = PROC(mmwInRead); + + fmmwGetInExist = PROC(mmwGetInExist); + fmmwIsInCritical = PROC(mmwIsInCritical); + + fmmwOutOpen = PROC(mmwOutOpen); + fmmwOutAbort = PROC(mmwOutAbort); + fmmwOutFlush = PROC(mmwOutFlush); + fmmwOutWrite = PROC(mmwOutWrite); + + fmmwIsOutCritical = PROC(mmwIsOutCritical); + fmmwIsOutFull = PROC(mmwIsOutFull); + fmmwGetOutRemaining = PROC(mmwGetOutRemaining); + fmmwGetOutCounter = PROC(mmwGetOutCounter); + fmmwSetOutCounter = PROC(mmwSetOutCounter); + + + if( !m_hLib ){ + FreeLib(); + } + } +} +//--------------------------------------------------------------------------- +__fastcall CXWave::~CXWave(void) +{ + if( m_hLib ){ + fmmwOutAbort(); + fmmwInClose(); + } + FreeLib(); +} +//--------------------------------------------------------------------------- +FARPROC __fastcall CXWave::GetProc(LPCSTR pName) +{ + if( !m_hLib ) return NULL; + + FARPROC fn = ::GetProcAddress(m_hLib, pName+1); + if( fn == NULL ){ + fn = ::GetProcAddress(m_hLib, pName); + if( fn == NULL ) FreeLib(); + } + return fn; +} +//--------------------------------------------------------------------------- +void __fastcall CXWave::FreeLib(void) +{ + if( m_hLib ){ + FreeLibrary(m_hLib); + m_hLib = NULL; + } +} +//--------------------------------------------------------------------------- +BOOL __fastcall CXWave::IsNameChange(void) +{ + return strcmpi(m_ItemName.c_str(), sys.m_SoundMMW.c_str()); +} +//--------------------------------------------------------------------------- +void __fastcall CXWave::PumpMessages(void) +{ + if( !IsLib() ) return; + + fmmwPumpMessages(); +} +//--------------------------------------------------------------------------- +BOOL __fastcall CXWave::InOpen(int sampfreq, int size) +{ + if( !IsLib() ) return FALSE; + + return fmmwInOpen(sampfreq, size); +} +//--------------------------------------------------------------------------- +void __fastcall CXWave::InClose(void) +{ + if( !IsLib() ) return; + + fmmwInClose(); +} +//--------------------------------------------------------------------------- +BOOL __fastcall CXWave::InRead(double *p, int len) +{ + if( !IsLib() ) return FALSE; + + int r = fmmwInRead(m_InBuff); + if( r ){ + SHORT *s = m_InBuff; + for( int i = 0; i < len; i++ ){ + *p++ = *s++; + } + } + return r; +} +//--------------------------------------------------------------------------- +int __fastcall CXWave::GetInBC(void) +{ + if( !IsLib() ) return 0; + return fmmwGetInExist(); +} +//--------------------------------------------------------------------------- +int __fastcall CXWave::IsInBufCritical(void) +{ + if( !IsLib() ) return 0; + return fmmwIsInCritical(); +} +//--------------------------------------------------------------------------- +BOOL __fastcall CXWave::OutOpen(int sampfreq, int size) +{ + if( !IsLib() ) return FALSE; + return fmmwOutOpen(sampfreq, size); +} +//--------------------------------------------------------------------------- +void __fastcall CXWave::OutFlush(void) +{ + if( !IsLib() ) return; + fmmwOutFlush(); +} +//--------------------------------------------------------------------------- +void __fastcall CXWave::OutAbort(void) +{ + if( !IsLib() ) return; + fmmwOutAbort(); +} +//--------------------------------------------------------------------------- +BOOL __fastcall CXWave::OutWrite(double *p, int len) +{ + if( !IsLib() ) return FALSE; + SHORT *t = m_OutBuff; + for( int i = 0; i < len; i++ ){ + *t++ = *p++; + } + return fmmwOutWrite(m_OutBuff); +} +//--------------------------------------------------------------------------- +int __fastcall CXWave::GetOutBC(void) +{ + if( !IsLib() ) return 0; + return fmmwGetOutRemaining(); +} +//--------------------------------------------------------------------------- +int __fastcall CXWave::GetOutBCC(void) +{ + if( !IsLib() ) return 0; + return fmmwGetOutCounter(); +} +//--------------------------------------------------------------------------- +void __fastcall CXWave::SetOutBCC(int count) +{ + if( !IsLib() ) return; + fmmwSetOutCounter(count); +} +//--------------------------------------------------------------------------- +int __fastcall CXWave::IsOutBufCritical(void) +{ + if( !IsLib() ) return 0; + return fmmwIsOutCritical(); +} +//--------------------------------------------------------------------------- +int __fastcall CXWave::IsOutBufFull(void) +{ + if( !IsLib() ) return 0; + return fmmwIsOutFull(); +} +//--------------------------------------------------------------------------- +void __fastcall CXWave::SetPTT(int tx) +{ + if( !IsLib() ) return; + fmmwSetPTT(tx); +} +//--------------------------------------------------------------------------- +int __fastcall CXWave::GetTimeout(void) +{ + if( !IsLib() ) return 200; + return fmmwGetTimeout(); +} +//--------------------------------------------------------------------------- + + diff --git a/test.pro b/test.pro new file mode 100644 index 0000000..1102e88 --- /dev/null +++ b/test.pro @@ -0,0 +1,76 @@ +[Define1024] +Name=JE3HHT +Enabled=1 +AFC=1 +AFCFixShift=2 +AFCSQ=32 +AFCTime=4.000000e+00 +AFCSweep=1.000000e+00 +UOS=1 +TxNet=1 +TxDisRev=0 +LimitDxGain=2.000000e+02 +LimitOverSampling=1 +ATC=0 +ATCTime=4 +Majority=1 +IgnoreFreamError=0 +SQ=1 +SQLevel=6.000000e+02 +DefMarkFreq=2.025000e+03 +DefShift=1.700000e+02 +DefStopLen=0 +OutputGain=2.457600e+04 +TXLoop=1 +TXBPFTAP=48 +TXLPF=0 +TXLPFFreq=1.000000e+02 +TXWaitType=0 +TXCharWait=0 +TXDiddleWait=0 +TXCharWaitDiddle=0 +TXRandomDiddle=0 +TXWaitTimerDiddle=0 +Rev=0 +ShiftFreq=1.700000e+02 +RXBPF=1 +RXBPFTAP=56 +RXBPFAFC=1 +RXBPFFW=1.000000e+02 +RXlms=0 +RXlmsDelay=0 +RXlmsMU2=3.000000e-03 +RXlmsGM=9.999000e-01 +RXlmsAGC=0 +RXlmsInv=0 +RXlmsTAP=96 +RXNotchTAP=72 +RXlmsBPF=1 +RXlmsType=1 +RXlmsNotch=0 +RXlmsNotch2=0 +RXlmsTwoNotch=1 +DEMTYPE=0 +BaudRate=4.545000e+01 +TTYBitLen=5 +TTYStopLen=3 +TTYParity=0 +SmoozType=0 +SmoozOrder=5 +SmoozIIR=4.000000e+01 +Smooz=7.000000e+01 +Tap=72 +IIRBW=60 +pllVcoGain=3.000000e+00 +pllLoopOrder=2 +pllLoopFC=2.500000e+02 +pllOutOrder=4 +pllOutFC=2.000000e+02 +Diddle=2 +TxFixShift=0 +InvPTT=0 +TXUOS=1 + +[Define] +LimitAGC=1 + diff --git a/tty23.pro b/tty23.pro new file mode 100644 index 0000000..a6617fb --- /dev/null +++ b/tty23.pro @@ -0,0 +1,69 @@ +[Define1024] +Name=JE3HHT +Enabled=1 +AFC=1 +AFCFixShift=1 +AFCSQ=32 +AFCTime=8.000000e+00 +AFCSweep=1.000000e+00 +UOS=1 +TxNet=1 +TxDisRev=0 +LimitDxGain=2.000000e+02 +LimitOverSampling=0 +ATC=0 +ATCTime=4 +Majority=1 +IgnoreFreamError=0 +SQ=0 +SQLevel=4.910000e+02 +DefMarkFreq=2.125000e+03 +DefShift=2.300000e+01 +DefStopLen=0 +OutputGain=2.457600e+04 +TXECHO=0 +TXBPFTAP=48 +TXLPF=0 +TXLPFFreq=1.000000e+02 +TXWaitType=0 +TXCharWait=0 +TXDiddleWait=0 +TXCharWaitDiddle=0 +TXRandomDiddle=0 +TXWaitTimerDiddle=0 +Rev=0 +ShiftFreq=2.300000e+01 +RXBPF=0 +RXBPFTAP=96 +RXBPFAFC=1 +RXBPFFW=0.000000e+00 +RXlms=0 +RXlmsDelay=0 +RXlmsMU2=3.000000e-03 +RXlmsGM=9.999000e-01 +RXlmsAGC=0 +RXlmsInv=0 +RXlmsTAP=56 +RXNotchTAP=72 +RXlmsBPF=1 +RXlmsType=1 +RXlmsNotch=2209 +RXlmsNotch2=0 +RXlmsTwoNotch=0 +DEMTYPE=2 +BaudRate=4.545000e+01 +SmoozType=0 +SmoozOrder=5 +SmoozIIR=4.000000e+01 +Smooz=7.000000e+01 +Tap=72 +IIRBW=25 +pllVcoGain=3.000000e+00 +pllLoopOrder=2 +pllLoopFC=4.000000e+01 +pllOutOrder=4 +pllOutFC=2.000000e+02 +Diddle=2 +TxFixShift=0 +InvPTT=0 +TXUOS=1 diff --git a/tty300.pro b/tty300.pro new file mode 100644 index 0000000..8ef6d95 --- /dev/null +++ b/tty300.pro @@ -0,0 +1,72 @@ +[Define1024] +Name=JE3HHT +Enabled=1 +AFC=0 +AFCFixShift=2 +AFCSQ=32 +AFCTime=4.000000e+00 +AFCSweep=1.000000e+00 +UOS=1 +TxNet=1 +TxDisRev=0 +LimitDxGain=2.000000e+02 +LimitOverSampling=1 +ATC=0 +ATCTime=4 +Majority=1 +IgnoreFreamError=0 +SQ=1 +SQLevel=6.000000e+02 +DefMarkFreq=2.025000e+03 +DefShift=1.700000e+02 +DefStopLen=0 +OutputGain=2.252800e+04 +TXECHO=0 +TXBPFTAP=48 +TXLPF=0 +TXLPFFreq=1.000000e+02 +TXWaitType=0 +TXCharWait=0 +TXDiddleWait=0 +TXCharWaitDiddle=0 +TXRandomDiddle=0 +TXWaitTimerDiddle=0 +Rev=0 +ShiftFreq=2.400000e+02 +RXBPF=0 +RXBPFTAP=56 +RXBPFAFC=1 +RXBPFFW=1.000000e+02 +RXlms=0 +RXlmsDelay=0 +RXlmsMU2=3.000000e-03 +RXlmsGM=9.999000e-01 +RXlmsAGC=0 +RXlmsInv=0 +RXlmsTAP=96 +RXNotchTAP=72 +RXlmsBPF=1 +RXlmsType=1 +RXlmsNotch=2095 +RXlmsNotch2=0 +RXlmsTwoNotch=1 +DEMTYPE=2 +BaudRate=3.000000e+02 +SmoozType=0 +SmoozOrder=5 +SmoozIIR=2.900000e+02 +Smooz=5.000000e+02 +Tap=48 +IIRBW=100 +pllVcoGain=3.000000e+00 +pllLoopOrder=2 +pllLoopFC=4.500000e+02 +pllOutOrder=4 +pllOutFC=2.000000e+02 +Diddle=2 +TxFixShift=0 +InvPTT=0 +TXUOS=1 +TTYBitLen=8 +TTYStopLen=3 +TTYParity=0 diff --git a/update.txt b/update.txt new file mode 100644 index 0000000..8a7babb --- /dev/null +++ b/update.txt @@ -0,0 +1,417 @@ +MMTTY‚̃o[ƒWƒ‡ƒ“ƒAƒbƒvî•ñ + +*********************************************************************** +XV—š—ð Ver1.68 -> Ver1.68A (JE3HHT) +*********************************************************************** +ƒŒƒxƒ‹ŒvŽZ‚Ì•s‹ï‡‚ÌC³ +‰pŒê”Å‚Ì󋵈ˑ¶ƒwƒ‹ƒv“®ì‚Ì•s‹ï‡‚ÌC³ + +*********************************************************************** +XV—š—ð Ver1.66G -> Ver1.68 (JE3HHT) +*********************************************************************** +ƒfƒ‚ƒWƒ…ƒŒ[ƒ^‚ÉFFT•ûŽ®‚ð’ljÁ +URL‚ÌC³ +ƒŠƒ‚[ƒgƒ‚[ƒh‚ÉRXM_PTTFSK‚̒ljÁ(Tnx K4CY) +Cabrilloƒtƒ@ƒCƒ‹ì¬‹@”\‚ðíœ +Dual Peak Filter‚ð’ljÁ (Tnx to AA6YQ) + +*********************************************************************** +Revision history Ver1.66F -> Ver1.66G (AA6YQ) +*********************************************************************** + +1. Changes to the Main window's Options menu +- Soundcard Output Level works on Vista (tnx to Ken VE5KC) +- Soundcard Input Level works on Vista (tnx to Ken VE5KC) + +*********************************************************************** +Revision history Ver1.65D -> Ver1.66F (AA6YQ) +*********************************************************************** + +Dave, AA6YQ begins updating MMTTY + +1. Changes to the "MMTTY Setup" window + +A. "TX" tab +- renamed the "PTT" panel to "PTT & FSK" (tnx to Joe W4TV) +- added com8 through com16 to the "PTT & FSK" panel's "Port" selector +- clicking a button in the "Input Button" panel from a non-Japanese locale displays a window entitled "Edit Button" (tnx to Joe W + +B. "Misc" tab +- the new "Device Identifiers" panel enables independent selection of soundcard devices for reception ("RX") and transmission ("TX"); any of 16 input and output soundcard devices can be selected (tnx to Gil W0MN and Joe W4TV) +- selecting an "RX" or "TX" device identifier in the "Device Identifiers" panel updates the respective "Reception" or "Transmission" panels shown on the new "Soundcard" tab + +C. "Soundcard" tab (new) +- the "Reception" panel shows all installed soundcard input devices; selecting an input device updates the "RX" selector in the "Misc" tab's "Device Identifiers" panel +- the "Transmission" panel shows all installed soundcard output devices; selecting an output device updates the "TX" selector in the "Misc" tab's "Device Identifiers" panel + +2. Changes to the "Radio Command" window +- added com8 through com16 to the "Port" selector +- added 38400 and 57600 to the "Baud" selector (tnx to Joe W4TV) +- named the selector in the lower-left corner "Group" +- modified the contents of the "Group" selector: + +*** renamed the previous "Yaesu HF? (FT-1000MP,...)" entry to "Yaesu FT 1000D, 1000MP, 920" +*** renamed the previous "Yaesu VU? (FT-736,FT-847)" entry to "Yaesu FT 736, 817, 847, 857, 897" +*** added a "Yaesu FT 9000, 2000, 950, 450" entry (tnx to Joe W4TV and Art W2NRA) +*** renamed the previous "Kenwood" entry to "Kenwood, Elecraft" (tnx to Joe W4TV) + +- renamed the "Commands" panel's "VFO Polling" selector to "Model", and added entries for the Yaesu FT 9000, 2000, 950, and 450 (tnx to Joe W4TV) + +*********************************************************************** +XV—š—ð Ver1.65 -> Ver1.65D +*********************************************************************** +‰pŒêƒ‚[ƒhŽž‚̃wƒ‹ƒvƒtƒ@ƒCƒ‹‚ÌŽæ‚舵‚¢‚ÉCHMƒtƒ@ƒCƒ‹‚ð’ljÁ +Turbo HAMLOG/Win Ver5‚ւ̑Ήž (Tnx to JG1MOU) +¬‚³‚ȃoƒO‚ÌC³‚Ɖü‘P + +*********************************************************************** +XV—š—ð Ver1.64 -> Ver1.65 +*********************************************************************** +ƒŠƒ‚[ƒgƒ‚[ƒh‚ł̕sŠmŽÀ‚È‘—M‚̃oƒO‚ÌC³ +¬‚³‚ȃoƒO‚ÌC³‚Ɖü‘P + +*********************************************************************** +XV—š—ð Ver1.63 -> Ver1.64 +*********************************************************************** +FSKˆ—‚Ì‘—ŽóØ‚è‘Ö‚¦ƒ^ƒCƒ~ƒ“ƒO‚ð‰ü‘P +ƒJƒXƒ^ƒ€ƒƒOƒŠƒ“ƒN‚ÌŽÀ‘• +ƒJƒXƒ^ƒ€RadioCommand‚ÌŽÀ‘• +ƒJƒXƒ^ƒ€ƒTƒEƒ“ƒh‚ÌŽÀ‘• +ƒJƒXƒ^ƒ€TNCƒGƒ~ƒ…ƒŒ[ƒVƒ‡ƒ“‚ÌŽÀ‘• +¬‚³‚ȃoƒO‚ÌC³‚Ɖü‘P + +*********************************************************************** +XV—š—ð Ver1.62 -> Ver1.63 +*********************************************************************** +’჌ƒxƒ‹ƒTƒEƒ“ƒhƒoƒbƒtƒ@ˆ—‚̉ü‘P +ƒtƒ‹ƒfƒ…[ƒvƒŒƒbƒNƒXƒ‚[ƒh‚̒ljÁ +ƒTƒEƒ“ƒhƒJ[ƒh‚ÌTx offsetÝ’è‚̒ljÁ +Ý’è‰æ–ʂ̎óMƒƒOƒy[ƒW‚ðƒtƒ@ƒCƒ‹ƒƒjƒ…[‚Ɉړ® +ƒR[ƒ‹ƒTƒCƒ“ƒŠƒXƒg‚̒ljÁ +ƒRƒ“ƒeƒXƒgƒ‚[ƒh‚ÉBARTGƒRƒ“ƒeƒXƒg‚ð’ljÁ +VFOƒ|[ƒŠƒ“ƒO‚ÉJST245‚ð’ljÁ +ƒo[ƒWƒ‡ƒ“ƒAƒbƒvî•ñ‚̃ƒjƒ…[‚ð’ljÁ +EXTFSKƒ|[ƒg(—v EXTFSK.DLL)‚̒ljÁ +J-BELL/S-BELLƒR[ƒhƒZƒbƒh‚Ì‘I‘ð‚̒ljÁ +ƒvƒƒOƒ‰ƒ€I—¹‘¬“x‚ð‰ü‘P +WM_MOUSEWHEELƒƒbƒZ[ƒW‚ðˆ— +¬‚³‚ȃoƒO‚ÌC³ + + +================================== +’჌ƒxƒ‹ƒTƒEƒ“ƒhƒoƒbƒtƒ@ˆ—‚̉ü‘P +================================== +@’჌ƒxƒ‹ƒTƒEƒ“ƒhƒoƒbƒtƒ@ˆ—‚ð‰ü‘P‚µAƒoƒbƒtƒ@‚ÌzŠÂ”(FIFO)‚ðÝ’è‰æ–Ê‚ÅÝ’è‚Å‚«‚邿‚¤‚É‚µ‚Ü‚µ‚½B‚Ü‚½‘—M‚ÆŽóM‚ňقȂéFIFO‚Ì”‚ðŠ„‚è“–‚Ă邱‚Æ‚ª‚Å‚«‚Ü‚·B +@uLost soundv‚̃ƒbƒZ[ƒW‚ªƒXƒyƒNƒgƒ‰ƒ€ƒEƒCƒ“ƒhƒE‚É•p”ɂɕ\ަ‚³‚ê‚éê‡A‚±‚ÌFIFO‚Ì”‚ð‘‚â‚·‚Æ‰ðŒˆ‚·‚é‰Â”\«‚ª‚ ‚è‚Ü‚·B + ‚½‚¾‚µ‘—M(TX)‚ÌFIFO‚ð‘‚â‚·‚ÆA‚»‚Ì‘‚₵‚½”‚ɉž‚¶‚Ä‘—M‚̉ž“š‚ªŽáŠ±’x‚ê‚Ü‚·BŽóM(RX)‚ÌFIFO‚Í‚»‚Ì”‚É‚æ‚鉞“š‚̕ω»‚Í‚ ‚è‚Ü‚¹‚ñB + +* ]—ˆƒo[ƒWƒ‡ƒ“‚Å‘¶Ý‚µ‚½ƒoƒbƒtƒ@ƒTƒCƒY‚ÍMMTTY‚ªŽ©“®“I‚ÉÅ“K’l‚É’²®‚µ‚Ü‚·B + + +================================ +ƒtƒ‹ƒfƒ…[ƒvƒŒƒbƒNƒXƒ‚[ƒh‚̒ljÁ +================================ +@ƒTƒEƒ“ƒhƒJ[ƒh‚̘^‰¹/Ķ‚𓯎ž‚É“­‚©‚¹‚ÄŠO•”‚̃TƒEƒ“ƒhƒ‹[ƒvƒoƒbƒN‚ð‰Â”\‚É‚µ‚Ü‚µ‚½B‰q¯’ÊMŽž‚âA‚Ü‚½FSK‰^—pŽž‚̃‚ƒjƒ^‚Æ‚µ‚Ä‚à—˜—p‚Å‚«‚Ü‚·B +@Ý’è‰æ–Ê‚Ìu‚»‚Ì‘¼vƒy[ƒW‚ŃTƒEƒ“ƒhƒ‹[ƒvƒoƒbƒN‚ðuŠO•”(‰q¯—p)v‚ÉÝ’è‚·‚邯Aƒtƒ‹ƒfƒ…[ƒvƒŒƒbƒNƒX“®ì‚ɂȂè‚Ü‚·B +@]—ˆ‚ÌÝ’è‰æ–Ê‚Ìu‘—Mvƒy[ƒW‚É‚ ‚Á‚½uƒ[ƒJƒ‹ƒGƒR[v‚ÌÝ’è‚Í‹@”\‚ªd•¡‚·‚邽‚ß‚É휂µ‚Ü‚µ‚½B + +@ˆÈ‰º‚ÉŠeó‘Ԃł̑—MŒn“‚ðŽ¦‚µ‚Ü‚·B + +<ƒTƒEƒ“ƒhƒ‹[ƒvƒoƒbƒN‚ªOFF‚Ìê‡> + + TxData ---> Modulator ---> Sound Out --> + | + --> ŽóM‰æ–Ê + +<ƒTƒEƒ“ƒhƒ‹[ƒvƒoƒbƒN‚ª“à•”‚Ìê‡iƒfƒtƒHƒ‹ƒgj> + + TxData ---> Modulator ---> Sound Out --> + | + --> Demodulator -> ŽóM‰æ–Ê + +<ƒTƒEƒ“ƒhƒ‹[ƒvƒoƒbƒN‚ªŠO•”i‰q¯—pj‚Ìê‡> + + TxData ---> Modulator ---> Sound Out ----> + + -- Sound In <----- + | + --> Demodulator -> ŽóM‰æ–Ê + + +=================================== +ƒTƒEƒ“ƒhƒJ[ƒh‚ÌTx offsetÝ’è‚̒ljÁ +=================================== + ˜^‰¹iŽóMjŽž‚ÆÄ¶i‘—MjŽž‚ŃTƒEƒ“ƒhƒJ[ƒh‚̃Tƒ“ƒvƒŠƒ“ƒOŽü”g”‚ªˆÙ‚È‚éê‡A‚±‚ÌuTx offsetv‚ðݒ肵‚Ü‚·BÝ’è‚·‚é’l‚ÍMMSSTV‚Ƃ܂Á‚½‚­“¯‚¶‚Å‚·B‚±‚Ì’l‚ð³Šm‚É‹‚ß‚é‚É‚ÍMMSSTV‚ð—˜—p‚·‚é•K—v‚ª‚ ‚è‚Ü‚·B + +@‚µ‚©‚µRTTY‚ÌꇂÍA‚»‚ê‚قdzŠm‚ÉÝ’è‚·‚é•K—v‚Í‚ ‚è‚Ü‚¹‚ñ‚Ì‚ÅAˆÈ‰º‚̊ȕւȕû–@‚ÅŠr³‚µ‚Ä‚à\‚í‚È‚¢‚ÆŽv‚¢‚Ü‚·B + +1)‚Ü‚¸ŽóM‚̃NƒƒbƒN‚ð‡‚í‚Ä‚¨‚«‚Ü‚·B + +2)Ý’è‰æ–Êu‚»‚Ì‘¼vƒy[ƒW‚̃TƒEƒ“ƒhƒ‹[ƒvƒoƒbƒN‚ðuŠO•”(‰q¯’ÊM—p)v‚É‚µ‚Ü‚·B + +3)ƒTƒEƒ“ƒhƒJ[ƒh‚Ìo—͂Ɠü—Í‚ðÚ‘±‚µ‚Ü‚·B‚Ü‚½‚̓{ƒŠƒ…[ƒ€ƒRƒ“ƒgƒ[ƒ‹‚̃~ƒLƒT[ƒvƒƒOƒ‰ƒ€i“ü—̓{ƒŠƒ…[ƒ€ƒRƒ“ƒgƒ[ƒ‹j‚Åuƒ‹[ƒvƒoƒbƒNv‚Ü‚½‚ÍuƒXƒeƒŒƒI/ƒ‚ƒmƒ‰ƒ‹ƒ~ƒLƒT[v‚ð‘I‘ð‚µ‚Ü‚·B + +4)MMTTY‚ð‘—Mó‘Ô‚É‚µAƒXƒyƒNƒgƒ‰ƒ€•\ަ‚ªƒ}[ƒJ[‚Éd‚È‚é‚æ‚¤‚ÉTxOffset‚ð’²®‚µ‚Ü‚·B + +@ŋ߂̃TƒEƒ“ƒhƒJ[ƒh‚̃NƒƒbƒN‚ÌŒXŒü‚Æ‚µ‚Ä‚ÍA + ŽóMŽž ‘—MŽž Tx offset + 11025•t‹ß 11025•t‹ß 0 + 11025•t‹ß 11100•t‹ß 75.00 + 11100•t‹ß 11025•t‹ß -75.00 +‚Ì‚¢‚¸‚ê‚©‚Å‚·‚Ì‚ÅA‚à‚µƒXƒyƒNƒgƒ‰ƒ€•\ަ‚Ŏ኱‚̃YƒŒ‚ªŠm”F‚Å‚«‚éꇂÍATxOffset‚É75.00‚Ü‚½‚Í-75.00‚ðÝ’è‚·‚邯‚Ù‚Ú‡‚¤‚ÆŽv‚¢‚Ü‚·B + +@‚È‚¨RTTY‚Ìê‡A—Ⴆ‚Î11025Hzƒx[ƒX‚ł̃IƒtƒZƒbƒg‚ª75Hz‘¶Ý‚·‚éê‡A‘—Žó‚ÌŽü”g”ƒYƒŒ‚Í5Hz`15Hz‚ɂȂè‚Ü‚·B‚Ü‚½ƒ{[ƒŒ[ƒg‚̃YƒŒ‚Í6800ppm(0.68%)’ö“x‚ɂȂè‚Ü‚·‚ªARTTY‚Ì•ûޮީg‚ªŽ‚ƒ}[ƒWƒ“‚ª‘å‚«‚¢‚½‚ßAŽÀ—pã‚Í–â‘è‚ɂ͂Ȃç‚È‚¢‚ÆŽv‚¢‚Ü‚·B + +======================== +ƒR[ƒ‹ƒTƒCƒ“ƒŠƒXƒg‚̒ljÁ +======================== +@ƒƒOƒpƒlƒ‹‚̃R[ƒ‹ƒTƒCƒ“BOX‚ðƒ_ƒuƒ‹ƒNƒŠƒbƒN‚·‚é‚©AƒfƒtƒHƒ‹ƒg‚̃Vƒ‡[ƒgƒJƒbƒgƒL[uALT+Fv‚ð‰Ÿ‚·‚ÆAƒR[ƒ‹ƒTƒCƒ“ƒŠƒXƒg‚̃|ƒbƒvƒAƒbƒvƒƒjƒ…[‚ð•\ަ‚µ‚Ü‚·BƒŠƒXƒg‚É‚Í‰ß‹Ž‚É“ü—Í‚µ‚½ƒR[ƒ‹ƒTƒCƒ“Å‘å‚R‚QŒÂ‚ªÅV‚Ì‚à‚Ì‚©‚燂ɋL˜^‚³‚ê‚Ä‚¢‚Ü‚·B +@ƒƒjƒ…[“à‚̃R[ƒ‹ƒTƒCƒ“‚ð‘I‘ð‚·‚é‚ÆA‚»‚̃R[ƒ‹ƒTƒCƒ“‚ªƒR[ƒ‹ƒTƒCƒ“BOX‚É“ü‚è‚Ü‚·B + + +================================================ +Ý’è‰æ–ʂ̎óMƒƒOƒy[ƒW‚ðƒtƒ@ƒCƒ‹ƒƒjƒ…[‚Ɉړ® +================================================ + ƒŠƒ‚[ƒgƒ‚[ƒhŽž‚ÌƒŠƒ\[ƒX•s‘«‚ð‰ü‘P‚·‚邽‚ß‚ÉAÝ’è‰æ–ʂ̎óMƒƒOƒy[ƒW‚Ì‘S‚Ä‚Ìݒ耖ڂðƒtƒ@ƒCƒ‹ƒƒjƒ…[‚ÌuŽóM‹L˜^‚̃IƒvƒVƒ‡ƒ“v‚Ɉړ®‚µ‚Ü‚µ‚½B + +================== +EXTFSKƒ|[ƒg‚̒ljÁ +================== + JA7UDE‘å’낳‚ñ‚Ì”­ˆÄ‚É‚æ‚éAUSBƒ|[ƒg‚ð—˜—p‚µ‚½ŠO•”FSKƒ†ƒjƒbƒg‚ÅFSKM†‚ð쬂·‚éꇂɎg—p‚µ‚Ü‚·B‚±‚̃|[ƒg‚ð—˜—p‚·‚éê‡AMMTTYÝ’è‰æ–Ê‚ÌPTTƒ|[ƒg–¼‚ÉuEXTFSKv‚ð‘I‘ð‚µ‚Ü‚·B‚Ü‚½uEXTFSK.DLLv‚ªMMTTYƒtƒHƒ‹ƒ_“à‚É•K—v‚Å‚·BÚׂ͈ȉº‚ÌURL‚ðŽQÆ‚µ‚ĉº‚³‚¢B + +http://www.archi.is.tohoku.ac.jp/~ooba/ja7ude/japanese_frametop.htm + + +------------------------ ‰ß‹Ž‚Ì•ÏX—š—ð ------------------------------- + +[V1.00 2000-06-30] +‰‰ñŒöŠJ + +[V1.01 -> V1.10 2000-07-08] +ƒTƒEƒ“ƒhƒJ[ƒh‚̃oƒbƒtƒ@ƒTƒCƒYÝ’è‚ð’ljÁ +ƒ}ƒjƒ…ƒAƒ‹‚̈ꕔ‹LÚ˜R‚ê‚ðC³ +‘—M‰æ–ʂ̃TƒCƒY‚ðINIƒtƒ@ƒCƒ‹‚É‹L‰¯ +ƒƒO‹@”\‚ð’ljÁ +ˆê•”‚Ì256FƒrƒfƒIƒAƒ_ƒvƒ^‚ÅWaterFall‚ª³‚µ‚­•\ަ‚Å‚«‚È‚¢ƒoƒO‚ðC³ +‘O’uƒtƒBƒ‹ƒ^‚ð’ljÁ +Ý’è‰æ–ʂɃtƒBƒ‹ƒ^“Á«•\ަ‚̒ljÁ +ƒƒCƒ“‰æ–Ê‚ÉÏ•ªŠíiLPFj‚ÌÝ’èƒ{ƒbƒNƒX‚ð”z’u +WaterFall,ŽóM‰æ–Ê,‘—M‰æ–Ê‚ÌF‚ÌÝ’è‚ð’ljÁ +V‚µ‚¢ƒƒOƒtƒ@ƒCƒ‹‚̃I[ƒvƒ“‚ðŽÀsŒã‚ÉŒŸõ‚ª‚Å‚«‚È‚­‚È‚éƒoƒO‚ðC³ +FSK‘—M‚̑ΉžiTnx JA7DHJj +ƒfƒ‚ƒWƒ…ƒŒ[ƒ^“ü—Í•”‚É“K‰žƒtƒBƒ‹ƒ^iLMSj‚ð“ü‚ê‚ê‚邿‚¤‚É‚µ‚½ +FSK(TXD)o—͂̑—oƒrƒbƒg‚ª‹t‡‚ɂȂÁ‚Ä‚¢‚½ƒoƒO‚ðC³iTnx JA7DHJj +‚»‚Ì‘¼Aׂ©‚¢“_‚ÌC³‚Ǝ኱‚Ì‹@”\’ljÁ + +[V1.11 -> V1.20 2000-07-13] +PTT§Œäƒ|[ƒg‚ÉCOM5`COM8‚ð’ljÁ(Tnx JH3XDO) +ƒ}ƒNƒ‚¨‚æ‚Ñ’èŒ^ƒƒbƒZ[ƒW‚̕ϊ·Žq‚Éu%gv‚Æu%fv‚ð’ljÁ +QSOƒƒO‚̃eƒLƒXƒgƒtƒ@ƒCƒ‹‚ւ̃GƒNƒXƒ|[ƒg‹@”\‚ð’ljÁ +QSOƒƒO‚̃eƒLƒXƒgƒtƒ@ƒCƒ‹‚©‚ç‚̃Cƒ“ƒ|[ƒg‹@”\‚ð’ljÁ +FSK(TXD)‰^—pŽž‚Ì‘—ŽóØ‚è‘Ö‚¦‚̃oƒO‚ÌC³(Tnx JA1FQI) +•¶ŽšƒEƒCƒGƒgADiddleƒEƒGƒCƒg‚ð’ljÁ(Tnx JA1IQV) +•\ަƒƒjƒ…[‚ÉuŽóM‰æ–ʂ̃NƒŠƒAv‚ð’ljÁ(Tnx JG3LGD) +LMS“®ì‚̉ü‘P +V1.14‚Å”­¶‚µ‚½‚ ‚éðŒ‚Å‹N“®‚Å‚«‚È‚­‚È‚éƒoƒO‚ÌC³ +ƒ}ƒNƒƒ{ƒ^ƒ“‚̃Vƒ‡[ƒgƒJƒbƒgƒL[‚ÌŠ„‚è“–‚Ä(Tnx JA1IQV) +Ž©“®‚ÅŽóM‚É–ß‚éÛ‚Ì”÷–­‚ȃ^ƒCƒ~ƒ“ƒO‚ðC³ +LOG200ƒf[ƒ^ƒtƒ@ƒCƒ‹‚Æ‚Ì‘ŠŒÝ•ÏŠ·‚ð’ljÁ +‚w‚xƒXƒR[ƒv•\ަ‚ð’ljÁ(Tnx JA1IQV) +Žü”g”•Ù•ÊŠí‚̃fƒtƒHƒ‹ƒg‚ðFIRŒ^BPF‚©‚çIIRŒ^‹¤UŠí‚É•ÏX +XYƒXƒR[ƒvAƒ}[ƒNŽü”g”‚ð…•½‚É‚µ‚½(Tnx JA1IQV) +XYƒXƒR[ƒv•\ަ‚ð‰ü‘P +ƒfƒ‚ƒWƒ…ƒŒ[ƒ^‚ÉƒŠƒ~ƒbƒ^ƒAƒ“ƒv‚ð’ljÁ(Tnx 7L1CUH, JA1IQV) +ƒfƒ‚ƒWƒ…ƒŒ[ƒ^‚ÌAGC‹@”\‚ð”pŽ~ + +[V1.21 -> V1.30 2000-07-23] +ƒTƒEƒ“ƒh‚Ì‹L˜^‚ÆÄ¶‹@”\‚ð’ljÁiTnx 7L1CUHj +IIRŒ^‹¤UŠí‚ÌŽü”g”“Á«•\ަ‚ð’ljÁ +XY-Scope‚Ì•\ަƒTƒCƒY‚ð‘I‘ð‰Â”\‚É‚µ‚½ +LMS‚ÉInviŒë·M†o—Íj‚ð’ljÁ +ƒTƒEƒ“ƒh‚̘^‰¹EĶ‹@”\‚ð‹­‰» +ƒTƒEƒ“ƒhÄ¶Žž‚ɃTƒEƒ“ƒhƒJ[ƒh‚ÉM†‚ðo—Í‚·‚邿‚¤‚É‚µ‚½ +PLL•ûŽ®‚̃fƒ‚ƒWƒ…ƒŒ[ƒ^‚̒ljÁ +ĶˆÊ’uÝ’è‰æ–Ê‚ð’ljÁ +•¶ŽšƒEƒCƒGƒgADiddleƒEƒGƒCƒg‚̃Xƒ‰ƒCƒh‚ðAŒ^ƒ{ƒŠƒ…[ƒ€‚É•ÏX +ƒIƒVƒƒXƒR[ƒv‰æ–Ê‚ÉuPlayvƒ{ƒ^ƒ“‚ð’ljÁ +MMTTY‚ÌM†ˆ—‚̉ðàudigital.txtv‚ð’ljÁ +DTR‚Ö‚Ì•„†ƒf[ƒ^o—Í‘I‘ð‚ð”pŽ~iŽ|‚­“­‚©‚È‚¢j +Turbo Hamlogƒf[ƒ^ƒtƒ@ƒCƒ‹‚Æ‚Ì‘ŠŒÝ•ÏŠ·‚ð’ljÁ +ƒVƒ‡[ƒgƒJƒbƒgƒL[‚̃JƒXƒ^ƒ}ƒCƒY‚ð’ljÁ(Tnx 7L1CUH) +ƒƒO‹@”\‚̎኱‚Ì‹­‰» +ƒ}ƒNƒ‚Ìæ“ª‚Æ––”ö‚̃Xƒy[ƒX‚ª‹L˜^‚Å‚«‚È‚¢ƒoƒO‚ÌC³(Tnx 7L1CUH) +Ý’è‰æ–Ê‚ÉSoundˆ—Priority‚Ì‘I‘ð‚ð’ljÁ(Tnx JH1SWD) +Priority‚̃fƒtƒHƒ‹ƒg‚ðuCriticalv¨uHighestv‚É•ÏX(Tnx JH1SWD) +Hamlog->MMTTY‚ÅMyRST‚̕ϊ·‚ÌT”²‚¯‚ðC³(Tnx JH1SWD) +‹N“®Žž‚̃TƒEƒ“ƒhƒJ[ƒhƒI[ƒvƒ“‚ÌƒŠƒgƒ‰ƒC‚ð’ljÁ(Tnx JA6VAG) +Rx-Stopƒrƒbƒg‚̃fƒtƒHƒ‹ƒg‚ð1.42bit -> 1bit‚É•ÏX +Hamlog->MMTTY•ÏŠ·‚̈ꕔ‚̃oƒO‚ðC³(Tnx JH1SWD) +ƒRƒ“ƒgƒ[ƒ‹ƒpƒlƒ‹•\ަ‚ÌOn/Off‚̒ljÁ +ƒRƒ“ƒgƒ[ƒ‹ƒpƒlƒ‹ƒTƒCƒY‚Ì‘I‘ð‚ð’ljÁ +‚»‚Ì‘¼×‚©‚¢“_‚̉ü‘P + +[V1.31 -> V1.40 2000-07-30] +ƒƒOƒtƒ@ƒCƒ‹‚̕ϊ·“®ì‚ð‰ü‘P(Tnx JH1SWD) +–â‚¢‡‚킹ƒƒbƒZ[ƒW‚ð‰ü‘P(Tnx JH1SWD) +ƒvƒƒOƒ‰ƒ€ƒƒjƒ…[‚̒ljÁ(Tnx JH1SWD, JA1IQV) +ŠO•”ƒvƒƒOƒ‰ƒ€ŽÀsŽž‚̃JƒŒƒ“ƒgƒfƒBƒŒƒNƒgƒŠ‚ðÝ’è(Tnx JH1SWD) +ƒXƒPƒ‹ƒ`“®ì‚̎኱‚̉ü‘P +‰pŒêƒ‚[ƒh‚ð’ljÁ(Tnx HL1AQ) +’ᑬCPU‚Ì‚½‚ß‚ÌLocalEchoƒIƒvƒVƒ‡ƒ“‚ð’ljÁ +ƒ}ƒNƒƒeƒLƒXƒg‚ð‘—M‰æ–ÊŒo—R‚Åo—Í‚·‚éƒIƒvƒVƒ‡ƒ“‚ð’ljÁ(Tnx JA1IQV) +ˆê”Ôʼn‚̃ƒOƒf[ƒ^‹L˜^‚ŃGƒ‰[‚ɂȂéƒoƒO‚ðC³ +ƒƒO‚ÌUTC•\ަ(TimeZone‘I‘ð)‚ð’ljÁ +‰‰ñ‹N“®Žž‚ÌŒ¾Œê–â‚¢‡‚킹‚ð”pŽ~iŽ©“®”»’è‚É•ÏXj +XYScope‚̉ñ“]•ûŒü‚ð‹t‚É‚·‚éƒIƒvƒVƒ‡ƒ“‚ð’ljÁ(Tnx JA9AVA) +ƒXƒPƒ‹ƒ`“®ì‚̉ü‘P +WaitDiddleOutƒIƒvƒVƒ‡ƒ“‚ð’ljÁ +Limitƒ{ƒ^ƒ“‚ð”pŽ~ +NETƒ{ƒ^ƒ“‚̒ljÁ +DXƒ{ƒ^ƒ“‚̃fƒtƒHƒ‹ƒgƒQƒCƒ“‚ð100‚É•ÏX +ƒ}ƒEƒX‚Å‚ÌMyRSTŽæ‚肱‚݂ɃRƒ“ƒeƒXƒgƒ‚[ƒh‚ð’ljÁ +Control PanelƒTƒCƒY‚ÉLarge‚ð’ljÁ(Tnx JE8LWZ) +SQƒŒƒxƒ‹•\ަ‚ðSQ-OFFŽž‚É‚à“®ì‚·‚邿‚¤‚É‚µ‚½ +AFC‚ÌShift•ÏXƒAƒ‹ƒSƒŠƒYƒ€‚ÉHAMƒ‚[ƒh‚ð’ljÁ +NETƒ{ƒ^ƒ“‚Ì“®ì•s‹ï‡‚ðC³ +Šeƒ}ƒNƒƒ{ƒ^ƒ“‚Ì•ÒW‚ɃVƒ‡[ƒgƒJƒbƒgƒL[‚ðŠ„‚è“–‚ĉ”\‚É‚µ‚½(Tnx JA1IQV) +ƒ}ƒNƒŽQƃL[ƒ[ƒh‚Éu%sv‚ð’ljÁ(Tnx JH3XDO) +‚»‚Ì‘¼×‚©‚¢“_‚̉ü‘P + +[V1.41 -> V1.50 2000-08-08] +Ï•ªŠí‚ÉIIR-LPF‚ð’ljÁ +Ï•ªŠí‚Ì“Á«Šm”Fƒ{ƒ^ƒ“‚ð’ljÁ +XYScope•\ަ‚̈—•iŽ¿‚Ì‘I‘ð‚ð’ljÁ +XYScope•\ަ‚ÌƒŠƒ~ƒbƒ^[‚Å‚ÌˆÊ‘Š˜c‚݂ɂæ‚é‰e‹¿‚ðŠÉ˜a +ƒŠƒ~ƒbƒ^[‚ÌuOver Samplingv‚Ì‘I‘ð‚ð’ljÁ(ŽQƨDigital.txt) +ƒTƒEƒ“ƒhƒJ[ƒh‚̃NƒƒbƒN•â³’l‚ðÝ’è‰Â”\‚É‚µ‚½(Tnx JA1WSK) +ƒNƒƒbƒN•ⳂÅJJY‚Ì‚P•bƒ`ƒbƒN‰¹‚ð—˜—p‰Â”\‚É‚µ‚½(Tnx JA1WSK) +FSK‘—M(TXD)Žž‚ÉUART‚̃^ƒCƒ~ƒ“ƒO‚Å‘—M‚Å‚«‚é‘I‘ð‚ð’ljÁ +Diddle ONŽž‚ÉŽóM‚Ö‚ÌØ‚è‘Ö‚¦‚ª’x‚ê‚Ä‚¢‚½“_‚ð‰ü‘P +Diddle‚ÌuWaitTimerv‚ð’ljÁ(Tnx JA1IQV) +LTR/FIGƒR[ƒh‚Ì‹­§o—Í‚ð’ljÁ(Tnx JA1IQV) +’èŒ^ƒƒbƒZ[ƒWŽQƃL[ƒ[ƒh‚Éu^v‚ð’ljÁ(Tnx JA1IQV) +’ᑬCPUŽž‚É–â‚¢‡‚킹ƒƒbƒZ[ƒW•\ަ‚ª’x‚ê‚é‚̂𭂵‰ü‘P +‚»‚Ì‘¼×‚©‚¢“_‚̉ü‘P + +[V1.51 2000-08-08] +Pentium75MHz‚ł̑€ì‰ž“š‚ð­‚µ‰ü‘P +•s—vi–³ˆÓ–¡j‚ÈÝ’èƒXƒCƒbƒ`‚Ì”pŽ~ +ƒTƒXƒyƒ“ƒhŽž‚ÌCPUŽžŠÔ‚ðX‚ɉð•ú +ƒ}ƒjƒ…ƒAƒ‹i–{‘j‚Ɉ—ŒyŒ¸‰»‚̈’u‚ð‹LÚ + +[V1.52 2000-08-10] +ƒL[‘€ì‚É‚æ‚éƒVƒtƒg••ÏX‹@”\‚ð’ljÁ(Tnx JA3KWZ) +AFC‚̃Aƒ‹ƒSƒŠƒYƒ€‚ÉuFSKv‚ð’ljÁ(Tnx JA3KWZ) +ƒ}ƒNƒŽQƃL[ƒ[ƒh‚Éu~vu[vu]v‚ð’ljÁ +‘—MØ‚è‘Ö‚¦’¼Œã‚ÌDiddle‘—o‚ð0.25•bŠÔ‹ÖŽ~ +ׂ©‚¢“_‚ÌC³ + +[V1.53 2000-08-12] +AFC‚ÌHAM,FSK‚̃Aƒ‹ƒSƒŠƒYƒ€‚ɃVƒtƒg•220Hz/240Hz‚ð’ljÁ +FFT‚̃QƒCƒ“‘I‘ð‚ð’ljÁ +ׂ©‚¢“_‚ÌC³ + +[V1.54 2000-08-13] +uCtrl+BSvƒL[‚Å–¢‘—M‚Ì1s‚ðÁ‹Ž‚Å‚«‚邿‚¤‚É‚µ‚½(Tnx JA1IQV) +ƒ}ƒNƒŽQƃL[ƒ[ƒh‚Ìæ“ª‚É‹Lq‚·‚éu#v‚ð’ljÁ(JH8WIG) +ƒ}ƒNƒŽQƃL[ƒ[ƒh‚Éu%Ev‚ð’ljÁ(Tnx JA1IQV) +‘—M‰æ–ʂł̃L[ƒ[ƒhŽQÆ“®ì‚Éu‘¦Žž•ÏŠ·v‚ð’ljÁ(Tnx JG1GGU) + +[V1.55 2000-08-15] +Diddle‚̃fƒtƒHƒ‹ƒg‚ðuNONEv‚©‚çuLTRv‚É•ÏX(Tnx K6STI) +uDisable Revvi‘—MŽž‚ÉRev‚𖳌ø‚É‚·‚éj‚ð’ljÁ(Tnx W6/G0AZT) +’èŒ^ƒƒbƒZ[ƒW‚̃hƒƒbƒvƒŠƒXƒg‚Ì•\ަ”‚ð‚P‚U‚É‘‚₵‚½(Tnx JE4CIL) + +[V1.56 2000-08-20] +MMTTY.TXT“à‚ÌDsubƒsƒ“”Ô†‚ÌŒë‚è‚ðC³(Tnx MMTTY-Gropu) +ƒ}[ƒNŽü”g”‚̉ºŒÀ‚ð300Hz‚É•ÏX(Tnx MMTTY-Group) +uŽóM‰æ–ʂ̃NƒŠƒAv‚ɃVƒ‡[ƒgƒJƒbƒg‚ð’è‹`‚Å‚«‚邿‚¤‚É‚µ‚½(Tnx MMTTY-Group) +uESCv‚ðƒVƒ‡[ƒgƒJƒbƒgƒL[‚ÌƒŠƒXƒg‚ɒljÁ(Tnx MMTTY-Group) +ADIFƒtƒ@ƒCƒ‹‚ւ̃GƒNƒXƒ|[ƒg‚ð’ljÁ(Tnx JA5HRE, MMTTY-Group) +ƒ^ƒCƒ€ƒXƒ^ƒ“ƒv‚ðUTC•\ަ‚Å‚«‚邿‚¤‚É‚µ‚½(Tnx MMTTY-Group) +QSOƒf[ƒ^•\ަ‚ÅUTC•\ަ‚Å‚«‚È‚©‚Á‚½ƒoƒO‚ðC³(Tnx MMTTY-Group) +599ƒ{ƒ^ƒ“‚ð”pŽ~‚µ‘ã‚í‚è‚Ƀoƒ“ƒhƒ{ƒbƒNƒX‚ð”z’u + +[V1.57 2000-08-24] +ƒR[ƒ‹ƒTƒCƒ“ƒNƒŠƒbƒNŽž‚É‘¦ŒŸõ‚·‚邿‚¤‚É•ÏX(Tnx MMTTY-Group) +ƒ[ƒh’PˆÊ‚ł̕¶Žš‚Ì‘—M‚ð’ljÁ(Tnx MMTTY-Group) +ƒRƒeƒ“ƒXƒg‚̃‰ƒ“ƒjƒ“ƒOƒ‚[ƒh‚ÆS&Pƒ‚[ƒh‚ð’ljÁ(Tnx MMTTY-Group) +‰pŒê”Å—p‚ÉSetup Helpƒƒjƒ…[‚ÆHTML Help•\ަ‹@”\‚ð’ljÁ(Tnx MMTTY-Group) + +[V1.58 2000-09-07] +‰pŒê”Å—p‚ÉWindows Help‚̃AƒNƒZƒX‹@”\‚ð’ljÁ(Tnx KX2A) +ƒ}ƒNƒƒL[ƒ[ƒh‚Éu%Dv‚Æu%Tv‚ð’ljÁ(Tnx MMTTY-Group) +ƒ}ƒNƒƒL[ƒ[ƒh‚Ìu~v‚Æu_v‚Ì“®ì‚ð‰ü‘P(Tnx MMTTY-Group) +DXƒ{ƒ^ƒ“‚ð휂µATCƒ{ƒ^ƒ“‚ð’ljÁ +’èŒ^ƒƒbƒZ[ƒWŽQƃL[ƒ[ƒh‚Éu#v‚ð’ljÁ(Tnx MMTTY-Group) + +[V1.59 2000-10-15] +‘¦Žž•ÏŠ·Žž‚Å‚àu%Fv‚Æu%Lv‚Íí‚É‘—MŽž‚ɕϊ·‚·‚邿‚¤‚ɉü‘P(Tnx JA1IQV) +“ú–{Œê”Å‚ÉRTTY BASICS‚̃wƒ‹ƒvƒ|ƒCƒ“ƒ^‚ð’ljÁiTnx W7TI, JA7UDEj +ƒ}ƒEƒX‚ł̎æ‚肱‚Ý‚ÉCQ/RJƒ‚[ƒh‚ð’ljÁiTnx JA1IQV, K5YGj +ƒRƒ“ƒeƒXƒgƒ‚[ƒhŽž‚̃}ƒEƒX‚ł̎æ‚肱‚Ý“®ì‚̉ü‘PiTnx JA1IQVj +Hamlog‚Ƃ̕ϊ·‚Ń‚[ƒh‚ð’è‹`‰Â”\‚É‚µ‚½iTnx JE4CIL, 7L1CUHj +ADIF‚Ö‚ÌRSTo—͂̃fƒtƒHƒ‹ƒg“®ì‚ð•ÏXiTnx MMTTY-Groupj +TNC–Í‹[ƒ‚[ƒh‚ð’ljÁ +ƒeƒLƒXƒgƒtƒ@ƒCƒ‹‘—M‚Ì•¶Žš”§ŒÀ‚ð‚È‚­‚µ‚½iTnx MMTTY-Groupj +ƒŠƒ‚[ƒgƒ‚[ƒh‚ð’ljÁiTnx K4CYj +ŽžŽæ“¾‚ɃIƒtƒZƒbƒg‚ðÝ’è‚Å‚«‚邿‚¤‚É‚µ‚½iTnx JR3KFX) +ƒEƒCƒ“ƒhƒEƒTƒCƒY‚ƈʒu‚ðƒIƒvƒVƒ‡ƒ“‚Å‹L‰¯‰Â”\‚É‚µ‚½iTnx MMTTY-Groupj +ƒ}ƒNƒƒ{ƒ^ƒ“‚ÉF‚ð’è‹`‰Â”\‚É‚µ‚½iTnx MMTTY-Groupj +TXƒ{ƒ^ƒ“‘€ìŽž‚ÉŽ©“®‰üs‚ðo—͂ł«‚邿‚¤‚É‚µ‚½iTnx JH1BIHj +ƒ}ƒNƒƒ{ƒ^ƒ“(16ŒÂ)•\ަ‚ðON/OFF‰Â”\‚É‚µ‚½ +ƒƒCƒ“‰æ–Ê‚©‚ç'BW'‚ðƒNƒŠƒbƒN‚µ‚ÄBaud‚ð‘€ì‰Â”\‚É‚µ‚½iTnx MMTTY-Groupj +ƒTƒEƒ“ƒhƒJ[ƒh‚ÌID”Ô†‚ðÝ’è‚Å‚«‚邿‚¤‚É‚µ‚½iTnx MMTTY-Groupj +“ú•t‚Ì•\Œ»‚ð‘I‘ð‚Å‚«‚邿‚¤‚É‚µ‚½iTnx MMTTY-Groupj +PTT§Œä‚ÉRadioCommand‚ð’ljÁiTnx KB2EOQ, JA1WSK, MMTTY-Groupj +ƒ}ƒNƒƒ{ƒ^ƒ“(16ŒÂ)‚ÉƒŠƒs[ƒg‹@”\‚ð’ljÁiTnx MMTTY-Groupj +TXƒ{ƒ^ƒ“‚ÌŽ©“®‰üsݒ肪INIƒtƒ@ƒCƒ‹‚ɃZ[ƒu‚Å‚«‚È‚¢ƒoƒO‚ðC³iTnx JA1IQVj +ƒTƒEƒ“ƒhƒJ[ƒh‚̃Tƒ“ƒvƒŠƒ“ƒOŽü”g”‚ð•ÏX‰Â”\‚É‚µ‚½ +LMS‚Ì‘ã‚í‚è‚Ƀmƒbƒ`ƒtƒBƒ‹ƒ^‚ð‘I‘ð‚Å‚«‚邿‚¤‚É‚µ‚½ +ƒ}[ƒNŽü”g”‚̃hƒƒbƒvƒŠƒXƒg‚É1275Hz‚ð’ljÁ(Tnx JA1ADN) +'%D'ƒ}ƒNƒ‚Ìo—Í‘Ž®‚ð“ú•tŒ`Ž®‚Å•ÏX‰Â”\‚É‚µ‚½ +ƒ}ƒNƒƒ{ƒ^ƒ“‚̉¡‚P—ñ•À‚Ñ•\ަ‚ð’ljÁ(Tnx MMTTY Group) +FSK‚Ìo—̓^ƒCƒ~ƒ“ƒO‚ð‰ü‘P +‚Q‚‚̃mƒbƒ`Žü”g”‚ðŽg—p‚Å‚«‚邿‚¤‚É‚µ‚½ +ƒƒO‚̃eƒLƒXƒgƒCƒ“ƒ|[ƒg‚̃oƒO‚ÌC³(Tnx MMTTY Group) +YYYYŒ`Ž®‚̃oƒO‚ÌC³(Tnx MMTTY Group) + +[V1.60 2000-12-17] +ƒL[ƒ{[ƒh‚̃[ƒhƒ‰ƒbƒv‹@”\‚ð’ljÁ(Tnx JH1BIH) +ƒŠƒ‚[ƒgƒ‚[ƒh‚̉ü‘P(Tnx K4CY, MMTTY group) +ƒ}ƒNƒ’è‹`‰æ–Ê‚ÉuCommandsvƒ{ƒ^ƒ“‚ð’ljÁ(Tnx MMTTY group) +ŽóM‰æ–ʂ̑—M•¶Žš‚ÉF‚ð’è‹`‰Â”\‚É‚µ‚½(Tnx MMTTY group) +ADIFƒtƒ@ƒCƒ‹‚̃Cƒ“ƒ|[ƒg‚ð’ljÁ(Tnx MMTTY-Group) +USB-Comƒ|[ƒg‘Îô‚ÅFSK-TXD‚̈—•û–@‚Ì‘I‘ð‚ð’ljÁ(Tnx KD6AZN, JA7UDE, MMTTY-Group) +OnQSO,OffQSO,Capture‚̃Vƒ‡[ƒgƒJƒbƒg’è‹`‚̒ljÁ(Tnx JA1WSK, MMTTY-Group) +ƒ}ƒNƒƒL[ƒ[ƒh‚Éu%Mvu%tv‚ð’ljÁ(Tnx MMTTY-Group) +•¶ŽšƒtƒHƒ“ƒg‚ɃXƒ^ƒCƒ‹‚ð“K—p(Tnx MMTTY-Group) +‰pŒêƒ‚[ƒhŽž‚ÉJCC/JCG‰æ–Ê‚ÌQTH‚ð‰pŒê‚Å•\‹L‚·‚é(Tnx MMTTY-Group) +FFTƒEƒCƒ“ƒhƒEã‚̃mƒbƒ`Žü”g”ˆÊ’u‚Ƀ}[ƒJ[‚ð•\ަ(Tnx MMTTY-Group) +RadioCommand‚ÉVFOƒ|[ƒŠƒ“ƒO‹@”\‚ð’ljÁ(Tnx JA1WSK, KX2A, MMTTY-Group) +ƒXƒeƒŒƒIƒ‚[ƒh‚ŃTƒEƒ“ƒhƒJ[ƒh‚ðˆµ‚¤ƒIƒvƒVƒ‡ƒ“‚ð’ljÁ(Tnx MMTTY-Group) + +[V1.61 2001-01-26] +ŽžƒIƒtƒZƒbƒg‚É•ª‚ð’ljÁiTnx MMTTY-Groupj +ƒŠƒ‚[ƒgƒ‚[ƒh‚̉ü‘PiTnx K4CY, Zakanaka-Groupj +DSP•”•ª‚̈—‘¬“x‚̉ü‘P +WindowsNT/2000‚ł̃ƒbƒN‚Ì–â‘è‚ð‰ðŒˆiTnx MMTTY-Groupj +‘—MŽž‚ÌuAlways fix shiftvƒIƒvƒVƒ‡ƒ“‚ð’ljÁiTnx K4CYj +VFOƒ|[ƒŠƒ“ƒO‚ÉKenwood‚ð’ljÁiTnx MMTTY-Groupj +ƒvƒƒtƒ@ƒCƒ‹ƒƒjƒ…[‚̒ljÁ +ƒNƒƒbƒN’²®‰æ–ʂ̑€ì‰ü‘P +TNCƒGƒ~ƒ…ƒŒ[ƒVƒ‡ƒ“‚ÉuBaudot modemv‚ð’ljÁ +ŽžƒIƒtƒZƒbƒg‚Éu‰ÄŽžŠÔ’²®‚Ì–³Ž‹v‚ð’ljÁiTnx K4CYj +ƒƒO‚̃GƒNƒXƒ|[ƒg‚ÉuCabrillo filev‚ð’ljÁiTnx W6/G0AZT, MMTTY-Groupj + +[V1.62 2001-09-22] +•œ’²Ší‚ÌƒŠƒ~ƒbƒ^‚ÉAGCƒIƒvƒVƒ‡ƒ“‚ð’ljÁ +ƒŠƒ‚[ƒgƒ‚[ƒh‚̉ü‘P (Tnx to K4CY, JK1IQK and MMTTY group) +VFOƒ|[ƒŠƒ“ƒO‚ÉFT1000D‚ð’ljÁ(Tnx to MMTTY group) +VFOƒ|[ƒŠƒ“ƒO‚ÉFT920‚ð’ljÁ(Tnx to MMTTY group) +Turbo Hamlog‚Æ‚ÌƒŠƒAƒ‹ƒ^ƒCƒ€ƒŠƒ“ƒN‚ð’ljÁ(Tnx to JG1MOU) +‚»‚Ì‘¼Aׂ©‚¢ƒoƒO‚ÌC³‚Ɖü‘P + + +73, Mako + \ No newline at end of file