DPP ReadCfg: Main Page

DPP ReadCfg 20170920
DPP ReadCfg Configuation Test Program
  • Main Page
  • Namespaces
  • Classes
  • Files
DPP ReadCfg Documentation

Amptek CSharp DP5 Example (ReadCfg)

ReadCfg is a C# .Net application that demonstrates how Amptek DPP communications can be easily integrated into other programs.

What ReadCfg does.

ReadCfg reads a DPP device configuration and demonstrates a minimal set of DPP ASCII Configuration related commands.

  • Reads DPP ASCII Configuration
  • Filters DPP ASCII Configuration by DPP device type
  • (Project source is CSharp vs2005 and above and requires .Net2 or above installed)

ReadCfg Classes

  • ReadCfg.Form1 (Demonstrates DPP ASCII Configuration Command Functions)
  • AsciiCmdUtilities (ASCII Configuration Utilities)

Main ReadCfg Namespace

  • ReadCfg (Controls ReadCfg Functions)

More Information

http://amptek.com/products/dp5-digital-pulse-processor-software/ Amptek Software Page

Generated on Thu Sep 21 2017 15:39:03 for DPP ReadCfg by doxygen 1.7.6.1


DPP ReadCfg: AsciiCmdUtilities.CommandFilters Class Reference

  • Namespaces
  • Classes
  • Files
  • Class List
  • Class Index
  • Class Members
  • AsciiCmdUtilities
  • CommandFilters
Public Member Functions | Static Public Member Functions
AsciiCmdUtilities.CommandFilters Class Reference

List of all members.

Public Member Functions

string | CreateResTestReadBackCmd (bool bSendCoarseFineGain, int DppType)
string | CreateFullReadBackCmd (bool PC5_PRESENT, int DppType, bool isDP5_RevDxGains, byte DPP_ECO)
string | RemoveCmdByDeviceType (string strCfgDataIn, bool PC5_PRESENT, int DppType, bool isDP5_RevDxGains, byte DPP_ECO)
string | GetCmdDesc (string strCmd)
string | CreateSpectrumConfig (string strRawCfgIn)
ArrayList | MakeDp5CmdList ()

Static Public Member Functions

static string | RemoveCmd (string strCmd, string strCfgData)

Detailed Description

Definition at line 10 of file AsciiCmdUtilities.cs.

Member Function Documentation

string AsciiCmdUtilities.CommandFilters.CreateFullReadBackCmd | ( | bool | PC5_PRESENT,
 |  | int | DppType,
 |  | bool | isDP5_RevDxGains,
 |  | byte | DPP_ECO
 | ) |  | [inline]

Definition at line 37 of file AsciiCmdUtilities.cs.

string AsciiCmdUtilities.CommandFilters.CreateResTestReadBackCmd | ( | bool | bSendCoarseFineGain,
 |  | int | DppType
 | ) |  | [inline]

Definition at line 12 of file AsciiCmdUtilities.cs.

string AsciiCmdUtilities.CommandFilters.CreateSpectrumConfig ( string strRawCfgIn ) [inline]

Definition at line 635 of file AsciiCmdUtilities.cs.

Here is the call graph for this function:

string AsciiCmdUtilities.CommandFilters.GetCmdDesc ( string strCmd ) [inline]

Definition at line 326 of file AsciiCmdUtilities.cs.

ArrayList AsciiCmdUtilities.CommandFilters.MakeDp5CmdList ( ) [inline]

Definition at line 656 of file AsciiCmdUtilities.cs.

Here is the caller graph for this function:

static string AsciiCmdUtilities.CommandFilters.RemoveCmd | ( | string | strCmd,
 |  | string | strCfgData
 | ) |  | [inline, static]

Definition at line 191 of file AsciiCmdUtilities.cs.

Here is the caller graph for this function:

string AsciiCmdUtilities.CommandFilters.RemoveCmdByDeviceType | ( | string | strCfgDataIn,
 |  | bool | PC5_PRESENT,
 |  | int | DppType,
 |  | bool | isDP5_RevDxGains,
 |  | byte | DPP_ECO
 | ) |  | [inline]

Definition at line 210 of file AsciiCmdUtilities.cs.

Here is the call graph for this function:

The documentation for this class was generated from the following file:
  • AsciiCmdUtilities.cs
Generated on Thu Sep 21 2017 15:39:02 for DPP ReadCfg by doxygen 1.7.6.1


DPP ReadCfg: csRepeat.FW6DppStatus Class Reference

  • Class List
  • Class Index
  • Class Members
  • csRepeat
  • FW6DppStatus
Public Member Functions | Public Attributes
csRepeat.FW6DppStatus Class Reference

Parse FW6 Dpp Status data packets. More...

List of all members.

Public Member Functions

ulong | GetULong (int ulStart, byte[] buffer)
void | Process_Status (byte[] buffer)
string | ShowStatusValueStrings ()
string | PX5_OptionsString ()
string | GetStatusValueStrings ()
string | VersionToStr (byte bVersion)
string | OnOffStr (bool bOn)
string | GetDeviceNameFromVal (int DeviceTypeVal)

Public Attributes

double | AccumulationTime
bool | MCA_EN
bool | PRECNT_REACHED
bool | PresetRtDone
bool | PresetLtDone
bool | PC5_PRESENT
byte | DEVICE_ID
byte | DPP_ECO = 0
bool | isDP5_RevDxGains = false
const byte | dppDP5 = 0
const byte | dppPX5 = 1
const byte | dppDP5G = 2
const byte | dppMCA8000D = 3
const byte | dppTB5 = 4
const byte | dppDP5X = 5
const byte | PX5_OPTION_NONE = 0
const byte | PX5_OPTION_HPGe_HVPS = 1
const byte | PX5_OPTION_TEST_TEK = 4
const byte | PX5_OPTION_TEST_MOX = 5
const byte | PX5_OPTION_TEST_AMP = 6
const byte | PX5_OPTION_TEST_MODE_1 = 8
const byte | PX5_OPTION_TEST_MODE_2 = 9

Detailed Description

Parse FW6 Dpp Status data packets.

Definition at line 10 of file FW6DppStatus.cs.

Member Function Documentation

string csRepeat.FW6DppStatus.GetDeviceNameFromVal ( int DeviceTypeVal ) [inline]

Definition at line 694 of file FW6DppStatus.cs.

Here is the caller graph for this function:

string csRepeat.FW6DppStatus.GetStatusValueStrings ( ) [inline]

Definition at line 350 of file FW6DppStatus.cs.

Here is the call graph for this function:

ulong csRepeat.FW6DppStatus.GetULong | ( | int | ulStart,
 |  | byte[] | buffer
 | ) |  | [inline]

Definition at line 88 of file FW6DppStatus.cs.

Here is the caller graph for this function:

string csRepeat.FW6DppStatus.OnOffStr ( bool bOn ) [inline]

Definition at line 670 of file FW6DppStatus.cs.

void csRepeat.FW6DppStatus.Process_Status ( byte[] buffer ) [inline]

Definition at line 97 of file FW6DppStatus.cs.

Here is the call graph for this function:

string csRepeat.FW6DppStatus.PX5_OptionsString ( ) [inline]

Definition at line 313 of file FW6DppStatus.cs.

Here is the caller graph for this function:

string csRepeat.FW6DppStatus.ShowStatusValueStrings ( ) [inline]

Definition at line 260 of file FW6DppStatus.cs.

Here is the call graph for this function:

string csRepeat.FW6DppStatus.VersionToStr ( byte bVersion ) [inline]

Definition at line 661 of file FW6DppStatus.cs.

Here is the caller graph for this function:

Member Data Documentation

double csRepeat.FW6DppStatus.AccumulationTime

Definition at line 21 of file FW6DppStatus.cs.

byte csRepeat.FW6DppStatus.DEVICE_ID

Definition at line 55 of file FW6DppStatus.cs.

byte csRepeat.FW6DppStatus.DPP_ECO = 0

Definition at line 62 of file FW6DppStatus.cs.

const byte csRepeat.FW6DppStatus.dppDP5 = 0

Definition at line 70 of file FW6DppStatus.cs.

const byte csRepeat.FW6DppStatus.dppDP5G = 2

Definition at line 72 of file FW6DppStatus.cs.

const byte csRepeat.FW6DppStatus.dppDP5X = 5

Definition at line 75 of file FW6DppStatus.cs.

const byte csRepeat.FW6DppStatus.dppMCA8000D = 3

Definition at line 73 of file FW6DppStatus.cs.

const byte csRepeat.FW6DppStatus.dppPX5 = 1

Definition at line 71 of file FW6DppStatus.cs.

const byte csRepeat.FW6DppStatus.dppTB5 = 4

Definition at line 74 of file FW6DppStatus.cs.

bool csRepeat.FW6DppStatus.isDP5_RevDxGains = false

Definition at line 67 of file FW6DppStatus.cs.

bool csRepeat.FW6DppStatus.MCA_EN

Definition at line 29 of file FW6DppStatus.cs.

bool csRepeat.FW6DppStatus.PC5_PRESENT

Definition at line 47 of file FW6DppStatus.cs.

bool csRepeat.FW6DppStatus.PRECNT_REACHED

Definition at line 30 of file FW6DppStatus.cs.

bool csRepeat.FW6DppStatus.PresetLtDone

Definition at line 32 of file FW6DppStatus.cs.

bool csRepeat.FW6DppStatus.PresetRtDone

Definition at line 31 of file FW6DppStatus.cs.

const byte csRepeat.FW6DppStatus.PX5_OPTION_HPGe_HVPS = 1

Definition at line 80 of file FW6DppStatus.cs.

const byte csRepeat.FW6DppStatus.PX5_OPTION_NONE = 0

Definition at line 79 of file FW6DppStatus.cs.

const byte csRepeat.FW6DppStatus.PX5_OPTION_TEST_AMP = 6

Definition at line 83 of file FW6DppStatus.cs.

const byte csRepeat.FW6DppStatus.PX5_OPTION_TEST_MODE_1 = 8

Definition at line 84 of file FW6DppStatus.cs.

const byte csRepeat.FW6DppStatus.PX5_OPTION_TEST_MODE_2 = 9

Definition at line 85 of file FW6DppStatus.cs.

const byte csRepeat.FW6DppStatus.PX5_OPTION_TEST_MOX = 5

Definition at line 82 of file FW6DppStatus.cs.

const byte csRepeat.FW6DppStatus.PX5_OPTION_TEST_TEK = 4

Definition at line 81 of file FW6DppStatus.cs.

The documentation for this class was generated from the following file:
  • FW6DppStatus.cs


DPP ReadCfg: INIUtilities.IniFile Class Reference

  • Class List
  • Class Index
  • Class Members
  • INIUtilities
  • IniFile
Classes | Public Member Functions | Public Attributes | Properties
INIUtilities.IniFile Class Reference

Provides methods for reading and writing to an INI file. More...

List of all members.

Classes

class | NativeMethods
A static class that provides the win32 P/Invoke signatures used by this class.

Public Member Functions

IniFile (string path)
string | GetString (string sectionName, string keyName, string defaultValue)
Gets the value of a setting in an ini file as a T:System.String.
short | GetInt16 (string sectionName, string keyName, short defaultValue)
Gets the value of a setting in an ini file as a T:System.Int16.
int | GetInt32 (string sectionName, string keyName, int defaultValue)
Gets the value of a setting in an ini file as a T:System.Int32.
double | GetDouble (string sectionName, string keyName, double defaultValue)
Gets the value of a setting in an ini file as a T:System.Double.
bool | GetBoolean (string sectionName, string keyName, bool defaultValue)
Gets the value of a setting in an ini file as a T:System.Boolean.
List< KeyValuePair< string,
string > > 		GetSectionValuesAsList (string sectionName)
Gets all of the values in a section as a list.
Dictionary< string, string > | GetSectionValues (string sectionName)
Gets all of the values in a section as a dictionary.
string[] | GetKeyNames (string sectionName)
Gets the names of all keys under a specific section in the ini file.
string[] | GetSectionNames ()
Gets the names of all sections in the ini file.
void | WriteValue (string sectionName, string keyName, string value)
Writes a T:System.String value to the ini file.
void | WriteValue (string sectionName, string keyName, short value)
Writes an T:System.Int16 value to the ini file.
void | WriteValue (string sectionName, string keyName, int value)
Writes an T:System.Int32 value to the ini file.
void | WriteValue (string sectionName, string keyName, float value)
Writes an T:System.Single value to the ini file.
void | WriteValue (string sectionName, string keyName, double value)
Writes a T:System.Double value to the ini file.
void | WriteValue (string sectionName, string keyName, bool value)
Writes a T:System.Boolean value to the ini file.
void | DeleteKey (string sectionName, string keyName)
Deletes the specified key from the specified section.
void | DeleteSection (string sectionName)
Deletes a section from the ini file.

Public Attributes

const int | MaxSectionSize = 32767
The maximum size of a section in an ini file.

Properties

string | Path [get]
Gets the full path of ini file this object instance is operating on.

Detailed Description

Provides methods for reading and writing to an INI file.

Definition at line 12 of file IniFile.cs.

Constructor & Destructor Documentation

INIUtilities.IniFile.IniFile ( string path ) [inline]

Initializes a new instance of the IniFile class.

Parameters:
path The ini file to read and write from.

Definition at line 105 of file IniFile.cs.

Member Function Documentation

void INIUtilities.IniFile.DeleteKey | ( | string | sectionName,
 |  | string | keyName
 | ) |  | [inline]

Deletes the specified key from the specified section.

Parameters:
sectionName | Name of the section to remove the key from.
keyName | Name of the key to remove.
Exceptions:
ArgumentNullException sectionName or keyName are a null reference (Nothing in VB)

Definition at line 651 of file IniFile.cs.

void INIUtilities.IniFile.DeleteSection ( string sectionName ) [inline]

Deletes a section from the ini file.

Parameters:
sectionName Name of the section to delete.
Exceptions:
ArgumentNullException sectionName is a null reference (Nothing in VB)

Definition at line 671 of file IniFile.cs.

bool INIUtilities.IniFile.GetBoolean | ( | string | sectionName,
 |  | string | keyName,
 |  | bool | defaultValue
 | ) |  | [inline]

Gets the value of a setting in an ini file as a T:System.Boolean.

Parameters:
sectionName | The name of the section to read from.
keyName | The name of the key in section to read.
defaultValue | The default value to return if the key cannot be found.
Returns:
The value of the key, if found. Otherwise, returns defaultValue
Exceptions:
ArgumentNullException sectionName or keyName are a null reference (Nothing in VB)

Definition at line 257 of file IniFile.cs.

Here is the call graph for this function:

double INIUtilities.IniFile.GetDouble | ( | string | sectionName,
 |  | string | keyName,
 |  | double | defaultValue
 | ) |  | [inline]

Gets the value of a setting in an ini file as a T:System.Double.

Parameters:
sectionName | The name of the section to read from.
keyName | The name of the key in section to read.
defaultValue | The default value to return if the key cannot be found.
Returns:
The value of the key, if found. Otherwise, returns defaultValue
Exceptions:
ArgumentNullException sectionName or keyName are a null reference (Nothing in VB)

Definition at line 228 of file IniFile.cs.

Here is the call graph for this function:

short INIUtilities.IniFile.GetInt16 | ( | string | sectionName,
 |  | string | keyName,
 |  | short | defaultValue
 | ) |  | [inline]

Gets the value of a setting in an ini file as a T:System.Int16.

Parameters:
sectionName | The name of the section to read from.
keyName | The name of the key in section to read.
defaultValue | The default value to return if the key cannot be found.
Returns:
The value of the key, if found. Otherwise, returns defaultValue .
Exceptions:
ArgumentNullException sectionName or keyName are a null reference (Nothing in VB)

Definition at line 180 of file IniFile.cs.

Here is the call graph for this function:

int INIUtilities.IniFile.GetInt32 | ( | string | sectionName,
 |  | string | keyName,
 |  | int | defaultValue
 | ) |  | [inline]

Gets the value of a setting in an ini file as a T:System.Int32.

Parameters:
sectionName | The name of the section to read from.
keyName | The name of the key in section to read.
defaultValue | The default value to return if the key cannot be found.
Returns:
The value of the key, if found. Otherwise, returns defaultValue
Exceptions:
ArgumentNullException sectionName or keyName are a null reference (Nothing in VB)

Definition at line 202 of file IniFile.cs.

Here is the caller graph for this function:

string [] INIUtilities.IniFile.GetKeyNames ( string sectionName ) [inline]

Gets the names of all keys under a specific section in the ini file.

Parameters:
sectionName The name of the section to read key names from.
Returns:
An array of key names.

The total length of all key names in the section must be less than 32KB in length.

Exceptions:
ArgumentNullException sectionName is a null reference (Nothing in VB)

Definition at line 402 of file IniFile.cs.

string [] INIUtilities.IniFile.GetSectionNames ( ) [inline]

Gets the names of all sections in the ini file.

Returns:
An array of section names.

The total length of all section names in the section must be less than 32KB in length.

Definition at line 442 of file IniFile.cs.

Dictionary<string, string> INIUtilities.IniFile.GetSectionValues ( string sectionName ) [inline]

Gets all of the values in a section as a dictionary.

Parameters:
sectionName Name of the section to retrieve values from.
Returns:
A Dictionary{T, T} containing the key/value pairs found in this section.

If a section contains more than one key with the same name, this function only returns the first instance. If you need to get all key/value pairs within a section even when keys have the same name, use GetSectionValuesAsList.

Exceptions:
ArgumentNullException sectionName is a null reference (Nothing in VB)

Definition at line 362 of file IniFile.cs.

Here is the call graph for this function:

List<KeyValuePair<string, string> > INIUtilities.IniFile.GetSectionValuesAsList ( string sectionName ) [inline]

Gets all of the values in a section as a list.

Parameters:
sectionName Name of the section to retrieve values from.
Returns:
A List{T} containing KeyValuePair{T1, T2} objects that describe this section. Use this verison if a section may contain multiple items with the same key value. If you know that a section cannot contain multiple values with the same key name or you don't care about the duplicates, use the more convenient GetSectionValues function.
Exceptions:
ArgumentNullException sectionName is a null reference (Nothing in VB)

Definition at line 295 of file IniFile.cs.

Here is the caller graph for this function:

string INIUtilities.IniFile.GetString | ( | string | sectionName,
 |  | string | keyName,
 |  | string | defaultValue
 | ) |  | [inline]

Gets the value of a setting in an ini file as a T:System.String.

Parameters:
sectionName | The name of the section to read from.
keyName | The name of the key in section to read.
defaultValue | The default value to return if the key cannot be found.
Returns:
The value of the key, if found. Otherwise, returns defaultValue

The retreived value must be less than 32KB in length.

Exceptions:
ArgumentNullException sectionName or keyName are a null reference (Nothing in VB)

Definition at line 145 of file IniFile.cs.

Here is the caller graph for this function:

void INIUtilities.IniFile.WriteValue | ( | string | sectionName,
 |  | string | keyName,
 |  | string | value
 | ) |  | [inline]

Writes a T:System.String value to the ini file.

Parameters:
sectionName | The name of the section to write to .
keyName | The name of the key to write to.
value | The string value to write
Exceptions:
T:System.ComponentModel.Win32Exception | The write failed.
ArgumentNullException | sectionName or keyName or value are a null reference (Nothing in VB)

Definition at line 534 of file IniFile.cs.

Here is the caller graph for this function:

void INIUtilities.IniFile.WriteValue | ( | string | sectionName,
 |  | string | keyName,
 |  | short | value
 | ) |  | [inline]

Writes an T:System.Int16 value to the ini file.

Parameters:
sectionName | The name of the section to write to .
keyName | The name of the key to write to.
value | The value to write
Exceptions:
T:System.ComponentModel.Win32Exception The write failed.

Definition at line 557 of file IniFile.cs.

Here is the call graph for this function:

void INIUtilities.IniFile.WriteValue | ( | string | sectionName,
 |  | string | keyName,
 |  | int | value
 | ) |  | [inline]

Writes an T:System.Int32 value to the ini file.

Parameters:
sectionName | The name of the section to write to .
keyName | The name of the key to write to.
value | The value to write
Exceptions:
T:System.ComponentModel.Win32Exception | The write failed.
ArgumentNullException | sectionName or keyName are a null reference (Nothing in VB)

Definition at line 575 of file IniFile.cs.

Here is the call graph for this function:

void INIUtilities.IniFile.WriteValue | ( | string | sectionName,
 |  | string | keyName,
 |  | float | value
 | ) |  | [inline]

Writes an T:System.Single value to the ini file.

