mirror of
https://github.com/n5ac/mmvari.git
synced 2025-12-06 04:12:03 +01:00
Added LGPL files from AA6YQ
This commit is contained in:
parent
456f855aa2
commit
59ba3da1ce
423
ARRL.DX
Normal file
423
ARRL.DX
Normal file
|
|
@ -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
|
||||
!----------------------------------------------------------------------------
|
||||
!ファイルの形式
|
||||
! カントリ名 ; カントリ識別子 ; QTH ; 大陸名 ; タイムゾーン
|
||||
!
|
||||
!● 行の先頭の<!>はコメントコード,<$>は終了コード
|
||||
!● カントリ名は8文字以内。
|
||||
!● カントリ識別子は<,>で区切って複数個記述可。
|
||||
!● QTHは任意の文字列
|
||||
!● 大陸名は NA, SA, EU, OC, AF, AS, AN
|
||||
!● タイムゾーンはA~Z(Jを除く)で記述する。小文字は+30分
|
||||
!● <TAB>コードは任意の位置にあっても良い
|
||||
!● 1行255文字以内。
|
||||
!● 定義する行(コメント行を除く)は最大512行まで
|
||||
!● このファイルをネット等で流通させる場合は、最後の変更履歴に追加記載する
|
||||
! ことをお勧めします。
|
||||
!
|
||||
!カントリ識別子
|
||||
! 1.プリフィックス(コールサイン)の羅列
|
||||
! 9M2,9M4,9W2,9W4
|
||||
! JD1YAA,JD1BIY
|
||||
! ※ コールサインが短い場合は終端記号(\)を付加したほうが良い
|
||||
! BV9P → BV9PAも含まれる
|
||||
! BV9P\ → BV9Pのみ
|
||||
!
|
||||
! 2.範囲の指定
|
||||
! DA-DR,Y2-Y9
|
||||
! EA6-EH6,AM6-AO6
|
||||
! 範囲は同じ位置の1ヶ所のみを昇順で記述
|
||||
! JA-JS EA6-EH6 OK
|
||||
! JS-JA(降順) EA6-EH7(2ヶ所) NG
|
||||
!
|
||||
! 3.ワイルドカード(範囲の複合可)
|
||||
! U?1-U?6,R?1-R?6
|
||||
! SV*/A,*/SV/A
|
||||
! <?>=すべての文字, <*>=すべての文字列
|
||||
!
|
||||
! 4.最初に定義したほうが優先される
|
||||
! JD1/M ;JD1YAA ; MINAMI TORISHIMA ;OC
|
||||
! JA ;JA-JS ; JAPAN ;AS
|
||||
! 上記の例ではJD1YAAはJA-JSにも含まれるが、その前にJD1/Mの定義
|
||||
! があるのでそちらが優先される
|
||||
!
|
||||
!<<<変更履歴>>>
|
||||
! Jan 15, 1996 - BV9P追加 JE3HHT
|
||||
! Feb 15, 1996 - BS7H追加 JE3HHT
|
||||
! Aug. 4, 1998 - VR98追加 JQ3UDL
|
||||
! Aug. 4, 1998 - TA(AS)変更 JQ3UDL
|
||||
! Nov. 15, 1998 - BQ9P追加 JQ3UDL
|
||||
! Feb. 7, 1999 - FO0/M追加 JQ3UDL
|
||||
! Feb. 7, 1999 - FO0/A追加 JQ3UDL
|
||||
! Feb. 7, 1999 - H40追加 JQ3UDL
|
||||
! Jul. 10, 1999 - E4追加 JQ3UDL
|
||||
! Nov. 15. 1999 - 9M6OO追加 JQ3UDL
|
||||
! Nov. 20. 1999 - B1-B9追加 JQ3UDL
|
||||
! Jan. 06. 2000 - ST0削除 JE3HHT
|
||||
! Feb. 15. 2000 - VR6にVP6追加 JE3HHT
|
||||
! Mar. 03. 2000 - FO0XにFO0AAA追加 JE3HHT
|
||||
! Mar. 20. 2000 - FO0X=>FO/C,FO0/M=>FO/M,FO0/A=>FO/Aに変更 JQ3UDL
|
||||
! Mar. 20. 2000 - 4W追加 JQ3UDL
|
||||
! Mar. 21. 2000 - TX0追加 JE3HHT
|
||||
! Jan. 07. 2001 - P2の範囲変更 JQ3UDL
|
||||
! Jan. 08. 2001 - KG4範囲変更 JQ3UDL
|
||||
! Jan. 08. 2001 - LZ0A追加 JQ3UDL
|
||||
|
||||
82
CLX.cpp
Normal file
82
CLX.cpp
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
#include <vcl.h>
|
||||
#pragma hdrstop
|
||||
|
||||
#include "math.h"
|
||||
#include "CLX.h"
|
||||
|
||||
///----------------------------------------------------------------
|
||||
/// •¡‘f<E28098>”‰‰Ž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)
|
||||
188
CLX.h
Normal file
188
CLX.h
Normal file
|
|
@ -0,0 +1,188 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
#ifndef CLXH
|
||||
#define CLXH
|
||||
//---------------------------------------------------------------------------
|
||||
///----------------------------------------------------------------
|
||||
/// •¡‘f<E28098>”‰‰Ž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 CLX Ccor(CLX x, CLX y){
|
||||
CLX z;
|
||||
|
||||
z.r = x.r * y.r + x.j * y.j;
|
||||
z.j = x.r * y.j - x.j * y.r;
|
||||
return z;
|
||||
}
|
||||
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
|
||||
165
COPYING.LESSER.txt
Normal file
165
COPYING.LESSER.txt
Normal file
|
|
@ -0,0 +1,165 @@
|
|||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
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.
|
||||
674
COPYING.txt
Normal file
674
COPYING.txt
Normal file
|
|
@ -0,0 +1,674 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
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.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
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:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
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
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
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
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
23
Clock.txt
Normal file
23
Clock.txt
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
◎再生同期パルス
|
||||
実はPCのサウンドカードはサンプリング周波数が相当ズレている場合があります。例えばサウンドカードのサンプリング周波数に標準の11025Hzを指定した場合、実際の物理サンプリング周波数は11100Hz近辺になっている場合があります(送信時と受信時で異なる場合が多い)。この場合のズレ量は約6800ppmにもなり、すべてのDSP処理はこのサンプリング周波数を基準に行われるために、取り扱うすべての周波数やタイミングにこのズレ量が同じ比率で影響し、主として次の問題点が発生します。
|
||||
|
||||
・キャリア周波数のズレ
|
||||
・伝送速度(符号タイミング/周波数偏移)のズレ
|
||||
|
||||
キャリア周波数に関しては、例えば2000Hzが2014Hzになる程度で、運用上少し不便ですが、大きな問題ではありません。GMSKの場合の周波数偏移も変化しますが、伝送速度(=位相変化速度)が同じ比率で変化するため送信側では必ずGMSKになります。
|
||||
しかし問題となるのは伝送速度のズレのほうです。VARICODEは文字と文字の間に必ずGAPが存在しますので、ここで同期パルスの位相を調整すればRTTYのような調歩同期式符号として扱うことができます。しかし最大で21Bitsもの符号を伝送するような符号方式では、大きなクロックずれは符号の後半部で同期が外れてしまいS/Nに関係なく誤りが発生してしまいます。
|
||||
つまり再生同期パルスは位相の調整だけでは不十分で、その周波数(周期)も調整する必要があります。しかし受信信号のタイミングがすぐに再生同期パルスの周波数に影響を与えるような方式ではQSBなどの外乱で簡単に乱れてしまい良くありません。そこで高速に応答できる範囲を1000ppm程度とし、ある程度の時間をかければ25000ppm程度のズレでも補正できるような同期パルスの再生方法が必要になります。
|
||||
|
||||
以下に今回採用した再生同期パルスの生成回路を示します。
|
||||
|
||||
受信パルス --> 位相比較 --> LPF1 -------------------> SYNC status
|
||||
| |
|
||||
| -----> LPF2-------
|
||||
| | |
|
||||
-------------- 移相器 <----- VCO <--
|
||||
|
|
||||
--------- π/4 shift --------------> 再生同期パルス
|
||||
|
||||
この方式では2つのループがあるので、少し複雑な動作になりますが、動作としては小さなズレは移相器で(高速で)補正し、大きなズレはVCO周波数を可変して(低速で)補正するようなイメージになります。この回路はあきらかにPLLですからその応答特性は(LPF1,LPF2,VCOゲインからなる)ダンピングファクタによって決定され、十分な時間が経過した後の再生同期パルスは、送信側の同期パルスの周期とほぼ一致し、位相がπ/4ずれている状態になると考えられます。この回路をMMVARIではATC(Automatic Timing Control)と呼びます。
|
||||
|
||||
「SYNC status」は、PLLがロックしているかどうかを表し、MMVARIではスペクトラムまたはウォータフォール画面の左上に「SYNC」として表示されます。PLLがロックしていない場合は、受信パルスで強制的に周期調整した別系統の再生同期パルスをデコードパルスにします。この別系統のパルスは、若干外乱に弱いですが、PLLがロックするまでの期間のタイミングズレによる文字化けを防止することができます。
|
||||
581
ClockAdj.cpp
Normal file
581
ClockAdj.cpp
Normal file
|
|
@ -0,0 +1,581 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
#include <vcl.h>
|
||||
#pragma hdrstop
|
||||
|
||||
#include "ClockAdj.h"
|
||||
#include "Main.h"
|
||||
//---------------------------------------------------------------------------
|
||||
#pragma package(smart_init)
|
||||
#pragma resource "*.dfm"
|
||||
//TClockAdjDlg *ClockAdjDlg;
|
||||
//---------------------------------------------------------------------------
|
||||
__fastcall TClockAdjDlg::TClockAdjDlg(TComponent* Owner)
|
||||
: TForm(Owner)
|
||||
{
|
||||
m_fDisEvent = TRUE;
|
||||
Font->Name = ((TForm *)Owner)->Font->Name;
|
||||
Font->Charset = ((TForm *)Owner)->Font->Charset;
|
||||
if( sys.m_MsgEng ){
|
||||
Caption = "Calibrating the SoundCard (Clock-RX) with a Time Standard Broadcast Station";
|
||||
SBClose->Caption = "Cancel";
|
||||
}
|
||||
else {
|
||||
char bf[256];
|
||||
sprintf(bf, "サウンドカード(%uHz系)の受信クロック値の較正", SAMPBASE);
|
||||
Caption = bf;
|
||||
}
|
||||
m_SampFreq = SAMPFREQ;
|
||||
m_ToneFreq = 1000.0;
|
||||
m_Clock.Create(PBoxT->Width);
|
||||
m_Clock.SetSampleFreq(m_SampFreq);
|
||||
m_Clock.SetToneFreq(m_ToneFreq);
|
||||
m_pBitmapFFT = new Graphics::TBitmap;
|
||||
m_pBitmapFFT->Width = PBoxFFT->Width;
|
||||
m_pBitmapFFT->Height = PBoxFFT->Height;
|
||||
m_pBitmapT = new Graphics::TBitmap;
|
||||
// m_pBitmapT->Width = PBoxT->Width;
|
||||
// m_pBitmapT->Height = PBoxT->Height;
|
||||
|
||||
m_FFTWindow = (3000-1) * FFT_SIZE / MainVARI->m_FFTSampFreq;
|
||||
|
||||
m_StgT.Sum = 0;
|
||||
m_StgT.Max = 16384;
|
||||
m_StgT.VW = 16384;
|
||||
|
||||
m_MouseDown = 0;
|
||||
m_Point = 0;
|
||||
m_PointRX = 0;
|
||||
m_CursorX = 640;
|
||||
CreateWaterColors();
|
||||
CBTone->Text = m_ToneFreq;
|
||||
|
||||
m_fDisEvent = FALSE;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TClockAdjDlg::FormDestroy(TObject *Sender)
|
||||
{
|
||||
if( m_pBitmapFFT ) delete m_pBitmapFFT;
|
||||
if( m_pBitmapT ) delete m_pBitmapT;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TClockAdjDlg::FormCloseQuery(TObject *Sender,
|
||||
bool &CanClose)
|
||||
{
|
||||
CanClose = TRUE;
|
||||
double d = SAMPFREQ - m_SampFreq;
|
||||
d = fabs(d);
|
||||
if( d >= 0.005 ){
|
||||
if( YesNoMB(sys.m_MsgEng ? "The clock value (%.2lfHz) is not applied, are you sure?":"クロック値(%.2lfHz)は適用されません. よろしいですか?", m_SampFreq) == IDNO ){
|
||||
CanClose = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TClockAdjDlg::SBCloseClick(TObject *Sender)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TClockAdjDlg::FormClose(TObject *Sender,
|
||||
TCloseAction &Action)
|
||||
{
|
||||
if( Action == caHide ){
|
||||
::PostMessage(MainVARI->Handle, WM_WAVE, waveClockAdj, DWORD(this));
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TClockAdjDlg::Execute(void)
|
||||
{
|
||||
char bf[256];
|
||||
sprintf(bf, "%.2lf", m_SampFreq);
|
||||
EditClock->Text = bf;
|
||||
UdClock->Position = 0;
|
||||
UpdatePPM();
|
||||
Visible = TRUE;
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
void __fastcall TClockAdjDlg::UpdatePPM(void)
|
||||
{
|
||||
double dd = ((m_SampFreq - SAMPBASE) * 1000000.0 / SAMPBASE);
|
||||
|
||||
char bf[64];
|
||||
sprintf(bf, "(%+dppm)", int(dd+0.5));
|
||||
LPPM->Caption = bf;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TClockAdjDlg::DrawMsg(void)
|
||||
{
|
||||
TCanvas *cp = m_pBitmapT->Canvas;
|
||||
|
||||
cp->Font->Name = Font->Name;
|
||||
cp->Font->Charset = Font->Charset;
|
||||
cp->Font->Color = clWhite;
|
||||
cp->Font->Size = 10;
|
||||
int FH = cp->TextHeight("A");
|
||||
int Y = 5;
|
||||
if( sys.m_MsgEng ){
|
||||
cp->TextOut(10, Y, "1) Receive standard radio wave (e.g. BPM on 5MHz, 10MHz, 15MHz, 20MHz)."); Y+=FH;
|
||||
cp->TextOut(10, Y, "2) Tune into the tick sound."); Y+=FH;
|
||||
cp->TextOut(10, Y, "3) Continue listening to the sound for a while. You have a vertical line."); Y+=FH;
|
||||
cp->TextOut(10, Y, "4) Click the lower point of the line."); Y+=FH;
|
||||
cp->TextOut(10, Y, "5) Click the upper point of the line."); Y+=FH;
|
||||
Y+=FH;
|
||||
cp->TextOut(10, Y, "You could use FAX broadcasting instead of WWV, but be sure it has"); Y+=FH;
|
||||
cp->TextOut(10, Y, "exact timing.");
|
||||
}
|
||||
else {
|
||||
cp->TextOut(10, Y, "1.BPM(WWV)をAMまたはSSBで受信し、この画面の下にあるToneに1000Hz"); Y+=FH;
|
||||
cp->TextOut(10, Y, " または1800Hzを設定します. (放送周波数 = 5MHz, 10MHz, 15MHz, 20MHz)"); Y+=FH;
|
||||
cp->TextOut(10, Y, "2.SSBの場合は1秒チック音がToneに重なるように受信周波数を調整します."); Y+=FH;
|
||||
cp->TextOut(10, Y, "3.しばらく受信して縦または斜めの帯線が表示されるのを待ちます(数分)."); Y+=FH;
|
||||
cp->TextOut(10, Y, "4.表示された帯線の下の端点をクリックします."); Y+=FH;
|
||||
cp->TextOut(10, Y, "5.更に同じ帯線の上の端点をクリックするとクロック値が自動的に"); Y+=FH;
|
||||
cp->TextOut(10, Y, " 設定されます.(2点間の距離が長いほうが正確です)"); Y+=FH;
|
||||
cp->TextOut(10, Y, "6.最終的に帯線が垂直にまっすぐ表示されるようになればOKです."); Y+=FH+FH;
|
||||
cp->TextOut(10, Y, "- BPM(WWV)の代わりに、精度は劣りますが、JMH,JMGなどのFAX放送の0.5秒毎の"); Y+=FH;
|
||||
cp->TextOut(10, Y, " デッドセクタを利用してもOKのようです."); Y+=FH;
|
||||
cp->TextOut(10, Y, "- NTTの時報サービスを利用することもできます."); Y+=FH+FH;
|
||||
cp->TextOut(10, Y, "左クリック - 調整の開始"); Y+=FH;
|
||||
cp->TextOut(10, Y, "右クリック - 垂直カーソル移動");
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TClockAdjDlg::FormResize(TObject *Sender)
|
||||
{
|
||||
SBClose->Left = PCC->ClientWidth - SBClose->Width - 2;
|
||||
SBSet->Left = SBClose->Left - SBSet->Width - 2;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TClockAdjDlg::Do(short ds)
|
||||
{
|
||||
if( m_Clock.Do(ds) ){
|
||||
TCanvas *pCanvas = m_pBitmapT->Canvas;
|
||||
TRect src;
|
||||
src.Left = 0; src.Right = m_pBitmapT->Width;
|
||||
src.Top = 0; src.Bottom = m_pBitmapT->Height;
|
||||
TRect trc = src;
|
||||
src.Bottom--;
|
||||
trc.Top++;
|
||||
pCanvas->CopyRect(trc, pCanvas, src);
|
||||
|
||||
int sum = 0;
|
||||
int max = 0;
|
||||
int mp;
|
||||
int d;
|
||||
for( int i = 0; i < src.Right; i++ ){
|
||||
d = m_Clock.GetData(i);
|
||||
if( max < d ){
|
||||
max = d;
|
||||
mp = i;
|
||||
}
|
||||
sum += d;
|
||||
|
||||
d = (d - m_StgT.Sum) * 256 / m_StgT.VW;
|
||||
if( d >= 256 ) d = 255;
|
||||
if( d < 0 ) d = 0;
|
||||
pCanvas->Pixels[i][0] = m_tWaterColors[d];
|
||||
}
|
||||
pCanvas->Pixels[mp][0] = clRed;
|
||||
|
||||
sum /= src.Right;
|
||||
m_StgT.Sum = (m_StgT.Sum + sum) / 2;
|
||||
m_StgT.Max = (m_StgT.Max + max) / 2;
|
||||
m_StgT.VW = m_StgT.Max - m_StgT.Sum;
|
||||
if( m_StgT.VW < 128 ) m_StgT.VW = 128;
|
||||
m_PointY++;
|
||||
m_PointRX++;
|
||||
if( m_PointRX >= PBoxT->Height ) m_PointRX = PBoxT->Height;
|
||||
PBoxTPaint(NULL);
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TClockAdjDlg::DrawFFT(BOOL fClear)
|
||||
{
|
||||
if( !m_pBitmapFFT ) return;
|
||||
|
||||
TCanvas *pCanvas = m_pBitmapFFT->Canvas;
|
||||
TRect rc;
|
||||
rc.Left = 0; rc.Top = 0;
|
||||
rc.Right = m_fftXW; rc.Bottom = m_fftYW;
|
||||
pCanvas->Brush->Color = MainVARI->m_tFFTColset[0].c;
|
||||
pCanvas->Pen->Color = MainVARI->m_tFFTColset[0].c;
|
||||
pCanvas->FillRect(rc);
|
||||
|
||||
pCanvas->Pen->Style = psDot;
|
||||
int xx, y;
|
||||
int fh = pCanvas->TextHeight("A");
|
||||
|
||||
switch(MainVARI->m_FFTVType){
|
||||
case 0:
|
||||
pCanvas->Pen->Color = MainVARI->m_tFFTColset[3].c;
|
||||
for( y = 6; y <= 86; y += 20 ){
|
||||
xx = y * m_fftYW / 100;
|
||||
pCanvas->MoveTo(0, xx); pCanvas->LineTo(m_fftXW, xx);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
pCanvas->Pen->Color = MainVARI->m_tFFTColset[3].c;
|
||||
for( y = 6; y <= 66; y += 20 ){
|
||||
xx = y * m_fftYW / 60;
|
||||
pCanvas->MoveTo(0, xx); pCanvas->LineTo(m_fftXW, xx);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
#if 1
|
||||
pCanvas->Font->Height = -12;
|
||||
pCanvas->Font->Color = MainVARI->m_tFFTColset[2].c;
|
||||
pCanvas->Pen->Color = MainVARI->m_tFFTColset[3].c;
|
||||
MainVARI->DrawFreqScale(pCanvas, m_fftXW, m_fftYW, 0, 3000, fh, FALSE);
|
||||
#else
|
||||
int A, L;
|
||||
A = 500; L = 500;
|
||||
f = 0;
|
||||
int f, fw;
|
||||
char bf[128];
|
||||
pCanvas->Font->Height = -12;
|
||||
pCanvas->Font->Color = MainVARI->m_tFFTColset[2].c;
|
||||
pCanvas->Pen->Color = MainVARI->m_tFFTColset[3].c;
|
||||
y = 0;
|
||||
for( ; f < 3000; f += A ){
|
||||
xx = f * m_fftXW / 3000;
|
||||
if( xx >= m_fftXW ) break;
|
||||
if( !(f % 1000) || !(f % L) ){
|
||||
sprintf(bf, "%u", f);
|
||||
fw = pCanvas->TextWidth(bf)/2;
|
||||
if( (xx - fw) > 0 ) pCanvas->TextOut(xx - fw, y, bf);
|
||||
// pCanvas->MoveTo(xx, y ? 0 : fh); pCanvas->LineTo(xx, y ? m_fftYW-fh : m_fftYW);
|
||||
pCanvas->MoveTo(xx, fh); pCanvas->LineTo(xx, m_fftYW);
|
||||
}
|
||||
else {
|
||||
pCanvas->MoveTo(xx, 0); pCanvas->LineTo(xx, m_fftYW);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
pCanvas->Pen->Color = clGreen;
|
||||
xx = (DEMSAMPFREQ*0.5) * m_fftXW / 3000;
|
||||
pCanvas->MoveTo(xx, fh); pCanvas->LineTo(xx, m_fftYW);
|
||||
int rfo = m_ToneFreq;
|
||||
pCanvas->Pen->Style = psSolid;
|
||||
pCanvas->Pen->Color = MainVARI->m_tFFTColset[4].c;
|
||||
xx = 0.5 + rfo * m_fftXW / 3000;
|
||||
pCanvas->MoveTo(xx, fh); pCanvas->LineTo(xx, m_fftYW);
|
||||
POINT pt[4];
|
||||
pt[0].x = xx; pt[0].y = fh;
|
||||
pt[1].x = xx - 3; pt[1].y = fh+3;
|
||||
pt[2].x = xx; pt[2].y = fh + 6;
|
||||
pt[3].x = xx + 3; pt[3].y = fh+3;
|
||||
pCanvas->Brush->Color = MainVARI->m_tFFTColset[4].c;
|
||||
pCanvas->Polygon(pt, 3);
|
||||
|
||||
if( !fClear ){
|
||||
pCanvas->Pen->Style = psSolid;
|
||||
pCanvas->Pen->Color = MainVARI->m_tFFTColset[1].c;
|
||||
|
||||
double k = double(PBoxFFT->Height)/double(MainVARI->PBoxFFT->Height);
|
||||
int *pFFT = MainVARI->m_fftout;
|
||||
int xo = 0;
|
||||
int x, y;
|
||||
if( MainVARI->m_FFTVType == 1 ){
|
||||
int yo = m_fftYW * 40;
|
||||
for( x = 0; x < m_fftXW; x++ ){
|
||||
xx = xo + (x * m_FFTWindow / m_fftXW);
|
||||
y = pFFT[xx] * k;
|
||||
y = m_fftYW - ((y-yo)/60);
|
||||
if( x ){
|
||||
pCanvas->LineTo(x, y);
|
||||
}
|
||||
else {
|
||||
pCanvas->MoveTo(x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
for( x = 0; x < m_fftXW; x++ ){
|
||||
xx = xo + (x * m_FFTWindow / m_fftXW);
|
||||
y = pFFT[xx] * k;
|
||||
y = m_fftYW - (y/100);
|
||||
if( x ){
|
||||
pCanvas->LineTo(x, y);
|
||||
}
|
||||
else {
|
||||
pCanvas->MoveTo(x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TClockAdjDlg::UpdateFFT(void)
|
||||
{
|
||||
DrawFFT(FALSE);
|
||||
PBoxFFTPaint(NULL);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TClockAdjDlg::PBoxTPaint(TObject *Sender)
|
||||
{
|
||||
PBoxT->Canvas->Draw(0, 0, m_pBitmapT);
|
||||
DrawCursor();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TClockAdjDlg::PBoxFFTPaint(TObject *Sender)
|
||||
{
|
||||
PBoxFFT->Canvas->Draw(0, 0, m_pBitmapFFT);
|
||||
MainVARI->DrawErrorMsg(PBoxFFT->Canvas, m_fftXW, m_fftYW, FALSE);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TClockAdjDlg::PCFFTResize(TObject *Sender)
|
||||
{
|
||||
m_pBitmapFFT->Width = PBoxFFT->Width;
|
||||
m_pBitmapFFT->Height = PBoxFFT->Height;
|
||||
TCanvas *pCanvas = m_pBitmapFFT->Canvas;
|
||||
pCanvas->Brush->Color = MainVARI->m_tFFTColset[0].c;
|
||||
TRect rc;
|
||||
rc.Left = 0; rc.Top = 0;
|
||||
rc.Right = m_pBitmapFFT->Width;
|
||||
rc.Bottom = m_pBitmapFFT->Height;
|
||||
pCanvas->FillRect(rc);
|
||||
m_fftXW = m_pBitmapFFT->Width;
|
||||
m_fftYW = m_pBitmapFFT->Height;
|
||||
DrawFFT(TRUE);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TClockAdjDlg::PCTResize(TObject *Sender)
|
||||
{
|
||||
BOOL f = m_pBitmapT->Width != PBoxT->Width;
|
||||
|
||||
m_pBitmapT->Width = PBoxT->Width;
|
||||
m_pBitmapT->Height = PBoxT->Height;
|
||||
if( f ){
|
||||
TCanvas *pCanvas = m_pBitmapT->Canvas;
|
||||
pCanvas->Brush->Color = clBlack;
|
||||
TRect rc;
|
||||
rc.Left = 0; rc.Top = 0;
|
||||
rc.Right = m_pBitmapT->Width;
|
||||
rc.Bottom = m_pBitmapT->Height;
|
||||
pCanvas->FillRect(rc);
|
||||
|
||||
m_Clock.Create(PBoxT->Width);
|
||||
DrawMsg();
|
||||
m_PointRX = 0;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TClockAdjDlg::SBSetClick(TObject *Sender)
|
||||
{
|
||||
MainVARI->SetSampleFreq(m_SampFreq, FALSE);
|
||||
Close();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TClockAdjDlg::UdClockClick(TObject *Sender,
|
||||
TUDBtnType Button)
|
||||
{
|
||||
double f;
|
||||
sscanf(AnsiString(EditClock->Text).c_str(), "%lf", &f); //JA7UDE 0428
|
||||
if( Button == Comctrls::btNext ){
|
||||
f += 0.01;
|
||||
}
|
||||
else {
|
||||
f -= 0.01;
|
||||
}
|
||||
char bf[128];
|
||||
sprintf(bf, "%.2lf", f);
|
||||
EditClock->Text = bf;
|
||||
m_SampFreq = f;
|
||||
m_Clock.SetSampleFreq(f);
|
||||
UpdatePPM();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TClockAdjDlg::DrawMessage(LPCSTR p)
|
||||
{
|
||||
TCanvas *pCanvas = PBoxT->Canvas;
|
||||
int xr = pCanvas->TextWidth(p);
|
||||
int xl = (PBoxT->Width - xr)/2;
|
||||
xr += xl;
|
||||
int FH = pCanvas->TextHeight(p);
|
||||
int VC = PBoxT->Height - FH;
|
||||
pCanvas->Pen->Color = clWhite;
|
||||
pCanvas->Brush->Color = clBlack;
|
||||
pCanvas->RoundRect(xl-10, VC-FH, xr+10, VC+FH, 10, 10);
|
||||
pCanvas->Font->Color = clWhite;
|
||||
pCanvas->TextOut(xl, VC-FH/2, p);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
double __fastcall TClockAdjDlg::GetPointSamp(void)
|
||||
{
|
||||
if( m_PointY == m_PointY2 ) return m_SampFreq;
|
||||
double d = (m_PointX2 - m_PointX);
|
||||
d = d * m_SampFreq / PBoxT->Width;
|
||||
d /= (m_PointY - m_PointY2);
|
||||
d += m_SampFreq;
|
||||
d = int(d * 100 + 0.5) * 0.01;
|
||||
return d;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TClockAdjDlg::DrawCursor(void)
|
||||
{
|
||||
TCanvas *pCanvas = PBoxT->Canvas;
|
||||
pCanvas->Pen->Color = clLime;
|
||||
pCanvas->Pen->Style = psDot;
|
||||
pCanvas->MoveTo(m_CursorX, 0);
|
||||
int rop = ::SetROP2(pCanvas->Handle, R2_MASKPENNOT);
|
||||
pCanvas->LineTo(m_CursorX, PBoxT->Height - 1);
|
||||
::SetROP2(pCanvas->Handle, rop);
|
||||
if( m_Point ){
|
||||
pCanvas->Pen->Color = clYellow;
|
||||
pCanvas->Pen->Style = psSolid;
|
||||
pCanvas->MoveTo(m_PointX, m_PointY);
|
||||
::SetROP2(pCanvas->Handle, R2_MASKPENNOT);
|
||||
pCanvas->LineTo(m_PointX2, m_PointY2);
|
||||
::SetROP2(pCanvas->Handle, rop);
|
||||
char bf[256];
|
||||
if( sys.m_MsgEng ){
|
||||
sprintf( bf, "OK : Left button, Cancel : Right button Clock=%.2lf", GetPointSamp());
|
||||
}
|
||||
else {
|
||||
sprintf( bf, "決定 : 左ボタン, 中止 : 右ボタン Clock=%.2lf", GetPointSamp());
|
||||
}
|
||||
DrawMessage(bf);
|
||||
if( PBoxT->Cursor != crCross ) PBoxT->Cursor = crCross;
|
||||
}
|
||||
else {
|
||||
if( PBoxT->Cursor != crDefault ) PBoxT->Cursor = crDefault;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TClockAdjDlg::PBoxTMouseDown(TObject *Sender,
|
||||
TMouseButton Button, TShiftState Shift, int X, int Y)
|
||||
{
|
||||
if( Button == mbLeft ){
|
||||
if( m_Point ){
|
||||
m_Point = 0;
|
||||
if( m_PointY2 != m_PointY ){
|
||||
m_SampFreq = GetPointSamp();
|
||||
char bf[256];
|
||||
sprintf(bf, "%.2lf", m_SampFreq);
|
||||
EditClock->Text = bf;
|
||||
m_Clock.SetSampleFreq(m_SampFreq);
|
||||
UpdatePPM();
|
||||
|
||||
TRect rc;
|
||||
rc.Left = 0; rc.Right = m_pBitmapT->Width;
|
||||
rc.Top = 0;
|
||||
rc.Bottom = m_PointRX;
|
||||
TCanvas *pCanvas = m_pBitmapT->Canvas;
|
||||
pCanvas->Brush->Color = clBlack;
|
||||
pCanvas->FillRect(rc);
|
||||
m_PointRX = 0;
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
PBoxTPaint(NULL);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TClockAdjDlg::PBoxTMouseMove(TObject *Sender,
|
||||
TShiftState Shift, int X, int Y)
|
||||
{
|
||||
if( m_Point ){
|
||||
m_PointX2 = X;
|
||||
m_PointY2 = Y;
|
||||
PBoxTPaint(NULL);
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TClockAdjDlg::CreateWaterColors(void)
|
||||
{
|
||||
UCOL col[3];
|
||||
col[0].c = clBlack;
|
||||
col[1].c = clWhite;
|
||||
col[2].c = clYellow;
|
||||
int i;
|
||||
UCOL c;
|
||||
for( i = 0; i < 160; i++ ){
|
||||
c = GetGrade2(col, i, 160);
|
||||
m_tWaterColors[i] = c.c;
|
||||
}
|
||||
for( i = 0; i < 96; i++ ){
|
||||
c = GetGrade2(&col[1], i, 96);
|
||||
m_tWaterColors[i+160] = c.c;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void __fastcall TClockAdjDlg::CBToneChange(TObject *Sender)
|
||||
{
|
||||
if( m_fDisEvent ) return;
|
||||
|
||||
int f;
|
||||
sscanf(AnsiString(CBTone->Text).c_str(), "%d", &f); //JA7UDE 0428
|
||||
if( (f >= 250) && (f <= 2700) ){
|
||||
SetToneFreq(f);
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TClockAdjDlg::SetToneFreq(int f)
|
||||
{
|
||||
if( f < 250 ) f = 250;
|
||||
if( f > 2700 ) f = 2700;
|
||||
m_ToneFreq = f;
|
||||
m_Clock.SetToneFreq(m_ToneFreq);
|
||||
m_fDisEvent++;
|
||||
CBTone->Text = m_ToneFreq;
|
||||
m_fDisEvent--;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void __fastcall TClockAdjDlg::PBoxFFTMouseDown(TObject *Sender,
|
||||
TMouseButton Button, TShiftState Shift, int X, int Y)
|
||||
{
|
||||
if( Button != mbLeft ) return;
|
||||
|
||||
SetToneFreq((X * 3000) / PBoxFFT->Width);
|
||||
m_MouseDown = 1;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void __fastcall TClockAdjDlg::PBoxFFTMouseMove(TObject *Sender,
|
||||
TShiftState Shift, int X, int Y)
|
||||
{
|
||||
if( m_MouseDown ){
|
||||
SetToneFreq((X * 3000) / PBoxFFT->Width);
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void __fastcall TClockAdjDlg::PBoxFFTMouseUp(TObject *Sender,
|
||||
TMouseButton Button, TShiftState Shift, int X, int Y)
|
||||
{
|
||||
m_MouseDown = FALSE;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
BIN
ClockAdj.dfm
Normal file
BIN
ClockAdj.dfm
Normal file
Binary file not shown.
123
ClockAdj.h
Normal file
123
ClockAdj.h
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
#ifndef ClockAdjH
|
||||
#define ClockAdjH
|
||||
//---------------------------------------------------------------------------
|
||||
#include <Classes.hpp>
|
||||
#include <Controls.hpp>
|
||||
#include <StdCtrls.hpp>
|
||||
#include <Forms.hpp>
|
||||
#include <Buttons.hpp>
|
||||
#include <ComCtrls.hpp>
|
||||
#include <ExtCtrls.hpp>
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
#include "ComLib.h"
|
||||
#include "dsp.h"
|
||||
//---------------------------------------------------------------------------
|
||||
class TClockAdjDlg : public TForm
|
||||
{
|
||||
__published: // IDE 管理のコンポーネント
|
||||
TPanel *PCFFT;
|
||||
TPanel *PCT;
|
||||
TLabel *L1;
|
||||
TEdit *EditClock;
|
||||
TLabel *L2;
|
||||
TUpDown *UdClock;
|
||||
TSpeedButton *SBClose;
|
||||
TPaintBox *PBoxFFT;
|
||||
TPaintBox *PBoxT;
|
||||
TPanel *PCC;
|
||||
TSplitter *Splitter;
|
||||
TSpeedButton *SBSet;
|
||||
TComboBox *CBTone;
|
||||
TLabel *L3;
|
||||
TLabel *L4;
|
||||
TLabel *LPPM;
|
||||
void __fastcall SBCloseClick(TObject *Sender);
|
||||
void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
|
||||
void __fastcall FormResize(TObject *Sender);
|
||||
void __fastcall FormDestroy(TObject *Sender);
|
||||
void __fastcall PBoxTPaint(TObject *Sender);
|
||||
void __fastcall PBoxFFTPaint(TObject *Sender);
|
||||
void __fastcall PCFFTResize(TObject *Sender);
|
||||
void __fastcall PCTResize(TObject *Sender);
|
||||
void __fastcall SBSetClick(TObject *Sender);
|
||||
void __fastcall UdClockClick(TObject *Sender, TUDBtnType Button);
|
||||
void __fastcall PBoxTMouseDown(TObject *Sender, TMouseButton Button,
|
||||
TShiftState Shift, int X, int Y);
|
||||
void __fastcall PBoxTMouseMove(TObject *Sender, TShiftState Shift, int X,
|
||||
int Y);
|
||||
void __fastcall CBToneChange(TObject *Sender);
|
||||
void __fastcall PBoxFFTMouseDown(TObject *Sender, TMouseButton Button,
|
||||
TShiftState Shift, int X, int Y);
|
||||
void __fastcall FormCloseQuery(TObject *Sender, bool &CanClose);
|
||||
void __fastcall PBoxFFTMouseMove(TObject *Sender, TShiftState Shift,
|
||||
int X, int Y);
|
||||
void __fastcall PBoxFFTMouseUp(TObject *Sender, TMouseButton Button,
|
||||
TShiftState Shift, int X, int Y);
|
||||
private: // ユーザー宣言
|
||||
int m_fDisEvent;
|
||||
|
||||
double m_SampFreq;
|
||||
double m_ToneFreq;
|
||||
CClock m_Clock;
|
||||
|
||||
TColor m_tWaterColors[256];
|
||||
Graphics::TBitmap *m_pBitmapT;
|
||||
FFTSTG m_StgT;
|
||||
|
||||
int m_CursorX;
|
||||
int m_Point;
|
||||
int m_PointX, m_PointY;
|
||||
int m_PointX2, m_PointY2;
|
||||
int m_PointRX;
|
||||
|
||||
int m_fftXW, m_fftYW;
|
||||
Graphics::TBitmap *m_pBitmapFFT;
|
||||
int m_FFTWindow;
|
||||
|
||||
int m_MouseDown;
|
||||
private:
|
||||
void __fastcall UpdatePPM(void);
|
||||
void __fastcall CreateWaterColors(void);
|
||||
void __fastcall DrawMsg(void);
|
||||
void __fastcall InitWater(void);
|
||||
void __fastcall DrawFFT(BOOL fClear);
|
||||
|
||||
double __fastcall GetPointSamp(void);
|
||||
void __fastcall DrawMessage(LPCSTR p);
|
||||
void __fastcall DrawCursor(void);
|
||||
void __fastcall SetToneFreq(int f);
|
||||
|
||||
|
||||
public: // ユーザー宣言
|
||||
__fastcall TClockAdjDlg(TComponent* Owner);
|
||||
|
||||
void __fastcall Execute(void);
|
||||
void __fastcall Do(short ds);
|
||||
void __fastcall UpdateFFT(void);
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
//extern PACKAGE TClockAdjDlg *ClockAdjDlg;
|
||||
//---------------------------------------------------------------------------
|
||||
#endif
|
||||
|
||||
409
CodeVw.cpp
Normal file
409
CodeVw.cpp
Normal file
|
|
@ -0,0 +1,409 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
#include <vcl.h>
|
||||
#pragma hdrstop
|
||||
|
||||
#include "CodeVw.h"
|
||||
//---------------------------------------------------------------------------
|
||||
#pragma package(smart_init)
|
||||
#pragma resource "*.dfm"
|
||||
//TCodeView *CodeView;
|
||||
//---------------------------------------------------------------------------
|
||||
__fastcall TCodeView::TCodeView(TComponent* Owner)
|
||||
: TForm(Owner)
|
||||
{
|
||||
if( sys.m_MsgEng ){
|
||||
Font->Name = "Arial";
|
||||
Font->Charset = ANSI_CHARSET;
|
||||
SBClose->Caption = "Close";
|
||||
}
|
||||
SBUS->Hint = "English(ANSI)";
|
||||
SBJA->Hint = sys.m_MsgEng ? "Japanese(Shift-JIS)" : "日本語(シフトJIS)";
|
||||
SBHL->Hint = sys.m_MsgEng ? "Korean(Hangul)" : "韓国語(ハングル)";
|
||||
SBBY->Hint = sys.m_MsgEng ? "Chinese(GB2312)" : "中国語(簡体)";
|
||||
SBBV->Hint = sys.m_MsgEng ? "Chinese(BIG5)" : "中国語(繁体)";
|
||||
m_hWnd = NULL;
|
||||
m_pFont = NULL;
|
||||
m_Base = 0;
|
||||
m_MouseDown = 0;
|
||||
CheckFontCharset();
|
||||
SBJA->Enabled = sys.m_tFontFam[fmJA];
|
||||
SBHL->Enabled = sys.m_tFontFam[fmHL] || sys.m_tFontFam[fmJOHAB];
|
||||
SBBV->Enabled = sys.m_tFontFam[fmBV];
|
||||
SBBY->Enabled = sys.m_tFontFam[fmBY];
|
||||
|
||||
UpdateXW();
|
||||
#if 0
|
||||
int YW = GetSystemMetrics(SM_CYFULLSCREEN);
|
||||
Left = sys.m_CodeLeft;
|
||||
Top = sys.m_CodeTop;
|
||||
if( Left < 0 ) Left = 0;
|
||||
if( Top + Height > YW ) Top = YW - Height;
|
||||
#endif
|
||||
ShowHint = sys.m_WinNT;
|
||||
FormCenter(this);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
WORD __fastcall TCodeView::GetEUDC(int y, int x)
|
||||
{
|
||||
const WORD _tOut[]={0xf040, 0xf050, 0xf060, 0xf070,
|
||||
0xf080, 0xf090, 0xf0a0, 0xf0b0,
|
||||
0xf0c0, 0xf0d0, 0xf0e0, 0xf0f0,
|
||||
0xf140, 0xf150, 0xf160, 0xf170,
|
||||
};
|
||||
const WORD _tOutHL[]={0xc9a0, 0xc9b0, 0xc9c0, 0xc9d0,
|
||||
0xc9e0, 0xc9f0, 0xfea0, 0xfeb0,
|
||||
0xfec0, 0xfed0, 0xfee0, 0xfef0,
|
||||
0, 0, 0, 0,
|
||||
};
|
||||
const WORD _tOutBV[]={0xfa40, 0xfa50, 0xfa60, 0xfa70,
|
||||
0xfaa0, 0xfab0, 0xfac0, 0xfad0,
|
||||
0xfae0, 0xfaf0, 0xfb40, 0xfb50,
|
||||
0xfb60, 0xfb70, 0xfba0, 0xfbb0,
|
||||
};
|
||||
const WORD _tOutBY[]={0xaaa0, 0xaab0, 0xaac0, 0xaad0,
|
||||
0xaae0, 0xaaf0, 0xaba0, 0xabb0,
|
||||
0xabc0, 0xabd0, 0xabe0, 0xabf0,
|
||||
0xaca0, 0xacb0, 0xacc0, 0xacd0,
|
||||
};
|
||||
int c;
|
||||
switch(m_pFont->Charset){
|
||||
case SHIFTJIS_CHARSET:
|
||||
c = _tOut[y] + x;
|
||||
if( (c==0xf07f)||(c==0xf0fd)||(c==0xf0fe)||(c==0xf0ff)||(c==0xf17f) ) c = 0;
|
||||
break;
|
||||
case HANGEUL_CHARSET:
|
||||
c = _tOutHL[y];
|
||||
if( c ){
|
||||
c += x;
|
||||
if( (c==0xc9a0)||(c==0xfea0)||(c==0xc9ff)||(c==0xfeff) ) c = 0;
|
||||
}
|
||||
break;
|
||||
case CHINESEBIG5_CHARSET: // 台湾
|
||||
c = _tOutBV[y] + x;
|
||||
if( (c==0xfa7f)||(c==0xfaa0)||(c==0xfaff)||(c==0xfb7f)||(c==0xfba0) ) c = 0;
|
||||
break;
|
||||
case 134: // 中国語簡略
|
||||
c = _tOutBY[y] + x;
|
||||
if( (c==0xaaa0)||(c==0xaaff)||(c==0xaba0)||(c==0xabff)||(c==0xaca0) ) c = 0;
|
||||
break;
|
||||
default:
|
||||
c = 0;
|
||||
break;
|
||||
}
|
||||
return WORD(c);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TCodeView::UpdateTitle(void)
|
||||
{
|
||||
AnsiString as = sys.m_MsgEng ? "Character code list" : "Character Code list"; //AA6YQ 2013-05-25 removed JA characters
|
||||
as += " [";
|
||||
as += m_pFont->Name;
|
||||
AddStyle(as, m_pFont->Charset, 0);
|
||||
as += "]";
|
||||
Caption = as;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TCodeView::UpdateXW(void)
|
||||
{
|
||||
if( m_Base ){
|
||||
m_XW = PBox->Width / 17;
|
||||
m_XW--;
|
||||
m_YW1 = m_YW = PBox->Height / 17;
|
||||
m_XW1 = PBox->Width - (m_XW * 16);
|
||||
UDMB->Visible = m_Base ? TRUE : FALSE;
|
||||
}
|
||||
else {
|
||||
m_XW1 = m_XW = PBox->Width / 17;
|
||||
m_YW1 = m_YW = PBox->Height / 17;
|
||||
UDMB->Visible = FALSE;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TCodeView::SetPBoxFont(TCanvas *pCanvas)
|
||||
{
|
||||
pCanvas->Font = m_pFont;
|
||||
pCanvas->Font->Height = -(m_YW-5);
|
||||
TFontStyles fs;
|
||||
fs = Code2FontStyle(0);
|
||||
pCanvas->Font->Style = fs;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TCodeView::DrawChar(TCanvas *pCanvas, int c, BOOL f)
|
||||
{
|
||||
|
||||
int x = c % 16;
|
||||
int y = c / 16;
|
||||
char bf[32];
|
||||
LPSTR t = bf;
|
||||
if( c ){
|
||||
c += m_Base;
|
||||
}
|
||||
if( !c ) return;
|
||||
if( c & 0x00ff00 ) *t++ = BYTE(c>>8);
|
||||
*t++ = BYTE(c);
|
||||
*t = 0;
|
||||
pCanvas->Font->Color = f ? clWhite : clBlack;
|
||||
int fw = pCanvas->TextWidth(bf);
|
||||
int fh = pCanvas->TextHeight(bf);
|
||||
int xx = m_XW1 + x * m_XW + (m_XW-fw)/2;
|
||||
int yy = m_YW1 + y * m_YW + (m_YW-fh)/2;
|
||||
::SetBkMode(pCanvas->Handle, TRANSPARENT);
|
||||
pCanvas->TextOut(xx, yy, bf);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TCodeView::DrawCursor(TCanvas *pCanvas, int c, BOOL f)
|
||||
{
|
||||
TRect rc;
|
||||
|
||||
int x = c % 16;
|
||||
int y = c / 16;
|
||||
rc.Left = 1 + m_XW1 + x * m_XW;
|
||||
rc.Top = 1 + m_YW1 + y * m_YW;
|
||||
rc.Right = rc.Left + m_XW - 1;
|
||||
rc.Bottom = rc.Top + m_YW - 1;
|
||||
TColor col;
|
||||
if( f ){
|
||||
col = clBlue;
|
||||
}
|
||||
else if( (!m_Base) && m_tPfx[c] ){
|
||||
col = clGray;
|
||||
}
|
||||
else {
|
||||
col = clWhite;
|
||||
}
|
||||
pCanvas->Pen->Color = col;
|
||||
pCanvas->Brush->Color = col;
|
||||
pCanvas->FillRect(rc);
|
||||
DrawChar(pCanvas, c, f);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TCodeView::PBoxPaint(TObject *Sender)
|
||||
{
|
||||
if( !m_pFont ) return;
|
||||
|
||||
CWaitCursor w;
|
||||
Graphics::TBitmap *pBmp = new Graphics::TBitmap;
|
||||
pBmp->Width = PBox->Width;
|
||||
pBmp->Height = PBox->Height;
|
||||
TCanvas *pCanvas = pBmp->Canvas;
|
||||
if( !m_Base ) memset(m_tPfx, 0, sizeof(m_tPfx));
|
||||
SetPBoxFont(pCanvas);
|
||||
OnWave();
|
||||
SetMBCP(m_pFont->Charset);
|
||||
int x, y, xx, yy, fw, fh;
|
||||
char bf[16];
|
||||
int c = 0;
|
||||
for( y = 0; y < 16; y++ ){
|
||||
OnWave();
|
||||
for( x = 0; x < 16; x++ ){
|
||||
if( !m_Base && (_mbsbtype((const unsigned char *)&c, 0) == _MBC_LEAD) ){
|
||||
m_tPfx[c] = TRUE;
|
||||
DrawCursor(pCanvas, c, FALSE);
|
||||
}
|
||||
else {
|
||||
DrawChar(pCanvas, c, FALSE);
|
||||
}
|
||||
c++;
|
||||
}
|
||||
}
|
||||
pCanvas->Font = Font;
|
||||
pCanvas->Pen->Color = clBlack;
|
||||
::SetBkMode(pCanvas->Handle, TRANSPARENT);
|
||||
for( y = 0; y < 16; y++ ){
|
||||
wsprintf(bf, "%X", y);
|
||||
fw = pCanvas->TextWidth(bf);
|
||||
fh = pCanvas->TextHeight(bf);
|
||||
xx = m_XW1 + y*m_XW + (m_XW-fw)/2;
|
||||
yy = (m_YW1-fh)/2;
|
||||
pCanvas->TextOut(xx, yy, bf);
|
||||
|
||||
if( m_Base ){
|
||||
wsprintf(bf, "%04x", y*16 + m_Base);
|
||||
}
|
||||
else {
|
||||
wsprintf(bf, "%02X", y*16);
|
||||
}
|
||||
fw = pCanvas->TextWidth(bf);
|
||||
fh = pCanvas->TextHeight(bf);
|
||||
xx = (m_XW1-fw)/2;
|
||||
yy = m_YW1 + y*m_YW + (m_YW-fh)/2;
|
||||
pCanvas->TextOut(xx, yy, bf);
|
||||
|
||||
pCanvas->Pen->Width = y ? 1 : 2;
|
||||
pCanvas->MoveTo(0, m_YW1 + y*m_YW);
|
||||
pCanvas->LineTo(PBox->Width, m_YW1 + y*m_YW);
|
||||
pCanvas->MoveTo(m_XW1 + y*m_XW, 0);
|
||||
pCanvas->LineTo(m_XW1 + y*m_XW, PBox->Height);
|
||||
}
|
||||
PBox->Canvas->Draw(0, 0, pBmp);
|
||||
delete pBmp;
|
||||
m_pfxCount = 0;
|
||||
for( x = 0; x < 256; x++ ){
|
||||
if( m_tPfx[x] ){
|
||||
m_tPfxIdx[m_pfxCount] = x;
|
||||
m_pfxCount++;
|
||||
}
|
||||
}
|
||||
if( m_pfxCount != UDMB->Max ) UDMB->Max = short(m_pfxCount - 1);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TCodeView::UpdatePfx(void)
|
||||
{
|
||||
memset(m_tPfx, 0, sizeof(m_tPfx));
|
||||
int c;
|
||||
for( c = 0; c < 256; c++ ){
|
||||
if( _mbsbtype((const unsigned char *)&c, 0) == _MBC_LEAD ){
|
||||
m_tPfx[c] = TRUE;
|
||||
}
|
||||
}
|
||||
m_pfxCount = 0;
|
||||
for( c = 0; c < 256; c++ ){
|
||||
if( m_tPfx[c] ){
|
||||
m_tPfxIdx[m_pfxCount] = c;
|
||||
m_pfxCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TCodeView::Execute(HWND hWnd, UINT uMsg, int wParam, TFont *pFont)
|
||||
{
|
||||
m_hWnd = hWnd;
|
||||
m_uMsg = uMsg;
|
||||
m_wParam = wParam;
|
||||
m_pFont = pFont;
|
||||
m_Base = 0;
|
||||
UpdateXW();
|
||||
UpdateTitle();
|
||||
ShowModal();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TCodeView::SBCloseClick(TObject *Sender)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TCodeView::PBoxMouseDown(TObject *Sender,
|
||||
TMouseButton Button, TShiftState Shift, int X, int Y)
|
||||
{
|
||||
if( (Button == mbRight) && (m_Base) ){
|
||||
if( m_Base ){
|
||||
m_Base = 0;
|
||||
}
|
||||
UpdateXW(); PBoxPaint(NULL);
|
||||
return;
|
||||
}
|
||||
if( Button != mbLeft ) return;
|
||||
|
||||
X -= m_XW1;
|
||||
Y -= m_YW1;
|
||||
if( X < 0 ) return;
|
||||
if( Y < 0 ) return;
|
||||
X /= m_XW;
|
||||
Y /= m_YW;
|
||||
if( X >= 16 ) X = 15;
|
||||
if( Y >= 16 ) Y = 15;
|
||||
int code = (Y * 16) + X;
|
||||
m_MouseDown = code + 1;
|
||||
TCanvas *pCanvas = PBox->Canvas;
|
||||
SetPBoxFont(pCanvas);
|
||||
DrawCursor(pCanvas, code, TRUE);
|
||||
|
||||
if( m_Base ){
|
||||
code |= m_Base | 0x00010000;
|
||||
}
|
||||
else if( m_tPfx[code] ){
|
||||
for( int i = 0; i < m_pfxCount; i++ ){
|
||||
if( m_tPfxIdx[i] == code ){
|
||||
UDMB->Position = short(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
m_Base = (code << 8);
|
||||
UpdateXW(); PBoxPaint(NULL);
|
||||
m_MouseDown = FALSE;
|
||||
return;
|
||||
}
|
||||
|
||||
if( m_hWnd ){
|
||||
m_Code = code & 0x0000ffff;
|
||||
::PostMessage(m_hWnd, m_uMsg, m_wParam, m_Code);
|
||||
Timer->Interval = 500;
|
||||
Timer->Enabled = TRUE;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TCodeView::PBoxMouseUp(TObject *Sender,
|
||||
TMouseButton Button, TShiftState Shift, int X, int Y)
|
||||
{
|
||||
if( !m_MouseDown ) return;
|
||||
|
||||
m_MouseDown--;
|
||||
TCanvas *pCanvas = PBox->Canvas;
|
||||
SetPBoxFont(pCanvas);
|
||||
DrawCursor(pCanvas, m_MouseDown, FALSE);
|
||||
m_MouseDown = 0;
|
||||
Timer->Enabled = FALSE;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TCodeView::TimerTimer(TObject *Sender)
|
||||
{
|
||||
if( m_MouseDown ){
|
||||
::PostMessage(m_hWnd, m_uMsg, m_wParam, m_Code);
|
||||
Timer->Interval = 100;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TCodeView::SBUSClick(TObject *Sender)
|
||||
{
|
||||
WORD wLang;
|
||||
if( Sender == SBJA ){
|
||||
wLang = 0x0411;
|
||||
}
|
||||
else if( Sender == SBHL ){
|
||||
wLang = 0x0412;
|
||||
}
|
||||
else if( Sender == SBBY ){
|
||||
wLang = 0x0804;
|
||||
}
|
||||
else if( Sender == SBBV ){
|
||||
wLang = 0x0404;
|
||||
}
|
||||
else {
|
||||
wLang = 0;
|
||||
}
|
||||
SetLangFont(m_pFont, wLang);
|
||||
PBox->Invalidate();
|
||||
UpdateTitle();
|
||||
if( m_hWnd ){
|
||||
::PostMessage(m_hWnd, m_uMsg, m_wParam, 0x10000000);
|
||||
}
|
||||
SetMBCP(m_pFont->Charset);
|
||||
UpdatePfx();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TCodeView::UDMBClick(TObject *Sender, TUDBtnType Button)
|
||||
{
|
||||
m_Base = m_tPfxIdx[UDMB->Position] << 8;
|
||||
UpdateXW(); PBoxPaint(NULL);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
BIN
CodeVw.dfm
Normal file
BIN
CodeVw.dfm
Normal file
Binary file not shown.
91
CodeVw.h
Normal file
91
CodeVw.h
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
#ifndef CodeVwH
|
||||
#define CodeVwH
|
||||
//---------------------------------------------------------------------------
|
||||
#include <Classes.hpp>
|
||||
#include <Controls.hpp>
|
||||
#include <StdCtrls.hpp>
|
||||
#include <Forms.hpp>
|
||||
#include <ExtCtrls.hpp>
|
||||
#include <Buttons.hpp>
|
||||
|
||||
#include "ComLib.h"
|
||||
#include <ComCtrls.hpp>
|
||||
#define WM_FORMCLOSE (WM_USER+410)
|
||||
#define WM_CODEINSERT (WM_USER+411)
|
||||
//---------------------------------------------------------------------------
|
||||
class TCodeView : public TForm
|
||||
{
|
||||
__published: // IDE 管理のコンポーネント
|
||||
TPanel *Panel;
|
||||
TPaintBox *PBox;
|
||||
TSpeedButton *SBClose;
|
||||
TSpeedButton *SBUS;
|
||||
TSpeedButton *SBJA;
|
||||
TSpeedButton *SBHL;
|
||||
TSpeedButton *SBBY;
|
||||
TSpeedButton *SBBV;
|
||||
TUpDown *UDMB;
|
||||
TTimer *Timer;
|
||||
void __fastcall PBoxPaint(TObject *Sender);
|
||||
void __fastcall SBCloseClick(TObject *Sender);
|
||||
void __fastcall PBoxMouseDown(TObject *Sender, TMouseButton Button,
|
||||
TShiftState Shift, int X, int Y);
|
||||
void __fastcall SBUSClick(TObject *Sender);
|
||||
void __fastcall UDMBClick(TObject *Sender, TUDBtnType Button);
|
||||
void __fastcall PBoxMouseUp(TObject *Sender, TMouseButton Button,
|
||||
TShiftState Shift, int X, int Y);
|
||||
|
||||
void __fastcall TimerTimer(TObject *Sender);
|
||||
private: // ユーザー宣言
|
||||
HWND m_hWnd;
|
||||
UINT m_uMsg;
|
||||
int m_wParam;
|
||||
|
||||
TFont *m_pFont;
|
||||
int m_Code;
|
||||
int m_XW1;
|
||||
int m_YW1;
|
||||
int m_XW;
|
||||
int m_YW;
|
||||
int m_MouseDown;
|
||||
int m_Base;
|
||||
BOOL m_tPfx[256];
|
||||
int m_pfxCount;
|
||||
int m_tPfxIdx[256];
|
||||
void __fastcall UpdateTitle(void);
|
||||
void __fastcall UpdatePfx(void);
|
||||
void __fastcall UpdateXW(void);
|
||||
void __fastcall SetPBoxFont(TCanvas *pCanvas);
|
||||
void __fastcall DrawChar(TCanvas *pCanvas, int c, BOOL f);
|
||||
void __fastcall DrawCursor(TCanvas *pCanvas, int c, BOOL f);
|
||||
WORD __fastcall GetEUDC(int y, int x);
|
||||
|
||||
public: // ユーザー宣言
|
||||
__fastcall TCodeView(TComponent* Owner);
|
||||
|
||||
void __fastcall Execute(HWND hWnd, UINT uMsg, int wParam, TFont *pFont);
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
//extern PACKAGE TCodeView *CodeView;
|
||||
//---------------------------------------------------------------------------
|
||||
#endif
|
||||
BIN
ComFSK.fsk
Normal file
BIN
ComFSK.fsk
Normal file
Binary file not shown.
3702
ComLib.cpp
Normal file
3702
ComLib.cpp
Normal file
File diff suppressed because it is too large
Load diff
733
ComLib.h
Normal file
733
ComLib.h
Normal file
|
|
@ -0,0 +1,733 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
#ifndef ComLibH
|
||||
#define ComLibH
|
||||
#include <ComCtrls.hpp>
|
||||
#include <inifiles.hpp>
|
||||
#include <Grids.hpp>
|
||||
#include <Buttons.hpp>
|
||||
#include <values.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <mbstring.h>
|
||||
#include <dir.h>
|
||||
#include <Wingdi.h> //ja7ude 0522
|
||||
|
||||
#define VERBETA ""
|
||||
#define VERNO "0.45"
|
||||
#define INI_SCHEMA 3
|
||||
|
||||
#define DEBUG TRUE
|
||||
#define MEASIMD FALSE
|
||||
#define LOGFFT FALSE
|
||||
#define SHOWERRCOUNT FALSE
|
||||
#define FORCELANG 0
|
||||
#if DEBUG
|
||||
#include <assert.h>
|
||||
#define ASSERT(c) assert(c)
|
||||
#else
|
||||
#define ASSERT(c)
|
||||
#endif
|
||||
|
||||
#if SHOWERRCOUNT
|
||||
#define EPHASE(c) sys.m_ErrPhase = c
|
||||
enum {
|
||||
P_NULL,
|
||||
P_DEMBPF,
|
||||
P_DEMAGC,
|
||||
P_DEMLPF,
|
||||
P_DEMAFC,
|
||||
P_DEMLOCK,
|
||||
P_DEMVCO,
|
||||
P_DEMOUT,
|
||||
P_SUBCREATE,
|
||||
P_SUBVIEW,
|
||||
};
|
||||
#else
|
||||
#define EPHASE(c)
|
||||
#endif
|
||||
|
||||
#define VERID "beta ver "VERNO
|
||||
#define VERTTL2 "MMVARI "VERID VERBETA
|
||||
#define VERTTL VERTTL2" (C) JE3HHT 2004-2010."
|
||||
|
||||
#define WM_WAVE WM_USER+400
|
||||
#define CM_CRADIO WM_USER+400
|
||||
#define CM_CMML WM_USER+401
|
||||
#define CM_CMMR WM_USER+402
|
||||
|
||||
enum {
|
||||
waveIN,
|
||||
waveOUT,
|
||||
waveCloseFileEdit,
|
||||
waveCodeView,
|
||||
wavePlayDlg,
|
||||
waveCloseRxView,
|
||||
waveSwapRxView,
|
||||
waveClockAdj,
|
||||
waveSeekMacro,
|
||||
waveDoMacro,
|
||||
waveLoadMacro,
|
||||
#if DEBUG
|
||||
waveRepeatMacro = 1024,
|
||||
#endif
|
||||
};
|
||||
|
||||
enum {
|
||||
macOnTimer,
|
||||
macOnPTT,
|
||||
macOnQSO,
|
||||
macOnFind,
|
||||
macOnBand,
|
||||
macOnStart,
|
||||
macOnExit,
|
||||
macOnMode,
|
||||
macOnSpeed,
|
||||
macOnClick,
|
||||
macOnFFTScale,
|
||||
macOnEnd,
|
||||
};
|
||||
//extern char g_MMLogDir[256];
|
||||
|
||||
extern const char MONN[];
|
||||
extern const char MONU[];
|
||||
extern const LPCSTR g_tLogModeTable[];
|
||||
extern const LPCSTR g_tDispModeTable[];
|
||||
extern const LPCSTR g_tMacEvent[];
|
||||
extern const LPCSTR g_tSoundCH[];
|
||||
extern const LPCSTR g_tOnOff[];
|
||||
|
||||
#ifndef LPCUSTR
|
||||
typedef const unsigned char * LPCUSTR;
|
||||
typedef unsigned char * LPUSTR;
|
||||
#endif
|
||||
|
||||
#define ABS(c) (((c)<0)?(-(c)):(c))
|
||||
#define AN(p) (sizeof(p)/sizeof(*(p)))
|
||||
#define CR 0x0d
|
||||
#define LF 0x0a
|
||||
#define TAB '\t'
|
||||
|
||||
#define FSBOLD 1
|
||||
#define FSITALIC 2
|
||||
#define FSUNDERLINE 4
|
||||
#define FSSTRIKEOUT 8
|
||||
|
||||
typedef struct {
|
||||
AnsiString m_Name;
|
||||
BYTE m_Charset;
|
||||
int m_Height;
|
||||
DWORD m_Style;
|
||||
}FONTDATA;
|
||||
|
||||
enum {
|
||||
kkTX,
|
||||
kkTXOFF,
|
||||
kkEOF,
|
||||
};
|
||||
typedef struct {
|
||||
WORD Key;
|
||||
LPCSTR pName;
|
||||
}DEFKEYTBL;
|
||||
extern const DEFKEYTBL KEYTBL[];
|
||||
LPCSTR __fastcall ToDXKey(LPCSTR s);
|
||||
LPCSTR __fastcall ToJAKey(LPCSTR s);
|
||||
LPCSTR __fastcall GetKeyName(WORD Key);
|
||||
WORD __fastcall GetKeyCode(LPCSTR pName);
|
||||
|
||||
enum {
|
||||
fmJA,
|
||||
fmHL,
|
||||
fmJOHAB,
|
||||
fmBV,
|
||||
fmBY,
|
||||
fmEND,
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
AnsiString m_CallSign;
|
||||
|
||||
WORD m_DefKey[kkEOF];
|
||||
|
||||
BOOL m_PTTLock;
|
||||
|
||||
int m_bFSKOUT;
|
||||
int m_bINVFSK;
|
||||
AnsiString m_PTTCOM;
|
||||
|
||||
int m_DefaultMode;
|
||||
int m_LoopBack;
|
||||
int m_MsgEng;
|
||||
|
||||
LCID m_LCID;
|
||||
WORD m_wLang;
|
||||
BOOL m_fShowLangMsg;
|
||||
BOOL m_fBaseMBCS;
|
||||
DWORD m_dwVersion;
|
||||
BOOL m_WinNT;
|
||||
BOOL m_WinVista;
|
||||
|
||||
AnsiString m_FontName;
|
||||
BYTE m_FontCharset;
|
||||
|
||||
BYTE m_Charset;
|
||||
BOOL m_fFontFam;
|
||||
BOOL m_tFontFam[fmEND];
|
||||
|
||||
int m_OptionPage;
|
||||
int m_EventIndex;
|
||||
|
||||
char m_BgnDir[256];
|
||||
char m_SoundDir[256];
|
||||
char m_ExtLogDir[256];
|
||||
char m_LogDir[256];
|
||||
char m_TextDir[256];
|
||||
char m_MacroDir[256];
|
||||
|
||||
int m_AutoTimeOffset;
|
||||
int m_TimeOffset;
|
||||
int m_TimeOffsetMin;
|
||||
int m_LogLink;
|
||||
AnsiString m_LogName;
|
||||
|
||||
BOOL m_fRestoreSubChannel;
|
||||
BOOL m_fFixWindow;
|
||||
RECT m_rcWindow; // ウインドウの配置
|
||||
int m_WindowState; // ウインドウの状態
|
||||
|
||||
BOOL m_fAutoTS;
|
||||
|
||||
BOOL m_fSendSingleTone;
|
||||
|
||||
BOOL m_EnableMouseWheel;
|
||||
AnsiString m_SoundIDRX;
|
||||
AnsiString m_SoundIDTX;
|
||||
AnsiString m_SoundMMW; // MMW名
|
||||
|
||||
AnsiString m_AS;
|
||||
AnsiString m_MacEvent[macOnEnd];
|
||||
|
||||
BOOL m_fPlayBack;
|
||||
int m_PlayBackSpeed;
|
||||
BOOL m_fShowCtrlCode;
|
||||
|
||||
BOOL m_MFSK_Center;
|
||||
BOOL m_MFSK_SQ_Metric;
|
||||
|
||||
BOOL m_MacroError;
|
||||
int m_MaxCarrier;
|
||||
int m_DecCutOff;
|
||||
int m_MacBuffSize;
|
||||
int m_OnTimerInterval;
|
||||
RECT m_PosMacEdit;
|
||||
|
||||
#if DEBUG
|
||||
BOOL m_test;
|
||||
int m_testSN;
|
||||
AnsiString m_testName;
|
||||
double m_testGain;
|
||||
double m_testNoiseGain;
|
||||
int m_testCarrier1;
|
||||
int m_testCarrier2;
|
||||
int m_testDB2;
|
||||
double m_testGain2;
|
||||
int m_testQSBTime;
|
||||
int m_testQSBDB;
|
||||
BOOL m_test500;
|
||||
BOOL m_testPhase;
|
||||
int m_testClockErr;
|
||||
#endif
|
||||
#if SHOWERRCOUNT
|
||||
int m_ErrPhase;
|
||||
#endif
|
||||
}SYSSET;
|
||||
extern SYSSET sys;
|
||||
|
||||
typedef struct {
|
||||
int WMax;
|
||||
int Max;
|
||||
int Sum;
|
||||
int dBSum;
|
||||
int dBMax;
|
||||
int dBWMax;
|
||||
|
||||
int Timer;
|
||||
int VW;
|
||||
int LimitL, LimitH;
|
||||
int Sig;
|
||||
int DispSig;
|
||||
}FFTSTG;
|
||||
|
||||
///---------------------------------------------------------
|
||||
typedef union {
|
||||
struct {
|
||||
BYTE r;
|
||||
BYTE g;
|
||||
BYTE b;
|
||||
BYTE s;
|
||||
}b;
|
||||
DWORD d;
|
||||
TColor c;
|
||||
}UCOL;
|
||||
///---------------------------------------------------------
|
||||
/// テキスト文字列ストリーマー
|
||||
class CTextString
|
||||
{
|
||||
private:
|
||||
LPCSTR rp;
|
||||
public:
|
||||
inline __fastcall CTextString(LPCSTR p){
|
||||
rp = p;
|
||||
};
|
||||
inline __fastcall CTextString(AnsiString &As){
|
||||
rp = As.c_str();
|
||||
};
|
||||
int __fastcall LoadText(LPSTR tp, int len);
|
||||
};
|
||||
|
||||
class CWebRef
|
||||
{
|
||||
private:
|
||||
AnsiString HTML;
|
||||
public:
|
||||
__fastcall CWebRef();
|
||||
inline bool __fastcall IsHTML(void){
|
||||
return !HTML.IsEmpty();
|
||||
};
|
||||
void __fastcall ShowHTML(LPCSTR url);
|
||||
};
|
||||
|
||||
///---------------------------------------------------------
|
||||
/// テキストバッファストリーマー
|
||||
class StrText{
|
||||
public:
|
||||
char *Bp;
|
||||
char *Wp;
|
||||
inline __fastcall StrText(int max){
|
||||
Bp = new char[max];
|
||||
Clear();
|
||||
};
|
||||
inline __fastcall ~StrText(){
|
||||
delete Bp;
|
||||
};
|
||||
inline char *Printf(char *ct, ...){
|
||||
va_list pp;
|
||||
|
||||
va_start(pp, ct);
|
||||
vsprintf(Wp, ct, pp );
|
||||
va_end(pp);
|
||||
ct = Wp;
|
||||
Wp += strlen(Wp);
|
||||
return(ct);
|
||||
};
|
||||
inline void __fastcall Add(LPCSTR sp){
|
||||
strcpy(Wp, sp);
|
||||
Wp += strlen(Wp);
|
||||
};
|
||||
inline void __fastcall Write(void *p, int n){
|
||||
memcpy(Wp, p, n);
|
||||
Wp += n;
|
||||
*Wp = 0;
|
||||
};
|
||||
inline int __fastcall GetCnt(void){
|
||||
return Wp - Bp;
|
||||
};
|
||||
inline void __fastcall Clear(void){
|
||||
Wp = Bp;
|
||||
*Wp = 0;
|
||||
};
|
||||
inline char *__fastcall GetText(void){
|
||||
return Bp;
|
||||
};
|
||||
};
|
||||
|
||||
class CWaitCursor
|
||||
{
|
||||
private:
|
||||
TCursor sv;
|
||||
public:
|
||||
__fastcall CWaitCursor();
|
||||
__fastcall ~CWaitCursor();
|
||||
void __fastcall Delete(void);
|
||||
void __fastcall Wait(void);
|
||||
};
|
||||
|
||||
///---------------------------------------------------------
|
||||
/// コントロールのアラインの管理クラス
|
||||
class CAlign
|
||||
{
|
||||
private:
|
||||
int BTop, BLeft;
|
||||
int BWidth, BHeight;
|
||||
int OTop, OLeft;
|
||||
int OWidth, OHeight;
|
||||
int OFontHeight;
|
||||
double m_FontAdj;
|
||||
|
||||
TControl *tp;
|
||||
TFont *fp;
|
||||
public:
|
||||
inline __fastcall CAlign(void){
|
||||
tp = NULL;
|
||||
fp = NULL;
|
||||
m_FontAdj = 1.0;
|
||||
};
|
||||
inline __fastcall ~CAlign(){
|
||||
};
|
||||
void __fastcall InitControl(TControl *p, TControl *pB, TFont *pF = NULL);
|
||||
void __fastcall InitControl(TControl *p, RECT *rp, TFont *pF = NULL);
|
||||
void __fastcall NewAlign(TControl *pB);
|
||||
inline double __fastcall GetFontAdj(void){return fabs(m_FontAdj);};
|
||||
inline TControl *__fastcall GetControl(void){return tp;};
|
||||
void __fastcall NewAlign(TControl *pB, double hx);
|
||||
void __fastcall NewFont(AnsiString &FontName, BYTE Charset, TFontStyles fs);
|
||||
void __fastcall NewFixAlign(TControl *pB, int XR);
|
||||
void __fastcall Resume(void);
|
||||
};
|
||||
|
||||
///---------------------------------------------------------
|
||||
/// コントロールのアラインの管理クラス
|
||||
class CAlignList
|
||||
{
|
||||
private:
|
||||
int Max;
|
||||
int Cnt;
|
||||
CAlign **AlignList;
|
||||
void __fastcall Alloc(void);
|
||||
public:
|
||||
__fastcall CAlignList(void);
|
||||
__fastcall ~CAlignList();
|
||||
void __fastcall EntryControl(TControl *tp, TControl *pB, TFont *pF = NULL);
|
||||
void __fastcall EntryControl(TControl *tp, RECT *rp, TFont *pF = NULL);
|
||||
void __fastcall EntryControl(TControl *tp, int XW, int YW, TFont *pF = NULL);
|
||||
void __fastcall NewAlign(TControl *pB);
|
||||
double __fastcall GetFontAdj(TControl *pB);
|
||||
void __fastcall NewAlign(TControl *pB, TControl *pS, double hx);
|
||||
void __fastcall NewFont(AnsiString &FontName, BYTE Charset, TFontStyles fs);
|
||||
void __fastcall NewFixAlign(TControl *pB, int XR);
|
||||
void __fastcall Resume(TControl *pB);
|
||||
};
|
||||
|
||||
int __fastcall FindStringTableStrictly(const LPCSTR _tt[], LPCSTR pName, int max);
|
||||
int __fastcall FindStringTable(const LPCSTR _tt[], LPCSTR pName, int max);
|
||||
int __fastcall GetModeIndex(LPCSTR pName);
|
||||
int __fastcall IsFile(LPCSTR pName);
|
||||
BOOL __fastcall StrWindowsVer(LPSTR t);
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
int __fastcall SetTimeOffsetInfo(int &Hour, int &Min);
|
||||
void __fastcall AddjustOffset(SYSTEMTIME *tp);
|
||||
void __fastcall GetUTC(SYSTEMTIME *tp);
|
||||
void __fastcall GetLocal(SYSTEMTIME *tp);
|
||||
LPSTR __fastcall StrDupe(LPCSTR s);
|
||||
|
||||
LPUSTR __fastcall jstrupr(LPUSTR s);
|
||||
LPUSTR __fastcall jstrlwr(LPUSTR s);
|
||||
inline LPSTR __fastcall jstrupr(LPSTR s){return (LPSTR)jstrupr(LPUSTR(s));};
|
||||
inline LPSTR __fastcall jstrlwr(LPSTR s){return (LPSTR)jstrlwr(LPUSTR(s));};
|
||||
LPCSTR __fastcall ConvAndChar(LPSTR t, LPCSTR p);
|
||||
|
||||
void __fastcall OnWave(void);
|
||||
int __fastcall SetTimeOffsetInfo(int &Hour, int &Min);
|
||||
WORD __fastcall AdjustRolTimeUTC(WORD tim, char c);
|
||||
void __fastcall DrawMessage(TCanvas *pCanvas, int XW, int YW, LPCSTR p, int Pos);
|
||||
void __fastcall FormCenter(TForm *tp, int XW, int YW);
|
||||
void __fastcall FormCenter(TForm *tp, TForm *pOwner);
|
||||
void __fastcall FormCenter(TForm *tp);
|
||||
char *__fastcall lastp(char *p);
|
||||
char *__fastcall clipsp(char *s);
|
||||
LPCSTR __fastcall _strdmcpy(LPSTR t, LPCSTR p, char c);
|
||||
const char *__fastcall StrDlmCpy(char *t, const char *p, char Dlm, int len);
|
||||
const char *__fastcall StrDlmCpyK(char *t, const char *p, char Dlm, int len);
|
||||
void __fastcall StrCopy(LPSTR t, LPCSTR s, int n);
|
||||
char __fastcall LastC(LPCSTR p);
|
||||
LPCSTR __fastcall GetEXT(LPCSTR Fname);
|
||||
void __fastcall SetEXT(LPSTR pName, LPSTR pExt);
|
||||
BOOL __fastcall CheckEXT(LPCSTR pName, LPCSTR pExt);
|
||||
void __fastcall SetCurDir(LPSTR t, int size);
|
||||
void __fastcall SetDirName(LPSTR t, LPCSTR pName);
|
||||
void __fastcall GetFileName(AnsiString &Name, LPCSTR pName);
|
||||
void __fastcall GetFullPathName(AnsiString &as, LPCSTR pName);
|
||||
void __fastcall GetFullPathName(AnsiString &as, LPCSTR pName, LPCSTR pFolder);
|
||||
void __fastcall LimitInt(int *pInt, int min, int max);
|
||||
void __fastcall LimitDbl(double *pInt, double min, double max);
|
||||
LPCSTR __fastcall StrDbl(LPSTR bf, double d);
|
||||
void __fastcall AdjustAS(AnsiString *pAS);
|
||||
void __fastcall ClipLF(LPSTR sp);
|
||||
void __fastcall DelCR(AnsiString &ws, LPCSTR s);
|
||||
void __fastcall DeleteComment(LPSTR bf);
|
||||
LPSTR __fastcall FillSpace(LPSTR s, int n);
|
||||
LPCSTR __fastcall SkipToValue(LPCSTR sp);
|
||||
LPSTR __fastcall SkipSpace(LPSTR sp);
|
||||
LPCSTR __fastcall SkipSpace(LPCSTR sp);
|
||||
LPSTR __fastcall DelLastSpace(LPSTR t);
|
||||
LPSTR __fastcall StrDlm(LPSTR &t, LPSTR p);
|
||||
LPSTR __fastcall StrDlm(LPSTR &t, LPSTR p, char c);
|
||||
void __fastcall ChgString(LPSTR t, char a, char b);
|
||||
void __fastcall DelChar(LPSTR t, char a);
|
||||
int __fastcall atoin(const char *p, int n);
|
||||
int __fastcall htoin(const char *p, int n);
|
||||
|
||||
int __fastcall GetActiveIndex(TPageControl *pp);
|
||||
void __fastcall SetActiveIndex(TPageControl *pp, int page);
|
||||
int __fastcall InvMenu(TMenuItem *pItem);
|
||||
|
||||
void InfoMB(LPCSTR fmt, ...);
|
||||
void ErrorMB(LPCSTR fmt, ...);
|
||||
void WarningMB(LPCSTR fmt, ...);
|
||||
int YesNoMB(LPCSTR fmt, ...);
|
||||
int YesNoCancelMB(LPCSTR fmt, ...);
|
||||
int OkCancelMB(LPCSTR fmt, ...);
|
||||
void __fastcall ErrorFWrite(LPCSTR pName);
|
||||
|
||||
int __fastcall RemoveL2(LPSTR t, LPSTR ss, LPCSTR pKey, int size);
|
||||
void __fastcall AddL2(LPSTR t, LPCSTR pKey, LPCSTR s, UCHAR c1, UCHAR c2, int size);
|
||||
int __fastcall IsJA(const char *s);
|
||||
LPCSTR __fastcall ClipCall(LPCSTR s);
|
||||
void __fastcall chgptb(LPSTR s);
|
||||
LPCSTR __fastcall ClipCC(LPCSTR s);
|
||||
void __fastcall Yen2CrLf(AnsiString &ws, AnsiString &cs);
|
||||
void __fastcall CrLf2Yen(AnsiString &ws, AnsiString &cs);
|
||||
|
||||
void __fastcall GetLogFont(LOGFONT *pLogfont, TFont *pFont);
|
||||
void __fastcall AddStyle(AnsiString &as, BYTE charset, DWORD style);
|
||||
TFontStyles __fastcall Code2FontStyle(int code);
|
||||
int __fastcall FontStyle2Code(TFontStyles style);
|
||||
void __fastcall LoadFontFromInifile(TFont *pFont, LPCSTR pSect, TMemIniFile *pIniFile);
|
||||
void __fastcall SaveFontToInifile(TFont *pFont, LPCSTR pSect, TMemIniFile *pIniFile);
|
||||
UCOL __fastcall GetGrade2(UCOL s[2], int x, int xw);
|
||||
void __fastcall CheckFontCharset(void);
|
||||
BOOL __fastcall SetLangFont(TFont *pFont, WORD wLang);
|
||||
void __fastcall SetMBCP(BYTE charset);
|
||||
|
||||
void __fastcall Font2FontData(FONTDATA *pData, TFont *pFont);
|
||||
void __fastcall FontData2Font(TFont *pFont, FONTDATA *pData);
|
||||
void __fastcall LoadFontFromInifile(FONTDATA *pData, LPCSTR pSect, TMemIniFile *pIniFile);
|
||||
void __fastcall SaveFontToInifile(FONTDATA *pData, LPCSTR pSect, TMemIniFile *pIniFile);
|
||||
|
||||
void __fastcall NumCopy(LPSTR t, LPCSTR p);
|
||||
int __fastcall IsNumbs(LPCSTR p);
|
||||
int __fastcall IsNumbAll(LPCSTR p);
|
||||
int __fastcall IsAlphas(LPCSTR p);
|
||||
int __fastcall IsAlphaAll(LPCSTR p);
|
||||
int __fastcall IsRST(LPCSTR p);
|
||||
int __fastcall IsCallChar(char c);
|
||||
int __fastcall IsCall(LPCSTR p);
|
||||
int __fastcall IsJA(const char *s);
|
||||
LPCSTR __fastcall ClipCall(LPCSTR s);
|
||||
LPCSTR __fastcall ClipCC(LPCSTR s);
|
||||
/*
|
||||
inline LPUSTR __fastcall StrDlm(LPUSTR &t, LPUSTR p, char c){return (LPUSTR)StrDlm(LPSTR(t), LPSTR(p), c);};
|
||||
inline LPUSTR __fastcall StrDlm(LPUSTR &t, LPUSTR p){return (LPUSTR)StrDlm(LPSTR(t), LPSTR(p));};
|
||||
inline LPUSTR __fastcall StrDlm(LPUSTR &t, LPSTR p, char c){return (LPUSTR)StrDlm(LPSTR(t), p, c);};
|
||||
inline LPUSTR __fastcall StrDlm(LPUSTR &t, LPSTR p){return (LPUSTR)StrDlm(LPSTR(t), p);};
|
||||
*/
|
||||
void __fastcall SetGroupEnabled(TGroupBox *gp);
|
||||
void __fastcall KeyEvent(const short *p);
|
||||
|
||||
int __fastcall Calc(double &d, LPCSTR p);
|
||||
int __fastcall CalcI(int &d, LPCSTR p);
|
||||
int __fastcall CalcU(int &d, LPCSTR p);
|
||||
|
||||
void __fastcall GPS2SystemTime(ULONG gps, SYSTEMTIME *sp);
|
||||
ULONG __fastcall SystemTime2GPS(SYSTEMTIME *sp);
|
||||
|
||||
void __fastcall SetComboBox(TComboBox *pCombo, LPCSTR pList);
|
||||
void __fastcall GetComboBox(AnsiString &as, TComboBox *pCombo);
|
||||
|
||||
void __fastcall ConvDummy(AnsiString &ws, LPCSTR p, LPCSTR pNames, LPCSTR pValues);
|
||||
|
||||
typedef struct {
|
||||
LPSTR pStr;
|
||||
int Count;
|
||||
}MULTSET;
|
||||
|
||||
class CMULT
|
||||
{
|
||||
private:
|
||||
int m_CNT;
|
||||
int m_MAX;
|
||||
MULTSET *m_pBase;
|
||||
// LPSTR *m_pStr;
|
||||
// LPSTR m_pStr[MULTMAX];
|
||||
private:
|
||||
void __fastcall Alloc(void);
|
||||
|
||||
public:
|
||||
__fastcall CMULT();
|
||||
__fastcall ~CMULT(){
|
||||
Clear();
|
||||
};
|
||||
void __fastcall Clear(void);
|
||||
int __fastcall Add(LPCSTR pKey);
|
||||
int __fastcall Set(LPCSTR pKey, int n);
|
||||
int __fastcall GetCount(void){
|
||||
return m_CNT;
|
||||
};
|
||||
void __fastcall Sort(void);
|
||||
void __fastcall SortCount(void);
|
||||
LPCSTR __fastcall GetText(int n){
|
||||
if( (n >= 0) && (n < m_CNT) ){
|
||||
return m_pBase[n].pStr;
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
}
|
||||
};
|
||||
int __fastcall GetCount(int n){
|
||||
if( (n >= 0) && (n < m_CNT) ){
|
||||
return m_pBase[n].Count;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
int __fastcall GetCount(LPCSTR pKey);
|
||||
int __fastcall GetTotal(void);
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
class CCond
|
||||
{
|
||||
private:
|
||||
int m_CIFMAX;
|
||||
int m_f; /* 条件のカウンタ */
|
||||
int m_fc; /* 偽の場合のレベルカウンタ */
|
||||
int *m_pE; /* 状態のネスト配列 */
|
||||
int *m_pAF; /* 展開フラグのネスト配列 */
|
||||
int m_err; /* エラーチェック */
|
||||
BOOL m_fCond;
|
||||
|
||||
int __fastcall BgnCond(void);
|
||||
public:
|
||||
int __fastcall CondJob(const char *p, TSpeedButton *pButton);
|
||||
int __fastcall CondStr(AnsiString &Cond, const char *p);
|
||||
inline void __fastcall SetCond(void){m_fCond=TRUE;};
|
||||
inline BOOL __fastcall IsCond(void){return m_fCond;};
|
||||
inline int __fastcall GetLevel(void){return m_f;};
|
||||
inline void __fastcall ClearLevel(void){m_f = 0;};
|
||||
|
||||
__fastcall CCond(int max);
|
||||
__fastcall ~CCond(void);
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
#pragma option -a- // パックの指示
|
||||
typedef struct {
|
||||
WORD hash;
|
||||
BYTE mtype;
|
||||
BYTE dummy;
|
||||
LPCSTR pName;
|
||||
LPCSTR pString;
|
||||
LPCSTR pPara;
|
||||
}VALDATA;
|
||||
#pragma option -a. // パック解除の指示
|
||||
|
||||
#define _VAL_NORMAL 1
|
||||
#define _VAL_INIFILE 2
|
||||
#define _VAL_PROC 4
|
||||
|
||||
class CVal
|
||||
{
|
||||
private:
|
||||
VALDATA *m_pBase;
|
||||
int m_Max;
|
||||
int m_Count;
|
||||
BOOL m_fHandleProc;
|
||||
private:
|
||||
void __fastcall Alloc(void);
|
||||
|
||||
public:
|
||||
__fastcall CVal();
|
||||
__fastcall ~CVal(){Delete();};
|
||||
|
||||
inline int __fastcall GetCount(void){return m_Count;};
|
||||
inline BOOL __fastcall IsHandleProc(void){return m_fHandleProc;};
|
||||
|
||||
void __fastcall Delete(void);
|
||||
void __fastcall Delete(BYTE mtype);
|
||||
BOOL __fastcall Delete(LPCSTR pName, BYTE mtype);
|
||||
|
||||
int __fastcall FindName(LPCSTR pName, BYTE mtype);
|
||||
void __fastcall RegisterString(LPCSTR pName, LPCSTR pString, LPCSTR pPara, BYTE mtype);
|
||||
|
||||
void __fastcall WriteInifile(TMemIniFile *pIniFile, LPCSTR pSect);
|
||||
void __fastcall ReadInifile(TMemIniFile *pIniFile, LPCSTR pSect);
|
||||
|
||||
inline LPCSTR __fastcall GetString(int n){ return m_pBase[n].pString; };
|
||||
inline LPCSTR __fastcall GetPara(int n){ return m_pBase[n].pPara; };
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
#pragma option -a- // パックの指示
|
||||
typedef struct {
|
||||
WORD cMBCS;
|
||||
WORD cASCII;
|
||||
}CONVALPHA;
|
||||
#pragma option -a. // パック解除の指示
|
||||
|
||||
class CMBCS
|
||||
{
|
||||
private:
|
||||
BYTE *m_pLead;
|
||||
int m_Charset;
|
||||
public:
|
||||
__fastcall CMBCS();
|
||||
__fastcall ~CMBCS();
|
||||
void __fastcall Create(BYTE charset);
|
||||
void __fastcall Create(void);
|
||||
BOOL __fastcall IsLead(BYTE c);
|
||||
BOOL __fastcall IsLead(const unsigned char *p);
|
||||
int __fastcall ConvAlpha(int code);
|
||||
|
||||
inline BOOL __fastcall IsCreate(void){return m_pLead != NULL;};
|
||||
inline void __fastcall SetCharset(BYTE charset){m_Charset = charset;};
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// CLIBLクラス
|
||||
typedef struct {
|
||||
LPCSTR pName;
|
||||
//HANDLE hLib; //ja7ude 0522
|
||||
HINSTANCE hLib;
|
||||
}LIBD;
|
||||
|
||||
typedef void (__stdcall *tmmMacro)(HWND hWnd, LPSTR t, LPCSTR p);
|
||||
class CLIBL {
|
||||
public:
|
||||
int m_AMax;
|
||||
int m_Count;
|
||||
LIBD *m_pBase;
|
||||
private:
|
||||
void __fastcall Alloc(void);
|
||||
void __fastcall Add(LPCSTR pName, HANDLE hLib);
|
||||
public:
|
||||
CLIBL(){
|
||||
m_pBase = NULL;
|
||||
Delete();
|
||||
};
|
||||
~CLIBL(){
|
||||
Delete();
|
||||
};
|
||||
void __fastcall Delete(void);
|
||||
HANDLE __fastcall LoadLibrary(LPCSTR pName);
|
||||
void __fastcall DeleteLibrary(HANDLE hLib);
|
||||
};
|
||||
#endif
|
||||
|
||||
576
Comm.cpp
Normal file
576
Comm.cpp
Normal file
|
|
@ -0,0 +1,576 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
#include <vcl.h>
|
||||
#pragma hdrstop
|
||||
|
||||
#include "Comm.h"
|
||||
#include "ComLib.h"
|
||||
#include "Dsp.h"
|
||||
|
||||
#define WAITSTAT 0
|
||||
|
||||
#define DEFFSOUND 3
|
||||
|
||||
COMMPARA COMM;
|
||||
void __fastcall InitCOMMPara(void)
|
||||
{
|
||||
COMM.change = 1;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
void CALLBACK MMTimeProc(UINT uID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2)
|
||||
{
|
||||
CComm *pComm = (CComm *)dwUser;
|
||||
if( uID != pComm->m_uMMTimerID ) return;
|
||||
|
||||
pComm->m_FSK.Timer();
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
// CFSK class
|
||||
__fastcall CFSK::CFSK(void)
|
||||
{
|
||||
m_bPortD = 0;
|
||||
|
||||
m_BLen = 5;
|
||||
Init();
|
||||
#if MeasureAccuracy
|
||||
QueryPerformanceFrequency(&m_liFreq);
|
||||
m_liPOld.u.HighPart = -1;
|
||||
#endif
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall CFSK::Init(void)
|
||||
{
|
||||
m_hPort = INVALID_HANDLE_VALUE;
|
||||
m_StgD = -1;
|
||||
m_Sequence = 0;
|
||||
m_Count = 0;
|
||||
m_oFSK = 1;
|
||||
m_aFSK = -1;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall CFSK::SetHandle(HANDLE hPort)
|
||||
{
|
||||
m_hPort = hPort;
|
||||
m_StgD = -1;
|
||||
m_Sequence = 0;
|
||||
m_Count = 0;
|
||||
m_oFSK = 1; // mark signal
|
||||
m_aFSK = -1;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
// para: Upper16bits Speed(eg. 45)
|
||||
// Lower16bits b1-b0 Stop (0-1, 1-1.5, 2-2)
|
||||
// b5-b2 Length
|
||||
void __fastcall CFSK::SetPara(LONG para)
|
||||
{
|
||||
m_BLen = (para >> 2) & 0x000f;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
// This function is called from the TimeProc(). and according to
|
||||
//MSDN, it may be an illegal operation. MSDN said, Applications
|
||||
//should not call any system-defined functions from inside a
|
||||
//callback function, except for several functions.
|
||||
// However, the EscapeCommFunction() seems to be no problem on my
|
||||
//PCs with Windows 2000 and Windows XP, but I am not sure if it
|
||||
//works on every PC.
|
||||
// BTW, EnterCriticalSection() and LeaveCriticalSection() had problem
|
||||
//on this, and I gave up to use them....
|
||||
//
|
||||
void __fastcall CFSK::SetPort(int sw)
|
||||
{
|
||||
::EscapeCommFunction(m_hPort, sw ? SETBREAK : CLRBREAK);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
// 11ms interval
|
||||
void __fastcall CFSK::Timer(void)
|
||||
{
|
||||
if( m_Count <= 0 ){
|
||||
switch(m_Sequence){
|
||||
case 1: // output data
|
||||
m_oFSK = (m_NowD & 1) ? 1 : 0;
|
||||
m_NowD = m_NowD >> 1;
|
||||
m_BCount--;
|
||||
if( !m_BCount ){
|
||||
m_Sequence++;
|
||||
}
|
||||
m_Count = 1;
|
||||
break;
|
||||
case 2: // output stop-bit
|
||||
m_oFSK = 1;
|
||||
m_Count = 2;
|
||||
m_Sequence = 0;
|
||||
break;
|
||||
default:
|
||||
if( m_StgD != -1 ){
|
||||
m_NowD = m_StgD;
|
||||
m_StgD = -1;
|
||||
m_BCount = m_BLen;
|
||||
m_oFSK = 0; // output start-bit
|
||||
m_Sequence = 1;
|
||||
m_Count = 1;
|
||||
m_Idle = 0;
|
||||
#if MeasureAccuracy
|
||||
if( QueryPerformanceCounter(&m_liPCur) ){
|
||||
if( m_liPOld.u.HighPart != -1 ){
|
||||
m_dlDiff = m_liPCur.QuadPart - m_liPOld.QuadPart;
|
||||
}
|
||||
m_liPOld = m_liPCur;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
m_oFSK = 1; // output mark signal.
|
||||
m_Idle = 1;
|
||||
#if MeasureAccuracy
|
||||
m_liPOld.u.HighPart = -1;
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
m_Count--;
|
||||
}
|
||||
|
||||
if( !IsOpen() ) return;
|
||||
|
||||
if( m_oFSK != m_aFSK ){
|
||||
m_aFSK = m_oFSK;
|
||||
SetPort(m_invFSK ? m_oFSK : !m_oFSK);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
__fastcall CComm::CComm(void)
|
||||
{
|
||||
m_CreateON = FALSE; // クリエイトフラグ
|
||||
m_Command = 0;
|
||||
m_fHnd = INVALID_HANDLE_VALUE; // ファイルハンドル
|
||||
m_ptt = m_scan = 0;
|
||||
m_pEXT = NULL;
|
||||
|
||||
m_Baud = 45;
|
||||
m_bFSKOUT = FALSE;
|
||||
m_bINVFSK = FALSE;
|
||||
|
||||
m_pReadTimerExtfsk = NULL;
|
||||
m_fSendChar = 0;
|
||||
m_Diddle = diddleLTR;
|
||||
m_Fig = FALSE;
|
||||
m_FigOut = FALSE;
|
||||
m_bDiddleEnabled = TRUE;
|
||||
m_cGuard = 0;
|
||||
|
||||
m_uMMTimerID = 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
int __fastcall CComm::GetPutChar(void)
|
||||
{
|
||||
int c;
|
||||
|
||||
if( m_QueueExtfsk.IsEmpty() ){
|
||||
if( !m_bDiddleEnabled ) return -1;
|
||||
switch(m_Diddle){
|
||||
case diddleLTR:
|
||||
c = 0x1f;
|
||||
if( m_Fig ) m_FigOut = TRUE;
|
||||
break;
|
||||
default:
|
||||
c = 0x00;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if( m_FigOut ){
|
||||
c = 0x1b;
|
||||
m_FigOut = FALSE;
|
||||
}
|
||||
else {
|
||||
c = m_QueueExtfsk.Pop();
|
||||
switch(c){
|
||||
case 0x1f: // 11111 LTR
|
||||
m_Fig = FALSE;
|
||||
break;
|
||||
case 0x1b: // 11011 FIG
|
||||
m_Fig = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return c;
|
||||
}
|
||||
//-----------------------------------------------------------------
|
||||
void __fastcall CComm::PutCharExtfsk( TObject *Sender )
|
||||
{
|
||||
if( m_cGuard > 0 ){
|
||||
m_cGuard--;
|
||||
return;
|
||||
}
|
||||
if( m_pEXT != NULL ){
|
||||
if( !m_pEXT->IsTxBusy() ){
|
||||
int c = GetPutChar();
|
||||
if( c != -1 ) m_pEXT->PutChar(BYTE(c));
|
||||
}
|
||||
}
|
||||
else if( m_FSK.IsOpen() ){
|
||||
if( !m_FSK.IsBusy() ){
|
||||
int c = GetPutChar();
|
||||
if( c != -1 ) m_FSK.PutByte(BYTE(c));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
void __fastcall CComm::CreateTimer(void)
|
||||
{
|
||||
if( !m_bFSKOUT ) return;
|
||||
if( !m_fSendChar ) return;
|
||||
if( !m_pEXT && (m_fHnd == INVALID_HANDLE_VALUE) ) return;
|
||||
|
||||
m_Fig = FALSE;
|
||||
m_FigOut = FALSE;
|
||||
|
||||
m_QueueExtfsk.Clear();
|
||||
if( !m_pReadTimerExtfsk ) m_pReadTimerExtfsk = new TTimer(NULL);
|
||||
int interval = (1000.0 / m_Baud);
|
||||
if( interval < 10 ) interval = 10;
|
||||
m_pReadTimerExtfsk->Interval = interval;
|
||||
m_pReadTimerExtfsk->Enabled = true;
|
||||
m_pReadTimerExtfsk->OnTimer = PutCharExtfsk;
|
||||
m_bDiddleEnabled = TRUE;
|
||||
m_cGuard = 8;
|
||||
|
||||
if( !m_pEXT && (m_fHnd != INVALID_HANDLE_VALUE) ){
|
||||
m_FSK.SetHandle(m_fHnd);
|
||||
m_FSK.ClearPort();
|
||||
|
||||
m_uMMTimerID = 0;
|
||||
if( ::timeGetDevCaps(&m_TimeCaps, sizeof(m_TimeCaps)) == TIMERR_NOERROR ){
|
||||
::timeBeginPeriod(m_TimeCaps.wPeriodMin);
|
||||
m_uMMTimerID = ::timeSetEvent(11, 0, MMTimeProc, DWORD(this), TIME_PERIODIC);
|
||||
}
|
||||
}
|
||||
}
|
||||
//-----------------------------------------------------------------
|
||||
void __fastcall CComm::DeleteTimer(void)
|
||||
{
|
||||
if( m_pReadTimerExtfsk ){
|
||||
delete m_pReadTimerExtfsk;
|
||||
m_pReadTimerExtfsk = NULL;
|
||||
}
|
||||
if( m_uMMTimerID ){
|
||||
m_FSK.Disable();
|
||||
|
||||
::timeKillEvent(m_uMMTimerID);
|
||||
m_uMMTimerID = 0;
|
||||
::timeEndPeriod(m_TimeCaps.wPeriodMin);
|
||||
}
|
||||
}
|
||||
|
||||
void __fastcall CComm::SetFSK(int bFSK, int bINV)
|
||||
{
|
||||
m_bFSKOUT = bFSK;
|
||||
m_bINVFSK = bINV;
|
||||
m_FSK.SetInvFSK(m_bINVFSK);
|
||||
if( m_ptt && !m_pReadTimerExtfsk ) CreateTimer();
|
||||
}
|
||||
|
||||
/*#$%
|
||||
==============================================================
|
||||
通信回線をクローズする
|
||||
--------------------------------------------------------------
|
||||
--------------------------------------------------------------
|
||||
--------------------------------------------------------------
|
||||
==============================================================
|
||||
*/
|
||||
void __fastcall CComm::Close(void)
|
||||
{
|
||||
if( m_CreateON ){
|
||||
DeleteTimer();
|
||||
if( m_pEXT != NULL ){
|
||||
delete m_pEXT;
|
||||
m_pEXT = NULL;
|
||||
}
|
||||
else if( m_fHnd != INVALID_HANDLE_VALUE ){
|
||||
::CloseHandle(m_fHnd);
|
||||
m_fHnd = INVALID_HANDLE_VALUE;
|
||||
}
|
||||
m_CreateON = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/*#$%
|
||||
==============================================================
|
||||
通信回線をオープンする
|
||||
--------------------------------------------------------------
|
||||
PortName : 回線の名前
|
||||
pCP : COMMPARAのポインタ(ヌルの時はデフォルトで初期化)
|
||||
RBufSize : 受信バッファのサイズ(default=2048)
|
||||
TBufSize : 送信バッファのサイズ(default=2048)
|
||||
--------------------------------------------------------------
|
||||
TRUE/FALSE
|
||||
--------------------------------------------------------------
|
||||
==============================================================
|
||||
*/
|
||||
BOOL __fastcall CComm::Open(LPCTSTR PortName)
|
||||
{
|
||||
if( m_CreateON ) Close();
|
||||
m_fHnd = ::CreateFile( PortName, GENERIC_READ | GENERIC_WRITE,
|
||||
0, NULL,
|
||||
OPEN_EXISTING,
|
||||
FILE_ATTRIBUTE_NORMAL,
|
||||
NULL
|
||||
);
|
||||
if( m_fHnd == INVALID_HANDLE_VALUE ){
|
||||
AnsiString as = "\\\\.\\";
|
||||
as += PortName;
|
||||
m_fHnd = ::CreateFile( as.c_str(), 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;
|
||||
para = (m_Baud << 16) | (5 << 2);
|
||||
m_pEXT->Open(para);
|
||||
m_CreateON = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
else {
|
||||
delete m_pEXT;
|
||||
m_pEXT = NULL;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
// setup device buffers
|
||||
if( ::SetupComm( m_fHnd, DWORD(1024), DWORD(2) ) == FALSE ){
|
||||
::CloseHandle(m_fHnd);
|
||||
m_fHnd = INVALID_HANDLE_VALUE;
|
||||
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 );
|
||||
m_fHnd = INVALID_HANDLE_VALUE;
|
||||
return FALSE;
|
||||
}
|
||||
::GetCommState( m_fHnd, &m_dcb );
|
||||
m_dcb.BaudRate = 9600;
|
||||
m_dcb.fBinary = TRUE;
|
||||
m_dcb.ByteSize = 8;
|
||||
m_dcb.Parity = NOPARITY;
|
||||
m_dcb.StopBits = ONESTOPBIT;
|
||||
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 = RTS_CONTROL_DISABLE; // 送信禁止
|
||||
m_dcb.fDtrControl = DTR_CONTROL_DISABLE; // 送信禁止
|
||||
|
||||
// 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( !::SetCommState( m_fHnd, &m_dcb ) ){
|
||||
::CloseHandle( m_fHnd );
|
||||
m_fHnd = INVALID_HANDLE_VALUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// get any early notifications
|
||||
if( !::SetCommMask( m_fHnd, EV_RXFLAG ) ){
|
||||
::CloseHandle(m_fHnd);
|
||||
m_fHnd = INVALID_HANDLE_VALUE;
|
||||
return FALSE;
|
||||
}
|
||||
m_CreateON = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
//-----------------------------------------------------------------
|
||||
// PTT切り替え用
|
||||
int __fastcall CComm::PTTOpen(void)
|
||||
{
|
||||
if( !m_CreateON ){
|
||||
if( !strcmpi(sys.m_PTTCOM.c_str(), "NONE") ) return FALSE;
|
||||
Open(sys.m_PTTCOM.c_str());
|
||||
if( !m_CreateON ) return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
//-----------------------------------------------------------------
|
||||
// PTT切り替え用
|
||||
int __fastcall CComm::SetPTT(void)
|
||||
{
|
||||
if( m_pEXT != NULL ){
|
||||
m_pEXT->SetPTT(m_ptt);
|
||||
}
|
||||
else if( m_fHnd != INVALID_HANDLE_VALUE ){
|
||||
::EscapeCommFunction(m_fHnd, m_ptt ? SETRTS : CLRRTS);
|
||||
::EscapeCommFunction(m_fHnd, m_ptt ? SETDTR : CLRDTR);
|
||||
}
|
||||
if( m_ptt ){
|
||||
CreateTimer();
|
||||
}
|
||||
else {
|
||||
DeleteTimer();
|
||||
}
|
||||
return m_ptt;
|
||||
}
|
||||
//-----------------------------------------------------------------
|
||||
// PTT切り替え用
|
||||
void __fastcall CComm::SetPTT(int sw)
|
||||
{
|
||||
m_ptt = sw;
|
||||
|
||||
if( !PTTOpen() ) return;
|
||||
if( !SetPTT() && (!sys.m_PTTLock) ) Close();
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
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);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
CQUE::CQUE(void)
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void __fastcall CQUE::Clear(void)
|
||||
{
|
||||
m_R = 0;
|
||||
m_W = 0;
|
||||
m_C = 0;
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void __fastcall CQUE::Push(BYTE c)
|
||||
{
|
||||
if( m_C < QUEMAX ){
|
||||
m_tFifo[m_W++] = c;
|
||||
if( m_W >= QUEMAX ) m_W = 0;
|
||||
m_C++;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
BYTE __fastcall CQUE::Pop(void)
|
||||
{
|
||||
if( !m_C ) return 0;
|
||||
|
||||
BYTE c = m_tFifo[m_R++];
|
||||
if( m_R >= QUEMAX ) m_R = 0;
|
||||
m_C--;
|
||||
return c;
|
||||
}
|
||||
|
||||
217
Comm.h
Normal file
217
Comm.h
Normal file
|
|
@ -0,0 +1,217 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
///----------------------------------------------------------
|
||||
/// RS232C通信クラス
|
||||
///
|
||||
/// (C) JE3HHT Makoto.Mori
|
||||
///
|
||||
//---------------------------------------------------------------------------
|
||||
#ifndef CommH
|
||||
#define CommH
|
||||
//---------------------------------------------------------------------------
|
||||
#include <Classes.hpp>
|
||||
#include <mmsystem.h>
|
||||
//---------------------------------------------------------------------------
|
||||
#define CR 0x0d
|
||||
#define LF 0x0a
|
||||
#define COMM_CLOSE 1
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
#define MeasureAccuracy FALSE
|
||||
//---------------------------------------------------------------------------
|
||||
class CFSK {
|
||||
private:
|
||||
volatile HANDLE m_hPort;
|
||||
|
||||
volatile BYTE m_bPortD;
|
||||
|
||||
volatile int m_BLen;
|
||||
|
||||
volatile int m_Sequence;
|
||||
volatile int m_Count;
|
||||
volatile int m_BCount;
|
||||
volatile int m_NowD;
|
||||
volatile int m_StgD;
|
||||
|
||||
volatile int m_Idle;
|
||||
|
||||
volatile int m_invFSK;
|
||||
volatile int m_oFSK;
|
||||
volatile int m_aFSK;
|
||||
|
||||
#if MeasureAccuracy
|
||||
LARGE_INTEGER m_liFreq;
|
||||
LARGE_INTEGER m_liPCur, m_liPOld;
|
||||
DWORDLONG m_dlDiff;
|
||||
#endif
|
||||
public:
|
||||
inline int __fastcall IsOpen(void){ return m_hPort != INVALID_HANDLE_VALUE;};
|
||||
|
||||
public:
|
||||
__fastcall CFSK(void);
|
||||
void __fastcall Init(void);
|
||||
void __fastcall Timer(void);
|
||||
void __fastcall SetPara(LONG para);
|
||||
inline void __fastcall Disable(void){m_hPort = INVALID_HANDLE_VALUE;};
|
||||
void __fastcall SetHandle(HANDLE hPort);
|
||||
void __fastcall PutByte(BYTE c){m_StgD = c;};
|
||||
void __fastcall SetPort(int sw);
|
||||
void __fastcall ClearPort(void){
|
||||
SetPort(m_invFSK ? m_oFSK : !m_oFSK);
|
||||
}
|
||||
inline int __fastcall IsBusy(void){
|
||||
return (m_StgD != -1) ? TRUE : FALSE;
|
||||
};
|
||||
inline void __fastcall SetInvFSK(int inv){
|
||||
m_invFSK = inv;
|
||||
m_aFSK = -1;
|
||||
};
|
||||
inline void __fastcall SetDelay(int n){m_Count = n;};
|
||||
#if MeasureAccuracy
|
||||
inline DWORDLONG __fastcall GetPDiff(void){return m_dlDiff;};
|
||||
inline DWORDLONG __fastcall GetPFreq(void){return m_liFreq.QuadPart;};
|
||||
#endif
|
||||
};
|
||||
|
||||
//Added by JA7UDE (April 17, 2010)
|
||||
#define EXTFSK_CHECK_INTERVAL 22
|
||||
//Till here
|
||||
|
||||
#define QUEMAX 1024
|
||||
class CQUE {
|
||||
private:
|
||||
int m_R;
|
||||
int m_W;
|
||||
int m_C;
|
||||
BYTE m_tFifo[QUEMAX];
|
||||
public:
|
||||
CQUE(void);
|
||||
void __fastcall Clear(void);
|
||||
void __fastcall Push(BYTE c);
|
||||
BYTE __fastcall Pop(void);
|
||||
|
||||
inline BOOL IsEmpty(void){return m_C == 0;};
|
||||
};
|
||||
|
||||
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; //ja7ude 0522
|
||||
HINSTANCE m_hLib;
|
||||
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:
|
||||
BOOL m_CreateON; // クリエイトフラグ
|
||||
volatile int m_Command;
|
||||
DCB m_dcb; // DCB
|
||||
HANDLE m_fHnd; // ファイルハンドル
|
||||
|
||||
int m_ptt;
|
||||
int m_scan;
|
||||
CEXTFSK *m_pEXT;
|
||||
|
||||
int m_Baud;
|
||||
int m_bFSKOUT;
|
||||
int m_bINVFSK;
|
||||
|
||||
int m_cGuard;
|
||||
int m_Fig;
|
||||
int m_FigOut;
|
||||
int m_Diddle;
|
||||
int m_fSendChar;
|
||||
int m_bDiddleEnabled;
|
||||
CQUE m_QueueExtfsk;
|
||||
TTimer *m_pReadTimerExtfsk;
|
||||
|
||||
TIMECAPS m_TimeCaps;
|
||||
UINT m_uMMTimerID;
|
||||
CFSK m_FSK;
|
||||
protected:
|
||||
private:
|
||||
int __fastcall PTTOpen(void);
|
||||
void __fastcall CreateTimer(void);
|
||||
void __fastcall DeleteTimer(void);
|
||||
|
||||
public:
|
||||
__fastcall CComm(void);
|
||||
__fastcall ~CComm(){
|
||||
Close();
|
||||
};
|
||||
inline BOOL __fastcall IsOpen(void){
|
||||
return m_CreateON;
|
||||
};
|
||||
BOOL __fastcall Open(LPCTSTR PortName);
|
||||
void __fastcall Close(void);
|
||||
int __fastcall SetPTT(void);
|
||||
void __fastcall SetPTT(int sw);
|
||||
|
||||
void __fastcall SetFSK(int bFSK, int bINV);
|
||||
int __fastcall GetPutChar(void);
|
||||
void __fastcall PutCharExtfsk( TObject *Sender ); //Added by JA7UDE on April 5, 2010
|
||||
void __fastcall SetSendChar(BOOL f){m_fSendChar = f;}; // Added by JE3HHT on Sep.1010
|
||||
void __fastcall SetDiddle(int d){m_Diddle = d;}; // Added by JE3HHT on Sep.1010
|
||||
BOOL __fastcall IsBaudChange(double speed){return int(speed) != m_Baud;};
|
||||
void __fastcall SetMark(void){m_bDiddleEnabled = FALSE;};
|
||||
};
|
||||
|
||||
void __fastcall InitCOMMPara(void);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
216
Dump.h
Normal file
216
Dump.h
Normal file
|
|
@ -0,0 +1,216 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
#ifndef DumpH
|
||||
#define DumpH
|
||||
|
||||
#include "stdio.h"
|
||||
#include "ComLib.h"
|
||||
//---------------------------------------------------------------------------
|
||||
#define DUMPCOLMAX 160
|
||||
#define DUMPCRLIMIT 4
|
||||
enum {
|
||||
csNONE,
|
||||
csCARET,
|
||||
csSTATIC,
|
||||
};
|
||||
enum {
|
||||
dmpMoveTOP=0x1000,
|
||||
dmpMoveLAST,
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
class CDump
|
||||
{
|
||||
private:
|
||||
int **m_pBase;
|
||||
|
||||
TRect m_rcScreen;
|
||||
BOOL m_fDisEvent;
|
||||
|
||||
int m_ScreenLineMax;
|
||||
int m_ScreenColMax;
|
||||
int m_StgLineMax;
|
||||
// int m_StgColMax;
|
||||
int m_FontYW;
|
||||
int m_FontXW;
|
||||
|
||||
BOOL m_fLastCP;
|
||||
int m_MLine; // 現在の最終行数
|
||||
int m_MCol; // 現愛の最終桁
|
||||
|
||||
int m_WTop;
|
||||
int m_WLine;
|
||||
int m_WCol;
|
||||
|
||||
int m_DTop;
|
||||
int m_X;
|
||||
int m_Y;
|
||||
|
||||
int m_RLine;
|
||||
int m_RCol;
|
||||
int m_RX;
|
||||
int m_RY;
|
||||
|
||||
int m_fSelText;
|
||||
int m_fSelect;
|
||||
int m_SLine;
|
||||
int m_SCol;
|
||||
|
||||
int m_FLine;
|
||||
|
||||
BOOL m_fWindow;
|
||||
|
||||
char m_Buffer[16];
|
||||
|
||||
int m_CursorType;
|
||||
int m_Cursor;
|
||||
|
||||
BOOL m_fKanji;
|
||||
BOOL m_fCR;
|
||||
BOOL m_fActive;
|
||||
int m_CRCount;
|
||||
|
||||
FILE *m_wfp;
|
||||
|
||||
UINT m_nTimerID;
|
||||
int m_MouseWheelCount;
|
||||
|
||||
BOOL m_fShowCtrlCode;
|
||||
|
||||
BOOL m_fRTTY;
|
||||
int m_SMX, m_SML;
|
||||
public:
|
||||
UCOL m_Color[5];
|
||||
TColor m_CursorColor;
|
||||
BOOL m_fConvAlpha;
|
||||
private:
|
||||
HWND m_hWnd;
|
||||
TPanel *m_pPanel;
|
||||
TFont *m_pFont;
|
||||
TCanvas *m_pCanvas;
|
||||
TPaintBox *m_pPaintBox;
|
||||
TScrollBar *m_pScrollBar;
|
||||
CMBCS *m_pMBCS;
|
||||
int m_ScreenXW;
|
||||
int m_ScreenYW;
|
||||
int m_ScreenLXW;
|
||||
LOGFONT m_LogFont;
|
||||
private:
|
||||
void __fastcall DeleteStg(void);
|
||||
void __fastcall SetBuffer(int c);
|
||||
int __fastcall CharWidth(int c);
|
||||
void __fastcall MemScroll(void);
|
||||
void __fastcall WriteLine(AnsiString &as, int line);
|
||||
void __fastcall WriteLine(int line);
|
||||
void __fastcall PutScroll(void);
|
||||
int __fastcall DrawChar(int x, int y, int c, BOOL f);
|
||||
void __fastcall DrawCursor(int x, int y, int sw);
|
||||
void __fastcall SetCursorPos(void);
|
||||
void __fastcall FollowRP(void);
|
||||
BOOL __fastcall BackSpace(void);
|
||||
void __fastcall InsChar(int c, int col);
|
||||
void __fastcall DeleteCR2(void);
|
||||
void __fastcall SetCompositionWindowPos(BOOL fFont);
|
||||
void __fastcall DeleteChar(BOOL fForce);
|
||||
void __fastcall DoWheel(int z);
|
||||
BOOL __fastcall IsSpace(int c, int ci);
|
||||
|
||||
int *__fastcall CreateContP(int line, int col, int add);
|
||||
void __fastcall CloseContP(int line, int col, int *bp, int offset);
|
||||
|
||||
public:
|
||||
__fastcall CDump(void);
|
||||
__fastcall ~CDump();
|
||||
void __fastcall Create(HWND hWnd, TPanel *pPanel, TPaintBox *pPaintBox, TFont *pFont, TScrollBar *pBar, int line);
|
||||
BOOL __fastcall PutChar(int c, int col);
|
||||
BOOL __fastcall PutKey(char c, int col);
|
||||
void PutStatus(int col, LPCSTR pFmt, ...);
|
||||
int __fastcall GetCharCount(BOOL fTX);
|
||||
int __fastcall GetChar(BOOL fDraw);
|
||||
int __fastcall GetCharNB(void);
|
||||
void __fastcall Clear(void);
|
||||
void __fastcall Paint(void);
|
||||
void __fastcall SetFont(TFont *pFont);
|
||||
void __fastcall Resize(void);
|
||||
void __fastcall SetScrollBar(void);
|
||||
void __fastcall OnScrollBarChange(void);
|
||||
BOOL __fastcall OnTimer(void);
|
||||
BOOL __fastcall OnMouseWheel(int z);
|
||||
void __fastcall SetCursorType(int type);
|
||||
void __fastcall Cursor(int sw);
|
||||
void __fastcall CreateCaret(void);
|
||||
void __fastcall DestroyCaret(void);
|
||||
void __fastcall MoveCursor(int Key);
|
||||
void __fastcall MoveCursor(int SX, int SY, BOOL fDown);
|
||||
inline __fastcall DeleteChar(void){DeleteChar(FALSE);};
|
||||
BOOL __fastcall CanEdit(void);
|
||||
|
||||
BOOL __fastcall ClearAllSelect(BOOL fPaint);
|
||||
BOOL __fastcall IsWindowText(LPCSTR pText);
|
||||
BOOL __fastcall GetWindowCallsign(AnsiString &as);
|
||||
void __fastcall GetWindowText(AnsiString &as);
|
||||
int __fastcall GetWindowText(AnsiString &as, int SX, int SY);
|
||||
|
||||
void __fastcall OpenLogFile(LPCSTR pName);
|
||||
void __fastcall CloseLogFile(void);
|
||||
inline __fastcall IsLogging(void){return m_wfp != NULL;};
|
||||
void __fastcall FlushLogFile(void);
|
||||
|
||||
void __fastcall DupeText(int col);
|
||||
|
||||
void __fastcall OpenSelect(void);
|
||||
void __fastcall CloseSelect(void);
|
||||
void __fastcall UpdateSelect(void);
|
||||
BOOL __fastcall ClearSelect(BOOL fPaint);
|
||||
BOOL __fastcall GetSelText(AnsiString &as);
|
||||
BOOL __fastcall DeleteSelText(void);
|
||||
inline __fastcall IsSelText(void){return m_fSelText;};
|
||||
void __fastcall Invalidate(void);
|
||||
void __fastcall SwapLTR(void);
|
||||
|
||||
inline int __fastcall GetScreenLine(void){return m_ScreenLineMax;};
|
||||
inline void __fastcall GetCursorPos(int &x, int &y){
|
||||
x = m_X; y = m_Y;
|
||||
};
|
||||
inline BOOL __fastcall IsCursorLast(void){return m_fLastCP;};
|
||||
|
||||
inline int __fastcall GetWindowSize(void){
|
||||
return (m_ScreenYW << 16) + m_ScreenXW;
|
||||
}
|
||||
inline LOGFONT *__fastcall GetLogFontP(void){return &m_LogFont;};
|
||||
inline BOOL __fastcall IsCreate(void){return m_hWnd != NULL;};
|
||||
inline BOOL __fastcall IsPrinted(void){return m_WLine + m_WCol;};
|
||||
inline void __fastcall SetMBCS(CMBCS *pMBCS){ m_pMBCS = pMBCS;};
|
||||
inline void __fastcall SetRTTY(BOOL f){m_fRTTY = f;};
|
||||
int __fastcall IsWord(void);
|
||||
void __fastcall ShowCtrl(BOOL f);
|
||||
|
||||
inline void __fastcall UpdateCaptureLimit(void){
|
||||
m_FLine = m_WLine;
|
||||
};
|
||||
inline void __fastcall ClearCaptureLimit(void){
|
||||
m_FLine = 0;
|
||||
}
|
||||
inline BOOL __fastcall IsActive(void){return m_fActive;};
|
||||
#if DEBUG
|
||||
void __fastcall Debug(LPSTR t);
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
304
EHISTORY.TXT
Normal file
304
EHISTORY.TXT
Normal file
|
|
@ -0,0 +1,304 @@
|
|||
========================
|
||||
BetaVer0.45 2010/OCT/04
|
||||
========================
|
||||
- Added mfsk4, mfsk8, mfsk32, mfsk64, mfsk11, and mfsk22 modes
|
||||
- Improved the decoder of the qpsk mode
|
||||
- Added an option that restores the subchannel window status on a start up
|
||||
- Enhanced macro
|
||||
- Applied minor updates
|
||||
|
||||
========================
|
||||
BetaVer0.44 2010/SEP/24
|
||||
========================
|
||||
- Added QPSK mode
|
||||
- Added a RTTY demodulator based on FFT
|
||||
- Added the FSK support (TNX to JA7UDE)
|
||||
When a COM port is selected, the MMVARI internally controls the FSK keying. When EXTFSK is selected, EXTFSK generates the FSK keying. MMVARI and EXTFSK use Windows' multimedia timer so that they might have 1msec jitter.
|
||||
- Added the English web site URL.
|
||||
- Updated the JARTS web site URL.
|
||||
- Added the selection of COM8 to COM16.
|
||||
- Added the rig control menu.
|
||||
- Updated the sound device selection.
|
||||
|
||||
========================
|
||||
BetaVer0.42 2007/JAN/15
|
||||
========================
|
||||
- Deleted the start-up warning message in the English environment
|
||||
|
||||
========================
|
||||
BetaVer0.41 2005/MAR/20
|
||||
========================
|
||||
- Enabled the TX capability in the BPSK-VariJA (MBCS) mode (Tnx to JE4IVN)
|
||||
- Fixed typo in the English mode
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.40 2005/JAN/08
|
||||
========================
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.39 2004/NOV/06
|
||||
========================
|
||||
- Improved the gateway to Turbo Hamlog/Win version 5
|
||||
|
||||
========================
|
||||
BetaVer0.38 2004/NOV/03
|
||||
========================
|
||||
- Added a gateway to Turbo Hamlog/Win version 5 (Tnx to JG1MOU)
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.37 2004/OCT/08
|
||||
========================
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.36 2004/SEP/30
|
||||
========================
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.35 2004/SEP/22
|
||||
========================
|
||||
- Expanded the macro capability
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.34 2004/SEP/11
|
||||
========================
|
||||
- Added event macros (e.g. OnPTT, OnQSO, OnStart)
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.33 2004/SEP/08
|
||||
========================
|
||||
- Improved the AFC for GMSK/PSK
|
||||
- Added OnTimer event macro
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.32 2004/SEP/04
|
||||
========================
|
||||
- Improved the decimation speed
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.31 2004/AUG/28
|
||||
========================
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.30 2004/AUG/15
|
||||
========================
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.29 2004/AUG/09
|
||||
========================
|
||||
- Fixed an inexcusable bug and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.28 2004/AUG/07
|
||||
========================
|
||||
- Fixed a bug that disables RX after TX in the RTTY mode
|
||||
- Added the sound play back option
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.27 2004/AUG/03
|
||||
========================
|
||||
- Improved mfsk decoder (synchronization, AFC, processing speed, etc.)
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.26 2004/JUL/31
|
||||
========================
|
||||
- Added mfsk mode
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.25 2004/JUL/27
|
||||
========================
|
||||
- Added Expansion Macro Buttons (View menu)
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.24 2004/JUL/22
|
||||
========================
|
||||
- Expanded the macro capability
|
||||
Added <%Menu=...> command
|
||||
Supported Kenwood and JST245 in <%RadioKHz=...> command
|
||||
Added <%RadioMode=...> command
|
||||
* For detailed information, refer to the pop-up menu and rig control sections in EMMVARI.TXT.
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.23 2004/JUL/19
|
||||
========================
|
||||
- Fixed a bug in the AFC detection level calculation
|
||||
- Added a macro for the rig frequency control
|
||||
* Three types of macros are now included
|
||||
<%RadioKHz=YAESU-HF,14073.000> FT1000MP, FT920, etc...
|
||||
<%RadioKHz=YAESU-VU,14073.000> FT847, FT736, etc...
|
||||
<%RadioKHz=CI-V,14073.000> ICOM
|
||||
Example: 500Hz up
|
||||
<%RadioKHz=YAESU-VU,<%RadioKHz>+0.5>
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
|
||||
========================
|
||||
BetaVer0.22 2004/JUL/14
|
||||
========================
|
||||
- Improved AFC
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.21 2004/JUN/29
|
||||
========================
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.20 2004/JUN/28
|
||||
========================
|
||||
- Added several functions to the spectrum right click operation
|
||||
- Improved the synchronizing scheme for the off-clock signals
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.19 2004/JUN/26
|
||||
========================
|
||||
- Added notch filter (right click on the spectrum scope window)
|
||||
- Improved BPF
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.18 2004/JUN/12
|
||||
========================
|
||||
- Added rtty mode
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.17 2004/JUN/04
|
||||
========================
|
||||
- Expanded the macro capability
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.16 2004/MAR/20
|
||||
========================
|
||||
- Added MMTTY/MMSSTV custom sound
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.15 2004/MAR/02
|
||||
========================
|
||||
- Made the color mapping of the waterfall user-customizable
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.14 2004/FEB/28
|
||||
========================
|
||||
- Added an automatic TX alphabet character conversion (from two-byte alphabet code to single-byte)
|
||||
- Added 22050, 44100, 48000Hz sound clock frequencies
|
||||
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.13 2004/FEB/22
|
||||
========================
|
||||
- Fixed a bug that disabled the Kana transmission in the VariSTD/JA mode
|
||||
- User can customize the background color of the RX window
|
||||
- Added a pop-up menu in response to the right click on the RX window
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.12 2004/FEB/18
|
||||
========================
|
||||
- Fixed an exposure happening on some PCs
|
||||
- Added the 6000Hz clock frequency support for the sound device
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.11 2004/FEB/15
|
||||
========================
|
||||
- Fixed an exposure happening on some PCs (?)
|
||||
- Expanded the macro capability
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.10 2004/FEB/12
|
||||
========================
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.09 2004/FEB/09
|
||||
========================
|
||||
- Added BPSK and bpsk mode
|
||||
BPSK - Not compatible with HALPSK or WINPSK/J (TX is inhibited on VariJA)
|
||||
bpsk - Conventional standard varicode compatible with HALPSK and WINPSK/J (BPSK/bpsk have not been tested yet)
|
||||
- Added amplitude monitor windows for the debug of BPSK modulation. Right click on the Sync button to activate it.
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.08 2004/FEB/04
|
||||
========================
|
||||
- Improved the TX window editing
|
||||
- Expanded the macro capability
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.07 2004/JAN/27
|
||||
========================
|
||||
- Fixed a bug of the PTT control in RadioCommand
|
||||
- Added FSK modulation (fm=1.0) for V/UHF to accommodate the rig frequency drift
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.06 2004/JAN/23
|
||||
========================
|
||||
- Added q tool for calibrating the soundcard
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.05 2004/JAN/21
|
||||
========================
|
||||
- Added English menu and messages (Tnx Kim HL3IB and Sung HL1AQ)
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer0.04 2004/JAN/19
|
||||
========================
|
||||
- Included EProject.txt in the MMVARI package(Tnx JA7UDE)
|
||||
- Fixed a couple of bugs and applied some improvements
|
||||
|
||||
========================
|
||||
BetaVer 0.03 2004/JAN/15
|
||||
========================
|
||||
- Changed the program name from MMGMSK to MMVARI (the modulation is subject
|
||||
to change)
|
||||
- Changed the index mapping for Japanese font ($E040-$FEFF is remapped to
|
||||
$A040-$BEFF)
|
||||
- Added an option that allows the user to change TX and TXOFF keys.
|
||||
- Fixed some bugs and applied minor improvements.
|
||||
|
||||
========================
|
||||
BetaVer0.02
|
||||
========================
|
||||
- Added sound record and replay functions.
|
||||
- Added RadioCommand.
|
||||
- Added logging function.
|
||||
- Added the log linkage to TurboHamlog/Win.
|
||||
- Fixed some bugs.
|
||||
|
||||
========================
|
||||
BetaVer0.01 2004/JAN/09
|
||||
========================
|
||||
- Added AFC level control in the RX tab.
|
||||
- Added a character code in the Edit menu.
|
||||
- Added VARICODE table in the option menu
|
||||
|
||||
========================
|
||||
BetaVer0.00 2004/JAN/08
|
||||
========================
|
||||
- First beta released.
|
||||
1016
EMMVARI.TXT
Normal file
1016
EMMVARI.TXT
Normal file
File diff suppressed because it is too large
Load diff
232
EPROJECT.TXT
Normal file
232
EPROJECT.TXT
Normal file
|
|
@ -0,0 +1,232 @@
|
|||
MMVARI project
|
||||
January 2, 2004 JE3HHT Makoto Mori
|
||||
Translated into English by JA7UDE Nobuyuki Oba
|
||||
|
||||
[Preface]
|
||||
|
||||
I like having QSOs in Japanese simply because I am Japanese. Even in PSK31, I prefer using Japanese characters for domestic QSOs. As well known, PSK31 is a great means of communication, but I have been aware of an exposure in manipulating Japanese characters; more precisely, in manipulating Eastern Asia languages including Hangul and Chinese. The objective of this project is to give a solution to the exposure.
|
||||
|
||||
|
||||
[Character code and structure]
|
||||
|
||||
Eastern Asia languages, such as Japanese, Hangul, and Chinese, have many characters, which are impossible to be fit into the 8-bit code space. The current PSK31 implementation uses MultiByte Character Set (MBCS) to accommodate this requirement. To send one MBCS character, PSK31 sends two bytes, and thus it suffers from a couple of disadvantages below:
|
||||
|
||||
(1) Slow
|
||||
(2) Once the phase is unlocked, the output becomes unrecoverable garbage for a while.
|
||||
(3) Characters with different byte lengths are mixed. It makes the backspace operation confusing.
|
||||
|
||||
Let us see these problems one by one.
|
||||
|
||||
(1) It is true that Easter Asia languages have many characters, but this is not only the reason they are not suited for PSK31. The first byte of MBCS is assigned to the range between $81 and $FE. In addition, Hiragana, which appears in Japanese very frequently, is assigned to $9F-$F2. In PSK31's VARICODE, characters in those ranges are assigned to lengthy codes. To make matters worse, a GAP (00) is added between two VARICODE characters that represent one MBCS character. This results in 24 bits for one character. In fact, PSK31 QSO in Japanese is too slow to make smooth communication. It sometimes is slower than CW using Japanese characters.
|
||||
|
||||
(2) Even when only one character is missing in the path, the receiver often outputs a string of garbled characters because the receiver misunderstands the delimiting position of MBCS characters. The first byte and second byte of MBCS share some range of codes, so that the receiver cannot always distinguish whether the received code is the first or second byte only from the range the received byte belongs to. Fortunately, $A0-$DF are not used for the first byte in the Japanese code set, and therefore can be used for phase detection. However, Hangul and Chinese code sets use more number of character codes that are used in the first and second bytes.
|
||||
|
||||
(3) From the application perspective, one-byte and two-byte characters are seen mixed in the transmission. This makes the backspace (BS) operation confusing. Japanese compliant PSK31 programs, such as HALPSK and WINPSK/J, use a crafty trick to solve this problem, but it is not the best approach. The most effective solution is to increase the code space so that each character has a unique code. Theoretically, VARICODE used in PSK31 can have as many codes as desired.
|
||||
|
||||
To support only MBCS, the program has to handle the characters in $00-$FF and $8140-$FEFF, and does not have to handle characters outside of these ranges. The second byte of MBCS is equal to or greater than $40. In Japanese, there is no character assigned in $A040-$DFFF. In Hangul and Chinese, however, some characters are assigned in this range.
|
||||
|
||||
Someone may ask "how about UNICODE?" On UNICODE, a unique code is assigned to a character irrespective of the code set, but all the codes from $0000 to $FFFF must be handled. In real QSOs, we do not use Japanese and Chinese mixed. Hangul characters are assigned in the later portion of the UNICODE, and they tend to be longer in code bit length. UNICODE is not supported in all Windows. For these reasons, I dropped the UNICODE support.
|
||||
|
||||
How about JIS code? It does not take account of any languages other than Japanese, so it should not be suited for amateur radio communication.
|
||||
|
||||
To convert MBCS in $00-$FF and $8140-$FEFF to VARICODE, we need the continuous index values of $0000-$5F7F. VARICODE is based on a rule so that every code starts with bit 1 and ends with bit 1, and has no series of two or more 0s. According to this rule, the index can be defined in the table show below. With this assignment, we can use divide & conquer algorithm to convert the VARICODE to index.
|
||||
|
||||
Index VARICODE
|
||||
$0000 1
|
||||
$0001 11
|
||||
$0002 101
|
||||
$0003 111
|
||||
$0004 1011
|
||||
$0005 1101
|
||||
$0006 1111
|
||||
$0007 10101
|
||||
$0008 10111
|
||||
$0009 11011
|
||||
$000A 11101
|
||||
$000B 11111
|
||||
: :
|
||||
$00FF 101101011011
|
||||
: :
|
||||
$5F7F 110111111111101101101
|
||||
|
||||
Care should be taken that if the index is directly assigned to the code set, not frequently used characters are assigned to short codes, and would result in inefficient coding. ASCII characters in $0000-$007F are assigned to PSK31 codes by optimizing the code length with respect to the frequency in use of characters. Let us use the PSK31 code for this range ($0000-$0007F) for compatibility.
|
||||
|
||||
Well, let's see the frequency of Japanese characters from the MBCS viewpoint. The table below shows the frequency of the first byte in several documents I wrote.
|
||||
|
||||
$81 : 6.33% $89 : 0.95% $91 : 2.44% $99 : 0.00%
|
||||
$82 : 51.5% $8A : 1.68% $92 : 2.12% $9A : 0.00%
|
||||
$83 : 8.99% $8B : 0.54% $93 : 2.93% $9B : 0.00%
|
||||
$84 : 0.00% $8C : 1.79% $94 : 1.74% $9C : 0.00%
|
||||
$85 : 0.00% $8D : 2.66% $95 : 4.51% $9D : 0.00%
|
||||
$86 : 0.00% $8E : 3.75% $96 : 1.22% $9E : 0.00%
|
||||
$87 : 0.00% $8F : 1.47% $97 : 1.38% $9F : 0.00%
|
||||
$88 : 1.68% $90 : 2.04% $98 : 0.24%
|
||||
|
||||
$E0 : 0.00% $E8 : 0.00% $F0 : 0.00% $F8 : 0.00%
|
||||
$E1 : 0.00% $E9 : 0.00% $F1 : 0.00% $F9 : 0.00%
|
||||
$E2 : 0.00% $EA : 0.00% $F2 : 0.00% $FA : 0.00%
|
||||
$E3 : 0.00% $EB : 0.00% $F3 : 0.00% $FB : 0.00%
|
||||
$E4 : 0.00% $EC : 0.00% $F4 : 0.00% $FC : 0.00%
|
||||
$E5 : 0.00% $ED : 0.00% $F5 : 0.00% $FD : 0.00%
|
||||
$E6 : 0.00% $EE : 0.00% $F6 : 0.00% $FE : 0.00%
|
||||
$E7 : 0.00% $EF : 0.00% $F7 : 0.00%
|
||||
|
||||
The table shows that the former part of the codes has larger frequency values. The latter part, which is mapped to complicated Kanji characters, has smaller frequency values. Let's get in more details. $82 has significantly high frequency, that is, over 50%. This is the code for Japanese Hiragana. Spoken Japanese language is said to be having over 70% Hiragana. This implies that assigning short codes to Hiragana improves the communication efficiency. In amateur radio conversation, Katakana is also often being used, and it is a good idea to assign short code to them as well as Hiragana.
|
||||
|
||||
In MBCS, Hiragana is defined in the range of $829F-$82F2, which correspond to $021F-$0272 in the index. If this range is directly mapped to VARICODE, the bit length of each code becomes 15 to 16 bits including GAP. However, if it is mapped to $0080-$00D3, the bit length is shortened to 12 or 13 bits. Katakana is mapped to $0280-$02D6 in the index ($8340-$8396 in MBCS), so let us assign Katakana to $00D4-$012A.
|
||||
|
||||
Another point we must consider in the code mapping is the effect to MBCS languages other than Japanese. My quick research shows that $0081-$00FE has no characters assigned (defined as the first byte), and therefore this range should cause no problem. Characters in $0100-$012A are defined in Hangul and Chinese, but I do not know the frequency of them. In addition, non-MBCS language other than English might have characters assigned to this range. For these regions, it is a good idea to perform this translation by referring to the font set in the receiving side. In addition, since the translation scheme must be changed according to font sets, let Japanese characters in range $E040-$FEFF be translated into $A040-$BEFF, which has no Japanese characters assigned. The frequency of characters in this range is not so high, but this translation gives slightly better coding efficiency. In the index, $4840-$5F7F is translated into $1840-$2F7F.
|
||||
|
||||
|
||||
Let us summarize the translation and mapping scheme here.
|
||||
|
||||
$0000-$007F Same as PSK31 translation
|
||||
$0080-$00D3 Translated to $021F-$0272 if Japanese font set
|
||||
$00D4-$012A Translated to $0280-$02D6 if Japanese font set
|
||||
$012B-$021E No translation, as is.
|
||||
$021F-$0272 Translated to $0080-$00D3 if Japanese font set
|
||||
$0273-$027F No translation, as is.
|
||||
$0280-$02D6 Translated to $00D4-$012A if Japanese font set
|
||||
$02D7-$183F No translation, as is.
|
||||
$1840-$2F7F Translated to $4840-$5F7F if Japanese font set
|
||||
$2F80-$483F No translation, as is.
|
||||
$4840-$5F7F Translated to $1840-$2F7F if Japanese font set
|
||||
|
||||
For instance, the longest code made by using this translation scheme is
|
||||
$5F7F 110111111111101101101 (21Bits)
|
||||
The last Japanese Character is
|
||||
$2F7F 10110101111111101111 (20Bits)
|
||||
|
||||
|
||||
|
||||
[Modulation]
|
||||
|
||||
In Japan, all the PSK31 QSOs using Japanese characters concatenates two VARICODEs to send one MBCS character. If the VARICODE shown above is used, the compatibility with existing PSK31 programs will be lost.
|
||||
|
||||
For this reason, I have decided not to use PSK31, but to make use of GMSK (BT=1.0) as an experimental modulation. GMSK is a sort of FSK, but it also is a brother of PSK in a sense. The sound of GMSK is similar to that of PSK31, but has different spectrum, with which the user can distinguish between them. Theoretically, GMSK have no amplitude component, and therefore does not require the linearity of the transmitter (isn't this FB?).
|
||||
|
||||
Like PSK31, MMVARI sends 0 by reverting the symbol and 1 by keeping the symbol. With this coding, the user does not have to take care of USB/LSB heterodyne. The detail of GMSK is beyond scope of this project. Please refer to other books.
|
||||
|
||||
|
||||
[Experimental program]
|
||||
|
||||
I made a PC soundcard program, MMVARI, to implement the proposed scheme. Since the objective of this project is new VARICODE experimentation, MMVARI are:
|
||||
|
||||
1) Implementing only basic functions for standard QSO.
|
||||
2) Providing Japanese menu only, but can be used in any MBCS languages. Non-MBCS languages, such as English, are out of scope of this project.
|
||||
|
||||
I would like to see the feasibility first, and after then improve the engine and cosmetics.
|
||||
|
||||
|
||||
[Appendix]
|
||||
|
||||
An example C code for the index translation
|
||||
|
||||
static int SwapHiragana(int index)
|
||||
{
|
||||
if( index <= 0x00d3 ){ // $80-$D3
|
||||
index += 0x21f - 0x0080; // $80-$D3 to Hiragana
|
||||
}
|
||||
else if( index <= 0x12a ){ // $D4-$12A
|
||||
index += 0x280 - 0x00d4; // $D4-$12A to Katakana
|
||||
}
|
||||
else if( (index >= 0x021f) && (index <= 0x0272) ){ // Hiragana
|
||||
index -= 0x21f - 0x0080; // Hiragana to $80-$D3
|
||||
}
|
||||
else if( (index >= 0x0280) && (index <= 0x02d6) ){ // Katakana
|
||||
index -= 0x280 - 0x00d4; // Katakana to $D4-$12A
|
||||
}
|
||||
else if( (index >= 0x1840) && (index <= 0x2f7f) ){
|
||||
index += 0x4840 - 0x1840;
|
||||
}
|
||||
else if( (index >= 0x4840) && (index <= 0x5f7f) ){
|
||||
index -= 0x4840 - 0x1840;
|
||||
}
|
||||
}
|
||||
|
||||
UINT Index2Mbc(int index, BOOL fJA)
|
||||
{
|
||||
const BYTE _tIndex2Ascii[]={
|
||||
0x20,0x65,0x74,0x6F,0x61,0x69,0x6E,0x72, /*00*/
|
||||
0x73,0x6C,0x0A,0x0D,0x68,0x64,0x63,0x2D, /*08*/
|
||||
0x75,0x6D,0x66,0x70,0x3D,0x2E,0x67,0x79, /*10*/
|
||||
0x62,0x77,0x54,0x53,0x2C,0x45,0x76,0x41, /*18*/
|
||||
0x49,0x4F,0x43,0x52,0x44,0x30,0x4D,0x31, /*20*/
|
||||
0x6B,0x50,0x4C,0x46,0x4E,0x78,0x42,0x32, /*28*/
|
||||
0x09,0x3A,0x29,0x28,0x47,0x33,0x48,0x55, /*30*/
|
||||
0x35,0x57,0x22,0x36,0x5F,0x2A,0x58,0x34, /*38*/
|
||||
0x59,0x4B,0x27,0x38,0x37,0x2F,0x56,0x39, /*40*/
|
||||
0x7C,0x3B,0x71,0x7A,0x3E,0x24,0x51,0x2B, /*48*/
|
||||
0x6A,0x3C,0x5C,0x23,0x5B,0x5D,0x4A,0x21, /*50*/
|
||||
0x00,0x5A,0x3F,0x7D,0x7B,0x26,0x40,0x5E, /*58*/
|
||||
0x25,0x7E,0x01,0x0C,0x60,0x04,0x02,0x06, /*60*/
|
||||
0x11,0x10,0x1E,0x07,0x08,0x1B,0x17,0x14, /*68*/
|
||||
0x1C,0x05,0x15,0x16,0x0B,0x0E,0x03,0x18, /*70*/
|
||||
0x19,0x1F,0x0F,0x12,0x13,0x7F,0x1A,0x1D, /*78*/
|
||||
};
|
||||
|
||||
if( index <= 0x007f ){
|
||||
index = _tIndex2Ascii[index];
|
||||
}
|
||||
else if( fJA ){
|
||||
index = SwapHiragana(index);
|
||||
}
|
||||
|
||||
UINT mbc;
|
||||
int m, b;
|
||||
if( index >= 0x0100 ){
|
||||
index -= 0x0100;
|
||||
m = index % 192;
|
||||
b = index / 192;
|
||||
mbc = 0x8140 + m + (b * 256);
|
||||
}
|
||||
else {
|
||||
mbc = index;
|
||||
}
|
||||
return mbc;
|
||||
}
|
||||
|
||||
int Mbc2Index(UINT mbc, BOOL fJA)
|
||||
{
|
||||
const BYTE _tAscii2Index[]={
|
||||
0x58,0x62,0x66,0x76,0x65,0x71,0x67,0x6B, /*00*/
|
||||
0x6C,0x30,0x0A,0x74,0x63,0x0B,0x75,0x7A, /*08*/
|
||||
0x69,0x68,0x7B,0x7C,0x6F,0x72,0x73,0x6E, /*10*/
|
||||
0x77,0x78,0x7E,0x6D,0x70,0x7F,0x6A,0x79, /*18*/
|
||||
0x00,0x57,0x3A,0x53,0x4D,0x60,0x5D,0x42, /*20*/
|
||||
0x33,0x32,0x3D,0x4F,0x1C,0x0F,0x15,0x45, /*28*/
|
||||
0x25,0x27,0x2F,0x35,0x3F,0x38,0x3B,0x44, /*30*/
|
||||
0x43,0x47,0x31,0x49,0x51,0x14,0x4C,0x5A, /*38*/
|
||||
0x5E,0x1F,0x2E,0x22,0x24,0x1D,0x2B,0x34, /*40*/
|
||||
0x36,0x20,0x56,0x41,0x2A,0x26,0x2C,0x21, /*48*/
|
||||
0x29,0x4E,0x23,0x1B,0x1A,0x37,0x46,0x39, /*50*/
|
||||
0x3E,0x40,0x59,0x54,0x52,0x55,0x5F,0x3C, /*58*/
|
||||
0x64,0x04,0x18,0x0E,0x0D,0x01,0x12,0x16, /*60*/
|
||||
0x0C,0x05,0x50,0x28,0x09,0x11,0x06,0x03, /*68*/
|
||||
0x13,0x4A,0x07,0x08,0x02,0x10,0x1E,0x19, /*70*/
|
||||
0x2D,0x17,0x4B,0x5C,0x48,0x5B,0x61,0x7D, /*78*/
|
||||
};
|
||||
int index, m, b;
|
||||
if( mbc >= 0x8100 ){
|
||||
if( (mbc & 0x00ff) >= 0x0040 ){
|
||||
mbc -= 0x8100;
|
||||
m = mbc % 256;
|
||||
b = mbc / 256;
|
||||
index = 0x100 - 0x40 + m + (b * 192);
|
||||
}
|
||||
else {
|
||||
return -1; /* error */
|
||||
}
|
||||
}
|
||||
else {
|
||||
index = mbc;
|
||||
}
|
||||
if( index <= 0x007f ){
|
||||
index = _tAscii2Index[index];
|
||||
}
|
||||
else if( fJA ){
|
||||
index = SwapHiragana(index);
|
||||
}
|
||||
return index;
|
||||
}
|
||||
|
||||
308
FEdit.cpp
Normal file
308
FEdit.cpp
Normal file
|
|
@ -0,0 +1,308 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
#include <vcl.h>
|
||||
#pragma hdrstop
|
||||
|
||||
#include "FEdit.h"
|
||||
#include "ComLib.h"
|
||||
#include "Main.h"
|
||||
//---------------------------------------------------------------------------
|
||||
#pragma package(smart_init)
|
||||
#pragma resource "*.dfm"
|
||||
//TFileEdit *FileEdit;
|
||||
//---------------------------------------------------------------------------
|
||||
__fastcall TFileEdit::TFileEdit(TComponent* Owner)
|
||||
: TForm(Owner)
|
||||
{
|
||||
m_hWnd = NULL;
|
||||
m_uMsg = 0;
|
||||
m_FileName = "";
|
||||
REdit->Font->Pitch = fpFixed;
|
||||
if( sys.m_MsgEng ){
|
||||
REdit->Font->Name = "Courier New";
|
||||
REdit->Font->Charset = ANSI_CHARSET;
|
||||
}
|
||||
else {
|
||||
REdit->Font->Name = "MS ゴシック";
|
||||
REdit->Font->Charset = SHIFTJIS_CHARSET;
|
||||
|
||||
KF->Caption = "ファイル(&F)";
|
||||
KFN->Caption = "メモ帳に切り替え(&N)";
|
||||
KFX->Caption = "終了(&X)";
|
||||
KE->Caption = "編集(&E)";
|
||||
KFA->Caption = "名前を付けて保存(&A)...";
|
||||
KEU->Caption = "元に戻す(&U)";
|
||||
KEC->Caption = "切り取り(&T)";
|
||||
KECP->Caption = "コピー(&C)";
|
||||
KEP->Caption = "貼り付け(&P)";
|
||||
KEA->Caption = "すべて選択(&L)";
|
||||
KS->Caption = "検索(&S)";
|
||||
KSS->Caption = "検索(&F)...";
|
||||
KSN->Caption = "次を検索(&N)";
|
||||
}
|
||||
for( int i = 0; i < KE->Count; i++ ){
|
||||
TMenuItem *pMenu = new TMenuItem(this);
|
||||
pMenu->Caption = KE->Items[i]->Caption;
|
||||
pMenu->OnClick = KE->Items[i]->OnClick;
|
||||
PopupMenu->Items->Add(pMenu);
|
||||
}
|
||||
m_fDelFile = FALSE;
|
||||
m_InitFirst = TRUE;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TFileEdit::Execute(LPCSTR pName, BOOL fReadOnly)
|
||||
{
|
||||
DWORD dw = ::GetFileAttributes(pName);
|
||||
if( (dw != 0xffffffff) && (dw & FILE_ATTRIBUTE_READONLY) ){
|
||||
fReadOnly = TRUE;
|
||||
}
|
||||
REdit->ReadOnly = fReadOnly;
|
||||
AnsiString as = pName;
|
||||
if( fReadOnly ) as += sys.m_MsgEng ? " (Read only)" : " (読み取り専用)";
|
||||
Caption = as;
|
||||
CWaitCursor tw;
|
||||
m_FileName = pName;
|
||||
OnWave();
|
||||
try {
|
||||
REdit->Lines->LoadFromFile(pName);
|
||||
}
|
||||
catch(...){
|
||||
FILE *fp;
|
||||
if( (fp = fopen(pName, "rt")) != NULL ){
|
||||
OnWave();
|
||||
char bf[2048];
|
||||
REdit->Lines->Clear();
|
||||
while(!feof(fp)){
|
||||
if( fgets(bf, sizeof(bf), fp) ){
|
||||
ClipLF(bf);
|
||||
REdit->Lines->Add(bf);
|
||||
}
|
||||
}
|
||||
fclose(fp);
|
||||
REdit->ReadOnly = TRUE;
|
||||
}
|
||||
else {
|
||||
ErrorMB(sys.m_MsgEng ? "Sorry, could not open <%s>...":"<%s>をオープンできませんでした", pName);
|
||||
Close();
|
||||
return;
|
||||
}
|
||||
}
|
||||
if( m_fDelFile ){
|
||||
m_fDelFile = FALSE;
|
||||
unlink(pName);
|
||||
}
|
||||
REdit->Modified = FALSE;
|
||||
m_InitFirst = FALSE;
|
||||
OnWave();
|
||||
AdjustTop();
|
||||
Show();
|
||||
if( !::IsWindowEnabled(Handle) ) ::EnableWindow(Handle, TRUE);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TFileEdit::Execute(AnsiString &as, LPCSTR pTitle, LPCSTR pName)
|
||||
{
|
||||
Caption = pTitle;
|
||||
m_FileName = pName;
|
||||
CWaitCursor tw;
|
||||
REdit->Text = as;
|
||||
REdit->ReadOnly = FALSE;
|
||||
REdit->Modified = FALSE;
|
||||
m_InitFirst = TRUE;
|
||||
OnWave();
|
||||
Show();
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
void __fastcall TFileEdit::FormCloseQuery(TObject *Sender, bool &CanClose)
|
||||
{
|
||||
if( REdit->Modified ){
|
||||
int r = YesNoCancelMB(sys.m_MsgEng ? "Overwrite to the file (%s) ?" : "ファイル (%s) に上書きしますか?", m_FileName.c_str());
|
||||
switch(r){
|
||||
case IDYES:
|
||||
{
|
||||
CWaitCursor w;
|
||||
REdit->Lines->SaveToFile(m_FileName);
|
||||
}
|
||||
break;
|
||||
case IDCANCEL:
|
||||
CanClose = FALSE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
CanClose = TRUE;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TFileEdit::KECClick(TObject *Sender)
|
||||
{
|
||||
REdit->CutToClipboard();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TFileEdit::KECPClick(TObject *Sender)
|
||||
{
|
||||
REdit->CopyToClipboard();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TFileEdit::KEPClick(TObject *Sender)
|
||||
{
|
||||
REdit->PasteFromClipboard();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TFileEdit::KEUClick(TObject *Sender)
|
||||
{
|
||||
if( REdit->HandleAllocated() ){
|
||||
SendMessage(REdit->Handle, EM_UNDO, 0, 0);
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TFileEdit::KEAClick(TObject *Sender)
|
||||
{
|
||||
REdit->SelectAll();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TFileEdit::KEClick(TObject *Sender)
|
||||
{
|
||||
BOOL f = !REdit->ReadOnly;
|
||||
KEU->Enabled = f && REdit->Modified;
|
||||
KECP->Enabled = REdit->SelLength;
|
||||
KEC->Enabled = f && KECP->Enabled;
|
||||
KEP->Enabled = f && ::IsClipboardFormatAvailable(CF_TEXT);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TFileEdit::KFAClick(TObject *Sender)
|
||||
{
|
||||
AnsiString FileName = m_FileName.c_str();
|
||||
SetEXT(FileName.c_str(), "");
|
||||
LPCSTR pEXT = GetEXT(m_FileName.c_str());
|
||||
SaveDialog->FileName = FileName;
|
||||
SaveDialog->DefaultExt = pEXT;
|
||||
if( SaveDialog->Execute() ) {
|
||||
// Options + OverwritePrompt = True thus no need to check.
|
||||
REdit->Lines->SaveToFile(SaveDialog->FileName);
|
||||
m_FileName = SaveDialog->FileName;
|
||||
REdit->Modified = FALSE;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TFileEdit::KFXClick(TObject *Sender)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TFileEdit::PopupMenuPopup(TObject *Sender)
|
||||
{
|
||||
KEClick(NULL);
|
||||
for( int i = 0; i < PopupMenu->Items->Count; i++ ){
|
||||
PopupMenu->Items->Items[i]->Enabled = KE->Items[i]->Enabled;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TFileEdit::KSSClick(TObject *Sender)
|
||||
{
|
||||
FindDialog->Execute();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TFileEdit::FindDialogFind(TObject *Sender)
|
||||
{
|
||||
int FoundAt, StartPos, ToEnd;
|
||||
// 検索は現在選択されている場所から開始される
|
||||
// 何も選択されていない場合は,
|
||||
// テキストの最初から開始される
|
||||
if(REdit->SelLength){
|
||||
StartPos = REdit->SelStart + REdit->SelLength;
|
||||
}
|
||||
else {
|
||||
StartPos = 0;
|
||||
}
|
||||
// ToEnd は検索範囲の文字数を示す
|
||||
ToEnd = REdit->Text.Length() - StartPos;
|
||||
|
||||
|
||||
TSearchTypes stype;
|
||||
if( FindDialog->Options.Contains(frMatchCase) ) stype << stMatchCase;
|
||||
if( FindDialog->Options.Contains(frWholeWord) ) stype << stWholeWord;
|
||||
FoundAt = REdit->FindText(FindDialog->FindText, StartPos, ToEnd, stype);
|
||||
if( FoundAt != -1 ){
|
||||
REdit->SetFocus();
|
||||
REdit->SelStart = FoundAt;
|
||||
REdit->SelLength = FindDialog->FindText.Length();
|
||||
keybd_event(VK_RIGHT, 0, 0, 0);
|
||||
keybd_event(VK_RIGHT, 0, KEYEVENTF_KEYUP, 0);
|
||||
Application->ProcessMessages();
|
||||
REdit->SelStart = FoundAt;
|
||||
REdit->SelLength = FindDialog->FindText.Length();
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TFileEdit::KSClick(TObject *Sender)
|
||||
{
|
||||
KSN->Enabled = !FindDialog->FindText.IsEmpty();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TFileEdit::KFNClick(TObject *Sender)
|
||||
{
|
||||
CWaitCursor w;
|
||||
REdit->Lines->SaveToFile(m_FileName);
|
||||
REdit->Modified = FALSE;
|
||||
|
||||
Close();
|
||||
|
||||
char bf[256];
|
||||
sprintf(bf, "NOTEPAD %s", m_FileName.c_str());
|
||||
WinExec(bf, SW_SHOWDEFAULT);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TFileEdit::FormClose(TObject *Sender, TCloseAction &Action)
|
||||
{
|
||||
if( (Action == caHide) && m_hWnd && m_uMsg && m_wParam){
|
||||
::PostMessage(m_hWnd, m_uMsg, m_wParam, DWORD(this));
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TFileEdit::SetEvent(HWND hWnd, UINT uMsg, DWORD wParam)
|
||||
{
|
||||
m_hWnd = hWnd;
|
||||
m_uMsg = uMsg;
|
||||
m_wParam = wParam;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TFileEdit::FormPaint(TObject *Sender)
|
||||
{
|
||||
if( m_InitFirst ){
|
||||
m_InitFirst = FALSE;
|
||||
const short _tt[]={
|
||||
VK_CONTROL, VK_END, VK_END|0x8000, VK_CONTROL|0x8000,
|
||||
0
|
||||
};
|
||||
KeyEvent(_tt);
|
||||
AdjustTop();
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TFileEdit::AdjustTop(void)
|
||||
{
|
||||
int ot = MainVARI->GetOverlayTop();
|
||||
if( ot > Top ){
|
||||
Top = ot;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
102
FEdit.h
Normal file
102
FEdit.h
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
#ifndef FEditH
|
||||
#define FEditH
|
||||
//---------------------------------------------------------------------------
|
||||
#include <Classes.hpp>
|
||||
#include <Controls.hpp>
|
||||
#include <StdCtrls.hpp>
|
||||
#include <Forms.hpp>
|
||||
#include <ComCtrls.hpp>
|
||||
#include <Menus.hpp>
|
||||
#include <Dialogs.hpp>
|
||||
//---------------------------------------------------------------------------
|
||||
enum TFontPitch { fpDefault, fpVariable, fpFixed }; //ja7ude 0522
|
||||
//---------------------------------------------------------------------------
|
||||
class TFileEdit : public TForm
|
||||
{
|
||||
__published: // IDE 管理のコンポーネント
|
||||
TRichEdit *REdit;
|
||||
TMainMenu *MainMenu1;
|
||||
TMenuItem *KF;
|
||||
TMenuItem *KE;
|
||||
TMenuItem *KFA;
|
||||
TMenuItem *KEC;
|
||||
TMenuItem *KECP;
|
||||
TMenuItem *KEP;
|
||||
TSaveDialog *SaveDialog;
|
||||
TMenuItem *N1;
|
||||
TMenuItem *KEU;
|
||||
TMenuItem *N2;
|
||||
TMenuItem *KEA;
|
||||
TMenuItem *N3;
|
||||
TMenuItem *KFX;
|
||||
TPopupMenu *PopupMenu;
|
||||
TFindDialog *FindDialog;
|
||||
TMenuItem *KS;
|
||||
TMenuItem *KSS;
|
||||
TMenuItem *KSN;
|
||||
TMenuItem *KFN;
|
||||
void __fastcall FormCloseQuery(TObject *Sender, bool &CanClose);
|
||||
|
||||
void __fastcall KECClick(TObject *Sender);
|
||||
void __fastcall KECPClick(TObject *Sender);
|
||||
void __fastcall KEPClick(TObject *Sender);
|
||||
void __fastcall KFAClick(TObject *Sender);
|
||||
void __fastcall KEUClick(TObject *Sender);
|
||||
void __fastcall KEAClick(TObject *Sender);
|
||||
|
||||
void __fastcall KEClick(TObject *Sender);
|
||||
void __fastcall KFXClick(TObject *Sender);
|
||||
void __fastcall PopupMenuPopup(TObject *Sender);
|
||||
|
||||
void __fastcall KSSClick(TObject *Sender);
|
||||
void __fastcall FindDialogFind(TObject *Sender);
|
||||
void __fastcall KSClick(TObject *Sender);
|
||||
void __fastcall KFNClick(TObject *Sender);
|
||||
void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
|
||||
void __fastcall FormPaint(TObject *Sender);
|
||||
|
||||
private: // ユーザー宣言
|
||||
BOOL m_InitFirst;
|
||||
AnsiString m_FileName;
|
||||
HWND m_hWnd;
|
||||
UINT m_uMsg;
|
||||
DWORD m_wParam;
|
||||
BOOL m_fDelFile;
|
||||
private:
|
||||
void __fastcall AdjustTop(void);
|
||||
|
||||
public: // ユーザー宣言
|
||||
__fastcall TFileEdit(TComponent* Owner);
|
||||
void __fastcall SetEvent(HWND hWnd, UINT uMsg, DWORD wParam);
|
||||
void __fastcall Execute(LPCSTR pName, BOOL fReadOnly);
|
||||
void __fastcall Execute(AnsiString &as, LPCSTR pTitle, LPCSTR pName);
|
||||
|
||||
inline void __fastcall SetWordWrap(BOOL ww){REdit->WordWrap = ww;};
|
||||
inline void __fastcall SetDelFile(BOOL fDel){m_fDelFile = fDel;};
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
//extern PACKAGE TFileEdit *FileEdit;
|
||||
//---------------------------------------------------------------------------
|
||||
//---------------------------------------------------------------------------
|
||||
#endif
|
||||
|
||||
BIN
FSK8250/App.ico
Normal file
BIN
FSK8250/App.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 318 B |
457
FSK8250/Main.cpp
Normal file
457
FSK8250/Main.cpp
Normal file
|
|
@ -0,0 +1,457 @@
|
|||
//---------------------------------------------------------------------------
|
||||
#include <vcl.h>
|
||||
#pragma hdrstop
|
||||
|
||||
#include "Main.h"
|
||||
SYS sys;
|
||||
//---------------------------------------------------------------------------
|
||||
#pragma package(smart_init)
|
||||
#pragma resource "*.dfm"
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall 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(), MAX_PATH-1);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall SetEXT(LPSTR t, LPCSTR pExt)
|
||||
{
|
||||
LPSTR p = LASTP(t);
|
||||
for( ; p > t; p-- ){
|
||||
if( *p == '.' ){
|
||||
p++;
|
||||
strcpy(p, pExt);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
//***************************************************************************
|
||||
// TExtFSK (MainWindow) class
|
||||
//---------------------------------------------------------------------------
|
||||
__fastcall TComFSK::TComFSK(TComponent* Owner)
|
||||
: TForm(Owner)
|
||||
{
|
||||
m_DisEvent = 1;
|
||||
m_Left = 0;
|
||||
m_Top = 0;
|
||||
m_hPort = INVALID_HANDLE_VALUE;
|
||||
m_X = 0;
|
||||
m_Para = 45 << 16;
|
||||
|
||||
m_fMsg = TRUE;
|
||||
m_fCheckError = FALSE;
|
||||
m_fLimitSpeed = FALSE;
|
||||
m_LimitMargin = 3;
|
||||
|
||||
m_strIniName = sys.m_ModuleName;
|
||||
SetEXT(m_strIniName.c_str(), "ini");
|
||||
PortName->ItemIndex = 0;
|
||||
|
||||
char drive[_MAX_DRIVE];
|
||||
char dir[_MAX_DIR];
|
||||
char name[_MAX_FNAME];
|
||||
char ext[_MAX_EXT];
|
||||
|
||||
::_splitpath( sys.m_ModuleName, drive, dir, name, ext );
|
||||
strupr(name);
|
||||
AnsiString as = name;
|
||||
as += " "VERNO;
|
||||
Caption = as;
|
||||
|
||||
ReadIniFile();
|
||||
|
||||
CBERR->Checked = m_fCheckError;
|
||||
CBLMT->Checked = m_fLimitSpeed;
|
||||
|
||||
Left = m_Left;
|
||||
Top = m_Top;
|
||||
WindowState = TWindowState(m_WindowState);
|
||||
m_DisEvent = 0;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
// para: Upper16bits Speed(eg. 45)
|
||||
// Lower16bits b1-b0 Stop (0-1, 1-1.5, 2-2)
|
||||
// b5-b2 Length
|
||||
void __fastcall TComFSK::SetPara(LONG para)
|
||||
{
|
||||
m_Para = para;
|
||||
AnsiString as = int(para >> 16);
|
||||
as += " baud";
|
||||
LB->Caption = as;
|
||||
OpenPort();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TComFSK::FormClose(TObject *Sender, TCloseAction &Action)
|
||||
{
|
||||
m_WindowState = WindowState;
|
||||
if( m_WindowState == wsNormal ){
|
||||
m_Left = Left;
|
||||
m_Top = Top;
|
||||
}
|
||||
|
||||
if( IsOpen() && m_ptt ){
|
||||
SetPTT(FALSE, FALSE);
|
||||
}
|
||||
|
||||
ClosePort();
|
||||
WriteIniFile();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TComFSK::ReadIniFile(void)
|
||||
{
|
||||
TMemIniFile *pIniFile = new TMemIniFile(m_strIniName);
|
||||
|
||||
m_Top = pIniFile->ReadInteger("Window", "Top", m_Top);
|
||||
m_Left = pIniFile->ReadInteger("Window", "Left", m_Left);
|
||||
if( m_Top < 0 ) m_Top = 0;
|
||||
if( m_Left < 0 ) m_Left = 0;
|
||||
|
||||
m_WindowState = (TWindowState)pIniFile->ReadInteger("Window", "State", WindowState);
|
||||
|
||||
AnsiString as = pIniFile->ReadString("Settings", "Port", "COM1");
|
||||
int n = PortName->Items->IndexOf(as);
|
||||
if( n < 0 ){
|
||||
n = atoi(as.c_str());
|
||||
if( n < 0 ) n = 0;
|
||||
}
|
||||
PortName->ItemIndex = n;
|
||||
RGPTT->ItemIndex = pIniFile->ReadInteger("Settings", "PTT", RGPTT->ItemIndex);
|
||||
RGSTOP->ItemIndex = pIniFile->ReadInteger("Settings", "STOP", RGSTOP->ItemIndex);
|
||||
CBInvPTT->Checked = pIniFile->ReadInteger("Settings", "InvPTT", CBInvPTT->Checked);
|
||||
m_fCheckError = pIniFile->ReadInteger("Settings", "CheckError", m_fCheckError);
|
||||
m_fLimitSpeed = pIniFile->ReadInteger("Settings", "LimitSpeed", m_fLimitSpeed);
|
||||
m_LimitMargin = pIniFile->ReadInteger("Settings", "LimitMargin", m_LimitMargin);
|
||||
int ver = pIniFile->ReadInteger("Settings", "VER", 0);
|
||||
if( ver < VERINI ) RGSTOP->ItemIndex = 1;
|
||||
delete pIniFile;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TComFSK::WriteIniFile(void)
|
||||
{
|
||||
TMemIniFile *pIniFile = new TMemIniFile(m_strIniName);
|
||||
pIniFile->WriteInteger("Window", "Top", m_Top);
|
||||
pIniFile->WriteInteger("Window", "Left", m_Left);
|
||||
pIniFile->WriteInteger("Window", "State", WindowState);
|
||||
pIniFile->WriteInteger("Settings", "VER", VERINI);
|
||||
pIniFile->WriteString("Settings", "Port", PortName->Items->Strings[PortName->ItemIndex]);
|
||||
pIniFile->WriteInteger("Settings", "PTT", RGPTT->ItemIndex);
|
||||
pIniFile->WriteInteger("Settings", "InvPTT", CBInvPTT->Checked);
|
||||
pIniFile->WriteInteger("Settings", "STOP", RGSTOP->ItemIndex);
|
||||
pIniFile->WriteInteger("Settings", "CheckError", m_fCheckError);
|
||||
pIniFile->WriteInteger("Settings", "LimitSpeed", m_fLimitSpeed);
|
||||
pIniFile->WriteInteger("Settings", "LimitMargin", m_LimitMargin);
|
||||
pIniFile->UpdateFile();
|
||||
delete pIniFile;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TComFSK::UpdateComStat(void)
|
||||
{
|
||||
char bf[128];
|
||||
|
||||
wsprintf(bf, "Status:%s", m_hPort != INVALID_HANDLE_VALUE ? "OK" : "NG");
|
||||
LComStat->Color = m_hPort != INVALID_HANDLE_VALUE ? clBtnFace : clRed;
|
||||
LComStat->Caption = bf;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TComFSK::OpenPort(void)
|
||||
{
|
||||
ClosePort();
|
||||
OpenPort_();
|
||||
UpdateComStat();
|
||||
SetPTT(FALSE, FALSE);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
BOOL __fastcall TComFSK::OpenPort_(void)
|
||||
{
|
||||
AnsiString pname = PortName->Items->Strings[PortName->ItemIndex];
|
||||
|
||||
m_hPort = ::CreateFile( pname.c_str(),
|
||||
GENERIC_READ | GENERIC_WRITE,
|
||||
0, NULL,
|
||||
OPEN_EXISTING,
|
||||
FILE_ATTRIBUTE_NORMAL,
|
||||
NULL
|
||||
);
|
||||
if( m_hPort == INVALID_HANDLE_VALUE ){
|
||||
AnsiString as = "\\\\.\\";
|
||||
as += pname;
|
||||
m_hPort = ::CreateFile( as.c_str(),
|
||||
GENERIC_READ | GENERIC_WRITE,
|
||||
0, NULL,
|
||||
OPEN_EXISTING,
|
||||
FILE_ATTRIBUTE_NORMAL,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
if( m_hPort == INVALID_HANDLE_VALUE ) return FALSE;
|
||||
|
||||
if( ::SetupComm( m_hPort, DWORD(256), DWORD(2) ) == FALSE ){
|
||||
::CloseHandle(m_hPort);
|
||||
m_hPort = INVALID_HANDLE_VALUE;
|
||||
return FALSE;
|
||||
}
|
||||
::PurgeComm( m_hPort, PURGE_TXABORT | PURGE_RXABORT | PURGE_TXCLEAR | PURGE_RXCLEAR );
|
||||
|
||||
COMMTIMEOUTS TimeOut;
|
||||
|
||||
TimeOut.ReadIntervalTimeout = 0xffffffff;
|
||||
TimeOut.ReadTotalTimeoutMultiplier = 0;
|
||||
TimeOut.ReadTotalTimeoutConstant = 0;
|
||||
TimeOut.WriteTotalTimeoutMultiplier = 0;
|
||||
TimeOut.WriteTotalTimeoutConstant = 1000;
|
||||
if( !::SetCommTimeouts( m_hPort, &TimeOut ) ){
|
||||
::CloseHandle( m_hPort );
|
||||
m_hPort = INVALID_HANDLE_VALUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
::GetCommState( m_hPort, &m_dcb );
|
||||
m_dcb.fBinary = TRUE;
|
||||
m_dcb.BaudRate = m_Para >> 16; // BAUD
|
||||
m_dcb.ByteSize = 5; // 5 bits length
|
||||
m_dcb.StopBits = BYTE(RGSTOP->ItemIndex);
|
||||
m_dcb.Parity = NOPARITY;
|
||||
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 = RTS_CONTROL_DISABLE;
|
||||
m_dcb.fDtrControl = DTR_CONTROL_DISABLE;
|
||||
m_dcb.fTXContinueOnXoff = FALSE;
|
||||
m_dcb.XonLim = USHORT(256/4);
|
||||
m_dcb.XoffLim = USHORT(256*3/4);
|
||||
m_dcb.DCBlength = sizeof( DCB );
|
||||
|
||||
if( !::SetCommState( m_hPort, &m_dcb ) ){
|
||||
::CloseHandle( m_hPort );
|
||||
m_hPort = INVALID_HANDLE_VALUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if( !::SetCommMask( m_hPort, EV_RXFLAG ) ){
|
||||
::CloseHandle(m_hPort);
|
||||
m_hPort = INVALID_HANDLE_VALUE;
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TComFSK::ClosePort(void)
|
||||
{
|
||||
DeleteMMTimer();
|
||||
if( IsOpen() ){
|
||||
::CloseHandle(m_hPort);
|
||||
m_hPort = INVALID_HANDLE_VALUE;
|
||||
}
|
||||
UpdateComStat();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TComFSK::SetPort(int port, int sw)
|
||||
{
|
||||
switch(port){
|
||||
case ptTXD:
|
||||
::EscapeCommFunction(m_hPort, sw ? SETBREAK : CLRBREAK);
|
||||
break;
|
||||
case ptRTS:
|
||||
::EscapeCommFunction(m_hPort, sw ? SETRTS : CLRRTS);
|
||||
break;
|
||||
case ptDTR:
|
||||
::EscapeCommFunction(m_hPort, sw ? SETDTR : CLRDTR);
|
||||
break;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TComFSK::SetPTT(int sw, int msg)
|
||||
{
|
||||
m_ptt = sw;
|
||||
if( CBInvPTT->Checked ){
|
||||
sw = sw ? 0 : 1;
|
||||
}
|
||||
if( !m_ptt && m_ummTimerID ){
|
||||
DeleteMMTimer();
|
||||
}
|
||||
SetPort(RGPTT->ItemIndex ? ptDTR : ptRTS, sw);
|
||||
if( m_ptt ){
|
||||
m_dwPending = 0;
|
||||
}
|
||||
|
||||
m_X = 0;
|
||||
if( msg ){
|
||||
if( WindowState == wsMinimized) return;
|
||||
Memo->Lines->Add(m_ptt ? "PTT ON" : "PTT OFF");
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void CALLBACK mmTimeProc(UINT uID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2)
|
||||
{
|
||||
ASSERT(dwUser);
|
||||
|
||||
TComFSK *pComm = (TComFSK *)dwUser;
|
||||
if( uID != pComm->m_ummTimerID ) return;
|
||||
|
||||
pComm->DoTimer();
|
||||
}
|
||||
//-----------------------------------------------------------------
|
||||
void __fastcall TComFSK::DoTimer(void)
|
||||
{
|
||||
if( m_dwPending ){
|
||||
if( m_hPort != INVALID_HANDLE_VALUE ){
|
||||
::TransmitCommChar(m_hPort, BYTE(m_dwPending & 0x00ff));
|
||||
}
|
||||
m_dwPending = 0;
|
||||
}
|
||||
}
|
||||
//-----------------------------------------------------------------
|
||||
void __fastcall TComFSK::CreateMMTimer(void)
|
||||
{
|
||||
if( !m_fLimitSpeed ) return;
|
||||
|
||||
int baud = m_Para >> 16;
|
||||
if( baud <= 0 ) return;
|
||||
|
||||
m_ummTimerID = 0;
|
||||
if( ::timeGetDevCaps(&m_TimeCaps, sizeof(m_TimeCaps)) == TIMERR_NOERROR ){
|
||||
::timeBeginPeriod(m_TimeCaps.wPeriodMin);
|
||||
double dblSymTime = (14 + RGSTOP->ItemIndex) * 500.0 / double(baud);
|
||||
double dblLmtTime = dblSymTime + m_LimitMargin;
|
||||
int lmttime = int(dblLmtTime + 0.5);
|
||||
if( m_fMsg && (WindowState == wsNormal) ){
|
||||
char bf[64];
|
||||
wsprintf(bf, "S=%d.%02dms, T=%ums", int(dblSymTime), int(dblSymTime * 100.0) % 100, lmttime);
|
||||
Memo->Lines->Add(bf);
|
||||
}
|
||||
m_ummTimerID = ::timeSetEvent(lmttime, 0, mmTimeProc, DWORD(this), TIME_PERIODIC);
|
||||
}
|
||||
if( !m_ummTimerID ){
|
||||
if( m_fMsg ){
|
||||
Memo->Lines->Add("MM timer is not supported.");
|
||||
}
|
||||
}
|
||||
m_fMsg = FALSE;
|
||||
}
|
||||
//-----------------------------------------------------------------
|
||||
void __fastcall TComFSK::DeleteMMTimer(void)
|
||||
{
|
||||
if( m_ummTimerID ){
|
||||
::timeKillEvent(m_ummTimerID);
|
||||
m_ummTimerID = 0;
|
||||
::timeEndPeriod(m_TimeCaps.wPeriodMin);
|
||||
}
|
||||
}
|
||||
//-----------------------------------------------------------------
|
||||
// 送信ビジーかどうか調べる
|
||||
int __fastcall TComFSK::IsBusy(void)
|
||||
{
|
||||
if( m_ummTimerID ){
|
||||
return m_dwPending ? 1 : 0;
|
||||
}
|
||||
if( IsOpen() ){
|
||||
if( m_dwPending ){
|
||||
if( TransmitCommChar(m_hPort, BYTE(m_dwPending & 0x00ff)) ){
|
||||
m_dwPending = 0;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
if( m_fCheckError || m_fLimitSpeed ) return FALSE;
|
||||
if( !IsOpen() ) return FALSE;
|
||||
|
||||
COMSTAT ComStat;
|
||||
DWORD dwErrorFlags;
|
||||
|
||||
ClearCommError(m_hPort, &dwErrorFlags, &ComStat);
|
||||
return ComStat.fTxim;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TComFSK::PutChar(BYTE c)
|
||||
{
|
||||
if( !m_ptt ) return;
|
||||
|
||||
if( m_fLimitSpeed && !m_ummTimerID ) CreateMMTimer();
|
||||
|
||||
if( m_ummTimerID ){
|
||||
m_dwPending = c | 0x8000;
|
||||
}
|
||||
else if( IsOpen() ){
|
||||
if( !TransmitCommChar(m_hPort, c) ){
|
||||
if( m_fCheckError ){
|
||||
m_dwPending = c | 0x8000;
|
||||
}
|
||||
}
|
||||
}
|
||||
if( WindowState == wsMinimized) return;
|
||||
|
||||
char bf[128];
|
||||
if( m_X ){
|
||||
int n = Memo->Lines->Count;
|
||||
if( n ) n--;
|
||||
strcpy(bf, AnsiString(Memo->Lines->Strings[n]).c_str());
|
||||
wsprintf(&bf[strlen(bf)], " %02X", c);
|
||||
if( !m_ptt ) return;
|
||||
Memo->Lines->Strings[n] = bf;
|
||||
}
|
||||
else {
|
||||
wsprintf(bf, "%02X", c);
|
||||
Memo->Lines->Add(bf);
|
||||
}
|
||||
m_X++;
|
||||
if( m_X >= 8 ) m_X = 0;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TComFSK::PortNameChange(TObject *Sender)
|
||||
{
|
||||
if( m_DisEvent ) return;
|
||||
|
||||
OpenPort();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TComFSK::SBMinClick(TObject *Sender)
|
||||
{
|
||||
if( m_DisEvent ) return;
|
||||
|
||||
if( WindowState == wsNormal ){
|
||||
m_Left = Left;
|
||||
m_Top = Top;
|
||||
}
|
||||
|
||||
WindowState = wsMinimized;
|
||||
m_WindowState = wsMinimized;
|
||||
|
||||
Memo->Lines->Clear();
|
||||
m_X = 0;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TComFSK::CBInvPTTClick(TObject *Sender)
|
||||
{
|
||||
if( m_DisEvent ) return;
|
||||
SetPTT(m_ptt, FALSE);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TComFSK::CBERRClick(TObject *Sender)
|
||||
{
|
||||
m_fCheckError = CBERR->Checked;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TComFSK::CBLMTClick(TObject *Sender)
|
||||
{
|
||||
m_fLimitSpeed = CBLMT->Checked;
|
||||
if( m_ptt && m_fLimitSpeed ){
|
||||
CreateMMTimer();
|
||||
}
|
||||
else {
|
||||
DeleteMMTimer();
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
BIN
FSK8250/Main.dfm
Normal file
BIN
FSK8250/Main.dfm
Normal file
Binary file not shown.
113
FSK8250/Main.h
Normal file
113
FSK8250/Main.h
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
//---------------------------------------------------------------------------
|
||||
#ifndef MainH
|
||||
#define MainH
|
||||
//---------------------------------------------------------------------------
|
||||
#include <Classes.hpp>
|
||||
#include <Controls.hpp>
|
||||
#include <StdCtrls.hpp>
|
||||
#include <Forms.hpp>
|
||||
#include <ExtCtrls.hpp>
|
||||
#include <Buttons.hpp>
|
||||
#include <Inifiles.hpp>
|
||||
#include <mmsystem.h>
|
||||
#include <stdlib.h>
|
||||
//---------------------------------------------------------------------------
|
||||
#define NDEBUG // Remove this symbol, if you would like to do debug
|
||||
#include <assert.h>
|
||||
#define ASSERT(c) assert(c)
|
||||
//---------------------------------------------------------------------------
|
||||
#define VERNO "1.04"
|
||||
#define VERINI 1
|
||||
//---------------------------------------------------------------------------
|
||||
template <class T> T LASTP(T p){
|
||||
int l = strlen(p);
|
||||
if( l ) p += (l-1);
|
||||
return p;
|
||||
};
|
||||
enum {
|
||||
ptTXD,
|
||||
ptRTS,
|
||||
ptDTR,
|
||||
};
|
||||
void __fastcall SetDirName(LPSTR t, LPCSTR pName);
|
||||
|
||||
typedef struct { // Should not put a class into the member
|
||||
DWORD m_dwVersion;
|
||||
int m_WinNT;
|
||||
char m_BgnDir[MAX_PATH];
|
||||
char m_ModuleName[MAX_PATH];
|
||||
}SYS;
|
||||
extern SYS sys;
|
||||
//---------------------------------------------------------------------------
|
||||
class TComFSK : public TForm
|
||||
{
|
||||
__published: // IDE
|
||||
TMemo *Memo;
|
||||
TLabel *L1;
|
||||
TComboBox *PortName;
|
||||
TLabel *LComStat;
|
||||
TRadioGroup *RGPTT;
|
||||
TCheckBox *CBInvPTT;
|
||||
TSpeedButton *SBMin;
|
||||
TLabel *LB;
|
||||
TRadioGroup *RGSTOP;
|
||||
TCheckBox *CBERR;
|
||||
TCheckBox *CBLMT;
|
||||
void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
|
||||
void __fastcall PortNameChange(TObject *Sender);
|
||||
|
||||
void __fastcall SBMinClick(TObject *Sender);
|
||||
void __fastcall CBInvPTTClick(TObject *Sender);
|
||||
|
||||
|
||||
|
||||
void __fastcall CBERRClick(TObject *Sender);
|
||||
void __fastcall CBLMTClick(TObject *Sender);
|
||||
private:
|
||||
int m_Left;
|
||||
int m_Top;
|
||||
int m_WindowState;
|
||||
int m_DisEvent;
|
||||
int m_ptt;
|
||||
int m_X;
|
||||
AnsiString m_strIniName;
|
||||
|
||||
LONG m_Para;
|
||||
HANDLE m_hPort;
|
||||
DCB m_dcb;
|
||||
|
||||
BOOL m_fCheckError;
|
||||
BOOL m_fLimitSpeed;
|
||||
int m_LimitMargin;
|
||||
|
||||
BOOL m_fBusy;
|
||||
DWORD m_dwPending;
|
||||
|
||||
BOOL m_fMsg;
|
||||
TIMECAPS m_TimeCaps;
|
||||
UINT m_ummTimerID;
|
||||
private:
|
||||
void __fastcall ReadIniFile(void);
|
||||
void __fastcall WriteIniFile(void);
|
||||
|
||||
inline int __fastcall IsOpen(void){ return m_hPort != INVALID_HANDLE_VALUE;};
|
||||
void __fastcall UpdateComStat(void);
|
||||
void __fastcall OpenPort(void);
|
||||
BOOL __fastcall OpenPort_(void);
|
||||
void __fastcall ClosePort(void);
|
||||
void __fastcall SetPort(int port, int sw);
|
||||
|
||||
public:
|
||||
__fastcall TComFSK(TComponent* Owner);
|
||||
void __fastcall SetPara(LONG para);
|
||||
void __fastcall SetPTT(int sw, int msg);
|
||||
int __fastcall IsBusy(void);
|
||||
void __fastcall PutChar(BYTE c);
|
||||
void __fastcall CreateMMTimer(void);
|
||||
void __fastcall DeleteMMTimer(void);
|
||||
void __fastcall DoTimer(void);
|
||||
|
||||
friend void CALLBACK mmTimeProc(UINT uID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2);
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
#endif
|
||||
57
FSK8250/api.txt
Normal file
57
FSK8250/api.txt
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
=========================================
|
||||
◎MMTTY, MMSSTV, MMVARIとのインターフェース
|
||||
=========================================
|
||||
EXTFSK.DLLは以下の5つのファンクションをエクスポートしなければなりません。
|
||||
|
||||
extern "C" LONG __declspec(dllexport) __stdcall extfskOpen(LONG para)
|
||||
extern "C" void __declspec(dllexport) __stdcall extfskClose(void)
|
||||
extern "C" LONG __declspec(dllexport) __stdcall extfskIsTxBusy(void)
|
||||
extern "C" void __declspec(dllexport) __stdcall extfskPutChar(BYTE c)
|
||||
extern "C" void __declspec(dllexport) __stdcall extfskSetPTT(LONG tx)
|
||||
|
||||
各ファンクションは、__stdcall呼び出し規約(ファンクション側でスタックを調整する)で記述され、エクスポートしている名前に修飾があってはいけません。ただし各ファンクションの名前はアンダスコア(_)が1つ付加していても構いません。MMTTYは例えばextfskOpenを探し、それに失敗すると、_extfskOpenを探します。
|
||||
|
||||
|
||||
LONG extfskOpen(LONG para)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
[引数]
|
||||
para:上位16ビット 速度(例:45)
|
||||
下位16ビット b1-b0 Stop (0-1, 1-1.5, 2-2)
|
||||
b5-b2 Length (5, 6, 7, 8)
|
||||
[戻値]
|
||||
TRUE - 成功, FALSE - 失敗
|
||||
[解説]
|
||||
ポートをオープンします。Stop2が指定されてもStop1.5でオープンして下さい。
|
||||
|
||||
付属のサンプルではパラメータは無視され常にBaud=45.45, Stop=1.5でオープンされます。
|
||||
|
||||
void extfskClose(void)
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
[解説]
|
||||
オープンしたポートをクローズします。
|
||||
|
||||
LONG extfskIsTxBusy(void)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
[戻値]
|
||||
TRUE - バッファがいっぱい, FALSE - バッファは空きがある
|
||||
[解説]
|
||||
送信バッファがいっぱいかどうかを返します。
|
||||
[参考]
|
||||
快適なDiddle操作を確保するため、送信バッファの個数は可能な限り小さくして下さい。ただし符号の連続タイミングを一定に保つ必要がある場合は最低限1個のバッファが必要です。付属のサンプルは1個のバッファを設けた例です。
|
||||
|
||||
void extfskPutChar(BYTE c)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
[引数]
|
||||
c:送信するデータ
|
||||
[解説]
|
||||
送信するデータをバッファに1バイト書き込みます。MMTTYはこのファンクションを呼び出す前に必ずextfskIsTxBusy()を呼び出してバッファに空きがあるかどうかを調査します。
|
||||
|
||||
void extfskSetPTT(LONG tx)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
[引数]
|
||||
tx b0: 0-受信に切り替え, 1-送信に切り替え
|
||||
b1: 0-画像スキャン停止中, 1-画像スキャン中 (MMSSTVのみ)
|
||||
[解説]
|
||||
PTTを切り替えます。MMTTYではb0のPTTのみがセットされますが、MMSSTVでは「RTS while SCAN」をONにしている場合、b1の画像スキャン情報もセットされます。
|
||||
|
||||
73, Mako
|
||||
60
FSK8250/eapi.txt
Normal file
60
FSK8250/eapi.txt
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
=====
|
||||
Interface to MMTTY, MMSSTV, MMVARI
|
||||
=====
|
||||
EXTFSK.DLL must export the following five functions:
|
||||
|
||||
extern "C" LONG __declspec(dllexport) __stdcall extfskOpen(LONG para)
|
||||
extern "C" void __declspec(dllexport) __stdcall extfskClose(void)
|
||||
extern "C" LONG __declspec(dllexport) __stdcall extfskIsTxBusy(void)
|
||||
extern "C" void __declspec(dllexport) __stdcall extfskPutChar(BYTE c)
|
||||
extern "C" void __declspec(dllexport) __stdcall extfskSetPTT(LONG tx)
|
||||
|
||||
Each function must comply with __stdcall call function (stack is adjusted on the called function side). The function name could be preceded by one underscore (_). For example, if MMTTY fails to find extfskOpen(), it then looks for _extfskOpen().
|
||||
|
||||
-----------------------------
|
||||
LONG extfskOpen( LONG para )
|
||||
-----------------------------
|
||||
Parameters
|
||||
Upper 16 bits of para: Speed (45 for example)
|
||||
Lower 16 bits of para: b1-b0 Stop (0-1, 1-1.5, 2-2)
|
||||
b5-b2 Length (5, 6, 7 or 8)
|
||||
Returned value
|
||||
TRUE = succeeded
|
||||
FALSE = failed
|
||||
Note
|
||||
This function opens the port. Even if Stop 2 is specified, open with Stop 1.5. The sample code ignores the parameters and always opens with Baud = 45.45 and Stop = 1.5.
|
||||
|
||||
-------------------------
|
||||
void extfskClose( void )
|
||||
-------------------------
|
||||
Note
|
||||
This function closes the port.
|
||||
|
||||
----------------------------
|
||||
LONG extfskIsTxBusy( void )
|
||||
----------------------------
|
||||
Returned value
|
||||
TRUE = Buffer is full
|
||||
FALSE = Buffer is not full
|
||||
Note
|
||||
This function returns the buffer status, that is, full or not full. For clean diddling, keep the buffer length as small as possible. For making continuous transmission, however, the buffer should have at least one slot capacity. The sample code has one slot for the buffer.
|
||||
|
||||
------------------------------
|
||||
void extfskPutChar( BYTE c )
|
||||
------------------------------
|
||||
Parameter
|
||||
c: TX data
|
||||
Note
|
||||
This function writes a byte data to the buffer. Before writing the data, MMTTY always calls extfskIsTxBusy() to see if the buffer can accept the new data.
|
||||
|
||||
-----------------------------
|
||||
void extfskSetPTT( LONG tx )
|
||||
-----------------------------
|
||||
Parameter
|
||||
tx b0: 0 ? Switch to RX, 1 ? Switch to TX
|
||||
tx b1: 0 ? Not scanning RX image, 1 ? Scanning RX image (MMSSTV only)
|
||||
Note
|
||||
This function makes and breaks PTT. MMTTY uses bit 0 only. MMSSTV set bit 1 while it is scanning a RX image if RTS while scan option is enabled.
|
||||
|
||||
73, Mako
|
||||
|
||||
179
FSK8250/fsk8250.bpr
Normal file
179
FSK8250/fsk8250.bpr
Normal file
|
|
@ -0,0 +1,179 @@
|
|||
# ---------------------------------------------------------------------------
|
||||
!if !$d(BCB)
|
||||
BCB = $(MAKEDIR)\..
|
||||
!endif
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# IDE セクション
|
||||
# ---------------------------------------------------------------------------
|
||||
# プロジェクトメイクファイルの以下のセクションは、IDE によって管理されます。
|
||||
# このセクションを変更する場合は、できるだけ IDE を使用するようにして
|
||||
# ください。
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
VERSION = BCB.03
|
||||
# ---------------------------------------------------------------------------
|
||||
PROJECT = fsk8250.fsk
|
||||
OBJFILES = fsk8250.obj Main.obj
|
||||
RESFILES =
|
||||
DEFFILE =
|
||||
RESDEPEN = $(RESFILES) Main.dfm
|
||||
LIBFILES =
|
||||
LIBRARIES = inet35.lib VCL35.lib
|
||||
SPARELIBS = VCL35.lib inet35.lib
|
||||
PACKAGES = VCLX35.bpi VCL35.bpi VCLDB35.bpi VCLDBX35.bpi bcbsmp35.bpi dclocx35.bpi \
|
||||
QRPT35.bpi TEEUI35.bpi VCLSMP35.bpi TEEDB35.bpi TEE35.bpi ibsmp35.bpi \
|
||||
NMFAST35.bpi INETDB35.bpi INET35.bpi
|
||||
# ---------------------------------------------------------------------------
|
||||
PATHCPP = .;
|
||||
PATHASM = .;
|
||||
PATHPAS = .;
|
||||
PATHRC = .;
|
||||
DEBUGLIBPATH = $(BCB)\lib\debug
|
||||
RELEASELIBPATH = $(BCB)\lib\release
|
||||
# ---------------------------------------------------------------------------
|
||||
CFLAG1 = -WD -O2 -Hc -w -Ve -d -k- -vi -c -b- -w-par -w-inl -Vx
|
||||
CFLAG2 = -I$(BCB)\include;$(BCB)\include\vcl -H=$(BCB)\lib\vcl35.csm
|
||||
CFLAG3 = -Tkh30000
|
||||
PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \
|
||||
-I$(BCB)\include;$(BCB)\include\vcl -$L- -$D- -v -JPHN -M
|
||||
RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl
|
||||
AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES
|
||||
LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) -aa -Tpd -x -Gn
|
||||
IFLAGS =
|
||||
# ---------------------------------------------------------------------------
|
||||
ALLOBJ = c0d32.obj sysinit.obj $(OBJFILES)
|
||||
ALLRES = $(RESFILES)
|
||||
ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mt.lib
|
||||
# ---------------------------------------------------------------------------
|
||||
!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
|
||||
|
||||
[Version Info Keys]
|
||||
CompanyName=
|
||||
FileDescription=
|
||||
FileVersion=1.0.0.0
|
||||
InternalName=
|
||||
LegalCopyright=
|
||||
LegalTrademarks=
|
||||
OriginalFilename=
|
||||
ProductName=
|
||||
ProductVersion=1.0.0.0
|
||||
Comments=
|
||||
|
||||
[HistoryLists\hlIncludePath]
|
||||
Count=1
|
||||
Item0=$(BCB)\include;$(BCB)\include\vcl
|
||||
|
||||
[HistoryLists\hlLibraryPath]
|
||||
Count=1
|
||||
Item0=$(BCB)\lib\obj;$(BCB)\lib
|
||||
|
||||
[HistoryLists\hlDebugSourcePath]
|
||||
Count=1
|
||||
Item0=$(BCB)\source\vcl
|
||||
|
||||
[HistoryLists\hlHostApplication]
|
||||
Count=3
|
||||
Item0=D:\mmvari\mmvari.exe
|
||||
Item1=D:\Temp\mmtty\mmtty.exe
|
||||
Item2=D:\Mmtty\mmtty.exe
|
||||
|
||||
[Debugging]
|
||||
DebugSourceDirs=$(BCB)\source\vcl
|
||||
|
||||
[Parameters]
|
||||
RunParams=
|
||||
HostApplication=D:\mmvari\mmvari.exe
|
||||
|
||||
!endif
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# MAKE セクション
|
||||
# ---------------------------------------------------------------------------
|
||||
# IDE はプロジェクトファイルのこのセクションは使用していません。
|
||||
# コマンドラインの MAKE ユーティリティを使用してビルドするためのものです。
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
.autodepend
|
||||
# ---------------------------------------------------------------------------
|
||||
!if !$d(BCC32)
|
||||
BCC32 = bcc32
|
||||
!endif
|
||||
|
||||
!if !$d(DCC32)
|
||||
DCC32 = dcc32
|
||||
!endif
|
||||
|
||||
!if !$d(TASM32)
|
||||
TASM32 = tasm32
|
||||
!endif
|
||||
|
||||
!if !$d(LINKER)
|
||||
LINKER = ilink32
|
||||
!endif
|
||||
|
||||
!if !$d(BRCC32)
|
||||
BRCC32 = brcc32
|
||||
!endif
|
||||
# ---------------------------------------------------------------------------
|
||||
!if $d(PATHCPP)
|
||||
.PATH.CPP = $(PATHCPP)
|
||||
.PATH.C = $(PATHCPP)
|
||||
!endif
|
||||
|
||||
!if $d(PATHPAS)
|
||||
.PATH.PAS = $(PATHPAS)
|
||||
!endif
|
||||
|
||||
!if $d(PATHASM)
|
||||
.PATH.ASM = $(PATHASM)
|
||||
!endif
|
||||
|
||||
!if $d(PATHRC)
|
||||
.PATH.RC = $(PATHRC)
|
||||
!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) $(CFLAG3) -n$(@D) {$< }
|
||||
|
||||
.c.obj:
|
||||
$(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
|
||||
|
||||
.asm.obj:
|
||||
$(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@
|
||||
|
||||
.rc.res:
|
||||
$(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $<
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
191
FSK8250/fsk8250.cbproj
Normal file
191
FSK8250/fsk8250.cbproj
Normal file
|
|
@ -0,0 +1,191 @@
|
|||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{3F4B3917-B2FC-437A-834F-3DE31B026A4F}</ProjectGuid>
|
||||
<ProjectType>CppDynamicLibrary</ProjectType>
|
||||
<Base>True</Base>
|
||||
<Config Condition="'$(Config)'==''">Debug</Config>
|
||||
<ProjectVersion>14.6</ProjectVersion>
|
||||
<AppType>Library</AppType>
|
||||
<FrameworkType>None</FrameworkType>
|
||||
<Platform Condition="'$(Platform)'==''">Win32</Platform>
|
||||
<TargetedPlatforms>1</TargetedPlatforms>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
|
||||
<Base_Win32>true</Base_Win32>
|
||||
<CfgParent>Base</CfgParent>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
|
||||
<Cfg_1>true</Cfg_1>
|
||||
<CfgParent>Base</CfgParent>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
|
||||
<Cfg_1_Win32>true</Cfg_1_Win32>
|
||||
<CfgParent>Cfg_1</CfgParent>
|
||||
<Cfg_1>true</Cfg_1>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win64)'!=''">
|
||||
<Cfg_1_Win64>true</Cfg_1_Win64>
|
||||
<CfgParent>Cfg_1</CfgParent>
|
||||
<Cfg_1>true</Cfg_1>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
|
||||
<Cfg_2>true</Cfg_2>
|
||||
<CfgParent>Base</CfgParent>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
|
||||
<Cfg_2_Win32>true</Cfg_2_Win32>
|
||||
<CfgParent>Cfg_2</CfgParent>
|
||||
<Cfg_2>true</Cfg_2>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win64)'!=''">
|
||||
<Cfg_2_Win64>true</Cfg_2_Win64>
|
||||
<CfgParent>Cfg_2</CfgParent>
|
||||
<Cfg_2>true</Cfg_2>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Base)'!=''">
|
||||
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
|
||||
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace>
|
||||
<VerInfo_Locale>1041</VerInfo_Locale>
|
||||
<LinkPackageStatics>rtl.lib;vcl.lib;inet.lib</LinkPackageStatics>
|
||||
<PackageImports>vclx.bpi;rtl.bpi;vcl.bpi;dbrtl.bpi;vcldb.bpi;bdertl.bpi;vcldbx.bpi;bcbsmp.bpi;teeui.bpi;vclsmp.bpi;teedb.bpi;tee.bpi;ibsmp.bpi;inetdb.bpi;inet.bpi;$(PackageImports)</PackageImports>
|
||||
<DCC_UnitSearchPath>.\;$(BDS)\lib;$(BDS)\lib\obj;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
|
||||
<ILINK_AppType>Windows</ILINK_AppType>
|
||||
<BCC_PCHCache>true</BCC_PCHCache>
|
||||
<BRCC_IncludePath>$(BDS)\include;$(BDS)\include\vcl;$(BRCC_IncludePath)</BRCC_IncludePath>
|
||||
<BCC_OptimizeForSpeed>true</BCC_OptimizeForSpeed>
|
||||
<BCC_IncludePath>$(BDS)\include;$(BDS)\include\vcl;$(BCC_IncludePath)</BCC_IncludePath>
|
||||
<DCC_IncludePath>.\;$(BDS)\lib;$(BDS)\lib\obj;$(DCC_IncludePath)</DCC_IncludePath>
|
||||
<TASM_IncludePath>$(BDS)\include;$(BDS)\include\vcl;$(TASM_IncludePath)</TASM_IncludePath>
|
||||
<AllPackageLibs>rtl.lib;vcl.lib;inet.lib</AllPackageLibs>
|
||||
<FinalOutputDir>.</FinalOutputDir>
|
||||
<ILINK_WinAppType>DLL</ILINK_WinAppType>
|
||||
<TASM_Debugging>None</TASM_Debugging>
|
||||
<TASM_AdditionalSwitches> /w2</TASM_AdditionalSwitches>
|
||||
<OutputExt>fsk</OutputExt>
|
||||
<DCC_CBuilderOutput>JPHNE</DCC_CBuilderOutput>
|
||||
<DCC_AdditionalSwitches> -M</DCC_AdditionalSwitches>
|
||||
<ILINK_LibraryPath>$(BDS)\lib\obj;$(BDS)\lib;$(BDS)\lib\psdk;$(ILINK_LibraryPath)</ILINK_LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Base_Win32)'!=''">
|
||||
<VerInfo_Locale>1033</VerInfo_Locale>
|
||||
<BCC_UserSuppliedOptions> -tWM -Tkh30000 -Vx -tWD -d -Ve</BCC_UserSuppliedOptions>
|
||||
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
|
||||
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_1)'!=''">
|
||||
<ILINK_LibraryPath>$(BDS)\lib\debug;$(ILINK_LibraryPath);$(ILINK_LibraryPath)</ILINK_LibraryPath>
|
||||
<DCC_Define>DEBUG;$(DCC_Define);$(DCC_Define)</DCC_Define>
|
||||
<BCC_SourceDebuggingOn>true</BCC_SourceDebuggingOn>
|
||||
<IntermediateOutputDir>Debug_Build</IntermediateOutputDir>
|
||||
<ILINK_FullDebugInfo>true</ILINK_FullDebugInfo>
|
||||
<TASM_DisplaySourceLines>true</TASM_DisplaySourceLines>
|
||||
<ILINK_DisableIncrementalLinking>true</ILINK_DisableIncrementalLinking>
|
||||
<BCC_DisableOptimizations>true</BCC_DisableOptimizations>
|
||||
<TASM_Debugging>Full</TASM_Debugging>
|
||||
<DCC_AdditionalSwitches> -M -V</DCC_AdditionalSwitches>
|
||||
<BCC_DebugLineNumbers>true</BCC_DebugLineNumbers>
|
||||
<DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
|
||||
<BCC_InlineFunctionExpansion>false</BCC_InlineFunctionExpansion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
|
||||
<BCC_Defines>_DEBUG;$(BCC_Defines);$(BCC_Defines)</BCC_Defines>
|
||||
<BCC_UserSuppliedOptions> -tWM -Tkh30000 -Vx -tWD -d -Ve -k</BCC_UserSuppliedOptions>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_1_Win64)'!=''">
|
||||
<BCC_Defines>_DEBUG;$(BCC_Defines);$(BCC_Defines)</BCC_Defines>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_2)'!=''">
|
||||
<IntermediateOutputDir>Release_Build</IntermediateOutputDir>
|
||||
<DCC_AdditionalSwitches> -M -$O+</DCC_AdditionalSwitches>
|
||||
<ILINK_LibraryPath>$(BDS)\lib\release;$(ILINK_LibraryPath);$(ILINK_LibraryPath)</ILINK_LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
|
||||
<BCC_Defines>NDEBUG;$(BCC_Defines);$(BCC_Defines)</BCC_Defines>
|
||||
<BCC_UserSuppliedOptions> -tWM -Tkh30000 -Vx -tWD -d -Ve -r</BCC_UserSuppliedOptions>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_2_Win64)'!=''">
|
||||
<BCC_Defines>NDEBUG;$(BCC_Defines);$(BCC_Defines)</BCC_Defines>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<CppCompile Include="fsk8250.cpp">
|
||||
<BuildOrder>-1</BuildOrder>
|
||||
<BuildOrder>0</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="Main.cpp">
|
||||
<BuildOrder>-1</BuildOrder>
|
||||
<Form>ComFSK</Form>
|
||||
<DependentOn>Main.h</DependentOn>
|
||||
<BuildOrder>1</BuildOrder>
|
||||
</CppCompile>
|
||||
<FormResources Include="Main.dfm"/>
|
||||
<BuildConfiguration Include="Release">
|
||||
<Key>Cfg_2</Key>
|
||||
<CfgParent>Base</CfgParent>
|
||||
</BuildConfiguration>
|
||||
<BuildConfiguration Include="Base">
|
||||
<Key>Base</Key>
|
||||
</BuildConfiguration>
|
||||
<BuildConfiguration Include="Debug">
|
||||
<Key>Cfg_1</Key>
|
||||
<CfgParent>Base</CfgParent>
|
||||
</BuildConfiguration>
|
||||
</ItemGroup>
|
||||
<Import Condition="Exists('$(BDS)\Bin\CodeGear.Cpp.Targets')" Project="$(BDS)\Bin\CodeGear.Cpp.Targets"/>
|
||||
<Import Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')" Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj"/>
|
||||
<ProjectExtensions>
|
||||
<Borland.Personality>CPlusPlusBuilder.Personality.12</Borland.Personality>
|
||||
<Borland.ProjectType>CppDynamicLibrary</Borland.ProjectType>
|
||||
<BorlandProject>
|
||||
<CPlusPlusBuilder.Personality>
|
||||
<VersionInfo>
|
||||
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
|
||||
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
|
||||
<VersionInfo Name="MajorVer">1</VersionInfo>
|
||||
<VersionInfo Name="MinorVer">0</VersionInfo>
|
||||
<VersionInfo Name="Release">0</VersionInfo>
|
||||
<VersionInfo Name="Build">0</VersionInfo>
|
||||
<VersionInfo Name="Debug">False</VersionInfo>
|
||||
<VersionInfo Name="PreRelease">False</VersionInfo>
|
||||
<VersionInfo Name="Special">False</VersionInfo>
|
||||
<VersionInfo Name="Private">False</VersionInfo>
|
||||
<VersionInfo Name="DLL">False</VersionInfo>
|
||||
<VersionInfo Name="Locale">1041</VersionInfo>
|
||||
<VersionInfo Name="CodePage">932</VersionInfo>
|
||||
</VersionInfo>
|
||||
<VersionInfoKeys>
|
||||
<VersionInfoKeys Name="CompanyName"/>
|
||||
<VersionInfoKeys Name="FileDescription"/>
|
||||
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="InternalName"/>
|
||||
<VersionInfoKeys Name="LegalCopyright"/>
|
||||
<VersionInfoKeys Name="LegalTrademarks"/>
|
||||
<VersionInfoKeys Name="OriginalFilename"/>
|
||||
<VersionInfoKeys Name="ProductName"/>
|
||||
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="Comments"/>
|
||||
</VersionInfoKeys>
|
||||
<ProjectProperties>
|
||||
<ProjectProperties Name="AutoShowDeps">False</ProjectProperties>
|
||||
<ProjectProperties Name="ManagePaths">True</ProjectProperties>
|
||||
<ProjectProperties Name="VerifyPackages">True</ProjectProperties>
|
||||
</ProjectProperties>
|
||||
</CPlusPlusBuilder.Personality>
|
||||
<Platforms>
|
||||
<Platform value="OSX32">False</Platform>
|
||||
<Platform value="Win32">True</Platform>
|
||||
<Platform value="Win64">False</Platform>
|
||||
</Platforms>
|
||||
</BorlandProject>
|
||||
<ProjectFileVersion>12</ProjectFileVersion>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
||||
2
FSK8250/fsk8250.cbproj.local
Normal file
2
FSK8250/fsk8250.cbproj.local
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<BorlandProject/>
|
||||
85
FSK8250/fsk8250.cpp
Normal file
85
FSK8250/fsk8250.cpp
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
//---------------------------------------------------------------------------
|
||||
#include <vcl.h>
|
||||
#pragma hdrstop
|
||||
#include "Main.h"
|
||||
//---------------------------------------------------------------------------
|
||||
extern "C" void __declspec(dllexport) __stdcall extfskClose(void);
|
||||
//---------------------------------------------------------------------------
|
||||
USEFORM("Main.cpp", ComFSK);
|
||||
//---------------------------------------------------------------------------
|
||||
TComFSK *g_pMain;
|
||||
//---------------------------------------------------------------------------
|
||||
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*)
|
||||
{
|
||||
switch(reason){
|
||||
case DLL_PROCESS_ATTACH:
|
||||
g_pMain = NULL;
|
||||
|
||||
memset(&sys, 0, sizeof(sys));
|
||||
::GetModuleFileName(hinst, sys.m_ModuleName, sizeof(sys.m_ModuleName));
|
||||
::SetDirName(sys.m_BgnDir, sys.m_ModuleName);
|
||||
sys.m_dwVersion = ::GetVersion();
|
||||
sys.m_WinNT = (sys.m_dwVersion < 0x80000000) ? TRUE : FALSE;
|
||||
break;
|
||||
case DLL_PROCESS_DETACH:
|
||||
extfskClose();
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
extern "C" LONG __declspec(dllexport) __stdcall
|
||||
extfskOpen(LONG para)
|
||||
{
|
||||
extfskClose();
|
||||
|
||||
g_pMain = new TComFSK(NULL);
|
||||
ASSERT(g_pMain);
|
||||
if( g_pMain != NULL ){
|
||||
g_pMain->SetPara(para);
|
||||
g_pMain->Show();
|
||||
return TRUE;
|
||||
}
|
||||
else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
extern "C" void __declspec(dllexport) __stdcall
|
||||
extfskClose(void)
|
||||
{
|
||||
if( g_pMain != NULL ){
|
||||
g_pMain->Close();
|
||||
delete g_pMain;
|
||||
g_pMain = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
extern "C" LONG __declspec(dllexport) __stdcall
|
||||
extfskIsTxBusy(void)
|
||||
{
|
||||
if( g_pMain == NULL ) return FALSE;
|
||||
|
||||
return g_pMain->IsBusy();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
extern "C" void __declspec(dllexport) __stdcall
|
||||
extfskPutChar(BYTE c)
|
||||
{
|
||||
if( g_pMain == NULL ) return;
|
||||
|
||||
g_pMain->PutChar(c);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
extern "C" void __declspec(dllexport) __stdcall
|
||||
extfskSetPTT(LONG tx)
|
||||
{
|
||||
if( g_pMain == NULL ) return;
|
||||
|
||||
g_pMain->SetPTT(tx & 1, TRUE);
|
||||
}
|
||||
|
||||
BIN
FSK8250/fsk8250.fsk
Normal file
BIN
FSK8250/fsk8250.fsk
Normal file
Binary file not shown.
20
FSK8250/fsk8250.ini
Normal file
20
FSK8250/fsk8250.ini
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
[Window]
|
||||
Top=275
|
||||
Left=639
|
||||
State=0
|
||||
|
||||
[Settings]
|
||||
Port=COM1
|
||||
FSK=0
|
||||
PTT=1
|
||||
InvFSK=0
|
||||
InvPTT=0
|
||||
|
||||
[Port]
|
||||
LPT1=3BC
|
||||
LPT2=378
|
||||
LPT3=278
|
||||
|
||||
[DirectAccess]
|
||||
LPTADR=378
|
||||
|
||||
6
FSK8250/fsk8250.map
Normal file
6
FSK8250/fsk8250.map
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
Start Length Name Class
|
||||
0001:00401000 0002D7F50H _TEXT CODE
|
||||
0002:006D9000 00000EAB8H _DATA DATA
|
||||
0003:006E7AB8 00001BD18H _BSS BSS
|
||||
0004:00000000 0000000E8H _TLS TLS
|
||||
BIN
FSK8250/fsk8250.res
Normal file
BIN
FSK8250/fsk8250.res
Normal file
Binary file not shown.
BIN
FSK8250/fsk8250.tds
Normal file
BIN
FSK8250/fsk8250.tds
Normal file
Binary file not shown.
594
Fft.cpp
Normal file
594
Fft.cpp
Normal file
|
|
@ -0,0 +1,594 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
#include <vcl.h>
|
||||
#pragma hdrstop
|
||||
|
||||
#include <math.h>
|
||||
#include "fft.h"
|
||||
|
||||
int FFT_SIZE=2048;
|
||||
|
||||
#define PI 3.1415926535897932384626433832795
|
||||
#define PI2 (2*PI)
|
||||
|
||||
#define SCALEADJ_1 (-4.4494132)
|
||||
#define LOGADJ (2.81458e4)
|
||||
|
||||
//-------------------------------------------------
|
||||
// FFT処理クラス
|
||||
__fastcall CFFT::CFFT()
|
||||
{
|
||||
m_FFTDIS = 0;
|
||||
// memset(m_fft, 0, sizeof(m_fft));
|
||||
m_tWindow = new double[FFT_BUFSIZE];
|
||||
m_tSinCos = new double[FFT_BUFSIZE/2];
|
||||
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) )); //ハニング窓
|
||||
}
|
||||
m_StgSize = 1;
|
||||
m_StgScale = 1.0;
|
||||
m_StgK = 0.0;
|
||||
m_StgSW = FALSE;
|
||||
m_FFTGain = 0;
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// FFT処理クラスの再初期化
|
||||
void __fastcall CFFT::InitFFT(void)
|
||||
{
|
||||
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) )); //ハニング窓
|
||||
}
|
||||
m_StgSize = 1;
|
||||
m_StgScale = 1.0;
|
||||
m_StgK = 0.0;
|
||||
m_StgSW = FALSE;
|
||||
m_FFTDIS = 0;
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
__fastcall CFFT::~CFFT()
|
||||
{
|
||||
m_FFTDIS++;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
void __fastcall 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);
|
||||
}
|
||||
}
|
||||
//-------------------------------------------------
|
||||
// データの処理化
|
||||
void __fastcall 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
//-------------------------------------------------
|
||||
// データの処理化
|
||||
void __fastcall 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 __fastcall 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 __fastcall 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 __fastcall 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 __fastcall 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++){
|
||||
(*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 __fastcall 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; // <-- here
|
||||
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;
|
||||
}
|
||||
if( m_FFTGain ){
|
||||
pStgBuf[k] = m_StgK*pStgBuf[k] + m_StgScale*pow(xi, 0.25)*0.00345;
|
||||
pStgBuf[j] = m_StgK*pStgBuf[j] + m_StgScale*pow(xr, 0.25)*0.00345;
|
||||
}
|
||||
else {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
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];
|
||||
if( yi >= 1e38 ) yi = 1e38;
|
||||
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;
|
||||
}
|
||||
if( m_FFTGain ){
|
||||
pStgBuf[k] = pow(xi, 0.25)*0.00345;
|
||||
pStgBuf[j] = pow(xr, 0.25)*0.00345;
|
||||
}
|
||||
else {
|
||||
pStgBuf[k] = log10(xi+LOGADJ)+SCALEADJ_1;
|
||||
pStgBuf[j] = log10(xr+LOGADJ)+SCALEADJ_1;
|
||||
}
|
||||
}
|
||||
}
|
||||
pStgBuf[FFT_SIZE/2] = pStgBuf[(FFT_SIZE/2) - 2];
|
||||
}
|
||||
|
||||
60
Fft.h
Normal file
60
Fft.h
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
#ifndef FFT_H
|
||||
#define FFT_H
|
||||
//---------------------------------------------------------------------------
|
||||
extern int FFT_SIZE;
|
||||
//#define FFT_SIZE 2048
|
||||
#define FFT_BUFSIZE 2048
|
||||
#define SQRT_FFT_SIZE 46//sqrt(2048)
|
||||
|
||||
class CFFT
|
||||
{
|
||||
public:
|
||||
__fastcall CFFT();
|
||||
virtual __fastcall ~CFFT();
|
||||
void __fastcall InitFFT(void);
|
||||
|
||||
int m_FFTGain;
|
||||
int m_FFTDIS;
|
||||
void __fastcall Calc(double * InBuf, int size, double gain, int stg, int* OutBuf);
|
||||
inline void __fastcall ClearStg(void){
|
||||
memset(pStgBuf, 0, sizeof(double[FFT_BUFSIZE]));
|
||||
}
|
||||
private:
|
||||
BOOL m_StgSW;
|
||||
int m_StgSize;
|
||||
double m_StgScale;
|
||||
double m_StgK;
|
||||
|
||||
double *m_tSinCos;
|
||||
double *m_tWindow;
|
||||
double *pStgBuf;
|
||||
int *m_Work;
|
||||
void __fastcall makewt(int nw, int *ip, double *w);
|
||||
void __fastcall makect(int nc, int *ip, double *c);
|
||||
void __fastcall bitrv2(int n, int *ip, double *a);
|
||||
void __fastcall cftfsub(int n, double *a, double *w);
|
||||
void __fastcall rftfsub(int n, double *a, int nc, double *c);
|
||||
void __fastcall cft1st(int n, double *a, double *w);
|
||||
void __fastcall cftmdl(int n, int l, double *a, double *w);
|
||||
};
|
||||
|
||||
#endif
|
||||
158
FreqDisp.cpp
Normal file
158
FreqDisp.cpp
Normal file
|
|
@ -0,0 +1,158 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
#include <vcl.h>
|
||||
#pragma hdrstop
|
||||
|
||||
#include "ComLib.h"
|
||||
#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_H2 = NULL;
|
||||
m_Tap2 = 0;
|
||||
m_Max = 0;
|
||||
m_SampleFreq = SAMPFREQ;
|
||||
|
||||
pBitmap = new Graphics::TBitmap();
|
||||
pBitmap->Width = PaintBox->Width;
|
||||
pBitmap->Height = PaintBox->Height;
|
||||
if( sys.m_MsgEng ){
|
||||
CancelBtn->Caption = "Close";
|
||||
Caption = "frequency characteristic";
|
||||
}
|
||||
FormCenter(this);
|
||||
}
|
||||
__fastcall TFreqDispDlg::~TFreqDispDlg()
|
||||
{
|
||||
delete pBitmap;
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
void __fastcall TFreqDispDlg::Execute(CFIR2 *pFIR, int max, double SampleFreq)
|
||||
{
|
||||
m_type = 0;
|
||||
m_H1 = pFIR->GetHP();
|
||||
m_Tap1 = pFIR->GetTap();
|
||||
m_Tap2 = 0;
|
||||
m_Max = max;
|
||||
m_SampleFreq = SampleFreq;
|
||||
MakeBitmap();
|
||||
ShowModal();
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
void __fastcall TFreqDispDlg::Execute(CFIRX *pFIR, int max, double SampleFreq)
|
||||
{
|
||||
m_type = 0;
|
||||
m_H1 = pFIR->GetHP();
|
||||
m_Tap1 = pFIR->GetTap();
|
||||
m_Tap2 = 0;
|
||||
m_Max = max;
|
||||
m_SampleFreq = SampleFreq;
|
||||
MakeBitmap();
|
||||
ShowModal();
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
void __fastcall TFreqDispDlg::Execute(const double *H, int Tap, int max, double SampleFreq)
|
||||
{
|
||||
m_type = 0;
|
||||
m_H1 = H;
|
||||
m_Tap1 = Tap ? Tap : 1;
|
||||
m_Tap2 = 0;
|
||||
m_Max = max;
|
||||
m_SampleFreq = SampleFreq;
|
||||
MakeBitmap();
|
||||
ShowModal();
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
void __fastcall TFreqDispDlg::Execute(double a10, double b11, double b12, double a20, double b21, double b22, double SampleFreq)
|
||||
{
|
||||
m_type = 1;
|
||||
m_a10 = a10;
|
||||
m_b11 = b11;
|
||||
m_b12 = b12;
|
||||
m_a20 = a20;
|
||||
m_b21 = b21;
|
||||
m_b22 = b22;
|
||||
m_SampleFreq = SampleFreq;
|
||||
MakeBitmap();
|
||||
ShowModal();
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
void __fastcall TFreqDispDlg::Execute(CIIRTANK &tank, double SampleFreq)
|
||||
{
|
||||
m_type = 4;
|
||||
m_a10 = tank.a0;
|
||||
m_b11 = tank.b1;
|
||||
m_b12 = tank.b2;
|
||||
m_SampleFreq = SampleFreq;
|
||||
MakeBitmap();
|
||||
ShowModal();
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
void __fastcall TFreqDispDlg::Execute(CIIR *ip, double max, double SampleFreq)
|
||||
{
|
||||
m_type = 2;
|
||||
m_piir = ip;
|
||||
m_Max = max;
|
||||
m_SampleFreq = SampleFreq;
|
||||
MakeBitmap();
|
||||
ShowModal();
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
void __fastcall TFreqDispDlg::MakeBitmap(void)
|
||||
{
|
||||
OnWave();
|
||||
if( m_type == 0 ){ // FIR
|
||||
DrawGraph(pBitmap, m_H1, m_Tap1, m_Max, 1, clBlue, m_SampleFreq);
|
||||
if( m_Tap2 ){
|
||||
DrawGraph(pBitmap, m_H2, m_Tap2, m_Max, 0, clRed, m_SampleFreq);
|
||||
}
|
||||
}
|
||||
else if( m_type == 1 ){ // IIR Tank
|
||||
DrawGraphIIR(pBitmap, m_a10, 0, 0, -m_b11, -m_b12, m_Max, 1, clBlue, m_SampleFreq);
|
||||
DrawGraphIIR(pBitmap, m_a20, 0, 0, -m_b21, -m_b22, m_Max, 0, clRed, m_SampleFreq);
|
||||
}
|
||||
else if( m_type == 2 ){ // IIR
|
||||
DrawGraphIIR(pBitmap, m_piir, m_Max, 1, clBlue, m_SampleFreq);
|
||||
}
|
||||
else if( m_type == 3 ){ // FIR-Avg
|
||||
DrawGraph(pBitmap, m_H1, m_Tap1, m_Max, 1, clBlue, m_SampleFreq);
|
||||
}
|
||||
else if( m_type == 4 ){
|
||||
DrawGraphIIR(pBitmap, m_a10, 0, 0, -m_b11, -m_b12, m_Max, 1, clBlue, m_SampleFreq);
|
||||
}
|
||||
OnWave();
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
void __fastcall TFreqDispDlg::PaintBoxPaint(TObject *Sender)
|
||||
{
|
||||
PaintBox->Canvas->Draw(0, 0, (TGraphic*)pBitmap);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
BIN
FreqDisp.dfm
Normal file
BIN
FreqDisp.dfm
Normal file
Binary file not shown.
86
FreqDisp.h
Normal file
86
FreqDisp.h
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
#ifndef FreqDispH
|
||||
#define FreqDispH
|
||||
//----------------------------------------------------------------------------
|
||||
/* JA7UDE 0428
|
||||
#include <vcl\System.hpp>
|
||||
#include <vcl\Windows.hpp>
|
||||
#include <vcl\SysUtils.hpp>
|
||||
#include <vcl\Classes.hpp>
|
||||
#include <vcl\Graphics.hpp>
|
||||
#include <vcl\StdCtrls.hpp>
|
||||
#include <vcl\Forms.hpp>
|
||||
#include <vcl\Controls.hpp>
|
||||
#include <vcl\Buttons.hpp>
|
||||
#include <vcl\ExtCtrls.hpp>
|
||||
*/
|
||||
//----------------------------------------------------------------------------
|
||||
#include "dsp.h"
|
||||
//----------------------------------------------------------------------------
|
||||
class TFreqDispDlg : public TForm
|
||||
{
|
||||
__published:
|
||||
TButton *CancelBtn;
|
||||
TPanel *Panel;
|
||||
TPaintBox *PaintBox;
|
||||
TTimer *Timer;
|
||||
void __fastcall PaintBoxPaint(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;
|
||||
const double *m_H2;
|
||||
int m_Tap2;
|
||||
double m_SampleFreq;
|
||||
|
||||
double m_HT[TAPMAX+1];
|
||||
private:
|
||||
void __fastcall MakeBitmap(void);
|
||||
|
||||
public:
|
||||
virtual __fastcall TFreqDispDlg(TComponent* AOwner);
|
||||
__fastcall ~TFreqDispDlg();
|
||||
|
||||
void __fastcall Execute(CFIR2 *pFIR, int max, double SampleFreq);
|
||||
void __fastcall Execute(CFIRX *pFIR, int max, double SampleFreq);
|
||||
void __fastcall Execute(const double *H, int Tap, int max, double SampleFreq);
|
||||
void __fastcall Execute(double a10, double b11, double b12, double a20, double b21, double b22, double SampleFreq);
|
||||
void __fastcall Execute(CIIR *ip, double max, double SampleFreq);
|
||||
void __fastcall Execute(CIIRTANK &tank, double SampleFreq);
|
||||
|
||||
int m_Max;
|
||||
};
|
||||
//----------------------------------------------------------------------------
|
||||
//extern TFreqDispDlg *FreqDispDlg;
|
||||
//----------------------------------------------------------------------------
|
||||
#endif
|
||||
|
||||
632
Hamlog5.cpp
Normal file
632
Hamlog5.cpp
Normal file
|
|
@ -0,0 +1,632 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
#include <vcl.h>
|
||||
#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;
|
||||
}
|
||||
//--------------------------------------------
|
||||
//コンストラクタ
|
||||
CHamlog5::CHamlog5()
|
||||
{
|
||||
m_fCreate = FALSE;
|
||||
m_RecMax = 0; // レコード数
|
||||
m_FilMax = 0; // フィールド数
|
||||
m_RecWidth = 0; // レコードの幅
|
||||
m_FilOff = 0; // ヘッダオフセット
|
||||
m_bp = NULL;
|
||||
m_OpenFlag = FALSE;
|
||||
m_WriteFlag = FALSE; // 書き込みフラグ
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
//デストラクタ
|
||||
CHamlog5::~CHamlog5()
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
//ヘッダデータセットアップ
|
||||
BOOL CHamlog5::SetupHeader(void)
|
||||
{
|
||||
if( fread(&m_Head, 1, sizeof(m_Head), m_fp)!=sizeof(m_Head) ){
|
||||
return FALSE; // 異なるフォーマット
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
//ヘッダデータ作成
|
||||
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;
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
//オープン
|
||||
BOOL CHamlog5::Open(LPCSTR Name, BOOL fMsg)
|
||||
{
|
||||
if( (m_OpenFlag == TRUE) ) Close();
|
||||
m_WriteFlag = FALSE; // 書き込みフラグ
|
||||
if( (m_fp = fopen(Name, "rb")) == NULL ){
|
||||
if( fMsg ) ErrorMB("%sがオープンできません.", Name);
|
||||
return FALSE; // ファイルがオープンできない
|
||||
}
|
||||
m_OpenFlag = TRUE;
|
||||
m_fCreate = FALSE;
|
||||
if( SetupHeader() == FALSE ){
|
||||
Close();
|
||||
if( fMsg ) ErrorMB("ファイルフォーマットが認識できません.");
|
||||
return FALSE;
|
||||
}
|
||||
if( m_bp ) delete m_bp;
|
||||
m_bp = new char[m_RecWidth];
|
||||
if( Seek(0) == FALSE ){
|
||||
Close();
|
||||
if( fMsg ) ErrorMB("データーレコードが存在しません.");
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
//オープン
|
||||
BOOL CHamlog5::Create(LPCSTR Name)
|
||||
{
|
||||
if( (m_OpenFlag == TRUE) ) Close();
|
||||
m_WriteFlag = FALSE; // 書き込みフラグ
|
||||
if( (m_fp = fopen(Name, "wb")) == NULL ){
|
||||
ErrorMB("%sを作成できません.", Name);
|
||||
return FALSE; // ファイルがオープンできない
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
//クローズ
|
||||
void CHamlog5::Close(void)
|
||||
{
|
||||
if( m_OpenFlag == TRUE ){
|
||||
Update();
|
||||
if( m_RecMax != m_Head.RecMax ){ // データが追加されている
|
||||
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("ファイルの作成に失敗しました.");
|
||||
}
|
||||
m_OpenFlag = FALSE;
|
||||
}
|
||||
if( m_bp != NULL ){
|
||||
delete m_bp;
|
||||
m_bp = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
//レコードシーク
|
||||
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;
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
//マークのチェック
|
||||
BOOL CHamlog5::IsData(void)
|
||||
{
|
||||
return (*m_bp == ' ') ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
//データの読み込み
|
||||
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;
|
||||
}
|
||||
//--------------------------------------------
|
||||
//データの読み込み
|
||||
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;
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
//データの読み込み
|
||||
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;
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
//データの書き込み(バッファを更新するのみ)
|
||||
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;
|
||||
}
|
||||
//--------------------------------------------
|
||||
//データの書き込み(バッファを更新するのみ)
|
||||
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;
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
//データの書き込み(バッファの内容を反映させる)
|
||||
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;
|
||||
}
|
||||
//--------------------------------------------
|
||||
//データのデコード
|
||||
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; // コールサインの形式
|
||||
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;
|
||||
}
|
||||
//--------------------------------------------
|
||||
//データのエンコード
|
||||
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);
|
||||
}
|
||||
|
||||
119
Hamlog5.h
Normal file
119
Hamlog5.h
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
#ifndef Hamlog5H
|
||||
#define Hamlog5H
|
||||
|
||||
// MMQSL用Hamlog Ver5のドライバ
|
||||
|
||||
#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; // ヘッダ情報
|
||||
ULONG m_RecMax; // レコード数
|
||||
USHORT m_FilMax; // フィールド数
|
||||
USHORT m_RecWidth; // レコードの幅
|
||||
USHORT m_FilOff; // ヘッダオフセット
|
||||
FILE *m_fp;
|
||||
AnsiString m_StrTable[HamlogDBMAX]; // テーブル名の配列
|
||||
USHORT m_PosTable[HamlogDBMAX]; // フィールド位置の配列
|
||||
USHORT m_LenTable[HamlogDBMAX]; // フィールド長さの配列
|
||||
char m_TypeTable[HamlogDBMAX]; // 型情報の配列
|
||||
BOOL m_OpenFlag; // ファイルオープンフラグ
|
||||
|
||||
ULONG m_Index; // シーク時のインデックス
|
||||
ULONG m_Pos; // シーク時のファイル位置
|
||||
LPSTR m_bp; // バッファのポインタ
|
||||
BOOL m_WriteFlag; // 書き込みフラグ
|
||||
BOOL SetupHeader(void); // ヘッダセットアップ
|
||||
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
|
||||
310
History.txt
Normal file
310
History.txt
Normal file
|
|
@ -0,0 +1,310 @@
|
|||
========================
|
||||
BetaVer0.45 2010/OCT/04
|
||||
========================
|
||||
◎mfsk4, mfsk8, mfsk32, mfsk64, mfsk11, mfsk22を追加
|
||||
◎qpskモードの復調処理の改良
|
||||
◎起動時にサブチャネル画面を復元するオプションを追加
|
||||
◎マクロ機能の強化
|
||||
◎その他の細かい修正
|
||||
|
||||
========================
|
||||
BetaVer0.44 2010/SEP/24
|
||||
========================
|
||||
◎QPSKモードの追加
|
||||
◎RTTY復調器にFFT方式を追加
|
||||
◎RTTYのFSK送信(TNX JA7UDE)
|
||||
COMポートを指定した場合、MMVARI内でタイミングを作成します。
|
||||
EXTFSKを指定した場合、EXTFSKがタイミングを作成します。
|
||||
いずれもマルチメディアタイマを使っいるので1ms程度のジッタが発生する可能性があります。
|
||||
◎英語版Webのアドレスの追加
|
||||
◎JARTSWebのアドレスの変更
|
||||
◎COM8~COM16を選択に追加
|
||||
◎リグコントロールメニューの追加
|
||||
◎サウンドカード指定方法の改善
|
||||
|
||||
========================
|
||||
BetaVer0.42 2007/JAN/15
|
||||
========================
|
||||
◎英語環境動作時の起動時警告メッセージを削除
|
||||
|
||||
========================
|
||||
BetaVer0.41 2005/MAR/20
|
||||
========================
|
||||
◎BPSK-VariJA(MBCS)の送信禁止の解除(Tnx to JE4IVN)
|
||||
◎英語モード時のtypeの修正
|
||||
◎バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.40 2005/JAN/08
|
||||
========================
|
||||
◎バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.39 2004/NOV/06
|
||||
========================
|
||||
◎Turbo Hamlog/Win Ver5とのリンクの改善
|
||||
|
||||
========================
|
||||
BetaVer0.38 2004/NOV/03
|
||||
========================
|
||||
◎Turbo Hamlog/Win Ver5への対応 (Tnx to JG1MOU)
|
||||
◎バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.37 2004/OCT/08
|
||||
========================
|
||||
◎バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.36 2004/SEP/30
|
||||
========================
|
||||
◎バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.35 2004/SEP/22
|
||||
========================
|
||||
◎マクロ機能の強化
|
||||
◎バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.34 2004/SEP/11
|
||||
========================
|
||||
◎イベントマクロ(OnPTT,OnQSO,OnStart,...)の追加
|
||||
◎バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.33 2004/SEP/08
|
||||
========================
|
||||
◎GMSK/PSKのAFCを改善
|
||||
◎OnTimerイベントマクロの追加
|
||||
◎バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.32 2004/SEP/04
|
||||
========================
|
||||
◎デシメータの処理高速化
|
||||
◎バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.31 2004/AUG/28
|
||||
========================
|
||||
◎バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.30 2004/AUG/15
|
||||
========================
|
||||
◎バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.29 2004/AUG/09
|
||||
========================
|
||||
◎しょうもないバグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.28 2004/AUG/07
|
||||
========================
|
||||
◎rttyで送信後に受信できなくなるバグを修正
|
||||
◎サウンドプレーバックオプションを追加
|
||||
◎バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.27 2004/AUG/03
|
||||
========================
|
||||
◎mfskモードの復調処理(同期処理,AFC動作,処理速度など)を改善
|
||||
◎バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.26 2004/JUL/31
|
||||
========================
|
||||
◎変調方式にmfskモードの追加
|
||||
◎バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.25 2004/JUL/27
|
||||
========================
|
||||
◎表示メニューに「拡張マクロボタンの表示」を追加
|
||||
◎バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.24 2004/JUL/22
|
||||
========================
|
||||
◎マクロ機能の強化
|
||||
<%Menu=...>コマンドを追加
|
||||
<%RadioKHz=...>にKENWOODとJST245を追加
|
||||
<%RadioMode=...>を追加
|
||||
詳細は操作マニュアルのマクロの解説「ポップアップメニュー」および
|
||||
「マクロでのリグコントロール」を参照して下さい。
|
||||
◎バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.23 2004/JUL/19
|
||||
========================
|
||||
◎AFCの検出レベル計算のバグを修正
|
||||
◎リグの周波数の設定マクロ<%RadioKHz=....>を追加
|
||||
現状は以下の3種類
|
||||
<%RadioKHz=YAESU-HF,14073.000> FT1000MP, FT920, etc...
|
||||
<%RadioKHz=YAESU-VU,14073.000> FT847, FT736, etc...
|
||||
<%RadioKHz=CI-V,14073.000> ICOM
|
||||
例:500Hzアップ
|
||||
<%RadioKHz=YAESU-VU,<%RadioKHz>+0.5>
|
||||
◎バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.22 2004/JUL/14
|
||||
========================
|
||||
◎AFC特性を改善
|
||||
◎バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.21 2004/JUN/29
|
||||
========================
|
||||
◎バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.20 2004/JUN/28
|
||||
========================
|
||||
◎スペクトラム右クリックの操作を改善
|
||||
◎クロックズレ信号受信時の同期方法を改善
|
||||
◎バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.19 2004/JUN/26
|
||||
========================
|
||||
◎ノッチフィルタの追加(スペクトラム右クリック)
|
||||
◎BPF特性の改善
|
||||
◎バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.18 2004/JUN/12
|
||||
========================
|
||||
◎変調方式にrttyモードの追加
|
||||
◎バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.17 2004/JUN/04
|
||||
========================
|
||||
◎マクロ機能の強化
|
||||
◎バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.16 2004/MAR/20
|
||||
========================
|
||||
◎MMTTY/MMSSTVカスタムサウンドの実装
|
||||
◎バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.15 2004/MAR/02
|
||||
========================
|
||||
◎ウォータフォールの色とレベル配分の設定を増設
|
||||
◎バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.14 2004/FEB/28
|
||||
========================
|
||||
◎「全角アルファベットを半角に変換」を追加(設定画面-送信タブ)
|
||||
◎22050,44100,48000Hz系などのクロックの動作を追加
|
||||
◎バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.13 2004/FEB/22
|
||||
========================
|
||||
◎VariSTD/JAの場合に半角のカナが送信できないバグを修正
|
||||
◎受信画面スクロール中の背景色を設定可能にした
|
||||
◎受信画面右クリック(文字がないところ)のポップアップメニューを追加
|
||||
◎マクロのファイルへの保存とロードを追加(ファイルメニュー)
|
||||
◎バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.12 2004/FEB/18
|
||||
========================
|
||||
◎一部のPCで動作しないバグを修正(再挑戦...)
|
||||
◎6000Hz系クロックの動作を追加
|
||||
◎バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.11 2004/FEB/15
|
||||
========================
|
||||
◎一部のPCで動作しないバグを修正(?)
|
||||
◎マクロ機能の強化
|
||||
◎バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.10 2004/FEB/12
|
||||
========================
|
||||
◎バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.09 2004/FEB/09
|
||||
========================
|
||||
◎変調方式にBPSK,bpskモードの追加
|
||||
BPSK - HALPSK,WINPSK/Jとの互換性なし(当面はVariJAは送信禁止にします)
|
||||
bpsk - 従来のSTD-VARICODE(互換性あり)
|
||||
なお、BPSK(bpsk)ははっきり言って作りっぱなしで、まだ一度も
|
||||
本チャンの信号は受けていません...
|
||||
◎振幅成分表示を追加(BPSK変調処理のデバッグ用)
|
||||
スペクトラム左側の「Sync」ボタンを右クリック
|
||||
◎その他、バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.08 2004/FEB/04
|
||||
|
||||
========================
|
||||
◎送信画面の編集操作の改善
|
||||
◎マクロの拡張
|
||||
◎その他、バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.07 2004/JAN/27
|
||||
========================
|
||||
◎RadioCommand(リグコントロール)のPTTが効かなかったバグを修正
|
||||
◎V/UHF帯用にFSK(fm=1.0)を追加(Rigの周波数ドリフト対策)
|
||||
◎その他、バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.06 2004/JAN/23
|
||||
========================
|
||||
◎オプションメニューに「サウンドカード校正画面」を追加
|
||||
◎その他、バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.05 2004/JAN/21
|
||||
========================
|
||||
◎英語のメニューメッセージを追加(Tnx Kim, HL3IB and Sung HL1AQ)
|
||||
◎その他、バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.04 2004/JAN/19
|
||||
========================
|
||||
◎mmvari.txt(現状はメモ程度)を追加
|
||||
◎英語版EProject.txtをパッケージ内に同梱(Tnx JA7UDE)
|
||||
◎その他、バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.03 2004/JAN/15
|
||||
========================
|
||||
◎プログラムの名称を変更(変調方式を変更するかも知れないので)
|
||||
◎日本語のVariCodeインデックス変換方法を変更
|
||||
$E040-$FEFF(難しい漢字)の範囲を$A040からに変更し符合を短くした。
|
||||
◎TX,TXOFFのキーを変更可能にした(設定画面の「送信」タブ)
|
||||
◎その他、バグの修正や小さな改善
|
||||
|
||||
========================
|
||||
BetaVer0.02
|
||||
========================
|
||||
◎サウンドの録音/再生機能(調整用)を追加
|
||||
◎RadioCommandを追加
|
||||
◎ログ機能を追加
|
||||
◎TurboHamlog/Winとのリンク機能を追加
|
||||
◎バグの修正
|
||||
|
||||
========================
|
||||
BetaVer0.01 2004/JAN/09
|
||||
========================
|
||||
◎設定画面「受信」タブにAFC吸い込みレベル(S/N比で設定)を追加
|
||||
◎編集メニューに「文字コード表」を追加
|
||||
◎オプションメニューに「VARICODEの参照」を追加
|
||||
|
||||
========================
|
||||
BetaVer0.00 2004/JAN/08
|
||||
========================
|
||||
◎初期バージョン
|
||||
73
InputWin.cpp
Normal file
73
InputWin.cpp
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
#include <vcl.h>
|
||||
#pragma hdrstop
|
||||
|
||||
#include "InputWin.h"
|
||||
#include "MacroKey.h"
|
||||
#include "ComLib.h"
|
||||
//---------------------------------------------------------------------
|
||||
#pragma resource "*.dfm"
|
||||
//---------------------------------------------------------------------
|
||||
__fastcall TInputWinDlg::TInputWinDlg(TComponent* AOwner)
|
||||
: TForm(AOwner)
|
||||
{
|
||||
FormStyle = ((TForm *)AOwner)->FormStyle;
|
||||
Font->Name = ((TForm *)AOwner)->Font->Name;
|
||||
Font->Charset = ((TForm *)AOwner)->Font->Charset;
|
||||
if( sys.m_MsgEng ){
|
||||
CancelBtn->Caption = "Cancel";
|
||||
}
|
||||
FormCenter(this);
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
int InputMB(LPCSTR pTitle, LPCSTR pMsg, AnsiString &as, BOOL fMac)
|
||||
{
|
||||
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 ? pTitle : "MMVARI";
|
||||
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;
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
int InputMB(LPCSTR pTitle, LPCSTR pMsg, AnsiString &as)
|
||||
{
|
||||
return InputMB(pTitle, pMsg, as, FALSE);
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
|
||||
BIN
InputWin.dfm
Normal file
BIN
InputWin.dfm
Normal file
Binary file not shown.
50
InputWin.h
Normal file
50
InputWin.h
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
#ifndef InputWinH
|
||||
#define InputWinH
|
||||
//----------------------------------------------------------------------------
|
||||
#include <System.hpp>
|
||||
#include <Windows.hpp>
|
||||
#include <SysUtils.hpp>
|
||||
#include <Classes.hpp>
|
||||
#include <Graphics.hpp>
|
||||
#include <StdCtrls.hpp>
|
||||
#include <Forms.hpp>
|
||||
#include <Controls.hpp>
|
||||
#include <Buttons.hpp>
|
||||
#include <ExtCtrls.hpp>
|
||||
//----------------------------------------------------------------------------
|
||||
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, BOOL fMac);
|
||||
int InputMB(LPCSTR pTitle, LPCSTR pMsg, AnsiString &as);
|
||||
//----------------------------------------------------------------------------
|
||||
#endif
|
||||
|
||||
2231
LogConv.cpp
Normal file
2231
LogConv.cpp
Normal file
File diff suppressed because it is too large
Load diff
250
LogConv.h
Normal file
250
LogConv.h
Normal file
|
|
@ -0,0 +1,250 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
#ifndef LogConvH
|
||||
#define LogConvH
|
||||
#include "LogFile.h"
|
||||
|
||||
extern const char *MONT1[];
|
||||
extern const char *MONT2[];
|
||||
extern const char *_BandText[];
|
||||
//*************************************************************
|
||||
// ログ変換の基本クラス
|
||||
//
|
||||
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; // 変換中のファイル名
|
||||
public:
|
||||
__fastcall CLogConv();
|
||||
virtual __fastcall ~CLogConv();
|
||||
virtual int __fastcall IsOpen(void){return m_fp != NULL ? 1 : 0;};
|
||||
virtual int __fastcall Open(LPCSTR pName)=0;
|
||||
virtual int __fastcall Create(LPCSTR pName)=0;
|
||||
virtual int __fastcall Close(void)=0;
|
||||
virtual int __fastcall Read(SDMMLOG *sp)=0;
|
||||
virtual int __fastcall Write(SDMMLOG *sp)=0;
|
||||
};
|
||||
|
||||
#define TEXTCONVMAX 64
|
||||
typedef struct {
|
||||
int w;
|
||||
AnsiString Key;
|
||||
}TCONV;
|
||||
|
||||
//*************************************************************
|
||||
// テキストファイルアクセスのクラス
|
||||
//
|
||||
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]; // ファイルバッファ
|
||||
|
||||
private:
|
||||
int __fastcall Text2MMLOG(SDMMLOG *sp, LPSTR p, int &err);
|
||||
void __fastcall MMLOG2Text(LPSTR t, SDMMLOG *sp);
|
||||
|
||||
public:
|
||||
__fastcall CLogText();
|
||||
virtual int __fastcall Open(LPCSTR pName);
|
||||
virtual int __fastcall Create(LPCSTR pName);
|
||||
virtual int __fastcall Close(void);
|
||||
virtual int __fastcall Read(SDMMLOG *sp);
|
||||
virtual int __fastcall Write(SDMMLOG *sp);
|
||||
|
||||
};
|
||||
|
||||
void __fastcall MMLOG2Text(LPSTR t, SDMMLOG *sp, AnsiString &Key);
|
||||
int __fastcall Text2MMLOG(SDMMLOG *sp, LPCSTR s, AnsiString &Key);
|
||||
extern const LPCSTR ConvTbl[];
|
||||
extern CLogText LogText;
|
||||
|
||||
//*************************************************************
|
||||
// LOG200ファイルアクセスのクラス
|
||||
//
|
||||
#define LOG200WIDTH 200
|
||||
class CLog200 : public CLogConv
|
||||
{
|
||||
public:
|
||||
int m_Index;
|
||||
int m_err;
|
||||
protected:
|
||||
char m_bf[200]; // ファイルバッファ
|
||||
private:
|
||||
public:
|
||||
__fastcall CLog200();
|
||||
virtual int __fastcall Open(LPCSTR pName);
|
||||
virtual int __fastcall Create(LPCSTR pName);
|
||||
virtual int __fastcall Close(void);
|
||||
virtual int __fastcall Read(SDMMLOG *sp);
|
||||
virtual int __fastcall Write(SDMMLOG *sp);
|
||||
};
|
||||
|
||||
//*************************************************************
|
||||
// HAMLOGファイルアクセスのクラス
|
||||
//
|
||||
#pragma option -a- // パックの指示
|
||||
typedef struct {
|
||||
char Memo; // 03h=メモフィールド無し 83h=メモフィールド有り(HAMLOGでは 1Ah)
|
||||
char YY, MM, DD; // 最終更新年月日
|
||||
long Max; // レコード件数
|
||||
WORD HeadLen; // ヘッダの長さ(HAMLOG.DBSは 449)
|
||||
WORD DataLen; // レコードの長さ(HAMLOG.DBSは 58)
|
||||
char dummy[20]; // 00h
|
||||
}DBSHD;
|
||||
|
||||
typedef struct {
|
||||
char Memo; // 03h=メモフィールド無し 83h=メモフィールド有り(HAMLOGでは 1Ah)
|
||||
char YY, MM, DD; // 最終更新年月日
|
||||
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]; /* 削除マーク */
|
||||
char calls[7]; /* コールサイン */
|
||||
char potbl[3]; /* 移動エリア */
|
||||
char code[6]; /* JCCコード */
|
||||
char glid[6]; /* グリッドロケーター */
|
||||
char freq[4]; /* 周波数 */
|
||||
char mode[3]; /* モード */
|
||||
char name[12]; /* 氏名 */
|
||||
char qsl [1]; /* QSL via */
|
||||
char send[1]; /* QSL SEND */
|
||||
char rcv[1]; /* QSL RCV */
|
||||
char date[3]; /* 日付 */
|
||||
char time[2]; /* 時間 */
|
||||
char hiss[2]; /* HIS RST */
|
||||
char myrs[2]; /* MY RST */
|
||||
long ofs; /* HAMLOG.DBR オフセットアドレス */
|
||||
}SDHAMLOG;
|
||||
|
||||
typedef struct { /* DBRのフィールド位置データ */
|
||||
BYTE LenQTH;
|
||||
BYTE LenREM1;
|
||||
BYTE LenREM2;
|
||||
}FHDDBR;
|
||||
#pragma option -a. // パック解除の指示
|
||||
|
||||
class CHamLog : public CLogConv
|
||||
{
|
||||
public:
|
||||
int m_Index;
|
||||
int m_err;
|
||||
protected:
|
||||
DBSHD m_hd; // DBSヘッダ
|
||||
SDHAMLOG m_RecBuf; // レコードバッファ
|
||||
|
||||
AnsiString m_DBRName; // DBRファイルの名前
|
||||
FILE *m_dbrfp; // DBRファイルのファイルポインタ
|
||||
DBRHD m_dbrhd; // DBRヘッダ
|
||||
private:
|
||||
int __fastcall Seek(DWORD Index);
|
||||
BOOL __fastcall MakeHD(void);
|
||||
|
||||
public:
|
||||
__fastcall CHamLog();
|
||||
virtual int __fastcall Open(LPCSTR pName);
|
||||
virtual int __fastcall Create(LPCSTR pName);
|
||||
virtual int __fastcall Close(void);
|
||||
virtual int __fastcall Read(SDMMLOG *sp);
|
||||
virtual int __fastcall Write(SDMMLOG *sp);
|
||||
};
|
||||
|
||||
void __fastcall HAMLOGtoMMLOG(SDMMLOG *sp, SDHAMLOG *hp, FILE *dbrfp);
|
||||
int __fastcall MMLOGtoHAMLOG(SDHAMLOG *hp, SDMMLOG *sp, FILE *dbrfp);
|
||||
void __fastcall AddMMLOGKey(AnsiString &REM1, AnsiString &REM2, LPCSTR s, LPCSTR pKey);
|
||||
void __fastcall SetMMLOGKey(SDMMLOG *sp, LPSTR bf);
|
||||
void __fastcall SpaceCopy(LPSTR t, LPCSTR s, int n);
|
||||
|
||||
//*************************************************************
|
||||
// ADIFアクセスのクラス
|
||||
//
|
||||
class CLogADIF : public CLogConv
|
||||
{
|
||||
public:
|
||||
protected:
|
||||
char m_bf[1024]; // ファイルバッファ
|
||||
LPSTR m_p;
|
||||
int m_conv;
|
||||
private:
|
||||
void __fastcall MMLOG2ADIF(LPSTR t, SDMMLOG *sp);
|
||||
void __fastcall SetData(SDMMLOG *sp, LPCSTR pKey, LPSTR pData);
|
||||
void __fastcall AdjustData(SDMMLOG *sp);
|
||||
void OutF(int &col, FILE *fp, LPCSTR fmt, ...);
|
||||
|
||||
public:
|
||||
__fastcall CLogADIF();
|
||||
virtual int __fastcall Open(LPCSTR pName);
|
||||
virtual int __fastcall Create(LPCSTR pName);
|
||||
virtual int __fastcall Close(void);
|
||||
virtual int __fastcall Read(SDMMLOG *sp);
|
||||
virtual int __fastcall Write(SDMMLOG *sp);
|
||||
|
||||
};
|
||||
|
||||
//*************************************************************
|
||||
// Cabrillo アクセスのクラス
|
||||
//
|
||||
class CLogCabrillo : public CLogConv
|
||||
{
|
||||
public:
|
||||
protected:
|
||||
char m_bf[1024]; // ファイルバッファ
|
||||
LPSTR m_p;
|
||||
AnsiString m_SNR;
|
||||
private:
|
||||
void __fastcall MMLOG2Cabrillo(LPSTR t, SDMMLOG *sp);
|
||||
void __fastcall AdjustData(SDMMLOG *sp);
|
||||
|
||||
public:
|
||||
__fastcall CLogCabrillo();
|
||||
virtual int __fastcall Open(LPCSTR pName);
|
||||
virtual int __fastcall Create(LPCSTR pName);
|
||||
virtual int __fastcall Close(void);
|
||||
virtual int __fastcall Read(SDMMLOG *sp);
|
||||
virtual int __fastcall Write(SDMMLOG *sp);
|
||||
};
|
||||
|
||||
#endif
|
||||
1667
LogFile.cpp
Normal file
1667
LogFile.cpp
Normal file
File diff suppressed because it is too large
Load diff
280
LogFile.h
Normal file
280
LogFile.h
Normal file
|
|
@ -0,0 +1,280 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
#ifndef LogFileH
|
||||
#define LogFileH
|
||||
|
||||
#include "ComLib.h"
|
||||
//---------------------------------------------------------------------------
|
||||
#define MMLOGID "MMLOG DATA Ver1.00\032"
|
||||
|
||||
extern const char *_band[];
|
||||
|
||||
typedef struct { // Logの動作オプション
|
||||
char m_TimeZone; // 表示用タイムゾーン
|
||||
|
||||
int m_UpperName; // 大文字への変換
|
||||
int m_UpperQTH; // 大文字への変換
|
||||
int m_UpperREM; // 大文字への変換
|
||||
int m_UpperQSL; // 大文字への変換
|
||||
|
||||
int m_DefMyRST; // 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; // 自動セーブ
|
||||
|
||||
int m_QSOMacroFlag; // 0-OFF, 1-ON
|
||||
int m_CheckBand; // 同一バンドでの重複をチェック
|
||||
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;
|
||||
AnsiString m_THGMSK;
|
||||
int m_THTZ;
|
||||
int m_ClipRSTADIF;
|
||||
int m_DateType;
|
||||
|
||||
int m_Backup; // バックアップ作成
|
||||
|
||||
BYTE m_Hamlog5Len[17];
|
||||
}LOGSET;
|
||||
|
||||
#define MLCALL 16 /* コールサインの長さ */
|
||||
#define MLRST 20 /* RSTナンバの長さ */
|
||||
#define MLREM 56 /* 記事の長さ */
|
||||
#define MLNAME 16 /* 名前の長さ */
|
||||
#define MLQTH 28 /* QTHの長さ */
|
||||
#define MLQSL 54 /* QSLの長さ */
|
||||
#define MLPOW 4 /* 電力 */
|
||||
#define MLOPT 8 /* オプション */
|
||||
|
||||
#define MODEMAX 48
|
||||
|
||||
#define YEAR(c) (((c)<50)?(2000+(c)):(1900+(c)))
|
||||
|
||||
#pragma option -a- // パックの指示
|
||||
typedef struct { /* MMLOGデータ形式 */
|
||||
BYTE year; /* 年 */
|
||||
WORD date; /* 日付 */
|
||||
WORD btime; /* 開始時刻 */
|
||||
WORD etime; /* 終了時刻 */
|
||||
char call[MLCALL+1]; /* コールサイン */
|
||||
char ur[MLRST+1]; /* T リポート */
|
||||
char my[MLRST+1]; /* R リポート */
|
||||
BYTE band; /* バンド */
|
||||
SHORT fq; /* 周波数 */
|
||||
BYTE mode; /* モード */
|
||||
char pow[MLPOW+1]; /* 電力 */
|
||||
char name[MLNAME+1]; /* 名前 */
|
||||
char qth[MLQTH+1]; /* QTH */
|
||||
char qsl[MLQSL+1]; /* QSL */
|
||||
char send; /* QSL 送信 */
|
||||
char recv; /* QSL 受信 */
|
||||
char cq; /* cq/call */
|
||||
WORD env; /* 自局環境 */
|
||||
char rem[MLREM+1]; /* 記事 */
|
||||
char opt1[MLOPT+1]; /* オプション */
|
||||
char opt2[MLOPT+1]; /* オプション2 */
|
||||
}SDMMLOG;
|
||||
|
||||
#define FHDOFF 256 /* 先頭のヘッダのオフセット */
|
||||
#define UMODEMAX 32
|
||||
typedef struct {
|
||||
char id[20]; /* ファイルバージョン */
|
||||
char dmy[4]; /* ダミー領域 */
|
||||
USHORT mlt; /* マルチ情報のサイズ */
|
||||
char td; /* 時差コード */
|
||||
char hash; /* ハッシュデータ格納フラグ */
|
||||
long size; /* データサイズ */
|
||||
char master; /* マスターファイルフラグ */
|
||||
char dm2[15]; /* ダミー2 */
|
||||
char mode[UMODEMAX][6]; /* ユーザ定義モード */
|
||||
}FHD;
|
||||
#pragma option -a. // パック解除の指示
|
||||
|
||||
class CIndex
|
||||
{
|
||||
private:
|
||||
int m_IndexMax; // 確保中のインデックスの数
|
||||
int m_IndexCnt; // 現在のインデックスの数
|
||||
LPSTR pIndex; // インデックス領域のポインタ(16バイトインデックス)
|
||||
BYTE *pMult; // マルチ情報のポインタ
|
||||
public:
|
||||
__fastcall CIndex();
|
||||
__fastcall ~CIndex();
|
||||
void __fastcall AllocIndex(int n);
|
||||
void __fastcall ClearIndex(void);
|
||||
void __fastcall WriteIndex(LPCSTR pCall, int n);
|
||||
void __fastcall ReadIndex(LPSTR pCall, int n);
|
||||
LPSTR __fastcall PointIndex(int n);
|
||||
void __fastcall AddBlock(LPCSTR p, int len);
|
||||
int __fastcall ReadIndex(int handle, FHD *hp);
|
||||
void __fastcall MakeIndex(int handle, FHD *hp);
|
||||
int __fastcall 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:
|
||||
__fastcall CLogFind();
|
||||
__fastcall ~CLogFind();
|
||||
inline int __fastcall GetCount(void){return m_FindCnt;};
|
||||
inline void __fastcall Clear(void){
|
||||
m_FindCnt = m_FindCmp1Max = m_FindCmp2Max = m_FindStr1Max = m_FindStr2Max = 0;
|
||||
};
|
||||
int __fastcall Add(int n);
|
||||
void __fastcall Ins(int n);
|
||||
|
||||
inline void __fastcall Write(int n){
|
||||
pFindTbl[m_FindCnt] = n;
|
||||
m_FindCnt++;
|
||||
};
|
||||
inline void __fastcall SetText(LPCSTR p){
|
||||
if( p != m_FindStr.c_str() ){
|
||||
m_FindStr = p;
|
||||
}
|
||||
};
|
||||
inline LPCSTR __fastcall GetText(void){
|
||||
return m_FindStr.c_str();
|
||||
};
|
||||
inline void __fastcall ClearText(void){
|
||||
m_FindStr = "";
|
||||
};
|
||||
};
|
||||
|
||||
class CLogFile
|
||||
{
|
||||
private:
|
||||
int m_Open; // オープンフラグ
|
||||
int m_EditFlag; // 編集フラグ
|
||||
int m_Handle; // ファイルハンドル
|
||||
CIndex m_Index; // 現在オープン中のインデックス
|
||||
FHD m_fhd; // 現在オープン中のファイルヘッダ
|
||||
AnsiString m_Name; // ログファイルの名前
|
||||
char m_modebuf[8];
|
||||
public:
|
||||
AnsiString m_FileName; // ログファイルの名前(フルパス)
|
||||
|
||||
int m_CurNo;
|
||||
int m_CurChg;
|
||||
SDMMLOG m_sd;
|
||||
SDMMLOG m_bak;
|
||||
SDMMLOG m_asd;
|
||||
|
||||
CLogFind m_Find; // カレント検索データ
|
||||
LOGSET m_LogSet;
|
||||
private:
|
||||
void __fastcall SetHisRST(SDMMLOG *sp);
|
||||
void __fastcall InitHeader(void);
|
||||
|
||||
public:
|
||||
__fastcall CLogFile();
|
||||
__fastcall ~CLogFile();
|
||||
|
||||
void __fastcall DoBackup(void);
|
||||
|
||||
int __fastcall Open(LPCSTR pName, BOOL fNew);
|
||||
int __fastcall Close(void);
|
||||
|
||||
void __fastcall ReadIniFile(LPCSTR pKey, TMemIniFile *pIniFile);
|
||||
void __fastcall WriteIniFile(LPCSTR pKey, TMemIniFile *pIniFile);
|
||||
|
||||
void __fastcall MakeIndex(void);
|
||||
|
||||
inline int __fastcall IsEdit(void){return m_EditFlag;};
|
||||
void __fastcall MakePathName(LPCSTR pName);
|
||||
void __fastcall MakeName(LPCSTR pName);
|
||||
inline LPCSTR __fastcall GetName(void){return m_Name.c_str();};
|
||||
|
||||
inline int __fastcall GetCount(void){return m_fhd.size;};
|
||||
inline int __fastcall IsOpen(void){return m_Open;};
|
||||
int __fastcall GetData(SDMMLOG *sp, int n);
|
||||
int __fastcall PutData(SDMMLOG *sp, int n);
|
||||
|
||||
LPCSTR __fastcall GetDateString(SDMMLOG *sp, int sw);
|
||||
inline LPCSTR __fastcall GetDateString(SDMMLOG *sp){ return GetDateString(sp, m_LogSet.m_DateType); };
|
||||
LPCSTR __fastcall GetTimeString(WORD d);
|
||||
|
||||
|
||||
LPCSTR __fastcall GetModeString(BYTE m);
|
||||
void __fastcall SetMode(SDMMLOG *sp, LPCSTR s);
|
||||
|
||||
LPCSTR __fastcall GetFreqString(BYTE b, short fq);
|
||||
void __fastcall SetFreq(SDMMLOG *sp, LPCSTR p);
|
||||
LPCSTR __fastcall GetOptStr(int n, SDMMLOG *sp);
|
||||
void __fastcall SetOptStr(int n, SDMMLOG *sp, LPCSTR pOpt);
|
||||
|
||||
void __fastcall CopyAF(void);
|
||||
|
||||
void __fastcall SortDate(int bb, int eb);
|
||||
int __fastcall FindSameBand(BOOL fMode);
|
||||
int __fastcall FindSameDate(void);
|
||||
|
||||
void __fastcall FindStrSet(CLogFind *fp, LPCSTR pCall);
|
||||
int __fastcall FindCmpSet(CLogFind *fp, LPCSTR pCall);
|
||||
int __fastcall FindClipSet(CLogFind *fp, LPCSTR pCall);
|
||||
int __fastcall FindSet(CLogFind *fp, LPCSTR pCall);
|
||||
int __fastcall Find(LPCSTR pCall, int b, int dir);
|
||||
int __fastcall IsAlready(LPCSTR pCall);
|
||||
void __fastcall DeleteAll(void);
|
||||
void __fastcall DeleteLast(void);
|
||||
void __fastcall Delete(int top, int end);
|
||||
void __fastcall Insert(int n, SDMMLOG *sp);
|
||||
|
||||
void __fastcall InitCur(void);
|
||||
void __fastcall SetLastPos(void);
|
||||
|
||||
int __fastcall ReadAscii(SDMMLOG *sp, LPSTR p);
|
||||
|
||||
};
|
||||
|
||||
void __fastcall JSTtoUTC(int &Year, int &Mon, int &Day, int &Hour);
|
||||
void __fastcall JSTtoUTC(SDMMLOG *sp);
|
||||
void __fastcall UTCtoJST(int &Year, int &Mon, int &Day, int &Hour);
|
||||
void __fastcall UTCtoJST(SDMMLOG *sp);
|
||||
void __fastcall UTCtoJST(SYSTEMTIME *tp);
|
||||
void __fastcall mBandToBand(SDMMLOG *sp, LPCSTR p);
|
||||
LPCSTR __fastcall FreqTomBand(SDMMLOG *sp);
|
||||
int __fastcall GetLMode(BYTE m);
|
||||
|
||||
extern CLogFile Log;
|
||||
extern const char MONN[];
|
||||
extern const char MONU[];
|
||||
#endif
|
||||
|
||||
1018
LogList.cpp
Normal file
1018
LogList.cpp
Normal file
File diff suppressed because it is too large
Load diff
BIN
LogList.dfm
Normal file
BIN
LogList.dfm
Normal file
Binary file not shown.
150
LogList.h
Normal file
150
LogList.h
Normal file
|
|
@ -0,0 +1,150 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
#ifndef LogListH
|
||||
#define LogListH
|
||||
//----------------------------------------------------------------------------
|
||||
/* JA7UDE 0428
|
||||
#include <vcl\System.hpp>
|
||||
#include <vcl\Windows.hpp>
|
||||
#include <vcl\SysUtils.hpp>
|
||||
#include <vcl\Classes.hpp>
|
||||
#include <vcl\Graphics.hpp>
|
||||
#include <vcl\StdCtrls.hpp>
|
||||
#include <vcl\Forms.hpp>
|
||||
#include <vcl\Controls.hpp>
|
||||
#include <vcl\Buttons.hpp>
|
||||
#include <vcl\ExtCtrls.hpp>
|
||||
*/
|
||||
//----------------------------------------------------------------------------
|
||||
#include "LogFile.h"
|
||||
#include <Grids.hpp> //JA7UDE 0428
|
||||
#include <Menus.hpp>
|
||||
#include <Dialogs.hpp>
|
||||
//----------------------------------------------------------------------------
|
||||
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 *N6;
|
||||
TMenuItem *KReIndex;
|
||||
TMenuItem *N7;
|
||||
TMenuItem *KExport;
|
||||
TMenuItem *KImport;
|
||||
TMenuItem *KImportLog200;
|
||||
TMenuItem *KExportLog200;
|
||||
TMenuItem *KImportHamlog;
|
||||
TMenuItem *KExportHamlog;
|
||||
TMenuItem *KLogOpt;
|
||||
TMenuItem *KOpt;
|
||||
TMenuItem *KExportADIF;
|
||||
TMenuItem *KImportADIF;
|
||||
TMenuItem *KExportCabrillo;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 KReIndexClick(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);
|
||||
void __fastcall GridDrawCell(TObject *Sender, int Col, int Row,
|
||||
TRect &Rect, TGridDrawState State);
|
||||
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 LoadLog200(LPCSTR pName);
|
||||
int __fastcall SaveLog200(LPCSTR pName);
|
||||
int __fastcall LoadHamLog(LPCSTR pName);
|
||||
int __fastcall LoadHamLog5(LPCSTR pName);
|
||||
int __fastcall SaveHamLog(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
|
||||
253
LogSet.cpp
Normal file
253
LogSet.cpp
Normal file
|
|
@ -0,0 +1,253 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
#include <vcl.h>
|
||||
#pragma hdrstop
|
||||
|
||||
#include "LogSet.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 = 1;
|
||||
FormStyle = ((TForm *)AOwner)->FormStyle;
|
||||
Font->Name = ((TForm *)AOwner)->Font->Name;
|
||||
Font->Charset = ((TForm *)AOwner)->Font->Charset;
|
||||
if( sys.m_MsgEng ){
|
||||
TabConv->Caption = "Conversion";
|
||||
TabMisc->Caption = "Misc";
|
||||
CancelBtn->Caption = "Cancel";
|
||||
Caption = "Setup Logging";
|
||||
TabFlag->Caption = "Input";
|
||||
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";
|
||||
|
||||
RGDupe->Caption = "Dupe Check (Show Red)";
|
||||
RGDupe->Items->Strings[0] = "Callsign only";
|
||||
RGDupe->Items->Strings[1] = "Hit on the same band";
|
||||
RGDupe->Items->Strings[2] = "Same band and same mode";
|
||||
AutoZone->Caption = "Ignore daylight saving";
|
||||
CBBackup->Caption = "Make backup";
|
||||
CBRemC->Visible = FALSE;
|
||||
|
||||
GB3->Caption = "Link";
|
||||
RGLink->Caption = "Application";
|
||||
|
||||
GrpConv->Hint = "";
|
||||
GB1->Hint = "";
|
||||
RGLink->Hint = "Set linking Log program";
|
||||
CBPoll->Hint = "Get FREQ information from the Log program";
|
||||
CBPTT->Hint = "PTT controls via the Log program";
|
||||
GTime->Hint = "";
|
||||
AutoSave->Hint = "Flush(Save) Log file at the every QSO";
|
||||
CBBackup->Hint = "";
|
||||
RGDupe->Hint = "";
|
||||
|
||||
GB9->Caption = "Mode";
|
||||
}
|
||||
else {
|
||||
LLink->Caption = "Hamlogの環境設定-設定1で\r\n「交信履歴表示で一旦停止」のチェックは付けないで下さい.";
|
||||
}
|
||||
if( sys.m_LCID == 0x0412 ){ // LANG_KOREAN
|
||||
TimeZone->Items->Strings[0] = "Korea";
|
||||
}
|
||||
else {
|
||||
TimeZone->Items->Strings[0] = "Japan";
|
||||
}
|
||||
m_MMList.QueryList("MML");
|
||||
for( int i = 0; i < m_MMList.GetCount(); i++ ){
|
||||
CBMMLink->Items->Add(m_MMList.GetItemName(i));
|
||||
}
|
||||
FormCenter(this);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TLogSetDlg::DisplayHint(TObject *Sender)
|
||||
{
|
||||
LH->Caption = GetLongHint(Application->Hint);
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
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 ? TRUE : FALSE;
|
||||
if( !sys.m_MsgEng ){
|
||||
LLink->Visible = (RGLink->ItemIndex == 1) ? TRUE : FALSE;
|
||||
}
|
||||
CBMMLink->Enabled = (RGLink->ItemIndex == 2) ? TRUE : FALSE;
|
||||
LT->Enabled = CBMMLink->Enabled;
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
int __fastcall TLogSetDlg::Execute(void)
|
||||
{
|
||||
// int 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;
|
||||
|
||||
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;
|
||||
CBBackup->Checked = Log.m_LogSet.m_Backup;
|
||||
CBRemC->Checked = Log.m_LogSet.m_CopyREMB4;
|
||||
|
||||
if( Log.m_LogSet.m_TimeZone != 'I' ){
|
||||
TimeZone->ItemIndex = 1;
|
||||
}
|
||||
else {
|
||||
TimeZone->ItemIndex = 0;
|
||||
}
|
||||
AutoSave->Checked = Log.m_LogSet.m_AutoSave;
|
||||
RGDupe->ItemIndex = Log.m_LogSet.m_CheckBand;
|
||||
|
||||
THRTTY->Text = Log.m_LogSet.m_THRTTY;
|
||||
THSSTV->Text = Log.m_LogSet.m_THSSTV;
|
||||
THGMSK->Text = Log.m_LogSet.m_THGMSK;
|
||||
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];
|
||||
}
|
||||
UpdateUI();
|
||||
m_DisEvent = 0;
|
||||
m_fnHintProc = Application->OnHint;
|
||||
Application->OnHint = DisplayHint;
|
||||
int r = ShowModal();
|
||||
Application->OnHint = m_fnHintProc;
|
||||
PageIndex = GetActiveIndex(Page);
|
||||
if( r == 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_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;
|
||||
|
||||
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_CheckBand = RGDupe->ItemIndex;
|
||||
|
||||
Log.m_LogSet.m_THRTTY = THRTTY->Text;
|
||||
Log.m_LogSet.m_THSSTV = THSSTV->Text;
|
||||
Log.m_LogSet.m_THGMSK = THGMSK->Text;
|
||||
Log.m_LogSet.m_THTZ = THTZ->ItemIndex;
|
||||
Log.m_LogSet.m_ClipRSTADIF = ClipRSTADIF->Checked;
|
||||
Log.m_LogSet.m_DateType = DateType->ItemIndex;
|
||||
Log.m_LogSet.m_Backup = CBBackup->Checked;
|
||||
|
||||
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;
|
||||
}
|
||||
else {
|
||||
r = FALSE;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
void __fastcall TLogSetDlg::ClearOffClick(TObject *Sender)
|
||||
{
|
||||
UDOffset->Position = 0;
|
||||
UDMin->Position = 0;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TLogSetDlg::AutoZoneClick(TObject *Sender)
|
||||
{
|
||||
if( AutoZone->Checked ){
|
||||
int hour, min;
|
||||
SetTimeOffsetInfo(hour, min);
|
||||
UDOffset->Position = short(hour);
|
||||
UDMin->Position = short(min);
|
||||
}
|
||||
UpdateUI();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TLogSetDlg::RGLinkClick(TObject *Sender)
|
||||
{
|
||||
if( m_DisEvent ) return;
|
||||
|
||||
UpdateUI();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
BIN
LogSet.dfm
Normal file
BIN
LogSet.dfm
Normal file
Binary file not shown.
131
LogSet.h
Normal file
131
LogSet.h
Normal file
|
|
@ -0,0 +1,131 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
#ifndef LogSetH
|
||||
#define LogSetH
|
||||
//----------------------------------------------------------------------------
|
||||
/* JA7UDE 0428
|
||||
#include <vcl\System.hpp>
|
||||
#include <vcl\Windows.hpp>
|
||||
#include <vcl\SysUtils.hpp>
|
||||
#include <vcl\Classes.hpp>
|
||||
#include <vcl\Graphics.hpp>
|
||||
#include <vcl\StdCtrls.hpp>
|
||||
#include <vcl\Forms.hpp>
|
||||
#include <vcl\Controls.hpp>
|
||||
#include <vcl\Buttons.hpp>
|
||||
#include <vcl\ExtCtrls.hpp>
|
||||
#include <vcl\ComCtrls.hpp>
|
||||
*/
|
||||
//----------------------------------------------------------------------------
|
||||
#include "LogFile.h"
|
||||
#include "MMLink.h"
|
||||
#include <Classes.hpp>
|
||||
#include <ComCtrls.hpp>
|
||||
#include <Controls.hpp>
|
||||
#include <ExtCtrls.hpp>
|
||||
#include <StdCtrls.hpp>
|
||||
//----------------------------------------------------------------------------
|
||||
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;
|
||||
TRadioGroup *CopyHis;
|
||||
TRadioGroup *CopyFreq;
|
||||
TGroupBox *GB5;
|
||||
TCheckBox *DefMyRST;
|
||||
TRadioGroup *TimeZone;
|
||||
TTabSheet *TabConv;
|
||||
TGroupBox *GB1;
|
||||
TGroupBox *GB2;
|
||||
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;
|
||||
TGroupBox *GB3;
|
||||
TRadioGroup *RGLink;
|
||||
TCheckBox *CBPoll;
|
||||
TRadioGroup *THTZ;
|
||||
TRadioGroup *RGDupe;
|
||||
TLabel *LLink;
|
||||
TCheckBox *CBRemC;
|
||||
TComboBox *CBMMLink;
|
||||
TLabel *LT;
|
||||
TCheckBox *CBBackup;
|
||||
TLabel *LH;
|
||||
TCheckBox *CBPTT;
|
||||
TGroupBox *GB9;
|
||||
TLabel *Label2;
|
||||
TEdit *THRTTY;
|
||||
TLabel *Label3;
|
||||
TEdit *THSSTV;
|
||||
TLabel *L10;
|
||||
TEdit *THGMSK;
|
||||
void __fastcall ClearOffClick(TObject *Sender);
|
||||
void __fastcall AutoZoneClick(TObject *Sender);
|
||||
|
||||
|
||||
|
||||
void __fastcall RGLinkClick(TObject *Sender);
|
||||
|
||||
private:
|
||||
int m_DisEvent;
|
||||
TNotifyEvent m_fnHintProc;
|
||||
// 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);
|
||||
void __fastcall DisplayHint(TObject *Sender);
|
||||
|
||||
int __fastcall Execute(void);
|
||||
|
||||
};
|
||||
//----------------------------------------------------------------------------
|
||||
//extern TLogSetDlg *LogSetDlg;
|
||||
//----------------------------------------------------------------------------
|
||||
#endif
|
||||
866
Loglink.cpp
Normal file
866
Loglink.cpp
Normal file
|
|
@ -0,0 +1,866 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
#include <vcl.h>
|
||||
#pragma hdrstop
|
||||
|
||||
#include "LogLink.h"
|
||||
CLogLink LogLink;
|
||||
//---------------------------------------------------------------------------
|
||||
// CLogLinkクラス
|
||||
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;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
// 送信用ウインドウハンドルの設定
|
||||
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;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
// リンクの許可設定
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
// コールサインを分離
|
||||
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では表現できない表記の場合
|
||||
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") ){
|
||||
StrCopy(bf, Log.m_LogSet.m_THGMSK.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");
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
// MM -> HamLog フォーマットの一括変換
|
||||
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では表現できない表記の場合
|
||||
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 ){
|
||||
#if 1
|
||||
SetHamlogMode(bf);
|
||||
#else
|
||||
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") ){
|
||||
StrCopy(bf, Log.m_LogSet.m_THGMSK.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");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
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);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
// ウインドウフォーカスを自身に戻す
|
||||
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);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
// ログのリンクのチェック
|
||||
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;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
// 定期的なログのリンクの監視(200ms毎にコール)
|
||||
BOOL CLogLink::TimerLogLink(void)
|
||||
{
|
||||
if( !m_Enabled ) return FALSE;
|
||||
|
||||
if( !m_Count ){
|
||||
m_Count = 5000/LINKINTERVAL; // 5[s]毎のチェック
|
||||
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;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
// 定期的な周波数ポーリング
|
||||
void CLogLink::EventGetFreq(void)
|
||||
{
|
||||
if( !m_Polling ) return;
|
||||
|
||||
if( !m_Count2 ){
|
||||
m_Count2 = 2000/LINKINTERVAL; // 2[s]毎のチェック
|
||||
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--;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
// 周波数の設定
|
||||
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;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
// モードの設定
|
||||
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;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
// クリア
|
||||
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にフォーカスを設定
|
||||
void CLogLink::SetFocus(void)
|
||||
{
|
||||
if( m_Enabled != 1 ) return;
|
||||
if( m_hLog == NULL ) return;
|
||||
if( m_hLogIn == NULL ) return;
|
||||
|
||||
::SetForegroundWindow(m_hLogIn);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
// コールサインの転送
|
||||
void CLogLink::SetCall(LPSTR pCall, int sw)
|
||||
{
|
||||
if( !CheckLink() ) return;
|
||||
|
||||
switch(m_Enabled){
|
||||
case 1:
|
||||
{
|
||||
if( m_hLog == NULL ) return;
|
||||
int af = Application->Active;
|
||||
Clear();
|
||||
OnWave();
|
||||
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));
|
||||
OnWave();
|
||||
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;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
// コールサインの検索
|
||||
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;
|
||||
OnWave();
|
||||
|
||||
OnWave();
|
||||
m_cds.dwData = 17;
|
||||
m_cds.cbData = 0;
|
||||
m_cds.lpData = NULL;
|
||||
::SendMessage(m_hLog, WM_COPYDATA, WPARAM(m_hApp), LPARAM(&m_cds));
|
||||
OnWave();
|
||||
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;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
// ログの記録
|
||||
// 0-データの設定のみ
|
||||
// 1-データの設定とRETキー/問い合わせの実行(QSOの開始時)
|
||||
// 2-書きこみを実行(QSOの終了時)
|
||||
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));
|
||||
OnWave();
|
||||
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からの返信メッセージから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 ){ // 周波数情報
|
||||
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);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
123
Loglink.h
Normal file
123
Loglink.h
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
#ifndef LogLinkH
|
||||
#define LogLinkH
|
||||
|
||||
#include <sys\stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
|
||||
#include "ComLib.h"
|
||||
#include "LogConv.h"
|
||||
#include "MMLink.h"
|
||||
|
||||
#define LINKINTERVAL 1000
|
||||
//
|
||||
//------------ 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クラス
|
||||
class CLogLink
|
||||
{
|
||||
private:
|
||||
int m_Enabled; // リンクの許可
|
||||
int m_Polling; // 周波数ポーリング
|
||||
BOOL m_PTTEnabled; // PTTコントロール
|
||||
BOOL m_1stSession;
|
||||
|
||||
HWND m_hLog; // Hamlogプログラムのハンドル
|
||||
HWND m_hLogIn; // Hamlog入力ウインドウのハンドル
|
||||
|
||||
COPYDATASTRUCT m_cds; // インターフェース構造体
|
||||
int m_Count; // 監視カウンタ
|
||||
int m_CStat; // 状態変更セマフォ
|
||||
int m_Count2; // ポーリングカウンタ
|
||||
|
||||
HWND m_hMain; // メイン画面のウインドウハンドル
|
||||
HWND m_hApp; // アプリケーションのウインドウハンドル
|
||||
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
|
||||
|
||||
408
MMLink.cpp
Normal file
408
MMLink.cpp
Normal file
|
|
@ -0,0 +1,408 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
#include <vcl.h>
|
||||
#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", sys.m_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();
|
||||
}
|
||||
|
||||
154
MMLink.h
Normal file
154
MMLink.h
Normal file
|
|
@ -0,0 +1,154 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
#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;
|
||||
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
|
||||
105
MMVARI.BPR
Normal file
105
MMVARI.BPR
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
<?xml version='1.0' encoding='utf-8' ?>
|
||||
<!-- C++Builder XML Project -->
|
||||
<PROJECT>
|
||||
<MACROS>
|
||||
<VERSION value="BCB.05.03"/>
|
||||
<PROJECT value="MMVARI.exe"/>
|
||||
<OBJFILES value="MMVARI.obj mfsk.obj CLX.obj DSP.obj Main.obj Wave.obj Fft.obj ComLib.obj
|
||||
Dump.obj MacEdit.obj FreqDisp.obj Comm.obj Option.obj MacroKey.obj
|
||||
FEdit.obj VerDsp.obj CodeVw.obj InputWin.obj PlayDlg.obj LogSet.obj
|
||||
LogFile.obj Loglink.obj LogList.obj MMLink.obj LogConv.obj country.obj
|
||||
Qsodlg.obj Mmcg.obj MmcgDlg.obj RadioSet.obj cradio.obj RxView.obj
|
||||
ClockAdj.obj TrackDlg.obj Test.obj Hamlog5.obj TH5Len.obj RMenuDlg.obj"/>
|
||||
<RESFILES value="mmvari.res"/>
|
||||
<IDLFILES value=""/>
|
||||
<DEFFILE value=""/>
|
||||
<RESDEPEN value="$(RESFILES) Main.dfm MacEdit.dfm FreqDisp.dfm Option.dfm MacroKey.dfm
|
||||
FEdit.dfm VerDsp.dfm CodeVw.dfm InputWin.dfm PlayDlg.dfm LogSet.dfm
|
||||
LogList.dfm Qsodlg.dfm MmcgDlg.dfm RadioSet.dfm RxView.dfm ClockAdj.dfm
|
||||
TrackDlg.dfm Test.dfm TH5Len.dfm RMenuDlg.dfm"/>
|
||||
<LIBFILES value=""/>
|
||||
<LIBRARIES value="vcl50.lib"/>
|
||||
<SPARELIBS value="vcl50.lib"/>
|
||||
<PACKAGES value="vclx50.bpi vcl50.bpi vcldb50.bpi vclbde50.bpi vcldbx50.bpi bcbsmp50.bpi
|
||||
dclocx50.bpi qrpt50.bpi teeui50.bpi vclsmp50.bpi teedb50.bpi tee50.bpi
|
||||
ibsmp50.bpi nmfast50.bpi inetdb50.bpi inet50.bpi"/>
|
||||
<PATHCPP value=".;"/>
|
||||
<PATHPAS value=".;"/>
|
||||
<PATHRC value=".;"/>
|
||||
<PATHASM value=".;"/>
|
||||
<DEBUGLIBPATH value="$(BCB)\lib\debug"/>
|
||||
<RELEASELIBPATH value="$(BCB)\lib\release"/>
|
||||
<LINKER value="ilink32"/>
|
||||
<USERDEFINES value=""/>
|
||||
<SYSDEFINES value="NO_STRICT"/>
|
||||
<MAINSOURCE value="MMVARI.cpp"/>
|
||||
<INCLUDEPATH value="..\vsais10;res;$(BCB)\include;$(BCB)\include\vcl"/>
|
||||
<LIBPATH value="..\vsais10;res;$(BCB)\lib\obj;$(BCB)\lib"/>
|
||||
<WARNINGS value="-w-par -w-8027 -w-8026"/>
|
||||
<WARNOPTSTR value=""/>
|
||||
</MACROS>
|
||||
<OPTIONS>
|
||||
<CFLAG1 value="-O2 -H=c:\PROGRA~2\borland\CBUILD~1\lib\vcl35.csm -Hc -Vx -Ve -X- -a8 -b-
|
||||
-d -k- -vi -c -tW -Tkh30000 -tWM"/>
|
||||
<CFLAG2 value=""/>
|
||||
<CFLAG3 value=""/>
|
||||
<PFLAGS value="-$YD -$L- -$D- -v -M -JPHNE"/>
|
||||
<RFLAGS value=""/>
|
||||
<AFLAGS value="/mx /w2 /zn"/>
|
||||
<LFLAGS value="-D"" -aa -Tpe -x -Gn"/>
|
||||
<IFLAGS value=""/>
|
||||
</OPTIONS>
|
||||
<LINKER>
|
||||
<ALLOBJ value="c0w32.obj sysinit.obj $(OBJFILES)"/>
|
||||
<ALLRES value="$(RESFILES)"/>
|
||||
<ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cp32mt.lib"/>
|
||||
</LINKER>
|
||||
<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
|
||||
|
||||
[Version Info Keys]
|
||||
CompanyName=
|
||||
FileDescription=
|
||||
FileVersion=1.0.0.0
|
||||
InternalName=
|
||||
LegalCopyright=
|
||||
LegalTrademarks=
|
||||
OriginalFilename=
|
||||
ProductName=
|
||||
ProductVersion=1.0.0.0
|
||||
Comments=
|
||||
|
||||
[Debugging]
|
||||
DebugSourceDirs=$(BCB)\source\vcl
|
||||
|
||||
[Parameters]
|
||||
RunParams=
|
||||
HostApplication=
|
||||
RemoteHost=
|
||||
RemotePath=
|
||||
RemoteDebug=0
|
||||
|
||||
[Compiler]
|
||||
ShowInfoMsgs=0
|
||||
LinkDebugVcl=0
|
||||
LinkCGLIB=0
|
||||
|
||||
[Language]
|
||||
ActiveLang=
|
||||
ProjectLang=
|
||||
RootDir=
|
||||
</IDEOPTIONS>
|
||||
</PROJECT>
|
||||
445
MMVARI.cbproj
Normal file
445
MMVARI.cbproj
Normal file
|
|
@ -0,0 +1,445 @@
|
|||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{B74A1F86-E21B-4660-8AD0-C595B4167159}</ProjectGuid>
|
||||
<ProjectType>CppVCLApplication</ProjectType>
|
||||
<MainSource>MMVARI.cpp</MainSource>
|
||||
<Base>True</Base>
|
||||
<Config Condition="'$(Config)'==''">Debug</Config>
|
||||
<ProjectVersion>14.6</ProjectVersion>
|
||||
<AppType>Application</AppType>
|
||||
<FrameworkType>VCL</FrameworkType>
|
||||
<Platform Condition="'$(Platform)'==''">Win32</Platform>
|
||||
<TargetedPlatforms>1</TargetedPlatforms>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
|
||||
<Base_Win32>true</Base_Win32>
|
||||
<CfgParent>Base</CfgParent>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
|
||||
<Base_Win64>true</Base_Win64>
|
||||
<CfgParent>Base</CfgParent>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
|
||||
<Cfg_1>true</Cfg_1>
|
||||
<CfgParent>Base</CfgParent>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
|
||||
<Cfg_1_Win32>true</Cfg_1_Win32>
|
||||
<CfgParent>Cfg_1</CfgParent>
|
||||
<Cfg_1>true</Cfg_1>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win64)'!=''">
|
||||
<Cfg_1_Win64>true</Cfg_1_Win64>
|
||||
<CfgParent>Cfg_1</CfgParent>
|
||||
<Cfg_1>true</Cfg_1>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
|
||||
<Cfg_2>true</Cfg_2>
|
||||
<CfgParent>Base</CfgParent>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
|
||||
<Cfg_2_Win32>true</Cfg_2_Win32>
|
||||
<CfgParent>Cfg_2</CfgParent>
|
||||
<Cfg_2>true</Cfg_2>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win64)'!=''">
|
||||
<Cfg_2_Win64>true</Cfg_2_Win64>
|
||||
<CfgParent>Cfg_2</CfgParent>
|
||||
<Cfg_2>true</Cfg_2>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Base)'!=''">
|
||||
<DCC_Namespace>Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace>
|
||||
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
|
||||
<VerInfo_Locale>1041</VerInfo_Locale>
|
||||
<LinkPackageStatics>rtl.lib;vcl.lib</LinkPackageStatics>
|
||||
<PackageImports>vclx.bpi;rtl.bpi;vcl.bpi;dbrtl.bpi;vcldb.bpi;bdertl.bpi;vcldbx.bpi;bcbsmp.bpi;teeui.bpi;vclsmp.bpi;teedb.bpi;tee.bpi;ibsmp.bpi;inetdb.bpi;inet.bpi;$(PackageImports)</PackageImports>
|
||||
<DCC_UnitSearchPath>.\;$(BDS)\lib;$(BDS)\lib\obj;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
|
||||
<ILINK_AppType>Windows</ILINK_AppType>
|
||||
<BCC_PCHCache>true</BCC_PCHCache>
|
||||
<BRCC_IncludePath>..\vsais10;res;$(BDS)\include;$(BDS)\include\vcl;$(BRCC_IncludePath)</BRCC_IncludePath>
|
||||
<BCC_OptimizeForSpeed>true</BCC_OptimizeForSpeed>
|
||||
<BCC_IncludePath>..\vsais10;res;$(BDS)\include;$(BDS)\include\vcl;$(BCC_IncludePath)</BCC_IncludePath>
|
||||
<DCC_IncludePath>.\;$(BDS)\lib;$(BDS)\lib\obj;$(DCC_IncludePath)</DCC_IncludePath>
|
||||
<TASM_IncludePath>..\vsais10;res;$(BDS)\include;$(BDS)\include\vcl;$(TASM_IncludePath)</TASM_IncludePath>
|
||||
<FinalOutputDir>.</FinalOutputDir>
|
||||
<BCC_GenerateWindowsApp>true</BCC_GenerateWindowsApp>
|
||||
<AllPackageLibs>rtl.lib;vcl.lib</AllPackageLibs>
|
||||
<TASM_Debugging>None</TASM_Debugging>
|
||||
<TASM_AdditionalSwitches> /w2</TASM_AdditionalSwitches>
|
||||
<OutputExt>exe</OutputExt>
|
||||
<DCC_CBuilderOutput>JPHNE</DCC_CBuilderOutput>
|
||||
<DCC_AdditionalSwitches> -M</DCC_AdditionalSwitches>
|
||||
<ILINK_LibraryPath>..\vsais10;res;$(BDS)\lib\obj;$(BDS)\lib;$(BDS)\lib\psdk;$(ILINK_LibraryPath)</ILINK_LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Base_Win32)'!=''">
|
||||
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
|
||||
<BCC_UserSuppliedOptions> -tWM -Tkh30000 -Vx -d -Ve</BCC_UserSuppliedOptions>
|
||||
<IncludePath>$(BDSINCLUDE)\windows\vcl;$(IncludePath)</IncludePath>
|
||||
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
|
||||
<VerInfo_Locale>1033</VerInfo_Locale>
|
||||
<Icon_MainIcon>MMVARI_Icon.ico</Icon_MainIcon>
|
||||
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Base_Win64)'!=''">
|
||||
<IncludePath>$(BDSINCLUDE)\windows\vcl;$(IncludePath)</IncludePath>
|
||||
<Icon_MainIcon>MMVARI_Icon.ico</Icon_MainIcon>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_1)'!=''">
|
||||
<ILINK_LibraryPath>$(BDS)\lib\debug;$(ILINK_LibraryPath);$(ILINK_LibraryPath)</ILINK_LibraryPath>
|
||||
<DCC_Define>DEBUG;$(DCC_Define);$(DCC_Define)</DCC_Define>
|
||||
<BCC_SourceDebuggingOn>true</BCC_SourceDebuggingOn>
|
||||
<IntermediateOutputDir>Debug_Build</IntermediateOutputDir>
|
||||
<ILINK_FullDebugInfo>true</ILINK_FullDebugInfo>
|
||||
<TASM_DisplaySourceLines>true</TASM_DisplaySourceLines>
|
||||
<ILINK_DisableIncrementalLinking>true</ILINK_DisableIncrementalLinking>
|
||||
<BCC_DisableOptimizations>true</BCC_DisableOptimizations>
|
||||
<TASM_Debugging>Full</TASM_Debugging>
|
||||
<DCC_AdditionalSwitches> -M -V</DCC_AdditionalSwitches>
|
||||
<BCC_DebugLineNumbers>true</BCC_DebugLineNumbers>
|
||||
<DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
|
||||
<BCC_InlineFunctionExpansion>false</BCC_InlineFunctionExpansion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
|
||||
<Manifest_File>None</Manifest_File>
|
||||
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
|
||||
<BCC_UserSuppliedOptions> -tWM -Tkh30000 -Vx -d -Ve -k</BCC_UserSuppliedOptions>
|
||||
<VerInfo_Locale>1033</VerInfo_Locale>
|
||||
<BCC_Defines>_DEBUG;$(BCC_Defines);$(BCC_Defines)</BCC_Defines>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_1_Win64)'!=''">
|
||||
<BCC_Defines>_DEBUG;$(BCC_Defines);$(BCC_Defines)</BCC_Defines>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_2)'!=''">
|
||||
<IntermediateOutputDir>Release_Build</IntermediateOutputDir>
|
||||
<DCC_AdditionalSwitches> -M -$O+</DCC_AdditionalSwitches>
|
||||
<ILINK_LibraryPath>$(BDS)\lib\release;$(ILINK_LibraryPath);$(ILINK_LibraryPath)</ILINK_LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
|
||||
<BCC_UserSuppliedOptions> -tWM -Tkh30000 -Vx -d -Ve -r</BCC_UserSuppliedOptions>
|
||||
<BCC_Defines>NDEBUG;$(BCC_Defines);$(BCC_Defines)</BCC_Defines>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_2_Win64)'!=''">
|
||||
<BCC_Defines>NDEBUG;$(BCC_Defines);$(BCC_Defines)</BCC_Defines>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<CppCompile Include="ClockAdj.cpp">
|
||||
<BuildOrder>33</BuildOrder>
|
||||
<Form>ClockAdjDlg</Form>
|
||||
<DependentOn>ClockAdj.h</DependentOn>
|
||||
<BuildOrder>17</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="CLX.cpp">
|
||||
<BuildOrder>28</BuildOrder>
|
||||
<DependentOn>CLX.h</DependentOn>
|
||||
<BuildOrder>2</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="CodeVw.cpp">
|
||||
<BuildOrder>30</BuildOrder>
|
||||
<Form>CodeView</Form>
|
||||
<DependentOn>CodeVw.h</DependentOn>
|
||||
<BuildOrder>16</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="ComLib.cpp">
|
||||
<BuildOrder>7</BuildOrder>
|
||||
<DependentOn>ComLib.h</DependentOn>
|
||||
<BuildOrder>23</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="Comm.cpp">
|
||||
<BuildOrder>35</BuildOrder>
|
||||
<DependentOn>Comm.h</DependentOn>
|
||||
<BuildOrder>11</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="country.cpp">
|
||||
<BuildOrder>25</BuildOrder>
|
||||
<DependentOn>country.h</DependentOn>
|
||||
<BuildOrder>1</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="cradio.cpp">
|
||||
<BuildOrder>30</BuildOrder>
|
||||
<DependentOn>cradio.h</DependentOn>
|
||||
<BuildOrder>16</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="DSP.cpp">
|
||||
<BuildOrder>3</BuildOrder>
|
||||
<DependentOn>DSP.h</DependentOn>
|
||||
<BuildOrder>27</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="Dump.cpp">
|
||||
<BuildOrder>8</BuildOrder>
|
||||
<DependentOn>Dump.h</DependentOn>
|
||||
<BuildOrder>22</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="FEdit.cpp">
|
||||
<BuildOrder>34</BuildOrder>
|
||||
<Form>FileEdit</Form>
|
||||
<DependentOn>FEdit.h</DependentOn>
|
||||
<BuildOrder>14</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="Fft.cpp">
|
||||
<BuildOrder>6</BuildOrder>
|
||||
<DependentOn>Fft.h</DependentOn>
|
||||
<BuildOrder>20</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="FreqDisp.cpp">
|
||||
<BuildOrder>36</BuildOrder>
|
||||
<Form>FreqDispDlg</Form>
|
||||
<DependentOn>FreqDisp.h</DependentOn>
|
||||
<BuildOrder>10</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="Hamlog5.cpp">
|
||||
<BuildOrder>36</BuildOrder>
|
||||
<DependentOn>Hamlog5.h</DependentOn>
|
||||
<BuildOrder>10</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="InputWin.cpp">
|
||||
<BuildOrder>33</BuildOrder>
|
||||
<Form>InputWinDlg</Form>
|
||||
<DependentOn>InputWin.h</DependentOn>
|
||||
<BuildOrder>17</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="LogConv.cpp">
|
||||
<BuildOrder>4</BuildOrder>
|
||||
<DependentOn>LogConv.h</DependentOn>
|
||||
<BuildOrder>24</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="LogFile.cpp">
|
||||
<BuildOrder>6</BuildOrder>
|
||||
<DependentOn>LogFile.h</DependentOn>
|
||||
<BuildOrder>20</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="Loglink.cpp">
|
||||
<BuildOrder>5</BuildOrder>
|
||||
<DependentOn>Loglink.h</DependentOn>
|
||||
<BuildOrder>21</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="LogList.cpp">
|
||||
<BuildOrder>8</BuildOrder>
|
||||
<Form>LogListDlg</Form>
|
||||
<DependentOn>LogList.h</DependentOn>
|
||||
<BuildOrder>22</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="LogSet.cpp">
|
||||
<Form>LogSetDlg</Form>
|
||||
<DependentOn>LogSet.h</DependentOn>
|
||||
<BuildOrder>19</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="MacEdit.cpp">
|
||||
<BuildOrder>9</BuildOrder>
|
||||
<Form>MacEditDlg</Form>
|
||||
<DependentOn>MacEdit.h</DependentOn>
|
||||
<BuildOrder>29</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="MacroKey.cpp">
|
||||
<BuildOrder>37</BuildOrder>
|
||||
<Form>MacroKeyDlg</Form>
|
||||
<DependentOn>MacroKey.h</DependentOn>
|
||||
<BuildOrder>13</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="Main.cpp">
|
||||
<BuildOrder>4</BuildOrder>
|
||||
<Form>MainVARI</Form>
|
||||
<DependentOn>Main.h</DependentOn>
|
||||
<BuildOrder>24</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="mfsk.cpp">
|
||||
<BuildOrder>-1</BuildOrder>
|
||||
<DependentOn>mfsk.h</DependentOn>
|
||||
<BuildOrder>1</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="Mmcg.cpp">
|
||||
<BuildOrder>3</BuildOrder>
|
||||
<DependentOn>Mmcg.h</DependentOn>
|
||||
<BuildOrder>27</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="MmcgDlg.cpp">
|
||||
<BuildOrder>28</BuildOrder>
|
||||
<Form>MmcgDlgBox</Form>
|
||||
<DependentOn>MmcgDlg.h</DependentOn>
|
||||
<BuildOrder>2</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="MMLink.cpp">
|
||||
<BuildOrder>7</BuildOrder>
|
||||
<DependentOn>MMLink.h</DependentOn>
|
||||
<BuildOrder>23</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="MMVARI.cpp">
|
||||
<BuildOrder>-1</BuildOrder>
|
||||
<BuildOrder>0</BuildOrder>
|
||||
</CppCompile>
|
||||
<ResFiles Include="mmvari.res">
|
||||
<BuildOrder>32</BuildOrder>
|
||||
<BuildOrder>18</BuildOrder>
|
||||
</ResFiles>
|
||||
<CppCompile Include="Option.cpp">
|
||||
<BuildOrder>38</BuildOrder>
|
||||
<Form>OptDlgBox</Form>
|
||||
<DependentOn>Option.h</DependentOn>
|
||||
<BuildOrder>12</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="PlayDlg.cpp">
|
||||
<BuildOrder>32</BuildOrder>
|
||||
<Form>PlayDlgBox</Form>
|
||||
<DependentOn>PlayDlg.h</DependentOn>
|
||||
<BuildOrder>18</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="Qsodlg.cpp">
|
||||
<BuildOrder>26</BuildOrder>
|
||||
<Form>QSODlgBox</Form>
|
||||
<DependentOn>Qsodlg.h</DependentOn>
|
||||
<BuildOrder>0</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="RadioSet.cpp">
|
||||
<BuildOrder>9</BuildOrder>
|
||||
<Form>RADIOSetDlg</Form>
|
||||
<DependentOn>RadioSet.h</DependentOn>
|
||||
<BuildOrder>29</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="RMenuDlg.cpp">
|
||||
<BuildOrder>38</BuildOrder>
|
||||
<Form>RMenuDialog</Form>
|
||||
<DependentOn>RMenuDlg.h</DependentOn>
|
||||
<BuildOrder>12</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="RxView.cpp">
|
||||
<BuildOrder>31</BuildOrder>
|
||||
<Form>RxViewDlg</Form>
|
||||
<DependentOn>RxView.h</DependentOn>
|
||||
<BuildOrder>15</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="Test.cpp">
|
||||
<BuildOrder>35</BuildOrder>
|
||||
<Form>TestDlg</Form>
|
||||
<DependentOn>Test.h</DependentOn>
|
||||
<BuildOrder>11</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="TH5Len.cpp">
|
||||
<BuildOrder>37</BuildOrder>
|
||||
<Form>TH5LenDlg</Form>
|
||||
<DependentOn>TH5Len.h</DependentOn>
|
||||
<BuildOrder>13</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="TrackDlg.cpp">
|
||||
<BuildOrder>34</BuildOrder>
|
||||
<Form>TrackDlgBox</Form>
|
||||
<DependentOn>TrackDlg.h</DependentOn>
|
||||
<BuildOrder>14</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="VerDsp.cpp">
|
||||
<BuildOrder>31</BuildOrder>
|
||||
<Form>VerDspDlg</Form>
|
||||
<DependentOn>VerDsp.h</DependentOn>
|
||||
<BuildOrder>15</BuildOrder>
|
||||
</CppCompile>
|
||||
<CppCompile Include="Wave.cpp">
|
||||
<BuildOrder>5</BuildOrder>
|
||||
<DependentOn>Wave.h</DependentOn>
|
||||
<BuildOrder>21</BuildOrder>
|
||||
</CppCompile>
|
||||
<FormResources Include="Option.dfm"/>
|
||||
<FormResources Include="MmcgDlg.dfm"/>
|
||||
<FormResources Include="Main.dfm"/>
|
||||
<FormResources Include="MacroKey.dfm"/>
|
||||
<FormResources Include="PlayDlg.dfm"/>
|
||||
<FormResources Include="TrackDlg.dfm"/>
|
||||
<FormResources Include="TH5Len.dfm"/>
|
||||
<FormResources Include="VerDsp.dfm"/>
|
||||
<FormResources Include="Test.dfm"/>
|
||||
<FormResources Include="RadioSet.dfm"/>
|
||||
<FormResources Include="Qsodlg.dfm"/>
|
||||
<FormResources Include="RxView.dfm"/>
|
||||
<FormResources Include="RMenuDlg.dfm"/>
|
||||
<FormResources Include="MacEdit.dfm"/>
|
||||
<FormResources Include="ClockAdj.dfm"/>
|
||||
<FormResources Include="CodeVw.dfm"/>
|
||||
<FormResources Include="FEdit.dfm"/>
|
||||
<FormResources Include="LogSet.dfm"/>
|
||||
<FormResources Include="LogList.dfm"/>
|
||||
<FormResources Include="FreqDisp.dfm"/>
|
||||
<FormResources Include="InputWin.dfm"/>
|
||||
<BuildConfiguration Include="Release">
|
||||
<Key>Cfg_2</Key>
|
||||
<CfgParent>Base</CfgParent>
|
||||
</BuildConfiguration>
|
||||
<BuildConfiguration Include="Base">
|
||||
<Key>Base</Key>
|
||||
</BuildConfiguration>
|
||||
<BuildConfiguration Include="Debug">
|
||||
<Key>Cfg_1</Key>
|
||||
<CfgParent>Base</CfgParent>
|
||||
</BuildConfiguration>
|
||||
</ItemGroup>
|
||||
<Import Condition="Exists('$(BDS)\Bin\CodeGear.Cpp.Targets')" Project="$(BDS)\Bin\CodeGear.Cpp.Targets"/>
|
||||
<Import Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')" Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj"/>
|
||||
<ProjectExtensions>
|
||||
<Borland.Personality>CPlusPlusBuilder.Personality.12</Borland.Personality>
|
||||
<Borland.ProjectType>CppVCLApplication</Borland.ProjectType>
|
||||
<BorlandProject>
|
||||
<CPlusPlusBuilder.Personality>
|
||||
<VersionInfo>
|
||||
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
|
||||
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
|
||||
<VersionInfo Name="MajorVer">1</VersionInfo>
|
||||
<VersionInfo Name="MinorVer">0</VersionInfo>
|
||||
<VersionInfo Name="Release">0</VersionInfo>
|
||||
<VersionInfo Name="Build">0</VersionInfo>
|
||||
<VersionInfo Name="Debug">False</VersionInfo>
|
||||
<VersionInfo Name="PreRelease">False</VersionInfo>
|
||||
<VersionInfo Name="Special">False</VersionInfo>
|
||||
<VersionInfo Name="Private">False</VersionInfo>
|
||||
<VersionInfo Name="DLL">False</VersionInfo>
|
||||
<VersionInfo Name="Locale">1041</VersionInfo>
|
||||
<VersionInfo Name="CodePage">932</VersionInfo>
|
||||
</VersionInfo>
|
||||
<VersionInfoKeys>
|
||||
<VersionInfoKeys Name="CompanyName"/>
|
||||
<VersionInfoKeys Name="FileDescription"/>
|
||||
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="InternalName"/>
|
||||
<VersionInfoKeys Name="LegalCopyright"/>
|
||||
<VersionInfoKeys Name="LegalTrademarks"/>
|
||||
<VersionInfoKeys Name="OriginalFilename"/>
|
||||
<VersionInfoKeys Name="ProductName"/>
|
||||
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="Comments"/>
|
||||
</VersionInfoKeys>
|
||||
<Debugging>
|
||||
<Debugging Name="DebugSourceDirs">$(BCB)\source\vcl</Debugging>
|
||||
</Debugging>
|
||||
<Parameters>
|
||||
<Parameters Name="RemoteHost"/>
|
||||
<Parameters Name="RemotePath"/>
|
||||
<Parameters Name="RemoteDebug">0</Parameters>
|
||||
</Parameters>
|
||||
<Compiler>
|
||||
<Compiler Name="ShowInfoMsgs">0</Compiler>
|
||||
<Compiler Name="LinkDebugVcl">0</Compiler>
|
||||
<Compiler Name="LinkCGLIB">0</Compiler>
|
||||
</Compiler>
|
||||
<ProjectProperties>
|
||||
<ProjectProperties Name="AutoShowDeps">False</ProjectProperties>
|
||||
<ProjectProperties Name="ManagePaths">True</ProjectProperties>
|
||||
<ProjectProperties Name="VerifyPackages">True</ProjectProperties>
|
||||
</ProjectProperties>
|
||||
<Source>
|
||||
<Source Name="MainSource">MMVARI.cpp</Source>
|
||||
</Source>
|
||||
</CPlusPlusBuilder.Personality>
|
||||
<Platforms>
|
||||
<Platform value="Win32">True</Platform>
|
||||
<Platform value="Win64">False</Platform>
|
||||
</Platforms>
|
||||
</BorlandProject>
|
||||
<ProjectFileVersion>12</ProjectFileVersion>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
||||
2
MMVARI.cbproj.local
Normal file
2
MMVARI.cbproj.local
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<BorlandProject/>
|
||||
76
MMVARI.cpp
Normal file
76
MMVARI.cpp
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
#include <vcl.h>
|
||||
#pragma hdrstop
|
||||
USEUNIT("mfsk.cpp");
|
||||
USEUNIT("CLX.cpp");
|
||||
USEUNIT("DSP.cpp");
|
||||
USEFORM("Main.cpp", MainVARI);
|
||||
USEUNIT("Wave.cpp");
|
||||
USEUNIT("Fft.cpp");
|
||||
USEUNIT("ComLib.cpp");
|
||||
USEUNIT("Dump.cpp");
|
||||
USEFORM("MacEdit.cpp", MacEditDlg);
|
||||
USEFORM("FreqDisp.cpp", FreqDispDlg);
|
||||
USEUNIT("Comm.cpp");
|
||||
USEFORM("Option.cpp", OptDlgBox);
|
||||
USEFORM("MacroKey.cpp", MacroKeyDlg);
|
||||
USEFORM("FEdit.cpp", FileEdit);
|
||||
USEFORM("VerDsp.cpp", VerDspDlg);
|
||||
USEFORM("CodeVw.cpp", CodeView);
|
||||
USEFORM("InputWin.cpp", InputWinDlg);
|
||||
USEFORM("PlayDlg.cpp", PlayDlgBox);
|
||||
USEFORM("LogSet.cpp", LogSetDlg);
|
||||
USEUNIT("LogFile.cpp");
|
||||
USEUNIT("Loglink.cpp");
|
||||
USEFORM("LogList.cpp", LogListDlg);
|
||||
USEUNIT("MMLink.cpp");
|
||||
USEUNIT("LogConv.cpp");
|
||||
USEUNIT("country.cpp");
|
||||
USEFORM("Qsodlg.cpp", QSODlgBox);
|
||||
USEUNIT("Mmcg.cpp");
|
||||
USEFORM("MmcgDlg.cpp", MmcgDlgBox);
|
||||
USEFORM("RadioSet.cpp", RADIOSetDlg);
|
||||
USEUNIT("cradio.cpp");
|
||||
USEFORM("RxView.cpp", RxViewDlg);
|
||||
USERES("mmvari.res");
|
||||
USEFORM("ClockAdj.cpp", ClockAdjDlg);
|
||||
USEFORM("TrackDlg.cpp", TrackDlgBox);
|
||||
USEFORM("Test.cpp", TestDlg);
|
||||
USEUNIT("Hamlog5.cpp");
|
||||
USEFORM("TH5Len.cpp", TH5LenDlg);
|
||||
USEFORM("RMenuDlg.cpp", RMenuDialog);
|
||||
//---------------------------------------------------------------------------
|
||||
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
|
||||
{
|
||||
try
|
||||
{
|
||||
Application->Initialize();
|
||||
Application->CreateForm(__classid(TMainVARI), &MainVARI);
|
||||
Application->Run();
|
||||
}
|
||||
catch (Exception &exception)
|
||||
{
|
||||
Application->ShowException(&exception);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
6
MMVARI.map
Normal file
6
MMVARI.map
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
Start Length Name Class
|
||||
0001:00401000 000388EB8H _TEXT CODE
|
||||
0002:0078A000 000040310H _DATA DATA
|
||||
0003:007CA310 000021914H _BSS BSS
|
||||
0004:00000000 0000000F8H _TLS TLS
|
||||
BIN
MMVARI.res
Normal file
BIN
MMVARI.res
Normal file
Binary file not shown.
BIN
MMVARI.tds
Normal file
BIN
MMVARI.tds
Normal file
Binary file not shown.
BIN
MMVARI_Icon.ico
Normal file
BIN
MMVARI_Icon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
403
MacEdit.cpp
Normal file
403
MacEdit.cpp
Normal file
|
|
@ -0,0 +1,403 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
#include <vcl.h>
|
||||
#pragma hdrstop
|
||||
|
||||
#include "MacEdit.h"
|
||||
#include "MacroKey.h"
|
||||
//---------------------------------------------------------------------
|
||||
#pragma resource "*.dfm"
|
||||
//---------------------------------------------------------------------
|
||||
__fastcall TMacEditDlg::TMacEditDlg(TComponent* AOwner)
|
||||
: TForm(AOwner)
|
||||
{
|
||||
FormStyle = ((TForm *)AOwner)->FormStyle;
|
||||
Font->Name = ((TForm *)AOwner)->Font->Name;
|
||||
Font->Charset = ((TForm *)AOwner)->Font->Charset;
|
||||
// Memo->Font->Charset = MainGMSK->PCTX->Font->Charset;
|
||||
if( sys.m_MsgEng ){
|
||||
// Caption = "Edit button";
|
||||
L1->Caption = "Button";
|
||||
SBMac->Caption = "Macro";
|
||||
SBCond->Caption = "Cond.";
|
||||
SBClear->Caption = "Clear";
|
||||
CancelBtn->Caption = "Cancel";
|
||||
|
||||
ELabel->Hint = "Button name";
|
||||
SBB->Hint = "Bold";
|
||||
SBI->Hint = "Italic";
|
||||
SBU->Hint = "Under line";
|
||||
SBMac->Hint = "Choose macro-command";
|
||||
SBCond->Hint = "Choose condition-command";
|
||||
SBClear->Hint = "All clear";
|
||||
|
||||
KE->Caption = "&Edit";
|
||||
KEU->Caption = "&Undo";
|
||||
KEC->Caption = "Cu&T";
|
||||
KECP->Caption = "&Copy";
|
||||
KEP->Caption = "&Paste";
|
||||
KEA->Caption = "Select AL&L";
|
||||
|
||||
KFL->Caption = "&Load text...";
|
||||
KFS->Caption = "Save &As...";
|
||||
}
|
||||
KEIM->Caption = SBMac->Hint;
|
||||
KEIC->Caption = SBCond->Hint;
|
||||
KF->Caption = MainVARI->KF->Caption;
|
||||
KH->Caption = MainVARI->KH->Caption;
|
||||
KHO->Caption = MainVARI->KHO->Caption;
|
||||
KHS->Caption = MainVARI->KHS->Caption;
|
||||
m_pKeyDlg = NULL;
|
||||
m_pOverWrite = NULL;
|
||||
m_InsCount = 0;
|
||||
OnWave();
|
||||
if( sys.m_PosMacEdit.right ){
|
||||
Position = poDesigned;
|
||||
if( sys.m_PosMacEdit.bottom >= 0 ){
|
||||
SetBounds(sys.m_PosMacEdit.left, sys.m_PosMacEdit.top, sys.m_PosMacEdit.right, sys.m_PosMacEdit.bottom);
|
||||
}
|
||||
else {
|
||||
WindowState = wsMaximized;
|
||||
}
|
||||
}
|
||||
else {
|
||||
FormCenter(this);
|
||||
SaveBounds();
|
||||
}
|
||||
m_MacroDir = sys.m_MacroDir;
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
void __fastcall TMacEditDlg::SaveBounds(void)
|
||||
{
|
||||
if( WindowState == wsNormal ){
|
||||
sys.m_PosMacEdit.left = Left;
|
||||
sys.m_PosMacEdit.top = Top;
|
||||
sys.m_PosMacEdit.right = Width;
|
||||
sys.m_PosMacEdit.bottom = Height;
|
||||
}
|
||||
else {
|
||||
sys.m_PosMacEdit.bottom = -1;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
int __fastcall TMacEditDlg::Execute(MACBUTTON *pList, int n)
|
||||
{
|
||||
char bf[128];
|
||||
sprintf(bf, sys.m_MsgEng ? "Edit button (No.%u)" : "ボタンの編集 (No.%u)", n+1);
|
||||
Caption = bf;
|
||||
sprintf(bf, "Button%d", n+1);
|
||||
m_Name = bf;
|
||||
Memo->Text = pList->Text;
|
||||
ELabel->Text = pList->Name;
|
||||
PC->Color = pList->Color;
|
||||
SBB->Down = pList->Style & FSBOLD;
|
||||
SBI->Down = pList->Style & FSITALIC;
|
||||
SBU->Down = pList->Style & FSUNDERLINE;
|
||||
Memo->SelStart = strlen(pList->Text.c_str());
|
||||
OnWave();
|
||||
int r = ShowModal();
|
||||
if( m_pKeyDlg ){
|
||||
delete m_pKeyDlg;
|
||||
m_pKeyDlg = NULL;
|
||||
OnWave();
|
||||
}
|
||||
if( r == IDOK ){
|
||||
pList->Text = Memo->Text;
|
||||
if( Memo->Text.IsEmpty() && !ELabel->Text.IsEmpty() ){
|
||||
sprintf(bf, "M%d", n+1);
|
||||
pList->Name = bf;
|
||||
}
|
||||
else {
|
||||
pList->Name = ELabel->Text;
|
||||
}
|
||||
pList->Color = PC->Color;
|
||||
pList->Style = 0;
|
||||
if( SBB->Down ) pList->Style |= FSBOLD;
|
||||
if( SBI->Down ) pList->Style |= FSITALIC;
|
||||
if( SBU->Down ) pList->Style |= FSUNDERLINE;
|
||||
return TRUE;
|
||||
}
|
||||
else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
int __fastcall TMacEditDlg::Execute(AnsiString &as, LPCSTR pTitle)
|
||||
{
|
||||
L1->Enabled = FALSE;
|
||||
ELabel->Enabled = FALSE;
|
||||
PC->Enabled = FALSE;
|
||||
SBB->Enabled = FALSE;
|
||||
SBI->Enabled = FALSE;
|
||||
SBU->Enabled = FALSE;
|
||||
|
||||
AnsiString ts = sys.m_MsgEng ? "Edit macro" : "マクロ文の編集";
|
||||
if( pTitle ){
|
||||
ts += " - ";
|
||||
ts += pTitle;
|
||||
}
|
||||
Caption = ts;
|
||||
m_Name = pTitle;
|
||||
Memo->Text = as.c_str();
|
||||
ELabel->Text = "";
|
||||
Memo->SelStart = strlen(as.c_str());
|
||||
OnWave();
|
||||
int r = ShowModal();
|
||||
if( m_pKeyDlg ){
|
||||
delete m_pKeyDlg;
|
||||
m_pKeyDlg = NULL;
|
||||
OnWave();
|
||||
}
|
||||
if( r == IDOK ){
|
||||
as = Memo->Text;
|
||||
return TRUE;
|
||||
}
|
||||
else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
int __fastcall TMacEditDlg::Execute(LPCSTR pName)
|
||||
{
|
||||
CWaitCursor w;
|
||||
mkdir(sys.m_MacroDir);
|
||||
|
||||
m_pOverWrite = new TMenuItem(this);
|
||||
m_pOverWrite->Caption = sys.m_MsgEng ? "&Over write":"上書き保存(&O)";
|
||||
m_pOverWrite->OnClick = KFSClick;
|
||||
KF->Insert(KF->IndexOf(KFS), m_pOverWrite);
|
||||
|
||||
L1->Enabled = FALSE;
|
||||
ELabel->Enabled = FALSE;
|
||||
PC->Enabled = FALSE;
|
||||
SBB->Enabled = FALSE;
|
||||
SBI->Enabled = FALSE;
|
||||
SBU->Enabled = FALSE;
|
||||
|
||||
GetFullPathName(m_FullName, pName, sys.m_MacroDir);
|
||||
GetFileName(m_Name, pName);
|
||||
char bf[256];
|
||||
SetDirName(bf, m_FullName.c_str());
|
||||
m_MacroDir = bf;
|
||||
AnsiString ts = sys.m_MsgEng ? "Edit macro" : "マクロ文の編集";
|
||||
ts += " - ";
|
||||
ts += m_FullName;
|
||||
Caption = ts;
|
||||
if( IsFile(m_FullName.c_str()) ){
|
||||
try {
|
||||
Memo->Lines->LoadFromFile(m_FullName);
|
||||
}
|
||||
catch(...){
|
||||
}
|
||||
}
|
||||
ELabel->Text = "";
|
||||
OnWave();
|
||||
int r = ShowModal();
|
||||
if( m_pKeyDlg ){
|
||||
delete m_pKeyDlg;
|
||||
m_pKeyDlg = NULL;
|
||||
OnWave();
|
||||
}
|
||||
if( r == IDOK ){
|
||||
CWaitCursor w;
|
||||
Memo->Lines->SaveToFile(m_FullName);
|
||||
return TRUE;
|
||||
}
|
||||
else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
void __fastcall TMacEditDlg::PCClick(TObject *Sender)
|
||||
{
|
||||
ColorDialog->Color = PC->Color;
|
||||
if( ColorDialog->Execute() ){
|
||||
PC->Color = ColorDialog->Color;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TMacEditDlg::SBMacClick(TObject *Sender)
|
||||
{
|
||||
int type = ((Sender == SBMac) || (Sender == KEIM)) ? 0 : 1;
|
||||
m_InsCount = 0;
|
||||
if( !m_pKeyDlg ){
|
||||
m_pKeyDlg = new TMacroKeyDlg(this);
|
||||
m_pKeyDlg->Execute(Left+48, Top+60, this, type);
|
||||
}
|
||||
else {
|
||||
m_pKeyDlg->Execute(-1, -1, this, type);
|
||||
}
|
||||
if( m_pKeyDlg ) m_pKeyDlg->UpdateUndo(m_InsCount);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TMacEditDlg::SBClearClick(TObject *Sender)
|
||||
{
|
||||
Memo->Clear();
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
void __fastcall TMacEditDlg::Undo(void)
|
||||
{
|
||||
if( m_InsCount ){
|
||||
for( ; m_InsCount; m_InsCount-- ){
|
||||
::PostMessage(Memo->Handle, WM_CHAR, '\b', 0);
|
||||
}
|
||||
if( m_pKeyDlg ) m_pKeyDlg->UpdateUndo(m_InsCount);
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
void __fastcall TMacEditDlg::OnInsertText(LPCSTR pText)
|
||||
{
|
||||
m_InsCount = 0;
|
||||
for( LPCSTR p = pText; *p; p++ ){
|
||||
::PostMessage(Memo->Handle, WM_CHAR, *p, 0);
|
||||
m_InsCount++;
|
||||
}
|
||||
if( m_pKeyDlg ) m_pKeyDlg->UpdateUndo(m_InsCount);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TMacEditDlg::FormDestroy(TObject *Sender)
|
||||
{
|
||||
if( m_pKeyDlg ){
|
||||
delete m_pKeyDlg;
|
||||
m_pKeyDlg = NULL;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TMacEditDlg::FormResize(TObject *Sender)
|
||||
{
|
||||
CancelBtn->Left = PB->Width - CancelBtn->Width - 1;
|
||||
OKBtn->Left = CancelBtn->Left - OKBtn->Width - 1;
|
||||
SaveBounds();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TMacEditDlg::FormClose(TObject *Sender,
|
||||
TCloseAction &Action)
|
||||
{
|
||||
SaveBounds();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TMacEditDlg::KEClick(TObject *Sender)
|
||||
{
|
||||
KEU->Enabled = Memo->Modified;
|
||||
KEC->Enabled = Memo->SelLength;
|
||||
KECP->Enabled = KEC->Enabled;
|
||||
KEP->Enabled = ::IsClipboardFormatAvailable(CF_TEXT);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TMacEditDlg::KEUClick(TObject *Sender)
|
||||
{
|
||||
if( Memo->HandleAllocated() ){
|
||||
SendMessage(Memo->Handle, EM_UNDO, 0, 0);
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TMacEditDlg::KECClick(TObject *Sender)
|
||||
{
|
||||
Memo->CutToClipboard();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TMacEditDlg::KECPClick(TObject *Sender)
|
||||
{
|
||||
Memo->CopyToClipboard();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TMacEditDlg::KEPClick(TObject *Sender)
|
||||
{
|
||||
Memo->PasteFromClipboard();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TMacEditDlg::KEAClick(TObject *Sender)
|
||||
{
|
||||
Memo->SelectAll();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TMacEditDlg::KHOClick(TObject *Sender)
|
||||
{
|
||||
if( Sender == KHO ){
|
||||
MainVARI->ShowManual();
|
||||
}
|
||||
else {
|
||||
MainVARI->ShowMacroSample();
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TMacEditDlg::KFSClick(TObject *Sender)
|
||||
{
|
||||
mkdir(sys.m_MacroDir);
|
||||
if( Sender == KFS ){
|
||||
TSaveDialog *pBox = new TSaveDialog(this);
|
||||
pBox->Options << ofOverwritePrompt;
|
||||
pBox->Options << ofNoReadOnlyReturn;
|
||||
if( sys.m_MsgEng ){
|
||||
pBox->Title = "Save macro text";
|
||||
}
|
||||
else {
|
||||
pBox->Title = "テキストファイルにセーブ";
|
||||
}
|
||||
pBox->Filter = "Text Files(*.txt)|*.txt";
|
||||
pBox->FileName = m_Name;
|
||||
pBox->DefaultExt = "txt";
|
||||
pBox->InitialDir = m_MacroDir;
|
||||
OnWave();
|
||||
if( pBox->Execute() == TRUE ){
|
||||
OnWave();
|
||||
Memo->Lines->SaveToFile(pBox->FileName);
|
||||
}
|
||||
delete pBox;
|
||||
}
|
||||
else {
|
||||
Memo->Lines->SaveToFile(m_FullName);
|
||||
Memo->Modified = FALSE;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TMacEditDlg::KFLClick(TObject *Sender)
|
||||
{
|
||||
mkdir(sys.m_MacroDir);
|
||||
TOpenDialog *pBox = new TOpenDialog(this);
|
||||
pBox->Options >> ofCreatePrompt;
|
||||
pBox->Options << ofFileMustExist;
|
||||
if( sys.m_MsgEng ){
|
||||
pBox->Title = "Load macro text";
|
||||
}
|
||||
else {
|
||||
pBox->Title = "テキストファイルからロード";
|
||||
}
|
||||
pBox->Filter = "Text Files(*.txt)|*.txt";
|
||||
pBox->FileName = m_Name;
|
||||
pBox->DefaultExt = "txt";
|
||||
pBox->InitialDir = m_MacroDir;
|
||||
OnWave();
|
||||
if( pBox->Execute() == TRUE ){
|
||||
OnWave();
|
||||
Memo->Lines->LoadFromFile(pBox->FileName);
|
||||
Memo->Modified = TRUE;
|
||||
}
|
||||
delete pBox;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TMacEditDlg::KFClick(TObject *Sender)
|
||||
{
|
||||
if( m_pOverWrite ) m_pOverWrite->Enabled = Memo->Modified;
|
||||
KFS->Enabled = !Memo->Text.IsEmpty();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
BIN
MacEdit.dfm
Normal file
BIN
MacEdit.dfm
Normal file
Binary file not shown.
123
MacEdit.h
Normal file
123
MacEdit.h
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
#ifndef MacEditH
|
||||
#define MacEditH
|
||||
//----------------------------------------------------------------------------
|
||||
#include <System.hpp>
|
||||
#include <Windows.hpp>
|
||||
#include <SysUtils.hpp>
|
||||
#include <Classes.hpp>
|
||||
#include <Graphics.hpp>
|
||||
#include <StdCtrls.hpp>
|
||||
#include <Forms.hpp>
|
||||
#include <Controls.hpp>
|
||||
#include <Buttons.hpp>
|
||||
#include <ExtCtrls.hpp>
|
||||
//----------------------------------------------------------------------------
|
||||
#include "Main.h"
|
||||
#include <Dialogs.hpp>
|
||||
#include "MacroKey.h"
|
||||
#include <Menus.hpp>
|
||||
//----------------------------------------------------------------------------
|
||||
class TMacEditDlg : public TForm
|
||||
{
|
||||
__published:
|
||||
TButton *OKBtn;
|
||||
TButton *CancelBtn;
|
||||
TMemo *Memo;
|
||||
TEdit *ELabel;
|
||||
TLabel *L1;
|
||||
TColorDialog *ColorDialog;
|
||||
TPanel *PC;
|
||||
TSpeedButton *SBMac;
|
||||
TSpeedButton *SBClear;
|
||||
TSpeedButton *SBB;
|
||||
TSpeedButton *SBI;
|
||||
TSpeedButton *SBU;
|
||||
TSpeedButton *SBCond;
|
||||
TPanel *PB;
|
||||
TMainMenu *Menu;
|
||||
TMenuItem *KE;
|
||||
TMenuItem *KEC;
|
||||
TMenuItem *KECP;
|
||||
TMenuItem *KEP;
|
||||
TMenuItem *KEU;
|
||||
TMenuItem *KEA;
|
||||
TMenuItem *N1;
|
||||
TMenuItem *N2;
|
||||
|
||||
|
||||
TMenuItem *KH;
|
||||
TMenuItem *KHO;
|
||||
TMenuItem *KHS;
|
||||
TMenuItem *N3;
|
||||
TMenuItem *KEIM;
|
||||
TMenuItem *KEIC;
|
||||
TMenuItem *KF;
|
||||
TMenuItem *KFS;
|
||||
TMenuItem *KFL;
|
||||
TMenuItem *N4;
|
||||
void __fastcall PCClick(TObject *Sender);
|
||||
void __fastcall SBMacClick(TObject *Sender);
|
||||
void __fastcall SBClearClick(TObject *Sender);
|
||||
void __fastcall FormDestroy(TObject *Sender);
|
||||
|
||||
void __fastcall FormResize(TObject *Sender);
|
||||
void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
|
||||
|
||||
void __fastcall KEClick(TObject *Sender);
|
||||
void __fastcall KEUClick(TObject *Sender);
|
||||
void __fastcall KEAClick(TObject *Sender);
|
||||
void __fastcall KECClick(TObject *Sender);
|
||||
void __fastcall KECPClick(TObject *Sender);
|
||||
void __fastcall KEPClick(TObject *Sender);
|
||||
void __fastcall KHOClick(TObject *Sender);
|
||||
|
||||
|
||||
void __fastcall KFSClick(TObject *Sender);
|
||||
void __fastcall KFLClick(TObject *Sender);
|
||||
void __fastcall KFClick(TObject *Sender);
|
||||
|
||||
|
||||
private:
|
||||
AnsiString m_Name;
|
||||
AnsiString m_FullName;
|
||||
AnsiString m_MacroDir;
|
||||
int m_InsCount;
|
||||
TMacroKeyDlg *m_pKeyDlg;
|
||||
TMenuItem *m_pOverWrite;
|
||||
|
||||
void __fastcall SaveBounds(void);
|
||||
|
||||
public:
|
||||
virtual __fastcall TMacEditDlg(TComponent* AOwner);
|
||||
|
||||
int __fastcall Execute(MACBUTTON *pList, int n);
|
||||
int __fastcall Execute(AnsiString &as, LPCSTR pTitle);
|
||||
int __fastcall Execute(LPCSTR pName);
|
||||
|
||||
void __fastcall OnInsertText(LPCSTR pText);
|
||||
void __fastcall Undo(void);
|
||||
};
|
||||
//----------------------------------------------------------------------------
|
||||
//extern PACKAGE TMacEditDlg *MacEditDlg;
|
||||
//----------------------------------------------------------------------------
|
||||
#endif
|
||||
906
MacroKey.cpp
Normal file
906
MacroKey.cpp
Normal file
|
|
@ -0,0 +1,906 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
#include <vcl.h>
|
||||
#pragma hdrstop
|
||||
|
||||
#include <Printers.hpp>
|
||||
|
||||
#include "MacroKey.h"
|
||||
#include "MacEdit.h"
|
||||
#include "ComLib.h"
|
||||
#include "InputWin.h"
|
||||
//---------------------------------------------------------------------
|
||||
#pragma resource "*.dfm"
|
||||
//TMacroKeyDlg *MacroKeyDlg;
|
||||
MACKEY mackeycom[]={
|
||||
{1, "<%TX>","送信に切り替え", "Switch to TX"},
|
||||
{1, "<%RX>","受信に切り替え", "Switch to RX"},
|
||||
{1, "<%TXRX>","送受の切り替え", "Turns over TX/RX"},
|
||||
{1, "<%TXOFF>","送信の強制終了", "Abort TX (Switch to RX immediately)"},
|
||||
{1, "<%AutoClear>","自動的に送信画面をクリア", "Clear TX window automatically"},
|
||||
{1, "<%ClearTXW>","送信画面をクリア", "Clear TX window"},
|
||||
{1, "<%ClearRXW>","受信画面をクリア", "Clear RX window"},
|
||||
{1, "<%MyCall>","自局のコールサイン", "My callsign"},
|
||||
{1, "<%HisCall>","相手局のコールサイン", "His/her callsign"},
|
||||
{1, "<%HisName>","相手局の名前", "His/her name"},
|
||||
{1, "<%DearName>","Dear xxx または xxxさん", "Dear xxx"},
|
||||
{1, "<%HisRST>","相手局のRST", "His/her RST"},
|
||||
{1, "<%MyRST>","自局の(伝えられた)RST", "My RST"},
|
||||
{1, "<%FREQ>","運用周波数(例 7)", "Logging FREQ (e.g. 7)"},
|
||||
{1, "<%BAND>","運用バンド(例 40m)", "Logging BAND (e.g. 40m)"},
|
||||
{1, "<%HisQTH>","相手局のQTH", "His/her QTH"},
|
||||
{1, "<%Note>","Note(備考)", "Note (Remarks)"},
|
||||
{1, "<%UDATE>","日付(UTC)", "UTC date"},
|
||||
{1, "<%UTIME>","時刻(UTC) hh:mm", "UTC time (hh:mm)"},
|
||||
{1, "<%UTIMES>","時刻(UTC) hh:mm:ss", "UTC time (hh:mm:ss)"},
|
||||
{1, "<%LDATE>","日付(Local)", "Local date"},
|
||||
{1, "<%LTIME>","時刻(Local) hh:mm", "Local time (hh:mm)"},
|
||||
{1, "<%LTIMES>","時刻(Local) hh:mm:ss", "Local time (hh:mm:ss)"},
|
||||
{1, "<%PTIME>","1980/JAN/6 からの経過秒(UTC時刻)", "Passing time from 1980/JAN/6 (UTC)"},
|
||||
{1, "<%LPTIME>","1980/JAN/6 からの経過秒(ローカル時刻)", "Passing time from 1980/JAN/6 (local time)"},
|
||||
{1, "<%QPTIME>","QSO開始UTC時刻(1980/JAN/6 からの経過秒)", "QSO Starting time (passing time from 1980/JAN/6 (UTC)"},
|
||||
{1, "<%VALTIME=year,<%PTIME>>","PTIMEを分解 (year/month/day/hour/minute/second..., PTIME)", "Takes the PTIME apart (year/month/day/hour/minute/second..., PTIME)"},
|
||||
{1, "<%Capture>","コールサインの捕獲", "Capture callsign"},
|
||||
{2, "<%HisGreetings=3>","自動挨拶(例 1-GA, 2-Good morning, 3-おはようございます)", NULL},
|
||||
{3, "<%HisGreetings=2>","Auto Greetings (e.g. 1-GA, 2-Good morning)", NULL},
|
||||
{1, "<%HisNR>","HisRSTのコンテストNR", "Only the contest number part of his/her RST"},
|
||||
{1, "<%MyNR>","MyRSTのコンテストNR", "Only the contest number part of my RST"},
|
||||
{1, "<%Entity=<%HisCall>>","エンティティコード", "Code of the entity"},
|
||||
{1, "<%EntityName=<%HisCall>>","エンティティ名", "Name of the entity"},
|
||||
{1, "<%Continent=<%HisCall>>","大陸コード", "Code of the continent"},
|
||||
{1, "<%PLATFORM>","OSのプラットフォーム", "Platform of the OS"},
|
||||
{1, "<%CodePage>","OSのコードページ", "Code page of the OS"},
|
||||
{1, "<%LanguageID>","OSの言語ID", "Language ID of the OS"},
|
||||
{1, "<%VER>","MMVARIのバージョン", "Program version of MMVARI"},
|
||||
{1, "<%VERMINOR>","MMVARIのマイナーバージョン", "Program minor version of MMVARI"},
|
||||
{1, "<%VARITYPE>","バリコード種別(VariSTD, VariJA, VariHL, ...)", "Type of the VARICODE(VariSTD, VariJA, VariHL, ...)"},
|
||||
{1, "<%MODE>","現在のモード(変調方式)種別(GMSK, FSK, ...)", "Current type of the mode(GMSK, FSK, ...)"},
|
||||
{1, "<%Level>","信号のS/Nレベル(dB)", "S/N level of the signals"},
|
||||
{1, "<%PeakLevel>","信号のピークS/Nレベル(dB)", "Peak S/N level of the signals"},
|
||||
{1, "<%AverageLevel>","信号の平均S/Nレベル(dB)", "Average S/N level of the signals"},
|
||||
{1, "<%MetricMFSK>","mfsk信号のメトリックレベル", "Metric level in mfsk"},
|
||||
{1, "<%MetricMFSK=even>","mfsk信号のビタビ別メトリックレベル(even/odd)", "Metric level of the viterbi in mfsk (even/odd)"},
|
||||
{1, "<%SquelchLevel=3.0>","スケルチレベル(S/N=dB)の設定", "Set squelch level (S/N=dB)"},
|
||||
{1, "<%CWID>","My callsignをCWで送信", "CWID of the MyCallsign"},
|
||||
{1, "<%CWID= 73 :>","文字列をCWで送信 (AS @ SK : AR ; KN ] BT =)", "CWID of the strings (AS @ SK : AR ; KN ] BT =)"},
|
||||
{1, "<%CWSpeed=20>","CW速度(10 - 60)を設定", "CWID speed (10-60)"},
|
||||
{1, "<%MODE=GMSK>","モード(変調方式)の設定(GMSK, FSK, ...)", "Set the mode(GMSK, FSK, ...)"},
|
||||
{1, "<%AutoNET>","自動的にNETをONにする", "Turns NET into ON automatically"},
|
||||
{1, "<%NETON>","NETをONにする", "Turns NET into ON"},
|
||||
{1, "<%NETOFF>","NETをOFFにする", "Turns NET into OFF"},
|
||||
{1, "<%AFCON>","AFCをONにする", "Turns AFC into ON"},
|
||||
{1, "<%AFCOFF>","AFCをOFFにする", "Turns AFC into OFF"},
|
||||
{1, "<%ATCON>","ATCをONにする", "Turns ATC into ON"},
|
||||
{1, "<%ATCOFF>","ATCをOFFにする", "Turns ATC into OFF"},
|
||||
{1, "<%RxCarrier>","受信キャリア周波数(Hz)", "RX carrier FREQ(Hz)"},
|
||||
{1, "<%TxCarrier>","送信キャリア周波数(Hz)", "TX carrier FREQ(Hz)"},
|
||||
{1, "<%RxCarrier=1750>","受信キャリア周波数(Hz)を設定", "Set RX carrier FREQ(Hz)"},
|
||||
{1, "<%TxCarrier=1750>","送信キャリア周波数(Hz)を設定", "Set TX carrier FREQ(Hz)"},
|
||||
{1, "<%AFCFrequency>","AFC検出周波数(Hz)", "AFC FREQ(Hz)"},
|
||||
{1, "<%MouseFrequency>","スペクトラム/ウォータフォールでのマウス周波数(Hz)", "Mouse frequency on Waterfall(Hz)"},
|
||||
{1, "<%TONE>","シングルトーンを送信", "Transmit single tone"},
|
||||
{1, "<%BPF=0>","BPF帯域幅(0-3)を設定", "Set BPF width (0-3)"},
|
||||
{1, "<%BPFTaps=64,80,128,256>","BPFのタップ数を設定", "Set BPF taps"},
|
||||
{1, "<%Notch=ONOFF>","ノッチフィルタのON/OFF (ON/OFF/ONOFF)", "Turns Notch into ON or OFF (ON/OFF/ONOFF)"},
|
||||
{1, "<%Notch=1750>","ノッチフィルタの周波数(Hz)を設定", "Set Notch FREQ (Hz)"},
|
||||
{1, "<%NotchTaps=128>","ノッチフィルタのタップ数を設定(16~512)", "Set taps of the Notch filter (16-512)"},
|
||||
{1, "<%NotchWidth=1>","ノッチフィルタの帯域を設定(1~1000)", "Set width of the Notch filter (1-1000)"},
|
||||
{1, "<%BAUD>","伝送ボーレート", "BaudRate"},
|
||||
{1, "<%BAUD=31.25>","伝送ボーレート(20~300)を設定", "Set BaudRate(20-300)"},
|
||||
{1, "<%AFCWidth=50>","AFC吸い込み幅(Hz)を設定", "Set AFC FREQ width(Hz)"},
|
||||
{1, "<%AFCLevel=12>","AFC吸い込みレベル(dB)を設定", "Set AFC sense level(dB)"},
|
||||
{1, "<%ATCSpeed=0>","ATC応答速度(0-5)を設定", "Set ATC speed(0-5)"},
|
||||
{1, "<%ATCLevel=15>","ATC検出レベル(dB)を設定", "Set ATC sense level(dB)"},
|
||||
{1, "<%ATCPPM>","ATC値(ppm)", "ATC value (ppm)"},
|
||||
{1, "<%PTT=COM1>","PTTポートを設定", "Set PTT port"},
|
||||
{1, "<%COMFSK=ONOFF>","PTTポート FSKのON/OFF (ON/OFF/ONOFF)", "Turns FSK into ON or OFF (ON/OFF/ONOFF)"},
|
||||
{1, "<%COMFSKINV=ONOFF>","PTTポート FSKの論理反転のON/OFF (ON/OFF/ONOFF)", "Turns inverting logic (FSK) into ON or OFF (ON/OFF/ONOFF)"},
|
||||
{1, "<%Radio=COM2>","Radioポートを設定", "Set Radio port"},
|
||||
{1, "<%RadioOut=\\$000000000F>","Radioポートにデータを出力", "Output data to the radio port"},
|
||||
{1, "<%RadioCarrierKHz>","リグの補正キャリア周波数(KHz)", "Adjusted carrier FREQ(KHz) of the radio"},
|
||||
{1, "<%RadioKHz>","リグのVFO周波数(KHz)", "VFO FREQ(KHz) of the radio"},
|
||||
{1, "<%RadioKHz=YAESU-HF,14073.000>","リグのVFO周波数(KHz)の設定", "Set VFO FREQ(KHz) of the radio"},
|
||||
{1, "<%RadioMode>","リグのモード", "Mode of the radio"},
|
||||
{1, "<%RadioMode=CI-V,LSB>","リグのモードを設定", "Set Mode of the radio"},
|
||||
{1, "<%PTTON>","PTTをONにする", "Turns PTT into ON"},
|
||||
{1, "<%PTTOFF>","PTTをOFFにする", "Turns PTT into OFF"},
|
||||
{1, "<%FFTScale>","FFTスケール(0-100dB, 1-60dB, 2-二乗振幅)", "FFT scale (0-100dB, 1-60dB, 2-Square amplitude)"},
|
||||
{1, "<%FFTScale=2>","FFTスケールを設定", "Set FFT scale"},
|
||||
{1, "<%FFTWidth=1000>","FFT表示幅(500/1000/2000/3000)", "Choose FFT width(500/1000/2000/3000)"},
|
||||
{1, "<%SyncWidth=14>","Sync/Wave表示幅(4-24)", "Choose Sync/Waveform width(4-24)"},
|
||||
{1, "<%ShowCH=1,ONOFF>","サブチャンネル(1-8)表示, ON/OFF/ONOFF", "Show sub-channel(1-8), ON/OFF/ONOFF"},
|
||||
{1, "<%SetCHSpeed=1,31.25>","サブチャンネル(1-8)のボーレート設定, 15~300", "Set speed to the sub-channel(1-8), 15-300"},
|
||||
{1, "<%SetCHMode=1,GMSK>","サブチャンネル(1-8)のモード設定", "Set mode to the sub-channel(1-8)"},
|
||||
{1, "<%ClearCHW=1>","サブチャンネル(1-8)の画面クリア", "Clear window of the sub-channel(1-8)"},
|
||||
{1, "<%QSOON>","QSOの開始(ログに記録)", "Start QSO (logging)"},
|
||||
{1, "<%QSOOFF>","QSOの終了(ログに記録)", "End of the QSO (logging)"},
|
||||
{1, "<%FREQ=7>","ログの運用周波数を設定", "Set logging FREQ"},
|
||||
{1, "<%BAND=40m>","ログの運用バンドを設定", "Set logging BAND"},
|
||||
{1, "<%LogMODE=SSB>","ログの運用モードを設定(ヌル文字列で自動設定)", "Set logging MODE (null is auto)"},
|
||||
{1, "<%HisCall=<%Capture>>","相手局のコールを設定", "Set his/her callsign"},
|
||||
{1, "<%HisRST=599>","相手局のRSTを設定", "Set his/her RST"},
|
||||
{1, "<%MyRST=599>","自局のRSTを設定", "Set my RST"},
|
||||
{1, "<%Note=<%VARITYPE>>","Note(備考)に設定", "Set note (Remarks)"},
|
||||
{1, "<%RefRXW>","受信画面の参照画面を開く", "Show RX window with the editor"},
|
||||
{1, "<%EditFile=memo.txt, 0>","テキストファイル編集画面を開く(Name, ReadOnly)", "Open text editer(Name, ReadOnly)"},
|
||||
{1, "<%SendFile=test.txt>","テキストファイルの送信", "Send file"},
|
||||
{1, "<%EditMacro=2>","マクロボタン(1~160)を編集", "Edit macro button (1-160)"},
|
||||
{1, "<%EditMacro=OnStart>","イベントマクロを編集(Event名)", "Edit event macro (Name of the event)"},
|
||||
{1, "<%EditMacro=AS(CW)>","AS(CW)マクロを編集(Event)", "Edit AS(CW) macro"},
|
||||
{1, "<%EditMacro=MacroTxt.txt>","テキストファイルのマクロを編集", "Edit macro written in the text file"},
|
||||
{1, "<%MacroText=MacroTxt.txt>","テキストファイルのマクロを実行", "Execute macro written in the text file"},
|
||||
{1, "<%SaveMacro=Macros.mac>","全てのマクロをファイルに保存", "Save all Macros"},
|
||||
{1, "<%LoadMacro=Macros.mac>","全てのマクロをファイルからロード", "Load all Macros"},
|
||||
{1, "<%HEX2DEC=ABCD>","16進数を10進数に変換", "Convert decimal to HEX"},
|
||||
{1, "<%CHAR=A>","文字コード(10進数)に変換", "Convert character code (decimal)"},
|
||||
{1, "<%CHARX=A>","文字コード(16進数)に変換", "Convert character code (HEX)"},
|
||||
{1, "<%CODE=82A0>","文字コード(16進数)で入力", "Input as the character code (HEX)"},
|
||||
{1, "<%SP>","スペースを入力", "Input space"},
|
||||
{1, "<%CR>","CRを入力", "Input CR"},
|
||||
{1, "<%BS>","BSを入力", "Input BS"},
|
||||
{1, "<%TAB>","TABを入力", "Input TAB"},
|
||||
{1, "<%SkipCR>","マクロ文内の次のCR(改行)をスキップ", "Skip next CR(Enter) in the macro sentence"},
|
||||
{1, "<%DisableCR>","マクロ文内のCR(改行)を無効にする", "Disable CR(Enter) in the macro sentence"},
|
||||
{1, "<%EnableCR>","マクロ文内のCR(改行)を有効にする", "Enable CR(Enter) in the macro sentence"},
|
||||
{1, "<%DisableTAB>","マクロ文内のTABを無効にする", "Disable TAB in the macro sentence"},
|
||||
{1, "<%EnableTAB>","マクロ文内のTABを有効にする", "Enable TAB in the macro sentence"},
|
||||
{1, "<%DisableSP>","マクロ文内のスペースを無効にする", "Disable SPACE in the macro sentence"},
|
||||
{1, "<%EnableSP>","マクロ文内のスペースを有効にする", "Enable SPACE in the macro sentence"},
|
||||
{1, "<%Skip$=3,<%HisCall>>","指定の文字数をスキップ(Ascii)", "Skip Ascii characters"},
|
||||
{1, "<%MSkip$=3,<%Note>>","指定の文字数をスキップ(MBCS)", "Skip MBCS characters"},
|
||||
{1, "<%Find$=xx,ABCxxVVV>","指定の文字列を検索", "Find string"},
|
||||
{1, "<%StrLen=<%HisCall>>","文字列の長さ", "String length"},
|
||||
{1, "<%MStrLen=<%Note>>","MBCS文字列の長さ", "MBSC string length"},
|
||||
{1, "<%ONOFF=<%Cond=IsSQ>>","ON/OFFを得る", "Get ON/OFF"},
|
||||
{1, "<%RepeatText=3,<%RepeatText=33,RY><%CR>>","マクロ文字列の繰り返し", "Repeating the macro string"},
|
||||
{1, "<%IDLE>","アイドル信号を挿入", "Insert idle signals"},
|
||||
{1, "<%DIDDLE=LTR>","RTTYのDIDDLEコードを設定(BLK/LTR)", "Set DIDDLE code in RTTY (BLK/LTR)"},
|
||||
{1, "<%UOS=ON>","RTTYのUOSを設定(ON/OFF/ONOFF)", "Set UOS in RTTY (ON/OFF/ONOFF)"},
|
||||
{1, "<%RTTYWaitC=0>","RTTYの文字ウエイトを設定(0-100)", "Set character wait in RTTY (0-100)"},
|
||||
{1, "<%RTTYWaitD=0>","RTTYのDIDDLEウエイトを設定(0-100)", "Set DIDDLE wait in RTTY (0-100)"},
|
||||
{1, "<%RTTYWordOut=ON>","RTTYのワード単位出力を設定(ON/OFF/ONOFF)", "Set word out in RTTY (ON/OFF/ONOFF)"},
|
||||
{1, "<%RTTYDEM=FFT>","RTTYの復調器を設定(IIR/FFT)", "Set demodulator in RTTY (IIR/FFT)"},
|
||||
{1, "<%TxShift=170.0>","RTTY/FSK-Wの送信シフト幅を設定(10-450)", "Set TX's shift width in RTTY/FSK-W (10-450)"},
|
||||
{1, "<%RxShift=170.0>","RTTY/FSK-Wの受信シフト幅を設定(10-450)", "Set RX's shift width in RTTY/FSK-W (10-450)"},
|
||||
{1, "<%ToUpper=<%HisName>>","アッパーケース(大文字)に変換", "Convert to upper case"},
|
||||
{1, "<%ToLower=<%HisCall> de <%MyCall>>","ロワーケース(小文字)に変換", "Convert to lower case"},
|
||||
{1, "<%IME=ON>","IMEを制御する (ON/OFF/ONOFF)", "Control IME (ON/OFF/ONOFF)"},
|
||||
{1, "<%RepeatTX=3000>","繰り返し送信の受信時間(ms)を設定", "Repeating TX mode (=RX times(ms))"},
|
||||
{1, "<%Repeat=10000>","マクロの繰り返し(ms)を設定", "Repeating the macro (ms)"},
|
||||
{1, "<%OnTimer=<%WaterMsg=4,<%AFCFrequency>Hz>>","OnTimerマクロを設定", "Set OnTimer macro"},
|
||||
{1, "<%OnTimerInterval=1000>","OnTimerマクロの時間間隔(ms)を設定", "Set time interval(ms) of OnTimer macro"},
|
||||
{1, "<%Page=1>","送信画面ページを切り替え (1~4)", "Choose TXW-page (1-4)"},
|
||||
{1, "<%AutoReturn>","自動的に送信画面ページを戻す", "Return TXW-page automatically"},
|
||||
{1, "<%MoveTop>","カーソルを先頭に移動", "Move cursor to the TOP"},
|
||||
{1, "<%MoveEnd>","カーソルを最後に移動", "Move cursor to the END"},
|
||||
{1, "<%ResetScroll>","受信画面のスクロール状態を解除", "Reset scroll in the RX window"},
|
||||
{1, "<%PopupTXW>","送信画面のポップアップメニューを開く", "Open Popup menu"},
|
||||
{1, "<%DupeText>","1つ前の行と同じ内容を挿入", "Create dupe text"},
|
||||
{1, "<%SeekNext>","ボタンページを次へ", "Seek to the next Button page"},
|
||||
{1, "<%SeekPrev>","ボタンページを前へ", "Seek to the previous Button page"},
|
||||
{1, "<%SeekTop>","ボタンページを先頭へ", "Seek to the top Button page"},
|
||||
{1, "<%DigitalLevel=16384>","デジタル出力レベルを設定(1024 - 32768)", "Set digital output level (1024 - 32768)"},
|
||||
{1, "<%OutputVolume>","出力ボリューム調整画面を開く", "Open output volume"},
|
||||
{1, "<%InputVolume>","入力ボリューム調整画面を開く", "Open input volume"},
|
||||
{1, "<%Setup>","設定画面を開く", "Open Setup window"},
|
||||
{1, "<%SetupLog>","ログ設定画面を開く", "Open Setup logging window"},
|
||||
{1, "<%SetupRadio>","リグコントロール設定画面を開く", "Open Setup radio command window"},
|
||||
{1, "<%Calibration>","クロック較正画面を開く", "Open calibration window"},
|
||||
{1, "<%BaseClock>","ベースクロック値(Hz)", "Base clock(Hz)"},
|
||||
{1, "<%Clock>","RXクロック値(Hz)", "RX clock(Hz)"},
|
||||
{1, "<%Clock=11025.00>","RXクロック値を設定", "Set RX clock"},
|
||||
{1, "<%TxOffset>","TXオフセット値(Hz)", "TX offset clock(Hz)"},
|
||||
{1, "<%TxOffset=0.00>","TXオフセット値を設定", "Set TX offset clock"},
|
||||
{1, "<%DemodulatorClock>","復調器クロック値(Hz)", "Demodulator clock(Hz)"},
|
||||
{1, "<%FFTClock>","FFTクロック値(Hz)", "FFT clock(Hz)"},
|
||||
{1, "<%FFTSize>","FFTのサイズ(点数)", "FFT size(points)"},
|
||||
{1, "<%WaterNoise>","ウォータフォールの検出ノイズレベル(dB)", "Sense noise level (dB) in WaterFall"},
|
||||
{1, "<%WaterNoise=35,65>","ウォータフォールのノイズレベル範囲(dB)を設定", "Set noise level range (dB) in WaterFall"},
|
||||
{1, "<%WaterLevels>","ウォータフォールのレベル配分", "Levels in WaterFall"},
|
||||
{1, "<%WaterLevels=10,60,134,192,220,240>","ウォータフォールのレベル配分を設定", "Set levels in WaterFall"},
|
||||
{1, "<%WaterColors>","ウォータフォールの配色", "Colors in WaterFall"},
|
||||
{1, "<%WaterColors=0,FF0000,FFFFFF,FF,FFFF00,FF0000,FFFF00,FFFF,80FF,FF,FF,FF>","ウォータフォールの配色を設定", "Set colors in WaterFall"},
|
||||
{1, "<%SpectrumColors>","スペクトラムの配色", "Colors in Spectrum"},
|
||||
{1, "<%SpectrumColors=0,FF00,FFFFFF,808080,FFFF00,FF0000>","スペクトラムの配色を設定", "Set colors in Spectrum"},
|
||||
{1, "<%RxColors>","受信画面の配色", "Colors in RX window"},
|
||||
{1, "<%RxColors=FFFFFF,0,FF0000,FF,E0E0E0>","受信画面の配色を設定", "Set colors in RX window"},
|
||||
{1, "<%TxColors>","送信画面の配色", "Colors in TX window"},
|
||||
{1, "<%TxColors=FFFFFF,0,FF0000,FF,FFFFFF>","送信画面の配色を設定", "Set colors in TX window"},
|
||||
{1, "<%SoundName>","入力サウンドの名前", "Name of the input sound device"},
|
||||
{1, "<%SoundOutName>","出力サウンドの名前", "Name of the output sound device"},
|
||||
{1, "<%SoundDevice=MONO,-1>","サウンドCH(MONO/LEFT/RIGHT)とデバイスIDの設定", "Set CH.(MONO/LEFT/RIGHT) es device ID of the sound"},
|
||||
{1, "<%Suspend>","サスペンドにする", "Suspend MMVARI"},
|
||||
{1, "<%Resume>","サスペンドを解除する", "Resume MMVARI"},
|
||||
{1, "<%Wait=1000>","指定時間(ms)ウエイトする", "Wait the time (ms)"},
|
||||
{1, "<%Execute=notepad.exe <%Folder>memo.txt>","プログラムの実行", "Execute other program"},
|
||||
{1, "<%Shell=<%Folder>emmvari.txt>","シェルでドキュメントを開く", "Open document by Shell32"},
|
||||
{1, "<%Exit>","MMVARIを終了する", "Exit MMVARI"},
|
||||
{1, "<%ShutDown>","Windowsをシャットダウンする", "Shut down Windows"},
|
||||
{1, "<%YesNo=String>","Yes/Noのメッセージボックス(Yes=6,No=7)", "Show Yes/No message(Yes=6,No=7)"},
|
||||
{1, "<%YesNoCancel=String>","Yes/No/Cancelのメッセージボックス(Yes=6,No=7,Cancel=2)", "Show Yes/No/Cancel message(Yes=6,No=7,Cancel=2)"},
|
||||
{1, "<%OkCancel=String>","Ok/Cancelのメッセージボックス(Ok=1,Cancel=2)", "Show Ok/Cancel message(Ok=1,Cancel=2)"},
|
||||
{1, "<%Error=Macro ERROR>","エラーメッセージを表示", "Show error message"},
|
||||
{1, "<%Warning=Macro WARNING>","警告メッセージを表示", "Show warning message"},
|
||||
{1, "<%Message=Macro message>","メッセージを表示", "Show message"},
|
||||
{1, "<%WaterMsg=4,Metric=<%MetricMFSK>><%Repeat=1000>","ウォータフォールにメッセージを表示(位置=0-4)", "Show message in the WaterFall (Pos. 0-4)"},
|
||||
{1, "<%RxStatus=Status>","受信画面にステータスを表示", "Show status in the RX window"},
|
||||
{1, "<%TableCount=AAA,BBB,CCC>","テーブルの項目数を得る", "Get count of the table"},
|
||||
{1, "<%TableStr=1,AAA,BBB,CCC>","テーブルの文字列を得る", "Get string of the table"},
|
||||
{1, "<%Table=<%BAUD>,20.0,31.25,45.0>","テーブルのインデクッスを得る", "Get index of the table"},
|
||||
{1, "<%Menu=A,B,C,D>","メニューの表示(Input$に入る)", "Show menu (Put into Input$)"},
|
||||
{1, "<%MenuB=\x22<%Table=<%BAUD>,20.0,31.25,45.45,62.5>\x22,20.0,31.25,45.45,62.5>","マーク付きメニューの表示(Input$に入る)", "Show menu with mark (Put into Input$)"},
|
||||
{1, "<%Menu>","メニューインデックス", "menu index"},
|
||||
{1, "<%Input=Input strings>","文字列の入力", "Input strings"},
|
||||
{1, "<%Input$>","入力された文字列", "The strings which was entered"},
|
||||
{1, "<%Click$>","受信画面でクリックした文字列", "The strings which was clicked in the RX window"},
|
||||
{1, "<%CLICK$>","受信画面でクリックした文字列(大文字)", "The strings (upper case) which was clicked in the RX window"},
|
||||
{1, "<%vvv>","テストメッセージ(英語)", "test message"},
|
||||
{2, "<%VVV>","テストメッセージ(日本語)", "test message"},
|
||||
{1, "<%KeyStroke=41>","キー(VK code)を押して離す", "Down and up the keyboard (VK code)"},
|
||||
{1, "<%KeyDown=12><%KeyStroke=<%CHARX=V>><%KeyUp=12>","キー(VK code)を押す(Shift=10,Ctrl=11,Alt=12)", "Down the keyboard(VK code, Shift=10,Ctrl=11,Alt=12)"},
|
||||
{1, "<%KeyUp=12>","キー(VK code)を離す(Shift=10,Ctrl=11,Alt=12)", "Up the keyboard(VK code, Shift=10,Ctrl=11,Alt=12)"},
|
||||
{1, "<%DoMacro=2>","マクロボタン(1~160)を実行", "Execute macro button (1-160)"},
|
||||
{1, "<%DoEvent=OnMode>","イベントマクロを実行", "Execute event macro"},
|
||||
{1, "<%Events>","イベントのリスト", "List of the events"},
|
||||
{1, "<%ButtonName=1,Clear>","マクロボタン(1~160)の名前を設定", "Set name of the button (1-160)"},
|
||||
{1, "<%ButtonContents=1,<%ClearTXW>>","マクロボタン(1~160)の内容を設定", "Set contents of the button (1-160)"},
|
||||
{1, "<%PlayBack=ON>","サウンドプレーバックボタン機能の設定(ON/OFF/ONOFF)", "Set Sound Playback function (ON/OFF/ONOFF)"},
|
||||
{1, "<%PlayBack=10>","サウンドプレーバック(0~60秒)を実行", "Execute Sound Playback (0-60s)"},
|
||||
{1, "<%PlayBackSpeed=5>","サウンドプレーバックの速度(1~20)を設定", "Set speed of the Sound Playback (1-20)"},
|
||||
{1, "<%PlayBackButtons=60,30,15>","サウンドプレーバックボタンの時間を設定", "Set time of the Sound Playback buttons"},
|
||||
{1, "<%PlaySound=sound.mmv>","サウンドファイルの再生", "Sound playing from the file"},
|
||||
{1, "<%PlaySound>","サウンドファイルの再生ダイアログを表示する", "Show sound playing dialog"},
|
||||
{1, "<%RecordSound=sound.mmv>","サウンドファイルの録音", "Sound recording to the file"},
|
||||
{1, "<%RecordSound>","サウンドファイルの録音ダイアログを表示する", "Show sound recording dialog"},
|
||||
{1, "<%QuickRecordSound>","サウンドファイルの録音", "Sound recording (filename = Time stamp)"},
|
||||
{1, "<%StopPlayRecord>","サウンド再生/録音の停止", "Close recording or playing"},
|
||||
{1, "<%SoundTime>","再生/録音時間(秒)", "Time (sec) of sound (playing or recording)"},
|
||||
{1, "<%Slider=CW speed,<%CWSpeed>,10,60,1,10>","スライダーを表示(タイトル,値,Min,Max,ステップ,目盛の数) Input$に入る", "Show slider (Title,Value,Min,Max,Step,Scale) Put into Input$"},
|
||||
{1, "<%FileDialog=Text file,Text Files(*.txt)|*.txt|,Default,txt,>","ファイル選択ダイアログを表示(Input$に入る)", "Show choose file dialog box (Put into Input$)"},
|
||||
{1, "<%CPUBENCHMARK>","CPUベンチマーク値 (us)", "The values of CPU-benchmark (us)"},
|
||||
{1, "<%RANDOM=<%PTIME>>","乱数の種の初期化", "Initialization of a random seed"},
|
||||
{1, "<%RANDOM>","乱数(0~32767)", "A random values (0 - 32767)"},
|
||||
{1, "<%String=Name>","#defineで定義した文字列を展開", "Defined strings by #define"},
|
||||
{1, "<%CallProc=Name>","プロシジャーを実行", "Execute the procedure"},
|
||||
{1, "<%DebugProc=Name>","<%CallProc=...>のデバッグ版", "Debug version of <%CallProc=...>"},
|
||||
{1, "<%Format=%.3f,<%BAUD>>","書式変換(C言語)指定で展開 (書式文字列,式)", "Convert format (C Language) string"},
|
||||
{1, "<%Inv=<%Cond=IsSQ>>","論理を反転", "Invert logic"},
|
||||
{1, "<%Floor=<%BAUD>>","小数点以下を切り捨て", "Returns the largest integer that is not greater than the argument"},
|
||||
{1, "<%Log=10>","自然対数を計算", "Calculates logarithms"},
|
||||
{1, "<%Exp=2.302585092994046>","指数関数 e の x 乗を計算", "Calculates the exponential"},
|
||||
{1, "<%Sqrt=10>","平方根を計算", "Calculates the square root"},
|
||||
{1, "<%Pow=10,2>","x の y 乗を計算", "Calculates x raised to the power of y"},
|
||||
{1, "<%Sin=0.5>","sin(x)を計算", "Calculates the sin(x)"},
|
||||
{1, "<%Cos=0.5>","cos(x)を計算", "Calculates the cos(x)"},
|
||||
{1, "<%Tan=0.5>","tan(x)を計算", "Calculates the tan(x)"},
|
||||
{1, "<%ArcTan=0.5>","arc-tan(x)を計算", "Calculates the arc-tan(x)"},
|
||||
{1, "<%Cond=IsSQ>","条件命令のテスト結果(0-FALSE, 1-TRUE)", "Test result of condition command (0-FALSE, 1-TRUE)"},
|
||||
{1, "<%ListSpeed=15.625,31.25,62.5,93.75,125.0,250.0>","Speedボックスのリストを設定", "Set list of Speed box"},
|
||||
{1, "<%ListCarrier=500,800,1000,1200,1500,1750,2000,2210>","Carrierボックスのリストを設定", "Set list of Carrier box"},
|
||||
{1, "<%ListRST=599,579,559,449,339>","RSTボックスのリストを設定", "Set list of RST box"},
|
||||
{1, "<%ListLogFreq=1.8,3.5,7,10,14,18,21,24,28,50,144,430,1200>","ログ周波数ボックスのリストを設定", "Set list of Log-FREQ box"},
|
||||
{1, "<%SetCaptureLimit>","文字列捕獲の検索範囲を設定", "Set the limit of the capturing range"},
|
||||
{1, "<%ClearCaptureLimit>","文字列捕獲の検索範囲をクリア", "Clear the limit of the capturing range"},
|
||||
{1, "<%Font>","受信画面のフォントパラメータ(Name, Size, Charset)", "Font parameters of the RX window (Name, Size, Charset)"},
|
||||
{1, "<%Font=,14,>","受信/送信画面のフォントを設定(=Name, Size, Charset)", "Sets font into the TX/RX window (=Name, Size, Charset)"},
|
||||
{1, "<%SetFocus>","送信画面にキーボードフォーカスを設定する", "Sets keyboard focus to the TX window"},
|
||||
{1, "<%Folder>","MMVARIのフォルダ", "MMVARI's folder"},
|
||||
{1, "<%AddMenu=E&X,Caption&1,OnCaption1Click>","拡張メニューの追加 (=Name,Caption,Procedure,Arg...)", "Add extension menu (=Name,Caption,Procedure,Arg...)"},
|
||||
{1, "<%InsertMenu=&H,&P,Caption&1, OnCaption1Click>","拡張メニューの挿入 (=Name,InsPos,Caption,Procedure,Arg...)", "Insert extension menu (=Name,InsPos,Caption,Procedure,Arg...)"},
|
||||
{1, "<%ShowMenu=&F, ONOFF>","メニューの表示 (=Name...,ON/OFF/ONOFF)", "Show the menu (=Name...,ON/OFF/ONOFF)"},
|
||||
{1, "<%EnableMenu=&F, ONOFF>","メニューの許可 (=Name...,ON/OFF/ONOFF)", "Enable the menu (=Name...,ON/OFF/ONOFF)"},
|
||||
{1, "<%ShortCut=&V, &C, &1, Ctrl+1>","メニューにショートカットを設定 (=Name...,Key)", "Set menu short cut (=Name...,Key)"},
|
||||
{1, "<%CheckMenu=&H, &P, ONOFF>","メニューにチェックの付ける (=Name...,ON/OFF/ONOFF)", "Set menu check (=Name...,ON/OFF/ONOFF)"},
|
||||
{1, "<%DeleteMenu=&X>","メニューを削除 (=Name...)", "Delete menu (=Name...)"},
|
||||
{1, "<%DoMenu=&V,&C,&1>","メニューを実行 (=Name...)", "Execute the menu (=Name...)"},
|
||||
{1, "<%DoButton=FFT>","ボタンをクリックする", "Click the button"},
|
||||
{1, "<%ShowHTML=home>","HTML/ウェーブサイトを表示", "Show html or Web site"},
|
||||
{1, "<%SendMessage=PSKGNRFUNC,0,1>","ウインドウメッセージの送信 (=Name, wParam, lParam)", "Send window message (=Name, wParam, lParam)"},
|
||||
// {1, "<%SendMessage=this,16,0,0>","ウインドウメッセージの送信 (this, uMsg, wParam, lParam)", "Send window message (this, uMsg, wParam, lParam)"},
|
||||
// {1, "<%CallDLL=QRZ.DLL,FuncName,<%HisCall>>","DLLファンクションの呼び出し", "Call the function in the DLL"},
|
||||
{1, "<%Memory>","メモリ状態(Load[%],Total[MB],Free[MB])", "Memory status(Load[%],Total[MB],Free[MB])"},
|
||||
{1, "<%BuffSize=4096>","マクロバッファの最小のサイズを設定(512-65536)", "Set minimum buffer size for Macro function (512-65536)"},
|
||||
{1, "<%EOF>","定義の終了", "End of the macro"},
|
||||
{0, NULL, NULL},
|
||||
};
|
||||
|
||||
#if AN(mackeycom) >= MACLISTMAX
|
||||
#error macro key over follow
|
||||
#endif
|
||||
|
||||
MACKEY condcom[]={
|
||||
{1, "IsCall","Callに文字が存在する時", "Letters exists in the Call-box"},
|
||||
{1, "IsName","Nameに文字が存在する時", "Letters exists in the Name-box"},
|
||||
{1, "IsHisRST","Hisに文字が存在する時", "Letters exists in the His-box"},
|
||||
{1, "IsMyRST","Myに文字が存在する時", "Letters exists in the My-box"},
|
||||
{1, "IsQTH","QTHに文字が存在する時", "Letters exists in the QTH-box"},
|
||||
{1, "IsNote","Noteに文字が存在する時", "Letters exists in the Note-box"},
|
||||
{1, "IsLocal","同じエンティティの時", "Same entity (country)"},
|
||||
{1, "IsQSO","QSOボタンを押している時", "QSO button down"},
|
||||
{1, "IsDupe","重複QSOの場合", "Is dupe QSO?"},
|
||||
{1, "IsAFC","AFCがONの時", "Is AFC ON?"},
|
||||
{1, "IsNET","NETがONの時", "Is NET ON?"},
|
||||
{1, "IsTX","送信中の時", "Is transmitting?"},
|
||||
{1, "IsPTT","PTTがONの時", "Is PTT ON?"},
|
||||
{1, "IsSQ","スケルチが開いている時", "Is Squelch open?"},
|
||||
{1, "IsTone","シングルトーン送信中の時", "Is single tone transmitting?"},
|
||||
{1, "IsTXEmpty","未送信文字が存在しない時", "Letters do not exist in the TX window"},
|
||||
{1, "IsRXScroll","受信画面がスクロール中の時", "Is RX window scrolling?"},
|
||||
{1, "IsRepeat","マクロが繰り返し中の時", "Is the macro repeating?"},
|
||||
{1, "IsIME","IMEがONの時", "Is IME ON?"},
|
||||
{1, "IsPlaying","サウンド再生中の時", "Is sound playing?"},
|
||||
{1, "IsFileSending","ファイル送信中の時", "Is file sending?"},
|
||||
{1, "IsRecording","サウンド録音中の時", "Is sound recording?"},
|
||||
{1, "IsFile(test.txt)","ファイルが存在する時", "File exists"},
|
||||
{1, "IsDefined(Name)","文字列変数が存在する時", "Variable strings exists"},
|
||||
{1, "IsMBCS(<%HisName>)","文字列にMBCSが含まれる時", "Is string including MBCS?"},
|
||||
{1, "IsAlpha(<%MyNR>)","文字列がアルファベットの時", "Is string alphabet?"},
|
||||
{1, "IsNumber(<%MyNR>)","文字列が数字の時", "Is string number?"},
|
||||
{1, "IsUOS","RTTYのUOSがONの時", "Is UOS active in RTTY?"},
|
||||
{1, "IsRadioLSB","RigがLSBモードの時", "Is LSB of the radio?"},
|
||||
{1, "IsCaptureText(CQ)","受信テキストに文字列が存在する時", "Does string exist in the received text?"},
|
||||
{1, "IsOnTimer","OnTimerマクロを実行中の時", "Is OnTimer executing?"},
|
||||
{1, "IsIdle","アイドル状態の時", "Is idle?"},
|
||||
{1, "IsEnglish","英語モードの時", "Is English mode running?"},
|
||||
{1, "IsMfskCenter","mfskが中心周波数合わせの時", "Is center FREQ handling in mfsk?"},
|
||||
{1, "IsMfskMetricSq","mfskがメトリックスケルチの時", "Is squelch metric in mfsk?"},
|
||||
{1, "Is1stCR","送信開始時に自動でCR/LF出力する時", "Is CR/LF sending automatically at the beginning?"},
|
||||
{1, "IsPlayBack","サウンドプレーバック機能がONの時", "Is sound play back enabled?"},
|
||||
{1, "IsCodeMM","MMVARIコード(VariJA, VariHL,...)の時", "Is MMVARI code (VariJA, VariHL,...)?"},
|
||||
{1, "IsCall(<%CLICK$>)","文字列がコールサインの時", "Is the strings call sign?"},
|
||||
{1, "IsRST(<%CLICK$>)","文字列がRSTの時", "Is the strings RST?"},
|
||||
{1, "IsMenu(&H, &U)","メニューが存在する時", "Menu exists?"},
|
||||
{1, "IsMenuEnabled(&H, &U)","メニューが許可されている時", "Is the menu enabled?"},
|
||||
{1, "IsMenuChecked(&H, &U)","メニューがチェックされている時", "Is the menu checked?"},
|
||||
{1, "IsMenuVisible(&H, &U)","メニューが表示されている時", "Is the menu visible?"},
|
||||
{1, "IsButton(QSO)","ボタンが存在する時", "Button exists?"},
|
||||
{1, "IsButtonEnabled(QSO)","ボタンが許可されている時", "Is the button enabled?"},
|
||||
{1, "IsButtonDown(QSO)","ボタンが押されている時", "Is the button down?"},
|
||||
{1, "ValFreq>=144","ログ周波数の比較", "Compare logging FREQ"},
|
||||
{1, "ValBaud==31.25","伝送速度(Bps)の比較", "Compare speed (baudrate)"},
|
||||
{1, "ValCarrierRX<1500","受信キャリア周波数の比較", "Compare RX carrier FREQ"},
|
||||
{1, "ValCarrierTX<1500","送信キャリア周波数の比較", "Compare TX carrier FREQ"},
|
||||
{1, "ValPage!=1","送信画面ページの比較", "Compare TX window page"},
|
||||
{1, "ValTimeLocal<1200","時刻(Local)の比較", "Compare Local time"},
|
||||
{1, "ValTimeUTC>=0900","時刻(UTC)の比較", "Compare UTC time"},
|
||||
{1, "ValDateLocal>=0801","日付(Local)の比較", "Compare Local date"},
|
||||
{1, "ValDateUTC<0401","日付(UTC)の比較", "Compare UTC date"},
|
||||
{1, "ValScope","スコープの状態を比較(FFT=0, WF=1, SYNC=2)", "Compare condition of the scope (FFT=0, WF=1, SYNC=2)"},
|
||||
{1, "ValMacro(<%VER>)>="VERNO,"マクロ展開文字列の数値を比較", "Compare value of the Macro"},
|
||||
{1, "ValMenu","選択された<%Menu=...>のインデックス番号を比較", "Compare value of the selected <%Menu=...> index"},
|
||||
{1, "StrCall==JA3QRZ","コールサインの比較", "Compare his callsign"},
|
||||
{1, "StrMode==GMSK","モードの比較", "Compare current Mode"},
|
||||
{1, "StrBand==40m","ログ周波数(バンド)の比較", "Compare logging BAND"},
|
||||
{1, "StrHisRST==599","HisRSTの比較", "Compare HisRST"},
|
||||
{1, "StrMyRST==599","MyRSTの比較", "Compare MyRST"},
|
||||
{1, "StrNote==???","Noteの比較", "Compare Note"},
|
||||
{1, "StrEntity==JA","エンティティの比較", "Compare the entity of his callsign"},
|
||||
{1, "StrContinent==AS","大陸の比較", "Compare the continent of his callsign"},
|
||||
{1, "StrVARITYPE==JA","VARICODE種別(JA/HL/BV/BY/STD)の比較", "Compare type of the VARICODE(JA/HL/BV/BY/STD)"},
|
||||
{1, "StrPLATFORM==XP","Windowsプラットフォーム(95/98/98SE/ME/NT/2000/XP)の比較", "Compare platform of the Windows(95/98/98SE/ME/NT/2000/XP)"},
|
||||
{1, "StrMacro(<%VER>)=="VERNO,"マクロ展開文字列の比較", "Compare strings of the Macro"},
|
||||
{1, "#else","残りのすべてで真", "Rest of all"},
|
||||
{1, "#endif","条件ブロックを終了", "Exit condition block"},
|
||||
{1, "#macro <%TX>","マクロコマンドをパス1で実行", "Execute macro at the pass 1"},
|
||||
{1, "#proc Name","プロシジャーの登録 (Name, Dummy...)", "Register procedure (Name, Dummy...)"},
|
||||
{1, "#endp","プロシジャーの登録の終了", "End of the procedure"},
|
||||
{1, "#repeat 3","#repeat ~ #endpまでを繰り返し", "Repeat the block #repeat to #endp"},
|
||||
{1, "#define Name Strings","文字列を名前変数に定義", "Define variable strings to the name"},
|
||||
{1, "#DEFINE Name Strings","文字列を名前変数に定義(INIフィアルに保存)", "Define variable strings to the name (Save to INI file)"},
|
||||
{1, "#DELETE Name", "名前変数またはプロシジャーを削除", "Delete variable string or procedure"},
|
||||
{1, "#DELETEALL", "すべての名前変数を削除", "Delete all variable strings and procedures"},
|
||||
{1, "#exit","マクロ文の終了(パス1で終了)", "Exit macro at the pass 1"},
|
||||
{1, "#comment","コメント行", "Comment line"},
|
||||
{0, NULL, NULL},
|
||||
};
|
||||
static int g_Pos[2]={0,0};
|
||||
static int g_TopPos[2]={0,0};
|
||||
static POINT g_xySave;//={0,0};
|
||||
//---------------------------------------------------------------------
|
||||
__fastcall TMacroKeyDlg::TMacroKeyDlg(TComponent* AOwner)
|
||||
: TForm(AOwner)
|
||||
{
|
||||
g_xySave.x = 0;
|
||||
g_xySave.y = 0;
|
||||
m_pDlg = NULL;
|
||||
FormStyle = ((TForm *)AOwner)->FormStyle;
|
||||
Font->Name = ((TForm *)AOwner)->Font->Name;
|
||||
Font->Charset = ((TForm *)AOwner)->Font->Charset;
|
||||
if( sys.m_MsgEng ){
|
||||
// Caption = "Choose macro";
|
||||
CancelBtn->Caption = "Close";
|
||||
SBIns->Caption = "Insert";
|
||||
SBSpace->Caption = "Space";
|
||||
SBCR->Caption = "Enter";
|
||||
SBUndo->Caption = "Undo";
|
||||
SBFind->Caption = "Find";
|
||||
SBPrint->Caption = "Print";
|
||||
|
||||
SBIns->Hint = "Insert current command";
|
||||
SBSpace->Hint = "Insert 'Space'";
|
||||
SBCR->Hint = "Insert 'Enter'";
|
||||
SBUndo->Hint = "Cancel of the operation";
|
||||
SBFind->Hint = "Find strings";
|
||||
SBPrint->Hint = "Print the list (Right click for create file)";
|
||||
Grid->Hint = "Insert command for double click (Sort - click the title)";
|
||||
}
|
||||
OnWave();
|
||||
m_Type = 0;
|
||||
m_fSort = FALSE;
|
||||
m_fSortType = 0;
|
||||
m_fDisDblClick = FALSE;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TMacroKeyDlg::FormDestroy(TObject *Sender)
|
||||
{
|
||||
g_xySave.x = Left;
|
||||
g_xySave.y = Top;
|
||||
g_Pos[m_Type] = Grid->Row;
|
||||
g_TopPos[m_Type] = Grid->TopRow;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TMacroKeyDlg::UpdateUI(int row)
|
||||
{
|
||||
int r = row - 1;
|
||||
if( r >= 0 ){
|
||||
SBIns->Enabled = TRUE;
|
||||
}
|
||||
else {
|
||||
SBIns->Enabled = FALSE;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TMacroKeyDlg::UpdateUndo(BOOL undo)
|
||||
{
|
||||
SBUndo->Enabled = undo;
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
int __fastcall TMacroKeyDlg::AddMacKey(MACKEY *mp, int n)
|
||||
{
|
||||
for( ; mp->r; mp++){
|
||||
if( (mp->r == 2) && sys.m_MsgEng ) continue;
|
||||
if( (mp->r == 3) && !sys.m_MsgEng ) continue;
|
||||
mackey[n] = *mp;
|
||||
n++;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
void __fastcall TMacroKeyDlg::Execute(int x, int y, TMacEditDlg *pDlg, int type)
|
||||
{
|
||||
m_fSort = FALSE;
|
||||
m_Type = type;
|
||||
Grid->RowCount = AddMacKey(type ? condcom : mackeycom, 0) + 1;
|
||||
if( (g_Pos[type] > 0) && (g_Pos[type] < Grid->RowCount) ){
|
||||
Grid->Row = g_Pos[type];
|
||||
Grid->TopRow = g_TopPos[type];
|
||||
}
|
||||
UpdateUI(Grid->Row);
|
||||
if( type ){
|
||||
Caption = sys.m_MsgEng ? "Choose Condition command (pass 1 command)" : "条件命令(パス1命令)の選択";
|
||||
}
|
||||
else {
|
||||
Caption = sys.m_MsgEng ? "Choose Macro command (pass 2 command)" : "マクロコマンド(パス2命令)の選択";
|
||||
}
|
||||
SBSpace->Enabled = !type;
|
||||
SBCR->Enabled = !type;
|
||||
#if DEBUG
|
||||
char bf[256];
|
||||
sprintf(bf, "%s (Commands=%u/%u)", Caption.c_str(), Grid->RowCount-1, MACLISTMAX);
|
||||
Caption = bf;
|
||||
#endif
|
||||
m_pDlg = pDlg;
|
||||
if( (x >= 0) && (y >= 0) ){
|
||||
if( g_xySave.x && g_xySave.y ){
|
||||
Left = g_xySave.x;
|
||||
Top = g_xySave.y;
|
||||
}
|
||||
else {
|
||||
Left = x;
|
||||
Top = y;
|
||||
}
|
||||
}
|
||||
Visible = TRUE;
|
||||
OnWave();
|
||||
Grid->SetFocus();
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
LPCSTR __fastcall TMacroKeyDlg::GetComment(const MACKEY *mp)
|
||||
{
|
||||
LPCSTR pCom;
|
||||
|
||||
if( sys.m_MsgEng ){
|
||||
pCom = mp->pEng;
|
||||
if( pCom == NULL ){
|
||||
pCom = mp->pJpn;
|
||||
}
|
||||
}
|
||||
else {
|
||||
pCom = mp->pJpn;
|
||||
}
|
||||
return pCom;
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
void __fastcall TMacroKeyDlg::GridDrawCell(TObject *Sender, int Col,
|
||||
int Row, TRect &Rect, TGridDrawState State)
|
||||
{
|
||||
char bf[256];
|
||||
Grid->Canvas->Font->Height = -12;
|
||||
Grid->Canvas->FillRect(Rect);
|
||||
int X = Rect.Left + 4;
|
||||
int Y = Rect.Top + 2;
|
||||
|
||||
if( Row ){
|
||||
Row--;
|
||||
bf[0] = 0;
|
||||
switch(Col){
|
||||
case 0:
|
||||
OnWave();
|
||||
strcpy(bf, mackey[Row].pKey);
|
||||
break;
|
||||
case 1:
|
||||
strcpy(bf, GetComment(&mackey[Row]));
|
||||
break;
|
||||
}
|
||||
Grid->Canvas->TextRect(Rect, X, Y, bf);
|
||||
}
|
||||
else { // タイトル
|
||||
LPCSTR _tt[]={
|
||||
"Commands","Comments",
|
||||
};
|
||||
Grid->Canvas->TextRect(Rect, X, Y, _tt[Col]);
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TMacroKeyDlg::GridSelectCell(TObject *Sender, int Col,
|
||||
int Row, bool &CanSelect)
|
||||
{
|
||||
UpdateUI(Row);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TMacroKeyDlg::CancelBtnClick(TObject *Sender)
|
||||
{
|
||||
g_Pos[m_Type] = Grid->Row;
|
||||
g_TopPos[m_Type] = Grid->TopRow;
|
||||
Visible = FALSE;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TMacroKeyDlg::SBInsClick(TObject *Sender)
|
||||
{
|
||||
if( m_pDlg ){
|
||||
if( Grid->Row ){
|
||||
LPCSTR p = mackey[Grid->Row - 1].pKey;
|
||||
if( m_Type ){
|
||||
char bf[256];
|
||||
sprintf(bf, (*p == '#') ? "%s\r" : "#if %s\r", p);
|
||||
p = bf;
|
||||
}
|
||||
m_pDlg->OnInsertText(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TMacroKeyDlg::SBSpaceClick(TObject *Sender)
|
||||
{
|
||||
if( m_pDlg ){
|
||||
m_pDlg->OnInsertText(" ");
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TMacroKeyDlg::SBCRClick(TObject *Sender)
|
||||
{
|
||||
if( m_pDlg ){
|
||||
m_pDlg->OnInsertText("\r");
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TMacroKeyDlg::SBUndoClick(TObject *Sender)
|
||||
{
|
||||
if( m_pDlg ){
|
||||
m_pDlg->Undo();
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TMacroKeyDlg::GridMouseDown(TObject *Sender,
|
||||
TMouseButton Button, TShiftState Shift, int X, int Y)
|
||||
{
|
||||
if( Y < Grid->DefaultRowHeight ){
|
||||
if( Button == mbLeft ){
|
||||
int type = (X <= Grid->ColWidths[0]) ? 0 : 1;
|
||||
if( type == m_fSortType ){
|
||||
m_fSort = m_fSort ? FALSE : TRUE;
|
||||
}
|
||||
else {
|
||||
m_fSort = TRUE;
|
||||
}
|
||||
m_fSortType = type;
|
||||
Sort(m_fSort, type);
|
||||
Grid->Invalidate();
|
||||
m_fDisDblClick = TRUE;
|
||||
}
|
||||
}
|
||||
else {
|
||||
m_fDisDblClick = FALSE;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
static int _USERENTRY _cmpK(const void *s, const void *t)
|
||||
{
|
||||
const MACKEY *sp = (const MACKEY *)s;
|
||||
const MACKEY *tp = (const MACKEY *)t;
|
||||
return strcmpi(sp->pKey, tp->pKey);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
static int _USERENTRY _cmpC(const void *s, const void *t)
|
||||
{
|
||||
const MACKEY *sp = (const MACKEY *)s;
|
||||
const MACKEY *tp = (const MACKEY *)t;
|
||||
LPCSTR pComS, pComT;
|
||||
if( sys.m_MsgEng ){
|
||||
pComS = sp->pEng;
|
||||
if( pComS == NULL ) pComS = sp->pJpn;
|
||||
pComT = tp->pEng;
|
||||
if( pComT == NULL ) pComT = tp->pJpn;
|
||||
}
|
||||
else {
|
||||
pComS = sp->pJpn;
|
||||
pComT = tp->pJpn;
|
||||
}
|
||||
return strcmpi(pComS, pComT);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TMacroKeyDlg::Sort(BOOL fSort, int type)
|
||||
{
|
||||
if( fSort ){
|
||||
qsort(mackey, Grid->RowCount - 1, sizeof(MACKEY), type ? _cmpC : _cmpK);
|
||||
}
|
||||
else {
|
||||
AddMacKey(m_Type ? condcom : mackeycom, 0);
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TMacroKeyDlg::GridDblClick(TObject *Sender)
|
||||
{
|
||||
if( m_fDisDblClick ){
|
||||
m_fDisDblClick = FALSE;
|
||||
return;
|
||||
}
|
||||
SBInsClick(NULL);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TMacroKeyDlg::FormKeyPress(TObject *Sender, char &Key)
|
||||
{
|
||||
if( isalpha(Key) ){
|
||||
int c = toupper(Key);
|
||||
if( !m_fSort || m_fSortType ){
|
||||
m_fSort = TRUE;
|
||||
m_fSortType = 0;
|
||||
Sort(m_fSort, m_fSortType);
|
||||
}
|
||||
MACKEY *mp = mackey;
|
||||
LPCSTR p;
|
||||
for( int i = 0; i < Grid->RowCount - 1; i++, mp++ ){
|
||||
p = mp->pKey;
|
||||
if( p ){
|
||||
if( *p == '<' ) p++;
|
||||
if( *p == '%' ) p++;
|
||||
if( toupper(*p) == c ){
|
||||
int top = i;
|
||||
if( top < 1 ) top = 1;
|
||||
Grid->TopRow = top;
|
||||
Grid->Row = i + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Grid->Invalidate();
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
static BOOL __fastcall jstrstr(LPCSTR s, LPCSTR p)
|
||||
{
|
||||
CMBCS *pM = &MainVARI->m_RxSet[0].m_MBCS;
|
||||
int l = strlen(p);
|
||||
for( ; *s; s++ ){
|
||||
if( !strnicmp(s, p, l) ) return TRUE;
|
||||
if( pM->IsLead(BYTE(*s)) ) s++;
|
||||
if( !*s ) break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TMacroKeyDlg::SBFindClick(TObject *Sender)
|
||||
{
|
||||
AnsiString as;
|
||||
if( InputMB("MMVARI", sys.m_MsgEng ? "Find string" : "検索文字列", as) ){
|
||||
if( as.IsEmpty() ) return;
|
||||
MACKEY mac[MACLISTMAX];
|
||||
memset(mac, 0, sizeof(mac));
|
||||
int N = 0;
|
||||
MACKEY *wp = mac;
|
||||
MACKEY *mp = mackey;
|
||||
LPCSTR p;
|
||||
int i;
|
||||
for( i = 0; i < Grid->RowCount - 1; i++, mp++ ){
|
||||
p = mp->pKey;
|
||||
if( p ){
|
||||
if( jstrstr(p, as.c_str()) ){
|
||||
memcpy(wp, mp, sizeof(MACKEY)), wp++;
|
||||
N++;
|
||||
}
|
||||
else {
|
||||
p = GetComment(mp);
|
||||
if( p && jstrstr(p, as.c_str()) ){
|
||||
memcpy(wp, mp, sizeof(MACKEY)), wp++;
|
||||
N++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
mp = mackey;
|
||||
for( i = 0; i < Grid->RowCount - 1; i++, mp++ ){
|
||||
BOOL f = FALSE;
|
||||
MACKEY *rp = mac;
|
||||
for( int j = 0; j < N; j++, rp++ ){
|
||||
if( !memcmp(rp, mp, sizeof(MACKEY)) ){
|
||||
f = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( !f ){
|
||||
memcpy(wp, mp, sizeof(MACKEY)), wp++;
|
||||
N++;
|
||||
}
|
||||
}
|
||||
memcpy(mackey, mac, sizeof(mackey));
|
||||
m_fSort = FALSE;
|
||||
Grid->TopRow = 1;
|
||||
Grid->Row = 1;
|
||||
Grid->Invalidate();
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
// リストの印刷
|
||||
void __fastcall TMacroKeyDlg::SBPrintClick(TObject *Sender)
|
||||
{
|
||||
CWaitCursor w;
|
||||
#if 1 // 設定ダイアログ
|
||||
TPrinterSetupDialog *pBox = new TPrinterSetupDialog(this);
|
||||
#else // 印刷ダイアログ
|
||||
TPrintDialog *pBox = new TPrintDialog(this);
|
||||
pBox->Options.Clear();
|
||||
#endif
|
||||
OnWave();
|
||||
if( pBox->Execute() ){
|
||||
OnWave();
|
||||
char bf[512];
|
||||
|
||||
Printer()->Title = VERTTL2;
|
||||
Printer()->BeginDoc();
|
||||
|
||||
int kcount = Grid->RowCount - 1; // 項目の数
|
||||
int pyw = Printer()->PageHeight; // 用紙の縦幅
|
||||
int pxw = Printer()->PageWidth; // 用紙の横幅
|
||||
int xoff = pxw * 5 / 100; // 左右のマージン
|
||||
int yoff = pyw * 5 / 100; // 上下のマージン
|
||||
int yw = pyw - (yoff*2); // 印刷領域の縦幅
|
||||
int xw = pxw - (xoff*2); // 印刷領域の横幅
|
||||
int pline;
|
||||
if( yw > xw ){ // 縦長
|
||||
pline = 50;
|
||||
}
|
||||
else { // 横長
|
||||
pline = 25;
|
||||
}
|
||||
int lyw = yw / (pline + 2); // 1行あたりのピクセル数
|
||||
yw = lyw * (pline + 2);
|
||||
|
||||
TCanvas *pCanvas = Printer()->Canvas;
|
||||
pCanvas->Font->Name = Font->Name;
|
||||
pCanvas->Font->Charset = Font->Charset;
|
||||
pCanvas->Font->Height = -(lyw * 8 / 10);
|
||||
pCanvas->Font->Color = clBlack;
|
||||
pCanvas->Pen->Color = clBlack;
|
||||
int pagemax = (kcount + pline - 1) / pline; // ページの数
|
||||
TRect rc; // 表の枠の範囲
|
||||
rc.Left = xoff; rc.Top = yoff;
|
||||
rc.Right = rc.Left + xw; rc.Bottom = rc.Top + yw;
|
||||
int xt = (lyw * 1) / 10; // 文字のオフセット
|
||||
int yt = (lyw * 1) / 10; // 文字のオフセット
|
||||
if( !xt ) xt++;
|
||||
if( !yt ) yt++;
|
||||
int xp = ((rc.Right - rc.Left) * 4 / 10); // 垂直分割線の位置
|
||||
const MACKEY *mp = mackey;
|
||||
int n = 0;
|
||||
for( int i = 1; i <= pagemax; i++ ){
|
||||
OnWave();
|
||||
int y = rc.Top;
|
||||
for( int j = 0; j < (pline+2); j++, y += lyw ){
|
||||
switch(j){
|
||||
case 0: // タイトルの描画
|
||||
sprintf(bf, "%s - " VERTTL2, m_Type ? "Conditions" : "Macros");
|
||||
pCanvas->TextOut(rc.Left, y, bf);
|
||||
sprintf(bf, "%u/%u", i, pagemax);
|
||||
pCanvas->TextOut(rc.Right - pCanvas->TextWidth(bf), y, bf);
|
||||
break;
|
||||
case 1: // 項目名の描画
|
||||
pCanvas->TextOut(rc.Left+xt, y+yt, sys.m_MsgEng ? "Commands" : "コマンド");
|
||||
pCanvas->TextOut(rc.Left+xp+xt, y+yt, sys.m_MsgEng ? "Comments" : "機能/動作");
|
||||
break;
|
||||
default: // 各項目の描画
|
||||
if( n < kcount ){
|
||||
pCanvas->TextOut(rc.Left + xt, y+yt, mp->pKey);
|
||||
pCanvas->TextOut(rc.Left + xp + xt, y+yt, GetComment(mp));
|
||||
n++; mp++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
pCanvas->MoveTo(rc.Left, y+lyw); pCanvas->LineTo(rc.Right, y+lyw);
|
||||
}
|
||||
y = rc.Top + lyw;
|
||||
pCanvas->MoveTo(rc.Left, y);
|
||||
pCanvas->LineTo(rc.Right, y);
|
||||
pCanvas->LineTo(rc.Right, rc.Bottom);
|
||||
pCanvas->LineTo(rc.Left, rc.Bottom);
|
||||
pCanvas->LineTo(rc.Left, y);
|
||||
pCanvas->MoveTo(rc.Left + xp, y); pCanvas->LineTo(rc.Left + xp, rc.Bottom);
|
||||
if( i < pagemax ) Printer()->NewPage();
|
||||
}
|
||||
Printer()->EndDoc();
|
||||
OnWave();
|
||||
}
|
||||
delete pBox;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TMacroKeyDlg::SBPrintMouseDown(TObject *Sender,
|
||||
TMouseButton Button, TShiftState Shift, int X, int Y)
|
||||
{
|
||||
if( Button == mbRight ){
|
||||
TSaveDialog *pBox = new TSaveDialog(this);
|
||||
pBox->Options << ofOverwritePrompt;
|
||||
pBox->Options << ofNoReadOnlyReturn;
|
||||
if( sys.m_MsgEng ){
|
||||
pBox->Title = "Create list file";
|
||||
pBox->Filter = "Text Files(*.txt)|*.txt|";
|
||||
}
|
||||
else {
|
||||
pBox->Title = "一覧表ファイルを作成";
|
||||
pBox->Filter = "テキストファイル(*.txt)|*.txt|";
|
||||
}
|
||||
pBox->FileName = "Temp";
|
||||
pBox->DefaultExt = "txt";
|
||||
pBox->InitialDir = sys.m_TextDir;
|
||||
OnWave();
|
||||
if( pBox->Execute() == TRUE ){
|
||||
OnWave();
|
||||
FILE *fp = fopen(AnsiString(pBox->FileName).c_str(), "wt"); //JA7UDE 0428
|
||||
if( fp ){
|
||||
const MACKEY *mp = mackey;
|
||||
for( int i = 1; i < Grid->RowCount; i++, mp++ ){
|
||||
fprintf(fp, "%d\t%s\t%s\n", i, mp->pKey, GetComment(mp));
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
}
|
||||
delete pBox;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
BIN
MacroKey.dfm
Normal file
BIN
MacroKey.dfm
Normal file
Binary file not shown.
101
MacroKey.h
Normal file
101
MacroKey.h
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
#ifndef MacroKeyH
|
||||
#define MacroKeyH
|
||||
//----------------------------------------------------------------------------
|
||||
// JA7UDE 0428
|
||||
#include <System.hpp>
|
||||
#include <Windows.hpp>
|
||||
#include <SysUtils.hpp>
|
||||
#include <Classes.hpp>
|
||||
#include <Graphics.hpp>
|
||||
#include <StdCtrls.hpp>
|
||||
#include <Forms.hpp>
|
||||
#include <Controls.hpp>
|
||||
#include <Buttons.hpp>
|
||||
#include <ExtCtrls.hpp>
|
||||
|
||||
#include <Grids.hpp>
|
||||
//----------------------------------------------------------------------------
|
||||
#define MACLISTMAX 288
|
||||
//----------------------------------------------------------------------------
|
||||
#pragma option -a- // パックの指示
|
||||
typedef struct {
|
||||
BYTE r;
|
||||
LPCSTR pKey;
|
||||
LPCSTR pJpn;
|
||||
LPCSTR pEng;
|
||||
}MACKEY;
|
||||
#pragma option -a. // パック解除の指示
|
||||
class TMacEditDlg;
|
||||
class TMacroKeyDlg : public TForm
|
||||
{
|
||||
__published:
|
||||
TButton *CancelBtn;
|
||||
TStringGrid *Grid;
|
||||
TSpeedButton *SBIns;
|
||||
TSpeedButton *SBSpace;
|
||||
TSpeedButton *SBCR;
|
||||
TSpeedButton *SBUndo;
|
||||
TSpeedButton *SBFind;
|
||||
TSpeedButton *SBPrint;
|
||||
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 CancelBtnClick(TObject *Sender);
|
||||
void __fastcall SBInsClick(TObject *Sender);
|
||||
void __fastcall SBSpaceClick(TObject *Sender);
|
||||
void __fastcall SBCRClick(TObject *Sender);
|
||||
void __fastcall FormDestroy(TObject *Sender);
|
||||
void __fastcall SBUndoClick(TObject *Sender);
|
||||
void __fastcall GridMouseDown(TObject *Sender, TMouseButton Button,
|
||||
TShiftState Shift, int X, int Y);
|
||||
void __fastcall GridDblClick(TObject *Sender);
|
||||
void __fastcall FormKeyPress(TObject *Sender, char &Key);
|
||||
void __fastcall SBFindClick(TObject *Sender);
|
||||
|
||||
void __fastcall SBPrintClick(TObject *Sender);
|
||||
void __fastcall SBPrintMouseDown(TObject *Sender, TMouseButton Button,
|
||||
TShiftState Shift, int X, int Y);
|
||||
private:
|
||||
int m_Type;
|
||||
BOOL m_fSort;
|
||||
int m_fSortType;
|
||||
BOOL m_fDisDblClick;
|
||||
MACKEY mackey[MACLISTMAX];
|
||||
int __fastcall AddMacKey(MACKEY *mp, int n);
|
||||
LPCSTR __fastcall GetComment(const MACKEY *mp);
|
||||
void __fastcall UpdateUI(int row);
|
||||
void __fastcall Sort(BOOL fSort, int type);
|
||||
|
||||
TMacEditDlg *m_pDlg;
|
||||
|
||||
public:
|
||||
virtual __fastcall TMacroKeyDlg(TComponent* AOwner);
|
||||
|
||||
void __fastcall Execute(int x, int y, TMacEditDlg *pDlg, int type);
|
||||
void __fastcall UpdateUndo(BOOL undo);
|
||||
};
|
||||
//----------------------------------------------------------------------------
|
||||
//extern TMacroKeyDlg *MacroKeyDlg;
|
||||
//----------------------------------------------------------------------------
|
||||
#endif
|
||||
29
MacroTxt/AddMenu.txt
Normal file
29
MacroTxt/AddMenu.txt
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<%DisableCR>
|
||||
#define _Name1 拡張(&1)
|
||||
<%DeleteMenu=_Name1>
|
||||
<%AddMenu=_Name1, CWの速度(&C)..., Slider, CWの速度, CWSpeed, 10, 40>
|
||||
<%AddMenu=_Name1, デジタル出力レベル(&D)..., Slider, デジタル出力レベル, DigitalLevel, 1024, 32768, 1024>
|
||||
<%AddMenu=_Name1, ->
|
||||
<%AddMenu=_Name1, CQ DX(&1) (リピート), OnCQDXClick, 1, 3, 3, 4000>
|
||||
<%AddMenu=_Name1, CQ DX(&3) (リピート), OnCQDXClick, 3, 3, 3, 5000>
|
||||
<%AddMenu=_Name1, ->
|
||||
<%AddMenu=_Name1, リモート接続(&M)..., OnCommand, "<%SoundDevice=MONO,WLClient><%Radio=RPClient>">
|
||||
<%AddMenu=_Name1, リモート接続の解除(&R)..., OnCommand, "<%SoundDevice=MONO,-1><%Radio=NONE>">
|
||||
|
||||
#proc OnCommand @Command
|
||||
<%DisableCR>@Command
|
||||
#endp
|
||||
|
||||
#proc OnCQDXClick @Nline, @Ncq, @Ncall, @Interval
|
||||
<%DisableCR><%ClearTXW><%AutoClear><%TX><%RX>
|
||||
<%RepeatText=@Nline,<%RepeatText=@Ncq,CQ DX<%SP>>de<%RepeatText=@Ncall,<%SP><%MyCall>><%CR>>
|
||||
<%BS><%SP>pse DX k<%CR><%RepeatTX=@Interval>
|
||||
#endp
|
||||
|
||||
#proc Slider @Title, @Command, @Min, @Max, @Step, @NumScales
|
||||
<%DisableCR>
|
||||
#macro <%Slider=@Title, <%@Command>, @Min, @Max, @Step, @NumScales>
|
||||
#if StrMacro(<%Input$>)
|
||||
<%@Command=<%Input$>>
|
||||
#endif
|
||||
#endp
|
||||
23
MacroTxt/Button101.txt
Normal file
23
MacroTxt/Button101.txt
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<%DisableCR><%DisableTAB>
|
||||
#define _tButtons "60-30-15<%TAB>(Default)","60-20-10","60-40-15"
|
||||
#define _tReplays Replay latest 10sec, Replay latest 15sec, Replay latest 20sec, Replay latest 30sec
|
||||
#define _strMenu OFF, ON, -, 0, <%String=_tButtons>, -, 0, <%String=_tReplays>
|
||||
#define _iSwitch <%Format=%d,<%Cond=IsPlayBack>+1>
|
||||
#if IsPlayBack
|
||||
#macro <%MenuB=_iSwitch, _strMenu>
|
||||
#else
|
||||
#macro <%MenuB=_iSwitch, OFF, ON>
|
||||
#endif
|
||||
#if ValMenu
|
||||
#if StrMacro(<%Input$>) >> -
|
||||
#define _strButtons <%Format=%.2s,<%Input$>>,<%Format=%.2s,<%Skip$=3,<%Input$>>>,<%Format=%.2s,<%Skip$=6,<%Input$>>>
|
||||
#macro <%PlayBackButtons=_strButtons>
|
||||
#elseif StrMacro(<%Input$>) >> Replay
|
||||
#define _strTime <%Format=%d,<%Input$>>
|
||||
#macro <%WaterMsg=3,_strTime>
|
||||
#macro <%PlayBack=_strTime>
|
||||
#else
|
||||
#macro <%PlayBack=<%Input$>>
|
||||
#endif
|
||||
#endif
|
||||
<%EOF>
|
||||
12
MacroTxt/Button86.txt
Normal file
12
MacroTxt/Button86.txt
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<%DisableCR>
|
||||
<%CallProc=Repeat, 3, CQ CQ CQ de <%MyCall> <%MyCall> <%MyCall><%CR>>
|
||||
<%BS> pse k...<%CR>
|
||||
|
||||
#proc Repeat @N, @Text
|
||||
<%DisableCR>
|
||||
#define _RepCount <%Format=%d,@N-1>
|
||||
#if _RepCount >= 0
|
||||
@Text
|
||||
<%CallProc=Repeat, _RepCount, @Text>
|
||||
#endif
|
||||
#endp
|
||||
5
MacroTxt/File1.txt
Normal file
5
MacroTxt/File1.txt
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<%TX><%RX>
|
||||
#repeat 3
|
||||
CQ CQ CQ de <%MyCall> <%MyCall> <%MyCall> (<%Format=%d, 1 + $repeat - $counter>)<%SP><%CallProc=DateTime, <%LPTIME>>
|
||||
#endp
|
||||
pse k...<%CR>
|
||||
960
Macros.mac
Normal file
960
Macros.mac
Normal file
|
|
@ -0,0 +1,960 @@
|
|||
[MB1]
|
||||
Name=Clear
|
||||
Text="<%ClearTXW>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB2]
|
||||
Name=CQ
|
||||
Text="#if StrVARITYPE>>STD || StrVARITYPE==BAUDOT\r\n<%ClearTXW><%TX>CQ CQ CQ de <%MyCall> <%MyCall> <%MyCall> pse K<%RX>\r\n#else\r\n<%ClearTXW><%TX>CQ CQ CQ de <%MyCall> <%MyCall> <%MyCall> pse (<%VARITYPE>) K<%RX>\r\n#endif\r\n"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB3]
|
||||
Name=CQ2
|
||||
Text="<%ClearTXW><%TX>CQ CQ CQ de <%MyCall> <%MyCall> <%MyCall>\r\nCQ CQ CQ de <%MyCall> <%MyCall> <%MyCall> pse (<%VARITYPE>) K\r\n<%RX>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB4]
|
||||
Name=1x1
|
||||
Text="<%NETON><%TX><%HisCall> de <%MyCall>\r\n<%RX>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB5]
|
||||
Name=2x2
|
||||
Text="<%NETON><%TX><%IDLE><%IDLE><%HisCall> <%HisCall> de <%MyCall> <%MyCall>\r\n<%RX>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB6]
|
||||
Name=RRR
|
||||
Text="<%IDLE><%IDLE>RRR <%HisCall> de <%MyCall> <%RxCarrier>\r\n#if IsLocal\r\n#if StrVARITYPE == STD/JA\r\n--- <Japanese> ---\r\n#else\r\n--- <%VARITYPE> ---\r\n#endif\r\n#endif\r\n"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB7]
|
||||
Name=BTU
|
||||
Text="BTU <%HisCall> de <%MyCall> KN\r\n<%CWID=]><%RX><%AutoClear><%EOF>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB8]
|
||||
Name=Test
|
||||
Text="(1)◎はじめに\r\n(2) 私は日本人なので日本語での会話が好きです。PSK31においても国内局同士\r\n(3)であればできるだけ日本語で会話します。ご存知の通り、PSK31は素晴らしい\r\n(4)伝送方式ですが、日本語を伝送する場合、若干の問題があることが気になって\r\n(5)いました。そして他の東アジア系言語(ハングル、中国語)でも同じ問題を持つと\r\n(6)考えられます。\r\n(7) このプロジェクトは、この問題を低減する方法について考察し、それを実験する\r\n(8)ことを目的とします。\r\n"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB9]
|
||||
Name=CH1
|
||||
Text="<%ShowCH=1,ONOFF>"
|
||||
Color=0
|
||||
Style=4
|
||||
|
||||
[MB10]
|
||||
Name=PTT
|
||||
Text="#if IsPTT\r\n#macro <%PTTOFF>\r\n#else\r\n#macro <%PTTON>\r\n#endif"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB11]
|
||||
Name=M11
|
||||
Text="<%SeekPrev>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB12]
|
||||
Name=M12
|
||||
Text="<%SeekNext>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB13]
|
||||
Name=CWID
|
||||
Text="<%TX><%CWID=DE <%MyCall>><%RX><%EOF>"
|
||||
Color=0
|
||||
Style=4
|
||||
|
||||
[MB14]
|
||||
Name=TU SK
|
||||
Text="<%TX><%CWID=TU:><%RX><%EOF>"
|
||||
Color=0
|
||||
Style=4
|
||||
|
||||
[MB15]
|
||||
Name=AS
|
||||
Text="#if !IsTX\r\n<%AutoNET><%AutoReturn><%SkipCR>\r\n#if ValPage!=4\r\n<%Page=4><%SkipCR>\r\n#else\r\n<%Page=3><%SkipCR>\r\n#endif\r\n<%ClearTXW><%SkipCR>\r\n#endif\r\n<%TX><%CWID=@><%RX><%EOF>\r\n"
|
||||
Color=0
|
||||
Style=4
|
||||
|
||||
[MB16]
|
||||
Name=1750
|
||||
Text="<%RxCarrier=_DefaultCarrier>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB17]
|
||||
Name=NEST
|
||||
Text="#define\t_CW\t<%CWID=de <%MyCall>>\r\n<%TX><%RX><%String=_CW><%EOF>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB18]
|
||||
Name=FIN
|
||||
Text="#if IsLocal\r\nRRR <%DearName>有難うございました。 73 SK....<%RX>\r\n#else\r\nRRR Thanks again, <%DearName> CUL, 73 SK....<%RX>\r\n#endif\r\n"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB19]
|
||||
Name=DemLPF
|
||||
Text="<%ShowDemLPF>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB20]
|
||||
Name=DearName
|
||||
Text="<%DearName>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB21]
|
||||
Name=CH2
|
||||
Text="<%ShowCH=2,ONOFF>"
|
||||
Color=0
|
||||
Style=4
|
||||
|
||||
[MB22]
|
||||
Name=IDLE
|
||||
Text="<%IDLE><%IDLE>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB23]
|
||||
Name=M23
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB24]
|
||||
Name=M24
|
||||
Text="#if !IsDefined(TodayWX) || !StrMacro(<%String=TodayWX>)\r\n#define\tTodayWX\t<%Input=WXを入力>\r\n#endif\r\n#if StrMacro(<%String=TodayWX>)\r\n本日のお天気は、<%String=TodayWX>です。\r\n#endif\r\n"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB25]
|
||||
Name=REP
|
||||
Text="#define\tReceiveTime\t5000\r\n#if !IsSQ\r\n<%RepeatTX=ReceiveTime><%ClearTXW><%SkipCR>\r\nCQ CQ CQ de <%MyCall> <%MyCall> <%MyCall> pse (<%VARITYPE>) K\r\n#elseif StrMacro(<%Capture>)\r\n#macro <%HisCall=<%Capture>>\r\n#else\r\n#macro <%Repeat=1000>\r\n#endif\r\n"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB26]
|
||||
Name=Sound
|
||||
Text="<%WaterMsg=3,<%SoundName>>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB27]
|
||||
Name=CH1,GMSK
|
||||
Text="<%SetCHMode=1,GMSK>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB28]
|
||||
Name=CH1,250
|
||||
Text="<%SetCHSpeed=1,250.5>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB29]
|
||||
Name=MMSSTV
|
||||
Text="<%Suspend><%Execute=D:\\MMSSTV\\MMSSTV.exe>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB30]
|
||||
Name=Tx BPF
|
||||
Text="<%ShowTxBPF>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB31]
|
||||
Name=DECM
|
||||
Text="<%ShowDECM>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB32]
|
||||
Name=SQ=3.0
|
||||
Text="<%SquelchLevel=3.0>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB33]
|
||||
Name=ShowMFSK
|
||||
Text="<%ShowMFSK>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB34]
|
||||
Name=CW
|
||||
Text="#if StrMacro(<%Input=Input CW text, vvv vvv vvv>)\r\n<%TX><%RX><%CWID=<%Input$>><%EOF>\r\n#endif\r\n"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB35]
|
||||
Name=M35
|
||||
Text="#define\tMyRIG\t\tFT1000MP 50W\r\n#define\tMyANT80m\tVertical(7m)\r\n#define\tMyANT40m\tVertical(7m)\r\n#define\tMyANT30m\tMagnetic loop(90cm)\r\n#define\tMyANT20m\tMagnetic loop(90cm)\r\n#define\tMyANT17m\tMagnetic loop(90cm)\r\n#define\tMyANT15m\tMagnetic loop(90cm)\r\n#define\tMyANT12m\tMagnetic loop(90cm)\r\n#define\tMyANT10m\tMagnetic loop(90cm)\r\n#if StrBand==80m\r\n#define\tMyANT\t\tMyANT80m\r\n#elseif StrBand==40m\r\n#define\tMyANT\t\tMyANT40m\r\n#elseif StrBand==30m\r\n#define\tMyANT\t\tMyANT30m\r\n#elseif StrBand==20m\r\n#define\tMyANT\t\tMyANT20m\r\n#elseif StrBand==17m\r\n#define\tMyANT\t\tMyANT17m\r\n#elseif StrBand==15m\r\n#define\tMyANT\t\tMyANT15m\r\n#elseif StrBand==12m\r\n#define\tMyANT\t\tMyANT12m\r\n#else\r\n#define\tMyANT\t\tMyANT10m\r\n#endif\r\n私のリグは<%String=MyRIG>、アンテナは<%String=MyANT>です。\r\n"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB36]
|
||||
Name=M36
|
||||
Text="#define\tQTH_HOME\t大阪府高槻市\r\n#define\tQTH_25006\t大阪府三島郡\r\n#define\tQTH_2701\t兵庫県神戸市\r\n#if StrNote >> 25006\r\n#define\tMyQTH\t\tQTH_25006\r\n#elseif StrNote >> 2701\r\n#define\tMyQTH\t\tQTH_2701\r\n#else\r\n#define\tMyQTH\t\tQTH_HOME\r\n#endif\r\n私の現在のQTHは、<%String=MyQTH>です。\r\n"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB37]
|
||||
Name=Clear
|
||||
Text="<%ClearTXW>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB38]
|
||||
Name=RAND
|
||||
Text="<%WaterMsg=3,<%RANDOM>>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB39]
|
||||
Name=GPS
|
||||
Text="#define\t_T_NOW\t<%PTIME>\r\n#define\t_T_DIFF\t<%Format=%d,_T_NOW-_T_B4>\r\n#define\t_T_B4\t_T_NOW\r\n<%String=_T_DIFF>\r\n"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB40]
|
||||
Name=CPU
|
||||
Text="<%WaterMsg=4,<%CPUBENCHMARK>><%Repeat=1000>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB41]
|
||||
Name=TIMEVAL
|
||||
Text="<%DisableCR>\r\n#define\t_PT\t<%Format=%u,<%PTIME>+9*60*60>\r\n<%WaterMsg=3,<%VALTIME=HOUR,_PT>:<%VALTIME=MINUTE,_PT>:<%VALTIME=SECOND,_PT>>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB42]
|
||||
Name=M42
|
||||
Text="<%VALTIME=LMonth,<%PTIME>>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB43]
|
||||
Name=atcppm
|
||||
Text="<%ATCPPM>\r\n"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB44]
|
||||
Name=MLEN
|
||||
Text="<%MStrLen=<%Note>>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB45]
|
||||
Name=M45
|
||||
Text="#define AAA 50"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB46]
|
||||
Name=M46
|
||||
Text="<%SeekTop>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB47]
|
||||
Name=M47
|
||||
Text="<%SeekPrev>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB48]
|
||||
Name=M48
|
||||
Text="<%SeekNext>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB49]
|
||||
Name=RadioKHz
|
||||
Text="<%WaterMsg=3,<%RadioKHz>>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB50]
|
||||
Name=M50
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB51]
|
||||
Name=M51
|
||||
Text="<%TxIMM=<%CWID=JE3HHT>>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB52]
|
||||
Name=M52
|
||||
Text="#DEFINE\t_DefaultCarrier\t1500\r\n#DEFINE\t_DefaultTEST\t0\r\n"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB53]
|
||||
Name=M53
|
||||
Text="#DELETE _DefaultCarrier\r\n#DELETE _DefaultTEST"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB54]
|
||||
Name=B/2
|
||||
Text="<%BAUD=<%Format=%f,<%BAUD>/2>>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB55]
|
||||
Name=M55
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB56]
|
||||
Name=M56
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB57]
|
||||
Name=M57
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB58]
|
||||
Name=M58
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB59]
|
||||
Name=M59
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB60]
|
||||
Name=M60
|
||||
Text="<%MODE=rtty-U>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB61]
|
||||
Name=RxFile
|
||||
Text="<%RxFile=history.txt>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB62]
|
||||
Name=RST
|
||||
Text="<%HisRST>\r\n"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB63]
|
||||
Name=NR
|
||||
Text="<%HisNR>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB64]
|
||||
Name=Format
|
||||
Text="<%Format=%g,<%FREQ> % 1>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB65]
|
||||
Name=MOD
|
||||
Text="#define\tVAL\t<%Format=%d,<%FREQ>*1000>\r\n#define\tMOD\t<%Format=%d,VAL % 1000>\r\n<%String=MOD>\r\n"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB66]
|
||||
Name=Bx2
|
||||
Text="<%BAUD=<%Format=%f,<%BAUD>*2>>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB67]
|
||||
Name=M67
|
||||
Text="#register\t_MenuSub\t3,6,1\r\n#macro <%DoMenu=_MenuSub>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB68]
|
||||
Name=AAA
|
||||
Text="<%OutputVolume><%Wait=200><%KeyStroke=<%CHAR=I>><%KeyDown=12><%KeyStroke=<%CHAR=P>><%KeyUp=12><%KeyStroke=<%CHAR=R>>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB69]
|
||||
Name=DoMenu
|
||||
Text="#define\tMenuSub\t3,6,1\r\n#macro <%DoMenu=MenuSub>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB70]
|
||||
Name=EHistory
|
||||
Text="<%Execute=notepad.exe ehistory.txt>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB71]
|
||||
Name=EMmvari
|
||||
Text="<%Execute=notepad.exe emmvari.txt>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB72]
|
||||
Name=EProject
|
||||
Text="<%Execute=notepad.exe eproject.txt>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB73]
|
||||
Name=Clear
|
||||
Text="<%ClearTXW>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB74]
|
||||
Name=MacTxt
|
||||
Text="#macro <%MacroText=d:\\Temp\\Macro.txt>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB75]
|
||||
Name=M75
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB76]
|
||||
Name=M76
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB77]
|
||||
Name=0x2 - 2x4
|
||||
Text="<%DisableCR><%DisableTAB>\r\n#macro <%Menu= 0x2, 0x3, 0x4, -, 1x2, 1x3, 1x4, -, 2x3, 2x4>\r\n#if ValMenu\r\n\t#define\t_His\t<%Format=%c,<%Input$>>\r\n\t#define\t_My\t<%Format=%c,<%Skip$=2,<%Input$>>>\r\n\t<%TX><%RX>\r\n\t#if !Is1stCR\r\n\t\t<%CR>\r\n\t#endif\r\n\t#if IsCall\r\n\t\t<%RepeatText=_His,<%HisCall> >\r\n\t#endif\r\n\tde\r\n\t<%RepeatText=_My, <%MyCall>>\r\n\t pse K<%CR>\r\n#endif"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB78]
|
||||
Name=M78
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB79]
|
||||
Name=M79
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB80]
|
||||
Name=M80
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB81]
|
||||
Name=M81
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB82]
|
||||
Name=M82
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB83]
|
||||
Name=M83
|
||||
Text="<%SeekPrev>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB84]
|
||||
Name=M84
|
||||
Text="<%SeekNext>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB85]
|
||||
Name=M85
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB86]
|
||||
Name=M86
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB87]
|
||||
Name=M87
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB88]
|
||||
Name=M88
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB89]
|
||||
Name=M89
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB90]
|
||||
Name=M90
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB91]
|
||||
Name=M91
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB92]
|
||||
Name=M92
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB93]
|
||||
Name=M93
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB94]
|
||||
Name=M94
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB95]
|
||||
Name=M95
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB96]
|
||||
Name=M96
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB97]
|
||||
Name=M97
|
||||
Text="<%ClearTXW><%TX><%RX>CQ CQ CQ de <%CWID=<%MyCall>><%IDLE><%IDLE><%IDLE> <%MyCall> <%MyCall> <%MyCall> pse k\r\n"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB98]
|
||||
Name=CQ
|
||||
Text="<%DisableCR><%ClearTXW><%TX><%RX>\r\n#macro <%Menu=CQ3, CQ4, CQ5>\r\n#if ValMenu\r\n#define\t_cLine\t<%Format=%c,<%Skip$=2,<%Input$>>>\r\n<%RepeatText=_cLine,<%RepeatText=3,CQ >de<%RepeatText=3, <%MyCall>><%CR>>pse k...<%CR>\r\n#endif\r\n<%EOF>\r\n"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB99]
|
||||
Name=RY
|
||||
Text="<%RepeatText=3,<%RepeatText=33,RY><%CR>>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB100]
|
||||
Name=M100
|
||||
Text="<%PlayBackButtons=60,30,15>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB101]
|
||||
Name=PlayBack
|
||||
Text="#macro <%MenuB="<%Format=%d,2-<%Cond= IsPlayBack>>",ON,OFF>\r\n#if ValMenu\r\n#macro <%PlayBack=<%Input$>>\r\n#endif"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB102]
|
||||
Name=Sound
|
||||
Text="#define\t_tCH\tMONO,LEFT,RIGHT\r\n#define\t_strCH\t<%TableStr=1,<%SoundDevice>>\r\n#define\t_iCH\t<%Table=_strCH,_tCH>\r\n#macro <%MenuB=_iCH,_tCH>\r\n#if ValMenu\r\n#macro <%SoundDevice=<%Input$>><%WaterMsg=3,Sound=<%SoundDevice>>\r\n#endif\r\n"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB103]
|
||||
Name=M103
|
||||
Text="<%WaterMsg=3,<%EntityName=<%HisCall>>/<%Continent=<%HisCall>>>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB104]
|
||||
Name=ShutDown
|
||||
Text="<%DisableCR>\r\n#if <%YesNo=Windows will be shut down, are you sure?> == 6\r\n<%ShutDown>\r\n#endif"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB105]
|
||||
Name=Exit
|
||||
Text="<%DisableCR>\r\n#if <%YesNo=MMVARIを終了します. ほんまにええですか?> == 6\r\n<%Exit>\r\n#endif"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB106]
|
||||
Name=DigiOut
|
||||
Text="<%DisableCR>\r\n#define\t_tLevel\t8192,16384,24576,32768\r\n#define\t_tLabel\tLow, Midium(Default), High, VeryHigh\r\n#define\t_iLevel\t<%Table=<%DigitalLevel>,_tLevel>\r\n#macro <%MenuB=_iLevel,_tLabel>\r\n#if ValMenu\r\n<%DigitalLevel=<%TableStr=<%Menu>,_tLevel>>\r\n#endif"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB107]
|
||||
Name=M107
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB108]
|
||||
Name=ShowClock
|
||||
Text="<%OnTimer=<%WaterMsg=4,Dem=<%DemodulatorClock>(<%Format=%.2lf,<%DemodulatorClock>*0.5>), FFT=<%FFTClock>/<%FFTSize>>>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB109]
|
||||
Name=M109
|
||||
Text="#if StrVARITYPE>>STD\r\n<%ClearTXW><%TX><%IDLE>CQ CQ CQ<%IDLE><%IDLE> de <%MyCall> <%MyCall> <%MyCall> pse K<%RX>\r\n#else\r\n<%ClearTXW><%TX>CQ CQ CQ de <%MyCall> <%MyCall> <%MyCall> pse (<%VARITYPE>) K<%RX>\r\n#endif\r\n"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB110]
|
||||
Name=BLK
|
||||
Text="<%DIDDLE=BLK>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB111]
|
||||
Name=LTR
|
||||
Text="<%DIDDLE=LTR>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB112]
|
||||
Name=WaterNoise
|
||||
Text="#if !IsRepeat\r\n#macro <%Menu=35-65, 30-60, 30-55, 30-50, 10-65>\r\n#if ValMenu == 1\r\n#macro <%WaterNoise=35,65>\r\n#elseif ValMenu == 2\r\n#macro <%WaterNoise=30,60>\r\n#elseif ValMenu == 3\r\n#macro <%WaterNoise=30,55>\r\n#elseif ValMenu == 4\r\n#macro <%WaterNoise=30,50>\r\n#elseif ValMenu == 5\r\n#macro <%WaterNoise=10,65>\r\n#endif\r\n#endif\r\n#macro <%OnTimer=<%WaterMsg=4,<%WaterNoise>dB>>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB113]
|
||||
Name=Metric
|
||||
Text="<%OnTimer=<%WaterMsg=4,Metric=<%MetricMFSK>/<%MetricMFSK=even>/<%MetricMFSK=odd>>>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB114]
|
||||
Name=AFCFreq
|
||||
Text="<%OnTimer=<%WaterMsg=<%AFCFrequency>/<%AFCCount>/<%MetricMFSK>>>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB115]
|
||||
Name=DecBench
|
||||
Text="#macro <%Menu=CPU BENCH, DECM BENCH>\r\n#if ValMenu == 1\r\n#macro <%OnTimer=<%WaterMsg=4,<%CPUBENCHMARK>>>\r\n#elseif ValMenu==2\r\n#macro <%OnTimer=<%WaterMsg=4,<%BENCHDECM>>>\r\n#endif\r\n"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB116]
|
||||
Name=CQ2
|
||||
Text="<%ClearTXW><%TX>CQ CQ CQ de <%MyCall> <%MyCall> <%MyCall>\r\nCQ CQ CQ de <%MyCall> <%MyCall> <%MyCall> pse (<%VARITYPE>) K\r\n<%RX>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB117]
|
||||
Name=Notch256
|
||||
Text="<%NotchTaps=128><%WaterMsg=3,<%NotchTaps>>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB118]
|
||||
Name=Notch
|
||||
Text="<%Notch=ONOFF>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB119]
|
||||
Name=FileDialog
|
||||
Text="#if 1\r\n#macro <%FileDialog=, MMV Files(*.mmv)|*.mmv|, Default,mmv, C:\\Sound>\r\n#macro <%WaterMsg=3,<%Input$>>\r\n#if IsFile(<%Input$>)\r\n#macro <%PlaySound=<%Input$>>\r\n#endif\r\n#else\r\n#macro <%PlaySound>\r\n#endif"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB120]
|
||||
Name=EditEvent
|
||||
Text="\t#macro <%Menu=OnTimer,OnPTT,OnQSO,OnFind,OnStart,OnExit,OnMode,OnSpeed>\r\n\t#if ValMenu == 1\r\n\t#macro <%OnTimer>\r\n\t#elseif ValMenu == 2\r\n\t#macro <%OnPTT>\t\r\n\t#elseif ValMenu == 3\r\n\t#macro <%OnQSO>\r\n\t#elseif ValMenu == 4\r\n\t#macro <%OnFind>\r\n\t#elseif ValMenu == 5\r\n\t#macro <%OnStart>\r\n\t#elseif ValMenu == 6\r\n\t#macro <%OnExit>\r\n\t#elseif ValMenu == 7\r\n\t#macro <%OnMode>\r\n\t#elseif ValMenu == 8\r\n\t#macro <%OnSpeed>\r\n\t#endif\r\n"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB121]
|
||||
Name=Capture
|
||||
Text="#if StrMacro(<%Capture>)\r\n#macro <%HisCall=<%Capture>>\r\n#else\r\n#macro <%Repeat=1000>\r\n#endif"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB122]
|
||||
Name=UOS_OFF
|
||||
Text="<%UOS=OFF>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB123]
|
||||
Name=UOS_ON
|
||||
Text="<%UOS=ON>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB124]
|
||||
Name=OnTimer
|
||||
Text="\t#macro <%Menu=AFC, Metric(MFSK), RadioMode, WaterNoise, S/N, UTC, Local, -, Stop>\r\n\t#if ValMenu == 1\r\n\t#macro <%OnTimer=<%WaterMsg=4,<%AFCFrequency>Hz>>\r\n\t#elseif ValMenu == 2\r\n\t#macro <%OnTimer=<%WaterMsg=4,<%MetricMFSK>>>\r\n\t#elseif ValMenu == 3\r\n\t#macro <%OnTimer=<%WaterMsg=4,<%RadioMode>>>\r\n\t#elseif ValMenu == 4\r\n\t#macro <%OnTimer=<%WaterMsg=4,<%WaterNoise>dB>>\r\n\t#elseif ValMenu == 5\r\n\t#macro <%OnTimer=<%WaterMsg=4,S/N=<%AverageLevel>/<%PeakLevel>dB>>\r\n\t#elseif ValMenu == 6\r\n\t#macro <%OnTimer=<%WaterMsg=4,<%UTIME>z>>\r\n\t#elseif ValMenu == 7\r\n\t#macro <%OnTimer=<%WaterMsg=4,<%LTIME>>>\r\n\t#else\r\n\t#macro <%OnTimer=>\r\n\t#endif\r\n"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB125]
|
||||
Name=WaitC-0
|
||||
Text="<%RTTYWaitC=0>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB126]
|
||||
Name=WaitD-0
|
||||
Text="<%RTTYWaitD=0>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB127]
|
||||
Name=BAUD
|
||||
Text="<%WaterMsg=3,<%BAUD>>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB128]
|
||||
Name=PlayBack
|
||||
Text="<%PlayBack=10>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB129]
|
||||
Name=NotchWidth
|
||||
Text="<%WaterMsg=3,<%NotchWidth>>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB130]
|
||||
Name=200
|
||||
Text="<%TxShift=200><%RxShift=200>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB131]
|
||||
Name=NextMode
|
||||
Text="<%DisableCR>\r\n#define\t_Table\tGMSK,bpsk,rtty-L\r\n#define\t_Count\t<%Format=%d,<%TableCount=_Table>>\r\n#define\t_CurMode\t<%Format=%d,(_CurMode%_Count)+1>\r\n#macro <%WaterMsg=4,<%String=_CurMode>/<%String=_Count>>\r\n#macro <%WaterMsg=3,<%TableStr=_CurMode,_Table>>\r\n#macro <%MODE=<%TableStr=_CurMode,_Table>>\r\n<%Repeat=3000>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB132]
|
||||
Name=SimBaud
|
||||
Text="#if StrMacro(<%Input=Input ppm>)\r\n#define\t_ppm\t<%Format=%f,<%Input$>*1e-6>\r\n#define\t_baud\t<%Format=%f,<%BAUD> - <%BAUD>*_ppm>\r\n#macro <%SimBAUD=<%Format=%f,_baud>>\r\n#macro <%WaterMsg=3,<%String=_baud>>\r\n#endif"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB133]
|
||||
Name=M133
|
||||
Text="RYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRY\r\n"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB134]
|
||||
Name=Menu
|
||||
Text="#macro <%Menu=&73 CU SK, &TU SK EE, &SU, &EE>\r\n#if ValMenu==1\r\n<%TX><%RX><%CWID=73CU:><%EOF>\r\n#elseif ValMenu==2\r\n<%TX><%RX><%CWID=TU:EE><%EOF>\r\n#elseif ValMenu==3\r\n<%TX><%RX><%CWID=SU><%EOF>\r\n#elseif ValMenu==4\r\n<%TX><%RX><%CWID=EE><%EOF>\r\n#endif\r\n"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB135]
|
||||
Name=Final
|
||||
Text="<%Menu=<%DearName>まいどおおきに..., ほなさいなら..., "TNX AGN <%DearName>, CUL..."><%Input$>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB136]
|
||||
Name=Clear
|
||||
Text="<%ClearTXW>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB137]
|
||||
Name=WaitC
|
||||
Text="<%RTTYWaitC=50>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB138]
|
||||
Name=WaitD
|
||||
Text="<%RTTYWaitD=40>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB139]
|
||||
Name=Dupe
|
||||
Text="<%DupeText>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB140]
|
||||
Name=MTTY
|
||||
Text="#define\t_W\t<%Format="%f",<%BAUD>*0.5>\r\n<%TxShift=_W><%RxShift=_W>\r\n"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB141]
|
||||
Name=170
|
||||
Text="<%TxShift=170><%RxShift=170>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB142]
|
||||
Name=450
|
||||
Text="<%TxShift=450><%RxShift=450>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB143]
|
||||
Name=DLL
|
||||
Text="#define\t_CallArg\td:\\test\\MacDLL\\MacDLL.dll, mmmacTest, <%MyCall>\r\n#macro <%WaterMsg=3,<%CallDLL=_CallArg>>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB144]
|
||||
Name=Sim.
|
||||
Text="<%TestSignal>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB145]
|
||||
Name=CQ
|
||||
Text="<%DisableCR><%ClearTXW><%TX><%CODE=7F><%CODE=7F><%CODE=02><%CR>\r\nCQ CQ CQ de NOCALL NOCALL NOCALL<%CR>\r\nCQ CQ CQ de NOCALL NOCALL NOCALL<%CR>\r\nCQ CQ CQ de NOCALL NOCALL NOCALL<%CR>\r\npse K<%CODE=7F><%CODE=7F><%CODE=04>\r\n<%RX>"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB146]
|
||||
Name=FreqMenu
|
||||
Text="#if !IsDefined(_Rig)\r\n#define\t_Rig\tCI-V\r\n#endif\r\n\t#macro <%Menu=7028.5,10141.5,14072.5,18102.5,21072.5,28072.5,50980.0,144450.0>\r\n\t#if ValMenu\r\n\t#if IsRadioLSB\r\n\t#macro <%RadioKHz=_Rig,<%Input$>+<%RxCarrier>*0.001>\r\n\t#else\r\n\t#macro <%RadioKHz=_Rig,<%Input$>-<%RxCarrier>*0.001>\r\n\t#endif\r\n\t#endif\r\n"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB147]
|
||||
Name=MODE
|
||||
Text="#define\t_Rig\tCI-V\r\n#define\t_t_Mode\tLSB,USB,CW,AM,FM,RTTY,PACKET\r\n#macro <%MenuB="<%Table=<%RadioMode>,_t_Mode>",_t_Mode>\r\n#if ValMenu\r\n#macro <%RadioMode=_Rig,<%Input$>>\r\n#endif\r\n"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB148]
|
||||
Name=+500
|
||||
Text="#define\t_FQ\t7.028\r\n#define\t_Rig\tCI-V\r\n#if <%RadioKHz>\r\n#macro <%RadioKHz=_Rig,<%RadioKHz>+0.5>\r\n#else\r\n#macro <%RadioKHz=_Rig,_FQ*1000>\r\n#endif"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB149]
|
||||
Name=-500
|
||||
Text="#define\t_FQ\t7.028\r\n#define\t_Rig\tCI-V\r\n#if <%RadioKHz>\r\n#macro <%RadioKHz=_Rig,<%RadioKHz>-0.5>\r\n#else\r\n#macro <%RadioKHz=_Rig,_FQ*1000>\r\n#endif"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB150]
|
||||
Name=SetTone
|
||||
Text="#define\t_Tone\t1750\r\n#define\t_Rig\tCI-V\r\n#macro <%Menu=1000,1200,1500,1750,2000>\r\n#if ValMenu\r\n#define\t_Tone\t<%Input$>\r\n#define\t_OffKHz\t<%Format=%f,(<%RxCarrier>-_Tone)*0.001>\r\n#if IsRadioLSB\r\n#macro <%RadioKHz=_Rig,<%RadioKHz>-_OffKHz>\r\n#else\r\n#macro <%RadioKHz=_Rig,<%RadioKHz>+_OffKHz>\r\n#endif\r\n#macro <%RxCarrier=_Tone>\r\n#endif"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB151]
|
||||
Name=RigQuery?
|
||||
Text="#if IsRadioLSB\r\n#macro <%WaterMsg=3,<%RadioKHz> <%RadioMode> IsRadioLSB=TRUE>\r\n#else\r\n#macro <%WaterMsg=3,<%RadioKHz> <%RadioMode> IsRadioLSB=FALSE>\r\n#endif\r\n"
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB152]
|
||||
Name=M152
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB153]
|
||||
Name=M153
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB154]
|
||||
Name=M154
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB155]
|
||||
Name=M155
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB156]
|
||||
Name=M156
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB157]
|
||||
Name=M157
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB158]
|
||||
Name=M158
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB159]
|
||||
Name=M159
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
[MB160]
|
||||
Name=M160
|
||||
Text=""
|
||||
Color=0
|
||||
Style=0
|
||||
|
||||
81
Mmcg.h
Normal file
81
Mmcg.h
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
#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; // 現在確保しているスロット数
|
||||
int m_Cnt; // 現在記憶しているスロット数
|
||||
MMCG *m_bp; // MMCGの配列
|
||||
|
||||
|
||||
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 __fastcall Free(void);
|
||||
void __fastcall Alloc(int n);
|
||||
LPSTR __fastcall adjspl(LPSTR p);
|
||||
int __fastcall chkspl(LPCSTR p);
|
||||
int __fastcall LastMatch(LPSTR t, LPSTR s);
|
||||
int __fastcall NormQth(LPSTR p);
|
||||
int __fastcall isfind(LPCSTR p);
|
||||
int __fastcall _ischrtyp(char *p, int x);
|
||||
LPCSTR __fastcall getprf(LPCSTR pCode);
|
||||
void __fastcall GetGun(LPSTR t, LPCSTR pCode);
|
||||
int __fastcall isEnt(MMCG *mp);
|
||||
|
||||
public:
|
||||
__fastcall CMMCG();
|
||||
__fastcall ~CMMCG();
|
||||
|
||||
void __fastcall LoadDef(LPCSTR pFileName);
|
||||
void __fastcall FindAll(void);
|
||||
void __fastcall FindQTH(LPSTR pKey);
|
||||
void __fastcall FindNumb(LPSTR pKey);
|
||||
void __fastcall Find(LPSTR p);
|
||||
void __fastcall SetMask(void);
|
||||
|
||||
LPCSTR __fastcall GetQTH(MMCG *mp);
|
||||
};
|
||||
|
||||
extern CMMCG mmcg;
|
||||
#endif
|
||||
245
MmcgDlg.cpp
Normal file
245
MmcgDlg.cpp
Normal file
|
|
@ -0,0 +1,245 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
#include <vcl.h>
|
||||
#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( sys.m_MsgEng ){
|
||||
SBInc->Caption = "String";
|
||||
SBMask->Caption = "Area";
|
||||
CancelBtn->Caption = "Cancel";
|
||||
}
|
||||
|
||||
m_DisEvent = 0;
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
void __fastcall TMmcgDlgBox::UpdateCaption(void)
|
||||
{
|
||||
char bf[256];
|
||||
|
||||
if( sys.m_MsgEng ){
|
||||
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()); //JA7UDE 0428
|
||||
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);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
BIN
MmcgDlg.dfm
Normal file
BIN
MmcgDlg.dfm
Normal file
Binary file not shown.
76
MmcgDlg.h
Normal file
76
MmcgDlg.h
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
#ifndef MmcgDlgH
|
||||
#define MmcgDlgH
|
||||
//----------------------------------------------------------------------------
|
||||
/* JA7UDE 0428
|
||||
#include <vcl\System.hpp>
|
||||
#include <vcl\Windows.hpp>
|
||||
#include <vcl\SysUtils.hpp>
|
||||
#include <vcl\Classes.hpp>
|
||||
#include <vcl\Graphics.hpp>
|
||||
#include <vcl\StdCtrls.hpp>
|
||||
#include <vcl\Forms.hpp>
|
||||
#include <vcl\Controls.hpp>
|
||||
#include <vcl\Buttons.hpp>
|
||||
#include <vcl\ExtCtrls.hpp>
|
||||
*/
|
||||
#include <Grids.hpp>
|
||||
//----------------------------------------------------------------------------
|
||||
#include "Mmcg.h"
|
||||
#include <Buttons.hpp>
|
||||
#include <Classes.hpp>
|
||||
#include <Controls.hpp>
|
||||
#include <StdCtrls.hpp>
|
||||
//----------------------------------------------------------------------------
|
||||
class TMmcgDlgBox : public TForm
|
||||
{
|
||||
__published:
|
||||
TButton *OKBtn;
|
||||
TButton *CancelBtn;
|
||||
TStringGrid *Grid;
|
||||
TEdit *EditYomi;
|
||||
TSpeedButton *SBMask;
|
||||
TSpeedButton *SBInc;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);
|
||||
void __fastcall GridDrawCell(TObject *Sender, int Col, int Row,
|
||||
TRect &Rect, TGridDrawState State);
|
||||
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
|
||||
1341
Mmvari English.ini
Normal file
1341
Mmvari English.ini
Normal file
File diff suppressed because it is too large
Load diff
1341
Mmvari Japanese.ini
Normal file
1341
Mmvari Japanese.ini
Normal file
File diff suppressed because it is too large
Load diff
1341
Mmvari.ini
Normal file
1341
Mmvari.ini
Normal file
File diff suppressed because it is too large
Load diff
938
Option.cpp
Normal file
938
Option.cpp
Normal file
|
|
@ -0,0 +1,938 @@
|
|||
//Copyright+LGPL
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// This file is part of MMVARI.
|
||||
|
||||
// MMVARI 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.
|
||||
|
||||
// MMVARI 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
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
#include <vcl.h>
|
||||
#pragma hdrstop
|
||||
|
||||
#include "Option.h"
|
||||
#include "ComLib.h"
|
||||
#include "Main.h"
|
||||
#include "dsp.h"
|
||||
#include "CodeVw.h"
|
||||
#include "RadioSet.h"
|
||||
#include "cradio.h"
|
||||
#include "MacEdit.h"
|
||||
//---------------------------------------------------------------------
|
||||
#pragma resource "*.dfm"
|
||||
//TOptDlgBox *OptDlgBox;
|
||||
//---------------------------------------------------------------------
|
||||
__fastcall TOptDlgBox::TOptDlgBox(TComponent* AOwner)
|
||||
: TForm(AOwner)
|
||||
{
|
||||
m_fDisEvent = TRUE;
|
||||
FormStyle = ((TForm *)AOwner)->FormStyle;
|
||||
Font->Name = ((TForm *)AOwner)->Font->Name;
|
||||
Font->Charset = ((TForm *)AOwner)->Font->Charset;
|
||||
if( sys.m_MsgEng ){
|
||||
Caption = "Setup MMVARI";
|
||||
CancelBtn->Caption = "Cancel";
|
||||
|
||||
TabRX->Caption = "RX";
|
||||
TabTX->Caption = "TX";
|
||||
TabMisc->Caption = "Misc";
|
||||
|
||||
// RX
|
||||
GB10->Caption = "HPF (DC ingredients cutter)";
|
||||
GB10->Hint = "It is unnecessary with most sound cards";
|
||||
CBHPF->Caption = "Use HPF";
|
||||
L10->Caption = "FREQ width +/-";
|
||||
L13->Caption = "Sense level(S/N)";
|
||||
GB6->Hint = "Narrow (less than 50Hz) is FB in HF";
|
||||
GB15->Hint = "You do not need to change the value";
|
||||
L20->Caption = "Speed";
|
||||
L21->Caption = "Slow ---- Fast";
|
||||
L22->Caption = "Sense level(S/N)";
|
||||
L23->Caption = "Max range +/-";
|
||||
CBMC->Caption = "Handling center frequency";
|
||||
CBMM->Caption = "Use metric level squelch";
|
||||
CBMM->Hint = "It may be FB, when you use narrow filter in the Rig";
|
||||
GB17->Caption = "Misc";
|
||||
CBSWL->Caption = "Show Time stamp for SWL";
|
||||
CBPB->Caption = "Enabled Sound Playback";
|
||||
LPB->Caption = "Playback speed\r\nx1 -------------- x20";
|
||||
RGRTTY->Caption = "RTTY Demodulator";
|
||||
|
||||
// TX
|
||||
CBComLock->Caption = "Exclusive lock";
|
||||
CBFSK->Caption = "Output";
|
||||
CBFSK->Hint = "Use multi-media timer function";
|
||||
CBFSKINV->Caption = "Invert logic";
|
||||
CBFSKINV->Hint = "Invert mark and space";
|
||||
|
||||
SBRadio->Caption = "Radio command";
|
||||
GB8->Caption = "Digital output level";
|
||||
RGLoopBack->Caption = "LoopBack";
|
||||
RGLoopBack->Items->Strings[0] = "Internal";
|
||||
RGLoopBack->Items->Strings[1] = "External (full-duplex)";
|
||||
GBKey->Caption = "Key assign";
|
||||
GB5->Caption = "Macro";
|
||||
GB16->Caption = "Misc";
|
||||
CBCA->Caption = "Convert MBCS alphabet to ASCII";
|
||||
SBAS->Caption = "Edit AS(CW)";
|
||||
SBAS->Hint = "Edit AS(CW) macro - Right click on the Spectrum scope";
|
||||
GB33->Caption = "Event macro";
|
||||
L33->Caption = "Name";
|
||||
SBEvent->Caption = "Edit";
|
||||
SBEventC->Caption = "Clear";
|
||||
CBEvent->Hint = "Choose event to edit";
|
||||
SBEvent->Hint = "Edit this event";
|
||||
SBEventC->Hint = "Clear this event";
|
||||
CBST->Caption = "Output single tone when the TX ends (PSK)";
|
||||
|
||||
// Misc
|
||||
GB2->Caption = "Soundcard";
|
||||
RGSoundIn->Caption = "Input channel";
|
||||
RGSoundIn->Items->Strings[0] = "Mono";
|
||||
RGSoundIn->Items->Strings[1] = "Left";
|
||||
RGSoundIn->Items->Strings[2] = "Right";
|
||||
RGPriority->Caption = "Priority";
|
||||
RGPriority->Items->Strings[0] = "Normal";
|
||||
RGPriority->Items->Strings[1] = "Higher";
|
||||
RGPriority->Items->Strings[2] = "Highest";
|
||||
GB11->Caption = "RX window";
|
||||
SBRxFont->Caption = "Font";
|
||||
SBRxChar->Caption = "Code list";
|
||||
SBRxChar->Hint = "Character code list";
|
||||
CBRxUTC->Caption = "Time stamp = UTC";
|
||||
CBMW->Caption = "Scroll with mouse wheel";
|
||||
CBShowCtrl->Caption = "Show CTRL code";
|
||||
GB12->Caption = "TX window";
|
||||
SBTxFont->Caption = "Font";
|
||||
GBWindow->Caption = "Size and position";
|
||||
RBW1->Caption = "Windows default";
|
||||
RBW2->Caption = "Save size && pos.";
|
||||
CBRestoreSub->Caption = "Restore sub channels";
|
||||
GB13->Caption = "Spectrum scope";
|
||||
GB14->Caption = "Waterfall scope";
|
||||
L30->Caption = "Level";
|
||||
L31->Caption = "Sigs";
|
||||
|
||||
SBJA->Caption = "Japanese";
|
||||
SBEng->Caption = "English";
|
||||
GB9->Caption = "Message-Language";
|
||||
|
||||
OKBtn->Hint = "Save all update && close this window";
|
||||
CancelBtn->Hint = "Unsave all update && close this window";
|
||||
EATCL->Hint = "Default = 15dB";
|
||||
TBATC->Hint = "Default = Slow";
|
||||
CBATCM->Hint = "Default = 25000ppm";
|
||||
CBComPTT->Hint = "";
|
||||
CBComLock->Hint = "Uncheck this, when the port shares with other software";
|
||||
RGLoopBack->Hint = "Choose 'Internal' for usually operation";
|
||||
ECallSign->Hint = "Your callsign";
|
||||
GB8->Hint = "The signal may be a warp, when it is high (It depend on soundcard)";
|
||||
CBKTX->Hint = "Switch TX/RX";
|
||||
CBKTXOFF->Hint = "Abort TX";
|
||||
CBCA->Hint = "Some transmission efficiency will be improved when does this conv.";
|
||||
CBFifoRX->Hint = "Enlarge the value if you often break the sound in RX";
|
||||
CBFifoTX->Hint = "Enlarge the value if you often break the sound in TX";
|
||||
CBClock->Hint = "RX sampling FREQ (Put the same value of MMSSTV)";
|
||||
CBTxOffset->Hint = "TX (offset) sampling FREQ (Put the same value of MMSSTV)";
|
||||
CBSoundID->Hint = "Input sound device (device name or number)";
|
||||
CBSoundIDTX->Hint = "Output sound device (device name or number)";
|
||||
PCRx1->Hint = "Back color";
|
||||
PCRx2->Hint = "Character color (RX)";
|
||||
PCRx3->Hint = "Character color (TX)";
|
||||
PCRx4->Hint = "Status color";
|
||||
PCRx5->Hint = "Back color with scrolling";
|
||||
PCTx1->Hint = "Back color";
|
||||
PCTx2->Hint = "Character color";
|
||||
PCTx3->Hint = "Character color (TX)";
|
||||
PCTx4->Hint = "CWID/Control code color";
|
||||
PS1->Hint = "Back color";
|
||||
PS2->Hint = "Signal color";
|
||||
PS3->Hint = "Text color";
|
||||
PS4->Hint = "Scale";
|
||||
PS5->Hint = "RX Marker";
|
||||
PS6->Hint = "TX Marker";
|
||||
PW1->Hint = "Back color";
|
||||
PW2->Hint = "Level1";
|
||||
PW3->Hint = "Text color";
|
||||
PW4->Hint = "Marker frame";
|
||||
PW5->Hint = "RX Marker";
|
||||
PW6->Hint = "TX Marker";
|
||||
PW7->Hint = "Level2";
|
||||
PW8->Hint = "Level3";
|
||||
PW9->Hint = "Level4";
|
||||
PW10->Hint = "Level5";
|
||||
PW11->Hint = "Level6";
|
||||
PW12->Hint = "Level7";
|
||||
PL->Hint = "Set level (Drag && drop)";
|
||||
SBWLCD->Hint = "Return to the LCD's default (Level and Colors)";
|
||||
SBWCRT->Hint = "Return to the CRT's default (Level and Colors)";
|
||||
GBWindow->Hint = "Window size and position (when program will be invoked).";
|
||||
SBFont->Hint = "Choose your favorite font for the program except TX/RX window";
|
||||
}
|
||||
else {
|
||||
LPB->Caption = "プレーバック速度\r\nx1 <---------> x20";
|
||||
}
|
||||
SBJA->Hint = "All menu messages are displayed in Japanese";
|
||||
SBEng->Hint = "All menu messages are displayed in English";
|
||||
|
||||
double mb = 120.0 * SAMPBASE / (1024*1024);
|
||||
char bf[256];
|
||||
sprintf(bf, sys.m_MsgEng ? "To use memory of %.1lfMB for the function":"この機能は%.1lfMBのメモリを使います.", mb);
|
||||
CBPB->Hint = bf;
|
||||
|
||||
UdATCL->Hint = EATCL->Hint;
|
||||
m_fComChange = FALSE;
|
||||
m_fLangChange = FALSE;
|
||||
|
||||
UdClock->Hint = CBClock->Hint;
|
||||
UdTxOffset->Hint = CBTxOffset->Hint;
|
||||
OnWave();
|
||||
const DEFKEYTBL *pKey = KEYTBL;
|
||||
for( ; pKey->Key; pKey++ ){
|
||||
CBKTX->Items->Add(pKey->pName);
|
||||
}
|
||||
CBEvent->DropDownCount = macOnEnd;
|
||||
for( int i = 0; i < macOnEnd; i++ ){
|
||||
CBEvent->Items->Add(g_tMacEvent[i]);
|
||||
}
|
||||
CBEvent->ItemIndex = sys.m_EventIndex;
|
||||
OnWave();
|
||||
CBKTXOFF->Items->Assign(CBKTX->Items);
|
||||
FormCenter(this);
|
||||
m_MouseDown = 0;
|
||||
m_MouseWLN = -1;
|
||||
CWave *pw = &MainVARI->m_Wave;
|
||||
pw->GetDeviceList();
|
||||
for( int i = 0; i < pw->m_InDevs; i++ ){
|
||||
if( !pw->m_tInDevName[i].IsEmpty() ){
|
||||
CBSoundID->Items->Add(pw->m_tInDevName[i]);
|
||||
}
|
||||
}
|
||||
for( int i = 0; i < pw->m_OutDevs; i++ ){
|
||||
if( !pw->m_tOutDevName[i].IsEmpty() ){
|
||||
CBSoundIDTX->Items->Add(pw->m_tOutDevName[i]);
|
||||
}
|
||||
}
|
||||
CBSoundID->DropDownCount = CBSoundID->Items->Count;
|
||||
CBSoundIDTX->DropDownCount = CBSoundIDTX->Items->Count;
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
void __fastcall TOptDlgBox::UpdateButton(void)
|
||||
{
|
||||
if( m_FontCharset == SHIFTJIS_CHARSET ){
|
||||
SBJA->Down = TRUE;
|
||||
}
|
||||
else {
|
||||
SBEng->Down = TRUE;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
void __fastcall TOptDlgBox::UpdateHint(void)
|
||||
{
|
||||
AnsiString as = PCRx2->Font->Name;
|
||||
TFontStyles fs = PCRx2->Font->Style;
|
||||
AddStyle(as, PCRx2->Font->Charset, FontStyle2Code(fs));
|
||||
as += sys.m_MsgEng ? " (VariCode type is decided by this font)":" (このフォントでVariCodeタイプが決まります)";
|
||||
SBRxFont->Hint = as;
|
||||
as = PCTx2->Font->Name;
|
||||
fs = PCTx2->Font->Style;
|
||||
AddStyle(as, PCTx2->Font->Charset, FontStyle2Code(fs));
|
||||
SBTxFont->Hint = as;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TOptDlgBox::DisplayHint(TObject *Sender)
|
||||
{
|
||||
LH->Caption = GetLongHint(Application->Hint);
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
void __fastcall TOptDlgBox::UpdateUI(void)
|
||||
{
|
||||
int dd;
|
||||
BOOL f = (sscanf(AnsiString(CBSoundID->Text).c_str(), "%d", &dd) == 1 ); //JA7UDE 0428
|
||||
if( !f ){
|
||||
if( !strcmpi(AnsiString(CBSoundID->Text).c_str(), "Default") ){ //JA7UDE 0428
|
||||
f = TRUE;
|
||||
}
|
||||
else {
|
||||
CWave *pw = &MainVARI->m_Wave;
|
||||
for(int i = 0; i < pw->m_InDevs; i++ ){
|
||||
if( !strcmp(AnsiString(CBSoundID->Text).c_str(), AnsiString(pw->m_tInDevName[i]).c_str()) ){ //JA7UDE 0428
|
||||
f = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
LO->Enabled = f;
|
||||
CBSoundIDTX->Enabled = f;
|
||||
|
||||
GB3->Enabled = f;
|
||||
SetGroupEnabled(GB3);
|
||||
RGSoundIn->Enabled = f;
|
||||
|
||||
f = CBPB->Checked;
|
||||
TBPB->Visible = f;
|
||||
LPB->Visible = f;
|
||||
SBEventC->Enabled = !m_MacEvent[CBEvent->ItemIndex].IsEmpty();
|
||||
|
||||
AnsiString as = CBComPTT->Text;
|
||||
f = strncmpi(as.c_str(), "COM", 3);
|
||||
if( f ){ // COMxx
|
||||
f = strcmp(as.c_str(), "NONE");
|
||||
}
|
||||
else {
|
||||
LPCSTR p = as.c_str();
|
||||
f = isdigit(p[3]) ? 0 : 1;
|
||||
}
|
||||
CBFSKINV->Enabled = f ? 0 : 1;
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
int __fastcall TOptDlgBox::Execute(DWORD dwPage)
|
||||
{
|
||||
m_fDisEvent = TRUE;
|
||||
int i;
|
||||
char bf[256];
|
||||
// RX
|
||||
CBAFCW->Text = MainVARI->m_AFCWidth;
|
||||
UdAFCL->Position = short(MainVARI->m_AFCLevel);
|
||||
CBHPF->Checked = MainVARI->m_fHPF;
|
||||
TBATC->Position = short(MainVARI->m_ATCSpeed);
|
||||
UdATCL->Position = short(MainVARI->m_ATCLevel);
|
||||
CBATCM->Text = MainVARI->m_ATCLimit;
|
||||
CBSWL->Checked = sys.m_fAutoTS;
|
||||
CBPB->Checked = sys.m_fPlayBack;
|
||||
TBPB->Position = sys.m_PlayBackSpeed;
|
||||
RGRTTY->ItemIndex = MainVARI->m_RxSet[0].m_RTTYFFT;
|
||||
// TX
|
||||
CBComPTT->Text = sys.m_PTTCOM;
|
||||
CBFSK->Checked = sys.m_bFSKOUT;
|
||||
CBFSKINV->Checked = sys.m_bINVFSK;
|
||||
|
||||
CBComLock->Checked = sys.m_PTTLock;
|
||||
RGLoopBack->ItemIndex = sys.m_LoopBack;
|
||||
|
||||
ECallSign->Text = sys.m_CallSign;
|
||||
m_AS = sys.m_AS.c_str();
|
||||
for( i = 0; i < macOnEnd; i++ ) m_MacEvent[i] = sys.m_MacEvent[i];
|
||||
TBModGain->Position = MainVARI->m_ModGain;
|
||||
|
||||
CBKTX->ItemIndex = CBKTX->Items->IndexOf(GetKeyName(sys.m_DefKey[kkTX]));
|
||||
CBKTXOFF->ItemIndex = CBKTXOFF->Items->IndexOf(GetKeyName(sys.m_DefKey[kkTXOFF]));
|
||||
CBCA->Checked = MainVARI->m_fConvAlpha;
|
||||
CBMC->Checked = sys.m_MFSK_Center;
|
||||
CBMM->Checked = sys.m_MFSK_SQ_Metric;
|
||||
CBST->Checked = sys.m_fSendSingleTone;
|
||||
|
||||
//Misc
|
||||
CBFifoRX->Text = MainVARI->m_Wave.m_InFifoSize;
|
||||
CBFifoTX->Text = MainVARI->m_Wave.m_OutFifoSize;
|
||||
RGSoundIn->ItemIndex = MainVARI->m_Wave.m_SoundStereo;
|
||||
|
||||
int d;
|
||||
if( MainVARI->m_Wave.m_SoundID == -2 ){
|
||||
CBSoundID->Text = sys.m_SoundMMW;
|
||||
}
|
||||
else {
|
||||
if( (sscanf(sys.m_SoundIDRX.c_str(), "%d", &d ) == 1) && (d == -1) ){
|
||||
CBSoundID->Text = "Default";
|
||||
}
|
||||
else {
|
||||
CBSoundID->Text = sys.m_SoundIDRX;
|
||||
}
|
||||
}
|
||||
if( (sscanf(sys.m_SoundIDTX.c_str(), "%d", &d ) == 1) && (d == -1) ){
|
||||
CBSoundIDTX->Text = "Default";
|
||||
}
|
||||
else {
|
||||
CBSoundIDTX->Text = sys.m_SoundIDTX;
|
||||
}
|
||||
sprintf(bf, "%.2lf", SAMPFREQ);
|
||||
CBClock->Text = bf;
|
||||
sprintf(bf, "%.2lf", SAMPTXOFFSET);
|
||||
CBTxOffset->Text = bf;
|
||||
UdTxOffset->Position = 0;
|
||||
RGPriority->ItemIndex = MainVARI->m_Priority;
|
||||
|
||||
PCRx2->Font = MainVARI->PCRX->Font;
|
||||
long cz;
|
||||
cz = MainVARI->m_Dump.m_Color[0].d;
|
||||
PCRx1->Color = cz;
|
||||
cz = MainVARI->m_Dump.m_Color[1].d;
|
||||
PCRx2->Color = cz;
|
||||
cz = MainVARI->m_Dump.m_Color[2].d;
|
||||
PCRx3->Color = cz;
|
||||
cz = MainVARI->m_Dump.m_Color[3].d;
|
||||
PCRx4->Color = cz;
|
||||
cz = MainVARI->m_Dump.m_Color[4].d;
|
||||
PCRx5->Color = cz;
|
||||
|
||||
//PCRx1->Color = MainVARI->m_Dump.m_Color[0].c;
|
||||
//PCRx2->Color = MainVARI->m_Dump.m_Color[1].c;
|
||||
//PCRx3->Color = MainVARI->m_Dump.m_Color[2].c;
|
||||
//PCRx4->Color = MainVARI->m_Dump.m_Color[3].c;
|
||||
//PCRx5->Color = MainVARI->m_Dump.m_Color[4].c;
|
||||
|
||||
CBRxUTC->Checked = MainVARI->m_StatusUTC;
|
||||
CBMW->Checked = sys.m_EnableMouseWheel;
|
||||
CBShowCtrl->Checked = sys.m_fShowCtrlCode;
|
||||
|
||||
PCTx2->Font = MainVARI->PCTX->Font;
|
||||
cz = MainVARI->m_Edit[0].m_Color[0].c;
|
||||
PCTx1->Color = cz;
|
||||
cz = MainVARI->m_Edit[0].m_Color[1].c;
|
||||
PCTx2->Color = cz;
|
||||
cz = MainVARI->m_Edit[0].m_Color[2].c;
|
||||
PCTx3->Color = cz;
|
||||
cz = MainVARI->m_Edit[0].m_Color[3].c;
|
||||
PCTx4->Color = cz;
|
||||
|
||||
//PCTx1->Color = MainVARI->m_Edit[0].m_Color[0].c;
|
||||
//PCTx2->Color = MainVARI->m_Edit[0].m_Color[1].c;
|
||||
//PCTx3->Color = MainVARI->m_Edit[0].m_Color[2].c;
|
||||
//PCTx4->Color = MainVARI->m_Edit[0].m_Color[3].c;
|
||||
|
||||
PS1->Color = MainVARI->m_tFFTColset[0].c;
|
||||
PS2->Color = MainVARI->m_tFFTColset[1].c;
|
||||
PS3->Color = MainVARI->m_tFFTColset[2].c;
|
||||
PS4->Color = MainVARI->m_tFFTColset[3].c;
|
||||
PS5->Color = MainVARI->m_tFFTColset[4].c;
|
||||
PS6->Color = MainVARI->m_tFFTColset[5].c;
|
||||
|
||||
PW1->Color = MainVARI->m_tWaterColset[0].c;
|
||||
PW2->Color = MainVARI->m_tWaterColset[1].c;
|
||||
PW3->Color = MainVARI->m_tWaterColset[2].c;
|
||||
PW4->Color = MainVARI->m_tWaterColset[3].c;
|
||||
PW5->Color = MainVARI->m_tWaterColset[4].c;
|
||||
PW6->Color = MainVARI->m_tWaterColset[5].c;
|
||||
PW7->Color = MainVARI->m_tWaterColset[6].c;
|
||||
PW8->Color = MainVARI->m_tWaterColset[7].c;
|
||||
PW9->Color = MainVARI->m_tWaterColset[8].c;
|
||||
PW10->Color = MainVARI->m_tWaterColset[9].c;
|
||||
PW11->Color = MainVARI->m_tWaterColset[10].c;
|
||||
PW12->Color = MainVARI->m_tWaterColset[11].c;
|
||||
PL->Color = PW1->Color;
|
||||
for( i = 0; i < 6; i++ ){
|
||||
m_tWaterLevel[i] = MainVARI->m_tWaterLevel[i];
|
||||
}
|
||||
|
||||
RBW1->Checked = !sys.m_fFixWindow;
|
||||
RBW2->Checked = sys.m_fFixWindow;
|
||||
CBRestoreSub->Checked = sys.m_fRestoreSubChannel;
|
||||
|
||||
m_FontName = sys.m_FontName;
|
||||
m_FontCharset = sys.m_FontCharset;
|
||||
|
||||
UpdateButton();
|
||||
UpdateHint();
|
||||
UpdateUI();
|
||||
OnWave();
|
||||
m_fDisEvent = FALSE;
|
||||
|
||||
if( (dwPage >= 0) && (dwPage <= 2) ){
|
||||
sys.m_OptionPage = dwPage;
|
||||
}
|
||||
SetActiveIndex(Page, sys.m_OptionPage);
|
||||
m_fnHintProc = Application->OnHint;
|
||||
Application->OnHint = DisplayHint;
|
||||
int r = ShowModal();
|
||||
Application->OnHint = m_fnHintProc;
|
||||
sys.m_OptionPage = GetActiveIndex(Page);
|
||||
sys.m_EventIndex = CBEvent->ItemIndex;
|
||||
if( r == IDOK ){
|
||||
int di;
|
||||
double dd;
|
||||
// RX
|
||||
sscanf(AnsiString(CBAFCW->Text).c_str(), "%u", &di); //JA7UDE 0428
|
||||
if( (di >= 0) && (di <= 2000) ){
|
||||
MainVARI->m_AFCWidth = di;
|
||||
}
|
||||
MainVARI->m_AFCLevel = UdAFCL->Position;
|
||||
MainVARI->m_fHPF = CBHPF->Checked;
|
||||
MainVARI->SetATCSpeed(TBATC->Position);
|
||||
MainVARI->m_ATCLevel = UdATCL->Position;
|
||||
sscanf(AnsiString(CBATCM->Text).c_str(), "%u", &di); //JA7UDE 0428
|
||||
if( (di >= 1000) && (di <= 100000) ){
|
||||
MainVARI->SetATCLimit(di);
|
||||
}
|
||||
sys.m_fAutoTS = CBSWL->Checked;
|
||||
sys.m_fPlayBack = CBPB->Checked;
|
||||
sys.m_PlayBackSpeed = TBPB->Position;
|
||||
|
||||
// TX
|
||||
sys.m_PTTCOM = CBComPTT->Text;
|
||||
sys.m_bFSKOUT = CBFSK->Checked;
|
||||
sys.m_bINVFSK = CBFSKINV->Checked;
|
||||
if( MainVARI->m_pCom ) MainVARI->m_pCom->SetFSK(sys.m_bFSKOUT, sys.m_bINVFSK);
|
||||
|
||||
sys.m_PTTLock = CBComLock->Checked;
|
||||
sys.m_LoopBack = RGLoopBack->ItemIndex;
|
||||
sys.m_CallSign = ECallSign->Text;
|
||||
sys.m_AS = m_AS.c_str();
|
||||
for( i = 0; i < macOnEnd; i++ ) sys.m_MacEvent[i] = m_MacEvent[i];
|
||||
MainVARI->m_ModGain = TBModGain->Position;
|
||||
MainVARI->UpdateModGain();
|
||||
|
||||
sys.m_DefKey[kkTX] = GetKeyCode(AnsiString(CBKTX->Text).c_str()); //JA7UDE 0428
|
||||
sys.m_DefKey[kkTXOFF] = GetKeyCode(AnsiString(CBKTXOFF->Text).c_str()); //JA7UDE 0428
|
||||
MainVARI->SetConvAlpha(CBCA->Checked);
|
||||
sys.m_fSendSingleTone = CBST->Checked;
|
||||
|
||||
PCTx2->Font->Charset = PCRx2->Font->Charset;
|
||||
LOGFONT l1;
|
||||
LOGFONT l2;
|
||||
GetLogFont(&l1, PCRx2->Font);
|
||||
GetLogFont(&l2, MainVARI->PCRX->Font);
|
||||
if( memcmp(&l1, &l2, sizeof(l1)) ){
|
||||
MainVARI->PCRX->Font = PCRx2->Font;
|
||||
MainVARI->OnFontChange(FALSE);
|
||||
}
|
||||
MainVARI->m_Dump.m_Color[0].c = PCRx1->Color;
|
||||
MainVARI->m_Dump.m_Color[1].c = PCRx2->Color;
|
||||
MainVARI->m_Dump.m_Color[2].c = PCRx3->Color;
|
||||
MainVARI->m_Dump.m_Color[3].c = PCRx4->Color;
|
||||
MainVARI->m_Dump.m_Color[4].c = PCRx5->Color;
|
||||
MainVARI->m_StatusUTC = CBRxUTC->Checked;
|
||||
sys.m_EnableMouseWheel = CBMW->Checked;
|
||||
sys.m_fShowCtrlCode = CBShowCtrl->Checked;
|
||||
|
||||
GetLogFont(&l1, PCTx2->Font);
|
||||
GetLogFont(&l2, MainVARI->PCTX->Font);
|
||||
if( memcmp(&l1, &l2, sizeof(l1)) ){
|
||||
MainVARI->PCTX->Font = PCTx2->Font;
|
||||
MainVARI->OnFontChange(TRUE);
|
||||
}
|
||||
for( int i = 0; i < 4; i++ ){
|
||||
MainVARI->m_Edit[i].m_Color[0].c = PCTx1->Color;
|
||||
MainVARI->m_Edit[i].m_Color[1].c = PCTx2->Color;
|
||||
MainVARI->m_Edit[i].m_Color[2].c = PCTx3->Color;
|
||||
MainVARI->m_Edit[i].m_Color[3].c = PCTx4->Color;
|
||||
MainVARI->m_Edit[i].m_Color[4].c = PCTx1->Color;
|
||||
}
|
||||
MainVARI->m_tFFTColset[0].c = PS1->Color;
|
||||
MainVARI->m_tFFTColset[1].c = PS2->Color;
|
||||
MainVARI->m_tFFTColset[2].c = PS3->Color;
|
||||
MainVARI->m_tFFTColset[3].c = PS4->Color;
|
||||
MainVARI->m_tFFTColset[4].c = PS5->Color;
|
||||
MainVARI->m_tFFTColset[5].c = PS6->Color;
|
||||
|
||||
MainVARI->m_tWaterColset[0].c = PW1->Color;
|
||||
MainVARI->m_tWaterColset[1].c = PW2->Color;
|
||||
MainVARI->m_tWaterColset[2].c = PW3->Color;
|
||||
MainVARI->m_tWaterColset[3].c = PW4->Color;
|
||||
MainVARI->m_tWaterColset[4].c = PW5->Color;
|
||||
MainVARI->m_tWaterColset[5].c = PW6->Color;
|
||||
MainVARI->m_tWaterColset[6].c = PW7->Color;
|
||||
MainVARI->m_tWaterColset[7].c = PW8->Color;
|
||||
MainVARI->m_tWaterColset[8].c = PW9->Color;
|
||||
MainVARI->m_tWaterColset[9].c = PW10->Color;
|
||||
MainVARI->m_tWaterColset[10].c = PW11->Color;
|
||||
MainVARI->m_tWaterColset[11].c = PW12->Color;
|
||||
for( i = 0; i < 6; i++ ){
|
||||
MainVARI->m_tWaterLevel[i] = m_tWaterLevel[i];
|
||||
}
|
||||
|
||||
sys.m_fFixWindow = RBW2->Checked;
|
||||
sys.m_fRestoreSubChannel = CBRestoreSub->Checked;
|
||||
|
||||
if( RGRTTY->ItemIndex != MainVARI->m_RxSet[0].m_RTTYFFT ){
|
||||
MainVARI->SetRTTYFFT(RGRTTY->ItemIndex);
|
||||
}
|
||||
|
||||
sys.m_MFSK_SQ_Metric = CBMM->Checked;
|
||||
sscanf(AnsiString(CBClock->Text).c_str(), "%lf", &dd); //JA7UDE 0428
|
||||
di = CBMC->Checked != sys.m_MFSK_Center;
|
||||
if( (dd != SAMPFREQ) || di ){
|
||||
sys.m_MFSK_Center = CBMC->Checked;
|
||||
MainVARI->SetSampleFreq(dd, di);
|
||||
}
|
||||
sscanf(AnsiString(CBTxOffset->Text).c_str(), "%lf", &dd); //JA7UDE 0428
|
||||
if( dd != SAMPTXOFFSET ){
|
||||
MainVARI->SetTxOffset(dd);
|
||||
}
|
||||
sscanf(AnsiString(CBFifoRX->Text).c_str(), "%u", &di); //JA7UDE 0428
|
||||
if( (di >= 4) && (di <= 32) ){
|
||||
MainVARI->SetRXFifo(di);
|
||||
}
|
||||
sscanf(AnsiString(CBFifoTX->Text).c_str(), "%u", &di); //JA7UDE 0428
|
||||
if( (di >= 4) && (di <= 32) ){
|
||||
MainVARI->SetTXFifo(di);
|
||||
}
|
||||
MainVARI->SetSoundCard(RGSoundIn->ItemIndex, AnsiString(CBSoundID->Text).c_str(), AnsiString(CBSoundIDTX->Text).c_str()); //JA7UDE 0428
|
||||
MainVARI->UpdatePriority(RGPriority->ItemIndex);
|
||||
|
||||
if( (m_FontCharset != sys.m_FontCharset) || (m_FontName != sys.m_FontName) ){
|
||||
m_fLangChange = TRUE;
|
||||
sys.m_FontCharset = m_FontCharset;
|
||||
sys.m_FontName = m_FontName;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
OnWave();
|
||||
return FALSE;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TOptDlgBox::UdTxOffsetClick(TObject *Sender,
|
||||
TUDBtnType Button)
|
||||
{
|
||||
if( m_fDisEvent ) return;
|
||||
|
||||
double f;
|
||||
sscanf(AnsiString(CBTxOffset->Text).c_str(), "%lf", &f); //JA7UDE 0428
|
||||
if( Button == Comctrls::btNext ){
|
||||
f += 0.02;
|
||||
}
|
||||
else {
|
||||
f -= 0.02;
|
||||
}
|
||||
char bf[128];
|
||||
sprintf(bf, "%.2lf", f);
|
||||
m_fDisEvent++;
|
||||
CBTxOffset->Text = bf;
|
||||
m_fDisEvent--;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TOptDlgBox::CBTxOffsetChange(TObject *Sender)
|
||||
{
|
||||
if( m_fDisEvent ) return;
|
||||
double fq;
|
||||
sscanf(AnsiString(CBTxOffset->Text).c_str(), "%lf", &fq); //JA7UDE 0428
|
||||
if( (fq >= -300.0) && (fq <= 300.0) ){
|
||||
m_fDisEvent++;
|
||||
UdTxOffset->Position = short(fq * 100.0);
|
||||
m_fDisEvent--;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TOptDlgBox::SBRxFontClick(TObject *Sender)
|
||||
{
|
||||
TFontDialog *pBox = new TFontDialog(this);
|
||||
TPanel *pPanel = Sender == SBRxFont ? PCRx2 : PCTx2;
|
||||
pBox->Font = pPanel->Font;
|
||||
pBox->Font->Color = pPanel->Color;
|
||||
OnWave();
|
||||
if( pBox->Execute() ){
|
||||
pPanel->Font = pBox->Font;
|
||||
pPanel->Color = pBox->Font->Color;
|
||||
if( pPanel == PCRx2 ){
|
||||
PCTx2->Font->Name = PCRx2->Font->Name;
|
||||
PCTx2->Font->Charset = PCRx2->Font->Charset;
|
||||
}
|
||||
UpdateHint();
|
||||
}
|
||||
delete pBox;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TOptDlgBox::SBRxCharClick(TObject *Sender)
|
||||
{
|
||||
LOGFONT l1;
|
||||
GetLogFont(&l1, PCRx2->Font);
|
||||
TCodeView *pBox = new TCodeView(this);
|
||||
Application->OnHint = m_fnHintProc;
|
||||
pBox->Execute(NULL, 0, 0, PCRx2->Font);
|
||||
Application->OnHint = DisplayHint;
|
||||
LOGFONT l2;
|
||||
GetLogFont(&l2, PCRx2->Font);
|
||||
if( memcmp(&l1, &l2, sizeof(l1)) ){
|
||||
PCTx2->Font->Name = PCRx2->Font->Name;
|
||||
PCTx2->Font->Charset = PCRx2->Font->Charset;
|
||||
UpdateHint();
|
||||
}
|
||||
delete pBox;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TOptDlgBox::PCRx1Click(TObject *Sender)
|
||||
{
|
||||
TColorDialog *pBox = new TColorDialog(this);
|
||||
pBox->Options << cdFullOpen;
|
||||
TPanel *pPanel = (TPanel *)Sender;
|
||||
pBox->Color = pPanel->Color;
|
||||
OnWave();
|
||||
if( pBox->Execute() ){
|
||||
pPanel->Color = pBox->Color;
|
||||
if( pPanel == PW1 ) PL->Color = PW1->Color;
|
||||
PBL->Invalidate();
|
||||
}
|
||||
delete pBox;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TOptDlgBox::UdClockClick(TObject *Sender,
|
||||
TUDBtnType Button)
|
||||
{
|
||||
if( m_fDisEvent ) return;
|
||||
|
||||
double f;
|
||||
sscanf(AnsiString(CBClock->Text).c_str(), "%lf", &f); //JA7UDE 0428
|
||||
if( Button == Comctrls::btNext ){
|
||||
f += 0.02;
|
||||
}
|
||||
else {
|
||||
f -= 0.02;
|
||||
}
|
||||
char bf[128];
|
||||
sprintf(bf, "%.2lf", f);
|
||||
m_fDisEvent++;
|
||||
CBClock->Text = bf;
|
||||
m_fDisEvent--;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TOptDlgBox::CBComPTTChange(TObject *Sender)
|
||||
{
|
||||
if( m_fDisEvent ) return;
|
||||
|
||||
m_fComChange = TRUE;
|
||||
UpdateUI();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TOptDlgBox::SBRadioClick(TObject *Sender)
|
||||
{
|
||||
TRADIOSetDlg *pBox = new TRADIOSetDlg(this);
|
||||
RADIO.change = pBox->Execute();
|
||||
delete pBox;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TOptDlgBox::SBEngClick(TObject *Sender)
|
||||
{
|
||||
if( SBJA->Down ){
|
||||
m_FontName = "MS Pゴシック";
|
||||
m_FontCharset = SHIFTJIS_CHARSET;
|
||||
if( sys.m_MsgEng ){
|
||||
Application->MessageBox(L"MMVARIを再起動すると日本語モードになります.\r\n(Please restart MMVARI for Japanese mode)", L"MMVARI", MB_ICONINFORMATION|MB_OK);
|
||||
}
|
||||
}
|
||||
else {
|
||||
m_FontName = "Arial";
|
||||
m_FontCharset = ANSI_CHARSET;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TOptDlgBox::SBFontClick(TObject *Sender)
|
||||
{
|
||||
TFontDialog *pBox = new TFontDialog(this);
|
||||
pBox->Font->Name = m_FontName;
|
||||
pBox->Font->Charset = m_FontCharset;
|
||||
OnWave();
|
||||
if( pBox->Execute() ){
|
||||
m_FontName = pBox->Font->Name;
|
||||
m_FontCharset = pBox->Font->Charset;
|
||||
UpdateButton();
|
||||
}
|
||||
delete pBox;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TOptDlgBox::PBLPaint(TObject *Sender)
|
||||
{
|
||||
int xw = PBL->Width;
|
||||
int yw = PBL->Height;
|
||||
int x;
|
||||
|
||||
TCanvas *pCanvas = PBL->Canvas;
|
||||
|
||||
TRect rc;
|
||||
rc.Left = 0; rc.Top = 0;
|
||||
rc.Right = xw; rc.Bottom = yw;
|
||||
pCanvas->Brush->Color = PW1->Color;
|
||||
pCanvas->FillRect(rc);
|
||||
|
||||
pCanvas->Pen->Width = 2;
|
||||
TColor col[6];
|
||||
col[0] = PW2->Color;
|
||||
col[1] = PW7->Color;
|
||||
col[2] = PW8->Color;
|
||||
col[3] = PW9->Color;
|
||||
col[4] = PW10->Color;
|
||||
col[5] = PW11->Color;
|
||||
|
||||
for( int i = 0; i < 6; i++ ){
|
||||
x = m_tWaterLevel[i] * xw / 256;
|
||||
pCanvas->Pen->Color = col[i];
|
||||
pCanvas->MoveTo(x, 0);
|
||||
pCanvas->LineTo(x, yw);
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
int __fastcall TOptDlgBox::GetWLNo(int x)
|
||||
{
|
||||
int i;
|
||||
int *ip = m_tWaterLevel;
|
||||
for( i = 0; i < 6; i++, ip++ ){
|
||||
int X = *ip * PBL->Width / 256;
|
||||
if( (x > (X-3)) && (x < (X+3)) ){
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TOptDlgBox::PBLMouseDown(TObject *Sender,
|
||||
TMouseButton Button, TShiftState Shift, int X, int Y)
|
||||
{
|
||||
if( Button != mbLeft ) return;
|
||||
|
||||
if( m_MouseWLN >= 0 ){
|
||||
m_MouseDown = TRUE;
|
||||
switch(m_MouseWLN){
|
||||
case 0:
|
||||
m_MinWL = 0;
|
||||
m_MaxWL = m_tWaterLevel[1];
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
m_MinWL = m_tWaterLevel[m_MouseWLN-1];
|
||||
m_MaxWL = m_tWaterLevel[m_MouseWLN+1];
|
||||
break;
|
||||
case 5:
|
||||
m_MinWL = m_tWaterLevel[4];
|
||||
m_MaxWL = 256;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TOptDlgBox::PBLMouseMove(TObject *Sender,
|
||||
TShiftState Shift, int X, int Y)
|
||||
{
|
||||
if( m_MouseDown ){
|
||||
int x = X * 256 / PBL->Width;
|
||||
if( (x > m_MinWL) && (x < m_MaxWL) ){
|
||||
m_tWaterLevel[m_MouseWLN] = x;
|
||||
PBLPaint(NULL);
|
||||
}
|
||||
}
|
||||
else {
|
||||
m_MouseWLN = GetWLNo(X);
|
||||
PBL->Cursor = m_MouseWLN >= 0 ? crSizeWE : crDefault;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TOptDlgBox::PBLMouseUp(TObject *Sender,
|
||||
TMouseButton Button, TShiftState Shift, int X, int Y)
|
||||
{
|
||||
m_MouseDown = FALSE;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void __fastcall TOptDlgBox::SBWLCDClick(TObject *Sender)
|
||||
{
|
||||
PW1->Color = clBlack; // back
|
||||
PW3->Color = clWhite; // char
|
||||
PW4->Color = clRed; // WAKU
|
||||
PW5->Color = TColor(RGB(0,255,255)); // RX
|
||||
PW6->Color = clBlue; // TX
|
||||
|
||||
if( Sender == SBWLCD ){
|
||||
m_tWaterLevel[0] = 28;
|
||||
m_tWaterLevel[1] = 100;
|
||||
m_tWaterLevel[2] = 168;
|
||||
m_tWaterLevel[3] = 192;
|
||||
m_tWaterLevel[4] = 220;
|
||||
m_tWaterLevel[5] = 240;
|
||||
|
||||
PW2->Color = TColor(RGB(0,255,255)); // low
|
||||
PW7->Color = clYellow; // mid-low
|
||||
PW8->Color = TColor(RGB(255,128,0)); // mid
|
||||
PW9->Color = TColor(RGB(255,0,128)); // mid-high
|
||||
PW10->Color = clRed; // Peak
|
||||
PW11->Color = clRed; // Peak
|
||||
PW12->Color = clRed; // Peak
|
||||
}
|
||||
else {
|
||||
m_tWaterLevel[0] = 10;
|
||||
m_tWaterLevel[1] = 60;
|
||||
m_tWaterLevel[2] = 134;
|
||||
m_tWaterLevel[3] = 192;
|
||||
m_tWaterLevel[4] = 220;
|
||||
m_tWaterLevel[5] = 240;
|
||||
|
||||
PW2->Color = TColor(16711680); // low
|
||||
PW7->Color = TColor(16776960); // mid-low
|
||||
PW8->Color = TColor(65535); // mid
|
||||
PW9->Color = TColor(33023); // mid-high
|
||||
PW10->Color = clRed; // Peak
|
||||
PW11->Color = clRed; // Peak
|
||||
PW12->Color = clRed; // Peak
|
||||
}
|
||||
PBL->Invalidate();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TOptDlgBox::CBSoundIDDropDown(TObject *Sender)
|
||||
{
|
||||
if( m_fDisEvent ) return;
|
||||
|
||||
if( !m_MMListW.IsQuery() ){
|
||||
m_MMListW.QueryList("MMW");
|
||||
for( int i = 0; i < m_MMListW.GetCount(); i++ ){
|
||||
CBSoundID->Items->Add(m_MMListW.GetItemName(i));
|
||||
}
|
||||
CBSoundID->DropDownCount = CBSoundID->Items->Count;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TOptDlgBox::CBSoundIDChange(TObject *Sender)
|
||||
{
|
||||
if( m_fDisEvent ) return;
|
||||
UpdateUI();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TOptDlgBox::CBComPTTDropDown(TObject *Sender)
|
||||
{
|
||||
if( m_fDisEvent ) return;
|
||||
|
||||
if( !m_MMListF.IsQuery() ){
|
||||
m_MMListF.QueryList("FSK");
|
||||
for( int i = 0; i < m_MMListF.GetCount(); i++ ){
|
||||
CBComPTT->Items->Add(m_MMListF.GetItemName(i));
|
||||
}
|
||||
CBComPTT->DropDownCount = CBComPTT->Items->Count;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TOptDlgBox::SBASClick(TObject *Sender)
|
||||
{
|
||||
TMacEditDlg *pBox = new TMacEditDlg(this);
|
||||
if( pBox->Execute(m_AS, "AS(CW)") ){
|
||||
AdjustAS(&m_AS);
|
||||
}
|
||||
delete pBox;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TOptDlgBox::SBEventClick(TObject *Sender)
|
||||
{
|
||||
int n = CBEvent->ItemIndex;
|
||||
TMacEditDlg *pBox = new TMacEditDlg(this);
|
||||
if( pBox->Execute(m_MacEvent[n], g_tMacEvent[n]) ){
|
||||
AdjustAS(&m_MacEvent[n]);
|
||||
}
|
||||
delete pBox;
|
||||
UpdateUI();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TOptDlgBox::SBEventCClick(TObject *Sender)
|
||||
{
|
||||
int n = CBEvent->ItemIndex;
|
||||
if( YesNoMB(sys.m_MsgEng ? "Clear contents of %s, and stop executing this event macro.":"%sの定義内容をクリアし、このイベントマクロを停止します.", g_tMacEvent[n]) == IDYES ){
|
||||
m_MacEvent[n] = "";
|
||||
UpdateUI();
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TOptDlgBox::CBPBClick(TObject *Sender)
|
||||
{
|
||||
UpdateUI();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue