├── Doc ├── index.htm ├── SWManual.doc └── ale_diag.jpg ├── SourceALE ├── ALE_Help.chm ├── res │ ├── ALE.ico │ ├── ALEDoc.ico │ ├── ale-2.ico │ ├── Toolbar.bmp │ ├── movedownd.bmp │ ├── movedownf.bmp │ ├── movedownu.bmp │ ├── movedownx.bmp │ ├── moveupd.bmp │ ├── moveupf.bmp │ ├── moveupu.bmp │ ├── moveupx.bmp │ └── ALE.rc2 ├── StdAfx.cpp ├── Dlgfloat.h ├── ALE.dsw ├── ASCII_Set.h ├── Icom.h ├── Radio.h ├── ALE.sln ├── SunTimes.h ├── Radio.cpp ├── StdAfx.h ├── AMDText.h ├── ALE.h ├── SelectSoundAddrs.h ├── SelectSelfAddr.h ├── SlotAddr.h ├── SelectIndivAddr.h ├── AMDDisplay.h ├── SlotList.h ├── Config.h ├── SignalQualityDlg.h ├── MainFrm.h ├── CircBufO.cpp ├── AMDText.cpp ├── SelfAddrDlg.h ├── CircBufI.cpp ├── ChannelList.h ├── OtherAddrList.h ├── SelfAddrList.h ├── OtherAddrDlg.h ├── ChannelDlg.h ├── SelectRxChannel.h ├── hlp │ └── ALE.hm ├── Dlgfloat.cpp ├── SelectSelfAddr.cpp ├── SlotAddr.cpp ├── Icom.cpp ├── ALEView.h ├── SelectSoundAddrs.cpp ├── resource.h ├── HDAudio.h ├── MainFrm.cpp ├── CircBuf.h ├── ALE.cpp ├── Config.cpp ├── SelectIndivAddr.cpp ├── SignalQualityDlg.cpp ├── SelfAddrDlg.cpp ├── OtherAddrDlg.cpp ├── ChannelDlg.cpp ├── SunTimes.cpp ├── SlotList.cpp ├── SelectRxChannel.cpp ├── AMDDisplay.cpp ├── OtherAddrList.cpp ├── SelfAddrList.cpp └── ALE.vcxproj.filters ├── SourceHelp └── ALEhelp.zip ├── SourceCal ├── res │ ├── Calibrate.ico │ ├── Toolbar.bmp │ ├── CalibrateDoc.ico │ └── Calibrate.rc2 ├── resource.hm ├── StdAfx.cpp ├── Calibrate.dsw ├── resource.h ├── Calibrate.sln ├── StdAfx.h ├── Calibrate.h ├── CalibrateDoc.h ├── MainFrm.h ├── CalibrateView.h ├── CalibrateDoc.cpp ├── HDAudio.h ├── CalDlg.h ├── MainFrm.cpp ├── CalibrateView.cpp ├── Calibrate.vcxproj.filters ├── Calibrate.cpp └── Calibrate.dsp ├── README.md └── .gitignore /Doc/index.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DigitalHERMES/ALELite/master/Doc/index.htm -------------------------------------------------------------------------------- /Doc/SWManual.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DigitalHERMES/ALELite/master/Doc/SWManual.doc -------------------------------------------------------------------------------- /Doc/ale_diag.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DigitalHERMES/ALELite/master/Doc/ale_diag.jpg -------------------------------------------------------------------------------- /SourceALE/ALE_Help.chm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DigitalHERMES/ALELite/master/SourceALE/ALE_Help.chm -------------------------------------------------------------------------------- /SourceALE/res/ALE.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DigitalHERMES/ALELite/master/SourceALE/res/ALE.ico -------------------------------------------------------------------------------- /SourceHelp/ALEhelp.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DigitalHERMES/ALELite/master/SourceHelp/ALEhelp.zip -------------------------------------------------------------------------------- /SourceALE/res/ALEDoc.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DigitalHERMES/ALELite/master/SourceALE/res/ALEDoc.ico -------------------------------------------------------------------------------- /SourceALE/res/ale-2.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DigitalHERMES/ALELite/master/SourceALE/res/ale-2.ico -------------------------------------------------------------------------------- /SourceALE/res/Toolbar.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DigitalHERMES/ALELite/master/SourceALE/res/Toolbar.bmp -------------------------------------------------------------------------------- /SourceALE/res/movedownd.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DigitalHERMES/ALELite/master/SourceALE/res/movedownd.bmp -------------------------------------------------------------------------------- /SourceALE/res/movedownf.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DigitalHERMES/ALELite/master/SourceALE/res/movedownf.bmp -------------------------------------------------------------------------------- /SourceALE/res/movedownu.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DigitalHERMES/ALELite/master/SourceALE/res/movedownu.bmp -------------------------------------------------------------------------------- /SourceALE/res/movedownx.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DigitalHERMES/ALELite/master/SourceALE/res/movedownx.bmp -------------------------------------------------------------------------------- /SourceALE/res/moveupd.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DigitalHERMES/ALELite/master/SourceALE/res/moveupd.bmp -------------------------------------------------------------------------------- /SourceALE/res/moveupf.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DigitalHERMES/ALELite/master/SourceALE/res/moveupf.bmp -------------------------------------------------------------------------------- /SourceALE/res/moveupu.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DigitalHERMES/ALELite/master/SourceALE/res/moveupu.bmp -------------------------------------------------------------------------------- /SourceALE/res/moveupx.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DigitalHERMES/ALELite/master/SourceALE/res/moveupx.bmp -------------------------------------------------------------------------------- /SourceCal/res/Calibrate.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DigitalHERMES/ALELite/master/SourceCal/res/Calibrate.ico -------------------------------------------------------------------------------- /SourceCal/res/Toolbar.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DigitalHERMES/ALELite/master/SourceCal/res/Toolbar.bmp -------------------------------------------------------------------------------- /SourceCal/res/CalibrateDoc.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DigitalHERMES/ALELite/master/SourceCal/res/CalibrateDoc.ico -------------------------------------------------------------------------------- /SourceCal/resource.hm: -------------------------------------------------------------------------------- 1 | // Microsoft Developer Studio generated Help ID include file. 2 | // Used by Calibrate.rc 3 | // 4 | #define HIDC_STATIC3 0x808203eb // IDD_DIALOG1 5 | -------------------------------------------------------------------------------- /SourceALE/StdAfx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // ALE.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /SourceCal/StdAfx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // Calibrate.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /SourceALE/Dlgfloat.h: -------------------------------------------------------------------------------- 1 | // dlgfloat.h : header file for double validation routine 2 | // 30 Jun 1999 3 | 4 | // Undocumented MFC routine 5 | AFX_STATIC BOOL AFXAPI _AfxSimpleFloatParse(LPCTSTR lpszText, double& d); 6 | AFX_STATIC BOOL AFXAPI _AfxSimpleLongParse(LPCTSTR lpszText, long& lo); 7 | BOOL SimpleHexParse(LPCTSTR lpszText, long& lo); 8 | -------------------------------------------------------------------------------- /SourceALE/res/ALE.rc2: -------------------------------------------------------------------------------- 1 | // 2 | // ALE.RC2 - resources Microsoft Visual C++ does not edit directly 3 | // 4 | 5 | #ifdef APSTUDIO_INVOKED 6 | #error this file is not editable by Microsoft Visual C++ 7 | #endif //APSTUDIO_INVOKED 8 | 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // Add manually edited resources here... 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | -------------------------------------------------------------------------------- /SourceCal/res/Calibrate.rc2: -------------------------------------------------------------------------------- 1 | // 2 | // CALIBRATE.RC2 - resources Microsoft Visual C++ does not edit directly 3 | // 4 | 5 | #ifdef APSTUDIO_INVOKED 6 | #error this file is not editable by Microsoft Visual C++ 7 | #endif //APSTUDIO_INVOKED 8 | 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // Add manually edited resources here... 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | -------------------------------------------------------------------------------- /SourceALE/ALE.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "ALE"=.\ALE.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /SourceCal/Calibrate.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "Calibrate"=".\Calibrate.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /SourceALE/ASCII_Set.h: -------------------------------------------------------------------------------- 1 | /* ASCII_Set.h eej 7/22/91 table indexed by ASCII character */ 2 | /* to determine most restrictive character set it belongs to */ 3 | 4 | #define ASCII_128 0 5 | #define ASCII_64 1 6 | #define ASCII_38 2 7 | 8 | static char ASCII_Set[128] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 11 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 2, 12 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 13 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 14 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; 16 | 17 | -------------------------------------------------------------------------------- /SourceALE/Icom.h: -------------------------------------------------------------------------------- 1 | // Icom.h: interface for the CIcom class, a type of CRadio. 2 | // 1 Jul 1999 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_ICOM_H__0A0160A1_0209_11D3_8F3A_0060089F9D1C__INCLUDED_) 6 | #define AFX_ICOM_H__0A0160A1_0209_11D3_8F3A_0060089F9D1C__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | // Icom.h : header file 12 | // 13 | 14 | class CIcom : public CRadio 15 | { 16 | // Construction 17 | public: 18 | CIcom(HANDLE hComm); 19 | 20 | // Attributes 21 | public: 22 | 23 | // Operations 24 | public: 25 | 26 | // Implementation 27 | public: 28 | virtual ~CIcom(); 29 | virtual void Initialize(BYTE bRadioAddress); 30 | virtual void Tune(double dFreq); 31 | virtual void SetMode(enum RADIOMODE Mode); 32 | 33 | private: 34 | BYTE BCD(int twodig); 35 | }; 36 | 37 | #endif // !defined(AFX_ICOM_H__0A0160A1_0209_11D3_8F3A_0060089F9D1C__INCLUDED_) 38 | -------------------------------------------------------------------------------- /SourceALE/Radio.h: -------------------------------------------------------------------------------- 1 | // Radio.h: interface for the CRadio class. 2 | // 31 Aug 1999 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_RADIO_H__23CB3481_3120_11D2_8F37_0060089F9D1C__INCLUDED_) 6 | #define AFX_RADIO_H__23CB3481_3120_11D2_8F37_0060089F9D1C__INCLUDED_ 7 | 8 | #if _MSC_VER >= 1000 9 | #pragma once 10 | #endif // _MSC_VER >= 1000 11 | 12 | class CRadio 13 | { 14 | public: 15 | enum RADIOMODE {NULL_MODE, USB, LSB, CW, AM}; 16 | 17 | protected: 18 | HANDLE hComm; 19 | enum RADIOMODE eCurMode; 20 | double dCurFreq; 21 | BYTE baMessage[20]; 22 | 23 | public: 24 | CRadio(); 25 | virtual ~CRadio(); 26 | virtual void Initialize(BYTE bRadioAddress); 27 | virtual void Tune(double dFreq); 28 | void SetFreq(double dFreq); 29 | double GetFreq(); 30 | virtual void SetMode(enum RADIOMODE Mode); 31 | enum RADIOMODE GetMode(); 32 | }; 33 | 34 | #endif // !defined(AFX_RADIO_H__23CB3481_3120_11D2_8F37_0060089F9D1C__INCLUDED_) 35 | -------------------------------------------------------------------------------- /SourceALE/ALE.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30128.74 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ALE", "ALE.vcxproj", "{3DB2CFB9-6AF0-4765-B4EE-A3D43FDC30EB}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x86 = Debug|x86 11 | Release|x86 = Release|x86 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {3DB2CFB9-6AF0-4765-B4EE-A3D43FDC30EB}.Debug|x86.ActiveCfg = Debug|Win32 15 | {3DB2CFB9-6AF0-4765-B4EE-A3D43FDC30EB}.Debug|x86.Build.0 = Debug|Win32 16 | {3DB2CFB9-6AF0-4765-B4EE-A3D43FDC30EB}.Release|x86.ActiveCfg = Release|Win32 17 | {3DB2CFB9-6AF0-4765-B4EE-A3D43FDC30EB}.Release|x86.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {0FD470A2-2A57-4FB7-9403-A8596C9802BC} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /SourceCal/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by Calibrate.rc 4 | // 5 | #define IDD_ABOUTBOX 100 6 | #define IDR_MAINFRAME 128 7 | #define IDR_CALIBRTYPE 129 8 | #define IDD_DIALOG1 130 9 | #define IDC_BUTTON1 1000 10 | #define IDC_STATIC1 1001 11 | #define IDC_STATIC0 1002 12 | #define IDC_STATIC3 1003 13 | #define IDC_BUTTON2 1004 14 | #define IDC_STATIC4 1004 15 | #define IDC_STATIC5 1005 16 | #define IDC_BUTTON3 1006 17 | #define ID_CALIBRATE_GO 32771 18 | 19 | // Next default values for new objects 20 | // 21 | #ifdef APSTUDIO_INVOKED 22 | #ifndef APSTUDIO_READONLY_SYMBOLS 23 | #define _APS_3D_CONTROLS 1 24 | #define _APS_NEXT_RESOURCE_VALUE 131 25 | #define _APS_NEXT_COMMAND_VALUE 32772 26 | #define _APS_NEXT_CONTROL_VALUE 1006 27 | #define _APS_NEXT_SYMED_VALUE 101 28 | #endif 29 | #endif 30 | -------------------------------------------------------------------------------- /SourceCal/Calibrate.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30128.74 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Calibrate", "Calibrate.vcxproj", "{FDC0A81E-1850-4E1F-AAD8-D8F5EA3D62C4}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x86 = Debug|x86 11 | Release|x86 = Release|x86 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {FDC0A81E-1850-4E1F-AAD8-D8F5EA3D62C4}.Debug|x86.ActiveCfg = Debug|Win32 15 | {FDC0A81E-1850-4E1F-AAD8-D8F5EA3D62C4}.Debug|x86.Build.0 = Debug|Win32 16 | {FDC0A81E-1850-4E1F-AAD8-D8F5EA3D62C4}.Release|x86.ActiveCfg = Release|Win32 17 | {FDC0A81E-1850-4E1F-AAD8-D8F5EA3D62C4}.Release|x86.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {D4CE421B-7CF6-4C2E-BFD6-6732DC9BA82E} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /SourceALE/SunTimes.h: -------------------------------------------------------------------------------- 1 | // SunTimes.h: interface for the CSunTimes class. 2 | // 19 Oct 1999 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_SUNTIMES_H__1D8715E4_860F_11D3_8F3A_0060089F9D1C__INCLUDED_) 6 | #define AFX_SUNTIMES_H__1D8715E4_860F_11D3_8F3A_0060089F9D1C__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | class CSunTimes 13 | { 14 | private: 15 | double PI; 16 | 17 | public: 18 | CSunTimes(); 19 | virtual ~CSunTimes(); 20 | double GetSunRiseGMT(double latitude, double longitude); 21 | double GetSunSetGMT(double latitude, double longitude); 22 | 23 | private: 24 | int JulianDay(int mn, int dy, int lpyr); 25 | int IsLeapYear(int yr); 26 | double CalcGamma(int julianDay); 27 | double CalcGamma2(int julianDay, double hour); 28 | double CalcEqofTime(double gamma); 29 | double CalcSolarDec(double gamma); 30 | double CalcHourAngle(double lat, double solarDec, BOOL bSunRise); 31 | double DegToRad(double angleDeg); 32 | double RadToDeg(double angleRad); 33 | }; 34 | 35 | #endif // !defined(AFX_SUNTIMES_H__1D8715E4_860F_11D3_8F3A_0060089F9D1C__INCLUDED_) 36 | -------------------------------------------------------------------------------- /SourceCal/StdAfx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #if !defined(AFX_STDAFX_H__DF634687_AD5F_11D3_B8DB_0080C84B206B__INCLUDED_) 7 | #define AFX_STDAFX_H__DF634687_AD5F_11D3_B8DB_0080C84B206B__INCLUDED_ 8 | 9 | #if _MSC_VER > 1000 10 | #pragma once 11 | #endif // _MSC_VER > 1000 12 | 13 | #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers 14 | 15 | #include // MFC core and standard components 16 | #include // MFC extensions 17 | #include // MFC Automation classes 18 | #include // MFC support for Internet Explorer 4 Common Controls 19 | #ifndef _AFX_NO_AFXCMN_SUPPORT 20 | #include // MFC support for Windows Common Controls 21 | #endif // _AFX_NO_AFXCMN_SUPPORT 22 | 23 | #define WM_USER_DATA_AVAIL WM_USER 24 | 25 | //{{AFX_INSERT_LOCATION}} 26 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 27 | 28 | #endif // !defined(AFX_STDAFX_H__DF634687_AD5F_11D3_B8DB_0080C84B206B__INCLUDED_) 29 | -------------------------------------------------------------------------------- /SourceALE/Radio.cpp: -------------------------------------------------------------------------------- 1 | // Radio.cpp: implementation of the CRadio class. 2 | // 31 Aug 1999 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #include "stdafx.h" 6 | #include "Radio.h" 7 | 8 | #ifdef _DEBUG 9 | #undef THIS_FILE 10 | static char THIS_FILE[]=__FILE__; 11 | #define new DEBUG_NEW 12 | #endif 13 | ////////////////////////////////////////////////////////////////////// 14 | // CRadio 15 | 16 | ////////////////////////////////////////////////////////////////////// 17 | // Construction/Destruction 18 | ////////////////////////////////////////////////////////////////////// 19 | 20 | CRadio::CRadio() 21 | { 22 | dCurFreq = 0.0; 23 | eCurMode = NULL_MODE; 24 | } 25 | 26 | CRadio::~CRadio() 27 | { 28 | } 29 | 30 | void CRadio::Initialize(BYTE bRadioAddress) 31 | { 32 | } 33 | 34 | void CRadio::Tune(double dFreq) 35 | { 36 | dCurFreq = dFreq; 37 | } 38 | 39 | void CRadio::SetFreq(double dFreq) 40 | { 41 | // This is used by derived classes to save the current frequency 42 | dCurFreq = dFreq; 43 | } 44 | 45 | double CRadio::GetFreq() 46 | { 47 | return dCurFreq; 48 | } 49 | 50 | void CRadio::SetMode(enum RADIOMODE Mode) 51 | { 52 | } 53 | 54 | enum CRadio::RADIOMODE CRadio::GetMode() 55 | { 56 | return eCurMode; 57 | } 58 | -------------------------------------------------------------------------------- /SourceALE/StdAfx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | // 19 Aug 1999 6 | 7 | #if !defined(AFX_STDAFX_H__1A7D6910_335C_11D2_8F37_0060089F9D1C__INCLUDED_) 8 | #define AFX_STDAFX_H__1A7D6910_335C_11D2_8F37_0060089F9D1C__INCLUDED_ 9 | 10 | #if _MSC_VER > 1000 11 | #pragma once 12 | #endif // _MSC_VER > 1000 13 | 14 | #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers 15 | 16 | #include // MFC core and standard components 17 | #include // MFC extensions 18 | #include // MFC Automation classes 19 | #include // MFC support for Internet Explorer 4 Common Controls 20 | #ifndef _AFX_NO_AFXCMN_SUPPORT 21 | #include // MFC support for Windows Common Controls 22 | #include // support for HTML help 23 | #endif // _AFX_NO_AFXCMN_SUPPORT 24 | 25 | #define WM_USER_DATA_AVAIL WM_USER 26 | #define WM_USER_DOC_STARTED (WM_USER+1) 27 | #define WM_USER_ACTION (WM_USER+2) 28 | 29 | #define ID_TIMER_SOUNDING 1 30 | 31 | //{{AFX_INSERT_LOCATION}} 32 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 33 | 34 | #endif // !defined(AFX_STDAFX_H__1A7D6910_335C_11D2_8F37_0060089F9D1C__INCLUDED_) 35 | -------------------------------------------------------------------------------- /SourceALE/AMDText.h: -------------------------------------------------------------------------------- 1 | // AMDText.h : header file 2 | // 13 Oct 1999 3 | 4 | #if !defined(AFX_AMDTEXT_H__189C4849_80A9_11D3_8F3A_0060089F9D1C__INCLUDED_) 5 | #define AFX_AMDTEXT_H__189C4849_80A9_11D3_8F3A_0060089F9D1C__INCLUDED_ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | // CAMDText dialog 13 | 14 | class CAMDText : public CDialog 15 | { 16 | private: 17 | CEdit& ctlText() { return *(CEdit*) GetDlgItem(IDC_EDIT1); } 18 | 19 | // Construction 20 | public: 21 | CAMDText(CWnd* pParent = NULL); // standard constructor 22 | 23 | struct CALEDoc::DATA *pData; 24 | CString strAMDText; 25 | 26 | // Dialog Data 27 | //{{AFX_DATA(CAMDText) 28 | enum { IDD = IDD_AMDMESSAGE }; 29 | // NOTE: the ClassWizard will add data members here 30 | //}}AFX_DATA 31 | 32 | 33 | // Overrides 34 | // ClassWizard generated virtual function overrides 35 | //{{AFX_VIRTUAL(CAMDText) 36 | //}}AFX_VIRTUAL 37 | 38 | // Implementation 39 | protected: 40 | 41 | // Generated message map functions 42 | //{{AFX_MSG(CAMDText) 43 | virtual BOOL OnInitDialog(); 44 | virtual void OnOK(); 45 | //}}AFX_MSG 46 | DECLARE_MESSAGE_MAP() 47 | }; 48 | 49 | //{{AFX_INSERT_LOCATION}} 50 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 51 | 52 | #endif // !defined(AFX_AMDTEXT_H__189C4849_80A9_11D3_8F3A_0060089F9D1C__INCLUDED_) 53 | -------------------------------------------------------------------------------- /SourceALE/ALE.h: -------------------------------------------------------------------------------- 1 | // ALE.h : main header file for the ALE application 2 | // 3 Feb 1999 3 | 4 | #if !defined(AFX_ALE_H__1A7D690E_335C_11D2_8F37_0060089F9D1C__INCLUDED_) 5 | #define AFX_ALE_H__1A7D690E_335C_11D2_8F37_0060089F9D1C__INCLUDED_ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | #ifndef __AFXWIN_H__ 12 | #error include 'stdafx.h' before including this file for PCH 13 | #endif 14 | 15 | #include "resource.h" // main symbols 16 | 17 | ///////////////////////////////////////////////////////////////////////////// 18 | // CALEApp: 19 | // See ALE.cpp for the implementation of this class 20 | // 21 | 22 | class CALEApp : public CWinApp 23 | { 24 | public: 25 | CALEApp(); 26 | 27 | // Overrides 28 | // ClassWizard generated virtual function overrides 29 | //{{AFX_VIRTUAL(CALEApp) 30 | public: 31 | virtual BOOL InitInstance(); 32 | //}}AFX_VIRTUAL 33 | 34 | // Implementation 35 | //{{AFX_MSG(CALEApp) 36 | afx_msg void OnAppAbout(); 37 | // NOTE - the ClassWizard will add and remove member functions here. 38 | // DO NOT EDIT what you see in these blocks of generated code ! 39 | //}}AFX_MSG 40 | DECLARE_MESSAGE_MAP() 41 | }; 42 | 43 | 44 | ///////////////////////////////////////////////////////////////////////////// 45 | 46 | //{{AFX_INSERT_LOCATION}} 47 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 48 | 49 | #endif // !defined(AFX_ALE_H__1A7D690E_335C_11D2_8F37_0060089F9D1C__INCLUDED_) 50 | -------------------------------------------------------------------------------- /SourceALE/SelectSoundAddrs.h: -------------------------------------------------------------------------------- 1 | // SelectSoundAddrs.h : header file 2 | // 5 Apr 1999 3 | 4 | #if !defined(AFX_SELECTSOUNDADDRS_H__E2C077CE_E8FD_11D2_8F3A_0060089F9D1C__INCLUDED_) 5 | #define AFX_SELECTSOUNDADDRS_H__E2C077CE_E8FD_11D2_8F3A_0060089F9D1C__INCLUDED_ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | // CSelectSoundAddrs dialog 13 | 14 | class CSelectSoundAddrs : public CDialog 15 | { 16 | private: 17 | CListBox& ctlList() { return *(CListBox*) GetDlgItem(IDC_LIST1); } 18 | 19 | // Construction 20 | public: 21 | CSelectSoundAddrs(CWnd* pParent = NULL); // standard constructor 22 | 23 | struct CALEDoc::DATA *pData; 24 | 25 | // Dialog Data 26 | //{{AFX_DATA(CSelectSoundAddrs) 27 | enum { IDD = IDD_SOUNDADDRS }; 28 | // NOTE: the ClassWizard will add data members here 29 | //}}AFX_DATA 30 | 31 | 32 | // Overrides 33 | // ClassWizard generated virtual function overrides 34 | //{{AFX_VIRTUAL(CSelectSoundAddrs) 35 | //}}AFX_VIRTUAL 36 | 37 | // Implementation 38 | protected: 39 | 40 | // Generated message map functions 41 | //{{AFX_MSG(CSelectSoundAddrs) 42 | virtual BOOL OnInitDialog(); 43 | virtual void OnOK(); 44 | //}}AFX_MSG 45 | DECLARE_MESSAGE_MAP() 46 | }; 47 | 48 | //{{AFX_INSERT_LOCATION}} 49 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 50 | 51 | #endif // !defined(AFX_SELECTSOUNDADDRS_H__E2C077CE_E8FD_11D2_8F3A_0060089F9D1C__INCLUDED_) 52 | -------------------------------------------------------------------------------- /SourceALE/SelectSelfAddr.h: -------------------------------------------------------------------------------- 1 | // SelectSelfAddr.h : header file 2 | // 4 Oct 99 3 | 4 | #if !defined(AFX_SELECTSELFADDR_H__67B76E43_7A60_11D3_8F3A_0060089F9D1C__INCLUDED_) 5 | #define AFX_SELECTSELFADDR_H__67B76E43_7A60_11D3_8F3A_0060089F9D1C__INCLUDED_ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | // CSelectSelfAddr dialog 13 | 14 | class CSelectSelfAddr : public CDialog 15 | { 16 | private: 17 | CListBox& ctlSelfList() { return *(CListBox*) GetDlgItem(IDC_LIST1); } 18 | 19 | // Construction 20 | public: 21 | CSelectSelfAddr(CWnd* pParent = NULL); // standard constructor 22 | 23 | struct CALEDoc::DATA *pData; 24 | int iSelfAddr, iChannel; 25 | 26 | // Dialog Data 27 | //{{AFX_DATA(CSelectSelfAddr) 28 | enum { IDD = IDD_SELSELFADDR }; 29 | // NOTE: the ClassWizard will add data members here 30 | //}}AFX_DATA 31 | 32 | // Overrides 33 | // ClassWizard generated virtual function overrides 34 | //{{AFX_VIRTUAL(CSelectSelfAddr) 35 | //}}AFX_VIRTUAL 36 | 37 | // Implementation 38 | protected: 39 | 40 | // Generated message map functions 41 | //{{AFX_MSG(CSelectSelfAddr) 42 | virtual BOOL OnInitDialog(); 43 | virtual void OnOK(); 44 | //}}AFX_MSG 45 | DECLARE_MESSAGE_MAP() 46 | }; 47 | 48 | //{{AFX_INSERT_LOCATION}} 49 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 50 | 51 | #endif // !defined(AFX_SELECTSELFADDR_H__67B76E43_7A60_11D3_8F3A_0060089F9D1C__INCLUDED_) 52 | -------------------------------------------------------------------------------- /SourceCal/Calibrate.h: -------------------------------------------------------------------------------- 1 | // Calibrate.h : main header file for the CALIBRATE application 2 | // 3 | 4 | #if !defined(AFX_CALIBRATE_H__DF634685_AD5F_11D3_B8DB_0080C84B206B__INCLUDED_) 5 | #define AFX_CALIBRATE_H__DF634685_AD5F_11D3_B8DB_0080C84B206B__INCLUDED_ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | #ifndef __AFXWIN_H__ 12 | #error include 'stdafx.h' before including this file for PCH 13 | #endif 14 | 15 | #include "resource.h" // main symbols 16 | 17 | ///////////////////////////////////////////////////////////////////////////// 18 | // CCalibrateApp: 19 | // See Calibrate.cpp for the implementation of this class 20 | // 21 | 22 | class CCalibrateApp : public CWinApp 23 | { 24 | public: 25 | CCalibrateApp(); 26 | 27 | // Overrides 28 | // ClassWizard generated virtual function overrides 29 | //{{AFX_VIRTUAL(CCalibrateApp) 30 | public: 31 | virtual BOOL InitInstance(); 32 | //}}AFX_VIRTUAL 33 | 34 | // Implementation 35 | //{{AFX_MSG(CCalibrateApp) 36 | afx_msg void OnAppAbout(); 37 | // NOTE - the ClassWizard will add and remove member functions here. 38 | // DO NOT EDIT what you see in these blocks of generated code ! 39 | //}}AFX_MSG 40 | DECLARE_MESSAGE_MAP() 41 | }; 42 | 43 | 44 | ///////////////////////////////////////////////////////////////////////////// 45 | 46 | //{{AFX_INSERT_LOCATION}} 47 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 48 | 49 | #endif // !defined(AFX_CALIBRATE_H__DF634685_AD5F_11D3_B8DB_0080C84B206B__INCLUDED_) 50 | -------------------------------------------------------------------------------- /SourceALE/SlotAddr.h: -------------------------------------------------------------------------------- 1 | // SlotAddr.h : header file 2 | // 13 Jan 1999 3 | 4 | #if !defined(AFX_SLOTADDR_H__4D577202_AAD8_11D2_8F3A_0060089F9D1C__INCLUDED_) 5 | #define AFX_SLOTADDR_H__4D577202_AAD8_11D2_8F3A_0060089F9D1C__INCLUDED_ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | // CSlotAddr dialog 13 | 14 | class CSlotAddr : public CDialog 15 | { 16 | private: 17 | CEdit& ctlSlotAddr() {return *(CEdit *) GetDlgItem(IDC_EDIT1); } 18 | 19 | // Construction 20 | public: 21 | CSlotAddr(CWnd* pParent = NULL); // standard constructor 22 | 23 | CStringArray *pSlotStrings; 24 | BOOL bNew; // TRUE if this is a new record, FALSE to edit existing record 25 | int pos; // The position of the string to edit or where to add a new string 26 | 27 | // Dialog Data 28 | //{{AFX_DATA(CSlotAddr) 29 | enum { IDD = IDD_SLOTADDR }; 30 | // NOTE: the ClassWizard will add data members here 31 | //}}AFX_DATA 32 | 33 | 34 | // Overrides 35 | // ClassWizard generated virtual function overrides 36 | //{{AFX_VIRTUAL(CSlotAddr) 37 | //}}AFX_VIRTUAL 38 | 39 | // Implementation 40 | protected: 41 | 42 | // Generated message map functions 43 | //{{AFX_MSG(CSlotAddr) 44 | virtual BOOL OnInitDialog(); 45 | virtual void OnOK(); 46 | //}}AFX_MSG 47 | DECLARE_MESSAGE_MAP() 48 | }; 49 | 50 | //{{AFX_INSERT_LOCATION}} 51 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 52 | 53 | #endif // !defined(AFX_SLOTADDR_H__4D577202_AAD8_11D2_8F3A_0060089F9D1C__INCLUDED_) 54 | -------------------------------------------------------------------------------- /SourceALE/SelectIndivAddr.h: -------------------------------------------------------------------------------- 1 | // SelectIndivAddr.h : header file 2 | // 9 Jul 1999 3 | 4 | #if !defined(AFX_SELECTINDIVADDR_H__C7DE9D61_E5F1_11D2_8F3A_0060089F9D1C__INCLUDED_) 5 | #define AFX_SELECTINDIVADDR_H__C7DE9D61_E5F1_11D2_8F3A_0060089F9D1C__INCLUDED_ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | // CSelectIndivAddr dialog 13 | 14 | class CSelectIndivAddr : public CDialog 15 | { 16 | private: 17 | CListBox& ctlToList() { return *(CListBox*) GetDlgItem(IDC_LIST1); } 18 | CListBox& ctlSelfList() { return *(CListBox*) GetDlgItem(IDC_LIST2); } 19 | 20 | // Construction 21 | public: 22 | CSelectIndivAddr(CWnd* pParent = NULL); // standard constructor 23 | 24 | struct CALEDoc::DATA *pData; 25 | int iOtherAddr, iSelfAddr, iChannel; 26 | CHANNELMODE eChannelMode; 27 | 28 | // Dialog Data 29 | //{{AFX_DATA(CSelectIndivAddr) 30 | enum { IDD = IDD_SELINDIV }; 31 | // NOTE: the ClassWizard will add data members here 32 | //}}AFX_DATA 33 | 34 | // Overrides 35 | // ClassWizard generated virtual function overrides 36 | //{{AFX_VIRTUAL(CSelectIndivAddr) 37 | //}}AFX_VIRTUAL 38 | 39 | // Implementation 40 | protected: 41 | 42 | // Generated message map functions 43 | //{{AFX_MSG(CSelectIndivAddr) 44 | virtual BOOL OnInitDialog(); 45 | virtual void OnOK(); 46 | //}}AFX_MSG 47 | DECLARE_MESSAGE_MAP() 48 | }; 49 | 50 | //{{AFX_INSERT_LOCATION}} 51 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 52 | 53 | #endif // !defined(AFX_SELECTINDIVADDR_H__C7DE9D61_E5F1_11D2_8F3A_0060089F9D1C__INCLUDED_) 54 | -------------------------------------------------------------------------------- /SourceALE/AMDDisplay.h: -------------------------------------------------------------------------------- 1 | // AMDDisplay.h : header file 2 | // 12 Oct 99 3 | 4 | #if !defined(AFX_AMDDISPLAY_H__8E74B801_7C9D_11D3_8F3A_0060089F9D1C__INCLUDED_) 5 | #define AFX_AMDDISPLAY_H__8E74B801_7C9D_11D3_8F3A_0060089F9D1C__INCLUDED_ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | // CAMDDisplay dialog 13 | 14 | class CAMDDisplay : public CDialog 15 | { 16 | private: 17 | CRichEditCtrl& ctlEdit() { return *(CRichEditCtrl*) GetDlgItem(IDC_RICHEDIT1); } 18 | 19 | // Construction 20 | public: 21 | CAMDDisplay(CWnd* pParent = NULL); // standard constructor 22 | void AMDModified(LONG index); 23 | 24 | // Dialog Data 25 | struct CALEDoc::DATA *pData; 26 | CALEView* view; 27 | 28 | //{{AFX_DATA(CAMDDisplay) 29 | enum { IDD = IDD_AMD }; 30 | // NOTE: the ClassWizard will add data members here 31 | //}}AFX_DATA 32 | 33 | 34 | // Overrides 35 | // ClassWizard generated virtual function overrides 36 | //{{AFX_VIRTUAL(CAMDDisplay) 37 | //}}AFX_VIRTUAL 38 | 39 | // Implementation 40 | private: 41 | int iMsg; // index to where new text will go in the RichEdit control 42 | 43 | protected: 44 | virtual void OnCancel(); 45 | virtual void PostNcDestroy(); 46 | 47 | // Generated message map functions 48 | //{{AFX_MSG(CAMDDisplay) 49 | virtual BOOL OnInitDialog(); 50 | //}}AFX_MSG 51 | DECLARE_MESSAGE_MAP() 52 | }; 53 | 54 | //{{AFX_INSERT_LOCATION}} 55 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 56 | 57 | #endif // !defined(AFX_AMDDISPLAY_H__8E74B801_7C9D_11D3_8F3A_0060089F9D1C__INCLUDED_) 58 | -------------------------------------------------------------------------------- /SourceALE/SlotList.h: -------------------------------------------------------------------------------- 1 | // SlotList.h : header file 2 | // 13 Jan 1999 3 | 4 | #if !defined(AFX_SLOTLIST_H__4D577201_AAD8_11D2_8F3A_0060089F9D1C__INCLUDED_) 5 | #define AFX_SLOTLIST_H__4D577201_AAD8_11D2_8F3A_0060089F9D1C__INCLUDED_ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | // CSlotList dialog 13 | 14 | class CSlotList : public CDialog 15 | { 16 | private: 17 | CListCtrl& ctlList () { return *(CListCtrl*) GetDlgItem(IDC_LIST1); } 18 | CBitmapButton m_ctlMoveUp; 19 | CBitmapButton m_ctlMoveDown; 20 | 21 | void DispSlotList(); 22 | 23 | // Construction 24 | public: 25 | CSlotList(CWnd* pParent = NULL); // standard constructor 26 | 27 | CStringArray *pSlotStrings; 28 | 29 | // Dialog Data 30 | //{{AFX_DATA(CSlotList) 31 | enum { IDD = IDD_SLOT_LIST }; 32 | // NOTE: the ClassWizard will add data members here 33 | //}}AFX_DATA 34 | 35 | 36 | // Overrides 37 | // ClassWizard generated virtual function overrides 38 | //{{AFX_VIRTUAL(CSlotList) 39 | //}}AFX_VIRTUAL 40 | 41 | // Implementation 42 | protected: 43 | 44 | // Generated message map functions 45 | //{{AFX_MSG(CSlotList) 46 | afx_msg void OnAddSaddr(); 47 | afx_msg void OnDeleteSaddr(); 48 | afx_msg void OnEditSaddr(); 49 | afx_msg void OnMovedown(); 50 | afx_msg void OnMoveup(); 51 | virtual BOOL OnInitDialog(); 52 | //}}AFX_MSG 53 | DECLARE_MESSAGE_MAP() 54 | }; 55 | 56 | //{{AFX_INSERT_LOCATION}} 57 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 58 | 59 | #endif // !defined(AFX_SLOTLIST_H__4D577201_AAD8_11D2_8F3A_0060089F9D1C__INCLUDED_) 60 | -------------------------------------------------------------------------------- /SourceALE/Config.h: -------------------------------------------------------------------------------- 1 | // Config.h : header file 2 | // 30 Jun 1999 3 | 4 | #if !defined(AFX_CONFIG_H__1641AFC1_2A20_11D3_8F3A_0060089F9D1C__INCLUDED_) 5 | #define AFX_CONFIG_H__1641AFC1_2A20_11D3_8F3A_0060089F9D1C__INCLUDED_ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | // CConfig dialog 13 | 14 | class CConfig : public CDialog 15 | { 16 | private: 17 | CComboBox& ctlComboRadio() {return *(CComboBox *) GetDlgItem(IDC_COMBO1); } 18 | CEdit& ctlRadioAddr() {return *(CEdit *) GetDlgItem(IDC_RADIOADDR); } 19 | CComboBox& ctlComboCommPort() {return *(CComboBox *) GetDlgItem(IDC_COMBO2); } 20 | CComboBox& ctlComboBaud() {return *(CComboBox *) GetDlgItem(IDC_COMBO3); } 21 | 22 | // Construction 23 | public: 24 | CConfig(CWnd* pParent = NULL); // standard constructor 25 | 26 | struct CALEDoc::DATA *pData; 27 | HANDLE hComm; 28 | 29 | // Dialog Data 30 | //{{AFX_DATA(CConfig) 31 | enum { IDD = IDD_CONFIG }; 32 | // NOTE: the ClassWizard will add data members here 33 | //}}AFX_DATA 34 | 35 | 36 | // Overrides 37 | // ClassWizard generated virtual function overrides 38 | //{{AFX_VIRTUAL(CConfig) 39 | //}}AFX_VIRTUAL 40 | 41 | // Implementation 42 | protected: 43 | 44 | // Generated message map functions 45 | //{{AFX_MSG(CConfig) 46 | virtual BOOL OnInitDialog(); 47 | virtual void OnOK(); 48 | //}}AFX_MSG 49 | DECLARE_MESSAGE_MAP() 50 | }; 51 | 52 | //{{AFX_INSERT_LOCATION}} 53 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 54 | 55 | #endif // !defined(AFX_CONFIG_H__1641AFC1_2A20_11D3_8F3A_0060089F9D1C__INCLUDED_) 56 | -------------------------------------------------------------------------------- /SourceCal/CalibrateDoc.h: -------------------------------------------------------------------------------- 1 | // CalibrateDoc.h : interface of the CCalibrateDoc class 2 | // 3 | ///////////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_CALIBRATEDOC_H__DF63468B_AD5F_11D3_B8DB_0080C84B206B__INCLUDED_) 6 | #define AFX_CALIBRATEDOC_H__DF63468B_AD5F_11D3_B8DB_0080C84B206B__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | class CCalibrateDoc : public CDocument 13 | { 14 | protected: // create from serialization only 15 | CCalibrateDoc(); 16 | DECLARE_DYNCREATE(CCalibrateDoc) 17 | 18 | // Attributes 19 | // Operations 20 | public: 21 | 22 | // Overrides 23 | // ClassWizard generated virtual function overrides 24 | //{{AFX_VIRTUAL(CCalibrateDoc) 25 | public: 26 | virtual BOOL OnNewDocument(); 27 | virtual void Serialize(CArchive& ar); 28 | //}}AFX_VIRTUAL 29 | 30 | // Implementation 31 | public: 32 | virtual ~CCalibrateDoc(); 33 | void DataAvail(); 34 | 35 | #ifdef _DEBUG 36 | virtual void AssertValid() const; 37 | virtual void Dump(CDumpContext& dc) const; 38 | #endif 39 | 40 | protected: 41 | 42 | // Generated message map functions 43 | protected: 44 | //{{AFX_MSG(CCalibrateDoc) 45 | // NOTE - the ClassWizard will add and remove member functions here. 46 | // DO NOT EDIT what you see in these blocks of generated code ! 47 | //}}AFX_MSG 48 | DECLARE_MESSAGE_MAP() 49 | }; 50 | 51 | ///////////////////////////////////////////////////////////////////////////// 52 | 53 | //{{AFX_INSERT_LOCATION}} 54 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 55 | 56 | #endif // !defined(AFX_CALIBRATEDOC_H__DF63468B_AD5F_11D3_B8DB_0080C84B206B__INCLUDED_) 57 | -------------------------------------------------------------------------------- /SourceALE/SignalQualityDlg.h: -------------------------------------------------------------------------------- 1 | // SignalQualityDlg.h : header file 2 | // 12 May 1999 3 | 4 | #if !defined(AFX_SIGNALQUALITYDLG_H__8AB1E944_06E1_11D3_8F3A_0060089F9D1C__INCLUDED_) 5 | #define AFX_SIGNALQUALITYDLG_H__8AB1E944_06E1_11D3_8F3A_0060089F9D1C__INCLUDED_ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | class CALEView; 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | // CSignalQualityDlg dialog 15 | 16 | class CSignalQualityDlg : public CDialog 17 | { 18 | private: 19 | CListCtrl& ctlList() { return *(CListCtrl*) GetDlgItem(IDC_LIST1); } 20 | 21 | // Construction 22 | public: 23 | CSignalQualityDlg(CWnd* pParent = NULL); // standard constructor 24 | void LqaModified(UINT wEditType, LONG index); 25 | 26 | // Dialog Data 27 | struct CALEDoc::DATA *pData; 28 | CALEView* view; 29 | 30 | //{{AFX_DATA(CSignalQualityDlg) 31 | enum { IDD = IDD_SIGNALQUALITY }; 32 | // NOTE: the ClassWizard will add data members here 33 | //}}AFX_DATA 34 | 35 | 36 | // Overrides 37 | // ClassWizard generated virtual function overrides 38 | //{{AFX_VIRTUAL(CSignalQualityDlg) 39 | //}}AFX_VIRTUAL 40 | 41 | // Implementation 42 | protected: 43 | virtual void OnCancel(); 44 | virtual void PostNcDestroy(); 45 | // Generated message map functions 46 | //{{AFX_MSG(CSignalQualityDlg) 47 | afx_msg void OnDeleteCh(); 48 | virtual BOOL OnInitDialog(); 49 | //}}AFX_MSG 50 | DECLARE_MESSAGE_MAP() 51 | }; 52 | 53 | //{{AFX_INSERT_LOCATION}} 54 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 55 | 56 | #endif // !defined(AFX_SIGNALQUALITYDLG_H__8AB1E944_06E1_11D3_8F3A_0060089F9D1C__INCLUDED_) 57 | -------------------------------------------------------------------------------- /SourceALE/MainFrm.h: -------------------------------------------------------------------------------- 1 | // MainFrm.h : interface of the CMainFrame class 2 | // 28 May 1999 3 | ///////////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_MAINFRM_H__1A7D6912_335C_11D2_8F37_0060089F9D1C__INCLUDED_) 6 | #define AFX_MAINFRM_H__1A7D6912_335C_11D2_8F37_0060089F9D1C__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | class CMainFrame : public CFrameWnd 13 | { 14 | 15 | protected: // create from serialization only 16 | CMainFrame(); 17 | DECLARE_DYNCREATE(CMainFrame) 18 | 19 | // Attributes 20 | public: 21 | 22 | // Operations 23 | public: 24 | 25 | // Overrides 26 | // ClassWizard generated virtual function overrides 27 | //{{AFX_VIRTUAL(CMainFrame) 28 | virtual BOOL PreCreateWindow(CREATESTRUCT& cs); 29 | //}}AFX_VIRTUAL 30 | 31 | // Implementation 32 | public: 33 | virtual ~CMainFrame(); 34 | #ifdef _DEBUG 35 | virtual void AssertValid() const; 36 | virtual void Dump(CDumpContext& dc) const; 37 | #endif 38 | 39 | protected: // control bar embedded members 40 | CStatusBar m_wndStatusBar; 41 | CToolBar m_wndToolBar; 42 | 43 | // Generated message map functions 44 | protected: 45 | //{{AFX_MSG(CMainFrame) 46 | afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 47 | afx_msg void OnHelpFinder(); 48 | //}}AFX_MSG 49 | afx_msg LONG OnDataAvail(UINT, LONG); 50 | afx_msg LONG OnDocAvail(UINT, LONG); 51 | afx_msg LONG OnModemActionMessage(UINT, LONG); 52 | DECLARE_MESSAGE_MAP() 53 | }; 54 | 55 | ///////////////////////////////////////////////////////////////////////////// 56 | 57 | //{{AFX_INSERT_LOCATION}} 58 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 59 | 60 | #endif // !defined(AFX_MAINFRM_H__1A7D6912_335C_11D2_8F37_0060089F9D1C__INCLUDED_) 61 | -------------------------------------------------------------------------------- /SourceCal/MainFrm.h: -------------------------------------------------------------------------------- 1 | // MainFrm.h : interface of the CMainFrame class 2 | // 3 | ///////////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_MAINFRM_H__DF634689_AD5F_11D3_B8DB_0080C84B206B__INCLUDED_) 6 | #define AFX_MAINFRM_H__DF634689_AD5F_11D3_B8DB_0080C84B206B__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | class CMainFrame : public CFrameWnd 13 | { 14 | 15 | protected: // create from serialization only 16 | CMainFrame(); 17 | DECLARE_DYNCREATE(CMainFrame) 18 | 19 | // Attributes 20 | public: 21 | 22 | // Operations 23 | public: 24 | 25 | // Overrides 26 | // ClassWizard generated virtual function overrides 27 | //{{AFX_VIRTUAL(CMainFrame) 28 | virtual BOOL PreCreateWindow(CREATESTRUCT& cs); 29 | //}}AFX_VIRTUAL 30 | 31 | // Implementation 32 | public: 33 | virtual ~CMainFrame(); 34 | #ifdef _DEBUG 35 | virtual void AssertValid() const; 36 | virtual void Dump(CDumpContext& dc) const; 37 | #endif 38 | 39 | protected: // control bar embedded members 40 | CStatusBar m_wndStatusBar; 41 | CToolBar m_wndToolBar; 42 | 43 | // Generated message map functions 44 | protected: 45 | //{{AFX_MSG(CMainFrame) 46 | afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 47 | // NOTE - the ClassWizard will add and remove member functions here. 48 | // DO NOT EDIT what you see in these blocks of generated code! 49 | //}}AFX_MSG 50 | afx_msg LONG OnDataAvail(UINT, LONG); 51 | DECLARE_MESSAGE_MAP() 52 | }; 53 | 54 | ///////////////////////////////////////////////////////////////////////////// 55 | 56 | //{{AFX_INSERT_LOCATION}} 57 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 58 | 59 | #endif // !defined(AFX_MAINFRM_H__DF634689_AD5F_11D3_B8DB_0080C84B206B__INCLUDED_) 60 | -------------------------------------------------------------------------------- /SourceALE/CircBufO.cpp: -------------------------------------------------------------------------------- 1 | // CircBufO.cpp: implementation of the CCircBufO class. 2 | // 10 Mar 1999 3 | 4 | 5 | #include "stdafx.h" 6 | #include 7 | #include "CircBuf.h" 8 | 9 | #ifdef _DEBUG 10 | #undef THIS_FILE 11 | static char THIS_FILE[]=__FILE__; 12 | #define new DEBUG_NEW 13 | #endif 14 | 15 | ////////////////////////////////////////////////////////////////////// 16 | // Construction/Destruction 17 | ////////////////////////////////////////////////////////////////////// 18 | 19 | CCircBufO::CCircBufO() 20 | { 21 | in = 0; 22 | out = 0; 23 | } 24 | 25 | CCircBufO::~CCircBufO() 26 | { 27 | 28 | } 29 | 30 | ////////////////////////////////////////////////////////////////////// 31 | // Member Functions 32 | 33 | void CCircBufO::Reset() 34 | { 35 | g_CriticalSection.Lock(); 36 | in = 0; 37 | out = 0; 38 | g_CriticalSection.Unlock(); 39 | } 40 | 41 | int CCircBufO::Put(long *buffer, int count) 42 | { 43 | g_CriticalSection.Lock(); 44 | 45 | // Check if there is sufficient room for the Put 46 | if (count > (CIRCBUFOSIZE - in + out - 1) % CIRCBUFOSIZE) { // There is a problem 47 | g_CriticalSection.Unlock(); 48 | if (count >= CIRCBUFOSIZE) 49 | return 2; 50 | else 51 | return 1; 52 | } 53 | 54 | // Move the data into the circular buffer 55 | for (int i = 0; i < count; i++) { 56 | iCBuffer[in++] = buffer[i]; 57 | in %= CIRCBUFOSIZE; 58 | } 59 | 60 | g_CriticalSection.Unlock(); 61 | return 0; 62 | } 63 | 64 | int CCircBufO::Get(long *buffer, int count) 65 | { 66 | int i; 67 | 68 | g_CriticalSection.Lock(); 69 | 70 | // Move the data from the circular buffer 71 | for (i = 0; i < count; i++) { 72 | if (in == out) 73 | break; 74 | buffer[i] = iCBuffer[out++]; 75 | out %= CIRCBUFOSIZE; 76 | } 77 | 78 | g_CriticalSection.Unlock(); 79 | return i; 80 | } 81 | -------------------------------------------------------------------------------- /SourceALE/AMDText.cpp: -------------------------------------------------------------------------------- 1 | // AMDText.cpp : implementation file 2 | // 13 Oct 1999 3 | 4 | #include "stdafx.h" 5 | #include "ALE.h" 6 | #include "ALEDoc.h" 7 | #include "AMDText.h" 8 | #include "ASCII_Set.h" 9 | 10 | #ifdef _DEBUG 11 | #define new DEBUG_NEW 12 | #undef THIS_FILE 13 | static char THIS_FILE[] = __FILE__; 14 | #endif 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // CAMDText dialog 18 | 19 | 20 | CAMDText::CAMDText(CWnd* pParent /*=NULL*/) 21 | : CDialog(CAMDText::IDD, pParent) 22 | { 23 | //{{AFX_DATA_INIT(CAMDText) 24 | // NOTE: the ClassWizard will add member initialization here 25 | //}}AFX_DATA_INIT 26 | } 27 | 28 | 29 | BEGIN_MESSAGE_MAP(CAMDText, CDialog) 30 | //{{AFX_MSG_MAP(CAMDText) 31 | //}}AFX_MSG_MAP 32 | END_MESSAGE_MAP() 33 | 34 | ///////////////////////////////////////////////////////////////////////////// 35 | // CAMDText message handlers 36 | 37 | BOOL CAMDText::OnInitDialog() 38 | { 39 | CDialog::OnInitDialog(); 40 | 41 | ctlText().SetLimitText(90); 42 | 43 | return TRUE; // return TRUE unless you set the focus to a control 44 | } 45 | 46 | void CAMDText::OnOK() 47 | { 48 | int i, len; 49 | CString strErr; 50 | 51 | ctlText().GetWindowText(strAMDText); 52 | // Must not be null 53 | len = strAMDText.GetLength(); 54 | if (len == 0) { 55 | MessageBox("Enter the text for the message (or press Cancel)."); 56 | ctlText().SetFocus(); 57 | return; 58 | } 59 | 60 | // All characters must be in the ASCII-64 character set 61 | for (i = 0; i < len; i++) 62 | if (ASCII_Set[strAMDText[i]] < ASCII_64) { 63 | strErr.Format("The character %c is not allowed in AMD messages.", strAMDText[i]); 64 | MessageBox(strErr); 65 | ctlText().SetFocus(); 66 | ctlText().SetSel(i, i + 1); 67 | return; 68 | } 69 | 70 | CDialog::OnOK(); 71 | } 72 | -------------------------------------------------------------------------------- /SourceALE/SelfAddrDlg.h: -------------------------------------------------------------------------------- 1 | // SelfAddrDlg.h : header file 2 | // 11 Dec 1998 3 | 4 | #if !defined(AFX_SELFADDRDLG_H__E7D694C1_807E_11D2_8F3A_0060089F9D1C__INCLUDED_) 5 | #define AFX_SELFADDRDLG_H__E7D694C1_807E_11D2_8F3A_0060089F9D1C__INCLUDED_ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | // CSelfAddrDlg dialog 13 | 14 | class CSelfAddrDlg : public CDialog 15 | { 16 | private: 17 | CEdit& ctlSelfAddr() {return *(CEdit *) GetDlgItem(IDC_EDIT1); } 18 | CEdit& ctlNetAddr() {return *(CEdit *) GetDlgItem(IDC_EDIT2); } 19 | CEdit& ctlSlotWait() {return *(CEdit *) GetDlgItem(IDC_EDIT3); } 20 | CListBox& ctlChannelList() {return *(CListBox *) GetDlgItem(IDC_LIST1); } 21 | 22 | // Construction 23 | public: 24 | CSelfAddrDlg(CWnd* pParent = NULL); // standard constructor 25 | 26 | struct CALEDoc::DATA *pData; 27 | BOOL bNew; // TRUE if this is a new record, FALSE to edit existing record 28 | int pos; // The position of the record to edit or where to add a new record 29 | 30 | // Dialog Data 31 | //{{AFX_DATA(CSelfAddrDlg) 32 | enum { IDD = IDD_SELFADDR }; 33 | // NOTE: the ClassWizard will add data members here 34 | //}}AFX_DATA 35 | 36 | 37 | // Overrides 38 | // ClassWizard generated virtual function overrides 39 | //{{AFX_VIRTUAL(CSelfAddrDlg) 40 | //}}AFX_VIRTUAL 41 | 42 | // Implementation 43 | protected: 44 | 45 | // Generated message map functions 46 | //{{AFX_MSG(CSelfAddrDlg) 47 | virtual BOOL OnInitDialog(); 48 | virtual void OnOK(); 49 | //}}AFX_MSG 50 | DECLARE_MESSAGE_MAP() 51 | }; 52 | 53 | //{{AFX_INSERT_LOCATION}} 54 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 55 | 56 | #endif // !defined(AFX_SELFADDRDLG_H__E7D694C1_807E_11D2_8F3A_0060089F9D1C__INCLUDED_) 57 | -------------------------------------------------------------------------------- /SourceALE/CircBufI.cpp: -------------------------------------------------------------------------------- 1 | // CircBuf.cpp: implementation of the CCircBufI class. 2 | // 10 Mar 99 3 | 4 | 5 | #include "stdafx.h" 6 | #include 7 | #include "CircBuf.h" 8 | 9 | #ifdef _DEBUG 10 | #undef THIS_FILE 11 | static char THIS_FILE[]=__FILE__; 12 | #define new DEBUG_NEW 13 | #endif 14 | 15 | ////////////////////////////////////////////////////////////////////// 16 | // Construction/Destruction 17 | ////////////////////////////////////////////////////////////////////// 18 | 19 | CCircBufI::CCircBufI() 20 | { 21 | in = 0; 22 | out = 0; 23 | } 24 | 25 | CCircBufI::~CCircBufI() 26 | { 27 | 28 | } 29 | 30 | ////////////////////////////////////////////////////////////////////// 31 | // Member Functions 32 | 33 | void CCircBufI::Reset() 34 | { 35 | g_CriticalSection.Lock(); 36 | in = 0; 37 | out = 0; 38 | g_CriticalSection.Unlock(); 39 | } 40 | 41 | int CCircBufI::Put(CIRCBUFINDATA *buffer, int count) 42 | { 43 | g_CriticalSection.Lock(); 44 | 45 | // Check if there is sufficient room for the Put 46 | if (count > (CIRCBUFISIZE - in + out - 1) % CIRCBUFISIZE) { // There is a problem 47 | g_CriticalSection.Unlock(); 48 | if (count >= CIRCBUFISIZE) 49 | return 2; 50 | else 51 | return 1; 52 | } 53 | 54 | // Move the data into the circular buffer 55 | for (int i = 0; i < count; i++) { 56 | strCBuffer[in++] = buffer[i]; 57 | in %= CIRCBUFISIZE; 58 | } 59 | 60 | g_CriticalSection.Unlock(); 61 | return 0; 62 | } 63 | 64 | int CCircBufI::Get(CIRCBUFINDATA *buffer, int count) 65 | { 66 | int i; 67 | 68 | g_CriticalSection.Lock(); 69 | 70 | // Move the data from the circular buffer 71 | for (i = 0; i < count; i++) { 72 | if (in == out) 73 | break; 74 | buffer[i] = strCBuffer[out++]; 75 | out %= CIRCBUFISIZE; 76 | } 77 | 78 | g_CriticalSection.Unlock(); 79 | return i; 80 | } 81 | -------------------------------------------------------------------------------- /SourceALE/ChannelList.h: -------------------------------------------------------------------------------- 1 | // ChannelList.h : header file 2 | // 30 Mar 1998 3 | 4 | #if !defined(AFX_CHANNELLIST_H__A3C17B64_3849_11D2_8F39_0060089F9D1C__INCLUDED_) 5 | #define AFX_CHANNELLIST_H__A3C17B64_3849_11D2_8F39_0060089F9D1C__INCLUDED_ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | // CChannelList dialog 13 | 14 | class CChannelList : public CDialog 15 | { 16 | private: 17 | CListCtrl& ctlList () { return *(CListCtrl*) GetDlgItem(IDC_LIST1); } 18 | CButton& ctlEdit () { return *(CButton*) GetDlgItem(IDC_EDIT_CHAN); } 19 | CButton& ctlAdd () { return *(CButton*) GetDlgItem(IDC_ADD_CHAN); } 20 | CButton& ctlDelete () { return *(CButton*) GetDlgItem(IDC_DELETE_CHAN); } 21 | CBitmapButton m_ctlMoveUp; 22 | CBitmapButton m_ctlMoveDown; 23 | 24 | void DispChannelList(); 25 | 26 | // Construction 27 | public: 28 | CChannelList(CWnd* pParent = NULL); // standard constructor 29 | 30 | struct CALEDoc::DATA *pData; 31 | 32 | // Dialog Data 33 | //{{AFX_DATA(CChannelList) 34 | enum { IDD = IDD_CHANNEL_LIST }; 35 | // NOTE: the ClassWizard will add members here 36 | //}}AFX_DATA 37 | 38 | 39 | // Overrides 40 | // ClassWizard generated virtual function overrides 41 | //{{AFX_VIRTUAL(CChannelList) 42 | //}}AFX_VIRTUAL 43 | 44 | // Implementation 45 | protected: 46 | 47 | // Generated message map functions 48 | //{{AFX_MSG(CChannelList) 49 | virtual BOOL OnInitDialog(); 50 | afx_msg void OnDeleteChan(); 51 | afx_msg void OnAddChan(); 52 | afx_msg void OnEditChan(); 53 | afx_msg void OnMoveUp(); 54 | afx_msg void OnMoveDown(); 55 | //}}AFX_MSG 56 | DECLARE_MESSAGE_MAP() 57 | }; 58 | 59 | //{{AFX_INSERT_LOCATION}} 60 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 61 | 62 | #endif // !defined(AFX_CHANNELLIST_H__A3C17B64_3849_11D2_8F39_0060089F9D1C__INCLUDED_) 63 | -------------------------------------------------------------------------------- /SourceCal/CalibrateView.h: -------------------------------------------------------------------------------- 1 | // CalibrateView.h : interface of the CCalibrateView class 2 | // 3 | ///////////////////////////////////////////////////////////////////////////// 4 | 5 | #include "CalDlg.h" 6 | 7 | #if !defined(AFX_CALIBRATEVIEW_H__DF63468D_AD5F_11D3_B8DB_0080C84B206B__INCLUDED_) 8 | #define AFX_CALIBRATEVIEW_H__DF63468D_AD5F_11D3_B8DB_0080C84B206B__INCLUDED_ 9 | 10 | #if _MSC_VER > 1000 11 | #pragma once 12 | #endif // _MSC_VER > 1000 13 | 14 | class CCalibrateView : public CView 15 | { 16 | protected: // create from serialization only 17 | CCalibrateView(); 18 | DECLARE_DYNCREATE(CCalibrateView) 19 | 20 | // Attributes 21 | public: 22 | CCalibrateDoc* GetDocument(); 23 | CCalDlg *pCalDlg; 24 | 25 | // Operations 26 | public: 27 | 28 | // Overrides 29 | // ClassWizard generated virtual function overrides 30 | //{{AFX_VIRTUAL(CCalibrateView) 31 | public: 32 | virtual void OnDraw(CDC* pDC); // overridden to draw this view 33 | virtual BOOL PreCreateWindow(CREATESTRUCT& cs); 34 | protected: 35 | virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint); 36 | //}}AFX_VIRTUAL 37 | 38 | // Implementation 39 | public: 40 | virtual ~CCalibrateView(); 41 | #ifdef _DEBUG 42 | virtual void AssertValid() const; 43 | virtual void Dump(CDumpContext& dc) const; 44 | #endif 45 | 46 | protected: 47 | 48 | // Generated message map functions 49 | protected: 50 | //{{AFX_MSG(CCalibrateView) 51 | afx_msg void OnCalibrateGo(); 52 | //}}AFX_MSG 53 | DECLARE_MESSAGE_MAP() 54 | }; 55 | 56 | #ifndef _DEBUG // debug version in CalibrateView.cpp 57 | inline CCalibrateDoc* CCalibrateView::GetDocument() 58 | { return (CCalibrateDoc*)m_pDocument; } 59 | #endif 60 | 61 | ///////////////////////////////////////////////////////////////////////////// 62 | 63 | //{{AFX_INSERT_LOCATION}} 64 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 65 | 66 | #endif // !defined(AFX_CALIBRATEVIEW_H__DF63468D_AD5F_11D3_B8DB_0080C84B206B__INCLUDED_) 67 | -------------------------------------------------------------------------------- /SourceALE/OtherAddrList.h: -------------------------------------------------------------------------------- 1 | // OtherAddrList.h : header file 2 | // 4 Jan 1999 3 | 4 | #if !defined(AFX_OTHERADDRLIST_H__AB71A3A1_A3C2_11D2_8F3A_0060089F9D1C__INCLUDED_) 5 | #define AFX_OTHERADDRLIST_H__AB71A3A1_A3C2_11D2_8F3A_0060089F9D1C__INCLUDED_ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // COtherAddrList dialog 12 | 13 | class COtherAddrList : public CDialog 14 | { 15 | CListCtrl& ctlList () { return *(CListCtrl*) GetDlgItem(IDC_LIST1); } 16 | CButton& ctlEdit () { return *(CButton*) GetDlgItem(IDC_EDIT_SADDR); } 17 | CButton& ctlAdd () { return *(CButton*) GetDlgItem(IDC_ADD_SADDR); } 18 | CButton& ctlDelete () { return *(CButton*) GetDlgItem(IDC_DELETE_SADDR); } 19 | CBitmapButton m_ctlMoveUp; 20 | CBitmapButton m_ctlMoveDown; 21 | 22 | void AddOtherAddrList(int); 23 | void DispOtherAddrList(); 24 | 25 | // Construction 26 | public: 27 | COtherAddrList(CWnd* pParent = NULL); // standard constructor 28 | 29 | struct CALEDoc::DATA *pData; 30 | 31 | // Dialog Data 32 | //{{AFX_DATA(COtherAddrList) 33 | enum { IDD = IDD_OTHADDR_LIST }; 34 | // NOTE: the ClassWizard will add data members here 35 | //}}AFX_DATA 36 | 37 | 38 | // Overrides 39 | // ClassWizard generated virtual function overrides 40 | //{{AFX_VIRTUAL(COtherAddrList) 41 | //}}AFX_VIRTUAL 42 | 43 | // Implementation 44 | protected: 45 | 46 | // Generated message map functions 47 | //{{AFX_MSG(COtherAddrList) 48 | virtual BOOL OnInitDialog(); 49 | afx_msg void OnMovedown(); 50 | afx_msg void OnMoveup(); 51 | afx_msg void OnAddOaddr(); 52 | afx_msg void OnDeleteOaddr(); 53 | afx_msg void OnEditOaddr(); 54 | //}}AFX_MSG 55 | DECLARE_MESSAGE_MAP() 56 | }; 57 | 58 | //{{AFX_INSERT_LOCATION}} 59 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 60 | 61 | #endif // !defined(AFX_OTHERADDRLIST_H__AB71A3A1_A3C2_11D2_8F3A_0060089F9D1C__INCLUDED_) 62 | -------------------------------------------------------------------------------- /SourceALE/SelfAddrList.h: -------------------------------------------------------------------------------- 1 | // SelfAddrList.h : header file 2 | // 20 Nov 1998 3 | 4 | #if !defined(AFX_SELFADDRLIST_H__602ADF42_7FBB_11D2_8F3A_0060089F9D1C__INCLUDED_) 5 | #define AFX_SELFADDRLIST_H__602ADF42_7FBB_11D2_8F3A_0060089F9D1C__INCLUDED_ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | // CSelfAddrList dialog 13 | 14 | class CSelfAddrList : public CDialog 15 | { 16 | private: 17 | CListCtrl& ctlList () { return *(CListCtrl*) GetDlgItem(IDC_LIST1); } 18 | // CButton& ctlEdit () { return *(CButton*) GetDlgItem(IDC_EDIT_SADDR); } 19 | // CButton& ctlAdd () { return *(CButton*) GetDlgItem(IDC_ADD_SADDR); } 20 | // CButton& ctlDelete () { return *(CButton*) GetDlgItem(IDC_DELETE_SADDR); } 21 | CBitmapButton m_ctlMoveUp; 22 | CBitmapButton m_ctlMoveDown; 23 | 24 | void AddAddrList(int); 25 | void DispSelfAddrList(); 26 | 27 | // Construction 28 | public: 29 | CSelfAddrList(CWnd* pParent = NULL); // standard constructor 30 | 31 | struct CALEDoc::DATA *pData; 32 | 33 | // Dialog Data 34 | //{{AFX_DATA(CSelfAddrList) 35 | enum { IDD = IDD_SELFADDR_LIST }; 36 | // NOTE: the ClassWizard will add data members here 37 | //}}AFX_DATA 38 | 39 | 40 | // Overrides 41 | // ClassWizard generated virtual function overrides 42 | //{{AFX_VIRTUAL(CSelfAddrList) 43 | //}}AFX_VIRTUAL 44 | 45 | // Implementation 46 | protected: 47 | 48 | // Generated message map functions 49 | //{{AFX_MSG(CSelfAddrList) 50 | virtual BOOL OnInitDialog(); 51 | afx_msg void OnMovedown(); 52 | afx_msg void OnMoveup(); 53 | afx_msg void OnAddSaddr(); 54 | afx_msg void OnDeleteSaddr(); 55 | afx_msg void OnEditSaddr(); 56 | //}}AFX_MSG 57 | DECLARE_MESSAGE_MAP() 58 | }; 59 | 60 | //{{AFX_INSERT_LOCATION}} 61 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 62 | 63 | #endif // !defined(AFX_SELFADDRLIST_H__602ADF42_7FBB_11D2_8F3A_0060089F9D1C__INCLUDED_) 64 | -------------------------------------------------------------------------------- /SourceALE/OtherAddrDlg.h: -------------------------------------------------------------------------------- 1 | // OtherAddrDlg.h : header file 2 | // 4 Jan 1999 3 | 4 | #if !defined(AFX_OTHERADDRDLG_H__AB71A3A2_A3C2_11D2_8F3A_0060089F9D1C__INCLUDED_) 5 | #define AFX_OTHERADDRDLG_H__AB71A3A2_A3C2_11D2_8F3A_0060089F9D1C__INCLUDED_ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // COtherAddrDlg dialog 12 | 13 | class COtherAddrDlg : public CDialog 14 | { 15 | private: 16 | CEdit& ctlOtherAddr() {return *(CEdit *) GetDlgItem(IDC_EDIT1); } 17 | CEdit& ctlReplyWait() {return *(CEdit *) GetDlgItem(IDC_EDIT3); } 18 | CListBox& ctlSlotList() {return *(CListBox *) GetDlgItem(IDC_LIST2); } 19 | CListBox& ctlChannelList() {return *(CListBox *) GetDlgItem(IDC_LIST1); } 20 | CButton& ctlEditSlots () { return *(CButton*) GetDlgItem(IDC_BUTTON1); } 21 | 22 | // Construction 23 | public: 24 | COtherAddrDlg(CWnd* pParent = NULL); // standard constructor 25 | 26 | struct CALEDoc::DATA *pData; 27 | BOOL bNew; // TRUE if this is a new record, FALSE to edit existing record 28 | int pos; // The position of the record to edit or where to add a new record 29 | 30 | CStringArray LocalSlotStrings; 31 | 32 | // Dialog Data 33 | //{{AFX_DATA(COtherAddrDlg) 34 | enum { IDD = IDD_OTHADDR }; 35 | // NOTE: the ClassWizard will add data members here 36 | //}}AFX_DATA 37 | 38 | 39 | // Overrides 40 | // ClassWizard generated virtual function overrides 41 | //{{AFX_VIRTUAL(COtherAddrDlg) 42 | //}}AFX_VIRTUAL 43 | 44 | // Implementation 45 | protected: 46 | 47 | // Generated message map functions 48 | //{{AFX_MSG(COtherAddrDlg) 49 | virtual BOOL OnInitDialog(); 50 | virtual void OnOK(); 51 | afx_msg void OnEditSlots(); 52 | //}}AFX_MSG 53 | DECLARE_MESSAGE_MAP() 54 | }; 55 | 56 | //{{AFX_INSERT_LOCATION}} 57 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 58 | 59 | #endif // !defined(AFX_OTHERADDRDLG_H__AB71A3A2_A3C2_11D2_8F3A_0060089F9D1C__INCLUDED_) 60 | -------------------------------------------------------------------------------- /SourceALE/ChannelDlg.h: -------------------------------------------------------------------------------- 1 | // ChannelDlg.h : header file 2 | // 17 Nov 1998 3 | #if !defined(AFX_CHANNELDLG_H__22A4BD01_7AFA_11D2_8F3A_0060089F9D1C__INCLUDED_) 4 | #define AFX_CHANNELDLG_H__22A4BD01_7AFA_11D2_8F3A_0060089F9D1C__INCLUDED_ 5 | 6 | #if _MSC_VER > 1000 7 | #pragma once 8 | #endif // _MSC_VER > 1000 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // CChannelDlg dialog 12 | 13 | class CChannelDlg : public CDialog 14 | { 15 | private: 16 | CEdit& ctlTxFreq() {return *(CEdit *) GetDlgItem(IDC_EDIT1); } 17 | CComboBox& ctlComboTxMode() {return *(CComboBox *) GetDlgItem(IDC_COMBO1); } 18 | CEdit& ctlRxFreq() {return *(CEdit *) GetDlgItem(IDC_EDIT2); } 19 | CComboBox& ctlComboRxMode() {return *(CComboBox *) GetDlgItem(IDC_COMBO2); } 20 | CComboBox& ctlComboTRMode() {return *(CComboBox *) GetDlgItem(IDC_COMBO3); } 21 | CComboBox& ctlComboScanMode() {return *(CComboBox *) GetDlgItem(IDC_COMBO4); } 22 | CEdit& ctlSoundInt() {return *(CEdit *) GetDlgItem(IDC_EDIT3); } 23 | 24 | // Construction 25 | public: 26 | CChannelDlg(CWnd* pParent = NULL); // standard constructor 27 | 28 | struct CALEDoc::DATA *pData; 29 | BOOL bNew; // TRUE if this is a new record, FALSE to edit existing record 30 | int pos; // The position of the record to edit or where to add a new record 31 | 32 | // Dialog Data 33 | //{{AFX_DATA(CChannelDlg) 34 | enum { IDD = IDD_CHANNEL }; 35 | //}}AFX_DATA 36 | 37 | 38 | // Overrides 39 | // ClassWizard generated virtual function overrides 40 | //{{AFX_VIRTUAL(CChannelDlg) 41 | //}}AFX_VIRTUAL 42 | 43 | // Implementation 44 | protected: 45 | 46 | // Generated message map functions 47 | //{{AFX_MSG(CChannelDlg) 48 | virtual BOOL OnInitDialog(); 49 | virtual void OnOK(); 50 | //}}AFX_MSG 51 | DECLARE_MESSAGE_MAP() 52 | }; 53 | 54 | //{{AFX_INSERT_LOCATION}} 55 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 56 | 57 | #endif // !defined(AFX_CHANNELDLG_H__22A4BD01_7AFA_11D2_8F3A_0060089F9D1C__INCLUDED_) 58 | -------------------------------------------------------------------------------- /SourceALE/SelectRxChannel.h: -------------------------------------------------------------------------------- 1 | // SelectRxChannel.h : header file 2 | // 3 Nov 1999 3 | 4 | #if !defined(AFX_SELECTRXCHANNEL_H__A544D901_2407_11D3_8F3A_0060089F9D1C__INCLUDED_) 5 | #define AFX_SELECTRXCHANNEL_H__A544D901_2407_11D3_8F3A_0060089F9D1C__INCLUDED_ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | // CSelectRxChannel dialog 13 | 14 | class CSelectRxChannel : public CDialog 15 | { 16 | private: 17 | CListCtrl& ctlList() { return *(CListCtrl*) GetDlgItem(IDC_LIST1); } 18 | 19 | // Construction 20 | public: 21 | CSelectRxChannel(CWnd* pParent = NULL); // standard constructor 22 | 23 | struct CALEDoc::DATA *pData; 24 | int iSelfAddrMode; // There are 3 cases when this dialog is called 25 | // iSelfAddrMode = 0 when all channels are displayed 26 | // iSelfAddrMode = 1 when only the channels associated 27 | // with iSelfAddr are displayed 28 | // iSelfAddrMode = 2 when only the common channels 29 | // associated with both iSelfAddr and iOtherAddr are displayed 30 | int iSelfAddr; 31 | int iOtherAddr; 32 | int iChanNum; 33 | 34 | // Dialog Data 35 | //{{AFX_DATA(CSelectRxChannel) 36 | enum { IDD = IDD_RXCHANNEL }; 37 | // NOTE: the ClassWizard will add data members here 38 | //}}AFX_DATA 39 | 40 | 41 | // Overrides 42 | // ClassWizard generated virtual function overrides 43 | //{{AFX_VIRTUAL(CSelectRxChannel) 44 | //}}AFX_VIRTUAL 45 | 46 | // Implementation 47 | protected: 48 | 49 | // Generated message map functions 50 | //{{AFX_MSG(CSelectRxChannel) 51 | virtual BOOL OnInitDialog(); 52 | virtual void OnOK(); 53 | //}}AFX_MSG 54 | DECLARE_MESSAGE_MAP() 55 | }; 56 | 57 | //{{AFX_INSERT_LOCATION}} 58 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 59 | 60 | #endif // !defined(AFX_SELECTRXCHANNEL_H__A544D901_2407_11D3_8F3A_0060089F9D1C__INCLUDED_) 61 | -------------------------------------------------------------------------------- /SourceCal/CalibrateDoc.cpp: -------------------------------------------------------------------------------- 1 | // CalibrateDoc.cpp : implementation of the CCalibrateDoc class 2 | // 3 | 4 | #include "stdafx.h" 5 | 6 | #include "Calibrate.h" 7 | #include "CalibrateDoc.h" 8 | 9 | 10 | 11 | #ifdef _DEBUG 12 | #define new DEBUG_NEW 13 | #undef THIS_FILE 14 | static char THIS_FILE[] = __FILE__; 15 | #endif 16 | 17 | ///////////////////////////////////////////////////////////////////////////// 18 | // CCalibrateDoc 19 | 20 | IMPLEMENT_DYNCREATE(CCalibrateDoc, CDocument) 21 | 22 | BEGIN_MESSAGE_MAP(CCalibrateDoc, CDocument) 23 | //{{AFX_MSG_MAP(CCalibrateDoc) 24 | // NOTE - the ClassWizard will add and remove mapping macros here. 25 | // DO NOT EDIT what you see in these blocks of generated code! 26 | //}}AFX_MSG_MAP 27 | END_MESSAGE_MAP() 28 | 29 | ///////////////////////////////////////////////////////////////////////////// 30 | // CCalibrateDoc construction/destruction 31 | 32 | CCalibrateDoc::CCalibrateDoc() 33 | { 34 | // TODO: add one-time construction code here 35 | 36 | } 37 | 38 | CCalibrateDoc::~CCalibrateDoc() 39 | { 40 | } 41 | 42 | BOOL CCalibrateDoc::OnNewDocument() 43 | { 44 | if (!CDocument::OnNewDocument()) 45 | return FALSE; 46 | 47 | // TODO: add reinitialization code here 48 | // (SDI documents will reuse this document) 49 | 50 | return TRUE; 51 | } 52 | 53 | 54 | 55 | ///////////////////////////////////////////////////////////////////////////// 56 | // CCalibrateDoc serialization 57 | 58 | void CCalibrateDoc::Serialize(CArchive& ar) 59 | { 60 | if (ar.IsStoring()) 61 | { 62 | // TODO: add storing code here 63 | } 64 | else 65 | { 66 | // TODO: add loading code here 67 | } 68 | } 69 | 70 | ///////////////////////////////////////////////////////////////////////////// 71 | // CCalibrateDoc diagnostics 72 | 73 | #ifdef _DEBUG 74 | void CCalibrateDoc::AssertValid() const 75 | { 76 | CDocument::AssertValid(); 77 | } 78 | 79 | void CCalibrateDoc::Dump(CDumpContext& dc) const 80 | { 81 | CDocument::Dump(dc); 82 | } 83 | #endif //_DEBUG 84 | 85 | ///////////////////////////////////////////////////////////////////////////// 86 | // CCalibrateDoc commands 87 | void CCalibrateDoc::DataAvail() { 88 | UpdateAllViews(NULL, 1L, NULL); 89 | } 90 | 91 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This is the distribution for the ALE Lite program. Please 2 | note the following disclaimer: 3 | 4 | The software contained within was developed by an agency of the 5 | U.S. Government. NTIA/ITS has no objection to the use of this 6 | software for any purpose since it is not subject to copyright 7 | protection in the U.S. 8 | 9 | No warranty, expressed or implied, is made by NTIA/ITS or the U. S. 10 | Government as to the accuracy, suitability and functioning of the 11 | program and related material, nor shall the fact of distribution 12 | constitute any endorsement by the U.S. Government. 13 | 14 | The basic distribution consists of the executable for the ALE Lite 15 | program and for a Calibration program that is needed before running 16 | ALE Lite. A help file is also included. All of these files are in the 17 | Executable subdirectory. 18 | 19 | The help file, ALE_Help.chm, should be executed (by double clicking 20 | on it) to get the installation instructions. 21 | 22 | For those who are interested the source code for the program is 23 | included. There is a separate source directory for the ALE Lite program, 24 | the Calibration program, and for the help file. The Doc subdirectory 25 | has a documentation file, SWManual.doc, that is intended for 26 | programmers and is in Microsoft Word format. 27 | 28 | Please note that this is a first version of this software. It is not intended 29 | to be a polished, finished product. We have had good luck using it 30 | in a laboratory environment, and we hope others will get some good 31 | value from using it. The program has not been tested widely in 32 | real environments and may contain problems. At this time we do 33 | not anticipate devoting any further resources toward the further 34 | development of this program, but perhaps others with interest may 35 | want to continue development with the supplied source code. 36 | 37 | The equipment that the software has been tested on consists of 38 | 200 MHz Pentium Pro PCs with 64 Mb of RAM, Creative Ensoniq 39 | AudioPCI sounds, DirectX 7, ICOM transceivers (IC-726 and IC-781) and 40 | the Windows 98 SE operating system. 41 | -------------------------------------------------------------------------------- /SourceALE/hlp/ALE.hm: -------------------------------------------------------------------------------- 1 | 2 | // Commands (ID_* and IDM_*) 3 | HID_STATUS1 0x10066 4 | HID_EDIT_CHANNEL 0x18003 5 | HID_EDIT_SELFADDR 0x18004 6 | HID_EDIT_OTHERADDR 0x18005 7 | HID_TRANSMIT_START 0x18006 8 | HID_RECEIVE_STARTRECEIVING 0x18007 9 | HID_INDIVIDUALCALL 0x18008 10 | HID_NETWORKCALL 0x18009 11 | HID_SOUNDING_START 0x1800A 12 | HIDM_THISIS 0x1800B 13 | HIDM_THISWAS 0x1800C 14 | HID_VIEW_SIGNALQUALITY 0x1800D 15 | HID_STARTSCANNING 0x1800E 16 | HID_RX_SCANNING 0x1800E 17 | HID_RX_OFF 0x1800F 18 | HID_RX_SINGCHAN 0x18010 19 | HID_EDIT_CONFIG 0x18011 20 | HID_ALLCALL 0x18012 21 | HID_AMDMESSAGE 0x18013 22 | HID_VIEW_AMD 0x18014 23 | HID_DEBUG_MODE 0x18015 24 | 25 | // Prompts (IDP_*) 26 | 27 | // Resources (IDR_*) 28 | HIDR_MAINFRAME 0x20080 29 | HIDR_ALETYPE 0x20081 30 | 31 | // Dialogs (IDD_*) 32 | HIDD_ABOUTBOX 0x20064 33 | HIDD_SELFADDR 0x20082 34 | HIDD_CHANNEL 0x20083 35 | HIDD_CHANNEL_LIST 0x20085 36 | HIDD_SELFADDR_LIST 0x20086 37 | HIDD_OTHADDR_LIST 0x20087 38 | HIDD_OTHADDR 0x20088 39 | HIDD_SLOT_LIST 0x20089 40 | HIDD_SLOTADDR 0x2008A 41 | HIDD_SELINDIV 0x2008B 42 | HIDD_SOUNDADDRS 0x2008C 43 | HIDD_SIGNALQUALITY 0x2008D 44 | HIDD_RXCHANNEL 0x2008E 45 | HIDD_CONFIG 0x2008F 46 | HIDD_SELSELFADDR 0x20090 47 | HIDD_AMD 0x20091 48 | HIDD_AMDMESSAGE 0x20092 49 | 50 | // Frame Controls (IDW_*) 51 | -------------------------------------------------------------------------------- /SourceALE/Dlgfloat.cpp: -------------------------------------------------------------------------------- 1 | // DlgFloat.cpp 2 | // 30 Jun 1999 3 | 4 | // This is derived from the Microsoft Foundation Classes C++ library. 5 | 6 | #include "stdafx.h" 7 | #include // floating point precision 8 | 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // Extra data validation procs for float/double support 12 | // see "dlgdata.cpp" for non-floating point support 13 | ///////////////////////////////////////////////////////////////////////////// 14 | 15 | AFX_STATIC BOOL AFXAPI _AfxSimpleFloatParse(LPCTSTR lpszText, double& d) 16 | { 17 | ASSERT(lpszText != NULL); 18 | while (*lpszText == ' ' || *lpszText == '\t') 19 | lpszText++; 20 | 21 | TCHAR chFirst = lpszText[0]; 22 | d = _tcstod(lpszText, (LPTSTR*)&lpszText); 23 | if (d == 0.0 && chFirst != '0') 24 | return FALSE; // could not convert 25 | while (*lpszText == ' ' || *lpszText == '\t') 26 | lpszText++; 27 | 28 | if (*lpszText != '\0') 29 | return FALSE; // not terminated properly 30 | 31 | return TRUE; 32 | } 33 | 34 | // Here is a similar version for longs 35 | AFX_STATIC BOOL AFXAPI _AfxSimpleLongParse(LPCTSTR lpszText, long& lo) 36 | { 37 | ASSERT(lpszText != NULL); 38 | while (*lpszText == ' ' || *lpszText == '\t') 39 | lpszText++; 40 | 41 | TCHAR chFirst = lpszText[0]; 42 | lo = _tcstol(lpszText, (LPTSTR*)&lpszText, 10); 43 | if (lo == 0 && chFirst != '0') 44 | return FALSE; // could not convert 45 | while (*lpszText == ' ' || *lpszText == '\t') 46 | lpszText++; 47 | 48 | if (*lpszText != '\0') 49 | return FALSE; // not terminated properly 50 | 51 | return TRUE; 52 | } 53 | 54 | // This is for hexadecimal numbers 55 | BOOL SimpleHexParse(LPCTSTR lpszText, long& lo) 56 | { 57 | ASSERT(lpszText != NULL); 58 | while (*lpszText == ' ' || *lpszText == '\t') 59 | lpszText++; 60 | 61 | TCHAR chFirst = lpszText[0]; 62 | lo = _tcstol(lpszText, (LPTSTR*)&lpszText, 16); 63 | if (lo == 0 && chFirst != '0') 64 | return FALSE; // could not convert 65 | while (*lpszText == ' ' || *lpszText == '\t') 66 | lpszText++; 67 | 68 | if (*lpszText != '\0') 69 | return FALSE; // not terminated properly 70 | 71 | return TRUE; 72 | } 73 | 74 | ///////////////////////////////////////////////////////////////////////////// 75 | -------------------------------------------------------------------------------- /SourceCal/HDAudio.h: -------------------------------------------------------------------------------- 1 | // HDAudio.h: interface for the HDAudio class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_HDAUDIO_H__D85F9E8C_788E_11D2_90C8_00609710F7FB__INCLUDED_) 6 | #define AFX_HDAUDIO_H__D85F9E8C_788E_11D2_90C8_00609710F7FB__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | // Defines for HDAudio::InitNotify 13 | #define INPUTBUFFER 1 14 | #define OUTPUTBUFFER 2 15 | 16 | // Number of Event Notifiations 17 | #define NUMBEVENTS 3 18 | 19 | // Setup Globals for HDAudio demod 20 | #define SAMPLEFREQ 22050L 21 | #define BITSPERSAMPLE 16 22 | #define NUMBCHANNELS 1 23 | // Index 24 | #define FSK_1 750 // 0 25 | #define FSK_2 1000 // 1 26 | #define FSK_3 1500 // 2 27 | #define FSK_4 1250 // 3 28 | #define FSK_5 2500 // 4 29 | #define FSK_6 2250 // 5 30 | #define FSK_7 1750 // 6 31 | #define FSK_8 2000 // 7 32 | 33 | #define NUMBFSK 8 34 | 35 | // Samples per 4 mS Block 36 | #define GOERTZBLK (short)(0.004*SAMPLEFREQ) 37 | // NUMBGBLK * GOERTZBLK/22050 = second data at f_s = 22050 38 | #define NUMBGBLK (short)(SAMPLEFREQ/GOERTZBLK) 39 | 40 | struct strReturnVal { 41 | double dDC; 42 | double dPwr; 43 | }; 44 | 45 | class HDAudio 46 | { 47 | public: 48 | // Constructor and Distructor 49 | HDAudio(); 50 | virtual ~HDAudio(); 51 | // Member Functions 52 | BOOL InitDSound(CWnd *pWnd); 53 | BOOL StopOutputBuffer( ); 54 | BOOL InitNotify( ); 55 | BOOL ProcessOutputBuffer( DWORD iEvent ); 56 | BOOL ProcessInputBuffer( DWORD iEvent ); 57 | BOOL InitializeBuffer( DWORD dwStart, DWORD cblength ); 58 | BOOL Start( ); 59 | BOOL Stop( ); 60 | void Release( ); 61 | private: 62 | void Error( HRESULT hr ); 63 | // Demodulate is used only in ProcessOutputBuffer 64 | BOOL Calibration( LPBYTE pbSource, DWORD cbLength ); 65 | }; 66 | 67 | 68 | 69 | #endif // !defined(AFX_HDAUDIO_H__D85F9E8C_788E_11D2_90C8_00609710F7FB__INCLUDED_) 70 | -------------------------------------------------------------------------------- /SourceCal/CalDlg.h: -------------------------------------------------------------------------------- 1 | // CalDlg.h : header file 2 | // 3 | 4 | #if !defined(AFX_CALDLG_H__DF634695_AD5F_11D3_B8DB_0080C84B206B__INCLUDED_) 5 | #define AFX_CALDLG_H__DF634695_AD5F_11D3_B8DB_0080C84B206B__INCLUDED_ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | class CCalibrateView; 12 | 13 | typedef struct tagRXTHREADPARMS { 14 | // Add any parameters to be passed to the thread 15 | CWnd *pWnd; 16 | BOOL bContinue; 17 | double value; // This is the value passed from the thread back 18 | } RXTHREADPARMS; 19 | 20 | ///////////////////////////////////////////////////////////////////////////// 21 | // CCalDlg dialog 22 | 23 | class CCalDlg : public CDialog 24 | { 25 | private: 26 | CStatic& ctlText0() {return *(CStatic *) GetDlgItem(IDC_STATIC0); } 27 | CStatic& ctlText3() {return *(CStatic *) GetDlgItem(IDC_STATIC3); } 28 | CStatic& ctlText5() {return *(CStatic *) GetDlgItem(IDC_STATIC5); } 29 | CStatic& ctlText1() {return *(CStatic *) GetDlgItem(IDC_STATIC1); } 30 | CStatic& ctlText4() {return *(CStatic *) GetDlgItem(IDC_STATIC4); } 31 | CButton& ctlButton1() {return *(CButton *) GetDlgItem(IDC_BUTTON1); } 32 | CButton& ctlButton2() {return *(CButton *) GetDlgItem(IDC_BUTTON2); } 33 | double dSigInPwr, dNoise; 34 | // Construction 35 | public: 36 | CCalDlg(CWnd* pParent = NULL); // standard constructor 37 | void UpdateValue(); 38 | 39 | // Dialog Data 40 | private: 41 | CWinThread* pRxThread; 42 | 43 | public: 44 | CCalibrateView* view; 45 | RXTHREADPARMS rxthreadParms; 46 | 47 | //{{AFX_DATA(CCalDlg) 48 | enum { IDD = IDD_DIALOG1 }; 49 | // NOTE: the ClassWizard will add data members here 50 | //}}AFX_DATA 51 | 52 | 53 | // Overrides 54 | // ClassWizard generated virtual function overrides 55 | //{{AFX_VIRTUAL(CCalDlg) 56 | protected: 57 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 58 | virtual void PostNcDestroy(); 59 | //}}AFX_VIRTUAL 60 | 61 | // Implementation 62 | protected: 63 | 64 | // Generated message map functions 65 | //{{AFX_MSG(CCalDlg) 66 | afx_msg void OnButton1(); 67 | virtual BOOL OnInitDialog(); 68 | virtual void OnCancel(); 69 | //}}AFX_MSG 70 | DECLARE_MESSAGE_MAP() 71 | }; 72 | 73 | //{{AFX_INSERT_LOCATION}} 74 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 75 | 76 | #endif // !defined(AFX_CALDLG_H__DF634695_AD5F_11D3_B8DB_0080C84B206B__INCLUDED_) 77 | -------------------------------------------------------------------------------- /SourceALE/SelectSelfAddr.cpp: -------------------------------------------------------------------------------- 1 | // SelectSelfAddr.cpp : implementation file 2 | // 3 Nov 99 3 | 4 | #include "stdafx.h" 5 | #include "ALE.h" 6 | #include "ALEDoc.h" 7 | #include "SelectRxChannel.h" 8 | #include "SelectSelfAddr.h" 9 | 10 | #ifdef _DEBUG 11 | #define new DEBUG_NEW 12 | #undef THIS_FILE 13 | static char THIS_FILE[] = __FILE__; 14 | #endif 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // CSelectSelfAddr dialog 18 | 19 | 20 | CSelectSelfAddr::CSelectSelfAddr(CWnd* pParent /*=NULL*/) 21 | : CDialog(CSelectSelfAddr::IDD, pParent) 22 | { 23 | //{{AFX_DATA_INIT(CSelectSelfAddr) 24 | // NOTE: the ClassWizard will add member initialization here 25 | //}}AFX_DATA_INIT 26 | } 27 | 28 | 29 | BEGIN_MESSAGE_MAP(CSelectSelfAddr, CDialog) 30 | //{{AFX_MSG_MAP(CSelectSelfAddr) 31 | //}}AFX_MSG_MAP 32 | END_MESSAGE_MAP() 33 | 34 | ///////////////////////////////////////////////////////////////////////////// 35 | // CSelectSelfAddr message handlers 36 | 37 | BOOL CSelectSelfAddr::OnInitDialog() 38 | { 39 | int count, numOthers, i; 40 | struct CALEDoc::SELFADDR sa; 41 | 42 | CDialog::OnInitDialog(); 43 | 44 | numOthers = pData->parrSelfAddrs->GetSize(); 45 | count = 0; 46 | 47 | for (i = 0; i < numOthers; i++) { 48 | sa = pData->parrSelfAddrs->GetAt(i); 49 | ctlSelfList().InsertString(count++, sa.strSelfAddr); 50 | } 51 | 52 | // If there aren't any Self Addresses, display error and then quit Dialog Box 53 | if (!count) { 54 | MessageBox("There aren't any Self Addresses configured.\nFirst enter station info into the Self Addresses section.", 55 | "Alert", MB_OK); 56 | EndDialog(IDCANCEL); 57 | } 58 | 59 | return TRUE; // return TRUE unless you set the focus to a control 60 | } 61 | 62 | void CSelectSelfAddr::OnOK() 63 | { 64 | // If no selection in From Address, then error 65 | if ((iSelfAddr = ctlSelfList().GetCurSel()) == LB_ERR) { 66 | MessageBox("Select one of the Self Addresses (or press Cancel)."); 67 | ctlSelfList().SetFocus(); 68 | return; 69 | } 70 | 71 | // Bring up a dialog box, so the user can select the desired channel 72 | CSelectRxChannel dlg(NULL); 73 | 74 | // Select the channel to receive 75 | dlg.pData = pData; 76 | dlg.iSelfAddrMode = 1; 77 | dlg.iSelfAddr = iSelfAddr; 78 | if (dlg.DoModal() == IDOK) { 79 | iChannel = dlg.iChanNum; 80 | } else { 81 | CDialog::OnCancel(); 82 | return; 83 | } 84 | 85 | CDialog::OnOK(); 86 | } 87 | -------------------------------------------------------------------------------- /SourceALE/SlotAddr.cpp: -------------------------------------------------------------------------------- 1 | // SlotAddr.cpp : implementation file 2 | // 14 Jan 1999 3 | 4 | #include "stdafx.h" 5 | #include "ALE.h" 6 | #include "SlotAddr.h" 7 | 8 | #ifdef _DEBUG 9 | #define new DEBUG_NEW 10 | #undef THIS_FILE 11 | static char THIS_FILE[] = __FILE__; 12 | #endif 13 | 14 | ///////////////////////////////////////////////////////////////////////////// 15 | // CSlotAddr dialog 16 | 17 | 18 | CSlotAddr::CSlotAddr(CWnd* pParent /*=NULL*/) 19 | : CDialog(CSlotAddr::IDD, pParent) 20 | { 21 | //{{AFX_DATA_INIT(CSlotAddr) 22 | // NOTE: the ClassWizard will add member initialization here 23 | //}}AFX_DATA_INIT 24 | } 25 | 26 | 27 | BEGIN_MESSAGE_MAP(CSlotAddr, CDialog) 28 | //{{AFX_MSG_MAP(CSlotAddr) 29 | //}}AFX_MSG_MAP 30 | END_MESSAGE_MAP() 31 | 32 | ///////////////////////////////////////////////////////////////////////////// 33 | // CSlotAddr message handlers 34 | 35 | BOOL CSlotAddr::OnInitDialog() 36 | { 37 | CDialog::OnInitDialog(); 38 | 39 | if (!bNew) 40 | ctlSlotAddr().SetWindowText(pSlotStrings->GetAt(pos)); 41 | 42 | ctlSlotAddr().SetLimitText(15); 43 | ctlSlotAddr().SetFocus(); 44 | ctlSlotAddr().SetSel(0, -1); 45 | 46 | return FALSE; // return TRUE unless you set the focus to a control 47 | } 48 | 49 | void CSlotAddr::OnOK() 50 | { 51 | CString str; 52 | int i, len, cntstr; 53 | 54 | // Check the Slot Address. It must contain only upper case letters or 55 | // numbers, a maximum of 15 characters, be non-null, and not be a duplicate 56 | // name. (The control enforces caps and a length limit of 15.) 57 | cntstr = pSlotStrings->GetSize(); 58 | ctlSlotAddr().GetWindowText(str); 59 | len = str.GetLength(); 60 | if (len == 0) { 61 | MessageBox("The Slot Address cannot be empty (Press Cancel to not make a change)."); 62 | ctlSlotAddr().SetFocus(); 63 | ctlSlotAddr().SetSel(0, -1); 64 | return; 65 | } 66 | // Check for a dup slot address, but if we are editing, accept a string that 67 | // is unchanged. 68 | for (i = 0; i < cntstr; i++) { 69 | if (str == pSlotStrings->GetAt(i) && (bNew || i != pos)) { 70 | MessageBox("Slot Addresses must be unique."); 71 | ctlSlotAddr().SetFocus(); 72 | ctlSlotAddr().SetSel(0, -1); 73 | return; 74 | } 75 | } 76 | 77 | // Everything should be OK. Save the data 78 | if (bNew) { 79 | if (pos == -1) 80 | pos = pSlotStrings->Add(str); 81 | else 82 | pSlotStrings->InsertAt(pos, str); 83 | } else { 84 | pSlotStrings->SetAt(pos, str); 85 | } 86 | 87 | CDialog::OnOK(); 88 | } 89 | -------------------------------------------------------------------------------- /SourceCal/MainFrm.cpp: -------------------------------------------------------------------------------- 1 | // MainFrm.cpp : implementation of the CMainFrame class 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "Calibrate.h" 6 | 7 | #include "MainFrm.h" 8 | #include "CalibrateDoc.h" 9 | 10 | #ifdef _DEBUG 11 | #define new DEBUG_NEW 12 | #undef THIS_FILE 13 | static char THIS_FILE[] = __FILE__; 14 | #endif 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // CMainFrame 18 | 19 | IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd) 20 | 21 | BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd) 22 | //{{AFX_MSG_MAP(CMainFrame) 23 | // NOTE - the ClassWizard will add and remove mapping macros here. 24 | // DO NOT EDIT what you see in these blocks of generated code ! 25 | ON_WM_CREATE() 26 | //}}AFX_MSG_MAP 27 | ON_MESSAGE(WM_USER_DATA_AVAIL, OnDataAvail) 28 | END_MESSAGE_MAP() 29 | 30 | static UINT indicators[] = 31 | { 32 | ID_SEPARATOR, // status line indicator 33 | ID_INDICATOR_CAPS, 34 | ID_INDICATOR_NUM, 35 | ID_INDICATOR_SCRL, 36 | }; 37 | 38 | ///////////////////////////////////////////////////////////////////////////// 39 | // CMainFrame construction/destruction 40 | 41 | CMainFrame::CMainFrame() 42 | { 43 | // TODO: add member initialization code here 44 | 45 | } 46 | 47 | CMainFrame::~CMainFrame() 48 | { 49 | } 50 | 51 | int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) 52 | { 53 | if (CFrameWnd::OnCreate(lpCreateStruct) == -1) 54 | return -1; 55 | 56 | if (!m_wndStatusBar.Create(this) || 57 | !m_wndStatusBar.SetIndicators(indicators, 58 | sizeof(indicators)/sizeof(UINT))) 59 | { 60 | TRACE0("Failed to create status bar\n"); 61 | return -1; // fail to create 62 | } 63 | 64 | return 0; 65 | } 66 | 67 | BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) 68 | { 69 | if( !CFrameWnd::PreCreateWindow(cs) ) 70 | return FALSE; 71 | // TODO: Modify the Window class or styles here by modifying 72 | // the CREATESTRUCT cs 73 | 74 | return TRUE; 75 | } 76 | 77 | ///////////////////////////////////////////////////////////////////////////// 78 | // CMainFrame diagnostics 79 | 80 | #ifdef _DEBUG 81 | void CMainFrame::AssertValid() const 82 | { 83 | CFrameWnd::AssertValid(); 84 | } 85 | 86 | void CMainFrame::Dump(CDumpContext& dc) const 87 | { 88 | CFrameWnd::Dump(dc); 89 | } 90 | 91 | #endif //_DEBUG 92 | 93 | ///////////////////////////////////////////////////////////////////////////// 94 | // CMainFrame message handlers 95 | 96 | LONG CMainFrame::OnDataAvail(UINT wParam, LONG lParam) 97 | { 98 | ((CCalibrateDoc*) GetActiveDocument())->DataAvail(); 99 | 100 | return 0; 101 | } 102 | 103 | -------------------------------------------------------------------------------- /SourceALE/Icom.cpp: -------------------------------------------------------------------------------- 1 | // Icom.cpp : implementation file 2 | // 20 Jan 2000 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #include "stdafx.h" 6 | #include "Radio.h" 7 | #include "Icom.h" 8 | 9 | #ifdef _DEBUG 10 | #define new DEBUG_NEW 11 | #undef THIS_FILE 12 | static char THIS_FILE[] = __FILE__; 13 | #endif 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // CIcom 17 | 18 | CIcom::CIcom(HANDLE hCommPort) 19 | { 20 | baMessage[0] = baMessage[1] = 0xfe; 21 | baMessage[3] = 0xe0; 22 | hComm = hCommPort; 23 | } 24 | 25 | CIcom::~CIcom() 26 | { 27 | } 28 | 29 | void CIcom::Initialize(BYTE bRadioAddress) 30 | { 31 | // Initialize the radio to a known state 32 | baMessage[2] = bRadioAddress; 33 | } 34 | 35 | BYTE CIcom::BCD(int twodig) 36 | { 37 | // twodig is assumed to be an int between 0 and 99. The BCD 38 | // representation is returned. 39 | return (BYTE) ((twodig / 10) * 16 + twodig % 10); 40 | } 41 | 42 | void CIcom::Tune(double dFreq) 43 | { 44 | int i; 45 | DWORD dwWritten; 46 | 47 | // Check to see if we are already on the desired frequency 48 | if (dCurFreq == dFreq) 49 | return; 50 | 51 | SetFreq(dFreq); 52 | 53 | // Tune the radio to the frequency 54 | baMessage[4] = 0; 55 | 56 | // Convert the double freq to the ICOM BCD freq 57 | dFreq += 0.0000005; 58 | i = (int) (dFreq / 100.0); 59 | baMessage[9] = BCD(i); 60 | dFreq = dFreq - i * 100; 61 | i = (int) dFreq; 62 | baMessage[8] = BCD(i); 63 | dFreq = (dFreq - i) * 100.0; 64 | i = (int) dFreq; 65 | baMessage[7] = BCD(i); 66 | dFreq = (dFreq - i) * 100.0; 67 | i = (int) dFreq; 68 | baMessage[6] = BCD(i); 69 | dFreq = (dFreq - i) * 100.0; 70 | i = (int) dFreq; 71 | baMessage[5] = BCD(i); 72 | 73 | baMessage[10] = 0xfd; 74 | 75 | // Write it to the comm port 76 | WriteFile(hComm, baMessage, 11, &dwWritten, NULL); 77 | } 78 | 79 | void CIcom::SetMode(enum RADIOMODE Mode) 80 | { 81 | DWORD dwWritten; 82 | 83 | // Check to see if we are already in the desired mode 84 | if (eCurMode == Mode) 85 | return; 86 | 87 | // Some ICOM models require a delay here. They will not correctly execute 88 | // an immediate change mode command. 89 | ::Sleep(15); 90 | 91 | // Set the mode on the radio 92 | if (Mode != eCurMode) { 93 | baMessage[4] = 1; 94 | 95 | if (Mode == LSB) 96 | baMessage[5] = 0; 97 | else if (Mode == USB) 98 | baMessage[5] = 1; 99 | else if (Mode == AM) 100 | baMessage[5] = 2; 101 | else if (Mode == CW) 102 | baMessage[5] = 3; 103 | 104 | baMessage[6] = 0xfd; 105 | 106 | // Write it to the comm port 107 | WriteFile(hComm, baMessage, 7, &dwWritten, NULL); 108 | 109 | eCurMode = Mode; 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /SourceCal/CalibrateView.cpp: -------------------------------------------------------------------------------- 1 | // CalibrateView.cpp : implementation of the CCalibrateView class 2 | // 3 | 4 | #include "stdafx.h" 5 | 6 | #include 7 | #include 8 | #include "hdaudio.h" 9 | 10 | #include "Calibrate.h" 11 | #include "CalibrateDoc.h" 12 | #include "CalDlg.h" 13 | #include "CalibrateView.h" 14 | 15 | #ifdef _DEBUG 16 | #define new DEBUG_NEW 17 | #undef THIS_FILE 18 | static char THIS_FILE[] = __FILE__; 19 | #endif 20 | 21 | ///////////////////////////////////////////////////////////////////////////// 22 | // CCalibrateView 23 | 24 | IMPLEMENT_DYNCREATE(CCalibrateView, CView) 25 | 26 | BEGIN_MESSAGE_MAP(CCalibrateView, CView) 27 | //{{AFX_MSG_MAP(CCalibrateView) 28 | ON_COMMAND(ID_CALIBRATE_GO, OnCalibrateGo) 29 | //}}AFX_MSG_MAP 30 | END_MESSAGE_MAP() 31 | 32 | ///////////////////////////////////////////////////////////////////////////// 33 | // CCalibrateView construction/destruction 34 | 35 | CCalibrateView::CCalibrateView() 36 | { 37 | pCalDlg = NULL; 38 | } 39 | 40 | CCalibrateView::~CCalibrateView() 41 | { 42 | } 43 | 44 | BOOL CCalibrateView::PreCreateWindow(CREATESTRUCT& cs) 45 | { 46 | // TODO: Modify the Window class or styles here by modifying 47 | // the CREATESTRUCT cs 48 | 49 | return CView::PreCreateWindow(cs); 50 | } 51 | 52 | ///////////////////////////////////////////////////////////////////////////// 53 | // CCalibrateView drawing 54 | 55 | void CCalibrateView::OnDraw(CDC* pDC) 56 | { 57 | CCalibrateDoc* pDoc = GetDocument(); 58 | ASSERT_VALID(pDoc); 59 | // TODO: add draw code for native data here 60 | } 61 | 62 | ///////////////////////////////////////////////////////////////////////////// 63 | // CCalibrateView diagnostics 64 | 65 | #ifdef _DEBUG 66 | void CCalibrateView::AssertValid() const 67 | { 68 | CView::AssertValid(); 69 | } 70 | 71 | void CCalibrateView::Dump(CDumpContext& dc) const 72 | { 73 | CView::Dump(dc); 74 | } 75 | 76 | CCalibrateDoc* CCalibrateView::GetDocument() // non-debug version is inline 77 | { 78 | ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CCalibrateDoc))); 79 | return (CCalibrateDoc*)m_pDocument; 80 | } 81 | #endif //_DEBUG 82 | 83 | ///////////////////////////////////////////////////////////////////////////// 84 | // CCalibrateView message handlers 85 | 86 | void CCalibrateView::OnCalibrateGo() 87 | { 88 | CCalibrateDoc* pDoc = GetDocument(); 89 | 90 | if (pCalDlg != NULL) { 91 | pCalDlg->DestroyWindow(); 92 | } else { 93 | pCalDlg = new CCalDlg; 94 | pCalDlg->view = this; 95 | pCalDlg->Create(IDD_DIALOG1, this); 96 | } 97 | 98 | return; 99 | } 100 | 101 | void CCalibrateView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint) 102 | { 103 | if ((pCalDlg != NULL) && (lHint == 1L)) 104 | pCalDlg->UpdateValue(); 105 | else 106 | CView::OnUpdate(pSender, lHint, pHint); 107 | } 108 | -------------------------------------------------------------------------------- /SourceCal/Calibrate.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {71d49bcf-1ae1-4b12-8267-b51b32887e34} 6 | cpp;c;cxx;rc;def;r;odl;idl;hpj;bat 7 | 8 | 9 | {1f207f72-3272-4ded-a7b1-dd123febbd2f} 10 | h;hpp;hxx;hm;inl 11 | 12 | 13 | {ad5e1a44-7ebd-4d03-8f1c-1690974c19a4} 14 | ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | Source Files 38 | 39 | 40 | 41 | 42 | Source Files 43 | 44 | 45 | 46 | 47 | Header Files 48 | 49 | 50 | Header Files 51 | 52 | 53 | Header Files 54 | 55 | 56 | Header Files 57 | 58 | 59 | Header Files 60 | 61 | 62 | Header Files 63 | 64 | 65 | Header Files 66 | 67 | 68 | Header Files 69 | 70 | 71 | 72 | 73 | Resource Files 74 | 75 | 76 | Resource Files 77 | 78 | 79 | Resource Files 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | Resource Files 88 | 89 | 90 | -------------------------------------------------------------------------------- /SourceALE/ALEView.h: -------------------------------------------------------------------------------- 1 | // ALEView.h : interface of the CALEView class 2 | // 25 Oct 1999 3 | ///////////////////////////////////////////////////////////////////////////// 4 | 5 | #include "SignalQualityDlg.h" 6 | #include "AMDDisplay.h" 7 | 8 | #if !defined(AFX_ALEVIEW_H__1A7D6916_335C_11D2_8F37_0060089F9D1C__INCLUDED_) 9 | #define AFX_ALEVIEW_H__1A7D6916_335C_11D2_8F37_0060089F9D1C__INCLUDED_ 10 | 11 | #if _MSC_VER > 1000 12 | #pragma once 13 | #endif // _MSC_VER > 1000 14 | 15 | class CALEView : public CView 16 | { 17 | protected: // create from serialization only 18 | CALEView(); 19 | DECLARE_DYNCREATE(CALEView) 20 | 21 | // Attributes 22 | public: 23 | CALEDoc* GetDocument(); 24 | CStatusBar m_wndStatusBar; 25 | CSignalQualityDlg* pSQDlg; 26 | CAMDDisplay* pAMDDlg; 27 | 28 | private: 29 | 30 | // Operations 31 | private: 32 | BOOL SoundingOn(); 33 | void SoundingOff(); 34 | 35 | public: 36 | 37 | // Overrides 38 | // ClassWizard generated virtual function overrides 39 | //{{AFX_VIRTUAL(CALEView) 40 | public: 41 | virtual void OnDraw(CDC* pDC); // overridden to draw this view 42 | virtual BOOL PreCreateWindow(CREATESTRUCT& cs); 43 | virtual void OnInitialUpdate(); 44 | protected: 45 | virtual BOOL OnPreparePrinting(CPrintInfo* pInfo); 46 | virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo); 47 | virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo); 48 | virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint); 49 | //}}AFX_VIRTUAL 50 | 51 | // Implementation 52 | public: 53 | virtual ~CALEView(); 54 | #ifdef _DEBUG 55 | virtual void AssertValid() const; 56 | virtual void Dump(CDumpContext& dc) const; 57 | #endif 58 | 59 | protected: 60 | 61 | // Generated message map functions 62 | protected: 63 | //{{AFX_MSG(CALEView) 64 | afx_msg void OnEditChannel(); 65 | afx_msg void OnEditSelfaddr(); 66 | afx_msg void OnEditOtheraddr(); 67 | afx_msg void OnSoundingStart(); 68 | afx_msg void OnUpdateSoundingStart(CCmdUI* pCmdUI); 69 | afx_msg void OnTimer(UINT nIDEvent); 70 | afx_msg void OnViewSignalquality(); 71 | afx_msg void OnUpdateViewSignalquality(CCmdUI* pCmdUI); 72 | afx_msg void OnRxScanning(); 73 | afx_msg void OnUpdateRxScanning(CCmdUI* pCmdUI); 74 | afx_msg void OnRxOff(); 75 | afx_msg void OnUpdateRxOff(CCmdUI* pCmdUI); 76 | afx_msg void OnRxSingchan(); 77 | afx_msg void OnUpdateRxSingchan(CCmdUI* pCmdUI); 78 | afx_msg void OnEditConfig(); 79 | afx_msg void OnIndividualCall(); 80 | afx_msg void OnUpdateIndividualcall(CCmdUI* pCmdUI); 81 | afx_msg void OnAllcall(); 82 | afx_msg void OnViewAmd(); 83 | afx_msg void OnUpdateViewAmd(CCmdUI* pCmdUI); 84 | afx_msg void OnSendAMDMessage(); 85 | afx_msg void OnDebugMode(); 86 | //}}AFX_MSG 87 | DECLARE_MESSAGE_MAP() 88 | }; 89 | 90 | #ifndef _DEBUG // debug version in ALEView.cpp 91 | inline CALEDoc* CALEView::GetDocument() 92 | { return (CALEDoc*)m_pDocument; } 93 | #endif 94 | 95 | ///////////////////////////////////////////////////////////////////////////// 96 | 97 | //{{AFX_INSERT_LOCATION}} 98 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 99 | 100 | #endif // !defined(AFX_ALEVIEW_H__1A7D6916_335C_11D2_8F37_0060089F9D1C__INCLUDED_) 101 | -------------------------------------------------------------------------------- /SourceALE/SelectSoundAddrs.cpp: -------------------------------------------------------------------------------- 1 | // SelectSoundAddrs.cpp : implementation file 2 | // 5 Apr 1999 3 | 4 | #include "stdafx.h" 5 | #include "ALE.h" 6 | #include "ALEDoc.h" 7 | #include "SelectSoundAddrs.h" 8 | 9 | #ifdef _DEBUG 10 | #define new DEBUG_NEW 11 | #undef THIS_FILE 12 | static char THIS_FILE[] = __FILE__; 13 | #endif 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // CSelectSoundAddrs dialog 17 | 18 | 19 | CSelectSoundAddrs::CSelectSoundAddrs(CWnd* pParent /*=NULL*/) 20 | : CDialog(CSelectSoundAddrs::IDD, pParent) 21 | { 22 | //{{AFX_DATA_INIT(CSelectSoundAddrs) 23 | // NOTE: the ClassWizard will add member initialization here 24 | //}}AFX_DATA_INIT 25 | } 26 | 27 | 28 | BEGIN_MESSAGE_MAP(CSelectSoundAddrs, CDialog) 29 | //{{AFX_MSG_MAP(CSelectSoundAddrs) 30 | //}}AFX_MSG_MAP 31 | END_MESSAGE_MAP() 32 | 33 | ///////////////////////////////////////////////////////////////////////////// 34 | // CSelectSoundAddrs message handlers 35 | 36 | BOOL CSelectSoundAddrs::OnInitDialog() 37 | { 38 | int count = 0; 39 | struct CALEDoc::SELFADDR sa; 40 | 41 | CDialog::OnInitDialog(); 42 | 43 | int numSelfs = pData->parrSelfAddrs->GetSize(); 44 | 45 | // Set the list box contents to the possible Self Addresses and 46 | // select the last ones used. 47 | for (int i = 0; i < numSelfs; i++) { 48 | sa = pData->parrSelfAddrs->GetAt(i); 49 | ctlList().InsertString(count, sa.strSelfAddr); 50 | ctlList().SetSel(count++, sa.bSoundingOn); 51 | } 52 | 53 | // If there aren't any Self Addresses, display error and then quit Dialog Box 54 | if (!count) { 55 | MessageBox("There aren't any Self Addresses configured.\nFirst enter station info into the Self Addresses section.", 56 | "Alert", MB_OK); 57 | EndDialog(IDCANCEL); 58 | } 59 | 60 | return TRUE; // return TRUE unless you set the focus to a control 61 | } 62 | 63 | void CSelectSoundAddrs::OnOK() 64 | { 65 | int i, j, iCurSel, numSelfs, numChans; 66 | struct CALEDoc::SELFADDR sa; 67 | struct CALEDoc::CHANNEL ch; 68 | CString strSelfAddr, strErr; 69 | BOOL bAddrOK; 70 | 71 | // If no selection then error 72 | if ((iCurSel = ctlList().GetSelCount()) == 0) { 73 | MessageBox("Select one or more of the Addresses (or press Cancel)."); 74 | ctlList().SetFocus(); 75 | return; 76 | } 77 | 78 | // Check that at least 1 channel has a sounding interval for each address 79 | numSelfs = pData->parrSelfAddrs->GetSize(); 80 | numChans = pData->parrChannels->GetSize(); 81 | for (i = 0; i < numSelfs; i++) { 82 | if (ctlList().GetSel(i)) { 83 | sa = pData->parrSelfAddrs->GetAt(i); 84 | bAddrOK = FALSE; 85 | for (j = 0; j < numChans; j++) { 86 | if (sa.parrValidChannels->GetAt(j)) { 87 | ch = pData->parrChannels->GetAt(j); 88 | if (ch.dSoundInterval > 0.0) { 89 | bAddrOK = TRUE; 90 | break; 91 | } 92 | } 93 | } 94 | if (!bAddrOK) { 95 | strErr.Format("Address %s cannot be selected.\nAt least one of the channels used by this address must have a valid Sound Interval.", 96 | sa.strSelfAddr); 97 | MessageBox(strErr); 98 | ctlList().SetFocus(); 99 | return; 100 | } 101 | } 102 | } 103 | 104 | // All is OK. Set sounding on for each selected address 105 | for (i = 0; i < numSelfs; i++) { 106 | sa = pData->parrSelfAddrs->GetAt(i); 107 | sa.bSoundingOn = ctlList().GetSel(i); 108 | pData->parrSelfAddrs->SetAt(i, sa); 109 | } 110 | 111 | CDialog::OnOK(); 112 | } 113 | -------------------------------------------------------------------------------- /SourceALE/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by ALE.rc 4 | // 5 | #define IDD_ABOUTBOX 100 6 | #define ID_STATUS1 102 7 | #define IDR_MAINFRAME 128 8 | #define IDR_ALETYPE 129 9 | #define IDD_SELFADDR 130 10 | #define IDD_CHANNEL 131 11 | #define IDD_CHANNEL_LIST 133 12 | #define IDD_SELFADDR_LIST 134 13 | #define IDD_OTHADDR_LIST 135 14 | #define IDD_OTHADDR 136 15 | #define IDD_SLOT_LIST 137 16 | #define IDD_SLOTADDR 138 17 | #define IDD_SELINDIV 139 18 | #define IDD_SOUNDADDRS 140 19 | #define IDD_SIGNALQUALITY 141 20 | #define IDD_RXCHANNEL 142 21 | #define IDD_CONFIG 143 22 | #define IDD_SELSELFADDR 144 23 | #define IDD_AMD 145 24 | #define IDD_AMDMESSAGE 146 25 | #define IDC_EDIT_CHAN 1000 26 | #define IDC_EDIT1 1001 27 | #define IDC_EDIT2 1002 28 | #define IDC_LIST1 1003 29 | #define IDC_EDIT3 1004 30 | #define IDC_COMBO1 1005 31 | #define IDC_COMBO2 1006 32 | #define IDC_COMBO3 1007 33 | #define IDC_COMBO4 1008 34 | #define IDC_ADD_CHAN 1009 35 | #define IDC_DELETE_CHAN 1010 36 | #define IDC_MOVEUP 1011 37 | #define IDC_MOVEDOWN 1012 38 | #define IDC_EDIT_SADDR 1013 39 | #define IDC_ADD_SADDR 1014 40 | #define IDC_DELETE_SADDR 1015 41 | #define IDC_EDIT_OADDR 1018 42 | #define IDC_ADD_OADDR 1019 43 | #define IDC_DELETE_OADDR 1020 44 | #define IDC_LIST2 1021 45 | #define IDC_BUTTON1 1022 46 | #define IDC_DELETE_CH 1024 47 | #define IDC_RADIOADDR 1025 48 | #define IDC_RADIO1 1026 49 | #define IDC_RADIO2 1027 50 | #define IDC_RICHEDIT1 1028 51 | #define ID_EDIT_CHANNEL 32771 52 | #define ID_EDIT_SELFADDR 32772 53 | #define ID_EDIT_OTHERADDR 32773 54 | #define ID_TRANSMIT_START 32774 55 | #define ID_RECEIVE_STARTRECEIVING 32775 56 | #define ID_INDIVIDUALCALL 32776 57 | #define ID_NETWORKCALL 32777 58 | #define ID_SOUNDING_START 32778 59 | #define IDM_THISIS 32779 60 | #define IDM_THISWAS 32780 61 | #define ID_VIEW_SIGNALQUALITY 32781 62 | #define ID_STARTSCANNING 32782 63 | #define ID_RX_SCANNING 32782 64 | #define ID_RX_OFF 32783 65 | #define ID_RX_SINGCHAN 32784 66 | #define ID_EDIT_CONFIG 32785 67 | #define ID_ALLCALL 32786 68 | #define ID_AMDMESSAGE 32787 69 | #define ID_VIEW_AMD 32788 70 | #define ID_DEBUG_MODE 32789 71 | 72 | // Next default values for new objects 73 | // 74 | #ifdef APSTUDIO_INVOKED 75 | #ifndef APSTUDIO_READONLY_SYMBOLS 76 | #define _APS_3D_CONTROLS 1 77 | #define _APS_NEXT_RESOURCE_VALUE 147 78 | #define _APS_NEXT_COMMAND_VALUE 32790 79 | #define _APS_NEXT_CONTROL_VALUE 1029 80 | #define _APS_NEXT_SYMED_VALUE 103 81 | #endif 82 | #endif 83 | -------------------------------------------------------------------------------- /SourceALE/HDAudio.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // HDAudio.h: Interface for the HDAudio class. 4 | // 5 | // Designed and programmed at The Institute of Telecommunication Sciences 6 | // 7 | // Ver 0.1 - R. Stafford & C. Behm 26 Mar 1999 8 | // 9 | ///////////////////////////////////////////////////////////////////////////////////////////////// 10 | 11 | #if !defined(AFX_HDAUDIO_H__D85F9E8C_788E_11D2_90C8_00609710F7FB__INCLUDED_) 12 | #define AFX_HDAUDIO_H__D85F9E8C_788E_11D2_90C8_00609710F7FB__INCLUDED_ 13 | 14 | #if _MSC_VER > 1000 15 | #pragma once 16 | #endif // _MSC_VER > 1000 17 | 18 | ////////////////////////////////////////////////////////////////////////////////////////////////// 19 | // Error defines for HDAudio 20 | #define INPUT_BUFFER_LOCK_FAILED 900 21 | #define OUTBUFFER_LOST 901 22 | #define OUTPUT_BUFFER_LOCK_FAILED 902 23 | 24 | // Defines for HDAudio::InitNotify 25 | #define INPUTBUFFER 1 26 | #define OUTPUTBUFFER 2 27 | 28 | // Number of Event Notifications 29 | #define NUMBEVENTS 3 30 | 31 | // Setup Globals for HDAudio::Demodule 32 | #define SAMPLEFREQ 22050L 33 | #define BITSPERSAMPLE 16 34 | #define NUMBCHANNELS 1 35 | #define OUTPUTAMPLITUDE 5000 36 | // Index 37 | #define FSK_1 750 // 0 38 | #define FSK_2 1000 // 1 39 | #define FSK_3 1500 // 2 40 | #define FSK_4 1250 // 3 41 | #define FSK_5 2500 // 4 42 | #define FSK_6 2250 // 5 43 | #define FSK_7 1750 // 6 44 | #define FSK_8 2000 // 7 45 | 46 | #define NUMBFSK 8 47 | 48 | // Samples per 4 mS Block 49 | #define GOERTZBLK (short)(0.004*SAMPLEFREQ) 50 | // NUMBGBLK is the number of Goertzel blocks in the total circular buffer 51 | // It must be divisable by 5 to keep in time sync with the 8 ms ALE symbols 52 | #define NUMBGBLK 120 53 | 54 | // Define the number of 8 ms symbols in half of the DirectX circular buffer 55 | #define HALFBLKOFSYMBOLS NUMBGBLK/4 56 | 57 | // Define the Input symbols structures 58 | // First define the half size Goertzel blocks 59 | struct strSymbolL { // little blocks are 1/2 Goertzel length 60 | short iSymbol; 61 | double dFSK[8]; 62 | double dSpecAve; 63 | }; 64 | // The input symbols array will have an SNR attached to each symbol 65 | struct strSymbolB { // big blocks are Goertzel length 66 | short iSymbol; 67 | double dSNR; 68 | }; 69 | 70 | class HDAudio 71 | { 72 | // Attributes 73 | private: 74 | DWORD dwMyWriteCursor; 75 | 76 | public: 77 | double dNoiseThreshold; 78 | 79 | public: 80 | // Constructor and Destructor 81 | HDAudio(); 82 | virtual ~HDAudio(); 83 | 84 | // Member Functions 85 | HRESULT InitDSound( CWnd *pWnd ); 86 | HRESULT InitNotify( short iInOrOut ); 87 | HRESULT ProcessOutputBuffer( DWORD iEvent, short iAmp ); 88 | HRESULT ProcessInputBuffer( DWORD iEvent ); 89 | BOOL InitializeBuffer( DWORD dwStart, DWORD cblength ); 90 | HRESULT Start( short iInOrOut ); 91 | HRESULT StopOutputBuffer( ); 92 | HRESULT Stop( short iInOrOut ); 93 | void Release( ); 94 | private: 95 | // Demodulate is used only in ProcessOutputBuffer 96 | BOOL Demodulate( LPBYTE pbSource, DWORD cbLength ); 97 | BOOL Modulate( short iAmp ); 98 | }; 99 | 100 | #endif // !defined(AFX_HDAUDIO_H__D85F9E8C_788E_11D2_90C8_00609710F7FB__INCLUDED_) 101 | -------------------------------------------------------------------------------- /SourceALE/MainFrm.cpp: -------------------------------------------------------------------------------- 1 | // MainFrm.cpp : implementation of the CMainFrame class 2 | // 19 August 1999 3 | 4 | #include "stdafx.h" 5 | #include "ALE.h" 6 | 7 | #include "MainFrm.h" 8 | #include "ALEDoc.h" 9 | 10 | #ifdef _DEBUG 11 | #define new DEBUG_NEW 12 | #undef THIS_FILE 13 | static char THIS_FILE[] = __FILE__; 14 | #endif 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // CMainFrame 18 | 19 | IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd) 20 | 21 | BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd) 22 | //{{AFX_MSG_MAP(CMainFrame) 23 | ON_WM_CREATE() 24 | ON_COMMAND(ID_HELP_FINDER, OnHelpFinder) 25 | //}}AFX_MSG_MAP 26 | // Global help commands 27 | ON_COMMAND(ID_HELP, CFrameWnd::OnHelp) 28 | ON_COMMAND(ID_CONTEXT_HELP, CFrameWnd::OnContextHelp) 29 | ON_COMMAND(ID_DEFAULT_HELP, CFrameWnd::OnHelpFinder) 30 | 31 | ON_MESSAGE(WM_USER_DATA_AVAIL, OnDataAvail) 32 | ON_MESSAGE(WM_USER_DOC_STARTED, OnDocAvail) 33 | ON_MESSAGE(WM_USER_ACTION, OnModemActionMessage) 34 | END_MESSAGE_MAP() 35 | 36 | static UINT indicators[] = 37 | { 38 | ID_SEPARATOR, // status line indicator 39 | ID_STATUS1, // status line indicator 40 | ID_INDICATOR_CAPS, 41 | ID_INDICATOR_NUM, 42 | ID_INDICATOR_SCRL, 43 | }; 44 | 45 | ///////////////////////////////////////////////////////////////////////////// 46 | // CMainFrame construction/destruction 47 | 48 | CMainFrame::CMainFrame() 49 | { 50 | // TODO: add member initialization code here 51 | 52 | } 53 | 54 | CMainFrame::~CMainFrame() 55 | { 56 | } 57 | 58 | int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) 59 | { 60 | if (CFrameWnd::OnCreate(lpCreateStruct) == -1) 61 | return -1; 62 | 63 | if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP 64 | | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) || 65 | !m_wndToolBar.LoadToolBar(IDR_MAINFRAME)) 66 | { 67 | TRACE0("Failed to create toolbar\n"); 68 | return -1; // fail to create 69 | } 70 | 71 | if (!m_wndStatusBar.Create(this) || 72 | !m_wndStatusBar.SetIndicators(indicators, 73 | sizeof(indicators)/sizeof(UINT))) 74 | { 75 | TRACE0("Failed to create status bar\n"); 76 | return -1; // fail to create 77 | } 78 | m_wndStatusBar.SetPaneInfo(1, ID_STATUS1, SBPS_NORMAL, 400); 79 | 80 | m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY); 81 | EnableDocking(CBRS_ALIGN_ANY); 82 | DockControlBar(&m_wndToolBar); 83 | 84 | return 0; 85 | } 86 | 87 | BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) 88 | { 89 | if( !CFrameWnd::PreCreateWindow(cs) ) 90 | return FALSE; 91 | // TODO: Modify the Window class or styles here by modifying 92 | // the CREATESTRUCT cs 93 | 94 | return TRUE; 95 | } 96 | 97 | ///////////////////////////////////////////////////////////////////////////// 98 | // CMainFrame diagnostics 99 | 100 | #ifdef _DEBUG 101 | void CMainFrame::AssertValid() const 102 | { 103 | CFrameWnd::AssertValid(); 104 | } 105 | 106 | void CMainFrame::Dump(CDumpContext& dc) const 107 | { 108 | CFrameWnd::Dump(dc); 109 | } 110 | 111 | #endif //_DEBUG 112 | 113 | ///////////////////////////////////////////////////////////////////////////// 114 | // CMainFrame message handlers 115 | 116 | LONG CMainFrame::OnDataAvail(UINT wParam, LONG lParam) 117 | { 118 | ((CALEDoc*) GetActiveDocument())->DataAvail(); 119 | 120 | return 0; 121 | } 122 | 123 | LONG CMainFrame::OnDocAvail(UINT wParam, LONG lParam) 124 | { 125 | ((CALEDoc*) GetActiveDocument())->pStatusBar = &m_wndStatusBar; 126 | 127 | return 0; 128 | } 129 | 130 | LONG CMainFrame::OnModemActionMessage(UINT wParam, LONG lParam) 131 | { 132 | ((CALEDoc*) GetActiveDocument())->OnModemAction(wParam, lParam); 133 | 134 | return 0; 135 | } 136 | 137 | void CMainFrame::OnHelpFinder() 138 | { 139 | // Call HTML help 140 | ::HtmlHelp(NULL, "ALE_Help.chm", HH_DISPLAY_TOPIC, 0); 141 | } 142 | -------------------------------------------------------------------------------- /SourceALE/CircBuf.h: -------------------------------------------------------------------------------- 1 | // CircBuf.h: interface for the CCircBuf class. 2 | // 12 Mar 1999 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_CIRCBUF_H__BE28EFE1_731F_11D2_8F3A_0060089F9D1C__INCLUDED_) 6 | #define AFX_CIRCBUF_H__BE28EFE1_731F_11D2_8F3A_0060089F9D1C__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | #include "HDAudio.h" // You need the defines from here for the CCircBufx sizes 13 | 14 | // The longest ALE message is 36 seconds long set the output buffer to that size 15 | #define CIRCBUFOSIZE 100 // ~40 Seconds of output data 16 | // The input buffer can be small since in all likelyhood we'll be checking it quite often 17 | // So to start with lets make it... 18 | #define CIRCBUFISIZE 20 // ~4 Seconds of input data 19 | 20 | typedef struct tagCIRCBUFINDATA { 21 | long ALEWord; // a 24 bit ALE word 22 | double dSNR; // a "signal/noise" associated with the word 23 | int Ucount; // count of unanimous votes (for "BER") 24 | BOOL bALEDetected, // Used during scanning as a fast check if ALE signal present 25 | bALEEnded; // TRUE when the end of an ALE transmission is detected 26 | } CIRCBUFINDATA; 27 | 28 | ////////////////////////////////////////////////////////////////////////////////////////// 29 | // Circular Buffer classes 30 | // 31 | // This classes are thread-safe. All accesses through member functions are 32 | // locked by CriticalSections so synchronicity problems should not occur. 33 | // 34 | // If in == out, then the buffer is empty 35 | // If in == out - 1 or (in == CIRCBUFSIZE - 1 and out == 0), then 36 | // the buffer is full. This always leaves one place in the buffer 37 | // unused, so that the full buffer can be differentiated from the 38 | // empty buffer. 39 | /////////////////////////////////////////////////////////////////////////////////////////// 40 | 41 | // Circular Buffer Output 42 | class CCircBufO 43 | { 44 | public: 45 | CCircBufO(); 46 | virtual ~CCircBufO(); 47 | 48 | // Reset the circular buffer to empty 49 | void Reset(); 50 | 51 | // Put copies 'count' bytes from 'buffer' to the circular buffer. 52 | // Value returned is 0 if successful, 53 | // 1 if failure because the circular buffer is too full 54 | // 2 if failure because the circular buffer is too small 55 | // (that is the data would not fit even when the buffer 56 | // is empty.) 57 | // If the Put fails, no data is put in the circular buffer. 58 | int Put(long *buffer, int count); 59 | 60 | // Get copies up to 'count' words from the circular buffer to 'buffer'. 61 | // 'count' words will be returned if that many are available. 62 | // Value returned is the number of bytes returned (possibly zero). 63 | // If the Get fails, no data is put in the 'buffer'. 64 | int Get(long *buffer, int count); 65 | 66 | private: 67 | int in, out; 68 | long iCBuffer[CIRCBUFOSIZE]; 69 | CCriticalSection g_CriticalSection; 70 | }; 71 | 72 | // Circular Buffer Input 73 | class CCircBufI 74 | { 75 | public: 76 | CCircBufI(); 77 | virtual ~CCircBufI(); 78 | 79 | // Reset the circular buffer to empty 80 | void Reset(); 81 | 82 | // Put copies 'count' items from 'buffer' to the circular buffer. 83 | // Value returned is 0 if successful, 84 | // 1 if failure because the circular buffer is too full 85 | // 2 if failure because the circular buffer is too small 86 | // (that is the data would not fit even when the buffer 87 | // is empty.) 88 | // If the Put fails, no data is put in the circular buffer. 89 | int Put(CIRCBUFINDATA *buffer, int count); 90 | 91 | // Get copies up to 'count' items from the circular buffer to 'buffer'. 92 | // 'count' items will be returned if that many are available. 93 | // Value returned is the number of items returned (possibly zero). 94 | // If the Get fails, no data is put in the 'buffer'. 95 | int Get(CIRCBUFINDATA *buffer, int count); 96 | 97 | private: 98 | int in, out; 99 | CIRCBUFINDATA strCBuffer[CIRCBUFISIZE]; 100 | CCriticalSection g_CriticalSection; 101 | }; 102 | 103 | #endif // !defined(AFX_CIRCBUF_H__BE28EFE1_731F_11D2_8F3A_0060089F9D1C__INCLUDED_) 104 | -------------------------------------------------------------------------------- /SourceCal/Calibrate.cpp: -------------------------------------------------------------------------------- 1 | // Calibrate.cpp : Defines the class behaviors for the application. 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "Calibrate.h" 6 | 7 | #include "MainFrm.h" 8 | #include "CalibrateDoc.h" 9 | #include "CalibrateView.h" 10 | 11 | #ifdef _DEBUG 12 | #define new DEBUG_NEW 13 | #undef THIS_FILE 14 | static char THIS_FILE[] = __FILE__; 15 | #endif 16 | 17 | ///////////////////////////////////////////////////////////////////////////// 18 | // CCalibrateApp 19 | 20 | BEGIN_MESSAGE_MAP(CCalibrateApp, CWinApp) 21 | //{{AFX_MSG_MAP(CCalibrateApp) 22 | ON_COMMAND(ID_APP_ABOUT, OnAppAbout) 23 | // NOTE - the ClassWizard will add and remove mapping macros here. 24 | // DO NOT EDIT what you see in these blocks of generated code! 25 | //}}AFX_MSG_MAP 26 | // Standard file based document commands 27 | ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew) 28 | ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen) 29 | END_MESSAGE_MAP() 30 | 31 | ///////////////////////////////////////////////////////////////////////////// 32 | // CCalibrateApp construction 33 | 34 | CCalibrateApp::CCalibrateApp() 35 | { 36 | // TODO: add construction code here, 37 | // Place all significant initialization in InitInstance 38 | } 39 | 40 | ///////////////////////////////////////////////////////////////////////////// 41 | // The one and only CCalibrateApp object 42 | 43 | CCalibrateApp theApp; 44 | 45 | ///////////////////////////////////////////////////////////////////////////// 46 | // CCalibrateApp initialization 47 | 48 | BOOL CCalibrateApp::InitInstance() 49 | { 50 | AfxEnableControlContainer(); 51 | 52 | // Standard initialization 53 | // If you are not using these features and wish to reduce the size 54 | // of your final executable, you should remove from the following 55 | // the specific initialization routines you do not need. 56 | 57 | #ifdef _AFXDLL 58 | Enable3dControls(); // Call this when using MFC in a shared DLL 59 | #else 60 | Enable3dControlsStatic(); // Call this when linking to MFC statically 61 | #endif 62 | 63 | // Change the registry key under which our settings are stored. 64 | // TODO: You should modify this string to be something appropriate 65 | // such as the name of your company or organization. 66 | SetRegistryKey(_T("Local AppWizard-Generated Applications")); 67 | 68 | LoadStdProfileSettings(); // Load standard INI file options (including MRU) 69 | 70 | // Register the application's document templates. Document templates 71 | // serve as the connection between documents, frame windows and views. 72 | 73 | CSingleDocTemplate* pDocTemplate; 74 | pDocTemplate = new CSingleDocTemplate( 75 | IDR_MAINFRAME, 76 | RUNTIME_CLASS(CCalibrateDoc), 77 | RUNTIME_CLASS(CMainFrame), // main SDI frame window 78 | RUNTIME_CLASS(CCalibrateView)); 79 | AddDocTemplate(pDocTemplate); 80 | 81 | // Parse command line for standard shell commands, DDE, file open 82 | CCommandLineInfo cmdInfo; 83 | ParseCommandLine(cmdInfo); 84 | 85 | // Dispatch commands specified on the command line 86 | if (!ProcessShellCommand(cmdInfo)) 87 | return FALSE; 88 | 89 | // The one and only window has been initialized, so show and update it. 90 | m_pMainWnd->ShowWindow(SW_SHOW); 91 | m_pMainWnd->UpdateWindow(); 92 | 93 | return TRUE; 94 | } 95 | 96 | 97 | ///////////////////////////////////////////////////////////////////////////// 98 | // CAboutDlg dialog used for App About 99 | 100 | class CAboutDlg : public CDialog 101 | { 102 | public: 103 | CAboutDlg(); 104 | 105 | // Dialog Data 106 | //{{AFX_DATA(CAboutDlg) 107 | enum { IDD = IDD_ABOUTBOX }; 108 | //}}AFX_DATA 109 | 110 | // ClassWizard generated virtual function overrides 111 | //{{AFX_VIRTUAL(CAboutDlg) 112 | protected: 113 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 114 | //}}AFX_VIRTUAL 115 | 116 | // Implementation 117 | protected: 118 | //{{AFX_MSG(CAboutDlg) 119 | // No message handlers 120 | //}}AFX_MSG 121 | DECLARE_MESSAGE_MAP() 122 | }; 123 | 124 | CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD) 125 | { 126 | //{{AFX_DATA_INIT(CAboutDlg) 127 | //}}AFX_DATA_INIT 128 | } 129 | 130 | void CAboutDlg::DoDataExchange(CDataExchange* pDX) 131 | { 132 | CDialog::DoDataExchange(pDX); 133 | //{{AFX_DATA_MAP(CAboutDlg) 134 | //}}AFX_DATA_MAP 135 | } 136 | 137 | BEGIN_MESSAGE_MAP(CAboutDlg, CDialog) 138 | //{{AFX_MSG_MAP(CAboutDlg) 139 | // No message handlers 140 | //}}AFX_MSG_MAP 141 | END_MESSAGE_MAP() 142 | 143 | // App command to run the dialog 144 | void CCalibrateApp::OnAppAbout() 145 | { 146 | CAboutDlg aboutDlg; 147 | aboutDlg.DoModal(); 148 | } 149 | 150 | ///////////////////////////////////////////////////////////////////////////// 151 | // CCalibrateApp message handlers 152 | 153 | -------------------------------------------------------------------------------- /SourceALE/ALE.cpp: -------------------------------------------------------------------------------- 1 | // ALE.cpp : Defines the class behaviors for the application. 2 | // 3 Feb 1999 3 | 4 | #include "stdafx.h" 5 | #include "afxcview.h" 6 | #include "ALE.h" 7 | 8 | #include "MainFrm.h" 9 | #include "ALEDoc.h" 10 | #include "ALEView.h" 11 | 12 | #ifdef _DEBUG 13 | #define new DEBUG_NEW 14 | #undef THIS_FILE 15 | static char THIS_FILE[] = __FILE__; 16 | #endif 17 | 18 | ///////////////////////////////////////////////////////////////////////////// 19 | // CALEApp 20 | 21 | BEGIN_MESSAGE_MAP(CALEApp, CWinApp) 22 | //{{AFX_MSG_MAP(CALEApp) 23 | ON_COMMAND(ID_APP_ABOUT, OnAppAbout) 24 | // NOTE - the ClassWizard will add and remove mapping macros here. 25 | // DO NOT EDIT what you see in these blocks of generated code! 26 | //}}AFX_MSG_MAP 27 | // Standard file based document commands 28 | ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew) 29 | ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen) 30 | // Standard print setup command 31 | ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup) 32 | END_MESSAGE_MAP() 33 | 34 | ///////////////////////////////////////////////////////////////////////////// 35 | // CALEApp construction 36 | 37 | CALEApp::CALEApp() 38 | { 39 | // TODO: add construction code here, 40 | // Place all significant initialization in InitInstance 41 | } 42 | 43 | ///////////////////////////////////////////////////////////////////////////// 44 | // The one and only CALEApp object 45 | 46 | CALEApp theApp; 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // CALEApp initialization 50 | 51 | BOOL CALEApp::InitInstance() 52 | { 53 | AfxEnableControlContainer(); 54 | AfxInitRichEdit(); 55 | 56 | // Standard initialization 57 | // If you are not using these features and wish to reduce the size 58 | // of your final executable, you should remove from the following 59 | // the specific initialization routines you do not need. 60 | 61 | #ifdef _AFXDLL 62 | Enable3dControls(); // Call this when using MFC in a shared DLL 63 | #else 64 | Enable3dControlsStatic(); // Call this when linking to MFC statically 65 | #endif 66 | 67 | SetRegistryKey(_T("ITS Applications")); 68 | 69 | LoadStdProfileSettings(); // Load standard INI file options (including MRU) 70 | 71 | // Register the application's document templates. Document templates 72 | // serve as the connection between documents, frame windows and views. 73 | 74 | CSingleDocTemplate* pDocTemplate; 75 | pDocTemplate = new CSingleDocTemplate( 76 | IDR_MAINFRAME, 77 | RUNTIME_CLASS(CALEDoc), 78 | RUNTIME_CLASS(CMainFrame), // main SDI frame window 79 | RUNTIME_CLASS(CALEView)); 80 | AddDocTemplate(pDocTemplate); 81 | 82 | // Enable DDE Execute open 83 | EnableShellOpen(); 84 | RegisterShellFileTypes(TRUE); 85 | 86 | // Parse command line for standard shell commands, DDE, file open 87 | CCommandLineInfo cmdInfo; 88 | ParseCommandLine(cmdInfo); 89 | 90 | // Dispatch commands specified on the command line 91 | if (!ProcessShellCommand(cmdInfo)) 92 | return FALSE; 93 | 94 | // The one and only window has been initialized, so show and update it. 95 | m_pMainWnd->ShowWindow(SW_SHOW); 96 | m_pMainWnd->UpdateWindow(); 97 | 98 | // Enable drag/drop open 99 | m_pMainWnd->DragAcceptFiles(); 100 | 101 | return TRUE; 102 | } 103 | 104 | 105 | ///////////////////////////////////////////////////////////////////////////// 106 | // CAboutDlg dialog used for App About 107 | 108 | class CAboutDlg : public CDialog 109 | { 110 | public: 111 | CAboutDlg(); 112 | 113 | // Dialog Data 114 | //{{AFX_DATA(CAboutDlg) 115 | enum { IDD = IDD_ABOUTBOX }; 116 | //}}AFX_DATA 117 | 118 | // ClassWizard generated virtual function overrides 119 | //{{AFX_VIRTUAL(CAboutDlg) 120 | protected: 121 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 122 | //}}AFX_VIRTUAL 123 | 124 | // Implementation 125 | protected: 126 | //{{AFX_MSG(CAboutDlg) 127 | // No message handlers 128 | //}}AFX_MSG 129 | DECLARE_MESSAGE_MAP() 130 | }; 131 | 132 | CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD) 133 | { 134 | //{{AFX_DATA_INIT(CAboutDlg) 135 | //}}AFX_DATA_INIT 136 | } 137 | 138 | void CAboutDlg::DoDataExchange(CDataExchange* pDX) 139 | { 140 | CDialog::DoDataExchange(pDX); 141 | //{{AFX_DATA_MAP(CAboutDlg) 142 | //}}AFX_DATA_MAP 143 | } 144 | 145 | BEGIN_MESSAGE_MAP(CAboutDlg, CDialog) 146 | //{{AFX_MSG_MAP(CAboutDlg) 147 | // No message handlers 148 | //}}AFX_MSG_MAP 149 | END_MESSAGE_MAP() 150 | 151 | // App command to run the dialog 152 | void CALEApp::OnAppAbout() 153 | { 154 | CAboutDlg aboutDlg; 155 | aboutDlg.DoModal(); 156 | } 157 | 158 | ///////////////////////////////////////////////////////////////////////////// 159 | // CALEApp message handlers 160 | 161 | -------------------------------------------------------------------------------- /SourceALE/Config.cpp: -------------------------------------------------------------------------------- 1 | // Config.cpp : implementation file 2 | // 30 Jun 1999 3 | 4 | #include "stdafx.h" 5 | #include "DlgFloat.h" 6 | #include "ALE.h" 7 | #include "ALEDoc.h" 8 | #include "Config.h" 9 | 10 | #ifdef _DEBUG 11 | #define new DEBUG_NEW 12 | #undef THIS_FILE 13 | static char THIS_FILE[] = __FILE__; 14 | #endif 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // CConfig dialog 18 | 19 | 20 | CConfig::CConfig(CWnd* pParent /*=NULL*/) 21 | : CDialog(CConfig::IDD, pParent) 22 | { 23 | //{{AFX_DATA_INIT(CConfig) 24 | // NOTE: the ClassWizard will add member initialization here 25 | //}}AFX_DATA_INIT 26 | } 27 | 28 | 29 | BEGIN_MESSAGE_MAP(CConfig, CDialog) 30 | //{{AFX_MSG_MAP(CConfig) 31 | //}}AFX_MSG_MAP 32 | END_MESSAGE_MAP() 33 | 34 | ///////////////////////////////////////////////////////////////////////////// 35 | // CConfig message handlers 36 | 37 | BOOL CConfig::OnInitDialog() 38 | { 39 | CString str; 40 | 41 | CDialog::OnInitDialog(); 42 | 43 | // Initialize the ComboBox controls 44 | ctlComboRadio().AddString("ICOM"); 45 | 46 | ctlComboCommPort().AddString("COM1"); 47 | ctlComboCommPort().AddString("COM2"); 48 | ctlComboCommPort().AddString("COM3"); 49 | ctlComboCommPort().AddString("COM4"); 50 | 51 | ctlComboBaud().AddString("19200"); 52 | ctlComboBaud().AddString("9600"); 53 | ctlComboBaud().AddString("4800"); 54 | ctlComboBaud().AddString("2400"); 55 | ctlComboBaud().AddString("1200"); 56 | 57 | if (pData->pConfig->eRadioType == ICOM) 58 | ctlComboRadio().SelectString(-1, "ICOM"); 59 | 60 | ctlRadioAddr().SetLimitText(2); 61 | str.Format("%2X", pData->pConfig->bRadioAddress); 62 | ctlRadioAddr().SetWindowText(str); 63 | 64 | if (ctlComboCommPort().SelectString(-1, pData->pConfig->strCommPort) == CB_ERR) { 65 | ctlComboCommPort().AddString(pData->pConfig->strCommPort); 66 | ctlComboCommPort().SelectString(-1, pData->pConfig->strCommPort); 67 | } 68 | 69 | switch (pData->pConfig->lBaud) { 70 | case 19200: 71 | ctlComboBaud().SelectString(-1, "19200"); 72 | break; 73 | case 9600: 74 | ctlComboBaud().SelectString(-1, "9600"); 75 | break; 76 | case 4800: 77 | ctlComboBaud().SelectString(-1, "4800"); 78 | break; 79 | case 2400: 80 | ctlComboBaud().SelectString(-1, "2400"); 81 | break; 82 | case 1200: 83 | ctlComboBaud().SelectString(-1, "1200"); 84 | break; 85 | } 86 | 87 | return TRUE; // return TRUE unless you set the focus to a control 88 | } 89 | 90 | void CConfig::OnOK() 91 | { 92 | COMMPROP CommProp; 93 | CString strCommPort, str; 94 | long bRadioAddress; 95 | long lBaud; 96 | DWORD mask; 97 | 98 | // Assume the Radio is OK 99 | 100 | // Check that the Radio Address is between 1 and 77 (hex) 101 | ctlRadioAddr().GetWindowText(str); 102 | if (!SimpleHexParse(str, bRadioAddress) || (bRadioAddress <= 0) || (bRadioAddress > 127)) { 103 | MessageBox("The Radio Address must be a hexadecimal number between 1 and 7F."); 104 | ctlRadioAddr().SetFocus(); 105 | ctlRadioAddr().SetSel(0, -1); 106 | return; 107 | } 108 | 109 | // Comm Ports may have non-standard names. Check and see if this computer has the named comm port. 110 | // Try to open comm port 111 | ctlComboCommPort().GetWindowText(strCommPort); 112 | if (hComm != 0) 113 | CloseHandle(hComm); 114 | if ((hComm = CreateFile(strCommPort, GENERIC_READ | GENERIC_WRITE, 115 | 0, 0, OPEN_EXISTING, 0, 0)) == INVALID_HANDLE_VALUE) { 116 | MessageBox("The selected Serial Comm Port is busy or doesn't exist."); 117 | ctlComboCommPort().SetFocus(); 118 | hComm = 0; 119 | return; 120 | } 121 | 122 | // Check if this baud rate is supported on this comm port 123 | GetCommProperties(hComm, &CommProp); 124 | ctlComboBaud().GetWindowText(str); 125 | _AfxSimpleLongParse(str, lBaud); 126 | switch (lBaud) { 127 | case 1200: 128 | mask = BAUD_1200; 129 | break; 130 | case 2400: 131 | mask = BAUD_2400; 132 | break; 133 | case 4800: 134 | mask = BAUD_4800; 135 | break; 136 | case 9600: 137 | mask = BAUD_9600; 138 | break; 139 | case 19200: 140 | mask = BAUD_19200; 141 | break; 142 | } 143 | 144 | if (!(CommProp.dwSettableBaud & mask)) { 145 | MessageBox("The Serial Port does not support this baud rate."); 146 | ctlComboCommPort().SetFocus(); 147 | CloseHandle(hComm); 148 | return; 149 | } 150 | 151 | // Everything is OK. Save the configuration. 152 | ctlComboRadio().GetWindowText(str); 153 | if (str == "ICOM") 154 | pData->pConfig->eRadioType = ICOM; 155 | pData->pConfig->strCommPort = strCommPort; 156 | pData->pConfig->bRadioAddress = (BYTE) bRadioAddress; 157 | pData->pConfig->lBaud = lBaud; 158 | pData->pDoc->SetModifiedFlag(); 159 | 160 | CloseHandle(hComm); 161 | CDialog::OnOK(); 162 | } 163 | -------------------------------------------------------------------------------- /SourceALE/SelectIndivAddr.cpp: -------------------------------------------------------------------------------- 1 | // SelectIndivAddr.cpp : implementation file 2 | // 18 Nov 1999 3 | 4 | #include "stdafx.h" 5 | #include "ALE.h" 6 | #include "ALEDoc.h" 7 | #include "SelectRxChannel.h" 8 | #include "SelectIndivAddr.h" 9 | 10 | #ifdef _DEBUG 11 | #define new DEBUG_NEW 12 | #undef THIS_FILE 13 | static char THIS_FILE[] = __FILE__; 14 | #endif 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // CSelectIndivAddr dialog 18 | 19 | 20 | CSelectIndivAddr::CSelectIndivAddr(CWnd* pParent /*=NULL*/) 21 | : CDialog(CSelectIndivAddr::IDD, pParent) 22 | { 23 | //{{AFX_DATA_INIT(CSelectIndivAddr) 24 | // NOTE: the ClassWizard will add member initialization here 25 | //}}AFX_DATA_INIT 26 | } 27 | 28 | 29 | BEGIN_MESSAGE_MAP(CSelectIndivAddr, CDialog) 30 | //{{AFX_MSG_MAP(CSelectIndivAddr) 31 | //}}AFX_MSG_MAP 32 | END_MESSAGE_MAP() 33 | 34 | ///////////////////////////////////////////////////////////////////////////// 35 | // CSelectIndivAddr message handlers 36 | 37 | BOOL CSelectIndivAddr::OnInitDialog() 38 | { 39 | int count, numOthers, i; 40 | struct CALEDoc::OTHERADDR oa; 41 | struct CALEDoc::SELFADDR sa; 42 | 43 | CDialog::OnInitDialog(); 44 | 45 | // The default channel mode should be automatic 46 | CheckRadioButton(IDC_RADIO1, IDC_RADIO2, IDC_RADIO1); 47 | 48 | numOthers = pData->parrOtherAddrs->GetSize(); 49 | count = 0; 50 | 51 | for (i = 0; i < numOthers; i++) { 52 | oa = pData->parrOtherAddrs->GetAt(i); 53 | if (oa.pSlotStrings->GetSize() == 0) { 54 | ctlToList().InsertString(count++, oa.strOtherAddr); 55 | } 56 | } 57 | 58 | // If there aren't any Other Addresses, display error and then quit Dialog Box 59 | if (!count) { 60 | MessageBox("There aren't any Other Addresses configured.\nFirst enter station info into the Other Addresses section.", 61 | "Alert", MB_OK); 62 | EndDialog(IDCANCEL); 63 | return TRUE; 64 | } 65 | 66 | numOthers = pData->parrSelfAddrs->GetSize(); 67 | count = 0; 68 | 69 | for (i = 0; i < numOthers; i++) { 70 | sa = pData->parrSelfAddrs->GetAt(i); 71 | ctlSelfList().InsertString(count++, sa.strSelfAddr); 72 | } 73 | 74 | // If there aren't any Self Addresses, display error and then quit Dialog Box 75 | if (!count) { 76 | MessageBox("There aren't any Self Addresses configured.\nFirst enter station info into the Self Addresses section.", 77 | "Alert", MB_OK); 78 | EndDialog(IDCANCEL); 79 | } 80 | 81 | return TRUE; // return TRUE unless you set the focus to a control 82 | } 83 | 84 | void CSelectIndivAddr::OnOK() 85 | { 86 | int iCurSel, numOthers, numChans, i; 87 | CString strOtherAddr; 88 | struct CALEDoc::OTHERADDR oa; 89 | struct CALEDoc::SELFADDR sa; 90 | struct CALEDoc::CHANNEL ch; 91 | 92 | // If no selection in To Address, then error 93 | if ((iCurSel = ctlToList().GetCurSel()) == LB_ERR) { 94 | MessageBox("Select one of the To Addresses (or press Cancel)."); 95 | ctlToList().SetFocus(); 96 | return; 97 | } 98 | 99 | ctlToList().GetText(iCurSel, strOtherAddr); 100 | numOthers = pData->parrOtherAddrs->GetSize(); 101 | 102 | for (i = 0; i < numOthers; i++) { 103 | oa = pData->parrOtherAddrs->GetAt(i); 104 | if (oa.pSlotStrings->GetSize() == 0) { 105 | if (oa.strOtherAddr == strOtherAddr) { 106 | iOtherAddr = i; 107 | break; 108 | } 109 | } 110 | } 111 | 112 | // If no selection in From Address, then error 113 | if ((iSelfAddr = ctlSelfList().GetCurSel()) == LB_ERR) { 114 | MessageBox("Select one of the Self Addresses (or press Cancel)."); 115 | ctlSelfList().SetFocus(); 116 | return; 117 | } 118 | 119 | // Do the two addresses have at least one channel in common? 120 | sa = pData->parrSelfAddrs->GetAt(iSelfAddr); 121 | numChans = pData->parrChannels->GetSize(); 122 | for (i = 0; i < numChans; i++) { 123 | ch = pData->parrChannels->GetAt(i); 124 | if (sa.parrValidChannels->GetAt(i) && oa.parrValidChannels->GetAt(i) && 125 | (ch.eTRMode == CALEDoc::TR)) 126 | goto ChannelOK; 127 | } 128 | // If here, then we couldn't find a common channel 129 | MessageBox("There is no common channel used by both addresses. Select another address (or press Cancel)."); 130 | ctlToList().SetFocus(); 131 | return; 132 | 133 | ChannelOK: 134 | if (IsDlgButtonChecked(IDC_RADIO1)) 135 | eChannelMode = AUTO; 136 | else { 137 | eChannelMode = MANUAL; 138 | 139 | // Bring up a dialog box, so the user can select the desired channel 140 | CSelectRxChannel dlg(NULL); 141 | 142 | // Select the channel to receive 143 | dlg.pData = pData; 144 | dlg.iSelfAddrMode = 2; 145 | dlg.iSelfAddr = iSelfAddr; 146 | dlg.iOtherAddr = iOtherAddr; 147 | if (dlg.DoModal() == IDOK) { 148 | iChannel = dlg.iChanNum; 149 | } else { 150 | CDialog::OnCancel(); 151 | return; 152 | } 153 | } 154 | 155 | CDialog::OnOK(); 156 | } 157 | -------------------------------------------------------------------------------- /SourceALE/SignalQualityDlg.cpp: -------------------------------------------------------------------------------- 1 | // SignalQualityDlg.cpp : implementation file 2 | // 24 Jan 2000 3 | 4 | #include "stdafx.h" 5 | #include "ALE.h" 6 | #include "ALEDoc.h" 7 | #include "ALEView.h" 8 | #include "SignalQualityDlg.h" 9 | 10 | #ifdef _DEBUG 11 | #define new DEBUG_NEW 12 | #undef THIS_FILE 13 | static char THIS_FILE[] = __FILE__; 14 | #endif 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // CSignalQualityDlg dialog 18 | 19 | CSignalQualityDlg::CSignalQualityDlg(CWnd* pParent /*=NULL*/) 20 | : CDialog(CSignalQualityDlg::IDD, pParent) 21 | { 22 | //{{AFX_DATA_INIT(CSignalQualityDlg) 23 | // NOTE: the ClassWizard will add member initialization here 24 | //}}AFX_DATA_INIT 25 | } 26 | 27 | BEGIN_MESSAGE_MAP(CSignalQualityDlg, CDialog) 28 | //{{AFX_MSG_MAP(CSignalQualityDlg) 29 | ON_BN_CLICKED(IDC_DELETE_CH, OnDeleteCh) 30 | //}}AFX_MSG_MAP 31 | 32 | END_MESSAGE_MAP() 33 | 34 | ///////////////////////////////////////////////////////////////////////////// 35 | // CSignalQualityDlg message handlers 36 | 37 | BOOL CSignalQualityDlg::OnInitDialog() 38 | { 39 | struct CALEDoc::LQA lqa; 40 | int size, i, index; 41 | CString str; 42 | 43 | CDialog::OnInitDialog(); 44 | 45 | size = pData->parrLQAs->GetSize(); 46 | 47 | ctlList().InsertColumn(0, "Address", LVCFMT_RIGHT, 120); 48 | ctlList().InsertColumn(1, "Frequency", LVCFMT_RIGHT, 64); 49 | ctlList().InsertColumn(2, "Rx BER", LVCFMT_RIGHT, 50); 50 | ctlList().InsertColumn(3, "Rx SNR", LVCFMT_RIGHT, 53); 51 | ctlList().InsertColumn(4, "Rx Time", LVCFMT_CENTER, 100); 52 | ctlList().InsertColumn(5, "Tx BER", LVCFMT_RIGHT, 50); 53 | ctlList().InsertColumn(6, "Tx SINAD", LVCFMT_RIGHT, 61); 54 | ctlList().InsertColumn(7, "Tx Time", LVCFMT_CENTER, 100); 55 | 56 | for (i = 0; i < size; i++) { 57 | lqa = pData->parrLQAs->GetAt(i); 58 | index = ctlList().InsertItem(i, lqa.strOtherAddr); 59 | str.Format("%lf", lqa.dRxFreq); 60 | ctlList().SetItemText(index, 1, str); 61 | str.Format("%d", lqa.RxBER.value); 62 | ctlList().SetItemText(index, 2, str); 63 | str.Format("%d", lqa.RxSNR.value); 64 | ctlList().SetItemText(index, 3, str); 65 | str = lqa.RxBER.time.Format("%m/%d/%y %H:%M"); 66 | ctlList().SetItemText(index, 4, str); 67 | str.Format("%d", lqa.TxBER.value); 68 | ctlList().SetItemText(index, 5, str); 69 | str.Format("%d", lqa.TxSINAD.value); 70 | ctlList().SetItemText(index, 6, str); 71 | str = lqa.TxBER.time.Format("%m/%d/%y %H:%M"); 72 | ctlList().SetItemText(index, 7, str); 73 | } 74 | 75 | return TRUE; // return TRUE unless you set the focus to a control 76 | } 77 | 78 | void CSignalQualityDlg::OnDeleteCh() 79 | { 80 | int item, size, i; 81 | double dRxFreq; 82 | CString strOtherAddr, str; 83 | struct CALEDoc::LQA lqa; 84 | 85 | POSITION pos = ctlList().GetFirstSelectedItemPosition(); 86 | if (pos == NULL) { 87 | MessageBox("There isn't anything selected to delete!", "Alert", MB_OK); 88 | } else { 89 | while (pos) { 90 | item = ctlList().GetNextSelectedItem(pos); 91 | strOtherAddr = ctlList().GetItemText(item, 0); 92 | str = ctlList().GetItemText(item, 1); 93 | sscanf((LPCTSTR) str, "%lf", &dRxFreq); 94 | 95 | size = pData->parrLQAs->GetSize(); 96 | for (i = 0; i < size; i++) { 97 | lqa = pData->parrLQAs->GetAt(i); 98 | if ((lqa.strOtherAddr == strOtherAddr) && (lqa.dRxFreq == dRxFreq)) { 99 | pData->parrLQAs->RemoveAt(i); 100 | break; 101 | } 102 | } 103 | 104 | ctlList().DeleteItem(item); 105 | pos = ctlList().GetFirstSelectedItemPosition(); 106 | } 107 | } 108 | } 109 | 110 | void CSignalQualityDlg::LqaModified(UINT wEditType, LONG index) 111 | { 112 | struct CALEDoc::LQA lqa; 113 | int size, index2; 114 | double dRxFreq; 115 | CString strOtherAddr, str; 116 | 117 | lqa = pData->parrLQAs->GetAt(index); 118 | if (wEditType == 1) { 119 | // An lqa record has changed 120 | // Find the right entry in the list 121 | size = ctlList().GetItemCount(); 122 | for (index2 = 0; index2 < size; index2++) { 123 | strOtherAddr = ctlList().GetItemText(index2, 0); 124 | if (lqa.strOtherAddr == strOtherAddr) { 125 | str = ctlList().GetItemText(index2, 1); 126 | sscanf((LPCTSTR) str, "%lf", &dRxFreq); 127 | if (lqa.dRxFreq == dRxFreq) 128 | // We have the right entry 129 | break; 130 | } 131 | } 132 | } else { 133 | // A new lqa record has been added 134 | index2 = ctlList().InsertItem(index, lqa.strOtherAddr); 135 | str.Format("%lf", lqa.dRxFreq); 136 | ctlList().SetItemText(index2, 1, str); 137 | } 138 | 139 | str.Format("%d", lqa.RxBER.value); 140 | ctlList().SetItemText(index2, 2, str); 141 | str.Format("%d", lqa.RxSNR.value); 142 | ctlList().SetItemText(index2, 3, str); 143 | str = lqa.RxBER.time.Format("%m/%d/%y %H:%M"); 144 | ctlList().SetItemText(index2, 4, str); 145 | str.Format("%d", lqa.TxBER.value); 146 | ctlList().SetItemText(index2, 5, str); 147 | str.Format("%d", lqa.TxSINAD.value); 148 | ctlList().SetItemText(index2, 6, str); 149 | str = lqa.TxBER.time.Format("%m/%d/%y %H:%M"); 150 | ctlList().SetItemText(index2, 7, str); 151 | } 152 | 153 | void CSignalQualityDlg::OnCancel() 154 | { 155 | DestroyWindow(); 156 | } 157 | 158 | void CSignalQualityDlg::PostNcDestroy() 159 | { 160 | view->pSQDlg = NULL; 161 | delete this; 162 | } 163 | -------------------------------------------------------------------------------- /SourceALE/SelfAddrDlg.cpp: -------------------------------------------------------------------------------- 1 | // SelfAddrDlg.cpp : implementation file 2 | // 26 Oct 1999 3 | 4 | #include "stdafx.h" 5 | #include "ALE.h" 6 | #include "ALEDoc.h" 7 | #include "SelfAddrDlg.h" 8 | #include "Dlgfloat.h" 9 | 10 | #ifdef _DEBUG 11 | #define new DEBUG_NEW 12 | #undef THIS_FILE 13 | static char THIS_FILE[] = __FILE__; 14 | #endif 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // CSelfAddrDlg dialog 18 | 19 | 20 | CSelfAddrDlg::CSelfAddrDlg(CWnd* pParent /*=NULL*/) 21 | : CDialog(CSelfAddrDlg::IDD, pParent) 22 | { 23 | //{{AFX_DATA_INIT(CSelfAddrDlg) 24 | // NOTE: the ClassWizard will add member initialization here 25 | //}}AFX_DATA_INIT 26 | } 27 | 28 | 29 | BEGIN_MESSAGE_MAP(CSelfAddrDlg, CDialog) 30 | //{{AFX_MSG_MAP(CSelfAddrDlg) 31 | //}}AFX_MSG_MAP 32 | END_MESSAGE_MAP() 33 | 34 | ///////////////////////////////////////////////////////////////////////////// 35 | // CSelfAddrDlg message handlers 36 | 37 | BOOL CSelfAddrDlg::OnInitDialog() 38 | { 39 | CString str; 40 | struct CALEDoc::SELFADDR sa; 41 | struct CALEDoc::CHANNEL ch; 42 | int i; 43 | 44 | CDialog::OnInitDialog(); 45 | 46 | // Add the list of channels to the list box 47 | int size = pData->parrChannels->GetSize(); 48 | for (i = 0; i < size; i++) { 49 | ch = pData->parrChannels->GetAt(i); 50 | str.Format("%f", ch.dRecFreq); 51 | ctlChannelList().AddString(str); 52 | } 53 | 54 | if (bNew) { 55 | ctlSlotWait().SetWindowText("0"); 56 | } else { 57 | sa = pData->parrSelfAddrs->GetAt(pos); 58 | ctlSelfAddr().SetWindowText(sa.strSelfAddr); 59 | ctlNetAddr().SetWindowText(sa.strNetAddr); 60 | str.Format("%d", sa.m_nSlotWait); 61 | ctlSlotWait().SetWindowText(str); 62 | for (i = 0; i < size; i++) { 63 | if (sa.parrValidChannels->GetAt(i)) 64 | ctlChannelList().SetSel(i); 65 | } 66 | } 67 | 68 | ctlSelfAddr().SetLimitText(15); 69 | ctlNetAddr().SetLimitText(15); 70 | 71 | return TRUE; // return TRUE unless you set the focus to a control 72 | } 73 | 74 | void CSelfAddrDlg::OnOK() 75 | { 76 | CString str; 77 | long SlotWait; 78 | struct CALEDoc::SELFADDR sa, sa2; 79 | int i, len1, len2, cntsa; 80 | BOOLEAN bChSelected, bChOK; 81 | 82 | // Check the Self Address. It must contain only upper case letters or 83 | // numbers, a maximum of 15 characters, and the first entry can be a 84 | // maximum of three characters. (The control enforces caps and a length 85 | // limit of 15.) Null entries are OK. 86 | cntsa = pData->parrSelfAddrs->GetSize(); 87 | ctlSelfAddr().GetWindowText(str); 88 | len1 = str.GetLength(); 89 | if (((cntsa == 0) || (pos == 0)) && (len1 > 3)) { 90 | MessageBox("The first self address cannot be longer than 3 characters"); 91 | ctlSelfAddr().SetFocus(); 92 | ctlSelfAddr().SetSel(0, -1); 93 | return; 94 | } 95 | for (i = 0; i < len1; i++) { 96 | if (!isalnum(str[i])) { 97 | MessageBox("Addresses can contain only letters and numbers"); 98 | ctlSelfAddr().SetFocus(); 99 | ctlSelfAddr().SetSel(0, -1); 100 | return; 101 | } 102 | } 103 | sa.strSelfAddr = str; 104 | 105 | // Check the Network Address. It must contain only upper case letters or 106 | // numbers and a maximum of 15 characters. (The control enforces caps and a length 107 | // limit of 15.) Null entries are OK. 108 | ctlNetAddr().GetWindowText(str); 109 | len2 = str.GetLength(); 110 | for (i = 0; i < len2; i++) { 111 | if (!isalnum(str[i])) { 112 | MessageBox("Addresses can contain only letters and numbers"); 113 | ctlNetAddr().SetFocus(); 114 | ctlNetAddr().SetSel(0, -1); 115 | return; 116 | } 117 | } 118 | if ((len1 == 0) && (len2 == 0)) { 119 | MessageBox("The Self and Network Address cannot both be empty."); 120 | ctlNetAddr().SetFocus(); 121 | ctlNetAddr().SetSel(0, -1); 122 | return; 123 | } 124 | sa.strNetAddr = str; 125 | 126 | // Check the Slot Wait. Reject non-integers, bad characters, negative numbers. 127 | // Zero is OK, but null entries will be rejected. 128 | ctlSlotWait().GetWindowText(str); 129 | if (!_AfxSimpleLongParse(str, SlotWait) || (SlotWait < 0)) { 130 | MessageBox("The Slot Wait must be a positive integer or zero."); 131 | ctlSlotWait().SetFocus(); 132 | ctlSlotWait().SetSel(0, -1); 133 | return; 134 | } 135 | sa.m_nSlotWait = SlotWait; 136 | 137 | // Set the array of channels selected. 138 | bChOK = FALSE; 139 | sa.parrValidChannels = new (CArray< BOOLEAN, BOOLEAN >); 140 | len1 = pData->parrChannels->GetSize(); 141 | for (i = 0; i < len1; i++) { 142 | if (bChSelected = ctlChannelList().GetSel(i)) 143 | bChOK = TRUE; 144 | sa.parrValidChannels->Add(bChSelected); 145 | } 146 | 147 | // There must be at least one channel selected 148 | if (!bChOK) { 149 | MessageBox("At least one channel must be selected."); 150 | ctlChannelList().SetFocus(); 151 | delete sa.parrValidChannels; 152 | return; 153 | } 154 | 155 | // Everything should be OK. Save the data 156 | if (bNew) { 157 | // Default for sounding is off, but don't change preexisting values 158 | sa.bSoundingOn = FALSE; 159 | if (pos == -1) 160 | pos = pData->parrSelfAddrs->Add(sa); 161 | else 162 | pData->parrSelfAddrs->InsertAt(pos, sa); 163 | } else { 164 | sa2 = pData->parrSelfAddrs->GetAt(pos); 165 | delete sa2.parrValidChannels; 166 | pData->parrSelfAddrs->SetAt(pos, sa); 167 | } 168 | 169 | CDialog::OnOK(); 170 | } 171 | -------------------------------------------------------------------------------- /SourceCal/Calibrate.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="Calibrate" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | # ** DO NOT EDIT ** 4 | 5 | # TARGTYPE "Win32 (x86) Application" 0x0101 6 | 7 | CFG=Calibrate - Win32 Debug 8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE, 9 | !MESSAGE use the Export Makefile command and run 10 | !MESSAGE 11 | !MESSAGE NMAKE /f "Calibrate.mak". 12 | !MESSAGE 13 | !MESSAGE You can specify a configuration when running NMAKE 14 | !MESSAGE by defining the macro CFG on the command line. For example: 15 | !MESSAGE 16 | !MESSAGE NMAKE /f "Calibrate.mak" CFG="Calibrate - Win32 Debug" 17 | !MESSAGE 18 | !MESSAGE Possible choices for configuration are: 19 | !MESSAGE 20 | !MESSAGE "Calibrate - Win32 Release" (based on "Win32 (x86) Application") 21 | !MESSAGE "Calibrate - Win32 Debug" (based on "Win32 (x86) Application") 22 | !MESSAGE 23 | 24 | # Begin Project 25 | # PROP AllowPerConfigDependencies 0 26 | # PROP Scc_ProjName "" 27 | # PROP Scc_LocalPath "" 28 | CPP=cl.exe 29 | MTL=midl.exe 30 | RSC=rc.exe 31 | 32 | !IF "$(CFG)" == "Calibrate - Win32 Release" 33 | 34 | # PROP BASE Use_MFC 6 35 | # PROP BASE Use_Debug_Libraries 0 36 | # PROP BASE Output_Dir "Release" 37 | # PROP BASE Intermediate_Dir "Release" 38 | # PROP BASE Target_Dir "" 39 | # PROP Use_MFC 6 40 | # PROP Use_Debug_Libraries 0 41 | # PROP Output_Dir "Release" 42 | # PROP Intermediate_Dir "Release" 43 | # PROP Ignore_Export_Lib 0 44 | # PROP Target_Dir "" 45 | # ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c 46 | # ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /c 47 | # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 48 | # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 49 | # ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" 50 | # ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" 51 | BSC32=bscmake.exe 52 | # ADD BASE BSC32 /nologo 53 | # ADD BSC32 /nologo 54 | LINK32=link.exe 55 | # ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 56 | # ADD LINK32 dsound.lib dxguid.lib /nologo /subsystem:windows /machine:I386 57 | # SUBTRACT LINK32 /pdb:none 58 | 59 | !ELSEIF "$(CFG)" == "Calibrate - Win32 Debug" 60 | 61 | # PROP BASE Use_MFC 6 62 | # PROP BASE Use_Debug_Libraries 1 63 | # PROP BASE Output_Dir "Debug" 64 | # PROP BASE Intermediate_Dir "Debug" 65 | # PROP BASE Target_Dir "" 66 | # PROP Use_MFC 6 67 | # PROP Use_Debug_Libraries 1 68 | # PROP Output_Dir "Debug" 69 | # PROP Intermediate_Dir "Debug" 70 | # PROP Ignore_Export_Lib 0 71 | # PROP Target_Dir "" 72 | # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c 73 | # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FR /Yu"stdafx.h" /FD /GZ /c 74 | # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 75 | # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 76 | # ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" 77 | # ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" 78 | BSC32=bscmake.exe 79 | # ADD BASE BSC32 /nologo 80 | # ADD BSC32 /nologo 81 | LINK32=link.exe 82 | # ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept 83 | # ADD LINK32 dsound.lib dxguid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept 84 | 85 | !ENDIF 86 | 87 | # Begin Target 88 | 89 | # Name "Calibrate - Win32 Release" 90 | # Name "Calibrate - Win32 Debug" 91 | # Begin Group "Source Files" 92 | 93 | # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" 94 | # Begin Source File 95 | 96 | SOURCE=.\CalDlg.cpp 97 | # End Source File 98 | # Begin Source File 99 | 100 | SOURCE=.\Calibrate.cpp 101 | # End Source File 102 | # Begin Source File 103 | 104 | SOURCE=.\Calibrate.rc 105 | # End Source File 106 | # Begin Source File 107 | 108 | SOURCE=.\CalibrateDoc.cpp 109 | # End Source File 110 | # Begin Source File 111 | 112 | SOURCE=.\CalibrateView.cpp 113 | # End Source File 114 | # Begin Source File 115 | 116 | SOURCE=.\HDAudio.cpp 117 | # End Source File 118 | # Begin Source File 119 | 120 | SOURCE=.\MainFrm.cpp 121 | # End Source File 122 | # Begin Source File 123 | 124 | SOURCE=.\StdAfx.cpp 125 | # ADD CPP /Yc"stdafx.h" 126 | # End Source File 127 | # End Group 128 | # Begin Group "Header Files" 129 | 130 | # PROP Default_Filter "h;hpp;hxx;hm;inl" 131 | # Begin Source File 132 | 133 | SOURCE=.\CalDlg.h 134 | # End Source File 135 | # Begin Source File 136 | 137 | SOURCE=.\Calibrate.h 138 | # End Source File 139 | # Begin Source File 140 | 141 | SOURCE=.\CalibrateDoc.h 142 | # End Source File 143 | # Begin Source File 144 | 145 | SOURCE=.\CalibrateView.h 146 | # End Source File 147 | # Begin Source File 148 | 149 | SOURCE=.\HDAudio.h 150 | # End Source File 151 | # Begin Source File 152 | 153 | SOURCE=.\MainFrm.h 154 | # End Source File 155 | # Begin Source File 156 | 157 | SOURCE=.\Resource.h 158 | # End Source File 159 | # Begin Source File 160 | 161 | SOURCE=.\StdAfx.h 162 | # End Source File 163 | # End Group 164 | # Begin Group "Resource Files" 165 | 166 | # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" 167 | # Begin Source File 168 | 169 | SOURCE=.\res\Calibrate.ico 170 | # End Source File 171 | # Begin Source File 172 | 173 | SOURCE=.\res\Calibrate.rc2 174 | # End Source File 175 | # Begin Source File 176 | 177 | SOURCE=.\res\CalibrateDoc.ico 178 | # End Source File 179 | # Begin Source File 180 | 181 | SOURCE=.\res\Toolbar.bmp 182 | # End Source File 183 | # End Group 184 | # Begin Source File 185 | 186 | SOURCE=.\ReadMe.txt 187 | # End Source File 188 | # End Target 189 | # End Project 190 | -------------------------------------------------------------------------------- /SourceALE/OtherAddrDlg.cpp: -------------------------------------------------------------------------------- 1 | // OtherAddrDlg.cpp : implementation file 2 | // 30 Mar 1999 3 | 4 | #include "stdafx.h" 5 | #include "ALE.h" 6 | #include "ALEDoc.h" 7 | #include "OtherAddrDlg.h" 8 | #include "SlotList.h" 9 | #include "Dlgfloat.h" 10 | 11 | #ifdef _DEBUG 12 | #define new DEBUG_NEW 13 | #undef THIS_FILE 14 | static char THIS_FILE[] = __FILE__; 15 | #endif 16 | 17 | ///////////////////////////////////////////////////////////////////////////// 18 | // COtherAddrDlg dialog 19 | 20 | 21 | COtherAddrDlg::COtherAddrDlg(CWnd* pParent /*=NULL*/) 22 | : CDialog(COtherAddrDlg::IDD, pParent) 23 | { 24 | //{{AFX_DATA_INIT(COtherAddrDlg) 25 | // NOTE: the ClassWizard will add member initialization here 26 | //}}AFX_DATA_INIT 27 | } 28 | 29 | 30 | BEGIN_MESSAGE_MAP(COtherAddrDlg, CDialog) 31 | //{{AFX_MSG_MAP(COtherAddrDlg) 32 | ON_BN_CLICKED(IDC_BUTTON1, OnEditSlots) 33 | //}}AFX_MSG_MAP 34 | END_MESSAGE_MAP() 35 | 36 | ///////////////////////////////////////////////////////////////////////////// 37 | // COtherAddrDlg message handlers 38 | 39 | BOOL COtherAddrDlg::OnInitDialog() 40 | { 41 | CString str; 42 | struct CALEDoc::OTHERADDR oa; 43 | struct CALEDoc::CHANNEL ch; 44 | int i; 45 | 46 | CDialog::OnInitDialog(); 47 | 48 | // Add the list of channels to the list box 49 | int size = pData->parrChannels->GetSize(); 50 | for (i = 0; i < size; i++) { 51 | ch = pData->parrChannels->GetAt(i); 52 | str.Format("%f", ch.dRecFreq); 53 | ctlChannelList().AddString(str); 54 | } 55 | 56 | if (bNew) { 57 | ctlReplyWait().SetWindowText("0"); 58 | } else { 59 | oa = pData->parrOtherAddrs->GetAt(pos); 60 | ctlOtherAddr().SetWindowText(oa.strOtherAddr); 61 | str.Format("%f", oa.dReplyWait); 62 | ctlReplyWait().SetWindowText(str); 63 | 64 | for (i = 0; i < size; i++) { 65 | if (oa.parrValidChannels->GetAt(i)) 66 | ctlChannelList().SetSel(i); 67 | } 68 | 69 | size = oa.pSlotStrings->GetSize(); 70 | for (i = 0; i < size; i++) { 71 | ctlSlotList().AddString(oa.pSlotStrings->GetAt(i)); 72 | LocalSlotStrings.Add(oa.pSlotStrings->GetAt(i)); 73 | } 74 | } 75 | 76 | ctlOtherAddr().SetLimitText(15); 77 | 78 | return TRUE; // return TRUE unless you set the focus to a control 79 | } 80 | 81 | void COtherAddrDlg::OnEditSlots() 82 | { 83 | // Run the dialog box for changing the slot addresses. Assume the dialog box 84 | // checks that all data is correct and complete. 85 | 86 | CSlotList dlg(this); 87 | dlg.pSlotStrings = &LocalSlotStrings; 88 | if (dlg.DoModal() == IDOK) { 89 | // Redisplay the list contol with the new Slot Addresses. 90 | ctlSlotList().ResetContent(); 91 | int size = LocalSlotStrings.GetSize(); 92 | for (int i = 0; i < size; i++) { 93 | ctlSlotList().AddString(LocalSlotStrings.GetAt(i)); 94 | } 95 | 96 | pData->pDoc->SetModifiedFlag(); 97 | } 98 | } 99 | 100 | void COtherAddrDlg::OnOK() 101 | { 102 | CString str; 103 | double ReplyWait; 104 | struct CALEDoc::OTHERADDR oa, oa2; 105 | int i, len, cntoa; 106 | BOOLEAN bChanOK, bChanSelected; 107 | 108 | // Check the Other Address. It must contain only upper case letters or 109 | // numbers, a maximum of 15 characters, and the address must be unique 110 | // within the list. (The control enforces caps and a length 111 | // limit of 15.) Null entries are not OK. 112 | cntoa = pData->parrOtherAddrs->GetSize(); 113 | ctlOtherAddr().GetWindowText(str); 114 | len = str.GetLength(); 115 | if (len == 0) { 116 | MessageBox("The other address field cannot be empty."); 117 | ctlOtherAddr().SetFocus(); 118 | ctlOtherAddr().SetSel(0, -1); 119 | return; 120 | } 121 | 122 | for (i = 0; i < len; i++) { 123 | if (!isalnum(str[i])) { 124 | MessageBox("Addresses can contain only (upper case) letters and numbers."); 125 | ctlOtherAddr().SetFocus(); 126 | ctlOtherAddr().SetSel(0, -1); 127 | return; 128 | } 129 | } 130 | 131 | // Check for a dup other address, but if we are editing, accept a string that 132 | // is unchanged. 133 | for (i = 0; i < cntoa; i++) { 134 | if (str == pData->parrOtherAddrs->GetAt(i).strOtherAddr && (bNew || i != pos)) { 135 | MessageBox("Other Addresses must be unique."); 136 | ctlOtherAddr().SetFocus(); 137 | ctlOtherAddr().SetSel(0, -1); 138 | return; 139 | } 140 | } 141 | oa.strOtherAddr = str; 142 | 143 | // Check the Reply Wait. Reject bad characters, negative numbers. 144 | // Zero is OK, but null entries will be rejected. 145 | ctlReplyWait().GetWindowText(str); 146 | if (!_AfxSimpleFloatParse(str, ReplyWait) || (ReplyWait < 0)) { 147 | MessageBox("The Reply Wait must be a positive number or zero."); 148 | ctlReplyWait().SetFocus(); 149 | ctlReplyWait().SetSel(0, -1); 150 | return; 151 | } 152 | oa.dReplyWait = ReplyWait; 153 | 154 | // Set the array of channels selected. 155 | bChanOK = FALSE; 156 | oa.parrValidChannels = new (CArray< BOOLEAN, BOOLEAN >); 157 | len = pData->parrChannels->GetSize(); 158 | for (i = 0; i < len; i++) { 159 | if (bChanSelected = ctlChannelList().GetSel(i)) 160 | bChanOK = TRUE; 161 | oa.parrValidChannels->Add(bChanSelected); 162 | } 163 | 164 | // There must be at least one channel selected 165 | if (!bChanOK) { 166 | MessageBox("At least one channel must be selected."); 167 | ctlChannelList().SetFocus(); 168 | delete oa.parrValidChannels; 169 | return; 170 | } 171 | 172 | // Set the string array for the slot addresses 173 | oa.pSlotStrings = new (CStringArray); 174 | len = LocalSlotStrings.GetSize(); 175 | for (i = 0; i < len; i++) 176 | oa.pSlotStrings->Add(LocalSlotStrings.GetAt(i)); 177 | 178 | // Everything should be OK. Save the data 179 | if (bNew) { 180 | if (pos == -1) 181 | pos = pData->parrOtherAddrs->Add(oa); 182 | else 183 | pData->parrOtherAddrs->InsertAt(pos, oa); 184 | } else { 185 | oa2 = pData->parrOtherAddrs->GetAt(pos); 186 | delete oa2.parrValidChannels; 187 | delete oa2.pSlotStrings; 188 | pData->parrOtherAddrs->SetAt(pos, oa); 189 | } 190 | 191 | CDialog::OnOK(); 192 | } 193 | 194 | -------------------------------------------------------------------------------- /SourceALE/ChannelDlg.cpp: -------------------------------------------------------------------------------- 1 | // ChannelDlg.cpp : implementation file 2 | // 19 Nov 1999 3 | 4 | #include "stdafx.h" 5 | #include "ALE.h" 6 | #include "ALEDoc.h" 7 | #include "ChannelDlg.h" 8 | #include "Dlgfloat.h" 9 | 10 | #ifdef _DEBUG 11 | #define new DEBUG_NEW 12 | #undef THIS_FILE 13 | static char THIS_FILE[] = __FILE__; 14 | #endif 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // CChannelDlg dialog 18 | 19 | 20 | CChannelDlg::CChannelDlg(CWnd* pParent /*=NULL*/) 21 | : CDialog(CChannelDlg::IDD, pParent) 22 | { 23 | //{{AFX_DATA_INIT(CChannelDlg) 24 | //}}AFX_DATA_INIT 25 | } 26 | 27 | 28 | BEGIN_MESSAGE_MAP(CChannelDlg, CDialog) 29 | //{{AFX_MSG_MAP(CChannelDlg) 30 | //}}AFX_MSG_MAP 31 | END_MESSAGE_MAP() 32 | 33 | ///////////////////////////////////////////////////////////////////////////// 34 | // CChannelDlg message handlers 35 | 36 | BOOL CChannelDlg::OnInitDialog() 37 | { 38 | CString str; 39 | struct CALEDoc::CHANNEL ch; 40 | 41 | CDialog::OnInitDialog(); 42 | 43 | // Initialize the ComboBox controls 44 | ctlComboTxMode().AddString("USB"); 45 | ctlComboTxMode().AddString("LSB"); 46 | ctlComboTxMode().AddString("CW"); 47 | ctlComboTxMode().AddString("AM"); 48 | ctlComboRxMode().AddString("USB"); 49 | ctlComboRxMode().AddString("LSB"); 50 | ctlComboRxMode().AddString("CW"); 51 | ctlComboRxMode().AddString("AM"); 52 | ctlComboTRMode().AddString("Rx Only"); 53 | ctlComboTRMode().AddString("Tx/Rx"); 54 | ctlComboScanMode().AddString("On"); 55 | ctlComboScanMode().AddString("Off"); 56 | 57 | if (bNew) { 58 | ctlComboTxMode().SelectString(-1, "USB"); 59 | ctlComboRxMode().SelectString(-1, "USB"); 60 | ctlComboTRMode().SelectString(-1, "Tx/Rx"); 61 | ctlComboScanMode().SelectString(-1, "On"); 62 | ctlSoundInt().SetWindowText("0"); 63 | } else { 64 | ch = pData->parrChannels->GetAt(pos); 65 | str.Format("%f", ch.dTransFreq); 66 | ctlTxFreq().SetWindowText(str); 67 | 68 | if (ch.eTransMode == CRadio::USB) 69 | str = "USB"; 70 | else if (ch.eTransMode == CRadio::LSB) 71 | str = "LSB"; 72 | else if (ch.eTransMode == CRadio::CW) 73 | str = "CW"; 74 | else if (ch.eTransMode == CRadio::AM) 75 | str = "AM"; 76 | ctlComboTxMode().SelectString(-1, str); 77 | 78 | str.Format("%f", ch.dRecFreq); 79 | ctlRxFreq().SetWindowText(str); 80 | 81 | if (ch.eRecMode == CRadio::USB) 82 | str = "USB"; 83 | else if (ch.eRecMode == CRadio::LSB) 84 | str = "LSB"; 85 | else if (ch.eRecMode == CRadio::CW) 86 | str = "CW"; 87 | else if (ch.eRecMode == CRadio::AM) 88 | str = "AM"; 89 | ctlComboRxMode().SelectString(-1, str); 90 | 91 | if (ch.eTRMode == CALEDoc::TR) 92 | str = "Tx/Rx"; 93 | else 94 | str = "Rx Only"; 95 | ctlComboTRMode().SelectString(-1, str); 96 | 97 | if (ch.bScanMode) 98 | str = "On"; 99 | else 100 | str = "Off"; 101 | ctlComboScanMode().SelectString(-1, str); 102 | 103 | str.Format("%.1f", ch.dSoundInterval); 104 | ctlSoundInt().SetWindowText(str); 105 | } 106 | return TRUE; // return TRUE unless you set the focus to a control 107 | } 108 | 109 | void CChannelDlg::OnOK() 110 | { 111 | CString str; 112 | double dTxFreq, dRxFreq, dSoundInt; 113 | CRadio::RADIOMODE eTxMode, eRxMode; 114 | CALEDoc::TRMODE eTRMode; 115 | BOOLEAN bScanMode; 116 | struct CALEDoc::CHANNEL ch; 117 | 118 | // Check all the fields for validity 119 | // May need to make these checks radio specific 120 | // Is the transmit frequency in range? 121 | ctlTxFreq().GetWindowText(str); 122 | if (!_AfxSimpleFloatParse(str, dTxFreq) || (dTxFreq > 30.0) || (dTxFreq < 3.0)) { 123 | MessageBox("A valid tranmit frequency must be supplied"); 124 | ctlTxFreq().SetFocus(); 125 | ctlTxFreq().SetSel(0, -1); 126 | return; 127 | } 128 | 129 | // Is the receive frequency in range? 130 | ctlRxFreq().GetWindowText(str); 131 | if (!_AfxSimpleFloatParse(str, dRxFreq) || (dRxFreq > 30.0) || (dRxFreq < 3.0)) { 132 | MessageBox("A valid receive frequency must be supplied"); 133 | ctlRxFreq().SetFocus(); 134 | ctlRxFreq().SetSel(0, -1); 135 | return; 136 | } 137 | 138 | // Is the sound interval valid 139 | ctlSoundInt().GetWindowText(str); 140 | if (!_AfxSimpleFloatParse(str, dSoundInt) || (dSoundInt < 0.0)) { 141 | MessageBox("A valid sound interval must be supplied"); 142 | ctlSoundInt().SetFocus(); 143 | ctlSoundInt().SetSel(0, -1); 144 | return; 145 | } 146 | 147 | // Receive only cannot be selected with sounding on 148 | ctlComboTRMode().GetWindowText(str); 149 | eTRMode = str.Compare("Rx Only") ? CALEDoc::TR : CALEDoc::RECONLY; 150 | if ((dSoundInt > 0) && (eTRMode == CALEDoc::RECONLY)) { 151 | MessageBox("Having a channel Receive Only is incompatible with Sounding on the channel.\nEither allow transmissions or set the Sounding Interval to 0."); 152 | ctlComboTRMode().SetFocus(); 153 | return; 154 | } 155 | 156 | // Everything should be OK. Save the data 157 | ctlComboTxMode().GetWindowText(str); 158 | if (str.Compare("USB") == 0) 159 | eTxMode = CRadio::USB; 160 | else if (str.Compare("LSB") == 0) 161 | eTxMode = CRadio::LSB; 162 | else if (str.Compare("CW") == 0) 163 | eTxMode = CRadio::CW; 164 | else if (str.Compare("AM") == 0) 165 | eTxMode = CRadio::AM; 166 | ctlComboRxMode().GetWindowText(str); 167 | if (str.Compare("USB") == 0) 168 | eRxMode = CRadio::USB; 169 | else if (str.Compare("LSB") == 0) 170 | eRxMode = CRadio::LSB; 171 | else if (str.Compare("CW") == 0) 172 | eRxMode = CRadio::CW; 173 | else if (str.Compare("AM") == 0) 174 | eRxMode = CRadio::AM; 175 | ctlComboScanMode().GetWindowText(str); 176 | bScanMode = (BOOLEAN) str.Compare("Off"); 177 | 178 | ch.dTransFreq = dTxFreq; 179 | ch.eTransMode = eTxMode; 180 | ch.dRecFreq = dRxFreq; 181 | ch.eRecMode = eRxMode; 182 | ch.eTRMode = eTRMode; 183 | ch.bScanMode = bScanMode; 184 | ch.dSoundInterval = dSoundInt; 185 | 186 | if (bNew) { 187 | if (pos == -1) 188 | pos = pData->parrChannels->Add(ch); 189 | else 190 | pData->parrChannels->InsertAt(pos, ch); 191 | } else { 192 | pData->parrChannels->SetAt(pos, ch); 193 | } 194 | 195 | CDialog::OnOK(); 196 | } 197 | -------------------------------------------------------------------------------- /SourceALE/SunTimes.cpp: -------------------------------------------------------------------------------- 1 | // SunTimes.cpp: implementation of the CSunTimes class. 2 | // 19 Oct 1999 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #include "stdafx.h" 6 | #include "ALE.h" 7 | #include "SunTimes.h" 8 | #include 9 | 10 | #ifdef _DEBUG 11 | #undef THIS_FILE 12 | static char THIS_FILE[]=__FILE__; 13 | #define new DEBUG_NEW 14 | #endif 15 | 16 | ////////////////////////////////////////////////////////////////////// 17 | // Construction/Destruction 18 | ////////////////////////////////////////////////////////////////////// 19 | 20 | CSunTimes::CSunTimes() 21 | { 22 | PI = 4.0 * atan(1.0); 23 | } 24 | 25 | 26 | CSunTimes::~CSunTimes() 27 | { 28 | 29 | } 30 | 31 | 32 | double CSunTimes::GetSunRiseGMT(double latitude, double longitude) 33 | // Calculates the time of the sunrise for the current day (as read from the system clock) 34 | // latitude and longitude are in degrees. 35 | // Returned value is Sun Rise time in minutes (from midnight) 36 | { 37 | int julDay; 38 | double dGamma, dEqTime, dSolarDec, dHourAngle, dGammaSunrise, dDelta; 39 | double dTimeDiff, dTimeGMT; 40 | CTime timeCur = CTime::GetCurrentTime(); 41 | 42 | julDay = JulianDay(timeCur.GetMonth(), timeCur.GetDay(), 43 | IsLeapYear(timeCur.GetYear())); 44 | 45 | // *** First pass to approximate sunrise 46 | dGamma = CalcGamma(julDay); 47 | dEqTime = CalcEqofTime(dGamma); 48 | dSolarDec = CalcSolarDec(dGamma); 49 | dHourAngle = CalcHourAngle(latitude, dSolarDec, TRUE); 50 | dDelta = longitude - RadToDeg(dHourAngle); 51 | dTimeDiff = 4.0 * dDelta; 52 | dTimeGMT = 720.0 + dTimeDiff - dEqTime; 53 | 54 | // *** Second pass includes fractional jday in gamma calc 55 | 56 | dGammaSunrise = CalcGamma2(julDay, dTimeGMT / 60.0); 57 | dEqTime = CalcEqofTime(dGammaSunrise); 58 | dSolarDec = CalcSolarDec(dGammaSunrise); 59 | dHourAngle = CalcHourAngle(latitude, dSolarDec, TRUE); 60 | dDelta = longitude - RadToDeg(dHourAngle); 61 | dTimeDiff = 4.0 * dDelta; 62 | dTimeGMT = 720.0 + dTimeDiff - dEqTime; // in minutes 63 | 64 | return dTimeGMT; 65 | } 66 | 67 | 68 | double CSunTimes::GetSunSetGMT(double latitude, double longitude) 69 | // Calculates the time of the Sunset for the current day (as read from the system clock) 70 | // latitude and longitude are in degrees. 71 | // Returned value is Sun Set time in minutes (from midnight) 72 | { 73 | int julDay; 74 | double dGamma, dEqTime, dSolarDec, dHourAngle, dGammaSunset, dDelta; 75 | double dTimeDiff, dSetTimeGMT; 76 | CTime timeCur = CTime::GetCurrentTime(); 77 | 78 | julDay = JulianDay(timeCur.GetMonth(), timeCur.GetDay(), 79 | IsLeapYear(timeCur.GetYear())); 80 | 81 | // First calculates sunrise and approx length of day 82 | dGamma = CalcGamma(julDay); 83 | dEqTime = CalcEqofTime(dGamma); 84 | dSolarDec = CalcSolarDec(dGamma); 85 | dHourAngle = CalcHourAngle(latitude, dSolarDec, FALSE); 86 | dDelta = longitude - RadToDeg(dHourAngle); 87 | dTimeDiff = 4.0 * dDelta; 88 | dSetTimeGMT = 720.0 + dTimeDiff - dEqTime; 89 | 90 | // first pass used to include fractional day in gamma calc 91 | 92 | dGammaSunset = CalcGamma2(julDay, dSetTimeGMT / 60.0); 93 | dEqTime = CalcEqofTime(dGammaSunset); 94 | dSolarDec = CalcSolarDec(dGammaSunset); 95 | dHourAngle = CalcHourAngle(latitude, dSolarDec, FALSE); 96 | dDelta = longitude - RadToDeg(dHourAngle); 97 | dTimeDiff = 4.0 * dDelta; 98 | dSetTimeGMT = 720.0 + dTimeDiff - dEqTime; // in minutes 99 | 100 | return dSetTimeGMT; 101 | } 102 | 103 | 104 | int CSunTimes::JulianDay(int mn, int dy, int lpyr) 105 | // Calculates the Julian day. mn is the month (Jan = 1), 106 | // dy is the day of the month, lpyr = 1 for leap years or 0 otherwise. 107 | { 108 | int i, julDay = 0; 109 | int monthList[11] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30}; 110 | 111 | for (i = 0; i < mn - 1; i++) 112 | julDay += monthList[i]; 113 | 114 | if (mn >= 2) 115 | julDay += lpyr; 116 | 117 | julDay += dy; 118 | 119 | return julDay; 120 | } 121 | 122 | 123 | int CSunTimes::IsLeapYear(int yr) 124 | // IsLeapYear returns 1 if the yr is a leap year, 0 if it is not. 125 | { 126 | return ((yr % 4 == 0 && yr % 100 != 0) || yr % 400 == 0); 127 | } 128 | 129 | 130 | double CSunTimes::CalcGamma(int julianDay) 131 | // Returns the gamma value that is used in the calculation for the 132 | // equation of time and the solar declination. 133 | { 134 | return (2.0 * PI / 365.0) * (julianDay - 1.0); 135 | } 136 | 137 | 138 | 139 | double CSunTimes::CalcGamma2(int julianDay, double hour) 140 | // Returns the gamma value used to calculate eq of time 141 | // and solar declination. 142 | { 143 | return (2.0 * PI / 365) * (julianDay - 1 + (hour / 24.0)); 144 | } 145 | 146 | 147 | double CSunTimes::CalcEqofTime(double gamma) 148 | // Return the equation of time value for the given date. 149 | { 150 | return (229.18 * (0.000075 + 0.001868 * cos(gamma) - 0.032077 * sin(gamma) 151 | - 0.014615 * cos(2 * gamma) - 0.040849 * sin(2 * gamma))); 152 | } 153 | 154 | 155 | double CSunTimes::CalcSolarDec(double gamma) 156 | // Return the solar declination angle (in radians) for the given date. 157 | { 158 | return (0.006918 - 0.399912 * cos(gamma) + 0.070257 * sin(gamma) 159 | - 0.006758 * cos(2 * gamma) + 0.000907 * sin(2 * gamma)); 160 | } 161 | 162 | 163 | double CSunTimes::CalcHourAngle(double lat, double solarDec, BOOL bSunRise) 164 | // The hour angle returned below is only for sunrise/sunset, i.e. when the solar 165 | // zenith angle is 90.8 degrees. 166 | // The reason why it's not 90 degrees is because we need to account for atmoshperic 167 | // refraction. 168 | { 169 | double dLatRad; 170 | 171 | dLatRad = DegToRad(lat); 172 | 173 | if (bSunRise) // if true, then calculationg for sunrise 174 | return (acos(cos(DegToRad(90.833)) / (cos(dLatRad) * cos(solarDec)) 175 | - tan(dLatRad) * tan(solarDec))); 176 | else 177 | return -(acos(cos(DegToRad(90.833)) / (cos(dLatRad) * cos(solarDec)) 178 | - tan(dLatRad) * tan(solarDec))); 179 | } 180 | 181 | 182 | double CSunTimes::DegToRad(double angleDeg) 183 | // Convert degree angle to radians 184 | { 185 | return (PI * angleDeg / 180); 186 | } 187 | 188 | 189 | double CSunTimes::RadToDeg(double angleRad) 190 | // Convert radian angle to degrees 191 | { 192 | return (180.0 * angleRad / PI); 193 | } 194 | 195 | -------------------------------------------------------------------------------- /SourceALE/SlotList.cpp: -------------------------------------------------------------------------------- 1 | // SlotList.cpp : implementation file 2 | // 14 Jan 1999 3 | 4 | #include "stdafx.h" 5 | #include "ALE.h" 6 | #include "SlotList.h" 7 | #include "SlotAddr.h" 8 | 9 | #ifdef _DEBUG 10 | #define new DEBUG_NEW 11 | #undef THIS_FILE 12 | static char THIS_FILE[] = __FILE__; 13 | #endif 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // CSlotList dialog 17 | 18 | 19 | CSlotList::CSlotList(CWnd* pParent /*=NULL*/) 20 | : CDialog(CSlotList::IDD, pParent) 21 | { 22 | //{{AFX_DATA_INIT(CSlotList) 23 | // NOTE: the ClassWizard will add member initialization here 24 | //}}AFX_DATA_INIT 25 | } 26 | 27 | 28 | BEGIN_MESSAGE_MAP(CSlotList, CDialog) 29 | //{{AFX_MSG_MAP(CSlotList) 30 | ON_BN_CLICKED(IDC_ADD_SADDR, OnAddSaddr) 31 | ON_BN_CLICKED(IDC_DELETE_SADDR, OnDeleteSaddr) 32 | ON_BN_CLICKED(IDC_EDIT_SADDR, OnEditSaddr) 33 | ON_BN_CLICKED(IDC_MOVEDOWN, OnMovedown) 34 | ON_BN_CLICKED(IDC_MOVEUP, OnMoveup) 35 | //}}AFX_MSG_MAP 36 | END_MESSAGE_MAP() 37 | 38 | ///////////////////////////////////////////////////////////////////////////// 39 | // CSlotList message handlers 40 | 41 | void CSlotList::DispSlotList() 42 | { 43 | int index; 44 | 45 | int size = pSlotStrings->GetSize(); 46 | 47 | ctlList().InsertColumn(0, "Slot Address", LVCFMT_LEFT, 120); 48 | 49 | for (int i = 0; i < size; i++) { 50 | index = ctlList().InsertItem(i, pSlotStrings->GetAt(i)); 51 | } 52 | 53 | // Enable or disable the arrow buttons on the dialog box depending on how 54 | // many self address entries exist. 55 | if (size >= 2) { 56 | m_ctlMoveUp.EnableWindow(TRUE); 57 | m_ctlMoveDown.EnableWindow(TRUE); 58 | } else { 59 | m_ctlMoveUp.EnableWindow(FALSE); 60 | m_ctlMoveDown.EnableWindow(FALSE); 61 | } 62 | } 63 | 64 | BOOL CSlotList::OnInitDialog() 65 | { 66 | CDialog::OnInitDialog(); 67 | 68 | m_ctlMoveUp.AutoLoad(IDC_MOVEUP, this); 69 | m_ctlMoveDown.AutoLoad(IDC_MOVEDOWN, this); 70 | DispSlotList(); 71 | 72 | return TRUE; // return TRUE unless you set the focus to a control 73 | } 74 | 75 | void CSlotList::OnMovedown() 76 | { 77 | POSITION pos = ctlList().GetFirstSelectedItemPosition(); 78 | if (pos == NULL) { 79 | MessageBox("There isn't a Slot Address selected!", "Alert", MB_OK); 80 | } else if ((int) pos == pSlotStrings->GetSize()) { 81 | MessageBox("The selected item is already last!", "Alert", MB_OK); 82 | } else { 83 | pos--; 84 | // Rearrange the array elements 85 | CString str = pSlotStrings->GetAt((int) pos); 86 | pSlotStrings->RemoveAt((int) pos); 87 | pos++; 88 | pSlotStrings->InsertAt((int) pos, str); 89 | 90 | // Rearrange the list displayed in the dialog box 91 | ctlList().DeleteItem((int) --pos); 92 | ctlList().InsertItem((int) ++pos, str); 93 | 94 | // Keep the item that was deleted and reinserted highlighted 95 | ctlList().SetItemState((int) pos, LVIS_SELECTED | LVIS_FOCUSED, 96 | LVIS_SELECTED | LVIS_FOCUSED); 97 | } 98 | ctlList().SetFocus(); 99 | } 100 | 101 | void CSlotList::OnMoveup() 102 | { 103 | POSITION pos = ctlList().GetFirstSelectedItemPosition(); 104 | if (pos == NULL) { 105 | MessageBox("There isn't a Slot Address selected!", "Alert", MB_OK); 106 | } else if ((int) pos == 1) { 107 | MessageBox("The selected item is already first!", "Alert", MB_OK); 108 | } else { 109 | pos--; 110 | // Rearrange the array elements 111 | CString str = pSlotStrings->GetAt((int) pos); 112 | pSlotStrings->RemoveAt((int) pos); 113 | pos--; 114 | pSlotStrings->InsertAt((int) pos, str); 115 | 116 | // Rearrange the list displayed in the dialog box 117 | ctlList().DeleteItem((int) ++pos); 118 | ctlList().InsertItem((int) --pos, str); 119 | 120 | // Keep the item that was deleted and reinserted highlighted 121 | ctlList().SetItemState((int) pos, LVIS_SELECTED | LVIS_FOCUSED, 122 | LVIS_SELECTED | LVIS_FOCUSED); 123 | } 124 | ctlList().SetFocus(); 125 | } 126 | 127 | void CSlotList::OnDeleteSaddr() 128 | { 129 | CString str; 130 | 131 | POSITION pos = ctlList().GetFirstSelectedItemPosition(); 132 | if (pos == NULL) { 133 | MessageBox("There isn't a Slot Address selected!", "Alert", MB_OK); 134 | } else { 135 | pos--; 136 | ctlList().DeleteItem((int) pos); 137 | pSlotStrings->RemoveAt((int) pos); 138 | 139 | // If the number of self addresses has gone below 2, disable the arrow buttons. 140 | if (pSlotStrings->GetSize() < 2) { 141 | m_ctlMoveUp.EnableWindow(FALSE); 142 | m_ctlMoveDown.EnableWindow(FALSE); 143 | } 144 | } 145 | } 146 | 147 | void CSlotList::OnAddSaddr() 148 | { 149 | // Run the dialog box for an individual slot address. 150 | 151 | CSlotAddr dlg(this); 152 | 153 | // If there is a slot address selected, make the insertion before the selection. 154 | // If not, put it at the end of the list 155 | POSITION pos = ctlList().GetFirstSelectedItemPosition(); 156 | if (pos == NULL) 157 | dlg.pos = -1; 158 | else 159 | dlg.pos = (int) --pos; 160 | 161 | dlg.pSlotStrings = pSlotStrings; 162 | dlg.bNew = TRUE; 163 | if (dlg.DoModal() == IDOK) { 164 | // Add the new record to the list control 165 | int i = dlg.pos; 166 | ctlList().InsertItem((int) i, pSlotStrings->GetAt(i)); 167 | 168 | ctlList().SetItemState(i, LVIS_SELECTED | LVIS_FOCUSED, 169 | LVIS_SELECTED | LVIS_FOCUSED); 170 | 171 | // If the number of self addresses has gone above 1, enable the arrow buttons. 172 | if (pSlotStrings->GetSize() >= 2) { 173 | m_ctlMoveUp.EnableWindow(TRUE); 174 | m_ctlMoveDown.EnableWindow(TRUE); 175 | } 176 | } 177 | ctlList().SetFocus(); 178 | } 179 | 180 | void CSlotList::OnEditSaddr() 181 | { 182 | // Run the dialog box for an individual slot address. 183 | 184 | POSITION pos = ctlList().GetFirstSelectedItemPosition(); 185 | if (pos == NULL) 186 | MessageBox("There isn't a Slot Address selected!", "Alert", MB_OK); 187 | else { 188 | CSlotAddr dlg(this); 189 | dlg.pos = (int) --pos; 190 | dlg.pSlotStrings = pSlotStrings; 191 | dlg.bNew = FALSE; 192 | if (dlg.DoModal() == IDOK) { 193 | // Delete the old string from the list control and add the modified one. 194 | int i = (int) pos; 195 | ctlList().DeleteItem(i); 196 | ctlList().InsertItem((int) i, pSlotStrings->GetAt(i)); 197 | 198 | ctlList().SetItemState(i, LVIS_SELECTED | LVIS_FOCUSED, 199 | LVIS_SELECTED | LVIS_FOCUSED); 200 | } 201 | } 202 | ctlList().SetFocus(); 203 | } 204 | -------------------------------------------------------------------------------- /SourceALE/SelectRxChannel.cpp: -------------------------------------------------------------------------------- 1 | // SelectRxChannel.cpp : implementation file 2 | // 18 Nov 1999 3 | 4 | #include "stdafx.h" 5 | #include "ALE.h" 6 | #include "ALEDoc.h" 7 | #include "SelectRxChannel.h" 8 | 9 | #ifdef _DEBUG 10 | #define new DEBUG_NEW 11 | #undef THIS_FILE 12 | static char THIS_FILE[] = __FILE__; 13 | #endif 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // CSelectRxChannel dialog 17 | 18 | 19 | CSelectRxChannel::CSelectRxChannel(CWnd* pParent /*=NULL*/) 20 | : CDialog(CSelectRxChannel::IDD, pParent) 21 | { 22 | //{{AFX_DATA_INIT(CSelectRxChannel) 23 | // NOTE: the ClassWizard will add member initialization here 24 | //}}AFX_DATA_INIT 25 | } 26 | 27 | 28 | BEGIN_MESSAGE_MAP(CSelectRxChannel, CDialog) 29 | //{{AFX_MSG_MAP(CSelectRxChannel) 30 | //}}AFX_MSG_MAP 31 | END_MESSAGE_MAP() 32 | 33 | ///////////////////////////////////////////////////////////////////////////// 34 | // CSelectRxChannel message handlers 35 | 36 | BOOL CSelectRxChannel::OnInitDialog() 37 | { 38 | int i, numChans, index; 39 | struct CALEDoc::CHANNEL ch; 40 | struct CALEDoc::SELFADDR sa; 41 | struct CALEDoc::OTHERADDR oa; 42 | CString str; 43 | 44 | CDialog::OnInitDialog(); 45 | 46 | numChans = pData->parrChannels->GetSize(); 47 | 48 | // If there aren't any Channels, display error and then quit Dialog Box 49 | if (!numChans) { 50 | MessageBox("There aren't any Channels configured.\nFirst enter Channel info in the Edit section.", 51 | "Alert", MB_OK); 52 | EndDialog(IDCANCEL); 53 | } 54 | 55 | // Set the list box contents to the possible Channels 56 | ctlList().InsertColumn(0, "Tx Freq", LVCFMT_RIGHT, 64); 57 | ctlList().InsertColumn(1, "Tx Mode", LVCFMT_CENTER, 60); 58 | ctlList().InsertColumn(2, "Rx Freq", LVCFMT_RIGHT, 64); 59 | ctlList().InsertColumn(3, "Rx Mode", LVCFMT_CENTER, 60); 60 | 61 | switch (iSelfAddrMode) { 62 | case 0: 63 | // List all of the channels 64 | for (i = 0; i < numChans; i++) { 65 | ch = pData->parrChannels->GetAt(i); 66 | str.Format("%f", ch.dTransFreq); 67 | index = ctlList().InsertItem(i, str); 68 | if (ch.eTransMode == CRadio::USB) 69 | str = "USB"; 70 | else if (ch.eTransMode == CRadio::LSB) 71 | str = "LSB"; 72 | else if (ch.eTransMode == CRadio::CW) 73 | str = "CW"; 74 | else if (ch.eTransMode == CRadio::AM) 75 | str = "AM"; 76 | 77 | ctlList().SetItemText(index, 1, str); 78 | str.Format("%f", ch.dRecFreq); 79 | ctlList().SetItemText(index, 2, str); 80 | if (ch.eRecMode == CRadio::USB) 81 | str = "USB"; 82 | else if (ch.eRecMode == CRadio::LSB) 83 | str = "LSB"; 84 | else if (ch.eRecMode == CRadio::CW) 85 | str = "CW"; 86 | else if (ch.eRecMode == CRadio::AM) 87 | str = "AM"; 88 | ctlList().SetItemText(index, 3, str); 89 | } 90 | break; 91 | case 1: 92 | // If iSelfAddrMode = 1, then only list the channels for the specified Self Address 93 | sa = pData->parrSelfAddrs->GetAt(iSelfAddr); 94 | for (i = 0; i < numChans; i++) { 95 | ch = pData->parrChannels->GetAt(i); 96 | if (sa.parrValidChannels->GetAt(i) && 97 | (ch.eTRMode == CALEDoc::TR)) { 98 | str.Format("%f", ch.dTransFreq); 99 | index = ctlList().InsertItem(i, str); 100 | if (ch.eTransMode == CRadio::USB) 101 | str = "USB"; 102 | else if (ch.eTransMode == CRadio::LSB) 103 | str = "LSB"; 104 | else if (ch.eTransMode == CRadio::CW) 105 | str = "CW"; 106 | else if (ch.eTransMode == CRadio::AM) 107 | str = "AM"; 108 | 109 | ctlList().SetItemText(index, 1, str); 110 | str.Format("%f", ch.dRecFreq); 111 | ctlList().SetItemText(index, 2, str); 112 | if (ch.eRecMode == CRadio::USB) 113 | str = "USB"; 114 | else if (ch.eRecMode == CRadio::LSB) 115 | str = "LSB"; 116 | else if (ch.eRecMode == CRadio::CW) 117 | str = "CW"; 118 | else if (ch.eRecMode == CRadio::AM) 119 | str = "AM"; 120 | ctlList().SetItemText(index, 3, str); 121 | } 122 | } 123 | break; 124 | case 2: 125 | // List the channels that are common to both the specified Self 126 | // Address and the specified Other Address 127 | sa = pData->parrSelfAddrs->GetAt(iSelfAddr); 128 | oa = pData->parrOtherAddrs->GetAt(iOtherAddr); 129 | for (i = 0; i < numChans; i++) { 130 | ch = pData->parrChannels->GetAt(i); 131 | if (sa.parrValidChannels->GetAt(i) && oa.parrValidChannels->GetAt(i) && 132 | (ch.eTRMode == CALEDoc::TR)) { 133 | str.Format("%f", ch.dTransFreq); 134 | index = ctlList().InsertItem(i, str); 135 | if (ch.eTransMode == CRadio::USB) 136 | str = "USB"; 137 | else if (ch.eTransMode == CRadio::LSB) 138 | str = "LSB"; 139 | else if (ch.eTransMode == CRadio::CW) 140 | str = "CW"; 141 | else if (ch.eTransMode == CRadio::AM) 142 | str = "AM"; 143 | 144 | ctlList().SetItemText(index, 1, str); 145 | str.Format("%f", ch.dRecFreq); 146 | ctlList().SetItemText(index, 2, str); 147 | if (ch.eRecMode == CRadio::USB) 148 | str = "USB"; 149 | else if (ch.eRecMode == CRadio::LSB) 150 | str = "LSB"; 151 | else if (ch.eRecMode == CRadio::CW) 152 | str = "CW"; 153 | else if (ch.eRecMode == CRadio::AM) 154 | str = "AM"; 155 | ctlList().SetItemText(index, 3, str); 156 | } 157 | } 158 | break; 159 | } 160 | 161 | return TRUE; // return TRUE unless you set the focus to a control 162 | } 163 | 164 | void CSelectRxChannel::OnOK() 165 | { 166 | CString strList, strChan; 167 | int i, ind, numChans; 168 | struct CALEDoc::CHANNEL ch; 169 | POSITION pos; 170 | 171 | pos = ctlList().GetFirstSelectedItemPosition(); 172 | // If no selection then error 173 | if (pos == NULL) { 174 | MessageBox("Select one of the Channels (or press Cancel)."); 175 | ctlList().SetFocus(); 176 | return; 177 | } 178 | 179 | ind = ctlList().GetNextSelectedItem(pos); 180 | strList = ctlList().GetItemText(ind, 0); 181 | 182 | numChans = pData->parrChannels->GetSize(); 183 | for (i = 0; i < numChans; i++) { 184 | ch = pData->parrChannels->GetAt(i); 185 | strChan.Format("%f", ch.dTransFreq); 186 | if (strList == strChan) { 187 | iChanNum = i; 188 | break; 189 | } 190 | } 191 | 192 | CDialog::OnOK(); 193 | } 194 | -------------------------------------------------------------------------------- /SourceALE/AMDDisplay.cpp: -------------------------------------------------------------------------------- 1 | // AMDDisplay.cpp : implementation file 2 | // 26 Oct 99 3 | 4 | #include "stdafx.h" 5 | #include "ALE.h" 6 | #include "ALEDoc.h" 7 | #include "ALEView.h" 8 | #include "AMDDisplay.h" 9 | 10 | #ifdef _DEBUG 11 | #define new DEBUG_NEW 12 | #undef THIS_FILE 13 | static char THIS_FILE[] = __FILE__; 14 | #endif 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // CAMDDisplay dialog 18 | 19 | 20 | CAMDDisplay::CAMDDisplay(CWnd* pParent /*=NULL*/) 21 | : CDialog(CAMDDisplay::IDD, pParent) 22 | { 23 | //{{AFX_DATA_INIT(CAMDDisplay) 24 | // NOTE: the ClassWizard will add member initialization here 25 | //}}AFX_DATA_INIT 26 | } 27 | 28 | 29 | BEGIN_MESSAGE_MAP(CAMDDisplay, CDialog) 30 | //{{AFX_MSG_MAP(CAMDDisplay) 31 | //}}AFX_MSG_MAP 32 | END_MESSAGE_MAP() 33 | 34 | ///////////////////////////////////////////////////////////////////////////// 35 | // CAMDDisplay message handlers 36 | 37 | BOOL CAMDDisplay::OnInitDialog() 38 | { 39 | int size, i, len; 40 | CString str; 41 | CHARFORMAT cf; 42 | PARAFORMAT pf; 43 | struct CALEDoc::AMDMESSAGE amd; 44 | 45 | CDialog::OnInitDialog(); 46 | cf.cbSize = sizeof CHARFORMAT; 47 | pf.cbSize = sizeof(PARAFORMAT); 48 | iMsg = 0; 49 | 50 | // Write a title line 51 | str = "AMD Messages\n"; 52 | len = str.GetLength(); 53 | ctlEdit().ReplaceSel(str); 54 | ctlEdit().SetSel(0, len); 55 | cf.dwMask = CFM_BOLD | CFM_SIZE; 56 | cf.dwEffects = CFE_BOLD; 57 | cf.yHeight = 240; 58 | ctlEdit().SetSelectionCharFormat(cf); 59 | // Modify the paragraph format so that the text is centered. 60 | pf.dwMask = PFM_ALIGNMENT; 61 | pf.wAlignment = PFA_CENTER; 62 | ctlEdit().SetParaFormat(pf); 63 | ctlEdit().SetSel(-1, -1); 64 | iMsg += len; 65 | 66 | // Set the size back to 10 point 67 | cf.dwMask = CFM_BOLD | CFM_SIZE; 68 | cf.dwEffects = 0; 69 | cf.yHeight = 200; 70 | ctlEdit().SetSelectionCharFormat(cf); 71 | 72 | size = pData->parrAMDMessages->GetSize(); 73 | for (i = 0; i < size; i++) { 74 | amd = pData->parrAMDMessages->GetAt(i); 75 | str = "From " + amd.strFrom; 76 | iMsg += 5; 77 | len = amd.strFrom.GetLength(); 78 | ctlEdit().ReplaceSel(str); 79 | ctlEdit().SetSel(iMsg, iMsg + len); 80 | iMsg += len; 81 | cf.dwMask = CFM_BOLD; 82 | cf.dwEffects = CFE_BOLD; 83 | ctlEdit().SetSelectionCharFormat(cf); 84 | ctlEdit().SetSel(-1, -1); 85 | cf.dwEffects = 0; 86 | ctlEdit().SetSelectionCharFormat(cf); 87 | 88 | str = " to " + amd.strTo; 89 | iMsg += 4; 90 | len = amd.strTo.GetLength(); 91 | ctlEdit().ReplaceSel(str); 92 | ctlEdit().SetSel(iMsg, iMsg + len); 93 | iMsg += len; 94 | cf.dwMask = CFM_BOLD; 95 | cf.dwEffects = CFE_BOLD; 96 | ctlEdit().SetSelectionCharFormat(cf); 97 | ctlEdit().SetSel(-1, -1); 98 | cf.dwEffects = 0; 99 | ctlEdit().SetSelectionCharFormat(cf); 100 | 101 | str = " on " + amd.strFreq; 102 | iMsg += 4; 103 | len = amd.strFreq.GetLength(); 104 | ctlEdit().ReplaceSel(str); 105 | ctlEdit().SetSel(iMsg, iMsg + len); 106 | iMsg += len; 107 | cf.dwMask = CFM_BOLD; 108 | cf.dwEffects = CFE_BOLD; 109 | ctlEdit().SetSelectionCharFormat(cf); 110 | ctlEdit().SetSel(-1, -1); 111 | cf.dwEffects = 0; 112 | ctlEdit().SetSelectionCharFormat(cf); 113 | 114 | str = " MHz. at " + amd.strTime + "\n"; 115 | iMsg += 9; 116 | len = amd.strTime.GetLength(); 117 | ctlEdit().ReplaceSel(str); 118 | ctlEdit().SetSel(iMsg, iMsg + len); 119 | iMsg += len + 1; 120 | cf.dwMask = CFM_BOLD; 121 | cf.dwEffects = CFE_BOLD; 122 | ctlEdit().SetSelectionCharFormat(cf); 123 | ctlEdit().SetSel(-1, -1); 124 | cf.dwEffects = 0; 125 | ctlEdit().SetSelectionCharFormat(cf); 126 | 127 | // Set the size back to 10 point 128 | cf.dwMask = CFM_SIZE; 129 | cf.dwEffects = 0; 130 | cf.yHeight = 200; 131 | ctlEdit().SetSelectionCharFormat(cf); 132 | 133 | pf.dwMask = PFM_STARTINDENT; 134 | pf.dxStartIndent = 200; 135 | ctlEdit().SetParaFormat(pf); 136 | str = amd.strMessage + "\n\n"; 137 | ctlEdit().ReplaceSel(str); 138 | iMsg += str.GetLength(); 139 | 140 | pf.dwMask = PFM_STARTINDENT; 141 | pf.dxStartIndent = 0; 142 | ctlEdit().SetParaFormat(pf); 143 | } 144 | 145 | return TRUE; // return TRUE 146 | } 147 | 148 | void CAMDDisplay::OnCancel() 149 | { 150 | DestroyWindow(); 151 | } 152 | 153 | void CAMDDisplay::PostNcDestroy() 154 | { 155 | view->pAMDDlg = NULL; 156 | delete this; 157 | } 158 | 159 | void CAMDDisplay::AMDModified(LONG index) 160 | // A new AMD message has been received. Add it to the display 161 | { 162 | struct CALEDoc::AMDMESSAGE amd; 163 | int len; 164 | CString str; 165 | CHARFORMAT cf; 166 | PARAFORMAT pf; 167 | 168 | SetFocus(); 169 | 170 | amd = pData->parrAMDMessages->GetAt(index); 171 | cf.cbSize = sizeof CHARFORMAT; 172 | 173 | str = "From " + amd.strFrom; 174 | iMsg += 5; 175 | len = amd.strFrom.GetLength(); 176 | ctlEdit().ReplaceSel(str); 177 | ctlEdit().SetSel(iMsg, iMsg + len); 178 | iMsg += len; 179 | cf.dwMask = CFM_BOLD; 180 | cf.dwEffects = CFE_BOLD; 181 | ctlEdit().SetSelectionCharFormat(cf); 182 | ctlEdit().SetSel(-1, -1); 183 | cf.dwEffects = 0; 184 | ctlEdit().SetSelectionCharFormat(cf); 185 | 186 | str = " to " + amd.strTo; 187 | iMsg += 4; 188 | len = amd.strTo.GetLength(); 189 | ctlEdit().ReplaceSel(str); 190 | ctlEdit().SetSel(iMsg, iMsg + len); 191 | iMsg += len; 192 | cf.dwMask = CFM_BOLD; 193 | cf.dwEffects = CFE_BOLD; 194 | ctlEdit().SetSelectionCharFormat(cf); 195 | ctlEdit().SetSel(-1, -1); 196 | cf.dwEffects = 0; 197 | ctlEdit().SetSelectionCharFormat(cf); 198 | 199 | str = " on " + amd.strFreq; 200 | iMsg += 4; 201 | len = amd.strFreq.GetLength(); 202 | ctlEdit().ReplaceSel(str); 203 | ctlEdit().SetSel(iMsg, iMsg + len); 204 | iMsg += len; 205 | cf.dwMask = CFM_BOLD; 206 | cf.dwEffects = CFE_BOLD; 207 | ctlEdit().SetSelectionCharFormat(cf); 208 | ctlEdit().SetSel(-1, -1); 209 | cf.dwEffects = 0; 210 | ctlEdit().SetSelectionCharFormat(cf); 211 | 212 | str = " MHz. at " + amd.strTime + "\n"; 213 | iMsg += 9; 214 | len = amd.strTime.GetLength(); 215 | ctlEdit().ReplaceSel(str); 216 | ctlEdit().SetSel(iMsg, iMsg + len); 217 | iMsg += len + 1; 218 | cf.dwMask = CFM_BOLD; 219 | cf.dwEffects = CFE_BOLD; 220 | ctlEdit().SetSelectionCharFormat(cf); 221 | ctlEdit().SetSel(-1, -1); 222 | cf.dwEffects = 0; 223 | ctlEdit().SetSelectionCharFormat(cf); 224 | 225 | // Set the size back to 10 point 226 | cf.dwMask = CFM_SIZE; 227 | cf.dwEffects = 0; 228 | cf.yHeight = 200; 229 | ctlEdit().SetSelectionCharFormat(cf); 230 | 231 | pf.dwMask = PFM_STARTINDENT; 232 | pf.dxStartIndent = 200; 233 | ctlEdit().SetParaFormat(pf); 234 | str = amd.strMessage + "\n\n"; 235 | ctlEdit().ReplaceSel(str); 236 | iMsg += str.GetLength(); 237 | 238 | pf.dwMask = PFM_STARTINDENT; 239 | pf.dxStartIndent = 0; 240 | ctlEdit().SetParaFormat(pf); 241 | } 242 | -------------------------------------------------------------------------------- /SourceALE/OtherAddrList.cpp: -------------------------------------------------------------------------------- 1 | // OtherAddrList.cpp : implementation file 2 | // 3 Feb 1999 3 | 4 | #include "stdafx.h" 5 | #include "ALE.h" 6 | #include "ALEDoc.h" 7 | #include "OtherAddrList.h" 8 | #include "ALEView.h" 9 | #include "OtherAddrDlg.h" 10 | 11 | #ifdef _DEBUG 12 | #define new DEBUG_NEW 13 | #undef THIS_FILE 14 | static char THIS_FILE[] = __FILE__; 15 | #endif 16 | 17 | ///////////////////////////////////////////////////////////////////////////// 18 | // COtherAddrList dialog 19 | 20 | COtherAddrList::COtherAddrList(CWnd* pParent /*=NULL*/) 21 | : CDialog(COtherAddrList::IDD, pParent) 22 | { 23 | //{{AFX_DATA_INIT(COtherAddrList) 24 | // NOTE: the ClassWizard will add member initialization here 25 | //}}AFX_DATA_INIT 26 | } 27 | 28 | 29 | BEGIN_MESSAGE_MAP(COtherAddrList, CDialog) 30 | //{{AFX_MSG_MAP(COtherAddrList) 31 | ON_BN_CLICKED(IDC_MOVEDOWN, OnMovedown) 32 | ON_BN_CLICKED(IDC_MOVEUP, OnMoveup) 33 | ON_BN_CLICKED(IDC_ADD_OADDR, OnAddOaddr) 34 | ON_BN_CLICKED(IDC_DELETE_OADDR, OnDeleteOaddr) 35 | ON_BN_CLICKED(IDC_EDIT_OADDR, OnEditOaddr) 36 | //}}AFX_MSG_MAP 37 | END_MESSAGE_MAP() 38 | 39 | ///////////////////////////////////////////////////////////////////////////// 40 | // COtherAddrList message handlers 41 | 42 | void COtherAddrList::AddOtherAddrList(int i) 43 | { 44 | CString str; 45 | struct CALEDoc::OTHERADDR oa; 46 | int index; 47 | 48 | oa = pData->parrOtherAddrs->GetAt(i); 49 | index = ctlList().InsertItem(i, oa.strOtherAddr); 50 | str.Format("%.2f", oa.dReplyWait); 51 | ctlList().SetItemText(index, 1, str); 52 | } 53 | 54 | void COtherAddrList::DispOtherAddrList() 55 | { 56 | int size = pData->parrOtherAddrs->GetSize(); 57 | 58 | ctlList().InsertColumn(0, "Other Address", LVCFMT_LEFT, 120); 59 | ctlList().InsertColumn(1, "Wait for Reply", LVCFMT_LEFT, 90); 60 | 61 | CString str; 62 | for (int i = 0; i < size; i++) { 63 | AddOtherAddrList(i); 64 | } 65 | 66 | // Enable or disable the arrow buttons on the dialog box depending on how 67 | // many self address entries exist. 68 | if (size >= 2) { 69 | m_ctlMoveUp.EnableWindow(TRUE); 70 | m_ctlMoveDown.EnableWindow(TRUE); 71 | } else { 72 | m_ctlMoveUp.EnableWindow(FALSE); 73 | m_ctlMoveDown.EnableWindow(FALSE); 74 | } 75 | } 76 | 77 | BOOL COtherAddrList::OnInitDialog() 78 | { 79 | CDialog::OnInitDialog(); 80 | 81 | m_ctlMoveUp.AutoLoad(IDC_MOVEUP, this); 82 | m_ctlMoveDown.AutoLoad(IDC_MOVEDOWN, this); 83 | DispOtherAddrList(); 84 | 85 | return TRUE; // return TRUE unless you set the focus to a control 86 | } 87 | 88 | void COtherAddrList::OnAddOaddr() 89 | { 90 | // Run the dialog box for an individual other address. Assume the dialog box 91 | // checks that all data is correct and complete, and that it will add 92 | // the new other address to the parrOtherAddrs array. 93 | 94 | COtherAddrDlg dlg(this); 95 | 96 | // If there is a other address selected, make the insertion before the selection. 97 | // If not, put it at the end of the list 98 | POSITION pos = ctlList().GetFirstSelectedItemPosition(); 99 | if (pos == NULL) 100 | dlg.pos = -1; 101 | else 102 | dlg.pos = (int) --pos; 103 | 104 | dlg.pData = pData; 105 | dlg.bNew = TRUE; 106 | if (dlg.DoModal() == IDOK) { 107 | // Add the new record to the list control 108 | int i = dlg.pos; 109 | AddOtherAddrList(i); 110 | 111 | ctlList().SetItemState(i, LVIS_SELECTED | LVIS_FOCUSED, 112 | LVIS_SELECTED | LVIS_FOCUSED); 113 | pData->pDoc->SetModifiedFlag(); 114 | 115 | // If the number of other addresses has gone above 1, enable the arrow buttons. 116 | if (pData->parrOtherAddrs->GetSize() >= 2) { 117 | m_ctlMoveUp.EnableWindow(TRUE); 118 | m_ctlMoveDown.EnableWindow(TRUE); 119 | } 120 | } 121 | ctlList().SetFocus(); 122 | } 123 | 124 | void COtherAddrList::OnDeleteOaddr() 125 | { 126 | struct CALEDoc::OTHERADDR oa; 127 | 128 | POSITION pos = ctlList().GetFirstSelectedItemPosition(); 129 | if (pos == NULL) { 130 | MessageBox("There isn't an Other Address selected!", "Alert", MB_OK); 131 | } else { 132 | pos--; 133 | ctlList().DeleteItem((int) pos); 134 | oa = pData->parrOtherAddrs->GetAt((int) pos); 135 | delete oa.parrValidChannels; 136 | delete oa.pSlotStrings; 137 | pData->parrOtherAddrs->RemoveAt((int) pos); 138 | pData->pDoc->SetModifiedFlag(); 139 | 140 | // If the number of other addresses has gone below 2, disable the arrow buttons. 141 | if (pData->parrOtherAddrs->GetSize() < 2) { 142 | m_ctlMoveUp.EnableWindow(FALSE); 143 | m_ctlMoveDown.EnableWindow(FALSE); 144 | } 145 | } 146 | } 147 | 148 | void COtherAddrList::OnEditOaddr() 149 | { 150 | // Run the dialog box for an individual other address. Assume the dialog box 151 | // checks that all data is correct and complete, and that it will add 152 | // the new self address to the parrOtherAddrs array. 153 | 154 | POSITION pos = ctlList().GetFirstSelectedItemPosition(); 155 | if (pos == NULL) 156 | MessageBox("There isn't an Other Address selected!", "Alert", MB_OK); 157 | else { 158 | COtherAddrDlg dlg(this); 159 | dlg.pos = (int) --pos; 160 | dlg.pData = pData; 161 | dlg.bNew = FALSE; 162 | if (dlg.DoModal() == IDOK) { 163 | // Delete the old record from the list control and add the modified one. 164 | int i = (int) pos; 165 | ctlList().DeleteItem(i); 166 | AddOtherAddrList(i); 167 | 168 | ctlList().SetItemState(i, LVIS_SELECTED | LVIS_FOCUSED, 169 | LVIS_SELECTED | LVIS_FOCUSED); 170 | pData->pDoc->SetModifiedFlag(); 171 | } 172 | } 173 | ctlList().SetFocus(); 174 | } 175 | 176 | void COtherAddrList::OnMovedown() 177 | { 178 | POSITION pos = ctlList().GetFirstSelectedItemPosition(); 179 | if (pos == NULL) { 180 | MessageBox("There isn't an Other Address selected!", "Alert", MB_OK); 181 | } else if ((int) pos == pData->parrSelfAddrs->GetSize()) { 182 | MessageBox("The selected item is already last!", "Alert", MB_OK); 183 | } else { 184 | pos--; 185 | // Rearrange the array elements 186 | CALEDoc::OTHERADDR oa = pData->parrOtherAddrs->GetAt((int) pos); 187 | pData->parrOtherAddrs->RemoveAt((int) pos); 188 | pos++; 189 | pData->parrOtherAddrs->InsertAt((int) pos, oa); 190 | 191 | // Rearrange the list displayed in the dialog box 192 | ctlList().DeleteItem((int) --pos); 193 | AddOtherAddrList((int) ++pos); 194 | 195 | // Keep the item that was deleted and reinserted highlighted 196 | ctlList().SetItemState((int) pos, LVIS_SELECTED | LVIS_FOCUSED, 197 | LVIS_SELECTED | LVIS_FOCUSED); 198 | 199 | pData->pDoc->SetModifiedFlag(); 200 | } 201 | ctlList().SetFocus(); 202 | } 203 | 204 | void COtherAddrList::OnMoveup() 205 | { 206 | POSITION pos = ctlList().GetFirstSelectedItemPosition(); 207 | if (pos == NULL) { 208 | MessageBox("There isn't an Other Address selected!", "Alert", MB_OK); 209 | } else if ((int) pos == 1) { 210 | MessageBox("The selected item is already first!", "Alert", MB_OK); 211 | } else { 212 | pos--; 213 | // Rearrange the array elements 214 | CALEDoc::OTHERADDR oa = pData->parrOtherAddrs->GetAt((int) pos); 215 | pData->parrOtherAddrs->RemoveAt((int) pos); 216 | pos--; 217 | pData->parrOtherAddrs->InsertAt((int) pos, oa); 218 | 219 | // Rearrange the list displayed in the dialog box 220 | ctlList().DeleteItem((int) ++pos); 221 | AddOtherAddrList((int) --pos); 222 | 223 | // Keep the item that was deleted and reinserted highlighted 224 | ctlList().SetItemState((int) pos, LVIS_SELECTED | LVIS_FOCUSED, 225 | LVIS_SELECTED | LVIS_FOCUSED); 226 | 227 | pData->pDoc->SetModifiedFlag(); 228 | } 229 | ctlList().SetFocus(); 230 | } 231 | 232 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Aa][Rr][Mm]/ 27 | [Aa][Rr][Mm]64/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Ll]og/ 32 | [Ll]ogs/ 33 | 34 | # Visual Studio 2015/2017 cache/options directory 35 | .vs/ 36 | # Uncomment if you have tasks that create the project's static files in wwwroot 37 | #wwwroot/ 38 | 39 | # Visual Studio 2017 auto generated files 40 | Generated\ Files/ 41 | 42 | # MSTest test Results 43 | [Tt]est[Rr]esult*/ 44 | [Bb]uild[Ll]og.* 45 | 46 | # NUnit 47 | *.VisualState.xml 48 | TestResult.xml 49 | nunit-*.xml 50 | 51 | # Build Results of an ATL Project 52 | [Dd]ebugPS/ 53 | [Rr]eleasePS/ 54 | dlldata.c 55 | 56 | # Benchmark Results 57 | BenchmarkDotNet.Artifacts/ 58 | 59 | # .NET Core 60 | project.lock.json 61 | project.fragment.lock.json 62 | artifacts/ 63 | 64 | # StyleCop 65 | StyleCopReport.xml 66 | 67 | # Files built by Visual Studio 68 | *_i.c 69 | *_p.c 70 | *_h.h 71 | *.ilk 72 | *.meta 73 | *.obj 74 | *.iobj 75 | *.pch 76 | *.pdb 77 | *.ipdb 78 | *.pgc 79 | *.pgd 80 | *.rsp 81 | *.sbr 82 | *.tlb 83 | *.tli 84 | *.tlh 85 | *.tmp 86 | *.tmp_proj 87 | *_wpftmp.csproj 88 | *.log 89 | *.vspscc 90 | *.vssscc 91 | .builds 92 | *.pidb 93 | *.svclog 94 | *.scc 95 | 96 | # Chutzpah Test files 97 | _Chutzpah* 98 | 99 | # Visual C++ cache files 100 | ipch/ 101 | *.aps 102 | *.ncb 103 | *.opendb 104 | *.opensdf 105 | *.sdf 106 | *.cachefile 107 | *.VC.db 108 | *.VC.VC.opendb 109 | 110 | # Visual Studio profiler 111 | *.psess 112 | *.vsp 113 | *.vspx 114 | *.sap 115 | 116 | # Visual Studio Trace Files 117 | *.e2e 118 | 119 | # TFS 2012 Local Workspace 120 | $tf/ 121 | 122 | # Guidance Automation Toolkit 123 | *.gpState 124 | 125 | # ReSharper is a .NET coding add-in 126 | _ReSharper*/ 127 | *.[Rr]e[Ss]harper 128 | *.DotSettings.user 129 | 130 | # TeamCity is a build add-in 131 | _TeamCity* 132 | 133 | # DotCover is a Code Coverage Tool 134 | *.dotCover 135 | 136 | # AxoCover is a Code Coverage Tool 137 | .axoCover/* 138 | !.axoCover/settings.json 139 | 140 | # Visual Studio code coverage results 141 | *.coverage 142 | *.coveragexml 143 | 144 | # NCrunch 145 | _NCrunch_* 146 | .*crunch*.local.xml 147 | nCrunchTemp_* 148 | 149 | # MightyMoose 150 | *.mm.* 151 | AutoTest.Net/ 152 | 153 | # Web workbench (sass) 154 | .sass-cache/ 155 | 156 | # Installshield output folder 157 | [Ee]xpress/ 158 | 159 | # DocProject is a documentation generator add-in 160 | DocProject/buildhelp/ 161 | DocProject/Help/*.HxT 162 | DocProject/Help/*.HxC 163 | DocProject/Help/*.hhc 164 | DocProject/Help/*.hhk 165 | DocProject/Help/*.hhp 166 | DocProject/Help/Html2 167 | DocProject/Help/html 168 | 169 | # Click-Once directory 170 | publish/ 171 | 172 | # Publish Web Output 173 | *.[Pp]ublish.xml 174 | *.azurePubxml 175 | # Note: Comment the next line if you want to checkin your web deploy settings, 176 | # but database connection strings (with potential passwords) will be unencrypted 177 | *.pubxml 178 | *.publishproj 179 | 180 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 181 | # checkin your Azure Web App publish settings, but sensitive information contained 182 | # in these scripts will be unencrypted 183 | PublishScripts/ 184 | 185 | # NuGet Packages 186 | *.nupkg 187 | # NuGet Symbol Packages 188 | *.snupkg 189 | # The packages folder can be ignored because of Package Restore 190 | **/[Pp]ackages/* 191 | # except build/, which is used as an MSBuild target. 192 | !**/[Pp]ackages/build/ 193 | # Uncomment if necessary however generally it will be regenerated when needed 194 | #!**/[Pp]ackages/repositories.config 195 | # NuGet v3's project.json files produces more ignorable files 196 | *.nuget.props 197 | *.nuget.targets 198 | 199 | # Microsoft Azure Build Output 200 | csx/ 201 | *.build.csdef 202 | 203 | # Microsoft Azure Emulator 204 | ecf/ 205 | rcf/ 206 | 207 | # Windows Store app package directories and files 208 | AppPackages/ 209 | BundleArtifacts/ 210 | Package.StoreAssociation.xml 211 | _pkginfo.txt 212 | *.appx 213 | *.appxbundle 214 | *.appxupload 215 | 216 | # Visual Studio cache files 217 | # files ending in .cache can be ignored 218 | *.[Cc]ache 219 | # but keep track of directories ending in .cache 220 | !?*.[Cc]ache/ 221 | 222 | # Others 223 | ClientBin/ 224 | ~$* 225 | *~ 226 | *.dbmdl 227 | *.dbproj.schemaview 228 | *.jfm 229 | *.pfx 230 | *.publishsettings 231 | orleans.codegen.cs 232 | 233 | # Including strong name files can present a security risk 234 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 235 | #*.snk 236 | 237 | # Since there are multiple workflows, uncomment next line to ignore bower_components 238 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 239 | #bower_components/ 240 | 241 | # RIA/Silverlight projects 242 | Generated_Code/ 243 | 244 | # Backup & report files from converting an old project file 245 | # to a newer Visual Studio version. Backup files are not needed, 246 | # because we have git ;-) 247 | _UpgradeReport_Files/ 248 | Backup*/ 249 | UpgradeLog*.XML 250 | UpgradeLog*.htm 251 | ServiceFabricBackup/ 252 | *.rptproj.bak 253 | 254 | # SQL Server files 255 | *.mdf 256 | *.ldf 257 | *.ndf 258 | 259 | # Business Intelligence projects 260 | *.rdl.data 261 | *.bim.layout 262 | *.bim_*.settings 263 | *.rptproj.rsuser 264 | *- [Bb]ackup.rdl 265 | *- [Bb]ackup ([0-9]).rdl 266 | *- [Bb]ackup ([0-9][0-9]).rdl 267 | 268 | # Microsoft Fakes 269 | FakesAssemblies/ 270 | 271 | # GhostDoc plugin setting file 272 | *.GhostDoc.xml 273 | 274 | # Node.js Tools for Visual Studio 275 | .ntvs_analysis.dat 276 | node_modules/ 277 | 278 | # Visual Studio 6 build log 279 | *.plg 280 | 281 | # Visual Studio 6 workspace options file 282 | *.opt 283 | 284 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 285 | *.vbw 286 | 287 | # Visual Studio LightSwitch build output 288 | **/*.HTMLClient/GeneratedArtifacts 289 | **/*.DesktopClient/GeneratedArtifacts 290 | **/*.DesktopClient/ModelManifest.xml 291 | **/*.Server/GeneratedArtifacts 292 | **/*.Server/ModelManifest.xml 293 | _Pvt_Extensions 294 | 295 | # Paket dependency manager 296 | .paket/paket.exe 297 | paket-files/ 298 | 299 | # FAKE - F# Make 300 | .fake/ 301 | 302 | # CodeRush personal settings 303 | .cr/personal 304 | 305 | # Python Tools for Visual Studio (PTVS) 306 | __pycache__/ 307 | *.pyc 308 | 309 | # Cake - Uncomment if you are using it 310 | # tools/** 311 | # !tools/packages.config 312 | 313 | # Tabs Studio 314 | *.tss 315 | 316 | # Telerik's JustMock configuration file 317 | *.jmconfig 318 | 319 | # BizTalk build output 320 | *.btp.cs 321 | *.btm.cs 322 | *.odx.cs 323 | *.xsd.cs 324 | 325 | # OpenCover UI analysis results 326 | OpenCover/ 327 | 328 | # Azure Stream Analytics local run output 329 | ASALocalRun/ 330 | 331 | # MSBuild Binary and Structured Log 332 | *.binlog 333 | 334 | # NVidia Nsight GPU debugger configuration file 335 | *.nvuser 336 | 337 | # MFractors (Xamarin productivity tool) working folder 338 | .mfractor/ 339 | 340 | # Local History for Visual Studio 341 | .localhistory/ 342 | 343 | # BeatPulse healthcheck temp database 344 | healthchecksdb 345 | 346 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 347 | MigrationBackup/ 348 | 349 | # Ionide (cross platform F# VS Code tools) working folder 350 | .ionide/ 351 | -------------------------------------------------------------------------------- /SourceALE/SelfAddrList.cpp: -------------------------------------------------------------------------------- 1 | // SelfAddrList.cpp : implementation file 2 | // 3 Feb 1999 3 | 4 | #include "stdafx.h" 5 | #include "ALE.h" 6 | #include "ALEDoc.h" 7 | #include "SelfAddrList.h" 8 | #include "ALEView.h" 9 | #include "SelfAddrDlg.h" 10 | 11 | #ifdef _DEBUG 12 | #define new DEBUG_NEW 13 | #undef THIS_FILE 14 | static char THIS_FILE[] = __FILE__; 15 | #endif 16 | 17 | ///////////////////////////////////////////////////////////////////////////// 18 | // CSelfAddrList dialog 19 | 20 | 21 | CSelfAddrList::CSelfAddrList(CWnd* pParent /*=NULL*/) 22 | : CDialog(CSelfAddrList::IDD, pParent) 23 | { 24 | //{{AFX_DATA_INIT(CSelfAddrList) 25 | // NOTE: the ClassWizard will add member initialization here 26 | //}}AFX_DATA_INIT 27 | } 28 | 29 | 30 | BEGIN_MESSAGE_MAP(CSelfAddrList, CDialog) 31 | //{{AFX_MSG_MAP(CSelfAddrList) 32 | ON_BN_CLICKED(IDC_MOVEDOWN, OnMovedown) 33 | ON_BN_CLICKED(IDC_MOVEUP, OnMoveup) 34 | ON_BN_CLICKED(IDC_ADD_SADDR, OnAddSaddr) 35 | ON_BN_CLICKED(IDC_DELETE_SADDR, OnDeleteSaddr) 36 | ON_BN_CLICKED(IDC_EDIT_SADDR, OnEditSaddr) 37 | //}}AFX_MSG_MAP 38 | END_MESSAGE_MAP() 39 | 40 | ///////////////////////////////////////////////////////////////////////////// 41 | // CSelfAddrList message handlers 42 | 43 | void CSelfAddrList::AddAddrList(int i) 44 | { 45 | CString str; 46 | struct CALEDoc::SELFADDR sa; 47 | int index; 48 | 49 | sa = pData->parrSelfAddrs->GetAt(i); 50 | index = ctlList().InsertItem(i, sa.strSelfAddr); 51 | ctlList().SetItemText(index, 1, sa.strNetAddr); 52 | str.Format("%d", sa.m_nSlotWait); 53 | ctlList().SetItemText(index, 2, str); 54 | } 55 | 56 | void CSelfAddrList::DispSelfAddrList() 57 | { 58 | int size = pData->parrSelfAddrs->GetSize(); 59 | 60 | ctlList().InsertColumn(0, "Self Address", LVCFMT_LEFT, 120); 61 | ctlList().InsertColumn(1, "Net Address", LVCFMT_LEFT, 120); 62 | ctlList().InsertColumn(2, "Slot Wait", LVCFMT_LEFT, 64); 63 | 64 | for (int i = 0; i < size; i++) { 65 | AddAddrList(i); 66 | } 67 | 68 | // Enable or disable the arrow buttons on the dialog box depending on how 69 | // many self address entries exist. 70 | if (size >= 2) { 71 | m_ctlMoveUp.EnableWindow(TRUE); 72 | m_ctlMoveDown.EnableWindow(TRUE); 73 | } else { 74 | m_ctlMoveUp.EnableWindow(FALSE); 75 | m_ctlMoveDown.EnableWindow(FALSE); 76 | } 77 | } 78 | 79 | BOOL CSelfAddrList::OnInitDialog() 80 | { 81 | CDialog::OnInitDialog(); 82 | 83 | m_ctlMoveUp.AutoLoad(IDC_MOVEUP, this); 84 | m_ctlMoveDown.AutoLoad(IDC_MOVEDOWN, this); 85 | DispSelfAddrList(); 86 | 87 | return TRUE; // return TRUE unless you set the focus to a control 88 | } 89 | 90 | void CSelfAddrList::OnMovedown() 91 | { 92 | POSITION pos = ctlList().GetFirstSelectedItemPosition(); 93 | if (pos == NULL) { 94 | MessageBox("There isn't a Self Address selected!", "Alert", MB_OK); 95 | } else if ((int) pos == 1) { 96 | MessageBox("The first self address is the base 3 character address and can't be moved.", "Alert", MB_OK); 97 | } else if ((int) pos == pData->parrSelfAddrs->GetSize()) { 98 | MessageBox("The selected item is already last!", "Alert", MB_OK); 99 | } else { 100 | pos--; 101 | // Rearrange the array elements 102 | CALEDoc::SELFADDR sa = pData->parrSelfAddrs->GetAt((int) pos); 103 | pData->parrSelfAddrs->RemoveAt((int) pos); 104 | pos++; 105 | pData->parrSelfAddrs->InsertAt((int) pos, sa); 106 | 107 | // Rearrange the list displayed in the dialog box 108 | ctlList().DeleteItem((int) --pos); 109 | AddAddrList((int) ++pos); 110 | 111 | // Keep the item that was deleted and reinserted highlighted 112 | ctlList().SetItemState((int) pos, LVIS_SELECTED | LVIS_FOCUSED, 113 | LVIS_SELECTED | LVIS_FOCUSED); 114 | 115 | pData->pDoc->SetModifiedFlag(); 116 | } 117 | ctlList().SetFocus(); 118 | } 119 | 120 | void CSelfAddrList::OnMoveup() 121 | { 122 | POSITION pos = ctlList().GetFirstSelectedItemPosition(); 123 | if (pos == NULL) { 124 | MessageBox("There isn't a Self Address selected!", "Alert", MB_OK); 125 | } else if ((int) pos == 1) { 126 | MessageBox("The selected item is already first!", "Alert", MB_OK); 127 | } else if ((int) pos == 2) { 128 | MessageBox("The first self address is the base 3 character address and can't be moved.", "Alert", MB_OK); 129 | } else { 130 | pos--; 131 | // Rearrange the array elements 132 | CALEDoc::SELFADDR sa = pData->parrSelfAddrs->GetAt((int) pos); 133 | pData->parrSelfAddrs->RemoveAt((int) pos); 134 | pos--; 135 | pData->parrSelfAddrs->InsertAt((int) pos, sa); 136 | 137 | // Rearrange the list displayed in the dialog box 138 | ctlList().DeleteItem((int) ++pos); 139 | AddAddrList((int) --pos); 140 | 141 | // Keep the item that was deleted and reinserted highlighted 142 | ctlList().SetItemState((int) pos, LVIS_SELECTED | LVIS_FOCUSED, 143 | LVIS_SELECTED | LVIS_FOCUSED); 144 | 145 | pData->pDoc->SetModifiedFlag(); 146 | } 147 | ctlList().SetFocus(); 148 | } 149 | 150 | void CSelfAddrList::OnAddSaddr() 151 | { 152 | // Run the dialog box for an individual self address. Assume the dialog box 153 | // checks that all data is correct and complete, and that it will add 154 | // the new self address to the parrSelfAddrs array. 155 | 156 | CSelfAddrDlg dlg(this); 157 | 158 | // If there is a self address selected, make the insertion before the selection. 159 | // If not, put it at the end of the list 160 | POSITION pos = ctlList().GetFirstSelectedItemPosition(); 161 | if (pos == NULL) 162 | dlg.pos = -1; 163 | else 164 | dlg.pos = (int) --pos; 165 | 166 | dlg.pData = pData; 167 | dlg.bNew = TRUE; 168 | if (dlg.DoModal() == IDOK) { 169 | // Add the new record to the list control 170 | int i = dlg.pos; 171 | AddAddrList(i); 172 | 173 | ctlList().SetItemState(i, LVIS_SELECTED | LVIS_FOCUSED, 174 | LVIS_SELECTED | LVIS_FOCUSED); 175 | pData->pDoc->SetModifiedFlag(); 176 | 177 | // If the number of self addresses has gone above 1, enable the arrow buttons. 178 | if (pData->parrSelfAddrs->GetSize() >= 2) { 179 | m_ctlMoveUp.EnableWindow(TRUE); 180 | m_ctlMoveDown.EnableWindow(TRUE); 181 | } 182 | } 183 | ctlList().SetFocus(); 184 | } 185 | 186 | void CSelfAddrList::OnDeleteSaddr() 187 | { 188 | struct CALEDoc::SELFADDR sa; 189 | 190 | POSITION pos = ctlList().GetFirstSelectedItemPosition(); 191 | if (pos == NULL) { 192 | MessageBox("There isn't a Self Address selected!", "Alert", MB_OK); 193 | } else if ((int) pos == 1) { 194 | MessageBox("The first self address is the base 3 character address and can't be deleted.", "Alert", MB_OK); 195 | } else { 196 | pos--; 197 | ctlList().DeleteItem((int) pos); 198 | sa = pData->parrSelfAddrs->GetAt((int) pos); 199 | delete sa.parrValidChannels; 200 | pData->parrSelfAddrs->RemoveAt((int) pos); 201 | pData->pDoc->SetModifiedFlag(); 202 | 203 | // If the number of self addresses has gone below 2, disable the arrow buttons. 204 | if (pData->parrSelfAddrs->GetSize() < 2) { 205 | m_ctlMoveUp.EnableWindow(FALSE); 206 | m_ctlMoveDown.EnableWindow(FALSE); 207 | } 208 | } 209 | } 210 | 211 | void CSelfAddrList::OnEditSaddr() 212 | { 213 | // Run the dialog box for an individual self address. Assume the dialog box 214 | // checks that all data is correct and complete, and that it will add 215 | // the new self address to the parrSelfAddrs array. 216 | 217 | POSITION pos = ctlList().GetFirstSelectedItemPosition(); 218 | if (pos == NULL) 219 | MessageBox("There isn't a Self Address selected!", "Alert", MB_OK); 220 | else { 221 | CSelfAddrDlg dlg(this); 222 | dlg.pos = (int) --pos; 223 | dlg.pData = pData; 224 | dlg.bNew = FALSE; 225 | if (dlg.DoModal() == IDOK) { 226 | // Delete the old record from the list control and add the modified one. 227 | int i = (int) pos; 228 | ctlList().DeleteItem(i); 229 | AddAddrList(i); 230 | 231 | ctlList().SetItemState(i, LVIS_SELECTED | LVIS_FOCUSED, 232 | LVIS_SELECTED | LVIS_FOCUSED); 233 | pData->pDoc->SetModifiedFlag(); 234 | } 235 | } 236 | ctlList().SetFocus(); 237 | } 238 | -------------------------------------------------------------------------------- /SourceALE/ALE.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {fe41edf5-e5ab-4098-a803-bdc35586a5b5} 6 | cpp;c;cxx;rc;def;r;odl;idl;hpj;bat 7 | 8 | 9 | {e62c6ad4-434f-4c3b-a44f-37beaf19ceb9} 10 | h;hpp;hxx;hm;inl 11 | 12 | 13 | {335c2688-1885-4260-981c-d3bcf752985a} 14 | ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | Source Files 38 | 39 | 40 | Source Files 41 | 42 | 43 | Source Files 44 | 45 | 46 | Source Files 47 | 48 | 49 | Source Files 50 | 51 | 52 | Source Files 53 | 54 | 55 | Source Files 56 | 57 | 58 | Source Files 59 | 60 | 61 | Source Files 62 | 63 | 64 | Source Files 65 | 66 | 67 | Source Files 68 | 69 | 70 | Source Files 71 | 72 | 73 | Source Files 74 | 75 | 76 | Source Files 77 | 78 | 79 | Source Files 80 | 81 | 82 | Source Files 83 | 84 | 85 | Source Files 86 | 87 | 88 | Source Files 89 | 90 | 91 | Source Files 92 | 93 | 94 | Source Files 95 | 96 | 97 | Source Files 98 | 99 | 100 | Source Files 101 | 102 | 103 | 104 | 105 | Source Files 106 | 107 | 108 | 109 | 110 | Header Files 111 | 112 | 113 | Header Files 114 | 115 | 116 | Header Files 117 | 118 | 119 | Header Files 120 | 121 | 122 | Header Files 123 | 124 | 125 | Header Files 126 | 127 | 128 | Header Files 129 | 130 | 131 | Header Files 132 | 133 | 134 | Header Files 135 | 136 | 137 | Header Files 138 | 139 | 140 | Header Files 141 | 142 | 143 | Header Files 144 | 145 | 146 | Header Files 147 | 148 | 149 | Header Files 150 | 151 | 152 | Header Files 153 | 154 | 155 | Header Files 156 | 157 | 158 | Header Files 159 | 160 | 161 | Header Files 162 | 163 | 164 | Header Files 165 | 166 | 167 | Header Files 168 | 169 | 170 | Header Files 171 | 172 | 173 | Header Files 174 | 175 | 176 | Header Files 177 | 178 | 179 | Header Files 180 | 181 | 182 | Header Files 183 | 184 | 185 | Header Files 186 | 187 | 188 | Header Files 189 | 190 | 191 | 192 | 193 | Resource Files 194 | 195 | 196 | Resource Files 197 | 198 | 199 | Resource Files 200 | 201 | 202 | Resource Files 203 | 204 | 205 | Resource Files 206 | 207 | 208 | Resource Files 209 | 210 | 211 | Resource Files 212 | 213 | 214 | Resource Files 215 | 216 | 217 | Resource Files 218 | 219 | 220 | Resource Files 221 | 222 | 223 | Resource Files 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | Header Files 232 | 233 | 234 | Resource Files 235 | 236 | 237 | 238 | --------------------------------------------------------------------------------