Parameters:
sectionName | The name of the section to write to .
keyName | The name of the key to write to.
value | The value to write
Exceptions:
T:System.ComponentModel.Win32Exception | The write failed.
ArgumentNullException | sectionName or keyName are a null reference (Nothing in VB)

Definition at line 593 of file IniFile.cs.

Here is the call graph for this function:

void INIUtilities.IniFile.WriteValue | ( | string | sectionName,
 |  | string | keyName,
 |  | double | value
 | ) |  | [inline]

Writes a T:System.Double value to the ini file.

Parameters:
sectionName | The name of the section to write to .
keyName | The name of the key to write to.
value | The value to write
Exceptions:
T:System.ComponentModel.Win32Exception | The write failed.
ArgumentNullException | sectionName or keyName are a null reference (Nothing in VB)

Definition at line 611 of file IniFile.cs.

Here is the call graph for this function:

void INIUtilities.IniFile.WriteValue | ( | string | sectionName,
 |  | string | keyName,
 |  | bool | value
 | ) |  | [inline]

Writes a T:System.Boolean value to the ini file.

Parameters:
sectionName | The name of the section to write to .
keyName | The name of the key to write to.
value | The value to write
Exceptions:
T:System.ComponentModel.Win32Exception | The write failed.
ArgumentNullException | sectionName or keyName are a null reference (Nothing in VB)

Definition at line 629 of file IniFile.cs.

Here is the call graph for this function:

Member Data Documentation

const int INIUtilities.IniFile.MaxSectionSize = 32767

The maximum size of a section in an ini file.

This property defines the maximum size of the buffers used to retreive data from an ini file. This value is the maximum allowed by the win32 functions GetPrivateProfileSectionNames() or GetPrivateProfileString().

Definition at line 24 of file IniFile.cs.

Property Documentation

string INIUtilities.IniFile.Path [get]

Gets the full path of ini file this object instance is operating on.

A file path.

Definition at line 120 of file IniFile.cs.

The documentation for this class was generated from the following file:
  • IniFile.cs


DPP ReadCfg: ReadCfg.Form1 Class Reference

  • Class List
  • Class Index
  • Class Members
  • ReadCfg
  • Form1
Public Member Functions | Protected Member Functions
ReadCfg.Form1 Class Reference

Summary description for Form1. More...

List of all members.

Public Member Functions

Form1 ()

Protected Member Functions

override void Dispose (bool disposing)
Clean up any resources being used.

Detailed Description

Summary description for Form1.

Definition at line 19 of file Form1.cs.

Constructor & Destructor Documentation

ReadCfg.Form1.Form1 ( ) [inline]

Definition at line 62 of file Form1.cs.

Member Function Documentation

override void ReadCfg.Form1.Dispose ( bool disposing ) [inline, protected]

Clean up any resources being used.

Definition at line 77 of file Form1.cs.

The documentation for this class was generated from the following file:
  • Form1.cs


DPP ReadCfg: Class Members

  • Class List
  • Class Index
  • Class Members
  • All
  • Functions
  • Variables
  • Properties
  • a
  • c
  • d
  • f
  • g
  • i
  • m
  • o
  • p
  • r
  • s
  • v
  • w
Here is a list of all class members with links to the classes they belong to:

- a -

  • AccumulationTime : csRepeat.FW6DppStatus

- c -

  • CreateFullReadBackCmd() : AsciiCmdUtilities.CommandFilters
  • CreateResTestReadBackCmd() : AsciiCmdUtilities.CommandFilters
  • CreateSpectrumConfig() : AsciiCmdUtilities.CommandFilters

- d -

  • DeleteKey() : INIUtilities.IniFile
  • DeleteSection() : INIUtilities.IniFile
  • DEVICE_ID : csRepeat.FW6DppStatus
  • Dispose() : ReadCfg.Form1
  • DPP_ECO : csRepeat.FW6DppStatus
  • dppDP5 : csRepeat.FW6DppStatus
  • dppDP5G : csRepeat.FW6DppStatus
  • dppDP5X : csRepeat.FW6DppStatus
  • dppMCA8000D : csRepeat.FW6DppStatus
  • dppPX5 : csRepeat.FW6DppStatus
  • dppTB5 : csRepeat.FW6DppStatus

- f -

  • Form1() : ReadCfg.Form1

- g -

  • GetBoolean() : INIUtilities.IniFile
  • GetCmdDesc() : AsciiCmdUtilities.CommandFilters
  • GetDeviceNameFromVal() : csRepeat.FW6DppStatus
  • GetDouble() : INIUtilities.IniFile
  • GetInt16() : INIUtilities.IniFile
  • GetInt32() : INIUtilities.IniFile
  • GetKeyNames() : INIUtilities.IniFile
  • GetSectionNames() : INIUtilities.IniFile
  • GetSectionValues() : INIUtilities.IniFile
  • GetSectionValuesAsList() : INIUtilities.IniFile
  • GetStatusValueStrings() : csRepeat.FW6DppStatus
  • GetString() : INIUtilities.IniFile
  • GetULong() : csRepeat.FW6DppStatus

- i -

  • IniFile() : INIUtilities.IniFile
  • isDP5_RevDxGains : csRepeat.FW6DppStatus

- m -

  • MakeDp5CmdList() : AsciiCmdUtilities.CommandFilters
  • MaxSectionSize : INIUtilities.IniFile
  • MCA_EN : csRepeat.FW6DppStatus

- o -

  • OnOffStr() : csRepeat.FW6DppStatus

- p -

  • Path : INIUtilities.IniFile
  • PC5_PRESENT : csRepeat.FW6DppStatus
  • PRECNT_REACHED : csRepeat.FW6DppStatus
  • PresetLtDone : csRepeat.FW6DppStatus
  • PresetRtDone : csRepeat.FW6DppStatus
  • Process_Status() : csRepeat.FW6DppStatus
  • PX5_OPTION_HPGe_HVPS : csRepeat.FW6DppStatus
  • PX5_OPTION_NONE : csRepeat.FW6DppStatus
  • PX5_OPTION_TEST_AMP : csRepeat.FW6DppStatus
  • PX5_OPTION_TEST_MODE_1 : csRepeat.FW6DppStatus
  • PX5_OPTION_TEST_MODE_2 : csRepeat.FW6DppStatus
  • PX5_OPTION_TEST_MOX : csRepeat.FW6DppStatus
  • PX5_OPTION_TEST_TEK : csRepeat.FW6DppStatus
  • PX5_OptionsString() : csRepeat.FW6DppStatus

- r -

  • RemoveCmd() : AsciiCmdUtilities.CommandFilters
  • RemoveCmdByDeviceType() : AsciiCmdUtilities.CommandFilters

- s -

  • ShowStatusValueStrings() : csRepeat.FW6DppStatus

- v -

  • VersionToStr() : csRepeat.FW6DppStatus

- w -

  • WriteValue() : INIUtilities.IniFile


DPP ReadCfg: Class Members - Functions

  • Class List
  • Class Index
  • Class Members
  • All
  • Functions
  • Variables
  • Properties
  • c
  • d
  • f
  • g
  • i
  • m
  • o
  • p
  • r
  • s
  • v
  • w

- c -

  • CreateFullReadBackCmd() : AsciiCmdUtilities.CommandFilters
  • CreateResTestReadBackCmd() : AsciiCmdUtilities.CommandFilters
  • CreateSpectrumConfig() : AsciiCmdUtilities.CommandFilters

- d -

  • DeleteKey() : INIUtilities.IniFile
  • DeleteSection() : INIUtilities.IniFile
  • Dispose() : ReadCfg.Form1

- f -

  • Form1() : ReadCfg.Form1

- g -

  • GetBoolean() : INIUtilities.IniFile
  • GetCmdDesc() : AsciiCmdUtilities.CommandFilters
  • GetDeviceNameFromVal() : csRepeat.FW6DppStatus
  • GetDouble() : INIUtilities.IniFile
  • GetInt16() : INIUtilities.IniFile
  • GetInt32() : INIUtilities.IniFile
  • GetKeyNames() : INIUtilities.IniFile
  • GetSectionNames() : INIUtilities.IniFile
  • GetSectionValues() : INIUtilities.IniFile
  • GetSectionValuesAsList() : INIUtilities.IniFile
  • GetStatusValueStrings() : csRepeat.FW6DppStatus
  • GetString() : INIUtilities.IniFile
  • GetULong() : csRepeat.FW6DppStatus

- i -

  • IniFile() : INIUtilities.IniFile

- m -

  • MakeDp5CmdList() : AsciiCmdUtilities.CommandFilters

- o -

  • OnOffStr() : csRepeat.FW6DppStatus

- p -

  • Process_Status() : csRepeat.FW6DppStatus
  • PX5_OptionsString() : csRepeat.FW6DppStatus

- r -

  • RemoveCmd() : AsciiCmdUtilities.CommandFilters
  • RemoveCmdByDeviceType() : AsciiCmdUtilities.CommandFilters

- s -

  • ShowStatusValueStrings() : csRepeat.FW6DppStatus

- v -

  • VersionToStr() : csRepeat.FW6DppStatus

- w -

  • WriteValue() : INIUtilities.IniFile


DPP ReadCfg: Class Members - Variables

  • Class List
  • Class Index
  • Class Members
  • All
  • Functions
  • Variables
  • Properties
  • AccumulationTime : csRepeat.FW6DppStatus
  • DEVICE_ID : csRepeat.FW6DppStatus
  • DPP_ECO : csRepeat.FW6DppStatus
  • dppDP5 : csRepeat.FW6DppStatus
  • dppDP5G : csRepeat.FW6DppStatus
  • dppDP5X : csRepeat.FW6DppStatus
  • dppMCA8000D : csRepeat.FW6DppStatus
  • dppPX5 : csRepeat.FW6DppStatus
  • dppTB5 : csRepeat.FW6DppStatus
  • isDP5_RevDxGains : csRepeat.FW6DppStatus
  • MaxSectionSize : INIUtilities.IniFile
  • MCA_EN : csRepeat.FW6DppStatus
  • PC5_PRESENT : csRepeat.FW6DppStatus
  • PRECNT_REACHED : csRepeat.FW6DppStatus
  • PresetLtDone : csRepeat.FW6DppStatus
  • PresetRtDone : csRepeat.FW6DppStatus
  • PX5_OPTION_HPGe_HVPS : csRepeat.FW6DppStatus
  • PX5_OPTION_NONE : csRepeat.FW6DppStatus
  • PX5_OPTION_TEST_AMP : csRepeat.FW6DppStatus
  • PX5_OPTION_TEST_MODE_1 : csRepeat.FW6DppStatus
  • PX5_OPTION_TEST_MODE_2 : csRepeat.FW6DppStatus
  • PX5_OPTION_TEST_MOX : csRepeat.FW6DppStatus
  • PX5_OPTION_TEST_TEK : csRepeat.FW6DppStatus


DPP ReadCfg: Class Members - Properties

  • Class List
  • Class Index
  • Class Members
  • All
  • Functions
  • Variables
  • Properties
  • Path : INIUtilities.IniFile


DPP ReadCfg: AsciiCmdUtilities.cs File Reference

  • File List
Classes | Namespaces
AsciiCmdUtilities.cs File Reference

Go to the source code of this file.

Classes

class | AsciiCmdUtilities.CommandFilters

Namespaces

package | AsciiCmdUtilities
Generated on Thu Sep 21 2017 15:39:02 for DPP ReadCfg by doxygen 1.7.6.1


DPP ReadCfg: AssemblyInfo.cs File Reference

  • File List
AssemblyInfo.cs File Reference

Go to the source code of this file.

Generated on Thu Sep 21 2017 15:39:02 for DPP ReadCfg by doxygen 1.7.6.1


DPP ReadCfg: Form1.cs File Reference

  • File List
Classes | Namespaces
Form1.cs File Reference

Go to the source code of this file.

Classes

class | ReadCfg.Form1
Summary description for Form1. More...

Namespaces

package | ReadCfg
Generated on Thu Sep 21 2017 15:39:02 for DPP ReadCfg by doxygen 1.7.6.1


DPP ReadCfg: FW6DppStatus.cs File Reference

  • File List
Classes | Namespaces
FW6DppStatus.cs File Reference

Go to the source code of this file.

Classes

class | csRepeat.FW6DppStatus
Parse FW6 Dpp Status data packets. More...

Namespaces

package | csRepeat
Generated on Thu Sep 21 2017 15:39:02 for DPP ReadCfg by doxygen 1.7.6.1


DPP ReadCfg: IniFile.cs File Reference

  • File List
Classes | Namespaces
IniFile.cs File Reference

Go to the source code of this file.

Classes

class | INIUtilities.IniFile
Provides methods for reading and writing to an INI file. More...
class | INIUtilities.IniFile.NativeMethods
A static class that provides the win32 P/Invoke signatures used by this class.

Namespaces

package | INIUtilities
Generated on Thu Sep 21 2017 15:39:02 for DPP ReadCfg by doxygen 1.7.6.1


DPP ReadCfg: AsciiCmdUtilities.cs Source File

  • File List
