FLDG
Programmer Guide
by Terry G. Glagowski, PhD / W1TR / AFA1DI
W1TR@ARRL.net
01-Oct-2013 12:17 - for FLDigi Version 3.21.76
This document describes the FLDG DLL interface between the Microsoft .NET application framework / programming system and the FLDigi XML-RPC interface. The FLDG .DLL is written for Microsoft .NET version 4.0 in C# source code using Microsoft Visual Studio 2010 Professional. The XML Documentation option was used to create information to be available in the Object Browser when the client software development environment is Microsoft Visual Studio.
FLDG is callable from C#, VB.net, and C++ .net and operates entirely in the managed code .NET 4.0 Environment.
Note: in general, if FLDigi versions are backward compatible and methods are not changed or removed, this DLL will support newer FLDigi versions without supporting the latest features. This DLL does NOT support any FLDigi methods that are deprecated as of version 3.21.75.
See http://www.w1hkj.com/
for access to the FLDigi and other FL family of
software
See http://www.w1hkj.com/FldigiHelp-3.21/xmlrpc-control.html
for details on the FLDigi XML_RPC interface.
See http://xmlrpc.scripting.com/default.html
for more details on the general specifications for XML_RPC interfaces.
See http://en.wikipedia.org/wiki/XML-RPC
for an introduction to the XML_RPC interface.
This section describes the return codes available for error diagnosis for the FLDG DLL client software.
This means that no error was detected and the function returned normally with the expected value.
This means that there was an error originated by the XML_RPC server.
This means that there was a network error, most likely the unavailability of the XML_RPC server on the network, or an error in address or port number.
This means that there was some kind of data error in one of the arguments or return value for an FLDigi XML_RPC method.
This means that there was a syntax error in the XML stream sent or received from the XML_RPC server.
This means that some miscellaneous error has occurred.
This DLL has properties that can be accessed to determine mode or affect the behavior of the DLL.
The ErrorCode is read-only property having an enumeration value of type ErrorCode (see DLL Error Codes above).
This property is an error message passed from a lower function within the software such as an exception message, etc.
This property is a descriptive name for the error originated by the FLDG DLL software.
This property is a unique identifier number for the error to help tracing FLDG DLL bugs by identifying the location in the source code where the error happened.
The default value of this property is the empty string, but when non-empty contains the filename of a log file that contains a total log of queries issued and responses received during DLL operation.
The default value of this property is the empty string, but when non-empty contains the filename of an XML Query File that is sent by the FLDG DLL to the XML_RPC server for debugging purposes thereby totally bypassing all the member functions.
The default value of this property is the empty string, but when non-empty contains the filename of an XML Response File that is sent by the FLDG DLL to the client program for debugging purposes thereby totally bypassing the XML_RPC server.
This is the DLL Version based on Build Time (last write to the DLL) as a unique identifier.
This is the IP Address / Port Number string for the FLDG object instance, making possible multiple instances of the FLDigi software and FLDG object controlling is using separate IP addresses / port numbers. Example String: "http://localhost:7362" which is the default port for FLDigi unless a command line option is used to start the process.
The following categories of member functions are
in FLDG:
1) Infrastructure Functions
there are member functions for supporting the infrastructure
of assembling XML Format Queries, decoding XML Format Responses, and
communicating with the XML-RPC Server of FLDigi.
2) Signature Functions
there are member functions for each signature type for the FLDigi methods,
3) Method Functions
There is a one-to-one relationship between the XML_RPC
methods for FLDigi and the member functions in this
DLL
Infrastructure functions deal with constructing XML Format Queries, decoding XML Format Responses, and sending / receiving messages to the XML_RPC Server.
This function decodes BASE64 characters into a
UTF8 (ASCII) character string.
It is used by those method functions and signature functions that have BASE64
return values.
See http://en.wikipedia.org/wiki/Base64
This function encodes a UTF8 (ASCII) character
string into BASE64 characters.
It is used by those method functions and signature functions that have BASE64
arguments.
See http://en.wikipedia.org/wiki/Base64
This function is intended for private usage by the XML RPC Communications Processor. The argument is the raw text of the HTTP Post, and the URL to which it is posted. The return value is the response from the HTTP Post.
This function is intended for private usageby the XML Query Generator and installs an XML Declaration to a new but empty XML Document. The return value is the XML String for debugging purposes.
This function is intended for private usage by the XML Query Generator and appends a fault response to the XML format response. The return value is the XML String for debugging purposes.
This function is intended for private usage and appends a method call to the XML Format Query. The return value is the XML String for debugging purposes.
This function is intended for private usage by the XML Query Generator and appends a PARAM hook in the XML Format Query. The return value is the XML String for debugging purposes.
This function is intended for private usage by the XML Response Processor and extracts the response value from the XML Format Response.
This function is intended for private usage by the XML RPC Communications Processor. The argument is the XML_RPC Format Query, and the return value is the XML_RPC Format Response.
This method helps implement the FLDigi methods with signature "6_ii".
This method helps implement the FLDigi methods with signature "6_n".
This method helps implement the FLDigi methods with signature "A_n".
This method helps implement the FLDigi methods with signature "b_b".
This method helps implement the FLDigi methods with signature "b_n".
This method helps implement the FLDigi methods with signature "d_d".
This method helps implement the FLDigi methods with signature "d_n".
This method helps implement the FLDigi methods with signature "i_i".
This method helps implement the FLDigi methods with signature "n_6".
This method helps implement the FLDigi methods with signature "n_A".
This method helps implement the FLDigi methods with signature "n_b".
This method helps implement the FLDigi methods with signature "n_i".
This method helps implement the FLDigi methods with signature "n_n".
This method helps implement the FLDigi methods with signature "n_s".
This method helps implement the FLDigi methods with signature "n_V". V is either an array or structure argument.
This method helps implement the FLDigi methods with signature "s_b".
This method helps implement the FLDigi methods with signature "s_i".
This method helps implement the FLDigi methods with signature "s_i".
This method helps implement the FLDigi methods with signature "s_n".
This method helps implement the FLDigi methods with signature "S_n".
This method helps implement the FLDigi methods with signature "s_n".
This method helps implement the FLDigi methods with signature "V_n". V is either an array or structure return value.
This method helps implement the FLDigi methods with signature "V_n". V is either an array or structure return value.
There are several families of method functions associated
with groups of state variables within the FLDigi
Application:
This function constructs an object from the FLDIGI class, i.e. the class constructor, and is NOT related to a FLDigi method. The return value IS the instantiated object.
The FLDIGI family is a collection of functions that Get and
Set state variables associated with the FLDigi
application including program version and list of methods.
This method implements the "fldigi.config_dir" method, returns the FLDigi configuration directory.yle="margin-left: 40px">public String[] Fldigi_List()
This method implements the "fldigi.list" method, returns the FLDigi method list. Since the raw XML Response contains a structure value, this has been decoded into an array of strings, each with the format {method name} - {method signature} - {help description}.
This method implements the "fldigi.name" method, returns the FLDIGI Program Name.
This method implements the "fldigi.name_version" method, returns the FLDIGI Program Name and Version.
This method implements the "fldigi.terminate" method, Terminates FLDIGI Without Saving Anything.
This method implements the "fldigi.terminate" method, Terminates FLDIGI with
option:
Bit 0 = Save Options
Bit 1 = Save Log
Bit 2 = Save Macros
This method implements the "fldigi.version" method, Returns the FLDIGI Program Version.
This method implements the "fldigi.version_struct" method, Returns the FLDIGI Program Version as a Structure (outer XML of Value)
This method implements the "fldigi.version_struct" method, Returns the FLDIGI Program Version as a Structure (outer XML of Value)
The LOG family Gets and Sets a number of state variables
associated with QSO in the LOG.
This method implements the "log.clear" method, Clears the LOG family of FLDigi state variables.
This method implements the "log.get_az" method, Gets the LOG Azimuth.
This method implements the "log.get_band" method, Gets the LOG Band.
This method implements the "log.get_call" method, Gets the LOG Call.
This method implements the "log.get_country" method, Gets the LOG Country.
This method implements the "log.get_exchange" method, Gets the LOG Exchange.
This method implements the "log.get_frequency" method, Gets the LOG Frequency state variable.
This method implements the "log.get_locator" method, Gets the LOG Locator (Maidenhead Grid) .
This method implements the "log.get_name" method, Gets the LOG Name.
This method implements the "log.get_qth" method, Gets the LOG Name.
This method implements the "log.get_rst_in" method, Gets the LOG Name.
This method implements the "log.get_rst_out" method, Gets the LOG Name.
This method implements the "log.get_rst_out" method, Gets the LOG Serial Number state variable.
This method implements the "log.get_serial_number_sent" method, Gets the LOG Serial Number Sent.
This method implements the "log.get_serial_number_sent" method, Gets the LOG Serial Number Sent.
This method implements the "log.get_state" method, Gets the LOG State.
This method implements the "log.get_time_off" method, Gets the LOG Time Off.
This method implements the "log.get_time_on" method, Gets the LOG Time On.
This method implements the "log.set_call" method, Sets the LOG Call.
This method implements the "log.set_exchange" method, Sets the LOG Exchange .
This method implements the "log.set_locator" method, Sets the LOG Name.
This method implements the "log.set_name" method, Sets the LOG Name.
This method implements the "log.set_qth" method, Sets the LOG QTH.
This method implements the "log.set_serial_number" method, Sets the LOG Serial Number.
The MAIN family of functions Gets and Sets state variables
associated with the main FLDigi DSP receiver and
transmitter.
This method implements the "main.abort" method, forces the MAIN Transceiver Mode from Transmit Mode or Tune Mode to Receive Mode.
This method implements the "main.get_afc" method, Gets the MAIN AFC Status.
This method implements the "main.get_frequency" method, Gets the MAIN Frequency.
This method implements the "main.get_lock" method, Gets the MAIN Lock.
This method implements the "main.get_max_macro_id" method, Gets the MAIN Macro ID.
This method implements the "main.get_reverse" method, Gets the MAIN Reverse.
This method implements the "main.get_rsid" method, Gets the MAIN RSID (RxID).
This method implements the "main.get_squelch" method, Gets the MAIN Squelch Status state variable.
This method implements the "main.get_squelch_level" method, Gets the MAIN Squelch Level .
This method implements the
"main.get_status1" method, Gets the MAIN Status One.
This is Digital Mode (Modem Name) dependent.
This method implements the
"main.get_status2" method, Gets the MAIN Status Two.
This is Digital Mode (Modem Name) dependent.
This method implements the "main.get_trx_state" method, Gets the MAIN TRX State.
This method implements the "main.get_trx_status" method, Gets the MAIN TRX State.
This method implements the "main.get_wf_sideband" method, Gets the MAIN Waterfall Sideband .
This method implements the "main.inc_frequency" method, Increments RF Carrier Frequency, Returns New RF Carrier Frequency.
This method implements the "main.inc_squelch_level" method, Increments the Squelch Level, Returns New Squelch Level
This method implements the "main.run_macro" method, Runs Macro with MacroID
This method implements the "main.rx" method, Sets the MAIN Transceiver Mode to Receive Mode
This method implements the "main.set_afc" method, Sets the MAIN AFC Status.
This method implements the "main.set_frequency" method, Sets the MAIN Frequency and returns the previous value.
This method implements the "main.set_lock" method and Sets the MAIN Lock and returns the previous value.
This method implements the "main.set_lock" method, Sets the MAIN Lock and returns the previous value.
This method implements the "main.set_rsid" method, Sets the MAIN RSID (RxID) and returns the previous value.
This method implements the "main.set_squelch" method, Sets the MAIN Squelch Status state variable and returns the previous value.
This method implements the "main.set_squelch_level" method, Sets the MAIN Squelch Level and returns the previous value.
This method implements the "main.set_wf_sideband" method, Sets the MAIN Waterfall Sideband .
This method implements the "main.toggle_afc" method, Toggles the MAIN AFC Status and returns the New value.
This method implements the "main.toggle_lock" method, Toggles the MAIN Lock Status and returns the New value.
This method implements the "main.toggle_reverse" method, Toggles the MAIN Reverse Sideband Status and returns the New value.
This method implements the "main.toggle_rsid" method, Toggles the MAIN RSID (RxID) Status and returns the New value.
This method implements the "main.tune" method, Sets the Transceiver Mode to Tune Mode.
This method implements the "main.tune" method, Sets the Transceiver Mode to Transmit Mode.
The MODEM family of functions Gets and Sets state variables associated
with the modem options / digital mode selection.
This method implements the "modem.get_afc_search_range" method, Gets the MODEM AFC Search Range.
This method implements the "modem.get_bandwidth" method, Gets the MODEM Bandwidth.
This method implements the "modem.get_carrier" method, Gets the MODEM Carrier Frequency (audio).
This method implements the "modem.get_id" method and Gets the MODEM ID (numeric).
This method implements the "modem.get_max_id" method, Gets the MODEM Max Modem ID.
This method implements the "modem.get_name" method, Gets the MODEM Name.
Note: Modem Name is equivalent to Digital Mode.
This method implements the "modem.get_names" method, Gets the a
String Array containing a list of Modem Names.
Note: Modem Name is equivalent to Digital Mode.
This method implements the "modem.get_quality" method, Gets the MODEM Quality.
This method implements the "modem.inc_afc_search_range" method, Increments the MODEM AFC Search Range, and returns the new value.
This method implements the "modem.inc_carrier" method, Increments the MODEM Carrier Frequency (audio), and returns the new value.
This method implements the "modem.olivia.get_bandwidth" method, Gets the MODEM Olivia Bandwidth.
This method implements the "modem.olivia.get_tones" method, Gets the MODEM Olivia Tones (count).
This method implements the "modem.olivia.set_bandwidth" method, Sets the MODEM Olivia Bandwidth.
This method implements the "modem.olivia.set_tones" method, Sets the MODEM Olivia Olivia Tones (count).
This method implements the "modem.search_down" method, Starts Modem Search Downward in Frequency.
This method implements the "modem.search_up" method, Starts Modem Search Upward in Frequency.
This method implements the "modem.set_afc_search_range" method, Sets the Modem AFC Search Range.
This method implements the "modem.set_bandwidth" method, Sets the Modem Bandwidth .
This method implements the "modem.set_by_id" method, Sets the Modem ID Number.
This method implements the "modem.set_by_name" method, Sets the Modem Name.
This method implements the "modem.set_carrier" method, Sets the Modem Carrier Frequency (audio).
The NAVTEX family of functions Gets and Sets state variables
associated with NAVTEX operations.
Disclaimer: NAVTEX family functions have not
been tested. More information regarding NAVTEX is needed from FLDigi authors.
This method implements the "navtex.get_message" method, Sets the NAVTEX Delay.
This method implements the "navtex.send_message" method, Sends a NAVTEX Message.
The RIG Family is a set of functions that Get and Set state
variables associated with the RIG or Transceiver coupled to FLDigi.
Coupling of a rig to FLDigi is not necessary for
successful digital reception and transmission, but functionality is more
limited.
This method implements the "rig.get_bandwidth" method, Gets the RIG Bandwidth.
This method implements the "rig.get_bandwidths" method, Gets the RIG Bandwidths list.
This method implements the "rig.get_frequency" method, Gets the RIG Frequency.
This method implements the "rig.get_mode" method, Gets the RIG Mode.
This method implements the "rig.get_modes" method, Gets the RIG Modes list.
This method implements the "rig.get_name" method, Gets the RIG Name.
This method implements the "rig.get_notch" method, Gets the RIG Notch.
This method implements the "rig.release_control" method, Release XML-RPC Control.
FLDIGI Will Return to CAT Control / Monitoring of RIG if this is Set Up.
This method implements the "rig.set_bandwidth" method, Sets the RIG Bandwidth.
This method implements the "rig.set_bandwidths" method, Sets the RIG Bandwidths list.
This method implements the "rig.set_frequency" method, Sets the RIG Frequency, Returns the old value.
This method implements the "rig.set_mode" method, Sets the RIG Mode, Returns the old value.
This method implements the "rig.set_modes" method, Sets the RIG Modes List.
This method implements the "rig.set_name" method, Sets the RIG Name.
This method implements the "rig.set_notch" method, Sets the RIG Notch.
This method implements the "rig.take_control" method, Take XML-RPC Control of FLDigi.
FLDIGI Will Relinquish CAT Control / Monitoring of RIG and Depend on
Controlling Application to do so.
The RXTX Family and TEXT Family are functions that Get and Set Text in the
RX and TX Buffer of FLDigi.
This method implements the "rx.get_data" method, Returns all RX data received since last query in BASE64 format.
This method implements the "rxtx.get_data" method, Returns all RXTX combined data since last query in BASE64 format.
This method implements the "tx.get_data" method, Returns all TX data transmitted since last query in BASE64 format.
This method implements the "spot.get_auto" method, Get AutoSpotter Status.
This method implements the "spot.pskrep.get_count" method, Get Number of Callsigns Spotted in Current Session.
This method implements the "spot.set_auto" method, Set AutoSpotter Status, Return Old value.
This method implements the "spot.toggle_auto" method, Toggle AutoSpotter Status, Return New value.
The RXTX Family and TEXT Family are functions that Get and Set Text in the
RX and TX Buffer of FLDigi.
This method implements the "text.add_tx" method, Add Text to the Transmit Buffer.
This method implements the "text.add_tx_bytes" method, Add Text to TX Window. Translation to Base64 from UTF8 ASCII format of the argument is included.
This method implements the "text.clear_rx" method, Clear the RX Buffer.
This method implements the "text.clear_tx" method, Clear the TX Buffer.
This method implements the "text.get_rx" method, Get Base64 Format Text at Start Index and Length Specified. Truncates if insufficient data is available or start index is out of range. Translation from Base64 to UTF8 ASCII format of the return value is included.
This method implements the "text.get_rx_length" method, followed by the "text.get_rx_length" method to get ALL Text in RX Buffer in Base64 Format. Translation from Base64 to UTF8 ASCII format of the return value is included.
This method implements the "text.get_rx_length" method, Gets Length of Text in RX Buffer.
The WEFAX Family of functions
Gets and Sets state variables associated with WEFAX operation.
Disclaimer: WEFAX family functions were not tested, and
insufficient information regarding return values is available from FLDigi authors at this time.
This method implements the "wefax.end_reception" method, Get Received WEFAX File.
This method implements the "wefax.get_received_file" method, Get Received WEFAX File.
This method implements the "wefax.state_string" method, Get WEFAX Engine State (RX/TX) for Information.
This method implements the "wefax.send_file" method, Send WEFAX File.
This method implements the "wefax.set_adif_log" method, Set ADIF Logging Status.
This method implements the "wefax.set_max_lines" method, Set Maximum Lines.
This method implements the "wefax.set_tx_abort_flag" method, Set TX Abort Flag - Cancel WEFAX Image Transmission.
This method implements the "wefax.skip_apt" method, Set TX Abort Flag - Skip APT During WEFAX Reception.
This method implements the "wefax.skip_phasing" method, Set TX Abort Flag - Skip Phasing During WEFAX Reception.
This method implements the "wefax.start_manual_reception" method, Set TX Abort Flag - Start FAX Image Reception in Manual Mode.
This section contains some use cases to show the intended use of the FLDG
DLL to control the FLDigi Application.
Source code is provided for C# but is easily translated to VB.NET or C++ .NET.
The following code segments are assumed to be a part of a C# Windows Forms
application and that the form controls activate the following functions.
It is also assumed that there are controls in the form that are used to enter
and display data.
Use a code sequence similar to this to activate FLDigi from an application using the DLL.
Deciding what executable path and command line arguments to use is outside the scope of the DLL logic.
using System.Diagnostics; // interact with system processes
Void Activate_FLDigi()
{
String myFLDigiExecutablePath = “. . .\FLDigi.exe”; // Use the REAL full path to FLDigi Executable
static Process myProcess
= new Process(); // Suggest Making This a
Variable in a Class, not local
myProcess.StartInfo.UseShellExecute = false;
myProcess.StartInfo.FileName = myFLDigiExecutablePath;
// Set Command Line Options as Required
// See FLDigi XML-RPC Document
myProcess.StartInfo.Arguments = "--wo"; // Command Line Option
for Minimize
myProcess.StartInfo.Arguments = ""; // Command Line
Option for Normal
myProcess.StartInfo.CreateNoWindow = false;
myProcess.Start();
}
using TGG_LIB; //
Use TGG Custom Classes
using TGG_LIB.FLDIGI;
private void Terminate_FLDigi()
{
String myServerName = “http://localhost:7362”; // Server Name Shown is Default, Use Arbitrary IP and Port
FLDIGI myFLDIGI = new FLDIGI(); // Suggest Making This a Variable in a Class, not local
myFLDIGI.XmlRpcServerName = myServerName;
}
using TGG_LIB; //
Use TGG Custom Classes
using TGG_LIB.FLDIGI;
private void SetIPandPort_FLDigi()
{
FLDIGI myFLDIGI = new FLDIGI(); // Suggest Making This a Variable in a Class, not local
myFLDIGI.Fldigi_Terminate();
}
This code will capture much information from FLDigi and display it on a form in your application.
Items with name L_ are label controls, CB_ are ComboBox
controls, T_ are TextBox controls, CK_ are CheckBox controls, declarations not shown here.
using
TGG_LIB; // Use TGG Custom
Classes
using
TGG_LIB.FLDIGI;
private
void GetAllInfo()
{
String[] myStringArray;
/////
FLDIGI
//
Labels
L_FLDIGI_ConfigDir.Text
= String.Format("Config
Dir: {0}", m_FLDIGI.Fldigi_Config_Dir());
L_FLDIGI_ProgramName.Text
= String.Format("Pgm
Name: {0}", m_FLDIGI.Fldigi_Name());
L_FLDIGI_ProgramNameAndVersion.Text
= String.Format("Pgm
Name/Ver: {0}", m_FLDIGI.Fldigi_Name_Version());
L_FLDIGI_Version.Text
= String.Format("Version: {0}",
m_FLDIGI.Fldigi_Version());
//
ComboBoxes
myStringArray = m_FLDIGI.Fldigi_List();
if (myStringArray !=
null)
{
CB_FLDIGI_List.Items.Clear();
foreach (String myString in myStringArray)
{
CB_FLDIGI_List.Items.Add(myString);
}
}
/////
LOG
//
TextBoxes
T_Log_Name.Text
= String.Format("{0}", m_FLDIGI.Log_Get_Name());
T_Log_QTH.Text
= String.Format("{0}", m_FLDIGI.Log_Get_QTH());
T_Log_Call.Text
= String.Format("{0}", m_FLDIGI.Log_Get_Call());
T_Log_Exchange.Text
= String.Format("{0}", m_FLDIGI.Log_Get_Exchange());
T_Log_Locator.Text
= String.Format("{0}", m_FLDIGI.Log_Get_Locator());
T_Log_SerialNumber.Text
= String.Format("{0}", m_FLDIGI.Log_Get_Serial_Number());
//
Labels
L_Log_Notes.Text
= String.Format("Notes: {0}", m_FLDIGI.Log_Get_Notes());
L_Log_Frequency.Text
= String.Format("Freq:
{0}", m_FLDIGI.Log_Get_Frequency());
L_Log_Band.Text
= String.Format("Band: {0}", m_FLDIGI.Log_Get_Band());
L_Log_RST_In.Text = String.Format("RST RX: {0}", m_FLDIGI.Log_Get_RST_In());
L_Log_RST_Out.Text
= String.Format("RST TX: {0}",
m_FLDIGI.Log_Get_RST_Out());
L_Log_SerialNumberSent.Text
= String.Format("Sent#: {0}", m_FLDIGI.Log_Get_Serial_Number_Sent());
L_Log_TimeOn.Text
= String.Format("Time On: {0}",
m_FLDIGI.Log_Get_Time_On());
L_Log_TimeOff.Text
= String.Format("Time Off: {0}",
m_FLDIGI.Log_Get_Time_Off());
L_Log_Country.Text
= String.Format("Ctry:
{0}", m_FLDIGI.Log_Get_Country());
L_Log_State.Text
= String.Format("State: {0}", m_FLDIGI.Log_Get_State());
L_Log_Province.Text
= String.Format("Prov:
{0}", m_FLDIGI.Log_Get_Province());
/////
MAIN
//
TextBoxes
T_Main_Frequency.Text
= String.Format("{0}", m_FLDIGI.Main_Get_Frequency());
T_Main_SquelchLevel.Text
= String.Format("{0}", m_FLDIGI.Main_Get_Squelch_Level());
//
Labels
L_Main_MaxMacroID.Text
= String.Format("Max Macro ID: {0}",
m_FLDIGI.Main_Get_Max_Macro_ID());
L_Main_Status1.Text = String.Format("Status1: {0}",
m_FLDIGI.Main_Get_Status1());
L_Main_Status2.Text = String.Format("Status2: {0}",
m_FLDIGI.Main_Get_Status2());
L_Main_TRX_State.Text
= String.Format("TRX State: {0}",
m_FLDIGI.Main_Get_TRX_State());
L_Main_TRX_Status.Text
= String.Format("TRX Status: {0}",
m_FLDIGI.Main_Get_TRX_Status());
//
CheckBoxes
CK_Main_AFC.Checked
= m_FLDIGI.Main_Get_AFC();
CK_Main_Lock.Checked
= m_FLDIGI.Main_Get_Lock();
CK_Main_Squelch.Checked
= m_FLDIGI.Main_Get_Squelch();
CK_Main_Reverse.Checked
= m_FLDIGI.Main_Get_Reverse();
CK_Main_RSID.Checked
= m_FLDIGI.Main_Get_RSID();
/////
RIG
//
TextBoxes
T_Rig_Bandwidth.Text
= String.Format("{0}", m_FLDIGI.Rig_Get_Bandwidth());
T_Rig_Mode.Text
= String.Format("{0}", m_FLDIGI.Rig_Get_Mode());
T_Rig_Frequency.Text
= String.Format("{0}", m_FLDIGI.Rig_Get_Frequency());
T_Rig_Notch.Text
= String.Format("{0}", m_FLDIGI.Rig_Get_Notch());
//
ComboBoxes
//
CB_Rig_Bandwidths
myStringArray = m_FLDIGI.Rig_Get_Bandwidths();
if (myStringArray !=
null)
{
CB_Rig_Bandwidths.Items.Clear();
foreach (String myString in myStringArray)
{
CB_Rig_Bandwidths.Items.Add(myString);
}
}
//
CB_Rig_Modes
myStringArray = m_FLDIGI.Rig_Get_Modes();
if (myStringArray !=
null)
{
CB_Rig_Modes.Items.Clear();
foreach (String myString in myStringArray)
{
CB_Rig_Modes.Items.Add(myString);
}
}
/////
MODEM
//
TextBoxes
T_Modem_AFC_SearchRange.Text
= String.Format("{0}", m_FLDIGI.Modem_Get_AFC_Search_Range());
T_Modem_Bandwidth.Text
= String.Format("{0}", m_FLDIGI.Modem_Get_Bandwidth());
T_Modem_Carrier.Text
= String.Format("{0}", m_FLDIGI.Modem_Get_Carrier());
T_Modem_ID.Text
= String.Format("{0}", m_FLDIGI.Modem_Get_ID());
T_Modem_Name.Text
= String.Format("{0}", m_FLDIGI.Modem_Get_Name());
T_Modem_Olivia_Bandwidth.Text
= String.Format("{0}", m_FLDIGI.Modem_Olivia_Get_Bandwidth());
T_Modem_OliviaTones.Text
= String.Format("{0}", m_FLDIGI.Modem_Olivia_Get_Tones());
//
Labels
L_Modem_MaxID.Text
= String.Format("MaxID:
{0}", m_FLDIGI.Modem_Get_Max_ID());
//
ComboBoxes
//CB_Modem_Names =
myStringArray = m_FLDIGI.Modem_Get_Names();
if (myStringArray !=
null)
{
CB_Modem_Names.Items.Clear();
foreach (String myString in myStringArray)
{
CB_Modem_Names.Items.Add(myString);
}
}
/////
TEXT
//
TextBoxes
T_Text_RX.Text
= m_FLDIGI.Text_Get_RX_All();
}
This code will update information in FLDigi.
Items with name L_ are label controls, CB_ are ComboBox
controls, T_ are TextBox controls, CK_ are CheckBox controls, declarations not shown here.
These routines are event handlers for form controls and are a part of the Form Class.
using
TGG_LIB; // Use TGG Custom
Classes
using
TGG_LIB.FLDIGI;
/// <summary>TextBox: LOG / QTH - Double Click</summary>
private void T_Log_QTH_DoubleClick(object
sender, EventArgs
e)
{
m_FLDIGI.Log_Set_QTH(T_Log_QTH.Text);
}
//=========================================================================================
/// <summary>TextBox: Transmit - KeyPress</summary>
/// <remarks>Send Contents of Transmit field to FLDIGI</remarks>
private void T_Text_TX_KeyPress(object
sender, KeyPressEventArgs
e)
{
String
myString;
switch (e.KeyChar)
{
// Translate CR to CR/LF
case '\r':
myString = "\r\n";
break;
// Pass Along Other Characters As They Are
default:
myString = Convert.ToString(e.KeyChar);
break;
}
m_FLDIGI.Text_Add_TX(myString);
}
//=========================================================================================
/// <summary>TextBox: MAIN / Frequency - Double Click</summary>
private void T_Main_Frequency_DoubleClick(object
sender, EventArgs
e)
{
try
{
m_FLDIGI.Main_Set_Frequency(Convert.ToDouble(T_Main_Frequency.Text));
L_Status.Text
= String.Format("{0}", FLDIGI_ErrorCategory.OK.ToString());
// Report Error Status
ReportErrorStatus();
}
catch (Exception
ex)
{
L_Status.Text
= String.Format("{0}: {1}-{2} {3}",
m_FLDIGI.ErrorCode.ToString(), m_FLDIGI.ErrorName,
m_FLDIGI.ErrorMessage, ex.Message);
m_FLDIGI.Main_Set_Frequency(0.0);
}
}
//=========================================================================================
This document has described the FLDG interface DLL between the Microsoft .NET version 4 programming environment and the FLDigi dll available from the FLDigi download page (see references above). Some basic use cases accessing data in the FLDigi application are shown to help developers get started using the FLDG dll.