AsciiCmdUtilities.cs
Go to the documentation of this file.
00001 using System;
00002 using System.Collections;
00003 using System.Globalization;
00004 using System.Runtime.InteropServices;
00005 using System.Text;
00006 using csRepeat;
00007
00008 namespace AsciiCmdUtilities
00009 {
00010     public class CommandFilters
00011     {
00012         public string CreateResTestReadBackCmd(bool bSendCoarseFineGain, int DppType)
00013         {
00014             string strCfg = "";
00015             bool isINOF;
00016
00017             isINOF = (DppType != FW6DppStatus.dppDP5G) && (DppType != FW6DppStatus.dppTB5);
00018             strCfg = "";
00019             strCfg += "CLCK=?;";
00020             strCfg += "TPEA=?;";
00021             if (bSendCoarseFineGain) { strCfg += "GAIF=?;"; }
00022             if (!bSendCoarseFineGain) { strCfg += "GAIN=?;"; }
00023             strCfg += "RESL=?;";
00024             strCfg += "TFLA=?;";
00025             strCfg += "TPFA=?;";
00026             strCfg += "PURE=?;";
00027             strCfg += "RTDE=?;";
00028             strCfg += "MCAS=?;";
00029             strCfg += "MCAC=?;";
00030             strCfg += "SOFF=?;";
00031             strCfg += "AINP=?;";
00032             if (isINOF) { strCfg += "INOF=?;"; }
00033             if (bSendCoarseFineGain) { strCfg += "GAIA=?;"; }
00034             return strCfg;
00035         }
00036
00037         public string CreateFullReadBackCmd(bool PC5_PRESENT, int DppType, bool isDP5_RevDxGains, byte DPP_ECO)
00038         {
00039             string strCfg = "";
00040             bool isHVSE;
00041             bool isPAPS;
00042             bool isTECS;
00043             bool isVOLU;
00044             bool isCON1;
00045             bool isCON2;
00046             bool isINOF;
00047             bool isBOOT;
00048             bool isGATE;
00049             bool isPAPZ;
00050             bool isSCTC;
00051             bool isDP5_DxK = false;
00052             bool isDP5_DxL = false;
00053
00054             if (DppType == FW6DppStatus.dppMCA8000D)
00055             {
00056                 strCfg = CreateFullReadBackCmdMCA8000D(DppType);
00057                 return strCfg;
00058             }
00059
00060             // DP5 Rev Dx K,L needs PAPZ
00061             if ((DppType == FW6DppStatus.dppDP5) && isDP5_RevDxGains)
00062             {
00063                 if ((DPP_ECO & 0x0F) == 0x0A)
00064                 {
00065                     isDP5_DxK = true;
00066                 }
00067                 if ((DPP_ECO & 0x0F) == 0x0B)
00068                 {
00069                     isDP5_DxL = true;
00070                 }
00071             }
00072
00073             isHVSE = (((DppType != FW6DppStatus.dppPX5) && PC5_PRESENT) || DppType == FW6DppStatus.dppPX5);
00074             isPAPS = (DppType != FW6DppStatus.dppDP5G) && (DppType != FW6DppStatus.dppTB5);
00075             isTECS = (((DppType == FW6DppStatus.dppDP5) && PC5_PRESENT) || (DppType == FW6DppStatus.dppPX5) || (DppType == FW6DppStatus.dppDP5X));
00076             isVOLU = (DppType == FW6DppStatus.dppPX5);
00077             isCON1 = ((DppType != FW6DppStatus.dppDP5) && (DppType != FW6DppStatus.dppDP5X));
00078             isCON2 = ((DppType != FW6DppStatus.dppDP5) && (DppType != FW6DppStatus.dppDP5X));
00079             isINOF = (DppType != FW6DppStatus.dppDP5G) && (DppType != FW6DppStatus.dppTB5);
00080             isSCTC = (DppType == FW6DppStatus.dppDP5G) || (DppType == FW6DppStatus.dppTB5);
00081             isBOOT = ((DppType == FW6DppStatus.dppDP5) || (DppType == FW6DppStatus.dppDP5X));
00082             isGATE = ((DppType == FW6DppStatus.dppDP5) || (DppType == FW6DppStatus.dppDP5X));
00083             isPAPZ = (DppType == FW6DppStatus.dppPX5) || isDP5_DxK || isDP5_DxL;
00084
00085             strCfg = "";
00086             strCfg += "RESC=?;";
00087             strCfg += "CLCK=?;";
00088             strCfg += "TPEA=?;";
00089             strCfg += "GAIF=?;";
00090             strCfg += "GAIN=?;";
00091             strCfg += "RESL=?;";
00092             strCfg += "TFLA=?;";
00093             strCfg += "TPFA=?;";
00094             strCfg += "PURE=?;";
00095             if (isSCTC) { strCfg += "SCTC=?;"; }
00096             strCfg += "RTDE=?;";
00097             strCfg += "MCAS=?;";
00098             strCfg += "MCAC=?;";
00099             strCfg += "SOFF=?;";
00100             strCfg += "AINP=?;";
00101             if (isINOF) { strCfg += "INOF=?;"; }
00102             strCfg += "GAIA=?;";
00103             strCfg += "CUSP=?;";
00104             strCfg += "PDMD=?;";
00105             strCfg += "THSL=?;";
00106             strCfg += "TLLD=?;";
00107             strCfg += "THFA=?;";
00108             strCfg += "DACO=?;";
00109             strCfg += "DACF=?;";
00110             strCfg += "RTDS=?;";
00111             strCfg += "RTDT=?;";
00112             strCfg += "BLRM=?;";
00113             strCfg += "BLRD=?;";
00114             strCfg += "BLRU=?;";
00115             if (isGATE) { strCfg += "GATE=?;"; }
00116             strCfg += "AUO1=?;";
00117             strCfg += "PRET=?;";
00118             strCfg += "PRER=?;";
00119             strCfg += "PREC=?;";
00120             strCfg += "PRCL=?;";
00121             strCfg += "PRCH=?;";
00122             if (isHVSE) { strCfg += "HVSE=?;"; }
00123             if (isTECS) { strCfg += "TECS=?;"; }
00124             if (isPAPZ) { strCfg += "PAPZ=?;"; }
00125             if (isPAPS) { strCfg += "PAPS=?;"; }
00126             strCfg += "SCOE=?;";
00127             strCfg += "SCOT=?;";
00128             strCfg += "SCOG=?;";
00129             strCfg += "MCSL=?;";
00130             strCfg += "MCSH=?;";
00131             strCfg += "MCST=?;";
00132             strCfg += "AUO2=?;";
00133             strCfg += "TPMO=?;";
00134             strCfg += "GPED=?;";
00135             strCfg += "GPIN=?;";
00136             strCfg += "GPME=?;";
00137             strCfg += "GPGA=?;";
00138             strCfg += "GPMC=?;";
00139             strCfg += "MCAE=?;";
00140             if (isVOLU) { strCfg += "VOLU=?;"; }
00141             if (isCON1) { strCfg += "CON1=?;"; }
00142             if (isCON2) { strCfg += "CON2=?;"; }
00143             if (isBOOT) { strCfg += "BOOT=?;"; }
00144             return strCfg;
00145         }
00146
00147         string CreateFullReadBackCmdMCA8000D(int DppType)
00148         {
00149             string strCfg = "";
00150
00151             if (DppType == FW6DppStatus.dppMCA8000D)
00152             {
00153                 strCfg += "RESC=?;";
00154                 strCfg += "PURE=?;";
00155                 strCfg += "MCAS=?;";
00156                 strCfg += "MCAC=?;";
00157                 strCfg += "SOFF=?;";
00158                 strCfg += "GAIA=?;";
00159                 strCfg += "PDMD=?;";
00160                 strCfg += "THSL=?;";
00161                 strCfg += "TLLD=?;";
00162                 strCfg += "GATE=?;";
00163                 strCfg += "AUO1=?;";
00164                 //strCfg += "PRET=?;";
00165                 strCfg += "PRER=?;";
00166                 strCfg += "PREL=?;";
00167                 strCfg += "PREC=?;";
00168                 strCfg += "PRCL=?;";
00169                 strCfg += "PRCH=?;";
00170                 strCfg += "SCOE=?;";
00171                 strCfg += "SCOT=?;";
00172                 strCfg += "SCOG=?;";
00173                 strCfg += "MCSL=?;";
00174                 strCfg += "MCSH=?;";
00175                 strCfg += "MCST=?;";
00176                 strCfg += "AUO2=?;";
00177                 strCfg += "GPED=?;";
00178                 strCfg += "GPIN=?;";
00179                 strCfg += "GPME=?;";
00180                 strCfg += "GPGA=?;";
00181                 strCfg += "GPMC=?;";
00182                 strCfg += "MCAE=?;";
00183                 //strCfg += "VOLU=?;";
00184                 //strCfg += "CON1=?;";
00185                 //strCfg += "CON2=?;";
00186                 strCfg += "PDMD=?;";
00187             }
00188             return strCfg;
00189         }
00190
00191         public static string RemoveCmd(string strCmd, string strCfgData)
00192         {
00193             int iStart, iEnd, iCmd;
00194             string strNew = "";
00195
00196             strNew = strCfgData;
00197             if (strCfgData.Length < 7) { return strCfgData; }   // no data
00198             if (strCmd.Length != 4) { return strCfgData; }              // bad command
00199             iCmd = (int)strCfgData.IndexOf(strCmd + "=", 0);
00200             if (iCmd == -1) { return strCfgData; }                                              // cmd not found
00201             iStart = iCmd;
00202             iEnd = (int)strCfgData.IndexOf(";", iCmd);
00203             if (iEnd == -1) { return strCfgData; }                                              // end not found
00204             if (iEnd <= iStart) { return strCfgData; }                                  // unknown error
00205             strNew = strCfgData.Substring(0, iStart) + strCfgData.Substring(iEnd + 1);
00206             return strNew;
00207         }
00208
00210         public string RemoveCmdByDeviceType(string strCfgDataIn, bool PC5_PRESENT, int DppType, bool isDP5_RevDxGains, byte DPP_ECO)
00211         {
00212             string strCfgData;
00213             bool isHVSE;
00214             bool isPAPS;
00215             bool isTECS;
00216             bool isVOLU;
00217             bool isCON1;
00218             bool isCON2;
00219             bool isINOF;
00220             bool isBOOT;
00221             bool isGATE;
00222             bool isPAPZ;
00223             bool isSCTC;
00224             bool isPREL;
00225             bool isDP5_DxK = false;
00226             bool isDP5_DxL = false;
00227
00228             strCfgData = strCfgDataIn;
00229             if (DppType == FW6DppStatus.dppMCA8000D)
00230             {
00231                 strCfgData = Remove_MCA8000D_Cmds(strCfgData, DppType);
00232                 return strCfgData;
00233             }
00234
00235             // DP5 Rev Dx K,L needs PAPZ
00236             if ((DppType == FW6DppStatus.dppDP5) && isDP5_RevDxGains)
00237             {
00238                 if ((DPP_ECO & 0x0F) == 0x0A)
00239                 {
00240                     isDP5_DxK = true;
00241                 }
00242                 if ((DPP_ECO & 0x0F) == 0x0B)
00243                 {
00244                     isDP5_DxL = true;
00245                 }
00246             }
00247
00248             isHVSE = (((DppType != FW6DppStatus.dppPX5) && PC5_PRESENT) || DppType == FW6DppStatus.dppPX5);
00249             isPAPS = (DppType != FW6DppStatus.dppDP5G) && (DppType != FW6DppStatus.dppTB5);
00250             isTECS = (((DppType == FW6DppStatus.dppDP5) && PC5_PRESENT) || (DppType == FW6DppStatus.dppPX5) || (DppType == FW6DppStatus.dppDP5X));
00251             isVOLU = (DppType == FW6DppStatus.dppPX5);
00252             isCON1 = ((DppType != FW6DppStatus.dppDP5) && (DppType != FW6DppStatus.dppDP5X));
00253             isCON2 = ((DppType != FW6DppStatus.dppDP5) && (DppType != FW6DppStatus.dppDP5X));
00254             isINOF = (DppType != FW6DppStatus.dppDP5G) && (DppType != FW6DppStatus.dppTB5);
00255             isSCTC = (DppType == FW6DppStatus.dppDP5G) || (DppType == FW6DppStatus.dppTB5);
00256             isBOOT = ((DppType == FW6DppStatus.dppDP5) || (DppType == FW6DppStatus.dppDP5X));
00257             isGATE = ((DppType == FW6DppStatus.dppDP5) || (DppType == FW6DppStatus.dppDP5X));
00258             isPAPZ = (DppType == FW6DppStatus.dppPX5) || isDP5_DxK || isDP5_DxL;
00259             isPREL = (DppType == FW6DppStatus.dppMCA8000D);
00260             if (!isHVSE) { strCfgData = RemoveCmd("HVSE", strCfgData); }  //High Voltage Bias
00261             if (!isPAPS) { strCfgData = RemoveCmd("PAPS", strCfgData); }  //Preamp Voltage
00262             if (!isTECS) { strCfgData = RemoveCmd("TECS", strCfgData); }  //Cooler Temperature
00263             if (!isVOLU) { strCfgData = RemoveCmd("VOLU", strCfgData); }  //px5 speaker
00264             if (!isCON1) { strCfgData = RemoveCmd("CON1", strCfgData); }  //connector 1
00265             if (!isCON2) { strCfgData = RemoveCmd("CON2", strCfgData); }  //connector 2
00266             if (!isINOF) { strCfgData = RemoveCmd("INOF", strCfgData); }  //input offset
00267             if (!isBOOT) { strCfgData = RemoveCmd("BOOT", strCfgData); }  //PC5 On At StartUp
00268             if (!isGATE) { strCfgData = RemoveCmd("GATE", strCfgData); }  //Gate input
00269             if (!isPAPZ) { strCfgData = RemoveCmd("PAPZ", strCfgData); }  //Pole-Zero
00270             if (!isSCTC) { strCfgData = RemoveCmd("SCTC", strCfgData); }  //Scintillator Time Constant
00271             if (!isPREL) { strCfgData = RemoveCmd("PREL", strCfgData); }  //Preset Live Time
00272             return strCfgData;
00273         }
00274
00276         string Remove_MCA8000D_Cmds(string strCfgDataIn, int DppType)
00277         {
00278             string strCfgData;
00279
00280             strCfgData = strCfgDataIn;
00281             if (DppType == FW6DppStatus.dppMCA8000D)
00282             {
00283                 strCfgData = RemoveCmd("CLCK", strCfgData);
00284                 strCfgData = RemoveCmd("TPEA", strCfgData);
00285                 strCfgData = RemoveCmd("GAIF", strCfgData);
00286                 strCfgData = RemoveCmd("GAIN", strCfgData);
00287                 strCfgData = RemoveCmd("RESL", strCfgData);
00288                 strCfgData = RemoveCmd("TFLA", strCfgData);
00289                 strCfgData = RemoveCmd("TPFA", strCfgData);
00290                 //strCfgData = RemoveCmd("PURE", strCfgData);
00291                 strCfgData = RemoveCmd("RTDE", strCfgData);
00292                 strCfgData = RemoveCmd("AINP", strCfgData);
00293                 strCfgData = RemoveCmd("INOF", strCfgData);
00294                 strCfgData = RemoveCmd("CUSP", strCfgData);
00295                 strCfgData = RemoveCmd("THFA", strCfgData);
00296                 strCfgData = RemoveCmd("DACO", strCfgData);
00297                 strCfgData = RemoveCmd("DACF", strCfgData);
00298                 strCfgData = RemoveCmd("RTDS", strCfgData);
00299                 strCfgData = RemoveCmd("RTDT", strCfgData);
00300                 strCfgData = RemoveCmd("BLRM", strCfgData);
00301                 strCfgData = RemoveCmd("BLRD", strCfgData);
00302                 strCfgData = RemoveCmd("BLRU", strCfgData);
00303                 strCfgData = RemoveCmd("PRET", strCfgData);
00304                 strCfgData = RemoveCmd("HVSE", strCfgData);
00305                 strCfgData = RemoveCmd("TECS", strCfgData);
00306                 strCfgData = RemoveCmd("PAPZ", strCfgData);
00307                 strCfgData = RemoveCmd("PAPS", strCfgData);
00308                 strCfgData = RemoveCmd("TPMO", strCfgData);
00309                 strCfgData = RemoveCmd("SCAH", strCfgData);
00310                 strCfgData = RemoveCmd("SCAI", strCfgData);
00311                 strCfgData = RemoveCmd("SCAL", strCfgData);
00312                 strCfgData = RemoveCmd("SCAO", strCfgData);
00313                 strCfgData = RemoveCmd("SCAW", strCfgData);
00314                 strCfgData = RemoveCmd("BOOT", strCfgData);
00315
00316                 // added to list late, recheck at later date 20120817
00317                 strCfgData = RemoveCmd("CON1", strCfgData);
00318                 strCfgData = RemoveCmd("CON2", strCfgData);
00319
00320                 // not implemented as of 20120817, will be implemented at some time
00321                 strCfgData = RemoveCmd("VOLU", strCfgData);
00322             }
00323             return strCfgData;
00324         }
00325
00326         public string GetCmdDesc(string strCmd)
00327         {
00328             string strCmdName = "";
00329             if (strCmd == "RESC")
00330             {
00331                 strCmdName = "Reset Configuration";
00332             }
00333             else if (strCmd == "CLCK")
00334             {
00335                 strCmdName = "20MHz/80MHz";
00336             }
00337             else if (strCmd == "TPEA")
00338             {
00339                 strCmdName = "Peaking Time";
00340             }
00341             else if (strCmd == "GAIF")
00342             {
00343                 strCmdName = "Fine Gain";
00344             }
00345             else if (strCmd == "GAIN")
00346             {
00347                 strCmdName = "Total Gain (Analog * Fine)";
00348             }
00349             else if (strCmd == "RESL")
00350             {
00351                 strCmdName = "Detector Reset Lockout";
00352             }
00353             else if (strCmd == "TFLA")
00354             {
00355                 strCmdName = "Flat Top";
00356             }
00357             else if (strCmd == "TPFA")
00358             {
00359                 strCmdName = "Fast Channel Peaking Time";
00360             }
00361             else if (strCmd == "PURE")
00362             {
00363                 strCmdName = "PUR Interval On/Off";
00364             }
00365             else if (strCmd == "RTDE")
00366             {
00367                 strCmdName = "RTD On/Off";
00368             }
00369             else if (strCmd == "MCAS")
00370             {
00371                 strCmdName = "MCA Source";
00372             }
00373             else if (strCmd == "MCAC")
00374             {
00375                 strCmdName = "MCA/MCS Channels";
00376             }
00377             else if (strCmd == "SOFF")
00378             {
00379                 strCmdName = "Set Spectrum Offset";
00380             }
00381             else if (strCmd == "AINP")
00382             {
00383                 strCmdName = "Analog Input Pos/Neg";
00384             }
00385             else if (strCmd == "INOF")
00386             {
00387                 strCmdName = "Input Offset";
00388             }
00389             else if (strCmd == "GAIA")
00390             {
00391                 strCmdName = "Analog Gain Index";
00392             }
00393             else if (strCmd == "CUSP")
00394             {
00395                 strCmdName = "Non-Trapezoidal Shaping";
00396             }
00397             else if (strCmd == "PDMD")
00398             {
00399                 strCmdName = "Peak Detect Mode (Min/Max)";
00400             }
00401             else if (strCmd == "THSL")
00402             {
00403                 strCmdName = "Slow Threshold";
00404             }
00405             else if (strCmd == "TLLD")
00406             {
00407                 strCmdName = "LLD Threshold";
00408             }
00409             else if (strCmd == "THFA")
00410             {
00411                 strCmdName = "Fast Threshold";
00412             }
00413             else if (strCmd == "DACO")
00414             {
00415                 strCmdName = "DAC Output";
00416             }
00417             else if (strCmd == "DACF")
00418             {
00419                 strCmdName = "DAC Offset";
00420             }
00421             else if (strCmd == "RTDS")
00422             {
00423                 strCmdName = "RTD Sensitivity";
00424             }
00425             else if (strCmd == "RTDT")
00426             {
00427                 strCmdName = "RTD Threshold";
00428             }
00429             else if (strCmd == "RTDD")
00430             {
00431                 strCmdName = "Custom RTD Oneshot Delay";
00432             }
00433             else if (strCmd == "RTDW")
00434             {
00435                 strCmdName = "Custom RTD Oneshot Width";
00436             }
00437             else if (strCmd == "BLRM")
00438             {
00439                 strCmdName = "BLR Mode";
00440             }
00441             else if (strCmd == "BLRD")
00442             {
00443                 strCmdName = "BLR Down Correction";
00444             }
00445             else if (strCmd == "BLRU")
00446             {
00447                 strCmdName = "BLR Up Correction";
00448             }
00449             else if (strCmd == "GATE")
00450             {
00451                 strCmdName = "Gate Control";
00452             }
00453             else if (strCmd == "AUO1")
00454             {
00455                 strCmdName = "AUX_OUT Selection";
00456             }
00457             else if (strCmd == "PRET")
00458             {
00459                 strCmdName = "Preset Time";
00460             }
00461             else if (strCmd == "PRER")
00462             {
00463                 strCmdName = "Preset Real Time";
00464             }
00465             else if (strCmd == "PREL")
00466             {
00467                 strCmdName = "Preset Live Time";
00468             }
00469             else if (strCmd == "PREC")
00470             {
00471                 strCmdName = "Preset Counts";
00472             }
00473             else if (strCmd == "PRCL")
00474             {
00475                 strCmdName = "Preset Counts Low Threshold";
00476             }
00477             else if (strCmd == "PRCH")
00478             {
00479                 strCmdName = "Preset Counts High Threshold";
00480             }
00481             else if (strCmd == "HVSE")
00482             {
00483                 strCmdName = "HV Set";
00484             }
00485             else if (strCmd == "TECS")
00486             {
00487                 strCmdName = "TEC Set";
00488             }
00489             else if (strCmd == "PAPZ")
00490             {
00491                 strCmdName = "Pole-Zero";
00492             }
00493             else if (strCmd == "PAPS")
00494             {
00495                 strCmdName = "Preamp 8.5/5 (N/A)";
00496             }
00497             else if (strCmd == "SCOE")
00498             {
00499                 strCmdName = "Scope Trigger Edge";
00500             }
00501             else if (strCmd == "SCOT")
00502             {
00503                 strCmdName = "Scope Trigger Position";
00504             }
00505             else if (strCmd == "SCOG")
00506             {
00507                 strCmdName = "Digital Scope Gain";
00508             }
00509             else if (strCmd == "MCSL")
00510             {
00511                 strCmdName = "MCS Low Threshold";
00512             }
00513             else if (strCmd == "MCSH")
00514             {
00515                 strCmdName = "MCS High Threshold";
00516             }
00517             else if (strCmd == "MCST")
00518             {
00519                 strCmdName = "MCS Timebase";
00520             }
00521             else if (strCmd == "AUO2")
00522             {
00523                 strCmdName = "AUX_OUT2 Selection";
00524             }
00525             else if (strCmd == "TPMO")
00526             {
00527                 strCmdName = "Test Pulser On/Off";
00528             }
00529             else if (strCmd == "GPED")
00530             {
00531                 strCmdName = "G.P. Counter Edge";
00532             }
00533             else if (strCmd == "GPIN")
00534             {
00535                 strCmdName = "G.P. Counter Input";
00536             }
00537             else if (strCmd == "GPME")
00538             {
00539                 strCmdName = "G.P. Counter Uses MCA_EN?";
00540             }
00541             else if (strCmd == "GPGA")
00542             {
00543                 strCmdName = "G.P. Counter Uses GATE?";
00544             }
00545             else if (strCmd == "GPMC")
00546             {
00547                 strCmdName = "G.P. Counter Cleared With MCA Counters?";
00548             }
00549             else if (strCmd == "MCAE")
00550             {
00551                 strCmdName = "MCA/MCS Enable";
00552             }
00553             else if (strCmd == "VOLU")
00554             {
00555                 strCmdName = "Speaker On/Off";
00556             }
00557             else if (strCmd == "CON1")
00558             {
00559                 strCmdName = "Connector 1";
00560             }
00561             else if (strCmd == "CON2")
00562             {
00563                 strCmdName = "Connector 2";
00564             }
00565             else if (strCmd == "SCAH")
00566             {
00567                 strCmdName = "SCAx High Threshold";
00568             }
00569             else if (strCmd == "SCAI")
00570             {
00571                 strCmdName = "SCA Index";
00572             }
00573             else if (strCmd == "SCAL")
00574             {
00575                 strCmdName = "SCAx Low Theshold";
00576             }
00577             else if (strCmd == "SCAO")
00578             {
00579                 strCmdName = "SCAx Output (SCA1-8 Only)";
00580             }
00581             else if (strCmd == "SCAW")
00582             {
00583                 strCmdName = "SCA Pulse Width (Not Indexed - SCA1-8)";
00584             }
00585             else if (strCmd == "BOOT")
00586             {
00587                 strCmdName = "Turn Supplies On/Off At Power Up";
00588             }
00589             return strCmdName;
00590         }
00591
00592         string AppendCmdDesc(string strCmd, string strCfgData)
00593         {
00594                 int iStart,iEnd,iCmd;
00595                 string strNew;
00596                 string strDesc;
00597
00598                 strNew = "";
00599                 if (strCfgData.Length < 7)
00600             {
00601                 return strCfgData;
00602             }   // no data
00603                 if (strCmd.Length != 4)
00604             {
00605                 return strCfgData;
00606             }           // bad command
00607             iCmd = (int)strCfgData.IndexOf(strCmd + "=", 0);
00608                 if (iCmd == -1)
00609             {
00610                 return strCfgData;
00611             }                                           // cmd not found
00612             iEnd = (int)strCfgData.IndexOf(";", iCmd);
00613                 if (iEnd == -1)
00614             {
00615                 return strCfgData;
00616             }                   // data end found
00617             iStart = (int)strCfgData.IndexOf("=", iCmd);
00618                 if (iStart != (iCmd + 4))
00619             {
00620                 return strCfgData;
00621             }                   // data start not found
00622                 if (iStart >= iEnd)
00623             {
00624                 return strCfgData;
00625             }           // data error
00626                 strDesc = GetCmdDesc(strCmd);
00627                 if (strDesc.Length == 0)
00628             {
00629                 return strCfgData;
00630             }           // cmd desc  not found
00631             strNew = strCfgData.Substring(0, iEnd + 1) + "    " + strDesc + strCfgData.Substring(iEnd + 1);
00632                 return strNew;
00633         }
00634
00635         public string CreateSpectrumConfig(string strRawCfgIn)
00636         {
00637             string strDisplayCfgOut = "";
00638             string strCmdD = "";
00639             ArrayList Dp5CmdList;
00640
00641             Dp5CmdList = MakeDp5CmdList();
00642             strDisplayCfgOut = strRawCfgIn;
00643             if (Dp5CmdList.Count > 0) {
00644                 foreach (object lstCmd in Dp5CmdList)
00645                 {
00646                     strCmdD = (string)lstCmd;
00647                     if (strCmdD.Length > 0)
00648                     {
00649                         strDisplayCfgOut = AppendCmdDesc(strCmdD, strDisplayCfgOut);
00650                     }
00651                 }
00652             }
00653             return strDisplayCfgOut;
00654         }
00655
00656         public ArrayList MakeDp5CmdList()
00657         {
00658             ArrayList strCfgArr = new ArrayList();
00659             strCfgArr.Clear();
00660             strCfgArr.Add("RESC");
00661             strCfgArr.Add("CLCK");
00662             strCfgArr.Add("TPEA");
00663             strCfgArr.Add("GAIF");
00664             strCfgArr.Add("GAIN");
00665             strCfgArr.Add("RESL");
00666             strCfgArr.Add("TFLA");
00667             strCfgArr.Add("TPFA");
00668             strCfgArr.Add("PURE");
00669             strCfgArr.Add("RTDE");
00670             strCfgArr.Add("MCAS");
00671             strCfgArr.Add("MCAC");
00672             strCfgArr.Add("SOFF");
00673             strCfgArr.Add("AINP");
00674             strCfgArr.Add("INOF");
00675             strCfgArr.Add("GAIA");
00676             strCfgArr.Add("CUSP");
00677             strCfgArr.Add("PDMD");
00678             strCfgArr.Add("THSL");
00679             strCfgArr.Add("TLLD");
00680             strCfgArr.Add("THFA");
00681             strCfgArr.Add("DACO");
00682             strCfgArr.Add("DACF");
00683             strCfgArr.Add("RTDS");
00684             strCfgArr.Add("RTDT");
00685             strCfgArr.Add("BLRM");
00686             strCfgArr.Add("BLRD");
00687             strCfgArr.Add("BLRU");
00688             strCfgArr.Add("GATE");
00689             strCfgArr.Add("AUO1");
00690             strCfgArr.Add("PRET");
00691             strCfgArr.Add("PRER");
00692             strCfgArr.Add("PREL");
00693             strCfgArr.Add("PREC");
00694             strCfgArr.Add("PRCL");
00695             strCfgArr.Add("PRCH");
00696             strCfgArr.Add("HVSE");
00697             strCfgArr.Add("TECS");
00698             strCfgArr.Add("PAPZ");
00699             strCfgArr.Add("PAPS");
00700             strCfgArr.Add("SCOE");
00701             strCfgArr.Add("SCOT");
00702             strCfgArr.Add("SCOG");
00703             strCfgArr.Add("MCSL");
00704             strCfgArr.Add("MCSH");
00705             strCfgArr.Add("MCST");
00706             strCfgArr.Add("AUO2");
00707             strCfgArr.Add("TPMO");
00708             strCfgArr.Add("GPED");
00709             strCfgArr.Add("GPIN");
00710             strCfgArr.Add("GPME");
00711             strCfgArr.Add("GPGA");
00712             strCfgArr.Add("GPMC");
00713             strCfgArr.Add("MCAE");
00714             strCfgArr.Add("VOLU");
00715             strCfgArr.Add("CON1");
00716             strCfgArr.Add("CON2");
00717             strCfgArr.Add("BOOT");
00718             return strCfgArr;
00719         }
00720
00721         // replaces all occurrences of substring in string
00722         string ReplaceCmdText(string strInTextIn, string strFrom, string strTo)
00723         {
00724             string strReplaceText;
00725             string strInText;
00726             string strOutText;
00727             int lFromLen;
00728             int lMatchPos;
00729
00730             strInText = strInTextIn;
00731             strOutText = "";
00732             lFromLen = (int)strFrom.Length;
00733             while (strInText.Length > 0)
00734             {
00735                 lMatchPos = (1 + (int)strInText.IndexOf(strFrom));
00736                 if (lMatchPos == 0)
00737                 {
00738                     strOutText = strOutText + strInText;
00739                     strInText = "";
00740                 }
00741                 else
00742                 {
00743                     strOutText = strOutText + strInText.Substring(0, lMatchPos - 1) + strTo;
00744                     strInText = strInText.Substring(lMatchPos + lFromLen - 1);
00745                 }
00746             }
00747             strReplaceText = strOutText;
00748             return strReplaceText;
00749         }
00750
00751         // demonstrates replacing a ASCII configuration string values
00752         private void ReplaceCmdValues(string strCmdStringIn)
00753         {
00754             string strCfg = "";
00755             int lLenCmdString;
00756             int lBlock1Length;
00757
00758             strCmdStringIn = strCmdStringIn.Trim();
00759             lLenCmdString = strCmdStringIn.Length;
00760             if (lLenCmdString > 0)
00761             {
00762                 strCfg = strCmdStringIn;
00763                 strCfg = ReplaceCmdText(strCfg, "US;", ";");
00764                 strCfg = ReplaceCmdText(strCfg, "OFF;", "OF;");
00765                 strCfg = ReplaceCmdText(strCfg, "RISING;", "RI;");
00766                 strCfg = ReplaceCmdText(strCfg, "FALLING;", "FA;");
00767                 lBlock1Length = strCfg.Length;
00768             }
00769         }
00770
00771         // demonstrates splitting a ASCII configuration string
00772         private void SplitConfig(string strCmdStringIn)
00773         {
00774             string strConfigOutBlock1 = "";
00775             string strConfigOutBlock2 = "";
00776             int lLenCmdString;
00777             int lSplitPosition;
00778             int lBlock1Length;
00779             int lBlock2Length;
00780             int lTotalCfgOutLength;
00781
00782             strCmdStringIn = strCmdStringIn.Trim();
00783             lLenCmdString = strCmdStringIn.Length;
00784             lSplitPosition = GetCmdChunk(strCmdStringIn);
00785             strConfigOutBlock1 = strCmdStringIn.Substring(0, lSplitPosition);
00786             strConfigOutBlock2 = strCmdStringIn.Substring(lSplitPosition + 1);
00787             lBlock1Length = strConfigOutBlock1.Length;
00788             lBlock2Length = strConfigOutBlock2.Length;
00789             lTotalCfgOutLength = lBlock1Length + lBlock2Length;
00790         }
00791
00792         // breaks ASCII Command string into two chuncks, returns split position
00793         int GetCmdChunk(string strCmd)
00794         {
00795             int GetCmdChunk = 0;
00796             int idxCfg;
00797             int lChunk;
00798             int lEnd;
00799             GetCmdChunk = 0;
00800             lChunk = 0;
00801             lEnd = 0;
00802             for (idxCfg = 1; idxCfg <= (int)strCmd.Length; idxCfg++)
00803             {
00804                 lChunk = (int)(1 + strCmd.IndexOf(";", lEnd));
00805                 if ((lChunk == 0) || (lChunk > 512))
00806                 {
00807                     break;
00808                 }
00809                 lEnd = lChunk;
00810             }
00811             GetCmdChunk = lEnd;
00812             return GetCmdChunk;
00813         }
00814
00816         bool CopyAsciiData(byte[] Data, string strCfg, long lLen)
00817         {
00818             if (strCfg.Length > 0)
00819             {
00820                 Data = Encoding.ASCII.GetBytes(strCfg);
00821                 return true;
00822             }
00823             else
00824             {
00825                 return false;
00826             }
00827         }
00828     }
00829
00830 }
Generated on Thu Sep 21 2017 15:39:02 for DPP ReadCfg by doxygen 1.7.6.1


DPP ReadCfg: AssemblyInfo.cs Source File

  • File List
AssemblyInfo.cs
Go to the documentation of this file.
00001 using System.Reflection;
00002 using System.Runtime.CompilerServices;
00003
00004 //
00005 // General Information about an assembly is controlled through the following
00006 // set of attributes. Change these attribute values to modify the information
00007 // associated with an assembly.
00008 //
00009 [assembly: AssemblyTitle("")]
00010 [assembly: AssemblyDescription("")]
00011 [assembly: AssemblyConfiguration("")]
00012 [assembly: AssemblyCompany("")]
00013 [assembly: AssemblyProduct("")]
00014 [assembly: AssemblyCopyright("")]
00015 [assembly: AssemblyTrademark("")]
00016 [assembly: AssemblyCulture("")]
00017
00018 //
00019 // Version information for an assembly consists of the following four values:
00020 //
00021 //      Major Version
00022 //      Minor Version
00023 //      Build Number
00024 //      Revision
00025 //
00026 // You can specify all the values or you can default the Revision and Build Numbers
00027 // by using the '*' as shown below:
00028
00029 [assembly: AssemblyVersion("1.0.*")]
00030
00031 //
00032 // In order to sign your assembly you must specify a key to use. Refer to the
00033 // Microsoft .NET Framework documentation for more information on assembly signing.
00034 //
00035 // Use the attributes below to control which key is used for signing.
00036 //
00037 // Notes:
00038 //   (*) If no key is specified, the assembly is not signed.
00039 //   (*) KeyName refers to a key that has been installed in the Crypto Service
00040 //       Provider (CSP) on your machine. KeyFile refers to a file which contains
00041 //       a key.
00042 //   (*) If the KeyFile and the KeyName values are both specified, the
00043 //       following processing occurs:
00044 //       (1) If the KeyName can be found in the CSP, that key is used.
00045 //       (2) If the KeyName does not exist and the KeyFile does exist, the key
00046 //           in the KeyFile is installed into the CSP and used.
00047 //   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
00048 //       When specifying the KeyFile, the location of the KeyFile should be
00049 //       relative to the project output directory which is
00050 //       %Project Directory%\obj<configuration>. For example, if your KeyFile is
00051 //       located in the project directory, you would specify the AssemblyKeyFile
00052 //       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
00053 //   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
00054 //       documentation for more information on this.
00055 //
00056 [assembly: AssemblyDelaySign(false)]
00057 [assembly: AssemblyKeyFile("")]
00058 [assembly: AssemblyKeyName("")]
Generated on Thu Sep 21 2017 15:39:02 for DPP ReadCfg by doxygen 1.7.6.1


DPP ReadCfg: FW6DppStatus.cs Source File

  • File List
FW6DppStatus.cs
Go to the documentation of this file.
00001 using System;
00002 using System.Collections.Generic;
00003 using System.Text;
00004
00005 namespace csRepeat
00006 {
00010     class FW6DppStatus
00011     {
00012
00013         bool bHaveStatus = false;
00014         byte[] RAW = new byte[64];
00015         ulong SerialNumber;
00016         ulong FastCount;
00017         ulong SlowCount;
00018         byte FPGA;
00019         byte Firmware;
00020         byte Build;
00021         public double AccumulationTime;
00022         double RealTime;
00023         double LiveTime;
00024         double HV;
00025         double DET_TEMP;
00026         double DP5_TEMP;
00027         //bool PX4;
00028         bool AFAST_LOCKED;
00029         public bool MCA_EN;
00030         public bool PRECNT_REACHED;
00031         public bool PresetRtDone;
00032         public bool PresetLtDone;
00033         //bool SUPPLIES_ON;
00034         bool SCOPE_DR;
00035         bool DP5_CONFIGURED;
00036         ulong GP_COUNTER;
00037         bool AOFFSET_LOCKED;
00038         bool MCS_DONE;
00039         //bool RAM_TEST_RUN;
00040         //bool RAM_TEST_ERROR;
00041         //double DCAL;
00042         //byte PZCORR;                          // or single?
00043         //byte UC_TEMP_OFFSET;
00044         //double AN_IN;
00045         //double VREF_IN;
00046         //ulong PC5_SN;
00047         public bool PC5_PRESENT;
00048         bool PC5_HV_POL;
00049         bool PC5_8_5V;
00050         //double ADC_GAIN_CAL;
00051         //byte ADC_OFFSET_CAL;
00052         //long SPECTRUM_OFFSET;     // or single?
00053         bool b80MHzMode;
00054         bool bFPGAAutoClock;
00055         public byte DEVICE_ID;
00056         bool ReBootFlag;
00057         byte DPP_options;
00058         bool HPGe_HV_INH;
00059         bool HPGe_HV_INH_POL;
00060
00061         double TEC_Voltage;
00062         public byte DPP_ECO = 0;
00063             bool AU34_2;                  // automatic source changer (ASC) operation
00064         //bool isAscInstalled;          // automatic source changer (ASC) operation
00065         //bool isAscEnabled;            //  automatic source changer (ASC) operation
00066         //bool bScintHas80MHzOption;    // DP5G/TB5 80MHz FPGA
00067         public bool isDP5_RevDxGains = false;
00068
00069         //DEVICE_ID 0=DP5,1=PX5,2=DP5G,3=MCA8000D,4=TB5,5=DP5X
00070         public const byte dppDP5 = 0;
00071         public const byte dppPX5 = 1;
00072         public const byte dppDP5G = 2;
00073         public const byte dppMCA8000D = 3;
00074         public const byte dppTB5 = 4;
00075         public const byte dppDP5X = 5;
00076
00077         //typedef enum _PX5_OPTIONS
00078         //{
00079             public const byte PX5_OPTION_NONE=0;
00080             public const byte PX5_OPTION_HPGe_HVPS=1;
00081             public const byte PX5_OPTION_TEST_TEK=4;
00082             public const byte PX5_OPTION_TEST_MOX=5;
00083             public const byte PX5_OPTION_TEST_AMP=6;
00084             public const byte PX5_OPTION_TEST_MODE_1=8;
00085         public const byte PX5_OPTION_TEST_MODE_2 = 9;
00086         //} PX5_OPTIONS;
00087
00088         public ulong GetULong(int ulStart, byte[] buffer)
00089         {
00090             ulong ulValue = 0;
00091             for(int index=0;index<4;index++) {          // build 4 bytes (lwStart-lwStart+3) into double
00092                 ulValue += buffer[(ulStart + index)] * (ulong)Math.Pow(2.0, 8.0 * (double)index);
00093             }
00094             return ulValue;
00095         }
00096
00097         public void Process_Status(byte[] buffer)
00098         {
00099             for (int iRaw = 0; iRaw < 64; iRaw++) {
00100                 RAW[iRaw] = buffer[iRaw];
00101             }
00102             bool bDMCA_LiveTime = false;
00103             uint uiFwBuild = 0;
00104             bool bRebootFlagNagFix = false;
00105
00106             DEVICE_ID = RAW[39];
00107             FastCount = GetULong(0, RAW);
00108             SlowCount = GetULong(4, RAW);
00109             GP_COUNTER = GetULong(8, RAW);
00110             AccumulationTime = (float)RAW[12] * 0.001 + (float)(RAW[13] + (float)RAW[14] * 256.0 + (float)RAW[15] * 65536.0) * 0.1;
00111             RealTime = ((double)RAW[20] + ((double)RAW[21] * 256.0) + ((double)RAW[22] * 65536.0) + ((double)RAW[23] * 16777216.0)) * 0.001;
00112
00113             Firmware = RAW[24];
00114             FPGA = RAW[25];
00115
00116             if (Firmware > 0x65) {
00117                 Build = (byte)(RAW[37] & 0x0F);        //Build # added in FW6.06
00118             } else {
00119                 Build = 0;
00120             }
00121
00122             //Firmware Version:  6.07  Build:  0 has LiveTime and PREL
00123             //DEVICE_ID 0=DP5,1=PX5,2=DP5G,3=MCA8000D,4=TB5,5=DP5X
00124             if (DEVICE_ID == dppMCA8000D) {
00125                 if (Firmware >= 0x67) {
00126                     bDMCA_LiveTime = true;
00127                 }
00128             }
00129
00130             if (bDMCA_LiveTime) {
00131                 LiveTime = ((double)RAW[16] + ((double)RAW[17] * 256.0) + ((double)RAW[18] * 65536.0) + ((double)RAW[19] * 16777216.0)) * 0.001;
00132             } else {
00133                 LiveTime = 0;
00134             }
00135
00136             if (RAW[29] < 128) {
00137                 SerialNumber = GetULong(26, RAW);
00138             } else {
00139                 SerialNumber = 0;
00140             }
00141
00142             // HV = (double)(RAW[31] + (RAW[30] & 15) * 256) * 0.5;                    // 0.5V/count
00143
00144             if (RAW[30] < 128)  {    // not negative
00145                 HV = ((double)RAW[31] + ((double)RAW[30] * 256.0)) * 0.5;  // 0.5V/count
00146             } else {
00147                 HV = (((double)RAW[31] + ((double)RAW[30] * 256)) - 65536.0) * 0.5; // 0.5V/count
00148             }
00149
00150             DET_TEMP = (double)((RAW[33]) + (RAW[32] & 15) * 256) * 0.1; // - 273.16;        // 0.1K/count
00151             DP5_TEMP = RAW[34] - ((RAW[34] & 128) * 2);
00152
00153             PresetRtDone = ((RAW[35] & 128) == 128);
00154             //byte:35 BIT:D6
00155             // == Preset LiveTime Done for MCA8000D
00156             // == FAST Thresh locked for other dpp devices
00157             PresetLtDone = false;
00158             AFAST_LOCKED = false;
00159             if (bDMCA_LiveTime) {        // test for MCA8000D
00160                 PresetLtDone = ((RAW[35] & 64) == 64);
00161             } else {
00162                 AFAST_LOCKED = ((RAW[35] & 64) == 64);
00163             }
00164             MCA_EN = ((RAW[35] & 32) == 32);
00165             PRECNT_REACHED = ((RAW[35] & 16) == 16);
00166             SCOPE_DR = ((RAW[35] & 4) == 4);
00167             DP5_CONFIGURED = ((RAW[35] & 2) == 2);
00168
00169             AOFFSET_LOCKED = ((RAW[36] & 128) == 0);  // 0=locked, 1=searching
00170             MCS_DONE = ((RAW[36] & 64) == 64);
00171
00172             b80MHzMode = ((RAW[36] & 2) == 2);
00173             bFPGAAutoClock = ((RAW[36] & 1) == 1);
00174
00175             PC5_PRESENT = ((RAW[38] & 128) == 128);
00176             if  (PC5_PRESENT) {
00177                 PC5_HV_POL = ((RAW[38] & 64) == 64);
00178                 PC5_8_5V = ((RAW[38] & 32) == 32);
00179             } else {
00180                 PC5_HV_POL = false;
00181                 PC5_8_5V = false;
00182             }
00183
00184             if (Firmware >= 0x65) {        // reboot flag added FW6.05
00185                 if ((RAW[36] & 32) == 32) {
00186                     ReBootFlag = true;
00187                 } else {
00188                     ReBootFlag = false;
00189                 }
00190             } else {
00191                 ReBootFlag = false;
00192             }
00193             bRebootFlagNagFix = ReBootFlag;
00194
00195             TEC_Voltage = (((double)(RAW[40] & 15) * 256.0) + (double)(RAW[41])) / 758.5;
00196             DPP_ECO = RAW[49];
00197             // DP5G/TB5 80MHz FPGA
00198             //bScintHas80MHzOption = false;
00199             DPP_options = (byte)(RAW[42] & 15);
00200             HPGe_HV_INH = false;
00201             HPGe_HV_INH_POL = false;
00202             // automatic source changer (ASC) operation
00203             AU34_2 = false;
00204             //isAscInstalled = false;
00205             //isDP5_RevDxGains = false;
00206             if (DEVICE_ID == dppPX5) {
00207                 if (DPP_options == PX5_OPTION_HPGe_HVPS) {
00208                     HPGe_HV_INH = ((RAW[42] & 32) == 32);
00209                     HPGe_HV_INH_POL = ((RAW[42] & 16) == 16);
00210                     if (DPP_ECO == 1) {
00211                         // automatic source changer (ASC) operation
00212                         //isAscInstalled = true;
00213                         AU34_2 = ((RAW[42] & 64) == 64);
00214                     }
00215                 }
00216             } else if ((DEVICE_ID == dppDP5G) || (DEVICE_ID == dppTB5)) {
00217                 if ((DPP_ECO == 1) || (DPP_ECO == 2)) {
00218                     // DPP_ECO == 2 80MHz option added 20150409
00219                     //bScintHas80MHzOption = true;
00220                 }
00221             } else if (DEVICE_ID == dppDP5) {
00222                 uiFwBuild = Firmware;
00223                 uiFwBuild = (uiFwBuild << 8);
00224                 uiFwBuild = (uiFwBuild + Build);
00225                 // uiFwBuild - firmware with build for comparison
00226                 if (uiFwBuild >= 0x686) {
00227                     // 0xFF Value indicates old Analog Gain Count of 16
00228                     // Values < 0xFF indicate new gain count of 24 and new board rev
00229                     // "DP5 G3 Configuration P" will not be used (==0xFF)
00230                     if (DPP_ECO < 0xFF) {
00231                         //isDP5_RevDxGains = true;
00232                     }
00233                 }
00234             }
00235             bHaveStatus = true;
00236         }
00237
00238         string DP5_Dx_OptionFlags(byte DP5_Dx_Options) {
00239             byte D7D6;
00240             byte D5D4;
00241             byte D3D0;
00242             string strRev;
00243
00244             //D7-D6: 0 = DP5 Rev D
00245             //       1 = DP5 Rev E (future)
00246             //       2 = DP5 Rev F (future)
00247             //       3 = DP5 Rev G (future)
00248             D7D6 = (byte)(((DP5_Dx_Options >> 6) & 0x03) + 'D');
00249             //D5-D4: minor rev, 0-3 (i.e. Rev D0, D1 etc.)
00250             D5D4 = (byte)((DP5_Dx_Options >> 4) & 0x03);
00251             //D3-D0: Configuration 0 = A, 1=B, 2=C... 15=P.
00252             D3D0 = (byte)((DP5_Dx_Options & 0x0F) + 'A');
00253
00254             strRev = String.Format("DP5 Rev %c%d Configuration %c",D7D6,D5D4,D3D0);
00255             return(strRev);
00256
00257         }
00258
00259         // ShowStatusValueStrings does not include board and detector monitor data
00260         public string ShowStatusValueStrings()
00261         {
00262             string strConfig = "";
00263             string strTemp;
00264
00265             if (!bHaveStatus)
00266             {
00267                 return strConfig;
00268             }
00269
00270             strTemp = GetDeviceNameFromVal(DEVICE_ID);
00271             strConfig = "Device Type: " + strTemp + "\r\n";
00272             strTemp = String.Format("Serial Number: {0:d}\r\n", SerialNumber);  //SerialNumber
00273             strConfig += strTemp;
00274             strTemp = "Firmware: " + VersionToStr(Firmware);
00275             strConfig += strTemp;
00276             if (Firmware > 0x65)
00277             {
00278                 strTemp = String.Format("  Build:  {0:d}\r\n", Build);
00279                 strConfig += strTemp;
00280             }
00281             else
00282             {
00283                 strConfig += "\r\n";
00284             }
00285             strTemp = "FPGA: " + VersionToStr(FPGA) + "\r\n";
00286             strConfig += strTemp;
00287             if (DEVICE_ID != dppMCA8000D)
00288             {
00289                 strTemp = String.Format("Fast Count: {0:f}\r\n", FastCount);    //FastCount
00290                 strConfig += strTemp;
00291             }
00292             strTemp = String.Format("Slow Count: {0:f}\r\n", SlowCount);        //SlowCount
00293             strConfig += strTemp;
00294
00295             if (DEVICE_ID != dppMCA8000D)
00296             {
00297                 strTemp = String.Format("Accumulation Time: {0:f}\r\n", AccumulationTime);          //AccumulationTime
00298                 strConfig += strTemp;
00299             }
00300
00301             strTemp = String.Format("Real Time: {0:f}\r\n", RealTime);      //RealTime
00302             strConfig += strTemp;
00303
00304             if (DEVICE_ID == dppMCA8000D)
00305             {
00306                 strTemp = String.Format("Live Time: {0:f}\r\n", LiveTime);          //LiveTime
00307                 strConfig += strTemp;
00308             }
00309
00310             return strConfig;
00311         }
00312
00313         public string PX5_OptionsString()
00314         {
00315             string strOptions = "";
00316             if (DEVICE_ID == dppPX5) {
00317                 //DPP_options = 1;
00318                 //HPGe_HV_INH = true;
00319                 //HPGe_HV_INH_POL = true;
00320                 if (DPP_options > 0) {
00321                     //===============PX5 Options==================
00322                     strOptions += "PX5 Options: ";
00323                     if ((DPP_options & 1) == 1) {
00324                         strOptions += "HPGe HVPS\r\n";
00325                     } else {
00326                         strOptions += "Unknown\r\n";
00327                     }
00328                     //===============HPGe HVPS HV Status==================
00329                     strOptions += "HPGe HV: ";
00330                     if (HPGe_HV_INH) {
00331                         strOptions += "not inhibited\r\n";
00332                     } else {
00333                         strOptions += "inhibited\r\n";
00334                     }
00335                     //===============HPGe HVPS Inhibit Status==================
00336                     strOptions += "INH Polarity: ";
00337                     if (HPGe_HV_INH_POL) {
00338                         strOptions += "high\r\n";
00339                     } else {
00340                         strOptions += "low\r\n";
00341                     }
00342                 //} else {
00343                 //    strOptions += "PX5 Options: None\r\n";  //           strOptions += "No Options Installed"
00344                 }
00345             }
00346             return strOptions;
00347         }
00348
00349         // Use GetStatusValueStrings includes values for detector and board monitors
00350         public string GetStatusValueStrings()
00351         {
00352             string strConfig="";
00353             string strTemp;
00354
00355             if (!bHaveStatus)
00356             {
00357                 return strConfig;
00358             }
00359
00360             strTemp = GetDeviceNameFromVal(DEVICE_ID);
00361             strConfig = "Device Type: " + strTemp + "\r\n";
00362             strTemp = String.Format("Serial Number: {0:d}\r\n",SerialNumber);   //SerialNumber
00363             strConfig += strTemp;
00364             strTemp = "Firmware: " + VersionToStr(Firmware);
00365             strConfig += strTemp;
00366             if (Firmware > 0x65) {
00367                 strTemp = String.Format("  Build:  {0:d}\r\n", Build);
00368                 strConfig += strTemp;
00369             } else {
00370                 strConfig += "\r\n";
00371             }
00372             strTemp = "FPGA: " + VersionToStr(FPGA) + "\r\n";
00373             strConfig += strTemp;
00374             if (DEVICE_ID != 3) {
00375                 strTemp = String.Format("Fast Count: {0:f}\r\n",FastCount);     //FastCount
00376                 strConfig += strTemp;
00377             }
00378             strTemp = String.Format("Slow Count: {0:f}\r\n",SlowCount);         //SlowCount
00379             strConfig += strTemp;
00380
00381             if (DEVICE_ID != dppMCA8000D) {
00382                 strTemp = String.Format("Accumulation Time: {0:f2}\r\n",AccumulationTime);          //AccumulationTime
00383                 strConfig += strTemp;
00384             }
00385
00386             strTemp = String.Format("Real Time: {0:f2}\r\n",RealTime);      //RealTime
00387             strConfig += strTemp;
00388
00389             if (DEVICE_ID == dppMCA8000D) {
00390                 strTemp = String.Format("Live Time: {0:f2}\r\n",LiveTime);          //RealTime
00391                 strConfig += strTemp;
00392             }
00393
00394            if ((DEVICE_ID != dppDP5G) && (DEVICE_ID != dppMCA8000D)) {
00395                 strTemp = String.Format("Detector Temp: {0:f}K\r\n",DET_TEMP);          //"##0°C") ' round to nearest degree
00396                 strConfig += strTemp;
00397                 strTemp = String.Format("Detector HV: {0:f}V\r\n",HV);
00398                 strConfig += strTemp;
00399                 strTemp = String.Format("Board Temp: {0:d}°C\r\n",(int)DP5_TEMP);
00400                 strConfig += strTemp;
00401             } else if (DEVICE_ID == dppDP5G) {          // GAMMARAD5
00402                 if (DET_TEMP > 0) {
00403                     strTemp = String.Format("Detector Temp: {0:f1}K\r\n", DET_TEMP);
00404                     strConfig += strTemp;
00405                 } else {
00406                     strConfig += "";
00407                 }
00408                 strTemp = String.Format("HV Set: {0:f}V\r\n",HV);
00409                 strConfig += strTemp;
00410             } else if (DEVICE_ID == dppMCA8000D) {              // Digital MCA
00411                 strTemp = String.Format("Board Temp: {0:d}°C\r\n", (int)DP5_TEMP);
00412                 strConfig += strTemp;
00413             }
00414
00415             if (DEVICE_ID == dppPX5) {
00416                 strTemp = PX5_OptionsString();
00417                 strConfig += strTemp;
00418             }
00419             return strConfig;
00420         }
00421
00422         //void CDP5Status::Process_Diagnostics(Packet_In PIN, DiagDataType *dd, int device_type)
00423         //{
00424         //    long idxVal;
00425         //    string strVal;
00426         //    double DP5_ADC_Gain[10];  // convert each ADC count to engineering units - values calculated in FORM.LOAD
00427         //    double PC5_ADC_Gain[3];
00428         //    double PX5_ADC_Gain[12];
00429
00430         //    DP5_ADC_Gain[0] = 1.0 / 0.00286;                // 2.86mV/C
00431         //    DP5_ADC_Gain[1] = 1.0;                          // Vdd mon (out-of-scale)
00432         //    DP5_ADC_Gain[2] = (30.1 + 20.0) / 20.0;           // PWR
00433         //    DP5_ADC_Gain[3] = (13.0 + 20.0) / 20.0;            // 3.3V
00434         //    DP5_ADC_Gain[4] = (4.99 + 20.0) / 20.0;         // 2.5V
00435         //    DP5_ADC_Gain[5] = 1.0;                          // 1.2V
00436         //    DP5_ADC_Gain[6] = (35.7 + 20.0) / 20.0;          // 5.5V
00437         //    DP5_ADC_Gain[7] = (35.7 + 75.0) / 35.7;        // -5.5V (this one is tricky)
00438         //    DP5_ADC_Gain[8] = 1.0;                          // AN_IN
00439         //    DP5_ADC_Gain[9] = 1.0;                          // VREF_IN
00440
00441         //    PC5_ADC_Gain[0] = 500.0;                        // HV: 1500V/3V
00442         //    PC5_ADC_Gain[1] = 100.0;                        // TEC: 300K/3V
00443         //    PC5_ADC_Gain[2] = (20.0 + 10.0) / 10.0;            // +8.5/5V
00444
00445         //    //PX5_ADC_Gain[0] = (30.1 + 20.0) / 20.0;          // PWR
00446         //    PX5_ADC_Gain[0] = (69.8 + 20.0) / 20.0;          // 9V (was originally PWR)
00447         //    PX5_ADC_Gain[1] = (13.0 + 20.0) / 20.0;            // 3.3V
00448         //    PX5_ADC_Gain[2] = (4.99 + 20.0) / 20.0;          // 2.5V
00449         //    PX5_ADC_Gain[3] = 1.0;                         // 1.2V
00450         //    PX5_ADC_Gain[4] = (30.1 + 20.0) / 20.0;          // 5V
00451         //    PX5_ADC_Gain[5] = (10.7 + 75.0) / 10.7;         // -5V (this one is tricky)
00452         //    PX5_ADC_Gain[6] = (64.9 + 20.0) / 20.0;          // +PA
00453         //    PX5_ADC_Gain[7] = (10.7 + 75) / 10.7;        // -PA
00454         //    PX5_ADC_Gain[8] = (16.0 + 20.0) / 20.0;            // +TEC
00455         //    PX5_ADC_Gain[9] = 500.0;                       // HV: 1500V/3V
00456         //    PX5_ADC_Gain[10] = 100.0;                       // TEC: 300K/3V
00457         //    PX5_ADC_Gain[11] = 1.0 / 0.00286;               // 2.86mV/C
00458
00459         //    dd->Firmware = PIN.DATA[0];
00460         //    dd->FPGA = PIN.DATA[1];
00461         //    strVal = "0x0" + FmtHex(PIN.DATA[2], 2) + FmtHex(PIN.DATA[3], 2) + FmtHex(PIN.DATA[4], 2);
00462         //    dd->SRAMTestData = strtol(strVal,NULL,0);
00463         //    dd->SRAMTestPass = (dd->SRAMTestData == 0xFFFFFF);
00464         //    dd->TempOffset = PIN.DATA[180] + 256 * (PIN.DATA[180] > 127);  // 8-bit signed value
00465
00466         //    if (device_type == dppDP5) {
00467         //        for(idxVal=0;idxVal<10;idxVal++){
00468         //            dd->ADC_V[idxVal] = (float)((((PIN.DATA[5 + idxVal * 2] & 3) * 256) + PIN.DATA[6 + idxVal * 2]) * 2.44 / 1024.0 * DP5_ADC_Gain[idxVal]); // convert counts to engineering units (C or V)
00469         //        }
00470         //        dd->ADC_V[7] = dd->ADC_V[7] + dd->ADC_V[6] * (float)(1.0 - DP5_ADC_Gain[7]);  // -5.5V is a function of +5.5V
00471         //        dd->strTempRaw = String.Format("%   #.0f0C", dd->ADC_V[0] - 271.3);
00472         //        dd->strTempCal = String.Format("%   #.0f0C", (dd->ADC_V[0] - 280.0 + dd->TempOffset));
00473         //    } else if (device_type == dppPX5) {
00474         //        for(idxVal=0;idxVal<11;idxVal++){
00475         //            dd->ADC_V[idxVal] = (float)((((PIN.DATA[5 + idxVal * 2] & 15) * 256) + PIN.DATA[6 + idxVal * 2]) * 3.0 / 4096.0 * PX5_ADC_Gain[idxVal]);   // convert counts to engineering units (C or V)
00476         //        }
00477         //        dd->ADC_V[11] = (float)((((PIN.DATA[5 + 11 * 2] & 3) * 256) + PIN.DATA[6 + 11 * 2]) * 3.0 / 1024.0 * PX5_ADC_Gain[11]);  // convert counts to engineering units (C or V)
00478         //        dd->ADC_V[5] = (float)(dd->ADC_V[5] - (3.0 * PX5_ADC_Gain[5]) + 3.0); // -5V uses +3VR
00479         //        dd->ADC_V[7] = (float)(dd->ADC_V[7] - (3.0 * PX5_ADC_Gain[7]) + 3.0); // -PA uses +3VR
00480         //        dd->strTempRaw = String.Format("%#.1fC", dd->ADC_V[11] - 271.3);
00481         //        dd->strTempCal = String.Format("%#.1fC", (dd->ADC_V[11] - 280.0 + dd->TempOffset));
00482         //    }
00483
00484         //    dd->PC5_PRESENT = FALSE;  // assume no PC5, then check to see if there are any non-zero bytes
00485         //    for(idxVal=25;idxVal<=38;idxVal++) {
00486         //        if (PIN.DATA[idxVal] > 0) {
00487         //            dd->PC5_PRESENT = TRUE;
00488         //            break;
00489         //        }
00490         //    }
00491
00492         //    if (dd->PC5_PRESENT) {
00493         //        for(idxVal=0;idxVal<=2;idxVal++) {
00494         //            dd->PC5_V[idxVal] = (float)((((PIN.DATA[25 + idxVal * 2] & 15) * 256) + PIN.DATA[26 + idxVal * 2]) * 3.0 / 4096.0 * PC5_ADC_Gain[idxVal]); // convert counts to engineering units (C or V)
00495         //        }
00496         //        if (PIN.DATA[34] < 128) {
00497         //            dd->PC5_SN = (ULONG)GetULong(31, PIN.DATA);
00498         //        } else {
00499         //            dd->PC5_SN = -1; // no PC5 S/N
00500         //        }
00501         //        if ((PIN.DATA[35] == 255) && (PIN.DATA[36] == 255)) {
00502         //            dd->PC5Initialized = FALSE;
00503         //            dd->PC5DCAL = 0;
00504         //        } else {
00505         //            dd->PC5Initialized = TRUE;
00506         //            dd->PC5DCAL = (float)(((float)(PIN.DATA[35]) * 256.0 + (float)(PIN.DATA[36])) * 3.0 / 4096.0);
00507         //        }
00508         //        dd->IsPosHV = ((PIN.DATA[37] & 128) == 128);
00509         //        dd->Is8_5VPreAmp = ((PIN.DATA[37] & 64) == 64);
00510         //        dd->Sup9VOn = ((PIN.DATA[38] & 8) == 8);
00511         //        dd->PreAmpON = ((PIN.DATA[38] & 4) == 4);
00512         //        dd->HVOn = ((PIN.DATA[38] & 2) == 2);
00513         //        dd->TECOn = ((PIN.DATA[38] & 1) == 1);
00514         //    } else {
00515         //        for(idxVal=0;idxVal<=2;idxVal++) {
00516         //            dd->PC5_V[idxVal] = 0;
00517         //        }
00518         //        dd->PC5_SN = -1; // no PC5 S/N
00519         //        dd->PC5Initialized = FALSE;
00520         //        dd->PC5DCAL = 0;
00521         //        dd->IsPosHV = FALSE;
00522         //        dd->Is8_5VPreAmp = FALSE;
00523         //        dd->Sup9VOn = FALSE;
00524         //        dd->PreAmpON = FALSE;
00525         //        dd->HVOn = FALSE;
00526         //        dd->TECOn = FALSE;
00527         //    }
00528         //    for(idxVal=0;idxVal<=191;idxVal++) {
00529         //        dd->DiagData[idxVal] = PIN.DATA[idxVal + 39];
00530         //    }
00531         //    //string cstrData;
00532         //    //cstrData = DisplayBufferArray(PIN.DATA, 256);
00533         //    //SaveStringDataToFile(cstrData);
00534         //}
00535
00536         //string CDP5Status::DiagnosticsToString(DiagDataType dd, int device_type)
00537         //{
00538         //    long idxVal;
00539         //    string cstrVal;
00540         //    string strDiag;
00541
00542         //    strDiag = "Firmware: " + VersionToStr(dd.Firmware) + "\r\n";
00543         //    strDiag += "FPGA: " + VersionToStr(dd.FPGA) + "\r\n";
00544         //    strDiag += "SRAM Test: ";
00545         //    if (dd.SRAMTestPass) {
00546         //        strDiag += "PASS\r\n";
00547         //    } else {
00548         //        strDiag += "ERROR @ 0x" + FmtHex(dd.SRAMTestData, 6) + "\r\n";
00549         //    }
00550
00551         //    if (device_type == dppDP5) {
00552         //        strDiag += "DP5 Temp (raw): " + dd.strTempRaw + "\r\n";
00553         //        strDiag += "DP5 Temp (cal'd): " + dd.strTempCal + "\r\n";
00554         //        strDiag += "PWR: " + FmtPc5Pwr(dd.ADC_V[2]) + "\r\n";
00555         //        strDiag += "3.3V: " + FmtPc5Pwr(dd.ADC_V[3]) + "\r\n";
00556         //        strDiag += "2.5V: " + FmtPc5Pwr(dd.ADC_V[4]) + "\r\n";
00557         //        strDiag += "1.2V: " + FmtPc5Pwr(dd.ADC_V[5]) + "\r\n";
00558         //        strDiag += "+5.5V: " + FmtPc5Pwr(dd.ADC_V[6]) + "\r\n";
00559         //        strDiag += "-5.5V: " + FmtPc5Pwr(dd.ADC_V[7]) + "\r\n";
00560         //        strDiag += "AN_IN: " + FmtPc5Pwr(dd.ADC_V[8]) + "\r\n";
00561         //        strDiag += "VREF_IN: " + FmtPc5Pwr(dd.ADC_V[9]) + "\r\n";
00562
00563         //        strDiag += "\r\n";
00564         //        if (dd.PC5_PRESENT) {
00565         //            strDiag += "PC5: Present\r\n";
00566         //            cstrVal = String.Format("%dV",(int)(dd.PC5_V[0]));
00567         //            strDiag += "HV: " + cstrVal + "\r\n";
00568         //            cstrVal = String.Format("%#.1fK",dd.PC5_V[1]);
00569         //            strDiag += "Detector Temp: " + cstrVal + "\r\n";
00570         //            strDiag += "+8.5/5V: " + FmtPc5Pwr(dd.PC5_V[2]) + "\r\n";
00571         //            if (dd.PC5_SN > -1) {
00572         //                strDiag += "PC5 S/N: " + FmtLng(dd.PC5_SN) + "\r\n";
00573         //            } else {
00574         //                strDiag += "PC5 S/N: none\r\n";
00575         //            }
00576         //            if (dd.PC5Initialized) {
00577         //                strDiag += "PC5 DCAL: " + FmtPc5Pwr(dd.PC5DCAL) + "\r\n";
00578         //            } else {
00579         //                strDiag += "PC5 DCAL: Uninitialized\r\n";
00580         //            }
00581         //            strDiag += "PC5 Flavor: ";
00582         //            strDiag += IsAorB(dd.IsPosHV, "+HV, ", "-HV, ");
00583         //            strDiag += IsAorB(dd.Is8_5VPreAmp, "8.5V preamp", "5V preamp") + "\r\n";
00584         //            strDiag += "PC5 Supplies:\r\n";
00585         //            strDiag += "9V: " + OnOffStr(dd.Sup9VOn) + "\r\n";
00586         //            strDiag += "Preamp: " + OnOffStr(dd.PreAmpON) + "\r\n";
00587         //            strDiag += "HV: " + OnOffStr(dd.HVOn) + "\r\n";
00588         //            strDiag += "TEC: " + OnOffStr(dd.TECOn) + "\r\n";
00589         //        } else {
00590         //            strDiag += "PC5: Not Present\r\n";
00591         //        }
00592         //    } else if (device_type == dppPX5) {
00593         //        strDiag += "PX5 Temp (raw): " + dd.strTempRaw + "\r\n";
00594         //        strDiag += "PX5 Temp (cal'd): " + dd.strTempCal + "\r\n";
00595         //        //strDiag += "PWR: " + FmtPc5Pwr(dd.ADC_V[0]) + "\r\n";
00596         //        strDiag += "9V: " + FmtPc5Pwr(dd.ADC_V[0]) + "\r\n";
00597         //        strDiag += "3.3V: " + FmtPc5Pwr(dd.ADC_V[1]) + "\r\n";
00598         //        strDiag += "2.5V: " + FmtPc5Pwr(dd.ADC_V[2]) + "\r\n";
00599         //        strDiag += "1.2V: " + FmtPc5Pwr(dd.ADC_V[3]) + "\r\n";
00600         //        strDiag += "+5V: " + FmtPc5Pwr(dd.ADC_V[4]) + "\r\n";
00601         //        strDiag += "-5V: " + FmtPc5Pwr(dd.ADC_V[5]) + "\r\n";
00602         //        strDiag += "+PA: " + FmtPc5Pwr(dd.ADC_V[6]) + "\r\n";
00603         //        strDiag += "-PA: " + FmtPc5Pwr(dd.ADC_V[7]) + "\r\n";
00604         //        strDiag += "TEC: " + FmtPc5Pwr(dd.ADC_V[8]) + "\r\n";
00605         //        strDiag += "ABS(HV): " + FmtHvPwr(dd.ADC_V[9]) + "\r\n";
00606         //        strDiag += "DET_TEMP: " + FmtPc5Temp(dd.ADC_V[10]) + "\r\n";
00607         //    }
00608
00609         //    strDiag += "\r\nDiagnostic Data\r\n";
00610         //    strDiag += "---------------\r\n";
00611         //    for(idxVal=0;idxVal<=191;idxVal++) {
00612         //        if ((idxVal % 8) == 0) {
00613         //            strDiag += FmtHex(idxVal, 2) + ":";
00614         //        }
00615         //        strDiag += FmtHex(dd.DiagData[idxVal], 2) + " ";
00616         //        if ((idxVal % 8) == 7) {
00617         //            strDiag += "\r\n";
00618         //        }
00619         //    }
00620         //    return (strDiag);
00621         //}
00622
00623         //string CDP5Status::FmtHvPwr(float fVal)
00624         //{
00625         //    string cstrVal;
00626         //    cstrVal = String.Format("%#.1fV", fVal);  // "#.##0V"
00627         //    return cstrVal;
00628         //}
00629
00630         //string CDP5Status::FmtPc5Pwr(float fVal)
00631         //{
00632         //    string cstrVal;
00633         //    cstrVal = String.Format("%#.3fV", fVal);  // "#.##0V"
00634         //    return cstrVal;
00635         //}
00636
00637         //string CDP5Status::FmtPc5Temp(float fVal)
00638         //{
00639         //    string cstrVal;
00640         //    cstrVal = String.Format("%#.1fK", fVal);  // "#.##0V"
00641         //    return cstrVal;
00642         //}
00643
00644         //string CDP5Status::FmtHex(long FmtHex, long HexDig)
00645         //{
00646         //    string cstrHex;
00647         //    string cstrFmt;
00648         //    cstrFmt = String.Format("%d",HexDig);             // max size of 0 pad
00649         //    cstrFmt = "%0" + cstrFmt + "X";           // string format specifier
00650         //    cstrHex = String.Format(cstrFmt, FmtHex); // create padded string
00651         //    return cstrHex;
00652         //}
00653
00654         //string CDP5Status::FmtLng(long lVal)
00655         //{
00656         //    string cstrVal;
00657         //    cstrVal = String.Format("%d", lVal);
00658         //    return cstrVal;
00659         //}
00660
00661         public string VersionToStr(byte bVersion)
00662         {
00663             string cstrVerMajor = String.Format("{0:d}", ((bVersion & 0xF0) / 16));
00664             string cstrVerMinor = String.Format("{0:d2}", (bVersion & 0x0F)); ;
00665             string cstrVer;
00666             cstrVer = cstrVerMajor + "." + cstrVerMinor;
00667             return (cstrVer);
00668         }
00669
00670         public string OnOffStr(bool bOn)
00671         {
00672             if (bOn)
00673             {
00674                 return ("ON");
00675             }
00676             else
00677             {
00678                 return ("OFF");
00679             }
00680         }
00681
00682         string IsAorB(bool bIsA, string strA, string strB)
00683         {
00684             if (bIsA)
00685             {
00686                 return (strA);
00687             }
00688             else
00689             {
00690                 return (strB);
00691             }
00692         }
00693
00694         public string GetDeviceNameFromVal(int DeviceTypeVal)
00695         {
00696             string strDeviceType;
00697             switch (DeviceTypeVal)
00698             {
00699                 case 0:
00700                     strDeviceType = "DP5";
00701                     break;
00702                 case 1:
00703                     strDeviceType = "PX5";
00704                     break;
00705                 case 2:
00706                     strDeviceType = "DP5G";
00707                     break;
00708                 case 3:
00709                     strDeviceType = "MCA8000D";
00710                     break;
00711                 case 4:
00712                     strDeviceType = "TB5";
00713                     break;
00714                 case 5:
00715                     strDeviceType = "DP5X";
00716                     break;
00717                 default:           //if unknown set to DP5
00718                     strDeviceType = "DP5";
00719                     break;
00720             }
00721             return strDeviceType;
00722         }
00723
00724         //string CDP5Status::DisplayBufferArray(byte buffer[], ULONG bufSizeIn)
00725         //{
00726         //    ULONG i;
00727         //    string cstrVal("");
00728         //    string cstrMsg("");
00729         //    for(i=0;i<bufSizeIn;i++) {
00730         //        cstrVal = String.Format("%.2X ",buffer[i]);
00731         //        cstrMsg += cstrVal;
00732         //        //if (((i+1) % 16) == 0 ) {
00733         //        //    cstrMsg += "\r\n";
00734         //        //} else
00735         //        if (((i+1) % 8) == 0 ) {
00736         //        //    cstrMsg += "   ";
00737         //            //cstrMsg += "\r\n";
00738         //            cstrMsg += "\n";
00739         //        }
00740         //    }
00741         //    //cstrMsg += "\n";
00742         //    return cstrMsg;
00743         //}
00744
00745         //void CDP5Status::SaveStringDataToFile(string strData)
00746         //{
00747         //   FILE  *out;
00748         //   string strFilename;
00749         //   string strError;
00750
00751         //   strFilename = "vcDP5_Data.txt";
00752
00753         //   if ( (out = fopen(strFilename,"w")) == (FILE *) NULL)
00754         //      strError = String.Format("Couldn't open %s for writing.\n", strFilename);
00755         //   else
00756         //   {
00757         //      fprintf(out,"%s\n",strData);
00758         //   }
00759         //   fclose(out);
00760         //}
00761
00762
00763         //#pragma once
00764
00765         //#include "DP5Protocol.h"
00766         //#include "dpputilities.h"
00767
00768         //typedef enum _PX5_OPTIONS
00769         //{
00770         //    PX5_OPTION_NONE,
00771         //    PX5_OPTION_HPGe_HVPS
00772         //} PX5_OPTIONS;
00773
00774
00775         //typedef struct _DiagDataType
00776         //{
00777         //    float ADC_V[12];
00778         //    float PC5_V[4];
00779         //    bool PC5_PRESENT;
00780         //    long PC5_SN;
00781         //    byte Firmware;
00782         //    byte FPGA;
00783         //    bool SRAMTestPass;
00784         //    long SRAMTestData;
00785         //    int TempOffset;
00786         //    string strTempRaw;
00787         //    string strTempCal;
00788         //    bool PC5Initialized;
00789         //    float PC5DCAL;
00790         //    bool IsPosHV;
00791         //    bool Is8_5VPreAmp;
00792         //    bool Sup9VOn;
00793         //    bool PreAmpON;
00794         //    bool HVOn;
00795         //    bool TECOn;
00796         //    byte DiagData[192];
00797         //} DiagDataType, *PDDiagDataType;
00798
00799
00800
00801
00802
00803
00805         //double CDppUtilities::BYTEVersionToDouble(BYTE Version)
00806         //{
00807         //    double dblVersion;
00808         //    CString strTemp;
00809         //    strTemp = String.Format("%d.%02d",((Version & 240) / 16),(Version & 15));
00810         //    dblVersion = atof(strTemp);
00811         //    return dblVersion;
00812         //}
00813
00815         //CString CDppUtilities::BYTEVersionToString(BYTE Version)
00816         //{
00817         //    CString strTemp;
00818         //    strTemp = String.Format("%d.%02d",((Version & 240) / 16),(Version & 15));
00819         //    return strTemp;
00820         //}
00821
00822     }
00823 }
Generated on Thu Sep 21 2017 15:39:02 for DPP ReadCfg by doxygen 1.7.6.1


DPP ReadCfg: Form1.cs Source File

  • File List
Form1.cs
Go to the documentation of this file.
00001 using System;
00002 using System.IO;
00003 using System.Drawing;
00004 using System.Collections;
00005 using System.ComponentModel;
00006 using System.Windows.Forms;
00007 using System.Data;
00008 using System.Collections.Generic;
00009 using System.Text;
00010 using INIUtilities;
00011 using csRepeat;
00012 using AsciiCmdUtilities;
00013
00014 namespace ReadCfg
00015 {
00019         public class Form1 : System.Windows.Forms.Form
00020         {
00021                 private System.Windows.Forms.TextBox txtFilename;
00022                 private System.Windows.Forms.TextBox txtAsciiCommands;
00023         private Button btnReadConfig;
00024         private Button btnFilterCfg;
00025         private TextBox txtFilteredCmds;
00026         private GroupBox groupBox1;
00027         private RadioButton radbtnDppType2;
00028         private RadioButton radbtnDppType1;
00029         private RadioButton radbtnDppType0;
00030         private RadioButton radbtnDppType5;
00031         private RadioButton radbtnDppType4;
00032         private RadioButton radbtnDppType3;
00033
00034         private byte DppType;
00035         bool PC5_PRESENT;
00036         bool isDP5_RevDxGains;
00037         byte DPP_ECO;
00038         private CheckBox chkPC5_PRESENT;
00039         private CheckBox chkRevDxGains;
00040         private GroupBox groupBox2;
00041         private RadioButton radbtnB;
00042         private RadioButton radbtnA;
00043         private RadioButton radbtn0;
00044         private TextBox txtStatus;
00045
00046         private FW6DppStatus DppStat;
00047         private CommandFilters CmdFilters;
00048
00049         private Label lblFilename;
00050         private Label label1;
00051         private Label label3;
00052         private Button btnFullConfigReadback;
00053         private Label lblCfgReadbackInd;
00054         private Label lblCfgOR;
00055         private Label lblCfgFilterInd;
00056
00060                 private System.ComponentModel.Container components = null;
00061
00062                 public Form1()
00063                 {
00064                         //
00065                         // Required for Windows Form Designer support
00066                         //
00067                         InitializeComponent();
00068
00069                         //
00070                         // TODO: Add any constructor code after InitializeComponent call
00071                         //
00072                 }
00073
00077                 protected override void Dispose( bool disposing )
00078                 {
00079                         if( disposing )
00080                         {
00081                                 if (components != null)
00082                                 {
00083                                         components.Dispose();
00084                                 }
00085                         }
00086                         base.Dispose( disposing );
00087                 }
00088
00089                 #region Windows Form Designer generated code
00090
00091
00092
00093
00094                 private void InitializeComponent()
00095                 {
00096             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
00097             this.txtFilename = new System.Windows.Forms.TextBox();
00098             this.txtAsciiCommands = new System.Windows.Forms.TextBox();
00099             this.btnReadConfig = new System.Windows.Forms.Button();
00100             this.btnFilterCfg = new System.Windows.Forms.Button();
00101             this.txtFilteredCmds = new System.Windows.Forms.TextBox();
00102             this.groupBox1 = new System.Windows.Forms.GroupBox();
00103             this.radbtnDppType5 = new System.Windows.Forms.RadioButton();
00104             this.radbtnDppType4 = new System.Windows.Forms.RadioButton();
00105             this.radbtnDppType3 = new System.Windows.Forms.RadioButton();
00106             this.radbtnDppType2 = new System.Windows.Forms.RadioButton();
00107             this.radbtnDppType1 = new System.Windows.Forms.RadioButton();
00108             this.radbtnDppType0 = new System.Windows.Forms.RadioButton();
00109             this.chkPC5_PRESENT = new System.Windows.Forms.CheckBox();
00110             this.chkRevDxGains = new System.Windows.Forms.CheckBox();
00111             this.groupBox2 = new System.Windows.Forms.GroupBox();
00112             this.radbtnB = new System.Windows.Forms.RadioButton();
00113             this.radbtnA = new System.Windows.Forms.RadioButton();
00114             this.radbtn0 = new System.Windows.Forms.RadioButton();
00115             this.txtStatus = new System.Windows.Forms.TextBox();
00116             this.lblFilename = new System.Windows.Forms.Label();
00117             this.label1 = new System.Windows.Forms.Label();
00118             this.label3 = new System.Windows.Forms.Label();
00119             this.btnFullConfigReadback = new System.Windows.Forms.Button();
00120             this.lblCfgReadbackInd = new System.Windows.Forms.Label();
00121             this.lblCfgOR = new System.Windows.Forms.Label();
00122             this.lblCfgFilterInd = new System.Windows.Forms.Label();
00123             this.groupBox1.SuspendLayout();
00124             this.groupBox2.SuspendLayout();
00125             this.SuspendLayout();
00126             //
00127             // txtFilename
00128             //
00129             this.txtFilename.AllowDrop = true;
00130             this.txtFilename.Location = new System.Drawing.Point(11, 25);
00131             this.txtFilename.Name = "txtFilename";
00132             this.txtFilename.Size = new System.Drawing.Size(651, 20);
00133             this.txtFilename.TabIndex = 0;
00134             this.txtFilename.DragDrop += new System.Windows.Forms.DragEventHandler(this.txtFilename_DragDrop);
00135             this.txtFilename.DragEnter += new System.Windows.Forms.DragEventHandler(this.txtFilename_DragEnter);
00136             //
00137             // txtAsciiCommands
00138             //
00139             this.txtAsciiCommands.Location = new System.Drawing.Point(105, 101);
00140             this.txtAsciiCommands.Multiline = true;
00141             this.txtAsciiCommands.Name = "txtAsciiCommands";
00142             this.txtAsciiCommands.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
00143             this.txtAsciiCommands.Size = new System.Drawing.Size(558, 179);
00144             this.txtAsciiCommands.TabIndex = 1;
00145             //
00146             // btnReadConfig
00147             //
00148             this.btnReadConfig.Location = new System.Drawing.Point(10, 51);
00149             this.btnReadConfig.Name = "btnReadConfig";
00150             this.btnReadConfig.Size = new System.Drawing.Size(133, 27);
00151             this.btnReadConfig.TabIndex = 2;
00152             this.btnReadConfig.Text = "Read Configuration";
00153             this.btnReadConfig.UseVisualStyleBackColor = true;
00154             this.btnReadConfig.Click += new System.EventHandler(this.btnReadConfig_Click);
00155             //
00156             // btnFilterCfg
00157             //
00158             this.btnFilterCfg.Location = new System.Drawing.Point(150, 51);
00159             this.btnFilterCfg.Name = "btnFilterCfg";
00160             this.btnFilterCfg.Size = new System.Drawing.Size(209, 27);
00161             this.btnFilterCfg.TabIndex = 3;
00162             this.btnFilterCfg.Text = "Filter Configuration by Device Type";
00163             this.btnFilterCfg.UseVisualStyleBackColor = true;
00164             this.btnFilterCfg.Click += new System.EventHandler(this.btnFilterCfg_Click);
00165             //
00166             // txtFilteredCmds
00167             //
00168             this.txtFilteredCmds.Location = new System.Drawing.Point(105, 377);
00169             this.txtFilteredCmds.Multiline = true;
00170             this.txtFilteredCmds.Name = "txtFilteredCmds";
00171             this.txtFilteredCmds.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
00172             this.txtFilteredCmds.Size = new System.Drawing.Size(558, 179);
00173             this.txtFilteredCmds.TabIndex = 4;
00174             //
00175             // groupBox1
00176             //
00177             this.groupBox1.Controls.Add(this.radbtnDppType5);
00178             this.groupBox1.Controls.Add(this.radbtnDppType4);
00179             this.groupBox1.Controls.Add(this.radbtnDppType3);
00180             this.groupBox1.Controls.Add(this.radbtnDppType2);
00181             this.groupBox1.Controls.Add(this.radbtnDppType1);
00182             this.groupBox1.Controls.Add(this.radbtnDppType0);
00183             this.groupBox1.Location = new System.Drawing.Point(12, 84);
00184             this.groupBox1.Name = "groupBox1";
00185             this.groupBox1.Size = new System.Drawing.Size(87, 153);
00186             this.groupBox1.TabIndex = 5;
00187             this.groupBox1.TabStop = false;
00188             this.groupBox1.Text = "DPP Device";
00189             //
00190             // radbtnDppType5
00191             //
00192             this.radbtnDppType5.AutoSize = true;
00193             this.radbtnDppType5.Location = new System.Drawing.Point(11, 128);
00194             this.radbtnDppType5.Name = "radbtnDppType5";
00195             this.radbtnDppType5.Size = new System.Drawing.Size(53, 17);
00196             this.radbtnDppType5.TabIndex = 5;
00197             this.radbtnDppType5.TabStop = true;
00198             this.radbtnDppType5.Text = "DP5X";
00199             this.radbtnDppType5.UseVisualStyleBackColor = true;
00200             this.radbtnDppType5.CheckedChanged += new System.EventHandler(this.radbtnDppType5_CheckedChanged);
00201             //
00202             // radbtnDppType4
00203             //
00204             this.radbtnDppType4.AutoSize = true;
00205             this.radbtnDppType4.Location = new System.Drawing.Point(11, 106);
00206             this.radbtnDppType4.Name = "radbtnDppType4";
00207             this.radbtnDppType4.Size = new System.Drawing.Size(45, 17);
00208             this.radbtnDppType4.TabIndex = 4;
00209             this.radbtnDppType4.TabStop = true;
00210             this.radbtnDppType4.Text = "TB5";
00211             this.radbtnDppType4.UseVisualStyleBackColor = true;
00212             this.radbtnDppType4.CheckedChanged += new System.EventHandler(this.radbtnDppType4_CheckedChanged);
00213             //
00214             // radbtnDppType3
00215             //
00216             this.radbtnDppType3.AutoSize = true;
00217             this.radbtnDppType3.Location = new System.Drawing.Point(11, 84);
00218             this.radbtnDppType3.Name = "radbtnDppType3";
00219             this.radbtnDppType3.Size = new System.Drawing.Size(80, 17);
00220             this.radbtnDppType3.TabIndex = 3;
00221             this.radbtnDppType3.TabStop = true;
00222             this.radbtnDppType3.Text = "MCA8000D";
00223             this.radbtnDppType3.UseVisualStyleBackColor = true;
00224             this.radbtnDppType3.CheckedChanged += new System.EventHandler(this.radbtnDppType3_CheckedChanged);
00225             //
00226             // radbtnDppType2
00227             //
00228             this.radbtnDppType2.AutoSize = true;
00229             this.radbtnDppType2.Location = new System.Drawing.Point(11, 62);
00230             this.radbtnDppType2.Name = "radbtnDppType2";
00231             this.radbtnDppType2.Size = new System.Drawing.Size(54, 17);
00232             this.radbtnDppType2.TabIndex = 2;
00233             this.radbtnDppType2.TabStop = true;
00234             this.radbtnDppType2.Text = "DP5G";
00235             this.radbtnDppType2.UseVisualStyleBackColor = true;
00236             this.radbtnDppType2.CheckedChanged += new System.EventHandler(this.radbtnDppType2_CheckedChanged);
00237             //
00238             // radbtnDppType1
00239             //
00240             this.radbtnDppType1.AutoSize = true;
00241             this.radbtnDppType1.Location = new System.Drawing.Point(11, 40);
00242             this.radbtnDppType1.Name = "radbtnDppType1";
00243             this.radbtnDppType1.Size = new System.Drawing.Size(45, 17);
00244             this.radbtnDppType1.TabIndex = 1;
00245             this.radbtnDppType1.TabStop = true;
00246             this.radbtnDppType1.Text = "PX5";
00247             this.radbtnDppType1.UseVisualStyleBackColor = true;
00248             this.radbtnDppType1.CheckedChanged += new System.EventHandler(this.radbtnDppType1_CheckedChanged);
00249             //
00250             // radbtnDppType0
00251             //
00252             this.radbtnDppType0.AutoSize = true;
00253             this.radbtnDppType0.Location = new System.Drawing.Point(11, 18);
00254             this.radbtnDppType0.Name = "radbtnDppType0";
00255             this.radbtnDppType0.Size = new System.Drawing.Size(46, 17);
00256             this.radbtnDppType0.TabIndex = 0;
00257             this.radbtnDppType0.TabStop = true;
00258             this.radbtnDppType0.Text = "DP5";
00259             this.radbtnDppType0.UseVisualStyleBackColor = true;
00260             this.radbtnDppType0.CheckedChanged += new System.EventHandler(this.radbtnDppType0_CheckedChanged);
00261             //
00262             // chkPC5_PRESENT
00263             //
00264             this.chkPC5_PRESENT.AutoSize = true;
00265             this.chkPC5_PRESENT.Location = new System.Drawing.Point(11, 246);
00266             this.chkPC5_PRESENT.Name = "chkPC5_PRESENT";
00267             this.chkPC5_PRESENT.Size = new System.Drawing.Size(85, 17);
00268             this.chkPC5_PRESENT.TabIndex = 6;
00269             this.chkPC5_PRESENT.Text = "PC5 Present";
00270             this.chkPC5_PRESENT.UseVisualStyleBackColor = true;
00271             this.chkPC5_PRESENT.CheckedChanged += new System.EventHandler(this.chkPC5_PRESENT_CheckedChanged);
00272             //
00273             // chkRevDxGains
00274             //
00275             this.chkRevDxGains.AutoSize = true;
00276             this.chkRevDxGains.Location = new System.Drawing.Point(11, 269);
00277             this.chkRevDxGains.Name = "chkRevDxGains";
00278             this.chkRevDxGains.Size = new System.Drawing.Size(86, 17);
00279             this.chkRevDxGains.TabIndex = 7;
00280             this.chkRevDxGains.Text = "RevDxGains";
00281             this.chkRevDxGains.UseVisualStyleBackColor = true;
00282             this.chkRevDxGains.CheckedChanged += new System.EventHandler(this.chkRevDxGains_CheckedChanged);
00283             //
00284             // groupBox2
00285             //
00286             this.groupBox2.Controls.Add(this.radbtnB);
00287             this.groupBox2.Controls.Add(this.radbtnA);
00288             this.groupBox2.Controls.Add(this.radbtn0);
00289             this.groupBox2.Location = new System.Drawing.Point(4, 289);
00290             this.groupBox2.Name = "groupBox2";
00291             this.groupBox2.Size = new System.Drawing.Size(94, 71);
00292             this.groupBox2.TabIndex = 8;
00293             this.groupBox2.TabStop = false;
00294             this.groupBox2.Text = "DPP ECO";
00295             //
00296             // radbtnB
00297             //
00298             this.radbtnB.AutoSize = true;
00299             this.radbtnB.Location = new System.Drawing.Point(7, 51);
00300             this.radbtnB.Name = "radbtnB";
00301             this.radbtnB.Size = new System.Drawing.Size(57, 17);
00302             this.radbtnB.TabIndex = 2;
00303             this.radbtnB.TabStop = true;
00304             this.radbtnB.Text = "ECO B";
00305             this.radbtnB.UseVisualStyleBackColor = true;
00306             this.radbtnB.CheckedChanged += new System.EventHandler(this.radbtnB_CheckedChanged);
00307             //
00308             // radbtnA
00309             //
00310             this.radbtnA.AutoSize = true;
00311             this.radbtnA.Location = new System.Drawing.Point(7, 33);
00312             this.radbtnA.Name = "radbtnA";
00313             this.radbtnA.Size = new System.Drawing.Size(57, 17);
00314             this.radbtnA.TabIndex = 1;
00315             this.radbtnA.TabStop = true;
00316             this.radbtnA.Text = "ECO A";
00317             this.radbtnA.UseVisualStyleBackColor = true;
00318             this.radbtnA.CheckedChanged += new System.EventHandler(this.radbtnA_CheckedChanged);
00319             //
00320             // radbtn0
00321             //
00322             this.radbtn0.AutoSize = true;
00323             this.radbtn0.Location = new System.Drawing.Point(7, 15);
00324             this.radbtn0.Name = "radbtn0";
00325             this.radbtn0.Size = new System.Drawing.Size(56, 17);
00326             this.radbtn0.TabIndex = 0;
00327             this.radbtn0.TabStop = true;
00328             this.radbtn0.Text = "ECO 0";
00329             this.radbtn0.UseVisualStyleBackColor = true;
00330             this.radbtn0.CheckedChanged += new System.EventHandler(this.radbtn0_CheckedChanged);
00331             //
00332             // txtStatus
00333             //
00334             this.txtStatus.Location = new System.Drawing.Point(474, 297);
00335             this.txtStatus.Multiline = true;
00336             this.txtStatus.Name = "txtStatus";
00337             this.txtStatus.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
00338             this.txtStatus.Size = new System.Drawing.Size(182, 63);
00339             this.txtStatus.TabIndex = 9;
00340             //
00341             // lblFilename
00342             //
00343             this.lblFilename.AutoSize = true;
00344             this.lblFilename.Location = new System.Drawing.Point(9, 8);
00345             this.lblFilename.Name = "lblFilename";
00346             this.lblFilename.Size = new System.Drawing.Size(212, 13);
00347             this.lblFilename.TabIndex = 10;
00348             this.lblFilename.Text = "Drag Drop Configuration File to the TextBox";
00349             //
00350             // label1
00351             //
00352             this.label1.AutoSize = true;
00353             this.label1.Location = new System.Drawing.Point(105, 85);
00354             this.label1.Name = "label1";
00355             this.label1.Size = new System.Drawing.Size(113, 13);
00356             this.label1.TabIndex = 11;
00357             this.label1.Text = "Configuration as String";
00358             //
00359             // label3
00360             //
00361             this.label3.AutoSize = true;
00362             this.label3.Location = new System.Drawing.Point(320, 300);
00363             this.label3.Name = "label3";
00364             this.label3.Size = new System.Drawing.Size(144, 13);
00365             this.label3.TabIndex = 13;
00366             this.label3.Text = "Device Selection Parameters";
00367             //
00368             // btnFullConfigReadback
00369             //
00370             this.btnFullConfigReadback.Location = new System.Drawing.Point(365, 51);
00371             this.btnFullConfigReadback.Name = "btnFullConfigReadback";
00372             this.btnFullConfigReadback.Size = new System.Drawing.Size(171, 27);
00373             this.btnFullConfigReadback.TabIndex = 14;
00374             this.btnFullConfigReadback.Text = "Full Configuration Readback";
00375             this.btnFullConfigReadback.UseVisualStyleBackColor = true;
00376             this.btnFullConfigReadback.Click += new System.EventHandler(this.btnFullConfigReadback_Click);
00377             //
00378             // lblCfgReadbackInd
00379             //
00380             this.lblCfgReadbackInd.AutoSize = true;
00381             this.lblCfgReadbackInd.Location = new System.Drawing.Point(324, 361);
00382             this.lblCfgReadbackInd.Name = "lblCfgReadbackInd";
00383             this.lblCfgReadbackInd.Size = new System.Drawing.Size(126, 13);
00384             this.lblCfgReadbackInd.TabIndex = 17;
00385             this.lblCfgReadbackInd.Text = "Full Readback Command";
00386             //
00387             // lblCfgOR
00388             //
00389             this.lblCfgOR.AutoSize = true;
00390             this.lblCfgOR.Location = new System.Drawing.Point(295, 361);
00391             this.lblCfgOR.Name = "lblCfgOR";
00392             this.lblCfgOR.Size = new System.Drawing.Size(23, 13);
00393             this.lblCfgOR.TabIndex = 18;
00394             this.lblCfgOR.Text = "OR";
00395             //
00396             // lblCfgFilterInd
00397             //
00398             this.lblCfgFilterInd.AutoSize = true;
00399             this.lblCfgFilterInd.Location = new System.Drawing.Point(105, 361);
00400             this.lblCfgFilterInd.Name = "lblCfgFilterInd";
00401             this.lblCfgFilterInd.Size = new System.Drawing.Size(184, 13);
00402             this.lblCfgFilterInd.TabIndex = 19;
00403             this.lblCfgFilterInd.Text = "Configuration Filtered by Device Type";
00404             //
00405             // Form1
00406             //
00407             this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
00408             this.ClientSize = new System.Drawing.Size(668, 568);
00409             this.Controls.Add(this.lblCfgFilterInd);
00410             this.Controls.Add(this.lblCfgOR);
00411             this.Controls.Add(this.lblCfgReadbackInd);
00412             this.Controls.Add(this.btnFullConfigReadback);
00413             this.Controls.Add(this.label3);
00414             this.Controls.Add(this.label1);
00415             this.Controls.Add(this.lblFilename);
00416             this.Controls.Add(this.txtStatus);
00417             this.Controls.Add(this.groupBox2);
00418             this.Controls.Add(this.chkRevDxGains);
00419             this.Controls.Add(this.chkPC5_PRESENT);
00420             this.Controls.Add(this.groupBox1);
00421             this.Controls.Add(this.txtFilteredCmds);
00422             this.Controls.Add(this.btnFilterCfg);
00423             this.Controls.Add(this.btnReadConfig);
00424             this.Controls.Add(this.txtAsciiCommands);
00425             this.Controls.Add(this.txtFilename);
00426             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
00427             this.Name = "Form1";
00428             this.Text = "Configuration Test Application";
00429             this.Load += new System.EventHandler(this.Form1_Load);
00430             this.Closing += new System.ComponentModel.CancelEventHandler(this.Form1_Closing);
00431             this.groupBox1.ResumeLayout(false);
00432             this.groupBox1.PerformLayout();
00433             this.groupBox2.ResumeLayout(false);
00434             this.groupBox2.PerformLayout();
00435             this.ResumeLayout(false);
00436             this.PerformLayout();
00437
00438                 }
00439                 #endregion
00440
00444                 [STAThread]
00445                 static void Main()
00446                 {
00447                         Application.Run(new Form1());
00448                 }
00449
00450                 private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
00451                 {
00452
00453                 }
00454
00455         private void UpdateStatus()
00456         {
00457             string strStatus;
00458             //strStatus = "\r\n";
00459             strStatus = "";
00460
00461             strStatus += "DPP Type: ";
00462             strStatus += DppStat.GetDeviceNameFromVal(DppType);
00463             strStatus += "\r\n";
00464
00465             strStatus += "is PC5 PRESENT: ";
00466             strStatus += PC5_PRESENT.ToString();
00467             strStatus += "\r\n";
00468
00469             strStatus += "is DP5 RevDxGains: ";
00470             strStatus += isDP5_RevDxGains.ToString();
00471             strStatus += "\r\n";
00472
00473             strStatus += "DPP ECO: 0x";
00474             strStatus += DPP_ECO.ToString("X2");
00475             strStatus += "";
00476
00477             txtStatus.Text = strStatus;
00478         }
00479
00480                 private void Form1_Load(object sender, System.EventArgs e)
00481                 {
00482             DppStat = new FW6DppStatus();
00483             CmdFilters = new CommandFilters();
00484
00485             DppType = FW6DppStatus.dppDP5;
00486             PC5_PRESENT = true;
00487             isDP5_RevDxGains = false;
00488             DPP_ECO = 0;
00489
00490             radbtnDppType0.Select();
00491             radbtn0.Select();
00492             chkPC5_PRESENT.Checked = true;
00493             chkRevDxGains.Checked = false;
00494             UpdateStatus();
00495                 }
00496
00497         private void radbtnDppType0_CheckedChanged(object sender, EventArgs e)
00498         {
00499             DppType = FW6DppStatus.dppDP5;
00500             UpdateStatus();
00501         }
00502
00503         private void radbtnDppType1_CheckedChanged(object sender, EventArgs e)
00504         {
00505             DppType = FW6DppStatus.dppPX5;
00506             UpdateStatus();
00507         }
00508
00509         private void radbtnDppType2_CheckedChanged(object sender, EventArgs e)
00510         {
00511             DppType = FW6DppStatus.dppDP5G;
00512             UpdateStatus();
00513         }
00514
00515         private void radbtnDppType3_CheckedChanged(object sender, EventArgs e)
00516         {
00517             DppType = FW6DppStatus.dppMCA8000D;
00518             UpdateStatus();
00519         }
00520
00521         private void radbtnDppType4_CheckedChanged(object sender, EventArgs e)
00522         {
00523             DppType = FW6DppStatus.dppTB5;
00524             UpdateStatus();
00525         }
00526
00527         private void radbtnDppType5_CheckedChanged(object sender, EventArgs e)
00528         {
00529             DppType = FW6DppStatus.dppDP5X;
00530             UpdateStatus();
00531         }
00532
00533         private void radbtn0_CheckedChanged(object sender, EventArgs e)
00534         {
00535             DPP_ECO = 0x00;
00536             UpdateStatus();
00537         }
00538
00539         private void radbtnA_CheckedChanged(object sender, EventArgs e)
00540         {
00541             DPP_ECO = 0x0A;
00542             UpdateStatus();
00543         }
00544
00545         private void radbtnB_CheckedChanged(object sender, EventArgs e)
00546         {
00547             DPP_ECO = 0x0B;
00548             UpdateStatus();
00549         }
00550
00551         private void chkPC5_PRESENT_CheckedChanged(object sender, EventArgs e)
00552         {
00553             PC5_PRESENT = chkPC5_PRESENT.Checked;
00554             UpdateStatus();
00555         }
00556
00557         private void chkRevDxGains_CheckedChanged(object sender, EventArgs e)
00558         {
00559             isDP5_RevDxGains = chkRevDxGains.Checked;
00560             UpdateStatus();
00561         }
00562
00563         private void txtFilename_DragDrop(object sender, DragEventArgs e)
00564         {
00565             string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
00566             int iCount = 0;
00567             foreach (string file in files)
00568             {
00569                 if (iCount < 1)
00570                 {
00571                     txtFilename.Text = file;
00572                 }
00573                 iCount++;
00574             }
00575
00576         }
00577
00578         private void txtFilename_DragEnter(object sender, DragEventArgs e)
00579         {
00580             if (e.Data.GetDataPresent(DataFormats.FileDrop))
00581             {
00582                 e.Effect = DragDropEffects.Copy;
00583             }
00584             else
00585             {
00586                 e.Effect = DragDropEffects.None;
00587             }
00588         }
00589
00590         private void btnReadConfig_Click(object sender, EventArgs e)
00591         {
00592             string strCfgFilename = "";
00593             strCfgFilename = txtFilename.Text;
00594             if (! File.Exists(strCfgFilename)) {
00595                 txtAsciiCommands.Text = "File Error";
00596                 return;
00597             }
00598
00599             IniFile iniFile = new IniFile(strCfgFilename);
00600             // IniFile iniFile = new IniFile(".\\FS432.txt");
00601             // IniFile iniFile = new IniFile(".\\X123 Configuration.txt");
00602             txtFilename.Text = iniFile.Path;
00603             //Read section/key names
00604             List<KeyValuePair<string, string>> keyValuePairs;
00605             //string[] sections = iniFile.GetSectionNames();
00606             string strRawValue;
00607             string strValue;
00608             int iComment;
00609             string strCmds = "";
00610             string strCmd = "";
00611             string section = "DP5 Configuration File";
00612             //foreach (string section in sections)
00613             //{
00614             keyValuePairs = iniFile.GetSectionValuesAsList(section);
00615
00616             foreach (KeyValuePair<string, string> keyValuePair in keyValuePairs)
00617             {
00618                 strRawValue = keyValuePair.Value;
00619                 iComment = strRawValue.IndexOf(";");
00620                 if (iComment > 0)
00621                 {
00622                     strValue = strRawValue.Substring(0, iComment + 1);
00623                 }
00624                 else
00625                 {
00626                     strValue = strRawValue;
00627                 }
00628                 strCmd = keyValuePair.Key + "=" + strValue;
00629                 strCmds += strCmd;
00630             }
00631             txtAsciiCommands.Text = strCmds;
00632             //}
00633
00634         }
00635
00636         private void btnFilterCfg_Click(object sender, EventArgs e)
00637         {
00638             string strCfg = "";
00639             string strFilteredCfg = "";
00640             strCfg = txtAsciiCommands.Text;
00641             if ((strCfg == "File Error") || (strCfg == ""))
00642             {
00643                 txtFilteredCmds.Text = "Load DPP configuration before running filter.";
00644                 txtFilteredCmds.Text += "\r\n";
00645                 txtFilteredCmds.Text += strCfg;
00646                 return;
00647             }
00648             int iCmdEnd = -1;
00649             int iDataEnd = -1;
00650             iCmdEnd = strCfg.IndexOf("=");
00651             iDataEnd = strCfg.IndexOf(";");
00652             if ((iCmdEnd != 4) || (iCmdEnd > iDataEnd))
00653             {
00654                 txtFilteredCmds.Text = "DPP configuration error.";
00655                 txtFilteredCmds.Text += "\r\n";
00656                 txtFilteredCmds.Text += strCfg;
00657                 return;
00658             }
00659             strFilteredCfg = CmdFilters.RemoveCmdByDeviceType(strCfg, PC5_PRESENT, DppType, isDP5_RevDxGains, DPP_ECO);
00660             txtFilteredCmds.Text = strFilteredCfg;
00661             lblCfgFilterInd.BackColor = Color.DarkSeaGreen;
00662             lblCfgReadbackInd.BackColor = Color.Transparent;
00663         }
00664
00665         private void btnFullConfigReadback_Click(object sender, EventArgs e)
00666         {
00667             string strFilteredCfg = "";
00668             strFilteredCfg = CmdFilters.CreateFullReadBackCmd(PC5_PRESENT, DppType, isDP5_RevDxGains, DPP_ECO);
00669             txtFilteredCmds.Text = strFilteredCfg;
00670             lblCfgFilterInd.BackColor = Color.Transparent;
00671             lblCfgReadbackInd.BackColor = Color.LightBlue;
00672         }
00673
00674         }
00675 }
Generated on Thu Sep 21 2017 15:39:02 for DPP ReadCfg by doxygen 1.7.6.1


DPP ReadCfg: IniFile.cs Source File

  • File List
IniFile.cs
Go to the documentation of this file.
00001 using System;
00002 using System.Collections.Generic;
00003 using System.Globalization;
00004 using System.Runtime.InteropServices;
00005 using System.Text;
00006
00007 namespace INIUtilities
00008 {
00012     public class IniFile
00013     {
00024         public const int MaxSectionSize = 32767; // 32 KB
00025
00026         #region P/Invoke declares
00027
00040         [System.Security.SuppressUnmanagedCodeSecurity]
00041         private static class NativeMethods
00042         {
00043             [DllImport("kernel32.dll", CharSet = CharSet.Auto)]
00044             public static extern int GetPrivateProfileSectionNames(IntPtr lpszReturnBuffer,
00045                                                                    uint nSize,
00046                                                                    string lpFileName);
00047
00048             [DllImport("kernel32.dll", CharSet = CharSet.Auto)]
00049             public static extern uint GetPrivateProfileString(string lpAppName,
00050                                                               string lpKeyName,
00051                                                               string lpDefault,
00052                                                               StringBuilder lpReturnedString,
00053                                                               int nSize,
00054                                                               string lpFileName);
00055
00056             [DllImport("kernel32.dll", CharSet = CharSet.Auto)]
00057             public static extern uint GetPrivateProfileString(string lpAppName,
00058                                                               string lpKeyName,
00059                                                               string lpDefault,
00060                                                               [In, Out] char[] lpReturnedString,
00061                                                               int nSize,
00062                                                               string lpFileName);
00063
00064             [DllImport("kernel32.dll", CharSet = CharSet.Auto)]
00065             public static extern int GetPrivateProfileString(string lpAppName,
00066                                                              string lpKeyName,
00067                                                              string lpDefault,
00068                                                              IntPtr lpReturnedString,
00069                                                              uint nSize,
00070                                                              string lpFileName);
00071
00072             [DllImport("kernel32.dll", CharSet = CharSet.Auto)]
00073             public static extern int GetPrivateProfileInt(string lpAppName,
00074                                                           string lpKeyName,
00075                                                           int lpDefault,
00076                                                           string lpFileName);
00077
00078             [DllImport("kernel32.dll", CharSet = CharSet.Auto)]
00079             public static extern int GetPrivateProfileSection(string lpAppName,
00080                                                               IntPtr lpReturnedString,
00081                                                               uint nSize,
00082                                                               string lpFileName);
00083
00084             //We explicitly enable the SetLastError attribute here because
00085             // WritePrivateProfileString returns errors via SetLastError.
00086             // Failure to set this can result in errors being lost during
00087             // the marshal back to managed code.
00088             [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
00089             public static extern bool WritePrivateProfileString(string lpAppName,
00090                                                                 string lpKeyName,
00091                                                                 string lpString,
00092                                                                 string lpFileName);
00093
00094
00095         }
00096         #endregion
00097
00098                 //The path of the file we are operating on.
00099                 private readonly string m_path;
00100
00105         public IniFile(string path)
00106         {
00107             //Convert to the full path.  Because of backward compatibility,
00108             // the win32 functions tend to assume the path should be the
00109             // root Windows directory if it is not specified.  By calling
00110             // GetFullPath, we make sure we are always passing the full path
00111             // the win32 functions.
00112             m_path = System.IO.Path.GetFullPath(path);
00113         }
00114
00119         public string Path
00120         {
00121             get
00122             {
00123                 return m_path;
00124             }
00125         }
00126
00127         #region Get Value Methods
00128
00145         public string GetString(string sectionName,
00146                                 string keyName,
00147                                 string defaultValue)
00148         {
00149             if (sectionName == null)
00150                 throw new ArgumentNullException("sectionName");
00151
00152             if (keyName == null)
00153                 throw new ArgumentNullException("keyName");
00154
00155             StringBuilder retval = new StringBuilder(IniFile.MaxSectionSize);
00156
00157             NativeMethods.GetPrivateProfileString(sectionName,
00158                                                   keyName,
00159                                                   defaultValue,
00160                                                   retval,
00161                                                   IniFile.MaxSectionSize,
00162                                                   m_path);
00163
00164             return retval.ToString();
00165         }
00166
00180         public short GetInt16(string sectionName,
00181                               string keyName,
00182                               short  defaultValue)
00183         {
00184             int retval = GetInt32(sectionName, keyName, defaultValue);
00185
00186             return Convert.ToInt16(retval);
00187         }
00188
00202         public int GetInt32(string sectionName,
00203                             string keyName,
00204                             int defaultValue)
00205         {
00206             if (sectionName == null)
00207                 throw new ArgumentNullException("sectionName");
00208
00209             if (keyName == null)
00210                 throw new ArgumentNullException("keyName");
00211
00212             return NativeMethods.GetPrivateProfileInt(sectionName, keyName, defaultValue, m_path);
00213         }
00214
00228         public double GetDouble(string sectionName,
00229                                 string keyName,
00230                                 double defaultValue)
00231         {
00232             string str = GetString(sectionName, keyName, "");
00233
00234             if (String.IsNullOrEmpty(str))
00235                 return defaultValue;
00236
00237                         double retval;
00238                         if (!Double.TryParse(str, NumberStyles.Float, CultureInfo.InvariantCulture, out retval))
00239                                 retval = defaultValue;
00240
00241             return retval;
00242         }
00243
00257                 public bool GetBoolean(string sectionName,
00258                                                                  string keyName,
00259                                                                  bool defaultValue)
00260                 {
00261                         string str = GetString(sectionName, keyName, "");
00262                         if (String.IsNullOrEmpty(str))
00263                                 return defaultValue;
00264
00265                         bool retval;
00266                         if (!Boolean.TryParse(str, out retval))
00267                         {
00268                                 retval = defaultValue;
00269                         }
00270
00271                         return retval;
00272                 }
00273
00274         #endregion
00275
00276         #region GetSectionValues Methods
00277
00295         public List<KeyValuePair<string, string>> GetSectionValuesAsList(string sectionName)
00296         {
00297             List<KeyValuePair<string, string>> retval;
00298             string[] keyValuePairs;
00299             string key, value;
00300             int equalSignPos;
00301
00302             if (sectionName == null)
00303                 throw new ArgumentNullException("sectionName");
00304
00305             //Allocate a buffer for the returned section names.
00306             IntPtr ptr = Marshal.AllocCoTaskMem(IniFile.MaxSectionSize);
00307
00308             try
00309             {
00310                 //Get the section key/value pairs into the buffer.
00311                 int len = NativeMethods.GetPrivateProfileSection(sectionName,
00312                                                                  ptr,
00313                                                                  IniFile.MaxSectionSize,
00314                                                                  m_path);
00315
00316                 keyValuePairs = ConvertNullSeperatedStringToStringArray(ptr, len);
00317             }
00318             finally
00319             {
00320                 //Free the buffer
00321                 Marshal.FreeCoTaskMem(ptr);
00322             }
00323
00324             //Parse keyValue pairs and add them to the list.
00325             retval = new List<KeyValuePair<string, string>>(keyValuePairs.Length);
00326
00327             for (int i = 0; i < keyValuePairs.Length; ++i)
00328             {
00329                 //Parse the "key=value" string into its constituent parts
00330                 equalSignPos = keyValuePairs[i].IndexOf('=');
00331
00332                 key = keyValuePairs[i].Substring(0, equalSignPos);
00333
00334                 value = keyValuePairs[i].Substring(equalSignPos + 1,
00335                                                    keyValuePairs[i].Length - equalSignPos - 1);
00336
00337                 retval.Add( new KeyValuePair<string, string>(key, value) );
00338             }
00339
00340             return retval;
00341         }
00342
00362         public Dictionary<string, string> GetSectionValues(string sectionName)
00363         {
00364             List<KeyValuePair<string, string>> keyValuePairs;
00365             Dictionary<string, string> retval;
00366
00367             keyValuePairs = GetSectionValuesAsList(sectionName);
00368
00369             //Convert list into a dictionary.
00370             retval = new Dictionary<string, string>(keyValuePairs.Count);
00371
00372             foreach (KeyValuePair<string, string> keyValuePair in keyValuePairs)
00373             {
00374                 //Skip any key we have already seen.
00375                 if (!retval.ContainsKey(keyValuePair.Key))
00376                 {
00377                     retval.Add(keyValuePair.Key, keyValuePair.Value);
00378                 }
00379             }
00380
00381             return retval;
00382         }
00383
00384         #endregion
00385
00386         #region Get Key/Section Names
00387
00402         public string[] GetKeyNames(string sectionName)
00403         {
00404             int len;
00405             string[] retval;
00406
00407             if (sectionName == null)
00408                 throw new ArgumentNullException("sectionName");
00409
00410             //Allocate a buffer for the returned section names.
00411             IntPtr ptr = Marshal.AllocCoTaskMem(IniFile.MaxSectionSize);
00412
00413             try
00414             {
00415                 //Get the section names into the buffer.
00416                 len = NativeMethods.GetPrivateProfileString(sectionName,
00417                                                             null,
00418                                                             null,
00419                                                             ptr,
00420                                                             IniFile.MaxSectionSize,
00421                                                             m_path);
00422
00423                 retval = ConvertNullSeperatedStringToStringArray(ptr, len);
00424             }
00425             finally
00426             {
00427                 //Free the buffer
00428                 Marshal.FreeCoTaskMem(ptr);
00429             }
00430
00431             return retval;
00432         }
00433
00442         public string[] GetSectionNames()
00443         {
00444             string[] retval;
00445             int len;
00446
00447             //Allocate a buffer for the returned section names.
00448             IntPtr ptr = Marshal.AllocCoTaskMem(IniFile.MaxSectionSize);
00449
00450             try
00451             {
00452                 //Get the section names into the buffer.
00453                 len = NativeMethods.GetPrivateProfileSectionNames(ptr,
00454                     IniFile.MaxSectionSize, m_path);
00455
00456                 retval = ConvertNullSeperatedStringToStringArray(ptr, len);
00457             }
00458             finally
00459             {
00460                 //Free the buffer
00461                 Marshal.FreeCoTaskMem(ptr);
00462             }
00463
00464             return retval;
00465         }
00466
00478         private static string[] ConvertNullSeperatedStringToStringArray(IntPtr ptr, int valLength)
00479         {
00480             string[] retval;
00481
00482             if (valLength == 0)
00483             {
00484                 //Return an empty array.
00485                 retval = new string[0];
00486             }
00487             else
00488             {
00489                 //Convert the buffer into a string.  Decrease the length
00490                 //by 1 so that we remove the second null off the end.
00491                 string buff = Marshal.PtrToStringAuto(ptr, valLength - 1);
00492
00493                 //Parse the buffer into an array of strings by searching for nulls.
00494                 retval = buff.Split('\0');
00495             }
00496
00497             return retval;
00498         }
00499
00500         #endregion
00501
00502         #region Write Methods
00503
00513         private void WriteValueInternal(string sectionName, string keyName, string value)
00514         {
00515             if (!NativeMethods.WritePrivateProfileString(sectionName, keyName, value, m_path))
00516             {
00517                 throw new System.ComponentModel.Win32Exception();
00518             }
00519         }
00520
00534         public void WriteValue(string sectionName, string keyName, string value)
00535         {
00536             if (sectionName == null)
00537                 throw new ArgumentNullException("sectionName");
00538
00539             if (keyName == null)
00540                 throw new ArgumentNullException("keyName");
00541
00542             if (value == null)
00543                 throw new ArgumentNullException("value");
00544
00545             WriteValueInternal(sectionName, keyName, value);
00546         }
00547
00557         public void WriteValue(string sectionName, string keyName, short value)
00558         {
00559             WriteValue(sectionName, keyName, (int)value);
00560         }
00561
00575         public void WriteValue(string sectionName, string keyName, int value)
00576         {
00577             WriteValue(sectionName, keyName, value.ToString(CultureInfo.InvariantCulture));
00578         }
00579
00593         public void WriteValue(string sectionName, string keyName, float value)
00594         {
00595             WriteValue(sectionName, keyName, value.ToString(CultureInfo.InvariantCulture));
00596         }
00597
00611         public void WriteValue(string sectionName, string keyName, double value)
00612         {
00613             WriteValue(sectionName, keyName, value.ToString(CultureInfo.InvariantCulture));
00614         }
00615
00629                 public void WriteValue(string sectionName, string keyName, bool value)
00630                 {
00631                         WriteValue(sectionName, keyName, value.ToString(CultureInfo.InvariantCulture));
00632                 }
00633
00634         #endregion
00635
00636         #region Delete Methods
00637
00651         public void DeleteKey(string sectionName, string keyName)
00652         {
00653             if (sectionName == null)
00654                 throw new ArgumentNullException("sectionName");
00655
00656             if (keyName == null)
00657                 throw new ArgumentNullException("keyName");
00658
00659             WriteValueInternal(sectionName, keyName, null);
00660         }
00661
00671         public void DeleteSection(string sectionName)
00672         {
00673             if (sectionName == null)
00674                 throw new ArgumentNullException("sectionName");
00675
00676             WriteValueInternal(sectionName, null, null);
00677         }
00678
00679         #endregion
00680     }
00681 }
Generated on Thu Sep 21 2017 15:39:02 for DPP ReadCfg by doxygen 1.7.6.1


DPP ReadCfg: Class List

  • Class List
  • Class Index
  • Class Members
Class List
Here are the classes, structs, unions and interfaces with brief descriptions:
AsciiCmdUtilities.CommandFilters |
ReadCfg.Form1 | Summary description for Form1
csRepeat.FW6DppStatus | Parse FW6 Dpp Status data packets
INIUtilities.IniFile | Provides methods for reading and writing to an INI file


DPP ReadCfg: Member List

  • Class List
  • Class Index
  • Class Members
  • AsciiCmdUtilities
  • CommandFilters
AsciiCmdUtilities.CommandFilters Member List
This is the complete list of members for AsciiCmdUtilities.CommandFilters, including all inherited members.
CreateFullReadBackCmd(bool PC5_PRESENT, int DppType, bool isDP5_RevDxGains, byte DPP_ECO) | AsciiCmdUtilities.CommandFilters | [inline]
CreateResTestReadBackCmd(bool bSendCoarseFineGain, int DppType) | AsciiCmdUtilities.CommandFilters | [inline]
CreateSpectrumConfig(string strRawCfgIn) | AsciiCmdUtilities.CommandFilters | [inline]
GetCmdDesc(string strCmd) | AsciiCmdUtilities.CommandFilters | [inline]
MakeDp5CmdList() | AsciiCmdUtilities.CommandFilters | [inline]
RemoveCmd(string strCmd, string strCfgData) | AsciiCmdUtilities.CommandFilters | [inline, static]
RemoveCmdByDeviceType(string strCfgDataIn, bool PC5_PRESENT, int DppType, bool isDP5_RevDxGains, byte DPP_ECO) | AsciiCmdUtilities.CommandFilters | [inline]
Generated on Thu Sep 21 2017 15:39:02 for DPP ReadCfg by doxygen 1.7.6.1


DPP ReadCfg: Member List

  • Class List
  • Class Index
  • Class Members
  • INIUtilities
  • IniFile
INIUtilities.IniFile Member List
This is the complete list of members for INIUtilities.IniFile, including all inherited members.
DeleteKey(string sectionName, string keyName) | INIUtilities.IniFile | [inline]
DeleteSection(string sectionName) | INIUtilities.IniFile | [inline]
GetBoolean(string sectionName, string keyName, bool defaultValue) | INIUtilities.IniFile | [inline]
GetDouble(string sectionName, string keyName, double defaultValue) | INIUtilities.IniFile | [inline]
GetInt16(string sectionName, string keyName, short defaultValue) | INIUtilities.IniFile | [inline]
GetInt32(string sectionName, string keyName, int defaultValue) | INIUtilities.IniFile | [inline]
GetKeyNames(string sectionName) | INIUtilities.IniFile | [inline]
GetSectionNames() | INIUtilities.IniFile | [inline]
GetSectionValues(string sectionName) | INIUtilities.IniFile | [inline]
GetSectionValuesAsList(string sectionName) | INIUtilities.IniFile | [inline]
GetString(string sectionName, string keyName, string defaultValue) | INIUtilities.IniFile | [inline]
IniFile(string path) | INIUtilities.IniFile | [inline]
MaxSectionSize | INIUtilities.IniFile |
Path | INIUtilities.IniFile |
WriteValue(string sectionName, string keyName, string value) | INIUtilities.IniFile | [inline]
WriteValue(string sectionName, string keyName, short value) | INIUtilities.IniFile | [inline]
WriteValue(string sectionName, string keyName, int value) | INIUtilities.IniFile | [inline]
WriteValue(string sectionName, string keyName, float value) | INIUtilities.IniFile | [inline]
WriteValue(string sectionName, string keyName, double value) | INIUtilities.IniFile | [inline]
WriteValue(string sectionName, string keyName, bool value) | INIUtilities.IniFile | [inline]


DPP ReadCfg: Member List

  • Class List
  • Class Index
  • Class Members
  • ReadCfg
  • Form1
ReadCfg.Form1 Member List
This is the complete list of members for ReadCfg.Form1, including all inherited members.
Dispose(bool disposing) | ReadCfg.Form1 | [inline, protected]
Form1() | ReadCfg.Form1 | [inline]


DPP ReadCfg: Member List

  • Class List
  • Class Index
  • Class Members
  • csRepeat
  • FW6DppStatus
csRepeat.FW6DppStatus Member List
This is the complete list of members for csRepeat.FW6DppStatus, including all inherited members.
AccumulationTime | csRepeat.FW6DppStatus |
DEVICE_ID | csRepeat.FW6DppStatus |
DPP_ECO | csRepeat.FW6DppStatus |
dppDP5 | csRepeat.FW6DppStatus |
dppDP5G | csRepeat.FW6DppStatus |
dppDP5X | csRepeat.FW6DppStatus |
dppMCA8000D | csRepeat.FW6DppStatus |
dppPX5 | csRepeat.FW6DppStatus |
dppTB5 | csRepeat.FW6DppStatus |
GetDeviceNameFromVal(int DeviceTypeVal) | csRepeat.FW6DppStatus | [inline]
GetStatusValueStrings() | csRepeat.FW6DppStatus | [inline]
GetULong(int ulStart, byte[] buffer) | csRepeat.FW6DppStatus | [inline]
isDP5_RevDxGains | csRepeat.FW6DppStatus |
MCA_EN | csRepeat.FW6DppStatus |
OnOffStr(bool bOn) | csRepeat.FW6DppStatus | [inline]
PC5_PRESENT | csRepeat.FW6DppStatus |
PRECNT_REACHED | csRepeat.FW6DppStatus |
PresetLtDone | csRepeat.FW6DppStatus |
PresetRtDone | csRepeat.FW6DppStatus |
Process_Status(byte[] buffer) | csRepeat.FW6DppStatus | [inline]
PX5_OPTION_HPGe_HVPS | csRepeat.FW6DppStatus |
PX5_OPTION_NONE | csRepeat.FW6DppStatus |
PX5_OPTION_TEST_AMP | csRepeat.FW6DppStatus |
PX5_OPTION_TEST_MODE_1 | csRepeat.FW6DppStatus |
PX5_OPTION_TEST_MODE_2 | csRepeat.FW6DppStatus |
PX5_OPTION_TEST_MOX | csRepeat.FW6DppStatus |
PX5_OPTION_TEST_TEK | csRepeat.FW6DppStatus |
PX5_OptionsString() | csRepeat.FW6DppStatus | [inline]
ShowStatusValueStrings() | csRepeat.FW6DppStatus | [inline]
VersionToStr(byte bVersion) | csRepeat.FW6DppStatus | [inline]


DPP ReadCfg: Class Index

  • Class List
  • Class Index
  • Class Members
Class Index
C | F | I
C
F
FW6DppStatus (csRepeat)
I
CommandFilters (AsciiCmdUtilities) Form1 (ReadCfg)
IniFile (INIUtilities)
C | F | I


DPP ReadCfg: File List

  • File List
File List
Here is a list of all files with brief descriptions:
AsciiCmdUtilities.cs [code]
AssemblyInfo.cs [code]
Form1.cs [code]
FW6DppStatus.cs [code]
IniFile.cs [code]


DPP ReadCfg: Graph Legend

Graph Legend

This page explains how to interpret the graphs that are generated by doxygen.

Consider the following example:

/*! Invisible class because of truncation */
class Invisible { };

/*! Truncated class, inheritance relation is hidden */
class Truncated : public Invisible { };

/* Class not documented with doxygen comments */
class Undocumented { };

/*! Class that is inherited using public inheritance */
class PublicBase : public Truncated { };

/*! A template class */
template<class T> class Templ { };

/*! Class that is inherited using protected inheritance */
class ProtectedBase { };

/*! Class that is inherited using private inheritance */
class PrivateBase { };

/*! Class that is used by the Inherited class */
class Used { };

/*! Super class that inherits a number of other classes */
class Inherited : public PublicBase,
                  protected ProtectedBase,
                  private PrivateBase,
                  public Undocumented,
                  public Templ<int>
{
  private:
    Used *m_usedClass;
};

This will result in the following graph:

The boxes in the above graph have the following meaning:

  • A filled gray box represents the struct or class for which the graph is generated.
  • A box with a black border denotes a documented struct or class.
  • A box with a grey border denotes an undocumented struct or class.
  • A box with a red border denotes a documented struct or class forwhich not all inheritance/containment relations are shown. A graph is truncated if it does not fit within the specified boundaries.

The arrows have the following meaning:

  • A dark blue arrow is used to visualize a public inheritance relation between two classes.
  • A dark green arrow is used for protected inheritance.
  • A dark red arrow is used for private inheritance.
  • A purple dashed arrow is used if a class is contained or used by another class. The arrow is labeled with the variable(s) through which the pointed class or struct is accessible.
  • A yellow dashed arrow denotes a relation between a template instance and the template class it was instantiated from. The arrow is labeled with the template parameters of the instance.


DPP ReadCfg: Package AsciiCmdUtilities

  • Namespace List
Classes
Package AsciiCmdUtilities

Classes

class CommandFilters
Generated on Thu Sep 21 2017 15:39:02 for DPP ReadCfg by doxygen 1.7.6.1


DPP ReadCfg: Package INIUtilities

  • Namespace List
Classes
Package INIUtilities

Classes

class IniFile
Provides methods for reading and writing to an INI file. More...


DPP ReadCfg: Package ReadCfg

  • Namespace List
Classes
Package ReadCfg

Classes

class Form1
Summary description for Form1. More...


DPP ReadCfg: Package csRepeat

  • Namespace List
Classes
Package csRepeat

Classes

class FW6DppStatus
Parse FW6 Dpp Status data packets. More...
Generated on Thu Sep 21 2017 15:39:02 for DPP ReadCfg by doxygen 1.7.6.1


DPP ReadCfg: Namespace List

  • Namespace List
Namespace List
Here is a list of all namespaces with brief descriptions:
AsciiCmdUtilities
csRepeat
INIUtilities
ReadCfg
Generated on Thu Sep 21 2017 15:39:03 for DPP ReadCfg by doxygen 1.7.6.1


DPP ReadCfg: readme.txt File Reference

  • File List
readme.txt File Reference
Generated on Thu Sep 21 2017 15:39:02 for DPP ReadCfg by doxygen 1.7.6.1