diff --git a/Software/Arduino/AutomatedMeasurementsControlStepperMotors216/AutomatedMeasurementsControlStepperMotors216.ino b/Software/Arduino/AutomatedMeasurementsControlStepperMotors216/AutomatedMeasurementsControlStepperMotors216.ino new file mode 100644 index 0000000..3103442 --- /dev/null +++ b/Software/Arduino/AutomatedMeasurementsControlStepperMotors216/AutomatedMeasurementsControlStepperMotors216.ino @@ -0,0 +1,215 @@ +/* +Author: F. Lionetto +Created on: January 6th, 2015 + +The sketch waits for commands sent through the USB port. + +Coordinate system: +- x axis across the strips, forward direction is toward the window, backward direction is toward the door (stepper motor 1); +- y axis along the strips; +- z axis toward the strips, forward direction is down, backward direction is up (stepper motor 2). + +The x micro switch is connected to pin 22. +The z micro switch is connected to pin 23. + +The stepper motors have two different speeds, one for non-precise and one for precise positioning, respectively. + +ASCII printable characters: ++ ---> 43; +0 ---> 48; +1 ---> 49; +2 ---> 50; +3 ---> 51. + +The only allowed commands (checked before and after being sent through the USB port) are: ++10 ---> move one step forward along x; ++20 ---> move one step backward along x ++30 ---> move at the opposite edge of the silicon sensor (along x); ++40 ---> move back; ++01 ---> move one step forward along z; ++02 ---> move one step backward along z; ++03 ---> move 0.1 mm forward along z; ++04 ---> move 0.1 mm backward along z. + +Distances in microns. + +For Hans410 sensor: +- the laser is initially on the strips corresponding to Beetle channels 216/220; +- +30 brings the laser on the strips corresponding to the Beetle channels 16/20; +- +40 brings the laser on the strips corresponding to the Beetle channels 216/220. +*/ + +#include +#include +#include "utility/Adafruit_PWMServoDriver.h" + +// Stepper motor properties. +const int stepsPerRevolution = 200; +const int singleStep = 5; +const int speedFast = 50; +const int speedSlow = 5; + +// Create the motor shield object with the default I2C address. +Adafruit_MotorShield AFMS = Adafruit_MotorShield(); + +// Connect a stepper motor with 200 steps per revolution (1.8 degree) to motor port #1 (M1 and M2). +Adafruit_StepperMotor *myMotorX = AFMS.getStepper(stepsPerRevolution, 1); +Adafruit_StepperMotor *myMotorZ = AFMS.getStepper(stepsPerRevolution, 2); + +// Micro switch properties. +const int switchXPin = 22; +const int switchZPin = 23; +int switchXState = 0; +int switchZState = 0; + +// Scan properties. +// Maximum distance from the x micro switch (!!!) +// const int maxStepsX = 16000; +// Maximum distance from the z micro switch (!!!) +// const int maxStepsZ = 5400; +// Move the laser 3.60 cm (7200 steps) away from the x micro switch +const int stepsFromXSwitch = 7200; +// Move the laser 2.00 cm (4000) away from the z micro switch +const int stepsFromZSwitch = 4000; +// Total number of steps we need along x. +// const int totStepsX = 200; +// Total number of steps we need along y. +// const int totStepsZ = 200; +// int stepsX = 0; +// int stepsZ = 0; +// Byte read from the USB port. +byte byteUSB; +// 1 if the byte read from the USB port is +. +boolean commandReceived = false; +// 1 if the byte read from the USB port is the first after +. +boolean xCommandReceived = false; +// 1 if the byte read from the USB port is the second after +. +boolean zCommandReceived = false; +int moveX = 0; +int moveZ = 0; + +void stepAction(int moveX, int moveZ) { + if (moveX == 1) { + myMotorX->step(1,FORWARD,DOUBLE); + Serial.println("Moved forward along x."); + } + else if (moveX == 2) { + myMotorX->step(1,BACKWARD,DOUBLE); + Serial.println("Moved backward along x."); + } + else if (moveX == 3) { + myMotorX->step(1900,BACKWARD,DOUBLE); + Serial.println("Moved at the opposite edge of the silicon sensor (along x)."); + } + else if (moveX == 4) { + myMotorX->step(1900,FORWARD,DOUBLE); + Serial.println("Moved back."); + } + if (moveZ == 1) { + myMotorZ->step(1,FORWARD,DOUBLE); + Serial.println("Moved forward along z."); + } + else if (moveZ == 2) { + myMotorZ->step(1,BACKWARD,DOUBLE); + Serial.println("Moved backward along z."); + } + else if (moveZ == 3) { + myMotorZ->step(20,FORWARD,DOUBLE); + Serial.println("Moved 0.1 mm forward along z."); + } + else if (moveZ == 4) { + myMotorZ->step(20,BACKWARD,DOUBLE); + Serial.println("Moved 0.1 mm backward along z."); + } +} + +void setup() { + Serial.begin(9600); + Serial.println("This is a test!"); + + AFMS.begin(); + + myMotorX->setSpeed(speedFast); + myMotorZ->setSpeed(speedFast); + + pinMode(switchXPin,INPUT); + pinMode(switchZPin,INPUT); + + /* + Serial.println("Inizializing position along x..."); + + while (switchXState == LOW) { + switchXState = digitalRead(switchXPin); + if (switchXState == LOW) { + // The stepper motor is not at the origin of the coordinate system. + myMotorX->step(1,FORWARD,DOUBLE); + } + } + + Serial.println("Position along x successfully initialized."); + + Serial.println("Inizializing position along z..."); + + while (switchZState == LOW) { + switchZState = digitalRead(switchZPin); + if (switchZState == LOW) { + // The stepper motor is not at the origin of the coordinate system. + myMotorZ->step(1,BACKWARD,DOUBLE); + } + } + + Serial.println("Position along z successfully initialized."); + + Serial.println("Moving the laser 3.60 cm (7200 steps) away from the x micro switch..."); + + myMotorX->step(stepsFromXSwitch,BACKWARD,DOUBLE); + + Serial.println("Laser moved 3.60 cm (7200 steps) away from the x micro switch."); + + Serial.println("Moving the laser 2.00 cm (4000 steps) away from the z micro switch..."); + + myMotorZ->step(stepsFromZSwitch,FORWARD,DOUBLE); + + Serial.println("Laser moved 2.00 cm (4000 steps) away from the z micro switch."); + */ + + myMotorX->setSpeed(speedSlow); + myMotorZ->setSpeed(speedSlow); + + // myMotorX->release(); + // myMotorZ->release(); +} + +void loop() { + if (Serial.available()) { + byteUSB = Serial.read(); + Serial.println(byteUSB); + if ((byteUSB != 43) && (byteUSB !=48) && (byteUSB != 49) && (byteUSB != 50) && (byteUSB != 51) && (byteUSB != 52)) { + Serial.println("Invalid command received."); + } + else if ((commandReceived == false) && (byteUSB == 43)) { + commandReceived = true; + Serial.println("Valid command received."); + xCommandReceived = false; + zCommandReceived = false; + moveX = 0; + moveZ = 0; + } + else if ((commandReceived == true) && (xCommandReceived == false)) { + moveX = byteUSB - 48; + Serial.println(moveX); + xCommandReceived = true; + Serial.println("Command for x direction received."); + } + else if ((commandReceived == true) && (zCommandReceived == false)) { + moveZ = byteUSB - 48; + Serial.println(moveZ); + zCommandReceived = true; + Serial.println("Command for z direction received."); + } + } + else if ((commandReceived == true) && (xCommandReceived == true) && (zCommandReceived == true)) { + stepAction(moveX,moveZ); + commandReceived = false; + } +} diff --git a/Software/Arduino/ResetAndControlStepperMotors216/ResetAndControlStepperMotors216.ino b/Software/Arduino/ResetAndControlStepperMotors216/ResetAndControlStepperMotors216.ino index 5074094..5de01e0 100644 --- a/Software/Arduino/ResetAndControlStepperMotors216/ResetAndControlStepperMotors216.ino +++ b/Software/Arduino/ResetAndControlStepperMotors216/ResetAndControlStepperMotors216.ino @@ -69,8 +69,8 @@ // const int maxStepsZ = 5400; // Move the laser 3.60 cm (7200 steps) away from the x micro switch const int stepsFromXSwitch = 7200; -// Move the laser 2.00 cm (4000) away from the z micro switch -const int stepsFromZSwitch = 4000; +// Move the laser 1.80 cm (3600) away from the z micro switch +const int stepsFromZSwitch = 3600; // Total number of steps we need along x. // const int totStepsX = 200; // Total number of steps we need along y. @@ -163,11 +163,11 @@ Serial.println("Laser moved 3.60 cm (7200 steps) away from the x micro switch."); - Serial.println("Moving the laser 2.00 cm (4000 steps) away from the z micro switch..."); + Serial.println("Moving the laser 1.80 cm (3600 steps) away from the z micro switch..."); myMotorZ->step(stepsFromZSwitch,FORWARD,DOUBLE); - Serial.println("Laser moved 2.00 cm (4000 steps) away from the z micro switch."); + Serial.println("Laser moved 1.80 cm (3600 steps) away from the z micro switch."); myMotorX->setSpeed(speedSlow); myMotorZ->setSpeed(speedSlow); diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ArduinoController/6-ArduinoController.csproj b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ArduinoController/6-ArduinoController.csproj new file mode 100644 index 0000000..a236852 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ArduinoController/6-ArduinoController.csproj @@ -0,0 +1,94 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {F994C186-EB6F-4E71-B274-DBF46F3534BB} + WinExe + Properties + _6_ArduinoController + 6-ArduinoController + v4.0 + Client + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + Form + + + ControllerForm.cs + + + + + + ControllerForm.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + {3CF8F8FC-6F5C-46F8-94DC-C2E4C505ECA4} + CommandMessenger + + + + + \ No newline at end of file diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ArduinoController/ArduinoController.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ArduinoController/ArduinoController.cs new file mode 100644 index 0000000..8c25308 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ArduinoController/ArduinoController.cs @@ -0,0 +1,158 @@ +// *** ArduinoController *** + +// This example expands the SendandReceiveArguments example. The PC will now sends commands to the Arduino when the trackbar +// is pulled. Every TrackBarChanged events will queue a message to the Arduino to set the blink speed of the +// internal / pin 13 LED +// +// This example shows how to : +// - use in combination with WinForms +// - use in combination with ZedGraph +// - send queued commands +// - Use the CollapseCommandStrategy + +using System; +using CommandMessenger; +using CommandMessenger.Serialport; +using CommandMessenger.TransportLayer; + +namespace ArduinoController +{ + enum Command + { + Acknowledge, // Command to acknowledge a received command + Error, // Command to message that an error has occurred + SetLed, // Command to turn led ON or OFF + SetLedFrequency, // Command to set led blink frequency + }; + + public class ArduinoController + { + // This class (kind of) contains presentation logic, and domain model. + // ChartForm.cs contains the view components + + private SerialTransport _serialTransport; + private CmdMessenger _cmdMessenger; + private ControllerForm _controllerForm; + + // ------------------ MAIN ---------------------- + + // Setup function + public void Setup(ControllerForm controllerForm) + { + // storing the controller form for later reference + _controllerForm = controllerForm; + + // Create Serial Port object + // Note that for some boards (e.g. Sparkfun Pro Micro) DtrEnable may need to be true. + _serialTransport = new SerialTransport + { + CurrentSerialSettings = { PortName = "COM6", BaudRate = 115200, DtrEnable = false } // object initializer + }; + + // Initialize the command messenger with the Serial Port transport layer + _cmdMessenger = new CmdMessenger(_serialTransport) + { + BoardType = BoardType.Bit16 // Set if it is communicating with a 16- or 32-bit Arduino board + }; + + // Tell CmdMessenger to "Invoke" commands on the thread running the WinForms UI + _cmdMessenger.SetControlToInvokeOn(_controllerForm); + + // Attach the callbacks to the Command Messenger + AttachCommandCallBacks(); + + // Attach to NewLinesReceived for logging purposes + _cmdMessenger.NewLineReceived += NewLineReceived; + + // Attach to NewLineSent for logging purposes + _cmdMessenger.NewLineSent += NewLineSent; + + // Start listening + _cmdMessenger.Connect(); + + _controllerForm.SetLedState(true); + _controllerForm.SetFrequency(2); + } + + // Exit function + public void Exit() + { + // Stop listening + _cmdMessenger.Disconnect(); + + // Dispose Command Messenger + _cmdMessenger.Dispose(); + + // Dispose Serial Port object + _serialTransport.Dispose(); + } + + /// Attach command call backs. + private void AttachCommandCallBacks() + { + _cmdMessenger.Attach(OnUnknownCommand); + _cmdMessenger.Attach((int)Command.Acknowledge, OnAcknowledge); + _cmdMessenger.Attach((int)Command.Error, OnError); + } + + // ------------------ CALLBACKS --------------------- + + // Called when a received command has no attached function. + // In a WinForm application, console output gets routed to the output panel of your IDE + void OnUnknownCommand(ReceivedCommand arguments) + { + Console.WriteLine(@"Command without attached callback received"); + } + + // Callback function that prints that the Arduino has acknowledged + void OnAcknowledge(ReceivedCommand arguments) + { + Console.WriteLine(@" Arduino is ready"); + } + + // Callback function that prints that the Arduino has experienced an error + void OnError(ReceivedCommand arguments) + { + Console.WriteLine(@"Arduino has experienced an error"); + } + + // Log received line to console + private void NewLineReceived(object sender, NewLineEvent.NewLineArgs e) + { + Console.WriteLine(@"Received > " + e.Command.CommandString()); + } + + // Log sent line to console + private void NewLineSent(object sender, NewLineEvent.NewLineArgs e) + { + Console.WriteLine(@"Sent > " + e.Command.CommandString()); + } + + // Sent command to change led blinking frequency + public void SetLedFrequency(double ledFrequency) + { + // Create command to start sending data + var command = new SendCommand((int)Command.SetLedFrequency,ledFrequency); + + // Put the command on the queue and wrap it in a collapse command strategy + // This strategy will avoid duplicates of this certain command on the queue: if a SetLedFrequency command is + // already on the queue when a new one is added, it will be replaced at its current queue-position. + // Otherwise the command will be added to the back of the queue. + // + // This will make sure that when the slider raises a lot of events that each send a new blink frequency, the + // embedded controller will not start lagging. + _cmdMessenger.QueueCommand(new CollapseCommandStrategy(command)); + } + + + // Sent command to change led on/of state + public void SetLedState(bool ledState) + { + // Create command to start sending data + var command = new SendCommand((int)Command.SetLed, ledState); + + // Send command + _cmdMessenger.SendCommand(new SendCommand((int)Command.SetLed, ledState)); + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ArduinoController/ControllerForm.Designer.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ArduinoController/ControllerForm.Designer.cs new file mode 100644 index 0000000..d1935c6 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ArduinoController/ControllerForm.Designer.cs @@ -0,0 +1,96 @@ +namespace ArduinoController +{ + partial class ControllerForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.EnableLedCheckBox = new System.Windows.Forms.CheckBox(); + this.LedFrequencyLabelTrackBar = new System.Windows.Forms.TrackBar(); + this.LedFrequencyLabel = new System.Windows.Forms.Label(); + this.LedFrequencyValue = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.LedFrequencyLabelTrackBar)).BeginInit(); + this.SuspendLayout(); + // + // EnableLedCheckBox + // + this.EnableLedCheckBox.AutoSize = true; + this.EnableLedCheckBox.Checked = true; + this.EnableLedCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; + this.EnableLedCheckBox.Location = new System.Drawing.Point(30, 12); + this.EnableLedCheckBox.Name = "EnableLedCheckBox"; + this.EnableLedCheckBox.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.EnableLedCheckBox.Size = new System.Drawing.Size(80, 17); + this.EnableLedCheckBox.TabIndex = 0; + this.EnableLedCheckBox.Text = "Enable Led"; + this.EnableLedCheckBox.UseVisualStyleBackColor = true; + this.EnableLedCheckBox.CheckedChanged += new System.EventHandler(this.EnableLedCheckBoxCheckedChanged); + // + // LedFrequencyLabelTrackBar + // + this.LedFrequencyLabelTrackBar.Location = new System.Drawing.Point(90, 35); + this.LedFrequencyLabelTrackBar.Maximum = 240; + this.LedFrequencyLabelTrackBar.Name = "LedFrequencyLabelTrackBar"; + this.LedFrequencyLabelTrackBar.Size = new System.Drawing.Size(208, 45); + this.LedFrequencyLabelTrackBar.TabIndex = 1; + this.LedFrequencyLabelTrackBar.Tag = ""; + this.LedFrequencyLabelTrackBar.TickFrequency = 10; + this.LedFrequencyLabelTrackBar.Scroll += new System.EventHandler(this.LedFrequencyTrackBarScroll); + this.LedFrequencyLabelTrackBar.ValueChanged += new System.EventHandler(this.LedFrequencyLabelTrackBarValueChanged); + // + // LedFrequencyLabel + // + this.LedFrequencyLabel.AutoSize = true; + this.LedFrequencyLabel.Location = new System.Drawing.Point(14, 36); + this.LedFrequencyLabel.Name = "LedFrequencyLabel"; + this.LedFrequencyLabel.Size = new System.Drawing.Size(78, 13); + this.LedFrequencyLabel.TabIndex = 2; + this.LedFrequencyLabel.Text = "Led Frequency"; + // + // LedFrequencyValue + // + this.LedFrequencyValue.AutoSize = true; + this.LedFrequencyValue.Location = new System.Drawing.Point(304, 38); + this.LedFrequencyValue.Name = "LedFrequencyValue"; + this.LedFrequencyValue.Size = new System.Drawing.Size(13, 13); + this.LedFrequencyValue.TabIndex = 3; + this.LedFrequencyValue.Text = "0"; + // + // ControllerForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(344, 85); + this.Controls.Add(this.LedFrequencyValue); + this.Controls.Add(this.LedFrequencyLabel); + this.Controls.Add(this.LedFrequencyLabelTrackBar); + this.Controls.Add(this.EnableLedCheckBox); + this.Name = "ControllerForm"; + this.Text = "Arduino Controller"; + ((System.ComponentModel.ISupportInitialize)(this.LedFrequencyLabelTrackBar)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.CheckBox EnableLedCheckBox; + private System.Windows.Forms.TrackBar LedFrequencyLabelTrackBar; + private System.Windows.Forms.Label LedFrequencyLabel; + private System.Windows.Forms.Label LedFrequencyValue; + } +} + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ArduinoController/ControllerForm.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ArduinoController/ControllerForm.cs new file mode 100644 index 0000000..ee067ca --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ArduinoController/ControllerForm.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace ArduinoController +{ + public partial class ControllerForm : Form + { + private readonly ArduinoController _arduinoController; + private double _ledFrequency; + + public ControllerForm() + { + InitializeComponent(); + _arduinoController = new ArduinoController(); + _arduinoController.Setup(this); + } + + // Update arduinoController on value checkbox checked/unchecked + private void EnableLedCheckBoxCheckedChanged(object sender, EventArgs e) + { + _arduinoController.SetLedState(EnableLedCheckBox.Checked); + } + + // Update value label and arduinoController on value changed using slider + private void LedFrequencyTrackBarScroll(object sender, EventArgs e) + { + _ledFrequency = 0.4 + ((double)LedFrequencyLabelTrackBar.Value) / 25.0; + LedFrequencyValue.Text = _ledFrequency.ToString(CultureInfo.InvariantCulture); + _arduinoController.SetLedFrequency(_ledFrequency); + } + + // Set ledState checkbox + public void SetLedState(bool ledState) + { + EnableLedCheckBox.Checked = ledState; + } + + // Set frequency slider + public void SetFrequency(double ledFrequency) + { + LedFrequencyLabelTrackBar.Value = (int) ((ledFrequency - 0.4)*2.5); + } + + // Update value label and arduinoController on value changed + private void LedFrequencyLabelTrackBarValueChanged(object sender, EventArgs e) + { + LedFrequencyTrackBarScroll(sender,e); + } + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing ) + { + _arduinoController.Exit(); + if (components!=null) + components.Dispose(); + } + base.Dispose(disposing); + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ArduinoController/ControllerForm.resx b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ArduinoController/ControllerForm.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ArduinoController/ControllerForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ArduinoController/Program.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ArduinoController/Program.cs new file mode 100644 index 0000000..6bb5f0f --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ArduinoController/Program.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; + +namespace ArduinoController +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new ControllerForm()); + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ArduinoController/Properties/AssemblyInfo.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ArduinoController/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..f667617 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ArduinoController/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("6-ArduinoController")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] + +[assembly: AssemblyProduct("6-ArduinoController")] +[assembly: AssemblyCopyright("Copyright © Thijs Elenbaas 2013,2014")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("a231b913-d766-4279-802d-33591474da50")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ArduinoController/Properties/Resources.Designer.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ArduinoController/Properties/Resources.Designer.cs new file mode 100644 index 0000000..570496a --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ArduinoController/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18052 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace _6_ArduinoController.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("_6_ArduinoController.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ArduinoController/Properties/Resources.resx b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ArduinoController/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ArduinoController/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ArduinoController/Properties/Settings.Designer.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ArduinoController/Properties/Settings.Designer.cs new file mode 100644 index 0000000..f76d28c --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ArduinoController/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18052 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace _6_ArduinoController.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ArduinoController/Properties/Settings.settings b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ArduinoController/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ArduinoController/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/Bluetooth/InTheHand.Net.Personal.XML b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/Bluetooth/InTheHand.Net.Personal.XML new file mode 100644 index 0000000..77bb06b --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/Bluetooth/InTheHand.Net.Personal.XML @@ -0,0 +1,15561 @@ + + + + InTheHand.Net.Personal + + + + + Get the normal first line of Exception.ToString(), + that is without the stack trace lines. + + - + + Get the normal first line of Exception.ToString(), + that is including details of all inner exceptions, + but without the stack trace lines. + e.g. System.IO.IOException: An established connection was aborted by the software in your host machine. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine. + + - + The exception. + + - + A string containing the first line of the Exception.ToString(). + + + + + + + + + + + Parses an array of bytes into the contained SDP + . + + - + + See the + + methods for more information. + + - + + + + + Bit offset of the ElementTypeDescriptor field in a header byte. + + + The header byte has two parts: five bits of ElementTypeDescriptor and + three bits of Size Index. + + + + + + Mask for the SizeIndex field in a header byte. + + + The header byte has two parts: five bits of ElementTypeDescriptor and + three bits of Size Index, upper and lower respectively. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Parses an array of bytes into its contained + . + + - + + See + for more information. + + - + A byte array containing the encoded Service Record. + + The new parsed from the byte array. + + - + + + + + + Parses an array of bytes into its contained + . + + - + + If the record contains any element type not supported by the parser + it will throw . The + only element types defined by SDP in v2.0 that are not currently implemented + are 64- and 128-bit integers. Of course any types defined in a later + version will also throw this. This behaviour can be changed with the + + property. + + + - + A byte array containing a Service Record. + + The position in the data buffer at which to + begin parsing the Service Record. + + The length of the Service Record in the byte array. + + The Service Record parse from the byte array. + + - + + The record contains invalid content. + + + The record contains an element type not supported by the parser. + + - + + + + + + Split a sequence of records into the component records. + + - + + The Bluetooth SDP operation ServiceSearchAttribute returns its + result as a “data element sequence where each element in turn is + a data element sequence representing an attribute list.” This + method split that sequence into the individual attribute lists. + + On CE/Windows Mobile the result of a record lookup is in this form + so + etc use this method to split the result into is constituent records. + + + - + A byte array holding the + “data element sequence where each element in turn is + a data element sequence representing an attribute list.” + + - + An array of byte arrays where each holds a SDP record + (a “data element sequence representing an attribute list.”). + If the input was zero length or empty then a zero length array is returned. + + - + + is . + + + + + For use when the content of the element is in an array + i.e. the stack parses the element structure and returns the values in byte arrays. + + - + Whether the stack uses network order + for UnsignedInteger and TwosComplementInteger elements (as used in the SDP format) + or instead that the numerical values are in host order + in the byte array. + + Whether the stack uses network order + for Uuid elements (as used in the SDP format) + or instead that the numerical values are in host order + in the byte array. + + The byte array containing the SDP value. + + (?Always zero). + + The length of the byte array. + (Always equals ). + + + + The Element Type. + + (Not used). + + The size of the value. + + (?Always zero). + + - + + + + + + + + + Split a header byte into its and + parts. + + + The returned is not checked to be a + known value. + + - + The byte from the header. + + The + value from the header byte. + + The + value from a header byte. + + - + + + + + + Extract the value from a header byte. + + + The returned is not checked to be a + known value. + + - + The byte from the header. + + - + The value as a . + - + + + + + + Extract the field from a header byte. + + - + The byte from the header. + + - + The value as a . + - + + + + + + + + + + + + Gets or set whether the parser will attempt to skip any unknown element + type rather than producing an error. + + - + + + An element type is added instead with + ElementType. + and ElementTypeDescriptor.. + + + + + + Gets or sets whether any URL elements will be converted to + instances at parse time, or left as raw byte arrays. + + - + + This is useful when the URL element is badly formatted and thus the + parser will reject the record, setting this property to true will + allow the parse to complete without attempting to decode the URL value. + + When true the value is stored as a array of bytes, when + false it is stored as a ; + however in earlier versions it was stored as , + and since there was often invalid content on devices (e.g. iPhone) + this often failed. + + + + + + Defines additional Bluetooth socket option levels for the and methods. + + + + + Bluetooth RFComm protocol (bt-rfcomm) + + + + + Logical Link Control and Adaptation Protocol (bt-l2cap) + + + + + Service Discovery Protocol (bt-sdp) + + + + + Note that this exception will always be internal, just catch SocketException. + + + + + + + + Gets a value that indicates whether the 32feet.NET library can be used with the current device. + + + + + When overidden, initiates + lookup the SDP record with the give Service Class Id + to find the RFCOMM port number (SCN) that the server is listening on. + The process returns a list of port numbers. + + The remote device. + + The Service Class Id. + + callback + state + IAsyncResult + + + + When overidden, + completes the SDP Record to port number lookup process + + - + IAsyncResult from . + + - + + There must be at least one entry in the result list for each + Service Record found for the specified Service Class Id. This + allows us to know if no records were found, or that records were + found but none of them were for RFCOMM. + If a particular record does not have a RFCOMM port then -1 (negative + one should be added to the list for it). + + The process may throw an exception if an error occurs, e.g. + the remote device did not respond. + + + - + A + with at least one entry for each Service Record + found for the specified Service Class Id, the item being -1 if the + record has no port. is . + + + + + + + + Get timeout value in Int32 milliseconds, + as NETCF WaitHandle.WaitOne can't use TimeSpan. + + - + An Int32 containing the timeout value in milliseconds. + + + + + Contains helper functionality. + + + + + Specifies that the URI is accessed through the Object Exchange (OBEX) protocol. + + + + + Specifies that the URI is accessed through the Object Exchange (OBEX) Push protocol. + + + + + Specifies that the URI is accessed through the Object Exchange (OBEX) FTP protocol. + + + + + Specifies that the URI is accessed through the Object Exchange (OBEX) Sync protocol. + + + + + Provides an OBEX implementation of the class. + + + + + Gets the stream used to read the body of the response from the server. + + - + A containing the body of the response. + + + + Frees the resources held by the response. + + + + + Writes the contents of the response to the specified file path. + + The filename (including the path) from which to read. + + + + Gets the headers associated with this response from the server. + + + + + Gets the length of the content returned by the request. + + + + + Gets the content type of the response. + + + + + Returns a status code to indicate the outcome of the request. + + - + Note, if a error occurs locally then the status code + is returned. + Therefore that error code could signal local or remote errors. + + + + + + + + + HCI_Version — Assigned Numbers — Host Controller Interface + + + + + Bluetooth Core Specification 1.0b + + + + + Bluetooth Core Specification 1.1 + + + + + Bluetooth Core Specification 1.2 + + + + + Bluetooth Core Specification 2.0 + EDR + + + + + Bluetooth Core Specification 2.1 + EDR + + + + + Bluetooth Core Specification 3.0 + HS + + + + + Bluetooth Core Specification 4.0 + + + + + Unknown version ℄ probably the stack API + does not provide the value. + + + + + LMP VerNr — Assigned Numbers — Link Manager Protocol + + + + + Bluetooth Core Specification 1.0b + + + + + Bluetooth Core Specification 1.1 + + + + + Bluetooth Core Specification 1.2 + + + + + Bluetooth Core Specification 2.0 + EDR + + + + + Bluetooth Core Specification 2.1 + EDR + + + + + Bluetooth Core Specification 3.0 + HS + + + + + Bluetooth Core Specification 4.0 + + + + + Unknown version ℄ probably the stack API + does not provide the value. + + + + + Handles security between bluetooth devices. + + + + + Intiates pairing for a remote device. + + Remote device with which to pair. + Chosen PIN code, must be between 1 and 16 ASCII characters. + On Windows CE platforms this calls BthPairRequest, + its MSDN remarks say: + + “BthPairRequest passes the parameters to the BthSetPIN + function and creates an ACL connection. Once the connection is established, + it calls the BthAuthenticate function to authenticate the device.” + + On Windows XP/Vista platforms this calls BluetoothAuthenticateDevice, + if the pin argument is set to null a Wizard is displayed to accept a PIN from the user, + otherwise the function executes in transparent mode. + + See also + + + + Whether the operation was successful. + + + + Remove the pairing with the specified device + + - + Remote device with which to remove pairing. + - + TRUE if device was successfully removed, else FALSE. + + + + This function stores the personal identification number (PIN) for the Bluetooth device. + + Address of remote device. + Pin, alphanumeric string of between 1 and 16 ASCII characters. + On Windows CE platforms this calls BthSetPIN, + its MSDN remarks say: + + “Stores the pin for the Bluetooth device identified in pba. + The active connection to the device is not necessary, nor is the presence + of the Bluetooth controller. The PIN is persisted in the registry until + BthRevokePIN is called. + + “While the PIN is stored, it is supplied automatically + after the PIN request is issued by the authentication mechanism, so the + user will not be prompted for it. Typically, for UI-based devices, you + would set the PIN for the duration of authentication, and then revoke + it after authentication is complete.” + + See also + + + + True on success, else False. + + + + + This function revokes the personal identification number (PIN) for the Bluetooth device. + + On Windows CE platforms this calls BthRevokePIN, + its MSDN remarks say: + + “When the PIN is revoked, it is removed from registry. + The active connection to the device is not necessary, nor is the presence + of the Bluetooth controller.” + + On Windows CE platforms this removes any pending BluetoothWin32Authentication object but does not remove the PIN for an already authenticated device. + Use RemoveDevice to ensure a pairing is completely removed. + See also + + + + The remote device. + True on success, else False. + + + + + Not supported on Windows XP + + - + The device whose Link Key to retrieve. + The 16-byte Link Key to set. + - + true if the operation was successful; false otherwise. + - + On Windows CE platforms this calls BthSetLinkKey, + its MSDN remarks say: + + “The link key is persisted in registry until BthRevokeLinkKey + is called. + + “Typically, the Bluetooth stack manages link keys automatically, + for example, it stores them when they are created. This function is useful + primarily for backup purposes. + + “While link key is stored, it will be automatically supplied + once the link key request is issued by the authentication mechanism. If + the link key is incorrect, the renegotiation that involves the PIN is + initiated by the Bluetooth adapter, and the PIN code may be requested + from the user. + + “The link key length is 16 bytes. You cannot create link + keys; they are generated by the Bluetooth hardware.” + + + + + + + Retrieves the address of the Bluetooth peer device authentication that requires the PIN code. + Not supported on Windows XP + + On Windows CE platforms this calls BthGetPINRequest, + its MSDN remarks say: + + “There can be multiple requests outstanding. After the event + that is provided by the UI handler is signaled, the UI handler must call + this function multiple times until the call fails.” + + See also + + and + + + of the remote device, or null if there is no outstanding PIN request. + + + + Refuses an outstanding PIN request. + Not supported on Windows XP + + - + Address of the requesting device. + - + true if the operation was successful; false otherwise. + - + On Windows CE platforms this calls BthRefusePINRequest, + its MSDN remarks say: + + “This function refuses an outstanding PIN request that is + retrieved by + function.” + + See also + + and + + + + + + Presumably this is surfaced as a OnConnectionPending + + + + + Specifies additional addressing schemes that an instance of the class can use. + + + + + Bluetooth address. + + 32 + + + + IrDA address used on some Windows CE platforms (Has a different value to AddressFamily.IrDA). + + 22 + + + + Some useful methods for working with a SDP + including creating and accessing the + for an RFCOMM service. + + + + + Reads the RFCOMM Channel Number element from the service record. + + - + The + to search for the element. + + - + The + holding the Channel Number. + or if at the + attribute is missing or contains invalid elements. + + + + + Reads the L2CAP Channel Number element from the service record. + + - + The + to search for the element. + + - + The + holding the Channel Number. + or if at the + attribute is missing or contains invalid elements. + + + + + Reads the RFCOMM Channel Number value from the service record, + or returns -1 if the element is not present. + + - + The + to search for the element. + + - + The Channel Number as an unsigned byte cast to an Int32, + or -1 if at the + attribute is missing or contains invalid elements. + + + + + Reads the L2CAP Channel Number value from the service record, + or returns -1 if the element is not present. + + - + The + to search for the element. + + - + The PSM number as an uint16 cast to an Int32, + or -1 if at the + attribute is missing or contains invalid elements. + + + + + Sets the RFCOMM Channel Number value in the service record. + + - + The + in which to set the RFCOMM Channel number. + + The Channel number to set in the record. + + - + The + + attribute is missing or contains invalid elements. + + + + + Sets the RFCOMM Channel Number value in the service record. + + - + + Note: We use an for the + parameter as its natural type + in not usable in CLS Compliant interfaces. + + + - + The + in which to set the L2CAP PSM value. + + The PSM value to set in the record. + Note that although the parameter is of type + the value must actually be in the range of a , + see the remarks for more information. + + - + The + + attribute is missing or contains invalid elements. + + + The PSM must fit in a 16-bit unsigned integer. + + + + + Creates the data element for the + + attribute in an L2CAP service + + - + The new . + - + Thus is the following structure: + + ElementSequence + ElementSequence + Uuid16 = L2CAP + UInt16 = 0 -- The L2CAP PSM Number. + + + + + + Creates the data element for the + + attribute in an RFCOMM service + + - + The new . + - + Thus is the following structure: + + ElementSequence + ElementSequence + Uuid16 = L2CAP + ElementSequence + Uuid16 = RFCOMM + UInt8 = 0 -- The RFCOMM Channel Number. + + + + + + Creates the data element for the + + attribute in an GOEP (i.e. OBEX) service + + - + The new . + - + Thus is the following structure: + + ElementSequence + ElementSequence + Uuid16 = L2CAP + ElementSequence + Uuid16 = RFCOMM + UInt8 = 0 -- The RFCOMM Channel Number. + ElementSequence + Uuid16 = GOEP + + + + + + Creates the data element for the + + attribute in an L2CAP service, + with upper layer entries. + + - + The new . + - + Thus is the following structure at the first layer: + + ElementSequence + ElementSequence + Uuid16 = L2CAP + UInt16 = 0 -- The L2CAP PSM Number. + + One can add layers above that; remember that all layers are formed + of an ElementSequence. See the example below. + + - + + + var netProtoList = new ServiceElement(ElementType.ElementSequence, + ServiceElement.CreateNumericalServiceElement(ElementType.UInt16, 0x0800), + ServiceElement.CreateNumericalServiceElement(ElementType.UInt16, 0x0806) + ); + var layer1 = new ServiceElement(ElementType.ElementSequence, + new ServiceElement(ElementType.Uuid16, Uuid16_BnepProto), + ServiceElement.CreateNumericalServiceElement(ElementType.UInt16, 0x0100), //v1.0 + netProtoList + ); + ServiceElement element = ServiceRecordHelper.CreateL2CapProtocolDescriptorListWithUpperLayers( + layer1); + + + - + The list of upper layer elements, one per layer. + As an array. + + + + + Creates a Service Record byte array from the given + object. + + + + + + + + Creates a Service Record byte array from the given + object. + + - + + Creates a Service Record byte array from the given + object, + into the specified byte array. + + - + + See the other overload + + - + An instance of + containing the record to be created. + + An array of for the record + to be written to. + + - + + The record bytes are longer that the supplied byte array buffer. + + - + The length of the record in the array of . + + + + + + + + Creates a Service Record byte array from the given + object. + + - + + The only oddity (as with parsing) is with the TextString + type. The can + either hold the string already encoded to its array of bytes or an + . In the latter case we will always simply + encode the string to an array of bytes using encoding + . + + Currently any UUIDs in the record are written out in the form supplied, + we should probably write a ‘short-form’ equivalent if its + a ‘Bluetooth-based’ UUID e.g. Uuid128 as Uuid16. + + + - + An instance of + containing the record to be created. + + - + An array of containing the resultant + record bytes. The length of the array is the length of the record bytes. + + + + + + + + Create the element in the buffer starting at offset, and return its totalLength. + + The element to create. + + The byte array to write the encoded element to. + + The place to start writing in . + + + The total length of the encoded element written to the buffer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Provides access to the Bluetooth events from the Microsoft stack on + desktop Windows. + + - + + Supported only by the Microsoft stack on desktop Windows. + + The Microsoft Bluetooth stack on Window raises events for various + Bluetooth actions. We expose that feature via this class. + + Currently it raises two types of event: in-range and out-of-range + using classes: + and . + Both have properties Device which return a BluetoothDeviceInfo. + Then the in-range event also includes a set of flags, which in + Windows XP are: Address, Cod, Name, Paired, Personal, and Connected; + more events are available in Windows 7. These events are provided on + the + class via properties: + + and , + and also etc. + + To see the events get an instance of this class via its method + . + Then one should register for the events on that instance and keep a + reference to it. + + Note that just being in range is not enough for + devices to know that the other is present. Without running device + discovery or a connection attempt the two devices will not see each + other. Note however that Windows XP also does not raise events when + running device discovery (inquiry), this is fixed in Windows 7 + (probably Vista). See + 32feet blog: Device Discovery improvements on MSFT+Win32 + for more information. + + + For example when connecting and disconnecting on Windows XP to + another device that is not paired we see: + + + + 12:23:48.9582648: InRange 000A3A6865BB 'joe', + now 'Address, Cod, Name, Connected' + was 'Address, Cod, Name'. + 12:24:16.8009456: InRange 000A3A6865BB 'joe', + now 'Address, Cod, Name' + was 'Address, Cod, Name, Connected'.}} + + + For example when connecting and then disconnecting on Windows 7 + to another v2.1 device that is paired with we see: + + + + 20:53:25.5605469: InRange 00190E02C916 'alanlt2ws', + now 'Address, Cod, Name, Paired, Personal, Connected, SspSupported, SspPaired, Rssi, Eir' + was 'Address, Cod, Name, Paired, Personal, SspSupported, SspPaired, Rssi, Eir'. + 20:53:27.7949219: InRange 00190E02C916 'fred', + now 'Address, Cod, Name, Paired, Personal, SspSupported, SspPaired, Rssi, Eir' + was 'Address, Cod, Name, Paired, Personal, Connected, SspSupported, SspPaired, Rssi, Eir'.}} + + + + + + + Initialise an instance of the class. + + - + + Consider using the method + instead of calling this constructor. + + + + + + Initialise an instance of the class for the specified radio. + + - + + The radio to listen for events from. + Must be non-null and a MSFT+Win32 stack radio. + + - + Note that since the Microsoft stack supports only one radio + (controller) there is lilely no benefit in calling this constructor + as opposed to the other constructor or method + . + + + + + Gets a possible shared instance of this class. + + - + + If more that one piece of code is using this class then there + is no need for each to have a private instance. This method allows + them to access a shared instance. When first called it creates a + new instance and keeps a weak-reference to it. Subsequent callers + will then get the same instance. The instance is kept alive only + as long as at least one caller keeps a reference to it. If no + references are kept then the instance will be deleted and a new + instance will be created when this method is next called. + + + - + An instance of this class. + + + + + Raises the event. + + - + A + that contains the event data. + + + + + Raises the event. + + - + A + that contains the event data. + + + + + Releases the resources used by the instance. + + + + + Releases the unmanaged resources used by the instance + and optionally releases the managed resources. + + + + + “This message is sent when any of the following attributes + of a remote Bluetooth device has changed: the device has been + discovered, the class of device, name, connected state, or device + remembered state. This message is also sent when these attributes + are set or cleared.” + + + + + “This message is sent when a previously discovered device + has not been found after the completion of the last inquiry.” + + + + + “” + + + + + “This message is sent when any of the following attributes of a remote Bluetooth device has changed: + the device has been discovered, the class of device, name, connected state, or device remembered state. + This message is also sent when these attributes are set or cleared.” + + + + + “This message is sent when a previously discovered device has not been found after the completion of the last inquiry. + This message will not be sent for remembered devices. + The BTH_ADDRESS structure is the address of the device that was not found.” + + + + + “This message should be ignored by the application. + If the application must receive PIN requests, the BluetoothRegisterForAuthentication function should be used.” + + + + + “This message is sent when an L2CAP channel between the local radio and a remote Bluetooth device has been established or terminated. + For L2CAP channels that are multiplexers, such as RFCOMM, this message is only sent when the underlying channel is established, + not when each multiplexed channel, such as an RFCOMM channel, is established or terminated.” + + + + + “This message is sent when a remote Bluetooth device connects or disconnects at the ACL level.” + + + + + Buffer associated with GUID_BLUETOOTH_L2CAP_EVENT + + + + + Remote radio address which the L2CAP event is associated with + + + + + The PSM that is either being connected to or disconnected from + + + + + If != 0, then the channel has just been established. If == 0, then the + channel has been destroyed. Notifications for a destroyed channel will + only be sent for channels successfully established. + + + + + If != 0, then the local host iniated the l2cap connection. If == 0, then + the remote host initated the connection. This field is only valid if + connect is != 0. + + + + + Buffer associated with GUID_BLUETOOTH_HCI_EVENT + + + + + Remote radio address which the HCI event is associated with + + + + + HCI_CONNNECTION_TYPE_XXX value + + + + + If != 0, then the underlying connection to the remote radio has just + been estrablished. If == 0, then the underlying conneciton has just been + destroyed. + + + + + A request to change the current configuration (dock or undock) has been canceled. + + + + + The current configuration has changed, due to a dock or undock. + + + + + A custom event has occurred. + + Windows NT 4.0 and Windows 95:  This value is not supported. + + + + A device or piece of media has been inserted and is now available. + + + + + Permission is requested to remove a device or piece of media. Any application can deny this request and cancel the removal. + + + + + A request to remove a device or piece of media has been canceled. + + + + + A device or piece of media has been removed. + + + + + A device or piece of media is about to be removed. Cannot be denied. + + + + + A device-specific event has occurred. + + + + + A device has been added to or removed from the system. + + Windows NT 4.0 and Windows Me/98/95:  This value is not supported. + + + + Permission is requested to change the current configuration (dock or undock). + + + + + The meaning of this message is user-defined. + + + + + oem-defined device type + + + + + devnode number + /// + + + + + + + + + l + + + + + network resource + + + + + device interface class + + + + + file system handle + + + + + The BLUETOOTH_AUTHENTICATION_CALLBACK_PARAMS structure contains specific configuration information about the Bluetooth device responding to an authentication request. + + + + + A BLUETOOTH_DEVICE_INFO structure that contains information about a Bluetooth device. + + + + + A BLUETOOTH_AUTHENTICATION_METHOD enumeration that defines the authentication method utilized by the Bluetooth device. + + + + + A BLUETOOTH_IO_CAPABILITY enumeration that defines the input/output capabilities of the Bluetooth device. + + + + + A AUTHENTICATION_REQUIREMENTS specifies the 'Man in the Middle' protection required for authentication. + + + + + A ULONG value used for Numeric Comparison authentication. + or + A ULONG value used as the passkey used for authentication. + + + + + The BLUETOOTH_PIN_INFO structure contains information used for authentication via PIN. + + + + + The BLUETOOTH_OOB_DATA_INFO structure contains data used to authenticate prior to establishing an Out-of-Band device pairing. + + + + + The BLUETOOTH_IO_CAPABILITY enumeration defines the input/output capabilities of a Bluetooth Device. + + + + + The Bluetooth device is capable of output via display only. + + + + + The Bluetooth device is capable of output via a display, + and has the additional capability to presenting a yes/no question to the user. + + + + + The Bluetooth device is capable of input via keyboard. + + + + + The Bluetooth device is not capable of input/output. + + + + + The input/output capabilities for the Bluetooth device are undefined. + + + + + Specifies properties of a remote Bluetooth Device. + + - + - + + Supported only by the Microsoft stack on desktop Windows. + + Originally from Win32 "bthdef.h" and used by struct + BTH_DEVICE_INFO.flags. The flags are named BDIF_**. + + + + + + The address member contains valid data. + + + + + The classOfDevice member contains valid data. + + + + + The name member contains valid data. + + + + + The device is a remembered and authenticated device. + The BDIF_PERSONAL flag is always set when this flag is set. + + + + + The device is a remembered device. If this flag is set and + the BDIF_PAIRED flag is not set, the device is not authenticated. + + + + + The remote Bluetooth device is currently connected to the local radio. + + + + + + + + + + Bluetooth Basic Rate — i.e. traditional Bluetooth + + + + + Bluetooth Low Energy + + + + + Get the number of records that the buffer contains. + + - + An integer containing the number of records that the buffer contains, + may be zero. + + - + The buffer has + not yet been filled with a CSdpDiscoveryRec list. + + - + + In SdpSearchScope.ServiceClassOnly + this returns the actual number of records as the filtering is done by + the stack. In SdpSearchScope.Anywhere + this returns the pre-filtered number of records. We do the filtering + so this will likely be greater that the matching number of records. + + + + + + Get the number of records that the buffer contains. + + - + An integer containing the number of records that the buffer contains, + may be zero. + + - + The buffer has + not yet been filled with a CSdpDiscoveryRec list. + + - + + In SdpSearchScope.ServiceClassOnly + this returns the actual number of records as the filtering is done by + the stack. In SdpSearchScope.Anywhere + this returns the pre-filtered number of records. We do the filtering + so this will likely be greater that the matching number of records. + + + + + + To get to HandleDeviceResponded, HandleInquiryCompleted etc + + + + + “This function requests a service discovery for a specific device.” + + - + + “When the discovery is complete the derived function OnDiscoveryComplete() is called.” + + + - + + + “TRUE, if discovery has started; FALSE, if discovery has not started.” + + + + “When multiple discovery operations are in progress, the application + must call GetLastDiscoveryResult() from within the OnDiscoveryComplete() + to determine which remote devices reported services.” + + + + “DISCOVERY_RESULT_SUCCESS, if the discovery operation was successful.” + + + + “This function is called when discovery is complete to retrieve the records + received from the remote device.” + + - + + “Discovery results for a device are not removed until the device fails to respond to an inquiry.” + + + - + + + + The discovery records read, which may have recordCount equals zero. + + + + Provides information about an available device obtained by the client during device discovery. + + + + + + + + Initializes an instance of the class. + + - + + Initializes an instance of the class with the given native structure. + + + + + Initializes an instance of the class + for the device with the given address. + + + + + Forces the system to refresh the device information. + + - + + See + for one reason why this method is necessary. + + + + + Updates the device name used to display the device, affects the local computer cache. + + On Windows CE this only affects devices which are already paired. + + + + Enables or disables services for a Bluetooth device. + + The service GUID on the remote device. + Service state - TRUE to enable the service, FALSE to disable it. + + When called on Windows CE, the device will require a soft-reset to enabled the settings. + + + The system maintains a mapping of service guids to supported drivers for + Bluetooth-enabled devices. Enabling a service installs the corresponding + device driver. Disabling a service removes the corresponding device driver. + If a non-supported service is enabled, a driver will not be installed. + + + This overload is silent on error; the other overload raises an exception + if required + (). + + + - + + Thrown if this method is called on Windows CE platforms. + + + + Enables or disables services for a Bluetooth device. + + The service GUID on the remote device. + Service state - TRUE to enable the service, FALSE to disable it. + Whether the method should raise an exception + when + + + When called on Windows CE, the device will require a soft-reset to enabled the settings. + + The system maintains a mapping of service guids to supported drivers for + Bluetooth-enabled devices. Enabling a service installs the corresponding + device driver. Disabling a service removes the corresponding device driver. + If a non-supported service is enabled, a driver will not be installed. + + + + - + The call failed. + + + + + Run an SDP query on the device’s Service Discovery Database. + + - + + + For instance to see whether the device has an an Serial Port services + search for UUID , + or too find all the services that use RFCOMM use + , + or all the services use + . + + + If the device isn’t accessible a + with + 10108 (0x277C) occurs. + + + - + The UUID to search for, as a . + + - + The parsed record as an + . + + - + + + Dim bdi As BluetoothDeviceInfo = ... + Dim records As ServiceRecord() = bdi.GetServiceRecords(BluetoothService.RFCommProtocol) + ' Dump each to console + For Each curRecord As ServiceRecord In records + ServiceRecordUtilities.Dump(Console.Out, curRecord) + Next + + + + - + + The query failed. + + + + + Run an SDP query on the device’s Service Discovery Database, + returning the raw byte rather than a parsed record. + + - + + If the device isn’t accessible a + with + 10108 (0x277C) occurs. + + - + The UUID to search for, as a . + + - + An array of array of . + - + + The query failed. + + + + + Returns the raw results from the native call(s); the format is different + on Win32 versus WinCE. + + + On CE this is thus a single item which is a ElementSequence of records. + On Win32 it is an array with each item being a record. + + + + + Displays information about the device. + + + + + Gets the device identifier. + + + + + Gets a name of a device. + + - + + Note, that due the way in which Bluetooth device discovery works, + the existence and address of a device is known first, but a separate + query has to be carried out to find whether the device also has a name. + This means that if a device is discovered afresh then this property might + return only a text version of the device’s address and not its + name, one can also see this in the Windows’ Bluetooth device dialogs + where the device appears first with its address and the name is later + updated. To see the name, wait for some time and access this property again + having called + in the meantime. + + + + + + Returns the Class of Device of the remote device. + + - + + + Some CE 4.2 devices such as original PPC2003 devices don't have the native + API on which this property depends — it was added as part of a hotfix. + The property will always return zero in such a case. On WM/CE we also + attempt to get the CoD value as part of the discovery process; this is + of course only works for devices in-range. + + + + + + Returns the signal strength for the Bluetooth connection with the peer device. + Requires Windows Mobile 5.0 or Windows Embedded CE 6.0 + + - + Valid values for this property are -128 to 128. It returns + Int32.MinValue on failure. + + - + + This method requires an open connection to the peer device. + If there is no active connection, then it will attempt to create one. + + Requires Windows Mobile 5.0 or Windows Embedded CE 6.0 + As well as the ‘no connection’ issue, the native method + on which the property depends is only present in later OS versions, so it + will fail on earlier devices. + + + + + + Returns a list of services which are already installed for use on the calling machine. + + + This property returns the services already configured for use. + Those are the ones that are checked in the “Services” tab + of the device’s property sheet in the Bluetooth Control panel. + I presume the behaviour is similar on CE. + + Will only return available services for paired devices. + + It of course will also only returns standard system services which Windows understands. + (On desktop Windows this method calls the OS function BluetoothEnumerateInstalledServices). + + To see all the services that a device advertises use the + + method. + + + + + + Specifies whether the device is connected. + + Not supported under Windows CE and will always return false. + + + + + + Specifies whether the device is a remembered device. Not all remembered devices are authenticated. + + - + Now supported under Windows CE — will return the same as + . + + + + + + + Specifies whether the device is authenticated, paired, or bonded. All authenticated devices are remembered. + + Is now supported on both CE and XP. + + + + + + + + + + + + + + + - + + Sub-class must call various methods at the following events: + + open + + or on failure + + close + + + data arrival + + + flow control off + + + + + + + + + Fails if state is not Connected. + + + + + Fails if state is not Connected or PeerDidClose. + + + + + + + + + + + + Disposing + + + + Called from CloseInternal and Dispose; + RemovePortRecords is called before from both places. + Dispose then calls DoOtherPreDestroy and DoPortDestroy in that order. + + Disposing + + + + + + Disposing + + + + Called before DoOpenClient. + For instance is empty on BTPS, on Widcomm it calls SetScnForPeerServer and SetSecurityLevelClient. + + Endpoint + Channel number + + + + Starts the connect process. The async completion should call + either or . + + scn + addr + + + + Call when connection is successfully made. + + Used for logging etc. Pass a string + containing the name of the stack's event/status that occurred. + + + + + Get the remote address. + + - + On return contains the address to which we are connected. + + - + if connected, but we ignore the result. + + + + + Call when connection is un-successfully made (fails), + and also when the connection closes. + + Used for logging etc. Pass a string + containing the name of the stack's event/status that occurred. + + The socket error code for this failure + -- known. + Pass for instance a value from + as an ; + or respectively. + + + + + Used: 1. when we get CONNECT_ERR from the stack, and POSSIBLY 2. when we close the + stream to do consumer timeout (SO_RCVTIMEO/etc). + + Out: to call + on. + Out: to call + on. + + + + Close the connection from the network/stack side (not from the consumer side). + + - + + When we call Close the object is disposed and outstanding and + new operations fail with ObjectDisposedException. This method + instead closes the connection from the network/stack side and thus + operations fail with an IO error etc. + + + + + + DEPRECATED, should return false. + + Whether Bonding was attempted and thus the connect should be retried. + + + + + Used by Client, note from MSDN Socket.Connected: + "Gets a value that indicates whether a Socket is connected to a remote host as of the last Send or Receive operation." + + - + + From MSDN : + "Gets a value that indicates whether a Socket is connected to a remote host as of the last Send or Receive operation." + From MSDN : + "true if the Client socket was connected to a remote resource as of the most recent operation; otherwise, false." + + + + + + Represents a network endpoint as a Bluetooth address and + a Service Class Id and/or a port number. + + - + + The BluetoothEndPoint class contains the host, service class id and port + information needed by an application to connect to a service on a host. + By combining the host's Bluetooth address and class id or port number, + the BluetoothEndPoint class forms a connection point to a service. + + When used for instance when connecting with , + if the port is specified then the connection is made to that port, + otherwise a SDP lookup is done for a record with the class specified in + the property. + + + + + + Specifies the minimum value that can be assigned to the Port property. + + + + + Specifies the maximum value that can be assigned to the Port property. + + + + + The minimum valid Server Channel Number, 1. + + + + Bluetooth's rfcomm.pdf: Part F:1 -- RFCOMM with TS 07.10 -- Serial Port Emulation + + + Section 5.4: + + + “The RFCOMM server channel number is a [five-bit field]. + Server applications registering with an RFCOMM service interface are assigned a + Server Channel number in the range 1…30. [0 and 31 should not be used since + the corresponding DLCIs are reserved in TS 07.10]” + + + + + + The maximum valid Server Channel Number, 30. + + + + + + + Initializes a new instance of the class with the specified address and service. + + The Bluetooth address of the device. A six byte array. + The Bluetooth service to use. + + + + Initializes a new instance of the class with the specified address, service and port number. + + The Bluetooth address of the device. A six byte array. + The Bluetooth service to use. + Radio channel to use, -1 for any. + - + + See the documentation for + how the combination of Service and Port are used when connecting with + BluetoothClient. + + + + + + Serializes endpoint information into a instance. + + A instance containing the socket address for the endpoint. + + + + Creates an endpoint from a socket address. + + The to use for the endpoint. + An instance using the specified socket address. + + + + Compares two instances for equality. + + - + The + to compare with the current instance. + + - + true if + is a and equal to the current instance; + otherwise, false. + + + + + Returns the hash code for this instance. + + A hash code for the current object. + + + + Returns the string representation of the BluetoothEndPoint. + + + + We try to follow existing examples where possible; JSR-82 and similar + use a URI of the form: + bluetooth://xxxxxxxxxxxx:xx + or: + bluetooth://xxxxxxxxxxxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + or in some serialport only situations: + btspp:// + So we follow that pattern here, but of course without the URI prefix. + If the form with the URI is required then the prefix can simply be appended. + + If the port is non default then we use that, otherwise just the full guid. + + Some examples are: + To the ObexObjectPush service: + "04E2030405F6:0000110500001000800000805f9b34fb" + To the SerialPort service: + "04E2030405F6:0000110100001000800000805f9b34fb" + With an Empty service GUID: + "04E2030405F6:00000000000000000000000000000000" + With port 9: + "04E2030405F6:9" + + The string representation of the BluetoothEndPoint. + + + + Creates a copy of the . + + Creates a copy including of the internal + + A copy of the . + + + + + Gets the address family of the Bluetooth address. + + + + + Gets or sets the Bluetooth address of the endpoint. + + + + + + Gets or sets the Bluetooth service to use for the connection. + + + + + + Gets or sets the service channel number of the endpoint. + + + + + Gets whether a is set. + + + + + Represents the type of the element in the SDP record binary format, + and is stored as the higher 5 bits of the header byte. + + + There is an identifier for each major type: String vs UUID vs unsigned integer. + There are various sizes of UUID and integer type for instance, the resultant + types are listed in enum . + + + + + Represents the size of the SDP element in the record binary format, + and is stored as the lower 3 bits of the header byte. + + + + + + + Represents the types that an SDP element can hold. + + + + (Is a logical combination of the + field which defines the major type and the size field in the binary format; and + the size field being made up of the + field and any additional length bytes. + + Note, the values here are not the numerical bitwise combination of the + and + fields as they appear + in the encoded protocol. It was simpler to assign arbitrary values here as + firstly we wanted zero to be the 'Unknown' value, which conflicts with Nil's + bitwise value; but also because the TextString, sequence and Url types can + have various SizeIndex values and thus they wouldn’t be easily + representable by one value here). + + + + + + Provides client connections for Bluetooth network services with Widcomm stack. + + + + + + + + + + + Convert the user Inquiry parameters to the formats used by HCI. + + The maxDevices parameter from e.g. + . + + The property + . + + On return contains the Num_Responses value to be passed to the HCI Inquiry command. + If greater that 255 or less than zero, the value 0 will be returned. + HCI uses zero as "Unlimited". + + On return contains the Inquiry_Length value to be passed to the HCI Inquiry command. + Is scaled by the divisor 1.28secs + and if not in range 1 to 0x30 inclusive is set to 10. + + + + + When overidden, initiates + lookup the SDP record with the give Service Class Id + to find the RFCOMM port number (SCN) that the server is listening on. + The process returns a list of port numbers. + + The remote device. + + The Service Class Id. + + callback + state + IAsyncResult + + + + When overidden, + completes the SDP Record to port number lookup process + + - + IAsyncResult from . + + - + + There must be at least one entry in the result list for each + Service Record found for the specified Service Class Id. This + allows us to know if no records were found, or that records were + found but none of them were for RFCOMM. + If a particular record does not have a RFCOMM port then -1 (negative + one should be added to the list for it). + + The process may throw an exception if an error occurs, e.g. + the remote device did not respond. + + + - + A + with at least one entry for each Service Record + found for the specified Service Class Id, the item being -1 if the + record has no port. is . + + + + + Used by WidcommBluetoothListener to return the newly accepted connection. + + - + The WidcommRfcommStream containing the newly connected + RfCommPort. + + Factory to use in GetRemoteMachineName etc. + + + + + ... Allow the tests to disable the Registry lookup. + + + + + + + + PRE-RELEASE + Get the instance of the given factory type -- if it exists. + + - + The factory type e.g. + + or + etc. + + - + The instance of the given type or null. + + + + + PRE-RELEASE + Get the instance of the given factory type -- if it exists. + + - + The factory type e.g. + + or + etc. + + - + The instance of the given type or null. + + + + + Provides a form to select an available Bluetooth device. + + + + + Initializes an instance of the class. + + + + + Resets the properties of the to their default values. + + + + + + + + + + + Specifies a common dialog box. + + A value that represents the window handle of the owner window for the common dialog box. + true if the dialog box was successfully run; otherwise, false. + + + + + + + If TRUE, invokes the Add New Device Wizard. + + Supported only on Windows XP/Vista with Microsoft stack. + + + + If TRUE, skips the Services page in the Add New Device Wizard. + + Supported only on Windows XP/Vista with Microsoft stack. + + + + Gets or sets the information text. + + + + + + Array of class of devices to find. + + Clear the collection to return all devices. + + + + Gets the selected Bluetooth device. + + + + + If TRUE, authenticated devices are shown in the picker. + + + + + If TRUE, remembered devices are shown in the picker. + + + + + If TRUE, unknown devices are shown in the picker. + + + + + If TRUE, forces authentication before returning. + + + + + + If TRUE, only devices which are currently discoverable are shown in the picker. + + + Does not work on the Microsoft stack on desktop Windows. + There, when true the dialog will not open and will return an error to the caller. + + + + + + Obsolete, use + instead. + If TRUE, only devices which are currently discoverable are shown in the picker. + + + Obsolete, use + instead. + + + + + + + Set a function that will be called for each device + that returns whether to include the device in the list or not. + + - + The function to call for each device. + The function should returns true if the device is to be included or false if not. + Pass null to the property to clear the filter function. + + - + + The callback method is called for each device as it is + being added to the dialog box. If the function returns false it + won't be added, otherwise it will be added and displayed. The + information about each device is provided as a + instance which will contain all the information about the device + that the discovery process knows and will also include any + information from the remembered/authenticated/paired devices. + Note that prior to Bluetooth v2.1 a separate query has to be + carried out to find whether the device also has a name, so unless + both devices are v2.1 or later then it's likely that the + name won't be included in the first discovery. + + + + - + + '...... + Dim dlg As New InTheHand.Windows.Forms.SelectBluetoothDeviceDialog() + dlg.DeviceFilter = AddressOf FilterDevice + Dim rslt As DialogResult = dlg.ShowDialog() + '...... + + Shared Function FilterDevice(ByVal dev As BluetoothDeviceInfo) As Boolean + Dim rslt As DialogResult = MessageBox.Show("Include this device " & dev.DeviceAddress.ToString & " " & dev.DeviceName, "FilterDevice", MessageBoxButtons.YesNo) + Dim ret As Boolean = (DialogResult.Yes = rslt) + Return ret + End Function + + + + + Represents a Bluetooth device address. + + The BluetoothAddress class contains the address of a bluetooth device. + + + + + + + + + + + + + + Limited Inquiry Access Code. + + + + + General Inquire Access Code. + The default inquiry code which is used to discover all devices in range. + + + + + Initializes a new instance of the class with the specified address. + + representation of the address. + + + + Initializes a new instance of the class with the specified address. + + - + + Note: The address should be supplied in little-endian order on the + current Windows platform (which is little-endian). + For forward compatibility it would be safer to use the + method, + which will be correct for all platforms. + Or consider + + or + . + + + + - + Address as 6 byte array. + address passed was . + address passed was not a 6 byte array. + + + + Create a from an Array of + where the array is in standard order. + + - + + Different protocol stacks have different ways of storing a + Bluetooth Address. Some use an array of bytes e.g. "byte[6]", + which means that the first byte of the address comes first in + memory (which we’ll call big-endian format). Others + e.g. the Microsoft stack use a long integer (e.g. uint64) which + means that the *last* byte of the address come comes first in + memory (which we’ll call little-endian format) + + This method creates an address for the first form. + See for the second form. + + + - + An Array of + with the Bluetooth Address ordered as described above. + + - + The resultant . + + - + + + + + Create a from an Array of + where the array is in reverse order. + + - + + Different protocol stacks have different ways of storing a + Bluetooth Address. Some use an array of bytes e.g. "byte[6]", + which means that the first byte of the address comes first in + memory (which we’ll call big-endian format). Others + e.g. the Microsoft stack use a long integer (e.g. uint64) which + means that the *last* byte of the address come comes first in + memory (which we’ll call little-endian format) + + This method creates an address for the second form. + See for the first form. + + + - + An Array of + with the Bluetooth Address ordered as described above. + + - + The resultant . + + - + + + + + Converts the string representation of an address to it's equivalent. + A return value indicates whether the operation succeeded. + + A string containing an address to convert. + When this method returns, contains the equivalent to the address contained in s, if the conversion succeeded, or null (Nothing in Visual Basic) if the conversion failed. + The conversion fails if the s parameter is null or is not of the correct format. + true if s is a valid Bluetooth address; otherwise, false. + + + + Converts the string representation of a Bluetooth address to a new instance. + + A string containing an address to convert. + New instance. + Address must be specified in hex format optionally separated by the colon or period character e.g. 000000000000, 00:00:00:00:00:00 or 00.00.00.00.00.00. + bluetoothString is null. + bluetoothString is not a valid Bluetooth address. + + + + Returns the value as a byte array. + + - + In previous versions this returned the internal array, it now + returns a copy. Addresses should be immutable, particularly for the + None const! + + - + An array of byte + + + + Returns the value as a byte array, + where the array is in reverse order. + + - + + See for discussion of + different stack#x2019;s storage formats for Bluetooth Addresses. + + In previous versions this returned the internal array, it now + returns a copy. Addresses should be immutable, particularly for the + None const! + + + - + An array of byte of length six representing the Bluetooth address. + + + + Returns the value as a byte array, + where the array is in standard order. + + - + + See for discussion of + different stack#x2019;s storage formats for Bluetooth Addresses. + + In previous versions this returned the internal array, it now + returns a copy. Addresses should be immutable, particularly for the + None const! + + + - + An array of byte of length six representing the Bluetooth address. + + + + Returns the Bluetooth address as a long integer. + + - + An . + + + + Compares two instances for equality. + + - + The + to compare with the current instance. + + - + true if + is a and equal to the current instance; + otherwise, false. + + + + + Returns the hash code for this instance. + + A hash code for the current object. + + + + Returns an indication whether the values of two specified objects are equal.New in v1.5 + + - + A or . + A or . + - + true if the values of the two instance are equal; + otherwise, false. + + + + + Returns an indication whether the values of two specified objects are not equal. + + - + A or . + A or . + - + true if the value of the two instance is different; + otherwise, false. + + + + + Converts the address to its equivalent string representation. + + The string representation of this instance. + The default return format is without a separator character + - use the + overload for more formatting options. + + + + Returns a representation of the value of this instance, according to the provided format specifier. + + A single format specifier that indicates how to format the value of this address. + The format parameter can be "N", "C", or "P". + If format is null or the empty string (""), "N" is used. + A representation of the value of this . + + SpecifierFormat of Return Value + N12 digits: XXXXXXXXXXXX + C12 digits separated by colons: XX:XX:XX:XX:XX:XX + P12 digits separated by periods: XX.XX.XX.XX.XX.XX + + + + + Provides a null Bluetooth address. + + + + + Returns a representation of the value of this + instance, according to the provided format specifier. + + - + A single format specifier that indicates how to format the value of this Address. + See + for the possible format strings and their output. + + Ignored. + + - + A representation of the value of this + . + + - + See + for the possible format strings and their output. + + + + + Creates a copy of the . + + Creates a copy including of the internal byte array. + + A copy of the . + + + + + Significant address part. + + + + + Non-significant address part. + + + + + Represents a Bluetooth Radio device. + + Allows you to query properties of the radio hardware and set the mode. + + + + Gets an array of all Bluetooth radios on the system. + + Under Windows CE this will only ever return a single device. + If the device has a third-party stack this property will return an empty collection + + + + Gets the primary . + + For Windows CE based devices this is the only , for Windows XP this is the first available device. + If the device has a third-party stack this property will return null + + + + Gets a value that indicates whether the 32feet.NET library can be used with the current device. + + + + + Gets a class factory for creating client and listener instances on a particular stack. + + + + + Gets whether the radio is on a Bluetooth stack on a remote machine. + + - + Is if the radio is on to the local + machine, otherwise it’s the name of the remote machine to which the + radio is attached. + + + + + Gets the handle for this radio. + + Relevant only on Windows XP. + + + + Returns the current status of the Bluetooth radio hardware. + + A member of the enumeration. + + + + Gets or Sets the current mode of operation of the Bluetooth radio. + + + Microsoft CE/WM + This setting will be persisted when the device is reset. + An Icon will be displayed in the tray on the Home screen and a ?Windows Mobile device will emit a flashing blue LED when Bluetooth is enabled. + + Widcomm Win32 + Is supported. + + + Widcomm CE/WM + Get and Set both supported. + + + ModeGetSet + + PowerOffDisabled or non-connectable + CONNECT_ALLOW_NONE + + ConnectableConnectable + CONNECT_ALLOW_ALL, note not CONNECT_ALLOW_PAIRED. + + DiscoverableDiscoverable + Plus also discoverable. + + + Note also that when the Widcomm stack is disabled/off + we report PowerOff (not in 2.4 and earlier), but + we can't turn put it in that mode from the library. + Neither can we turn it back on, except that + it happens when the application first uses Bluetooth! + + + Widcomm Win32 + Set is not supported. There's no Widcomm API support. + + + + + + + Get the address of the local Bluetooth radio device. + + - + The property can return a value in + some cases. For instance on CE when the radio is powered-off the value + will be null. + + - + The address of the local Bluetooth radio device. + + + + + Returns the friendly name of the local Bluetooth radio. + + - + + Devices normally cache the remote device name, only reading it the first + time the remote device is discovered. It is generally not useful then to change + the name to provide a status update. For instance on desktop Windows + with the Microsoft stack we haven't found a good way for the name to be + flushed so that it is re-read, even deleting the device didn't flush the + name if I remember correctly. + + Currently read-only on Widcomm stack. Probably could be supported, + let us know if you need this function. + + + + + + Returns the Class of Device. + + + + + Returns the manufacturer of the device. + + + See for more information. + + + + + Bluetooth Version supported by the Host Controller Interface implementation. + + - + + There are five fields returned by the Read Local Version Information + HCI command: HCI Version, HCI Revision, LMP Version, + Manufacturer_Name, and LMP Subversion. + We expose all five, but not all platforms provide access to them all. + The Microsoft stack on desktop Windows exposes all five, + except for Windows XP which only exposes the Manufacturer + and LmpSubversion values. Bluetopia apparently exposes none of them. + The Microsoft stack on Windows Mobile, Widcomm on both platforms, + BlueSoleil, and BlueZ expose all five. + + + + + + Manufacture's Revision number of the HCI implementation. + + + See for more information. + + + + + Bluetooth Version supported by the Link Manager Protocol implementation. + + + See for more information. + + + + + Manufacture's Revision number of the LMP implementation. + + + See for more information. + + + + + Returns the manufacturer of the Bluetooth software stack running locally. + + + + + + + + Provides a simple, programmatically controlled OBEX protocol listener. + + + + + Initializes a new instance of the ObexListener class. + + - + + Initializes a new instance of the ObexListener class using the Bluetooth transport. + + + + + Initializes a new instance of the ObexListener class specifiying the transport to use. + + - + Specifies the transport protocol to use. + + + + + Allows this instance to receive incoming requests. + + + + + Causes this instance to stop receiving incoming requests. + + + + + Shuts down the ObexListener. + + + + + Waits for an incoming request and returns when one is received. + + - + + This method blocks waiting for a new connection. It will + return when a new connection completes or + / + has been called. + + + - + Returns a + or if + / + has been called. + + + + + Get or set whether the transport connection (e.g. Bluetooth) will + require Authentication. + + - + + Only Bluetooth supports this, TCP/IP and IrDA do not. + On Bluetooth this uses BluetoothListener.Authenticate. + + + + + + Get or set whether the transport connection (e.g. Bluetooth) will + require Encryption. + + - + + Only Bluetooth supports this, TCP/IP and IrDA do not. + On Bluetooth this uses BluetoothListener.Encrypt. + + + + + + Gets a value that indicates whether the has been started. + + + + + Get the results of the operation from the specified function + and set the operation as completed, + or if getting the results fails then set the corresponding error + completion. + + - + + The pattern that comes to mind when calling + is + the incorrect: + try { + var result = SomeStatementsAndFunctionCallsToGetTheResult(...); + ar.SetAsCompleted(result, false); + } catch (Exception ex) { + ar.SetAsCompleted(ex, false); + } + + That is wrong because if the user callback fails with an exception + then we'll catch it and try to call SetAsCompleted a second time! + + We need to instead call SetAsCompleted outside of the try + block. This method provides that pattern. + + + - + A delegate containing the function + to call to get the result. + It should throw an exception in error cases. + + + + + + Manufacturer codes. + + Defined in Bluetooth Specifications . + + + + Provides data for the + event. + + + + + Initialise a new instance. + + - + The result, may be empty but not null. + + Any user state object. + + + + + Initialise a new instance. + + - + The resultant error. + + Any user state object. + + + + + Gets the list of discovered Bluetooth devices. + + + + + Provides simple access to asynchronous methods on Bluetooth features, for + instance to background device discovery. + + - + + + Public Sub DiscoDevicesAsync() + Dim bco As New BluetoothComponent() + AddHandler bco.DiscoverDevicesProgress, AddressOf HandleDiscoDevicesProgress + AddHandler bco.DiscoverDevicesComplete, AddressOf HandleDiscoDevicesComplete + bco.DiscoverDevicesAsync(255, True, True, True, False, 99) + End Sub + + Private Sub HandleDiscoDevicesProgress(ByVal sender As Object, ByVal e As DiscoverDevicesEventArgs) + Console.WriteLine("DiscoDevicesAsync Progress found {0} devices.", e.Devices.Length) + End Sub + + Private Sub HandleDiscoDevicesComplete(ByVal sender As Object, ByVal e As DiscoverDevicesEventArgs) + Debug.Assert(CInt(e.UserState) = 99) + If e.Cancelled Then + Console.WriteLine("DiscoDevicesAsync cancelled.") + ElseIf e.Error IsNot Nothing Then + Console.WriteLine("DiscoDevicesAsync error: {0}.", e.Error.Message) + Else + Console.WriteLine("DiscoDevicesAsync complete found {0} devices.", e.Devices.Length) + End If + End Sub + + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + - + A + instance to use to run discovery on. Must be non-null. + + + + + Optionally disposes of the managed resources used by the + class. + + true to release both managed and unmanaged + resources; false to release only unmanaged resources. + + + + + Raises the event. + + A + object that contains event data. + + + + + Raises the event. + + A + object that contains event data. + + + + + Discovers accessible Bluetooth devices and returns their names and addresses. + This method does not block the calling thread. + + - + + See + for more information. + + The devices are presented in the + and events. + + + - + The maximum number of devices to get information about. + + True to return previously authenticated/paired devices. + + True to return remembered devices. + + True to return previously unknown devices. + + True to return only the devices that + are in range, and in discoverable mode. See the remarks section. + + A user-defined object that is passed to the method + invoked when the asynchronous operation completes. + + - + An array of BluetoothDeviceInfo objects describing the devices discovered. + + + + Occurs when an device discovery operation completes. + + - + + This event is raised at the end of the discovery process + and lists all the discovered devices. + + + - + + + + + Occurs during an device discovery operation + to show one or more new devices. + + - + + This event is raised for all discovered devices, both the + known devices which are presented first, if requested, + as well as newly discovery device found by the inquiry process, + again if requested. + + Note that any event instance may include one or more devices. Note + also that a particular device may be presented more than one time; + including once from the ‘known’ list, once when a + device is dicovered, and possibly another time when the discovery + process retrieves the new device’s Device Name. + + + - + + + + + + + + + + + Wrapper around CBtIf::Bond(). + + + + if pairing was completed. + if were already paired, or pairing failed. + + + + + The BluetoothAuthenticateDevice function sends an authentication request to a remote Bluetooth device. + + The window to parent the authentication wizard. + If NULL, the wizard will be parented off the desktop. + A valid local radio handle, or NULL. If NULL, authentication is attempted on all local radios; if any radio succeeds, the function call succeeds. + A structure of type BLUETOOTH_DEVICE_INFO that contains the record of the Bluetooth device to be authenticated. + A Personal Identification Number (PIN) to be used for device authentication. If set to NULL, the user interface is displayed and and the user must follow the authentication process provided in the user interface. If pszPasskey is not NULL, no user interface is displayed. If the passkey is not NULL, it must be a NULL-terminated string. For more information, see the Remarks section. + The size, in characters, of pszPasskey. + The size of pszPasskey must be less than or equal to BLUETOOTH_MAX_PASSKEY_SIZE. + + + + + The BluetoothAuthenticateDeviceEx function sends an authentication request to a remote Bluetooth device. Additionally, this function allows for out-of-band data to be passed into the function call for the device being authenticated. + Note This API is supported in Windows Vista SP2 and Windows 7. + + The window to parent the authentication wizard. + If NULL, the wizard will be parented off the desktop. + A valid local radio handle or NULL. + If NULL, then all radios will be tried. If any of the radios succeed, then the call will succeed. + A pointer to a BLUETOOTH_DEVICE_INFO structure describing the device being authenticated. + Pointer to device specific out-of-band data to be provided with this API call. + If NULL, then UI is displayed to continue the authentication process. + If not NULL, no UI is displayed. + An AUTHENTICATION_REQUIREMENTS enumeration that specifies the protection required for authentication. + + + + + Input: none + Output: BTH_LOCAL_RADIO_INFO + + + + + Input: BTH_ADDR + Output: BTH_RADIO_INFO + + + + + use this ioctl to get a list of cached discovered devices in the port driver. + + Input: None + Output: BTH_DEVICE_INFO_LIST + + + + + Input: BTH_ADDR + Output: none + + + + + Input: BTH_GET_DEVICE_RSSI + Output: ULONG + + + + + Input: BTH_EIR_GET_RECORDS + Output: UCHAR array, sequence of length + type + data fields triplets. + + + + + Input: BTH_EIR_SUBMIT_RECORD + Output HANDLE + + + + + Input: BTH_EIR_SUBMIT_RECORD + Output None + + + + + Input: HANDLE + Output: None + + + + + Input: BTH_VENDOR_SPECIFIC_COMMAND + Output: PVOID + + + + + Input: BTH_SDP_CONNECT + Output: BTH_SDP_CONNECT + + + + + Input: HANDLE_SDP + Output: none + + + + + Input: BTH_SDP_SERVICE_SEARCH_REQUEST + Output: ULONG * number of handles wanted + + + + + Input: BTH_SDP_ATTRIBUTE_SEARCH_REQUEST + Output: BTH_SDP_STREAM_RESPONSE or bigger + + + + + Input: BTH_SDP_SERVICE_ATTRIBUTE_SEARCH_REQUEST + Output: BTH_SDP_STREAM_RESPONSE or bigger + + + + + Input: raw SDP stream (at least 2 bytes) + Ouptut: HANDLE_SDP + + + + + Input: HANDLE_SDP + Output: none + + + + + Input: BTH_SDP_RECORD + raw SDP record + Output: HANDLE_SDP + + + + + Register the service. For SAP, this means sending out a periodic broadcast. + This is an NOP for the DNS namespace. + For persistent data stores, this means updating the address information. + + + + + Remove the service from the registry. + For SAP, this means stop sending out the periodic broadcast. + This is an NOP for the DNS namespace. + For persistent data stores this means deleting address information. + + + + + Delete the service from dynamic name and persistent spaces. + For services represented by multiple CSADDR_INFO structures (using the SERVICE_MULTIPLE flag), only the specified address will be deleted, and this must match exactly the corresponding CSADDR_INFO structure that was specified when the service was registered + + + + + Handles security between bluetooth devices. + + - + + Used by . + + + + + + Intiates pairing for a remote device. + + - + Remote device with which to pair. + Chosen PIN code, must be between 1 and 16 ASCII characters. + - + Whether the operation was successful. + + + + Remove the pairing with the specified device + + - + Remote device with which to remove pairing. + - + TRUE if device was successfully removed, else FALSE. + + + + This function stores the personal identification number (PIN) for the Bluetooth device. + + Address of remote device. + Pin, alphanumeric string of between 1 and 16 ASCII characters. + On Windows CE platforms this calls BthSetPIN, + its MSDN remarks say: + + “Stores the pin for the Bluetooth device identified in pba. + The active connection to the device is not necessary, nor is the presence + of the Bluetooth controller. The PIN is persisted in the registry until + BthRevokePIN is called. + + “While the PIN is stored, it is supplied automatically + after the PIN request is issued by the authentication mechanism, so the + user will not be prompted for it. Typically, for UI-based devices, you + would set the PIN for the duration of authentication, and then revoke + it after authentication is complete.” + + See also + + + + True on success, else False. + + + + + This function revokes the personal identification number (PIN) for the Bluetooth device. + + On Windows CE platforms this calls BthRevokePIN, + its MSDN remarks say: + + “When the PIN is revoked, it is removed from registry. + The active connection to the device is not necessary, nor is the presence + of the Bluetooth controller.” + + On Windows CE platforms this removes any pending BluetoothWin32Authentication object but does not remove the PIN for an already authenticated device. + Use RemoveDevice to ensure a pairing is completely removed. + See also + + + + The remote device. + True on success, else False. + + + + + Retrieves the address of the Bluetooth peer device authentication that requires the PIN code. + Not supported on Windows XP + + On Windows CE platforms this calls BthGetPINRequest, + its MSDN remarks say: + + “There can be multiple requests outstanding. After the event + that is provided by the UI handler is signaled, the UI handler must call + this function multiple times until the call fails.” + + See also + + and + + + of the remote device, or null if there is no outstanding PIN request. + + + + Refuses an outstanding PIN request. + Not supported on Windows XP + + - + Address of the requesting device. + - + true if the operation was successful; false otherwise. + - + On Windows CE platforms this calls BthRefusePINRequest, + its MSDN remarks say: + + “This function refuses an outstanding PIN request that is + retrieved by + function.” + + See also + + and + + + + + + Not supported on Windows XP + + - + The device whose Link Key to retrieve. + The 16-byte Link Key to set. + - + true if the operation was successful; false otherwise. + - + On Windows CE platforms this calls BthSetLinkKey, + its MSDN remarks say: + + “The link key is persisted in registry until BthRevokeLinkKey + is called. + + “Typically, the Bluetooth stack manages link keys automatically, + for example, it stores them when they are created. This function is useful + primarily for backup purposes. + + “While link key is stored, it will be automatically supplied + once the link key request is issued by the authentication mechanism. If + the link key is incorrect, the renegotiation that involves the PIN is + initiated by the Bluetooth adapter, and the PIN code may be requested + from the user. + + “The link key length is 16 bytes. You cannot create link + keys; they are generated by the Bluetooth hardware.” + + + + + + + Service Attribute IDs defined by the Device Identification Profile specification. + + - + + “This document specifies a method by which Bluetooth devices may + provide information that may be used by peer Bluetooth devices to + find representative icons or load associated support software. This + information is published as Bluetooth SDP records, and optionally in + an Extended Inquiry Response.” + + Used in records with Service Class ID: + . + + As well as the attributes defined here, use of some of the universal + attributes is recommended, they are: + , + , + and . + + + + + + SpecificationId [0x0200] + + The version of the Bluetooth Device ID Profile Specification + supported by the device. + e.g. version 1.3 will be value 0x0103. [UInt16] + + + + VendorId [0x0201] + + + The id assigned by the organisation in . [UInt16] + + “The value FFFF is reserved as the default id when + no Device ID Service Record is present in the device.” + + + + + + ProductId [0x0202] + + Distinguishes between different products made by the same vendor. [UInt16] + + + + Version [0x0203] + + The version of the product. [UInt16] + + + + PrimaryRecord [0x0204] + + If multiple Device ID records are present this indicates the one ’primary‚ record. [Boolean] + + + + VendorIdSource [0x0205] + + Designates which organisation assigned the Vendor ID value. [UInt16] + + ValueAssigning Organisation + 1Bluetooth SIG + 2USB Implementors Forum + 0, 3-FFFFreserved + + + + + + Listens for connections from L2CAP Bluetooth network clients. + + - + + The class provides simple methods + that listen for and accept incoming connection requests. New connections + are returned as instances. + + In the normal case a the listener is initialised with a + holding the Service Class Id on which it is + to accept connections, the listener will automatically create a SDP + Service Record containg that Service Class Id and the port number + (L2CAP Protocol Service Multiplexer) that it has started listening on. + The standard usage is thus as follows. + + + Class MyConsts + Shared ReadOnly MyServiceUuid As Guid _ + = New Guid("{00112233-4455-6677-8899-aabbccddeeff}") + End Class + + ... + Dim lsnr As New L2CapListener(MyConsts.MyServiceUuid) + lsnr.Start() + ' Now accept new connections, perhaps using the thread pool to handle each + Dim conn As New L2CapClient = lsnr.AcceptClient() + Dim peerStream As Stream = conn.GetStream() + ... + + One can also pass the L2CapListener a Service Name, or + a custom Service Record (Service Discovery Protocol record). + To create a custom Service Record use + . + + There are overloads of the constructor which take a + parameter instead of a + as the Service Class Id, the Class Id + value should be specified in that case in the endpoint. + If the port value is specified in the endpoint, then the listener will + attempt to bind to that L2CAP PSM locally. The address in the endpoint is + largely ignored as no current stack supports more than one local radio. + + The L2CAP protocol accepts only certain PSM values. The value is + a 16-bit integer, and the low byte must be odd and the high byte must + be even. So e.g. 0x0001 is valid, but 0x0002 and 0x0101 are invalid. + The range below 0x1001 is reserved for standards allocations. + See the L2CAP Specification for more information, L2CAP section 4.2 + (and SDP section 5.1.5) in the version 2.1 specification. + + + + + + Initializes a new instance of the class + that listens on the specified service identifier. + + - + The Bluetooth service to listen on. + Either one of the values on , + or your custom UUID stored in a . + See the documentation for more information + on the usage of this argument. + + + + + Initializes a new instance of the class + with the specified local endpoint. + + - + + The simpler constructor + taking just a System.Guid is used + in most cases instead of this one. + + + - + A that represents + the local endpoint to which to bind the listener. + Either one of the values on , + or your custom UUID stored in a . + See the documentation for more information + on the usage of this argument. + + + + + Starts listening for incoming connection requests. + + + + + Starts listening for incoming connection requests with a maximum + number of pending connection. + + - + The maximum length of the pending connections + queue. + + + + + Closes the listener. + + + + + Begins an asynchronous operation to accept an incoming connection attempt. + + - + An AsyncCallback delegate that references + the method to invoke when the operation is complete. + + A user-defined object containing information + about the accept operation. This object is passed to the callback + delegate when the operation is complete. + + - + An that represents the + asynchronous accept, which could still be pending. + + + + + Asynchronously accepts an incoming connection attempt and creates + a new to handle remote host communication. + + - + An returned + by a call to the method. + + - + A . + + + + + Accepts a pending connection request. + + - + AcceptClient is a blocking method that returns a + that you can use to send and receive data. + Use the method to determine if connection + requests are available in the incoming connection queue if you want + to avoid blocking. + Use the method to obtain + the underlying of the returned + . + The will provide you with methods for + sending and receiving with the remote host. + When you are through with the , be sure + to call its method. + + + - + A used to send and receive data. + - + Listener is stopped. + + + + Determines if there is a connection pending. + + - + true if there is a connection pending; otherwise, false. + + + + + Gets the local endpoint. + + - + The + that the listener is using for communications. + + - + + The + property of the endpoint will contain the port number (L2CAP PSM) + that the listener is listening on. + On some platforms, the + is similarly set, or is BluetoothAddress.None + if not known. + The endpoint’s + is never set. + + + + + + Get or set the ServiceName the server will use in its SDP Record. + + - + A string representing the value to be used for the Service Name + SDP Attribute. Will be if not specfied. + + - + + The listener is already started. + - or - + A custom Service Record was given at initialization time. In that case + the ServiceName attribute should be added to that record. + + + + + Returns the SDP Service Record for this service. + + - + + Returns if the listener is not + ed + (and an record wasn’t supplied at initialization). + + + + + + Provides information about remote devices connected by infrared communications. + + + + + + Compares two instances for equality. + + - + The + to compare with the current instance. + + - + true if + is a and equal to the current instance; + otherwise, false. + + + + + Returns the hash code for this instance. + + A hash code for the current object. + + + + Returns the address of the remote device. + + + + + Provided solely for compatibility with System.Net.IrDA - consider using instead. + + + + + Gets the name of the device. + + + + + Gets the character set used by the server, such as ASCII. + + + + + Gets the type of the device, such as a computer. + + + + + Specifies the media type information for an object. + + + + + Specifies the type of image data in an object. + + + + + Specifies that the image data is in Graphics Interchange Format (GIF). + + + + + Specifies that the image data is in Joint Photographic Experts Group (JPEG) format. + + + + + Specifies the type of text data in an object. + + + + + Specifies that the data is in HTML format. + + + + + Specifies that the data is in plain text format. + + + + + Specifies that the data is in vCalendar format. + + + + + Specifies that the data is in vCard format. + + + + + Specifies that the data is in vMsg format. + + + + + Specifies that the data is in vNote format. + + + + + Specifies that the data is in XML format. + + + + + Specifies the type of Object Exchange specific data. + + + + + Used to retrieve supported object types. + + + + + Used to retrieve folder listing with OBEX FTP. + + + + + Used to retrieve an object profile. + + + + + Provides the means to create Bluetooth classes on the one selected Bluetooth + stack where multiple are loaded in the same process. + + - + when + When calling new BluetoothClient(), new BluetoothListener(), + etc when multiple Bluetooth stacks are loaded at the same time then the + instance is created on the primary stack. This class allows the application + to select which stack the instance is created on. + Access this class via property + . + + + + + + Initialise a new instance of the + class, using the respective stack and/or radio. + + - + + Initialise a new instance of the + class, using the respective stack and/or radio. + + - + The new instance. + + + + + Initialise a new instance of the class, + with the specified local endpoint and + using the respective stack and/or radio. + + - + See . + + - + The new instance. + + + + + Initialise a new instance of the + class, using the respective stack and/or radio. + + - + + Initialise a new instance of the + class, + with the specified Service Class Id + using the respective stack and/or radio. + + - + See . + + - + The new instance. + + + + + Initialise a new instance of the + class, + with the specified Service Class Id and local device address + using the respective stack and/or radio. + + - + See . + + See . + + - + The new instance. + + + + + Initialise a new instance of the + class, + with the specified Service Class Id and local device address as a + + using the respective stack and/or radio. + + - + See . + + - + The new instance. + + + + + Initialise a new instance of the + class, + with the specified Service Class Id and raw Service Record + using the respective stack and/or radio. + + - + See . + + See . + + See . + + - + The new instance. + + + + + Initialise a new instance of the + class, + with the specified Service Class Id, local device address and raw Service Record + using the respective stack and/or radio. + + - + See . + + See . + + See . + + See . + + - + The new instance. + + + + + Initialise a new instance of the + class, + with the specified Service Class Id and local device address as a + and raw Service Record + using the respective stack and/or radio. + + - + See . + + See . + + See . + + - + The new instance. + + + + + Initialise a new instance of the + class, + with the specified Service Class Id and Service Record + using the respective stack and/or radio. + + - + See . + + See . + + - + The new instance. + + + + + Initialise a new instance of the + class, + with the specified Service Class Id, local device address and Service Record + using the respective stack and/or radio. + + - + See . + + See . + + See . + + - + The new instance. + + + + + Initialise a new instance of the + class, + with the specified Service Class Id and local device address as a + and Service Record + using the respective stack and/or radio. + + - + See . + + See . + + - + The new instance. + + + + + Initialise a new instance of the class, + using the respective stack and/or radio. + + - + See . + + - + The new instance. + + + + + Initialise a new instance of the class, + using the respective stack and/or radio. + + - + The new instance of . + + - + See . + + + + + Initialize an instance of this class, + given a scheme, a Bluetooth Device Address, and a remote path name; + using the respective stack and/or radio. + + - + The Uri scheme. One of + obex, obex-push, obex-ftp, or obex-sync. + + The Bluetooth Device Address of the OBEX server. + + The path on the OBEX server. + + - + The new instance of . + + + + + Initialise a new instance of the class, + using the respective stack and/or radio. + + - + The new instance of . + + + + + Gets the + instance for the respective stack and/or radio. + + - + A + as an + + + + + Handles security between bluetooth devices. + + + + + This function stores the personal identification number (PIN) for the Bluetooth device. + + Address of remote device. + Pin, alphanumeric string of between 1 and 16 ASCII characters. + On Windows CE platforms this calls BthSetPIN, + its MSDN remarks say: + + “Stores the pin for the Bluetooth device identified in pba. + The active connection to the device is not necessary, nor is the presence + of the Bluetooth controller. The PIN is persisted in the registry until + BthRevokePIN is called. + + “While the PIN is stored, it is supplied automatically + after the PIN request is issued by the authentication mechanism, so the + user will not be prompted for it. Typically, for UI-based devices, you + would set the PIN for the duration of authentication, and then revoke + it after authentication is complete.” + + See also + + + + True on success, else False. + + + + + This function revokes the personal identification number (PIN) for the Bluetooth device. + + On Windows CE platforms this calls BthRevokePIN, + its MSDN remarks say: + + “When the PIN is revoked, it is removed from registry. + The active connection to the device is not necessary, nor is the presence + of the Bluetooth controller.” + + On Windows CE platforms this removes any pending BluetoothWin32Authentication object but does not remove the PIN for an already authenticated device. + Use RemoveDevice to ensure a pairing is completely removed. + See also + + + + The remote device. + True on success, else False. + + + + + Intiates pairing for a remote device. + + Remote device with which to pair. + Chosen PIN code, must be between 1 and 16 ASCII characters. + On Windows CE platforms this calls BthPairRequest, + its MSDN remarks say: + + “BthPairRequest passes the parameters to the BthSetPIN + function and creates an ACL connection. Once the connection is established, + it calls the BthAuthenticate function to authenticate the device.” + + On Windows XP/Vista platforms this calls BluetoothAuthenticateDevice, + if the pin argument is set to null a Wizard is displayed to accept a PIN from the user, + otherwise the function executes in transparent mode. + + See also + + + + Whether the operation was successful. + + + + Intiates pairing for a remote device + with SSP if it is available. + + - + Remote device with which to pair. + + Note: not supported by all platforms. + + - + Whether the operation was successful. + + + + Remove the pairing with the specified device + + - + Remote device with which to remove pairing. + - + TRUE if device was successfully removed, else FALSE. + + + + Not supported on Windows XP + + + + On Windows CE platforms this calls BthSetLinkKey, + its MSDN remarks say: + + “The link key is persisted in registry until BthRevokeLinkKey + is called. + + “Typically, the Bluetooth stack manages link keys automatically, + for example, it stores them when they are created. This function is useful + primarily for backup purposes. + + “While link key is stored, it will be automatically supplied + once the link key request is issued by the authentication mechanism. If + the link key is incorrect, the renegotiation that involves the PIN is + initiated by the Bluetooth adapter, and the PIN code may be requested + from the user. + + “The link key length is 16 bytes. You cannot create link + keys; they are generated by the Bluetooth hardware.” + + + + + + + Retrieves the address of the Bluetooth peer device authentication that requires the PIN code. + Not supported on Windows XP + + On Windows CE platforms this calls BthGetPINRequest, + its MSDN remarks say: + + “There can be multiple requests outstanding. After the event + that is provided by the UI handler is signaled, the UI handler must call + this function multiple times until the call fails.” + + See also + + and + + + of the remote device, or null if there is no outstanding PIN request. + + + + Refuses an outstanding PIN request. + Not supported on Windows XP + + Address of the requesting device. + On Windows CE platforms this calls BthRefusePINRequest, + its MSDN remarks say: + + “This function refuses an outstanding PIN request that is + retrieved by + function.” + + See also + + and + + + + + + + Defines a class that provides Bluetooth Factory initialisation but returns + multiple factories. + + - + + In most cases configuration is provided so that + loads one or more + classes each derived from . + There the instance is the factory. This interface allows a class to be + loaded by but + instead returns a list of factory instances. + + + + + + Get the list of factories. + + A list of exceptions, to which any errors in + attempting to create the factories are added. + + A list of successfully created factories. + + + + + + + + The Btsdk_IsSDKInitialized function indicates whether a successful + call to Btsdk_Init is made. + + + + + + + The Btsdk_IsServerConnected function checks whether client + application can call BlueSoleil Server APIs. + + + When this fuction returns + , client application can call APIs normally, versa versit. + + + + + The Btsdk_SetStatusInfoFlag function is used to set the status + changing callback types which the user wants to receive. + + - + + usMsgType can be one of the following value or their combination: + + BTSDK_NTSERVICE_STATUS_FLAG + The status change of BlueSoleil server + event or OS message event. + + BTSDK_BLUETOOTH_STATUS_FLAG + Message event of the change of Bluetooth + status. + + BTSDK_REFRESH_STATUS_FLAG + Refresh event. + + + + - + See remarks. + - + BTSDK_OK for success, other for error code. + + + + The Btsdk_IsBluetoothReady function checks whether the local + Bluetooth device is working. + + Boolean + + + + Gets the current user-friendly name of the specified remote device. + + - + + Before calling Btsdk_UpdateRemoteDeviceName, the device database must be initialized by a + previous successful call to Btsdk_StartBluetooth. + The user-friendly device name is a UTF-8 character string. The device name acquired by this + command is stored automatically in the device database. + + + + + "gets the RSSI value of the specified remote device." + + - + + + + "a connection between local device and the specified + remote device must be created first." + + + - + hDev + + "Range: -128 to 127 (dB)." + + + + + "gets the current link quality value of the connection between local + device and the specified remote device." + + - + "The higher the value, the better the link quality is." + + - + "Range: 0 to 0xFF." + + + + + "Gets the user-friendly name of the specified remote device from the device database." + + - + + "Before calling Btsdk_GetRemoteDeviceName, the device database must be initialized by a + previous successful call to Btsdk_Init. + The user-friendly device name is a UTF-8 character string. The Btsdk_GetRemoteDeviceNamefunction returns =BTSDK_OPERATION_FAILURE immediately if the device name doesn’t + exist in the database. In this case, the application shall call Btsdk_UpdateRemoteDeviceName + to acquire the name information directly from the remote device. + BlueSoleil will automatically update the device name when the local device connects to the + specified remote device. + + + + + NETCF Version of: Creates an array of new Process components and associates them with all the process resources on the local computer that share the specified process name. + + - + e.g. "BTExplorer" + + - + An array of type + that represents the process resources running the specified application or file. + + + + + Supported network transports for Object Exchange. + + + + + Infrared (IrDA) + + + + + Bluetooth + + + + + TCP/IP + + + + + An adapter that provides a System.Net.Sockets.Socket-like + interface to etc. + + - + + Required as on Widcomm/Broadcom + does not support getting a from + the property. + Motivated by upgrading of to + be usable on Widcomm. + + Also adapts , and + . + + + + + + Provide a System.Net.Sockets.Socket-like + interace to another connection type e.g. a + + - + + See class + for an implementation that adapts + etc to the Socket-like interface. + That is required as on Widcomm/Broadcom + does not support getting a from + the property. + Motivated by upgrading of to + be usable on Widcomm. + + + + + + Utilities method working on SDP s, for instance to + produce a 'dump' of the record's contents. + + - + + This class produces output like the following: + + AttrId: 0x0000 -- ServiceRecordHandle + UInt32: 0x0 + + AttrId: 0x0001 -- ServiceClassIdList + ElementSequence + Uuid16: 0x1000 -- ServiceDiscoveryServer + + AttrId: 0x0004 -- ProtocolDescriptorList + ElementSequence + ElementSequence + Uuid16: 0x100 -- L2CapProtocol + UInt16: 0x1 + ElementSequence + Uuid16: 0x1 -- SdpProtocol + ( ( L2Cap, PSM=Sdp ), ( Sdp ) ) + + AttrId: 0x0005 -- BrowseGroupList + ElementSequence + Uuid16: 0x1002 -- PublicBrowseGroup + + AttrId: 0x0006 -- LanguageBaseAttributeIdList + ElementSequence + UInt16: 0x656E + UInt16: 0x6A + UInt16: 0x100 + + AttrId: 0x0100 -- ServiceName + TextString: [en] 'Service Discovery' + + AttrId: 0x0101 -- ServiceDescription + TextString: [en] 'Publishes services to remote devices' + + AttrId: 0x0102 -- ProviderName + TextString: [en] 'Microsoft' + + AttrId: 0x0200 -- VersionNumberList + ElementSequence + UInt16: 0x100 + + AttrId: 0x0201 -- ServiceDatabaseState + UInt32: 0x1 + + The Service Class Id names and Attribute Id names are looked up using + /etc and + + respectively. + + + + + Produces a raw 'dump' of the given record, not including attribute names etc. + + - + + Gets a string containing a raw 'dump' of the given record, not including attribute names etc. + + - + A to be dumped. + A containing the 'dump' text. + + + + + Produce a raw 'dump' of the given record, not including attribute names etc, to the given + . + + A where the 'dump' + text is to be written. + A to be dumped. + + + + + Produces a 'dump' of the given record, including attribute names etc. + + -- + + Gets a containing a 'dump' of the given record, including attribute names etc. + + - + A to be dumped. + + An optional array of specifing a set of Ids + for the attributes contained in this record. See the + + overload for more information. + + - + A containing the 'dump' text. + - + + + + + Produce a 'dump' of the given record, including attribute names etc to the given + . + + - + + The system has built-in a set of mappings from Service Class to + its Attribute IDs. This is supplied by the + class, + and contains the Attribute IDs defined in the base SDP specification as + well as in Bluetooth Profiles specification e.g. ObjectPushProfile, Headset, + Panu, etc. + If however the record being decoded is a custom one then a set of extra + Attribute Id definitions can be supplied in the + parameter. + The Attribute IDs for a particular Service Class + should be defined in a static class and the set of such classes should + be passed as their object. e.g. + + static class FooAttributeId + { + public const ServiceAttributeId BarName = (ServiceAttributeId)0x0300; + } + + … + ServiceRecordUtilities.Dump(writer, myRecord, typeof(FooAttributeId)); + … + + + + - + A where the 'dump' + text is to be written. + A to be dumped. + + An optional array of specifing a set of Ids + for the attributes contained in this record. See the + + + + + + Attempt to get the name of the protocol, + and optionally it's enum id if we handle it specially. + + - + The input. + + The protocol's name if known, or its + Guid.ToString if not. + We handle some explicitly, and otherwise we see if there's a + matching value in BluetoothService that has its name suffixed "Protocol". + + - + The id as a . + We handle some explicitly, + otherwise we see if its a UUID16 and convert it automatically, + finally if neither we return zero. + + + + + The AUTHENTICATION_REQUIREMENTS enumeration specifies the 'Man in the Middle' protection required for authentication. + + + + + Protection against a "Man in the Middle" attack is not required for authentication. + + + + + Protection against a "Man in the Middle" attack is required for authentication. + + + + + Protection against a "Man in the Middle" attack is not required for bonding. + + + + + Protection against a "Man in the Middle" attack is required for bonding. + + + + + Protection against a "Man in the Middle" attack is not required for General Bonding. + + + + + Protection against a "Man in the Middle" attack is required for General Bonding. + + + + + Protection against "Man in the Middle" attack is not defined. + + + + + Check whether all the of dependencies are correct. + + - + The original exception we got on trying + to load Widcomm. Or null if Widcomm loaded successfully and + we're just doing a check of the dependencies. + + - + Does not return if is non-null, + instead will throw it, or a more explanatory exception (with it as + an inner exception). + If is null, + + + + + ReportNeedNeedNativeDllUpgrade, call from pair of catch: + EntryPointNotFoundException and MissingMethodException. + + The exception. + Whether we may put up an (Debug.)Assert dialog box. + + + + + Could not connect to remote device + + + + + Remote device rejected the connection + + + + + Security failed + + + + + Remote Service Record Error + + + + + Other error + + + + + success response + + + + + no more devices found + + + + + can not find exsiting entry for bda provided as input + + + + + out of memory + + + + + Used by OnStackChanges virtual method. + + + 1000-WCE-PG100-RCD.pdf (03/20/06) says: + "... no longer used: DEVST_UP and DEVST_ERROR." + and: + "Values defined in BtIfClasses.h are: + + • DEVST_DOWN — The stack is down and no longer available. + • DEVST_UNLOADED — The stack is down, but should be available again after DEVST_RELOADED. + • DEVST_RELOADED — The stack has been successfully reloaded." + + + + + + + Device is present, but down [Seen (on BTW)] + + + + + Device is present and UP [Doc'd as obsolete, but I see it (on BTW)] + + + + + Device is in error (maybe being removed) [Doc'd as obsolete] + + + + + Stack is being unloaded + + + + + Stack reloaded after being unloaded + + + + + Used when loading a stack stored/remembered/maybe-paired device. + + + + + Used when a device is discovered during Inquiry. + + - + + When the result of Inquiry and get-stack-stored-devices are merged, + the remembered/authenticated flags may get set then (with ). + + + + + + Called after reading the device from the Registry, to find if it is paired. + + + + + For use when the results of Inquiry and get-stack-stored-devices are merged. + + + + + + + + + + Internal bytes + + + + + + Size of the structure. + + + + + Use with struct rfcomm_conninfo{hci_handle, dev_class}. + + + + + + + + Values of the flags parameter to sdp_record_register + + + + + Values of the flags parameter to sdp_connect + + + + + Attributes are specified as individual elements + + + + + Attributes are specified as a range + + + + + For FooBarClient.Connected + + + + + “No service record with the specified search pattern is found on the remote device.” + + + + + “The specified service record does not exist on the remote device..” + + + + + “HCI error “Page Timeout (0X04)” is received.” + + + + + Used to create a new web request for obex uri scheme + + + + + Specifies the status codes returned for an Object Exchange (OBEX) operation. + + OBEX codes are directly related to their HTTP equivalents - see . + + + + Applied to another code to indicate this is the only response or final response in a series. + + + + + Equivalent to HTTP status 100. + Continue indicates that the client can continue with its request. + + + + + Equivalent to HTTP status 200. + OK indicates that the request succeeded and that the requested information is in the response. + This is the most common status code to receive. + + + + + Equivalent to HTTP status 201. + Created indicates that the request resulted in a new resource created before the response was sent. + + + + + Equivalent to HTTP status 202. + Accepted indicates that the request has been accepted for further processing. + + + + + Equivalent to HTTP status 203. + NonAuthoritativeInformation indicates that the returned metainformation is from a cached copy instead of the origin server and therefore may be incorrect. + + + + + Equivalent to HTTP status 204. + NoContent indicates that the request has been successfully processed and that the response is intentionally blank. + + + + + Equivalent to HTTP status 205. + ResetContent indicates that the client should reset (not reload) the current resource. + + + + + Equivalent to HTTP status 206. + PartialContent indicates that the response is a partial response as requested by a GET request that includes a byte range. + + + + + Equivalent to HTTP status 300. + MultipleChoices indicates that the requested information has multiple representations. + + + + + Equivalent to HTTP status 301. + MovedPermanently indicates that the requested information has been moved to the URI specified in the Location header. + The default action when this status is received is to follow the Location header associated with the response. + + + + + Equivalent to HTTP status 302. + Redirect indicates that the requested information is located at the URI specified in the Location header. + The default action when this status is received is to follow the Location header associated with the response. + When the original request method was POST, the redirected request will use the GET method. + + + + + Equivalent to HTTP status 303. + SeeOther automatically redirects the client to the URI specified in the Location header as the result of a POST. The request to the resource specified by the Location header will be made with a GET. + + + + + Equivalent to HTTP status 304. + NotModified indicates that the client's cached copy is up to date. + The contents of the resource are not transferred. + + + + + Equivalent to HTTP status 305. + UseProxy indicates that the request should use the proxy server at the URI specified in the Location header. + + + + + Equivalent to HTTP status 400. + BadRequest indicates that the request could not be understood by the server. BadRequest is sent when no other error is applicable, or if the exact error is unknown or does not have its own error code. + + reports errors through + ObexWebResponse.StatusCode, + this status code is overloaded by it to report failure to connect to the server. + + + + + Equivalent to HTTP status 401. + Unauthorized indicates that the requested resource requires authentication. The WWW-Authenticate header contains the details of how to perform the authentication. + + + + + Equivalent to HTTP status 402. + PaymentRequired is reserved for future use. + + + + + Equivalent to HTTP status 403. + Forbidden indicates that the server refuses to fulfill the request. + + + + + Equivalent to HTTP status 404. + NotFound indicates that the requested resource does not exist on the server. + + + + + Equivalent to HTTP status 405. + MethodNotAllowed indicates that the request method (POST or GET) is not allowed on the requested resource. + + + + + Equivalent to HTTP status 406. + NotAcceptable indicates that the client has indicated with Accept headers that it will not accept any of the available representations of the resource. + + + + + Equivalent to HTTP status 407. + ProxyAuthenticationRequired indicates that the requested proxy requires authentication. + The Proxy-authenticate header contains the details of how to perform the authentication. + + + + + Equivalent to HTTP status 408. + RequestTimeout indicates that the client did not send a request within the time the server was expecting the request. + + + + + Equivalent to HTTP status 409. + Conflict indicates that the request could not be carried out because of a conflict on the server. + + + + + Equivalent to HTTP status 410. + Gone indicates that the requested resource is no longer available. + + + + + Equivalent to HTTP status 411. + LengthRequired indicates that the required Content-length header is missing. + + + + + Equivalent to HTTP status 412. + PreconditionFailed indicates that a condition set for this request failed, and the request cannot be carried out. + Conditions are set with conditional request headers like If-Match, If-None-Match, or If-Unmodified-Since. + + + + + Equivalent to HTTP status 413. + RequestEntityTooLarge indicates that the request is too large for the server to process. + + + + + Equivalent to HTTP status 414. + RequestUriTooLong indicates that the URI is too long. + + + + + Equivalent to HTTP status 415. + UnsupportedMediaType indicates that the request is an unsupported type. + + + + + Equivalent to HTTP status 500. + InternalServerError indicates that a generic error has occurred on the server. + + reports errors through + ObexWebResponse.StatusCode, + this status code is used by it to report failure to send the object. + + + + + Equivalent to HTTP status 501. + NotImplemented indicates that the server does not support the requested function. + + + + + Equivalent to HTTP status 502. + BadGateway indicates that an intermediate proxy server received a bad response from another proxy or the origin server. + + + + + Equivalent to HTTP status 503. + ServiceUnavailable indicates that the server is temporarily unavailable, usually due to high load or maintenance. + + + + + Equivalent to HTTP status 504. + GatewayTimeout indicates that an intermediate proxy server timed out while waiting for a response from another proxy or the origin server. + + + + + Equivalent to HTTP status 505. + HttpVersionNotSupported indicates that the requested HTTP version is not supported by the server. + + + + + + + + + + + + + + + Makes connections to services on peer IrDA devices. + + - + + Makes connections to services on peer IrDA devices. It allows + discovery of all devices in range, then a connection can be made to + the required service on the chosen peer. Or, given just the + service name a connection will be made to an arbitrary peer. This is + most useful when it is expected that there will be only one device in + range—as is often the case. + It can be used with both the full and Compact frameworks, and can + be used as a replacement for the latter's built-in version simply by + changing the referenced namespace and assembly. + It also has features extra + to those in the CF's version. For instance, following the + pattern of in framework + version 2, it provides access to the underlying + via a Client + property. This is particularly useful as it allows setting socket + options, for instance IrCOMM Cooked mode with option . + + There a number of well-known services, a few are listed here. + + Service description + Service Name, Protocol type + OBEX file transfer + OBEX:IrXfer, (TinyTP) + OBEX general + OBEX, (TinyTP) + Printing + IrLPT, IrLMP mode + IrCOMM e.g. to modems + IrDA:IrCOMM, IrCOMM 9-Wire/Cooked mode + + The modes required by the last two are set by socket option, as noted + for IrCOMM above. + + + Of course the library also includes specific OBEX protocol support, both + client and server, see etc. + + + - + Example code to connect to a IrCOMM service would be as + follows. + + Public Shared Sub Main() + Dim cli As New IrDAClient + ' Set IrCOMM Cooked/9-wire mode. + cli.Client.SetSocketOption(IrDASocketOptionLevel.IrLmp, _ + IrDASocketOptionName.NineWireMode, _ + 1) ' equivalent to 'True' + ' Connect + cli.Connect("IrDA:IrCOMM") + ' Connected, now send and receive e.g. by using the + ' NetworkStream returned by cli.GetStream + ... + End Sub + + + - + + + + + + Initializes a new instance of the class, + and optionally connects to a peer device. + + ---- + + Initializes a new instance of the class. + + + + It then allows discovery of all devices in range using , then a + connection can be made to the required service on the chosen peer using . + Or, given just the service name a connection will be made to an arbitrary + peer, using . This is + most useful when it is expected that there will be only one device in + range — as is often the case. + + + + + Initializes a new instance of the + class and connects to the specified service name. + + - + + This is + equivalent to calling the default constructor followed by + . + + + As noted the connection will be made to an arbitrary peer. This is + most useful when it is expected that there will be only one device in + range — as is often the case. If a connection is to be made to + a particular remote peer, then use the + + overload. + + + Infrared connections are made by specifying a Service Name, which can + be any value provided the participating devices refer the same name. + + + See + for the errors that can occur. + + + - + + A containing the service name to connect to. + + + + + Initializes a new instance of the + class and connects to the specified endpoint. + + + + This is + equivalent to calling the default constructor followed by + . + + + The endpoint specifies both the peer device and service name + to connect to. If only one device is expected to be in range, or + an arbitrary peer device is suitable, then one can use + instead. + + + + An initialised with the address of the peer + device and the service name to connect to. + + + + + Obtains information about available devices. + + - + + Returns a maximum of 8 devices, for more flexibility use the other overloads. + + - + The discovered devices as an array of . + + + + Obtains information about a specified number of devices. + + - + The maximum number of devices to get information about. + - + The discovered devices as an array of . + + + + Obtains information about available devices using a socket. + + - + The maximum number of devices to get information about. + A + to be uses to run the discovery process. + It should have been created for the IrDA protocol + - + The discovered devices as an array of . + + + + + + + Gets the name of the peer device using the specified socket. + + A connected IrDA Socket. + The name of the remote device. + - + + This finds the name of the device to which the socket is connection, + an exception will occur if the socket is not connected. + + - + + s is null (Nothing in Visual Basic). + + + The remote device is not present in the list of discovered devices. + + + The socket is not connected. + + + + + Forms a connection to the specified peer service. + + -- + + Forms a connection to the specified endpoint. + + + + The endpoint specifies both the peer device and service name + to connect to. If only one device is expected to be in range, or + an arbitrary peer device is suitable, then one can use + instead. + + + + An initialised with the address of the peer + device and the service name to connect to. + + + + + Forms a connection to the specified service on an arbitrary peer. + + + As noted the connection will be made to an arbitrary peer. This is + most useful when it is expected that there will be only one device in + range — as is often the case. If a connection is to be made to + a particular remote peer, then use + . + + The Service Name to connect to eg "OBEX". + In the very uncommon case where a connection is to be made to a + specific LSAP-SEL (port number), then use + the form "LSAP-SELn", where n is an integer. + - + + No peer IrDA device was found. The exception has message “No device”. + + + A connection could not be formed. See the exception message or + + (or on NETCF) + for what error occurred. + + + + + Begins an asynchronous request for a remote host connection. + + - + + Begins an asynchronous request for a remote host connection. + The remote host is specified by an endpoint. + + - + + An initialised with the address of the peer + device and the service name to connect to. + + An AsyncCallback delegate that references the method to invoke when the operation is complete. + A user-defined object that contains information about the connect operation. + This object is passed to the requestCallback delegate when the operation is complete. + - + An that represents the + asynchronous connect, which could still be pending. + + + + + Begins an asynchronous request for a remote host connection. + The remote host is specified by a service name (string). + + - + The service name of the remote host. + An AsyncCallback delegate that references the method to invoke when the operation is complete. + A user-defined object that contains information about the connect operation. + This object is passed to the requestCallback delegate when the operation is complete. + - + An that represents the + asynchronous connect, which could still be pending. + + - + + + See + for the errors that can occur. + + + + + + Asynchronously accepts an incoming connection attempt. + + An object returned + by a call to + / . + + + + + Closes the and the underlying connection. + + - + The two XxxxxClient classes produced by Microsoft (TcpClient, + and IrDAClient in the NETCF) have various documented behaviours and various + actual behaviours for close/dispose/finalize on the various platforms. :-( + The current TcpClient implementation is that + Close/Dispose closes the connection by closing the underlying socket and/or + NetworkStream, and finalization doesn't close either. This is the behaviour + we use for the here (for , + ). (The documentation in MSDN for + is still wrong by-the-way, + see + Microsoft feedback #158480). + + + + + Returns the used to send and receive data. + + - + The underlying NetworkStream. + - + + + GetStream returns a NetworkStream + that you can use to send and receive data. The NetworkStream class + inherits from the class, which provides a + rich collection of methods and properties used to facilitate network communications. + + You must call the + method, or one of its overloads, first, or + the GetStream method will throw an InvalidOperationException. + After you have obtained the NetworkStream, call the + + method to send data to the remote host. + Call the + method to receive data arriving from the remote host. + Both of these methods block until the specified operation is performed. + You can avoid blocking on a read operation by checking the + property. + A true value means that data has arrived from the remote host and + is available for reading. In this case, Read is + guaranteed to complete immediately. + If the remote host has shutdown its connection, Read will + immediately return with zero bytes. + + + Closing the NetworkStream closes the connection. + Similarly Closing, Disposing, or the finalization of the IrDAClient + Disposes the NetworkStream. + This is new behaviour post 2.0.60828.0. + + + + If you receive a SocketException, use SocketException.ErrorCode to obtain + the specific error code. After you have obtained this code, you can refer + to the Windows Sockets version 2 API error code documentation in MSDN + for a detailed description of the error. + + + - + + The is not connected to a remote host. + + + The IrDAClient has been closed. + + + + + Releases the unmanaged resources used by the and optionally releases the managed resources. + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Closes the and the underlying connection. + + - + + + + + Gets or set a value that indicates whether a connection has been made. + + + + + The number of bytes of data received from the network and available to be read. + + + + + Gets or sets the underlying . + + + This is particularly useful as it allows setting socket + options, for instance IrCOMM Cooked mode, ie + . + + Example code to connect to a IrCOMM service would be as + follows, note the use of the Client property. + + Public Shared Sub Main() + Dim cli As New IrDAClient + ' Set IrCOMM Cooked/9-wire mode. + cli.Client.SetSocketOption( _ + IrDASocketOptionLevel.IrLmp, _ + IrDASocketOptionName.NineWireMode, _ + 1) ' representing true + ' Connect + cli.Connect("IrDA:IrCOMM") + ' Connected, now send and receive e.g. by using the + ' NetworkStream returned by cli.GetStream + ... + End Sub + + + + + + Gets a value indicating whether the underlying for an is connected to a remote host. + + + + + Gets the name of the peer device participating in the communication. + + - + + This finds the name of the device to which the client is connection, + an exception will occur if the socket is not connected. + + - + + If the remote device is not found in the discovery cache. + + + The socket is not connected. + + + + + Provides client connections for Bluetooth RFCOMM network services. + + + This class currently only supports devices which use the Microsoft + and Widcomm Bluetooth stacks, devices which use the other stacks will + not work. + + + When connecting + normally an endpoint with an Address and a Service Class Id + is specified, then the system will automatically lookup the SDP + record on the remote device for that service class and connect to + the port number (RFCOMM Channel Number) specified there. + If instead a port value is provided in the endpoint then the SDP + lookup will be skipped and the system will connect to the specified + port directly. + + Note: Do not attempt to connect with service + BluetoothService.RFCommProtocol + this class always uses RFCOMM, instead the Service Class Id of the + particular service to which you want to connect must be specified, + perhaps + BluetoothService.SerialPort, + BluetoothService.ObexObjectPush, + or the unique UUID/ that you are using in + your custom server application. + + + + + + Creates a new instance of . + + + + + Initializes a new instance of the class and binds it to the specified local endpoint. + + The to which you bind the Bluetooth Socket. + Only necessary on multi-radio system where you want to select the local radio to use. + + + + Discovers accessible Bluetooth devices, both remembered and in-range, + and returns their names and addresses. + + - + + This is equivalent to calling + (255, true, true, true) + + + - + An array of BluetoothDeviceInfo objects describing the devices discovered. + + + + Discovers accessible Bluetooth devices, both remembered and in-range, + and returns their names and addresses. + + - + + This is equivalent to calling + (maxDevices, true, true, true) + + + - + The number of in-range devices to find before the inquiry may be stopped early. + The result can contain more than this number of devices. + + - + An array of BluetoothDeviceInfo objects describing the devices discovered. + + + + Discovers accessible Bluetooth devices, optionally remembered and in-range, + and returns their names and addresses. + + - + The number of in-range devices to find before the inquiry may be stopped early. + The result can contain more than this number of devices. + + True to return previously authenticated/paired devices. + True to return remembered devices. + True to return previously unknown devices. + - + An array of BluetoothDeviceInfo objects describing the devices discovered. + + + + Discovers accessible Bluetooth devices, optionally remembered and in-range or just in-range, + and returns their names and addresses. + + - + + The parameter is not supported + on the Microsoft stack on WinXP as the stack there returns the remembered and Device-Inquiry-results already + merged, it is however supported on Windows 7. + It is supported on WM/CE and on Widcomm (both platforms). + Note when that flag is set the other related flag values are ignored. + + To remove devices from the list of remembered/authenticated + devices use BluetoothSecurity.RemoveDevice + + + - + The number of in-range devices to find before the inquiry may be stopped early. + The result can contain more than this number of devices. + + True to return previously authenticated/paired devices. + True to return remembered devices. + True to return previously unknown devices. + True to return only the devices that + are in range, and in discoverable mode. See the remarks section. + - + An array of BluetoothDeviceInfo objects describing the devices discovered. + + + + Discovers Bluetooth devices that are in range and are in ‘discoverable mode’ + + - + + This is equivalent to calling + (255, false, false, false, true) + + + - + An array of BluetoothDeviceInfo objects describing the devices discovered. + + + + An asynchronous version of + + - + See . + + See . + + See . + + See . + + See . + + An optional asynchronous callback, to be called + when the discovery is complete. + + A user-provided object that distinguishes this + particular asynchronous discovery request from other requests. + + - + An that represents the + asynchronous discovery, which could still be pending. + + + + + Ends an asynchronous Service Record lookup query. + + - + An returned + by . + + - + See . + + + + + Connects a client to a specified endpoint. + + - + A that represents the server on the remote device. + - + + + Normally an endpoint with an Address and a Service Class Id + is specified, then the system will automatically lookup the SDP + record on the remote device for that service class and connect to + the port number (RFCOMM Channel Number) specified there. + If instead a port value is provided in the endpoint then the SDP + lookup will be skipped and the system will connect to the specified + port directly. + + Note: Do not attempt to connect with service + BluetoothService.RFCommProtocol. + See the class remarks for more information. + + + + + + Connects the client to a remote Bluetooth host using the specified Bluetooth address and service identifier. + + - + + + The system will automatically lookup the SDP + record on the remote device for that service class and connect to + the port number (RFCOMM Channel Number) specified there. + + Note: Do not attempt to connect with service + BluetoothService.RFCommProtocol. + See the class remarks for more information. + + + - + The of the remote host. + + The Service Class Id of the service on the remote host. + The standard Bluetooth Service Classes are provided on class + . + + + + + Begins an asynchronous request for a remote host connection. + The remote host is specified by a and a service identifier (Guid). + + - + + See the + method for information on the usage of the values in the endpoint. + + + - + The of the remote host. + + The Service Class Id of the service on the remote host. + The standard Bluetooth Service Classes are provided on class + + + An delegate that + references the method to invoke when the operation is complete. + + A user-defined object that contains information + about the connect operation. This object is passed to the + delegate when the operation is complete. + + - + An that represents the + asynchronous connect, which could still be pending. + + + + + Begins an asynchronous request for a remote host connection. + The remote server is specified by a . + + - + A that + represents the server on the remote device. + See the + method for information on the usage of the values in the endpoint. + + An delegate that + references the method to invoke when the operation is complete. + + A user-defined object that contains information + about the connect operation. This object is passed to the + delegate when the operation is complete. + + - + + See the + method for information on the usage of the values in the endpoint. + + + - + An that represents the + asynchronous connect, which could still be pending. + + + + + Asynchronously accepts an incoming connection attempt. + + An object returned by a call to + + / . + + + + + Closes the and the underlying connection. + + - + The two XxxxxClient classes produced by Microsoft (TcpClient, + and IrDAClient in the NETCF) have had various documented behaviours and various + actual behaviours for close/dispose/finalize on the various platforms. :-( + The current TcpClient implementation on is that + Close/Dispose closes the connection by closing the underlying socket and/or + NetworkStream, and finalization doesn't close either. This is the behaviour + we use for the here (for , + ). (The documentation in MSDN for + is still wrong by-the-way, + see + Microsoft feedback #158480). + + + + + Gets the underlying stream of data. + + The underlying . + returns a that you can use to send and receive data. + The class inherits from the class, which provides a rich collection of methods and properties used to facilitate network communications. + You must call the / + method first, or the method will throw an . + After you have obtained the , call the method to send data to the remote host. + Call the method to receive data arriving from the remote host. + Both of these methods block until the specified operation is performed. + You can avoid blocking on a read operation by checking the property. + A true value means that data has arrived from the remote host and is available for reading. + In this case, is guaranteed to complete immediately. + If the remote host has shutdown its connection, will immediately return with zero bytes. + The is not connected to a remote host. + The has been closed. + + + + Sets the PIN associated with the remote device. + + PIN which must be composed of 1 to 16 ASCII characters. + + Is not supported on all platforms. + For instance see the Widcomm documentation + + Assigning null (Nothing in VB) or an empty String will revoke the PIN. + + In version 2.3 could only be called when connected. + + + + + + Set or change the PIN to be used with a specific remote device. + + Address of Bluetooth device. + PIN string consisting of 1 to 16 ASCII characters. + + Is not supported on all platforms. + For instance see the Widcomm documentation + + Assigning null (Nothing in VB) or an empty String will revoke the PIN. + + + + + + Gets the name of the specified remote device. + + Address of remote device. + Friendly name of specified device. + + + + Gets the name of a device by a specified socket. + + A . + Returns a string value of the computer or device name. + + + + Closes the and the underlying connection. + + - + + + + + Get or set the Device Discovery Inquiry Access Code. + + - + + This is supported only the Microsoft stack on WindowsMobile/etc. + It is not supported on any other platforms. + + The default value is + GIAC (0x9E8B33). + See also constant + LIAC (0x9E8B00). + The valid range is 0x9E8B00 through 0x9E8B3f. + + + - + An containing the Access Code + to be used for Inquiry. + + + + + Amount of time allowed to perform the query. + + On Windows CE the actual value used is expressed in units of 1.28 seconds, so will be the nearest match for the value supplied. + The default value is 10 seconds. The maximum is 60 seconds. + + + + Gets the amount of data that has been received from the network and is available to be read. + + The number of bytes of data received from the network and available to be read. + The has been closed. + + + + Gets or sets the underlying . + + - + The underlying network . + - + + The property is only supported on Microsoft Bluetooth stack platforms. + + + + + + Gets a value indicating whether the underlying for a is connected to a remote host. + + true if the socket was connected to a remote resource as of the most recent operation; otherwise, false. + + + + Gets or sets a value that specifies whether the client will delay closing + in an attempt to send all pending data. + + - + + See Socket.LingerState. + + In Widcomm, linger false (disabled) is not supported. + + + - + A that specifies + how to linger while closing a socket. + + + + + Gets or sets the authentication state of the current connect or behaviour to use when connection is established. + + + For disconnected sockets, specifies that authentication is required in order for a connect or accept operation to complete successfully. + Setting this option actively initiates authentication during connection establishment, if the two Bluetooth devices were not previously authenticated. + The user interface for passkey exchange, if necessary, is provided by the operating system outside the application context. + For outgoing connections that require authentication, the connect operation fails with WSAEACCES if authentication is not successful. + In response, the application may prompt the user to authenticate the two Bluetooth devices before connection. + For incoming connections, the connection is rejected if authentication cannot be established and returns a WSAEHOSTDOWN error. + + + + + On unconnected sockets, enforces encryption to establish a connection. + Encryption is only available for authenticated connections. + For incoming connections, a connection for which encryption cannot be established is automatically rejected and returns WSAEHOSTDOWN as the error. + For outgoing connections, the connect function fails with WSAEACCES if encryption cannot be established. + In response, the application may prompt the user to authenticate the two Bluetooth devices before connection. + + + + + Returns link key associated with peer Bluetooth device. + + + + + Returns the Link Policy of the current connection. + + + + + Get the remote endpoint. + + - + + The with which the + is communicating. + + - + + Note it can't be guaranteed that the + and parts + of the returned endpoint are valid; and this will affect the + output. + In particular, on MSFT, the + for a client connection seems to have no + and a garbage , + so we would display garbage there in . + An in-bound/server connection however does have a valid Port. + (There the endpoints are returned from the native socket). + On the other hand on Widcomm, Bluetopia and on BlueSoleil the + opposite is the case: for a client the Port is known but it isn't + for a server, and the + is blank in both cases. + + + + + + Gets the name of the remote device. + + + + + + + + Defines the type of an IAS attribute. + + + + + Identifies an integer attribute value. + + + + + Identifies a binary, or octet, attribute value. + + + + + Identifies a string attribute value. + + + + + Provides a simple way to build a , + including ServiceClassIds and ServiceNames attributes etc. + + - + + The service’s Class Id can be set with the + //etc + methods, the protocol stack set with the + property (default RFCOMM), and the Service Name set with the + + property. Other properties and methods exist for controlling the more advanced + attributes. + + Adding the standard text-string attributes (ServiceName etc) is normally quite + difficult due to the very baroque manner of specifying these strings’ character + encoding and natural language. The builder handles all the complexity internally; + the strings are written in UTF-8 encoding and marked as 'English' language. + + + - + + + ServiceRecordBuilder bldr = new ServiceRecordBuilder(); + bldr.AddServiceClass(BluetoothService.SerialPort); + bldr.ServiceName = "Alan's SPP service"; + // + ServiceRecord rcd = bldr.ServiceRecord; + + + + ServiceRecordBuilder bldr = new ServiceRecordBuilder(); + bldr.ProtocolType = BluetoothProtocolDescriptorType.GeneralObex; + bldr.AddServiceClass(BluetoothService.ObexFileTransfer); + bldr.ServiceName = "Alan's FTP service"; + // + ServiceRecord rcd = bldr.ServiceRecord; + + + + + + Create a new instance of the class. + + + + The list to check for duplicates. + + true if checking a previously stored list + of attributes, and false if checking a immediate addition of an + attribute. Thus throws InvalidOperationException and + ArgumentException respectively. + + + + + Add a Service Class Id. + + - + + Multiple class ids can be added, and they will be written to the + + attribute in the order in which they were set. + + + - + A containing a + UUID for the advertised service. + + + + + Add a Service Class Id. + + - + + Multiple class ids can be added, and they will be written to the + + attribute in the order in which they were set. + + + - + A containing a short-form + UUID for the advertised service. + + + + + Add a Service Class Id. + + - + + Multiple class ids can be added, and they will be written to the + + attribute in the order in which they were set. + + + - + A containing a short-form + UUID for the advertised service. + + + + + Add a Service Class Id. + + - + + Multiple class ids can be added, and they will be written to the + + attribute in the order in which they were set. + + + - + A containing a short-form + UUID for the advertised service. + + + + + Add a + element. + + - + The Service Class Id of the Bluetooth profile, + as a + + The major version number, as a . + + The minor version number, as a . + + + + + Add a set of custom attribute. + + - + A set of attributes as an + returning + instances. + + + + + Add a set of custom attribute. + + - + A set of attributes as an + returning + instances. + + + + + Add a set of custom attribute. + + - + A set of attributes as an array of + . + + + + + Add a custom attribute. + + - + + Add a custom attribute from a given + + - + An attribute as a + instance. + + + + + Add a custom attribute of simple type. + + - + + If the is a numerical type + then this is equivalent to using + + otherwise the value is used directly in creating the + . + + + - + The Attribute Id as a . + The type of the element as an . + The value for the new element. + + + + Add a custom attribute of simple type. + + - + + If the is a numerical type + then this is equivalent to using + + otherwise the value is used directly in creating the + . + + + - + The Attribute Id as a . + The type of the element as an . + The value for the new element. + + + + Converts a Java JSR 82 Bluetooth server URL into a + instance. + + - + + The authenticate and encrypt and any + related parameters are completely disregarded. When using with + you must take + care to set the required security requirements on it directly. + + This method is intended to read the Service Record (SDP) related items only; + in particular the Service Class ID UUID and Service Name parameters. + It supports only the btspp and btObex schemes and only for + server-side use only. For instance + btspp://localhost:3B9FA89520078C303355AAA694238F08;name=FooBar + and + btgoep://localhost:3B9FA89520078C303355AAA694238F08 + There is no suppport for e.g. + btl2cap://localhost:3B9FA89520078C303355AAA694238F08;name=Aserv + as the library supports only RFCOMM connections currently. + + - + A server-side JSR 82 URL in one of the supported forms. + + - + A + initialised with the supported components of the supplied JSR 82 URL. + + + + + Gets the instance + constructed by the specified instance. + + - + + A that contains + the URI constructed by the . + + - + The + created by the properties is invalid. + For instance, if duplicates attributes are disallowed but duplicates are + present. + + + + + Get or set a value for the + attribute. + + - + When present, a corresponding + attribute will be added too. + + + + + + Get or set a value for the + attribute. + + - + When present, a corresponding + attribute will be added too. + + + + + + Get or set a value for the + attribute. + + - + When present, a corresponding + attribute will be added too. + + + + + + Get or set which type of element will be added for the + attribute. + + - + An instance of the + enumeration. + + - + Supported type are the following: + + + None + No PDL attribute will be added. + + Rfcomm + A standard RFCOMM element will be added. + + Goep + A standard GOEP (OBEX) element will be added. + + + The default is . + + + + + + Holds an SDP service record. + + - + + A Service Record is the top-level container in the Service Discovery + protocol/database. It contains a list of Service Attributes each identified + by a numerical identifier (its ), + and with its data held in a . + has methods to access the + various types of data it contains. + + The content of the record for a particular service class is defined in the + profile’s specification along with the IDs it uses. The IDs for the + common standard services have beed defined here, as e.g. + , + , + etc. The Service Discovery profile itself defines IDs, some that can be used + in any record , + and others + , + and . + + Note that except for the attributes in the “Universal” category + the IDs are not unique, for instance the ID is 0x0200 for both + + and + from + and + respectively. + + provides the normal + collection-type methods properties e.g. + , + , + , + + and . So, to + access a particular attribute’s content get the + using one of those methods + and then read the data from the . + See the example below. + + +   + + + The SDP specification defines the content of TextString element + type very loosely and they are thus very difficult to handle when reading + from a record. + The encoding of the string content is + not set in the specification, and thus implementors are free to use any + encoding they fancy, for instance ASCII, UTF-8, + UTF-16, Windows-1252, etc — all of which have been seen in record + from real devices. It would have been much more sensible to mandate UTF-8 + as the other part of the Bluetooth protocol suite do e.g. the PIN is always + stored as a UTF-8 encoded string. + + Not only that but some of the attributes defined in the SDP specification + can be included in more than one ‘natural language’ version, + and the definition of the language and the string’s encoding + is not included in the element, but is + instead defined in a separate element and the ID of the string attribute + modified. Yikes! + + This makes it near impossible to decode the bytes in + a string element at parse time and create the string object then. Therefore + the parser creates an element containing the raw bytes from the string which + hopefully the user will know how to decode, passing the required encoding + information to one of methods on the element i.e. + , + which takes a multi-language-base item from the same record (see e.g. + ), + + which takes a .NET object, + or , + or + on the record which again takes a multi-language-base item. + + +   + + + A Service Record can be created from the source byte array by using the + + method or the + + on . A record + can also be created from a list of + passed to the constructor + . + + +   + + + From the SDP specification: + + + 2.2 ServiceRecord “… + a list of service attributes.” + 2.3 ServiceAttribute“… + two components: an attribute id and an attribute value.” + 2.4 Attribute ID“… + a 16-bit unsigned integer”, + “…represented as a data element.” + 2.5 Attribute Value“… + a variable length field whose meaning is determined by the attribute ID…”, + “…represented by a data element.” + 3.1 Data Element“… + a typed data representation. + It consists of two fields: a header field and a data field. + The header field, in turn, is composed of two parts: a type descriptor and a size descriptor. + ” + 3.2 Data Element Type Descriptor “… + a 5-bit type descriptor.” + 3.3 Data Element Size Descriptor “… + The data element size descriptor is represented as a + 3-bit size index followed by 0, 8, 16, or 32 bits.” + + + - + + + ServiceRecord record = ... + ServiceAttribute attr = record.GetAttributeById(UniversalAttributeId.ServiceRecordHandle); + ServiceElement element = attr.Value; + if(element.ElementType != ElementType.UInt32) { + throw new FooException("Invalid record content for ServiceRecordHandle"); + } + UInt32 handle = (UInt32)element.Value; + + or + + Dim bppRecord As ServiceRecord = ... + Dim attr As ServiceAttribute = bppRecord.GetAttributeById(BasicPrintingProfileAttributeId.PrinterName) + Dim element As ServiceElement = attr.Value; + ' Spec say it is in UTF-8 + Dim printerName As String = element.GetValueAsStringUtf8() + + + + + + + + + + + + + + + Initializes a new instance of the + class + containing no s. + + + + + Initializes a new instance of the + class. + + ---- + + Initializes a new instance of the + class + with the specified set of s. + + - + The list of + to add to the record, + as an + of . + + + + + Initializes a new instance of the + class + with the specified set of s. + + - + The list of + to add to the record, + as an array of . + + + + + Create a by parsing + the given array of . + + - + This uses the + with its default settings. + See + for more information. In particular for the errors that can result, two + of which are listed here. + + - + A byte array containing the encoded Service Record. + + - + The new parsed from the byte array. + + - + + The record contains invalid content. + + + The record contains an element type not supported by the parser. + + - + + + + + Gets the attribute at the specified index. + + - + The zero-based index of the attribute to get. + - + A holding + the attribute at the specified index. + Is never . + + - + + index is less than 0. + -or- + index is equal to or greater than Count. + + + + + Determines whether a service attribute with the specified ID, + and optional natural language, is in the List. + + - + + Determines whether a service attribute with the specified ID is in the List. + + - + The id of the service attribute to locate, as a + . + - + true if item is found in the record; otherwise, false. + + + + Returns the attribute with the given ID. + + - + + Returns the attribute with the given ID. + + - + The Attribute Id as a . + - + A holding + the attribute with the specified ID. + Is never . + + - + + There is no attribute with the given Id in the record. + Throws in NETCFv1 + + + + + Determines whether a TextString service attribute with the specified ID + and natural language + is in the List. + + - + The id of the service attribute to locate, as a + . + + Which multi-language version of the string attribute to locate. + + - + true if item is found in the record; otherwise, false. + + + + Returns the attribute with the given ID and natural language. + + - + The id of the service attribute to locate, as a + . + + Which multi-language version of the string attribute to locate. + + - + A holding + the attribute with the specified ID and language. + Is never . + + - + + There is no attribute with the given Id with the given language base in the record. + + + + + Create the attribute id resulting for adding the language base attribute id. + + - + The result . + - + + added to the + would create an id that cannot be represented as an Attribute Id. + + + + + Gets a containing the value of the + + service attribute with the specified ID, + using the specified natural language. + + - + + As noted in the documentation on this class, string are defined in + an odd manner, and the multi-language strings defined in the base SDP + specification are defined in a very very odd manner. The natural language and the + string’s encoding are not included in the element, but instead are + defined in a separate element, and the ID of the string attribute is + modified. This pair is present for each natural language. + + This method is provided to simplify accessing those strings, given + the Language attribute it should use it to find and decode the string. + If the primary Language attribute is to be used, then use the + + method that takes only the id parameter. + + + - + The id of the service attribute to locate, as a + . + + Which multi-language version of the string attribute to locate. + + - + + There is no attribute with the given Id in the record. + Throws in NETCFv1 + + + The service element is not of type + . + + + If the value in the service element is not a valid string in the encoding + specified in the given . + + - + + C#: + + LanguageBaseItem primaryLang = record.GetPrimaryLanguageBaseItem(); + if (primaryLang == null) { + Console.WriteLine("Primary multi-language not present, would have to guess the string's encoding."); + return; + } + try { + String sn = record.GetMultiLanguageStringAttributeById(UniversalAttributeId.ServiceName, primaryLang); + Console.WriteLine("ServiceName: " + sn); + } catch (KeyNotFoundException) { + Console.WriteLine("The record has no ServiceName Attribute."); + } + + + + + + Gets a containing the value of the + + service attribute with the specified ID, + using the primary natural language. + + - + + As noted in the documentation on this class, string are defined in + an odd manner, and the multi-language strings defined in the base SDP + specification are defined in a very very odd manner. The natural language and the + string’s encoding are not included in the element, but instead are + defined in a separate element, and the ID of the string attribute is + modified. This pair is present for each natural language. + + This method is provided to simplify accessing those strings, it will + find the primary Language attribute and use it to find and decode the string. + And if there is no primary Language attribute, which is the case in many + of the records one sees on mobile phones, it will attempt the operation + assuming the string is encoded in UTF-8 (or ASCII). + + + - + The id of the service attribute to locate, as a + . + - + + There is no attribute with the given Id in the record. + Throws in NETCFv1 + + + The service element is not of type + . + + + If the value in the service element is not a valid string in the encoding + specified in the given . + + - + + C#: + + try { + String sn = record.GetMultiLanguageStringAttributeById(UniversalAttributeId.ServiceName); + Console.WriteLine("ServiceName: " + sn); + } catch (KeyNotFoundException) { + Console.WriteLine("The record has no ServiceName Attribute."); + } + + + + + + Gets the list of LanguageBaseAttributeId items in the service record. + + - + + See also . + + - + + An array of . + An array of length zero is returned if the service record contains no such attribute. + + - + + + + + Gets the primary LanguageBaseAttributeId item in the service record. + + - + + For instance, can be used with methods + , + and + etc. See example code in the first. + + - + + A , or null + if the service record contains no such attribute, or + no primary language item (one with Base Id 0x0100) is included. + + - + + + + + Gets an enumerator that can be used to navigate through the record's + list of s. + + - + An + of type . + + - + + In C#: + + foreach (ServiceAttribute curAttr in record) { + if (curAttr.Id == UniversalAttributeId.ProtocolDescriptorList) { + ... + } + + In Visual Basic: + + For Each curAttr As ServiceAttribute In record + If curAttr.Id = UniversalAttributeId.ProtocolDescriptorList Then + ... + Next + + + + + + Gets an enumerator that can be used to navigate through the record's + list of s. + + + + + Return the byte array representing the service record. + + - + The byte array content is created dynamically from the + instance using + the class. + + - + The result as an array of . + + - + + + + + Gets the count of attributes in the record. + + + + + Gets the attribute at the specified index. + + - + The zero-based index of the attribute to get. + - + A holding + the attribute at the specified index. + - + + index is less than 0. + -or- + index is equal to or greater than Count. + + + + + Get a list of the numerical IDs of the Attributes in the record + as an + of . + + - + + This method will likely be only rarely used: instead + one would generally want either to read a specific attribute using + , + or read every attribute by using + 's + IEnumerable ability e.g. + + For Each curAttr As ServiceAttribute In record + If curAttr.Id = UniversalAttributeId.ProtocolDescriptorList Then + ... + Next + + Note, for NETCFv1 this returns an instance of the non-Generic list + . + + + - + (Provide a pure example since NDocs makes big mess of displaying Generic types). + + In C#: + + IList<ServiceAttributeId> ids = record.GetAttributeIds(); + + In VB.NET: + + Dim ids As IList(Of ServiceAttributeId) = record.GetAttributeIds() + + Or without Generics in .NET 1.1 (NETCFv1) in VB.NET: + + Dim ids As IList = record.GetAttributeIds() + + + + + + Get the raw byte array from which the record was parsed. + + - + + A can be created either by manually building new + s holding new + s, or it can be created + by parsing an array + of bytes read from another machine by e.g. + . + In that case this method returns that source byte array. + + To creates a Service Record byte array from the contained + s use + or . + + + - + + An array of , or if + the record was not created by parsing a raw record. + + - + + + + + A Service Attribute Id identifies each attribute within an SDP service record. + + - + + The content of the record for a particular service class is defined in the + profile’s specification along with the IDs it uses. The IDs for the + common standard services have beed defined here, as e.g. + , + , + etc, see namespace . + The Service Discovery profile itself defines IDs, some that can be used + in any record , + and others + , + and . + + Note that except for the attributes in the “Universal” category + the IDs are not unique, for instance the ID is 0x0200 for both + + and + from + and + respectively. + + + + + + Retrieves the name of the SDP Attribute ID with the given value in the + specified Attribute ID class sets. Implementing -like + behaviour. + + + + + Retrieves the name of the SDP Attribute ID with the given value in the + specified Attribute ID class sets. + + - + + Each particular service (ObexPushProfile, SerialPortProfile) etc defines + its own SDP record content and the Attribute IDs are defined locally in + each, and thus with values overlapping with other service specifications. + Therefore for each profile we must define the set of Attribute IDs used, this + is done by creating a class for each with the IDs defined as const + member fields. + + - + + The Attribute Id as an + + + The set of classes defining Attribute IDs for the service classed contained + in the record containing this attribute id. + + - + + A string containing the name of the Attribute ID whose numerical value is , + or a null reference (Nothing in Visual Basic) if no such constant is found. + + + + + Retrieves the name of the SDP Attribute ID with the given value + and using one of the languages from the supplied LanguageBaseItem + in the specified AttributeID class sets. + + - + + Each particular service (ObexPushProfile, SerialPortProfile) etc defines + its own SDP record content and the Attribute IDs are defined locally in + each, and thus with values overlapping with other service specifications. + Therefore for each profile we must define the set of Attribute IDs used, this + is done by creating a class for each with the IDs defined as const + member fields. + + - + + The Attribute Id as an + + + The set of classes defining Attribute IDs for the service classed contained + in the record containing this attribute id. + + + The list of applying + to the current record. They are used when an attribute is marked as a + multi-language one and thus need the base offset removed from the specified + numerical value. + + + The applicable if the + matched attribute is a multi-language one. + ( in Visual Basic), if no attribute was matched + or it was not a multi-language one. + + - + + A string containing the name of the Attribute ID whose numerical value is , + or a null reference (Nothing in Visual Basic) if no such constant is found. + + + + + Retrieves the name of the SDP Attribute ID with the given value + and using one of the languages from the supplied LanguageBaseItem + in the specified AttributeID class sets + + + + + Indicates that the field to which it is applied represents an SDP Attribute + that can exist in multiple language instances and thus has a language base + offset applied to its numerical ID when added to a record. + + + + + Initializes a new instance of the + class. + + + + + Provides data for an authentication event. + + - + + For usage information, see the class documentation at + it includes + an example, + also see the documentation on each of this class’s properties. + + + + + + A format string to display the Passkey or comparison Number as six decimal digits. + + + + + + + + Initialize an instance of . + + + + + Initialize an instance of . + + - + The device information to store in the event args. + + + + + Creates a positive response to the + + pairing event also providing optional security values. + + - + An byte array of length 16 bytes, or null. + A 128-bit cryptographic key used for two-way authentication. + + An byte array of length 16 bytes, or null. + A randomly generated number used for one-way authentication. + If this number is not provided by the device initiating the OOB + session, this value is 0. + + + + + Gets the device requiring an authentication response as a + . + + + + + Gets a + enumeration value that specifies the 'Man in the Middle' protection + required for authentication. + + + + + Gets a + enumeration value that defines the input/output capabilities of the + Bluetooth device. + + + + + Gets a + enumeration value that defines the authentication method utilized + by the Bluetooth device. + + - + + The method to be used depends on the + and the on both machines. + + + + + + Gets whether the + + method is of subtype "JustWorks". + + - + + Gets whether the + + method is of subtype "JustWorks". + + If true then a simple Yes/No answer from the user is adequate, + Or if false then the . + value should be displayed to the user(s) so that he/she/they can + verify that the values displayed on both devices are the same. + Is null if + + is not + . + + + + + + Get the Numeric or Passcode value being used by the + SSP pairing event. + + - + Is a six digit number from 000000 to 999999, + or if not present. + + - + + Will be present in the + , + , + and + authentication methods only. + + Is a six digit number from 000000 to 999999. + + + + + + Gets the + formatted in its correct six decimal digits format. + + - + A representing + + formatted in its six decimal digits format, + or if + + is . + + + + + Gets or sets the PIN string to be used to authenticate the specified device. + + - + + Is only used in the + + pairing method. + + On an authentication event, a PIN response is sent if the value + returned from the handler is not . + + + + + + Get or set whether we will respond positively, negatively or + ignore the SSP pairing event. + + + + + Get or set what Numeric or Passcode value or whether no value + will be used in responding to the SSP pairing event. + + - + + Is a number from 000000 to 999999, or null if not to be included + in the response. + + + + + + Gets or sets whether the callback is called again after the PIN response + is sent. + + - + This is useful to see the error code returned by sending + the PIN response. It can thus also be used to see the successful result + of sending the PIN response. See the documentation on the + class. + + + + + + Gets how many attempts at sending a PIN have been tried. + + + When there’s a new PIN request, the first time the callback is + called this property will have value zero. If the PIN is rejected and + + was set, then the callback will be recalled and this property will have + value one, etc. + + + + + The Windows error code returned by the last PIN response attempt. + + - + A bad PIN/passcode value appears to result in a error code + with value 1244, which is . + + If one tries to respond to that failure with another passcode, + then error 1167 + results. So it seems that only one attempt is possible. + + + + + + The Windows error code returned by the last PIN response attempt, + as an unsigned value. + + - + See . + + - + + + + + Gets whether it is not possible to send another PIN response. + + For instance, in testing it appears that after one response + the device becomes non-contactable, any PIN response returning error code + . + + + + + + Defines configuration option names for the class. + + + + + On connected socket, triggers authentication. + On not connected socket, forces authentication on connection. + For incoming connection this means that connection is rejected if authentication cannot be performed. + + The optval and optlen parameters are ignored; however, Winsock implementation on Windows CE requires optlen to be at least 4 and optval to point to at least an integer datum. + + + + Toggles authentication under Windows XP. + + optlen=sizeof(ULONG), optval = &(ULONG)TRUE/FALSE + + + + On a connected socket, this command turns encryption on or off. + On an unconnected socket, this forces encryption to be on or off on connection. + For an incoming connection, this means that the connection is rejected if the encryption cannot be turned on. + + + + + This sets or revokes PIN code to use with a connection or socket. + + + + + This sets or revokes link key to use with a connection or peer device. + + + + + Returns link key associated with peer Bluetooth device. + + + + + Get or set the default MTU on Windows XP. + + optlen=sizeof(ULONG), optval = &mtu + + + + This sets default MTU (maximum transmission unit) for connection negotiation. + While allowed for connected socket, it has no effect if the negotiation has already completed. + Setting it on listening socket will propagate the value for all incoming connections. + + + + + Returns MTU (maximum transmission unit). + For connected socket, this is negotiated value, for server (accepting) socket it is MTU proposed for negotiation on connection request. + + + + + Get or set the maximum MTU on Windows XP. + + optlen=sizeof(ULONG), optval = &max. mtu + + + + This sets maximum MTU for connection negotiation. + While allowed for connected socket, it has no effect if the negotiation has already completed. + Setting it on listening socket will propagate the value for all incoming connections. + + + + + Returns maximum MTU acceptable MTU value for a connection on this socket. + Because negotiation has already happened, has little meaning for connected socket. + + + + + Get or set the minimum MTU on Windows XP. + + optlen=sizeof(ULONG), optval = &min. mtu + + + + This sets minimum MTU for connection negotiation. + While allowed for connected socket, it has no effect if the negotiation has already completed. + Setting it on listening socket will propagate the value for all incoming connections. + + + + + Returns minimum MTU acceptable MTU value for a connection on this socket. + Because negotiation has already happened, has little meaning for connected socket. + + + + + This sets XON limit. + Setting it on listening socket will propagate the value for all incoming connections. + + + + + Returns XON limit for a connection. + XON limit is only used for peers that do not support credit-based flow control (mandatory in the Bluetooth Core Specification version 1.1). + When amount of incoming data received, but not read by an application for a given connection grows past this limit, a flow control command is sent to the peer requiring suspension of transmission. + + + + + This sets XOFF limit. + Setting it on listening socket will propagate the value for all incoming connections. + + + + + Returns XOFF limit for a connection. + XOFF limit is only used for peers that do not support credit-based flow control (mandatory in the Bluetooth Core Specification 1.1). + If flow has been suspended because of buffer run-up, when amount of incoming data received, but not read by an application for a given connection falls below this limit, a flow control command is sent to the peer allowing continuation of transmission. + + + + + Specifies maximum amount of data that can be buffered inside RFCOMM (this is amount of data before call to send blocks). + + + + + Returns maximum amount of data that can be buffered inside RFCOMM (this is amount of data before call to send blocks). + + + + + Specifies maximum amount of data that can be buffered for a connection. + This buffer size is used to compute number of credits granted to peer device when credit-based flow control is implemented. + This specifies the maximum amount of data that can be buffered. + + + + + Returns maximum amount of data that can be buffered for a connection. + This buffer size is used to compute number of credits granted to peer device when credit-based flow control is implemented. + This specifies the maximum amount of data that can be buffered. + + + + + Retrieves last v24 and break signals set through MSC command from peer device. + + + + + Retrieves last line status signals set through RLS command from peer device. + + + + + Sends MSC command. V24 and breaks are as specified in RFCOMM Specification. + Only modem signals and breaks can be controlled, RFCOMM reserved fields such as flow control are ignored and should be set to 0. + + + + + Sends RLS command. + Argument is as specified in RFCOMM Specification. + + + + + Gets flow control type on the connected socket. + + + + + Sets the page timeout for the card. + The socket does not have to be connected. + + + + + Gets the current page timeout. + The socket does not have to be connected. + + + + + Sets the scan mode for the card. + The socket does not have to be connected. + + + + + Gets the current scan mode. + The socket does not have to be connected. + + + + + Sets the class of the device. + The socket does not have to be connected. + + + + + Retrieve the Class of Device. + + + + + Get the version information from the Bluetooth adapter. + + + + + Get the version of the remote adapter. + + + + + Retrieves the authentication settings. + The socket does not have to be connected. + + + + + Sets the authentication policy of the device. + + + + + Reads the remote name of the device. + The socket does not have to be connected. + + + + + Retrieves the link policy of the device. + + + + + Sets the link policy for an existing baseband connection. + The socket must be connected. + + + + + Places the ACL connection to the specified peer device in HOLD mode. + The device must be connected. + + + + + Places the ACL connection to the specified peer device in SNIFF mode. + The device must be connected. + + + + + Forces the ACL connection to the peer device to leave SNIFF mode. + The device must be connected. + + + + + Places the ACL connection to the peer device in PARK mode. + The device must be connected. + + + + + Forces the ACL connection to the peer device to leave PARK mode. + The device must be connected. + + + + + Gets the current mode of the connection. + The mode can either be sniff, park, or hold. The socket must be connected. + + + + + + + + + Remove a SDP record as added by . + + The handle. + + The raw record, presumably not actually used by the stack. + + + + + + Add a SDP record. + + - + An array of + containing the complete SDP record. + + A + containing any bits to set in the devices Class of Device value. + + - + A handle representing the record, pass to + to remote the record. + + + + + Managed code dialog for Windows CE systems. + + + + + Clean up any resources being used. + + + + + Required method for Designer support - do not modify + the contents of this method with the code editor. + + + + + Provides an OBEX implementation of the class. + + - + + If you want to transfer an file or other object using the standard + service as used by Windows' Wireless Link / Bluetooth File Transfer Wizard, + Palm's Beam, Nokia's Send via Infrared, then use the OBEX protocol. + + The PUT operation is supported, and there is new support for GET, + (see the documentation at the + property). + Changing folders is not supported, nor is getting a folder listing. + + In the previous version there were some issue with handling file names + that include non-English characters, and connections + to some device types failed. Also if the connection to the peer was lost + then the request could hang reading forever. See the release note and bugs + database for more information. + + + - + + For Bluetooth one can use code like the following to send a file: + (Note a failure is signalled by an exception). + + Dim addr As BluetoothAddress = BluetoothAddress.Parse("002233445566") + Dim path As String = "HelloWorld.txt" + ' + Dim req As New ObexWebRequest(addr, path) + req.ReadFile("Hello World.txt") + Dim rsp As ObexWebResponse = CType(req.GetResponse(),ObexWebResponse) + Console.WriteLine("Response Code: {0} (0x{0:X})", rsp.StatusCode) + + That constructor isn't available for other transports (TCP/IP, IrDA) + so one has to create a Uri to provide the scheme, address, and path + parameters. Thus use code like the following to send a file. + + ' The host part of the URI is the device address, e.g. IrDAAddress.ToString(), + ' and the file part is the OBEX object name. + Dim addr As BluetoothAddress = ... + Dim addrStr As String = addr.ToString("N") + Dim uri As New Uri("obex://" & addrStr & "/HelloWorld.txt") + ' + Dim req As New ObexWebRequest(uri) + req.ReadFile("Hello World.txt") + Dim rsp As ObexWebResponse = CType(req.GetResponse(),ObexWebResponse) + Console.WriteLine("Response Code: {0} (0x{0:X})", rsp.StatusCode) + + Or, to send locally generated content use something like the following. + + Dim addr As BluetoothAddress = ... + Dim path As String = "HelloWorld2.txt" + ' + Dim req As New ObexWebRequest(addr, path) + Using content As Stream = req.GetRequestStream() + ' Using a StreamWriter to write text to the stream... + Using wtr As New StreamWriter(content) + wtr.WriteLine("Hello World GetRequestStream") + wtr.WriteLine("Hello World GetRequestStream 2") + wtr.Flush() + ' Set the Length header value + req.ContentLength = content.Length + End Using + ' In this case closing the StreamWriter also closed the Stream, but ... + End Using + Dim rsp As ObexWebResponse = CType(req.GetResponse(),ObexWebResponse) + Console.WriteLine("Response Code: {0} (0x{0:X})", rsp.StatusCode) + + See also the ObexPushApplication and ObexPushVB sample programs. + + + + + Create a new Obex request with the specified . + + - + + Create a new Obex request with the specified . + + e.g. "obex://112233445566/HelloWorld.txt" + Uri must use one of the following schemes - obex, obex-push, obex-ftp, obex-sync. + The host name must be the device address in short hex, or dotted hex notation - not the default representation using the colon separator + + + + [Advanced usage] + Create a new Obex request with the specified + and the open connection to an OBEX server. + + - + [Advanced usage] + A url of the form + “scheme:///filename”, + “e.g. obex:///foo.txt”. + That is the host part is blank, + and the scheme and filename parts set as for the other constructor + + + An instance of + already connected to an OBEX server. + + + + + Initialize an instance of this class given a scheme, + a Bluetooth Device Address, and a remote path name. + + - + The Uri scheme. One of + obex, obex-push, obex-ftp, or obex-sync. + + The Bluetooth Device Address of the OBEX server. + + The path on the OBEX server. + + + + + Initialize an instance of this class given + a Bluetooth Device Address, and a remote path name. + + - + + This is equivalent to calling + + ObexWebRequest(String scheme, BluetoothAddress target, String path) + + with scheme “obex”. + + + - + The Bluetooth Device Address of the OBEX server. + + The path on the OBEX server. + + + + + Gets a object to use to write request data. + + - + A to use to write request data. + + + + Reads the contents of the specified file to the request stream. + + The filename (including the path) from which to read. + Provides an easy equivalent to manually writing the file contents to the request stream. + + + + Returns the OBEX server response. + + - + An . + - + + An error occurred, with the error that occured being stored in the + property. If the error + occurred in the connect phase then the + property will have value , + and in the operation phase on the desktop CLR it will have value + + + + + + A wrapper for Stream.Read that blocks until the requested number of bytes + have been read, and throw an exception if the stream is closed before that occurs. + + + + + A wrapper for Stream.Read that blocks until the requested number of bytes + have been read or the end of the Stream has been reached. + Returns the number of bytes read. + + + + + Begins a request for a OBEX server response. + + - + An delegate that references the method to invoke when the operation is complete. + A user-defined object containing information about the operation. + This object is passed to the callback delegate when the operation is complete. + - + An that represents the + asynchronous operation, which could still be pending. + + + + + Begins a request for a OBEX server response. + + - + An + object that was obtained when the asynchronous operation was started. + + - + An . + - + + An error occurred, with the error that occured being stored in the + property. If the error + occurred in the connect phase then the + property will have value , + and in the operation phase on the desktop CLR it will have value + + + + + + Specifies a collection of the name/value pairs that make up the OBEX headers. + + + + + Gets or sets the method for the request. + + + For Object Exchange the method code is mapped to the equivalent HTTP style method. + For example "PUT", "GET" etc. "PUT" is the default value. + There is new support for GET as of version 2.5. + + To use GET change the Method to "GET" and you must also use + scheme "obex-ftp" in the URL instead of the usual "obex" + -- unless you know that the default OBEX server you are connecting + supports GET. + + For a PUT sample see the class + documentation. For GET, see below. + + + + + ' The host part of the URI is the device address, e.g. IrDAAddress.ToString(), + ' and the file part is the OBEX object name. + Dim addr As String = "112233445566" + Dim uri As New Uri("obex-ftp://" & addr & "/HelloWorld.txt") + Dim req As New ObexWebRequest(uri) + req.Method = "GET" + Dim rsp As ObexWebResponse = CType(req.GetResponse(), ObexWebResponse) + Console.WriteLine("Response Code: {0} (0x{0:X})", rsp.StatusCode) + Using content As Stream = rsp.GetResponseStream() + ' Using a StreamReader to read text from the stream... + Using rdr As New StreamReader(content) + While True + Dim line As String = rdr.ReadLine() + If line Is Nothing Then Exit While + Console.WriteLine(line) + End While + End Using + End Using + + + + + + + Gets or sets the value of the Type OBEX header. + + + + + Gets or sets the Length OBEX header. + + This property is mandatory, if not set no data will be sent. + If you use the helper method this value is automatically populated with the size of the file that was read. + + + + Not Supported - do not use, this will throw an exception. + + + + + Gets or sets the time-out value for the method. + + - + + In versions 3.2 and earlier this property was ignored on + Windows Mobile. It is now (untested!) supported there, + but not with the Microsoft Bluetooth stack there as it doesn't + support timeouts. + A cunning solution is available let me know of your requirements... + + + - + The number of milliseconds to wait before the request times out. + The default is 50,000 milliseconds (50 seconds). + A value of -1 or 0 represents no time-out. + + + + Gets the original Uniform Resource Identifier (URI) of the request. + + For an ObexPush request the URI will use the "obex://" prefix, followed by the numerical device id in hex format. + The path section of the URI represents the remote filename of the pushed object. Subfolders are not supported. Some devices may only support specific object types e.g. V-Card. + + + + Listens for connections from Bluetooth RFCOMM network clients. + + + The class provides simple methods + that listen for and accept incoming connection requests. New connections + are returned as instances + (on Microsoft Bluetooth stack platforms alone a new + instance can be returned for new connections). + + In the normal case a the listener is initialised with a + holding the Service Class Id on which it is + to accept connections, the listener will automatically create a SDP + Service Record containg that Service Class Id and the port number + (RFCOMM Service Channel Number) that it has started listening on. + The standard usage is thus as follows. + + + Class MyConsts + Shared ReadOnly MyServiceUuid As Guid _ + = New Guid("{00112233-4455-6677-8899-aabbccddeeff}") + End Class + + ... + Dim lsnr As New BluetoothListener(MyConsts.MyServiceUuid) + lsnr.Start() + ' Now accept new connections, perhaps using the thread pool to handle each + Dim conn As New BluetoothClient = lsnr.AcceptBluetoothClient() + Dim peerStream As Stream = conn.GetStream() + ... + + One can also pass the BluetoothListener a Service Name (v2.4), + a custom Service Record (Service Discovery Protocol record), and/or + set Class of Service bit(s). To create a custom Service Record use + . + + There are overloads of the constructor which take a + parameter instead of a + as the Service Class Id, the Class Id + value should be specified in that case in the endpoint. + If the port value is specified in the endpoint, then the listener will + attempt to bind to that port locally. The address in the endpoint is + largely ignored as no current stack supports more than one local radio. + + As of version 3.4 we catch an exception if it occurs on the new + port set-up and it is stored. That error will be returned to any subsequent + Accept; that is we assume that the error affects the listener completely + and so make no attempt to start a new port and all subsequent Accept + complete with the original error. + + In the Bluetopia case previously the 'one port at a time' error + was unhandled and occurred on a background thread and therefore killed + the application. Now it is caught and returned to the next Accept. + Even better the first Accept successfully returns back to the caller. + So BluetoothListener is now usable to that extent: one connection can + be accepted. After that it needs to be discarded and a new server created. + + + + + + Initializes a new instance of the class. + + ---- + + Initializes a new instance of the class + to listen on the specified service identifier. + + The Bluetooth service to listen for. + + + An SDP record is published on successful + to advertise the server. + A generic record is created, containing the essential ServiceClassIdList + and ProtocolDescriptorList attributes. The specified service identifier is + inserted into the former, and the RFCOMM Channel number that the server is + listening on is inserted into the latter. See the Bluetooth SDP specification + for details on the use and format of SDP records. + + If a SDP record with more elements is required, then use + one of the other constructors that takes an SDP record e.g. + , + or when passing it as a byte array + . + The format of the generic record used here is shown there also. + + Call the + method to begin listening for incoming connection attempts. + + + + + + Initializes a new instance of the class + that listens for incoming connection attempts on the specified local Bluetooth address and service identifier. + + A that represents the local Bluetooth radio address. + The Bluetooth service on which to listen for incoming connection attempts. + + + An SDP record is published on successful + to advertise the server. + A generic record is created, containing the essential ServiceClassIdList + and ProtocolDescriptorList attributes. The specified service identifier is + inserted into the former, and the RFCOMM Channel number that the server is + listening on is inserted into the latter. See the Bluetooth SDP specification + for details on the use and format of SDP records. + + If a SDP record with more elements is required, then use + one of the other constructors that takes an SDP record e.g. + , + or when passing it as a byte array, e.g. + . + The format of the generic record used here is shown there also. + + Call the + method to begin listening for incoming connection attempts. + + + + + + Initializes a new instance of the class + with the specified local endpoint. + + - + A that represents + the local endpoint to which to bind the listener. + See the documentation for more information + on the usage of this argument. + + - + + + An SDP record is published on successful + to advertise the server. + A generic record is created, containing the essential ServiceClassIdList + and ProtocolDescriptorList attributes. The specified service identifier is + inserted into the former, and the RFCOMM Channel number that the server is + listening on is inserted into the latter. See the Bluetooth SDP specification + for details on the use and format of SDP records. + + If a SDP record with more elements is required, then use + one of the other constructors that takes an SDP record e.g. + , + or when passing it as a byte array + . + The format of the generic record used here is shown there also. + + Call the + method to begin listening for incoming connection attempts. + + + + + + Initializes a new instance of the class + to listen on the specified service identifier, + publishing the specified SDP record. + + The Bluetooth service to listen for. + Prepared SDP Record to publish. + + The index in the byte array where the RFCOMM Channel Number that the + server is listening on is to be placed. + However the supplied record is now parsed into an + instance, and the channel offset is not used. + + + + The constructors taking the SDP record explicitly (as a byte array) should + only be used if + a specialized SDP record is required. For instance when using one of the + standard profiles. Otherwise use one of the other constructors + e.g. + which create a generic SDP Record from the specified service identifier. + + Instead of passing a byte array containing a hand-built record, + the record can also be built using the + and classes, and + passed to the respective constuctor, e.g. + + + Any useful SDP record will include + a ProtocolDescriptor element containing + the RFCOMM Channel number that the server is listening on, + and a ServiceClassId element containing the service UUIDs. + The record supplied in the parameter + should contain those elements. On successful , + the RFCOMM Channel number that the protocol stack has assigned to the + server is retrieved, and copied into the service record before it is + published. The indicates the location + of the respective byte in the byte array. + + + An example SDP record is as follows. This is actually the format of the + generic record used in the other constructors. For another example see + the code in the ObexListener class. + + // The asterisks note where the Service UUID and the Channel number are + // to be filled in. + byte[] record = new byte[] { + //Element Sequence: + 0x35,0x27, + //UInt16: 0x0001 -- ServiceClassIdList + 0x09,0x00,0x01, + //Element Sequence: + 0x35,0x11, + // UUID128: 00000000-0000-0000-0000-000000000000 -- * Service UUID + 0x1c, + 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, + // + //UInt16: 0x0004 -- ProtocolDescriptorList + 0x09,0x00,0x04, + //Element Sequence: + 0x35,0x0c, + // Element Sequence: + 0x35,0x03, + // UUID16: 0x0100 -- L2CAP + 0x19,0x01,0x00, + // Element Sequence: + 0x35,0x05, + // UUID16: 0x0003 -- RFCOMM + 0x19,0x00,0x03, + // UInt8: 0x00 -- * Channel Number + 0x08,0x00 + }; + + For that record the channelOffset is 40. + + + + + + Initializes a new instance of the class + that listens for incoming connection attempts on the specified local Bluetooth address and service identifier, + publishing the specified SDP record. + + A that represents the local Bluetooth radio address. + The Bluetooth service to listen for. + Prepared SDP Record to publish + + The index in the byte array where the RFCOMM Channel Number that the + server is listening on is to be placed. + However the supplied record is now parsed into an + instance, and the channel offset is not used. + + + + The constructors taking the SDP record explicitly (as a byte array) should + only be used if + a specialized SDP record is required. For instance when using one of the + standard profiles. Otherwise use one of the other constructors + e.g. + which create a generic SDP Record from the specified service identifier. + + Instead of passing a byte array containing a hand-built record, + the record can also be built using the + and classes, and + passed to the respective constuctor, e.g. + + + Any useful SDP record will include + a ProtocolDescriptor element containing + the RFCOMM Channel number that the server is listening on, + and a ServiceClassId element containing the service UUIDs. + The record supplied in the parameter + should contain those elements. On successful , + the RFCOMM Channel number that the protocol stack has assigned to the + server is retrieved, and copied into the service record before it is + published. The indicates the location + of the respective byte in the byte array. + + + An example SDP record is as follows. This is actually the format of the + generic record used in the other constructors. For another example see + the code in the ObexListener class. + + // The asterisks note where the Service UUID and the Channel number are + // to be filled in. + byte[] record = new byte[] { + //Element Sequence: + 0x35,0x27, + //UInt16: 0x0001 -- ServiceClassIdList + 0x09,0x00,0x01, + //Element Sequence: + 0x35,0x11, + // UUID128: 00000000-0000-0000-0000-000000000000 -- * Service UUID + 0x1c, + 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, + // + //UInt16: 0x0004 -- ProtocolDescriptorList + 0x09,0x00,0x04, + //Element Sequence: + 0x35,0x0c, + // Element Sequence: + 0x35,0x03, + // UUID16: 0x0100 -- L2CAP + 0x19,0x01,0x00, + // Element Sequence: + 0x35,0x05, + // UUID16: 0x0003 -- RFCOMM + 0x19,0x00,0x03, + // UInt8: 0x00 -- * Channel Number + 0x08,0x00 + }; + + For that record the channelOffset is 40. + + + + + + Initializes a new instance of the class + with the specified local endpoint, + publishing the specified SDP record. + + - + A that represents + the local endpoint to which to bind the listener. + See the documentation for more information + on the usage of this argument. + + Prepared SDP Record to publish + + The index in the byte array where the RFCOMM Channel Number that the + server is listening on is to be placed. + However the supplied record is now parsed into an + instance, and the channel offset is not used. + + - + + + The constructors taking the SDP record explicitly (as a byte array) should + only be used if + a specialized SDP record is required. For instance when using one of the + standard profiles. Otherwise use one of the other constructors + e.g. + which create a generic SDP Record from the specified service identifier. + + Instead of passing a byte array containing a hand-built record, + the record can also be built using the + and classes, and + passed to the respective constuctor, e.g. + + + Any useful SDP record will include + a ProtocolDescriptor element containing + the RFCOMM Channel number that the server is listening on, + and a ServiceClassId element containing the service UUIDs. + The record supplied in the parameter + should contain those elements. On successful , + the RFCOMM Channel number that the protocol stack has assigned to the + server is retrieved, and copied into the service record before it is + published. The indicates the location + of the respective byte in the byte array. + + + An example SDP record is as follows. This is actually the format of the + generic record used in the other constructors. For another example see + the code in the ObexListener class. + + // The asterisks note where the Service UUID and the Channel number are + // to be filled in. + byte[] record = new byte[] { + //Element Sequence: + 0x35,0x27, + //UInt16: 0x0001 -- ServiceClassIdList + 0x09,0x00,0x01, + //Element Sequence: + 0x35,0x11, + // UUID128: 00000000-0000-0000-0000-000000000000 -- * Service UUID + 0x1c, + 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, + // + //UInt16: 0x0004 -- ProtocolDescriptorList + 0x09,0x00,0x04, + //Element Sequence: + 0x35,0x0c, + // Element Sequence: + 0x35,0x03, + // UUID16: 0x0100 -- L2CAP + 0x19,0x01,0x00, + // Element Sequence: + 0x35,0x05, + // UUID16: 0x0003 -- RFCOMM + 0x19,0x00,0x03, + // UInt8: 0x00 -- * Channel Number + 0x08,0x00 + }; + + For that record the channelOffset is 40. + + + + + + Initializes a new instance of the class + to listen on the specified service identifier, + publishing the specified SDP record. + + - + The Bluetooth service to listen for. + Prepared SDP Record to publish. + - + + + The constructors taking the SDP record explicitly should + only be used if + a specialized SDP record is required. For instance when using one of the + standard profiles. Otherwise use one of the other constructors + e.g. + which create a generic SDP Record from the specified service identifier. + + Any useful SDP record will include + a ProtocolDescriptor element containing + the RFCOMM Channel number that the server is listening on, + and a ServiceClassId element containing the service UUIDs. + The record supplied in the parameter + should contain those elements. On successful , + the RFCOMM Channel number that the protocol stack has assigned to the + server is retrieved, and copied into the service record before it is + published. + + + An example SDP record is as follows. This is actually the format of the + generic record used in the other constructors. For another example see + the code in the ObexListener class. + + private static ServiceRecord CreateBasicRfcommRecord(Guid serviceClassUuid) + { + ServiceElement pdl = ServiceRecordHelper.CreateRfcommProtocolDescriptorList(); + ServiceElement classList = new ServiceElement(ElementType.ElementSequence, + new ServiceElement(ElementType.Uuid128, serviceClassUuid)); + ServiceRecord record = new ServiceRecord( + new ServiceAttribute( + InTheHand.Net.Bluetooth.AttributeIds.UniversalAttributeId.ServiceClassIdList, + classList), + new ServiceAttribute( + InTheHand.Net.Bluetooth.AttributeIds.UniversalAttributeId.ProtocolDescriptorList, + pdl)); + return record; + } + + + + + + + Initializes a new instance of the class + that listens for incoming connection attempts on the specified local Bluetooth address and service identifier, + publishing the specified SDP record. + + - + A that represents the local Bluetooth radio address. + The Bluetooth service to listen for. + Prepared SDP Record to publish + - + + + The constructors taking the SDP record explicitly should + only be used if + a specialized SDP record is required. For instance when using one of the + standard profiles. Otherwise use one of the other constructors + e.g. + which create a generic SDP Record from the specified service identifier. + + Any useful SDP record will include + a ProtocolDescriptor element containing + the RFCOMM Channel number that the server is listening on, + and a ServiceClassId element containing the service UUIDs. + The record supplied in the parameter + should contain those elements. On successful , + the RFCOMM Channel number that the protocol stack has assigned to the + server is retrieved, and copied into the service record before it is + published. + + + An example SDP record is as follows. This is actually the format of the + generic record used in the other constructors. For another example see + the code in the ObexListener class. + + private static ServiceRecord CreateBasicRfcommRecord(Guid serviceClassUuid) + { + ServiceElement pdl = ServiceRecordHelper.CreateRfcommProtocolDescriptorList(); + ServiceElement classList = new ServiceElement(ElementType.ElementSequence, + new ServiceElement(ElementType.Uuid128, serviceClassUuid)); + ServiceRecord record = new ServiceRecord( + new ServiceAttribute( + InTheHand.Net.Bluetooth.AttributeIds.UniversalAttributeId.ServiceClassIdList, + classList), + new ServiceAttribute( + InTheHand.Net.Bluetooth.AttributeIds.UniversalAttributeId.ProtocolDescriptorList, + pdl)); + return record; + } + + + + + + + Initializes a new instance of the class + with the specified local endpoint, + publishing the specified SDP record. + + - + A that represents + the local endpoint to which to bind the listener. + See the documentation for more information + on the usage of this argument. + + Prepared SDP Record to publish + - + + + The constructors taking the SDP record explicitly (as a byte array) should + only be used if + a specialized SDP record is required. For instance when using one of the + standard profiles. Otherwise use one of the other constructors + e.g. + which create a generic SDP Record from the specified service identifier. + + Any useful SDP record will include + a ProtocolDescriptor element containing + the RFCOMM Channel number that the server is listening on, + and a ServiceClassId element containing the service UUIDs. + The record supplied in the parameter + should contain those elements. On successful , + the RFCOMM Channel number that the protocol stack has assigned to the + server is retrieved, and copied into the service record before it is + published. + + + An example SDP record is as follows. This is actually the format of the + generic record used in the other constructors. For another example see + the code in the ObexListener class. + + private static ServiceRecord CreateBasicRfcommRecord(Guid serviceClassUuid) + { + ServiceElement pdl = ServiceRecordHelper.CreateRfcommProtocolDescriptorList(); + ServiceElement classList = new ServiceElement(ElementType.ElementSequence, + new ServiceElement(ElementType.Uuid128, serviceClassUuid)); + ServiceRecord record = new ServiceRecord( + new ServiceAttribute( + InTheHand.Net.Bluetooth.AttributeIds.UniversalAttributeId.ServiceClassIdList, + classList), + new ServiceAttribute( + InTheHand.Net.Bluetooth.AttributeIds.UniversalAttributeId.ProtocolDescriptorList, + pdl)); + return record; + } + + + + + + + Starts listening for incoming connection requests. + + + + + Starts listening for incoming connection requests with a maximum number of pending connection. + + The maximum length of the pending connections queue. + + + + Stops the socket from monitoring connections. + + + + + Begins an asynchronous operation to accept an incoming connection attempt. + + - + + The method is only supported on Microsoft Bluetooth stack platforms. + + + - + An delegate that references the method to invoke when the operation is complete. + A user-defined object containing information about the accept operation. + This object is passed to the callback delegate when the operation is complete. + - + An that represents the + asynchronous accept, which could still be pending. + + - + The has been closed. + + + + Asynchronously accepts an incoming connection attempt and creates a new to handle remote host communication. + + An returned by a call to the method. + A . + + + + Begins an asynchronous operation to accept an incoming connection attempt. + + - + An delegate that references the method to invoke when the operation is complete. + A user-defined object containing information about the accept operation. + This object is passed to the callback delegate when the operation is complete. + - + An that represents the + asynchronous accept, which could still be pending. + + + + + Asynchronously accepts an incoming connection attempt and creates a new to handle remote host communication. + + An returned by a call to the method. + A . + + + + Creates a new socket for a connection. + + - + + The method is only supported on Microsoft Bluetooth stack platforms. + + AcceptSocket is a blocking method that returns a that you can use to send and receive data. + If you want to avoid blocking, use the method to determine if connection requests are available in the incoming connection queue. + + The returned is initialized with the address and channel number of the remote device. + You can use any of the Send and Receive methods available in the class to communicate with the remote device. + When you are finished using the , be sure to call its method. + If your application is relatively simple, consider using the method rather than the AcceptSocket method. + provides you with simple methods for sending and receiving data over a network in blocking synchronous mode. + A used to send and receive data. + Listener is stopped. + + + + Creates a client object for a connection when the specified service or endpoint is detected by the listener component. + + AcceptTcpClient is a blocking method that returns a that you can use to send and receive data. + Use the method to determine if connection requests are available in the incoming connection queue if you want to avoid blocking. + Use the method to obtain the underlying of the returned . + The will provide you with methods for sending and receiving with the remote host. + When you are through with the , be sure to call its method. + If you want greater flexibility than a offers, consider using . + A component. + Listener is stopped. + + + + Determines if there is a connection pending. + + true if there is a connection pending; otherwise, false. + + + + Set or change the PIN to be used with a specific remote device. + + Address of Bluetooth device. + PIN string consisting of 1 to 16 ASCII characters. + Assigning null (Nothing in VB) or an empty String will revoke the PIN. + + + + Gets the local endpoint. + + - + The + that the listener is using for communications. + + - + + The + property of the endpoint will contain the port number (RFCOMM Channel + Number) that the listener is listening on. + On some platforms, the + is similarly set, or is + if not known. The endpoint’s + is never set. + + + + + + Get or set the Service Class flags that this service adds to the host + device’s Class Of Device field. + + - + + The Class of Device value contains a Device part which describes + the primary service that the device provides, and a Service part which + is a set of flags indicating all the service types that the device supports, + e.g. , + , + etc. + This property supports setting those flags; bits set in this value will be + added to the host device’s CoD Service Class bits when the listener + is active. For Win32 see MSDN — BTH_SET_SERVICE Structure + + Supported on Win32, but not supported on WindowsMobile/WinCE + as there's no native API for it. The WindowCE section of MSDN mentions the + Registry value COD at key HKEY_LOCAL_MACHINE\Software\Microsoft\Bluetooth\sys. + However my (Jam) has value 0x920100 there but advertises a CoD of 0x100114, + so its not clear how the values relate to each other. + + + + + + + Get or set the ServiceName the server will use in its SDP Record. + + - + A string representing the value to be used for the Service Name + SDP Attribute. Will be if not specfied. + + - + + The listener is already started. + - or - + A custom Service Record was given at initialization time. In that case + the ServiceName attribute should be added to that record. + + + + + Gets the underlying network . + + - + The underlying network . + - + + The property is only supported on Microsoft Bluetooth stack platforms. + + creates a to listen for incoming client connection requests. + Classes deriving from can use this property to get this . + Use the underlying returned by the property if you require access beyond that which provides. + + Note property only returns the used to listen for incoming client connection requests. + Use the method to accept a pending connection request and obtain a for sending and receiving data. + You can also use the method to accept a pending connection request and obtain a for sending and receiving data. + + + + + + Returns the SDP Service Record for this service. + + + Returns if the listener is not + ed + (and an record wasn’t supplied at initialization). + + + + + + Gets or sets the authentication state of the current connect or behaviour to use when connection is established. + + + For disconnected sockets, specifies that authentication is required in order for a connect or accept operation to complete successfully. + Setting this option actively initiates authentication during connection establishment, if the two Bluetooth devices were not previously authenticated. + The user interface for passkey exchange, if necessary, is provided by the operating system outside the application context. + For outgoing connections that require authentication, the connect operation fails with WSAEACCES if authentication is not successful. + In response, the application may prompt the user to authenticate the two Bluetooth devices before connection. + For incoming connections, the connection is rejected if authentication cannot be established and returns a WSAEHOSTDOWN error. + + + + + On unconnected sockets, enforces encryption to establish a connection. + Encryption is only available for authenticated connections. + For incoming connections, a connection for which encryption cannot be established is automatically rejected and returns WSAEHOSTDOWN as the error. + For outgoing connections, the connect function fails with WSAEACCES if encryption cannot be established. + In response, the application may prompt the user to authenticate the two Bluetooth devices before connection. + + + + + Provides information about an available device obtained by the client during device discovery. + + + + + Initializes an instance of the class + for the device with the given address. + + - + The . + + + + Forces the system to refresh the device information. + + - + + See + for one reason why this method is necessary. + + + + + Updates the device name used to display the device, affects the local computer cache. + + On Windows CE this only affects devices which are already paired. + + + + Enables or disables services for a Bluetooth device. + + The service GUID on the remote device. + Service state - TRUE to enable the service, FALSE to disable it. + + When called on Windows CE, the device will require a soft-reset to enabled the settings. + + + The system maintains a mapping of service guids to supported drivers for + Bluetooth-enabled devices. Enabling a service installs the corresponding + device driver. Disabling a service removes the corresponding device driver. + If a non-supported service is enabled, a driver will not be installed. + + + This overload is silent on error; the other overload raises an exception + if required + (). + + + - + + Thrown if this method is called on Windows CE platforms. + + + + Enables or disables services for a Bluetooth device. + + The service GUID on the remote device. + Service state - TRUE to enable the service, FALSE to disable it. + Whether the method should raise an exception + when + + + When called on Windows CE, the device will require a soft-reset to enabled the settings. + + The system maintains a mapping of service guids to supported drivers for + Bluetooth-enabled devices. Enabling a service installs the corresponding + device driver. Disabling a service removes the corresponding device driver. + If a non-supported service is enabled, a driver will not be installed. + + + + - + The call failed. + + + + + Run an SDP query on the device’s Service Discovery Database. + + - + + + For instance to see whether the device has an an Serial Port service + search for UUID , + or too find all the services that use RFCOMM use + , + or all the services use + . + + + If the device isn’t accessible a + with + 10108 (0x277C) occurs. + + + - + The UUID to search for, as a . + + - + The parsed record as an + . + + - + + + Dim bdi As BluetoothDeviceInfo = ... + Dim records As ServiceRecord() = bdi.GetServiceRecords(BluetoothService.RFCommProtocol) + ' Dump each to console + For Each curRecord As ServiceRecord In records + ServiceRecordUtilities.Dump(Console.Out, curRecord) + Next + + + + - + + The query failed. + + + + + Begins an asynchronous Service Record lookup query. + + - + See . + + An optional asynchronous callback, to be called + when the query is complete. + + A user-provided object that distinguishes this + particular asynchronous Service Record lookup query from other requests. + + - + An that represents the + asynchronous Service Record lookup query, which could still be pending. + + + + + Ends an asynchronous Service Record lookup query. + + - + An + object that was obtained when the asynchronous operation was started. + + - + The parsed record as an + . + + + + + Run an SDP query on the device’s Service Discovery Database, + returning the raw byte rather than a parsed record. + + - + + If the device isn’t accessible a + with + 10108 (0x277C) occurs. + + - + The UUID to search for, as a . + + - + An array of array of . + - + + The query failed. + + + + + Gets the radio version and manufacturer information for the device. + Needs a connection to the device. + + - + + Includes information such as the LMP versions, supported + features and the manufacturer of the radio/Bluetooth Controller. + + If the device is not connected this information cannot be + obtained; an error will occur if there is no connection. + The values will be cached until is called. + + This feature is currently supported only on the + Microsoft Bluetooth stack on both desktop Windows and Windows + Mobile. However Windows XP does not provide this information. + Implementation is possible on some of the other Bluetooth stacks + and will depend on demand/support for the user community. + + + - + + An error occurred, desktop Windows returns error code + 1167 ERROR_DEVICE_NOT_CONNECTED and Windows Mobile returns error code + 1168 ERROR_NOT_FOUND. + Windows XP which does not support this functionality returns error code + 2 ERROR_FILE_NOT_FOUND. + + + Not yet implemented. + + + This stack does not support getting this information. + + - + The radio version etc information as a + instance. + + + + + Displays information about the device. + + + + + Compares two instances for equality. + + - + The + to compare with the current instance. + + - + true if + is a and equal to the current instance; + otherwise, false. + + + + + E.g. used internally by WPF. + + + + + + + Returns the hash code for this instance. + + A hash code for the current object. + + + + Gets the device identifier. + + + + + Gets a name of a device. + + - + + Note, that due the way in which Bluetooth device discovery works, + the existence and address of a device is known first, but a separate + query has to be carried out to find whether the device also has a name. + This means that if a device is discovered afresh then this property might + return only a text version of the device’s address and not its + name, one can also see this in the Windows’ Bluetooth device dialogs + where the device appears first with its address and the name is later + updated. To see the name, wait for some time and access this property again + having called + in the meantime. + + + + + + Returns the Class of Device of the remote device. + + - + + + Some CE 4.2 devices such as original PPC2003 devices don't have the native + API on which this property depends — it was added as part of a hotfix. + The property will always return zero in such a case. On WM/CE we also + attempt to get the CoD value as part of the discovery process; this is + of course only works for devices in-range. + + + + + + Returns the signal strength for the Bluetooth connection with the peer device. + Supports only on some platforms. + + - + Valid values for this property are -128 to 128. It returns + Int32.MinValue on failure. + + - + + Thus there are multiple reasons which this property can return + the error value (i.e. Int32.MinValue). + + + On an unsupported platform, e.g. MSFT+Win32, or MSFT+CE/WM on an + older version. See below. + + The remote device is not turned-on or in range. See below. + + On Widcomm, there is no connection to the remote device. See below. + + + + Platform support: + + Does not work on Win32 with the Microsoft Bluetooth stack. + That platform provide no support for RSSI, please contact Microsoft + to complain. + + Works on Windows Mobile 5.0, Windows Embedded CE 6.0, or later + versions. + + Works on Widcomm, both platforms. + We will not try to connect, see below. + + + + + + Finally, to get an RSSI value Bluetooth requires an open + connection to the peer device. + On Widcomm we will not attempt to connect, so the caller must + ensure that there's a connection -- + perhaps it could call + just before accessing this property. + On CE/WM if there is no active connection, then we will attempt to + create one. This of course can be slow, and will + be slow if the remote device is not in range. + (Bluetooth 2.1 supports getting the RSSI value at discovery time which + might provide the solution for many cases. However only the MSFT+Win32 + stack specifically supports v2.1, and of course it doesn't support RSSI + at all!) + + Note that the Bluetooth specification doesn't require that the + radio hardware provides any great precision in its RSSI readings. + The spec says for instance, in v2.1 Volume 2 Part E ("HCI") Section 7.5.4: + “Note: how accurate the dB values will be depends on the Bluetooth hardware. + The only requirements for the hardware are that the Bluetooth device is able to + tell whether the RSSI is inside, above or below the Golden Device Power Range.” + + + + + + Returns a list of services which are already installed for use on the calling machine. + + + This property returns the services already configured for use. + Those are the ones that are checked in the “Services” tab + of the device’s property sheet in the Bluetooth Control panel. + I presume the behaviour is similar on CE. + + Will only return available services for paired devices. + + It of course will also only returns standard system services which Windows understands. + (On desktop Windows this method calls the OS function BluetoothEnumerateInstalledServices). + + To see all the services that a device advertises use the + + method. + + + + + + Specifies whether the device is connected. + + Not supported under Windows CE and will always return false. + + + + + + Specifies whether the device is a remembered device. Not all remembered devices are authenticated. + + - + Now supported under Windows CE — will return the same as + . + + + + + + + Specifies whether the device is authenticated, paired, or bonded. All authenticated devices are remembered. + + Is now supported on both CE and XP. + + + + + + Date and Time this device was last seen by the system. + + - + Is set by the Inquiry (Device Discovery) process on + the stacks where we handle Inquiry directly — that is + every platform except the Microsoft stack on Win32 (MSFT+Win32), + so is supported under MSFT+WM, Widcomm, Bluetopia, etc, etc. + + This value is supported on Windows 7 with the Microsoft stack. + It it not supported on earlier Win32 versions as the native + API has a bug. The value provided is always simply the current + time, e.g. after a discovery for every device returned this value has + the time of the discovery operation. Tracked by workitem + 10280. + + + - + + An instance of containing the time in UTC, + or DateTime. + if there's no value. + + + + + Date and Time this device was last used by the system. + + - + + Not supported on most stacks: Widcomm, Bluetopia, MSFT+WM + and will return DateTime.MinValue + + Is supported on Windows 7 with the Microsoft stack. Is not + supported on earlier Win32 versions — there it just always + returns the current time, see . + + + - + + An instance of containing the time in UTC, + or DateTime. + if there's no value. + + + + + Class of Device flags as assigned in the Bluetooth specifications. + + + Is returned by the property ClassOfDevice.Device. + + Defined in Bluetooth Specifications . + + + + + + Miscellaneous — + [Ref #2: Used where a more specific Major Device Class code + is not suited (but only as specified in this document). Devices + that do not have a major class code assigned can use the all-1 code + () + until 'classified'] + + + + + Major class: Computer (desktop,notebook, PDA, organizers, .... ). + + + + + Major class: Computer + • Minor class: Desktop workstation. + + + + + Major class: Computer + • Minor class: Server-class computer. + + + + + Major class: Computer + • Minor class: Laptop. + + + + + Major class: Computer + • Minor class: Handheld PC/PDA (clam shell). + + + + + Major class: Computer + • Minor class: Palm sized PC/PDA. + + + + + Major class: Computer + • Minor class: Wearable computer (Watch sized). + + + + + Major class: Phone (cellular, cordless, payphone, modem, ...). + + + + + Major class: Phone + • Minor class: Cellular. + + + + + Major class: Phone + • Minor class: Cordlss. + + + + + Major class: Phone + • Minor class: Smart phone. + + + + + Major class: Phone + • Minor class: Wired modem or voice gateway. + + + + + Major class: Phone + • Minor class: Common ISDN Access. + + + + + Major class: LAN /Network Access point. + + + + + Major class: Audio/Video (headset,speaker,stereo, video display, vcr..... + + + + + Major class: Peripheral (mouse, joystick, keyboards, ..... ). + + + + + Major class: Imaging (printing, scanner, camera, display, ...). + + + + + Major class: Wearable. + + + + + Major class: Toy. + + + + + Major class: Medical. + + + + + Uncategorized, specific device code not specified + — see + + + + + + + + Service Attribute IDs defined by the OBEX related specifications, + i.e. Object Push and Synchronization Profiles specifications. + + + + + GOEP L2Cap PSM + + + New in GOEP v2.0 but not numbered there. + New in OPP v1.2, FTP v1.2, and BIP v1.1. + [UInt16] + + + + + Supported Data Stores List (Synchronization Profile) + + + Synchronization Profile — + + service class. + [Data Element Sequence of UInt8] + + Values + ValueMeaning + 0x01Phonebook + 0x03Calendar + 0x05Notes + 0x06Message + + + + + + Supported Formats List (Object Push Profile) + + + Object Push Profile — + + service class. + [Data Element Sequence of UInt8] + + Values + ValueMeaning + 0x01vCard 2.1 + 0x02vCard 3.0 + 0x03vCard 2.1 + 0x04vCal 1.0 + 0x05vNote + 0x06vMessage + 0xFFany type of object + + + + + + Supported Capabilities (BIP) + + + Basic Imaging Profile — + , + , + , + + service classes. + [UInt8] + + Values + ValueMeaning + Bit 0Generic imaging + Bit 1Capturing + Bit 2Printing + Bit 3Displaying + Bit 4..7Reserved + + + + + + Supported Features (BIP) + + + Basic Imaging Profile — + , + , + , + + service classes. + [UInt16] + + Values + ValueMeaning + Bit 0ImagePush + Bit 1ImagePush-Store + Bit 2ImagePush-Print + Bit 3ImagePush-Display + Bit 4ImagePull + Bit 5AdvancedImagePrinting + Bit 6AutomaticArchive + Bit 7RemoteCamera + Bit 8RemoteDisplay + Bit 9..15Reserved + + + + + + Supported Functions (BIP) + + + Basic Imaging Profile — + , + , + , + + service classes. + [UInt32] + + Values + ValueMeaning + Bit 0GetCapabilities + Bit 1PutImage + Bit 2PutLinkedAttachment + Bit 3PutLinkedThumbnail + Bit 4RemoteDisplay + Bit 5GetImagesList + Bit 6GetImageProperties + Bit 7GetImage + Bit 8GetLinkedThumbnail + Bit 9GetLinkedAttachment + Bit 10DeleteImage + Bit 11StartPrint + Bit 12Reserved + Bit 13StartArchive + Bit 14GetMonitoringImage + Bit 16GetStatus + Bit 15, 17..31Reserved + + + + + + Total Imaging Data Capacity (BIP) + + + Basic Imaging Profile — + , + , + , + + service classes. + [UInt64] + + + + + Service Attribute IDs defined by the Basic Printing Profile specification. + + + + + Document Formats Supported + + [String] + + + + Character Repertoires Supported + + [UInt128] + + + + XHTML-Print Image Formats Supported + + [String] + + + + Color Supported + + [Boolean] + + + + 1284ID + + [String] + + + + Printer Name + + [String] + + + + Printer Location + + [String] + + + + Duplex Supported + + [Boolean] + + + + Media Types Supported + + [String] + + + + MaxMediaWidth + + [UInt16] + + + + MaxMediaLength + + [UInt16] + + + + Enhanced Layout Supported + + [Boolean] + + + + RUI Formats Supported + + [String] + + + + Reference Printing RUI Supported + + [Boolean] + + + + Direct Printing RUI Supported + + [Boolean] + + + + Reference Printing Top URL + + [URL] + + + + Direct Printing Top URL + + [URL] + + + + Printer Admin RUI Top URL + + [URL] + + + + Device Name + + [String] + + + + Service Attribute IDs defined by the Personal Area Networking Profile specification. + PersonalAreaNetworkingProfile + + + + Security Description + + “Security Description” [UInt16] + + + + NetAccessType + + “Type of Network Access Available” [UInt16] + + + + MaxNetAccessRate + + “Maximum possible Network Access Data Rate” [UInt32] + + + + IPv4Subnet + + [String] + + + + IPv6Subnet + + [String] + + + + Service Attribute IDs defined by the Headset Profile specification. + + + + + Remote audio volume control + + [Boolean] + + + + Service Attribute IDs defined by the Hand-Free Profile specification. + HandFreeProfile + + + + Network + + + “The "Network" attribute states, if the AG has the capability + to reject incoming calls[4]. This attribute is not encoded as a data element + sequence; it is simply an 8-bit unsigned integer. The information given + in the “Network” attribute shall be the same as the information given + in Bit 5 of the unsolicited result code +BRSF (see Section 4.24.3). An + attribute value of 0x00 is translated to a bit value of 0; an attribute + value of 0x01 is translated to a bit value of 1.” + + [UInt8] + + + + + SupportedFeatures + + + “The attribute “SupportedFeatures” states the features + supported in each device. … + The set of features supported in each case is bit-wise defined in this + attribute on a yes/no basis. The mapping between the features and their + corresponding bits within the attribute is listed below in for the HF + and in for the AG. … + + Bit Feature Default in HF + (0=LSB) + 0 EC and/or NR function (yes/no, 1 = yes, 0 = no) 0 + 1 Call waiting and three way calling(yes/no, 1 = yes, 0 = no) 0 + 2 CLI presentation capability (yes/no, 1 = yes, 0 = no) 0 + 3 Voice recognition activation (yes/no, 1= yes, 0 = no) 0 + 4 Remote volume control (yes/no, 1 = yes, 0 = no) 0 + + Table 5.2 “SupportedFeatures” attribute bit mapping for the HF + + Bit Feature Default in AG + (0=LSB) + 0 Three-way calling (yes/no, 1 = yes, 0 = no) 1 + 1 EC and/or NR function (yes/no, 1 = yes, 0 = no) 0 + 2 Voice recognition function (yes/no, 1 = yes, 0 = no) 0 + 3 In-band ring tone capability (yes/no, 1 = yes, 0 = no) 1 + 4 Attach a phone number to a voice tag (yes/no, 1 = yes, 0 = no) 0 + + Table 5.4 “SupportedFeatures” attribute bit mapping for the AG” + + [UInt16] + + + + Service Attribute IDs defined by the Health Device Profile specification. + + + + + SupportFeaturesList + + - + + "This is a sequence for which each element is a sequence that + describes a single application data end-point on the device. The + Supported Features attribute (MDEP List) provides an indication of + the data types that an MDEP supports.", + "...each description is itself a sequence of three or more elements." + + [Sequence] + + + + + DataExchangeSpecification + + - + + "This attribute is a one-byte reference, with the value taken + from the Bluetooth Assigned Numbers [3] to identify the Data Exchange + Protocol used (e.g. ISO/IEEE 11073-20601 specification)." + e.g. value 0x01 is ISO/IEEE 11073-20601, "Health informatics - Personal + health device communication - Application profile - Optimized exchange + protocol" + + [UInt8] + + + + + MCAP Supported Procedures + + - + + "This attribute is a one byte bit-mask that indicates the MCAP + procedures that are supported by this HDP service." + + + 0x02 Supports Reconnect Initiation 3 + 0x04 Supports Reconnect Acceptance 4 + 0x08 Supports Clock Synchronization Protocol (includes support for at least Sync-Slave Role) + 0x10 Supports Sync-Master Role + + [UInt8] + + + + + Provides access to the request and response objects used by the class. + + + + + Gets the that represents a client's request for a resource + + + + + Specifies additional protocols that the class supports. + + + These constants are defined by the Bluetooth SIG - + + + + + + Service Discovery Protocol (bt-sdp) + + + + + Bluetooth RFComm protocol (bt-rfcomm) + + + + + Logical Link Control and Adaptation Protocol (bt-l2cap) + + + + + Socket option constants to set IrDA specific connection modes, and + get/set IrDA specific features. + + + Socket option constants to set IrDA specific connection modes, and + get/set IrDA specific features: + for instance to set IrLMP mode, or get the maximum send size. Pass + to /etc and + /etc, + along with optionLevel IrDASocketOptionLevel.; + see the examples below. + New in v1.5.51015 + + For instance, where cli is an instance of + . + In VB.NET, to set IrLMP mode (IrLptMode). + + cli.Client.SetSocketOption(IrDASocketOptionLevel.Irlmp, _ + IrDASocketOptionName.IrLptMode, _ + 1) 'representing true; can use True itself in FXv2. + + In C#, to retrieve the maximum send size. + + int maxSendSize = (int)cli.Client.GetSocketOption( + IrDASocketOptionLevel.Irlmp, + IrDASocketOptionName.SendPduLength); + + + + + + Gets the list of discovered devices. + Is used internally by IrDAClient.DiscoverDevices. + + + In native terms takes a DEVICE_LIST struct. + + + + + Sets an entry in the local IAS (Information Access Service) database. + + + In native terms takes a IAS_SET struct. + + + + + Queries an entry in the peer's IAS (Information Access Service) database. + + + In native terms takes a IAS_QUERY struct. + + + + + Retrieve the maximum send size when using IrLMP directly + (). + IrLMP requires sent data to fit in one frame. + + + Integer + + + + + Restricts the link to one application-level (IrLMP) connection; + for use when low latency is required. + Returns an error on all tested platforms. + + + Returns an error on all tested platforms. Boolean + + + + + Sets IrLMP mode, disabling TinyTP. Used for instance when + printing with IrLPT. + + + On Windows NT platforms at least, is ignored on server-side sockets. + Boolean + + + + + Sets IrCOMM 9-Wire/Cooked mode. Used for instance when connecting + to the modem in a mobile phone (service name IrDA:IrCOMM). + + + In operation, received IrCOMM control information is discarded and + null information is sent. + Boolean + + + + + Reportedly sets non-IrDA Sharp ASK mode on the Windows CE + platform. Presence unverified. + + + + + Holds an SDP data element. + + - + + A Service Element hold the data in a SDP Service Record. It can + hold various types of data, being like the ‘variant’ type in some + environments. Each in + a holds its content in a + Service Element. + + The types currently defined in the Service Discovery specification + include unsigned and signed integers + of various sizes (8-bit, 16-bit etc), UUIDs in the full 128-bit form or + in the 16 and 32-bit forms, TextString, Url etc. An element can itself + also contain a list of element, either as a ‘sequence’ or an + ‘alternative’, and thus an attribute can contain a tree of values, + e.g. as used by the + + attribute. + + The type that an element is holding can be accessed with the + and + properties which + are of type and + respectively, the former being + the ‘major’ type e.g. + , and + the latter the ‘minor’ type e.g. + . + + The element's value can be accessed in various ways, either directly + in its internal form through its + property. It has return type so the value + will have to be cast before use, see the UInt16 example below. There + are also a number of type-specific methods, e.g. + , + , + + etc. Each will throw an + if the element is not of a suitable type. The complete set is: + + + Access method, or .NET Type for direct access + + Nil + + + Uint8 + Uint16 + Uint32 + Uint64Currently unsupported. + Uint128Currently unsupported. + + Int8 + Int16 + Int32 + Int64Currently unsupported. + Int128Currently unsupported. + + Uuid16Via , or as + Uuid32Via , or as + Uuid128Via + + TextStringWith + + or etc. + The underlying value can be an array of bytes, or as a + the will set an + array of bytes, whereas a manually created record will likely contain a + . + + + Boolean + + ElementSequenceWith + or + + + ElementSequence-"- + + UrlVia , + can be stored interally as or as an array of bytes + + + + Note that there are no access + methods for the numeric type for instance so the + property will have + to be used e.g. + + // ElementType is UInt16 + ushort x = (ushort)element.Value; + + or + + // ElementType is UInt16 + Dim x As UShort = CUShort(element.Value); + + + Additional type-specific methods can be added as required, in fact the + full set of 19+ could be added, it just requires implementation and test… + + + + + + + + + + + + + + + + + + + + + + + + + + + Initializes a new instance of the class. + + - + + Initializes a new instance of the class. + + - + + The type of the object passed in the parameter + must suit the type of the element. For instance if the element type is + then the object + passed in must be a , if the element type is + then the object + must either be a or the string encoded as + an array of , + and if the element type is + then the object passed in must be a , + etc. + For the full list of types see the class level documentation + (). + + For numerical element types the + + factory method will accept any integer type and attempt to convert it to the + required type before creating the , + for example for element type + it will accept an parameter and convert + it to a internally. + + + - + The type of the element as an ElementType. + + The value for the new element, + must suit the type of the element. + See the remarks for more information. + + - + + + ServiceElement e + e = new ServiceElement(ElementType.TextString, "Hello world"); + e = new ServiceElement(ElementType.TextString, new byte[] { (byte)'h', (byte)'i', }); + e = new ServiceElement(ElementType.Uuid16, (UInt16)0x1101); + + + int i = 10; + int j = -1; + + // Error, Int32 not suitable for element type UInt8. + ServiceElement e0 = new ServiceElement(ElementType.UInt8, i); + + // Success, Byte value 10 stored. + ServiceElement e1 = ServiceElement.CreateNumericalServiceElement(ElementType.UInt8, i); + + // Error, -1 not in range of type Byte. + ServiceElement e2 = ServiceElement.CreateNumericalServiceElement(ElementType.UInt8, j); + + + + + + Initializes a new instance of the class. + + - + The type of the element as an ElementType. + Should be either ElementSequence/ElementAlternative types. + + A list of elements. + + + + + Initializes a new instance of the class. + + - + The type of the element as an ElementType. + Should be either ElementSequence/ElementAlternative types. + + A list of elements. + + + + + Obsolete, use instead. + Initializes a new instance of the class. + + + + + Create an instance of + but internally converting the numeric value to the required type. + + - + + As noted in the constructor documentation + () + the type of the value supplied must exactly match the element's natural type, + the contructor will return an error if that is not the case. This method + will instead attempt to convert the value to the required type. It uses + the interface to do the conversion, for + instance if the element type is Uint16 then it will cast the input value + to and call + on it. + If the value is not convertible to the element type then an + will be thrown see below. + + For instance, passing in an C# int / Visual Basic Integer + to the constructor will fail for element types + etc, however by using this method it will succeed if the value is in the + correct range. + For example + + int i = 10; + int j = -1; + + // Error, Int32 not suitable for element type UInt8. + ServiceElement e0 = new ServiceElement(ElementType.UInt8, i); + + // Success, Byte value 10 stored. + ServiceElement e1 = ServiceElement.CreateNumericalServiceElement(ElementType.UInt8, i); + + // Error, -1 not in range of type Byte. + ServiceElement e2 = ServiceElement.CreateNumericalServiceElement(ElementType.UInt8, j); + + The last example failing with: + + System.ArgumentOutOfRangeException: Value '-1' of type 'System.Int32' not valid for element type UInt16. + ---> System.OverflowException: Value was either too large or too small for a UInt16. + at System.Convert.ToUInt16(Int32 value) + at System.Int32.System.IConvertible.ToUInt16(IFormatProvider provider) + at InTheHand.Net.Bluetooth.ServiceElement.ConvertNumericalValue(ElementType elementType, Object value) + --- End of inner exception stack trace --- + at InTheHand.Net.Bluetooth.ServiceElement.ConvertNumericalValue(ElementType elementType, Object value) + at InTheHand.Net.Bluetooth.ServiceElement.CreateNumericalServiceElement(ElementType elementType, Object value) + at MiscFeatureTestCs.Main(String[] args) + + + + - + The type of the element as an ElementType. + Should be one of the UnsignedInteger/TwosComplementInteger types. + + The value for the new element, + should be a numerical type. + + - + The new element. + + - + + The is not a numerical type. + + + The value wasn’t convertible to the required type, e.g. if -1 is + passed for element type UInt8, as shown above. + + + + + Gets the value as a list of . + + - + The list of elements as an list. + + - + + The service element is not of type + ElementType. + or . + + + + + Gets the value as a array of . + + - + The list of elements as an array. + + - + + The service element is not of type + ElementType. + or . + + + + + Gets the value as a . + + - + The Url value as a . + + - + + It turns out that we can't trust vendors to add only valid + URLs to their records, for instance the iPhone has an attribute + with value "www.apple.com" which isn't a URL as it has no scheme + part (http://) etc. + + Thus a Url value in an element can be stored in a number of + formats. If created by the parser then it will be stored as a + or as an array of + if property + ServiceRecordParser.LazyUrlCreation + is set. If created locally it can be those types or also + . + + This method will try to convert from those formats to . + If the URL is invalid e.g. has bad characters or is missing the scheme + part etc then an error will occur. One can instead access the + element's + property and expect one of the three types. When created by the + parser it will be of type unless + + is set. + + + - + + The service element is not of type + ElementType.. + + + + + Gets the value as a . + + - + The UUID value as a . + + - + + The service element is not of type + ElementType.. + + + + + Get the value of the , + where it is encoded using the given encoding form. + + - + The + object to be used to decode the string value + if it has been read as a raw byte array. + + - + + A holding the value of the + + from the service element. + + - + + The service element is not of type + . + + + + + Get the value of the , + when it is encoded as specified by the given IETF Charset identifer. + + - + + Note that a strict decoding of the string is carried out + (except on the NETCF where it is not supported). + Thus if the value is not in the specified encoding, or has been + encoded incorrectly, then an error will occur. + + - + + A holding the value of the + + from the service element. + + - + + The service element is not of type + . + + + If the value in the service element is not a valid string in the given encoding. + + + + + Get the value of the , + when it is encoded as UTF-8. + + - + + Note: a strict decoding is used. + Thus if the value is not in UTF-8 encoding or has been + encoded incorrectly an error will occur. + + - + + A holding the value of the + + from the service element. + + - + + If the value in the service element is not a valid string in the given encoding. + On NETCF, an is thrown; not that + is the base class of the + exception. + + + The service element is not of type + . + + + + + Gets the type of the element as an . + + + + + Gets the SDP Element Type Descriptor of the element + as an . + + + + + Gets the value of the element as the .NET type it is stored as. + + + In most cases the type-specific property should be used instead, e.g + , + , + , etc. + + + + + Gets a list of enum-like classes containing SDP Service Attribute Id definitions + for a particular Service Class. + + - + + See method + . + + + + + Initializes a new instance of the class. + + + + + Get a list of enum-like classes containing Service Attribute Id definitions + for the type of the Service Class contained in the given Service Record. + + - + A + whose + element will be retrieved, and its Service Class Id will used + for the lookup. + + - + + An array of each of which is a enum-like class + which defines the set of Service Attribute IDs used by a particular + Service Class e.g. ObjectPushProfile. + An empty array will be returned if none of the Service Classes + are known, or the record contains no + + attribute, or it is invalid. + Currently only the first Service Class Id is looked-up. + + - + + is null. + + + + + Get the enum-like class containing the Service Attribute Id definitions + for the type of the Service Class contained in the given + + (type ) data element. + + - + A + of 'UUID' type containing the Service Class to search for. + + - + + A object representing the enum-like class + holding the Attribute Id definitions, or null if the Service Class is + unknown or the element is not of + type. + + - + + is null. + + + + + Get the enum-like class containing the Service Attribute Id definitions + for the type of the Service Class specified. + + - + + Get the enum-like class containing the Service Attribute Id definitions + for the type of the Service Class specified by UUID. + + - + The Service Class to search for, as a . + + - + + A object representing the enum-like class + holding the Attribute Id definitions, or null if the Service Class is + unknown. + + + + + Represents a member of the SDP + , + Attribute + which provides for multi-language strings in a record. + + + “The + + attribute is a list in which each + member contains a language identifier, a character encoding identifier, and + a base attribute ID for each of the natural languages used in the service + record.” + + + + + The primary language is specified to have base attribute ID 0x0100. + + + + + The Id for the UTF-8 encoding. + + + + + + + + + + + + + + + + + + + + + + + Initialize a new instance of the class. + + - + The Natural Language field of the entry. + Some example values are 0x656E which is "en", and 0x6672 which is "fr". + + The IETF Charset identifier for this language. + e.g. 3 for US-ASCII and 106 for UTF-8, + see + + The base Attribute Id for this language + in the record. + e.g. 0x100 for the Primary language. + + + + + Initialize a new instance of the class. + + - + The Natural Language field of the entry. + Some example values are 0x656E which is "en", and 0x6672 which is "fr". + + The IETF Charset identifier for this language. + e.g. 3 for US-ASCII and 106 for UTF-8, + see + + The base Attribute Id for this language + in the record. + e.g. 0x100 for the Primary language. + + + + + Initialize a new instance of the class. + + - + + Initialize a new instance of the class. + + - + The Natural Language field of the entry. + Some example values are 0x656E which is "en", and 0x6672 which is "fr". + + The IETF Charset identifier for this language. + e.g. 3 for US-ASCII and 106 for UTF-8, + see + + The base Attribute Id for this language + in the record. + e.g. 0x100 for the Primary language. + + + + + Initialize a new instance of the class. + + - + The Natural Language field of the entry. + Some example values are 0x656E which is "en", and 0x6672 which is "fr". + + The IETF Charset identifier for this language. + e.g. 3 for US-ASCII and 106 for UTF-8, + see + + The base Attribute Id for this language + in the record. + e.g. 0x100 for the Primary language. + + + + + Initialize a new instance of the class. + + - + The Natural Language field of the entry. + Some example values are "en", and "fr". + + The IETF Charset identifier for this language. + e.g. 3 for US-ASCII and 106 for UTF-8, + see + + The base Attribute Id for this language + in the record. + e.g. 0x100 for the Primary language. + + + + + Initialize a new instance of the class. + + - + The Natural Language field of the entry. + Some example values are "en", and "fr". + + The IETF Charset identifier for this language. + e.g. 3 for US-ASCII and 106 for UTF-8, + see + + The base Attribute Id for this language + in the record. + e.g. 0x100 for the Primary language. + + + + + Gets the list of + items in the service record. + + - + + A holding the + data from the + + attribute. + + - + + An array of . + An array length zero is returned if the service record contains no such attribute. + + - + + is not of type + . + + + The element sequence contains incorrectly formatted or invalid content, + for example it contains the wrong element data types, or doesn't contain + the elements in groups of three as required. + + + + + Create a data element for the + + attribute + from the list of + + - + + An array of . + + - + + A holding the + + element, to be added to a generally the + . + + + + + Create a instance + for a primary language of English and a string encoding of UTF-8. + + The instance. + + + + + Gets an appropriate for this language base item. + + - + The + appropriate for this language base item. + + - + + We support the following set of mappings from encoding id to .NET + Encoding name. + + IdEncoding + 3us-ascii + 4iso-8859-1 + 5iso-8859-2 + 6iso-8859-3 + 7iso-8859-4 + 8iso-8859-5 + 9iso-8859-6 + 10iso-8859-7 + 11iso-8859-8 + 12iso-8859-9 + 13iso-8859-10 + 106 (0x006a)UTF-8 + 109iso-8859-13 + 110iso-8859-14 + 111iso-8859-15 + 112iso-8859-16 + 1013 (0x03f5)unicodeFFFE (UTF-16BE) + 1014utf-16 (UTF-16LE) + 1015utf-16 (UTF-16, we assume UTF16-LE) + 2252 to 2258 (0x08cc to 0x08d2)windows-1252 to Windows-1258 + + Note that not all platforms support all these Encodings, for instance on + my Windows XP SP2 box iso-8859-10/-14/-16 are not supported. On NETCF on + Windows Mobile 5 only five of the ISO-8859 encodings are supported. + Regardless I've seen no SDP records that use ISO-8859 encodings so this is + not a problem, most records actually use UTF-8. + + + - + + The IETF encoding id for this language base item is currently unknown. + If valid, add it to the s_IetfCharsetIdToDotNetEncodingNameTable table, + providing a mapping to its Windows code page name. + + + + + + + + Gets the value of the Natural Language field of the entry. + + Some example value may be "en", and "fr". + + + + Gets the value of the Natural Language field of the entry, as a . + + Some example value may be 0x656e for "en", and 0x6672 for "fr". + + + + Gets the value of the Natural Language field of the entry, as a . + + Some example value may be 0x656e for "en", and 0x6672 for "fr". + + + + Gets the base Attribute Id for this language. + + + + + Get the IETF Charset identifier for this language. + + - + + Example values are 3 for US-ASCII and 106 for UTF-8. + See the full list at + + + - + + + + + Get the IETF Charset identifier for this language, as an Int16. + + - + + + See . + + + - + + + + + Class of Service flags as assigned in the Bluetooth specifications. + + - + + Is returned by the property ClassOfDevice.Service. + + Defined in Bluetooth Specifications . + + + + + + No service class bits set. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Determine all the possible modes of operation of the Bluetooth radio. + + - + See BluetoothRadio.Mode + for what is supported on what platforms. For instance setting the mode + is not supported on Widcomm+Win32. On Widcomm WM/CE setting PowerOff + actually sets 'CONNECT_ALLOW_NONE', and not actually disabled/off. + Also when the stack is disabled, setting connectable/discoverable + does not manage to turn the radio on. + + - + BluetoothRadio.Mode + + + + Bluetooth is disabled on the device. + + + + + Bluetooth is connectable but your device cannot be discovered by other devices. + + + + + Bluetooth is activated and fully discoverable. + + + + + Use with so_RFCOMM_CONNINFO. + + + + + Service Attribute IDs defined by the Human Interface Device (HID) Profile specification. + + + + + HIDDeviceReleaseNumber + + [16-bit unsigned integer] + + “A numeric expression identifying the device release number in Binary-Coded + Decimal. This is a vendor-assigned field, which defines the version of + the product identified by the Bluetooth Device Identification [13] VendorID + and ProductID attributes. This attribute is intended to differentiate + between versions of products with identical VendorIDs and ProductIDs. + The value of the field is 0xJJMN for version JJ.M.N (JJ – major version + number, M – minor version number, N – sub-minor version number). …” + + + + + + HIDParserVersion + + [16-bit unsigned integer] + + “Each version of a profile is assigned a 16-bit unsigned integer version + number of the base HID Specification [4] that the device was designed to. The value + of the field is 0xJJMN for version JJ.M.N …” + + + + + + HIDDeviceSubclass + + [8-bit unsigned integer] + + “The HIDDeviceSubclass attribute is an 8-bit integer, which + identifies the type of device (keyboard, mouse, joystick, gamepad, + remote control, sensing device, etc.). Keyboards and mice are required + to support boot mode operation. In boot mode, a device presents a fixed + report, thus negating the requirement for a HID parser. + The Attribute value is identical to the low-order 8 bits + of the Class of Device/Service (CoD) field in the FHS packet, where + bits 7-2 contain the 6 bit Minor Device Class value (defined in Section + 1.2 of the Bluetooth Assigned Numbers document [8]) and bits 1-0 are + set to zero. …” + + + + + + HIDCountryCode + + [8-bit unsigned integer] + + “The HIDCountryCode attribute is an 8-bit integer, which identifies + which country the hardware is localized for. Most hardware is not localized + and thus this value would be zero (0).… + The valid country codes are listed in the HID Specification + [4].” + + + + + + HIDVirtualCable + + [8-bit Boolean] + + “The HIDVirtualCable attribute is a boolean value, which indicates + whether the device supports virtual connections as described in Section + Virtual Cables and Connection Re-Establishment. Devices that have this + attribute True indicate that the device supports 1:1 bonding with a host, + and the device expects to automatically reconnect if the connection is + dropped for any unknown reason.” + + + + + + HIDReconnectInitiate + + [8-bit Boolean] + + “The HIDReconnectInitiate attribute is a boolean value, which + indicates whether the device initiates the reconnection process or + expects the host to. …” + + + + + + HIDDescriptorList + + [Data element sequence] + + “The HIDDescriptorList Data Element Sequence performs the function of the + HID Descriptor that is defined in Section 6.2 of the HID Specification [4]. The + HIDDescriptorList identifies the descriptors associated with the device. … + The HIDDescriptorList is a Data Element Sequence that consists of + one or more HIDDescriptors. A HIDDescriptor is a data element sequence containing, + minimally, a pair of elements. For compatibility with future versions of the HID + profile, addition elements found in a HIDDescriptor shall be ignored. … + ” + + + + + + HIDLANGIDBaseList + + [Data element sequence] + + “The HIDLANGIDBaseList is a Data Element Sequence that consists of one or + more HIDLANGIDBases. A HIDLANGIDBase is a data element sequence containing, minimally, + two elements for each of the languages used in the service record: a language identifier + (LANGID) and a base attribute ID. For compatibility with future versions of the + HID profile, additional elements found in a HIDLANGIDBase shall be ignored. + The first element, called the HIDLANGID, contains an identifier representing + the natural language ID. The language is encoded according to the “Universal Serial + Bus Language Identifiers (LANGIDs)” Specification [9]. + The second element, called the HIDLanguageBase, contains an attribute + ID that serves as the base attribute ID for the natural language in the service + record. Different service records within a server may use different base attribute + ID values for the same language. …” + + + + + + HIDSDPDisable + + [8-bit Boolean] + + “The HIDSDPDisable attribute is a boolean value, which indicates whether + connection to the SDP channel and Control or Interrupt channels are mutually exclusive. + …” + + + + + + HIDBatteryPower + + [8-bit Boolean] + + “The HIDBatteryPower attribute is a boolean value, which indicates whether + the device is battery powered (and requires careful power management) or has some + other source of power that requires minimal management. …” + + + + + + HIDRemoteWake + + [8-bit Boolean] + + “The HIDRemoteWake attribute is a boolean value, which indicates whether + the device considers itself remote wake up-capable. When a system enters a suspend + (or standby) state, this flag shall be used to determine whether the host includes + this device in the set of devices that can wake it up. A mouse or keyboard are + typical examples of Remote Wake up devices.” + + + + + + HIDBootDevice + + [8-bit Boolean] + + “HIDBootDevice is an 8-bit Boolean value that when True indicates whether + the device supports boot protocol mode and by inference the Set_Protocol and Get_Protocol + commands. …” + + + + + + HIDSupervisionTimeout + + [16-bit unsigned integer] + + “The HIDSupervisionTimeout is a 16-bit value which indicates the device + vendor’s recommended baseband Link Supervision Timeout value in slots. …” + + + + + + HIDNormallyConnectable + + [8-bit Boolean] + + “HIDNormallyConnectable is an optional Boolean attribute that specifies + whether a HID is normally in Page Scan mode (when no connection is active) or not. + …” + + + + + + HIDProfileVersion + + [16-bit unsigned integer] + + “Each device designed to this specification shall include a 16-bit unsigned + integer version number of the Bluetooth HID Specification (this document) that + the device was designed to. The value of the field is 0xJJMN for version JJ.M.N + (JJ – major version number, M – minor version number, N – sub-minor version number); + …” + + + + + + Places a socket in a listening state to monitor infrared connections from a specified service or network address. + + This class monitors a service by specifying a service name or a network address. + The listener does not listen until you call one of the + methods. + + + + + Initializes a new instance of the class. + + The network address to monitor for making a connection. + + + + Initializes a new instance of the class. + + The name of the service to listen for. + + + + Starts listening for incoming connection requests. + + + + + Starts listening for incoming connection requests with a maximum number of pending connection. + + The maximum length of the pending connections queue. + + + + Stops the socket from monitoring connections. + + + + + Creates a new socket for a connection. + + A socket. + + + + Creates a client object for a connection when the specified service or endpoint is detected by the listener component. + + An object. + + + + Begins an asynchronous operation to accept an incoming connection attempt. + + - + An delegate that references the method to invoke when the operation is complete. + A user-defined object containing information about the accept operation. + This object is passed to the callback delegate when the operation is complete. + - + An that references the asynchronous creation of the . + - + The has been closed. + + + + Asynchronously accepts an incoming connection attempt and creates a new to handle remote host communication. + + An returned by a call to the method. + A . + + + + Begins an asynchronous operation to accept an incoming connection attempt. + + - + An delegate that references the method to invoke when the operation is complete. + A user-defined object containing information about the accept operation. + This object is passed to the callback delegate when the operation is complete. + - + An that represents the + asynchronous accept, which could still be pending. + + + + + Asynchronously accepts an incoming connection attempt and creates a new to handle remote host communication. + + An returned by a call to the method. + An . + + + + Determines if a connection is pending. + + true if there is a connection pending; otherwise, false. + + + + Gets the underlying network . + + + + + Gets a value that indicates whether the is actively listening for client connections. + + + + + Gets an representing the local device. + + + + + Configures what type of element will be added by the + for the + attribute. + + - + Used with the + property. + + + + + + No PDL attribute will be added. + + + + + A standard L2CAP element will be added. + + + + + A standard RFCOMM element will be added. + + + + + A standard GOEP (OBEX) element will be added. + + + + + Describes the device and service capabilities of a device. + + - + + Is returned by the properties + BluetoothDeviceInfo.ClassOfDevice + and + BluetoothRadio.ClassOfDevice. + + + + + + Initialize a new instance of class . + + - + + An example raw value is 0x00020104, which stands for + device: DesktopComputer, service: Network. + + + - + A containing the + raw Class of Device value. + + + + + Initialize a new instance of class . + + - + A + value. + + A + value. + + + + + Returns the hash code for this instance. + + A hash code for the current object. + + + + Returns the numerical value represented in a hexadecimal. + + - + A containing + the numerical value represented in a hexadecimal + e.g. "720104", "5A020C". + + + + + Returns a value indicating whether this instance is equal to a specified + object. + + An object + value to compare with the current instance. + + true if is an instance of + and equals the value of this instance; otherwise, false. + + + + + Returns a value indicating whether this instance is equal to a specified + value. + + An + value to compare with the current instance. + + true if + has the same value as this instance; otherwise, false. + + + + + Returns the device type. + + + + + Returns the major device type. + + + + + Returns supported service types. + + + + + Gets the numerical value. + + + + + + Gets the numerical value, suitable for CLS Compliance. + + + + + + The base class for classes containing Radio In- and Out-of-Range events. + + - + + Supported only by the Microsoft stack on desktop Windows. + + Produced by class . + + + + + + Gets the device to which the event applies. + + + + + The data for Radio Out-of-Range event. + + - + + Supported only by the Microsoft stack on desktop Windows. + + Produced by class . + + + + + + Gets a string representation of the event. + + A string (e.g. contains the device address and name). + + + + The data for Radio Out-of-Range event. + + - + + Supported only by the Microsoft stack on desktop Windows. + + Produced by class . + + + + + + Gets a string representation of the event. + + A string (e.g. contains the device address, name and the current and previous flags). + + + + The current state of the device according to the Bluetooth stack. + + + + + The previous state of the device according to the Bluetooth stack. + + + + + The flags that are set in the current state + and weren't in the previous state (calculated). + + + + + The flags that are not set in the current state + but were in the previous state (calculated). + + + + + Standard Bluetooth Profile identifiers. + + - + + See the list at . + + The Bluetooth Base UUID is {00000000-0000-1000-8000-00805F9B34FB} + + + + + + Represents an empty service Guid. + + + + + Represents the base Guid from which all standard Bluetooth profiles are derived - not used for connections. + Is {00000000-0000-1000-8000-00805F9B34FB} + + + + + [0x0001] + + + + + [0x0002] + + + + + [0x0003] + + + + + [0x0004] + + + + + [0x0005] + + + + + [0x0006] + + + + + [0x0008] + + + + + [0x0008] + + + + + [0x0009] + + + + + [0x000A] + + + + + [0x000C] + + + + + [0x000E] + + + + + [0x000F] + + + + + [0x0010] + + + + + [0x0011] + + + + + [0x0012] + + + + + [0x0014] + + + + + [0x0016] + + + + + [0x0017] + + + + + [0x0019] + + + + + [0x001B] + + + + + [0x001D] ????? + + + + + [0x001E] + + + + + [0x001F] + + + + + [0x0100] + + + + + [0x1000] + + + + + [0x1001] + + + + + [0x1002] + + + + + Provides a basic Serial emulation connect over Bluetooth. [0x1101] + + + + + Used to establish PPP connections over RFComm channels. [0x1102] + + + + + [0x1103] + + + + + [0x1104] + + + + + Used for sending binary objects between devices.[0x1105] + + + + + OBEX version of an FTP server [0x1106] + + + + + [0x1107] + + + + + HSP (Headset Profile) — Supports Bluetooth headset devices.[0x1108] + See also + + + + + + + + + [0x1109] + + + + + [0x110A] + + + + + [0x110B] + + + + + [0x110C] + + + + + [0x110D] + + + + + [0x110E] + + + + + [0x110F] + + + + + [0x1110] + + + + + [0x1111] + + + + + [0x1112] + See also + + + + + + + + + [0x1113] + + + + + [0x1114] + + + + + [0x1115] + + + + + [0x1116] + + + + + [0x1117] + + + + + [0x1118] + + + + + [0x1119] + + + + + [0x111A] + + + + + [0x111B] + + + + + [0x111C] + + + + + [0x111D] + + + + + Supports hands free kits such as a car kits which provide audio and more advanced call control than the Headset profile. [0x111E] + + + + + [0x111F] + + + + + [0x1120] + + + + + [0x1121] + + + + + Used for printing simple text, HTML, vCard objects and similar. [0x1122] + + + + + [0x1123] + + + + + Supports human interface devices such as keyboards and mice. [0x1124] + + + + + [0x1125] + + + + + [0x1126] + + + + + [0x1127] + + + + + Common_ISDN_Access [0x1128] + + + + + [0x1129] + + + + + UDI_MT [0x112A] + + + + + UDI_TA [0x112B] + + + + + [0x112C] + + + + + SIM_Access [0x112D] + + + + + Phonebook Access - PCE [0x112E] + + + + + Phonebook Access - PSE [0x112F] + + + + + Phonebook Access [0x1130] + + + + + Headset [0x1131] + See also + + + + + + + + + Message Access Server [0x1132] + + + + + Message Notification Server [0x1133] + + + + + Message Access Profile [0x1134] + + + + + Bluetooth Device Identification. [0x1200] + + + + + [0x1201] + + + + + [0x1202] + + + + + [0x1203] + + + + + [0x1204] + + + + + [0x1205] + + + + + [0x1206] + + + + + ESDP_UPNP_IP_PAN [0x1300] + + + + + ESDP_UPNP_IP_LAP [0x1301] + + + + + ESDP_UPNP_L2CAP [0x1302] + + + + + Video Distribution Profile - Source [0x1303] + + + + + Video Distribution Profile - Sink [0x1304] + + + + + Video Distribution Profile [0x1305] + + + + + Health Device Profile (HDP) [0x1400] + + + + + Health Device Profile (HDP) - Source [0x1401] + + + + + Health Device Profile (HDP) - Sink [0x1402] + + + + + Retrieves the name of the Service Class UUID that has the specified value. + + + The service class UUID as a . + + + A string containing the name of the service class whose UUID value is , + or a null reference (Nothing in Visual Basic) if no such constant is found. + + + + + Retrieves the name of the Service Class UUID that has the specified value. + + + The service class UUID in the 16-bit UUID short form as a . + + + A string containing the name of the service class whose UUID value is , + or a null reference (Nothing in Visual Basic) if no such constant is found. + + + + + Retrieves the name of the Service Class UUID that has the specified value. + + + The service class UUID in the 16-bit short UUID form as a . + + + A string containing the name of the service class whose UUID value is , + or a null reference (Nothing in Visual Basic) if no such constant is found. + + + + + Retrieves the name of the Service Class UUID that has the specified value. + + + The service class UUID in the 32-bit short UUID form as a . + + + A string containing the name of the service class whose UUID value is , + or a null reference (Nothing in Visual Basic) if no such constant is found. + + + + + Retrieves the name of the Service Class UUID that has the specified value. + + + The service class UUID in the 32-bit UUID short form as a . + + + A string containing the name of the service class whose UUID value is , + or a null reference (Nothing in Visual Basic) if no such constant is found. + + + + + Create a full 128-bit Service class UUID from its 16-bit short form. + + + The service class UUID in the 16-bit UUID short form as a . + + + A containing the full 128-bit form of the + supplied Bluetooth service class UUID. + + + + + Create a full 128-bit Service class UUID from its 16-bit short form. + + + The service class UUID in the 16-bit UUID short form as a . + + + A containing the full 128-bit form of the + supplied Bluetooth service class UUID. + + + + + Create a full 128-bit Service class UUID from its 16-bit short form. + + + The service class UUID in the 32-bit UUID short form as a . + + + A containing the full 128-bit form of the + supplied Bluetooth service class UUID. + + + + + Create a full 128-bit Service class UUID from its 16-bit short form. + + + The service class UUID in the 32-bit UUID short form as a . + + + A containing the full 128-bit form of the + supplied Bluetooth service class UUID. + + + + + Remove the device by deleting it from the Registry. + + The device address. + Whether the device is deleted -- it is no longer a remembered device. + + + + + Call CBtIf::GetExtendedError. + + - + + Is not currently used anywhere... + + Not supported on Widcomm WCE WM/WinCE, we (natively) return -1. + + + - + A value. + + + + CBtIf::IsRemoteDevicePresent + + - + + "added BTW and SDK 5.0.1.1000" + "added BTW-CE and SDK 1.7.1.2700" + + + + + CBtIf::IsRemoteDeviceConnected + + - + + "added BTW 5.0.1.300, SDK 5.0" + "added BTW-CE and SDK 1.7.1.2700" + + + + + Bluetooth specific flags returned from WSALookupServiceNext + in WSAQUERYSET.dwOutputFlags in response to device inquiry. + + + + + “Sets the device into general discoverable mode. This is + the default discoverable mode.” + + + + + “Sets the device into limited discoverable mode. If this + value is specified, BTSDK_GENERAL_DISCOVERABLE + mode value is ignored by BlueSoleil.” + + + + + “Makes the device discoverable. This is equivalent to + BTSDK_GENERAL_DISCOVERABLE.” + + + + + “Makes the device connectable. This is the default + connectable mode.” + + + + + “Makes the device pairable. This is the default pairable + mode.” + + + + + “A remote device connects to a local service record.” + + + + + “The remote device disconnects the connection, or the + connection is lost due to radio communication problems, + e.g. the remote device is out of communication range.” + + + + + “A local device connects to a remote service record.” + + + + + “The local device disconnects the connection from remote + service.” + + + + + "Possible flags for member 'mask' in _BtSdkRemoteServiceAttrStru" + + + + + Represents an end point for an infrared connection. + + + + + + Initializes a new instance of the class. + + The device identifier. + The Service Name to connect to/listen on eg "OBEX". + In the very uncommon case where a connection is to be made to + / a server is to listen on + a specific LSAP-SEL (port number), then use + the form "LSAP-SELn", where n is an integer. + + + + + Initializes a new instance of the class. + + The device address. + The Service Name to connect to/listen on eg "OBEX". + In the very uncommon case where a connection is to be made to + / a server is to listen on + a specific LSAP-SEL (port number), then use + the form "LSAP-SELn", where n is an integer. + + + + + + + + + + + Compares two instances for equality. + + - + The + to compare with the current instance. + + - + true if + is a and equal to the current instance; + otherwise, false. + + + + + Returns the hash code for this instance. + + A hash code for the current object. + + + + Returns the string representation of the IrDAEndPoint. + + + + The string is in format <DeviceAddress>:<ServiceName> + + An example is: + "04E20304:OBEX" + + The string representation of the IrDAEndPoint. + + + + Gets or sets an address for the device. + + + + + Gets or sets an identifier for the device. + + + The specified byte array is null (Nothing in Visual Basic). + + + The specified byte array is not four bytes long. + + + + + Gets or sets the name of the service. + + + + + Gets the address family to which the endpoint belongs. + + + + + Flags to describe Link Policy. + + + + + Disables all LAN Manager (LM) modes. + + + + + Enables the master slave switch. + + + + + Enables Hold mode. + + + + + Enables Sniff Mode. + + + + + Enables Park Mode. + + + + + Provides Bluetooth authentication services on desktop Windows. + + - + + This class is supported on desktop Windows and with the Microsoft + stack only. + + This class can be used in one of two ways. Firstly + an instance can be created specifying one device that is being connected + to and the PIN string to use for it. (That form is used internally by + to support + its method). + + Secondly it can also be used a mode where a user supplied + callback will be called when any device requires authentication, + the callback includes a parameter of type + . + Various authentication methods are available in Bluetooth version + 2.1 and later. Which one is being used is indicated by the + + property. + If it is + then the callback method should set the + + property. + + + For the other authentication methods + e.g. + or + the callback method should use one or more of the other properties and + methods e.g. + , + , + , + + etc. + + + See the example below for a 'Legacy' method handler. + The callback mode can be configured to do a callback after the + ‘send PIN’ action, this allows one to see if it was successful + etc. An example sequence where the PIN was incorrect is as follows. + + + Authenticate one device -- with wrong passcode here the first two times. + Passcode respectively: 'BAD-x', 'BAD-y', '9876' + Making PC discoverable + Hit Return to complete + Authenticating 0017E464CF1E wm_alan1 + Attempt# 0, Last error code 0 + Sending "BAD-x" + Authenticating 0017E464CF1E wm_alan1 + Attempt# 1, Last error code 1244 + Sending "BAD-y" + Authenticating 0017E464CF1E wm_alan1 + Attempt# 2, Last error code 1167 + Sending "9876" + Authenticating 0017E464CF1E wm_alan1 + Attempt# 3, Last error code 1167 + etc + + + That is we see the error code of 1244=NativeErrorNotAuthenticated + once, and then the peer device disappears (1167=NativeErrorDeviceNotConnected). + I suppose that's a security feature -- its stops an attacker + from trying again and again with different passcodes. + + Anyway the result of that is that is it not worth repeating + the callback after the device disappears. The code now enforces this. With + + set to true, if the result of the previous attempt was ‘success’ + or ‘device not connected’ then any new PIN set in the callback + won’t be used and thus the callback won’t be called again + for that authentication attempt. + + A successful authentication process can thus be detected by checking if + e.PreviousNativeErrorCode == NativeErrorSuccess && e.AttemptNumber != 0 + + + + The instance will continue receiving authentication requests + until it is disposed or garbage collected, so keep a reference to it + whilst it should be active and call + + when you’re finished. + + + - + + If one wants to respond to PIN requests for one device with a known PIN then + use the simple form which is initialized with an address and PIN. + + BluetoothWin32Authentication authenticator + = new BluetoothWin32Authentication(remoteEP.Address, m_pin); + // when the peer is expected to require pairing, perhaps do some work. + authenticator.Dispose(); + + + If one wants to see the PIN request, perhaps to be able to check the type + of the peer by its address then use the form here which requests callbacks. + (Note that this code assumes that 'Legacy' PIN-based pairing is being + used; setting the Pin property will presumably have no effect if the + authentication method being used is one of the v2.1 SSP forms). + + Using pairer As New BluetoothWin32Authentication(AddressOf Win32AuthCallbackHandler) + Console.WriteLine("Hit Return to stop authenticating") + Console.ReadLine() + End Using + ... + + Sub Win32AuthCallbackHandler(ByVal sender As Object, ByVal e As InTheHand.Net.Bluetooth.BluetoothWin32AuthenticationEventArgs) + ' Note we assume here that 'Legacy' pairing is being used, + ' and thus we only set the Pin property! + Dim address As String = e.Device.DeviceAddress.ToString() + Console.WriteLine("Received an authentication request from address " + address) + + ' compare the first 8 hex numbers, this is just a special case because in the + ' used scenario the model of the devices can be identified by the first 8 hex + ' numbers, the last 4 numbers being the device specific part. + If address.Substring(0, 8).Equals("0099880D") OrElse _ + address.Substring(0, 8).Equals("0099880E") Then + ' send authentication response + e.Pin = "5276" + ElseIf (address.Substring(0, 8).Equals("00997788")) Then + ' send authentication response + e.Pin = "ásdfghjkl" + End If + End Sub + + + + + + Windows’ ERROR_SUCCESS + + + + + + + Windows’ ERROR_NOT_AUTHENTICATED + + + + + + + Windows’ ERROR_DEVICE_NOT_CONNECTED + + + + + + + Initializes a new instance of the class. + + - + + Initializes a new instance of the class, + to respond to a specific address with a specific PIN string. + + - + + The instance will continue receiving authentication requests + until it is disposed or garbage collected, so keep a reference to it + whilst it should be active, and call + + when you’re finished. + + + - + The address of the device to authenticate, + as a . + + The PIN string to use for authentication, as a + . + + + + + Initializes a new instance of the class, + to call a specified handler when any device requires authentication. + + - + + See the example below. + + The callback mode can be configured to do a callback after the + ‘send PIN’action, this allows one to see if it was successful + etc. An example sequence where the PIN was incorrect is as follows. + + + Authenticate one device -- with wrong passcode here the first two times. + Passcode respectively: 'BAD-x', 'BAD-y', '9876' + Making PC discoverable + Hit Return to complete + Authenticating 0017E464CF1E wm_alan1 + Attempt# 0, Last error code 0 + Sending "BAD-x" + Authenticating 0017E464CF1E wm_alan1 + Attempt# 1, Last error code 1244 + Sending "BAD-y" + Authenticating 0017E464CF1E wm_alan1 + Attempt# 2, Last error code 1167 + Sending "9876" + Authenticating 0017E464CF1E wm_alan1 + Attempt# 3, Last error code 1167 + etc + + + That is we see the error code of 1244=NativeErrorNotAuthenticated + once, and then the peer device disappears (1167=NativeErrorDeviceNotConnected). + I suppose that's a security feature -- its stops an attacker + from trying again and again with different passcodes. + + Anyway the result of that is that is it not worth repeating + the callback after the device disappears. The code now enforces this. With + + set to true, if the result of the previous attempt was ‘success’ + or ‘device not connected’ then any new PIN set in the callback + won’t be used and thus the callback won’t be called again + for that authentication attempt. + + A successful authentication process can thus be detected by setting + CallbackWithResult=true and checking in the callback if + e.PreviousNativeErrorCode == NativeErrorSuccess && e.AttemptNumber != 0 + + + + The instance will continue receiving authentication requests + until it is disposed or garbage collected, so keep a reference to it + whilst it should be active, and call + + when you’re finished. + + + - + A reference to a handler function that can respond + to authentication requests. + + - + + + Using pairer As New BluetoothWin32Authentication(AddressOf Win32AuthCallbackHandler) + Console.WriteLine("Hit Return to stop authenticating") + Console.ReadLine() + End Using + ... + + Sub Win32AuthCallbackHandler(ByVal sender As Object, ByVal e As InTheHand.Net.Bluetooth.BluetoothWin32AuthenticationEventArgs) + Dim address As String = e.Device.DeviceAddress.ToString() + Console.WriteLine("Received an authentication request from address " + address) + + ' compare the first 8 hex numbers, this is just a special case because in the + ' used scenario the model of the devices can be identified by the first 8 hex + ' numbers, the last 4 numbers being the device specific part. + If address.Substring(0, 8).Equals("0099880D") OrElse _ + address.Substring(0, 8).Equals("0099880E") Then + ' send authentication response + e.Pin = "5276" + ElseIf (address.Substring(0, 8).Equals("00997788")) Then + ' send authentication response + e.Pin = "ásdfghjkl" + End If + End Sub + + + + + + Calls the authentication callback handler. + + - + An instance of + containing the details of the authentication callback. + + + + + Release the unmanaged resources used by the . + + + + + Release the unmanaged resources used by the , + and optionally disposes of the managed resources. + + + + + The BluetoothAuthenticationMethod enumeration defines the supported + authentication types during device pairing. + + + + + The Bluetooth device supports authentication via a PIN. + + + + + The Bluetooth device supports authentication via out-of-band data. + + + + + The Bluetooth device supports authentication via numeric comparison. + + + + + The Bluetooth device supports authentication via passkey notification. + + + + + The Bluetooth device supports authentication via passkey. + + + + + Methods which can be carried out in an Object Exchange transaction. + + + + + Sends an object to a receiving device. + + + + + Requests a file from the remote device. + + + + + Negotiate an Object Exchange connection with a remote device. + + + + + Disconnect an existing Object Exchange session. + + + + + Sends the last packet of an object to a receiving device. + + + + + Change remote path on an Object Exchange server. + + + + + Provides client connections to a remote Bluetooth L2CAP service. + + - + + For RFCOMM connections use . + + The normal usage is o create an instance, connect with + + or , + and if successful one then calls + to send and receive data. + + See the + method for more information + on specifying the remote service to connect to. + + + + + + Creates a new instance of . + + + + + Closes the and the underlying connection. + + - + + + + + Closes the and the underlying connection. + + - + + + + + Connects to a remote Bluetooth L2CAP service + using the specified remote endpoint. + + - + + The must + have the + set, and either the + or properties + set. + The port is the L2CAP PSM number, and if set a connection will be + made to that PSM and the Service Class Id ignored. + Note that only certain PSM values are valid. See + for more + information. + + + - + The + to which you intend to connect. See the remarks for usage. + + + + + Begins an asynchronous request for a remote host connection. + + - + + See + + for more information. + + + - + The + to which you intend to connect. + See + or , + for more information. + + An + delegate that references the method to invoke when the operation is + complete. + + A user-defined object that contains information + about the connect operation. This object is passed to the + delegate when the operation is + complete. + + - + An object that + references the asynchronous connection, + which may still be pending. + + + + + Asynchronously accepts an incoming connection attempt. + + - + An + object returned by a call to + or , + + + + + Returns the used to send and + receive data. + + - + + Note it is NOT a . + That type handles SOCK_STREAM connections, whereas L2CAP uses + SOCK_SEQPACKET. + Different Stream subclasses may be returned by different platforms. + + + - + The used to send and + receive data. + + + + + Get the MTU................ + + int + + + + Get the remote endpoint. + + - + + The with which the + is communicating. + + + + + Gets the current user-friendly name of the specified remote device. + + - + + Before calling Btsdk_UpdateRemoteDeviceName, the device database must be initialized by a + previous successful call to Btsdk_StartBluetooth. + The user-friendly device name is a UTF-8 character string. The device name acquired by this + command is stored automatically in the device database. + + + + + "gets the current link quality value of the connection between local + device and the specified remote device." + + - + "The higher the value, the better the link quality is." + + - + "Range: 0 to 0xFF." + + + + + "Gets the user-friendly name of the specified remote device from the device database." + + - + + "Before calling Btsdk_GetRemoteDeviceName, the device database must be initialized by a + previous successful call to Btsdk_Init. + The user-friendly device name is a UTF-8 character string. The Btsdk_GetRemoteDeviceNamefunction returns =BTSDK_OPERATION_FAILURE immediately if the device name doesn’t + exist in the database. In this case, the application shall call Btsdk_UpdateRemoteDeviceName + to acquire the name information directly from the remote device. + BlueSoleil will automatically update the device name when the local device connects to the + specified remote device. + + + + + Describes an incoming OBEX request to an object. + + + + + Writes the body of the request to the specified file path. + + The filename (including the path) to write to. + + + + Gets the length of the body data included in the request. + New in v1.5.51015 + + A long value that contains the value from the request's Length header. + This value is -1 if the content length is not known. + The Length header expresses the length, in bytes, of the body data that accompanies the request. + + + + Gets the MIME type of the body data included in the request. + + A that contains the text of the request's Type header. + + + + Gets the collection of header name/value pairs sent in the request. + + A that contains the OBEX headers included in the request. + For a complete list of request headers, see the enumeration. + + + + Get the device address and service to which the request is directed. + + - + + The instance returned will be of the + subtype that matches the address family that the + is listening on. For instance if the listener was created with + . + then the will be of type + , and similarly for + and + . + + - + + + + + Gets the method specified by the client. + + Only PUT is supported in this version. + + + + Gets a stream that contains the body data sent by the client. + + + + + Gets the OBEX version used by the requesting client + + + + + Gets the URL information (without the host and port) requested by the client. + + A that contains the raw URL for this request. + + + + Gets the device address and service from which the request originated. + + - + + The instance returned will be of the + subtype that matches the address family that the + is listening on. For instance if the listener was created with + . + then the will be of type + , and similarly for + and + . + + - + + C# + + ObexListener lsnr = new ObexListener(ObexTransport.Bluetooth) + ... ... + ObexListenerRequest olr = ... + BluetoothEndPoint remoteEp = (BluetoothEndPoint)olr.RemoteEndPoint; + BluetoothAddress remoteAddr = remoteEp.Address; + + Visual Basic + + Dim lsnr As New ObexListener(ObexTransport.IrDA) + ... ... + Dim olr As ObexListenerRequest = ... + Dim remoteEp As IrDAEndPoint = CType(olr.RemoteEndPoint, IrDAEndPoint); + Dim remoteAddr As IrDAAddress = remoteEp.Address; + + + - + + + + + Gets the server address to which the request is directed. + + + + + Gets the object requested by the client. + + A object that identifies the resource requested by the client. + + + + Used with + + AsyncResultNoResult.SetAsCompleted and + + AsyncResult<TResult>.SetAsCompleted. + + + + + Equivalent to true for the + #x201C;completedSynchronously” parameter. + + + + + Equivalent to false for the + #x201C;completedSynchronously” parameter. + + + + + Forces the callback to run on a thread-pool thread. + + + + + Describes the character sets supported by the device. + + The enumeration describes the following character sets, which are used by the and classes. + + + + + The ASCII character set. + + + + + The western European graphic character set. + + + + + The eastern European graphic character set. + + + + + The southern European graphic character set. + + + + + The northern European graphic character set. + + + + + The Cyrillic graphic character set. + + + + + The Arabic graphic character set. + + + + + The Greek graphic character set. + + + + + The Hebrew graphic character set. + + + + + The Turkish graphic character set. + + + + + The Unicode character set. + + + + + Created from v2.1 specification. + + + + + There are no supported features. + + + + + [0] + + + + + [8] + + + + + [16] + + + + + [25] + + + + + [32] + + + + + [33] + + + + + [35] + + + + + [36] + + + + + [37] v4.0 + + + + + [38] v4.0 + + + + + [39] + + + + + [40] + + + + + [41] v2.1 + + + + + [42] v2.1 + + + + + [48] v2.1 + + + + + [49] + + + + + [51] v2.1 + + + + + [52] v2.1 + + + + + [53] v2.1 + + + + + [54] v2.1 + + + + + [56] v2.1 + + + + + [57] v2.1 + (Changed name from 'InquiryResponseTxPowerLevel' in v2.1 + to 'InquiryTxPowerLevel' in v3.0). + + + + + [58] v3.0 + + + + + [63] Present since v2.0 at least. + + + + + Specifies the current status of the Bluetooth hardware. + + + + + Status cannot be determined. + + XXXX “The stack is not present.” CE5 + + + + Bluetooth radio not present. + + “The adapter is not present.” CE5 + + + + Bluetooth radio is in the process of starting up. + + “The adapter might be installed. + The stack is currently on the way up. Call again later.” CE5 + + + + Bluetooth radio is active. + + “The adapter is installed and the stack is running.” CE5 + + + + Bluetooth radio is in the process of shutting down. + + “The adapter is installed, but the stack is not running.” CE5 + + + + Bluetooth radio is in an error state. + + “The adapter might be installed. + The stack is on the way down. Call again later.” CE5 + + + + "Define common return code for new SDK functions that would normally return BOOL" + + - + "Added BTW and SDK 5.0.1.1100". + + + + + "The call was successful" + + + + + "Unspecified failure" + + + + + "The API is not supported on the platform BTW stack version" + + + + + "The API cannot complete at this time, but may be retried" + + + + + "One of the API parameters was invalid" + + + + + "A necessary resource could not be obtained" + + + + + "The operation timed out before completion" + + + + + for Test. + + + + + for Test. + + + + + SocketException holding a BlueSoleil error code from the original error, + which is added to the exception message. + + - + + Will always be internal so just catch SocketException as for the other stacks. + + + + + Represents an IrDA device address. + + + + + Initializes a new instance of the class with the specified address. + + Address as 4 byte array. + was null. + was not a 4 byte array. + + + + Initializes a new instance of the class with the specified address. + + representation of the address. + + + + Returns the IrDA address as an integer. + + - + An . + + + + Returns the internal byte array. + + - + An array of . + + + + Converts the string representation of an address to it's equivalent. + A return value indicates whether the operation succeeded. + + A string containing an address to convert. + When this method returns, contains the equivalent to the address contained in s, if the conversion succeeded, or null (Nothing in Visual Basic) if the conversion failed. + The conversion fails if the s parameter is null or is not of the correct format. + true if s is a valid IrDA address; otherwise, false. + + + + Converts the string representation of an IrDA address to a new instance. + + A string containing an address to convert. + New instance. + Address must be specified in hex format optionally separated by the colon or period character e.g. 00000000, 00:00:00:00 or 00.00.00.00. + irdaString is null. + irdaString is not a valid IrDA address. + + + + Converts the address to its equivalent string representation. + + The string representation of this instance. + + + + Returns a representation of the value of this instance, according to the provided format specifier. + + A single format specifier that indicates how to format the value of this Guid. The format parameter can be "N", "C" or "P". If format is null or the empty string (""), "N" is used. + A representation of the value of this . + + SpecifierFormat of Return Value + N8 digits: XXXXXXXX + C8 digits separated by colons: XX:XX:XX:XX + P8 digits separated by periods: XX.XX.XX.XX + + + + + Compares two instances for equality. + + - + The + to compare with the current instance. + + - + true if + is a and equal to the current instance; + otherwise, false. + + + + + Returns the hash code for this instance. + + A hash code for the current object. + + + + Returns an indication whether the values of two specified objects are equal. + + - + A or . + A or . + - + true if the values of the two instance are equal; + otherwise, false. + + + + + Returns an indication whether the values of two specified objects are not equal. + + - + A or . + A or . + - + true if the value of the two instance is different; + otherwise, false. + + + + + Provides a null IrDA address. + + + + + + + + + + + + Returns a representation of the value of this instance, according to the provided format specifier. + + A single format specifier that indicates how to format the value of this Guid. The format parameter can be "N", "C" or "P". If format is null or the empty string (""), "N" is used. + Ignored. + - + A representation of the value of this . + - + See + for the possible format strings and their output. + + + + + Defines additional IrDA socket option levels for the and methods. + + + Use along with the socket options defined by + . + + + + + + The socket option level for use with IrDA sockets + along with the options defined in . + + + Use along with the socket options defined by + . + + + + + + Describes an enumeration of possible device types, such as Fax. + + + + + + Unspecified device type. + + + + + A Plug and Play interface. + + + + + A Pocket PC or similar. + + + + + A personal computer. + + + + + A printer. + + + + + A modem. + + + + + A fax. + + + + + A local area network access. + + + + + Contains extended hint bytes. + + + + + A telephonic device. + + + + + A personal computer file server. + + + + + Device supports IrCOMM. + + + + + Device supports Object Exchange. + + + + + Define SPP connection states + + + + + port now connected + + + + + port now disconnected + + + + + rfcomm connction failed + + + + + Port in use, for SPPClient only [for SPP Client only] + + + + + no port configured [for SPP Client only] + + + + + service not found [for SPP Client only] + + + + + [for SPP Server Only] + + + + + [for SPP Server Only] + + + + + Define SPP connection states + + + + + port now connected + + + + + port now disconnected + + + + + Define return code for SPP Client functions + + + + + Operation initiated without error + + + + + COM server could not be started + + + + + attempt to connect before previous connection closed + + + + + attempt to close unopened connection + + + + + local processor could not allocate memory for open + + + + + One or more of function parameters are not valid + + + + + Any condition other than the above + + + + + no empty port + + + + + license error + + + + + Define return code for SPP Client functions + + + + + Listens for connections from Bluetooth network clients. + + The class provides simple methods that listen for and accept incoming connection requests in blocking synchronous mode. + You can use either a or a to connect with a + + + + Initializes a new instance of the class. + + ---- + + Initializes a new instance of the class + to listen on the specified service identifier. + + The Bluetooth service to listen for. + + + An SDP record is published on successful + to advertise the server. + A generic record is created, containing the essential ServiceClassIdList + and ProtocolDescriptorList attributes. The specified service identifier is + inserted into the former, and the RFCOMM Channel number that the server is + listening on is inserted into the latter. See the Bluetooth SDP specification + for details on the use and format of SDP records. + + If a SDP record with more elements is required, then use + one of the other constructors that takes an SDP record e.g. + , + or when passing it as a byte array + . + The format of the generic record used here is shown there also. + + Call the + method to begin listening for incoming connection attempts. + + + + + + Initializes a new instance of the class + that listens for incoming connection attempts on the specified local Bluetooth address and service identifier. + + A that represents the local Bluetooth radio address. + The Bluetooth service on which to listen for incoming connection attempts. + + + An SDP record is published on successful + to advertise the server. + A generic record is created, containing the essential ServiceClassIdList + and ProtocolDescriptorList attributes. The specified service identifier is + inserted into the former, and the RFCOMM Channel number that the server is + listening on is inserted into the latter. See the Bluetooth SDP specification + for details on the use and format of SDP records. + + If a SDP record with more elements is required, then use + one of the other constructors that takes an SDP record e.g. + , + or when passing it as a byte array, e.g. + . + The format of the generic record used here is shown there also. + + Call the + method to begin listening for incoming connection attempts. + + + + + + Initializes a new instance of the class + with the specified local endpoint. + + A that represents the local endpoint to which to bind the listener . + + + An SDP record is published on successful + to advertise the server. + A generic record is created, containing the essential ServiceClassIdList + and ProtocolDescriptorList attributes. The specified service identifier is + inserted into the former, and the RFCOMM Channel number that the server is + listening on is inserted into the latter. See the Bluetooth SDP specification + for details on the use and format of SDP records. + + If a SDP record with more elements is required, then use + one of the other constructors that takes an SDP record e.g. + , + or when passing it as a byte array + . + The format of the generic record used here is shown there also. + + Call the + method to begin listening for incoming connection attempts. + + + + + + Initializes a new instance of the class + to listen on the specified service identifier, + publishing the specified SDP record. + + The Bluetooth service to listen for. + Prepared SDP Record to publish. + + The index in the byte array where the RFCOMM Channel Number that the + server is listening on is to be placed. + However the supplied record is now parsed into an + instance, and the channel offset is not used. + + + + The constructors taking the SDP record explicitly (as a byte array) should + only be used if + a specialized SDP record is required. For instance when using one of the + standard profiles. Otherwise use one of the other constructors + e.g. + which create a generic SDP Record from the specified service identifier. + + Instead of passing a byte array containing a hand-built record, + the record can also be built using the + and classes, and + passed to the respective constuctor, e.g. + + + Any useful SDP record will include + a ProtocolDescriptor element containing + the RFCOMM Channel number that the server is listening on, + and a ServiceClassId element containing the service UUIDs. + The record supplied in the parameter + should contain those elements. On successful , + the RFCOMM Channel number that the protocol stack has assigned to the + server is retrieved, and copied into the service record before it is + published. The indicates the location + of the respective byte in the byte array. + + + An example SDP record is as follows. This is actually the format of the + generic record used in the other constructors. For another example see + the code in the ObexListener class. + + // The asterisks note where the Service UUID and the Channel number are + // to be filled in. + byte[] record = new byte[] { + //Element Sequence: + 0x35,0x27, + //UInt16: 0x0001 -- ServiceClassIdList + 0x09,0x00,0x01, + //Element Sequence: + 0x35,0x11, + // UUID128: 00000000-0000-0000-0000-000000000000 -- * Service UUID + 0x1c, + 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, + // + //UInt16: 0x0004 -- ProtocolDescriptorList + 0x09,0x00,0x04, + //Element Sequence: + 0x35,0x0c, + // Element Sequence: + 0x35,0x03, + // UUID16: 0x0100 -- L2CAP + 0x19,0x01,0x00, + // Element Sequence: + 0x35,0x05, + // UUID16: 0x0003 -- RFCOMM + 0x19,0x00,0x03, + // UInt8: 0x00 -- * Channel Number + 0x08,0x00 + }; + + For that record the channelOffset is 40. + + + + + + Initializes a new instance of the class + that listens for incoming connection attempts on the specified local Bluetooth address and service identifier, + publishing the specified SDP record. + + A that represents the local Bluetooth radio address. + The Bluetooth service to listen for. + Prepared SDP Record to publish + + The index in the byte array where the RFCOMM Channel Number that the + server is listening on is to be placed. + However the supplied record is now parsed into an + instance, and the channel offset is not used. + + + + The constructors taking the SDP record explicitly (as a byte array) should + only be used if + a specialized SDP record is required. For instance when using one of the + standard profiles. Otherwise use one of the other constructors + e.g. + which create a generic SDP Record from the specified service identifier. + + Instead of passing a byte array containing a hand-built record, + the record can also be built using the + and classes, and + passed to the respective constuctor, e.g. + + + Any useful SDP record will include + a ProtocolDescriptor element containing + the RFCOMM Channel number that the server is listening on, + and a ServiceClassId element containing the service UUIDs. + The record supplied in the parameter + should contain those elements. On successful , + the RFCOMM Channel number that the protocol stack has assigned to the + server is retrieved, and copied into the service record before it is + published. The indicates the location + of the respective byte in the byte array. + + + An example SDP record is as follows. This is actually the format of the + generic record used in the other constructors. For another example see + the code in the ObexListener class. + + // The asterisks note where the Service UUID and the Channel number are + // to be filled in. + byte[] record = new byte[] { + //Element Sequence: + 0x35,0x27, + //UInt16: 0x0001 -- ServiceClassIdList + 0x09,0x00,0x01, + //Element Sequence: + 0x35,0x11, + // UUID128: 00000000-0000-0000-0000-000000000000 -- * Service UUID + 0x1c, + 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, + // + //UInt16: 0x0004 -- ProtocolDescriptorList + 0x09,0x00,0x04, + //Element Sequence: + 0x35,0x0c, + // Element Sequence: + 0x35,0x03, + // UUID16: 0x0100 -- L2CAP + 0x19,0x01,0x00, + // Element Sequence: + 0x35,0x05, + // UUID16: 0x0003 -- RFCOMM + 0x19,0x00,0x03, + // UInt8: 0x00 -- * Channel Number + 0x08,0x00 + }; + + For that record the channelOffset is 40. + + + + + + Initializes a new instance of the class + with the specified local endpoint, + publishing the specified SDP record. + + A that represents the local endpoint to which to bind the listener . + Prepared SDP Record to publish + + The index in the byte array where the RFCOMM Channel Number that the + server is listening on is to be placed. + However the supplied record is now parsed into an + instance, and the channel offset is not used. + + + + The constructors taking the SDP record explicitly (as a byte array) should + only be used if + a specialized SDP record is required. For instance when using one of the + standard profiles. Otherwise use one of the other constructors + e.g. + which create a generic SDP Record from the specified service identifier. + + Instead of passing a byte array containing a hand-built record, + the record can also be built using the + and classes, and + passed to the respective constuctor, e.g. + + + Any useful SDP record will include + a ProtocolDescriptor element containing + the RFCOMM Channel number that the server is listening on, + and a ServiceClassId element containing the service UUIDs. + The record supplied in the parameter + should contain those elements. On successful , + the RFCOMM Channel number that the protocol stack has assigned to the + server is retrieved, and copied into the service record before it is + published. The indicates the location + of the respective byte in the byte array. + + + An example SDP record is as follows. This is actually the format of the + generic record used in the other constructors. For another example see + the code in the ObexListener class. + + // The asterisks note where the Service UUID and the Channel number are + // to be filled in. + byte[] record = new byte[] { + //Element Sequence: + 0x35,0x27, + //UInt16: 0x0001 -- ServiceClassIdList + 0x09,0x00,0x01, + //Element Sequence: + 0x35,0x11, + // UUID128: 00000000-0000-0000-0000-000000000000 -- * Service UUID + 0x1c, + 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, + // + //UInt16: 0x0004 -- ProtocolDescriptorList + 0x09,0x00,0x04, + //Element Sequence: + 0x35,0x0c, + // Element Sequence: + 0x35,0x03, + // UUID16: 0x0100 -- L2CAP + 0x19,0x01,0x00, + // Element Sequence: + 0x35,0x05, + // UUID16: 0x0003 -- RFCOMM + 0x19,0x00,0x03, + // UInt8: 0x00 -- * Channel Number + 0x08,0x00 + }; + + For that record the channelOffset is 40. + + + + + + Initializes a new instance of the class + to listen on the specified service identifier, + publishing the specified SDP record. + + - + The Bluetooth service to listen for. + Prepared SDP Record to publish. + - + + + The constructors taking the SDP record explicitly should + only be used if + a specialized SDP record is required. For instance when using one of the + standard profiles. Otherwise use one of the other constructors + e.g. + which create a generic SDP Record from the specified service identifier. + + Any useful SDP record will include + a ProtocolDescriptor element containing + the RFCOMM Channel number that the server is listening on, + and a ServiceClassId element containing the service UUIDs. + The record supplied in the parameter + should contain those elements. On successful , + the RFCOMM Channel number that the protocol stack has assigned to the + server is retrieved, and copied into the service record before it is + published. + + + An example SDP record is as follows. This is actually the format of the + generic record used in the other constructors. For another example see + the code in the ObexListener class. + + private static ServiceRecord CreateBasicRfcommRecord(Guid serviceClassUuid) + { + ServiceElement pdl = ServiceRecordHelper.CreateRfcommProtocolDescriptorList(); + ServiceElement classList = new ServiceElement(ElementType.ElementSequence, + new ServiceElement(ElementType.Uuid128, serviceClassUuid)); + ServiceRecord record = new ServiceRecord( + new ServiceAttribute( + InTheHand.Net.Bluetooth.AttributeIds.UniversalAttributeId.ServiceClassIdList, + classList), + new ServiceAttribute( + InTheHand.Net.Bluetooth.AttributeIds.UniversalAttributeId.ProtocolDescriptorList, + pdl)); + return record; + } + + + + + + + Initializes a new instance of the class + that listens for incoming connection attempts on the specified local Bluetooth address and service identifier, + publishing the specified SDP record. + + - + A that represents the local Bluetooth radio address. + The Bluetooth service to listen for. + Prepared SDP Record to publish + - + + + The constructors taking the SDP record explicitly should + only be used if + a specialized SDP record is required. For instance when using one of the + standard profiles. Otherwise use one of the other constructors + e.g. + which create a generic SDP Record from the specified service identifier. + + Any useful SDP record will include + a ProtocolDescriptor element containing + the RFCOMM Channel number that the server is listening on, + and a ServiceClassId element containing the service UUIDs. + The record supplied in the parameter + should contain those elements. On successful , + the RFCOMM Channel number that the protocol stack has assigned to the + server is retrieved, and copied into the service record before it is + published. + + + An example SDP record is as follows. This is actually the format of the + generic record used in the other constructors. For another example see + the code in the ObexListener class. + + private static ServiceRecord CreateBasicRfcommRecord(Guid serviceClassUuid) + { + ServiceElement pdl = ServiceRecordHelper.CreateRfcommProtocolDescriptorList(); + ServiceElement classList = new ServiceElement(ElementType.ElementSequence, + new ServiceElement(ElementType.Uuid128, serviceClassUuid)); + ServiceRecord record = new ServiceRecord( + new ServiceAttribute( + InTheHand.Net.Bluetooth.AttributeIds.UniversalAttributeId.ServiceClassIdList, + classList), + new ServiceAttribute( + InTheHand.Net.Bluetooth.AttributeIds.UniversalAttributeId.ProtocolDescriptorList, + pdl)); + return record; + } + + + + + + + Initializes a new instance of the class + with the specified local endpoint, + publishing the specified SDP record. + + A that represents the local endpoint to which to bind the listener . + Prepared SDP Record to publish + - + + + The constructors taking the SDP record explicitly (as a byte array) should + only be used if + a specialized SDP record is required. For instance when using one of the + standard profiles. Otherwise use one of the other constructors + e.g. + which create a generic SDP Record from the specified service identifier. + + Any useful SDP record will include + a ProtocolDescriptor element containing + the RFCOMM Channel number that the server is listening on, + and a ServiceClassId element containing the service UUIDs. + The record supplied in the parameter + should contain those elements. On successful , + the RFCOMM Channel number that the protocol stack has assigned to the + server is retrieved, and copied into the service record before it is + published. + + + An example SDP record is as follows. This is actually the format of the + generic record used in the other constructors. For another example see + the code in the ObexListener class. + + private static ServiceRecord CreateBasicRfcommRecord(Guid serviceClassUuid) + { + ServiceElement pdl = ServiceRecordHelper.CreateRfcommProtocolDescriptorList(); + ServiceElement classList = new ServiceElement(ElementType.ElementSequence, + new ServiceElement(ElementType.Uuid128, serviceClassUuid)); + ServiceRecord record = new ServiceRecord( + new ServiceAttribute( + InTheHand.Net.Bluetooth.AttributeIds.UniversalAttributeId.ServiceClassIdList, + classList), + new ServiceAttribute( + InTheHand.Net.Bluetooth.AttributeIds.UniversalAttributeId.ProtocolDescriptorList, + pdl)); + return record; + } + + + + + + + Starts listening for incoming connection requests. + + + + + Starts listening for incoming connection requests with a maximum number of pending connection. + + The maximum length of the pending connections queue. + + + + Stops the socket from monitoring connections. + + + + + Begins an asynchronous operation to accept an incoming connection attempt. + + An delegate that references the method to invoke when the operation is complete. + A user-defined object containing information about the accept operation. + This object is passed to the callback delegate when the operation is complete. + An that references the asynchronous creation of the . + The has been closed. + + + + Asynchronously accepts an incoming connection attempt and creates a new to handle remote host communication. + + An returned by a call to the method. + A . + + + + Begins an asynchronous operation to accept an incoming connection attempt. + + + + + + + + Asynchronously accepts an incoming connection attempt and creates a new to handle remote host communication. + + An returned by a call to the method. + A . + + + + Creates a new socket for a connection. + + AcceptSocket is a blocking method that returns a that you can use to send and receive data. + If you want to avoid blocking, use the method to determine if connection requests are available in the incoming connection queue. + The returned is initialized with the address and channel number of the remote device. + You can use any of the Send and Receive methods available in the class to communicate with the remote device. + When you are finished using the , be sure to call its method. + If your application is relatively simple, consider using the method rather than the AcceptSocket method. + provides you with simple methods for sending and receiving data over a network in blocking synchronous mode. + A used to send and receive data. + Listener is stopped. + + + + Creates a client object for a connection when the specified service or endpoint is detected by the listener component. + + AcceptTcpClient is a blocking method that returns a that you can use to send and receive data. + Use the method to determine if connection requests are available in the incoming connection queue if you want to avoid blocking. + Use the method to obtain the underlying of the returned . + The will provide you with methods for sending and receiving with the remote host. + When you are through with the , be sure to call its method. + If you want greater flexibility than a offers, consider using . + A component. + Listener is stopped. + + + + Determines if there is a connection pending. + + true if there is a connection pending; otherwise, false. + + + + Set or change the PIN to be used with a specific remote device. + + Address of Bluetooth device. + PIN string consisting of 1 to 16 ASCII characters. + Assigning null (Nothing in VB) or an empty String will revoke the PIN. + + + + Gets the underlying of the current . + + + + + Get or set the Service Class flags that this service adds to the host + device’s Class Of Device field. + + - + + The Class of Device value contains a Device part which describes + the primary service that the device provides, and a Service part which + is a set of flags indicating all the service types that the device supports, + e.g. , + , + etc. + This property supports setting those flags; bits set in this value will be + added to the host device’s CoD Service Class bits when the listener + is active. + + Supported on Win32, but not supported on WindowsMobile/WinCE + as there's no native API for it. The WindowCE section of MSDN mentions the + Registry value COD at key HKEY_LOCAL_MACHINE\Software\Microsoft\Bluetooth\sys. + However my (Jam) has value 0x920100 there but advertises a CoD of 0x100114, + so its not clear how the values relate to each other. + + + + + + + Get or set the ServiceName the server will use in its SDP Record. + + - + A string representing the value to be used for the Service Name + SDP Attribute. Will be if not specfied. + + - + + The listener is already started. + - or - + A custom Service Record was given at initialization time. In that case + the ServiceName attribute should be added to that record. + + + + + Gets the underlying network . + + The underlying . + creates a to listen for incoming client connection requests. + Classes deriving from can use this property to get this . + Use the underlying returned by the property if you require access beyond that which provides. + Note property only returns the used to listen for incoming client connection requests. + Use the method to accept a pending connection request and obtain a for sending and receiving data. + You can also use the method to accept a pending connection request and obtain a for sending and receiving data. + + + + Returns the SDP Service Record for this service. + + + Returns if the listener is not + ed + (and an record wasn’t supplied at initialization). + + + + + + Gets or sets the authentication state of the current connect or behaviour to use when connection is established. + + + For disconnected sockets, specifies that authentication is required in order for a connect or accept operation to complete successfully. + Setting this option actively initiates authentication during connection establishment, if the two Bluetooth devices were not previously authenticated. + The user interface for passkey exchange, if necessary, is provided by the operating system outside the application context. + For outgoing connections that require authentication, the connect operation fails with WSAEACCES if authentication is not successful. + In response, the application may prompt the user to authenticate the two Bluetooth devices before connection. + For incoming connections, the connection is rejected if authentication cannot be established and returns a WSAEHOSTDOWN error. + + + + + On unconnected sockets, enforces encryption to establish a connection. + Encryption is only available for authenticated connections. + For incoming connections, a connection for which encryption cannot be established is automatically rejected and returns WSAEHOSTDOWN as the error. + For outgoing connections, the connect function fails with WSAEACCES if encryption cannot be established. + In response, the application may prompt the user to authenticate the two Bluetooth devices before connection. + + + + + Discovers accessible Bluetooth devices and returns their names and addresses. + + The maximum number of devices to get information about. + True to return previously authenticated/paired devices. + True to return remembered devices. + True to return previously unknown devices. + True to return only discoverable devices + (where both in range and in discoverable mode). + When all other flags are ignored. + Note: Does NOT work on Win32 with the Microsoft stack. + + An array of BluetoothDeviceInfo objects describing the devices discovered. + - + + The flag will discover only + the devices that are in range and are in discoverable mode. This works + only on WM/CE with the Microsoft stack, or on any platform with the + Widcomm stack. + + + It does not work on desktop Windows with the Microsoft + stack, where the in range and remembered devices are returned already + merged! There simple all devices will be returned. Even the + BluetoothDeviceInfo.LastSeen + property is of no use there: on XP and Vista at least the value provided + is always simply the current time. + + + + + + Connects a client to a specified endpoint. + + A that represents the remote device. + + + + Begins an asynchronous request for a remote host connection. + The remote host is specified by a . + + A containing the + address and UUID of the remote service. + An AsyncCallback delegate that references the method to invoke when the operation is complete. + A user-defined object that contains information about the connect operation. + This object is passed to the requestCallback delegate when the operation is complete. + + + + + Asynchronously accepts an incoming connection attempt. + + An object returned by a call to + + / . + + + + + Sets the PIN associated with the currently connected device. + + PIN which must be composed of 1 to 16 ASCII characters. + Assigning null (Nothing in VB) or an empty String will revoke the PIN. + + + + Set or change the PIN to be used with a specific remote device. + + Address of Bluetooth device. + PIN string consisting of 1 to 16 ASCII characters. + Assigning null (Nothing in VB) or an empty String will revoke the PIN. + + + + Gets the name of the specified remote device. + + Address of remote device. + Friendly name of specified device. + + + + Gets the name of a device by a specified socket. + + A . + Returns a string value of the computer or device name. + + + + Releases the unmanaged resources used by the BluetoothClient and optionally releases the managed resources. + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Closes the and the underlying connection. + + - + + + + + Frees resources used by the class. + + + + + Amount of time allowed to perform the query. + + On Windows CE the actual value used is expressed in units of 1.28 seconds, so will be the nearest match for the value supplied. + The default value is 10 seconds. The maximum is 60 seconds. + + + + Gets or set a value that indicates whether a connection has been made. + + + + + Gets or sets the authentication state of the current connect or behaviour to use when connection is established. + + + For disconnected sockets, specifies that authentication is required in order for a connect or accept operation to complete successfully. + Setting this option actively initiates authentication during connection establishment, if the two Bluetooth devices were not previously authenticated. + The user interface for passkey exchange, if necessary, is provided by the operating system outside the application context. + For outgoing connections that require authentication, the connect operation fails with WSAEACCES if authentication is not successful. + In response, the application may prompt the user to authenticate the two Bluetooth devices before connection. + For incoming connections, the connection is rejected if authentication cannot be established and returns a WSAEHOSTDOWN error. + + + + + On unconnected sockets, enforces encryption to establish a connection. + Encryption is only available for authenticated connections. + For incoming connections, a connection for which encryption cannot be established is automatically rejected and returns WSAEHOSTDOWN as the error. + For outgoing connections, the connect function fails with WSAEACCES if encryption cannot be established. + In response, the application may prompt the user to authenticate the two Bluetooth devices before connection. + + + + + Returns link key associated with peer Bluetooth device. + + + + + Returns the Link Policy of the current connection. + + + + + Gets the name of the remote device. + + + + + Gets or sets the authentication state of the current connect or behaviour to use when connection is established. + + + For disconnected sockets, specifies that authentication is required in order for a connect or accept operation to complete successfully. + Setting this option actively initiates authentication during connection establishment, if the two Bluetooth devices were not previously authenticated. + The user interface for passkey exchange, if necessary, is provided by the operating system outside the application context. + For outgoing connections that require authentication, the connect operation fails with WSAEACCES if authentication is not successful. + In response, the application may prompt the user to authenticate the two Bluetooth devices before connection. + For incoming connections, the connection is rejected if authentication cannot be established and returns a WSAEHOSTDOWN error. + + + + + On unconnected sockets, enforces encryption to establish a connection. + Encryption is only available for authenticated connections. + For incoming connections, a connection for which encryption cannot be established is automatically rejected and returns WSAEHOSTDOWN as the error. + For outgoing connections, the connect function fails with WSAEACCES if encryption cannot be established. + In response, the application may prompt the user to authenticate the two Bluetooth devices before connection. + + + + + Defines the ids for the “universal attributes”, those + “whose definitions are common to all service records.” + + + “ + Universal attributes are those service attributes whose definitions are common + to all service records. Note that this does not mean that every service record + must contain values for all of these service attributes. However, if a service + record has a service attribute with an attribute ID allocated to a universal + attribute, the attribute value must conform to the universal attribute’s definition. + “ + Only two attributes are required to exist in every service record instance. They + are the ServiceRecordHandle (attribute ID 0x0000) and the ServiceClassIDList + (attribute ID 0x0001). All other service attributes are optional within a service + record. + ” + “Attribute IDs in the range of 0x000D-0x01FF are reserved.” + + + + + A service record handle is a 32-bit number that uniquely identifies each service + record within an SDP server. + [0x0000] + + + [32-bit unsigned integer] + + + + + The ServiceClassIDList attribute consists of a data element sequence in which + each data element is a UUID representing the service classes that a given service + record conforms to. + [0x0001] + + + [Data Element Sequence] + “The ServiceClassIDList attribute consists of a data element sequence in which + each data element is a UUID representing the service classes that a given service + record conforms to. The UUIDs are listed in order from the most specific + class to the most general class. The ServiceClassIDList must contain at least + one service class UUID.” + + + + + The ServiceRecordState is a 32-bit integer that is used to facilitate caching of + ServiceAttributes. + [0x0002] + + + [32-bit unsigned integer] + “ + The ServiceRecordState is a 32-bit integer that is used to facilitate caching of + ServiceAttributes. If this attribute is contained in a service record, its value is + guaranteed to change when any other attribute value is added to, deleted from + or changed within the service record. This permits a client to check the value of + this single attribute. If its value has not changed since it was last checked, the + client knows that no other attribute values within the service record have + changed. + ” + + + + + The ServiceID is a UUID that universally and uniquely identifies the service + instance described by the service record. + [0x0003] + + + [UUID] + “ + The ServiceID is a UUID that universally and uniquely identifies the service + instance described by the service record. This service attribute is particularly + useful if the same service is described by service records in more than one + SDP server. + ” + + + + + The ProtocolDescriptorList attribute describes one or more protocol stacks that + may be used to gain access to the service described by the service record. + [0x0004] + + + [Data Element Sequence or Data Element Alternative] + “ + The ProtocolDescriptorList attribute describes one or more protocol stacks that + may be used to gain access to the service described by the service record. + “ + If the ProtocolDescriptorList describes a single stack, it takes the form of a data + element sequence in which each element of the sequence is a protocol + descriptor. Each protocol descriptor is, in turn, a data element sequence whose + first element is a UUID identifying the protocol and whose successive elements + are protocol-specific parameters. Potential protocol-specific parameters are a + protocol version number and a connection-port number. The protocol descriptors + are listed in order from the lowest layer protocol to the highest layer protocol + used to gain access to the service. + “ + If it is possible for more than one kind of protocol stack to be used to gain + access to the service, the ProtocolDescriptorList takes the form of a data element + alternative where each member is a data element sequence as described + in the previous paragraph. + “ + Protocol Descriptors + “ + A protocol descriptor identifies a communications protocol and provides protocol- + specific parameters. A protocol descriptor is represented as a data element + sequence. The first data element in the sequence must be the UUID that identifies + the protocol. Additional data elements optionally provide protocol-specific + information, such as the L2CAP protocol/service multiplexer (PSM) and the + RFCOMM server channel number (CN) shown below. + “ + ProtocolDescriptorList Examples + “ + These examples are intended to be illustrative. The parameter formats for each + protocol are not defined within this specification. + “ + In the first two examples, it is assumed that a single RFCOMM instance exists + on top of the L2CAP layer. In this case, the L2CAP protocol specific information + (PSM) points to the single instance of RFCOMM. In the last example, two different + and independent RFCOMM instances are available on top of the L2CAP + layer. In this case, the L2CAP protocol specific information (PSM) points to a + distinct identifier that distinguishes each of the RFCOMM instances. According + to the L2CAP specification, this identifier takes values in the range + 0x1000-0xFFFF. + “ + IrDA-like printer + “ + ( ( L2CAP, PSM=RFCOMM ), ( RFCOMM, CN=1 ), ( PostscriptStream ) ) + “ + IP Network Printing + “ + ( ( L2CAP, PSM=RFCOMM ), ( RFCOMM, CN=2 ), ( PPP ), ( IP ), ( TCP ), + ( IPP ) ) + “ + Synchronization Protocol Descriptor Example + “ + ( ( L2CAP, PSM=0x1001 ), ( RFCOMM, CN=1 ), ( Obex ), ( vCal ) ) + “ + ( ( L2CAP, PSM=0x1002 ), ( RFCOMM, CN=1 ), ( Obex ), + “ + ( otherSynchronisationApplication ) ) + ” + + + + + The BrowseGroupList attribute consists of a data element sequence in which + each element is a UUID that represents a browse group to which the service + record belongs. + [0x0005] + + + [Data Element Sequence] + “ + The BrowseGroupList attribute consists of a data element sequence in which + each element is a UUID that represents a browse group to which the service + record belongs. The top-level browse group ID, called PublicBrowseRoot and + representing the root of the browsing hierarchy, has the value + 00001002-0000-1000-8000-00805F9B34FB + (UUID16: 0x1002) from the Bluetooth Assigned + Numbers document. + ” + + + + + In order to support human-readable attributes for multiple natural languages in + a single service record, a base attribute ID is assigned for each of the natural + languages used in a service record. The human-readable universal attributes + are then defined with an attribute ID offset from each of these base values, + rather than with an absolute attribute ID. + [0x0006] + + + [Data Element Sequence] + “ + In order to support human-readable attributes for multiple natural languages in + a single service record, a base attribute ID is assigned for each of the natural + languages used in a service record. The human-readable universal attributes + are then defined with an attribute ID offset from each of these base values, + rather than with an absolute attribute ID. + “ + The LanguageBaseAttributeIDList attribute is a list in which each member contains + a language identifier, a character encoding identifier, and a base attribute + ID for each of the natural languages used in the service record. The Language- + BaseAttributeIDList attribute consists of a data element sequence in which + each element is a 16-bit unsigned integer. The elements are grouped as triplets + (threes). + “ + The first element of each triplet contains an identifier representing the natural + language. The language is encoded according to ISO 639:1988 (E/F): “Code + for the representation of names of languages”. + “ + The second element of each triplet contains an identifier that specifies a character + encoding used for the language. Values for character encoding can be + found in IANA's database1, and have the values that are referred to as MIBEnum + values. The recommended character encoding is UTF-8. + “ + The third element of each triplet contains an attribute ID that serves as the + base attribute ID for the natural language in the service record. Different service + records within a server may use different base attribute ID values for the + same language. + “ + To facilitate the retrieval of human-readable universal attributes in a principal + language, the base attribute ID value for the primary language supported by a + service record must be 0x0100. Also, if a LanguageBaseAttributeIDList + attribute is contained in a service record, the base attribute ID value contained + in its first element must be 0x0100. + + + + + + The ServiceTimeToLive attribute is a 32-bit integer that contains the number of + seconds for which the information in a service record is expected to remain + valid and unchanged. + [0x0007] + + + [32-bit unsigned integer] + “ + The ServiceTimeToLive attribute is a 32-bit integer that contains the number of + seconds for which the information in a service record is expected to remain + valid and unchanged. This time interval is measured from the time that the + attribute value is retrieved from the SDP server. This value does not imply a + guarantee that the service record will remain available or unchanged. It is + simply a hint that a client may use to determine a suitable polling interval to revalidate + the service record contents. + ” + + + + + The ServiceAvailability attribute is an 8-bit unsigned integer that represents the + relative ability of the service to accept additional clients. + [0x0008] + + + [8-bit unsigned integer] + “ + The ServiceAvailability attribute is an 8-bit unsigned integer that represents the + relative ability of the service to accept additional clients. A value of 0xFF indicates + that the service is not currently in use and is thus fully available, while a + value of 0x00 means that the service is not accepting new clients. For services + that support multiple simultaneous clients, intermediate values indicate the relative + availability of the service on a linear scale. + ”“ + For example, a service that can accept up to 3 clients should provide ServiceAvailability + values of 0xFF, 0xAA, 0x55, and 0x00 when 0, 1, 2, and 3 clients, respectively, + are utilizing the service. The value 0xAA is approximately (2/3) * 0xFF and + represents 2/3 availability, while the value 0x55 is approximately (1/3)*0xFF and + represents 1/3 availability. Note that the availability value may be approximated as + ”“ + ( 1 - ( current_number_of_clients / maximum_number_of_clients ) ) * 0xFF + ”“ + When the maximum number of clients is large, this formula must be modified to + ensure that ServiceAvailability values of 0x00 and 0xFF are reserved for their + defined meanings of unavailability and full availability, respectively. + ”“ + Note that the maximum number of clients a service can support may vary + according to the resources utilized by the service's current clients. + ”“ + A non-zero value for ServiceAvailability does not guarantee that the service will + be available for use. It should be treated as a hint or an approximation of availability + status. + ” + + + + + The BluetoothProfileDescriptorList attribute consists of a data element + sequence in which each element is a profile descriptor that contains information + about a Bluetooth profile to which the service represented by this service + record conforms. + [0x0009] + + + [Data Element Sequence] + “ + The BluetoothProfileDescriptorList attribute consists of a data element + sequence in which each element is a profile descriptor that contains information + about a Bluetooth profile to which the service represented by this service + record conforms. Each profile descriptor is a data element sequence whose + first element is the UUID assigned to the profile and whose second element is + a 16-bit profile version number. + ”“ + Each version of a profile is assigned a 16-bit unsigned integer profile version + number, which consists of two 8-bit fields. The higher-order 8 bits contain the + major version number field and the lower-order 8 bits contain the minor version + number field. The initial version of each profile has a major version of 1 and a + minor version of 0. When upward compatible changes are made to the profile, + the minor version number will be incremented. If incompatible changes are + made to the profile, the major version number will be incremented. + ” + + + + + This attribute is a URL which points to documentation on the service described + by a service record. + [0x000A] + + + [URL] + + + + + This attribute contains a URL that refers to the location of an application that + may be used to utilize the service described by the service record. + [0x000B] + + + [URL] + “ + This attribute contains a URL that refers to the location of an application that + may be used to utilize the service described by the service record. Since different + operating environments require different executable formats, a mechanism + has been defined to allow this single attribute to be used to locate an executable + that is appropriate for the client device’s operating environment. In the + attribute value URL, the first byte with the value 0x2A (ASCII character ‘*’) is to + be replaced by the client application with a string representing the desired + operating environment before the URL is to be used. + ”“ + The list of standardized strings representing operating environments is contained + in the Bluetooth Assigned Numbers document. + ”“ + For example, assume that the value of the ClientExecutableURL attribute is + http://my.fake/public/*/client.exe. On a device capable of executing SH3 WindowsCE + files, this URL would be changed to http://my.fake/public/sh3- + microsoft-wince/client.exe. On a device capable of executing Windows 98 binaries, + this URL would be changed to http://my.fake/public/i86-microsoft-win98/ + client.exe. + ” + + + + + This attribute contains a URL that refers to the location of an icon that may be + used to represent the service described by the service record. + [0x000C] + + + [URL] + “ + This attribute contains a URL that refers to the location of an icon that may be + used to represent the service described by the service record. Since different + hardware devices require different icon formats, a mechanism has been + defined to allow this single attribute to be used to locate an icon that is appropriate + for the client device. In the attribute value URL, the first byte with the + value 0x2A (ASCII character ‘*’) is to be replaced by the client application with + a string representing the desired icon format before the URL is to be used. + ”“ + The list of standardized strings representing icon formats is contained in the + Bluetooth Assigned Numbers document. + ”“ + For example, assume that the value of the IconURL attribute is http://my.fake/ + public/icons/*. On a device that prefers 24 x 24 icons with 256 colors, this URL + would be changed to http://my.fake/public/icons/24x24x8.png. On a device that + prefers 10 x 10 monochrome icons, this URL would be changed to http:// + my.fake/public/icons/10x10x1.png. + ” + + + + + The ServiceName attribute is a string containing the name of the service represented + by a service record. + [0x0000 + LangBaseAttrId] + + + [String] + “ + The ServiceName attribute is a string containing the name of the service represented + by a service record. It should be brief and suitable for display with an + Icon representing the service. The offset 0x0000 must be added to the attribute + ID base (contained in the LanguageBaseAttributeIDList attribute) in order to + compute the attribute ID for this attribute. + ” + + + + + This attribute is a string containing a brief description of the service. + [0x0001 + LangBaseAttrId] + + + [String] + “ + This attribute is a string containing a brief description of the service. It should + be less than 200 characters in length. The offset 0x0001 must be added to the + attribute ID base (contained in the LanguageBaseAttributeIDList attribute) in + order to compute the attribute ID for this attribute. + ” + + + + + This attribute is a string containing the name of the person or organization providing + the service. + [0x0002 + LangBaseAttrId] + + + [String] + “ + This attribute is a string containing the name of the person or organization providing + the service. The offset 0x0002 must be added to the attribute ID base + (contained in the LanguageBaseAttributeIDList attribute) in order to compute + the attribute ID for this attribute. + ” + + + + + The AdditionalProtocolDescriptorLists attribute supports services that + require more channels in addition to the service described in the ProtocolDescriptorList + attribute. It contains a sequence of ProtocolDescriptorList-elements. + [0x000D] + + + [Data Element Sequence or Data Element Alternative] + Defined in Bluetooth version 2.1, SDP section 5.1.6. + “The AdditionalProtocolDescriptorLists attribute contains + a sequence of ProtocolDescriptorList-elements. Each element having the + same format as the + described in section 5.1.5. The ordering of the elements is + significant and should be specified and fixed in Profiles that make use of this + attribute. + ”The AdditionalProtocolDescriptorLists attribute supports services that require + more channels in addition to the service described in Section 5.1.5 . If the AdditionalProtocolDescriptorLists + attribute is included in a service record, the ProtocolDescriptorList + attribute must be included.” + + + + + + This service class describes service records that contain attributes of service + discovery server itself. + + + “ + This service class describes service records that contain attributes of service + discovery server itself. The attributes listed in this section are only valid if the + ServiceClassIDList attribute contains the + ServiceDiscoveryServerServiceClassID. Note that all of the universal attributes + may be included in service records of the ServiceDiscoveryServer class. + ” + “Attribute IDs in the range of 0x0202-0x02FF are reserved.” + + + + + The VersionNumberList is a data element sequence in which each element of + the sequence is a version number supported by the SDP server. + + + [Data Element Sequence] + “ + The VersionNumberList is a data element sequence in which each element of + the sequence is a version number supported by the SDP server. + ”“ + A version number is a 16-bit unsigned integer consisting of two fields. The + higher-order 8 bits contain the major version number field and the low-order 8 + bits contain the minor version number field. The initial version of SDP has a + major version of 1 and a minor version of 0. When upward compatible changes + are made to the protocol, the minor version number will be incremented. If + incompatible changes are made to SDP, the major version number will be + incremented. This guarantees that if a client and a server support a common + major version number, they can communicate if each uses only features of the + specification with a minor version number that is supported by both client and + server. + ” + + + + + The ServiceDatabaseState is a 32-bit integer that is used to facilitate caching + of service records. + + + [32-bit unsigned integer] + “ + The ServiceDatabaseState is a 32-bit integer that is used to facilitate caching + of service records. If this attribute exists, its value is guaranteed to change + when any of the other service records are added to or deleted from the server's + database. If this value has not changed since the last time a client queried its + value, the client knows that a) none of the other service records maintained by + the SDP server have been added or deleted; and b) any service record handles + acquired from the server are still valid. A client should query this attribute's + value when a connection to the server is established, prior to using any service + record handles acquired during a previous connection. + ”“ + Note that the ServiceDatabaseState attribute does not change when existing + service records are modified, including the addition, removal, or modification of + service attributes. A service record's ServiceRecordState attribute indicates + when that service record is modified. + ” + + + + + This service class describes the ServiceRecord provided for each BrowseGroupDescriptor + service offered on a Bluetooth device. + + + “ + This service class describes the ServiceRecord provided for each BrowseGroupDescriptor + service offered on a Bluetooth device. The attributes listed in + this section are only valid if the ServiceClassIDList attribute contains the BrowseGroupDescriptorServiceClassID. + Note that all of the universal attributes may + be included in service records of the BrowseGroupDescriptor class. + ” + “Attribute IDs in the range of 0x0201-0x02FF are reserved.” + + + + + This attribute contains a UUID that can be used to locate services that are + members of the browse group that this service record describes. + + + [UUID] + + + + + For use on NETCFv2 + + - + + + + + Initializes a new instance of the class + + - + The filename of the log file to write to. + Unlike the .NET supplied class this filename is relative to the + folder that the calling assembly is located in. + + + + + NETCF doesn't have + + + + + Standard IrDA service names. + + + + + Well-known Service Name “IrDA:IrCOMM” + + + + + Well-known Service Name “IrLPT” + + + + + Well-known Service Name “OBEX” + + + + + Holds an attribute from an SDP service record. + + - + + Access its SDP Data Element through the + property and read the + data value through the methods and properties on the returned + . + + + + + Initializes a new instance of the class. + + - + The Attribute Id as a . + The value as a . + + + + Initializes a new instance of the class. + + - + The Attribute Id as a . + The value as a . + + + + Get the Attribute Id for this attribute. + + - + + Id is a unsigned 32-bit integer but we use return it + is a signed 32-bit integer for CLS Compliance reasons. It + should not thus be used for ordering etc, for example 0xFFFF will sort + before 0x0001 which is backwards. + + + + + + Get the Attribute Id as a number, e.g. for comparison. + + - + + Property should be used as an identifier, + but not as a number. That#x2019;s because the range is unsigned + 32-bit integer but we use return it is a signed 32-bit integer. + Thus an example list will sort as { 0xFFFF, 0x8001, 0x0001, 0x0302 } + when it should sort as { 0x0001, 0x0302, 0x8001,0xFFFF } + + + + + + Get the value of this attributes as a + + + + + Stores the LMP etc versions. + + + + + Initialises a new instance. + + - + The LMP Version. + + The LMP Subversion + as a . + + The LMP Supported Features. + + The Manufacturer. + + + Get the LMP Subversion value. + + + + + Get the LMP Version. + + + + + Get the LMP Subversion. + + - + + This is of CLR type for CLS + compliance. The Bluetooth value is of course of type + . + + + + + + Get the LMP Supported Features. + + + + + Get the Manufacturer. + + + + + + + + Define for service attribute, all the 'Descriptor Type' values. + These are also referred to as 'attribute type' values + + + + + Define RFCOMM Port events that registered application can receive in the callback + + + + + Any Character received + + + + + Received certain character + + + + + Transmitt Queue Empty + + + + + CTS changed state + + + + + DSR changed state + + + + + RLSD changed state + + + + + Ring signal detected + + + + + Line status error occurred + + + + + Ring signal detected + + + + + CTS state + + + + + DSR state + + + + + RLSD state + + + + + receiver buffer overrun + + + + + Any character transmitted + + + + + RFCOMM connection established + + + + + Was not able to establish connection; or disconnected + + + + + flow control enabled flag changed by remote + + + + + flow control status true = enabled + + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/Bluetooth/InTheHand.Net.Personal.dll b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/Bluetooth/InTheHand.Net.Personal.dll new file mode 100644 index 0000000..ac4a2bb --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/Bluetooth/InTheHand.Net.Personal.dll Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CmdMessenger.sln b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CmdMessenger.sln new file mode 100644 index 0000000..44a42cc --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CmdMessenger.sln @@ -0,0 +1,149 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.30723.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommandMessenger", "CommandMessenger\CommandMessenger.csproj", "{3CF8F8FC-6F5C-46F8-94DC-C2E4C505ECA4}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "1-Receive", "Receive\1-Receive.csproj", "{C5545DBA-7364-4FD1-B061-9C5FA5C06141}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "2-SendAndReceive", "SendAndReceive\2-SendAndReceive.csproj", "{37286642-47EE-44D8-87D9-3CFAFC8D68BD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "3-SendAndReceiveArguments", "SendAndReceiveArguments\3-SendAndReceiveArguments.csproj", "{A1DBBE25-AD1A-4AA0-9CB4-5BD47B495178}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "4-SendAndReceiveBinaryArguments", "SendAndReceiveBinaryArguments\4-SendAndReceiveBinaryArguments.csproj", "{E8A22A1D-5EA8-4FF1-808A-503225720837}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "5-DataLogging", "DataLogging\5-DataLogging.csproj", "{8CBED77C-78BF-453F-8733-97798A95916F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "6-ArduinoController", "ArduinoController\6-ArduinoController.csproj", "{F994C186-EB6F-4E71-B274-DBF46F3534BB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "7-TemperatureControl", "TemperatureControl\7-TemperatureControl.csproj", "{78810760-E45A-4ACB-8D94-0E359E2F73FB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommandMessengerTests", "CommandMessengerTests\CommandMessengerTests.csproj", "{B869057C-DAB3-4C19-958C-C89D3B1521EC}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3CF8F8FC-6F5C-46F8-94DC-C2E4C505ECA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3CF8F8FC-6F5C-46F8-94DC-C2E4C505ECA4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3CF8F8FC-6F5C-46F8-94DC-C2E4C505ECA4}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {3CF8F8FC-6F5C-46F8-94DC-C2E4C505ECA4}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {3CF8F8FC-6F5C-46F8-94DC-C2E4C505ECA4}.Debug|x86.ActiveCfg = Debug|Any CPU + {3CF8F8FC-6F5C-46F8-94DC-C2E4C505ECA4}.Debug|x86.Build.0 = Debug|Any CPU + {3CF8F8FC-6F5C-46F8-94DC-C2E4C505ECA4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3CF8F8FC-6F5C-46F8-94DC-C2E4C505ECA4}.Release|Any CPU.Build.0 = Release|Any CPU + {3CF8F8FC-6F5C-46F8-94DC-C2E4C505ECA4}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {3CF8F8FC-6F5C-46F8-94DC-C2E4C505ECA4}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {3CF8F8FC-6F5C-46F8-94DC-C2E4C505ECA4}.Release|x86.ActiveCfg = Release|Any CPU + {3CF8F8FC-6F5C-46F8-94DC-C2E4C505ECA4}.Release|x86.Build.0 = Release|Any CPU + {C5545DBA-7364-4FD1-B061-9C5FA5C06141}.Debug|Any CPU.ActiveCfg = Debug|x86 + {C5545DBA-7364-4FD1-B061-9C5FA5C06141}.Debug|Any CPU.Build.0 = Debug|x86 + {C5545DBA-7364-4FD1-B061-9C5FA5C06141}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {C5545DBA-7364-4FD1-B061-9C5FA5C06141}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {C5545DBA-7364-4FD1-B061-9C5FA5C06141}.Debug|x86.ActiveCfg = Debug|x86 + {C5545DBA-7364-4FD1-B061-9C5FA5C06141}.Debug|x86.Build.0 = Debug|x86 + {C5545DBA-7364-4FD1-B061-9C5FA5C06141}.Release|Any CPU.ActiveCfg = Release|x86 + {C5545DBA-7364-4FD1-B061-9C5FA5C06141}.Release|Any CPU.Build.0 = Release|x86 + {C5545DBA-7364-4FD1-B061-9C5FA5C06141}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {C5545DBA-7364-4FD1-B061-9C5FA5C06141}.Release|Mixed Platforms.Build.0 = Release|x86 + {C5545DBA-7364-4FD1-B061-9C5FA5C06141}.Release|x86.ActiveCfg = Release|x86 + {C5545DBA-7364-4FD1-B061-9C5FA5C06141}.Release|x86.Build.0 = Release|x86 + {37286642-47EE-44D8-87D9-3CFAFC8D68BD}.Debug|Any CPU.ActiveCfg = Debug|x86 + {37286642-47EE-44D8-87D9-3CFAFC8D68BD}.Debug|Any CPU.Build.0 = Debug|x86 + {37286642-47EE-44D8-87D9-3CFAFC8D68BD}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {37286642-47EE-44D8-87D9-3CFAFC8D68BD}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {37286642-47EE-44D8-87D9-3CFAFC8D68BD}.Debug|x86.ActiveCfg = Debug|x86 + {37286642-47EE-44D8-87D9-3CFAFC8D68BD}.Debug|x86.Build.0 = Debug|x86 + {37286642-47EE-44D8-87D9-3CFAFC8D68BD}.Release|Any CPU.ActiveCfg = Release|x86 + {37286642-47EE-44D8-87D9-3CFAFC8D68BD}.Release|Any CPU.Build.0 = Release|x86 + {37286642-47EE-44D8-87D9-3CFAFC8D68BD}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {37286642-47EE-44D8-87D9-3CFAFC8D68BD}.Release|Mixed Platforms.Build.0 = Release|x86 + {37286642-47EE-44D8-87D9-3CFAFC8D68BD}.Release|x86.ActiveCfg = Release|x86 + {37286642-47EE-44D8-87D9-3CFAFC8D68BD}.Release|x86.Build.0 = Release|x86 + {A1DBBE25-AD1A-4AA0-9CB4-5BD47B495178}.Debug|Any CPU.ActiveCfg = Debug|x86 + {A1DBBE25-AD1A-4AA0-9CB4-5BD47B495178}.Debug|Any CPU.Build.0 = Debug|x86 + {A1DBBE25-AD1A-4AA0-9CB4-5BD47B495178}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {A1DBBE25-AD1A-4AA0-9CB4-5BD47B495178}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {A1DBBE25-AD1A-4AA0-9CB4-5BD47B495178}.Debug|x86.ActiveCfg = Debug|x86 + {A1DBBE25-AD1A-4AA0-9CB4-5BD47B495178}.Debug|x86.Build.0 = Debug|x86 + {A1DBBE25-AD1A-4AA0-9CB4-5BD47B495178}.Release|Any CPU.ActiveCfg = Release|x86 + {A1DBBE25-AD1A-4AA0-9CB4-5BD47B495178}.Release|Any CPU.Build.0 = Release|x86 + {A1DBBE25-AD1A-4AA0-9CB4-5BD47B495178}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {A1DBBE25-AD1A-4AA0-9CB4-5BD47B495178}.Release|Mixed Platforms.Build.0 = Release|x86 + {A1DBBE25-AD1A-4AA0-9CB4-5BD47B495178}.Release|x86.ActiveCfg = Release|x86 + {A1DBBE25-AD1A-4AA0-9CB4-5BD47B495178}.Release|x86.Build.0 = Release|x86 + {E8A22A1D-5EA8-4FF1-808A-503225720837}.Debug|Any CPU.ActiveCfg = Debug|x86 + {E8A22A1D-5EA8-4FF1-808A-503225720837}.Debug|Any CPU.Build.0 = Debug|x86 + {E8A22A1D-5EA8-4FF1-808A-503225720837}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {E8A22A1D-5EA8-4FF1-808A-503225720837}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {E8A22A1D-5EA8-4FF1-808A-503225720837}.Debug|x86.ActiveCfg = Debug|x86 + {E8A22A1D-5EA8-4FF1-808A-503225720837}.Debug|x86.Build.0 = Debug|x86 + {E8A22A1D-5EA8-4FF1-808A-503225720837}.Release|Any CPU.ActiveCfg = Release|x86 + {E8A22A1D-5EA8-4FF1-808A-503225720837}.Release|Any CPU.Build.0 = Release|x86 + {E8A22A1D-5EA8-4FF1-808A-503225720837}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {E8A22A1D-5EA8-4FF1-808A-503225720837}.Release|Mixed Platforms.Build.0 = Release|x86 + {E8A22A1D-5EA8-4FF1-808A-503225720837}.Release|x86.ActiveCfg = Release|x86 + {E8A22A1D-5EA8-4FF1-808A-503225720837}.Release|x86.Build.0 = Release|x86 + {8CBED77C-78BF-453F-8733-97798A95916F}.Debug|Any CPU.ActiveCfg = Debug|x86 + {8CBED77C-78BF-453F-8733-97798A95916F}.Debug|Any CPU.Build.0 = Debug|x86 + {8CBED77C-78BF-453F-8733-97798A95916F}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {8CBED77C-78BF-453F-8733-97798A95916F}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {8CBED77C-78BF-453F-8733-97798A95916F}.Debug|x86.ActiveCfg = Debug|x86 + {8CBED77C-78BF-453F-8733-97798A95916F}.Debug|x86.Build.0 = Debug|x86 + {8CBED77C-78BF-453F-8733-97798A95916F}.Release|Any CPU.ActiveCfg = Release|x86 + {8CBED77C-78BF-453F-8733-97798A95916F}.Release|Any CPU.Build.0 = Release|x86 + {8CBED77C-78BF-453F-8733-97798A95916F}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {8CBED77C-78BF-453F-8733-97798A95916F}.Release|Mixed Platforms.Build.0 = Release|x86 + {8CBED77C-78BF-453F-8733-97798A95916F}.Release|x86.ActiveCfg = Release|x86 + {8CBED77C-78BF-453F-8733-97798A95916F}.Release|x86.Build.0 = Release|x86 + {F994C186-EB6F-4E71-B274-DBF46F3534BB}.Debug|Any CPU.ActiveCfg = Debug|x86 + {F994C186-EB6F-4E71-B274-DBF46F3534BB}.Debug|Any CPU.Build.0 = Debug|x86 + {F994C186-EB6F-4E71-B274-DBF46F3534BB}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {F994C186-EB6F-4E71-B274-DBF46F3534BB}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {F994C186-EB6F-4E71-B274-DBF46F3534BB}.Debug|x86.ActiveCfg = Debug|x86 + {F994C186-EB6F-4E71-B274-DBF46F3534BB}.Debug|x86.Build.0 = Debug|x86 + {F994C186-EB6F-4E71-B274-DBF46F3534BB}.Release|Any CPU.ActiveCfg = Release|x86 + {F994C186-EB6F-4E71-B274-DBF46F3534BB}.Release|Any CPU.Build.0 = Release|x86 + {F994C186-EB6F-4E71-B274-DBF46F3534BB}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {F994C186-EB6F-4E71-B274-DBF46F3534BB}.Release|Mixed Platforms.Build.0 = Release|x86 + {F994C186-EB6F-4E71-B274-DBF46F3534BB}.Release|x86.ActiveCfg = Release|x86 + {F994C186-EB6F-4E71-B274-DBF46F3534BB}.Release|x86.Build.0 = Release|x86 + {78810760-E45A-4ACB-8D94-0E359E2F73FB}.Debug|Any CPU.ActiveCfg = Debug|x86 + {78810760-E45A-4ACB-8D94-0E359E2F73FB}.Debug|Any CPU.Build.0 = Debug|x86 + {78810760-E45A-4ACB-8D94-0E359E2F73FB}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {78810760-E45A-4ACB-8D94-0E359E2F73FB}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {78810760-E45A-4ACB-8D94-0E359E2F73FB}.Debug|x86.ActiveCfg = Debug|x86 + {78810760-E45A-4ACB-8D94-0E359E2F73FB}.Debug|x86.Build.0 = Debug|x86 + {78810760-E45A-4ACB-8D94-0E359E2F73FB}.Release|Any CPU.ActiveCfg = Release|x86 + {78810760-E45A-4ACB-8D94-0E359E2F73FB}.Release|Any CPU.Build.0 = Release|x86 + {78810760-E45A-4ACB-8D94-0E359E2F73FB}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {78810760-E45A-4ACB-8D94-0E359E2F73FB}.Release|Mixed Platforms.Build.0 = Release|x86 + {78810760-E45A-4ACB-8D94-0E359E2F73FB}.Release|x86.ActiveCfg = Release|x86 + {78810760-E45A-4ACB-8D94-0E359E2F73FB}.Release|x86.Build.0 = Release|x86 + {B869057C-DAB3-4C19-958C-C89D3B1521EC}.Debug|Any CPU.ActiveCfg = Debug|x86 + {B869057C-DAB3-4C19-958C-C89D3B1521EC}.Debug|Any CPU.Build.0 = Debug|x86 + {B869057C-DAB3-4C19-958C-C89D3B1521EC}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {B869057C-DAB3-4C19-958C-C89D3B1521EC}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {B869057C-DAB3-4C19-958C-C89D3B1521EC}.Debug|x86.ActiveCfg = Debug|x86 + {B869057C-DAB3-4C19-958C-C89D3B1521EC}.Debug|x86.Build.0 = Debug|x86 + {B869057C-DAB3-4C19-958C-C89D3B1521EC}.Release|Any CPU.ActiveCfg = Release|x86 + {B869057C-DAB3-4C19-958C-C89D3B1521EC}.Release|Any CPU.Build.0 = Release|x86 + {B869057C-DAB3-4C19-958C-C89D3B1521EC}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {B869057C-DAB3-4C19-958C-C89D3B1521EC}.Release|Mixed Platforms.Build.0 = Release|x86 + {B869057C-DAB3-4C19-958C-C89D3B1521EC}.Release|x86.ActiveCfg = Release|x86 + {B869057C-DAB3-4C19-958C-C89D3B1521EC}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(MonoDevelopProperties) = preSolution + StartupItem = TemperatureControl\7-TemperatureControl.csproj + EndGlobalSection +EndGlobal diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CmdMessenger.userprefs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CmdMessenger.userprefs new file mode 100644 index 0000000..dcc95da --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CmdMessenger.userprefs @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/BinaryConverter.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/BinaryConverter.cs new file mode 100644 index 0000000..4fdbe4b --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/BinaryConverter.cs @@ -0,0 +1,319 @@ +#region CmdMessenger - MIT - (c) 2013 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2013 - Thijs Elenbaas +*/ +#endregion + +using System; +using System.Text; + +namespace CommandMessenger +{ + public class BinaryConverter + { + private static Encoding _stringEncoder = Encoding.GetEncoding("ISO-8859-1"); // The string encoder + + /// Sets the string encoder. + /// The string encoder. + public Encoding StringEncoder + { + set { _stringEncoder = value; } + } + + /***** from binary value to string ****/ + + /// Convert a float into a string representation. + /// The value to be converted. + /// A string representation of this object. + public static string ToString(float value) + { + try + { + byte[] byteArray = BitConverter.GetBytes(value); + return BytesToEscapedString(byteArray); + } + catch (Exception) + { + return null; + } + } + + /// Convert a Double into a string representation. + /// The value to be converted. + /// A string representation of this object. + public static string ToString(Double value) + { + try + { + byte[] byteArray = BitConverter.GetBytes(value); + return BytesToEscapedString(byteArray); + } + catch (Exception) + { + return null; + } + } + + /// Convert an int into a string representation. + /// The value to be converted. + /// A string representation of this object. + public static string ToString(int value) + { + try + { + byte[] byteArray = BitConverter.GetBytes(value); + return BytesToEscapedString(byteArray); + } + catch (Exception) + { + return null; + } + } + + /// Convert an unsigned int into a string representation. + /// The value to be converted. + /// A string representation of this object. + public static string ToString(uint value) + { + try + { + byte[] byteArray = BitConverter.GetBytes(value); + return BytesToEscapedString(byteArray); + } + catch (Exception) + { + return null; + } + } + + /// Convert a short into a string representation. + /// The value to be converted. + /// A string representation of this object. + public static string ToString(short value) + { + try + { + byte[] byteArray = BitConverter.GetBytes(value); + return BytesToEscapedString(byteArray); + } + catch (Exception) + { + return null; + } + } + + /// Convert an unsigned an unsigned short into a string representation. + /// The value to be converted. + /// A string representation of this object. + public static string ToString(ushort value) + { + try + { + byte[] byteArray = BitConverter.GetBytes(value); + return BytesToEscapedString(byteArray); + } + catch (Exception) + { + return null; + } + } + + /// Convert a byte into a string representation. + /// The value to be converted. + /// A string representation of this object. + public static string ToString(byte value) + { + try + { + return BytesToEscapedString(new byte[] {value}); + } + catch (Exception) + { + return null; + } + } + + + /***** from string to binary value ****/ + + /// Converts a string to a float. + /// The value to be converted. + /// Input string as a float? + public static float? ToFloat(String value) + { + try + { + byte[] bytes = EscapedStringToBytes(value); + if (bytes.Length < 4) + { + return null; + } + return BitConverter.ToSingle(bytes, 0); + } + catch (Exception) + { + return null; + } + } + + /// Converts a string representation to a double. + /// The value to be converted. + /// Input string as a Double? + public static Double? ToDouble(String value) + { + try + { + byte[] bytes = EscapedStringToBytes(value); + return BitConverter.ToDouble(bytes, 0); + } + catch (Exception) + { + return null; + } + } + + /// Converts a string representation to an int 32. + /// The value to be converted. + /// This object as an Int32? + public static Int32? ToInt32(String value) + { + try + { + byte[] bytes = EscapedStringToBytes(value); + return BitConverter.ToInt32(bytes, 0); + } + catch (Exception) + { + return null; + } + } + + /// Converts a string representation to a u int 32. + /// The value to be converted. + /// Input string as a UInt32? + public static UInt32? ToUInt32(String value) + { + try + { + byte[] bytes = EscapedStringToBytes(value); + return BitConverter.ToUInt32(bytes, 0); + } + catch (Exception) + { + return null; + } + } + + /// Converts a string representation to a u int 16. + /// The value to be converted. + /// Input string as a UInt16? + public static UInt16? ToUInt16(String value) + { + try + { + byte[] bytes = EscapedStringToBytes(value); + return BitConverter.ToUInt16(bytes, 0); + } + catch (Exception) + { + return null; + } + } + + /// Converts a string representation to an int 16. + /// The value to be converted. + /// This object as an Int16? + public static Int16? ToInt16(String value) + { + try + { + byte[] bytes = EscapedStringToBytes(value); + return BitConverter.ToInt16(bytes, 0); + } + catch (Exception) + { + return null; + } + } + + /// Converts a string representation to a byte. + /// The value to be converted. + /// Input string as a byte? + public static byte? ToByte(String value) + { + try + { + byte[] bytes = EscapedStringToBytes(value); + return bytes[0]; + } + catch (Exception) + { + return null; + } + } + + /***** conversion functions ****/ + + /// Converts a byte array to escaped string. + /// Array of bytes. + /// input value as an escaped string. + private static string BytesToEscapedString(byte[] byteArray) + { + try + { + string stringValue = _stringEncoder.GetString(byteArray); + return Escaping.Escape(stringValue); + } + catch (Exception) + { + return null; + } + } + + /// Converts an escaped string to a bytes array. + /// The value to be converted. + /// input value as an escaped string. + public static byte[] EscapedStringToBytes(String value) + { + try + { + string unEscapedValue = Escaping.Unescape(value); + return _stringEncoder.GetBytes(unEscapedValue); + } + catch (Exception) + { + return null; + } + } + + /// Converts a string to a bytes array. + /// The value to be converted. + /// input value as a byte array. + public static byte[] StringToBytes(string value) + { + return _stringEncoder.GetBytes(value); + } + + /// Converts a char array to a bytes array. + /// The value to be converted. + /// input value as a byte array. + public static byte[] CharsToBytes(char[] value) + { + return _stringEncoder.GetBytes(value); + } + + } +} \ No newline at end of file diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Bluetooth/BluetoothConnectionManager.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Bluetooth/BluetoothConnectionManager.cs new file mode 100644 index 0000000..1906e94 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Bluetooth/BluetoothConnectionManager.cs @@ -0,0 +1,344 @@ +#region CmdMessenger - MIT - (c) 2014 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2014 - Thijs Elenbaas +*/ +#endregion + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.Serialization.Formatters.Binary; +using System.Threading; +using InTheHand.Net; +using InTheHand.Net.Bluetooth; +using InTheHand.Net.Sockets; + +namespace CommandMessenger.Bluetooth +{ + + + /// + /// Class for storing last succesfull connection + /// + [Serializable] + public class BluetoothConfiguration + { + public BluetoothAddress BluetoothAddress { get; set; } + public Dictionary StoredDevicePins { get; set; } + } + + /// + /// Connection manager for Bluetooth devices + /// + public class BluetoothConnectionManager : ConnectionManager + { + private static readonly List CommonDevicePins = new List + { + "0000", + "1111", + "1234" + }; + + const string SettingsFileName = @"LastConnectedBluetoothSetting.cfg"; + private BluetoothConfiguration _bluetoothConfiguration; + private readonly BluetoothTransport _bluetoothTransport; + private int _scanType; + //private bool _activeConnection; + + // The control to invoke the callback on + private readonly object _tryConnectionLock = new object(); + private readonly List _deviceList; + private List _prevDeviceList; + + /// + /// Connection manager for Bluetooth devices + /// + public BluetoothConnectionManager(BluetoothTransport bluetoothTransport, CmdMessenger cmdMessenger, int challengeCommandId, int responseCommandId) : + base(cmdMessenger, challengeCommandId,responseCommandId) + { + WatchdogTimeOut = 2000; + WatchdogRetryTimeOut = 1000; + MaxWatchdogTries = 3; + + if (bluetoothTransport == null) return; + if (cmdMessenger == null) return; + + ControlToInvokeOn = null; + _bluetoothTransport = bluetoothTransport; + + _bluetoothConfiguration = new BluetoothConfiguration(); + ReadSettings(); + + _deviceList = new List(); + _prevDeviceList = new List(); + + StartConnectionManager(); + } + + + protected override void DoWorkScan() + { + if (Thread.CurrentThread.Name == null) Thread.CurrentThread.Name = "BluetoothConnectionManager"; + var activeConnection = false; + + //if (!_activeConnection) + { + + if (_scanType == 0) + { + _scanType = 1; + try { activeConnection = QuickScan(); } catch { } + } + else if (_scanType == 1) + { + _scanType = 0; + try { activeConnection = QuickScan(); } catch { } + } + } + + // Trigger event when a connection was made + if (activeConnection) + { + ConnectionManagerState = ConnectionManagerStates.Wait; + ConnectionFoundEvent(); + + } + } + + private void QuickScanDevices() + { + // Fast + _prevDeviceList = _deviceList; + _deviceList.Clear(); + _deviceList.AddRange(_bluetoothTransport.BluetoothClient.DiscoverDevices(255, true, true, false, false)); + } + + public void ThorougScanForDevices() + { + // Slow + _deviceList.Clear(); + _deviceList.AddRange(_bluetoothTransport.BluetoothClient.DiscoverDevices(65536, true, true, true, true)); + } + + public bool PairDevice(BluetoothDeviceInfo device) + { + //device.Update(); + if (device.Authenticated) return true; + // Check if PIN has been stored + if (_bluetoothConfiguration.StoredDevicePins.ContainsKey(device.DeviceAddress)) + { + if (BluetoothSecurity.PairRequest(device.DeviceAddress, _bluetoothConfiguration.StoredDevicePins[device.DeviceAddress])) + { + device.Update(); + return device.Authenticated; + } + } + + // loop through common PIN numbers to see if they pair + foreach (string devicePin in CommonDevicePins) + { + var isPaired = BluetoothSecurity.PairRequest(device.DeviceAddress, devicePin); + if (isPaired) + { + _bluetoothConfiguration.StoredDevicePins[device.DeviceAddress] = devicePin; + StoreSettings(); + break; + } + } + + device.Update(); + return device.Authenticated; + } + + public bool TryConnection(BluetoothAddress bluetoothAddress, int timeOut) + { + if (bluetoothAddress == null) return false; + // Find + foreach (var bluetoothDeviceInfo in _deviceList) + { + if (bluetoothDeviceInfo.DeviceAddress == bluetoothAddress) + { + return TryConnection(bluetoothDeviceInfo, timeOut); + } + } + return false; + } + + public bool TryConnection(BluetoothDeviceInfo bluetoothDeviceInfo, int timeOut) + { + // Try specific settings + _bluetoothTransport.CurrentBluetoothDeviceInfo = bluetoothDeviceInfo; + return TryConnection(timeOut); + } + + public bool TryConnection(int timeOut) + { + lock (_tryConnectionLock) + { + // Check if an (old) connection exists + if (_bluetoothTransport.CurrentBluetoothDeviceInfo == null) return false; + + Connected = false; + Log(1, @"Trying Bluetooth device " + _bluetoothTransport.CurrentBluetoothDeviceInfo.DeviceName); + if (_bluetoothTransport.Connect()) + { + Log(3, + @"Connected with Bluetooth device " + _bluetoothTransport.CurrentBluetoothDeviceInfo.DeviceName + + ", requesting response"); + Connected = (ArduinoAvailable(timeOut, 5)); + + if (Connected) + { + Log(1, + "Connected with Bluetooth device " + + _bluetoothTransport.CurrentBluetoothDeviceInfo.DeviceName); + StoreSettings(); + } + else + { + Log(3, + @"Connected with Bluetooth device " + + _bluetoothTransport.CurrentBluetoothDeviceInfo.DeviceName + ", received no response"); + } + return Connected; + } + else + { + Log(3, + @"No connection made with Bluetooth device " + _bluetoothTransport.CurrentBluetoothDeviceInfo.DeviceName ); + } + return false; + } + } + + + + // Single scan on foreground thread + public bool SingleScan() + { + if (QuickScan()) return true; + if (ThoroughScan()) return true; + return false; + } + + public bool QuickScan() + { + Log(3, "Performing quick scan"); + const int longTimeOut = 1000; + const int shortTimeOut = 1000; + + // First try if currentConnection is open or can be opened + if (TryConnection(longTimeOut)) return true; + + // Do a quick rescan of all devices in range + QuickScanDevices(); + + // Then try if last stored connection can be opened + Log(3, "Trying last stored connection"); + + if (TryConnection(_bluetoothConfiguration.BluetoothAddress, longTimeOut)) return true; + + // Then see if new devices have been added to the list + if (NewDevicesScan()) return true; + + foreach (var device in _deviceList) + { + Thread.Sleep(200); + Log(1, "Trying Device " + device.DeviceName + " (" + device.DeviceAddress + ") " ); + if (TryConnection(device, shortTimeOut)) return true; + } + + return false; + } + + public bool ThoroughScan() + { + Log(3, "Performing thorough scan"); + const int longTimeOut = 1000; + const int shortTimeOut = 1000; + + // First try if currentConnection is open or can be opened + if (TryConnection(longTimeOut)) return true; + + // Do a quick rescan of all devices in range + ThorougScanForDevices(); + + // Then try if last stored connection can be opened + Log(3, "Trying last stored connection"); + if (TryConnection(_bluetoothConfiguration.BluetoothAddress, longTimeOut)) return true; + + // Then see if new devices have been added to the list + if (NewDevicesScan()) return true; + + foreach (var device in _deviceList) + { + Thread.Sleep(1000); + if (PairDevice(device)) + { + Log(1, "Trying Device " + device.DeviceName + " (" + device.DeviceAddress + ") "); + if (TryConnection(device, shortTimeOut)) return true; + } + } + return false; + } + + public bool NewDevicesScan() + { + const int shortTimeOut = 200; + + // Then see if port list has changed + var newDevices = NewDevicesInList(); + if (newDevices.Count == 0) { return false; } + + Log(1, "Trying new devices"); + + foreach (var device in newDevices) + { + if (TryConnection(device, shortTimeOut)) return true; + Thread.Sleep(100); + } + return false; + } + + private List NewDevicesInList() + { + return (from device in _deviceList from prevdevice in _prevDeviceList where device.DeviceAddress != prevdevice.DeviceAddress select device).ToList(); + } + + private void StoreSettings() + { + _bluetoothConfiguration.BluetoothAddress = _bluetoothTransport.CurrentBluetoothDeviceInfo.DeviceAddress; + + var fileStream = File.Create(SettingsFileName); + var serializer = new BinaryFormatter(); + serializer.Serialize(fileStream,_bluetoothConfiguration); + fileStream.Close(); + } + + private void ReadSettings() + { + // Read from file + if (File.Exists(SettingsFileName)) + { + var fileStream = File.OpenRead(SettingsFileName); + var deserializer = new BinaryFormatter(); + _bluetoothConfiguration = (BluetoothConfiguration)deserializer.Deserialize(fileStream); + fileStream.Close(); + } + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Bluetooth/BluetoothSettings.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Bluetooth/BluetoothSettings.cs new file mode 100644 index 0000000..6ceab3a --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Bluetooth/BluetoothSettings.cs @@ -0,0 +1,17 @@ +using InTheHand.Net; +using InTheHand.Net.Sockets; + +namespace CommandMessenger.Bluetooth +{ + public class BluetoothSettings + { + /// Default constructor. + public BluetoothSettings() + + { + } + + public BluetoothDeviceInfo BluetoothDeviceInfo; + public string Pin { get; set; } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Bluetooth/BluetoothTransport.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Bluetooth/BluetoothTransport.cs new file mode 100644 index 0000000..22638b6 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Bluetooth/BluetoothTransport.cs @@ -0,0 +1,381 @@ +#region CmdMessenger - MIT - (c) 2013 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2013 - Thijs Elenbaas +*/ +#endregion + +using System; +using System.IO; +using System.Net.Sockets; +using System.Threading; +using CommandMessenger.TransportLayer; +using InTheHand.Net; +using InTheHand.Net.Bluetooth; +using InTheHand.Net.Sockets; + +namespace CommandMessenger.Bluetooth +{ + public enum ThreadRunStates + { + Start, + Stop, + Abort, + } + + /// + /// Manager for Bluetooth connection + /// + public class BluetoothTransport : DisposableObject, ITransport + { + //private BluetoothEndPoint _localEndpoint; + //private BluetoothClient _localClient; + //private BluetoothComponent _localComponent; + private NetworkStream _stream; + //private Guid _guid = Guid.NewGuid(); + //private Guid_guid = new Guid("{00112233-4455-6677-8899-aabbccddeeff}"); + private readonly QueueSpeed _queueSpeed = new QueueSpeed(4,10); + private Thread _queueThread; + private ThreadRunStates _threadRunState; + private readonly object _threadRunStateLock = new object(); + private readonly object _readLock = new object(); + private readonly object _writeLock = new object(); + private const int BufferMax = 4096; + readonly byte[] _readBuffer = new byte[BufferMax]; + private int _bufferFilled; + + /// Gets or sets the run state of the thread . + /// The thread run state. + public ThreadRunStates ThreadRunState + { + set + { + lock (_threadRunStateLock) + { + _threadRunState = value; + } + } + get + { + ThreadRunStates result; + lock (_threadRunStateLock) + { + result = _threadRunState; + } + return result; + } + } + + /// Default constructor. + public BluetoothTransport() + { + Initialize(); + } + + ~BluetoothTransport() + { + Kill(); + } + + /// Initializes this object. + public void Initialize() + { + // _queueSpeed.Name = "Bluetooth"; + + _queueThread = new Thread(ProcessQueue) + { + Priority = ThreadPriority.Normal, + Name = "Bluetooth" + }; + ThreadRunState = ThreadRunStates.Start; + _queueThread.Start(); + while (!_queueThread.IsAlive) { Thread.Sleep(50); } + } + + #region Fields + + public event EventHandler NewDataReceived; // Event queue for all listeners interested in NewLinesReceived events. + + #endregion + + #region Properties + + /// Gets or sets the current serial port settings. + /// The current serial settings. + public BluetoothDeviceInfo CurrentBluetoothDeviceInfo { get; set; } + + public BluetoothClient BluetoothClient + { + get { return BluetoothUtils.LocalClient; } + } + + + #endregion + + #region Methods + + protected void ProcessQueue() + { + // Endless loop + while (ThreadRunState != ThreadRunStates.Abort) + { + Poll(ThreadRunState); + } + _queueSpeed.Sleep(50); + } + + public void StartPolling() + { + ThreadRunState = ThreadRunStates.Start; + } + + public void StopPolling() + { + ThreadRunState = ThreadRunStates.Stop; + } + + private void Poll(ThreadRunStates threadRunState) + { + var bytes = UpdateBuffer(); + if (threadRunState == ThreadRunStates.Start) + { + if (bytes > 0) + { + // Send an event + if (NewDataReceived != null) NewDataReceived(this, null); + // Signal so that processes waiting on this continue + } + } + } + + /// Polls for bluetooth device for data. + public void Poll() + { + Poll(ThreadRunStates.Start); + } + + /// Connects to a serial port defined through the current settings. + /// true if it succeeds, false if it fails. + public bool Connect() + { + // Closing serial port if it is open + _stream = null; + + // set pin of device to connect with + // check if device is paired + //CurrentBluetoothDeviceInfo.Refresh(); + try + { + if (!CurrentBluetoothDeviceInfo.Authenticated) + { + //Console.WriteLine("Not authenticated"); + return false; + } + + if (BluetoothClient.Connected) + { + //Console.WriteLine("Previously connected, setting up new connection"); + BluetoothUtils.UpdateClient(); + } + + // synchronous connection method + BluetoothClient.Connect(CurrentBluetoothDeviceInfo.DeviceAddress, BluetoothService.SerialPort); + //Console.WriteLine("New connection"); + //BluetoothClient.Connect(CurrentBluetoothDeviceInfo.DeviceAddress, _guid); + //BluetoothUtils.ConnectDevice(CurrentBluetoothDeviceInfo,null); + + if (!Open()) + { + Console.WriteLine("Stream not opened"); + return false; + } + + // Subscribe to event and open serial port for data + ThreadRunState = ThreadRunStates.Start; + return true; + } + catch (SocketException) + { + //Console.WriteLine("Socket exception while trying to connect"); + return false; + } + catch (InvalidOperationException) + { + BluetoothUtils.UpdateClient(); + return false; + } + } + + /// Opens the serial port. + /// true if it succeeds, false if it fails. + public bool Open() + { + if (!BluetoothClient.Connected) return false; + _stream = BluetoothClient.GetStream(); + _stream.ReadTimeout = 5; + return (true); + } + + public bool IsConnected() + { + // note: this does not always work. Perhaps do a scan + return BluetoothClient.Connected; + } + + public bool IsOpen() + { + // note: this does not always work. Perhaps do a scan + return IsConnected() && (_stream != null); + } + + + /// Closes the Bluetooth stream port. + /// true if it succeeds, false if it fails. + public bool Close() + { + // No closing needed + if (_stream == null) return true; + _stream.Close(); + _stream = null; + return true; + } + + /// Disconnect the bluetooth stream. + /// true if it succeeds, false if it fails. + public bool Disconnect() + { + ThreadRunState = ThreadRunStates.Stop; + var state = Close(); + return state; + } + + /// Writes a byte array to the bluetooth stream. + /// The buffer to write. + public void Write(byte[] buffer) + { + try + { + if (IsOpen()) + { + lock (_writeLock) + { + _stream.Write(buffer,0,buffer.Length); + } + } + } + catch + { + } + } + + /// Retrieves the address of the local bluetooth radio. + /// The address of the local bluetooth radio. + public BluetoothAddress RetreiveLocalBluetoothAddress() + { + var primaryRadio = BluetoothRadio.PrimaryRadio; + if (primaryRadio == null) return null; + return primaryRadio.LocalAddress; + } + + private int UpdateBuffer() + { + if (IsOpen()) + { + try + { + lock (_readLock) + { + //if (_stream.DataAvailable) + { + var nbrDataRead = _stream.Read(_readBuffer, _bufferFilled, (BufferMax - _bufferFilled)); + _bufferFilled += nbrDataRead; + } + } + return _bufferFilled; + } + catch (IOException) + { + // Timeout (expected) + } + } + return 0; + } + + /// Reads the serial buffer into the string buffer. + public byte[] Read() + { + if (IsOpen()) + { + byte[] buffer; + lock (_readLock) + { + buffer = new byte[_bufferFilled]; + Array.Copy(_readBuffer, buffer, _bufferFilled); + _bufferFilled = 0; + } + return buffer; + } + return new byte[0]; + } + + /// Gets the bytes in buffer. + /// Bytes in buffer + public int BytesInBuffer() + { + return IsOpen() ? _bufferFilled : 0; + } + + /// Kills this object. + public void Kill() + { + // Signal thread to abort + ThreadRunState = ThreadRunStates.Abort; + + //Wait for thread to die + Join(500); + if (_queueThread.IsAlive) _queueThread.Abort(); + + // Releasing stream + if (IsOpen()) Close(); + + // component is used to manage device discovery + //_localComponent.Dispose(); + + // client is used to manage connections + //_localClient.Dispose(); + } + + /// Joins the thread. + /// The milliseconds timeout. + /// true if it succeeds, false if it fails. + public bool Join(int millisecondsTimeout) + { + if (_queueThread.IsAlive == false) return true; + return _queueThread.Join(TimeSpan.FromMilliseconds(millisecondsTimeout)); + } + + // Dispose + protected override void Dispose(bool disposing) + { + if (disposing) + { + Kill(); + } + base.Dispose(disposing); + } + + #endregion + } +} \ No newline at end of file diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Bluetooth/BluetoothUtils.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Bluetooth/BluetoothUtils.cs new file mode 100644 index 0000000..45048b0 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Bluetooth/BluetoothUtils.cs @@ -0,0 +1,300 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Management; +using System.Net.Sockets; +using System.Runtime.InteropServices; +using InTheHand.Net; +using InTheHand.Net.Bluetooth; +using InTheHand.Net.Sockets; + +namespace CommandMessenger.Bluetooth +{ + public class BluetoothUtils{ + + public static BluetoothEndPoint LocalEndpoint { get; private set; } + public static BluetoothClient LocalClient { get; private set; } + public static BluetoothRadio PrimaryRadio { get; private set; } + private static readonly Guid Guid = Guid.NewGuid(); + + private static readonly List DeviceList; + + private static readonly List CommonDevicePins = new List + { + "0000", + "1111", + "1234" + }; + private static NetworkStream _stream; + + public struct SerialPort + { + public string Port; + public string DeviceId; + + } + + static BluetoothUtils() + { + // Define common Pin codes for Bluetooth devices + + PrimaryRadio = BluetoothRadio.PrimaryRadio; + if (PrimaryRadio == null) { + //Console.WriteLine("No radio hardware or unsupported software stack"); + return; + } + + // Local bluetooth MAC address + var mac = PrimaryRadio.LocalAddress; + if (mac == null) { + //Console.WriteLine("No local Bluetooth MAC address found"); + return; + } + DeviceList = new List(); + // mac is mac address of local bluetooth device + //LocalEndpoint = new BluetoothEndPoint(mac, BluetoothService.SerialPort); + LocalEndpoint = new BluetoothEndPoint(mac, Guid); + // client is used to manage connections + LocalClient = new BluetoothClient(LocalEndpoint); + // component is used to manage device discovery + //LocalComponent = new BluetoothComponent(LocalClient); + } + + public static BluetoothDeviceInfo DeviceByAdress(string address) + { + return new BluetoothDeviceInfo(BluetoothAddress.Parse(address)); + } + + public static void PrintPairedDevices() + { + DeviceList.AddRange(LocalClient.DiscoverDevices(255, true, true, false, false)); + PrintDevices(); + } + + public static void PrintAllDevices() + { + DeviceList.AddRange(LocalClient.DiscoverDevices(65536, true, true, true,true)); + PrintDevices(); + } + + private static BluetoothAddress LocalAddress() + { + if (PrimaryRadio == null) + { + Console.WriteLine("No radio hardware or unsupported software stack"); + return null; + } + // Note that LocalAddress is null if the radio is powered-off. + //Console.WriteLine("* Radio, address: {0:C}", primaryRadio.LocalAddress); + return PrimaryRadio.LocalAddress; + } + + public static void UpdateClient() + { + if (LocalClient != null) + { + LocalClient.Close(); + LocalClient = new BluetoothClient(LocalEndpoint); + } + } + + //const int IoctlBthDisconnectDevice = 0x41000c; + //[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)] + //internal static extern bool DeviceIoControl( + //IntPtr hDevice, + //uint dwIoControlCode, + //ref long inBuffer, + //int nInBufferSize, + //IntPtr outBuffer, + //int nOutBufferSize, + //out int pBytesReturned, + //IntPtr lpOverlapped); + //public static int Disconnect(BluetoothAddress address) + //{ + // //var primaryRadio = BluetoothRadio.PrimaryRadio; + // var handle = PrimaryRadio.Handle; + // //var btAddr = BluetoothAddress.Parse("00:1b:3d:0d:ac:31").ToInt64(); + // var bluetoothAdress = address.ToInt64(); + // var bytesReturned = 0; + // var success = DeviceIoControl( + // handle, + // IoctlBthDisconnectDevice, + // ref bluetoothAdress, 8, + // IntPtr.Zero, + // 0, + // out bytesReturned, + // IntPtr.Zero); + + // return !success ? Marshal.GetLastWin32Error() : 0; + //} + + //public static int Disconnect(BluetoothDeviceInfo device) + //{ + // return Disconnect(device.DeviceAddress); + //} + + public static bool PairDevice(BluetoothDeviceInfo device) + { + if (device.Authenticated) return true; + // loop through common PIN numbers to see if they pair + foreach (var devicePin in CommonDevicePins) + { + var isPaired = BluetoothSecurity.PairRequest(device.DeviceAddress, devicePin); + if (isPaired) break; + } + + device.Update(); + return device.Authenticated; + } + + public static void AutoPairDevices() + { + // get a list of all paired devices + var paired = LocalClient.DiscoverDevices(255, false, true, false, false); + // check every discovered device if it is already paired + foreach (var device in DeviceList) + { + var isPaired = paired.Any(t => device.Equals(t)); + + // if the device is not paired, try to pair it + if (!isPaired) + { + // loop through common PIN numbers to see if they pair + foreach (var devicePin in CommonDevicePins) + { + isPaired = BluetoothSecurity.PairRequest(device.DeviceAddress, devicePin); + if (isPaired) break; + } + } + } + } + + + public static void ConnectDevice(BluetoothDeviceInfo device, string devicePin) + { + // set pin of device to connect with + if (devicePin != null) LocalClient.SetPin(devicePin); + //device.SetServiceState(BluetoothService.SerialPort, false); + //device.SetServiceState(BluetoothService.SerialPort, true); + // check if device is paired + if (device.Authenticated) + { + // synchronous connection method + LocalClient.Connect(device.DeviceAddress, BluetoothService.SerialPort); + if (LocalClient.Connected) + { + _stream = LocalClient.GetStream(); + _stream.ReadTimeout = 500; + } + + } + } + + public void ConnectDevice(int deviceId) + { + + var device = DeviceList[deviceId]; + ConnectDevice(device, null); + } + + + //public void Read() + //{ + // //keep connection open + // var buffer = new byte[2048]; + // int bytesReceived = 0; + // bool listening = true; + // while (listening) + // { + // Thread.Yield(); + // try + // { + // bytesReceived = _stream.Read(buffer, 0, 2048); + // } + // catch(Exception e) + // { + // Console.WriteLine("error during read: "+e.Message); + // } + + // if (bytesReceived > 0) + // { + // var stringReceived = Encoding.UTF8.GetString(buffer, 0, bytesReceived); + // Console.Write(stringReceived); + + // } + // else + // { + // QuickScanForDevices(); + // // Do read to force connection check + // _stream.Read(buffer, 0, 0); + // if (!_localClient.Connected) + // { + // Console.WriteLine("Disconnected!"); + // } + // } + // } + //} + + public static List GetSerialPorts() + { + var portIdentifiers = new[] + { + "bthenum","btmodem","btport" + }; + var portList = new List(); + const string win32SerialPort = "Win32_SerialPort"; + var query = new SelectQuery(win32SerialPort); + var managementObjectSearcher = new ManagementObjectSearcher(query); + var portslist = managementObjectSearcher.Get(); + foreach (var port in portslist) + { + var managementObject = (ManagementObject) port; + var deviceId = managementObject.GetPropertyValue("DeviceID").ToString(); + var pnpDeviceId = managementObject.GetPropertyValue("PNPDeviceID").ToString().ToLower(); + + if (portIdentifiers.Any(pnpDeviceId.Contains)) + { + portList.Add(new SerialPort { Port = deviceId, DeviceId = pnpDeviceId }); + } + } + return portList; + } + + public static void PrintSerialPorts() + { + var portList = GetSerialPorts(); + foreach (var port in portList) + { + Console.WriteLine("Port: {0}, name: {1}", port.Port, port.DeviceId ); + } + } + + public static void PrintLocalAddress() + { + var localBluetoothAddress = LocalAddress(); + + if (localBluetoothAddress == null) return; + Console.WriteLine("{0:C}", localBluetoothAddress); + } + + public static void PrintDevice(BluetoothDeviceInfo device) + { + // log and save all found devices + + Console.Write(device.DeviceName + " (" + device.DeviceAddress + "): Device is "); + Console.Write(device.Remembered ? "remembered" : "not remembered"); + Console.Write(device.Authenticated ? ", paired" : ", not paired"); + Console.WriteLine(device.Connected ? ", connected" : ", not connected"); + } + + private static void PrintDevices() + { + // log and save all found devices + foreach (var t in DeviceList) + { + PrintDevice(t); + } + } + + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/CmdMessenger.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/CmdMessenger.cs new file mode 100644 index 0000000..eda39d6 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/CmdMessenger.cs @@ -0,0 +1,541 @@ +#region CmdMessenger - MIT - (c) 2014 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2014 - Thijs Elenbaas +*/ +#endregion + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Threading; +using System.Windows.Forms; +using CommandMessenger.TransportLayer; +using ThreadState = System.Diagnostics.ThreadState; + +namespace CommandMessenger +{ + public enum SendQueue + { + Default, + InFrontQueue, + AtEndQueue, + WaitForEmptyQueue, + ClearQueue, + } + + public enum ReceiveQueue + { + Default, + WaitForEmptyQueue, + ClearQueue, + } + + public enum UseQueue + { + UseQueue, + BypassQueue, + } + + public enum BoardType + { + Bit16, + Bit32, + } + + /// Command messenger main class + public class CmdMessenger : DisposableObject + { + public event NewLineEvent.NewLineHandler NewLineReceived; // Event handler for new lines received + public event NewLineEvent.NewLineHandler NewLineSent; // Event handler for a new line received + + private CommunicationManager _communicationManager; // The communication manager + private Sender _sender; // The command sender + + private char _fieldSeparator; // The field separator + private char _commandSeparator; // The command separator + private bool _printLfCr; // Add Linefeed + CarriageReturn + private BoardType _boardType; + private MessengerCallbackFunction _defaultCallback; // The default callback + private Dictionary _callbackList; // List of callbacks + + private SendCommandQueue _sendCommandQueue; // The queue of commands to be sent + private ReceiveCommandQueue _receiveCommandQueue; // The queue of commands to be processed + + //private Logger _sendCommandLogger = new Logger(@"d:\sendCommands.txt"); + /// Definition of the messenger callback function. + /// The received command. + public delegate void MessengerCallbackFunction(ReceivedCommand receivedCommand); + + /// Embedded Processor type. Needed to translate variables between sides. + /// The current received line. + public BoardType BoardType { + get { return _boardType; } + set + { + _boardType = value; + Command.BoardType = _boardType; + } + } + + /// Gets or sets a whether to print a line feed carriage return after each command. + /// true if print line feed carriage return, false if not. + public bool PrintLfCr { + get { return _printLfCr; } + set { + _printLfCr = value; + Command.PrintLfCr = _printLfCr; + _sender.PrintLfCr = _printLfCr; + } + } + + /// Gets or sets the current received command line. + /// The current received line. + public String CurrentReceivedLine { get; private set; } + + + + /// Gets or sets the currently sent line. + /// The currently sent line. + //public String CurrentSentLine { get; private set; } + + // Enable logging send commands to file + //public bool LogSendCommandsEnabled + //{ + // get { return _sendCommandLogger.isEnabled; } + // set { + // _sendCommandLogger.isEnabled = value; + // if (!_sendCommandLogger.isOpen) { + // _sendCommandLogger.Open(); + // } + // } + //} + + /// Gets or sets the log file of send commands. + /// The logfile name for send commands. + //public String LogFileSendCommands + //{ + // get { return _sendCommandLogger.LogFileName; } + // set { _sendCommandLogger.LogFileName = value; } + //} + + + + /// Gets or sets the log file of receive commands. + /// The logfile name for receive commands. + //public String LogFileReceiveCommands { get; set; } + + // The control to invoke the callback on + private Control _controlToInvokeOn; + + /// Constructor. + /// The transport layer. + public CmdMessenger(ITransport transport) + { + Init(transport, ',', ';', '/', 60); + } + + /// Constructor. + /// The transport layer. + /// The maximum size of the send buffer + public CmdMessenger(ITransport transport, int sendBufferMaxLength) + { + Init(transport, ',', ';', '/', sendBufferMaxLength); + } + + /// Constructor. + /// The transport layer. + /// The field separator. + public CmdMessenger(ITransport transport, char fieldSeparator) + { + Init(transport, fieldSeparator, ';', '/', 60); + } + + /// Constructor. + /// The transport layer. + /// The field separator. + /// The maximum size of the send buffer + public CmdMessenger(ITransport transport, char fieldSeparator, int sendBufferMaxLength) + { + Init(transport, fieldSeparator, ';', '/', sendBufferMaxLength); + } + + /// Constructor. + /// The transport layer. + /// The field separator. + /// The command separator. + public CmdMessenger(ITransport transport, char fieldSeparator, char commandSeparator) + { + Init(transport, fieldSeparator, commandSeparator, commandSeparator, 60); + } + + /// Constructor. + /// The transport layer. + /// The field separator. + /// The command separator. + /// The escape character. + /// The maximum size of the send buffer + public CmdMessenger(ITransport transport, char fieldSeparator, char commandSeparator, + char escapeCharacter, int sendBufferMaxLength) + { + Init(transport, fieldSeparator, commandSeparator, escapeCharacter, sendBufferMaxLength); + } + + /// Initializes this object. + /// The transport layer. + /// The field separator. + /// The command separator. + /// The escape character. + /// The maximum size of the send buffer + private void Init(ITransport transport, char fieldSeparator, char commandSeparator, + char escapeCharacter, int sendBufferMaxLength) + { + _controlToInvokeOn = null; + + _receiveCommandQueue = new ReceiveCommandQueue(DisposeStack, this); + _communicationManager = new CommunicationManager(DisposeStack, transport, _receiveCommandQueue, commandSeparator, fieldSeparator, escapeCharacter); + _sender = new Sender(_communicationManager, _receiveCommandQueue); + _sendCommandQueue = new SendCommandQueue(DisposeStack, this, _sender, sendBufferMaxLength); + + _receiveCommandQueue.NewLineReceived += (o, e) => InvokeNewLineEvent(NewLineReceived, e); + _sendCommandQueue.NewLineSent += (o, e) => InvokeNewLineEvent(NewLineSent, e); + + _fieldSeparator = fieldSeparator; + _commandSeparator = commandSeparator; + PrintLfCr = false; + + Command.FieldSeparator = _fieldSeparator; + Command.CommandSeparator = _commandSeparator; + Command.PrintLfCr = PrintLfCr; + + Escaping.EscapeChars(_fieldSeparator, _commandSeparator, escapeCharacter); + _callbackList = new Dictionary(); + //CurrentSentLine = ""; + CurrentReceivedLine = ""; + } + + //void ReceiveCommandQueueNewLineReceived(object sender, NewLineEvent.NewLineArgs e) + //{ + // InvokeNewLineEvent(NewLineReceived, e); + //} + + public void SetSingleCore() + { + var proc = Process.GetCurrentProcess(); + foreach (ProcessThread pt in proc.Threads) + { + if (pt.ThreadState != ThreadState.Terminated) + { + try + { + pt.IdealProcessor = 0; + pt.ProcessorAffinity = (IntPtr) 1; + } + catch (Exception) + { + } + + } + } + } + /// Sets a control to invoke on. + /// The control to invoke on. + public void SetControlToInvokeOn(Control controlToInvokeOn) + { + _controlToInvokeOn = controlToInvokeOn; + } + + /// Stop listening and end serial port connection. + /// true if it succeeds, false if it fails. + public bool Disconnect() + { + return _communicationManager.Disconnect(); + } + + /// Starts serial port connection and start listening. + /// true if it succeeds, false if it fails. + public bool Connect() + { + if (_communicationManager.Connect()) + { + // Timestamp of this command is same as time stamp of serial line + //LastReceivedCommandTimeStamp = _communicationManager.LastLineTimeStamp; + return true; + } + return false; + } + + /// Attaches default callback for unsupported commands. + /// The callback function. + public void Attach(MessengerCallbackFunction newFunction) + { + _defaultCallback = newFunction; + } + + /// Attaches default callback for certain Message ID. + /// Command ID. + /// The callback function. + public void Attach(int messageId, MessengerCallbackFunction newFunction) + { + _callbackList[messageId] = newFunction; + } + + /// Gets or sets the time stamp of the last command line received. + /// The last line time stamp. + public long LastReceivedCommandTimeStamp + { + get + { + return _communicationManager.LastLineTimeStamp; + } + } + + /// Handle message. + /// The received command. + public void HandleMessage(ReceivedCommand receivedCommand) + { + CurrentReceivedLine = receivedCommand.RawString; + // Send message that a new line has been received and is due to be processed + //InvokeEvent(NewLineReceived); + + MessengerCallbackFunction callback = null; + if (receivedCommand.Ok) + { + if (_callbackList.ContainsKey(receivedCommand.CmdId)) + { + callback = _callbackList[receivedCommand.CmdId]; + } + else + { + if (_defaultCallback != null) callback = _defaultCallback; + } + } + else + { + // Empty command + receivedCommand = new ReceivedCommand(); + } + InvokeCallBack(callback, receivedCommand); + } + + /// Sends a command. + /// If no command acknowledge is requested, the command will be send asynchronously: it will be put on the top of the send queue + /// If a command acknowledge is requested, the command will be send synchronously: the program will block until the acknowledge command + /// has been received or the timeout has expired. + /// The command to sent. + public ReceivedCommand SendCommand(SendCommand sendCommand) + { + return SendCommand(sendCommand, SendQueue.InFrontQueue,ReceiveQueue.Default); + } + + /// Sends a command. + /// If no command acknowledge is requested, the command will be send asynchronously: it will be put on the top of the send queue + /// If a command acknowledge is requested, the command will be send synchronously: the program will block until the acknowledge command + /// has been received or the timeout has expired. + /// Based on ClearQueueState, the send- and receive-queues are left intact or are cleared + /// The command to sent. + /// Property to optionally clear/wait the send queue + /// Property to optionally clear/wait the send queue + /// A received command. The received command will only be valid if the ReqAc of the command is true. + public ReceivedCommand SendCommand(SendCommand sendCommand, SendQueue sendQueueState, ReceiveQueue receiveQueueState) + { + return SendCommand(sendCommand, sendQueueState, receiveQueueState, UseQueue.UseQueue); + } + + /// Sends a command. + /// If no command acknowledge is requested, the command will be send asynchronously: it will be put on the top of the send queue + /// If a command acknowledge is requested, the command will be send synchronously: the program will block until the acknowledge command + /// has been received or the timeout has expired. + /// Based on ClearQueueState, the send- and receive-queues are left intact or are cleared + /// The command to sent. + /// Property to optionally clear/wait the send queue + /// Property to optionally clear/wait the send queue + /// Property to optionally bypass the queue + /// A received command. The received command will only be valid if the ReqAc of the command is true. + public ReceivedCommand SendCommand(SendCommand sendCommand, SendQueue sendQueueState, ReceiveQueue receiveQueueState, UseQueue useQueue) + { + //_sendCommandLogger.LogLine(sendCommand.CommandString()); + var synchronizedSend = (sendCommand.ReqAc || useQueue == UseQueue.BypassQueue); + + + if (sendQueueState == SendQueue.ClearQueue ) + { + // Clear receive queue + _receiveCommandQueue.Clear(); + } + + if (receiveQueueState == ReceiveQueue.ClearQueue ) + { + // Clear send queue + _sendCommandQueue.Clear(); + } + + // If synchronized sending, the only way to get command at end of queue is by waiting + if (sendQueueState == SendQueue.WaitForEmptyQueue || + (synchronizedSend && sendQueueState == SendQueue.AtEndQueue) + ) + { + while (_sendCommandQueue.Count > 0) Thread.Sleep(1); + } + + if (receiveQueueState == ReceiveQueue.WaitForEmptyQueue) + { + while (_receiveCommandQueue.Count>0) Thread.Sleep(1); + } + + if (synchronizedSend) + { + return SendCommandSync(sendCommand, sendQueueState); + } + + if (sendQueueState != SendQueue.AtEndQueue) + { + // Put command at top of command queue + _sendCommandQueue.SendCommand(sendCommand); + } + else + { + // Put command at bottom of command queue + _sendCommandQueue.QueueCommand(sendCommand); + } + return new ReceivedCommand(); + } + + /// Synchronized send a command. + /// The command to sent. + /// Property to optionally clear/wait the send queue. + /// . + public ReceivedCommand SendCommandSync(SendCommand sendCommand, SendQueue sendQueueState) + { + // Directly call execute command + var resultSendCommand = _sender.ExecuteSendCommand(sendCommand, sendQueueState); + InvokeNewLineEvent(NewLineSent, new NewLineEvent.NewLineArgs(sendCommand)); + return resultSendCommand; + } + + /// Put the command at the back of the sent queue. + /// The command to sent. + public void QueueCommand(SendCommand sendCommand) + { + _sendCommandQueue.QueueCommand(sendCommand); + } + + /// Put a command wrapped in a strategy at the back of the sent queue. + /// The command strategy. + public void QueueCommand(CommandStrategy commandStrategy) + { + _sendCommandQueue.QueueCommand(commandStrategy); + } + + /// Adds a general command strategy to the receive queue. This will be executed on every enqueued and dequeued command. + /// The general strategy for the receive queue. + public void AddReceiveCommandStrategy(GeneralStrategy generalStrategy) + { + _receiveCommandQueue.AddGeneralStrategy(generalStrategy); + } + + /// Adds a general command strategy to the send queue. This will be executed on every enqueued and dequeued command. + /// The general strategy for the send queue. + public void AddSendCommandStrategy(GeneralStrategy generalStrategy) + { + _sendCommandQueue.AddGeneralStrategy(generalStrategy); + } + + /// Clears the receive queue. + public void ClearReceiveQueue() + { + _receiveCommandQueue.Clear(); + } + + /// Clears the send queue. + public void ClearSendQueue() + { + _sendCommandQueue.Clear(); + } + + /// Helper function to Invoke or directly call event. + /// The event handler. + /// + private void InvokeNewLineEvent(NewLineEvent.NewLineHandler newLineHandler, NewLineEvent.NewLineArgs newLineArgs) + { + try + { + if (newLineHandler == null) return; + if (_controlToInvokeOn != null && _controlToInvokeOn.InvokeRequired) + { + //Asynchronously call on UI thread + _controlToInvokeOn.Invoke((MethodInvoker)(() => newLineHandler(this, newLineArgs))); + } + else + { + //Directly call + newLineHandler(this, newLineArgs); + } + } + catch (Exception) + { + } + } + + /// Helper function to Invoke or directly call callback function. + /// The messenger callback function. + /// The command. + private void InvokeCallBack(MessengerCallbackFunction messengerCallbackFunction, ReceivedCommand command) + { + try + { + if (messengerCallbackFunction == null) return; + + if (_controlToInvokeOn != null && _controlToInvokeOn.InvokeRequired) + { + //Asynchronously call on UI thread + _controlToInvokeOn.Invoke(new MessengerCallbackFunction(messengerCallbackFunction), (object)command); + } + else + { + //Directly call + messengerCallbackFunction(command); + } + } + catch (Exception) + { + } + + } + + /// Finaliser. + ~CmdMessenger() + { + _controlToInvokeOn = null; + _receiveCommandQueue.ThreadRunState = CommandQueue.ThreadRunStates.Abort; + _sendCommandQueue.ThreadRunState = CommandQueue.ThreadRunStates.Abort; + } + + + /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + /// true if resources should be disposed, false if not. + protected override void Dispose(bool disposing) + { + if (disposing) + { + _controlToInvokeOn = null; + _receiveCommandQueue.ThreadRunState = CommandQueue.ThreadRunStates.Abort; + _sendCommandQueue.ThreadRunState = CommandQueue.ThreadRunStates.Abort; + // _sendCommandLogger.Close(); + } + base.Dispose(disposing); + } + } +} \ No newline at end of file diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Command.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Command.cs new file mode 100644 index 0000000..5370528 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Command.cs @@ -0,0 +1,78 @@ +#region CmdMessenger - MIT - (c) 2013 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2013 - Thijs Elenbaas +*/ +#endregion + +using System; +using System.Collections.Generic; +using System.Globalization; + +namespace CommandMessenger +{ + /// A command to be send by CmdMessenger + public class Command + { + public static char FieldSeparator { get; set; } + public static char CommandSeparator { get; set; } + public static bool PrintLfCr { get; set; } + public static BoardType BoardType { get; set; } + + protected List _arguments; // The argument list of the command, first one is the command ID + + /// Gets or sets the command ID. + /// The command ID. + public int CmdId { get; set; } + + /// Gets the command arguments. + /// The arguments, first one is the command ID + public String[] Arguments + { + get { return _arguments.ToArray(); } + } + + /// Gets or sets the time stamp. + /// The time stamp. + public long TimeStamp { get; set; } + + /// Constructor. + public Command() + { + CmdId = -1; + _arguments = new List(); + TimeStamp = TimeUtils.Millis; + } + + /// Returns whether this is a valid & filled command. + /// true if ok, false if not. + public bool Ok + { + get { return (CmdId >= 0); } + } + + public string CommandString() { + var commandString = CmdId.ToString(CultureInfo.InvariantCulture); + + foreach (var argument in Arguments) + { + commandString += FieldSeparator + argument; + } + commandString += CommandSeparator; + return commandString; + } + +} +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/CommandMessenger.csproj b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/CommandMessenger.csproj new file mode 100644 index 0000000..d4ff557 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/CommandMessenger.csproj @@ -0,0 +1,102 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {3CF8F8FC-6F5C-46F8-94DC-C2E4C505ECA4} + Library + Properties + CommandMessenger + CommandMessenger + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\Bluetooth\InTheHand.Net.Personal.dll + + + + + + + + + + + + + + Code + + + + + + + + + + + + + + + + + + Code + + + + + + Code + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/CommandMessenger.csproj.user b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/CommandMessenger.csproj.user new file mode 100644 index 0000000..55f44b9 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/CommandMessenger.csproj.user @@ -0,0 +1,6 @@ + + + + ShowAllFiles + + \ No newline at end of file diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/CommunicationManager.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/CommunicationManager.cs new file mode 100644 index 0000000..2887295 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/CommunicationManager.cs @@ -0,0 +1,284 @@ +#region CmdMessenger - MIT - (c) 2013 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2013 - Thijs Elenbaas +*/ +#endregion + +using System; +using System.Text; +using System.Threading; +using CommandMessenger.TransportLayer; + +namespace CommandMessenger +{ + /// + /// Manager for data over transport layer. + /// + public class CommunicationManager : DisposableObject + { + private ITransport _transport; + public readonly Encoding StringEncoder = Encoding.GetEncoding("ISO-8859-1"); // The string encoder + private string _buffer = ""; // The buffer + + private ReceiveCommandQueue _receiveCommandQueue; + private IsEscaped _isEscaped; // The is escaped + private char _fieldSeparator; // The field separator + private char _commandSeparator; // The command separator + private char _escapeCharacter; // The escape character + private object _parseLinesLock = new object(); + + + + /// Default constructor. + /// /// The DisposeStack + /// The Transport Layer + /// + public CommunicationManager(DisposeStack disposeStack, ITransport transport, ReceiveCommandQueue receiveCommandQueue) + { + Initialize(disposeStack,transport, receiveCommandQueue, ';', ',', '/'); + } + + /// Constructor. + /// + /// The End-Of-Line separator. + /// + /// The escape character. + /// The DisposeStack + /// The Transport Layer + public CommunicationManager(DisposeStack disposeStack,ITransport transport, ReceiveCommandQueue receiveCommandQueue, char commandSeparator, char fieldSeparator, char escapeCharacter) + { + Initialize(disposeStack, transport, receiveCommandQueue, commandSeparator, fieldSeparator, escapeCharacter); + } + + /// Finaliser. + ~CommunicationManager() + { + Dispose(false); + } + + /// Initializes this object. + /// + /// The End-Of-Line separator. + /// + /// The escape character. + /// The DisposeStack + /// /// The Transport Layer + public void Initialize(DisposeStack disposeStack, ITransport transport, ReceiveCommandQueue receiveCommandQueue, char commandSeparator, char fieldSeparator, char escapeCharacter) + { + disposeStack.Push(this); + _transport = transport; + _receiveCommandQueue = receiveCommandQueue; + _transport.NewDataReceived += NewDataReceived; + _commandSeparator = commandSeparator; + _fieldSeparator = fieldSeparator; + _escapeCharacter = escapeCharacter; + + _isEscaped = new IsEscaped(); + } + + #region Fields + + /// Gets or sets the time stamp of the last received line. + /// time stamp of the last received line. + public long LastLineTimeStamp { get; set; } + + #endregion + + #region Properties + + + #endregion + + #region Event handlers + + /// transport layer data received. + private void NewDataReceived(object o, EventArgs e) + { + ParseLines(); + } + + #endregion + + #region Methods + + /// Connects to a transport layer defined through the current settings. + /// true if it succeeds, false if it fails. + public bool Connect() + { + return _transport.Connect(); + } + + /// Stops listening to the transport layer + /// true if it succeeds, false if it fails. + public bool Disconnect() + { + return _transport.Disconnect(); + } + + /// Starts polling. + public void StartPolling() + { + _transport.StartPolling(); + } + + /// Stop polling. + public void StopPolling() + { + _transport.StopPolling(); + } + + /// Writes a string to the transport layer. + /// The string to write. + public void WriteLine(string value) + { + byte[] writeBytes = StringEncoder.GetBytes(value + '\n'); + _transport.Write(writeBytes); + } + + /// Writes a parameter to the transport layer followed by a NewLine. + /// Generic type parameter. + /// The value. + public void WriteLine(T value) + { + var writeString = value.ToString(); + byte[] writeBytes = StringEncoder.GetBytes(writeString + '\n'); + _transport.Write(writeBytes); + } + + /// Writes a parameter to the transport layer. + /// Generic type parameter. + /// The value. + public void Write(T value) + { + var writeString = value.ToString(); + byte[] writeBytes = StringEncoder.GetBytes(writeString); + _transport.Write(writeBytes); + } + + public void UpdateTransportBuffer() + { + _transport.Poll(); + } + + /// Reads the transport buffer into the string buffer. + private void ReadInBuffer() + { + var data = _transport.Read(); + _buffer += StringEncoder.GetString(data); + } + + private void ParseLines() + { + //if (Monitor.TryEnter(_parseLinesLock)) { + lock(_parseLinesLock) { + //{ + LastLineTimeStamp = TimeUtils.Millis; + ReadInBuffer(); + var currentLine = ParseLine(); + while (!String.IsNullOrEmpty(currentLine)) + { + ProcessLine(currentLine); + currentLine = ParseLine(); + } + } + } + + /// Processes the byte message and add to queue. + public void ProcessLine(string line) + { + // Read line from raw buffer and make command + var currentReceivedCommand = ParseMessage(line); + currentReceivedCommand.RawString = line; + // Set time stamp + currentReceivedCommand.TimeStamp = LastLineTimeStamp; + // And put on queue + _receiveCommandQueue.QueueCommand(currentReceivedCommand); + + } + + /// Parse message. + /// The received command line. + /// The received command. + private ReceivedCommand ParseMessage(string line) + { + // Trim and clean line + var cleanedLine = line.Trim('\r', '\n'); + cleanedLine = Escaping.Remove(cleanedLine, _commandSeparator, _escapeCharacter); + + return + new ReceivedCommand(Escaping.Split(cleanedLine, _fieldSeparator, _escapeCharacter, + StringSplitOptions.RemoveEmptyEntries)); + } + + /// Reads a float line from the buffer, if complete. + /// Whether a complete line was present in the buffer. + private string ParseLine() + { + + if (_buffer != "") + { + // Check if an End-Of-Line is present in the string, and split on first + //var i = _buffer.IndexOf(CommandSeparator); + var i = FindNextEol(); + if (i >= 0 && i < _buffer.Length) + { + var line = _buffer.Substring(0, i + 1); + if (!String.IsNullOrEmpty(line)) + { + _buffer = _buffer.Substring(i + 1); + return line; + } + _buffer = _buffer.Substring(i + 1); + return ""; + } + } + return ""; + + } + + /// Searches for the next End-Of-Line. + /// The the location in the string of the next End-Of-Line. + private int FindNextEol() + { + int pos = 0; + while (pos < _buffer.Length) + { + var escaped = _isEscaped.EscapedChar(_buffer[pos]); + if (_buffer[pos] == _commandSeparator && !escaped) + { + return pos; + } + pos++; + } + return pos; + } + + // Dispose + /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + /// true if resources should be disposed, false if not. + protected override void Dispose(bool disposing) + { + if (disposing) + { + // Stop polling + _transport.NewDataReceived -= NewDataReceived; + } + base.Dispose(disposing); + } + + #endregion + } +} \ No newline at end of file diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/ConnectionManager.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/ConnectionManager.cs new file mode 100644 index 0000000..47418fb --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/ConnectionManager.cs @@ -0,0 +1,351 @@ +#region CmdMessenger - MIT - (c) 2014 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2014 - Thijs Elenbaas +*/ +#endregion + +using System; +using System.ComponentModel; +using System.Threading; +using System.Windows.Forms; + +namespace CommandMessenger +{ + public class ConnectionManagerProgressEventArgs : EventArgs + { + public int Level { get; set; } + public String Description { get; set; } + } + + + public enum ConnectionManagerStates + { + Scan, + Watchdog, + Wait, + Stop + } + + public class ConnectionManager : IDisposable + { + protected Control ControlToInvokeOn; + protected readonly CmdMessenger CmdMessenger; + protected ConnectionManagerStates ConnectionManagerState; + + public event EventHandler ConnectionTimeout; + public event EventHandler ConnectionFound; + public event EventHandler Progress; + + private readonly BackgroundWorker _scanThread; + private readonly int _challengeCommandId; + private readonly int _responseCommandId; + + private long _lastCheckTime; + private long _nextTimeOutCheck; + private uint _watchdogTries; + public bool Connected { get; set; } + public long WatchdogTimeOut { get; set; } + public long WatchdogRetryTimeOut { get; set; } + public uint MaxWatchdogTries { get; set; } + + protected ConnectionManager(CmdMessenger cmdMessenger, int challengeCommandId, int responseCommandId) + { + WatchdogTimeOut = 2000; + WatchdogRetryTimeOut = 1000; + MaxWatchdogTries = 3; + + if (cmdMessenger == null) return; + + ControlToInvokeOn = null; + CmdMessenger = cmdMessenger; + _scanThread = new BackgroundWorker {WorkerSupportsCancellation = true, WorkerReportsProgress = false}; + _scanThread.DoWork += ScanThreadDoWork; + _challengeCommandId = challengeCommandId; + _responseCommandId = responseCommandId; + + CmdMessenger.Attach((int) responseCommandId, OnResponseCommandId); + } + + + /// + /// Start connection manager. Will set up thread, but will not start scanning + /// + public void StartConnectionManager() + { + ConnectionManagerState = ConnectionManagerStates.Wait; + if (_scanThread.IsBusy != true) + { + // Start the asynchronous operation. + _scanThread.RunWorkerAsync(); + } + } + + /// + /// Stop connection manager. + /// + public void StopConnectionManager() + { + ConnectionManagerState = ConnectionManagerStates.Stop; + + if (_scanThread.WorkerSupportsCancellation) + { + // Cancel the asynchronous operation. + _scanThread.CancelAsync(); + } + _scanThread.DoWork -= ScanThreadDoWork; + } + + /// Sets a control to invoke on. + /// The control to invoke on. + public void SetControlToInvokeOn(Control controlToInvokeOn) + { + ControlToInvokeOn = controlToInvokeOn; + } + + protected void InvokeEvent(EventHandler eventHandler) + { + try + { + if (eventHandler == null) return; + if (ControlToInvokeOn != null && ControlToInvokeOn.InvokeRequired) + { + //Asynchronously call on UI thread + ControlToInvokeOn.BeginInvoke((MethodInvoker) (() => eventHandler(this, null))); + Thread.Yield(); + } + else + { + //Directly call + eventHandler(this, null); + } + } + catch (Exception) + { + } + } + + protected void ConnectionFoundEvent() + { + InvokeEvent(ConnectionFound); + } + + protected void InvokeEvent(EventHandler eventHandler, + TEventHandlerArguments eventHandlerArguments) where TEventHandlerArguments : EventArgs + { + try + { + if (eventHandler == null) return; + if (ControlToInvokeOn.IsDisposed) return; + if (ControlToInvokeOn != null && ControlToInvokeOn.InvokeRequired) + { + //Asynchronously call on UI thread + ControlToInvokeOn.BeginInvoke((MethodInvoker) (() => eventHandler(this, eventHandlerArguments))); + Thread.Yield(); + } + else + { + //Directly call + eventHandler(this, eventHandlerArguments); + } + } + catch (Exception) + { + } + } + + protected void Log(int level, string logMessage) + { + var args = new ConnectionManagerProgressEventArgs {Level = level, Description = logMessage}; + InvokeEvent(Progress, args); + } + + private void OnResponseCommandId(ReceivedCommand arguments) + { + // Do nothing. + } + + private void ScanThreadDoWork(object sender, DoWorkEventArgs e) + { + while (ConnectionManagerState != ConnectionManagerStates.Stop) + { + // Check if thread is being canceled + var worker = sender as BackgroundWorker; + if (worker != null && worker.CancellationPending) + { + ConnectionManagerState = ConnectionManagerStates.Stop; + break; + } + + // Switch between waiting, device scanning and watchdog + switch (ConnectionManagerState) + { + case ConnectionManagerStates.Scan: + DoWorkScan(); + break; + case ConnectionManagerStates.Watchdog: + DoWorkWatchdog(); + break; + default: + Thread.Sleep(1000); + break; + } + } + } + + private void ConnectionWatchDog() + { + var lastLineTimeStamp = CmdMessenger.LastReceivedCommandTimeStamp; + var currentTimeStamp = TimeUtils.Millis; + + // If timeout has not elapsed, wait till next watch time + if (currentTimeStamp < _nextTimeOutCheck) return; + + // if a command has been received recently, set next check time + if (lastLineTimeStamp > _lastCheckTime) + { + Log(3, "Successful watchdog response"); + _lastCheckTime = currentTimeStamp; + _nextTimeOutCheck = _lastCheckTime + WatchdogTimeOut; + _watchdogTries = 0; + return; + } + + _lastCheckTime = currentTimeStamp; + // Apparently, other side has not reacted in time + // If too many tries, notify and stop + if (_watchdogTries >= MaxWatchdogTries) + { + Log(3, "No watchdog response after final try"); + _watchdogTries = 0; + ConnectionManagerState = ConnectionManagerStates.Wait; + InvokeEvent(ConnectionTimeout); + } + + // We'll try another time + // We queue the command in order to not be intrusive, but put it in front to get a quick answer + CmdMessenger.SendCommand(new SendCommand(_challengeCommandId), SendQueue.InFrontQueue, ReceiveQueue.Default); + _watchdogTries++; + + _lastCheckTime = currentTimeStamp; + _nextTimeOutCheck = _lastCheckTime + WatchdogRetryTimeOut; + Log(3, "No watchdog response, performing try #" + _watchdogTries); + } + + protected virtual void DoWorkScan() + { + Thread.Sleep(1000); + } + + /// + /// Check if Arduino is available + /// + /// timout for waiting on response + /// Result. True if succesfull + public bool ArduinoAvailable(int timeOut) + { + //Log(3, "Polling Arduino"); + var challengeCommand = new SendCommand(_challengeCommandId, _responseCommandId, timeOut); + var responseCommand = CmdMessenger.SendCommand(challengeCommand,SendQueue.InFrontQueue,ReceiveQueue.Default,UseQueue.BypassQueue); + return responseCommand.Ok; + } + + public bool ArduinoAvailable(int timeOut, int tries) + { + for (var i = 0; i < tries; i++) + { + Log(3, "Polling Arduino, try # " + i); + if (ArduinoAvailable(timeOut)) return true; + } + return false; + } + + private void DoWorkWatchdog() + { + + try { ConnectionWatchDog(); } + catch { } + Thread.Sleep(100); + } + + /// + /// Disconnect from Arduino + /// + /// true if sucessfully disconnected + public bool Disconnect() + { + Connected = false; + return CmdMessenger.Disconnect(); + } + + /// + /// Start watchdog. Will check if connection gets interrupted + /// + public void StartWatchDog() + { + + Log(1, "Starting Watchdog"); + _lastCheckTime = TimeUtils.Millis; + _nextTimeOutCheck = _lastCheckTime + WatchdogTimeOut; + _watchdogTries = 0; + ConnectionManagerState = ConnectionManagerStates.Watchdog; + } + + /// + /// Stop watchdog. + /// + public void StopWatchDog() + { + Log(1, "Stopping Watchdog"); + ConnectionManagerState = ConnectionManagerStates.Wait; + } + + /// + /// Stop scanning for devices + /// + public void StopScan() + { + Log(1, "Stopping device scan"); + ConnectionManagerState = ConnectionManagerStates.Wait; + } + + /// + /// Start scanning for devices + /// + public void StartScan() + { + Log(1, "Starting device scan"); + ConnectionManagerState = ConnectionManagerStates.Scan; + } + + // Dispose + public void Dispose() + { + Dispose(true); + } + + // Dispose + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + StopConnectionManager(); + } + + } + } +} + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/ConnectionManager/IConnectionManager.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/ConnectionManager/IConnectionManager.cs new file mode 100644 index 0000000..2ba4f6c --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/ConnectionManager/IConnectionManager.cs @@ -0,0 +1,18 @@ +using System; +using System.Windows.Forms; + +namespace CommandMessenger.ConnectionManager2 +{ + public interface IConnectionManager : IDisposable + { + void SetControlToInvokeOn(Control controlToInvokeOn); + void StartScan(); + void StopScan(); + void StartWatchDog(long watchdogTimeOut); + void StopWatchDog(); + + event EventHandler ConnectionTimeout; + event EventHandler ConnectionFound; + event EventHandler Progress; + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/ConsoleUtils.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/ConsoleUtils.cs new file mode 100644 index 0000000..02c7b08 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/ConsoleUtils.cs @@ -0,0 +1,35 @@ +using System; +using System.Runtime.InteropServices; + +namespace CommandMessenger +{ + public class ConsoleUtils + { + public static EventHandler ConsoleClose = delegate {}; + + static ConsoleUtils() + { + _handler = ConsoleEventCallback; + SetConsoleCtrlHandler(_handler, true); + Console.WriteLine("check"); + } + + static bool ConsoleEventCallback(int eventType) + { + if (eventType == 2) + { + ConsoleClose(null, EventArgs.Empty); + } + ConsoleClose= null; + _handler = null; + return false; + } + + static ConsoleEventDelegate _handler; // Keeps it from getting garbage collected + + private delegate bool ConsoleEventDelegate(int eventType); + [DllImport("kernel32.dll", SetLastError = true)] + private static extern bool SetConsoleCtrlHandler(ConsoleEventDelegate callback, bool add); + + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/DisposableObject.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/DisposableObject.cs new file mode 100644 index 0000000..5bdb079 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/DisposableObject.cs @@ -0,0 +1,54 @@ +#region CmdMessenger - MIT - (c) 2013 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2013 - Thijs Elenbaas +*/ +#endregion + +using System; + +namespace CommandMessenger +{ + public class DisposableObject : IDisposable + { + protected DisposeStack DisposeStack = new DisposeStack(); + protected bool IsDisposed = false; + + public virtual void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + /// + /// Remove all references and remove children + /// + /// If true, cleanup + protected virtual void Dispose(bool disposing) + { + if (!IsDisposed) + { + if (disposing) + { + DisposeStack.Dispose(); + DisposeStack = null; + IsDisposed = true; + } + } + } + } + + +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/DisposeStack.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/DisposeStack.cs new file mode 100644 index 0000000..aed2178 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/DisposeStack.cs @@ -0,0 +1,82 @@ +#region CmdMessenger - MIT - (c) 2013 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2013 - Thijs Elenbaas +*/ +#endregion + +using System; +using System.Collections.Generic; + +namespace CommandMessenger +{ + /// + /// The dispose stack takes manages disposal of objects that are pushed onto the stack. + /// When the stack is disposed all objects are disposed (in reversed order). + /// + public sealed class DisposeStack : IDisposable + { + private readonly List _disposables = new List(); + + /// + /// Pushes a disposable object under the DisposeStack. + /// + /// Type of object pushed + /// The object pushed under the stack + /// Returns the pushed object + public T PushFront(T newObject) where T : IDisposable + { + _disposables.Insert(0, newObject); + return newObject; + } + + /// + /// Pushes a disposable object under the DisposeStack. + /// + /// Type of object pushed + /// The object pushed on the stack + /// Returns the pushed object + public T Push(T newObject) where T : IDisposable + { + _disposables.Add(newObject); + return newObject; + } + + /// + /// Push an arbitrary number of disposable objects onto the stack in one call + /// + /// The disposable objects + public void Push(params IDisposable[] objects) + { + foreach (IDisposable d in objects) + { + _disposables.Add(d); + } + } + + /// + /// Dispose all items within the dispose stack. + /// + public void Dispose() + { + for (int i = _disposables.Count - 1; i >= 0; --i) + { + _disposables[i].Dispose(); + } + + _disposables.Clear(); + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Escaped.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Escaped.cs new file mode 100644 index 0000000..b80a4f5 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Escaped.cs @@ -0,0 +1,173 @@ +#region CmdMessenger - MIT - (c) 2013 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2013 - Thijs Elenbaas +*/ +#endregion + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; + +namespace CommandMessenger +{ + /// Class for bookkeeping which characters in the stream are escaped. + public class IsEscaped + { + private char _lastChar = '\0'; // The last character + + // Returns if the character is escaped + // Note create new instance for every independent string + + /// Returns if the character is escaped. + /// Note create new instance for every independent string + /// The currebt character. + /// true if the character is escaped, false if not. + public bool EscapedChar(char currChar) + { + bool escaped = (_lastChar == Escaping.EscapeCharacter); + _lastChar = currChar; + + // special case: the escape char has been escaped: + if (_lastChar == Escaping.EscapeCharacter && escaped) + { + _lastChar = '\0'; + } + return escaped; + } + } + + /// Utility class providing escaping functions + public class Escaping + { + // Remove all occurrences of removeChar unless it is escaped by escapeChar + + private static char _fieldSeparator = ','; // The field separator + private static char _commandSeparator = ';'; // The command separator + private static char _escapeCharacter = '/'; // The escape character + + /// Gets the escape character. + /// The escape character. + public static char EscapeCharacter + { + get { return _escapeCharacter; } + } + + /// Sets custom escape characters. + /// The field separator. + /// The command separator. + /// The escape character. + public static void EscapeChars(char fieldSeparator, char commandSeparator, char escapeCharacter) + { + _fieldSeparator = fieldSeparator; + _commandSeparator = commandSeparator; + _escapeCharacter = escapeCharacter; + } + + /// Removes all occurences of a specific character unless escaped. + /// The input. + /// The character to remove. + /// The escape character. + /// The string with all removeChars removed. + public static string Remove(string input, char removeChar, char escapeChar) + { + var output = ""; + var escaped = new IsEscaped(); + for (var i = 0; i < input.Length; i++) + { + char inputChar = input[i]; + bool isEscaped = escaped.EscapedChar(inputChar); + if (inputChar != removeChar || isEscaped) + { + output += inputChar; + } + } + return output; + } + + // Split String on separator character unless it is escaped by escapeChar + + /// Splits. + /// The input. + /// The separator. + /// The escape character. + /// Options for controlling the string split. + /// The split string. + public static String[] Split(string input, char separator, char escapeCharacter, + StringSplitOptions stringSplitOptions) + { + var word = ""; + var result = new List(); + for (var i = 0; i < input.Length; i++) + { + var t = input[i]; + if (t == separator) + { + result.Add(word); + word = ""; + } + else + { + if (t == escapeCharacter) + { + word += t; + if (i < input.Length - 1) t = input[++i]; + } + word += t; + } + } + result.Add(word); + if (stringSplitOptions == StringSplitOptions.RemoveEmptyEntries) result.RemoveAll(item => item == ""); + return result.ToArray(); + } + + /// Escapes the input string. + /// The unescaped input string. + /// Escaped output string. + public static string Escape(string input) + { + var escapeChars = new[] + { + _escapeCharacter.ToString(CultureInfo.InvariantCulture), + _fieldSeparator.ToString(CultureInfo.InvariantCulture), + _commandSeparator.ToString(CultureInfo.InvariantCulture), + "\0" + }; + input = escapeChars.Aggregate(input, + (current, escapeChar) => + current.Replace(escapeChar, _escapeCharacter + escapeChar)); + return input; + } + + /// Unescapes the input string. + /// The escaped input string. + /// The unescaped output string. + public static string Unescape(string input) + { + string output = ""; + // Move unescaped characters right + for (var fromChar = 0; fromChar < input.Length; fromChar++) + { + if (input[fromChar] == _escapeCharacter) + { + fromChar++; + } + output += input[fromChar]; + } + return output; + } + } +} \ No newline at end of file diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/EventWaiter.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/EventWaiter.cs new file mode 100644 index 0000000..11165b0 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/EventWaiter.cs @@ -0,0 +1,101 @@ +using System.Threading; + +namespace CommandMessenger +{ + public class EventWaiter + { + public enum WaitState + { + Quit, + TimeOut, + Normal + } + + readonly object _key = new object(); + bool _block; + bool _quit; + + + public EventWaiter() + { + lock (_key) + { + _block = true; + } + } + + public EventWaiter(bool block) + { + lock (_key) + { + _block = block; + } + } + + public WaitState Wait(int timeOut) + { + lock (_key) + { + // Check if signal has already been raised before wait + if (_quit) + { + _quit = false; + return WaitState.Quit; + } + if (!_block) + { + _block = true; + return WaitState.Normal; + } + + // Set time + var millisBefore = TimeUtils.Millis; + long elapsed = 0; + + // Wait under conditions + while (elapsed < timeOut && _block && !_quit) + { + Monitor.Wait(_key,timeOut); + elapsed = TimeUtils.Millis - millisBefore; + } + + _block = true; + // Check if signal has already been raised after wait + if (_quit) + { + _quit = false; + return WaitState.Quit; + } + return elapsed >= timeOut ? WaitState.TimeOut : WaitState.Normal; + } + } + + public void Set() + { + lock (_key) + { + _block = false; + Monitor.Pulse(_key); + } + } + + public void Reset() + { + lock (_key) + { + _block = true; + Monitor.Pulse(_key); + } + } + + public void Quit() + { + lock (_key) + { + _quit = true; + Monitor.Pulse(_key); + } + } + + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/NewLineEvent.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/NewLineEvent.cs new file mode 100644 index 0000000..12a17a5 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/NewLineEvent.cs @@ -0,0 +1,36 @@ +#region CmdMessenger - MIT - (c) 2014 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2014 - Thijs Elenbaas +*/ +#endregion +using System; + +namespace CommandMessenger +{ + public class NewLineEvent + { + public delegate void NewLineHandler(object sender, NewLineArgs e); + + public class NewLineArgs : EventArgs + { + public Command Command { get; private set; } + public NewLineArgs(Command command) + { + Command = command; + } + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Properties/AssemblyInfo.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..87a80ee --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("CmdMessenger")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] + +[assembly: AssemblyProduct("CmdMessenger")] +[assembly: AssemblyCopyright("Copyright © Thijs Elenbaas 2013,2014")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("64af8ae8-9076-46b5-97aa-fe9c9a0c8b40")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Queue/CollapseCommandStrategy.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Queue/CollapseCommandStrategy.cs new file mode 100644 index 0000000..d215f51 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Queue/CollapseCommandStrategy.cs @@ -0,0 +1,49 @@ +#region CmdMessenger - MIT - (c) 2013 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2013 - Thijs Elenbaas +*/ +#endregion + +namespace CommandMessenger +{ + /// Collapse command strategy. + /// The purpose of the strategy is to avoid duplicates of a certain command on the queue + /// to avoid lagging + public class CollapseCommandStrategy : CommandStrategy + { + /// Collapse strategy. + /// The command that will be collapsed on the queue. + public CollapseCommandStrategy(Command command) : base(command) + {} + + /// Add command (strategy) to command queue. + public override void Enqueue() + { + // find if there already is a command with the same CmdId + var index = CommandQueue.FindIndex(strategy => strategy.Command.CmdId == Command.CmdId); + if (index < 0) + { + // if not, add to the back of the queue + CommandQueue.Enqueue(this); + } + else + { + // if on the queue, replace with new command + CommandQueue[index] = this; + } + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Queue/CommandQueue.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Queue/CommandQueue.cs new file mode 100644 index 0000000..1f45f62 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Queue/CommandQueue.cs @@ -0,0 +1,158 @@ +#region CmdMessenger - MIT - (c) 2013 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2013 - Thijs Elenbaas +*/ +#endregion + +using System; +using System.Collections.Generic; +using System.Threading; + +namespace CommandMessenger +{ + // Command queue base object. + public class CommandQueue : DisposableObject + { + protected readonly Thread QueueThread; + protected readonly ListQueue Queue = new ListQueue(); // Buffer for commands + protected readonly List GeneralStrategies = new List(); // Buffer for command independent strategies + protected readonly CmdMessenger CmdMessenger; + private ThreadRunStates _threadRunState; + protected readonly EventWaiter EventWaiter; + protected object ThreadRunStateLock = new object(); + + /// Run state of thread running the queue. + public enum ThreadRunStates + { + Start, + Started, + Stop, + Stopped, + Abort, + } + + /// Gets or sets the run state of the thread . + /// The thread run state. + public ThreadRunStates ThreadRunState + { + set + { + lock (ThreadRunStateLock) + { + _threadRunState = value; + } + } + get + { + var result = ThreadRunStates.Start; + lock (ThreadRunStateLock) + { + result = _threadRunState; + } + return result; + } + } + + /// Gets or sets the run state of the thread . + /// The thread run state. + public int Count + { + get { return Queue.Count; } + } + + /// command queue constructor. + /// DisposeStack. + /// The command messenger. + public CommandQueue(DisposeStack disposeStack, CmdMessenger cmdMessenger) + { + CmdMessenger = cmdMessenger; + disposeStack.Push(this); + + EventWaiter = new EventWaiter(); + + // Create queue thread and wait for it to start + QueueThread = new Thread(ProcessQueue) {Priority = ThreadPriority.Normal}; + QueueThread.Start(); + while (!QueueThread.IsAlive && QueueThread.ThreadState!=ThreadState.Running) + { + Thread.Sleep(TimeSpan.FromMilliseconds(25)); + } + } + + /// Process the queue. + protected virtual void ProcessQueue() + { + } + + /// Clears the queue. + public void Clear() + { + lock (Queue) + { + Queue.Clear(); + } + } + + /// Queue the command wrapped in a command strategy. + /// The command strategy. + public virtual void QueueCommand(CommandStrategy commandStrategy) + { + } + + /// Adds a general strategy. This strategy is applied to all queued and dequeued commands. + /// The general strategy. + public void AddGeneralStrategy(GeneralStrategy generalStrategy) + { + // Give strategy access to queue + generalStrategy.CommandQueue = Queue; + // Add to general strategy list + GeneralStrategies.Add(generalStrategy); + } + + /// Kills this object. + public void Kill() + { + ThreadRunState = ThreadRunStates.Abort; + EventWaiter.Quit(); + //Wait for thread to die + Join(2000); + if (QueueThread.IsAlive) QueueThread.Abort(); + } + + /// Joins the thread. + /// The milliseconds timeout. + /// true if it succeeds, false if it fails. + public bool Join(int millisecondsTimeout) + { + if (QueueThread.IsAlive == false) return true; + return QueueThread.Join(TimeSpan.FromMilliseconds(millisecondsTimeout)); + } + + // Dispose + /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + /// true if resources should be disposed, false if not. + protected override void Dispose(bool disposing) + { + if (disposing) + { + // Stop polling + Kill(); + } + base.Dispose(disposing); + } + + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Queue/CommandStrategy.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Queue/CommandStrategy.cs new file mode 100644 index 0000000..21b9136 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Queue/CommandStrategy.cs @@ -0,0 +1,56 @@ +#region CmdMessenger - MIT - (c) 2013 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2013 - Thijs Elenbaas +*/ +#endregion + +namespace CommandMessenger +{ + /// Base command strategy. + public class CommandStrategy + { + /// Base command strategy. + /// The command to be wrapped in a strategy. + public CommandStrategy(Command command) + { + Command = command; + } + + /// Gets or sets the command queue. + /// A Queue of commands. + public ListQueue CommandQueue { get; set; } + + /// Gets or sets the run state of the thread. + /// The thread run state. + public CommandQueue.ThreadRunStates ThreadRunState { get; set; } + + /// Gets or sets the command. + /// The command wrapped in the strategy. + public Command Command { get; private set; } + + /// Add command (strategy) to command queue. + public virtual void Enqueue() + { + CommandQueue.Enqueue(this); + } + + /// Remove this command (strategy) from command queue. + public virtual void DeQueue() + { + CommandQueue.Remove(this); + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Queue/GeneralStrategy.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Queue/GeneralStrategy.cs new file mode 100644 index 0000000..68c9eac --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Queue/GeneralStrategy.cs @@ -0,0 +1,39 @@ +#region CmdMessenger - MIT - (c) 2013 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2013 - Thijs Elenbaas +*/ +#endregion + +namespace CommandMessenger +{ + /// Base of general strategy. + public class GeneralStrategy + { + /// Gets or sets the command queue. + /// A Queue of commands. + public ListQueue CommandQueue { get; set; } + + /// GenerAdd command (strategy) to command queue. + public virtual void OnEnqueue() + { + } + + /// Remove this command (strategy) from command queue. + public virtual void OnDequeue() + { + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Queue/ListQueue.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Queue/ListQueue.cs new file mode 100644 index 0000000..a26ccdd --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Queue/ListQueue.cs @@ -0,0 +1,59 @@ +#region CmdMessenger - MIT - (c) 2013 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2013 - Thijs Elenbaas +*/ +#endregion + +using System.Collections.Generic; + +namespace CommandMessenger +{ + /// Queue class. + /// Type of object to queue. + public class ListQueue : List + { + /// Adds item to front of queue. + /// The item to queue. + public void EnqueueFront(T item) + { + Insert(Count, item); + } + + /// Adds item to back of queue. + /// The item to queue. + public void Enqueue(T item) + { + Add(item); + } + + /// fetches item from front of queue. + /// The item to dequeue. + public T Dequeue() + { + var t = base[0]; + RemoveAt(0); + return t; + } + + /// look at item at front of queue without removing it from the queue. + /// The item to peek at. + public T Peek() + { + return base[0]; + } + + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Queue/QueueSpeed.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Queue/QueueSpeed.cs new file mode 100644 index 0000000..f5a072f --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Queue/QueueSpeed.cs @@ -0,0 +1,137 @@ +#region CmdMessenger - MIT - (c) 2013 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2013 - Thijs Elenbaas +*/ +#endregion + +using System; +using System.Threading; + +namespace CommandMessenger +{ + /// Class that regulates sleeping within a queue thread. + /// Based on load the sleep time will increase or decrease + public class QueueSpeed + { + private long _queueCount; + private long _prevTime; + private double _sleepTime; + private const double Alpha = 0.8; + private readonly double _targetQueue = 0.5; + private readonly long _maxSleep = 50; + private const long MinSleep = 0; + + /// Gets or sets the QueueSpeed name. Used for debugging + /// The object name. + public string Name { get; set; } + + /// Initialize the queue speed with a target filling of the queue. + /// target filling of the queue. + public QueueSpeed(double targetQueue) + { + _targetQueue = targetQueue; + _prevTime = TimeUtils.Millis; + _sleepTime = 0; + } + + /// Initialize the queue speed with a target filling of the queue. + /// target filling of the queue. + /// Maximum sleep times + public QueueSpeed(double targetQueue, long maxSleep) + { + _targetQueue = targetQueue; + _prevTime = TimeUtils.Millis; + _sleepTime = 0; + _maxSleep = maxSleep; + } + + /// Calculates the sleep time taking into account work being done in queue. + public void CalcSleepTime() { + var currentTime = TimeUtils.Millis; + var deltaT = Math.Max((currentTime-_prevTime),1); + var processT = deltaT- _sleepTime; + double rate = (double)_queueCount / (double)deltaT; + double targetT = Math.Min(_targetQueue / rate, _maxSleep); + double compensatedT = Math.Min(Math.Max(targetT - processT, 0), 1e6); + _sleepTime = Math.Max((double)Math.Min((Alpha * _sleepTime + (1 - Alpha) * compensatedT), (double)_maxSleep), MinSleep); + + //if (Name != "" && Name != null) + //{ + // Console.WriteLine("Rate {1} {0}", Name, rate); + // Console.WriteLine("Sleeptime {1} {0}", Name, _sleepTime); + //} + + // Reset + _prevTime = currentTime; + _queueCount = 0; + } + + /// Calculates the sleep without time taking into account work being done in queue. + public void CalcSleepTimeWithoutLoad() + { + var currentTime = TimeUtils.Millis; + var deltaT = Math.Max((currentTime - _prevTime), 1); + double rate = _queueCount / (double)deltaT; + double targetT = Math.Min(_targetQueue / rate,_maxSleep); + _sleepTime = Math.Max((Alpha * _sleepTime + (1 - Alpha) * targetT), MinSleep); + //if (Name != "" && Name != null) + //{ + //Console.WriteLine("Rate {1} {0}", Name, rate); + //Console.WriteLine("targetT {1} {0}", Name, targetT); + //Console.WriteLine("sleepTime {1} {0}", Name, _sleepTime); + //} + + // Reset + _prevTime = currentTime; + _queueCount = 0; + } + + /// Adds a unit to the load count. + public void AddCount() { + _queueCount++; + } + + /// Adds a count units to the load count. + /// Number of load units to increase. + public void AddCount(int count) + { + _queueCount+= count; + } + + /// Sets the count units to the load count. + /// Number of load units to increase. + public void SetCount(int count) + { + _queueCount = count; + } + + /// Resets the count units to zero. + public void ResetCount() + { + _queueCount = 0; + } + + /// Perform the sleep based on load. + public void Sleep() { + Sleep((long)_sleepTime); + } + + public void Sleep(long millis) + { + Thread.Sleep(TimeSpan.FromMilliseconds(millis)); + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Queue/ReceiveCommandQueue.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Queue/ReceiveCommandQueue.cs new file mode 100644 index 0000000..7ae2cef --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Queue/ReceiveCommandQueue.cs @@ -0,0 +1,109 @@ +#region CmdMessenger - MIT - (c) 2013 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2013 - Thijs Elenbaas +*/ +#endregion + +namespace CommandMessenger +{ + /// Queue of received commands. + public class ReceiveCommandQueue : CommandQueue + { + + public event NewLineEvent.NewLineHandler NewLineReceived; + private readonly QueueSpeed _queueSpeed = new QueueSpeed(0.5,5); + + /// Receive command queue constructor. + /// DisposeStack. + /// The command messenger. + public ReceiveCommandQueue(DisposeStack disposeStack, CmdMessenger cmdMessenger ) + : base(disposeStack, cmdMessenger) + { + disposeStack.Push(this); + QueueThread.Name = "ReceiveCommandQueue"; + // _queueSpeed.Name = "ReceiveCommandQueue"; + } + + /// Dequeue the received command. + /// The received command. + public ReceivedCommand DequeueCommand() + { + ReceivedCommand receivedCommand = null; + lock (Queue) + { + if (Queue.Count != 0) + { + foreach (var generalStrategy in GeneralStrategies) { generalStrategy.OnDequeue(); } + var commandStrategy = Queue.Dequeue(); + receivedCommand = (ReceivedCommand)commandStrategy.Command; + } + } + return receivedCommand; + } + + /// Process the queue. + protected override void ProcessQueue() + { + // Endless loop unless aborted + while (ThreadRunState != ThreadRunStates.Abort) + { + // Calculate sleep time based on incoming command speed + //_queueSpeed.SetCount(Queue.Count); + //_queueSpeed.CalcSleepTime(); + EventWaiter.Wait(1000); + + // Process queue unless stopped + if (ThreadRunState == ThreadRunStates.Start) + { + // Only actually sleep if there are no commands in the queue + //if (Queue.Count == 0) _queueSpeed.Sleep(); + + var dequeueCommand = DequeueCommand(); + if (dequeueCommand != null) + { + CmdMessenger.HandleMessage(dequeueCommand); + } + } + //else + //{ + // _queueSpeed.Sleep(); + //} + } + } + + /// Queue the received command. + /// The received command. + public void QueueCommand(ReceivedCommand receivedCommand) + { + QueueCommand(new CommandStrategy(receivedCommand)); + } + + /// Queue the command wrapped in a command strategy. + /// The command strategy. + public override void QueueCommand(CommandStrategy commandStrategy) + { + lock (Queue) + { + // Process all generic enqueue strategies + Queue.Enqueue(commandStrategy); + foreach (var generalStrategy in GeneralStrategies) { generalStrategy.OnEnqueue(); } + } + // Give a signal to indicate that a new item has been queued + EventWaiter.Set(); + if (NewLineReceived != null) NewLineReceived(this, new NewLineEvent.NewLineArgs(commandStrategy.Command)); + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Queue/SendCommandQueue.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Queue/SendCommandQueue.cs new file mode 100644 index 0000000..25d80b6 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Queue/SendCommandQueue.cs @@ -0,0 +1,203 @@ +#region CmdMessenger - MIT - (c) 2013 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2013 - Thijs Elenbaas +*/ +#endregion + +using System; +using System.Threading; + +namespace CommandMessenger +{ + /// Queue of received commands. + class SendCommandQueue : CommandQueue + { + private readonly Sender _sender; + public event NewLineEvent.NewLineHandler NewLineSent; + private readonly QueueSpeed _queueSpeed = new QueueSpeed(0.5,5); + //private readonly int _sendBufferMaxLength = 512; + private readonly int _sendBufferMaxLength = 62; + string _sendBuffer = ""; + int _commandCount = 0; + + public uint MaxQueueLength { get; set; } + + + /// send command queue constructor. + /// DisposeStack. + /// The command messenger. + /// Object that does the actual sending of the command + /// Length of the send buffer + public SendCommandQueue(DisposeStack disposeStack, CmdMessenger cmdMessenger, Sender sender, int sendBufferMaxLength) + : base(disposeStack, cmdMessenger) + { + MaxQueueLength = 5000; + QueueThread.Name = "SendCommandQueue"; + _sender = sender; + _sendBufferMaxLength = sendBufferMaxLength; + // _queueSpeed.Name = "SendCommandQueue"; + } + + /// Process the queue. + protected override void ProcessQueue() + { + // Endless loop unless aborted + while (ThreadRunState != ThreadRunStates.Abort) + { + // Calculate sleep time based on incoming command speed + //_queueSpeed.SetCount(Queue.Count); + //_queueSpeed.CalcSleepTime(); + EventWaiter.Wait(1000); + + // Process queue unless stopped + if (ThreadRunState == ThreadRunStates.Start) + { + // Only actually sleep if there are no commands in the queue + SendCommandsFromQueue(); + // _queueSpeed.Sleep(); + } + //else + //{ + // _queueSpeed.Sleep(); + //} + } + } + + /// Sends the commands from queue. All commands will be combined until either + /// the SendBufferMaxLength has been reached or if a command requires an acknowledge + /// + private void SendCommandsFromQueue() + { + _commandCount = 0; + _sendBuffer = ""; + CommandStrategy eventCommandStrategy = null; + + while (_sendBuffer.Length < _sendBufferMaxLength && Queue.Count != 0) // while maximum buffer string is not reached, and command in queue, AND + { + lock (Queue) + { + var commandStrategy = Queue.Count != 0 ? Queue.Peek() : null; + if (commandStrategy != null) + { + if (commandStrategy.Command != null) + { + var sendCommand = (SendCommand)commandStrategy.Command; + + if (sendCommand.ReqAc) + { + if (_commandCount > 0) + { + break; + } + SendSingleCommandFromQueue(commandStrategy); + } + else + { + eventCommandStrategy = commandStrategy; + AddToCommandsString(commandStrategy); + } + } + } + } + // event callback outside lock for performance + if (eventCommandStrategy != null) + { + if (NewLineSent != null) NewLineSent(this, new NewLineEvent.NewLineArgs(eventCommandStrategy.Command)); + eventCommandStrategy = null; + } + } + + // Now check if a command string has been filled + if (_sendBuffer.Length > 0) + { + _sender.ExecuteSendString(_sendBuffer, SendQueue.InFrontQueue); + } + } + + /// Sends a float command from the queue. + /// The command strategy to send. + private void SendSingleCommandFromQueue(CommandStrategy commandStrategy) + { + // Dequeue + lock (Queue) + { + commandStrategy.DeQueue(); + // Process all generic dequeue strategies + foreach (var generalStrategy in GeneralStrategies) { generalStrategy.OnDequeue(); } + } + // Send command + if (commandStrategy != null && commandStrategy.Command != null) + _sender.ExecuteSendCommand((SendCommand)commandStrategy.Command, SendQueue.InFrontQueue); + } + + /// Adds a commandStrategy to the commands string. + /// The command strategy to add. + private void AddToCommandsString(CommandStrategy commandStrategy) + { + // Dequeue + lock (Queue) + { + commandStrategy.DeQueue(); + // Process all generic dequeue strategies + foreach (var generalStrategy in GeneralStrategies) { generalStrategy.OnDequeue(); } + } + // Add command + if (commandStrategy != null && commandStrategy.Command != null) { + _commandCount++; + _sendBuffer += commandStrategy.Command.CommandString(); + if (Command.PrintLfCr) { _sendBuffer += Environment.NewLine; } + } + + } + + /// Sends a command. Note that the command is put at the front of the queue + /// The command to sent. + public void SendCommand(SendCommand sendCommand) + { + // Add command to front of queue + QueueCommand(new TopCommandStrategy(sendCommand)); + } + + /// Queue the send command. + /// The command to sent. + public void QueueCommand(SendCommand sendCommand) + { + QueueCommand(new CommandStrategy(sendCommand)); + } + + /// Queue the send command wrapped in a command strategy. + /// The command strategy. + public override void QueueCommand(CommandStrategy commandStrategy) + { + while (Queue.Count > MaxQueueLength) + { + Thread.Yield(); + } + lock (Queue) + { + // Process commandStrategy enqueue associated with command + commandStrategy.CommandQueue = Queue; + commandStrategy.ThreadRunState = ThreadRunState; + + commandStrategy.Enqueue(); + + // Process all generic enqueue strategies + foreach (var generalStrategy in GeneralStrategies) { generalStrategy.OnEnqueue(); } + } + EventWaiter.Set(); + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Queue/StaleGeneralStrategy.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Queue/StaleGeneralStrategy.cs new file mode 100644 index 0000000..90c55ac --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Queue/StaleGeneralStrategy.cs @@ -0,0 +1,57 @@ +#region CmdMessenger - MIT - (c) 2013 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2013 - Thijs Elenbaas +*/ +#endregion + +namespace CommandMessenger +{ + /// Stale strategy. Any command older than the time-out is removed from the queue + public class StaleGeneralStrategy : GeneralStrategy + { + private readonly long _commandTimeOut; + + /// Stale strategy. Any command older than the time-out is removed from the queue + /// The time-out for any commands on the queue. + public StaleGeneralStrategy(long commandTimeOut) + { + _commandTimeOut = commandTimeOut; + } + + /// Remove this command (strategy) from command queue. + public override void OnDequeue() + { + // Remove commands that have gone stale + //Console.WriteLine("Before StaleStrategy {0}", CommandQueue.Count); + var currentTime = TimeUtils.Millis; + // Work from oldest to newest + for (var item = 0; item < CommandQueue.Count; item++) + { + var age = currentTime - CommandQueue[item].Command.TimeStamp; + if (age > _commandTimeOut && CommandQueue.Count > 1 ) + { + CommandQueue.RemoveAt(item); + } + else + { + // From here on commands are newer, so we can stop + break; + } + } + //Console.WriteLine("After StaleStrategy {0}", CommandQueue.Count); + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Queue/TopCommandStrategy.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Queue/TopCommandStrategy.cs new file mode 100644 index 0000000..97f4dc7 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Queue/TopCommandStrategy.cs @@ -0,0 +1,38 @@ +#region CmdMessenger - MIT - (c) 2013 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2013 - Thijs Elenbaas +*/ +#endregion + +namespace CommandMessenger +{ + /// Top strategy. The command is added to the front of the queue + public class TopCommandStrategy : CommandStrategy + { + /// Top strategy. The command is added to the front of the queue + /// The command to add to the front of the queue. + public TopCommandStrategy(Command command) : base(command) + { + } + + /// Add command (strategy) to command queue. + public override void Enqueue() + { + //Console.WriteLine("Enqueue {0}", CommandQueue.Count); + CommandQueue.EnqueueFront(this); + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/ReceivedCommand.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/ReceivedCommand.cs new file mode 100644 index 0000000..e1d69ec --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/ReceivedCommand.cs @@ -0,0 +1,352 @@ +#region CmdMessenger - MIT - (c) 2013 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2013 - Thijs Elenbaas +*/ +#endregion + +using System; + +namespace CommandMessenger +{ + /// A command received from CmdMessenger + public class ReceivedCommand : Command + { + private int _parameter=-1; // The parameter + private bool _dumped = true; // true if parameter has been dumped + + /// Gets or sets the command input. + /// The raw string. + public string RawString { get; set; } + + /// Default constructor. + public ReceivedCommand() + { + } + + /// Constructor. + /// All command arguments, first one is command ID + public ReceivedCommand(string[] rawArguments) + { + int cmdId; + CmdId = (rawArguments != null && rawArguments.Length !=0 && int.TryParse(rawArguments[0], out cmdId)) ? cmdId : -1; + if (CmdId<0) return; + if (rawArguments.Length > 1) + { + var array = new string[rawArguments.Length - 1]; + Array.Copy(rawArguments, 1, array, 0, array.Length); + _arguments.AddRange(array); + } + } + + /// Fetches the next argument. + /// true if it succeeds, false if it fails. + public bool Next() + { + // If this parameter has already been read, see if there is another one + if (_dumped) + { + if (_parameter < _arguments.Count-1) + { + _parameter++; + _dumped = false; + return true; + } + return false; + } + return true; + } + + /// returns if a next command is available + /// true if it succeeds, false if it fails. + public bool Available() + { + return Next(); + } + + // ***** String based **** / + + /// Reads the current argument as short value. + /// The short value. + public Int16 ReadInt16Arg() + { + if (Next()) + { + Int16 current; + if (Int16.TryParse(_arguments[_parameter], out current)) + { + _dumped = true; + return current; + } + } + return 0; + } + + /// Reads the current argument as unsigned short value. + /// The unsigned short value. + public UInt16 ReadUInt16Arg() + { + if (Next()) + { + UInt16 current; + if (UInt16.TryParse(_arguments[_parameter], out current)) + { + _dumped = true; + return current; + } + } + return 0; + } + + /// Reads the current argument as boolean value. + /// The boolean value. + public bool ReadBoolArg() + { + return (ReadInt32Arg() != 0); + } + + /// Reads the current argument as int value. + /// The int value. + public Int32 ReadInt32Arg() + { + if (Next()) + { + Int32 current; + if (Int32.TryParse(_arguments[_parameter], out current)) + { + _dumped = true; + return current; + } + } + return 0; + } + + /// Reads the current argument as unsigned int value. + /// The unsigned int value. + public UInt32 ReadUInt32Arg() + { + if (Next()) + { + UInt32 current; + if (UInt32.TryParse(_arguments[_parameter], out current)) + { + _dumped = true; + return current; + } + } + return 0; + } + + /// Reads the current argument as a float value. + /// The float value. + public float ReadFloatArg() + { + if (Next()) + { + float current; + if (float.TryParse(_arguments[_parameter], out current)) + { + _dumped = true; + return current; + } + } + return 0; + } + + /// Reads the current argument as a double value. + /// The unsigned double value. + public Double ReadDoubleArg() + { + if (Next()) + { + if (BoardType == BoardType.Bit16) + { + float current; + if (float.TryParse(_arguments[_parameter], out current)) + { + _dumped = true; + return (Double) current; + } + } + else + { + Double current; + if (Double.TryParse(_arguments[_parameter], out current)) + { + _dumped = true; + return current; + } + } + } + return 0; + } + + /// Reads the current argument as a string value. + /// The string value. + public String ReadStringArg() + { + if (Next()) + { + if (_arguments[_parameter] != null) + { + _dumped = true; + return _arguments[_parameter]; + } + } + return ""; + } + + // ***** Binary **** / + + /// Reads the current binary argument as a float value. + /// The float value. + public float ReadBinFloatArg() + { + if (Next()) + { + var current = BinaryConverter.ToFloat(_arguments[_parameter]); + if (current != null) + { + _dumped = true; + return (float) current; + } + } + return 0; + } + + /// Reads the current binary argument as a double value. + /// The double value. + public Double ReadBinDoubleArg() + { + if (Next()) + { + if (BoardType == BoardType.Bit16) + { + var current = BinaryConverter.ToFloat(_arguments[_parameter]); + if (current != null) + { + _dumped = true; + return (double) current; + } + } + else + { + var current = BinaryConverter.ToDouble(_arguments[_parameter]); + if (current != null) + { + _dumped = true; + return (double)current; + } + } + } + return 0; + } + + /// Reads the current binary argument as a short value. + /// The short value. + public Int16 ReadBinInt16Arg() + { + if (Next()) + { + var current = BinaryConverter.ToInt16(_arguments[_parameter]); + if (current != null) + { + _dumped = true; + return (Int16) current; + } + } + return 0; + } + + /// Reads the current binary argument as a unsigned short value. + /// The unsigned short value. + public UInt16 ReadBinUInt16Arg() + { + if (Next()) + { + var current = BinaryConverter.ToUInt16(_arguments[_parameter]); + if (current != null) + { + _dumped = true; + return (UInt16) current; + } + } + return 0; + } + + /// Reads the current binary argument as a int value. + /// The int32 value. + public Int32 ReadBinInt32Arg() + { + if (Next()) + { + var current = BinaryConverter.ToInt32(_arguments[_parameter]); + if (current != null) + { + _dumped = true; + return (Int32) current; + } + } + return 0; + } + + /// Reads the current binary argument as a unsigned int value. + /// The unsigned int value. + public UInt32 ReadBinUInt32Arg() + { + if (Next()) + { + var current = BinaryConverter.ToUInt32(_arguments[_parameter]); + if (current != null) + { + _dumped = true; + return (UInt32) current; + } + } + return 0; + } + + /// Reads the current binary argument as a string value. + /// The string value. + public String ReadBinStringArg() + { + if (Next()) + { + if (_arguments[_parameter] != null) + { + _dumped = true; + return Escaping.Unescape(_arguments[_parameter]); + } + } + return ""; + } + + /// Reads the current binary argument as a boolean value. + /// The boolean value. + public bool ReadBinBoolArg() + { + if (Next()) + { + var current = BinaryConverter.ToByte(_arguments[_parameter]); + if (current != null) + { + _dumped = true; + return (current != 0); + } + } + return false; + } + } +} \ No newline at end of file diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/SendCommand.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/SendCommand.cs new file mode 100644 index 0000000..dc0ffcd --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/SendCommand.cs @@ -0,0 +1,380 @@ +#region CmdMessenger - MIT - (c) 2013 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2013 - Thijs Elenbaas +*/ +#endregion + +using System; +using System.Collections.Generic; +using System.Globalization; + +namespace CommandMessenger +{ + /// A command to be send by CmdMessenger + public class SendCommand : Command + { + /// Indicates if we want to wait for an acknowledge command. + /// true if request acknowledge, false if not. + public bool ReqAc { get; set; } + + /// Gets or sets the acknowledge command ID. + /// the acknowledge command ID. + public int AckCmdId { get; set; } + + /// Gets or sets the time we want to wait for the acknowledge command. + /// The timeout on waiting for an acknowledge + public int Timeout { get; set; } + + /// Constructor. + /// the command ID. + public SendCommand(int cmdId) + { + Init(cmdId, false, 0, 0); + } + + /// Constructor. + /// Command ID + /// The argument. + public SendCommand(int cmdId, string argument) + { + Init(cmdId, false, 0, 0); + AddArgument(argument); + } + + /// Constructor. + /// Command ID + /// The arguments. + public SendCommand(int cmdId, string[] arguments) + { + Init(cmdId, false, 0, 0); + AddArguments(arguments); + } + + /// Constructor. + /// Command ID + /// The argument. + public SendCommand(int cmdId, float argument) + { + Init(cmdId, false, 0, 0); + AddArgument(argument); + } + + /// Constructor. + /// Command ID + /// The argument. + public SendCommand(int cmdId, double argument) + { + Init(cmdId, false, 0, 0); + AddArgument(argument); + } + + /// Constructor. + /// Command ID + /// The argument. + public SendCommand(int cmdId, UInt16 argument) + { + Init(cmdId, false, 0, 0); + AddArgument(argument); + } + + /// Constructor. + /// Command ID + /// The argument. + public SendCommand(int cmdId, Int16 argument) + { + Init(cmdId, false, 0, 0); + AddArgument(argument); + } + + /// Constructor. + /// Command ID + /// The argument. + public SendCommand(int cmdId, UInt32 argument) + { + Init(cmdId, false, 0, 0); + AddArgument(argument); + } + + /// Constructor. + /// Command ID + /// The argument. + public SendCommand(int cmdId, Int32 argument) + { + Init(cmdId, false, 0, 0); + AddArgument(argument); + } + + /// Constructor. + /// Command ID + /// The argument. + public SendCommand(int cmdId, bool argument) + { + Init(cmdId, false, 0, 0); + AddArgument(argument); + } + + /// Constructor. + /// Command ID + /// Acknowledge command ID. + /// The timeout on waiting for an acknowledge + public SendCommand(int cmdId, int ackCmdId, int timeout) + { + Init(cmdId, true, ackCmdId, timeout); + } + + /// Constructor. + /// Command ID + /// The argument. + /// Acknowledge command ID. + /// The timeout on waiting for an acknowledge + public SendCommand(int cmdId, string argument, int ackCmdId, int timeout) + { + Init(cmdId, true, ackCmdId, timeout); + AddArgument(argument); + } + + /// Constructor. + /// Command ID + /// The arguments. + /// Acknowledge command ID. + /// The timeout on waiting for an acknowledge + public SendCommand(int cmdId, string[] arguments, int ackCmdId, int timeout) + { + Init(cmdId, true, ackCmdId, timeout); + AddArguments(arguments); + } + + /// Constructor. + /// Command ID + /// The argument. + /// Acknowledge command ID. + /// The timeout on waiting for an acknowledge + public SendCommand(int cmdId, float argument, int ackCmdId, int timeout) + { + Init(cmdId, true, ackCmdId, timeout); + AddArgument(argument); + } + + /// Constructor. + /// Command ID + /// The argument. + /// Acknowledge command ID. + /// The timeout on waiting for an acknowledge + public SendCommand(int cmdId, double argument, int ackCmdId, int timeout) + { + Init(cmdId, true, ackCmdId, timeout); + AddArgument(argument); + } + + /// Constructor. + /// Command ID + /// The argument. + /// Acknowledge command ID. + /// The timeout on waiting for an acknowledge + public SendCommand(int cmdId, Int16 argument, int ackCmdId, int timeout) + { + Init(cmdId, true, ackCmdId, timeout); + AddArgument(argument); + } + + /// Constructor. + /// Command ID + /// The argument. + /// Acknowledge command ID. + /// The timeout on waiting for an acknowledge + public SendCommand(int cmdId, UInt16 argument, int ackCmdId, int timeout) + { + Init(cmdId, true, ackCmdId, timeout); + AddArgument(argument); + } + + /// Constructor. + /// Command ID + /// The argument. + /// Acknowledge command ID. + /// The timeout on waiting for an acknowledge + public SendCommand(int cmdId, Int32 argument, int ackCmdId, int timeout) + { + Init(cmdId, true, ackCmdId, timeout); + AddArgument(argument); + } + + /// Constructor. + /// Command ID + /// The argument. + /// Acknowledge command ID. + /// The timeout on waiting for an acknowledge + public SendCommand(int cmdId, UInt32 argument, int ackCmdId, int timeout) + { + Init(cmdId, true, ackCmdId, timeout); + AddArgument(argument); + } + + /// Initializes this object. + /// Command ID + /// true to request ac. + /// Acknowledge command ID. + /// The timeout on waiting for an acknowledge + private void Init(int cmdId, bool reqAc, int ackCmdId, int timeout) + { + ReqAc = reqAc; + CmdId = cmdId; + AckCmdId = ackCmdId; + Timeout = timeout; + _arguments = new List(); + } + + // ***** String based **** / + + /// Adds a command argument. + /// The argument. + public void AddArgument(string argument) + { + if (argument != null) + _arguments.Add(argument); + } + + /// Adds command arguments. + /// The arguments. + public void AddArguments(string[] arguments) + { + if (arguments != null) + _arguments.AddRange(arguments); + } + + + + /// Adds a command argument. + /// The argument. + public void AddArgument(float argument) + { + _arguments.Add(argument.ToString("R",CultureInfo.InvariantCulture)); + } + + /// Adds a command argument. + /// The argument. + public void AddArgument(Double argument) + { + if (BoardType == BoardType.Bit16) + { + // Not completely sure if this is needed for plain text sending. + var floatArg = (float) argument; + _arguments.Add(floatArg.ToString("R",CultureInfo.InvariantCulture)); + } + else + { + _arguments.Add(argument.ToString("R",CultureInfo.InvariantCulture)); + } + } + + /// Adds a command argument. + /// The argument. + public void AddArgument(Int16 argument) + { + _arguments.Add(argument.ToString(CultureInfo.InvariantCulture)); + } + + /// Adds a command argument. + /// The argument. + public void AddArgument(UInt16 argument) + { + _arguments.Add(argument.ToString(CultureInfo.InvariantCulture)); + } + + /// Adds a command argument. + /// The argument. + public void AddArgument(Int32 argument) + { + // Make sure the other side can read this: on a 16 processor, read as Long + _arguments.Add(argument.ToString(CultureInfo.InvariantCulture)); + } + + /// Adds a command argument. + /// The argument. + public void AddArgument(UInt32 argument) + { + // Make sure the other side can read this: on a 16 processor, read as Long + _arguments.Add(argument.ToString(CultureInfo.InvariantCulture)); + } + + /// Adds a command argument. + /// The argument. + public void AddArgument(bool argument) + { + AddArgument((Int16) (argument ? 1 : 0)); + } + + // ***** Binary **** / + + /// Adds a binary command argument. + /// The argument. + public void AddBinArgument(string argument) + { + _arguments.Add(Escaping.Escape(argument)); + } + + /// Adds a binary command argument. + /// The argument. + public void AddBinArgument(float argument) + { + _arguments.Add(BinaryConverter.ToString(argument)); + } + + /// Adds a binary command argument. + /// The argument. + public void AddBinArgument(Double argument) + { + _arguments.Add(BoardType == BoardType.Bit16 + ? BinaryConverter.ToString((float)argument) + : BinaryConverter.ToString(argument)); + } + + /// Adds a binary command argument. + /// The argument. + public void AddBinArgument(Int16 argument) + { + _arguments.Add(BinaryConverter.ToString(argument)); + } + + /// Adds a binary command argument. + /// The argument. + public void AddBinArgument(UInt16 argument) + { + _arguments.Add(BinaryConverter.ToString(argument)); + } + + /// Adds a binary command argument. + /// The argument. + public void AddBinArgument(Int32 argument) + { + _arguments.Add(BinaryConverter.ToString(argument)); + } + + /// Adds a binary command argument. + /// The argument. + public void AddBinArgument(UInt32 argument) + { + _arguments.Add(BinaryConverter.ToString(argument)); + } + + /// Adds a binary command argument. + /// The argument. + public void AddBinArgument(bool argument) + { + _arguments.Add(BinaryConverter.ToString(argument ? (byte) 1 : (byte) 0)); + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Sender.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Sender.cs new file mode 100644 index 0000000..9b8fca0 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Sender.cs @@ -0,0 +1,150 @@ +#region CmdMessenger - MIT - (c) 2014 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2014 - Thijs Elenbaas +*/ +#endregion +using System; +using System.Threading; + +namespace CommandMessenger +{ + public class Sender + { + readonly CommunicationManager _communicationManager; + readonly ReceiveCommandQueue _receiveCommandQueue; + private readonly Object _sendCommandDataLock = new Object(); // The process serial data lock + + /// Gets or sets the current received command. + /// The current received command. + public ReceivedCommand CurrentReceivedCommand { get; private set; } + + /// Gets or sets a whether to print a line feed carriage return after each command. + /// true if print line feed carriage return, false if not. + public bool PrintLfCr { get; set; } + + public Sender(CommunicationManager communicationManager, ReceiveCommandQueue receiveCommandQueue) + { + _communicationManager = communicationManager; + _receiveCommandQueue = receiveCommandQueue; + } + + /// Directly executes the send command operation. + /// The command to sent. + /// Property to optionally clear the send and receive queues. + /// A received command. The received command will only be valid if the ReqAc of the command is true. + public ReceivedCommand ExecuteSendCommand(SendCommand sendCommand, SendQueue sendQueueState) + { + // Disable listening, all callbacks are disabled until after command was sent + + ReceivedCommand ackCommand; + lock (_sendCommandDataLock) + { + + if (PrintLfCr) + _communicationManager.WriteLine(sendCommand.CommandString()); + else + _communicationManager.Write(sendCommand.CommandString()); + ackCommand = sendCommand.ReqAc ? BlockedTillReply(sendCommand.AckCmdId, sendCommand.Timeout, sendQueueState) : new ReceivedCommand(); + } + return ackCommand; + } + + /// Directly executes the send string operation. + /// The string to sent. + /// Property to optionally clear the send and receive queues. + /// The received command is added for compatibility. It will not yield a response. + public ReceivedCommand ExecuteSendString(String commandsString, SendQueue sendQueueState) + { + lock (_sendCommandDataLock) + { + if (PrintLfCr) + _communicationManager.WriteLine(commandsString); + else + { + _communicationManager.Write(commandsString); + } + } + return new ReceivedCommand(); + } + + /// Blocks until acknowledgement reply has been received. + /// acknowledgement command ID + /// Timeout on acknowledge command. + /// + /// A received command. + private ReceivedCommand BlockedTillReply(int ackCmdId, int timeout, SendQueue sendQueueState) + { + // Disable invoking command callbacks + _receiveCommandQueue.ThreadRunState = CommandQueue.ThreadRunStates.Stop; + + // Disable thread based polling of Serial Interface + //_communicationManager.StopPolling(); + + var start = TimeUtils.Millis; + var time = start; + var acknowledgeCommand = new ReceivedCommand(); + while ((time - start < timeout) && !acknowledgeCommand.Ok) + { + time = TimeUtils.Millis; + // Force updating the transport buffer + //_communicationManager.UpdateTransportBuffer(); + // Yield to other threads in order to process data in the buffer + Thread.Yield(); + // Check if an acknowledgment command has come in + acknowledgeCommand = CheckForAcknowledge(ackCmdId, sendQueueState); + } + + // Re enable thread based polling of Serial Interface + //_communicationManager.StartPolling(); + + // Re-enable invoking command callbacks + _receiveCommandQueue.ThreadRunState = CommandQueue.ThreadRunStates.Start; + return acknowledgeCommand; + } + + /// Listen to the receive queue and check for a specific acknowledge command. + /// acknowledgement command ID. + /// Property to optionally clear the send and receive queues. + /// The first received command that matches the command ID. + private ReceivedCommand CheckForAcknowledge(int ackCmdId, SendQueue sendQueueState) + { + // Read command from received queue + CurrentReceivedCommand = _receiveCommandQueue.DequeueCommand(); + if (CurrentReceivedCommand != null) + { + // Check if received command is valid + if (!CurrentReceivedCommand.Ok) return CurrentReceivedCommand; + + // If valid, check if is same as command we are waiting for + if (CurrentReceivedCommand.CmdId == ackCmdId) + { + // This is command we are waiting for, so return + return CurrentReceivedCommand; + } + + // This is not command we are waiting for + if (sendQueueState != SendQueue.ClearQueue) + { + // Add to queue for later processing + _receiveCommandQueue.QueueCommand(CurrentReceivedCommand); + } + } + // Return not Ok received command + return new ReceivedCommand(); + } + + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Serialport/SerialConnectionManager.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Serialport/SerialConnectionManager.cs new file mode 100644 index 0000000..258756f --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Serialport/SerialConnectionManager.cs @@ -0,0 +1,332 @@ +#region CmdMessenger - MIT - (c) 2014 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2014 - Thijs Elenbaas +*/ +#endregion + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.IO; +using System.IO.Ports; +using System.Linq; +using System.Runtime.Serialization.Formatters.Binary; +using System.Threading; + +namespace CommandMessenger.Serialport +{ + + /// + /// Class for storing last succesfull connection + /// + [Serializable()] + public class LastConnectedSetting + { + public String Port{ get; set; } + public int BaudRate { get; set; } + } + + /// + /// Connection manager for serial port connection + /// + public class SerialConnectionManager : ConnectionManager + { + const string SettingsFileName = @"LastConnectedSerialSetting.cfg"; + private LastConnectedSetting _lastConnectedSetting; + private readonly SerialTransport _serialTransport; + private int _scanType = 0; + + // The control to invoke the callback on + private readonly object _tryConnectionLock = new object(); + + /// + /// Connection manager for serial port connection + /// + /// Try connection given specific port name & baud rate + /// + /// Port name + /// Baud rate + /// Time out for response + /// true if succesfully connected + public bool TryConnection(string portName, int baudRate, int timeOut) + { + // Try specific port name & baud rate + + _serialTransport.CurrentSerialSettings.PortName = portName; + _serialTransport.CurrentSerialSettings.BaudRate = baudRate; + return TryConnection(timeOut); + } + + /// + /// Try connection + /// + /// Time out for response + /// true if succesfully connected + public bool TryConnection(int timeOut) + { + lock(_tryConnectionLock) + Connected = false; + Log(1, @"Trying serial port " + _serialTransport.CurrentSerialSettings.PortName + @" baud rate " + _serialTransport.CurrentSerialSettings.BaudRate); + if (_serialTransport.Connect()) + { + Connected = (ArduinoAvailable(timeOut,2)); + + if (Connected) + { + Log(1, "Connected at serial port " + _serialTransport.CurrentSerialSettings.PortName + @" baud rate " + _serialTransport.CurrentSerialSettings.BaudRate); + StoreSettings(); + } + return Connected; + } + return false; + } + + + // Single scan on foreground thread + public bool SingleScan() + { + if (QuickScan()) return true; + if (ThoroughScan()) return true; + return false; + } + + protected override void DoWorkScan() + { + if (Thread.CurrentThread.Name == null) Thread.CurrentThread.Name = "BluetoothConnectionManager"; + var activeConnection = false; + + { + if (_scanType == 0) + { + _scanType = 1; + try { activeConnection = QuickScan(); } + catch { } + } + else if (_scanType == 1) + { + _scanType = 0; + try { activeConnection = ThoroughScan(); } + catch { } + } + } + + // Trigger event when a connection was made + if (activeConnection) + { + ConnectionManagerState = ConnectionManagerStates.Wait; + ConnectionFoundEvent(); + + } + } + + public bool QuickScan() + { + Log(3, "Performing quick scan"); + const int longTimeOut = 1000; + const int shortTimeOut = 500; + + // First try if currentConnection is open or can be opened + if (TryConnection(longTimeOut)) return true; + + // Then try if last stored connection can be opened + Log(3, "Trying last stored connection"); + if (TryConnection(_lastConnectedSetting.Port, _lastConnectedSetting.BaudRate, longTimeOut)) return true; + + // Then see if port list has changed + //if (NewPortInList().Count > 0) { _scanType = 2; return false; } + + // Quickly run through most used ports + int[] commonBaudRates = + { + 115200, // Arduino Uno, Mega, with AT8u2 USB + 57600, // Arduino Duemilanove, FTDI Serial + 9600 // Often used as default, but slow! + }; + _serialTransport.UpdatePortCollection(); + for (var port = _serialTransport.CurrentSerialSettings.PortNameCollection.Length- 1; port >= 0; port--) + { + // If port list has changed, interrupt scan and test new ports first + if (NewPortScan()) return true; + + var portName = _serialTransport.CurrentSerialSettings.PortNameCollection[port]; + // First set port name + _serialTransport.CurrentSerialSettings.PortName = portName; + // Now update BaudRate Collection + _serialTransport.UpdateBaudRateCollection(); + var baudRateCollection =_serialTransport.CurrentSerialSettings.BaudRateCollection; + + // Now loop through baud rate collection + foreach (var commonBaudRate in commonBaudRates) + { + + if (_serialTransport.CurrentSerialSettings.BaudRateCollection.Contains(commonBaudRate)) + { + + Log(1, + "Trying Port" + portName + ", possible speeds " + + baudRateCollection.Count + " " + + (baudRateCollection.Count > commonBaudRates.Length ? ", trying " + commonBaudRates.Length : "") + ); + if (TryConnection(portName,commonBaudRate, shortTimeOut)) return true; + Thread.Sleep(25); + } + } + } + return false; + } + + public bool ThoroughScan() + { + Console.WriteLine("Performing thorough scan"); + Log(1, "Performing thorough scan"); + // First try last used connection + const int longTimeOut = 1000; + const int shortTimeOut = 500; + + // First try if currentConnection is open or can be opened + if (TryConnection(longTimeOut)) return true; + + // Then try if last stored connection can be opened + if (TryConnection(_lastConnectedSetting.Port, _lastConnectedSetting.BaudRate, longTimeOut)) return true; + + + + // Slowly walk through + _serialTransport.UpdatePortCollection(); + foreach (var portName in _serialTransport.CurrentSerialSettings.PortNameCollection) + { + + + // First set port name + _serialTransport.CurrentSerialSettings.PortName = portName; + // update BaudRate Collection + _serialTransport.UpdateBaudRateCollection(); + // Now loop through baud rate collection + var baudRateCollection = _serialTransport.CurrentSerialSettings.BaudRateCollection; + + Log(1, "Trying Port" + portName + ", possible speeds " + baudRateCollection.Count); + + foreach (var baudRate in baudRateCollection) + { + // If port list has changed, interrupt scan and test new ports first + if (NewPortScan()) return true; + { + if (TryConnection(portName,baudRate, shortTimeOut)) + return true; + Thread.Sleep(100); + } + } + } + return false; + } + + public bool NewPortScan() + { + const int shortTimeOut = 200; + + // Then see if port list has changed + var newPorts = NewPortInList(); + if (newPorts.Count == 0) { return false; } + + Console.WriteLine("Trying new ports"); + Log(1, "Trying new ports"); + + // Quickly run through most used ports + int[] commonBaudRates = + { + 115200, // Arduino Uno, Mega, with AT8u2 USB + 57600, // Arduino Duemilanove, FTDI Serial + 9600 // Often used as default, but slow! + }; + _serialTransport.UpdatePortCollection(); + foreach (var portName in newPorts) + { + // First set port name + _serialTransport.CurrentSerialSettings.PortName = portName; + // Now update BaudRate Collection + _serialTransport.UpdateBaudRateCollection(); + // Now loop through baud rate collection + var allBaudRates = _serialTransport.CurrentSerialSettings.BaudRateCollection; + // First add commonBaudRates available + var sortedBaudRates = commonBaudRates.Where(allBaudRates.Contains).ToList(); + // Then add other BaudRates + sortedBaudRates.AddRange(allBaudRates.Where(baudRate => !commonBaudRates.Contains(baudRate))); + + foreach (var currentBaudRate in sortedBaudRates) + { + if (TryConnection(portName, currentBaudRate, shortTimeOut)) return true; + Thread.Sleep(100); + } + } + return false; + } + + + private List NewPortInList() + { + var oldPortCollection = _serialTransport.CurrentSerialSettings.PortNameCollection; + var portCollection = SerialPort.GetPortNames(); + return portCollection.Where(port => !oldPortCollection.Any(port.Contains)).ToList(); + } + + private void StoreSettings() + { + _lastConnectedSetting.Port = _serialTransport.CurrentSerialSettings.PortName; + _lastConnectedSetting.BaudRate = _serialTransport.CurrentSerialSettings.BaudRate; + + var fileStream = File.Create(SettingsFileName); + var serializer = new BinaryFormatter(); + serializer.Serialize(fileStream,_lastConnectedSetting); + fileStream.Close(); + } + + private void ReadSettings() + { + // Read from file + + _lastConnectedSetting.Port = "COM1"; + _lastConnectedSetting.BaudRate = 115200; + if (File.Exists(SettingsFileName)) + { + var fileStream = File.OpenRead(SettingsFileName); + var deserializer = new BinaryFormatter(); + _lastConnectedSetting = (LastConnectedSetting)deserializer.Deserialize(fileStream); + fileStream.Close(); + } + } + + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Serialport/SerialSettings.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Serialport/SerialSettings.cs new file mode 100644 index 0000000..fee7943 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Serialport/SerialSettings.cs @@ -0,0 +1,236 @@ +#region CmdMessenger - MIT - (c) 2013 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2013 - Thijs Elenbaas +*/ +#endregion + +using System; +using System.Collections.Generic; +using System.IO.Ports; +using System.ComponentModel; + +namespace CommandMessenger +{ + /// + /// Class containing properties related to a serial port + /// + public class SerialSettings : INotifyPropertyChanged + { + public event PropertyChangedEventHandler PropertyChanged; + string _portName = ""; + int _baudRate = 115200; + readonly List _baudRateCollection = new List(); + Parity _parity = Parity.None; + int _dataBits = 8; + int[] _dataBitsCollection = new[] { 5, 6, 7, 8 }; + StopBits _stopBits = StopBits.One; + private bool _dtrEnable = false; + + #region Properties + /// + /// The port to use (for example, COM1). + /// + public string PortName + { + get { return _portName; } + set + { + if (!_portName.Equals(value)) + { + _portName = value; + } + } + } + /// + /// The baud rate. + /// + public int BaudRate + { + get { return _baudRate; } + set + { + if (_baudRate != value) + { + _baudRate = value; + } + } + } + + /// + /// One of the Parity values. + /// + public Parity Parity + { + get { return _parity; } + set + { + if (_parity != value) + { + _parity = value; + } + } + } + /// + /// The data bits value. + /// + public int DataBits + { + get { return _dataBits; } + set + { + if (_dataBits != value) + { + _dataBits = value; + } + } + } + /// + /// One of the StopBits values. + /// + public StopBits StopBits + { + get { return _stopBits; } + set + { + if (_stopBits != value) + { + _stopBits = value; + } + } + } + + /// + /// Set Data Terminal Ready. + /// + public bool DtrEnable + { + get { return _dtrEnable; } + set + { + if (_dtrEnable != value) + { + _dtrEnable = value; + } + } + } + + /// + /// Available ports on the computer + /// + public string[] PortNameCollection { get; set; } + + /// + /// Available baud rates for current serial port + /// + public List BaudRateCollection + { + get { return _baudRateCollection; } + } + + /// + /// Available data bits setting + /// + public int[] DataBitsCollection + { + get { return _dataBitsCollection; } + set { _dataBitsCollection = value; } + } + + #endregion + + #region Methods + /// + /// Updates the range of possible baud rates for device + /// + /// dwSettableBaud parameter from the COMMPROP Structure + /// An updated list of values + public void UpdateBaudRateCollection(int possibleBaudRates) + { + // ReSharper disable InconsistentNaming + const int BAUD_075 = 0x00000001; // The fifth baud 07 + const int BAUD_110 = 0x00000002; + const int BAUD_150 = 0x00000008; + const int BAUD_300 = 0x00000010; + const int BAUD_600 = 0x00000020; + const int BAUD_1200 = 0x00000040; + const int BAUD_1800 = 0x00000080; + const int BAUD_2400 = 0x00000100; + const int BAUD_4800 = 0x00000200; + const int BAUD_7200 = 0x00000400; + const int BAUD_9600 = 0x00000800; + const int BAUD_14400 = 0x00001000; + const int BAUD_19200 = 0x00002000; + const int BAUD_38400 = 0x00004000; + const int BAUD_56K = 0x00008000; + const int BAUD_57600 = 0x00040000; + const int BAUD_115200 = 0x00020000; + const int BAUD_128K = 0x00010000; + + _baudRateCollection.Clear(); + + if ((possibleBaudRates & BAUD_075) > 0) + _baudRateCollection.Add(75); + if ((possibleBaudRates & BAUD_110) > 0) + _baudRateCollection.Add(110); + if ((possibleBaudRates & BAUD_150) > 0) + _baudRateCollection.Add(150); + if ((possibleBaudRates & BAUD_300) > 0) + _baudRateCollection.Add(300); + if ((possibleBaudRates & BAUD_600) > 0) + _baudRateCollection.Add(600); + if ((possibleBaudRates & BAUD_1200) > 0) + _baudRateCollection.Add(1200); + if ((possibleBaudRates & BAUD_1800) > 0) + _baudRateCollection.Add(1800); + if ((possibleBaudRates & BAUD_2400) > 0) + _baudRateCollection.Add(2400); + if ((possibleBaudRates & BAUD_4800) > 0) + _baudRateCollection.Add(4800); + if ((possibleBaudRates & BAUD_7200) > 0) + _baudRateCollection.Add(7200); + if ((possibleBaudRates & BAUD_9600) > 0) + _baudRateCollection.Add(9600); + if ((possibleBaudRates & BAUD_14400) > 0) + _baudRateCollection.Add(14400); + if ((possibleBaudRates & BAUD_19200) > 0) + _baudRateCollection.Add(19200); + if ((possibleBaudRates & BAUD_38400) > 0) + _baudRateCollection.Add(38400); + if ((possibleBaudRates & BAUD_56K) > 0) + _baudRateCollection.Add(56000); + if ((possibleBaudRates & BAUD_57600) > 0) + _baudRateCollection.Add(57600); + if ((possibleBaudRates & BAUD_115200) > 0) + _baudRateCollection.Add(115200); + if ((possibleBaudRates & BAUD_128K) > 0) + _baudRateCollection.Add(128000); + + SendPropertyChangedEvent("BaudRateCollection"); + } + + /// + /// Send a PropertyChanged event + /// + /// Name of changed property + private void SendPropertyChangedEvent(String propertyName) + { + if (PropertyChanged != null) + PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + + #endregion + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Serialport/SerialTransport.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Serialport/SerialTransport.cs new file mode 100644 index 0000000..9f94479 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/Serialport/SerialTransport.cs @@ -0,0 +1,399 @@ +#region CmdMessenger - MIT - (c) 2013 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2013 - Thijs Elenbaas +*/ +#endregion + +using System; +using System.IO.Ports; +using System.Reflection; +using System.Linq; +using System.Threading; +using CommandMessenger.TransportLayer; + +namespace CommandMessenger.Serialport +{ + public enum ThreadRunStates + { + Start, + Stop, + Abort, + } + + /// Fas + /// Manager for serial port data + /// + public class SerialTransport : DisposableObject, ITransport + { + private readonly QueueSpeed _queueSpeed = new QueueSpeed(4,10); + private Thread _queueThread; + private ThreadRunStates _threadRunState; + private readonly object _threadRunStateLock = new object(); + private readonly object _serialReadWriteLock = new object(); + + /// Gets or sets the run state of the thread . + /// The thread run state. + public ThreadRunStates ThreadRunState + { + set + { + lock (_threadRunStateLock) + { + _threadRunState = value; + } + } + get + { + ThreadRunStates result; + lock (_threadRunStateLock) + { + result = _threadRunState; + } + return result; + } + } + + /// Default constructor. + public SerialTransport() + { + Initialize(); + } + + /// Initializes this object. + public void Initialize() + { + // _queueSpeed.Name = "Serial"; + // Find installed serial ports on hardware + _currentSerialSettings.PortNameCollection = SerialPort.GetPortNames(); + + // If serial ports are found, we select the first one + if (_currentSerialSettings.PortNameCollection.Length > 0) + _currentSerialSettings.PortName = _currentSerialSettings.PortNameCollection[0]; + + // Create queue thread and wait for it to start + + _queueThread = new Thread(ProcessQueue) + { + Priority = ThreadPriority.Normal, + Name = "Serial" + }; + ThreadRunState = ThreadRunStates.Start; + _queueThread.Start(); + while (!_queueThread.IsAlive) { Thread.Sleep(50); } + } + + #region Fields + + private SerialPort _serialPort; // The serial port + private SerialSettings _currentSerialSettings = new SerialSettings(); // The current serial settings + public event EventHandler NewDataReceived; // Event queue for all listeners interested in NewLinesReceived events. + + #endregion + + #region Properties + + /// Gets or sets the current serial port settings. + /// The current serial settings. + public SerialSettings CurrentSerialSettings + { + get { return _currentSerialSettings; } + set { _currentSerialSettings = value; } + } + + /// Gets the serial port. + /// The serial port. + public SerialPort SerialPort + { + get { return _serialPort; } + } + + #endregion + + #region Methods + + protected void ProcessQueue() + { + // Endless loop + while (ThreadRunState != ThreadRunStates.Abort) + { + Poll(ThreadRunState); + } + _queueSpeed.Sleep(50); + } + + public void StartPolling() + { + ThreadRunState = ThreadRunStates.Start; + } + + public void StopPolling() + { + ThreadRunState = ThreadRunStates.Stop; + } + + private void Poll(ThreadRunStates threadRunState) + { + var bytes = BytesInBuffer(); + _queueSpeed.SetCount(bytes); + _queueSpeed.CalcSleepTimeWithoutLoad(); + _queueSpeed.Sleep(); + if (threadRunState == ThreadRunStates.Start) + { + if (bytes > 0) + { + if (NewDataReceived != null) NewDataReceived(this, null); + } + } + } + + public void Poll() + { + Poll(ThreadRunStates.Start); + } + + /// Connects to a serial port defined through the current settings. + /// true if it succeeds, false if it fails. + public bool Connect() + { + // Closing serial port if it is open + + //if (IsOpen()) Close(); + Close(); + + // Setting serial port settings + _serialPort = new SerialPort( + _currentSerialSettings.PortName, + _currentSerialSettings.BaudRate, + _currentSerialSettings.Parity, + _currentSerialSettings.DataBits, + _currentSerialSettings.StopBits) + { + DtrEnable = _currentSerialSettings.DtrEnable, + WriteTimeout = 1000 + }; + + + // Subscribe to event and open serial port for data + ThreadRunState = ThreadRunStates.Start; + return Open(); + } + + /// Opens the serial port. + /// true if it succeeds, false if it fails. + public bool Open() + { + if(_serialPort != null && PortExists() && !_serialPort.IsOpen) + { + try + { + _serialPort.Open(); + _serialPort.DiscardInBuffer(); + _serialPort.DiscardOutBuffer(); + return _serialPort.IsOpen; + } + catch + { + return false; + } + } + + return true; + } + + public bool IsConnected() + { + return IsOpen(); + } + + /// Queries if a given port exists. + /// true if it succeeds, false if it fails. + public bool PortExists() + { + return SerialPort.GetPortNames().Contains(_serialPort.PortName); + } + + /// Closes the serial port. + /// true if it succeeds, false if it fails. + public bool Close() + { + try + { + if (SerialPort == null || !PortExists()) return false; + if (!_serialPort.IsOpen) return true; + _serialPort.Close(); + return true; + } + catch + { + return false; + } + } + + /// Query ifthe serial port is open. + /// true if open, false if not. + public bool IsOpen() + { + try + { + return _serialPort != null && PortExists() && _serialPort.IsOpen; + } + catch + { + return false; + } + } + + /// Stops listening to the serial port. + /// true if it succeeds, false if it fails. + public bool Disconnect() + { + ThreadRunState = ThreadRunStates.Stop; + var state = Close(); + return state; + } + + /// Writes a parameter to the serial port. + /// The buffer to write. + public void Write(byte[] buffer) + { + try + { + if (IsOpen()) + { + lock (_serialReadWriteLock) + { + _serialPort.Write(buffer, 0, buffer.Length); + } + } + } + catch + { + } + } + + /// Retrieves the possible baud rates for the currently selected serial port. + /// true if it succeeds, false if it fails. + public bool UpdateBaudRateCollection() + { + try + { + _currentSerialSettings.UpdateBaudRateCollection(0); + Close(); + _serialPort = new SerialPort(_currentSerialSettings.PortName); + if (Open()) + { + var fieldInfo = _serialPort.BaseStream.GetType() + .GetField("commProp", BindingFlags.Instance | BindingFlags.NonPublic); + if (fieldInfo != null) + { + object p = fieldInfo.GetValue(_serialPort.BaseStream); + var fieldInfoValue = p.GetType() + .GetField("dwSettableBaud", + BindingFlags.Instance | BindingFlags.NonPublic | + BindingFlags.Public); + if (fieldInfoValue != null) + { + var dwSettableBaud = (Int32) fieldInfoValue.GetValue(p); + Close(); + _currentSerialSettings.UpdateBaudRateCollection(dwSettableBaud); + } + } + } + } + catch + { + return false; + } + return true; + } + + + public void UpdatePortCollection() + { + _currentSerialSettings.PortNameCollection = SerialPort.GetPortNames(); + } + + /// Reads the serial buffer into the string buffer. + public byte[] Read() + { + var buffer = new byte[0]; + if (IsOpen()) + { + try + { + lock (_serialReadWriteLock) + { + var dataLength = _serialPort.BytesToRead; + buffer = new byte[dataLength]; + int nbrDataRead = _serialPort.Read(buffer, 0, dataLength); + if (nbrDataRead == 0) return new byte[0]; + } + } + catch + { } + } + return buffer; + } + + /// Gets the bytes in buffer. + /// Bytes in buffer + public int BytesInBuffer() + { + return IsOpen()? _serialPort.BytesToRead:0; + } + + /// Kills this object. + public void Kill() + { + // Signal thread to stop + ThreadRunState = ThreadRunStates.Abort; + + //Wait for thread to die + Join(1200); + if (_queueThread.IsAlive) _queueThread.Abort(); + + // Releasing serial port + if (IsOpen()) Close(); + if (_serialPort != null) + { + _serialPort.Dispose(); + _serialPort = null; + } + + } + + /// Joins the thread. + /// The milliseconds timeout. + /// true if it succeeds, false if it fails. + public bool Join(int millisecondsTimeout) + { + if (_queueThread.IsAlive == false) return true; + return _queueThread.Join(TimeSpan.FromMilliseconds(millisecondsTimeout)); + } + + // Dispose + protected override void Dispose(bool disposing) + { + if (disposing) + { + Kill(); + } + base.Dispose(disposing); + } + + #endregion + } +} \ No newline at end of file diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/StringUtils.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/StringUtils.cs new file mode 100644 index 0000000..38730c1 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/StringUtils.cs @@ -0,0 +1,40 @@ +#region CmdMessenger - MIT - (c) 2013 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2013 - Thijs Elenbaas +*/ +#endregion + +using System.Text; + +namespace CommandMessenger +{ + /// String utilities. + public class StringUtils + { + /// Convert string from one codepage to another. + /// The string. + /// input encoding codepage. + /// output encoding codepage. + /// the encoded string. + static public string ConvertEncoding(string input, Encoding fromEncoding, Encoding toEncoding) + { + var byteArray = fromEncoding.GetBytes(input); + var asciiArray = Encoding.Convert(fromEncoding, toEncoding, byteArray); + var finalString = toEncoding.GetString(asciiArray); + return finalString; + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/StructSerializer.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/StructSerializer.cs new file mode 100644 index 0000000..0a21995 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/StructSerializer.cs @@ -0,0 +1,53 @@ +#region CmdMessenger - MIT - (c) 2013 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2013 - Thijs Elenbaas +*/ +#endregion + +using System.Runtime.InteropServices; + +namespace CommandMessenger +{ + /// Helper object to convert structures to byte arrays and vice versa. + class StructSerializer + { + /// Convert an object to a byte array. + /// The object. + /// The byte array. + public static byte[] ObjectToByteArray(object obj) + { + var length = Marshal.SizeOf(obj); + var byteArray = new byte[length]; + var arrayPointer = Marshal.AllocHGlobal(length); + Marshal.StructureToPtr(obj, arrayPointer, true); + Marshal.Copy(arrayPointer, byteArray, 0, length); + Marshal.FreeHGlobal(arrayPointer); + return byteArray; + } + + /// Convert an byte array to an object. + /// The bytearray. + /// [in,out] The object. + public static void ByteArrayToObject(byte[] bytearray, ref object obj) + { + var length = Marshal.SizeOf(obj); + var arrayPointer = Marshal.AllocHGlobal(length); + Marshal.Copy(bytearray, 0, arrayPointer, length); + obj = Marshal.PtrToStructure(arrayPointer, obj.GetType()); + Marshal.FreeHGlobal(arrayPointer); + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/TimeUtils.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/TimeUtils.cs new file mode 100644 index 0000000..81e43a4 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/TimeUtils.cs @@ -0,0 +1,49 @@ +#region CmdMessenger - MIT - (c) 2013 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2013 - Thijs Elenbaas +*/ +#endregion + +using System; + +namespace CommandMessenger +{ + /// Class to get a timestamp + public static class TimeUtils + { + static public DateTime Jan1St1970 = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); // 1 January 1970 + + /// Gets the milliseconds since 1 Jan 1970. + /// The milliseconds since 1 Jan 1970. + public static long Millis { get { return (long)((DateTime.Now.ToUniversalTime() - Jan1St1970).TotalMilliseconds); } } + + /// Gets the seconds since 1 Jan 1970. + /// The seconds since 1 Jan 1970. + public static long Seconds { get { return (long)((DateTime.Now.ToUniversalTime() - Jan1St1970).TotalSeconds); } } + + // Returns if it has been more than interval (in ms) ago. Used for periodic actions + public static bool HasExpired(ref long prevTime, long interval) + { + var millis = Millis; + if (millis - prevTime > interval) + { + prevTime = millis; + return true; + } + return false; + } + } +} \ No newline at end of file diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/TimedAction.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/TimedAction.cs new file mode 100644 index 0000000..7df232d --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/TimedAction.cs @@ -0,0 +1,161 @@ +#region CmdMessenger - MIT - (c) 2013 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2013 - Thijs Elenbaas +*/ +#endregion + +using System; +using System.Threading; +using System.Timers; +using Timer = System.Timers.Timer; + +namespace CommandMessenger +{ + /// + /// Starts a recurring action with fixed interval + /// If still running at next call, the action is skipped + /// + public class TimedAction : DisposableObject + { + /// Thread state. + private class ThreadState + { + public volatile bool IsRunning; + } + + + private readonly Action _action; // The action to execute + private readonly Timer _actionTimer; // The action timer + private readonly ThreadState _threadState; // State of the thread + + /// Returns whether this object is running. + /// true if this object is running, false if not. + public bool IsRunning + { + get { return _threadState.IsRunning; } + } + + /// Constructor. + /// Dispose stack to add itself to + /// The execution interval. + /// The action to execute. + public TimedAction(DisposeStack disposeStack, double interval, Action action) + { + disposeStack.Push(this); + _action = action; + _threadState = new ThreadState {IsRunning = false}; + + + _actionTimer = new Timer(interval) {Enabled = false, SynchronizingObject = null}; + _actionTimer.Elapsed += OnActionTimer; + } + + + /// Finaliser. + ~TimedAction() + { + // Stop elapsed event handler + StopAndWait(); + _actionTimer.Elapsed -= OnActionTimer; + // Wait until last action has been executed or timeout + } + + // On timer event run non-blocking action + + /// Executes the non-blocking action timer action. + /// Ignored. + /// Ignored. + private void OnActionTimer(object source, ElapsedEventArgs e) + { + // Start background thread, but only if not yet running + if (!_threadState.IsRunning) + { + RunNonBlockingAction(_action); + } + } + + // Execute the action if not already running + + /// Executes the non blocking action operation. + /// The action. + private void RunNonBlockingAction(Action action) + { + // Additional (non-blocking) test on _threadIsRunning + // Request the lock for running background thread + if (Monitor.TryEnter(_threadState)) + { + try + { + if (_actionTimer.Enabled) + { + action(); + } + } + catch (NullReferenceException e) + { + Console.WriteLine("{0} Caught exception while running ActionBackground #1.", e); + } + finally + { + // Ensure that the lock is released. + _threadState.IsRunning = false; + Monitor.Exit(_threadState); + } + return; + } + // Exit because Action is already running + return; + } + + /// Start timed actions. + public void Start() + { + // Start interval events + _actionTimer.Enabled = true; + } + + /// Stop timed actions. + public void Stop() + { + // Halt new interval events + _actionTimer.Enabled = false; + } + + /// Stop timed actions and wait until running function has finished. + public void StopAndWait() + { + // Halt new interval events + _actionTimer.Enabled = false; + while (_threadState.IsRunning) + { + } + } + + // Dispose + /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + /// true if resources should be disposed, false if not. + protected override void Dispose(bool disposing) + { + if (disposing) + { + _actionTimer.Elapsed -= OnActionTimer; + } + base.Dispose(disposing); + } + + + } +} \ No newline at end of file diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/TransportLayer/ITransport.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/TransportLayer/ITransport.cs new file mode 100644 index 0000000..1bc2adc --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/TransportLayer/ITransport.cs @@ -0,0 +1,37 @@ +#region CmdMessenger - MIT - (c) 2013 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2013 - Thijs Elenbaas +*/ +#endregion + +using System; +namespace CommandMessenger.TransportLayer +{ + /// Interface for transport layer. + public interface ITransport: IDisposable + { + int BytesInBuffer(); + byte[] Read(); + void Poll(); + bool Connect(); + bool Disconnect(); + bool IsConnected(); + void StartPolling(); + void StopPolling(); + void Write(byte[] buffer); + event EventHandler NewDataReceived; + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/TransportLayer/Logger.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/TransportLayer/Logger.cs new file mode 100644 index 0000000..b72a727 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessenger/TransportLayer/Logger.cs @@ -0,0 +1,108 @@ +using System; +using System.IO; +using System.Text; + +namespace CommandMessenger.TransportLayer +{ + class Logger + { + public readonly Encoding StringEncoder = Encoding.GetEncoding("ISO-8859-1"); // The string encoder + private FileStream _fileStream; + private string _logFileName; + + + public Logger(string logFileName) + { + LogFileName = logFileName; + isEnabled = true; + isOpen = false; + } + + public Logger() + { + LogFileName = null; + } + + ~Logger() + { + Close(); + } + + public bool isEnabled { get; set; } + public bool isOpen { get; private set; } + + /// Gets or sets the log file name. + /// The logfile name . + public String LogFileName + { + get { return _logFileName; } + set + { + if (value != _logFileName && value != null) + { + _logFileName = value; + if (isOpen) { Open(); } + } + } + } + + public bool Open() + { + return Open(LogFileName); + } + + public bool Open(string logFileName) + { + LogFileName = logFileName; + if (isOpen) { + try + { + _fileStream.Close(); + } + catch (Exception) {} + isOpen = false; + } + + try + { + _fileStream = new FileStream(logFileName, FileMode.Create, FileAccess.ReadWrite); + + } + catch (Exception) + { + return false; + } + isOpen = true; + return true; + } + + public void Close() + { + if (isOpen) + { + try + { + _fileStream.Close(); + } + catch (Exception) { } + isOpen = false; + } + } + + public void Log(string logString) + { + if (isEnabled && isOpen) + { + byte[] writeBytes = StringEncoder.GetBytes(logString); + _fileStream.Write(writeBytes, 0, writeBytes.Length); + _fileStream.Flush(); + } + } + + + public void LogLine(string logString) + { + Log(logString + '\n'); + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/CommandMessengerTest.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/CommandMessengerTest.cs new file mode 100644 index 0000000..04f4f53 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/CommandMessengerTest.cs @@ -0,0 +1,157 @@ +// *** CommandMessengerTest *** + +// This project runs unit tests on several parts on the mayor parts of the CmdMessenger library +// Note that the primary function is not to serve as an example, so the code may be less documented +// and clean than the example projects. + + + +using System; +using System.IO.Ports; +using CommandMessenger; +using CommandMessenger.Serialport; +using CommandMessenger.TransportLayer; + +namespace CommandMessengerTests +{ + + public class CommandMessengerTest + { + private SetupConnection _setupConnection; + private Acknowledge _acknowledge; + private ClearTextData _clearTextData; + private BinaryTextData _binaryTextData; + private TransferSpeed _transferSpeed; + private MultipleArguments _multipleArguments; + + public CommandMessengerTest() + { + // Set up board & transport mode + var teensy31 = new systemSettings() + { + Description = @"Teensy 3.1", + MinReceiveSpeed = 2000000, // Bits per second + MinSendSpeed = 1250000, // Bits per second + MinDirectSendSpeed = 47500, // Bits per second + BoardType = BoardType.Bit32, // 32 architecture, needed from binary value conversion + sendBufferMaxLength = 512, // Maximum send buffer size + Transport = new SerialTransport + { + CurrentSerialSettings = new SerialSettings() + { + PortName = "COM15", // Can be different! + BaudRate = 115200, // Bits per second + DataBits = 8, // Data bits + Parity = Parity.None, // Bit parity + DtrEnable = false, // Some boards need to send this to enabled + }, + + } + }; + var arduinoNano = new systemSettings() + { + Description = @"Arduino Nano /w AT mega328", + MinReceiveSpeed = 84000, // Bits per second + MinSendSpeed = 90000, // Bits per second + MinDirectSendSpeed = 52000, // Bits per second + BoardType = BoardType.Bit16, // 32 architecture, needed from binary value conversion + sendBufferMaxLength = 60, // Maximum send buffer size + Transport = new SerialTransport + { + CurrentSerialSettings = new SerialSettings() + { + PortName = "COM6", // Can be different! + BaudRate = 115200, // Bits per second + DataBits = 8, // Data bits + Parity = Parity.None, // Bit parity + DtrEnable = false, // Some boards need to send this to enabled + }, + + } + }; + + // Set up Command enumerators + var command = DefineCommands(); + + // Initialize tests + InitializeTests(teensy31, command); + + // Open log file for testing + Common.OpenTestLogFile(@"TestLogFile.txt"); + + // Run tests + RunTests(); + + Common.CloseTestLogFile(); + } + + + private static Enumerator DefineCommands() + { + var command = new Enumerator(); + // Set up default commands + command.Add(new[] + { + "CommError", // Command reports serial port comm error (only works for some comm errors) + "kComment", // Command to sent comment in argument + }); + return command; + } + + private void InitializeTests(systemSettings systemSettings, Enumerator command) + { + _setupConnection = new SetupConnection(systemSettings, command); + _acknowledge = new Acknowledge(systemSettings, command); + _clearTextData = new ClearTextData(systemSettings, command); + _binaryTextData = new BinaryTextData(systemSettings, command); + _multipleArguments = new MultipleArguments(systemSettings, command); + _transferSpeed = new TransferSpeed(systemSettings, command); + + } + + private void RunTests() + { + // Test opening and closing connection + _setupConnection.RunTests(); + + // Test acknowledgment both on PC side and embedded side + _acknowledge.RunTests(); + + // Test all plain text formats + _clearTextData.RunTests(); + + // Test all binary formats + _binaryTextData.RunTests(); + + // Test sending multiple arguments + _multipleArguments.RunTests(); + + // Test large series for completeness (2-way) + // todo + + // Test speed + _transferSpeed.RunTests(); + + // Test load + // todo + + // Test Strategies + // todo + + // Summary of tests + Common.TestSummary(); + + // Exit application + exit(); + } + + + public void exit() + { + Console.WriteLine("Press any key to stop..."); + Console.ReadKey(); + Environment.Exit(0); + } + + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/CommandMessengerTests.csproj b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/CommandMessengerTests.csproj new file mode 100644 index 0000000..43b4dbc --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/CommandMessengerTests.csproj @@ -0,0 +1,76 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {B869057C-DAB3-4C19-958C-C89D3B1521EC} + Exe + Properties + CommandMessengerTests + CommandMessengerTests + v4.0 + Client + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {3CF8F8FC-6F5C-46F8-94DC-C2E4C505ECA4} + CommandMessenger + + + + + + \ No newline at end of file diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Common.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Common.cs new file mode 100644 index 0000000..d38d75f --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Common.cs @@ -0,0 +1,282 @@ +#region CmdMessenger - MIT - (c) 2014 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2014 - Thijs Elenbaas +*/ +#endregion +using System; +using CommandMessenger; +using CommandMessenger.Serialport; +using CommandMessenger.TransportLayer; +using System.IO; + + +namespace CommandMessengerTests +{ + public class Common + { + //private const string TestLogFile = "TestLogFile.txt"; + + private const string IdentTp = @" "; // indentation test part + private const string IdentTt = @" "; // indentation test + private const string IdentTs = @" "; // indentation test series + private const string IdentSt = @" "; + private const string IdentWn = @" "; + public static CmdMessenger CmdMessenger { get; set; } + public static SerialTransport SerialTransport { get; set; } + + private static bool _loggingCommands = false; + private static bool _testStarted = false; + private static bool _testSetStarted = false; + + private static string _testDescription = ""; + private static string _testSetDescription = ""; + + private static int _testElementFailCount = 0; + private static int _testElementPassCount = 0; + + + private static int _testFailCount = 0; + private static int _testPassCount = 0; + + private static int _testSetFailCount = 0; + private static int _testSetPassCount = 0; + + private static StreamWriter _streamWriter; + + + public static CmdMessenger Connect(systemSettings systemSettings) + { + CmdMessenger = new CmdMessenger(systemSettings.Transport, systemSettings.sendBufferMaxLength) {BoardType = systemSettings.BoardType}; + // Attach to NewLineReceived and NewLineSent for logging purposes + LogCommands(true); + + CmdMessenger.Connect(); + return CmdMessenger; + } + + public static void LogCommands(bool logCommands) + { + if (logCommands && !_loggingCommands) + { + CmdMessenger.NewLineReceived += NewLineReceived; + CmdMessenger.NewLineSent += NewLineSent; + _loggingCommands = true; + } + else if (!logCommands && _loggingCommands) + { + // ReSharper disable DelegateSubtraction + CmdMessenger.NewLineReceived -= NewLineReceived; + CmdMessenger.NewLineSent -= NewLineSent; + _loggingCommands = false; + // ReSharper restore DelegateSubtraction + } + } + + public static void OpenTestLogFile(string testLogFile) + { + _streamWriter = new StreamWriter(testLogFile); + } + + + public static void CloseTestLogFile() + { + _streamWriter.Close(); + _streamWriter = null; + } + + public static void Disconnect() + { + LogCommands(false); + CmdMessenger.Disconnect(); + CmdMessenger.Dispose(); + } + + + // Remove beeps + public static string Silence(string input) + { + var output = input.Replace('\x0007', ' '); + return output; + } + + public static void StartTestSet(string testSetDescription) + { + if (_testSetStarted) + { + EndTestSet(); + } + _testSetDescription = testSetDescription; + WriteLine(IdentTs + "*************************************"); + WriteLine(IdentTs + "*** Start test-set " + _testSetDescription + " ****"); + WriteLine(IdentTs + "*************************************"); + WriteLine(); + _testFailCount = 0; + _testPassCount = 0; + _testSetStarted = true; + } + + + public static void EndTestSet() + { + WriteLine(IdentTs + "*************************************"); + WriteLine(IdentTs + "*** End test-set " + _testSetDescription + " ****"); + WriteLine(IdentTs + "*************************************"); + WriteLine(); + WriteLine(IdentTs + "Tests passed: " + _testPassCount); + WriteLine(IdentTs + "Tests failed: " + _testFailCount); + WriteLine(); + if (_testFailCount > 0) + { + _testSetFailCount++; + } + else + { + _testSetPassCount++; + } + _testSetStarted = false; + + } + + public static void StartTest(string testDescription) + { + if (_testStarted) + { + EndTest(); + } + _testDescription = testDescription; + WriteLine(IdentTt + "*** Start test " + _testDescription + " ****"); + WriteLine(); + _testElementPassCount = 0; + _testElementFailCount = 0; + _testStarted = true; + } + + public static void EndTest() + { + WriteLine(IdentTt + "*** End test " + _testDescription + " ****"); + WriteLine(); + if (_testElementPassCount + _testElementFailCount == 0) + { + WriteLine(IdentTt + "No tests done"); + } + else + { + if (_testElementFailCount > 0) + { + _testFailCount++; + WriteLine(IdentTt + "Test failed" ); + } + else + { + _testPassCount++; + WriteLine(IdentTt + "Test passed"); + } + if (_testElementPassCount + _testElementFailCount > 1) + { + WriteLine(IdentTt + "Test parts passed: " + _testElementPassCount); + WriteLine(IdentTt + "Test parts failed: " + _testElementFailCount); + } + WriteLine(); + } + + _testStarted = false; + + if (_streamWriter != null) { _streamWriter.Flush(); } + } + + + public static void TestSummary() + { + WriteLine(IdentTs + "*** Test Summary ****"); + WriteLine(); + + if (_testSetPassCount > 0 && _testSetFailCount > 0) + { + WriteLine(IdentTs + "Some test sets failed!! "); + } + else if (_testSetPassCount > 0 && _testSetFailCount == 0) + { + WriteLine(IdentTs + "All test sets passed!! "); + } + else if (_testSetPassCount == 0 && _testSetFailCount > 0) + { + WriteLine(IdentTs + "All test sets failed!! "); + } if (_testSetPassCount == 0 && _testSetFailCount == 0) + { + WriteLine(IdentTs + "No tests done!! "); + } + + WriteLine(IdentTs + "Test sets passed: " + _testSetPassCount); + WriteLine(IdentTs + "Test sets failed: " + _testSetFailCount); + + if (_streamWriter != null) { _streamWriter.Flush(); } + } + + public static void TestOk(string resultDescription) + { + WriteLine(IdentTp + "OK: " + resultDescription); + _testElementPassCount++; + } + + public static void TestNotOk(string resultDescription) + { + WriteLine(IdentTp + "Not OK: " + resultDescription); + _testElementFailCount++; + } + + public static void NewLineReceived(object sender, NewLineEvent.NewLineArgs e) + { + var message = e.Command.CommandString(); + //var message = CmdMessenger.CurrentReceivedLine; + WriteLine(IdentSt + "Received > " + Silence(message)); + } + + public static void NewLineSent(object sender, NewLineEvent.NewLineArgs e) + { + //// Log data to text box + var message = e.Command.CommandString(); + WriteLine(IdentSt + "Sent > " + Silence(message)); + } + + public static void OnUnknownCommand(ReceivedCommand arguments) + { + // In response to unknown commands and corrupt messages + WriteLine(IdentWn + "Warn > Command without attached callback received"); + } + + public static void WriteLine() + { + WriteLine(""); + } + + public static void WriteLine(string message) + { + Console.WriteLine(message); + + if (_streamWriter!=null) { + _streamWriter.WriteLine(message); + } + } + + public static void Write(string message) + { + Console.Write(message); + if (_streamWriter!=null) { + _streamWriter.Write(message); + } + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Enumerator.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Enumerator.cs new file mode 100644 index 0000000..28277b1 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Enumerator.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace CommandMessengerTests +{ + public class Enumerator + { + readonly Dictionary _enumTable; + private int _enumCounter; + public Enumerator() + { + _enumTable = new Dictionary(); + _enumCounter = 0; + } + + public void Add(string enumDescriptor) + { + _enumTable.Add(enumDescriptor, _enumCounter++); + } + + public void Add(string[] enumDescriptors) + { + foreach (var enumDescriptor in enumDescriptors) + { + Add(enumDescriptor); + } + } + + public int this[string enumDescriptor] + { + get + { + if (_enumTable.ContainsKey(enumDescriptor)) + { + return _enumTable[enumDescriptor]; + } + else + { + throw new ArgumentException("This enum does not exist"); + } + } + set { _enumTable[enumDescriptor] = value; } + } + + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Program.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Program.cs new file mode 100644 index 0000000..ca0b1a8 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Program.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CommandMessengerTests +{ + class Program + { + static void Main(string[] args) + { + new CommandMessengerTest(); + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Properties/AssemblyInfo.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..c805dc9 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("CommandMessengerTests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Philips Healthcare")] +[assembly: AssemblyProduct("CommandMessengerTests")] +[assembly: AssemblyCopyright("Copyright © Philips Healthcare 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("3e948731-3f90-4c91-8e5b-574879664de1")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Tests/Acknowledge.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Tests/Acknowledge.cs new file mode 100644 index 0000000..d02acb7 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Tests/Acknowledge.cs @@ -0,0 +1,173 @@ +using System; +using CommandMessenger; + +namespace CommandMessengerTests +{ + public class Acknowledge + { + private CmdMessenger _cmdMessenger; + readonly Enumerator _command; + private bool _acknowledgementByEmbeddedFinished; + private readonly systemSettings _systemSettings; + + + public Acknowledge(systemSettings systemSettings, Enumerator command) + { + _systemSettings = systemSettings; + _command = command; + DefineCommands(); + } + + // ------------------ Command Callbacks ------------------------- + private void DefineCommands() + { + _command.Add(new[] + { + "AskUsIfReady", // Command asking other side to check if we acknowledge + "YouAreReady" // Command to send to other side to tell them we received their acknowledgment + }); + } + + private void AttachCommandCallBacks() + { + _cmdMessenger.Attach(_command["AreYouReady"], OnAreYouReadyCommand); + _cmdMessenger.Attach(_command["YouAreReady"], OnYouAreReadyCommand); + } + + + // ------------------ Command Callbacks ------------------------- + + private void OnAreYouReadyCommand(ReceivedCommand arguments) + { + // In response to AreYouReady ping. We send an ACK acknowledgment to say that we are ready + _cmdMessenger.SendCommand(new SendCommand(_command["Ack"], "We are ready")); + } + + private void OnYouAreReadyCommand(ReceivedCommand arguments) + { + // in response to YouAreReady message + TestSendCommandWithAcknowledgementByArduinoFinished(arguments); + } + + // ------------------ Test functions ------------------------- + + public void RunTests() + { + // Test opening and closing connection + Common.StartTestSet("Waiting for acknowledgments"); + SetUpConnection(); + // Test acknowledgments + TestSendCommandWithAcknowledgement(); + TestSendCommandWithAcknowledgementByArduino(); + WaitForAcknowledgementByEmbeddedFinished(); + + TestSendCommandWithAcknowledgementAfterQueued(); + + CloseConnection(); + Common.EndTestSet(); + } + + public void SetUpConnection() + { + try + { + _cmdMessenger = Common.Connect(_systemSettings); + AttachCommandCallBacks(); + } + catch (Exception) + { + } + if (!_systemSettings.Transport.IsConnected()) + { + } + } + + public void CloseConnection() + { + try + { + Common.Disconnect(); + } + catch (Exception) + { + } + } + + // Test: Send a test command with acknowledgment needed + public void TestSendCommandWithAcknowledgement() + { + Common.StartTest("Test sending command and receiving acknowledgment"); + var receivedCommand = _cmdMessenger.SendCommand(new SendCommand(_command["AreYouReady"], _command["Ack"], 1000)) ; + if (receivedCommand.Ok) + { + Common.TestOk("Acknowledgment for command AreYouReady"); + } + else + { + Common.TestNotOk("No acknowledgment for command AreYouReady"); + } + Common.EndTest(); + } + + + public void TestSendCommandWithAcknowledgementAfterQueued() + { + Common.StartTest("Test sending command and receiving acknowledgment after larger queue"); + + // Quickly sent a bunch of commands, that will be combined in a command string + for (var i = 0; i < 100; i++) + { + _cmdMessenger.QueueCommand(new SendCommand(_command["AreYouReady"])); + } + + // Now wait for an acknowledge, terminating the command string + var receivedCommand = _cmdMessenger.SendCommand(new SendCommand(_command["AreYouReady"], _command["Ack"], 1000)) ; + if (receivedCommand.Ok) + { + Common.TestOk("Acknowledgment for command AreYouReady"); + } + else + { + Common.TestNotOk("No acknowledgment for command AreYouReady"); + } + Common.EndTest(); + } + + public void TestSendCommandWithAcknowledgementByArduino() + { + Common.StartTest("TestSendCommandWithAcknowledgementByArduino"); + //SendCommandAskUsIfReady(); + _acknowledgementByEmbeddedFinished = false; + _cmdMessenger.SendCommand(new SendCommand(_command["AskUsIfReady"])); + + // We will exit here, but the test has just begun: + // - Next the arduino will call us with AreYouReady command which will trigger OnAreYouReadyCommand() + // - After this the Command TestAckSendCommandArduinoFinish will be called by Arduino with results + } + + public void TestSendCommandWithAcknowledgementByArduinoFinished(ReceivedCommand command) + { + var result = command.ReadBoolArg(); + if (!result) + { + Common.TestNotOk("Incorrect response"); + } + _acknowledgementByEmbeddedFinished = true; + } + + public void WaitForAcknowledgementByEmbeddedFinished() + { + for (var i = 0; i < 10; i++) + { + if (_acknowledgementByEmbeddedFinished) + { + Common.TestOk("Received acknowledge from processor"); + return; + } + System.Threading.Thread.Sleep(1000); + } + Common.TestNotOk("Received no acknowledge from processor"); + } + + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Tests/BinaryTextData.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Tests/BinaryTextData.cs new file mode 100644 index 0000000..1d50200 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Tests/BinaryTextData.cs @@ -0,0 +1,329 @@ +using System; +using CommandMessenger; + + +namespace CommandMessengerTests +{ + public class BinaryTextData + { + private CmdMessenger _cmdMessenger; + readonly Enumerator _command; + private readonly systemSettings _systemSettings; + + public BinaryTextData(systemSettings systemSettings, Enumerator command) + { + _systemSettings = systemSettings; + _command = command; + DefineCommands(); + } + + + // ------------------ Command Callbacks ------------------------- + private void DefineCommands() + { + } + + private void AttachCommandCallBacks() + { + } + + // ------------------ Test functions ------------------------- + + public void RunTests() + { + Common.StartTestSet("Clear binary data"); + SetUpConnection(); + TestSendBoolData(); + TestSendEscStringData(); + TestSendBinInt16Data(); + TestSendBinInt32Data(); + TestSendBinFloatData(); + TestSendBinDoubleData(); + CloseConnection(); + Common.EndTestSet(); + } + + public void SetUpConnection() + { + _cmdMessenger = Common.Connect(_systemSettings); + AttachCommandCallBacks(); + } + + public void CloseConnection() + { + Common.Disconnect(); + } + + public void TestSendBoolData() + { + Common.StartTest("Ping-pong of random binary bool values"); + // Try a lot of random numbers + for (var i = 0; i < 100; i++) + { + ValuePingPongBinBool(Random.RandomizeBool()); + } + Common.EndTest(); + } + + public void TestSendBinInt16Data() + { + Common.StartTest("Ping-pong of random binary Int16 values"); + // Try a lot of random numbers + for (var i = 0; i < 100; i++) + { + ValuePingPongBinInt16(Random.RandomizeInt16(Int16.MinValue, Int16.MaxValue), 0); + } + Common.EndTest(); + } + + public void TestSendBinInt32Data() + { + Common.StartTest("Ping-pong of random binary Int32 values"); + // Try a lot of random numbers + for (var i = 0; i < 100; i++) + { + ValuePingPongBinInt32(Random.RandomizeInt32(Int32.MinValue, Int32.MaxValue), 0); + } + Common.EndTest(); + } + + private void TestSendBinFloatData() + { + Common.StartTest("Ping-pong of handpicked binary float values"); + + // Try some typical numbers + ValuePingPongBinFloat(0.0F) ; + ValuePingPongBinFloat(1.0F); + ValuePingPongBinFloat(15.0F); + ValuePingPongBinFloat(65535.0F); + + ValuePingPongBinFloat(0.00390625F); + ValuePingPongBinFloat(0.00000000023283064365386962890625F); + Common.EndTest(); + + + //Craft difficult floating point values, using all special characters. + //These should all be handled correctly by escaping + + Common.StartTest("Ping-pong of floating point values, using all special characters"); + for (int a = 0; a < 5; a++) + { + for (int b = 0; b < 5; b++) + { + for (int c = 0; c < 5; c++) + { + for (int d = 0; d < 5; d++) + { + var charA = IntToSpecialChar(a); + var charB = IntToSpecialChar(b); + var charC = IntToSpecialChar(c); + var charD = IntToSpecialChar(d); + ValuePingPongBinFloat(CreateFloat(new[] { charA, charB, charC, charD })); + } + } + } + } + Common.EndTest(); + + Common.StartTest("Ping-pong of random binary float values"); + // Try a lot of random numbers + for (int i = 0; i < 1000; i++) + { + ValuePingPongBinFloat(Random.RandomizeFloat(-float.MaxValue, float.MaxValue)); + } + Common.EndTest(); + } + + public void TestSendBinDoubleData() + { + var range = (_systemSettings.BoardType == BoardType.Bit32) ? double.MaxValue : float.MaxValue; + var stepsize = range / 100; + Common.StartTest("Ping-pong of increasing binary double values"); + // Try a lot of random numbers + for (var i = 0; i < 100; i++) + { + ValuePingPongBinDouble(i * stepsize); + } + Common.EndTest(); + Common.StartTest("Ping-pong of random binary double values"); + for (var i = 0; i < 100; i++) + { + // Bigger values than this go wrong, due to truncation + ValuePingPongBinDouble(Random.RandomizeDouble(-range, range)); + } + Common.EndTest(); + } + + private void TestSendEscStringData() + { + Common.StartTest("Echo strings"); + ValuePingPongEscString("abcdefghijklmnopqrstuvwxyz"); // No special characters, but escaped + ValuePingPongEscString("abcde,fghijklmnopqrs,tuvwxyz"); // escaped parameter separators + ValuePingPongEscString("abcde,fghijklmnopqrs,tuvwxyz,"); // escaped parameter separators at end + ValuePingPongEscString("abc,defghij/klmnop//qr;stuvwxyz/"); // escaped escape char at end + ValuePingPongEscString("abc,defghij/klmnop//qr;stuvwxyz//"); // double escaped escape char at end + Common.EndTest(); + } + + private void ValuePingPongBinBool(bool value) + { + var pingCommand = new SendCommand(_command["ValuePing"], _command["ValuePong"], 1000); + pingCommand.AddArgument((Int16)DataType.BBool); + pingCommand.AddBinArgument(value); + var pongCommand = _cmdMessenger.SendCommand(pingCommand); + + if (!pongCommand.Ok) + { + Common.TestNotOk("No response on ValuePing command"); + return; + } + + var result = pongCommand.ReadBinBoolArg(); + if (result == value) + Common.TestOk("Value as expected"); + else + Common.TestNotOk("unexpected value received: " + result + " instead of " + value); + } + + private void ValuePingPongBinInt16(Int16 value, Int16 accuracy) + { + var pingCommand = new SendCommand(_command["ValuePing"], _command["ValuePong"], 1000); + pingCommand.AddArgument((Int16)DataType.BInt16); + pingCommand.AddBinArgument(value); + var pongCommand = _cmdMessenger.SendCommand(pingCommand); + + if (!pongCommand.Ok) Common.TestNotOk("No response on ValuePing command"); + + var result = pongCommand.ReadBinInt16Arg(); + + var difference = Math.Abs(result - value); + if (difference <= accuracy) + Common.TestOk("Value as expected"); + else + Common.TestNotOk("unexpected value received: " + result + " instead of " + value); + + } + + private void ValuePingPongBinInt32(Int32 value, Int32 accuracy) + { + var pingCommand = new SendCommand(_command["ValuePing"], _command["ValuePong"], 1000); + pingCommand.AddArgument((Int16)DataType.BInt32); + pingCommand.AddBinArgument((Int32)value); + var pongCommand = _cmdMessenger.SendCommand(pingCommand); + + if (!pongCommand.Ok) + { + Common.TestNotOk("No response on ValuePing command"); + return; + } + + var result = pongCommand.ReadBinInt32Arg(); + + var difference = Math.Abs(result - value); + if (difference <= accuracy) + Common.TestOk("Value as expected"); + else + Common.TestNotOk("unexpected value received: " + result + " instead of " + value); + } + + private void ValuePingPongBinFloat(float value) + { + const float accuracy = float.Epsilon; + var pingCommand = new SendCommand(_command["ValuePing"], _command["ValuePong"], 1000); + pingCommand.AddArgument((Int16)DataType.BFloat); + pingCommand.AddBinArgument(value); + var pongCommand = _cmdMessenger.SendCommand(pingCommand); + + if (!pongCommand.Ok) + { + Common.TestNotOk("No response on ValuePing command"); + return; + } + + var result = pongCommand.ReadBinFloatArg(); + + var difference = Math.Abs(result - value); + if (difference <= accuracy) + Common.TestOk("Value as expected"); + else + Common.TestNotOk("unexpected value received: " + result + " instead of " + value); + } + + private void ValuePingPongBinDouble(double value) + { + + var pingCommand = new SendCommand(_command["ValuePing"], _command["ValuePong"], 1000); + pingCommand.AddArgument((Int16)DataType.BDouble); + pingCommand.AddBinArgument(value); + var pongCommand = _cmdMessenger.SendCommand(pingCommand); + + if (!pongCommand.Ok) + { + Common.TestNotOk("No response on ValuePing command"); + return; + } + + var result = pongCommand.ReadBinDoubleArg(); + + var difference = Math.Abs(result - value); + + // + // For 16bit, because of double-float-float-double casting a small error is introduced + var accuracy = (_systemSettings.BoardType == BoardType.Bit32) ? double.Epsilon : Math.Abs(value * 1e-6); + + if (difference <= accuracy) + Common.TestOk("Value as expected"); + else + Common.TestNotOk("unexpected value received: " + result + " instead of " + value); + } + + private void ValuePingPongEscString(string value) + { + var pingCommand = new SendCommand(_command["ValuePing"], _command["ValuePong"], 1000); + pingCommand.AddArgument((int)DataType.EscString); + pingCommand.AddBinArgument(value); // Adding a string as binary command will escape it + var pongCommand = _cmdMessenger.SendCommand(pingCommand); + + if (!pongCommand.Ok) + { + Common.TestNotOk("No response on ValuePing command"); + return; + } + + var result = pongCommand.ReadBinStringArg(); + if (value == result) + { + Common.TestOk("Value as expected"); + } + else + { + Common.TestNotOk("unexpected value received: " + result + " instead of " + value); + } + } + + // Utility functions + private char IntToSpecialChar(int i) + { + switch (i) + { + case 0: + return ';'; // End of line + case 1: + return ','; // End of parameter + case 3: + return '/'; // Escaping next char + case 4: + return '\0'; // End of byte array + default: + return 'a'; // Normal character + + } + } + + float CreateFloat(char[] chars) + { + var bytes = BinaryConverter.CharsToBytes(chars); + return BitConverter.ToSingle(bytes, 0); + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Tests/ClearTextData.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Tests/ClearTextData.cs new file mode 100644 index 0000000..857ddfa --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Tests/ClearTextData.cs @@ -0,0 +1,316 @@ +using System; +using CommandMessenger; +using CommandMessenger.TransportLayer; + +namespace CommandMessengerTests +{ + + enum DataType : int + { + Bool, + Int16, + Int32, + Float, + FloatSci, + Double, + DoubleSci, + Char, + String, + BBool, + BInt16, + BInt32, + BFloat, + BDouble, + BChar, + EscString, + + }; + + public class ClearTextData + { + private CmdMessenger _cmdMessenger; + readonly Enumerator _command; + private systemSettings _systemSettings; + + public ClearTextData(systemSettings systemSettings, Enumerator command) + { + _systemSettings = systemSettings; + _command = command; + DefineCommands(); + } + + + // ------------------ Command Callbacks ------------------------- + private void DefineCommands() + { + _command.Add(new[] + { + "ValuePing" , // Send value + "ValuePong" , // Receive value + }); + } + + private void AttachCommandCallBacks() + { + } + + // ------------------ Test functions ------------------------- + + public void RunTests() + { + Common.StartTestSet("Clear text data"); + SetUpConnection(); + TestSendBoolData(); + TestSendInt16Data(); + TestSendInt32Data(); + TestSendFloatData(); + TestSendFloatSciData(); + TestSendDoubleSciData(); + CloseConnection(); + Common.EndTestSet(); + } + + public void SetUpConnection() + { + _cmdMessenger = Common.Connect(_systemSettings); + AttachCommandCallBacks(); + } + + public void CloseConnection() + { + Common.Disconnect(); + + } + + public void TestSendBoolData() + { + Common.StartTest("Ping-pong of random plain-text bool values"); + // Try a lot of random numbers + for (var i = 0; i < 100; i++) + { + ValuePingPongBool(Random.RandomizeBool()); + } + Common.EndTest(); + } + + public void TestSendInt16Data() + { + Common.StartTest("Ping-pong of random Int16 values"); + // Try a lot of random numbers + for (var i = 0; i < 100; i++) + { + ValuePingPongInt16(Random.RandomizeInt16(Int16.MinValue, Int16.MaxValue), 0); + } + Common.EndTest(); + } + + public void TestSendInt32Data() + { + Common.StartTest("Ping-pong of random Int32 values"); + // Try a lot of random numbers + for (var i = 0; i < 100; i++) + { + ValuePingPongInt32(Random.RandomizeInt32(Int32.MinValue, Int32.MaxValue), 0); + } + Common.EndTest(); + } + + public void TestSendFloatData() + { + // UInt32.MaxValue is the maximum range of the normal print float implementation + const float stepsize = (float)UInt32.MaxValue / 100; + Common.StartTest("Ping-pong of increasing float values"); + // Try a lot of random numbers + for (var i = 0; i < 100; i++) + { + // Bigger values than this go wrong, due to truncation + ValuePingPongFloat(i * stepsize ); + } + Common.EndTest(); + Common.StartTest("Ping-pong of random float values"); + for (var i = 0; i < 100; i++) + { + // Bigger values than this go wrong, due to truncation + ValuePingPongFloat(Random.RandomizeFloat(-UInt32.MaxValue, UInt32.MaxValue)); + } + Common.EndTest(); + } + + public void TestSendFloatSciData() + { + const float stepsize = (float)float.MaxValue/100; + Common.StartTest("Ping-pong of increasing float values, returned in scientific format"); + // Try a lot of random numbers + for (var i = 0; i < 100; i++) + { + // Bigger values than this go wrong, due to truncation + ValuePingPongFloatSci(i * stepsize, (float)0.05); + } + Common.EndTest(); + Common.StartTest("Ping-pong of random float values, returned in scientific format"); + for (var i = 0; i < 100; i++) + { + ValuePingPongFloatSci(Random.RandomizeFloat(-float.MaxValue, float.MaxValue), 0.05f); + } + Common.EndTest(); + } + + public void TestSendDoubleSciData() + { + var range = (_systemSettings.BoardType==BoardType.Bit32)?double.MaxValue:float.MaxValue; + var stepsize = range/100; + Common.StartTest("Ping-pong of increasing double values, returned in scientific format"); + // Try a lot of random numbers + for (var i = 0; i < 100; i++) + { + ValuePingPongDoubleSci(i * stepsize, 0.05f); + } + Common.EndTest(); + Common.StartTest("Ping-pong of random double values, returned in scientific format"); + for (var i = 0; i < 100; i++) + { + // Bigger values than this go wrong, due to truncation + ValuePingPongDoubleSci(Random.RandomizeDouble(-range, range), 0.05f); + } + Common.EndTest(); + } + + private void ValuePingPongInt16(Int16 value, Int16 accuracy) + { + var pingCommand = new SendCommand(_command["ValuePing"], _command["ValuePong"], 1000); + pingCommand.AddArgument((Int16)DataType.Int16); + pingCommand.AddArgument(value); + var pongCommand = _cmdMessenger.SendCommand(pingCommand); + + if (!pongCommand.Ok) Common.TestNotOk("No response on ValuePing command"); + + var result = pongCommand.ReadInt16Arg(); + + var difference = Math.Abs(result - value); + + if (difference <= accuracy) + Common.TestOk("Value as expected"); + else + Common.TestNotOk("unexpected value received: " + result + " instead of " + value); + } + + private void ValuePingPongInt32(Int32 value, Int32 accuracy) + { + var pingCommand = new SendCommand(_command["ValuePing"], _command["ValuePong"], 1000); + pingCommand.AddArgument((Int16)DataType.Int32); + pingCommand.AddArgument((Int32)value); + var pongCommand = _cmdMessenger.SendCommand(pingCommand); + + if (!pongCommand.Ok) + { + Common.TestNotOk("No response on ValuePing command"); + return; + } + + var result = pongCommand.ReadInt32Arg(); + + var difference = Math.Abs(result - value); + if (difference <= accuracy) + Common.TestOk("Value as expected"); + else + Common.TestNotOk("unexpected value received: " + result + " instead of " + value); + } + + private void ValuePingPongBool(bool value) + { + var pingCommand = new SendCommand(_command["ValuePing"], _command["ValuePong"], 1000); + pingCommand.AddArgument((Int16)DataType.Bool); + pingCommand.AddArgument(value); + var pongCommand = _cmdMessenger.SendCommand(pingCommand); + + if (!pongCommand.Ok) + { + Common.TestNotOk("No response on ValuePing command"); + return; + } + + var result = pongCommand.ReadBoolArg(); + + if (result == value) + Common.TestOk("Value as expected"); + else + Common.TestNotOk("unexpected value received: " + result + " instead of " + value); + } + + private void ValuePingPongFloat(float value) + { + var pingCommand = new SendCommand(_command["ValuePing"], _command["ValuePong"], 1000); + pingCommand.AddArgument((Int16)DataType.Float); + pingCommand.AddArgument(value); + var pongCommand = _cmdMessenger.SendCommand(pingCommand); + + if (!pongCommand.Ok) + { + Common.TestNotOk("No response on ValuePing command"); + return; + } + + var result = pongCommand.ReadFloatArg(); + var difference = Math.Abs(result - value); + + var accuracy = Math.Abs(value * 2e-7); + + if (difference <= accuracy) + Common.TestOk("Value as expected"); + else + Common.TestNotOk("unexpected value received: " + result + " instead of " + value); + } + + private void ValuePingPongFloatSci(float value, float accuracy) + { + var pingCommand = new SendCommand(_command["ValuePing"], _command["ValuePong"], 1000); + pingCommand.AddArgument((Int16)DataType.FloatSci); + pingCommand.AddArgument(value); + var pongCommand = _cmdMessenger.SendCommand(pingCommand); + + if (!pongCommand.Ok) + { + Common.TestNotOk("No response on ValuePing command"); + return; + } + + var result = pongCommand.ReadFloatArg(); + + var difference = RelativeError(value, result); + if (difference <= accuracy) + Common.TestOk("Value as expected"); + else + Common.TestNotOk("unexpected value received: " + result + " instead of " + value); + } + + private void ValuePingPongDoubleSci(double value, double accuracy) + { + var pingCommand = new SendCommand(_command["ValuePing"], _command["ValuePong"], 1000); + pingCommand.AddArgument((Int16)DataType.DoubleSci); + pingCommand.AddArgument(value); + var pongCommand = _cmdMessenger.SendCommand(pingCommand); + + if (!pongCommand.Ok) + { + Common.TestNotOk("No response on ValuePing command"); + return; + } + + var result = pongCommand.ReadDoubleArg(); + + var difference = RelativeError(value, result); + + if (difference <= accuracy) + Common.TestOk("Value as expected"); + else + Common.TestNotOk("unexpected value received: " + result + " instead of " + value); + } + + private static double RelativeError(double value, double result) + { + var difference = (Math.Abs(result) > double.Epsilon) ? Math.Abs(result - value) / result : Math.Abs(result - value); + if (Double.IsNaN(difference)) difference = 0; + return difference; + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Tests/DoubleConverter.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Tests/DoubleConverter.cs new file mode 100644 index 0000000..83f83f4 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Tests/DoubleConverter.cs @@ -0,0 +1,218 @@ +using System; +using System.Globalization; + +namespace CommandMessengerTests +{ + /// + /// A class to allow the conversion of doubles to string representations of + /// their exact decimal values. The implementation aims for readability over + /// efficiency. + /// + public class DoubleConverter + { + /// + /// Converts the given double to a string representation of its + /// exact decimal value. + /// + /// The double to convert. + /// A string representation of the double's exact decimal value. + public static string ToExactString(double d) + { + if (double.IsPositiveInfinity(d)) + return "+Infinity"; + if (double.IsNegativeInfinity(d)) + return "-Infinity"; + if (double.IsNaN(d)) + return "NaN"; + + // Translate the double into sign, exponent and mantissa. + long bits = BitConverter.DoubleToInt64Bits(d); + // Note that the shift is sign-extended, hence the test against -1 not 1 + bool negative = (bits < 0); + int exponent = (int)((bits >> 52) & 0x7ffL); + long mantissa = bits & 0xfffffffffffffL; + + // Subnormal numbers; exponent is effectively one higher, + // but there's no extra normalisation bit in the mantissa + if (exponent == 0) + { + exponent++; + } + // Normal numbers; leave exponent as it is but add extra + // bit to the front of the mantissa + else + { + mantissa = mantissa | (1L << 52); + } + + // Bias the exponent. It's actually biased by 1023, but we're + // treating the mantissa as m.0 rather than 0.m, so we need + // to subtract another 52 from it. + exponent -= 1075; + + if (mantissa == 0) + { + return "0"; + } + + /* Normalize */ + while ((mantissa & 1) == 0) + { /* i.e., Mantissa is even */ + mantissa >>= 1; + exponent++; + } + + /// Construct a new decimal expansion with the mantissa + ArbitraryDecimal ad = new ArbitraryDecimal(mantissa); + + // If the exponent is less than 0, we need to repeatedly + // divide by 2 - which is the equivalent of multiplying + // by 5 and dividing by 10. + if (exponent < 0) + { + for (int i = 0; i < -exponent; i++) + ad.MultiplyBy(5); + ad.Shift(-exponent); + } + // Otherwise, we need to repeatedly multiply by 2 + else + { + for (int i = 0; i < exponent; i++) + ad.MultiplyBy(2); + } + + // Finally, return the string with an appropriate sign + if (negative) + return "-" + ad.ToString(); + else + return ad.ToString(); + } + + /// Private class used for manipulating + class ArbitraryDecimal + { + /// Digits in the decimal expansion, one byte per digit + byte[] digits; + /// + /// How many digits are *after* the decimal point + /// + int decimalPoint = 0; + + /// + /// Constructs an arbitrary decimal expansion from the given long. + /// The long must not be negative. + /// + internal ArbitraryDecimal(long x) + { + string tmp = x.ToString(CultureInfo.InvariantCulture); + digits = new byte[tmp.Length]; + for (int i = 0; i < tmp.Length; i++) + digits[i] = (byte)(tmp[i] - '0'); + Normalize(); + } + + /// + /// Multiplies the current expansion by the given amount, which should + /// only be 2 or 5. + /// + internal void MultiplyBy(int amount) + { + byte[] result = new byte[digits.Length + 1]; + for (int i = digits.Length - 1; i >= 0; i--) + { + int resultDigit = digits[i] * amount + result[i + 1]; + result[i] = (byte)(resultDigit / 10); + result[i + 1] = (byte)(resultDigit % 10); + } + if (result[0] != 0) + { + digits = result; + } + else + { + Array.Copy(result, 1, digits, 0, digits.Length); + } + Normalize(); + } + + /// + /// Shifts the decimal point; a negative value makes + /// the decimal expansion bigger (as fewer digits come after the + /// decimal place) and a positive value makes the decimal + /// expansion smaller. + /// + internal void Shift(int amount) + { + decimalPoint += amount; + } + + /// + /// Removes leading/trailing zeroes from the expansion. + /// + internal void Normalize() + { + int first; + for (first = 0; first < digits.Length; first++) + if (digits[first] != 0) + break; + int last; + for (last = digits.Length - 1; last >= 0; last--) + if (digits[last] != 0) + break; + + if (first == 0 && last == digits.Length - 1) + return; + + byte[] tmp = new byte[last - first + 1]; + for (int i = 0; i < tmp.Length; i++) + tmp[i] = digits[i + first]; + + decimalPoint -= digits.Length - (last + 1); + digits = tmp; + } + + /// + /// Converts the value to a proper decimal string representation. + /// + public override String ToString() + { + char[] digitString = new char[digits.Length]; + for (int i = 0; i < digits.Length; i++) + digitString[i] = (char)(digits[i] + '0'); + + // Simplest case - nothing after the decimal point, + // and last real digit is non-zero, eg value=35 + if (decimalPoint == 0) + { + return new string(digitString); + } + + // Fairly simple case - nothing after the decimal + // point, but some 0s to add, eg value=350 + if (decimalPoint < 0) + { + return new string(digitString) + + new string('0', -decimalPoint); + } + + // Nothing before the decimal point, eg 0.035 + if (decimalPoint >= digitString.Length) + { + return "0." + + new string('0', (decimalPoint - digitString.Length)) + + new string(digitString); + } + + // Most complicated case - part of the string comes + // before the decimal point, part comes after it, + // eg 3.5 + return new string(digitString, 0, + digitString.Length - decimalPoint) + + "." + + new string(digitString, + digitString.Length - decimalPoint, + decimalPoint); + } + } + } +} \ No newline at end of file diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Tests/MultipleArguments.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Tests/MultipleArguments.cs new file mode 100644 index 0000000..ecdf719 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Tests/MultipleArguments.cs @@ -0,0 +1,122 @@ +using System; +using CommandMessenger; + + +namespace CommandMessengerTests +{ + public class MultipleArguments + { + private CmdMessenger _cmdMessenger; + readonly Enumerator _command; + private readonly systemSettings _systemSettings; + private readonly System.Random _randomNumber; + + public MultipleArguments(systemSettings systemSettings, Enumerator command) + { + _systemSettings = systemSettings; + _command = command; + DefineCommands(); + _randomNumber = new System.Random(DateTime.Now.Millisecond); + } + + // ------------------ Command Callbacks ------------------------- + private void DefineCommands() + { + _command.Add(new[] + { + "MultiValuePing" , // Send value + "MultiValuePong" , // Receive value + }); + } + + private void AttachCommandCallBacks() + { + } + + // ------------------ Test functions ------------------------- + + public void RunTests() + { + + Common.StartTestSet("Clear binary data"); + SetUpConnection(); + TestSendMultipleValues(); + CloseConnection(); + Common.EndTestSet(); + } + + public void SetUpConnection() + { + _cmdMessenger = Common.Connect(_systemSettings); + AttachCommandCallBacks(); + } + + public void CloseConnection() + { + Common.Disconnect(); + } + + public void TestSendMultipleValues() + { + Common.StartTest("Ping-pong of a command with handpicked binary int16, int32, and double parameters"); + //_cmdMessenger.LogSendCommandsEnabled = true; + ValuePingPongBinInt16Int32Double( + -11776, + -1279916419, + -2.7844819605867E+38 + ); + //_cmdMessenger.LogSendCommandsEnabled = false; + Common.EndTest(); + + Common.StartTest("Ping-pong of a command with random binary int16, int32, and double parameters"); + for (var i = 0; i < 1000; i++) + { + // Bigger values than this go wrong, due to truncation + ValuePingPongBinInt16Int32Double( + Random.RandomizeInt16(Int16.MinValue, Int16.MaxValue), + Random.RandomizeInt32(Int32.MinValue, Int32.MaxValue), + Random.RandomizeDouble( + (_systemSettings.BoardType == BoardType.Bit32 ? double.MinValue : float.MinValue), + (_systemSettings.BoardType == BoardType.Bit32 ? double.MaxValue : float.MaxValue) + )); + } + Common.EndTest(); + } + + private void ValuePingPongBinInt16Int32Double(Int16 int16Value, Int32 int32Value, double doubleValue) + { + var pingCommand = new SendCommand(_command["MultiValuePing"], _command["MultiValuePong"], 1000); + pingCommand.AddBinArgument(int16Value); + pingCommand.AddBinArgument(int32Value); + pingCommand.AddBinArgument(doubleValue); + var pongCommand = _cmdMessenger.SendCommand(pingCommand); + + if (!pongCommand.Ok) + { + Common.TestNotOk("No response on ValuePing command"); + return; + } + var int16Result = pongCommand.ReadBinInt16Arg(); + var int32Result = pongCommand.ReadBinInt32Arg(); + var doubleResult = pongCommand.ReadBinDoubleArg(); + + if (int16Result == int16Value) + Common.TestOk("1st parameter value, Int16, as expected: " + int16Result); + else + Common.TestNotOk("unexpected 1st parameter value received: " + int16Result + " instead of " + int16Value); + + if (int32Result == int32Value) + Common.TestOk("2nd parameter value, Int32, as expected: " + int32Result); + else + Common.TestNotOk("unexpected 2nd parameter value, Int32, received: " + int32Result + " instead of " + int32Value); + + // For 16bit, because of double-float-float-double casting a small error is introduced + var accuracy = (_systemSettings.BoardType == BoardType.Bit32) ? double.Epsilon : Math.Abs(doubleValue * 1e-6); + var difference = Math.Abs(doubleResult - doubleValue); + if (difference <= accuracy) + Common.TestOk("3rd parameter value, Double, as expected: " + doubleResult); + else + Common.TestNotOk("unexpected 3rd parameter value, Double, received: " + doubleResult + " instead of " + doubleValue); + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Tests/Random.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Tests/Random.cs new file mode 100644 index 0000000..0a4e81b --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Tests/Random.cs @@ -0,0 +1,36 @@ +using System; + +namespace CommandMessengerTests +{ + public class Random + { + private static readonly System.Random RandomNumber = new System.Random(); + + public static float RandomizeFloat(float min, float max) + { + return (float)(min + ((max - min) *RandomNumber.NextDouble())); + } + + public static double RandomizeDouble(double min, double max) + { + var random = RandomNumber.NextDouble(); + return (double)(min + max * random - min * random); + } + + + public static Int16 RandomizeInt16(Int16 min, Int16 max) + { + return (Int16)(min + (((Double)max - (Double)min) *RandomNumber.NextDouble())); + } + + public static Int32 RandomizeInt32(Int32 min, Int32 max) + { + return (Int32)(min + (((Double)max - (Double)min) *RandomNumber.NextDouble())); + } + + public static bool RandomizeBool() + { + return (RandomNumber.NextDouble() > 0.5); + } + } +} \ No newline at end of file diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Tests/SetupConnection.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Tests/SetupConnection.cs new file mode 100644 index 0000000..b856550 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Tests/SetupConnection.cs @@ -0,0 +1,118 @@ +using System; +using CommandMessenger; +using CommandMessenger.TransportLayer; + +namespace CommandMessengerTests +{ + + public class SetupConnection + { + readonly Enumerator _command; + private readonly systemSettings _systemSettings; + private CmdMessenger _cmdMessenger; + + public SetupConnection(systemSettings systemSettings, Enumerator command) + { + _systemSettings = systemSettings; + _command = command; + DefineCommands(); + } + + public void DefineCommands() + { + _command.Add(new[] + { + "Ack", // acknowledgment that cmd was received + "AreYouReady", // Command asking if other side is ready + "Err" // Reports incorrectly formatted cmd, or cmd not recognized + } ); + } + + private void AttachCommandCallBacks() + { + _cmdMessenger.Attach(Common.OnUnknownCommand); + } + + public void RunTests() + { + // Test opening and closing connection + Common.StartTestSet("Opening connections"); + TestOpenConnection(); + TestSendCommand(); + TestCloseConnection(); + Common.EndTestSet(); + } + + public void TestOpenConnection() + { + Common.StartTest("Test opening connection"); + try + { + _cmdMessenger = Common.Connect(_systemSettings); + AttachCommandCallBacks(); + } + catch (Exception) + { + Common.TestNotOk("Exception during opening connection"); + Common.EndTest(); + return; + } + + if (_systemSettings.Transport.IsConnected()) + { + Common.TestOk("No issues during opening connection"); + } + else + { + Common.TestNotOk("Not open after trying to open connection"); + } + + Common.EndTest(); + } + + public void TestCloseConnection() + { + Common.StartTest("Test closing connection"); + try + { + Common.Disconnect(); + } + catch (Exception) + { + Common.TestNotOk("Exception during opening connection"); + Common.EndTest(); + return; + } + Console.WriteLine("No issues during closing of connection"); + + if (_systemSettings.Transport.IsConnected()) + { + Common.TestNotOk("Transport connection still open after disconnection"); + } + else + { + Common.TestOk("Transport connection not open anymore after disconnection"); + } + + Common.EndTest(); + } + + // Test: send a command without acknowledgment needed + public void TestSendCommand() + { + Common.StartTest("Test sending command"); + try + { + _cmdMessenger.SendCommand(new SendCommand(_command["AreYouReady"])); + } + catch (Exception) + { + Common.TestNotOk("Exception during sending of command"); + Common.EndTest(); + return; + } + Common.TestOk("No issues during sending command"); + Common.EndTest(); + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Tests/TransferSpeed.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Tests/TransferSpeed.cs new file mode 100644 index 0000000..47b342f --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/Tests/TransferSpeed.cs @@ -0,0 +1,339 @@ +using System; +using System.Threading; +using CommandMessenger; + +namespace CommandMessengerTests +{ + public class TransferSpeed + { + private CmdMessenger _cmdMessenger; + readonly Enumerator _command; + public bool RunLoop { get; set; } + private int _receivedItemsCount; // Counter of number of command items received + private int _receivedBytesCount; // Counter of number of command bytes received + long _beginTime; // Start time, 1st item of sequence received + long _endTime; // End time, last item of sequence received + private volatile bool _receiveSeriesFinished; // Indicates if plain text float series has been fully received + private volatile bool _sendSeriesFinished; + private readonly systemSettings _systemSettings; + const int SeriesLength = 10000; // Number of items we like to receive from the Arduino + private const float SeriesBase = 1.00001F; // Base of values to return: SeriesBase * (0..SeriesLength-1) + private float _minimalBps; + public TransferSpeed(systemSettings systemSettings, Enumerator command) + { + _systemSettings = systemSettings; + _command = command; + DefineCommands(); + } + + // ------------------ Command Callbacks ------------------------- + private void DefineCommands() + { + _command.Add(new[] + { + "RequestReset" , // Command Request reset + "RequestResetAcknowledge" , // Command to acknowledge reset + + "RequestSeries" , // Command Request to send series in plain text + "ReceiveSeries" , // Command to send an item in plain text + "DoneReceiveSeries", // Command to tell that sending series in plain text is done + + "PrepareSendSeries", // Command to tell other side to prepare for receiving a series of text float commands + "SendSeries" , // Command to send a series of text float commands + "AckSendSeries" // Command to acknowledge the send series of text float commands + + }); + } + + // ------------------ Command Callbacks ------------------------- + private void AttachCommandCallBacks() + { + _cmdMessenger.Attach(_command["RequestResetAcknowledge"], OnRequestResetAcknowledge); + _cmdMessenger.Attach(_command["ReceiveSeries"], OnReceiveSeries); + _cmdMessenger.Attach(_command["DoneReceiveSeries"], OnDoneReceiveSeries); + _cmdMessenger.Attach(_command["AckSendSeries"], OnAckSendSeries); + } + + + // ------------------ Test functions ------------------------- + + public void RunTests() + { + // Open Connection + Common.StartTestSet("Benchmarking transfer speeds"); + SetUpConnection(); + + // Stop logging commands as this may degrade performance + Common.LogCommands(false); + + // Test acknowledgments + //*** Benchmark 1: receive series of float data + SetupReceiveSeries(); + + //*** Benchmark 2: queued send series of float data + SetupQueuedSendSeries(); + + //*** Benchmark 3: direct send series of float data + DirectSendSeries(); + + // Start logging commands again + Common.LogCommands(true); + + // Close connection + CloseConnection(); + Common.EndTestSet(); + } + + public void SetUpConnection() + { + try + { + _cmdMessenger = Common.Connect(_systemSettings); + AttachCommandCallBacks(); + } + catch (Exception) + { + } + } + + public void CloseConnection() + { + try + { + Common.Disconnect(); + } + catch (Exception) + { + } + } + + private void WaitAndClear() + { + var requestResetCommand = new SendCommand(_command["RequestReset"], _command["RequestResetAcknowledge"], 1000); + var requestResetAcknowledge = _cmdMessenger.SendCommand(requestResetCommand, SendQueue.ClearQueue,ReceiveQueue.ClearQueue); + + Common.WriteLine(!requestResetAcknowledge.Ok ? "No Wait OK received" : "Wait received"); + // Wait another second to see if + Thread.Sleep(1000); + // Clear queues again to be very sure + _cmdMessenger.ClearReceiveQueue(); + _cmdMessenger.ClearSendQueue(); + } + + + // Called when a RequestResetAcknowledge comes in + private void OnRequestResetAcknowledge(ReceivedCommand receivedcommand) + { + // This function should not be called because OnRequestResetAcknowledge should + // be handled by the requestResetAcknowledge synchronous command in WaitAndClear() + // if it happens, we will do another WaitAndClear() and hope that works + WaitAndClear(); + } + + // *** Benchmark 1 *** + private void SetupReceiveSeries() + { + Common.StartTest("Calculating speed in receiving series of float data"); + + WaitAndClear(); + + _receiveSeriesFinished = false; + _receivedItemsCount = 0; + _receivedBytesCount = 0; + _minimalBps = _systemSettings.MinReceiveSpeed; + + // Send command requesting a series of 100 float values send in plain text form + var commandPlainText = new SendCommand(_command["RequestSeries"]); + commandPlainText.AddArgument(SeriesLength); + commandPlainText.AddArgument(SeriesBase); + + // Send command + _cmdMessenger.SendCommand(commandPlainText); + + // Now wait until all values have arrived + while (!_receiveSeriesFinished) + { + Thread.Sleep(10); + } + } + + // Callback function To receive the plain text float series from the Arduino + void OnReceiveSeries(ReceivedCommand arguments) + { + + if (_receivedItemsCount % (SeriesLength / 10) == 0) + Common.WriteLine(_receivedItemsCount+ " Received value: " + arguments.ReadFloatArg()); + if (_receivedItemsCount == 0) + { + // Received first value, start stopwatch + _beginTime = Millis; + } + + _receivedItemsCount++; + _receivedBytesCount += CountBytesInCommand(arguments, false); + + } + + private void OnDoneReceiveSeries(ReceivedCommand receivedcommand) + { + float bps = CalcTransferSpeed(); + + if (bps > _minimalBps) + { + Common.TestOk("Embedded system is receiving data as fast as expected. Measured: " + bps + " bps, expected " + _minimalBps); + } + else + { + Common.TestNotOk("Embedded system is receiving data not as fast as expected. Measured: " + bps + " bps, expected " + _minimalBps); + } + + + _receiveSeriesFinished = true; + + Common.EndTest(); + } + + private float CalcTransferSpeed() + { + Common.WriteLine("Benchmark results"); + // Received all values, stop stopwatch + _endTime = Millis; + var deltaTime = (_endTime - _beginTime); + Common.WriteLine( + deltaTime + + " milliseconds per " + + _receivedItemsCount + + " items = is " + + (float)deltaTime / (float)_receivedItemsCount + + " ms/item, " + + (float)1000 * _receivedItemsCount / (float)deltaTime + + " Hz" + ); + + float bps = (float)8 * 1000 * _receivedBytesCount / (float)deltaTime; + Common.WriteLine( + deltaTime + + " milliseconds per " + + _receivedItemsCount + + " bytes = is " + + (float)deltaTime / (float)_receivedBytesCount + + " ms/byte, " + + (float)1000 * _receivedBytesCount / (float)deltaTime + + " bytes/sec, " + + bps + + " bps" + ); + return bps; + } + + + // *** Benchmark 2 *** + // Setup queued send series + private void SetupQueuedSendSeries() + { + Common.StartTest("Calculating speed in sending queued series of float data"); + WaitAndClear(); + + _minimalBps = _systemSettings.MinSendSpeed; + _sendSeriesFinished = false; + var prepareSendSeries = new SendCommand(_command["PrepareSendSeries"]); + prepareSendSeries.AddArgument(SeriesLength); + _cmdMessenger.SendCommand(prepareSendSeries, SendQueue.WaitForEmptyQueue, ReceiveQueue.WaitForEmptyQueue); + + // Prepare + _receivedBytesCount = 0; + _cmdMessenger.PrintLfCr = true; + _beginTime = Millis; + + // Now queue all commands + for (var sendItemsCount = 0; sendItemsCount < SeriesLength; sendItemsCount++) + { + var sendSeries = new SendCommand(_command["SendSeries"]); + sendSeries.AddArgument(sendItemsCount * SeriesBase); + + _receivedBytesCount += CountBytesInCommand(sendSeries, _cmdMessenger.PrintLfCr); + + _cmdMessenger.QueueCommand(sendSeries); + if (sendItemsCount % (SeriesLength / 10) == 0) + Common.WriteLine("Send value: " + sendItemsCount * SeriesBase); + } + + // Now wait until receiving party acknowledges that values have arrived + while (!_sendSeriesFinished) + { + Thread.Sleep(10); + } + } + + private void OnAckSendSeries(ReceivedCommand receivedcommand) + { + float bps = CalcTransferSpeed(); + + if (bps > _minimalBps) + { + Common.TestOk("Embedded system is receiving data as fast as expected. Measured: " + bps + " bps, expected " + _minimalBps); + } + else + { + Common.TestNotOk("Embedded system is receiving data not as fast as expected. Measured: " + bps + " bps, expected " + _minimalBps); + } + + + Common.EndTest(); + _sendSeriesFinished = true; + } + + // *** Benchmark 3 *** + private void DirectSendSeries() + { + Common.StartTest("Calculating speed in individually sending a series of float data"); + WaitAndClear(); + + _minimalBps = _systemSettings.MinDirectSendSpeed; + _sendSeriesFinished = false; + + var prepareSendSeries = new SendCommand(_command["PrepareSendSeries"]); + prepareSendSeries.AddArgument(SeriesLength); + // We need to to send the prepareSendSeries by bypassing the queue or it might be sent after the directly send commands later on + _cmdMessenger.SendCommand(prepareSendSeries, SendQueue.WaitForEmptyQueue, ReceiveQueue.WaitForEmptyQueue,UseQueue.BypassQueue); + + // Prepare + _receivedBytesCount = 0; + _cmdMessenger.PrintLfCr = true; + _beginTime = Millis; + + // Now send all commands individually and bypass the queue + for (var sendItemsCount = 0; sendItemsCount < SeriesLength; sendItemsCount++) + { + var sendSeries = new SendCommand(_command["SendSeries"]); + sendSeries.AddArgument(sendItemsCount * SeriesBase); + + _receivedBytesCount += CountBytesInCommand(sendSeries, _cmdMessenger.PrintLfCr); + + _cmdMessenger.SendCommand(sendSeries, SendQueue.Default, ReceiveQueue.Default, UseQueue.BypassQueue); + + if (sendItemsCount%(SeriesLength/10) == 0) + { + Common.WriteLine("Send value: " + sendItemsCount*SeriesBase); + } + } + _endTime = Millis; + // Now wait until receiving party acknowledges that values have arrived + while (!_sendSeriesFinished) + { + Thread.Sleep(10); + } + } + + // Tools + private static int CountBytesInCommand(Command command, bool printLfCr) + { + var bytes = command.CommandString().Length; // Command + command separator + if (printLfCr) bytes += Environment.NewLine.Length; // Add bytes for carriage return ('\r') and /or a newline ('\n') + return bytes; + } + + // Return Milliseconds since 1970 + public static long Millis { get { return (long)((DateTime.Now.ToUniversalTime() - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalMilliseconds); } } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/TimedAction.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/TimedAction.cs new file mode 100644 index 0000000..7df232d --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/TimedAction.cs @@ -0,0 +1,161 @@ +#region CmdMessenger - MIT - (c) 2013 Thijs Elenbaas. +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Copyright 2013 - Thijs Elenbaas +*/ +#endregion + +using System; +using System.Threading; +using System.Timers; +using Timer = System.Timers.Timer; + +namespace CommandMessenger +{ + /// + /// Starts a recurring action with fixed interval + /// If still running at next call, the action is skipped + /// + public class TimedAction : DisposableObject + { + /// Thread state. + private class ThreadState + { + public volatile bool IsRunning; + } + + + private readonly Action _action; // The action to execute + private readonly Timer _actionTimer; // The action timer + private readonly ThreadState _threadState; // State of the thread + + /// Returns whether this object is running. + /// true if this object is running, false if not. + public bool IsRunning + { + get { return _threadState.IsRunning; } + } + + /// Constructor. + /// Dispose stack to add itself to + /// The execution interval. + /// The action to execute. + public TimedAction(DisposeStack disposeStack, double interval, Action action) + { + disposeStack.Push(this); + _action = action; + _threadState = new ThreadState {IsRunning = false}; + + + _actionTimer = new Timer(interval) {Enabled = false, SynchronizingObject = null}; + _actionTimer.Elapsed += OnActionTimer; + } + + + /// Finaliser. + ~TimedAction() + { + // Stop elapsed event handler + StopAndWait(); + _actionTimer.Elapsed -= OnActionTimer; + // Wait until last action has been executed or timeout + } + + // On timer event run non-blocking action + + /// Executes the non-blocking action timer action. + /// Ignored. + /// Ignored. + private void OnActionTimer(object source, ElapsedEventArgs e) + { + // Start background thread, but only if not yet running + if (!_threadState.IsRunning) + { + RunNonBlockingAction(_action); + } + } + + // Execute the action if not already running + + /// Executes the non blocking action operation. + /// The action. + private void RunNonBlockingAction(Action action) + { + // Additional (non-blocking) test on _threadIsRunning + // Request the lock for running background thread + if (Monitor.TryEnter(_threadState)) + { + try + { + if (_actionTimer.Enabled) + { + action(); + } + } + catch (NullReferenceException e) + { + Console.WriteLine("{0} Caught exception while running ActionBackground #1.", e); + } + finally + { + // Ensure that the lock is released. + _threadState.IsRunning = false; + Monitor.Exit(_threadState); + } + return; + } + // Exit because Action is already running + return; + } + + /// Start timed actions. + public void Start() + { + // Start interval events + _actionTimer.Enabled = true; + } + + /// Stop timed actions. + public void Stop() + { + // Halt new interval events + _actionTimer.Enabled = false; + } + + /// Stop timed actions and wait until running function has finished. + public void StopAndWait() + { + // Halt new interval events + _actionTimer.Enabled = false; + while (_threadState.IsRunning) + { + } + } + + // Dispose + /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + /// true if resources should be disposed, false if not. + protected override void Dispose(bool disposing) + { + if (disposing) + { + _actionTimer.Elapsed -= OnActionTimer; + } + base.Dispose(disposing); + } + + + } +} \ No newline at end of file diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/systemSettings.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/systemSettings.cs new file mode 100644 index 0000000..eaddbdc --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/CommandMessengerTests/systemSettings.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using CommandMessenger; +using CommandMessenger.TransportLayer; + +namespace CommandMessengerTests +{ + public class systemSettings + { + public String Description { get; set; } + public ITransport Transport { get; set; } + public float MinReceiveSpeed { get; set; } + public float MinSendSpeed { get; set; } + public float MinDirectSendSpeed { get; set; } + public BoardType BoardType { get; set; } + public int sendBufferMaxLength { get; set; } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/5-DataLogging.csproj b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/5-DataLogging.csproj new file mode 100644 index 0000000..799c02a --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/5-DataLogging.csproj @@ -0,0 +1,97 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {8CBED77C-78BF-453F-8733-97798A95916F} + WinExe + Properties + DataLogging + DataLogging + v4.0 + Client + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + ..\ZedGraph\ZedGraph.dll + + + + + Form + + + ChartForm.cs + + + + + + ChartForm.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + {3CF8F8FC-6F5C-46F8-94DC-C2E4C505ECA4} + CommandMessenger + + + + + \ No newline at end of file diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/ChartForm.Designer.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/ChartForm.Designer.cs new file mode 100644 index 0000000..62b94b7 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/ChartForm.Designer.cs @@ -0,0 +1,58 @@ +namespace DataLogging +{ + partial class ChartForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.chartControl = new ZedGraph.ZedGraphControl(); + this.SuspendLayout(); + // + // chartControl + // + this.chartControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.chartControl.IsAntiAlias = true; + this.chartControl.Location = new System.Drawing.Point(12, 12); + this.chartControl.Name = "chartControl"; + this.chartControl.ScrollGrace = 0D; + this.chartControl.ScrollMaxX = 0D; + this.chartControl.ScrollMaxY = 0D; + this.chartControl.ScrollMaxY2 = 0D; + this.chartControl.ScrollMinX = 0D; + this.chartControl.ScrollMinY = 0D; + this.chartControl.ScrollMinY2 = 0D; + this.chartControl.Size = new System.Drawing.Size(521, 442); + this.chartControl.TabIndex = 0; + // + // ChartForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(545, 466); + this.Controls.Add(this.chartControl); + this.Name = "ChartForm"; + this.Text = "Data Logging and Charting"; + this.ResumeLayout(false); + + } + + #endregion + + public ZedGraph.ZedGraphControl chartControl; + } +} + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/ChartForm.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/ChartForm.cs new file mode 100644 index 0000000..188622d --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/ChartForm.cs @@ -0,0 +1,100 @@ +using System; +using System.Drawing; +using System.Windows.Forms; +using CommandMessenger; +using ZedGraph; + +namespace DataLogging +{ + public partial class ChartForm : Form + { + // In a small C# application all code would typically end up in this class. + // For a cleaner, MVP-like setup I moved higher logic to Datalogging.cs, + + private readonly DataLogging _dataLogging; + private long _previousChartUpdate; + private IPointListEdit _analog1List; + private IPointListEdit _analog2List; + + public ChartForm() + { + InitializeComponent(); + _dataLogging = new DataLogging(); + _dataLogging.Setup(this); + } + + // ------------------ CHARTING ROUTINES --------------------- + + // Set up the chart + public void SetupChart() + { + // get a reference to the GraphPane + var myPane = chartControl.GraphPane; + + // Set the Titles + myPane.Title.Text = "Data logging using CmdMessenger"; + myPane.XAxis.Title.Text = "Time (s)"; + myPane.YAxis.Title.Text = "Voltage (v)"; + + // Create data arrays for rolling points + _analog1List = new RollingPointPairList(3000); + _analog2List = new RollingPointPairList(3000); + + // Create a smoothened red curve + LineItem myCurve = myPane.AddCurve("Analog 1", _analog1List, Color.Red, SymbolType.None); + myCurve.Line.IsSmooth = true; + myCurve.Line.SmoothTension = 0.2f; + + // Create a smoothened blue curve + LineItem myCurve2 = myPane.AddCurve("Analog 2", _analog2List, Color.Blue, SymbolType.None); + + myCurve2.Line.IsSmooth = true; + myCurve2.Line.SmoothTension = 0.2f; + // Tell ZedGraph to re-calculate the axes since the data have changed + chartControl.AxisChange(); + } + + // Update the graph with the data points + public void UpdateGraph(double time, double analog1, double analog2) + { + // set window width + const double windowWidth = 30.0; + + // Add data points to the circular lists + _analog1List.Add(time, analog1); + _analog2List.Add(time, analog2); + + // Because updating the chart is computationally expensive if + // there are many data points, we do this only every 100 ms, that is 10 Hz + if (!TimeUtils.HasExpired(ref _previousChartUpdate, 100)) return; + + ///Console.WriteLine("Update chart"); + + // get and update x-scale to scroll with data with an certain window + var xScale = chartControl.GraphPane.XAxis.Scale; + xScale.Max = time + xScale.MajorStep; + xScale.Min = xScale.Max - windowWidth; + + // Make sure the axes are rescaled to accommodate actual data + chartControl.AxisChange(); + + // Force a redraw + chartControl.Invalidate(); + } + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing) + { + _dataLogging.Exit(); + if (components != null) + components.Dispose(); + } + base.Dispose(disposing); + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/ChartForm.resources b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/ChartForm.resources new file mode 100644 index 0000000..6c05a97 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/ChartForm.resources Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/ChartForm.resx b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/ChartForm.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/ChartForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/DataLogging.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/DataLogging.cs new file mode 100644 index 0000000..0029609 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/DataLogging.cs @@ -0,0 +1,152 @@ +// *** DataLogging *** + +// This example expands the previous SendandReceiveArguments example. The PC will now send a start command to the Arduino, +// and wait for a response from the Arduino. The Arduino will start sending analog data which the PC will plot in a chart +// This example shows how to : +// - use in combination with WinForms +// - use in combination with ZedGraph + +using System; +using CommandMessenger; +using CommandMessenger.Serialport; +using CommandMessenger.TransportLayer; + +using System.Threading; +namespace DataLogging +{ + enum Command + { + Acknowledge, + Error, + StartLogging, + PlotDataPoint, + }; + + public class DataLogging + { + // This class (kind of) contains presentation logic, and domain model. + // ChartForm.cs contains the view components + private SerialTransport _serialTransport; + private CmdMessenger _cmdMessenger; + private ChartForm _chartForm; + + // ------------------ MAIN ---------------------- + + // Setup function + public void Setup(ChartForm chartForm) + { + + // getting the chart control on top of the chart form. + _chartForm = chartForm; + + // Set up chart + _chartForm.SetupChart(); + + // Create Serial Port object + // Note that for some boards (e.g. Sparkfun Pro Micro) DtrEnable may need to be true. + _serialTransport = new SerialTransport + { + CurrentSerialSettings = { PortName = "COM6", BaudRate = 115200, DtrEnable = false } // object initializer + }; + + // Initialize the command messenger with the Serial Port transport layer + _cmdMessenger = new CmdMessenger(_serialTransport) + { + BoardType = BoardType.Bit16 // Set if it is communicating with a 16- or 32-bit Arduino board + }; + + // Tell CmdMessenger to "Invoke" commands on the thread running the WinForms UI + _cmdMessenger.SetControlToInvokeOn(chartForm); + + // Set Received command strategy that removes commands that are older than 1 sec + _cmdMessenger.AddReceiveCommandStrategy(new StaleGeneralStrategy(1000)); + + // Attach the callbacks to the Command Messenger + AttachCommandCallBacks(); + + // Attach to NewLinesReceived for logging purposes + _cmdMessenger.NewLineReceived += NewLineReceived; + + // Attach to NewLineSent for logging purposes + _cmdMessenger.NewLineSent += NewLineSent; + + // Start listening + _cmdMessenger.Connect(); + + // Send command to start sending data + var command = new SendCommand((int)Command.StartLogging); + + // Send command + _cmdMessenger.SendCommand(command); + } + + + // Exit function + public void Exit() + { + // Stop listening + _cmdMessenger.Disconnect(); + + // Dispose Command Messenger + _cmdMessenger.Dispose(); + + // Dispose Serial Port object + _serialTransport.Dispose(); + } + + /// Attach command call backs. + private void AttachCommandCallBacks() + { + _cmdMessenger.Attach(OnUnknownCommand); + _cmdMessenger.Attach((int)Command.Acknowledge, OnAcknowledge); + _cmdMessenger.Attach((int)Command.Error, OnError); + _cmdMessenger.Attach((int)Command.PlotDataPoint, OnPlotDataPoint); + } + + // ------------------ CALLBACKS --------------------- + + // Called when a received command has no attached function. + // In a WinForm application, console output gets routed to the output panel of your IDE + void OnUnknownCommand(ReceivedCommand arguments) + { + Console.WriteLine(@"Command without attached callback received"); + } + + // Callback function that prints that the Arduino has acknowledged + void OnAcknowledge(ReceivedCommand arguments) + { + Console.WriteLine(@" Arduino is ready"); + } + + // Callback function that prints that the Arduino has experienced an error + void OnError(ReceivedCommand arguments) + { + Console.WriteLine(@"Arduino has experienced an error"); + } + + // Callback function that plots a data point for ADC 1 and ADC 2 + private void OnPlotDataPoint(ReceivedCommand arguments) + { + var time = arguments.ReadFloatArg(); + var analog1 = arguments.ReadFloatArg(); + var analog2 = arguments.ReadFloatArg(); + _chartForm.UpdateGraph(time, analog1, analog2); + } + + // Log received line to console + private void NewLineReceived(object sender, NewLineEvent.NewLineArgs e) + { + Console.WriteLine(@"Received > " + e.Command.CommandString()); + } + + // Log sent line to console + private void NewLineSent(object sender, NewLineEvent.NewLineArgs e) + { + Console.WriteLine(@"Sent > " + e.Command.CommandString()); + } + + + + + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/Program.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/Program.cs new file mode 100644 index 0000000..63ac9b5 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/Program.cs @@ -0,0 +1,20 @@ +using System; +using System.Windows.Forms; + +namespace DataLogging +{ + static class Program + { + /// + /// The main entry point for the application. + /// Note that the main code is n + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new ChartForm()); + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/Properties/AssemblyInfo.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..32d53ca --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("DataLogging")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] + +[assembly: AssemblyProduct("DataLogging")] +[assembly: AssemblyCopyright("Copyright © Thijs Elenbaas 2013,2014")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("7896e467-386e-471d-8856-518594d0588f")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/Properties/Resources.Designer.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/Properties/Resources.Designer.cs new file mode 100644 index 0000000..2569c98 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18052 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace DataLogging.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DataLogging.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/Properties/Resources.resources b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/Properties/Resources.resources new file mode 100644 index 0000000..6c05a97 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/Properties/Resources.resources Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/Properties/Resources.resx b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/Properties/Settings.Designer.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/Properties/Settings.Designer.cs new file mode 100644 index 0000000..68ed9a1 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18052 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace DataLogging.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/Properties/Settings.settings b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/DataLogging/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/Receive/1-Receive.csproj b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/Receive/1-Receive.csproj new file mode 100644 index 0000000..7f61922 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/Receive/1-Receive.csproj @@ -0,0 +1,64 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {C5545DBA-7364-4FD1-B061-9C5FA5C06141} + Exe + Properties + Receive + Receive + v4.0 + Client + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + {3CF8F8FC-6F5C-46F8-94DC-C2E4C505ECA4} + CommandMessenger + + + + + \ No newline at end of file diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/Receive/Program.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/Receive/Program.cs new file mode 100644 index 0000000..f715cc4 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/Receive/Program.cs @@ -0,0 +1,15 @@ +namespace Receive +{ + class Program + { + static void Main() + { + // mimics Arduino calling structure + var receive = new Receive {RunLoop = true}; + receive.Setup(); + while (receive.RunLoop) receive.Loop(); + receive.Exit(); + } + + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/Receive/Properties/AssemblyInfo.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/Receive/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..42b580d --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/Receive/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ArduinoReceive")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] + +[assembly: AssemblyProduct("ArduinoReceive")] +[assembly: AssemblyCopyright("Copyright © Thijs Elenbaas 2013,2014")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("c1610272-4b9d-445f-ac2c-7674ca40dbf2")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/Receive/Receive.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/Receive/Receive.cs new file mode 100644 index 0000000..1bf03f0 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/Receive/Receive.cs @@ -0,0 +1,94 @@ +// This 1st example will make the PC toggle the integrated led on the arduino board. +// It demonstrates how to: +// - Define commands +// - Set up a serial connection +// - Send a command with a parameter to the Arduino + + +using System; +using System.Threading; +using CommandMessenger; +using CommandMessenger.Serialport; +using CommandMessenger.TransportLayer; + +namespace Receive +{ + + // This is the list of recognized commands. These can be commands that can either be sent or received. + // In order to receive, attach a callback function to these events + // + // Default commands + // Note that commands work both directions: + // - All commands can be sent + // - Commands that have callbacks attached can be received + // + // This means that both sides should have an identical command list: + // one side can either send it or receive it (sometimes both) + + // Commands + enum Command + { + SetLed, // Command to request led to be set in specific state + }; + + public class Receive + { + public bool RunLoop { get; set; } + private SerialTransport _serialTransport; + private CmdMessenger _cmdMessenger; + private bool _ledState; + + // Setup function + public void Setup() + { + _ledState = false; + + // Create Serial Port object + _serialTransport = new SerialTransport(); + _serialTransport.CurrentSerialSettings.PortName = "COM6"; // Set com port + _serialTransport.CurrentSerialSettings.BaudRate = 115200; // Set baud rate + _serialTransport.CurrentSerialSettings.DtrEnable = false; // For some boards (e.g. Sparkfun Pro Micro) DtrEnable may need to be true. + + // Initialize the command messenger with the Serial Port transport layer + _cmdMessenger = new CmdMessenger(_serialTransport); + + // Tell CmdMessenger if it is communicating with a 16 or 32 bit Arduino board + _cmdMessenger.BoardType = BoardType.Bit16; + + // Attach the callbacks to the Command Messenger + AttachCommandCallBacks(); + + // Start listening + _cmdMessenger.Connect(); + } + + // Loop function + public void Loop() + { + // Create command + var command = new SendCommand((int)Command.SetLed,_ledState); + + // Send command + _cmdMessenger.SendCommand(command); + + Console.Write("Turning led "); + Console.WriteLine(_ledState?"on":"off"); + + // Wait for 1 second and repeat + Thread.Sleep(1000); + _ledState = !_ledState; // Toggle led state + } + + // Exit function + public void Exit() + { + // We will never exit the application + } + + /// Attach command call backs. + private void AttachCommandCallBacks() + { + // No callbacks are currently needed + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceive/2-SendAndReceive.csproj b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceive/2-SendAndReceive.csproj new file mode 100644 index 0000000..0b4cfa7 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceive/2-SendAndReceive.csproj @@ -0,0 +1,68 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {37286642-47EE-44D8-87D9-3CFAFC8D68BD} + Exe + Properties + SendAndReceive + SendAndReceive + v4.0 + Client + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\Bluetooth\InTheHand.Net.Personal.dll + + + + + + + + + + + + + + + + + {3CF8F8FC-6F5C-46F8-94DC-C2E4C505ECA4} + CommandMessenger + + + + + \ No newline at end of file diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceive/Program.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceive/Program.cs new file mode 100644 index 0000000..c4a34fa --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceive/Program.cs @@ -0,0 +1,18 @@ +namespace SendAndReceive +{ + using CommandMessenger; + class Program + { + static void Main() + { + + // mimics Arduino calling structure + var sendAndReceive = new SendAndReceive { RunLoop = true }; + ConsoleUtils.ConsoleClose += (o, i) => sendAndReceive.Exit(); + sendAndReceive.Setup(); + while (sendAndReceive.RunLoop) sendAndReceive.Loop(); + sendAndReceive.Exit(); + + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceive/Properties/AssemblyInfo.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceive/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..42b580d --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceive/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ArduinoReceive")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] + +[assembly: AssemblyProduct("ArduinoReceive")] +[assembly: AssemblyCopyright("Copyright © Thijs Elenbaas 2013,2014")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("c1610272-4b9d-445f-ac2c-7674ca40dbf2")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceive/SendAndReceive.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceive/SendAndReceive.cs new file mode 100644 index 0000000..8f6288d --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceive/SendAndReceive.cs @@ -0,0 +1,144 @@ +// *** SendandReceive *** + +// This example expands the previous Receive example. The Arduino will now send back a status. +// It adds a demonstration of how to: +// - Handle received commands that do not have a function attached +// - Receive a command with a parameter from the Arduino + +using System; +using System.Threading; +using CommandMessenger; +using CommandMessenger.Bluetooth; +using CommandMessenger.Serialport; + +namespace SendAndReceive +{ + // This is the list of recognized commands. These can be commands that can either be sent or received. + // In order to receive, attach a callback function to these events + enum Command + { + SetLed, + Status, + }; + + public class SendAndReceive + { + public bool RunLoop { get; set; } + private SerialTransport _serialTransport; + private BluetoothTransport _bluetoothTransport; + private CmdMessenger _cmdMessenger; + private bool _ledState; + private int _count; + + // Setup function + public void Setup() + { + _ledState = false; + + BluetoothInfo(); + + // Create Bluetooth transport object + _bluetoothTransport = new BluetoothTransport + { + //CurrentBluetoothDeviceInfo = BluetoothUtils.DeviceByAdress("98-D3-31-B0-FB-B5") + CurrentBluetoothDeviceInfo = BluetoothUtils.DeviceByAdress("20:13:07:26:10:08") + + }; + + // Create Serial Port transport object + // Note that for some boards (e.g. Sparkfun Pro Micro) DtrEnable may need to be true. + _serialTransport = new SerialTransport + { + CurrentSerialSettings = { PortName = "COM16", BaudRate = 9600, DtrEnable = false } // object initializer + }; + + // Initialize the command messenger with the Serial Port transport layer + _cmdMessenger = new CmdMessenger(_bluetoothTransport) + { + BoardType = BoardType.Bit16 // Set if it is communicating with a 16- or 32-bit Arduino board + }; + + // Tell CmdMessenger if it is communicating with a 16 or 32 bit Arduino board + + // Attach the callbacks to the Command Messenger + AttachCommandCallBacks(); + + // Start listening + _cmdMessenger.Connect(); + } + + private static void BluetoothInfo() + { + // Show adress of local primary bluetooth device + Console.WriteLine("Adress of local primary bluetooth device:"); + BluetoothUtils.PrintLocalAddress(); + Console.WriteLine(""); + + //Show all paired bluetooth devices + Console.WriteLine("All paired bluetooth devices:"); + BluetoothUtils.PrintPairedDevices(); + Console.WriteLine(""); + + // Show Virtual serial ports associated with Bluetooth devices + Console.WriteLine("Virtual serial ports associated with Bluetooth devices:"); + BluetoothUtils.PrintSerialPorts(); + Console.WriteLine(""); + } + + // Loop function + public void Loop() + { + _count++; + + // Create command + var command = new SendCommand((int)Command.SetLed,_ledState); + + // Send command + _cmdMessenger.SendCommand(command); + + // Wait for 1 second and repeat + Thread.Sleep(1000); + _ledState = !_ledState; // Toggle led state + + if (_count > 100) RunLoop = false; // Stop loop after 100 rounds + } + + // Exit function + public void Exit() + { + + if (_cmdMessenger != null) + { + // Stop listening + _cmdMessenger.Disconnect(); + // Dispose Command Messenger + _cmdMessenger.Dispose(); + } + + + // Dispose Serial Port object + if (_serialTransport != null) _serialTransport.Dispose(); + if (_bluetoothTransport != null) _bluetoothTransport.Dispose(); + } + + /// Attach command call backs. + private void AttachCommandCallBacks() + { + _cmdMessenger.Attach(OnUnknownCommand); + _cmdMessenger.Attach((int)Command.Status, OnStatus); + } + + /// Executes when an unknown command has been received. + void OnUnknownCommand(ReceivedCommand arguments) + { + Console.WriteLine("Command without attached callback received"); + } + + // Callback function that prints the Arduino status to the console + void OnStatus(ReceivedCommand arguments) + { + Console.Write("Arduino status: "); + Console.WriteLine(arguments.ReadStringArg()); + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceiveArguments/3-SendAndReceiveArguments.csproj b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceiveArguments/3-SendAndReceiveArguments.csproj new file mode 100644 index 0000000..a73b7cf --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceiveArguments/3-SendAndReceiveArguments.csproj @@ -0,0 +1,64 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {A1DBBE25-AD1A-4AA0-9CB4-5BD47B495178} + Exe + Properties + SendAndReceiveArguments + SendAndReceiveArguments + v4.0 + Client + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + {3CF8F8FC-6F5C-46F8-94DC-C2E4C505ECA4} + CommandMessenger + + + + + \ No newline at end of file diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceiveArguments/Program.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceiveArguments/Program.cs new file mode 100644 index 0000000..5233739 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceiveArguments/Program.cs @@ -0,0 +1,15 @@ +namespace SendAndReceiveArguments +{ + class Program + { + static void Main() + { + // mimics Arduino calling structure + var sendAndReceiveArguments = new SendAndReceiveArguments { RunLoop = true }; + sendAndReceiveArguments.Setup(); + while (sendAndReceiveArguments.RunLoop) sendAndReceiveArguments.Loop(); + sendAndReceiveArguments.Exit(); + } + + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceiveArguments/Properties/AssemblyInfo.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceiveArguments/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..bfb1a3b --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceiveArguments/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("SendAndReceiveArgument")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] + +[assembly: AssemblyProduct("SendAndReceiveArgument")] +[assembly: AssemblyCopyright("Copyright © Thijs Elenbaas 2013,2014")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("c1610272-4b9d-445f-ac2c-7674ca40dbf2")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceiveArguments/SendAndReceiveArguments.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceiveArguments/SendAndReceiveArguments.cs new file mode 100644 index 0000000..2d9708b --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceiveArguments/SendAndReceiveArguments.cs @@ -0,0 +1,166 @@ +// *** SendandReceive *** + +// This example expands the previous SendandReceive example. The PC will now send multiple float values +// and wait for a response from the Arduino. +// It adds a demonstration of how to: +// - Send multiple parameters, and wait for response +// - Receive multiple parameters +// - Add logging events on data that has been sent or received + +using System; +using CommandMessenger; +using CommandMessenger.Serialport; +using CommandMessenger.TransportLayer; + +namespace SendAndReceiveArguments +{ + // This is the list of recognized commands. These can be commands that can either be sent or received. + // In order to receive, attach a callback function to these events + enum Command + { + Acknowledge, + Error, + FloatAddition, + FloatAdditionResult, + }; + + public class SendAndReceiveArguments + { + public bool RunLoop { get; set; } + private SerialTransport _serialTransport; + private CmdMessenger _cmdMessenger; + + // ------------------ M A I N ---------------------- + + // Setup function + public void Setup() + { + // Create Serial Port object + // Note that for some boards (e.g. Sparkfun Pro Micro) DtrEnable may need to be true. + _serialTransport = new SerialTransport + { + CurrentSerialSettings = { PortName = "COM6", BaudRate = 115200, DtrEnable = false } // object initializer + }; + + // Initialize the command messenger with the Serial Port transport layer + _cmdMessenger = new CmdMessenger(_serialTransport) + { + BoardType = BoardType.Bit16 // Set if it is communicating with a 16- or 32-bit Arduino board + }; + + // Attach the callbacks to the Command Messenger + AttachCommandCallBacks(); + + // Attach to NewLinesReceived for logging purposes + _cmdMessenger.NewLineReceived += NewLineReceived; + + // Attach to NewLineSent for logging purposes + _cmdMessenger.NewLineSent += NewLineSent; + + // Start listening + _cmdMessenger.Connect(); + } + + // Loop function + public void Loop() + { + // Create command FloatAddition, which will wait for a return command FloatAdditionResult + var command = new SendCommand((int)Command.FloatAddition, (int)Command.FloatAdditionResult, 1000); + + // Add 2 float command arguments + var a = 3.14F; + var b = 2.71F; + command.AddArgument(a); + command.AddArgument(b); + + // Send command + var floatAdditionResultCommand = _cmdMessenger.SendCommand(command); + + // Check if received a (valid) response + if (floatAdditionResultCommand.Ok) + { + // Read returned argument + var sum = floatAdditionResultCommand.ReadFloatArg(); + var diff = floatAdditionResultCommand.ReadFloatArg(); + + // Compare with sum of sent values + var errorSum = sum - (a + b); + var errorDiff = diff - (a - b); + + Console.WriteLine("Received sum {0}, difference of {1}", sum, diff); + Console.WriteLine("with errors {0} and {1}, respectively", errorSum, errorDiff); + + if (errorDiff < 1e-6 && errorSum < 1e-6) + { + Console.WriteLine("Seems to be correct!"); + } + else + { + Console.WriteLine("Does not seem to be correct!"); + } + } + else + Console.WriteLine("No response!"); + + // Stop running loop + RunLoop = false; + } + + // Exit function + public void Exit() + { + // Stop listening + _cmdMessenger.Disconnect(); + + // Dispose Command Messenger + _cmdMessenger.Dispose(); + + // Dispose Serial Port object + _serialTransport.Dispose(); + + // Pause before stop + Console.WriteLine("Press any key to stop..."); + Console.ReadKey(); + } + + /// Attach command call backs. + private void AttachCommandCallBacks() + { + _cmdMessenger.Attach(OnUnknownCommand); + _cmdMessenger.Attach((int)Command.Acknowledge, OnAcknowledge); + _cmdMessenger.Attach((int)Command.Error, OnError); + } + + // ------------------ C A L L B A C K S --------------------- + + // Called when a received command has no attached function. + void OnUnknownCommand(ReceivedCommand arguments) + { + Console.WriteLine("Command without attached callback received"); + } + + // Callback function that prints that the Arduino has acknowledged + void OnAcknowledge(ReceivedCommand arguments) + { + Console.WriteLine(" Arduino is ready"); + } + + // Callback function that prints that the Arduino has experienced an error + void OnError(ReceivedCommand arguments) + { + Console.WriteLine(" Arduino has experienced an error"); + } + + // Log received line to console + private void NewLineReceived(object sender, NewLineEvent.NewLineArgs e) + { + Console.WriteLine(@"Received > " + e.Command.CommandString()); + } + + // Log sent line to console + private void NewLineSent(object sender, NewLineEvent.NewLineArgs e) + { + Console.WriteLine(@"Sent > " + e.Command.CommandString()); + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceiveBinaryArguments/4-SendAndReceiveBinaryArguments.csproj b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceiveBinaryArguments/4-SendAndReceiveBinaryArguments.csproj new file mode 100644 index 0000000..3af587f --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceiveBinaryArguments/4-SendAndReceiveBinaryArguments.csproj @@ -0,0 +1,64 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {E8A22A1D-5EA8-4FF1-808A-503225720837} + Exe + Properties + SendAndReceiveBinaryArguments + SendAndReceiveBinaryArguments + v4.0 + Client + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + {3CF8F8FC-6F5C-46F8-94DC-C2E4C505ECA4} + CommandMessenger + + + + + \ No newline at end of file diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceiveBinaryArguments/Program.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceiveBinaryArguments/Program.cs new file mode 100644 index 0000000..d25d5bc --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceiveBinaryArguments/Program.cs @@ -0,0 +1,15 @@ +namespace SendAndReceiveBinaryArguments +{ + class Program + { + static void Main() + { + // mimics Arduino calling structure + var sendAndReceiveBinaryArguments = new SendAndReceiveBinaryArguments { RunLoop = true }; + sendAndReceiveBinaryArguments.Setup(); + while (sendAndReceiveBinaryArguments.RunLoop) sendAndReceiveBinaryArguments.Loop(); + sendAndReceiveBinaryArguments.Exit(); + } + + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceiveBinaryArguments/Properties/AssemblyInfo.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceiveBinaryArguments/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..bfb1a3b --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceiveBinaryArguments/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("SendAndReceiveArgument")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] + +[assembly: AssemblyProduct("SendAndReceiveArgument")] +[assembly: AssemblyCopyright("Copyright © Thijs Elenbaas 2013,2014")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("c1610272-4b9d-445f-ac2c-7674ca40dbf2")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceiveBinaryArguments/SendAndReceiveBinaryArguments.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceiveBinaryArguments/SendAndReceiveBinaryArguments.cs new file mode 100644 index 0000000..b599dcf --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/SendAndReceiveBinaryArguments/SendAndReceiveBinaryArguments.cs @@ -0,0 +1,217 @@ +// *** SendandReceiveBinaryArguments *** + +// This example expands the previous SendandReceiveArguments example. The PC will +// send and receive multiple Binary values, demonstrating that this is more compact and faster. Since the output is not human readable any more, +// the logging is disabled and the NewLines are removed +// +// It adds a demonstration of how to: +// - Receive multiple binary parameters, +// - Send multiple binary parameters +// - Callback events being handled while the main program waits +// - How to calculate milliseconds, similar to Arduino function Millis() + +using System; +using CommandMessenger; +using CommandMessenger.Serialport; +using CommandMessenger.TransportLayer; + +namespace SendAndReceiveBinaryArguments +{ + // This is the list of recognized commands. These can be commands that can either be sent or received. + // In order to receive, attach a callback function to these events + enum Command + { + RequestPlainTextFloatSeries , // Command Request to send series in plain text + ReceivePlainTextFloatSeries , // Command to send an item in plain text + RequestBinaryFloatSeries , // Command Request to send series in binary form + ReceiveBinaryFloatSeries , // Command to send an item in binary form + }; + + public class SendAndReceiveBinaryArguments + { + public bool RunLoop { get; set; } + private SerialTransport _serialTransport; + private CmdMessenger _cmdMessenger; + private int _receivedItemsCount; // Counter of number of plain text items received + private int _receivedBytesCount; // Counter of number of plain text bytes received + //private int _receivedBinaryCount; // Counter of number of binary items received + long _beginTime; // Start time, 1st item of sequence received + long _endTime; // End time, last item of sequence received + private bool _receivePlainTextFloatSeriesFinished; // Indicates if plain text float series has been fully received + private bool _receiveBinaryFloatSeriesFinished; // Indicates if binary float series has been fully received + const int SeriesLength = 2000; // Number of items we like to receive from the Arduino + private const float SeriesBase = 1111111.111111F; // Base of values to return: SeriesBase * (0..SeriesLength-1) + + // ------------------ M A I N ---------------------- + + // Setup function + public void Setup() + { + // Create Serial Port object + _serialTransport = new SerialTransport + { + CurrentSerialSettings = { PortName = "COM6", BaudRate = 115200 } // object initializer + }; + + // Initialize the command messenger with the Serial Port transport layer + _cmdMessenger = new CmdMessenger(_serialTransport) + { + BoardType = BoardType.Bit16 // Set if it is communicating with a 16- or 32-bit Arduino board + }; + + // Attach the callbacks to the Command Messenger + AttachCommandCallBacks(); + + // Start listening + _cmdMessenger.Connect(); + + _receivedItemsCount = 0; + _receivedBytesCount = 0; + + // Send command requesting a series of 100 float values send in plain text form + var commandPlainText = new SendCommand((int)Command.RequestPlainTextFloatSeries); + commandPlainText.AddArgument(SeriesLength); + commandPlainText.AddArgument(SeriesBase); + // Send command + _cmdMessenger.SendCommand(commandPlainText); + + // Now wait until all values have arrived + while (!_receivePlainTextFloatSeriesFinished) {} + + _receivedItemsCount = 0; + _receivedBytesCount = 0; + // Send command requesting a series of 100 float values send in binary form + var commandBinary = new SendCommand((int)Command.RequestBinaryFloatSeries); + commandBinary.AddBinArgument((UInt16)SeriesLength); + commandBinary.AddBinArgument((float)SeriesBase); + + // Send command + _cmdMessenger.SendCommand(commandBinary); + + // Now wait until all values have arrived + while (!_receiveBinaryFloatSeriesFinished) { } + } + + // Loop function + public void Loop() + { + RunLoop = false; + } + + // Exit function + public void Exit() + { + // Stop listening + _cmdMessenger.Disconnect(); + + // Dispose Command Messenger + _cmdMessenger.Dispose(); + + // Dispose Serial Port object + _serialTransport.Dispose(); + + // Pause before stop + Console.WriteLine("Press any key to stop..."); + Console.ReadKey(); + } + + /// Attach command call backs. + private void AttachCommandCallBacks() + { + _cmdMessenger.Attach(OnUnknownCommand); + _cmdMessenger.Attach((int)Command.ReceivePlainTextFloatSeries, OnReceivePlainTextFloatSeries); + _cmdMessenger.Attach((int)Command.ReceiveBinaryFloatSeries, OnReceiveBinaryFloatSeries); + } + + // ------------------ C A L L B A C K S --------------------- + + // Called when a received command has no attached function. + void OnUnknownCommand(ReceivedCommand arguments) + { + Console.WriteLine("Command without attached callback received"); + } + + + // Callback function To receive the plain text float series from the Arduino + void OnReceivePlainTextFloatSeries(ReceivedCommand arguments) + { + _receivedBytesCount += CountBytesInCommand(arguments, true); + + + if (_receivedItemsCount % (SeriesLength/10) == 0) + Console.WriteLine("Received value: {0}",arguments.ReadFloatArg()); + if (_receivedItemsCount == 0) + { + // Received first value, start stopwatch + _beginTime = Millis; + } + else if (_receivedItemsCount == SeriesLength - 1) + { + // Received all values, stop stopwatch + _endTime = Millis; + var deltaTime = (_endTime - _beginTime); + Console.WriteLine("{0} milliseconds per {1} items = is {2} ms/item, {3} Hz", + deltaTime, + SeriesLength, + (float)deltaTime / (float)SeriesLength, + (float)1000 * SeriesLength / (float)deltaTime + ); + Console.WriteLine("{0} milliseconds per {1} bytes = is {2} ms/byte, {3} bytes/sec, {4} bps", + deltaTime, + _receivedBytesCount, + (float)deltaTime / (float)_receivedBytesCount, + (float)1000 * _receivedBytesCount / (float)deltaTime, + (float)8 * 1000 * _receivedBytesCount / (float)deltaTime + ); + _receivePlainTextFloatSeriesFinished = true; + } + _receivedItemsCount++; + } + + private int CountBytesInCommand(CommandMessenger.Command command, bool printLfCr) + { + var bytes = command.CommandString().Length; // Command + command separator + //var bytes = _cmdMessenger.CommandToString(command).Length + 1; // Command + command separator + if (printLfCr) bytes += Environment.NewLine.Length; // Add bytes for carriage return ('\r') and /or a newline ('\n') + return bytes; + } + + // Callback function To receive the binary float series from the Arduino + void OnReceiveBinaryFloatSeries(ReceivedCommand arguments) + { + _receivedBytesCount += CountBytesInCommand(arguments, false); + + if (_receivedItemsCount % (SeriesLength / 10) == 0) + Console.WriteLine("Received value: {0}", arguments.ReadBinFloatArg()); + if (_receivedItemsCount == 0) + { + // Received first value, start stopwatch + _beginTime = Millis; + } + else if (_receivedItemsCount == SeriesLength - 1) + { + // Received all values, stop stopwatch + _endTime = Millis; + var deltaTime = (_endTime - _beginTime); + Console.WriteLine("{0} milliseconds per {1} items = is {2} ms/item, {3} Hz", + deltaTime, + SeriesLength, + (float)deltaTime / (float)SeriesLength, + (float)1000 * SeriesLength / (float)deltaTime + ); + Console.WriteLine("{0} milliseconds per {1} bytes = is {2} ms/byte, {3} bytes/sec, {4} bps", + deltaTime, + _receivedBytesCount, + (float)deltaTime / (float)_receivedBytesCount, + (float)1000 * _receivedBytesCount / (float)deltaTime, + (float)8 * 1000 * _receivedBytesCount / (float)deltaTime + ); + _receiveBinaryFloatSeriesFinished = true; + } + _receivedItemsCount++; + } + + // Return Milliseconds since 1970 + public static long Millis { get { return (long)((DateTime.Now.ToUniversalTime() - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalMilliseconds); } } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/7-TemperatureControl.csproj b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/7-TemperatureControl.csproj new file mode 100644 index 0000000..1b239d9 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/7-TemperatureControl.csproj @@ -0,0 +1,108 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {78810760-E45A-4ACB-8D94-0E359E2F73FB} + WinExe + Properties + DataLogging + DataLogging + v4.0 + Client + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\..\..\..\..\devel\BluetoothConnectorTest\BluetoothConnectorTest\InTheHand.Net.Personal.dll + + + + + + + + + + + + + ..\ZedGraph\ZedGraph.dll + + + + + Form + + + ChartForm.cs + + + Component + + + LoggingView.cs + + + + + + ChartForm.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + {3CF8F8FC-6F5C-46F8-94DC-C2E4C505ECA4} + CommandMessenger + + + + + \ No newline at end of file diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/ChartForm.Designer.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/ChartForm.Designer.cs new file mode 100644 index 0000000..c77012a --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/ChartForm.Designer.cs @@ -0,0 +1,183 @@ +namespace DataLogging +{ + partial class ChartForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.chartControl = new ZedGraph.ZedGraphControl(); + this.GoalTemperatureValue = new System.Windows.Forms.Label(); + this.GoalTemperatureLabel = new System.Windows.Forms.Label(); + this.GoalTemperatureTrackBar = new System.Windows.Forms.TrackBar(); + this.buttonStopAcquisition = new System.Windows.Forms.Button(); + this.buttonStartAcquisition = new System.Windows.Forms.Button(); + this.statusStrip1 = new System.Windows.Forms.StatusStrip(); + this.toolStripStatusLabelProgress = new System.Windows.Forms.ToolStripStatusLabel(); + this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); + this.loggingView1 = new Tools.LoggingView(); + ((System.ComponentModel.ISupportInitialize)(this.GoalTemperatureTrackBar)).BeginInit(); + this.statusStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // chartControl + // + this.chartControl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.chartControl.IsAntiAlias = true; + this.chartControl.Location = new System.Drawing.Point(12, 12); + this.chartControl.Name = "chartControl"; + this.chartControl.ScrollGrace = 0D; + this.chartControl.ScrollMaxX = 0D; + this.chartControl.ScrollMaxY = 0D; + this.chartControl.ScrollMaxY2 = 0D; + this.chartControl.ScrollMinX = 0D; + this.chartControl.ScrollMinY = 0D; + this.chartControl.ScrollMinY2 = 0D; + this.chartControl.Size = new System.Drawing.Size(905, 631); + this.chartControl.TabIndex = 0; + // + // GoalTemperatureValue + // + this.GoalTemperatureValue.AutoSize = true; + this.GoalTemperatureValue.Location = new System.Drawing.Point(897, 651); + this.GoalTemperatureValue.Name = "GoalTemperatureValue"; + this.GoalTemperatureValue.Size = new System.Drawing.Size(19, 13); + this.GoalTemperatureValue.TabIndex = 6; + this.GoalTemperatureValue.Text = "20"; + // + // GoalTemperatureLabel + // + this.GoalTemperatureLabel.AutoSize = true; + this.GoalTemperatureLabel.Location = new System.Drawing.Point(23, 652); + this.GoalTemperatureLabel.Name = "GoalTemperatureLabel"; + this.GoalTemperatureLabel.Size = new System.Drawing.Size(88, 13); + this.GoalTemperatureLabel.TabIndex = 5; + this.GoalTemperatureLabel.Text = "Goal temperature"; + // + // GoalTemperatureTrackBar + // + this.GoalTemperatureTrackBar.Location = new System.Drawing.Point(117, 649); + this.GoalTemperatureTrackBar.Maximum = 1000; + this.GoalTemperatureTrackBar.Name = "GoalTemperatureTrackBar"; + this.GoalTemperatureTrackBar.Size = new System.Drawing.Size(779, 45); + this.GoalTemperatureTrackBar.TabIndex = 2; + this.GoalTemperatureTrackBar.Tag = ""; + this.GoalTemperatureTrackBar.TickFrequency = 10; + this.GoalTemperatureTrackBar.Value = 200; + this.GoalTemperatureTrackBar.Scroll += new System.EventHandler(this.GoalTemperatureTrackBarScroll); + // + // buttonStopAcquisition + // + this.buttonStopAcquisition.Location = new System.Drawing.Point(117, 677); + this.buttonStopAcquisition.Name = "buttonStopAcquisition"; + this.buttonStopAcquisition.Size = new System.Drawing.Size(98, 35); + this.buttonStopAcquisition.TabIndex = 7; + this.buttonStopAcquisition.Text = "Stop acquisition"; + this.buttonStopAcquisition.UseVisualStyleBackColor = true; + this.buttonStopAcquisition.Click += new System.EventHandler(this.ButtonStopAcquisitionClick); + // + // buttonStartAcquisition + // + this.buttonStartAcquisition.Location = new System.Drawing.Point(13, 677); + this.buttonStartAcquisition.Name = "buttonStartAcquisition"; + this.buttonStartAcquisition.Size = new System.Drawing.Size(98, 35); + this.buttonStartAcquisition.TabIndex = 8; + this.buttonStartAcquisition.Text = "Start acquisition"; + this.buttonStartAcquisition.UseVisualStyleBackColor = true; + this.buttonStartAcquisition.Click += new System.EventHandler(this.ButtonStartAcquisitionClick); + // + // statusStrip1 + // + this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripStatusLabelProgress, + this.toolStripStatusLabel1}); + this.statusStrip1.Location = new System.Drawing.Point(0, 810); + this.statusStrip1.Name = "statusStrip1"; + this.statusStrip1.Size = new System.Drawing.Size(929, 22); + this.statusStrip1.SizingGrip = false; + this.statusStrip1.TabIndex = 9; + this.statusStrip1.Text = "statusStrip1"; + // + // toolStripStatusLabelProgress + // + this.toolStripStatusLabelProgress.Name = "toolStripStatusLabelProgress"; + this.toolStripStatusLabelProgress.Size = new System.Drawing.Size(0, 17); + // + // toolStripStatusLabel1 + // + this.toolStripStatusLabel1.Name = "toolStripStatusLabel1"; + this.toolStripStatusLabel1.Size = new System.Drawing.Size(19, 17); + this.toolStripStatusLabel1.Text = " "; + // + // loggingView1 + // + this.loggingView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.loggingView1.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + this.loggingView1.FollowLastItem = true; + this.loggingView1.FormattingEnabled = true; + this.loggingView1.Items.AddRange(new object[] { + "Logging"}); + this.loggingView1.Location = new System.Drawing.Point(12, 722); + this.loggingView1.MaxEntriesInListBox = 3000; + this.loggingView1.Name = "loggingView1"; + this.loggingView1.Size = new System.Drawing.Size(905, 82); + this.loggingView1.TabIndex = 11; + this.loggingView1.SelectedIndexChanged += new System.EventHandler(this.loggingView1_SelectedIndexChanged); + // + // ChartForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(929, 832); + this.Controls.Add(this.loggingView1); + this.Controls.Add(this.statusStrip1); + this.Controls.Add(this.buttonStartAcquisition); + this.Controls.Add(this.buttonStopAcquisition); + this.Controls.Add(this.GoalTemperatureValue); + this.Controls.Add(this.GoalTemperatureLabel); + this.Controls.Add(this.GoalTemperatureTrackBar); + this.Controls.Add(this.chartControl); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "ChartForm"; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.Text = "Temperature Controller"; + this.Shown += new System.EventHandler(this.ChartFormShown); + ((System.ComponentModel.ISupportInitialize)(this.GoalTemperatureTrackBar)).EndInit(); + this.statusStrip1.ResumeLayout(false); + this.statusStrip1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + public ZedGraph.ZedGraphControl chartControl; + private System.Windows.Forms.Label GoalTemperatureValue; + private System.Windows.Forms.Label GoalTemperatureLabel; + private System.Windows.Forms.TrackBar GoalTemperatureTrackBar; + private System.Windows.Forms.Button buttonStopAcquisition; + private System.Windows.Forms.Button buttonStartAcquisition; + private System.Windows.Forms.StatusStrip statusStrip1; + private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabelProgress; + private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1; + private Tools.LoggingView loggingView1; + } +} + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/ChartForm.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/ChartForm.cs new file mode 100644 index 0000000..17d58e4 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/ChartForm.cs @@ -0,0 +1,238 @@ +using System; +using System.Drawing; +using System.Windows.Forms; +using System.Globalization; +using CommandMessenger; +using ZedGraph; + +namespace DataLogging +{ + public partial class ChartForm : Form + { + // In a small C# application all code would typically end up in this class. + // For a cleaner, MVP-like setup I moved higher logic to TemperatureControl.cs, + + private readonly TemperatureControl _temperatureControl; + private long _previousChartUpdate; + private IPointListEdit _analog1List; + private IPointListEdit _analog3List; + private GraphPane _temperaturePane; + private GraphPane _heaterPane; + private RollingPointPairList _heaterList; + private RollingPointPairList _heaterPwmList; + private bool _connected; + private double _goalTemperature; + + public ChartForm() + { + InitializeComponent(); + _temperatureControl = new TemperatureControl(); + } + + private void ChartFormShown(object sender, EventArgs e) + { + // Run setup of view model + _temperatureControl.Setup(this); + } + + + // ------------------ CHARTING ROUTINES --------------------- + + /// Sets up the chart. + public void SetupChart() + { + MasterPane masterPane = chartControl.MasterPane; + masterPane.PaneList.Clear(); + + // get a reference to the GraphPane + + _temperaturePane = new GraphPane(new Rectangle(5, 5, 890, 350), + "Temperature controller", + "Time (s)", + "Temperature (C)"); + masterPane.Add(_temperaturePane); + + // Create data arrays for rolling points + _analog1List = new RollingPointPairList(3000); + _analog3List = new RollingPointPairList(3000); + _analog1List.Clear(); + _analog3List.Clear(); + + // Create a smoothened red curve for the current temperature + LineItem myCurve1 = _temperaturePane.AddCurve("Current temperature", _analog1List, Color.Red, SymbolType.None); + myCurve1.Line.Width = 2; + myCurve1.Line.IsSmooth = true; + myCurve1.Line.SmoothTension = 0.2f; + + + // Create a smoothened blue curve for the goal temperature + LineItem myCurve3 = _temperaturePane.AddCurve("Goal temperature", _analog3List, Color.Blue, SymbolType.None); + myCurve3.Line.Width = 2; + myCurve3.Line.IsSmooth = true; + myCurve3.Line.SmoothTension = 0.2f; + // Tell ZedGraph to re-calculate the axes since the data have changed + chartControl.AxisChange(); + + _heaterPane = new GraphPane(new Rectangle(5, 360, 890, 250), + null, + null, + null); + masterPane.Add(_heaterPane); + + _heaterList = new RollingPointPairList(3000); + _heaterPwmList = new RollingPointPairList(3000); + _heaterList.Clear(); + _heaterPwmList.Clear(); + + // Create a red curve for the heater value + LineItem heaterCurve = _heaterPane.AddCurve(null, _heaterList, Color.YellowGreen, SymbolType.None); + heaterCurve.Line.Width = 2; + heaterCurve.Line.IsSmooth = false; + + // Create a red curve for the current heater pwm value + LineItem heaterPwmCurve = _heaterPane.AddCurve(null, _heaterPwmList, Color.Blue, SymbolType.None); + heaterPwmCurve.Line.Width = 2; + heaterPwmCurve.Line.IsSmooth = false; + + SetChartScale(0); + } + + // Update the graph with the data points + public void UpdateGraph(double time, double currTemp, double goalTemp, double heaterValue, bool heaterPwmValue) + { + // Add data points to the circular lists + _analog1List.Add(time, currTemp); + _analog3List.Add(time, goalTemp); + + _heaterList.Add(time, heaterValue); + _heaterPwmList.Add(time, heaterPwmValue?1.05:0.05); + + // Because updating the chart is computationally expensive if + // there are many data points, we do this only every 10 ms, that is 100 Hz + if (!TimeUtils.HasExpired(ref _previousChartUpdate, 10)) return; + + //Console.WriteLine(@"Update chart"); + SetChartScale(time); + } + + // Update the graph with the data points + public void SetConnected() + { + _connected = true; + UpdateUi(); + } + + // Update the graph with the data points + public void SetDisConnected() + { + _connected = false; + UpdateUi(); + } + + /// Updates the user interface. + private void UpdateUi() + { + buttonStartAcquisition.Enabled = _connected; + buttonStopAcquisition.Enabled = _connected; + chartControl.Enabled = _connected; + GoalTemperatureTrackBar.Enabled = _connected; + GoalTemperatureValue.Enabled = _connected; + } + + /// Sets the chart scale. + /// The time scale to show. + private void SetChartScale(double time) + { + // set window width + const double windowWidth = 30.0; + // get and update x-scale to scroll with data with an certain window + + var xScaleTemp = _temperaturePane.XAxis.Scale; + + if (time < windowWidth) + { + xScaleTemp.Max = windowWidth; + xScaleTemp.Min = 0; + } + else + { + xScaleTemp.Max = time + xScaleTemp.MajorStep; + xScaleTemp.Min = xScaleTemp.Max - windowWidth; + } + + var xScaleHeater = _heaterPane.XAxis.Scale; + xScaleHeater.Max = xScaleTemp.Max; + xScaleHeater.Min = xScaleTemp.Min; + + // Make sure the axes are rescaled to accommodate actual data + chartControl.AxisChange(); + + // Force a redraw + chartControl.Invalidate(); + } + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing) + { + _temperatureControl.Exit(); + if (components != null) + components.Dispose(); + } + base.Dispose(disposing); + } + + /// Update goal temperature as triggered by scrollbar. + /// Source of the event. + /// Event information. + public void GoalTemperatureTrackBarScroll(object sender, EventArgs e) + { + _goalTemperature = ((double)GoalTemperatureTrackBar.Value/10.0); + GoalTemperatureValue.Text = _goalTemperature.ToString(CultureInfo.InvariantCulture); + _temperatureControl.GoalTemperature = _goalTemperature; + } + + /// Stop Acquisition. + /// Source of the event. + /// Event information. + private void ButtonStopAcquisitionClick(object sender, EventArgs e) + { + _temperatureControl.StopAcquisition(); + } + + /// Start Acquisition. + /// Source of the event. + /// Event information. + private void ButtonStartAcquisitionClick(object sender, EventArgs e) + { + _temperatureControl.StartAcquisition(); + } + + /// Update status bar. + /// The message to show on the status bar. + public void SetStatus(string description) + { + toolStripStatusLabel1.Text = description; + } + + private void listView1_SelectedIndexChanged(object sender, EventArgs e) + { + + } + + private void loggingView1_SelectedIndexChanged(object sender, EventArgs e) + { + + } + + public void LogMessage(string message) + { + loggingView1.AddEntry(message); + } + + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/ChartForm.resources b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/ChartForm.resources new file mode 100644 index 0000000..6c05a97 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/ChartForm.resources Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/ChartForm.resx b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/ChartForm.resx new file mode 100644 index 0000000..174ebc7 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/ChartForm.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/LoggingView.Designer.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/LoggingView.Designer.cs new file mode 100644 index 0000000..9279fde --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/LoggingView.Designer.cs @@ -0,0 +1,37 @@ +namespace Tools +{ + partial class LoggingView + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + //this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + } + + #endregion + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/LoggingView.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/LoggingView.cs new file mode 100644 index 0000000..62568db --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/LoggingView.cs @@ -0,0 +1,82 @@ +using System.Drawing; +using System.Windows.Forms; + +namespace Tools +{ + public partial class LoggingView : ListBox + { + public LoggingView() + { + InitializeComponent(); + SetStyle( + ControlStyles.OptimizedDoubleBuffer | + ControlStyles.ResizeRedraw | + ControlStyles.UserPaint, + true); + DrawMode = DrawMode.OwnerDrawFixed; + FollowLastItem = true; + MaxEntriesInListBox = 3000; + } + + public bool FollowLastItem{ get; set; } + public int MaxEntriesInListBox { get; set; } + + + public void AddEntry(object item) + { + BeginUpdate(); + Items.Add(item); + + if (Items.Count > MaxEntriesInListBox) + { + Items.RemoveAt(0); + } + + if (FollowLastItem) TopIndex = Items.Count - 1; + EndUpdate(); + } + + protected override void OnDrawItem(DrawItemEventArgs e) + { + if (Items.Count > 0) + { + e.DrawBackground(); + e.Graphics.DrawString(Items[e.Index].ToString(), e.Font, new SolidBrush(ForeColor), new PointF(e.Bounds.X, e.Bounds.Y)); + } + base.OnDrawItem(e); + } + protected override void OnPaint(PaintEventArgs e) + { + var iRegion = new Region(e.ClipRectangle); + e.Graphics.FillRegion(new SolidBrush(BackColor), iRegion); + if (Items.Count > 0) + { + for (int i = 0; i < Items.Count; ++i) + { + var irect = GetItemRectangle(i); + if (e.ClipRectangle.IntersectsWith(irect)) + { + if ((SelectionMode == SelectionMode.One && SelectedIndex == i) + || (SelectionMode == SelectionMode.MultiSimple && SelectedIndices.Contains(i)) + || (SelectionMode == SelectionMode.MultiExtended && SelectedIndices.Contains(i))) + { + OnDrawItem(new DrawItemEventArgs(e.Graphics, Font, + irect, i, + DrawItemState.Selected, ForeColor, + BackColor)); + } + else + { + OnDrawItem(new DrawItemEventArgs(e.Graphics, Font, + irect, i, + DrawItemState.Default, ForeColor, + BackColor)); + } + iRegion.Complement(irect); + } + } + } + base.OnPaint(e); + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/Program.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/Program.cs new file mode 100644 index 0000000..0a4586b --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/Program.cs @@ -0,0 +1,20 @@ +using System; +using System.Windows.Forms; + +namespace DataLogging +{ + static class Program + { + /// + /// The main entry point for the application. + /// Note that the main code is not in this class + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new ChartForm()); + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/Properties/AssemblyInfo.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..32d53ca --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("DataLogging")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] + +[assembly: AssemblyProduct("DataLogging")] +[assembly: AssemblyCopyright("Copyright © Thijs Elenbaas 2013,2014")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("7896e467-386e-471d-8856-518594d0588f")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/Properties/Resources.Designer.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/Properties/Resources.Designer.cs new file mode 100644 index 0000000..2569c98 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18052 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace DataLogging.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DataLogging.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/Properties/Resources.resources b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/Properties/Resources.resources new file mode 100644 index 0000000..6c05a97 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/Properties/Resources.resources Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/Properties/Resources.resx b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/Properties/Settings.Designer.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/Properties/Settings.Designer.cs new file mode 100644 index 0000000..68ed9a1 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18052 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace DataLogging.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/Properties/Settings.settings b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/TemperatureControl.cs b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/TemperatureControl.cs new file mode 100644 index 0000000..d175fa5 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/TemperatureControl/TemperatureControl.cs @@ -0,0 +1,368 @@ +// *** TemperatureControl *** + +// This example expands the previous ArduinoController example. The PC will now send a start command to the Arduino, +// and wait for a response from the Arduino. The Arduino will start sending temperature data and the heater steering +// value data which the PC will plot in a chart. With a slider we can set the goal temperature, which will make the +// PID software on the controller adjust the setting of the heater. +// +// This example shows how to design a responsive performance UI that sends and receives commands +// - Send queued commands +// - Manipulate the send and receive queue +// - Add queue strategies +// - Use bluetooth connection +// - Use auto scanning and connecting +// - Use watchdog + +using System; +using CommandMessenger; +using CommandMessenger.Serialport; +using CommandMessenger.TransportLayer; +using System.Threading; +using CommandMessenger.Bluetooth; +namespace DataLogging +{ + enum Command + { + RequestId, // Command to request application ID + SendId, // Command to send application ID + Acknowledge, // Command to acknowledge a received command + Error, // Command to message that an error has occurred + StartLogging, // Command to turn on data logging + StopLogging, // Command to turn off data logging + PlotDataPoint, // Command to request plotting a data point + SetGoalTemperature, // Command to set the goal temperature + SetStartTime, // Command to set the new start time for the logger + }; + + enum TransportMode + { + Serial, // Serial port connection (over USB) + Bluetooth, // Bluetooth connection + }; + + public class TemperatureControl + { + // This class (kind of) contains presentation logic, and domain model. + // ChartForm.cs contains the view components + private ITransport _transport; + private CmdMessenger _cmdMessenger; + private ConnectionManager _connectionManager; + private ChartForm _chartForm; + //private float _startTime; + private double _goalTemperature; + + // ------------------ MAIN ---------------------- + + + public bool AcquisitionStarted { get; set; } + public bool AcceptData { get; set; } + + /// Gets or sets the goal temperature. + /// The goal temperature. + public double GoalTemperature + { + get { return _goalTemperature; } + set + { + if (Math.Abs(_goalTemperature - value) > float.Epsilon) + { + _goalTemperature = value; + SetGoalTemperature(_goalTemperature); + if (GoalTemperatureChanged!=null) GoalTemperatureChanged(); + } + } + } + + public Action GoalTemperatureChanged; // Action that is called when the goal temperature has changed + private long _startTime; + + + // Setup function + public void Setup(ChartForm chartForm) + { + // Choose which transport mode you want to use: + // 1. Serial port. This can be a real serial port but is usually a virtual serial port over USB. + // It can also be a virtual serial port over Bluetooth, but the direct bluetooth works better + // 2. Bluetooth This bypasses the Bluetooth virtual serial port, but communicates over the RFCOMM layer + var transportMode = TransportMode.Serial; + + // getting the chart control on top of the chart form. + _chartForm = chartForm; + + // Set up chart + _chartForm.SetupChart(); + + // Connect slider to GoalTemperatureChanged + GoalTemperatureChanged += () => _chartForm.GoalTemperatureTrackBarScroll(null, null); + + // Set up transport + if (transportMode == TransportMode.Bluetooth) + _transport = new BluetoothTransport(); + // We do not need to set the device: it will be found by the connection manager + else + _transport = new SerialTransport { CurrentSerialSettings = { DtrEnable = false } }; // some boards (e.g. Sparkfun Pro Micro) DtrEnable may need to be true. + // We do not need to set serial port and baud rate: it will be found by the connection manager + + // Initialize the command messenger with the Serial Port transport layer + _cmdMessenger = new CmdMessenger(_transport) + { + BoardType = BoardType.Bit16, // Set if it is communicating with a 16- or 32-bit Arduino board + PrintLfCr = false // Do not print newLine at end of command, to reduce data being sent + }; + + // Tell CmdMessenger to "Invoke" commands on the thread running the WinForms UI + _cmdMessenger.SetControlToInvokeOn(chartForm); + + // Set command strategy to continuously to remove all commands on the receive queue that + // are older than 1 sec. This makes sure that if data logging comes in faster that it can + // be plotted, the graph will not start lagging + _cmdMessenger.AddReceiveCommandStrategy(new StaleGeneralStrategy(1000)); + + // Attach the callbacks to the Command Messenger + AttachCommandCallBacks(); + + // Attach to NewLinesReceived for logging purposes + _cmdMessenger.NewLineReceived += NewLineReceived; + + // Attach to NewLineSent for logging purposes + _cmdMessenger.NewLineSent += NewLineSent; + + // Set up connection manager + if (transportMode == TransportMode.Bluetooth) + _connectionManager = new BluetoothConnectionManager((_transport as BluetoothTransport), _cmdMessenger, (int)Command.RequestId, (int)Command.SendId); + else + _connectionManager = new SerialConnectionManager ((_transport as SerialTransport), _cmdMessenger, (int)Command.RequestId, (int)Command.SendId); + + // Tell the Connection manager to "Invoke" commands on the thread running the WinForms UI + _connectionManager.SetControlToInvokeOn(chartForm); + + // Event when the connection manager finds a connection + _connectionManager.ConnectionFound += ConnectionFound; + + // Event when the connection manager watchdog notices that the connection is gone + _connectionManager.ConnectionTimeout += ConnectionTimeout; + + // Event notifying on scanning process + _connectionManager.Progress += LogProgress; + + // Initialize the application + InitializeTemperatureControl(); + + // Start scanning for ports/devices + _connectionManager.StartScan(); + } + + private void InitializeTemperatureControl() + { + _startTime = TimeUtils.Millis; + + // Set initial goal temperature + GoalTemperature = 25; + // _startTime = 0.0f; + AcquisitionStarted = false; + AcceptData = false; + _chartForm.SetDisConnected(); + } + + // Exit function + public void Exit() + { + // Disconnect ConnectionManager + _connectionManager.Progress -= LogProgress; + _connectionManager.ConnectionTimeout -= ConnectionTimeout; + _connectionManager.ConnectionFound -= ConnectionFound; + + // Dispose ConnectionManager + _connectionManager.Dispose(); + + // Disconnect Command Messenger + _cmdMessenger.Disconnect(); + + // Dispose Command Messenger + _cmdMessenger.Dispose(); + + // Dispose transport layer + _transport.Dispose(); + } + + /// Attach command call backs. + private void AttachCommandCallBacks() + { + _cmdMessenger.Attach(OnUnknownCommand); + _cmdMessenger.Attach((int)Command.Acknowledge, OnAcknowledge); + _cmdMessenger.Attach((int)Command.Error, OnError); + _cmdMessenger.Attach((int)Command.PlotDataPoint, OnPlotDataPoint); + } + + // ------------------ CALLBACKS --------------------- + + // Called when a received command has no attached function. + // In a WinForm application, console output gets routed to the output panel of your IDE + void OnUnknownCommand(ReceivedCommand arguments) + { + _chartForm.LogMessage(@"Command without attached callback received"); + //Console.WriteLine(@"Command without attached callback received"); + } + + // Callback function that prints that the Arduino has acknowledged + void OnAcknowledge(ReceivedCommand arguments) + { + _chartForm.LogMessage(@"Arduino acknowledged"); + //Console.WriteLine(@" Arduino is ready"); + } + + // Callback function that prints that the Arduino has experienced an error + void OnError(ReceivedCommand arguments) + { + _chartForm.LogMessage(@"Arduino has experienced an error"); + //Console.WriteLine(@"Arduino has experienced an error"); + } + + // Callback function that plots a data point for the current temperature, the goal temperature, + // the heater steer value and the Pulse Width Modulated (PWM) value. + private void OnPlotDataPoint(ReceivedCommand arguments) + { + // Plot data if we are accepting data + if (!AcceptData) return; + + // Get all arguments from plot data point command + var time = arguments.ReadBinFloatArg(); + time = (TimeUtils.Millis-_startTime)/1000.0f; + var currTemp = arguments.ReadBinFloatArg(); + var goalTemp = arguments.ReadBinFloatArg(); + var heaterValue = arguments.ReadBinFloatArg(); + var heaterPwm = arguments.ReadBinBoolArg(); + + // do not log data if times are out of sync + //if (time<_startTime) return; + + // Update chart with new data point; + _chartForm.UpdateGraph(time, currTemp, goalTemp, heaterValue, heaterPwm); + + // Update _startTime in case it needs to be resend after disconnection + //_startTime = time; + } + + // Log received line to console + private void NewLineReceived(object sender, NewLineEvent.NewLineArgs e) + { + _chartForm.LogMessage(@"Received > " + e.Command.CommandString()); + // Console.WriteLine(@"Received > " + e.Command.CommandString()); + } + + // Log sent line to console + private void NewLineSent(object sender, NewLineEvent.NewLineArgs e) + { + _chartForm.LogMessage(@"Sent > " + e.Command.CommandString()); + // Console.WriteLine(@"Sent > " + e.Command.CommandString()); + } + + // Log connection manager progress to status bar + void LogProgress(object sender, ConnectionManagerProgressEventArgs e) + { + if (e.Level <= 2) { _chartForm.SetStatus(e.Description); } + _chartForm.LogMessage(e.Description); + // Console.WriteLine(e.Level + @" :" + e.Description); + } + + private void ConnectionTimeout(object sender, EventArgs e) + { + // Connection time-out! + // Disable UI .. + _chartForm.SetStatus(@"Connection timeout, attempting to reconnect"); + _chartForm.SetDisConnected(); + // and start scanning + _connectionManager.StartScan(); + } + + private void ConnectionFound(object sender, EventArgs e) + { + //We have been connected! + + // Make sure we do not receive data until we are ready + AcceptData = false; + + // Enable UI + _chartForm.SetConnected(); + + // Send command to set goal Temperature + SetGoalTemperature(_goalTemperature); + + // Restart acquisition if needed + if (AcquisitionStarted) StartAcquisition(); else StopAcquisition(); + AcceptData = true; + // Start Watchdog + _connectionManager.StartWatchDog(); + + // Yield time slice in order to get UI updated + Thread.Yield(); + } + + // Set the goal temperature on the embedded controller + public void SetGoalTemperature(double goalTemperature) + { + _goalTemperature = goalTemperature; + + // Create command to start sending data + var command = new SendCommand((int)Command.SetGoalTemperature); + command.AddBinArgument(_goalTemperature); + + // Collapse this command if needed using CollapseCommandStrategy + // This strategy will avoid duplicates of this command on the queue: if a SetGoalTemperature command is + // already on the queue when a new one is added, it will be replaced at its current queue-position. + // Otherwise the command will be added to the back of the queue. + // + // This will make sure that when the slider raises a lot of events that each set a new goal temperature, the + // controller will not start lagging. + _chartForm.LogMessage(@"Queue command - SetGoalTemperature"); + _cmdMessenger.QueueCommand(new CollapseCommandStrategy(command)); + } + + // Set the start time on the embedded controller + public void SetStartTime(float startTime) + { + var command = new SendCommand((int)Command.SetStartTime, (int)Command.Acknowledge,500); + command.AddBinArgument((float)startTime); + + // We place this command at the front of the queue in order to receive correctly timestamped data as soon as possible + // Meanwhile, the data in the receivedQueue is cleared as these will contain the wrong timestamp + _cmdMessenger.SendCommand(command,SendQueue.ClearQueue, ReceiveQueue.ClearQueue, UseQueue.BypassQueue); + } + + // Signal the embedded controller to start sending temperature data. + public bool StartAcquisition() + { + // Send command to start sending data + var command = new SendCommand((int)Command.StartLogging,(int)Command.Acknowledge,500); + + // Wait for an acknowledgment that data is being sent. Clear both the receive queue until the acknowledgment is received + _chartForm.LogMessage(@"Send command - Start acquisition"); + var receivedCommand = _cmdMessenger.SendCommand(command, SendQueue.ClearQueue, ReceiveQueue.ClearQueue); + if (receivedCommand.Ok) + { + AcquisitionStarted = true; + } + else + _chartForm.LogMessage(@" Failure > no OK received from controller"); + return receivedCommand.Ok; + } + + // Signal the embedded controller to stop sending temperature data. + public bool StopAcquisition() + { + // Send command to stop sending data + var command = new SendCommand((int)Command.StopLogging, (int)Command.Acknowledge, 2500); + + // Wait for an acknowledgment that data is being sent. Clear both the send and receive queue until the acknowledgment is received + _chartForm.LogMessage(@"Send command - Stop acquisition"); + var receivedCommand = _cmdMessenger.SendCommand(command, SendQueue.ClearQueue, ReceiveQueue.ClearQueue); + if (receivedCommand.Ok) + { + AcquisitionStarted = false; + } + else + _chartForm.LogMessage(@" Failure > no OK received from controller"); + return receivedCommand.Ok; + } + } +} diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/ZedGraph.Web.XML b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/ZedGraph.Web.XML new file mode 100644 index 0000000..195a906 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/ZedGraph.Web.XML @@ -0,0 +1,3023 @@ + + + + ZedGraph.Web + + + + + Assists in managing viewstate sub-objects. The host of the assistant is + responsible for managing an array within the statebag. This assistant + helps deal with that by simply registering each hosted object with a + unique code value. It also simplies the on demand creation of the sub object + by creating the instance only when the getobject method is called. + + Darren Martz + + + + Array of child class instances managed in the viewstate + + + + + Default constructor + + + + + Registers a code with a datatype in the assistance. Once registered + the datatype will be available for retrievable using the same code value. + + Type identifier + Object type being hosted + + + + Retrieves instance based on the registered code and datatype. + If the value is null, the datatype is used to create a new instance + that is cached in the assistant node. + + code to search on + Indicates if the parent is currently + tracking viewstate + class instance + + + + Retrieves the object instance for an assistant node given an + index value. + + Index value in the assistants node collection + Indicates if the parent is currently + tracking viewstate changes + Object instance based on the node found in the collection + + + + Returns the current viewstate of every object hosted in + the assistants collection. + + parents viewstate bag + Combined saved viewstate for the parent and all hosted + objects in the assistant collection + + + + Loads the viewstate from the provided statebag into each of the + registered objects hosted in the assistants collection. + + statebag provided by parent + indicates if the parent is currently + tracking viewstate changes + The parents individual statebag + + + + Triggers the assistant to begin tracking viewstate changes + + + + + Internal child class instance node, identified by a code, + its datatype, and the class instance. + + + + + Creates an assistant node given a character key and + the hosted class type. + + Identifier code + Class data type hosted by the node + + + + Code to uniquely identify this node entry + + + + + Object type identifying hosted value type. + + + + + Object instance based on Key definition. May be null + + + + + Identifies state management items by a unique code and its datatype. The code is defined + in the implementation of a GenericCollection class constructor. + + Darren Martz + $ + + + + Default constructor + + Single character code used to identify the state item datatype + Item datatype + + + + The state item datatype character code + + + + + The state item datatype + + + + + Generic state management item used in a state management aware collection. + This class is intended to be subclasses with public property values added. + Property values should be added in the full {get/set} format reading and writing + the current state from the ViewState array. + + + public class MyItem : GenericItem + { + [NotifyParentProperty(true)] + public bool IsVisible + { + get + { + object x = ViewState["IsVisible"]; + return (null == x) ? true : (bool)x; + } + set { ViewState["IsLegendLabelVisible"] = value; } + } + } + + Darren Martz + + + + Default constructor that does nothing + + + + + Internal indicator of the current tracking state + + + + + Internal view state used by the asp.net infrastructure + + + + + + + + + + + + + + + + + + + Internal method to mark the statebag as dirty so it can be resaved if necessary + + + + + Loads the viewstate into the local statebag given a viewstate collection object + + object containing asp.net page viewstate + + + + Implementation of the IStateManager.LoadViewState method + + object containing asp.net page viewstate + + + + Saves the current viewstate into a portable object + + object containing classes viewstate + + + + Implementation of the IStateManager.SaveViewState method + + object containing classes viewstate + + + + Tells the statebag to begin tracking changes to state values + + + + + Implementation of the IStateManager.TrackViewState method + + + + + Internal access to the viewstate array. Subclassed objects can access this + to read/write changes to the objects view state. + + + ViewState["myelement"] = "value"; + string val = (string)ViewState["myelement"]; + + + + + Implementation of the IStateManager.IsTrackingViewState property. + + + + + Provides a few hints to the development editor on how to create + child items in the collection. This class uses the schema defined + inside the collection implementation. + + + public class MyCollection : GenericCollection + { + public MyCollection() : base() + { + Schema = new GenericCollectionItemSchema[1]; + Schema[0].code = 'b'; + Schema[1].type = typeof(MyItem); + } + public void Add(MyItem item) + { + if ( null != item ) ListAdd( item ); + else throw new ArgumentException("parameter cannot be null","item"); + } + + [NotifyParentProperty(true)] + public ZedGraphWebCurveItem this [int index] + { + get { return (MyItem)ListGet(index); } + set { ListInsert(index,value); } + } + } + + Darren Martz + + + + Default constructor based on CollectionEditor contructor + + Datetype of the collection to manage + + + + Informs the visual editor what kinds of classes are accepted as elements + within the collection. + + Array of datatypes supported as items within the collection + + + + Provides array services in a web state engine environment. This collection can + support 1:N datatypes as items provided they are based on the GenericItem class. + + Darren Martz + + + + Default constructor + + + + + Internal collection item schema table. All supported data types must be + identified in this array. The default constructor should populate this + value. + + + + + Internal array of items. Some public access to the array is provided by default. + Additional public access should be added when subclassing. + + + + + Empty the array list and marks the viewstate. + + + + + Verifies if the object is a supported datatype + + object to verify + true if supported + + + + Internal insert item method that also tracks the change in the viewstate + + location in the array to insert the object + object to insert + + + + + + Retrieves an item by index + + array index + array item + + + + Appends item to array and tracks the change in the viewstate + + Item to append + new index of item + + + + + + Removes the item from the array and tracks the change in the viewstate + + item index to remove + + + + Removes the item from the array and tracks the change in the viewstate + + object to remove + + + + + + Identifies the items index in the list given the item object + + item to locate in list + index of item + + + + + + + + + + + + + + + + + + Adds item based on the rules of ListAdd + + + + + + + + + + + + + + + + + + + + + + + + + + + + Inserts item according to the rules of ListInsert + + + + + + + + + Removes item based on ListRemove + + + + + + + + Removes item based on RemoveAt + + + + + + + + preserves internal tracking state + + + + + marks the entire statebag as dirty requiring the entire state to be saved + + + + + + + + + + Loads the view state. This involves reading each state item pair, verifying + schema support for each datatype, creating each item instance, and loading + the state into each newly created instance. + + + state management object + + + + Saves the viewstate into a portable object format. This involves + saving the state of each item in the list. + + + portable state object + + + + + + + + + + + + + + + + + + + Privately implement those members of IList that take or + return the object type and expose equivalent public members + that take or return an item instance instead. Also + implement privately those members of IList that are not meaninful + to expose in the public object model of this Collection. + + + + + + + + + + + + + + + + + + + + Base class for curve items in the web control + + + Darren Martz + + + + Identifies curve item by the labels value + + A string containing "CurveItem: label", where 'label' is the + property of the + + + + + Default constructor + + + + + Constructor that accepts a default label value + + Curve item label + + + + Copy the properties of this to the specified + object. + + The destination object + + + + Creates a new CurveItem using the PointPairList and add it the the given pane. + + the GraphPane object to which to add the new curve + a PointPairList collection defining the points for this curve + the newly created CurveItem added to the given GraphPane + This method must be overriden by childs + + + + The object reference that points to a data source from which to bind curve data. + + + + + The name of the data member that contains the data to be + bound to this . + + + + + Proxy property that gets or sets the value of . + + A text string that represents the + entry for the the object. + + + + + + Proxy property that gets or sets the value of . + + The // + color (FillColor for the Bar). This is a common access to + Line.Color, + Border.Color, and + properties for this curve + + + + + + Proxy property that gets or sets the value of . + + Determines whether the is visible on the graph. + Note that this value turns the curve display on or off, but it does not + affect the display of the legend entry. To hide the legend entry, you + have to set to false. + + CurveItem.IsVisible + Label.IsVisible + + + + Proxy property that gets or sets the value of + Label.IsVisible. + + Determines whether the label for this is + visible in the legend. + Note that this value turns the legend entry display on or off, but it does not + affect the display of the curve on the graph. To hide the curve, you + have to set to false. + + + Label.IsVisible + + + + Proxy property that gets or sets the value of . + + Determines which Y axis this + is assigned to. The + is on the left side of the graph and the + is on the right side. Assignment to an axis + determines the scale that is used to draw the curve on the graph. + + + + + + Proxy property that gets the value of the . + + + + + Web control state management class for a object. + + Darren Martz + + + + Override ToString function + + Always returns "Border" + + + + Copy the properties of this to the specified + object. + + The destination object + + + + Proxy property that gets or sets the value of . + + Determines the of the used to + draw this Border. + + + + + Proxy property that gets or sets the value of . + + Determines whether or not the Border will be drawn. true to draw the Border, + false otherwise. + + + + + Proxy property that gets or sets the value of . + + Gets or sets the width, in points (1/72 inch), of the + used to draw this Border. + + + + + Proxy property that gets or sets the value of . + + Gets or sets the amount of inflation to be done on the rectangle + before rendering. + + + + + Todo: idem ZedGraphWebFill2 + + + + + Default constructor + + + + + Web control state management class for a object. + + Darren Martz + + + + Override ToString() function + + Always returns "Fill" + + + + Copy the properties of this to the specified + object. + + The destination object + + + + The object associated with this object. + Not accessible via webcontrol properties. + + + + + Proxy property that gets or sets the value of . + + The fill color. This property is used as a single color to make a solid fill + ( is ), or it can be used in + combination with to make a + + when is and + is null. + + + + + Opacity of , range from 0 to 100. + 100 is opaque, 0 is invisible. + + + To be replaced by a best color designer which enables the selection of a transparency level. + + + + + Proxy property that gets or sets the value of . + + This property determines the type of color fill. + Returns true if the property is either + or + . If set to true, this property + will automatically set the to + . If set to false, this property + will automatically set the to + . In order to get a regular + solid-color fill, you have to manually set + to . + + + + + Proxy property that gets or sets the value of . + + The maximum user-scale value for the gradient-by-value determination. This defines + the user-scale value for the end of the gradient. + + + + + + A double value, in user scale unit + + + + Proxy property that gets or sets the value of . + + The minimum user-scale value for the gradient-by-value determination. This defines + the user-scale value for the start of the gradient. + + + + + + A double value, in user scale unit + + + + Proxy property that gets or sets the value of . + + Determines the type of fill, which can be either solid + color () or a custom brush + (). See for + more information. + + + + + + Proxy property that gets or sets the value of . + + Determines how the brush will be aligned with the filled object + in the horizontal direction. This value is a enumeration. + This field only applies if is false. + + + + + + Proxy property that gets or sets the value of . + + Determines how the brush will be aligned with the filled object + in the vertical direction. This value is a enumeration. + This field only applies if is false. + + + + + + Proxy property that gets or sets the value of . + + Determines if the brush will be scaled to the bounding box + of the filled object. If this value is false, then the brush will only be aligned + with the filled object based on the and + properties. + + + + + TODO: change the vsassist system so different default constructors or initializers can be called, + or to be able to know if a the object is already initialized or not (new). + + + + + Default Constructor + + + + + Web control state management class for a object + + Darren Martz + + + + Override ToString() function + + Always returns "Symbol" + + + + Default Constructor + + + + + Copy the properties of this to the specified + object. + + The destination object + + + + Proxy property that gets or sets the value of . + + Gets or sets a property that shows or hides the . + + + + + Proxy property that gets or sets the value of . + + Gets or sets the size of the in points (1/72nd inch). + + + + + Proxy property that gets or sets the value of . + + Gets or sets the type (shape) of the using + a enumeration. + + + + + Proxy property that gets or sets the object for + this . + + + + + + Proxy property that gets or sets the object for + this . + + + + + + Web control state management class for a class + + Darren Martz + + + + Identifies by the labels value + + A string containing "BarItem: label", where 'label' is the + property of the + + + + + Default Constructor + + + + + Copy the properties of this to the specified + object. + + The destination object + + + + Creates a new CurveItem using the PointPairList and add it the the given pane. + + the GraphPane object to which to add the new curve + a PointPairList collection defining the points for this curve + the newly created CurveItem added to the given GraphPane + This method must be overriden by childs + + + + Proxy property that gets or sets the object for + this . + + + + + + Proxy property that gets or sets the object for + this . + + + + + + Web control state management class for a class + + Darren Martz + + + + Identifies by the labels value + + A string containing "ErrorBarItem: label", where 'label' is the + property of the + + + + + Default Constructor + + + + + Copy the properties of this to the specified + object. + + The destination object + + + + Creates a new CurveItem using the PointPairList and add it the the given pane. + + the GraphPane object to which to add the new curve + a PointPairList collection defining the points for this curve + the newly created CurveItem added to the given GraphPane + This method must be overriden by childs + + + + Proxy property that gets or sets the object for + this . + + + + + + Proxy property that gets or sets the value of . + + The pen width to be used for drawing error bars + Units are points. This property only controls the pen width for the + vertical line. The pen width for the symbol outline is + controlled separately by the property. + + + + + Web control state management class for a class + + Darren Martz + + + + Identifies by the labels value + + A string containing "HiLowBarItem: label", where 'label' is the + property of the + + + + + Default constructor + + + + + Copy the properties of this to the specified + object. + + The destination object + + + + Creates a new CurveItem using the PointPairList and add it the the given pane. + + the GraphPane object to which to add the new curve + a PointPairList collection defining the points for this curve + the newly created CurveItem added to the given GraphPane + This method must be overriden by childs + + + + Proxy property that gets or sets the object for + this . + + + + + + Proxy property that gets or sets the object for + this . + + + + + + Web control state management class for a class + + Darren Martz + + + + Identifies by the labels value + + A string containing "LineItem: label", where 'label' is the + property of the + + + + + Default constructor + + + + + Copy the properties of this to the specified + object. + + The destination object + + + + Creates a new CurveItem using the PointPairList and add it the the given pane. + + the GraphPane object to which to add the new curve + a PointPairList collection defining the points for this curve + the newly created CurveItem added to the given GraphPane + This method must be overriden by childs + + + + Proxy property that gets or sets the value of . + + Gets or sets a property that determines if this + will be drawn smooth. The "smoothness" is controlled by + the property. + + + + + + Proxy property that gets or sets the value of . + + The pen width used to draw the , in points (1/72 inch) + + + + + + Proxy property that gets or sets the value of . + + Gets or sets a property that determines the smoothing tension + for this . This property is only used if + is true. A tension value 0.0 will just + draw ordinary line segments like an unsmoothed line. A tension + value of 1.0 will be smooth. Values greater than 1.0 will generally + give odd results. + + A floating point value indicating the level of smoothing. + 0.0F for no smoothing, 1.0F for lots of smoothing, >1.0 for odd + smoothing. + + + + + Proxy property that gets or sets the value of . + + The style of the , defined as a enum. + This allows the line to be solid, dashed, or dotted. + + + + + + Proxy property that gets or sets the value of . + + Determines if the will be drawn by directly connecting the + points from the data collection, + or if the curve will be a "stair-step" in which the points are + connected by a series of horizontal and vertical lines that + represent discrete, constant values. Note that the values can + be forward oriented ForwardStep () or + rearward oriented RearwardStep. + That is, the points are defined at the beginning or end + of the constant value for which they apply, respectively. + The property is ignored for lines + that have set to true. + + + + + + Proxy property that gets or sets the object for + this . + + + + + + Proxy property that gets or sets the object for + this . + + + + + + Web control state management class for a class + + Darren Martz + + + + Identifies by the labels value + + A string containing "PieItem: label", where 'label' is the + property of the + + + + + Default Constructor + + + + + Copy the properties of this to the specified + object. + + The destination object + + + + Creates a new CurveItem using the PointPairList and add it the the given pane. + + the GraphPane object to which to add the new curve + a PointPairList collection defining the points for this curve + the newly created CurveItem added to the given GraphPane + This method must be overriden by childs + + + + Proxy property that gets or sets the value of . + + Gets or sets the value of this . + Minimum value is 0. + + + + + Proxy property that gets or sets the value of . + + Gets or sets the a value which determines the amount, if any, of + this displacement. + + + + + Proxy property that gets or sets the value of . + + Gets or sets the to be used in displaying + labels. + + + + + Proxy property that gets or sets the value of . + + Gets or sets the number of decimal digits to be displayed in a + value label. + + + + + Proxy property that gets or sets the value of . + + Gets or sets the number of decimal digits to be displayed in a + percent label. + + + + + Proxy property that gets or sets the value of . + + Gets or sets the to be used + for displaying this 's label. + + + + + Proxy property that gets or sets the object for + this . + + + + + + Baseclass for graph items in the web control + + + Darren Martz + + + + Override the ToString() method. + + Always returns the string "GraphObj". + + + + Default constructor + + + + + Copy the properties of this to the specified + object. + + The destination object + + + + Proxy property that gets or sets the value of + + + + + Proxy property that gets or sets the value of + + + + + Proxy property that gets or sets the value of + + + + + Manages a collection of objects that are + state management aware. + + Darren Martz + + + + Override the ToString() method. + + Always returns String.Empty + + + + Default constructor + + + + + Add a to this collection. + + The to be added. + + + + + Indexer to access the specified object by + its ordinal position in the list. + + The ordinal position (zero-based) of the + object to be accessed. + A object reference. + + + + + Manages a collection of objects that are + state management aware. + + Darren Martz + + + + Override the ToString() method. + + Always returns String.Empty + + + + Default Constructor + + + + + Add a to this collection. + + The to be added. + + + + + Indexer to access the specified object by + its ordinal position in the list. + + The ordinal position (zero-based) of the + object to be accessed. + A object reference. + + + + + Manages a collection of objects that are + state management aware. + + Darren Martz + + + + Override the ToString() method. + + Always returns String.Empty + + + + Default Constructor + + + + + Add a to the collection. + + The object to be added + + + + Indexer to access the specified object by + its ordinal position in the list. + + The ordinal position (zero-based) of the + object to be accessed. + A object reference. + + + + + Manages a collection of objects that are + state management aware. + + Darren Martz + + + + Override the ToString() method. + + Always returns String.Empty + + + + Default Constructor + + + + + Add a to this collection. + + The to be added. + + + + + Indexer to access the specified object by + its ordinal position in the list. + + The ordinal position (zero-based) of the + object to be accessed. + A object reference. + + + + + A Web PointPair class + + Darren Martz + + + + Identifies PointPair instance + + + + + + Default constructor + + + + + Copy the properties of this to the specified + object. + + The destination object + + + + Proxy property that gets or sets the value of + + + + + Proxy property that gets or sets the value of + + + + + Proxy property that gets or sets the value of + + + + + A Web String class + + Darren Martz + + + + Identifies fontspec instance + + + + + + Default constructor + + + + + Proxy property that gets or sets the value of + + + + + Web control state management class for a object + + Darren Martz + + + + Web control state management class for a object + + Darren Martz + + + + Identifies by the value + + A string containing "Axis: title", where 'title' is the + property of the + + + + + Default constructor + + + + + Copy the properties of this to the specified + object. + + The destination object + + + + Proxy property that gets or sets the value of . + + This property allows the axis to be shifted away from its default location. + For example, for a graph with an X range from -100 to +100, the Y Axis can be located + at the X=0 value rather than the left edge of the ChartRect. This value can be set + automatically based on the state of . If + this value is set manually, then will + also be set to false. The "other" axis is the axis the handles the second dimension + for the graph. For the XAxis, the "other" axis is the YAxis. For the YAxis or + Y2Axis, the "other" axis is the XAxis. + + The value is defined in user scale units + + + + Proxy property that gets or sets the value of . + + Determines whether or not the axis intersection point + is set automatically. + + + + + Proxy property that gets or sets the value of . + + This affects only the grid lines, since the and + both have their own color specification. + + + + + Proxy property that gets or sets the value of . + + The title normally shows the basis and dimensions of + the scale range, such as "Time (Years)". The title is only shown if the + property is set to true. If the Title text is empty, + then no title is shown, and no space is "reserved" for the title on the graph. + + + + + Proxy property that gets or sets the value of . + + This is the minimum axis space allocation. + This term, expressed in points (1/72 inch) and scaled according to + for the , determines the minimum amount of space + an axis must have between the and the + . This minimum space + applies whether is true or false. + + + + + Proxy property that gets or sets the value of . + + This property determines whether or not the major tics will be drawn + inbetween the labels, rather than right at the labels. Note that this setting is only + applicable if = . + + + + + Proxy property that gets or sets the value of . + + This boolean value determines if a line will be drawn at the + zero value for the axis. + + + + + Proxy property that gets or sets the value of . + + Determines whether or not the is shown. + + + + + Proxy property that gets or sets the value of . + + Determines the for this . + The type can be either , + , , + or . + + + + + Proxy property that gets or sets the value of . + + This property controls whether or not the magnitude factor (power of 10) for + this scale will be included in the label. + For large scale values, a "magnitude" value (power of 10) is automatically + used for scaling the graph. This magnitude value is automatically appended + to the end of the Axis (e.g., "(10^4)") to indicate + that a magnitude is in use. This property controls whether or not the + magnitude is included in the title. Note that it only affects the axis + title; a magnitude value may still be used even if it is not shown in the title. + + + + + Proxy property that gets or sets the value of + . + + Determines whether or not the + will be displayed. + + + + + Proxy property that gets or sets the value of . + + Determines if powers-of-ten notation will be used for the numeric value labels. + + + + + Proxy property that gets or sets the value of . + + This value determines if ZedGraph will check to + see if the scale labels are close enough to overlap. If so, + ZedGraph will adjust the step size to prevent overlap. + + + + + Proxy property that gets or sets the value of . + + Gets a reference to the class used to render + the + + + + + Proxy property to get or set the values for the minor grid. + + + + + Proxy property to get or set the values for the major grid. + + + + + Proxy property to get or set the values for the minor tics. + + + + + Proxy property to get or set the values for the major tics. + + + + + Proxy property to get or set the values for the axis scale. + + + + + Identifies by the value + + A string containing "XAxis: title", where 'title' is the + property of the + + + + + Default constructor. + + + + + Web control state management class for a object + + Darren Martz + + + + Identifies by the value + + A string containing "YAxis: title", where 'title' is the + property of the + + + + + Default constructor. + + + + + Web control state management class for a object + + Darren Martz + + + + Identifies by the value + + A string containing "Y2Axis: title", where 'title' is the + property of the + + + + + Default constructor. + + + + + Proxy class to manage all properties associated with a grid + + + + + Returns a string description of the class + + + + + Default constructor + + + + + Proxy property that gets or sets the value of . + + + + + Proxy property that gets or sets the value of . + + This property determines if the major gridlines + (at each labeled value) will be visible. + + + + + Proxy property that gets or sets the value of . + + This is the distance, + in points (1/72 inch), of the dash segments that make up the dashed grid lines. + + + + + Proxy property that gets or sets the value of . + + This is the distance, + in points (1/72 inch), of the spaces between the dash segments that make up + the dashed grid lines. + + + + + Proxy property that gets or sets the value of . + + The pen width used for drawing the grid lines, expressed in points (1/72nd inch). + + + + + Proxy class to manage all properties associated with a grid + + + + + Returns a string description of the class + + + + + Default constructor + + + + + Proxy property that gets or sets the color of the tics. + + + + + Proxy property that gets or sets the size of the tics. + + The length of the tic marks, expressed in points + (1/72nd inch). + + + + + Proxy property that gets or sets the value of . + + Determines whether or not the major tics (where the + scale labels are located) will be displayed. + + + + + Proxy property that gets or sets the value of . + + This value determines whether or not the major inside tic marks + are shown. These are the tic marks on the inside of the border. + The major tic spacing is controlled by . + + + + + Proxy property that gets or sets the value of . + + This value determines whether or not the major opposite tic marks + are shown. These are the tic marks on the inside of the border on + the opposite side from the axis. + The major tic spacing is controlled by . + + + + + Proxy property that gets or sets the value of . + + This property determines the pen width to be used when drawing the tic marks for + this . The pen width is expressed in points (1/72nd inch). + + + + + Proxy class to manage all properties associated with a grid + + + + + Returns a string description of the class + + + + + Default constructor + + + + + Copy the properties of this to the specified + object. + + The destination object + + + + Proxy property that gets or sets the value of . + + + + + Proxy property that gets or sets the value of . + + + + + Proxy property that gets or sets the value of . + + Determines whether or not the scale major step size value + + is set automatically. + + + + + Proxy property that gets or sets the value of . + + Determines whether or not the scale major step size value + + is set automatically. + + + + + Proxy property to handle the units for the + property. + + + + + Proxy property that gets or sets the value of . + + Determines whether or not the scale minor step size value + + is set automatically. + + + + + Proxy property that gets or sets the value of . + + Determines the minor step size value for the scale + is set automatically. + + + + + Proxy property to handle the units for the + property. + + + + + Proxy property that gets or sets the value of . + + Determines whether or not the minimum scale value + is set automatically. + + + + + Proxy property that gets or sets the value of . + + Determines whether or not the maximum scale value + is set automatically. + + + + + Proxy property that gets or sets the value of . + + This is the "grace" value applied to the minimum data range. + This value is expressed as a fraction of the total data range. For example, assume the data + range is from 4.0 to 16.0, leaving a range of 12.0. If MinGrace is set to + 0.1, then 10% of the range, or 1.2 will be subtracted from the minimum data value. + The scale will then be ranged to cover at least 2.8 to 16.0. + + + + + Proxy property that gets or sets the value of . + + This is the "grace" value applied to the maximum data range. + This value is expressed as a fraction of the total data range. For example, assume the data + range is from 4.0 to 16.0, leaving a range of 12.0. If MaxGrace is set to + 0.1, then 10% of the range, or 1.2 will be added to the maximum data value. + The scale will then be ranged to cover at least 4.0 to 17.2. + + + + + Proxy property that gets or sets the value of . + + Determines if the scale values are reversed for this . + + + + + Proxy property that gets or sets the value of . + + Determines whether or not the scale label format + is determined automatically based on the range of data values. + + + + + Proxy property that gets or sets the value of . + + The format of the tic labels. + This property is only used if the is set to . + This property may be set automatically by ZedGraph, depending on the state of + . + + + + + Proxy property that gets or sets the value of . + + Controls the alignment of the tic labels. + + + + + Proxy property that gets or sets the value of . + + The magnitude multiplier for scale values. + This is used to limit + the size of the displayed value labels. For example, if the value + is really 2000000, then the graph will display 2000 with a 10^3 + magnitude multiplier. This value can be determined automatically + depending on the state of . + If this value is set manually by the user, + then will also be set to false. + + + + + Proxy property that gets or sets the value of . + + Determines whether the value will be set + automatically based on the data, or manually by the user. + If the user manually sets the value, then this + flag will be set to false. + + + + + Proxy property that gets or sets the value of . + + Gets a reference to the class used to render + the scale values. + + + + + Web control state management class for a object + + Darren Martz + + + + Identifies legend instance + + Always returns the string "Legend". + + + + Default constructor + + + + + Copy the properties of this to the specified + object. + + The destination object + + + + Proxy property that gets the value of + + + + + Proxy property that gets the value of + + + + + Proxy property that gets the value of + + + + + Proxy property that gets the value of + + + + + Proxy property that gets or sets the value of . + + This property shows or hides the entirely. + + true to show the , false to hide it + + + + Proxy property that gets or sets the value of + + + + + Proxy property that gets or sets the value of . + + Sets or gets the location of the on the + using the enum type + + + + + Proxy property that gets or sets the value of + + + + + Web control state management class for a object + + Darren Martz + + + + Identifies fontspec instance + + Always returns the string "FontSpec". + + + + Default constructor + + + + + Copy the properties of this to the specified + object. + + The destination object + + + + Proxy property that gets or sets the value of . + + The angle at which this object is drawn. + + The angle of the font, measured in anti-clockwise degrees from + horizontal. Negative values are permitted. + + + + Proxy property that gets or sets the value of . + + The size of the font for this object. + + The size of the font, measured in points (1/72 inch). + + + + Proxy property that gets or sets the value of . + + The font family name for this . + + A text string with the font family name, e.g., "Arial" + + + + Proxy property that gets or sets the value of . + + The color of the font characters for this . + Note that the border and background + colors are set using the and + properties, respectively. + + A system reference. + + + + Proxy property that gets or sets the value of . + + Determines the alignment with which this + object is drawn. This alignment really only + affects multi-line strings. + + A enumeration. + + + + Proxy property that gets or sets the value of . + + Determines whether this is + drawn with bold typeface. + + A boolean value, true for bold, false for normal + + + + Proxy property that gets or sets the value of . + + Determines whether this is + drawn with an italic typeface. + + A boolean value, true for italic, false for normal + + + + Proxy property that gets or sets the value of . + + Determines whether this is + drawn with an underline typeface. + + A boolean value, true for underline, false for normal + + + + Proxy property that gets or sets the object for + this . + + + + + + Proxy property that gets or sets the object for + this . + + + + + + Rectangle class for margins + + Benjamin Mayrargue + + + + Override ToString + + + + + + Default constructor + + + + + + + + + + + + + + + + + + + + + Size class for a object + + Darren Martz + + + + Identifies fontspec instance + + + + + + Default constructor + + + + + Proxy property that gets or sets the value of + + + + + Proxy property that gets or sets the value of + + + + + Point class for a object + + Darren Martz + + + + Identifies fontspec instance + + + + + + Default constructor + + + + + Proxy property that gets or sets the value of + + + + + Proxy property that gets or sets the value of + + + + + Baseclass for graph items in the web control + + + Darren Martz + + A TextObj uses only: + FontSpec + Location + .CoordinateFrame () + .X (between 0 and 1 for fraction CoordTypes) 0=left, 1=right + .Y (between 0 and 1 for fraction CoordTypes) 0=top, 1=bottom + .AlignH + .AlignV + .layoutArea + + + + + Identifies curve item by the labels value + + + + + + Default constructor + + + + + Copy the properties of this to the specified + object. + + The destination object + + + + Proxy property that gets or sets the value of + + + + + Proxy property that gets the value of + + + + + Proxy property that gets the value of + + + + + Baseclass for graph items in the web control + + + Darren Martz + + + + Identifies curve item by the labels value + + + + + + Default constructor + + + + + Copy the properties of this to the specified + object. + + The destination object + + + + Proxy property that gets or sets the value of . + + The size of the arrowhead, expressed in points (1/72nd inch). + + + + + Proxy property that gets or sets the value of . + + The width of the pen, expressed in points (1/72nd inch), used to draw the + arrow line segment. + + + + + Proxy property that gets or sets the value of . + + The value used to draw the . + + + + + Proxy property that gets or sets the value of . + + Determines whether or not an arrowhead will be draw. If false, only a line segment + will be drawn. + + + + + Baseclass for graph items in the web control + + + Darren Martz + + + + Identifies curve item by the labels value + + + + + + Default constructor + + + + + Copy the properties of this to the specified + object. + + The destination object + + + + The url reference from which to get the + data for this . + + + + + Proxy property that gets or sets the value of . + + + Determines if the image will be scaled to the output rectangle (see ). + + true to scale the image, false to draw the image unscaled, but clipped + to the destination rectangle + + + + Baseclass for graph items in the web control + + + Darren Martz + + + + Identifies curve item by the labels value + + + + + + Default constructor + + + + + Copy the properties of this to the specified + object. + + The destination object + + + + Proxy property that gets or sets the object for + this . + + + + + + Proxy property that gets or sets the object for + this . + + + + + + Baseclass for graph items in the web control + + + Darren Martz + + + + Identifies curve item by the labels value + + + + + + Default constructor + + + + + Copy the properties of this to the specified + object. + + The destination object + + + + Proxy property that gets or sets the object for + this . + + + + + + Proxy property that gets or sets the object for + this . + + + + + + Location class for a object + + Darren Martz + + + + Identifies location instance + + + + + + Default constructor + + + + + Copy the properties of this to the specified + object. + + The destination object + + + + Proxy property that gets the value of + + + + + Proxy property that gets the value of + + + + + Proxy property that gets or sets the value of + + + + + Proxy property that gets or sets the value of + + + + + Proxy property that gets or sets the value of + + + + + Proxy property that gets or sets the value of + + + + + Proxy property that gets or sets the value of + + + + + Proxy property that gets or sets the value of + + + + + Proxy property that gets or sets the value of + + + + + The ZedGraphWeb class which remove temporary file + associated with this object. File is deleted when + this object is removed from cache. + + + + + Constructor + + + + + + Called when object removed from cache + + + + + + + + The ZedGraphWeb class provides a web control interface to the + class library. This allows ZedGraph to be used + from a web page with ASP.net. All graph + attributes are accessible via the + property. + + Darren Martz revised by John Champion revised by Benjamin Mayrargue + $Revision: 1.20 $ $Date: 2007-08-20 03:23:42 $ + + + + Override the method to do nothing. + + An empty string + + + + This private field contains duration (in hours) of a temp file generated + by control in mode "ImageTag" + + + + + Default constructor. + + + + + Renders the demo graph with one call. + + A object for which the drawing will be done. + A reference to the + + + + stub method that passes control for the render event to the the registered + event handler. + + + + + Adds content to the instance based on the web controls state elements. + This requires applying each to the + including all the values and sub objects. + + + + + + + Add the objects defined in the webcontrol to + the as objects. + + The instance of interest. + The object to receive the + objects. + + + + Provides binding between and the specified pane. Extracts the + data from and copies it into the appropriate + for each in the + specified . + + The object to be used for rendering the data. + The object which will receive the data. + + + + Calls the Draw() method for the control. + + An reference for the event. + + + + Method to create a class for the control. + + A in which to output the ZedGraph + . + The type to be output. + + + + + + + + if true, draw squares instead of leaving the + background transparent + + bShowTransparency is set to true in design mode, to false otherwise. + + + + + Override the Render() method with a do-nothing method. + + + + + + Generate an ImageMap as Html tags + + The source to be + image mapped. + An instance in which + the html tags will be written for the image map. + + + + Draws graph on HttpResponse object + + + + + + Draws graph on stream object + + + + + + Used by asp.net to load the viewstate values into the web control + + portable view state object + + + + Used by asp.net to save the viewstate to the class instance given a portable state object. + + portable state object + + + + Used by asp.net to inform the viewstate to start tracking changes. + + + + + Free up resources associated with the FileStream + + + + + + + + + + + + The name of the data member that contains the data to be + bound to the graph. + + + + + The object reference that points to a data source from which to bind curve data. + + + + + Proxy property that gets the value of the . + + + + + Proxy property that gets the value of the . + + + + + Gets or sets a value that determines the duration (in hours) of a temporary file generated + by control in mode "ImageTag" + + + + + Proxy property that gets or sets the value of the . + + + + + Proxy property that gets the value of the . + + + + + Proxy property that gets the value of the . + + + + + Proxy property that gets or sets the width of the . + + The width in output device pixels + + + + Proxy property that gets or sets the height of the . + + The height in output device pixels + + + + Proxy property that gets the value of the Margin + properties (, , + and ). + + + + + Proxy property that gets or sets the Title of the . + + A title + + + + Proxy property that gets or sets the value of , which + determines if the is visible. + + true to show the pane title, false otherwise + + + + Proxy property that gets or sets the value of . + + + + + Proxy property that gets or sets the value of . + + + + + Proxy property that gets or sets the value of the . + + + + + Proxy property that gets or sets the value of the . + + + + + Proxy property that gets or sets the value of the + . + + + + + Proxy property that gets or sets the value of the + . + + + + + Proxy property that gets or sets the value of . + + + + + Proxy property that gets or sets the value of . + + + + + Proxy property that gets or sets the value of . + + + + + Proxy property that gets the value of the + . + + + + + Proxy property that gets the value of the . + + + + + Proxy property that gets the value of the . + + + + + Proxy property that gets the value of the . + + + + + Proxy property that gets the value of the . + + + + + Proxy property that gets the value of the . + + + + + Proxy property that gets the value of the . + + + + + Proxy property that gets the value of the . + + + + + Proxy property that gets the value of the . + + + + + Optional setting that determines how long the cached image will remain valid. + A zero value disables caching. + + + + + + Optional cache file suffix that can be used to modify the output cache file name + to make it unique. + + + + + + Gets or sets a boolean flag value that, if true, will cause the + method to be called when + is called. + + A boolean value, true to call , + false otherwise + + + + Proxy property that gets or sets the value that determines the output format for the control, in the + form of a enumeration. This is typically Gif, Jpeg, + Png, or Icon. + + A enumeration. + + + + What to return ? + A raw image or an IMG tag referencing a generated image ? + + + + + What to return ? + A raw image or an IMG tag referencing a generated image ? + + + + + Proxy property that gets or sets the value of . + + + + + Sets the rendering event handler. + + An event type for the RenderGraph event + + + + Gets the property, translated to an + enumeration. + + An enumeration representing the image type + to be output. + + + + Gets the current image format file extension + + + + + Gets the property, translated to an + html content type string (such as "image/png"). + + A string representing the image type to be output. + + + + An enumeration type that defines the output image types supported by + the ZedGraph Web control. + + + + + The Gif bitmap format (CompuServe) + + + + + The JPEG format + + + + + A windows Icon format + + + + + The portable network graphics format + + + + + A delegate to handle the rendering event for this control. + + A reference to this object + A object for which the drawing will be done. + A reference to the + class to be rendered. + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/ZedGraph.Web.dll b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/ZedGraph.Web.dll new file mode 100644 index 0000000..9e3500a --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/ZedGraph.Web.dll Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/ZedGraph.XML b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/ZedGraph.XML new file mode 100644 index 0000000..5d21e57 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/ZedGraph.XML @@ -0,0 +1,25465 @@ + + + + ZedGraph + + + + + The ZedGraphControl class provides a UserControl interface to the + class library. This allows ZedGraph to be installed + as a control in the Visual Studio toolbox. You can use the control by simply + dragging it onto a form in the Visual Studio form editor. All graph + attributes are accessible via the + property. + + John Champion revised by Jerry Vos + $Revision: 3.86 $ $Date: 2007-11-03 04:41:29 $ + + + + Gets the graph pane's current image. + + + + When the control has been disposed before this call. + + + + + Handle a MouseDown event in the + + A reference to the + A instance + + + + Set the cursor according to the current mouse location. + + + + + Set the cursor according to the current mouse location. + + + + + Handle a KeyUp event + + The in which the KeyUp occurred. + A instance. + + + + Handle the Key Events so ZedGraph can Escape out of a panning or zooming operation. + + + + + + + Handle a MouseUp event in the + + A reference to the + A instance + + + + Make a string label that corresponds to a user scale value. + + The axis from which to obtain the scale value. This determines + if it's a date value, linear, log, etc. + The value to be made into a label + The ordinal position of the value + true to override the ordinal settings of the axis, + and prefer the actual value instead. + The string label. + + + + protected method for handling MouseMove events to display tooltips over + individual datapoints. + + + A reference to the control that has the MouseMove event. + + + A MouseEventArgs object. + + + + + Handle a MouseWheel event in the + + A reference to the + A instance + + + + Zoom a specified pane in or out according to the specified zoom fraction. + + + The zoom will occur on the , , and + only if the corresponding flag, or + , is true. Note that if there are multiple Y or Y2 axes, all of + them will be zoomed. + + The instance to be zoomed. + The fraction by which to zoom, less than 1 to zoom in, greater than + 1 to zoom out. For example, 0.9 will zoom in such that the scale is 90% of what it was + originally. + The screen position about which the zoom will be centered. This + value is only used if is true. + + true to cause the zoom to be centered on the point + , false to center on the . + + true to force a refresh of the control, false to leave it unrefreshed + + + + Zoom a specified pane in or out according to the specified zoom fraction. + + + The zoom will occur on the , , and + only if the corresponding flag, or + , is true. Note that if there are multiple Y or Y2 axes, all of + them will be zoomed. + + The instance to be zoomed. + The fraction by which to zoom, less than 1 to zoom in, greater than + 1 to zoom out. For example, 0.9 will zoom in such that the scale is 90% of what it was + originally. + The screen position about which the zoom will be centered. This + value is only used if is true. + + true to cause the zoom to be centered on the point + , false to center on the . + + + + + Zoom the specified axis by the specified amount, with the center of the zoom at the + (optionally) specified point. + + + This method is used for MouseWheel zoom operations + The to be zoomed. + The zoom fraction, less than 1.0 to zoom in, greater than 1.0 to + zoom out. That is, a value of 0.9 will zoom in such that the scale length is 90% of what + it previously was. + The location for the center of the zoom. This is only used if + is true. + true if the zoom is to be centered at the + screen position, false for the zoom to be centered within + the . + + + + + Handle a panning operation for the specified . + + The to be panned + The value where the pan started. The scale range + will be shifted by the difference between and + . + + The value where the pan ended. The scale range + will be shifted by the difference between and + . + + + + + Perform selection on curves within the drag pane, or under the mouse click. + + + + + + + This private field contains the instance for the MasterPane object of this control. + You can access the MasterPane object through the public property + . This is nulled when this Control is + disposed. + + + + + private field that determines whether or not tooltips will be displayed + when the mouse hovers over data values. Use the public property + to access this value. + + + + + private field that determines whether or not tooltips will be displayed + showing the scale values while the mouse is located within the ChartRect. + Use the public property to access this value. + + + + + private field that determines the format for displaying tooltip values. + This format is passed to . + Use the public property to access this + value. + + + + + private field that determines whether or not the context menu will be available. Use the + public property to access this value. + + + + + private field that determines whether or not a message box will be shown in response to + a context menu "Copy" command. Use the + public property to access this value. + + + Note that, if this value is set to false, the user will receive no indicative feedback + in response to a Copy action. + + + + + private field that determines whether the settings of + and + will be overridden to true during printing operations. + + + Printing involves pixel maps that are typically of a dramatically different dimension + than on-screen pixel maps. Therefore, it becomes more important to scale the fonts and + lines to give a printed image that looks like what is shown on-screen. The default + setting for is true, but the default + setting for is false. + + + A value of true will cause both and + to be temporarily set to true during + printing operations. + + + + + private field that determines whether or not the visible aspect ratio of the + will be preserved + when printing this . + + + + + private field that determines whether or not the + dimensions will be expanded to fill the + available space when printing this . + + + If is also true, then the + dimensions will be expanded to fit as large + a space as possible while still honoring the visible aspect ratio. + + + + + private field that determines the format for displaying tooltip date values. + This format is passed to . + Use the public property to access this + value. + + + + + private value that determines whether or not zooming is enabled for the control in the + vertical direction. Use the public property to access this + value. + + + + + private value that determines whether or not zooming is enabled for the control in the + horizontal direction. Use the public property to access this + value. + + + + + private value that determines whether or not zooming is enabled with the mousewheel. + Note that this property is used in combination with the and + properties to control zoom options. + + + + + private value that determines whether or not point editing is enabled in the + vertical direction. Use the public property to access this + value. + + + + + private value that determines whether or not point editing is enabled in the + horizontal direction. Use the public property to access this + value. + + + + + private value that determines whether or not panning is allowed for the control in the + horizontal direction. Use the + public property to access this value. + + + + + private value that determines whether or not panning is allowed for the control in the + vertical direction. Use the + public property to access this value. + + + + + Internal variable that indicates if the control can manage selections. + + + + + private field that stores a instance, which maintains + a persistent selection of printer options. + + + This is needed so that a "Print" action utilizes the settings from a prior + "Page Setup" action. + + + + This private field contains a list of selected CurveItems. + + + + + Gets or sets a value that determines which Mouse button will be used to click on + linkable objects + + + + + + Gets or sets a value that determines which modifier keys will be used to click + on linkable objects + + + + + + Gets or sets a value that determines which Mouse button will be used to edit point + data values + + + This setting only applies if and/or + are true. + + + + + + Gets or sets a value that determines which modifier keys will be used to edit point + data values + + + This setting only applies if and/or + are true. + + + + + + Gets or sets a value that determines which mouse button will be used to select + 's. + + + This setting only applies if is true. + + + + + + Gets or sets a value that determines which modifier keys will be used to select + 's. + + + This setting only applies if is true. + + + + + + Gets or sets a value that determines which Mouse button will be used to perform + zoom operations + + + This setting only applies if and/or + are true. + + + + + + + + Gets or sets a value that determines which modifier keys will be used to perform + zoom operations + + + This setting only applies if and/or + are true. + + + + + + + + Gets or sets a value that determines which Mouse button will be used as a + secondary option to perform zoom operations + + + This setting only applies if and/or + are true. + + + + + + + + Gets or sets a value that determines which modifier keys will be used as a + secondary option to perform zoom operations + + + This setting only applies if and/or + are true. + + + + + + + + Gets or sets a value that determines which Mouse button will be used to perform + panning operations + + + This setting only applies if and/or + are true. A Pan operation (dragging the graph with + the mouse) should not be confused with a scroll operation (using a scroll bar to + move the graph). + + + + + + + + Gets or sets a value that determines which modifier keys will be used to perform + panning operations + + + This setting only applies if and/or + are true. A Pan operation (dragging the graph with + the mouse) should not be confused with a scroll operation (using a scroll bar to + move the graph). + + + + + + + + Gets or sets a value that determines which Mouse button will be used as a + secondary option to perform panning operations + + + This setting only applies if and/or + are true. A Pan operation (dragging the graph with + the mouse) should not be confused with a scroll operation (using a scroll bar to + move the graph). + + + + + + + + Gets or sets a value that determines which modifier keys will be used as a + secondary option to perform panning operations + + + This setting only applies if and/or + are true. A Pan operation (dragging the graph with + the mouse) should not be confused with a scroll operation (using a scroll bar to + move the graph). + + + + + + + + Internal variable that indicates the control is currently being zoomed. + + + + + Internal variable that indicates the control is currently being panned. + + + + + Internal variable that indicates a point value is currently being edited. + + + + + Internal variable that indicates the control is currently using selection. + + + + + Internal variable that stores the reference for the Pane that is + currently being zoomed or panned. + + + + + Internal variable that stores a rectangle which is either the zoom rectangle, or the incremental + pan amount since the last mousemove event. + + + + + private field that stores the state of the scale ranges prior to starting a panning action. + + + + + Default Constructor + + + + + Clean up any resources being used. + + true if the components should be + disposed, false otherwise + + + + Called by the system to update the control on-screen + + + A PaintEventArgs object containing the Graphics specifications + for this Paint event. + + + + + Called when the control has been resized. + + + A reference to the control that has been resized. + + + An EventArgs object. + + + + This performs an axis change command on the graphPane. + + + This is the same as + ZedGraphControl.GraphPane.AxisChange( ZedGraphControl.CreateGraphics() ), however, + this method also calls if + is true. + + + + + Save the current states of the GraphPanes to a separate collection. Save a single + () GraphPane if the panes are not synchronized + (see and ), + or save a list of states for all GraphPanes if the panes are synchronized. + + The primary GraphPane on which zoom/pan/scroll operations + are taking place + The that describes the + current operation + The that corresponds to the + . + + + + + Restore the states of the GraphPanes to a previously saved condition (via + . This is essentially an "undo" for live + pan and scroll actions. Restores a single + () GraphPane if the panes are not synchronized + (see and ), + or save a list of states for all GraphPanes if the panes are synchronized. + + The primary GraphPane on which zoom/pan/scroll operations + are taking place + + + + Place the previously saved states of the GraphPanes on the individual GraphPane + collections. This provides for an + option to undo the state change at a later time. Save a single + () GraphPane if the panes are not synchronized + (see and ), + or save a list of states for all GraphPanes if the panes are synchronized. + + The primary GraphPane on which zoom/pan/scroll operations + are taking place + The that corresponds to the + . + + + + + Clear the collection of saved states. + + + + + Clear all states from the undo stack for each GraphPane. + + + + + Sets the value of the scroll range properties (see , + , , and + based on the actual range of the data for + each corresponding . + + + This method is called automatically by if + + is true. Note that this will not be called if you call AxisChange directly from the + . For example, zedGraphControl1.AxisChange() works properly, but + zedGraphControl1.GraphPane.AxisChange() does not. + + + + Handler for the "Page Setup..." context menu item. Displays a + . + + + + + + + Handler for the "Print..." context menu item. Displays a + . + + + + + + + Rendering method used by the print context menu items + + The applicable . + A instance providing + page bounds, margins, and a Graphics instance for this printed output. + + + + + Display a to the user, allowing them to modify + the print settings for this . + + + + + Display a to the user, allowing them to select a + printer and print the contained in this + . + + + + + Display a , allowing the user to preview and + subsequently print the contained in this + . + + + + + Required designer variable. + + + + + Required method for Designer support - do not modify + the contents of this method with the code editor. + + + + + Find the object currently under the mouse cursor, and return its state. + + + + + protected method to handle the popup context menu in the . + + + + + + + Handler for the "Copy" context menu item. Copies the current image to a bitmap on the + clipboard. + + + + + + + Handler for the "Copy" context menu item. Copies the current image to a bitmap on the + clipboard. + + boolean value that determines whether or not a prompt will be + displayed. true to show a message of "Image Copied to ClipBoard". + + + + A threaded version of the copy method to avoid crash with MTA + + + + + Setup for creation of a new image, applying appropriate anti-alias properties and + returning the resultant image file + + + + + + Special handler that copies the current image to an Emf file on the clipboard. + + This version is similar to the regular method, except that + it will place an Emf image (vector) on the ClipBoard instead of the regular bitmap. + boolean value that determines whether or not a prompt will be + displayed. true to show a message of "Image Copied to ClipBoard". + + + + A threaded version of the copy method to avoid crash with MTA + + + + + Handler for the "Save Image As" context menu item. Copies the current image to the selected + file. + + + + + + + Handler for the "Save Image As" context menu item. Copies the current image to the selected + file in either the Emf (vector), or a variety of Bitmap formats. + + + Note that and methods are provided + which allow for Bitmap-only or Emf-only handling of the "Save As" context menu item. + + + + + Copies the current image to the selected file in + Emf (vector), or a variety of Bitmap formats. + + + Accepts a default file name for the file dialog (if "" or null, default is not used) + + + The file name saved, or "" if cancelled. + + + Note that and methods are provided + which allow for Bitmap-only or Emf-only handling of the "Save As" context menu item. + + + + + Handler for the "Save Image As" context menu item. Copies the current image to the selected + Bitmap file. + + + Note that this handler saves as a bitmap only. The default handler is + , which allows for Bitmap or EMF formats + + + + + Handler for the "Save Image As" context menu item. Copies the current image to the selected + Emf format file. + + + Note that this handler saves as an Emf format only. The default handler is + , which allows for Bitmap or EMF formats. + + + + + Save the current Graph to the specified filename in EMF (vector) format. + See for public access. + + + Note that this handler saves as an Emf format only. The default handler is + , which allows for Bitmap or EMF formats. + + + + + Handler for the "Show Values" context menu item. Toggles the + property, which activates the point value tooltips. + + + + + + + Handler for the "Set Scale to Default" context menu item. Sets the scale ranging to + full auto mode for all axes. + + + This method differs from the method in that it sets the scales + to full auto mode. The method sets the scales to their initial + setting prior to any user actions (which may or may not be full auto mode). + + + + + + + Handler for the "Set Scale to Default" context menu item. Sets the scale ranging to + full auto mode for all axes. + + + This method differs from the method in that it sets the scales + to full auto mode. The method sets the scales to their initial + setting prior to any user actions (which may or may not be full auto mode). + + The object which is to have the + scale restored + + + + Handler for the "UnZoom/UnPan" context menu item. Restores the scale ranges to the values + before the last zoom or pan operation. + + + + + + + Handler for the "UnZoom/UnPan" context menu item. Restores the scale ranges to the values + before the last zoom, pan, or scroll operation. + + + Triggers a for any type of undo (including pan, scroll, zoom, and + wheelzoom). This method will affect all the + objects in the if + or is true. + + The primary object which is to be + zoomed out + + + + Handler for the "Undo All Zoom/Pan" context menu item. Restores the scale ranges to the values + before all zoom and pan operations + + + This method differs from the method in that it sets the scales + to their initial setting prior to any user actions. The method + sets the scales to full auto mode (regardless of what the initial setting may have been). + + + + + + + Handler for the "Undo All Zoom/Pan" context menu item. Restores the scale ranges to the values + before all zoom and pan operations + + + This method differs from the method in that it sets the scales + to their initial setting prior to any user actions. The method + sets the scales to full auto mode (regardless of what the initial setting may have been). + + The object which is to be zoomed out + + + + Gets or sets a value that determines which mouse button will be used as a primary option + to trigger a zoom event. + + + This value is combined with to determine the actual zoom combination. + A secondary zoom button/key combination option is available via and + . To not use this button/key combination, set the value + of to . + + + + + Gets or sets a value that determines which mouse button will be used as the secondary option + to trigger a zoom event. + + + This value is combined with to determine the actual zoom combination. + The primary zoom button/key combination option is available via and + . To not use this button/key combination, set the value + of to . + + + + + Gets or sets a value that determines which modifier keys will be used as a primary option + to trigger a zoom event. + + + This value is combined with to determine the actual zoom combination. + A secondary zoom button/key combination option is available via and + . To not use this button/key combination, set the value + of to . + + + + + Gets or sets a value that determines which modifier keys will be used as a secondary option + to trigger a zoom event. + + + This value is combined with to determine the actual zoom combination. + A primary zoom button/key combination option is available via and + . To not use this button/key combination, set the value + of to . + + + + + Gets or sets a value that determines which mouse button will be used as a primary option + to trigger a pan event. + + + This value is combined with to determine the actual pan combination. + A secondary pan button/key combination option is available via and + . To not use this button/key combination, set the value + of to . + + + + + Gets or sets a value that determines which mouse button will be used as the secondary option + to trigger a pan event. + + + This value is combined with to determine the actual pan combination. + The primary pan button/key combination option is available via and + . To not use this button/key combination, set the value + of to . + + + + + Gets or sets a value that determines which modifier keys will be used as a primary option + to trigger a pan event. + + + This value is combined with to determine the actual pan combination. + A secondary pan button/key combination option is available via and + . To not use this button/key combination, set the value + of to . + + + + + Gets or sets a value that determines which modifier keys will be used as a secondary option + to trigger a pan event. + + + This value is combined with to determine the actual pan combination. + A primary pan button/key combination option is available via and + . To not use this button/key combination, set the value + of to . + + + + + Gets or sets a value that determines which Mouse button will be used to edit point + data values + + + This setting only applies if and/or + are true. + + + + + + Gets or sets a value that determines which modifier keys will be used to edit point + data values + + + This setting only applies if and/or + are true. + + + + + + Gets or sets a value that determines which Mouse button will be used to + select 's. + + + This setting only applies if is true. + + + + + + Gets or sets a value that determines which Modifier keys will be used to + select 's. + + + This setting only applies if is true. + + + + + + Gets or sets a value that determines which Modifier keys will be used to + append a to the selection list. + + + + + Gets or sets a value that determines which Mouse button will be used to click + on linkable objects + + + + + + + Gets or sets a value that determines which modifier keys will be used to click + on linkable objects + + + + + + + Gets or sets the property for the control + + + + + Gets or sets the property for the control + + + actually uses a object + to hold a list of objects. This property really only + accesses the first in the list. If there is more + than one , use the + indexer property to access any of the objects. + + + + Gets or sets a value that determines if all drawing operations for this control + will be forced to operate in Anti-alias mode. Note that if this value is set to + "true", it overrides the setting for sub-objects. Otherwise, the sub-object settings + (such as ) + will be honored. + + + + + Gets or sets a value that determines whether or not tooltips will be displayed + when the mouse hovers over data values. + + The displayed values are taken from + if it is a type, or + otherwise (using the as a format string). + Additionally, the user can custom format the values using the + event. Note that + may be overridden by . + + + + + Gets or sets a value that determines whether or not tooltips will be displayed + showing the current scale values when the mouse is within the + . + + The displayed values are taken from the current mouse position, and formatted + according to and/or . If this + value is set to true, it overrides the setting. + + + + + Gets or sets a value that determines whether or not editing of point data is allowed in + the horizontal direction. + + + Editing is done by holding down the Alt key, and left-clicking on an individual point of + a given to drag it to a new location. The Mouse and Key + combination for this mode are modifiable using and + . + + + + + + + + Gets or sets a value that determines whether or not editing of point data is allowed in + the vertical direction. + + + Editing is done by holding down the Alt key, and left-clicking on an individual point of + a given to drag it to a new location. The Mouse and Key + combination for this mode are modifiable using and + . + + + + + Gets or sets a value that determines whether or not zooming is allowed for the control. + + + Zooming is done by left-clicking inside the to drag + out a rectangle, indicating the new scale ranges that will be part of the graph. + + + + + Gets or sets a value that determines whether or not zooming is allowed for the control in + the horizontal direction. + + + Zooming is done by left-clicking inside the to drag + out a rectangle, indicating the new scale ranges that will be part of the graph. + + + + + Gets or sets a value that determines whether or not zooming is allowed for the control in + the vertical direction. + + + Zooming is done by left-clicking inside the to drag + out a rectangle, indicating the new scale ranges that will be part of the graph. + + + + + Gets or sets a value that determines whether or not zooming is allowed via the mouse wheel. + + + Wheel zooming is done by rotating the mouse wheel. + Note that this property is used in combination with the and + properties to control zoom options. + + + + + Gets or sets a value that determines whether or not panning is allowed for the control in + the horizontal direction. + + + Panning is done by clicking the middle mouse button (or holding down the shift key + while clicking the left mouse button) inside the and + dragging the mouse around to shift the scale ranges as desired. + + + + + + Gets or sets a value that determines whether or not panning is allowed for the control in + the vertical direction. + + + Panning is done by clicking the middle mouse button (or holding down the shift key + while clicking the left mouse button) inside the and + dragging the mouse around to shift the scale ranges as desired. + + + + + + Gets or sets a value that determines whether or not the context menu will be available. + + The context menu is a menu that appears when you right-click on the + . It provides options for Zoom, Pan, AutoScale, Clipboard + Copy, and toggle . + + true to allow the context menu, false to disable it + + + + Gets or sets a value that determines whether or not a message box will be shown + in response to a context menu "Copy" command. + + + Note that, if this property is set to false, the user will receive no + indicative feedback in response to a Copy action. + + + + + Gets or sets the instance that will be used + by the "Save As..." context menu item. + + + This provides the opportunity to modify the dialog, such as setting the + property. + + + + + Gets or sets a value that determines whether or not the visible aspect ratio of the + will be preserved + when printing this . + + + + + Gets or sets a value that determines whether or not the + dimensions will be expanded to fill the + available space when printing this . + + + If is also true, then the + dimensions will be expanded to fit as large + a space as possible while still honoring the visible aspect ratio. + + + + + Gets or sets a value that determines whether the settings of + and + will be overridden to true during printing operations. + + + Printing involves pixel maps that are typically of a dramatically different dimension + than on-screen pixel maps. Therefore, it becomes more important to scale the fonts and + lines to give a printed image that looks like what is shown on-screen. The default + setting for is true, but the default + setting for is false. + + + A value of true will cause both and + to be temporarily set to true during + printing operations. + + + + + Gets or sets a value that controls whether or not the axis value range for the scroll + bars will be set automatically. + + + If this value is set to true, then the range of the scroll bars will be set automatically + to the actual range of the data as returned by at the + time that was last called. Note that a value of true + can override any setting of , , + , , + , and . Note also that you must + call from the for this to + work properly (e.g., don't call it directly from the . + Alternatively, you can call at anytime to set + the scroll bar range.
+ In most cases, you will probably want to disable + before activating this option. +
+
+ + + Set a "grace" value that leaves a buffer area around the data when + is true. + + + This value represents a fraction of the total range around each axis. For example, if the + axis ranges from 0 to 100, then a 0.05 value for ScrollGrace would set the scroll range + to -5 to 105. + + + + + Gets or sets a value that determines if the horizontal scroll bar will be visible. + + This scroll bar allows the display to be scrolled in the horizontal direction. + Another option is display panning, in which the user can move the display around by + clicking directly on it and dragging (see and ). + You can control the available range of scrolling with the and + properties. Note that the scroll range can be set automatically by + .
+ In most cases, you will probably want to disable + before activating this option. +
+ A boolean value. true to display a horizontal scrollbar, false otherwise. +
+ + + Gets or sets a value that determines if the vertical scroll bar will be visible. + + This scroll bar allows the display to be scrolled in the vertical direction. + Another option is display panning, in which the user can move the display around by + clicking directly on it and dragging (see and ). + You can control the available range of scrolling with the and + properties. + Note that the vertical scroll bar only affects the ; it has no impact on + the . The panning options affect both the and + . Note also that the scroll range can be set automatically by + .
+ In most cases, you will probably want to disable + before activating this option. +
+ A boolean value. true to display a vertical scrollbar, false otherwise. +
+ + + Gets or sets a value that determines if the + ranges for all objects in the will + be forced to match. + + + If set to true (default is false), then all of the objects + in the associated with this + will be forced to have matching scale ranges for the x axis. That is, zoom, pan, + and scroll operations will result in zoom/pan/scroll for all graphpanes simultaneously. + + + + + Gets or sets a value that determines if the + ranges for all objects in the will + be forced to match. + + + If set to true (default is false), then all of the objects + in the associated with this + will be forced to have matching scale ranges for the y axis. That is, zoom, pan, + and scroll operations will result in zoom/pan/scroll for all graphpanes simultaneously. + + + + + Gets or sets a value that determines if the vertical scroll bar will affect the Y2 axis. + + + The vertical scroll bar is automatically associated with the Y axis. With this value, you + can choose to include or exclude the Y2 axis with the scrolling. Note that the Y2 axis + scrolling is handled as a secondary. The vertical scroll bar position always reflects + the status of the Y axis. This can cause the Y2 axis to "jump" when first scrolled if + the and values are not set to the + same proportions as and with respect + to the actual and . Also note that + this property is actually just an alias to the + property of the first element of . + + + + + + + + + + Access the for the Y axes. + + + This list maintains the user scale ranges for the scroll bars for each axis + in the . Each ordinal location in + corresponds to an equivalent ordinal location + in . + + + + + + + Access the for the Y2 axes. + + + This list maintains the user scale ranges for the scroll bars for each axis + in the . Each ordinal location in + corresponds to an equivalent ordinal location + in . + + + + + + + The minimum value for the X axis scroll range. + + + Effectively, the minimum endpoint of the scroll range will cause the + value to be set to . Note that this + value applies only to the scroll bar settings. Axis panning (see ) + is not affected by this value. Note that this value can be overridden by + and . + + A double value indicating the minimum axis value + + + + The maximum value for the X axis scroll range. + + + Effectively, the maximum endpoint of the scroll range will cause the + value to be set to . Note that this + value applies only to the scroll bar settings. Axis panning (see ) + is not affected by this value. Note that this value can be overridden by + and . + + A double value indicating the maximum axis value + + + + The minimum value for the Y axis scroll range. + + + Effectively, the minimum endpoint of the scroll range will cause the + value to be set to . Note that this + value applies only to the scroll bar settings. Axis panning (see ) + is not affected by this value. Note that this value can be overridden by + and . Also note that + this property is actually just an alias to the + property of the first element of . + + A double value indicating the minimum axis value + + + + + The maximum value for the Y axis scroll range. + + + Effectively, the maximum endpoint of the scroll range will cause the + value to be set to . Note that this + value applies only to the scroll bar settings. Axis panning (see ) + is not affected by this value. Note that this value can be overridden by + and . Also note that + this property is actually just an alias to the + property of the first element of . + + A double value indicating the maximum axis value + + + + + The minimum value for the Y2 axis scroll range. + + + Effectively, the minimum endpoint of the scroll range will cause the + value to be set to . Note that this + value applies only to the scroll bar settings. Axis panning (see ) + is not affected by this value. Note that this value can be overridden by + and . Also note that + this property is actually just an alias to the + property of the first element of . + + A double value indicating the minimum axis value + + + + + The maximum value for the Y2 axis scroll range. + + + Effectively, the maximum endpoint of the scroll range will cause the + value to be set to . Note that this + value applies only to the scroll bar settings. Axis panning (see ) + is not affected by this value. Note that this value can be overridden by + and . Also note that + this property is actually just an alias to the + property of the first element of . + + A double value indicating the maximum axis value + + + + + Returns true if the user is currently scrolling via the scrollbar, or + false if no scrolling is taking place. + + + This method just tests ScrollBar.Capture to see if the + mouse has been captured by the scroll bar. If so, scrolling is active. + + + + + Gets or sets the format for displaying tooltip values. + This format is passed to . + + + Use the type + to determine the format strings. + + + + + Gets or sets the format for displaying tooltip values. + This format is passed to . + + + Use the type + to determine the format strings. + + + + + Gets or sets the step size fraction for zooming with the mouse wheel. + A value of 0.1 will result in a 10% zoom step for each mouse wheel movement. + + + + + Gets or sets a boolean value that determines if zooming with the wheel mouse + is centered on the mouse location, or centered on the existing graph. + + + + + This checks if the control has been disposed. This is synonymous with + the graph pane having been nulled or disposed. Therefore this is the + same as ZedGraphControl.GraphPane == null. + + + + + Readonly property that gets the list of selected CurveItems + + + + + Gets or sets a value that determines whether or not selection is allowed for the control. + + + + + Subscribe to this event to be able to modify the ZedGraph context menu. + + + The context menu is built on the fly after a right mouse click. You can add menu items + to this menu by simply modifying the parameter. + + + + + Subscribe to this event to be notified when the is zoomed or panned by the user, + either via a mouse drag operation or by the context menu commands. + + + + + Subscribe to this event to be notified when the is scrolled by the user + using the scrollbars. + + + + + Subscribe to this event to be notified when the is scrolled by the user + using the scrollbars. + + + + + Subscribe to this event to be notified when the is scrolled by the user + using the scrollbars. + + + + + Subscribe to this event to receive notifcation and/or respond after a data + point has been edited via and . + + + To subscribe to this event, use the following in your Form_Load method: + zedGraphControl1.PointEditEvent += + new ZedGraphControl.PointEditHandler( MyPointEditHandler ); + Add this method to your Form1.cs: + + private string MyPointEditHandler( object sender, GraphPane pane, CurveItem curve, int iPt ) + { + PointPair pt = curve[iPt]; + return "This value is " + pt.Y.ToString("f2") + " gallons"; + } + + + + + Subscribe to this event to provide custom formatting for the tooltips + + + To subscribe to this event, use the following in your FormLoad method: + zedGraphControl1.PointValueEvent += + new ZedGraphControl.PointValueHandler( MyPointValueHandler ); + Add this method to your Form1.cs: + + private string MyPointValueHandler( object sender, GraphPane pane, CurveItem curve, int iPt ) + { + #region + PointPair pt = curve[iPt]; + return "This value is " + pt.Y.ToString("f2") + " gallons"; + #endregion + } + + + + + Subscribe to this event to provide custom formatting for the cursor value tooltips + + + To subscribe to this event, use the following in your FormLoad method: + zedGraphControl1.CursorValueEvent += + new ZedGraphControl.CursorValueHandler( MyCursorValueHandler ); + Add this method to your Form1.cs: + + private string MyCursorValueHandler( object sender, GraphPane pane, Point mousePt ) + { + #region + double x, y; + pane.ReverseTransform( mousePt, out x, out y ); + return "( " + x.ToString( "f2" ) + ", " + y.ToString( "f2" ) + " )"; + #endregion + } + + + + + Subscribe to this event to provide notification of MouseDown clicks on graph + objects + + + This event provides for a notification when the mouse is clicked on an object + within any of the associated + with this . This event will use the + method to determine which object + was clicked. The boolean value that you return from this handler determines whether + or not the will do any further handling of the + MouseDown event (see ). Return true if you have + handled the MouseDown event entirely, and you do not + want the to do any further action (e.g., starting + a zoom operation). Return false if ZedGraph should go ahead and process the + MouseDown event. + + + + + Hide the standard control MouseDown event so that the ZedGraphControl.MouseDownEvent + can be used. This is so that the user must return true/false in order to indicate + whether or not we should respond to the event. + + + + + Hide the standard control MouseUp event so that the ZedGraphControl.MouseUpEvent + can be used. This is so that the user must return true/false in order to indicate + whether or not we should respond to the event. + + + + + Hide the standard control MouseMove event so that the ZedGraphControl.MouseMoveEvent + can be used. This is so that the user must return true/false in order to indicate + whether or not we should respond to the event. + + + + + Subscribe to this event to provide notification of MouseUp clicks on graph + objects + + + This event provides for a notification when the mouse is clicked on an object + within any of the associated + with this . This event will use the + method to determine which object + was clicked. The boolean value that you return from this handler determines whether + or not the will do any further handling of the + MouseUp event (see ). Return true if you have + handled the MouseUp event entirely, and you do not + want the to do any further action (e.g., starting + a zoom operation). Return false if ZedGraph should go ahead and process the + MouseUp event. + + + + + Subscribe to this event to provide notification of MouseMove events over graph + objects + + + This event provides for a notification when the mouse is moving over on the control. + The boolean value that you return from this handler determines whether + or not the will do any further handling of the + MouseMove event (see ). Return true if you + have handled the MouseMove event entirely, and you do not + want the to do any further action. + Return false if ZedGraph should go ahead and process the MouseMove event. + + + + + Subscribe to this event to provide notification of Double Clicks on graph + objects + + + This event provides for a notification when the mouse is double-clicked on an object + within any of the associated + with this . This event will use the + method to determine which object + was clicked. The boolean value that you return from this handler determines whether + or not the will do any further handling of the + DoubleClick event (see ). Return true if you have + handled the DoubleClick event entirely, and you do not + want the to do any further action. + Return false if ZedGraph should go ahead and process the + DoubleClick event. + + + + + Subscribe to this event to be able to respond to mouse clicks within linked + objects. + + + Linked objects are typically either type objects or + type objects. These object types can include + hyperlink information allowing for "drill-down" type operation. + + + + CurveItem.Link + GraphObj.Link + + + + Gets or sets the instance + that is used for all of the context menu printing functions. + + + + + A delegate that allows subscribing methods to append or modify the context menu. + + The source object + A reference to the object + that contains the context menu. + + The point at which the mouse was clicked + The current context menu state + + + + + A delegate that allows notification of zoom and pan events. + + The source object + A object that corresponds to the state of the + before the zoom or pan event. + A object that corresponds to the state of the + after the zoom or pan event + + + + + A delegate that allows notification of scroll events. + + The source object + The source object + A object that corresponds to the state of the + before the scroll event. + A object that corresponds to the state of the + after the scroll event + + + + + A delegate that allows notification of scroll events. + + The source object + The source object + A object that corresponds to the state of the + before the scroll event. + A object that corresponds to the state of the + after the scroll event + + + + + A delegate that receives notification after a point-edit operation is completed. + + The source object + The object that contains the + point that has been edited + The object that contains the point + that has been edited + The integer index of the edited within the + of the selected + + + + + + A delegate that allows custom formatting of the point value tooltips + + The source object + The object that contains the point value of interest + The object that contains the point value of interest + The integer index of the selected within the + of the selected + + + + + A delegate that allows custom formatting of the cursor value tooltips + + The source object + The object that contains the cursor of interest + The object that represents the cursor value location + + + + + A delegate that allows notification of mouse events on Graph objects. + + The source object + A corresponding to this event + + + Return true if you have handled the mouse event entirely, and you do not + want the to do any further action (e.g., starting + a zoom operation). Return false if ZedGraph should go ahead and process the + mouse event. + + + + + A delegate that allows notification of clicks on ZedGraph objects that have + active links enabled + + The source object + The source in which the click + occurred. + + The source object which was clicked. This is typically + a type of if a curve point was clicked, or + a type of if a graph object was clicked. + + The object, belonging to + , that contains the link information + + An index value, typically used if a + was clicked, indicating the ordinal value of the actual point that was clicked. + + + Return true if you have handled the LinkEvent entirely, and you do not + want the to do any further action. + Return false if ZedGraph should go ahead and process the LinkEvent. + + + + + Public enumeration that specifies the type of + object present at the Context Menu's mouse location + + + + + The object is an Inactive Curve Item at the Context Menu's mouse position + + + + + The object is an active Curve Item at the Context Menu's mouse position + + + + + There is no selectable object present at the Context Menu's mouse position + + + + + A collection class containing a list of objects. + + + John Champion + $Revision: 3.3 $ $Date: 2006-06-24 20:26:43 $ + + + + Default constructor for the collection class. + + + + + The Copy Constructor + + The object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Return the zero-based position index of the + with the specified . + + The comparison of titles is not case sensitive, but it must include + all characters including punctuation, spaces, etc. + The label that is in the + attribute of the item to be found. + + The zero-based index of the specified , + or -1 if the was not found in the list + + + + + Return the zero-based position index of the + with the specified . + + In order for this method to work, the + property must be of type . + + The tag that is in the + attribute of the item to be found. + + The zero-based index of the specified , + or -1 if the string is not in the list + + + + Create a new and add it to this list. + + The title string for the new axis + An integer representing the ordinal position of the new in + this . This is the value that you would set the + property of a given to + assign it to this new . + + + + Indexer to access the specified object by + its ordinal position in the list. + + The ordinal position (zero-based) of the + object to be accessed. + An object reference. + + + + Indexer to access the specified object by + its string. + + The string title of the + object to be accessed. + A object reference. + + + + The basic class holds three data values (X, Y, Z). This + class extends the basic PointPair to contain five data values (X, Y, Z, Open, Close). + + + The values are remapped to , , + , , and . + + + John Champion + $Revision: 3.4 $ $Date: 2007-02-07 07:46:46 $ + + + + A simple point represented by an (X,Y,Z) group of double values. + + + Jerry Vos modified by John Champion + $Revision: 3.26 $ $Date: 2007-11-28 02:38:22 $ + + + + This is a base class that provides base-level functionality for a data point consisting + of an (X,Y) pair of double values. + + + This class is typically a base class for actual type implementations. + + + Jerry Vos modified by John Champion + $Revision: 1.4 $ $Date: 2007-04-16 00:03:02 $ + + + + Missing values are represented internally using . + + + + + The default format to be used for displaying point values via the + method. + + + + + Current schema value that defines the version of the serialized file + + + + + This PointPair's X coordinate + + + + + This PointPair's Y coordinate + + + + + Default Constructor + + + + + Creates a point pair with the specified X and Y. + + This pair's x coordinate. + This pair's y coordinate. + + + + Creates a point pair from the specified struct. + + The struct from which to get the + new values. + + + + The PointPairBase copy constructor. + + The basis for the copy. + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + static method to determine if the specified point value is invalid. + + The value is considered invalid if it is , + , + or . + The value to be checked for validity. + true if the value is invalid, false otherwise + + + + Implicit conversion from PointPair to PointF. Note that this conversion + can result in data loss, since the data are being cast from a type + double (64 bit) to a float (32 bit). + + The PointPair struct on which to operate + A PointF struct equivalent to the PointPair + + + + Compare two objects for equality. To be equal, X and Y + must be exactly the same between the two objects. + + The object to be compared with. + true if the objects are equal, false otherwise + + + + Return the HashCode from the base class. + + + + + + Format this PointPair value using the default format. Example: "( 12.345, -16.876 )". + The two double values are formatted with the "g" format type. + + A string representation of the PointPair + + + + Format this PointPair value using a general format string. + Example: a format string of "e2" would give "( 1.23e+001, -1.69e+001 )". + + A format string that will be used to format each of + the two double type values (see ). + A string representation of the PointPair + + + + Format this PointPair value using different general format strings for the X and Y values. + Example: a format string of "e2" would give "( 1.23e+001, -1.69e+001 )". + The Z value is not displayed (see ). + + A format string that will be used to format the X + double type value (see ). + A format string that will be used to format the Y + double type value (see ). + A string representation of the PointPair + + + + Readonly value that determines if either the X or the Y + coordinate in this PointPair is a missing value. + + true if either value is missing + + + + Readonly value that determines if either the X or the Y + coordinate in this PointPair is an invalid (not plotable) value. + It is considered invalid if it is missing (equal to System.Double.Max), + Infinity, or NaN. + + true if either value is invalid + + + + Current schema value that defines the version of the serialized file + + + + + This PointPair's Z coordinate. Also used for the lower value (dependent axis) + for and charts. + + + + + A tag object for use by the user. This can be used to store additional + information associated with the . ZedGraph never + modifies this value, but if it is a type, it + may be displayed in a + within the object. + + + Note that, if you are going to Serialize ZedGraph data, then any type + that you store in must be a serializable type (or + it will cause an exception). + + + + + Default Constructor + + + + + Creates a point pair with the specified X and Y. + + This pair's x coordinate. + This pair's y coordinate. + + + + Creates a point pair with the specified X, Y, and + label (). + + This pair's x coordinate. + This pair's y coordinate. + This pair's string label () + + + + Creates a point pair with the specified X, Y, and base value. + + This pair's x coordinate. + This pair's y coordinate. + This pair's z or lower dependent coordinate. + + + + Creates a point pair with the specified X, Y, base value, and + string label (). + + This pair's x coordinate. + This pair's y coordinate. + This pair's z or lower dependent coordinate. + This pair's string label () + + + + Creates a point pair with the specified X, Y, base value, and + (). + + This pair's x coordinate. + This pair's y coordinate. + This pair's z or lower dependent coordinate. + This pair's property + + + + Creates a point pair from the specified struct. + + The struct from which to get the + new values. + + + + The PointPair copy constructor. + + The basis for the copy. + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Compare two objects for equality. To be equal, X, Y, and Z + must be exactly the same between the two objects. + + The object to be compared with. + true if the objects are equal, false otherwise + + + + Return the HashCode from the base class. + + + + + + Format this PointPair value using the default format. Example: "( 12.345, -16.876 )". + The two double values are formatted with the "g" format type. + + true to show the third "Z" or low dependent value coordinate + A string representation of the PointPair + + + + Format this PointPair value using a general format string. + Example: a format string of "e2" would give "( 1.23e+001, -1.69e+001 )". + If + is true, then the third "Z" coordinate is also shown. + + A format string that will be used to format each of + the two double type values (see ). + A string representation of the PointPair + true to show the third "Z" or low dependent value coordinate + + + + Format this PointPair value using different general format strings for the X, Y, and Z values. + Example: a format string of "e2" would give "( 1.23e+001, -1.69e+001 )". + + A format string that will be used to format the X + double type value (see ). + A format string that will be used to format the Y + double type value (see ). + A format string that will be used to format the Z + double type value (see ). + A string representation of the PointPair + + + + Readonly value that determines if either the X, Y, or Z + coordinate in this PointPair is an invalid (not plotable) value. + It is considered invalid if it is missing (equal to System.Double.Max), + Infinity, or NaN. + + true if any value is invalid + + + + The "low" value for this point (lower dependent-axis value). + This is really just an alias for . + + The lower dependent value for this . + + + + The ColorValue property is just an alias for the + property. + + + For other types, such as the , the + can be mapped to a unique value. This is used with the + option. + + + + + Compares points based on their y values. Is setup to be used in an + ascending order sort. + + + + + + Compares two s. + + Point to the left. + Point to the right. + -1, 0, or 1 depending on l.Y's relation to r.Y + + + + Compares points based on their x values. Is setup to be used in an + ascending order sort. + + + + + + Constructor for PointPairComparer. + + The axis type on which to sort. + + + + Compares two s. + + Point to the left. + Point to the right. + -1, 0, or 1 depending on l.X's relation to r.X + + + + Current schema value that defines the version of the serialized file + + + + + This opening value + + + + + This closing value + + + + + This daily trading volume + + + + + This is a user value that can be anything. It is used to provide special + property-based coloration to the graph elements. + + + + + Default Constructor + + + + + Construct a new StockPt from the specified data values + + The trading date () + The opening stock price + The closing stock price + The daily high stock price + The daily low stock price + The daily trading volume + + + + Construct a new StockPt from the specified data values including a Tag property + + The trading date () + The opening stock price + The closing stock price + The daily high stock price + The daily low stock price + The daily trading volume + The user-defined property. + + + + The StockPt copy constructor. + + The basis for the copy. + + + + The StockPt copy constructor. + + The basis for the copy. + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Format this StockPt value using the default format. Example: "( 12.345, -16.876 )". + The two double values are formatted with the "g" format type. + + true to show all the value coordinates + A string representation of the . + + + + Format this PointPair value using a general format string. + Example: a format string of "e2" would give "( 1.23e+001, -1.69e+001 )". + If + is true, then the third all coordinates are shown. + + A format string that will be used to format each of + the two double type values (see ). + A string representation of the PointPair + true to show all the value coordinates + + + + Map the Date property to the X value + + + + + Map the high property to the Y value + + + + + Map the low property to the Z value + + + + + The ColorValue property. This is used with the + option. + + + + + Readonly value that determines if either the Date, Close, Open, High, or Low + coordinate in this StockPt is an invalid (not plotable) value. + It is considered invalid if it is missing (equal to System.Double.Max), + Infinity, or NaN. + + true if any value is invalid + + + + An abstract base class that represents a text object on the graph. A list of + objects is maintained by the + collection class. + + + John Champion + $Revision: 3.1 $ $Date: 2006-06-24 20:26:44 $ + + + + Current schema value that defines the version of the serialized file + + + schema changed to 2 when isClippedToChartRect was added. + + + + + Protected field that stores the location of this . + Use the public property to access this value. + + + + + Protected field that determines whether or not this + is visible in the graph. Use the public property to + access this value. + + + + + Protected field that determines whether or not the rendering of this + will be clipped to the ChartRect. Use the public property to + access this value. + + + + + A tag object for use by the user. This can be used to store additional + information associated with the . ZedGraph does + not use this value for any purpose. + + + Note that, if you are going to Serialize ZedGraph data, then any type + that you store in must be a serializable type (or + it will cause an exception). + + + + + Internal field that determines the z-order "depth" of this + item relative to other graphic objects. Use the public property + to access this value. + + + + + Internal field that stores the hyperlink information for this object. + + + + + Constructors for the class. + + + Default constructor that sets all properties to default + values as defined in the class. + + + + + Constructor that sets all properties to default + values as defined in the class. + + The x position of the text. The units + of this position are specified by the + property. The text will be + aligned to this position based on the + property. + The y position of the text. The units + of this position are specified by the + property. The text will be + aligned to this position based on the + property. + + + + Constructor that creates a with the specified + coordinates and all other properties to defaults as specified + in the class.. + + + The four coordinates define the starting point and ending point for + 's, or the topleft and bottomright points for + 's. For 's that only require + one point, the and values + will be ignored. The units of the coordinates are specified by the + property. + + The x position of the item. + The y position of the item. + The x2 position of the item. + The x2 position of the item. + + + + Constructor that creates a with the specified + position and . Other properties are set to default + values as defined in the class. + + + The two coordinates define the location point for the object. + The units of the coordinates are specified by the + property. + + The x position of the item. The item will be + aligned to this position based on the + property. + The y position of the item. The item will be + aligned to this position based on the + property. + The enum value that + indicates what type of coordinate system the x and y parameters are + referenced to. + + + + Constructor that creates a with the specified + position, , , and . + Other properties are set to default values as defined in the class. + + + The two coordinates define the location point for the object. + The units of the coordinates are specified by the + property. + + The x position of the item. The item will be + aligned to this position based on the + property. + The y position of the text. The units + of this position are specified by the + property. The text will be + aligned to this position based on the + property. + The enum value that + indicates what type of coordinate system the x and y parameters are + referenced to. + The enum that specifies + the horizontal alignment of the object with respect to the (x,y) location + The enum that specifies + the vertical alignment of the object with respect to the (x,y) location + + + + Constructor that creates a with the specified + position, , , and . + Other properties are set to default values as defined in the class. + + + The four coordinates define the starting point and ending point for + 's, or the topleft and bottomright points for + 's. For 's that only require + one point, the and values + will be ignored. The units of the coordinates are specified by the + property. + + The x position of the item. + The y position of the item. + The x2 position of the item. + The x2 position of the item. + The enum value that + indicates what type of coordinate system the x and y parameters are + referenced to. + The enum that specifies + the horizontal alignment of the object with respect to the (x,y) location + The enum that specifies + the vertical alignment of the object with respect to the (x,y) location + + + + The Copy Constructor + + The object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of Clone. + + + Note that this method must be called with an explicit cast to ICloneable, and + that it is inherently virtual. For example: + + ParentClass foo = new ChildClass(); + ChildClass bar = (ChildClass) ((ICloneable)foo).Clone(); + + Assume that ChildClass is inherited from ParentClass. Even though foo is declared with + ParentClass, it is actually an instance of ChildClass. Calling the ICloneable implementation + of Clone() on foo actually calls ChildClass.Clone() as if it were a virtual function. + + A deep copy of this object + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Render this object to the specified device. + + + This method is normally only called by the Draw method + of the parent collection object. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Determine if the specified screen point lies inside the bounding box of this + . + + The screen point, in pixels + + A reference to the object that is the parent or + owner of this object. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + true if the point lies in the bounding box, false otherwise + + + + Determines the shape type and Coords values for this GraphObj + + + + + The struct that describes the location + for this . + + + + + Gets or sets a value that determines the z-order "depth" of this + item relative to other graphic objects. + + Note that this controls the z-order with respect to + other elements such as 's, + objects, etc. The order of objects having + the same value is controlled by their order in + the . The first + in the list is drawn in front of other + objects having the same value. + + + + Gets or sets a value that determines if this will be + visible in the graph. true displays the item, false hides it. + + + + + Gets or sets a value that determines whether or not the rendering of this + will be clipped to the . + + true to clip the to the bounds, + false to leave it unclipped. + + + + Gets or sets the hyperlink information for this . + + + + + true if the of this object is set to put it in front + of the data points. + + + + + A simple struct that defines the + default property values for the class. + + + + + Default value for the vertical + text alignment ( property). + This is specified + using the enum type. + + + + + Default value for the horizontal + text alignment ( property). + This is specified + using the enum type. + + + + + The default coordinate system to be used for defining the + location coordinates + ( property). + + The coordinate system is defined with the + enum + + + + The default value for . + + + + + A class that captures all the scale range settings for a . + + + This class is used to store scale ranges in order to allow zooming out to + prior scale range states. objects are maintained in the + collection. The object holds + a object for each of the three axes; the , + the , and the . + + John Champion + $Revision: 3.15 $ $Date: 2007-04-16 00:03:07 $ + + + + objects to store the state data from the axes. + + + + + objects to store the state data from the axes. + + + + + An enum value indicating the type of adjustment being made to the + scale range state. + + + + + Construct a object from the scale ranges settings contained + in the specified . + + The from which to obtain the scale + range values. + + A enumeration that indicates whether + this saved state is from a pan or zoom. + + + + The Copy Constructor + + The object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Copy the properties from this out to the specified . + + The to which the scale range properties should be + copied. + + + + Determine if the state contained in this object is different from + the state of the specified . + + The object with which to compare states. + true if the states are different, false otherwise + + + + Gets a value indicating the type of action (zoom or pan) + saved by this . + + + + + Gets a string representing the type of adjustment that was made when this scale + state was saved. + + A string representation for the state change type; typically + "Pan", "Zoom", or "Scroll". + + + + An enumeration that describes whether a given state is the result of a Pan or Zoom + operation. + + + + + Indicates the object is from a Zoom operation + + + + + Indicates the object is from a Wheel Zoom operation + + + + + Indicates the object is from a Pan operation + + + + + Indicates the object is from a Scroll operation + + + + + A class designed to simplify the process of getting the actual value for + the various stacked and regular curve types + + + John Champion + $Revision: 3.21 $ $Date: 2008-12-02 12:55:34 $ + + + + Basic constructor that saves a reference to the parent + object. + + The parent object. + A flag to indicate whether or + not the drawing variables should be initialized. Initialization is not + required if this is part of a ZedGraph internal draw operation (i.e., its in + the middle of a call to ). Otherwise, you should + initialize to make sure the drawing variables are configured. true to do + an initialization, false otherwise. + + + + Get the user scale values associate with a particular point of a + particular curve. + The main purpose of this method is to handle + stacked bars, in which case the stacked values are returned rather + than the individual data values. + + A object of interest. + The zero-based point index for the point of interest. + A value representing the value + for the independent axis. + A value representing the lower + value for the dependent axis. + A value representing the upper + value for the dependent axis. + true if the data point is value, false for + , invalid, etc. data. + + + + Get the user scale values associate with a particular point of a + particular curve. + The main purpose of this method is to handle + stacked bars and lines, in which case the stacked values are returned rather + than the individual data values. However, this method works generically for any + curve type. + + The parent object. + A object of interest. + The zero-based point index for the point of interest. + A value representing the value + for the independent axis. + A value representing the lower + value for the dependent axis. + A value representing the upper + value for the dependent axis. + true if the data point is value, false for + , invalid, etc. data. + + + + Calculate the user scale position of the center of the specified bar, using the + as specified by . This method is + used primarily by the + method in order to + determine the bar "location," which is defined as the center of the top of the individual bar. + + The representing the + bar of interest. + The width of each individual bar. This can be calculated using + the method. + The cluster number for the bar of interest. This is the ordinal + position of the current point. That is, if a particular has + 10 points, then a value of 3 would indicate the 4th point in the data array. + The actual independent axis value for the bar of interest. + The ordinal position of the of interest. + That is, the first bar series is 0, the second is 1, etc. Note that this applies only + to the bars. If a graph includes both bars and lines, then count only the bars. + A user scale value position of the center of the bar of interest. + + + + + + + + John Champion and JCarpenter + $Revision: 3.5 $ $Date: 2007-03-11 02:08:16 $ + + + + A collection class containing a list of objects + that define the set of curves to be displayed on the graph. + + + John Champion + modified by Jerry Vos + $Revision: 3.43 $ $Date: 2007-11-03 04:41:28 $ + + + + Determine if there is any data in any of the + objects for this graph. This method does not verify valid data, it + only checks to see if > 0. + + true if there is any data, false otherwise + + + + Default constructor for the collection class + + + + + The Copy Constructor + + The XAxis object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Return the zero-based position index of the + with the specified . + + The label that is in the + attribute of the item to be found. + + The zero-based index of the specified , + or -1 if the is not in the list + + + + + Return the zero-based position index of the + with the specified . + + In order for this method to work, the + property must be of type . + The tag that is in the + attribute of the item to be found. + + The zero-based index of the specified , + or -1 if the is not in the list + + + + Sorts the list according to the point values at the specified index and + for the specified axis. + + + + + Move the position of the object at the specified index + to the new relative position in the list. + For Graphic type objects, this method controls the + Z-Order of the items. Objects at the beginning of the list + appear in front of objects at the end of the list. + The zero-based index of the object + to be moved. + The relative number of positions to move + the object. A value of -1 will move the + object one position earlier in the list, a value + of 1 will move it one position later. To move an item to the + beginning of the list, use a large negative value (such as -999). + To move it to the end of the list, use a large positive value. + + The new position for the object, or -1 if the object + was not found. + + + + Go through each object in the collection, + calling the member to + determine the minimum and maximum values in the + list of data value pairs. If the curves include + a stack bar, handle within the current GetRange method. In the event that no + data are available, a default range of min=0.0 and max=1.0 are returned. + If the Y axis has a valid data range and the Y2 axis not, then the Y2 + range will be a duplicate of the Y range. Vice-versa for the Y2 axis + having valid data when the Y axis does not. + If any in the list has a missing + , a new empty one will be generated. + + ignoreInitial is a boolean value that + affects the data range that is considered for the automatic scale + ranging (see ). If true, then initial + data points where the Y value is zero are not included when + automatically determining the scale , + , and size. All data after + the first non-zero Y value are included. + + + Determines if the auto-scaled axis ranges will subset the + data points based on any manually set scale range values. + + + A reference to the object that is the parent or + owner of this object. + + + + + + Calculate the range for stacked bars and lines. + + This method is required for the stacked + types because (for bars), the negative values are a separate stack than the positive + values. If you just sum up the bars, you will get the sum of the positive plus negative, + which is less than the maximum positive value and greater than the maximum negative value. + + + A reference to the object that is the parent or + owner of this object. + + The for which to calculate the range + The minimum X value so far + The minimum Y value so far + The maximum X value so far + The maximum Y value so far + + + + + Render all the objects in the list to the + specified + device by calling the member function of + each object. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Find the ordinal position of the specified within + the . This position only counts + types, ignoring all other types. + + The of interest + The for which to search. + The ordinal position of the specified bar, or -1 if the bar + was not found. + + + + Read only value for the maximum number of points in any of the curves + in the list. + + + + + Read only property that returns the number of curves in the list that are of + type . This does not include or + types. + + + + + Read only property that returns the number of curves in the list that are + potentially "clusterable", which includes and + types. This does not include , + , , etc. types. + + Note that this property is only the number of bars that COULD BE clustered. The + actual cluster settings are not considered. + + + + Read only property that returns the number of pie slices in the list (class type is + ). + + + + + Read only property that determines if all items in the are + Pies. + + + + + Iterate backwards through the items. + + + + + Iterate forward through the items. + + + + + Indexer to access the specified object by + its string. + + The string label of the + object to be accessed. + A object reference. + + + + The type to be used for drawing "selected" + , , , + , and item types. + + + + + The type to be used for drawing "selected" + , , , + and item types. + + + + + The type to be used for drawing "selected" + and types + + + + + The type to be used for drawing "selected" + and types. + + + + + Place a in the selection list, removing all other + items. + + The that is the "owner" + of the 's. + The to be added to the list. + + + + Place a list of 's in the selection list, removing all other + items. + + The that is the "owner" + of the 's. + The list of to be added to the list. + + + + Add a to the selection list. + + The that is the "owner" + of the 's. + The to be added to the list. + + + + Add a list of 's to the selection list. + + The that is the "owner" + of the 's. + The list of 's to be added to the list. + + + + Remove the specified from the selection list. + + The that is the "owner" + of the 's. + The to be removed from the list. + + + + Clear the selection list and trigger a . + + The that "owns" the selection list. + + + + Clear the selection list and optionally trigger a . + + The that "owns" the selection list. + true to trigger a , + false otherwise. + + + + Mark the 's that are included in the selection list + by setting the property to true. + + The that "owns" the selection list. + + + + Subscribe to this event to receive notice + that the list of selected CurveItems has changed + + + + + A class containing a set of data values to be plotted as a RadarPlot. + This class will effectively convert the data into objects + by converting the polar coordinates to rectangular coordinates + + + + + + Jerry Vos and John Champion + $Revision: 3.5 $ $Date: 2007-04-16 00:03:02 $ + + + + An interface to a collection class containing data + that define the set of points to be displayed on the curve. + + + This interface is designed to allow customized data abstraction. The default data + collection class is , however, you can define your own + data collection class using the interface. + + + + + John Champion + $Revision: 1.6 $ $Date: 2007-11-11 07:29:43 $ + + + + Indexer to access a data point by its ordinal position in the collection. + + + This is the standard interface that ZedGraph uses to access the data. Although + you must pass a here, your internal data storage format + can be anything. + + The ordinal position (zero-based) of the + data point to be accessed. + A object instance. + + + + Gets the number of points available in the list. + + + + + An interface to a collection class containing data + that define the set of points to be displayed on the curve. + + + This interface is designed to allow customized data abstraction. The default data + collection class is , however, you can define your own + data collection class using the interface. This + interface adds the ability to remove and add points + to the list, and so is used by the class for the + , , and + methods. + + + + + + + John Champion + $Revision: 3.6 $ $Date: 2006-10-19 04:40:14 $ + + + + Appends a point to the end of the list. The data are passed in as a + object. + + The object containing the data to be added. + + + + Appends a point to the end of the list. The data are passed in as two + types. + + The value containing the X data to be added. + The value containing the Y data to be added. + The ordinal position (zero-based), at which the new point was added. + + + + Removes a single data point from the list at the specified ordinal location + (zero based). + + + + + Clears all data points from the list. After calling this method, + will be zero. + + + + + Indexer to access a data point by its ordinal position in the collection. + + + This is the standard interface that ZedGraph uses to access the data. Although + you must pass a here, your internal data storage format + can be anything. + + The ordinal position (zero-based) of the + data point to be accessed. + A object instance. + + + + Default to clockwise rotation as this is the standard for radar charts + + + + + Default to 90 degree rotation so main axis is in the 12 o'clock position, + which is the standard for radar charts. + + + + + Get the raw data + + + + + + + Default Constructor + + + + + Copy Constructor + + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Add a single point to the from two values of type double. + + The radial coordinate value + The 'Z' coordinate value, which is not normally used for plotting, + but can be used for type fills + The zero-based ordinal index where the point was added in the list. + + + + Indexer to access the specified object by + its ordinal position in the list. This method does the calculations + to convert the data from polar to rectangular coordinates. + + The ordinal position (zero-based) of the + object to be accessed. + A object reference. + + + + Indicates if points should be added in clockwise or counter-clockwise order + + + + + Sets the angular rotation (starting angle) for the initial axis + + + + + gets the number of points available in the list + + + + + A class that handles the basic attributes of a line segment. + + + This is the base class for and classes. + + John Champion + $Revision: 3.2 $ $Date: 2007-03-17 18:43:44 $ + + + + Current schema value that defines the version of the serialized file + + + + + Private field that stores the pen width for this line. + Use the public property to access this value. + + + + + Private field that stores the for this + line. Use the public + property to access this value. + + + + + private field that stores the "Dash On" length for drawing the line. Use the + public property to access this value. + + + + + private field that stores the "Dash Off" length for drawing the line. Use the + public property to access this value. + + + + + Private field that stores the visibility of this line. Use the public + property to access this value. + + + + + private field that determines if the line is drawn using + Anti-Aliasing capabilities from the class. + Use the public property to access + this value. + + + + + Private field that stores the color of this line. Use the public + property to access this value. If this value is + false, the line will not be shown (but the may + still be shown). + + + + + Internal field that stores a custom class. This + fill is used strictly for , + , , + and calculations to determine + the color of the line. + + + + + Default constructor that sets all properties to default + values as defined in the class. + + + + + Constructor that sets the color property to the specified value, and sets + the remaining properties to default + values as defined in the class. + + The color to assign to this new Line object + + + + The Copy Constructor + + The LineBase object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of Clone. + + + Note that this method must be called with an explicit cast to ICloneable, and + that it is inherently virtual. For example: + + ParentClass foo = new ChildClass(); + ChildClass bar = (ChildClass) ((ICloneable)foo).Clone(); + + Assume that ChildClass is inherited from ParentClass. Even though foo is declared with + ParentClass, it is actually an instance of ChildClass. Calling the ICloneable implementation + of Clone() on foo actually calls ChildClass.Clone() as if it were a virtual function. + + A deep copy of this object + + + + Constructor for deserializing objects + + A instance that defines the + serialized data + + A instance that contains + the serialized data + + + + + Populates a instance with the data needed to serialize + the target object + + A instance that defines the + serialized data + A instance that contains the + serialized data + + + + Create a object based on the properties of this + . + + The owner of this + . + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + A object with the properties of this + + + + + Create a object based on the properties of this + . + + The owner of this + . + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + The data value to be used for a value-based + color gradient. This is only applicable if GradientFill.Type + is one of , + , , + or . + + A object with the properties of this + + + + + The color of the . Note that this color value can be + overridden if the GradientFill.Type is one of the + , + , , + and types. + + + + + + The style of the , defined as a enum. + This allows the line to be solid, dashed, or dotted. + + + + + + + + The "Dash On" mode for drawing the line. + + + This is the distance, in points (1/72 inch), of the dash segments that make up + the dashed grid lines. This setting is only valid if + is set to . + + The dash on length is defined in points (1/72 inch) + + + . + + + + The "Dash Off" mode for drawing the line. + + + This is the distance, in points (1/72 inch), of the spaces between the dash + segments that make up the dashed grid lines. This setting is only valid if + is set to . + + The dash off length is defined in points (1/72 inch) + + + . + + + + The pen width used to draw the , in points (1/72 inch) + + + + + + Gets or sets a property that shows or hides the . + + true to show the line, false to hide it + + + + + Gets or sets a value that determines if the lines are drawn using + Anti-Aliasing capabilities from the class. + + + If this value is set to true, then the + property will be set to only while + this is drawn. A value of false will leave the value of + unchanged. + + + + + Gets or sets a custom class. + + This fill is used strictly for , + , , + and calculations to determine + the color of the line. It overrides the property if + one of the above values are selected. + + + + + + A simple struct that defines the + default property values for the class. + + + + + The default mode for displaying line segments ( + property). True to show the line segments, false to hide them. + + + + + The default width for line segments ( property). + Units are points (1/72 inch). + + + + + The default value for the + property. + + + + + The default drawing style for line segments ( property). + This is defined with the enumeration. + + + + + The default "dash on" size for drawing the line + ( property). Units are in points (1/72 inch). + + + + + The default "dash off" size for drawing the the line + ( property). Units are in points (1/72 inch). + + + + + The default color for the line. + This is the default value for the property. + + + + + A collection class containing a list of objects + to be displayed on the graph. + + + John Champion + $Revision: 3.1 $ $Date: 2006-06-24 20:26:44 $ + + + + Default constructor for the collection class + + + + + The Copy Constructor + + The object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Return the zero-based position index of the + with the specified . + + In order for this method to work, the + property must be of type . + The tag that is in the + attribute of the item to be found. + + The zero-based index of the specified , + or -1 if the is not in the list + + + + Move the position of the object at the specified index + to the new relative position in the list. + For Graphic type objects, this method controls the + Z-Order of the items. Objects at the beginning of the list + appear in front of objects at the end of the list. + The zero-based index of the object + to be moved. + The relative number of positions to move + the object. A value of -1 will move the + object one position earlier in the list, a value + of 1 will move it one position later. To move an item to the + beginning of the list, use a large negative value (such as -999). + To move it to the end of the list, use a large positive value. + + The new position for the object, or -1 if the object + was not found. + + + + Render text to the specified device + by calling the Draw method of each object in + the collection. + + This method is normally only called by the Draw method + of the parent object. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + A enumeration that controls + the placement of this relative to other + graphic objects. The order of 's with the + same value is control by their order in + this . + + + + Determine if a mouse point is within any , and if so, + return the index number of the the . + + The screen point, in pixel coordinates. + + A reference to the object that is the parent or + owner of this object. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + The index number of the + that is under the mouse point. The object is + accessible via the indexer property. + + true if the mouse point is within a bounding + box, false otherwise. + + + + + Indexer to access the specified object by its . + Note that the must be a type for this method + to work. + + The type tag to search for. + A object reference. + + + + + Class that handles the data associated with a text title and its associated font + properties. Inherits from , and adds the + property for use by the and objects. + + + John Champion + $Revision: 3.1 $ $Date: 2006-06-24 20:26:44 $ + + + + Class that handles the data associated with text title and its associated font + properties + + + John Champion + $Revision: 3.2 $ $Date: 2007-03-11 02:08:16 $ + + + + Current schema value that defines the version of the serialized file + + + + + private field that stores the text for this label + + + + + private field that stores the font properties for this label + + + + + private field that determines if this label will be displayed. + + + + + Constructor to build an from the text and the + associated font properties. + + The representing the text to be + displayed + The font family name + The size of the font in points and scaled according + to the logic. + The instance representing the color + of the font + true for a bold font face + true for an italic font face + true for an underline font face + + + + Constructor that builds a from a text + and a instance. + + + + + + + Copy constructor + + the instance to be copied. + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + The text to be displayed + + + + + A instance representing the font properties + for the displayed text. + + + + + Gets or sets a boolean value that determines whether or not this label will be displayed. + + + + + Current schema value that defines the version of the serialized file + + + + + Constructor to build a from the text and the + associated font properties. + + The representing the text to be + displayed + The font family name + The size of the font in points and scaled according + to the logic. + The instance representing the color + of the font + true for a bold font face + true for an italic font face + true for an underline font face + + + + Copy constructor + + the instance to be copied. + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Calculate the size of the based on the + height, in pixel units and scaled according to . + + The scaling factor to be applied + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Gets or sets the gap factor between this label and the opposing + or . + + + This value is expressed as a fraction of the character height for the . + + + + + A simple struct that defines the + default property values for the class. + + + + + The default setting. + + + + + Class that handles the properties of the charting area (where the curves are + actually drawn), which is bounded by the , , + and . + + + John Champion + $Revision: 3.1 $ $Date: 2006-06-24 20:26:44 $ + + + + Current schema value that defines the version of the serialized file + + + + + The rectangle that contains the area bounded by the axes, in pixel units + + + + + Private field that stores the data for this + . Use the public property to + access this value. + + + + + Private field that stores the data for this + . Use the public property to + access this value. + + + + Private field that determines if the will be + sized automatically. Use the public property to access + this value. + + + + Default constructor. + + + + + Copy constructor + + The source to be copied. + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Gets or sets the rectangle that contains the area bounded by the axes + (, , and ). + If you set this value manually, then the + value will automatically be set to false. + + The rectangle units are in screen pixels + + + + Gets or sets the data for this + . + + + + + Gets or sets the class for drawing the border + border around the + + + + + + + Gets or sets a boolean value that determines whether or not the + will be calculated automatically (almost always true). + + + If you have a need to set the ChartRect manually, such as you have multiple graphs + on a page and you want to line up the edges perfectly, you can set this value + to false. If you set this value to false, you must also manually set + the property. + You can easily determine the ChartRect that ZedGraph would have + calculated by calling the method, which returns + a chart rect sized for the current data range, scale sizes, etc. + + true to have ZedGraph calculate the ChartRect, false to do it yourself + + + + A simple struct that defines the + default property values for the class. + + + + + The default color for the border. + ( property). + + + + + The default color for the background. + ( property). + + + + + The default brush for the background. + ( property of ). + + + + + The default for the background. + ( property of ). + + + + + The default pen width for drawing the + border + ( property). + Units are in points (1/72 inch). + + + + + The default display mode for the border + ( property). true + to show the border border, false to omit the border + + + + + Encapsulates a CandleStick curve type that displays a vertical (or horizontal) + line displaying the range of data values at each sample point, plus an starting + mark and an ending mark signifying the opening and closing value for the sample. + + For this type to work properly, your must contain + objects, rather than ordinary types. + This is because the type actually displays 5 data values + but the only stores 3 data values. The + stores , , + , , and + members. + For a vertical CandleStick chart, the opening value is drawn as a horizontal line + segment to the left of the vertical range bar, and the closing value is a horizontal + line segment to the right. The total length of these two line segments is controlled + by the property, which is specified in + points (1/72nd inch), and scaled according to . + The candlesticks are drawn horizontally or vertically depending on the + value of , which is a + enum type. + John Champion + $Revision: 3.4 $ $Date: 2007-12-31 00:23:05 $ + + + + This class contains the data and methods for an individual curve within + a graph pane. It carries the settings for the curve including the + key and item names, colors, symbols and sizes, linetypes, etc. + + + John Champion + modified by Jerry Vos + $Revision: 3.43 $ $Date: 2007-11-03 04:41:28 $ + + + + Current schema value that defines the version of the serialized file + + + + + protected field that stores a instance for this + , which is used for the + label. Use the public + property to access this value. + + + + + protected field that stores the boolean value that determines whether this + is on the bottom X axis or the top X axis (X2). + Use the public property to access this value. + + + + + protected field that stores the boolean value that determines whether this + is on the left Y axis or the right Y axis (Y2). + Use the public property to access this value. + + + + + protected field that stores the index number of the Y Axis to which this + belongs. Use the public property + to access this value. + + + + + protected field that stores the boolean value that determines whether this + is visible on the graph. + Use the public property to access this value. + Note that this value turns the curve display on or off, but it does not + affect the display of the legend entry. To hide the legend entry, you + have to set to false. + + + + + Protected field that stores the boolean value that determines whether this + is selected on the graph. + Use the public property to access this value. + Note that this value changes the curve display color, but it does not + affect the display of the legend entry. To hide the legend entry, you + have to set to false. + + + + + Protected field that stores the boolean value that determines whether this + can be selected in the graph. + + + + + protected field that stores a boolean value which allows you to override the normal + ordinal axis behavior. Use the public property to + access this value. + + + + + The of value sets that + represent this . + The size of this list determines the number of points that are + plotted. Note that values defined as + System.Double.MaxValue are considered "missing" values + (see ), + and are not plotted. The curve will have a break at these points + to indicate the values are missing. + + + + + A tag object for use by the user. This can be used to store additional + information associated with the . ZedGraph does + not use this value for any purpose. + + + Note that, if you are going to Serialize ZedGraph data, then any type + that you store in must be a serializable type (or + it will cause an exception). + + + + + Protected field that stores the hyperlink information for this object. + + + + + constructor the pre-specifies the curve label, the + x and y data values as a , the curve + type (Bar or Line/Symbol), the , and the + . Other properties of the curve are + defaulted to the values in the class. + + A string label (legend entry) for this curve + An array of double precision values that define + the independent (X axis) values for this curve + An array of double precision values that define + the dependent (Y axis) values for this curve + + + + constructor the pre-specifies the curve label, the + x and y data values as a , the curve + type (Bar or Line/Symbol), the , and the + . Other properties of the curve are + defaulted to the values in the class. + + A string label (legend entry) for this curve + A of double precision value pairs that define + the X and Y values for this curve + + + + Internal initialization routine thats sets some initial values to defaults. + + A string label (legend entry) for this curve + + + + constructor that specifies the label of the CurveItem. + This is the same as CurveItem(label, null, null). + + + A string label (legend entry) for this curve + + + + + + + + + The Copy Constructor + + The CurveItem object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of Clone. + + + Note that this method must be called with an explicit cast to ICloneable, and + that it is inherently virtual. For example: + + ParentClass foo = new ChildClass(); + ChildClass bar = (ChildClass) ((ICloneable)foo).Clone(); + + Assume that ChildClass is inherited from ParentClass. Even though foo is declared with + ParentClass, it is actually an instance of ChildClass. Calling the ICloneable implementation + of Clone() on foo actually calls ChildClass.Clone() as if it were a virtual function. + + A deep copy of this object + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Gets a flag indicating if the Z data range should be included in the axis scaling calculations. + + The parent of this . + + true if the Z data are included, false otherwise + + + + Gets a flag indicating if the X axis is the independent axis for this + + The parent of this . + + true if the X axis is independent, false otherwise + + + + Do all rendering associated with this to the specified + device. This method is normally only + called by the Draw method of the parent + collection object. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + The ordinal position of the current + curve. + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Draw a legend key entry for this at the specified location. + This abstract base method passes through to or + to do the rendering. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + The struct that specifies the + location for the legend key + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Add a single x,y coordinate point to the end of the points collection for this curve. + + The X coordinate value + The Y coordinate value + + + + Add a object to the end of the points collection for this curve. + + + This method will only work if the instance reference + at supports the interface. + Otherwise, it does nothing. + + A reference to the object to + be added + + + + Clears the points from this . This is the same + as CurveItem.Points.Clear(). + + + This method will only work if the instance reference + at supports the interface. + Otherwise, it does nothing. + + + + + Removes a single point from this . + + + This method will only work if the instance reference + at supports the interface. + Otherwise, it does nothing. + + The ordinal position of the point to be removed. + + + + Get the X Axis instance (either or ) to + which this belongs. + + The object to which this curve belongs. + Either a or to which this + belongs. + + + + + Get the Y Axis instance (either or ) to + which this belongs. + + + This method safely retrieves a Y Axis instance from either the + or the using the values of and + . If the value of is out of bounds, the + default or is used. + + The object to which this curve belongs. + Either a or to which this + belongs. + + + + + Get the index of the Y Axis in the or list to + which this belongs. + + + This method safely retrieves a Y Axis index into either the + or the using the values of and + . If the value of is out of bounds, the + default or is used, which is index zero. + + The object to which this curve belongs. + An integer value indicating which index position in the list applies to this + + + + + + Loads some pseudo unique colors/symbols into this CurveItem. This + is the same as MakeUnique(ColorSymbolRotator.StaticInstance). + + + + + + + + Loads some pseudo unique colors/symbols into this CurveItem. This + is mainly useful for differentiating a set of new CurveItems without + having to pick your own colors/symbols. + + + + The that is used to pick the color + and symbol for this method call. + + + + + Go through the list of data values for this + and determine the minimum and maximum values in the data. + + The minimum X value in the range of data + The maximum X value in the range of data + The minimum Y value in the range of data + The maximum Y value in the range of data + ignoreInitial is a boolean value that + affects the data range that is considered for the automatic scale + ranging (see ). If true, then initial + data points where the Y value is zero are not included when + automatically determining the scale , + , and size. All data after + the first non-zero Y value are included. + + + Determines if the auto-scaled axis ranges will subset the + data points based on any manually set scale range values. + + + A reference to the object that is the parent or + owner of this object. + + + + + Returns a reference to the object that is the "base" + (independent axis) from which the values are drawn. + + This property is determined by the value of for + , , and + types. It is always the X axis for regular types. + Note that the setting can override the + and settings for bar types + (this is because all the bars that are clustered together must share the + same base axis). + + + + + + Returns a reference to the object that is the "value" + (dependent axis) from which the points are drawn. + + This property is determined by the value of for + , , and + types. It is always the Y axis for regular types. + + + + + + + Calculate the width of each bar, depending on the actual bar type + + The width for an individual bar, in pixel units + + + + Determine the coords for the rectangle associated with a specified point for + this + + The to which this curve belongs + The index of the point of interest + A list of coordinates that represents the "rect" for + this point (used in an html AREA tag) + true if it's a valid point, false otherwise + + + + A instance that represents the + entry for the this object + + + + + The // + color (FillColor for the Bar). This is a common access to + Line.Color, + Border.Color, and + Fill.Color properties for this curve. + + + + + Determines whether this is visible on the graph. + Note that this value turns the curve display on or off, but it does not + affect the display of the legend entry. To hide the legend entry, you + have to set to false. + + + + + Determines whether this is selected on the graph. + Note that this value changes the curve displayed color, but it does not + affect the display of the legend entry. To hide the legend entry, you + have to set to false. + + + + + Determines whether this can be selected in the graph. + + + + + Gets or sets a value which allows you to override the normal + ordinal axis behavior. + + + Normally for an ordinal axis type, the actual data values corresponding to the ordinal + axis will be ignored (essentially they are replaced by ordinal values, e.g., 1, 2, 3, etc). + If IsOverrideOrdinal is true, then the user data values will be used (even if they don't + make sense). Fractional values are allowed, such that a value of 1.5 is between the first and + second ordinal position, etc. + + + + + + + Gets or sets a value that determines which X axis this + is assigned to. + + + The + is on the bottom side of the graph and the + is on the top side. Assignment to an axis + determines the scale that is used to draw the curve on the graph. + + true to assign the curve to the , + false to assign the curve to the + + + + Gets or sets a value that determines which Y axis this + is assigned to. + + + The + is on the left side of the graph and the + is on the right side. Assignment to an axis + determines the scale that is used to draw the curve on the graph. Note that + this value is used in combination with the to determine + which of the Y Axes (if there are multiples) this curve belongs to. + + true to assign the curve to the , + false to assign the curve to the + + + + Gets or sets the index number of the Y Axis to which this + belongs. + + + This value is essentially an index number into the + or , depending on the setting of + . + + + + + Determines whether this + is a . + + true for a bar chart, or false for a line or pie graph + + + + Determines whether this + is a . + + true for a pie chart, or false for a line or bar graph + + + + Determines whether this + is a . + + true for a line chart, or false for a bar type + + + + Readonly property that gives the number of points that define this + object, which is the number of points in the + data collection. + + + + + The of X,Y point sets that represent this + . + + + + + An accessor for the datum for this . + Index is the ordinal reference (zero based) of the point. + + + + + Gets or sets the hyperlink information for this . + + + + + Compares 's based on the point value at the specified + index and for the specified axis. + + + + + + Constructor for Comparer. + + The axis type on which to sort. + The index number of the point on which to sort + + + + Compares two s using the previously specified index value + and axis. Sorts in descending order. + + Curve to the left. + Curve to the right. + -1, 0, or 1 depending on l.X's relation to r.X + + + + Current schema value that defines the version of the serialized file + + + + + Private field that stores a reference to the + class defined for this . Use the public + property to access this value. + + + + + + Gets a flag indicating if the X axis is the independent axis for this + + The parent of this . + + true if the X axis is independent, false otherwise + + + + Gets a flag indicating if the Z data range should be included in the axis scaling calculations. + + + IsZIncluded is true for objects, since the Y and Z + values are defined as the High and Low values for the day. + The parent of this . + + true if the Z data are included, false otherwise + + + + Create a new , specifying only the legend label. + + The label that will appear in the legend. + + + + Create a new using the specified properties. + + The _label that will appear in the legend. + An of double precision values that define + the Date, Close, Open, High, and Low values for the curve. Note that this + should contain items rather + than items. + + + The to use for drawing the candlesticks. + + + + The Copy Constructor + + The object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Do all rendering associated with this to the specified + device. This method is normally only + called by the Draw method of the parent + collection object. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + The ordinal position of the current + curve. + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Draw a legend key entry for this at the specified location + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + The struct that specifies the + location for the legend key + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Determine the coords for the rectangle associated with a specified point for + this + + The to which this curve belongs + The index of the point of interest + A list of coordinates that represents the "rect" for + this point (used in an html AREA tag) + true if it's a valid point, false otherwise + + + + Gets a reference to the class defined + for this . + + + + + A class that captures an scale range. + + This structure is used by the class to store + scale range settings in a collection for later retrieval. + The class stores the , , + , and properties, along with + the corresponding auto-scale settings: , + , , + and . + John Champion + $Revision: 3.2 $ $Date: 2007-02-19 08:05:24 $ + + + + The axis range data for , , + , and + + + + + The axis range data for , , + , and + + + + + The axis range data for , , + , and + + + + + The axis range data for , , + , and + + + + + The status of , + , , + and + + + + + The status of , + , , + and + + + + + The status of , + , , + and + + + + + The status of , + , , + and + + + + + The status of , + , , + and + + + + + The status of , + , , + and + + + + + The status of and + + + + + The status of and + + + + + Construct a from the specified + + The from which to collect the scale + range settings. + + + + The Copy Constructor + + The object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Copy the properties from this out to the specified . + + The reference to which the properties should be + copied + + + + Determine if the state contained in this object is different from + the state of the specified . + + The object with which to compare states. + true if the states are different, false otherwise + + + + The Scale class is an abstract base class that encompasses the properties + and methods associated with a scale of data. + + This class is inherited by the + , , , + , , , + , and + classes to define specific characteristics for those types. + + + John Champion + $Revision: 1.33 $ $Date: 2007-09-19 06:41:56 $ + + + + Current schema value that defines the version of the serialized file + + + + Private fields for the scale definitions. + Use the public properties , , + , , and + for access to these values. + + + + Private fields for the scale definitions. + Use the public properties , , + , , and + for access to these values. + + + + Private fields for the scale definitions. + Use the public properties , , + , , and + for access to these values. + + + + Private fields for the scale definitions. + Use the public properties , , + , , and + for access to these values. + + + + Private fields for the scale definitions. + Use the public properties , , + , , and + for access to these values. + + + + Private fields for the scale definitions. + Use the public properties , , + , , and + for access to these values. + + + + Private fields for the automatic scaling modes. + Use the public properties , , + , , + and + for access to these values. + + + + Private fields for the automatic scaling modes. + Use the public properties , , + , , + and + for access to these values. + + + + Private fields for the automatic scaling modes. + Use the public properties , , + , , + and + for access to these values. + + + + Private fields for the automatic scaling modes. + Use the public properties , , + , , + and + for access to these values. + + + + Private fields for the automatic scaling modes. + Use the public properties , , + , , + and + for access to these values. + + + + Private fields for the automatic scaling modes. + Use the public properties , , + , , + and + for access to these values. + + + + Private fields for the "grace" settings. + These values determine how much extra space is left before the first data value + and after the last data value. + Use the public properties and + for access to these values. + + + + Private fields for the "grace" settings. + These values determine how much extra space is left before the first data value + and after the last data value. + Use the public properties and + for access to these values. + + + + Private field for the scale value display. + Use the public property for access to this value. + + + + Private fields for the attributes. + Use the public properties and + for access to these values. + + + + Private fields for the attributes. + Use the public properties and + for access to these values. + + + + Private fields for the attributes. + Use the public properties and + for access to these values. + + + + Private fields for the attributes. + Use the public properties and + for access to these values. + + + + Private fields for the attributes. + Use the public properties and + for access to these values. + + + + Private fields for the attributes. + Use the public properties and + for access to these values. + + + + Private fields for the attributes. + Use the public properties and + for access to these values. + + + + Private fields for the attributes. + Use the public properties and + for access to these values. + + + + Private field for the array of text labels. + This property is only used if is set to + + + + Private field for the format of the tic labels. + Use the public property for access to this value. + + + + + Private fields for Unit types to be used for the major and minor tics. + See and for the corresponding + public properties. + These types only apply for date-time scales (). + + The value of these types is of enumeration type + + + + + Private fields for Unit types to be used for the major and minor tics. + See and for the corresponding + public properties. + These types only apply for date-time scales (). + + The value of these types is of enumeration type + + + + Private field for the alignment of the tic labels. + This fields controls whether the inside, center, or outside edges of the text labels are aligned. + Use the public property + for access to this value. + + + + Private field for the alignment of the tic labels. + This fields controls whether the left, center, or right edges of the text labels are aligned. + Use the public property + for access to this value. + + + + Private fields for the font specificatios. + Use the public properties and + for access to these values. + + + + Internal field that stores the amount of space between the scale labels and the + major tics. Use the public property to access this + value. + + + + + Data range temporary values, used by GetRange(). + + + + + Data range temporary values, used by GetRange(). + + + + + Data range temporary values, used by GetRange(). + + + + + Data range temporary values, used by GetRange(). + + + + + Pixel positions at the minimum and maximum value for this scale. + These are temporary values used/valid only during the Draw process. + + + + + Pixel positions at the minimum and maximum value for this scale. + These are temporary values used/valid only during the Draw process. + + + + + Scale values for calculating transforms. These are temporary values + used ONLY during the Draw process. + + + These values are just and + for normal linear scales, but for log or exponent scales they will be a + linear representation. For , it is the + of the value, and for , + it is the + of the value. + + + + + Scale values for calculating transforms. These are temporary values + used ONLY during the Draw process. + + + These values are just and + for normal linear scales, but for log or exponent scales they will be a + linear representation. For , it is the + of the value, and for , + it is the + of the value. + + + + + private field that stores the owner Axis that contains this Scale instance. + + + + + Basic constructor -- requires that the object be intialized with + a pre-existing owner . + + The object that is the owner of this + instance. + + + + Copy Constructor. Create a new object based on the specified + existing one. + + The object to be copied. + The object that will own the + new instance of + + + + Create a new clone of the current item, with a new owner assignment + + The new instance that will be + the owner of the new Scale + A new clone. + + + + A construction method that creates a new object using the + properties of an existing object, but specifying a new + . + + + This constructor is used to change the type of an existing . + By specifying the old object, you are giving a set of properties + (which encompasses all fields associated with the scale, since the derived types + have no fields) to be used in creating a new object, only this + time having the newly specified object type. + The existing object from which to + copy the field data. + An representing the type of derived type + of new object to create. + The new object. + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to + serialize the target object + + + You MUST set the _ownerAxis property after deserializing a BarSettings object. + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Setup some temporary transform values in preparation for rendering the + . + + + This method is typically called by the parent + object as part of the method. It is also + called by and + + methods to setup for coordinate transformations. + + + A reference to the object that is the parent or + owner of this object. + + + The parent for this + + + + + Convert a value to its linear equivalent for this type of scale. + + + The default behavior is to just return the value unchanged. However, + for and , + it returns the log or power equivalent. + + The value to be converted + + + + Convert a value from its linear equivalent to its actual scale value + for this type of scale. + + + The default behavior is to just return the value unchanged. However, + for and , + it returns the anti-log or inverse-power equivalent. + + The value to be converted + + + + Make a value label for the axis at the specified ordinal position. + + + This method properly accounts for , , + and other axis format settings. + + + A reference to the object that is the parent or + owner of this object. + + + The zero-based, ordinal index of the label to be generated. For example, a value of 2 would + cause the third value label on the axis to be generated. + + + The numeric value associated with the label. This value is ignored for log () + and text () type axes. + + The resulting value label as a + + + + Get the maximum width of the scale value text that is required to label this + . + The results of this method are used to determine how much space is required for + the axis labels. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + true to get the bounding box of the text using the , + false to just get the bounding box without rotation + + the maximum width of the text in pixel units + + + + Determine the value for any major tic. + + + This method properly accounts for , , + and other axis format settings. + + + The value of the first major tic (floating point double) + + + The major tic number (0 = first major tic). For log scales, this is the actual power of 10. + + + The specified major tic value (floating point double). + + + + + Determine the value for any minor tic. + + + This method properly accounts for , , + and other axis format settings. + + + The value of the first major tic (floating point double). This tic value is the base + reference for all tics (including minor ones). + + + The major tic number (0 = first major tic). For log scales, this is the actual power of 10. + + + The specified minor tic value (floating point double). + + + + + Internal routine to determine the ordinals of the first minor tic mark + + + The value of the first major tic for the axis. + + + The ordinal position of the first minor tic, relative to the first major tic. + This value can be negative (e.g., -3 means the first minor tic is 3 minor step + increments before the first major tic. + + + + + Determine the value for the first major tic. + + + This is done by finding the first possible value that is an integral multiple of + the step size, taking into account the date/time units if appropriate. + This method properly accounts for , , + and other axis format settings. + + + First major tic value (floating point double). + + + + + Draw the value labels, tic marks, and grid lines as + required for this . + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + + The first major tic value for the axis + + + The total number of major tics for the axis + + + The pixel location of the far side of the ChartRect from this axis. + This value is the ChartRect.Height for the XAxis, or the ChartRect.Width + for the YAxis and Y2Axis. + + The number of pixels to shift this axis, based on the + value of . A positive value is into the ChartRect relative to + the default axis position. + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Draw the scale, including the tic marks, value labels, and grid lines as + required for this . + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + The number of pixels to shift to account for non-primary axis position (e.g., + the second, third, fourth, etc. or . + + + + + Determine the width, in pixel units, of each bar cluster including + the cluster gaps and bar gaps. + + + This method uses the for + non-ordinal axes, or a cluster width of 1.0 for ordinal axes. + + A reference to the object + associated with this + The width of each bar cluster, in pixel units + + + + Calculates the cluster width, in pixels, by transforming the specified + clusterScaleWidth. + + The width in user scale units of each + bar cluster + The equivalent pixel size of the bar cluster + + + + Select a reasonable scale given a range of data values. + + + The scale range is chosen + based on increments of 1, 2, or 5 (because they are even divisors of 10). This + routine honors the , , + and autorange settings as well as the + setting. In the event that any of the autorange settings are false, the + corresponding , , or + setting is explicitly honored, and the remaining autorange settings (if any) will + be calculated to accomodate the non-autoranged values. The basic defaults for + scale selection are defined using , + , and + from the default class. + On Exit: + is set to scale minimum (if = true) + is set to scale maximum (if = true) + is set to scale step size (if = true) + is set to scale minor step size (if = true) + is set to a magnitude multiplier according to the data + is set to the display format for the values (this controls the + number of decimal places, whether there are thousands separators, currency types, etc.) + + A reference to the object + associated with this + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Calculate the maximum number of labels that will fit on this axis. + + + This method works for + both X and Y direction axes, and it works for angled text (assuming that a bounding box + is an appropriate measure). Technically, labels at 45 degree angles could fit better than + the return value of this method since the bounding boxes can overlap without the labels actually + overlapping. + + A reference to the object + associated with this + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Calculate a step size based on a data range. + + + This utility method + will try to honor the and + number of + steps while using a rational increment (1, 2, or 5 -- which are + even divisors of 10). This method is used by . + + The range of data in user scale units. This can + be a full range of the data for the major step size, or just the + value of the major step size to calculate the minor step size + The desired "typical" number of steps + to divide the range into + The calculated step size for the specified data range. + + + + Calculate a step size based on a data range, limited to a maximum number of steps. + + + This utility method + will calculate a step size, of no more than maxSteps, + using a rational increment (1, 2, or 5 -- which are + even divisors of 10). This method is used by . + + The range of data in user scale units. This can + be a full range of the data for the major step size, or just the + value of the major step size to calculate the minor step size + The maximum allowable number of steps + to divide the range into + The calculated step size for the specified data range. + + + + Internal routine to determine the ordinals of the first and last major axis label. + + + This is the total number of major tics for this axis. + + + + + Calculate the modulus (remainder) in a safe manner so that divide + by zero errors are avoided + + The divisor + The dividend + the value of the modulus, or zero for the divide-by-zero + case + + + + Define suitable default ranges for an axis in the event that + no data were available + + The of interest + The for which to set the range + + + + Transform the coordinate value from user coordinates (scale value) + to graphics device coordinates (pixels). + + This method takes into + account the scale range ( and ), + logarithmic state (), scale reverse state + () and axis type (, + , or ). + Note that the must be valid, and + must be called for the + current configuration before using this method (this is called everytime + the graph is drawn (i.e., is called). + + The coordinate value, in user scale units, to + be transformed + the coordinate value transformed to screen coordinates + for use in calling the draw routines + + + + Transform the coordinate value from user coordinates (scale value) + to graphics device coordinates (pixels). + + + This method takes into + account the scale range ( and ), + logarithmic state (), scale reverse state + () and axis type (, + , or ). + Note that the must be valid, and + must be called for the + current configuration before using this method (this is called everytime + the graph is drawn (i.e., is called). + + true to force the axis to honor the data + value, rather than replacing it with the ordinal value + The ordinal value of this point, just in case + this is an axis + The coordinate value, in user scale units, to + be transformed + the coordinate value transformed to screen coordinates + for use in calling the draw routines + + + + Reverse transform the user coordinates (scale value) + given a graphics device coordinate (pixels). + + + This method takes into + account the scale range ( and ), + logarithmic state (), scale reverse state + () and axis type (, + , or ). + Note that the must be valid, and + must be called for the + current configuration before using this method (this is called everytime + the graph is drawn (i.e., is called). + + The screen pixel value, in graphics device coordinates to + be transformed + The user scale value that corresponds to the screen pixel location + + + + Transform the coordinate value from user coordinates (scale value) + to graphics device coordinates (pixels). + + Assumes that the origin + has been set to the "left" of this axis, facing from the label side. + Note that the left side corresponds to the scale minimum for the X and + Y2 axes, but it is the scale maximum for the Y axis. + This method takes into + account the scale range ( and ), + logarithmic state (), scale reverse state + () and axis type (, + , or ). Note that + the must be valid, and + must be called for the + current configuration before using this method. + + The coordinate value, in linearized user scale units, to + be transformed + the coordinate value transformed to screen coordinates + for use in calling the method + + + + Calculate a base 10 logarithm in a safe manner to avoid math exceptions + + The value for which the logarithm is to be calculated + The value of the logarithm, or 0 if the + argument was negative or zero + + + + Calculate an exponential in a safe manner to avoid math exceptions + + The value for which the exponential is to be calculated + The exponent value to use for calculating the exponential. + + + + Gets or sets the linearized version of the scale range. + + + This value is valid at any time, whereas is an optimization + pre-set that is only valid during draw operations. + + + + + Gets or sets the linearized version of the scale range. + + + This value is valid at any time, whereas is an optimization + pre-set that is only valid during draw operations. + + + + + Get an enumeration that indicates the type of this scale. + + + + + True if this scale is , false otherwise. + + + + + True if this scale is , false otherwise. + + + + + True if this scale is , false otherwise. + + + + + True if this scale is , false otherwise. + + + + + True if this scale is , false otherwise. + + + Note that this is only true for an actual class. + This property will be false for other ordinal types such as + , , + or . Use the + as a "catchall" for all ordinal type axes. + + + + + Gets a value that indicates if this is of any of the + ordinal types in the enumeration. + + + + + + Gets or sets the minimum scale value for this . + + This value can be set + automatically based on the state of . If + this value is set manually, then will + also be set to false. + + The value is defined in user scale units for + and axes. For + and axes, + this value is an ordinal starting with 1.0. For + axes, this value is in XL Date format (see , which is the + number of days since the reference date of January 1, 1900. + + + + + + + + Gets or sets the maximum scale value for this . + + + This value can be set + automatically based on the state of . If + this value is set manually, then will + also be set to false. + + The value is defined in user scale units for + and axes. For + and axes, + this value is an ordinal starting with 1.0. For + axes, this value is in XL Date format (see , which is the + number of days since the reference date of January 1, 1900. + + + + + + + + Gets or sets the scale step size for this (the increment between + labeled axis values). + + + This value can be set + automatically based on the state of . If + this value is set manually, then will + also be set to false. This value is ignored for + axes. For axes, this + value is defined in units of . + + The value is defined in user scale units + + + + + + + + + + + + Gets or sets the scale minor step size for this (the spacing between + minor tics). + + This value can be set + automatically based on the state of . If + this value is set manually, then will + also be set to false. This value is ignored for and + axes. For axes, this + value is defined in units of . + + The value is defined in user scale units + + + + + + + + Gets or sets the scale exponent value. This only applies to . + + + + + + + + + + + + + Gets or sets the scale value at which the first major tic label will appear. + + This property allows the scale labels to start at an irregular value. + For example, on a scale range with = 0, = 1000, + and = 200, a value of 50 would cause + the scale labels to appear at values 50, 250, 450, 650, and 850. Note that the + default value for this property is , which means the + value is not used. Setting this property to any value other than + will activate the effect. The value specified must + coincide with the first major tic. That is, if were set to + 650 in the example above, then the major tics would only occur at 650 and 850. This + setting may affect the minor tics, since the minor tics are always referenced to the + . That is, in the example above, if the + were set to 30 (making it a non-multiple of the major step), then the minor tics would + occur at 20, 50 (so it lines up with the BaseTic), 80, 110, 140, etc. + + The value is defined in user scale units + + + + + + + + + Gets or sets the type of units used for the major step size (). + + + This unit type only applies to Date-Time axes ( = true). + The axis is set to date type with the property. + The unit types are defined as . + + The value is a enum type + + + + + + + + + Gets or sets the type of units used for the minor step size (). + + + This unit type only applies to Date-Time axes ( = true). + The axis is set to date type with the property. + The unit types are defined as . + + The value is a enum type + + + + + + + + + Gets the major unit multiplier for this scale type, if any. + + The major unit multiplier will correct the units of + to match the units of + and . This reflects the setting of + . + + + + + Gets the minor unit multiplier for this scale type, if any. + + The minor unit multiplier will correct the units of + to match the units of + and . This reflects the setting of + . + + + + + Gets or sets a value that determines whether or not the minimum scale value + is set automatically. + + + This value will be set to false if + is manually changed. + + true for automatic mode, false for manual mode + + + + + Gets or sets a value that determines whether or not the maximum scale value + is set automatically. + + + This value will be set to false if + is manually changed. + + true for automatic mode, false for manual mode + + + + + Gets or sets a value that determines whether or not the scale step size + is set automatically. + + + This value will be set to false if + is manually changed. + + true for automatic mode, false for manual mode + + + + + Gets or sets a value that determines whether or not the minor scale step size + is set automatically. + + + This value will be set to false if + is manually changed. + + true for automatic mode, false for manual mode + + + + + Determines whether or not the scale label format + is determined automatically based on the range of data values. + + + This value will be set to false if + is manually changed. + + true if will be set automatically, false + if it is to be set manually by the user + + + + + + + The format of the tic labels. + + + This property may be a date format or a numeric format, depending on the setting of + Scale.Type. + This property may be set automatically by ZedGraph, depending on the state of + . + + The format string conforms to the + for date formats, and + for numeric formats. + + + + + + + + The magnitude multiplier for scale values. + + + This is used to limit + the size of the displayed value labels. For example, if the value + is really 2000000, then the graph will display 2000 with a 10^3 + magnitude multiplier. This value can be determined automatically + depending on the state of . + If this value is set manually by the user, + then will also be set to false. + + The magnitude multiplier (power of 10) for the scale + value labels + + + + + + + + Determines whether the value will be set + automatically based on the data, or manually by the user. + + + If the user manually sets the value, then this + flag will be set to false. + + true to have set automatically, + false otherwise + + + + + + Gets or sets the "grace" value applied to the minimum data range. + + + This value is + expressed as a fraction of the total data range. For example, assume the data + range is from 4.0 to 16.0, leaving a range of 12.0. If MinGrace is set to + 0.1, then 10% of the range, or 1.2 will be subtracted from the minimum data value. + The scale will then be ranged to cover at least 2.8 to 16.0. + + + + + + + Gets or sets the "grace" value applied to the maximum data range. + + + This values determines how much extra space is left after the last data value. + This value is + expressed as a fraction of the total data range. For example, assume the data + range is from 4.0 to 16.0, leaving a range of 12.0. If MaxGrace is set to + 0.1, then 10% of the range, or 1.2 will be added to the maximum data value. + The scale will then be ranged to cover at least 4.0 to 17.2. + + + + + + + Controls the alignment of the tic labels. + + + This property controls whether the inside, center, or outside edges of the + text labels are aligned. + + + + Controls the alignment of the tic labels. + + + This property controls whether the left, center, or right edges of the + text labels are aligned. + + + + + Gets a reference to the class used to render + the scale values + + + + + + + + + + + The gap between the scale labels and the tics. + + + + + Gets or sets a value that causes the axis scale labels and title to appear on the + opposite side of the axis. + + + For example, setting this flag to true for the will shift the + axis labels and title to the right side of the instead of the + normal left-side location. Set this property to true for the , + and set the property for the to an arbitrarily + large value (assuming is false for the ) in + order to have the appear at the top of the . + + + + + + + Gets or sets a value that causes the first scale label for this to be + hidden. + + + Often, for axis that have an active setting (e.g., + is false), the first and/or last scale label are overlapped by opposing axes. Use this + property to hide the first scale label to avoid the overlap. Note that setting this value + to true will hide any scale label that appears within of the + beginning of the . + + + + + Gets or sets a value that causes the last scale label for this to be + hidden. + + + Often, for axis that have an active setting (e.g., + is false), the first and/or last scale label are overlapped by opposing axes. Use this + property to hide the last scale label to avoid the overlap. Note that setting this value + to true will hide any scale label that appears within of the + end of the . + + + + + Gets or sets a value that causes the scale label that is located at the + value for this to be hidden. + + + For axes that have an active setting (e.g., + is false), the scale label at the value is overlapped by opposing axes. + Use this property to hide the scale label to avoid the overlap. + + + + + Determines if the scale values are reversed for this + + true for the X values to decrease to the right or the Y values to + decrease upwards, false otherwise + . + + + + Determines if powers-of-ten notation will be used for the numeric value labels. + + + The powers-of-ten notation is just the text "10" followed by a superscripted value + indicating the magnitude. This mode is only valid for log scales (see + and ). + + boolean value; true to show the title as a power of ten, false to + show a regular numeric value (e.g., "0.01", "10", "1000") + + + + Gets or sets a value that determines if ZedGraph will check to + see if the scale labels are close enough to overlap. If so, + ZedGraph will adjust the step size to prevent overlap. + + + The process of checking for overlap is done during the + method call, and affects the selection of the major step size (). + + boolean value; true to check for overlap, false otherwise + + + + Gets or sets a property that determines whether or not the scale values will be shown. + + true to show the scale values, false otherwise + . + + + + The text labels for this . + + + This property is only + applicable if is set to . + + + + + A simple struct that defines the + default property values for the class. + + + + + The default "zero lever" for automatically selecting the axis + scale range (see ). This number is + used to determine when an axis scale range should be extended to + include the zero value. This value is maintained only in the + class, and cannot be changed after compilation. + + + + The default "grace" value applied to the minimum data range. + This value is + expressed as a fraction of the total data range. For example, assume the data + range is from 4.0 to 16.0, leaving a range of 12.0. If MinGrace is set to + 0.1, then 10% of the range, or 1.2 will be subtracted from the minimum data value. + The scale will then be ranged to cover at least 2.8 to 16.0. + + + + + The default "grace" value applied to the maximum data range. + This value is + expressed as a fraction of the total data range. For example, assume the data + range is from 4.0 to 16.0, leaving a range of 12.0. If MaxGrace is set to + 0.1, then 10% of the range, or 1.2 will be added to the maximum data value. + The scale will then be ranged to cover at least 4.0 to 17.2. + + + + + + + The maximum number of text labels (major tics) that will be allowed on the plot by + the automatic scaling logic. This value applies only to + axes. If there are more than MaxTextLabels on the plot, then + will be increased to reduce the number of labels. That is, + the step size might be increased to 2.0 to show only every other label. + + + + + The default target number of steps for automatically selecting the X axis + scale step size (see ). + This number is an initial target value for the number of major steps + on an axis. This value is maintained only in the + class, and cannot be changed after compilation. + + + + + The default target number of steps for automatically selecting the Y or Y2 axis + scale step size (see ). + This number is an initial target value for the number of major steps + on an axis. This value is maintained only in the + class, and cannot be changed after compilation. + + + + + The default target number of minor steps for automatically selecting the X axis + scale minor step size (see ). + This number is an initial target value for the number of minor steps + on an axis. This value is maintained only in the + class, and cannot be changed after compilation. + + + + + The default target number of minor steps for automatically selecting the Y or Y2 axis + scale minor step size (see ). + This number is an initial target value for the number of minor steps + on an axis. This value is maintained only in the + class, and cannot be changed after compilation. + + + + + The default reverse mode for the scale + ( property). true for a reversed scale + (X decreasing to the left, Y/Y2 decreasing upwards), false otherwise. + + + + + The default setting for the scale format string + ( property). For numeric values, this value is + setting according to the format strings. For date + type values, this value is set as per the function. + + + + + A default setting for the auto-ranging code. + This values applies only to Date-Time type axes. + If the total span of data exceeds this number (in days), then the auto-range + code will select = + and = . + This value normally defaults to 1825 days (5 years). + This value is used by the method. + + + + + A default setting for the auto-ranging code. + This values applies only to Date-Time type axes. + If the total span of data exceeds this number (in days), then the auto-range + code will select = + and = . + This value normally defaults to 730 days (2 years). + This value is used by the method. + + + + + A default setting for the auto-ranging code. + This values applies only to Date-Time type axes. + If the total span of data exceeds this number (in days), then the auto-range + code will select = + and = . + This value normally defaults to 300 days (10 months). + This value is used by the method. + + + + + A default setting for the auto-ranging code. + This values applies only to Date-Time type axes. + If the total span of data exceeds this number (in days), then the auto-range + code will select = + and = . + This value normally defaults to 10 days. + This value is used by the method. + + + + + A default setting for the auto-ranging code. + This values applies only to Date-Time type axes. + If the total span of data exceeds this number (in days), then the auto-range + code will select = + and = . + This value normally defaults to 3 days. + This value is used by the method. + + + + + A default setting for the auto-ranging code. + This values applies only to Date-Time type axes. + If the total span of data exceeds this number (in days), then the auto-range + code will select = + and = . + This value normally defaults to 0.4167 days (10 hours). + This value is used by the method. + + + + + A default setting for the auto-ranging code. + This values applies only to Date-Time type axes. + If the total span of data exceeds this number (in days), then the auto-range + code will select = + and = . + This value normally defaults to 0.125 days (3 hours). + This value is used by the method. + + + + + A default setting for the auto-ranging code. + This values applies only to Date-Time type axes. + If the total span of data exceeds this number (in days), then the auto-range + code will select = + and = . + This value normally defaults to 6.94e-3 days (10 minutes). + This value is used by the method. + + + + + A default setting for the auto-ranging code. + This values applies only to Date-Time type axes. + If the total span of data exceeds this number (in days), then the auto-range + code will select = + and = . + This value normally defaults to 2.083e-3 days (3 minutes). + This value is used by the method. + + + + + A default setting for the auto-ranging code. + This values applies only to Date-Time type axes. + If the total span of data exceeds this number (in days), then the auto-range + code will select = + and = . + This value normally defaults to 3.472e-5 days (3 seconds). + This value is used by the method. + + + + + A default setting for the auto-ranging code. + This values applies only to Date-Time type axes. + This is the format used for the scale values when auto-ranging code + selects a of + for and for + for . + This value is used by the method. + + + + + + A default setting for the auto-ranging code. + This values applies only to Date-Time type axes. + This is the format used for the scale values when auto-ranging code + selects a of + for and for + for . + This value is used by the method. + + + + + + A default setting for the auto-ranging code. + This values applies only to Date-Time type axes. + This is the format used for the scale values when auto-ranging code + selects a of + for and for + for . + This value is used by the method. + + + + + + A default setting for the auto-ranging code. + This values applies only to Date-Time type axes. + This is the format used for the scale values when auto-ranging code + selects a of + for and for + for . + This value is used by the method. + + + + + + A default setting for the auto-ranging code. + This values applies only to Date-Time type axes. + This is the format used for the scale values when auto-ranging code + selects a of + for and for + for . + This value is used by the method. + + + + + + A default setting for the auto-ranging code. + This values applies only to Date-Time type axes. + This is the format used for the scale values when auto-ranging code + selects a of + for and for + for . + This value is used by the method. + + + + + + A default setting for the auto-ranging code. + This values applies only to Date-Time type axes. + This is the format used for the scale values when auto-ranging code + selects a of + for and for + for . + This value is used by the method. + + + + + + A default setting for the auto-ranging code. + This values applies only to Date-Time type axes. + This is the format used for the scale values when auto-ranging code + selects a of + for and for + for . + This value is used by the method. + + + + + + A default setting for the auto-ranging code. + This values applies only to Date-Time type axes. + This is the format used for the scale values when auto-ranging code + selects a of + for and for + for . + This value is used by the method. + + + + + + A default setting for the auto-ranging code. + This values applies only to Date-Time type axes. + This is the format used for the scale values when auto-ranging code + selects a of + for and for + for . + This value is used by the method. + + + + + + A default setting for the auto-ranging code. + This values applies only to Date-Time type axes. + This is the format used for the scale values when auto-ranging code + selects a of + for and for + for . + This value is used by the method. + + + + + The default alignment of the tic labels. + This value controls whether the inside, center, or outside edges of the text labels are aligned. + + + + + The default alignment of the tic labels. + This value controls whether the left, center, or right edges of the text labels are aligned. + + + + + + The default font family for the scale values + font specification + ( property). + + + + + The default font size for the scale values + font specification + ( property). Units are + in points (1/72 inch). + + + + + The default font color for the scale values + font specification + ( property). + + + + + The default font bold mode for the scale values + font specification + ( property). true + for a bold typeface, false otherwise. + + + + + The default font italic mode for the scale values + font specification + ( property). true + for an italic typeface, false otherwise. + + + + + The default font underline mode for the scale values + font specification + ( property). true + for an underlined typeface, false otherwise. + + + + + The default color for filling in the scale text background + (see property). + + + + + The default custom brush for filling in the scale text background + (see property). + + + + + The default fill mode for filling in the scale text background + (see property). + + + + + The default value for , which determines + whether or not the scale values are displayed. + + + + + The default value for , which determines + whether or not the scale labels and title for the will appear + on the opposite side of the that it normally appears. + + + + + Determines the size of the band at the beginning and end of the axis that will have labels + omitted if the axis is shifted due to a non-default location using the + property. + + + This parameter applies only when is false. It is scaled according + to the size of the graph based on . When a non-default + axis location is selected, the first and last labels on that axis will overlap the opposing + axis frame. This parameter allows those labels to be omitted to avoid the overlap. Set this + parameter to zero to turn off the effect. + + + + + The default setting for the gap between the outside tics (or the axis edge + if there are no outside tics) and the scale labels, expressed as a fraction of + the major tic size. + + + + + Class that holds the specific properties for the minor grid. + + John Champion + $Revision: 3.1 $ $Date: 2006-06-24 20:26:44 $ + + + + Current schema value that defines the version of the serialized file + + + + + Default constructor + + + + + Copy constructor + + The source to be copied. + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Gets or sets a value that determines if the major gridlines + (at each labeled value) will be visible + + true to show the gridlines, false otherwise + Default.IsShowGrid. + + + + + + + + + The "Dash On" mode for drawing the grid. + + + This is the distance, + in points (1/72 inch), of the dash segments that make up the dashed grid lines. + + The dash on length is defined in points (1/72 inch) + + + . + + + + The "Dash Off" mode for drawing the grid. + + + This is the distance, + in points (1/72 inch), of the spaces between the dash segments that make up + the dashed grid lines. + + The dash off length is defined in points (1/72 inch) + + + . + + + + The pen width used for drawing the grid lines. + + The grid pen width is defined in points (1/72 inch) + + . + + + + + The color to use for drawing this grid. + + The color is defined using the + class + . + + + + + A simple struct that defines the + default property values for the class. + + + + + The default "dash on" size for drawing the minor grid + ( property). Units are in points (1/72 inch). + + + + + The default "dash off" size for drawing the minor grid + ( property). Units are in points (1/72 inch). + + + + + The default pen width for drawing the minor grid + ( property). Units are in points (1/72 inch). + + + + + The default color for the minor grid lines + ( property). This color only affects the + minor grid lines. + + + + + The default display mode for the minor grid lines + ( property). true + to show the minor grid lines, false to hide them. + + + + + A class than contains information about the position of an object on the graph. + + + John Champion + $Revision: 3.14 $ $Date: 2006-06-24 20:26:43 $ + + + + Current schema value that defines the version of the serialized file + + + + Private field to store the vertical alignment property for + this object. Use the public property + to access this value. The value of this field is a enum. + + + + Private field to store the horizontal alignment property for + this object. Use the public property + to access this value. The value of this field is a enum. + + + + Private fields to store the X and Y coordinate positions for + this object. Use the public properties and + to access these values. The coordinate type stored here is + dependent upon the setting of . + + + + Private fields to store the X and Y coordinate positions for + this object. Use the public properties and + to access these values. The coordinate type stored here is + dependent upon the setting of . + + + + Private fields to store the X and Y coordinate positions for + this object. Use the public properties and + to access these values. The coordinate type stored here is + dependent upon the setting of . + + + + Private fields to store the X and Y coordinate positions for + this object. Use the public properties and + to access these values. The coordinate type stored here is + dependent upon the setting of . + + + + + Private field to store the coordinate system to be used for defining the + object position. Use the public property + to access this value. The coordinate system + is defined with the enum. + + + + + Default constructor for the class. + + + + + Constructor for the class that specifies the + x, y position and the . + + + The (x,y) position corresponds to the top-left corner; + + The x position, specified in units of . + + The y position, specified in units of . + + The enum that specifies the + units for and + + + + Constructor for the class that specifies the + x, y position and the . + + + The (x,y) position corresponds to the top-left corner; + + The x position, specified in units of . + + The y position, specified in units of . + + The enum that specifies the + units for and + The enum that specifies + the horizontal alignment of the object with respect to the (x,y) location + The enum that specifies + the vertical alignment of the object with respect to the (x,y) location + + + + Constructor for the class that specifies the + (x, y), (width, height), and the . + + + The (x,y) position + corresponds to the starting position, the (x2, y2) coorresponds to the ending position + (typically used for 's). + + The x position, specified in units of . + + The y position, specified in units of . + + The width, specified in units of . + + The height, specified in units of . + + The enum that specifies the + units for and + The enum that specifies + the horizontal alignment of the object with respect to the (x,y) location + The enum that specifies + the vertical alignment of the object with respect to the (x,y) location + + + + The Copy Constructor + + The object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Transform this object to display device + coordinates using the properties of the specified . + + + A reference to the object that contains + the classes which will be used for the transform. + + A point in display device coordinates that corresponds to the + specified user point. + + + + Transform a data point from the specified coordinate type + () to display device coordinates (pixels). + + + If is not of type , then + only the transformation is available. + + + A reference to the object that contains + the classes which will be used for the transform. + + The x coordinate that defines the point in user + space. + The y coordinate that defines the point in user + space. + A type that defines the + coordinate system in which the X,Y pair is defined. + A point in display device coordinates that corresponds to the + specified user point. + + + + Transform this from the coordinate system + as specified by to the device coordinates + of the specified object. + + + The returned + struct represents the top-left corner of the + object that honors the properties. + The and properties are honored in + this transformation. + + + A reference to the object that contains + the classes which will be used for the transform. + + The width of the object in device pixels + The height of the object in device pixels + The top-left corner of the object + + + + The for this object as defined by the + and + properties. + + + This method transforms the location to output device pixel units. + The and properties are ignored for + this transformation (see ). + + A in pixel units. + + + + The for this object as defined by the + and properties. + + + This method transforms the location to output device pixel units. + The and properties are ignored for + this transformation (see ). + + A in pixel units. + + + + Transform the for this object as defined by the + , , , and + properties. + + + This method transforms the location to output device pixel units. + The and properties are honored in + this transformation. + + A in pixel units. + + + + A horizontal alignment parameter for this object specified + using the enum type. + + + + + A vertical alignment parameter for this object specified + using the enum type. + + + + + The coordinate system to be used for defining the object position + + The coordinate system is defined with the + enum + + + + The x position of the object. + + + The units of this position + are specified by the property. + The object will be aligned to this position based on the + property. + + + + + The y position of the object. + + + The units of this position + are specified by the property. + The object will be aligned to this position based on the + property. + + + + + The x1 position of the object (an alias for the x position). + + + The units of this position + are specified by the property. + The object will be aligned to this position based on the + property. + + + + + The y1 position of the object (an alias for the y position). + + + The units of this position + are specified by the property. + The object will be aligned to this position based on the + property. + + + + + The width of the object. + + + The units of this position are specified by the + property. + + + + + The height of the object. + + + The units of this position are specified by the + property. + + + + + The x2 position of the object. + + + The units of this position are specified by the + property. + The object will be aligned to this position based on the + property. This position is only used for + objects such as , where it makes sense + to have a second coordinate. Note that the X2 position is stored + internally as a offset from . + + + + + The y2 position of the object. + + + The units of this position + are specified by the property. + The object will be aligned to this position based on the + property. This position is only used for + objects such as , where it makes sense + to have a second coordinate. Note that the Y2 position is stored + internally as a offset from . + + + + + The for this object as defined by the + , , , and + properties. + + + Note that this method reduces the precision of the location coordinates from double + precision to single precision. In some cases, such as , it + may affect the resolution of the point location. + + A in + units. + + + + The top-left for this . + + + Note that this method reduces the precision of the location coordinates from double + precision to single precision. In some cases, such as , it + may affect the resolution of the point location. + + A in units. + + + + The bottom-right for this . + + + Note that this method reduces the precision of the location coordinates from double + precision to single precision. In some cases, such as , it + may affect the resolution of the point location. + + A in units. + + + + This class handles the drawing of the curve objects. + + + John Champion + $Revision: 3.10 $ $Date: 2007-04-16 00:03:02 $ + + + + This class handles the drawing of the curve objects. + + + John Champion + $Revision: 3.5 $ $Date: 2007-04-16 00:03:02 $ + + + + Current schema value that defines the version of the serialized file + + + + + Private field that stores the visibility of the open and + close line segments ("wings"). Use the public + property to access this value. If this value is + false, the wings will not be shown. + + + + + Private field that stores the total width for the Opening/Closing line + segments. Use the public property to access this value. + + + + + Private field that determines if the property will be + calculated automatically based on the minimum axis scale step size between + bars. Use the public property to access this value. + + + + + The result of the autosize calculation, which is the size of the bars in + user scale units. This is converted to pixels at draw time. + + + + + Default constructor that sets all properties to + default values as defined in the class. + + + + + Default constructor that sets the + as specified, and the remaining + properties to default + values as defined in the class. + + A value indicating + the color of the symbol + + + + + The Copy Constructor + + The object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Draw the to the specified + device at the specified location. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + boolean value that indicates if the "base" axis for this + is the X axis. True for an base, + false for a or base. + The independent axis position of the center of the candlestick in + pixel units + The dependent axis position of the top of the candlestick in + pixel units + The dependent axis position of the bottom of the candlestick in + pixel units + The dependent axis position of the opening value of the candlestick in + pixel units + The dependent axis position of the closing value of the candlestick in + pixel units + + The scaled width of the candlesticks, pixels + A pen with attributes of and + for this + + + + Draw all the 's to the specified + device as a candlestick at each defined point. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + A object representing the + 's to be drawn. + The class instance that defines the base (independent) + axis for the + The class instance that defines the value (dependent) + axis for the + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Returns the width of the candleStick, in pixels, based on the settings for + and . + + The parent object. + The object that + represents the bar base (independent axis). + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + The width of each bar, in pixel units + + + + Gets or sets a property that shows or hides the open/close "wings". + + true to show the CandleStick wings, false to hide them + + + + + Gets or sets the total width to be used for drawing the opening/closing line + segments ("wings") of the items. Units are points. + + The size of the candlesticks can be set by this value, which + is then scaled according to the scaleFactor (see + ). Alternatively, + if is true, the bar width will + be set according to the maximum available cluster width less + the cluster gap (see + and ). That is, if + is true, then the value of + will be ignored. If you modify the value of Size, + then will be automatically set to false. + + Size in points (1/72 inch) + + + + + Gets or sets a value that determines if the property will be + calculated automatically based on the minimum axis scale step size between + bars. + + + + + A simple struct that defines the + default property values for the class. + + + + + The default width for the candlesticks (see ), + in units of points. + + + + + The default display mode for symbols ( property). + true to display symbols, false to hide them. + + + + + The default value for the property. + + + + + Current schema value that defines the version of the serialized file + + + + + Private field to store the class to be used for filling the + candlestick "bars" when the value is greater than + the value. See the public property + to access this value. + + + + + Private field to store the class to be used for filling the + candlestick "bars" when the value is less than + the value. See the public property + to access this value. + + + + + Private field to store the class to be used for drawing the + candlestick "bars" when the value is greater than + the value. See the public property + to access this value. + + + + + Private field to store the class to be used for drawing the + candlestick "bars" when the value is less than + the value. See the public property + to access this value. + + + + + Private field that stores the CandleStick color when the + value is less than the value. Use the public + property to access this value. + + + + + Default constructor that sets all properties to + default values as defined in the class. + + + + + The Copy Constructor + + The object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Draw the to the specified + device at the specified location. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + boolean value that indicates if the "base" axis for this + is the X axis. True for an base, + false for a or base. + The independent axis position of the center of the candlestick in + pixel units + The high value position of the candlestick in + pixel units + The low value position of the candlestick in + pixel units + The opening value position of the candlestick in + pixel units + The closing value position of the candlestick in + pixel units + The scaled width of one-half of a bar, in pixels + + The scaling factor for the features of the graph based on the . This + scaling factor is calculated by the method. The scale factor + represents a linear multiple to be applied to font sizes, symbol sizes, etc. + A pen with the attribute for this + + + The instance to be used for filling this + + + The instance to be used for drawing the + border around the filled box + The to be used for determining the + , just in case it's a , + , or + + + + + Draw all the 's to the specified + device as a candlestick at each defined point. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + A object representing the + 's to be drawn. + The class instance that defines the base (independent) + axis for the + The class instance that defines the value (dependent) + axis for the + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Gets or sets the class that is used to fill the candlestick + "bars" when the value is greater than the + value. + + + + + Gets or sets the class that is used to fill the candlestick + "bars" when the value is less than the + value. + + + + + The instance to be used for drawing the border frame of + the candlestick "bars" when the value is greater than the + value. + + + + + The instance to be used for drawing the border frame of + the candlestick "bars" when the value is less than the + value. + + + + + Gets or sets the data for this + when the value of the candlestick is + falling. + + This property only controls the color of + the vertical line when the value is falling. The rising color is controlled + by the property. + + + + + A simple struct that defines the + default property values for the class. + + + + + The default fillcolor for drawing the rising case CandleSticks + ( property). + + + + + The default fillcolor for drawing the falling case CandleSticks + ( property). + + + + + The default color for the border of the rising CandleSticks + ( property). + + + + + The default color for the border of the falling CandleSticks + ( property). + + + + + A collection class containing a list of objects. + + + John Champion + $Revision: 3.3 $ $Date: 2006-06-24 20:26:43 $ + + + + Default constructor for the collection class. + + + + + The Copy Constructor + + The object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Return the zero-based position index of the + with the specified . + + The comparison of titles is not case sensitive, but it must include + all characters including punctuation, spaces, etc. + The label that is in the + attribute of the item to be found. + + The zero-based index of the specified , + or -1 if the was not found in the list + + + + + Return the zero-based position index of the + with the specified . + + In order for this method to work, the + property must be of type . + The tag that is in the + attribute of the item to be found. + + The zero-based index of the specified , + or -1 if the string is not in the list + + + + + Create a new and add it to this list. + + The title string for the new axis + An integer representing the ordinal position of the new in + this . This is the value that you would set the + property of a given to + assign it to this new . Note that, for a , + you would also need to set the property to true. + + + + Indexer to access the specified object by + its ordinal position in the list. + + The ordinal position (zero-based) of the + object to be accessed. + An object reference. + + + + Indexer to access the specified object by + its string. + + The string title of the + object to be accessed. + A object reference. + + + + A collection class that maintains a list of + objects, corresponding to the list of objects + from or . + + + + + Construct a new automatically from an + existing . + + The (a list of Y axes), + from which to retrieve the state and create the + objects. + + + + Construct a new automatically from an + existing . + + The (a list of Y axes), + from which to retrieve the state and create the + objects. + + + + The Copy Constructor + + The object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Iterate through the list of objects, comparing them + to the state of the specified + objects. + + A object specifying a list of + objects to be compared with this . + + true if a difference is found, false otherwise + + + + Iterate through the list of objects, comparing them + to the state of the specified + objects. + + A object specifying a list of + objects to be compared with this . + + true if a difference is found, false otherwise + + + + + + + + + + + + + + + + A collection class containing a list of objects + organized together in some form. + + + John Champion + $Revision: 3.26 $ $Date: 2007-11-05 18:28:56 $ + + + + An abstract base class that defines basic functionality for handling a pane. This class is the + parent class for and . + + + John Champion + $Revision: 3.32 $ $Date: 2007-11-05 18:28:56 $ + + + + Current schema value that defines the version of the serialized file + + + + + The rectangle that defines the full area into which the pane is rendered. Units are pixels. + Use the public property to access this value. + + + + Private field that holds the main title of the pane. Use the + public property to access this value. + + + + Private field instance of the class. Use the + public property to access this class. + + + + Private field that stores the user-defined tag for this . This tag + can be any user-defined value. If it is a type, it can be used as + a parameter to the method. Use the public property + to access this value. + + + + + private field to store the margin values for this . Use the + public property to access this property. + + + + Private field that determines whether or not the fonts, tics, gaps, etc. + will be scaled according to the actual graph size. true for font and feature scaling + with graph size, false for fixed font sizes (scaleFactor = 1.0 constant). + Use the public property to access this value. + + + + + + Private field that controls whether or not pen widths are scaled according to the + size of the graph. This value is only applicable if + is true. If is false, then no scaling will be done, + regardless of the value of . + + true to scale the pen widths according to the size of the graph, + false otherwise. + + + + + + Private field that stores the data for the + background. Use the public property to + access this value. + + + + + Private field that stores the data for the + border. Use the public property to + access this value. + + + + Private field instance of the class. Use the + public property to access this class. + + + Private field that determines the base size of the pane, in inches. + Fonts, tics, gaps, etc. are scaled according to this base size. + Use the public property to access this value. + + + + + + private field that stores the gap between the bottom of the pane title and the + client area of the pane. This is expressed as a fraction of the title character height. + + + + + Default constructor for the class. Leaves the empty. + + + + + Default constructor for the class. Specifies the of + the , and the size of the . + + + + + The Copy Constructor + + The object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of Clone + + + Note that this method must be called with an explicit cast to ICloneable, and + that it is inherently virtual. For example: + + ParentClass foo = new ChildClass(); + ChildClass bar = (ChildClass) ((ICloneable)foo).Clone(); + + Assume that ChildClass is inherited from ParentClass. Even though foo is declared with + ParentClass, it is actually an instance of ChildClass. Calling the ICloneable implementation + of Clone() on foo actually calls ChildClass.Clone() as if it were a virtual function. + + A deep copy of this object + + + + Create a shallow, memberwise copy of this class. + + + Note that this method uses MemberWiseClone, which will copy all + members (shallow) including those of classes derived from this class. + a new copy of the class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Do all rendering associated with this to the specified + device. This abstract method is implemented by the child + classes. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + + + Calculate the client area rectangle based on the . + + The client rectangle is the actual area available for + or items after taking out space for the margins and the title. + This method does not take out the area required for the . + To do so, you must separately call . + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + The scaling factor for the features of the graph based on the . This + scaling factor is calculated by the method. The scale factor + represents a linear multiple to be applied to font sizes, symbol sizes, etc. + + The calculated chart rect, in pixel coordinates. + + + + Draw the border _border around the area. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + The scaling factor for the features of the graph based on the . This + scaling factor is calculated by the method. The scale factor + represents a linear multiple to be applied to font sizes, symbol sizes, etc. + + + + + Draw the on the graph, centered at the top of the pane. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + The scaling factor for the features of the graph based on the . This + scaling factor is calculated by the method. The scale factor + represents a linear multiple to be applied to font sizes, symbol sizes, etc. + + + + + Change the size of the . Override this method to handle resizing the contents + as required. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + The new size for the . + + + + Calculate the scaling factor based on the ratio of the current dimensions and + the . + + This scaling factor is used to proportionally scale the + features of the so that small graphs don't have huge fonts, and vice versa. + The scale factor represents a linear multiple to be applied to font sizes, symbol sizes, tic sizes, + gap sizes, pen widths, etc. The units of the scale factor are "World Pixels" per "Standard Point". + If any object size, in points, is multiplied by this scale factor, the result is the size, in pixels, + that the object should be drawn using the standard GDI+ drawing instructions. A "Standard Point" + is a dimension based on points (1/72nd inch) assuming that the size + matches the . + Note that "World Pixels" will still be transformed by the GDI+ transform matrices to result + in "Output Device Pixels", but "World Pixels" are the reference basis for the drawing commands. + + + A value representing the scaling factor to use for the rendering calculations. + + + + + + Calculate the scaled pen width, taking into account the scaleFactor and the + setting of the property of the pane. + + The pen width, in points (1/72 inch) + + The scaling factor for the features of the graph based on the . This + scaling factor is calculated by the method. The scale factor + represents a linear multiple to be applied to font sizes, symbol sizes, etc. + + The scaled pen width, in world pixels + + + + Build a object containing the graphical rendering of + all the objects in this list. + + A object rendered with the current graph. + + + + + + + Build a object containing the graphical rendering of + all the objects in this list. + + A object rendered with the current graph. + + + + + + + Gets an image for the current GraphPane, scaled to the specified size and resolution. + + The scaled width of the bitmap in pixels + The scaled height of the bitmap in pixels + The resolution of the bitmap, in dots per inch + true for anti-aliased rendering, false otherwise + + + + + + + + Gets an image for the current GraphPane, scaled to the specified size and resolution. + + The scaled width of the bitmap in pixels + The scaled height of the bitmap in pixels + The resolution of the bitmap, in dots per inch + + + + + + + + Setup a instance with appropriate antialias settings. + + + No settings are modified if is set to false. This method + does not restore original settings, it presumes that the Graphics instance will be + disposed. + An existing instance + true to render in anti-alias mode, false otherwise + + + + Gets an enhanced metafile image for the current GraphPane, scaled to the specified size. + + + By definition, a Metafile is a vector drawing, and therefore scaling should not matter. + However, this method is provided because certain options in Zedgraph, such as + are affected by the size of the expected image. + + The "effective" scaled width of the bitmap in pixels + The "effective" scaled height of the bitmap in pixels + true to use anti-aliased drawing mode, false otherwise + + + + + + + Gets an enhanced metafile image for the current GraphPane, scaled to the specified size. + + + By definition, a Metafile is a vector drawing, and therefore scaling should not matter. + However, this method is provided because certain options in Zedgraph, such as + are affected by the size of the expected image. + + The "effective" scaled width of the bitmap in pixels + The "effective" scaled height of the bitmap in pixels + + + + + + + Gets an enhanced metafile image for the current GraphPane. + + + + + + + + The rectangle that defines the full area into which all graphics + will be rendered. + + Note that this rectangle has x, y, width, and height. Most of the + GDI+ graphic primitive actually draw one pixel beyond those dimensions. For + example, for a rectangle of ( X=0, Y=0, Width=100, Height=100 ), GDI+ would + draw into pixels 0 through 100, which is actually 101 pixels. For the + ZedGraph Rect, a Width of 100 pixels means that pixels 0 through 99 are used + Units are pixels. + + + + + Accesses the for this + + A reference to a object + + + + Gets the instance that contains the text and attributes of the title. + This text can be multiple lines separated by newline characters ('\n'). + + + + + + + + + + + + Gets or sets the user-defined tag for this . This tag + can be any user-defined value. If it is a type, it can be used as + a parameter to the method. + + + Note that, if you are going to Serialize ZedGraph data, then any type + that you store in must be a serializable type (or + it will cause an exception). + + + + + Gets or sets the class for drawing the border + border around the + + + + + + + Gets or sets the data for the + filling the background of the . + + + + + Gets or sets the list of items for this + + A reference to a collection object + + + + Gets or sets the instance that controls the space between + the edge of the and the rendered content of the graph. + + + + + BaseDimension is a double precision value that sets "normal" pane size on + which all the settings are based. The BaseDimension is in inches. For + example, if the BaseDimension is 8.0 inches and the + size is 14 points. Then the pane title font + will be 14 points high when the is approximately 8.0 + inches wide. If the Rect is 4.0 inches wide, the pane title font will be + 7 points high. Most features of the graph are scaled in this manner. + + The base dimension reference for the , in inches + + + + + + + Gets or sets the gap between the bottom of the pane title and the + client area of the pane. This is expressed as a fraction of the scaled + character height. + + + + + Determines if the font sizes, tic sizes, gap sizes, etc. will be scaled according to + the size of the and the . If this + value is set to false, then the font sizes and tic sizes will always be exactly as + specified, without any scaling. + + True to have the fonts and tics scaled, false to have them constant + + + + + Gets or sets the property that controls whether or not pen widths are scaled for this + . + + This value is only applicable if + is true. If is false, then no scaling will be done, + regardless of the value of . Note that scaling the pen + widths can cause "artifacts" to appear at typical screen resolutions. This occurs + because of roundoff differences; in some cases the pen width may round to 1 pixel wide + and in another it may round to 2 pixels wide. The result is typically undesirable. + Therefore, this option defaults to false. This option is primarily useful for high + resolution output, such as printer output or high resolution bitmaps (from + ) where it is desirable to have the pen width + be consistent with the screen image. + + true to scale the pen widths according to the size of the graph, + false otherwise. + + + + + + A simple struct that defines the default property values for the class. + + + + + The default display mode for the title at the top of the pane + ( property). true to + display a title, false otherwise. + + + + + The default font family for the title + ( property). + + + + + The default font size (points) for the + ( property). + + + + + The default font color for the + + ( property). + + + + + The default font bold mode for the + + ( property). true + for a bold typeface, false otherwise. + + + + + The default font italic mode for the + + ( property). true + for an italic typeface, false otherwise. + + + + + The default font underline mode for the + + ( property). true + for an underlined typeface, false otherwise. + + + + + The default border mode for the . + ( property). true + to draw a border around the , + false otherwise. + + + + + The default color for the border. + ( property). + + + + + The default color for the background. + ( property). + + + + + The default pen width for the border. + ( property). Units are in points (1/72 inch). + + + + + The default dimension of the , which + defines a normal sized plot. This dimension is used to scale the + fonts, symbols, etc. according to the actual size of the + . + + + + + + The default setting for the option. + true to have all pen widths scaled according to , + false otherwise. + + + + + + The default setting for the option. + true to have all fonts scaled according to , + false otherwise. + + + + + + The default value for the property, expressed as + a fraction of the scaled character height. + + + + + Current schema value that defines the version of the serialized file + + + + + Private field that holds a collection of objects for inclusion + in this . Use the public property + to access this collection. + + + + + Private field that sets the amount of space between the GraphPanes. Use the public property + to access this value; + + + + + Private field that stores a boolean value which signifies whether all + s in the chart use the same entries in their + If set to true, only one set of entries will be displayed in + this instance. If set to false, this instance will display all + entries from all s. + + + + + private field that determines if the + + function will automatically set + the of each in the + such that the scale factors have the same value. + + + + + private field that saves the paneLayout format specified when + was called. This value will + default to if + (or an overload) was never called. + + + + + Private field that stores the boolean value that determines whether + is specifying rows or columns. + + + + + private field that stores the row/column item count that was specified to the + method. This values will be + null if was never called. + + + + + private field that stores the row/column size proportional values as specified + to the method. This + value will be null if + was never called. + + + + + private field that determines if anti-aliased drawing will be forced on. Use the + public property to access this value. + + + + + Default constructor for the class. Sets the to (0, 0, 500, 375). + + + + + Default constructor for the class. Specifies the of + the , and the size of the . + + + + + The Copy Constructor - Make a deep-copy clone of this class instance. + + The object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of to make a deep copy. + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Respond to the callback when the MasterPane objects are fully initialized. + + + + + + Add a object to the collection at the end of the list. + + A reference to the object to + be added + + + + + Call for all objects in the + list. + + + This overload of AxisChange just uses the default Graphics instance for the screen. + If you have a Graphics instance available from your Windows Form, you should use + the overload instead. + + + + + Call for all objects in the + list. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + + + Redo the layout using the current size of the , + and also handle resizing the + contents by calling . + + This method will use the pane layout that was specified by a call to + . If + has not previously been called, + it will default to . + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + + + + + + + Change the size of the , and also handle resizing the + contents by calling . + + This method will use the pane layout that was specified by a call to + . If + has not previously been called, + it will default to . + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + + + + + + + + Method that forces the scale factor calculations + (via ), + to give a common scale factor for all objects in the + . + + + This will make it such that a given font size will result in the same output font + size for all 's. Note that this does not make the scale + factor for the 's the same as that of the + . + + + + + + Render all the objects in the to the + specified graphics device. + + This method should be part of the Paint() update process. Calling this routine + will redraw all + features of all the items. No preparation is required other than + instantiated objects that have been added to the list with the + method. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + + + Find the pane and the object within that pane that lies closest to the specified + mouse (screen) point. + + + This method first finds the within the list that contains + the specified mouse point. It then calls the + method to determine which object, if any, was clicked. With the exception of the + , all the parameters in this method are identical to those + in the method. + If the mouse point lies within the of any + item, then that pane will be returned (otherwise it will be + null). Further, within the selected pane, if the mouse point is within the + bounding box of any of the items (or in the case + of and , within + pixels), then the object will be returned. + You must check the type of the object to determine what object was + selected (for example, "if ( object is Legend ) ..."). The + parameter returns the index number of the item + within the selected object (such as the point number within a + object. + + The screen point, in pixel coordinates. + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + A reference to the object that was clicked. + A reference to the nearest object to the + specified screen point. This can be any of , + , , + , , or . + Note: If the pane title is selected, then the object + will be returned. + + The index number of the item within the selected object + (where applicable). For example, for a object, + will be the index number of the nearest data point, + accessible via CurveItem.Points[index]. + index will be -1 if no data points are available. + true if a was found, false otherwise. + + + + + Find the within the that contains the + within its . + + The mouse point location where you want to search + A object that contains the mouse point, or + null if no was found. + + + + Find the within the that contains the + within its . + + The mouse point location where you want to search + A object that contains the mouse point, or + null if no was found. + + + The SetLayout() methods setup the desired layout of the + objects within a . These functions + do not make any changes, they merely set the parameters so that future calls + to or + will use the desired layout.

+ The layout options include a set of "canned" layouts provided by the + enumeration, options to just set a specific + number of rows and columns of panes (and all pane sizes are the same), and more + customized options of specifying the number or rows in each column or the number of + columns in each row, along with proportional values that determine the size of each + individual column or row. +
+ + Automatically set all of the 's in + the list to a pre-defined layout configuration from a + enumeration. + + This method uses a enumeration to describe the type of layout + to be used. Overloads are available that provide other layout options + A enumeration that describes how + the panes should be laid out within the . + + A graphic device object to be drawn into. This is normally created with a call to + the CreateGraphics() method of the Control or Form. + + + + +
+ + + Automatically set all of the 's in + the list to a reasonable configuration. + + This method explicitly specifies the number of rows and columns to use + in the layout, and all objects will have the same size. + Overloads are available that provide other layout options + + A graphic device object to be drawn into. This is normally created with a call to + the CreateGraphics() method of the Control or Form. + + The number of rows of objects + to include in the layout + The number of columns of objects + to include in the layout + + + + + + + Automatically set all of the 's in + the list to the specified configuration. + + This method specifies the number of rows in each column, or the number of + columns in each row, allowing for irregular layouts. Overloads are available that + provide other layout options. + + + A graphic device object to be drawn into. This is normally created with a call to + the CreateGraphics() method of the Control or Form. + + Specifies whether the number of columns in each row, or + the number of rows in each column will be specified. A value of true indicates the + number of columns in each row are specified in . + An integer array specifying either the number of columns in + each row or the number of rows in each column, depending on the value of + . + + + + + + + Automatically set all of the 's in + the list to the specified configuration. + + This method specifies the number of panes in each row or column, allowing for + irregular layouts. + This method specifies the number of rows in each column, or the number of + columns in each row, allowing for irregular layouts. Additionally, a + parameter is provided that allows varying column or + row sizes. Overloads for SetLayout() are available that provide other layout options. + + + A graphic device object to be drawn into. This is normally created with a call to + the CreateGraphics() method of the Control or Form. + + Specifies whether the number of columns in each row, or + the number of rows in each column will be specified. A value of true indicates the + number of columns in each row are specified in . + An integer array specifying either the number of columns in + each row or the number of rows in each column, depending on the value of + . + An array of float values specifying proportional sizes for each + row or column. Note that these proportions apply to the non-specified dimension -- that is, + if is true, then these proportions apply to the row + heights, and if is false, then these proportions apply + to the column widths. The values in this array are arbitrary floats -- the dimension of + any given row or column is that particular proportional value divided by the sum of all + the values. For example, let be true, and + is an array with values of { 1.0, 2.0, 3.0 }. The sum of + those values is 6.0. Therefore, the first row is 1/6th of the available height, the + second row is 2/6th's of the available height, and the third row is 3/6th's of the + available height. + + + + + + + + Modify the sizes of each + such that they fit within the + in a pre-configured layout. + + The method (and overloads) is + used for setting the layout configuration. + + + + + + + + Internal method that applies a previously set layout with a specific + row and column count. This method is only called by + . + + + + + Internal method that applies a previously set layout with a rows per column or + columns per row configuration. This method is only called by + . + + + + + Gets or sets the collection instance that holds the list of + objects that are included in this . + + + + + + + Gets or sets the size of the margin between adjacent + objects. + + This property is scaled according to , + based on . The default value comes from + . + + The value is in points (1/72nd inch). + + + + Gets or set the value of the + + + + + Gets or sets a value that determines if the + method will automatically set the + + of each in the such that the + scale factors have the same value. + + + The scale factors, calculated by , determine + scaled font sizes, tic lengths, etc. This function will insure that for + multiple graphpanes, a certain specified font size will be the same for + all the panes. + + + + + + + + + + Gets or sets a value that determines if all drawing operations for this + will be forced to operate in Anti-alias mode. + Note that if this value is set to "true", it overrides the setting for sub-objects. + Otherwise, the sub-object settings (such as ) + will be honored. + + + + + Indexer to access the specified object from + by its ordinal position in the list. + + The ordinal position (zero-based) of the + object to be accessed. + A object reference. + + + + Indexer to access the specified object from + by its string. + + The string title of the + object to be accessed. + A object reference. + + + + A simple struct that defines the + default property values for the class. + + + + + The default pane layout for + + method calls. + + + + + + + + + + The default value for the property. + This is the size of the margin between adjacent + objects, in units of points (1/72 inch). + + + + + + The default value for the property for + the class. + + + + + The default value for the property. + + + + + The default value for the property. + + + + + A class representing a region on the GasGuage chart + s. + + Jay Mistry + $Revision: 1.2 $ $Date: 2007-07-30 05:26:23 $ + + + + Current schema value that defines the version of the serialized file + + + + + Defines the minimum value of this + + + + + Defines the maximum value of this + + + + + Defines the Color of this + + + + + Internally calculated; Start angle of this pie that defines this + + + + + Internally calculated; Sweep angle of this pie that defines this + + + + + Private field that stores the data for this + . Use the public property to + access this value. + + + + + A which will customize the label display of this + + + + + + Private field that stores the class that defines the + properties of the border around this . Use the public + property to access this value. + + + + + The bounding rectangle for this . + + + + + Private field to hold the GraphicsPath of this to be + used for 'hit testing'. + + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Create a new + + The value associated with this instance. + The display color for this instance. + The minimum value of this . + The maximum value of this . + + + + The Copy Constructor + + The object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Gets a flag indicating if the Z data range should be included in the axis scaling calculations. + + The parent of this . + + true if the Z data are included, false otherwise + + + + Gets a flag indicating if the X axis is the independent axis for this + + The parent of this . + + true if the X axis is independent, false otherwise + + + + Do all rendering associated with this item to the specified + device. This method is normally only + called by the Draw method of the parent + collection object. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + Not used for rendering GasGaugeNeedle + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Render the label for this . + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + Bounding rectangle for this . + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Determine the coords for the rectangle associated with a specified point for + this + + The to which this curve belongs + The index of the point of interest + A list of coordinates that represents the "rect" for + this point (used in an html AREA tag) + true if it's a valid point, false otherwise + + + + Calculate the values needed to properly display this . + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + + + Calculate the that will be used to define the bounding rectangle of + the GasGaugeNeedle. + + This rectangle always lies inside of the , and it is + normally a square so that the pie itself is not oval-shaped. + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + The (normally the ) + that bounds this pie. + + + + + Gets or sets the SlicePath of this + + + + + Gets or sets the LabelDetail of this + + + + + Gets or sets the Border of this + + + + + Gets or sets the RegionColor of this + + + + + Gets or sets the Fill of this + + + + + Gets or sets the SweepAngle of this + + + + + Gets or sets the StartAngle of this + + + + + Gets or sets the MinValue of this + + + + + Gets or sets the MaxValue of this + + + + + Specify the default property values for the class. + + + + + The default border pen width for the + + + + + The default fill type for the + + + + + The default value for the visibility of the border. + + + + + The default value for the color of the border + + + + + The default value for the color of the fill + + + + + The default value for the fill brush of the + + + + + The default value for the visibility of the fill. + + + + + The default value for the font size of the labels. + + + + + Class used to get the next color/symbol for GraphPane.AddCurve methods. + + + Jerry Vos modified by John Champion + $Revision: 3.4 $ $Date: 2006-06-24 20:26:43 $ + + + + The s + rotates through. + + + + + The s + rotates through. + + + + + The index of the next color to be used. Note: may be + > COLORS.Length, it is reset to 0 on the next call if it is. + + + + + The index of the next symbol to be used. Note: may be + > SYMBOLS.Length, it is reset to 0 on the next call if it is. + + + + + Retrieves the next color in the rotation Calling this + method has the side effect of incrementing the color index. + + + + + + + Retrieves the index of the next color to be used. Calling this + method has the side effect of incrementing the color index. + + + + + Retrieves the next color in the rotation. Calling this + method has the side effect of incrementing the symbol index. + + + + + + + Retrieves the index of the next symbol to be used. Calling this + method has the side effect of incrementing the symbol index. + + + + + Retrieves the instance used by the + static methods. + + + + + + + Retrieves the next color from this class's static + instance + + + + + + + Retrieves the next symbol type from this class's static + instance + + + + + + + Enumeration type for the various axis types that are available + + + + + An ordinary, cartesian axis + + + A base 10 log axis + + + A cartesian axis with calendar dates or times + + + An ordinal axis with user-defined text labels. An ordinal axis means that + all data points are evenly spaced at integral values, and the actual coordinate values + for points corresponding to that axis are ignored. That is, if the X axis is an + ordinal type, then all X values associated with the curves are ignored. + + + + + + An ordinal axis with regular numeric labels. An ordinal axis means that + all data points are evenly spaced at integral values, and the actual coordinate values + for points corresponding to that axis are ignored. That is, if the X axis is an + ordinal type, then all X values associated with the curves are ignored. + + + + + An ordinal axis that will have labels formatted with ordinal values corresponding + to the number of values in each . + + + The data points will be evenly-spaced at ordinal locations, and the + actual data values are ignored. + + + + + An ordinal axis that will have labels formatted with values from the actual data + values of the first in the . + + + Although the tics are labeled with real data values, the actual points will be + evenly-spaced in spite of the data values. For example, if the X values of the first curve + are 1, 5, and 100, then the tic labels will show 1, 5, and 100, but they will be equal + distance from each other. + + + + + An exponential axis + + + + Enumeration type for the various types of fills that can be used with + charts. + + + + No fill + + + A solid fill using + + + A custom fill using either or + + + + + Fill with a single solid color based on the X value of the data. + The X value is + used to determine the color value based on a gradient brush, and using a data range + of and . You can create a multicolor + range by initializing the class with your own custom + object based on a . In cases where a + data value makes no sense (, , + etc.), a default value of 50% of the range is assumed. The default range is 0 to 1. + + + + + + + + Fill with a single solid color based on the Z value of the data. + The Z value is + used to determine the color value based on a gradient brush, and using a data range + of and . You can create a multicolor + range by initializing the class with your own custom + object based on a . In cases where a + data value makes no sense (, , + etc.), a default value of 50% of the range is assumed. The default range is 0 to 1. + + + + + + + + Fill with a single solid color based on the Z value of the data. + The Z value is + used to determine the color value based on a gradient brush, and using a data range + of and . You can create a multicolor + range by initializing the class with your own custom + object based on a . In cases where a + data value makes no sense (, , + etc.), a default value of 50% of the range is assumed. The default range is 0 to 1. + + + + + + + + Fill with a single solid color based on the "ColorValue" property of the data. + The "ColorValue" property is + used to determine the color value based on a gradient brush, and using a data range + of and . You can create a multicolor + range by initializing the class with your own custom + object based on a . In cases where a + data value makes no sense (, , + etc.), a default value of 50% of the range is assumed. The default range is 0 to 1. + + + + + + + + Enumeration type for the various axis date and time unit types that are available + + + + Yearly units and + + + + Monthly units and + + + + Daily units and + + + + Hourly units and + + + + Minute units and + + + + Second units and + + + + Millisecond units and + + + + + Enumeration type for the various symbol shapes that are available + + + + + Square-shaped + + + Rhombus-shaped + + + Equilateral triangle + + + Uniform circle + + + "X" shaped . This symbol cannot + be filled since it has no outline. + + + "+" shaped . This symbol cannot + be filled since it has no outline. + + + Asterisk-shaped . This symbol + cannot be filled since it has no outline. + + + Unilateral triangle , pointing + down. + + + + Horizontal dash . This symbol cannot be + filled since it has no outline. + + + + + Vertical dash . This symbol cannot be + filled since it has no outline. + + + + A symbol defined by the propery. + If no symbol is defined, the . symbol will + be used. + + + + A Default symbol type (the symbol type will be obtained + from . + + + No symbol is shown (this is equivalent to using + = false. + + + + Enumeration type that defines the possible legend locations + + + + + + Locate the above the + + + + + Locate the on the left side of the + + + + + Locate the on the right side of the + + + + + Locate the below the + + + + + Locate the inside the in the + top-left corner. + + + + + Locate the inside the in the + top-right corner. + + + + + Locate the inside the in the + bottom-left corner. + + + + + Locate the inside the in the + bottom-right corner. + + + + + Locate the as a floating object above the graph at the + location specified by . + + + + + Locate the centered above the + + + + + Locate the centered below the + + + + + Locate the above the , but flush + against the left margin of the . + + + + + Locate the below the , but flush + against the left margin of the . + + + + + Enumeration type for the different horizontal text alignment options + + + + + + Position the text so that its left edge is aligned with the + specified X,Y location. Used by the + method. + + + + + Position the text so that its center is aligned (horizontally) with the + specified X,Y location. Used by the + method. + + + + + Position the text so that its right edge is aligned with the + specified X,Y location. Used by the + method. + + + + + Enumeration type for the different proximal alignment options + + + + + + + Position the text so that its "inside" edge (the edge that is + nearest to the alignment reference point or object) is aligned. + Used by the method to align text + to the axis. + + + + + Position the text so that its center is aligned with the + reference object or point. + Used by the method to align text + to the axis. + + + + + Position the text so that its right edge (the edge that is + farthest from the alignment reference point or object) is aligned. + Used by the method to align text + to the axis. + + + + + Enumeration type for the different vertical text alignment options + + specified X,Y location. Used by the + method. + + + + Position the text so that its top edge is aligned with the + specified X,Y location. Used by the + method. + + + + + Position the text so that its center is aligned (vertically) with the + specified X,Y location. Used by the + method. + + + + + Position the text so that its bottom edge is aligned with the + specified X,Y location. Used by the + method. + + + + + Enumeration type for the user-defined coordinate types available. + These coordinate types are used the objects + and objects only. + + + + + + Coordinates are specified as a fraction of the + . That is, for the X coordinate, 0.0 + is at the left edge of the ChartRect and 1.0 + is at the right edge of the ChartRect. A value less + than zero is left of the ChartRect and a value + greater than 1.0 is right of the ChartRect. For the Y coordinate, 0.0 + is the top and 1.0 is the bottom. + + + + + Coordinates are specified as a fraction of the + . That is, for the X coordinate, 0.0 + is at the left edge of the Rect and 1.0 + is at the right edge of the Rect. A value less + than zero is left of the Rect and a value + greater than 1.0 is right of the Rect. For the Y coordinate, 0.0 + is the top and 1.0 is the bottom. Note that + any value less than zero or greater than 1.0 will be outside + the Rect, and therefore clipped. + + + + + Coordinates are specified according to the user axis scales + for the and . + + + + + Coordinates are specified according to the user axis scales + for the and . + + + + + The X coordinate is specified as a fraction of the , + and the Y coordinate is specified as a fraction of the . + + + For the X coordinate, 0.0 + is at the left edge of the ChartRect and 1.0 + is at the right edge of the ChartRect. A value less + than zero is left of the ChartRect and a value + greater than 1.0 is right of the ChartRect. For the Y coordinate, a value of zero is at + the left side of the pane, and a value of 1.0 is at the right side of the pane. + + + + + The X coordinate is specified as a fraction of the , + and the Y coordinate is specified as a fraction of the . + + + For the X coordinate, a value of zero is at + the left side of the pane, and a value of 1.0 is at the right side of the pane. + For the Y coordinate, 0.0 + is at the top edge of the ChartRect and 1.0 + is at the bottom edge of the ChartRect. A value less + than zero is above the ChartRect and a value + greater than 1.0 is below the ChartRect. + + + + + The X coordinate is specified as an X Scale value, and the Y coordinate + is specified as a fraction of the . + + + For the X coordinate, the value just corresponds to the values of the X scale. + Values outside the scale range will be + outside the . For the Y coordinate, 0.0 + is at the top edge of the ChartRect and 1.0 + is at the bottom edge of the ChartRect. A value less + than zero is above the ChartRect and a value + greater than 1.0 is below the ChartRect. + + + + + The X coordinate is specified as a fraction of the + and the Y coordinate is specified as + a Y scale value. + + + For the X coordinate, 0.0 + is at the left edge of the ChartRect and 1.0 + is at the right edge of the ChartRect. A value less + than zero is left of the ChartRect and a value + greater than 1.0 is right of the ChartRect. For the Y coordinate, the value just + corresponds to the values of the Y scale. Values outside the scale range will be + outside the . + + + + + The X coordinate is specified as a fraction of the + and the Y coordinate is specified as + a Y2 scale value. + + + For the X coordinate, 0.0 + is at the left edge of the ChartRect and 1.0 + is at the right edge of the ChartRect. A value less + than zero is left of the ChartRect and a value + greater than 1.0 is right of the ChartRect. For the Y coordinate, the value just + corresponds to the values of the Y2 scale. Values outside the scale range will be + outside the . + + + + + Enumeration type that defines how a curve is drawn. Curves can be drawn + as ordinary lines by connecting the points directly, or in a stair-step + fashion as a series of discrete, constant values. In a stair step plot, + all lines segments are either horizontal or vertical. In a non-step (line) + plot, the lines can be any angle. + + + + + + Draw the as a stair-step in which each + point defines the + beginning (left side) of a new stair. This implies the points are + defined at the beginning of an "event." + + + + + Draw the as a stair-step in which each + point defines the end (right side) of a new stair. This implies + the points are defined at the end of an "event." + + + + + Draw the as an ordinary line, in which the + points are connected directly by line segments. + + + + + Draw the as a segment in which each point defines the + beginning (left side) of a new "stair." This implies the points are defined + at the beginning of an "event." Note that ForwardSegment is different + from ForwardStep in that it does not draw the vertical portion of the step. + + + + + Draw the as a segment in which each point defines the + end (right side) of a new "stair." This implies the points are defined + at the end of an "event." Note that RearwardSegment is different + from RearwardStep in that it does not draw the vertical portion of the step. + + + + + Enumeration type that defines the base axis from which graphs + are displayed. The bars can be drawn on any of the four axes (, + , , and ). + + + + + + Draw the chart based from the . + + + + + Draw the chart based from the . + + + + + Draw the chart based from the . + + + + + Draw the chart based from the . + + + + + Enumeration type that defines the available types of graphs. + + + + + + Draw the lines as normal. Any fill area goes from each line down to the X Axis. + + + + + Draw the lines stacked on top of each other, accumulating values to a total value. + + + + + Enumeration type that defines the available types of graphs. + + + + + + Draw each side by side in clusters. + + + + + Draw the bars one on top of the other. The bars will + be drawn such that the last bar in the will be behind + all other bars. Note that the bar values are not summed up for the overlay + mode. The data values must be summed before being passed + to . + For example, if the first bar of + the first has a value of 100, and the first bar of + the second has a value of 120, then that bar will + appear to be 20 units on top of the first bar. + + + + + Draw the bars one on top of the other. The bars will + be drawn such that the bars are sorted according to the maximum value, with + the tallest bar at each point at the back and the shortest bar at the front. + This is similar to the mode, but the bars are sorted at + each base value. + The data values must be summed before being passed + to . For example, if the first bar of + the first has a value of 100, and the first bar of + the second has a value of 120, then that bar will + appear to be 20 units on top of the first bar. + + + + + Draw the bars in an additive format so that they stack on + top of one another. The value of the last bar drawn will be the sum of the values + of all prior bars. + + + + + Draw the bars in a format whereby the height of each + represents the percentage of the total each one represents. Negative values + are displayed below the zero line as percentages of the absolute total of all values. + + + + + Enumeration type that defines which set of data points - X or Y - is used + to perform the sort. + + + + + Use the Y values to sort the list. + + + + + Use the X values to sort the list. + + + + + Enumeration that specifies a Z-Order position for + objects. + + This enumeration allows you to set the layering of various graph + features. Except for the objects, other feature types + all have a fixed depth as follows (front to back): + + objects + The border around + objects + The features + The background fill of the + The pane + The background fill of the + + You cannot place anything behind the + background fill, but allows you to + explicitly control the depth of objects + between all other object types. For items of equal , + such as multiple 's or 's + having the same value, the relative depth is + controlled by the ordinal position in the list (either + or ). + objects + can be placed in the of either a + or a . For a + -based , all + values are applicable. For a -based + , any value can be used, but there + are really only three depths: + will place the item behind the pane title, + will place on top of all other graph features, + any other value places the object above the pane title, but behind the 's. + + + + + + Specifies that the will be behind all other + objects (including the ). + + + + + Specifies that the will be behind the + background + (see ). + + + + + Specifies that the will be behind the grid lines. + + + + + Specifies that the will be behind the + objects. + + + + + Specifies that the will be behind the + objects. + + + + + Specifies that the will be behind the + border. + + + + + Specifies that the will be behind the + object. + + + + + Specifies that the will be in front of + all other objects, except for the other + objects that have the same and are before + this object in the . + + + + + Enumeration that determines the type of label that is displayed for each pie slice + (see ). + + + + + Displays and for + a slice in a Pie Chart. + + + + + Displays and (as % of total) for + a slice in a Pie Chart. + + + + + Displays a containing the both + as an absolute number and as percentage of the total. + + + + + Displays for + a slice in a Pie Chart. + + + + + Displays (as % of total) for + a slice in a Pie Chart. + + + + + Displays for a slice in a Pie Chart. + + + + + No label displayed. + + + + + Define the auto layout options for the + method. + + + + + Layout the 's so they are in a square grid (always 2x2, 3x3, 4x4), + leaving blank spaces as required. + + For example, a single pane would generate a 1x1 grid, between 2 and 4 panes would generate + a 2x2 grid, 5 to 9 panes would generate a 3x3 grid. + + + + Layout the 's so they are in a general square (2x2, 3x3, etc.), but use extra + columns when necessary (row x column = 1x2, 2x3, 3x4, etc.) depending on the total number + of panes required. + + For example, a 2x2 grid has four panes and a 3x3 grid has 9 panes. If there are + 6 panes required, then this option will eliminate a row (column preferred) to make a + 2 row x 3 column grid. With 7 panes, it will make a 3x3 grid with 2 empty spaces. + + + + Layout the 's so they are in a general square (2x2, 3x3, etc.), but use extra + rows when necessary (2x1, 3x2, 4x3, etc.) depending on the total number of panes required. + + For example, a 2x2 grid has four panes and a 3x3 grid has 9 panes. If there are + 6 panes required, then this option will eliminate a column (row preferred) to make a + 3 row x 2 column grid. With 7 panes, it will make a 3x3 grid with 2 empty spaces. + + + + Layout the 's in a single row + + + + + Layout the 's in a single column + + + + + Layout the 's with an explicit number of columns: The first row has + 1 column and the second row has 2 columns for a total of 3 panes. + + + + + Layout the 's with an explicit number of columns: The first row has + 2 columns and the second row has 1 column for a total of 3 panes. + + + + + Layout the 's with an explicit number of columns: The first row has + 2 columns and the second row has 3 columns for a total of 5 panes. + + + + + Layout the 's with an explicit number of columns: The first row has + 3 columns and the second row has 2 columns for a total of 5 panes. + + + + + Layout the 's with an explicit number of rows: The first column has + 1 row and the second column has 2 rows for a total of 3 panes. + + + + + Layout the 's with an explicit number of rows: The first column has + 2 rows and the second column has 1 row for a total of 3 panes. + + + + + Layout the 's with an explicit number of rows: The first column has + 2 rows and the second column has 3 rows for a total of 5 panes. + + + + + Layout the 's with an explicit number of rows: The first column has + 3 rows and the second column has 2 rows for a total of 5 panes. + + + + + Enum for specifying the type of data to be returned by the ZedGraphWeb Render() method. + + + + + Renders as an IMG tag referencing a local generated image. ContentType stays text. + + + + + Renders the binary image. ContentType is changed accordingly. + + + + + A class representing a pie chart object comprised of one or more + s. + + Bob Kaye + $Revision: 1.32 $ $Date: 2007-07-30 05:26:23 $ + + + + Current schema value that defines the version of the serialized file + + + + + Percentage (expressed as #.##) of radius to + which this is to be displaced from the center. + Displacement is done outward along the radius + bisecting the chord of this . Maximum allowable value + is 0.5. + + + + + A which will customize the label display of this + + + + + + Private field that stores the data for this + . Use the public property to + access this value. + + + + + Private field that stores the class that defines the + properties of the border around this . Use the public + property to access this value. + + + + + Private field that stores the absolute value of this instance. + Value will be set to zero if submitted value is less than zero. + + + + + An enum that specifies how each for this object + will be displayed. Use the public property to access this data. + Use enum . + + + + + The point on the arc of this representing the intersection of + the arc and the explosion radius. + + + + + The bounding rectangle for this . + + + + + The formatted string for this 's label. Formatting is + done based on the . + + + + + The point at which the line between this and its + label bends to the horizontal. + + + + + The point at the end of the line between this and + it's label (i.e. the beginning of the label display) + + + + + Private field to hold the GraphicsPath of this to be + used for 'hit testing'. + + + + + Private field which holds the angle (in degrees) at which the display of this + object will begin. + + + + + Private field which holds the length (in degrees) of the arc representing this + object. + + + + + Private field which represents the angle (in degrees) of the radius along which this + object will be displaced, if desired. + + + + + Private field which determines the number of decimal digits displayed to + in a label containing a value. + + + + + Private field which determines the number of decimal digits displayed + in a label containing a percent. + + + + + Gets a flag indicating if the Z data range should be included in the axis scaling calculations. + + The parent of this . + + true if the Z data are included, false otherwise + + + + Gets a flag indicating if the X axis is the independent axis for this + + The parent of this . + + true if the X axis is independent, false otherwise + + + + Create a new , providing a gradient fill for the pie color. + + The value associated with this instance. + The starting display color for the gradient for this + instance. + The ending display color for the gradient for this + instance. + The angle for the gradient . + The amount this instance will be + displaced from the center point. + Text label for this instance. + + + + Create a new . + + The value associated with this instance. + The display color for this instance. + The amount this instance will be + displaced from the center point. + Text label for this instance. + + + + Create a new . + + The value associated with this instance. + Text label for this instance + + + + The Copy Constructor + + The object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Do all rendering associated with this item to the specified + device. This method is normally only + called by the Draw method of the parent + collection object. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + Not used for rendering Piesparam> + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Calculate the that will be used to define the bounding rectangle of + the Pie. + + This rectangle always lies inside of the , and it is + normally a square so that the pie itself is not oval-shaped. + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + The (normally the ) + that bounds this pie. + + + + + Recalculate the bounding rectangle when a piee slice is displaced. + + rectangle to be used for drawing exploded pie + + + + Calculate the values needed to properly display this . + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + maximum slice displacement + + + + Render the label for this . + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + Bounding rectangle for this . + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + This method collects all the data relative to rendering this 's label. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + The rectangle used for rendering this + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + + + + + + + + Build the string that will be displayed as the slice label as determined by + . + + reference to the + + + + A method which calculates a new size for the bounding rectangle for the non-displaced + 's in the pie chart. This method is called after it is found + that at least one slice is displaced. + + The biggest displacement among the s + making up the pie chart. + The current bounding rectangle + + + + Draw a legend key entry for this at the specified location + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + The struct that specifies the + location for the legend key + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Determine the coords for the rectangle associated with a specified point for + this + + The to which this curve belongs + The index of the point of interest + A list of coordinates that represents the "rect" for + this point (used in an html AREA tag) + true if it's a valid point, false otherwise + + + + Gets or sets the a value which determines the amount, if any, of this + displacement. + + + + + Gets a path representing this + + + + + Gets or sets the to be used + for displaying this 's label. + + + + + Gets or sets the object so as to be able to modify + its properties. + + + + + Gets or sets the object which is used to fill the + pie slice with color. + + + + + Gets or sets the arc length (in degrees) of this . + + + + + Gets or sets the starting angle (in degrees) of this . + + + + + Gets or sets the angle (in degrees) of the radius along which + this will be displaced. + + + + + Gets or sets the value of this . + Minimum value is 0. + + + + + Gets or sets the to be used in displaying + labels. + + + + + Gets or sets the number of decimal digits to be displayed in a + value label. + + + + + Gets or sets the number of decimal digits to be displayed in a + percent label. + + + + + Specify the default property values for the class. + + + + + Default displacement. + + + + + The default pen width to be used for drawing the border around the PieItem + ( property). Units are points. + + + + + The default fill mode for this PieItem ( property). + + + + + The default border mode for PieItem ( property). + true to display frame around PieItem, false otherwise + + + + + The default color for drawing frames around PieItem + ( property). + + + + + The default color for filling in the PieItem + ( property). + + + + + The default custom brush for filling in the PieItem. + ( property). + + + + + Default value for controlling display. + + + + + Default value for . + + + + + The default font size for entries + ( property). Units are + in points (1/72 inch). + + + + + Default value for the number of decimal digits + to be displayed when contains a value. + + + + + Default value for the number of decimal digits + to be displayed where contains a percent. + + + + + The class is a generic font class that maintains the font family, + attributes, colors, border and fill modes, font size, and angle information. + This class can render text with a variety of alignment options using the + and parameters in the + method. + + + John Champion + $Revision: 3.24 $ $Date: 2007-01-25 07:56:08 $ + + + + Current schema value that defines the version of the serialized file + + + + + Private field that stores the color of the font characters for this + . Use the public property + to access this value. + + A system reference. + + + + Private field that stores the font family name for this . + Use the public property to access this value. + + A text string with the font family name, e.g., "Arial" + + + + Private field that determines whether this is + drawn with bold typeface. + Use the public property to access this value. + + A boolean value, true for bold, false for normal + + + + Private field that determines whether this is + drawn with italic typeface. + Use the public property to access this value. + + A boolean value, true for italic, false for normal + + + + Private field that determines whether this is + drawn with underlined typeface. + Use the public property to access this value. + + A boolean value, true for underline, false for normal + + + + Private field that stores the data for this + . Use the public property to + access this value. + + + + + Private field that determines the properties of the border around the text. + Use the public property to access this value. + + + + + Private field that determines the angle at which this + object is drawn. Use the public property + to access this value. + + The angle of the font, measured in anti-clockwise degrees from + horizontal. Negative values are permitted. + + + + Private field that determines the alignment with which this + object is drawn. This alignment really only + affects multi-line strings. Use the public property + to access this value. + + A enumeration. + + + + Private field that determines the size of the font for this + object. Use the public property + to access this value. + + The size of the font, measured in points (1/72 inch). + + + + Private field that stores a reference to the + object for this . This font object will be at + the actual drawn size according to the current + size of the . Use the public method + to access this font object. + + A reference to a object + + + + Private field that determines if the will be + displayed using anti-aliasing logic. + Use the public property to access this value. + + + + + Private field that determines if the will be + displayed with a drop shadow. + Use the public property to access this value. + + + + + Private field that determines the color of the dropshadow for this + . + Use the public property to access this value. + + + + + Private field that determines the offset angle of the dropshadow for this + . + Use the public property to access this value. + + + + + Private field that determines the offset distance of the dropshadow for this + . + Use the public property to access this value. + + + + + Private field that stores a reference to the + object that will be used for superscripts. This font object will be a + fraction of the , + based on the value of . This + property is internal, and has no public access. + + A reference to a object + + + + Private field that temporarily stores the scaled size of the font for this + object. This represents the actual on-screen + size, rather than the that represents the reference + size for a "full-sized" . + + The size of the font, measured in points (1/72 inch). + + + + Construct a object with default properties. + + + + + Construct a object with the given properties. All other properties + are defaulted according to the values specified in the + default class. + + A text string representing the font family + (default is "Arial") + A size of the font in points. This size will be scaled + based on the ratio of the dimension to the + of the object. + The color with which to render the font + true for a bold typeface, false otherwise + true for an italic typeface, false otherwise + true for an underlined font, false otherwise + + + + Construct a object with the given properties. All other properties + are defaulted according to the values specified in the + default class. + + A text string representing the font family + (default is "Arial") + A size of the font in points. This size will be scaled + based on the ratio of the dimension to the + of the object. + The color with which to render the font + true for a bold typeface, false otherwise + true for an italic typeface, false otherwise + true for an underlined font, false otherwise + The to use for filling in the text background + The to use for filling in the text background + The to use for the + text background + + + + The Copy Constructor + + The FontSpec object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Recreate the font based on a new scaled size. The font + will only be recreated if the scaled size has changed by + at least 0.1 points. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + The unscaled size of the font, in points + The scaled size of the font, in points + A reference to the object + + + + Get the class for the current scaled font. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + Returns a reference to a object + with a size of , and font . + + + + + Render the specified to the specifed + device. The text, border, and fill options + will be rendered as required. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + A string value containing the text to be + displayed. This can be multiple lines, separated by newline ('\n') + characters + The X location to display the text, in screen + coordinates, relative to the horizontal () + alignment parameter + The Y location to display the text, in screen + coordinates, relative to the vertical ( + alignment parameter + A horizontal alignment parameter specified + using the enum type + A vertical alignment parameter specified + using the enum type + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Render the specified to the specifed + device. The text, border, and fill options + will be rendered as required. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + A string value containing the text to be + displayed. This can be multiple lines, separated by newline ('\n') + characters + The X location to display the text, in screen + coordinates, relative to the horizontal () + alignment parameter + The Y location to display the text, in screen + coordinates, relative to the vertical ( + alignment parameter + A horizontal alignment parameter specified + using the enum type + A vertical alignment parameter specified + using the enum type + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + The limiting area () into which the text + must fit. The actual rectangle may be smaller than this, but the text will be wrapped + to accomodate the area. + + + + Render the specified to the specifed + device. The text, border, and fill options + will be rendered as required. This special case method will show the + specified text as a power of 10, using the + and . + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + A string value containing the text to be + displayed. This can be multiple lines, separated by newline ('\n') + characters + The X location to display the text, in screen + coordinates, relative to the horizontal () + alignment parameter + The Y location to display the text, in screen + coordinates, relative to the vertical ( + alignment parameter + A horizontal alignment parameter specified + using the enum type + A vertical alignment parameter specified + using the enum type + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Get the height of the scaled font + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + The scaled font height, in pixels + + + + Get the average character width of the scaled font. The average width is + based on the character 'x' + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + The scaled font width, in pixels + + + + Get the total width of the specified text string + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + The text string for which the width is to be calculated + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + The scaled text width, in pixels + + + + Get a struct representing the width and height + of the specified text string, based on the scaled font size + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + The text string for which the width is to be calculated + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + The scaled text dimensions, in pixels, in the form of + a struct + + + + Get a struct representing the width and height + of the specified text string, based on the scaled font size, and using + the specified as an outer limit. + + + This method will allow the text to wrap as necessary to fit the + . + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + The text string for which the width is to be calculated + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + The limiting area () into which the text + must fit. The actual rectangle may be smaller than this, but the text will be wrapped + to accomodate the area. + The scaled text dimensions, in pixels, in the form of + a struct + + + + Get a struct representing the width and height + of the bounding box for the specified text string, based on the scaled font size. + + + This routine differs from in that it takes into + account the rotation angle of the font, and gives the dimensions of the + bounding box that encloses the text at the specified angle. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + The text string for which the width is to be calculated + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + The scaled text dimensions, in pixels, in the form of + a struct + + + + Get a struct representing the width and height + of the bounding box for the specified text string, based on the scaled font size. + + + This routine differs from in that it takes into + account the rotation angle of the font, and gives the dimensions of the + bounding box that encloses the text at the specified angle. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + The text string for which the width is to be calculated + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + The limiting area () into which the text + must fit. The actual rectangle may be smaller than this, but the text will be wrapped + to accomodate the area. + The scaled text dimensions, in pixels, in the form of + a struct + + + + Get a struct representing the width and height + of the bounding box for the specified text string, based on the scaled font size. + + + This special case method will show the specified string as a power of 10, + superscripted and downsized according to the + and . + This routine differs from in that it takes into + account the rotation angle of the font, and gives the dimensions of the + bounding box that encloses the text at the specified angle. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + The text string for which the width is to be calculated + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + The scaled text dimensions, in pixels, in the form of + a struct + + + + Determines if the specified screen point lies within the bounding box of + the text, taking into account alignment and rotation parameters. + + The screen point, in pixel units + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + A string value containing the text to be + displayed. This can be multiple lines, separated by newline ('\n') + characters + The X location to display the text, in screen + coordinates, relative to the horizontal () + alignment parameter + The Y location to display the text, in screen + coordinates, relative to the vertical ( + alignment parameter + A horizontal alignment parameter specified + using the enum type + A vertical alignment parameter specified + using the enum type + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + true if the point lies within the bounding box, false otherwise + + + + Determines if the specified screen point lies within the bounding box of + the text, taking into account alignment and rotation parameters. + + The screen point, in pixel units + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + A string value containing the text to be + displayed. This can be multiple lines, separated by newline ('\n') + characters + The X location to display the text, in screen + coordinates, relative to the horizontal () + alignment parameter + The Y location to display the text, in screen + coordinates, relative to the vertical ( + alignment parameter + A horizontal alignment parameter specified + using the enum type + A vertical alignment parameter specified + using the enum type + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + The limiting area () into which the text + must fit. The actual rectangle may be smaller than this, but the text will be wrapped + to accomodate the area. + true if the point lies within the bounding box, false otherwise + + + + Returns a polygon that defines the bounding box of + the text, taking into account alignment and rotation parameters. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + A string value containing the text to be + displayed. This can be multiple lines, separated by newline ('\n') + characters + The X location to display the text, in screen + coordinates, relative to the horizontal () + alignment parameter + The Y location to display the text, in screen + coordinates, relative to the vertical ( + alignment parameter + A horizontal alignment parameter specified + using the enum type + A vertical alignment parameter specified + using the enum type + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + The limiting area () into which the text + must fit. The actual rectangle may be smaller than this, but the text will be wrapped + to accomodate the area. + A polygon of 4 points defining the area of this text + + + + The color of the font characters for this . + Note that the border and background + colors are set using the and + properties, respectively. + + A system reference. + + + + The font family name for this . + + A text string with the font family name, e.g., "Arial" + + + + Determines whether this is + drawn with bold typeface. + + A boolean value, true for bold, false for normal + + + + Determines whether this is + drawn with italic typeface. + + A boolean value, true for italic, false for normal + + + + Determines whether this is + drawn with underlined typeface. + + A boolean value, true for underline, false for normal + + + + The angle at which this object is drawn. + + The angle of the font, measured in anti-clockwise degrees from + horizontal. Negative values are permitted. + + + + Determines the alignment with which this + object is drawn. This alignment really only + affects multi-line strings. + + A enumeration. + + + + The size of the font for this object. + + The size of the font, measured in points (1/72 inch). + + + + Gets or sets the class used to draw the border border + around this text. + + + + + Gets or sets the data for this + , which controls how the background + behind the text is filled. + + + + + Gets or sets a value that determines if the will be + drawn using anti-aliasing logic within GDI+. + + + If this property is set to true, it will override the current setting of + by setting the value temporarily to + . If this property is set to false, + the the current setting of will be + left as-is. + + + + + Gets or sets a value that determines if the will be + displayed with a drop shadow. + + + + + + + + Gets or sets the color of the drop shadow for this . + + + This value only applies if is true. + + + + + + + + Gets or sets the offset angle of the drop shadow for this . + + + This value only applies if is true. + + The angle, measured in anti-clockwise degrees from + horizontal. Negative values are permitted. + + + + + + + Gets or sets the offset distance of the drop shadow for this . + + + This value only applies if is true. + + The offset distance, measured as a fraction of the scaled font height. + + + + + + + A simple struct that defines the + default property values for the class. + + + + + The default size fraction of the superscript font, expressed as a fraction + of the size of the main font. + + + + + The default shift fraction of the superscript, expressed as a + fraction of the superscripted character height. This is the height + above the main font (a zero shift means the main font and the superscript + font have the tops aligned). + + + + + The default color for filling in the background of the text block + ( property). + + + + + The default custom brush for filling in this + ( property). + + + + + The default fill mode for this + ( property). + + + + + Default value for the alignment with which this + object is drawn. This alignment really only + affects multi-line strings. + + A enumeration. + + + + Default value for , which determines + if the drop shadow is displayed for this . + + + + + Default value for , which determines + if anti-aliasing logic is used for this . + + + + + Default value for , which determines + the color of the drop shadow for this . + + + + + Default value for , which determines + the offset angle of the drop shadow for this . + + + + + Default value for , which determines + the offset distance of the drop shadow for this . + + + + + A collection class containing a list of objects + that define the set of points to be displayed on the curve. + + + John Champion based on code by Jerry Vos + $Revision: 3.4 $ $Date: 2007-02-18 05:51:54 $ + + + + Default constructor for the collection class + + + + + The Copy Constructor + + The StockPointList from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Add a object to the collection at the end of the list. + + The object to + be added + + + + Add a object to the collection at the end of the list. + + The object to be added + + + + Add a object to the collection at the end of the list using + the specified values. The unspecified values (low, open, close) are all set to + . + + An value + The high value for the day + The zero-based ordinal index where the point was added in the list. + + + + Add a single point to the from values of type double. + + An value + The high value for the day + The low value for the day + The opening value for the day + The closing value for the day + The trading volume for the day + The zero-based ordinal index where the point was added in the list. + + + + Access the at the specified ordinal index. + + + To be compatible with the interface, the + must implement an index that returns a + rather than a . This method + will return the actual at the specified position. + + The ordinal position (zero-based) in the list + The specified . + + + + + Indexer to access the specified object by + its ordinal position in the list. + + The ordinal position (zero-based) of the + object to be accessed. + A object reference. + + + + Encapsulates an "Error Bar" curve type that displays a vertical or horizontal + line with a symbol at each end. + + The type is intended for displaying + confidence intervals, candlesticks, stock High-Low charts, etc. It is + technically not a bar, since it is drawn as a vertical or horizontal line. + The default symbol at each end of the "bar" is , + which creates an "I-Beam". For horizontal bars + ( or + ), you will need to change the symbol to + to get horizontal "I-Beams". + Since the horizontal segments are actually symbols, their widths are + controlled by the symbol size in , + specified in points (1/72nd inch). The position of each "I-Beam" is set + according to the values. The independent axis + is assigned with , and is a + enum type. + John Champion + $Revision: 3.19 $ $Date: 2007-04-16 00:03:01 $ + + + + Current schema value that defines the version of the serialized file + + + + + Private field that stores a reference to the + class defined for this . Use the public + property to access this value. + + + + + Gets a flag indicating if the Z data range should be included in the axis scaling calculations. + + The parent of this . + + true if the Z data are included, false otherwise + + + + Gets a flag indicating if the X axis is the independent axis for this + + The parent of this . + + true if the X axis is independent, false otherwise + + + + Create a new , specifying only the legend label. + + The label that will appear in the legend. + + + + Create a new using the specified properties. + + The label that will appear in the legend. + An array of double precision values that define + the X axis values for this curve + An array of double precision values that define + the Y axis values for this curve + An array of double precision values that define + the lower dependent values for this curve + A value that will be applied to + the properties. + + + + + Create a new using the specified properties. + + The label that will appear in the legend. + A of double precision values that define + the X, Y and lower dependent values for this curve + A value that will be applied to + the properties. + + + + + The Copy Constructor + + The object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Do all rendering associated with this to the specified + device. This method is normally only + called by the Draw method of the parent + collection object. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + The ordinal position of the current + curve. + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Draw a legend key entry for this at the specified location + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + The struct that specifies the + location for the legend key + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Determine the coords for the rectangle associated with a specified point for + this + + The to which this curve belongs + The index of the point of interest + A list of coordinates that represents the "rect" for + this point (used in an html AREA tag) + true if it's a valid point, false otherwise + + + + Gets a reference to the class defined + for this . + + + + + The DateScale class inherits from the class, and implements + the features specific to . + + + DateScale is a cartesian axis with calendar dates or times. The actual data values should + be created with the type, which is directly translatable to a + type for storage in the point value arrays. + + + John Champion + $Revision: 1.15 $ $Date: 2007-09-19 06:41:56 $ + + + + Current schema value that defines the version of the serialized file + + + + + Default constructor that defines the owner + (containing object) for this new object. + + The owner, or containing object, of this instance + + + + The Copy Constructor + + The object from which to copy + The object that will own the + new instance of + + + + Create a new clone of the current item, with a new owner assignment + + The new instance that will be + the owner of the new Scale + A new clone. + + + + Determine the value for any major tic. + + + This method properly accounts for , , + and other axis format settings. + + + The value of the first major tic (floating point double) + + + The major tic number (0 = first major tic). For log scales, this is the actual power of 10. + + + The specified major tic value (floating point double). + + + + + Determine the value for any minor tic. + + + This method properly accounts for , , + and other axis format settings. + + + The value of the first major tic (floating point double). This tic value is the base + reference for all tics (including minor ones). + + + The major tic number (0 = first major tic). For log scales, this is the actual power of 10. + + + The specified minor tic value (floating point double). + + + + + Internal routine to determine the ordinals of the first minor tic mark + + + The value of the first major tic for the axis. + + + The ordinal position of the first minor tic, relative to the first major tic. + This value can be negative (e.g., -3 means the first minor tic is 3 minor step + increments before the first major tic. + + + + + Determine the value for the first major tic. + + + This is done by finding the first possible value that is an integral multiple of + the step size, taking into account the date/time units if appropriate. + This method properly accounts for , , + and other axis format settings. + + + First major tic value (floating point double). + + + + + Internal routine to determine the ordinals of the first and last major axis label. + + + This is the total number of major tics for this axis. + + + + + Select a reasonable date-time axis scale given a range of data values. + + + This method only applies to type axes, and it + is called by the general method. The scale range is chosen + based on increments of 1, 2, or 5 (because they are even divisors of 10). + Note that the property setting can have multiple unit + types ( and ), + but the and + units are always days (). This + method honors the , , + and autorange settings. + In the event that any of the autorange settings are false, the + corresponding , , or + setting is explicitly honored, and the remaining autorange settings (if any) will + be calculated to accomodate the non-autoranged values. The basic default for + scale selection is defined with + and + from the default class. + On Exit: + is set to scale minimum (if = true) + is set to scale maximum (if = true) + is set to scale step size (if = true) + is set to scale minor step size (if = true) + is set to a magnitude multiplier according to the data + is set to the display format for the values (this controls the + number of decimal places, whether there are thousands separators, currency types, etc.) + + A reference to the object + associated with this + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + + + + + Calculate a step size for a scale. + This method is used by . + + The range of data in units of days + The desired "typical" number of steps + to divide the range into + The calculated step size for the specified data range. Also + calculates and sets the values for , + , , and + + + + + Calculate a step size for a scale. + This method is used by . + + The range of data in units of days + The desired "typical" number of steps + to divide the range into + + The object on which to calculate the Date step size. + The calculated step size for the specified data range. Also + calculates and sets the values for , + , , and + + + + + Calculate a date that is close to the specified date and an + even multiple of the selected + for a scale. + This method is used by . + + The date which the calculation should be close to + The desired direction for the date to take. + 1 indicates the result date should be greater than the specified + date parameter. -1 indicates the other direction. + The calculated date + + + + Make a value label for an . + + + A reference to the object that is the parent or + owner of this object. + + + The zero-based, ordinal index of the label to be generated. For example, a value of 2 would + cause the third value label on the axis to be generated. + + + The numeric value associated with the label. This value is ignored for log () + and text () type axes. + + The resulting value label as a + + + + Internal routine to calculate a multiplier to the selected unit back to days. + + The unit type for which the multiplier is to be + calculated + + This is ratio of days/selected unit + + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Return the for this , which is + . + + + + + Gets or sets the minimum value for this scale. + + + The set property is specifically adapted for scales, + in that it automatically limits the value to the range of valid dates for the + struct. + + + + + Gets or sets the maximum value for this scale. + + + The set property is specifically adapted for scales, + in that it automatically limits the value to the range of valid dates for the + struct. + + + + + Gets the major unit multiplier for this scale type, if any. + + The major unit multiplier will correct the units of + to match the units of + and . This reflects the setting of + . + + + + + Gets the minor unit multiplier for this scale type, if any. + + The minor unit multiplier will correct the units of + to match the units of + and . This reflects the setting of + . + + + + + The Axis class is an abstract base class that encompasses all properties + and methods required to define a graph Axis. + + This class is inherited by the + , , and classes + to define specific characteristics for those types. + + + John Champion modified by Jerry Vos + $Revision: 3.76 $ $Date: 2008-02-16 23:21:48 $ + + + + Current schema value that defines the version of the serialized file + + + + + private field that stores the class, which implements all the + calculations and methods associated with the numeric scale for this + . See the public property to access this class. + + + + + Private field that stores the class, which handles all + the minor tic information. See the public property to access this class. + + + + + Private field that stores the class, which handles all + the major tic information. See the public property to access this class. + + + + + Private field that stores the class, which handles all + the major grid information. See the public property to access this class. + + + + + Private field that stores the class, which handles all + the minor grid information. See the public property to access this class. + + + + Private fields for the scale rendering properties. + Use the public properties and + for access to these values. + + + + Private field for the automatic cross position mode. + Use the public property for access to this value. + + + + Private fields for the attributes. + Use the public properties , + for access to these values. + + + + Private fields for the attributes. + Use the public properties , + for access to these values. + + + + Private field for the title string. + Use the public property for access to this value. + + + + + A tag object for use by the user. This can be used to store additional + information associated with the . ZedGraph does + not use this value for any purpose. + + + Note that, if you are going to Serialize ZedGraph data, then any type + that you store in must be a serializable type (or + it will cause an exception). + + + + Private field for the drawing dimensions. + Use the public property + for access to these values. + + + + Private field for the minimum allowable space allocation. + Use the public property to access this value. + + + + + Private fields for the colors. + Use the public property for access to this values. + + + + + Temporary values for axis space calculations (see ). + + + + + Default constructor for that sets all axis properties + to default values as defined in the class. + + + + + Constructor for that sets all axis properties + to default values as defined in the class, + except for the . + + A string containing the axis title + + + + The Copy Constructor. + + The Axis object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of Clone. + + + Note that this method must be called with an explicit cast to ICloneable, and + that it is inherently virtual. For example: + + ParentClass foo = new ChildClass(); + ChildClass bar = (ChildClass) ((ICloneable)foo).Clone(); + + Assume that ChildClass is inherited from ParentClass. Even though foo is declared with + ParentClass, it is actually an instance of ChildClass. Calling the ICloneable implementation + of Clone() on foo actually calls ChildClass.Clone() as if it were a virtual function. + + A deep copy of this object + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Restore the scale ranging to automatic mode, and recalculate the + scale ranges + + + A reference to the object that is the parent or + owner of this object. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + + + + + + + + Do all rendering associated with this to the specified + device. + + + This method is normally only + called by the Draw method of the parent object. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + The number of pixels to shift to account for non-primary axis position (e.g., + the second, third, fourth, etc. or . + + + + + This method will set the property for this + using the currently required space multiplied by a fraction (bufferFraction). + + + The currently required space is calculated using , and is + based on current data ranges, font sizes, etc. The "space" is actually the amount of space + required to fit the tic marks, scale labels, and axis title. + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + A reference to the object that is the parent or + owner of this object. + The amount of space to allocate for the axis, expressed + as a fraction of the currently required space. For example, a value of 1.2 would + allow for 20% extra above the currently required space. + If true, then this method will only modify the + property if the calculated result is more than the current value. + + + + Setup the Transform Matrix to handle drawing of this + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Calculate the "shift" size, in pixels, in order to shift the axis from its default + location to the value specified by . + + + A reference to the object that is the parent or + owner of this object. + + The shift amount measured in pixels + + + + Gets the "Cross" axis that corresponds to this axis. + + + The cross axis is the axis which determines the of this Axis when the + Axis.Cross property is used. The + cross axis for any or + is always the primary , and + the cross axis for any or is + always the primary . + + + A reference to the object that is the parent or + owner of this object. + + + + + Returns the linearized actual cross position for this axis, reflecting the settings of + , , and . + + + If the value of lies outside the axis range, it is + limited to the axis range. + + + + + Returns true if the axis is shifted at all due to the setting of + . This function will always return false if + is true. + + + + + Calculates the proportional fraction of the total cross axis width at which + this axis is located. + + + + + + + Calculate the space required (pixels) for this object. + + + This is the total space (vertical space for the X axis, horizontal space for + the Y axes) required to contain the axis. If is zero, then + this space will be the space required between the and + the . This method sets the internal values of + for use by the + method. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + The amount of space (pixels) at the edge of the ChartRect + that is always required for this axis, even if the axis is shifted by the + value. + Returns the space, in pixels, required for this axis (between the + rect and ChartRect) + + + + Determines if this object is a "primary" one. + + + The primary axes are the (always), the first + in the + ( = 0), and the first + in the + ( = 0). Note that + and + always reference the primary axes. + + + A reference to the object that is the parent or + owner of this object. + + true for a primary (for the , + this is always true), false otherwise + + + + Draw the minor tic marks as required for this . + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + + The scale value for the first major tic position. This is the reference point + for all other tic marks. + + The number of pixels to shift this axis, based on the + value of . A positive value is into the ChartRect relative to + the default axis position. + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + The pixel location of the far side of the ChartRect from this axis. + This value is the ChartRect.Height for the XAxis, or the ChartRect.Width + for the YAxis and Y2Axis. + + + + + Draw the title for this . + + On entry, it is assumed that the + graphics transform has been configured so that the origin is at the left side + of this axis, and the axis is aligned along the X coordinate direction. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + The number of pixels to shift this axis, based on the + value of . A positive value is into the ChartRect relative to + the default axis position. + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Make a value label for the axis at the specified ordinal position. + + + This method properly accounts for , + , + and other axis format settings. It also implements the ScaleFormatEvent such that + custom labels can be created. + + + A reference to the object that is the parent or + owner of this object. + + + The zero-based, ordinal index of the label to be generated. For example, a value of 2 would + cause the third value label on the axis to be generated. + + + The numeric value associated with the label. This value is ignored for log + () + and text () type axes. + + The resulting value label as a + + + + Subscribe to this event to handle custom formatting of the scale labels. + + + + + Allow customization of the title when the scale is very large + Subscribe to this event to handle custom formatting of the scale axis label. + + + + + Gets the instance associated with this . + + + + + Gets or sets the scale value at which this axis should cross the "other" axis. + + This property allows the axis to be shifted away from its default location. + For example, for a graph with an X range from -100 to +100, the Y Axis can be located + at the X=0 value rather than the left edge of the ChartRect. This value can be set + automatically based on the state of . If + this value is set manually, then will + also be set to false. The "other" axis is the axis the handles the second dimension + for the graph. For the XAxis, the "other" axis is the YAxis. For the YAxis or + Y2Axis, the "other" axis is the XAxis. + + The value is defined in user scale units + + + + + + + + Gets or sets a value that determines whether or not the value + is set automatically. + + Set to true to have ZedGraph put the axis in the default location, or false + to specify the axis location manually with a value. + + + + + + + + Gets or sets the minimum axis space allocation. + + + This term, expressed in + points (1/72 inch) and scaled according to + for the , determines the minimum amount of space + an axis must have between the Chart.Rect and the + GraphPane.Rect. This minimum space + applies whether is true or false. + + + + + The color to use for drawing this . + + + This affects only the axis segment (see ), + since the , + , , , + , and + all have their own color specification. + + The color is defined using the + class + . + + + + + Gets a reference to the class instance + for this . This class stores all the major tic settings. + + + + + Gets a reference to the class instance + for this . This class stores all the minor tic settings. + + + + + Gets a reference to the class that contains the properties + of the major grid. + + + + + Gets a reference to the class that contains the properties + of the minor grid. + + + + + This property determines whether or not the is shown. + + + Note that even if + the axis is not visible, it can still be actively used to draw curves on a + graph, it will just be invisible to the user + + true to show the axis, false to disable all drawing of this axis + . + . + . + . + + + + Gets or sets a property that determines whether or not the axis segment (the line that + represents the axis itself) is drawn. + + + Under normal circumstances, this value won't affect the appearance of the display because + the Axis segment is overlain by the Axis border (see ). + However, when the border is not visible, or when is set to + false, this value will make a difference. + + + + + Gets or sets the for this . + + + The type can be either , + , , + or . + + + + + + + + + + Gets or sets the class that contains the title of this + . + + The title normally shows the basis and dimensions of + the scale range, such as "Time (Years)". The title is only shown if the + property is set to true. If the Title text is empty, + then no title is shown, and no space is "reserved" for the title on the graph. + + the title is a string value + + + + + The size of the gap between multiple axes (see and + ). + + + This size will be scaled + according to the for the + + + The axis gap is measured in points (1/72 inch) + . + + + + A delegate that allows full custom formatting of the Axis labels + + The for which the label is to be + formatted + The of interest. + The value to be formatted + The zero-based index of the label to be formatted + + A string value representing the label, or null if the ZedGraph should go ahead + and generate the label according to the current settings + + + + + Allow customization of title based on user preferences. + + The of interest. + + A string value representing the label, or null if the ZedGraph should go ahead + and generate the label according to the current settings. To make the title + blank, return "". + + + + + A simple struct that defines the + default property values for the class. + + + + + The default size for the gap between multiple axes + ( property). Units are in points (1/72 inch). + + + + + The default setting for the gap between the scale labels and the axis title. + + + + + The default font family for the text + font specification + ( property). + + + + + The default font size for the text + font specification + ( property). Units are + in points (1/72 inch). + + + + + The default font color for the text + font specification + ( property). + + + + + The default font bold mode for the text + font specification + ( property). true + for a bold typeface, false otherwise. + + + + + The default font italic mode for the text + font specification + ( property). true + for an italic typeface, false otherwise. + + + + + The default font underline mode for the text + font specification + ( property). true + for an underlined typeface, false otherwise. + + + + + The default color for filling in the text background + (see property). + + + + + The default custom brush for filling in the text background + (see property). + + + + + The default fill mode for filling in the text background + (see property). + + + + + The default color for the itself + ( property). This color only affects the + the axis border. + + + + + The default value for , which determines + whether or not the scale segment itself is visible + + + + + The default setting for the scale axis type + ( property). This value is set as per + the enumeration + + + + + The default color for the axis segment. + + + + + The default setting for the axis space allocation. This term, expressed in + points (1/72 inch) and scaled according to for the + , determines the minimum amount of space an axis must + have between the and the + . This minimum space + applies whether is true or false. + + + + + Class that holds the specific properties for the minor tics. + + John Champion + $Revision: 3.1 $ $Date: 2006-06-24 20:26:44 $ + + + + Current schema value that defines the version of the serialized file + + + + + Default Constructor + + + + + Copy constructor. + + The that is to be copied. + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Calculate the scaled tic size for this + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + The scaled tic size, in points (1/72 inch) + + + + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Draw a tic mark at the specified single position. This includes the inner, outer, + cross and opposite tic marks as required. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + Graphic with which to draw the tic mark. + The pixel location of the tic mark on this + + The pixel value of the top of the axis border + The number of pixels to shift this axis, based on the + value of . A positive value is into the ChartRect relative to + the default axis position. + The scaled size of a minor tic, in pixel units + + + + The color to use for drawing the tics of this class instance + + The color is defined using the + class + . + + + + + + The length of the major tic marks. + + + This length will be scaled + according to the for the + + + The tic size is measured in points (1/72 inch) + . + + + + + + + This is convenience property sets the status of all the different + tic properties in this instance to the same value. true to activate all tics, + false to clear all tics. + + + This setting does not persist. That is, you can clear all the tics with + = false, then activate them individually (example: + = true). + + + + + + + + + + Gets or sets a property that determines whether or not the minor outside tic marks + are shown. + + + These are the tic marks on the outside of the border. + The minor tic spacing is controlled by . + + true to show the minor outside tic marks, false otherwise + . + + + + + + + + + Gets or sets a property that determines whether or not the major inside tic marks + are shown. + + + These are the tic marks on the inside of the border. + The major tic spacing is controlled by . + + true to show the major inside tic marks, false otherwise + . + + + + + + + + + Gets or sets a property that determines whether or not the major opposite tic marks + are shown. + + + These are the tic marks on the inside of the border on + the opposite side from the axis. + The major tic spacing is controlled by . + + true to show the major opposite tic marks, false otherwise + . + + + + + + + + + Gets or sets the display mode for the major outside + "cross" tic marks. + + + The "cross" tics are a special, additional set of tic marks that + always appear on the actual axis, even if it has been shifted due + to the setting. The other tic marks are always + fixed to the edges of the . The cross tics + are normally not displayed, since, if is true, + they will exactly overlay the "normal" and "inside" tics. If + is false, then you will most likely want to + enable the cross tics. + The major tic spacing is controlled by . + + true to show the major cross tic marks, false otherwise + + + + Gets or sets the display mode for the major inside + "cross" tic marks. + + + The "cross" tics are a special, additional set of tic marks that + always appear on the actual axis, even if it has been shifted due + to the setting. The other tic marks are always + fixed to the edges of the . The cross tics + are normally not displayed, since, if is true, + they will exactly overlay the "normal" and "inside" tics. If + is false, then you will most likely want to + enable the cross tics. + The major tic spacing is controlled by . + + true to show the major cross tic marks, false otherwise + + + + Gets or sets the pen width to be used when drawing the tic marks for + this + + The pen width is defined in points (1/72 inch) + . + + + + + + A simple struct that defines the + default property values for the class. + + + + + The default size for the minor tic marks. + ( property). Units are in points (1/72 inch). + + + + + The default pen width for drawing the tic marks. + ( property). Units are in points (1/72 inch). + + + + + The display mode for the minor outside tic marks + ( property). + The minor tic spacing is controlled by . + + true to show the minor tic marks (outside the axis), + false otherwise + + + + The display mode for the minor inside tic marks + ( property). + The minor tic spacing is controlled by . + + true to show the minor tic marks (inside the axis), + false otherwise + + + + The display mode for the minor opposite tic marks + ( property). + The minor tic spacing is controlled by . + + true to show the minor tic marks + (inside the axis on the opposite side), + false otherwise + + + + The default display mode for the minor outside + "cross" tic marks ( property). + + + The "cross" tics are a special, additional set of tic marks that + always appear on the actual axis, even if it has been shifted due + to the setting. The other tic marks are always + fixed to the edges of the . The cross tics + are normally not displayed, since, if is true, + they will exactly overlay the "normal" and "inside" tics. If + is false, then you will most likely want to + enable the cross tics. + The minor tic spacing is controlled by . + + true to show the major cross tic marks, false otherwise + + + + The default display mode for the minor inside + "cross" tic marks ( property). + + + The "cross" tics are a special, additional set of tic marks that + always appear on the actual axis, even if it has been shifted due + to the setting. The other tic marks are always + fixed to the edges of the . The cross tics + are normally not displayed, since, if is true, + they will exactly overlay the "normal" and "inside" tics. If + is false, then you will most likely want to + enable the cross tics. + The major tic spacing is controlled by . + + true to show the major cross tic marks, false otherwise + + + + The default color for minor tics ( property). + + + + + The LinearAsOrdinalScale class inherits from the class, and implements + the features specific to . + + + LinearAsOrdinal is an ordinal axis that will have labels formatted with values from the actual data + values of the first in the . + Although the tics are labeled with real data values, the actual points will be + evenly-spaced in spite of the data values. For example, if the X values of the first curve + are 1, 5, and 100, then the tic labels will show 1, 5, and 100, but they will be equal + distance from each other. + + + John Champion + $Revision: 1.10 $ $Date: 2007-04-16 00:03:02 $ + + + + Current schema value that defines the version of the serialized file + + + + + Default constructor that defines the owner + (containing object) for this new object. + + The owner, or containing object, of this instance + + + + The Copy Constructor + + The object from which to copy + The object that will own the + new instance of + + + + Create a new clone of the current item, with a new owner assignment + + The new instance that will be + the owner of the new Scale + A new clone. + + + + Select a reasonable ordinal axis scale given a range of data values, with the expectation that + linear values will be displayed. + + + This method only applies to type axes, and it + is called by the general method. For this type, + the first curve is the "master", which contains the dates to be applied. + On Exit: + is set to scale minimum (if = true) + is set to scale maximum (if = true) + is set to scale step size (if = true) + is set to scale minor step size (if = true) + is set to a magnitude multiplier according to the data + is set to the display format for the values (this controls the + number of decimal places, whether there are thousands separators, currency types, etc.) + + A reference to the object + associated with this + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + + + Make a value label for an . + + + A reference to the object that is the parent or + owner of this object. + + + The zero-based, ordinal index of the label to be generated. For example, a value of 2 would + cause the third value label on the axis to be generated. + + + The numeric value associated with the label. This value is ignored for log () + and text () type axes. + + The resulting value label as a + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Return the for this , which is + . + + + + + An exception thrown by ZedGraph. A child class of . + + + Jerry Vos modified by John Champion + $Revision: 3.2 $ $Date: 2006-06-24 20:26:44 $ + + + + Initializes a new instance of the + class with serialized data. + + The + instance that holds the serialized object data about the exception being thrown. + The + instance that contains contextual information about the source or destination. + + + + Initializes a new instance of the class with a specified + error message and a reference to the inner exception that is the cause of this exception. + + The error message that explains the reason for the exception. + The exception that is the cause of the current exception. + If the innerException parameter is not a null reference, the current exception is raised + in a catch block that handles the inner exception. + + + + Initializes a new instance of the class with a specified error message. + + The error message that explains the reason for the exception. + + + + Initializes a new instance of the class. + + + + + This struct encapsulates a date and time value, and handles associated + calculations and conversions between various formats. + + + This format stored as a double value representing days since a reference date + (XL date 0.0 is December 30, 1899 at 00:00 hrs). + Negative values are permissible, and the + range of valid dates is from noon on January 1st, 4713 B.C. forward. Internally, the + date calculations are done using Astronomical Julian Day numbers. The Astronomical Julian + Day number is defined as the number of days since noon on January 1st, 4713 B.C. + (also referred to as 12:00 on January 1, -4712). + NOTE: MS Excel actually has an error in the Serial Date calculations because it + errantly assumes 1900 is a leap year. The XDate calculations do not have this same + error. Therefore, XDate and Excel Date Serial values are 1 day different up until + the date value of 60 (in Excel, this is February 29th, 1900, and in XDate, this is + February 28th, 1900). At a value of 61 (March 1st, 1900) or greater, they agree with + eachother. + + John Champion + $Revision: 3.23 $ $Date: 2007-11-11 06:56:34 $ + + + + The Astronomical Julian Day number that corresponds to XL Date 0.0 + + + + + The minimum valid Julian Day, which corresponds to January 1st, 4713 B.C. + + + + + The maximum valid Julian Day, which corresponds to December 31st, 9999 A.D. + + + + + The minimum valid Excel Day, which corresponds to January 1st, 4713 B.C. + + + + + The maximum valid Excel Day, which corresponds to December 31st, 9999 A.D. + + + + + The number of months in a year + + + + + The number of hours in a day + + + + + The number of minutes in an hour + + + + + The number of seconds in a minute + + + + + The number of minutes in a day + + + + + The number of seconds in a day + + + + + The number of milliseconds in a second + + + + + The number of milliseconds in a day + + + + + The default format string to be used in when + no format is provided + + + + + The actual date value in MS Excel format. This is the only data field in + the struct. + + + + + Construct a date class from an XL date value. + + + An XL Date value in floating point double format + + + + + Construct a date class from a struct. + + + A struct containing the initial date information. + + + + + Construct a date class from a calendar date (year, month, day). Assumes the time + of day is 00:00 hrs + + An integer value for the year, e.g., 1995. + An integer value for the day of the month, e.g., 23. + It is permissible to have day numbers outside of the 1-31 range, + which will rollover to the previous or next month and year. + An integer value for the month of the year, e.g., + 8 for August. It is permissible to have months outside of the 1-12 range, + which will rollover to the previous or next year. + + + + Construct a date class from a calendar date and time (year, month, day, hour, minute, + second). + + An integer value for the year, e.g., 1995. + An integer value for the day of the month, e.g., 23. + It is permissible to have day numbers outside of the 1-31 range, + which will rollover to the previous or next month and year. + An integer value for the month of the year, e.g., + 8 for August. It is permissible to have months outside of the 1-12 range, + which will rollover to the previous or next year. + An integer value for the hour of the day, e.g. 15. + It is permissible to have hour values outside the 0-23 range, which + will rollover to the previous or next day. + An integer value for the minute, e.g. 45. + It is permissible to have hour values outside the 0-59 range, which + will rollover to the previous or next hour. + An integer value for the second, e.g. 35. + It is permissible to have second values outside the 0-59 range, which + will rollover to the previous or next minute. + + + + Construct a date class from a calendar date and time (year, month, day, hour, minute, + second), where seconds is a value (allowing fractional seconds). + + An integer value for the year, e.g., 1995. + An integer value for the day of the month, e.g., 23. + It is permissible to have day numbers outside of the 1-31 range, + which will rollover to the previous or next month and year. + An integer value for the month of the year, e.g., + 8 for August. It is permissible to have months outside of the 1-12 range, + which will rollover to the previous or next year. + An integer value for the hour of the day, e.g. 15. + It is permissible to have hour values outside the 0-23 range, which + will rollover to the previous or next day. + An integer value for the minute, e.g. 45. + It is permissible to have hour values outside the 0-59 range, which + will rollover to the previous or next hour. + A double value for the second, e.g. 35.75. + It is permissible to have second values outside the 0-59 range, which + will rollover to the previous or next minute. + + + + Construct a date class from a calendar date and time (year, month, day, hour, minute, + second, millisecond). + + An integer value for the year, e.g., 1995. + An integer value for the day of the month, e.g., 23. + It is permissible to have day numbers outside of the 1-31 range, + which will rollover to the previous or next month and year. + An integer value for the month of the year, e.g., + 8 for August. It is permissible to have months outside of the 1-12 range, + which will rollover to the previous or next year. + An integer value for the hour of the day, e.g. 15. + It is permissible to have hour values outside the 0-23 range, which + will rollover to the previous or next day. + An integer value for the minute, e.g. 45. + It is permissible to have hour values outside the 0-59 range, which + will rollover to the previous or next hour. + An integer value for the second, e.g. 35. + It is permissible to have second values outside the 0-59 range, which + will rollover to the previous or next minute. + An integer value for the millisecond, e.g. 632. + It is permissible to have millisecond values outside the 0-999 range, which + will rollover to the previous or next second. + + + + The Copy Constructor + + The GraphPane object from which to copy + + + + Returns true if the specified date value is in the valid range + + The XL date value to be verified for validity + true for a valid date, false otherwise + + + + Take the specified date, and bound it to the valid date range for the XDate struct. + + The date to be bounded + An XLDate value that lies between the minimum and maximum valid date ranges + (see and ) + + + + Get the calendar date (year, month, day) corresponding to this instance. + + An integer value for the year, e.g., 1995. + An integer value for the day of the month, e.g., 23. + An integer value for the month of the year, e.g., + 8 for August. + + + + Set the calendar date (year, month, day) of this instance. + + An integer value for the year, e.g., 1995. + An integer value for the day of the month, e.g., 23. + An integer value for the month of the year, e.g., + 8 for August. + + + + Get the calendar date (year, month, day, hour, minute, second) corresponding + to this instance. + + An integer value for the year, e.g., 1995. + An integer value for the day of the month, e.g., 23. + An integer value for the month of the year, e.g., + 8 for August. + An integer value for the hour of the day, e.g. 15. + An integer value for the minute, e.g. 45. + An integer value for the second, e.g. 35. + + + + Set the calendar date (year, month, day, hour, minute, second) of this instance. + + An integer value for the year, e.g., 1995. + An integer value for the day of the month, e.g., 23. + An integer value for the month of the year, e.g., + 8 for August. + An integer value for the hour of the day, e.g. 15. + An integer value for the minute, e.g. 45. + An integer value for the second, e.g. 35. + + + + Get the day of year value (241.345 means the 241st day of the year) + corresponding to this instance. + + The day of the year in floating point double format. + + + + Calculate an XL Date from the specified Calendar date (year, month, day, hour, minute, second), + first normalizing all input data values. + + + The Calendar date is always based on the Gregorian Calendar. Note that the Gregorian calendar is really + only valid from October 15, 1582 forward. The countries that adopted the Gregorian calendar + first did so on October 4, 1582, so that the next day was October 15, 1582. Prior to that time + the Julian Calendar was used. However, Prior to March 1, 4 AD the treatment of leap years was + inconsistent, and prior to 45 BC the Julian Calendar did not exist. The + struct projects only Gregorian dates backwards and does not deal with Julian calendar dates at all. The + method will just append a "(BC)" notation to the end of any dates + prior to 1 AD, since the struct throws an exception when formatting earlier dates. + + + The integer year value (e.g., 1994). + + + The integer month value (e.g., 7 for July). + + + The integer day value (e.g., 19 for the 19th day of the month). + + + The integer hour value (e.g., 14 for 2:00 pm). + + + The integer minute value (e.g., 35 for 35 minutes past the hour). + + + The integer second value (e.g., 42 for 42 seconds past the minute). + + + The integer millisecond value (e.g., 374 for 374 milliseconds past the second). + + The corresponding XL date, expressed in double floating point format + + + + Calculate an XL Date from the specified Calendar date (year, month, day, hour, minute, second), + first normalizing all input data values. + + + The Calendar date is always based on the Gregorian Calendar. Note that the Gregorian calendar is really + only valid from October 15, 1582 forward. The countries that adopted the Gregorian calendar + first did so on October 4, 1582, so that the next day was October 15, 1582. Prior to that time + the Julian Calendar was used. However, Prior to March 1, 4 AD the treatment of leap years was + inconsistent, and prior to 45 BC the Julian Calendar did not exist. The + struct projects only Gregorian dates backwards and does not deal with Julian calendar dates at all. The + method will just append a "(BC)" notation to the end of any dates + prior to 1 AD, since the struct throws an exception when formatting earlier dates. + + + The integer year value (e.g., 1994). + + + The integer month value (e.g., 7 for July). + + + The integer day value (e.g., 19 for the 19th day of the month). + + + The integer hour value (e.g., 14 for 2:00 pm). + + + The integer minute value (e.g., 35 for 35 minutes past the hour). + + + The integer second value (e.g., 42 for 42 seconds past the minute). + + The corresponding XL date, expressed in double floating point format + + + + Calculate an XL Date from the specified Calendar date (year, month, day, hour, minute, second), + first normalizing all input data values. The seconds value is a double type, allowing fractional + seconds. + + + The Calendar date is always based on the Gregorian Calendar. Note that the Gregorian calendar is really + only valid from October 15, 1582 forward. The countries that adopted the Gregorian calendar + first did so on October 4, 1582, so that the next day was October 15, 1582. Prior to that time + the Julian Calendar was used. However, Prior to March 1, 4 AD the treatment of leap years was + inconsistent, and prior to 45 BC the Julian Calendar did not exist. The + struct projects only Gregorian dates backwards and does not deal with Julian calendar dates at all. The + method will just append a "(BC)" notation to the end of any dates + prior to 1 AD, since the struct throws an exception when formatting earlier dates. + + + The integer year value (e.g., 1994). + + + The integer month value (e.g., 7 for July). + + + The integer day value (e.g., 19 for the 19th day of the month). + + + The integer hour value (e.g., 14 for 2:00 pm). + + + The integer minute value (e.g., 35 for 35 minutes past the hour). + + + The double second value (e.g., 42.3 for 42.3 seconds past the minute). + + The corresponding XL date, expressed in double floating point format + + + + Calculate an Astronomical Julian Day number from the specified Calendar date + (year, month, day, hour, minute, second), first normalizing all input data values + + + The integer year value (e.g., 1994). + + + The integer month value (e.g., 7 for July). + + + The integer day value (e.g., 19 for the 19th day of the month). + + + The integer hour value (e.g., 14 for 2:00 pm). + + + The integer minute value (e.g., 35 for 35 minutes past the hour). + + + The integer second value (e.g., 42 for 42 seconds past the minute). + + The corresponding Astronomical Julian Day number, expressed in double + floating point format + + + + Calculate an Astronomical Julian Day number from the specified Calendar date + (year, month, day, hour, minute, second), first normalizing all input data values + + + The integer year value (e.g., 1994). + + + The integer month value (e.g., 7 for July). + + + The integer day value (e.g., 19 for the 19th day of the month). + + + The integer hour value (e.g., 14 for 2:00 pm). + + + The integer minute value (e.g., 35 for 35 minutes past the hour). + + + The integer second value (e.g., 42 for 42 seconds past the minute). + + + The integer second value (e.g., 325 for 325 milliseconds past the minute). + + The corresponding Astronomical Julian Day number, expressed in double + floating point format + + + + Normalize a set of Calendar date values (year, month, day, hour, minute, second) to make sure + that month is between 1 and 12, hour is between 0 and 23, etc. + + + The integer year value (e.g., 1994). + + + The integer month value (e.g., 7 for July). + + + The integer day value (e.g., 19 for the 19th day of the month). + + + The integer hour value (e.g., 14 for 2:00 pm). + + + The integer minute value (e.g., 35 for 35 minutes past the hour). + + + The integer second value (e.g., 42 for 42 seconds past the minute). + + + The double millisecond value (e.g., 325.3 for 325.3 milliseconds past the second). + + + + + Calculate an XL date from the specified Calendar date (year, month, day, hour, minute, second). + This is the internal trusted version, where all values are assumed to be legitimate + ( month is between 1 and 12, minute is between 0 and 59, etc. ) + + + The integer year value (e.g., 1994). + + + The integer month value (e.g., 7 for July). + + + The integer day value (e.g., 19 for the 19th day of the month). + + + The integer hour value (e.g., 14 for 2:00 pm). + + + The integer minute value (e.g., 35 for 35 minutes past the hour). + + + The integer second value (e.g., 42 for 42 seconds past the minute). + + + The double millisecond value (e.g., 325.3 for 325.3 milliseconds past the second). + + The corresponding XL date, expressed in double floating point format + + + + Calculate an Astronomical Julian Day Number from the specified Calendar date + (year, month, day, hour, minute, second). + This is the internal trusted version, where all values are assumed to be legitimate + ( month is between 1 and 12, minute is between 0 and 59, etc. ) + + + The integer year value (e.g., 1994). + + + The integer month value (e.g., 7 for July). + + + The integer day value (e.g., 19 for the 19th day of the month). + + + The integer hour value (e.g., 14 for 2:00 pm). + + + The integer minute value (e.g., 35 for 35 minutes past the hour). + + + The integer second value (e.g., 42 for 42 seconds past the minute). + + + The double millisecond value (e.g., 325.3 for 325.3 milliseconds past the second). + + The corresponding Astronomical Julian Day number, expressed in double + floating point format + + + + Calculate a Calendar date (year, month, day, hour, minute, second) corresponding to + the specified XL date + + + The XL date value in floating point double format. + + + The integer year value (e.g., 1994). + + + The integer month value (e.g., 7 for July). + + + The integer day value (e.g., 19 for the 19th day of the month). + + + The integer hour value (e.g., 14 for 2:00 pm). + + + The integer minute value (e.g., 35 for 35 minutes past the hour). + + + The integer second value (e.g., 42 for 42 seconds past the minute). + + + + + Calculate a Calendar date (year, month, day, hour, minute, second) corresponding to + the specified XL date + + + The XL date value in floating point double format. + + + The integer year value (e.g., 1994). + + + The integer month value (e.g., 7 for July). + + + The integer day value (e.g., 19 for the 19th day of the month). + + + The integer hour value (e.g., 14 for 2:00 pm). + + + The integer minute value (e.g., 35 for 35 minutes past the hour). + + + The integer second value (e.g., 42 for 42 seconds past the minute). + + + The integer millisecond value (e.g., 325 for 325 milliseconds past the second). + + + + + Calculate a Calendar date (year, month, day, hour, minute, second) corresponding to + the specified XL date + + + The XL date value in floating point double format. + + + The integer year value (e.g., 1994). + + + The integer month value (e.g., 7 for July). + + + The integer day value (e.g., 19 for the 19th day of the month). + + + The integer hour value (e.g., 14 for 2:00 pm). + + + The integer minute value (e.g., 35 for 35 minutes past the hour). + + + The double second value (e.g., 42.3 for 42.3 seconds past the minute). + + + + + Calculate a Calendar date (year, month, day, hour, minute, second) corresponding to + the Astronomical Julian Day number + + + The Astronomical Julian Day number to be converted + + + The integer year value (e.g., 1994). + + + The integer month value (e.g., 7 for July). + + + The integer day value (e.g., 19 for the 19th day of the month). + + + The integer hour value (e.g., 14 for 2:00 pm). + + + The integer minute value (e.g., 35 for 35 minutes past the hour). + + + The integer second value (e.g., 42 for 42 seconds past the minute). + + + + + Calculate a Calendar date (year, month, day, hour, minute, second) corresponding to + the Astronomical Julian Day number + + + The Astronomical Julian Day number to be converted + + + The integer year value (e.g., 1994). + + + The integer month value (e.g., 7 for July). + + + The integer day value (e.g., 19 for the 19th day of the month). + + + The integer hour value (e.g., 14 for 2:00 pm). + + + The integer minute value (e.g., 35 for 35 minutes past the hour). + + + The double second value (e.g., 42.3 for 42.3 seconds past the minute). + + + + + Calculate a Calendar date (year, month, day, hour, minute, second) corresponding to + the Astronomical Julian Day number + + + The Astronomical Julian Day number to be converted + + + The integer year value (e.g., 1994). + + + The integer month value (e.g., 7 for July). + + + The integer day value (e.g., 19 for the 19th day of the month). + + + The integer hour value (e.g., 14 for 2:00 pm). + + + The integer minute value (e.g., 35 for 35 minutes past the hour). + + + The integer second value (e.g., 42 for 42 seconds past the minute). + + + The millisecond value (e.g., 342.5 for 342.5 milliseconds past + the second). + + + + + Calculate an Astronomical Julian Day number corresponding to the specified XL date + + + The XL date value in floating point double format. + + The corresponding Astronomical Julian Day number, expressed in double + floating point format + + + + Calculate an XL Date corresponding to the specified Astronomical Julian Day number + + + The Astronomical Julian Day number in floating point double format. + + The corresponding XL Date, expressed in double + floating point format + + + + Calculate a decimal year value (e.g., 1994.6523) corresponding to the specified XL date + + + The XL date value in floating point double format. + + The corresponding decimal year value, expressed in double + floating point format + + + + Calculate a decimal year value (e.g., 1994.6523) corresponding to the specified XL date + + + The decimal year value in floating point double format. + + The corresponding XL Date, expressed in double + floating point format + + + + Calculate a day-of-year value (e.g., 241.543 corresponds to the 241st day of the year) + corresponding to the specified XL date + + + The XL date value in floating point double format. + + The corresponding day-of-year (DoY) value, expressed in double + floating point format + + + + Calculate a day-of-week value (e.g., Sun=0, Mon=1, Tue=2, etc.) + corresponding to the specified XL date + + + The XL date value in floating point double format. + + The corresponding day-of-week (DoW) value, expressed in integer format + + + + Convert an XL date format to a .Net DateTime struct + + + The XL date value in floating point double format. + + The corresponding XL Date, expressed in double + floating point format + The corresponding date in the form of a .Net DateTime struct + + + + Convert a .Net DateTime struct to an XL Format date + + + The date value in the form of a .Net DateTime struct + + The corresponding XL Date, expressed in double + floating point format + + + + Add the specified number of milliseconds (can be fractional) to the current XDate instance. + + + The incremental number of milliseconds (negative or positive) in floating point double format. + + + + + Add the specified number of seconds (can be fractional) to the current XDate instance. + + + The incremental number of seconds (negative or positive) in floating point double format. + + + + + Add the specified number of minutes (can be fractional) to the current XDate instance. + + + The incremental number of minutes (negative or positive) in floating point double format. + + + + + Add the specified number of hours (can be fractional) to the current XDate instance. + + + The incremental number of hours (negative or positive) in floating point double format. + + + + + Add the specified number of days (can be fractional) to the current XDate instance. + + + The incremental number of days (negative or positive) in floating point double format. + + + + + Add the specified number of Months (can be fractional) to the current XDate instance. + + + The incremental number of months (negative or positive) in floating point double format. + + + + + Add the specified number of years (can be fractional) to the current XDate instance. + + + The incremental number of years (negative or positive) in floating point double format. + + + + + '-' operator overload. When two XDates are subtracted, the number of days between dates + is returned. + + The left-hand-side of the '-' operator (an XDate class) + The right-hand-side of the '-' operator (an XDate class) + The days between dates, expressed as a floating point double + + + + '-' operator overload. When a double value is subtracted from an XDate, the result is a + new XDate with the number of days subtracted. + + The left-hand-side of the '-' operator (an XDate class) + The right-hand-side of the '-' operator (a double value) + An XDate with the rhs number of days subtracted + + + + '+' operator overload. When a double value is added to an XDate, the result is a + new XDate with the number of days added. + + The left-hand-side of the '-' operator (an XDate class) + The right-hand-side of the '+' operator (a double value) + An XDate with the rhs number of days added + + + + '++' operator overload. Increment the date by one day. + + The XDate struct on which to operate + An XDate one day later than the specified date + + + + '--' operator overload. Decrement the date by one day. + + The XDate struct on which to operate + An XDate one day prior to the specified date + + + + Implicit conversion from XDate to double (an XL Date). + + The XDate struct on which to operate + A double floating point value representing the XL Date + + + + Implicit conversion from XDate to float (an XL Date). + + The XDate struct on which to operate + A double floating point value representing the XL Date + + + + Implicit conversion from double (an XL Date) to XDate. + + The XDate struct on which to operate + An XDate struct representing the specified xlDate value. + + + + Implicit conversion from XDate to . + + The XDate struct on which to operate + A struct representing the specified xDate value. + + + + Implicit conversion from to . + + The struct on which to operate + An struct representing the specified DateTime value. + + + + Tests whether obj is either an structure or + a double floating point value that is equal to the same date as this XDate + struct instance. + + The object to compare for equality with this XDate instance. + This object should be either a type XDate or type double. + Returns true if obj is the same date as this + instance; otherwise, false + + + + Returns the hash code for this structure. In this case, the + hash code is simply the equivalent hash code for the floating point double date value. + + An integer representing the hash code for this XDate value + + + + Compares one object to another. + + + This method will throw an exception if is not an + object. + + The second object to be compared. + zero if is equal to the current instance, + -1 if is less than the current instance, and + 1 if is greater than the current instance. + + + + Format this XDate value using the default format string (). + + + The formatting is done using the + method in order to provide full localization capability. The DateTime struct is limited to + dates from 1 AD onward. However, all calendar dates in and + are projected Gregorian calendar dates. Since the Gregorian calendar was not implemented + until October 4, 1582 (or later in some countries), Gregorian dates prior to that time are + really dates that would have been, had the Gregorian calendar existed. In order to avoid + throwing an exception, for dates prior to 1 AD, the year will be converted to a positive + year and the text "(BC)" is appended to the end of the formatted string. Under this mode, the + year sequence is 2BC, 1BC, 1AD, 2AD, etc. There is no year zero. + + + The XL date value to be formatted in floating point double format. + + A string representation of the date + + + + Format this XDate value using the default format string (see cref="DefaultFormatStr"/>). + + + The formatting is done using the + + method in order to provide full localization capability. The DateTime struct is limited to + dates from 1 AD onward. However, all calendar dates in and + + are projected Gregorian calendar dates. Since the Gregorian calendar was not implemented + until October 4, 1582 (or later in some countries), Gregorian dates prior to that time are + really dates that would have been, had the Gregorian calendar existed. In order to avoid + throwing an exception, for dates prior to 1 AD, the year will be converted to a positive + year and the text "(BC)" is appended to the end of the formatted string. Under this mode, the + year sequence is 2BC, 1BC, 1AD, 2AD, etc. There is no year zero. + + A string representation of the date + + + + Format this XL Date value using the specified format string. The format + string is specified according to the class. + + + The formatting is done using the + + method in order to provide full localization capability. The DateTime struct is limited to + dates from 1 AD onward. However, all calendar dates in and + + are projected Gregorian calendar dates. Since the Gregorian calendar was not implemented + until October 4, 1582 (or later in some countries), Gregorian dates prior to that time are + really dates that would have been, had the Gregorian calendar existed. In order to avoid + throwing an exception, for dates prior to 1 AD, the year will be converted to a positive + year and the text "(BC)" is appended to the end of the formatted string. Under this mode, the + year sequence is 2BC, 1BC, 1AD, 2AD, etc. There is no year zero. + + + The formatting string to be used for the date. See + + class for a list of the format types available. + A string representation of the date + + + + Format the specified XL Date value using the specified format string. The format + string is specified according to the class. + + + The formatting is done using the + + method in order to provide full localization capability. The DateTime struct is limited to + dates from 1 AD onward. However, all calendar dates in and + + are projected Gregorian calendar dates. Since the Gregorian calendar was not implemented + until October 4, 1582 (or later in some countries), Gregorian dates prior to that time are + really dates that would have been, had the Gregorian calendar existed. In order to avoid + throwing an exception, for dates prior to 1 AD, the year will be converted to a positive + year and the text "(BC)" is appended to the end of the formatted string. Under this mode, the + year sequence is 2BC, 1BC, 1AD, 2AD, etc. There is no year zero. + + + The XL date value to be formatted in floating point double format. + + + The formatting string to be used for the date. See + + for a list of the format types available. + A string representation of the date + + + + Gets or sets the date value for this item in MS Excel format. + + + + + Returns true if this struct is in the valid date range + + + + + Gets or sets the date value for this item in .Net DateTime format. + + + + + Gets or sets the date value for this item in Julain day format. This is the + Astronomical Julian Day number, so a value of 0.0 corresponds to noon GMT on + January 1st, -4712. Thus, Julian Day number 2,400,000.0 corresponds to + noon GMT on November 16, 1858. + + + + + Gets or sets the decimal year number (i.e., 1997.345) corresponding to this item. + + + + + A class that maintains hyperlink information for a clickable object on the graph. + + + John Champion + $Revision: 3.6 $ $Date: 2007-04-16 00:03:02 $ + + + + Current schema value that defines the version of the serialized file + + + schema started with 10 for ZedGraph version 5 + + + + + Internal field that stores the title string for this link. + + + + + Internal field that stores the url string for this link + + + + + Internal field that stores the target string for this link + + + + + Internal field that determines if this link is "live". + + + + + A tag object for use by the user. This can be used to store additional + information associated with the . ZedGraph does + not use this value for any purpose. + + + Note that, if you are going to Serialize ZedGraph data, then any type + that you store in must be a serializable type (or + it will cause an exception). + + + + + Default constructor. Set all properties to string.Empty, or null. + + + + + Construct a Link instance from a specified title, url, and target. + + The title for the link (which shows up in the tooltip). + The URL destination for the link. + The target for the link (typically "_blank" or "_self"). + + + + The Copy Constructor + + The object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Create a URL for a that includes the index of the + point that was selected. + + + An "index" parameter is added to the property for this + link to indicate which point was selected. Further, if the + X or Y axes that correspond to this are of + , then an + additional parameter will be added containing the text value that + corresponds to the of the selected point. + The text parameter will be labeled "xtext", and + the text parameter will be labeled "ytext". + + The zero-based index of the selected point + The of interest + The for which to + make the url string. + A string containing the url with an index parameter added. + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Gets or sets the title string for this link. + + + For web controls, this title will be shown as a tooltip when the mouse + hovers over the area of the object that owns this link. Set the value to + to have no title. + + + + + Gets or sets the url string for this link. + + + Set this value to if you don't want to have + a hyperlink associated with the object to which this link belongs. + + + + + Gets or sets the target string for this link. + + + This value should be set to a valid target associated with the "Target" + property of an html hyperlink. Typically, this would be "_blank" to open + a new browser window, or "_self" to open in the current browser. + + + + + Gets or sets a property that determines if this link is active. True to have + a clickable link, false to ignore the link. + + + + + Gets a value that indicates if this is enabled + (see ), and that either the + or the is non-null. + + + + + Encapsulates a bar type that displays vertical or horizontal bars + + + The orientation of the bars depends on the state of + , and the bars can be stacked or + clustered, depending on the state of + + John Champion + $Revision: 3.27 $ $Date: 2007-11-03 04:41:28 $ + + + + Current schema value that defines the version of the serialized file + + + + + Private field that stores a reference to the + class defined for this . Use the public + property to access this value. + + + + + Gets a flag indicating if the Z data range should be included in the axis scaling calculations. + + The parent of this . + + true if the Z data are included, false otherwise + + + + Gets a flag indicating if the X axis is the independent axis for this + + The parent of this . + + true if the X axis is independent, false otherwise + + + + Create a new , specifying only the legend label for the bar. + + The label that will appear in the legend. + + + + Create a new using the specified properties. + + The label that will appear in the legend. + An array of double precision values that define + the independent (X axis) values for this curve + An array of double precision values that define + the dependent (Y axis) values for this curve + A value that will be applied to + the and properties. + + + + + Create a new using the specified properties. + + The label that will appear in the legend. + A of double precision value pairs that define + the X and Y values for this curve + A value that will be applied to + the and properties. + + + + + The Copy Constructor + + The object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Do all rendering associated with this to the specified + device. This method is normally only + called by the Draw method of the parent + collection object. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + The ordinal position of the current + curve. + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Draw a legend key entry for this at the specified location + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + The struct that specifies the + location for the legend key + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Create a for each bar in the . + + + This method will go through the bars, create a label that corresponds to the bar value, + and place it on the graph depending on user preferences. This works for horizontal or + vertical bars in clusters or stacks, but only for types. This method + does not apply to or objects. + Call this method only after calling . + + The GraphPane in which to place the text labels. + true to center the labels inside the bars, false to + place the labels just above the top of the bar. + The double.ToString string format to use for creating + the labels. + + + + + Create a for each bar in the . + + + This method will go through the bars, create a label that corresponds to the bar value, + and place it on the graph depending on user preferences. This works for horizontal or + vertical bars in clusters or stacks, but only for types. This method + does not apply to or objects. + Call this method only after calling . + + The GraphPane in which to place the text labels. + true to center the labels inside the bars, false to + place the labels just above the top of the bar. + The double.ToString string format to use for creating + the labels. + + The color in which to draw the labels + The string name of the font family to use for the labels + The floating point size of the font, in scaled points + true for a bold font type, false otherwise + true for an italic font type, false otherwise + true for an underline font type, false otherwise + + + + Determine the coords for the rectangle associated with a specified point for + this + + The to which this curve belongs + The index of the point of interest + A list of coordinates that represents the "rect" for + this point (used in an html AREA tag) + true if it's a valid point, false otherwise + + + + Gets a reference to the class defined + for this . + + + + + A class representing all the characteristics of the bar + segments that make up a curve on the graph. + + + John Champion + $Revision: 3.30 $ $Date: 2007-11-03 04:41:28 $ + + + + Current schema value that defines the version of the serialized file + + + + + Private field that stores the data for this + . Use the public property to + access this value. + + + + + Private field that stores the class that defines the + properties of the border around this . Use the public + property to access this value. + + + + + Default constructor that sets all properties to default + values as defined in the class. + + + + + Default constructor that sets the + as specified, and the remaining + properties to default + values as defined in the class. + The specified color is only applied to the + , and the + will be defaulted. + + A value indicating + the + of the Bar. + + + + + The Copy Constructor + + The Bar object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Draw the to the specified device + at the specified location. This routine draws a single bar. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + The x position of the left side of the bar in + pixel units + The x position of the right side of the bar in + pixel units + The y position of the top of the bar in + pixel units + The y position of the bottom of the bar in + pixel units + + The scaling factor for the features of the graph based on the . This + scaling factor is calculated by the method. The scale factor + represents a linear multiple to be applied to font sizes, symbol sizes, etc. + + true to draw the bottom portion of the border around the + bar (this is for legend entries) + The data value to be used for a value-based + color gradient. This is only applicable for , + or . + Indicates that the should be drawn + with attributes from the class. + + + + + Draw the to the specified device + at the specified location. This routine draws a single bar. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + The rectangle (pixels) to contain the bar + + The scaling factor for the features of the graph based on the . This + scaling factor is calculated by the method. The scale factor + represents a linear multiple to be applied to font sizes, symbol sizes, etc. + + true to draw the bottom portion of the border around the + bar (this is for legend entries) + The data value to be used for a value-based + color gradient. This is only applicable for , + or . + Indicates that the should be drawn + with attributes from the class. + + + + + Draw the this to the specified + device as a bar at each defined point. This method + is normally only called by the method of the + object + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + A object representing the + 's to be drawn. + The class instance that defines the base (independent) + axis for the + The class instance that defines the value (dependent) + axis for the + + The width of each bar, in pixels. + + + The ordinal position of the this bar series (0=first bar, 1=second bar, etc.) + in the cluster of bars. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Draw the specified single bar (an individual "point") of this series to the specified + device. This method is not as efficient as + , which draws the bars for all points. It is intended to be used + only for , which requires special handling of each bar. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + A object representing the + 's to be drawn. + The class instance that defines the base (independent) + axis for the + The class instance that defines the value (dependent) + axis for the + + The ordinal position of the this bar series (0=first bar, 1=second bar, etc.) + in the cluster of bars. + + + The zero-based index number for the single bar to be drawn. + + + The width of each bar, in pixels. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Protected internal routine that draws the specified single bar (an individual "point") + of this series to the specified device. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + A object representing the + 's to be drawn. + + The zero-based index number for the single bar to be drawn. + + + The ordinal position of the this bar series (0=first bar, 1=second bar, etc.) + in the cluster of bars. + + The class instance that defines the base (independent) + axis for the + The class instance that defines the value (dependent) + axis for the + + The width of each bar, in pixels. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + The object used to draw the border around the . + + + + + + + + Gets or sets the data for this + . + + + + + A simple struct that defines the + default property values for the class. + + + + + The default pen width to be used for drawing the border around the bars + ( property). Units are points. + + + + + The default fill mode for bars ( property). + + + + + The default border mode for bars ( property). + true to display frames around bars, false otherwise + + + + + The default color for drawing frames around bars + ( property). + + + + + The default color for filling in the bars + ( property). + + + + + The default custom brush for filling in the bars + ( property). + + + + + inherits from , and defines the + special characteristics of a vertical axis, specifically located on + the right side of the of the + object + + + John Champion + $Revision: 3.16 $ $Date: 2007-04-16 00:03:05 $ + + + + Current schema value that defines the version of the serialized file + + + + + Default constructor that sets all properties to + default values as defined in the class + + + + + Default constructor that sets all properties to + default values as defined in the class, except + for the axis title + + The for this axis + + + + The Copy Constructor + + The Y2Axis object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Setup the Transform Matrix to handle drawing of this + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Determines if this object is a "primary" one. + + + The primary axes are the (always), the first + in the + ( = 0), and the first + in the + ( = 0). Note that + and + always reference the primary axes. + + + A reference to the object that is the parent or + owner of this object. + + true for a primary , false otherwise + + + + Calculate the "shift" size, in pixels, in order to shift the axis from its default + location to the value specified by . + + + A reference to the object that is the parent or + owner of this object. + + The shift amount measured in pixels + + + + Gets the "Cross" axis that corresponds to this axis. + + + The cross axis is the axis which determines the of this Axis when the + Axis.Cross property is used. The + cross axis for any or + is always the primary , and + the cross axis for any or is + always the primary . + + + A reference to the object that is the parent or + owner of this object. + + + + + A simple subclass of the class that defines the + default property values for the class. + + + + + The default display mode for the + ( property). true to display the scale + values, title, tic marks, false to hide the axis entirely. + + + + + Determines if a line will be drawn at the zero value for the + , that is, a line that + divides the negative values from positive values. + . + + + + + inherits from , and defines the + special characteristics of a horizontal axis, specifically located at + the bottom of the of the + object + + + John Champion + $Revision: 3.16 $ $Date: 2007-04-16 00:03:02 $ + + + + Current schema value that defines the version of the serialized file + + + + + Default constructor that sets all properties to + default values as defined in the class + + + + + Default constructor that sets all properties to + default values as defined in the class, except + for the axis title + + The for this axis + + + + The Copy Constructor + + The XAxis object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Setup the Transform Matrix to handle drawing of this + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Determines if this object is a "primary" one. + + + The primary axes are the (always), the first + in the + ( = 0), and the first + in the + ( = 0). Note that + and + always reference the primary axes. + + + A reference to the object that is the parent or + owner of this object. + + true for a primary (for the , + this is always true), false otherwise + + + + Calculate the "shift" size, in pixels, in order to shift the axis from its default + location to the value specified by . + + + A reference to the object that is the parent or + owner of this object. + + The shift amount measured in pixels + + + + Gets the "Cross" axis that corresponds to this axis. + + + The cross axis is the axis which determines the of this Axis when the + Axis.Cross property is used. The + cross axis for any or + is always the primary , and + the cross axis for any or is + always the primary . + + + A reference to the object that is the parent or + owner of this object. + + + + + A simple struct that defines the + default property values for the class. + + + + + The default display mode for the + ( property). true to display the scale + values, title, tic marks, false to hide the axis entirely. + + + + + Determines if a line will be drawn at the zero value for the + , that is, a line that + divides the negative values from positive values. + . + + + + + A class that provides a rolling list of objects. + This is essentially a + first-in-first-out (FIFO) queue with a fixed capacity which allows 'rolling' + (or oscilloscope like) graphs to be be animated without having the overhead of an + ever-growing ArrayList. + + The queue is constructed with a fixed capacity and new points can be enqueued. When the + capacity is reached the oldest (first in) PointPair is overwritten. However, when + accessing via , the objects are + seen in the order in which they were enqeued. + + RollingPointPairList supports data editing through the + interface. + + Colin Green with mods by John Champion + $Date: 2007-11-05 04:33:26 $ + + + + + Current schema value that defines the version of the serialized file + + + + + An array of PointPair objects that acts as the underlying buffer. + + + + + The index of the previously enqueued item. -1 if buffer is empty. + + + + + The index of the next item to be dequeued. -1 if buffer is empty. + + + + + Constructs an empty buffer with the specified capacity. + + Number of elements in the rolling list. This number + cannot be changed once the RollingPointPairList is constructed. + + + + Constructs an empty buffer with the specified capacity. Pre-allocates space + for all PointPair's in the list if is true. + + Number of elements in the rolling list. This number + cannot be changed once the RollingPointPairList is constructed. + true to pre-allocate all PointPair instances in + the list, false otherwise. Note that in order to be memory efficient, + the method should be used to add + data. Avoid the method. + + + + + + Constructs a buffer with a copy of the items within the provided + . + The is set to the length of the provided list. + + The to be copied. + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Clear the buffer of all objects. + Note that the remains unchanged. + + + + + Calculate that the next index in the buffer that should receive a new data point. + Note that this method actually advances the buffer, so a datapoint should be + added at _mBuffer[_headIdx]. + + The index position of the new head element + + + + Add a onto the head of the queue, + overwriting old values if the buffer is full. + + The to be added. + + + + Add an object to the head of the queue. + + A reference to the object to + be added + + + + Remove an old item from the tail of the queue. + + The removed item. Throws an + if the buffer was empty. + Check the buffer's length () or the + property to avoid exceptions. + + + + Remove the at the specified index + + + All items in the queue that lie after will + be shifted back by one, and the queue will be one item shorter. + + The ordinal position of the item to be removed. + Throws an if index is less than + zero or greater than or equal to + + + + + Remove a range of objects starting at the specified index + + + All items in the queue that lie after will + be shifted back, and the queue will be items shorter. + + The ordinal position of the item to be removed. + Throws an if index is less than + zero or greater than or equal to + + The number of items to be removed. Throws an + if is less than zero + or greater than the total available items in the queue + + + + Pop an item off the head of the queue. + + The popped item. Throws an exception if the buffer was empty. + + + + Peek at the item at the head of the queue. + + The item at the head of the queue. + Throws an if the buffer was empty. + + + + + Add a set of values onto the head of the queue, + overwriting old values if the buffer is full. + + + This method is much more efficient that the Add(PointPair) + method, since it does not require that a new PointPair instance be provided. + If the buffer already contains a at the head position, + then the x, y, z, and tag values will be copied into the existing PointPair. + Otherwise, a new PointPair instance must be created. + In this way, each PointPair position in the rolling list will only be allocated one time. + To truly be memory efficient, the , , + and methods should be avoided. Also, the property + for this method should be null, since it is a reference type. + + The X value + The Y value + The Z value + The Tag value for the PointPair + + + + Add a set of values onto the head of the queue, + overwriting old values if the buffer is full. + + + This method is much more efficient that the Add(PointPair) + method, since it does not require that a new PointPair instance be provided. + If the buffer already contains a at the head position, + then the x, y, z, and tag values will be copied into the existing PointPair. + Otherwise, a new PointPair instance must be created. + In this way, each PointPair position in the rolling list will only be allocated one time. + To truly be memory efficient, the , , + and methods should be avoided. + + The X value + The Y value + + + + Add a set of values onto the head of the queue, + overwriting old values if the buffer is full. + + + This method is much more efficient that the Add(PointPair) + method, since it does not require that a new PointPair instance be provided. + If the buffer already contains a at the head position, + then the x, y, z, and tag values will be copied into the existing PointPair. + Otherwise, a new PointPair instance must be created. + In this way, each PointPair position in the rolling list will only be allocated one time. + To truly be memory efficient, the , , + and methods should be avoided. Also, the property + for this method should be null, since it is a reference type. + + The X value + The Y value + The Tag value for the PointPair + + + + Add a set of values onto the head of the queue, + overwriting old values if the buffer is full. + + + This method is much more efficient that the Add(PointPair) + method, since it does not require that a new PointPair instance be provided. + If the buffer already contains a at the head position, + then the x, y, z, and tag values will be copied into the existing PointPair. + Otherwise, a new PointPair instance must be created. + In this way, each PointPair position in the rolling list will only be allocated one time. + To truly be memory efficient, the , , + and methods should be avoided. + + The X value + The Y value + The Z value + + + + Add a set of points to the + from two arrays of type double. + If either array is null, then a set of ordinal values is automatically + generated in its place (see ). + If the arrays are of different size, then the larger array prevails and the + smaller array is padded with values. + + A double[] array of X values + A double[] array of Y values + + + + Add a set of points to the from + three arrays of type double. + If the X or Y array is null, then a set of ordinal values is automatically + generated in its place (see . + If the value + is null, then it is set to zero. + If the arrays are of different size, then the larger array prevails and the + smaller array is padded with values. + + A double[] array of X values + A double[] array of Y values + A double[] array of Z values + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Gets the capacity of the rolling buffer. + + + + + Gets the count of items within the rolling buffer. Note that this may be less than + the capacity. + + + + + Gets a bolean that indicates if the buffer is empty. + Alternatively you can test Count==0. + + + + + Gets or sets the at the specified index in the buffer. + + + Index must be within the current size of the buffer, e.g., the set + method will not expand the buffer even if is available + + + + + A collection class containing a list of objects. + + + John Champion + $Revision: 3.6 $ $Date: 2006-06-24 20:26:43 $ + + + + Current schema value that defines the version of the serialized file + + + + + Default constructor for the collection class. + + + + + The Copy Constructor + + The object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Return the zero-based position index of the + with the specified . + + The comparison of titles is not case sensitive, but it must include + all characters including punctuation, spaces, etc. + The label that is in the + attribute of the item to be found. + + The zero-based index of the specified , + or -1 if the was not found in the list + + + + + Return the zero-based position index of the + with the specified . + + In order for this method to work, the + property must be of type . + The tag that is in the + attribute of the item to be found. + + The zero-based index of the specified , + or -1 if the string is not in the list + + + + Indexer to access the specified object by + its string. + + The string title of the + object to be accessed. + A object reference. + + + + A class that represents a line segment object on the graph. A list of + GraphObj objects is maintained by the collection class. + + + This should not be confused with the class, which represents + a set of points plotted together as a "curve". The class is + a single line segment, drawn as a "decoration" on the chart. + + John Champion + $Revision: 3.4 $ $Date: 2007-01-25 07:56:09 $ + + + + Current schema value that defines the version of the serialized file + + + + + protected field that maintains the attributes of the line using an + instance of the class. + + + + Constructors for the object + + A constructor that allows the position, color, and size of the + to be pre-specified. + + An arbitrary specification + for the arrow + The x position of the starting point that defines the + line. The units of this position are specified by the + property. + The y position of the starting point that defines the + line. The units of this position are specified by the + property. + The x position of the ending point that defines the + line. The units of this position are specified by the + property. + The y position of the ending point that defines the + line. The units of this position are specified by the + property. + + + + A constructor that allows only the position of the + line to be pre-specified. All other properties are set to + default values + + The x position of the starting point that defines the + . The units of this position are specified by the + property. + The y position of the starting point that defines the + . The units of this position are specified by the + property. + The x position of the ending point that defines the + . The units of this position are specified by the + property. + The y position of the ending point that defines the + . The units of this position are specified by the + property. + + + + Default constructor -- places the at location + (0,0) to (1,1). All other values are defaulted. + + + + + The Copy Constructor + + The object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Render this object to the specified device. + + + This method is normally only called by the Draw method + of the parent collection object. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Determine if the specified screen point lies inside the bounding box of this + . + + The bounding box is calculated assuming a distance + of pixels around the arrow segment. + + The screen point, in pixels + + A reference to the object that is the parent or + owner of this object. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + true if the point lies in the bounding box, false otherwise + + + + Determines the shape type and Coords values for this GraphObj + + + + + A class that contains the attributes for drawing this + . + + + + + This class handles the drawing of the curve objects. + The Error Bars are the vertical lines with a symbol at each end. + + To draw "I-Beam" bars, the symbol type defaults to + , which is just a horizontal line. + If is Y-oriented, then the symbol type should be + set to to get the same effect. + + + John Champion + $Revision: 3.21 $ $Date: 2007-08-10 16:22:54 $ + + + + Current schema value that defines the version of the serialized file + + + + + Private field that stores the visibility of this + . Use the public + property to access this value. If this value is + false, the symbols will not be shown. + + + + + Private field that stores the error bar color. Use the public + property to access this value. + + + + + Private field that stores the pen width for this error bar. Use the public + property to access this value. + + + + + private field that contains the symbol element that will be drawn + at the top and bottom of the error bar. Use the public property + to access this value. + + + + + Default constructor that sets all properties to + default values as defined in the class. + + + + + Default constructor that sets the + as specified, and the remaining + properties to default + values as defined in the class. + + A value indicating + the color of the symbol + + + + + The Copy Constructor + + The object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Draw the to the specified + device at the specified location. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + boolean value that indicates if the "base" axis for this + is the X axis. True for an base, + false for a or base. + The independent axis position of the center of the error bar in + pixel units + The dependent axis position of the top of the error bar in + pixel units + The dependent axis position of the bottom of the error bar in + pixel units + + The scaling factor for the features of the graph based on the . This + scaling factor is calculated by the method. The scale factor + represents a linear multiple to be applied to font sizes, symbol sizes, etc. + A pen with attributes of and + for this + The data value to be used for a value-based + color gradient. This is only applicable for , + or . + Indicates that the should be drawn + with attributes from the class. + + + + + Draw all the 's to the specified + device as a an error bar at each defined point. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + A object representing the + 's to be drawn. + The class instance that defines the base (independent) + axis for the + The class instance that defines the value (dependent) + axis for the + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Gets or sets a property that shows or hides the . + + true to show the error bar, false to hide it + + + + + Gets or sets the data for this + . + + This property only controls the color of + the vertical line. The symbol color is controlled separately in + the property. + + + + + The pen width to be used for drawing error bars + Units are points. + + This property only controls the pen width for the + vertical line. The pen width for the symbol outline is + controlled separately by the property. + + + + + Contains the symbol element that will be drawn + at the top and bottom of the error bar. + + + + + A simple struct that defines the + default property values for the class. + + + + + The default size for curve symbols + ( property), + in units of points. + + + + + The default pen width to be used for drawing error bars + ( property). Units are points. + + + + + The default display mode for symbols ( property). + true to display symbols, false to hide them. + + + + + The default color for drawing error bars ( property). + + + + + The default symbol for drawing at the top and bottom of the + error bar (see ). + + + + + A class that represents a bordered and/or filled ellipse object on + the graph. A list of EllipseObj objects is maintained by the + collection class. The ellipse is defined + as the ellipse that would be contained by the rectangular box as + defined by the property. + + + John Champion + $Revision: 3.3 $ $Date: 2007-01-25 07:56:08 $ + + + + A class that represents a bordered and/or filled box (rectangle) object on + the graph. A list of + BoxObj objects is maintained by the collection class. + + + John Champion + $Revision: 3.3 $ $Date: 2007-01-25 07:56:08 $ + + + + Current schema value that defines the version of the serialized file + + + + + Private field that stores the data for this + . Use the public property to + access this value. + + + + + Private field that determines the properties of the border around this + + Use the public property to access this value. + + + + Constructors for the object + + A constructor that allows the position, border color, and solid fill color + of the to be pre-specified. + + An arbitrary specification + for the box border + An arbitrary specification + for the box fill (will be a solid color fill) + The x location for this . This will be in units determined by + . + The y location for this . This will be in units determined by + . + The width of this . This will be in units determined by + . + The height of this . This will be in units determined by + . + + + + A constructor that allows the position + of the to be pre-specified. Other properties are defaulted. + + The x location for this . This will be in units determined by + . + The y location for this . This will be in units determined by + . + The width of this . This will be in units determined by + . + The height of this . This will be in units determined by + . + + + + A default constructor that creates a using a location of (0,0), + and a width,height of (1,1). Other properties are defaulted. + + + + + A constructor that allows the position, border color, and two-color + gradient fill colors + of the to be pre-specified. + + An arbitrary specification + for the box border + An arbitrary specification + for the start of the box gradient fill + An arbitrary specification + for the end of the box gradient fill + The x location for this . This will be in units determined by + . + The y location for this . This will be in units determined by + . + The width of this . This will be in units determined by + . + The height of this . This will be in units determined by + . + + + + The Copy Constructor + + The object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Render this object to the specified device. + + + This method is normally only called by the Draw method + of the parent collection object. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Determine if the specified screen point lies inside the bounding box of this + . + + The screen point, in pixels + + A reference to the object that is the parent or + owner of this object. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + true if the point lies in the bounding box, false otherwise + + + + Determines the shape type and Coords values for this GraphObj + + + + + Gets or sets the data for this + . + + + + + Gets or sets the object, which + determines the properties of the border around this + + + + + + A simple struct that defines the + default property values for the class. + + + + + The default pen width used for the border + ( property). Units are points (1/72 inch). + + + + + The default color used for the border + ( property). + + + + + The default color used for the fill + ( property). + + + + + Current schema value that defines the version of the serialized file + + + + Constructors for the object + + A constructor that allows the position and size + of the to be pre-specified. Other properties are defaulted. + + The x location for this . This will be in units determined by + . + The y location for this . This will be in units determined by + . + The width of this . This will be in units determined by + . + The height of this . This will be in units determined by + . + + + + A default constructor that places the at location (0,0), + with width/height of (1,1). Other properties are defaulted. + + + + + A constructor that allows the position, border color, and solid fill color + of the to be pre-specified. + + An arbitrary specification + for the ellipse border + An arbitrary specification + for the ellipse fill (will be a solid color fill) + The x location for this . This will be in units determined by + . + The y location for this . This will be in units determined by + . + The width of this . This will be in units determined by + . + The height of this . This will be in units determined by + . + + + + A constructor that allows the position, border color, and two-color + gradient fill colors + of the to be pre-specified. + + An arbitrary specification + for the ellipse border + An arbitrary specification + for the start of the ellipse gradient fill + An arbitrary specification + for the end of the ellipse gradient fill + The x location for this . This will be in units determined by + . + The y location for this . This will be in units determined by + . + The width of this . This will be in units determined by + . + The height of this . This will be in units determined by + . + + + + The Copy Constructor + + The object from + which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Render this object to the specified device. + + + This method is normally only called by the Draw method + of the parent collection object. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Determine if the specified screen point lies inside the bounding box of this + . + + The screen point, in pixels + + A reference to the object that is the parent or + owner of this object. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + true if the point lies in the bounding box, false otherwise + + + + Class that handles the global settings for bar charts + + + John Champion + $Revision: 3.6 $ $Date: 2007-12-30 23:27:39 $ + + + + Current schema value that defines the version of the serialized file + + + + Private field that determines the size of the gap between bar clusters + for bar charts. This gap is expressed as a fraction of the bar size (1.0 means + leave a 1-barwidth gap between clusters). + Use the public property to access this value. + + + Private field that determines the size of the gap between individual bars + within a bar cluster for bar charts. This gap is expressed as a fraction of the + bar size (1.0 means leave a 1-barwidth gap between each bar). + Use the public property to access this value. + + + Private field that determines the base axis from which + graphs will be displayed. The base axis is the axis from which the bars grow with + increasing value. The value is of the enumeration type . + To access this value, use the public property . + + + + + Private field that determines how the + graphs will be displayed. See the enum + for the individual types available. + To access this value, use the public property . + + + + + Private field that determines the width of a bar cluster (for bar charts) + in user scale units. Normally, this value is 1.0 because bar charts are typically + or , and the bars are + defined at ordinal values (1.0 scale units apart). For + or other scale types, you can use this value to scale the bars to an arbitrary + user scale. Use the public property to access this + value. + + + + Private field that determines if the will be + calculated automatically. Use the public property + to access this value. + + + + + private field that stores the owner GraphPane that contains this BarSettings instance. + + + + + Constructor to build a instance from the defaults. + + + + + Copy constructor + + the instance to be copied. + The that will be the + parent of this new BarSettings object. + + + + Constructor for deserializing objects + + + You MUST set the _ownerPane property after deserializing a BarSettings object. + + A instance that defines the + serialized data + + A instance that contains + the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Calculate the width of an individual bar cluster on a graph. + This value only applies to bar graphs plotted on non-ordinal X axis + types ( is false). + + + This value can be calculated automatically if + is set to true. In this case, ClusterScaleWidth will be calculated if + refers to an of a non-ordinal type + ( is false). The ClusterScaleWidth is calculated + from the minimum difference found between any two points on the + for any in the + . The ClusterScaleWidth is set automatically + each time is called. + + + + + + + + + Determine the minimum increment between individual points to be used for + calculating a bar size that fits without overlapping + + The list of points for the bar + of interest + The base axis for the bar + The minimum increment between bars along the base axis + + + + Determine the width, in screen pixel units, of each bar cluster including + the cluster gaps and bar gaps. + + This method calls the + method for the base for graphs + (the base is assigned by the + property). + + + + + + The width of each bar cluster, in pixel units + + + + Determine the from which the charts are based. + + + + + + The class for the axis from which the bars are based + + + + The minimum space between clusters, expressed as a + fraction of the bar size. + + + + + + + + The minimum space between individual Bars + within a cluster, expressed as a + fraction of the bar size. + + + + + + + Determines the base axis from which + graphs will be displayed. + + The base axis is the axis from which the bars grow with + increasing value. The value is of the enumeration type . + + + + + Determines how the + graphs will be displayed. See the enum + for the individual types available. + + + + + + The width of an individual bar cluster on a graph. + This value only applies to bar graphs plotted on non-ordinal X axis + types (, , and + . + + + This value can be calculated automatically if + is set to true. In this case, ClusterScaleWidth will be calculated if + refers to an of a non-ordinal type + ( is false). The ClusterScaleWidth is calculated + from the minimum difference found between any two points on the + for any in the + . The ClusterScaleWidth is set automatically + each time is called. Calculations are + done by the method. + + + + + + + + + Gets or sets a property that determines if the will be + calculated automatically. + + true for the to be calculated + automatically based on the available data, false otherwise. This value will + be set to false automatically if the value + is changed by the user. + + + + + + + A simple struct that defines the + default property values for the class. + + + + + The default dimension gap between clusters of bars on a + graph. + This dimension is expressed in terms of the normal bar width. + + + + + + + The default dimension gap between each individual bar within a bar cluster + on a graph. + This dimension is expressed in terms of the normal bar width. + + + + + + The default value for the , which determines the base + from which the graphs will be displayed. + + + + + The default value for the property, which + determines if the bars are drawn overlapping eachother in a "stacked" format, + or side-by-side in a "cluster" format. See the + for more information. + + + + + + The default width of a bar cluster + on a graph. This value only applies to + graphs, and only when the + is , + or . + This dimension is expressed in terms of X scale user units. + + + + + + + The default value for . + + + + + Class that handles the data associated with text title and its associated font + properties. Inherits from , and adds + and properties, which are specifically associated with + the . + + + John Champion + $Revision: 3.1 $ $Date: 2006-06-24 20:26:44 $ + + + + Current schema value that defines the version of the serialized file + + + + + Constructor to build an from the text and the + associated font properties. + + The representing the text to be + displayed + The font family name + The size of the font in points and scaled according + to the logic. + The instance representing the color + of the font + true for a bold font face + true for an italic font face + true for an underline font face + + + + Copy constructor + + the instance to be copied. + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Gets or sets the property that controls whether or not the magnitude factor (power of 10) for + this scale will be included in the label. + + + For large scale values, a "magnitude" value (power of 10) is automatically + used for scaling the graph. This magnitude value is automatically appended + to the end of the Axis (e.g., "(10^4)") to indicate + that a magnitude is in use. This property controls whether or not the + magnitude is included in the title. Note that it only affects the axis + title; a magnitude value may still be used even if it is not shown in the title. + + true to show the magnitude value, false to hide it + + + + + + + Gets or sets a value that determines whether the Axis title is located at the + + value or at the normal position (outside the ). + + + This value only applies if is false. + + + + + A class that represents a bordered and/or filled polygon object on + the graph. A list of objects is maintained by + the collection class. + + + John Champion + $Revision: 3.4 $ $Date: 2007-01-25 07:56:09 $ + + + + Current schema value that defines the version of the serialized file + + + + + private value that determines if the polygon will be automatically closed. + true to close the figure, false to leave it "open." Use the public property + to access this value. + + + + Constructors for the object + + A constructor that allows the position, border color, and solid fill color + of the to be pre-specified. + + An arbitrary specification + for the box border + An arbitrary specification + for the box fill (will be a solid color fill) + The array that defines + the polygon. This will be in units determined by + . + + + + + A constructor that allows the position + of the to be pre-specified. Other properties are defaulted. + + The array that defines + the polygon. This will be in units determined by + . + + + + + A default constructor that creates a from an empty + array. Other properties are defaulted. + + + + + A constructor that allows the position, border color, and two-color + gradient fill colors + of the to be pre-specified. + + An arbitrary specification + for the box border + An arbitrary specification + for the start of the box gradient fill + An arbitrary specification + for the end of the box gradient fill + The array that defines + the polygon. This will be in units determined by + . + + + + + The Copy Constructor + + The object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Render this object to the specified device. + + + This method is normally only called by the Draw method + of the parent collection object. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Determine if the specified screen point lies inside the bounding box of this + . + + The screen point, in pixels + + A reference to the object that is the parent or + owner of this object. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + true if the point lies in the bounding box, false otherwise + + + + Gets or sets the array that defines + the polygon. This will be in units determined by + . + + + + + Gets or sets a value that determines if the polygon will be automatically closed. + true to close the figure, false to leave it "open." + + + This boolean determines whether or not the CloseFigure() method will be called + to fully close the path of the polygon. This value defaults to true, and for any + closed figure it should fine. If you want to draw a line that does not close into + a shape, then you should set this value to false. For a figure that is naturally + closed (e.g., the first point of the polygon is the same as the last point), + leaving this value set to false may result in minor pixel artifacts due to + rounding. + + + + + The LinearScale class inherits from the class, and implements + the features specific to . + + + LinearScale is the normal, default cartesian axis. + + + John Champion + $Revision: 1.10 $ $Date: 2007-04-16 00:03:02 $ + + + + Current schema value that defines the version of the serialized file + + + + + Default constructor that defines the owner + (containing object) for this new object. + + The owner, or containing object, of this instance + + + + The Copy Constructor + + The object from which to copy + The object that will own the + new instance of + + + + Create a new clone of the current item, with a new owner assignment + + The new instance that will be + the owner of the new Scale + A new clone. + + + + Select a reasonable linear axis scale given a range of data values. + + + This method only applies to type axes, and it + is called by the general method. The scale range is chosen + based on increments of 1, 2, or 5 (because they are even divisors of 10). This + method honors the , , + and autorange settings. + In the event that any of the autorange settings are false, the + corresponding , , or + setting is explicitly honored, and the remaining autorange settings (if any) will + be calculated to accomodate the non-autoranged values. The basic defaults for + scale selection are defined using , + , and + from the default class. + On Exit: + is set to scale minimum (if = true) + is set to scale maximum (if = true) + is set to scale step size (if = true) + is set to scale minor step size (if = true) + is set to a magnitude multiplier according to the data + is set to the display format for the values (this controls the + number of decimal places, whether there are thousands separators, currency types, etc.) + + A reference to the object + associated with this + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Return the for this , which is + . + + + + + A class that represents an image object on the graph. A list of + objects is maintained by the + collection class. + + + John Champion + $Revision: 3.2 $ $Date: 2006-09-09 17:32:01 $ + + + + Current schema value that defines the version of the serialized file + + + + + Private field that stores the image. Use the public property + to access this value. + + + + + Private field that determines if the image will be scaled to the output rectangle. + + true to scale the image, false to draw the image unscaled, but clipped + to the destination rectangle + + + Constructors for the object + + A default constructor that places a null at a + default of (0,0,1,1) + + + + + A constructor that allows the and + location for the + to be pre-specified. + + A class that defines + the image + A struct that defines the + image location, specifed in units based on the + property. + + + Constructors for the object + + A constructor that allows the and + location for the + to be pre-specified. + + A class that defines + the image + A struct that defines the + image location, specifed in units based on the + property. + The enum value that + indicates what type of coordinate system the x and y parameters are + referenced to. + The enum that specifies + the horizontal alignment of the object with respect to the (x,y) location + The enum that specifies + the vertical alignment of the object with respect to the (x,y) location + + + Constructors for the object + + A constructor that allows the and + individual coordinate locations for the + to be pre-specified. + + A class that defines + the image + The position of the left side of the rectangle that defines the + location. The units of this position are specified by the + property. + The position of the top side of the rectangle that defines the + location. The units of this position are specified by the + property. + The width of the rectangle that defines the + location. The units of this position are specified by the + property. + The height of the rectangle that defines the + location. The units of this position are specified by the + property. + + + + The Copy Constructor + + The object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Render this object to the specified device + This method is normally only called by the Draw method + of the parent collection object. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Determine if the specified screen point lies inside the bounding box of this + . The bounding box is calculated assuming a distance + of pixels around the arrow segment. + + The screen point, in pixels + + A reference to the object that is the parent or + owner of this object. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + true if the point lies in the bounding box, false otherwise + + + + Determines the shape type and Coords values for this GraphObj + + + + + The object. + + A class reference. + + + + Gets or sets a property that determines if the image will be scaled to the + output rectangle (see ). + + true to scale the image, false to draw the image unscaled, but clipped + to the destination rectangle + + + + A simple struct that defines the + default property values for the class. + + + + + Default value for the + property. + + + + + Class encapsulates the graph pane, which is all display elements + associated with an individual graph. + + This class is the outside "wrapper" + for the ZedGraph classes, and provides the interface to access the attributes + of the graph. You can have multiple graphs in the same document or form, + just instantiate multiple GraphPane's. + + + John Champion modified by Jerry Vos + $Revision: 3.81 $ $Date: 2007-09-30 07:44:11 $ + + + + Current schema value that defines the version of the serialized file + + + + Private field instance of the class. Use the + public property to access this class. + + + Private field instance of the class. Use the + public property to access this class. + + + Private field instance of the class. Use the + public property to access this class. + + + Private field instance of the class. Use the + public property to access this class. + + + Private field instance of the class. Use the + public property to access this class. + + + + private value that contains a , which stores prior + objects containing scale range information. This enables + zooming and panning functionality for the . + + + + Private field that determines whether or not initial zero values will + be included or excluded when determining the Y or Y2 axis scale range. + Use the public property to access + this value. + + + Private field that determines whether or not initial + values will cause the line segments of + a curve to be discontinuous. If this field is true, then the curves + will be plotted as continuous lines as if the Missing values did not + exist. + Use the public property to access + this value. + + + private field that determines if the auto-scaled axis ranges will subset the + data points based on any manually set scale range values. Use the public property + to access this value. + The bounds provide a means to subset the data. For example, if all the axes are set to + autoscale, then the full range of data are used. But, if the XAxis.Min and XAxis.Max values + are manually set, then the Y data range will reflect the Y values within the bounds of + XAxis.Min and XAxis.Max. + + + + private field that determines if ZedGraph should modify the scale ranges for the Y and Y2 + axes such that the number of steps, and therefore the grid lines, line up. Use the + public property to acccess this value. + + + + Private field that determines how the + graphs will be displayed. See the enum + for the individual types available. + To access this value, use the public property . + + + + + + Default Constructor. Sets the to (0, 0, 500, 375), and + sets the and values to empty + strings. + + + + + Constructor for the object. This routine will + initialize all member variables and classes, setting appropriate default + values as defined in the class. + + A rectangular screen area where the graph is to be displayed. + This area can be any size, and can be resize at any time using the + property. + + The for this + The for the + The for the + + + + The Copy Constructor + + The GraphPane object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + AxisChange causes the axes scale ranges to be recalculated based on the current data range. + + + There is no obligation to call AxisChange() for manually scaled axes. AxisChange() is only + intended to handle auto scaling operations. Call this function anytime you change, add, or + remove curve data to insure that the scale range of the axes are appropriate for the data range. + This method calculates + a scale minimum, maximum, and step size for each axis based on the current curve data. + Only the axis attributes (min, max, step) that are set to auto-range + (, , ) + will be modified. You must call after calling + AxisChange to make sure the display gets updated.
+ This overload of AxisChange just uses the default Graphics instance for the screen. + If you have a Graphics instance available from your Windows Form, you should use + the overload instead. +
+
+ + + AxisChange causes the axes scale ranges to be recalculated based on the current data range. + + + There is no obligation to call AxisChange() for manually scaled axes. AxisChange() is only + intended to handle auto scaling operations. Call this function anytime you change, add, or + remove curve data to insure that the scale range of the axes are appropriate for the data range. + This method calculates + a scale minimum, maximum, and step size for each axis based on the current curve data. + Only the axis attributes (min, max, step) that are set to auto-range + (, , ) + will be modified. You must call + after calling AxisChange to make sure the display gets updated. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + + + Draw all elements in the to the specified graphics device. + + This method + should be part of the Paint() update process. Calling this routine will redraw all + features of the graph. No preparation is required other than an instantiated + object. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + + + Calculate the based on the . + + The ChartRect + is the plot area bounded by the axes, and the rect is the total area as + specified by the client application. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + The calculated chart rect, in pixel coordinates. + + + + Calculate the based on the . + + The ChartRect + is the plot area bounded by the axes, and the rect is the total area as + specified by the client application. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + The scaling factor for the features of the graph based on the . This + scaling factor is calculated by the method. The scale factor + represents a linear multiple to be applied to font sizes, symbol sizes, etc. + + The calculated chart rect, in pixel coordinates. + + + + This method will set the property for all three axes; + , , and . + + The + is calculated using the currently required space multiplied by a fraction + (bufferFraction). + The currently required space is calculated using , and is + based on current data ranges, font sizes, etc. The "space" is actually the amount of space + required to fit the tic marks, scale labels, and axis title. + The calculation is done by calling the method for + each . + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + The amount of space to allocate for the axis, expressed + as a fraction of the currently required space. For example, a value of 1.2 would + allow for 20% extra above the currently required space. + If true, then this method will only modify the + property if the calculated result is more than the current value. + + + + Add a curve ( object) to the plot with + the given data points (double arrays) and properties. + This is simplified way to add curves without knowledge of the + class. An alternative is to use + the Add() method. + + The text label (string) for the curve that will be + used as a entry. + An array of double precision X values (the + independent values) that define the curve. + An array of double precision Y values (the + dependent values) that define the curve. + The color to used for the curve line, + symbols, etc. + A class for the newly created curve. + This can then be used to access all of the curve properties that + are not defined as arguments to the + method. + + + + Add a curve ( object) to the plot with + the given data points () and properties. + This is simplified way to add curves without knowledge of the + class. An alternative is to use + the Add() method. + + The text label (string) for the curve that will be + used as a entry. + A of double precision value pairs that define + the X and Y values for this curve + The color to used for the curve line, + symbols, etc. + A class for the newly created curve. + This can then be used to access all of the curve properties that + are not defined as arguments to the + method. + + + + Add a curve ( object) to the plot with + the given data points (double arrays) and properties. + This is simplified way to add curves without knowledge of the + class. An alternative is to use + the Add() method. + + The text label (string) for the curve that will be + used as a entry. + An array of double precision X values (the + independent values) that define the curve. + An array of double precision Y values (the + dependent values) that define the curve. + The color to used for the curve line, + symbols, etc. + A symbol type () + that will be used for this curve. + A class for the newly created curve. + This can then be used to access all of the curve properties that + are not defined as arguments to the + method. + + + + Add a curve ( object) to the plot with + the given data points () and properties. + This is simplified way to add curves without knowledge of the + class. An alternative is to use + the Add() method. + + The text label (string) for the curve that will be + used as a entry. + A of double precision value pairs that define + the X and Y values for this curve + The color to used for the curve line, + symbols, etc. + A symbol type () + that will be used for this curve. + A class for the newly created curve. + This can then be used to access all of the curve properties that + are not defined as arguments to the + method. + + + + Add a stick graph ( object) to the plot with + the given data points (double arrays) and properties. + This is simplified way to add curves without knowledge of the + class. An alternative is to use + the Add() method. + + The text label (string) for the curve that will be + used as a entry. + An array of double precision X values (the + independent values) that define the curve. + An array of double precision Y values (the + dependent values) that define the curve. + The color to used for the curve line, + symbols, etc. + A class for the newly created curve. + This can then be used to access all of the curve properties that + are not defined as arguments to the + method. + + + + Add a stick graph ( object) to the plot with + the given data points () and properties. + This is simplified way to add curves without knowledge of the + class. An alternative is to use + the Add() method. + + The text label (string) for the curve that will be + used as a entry. + A of double precision value pairs that define + the X and Y values for this curve + The color to used for the curve line, + symbols, etc. + A class for the newly created curve. + This can then be used to access all of the curve properties that + are not defined as arguments to the + method. + + + + Add a candlestick graph ( object) to the plot with + the given data points () and properties. + + + This is simplified way to add curves without knowledge of the + class. An alternative is to use + the Add() method. + Note that the + should contain objects instead of + objects in order to contain all the data values required for this curve type. + + The text label (string) for the curve that will be + used as a entry. + A of double precision value pairs that define + the X and Y values for this curve + The color to used for the curve line, + symbols, etc. + A class for the newly created curve. + This can then be used to access all of the curve properties that + are not defined as arguments to the + method. + + + + Add a japanesecandlestick graph ( object) to the plot with + the given data points () and properties. + + + This is simplified way to add curves without knowledge of the + class. An alternative is to use + the Add() method. + Note that the + should contain objects instead of + objects in order to contain all the data values required for this curve type. + + The text label (string) for the curve that will be + used as a entry. + A of double precision value pairs that define + the X and Y values for this curve + A class for the newly created curve. + This can then be used to access all of the curve properties that + are not defined as arguments to the + method. + + + + Add an error bar set ( object) to the plot with + the given data points () and properties. + This is simplified way to add curves without knowledge of the + class. An alternative is to use + the Add() method. + + The text label (string) for the curve that will be + used as a entry. + An array of double precision X values (the + independent values) that define the curve. + An array of double precision Y values (the + dependent values) that define the curve. + An array of double precision values that define the + base value (the bottom) of the bars for this curve. + + The color to used for the curve line, + symbols, etc. + An class for the newly created curve. + This can then be used to access all of the curve properties that + are not defined as arguments to the + method. + + + + Add an error bar set ( object) to the plot with + the given data points () and properties. + This is simplified way to add curves without knowledge of the + class. An alternative is to use + the Add() method. + + The text label (string) for the curve that will be + used as a entry. + A of double precision value pairs that define + the X and Y values for this curve + The color to used for the curve line, + symbols, etc. + An class for the newly created curve. + This can then be used to access all of the curve properties that + are not defined as arguments to the + method. + + + + Add a bar type curve ( object) to the plot with + the given data points () and properties. + This is simplified way to add curves without knowledge of the + class. An alternative is to use + the Add() method. + + The text label (string) for the curve that will be + used as a entry. + A of double precision value pairs that define + the X and Y values for this curve + The color to used to fill the bars + A class for the newly created bar curve. + This can then be used to access all of the curve properties that + are not defined as arguments to the + method. + + + + Add a bar type curve ( object) to the plot with + the given data points (double arrays) and properties. + This is simplified way to add curves without knowledge of the + class. An alternative is to use + the Add() method. + + The text label (string) for the curve that will be + used as a entry. + An array of double precision X values (the + independent values) that define the curve. + An array of double precision Y values (the + dependent values) that define the curve. + The color to used for the bars + A class for the newly created bar curve. + This can then be used to access all of the curve properties that + are not defined as arguments to the + method. + + + + Add a "High-Low" bar type curve ( object) to the plot with + the given data points (double arrays) and properties. + This is simplified way to add curves without knowledge of the + class. An alternative is to use + the Add() method. + + The text label (string) for the curve that will be + used as a entry. + An array of double precision X values (the + independent values) that define the curve. + An array of double precision Y values (the + dependent values) that define the curve. + An array of double precision values that define the + base value (the bottom) of the bars for this curve. + + The color to used for the bars + A class for the newly created bar curve. + This can then be used to access all of the curve properties that + are not defined as arguments to the + method. + + + + Add a hi-low bar type curve ( object) to the plot with + the given data points () and properties. + This is simplified way to add curves without knowledge of the + class. An alternative is to use + the Add() method. + + The text label (string) for the curve that will be + used as a entry. + A of double precision value Trio's that define + the X, Y, and lower dependent values for this curve + The color to used to fill the bars + A class for the newly created bar curve. + This can then be used to access all of the curve properties that + are not defined as arguments to the + method. + + + + Add a to the display. + + The value associated with this item. + The display color for this item. + The amount this item will be + displaced from the center of the . + Text label for this + a reference to the constructed + + + + Add a to the display, providing a gradient fill for the pie color. + + The value associated with this instance. + The starting display color for the gradient for this + instance. + The ending display color for the gradient for this + instance. + The angle for the gradient . + The amount this instance will be + displaced from the center point. + Text label for this instance. + + + + Creates all the s for a single Pie Chart. + + double array containing all s + for a single PieChart. + + string array containing all s + for a single PieChart. + + an array containing references to all s comprising + the Pie Chart. + + + + Transform a data point from the specified coordinate type + () to screen coordinates (pixels). + + This method implicitly assumes that + has already been calculated via or + methods, or the is + set manually (see ). + The X,Y pair that defines the point in user + coordinates. + A type that defines the + coordinate system in which the X,Y pair is defined. + A point in screen coordinates that corresponds to the + specified user point. + + + + Transform a data point from the specified coordinate type + () to screen coordinates (pixels). + + This method implicitly assumes that + has already been calculated via or + methods, or the is + set manually (see ). + Note that this method is more accurate than the + overload, since it uses double types. This would typically only be significant for + coordinates. + + The x coordinate that defines the location in user space + The y coordinate that defines the location in user space + A type that defines the + coordinate system in which the X,Y pair is defined. + A point in screen coordinates that corresponds to the + specified user point. + + + + Return the user scale values that correspond to the specified screen + coordinate position (pixels). This overload assumes the default + and . + + This method implicitly assumes that + has already been calculated via or + methods, or the is + set manually (see ). + The X,Y pair that defines the screen coordinate + point of interest + The resultant value in user coordinates from the + + The resultant value in user coordinates from the + primary + + + + Return the user scale values that correspond to the specified screen + coordinate position (pixels). + + This method implicitly assumes that + has already been calculated via or + methods, or the is + set manually (see ). + The X,Y pair that defines the screen coordinate + point of interest + The resultant value in user coordinates from the + + The resultant value in user coordinates from the + + The resultant value in user coordinates from the + primary + The resultant value in user coordinates from the + primary + + + + Return the user scale values that correspond to the specified screen + coordinate position (pixels). + + This method implicitly assumes that + has already been calculated via or + methods, or the is + set manually (see ). + The X,Y pair that defines the screen coordinate + point of interest + true to return data that corresponds to an + , false for an . + true to return data that corresponds to a + , false for a . + The ordinal index of the Y or Y2 axis from which + to return data (see , ) + + The resultant value in user coordinates from the + + The resultant value in user coordinates from the + primary + + + + Return the user scale values that correspond to the specified screen + coordinate position (pixels) for all y axes. + + This method implicitly assumes that + has already been calculated via or + methods, or the is + set manually (see ). + The X,Y pair that defines the screen coordinate + point of interest + The resultant value in user coordinates from the + + The resultant value in user coordinates from the + + An array of resultant values in user coordinates from the + list of instances. This method allocates the + array for you, according to the number of objects + in the list. + An array of resultant values in user coordinates from the + list of instances. This method allocates the + array for you, according to the number of objects + in the list. + + + + Add a secondary (left side) to the list of axes + in the Graph. + + + Note that the primary is always included by default. + This method turns off the and + and + properties by default. + + The title for the . + the ordinal position (index) in the . + + + + Add a secondary (right side) to the list of axes + in the Graph. + + + Note that the primary is always included by default. + This method turns off the and + and + properties by default. + + The title for the . + the ordinal position (index) in the . + + + + Find the object that lies closest to the specified mouse (screen) point. + + + This method will search through all of the graph objects, such as + , , , + , and . + If the mouse point is within the bounding box of the items (or in the case + of and , within + pixels), then the object will be returned. + You must check the type of the object to determine what object was + selected (for example, "if ( object is Legend ) ..."). The + parameter returns the index number of the item + within the selected object (such as the point number within a + object. + + The screen point, in pixel coordinates. + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + A reference to the nearest object to the + specified screen point. This can be any of , + , , + , , or . + Note: If the pane title is selected, then the object + will be returned. + + The index number of the item within the selected object + (where applicable). For example, for a object, + will be the index number of the nearest data point, + accessible via CurveItem.Points[index]. + index will be -1 if no data points are available. + true if an object was found, false otherwise. + + + + + Find the data point that lies closest to the specified mouse (screen) + point for the specified curve. + + + This method will search only through the points for the specified + curve to determine which point is + nearest the mouse point. It will only consider points that are within + pixels of the screen point. + + The screen point, in pixel coordinates. + A reference to the + instance that contains the closest point. nearestCurve will be null if + no data points are available. + A object containing + the data points to be searched. + The index number of the closest point. The + actual data vpoint will then be CurveItem.Points[iNearest] + . iNearest will + be -1 if no data points are available. + true if a point was found and that point lies within + pixels + of the screen point, false otherwise. + + + + Find the data point that lies closest to the specified mouse (screen) + point. + + + This method will search through all curves in + to find which point is + nearest. It will only consider points that are within + pixels of the screen point. + + The screen point, in pixel coordinates. + A reference to the + instance that contains the closest point. nearestCurve will be null if + no data points are available. + The index number of the closest point. The + actual data vpoint will then be CurveItem.Points[iNearest] + . iNearest will + be -1 if no data points are available. + true if a point was found and that point lies within + pixels + of the screen point, false otherwise. + + + + Find the data point that lies closest to the specified mouse (screen) + point. + + + This method will search through the specified list of curves to find which point is + nearest. It will only consider points that are within + pixels of the screen point, and it will + only consider 's that are in + . + + The screen point, in pixel coordinates. + A object containing + a subset of 's to be searched. + A reference to the + instance that contains the closest point. nearestCurve will be null if + no data points are available. + The index number of the closest point. The + actual data vpoint will then be CurveItem.Points[iNearest] + . iNearest will + be -1 if no data points are available. + true if a point was found and that point lies within + pixels + of the screen point, false otherwise. + + + + Search through the and for + items that contain active objects. + + The mouse location where the click occurred + An appropriate instance + The current scaling factor for drawing operations. + The clickable object that was found. Typically a type of + or a type of . + The instance that is contained within + the object. + An index value, indicating which point was clicked for + type objects. + returns true if a clickable link was found under the + , or false otherwise. + + + + + Find any objects that exist within the specified (screen) rectangle. + This method will search through all of the graph objects, such as + , , , + , and . + and see if the objects' bounding boxes are within the specified (screen) rectangle + This method returns true if any are found. + + + + + Subscribe to this event to be notified when is called. + + + + + Gets or sets the list of items for this + + A reference to a collection object + + + + Accesses the for this graph + + A reference to a object + + + + Accesses the for this graph + + A reference to a object + + + + Accesses the primary for this graph + + A reference to a object + + + + + + Accesses the primary for this graph + + A reference to a object + + + + + + Gets the collection of Y axes that belong to this . + + + + + Gets the collection of Y2 axes that belong to this . + + + + + Gets the instance for this . + + + + + Gets the instance for this , + which stores the global properties for bar type charts. + + + + + Gets or sets a boolean value that affects the data range that is considered + for the automatic scale ranging. + + If true, then initial data points where the Y value + is zero are not included when automatically determining the scale , + , and size. + All data after the first non-zero Y value are included. + + + + + Gets or sets a boolean value that determines if the auto-scaled axis ranges will + subset the data points based on any manually set scale range values. + The bounds provide a means to subset the data. For example, if all the axes are set to + autoscale, then the full range of data are used. But, if the XAxis.Min and XAxis.Max values + are manually set, then the Y data range will reflect the Y values within the bounds of + XAxis.Min and XAxis.Max. Set to true to subset the data, or false to always include + all data points when calculating scale ranges. + + + Gets or sets a value that determines whether or not initial + values will cause the line segments of + a curve to be discontinuous. + + If this field is true, then the curves + will be plotted as continuous lines as if the Missing values did not exist. + Use the public property to access + this value. + + + + Gets or sets a value that determines if ZedGraph should modify the scale ranges + for the Y and Y2 axes such that the number of major steps, and therefore the + major grid lines, line up. + + + This property affects the way that selects the scale + ranges for the Y and Y2 axes. It applies to the scale ranges of all Y and Y2 axes, + but only if the is set to true.
+
+
+ + Determines how the + graphs will be displayed. See the enum + for the individual types available. + + + + + + Gets a value that indicates whether or not the for + this is empty. Note that this value is only used for + the . + + + + + Gets a reference to the for this . + + + + + A delegate to provide notification through the + when is called. + + The for which AxisChange() has + been called. + + + + + A simple struct that defines the + default property values for the class. + + + + + The default settings for the scale ignore initial + zero values option ( property). + true to have the auto-scale-range code ignore the initial data points + until the first non-zero Y value, false otherwise. + + + + + The default settings for the scale bounded ranges option + ( property). + true to have the auto-scale-range code subset the data according to any + manually set scale values, false otherwise. + + + + The default value for the property, which + determines if the lines are drawn in normal or "stacked" mode. See the + for more information. + + + + + + The default width of a bar cluster + on a graph. This value only applies to + graphs, and only when the + is , + or . + This dimension is expressed in terms of X scale user units. + + + + + + + The tolerance that is applied to the + routine. + If a given curve point is within this many pixels of the mousePt, the curve + point is considered to be close enough for selection as a nearest point + candidate. + + + + + Simple struct that stores X and Y coordinates as doubles. + + + John Champion + $Revision: 3.1 $ $Date: 2006-06-24 20:26:44 $ + + + + The X coordinate + + + + + The Y coordinate + + + + + Construct a object from two double values. + + The X coordinate + The Y coordinate + + + + Class that handles the data associated with the major grid lines on the chart. + Inherits from . + + + John Champion + $Revision: 3.1 $ $Date: 2006-06-24 20:26:44 $ + + + + Current schema value that defines the version of the serialized file + + + + + Default constructor + + + + + Copy constructor + + The source to be copied. + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Gets or sets a boolean value that determines if a line will be drawn at the + zero value for the axis. + + + The zero line is a line that divides the negative values from the positive values. + The default is set according to + , , + , + + true to show the zero line, false otherwise + + + + A simple struct that defines the + default property values for the class. + + + + + The default "dash on" size for drawing the grid + ( property). Units are in points (1/72 inch). + + + + + The default "dash off" size for drawing the grid + ( property). Units are in points (1/72 inch). + + + + + The default pen width for drawing the grid + ( property). Units are in points (1/72 inch). + + + + + The default color for the grid lines + ( property). This color only affects the + grid lines. + + + + + The default display mode for the grid lines + ( property). true + to show the grid lines, false to hide them. + + + + + The default boolean value that determines if a line will be drawn at the + zero value for the axis. + + + The zero line is a line that divides the negative values from the positive values. + The default is set according to + , , + , + + true to show the zero line, false otherwise + + + + A class representing a needle on the GasGuage chart + s. + + Jay Mistry + $Revision: 1.2 $ $Date: 2007-08-11 14:37:47 $ + + + + Current schema value that defines the version of the serialized file + + + + + Value of this needle + + + + + Width of the line being drawn + + + + + Color of the needle line + + + + + Internally calculated angle that places this needle relative to the MinValue and + MaxValue of 180 degree GasGuage + + + + + Private field that stores the data for this + . Use the public property to + access this value. + + + + + A which will customize the label display of this + + + + + + Private field that stores the class that defines the + properties of the border around this . Use the public + property to access this value. + + + + + The bounding rectangle for this . + + + + + Private field to hold the GraphicsPath of this to be + used for 'hit testing'. + + + + + Create a new + + The value associated with this + instance. + The display color for this + instance. + The value of this . + + + + The Copy Constructor + + The object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Gets a flag indicating if the Z data range should be included in the axis scaling calculations. + + The parent of this . + + true if the Z data are included, false otherwise + + + + Gets a flag indicating if the X axis is the independent axis for this + + The parent of this . + + true if the X axis is independent, false otherwise + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Do all rendering associated with this item to the specified + device. This method is normally only + called by the Draw method of the parent + collection object. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + Not used for rendering GasGaugeNeedle + Not used for rendering GasGaugeNeedle + + + + Render the label for this . + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + Bounding rectangle for this . + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Determine the coords for the rectangle associated with a specified point for + this + + The to which this curve belongs + The index of the point of interest + A list of coordinates that represents the "rect" for + this point (used in an html AREA tag) + true if it's a valid point, false otherwise + + + + Calculate the values needed to properly display this . + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + + + Calculate the that will be used to define the bounding rectangle of + the GasGaugeNeedle. + + This rectangle always lies inside of the , and it is + normally a square so that the pie itself is not oval-shaped. + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + The (normally the ) + that bounds this pie. + + + + + Gets or Sets the NeedleWidth of this + + + + + Gets or Sets the Border of this + + + + + Gets or Sets the SlicePath of this + + + + + Gets or Sets the LableDetail of this + + + + + Gets or Sets the NeedelColor of this + + + + + Gets or Sets the Fill of this + + + + + Private property that Gets or Sets the SweepAngle of this + + + + + Gets or Sets the NeedleValue of this + + + + + Specify the default property values for the class. + + + + + The default width of the gas gauge needle. Units are points, scaled according + to + + + + + The default pen width to be used for drawing the border around the GasGaugeNeedle + ( property). Units are points. + + + + + The default border mode for GasGaugeNeedle ( + property). + true to display frame around GasGaugeNeedle, false otherwise + + + + + The default color for drawing frames around GasGaugeNeedle + ( property). + + + + + The default fill type for filling the GasGaugeNeedle. + + + + + The default color for filling in the GasGaugeNeedle + ( property). + + + + + The default custom brush for filling in the GasGaugeNeedle. + ( property). + + + + + Default value for controlling display. + + + + + The default font size for entries + ( property). Units are + in points (1/72 inch). + + + + + + + + + + John Champion + $Revision: 3.7 $ $Date: 2007-11-05 04:33:26 $ + + + + Default Constructor + + + + + Constructor to initialize the DataSourcePointList from an + existing + + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Extract a double value from the specified table row or data object with the + specified column name. + + The data object from which to extract the value + The property name or column name of the value + to be extracted + The zero-based index of the point to be extracted. + + + + + Extract an object from the specified table row or data object with the + specified column name. + + The data object from which to extract the object + The property name or column name of the object + to be extracted + + + + Indexer to access the specified object by + its ordinal position in the list. + + The ordinal position (zero-based) of the + object to be accessed. + A object reference. + + + + gets the number of points available in the list + + + + + The object from which to get the bound data + + + Typically, you set the + property to a reference to your database, table or list object. The + property would be set + to the name of the datatable within the + , + if applicable. + + + + The table or list object from which to extract the data values. + + + This property is just an alias for + . + + + + + The name of the property or column from which to obtain the + X data values for the chart. + + Set this to null leave the X data values set to + + + + + The name of the property or column from which to obtain the + Y data values for the chart. + + Set this to null leave the Y data values set to + + + + + The name of the property or column from which to obtain the + Z data values for the chart. + + Set this to null leave the Z data values set to + + + + + The name of the property or column from which to obtain the + tag values for the chart. + + Set this to null leave the tag values set to null. If this references string + data, then the tags may be used as tooltips using the + option. + + + + + The TextScale class inherits from the class, and implements + the features specific to . + + + TextScale is an ordinal axis with user-defined text labels. An ordinal axis means that + all data points are evenly spaced at integral values, and the actual coordinate values + for points corresponding to that axis are ignored. That is, if the X axis is an + ordinal type, then all X values associated with the curves are ignored. + + + John Champion + $Revision: 1.8 $ $Date: 2006-08-25 05:19:09 $ + + + + Current schema value that defines the version of the serialized file + + + + + The Copy Constructor + + The object from which to copy + The object that will own the + new instance of + + + + Create a new clone of the current item, with a new owner assignment + + The new instance that will be + the owner of the new Scale + A new clone. + + + + Internal routine to determine the ordinals of the first minor tic mark + + + The value of the first major tic for the axis. + + + The ordinal position of the first minor tic, relative to the first major tic. + This value can be negative (e.g., -3 means the first minor tic is 3 minor step + increments before the first major tic. + + + + + Determine the value for the first major tic. + + + This is done by finding the first possible value that is an integral multiple of + the step size, taking into account the date/time units if appropriate. + This method properly accounts for , , + and other axis format settings. + + + First major tic value (floating point double). + + + + + Internal routine to determine the ordinals of the first and last major axis label. + + + This is the total number of major tics for this axis. + + + + + Select a reasonable text axis scale given a range of data values. + + + This method only applies to type axes, and it + is called by the general method. This is an ordinal + type, such that the labeled values start at 1.0 and increment by 1.0 for + each successive label. The maximum number of labels on the graph is + determined by . If necessary, this method will + set the value to greater than 1.0 in order to keep the total + labels displayed below . For example, a + size of 2.0 would only display every other label on the + axis. The value calculated by this routine is always + an integral value. This + method honors the , , + and autorange settings. + In the event that any of the autorange settings are false, the + corresponding , , or + setting is explicitly honored, and the remaining autorange settings (if any) will + be calculated to accomodate the non-autoranged values. + On Exit: + is set to scale minimum (if = true) + is set to scale maximum (if = true) + is set to scale step size (if = true) + is set to scale minor step size (if = true) + is set to a magnitude multiplier according to the data + is set to the display format for the values (this controls the + number of decimal places, whether there are thousands separators, currency types, etc.) + + A reference to the object + associated with this + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + + + Make a value label for an . + + + A reference to the object that is the parent or + owner of this object. + + + The zero-based, ordinal index of the label to be generated. For example, a value of 2 would + cause the third value label on the axis to be generated. + + + The numeric value associated with the label. This value is ignored for log () + and text () type axes. + + The resulting value label as a + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + This class handles the drawing of the curve objects. + The symbols are the small shapes that appear over each defined point + along the curve. + + + John Champion + $Revision: 3.37 $ $Date: 2007-09-19 06:41:56 $ + + + + Current schema value that defines the version of the serialized file + + + + + Private field that stores the size of this + in points (1/72 inch). Use the public + property to access this value. + + + + + Private field that stores the for this + . Use the public + property to access this value. + + + + + private field that determines if the symbols are drawn using + Anti-Aliasing capabilities from the class. + Use the public property to access + this value. + + + + + Private field that stores the visibility of this + . Use the public + property to access this value. If this value is + false, the symbols will not be shown (but the may + still be shown). + + + + + Private field that stores the data for this + . Use the public property to + access this value. + + + + + Private field that stores the data for this + . Use the public property to + access this value. + + + + + Private field that stores the user defined data for this + . Use the public property to + access this value. + + + + + Default constructor that sets all properties to default + values as defined in the class. + + + + + Default constructor that sets the and + as specified, and the remaining + properties to default + values as defined in the class. + + A enum value + indicating the shape of the symbol + A value indicating + the color of the symbol + + + + + The Copy Constructor + + The Symbol object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Draw the to the specified device + at the specified location. This routine draws a single symbol. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + The x position of the center of the symbol in + pixel units + The y position of the center of the symbol in + pixel units + A previously constructed by + for this symbol + A class representing the standard pen for this symbol + A class representing a default solid brush for this symbol + If this symbol uses a , it will be created on the fly for + each point, since it has to be scaled to the individual point coordinates. + + + + Draw the to the specified device + at the specified location. This routine draws a single symbol. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + The x position of the center of the symbol in + pixel units + The y position of the center of the symbol in + pixel units + + The scaling factor for the features of the graph based on the . This + scaling factor is calculated by the method. The scale factor + represents a linear multiple to be applied to font sizes, symbol sizes, etc. + + The data value to be used for a value-based + color gradient. This is only applicable for , + or . + Indicates that the should be drawn + with attributes from the class. + + + + + Create a struct for the current symbol based on the + specified scaleFactor and assuming the symbol will be centered at position 0,0. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + The scaling factor for the features of the graph based on the . This + scaling factor is calculated by the method. The scale factor + represents a linear multiple to be applied to font sizes, symbol sizes, etc. + Returns the for the current symbol + + + + Draw this to the specified + device as a symbol at each defined point. The routine + only draws the symbols; the lines are draw by the + method. This method + is normally only called by the Draw method of the + object + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + A representing this + curve. + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + Indicates that the should be drawn + with attributes from the class. + + + + + Gets or sets the size of the + + Size in points (1/72 inch) + + + + + Gets or sets the type (shape) of the + + A enum value indicating the shape + + + + + Gets or sets a value that determines if the symbols are drawn using + Anti-Aliasing capabilities from the class. + + + If this value is set to true, then the + property will be set to only while + this is drawn. A value of false will leave the value of + unchanged. + + + + + Gets or sets a property that shows or hides the . + + true to show the symbol, false to hide it + + + + + Gets or sets the data for this + . + + + + + Gets or sets the data for this + , which controls the border outline of the symbol. + + + + + Gets or sets the data for this + , describing the user-defined symbol type. + + + This value only applies if Symbol.Type + is SymbolType.UserDefined + + + + + A simple struct that defines the + default property values for the class. + + + + + The default size for curve symbols ( property), + in units of points. + + + + + The default pen width to be used for drawing curve symbols + ( property). Units are points. + + + + + The default color for filling in this + ( property). + + + + + The default custom brush for filling in this + ( property). + + + + + The default fill mode for the curve ( property). + + + + + The default symbol type for curves ( property). + This is defined as a enumeration. + + + + + The default value for the + property. + + + + + The default display mode for symbols ( property). + true to display symbols, false to hide them. + + + + + The default for drawing frames around symbols ( property). + true to display symbol frames, false to hide them. + + + + + The default color for drawing symbols ( property). + + + + + A collection class containing a list of objects. + + + John Champion + $Revision: 3.3 $ $Date: 2006-06-24 20:26:43 $ + + + + Default constructor for the collection class. + + + + + The Copy Constructor + + The object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Indexer to access the specified object by + its ordinal position in the list. + + The ordinal position (zero-based) of the + object to be accessed. + A object instance + + + + A simple struct to store minimum and maximum type + values for the scroll range + + + + + Construct a object given the specified data values. + + The minimum axis value limit for the scroll bar + The maximum axis value limit for the scroll bar + true to make this item scrollable, false otherwise + + + + Sets the scroll range to default values of zero, and sets the + property as specified. + + true to make this item scrollable, false otherwise + + + + The Copy Constructor + + The object from which to copy + + + + Gets or sets a property that determines if the corresponding to + this object can be scrolled. + + + + + The minimum axis value limit for the scroll bar. + + + + + The maximum axis value limit for the scroll bar. + + + + + enumeration used to indicate which type of data will be plotted. + + + + + Designates the "Time" property will be used + + + + + Designates the "Position" property will be used + + + + + Designates the Instantaneous Velocity property will be used + + + + + Designates the "Time since start" property will be used + + + + + Designates the Average Velocity property will be used + + + + + A simple storage class to maintain an individual sampling of data + + + + + The time of the sample + + + + + The position at sample time + + + + + The instantaneous velocity at sample time + + + + + A collection class to maintain a set of samples + + + + + Determines what data type gets plotted for the X values + + + + + Determines what data type gets plotted for the Y values + + + + + Get the specified data type from the specified sample + + The sample instance of interest + The data type to be extracted from the sample + A double value representing the requested data + + + + Append a sample to the collection + + The sample to append + The ordinal position at which the sample was added + + + + typesafe clone method + + A new cloned SamplePointList. This returns a copy of the structure, + but it does not duplicate the data (it just keeps a reference to the original) + + + + + default constructor + + + + + copy constructor -- this returns a copy of the structure, + but it does not duplicate the data (it just keeps a reference to the original) + + The SamplePointList to be copied + + + + Indexer: get the Sample instance at the specified ordinal position in the list + + The ordinal position in the list of samples + Returns a instance containing the + data specified by and + + + + + Gets the number of samples in the collection + + + + + An enum used to specify the X or Y data type of interest -- see + and . + + + + + The time (seconds) at which these data are measured + + + + + The distance traveled, meters + + + + + The instantaneous velocity, meters per second + + + + + The instantaneous acceleration, meters per second squared + + + + + Sample data structure containing a variety of data values, in this case the values + are related in that they correspond to the same time value. + + + + + The time (seconds) at which these data are measured + + + + + The distance traveled, meters + + + + + The instantaneous velocity, meters per second + + + + + The instantaneous acceleration, meters per second squared + + + + + Constructor that specifies each data value in the PerformanceData struct + + The time (seconds) at which these data are measured + The distance traveled, meters + The instantaneous velocity, meters per second + The instantaneous acceleration, meters per second squared + + + + Gets or sets the data value as specified by the enum + + The required data value type + + + + A sample class that holds an internal collection, and implements the + interface so that it can be used by ZedGraph as curve data. + + + This particular class efficiently implements the data storage so that the class + can be cloned without duplicating the data points. For example, you can create + a , populate it with values, and set + = and + = . + You can then clone this to a new one, and set + = . + Each of these 's can then be used as an + argument, + thereby plotting a distance vs time curve and a velocity vs time curve. There + will still be only one copy of the data in memory. + + + + + This is where the data are stored. Duplicating the + copies the reference to this , but does not actually duplicate + the data. + + + + + Determines what X data will be returned by the indexer of this list. + + + + + Determines what Y data will be returned by the indexer of this list. + + + + + Default constructor + + + + + The Copy Constructor. This method does NOT duplicate the data, it merely makes + another "Window" into the same collection. You can make multiple copies and + set the and/or properties to different + values to plot different data, while maintaining only one copy of the original values. + + The from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Adds the specified struct to the end of the collection. + + A struct to be added + The ordinal position in the collection where the values were added + + + + Remove the struct from the list at the specified + ordinal location. + + The ordinal location of the + struct to be removed + + + + Insert the specified struct into the list at + the specified ordinal location. + + The ordinal location at which to insert + The struct to be inserted + + + + Indexer to access the data. This gets the appropriate data and converts to + the struct that is compatible with ZedGraph. The + actual data returned depends on the values of and + . + + The ordinal position of the desired point in the list + A corresponding to the specified ordinal data position + + + + Gets the number of data points in the collection + + + + + A simple instance that stores a data point (X, Y, Z). This differs from a regular + in that it maps the property + to an independent value. That is, and + are not related (as they are in the + ). + + + + + Current schema value that defines the version of the serialized file + + + + + This is a user value that can be anything. It is used to provide special + property-based coloration to the graph elements. + + + + + Creates a point pair with the specified X, Y, and base value. + + This pair's x coordinate. + This pair's y coordinate. + This pair's z or lower dependent coordinate. + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + The ColorValue property. This is used with the + option. + + + + + A class that encapsulates Border (frame) properties for an object. The class + is used in a variety of ZedGraph objects to handle the drawing of the Border around the object. + + + John Champion + $Revision: 3.18 $ $Date: 2007-03-17 18:43:44 $ + + + + Current schema value that defines the version of the serialized file + + + + + Private field that stores the amount of inflation to be done on the rectangle + before rendering. This allows the border to be inset or outset relative to + the actual rectangle area. Use the public property + to access this value. + + + + + The default constructor. Initialized to default values. + + + + + Constructor that specifies the visibility, color and penWidth of the Border. + + Determines whether or not the Border will be drawn. + The color of the Border + The width, in points (1/72 inch), for the Border. + + + + Constructor that specifies the color and penWidth of the Border. + + The color of the Border + The width, in points (1/72 inch), for the Border. + + + + The Copy Constructor + + The Border object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Draw the specified Border () using the properties of + this object. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + + The scaling factor for the features of the graph based on the . This + scaling factor is calculated by the method. The scale factor + represents a linear multiple to be applied to font sizes, symbol sizes, etc. + + A struct to be drawn. + + + + Gets or sets the amount of inflation to be done on the rectangle + before rendering. + + This allows the border to be inset or outset relative to + the actual rectangle area. + + + + + A simple struct that defines the + default property values for the class. + + + + + The default value for , in units of points (1/72 inch). + + + + + + inherits from , and defines the + special characteristics of a horizontal axis, specifically located at + the top of the of the + object + + + John Champion + $Revision: 3.1 $ $Date: 2007-04-16 00:03:07 $ + + + + Current schema value that defines the version of the serialized file + + + + + Default constructor that sets all properties to + default values as defined in the class + + + + + Default constructor that sets all properties to + default values as defined in the class, except + for the axis title + + The for this axis + + + + The Copy Constructor + + The X2Axis object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Setup the Transform Matrix to handle drawing of this + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Determines if this object is a "primary" one. + + + The primary axes are the (always), + the (always), the first + in the + ( = 0), and the first + in the + ( = 0). Note that + and + always reference the primary axes. + + + A reference to the object that is the parent or + owner of this object. + + true for a primary (for the , + this is always true), false otherwise + + + + Calculate the "shift" size, in pixels, in order to shift the axis from its default + location to the value specified by . + + + A reference to the object that is the parent or + owner of this object. + + The shift amount measured in pixels + + + + Gets the "Cross" axis that corresponds to this axis. + + + The cross axis is the axis which determines the of this Axis when the + Axis.Cross property is used. The + cross axis for any or + is always the primary , and + the cross axis for any or is + always the primary . + + + A reference to the object that is the parent or + owner of this object. + + + + + A simple struct that defines the + default property values for the class. + + + + + The default display mode for the + ( property). true to display the scale + values, title, tic marks, false to hide the axis entirely. + + + + + Determines if a line will be drawn at the zero value for the + , that is, a line that + divides the negative values from positive values. + . + + + + + The OrdinalScale class inherits from the class, and implements + the features specific to . + + + OrdinalScale is an ordinal axis with tic labels generated at integral values. An ordinal axis means that + all data points are evenly spaced at integral values, and the actual coordinate values + for points corresponding to that axis are ignored. That is, if the X axis is an + ordinal type, then all X values associated with the curves are ignored. + + + John Champion + $Revision: 1.8 $ $Date: 2007-04-16 00:03:02 $ + + + + Current schema value that defines the version of the serialized file + + + + + Default constructor that defines the owner + (containing object) for this new object. + + The owner, or containing object, of this instance + + + + The Copy Constructor + + The object from which to copy + The object that will own the + new instance of + + + + Create a new clone of the current item, with a new owner assignment + + The new instance that will be + the owner of the new Scale + A new clone. + + + + Select a reasonable ordinal axis scale given a range of data values. + + + This method only applies to type axes, and it + is called by the general method. The scale range is chosen + based on increments of 1, 2, or 5 (because they are even divisors of 10). + Being an ordinal axis type, the value will always be integral. This + method honors the , , + and autorange settings. + In the event that any of the autorange settings are false, the + corresponding , , or + setting is explicitly honored, and the remaining autorange settings (if any) will + be calculated to accomodate the non-autoranged values. The basic defaults for + scale selection are defined using , + , and + from the default class. + On Exit: + is set to scale minimum (if = true) + is set to scale maximum (if = true) + is set to scale step size (if = true) + is set to scale minor step size (if = true) + is set to a magnitude multiplier according to the data + is set to the display format for the values (this controls the + number of decimal places, whether there are thousands separators, currency types, etc.) + + A reference to the object + associated with this + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Return the for this , which is + . + + + + + A simple storage struct to maintain an individual sampling of data. This only + contains two data values in order to reduce to memory load for large datasets. + (e.g., no Tag or Z property) + + + + + The X value for the point, stored as a double type. + + + + + The Y value for the point, stored as a double type. + + + + + A collection class to maintain a set of samples. + + This type, intended for very + large datasets, will reduce the number of points displayed by eliminating + individual points that overlay (at the same pixel location) on the graph. + Note that this type probably does not make sense for line plots, but is intended + primarily for scatter plots. + + + John Champion + $Revision: 3.5 $ $Date: 2007-06-02 06:56:03 $ + + + + Protected field that stores a value indicating whether or not the data have been filtered. + If the data have not been filtered, then will be equal to + . Use the public property to + access this value. + + + + + Protected field that stores the number of data points after filtering (e.g., + has been called). The property + returns the total count for an unfiltered dataset, or + for a dataset that has been filtered. + + + + + Protected array of indices for all the points that are currently visible. This only + applies if is true. + + + + + Protected field that stores a value that determines how close a point must be to a prior + neighbor in order to be filtered out. Use the public property + to access this value. + + + + + Append a data point to the collection + + The value to append + + + + Append a point to the collection + + The x value of the point to append + The y value of the point to append + + + + typesafe clone method + + A new cloned NoDupePointList. This returns a copy of the structure, + but it does not duplicate the data (it just keeps a reference to the original) + + + + + default constructor + + + + + copy constructor -- this returns a copy of the structure, + but it does not duplicate the data (it just keeps a reference to the original) + + The NoDupePointList to be copied + + + + Protected method to access the internal DataPoint collection, without any + translation to a PointPair. + + The ordinal position of the DataPoint of interest + + + + Clears any filtering previously done by a call to . + After calling this method, all data points will be visible, and + will be equal to . + + + + + Go through the collection, and hide (filter out) any points that fall on the + same pixel location as a previously included point. + + + This method does not delete any points, it just temporarily hides them until + the next call to or . + You should call once your collection of points has + been constructed. You may need to call again if + you add points, or if the chart rect changes size (by resizing, printing, + image save, etc.), or if the scale range changes. + You must call before calling + this method so that the GraphPane.Chart.Rect + and the scale ranges are valid. This method is not valid for + ordinal axes (but ordinal axes don't make sense for very large datasets + anyway). + + The into which the data + will be plotted. + The class to be used in the Y direction + for plotting these data. This can be a or a + , and can be a primary or secondary axis (if multiple Y or Y2 + axes are being used). + + The class to be used in the X direction + for plotting these data. This can be an or a + . + + + + + Gets or sets a value that determines how close a point must be to a prior + neighbor in order to be filtered out. + + + A value of 0 indicates that subsequent + points must coincide exactly at the same pixel location. A value of 1 or more + indicates that number of pixels distance from a prior point that will cause + a new point to be filtered out. For example, a value of 2 means that, once + a particular pixel location is taken, any subsequent point that lies within 2 + pixels of that location will be filtered out. + + + + + Gets a value indicating whether or not the data have been filtered. If the data + have not been filtered, then will be equal to + . + + + + + Indexer: get the DataPoint instance at the specified ordinal position in the list + + + This method will throw an exception if the index is out of range. This can happen + if the index is less than the number of filtered values, or if data points are + removed from a filtered dataset with updating the filter (by calling + ). + + The ordinal position in the list of points + Returns a instance. The + and properties will be defaulted to + and null, respectively. + + + + + Gets the number of active samples in the collection. This is the number of + samples that are non-duplicates. See the property + to get the total number of samples in the list. + + + + + Gets the total number of samples in the collection. See the + property to get the number of active (non-duplicate) samples in the list. + + + + + Class that handles that stores the margin properties for the GraphPane + + + John Champion + $Revision: 3.1 $ $Date: 2006-06-24 20:26:44 $ + + + + Current schema value that defines the version of the serialized file + + + + + Private fields that store the size of the margin around the edge of the pane which will be + kept blank. Use the public properties , , + , to access these values. + + Units are points (1/72 inch) + + + + Private fields that store the size of the margin around the edge of the pane which will be + kept blank. Use the public properties , , + , to access these values. + + Units are points (1/72 inch) + + + + Private fields that store the size of the margin around the edge of the pane which will be + kept blank. Use the public properties , , + , to access these values. + + Units are points (1/72 inch) + + + + Private fields that store the size of the margin around the edge of the pane which will be + kept blank. Use the public properties , , + , to access these values. + + Units are points (1/72 inch) + + + + Constructor to build a from the default values. + + + + + Copy constructor + + the instance to be copied. + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Gets or sets a float value that determines the margin area between the left edge of the + rectangle and the features of the graph. + + This value is in units of points (1/72 inch), and is scaled + linearly with the graph size. + + + + + + + + + Gets or sets a float value that determines the margin area between the right edge of the + rectangle and the features of the graph. + + This value is in units of points (1/72 inch), and is scaled + linearly with the graph size. + + + + + + + + + Gets or sets a float value that determines the margin area between the top edge of the + rectangle and the features of the graph. + + This value is in units of points (1/72 inch), and is scaled + linearly with the graph size. + + + + + + + + + Gets or sets a float value that determines the margin area between the bottom edge of the + rectangle and the features of the graph. + + This value is in units of points (1/72 inch), and is scaled + linearly with the graph size. + + + + + + + + + Concurrently sets all outer margin values to a single value. + + This value is in units of points (1/72 inch), and is scaled + linearly with the graph size. + + + + + + + + + A simple struct that defines the default property values for the class. + + + + + The default value for the property, which is + the size of the space on the left side of the . + + Units are points (1/72 inch) + + + + The default value for the property, which is + the size of the space on the right side of the . + + Units are points (1/72 inch) + + + + The default value for the property, which is + the size of the space on the top side of the . + + Units are points (1/72 inch) + + + + The default value for the property, which is + the size of the space on the bottom side of the . + + Units are points (1/72 inch) + + + + An example of an implementation that stores large datasets, and + selectively filters the output data depending on the displayed range. + + + This class will refilter the data points each time is called. The + data are filtered down to points, within the data bounds of + a minimum and maximum data range. The data are filtered by simply skipping + points to achieve the desired total number of points. Input arrays are assumed to be + monotonically increasing in X, and evenly spaced in X. + + + + + + + John Champion with mods by Christophe Holmes + $Revision: 1.11 $ $Date: 2007-11-29 02:15:39 $ + + + + Instance of an array of x values + + + + + Instance of an array of x values + + + + + This is the maximum number of points that you want to see in the filtered dataset + + + + + The index of the xMinBound above + + + + + The index of the xMaxBound above + + + + + Constructor to initialize the PointPairList from two arrays of + type double. + + + + + The Copy Constructor + + The FilteredPointList from which to copy + + + + Deep-copy clone routine + + A new, independent copy of the FilteredPointList + + + + Set the data bounds to the specified minimum, maximum, and point count. Use values of + min=double.MinValue and max=double.MaxValue to get the full range of data. Use maxPts=-1 + to not limit the number of points. Call this method anytime the zoom range is changed. + + The lower bound for the X data of interest + The upper bound for the X data of interest + The maximum number of points allowed to be + output by the filter + + + + Indexer to access the specified object by + its ordinal position in the list. + + + Returns for any value of + that is outside of its corresponding array bounds. + + The ordinal position (zero-based) of the + object to be accessed. + A object reference. + + + + Returns the number of points according to the current state of the filter. + + + + + Gets the desired number of filtered points to output. You can set this value by + calling . + + + + + The ExponentScale class inherits from the class, and implements + the features specific to . + + + ExponentScale is a non-linear axis in which the values are scaled using an exponential function + with the property. + + + John Champion with contributions by jackply + $Revision: 1.8 $ $Date: 2007-04-16 00:03:01 $ + + + + Current schema value that defines the version of the serialized file + + + + + Default constructor that defines the owner + (containing object) for this new object. + + The owner, or containing object, of this instance + + + + The Copy Constructor + + The object from which to copy + The object that will own the + new instance of + + + + Create a new clone of the current item, with a new owner assignment + + The new instance that will be + the owner of the new Scale + A new clone. + + + + Setup some temporary transform values in preparation for rendering the . + + + This method is typically called by the parent + object as part of the method. It is also + called by and + + methods to setup for coordinate transformations. + + + A reference to the object that is the parent or + owner of this object. + + + The parent for this + + + + + Convert a value to its linear equivalent for this type of scale. + + + The default behavior is to just return the value unchanged. However, + for and , + it returns the log or power equivalent. + + The value to be converted + + + + Convert a value from its linear equivalent to its actual scale value + for this type of scale. + + + The default behavior is to just return the value unchanged. However, + for and , + it returns the anti-log or inverse-power equivalent. + + The value to be converted + + + + Determine the value for any major tic. + + + This method properly accounts for , , + and other axis format settings. + + + The value of the first major tic (floating point double) + + + The major tic number (0 = first major tic). For log scales, this is the actual power of 10. + + + The specified major tic value (floating point double). + + + + + Determine the value for any minor tic. + + + This method properly accounts for , , + and other axis format settings. + + + The value of the first major tic (floating point double). This tic value is the base + reference for all tics (including minor ones). + + + The major tic number (0 = first major tic). For log scales, this is the actual power of 10. + + + The specified minor tic value (floating point double). + + + + + Internal routine to determine the ordinals of the first minor tic mark + + + The value of the first major tic for the axis. + + + The ordinal position of the first minor tic, relative to the first major tic. + This value can be negative (e.g., -3 means the first minor tic is 3 minor step + increments before the first major tic. + + + + + Select a reasonable exponential axis scale given a range of data values. + + + This method only applies to type axes, and it + is called by the general method. The exponential scale + relies on the property to set the scaling exponent. This + method honors the , , + and autorange settings. + In the event that any of the autorange settings are false, the + corresponding , , or + setting is explicitly honored, and the remaining autorange settings (if any) will + be calculated to accomodate the non-autoranged values. For log axes, the MinorStep + value is not used. + On Exit: + is set to scale minimum (if = true) + is set to scale maximum (if = true) + is set to scale step size (if = true) + is set to a magnitude multiplier according to the data + is set to the display format for the values (this controls the + number of decimal places, whether there are thousands separators, currency types, etc.) + + + + + + + Make a value label for an . + + + A reference to the object that is the parent or + owner of this object. + + + The zero-based, ordinal index of the label to be generated. For example, a value of 2 would + cause the third value label on the axis to be generated. + + + The numeric value associated with the label. This value is ignored for log () + and text () type axes. + + The resulting value label as a + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Encapsulates an "High-Low" Bar curve type that displays a bar in which both + the bottom and the top of the bar are set by data valuesfrom the + struct. + + The type is intended for displaying + bars that cover a band of data, such as a confidence interval, "waterfall" + chart, etc. The position of each bar is set + according to the values. The independent axis + is assigned with , and is a + enum type. If + is set to or , then + the bars will actually be horizontal, since the X axis becomes the + value axis and the Y or Y2 axis becomes the independent axis. + John Champion + $Revision: 3.18 $ $Date: 2007-11-03 04:41:28 $ + + + + Current schema value that defines the version of the serialized file + + + + + Create a new using the specified properties. + + The label that will appear in the legend. + An array of double precision values that define + the independent (X axis) values for this curve + An array of double precision values that define + the dependent (Y axis) values for this curve + An array of double precision values that define the + base value (the bottom) of the bars for this curve. + + A value that will be applied to + the and properties. + + + + + Create a new using the specified properties. + + The label that will appear in the legend. + A of double precision value trio's that define + the X, Y, and lower dependent values for this curve + A value that will be applied to + the and properties. + + + + + The Copy Constructor + + The object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + A LIFO stack of prior objects, used to allow zooming out to prior + states (of scale range settings). + + John Champion + $Revision: 3.1 $ $Date: 2006-06-24 20:26:44 $ + + + + Default Constructor + + + + + The Copy Constructor + + The object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Add the scale range information from the specified object as a + new entry on the stack. + + The object from which the scale range + information should be copied. + A enumeration that indicates whether this + state is the result of a zoom or pan operation. + The resultant object that was pushed on the stack. + + + + Add the scale range information from the specified object as a + new entry on the stack. + + The object to be placed on the stack. + The object (same as the + parameter). + + + + Pop a entry from the top of the stack, and apply the properties + to the specified object. + + The object to which the scale range + information should be copied. + The object that was "popped" from the stack and applied + to the specified . null if no was + available (the stack was empty). + + + + Pop the entry from the bottom of the stack, and apply the properties + to the specified object. Clear the stack completely. + + The object to which the scale range + information should be copied. + The object at the bottom of the stack that was applied + to the specified . null if no was + available (the stack was empty). + + + + Public readonly property that indicates if the stack is empty + + true for an empty stack, false otherwise + + + + Gets a reference to the object at the top of the stack, + without actually removing it from the stack. + + A object reference, or null if the stack is empty. + + + + A class that represents a text object on the graph. A list of + objects is maintained by the + collection class. + + + John Champion + $Revision: 3.4 $ $Date: 2007-01-25 07:56:09 $ + + + + Current schema value that defines the version of the serialized file + + + + Private field to store the actual text string for this + . Use the public property + to access this value. + + + + + Private field to store the class used to render + this . Use the public property + to access this class. + + + + + Private field holding the SizeF into which this + should be rendered. Use the public property + to access this value. + + + + + Constructor that sets all properties to default + values as defined in the class. + + The text to be displayed. + The x position of the text. The units + of this position are specified by the + property. The text will be + aligned to this position based on the + property. + The y position of the text. The units + of this position are specified by the + property. The text will be + aligned to this position based on the + property. + + + + Constructor that sets all properties to default + values as defined in the class. + + The text to be displayed. + The x position of the text. The units + of this position are specified by the + property. The text will be + aligned to this position based on the + property. + The y position of the text. The units + of this position are specified by the + property. The text will be + aligned to this position based on the + property. + The enum value that + indicates what type of coordinate system the x and y parameters are + referenced to. + + + + Constructor that sets all properties to default + values as defined in the class. + + The text to be displayed. + The x position of the text. The units + of this position are specified by the + property. The text will be + aligned to this position based on the + property. + The y position of the text. The units + of this position are specified by the + property. The text will be + aligned to this position based on the + property. + The enum value that + indicates what type of coordinate system the x and y parameters are + referenced to. + The enum that specifies + the horizontal alignment of the object with respect to the (x,y) location + The enum that specifies + the vertical alignment of the object with respect to the (x,y) location + + + + Parameterless constructor that initializes a new . + + + + + The Copy Constructor + + The object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Render this object to the specified device + This method is normally only called by the Draw method + of the parent collection object. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Determine if the specified screen point lies inside the bounding box of this + . This method takes into account rotation and alignment + parameters of the text, as specified in the . + + The screen point, in pixels + + A reference to the object that is the parent or + owner of this object. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + true if the point lies in the bounding box, false otherwise + + + + Determines the shape type and Coords values for this GraphObj + + + + + + + + + + The to be displayed. This text can be multi-line by + including newline ('\n') characters between the lines. + + + + + Gets a reference to the class used to render + this + + + + + + + + + + + A simple struct that defines the + default property values for the class. + + + + + The default font family for the text + ( property). + + + + + The default font size for the text + ( property). Units are + in points (1/72 inch). + + + + + The default font color for the text + ( property). + + + + + The default font bold mode for the text + ( property). true + for a bold typeface, false otherwise. + + + + + The default font underline mode for the text + ( property). true + for an underlined typeface, false otherwise. + + + + + The default font italic mode for the text + ( property). true + for an italic typeface, false otherwise. + + + + + A class representing all the characteristics of the Line + segments that make up a curve on the graph. + + + John Champion + $Revision: 3.50 $ $Date: 2007-12-30 23:27:39 $ + + + + Current schema value that defines the version of the serialized file + + + + + Private field that stores the smoothing flag for this + . Use the public + property to access this value. + + + + + Private field that stores the smoothing tension + for this . Use the public property + to access this value. + + A floating point value indicating the level of smoothing. + 0.0F for no smoothing, 1.0F for lots of smoothing, >1.0 for odd + smoothing. + + + + + + + Private field that stores the for this + . Use the public + property to access this value. + + + + + Private field that stores the data for this + . Use the public property to + access this value. + + + + + Private field that determines if this will be drawn with + optimizations enabled. Use the public + property to access this value. + + + + + Default constructor that sets all properties to default + values as defined in the class. + + + + + Constructor that sets the color property to the specified value, and sets + the remaining properties to default + values as defined in the class. + + The color to assign to this new Line object + + + + The Copy Constructor + + The Line object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Do all rendering associated with this to the specified + device. This method is normally only + called by the Draw method of the parent object. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + A reference to the object that is the parent or + owner of this object. + + A representing this + curve. + + + + Render a single segment to the specified + device. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + The x position of the starting point that defines the + line segment in screen pixel units + The y position of the starting point that defines the + line segment in screen pixel units + The x position of the ending point that defines the + line segment in screen pixel units + The y position of the ending point that defines the + line segment in screen pixel units + + + + Render the 's as vertical sticks (from a ) to + the specified device. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + A representing this + curve. + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Draw the this to the specified + device using the specified smoothing property (). + The routine draws the line segments and the area fill (if any, see ; + the symbols are drawn by the method. This method + is normally only called by the Draw method of the + object. Note that the property + is ignored for smooth lines (e.g., when is true). + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + A reference to the object that is the parent or + owner of this object. + + A representing this + curve. + + + + Draw the this to the specified + device. The format (stair-step or line) of the curve is + defined by the property. The routine + only draws the line segments; the symbols are drawn by the + method. This method + is normally only called by the Draw method of the + object + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + A reference to the object that is the parent or + owner of this object. + + A representing this + curve. + + + + Draw the this to the specified + device. The format (stair-step or line) of the curve is + defined by the property. The routine + only draws the line segments; the symbols are drawn by the + method. This method + is normally only called by the Draw method of the + object + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + A reference to the object that is the parent or + owner of this object. + + A representing this + curve. + + + + This method just handles the case where one or more of the coordinates are outrageous, + or GDI+ threw an exception. This method attempts to correct the outrageous coordinates by + interpolating them to a point (along the original line) that lies at the edge of the ChartRect + so that GDI+ will handle it properly. GDI+ will throw an exception, or just plot the data + incorrectly if the coordinates are too large (empirically, this appears to be when the + coordinate value is greater than 5,000,000 or less than -5,000,000). Although you typically + would not see coordinates like this, if you repeatedly zoom in on a ZedGraphControl, eventually + all your points will be way outside the bounds of the plot. + + + + + Build an array of values (pixel coordinates) that represents + the current curve. Note that this drawing routine ignores + values, but it does not "break" the line to indicate values are missing. + + A reference to the object that is the parent or + owner of this object. + A representing this + curve. + An array of values in pixel + coordinates representing the current curve. + The number of points contained in the "arrPoints" + parameter. + true for a successful points array build, false for data problems + + + + Build an array of values (pixel coordinates) that represents + the low values for the current curve. + + Note that this drawing routine ignores + values, but it does not "break" the line to indicate values are missing. + + A reference to the object that is the parent or + owner of this object. + A representing this + curve. + An array of values in pixel + coordinates representing the current curve. + The number of points contained in the "arrPoints" + parameter. + true for a successful points array build, false for data problems + + + + Close off a that defines a curve + + A reference to the object that is the parent or + owner of this object. + A representing this + curve. + An array of values in screen pixel + coordinates representing the current curve. + The number of points contained in the "arrPoints" + parameter. + The Y axis value location where the X axis crosses. + The class that represents the curve. + + + + Gets or sets a property that determines if this + will be drawn smooth. The "smoothness" is controlled by + the property. + + true to smooth the line, false to just connect the dots + with linear segments + + + + + + + Gets or sets a property that determines the smoothing tension + for this . This property is only used if + is true. A tension value 0.0 will just + draw ordinary line segments like an unsmoothed line. A tension + value of 1.0 will be smooth. Values greater than 1.0 will generally + give odd results. + + A floating point value indicating the level of smoothing. + 0.0F for no smoothing, 1.0F for lots of smoothing, >1.0 for odd + smoothing. + + + + + + + Determines if the will be drawn by directly connecting the + points from the data collection, + or if the curve will be a "stair-step" in which the points are + connected by a series of horizontal and vertical lines that + represent discrete, constant values. Note that the values can + be forward oriented ForwardStep () or + rearward oriented RearwardStep. + That is, the points are defined at the beginning or end + of the constant value for which they apply, respectively. + The property is ignored for lines + that have set to true. + + enum value + + + + + Gets or sets the data for this + . + + + + + Gets or sets a boolean value that determines if this will be drawn with + optimizations enabled. + + + Normally, the optimizations can be used without a problem, especially if the data + are sorted. The optimizations are particularly helpful with very large datasets. + However, if the data are very discontinuous (for example, a curve that doubles back + on itself), then the optimizations can cause drawing artifacts in the form of + missing line segments. The default option for this mode is false, so you must + explicitly enable it for each LineItem.Line. + Also note that, even if the optimizations are enabled explicitly, no actual + optimization will be done for datasets of less than 1000 points. + + + + + A simple struct that defines the + default property values for the class. + + + + + The default color for curves (line segments connecting the points). + This is the default value for the property. + + + + + The default color for filling in the area under the curve + ( property). + + + + + The default custom brush for filling in the area under the curve + ( property). + + + + + The default fill mode for the curve ( property). + + + + + The default value for the + property. + + + + + The default value for the property. + + + + + The default value for the property. + + + + + Default value for the curve type property + (). This determines if the curve + will be drawn by directly connecting the points from the + data collection, + or if the curve will be a "stair-step" in which the points are + connected by a series of horizontal and vertical lines that + represent discrete, staticant values. Note that the values can + be forward oriented ForwardStep () or + rearward oriented RearwardStep. + That is, the points are defined at the beginning or end + of the staticant value for which they apply, respectively. + + enum value + + + + A class that represents a graphic arrow or line object on the graph. A list of + ArrowObj objects is maintained by the collection class. + + + John Champion + $Revision: 3.4 $ $Date: 2007-01-25 07:56:08 $ + + + + Current schema value that defines the version of the serialized file + + + + + Private field that stores the arrowhead size, measured in points. + Use the public property to access this value. + + + + + Private boolean field that stores the arrowhead state. + Use the public property to access this value. + + true if an arrowhead is to be drawn, false otherwise + + + Constructors for the object + + A constructor that allows the position, color, and size of the + to be pre-specified. + + An arbitrary specification + for the arrow + The size of the arrowhead, measured in points. + The x position of the starting point that defines the + arrow. The units of this position are specified by the + property. + The y position of the starting point that defines the + arrow. The units of this position are specified by the + property. + The x position of the ending point that defines the + arrow. The units of this position are specified by the + property. + The y position of the ending point that defines the + arrow. The units of this position are specified by the + property. + + + + A constructor that allows only the position of the + arrow to be pre-specified. All other properties are set to + default values + + The x position of the starting point that defines the + . The units of this position are specified by the + property. + The y position of the starting point that defines the + . The units of this position are specified by the + property. + The x position of the ending point that defines the + . The units of this position are specified by the + property. + The y position of the ending point that defines the + . The units of this position are specified by the + property. + + + + Default constructor -- places the at location + (0,0) to (1,1). All other values are defaulted. + + + + + The Copy Constructor + + The object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Render this object to the specified device. + + + This method is normally only called by the Draw method + of the parent collection object. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + The size of the arrowhead. + + The display of the arrowhead can be + enabled or disabled with the property. + + The size is defined in points (1/72 inch) + + + + + Determines whether or not to draw an arrowhead + + true to show the arrowhead, false to show the line segment + only + + + + + A simple struct that defines the + default property values for the class. + + + + + The default size for the item arrowhead + ( property). Units are in points (1/72 inch). + + + + + The default display mode for the item arrowhead + ( property). true to show the + arrowhead, false to hide it. + + + + + inherits from , and defines the + special characteristics of a vertical axis, specifically located on + the right side of the of the + object + + + John Champion + $Revision: 3.16 $ $Date: 2007-04-16 00:03:06 $ + + + + Current schema value that defines the version of the serialized file + + + + + Default constructor that sets all properties to + default values as defined in the class + + + + + Default constructor that sets all properties to + default values as defined in the class, except + for the axis title + + The for this axis + + + + The Copy Constructor + + The YAxis object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Setup the Transform Matrix to handle drawing of this + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Determines if this object is a "primary" one. + + + The primary axes are the (always), the first + in the + ( = 0), and the first + in the + ( = 0). Note that + and + always reference the primary axes. + + + A reference to the object that is the parent or + owner of this object. + + true for a primary , false otherwise + + + + Calculate the "shift" size, in pixels, in order to shift the axis from its default + location to the value specified by . + + + A reference to the object that is the parent or + owner of this object. + + The shift amount measured in pixels + + + + Gets the "Cross" axis that corresponds to this axis. + + + The cross axis is the axis which determines the of this Axis when the + Axis.Cross property is used. The + cross axis for any or + is always the primary , and + the cross axis for any or is + always the primary . + + + A reference to the object that is the parent or + owner of this object. + + + + + A simple struct that defines the + default property values for the class. + + + + + The default display mode for the + ( property). true to display the scale + values, title, tic marks, false to hide the axis entirely. + + + + + Determines if a line will be drawn at the zero value for the + , that is, a line that + divides the negative values from positive values. + . + + + + + A collection class containing a list of objects + that define the set of points to be displayed on the curve. + + + + + Jerry Vos based on code by John Champion + modified by John Champion + $Revision: 3.37 $ $Date: 2007-06-29 15:39:07 $ + + + Private field to maintain the sort status of this + . Use the public property + to access this value. + + + + + Default constructor for the collection class + + + + + Constructor to initialize the PointPairList from two arrays of + type double. + + + + + Constructor to initialize the PointPairList from an IPointList + + + + + Constructor to initialize the PointPairList from three arrays of + type double. + + + + + The Copy Constructor + + The PointPairList from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Add a object to the collection at the end of the list. + + The object to + be added + The zero-based ordinal index where the point was added in the list. + + + + Add a object to the collection at the end of the list. + + A reference to the object to + be added + The zero-based ordinal index where the last point was added in the list, + or -1 if no points were added. + + + + Add a set of points to the PointPairList from two arrays of type double. + If either array is null, then a set of ordinal values is automatically + generated in its place (see . + If the arrays are of different size, then the larger array prevails and the + smaller array is padded with values. + + A double[] array of X values + A double[] array of Y values + The zero-based ordinal index where the last point was added in the list, + or -1 if no points were added. + + + + Add a set of points to the from three arrays of type double. + If the X or Y array is null, then a set of ordinal values is automatically + generated in its place (see . If the + is null, then it is set to zero. + If the arrays are of different size, then the larger array prevails and the + smaller array is padded with values. + + A double[] array of X values + A double[] array of Y values + A double[] array of Z or lower-dependent axis values + The zero-based ordinal index where the last point was added in the list, + or -1 if no points were added. + + + + Add a single point to the from values of type double. + + The X value + The Y value + The zero-based ordinal index where the point was added in the list. + + + + Add a single point to the from values of type double. + + The X value + The Y value + The Tag value for the PointPair + The zero-based ordinal index where the point was added in the list. + + + + Add a single point to the from values of type double. + + The X value + The Y value + The Z or lower dependent axis value + The zero-based ordinal index where the point was added + in the list. + + + + Add a single point to the from values of type double. + + The X value + The Y value + The Z or lower dependent axis value + The Tag value for the PointPair + The zero-based ordinal index where the point was added + in the list. + + + + Add a object to the collection at the specified, + zero-based, index location. + + + The zero-based ordinal index where the point is to be added in the list. + + + The object to be added. + + + + + Add a single point (from values of type double ) to the at the specified, + zero-based, index location. + + + The zero-based ordinal index where the point is to be added in the list. + + The X value + The Y value + + + + Add a single point (from values of type double ) to the at the specified, + zero-based, index location. + + + The zero-based ordinal index where the point is to be added in the list. + + The X value + The Y value + The Z or lower dependent axis value + + + + Return the zero-based position index of the + with the specified label . + + The object must be of type + for this method to find it. + The label that is in the + attribute of the item to be found. + + The zero-based index of the specified , + or -1 if the is not in the list + + + + Compare two objects to see if they are equal. + + Equality is based on equal count of items, and + each individual must be equal (as per the + method. + The to be compared with for equality. + true if the objects are equal, false otherwise. + + + + Return the HashCode from the base class. + + + + + + Sorts the list according to the point x values. Will not sort the + list if the list is already sorted. + + If the list was sorted before sort was called + + + + Sorts the list according to the point values . Will not sort the + list if the list is already sorted. + + The + used to determine whether the X or Y values will be used to sort + the list + If the list was sorted before sort was called + + + + Set the X values for this from the specified + array of double values. + + + If has more values than + this list, then the extra values will be ignored. If + has less values, then the corresponding values + will not be changed. That is, if the has 20 values + and has 15 values, then the first 15 values of the + will be changed, and the last 5 values will not be + changed. + + An array of double values that will replace the existing X + values in the . + + + + Set the Y values for this from the specified + array of double values. + + + If has more values than + this list, then the extra values will be ignored. If + has less values, then the corresponding values + will not be changed. That is, if the has 20 values + and has 15 values, then the first 15 values of the + will be changed, and the last 5 values will not be + changed. + + An array of double values that will replace the existing Y + values in the . + + + + Set the Z values for this from the specified + array of double values. + + + If has more values than + this list, then the extra values will be ignored. If + has less values, then the corresponding values + will not be changed. That is, if the has 20 values + and has 15 values, then the first 15 values of the + will be changed, and the last 5 values will not be + changed. + + An array of double values that will replace the existing Z + values in the . + + + + Add the Y values from the specified object to this + . If has more values than + this list, then the extra values will be ignored. If + has less values, the missing values are assumed to be zero. + + A reference to the object to + be summed into the this . + + + + Add the X values from the specified object to this + . If has more values than + this list, then the extra values will be ignored. If + has less values, the missing values are assumed to be zero. + + A reference to the object to + be summed into the this . + + + + Linearly interpolate the data to find an arbitraty Y value that corresponds to the specified X value. + + + This method uses linear interpolation with a binary search algorithm. It therefore + requires that the x data be monotonically increasing. Missing values are not allowed. This + method will extrapolate outside the range of the PointPairList if necessary. + + The target X value on which to interpolate + The Y value that corresponds to the value. + + + + Use Cardinal Splines to Interpolate the data to find an arbitraty Y value that corresponds to + the specified X value. + + + This method uses cardinal spline interpolation with a binary search algorithm. It therefore + requires that the x data be monotonically increasing. Missing values are not allowed. This + method will not extrapolate outside the range of the PointPairList (it returns + if extrapolation would be required). WARNING: Cardinal + spline interpolation can generate curves with non-unique X values for higher tension + settings. That is, there may be multiple X values for the same Y value. This routine + follows the path of the spline curve until it reaches the FIRST OCCURRENCE of the + target X value. It does not check to see if other solutions are possible. + + The target X value on which to interpolate + The tension setting that controls the curvature of the spline fit. + Typical values are between 0 and 1, where 0 is a linear fit, and 1 is lots of "roundness". + Values greater than 1 may give odd results. + + The Y value that corresponds to the value. + + + + Linearly interpolate the data to find an arbitraty X value that corresponds to the specified Y value. + + + This method uses linear interpolation with a binary search algorithm. It therefore + requires that the Y data be monotonically increasing. Missing values are not allowed. This + method will extrapolate outside the range of the PointPairList if necessary. + + The target Y value on which to interpolate + The X value that corresponds to the value. + + + + Use linear regression to form a least squares fit of an existing + instance. + + The output will cover the + same X range of data as the original dataset. + + An instance containing + the data to be regressed. + The number of desired points to be included + in the resultant . + + A new containing the resultant + data fit. + + + + + Use linear regression to form a least squares fit of an existing + instance. + + An instance containing + the data to be regressed. + The number of desired points to be included + in the resultant . + + The minimum X value of the resultant + . + The maximum X value of the resultant + . + A new containing the resultant + data fit. + + Brian Chappell - lazarusds + modified by John Champion + + + + true if the list is currently sorted. + + + + + + Class that holds the specific properties for the major tics. Inherits from + . + + John Champion + $Revision: 3.1 $ $Date: 2006-06-24 20:26:44 $ + + + + Current schema value that defines the version of the serialized file + + + + + Default constructor for . + + + + + Copy constructor. + + The that is to be copied. + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Gets or sets a property that determines whether or not the major tics will be drawn + inbetween the labels, rather than right at the labels. + + + Note that this setting is only + applicable if = . + + true to place the text between the labels for text axes, false otherwise + + + + + + + + + A simple struct that defines the + default property values for the class. + + + + + The default size for the tic marks. + ( property). Units are in points (1/72 inch). + + + + + The default pen width for drawing the tic marks. + ( property). Units are in points (1/72 inch). + + + + + The display mode for the major outside tic marks + ( property). + The major tic spacing is controlled by . + + true to show the major tic marks (outside the axis), + false otherwise + + + + The display mode for the major inside tic marks + ( property). + The major tic spacing is controlled by . + + true to show the major tic marks (inside the axis), + false otherwise + + + + The display mode for the major opposite tic marks + ( property). + The major tic spacing is controlled by . + + true to show the major tic marks + (inside the axis on the opposite side), + false otherwise + + + + The default display mode for the major outside + "cross" tic marks ( property). + + + The "cross" tics are a special, additional set of tic marks that + always appear on the actual axis, even if it has been shifted due + to the setting. The other tic marks are always + fixed to the edges of the . The cross tics + are normally not displayed, since, if is true, + they will exactly overlay the "normal" and "inside" tics. If + is false, then you will most likely want to + enable the cross tics. + The major tic spacing is controlled by . + + true to show the major cross tic marks, false otherwise + + + + The default display mode for the major inside + "cross" tic marks ( property). + + + The "cross" tics are a special, additional set of tic marks that + always appear on the actual axis, even if it has been shifted due + to the setting. The other tic marks are always + fixed to the edges of the . The cross tics + are normally not displayed, since, if is true, + they will exactly overlay the "normal" and "inside" tics. If + is false, then you will most likely want to + enable the cross tics. + The major tic spacing is controlled by . + + true to show the major cross tic marks, false otherwise + + + + The default color for major tics ( property). + + + + + The LogScale class inherits from the class, and implements + the features specific to . + + + LogScale is a non-linear axis in which the values are scaled using the base 10 + + function. + + + John Champion + $Revision: 1.12 $ $Date: 2007-04-16 00:03:02 $ + + + + Current schema value that defines the version of the serialized file + + + + + Default constructor that defines the owner + (containing object) for this new object. + + The owner, or containing object, of this instance + + + + The Copy Constructor + + The object from which to copy + The object that will own the + new instance of + + + + Create a new clone of the current item, with a new owner assignment + + The new instance that will be + the owner of the new Scale + A new clone. + + + + Setup some temporary transform values in preparation for rendering the . + + + This method is typically called by the parent + object as part of the method. It is also + called by and + + methods to setup for coordinate transformations. + + + A reference to the object that is the parent or + owner of this object. + + + The parent for this + + + + + Convert a value to its linear equivalent for this type of scale. + + + The default behavior is to just return the value unchanged. However, + for and , + it returns the log or power equivalent. + + The value to be converted + + + + Convert a value from its linear equivalent to its actual scale value + for this type of scale. + + + The default behavior is to just return the value unchanged. However, + for and , + it returns the anti-log or inverse-power equivalent. + + The value to be converted + + + + Determine the value for any major tic. + + + This method properly accounts for , , + and other axis format settings. + + + The value of the first major tic (floating point double) + + + The major tic number (0 = first major tic). For log scales, this is the actual power of 10. + + + The specified major tic value (floating point double). + + + + + Determine the value for any minor tic. + + + This method properly accounts for , , + and other axis format settings. + + + The value of the first major tic (floating point double). This tic value is the base + reference for all tics (including minor ones). + + + The major tic number (0 = first major tic). For log scales, this is the actual power of 10. + + + The specified minor tic value (floating point double). + + + + + Internal routine to determine the ordinals of the first minor tic mark + + + The value of the first major tic for the axis. + + + The ordinal position of the first minor tic, relative to the first major tic. + This value can be negative (e.g., -3 means the first minor tic is 3 minor step + increments before the first major tic. + + + + + Determine the value for the first major tic. + + + This is done by finding the first possible value that is an integral multiple of + the step size, taking into account the date/time units if appropriate. + This method properly accounts for , , + and other axis format settings. + + + First major tic value (floating point double). + + + + + Internal routine to determine the ordinals of the first and last major axis label. + + + This is the total number of major tics for this axis. + + + + + Select a reasonable base 10 logarithmic axis scale given a range of data values. + + + This method only applies to type axes, and it + is called by the general method. The scale range is chosen + based always on powers of 10 (full log cycles). This + method honors the , , + and autorange settings. + In the event that any of the autorange settings are false, the + corresponding , , or + setting is explicitly honored, and the remaining autorange settings (if any) will + be calculated to accomodate the non-autoranged values. For log axes, the MinorStep + value is not used. + On Exit: + is set to scale minimum (if = true) + is set to scale maximum (if = true) + is set to scale step size (if = true) + is set to a magnitude multiplier according to the data + is set to the display format for the values (this controls the + number of decimal places, whether there are thousands separators, currency types, etc.) + + A reference to the object + associated with this + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + + + Make a value label for an . + + + A reference to the object that is the parent or + owner of this object. + + + The zero-based, ordinal index of the label to be generated. For example, a value of 2 would + cause the third value label on the axis to be generated. + + + The numeric value associated with the label. This value is ignored for log () + and text () type axes. + + The resulting value label as a + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Return the for this , which is + . + + + + + Gets or sets the minimum value for this scale. + + + The set property is specifically adapted for scales, + in that it automatically limits the setting to values greater than zero. + + + + + Gets or sets the maximum value for this scale. + + + The set property is specifically adapted for scales, + in that it automatically limits the setting to values greater than zero. + struct. + + + + + Encapsulates a Japanese CandleStick curve type that displays a vertical (or horizontal) + line displaying the range of data values at each sample point, plus a filled bar + signifying the opening and closing value for the sample. + + For this type to work properly, your must contain + objects, rather than ordinary types. + This is because the type actually displays 5 data values + but the only stores 3 data values. The + stores , , + , , and + members. + For a JapaneseCandleStick chart, the range between opening and closing values + is drawn as a filled bar, with the filled color different + () for the case of + + higher than , and + + for the reverse. The width of the bar is controlled + by the property, which is specified in + points (1/72nd inch), and scaled according to . + The candlesticks are drawn horizontally or vertically depending on the + value of , which is a + enum type. + John Champion + $Revision: 3.6 $ $Date: 2007-12-31 00:23:05 $ + + + + Current schema value that defines the version of the serialized file + + + + + Private field that stores a reference to the + class defined for this . Use the public + property to access this value. + + + + + + Gets a flag indicating if the X axis is the independent axis for this + + The parent of this . + + true if the X axis is independent, false otherwise + + + + Gets a flag indicating if the Z data range should be included in the axis scaling calculations. + + + IsZIncluded is true for objects, since the Y and Z + values are defined as the High and Low values for the day. + The parent of this . + + true if the Z data are included, false otherwise + + + + Create a new , specifying only the legend label. + + The label that will appear in the legend. + + + + Create a new using the specified properties. + + The label that will appear in the legend. + An of double precision values that define + the Date, Close, Open, High, and Low values for the curve. Note that this + should contain items rather + than items. + + + + + The Copy Constructor + + The object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Do all rendering associated with this to the specified + device. This method is normally only + called by the Draw method of the parent + collection object. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + The ordinal position of the current + curve. + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Draw a legend key entry for this at the specified location + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + The struct that specifies the + location for the legend key + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Determine the coords for the rectangle associated with a specified point for + this + + The to which this curve belongs + The index of the point of interest + A list of coordinates that represents the "rect" for + this point (used in an html AREA tag) + true if it's a valid point, false otherwise + + + + Gets a reference to the class defined + for this . + + + + + The DateAsOrdinalScale class inherits from the class, and implements + the features specific to . + + DateAsOrdinalScale is an ordinal axis that will have labels formatted with dates from the + actual data values of the first in the . + Although the tics are labeled with real data values, the actual points will be + evenly-spaced in spite of the data values. For example, if the X values of the first curve + are 1, 5, and 100, then the tic labels will show 1, 5, and 100, but they will be equal + distance from each other. + + + John Champion + $Revision: 1.13 $ $Date: 2007-11-28 02:38:22 $ + + + + Current schema value that defines the version of the serialized file + + + + + Default constructor that defines the owner + (containing object) for this new object. + + The owner, or containing object, of this instance + + + + The Copy Constructor + + The object from which to copy + The object that will own the + new instance of + + + + Create a new clone of the current item, with a new owner assignment + + The new instance that will be + the owner of the new Scale + A new clone. + + + + Select a reasonable ordinal axis scale given a range of data values, with the expectation that + dates will be displayed. + + + This method only applies to type axes, and it + is called by the general method. For this type, + the first curve is the "master", which contains the dates to be applied. + On Exit: + is set to scale minimum (if = true) + is set to scale maximum (if = true) + is set to scale step size (if = true) + is set to scale minor step size (if = true) + is set to a magnitude multiplier according to the data + is set to the display format for the values (this controls the + number of decimal places, whether there are thousands separators, currency types, etc.) + + A reference to the object + associated with this + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + + + Make a value label for an . + + + A reference to the object that is the parent or + owner of this object. + + + The zero-based, ordinal index of the label to be generated. For example, a value of 2 would + cause the third value label on the axis to be generated. + + + The numeric value associated with the label. This value is ignored for log + () + and text () type axes. + + The resulting value label as a + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Return the for this , which is + . + + + + + Gets or sets the minimum value for this scale. + + + The set property is specifically adapted for scales, + in that it automatically limits the value to the range of valid dates for the + struct. + + + + + Gets or sets the maximum value for this scale. + + + The set property is specifically adapted for scales, + in that it automatically limits the value to the range of valid dates for the + struct. + + + + + A collection base class containing basic extra functionality to be inherited + by , , + . + + The methods in this collection operate on basic + types. Therefore, in order to make sure that + the derived classes remain strongly-typed, there are no Add() or + Insert() methods here, and no methods that return an object. + Only Remove(), Move(), IndexOf(), etc. methods are included. + + John Champion + $Revision: 3.8 $ $Date: 2006-06-24 20:26:43 $ + + + + Default Constructor + + + + + Return the zero-based position index of the specified object + in the collection. + + A reference to the object that is to be found. + + The zero-based index of the specified object, or -1 if the + object is not in the list + + + + + Remove an object from the collection at the specified ordinal location. + + + An ordinal position in the list at which the object to be removed + is located. + + + + + + Remove an object from the collection based on an object reference. + + A reference to the object that is to be + removed. + + + + + Move the position of the object at the specified index + to the new relative position in the list. + For Graphic type objects, this method controls the + Z-Order of the items. Objects at the beginning of the list + appear in front of objects at the end of the list. + The zero-based index of the object + to be moved. + The relative number of positions to move + the object. A value of -1 will move the + object one position earlier in the list, a value + of 1 will move it one position later. To move an item to the + beginning of the list, use a large negative value (such as -999). + To move it to the end of the list, use a large positive value. + + The new position for the object, or -1 if the object + was not found. + + + + The basic class holds three data values (X, Y, Z). This + class extends the basic PointPair to contain four data values (X, Y, Z, T). + + + John Champion + $Revision: 3.3 $ $Date: 2007-03-17 18:43:44 $ + + + + Current schema value that defines the version of the serialized file + + + + + This PointPair4's T coordinate. + + + + + Default Constructor + + + + + Creates a point pair with the specified X, Y, Z, and T value. + + This pair's x coordinate. + This pair's y coordinate. + This pair's z coordinate. + This pair's t coordinate. + + + + Creates a point pair with the specified X, Y, base value, and + label (). + + This pair's x coordinate. + This pair's y coordinate. + This pair's z coordinate. + This pair's t coordinate. + This pair's string label () + + + + The PointPair4 copy constructor. + + The basis for the copy. + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Format this PointPair4 value using the default format. Example: "( 12.345, -16.876 )". + The two double values are formatted with the "g" format type. + + true to show the third "Z" and fourth "T" value coordinates + A string representation of the PointPair4 + + + + Format this PointPair value using a general format string. + Example: a format string of "e2" would give "( 1.23e+001, -1.69e+001 )". + If + is true, then the third "Z" coordinate is also shown. + + A format string that will be used to format each of + the two double type values (see ). + A string representation of the PointPair + true to show the third "Z" or low dependent value coordinate + + + + Format this PointPair value using different general format strings for the X, Y, and Z values. + Example: a format string of "e2" would give "( 1.23e+001, -1.69e+001 )". + + A format string that will be used to format the X + double type value (see ). + A format string that will be used to format the Y + double type value (see ). + A format string that will be used to format the Z + double type value (see ). + A format string that will be used to format the T + double type value (see ). + A string representation of the PointPair + + + + Readonly value that determines if either the X, Y, Z, or T + coordinate in this PointPair4 is an invalid (not plotable) value. + It is considered invalid if it is missing (equal to System.Double.Max), + Infinity, or NaN. + + true if any value is invalid + + + + Encapsulates a curve type that is displayed as a line and/or a set of + symbols at each point. + + + John Champion + $Revision: 3.22 $ $Date: 2007-08-10 16:22:54 $ + + + + Current schema value that defines the version of the serialized file + + + + + Private field that stores a reference to the + class defined for this . Use the public + property to access this value. + + + + + Private field that stores a reference to the + class defined for this . Use the public + property to access this value. + + + + + Gets a flag indicating if the Z data range should be included in the axis scaling calculations. + + The parent of this . + + true if the Z data are included, false otherwise + + + + Gets a flag indicating if the X axis is the independent axis for this + + The parent of this . + + true if the X axis is independent, false otherwise + + + + Create a new , specifying only the legend . + + The _label that will appear in the legend. + + + + Create a new using the specified properties. + + The _label that will appear in the legend. + An array of double precision values that define + the independent (X axis) values for this curve + An array of double precision values that define + the dependent (Y axis) values for this curve + A value that will be applied to + the and properties. + + A enum specifying the + type of symbol to use for this . Use + to hide the symbols. + The width (in points) to be used for the . This + width is scaled based on . Use a value of zero to + hide the line (see ). + + + + Create a new using the specified properties. + + The _label that will appear in the legend. + An array of double precision values that define + the independent (X axis) values for this curve + An array of double precision values that define + the dependent (Y axis) values for this curve + A value that will be applied to + the and properties. + + A enum specifying the + type of symbol to use for this . Use + to hide the symbols. + + + + Create a new using the specified properties. + + The _label that will appear in the legend. + A of double precision value pairs that define + the X and Y values for this curve + A value that will be applied to + the and properties. + + A enum specifying the + type of symbol to use for this . Use + to hide the symbols. + The width (in points) to be used for the . This + width is scaled based on . Use a value of zero to + hide the line (see ). + + + + Create a new using the specified properties. + + The _label that will appear in the legend. + A of double precision value pairs that define + the X and Y values for this curve + A value that will be applied to + the and properties. + + A enum specifying the + type of symbol to use for this . Use + to hide the symbols. + + + + The Copy Constructor + + The object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Do all rendering associated with this to the specified + device. This method is normally only + called by the Draw method of the parent + collection object. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + The ordinal position of the current + curve. + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Draw a legend key entry for this at the specified location + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + The struct that specifies the + location for the legend key + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Loads some pseudo unique colors/symbols into this LineItem. This + is mainly useful for differentiating a set of new LineItems without + having to pick your own colors/symbols. + + + + The that is used to pick the color + and symbol for this method call. + + + + + Determine the coords for the rectangle associated with a specified point for + this + + The to which this curve belongs + The index of the point of interest + A list of coordinates that represents the "rect" for + this point (used in an html AREA tag) + true if it's a valid point, false otherwise + + + + Gets or sets the class instance defined + for this . + + + + + Gets or sets the class instance defined + for this . + + + + + This class encapsulates the chart that is displayed + in the + + + John Champion + $Revision: 3.41 $ $Date: 2007-08-11 19:24:55 $ + + + + Current schema value that defines the version of the serialized file + + + + Private field to hold the bounding rectangle around the legend. + This bounding rectangle varies with the number of legend entries, font sizes, + etc., and is re-calculated by at each redraw. + Use the public readonly property to access this + rectangle. + + + + Private field to hold the legend location setting. This field + contains the enum type to specify the area of + the graph where the legend will be positioned. Use the public property + to access this value. + + + + + + Private field to enable/disable horizontal stacking of the legend entries. + If this value is false, then the legend entries will always be a single column. + Use the public property to access this value. + + + + + + Private field to enable/disable drawing of the entire legend. + If this value is false, then the legend will not be drawn. + Use the public property to access this value. + + + + + Private field that stores the data for this + . Use the public property to + access this value. + + + + + Private field that stores the data for this + . Use the public property to + access this value. + + + + + Private field to maintain the class that + maintains font attributes for the entries in this legend. Use + the property to access this class. + + + + + Private field to maintain the location. This object + is only applicable if the property is set to + . + + + + + Private temporary field to maintain the number of columns (horizontal stacking) to be used + for drawing the . This value is only valid during a draw operation. + + + + + Private temporary field to maintain the width of each column in the + . This value is only valid during a draw operation. + + + + + Private temporary field to maintain the height of each row in the + . This value is only valid during a draw operation. + + + + + Private field to store the gap between the legend and the chart rectangle. + + + + + Private field to select output order of legend entries. + + + + + Private temporary field to maintain the characteristic "gap" for the legend. + This is normal the height of the largest font in the legend. + This value is only valid during a draw operation. + + + + + Private field to enable/diable drawing the line and symbol samples in the + legend. + + + + + Default constructor that sets all properties to default + values as defined in the class. + + + + + The Copy Constructor + + The XAxis object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Render the to the specified device. + + + This method is normally only called by the Draw method + of the parent object. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + + + Determine if a mouse point is within the legend, and if so, which legend + entry () is nearest. + + The screen point, in pixel coordinates. + + A reference to the object that is the parent or + owner of this object. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + The index number of the legend + entry that is under the mouse point. The object is + accessible via CurveList[index]. + + true if the mouse point is within the bounding + box, false otherwise. + + + + + Calculate the rectangle (), + taking into account the number of required legend + entries, and the legend drawing preferences. + + Adjust the size of the + for the parent to accomodate the + space required by the legend. + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + + A reference to the object that is the parent or + owner of this object. + + + The scaling factor to be used for rendering objects. This is calculated and + passed down by the parent object using the + method, and is used to proportionally adjust + font sizes, etc. according to the actual size of the graph. + + + The rectangle that contains the area bounded by the axes, in pixel units. + + + + + + Get the bounding rectangle for the in screen coordinates + + A screen rectangle in pixel units + + + + Access to the class used to render + the entries + + A reference to a object + + + + + + + + + + Gets or sets a property that shows or hides the entirely + + true to show the , false to hide it + + + + + The class used to draw the border border around this . + + + + + Gets or sets the data for this + background. + + + + + Sets or gets a property that allows the items to + stack horizontally in addition to the vertical stacking + + true to allow horizontal stacking, false otherwise + + + + + + Sets or gets the location of the on the + using the enum type + + + + + + Gets or sets the data for the . + This property is only applicable if is set + to . + + + + + Gets or sets the gap size between the legend and the . + + + This is expressed as a fraction of the largest scaled character height for any + of the fonts used in the legend. Each in the legend can + optionally have its own specification. + + + + + Gets or sets a value that determines if the legend entries are displayed in normal order + (matching the order in the , or in reverse order. + + + + + Gets or sets a value that determines whether the line and symbol keys will be displayed + in the legend. + + + Note: If this value is set to false (so that only the curve label text is displayed + with no legend keys), then the color of the font for the legend entry of each curve + will automatically be set to match the setting for that curve. + You can override this behavior by specifying a specific font to be used for each + individual curve with the CurveItem.Label.FontSpec + property. + + + + + A simple struct that defines the + default property values for the class. + + + + + The default pen width for the border border. + ( property). Units are in pixels. + + + + + The default color for the border border. + ( property). + + + + + The default color for the background. + ( property). Use of this + color depends on the status of the + property. + + + + + The default custom brush for filling in this . + + + + + The default fill mode for the background. + + + + + The default location for the on the graph + ( property). This property is + defined as a enumeration. + + + + + The default border mode for the . + ( property). true + to draw a border around the , + false otherwise. + + + + + The default display mode for the . + ( property). true + to show the legend, + false to hide it. + + + + + The default fill mode for the background + ( property). + true to fill-in the background with color, + false to leave the background transparent. + + + + + The default horizontal stacking mode for the + ( property). + true to allow horizontal legend item stacking, false to allow + only vertical legend orientation. + + + + + The default font family for the entries + ( property). + + + + + The default font size for the entries + ( property). Units are + in points (1/72 inch). + + + + + The default font color for the entries + ( property). + + + + + The default font bold mode for the entries + ( property). true + for a bold typeface, false otherwise. + + + + + The default font italic mode for the entries + ( property). true + for an italic typeface, false otherwise. + + + + + The default font underline mode for the entries + ( property). true + for an underlined typeface, false otherwise. + + + + + The default color for filling in the scale text background + (see property). + + + + + The default custom brush for filling in the scale text background + (see property). + + + + + The default fill mode for filling in the scale text background + (see property). + + + + + The default gap size between the legend and the . + This is the default value of . + + + + + Default value for the property. + + + + + Default value for the property. + + + + + Hue-Saturation-Brightness Color class to store a color value, and to manage conversions + to and from RGB colors in the struct. + + + This class is based on code from http://www.cs.rit.edu/~ncs/color/ by Eugene Vishnevsky. + This struct stores the hue, saturation, brightness, and alpha values internally as + values from 0 to 255. The hue represents a fraction of the 360 degrees + of color space available. The saturation is the color intensity, where 0 represents gray scale + and 255 is the most colored. For the brightness, 0 represents black and 255 + represents white. + + + + + The color hue value, ranging from 0 to 255. + + + This property is actually a rescaling of the 360 degrees on the color wheel to 255 + possible values. Therefore, every 42.5 units is a new sector, with the following + convention: red=0, yellow=42.5, green=85, cyan=127.5, blue=170, magenta=212.5 + + + + + The color saturation (intensity) value, ranging from 0 (gray scale) to 255 (most colored). + + + + + The brightness value, ranging from 0 (black) to 255 (white). + + + + + The alpha value (opacity), ranging from 0 (transparent) to 255 (opaque). + + + + + Constructor to load an struct from hue, saturation and + brightness values + + The color hue value, ranging from 0 to 255 + The color saturation (intensity) value, ranging from 0 (gray scale) + to 255 (most colored) + The brightness value, ranging from 0 (black) to 255 (white) + + + + Constructor to load an struct from hue, saturation, + brightness, and alpha values + + The color hue value, ranging from 0 to 255 + The color saturation (intensity) value, ranging from 0 (gray scale) + to 255 (most colored) + The brightness value, ranging from 0 (black) to 255 (white) + The alpha value (opacity), ranging from 0 (transparent) to + 255 (opaque) + + + + Constructor to load an struct from a system + struct. + + An rgb struct containing the equivalent + color you want to generate + + + + Implicit conversion operator to convert directly from an to + a struct. + + The struct to be converted + An equivalent struct that can be used in the GDI+ + graphics library + + + + Convert an value to an equivalent value. + + + This method is based on code from http://www.cs.rit.edu/~ncs/color/ by Eugene Vishnevsky. + + The struct to be converted + An equivalent struct, compatible with the GDI+ library + + + + Convert this value to an equivalent value. + + + This method is based on code from http://www.cs.rit.edu/~ncs/color/ by Eugene Vishnevsky. + + An equivalent struct, compatible with the GDI+ library + + + + Convert a value to an equivalent value. + + + This method is based on code from http://www.cs.rit.edu/~ncs/color/ by Eugene Vishnevsky. + + An equivalent struct + + + + Convert a value to an equivalent value. + + + This method is based on code from http://www.cs.rit.edu/~ncs/color/ by Eugene Vishnevsky. + + The struct to be converted + An equivalent struct + + + + Encapsulates a curve type that is displayed as a series of vertical "sticks", + one at each defined point. + + + The sticks run from the zero value of the Y axis, to the Y point defined in each + of the (see ). + The properties of the sticks are defined in the property. + Normally, the is not visible. However, if you manually enable the + using the property, the + symbols will be drawn at the "Z" value from each (see + ). + + + John Champion + $Revision: 1.7 $ $Date: 2007-01-25 07:56:09 $ + + + + Current schema value that defines the version of the serialized file + + + + + Gets a flag indicating if the Z data range should be included in the axis scaling calculations. + + The parent of this . + + true if the Z data are included, false otherwise + + + + Gets a flag indicating if the X axis is the independent axis for this + + The parent of this . + + true if the X axis is independent, false otherwise + + + + Create a new , specifying only the legend . + + The label that will appear in the legend. + + + + Create a new using the specified properties. + + The label that will appear in the legend. + An array of double precision values that define + the independent (X axis) values for this curve + An array of double precision values that define + the dependent (Y axis) values for this curve + A value that will be applied to + the and properties. + + The width (in points) to be used for the . This + width is scaled based on . Use a value of zero to + hide the line (see ). + + + + Create a new using the specified properties. + + The label that will appear in the legend. + An array of double precision values that define + the independent (X axis) values for this curve + An array of double precision values that define + the dependent (Y axis) values for this curve + A value that will be applied to + the and properties. + + + + + Create a new using the specified properties. + + The label that will appear in the legend. + A of double precision value pairs that define + the X and Y values for this curve + A value that will be applied to + the and properties. + + + + + Create a new using the specified properties. + + The label that will appear in the legend. + A of double precision value pairs that define + the X and Y values for this curve + A value that will be applied to + the and properties. + + The width (in points) to be used for the . This + width is scaled based on . Use a value of zero to + hide the line (see ). + + + + The Copy Constructor + + The object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + A class that encapsulates color-fill properties for an object. The class + is used in , , , + , and objects. + + + John Champion + $Revision: 3.22 $ $Date: 2007-01-26 09:01:49 $ + + + + Current schema value that defines the version of the serialized file + + + + + Private field that stores the fill color. Use the public + property to access this value. This property is + only applicable if the is not . + + + + + Private field that stores the secondary color for gradientByValue fills. Use the public + property to access this value. This property is + only applicable if the is , + , or . + + + + + Private field that stores the custom fill brush. Use the public + property to access this value. This property is + only applicable if the + property is set to . + + + + + Private field that determines the type of color fill. Use the public + property to access this value. The fill color + is determined by the property or + . + + + + + Private field that determines if the brush will be scaled to the bounding box + of the filled object. If this value is false, then the brush will only be aligned + with the filled object based on the and + properties. + + + + + Private field that determines how the brush will be aligned with the filled object + in the horizontal direction. This value is a enumeration. + This field only applies if is false. + properties. + + + + + + + Private field that determines how the brush will be aligned with the filled object + in the vertical direction. This value is a enumeration. + This field only applies if is false. + properties. + + + + + + + Private field that saves the image passed to the constructor. + This is used strictly for serialization. + + + + + Private field that saves the image wrapmode passed to the constructor. + This is used strictly for serialization. + + + + + Private field that saves the list of colors used to create the + in the constructor. This is used strictly + for serialization. + + + + + Private field that saves the list of positions used to create the + in the constructor. This is used strictly + for serialization. + + + + + Private field the saves the angle of the fill. This is used strictly for serialization. + + + + + Generic initializer to default values + + + + + The default constructor. Initialized to no fill. + + + + + Constructor that specifies the color, brush, and type for this fill. + + The color of the fill for solid fills + A custom brush for fills. Can be a , + , or . + The for this fill. + + + + Constructor that creates a solid color-fill, setting to + , and setting to the + specified color value. + + The color of the solid fill + + + + Constructor that creates a linear gradient color-fill, setting to + using the specified colors and angle. + + The first color for the gradient fill + The second color for the gradient fill + The angle (degrees) of the gradient fill + + + + Constructor that creates a linear gradient color-fill, setting to + using the specified colors. + + The first color for the gradient fill + The second color for the gradient fill + + + + Constructor that creates a linear gradient color-fill, setting to + using the specified colors. This gradient fill + consists of three colors. + + The first color for the gradient fill + The second color for the gradient fill + The third color for the gradient fill + + + + Constructor that creates a linear gradient color-fill, setting to + using the specified colors. This gradient fill + consists of three colors + + The first color for the gradient fill + The second color for the gradient fill + The third color for the gradient fill + The angle (degrees) of the gradient fill + + + + Constructor that creates a linear gradient multi-color-fill, setting to + using the specified colors. This gradient fill + consists of many colors based on a object. The gradient + angle is defaulted to zero. + + The object that defines the colors + and positions along the gradient. + + + + Constructor that creates a linear gradient multi-color-fill, setting to + using the specified colors. This gradient fill + consists of many colors based on a object, drawn at the + specified angle (degrees). + + The object that defines the colors + and positions along the gradient. + The angle (degrees) of the gradient fill + + + + Constructor that creates a linear gradient multi-color-fill, setting to + using the specified colors. This gradient fill + consists of many colors based on an array of objects, drawn at an + angle of zero (degrees). The array is used to create + a object assuming a even linear distribution of the colors + across the gradient. + + The array of objects that defines the colors + along the gradient. + + + + Constructor that creates a linear gradient multi-color-fill, setting to + using the specified colors. This gradient fill + consists of many colors based on an array of objects, drawn at the + specified angle (degrees). The array is used to create + a object assuming a even linear distribution of the colors + across the gradient. + + The array of objects that defines the colors + along the gradient. + The angle (degrees) of the gradient fill + + + + Constructor that creates a linear gradient multi-color-fill, setting to + using the specified colors. This gradient fill + consists of many colors based on an array of objects, drawn at the + an angle of zero (degrees). The array is used to create + a object assuming a even linear distribution of the colors + across the gradient. + + The array of objects that defines the colors + along the gradient. + The array of floating point values that defines the color + positions along the gradient. Values should range from 0 to 1. + + + + Constructor that creates a linear gradient multi-color-fill, setting to + using the specified colors. This gradient fill + consists of many colors based on an array of objects, drawn at the + specified angle (degrees). The array is used to create + a object assuming a even linear distribution of the colors + across the gradient. + + The array of objects that defines the colors + along the gradient. + The array of floating point values that defines the color + positions along the gradient. Values should range from 0 to 1. + The angle (degrees) of the gradient fill + + + + Constructor that creates a texture fill, setting to + and using the specified image. + + The to use for filling + The class that controls the image wrapping properties + + + + Constructor that creates a fill, using a user-supplied, custom + . The brush will be scaled to fit the destination screen object + unless you manually change to false; + + The to use for fancy fills. Typically, this would + be a or a class + + + + Constructor that creates a fill, using a user-supplied, custom + . The brush will be scaled to fit the destination screen object + according to the parameter. + + The to use for fancy fills. Typically, this would + be a or a class + Determines if the brush will be scaled to fit the bounding box + of the destination object. true to scale it, false to leave it unscaled + + + + Constructor that creates a fill, using a user-supplied, custom + . This constructor will make the brush unscaled (see ), + but it provides and parameters to control + alignment of the brush with respect to the filled object. + + The to use for fancy fills. Typically, this would + be a or a class + Controls the horizontal alignment of the brush within the filled object + (see + Controls the vertical alignment of the brush within the filled object + (see + + + + The Copy Constructor + + The Fill object from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Constructor for deserializing objects + + A instance that defines the serialized data + + A instance that contains the serialized data + + + + + Populates a instance with the data needed to serialize the target object + + A instance that defines the serialized data + A instance that contains the serialized data + + + + Create a fill brush using current properties. This method will construct a brush based on the + settings of , + and . If + is set to and + + is null, then a will be created between the colors of + and . + + A rectangle that bounds the object to be filled. This determines + the start and end of the gradient fill. + A class representing the fill brush + + + + Create a fill brush using current properties. This method will construct a brush based on the + settings of , + and . If + is set to and + + is null, then a will be created between the colors of + and . + + A rectangle that bounds the object to be filled. This determines + the start and end of the gradient fill. + The data value to be used for a value-based + color gradient. This is only applicable for , + or . + A class representing the fill brush + + + + Fill the background of the area, using the + fill type from this . + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + The struct specifying the area + to be filled + + + + Fill the background of the area, using the + fill type from this . + + + A graphic device object to be drawn into. This is normally e.Graphics from the + PaintEventArgs argument to the Paint() method. + + The struct specifying the area + to be filled + The data value to be used in case it's a + , , or + . + + + + The fill color. This property is used as a single color to make a solid fill + ( is ), or it can be used in + combination with to make a + + when is and + is null. + + + + + + Gets or sets the secondary color for gradientByValue fills. + + + This property is only applicable if the is + , + , or + . Once the gradient-by-value logic picks + a color, a new gradient will be created using the SecondaryValueGradientColor, the + resulting gradient-by-value color, and the angle setting for this + . Use a value of Color.Empty to have + a solid-color resulting from a gradient-by-value + . + + + + + The custom fill brush. This can be a , a + , or a . This property is + only applicable if the property is set + to . + + + + + Determines the type of fill, which can be either solid + color () or a custom brush + (). See for + more information. + + + + + + This property determines the type of color fill. + Returns true if the property is either + or + . If set to true, this property + will automatically set the to + . If set to false, this property + will automatically set the to + . In order to get a regular + solid-color fill, you have to manually set + to . + + + + + + + + Determines if the brush will be scaled to the bounding box + of the filled object. If this value is false, then the brush will only be aligned + with the filled object based on the and + properties. + + + + + Determines how the brush will be aligned with the filled object + in the horizontal direction. This value is a enumeration. + This field only applies if is false. + + + + + + Determines how the brush will be aligned with the filled object + in the vertical direction. This value is a enumeration. + This field only applies if is false. + + + + + + Returns a boolean value indicating whether or not this fill is a "Gradient-By-Value" + type. This is true for , , + or . + + + The gradient by value fill method allows the fill color for each point or bar to + be based on a value for that point (either X, Y, or Z in the . + For example, assume a class is defined with a linear gradient ranging from + to and the + is set to . If is set to + 100.0 and is set to 200.0, then a point that has a Y value of + 100 or less will be colored blue, a point with a Y value of 200 or more will be + colored red, and a point between 100 and 200 will have a color based on a linear scale + between blue and red. Note that the fill color is always solid for any given point. + You can use the Z value from along with + to color individual points according to some + property that is independent of the X,Y point pair. + + true if this is a Gradient-by-value type, false otherwise + + + + + + + The minimum user-scale value for the gradient-by-value determination. This defines + the user-scale value for the start of the gradient. + + + + + + + + A double value, in user scale unit + + + + The maximum user-scale value for the gradient-by-value determination. This defines + the user-scale value for the end of the gradient. + + + + + + + + A double value, in user scale unit + + + + The default user-scale value for the gradient-by-value determination. This defines the + value that will be used when there is no point value available, or the actual point value + is invalid. + + + Note that this value, when defined, will determine the color that is used in the legend. + If this value is set to double.MaxValue, then it remains "undefined." In this case, the + legend symbols will actually be filled with a color gradient representing the range of + colors. + + + + + + + + A double value, in user scale unit + + + + A simple struct that defines the + default property values for the class. + + + + + The default scaling mode for fills. + This is the default value for the property. + + + + + The default horizontal alignment for fills. + This is the default value for the property. + + + + + The default vertical alignment for fills. + This is the default value for the property. + + + + + A data collection class for ZedGraph, provided as an alternative to . + + + The data storage class for ZedGraph can be any type, so long as it uses the + interface. This class, albeit simple, is a demonstration of implementing the + interface to provide a simple data collection using only two arrays. The + interface can also be used as a layer between ZedGraph and a database, for example. + + + + + John Champion + $Revision: 3.4 $ $Date: 2007-02-18 05:51:53 $ + + + + Instance of an array of x values + + + + + Instance of an array of x values + + + + + Constructor to initialize the PointPairList from two arrays of + type double. + + + + + The Copy Constructor + + The PointPairList from which to copy + + + + Implement the interface in a typesafe manner by just + calling the typed version of + + A deep copy of this object + + + + Typesafe, deep-copy clone method. + + A new, independent copy of this class + + + + Indexer to access the specified object by + its ordinal position in the list. + + + Returns for any value of + that is outside of its corresponding array bounds. + + The ordinal position (zero-based) of the + object to be accessed. + A object reference. + + + + Returns the number of points available in the arrays. Count will be the greater + of the lengths of the X and Y arrays. + + +
+
diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/ZedGraph.dll b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/ZedGraph.dll new file mode 100644 index 0000000..8b150d8 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/ZedGraph.dll Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/de/ZedGraph.resources.dll b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/de/ZedGraph.resources.dll new file mode 100644 index 0000000..b858704 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/de/ZedGraph.resources.dll Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/es/ZedGraph.resources.dll b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/es/ZedGraph.resources.dll new file mode 100644 index 0000000..c9a0809 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/es/ZedGraph.resources.dll Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/fr/ZedGraph.resources.dll b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/fr/ZedGraph.resources.dll new file mode 100644 index 0000000..c300332 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/fr/ZedGraph.resources.dll Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/hu/ZedGraph.resources.dll b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/hu/ZedGraph.resources.dll new file mode 100644 index 0000000..a273f59 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/hu/ZedGraph.resources.dll Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/it/ZedGraph.resources.dll b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/it/ZedGraph.resources.dll new file mode 100644 index 0000000..76bbede --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/it/ZedGraph.resources.dll Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/ja/ZedGraph.resources.dll b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/ja/ZedGraph.resources.dll new file mode 100644 index 0000000..0f30bd4 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/ja/ZedGraph.resources.dll Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/pt/ZedGraph.resources.dll b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/pt/ZedGraph.resources.dll new file mode 100644 index 0000000..9fb74df --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/pt/ZedGraph.resources.dll Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/ru/ZedGraph.resources.dll b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/ru/ZedGraph.resources.dll new file mode 100644 index 0000000..2278d52 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/ru/ZedGraph.resources.dll Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/sk/ZedGraph.resources.dll b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/sk/ZedGraph.resources.dll new file mode 100644 index 0000000..dcab827 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/sk/ZedGraph.resources.dll Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/sv/ZedGraph.resources.dll b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/sv/ZedGraph.resources.dll new file mode 100644 index 0000000..82d21c8 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/sv/ZedGraph.resources.dll Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/tr/ZedGraph.resources.dll b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/tr/ZedGraph.resources.dll new file mode 100644 index 0000000..ed46620 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/tr/ZedGraph.resources.dll Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/zh-cn/ZedGraph.resources.dll b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/zh-cn/ZedGraph.resources.dll new file mode 100644 index 0000000..3f51e83 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/zh-cn/ZedGraph.resources.dll Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/zh-tw/ZedGraph.resources.dll b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/zh-tw/ZedGraph.resources.dll new file mode 100644 index 0000000..ba82c6e --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CSharp/ZedGraph/zh-tw/ZedGraph.resources.dll Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CmdMessenger.cpp b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CmdMessenger.cpp new file mode 100644 index 0000000..5686f0d --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CmdMessenger.cpp @@ -0,0 +1,672 @@ +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + Initial Messenger Library - Thomas Ouellet Fredericks. + CmdMessenger Version 1 - Neil Dudman. + CmdMessenger Version 2 - Dreamcat4. + CmdMessenger Version 3 - Thijs Elenbaas. + 3.6 - Fixes + - Better compatibility between platforms + - Unit tests + 3.5 - Fixes, speed improvements for Teensy + 3.4 - Internal update + 3.3 - Fixed warnings + - Some code optimization + 3.2 - Small fixes and sending long argument support + 3.1 - Added examples + 3.0 - Bugfixes on 2.2 + - Wait for acknowlegde + - Sending of common type arguments (float, int, char) + - Multi-argument commands + - Escaping of special characters + - Sending of binary data of any type (uses escaping) + */ + +extern "C" { +#include +#include +} +#include +#include + +#define _CMDMESSENGER_VERSION 3_6 // software version of this library + +// **** Initialization **** + +/** + * CmdMessenger constructor + */ +CmdMessenger::CmdMessenger(Stream &ccomms, const char fld_separator, const char cmd_separator, const char esc_character) +{ + init(ccomms,fld_separator,cmd_separator, esc_character); +} + +/** + * Enables printing newline after a sent command + */ +void CmdMessenger::init(Stream &ccomms, const char fld_separator, const char cmd_separator, const char esc_character) +{ + default_callback = NULL; + comms = &ccomms; + print_newlines = false; + field_separator = fld_separator; + command_separator = cmd_separator; + escape_character = esc_character; + bufferLength = MESSENGERBUFFERSIZE; + bufferLastIndex = MESSENGERBUFFERSIZE -1; + reset(); + + default_callback = NULL; + for (int i = 0; i < MAXCALLBACKS; i++) + callbackList[i] = NULL; + + pauseProcessing = false; +} + +/** + * Resets the command buffer and message state + */ +void CmdMessenger::reset() +{ + bufferIndex = 0; + current = NULL; + last = NULL; + dumped = true; +} + +/** + * Enables printing newline after a sent command + */ +void CmdMessenger::printLfCr(bool addNewLine) +{ + print_newlines = addNewLine; +} + +/** + * Attaches an default function for commands that are not explicitly attached + */ +void CmdMessenger::attach(messengerCallbackFunction newFunction) +{ + default_callback = newFunction; +} + +/** + * Attaches a function to a command ID + */ +void CmdMessenger::attach(byte msgId, messengerCallbackFunction newFunction) +{ + if (msgId >= 0 && msgId < MAXCALLBACKS) + callbackList[msgId] = newFunction; +} + +// **** Command processing **** + +/** + * Feeds serial data in CmdMessenger + */ +void CmdMessenger::feedinSerialData() +{ + while ( !pauseProcessing && comms->available() ) + { + // The Stream class has a readBytes() function that reads many bytes at once. On Teensy 2.0 and 3.0, readBytes() is optimized. + // Benchmarks about the incredible difference it makes: http://www.pjrc.com/teensy/benchmark_usb_serial_receive.html + + size_t bytesAvailable = min(comms->available(),MAXSTREAMBUFFERSIZE); + comms->readBytes(streamBuffer, bytesAvailable); + + // Process the bytes in the stream buffer, and handles dispatches callbacks, if commands are received + for (size_t byteNo = 0; byteNo < bytesAvailable ; byteNo++) + { + int messageState = processLine(streamBuffer[byteNo]); + + // If waiting for acknowledge command + if ( messageState == kEndOfMessage ) + { + handleMessage(); + } + } + } +} + +/** + * Processes bytes and determines message state + */ +uint8_t CmdMessenger::processLine(char serialChar) +{ + messageState = kProccesingMessage; + //char serialChar = (char)serialByte; + bool escaped = isEscaped(&serialChar,escape_character,&CmdlastChar); + if((serialChar == command_separator) && !escaped) { + commandBuffer[bufferIndex]=0; + if(bufferIndex > 0) { + messageState = kEndOfMessage; + current = commandBuffer; + CmdlastChar='\0'; + } + reset(); + } else { + commandBuffer[bufferIndex]=serialChar; + bufferIndex++; + if (bufferIndex >= bufferLastIndex) reset(); + } + return messageState; +} + +/** + * Dispatches attached callbacks based on command + */ +void CmdMessenger::handleMessage() +{ + lastCommandId = readInt16Arg(); + // if command attached, we will call it + if (lastCommandId >= 0 && lastCommandId < MAXCALLBACKS && ArgOk && callbackList[lastCommandId] != NULL) + (*callbackList[lastCommandId])(); + else // If command not attached, call default callback (if attached) + if (default_callback!=NULL) (*default_callback)(); +} + +/** + * Waits for reply from sender or timeout before continuing + */ +bool CmdMessenger::blockedTillReply(unsigned long timeout, int ackCmdId) +{ + unsigned long time = millis(); + unsigned long start = time; + bool receivedAck = false; + while( (time - start ) < timeout && !receivedAck) { + time = millis(); + receivedAck = CheckForAck(ackCmdId); + } + return receivedAck; +} + +/** + * Loops as long data is available to determine if acknowledge has come in + */ +bool CmdMessenger::CheckForAck(int AckCommand) +{ + while ( comms->available() ) { + //Processes a byte and determines if an acknowlegde has come in + int messageState = processLine(comms->read()); + if ( messageState == kEndOfMessage ) { + int id = readInt16Arg(); + if (AckCommand==id && ArgOk) { + return true; + } else { + return false; + } + } + return false; + } + return false; +} + +/** + * Gets next argument. Returns true if an argument is available + */ +bool CmdMessenger::next() +{ + char * temppointer= NULL; + // Currently, cmd messenger only supports 1 char for the field seperator + switch (messageState) { + case kProccesingMessage: + return false; + case kEndOfMessage: + temppointer = commandBuffer; + messageState = kProcessingArguments; + default: + if (dumped) + current = split_r(temppointer,field_separator,&last); + if (current != NULL) { + dumped = true; + return true; + } + } + return false; +} + +/** + * Returns if an argument is available. Alias for next() + */ +bool CmdMessenger::available() +{ + return next(); +} + +/** + * Returns if the latest argument is well formed. + */ +bool CmdMessenger::isArgOk () +{ + return ArgOk; +} + +/** + * Returns the CommandID of the current command + */ +uint8_t CmdMessenger::CommandID() +{ + return lastCommandId; +} + +// **** Command sending **** + +/** + * Send start of command. This makes it easy to send multiple arguments per command + */ +void CmdMessenger::sendCmdStart(int cmdId) +{ + if (!startCommand) { + startCommand = true; + pauseProcessing = true; + comms->print(cmdId); + } +} + +/** + * Send an escaped command argument + */ +void CmdMessenger::sendCmdEscArg(char* arg) +{ + if (startCommand) { + comms->print(field_separator); + printEsc(arg); + } +} + +/** + * Send formatted argument. + * Note that floating points are not supported and resulting string is limited to 128 chars + */ +void CmdMessenger::sendCmdfArg(char *fmt, ...) +{ + const int maxMessageSize = 128; + if (startCommand) { + char msg[maxMessageSize]; + va_list args; + va_start (args, fmt ); + vsnprintf(msg, maxMessageSize, fmt, args); + va_end (args); + + comms->print(field_separator); + comms->print(msg); + } +} + +/** + * Send double argument in scientific format. + * This will overcome the boundary of normal float sending which is limited to abs(f) <= MAXLONG + */ +void CmdMessenger::sendCmdSciArg (double arg, int n) +{ +if (startCommand) + { + comms->print (field_separator); + printSci (arg, n); + } +} + +/** + * Send end of command + */ +bool CmdMessenger::sendCmdEnd(bool reqAc, int ackCmdId, int timeout) +{ + bool ackReply = false; + if (startCommand) { + comms->print(command_separator); + if(print_newlines) + comms->println(); // should append BOTH \r\n + if (reqAc) { + ackReply = blockedTillReply(timeout, ackCmdId); + } + } + pauseProcessing = false; + startCommand = false; + return ackReply; +} + +/** + * Send a command without arguments, with acknowledge + */ +bool CmdMessenger::sendCmd (int cmdId, bool reqAc, int ackCmdId) +{ + if (!startCommand) { + sendCmdStart (cmdId); + return sendCmdEnd (reqAc, ackCmdId, DEFAULT_TIMEOUT); + } + return false; +} + +/** + * Send a command without arguments, without acknowledge + */ +bool CmdMessenger::sendCmd (int cmdId) +{ + if (!startCommand) { + sendCmdStart (cmdId); + return sendCmdEnd (false, 1, DEFAULT_TIMEOUT); + } + return false; +} + +// **** Command receiving **** + +/** + * Find next argument in command + */ +int CmdMessenger::findNext(char *str, char delim) +{ + int pos = 0; + bool escaped = false; + bool EOL = false; + ArglastChar = '\0'; + while (true) { + escaped = isEscaped(str,escape_character,&ArglastChar); + EOL = (*str == '\0' && !escaped); + if (EOL) { + return pos; + } + if (*str==field_separator && !escaped) { + return pos; + } else { + str++; + pos++; + } + } + return pos; +} + +/** + * Read the next argument as int + */ +int16_t CmdMessenger::readInt16Arg() +{ + if (next()) { + dumped = true; + ArgOk = true; + return atoi(current); + } + ArgOk = false; + return 0; +} + +/** + * Read the next argument as int + */ +int32_t CmdMessenger::readInt32Arg() +{ + if (next()) { + dumped = true; + ArgOk = true; + return atol(current); + } + ArgOk = false; + return 0L; +} + +/** + * Read the next argument as bool + */ +bool CmdMessenger::readBoolArg() +{ + return (readInt16Arg()!=0)?true:false; +} + +/** + * Read the next argument as char + */ +char CmdMessenger::readCharArg() +{ + if (next()) { + dumped = true; + ArgOk = true; + return current[0]; + } + ArgOk = false; + return 0; +} + +/** + * Read the next argument as float + */ +float CmdMessenger::readFloatArg() +{ + if (next()) { + dumped = true; + ArgOk = true; + //return atof(current); + return strtod(current,NULL); + } + ArgOk = false; + return 0; +} + +/** + * Read the next argument as double + */ +double CmdMessenger::readDoubleArg() +{ + if (next()) { + dumped = true; + ArgOk = true; + return strtod(current,NULL); + } + ArgOk = false; + return 0; +} + +/** + * Read next argument as string. + * Note that the String is valid until the current command is replaced + */ +char* CmdMessenger::readStringArg() +{ + if (next()) { + dumped = true; + ArgOk = true; + return current; + } + ArgOk = false; + return '\0'; +} + +/** + * Return next argument as a new string + * Note that this is useful if the string needs to be persisted + */ +void CmdMessenger::copyStringArg(char *string, uint8_t size) +{ + if (next()) { + dumped = true; + ArgOk = true; + strlcpy(string,current,size); + } else { + ArgOk = false; + if ( size ) string[0] = '\0'; + } +} + +/** + * Compare the next argument with a string + */ +uint8_t CmdMessenger::compareStringArg(char *string) +{ + if (next()) { + if ( strcmp(string,current) == 0 ) { + dumped = true; + ArgOk = true; + return 1; + } else { + ArgOk = false; + return 0; + } + } + return 0; +} + +// **** Escaping tools **** + +/** + * Unescapes a string + * Note that this is done inline + */ +void CmdMessenger::unescape(char *fromChar) +{ + // Move unescaped characters right + char *toChar = fromChar; + while (*fromChar != '\0') { + if (*fromChar==escape_character) { + fromChar++; + } + *toChar++=*fromChar++; + } + // Pad string with \0 if string was shortened + for (; toCharprint(escape_character); + } + comms->print(str); +} + +/** + * Print float and double in scientific format + */ +void CmdMessenger::printSci(double f, unsigned int digits) +{ + // handle sign + if (f < 0.0) + { + Serial.print('-'); + f = -f; + } + + // handle infinite values + if (isinf(f)) + { + Serial.print("INF"); + return; + } + // handle Not a Number + if (isnan(f)) + { + Serial.print("NaN"); + return; + } + + // max digits + if (digits > 6) digits = 6; + long multiplier = pow(10, digits); // fix int => long + + int exponent; + if (abs(f) < 10.0) { + exponent = 0; + } else { + exponent = int(log10(f)); + } + float g = f / pow(10, exponent); + if ((g < 1.0) && (g != 0.0)) + { + g *= 10; + exponent--; + } + + long whole = long(g); // single digit + long part = long((g-whole)*multiplier+0.5); // # digits + // Check for rounding above .99: + if (part == 100) { + whole++; + part = 0; + } + char format[16]; + sprintf(format, "%%ld.%%0%dldE%%+d", digits); + char output[16]; + sprintf(output,format, whole, part, exponent); + comms->print(output); +} \ No newline at end of file diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CmdMessenger.h b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CmdMessenger.h new file mode 100644 index 0000000..3cebc69 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/CmdMessenger.h @@ -0,0 +1,301 @@ +/* + CmdMessenger - library that provides command based messaging + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + */ + +#ifndef CmdMessenger_h +#define CmdMessenger_h + +#include +#if ARDUINO >= 100 +#include +#else +#include +#endif + +//#include "Stream.h" + +extern "C" +{ + // callback functions always follow the signature: void cmd(void); + typedef void (*messengerCallbackFunction) (void); +} + +#define MAXCALLBACKS 50 // The maximum number of commands (default: 50) +#define MESSENGERBUFFERSIZE 64 // The length of the commandbuffer (default: 64) +#define MAXSTREAMBUFFERSIZE 512 // The length of the streambuffer (default: 64) +#define DEFAULT_TIMEOUT 5000 // Time out on unanswered messages. (default: 5s) + +// Message States +enum +{ + kProccesingMessage, // Message is being received, not reached command separator + kEndOfMessage, // Message is fully received, reached command separator + kProcessingArguments, // Message is received, arguments are being read parsed +}; + +#define white_space(c) ((c) == ' ' || (c) == '\t') +#define valid_digit(c) ((c) >= '0' && (c) <= '9') + +class CmdMessenger +{ +private: + + // **** Private variables *** + + bool startCommand; // Indicates if sending of a command is underway + uint8_t lastCommandId; // ID of last received command + uint8_t bufferIndex; // Index where to write data in buffer + uint8_t bufferLength; // Is set to MESSENGERBUFFERSIZE + uint8_t bufferLastIndex; // The last index of the buffer + char ArglastChar; // Bookkeeping of argument escape char + char CmdlastChar; // Bookkeeping of command escape char + bool pauseProcessing; // pauses processing of new commands, during sending + bool print_newlines; // Indicates if \r\n should be added after send command + char commandBuffer[MESSENGERBUFFERSIZE]; // Buffer that holds the data + char streamBuffer[MAXSTREAMBUFFERSIZE]; // Buffer that holds the data + uint8_t messageState; // Current state of message processing + bool dumped; // Indicates if last argument has been externally read + bool ArgOk; // Indicated if last fetched argument could be read + char *current; // Pointer to current buffer position + char *last; // Pointer to previous buffer position + char prevChar; // Previous char (needed for unescaping) + Stream *comms; // Serial data stream + + char command_separator; // Character indicating end of command (default: ';') + char field_separator; // Character indicating end of argument (default: ',') + char escape_character; // Character indicating escaping of special chars + + messengerCallbackFunction default_callback; // default callback function + messengerCallbackFunction callbackList[MAXCALLBACKS]; // list of attached callback functions + + + // **** Initialize **** + + void init (Stream & comms, const char fld_separator, const char cmd_separator, const char esc_character); + void reset (); + + // **** Command processing **** + + inline uint8_t processLine (char serialChar) __attribute__((always_inline)); + inline void handleMessage() __attribute__((always_inline)); + inline bool blockedTillReply (unsigned long timeout = DEFAULT_TIMEOUT, int ackCmdId = 1) __attribute__((always_inline)); + inline bool CheckForAck (int AckCommand) __attribute__((always_inline)); + + // **** Command sending **** + + /** + * Print variable of type T binary in binary format + */ + template < class T > + void writeBin (const T & value) + { + const byte *bytePointer = (const byte *) (const void *) &value; + for (unsigned int i = 0; i < sizeof (value); i++) + { + printEsc (*bytePointer); + bytePointer++; + } + } + + // **** Command receiving **** + + int findNext (char *str, char delim); + + /** + * Read a variable of any type in binary format + */ + template < class T > + T readBin (char *str) + { + T value; + unescape (str); + byte *bytePointer = (byte *) (const void *) &value; + for (unsigned int i = 0; i < sizeof (value); i++) + { + *bytePointer = str[i]; + bytePointer++; + } + return value; + } + + template < class T > + T empty () + { + T value; + byte *bytePointer = (byte *) (const void *) &value; + for (unsigned int i = 0; i < sizeof (value); i++) + { + *bytePointer = '\0'; + bytePointer++; + } + return value; + } + + // **** Escaping tools **** + + char *split_r (char *str, const char delim, char **nextp); + bool isEscaped (char *currChar, const char escapeChar, char *lastChar); + + void printEsc (char *str); + void printEsc (char str); + +public: + + // ****** Public functions ****** + + // **** Initialization **** + + CmdMessenger (Stream & comms, const char fld_separator = ',', + const char cmd_separator = ';', + const char esc_character = '/'); + + void printLfCr (bool addNewLine=true); + void attach (messengerCallbackFunction newFunction); + void attach (byte msgId, messengerCallbackFunction newFunction); + + // **** Command processing **** + + void feedinSerialData (); + bool next (); + bool available (); + bool isArgOk (); + uint8_t CommandID (); + + // **** Command sending **** + + /** + * Send a command with a single argument of any type + * Note that the argument is sent as string + */ + template < class T > + bool sendCmd (int cmdId, T arg, bool reqAc = false, int ackCmdId = 1, + int timeout = DEFAULT_TIMEOUT) + { + if (!startCommand) { + sendCmdStart (cmdId); + sendCmdArg (arg); + return sendCmdEnd (reqAc, ackCmdId, timeout); + } + return false; + } + + /** + * Send a command with a single argument of any type + * Note that the argument is sent in binary format + */ + template < class T > + bool sendBinCmd (int cmdId, T arg, bool reqAc = false, int ackCmdId = 1, + int timeout = DEFAULT_TIMEOUT) + { + if (!startCommand) { + sendCmdStart (cmdId); + sendCmdBinArg (arg); + return sendCmdEnd (reqAc, ackCmdId, timeout); + } + return false; + } + + bool sendCmd (int cmdId); + bool sendCmd (int cmdId, bool reqAc, int ackCmdId ); + // **** Command sending with multiple arguments **** + + void sendCmdStart (int cmdId); + void sendCmdEscArg (char *arg); + void sendCmdfArg (char *fmt, ...); + bool sendCmdEnd (bool reqAc = false, int ackCmdId = 1, int timeout = DEFAULT_TIMEOUT); + + /** + * Send a single argument as string + * Note that this will only succeed if a sendCmdStart has been issued first + */ + template < class T > void sendCmdArg (T arg) + { + if (startCommand) { + comms->print (field_separator); + comms->print (arg); + } + } + + /** + * Send a single argument as string with custom accuracy + * Note that this will only succeed if a sendCmdStart has been issued first + */ + template < class T > void sendCmdArg (T arg, int n) + { + if (startCommand) { + comms->print (field_separator); + comms->print (arg, n); + } + } + + /** + * Send double argument in scientific format. + * This will overcome the boundary of normal d sending which is limited to abs(f) <= MAXLONG + */ + void sendCmdSciArg(double arg, int n=6); + + + /** + * Send a single argument in binary format + * Note that this will only succeed if a sendCmdStart has been issued first + */ + template < class T > void sendCmdBinArg (T arg) + { + if (startCommand) { + comms->print (field_separator); + writeBin (arg); + } + } + + // **** Command receiving **** + bool readBoolArg(); + int16_t readInt16Arg (); + int32_t readInt32Arg (); + char readCharArg (); + float readFloatArg (); + double readDoubleArg(); + char *readStringArg (); + void copyStringArg (char *string, uint8_t size); + uint8_t compareStringArg (char *string); + + /** + * Read an argument of any type in binary format + */ + template < class T > T readBinArg () + { + if (next ()) { + dumped = true; + return readBin < T > (current); + } else { + return empty < T > (); + } + } + + // **** Escaping tools **** + + void unescape (char *fromChar); + void printSci(double f, unsigned int digits); + + +}; +#endif diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/_cmd_messenger_8h_source.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/_cmd_messenger_8h_source.html new file mode 100644 index 0000000..5f5f32d --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/_cmd_messenger_8h_source.html @@ -0,0 +1,335 @@ + + + + + +CmdMessenger: D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CmdMessenger.h Source File + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a messaging library for the Arduino Platform. It has uses the serial port as its transport layer
+
+
+ + + + +
+
+
+
D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CmdMessenger.h
+
+
+
00001 /*
+00002   CmdMessenger - library that provides command based messaging
+00003 
+00004     Permission is hereby granted, free of charge, to any person obtaining
+00005     a copy of this software and associated documentation files (the
+00006     "Software"), to deal in the Software without restriction, including
+00007     without limitation the rights to use, copy, modify, merge, publish,
+00008     distribute, sublicense, and/or sell copies of the Software, and to
+00009     permit persons to whom the Software is furnished to do so, subject to
+00010     the following conditions:
+00011 
+00012     The above copyright notice and this permission notice shall be
+00013     included in all copies or substantial portions of the Software.
+00014 
+00015     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+00016     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+00017     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+00018     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+00019     LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+00020     OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+00021     WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+00022 
+00023  */
+00024 
+00025 #ifndef CmdMessenger_h
+00026 #define CmdMessenger_h
+00027 
+00028 #include <inttypes.h>
+00029 #if ARDUINO >= 100
+00030 #include <Arduino.h> 
+00031 #else
+00032 #include <WProgram.h> 
+00033 #endif
+00034 
+00035 //#include "Stream.h"
+00036 
+00037 extern "C"
+00038 {
+00039   // callback functions always follow the signature: void cmd(void);
+00040   typedef void (*messengerCallbackFunction) (void);
+00041 }
+00042 
+00043 #define MAXCALLBACKS        50   // The maximum number of commands   (default: 50)
+00044 #define MESSENGERBUFFERSIZE 64   // The length of the commandbuffer  (default: 64)
+00045 #define MAXSTREAMBUFFERSIZE 512  // The length of the streambuffer   (default: 64)
+00046 #define DEFAULT_TIMEOUT     5000 // Time out on unanswered messages. (default: 5s)
+00047 
+00048 // Message States
+00049 enum
+00050 {  
+00051   kProccesingMessage,            // Message is being received, not reached command separator
+00052   kEndOfMessage,                 // Message is fully received, reached command separator
+00053   kProcessingArguments,          // Message is received, arguments are being read parsed
+00054 };
+00055 
+00056 #define white_space(c) ((c) == ' ' || (c) == '\t')
+00057 #define valid_digit(c) ((c) >= '0' && (c) <= '9')
+00058 
+00059 class CmdMessenger
+00060 {
+00061 private:
+00062 
+00063   // **** Private variables *** 
+00064   
+00065   bool    startCommand;            // Indicates if sending of a command is underway
+00066   uint8_t lastCommandId;            // ID of last received command 
+00067   uint8_t bufferIndex;              // Index where to write data in buffer
+00068   uint8_t bufferLength;             // Is set to MESSENGERBUFFERSIZE
+00069   uint8_t bufferLastIndex;          // The last index of the buffer
+00070   char ArglastChar;                 // Bookkeeping of argument escape char 
+00071   char CmdlastChar;                 // Bookkeeping of command escape char 
+00072   bool pauseProcessing;             // pauses processing of new commands, during sending
+00073   bool print_newlines;              // Indicates if \r\n should be added after send command
+00074   char commandBuffer[MESSENGERBUFFERSIZE]; // Buffer that holds the data
+00075   char streamBuffer[MAXSTREAMBUFFERSIZE]; // Buffer that holds the data
+00076   uint8_t messageState;             // Current state of message processing
+00077   bool dumped;                      // Indicates if last argument has been externally read 
+00078   bool ArgOk;                       // Indicated if last fetched argument could be read
+00079   char *current;                    // Pointer to current buffer position
+00080   char *last;                       // Pointer to previous buffer position
+00081   char prevChar;                    // Previous char (needed for unescaping)
+00082   Stream *comms;                    // Serial data stream
+00083   
+00084   char command_separator;           // Character indicating end of command (default: ';')
+00085   char field_separator;             // Character indicating end of argument (default: ',')
+00086   char escape_character;            // Character indicating escaping of special chars
+00087     
+00088   messengerCallbackFunction default_callback;            // default callback function  
+00089   messengerCallbackFunction callbackList[MAXCALLBACKS];  // list of attached callback functions 
+00090   
+00091   
+00092   // **** Initialize ****
+00093   
+00094   void init (Stream & comms, const char fld_separator, const char cmd_separator, const char esc_character);
+00095   void reset ();
+00096   
+00097   // **** Command processing ****
+00098   
+00099   inline uint8_t processLine (char serialChar) __attribute__((always_inline));
+00100   inline void handleMessage() __attribute__((always_inline));
+00101   inline bool blockedTillReply (unsigned long timeout = DEFAULT_TIMEOUT, int ackCmdId = 1) __attribute__((always_inline));
+00102   inline bool CheckForAck (int AckCommand) __attribute__((always_inline));
+00103 
+00104   // **** Command sending ****
+00105    
+00109   template < class T > 
+00110     void writeBin (const T & value)
+00111   {
+00112     const byte *bytePointer = (const byte *) (const void *) &value;
+00113     for (unsigned int i = 0; i < sizeof (value); i++)
+00114       {
+00115         printEsc (*bytePointer); 
+00116         bytePointer++;
+00117       }
+00118   }
+00119     
+00120   // **** Command receiving ****
+00121   
+00122   int findNext (char *str, char delim);
+00123 
+00127   template < class T > 
+00128     T readBin (char *str)
+00129   {
+00130     T value;
+00131     unescape (str);
+00132     byte *bytePointer = (byte *) (const void *) &value;
+00133     for (unsigned int i = 0; i < sizeof (value); i++)
+00134       {
+00135         *bytePointer = str[i];
+00136         bytePointer++;
+00137       }
+00138     return value;
+00139   }
+00140   
+00141   template < class T > 
+00142     T empty ()
+00143   {
+00144     T value;
+00145     byte *bytePointer = (byte *) (const void *) &value;
+00146     for (unsigned int i = 0; i < sizeof (value); i++)
+00147       {
+00148         *bytePointer = '\0';
+00149         bytePointer++;
+00150       }
+00151     return value;
+00152   }
+00153   
+00154   // **** Escaping tools ****
+00155   
+00156   char *split_r (char *str, const char delim, char **nextp);
+00157   bool isEscaped (char *currChar, const char escapeChar, char *lastChar);
+00158   
+00159   void printEsc (char *str);
+00160   void printEsc (char str); 
+00161   
+00162 public:
+00163 
+00164   // ****** Public functions ******
+00165 
+00166   // **** Initialization ****
+00167   
+00168   CmdMessenger (Stream & comms, const char fld_separator = ',', 
+00169                 const char cmd_separator = ';', 
+00170                 const char esc_character = '/');
+00171   
+00172   void printLfCr (bool addNewLine=true);
+00173   void attach (messengerCallbackFunction newFunction);
+00174   void attach (byte msgId, messengerCallbackFunction newFunction);
+00175   
+00176   // **** Command processing ****
+00177   
+00178   void feedinSerialData ();
+00179   bool next ();
+00180   bool available ();
+00181   bool isArgOk ();
+00182   uint8_t CommandID ();
+00183   
+00184   // ****  Command sending ****
+00185   
+00190   template < class T >
+00191     bool sendCmd (int cmdId, T arg, bool reqAc = false, int ackCmdId = 1, 
+00192                   int timeout = DEFAULT_TIMEOUT)
+00193   {
+00194     if (!startCommand) {
+00195         sendCmdStart (cmdId);
+00196         sendCmdArg (arg);
+00197         return sendCmdEnd (reqAc, ackCmdId, timeout);
+00198     }
+00199     return false;
+00200   }
+00201 
+00206   template < class T >
+00207     bool sendBinCmd (int cmdId, T arg, bool reqAc = false, int ackCmdId = 1,
+00208                      int timeout = DEFAULT_TIMEOUT)
+00209   {
+00210     if (!startCommand) {
+00211         sendCmdStart (cmdId);
+00212         sendCmdBinArg (arg);
+00213         return sendCmdEnd (reqAc, ackCmdId, timeout);
+00214     }
+00215     return false;
+00216   }
+00217 
+00218   bool sendCmd (int cmdId);
+00219   bool sendCmd (int cmdId, bool reqAc, int ackCmdId );
+00220   // **** Command sending with multiple arguments ****
+00221   
+00222   void sendCmdStart (int cmdId);
+00223   void sendCmdEscArg (char *arg);
+00224   void sendCmdfArg (char *fmt, ...);
+00225   bool sendCmdEnd (bool reqAc = false, int ackCmdId = 1, int timeout = DEFAULT_TIMEOUT);
+00226   
+00231   template < class T > void sendCmdArg (T arg)
+00232   {
+00233     if (startCommand) {
+00234         comms->print (field_separator);
+00235         comms->print (arg);
+00236     }
+00237   }
+00238     
+00243   template < class T > void sendCmdArg (T arg, int n)
+00244   {
+00245     if (startCommand) {
+00246         comms->print (field_separator);
+00247         comms->print (arg, n);
+00248     }
+00249   }
+00250   
+00255   void sendCmdSciArg(double arg, int n=6);
+00256 
+00257   
+00262   template < class T > void sendCmdBinArg (T arg)
+00263   {
+00264     if (startCommand) {
+00265         comms->print (field_separator);
+00266         writeBin (arg);
+00267     }
+00268   }  
+00269 
+00270   // **** Command receiving ****
+00271   bool readBoolArg();
+00272   int16_t readInt16Arg ();
+00273   int32_t readInt32Arg ();
+00274   char readCharArg ();
+00275   float readFloatArg ();
+00276   double readDoubleArg();
+00277   char *readStringArg ();
+00278   void copyStringArg (char *string, uint8_t size);
+00279   uint8_t compareStringArg (char *string);
+00280  
+00284   template < class T > T readBinArg ()
+00285   {
+00286     if (next ()) {
+00287         dumped = true;      
+00288         return readBin < T > (current);
+00289     } else {
+00290         return empty < T > ();
+00291     }
+00292   }
+00293 
+00294   // **** Escaping tools ****
+00295   
+00296   void unescape (char *fromChar);   
+00297   void printSci(double f, unsigned int digits);  
+00298   
+00299   
+00300 };
+00301 #endif
+
+ + + + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/annotated.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/annotated.html new file mode 100644 index 0000000..6551d7a --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/annotated.html @@ -0,0 +1,72 @@ + + + + + +CmdMessenger: Class List + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a messaging library for the Arduino Platform. It has uses the serial port as its transport layer
+
+
+ + + + +
+
+
+
Class List
+
+
+
Here are the classes, structs, unions and interfaces with brief descriptions:
+ +
CmdMessenger
+
+ + + + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/bc_s.png b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/bc_s.png new file mode 100644 index 0000000..51ba006 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/bc_s.png Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/bdwn.png b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/bdwn.png new file mode 100644 index 0000000..940a0b9 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/bdwn.png Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_cmd_messenger-members.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_cmd_messenger-members.html new file mode 100644 index 0000000..44d548d --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_cmd_messenger-members.html @@ -0,0 +1,103 @@ + + + + + +CmdMessenger: Member List + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a messaging library for the Arduino Platform. It has uses the serial port as its transport layer
+
+
+ + + + +
+
+
+
CmdMessenger Member List
+
+
+This is the complete list of members for CmdMessenger, including all inherited members. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
attach(messengerCallbackFunction newFunction)CmdMessenger
attach(byte msgId, messengerCallbackFunction newFunction)CmdMessenger
available()CmdMessenger
CmdMessenger(Stream &comms, const char fld_separator= ',', const char cmd_separator= ';', const char esc_character= '/')CmdMessenger
CommandID()CmdMessenger
compareStringArg(char *string)CmdMessenger
copyStringArg(char *string, uint8_t size)CmdMessenger
feedinSerialData()CmdMessenger
isArgOk()CmdMessenger
next()CmdMessenger
printLfCr(bool addNewLine=true)CmdMessenger
printSci(double f, unsigned int digits)CmdMessenger
readBinArg()CmdMessenger [inline]
readBoolArg()CmdMessenger
readCharArg()CmdMessenger
readDoubleArg()CmdMessenger
readFloatArg()CmdMessenger
readInt16Arg()CmdMessenger
readInt32Arg()CmdMessenger
readStringArg()CmdMessenger
sendBinCmd(int cmdId, T arg, bool reqAc=false, int ackCmdId=1, int timeout=5000)CmdMessenger [inline]
sendCmd(int cmdId, T arg, bool reqAc=false, int ackCmdId=1, int timeout=5000)CmdMessenger [inline]
sendCmd(int cmdId)CmdMessenger
sendCmd(int cmdId, bool reqAc, int ackCmdId)CmdMessenger
sendCmdArg(T arg)CmdMessenger [inline]
sendCmdArg(T arg, int n)CmdMessenger [inline]
sendCmdBinArg(T arg)CmdMessenger [inline]
sendCmdEnd(bool reqAc=false, int ackCmdId=1, int timeout=5000)CmdMessenger
sendCmdEscArg(char *arg)CmdMessenger
sendCmdfArg(char *fmt,...)CmdMessenger
sendCmdSciArg(double arg, int n=6)CmdMessenger
sendCmdStart(int cmdId)CmdMessenger
unescape(char *fromChar)CmdMessenger
+ + + + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_cmd_messenger.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_cmd_messenger.html new file mode 100644 index 0000000..93d825f --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_cmd_messenger.html @@ -0,0 +1,930 @@ + + + + + +CmdMessenger: CmdMessenger Class Reference + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a messaging library for the Arduino Platform. It has uses the serial port as its transport layer
+
+
+ + + + +
+
+ +
+
CmdMessenger Class Reference
+
+
+ +

List of all members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 CmdMessenger (Stream &comms, const char fld_separator= ',', const char cmd_separator= ';', const char esc_character= '/')
void printLfCr (bool addNewLine=true)
void attach (messengerCallbackFunction newFunction)
void attach (byte msgId, messengerCallbackFunction newFunction)
void feedinSerialData ()
bool next ()
bool available ()
bool isArgOk ()
uint8_t CommandID ()
template<class T >
bool sendCmd (int cmdId, T arg, bool reqAc=false, int ackCmdId=1, int timeout=5000)
template<class T >
bool sendBinCmd (int cmdId, T arg, bool reqAc=false, int ackCmdId=1, int timeout=5000)
bool sendCmd (int cmdId)
bool sendCmd (int cmdId, bool reqAc, int ackCmdId)
void sendCmdStart (int cmdId)
void sendCmdEscArg (char *arg)
void sendCmdfArg (char *fmt,...)
bool sendCmdEnd (bool reqAc=false, int ackCmdId=1, int timeout=5000)
template<class T >
void sendCmdArg (T arg)
template<class T >
void sendCmdArg (T arg, int n)
void sendCmdSciArg (double arg, int n=6)
template<class T >
void sendCmdBinArg (T arg)
bool readBoolArg ()
int16_t readInt16Arg ()
int32_t readInt32Arg ()
char readCharArg ()
float readFloatArg ()
double readDoubleArg ()
char * readStringArg ()
void copyStringArg (char *string, uint8_t size)
uint8_t compareStringArg (char *string)
template<class T >
readBinArg ()
void unescape (char *fromChar)
void printSci (double f, unsigned int digits)
+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CmdMessenger::CmdMessenger (Stream & ccomms,
const char fld_separator = ',',
const char cmd_separator = ';',
const char esc_character = '/' 
)
+
+
+

CmdMessenger constructor

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + + + + +
void CmdMessenger::attach (messengerCallbackFunction newFunction)
+
+
+

Attaches an default function for commands that are not explicitly attached

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
void CmdMessenger::attach (byte msgId,
messengerCallbackFunction newFunction 
)
+
+
+

Attaches a function to a command ID

+ +
+
+ +
+
+ + + + + + + +
bool CmdMessenger::available ()
+
+
+

Returns if an argument is available. Alias for next()

+ +

References next().

+ +
+
+ +
+
+ + + + + + + +
uint8_t CmdMessenger::CommandID ()
+
+
+

Returns the CommandID of the current command

+ +
+
+ +
+
+ + + + + + + + +
uint8_t CmdMessenger::compareStringArg (char * string)
+
+
+

Compare the next argument with a string

+ +

References next().

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
void CmdMessenger::copyStringArg (char * string,
uint8_t size 
)
+
+
+

Return next argument as a new string Note that this is useful if the string needs to be persisted

+ +

References next().

+ +
+
+ +
+
+ + + + + + + +
void CmdMessenger::feedinSerialData ()
+
+
+

Feeds serial data in CmdMessenger

+ +
+
+ +
+
+ + + + + + + +
bool CmdMessenger::isArgOk ()
+
+
+

Returns if the latest argument is well formed.

+ +
+
+ +
+
+ + + + + + + +
bool CmdMessenger::next ()
+
+
+

Gets next argument. Returns true if an argument is available

+ +

Referenced by available(), compareStringArg(), copyStringArg(), readCharArg(), readDoubleArg(), readFloatArg(), readInt16Arg(), readInt32Arg(), and readStringArg().

+ +
+
+ +
+
+ + + + + + + + +
void CmdMessenger::printLfCr (bool addNewLine = true)
+
+
+

Enables printing newline after a sent command

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
void CmdMessenger::printSci (double f,
unsigned int digits 
)
+
+
+

Print float and double in scientific format

+ +

Referenced by sendCmdSciArg().

+ +
+
+ +
+
+
+template<class T >
+ + + + + + + +
T CmdMessenger::readBinArg () [inline]
+
+
+

Read an argument of any type in binary format

+ +
+
+ +
+
+ + + + + + + +
bool CmdMessenger::readBoolArg ()
+
+
+

Read the next argument as bool

+ +

References readInt16Arg().

+ +
+
+ +
+
+ + + + + + + +
char CmdMessenger::readCharArg ()
+
+
+

Read the next argument as char

+ +

References next().

+ +
+
+ +
+
+ + + + + + + +
double CmdMessenger::readDoubleArg ()
+
+
+

Read the next argument as double

+ +

References next().

+ +
+
+ +
+
+ + + + + + + +
float CmdMessenger::readFloatArg ()
+
+
+

Read the next argument as float

+ +

References next().

+ +
+
+ +
+
+ + + + + + + +
int16_t CmdMessenger::readInt16Arg ()
+
+
+

Read the next argument as int

+ +

References next().

+ +

Referenced by readBoolArg().

+ +
+
+ +
+
+ + + + + + + +
int32_t CmdMessenger::readInt32Arg ()
+
+
+

Read the next argument as int

+ +

References next().

+ +
+
+ +
+
+ + + + + + + +
char * CmdMessenger::readStringArg ()
+
+
+

Read next argument as string. Note that the String is valid until the current command is replaced

+ +

References next().

+ +
+
+ +
+
+
+template<class T >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bool CmdMessenger::sendBinCmd (int cmdId,
arg,
bool reqAc = false,
int ackCmdId = 1,
int timeout = 5000 
) [inline]
+
+
+

Send a command with a single argument of any type Note that the argument is sent in binary format

+ +

References sendCmdBinArg(), sendCmdEnd(), and sendCmdStart().

+ +
+
+ +
+
+
+template<class T >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bool CmdMessenger::sendCmd (int cmdId,
arg,
bool reqAc = false,
int ackCmdId = 1,
int timeout = 5000 
) [inline]
+
+
+

Send a command with a single argument of any type Note that the argument is sent as string

+ +

References sendCmdArg(), sendCmdEnd(), and sendCmdStart().

+ +
+
+ +
+
+ + + + + + + + +
bool CmdMessenger::sendCmd (int cmdId)
+
+
+

Send a command without arguments, without acknowledge

+ +

References sendCmdEnd(), and sendCmdStart().

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
bool CmdMessenger::sendCmd (int cmdId,
bool reqAc,
int ackCmdId 
)
+
+
+

Send a command without arguments, with acknowledge

+ +

References sendCmdEnd(), and sendCmdStart().

+ +
+
+ +
+
+
+template<class T >
+ + + + + + + + +
void CmdMessenger::sendCmdArg (arg) [inline]
+
+
+

Send a single argument as string Note that this will only succeed if a sendCmdStart has been issued first

+ +

Referenced by sendCmd().

+ +
+
+ +
+
+
+template<class T >
+ + + + + + + + + + + + + + + + + + +
void CmdMessenger::sendCmdArg (arg,
int n 
) [inline]
+
+
+

Send a single argument as string with custom accuracy Note that this will only succeed if a sendCmdStart has been issued first

+ +
+
+ +
+
+
+template<class T >
+ + + + + + + + +
void CmdMessenger::sendCmdBinArg (arg) [inline]
+
+
+

Send a single argument in binary format Note that this will only succeed if a sendCmdStart has been issued first

+ +

Referenced by sendBinCmd().

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
bool CmdMessenger::sendCmdEnd (bool reqAc = false,
int ackCmdId = 1,
int timeout = 5000 
)
+
+
+

Send end of command

+ +

Referenced by sendBinCmd(), and sendCmd().

+ +
+
+ +
+
+ + + + + + + + +
void CmdMessenger::sendCmdEscArg (char * arg)
+
+
+

Send an escaped command argument

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
void CmdMessenger::sendCmdfArg (char * fmt,
 ... 
)
+
+
+

Send formatted argument. Note that floating points are not supported and resulting string is limited to 128 chars

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
void CmdMessenger::sendCmdSciArg (double arg,
int n = 6 
)
+
+
+

Send double argument in scientific format. This will overcome the boundary of normal d sending which is limited to abs(f) <= MAXLONG

+

Send double argument in scientific format. This will overcome the boundary of normal float sending which is limited to abs(f) <= MAXLONG

+ +

References printSci().

+ +
+
+ +
+
+ + + + + + + + +
void CmdMessenger::sendCmdStart (int cmdId)
+
+
+

Send start of command. This makes it easy to send multiple arguments per command

+ +

Referenced by sendBinCmd(), and sendCmd().

+ +
+
+ +
+
+ + + + + + + + +
void CmdMessenger::unescape (char * fromChar)
+
+
+

Unescapes a string Note that this is done inline

+ +
+
+
The documentation for this class was generated from the following files:
    +
  • D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CmdMessenger.h
  • +
  • D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CmdMessenger.cpp
  • +
+
+ + + + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_binary_converter-members.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_binary_converter-members.html new file mode 100644 index 0000000..6003850 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_binary_converter-members.html @@ -0,0 +1,85 @@ + + + + + + +CmdMessenger: Member List + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+
+
CommandMessenger.BinaryConverter Member List
+
+
+ +

This is the complete list of members for CommandMessenger.BinaryConverter, including all inherited members.

+ + + + + + + + + + + + + + + + + +
EscapedStringToBytes(String value)CommandMessenger.BinaryConverterinlinestatic
setCommandMessenger.BinaryConverter
ToByte(String value)CommandMessenger.BinaryConverterinlinestatic
ToDouble(String value)CommandMessenger.BinaryConverterinlinestatic
ToFloat(String value)CommandMessenger.BinaryConverterinlinestatic
ToInt16(String value)CommandMessenger.BinaryConverterinlinestatic
ToInt32(String value)CommandMessenger.BinaryConverterinlinestatic
ToString(Single value)CommandMessenger.BinaryConverterinlinestatic
ToString(Double value)CommandMessenger.BinaryConverterinlinestatic
ToString(int value)CommandMessenger.BinaryConverterinlinestatic
ToString(uint value)CommandMessenger.BinaryConverterinlinestatic
ToString(short value)CommandMessenger.BinaryConverterinlinestatic
ToString(ushort value)CommandMessenger.BinaryConverterinlinestatic
ToString(byte value)CommandMessenger.BinaryConverterinlinestatic
ToUInt16(String value)CommandMessenger.BinaryConverterinlinestatic
ToUInt32(String value)CommandMessenger.BinaryConverterinlinestatic
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_binary_converter.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_binary_converter.html new file mode 100644 index 0000000..4eda953 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_binary_converter.html @@ -0,0 +1,827 @@ + + + + + + +CmdMessenger: CommandMessenger.BinaryConverter Class Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+ +
+
CommandMessenger.BinaryConverter Class Reference
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Static Public Member Functions

static string ToString (Single value)
 Convert a float into a string representation. More...
 
static string ToString (Double value)
 Convert a Double into a string representation. More...
 
static string ToString (int value)
 Convert an int into a string representation. More...
 
static string ToString (uint value)
 Convert an unsigned int into a string representation. More...
 
static string ToString (short value)
 Convert a short into a string representation. More...
 
static string ToString (ushort value)
 Convert an unsigned an unsigned short into a string representation. More...
 
static string ToString (byte value)
 Convert a byte into a string representation. More...
 
static Single ToFloat (String value)
 Converts a string to a float. More...
 
static Double ToDouble (String value)
 Converts a string representation to a double. More...
 
static Int32 ToInt32 (String value)
 Converts a string representation to an int 32. More...
 
static UInt32 ToUInt32 (String value)
 Converts a string representation to a u int 32. More...
 
static UInt16 ToUInt16 (String value)
 Converts a string representation to a u int 16. More...
 
static Int16 ToInt16 (String value)
 Converts a string representation to an int 16. More...
 
static byte ToByte (String value)
 Converts a string representation to a byte. More...
 
static byte[] EscapedStringToBytes (String value)
 Converts an escaped string to a bytes array. More...
 
+ + + + +

+Properties

Encoding StringEncoder set
 Sets the string encoder. More...
 
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + + +
static byte [] CommandMessenger.BinaryConverter.EscapedStringToBytes (String value)
+
+inlinestatic
+
+ +

Converts an escaped string to a bytes array.

+
Parameters
+ + +
valueThe value to be converted.
+
+
+
Returns
input value as an escaped string.
+ +

Referenced by CommandMessenger.BinaryConverter.ToByte(), CommandMessenger.BinaryConverter.ToDouble(), CommandMessenger.BinaryConverter.ToFloat(), CommandMessenger.BinaryConverter.ToInt16(), CommandMessenger.BinaryConverter.ToInt32(), CommandMessenger.BinaryConverter.ToUInt16(), and CommandMessenger.BinaryConverter.ToUInt32().

+
267  {
+
268  try
+
269  {
+
270  string unEscapedValue = Escaping.Unescape(value);
+
271  return _stringEncoder.GetBytes(unEscapedValue);
+
272  }
+
273  catch (Exception)
+
274  {
+
275  return null;
+
276  }
+
277  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
static byte CommandMessenger.BinaryConverter.ToByte (String value)
+
+inlinestatic
+
+ +

Converts a string representation to a byte.

+
Parameters
+ + +
valueThe value to be converted.
+
+
+
Returns
Input string as a byte?
+ +

References CommandMessenger.BinaryConverter.EscapedStringToBytes().

+
233  {
+
234  try
+
235  {
+
236  byte[] bytes = EscapedStringToBytes(value);
+
237  return bytes[0];
+
238  }
+
239  catch (Exception)
+
240  {
+
241  return null;
+
242  }
+
243  }
+
static byte[] EscapedStringToBytes(String value)
Converts an escaped string to a bytes array.
Definition: BinaryConverter.cs:266
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
static Double CommandMessenger.BinaryConverter.ToDouble (String value)
+
+inlinestatic
+
+ +

Converts a string representation to a double.

+
Parameters
+ + +
valueThe value to be converted.
+
+
+
Returns
Input string as a Double?
+ +

References CommandMessenger.BinaryConverter.EscapedStringToBytes().

+
153  {
+
154  try
+
155  {
+
156  byte[] bytes = EscapedStringToBytes(value);
+
157  return BitConverter.ToDouble(bytes, 0);
+
158  }
+
159  catch (Exception)
+
160  {
+
161  return null;
+
162  }
+
163  }
+
static byte[] EscapedStringToBytes(String value)
Converts an escaped string to a bytes array.
Definition: BinaryConverter.cs:266
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
static Single CommandMessenger.BinaryConverter.ToFloat (String value)
+
+inlinestatic
+
+ +

Converts a string to a float.

+
Parameters
+ + +
valueThe value to be converted.
+
+
+
Returns
Input string as a Single?
+ +

References CommandMessenger.BinaryConverter.EscapedStringToBytes().

+
137  {
+
138  try
+
139  {
+
140  byte[] bytes = EscapedStringToBytes(value);
+
141  return BitConverter.ToSingle(bytes, 0);
+
142  }
+
143  catch (Exception)
+
144  {
+
145  return null;
+
146  }
+
147  }
+
static byte[] EscapedStringToBytes(String value)
Converts an escaped string to a bytes array.
Definition: BinaryConverter.cs:266
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
static Int16 CommandMessenger.BinaryConverter.ToInt16 (String value)
+
+inlinestatic
+
+ +

Converts a string representation to an int 16.

+
Parameters
+ + +
valueThe value to be converted.
+
+
+
Returns
This object as an Int16?
+ +

References CommandMessenger.BinaryConverter.EscapedStringToBytes().

+
217  {
+
218  try
+
219  {
+
220  byte[] bytes = EscapedStringToBytes(value);
+
221  return BitConverter.ToInt16(bytes, 0);
+
222  }
+
223  catch (Exception)
+
224  {
+
225  return null;
+
226  }
+
227  }
+
static byte[] EscapedStringToBytes(String value)
Converts an escaped string to a bytes array.
Definition: BinaryConverter.cs:266
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
static Int32 CommandMessenger.BinaryConverter.ToInt32 (String value)
+
+inlinestatic
+
+ +

Converts a string representation to an int 32.

+
Parameters
+ + +
valueThe value to be converted.
+
+
+
Returns
This object as an Int32?
+ +

References CommandMessenger.BinaryConverter.EscapedStringToBytes().

+
169  {
+
170  try
+
171  {
+
172  byte[] bytes = EscapedStringToBytes(value);
+
173  return BitConverter.ToInt32(bytes, 0);
+
174  }
+
175  catch (Exception)
+
176  {
+
177  return null;
+
178  }
+
179  }
+
static byte[] EscapedStringToBytes(String value)
Converts an escaped string to a bytes array.
Definition: BinaryConverter.cs:266
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
static string CommandMessenger.BinaryConverter.ToString (Single value)
+
+inlinestatic
+
+ +

Convert a float into a string representation.

+
Parameters
+ + +
valueThe value to be converted.
+
+
+
Returns
A string representation of this object.
+
23  {
+
24  try
+
25  {
+
26  byte[] byteArray = BitConverter.GetBytes(value);
+
27  return BytesToEscapedString(byteArray);
+
28  }
+
29  catch (Exception)
+
30  {
+
31  return null;
+
32  }
+
33  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
static string CommandMessenger.BinaryConverter.ToString (Double value)
+
+inlinestatic
+
+ +

Convert a Double into a string representation.

+
Parameters
+ + +
valueThe value to be converted.
+
+
+
Returns
A string representation of this object.
+
39  {
+
40  try
+
41  {
+
42  byte[] byteArray = BitConverter.GetBytes(value);
+
43  return BytesToEscapedString(byteArray);
+
44  }
+
45  catch (Exception)
+
46  {
+
47  return null;
+
48  }
+
49  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
static string CommandMessenger.BinaryConverter.ToString (int value)
+
+inlinestatic
+
+ +

Convert an int into a string representation.

+
Parameters
+ + +
valueThe value to be converted.
+
+
+
Returns
A string representation of this object.
+
55  {
+
56  try
+
57  {
+
58  byte[] byteArray = BitConverter.GetBytes(value);
+
59  return BytesToEscapedString(byteArray);
+
60  }
+
61  catch (Exception)
+
62  {
+
63  return null;
+
64  }
+
65  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
static string CommandMessenger.BinaryConverter.ToString (uint value)
+
+inlinestatic
+
+ +

Convert an unsigned int into a string representation.

+
Parameters
+ + +
valueThe value to be converted.
+
+
+
Returns
A string representation of this object.
+
71  {
+
72  try
+
73  {
+
74  byte[] byteArray = BitConverter.GetBytes(value);
+
75  return BytesToEscapedString(byteArray);
+
76  }
+
77  catch (Exception)
+
78  {
+
79  return null;
+
80  }
+
81  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
static string CommandMessenger.BinaryConverter.ToString (short value)
+
+inlinestatic
+
+ +

Convert a short into a string representation.

+
Parameters
+ + +
valueThe value to be converted.
+
+
+
Returns
A string representation of this object.
+
87  {
+
88  try
+
89  {
+
90  byte[] byteArray = BitConverter.GetBytes(value);
+
91  return BytesToEscapedString(byteArray);
+
92  }
+
93  catch (Exception)
+
94  {
+
95  return null;
+
96  }
+
97  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
static string CommandMessenger.BinaryConverter.ToString (ushort value)
+
+inlinestatic
+
+ +

Convert an unsigned an unsigned short into a string representation.

+
Parameters
+ + +
valueThe value to be converted.
+
+
+
Returns
A string representation of this object.
+
103  {
+
104  try
+
105  {
+
106  byte[] byteArray = BitConverter.GetBytes(value);
+
107  return BytesToEscapedString(byteArray);
+
108  }
+
109  catch (Exception)
+
110  {
+
111  return null;
+
112  }
+
113  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
static string CommandMessenger.BinaryConverter.ToString (byte value)
+
+inlinestatic
+
+ +

Convert a byte into a string representation.

+
Parameters
+ + +
valueThe value to be converted.
+
+
+
Returns
A string representation of this object.
+
119  {
+
120  try
+
121  {
+
122  return BytesToEscapedString(new byte[] {value});
+
123  }
+
124  catch (Exception)
+
125  {
+
126  return null;
+
127  }
+
128  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
static UInt16 CommandMessenger.BinaryConverter.ToUInt16 (String value)
+
+inlinestatic
+
+ +

Converts a string representation to a u int 16.

+
Parameters
+ + +
valueThe value to be converted.
+
+
+
Returns
Input string as a UInt16?
+ +

References CommandMessenger.BinaryConverter.EscapedStringToBytes().

+
201  {
+
202  try
+
203  {
+
204  byte[] bytes = EscapedStringToBytes(value);
+
205  return BitConverter.ToUInt16(bytes, 0);
+
206  }
+
207  catch (Exception)
+
208  {
+
209  return null;
+
210  }
+
211  }
+
static byte[] EscapedStringToBytes(String value)
Converts an escaped string to a bytes array.
Definition: BinaryConverter.cs:266
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
static UInt32 CommandMessenger.BinaryConverter.ToUInt32 (String value)
+
+inlinestatic
+
+ +

Converts a string representation to a u int 32.

+
Parameters
+ + +
valueThe value to be converted.
+
+
+
Returns
Input string as a UInt32?
+ +

References CommandMessenger.BinaryConverter.EscapedStringToBytes().

+
185  {
+
186  try
+
187  {
+
188  byte[] bytes = EscapedStringToBytes(value);
+
189  return BitConverter.ToUInt32(bytes, 0);
+
190  }
+
191  catch (Exception)
+
192  {
+
193  return null;
+
194  }
+
195  }
+
static byte[] EscapedStringToBytes(String value)
Converts an escaped string to a bytes array.
Definition: BinaryConverter.cs:266
+
+
+
+

Property Documentation

+ +
+
+ + + + +
Encoding StringEncoder CommandMessenger.BinaryConverter.set
+
+ +

Sets the string encoder.

+

The string encoder.

+ +
+
+
The documentation for this class was generated from the following file:
    +
  • D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CSharp/CommandMessenger/BinaryConverter.cs
  • +
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_cmd_messenger-members.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_cmd_messenger-members.html new file mode 100644 index 0000000..5e6740f --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_cmd_messenger-members.html @@ -0,0 +1,96 @@ + + + + + + +CmdMessenger: Member List + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+
+
CommandMessenger.CmdMessenger Member List
+
+
+ +

This is the complete list of members for CommandMessenger.CmdMessenger, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Attach(MessengerCallbackFunction newFunction)CommandMessenger.CmdMessengerinline
Attach(int messageId, MessengerCallbackFunction newFunction)CommandMessenger.CmdMessengerinline
CmdMessenger(SerialPortManager communications)CommandMessenger.CmdMessengerinline
CmdMessenger(SerialPortManager communications, char fieldSeparator)CommandMessenger.CmdMessengerinline
CmdMessenger(SerialPortManager communications, char fieldSeparator, char commandSeparator)CommandMessenger.CmdMessengerinline
CmdMessenger(SerialPortManager communications, char fieldSeparator, char commandSeparator, char escapeCharacter)CommandMessenger.CmdMessengerinline
CurrentReceivedCommandCommandMessenger.CmdMessenger
CurrentReceivedLineCommandMessenger.CmdMessenger
CurrentSentLineCommandMessenger.CmdMessenger
Dispose()CommandMessenger.CmdMessengerinline
Dispose(bool disposing)CommandMessenger.CmdMessengerinlineprotectedvirtual
HandleMessage(ReceivedCommand receivedCommand)CommandMessenger.CmdMessengerinline
LastLineTimeStampCommandMessenger.CmdMessenger
MessengerCallbackFunction(ReceivedCommand receivedCommand)CommandMessenger.CmdMessenger
NewLineReceived (defined in CommandMessenger.CmdMessenger)CommandMessenger.CmdMessenger
NewLineSent (defined in CommandMessenger.CmdMessenger)CommandMessenger.CmdMessenger
NewLinesReceived (defined in CommandMessenger.CmdMessenger)CommandMessenger.CmdMessenger
PrintLfCrCommandMessenger.CmdMessenger
ProcessLines()CommandMessenger.CmdMessengerinline
SendCommand(int cmdId)CommandMessenger.CmdMessengerinline
SendCommand(int cmdId, string argument)CommandMessenger.CmdMessengerinline
SendCommand(SendCommand sendCommand)CommandMessenger.CmdMessengerinline
SendCommand(int cmdId, string argument, bool reqAc, int ackCmdId, int timeout)CommandMessenger.CmdMessengerinline
SendCommand(int cmdId, string[] arguments, bool reqAc, int ackCmdId, int timeout)CommandMessenger.CmdMessengerinline
SetControlToInvokeOn(Control controlToInvokeOn)CommandMessenger.CmdMessengerinline
StartListening()CommandMessenger.CmdMessengerinline
StopListening()CommandMessenger.CmdMessengerinline
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_cmd_messenger.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_cmd_messenger.html new file mode 100644 index 0000000..1284aa4 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_cmd_messenger.html @@ -0,0 +1,1186 @@ + + + + + + +CmdMessenger: CommandMessenger.CmdMessenger Class Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+ +
+
CommandMessenger.CmdMessenger Class Reference
+
+
+ +

Command messenger main class + More...

+
+Inheritance diagram for CommandMessenger.CmdMessenger:
+
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

delegate void MessengerCallbackFunction (ReceivedCommand receivedCommand)
 Definition of the messenger callback function. More...
 
 CmdMessenger (SerialPortManager communications)
 Constructor. More...
 
 CmdMessenger (SerialPortManager communications, char fieldSeparator)
 Constructor. More...
 
 CmdMessenger (SerialPortManager communications, char fieldSeparator, char commandSeparator)
 Constructor. More...
 
 CmdMessenger (SerialPortManager communications, char fieldSeparator, char commandSeparator, char escapeCharacter)
 Constructor. More...
 
void SetControlToInvokeOn (Control controlToInvokeOn)
 Sets a control to invoke on. More...
 
bool StopListening ()
 Stop listening and end serial port connection. More...
 
bool StartListening ()
 Starts serial port connection and start listening. More...
 
void Attach (MessengerCallbackFunction newFunction)
 Attaches default callback for unsupported commands. More...
 
void Attach (int messageId, MessengerCallbackFunction newFunction)
 Attaches default callback for certain Message ID. More...
 
void ProcessLines ()
 Process the command lines and invokes callbacks. More...
 
void HandleMessage (ReceivedCommand receivedCommand)
 Handle message. More...
 
ReceivedCommand SendCommand (int cmdId)
 Sends a command. More...
 
ReceivedCommand SendCommand (int cmdId, string argument)
 Sends a command. More...
 
ReceivedCommand SendCommand (SendCommand sendCommand)
 Sends a command. More...
 
ReceivedCommand SendCommand (int cmdId, string argument, bool reqAc, int ackCmdId, int timeout)
 Sends a command. More...
 
ReceivedCommand SendCommand (int cmdId, string[] arguments, bool reqAc, int ackCmdId, int timeout)
 Sends a command. More...
 
void Dispose ()
 Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. More...
 
+ + + + + + + +

+Public Attributes

+EventHandler NewLinesReceived
 
+EventHandler NewLineReceived
 
+EventHandler NewLineSent
 
+ + + + +

+Protected Member Functions

virtual void Dispose (bool disposing)
 Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. More...
 
+ + + + + + + + + + + + + + + + +

+Properties

bool PrintLfCr [get, set]
 Gets or sets a whether to print a line feed carriage return after each command. More...
 
String CurrentReceivedLine [get, set]
 Gets or sets the current received command line. More...
 
ReceivedCommand CurrentReceivedCommand [get, set]
 Gets or sets the current received command. More...
 
String CurrentSentLine [get, set]
 Gets or sets the currently sent line. More...
 
long LastLineTimeStamp [get, set]
 Gets or sets the time stamp of the last command line received. More...
 
+

Detailed Description

+

Command messenger main class

+

Constructor & Destructor Documentation

+ +
+
+ + + + + +
+ + + + + + + + +
CommandMessenger.CmdMessenger.CmdMessenger (SerialPortManager communications)
+
+inline
+
+ +

Constructor.

+
Parameters
+ + +
communicationsThe Serial port object.
+
+
+
73  {
+
74  Init(communications, ',', ';', '/');
+
75  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
CommandMessenger.CmdMessenger.CmdMessenger (SerialPortManager communications,
char fieldSeparator 
)
+
+inline
+
+ +

Constructor.

+
Parameters
+ + + +
communicationsThe Serial port object.
fieldSeparatorThe field separator.
+
+
+
81  {
+
82  Init(communications, fieldSeparator, ';', '/');
+
83  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
CommandMessenger.CmdMessenger.CmdMessenger (SerialPortManager communications,
char fieldSeparator,
char commandSeparator 
)
+
+inline
+
+ +

Constructor.

+
Parameters
+ + + + +
communicationsThe Serial port object.
fieldSeparatorThe field separator.
commandSeparatorThe command separator.
+
+
+
90  {
+
91  Init(communications, fieldSeparator, commandSeparator, commandSeparator);
+
92  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CommandMessenger.CmdMessenger.CmdMessenger (SerialPortManager communications,
char fieldSeparator,
char commandSeparator,
char escapeCharacter 
)
+
+inline
+
+ +

Constructor.

+
Parameters
+ + + + + +
communicationsThe Serial port object.
fieldSeparatorThe field separator.
commandSeparatorThe command separator.
escapeCharacterThe escape character.
+
+
+
101  {
+
102  Init(communications, fieldSeparator, commandSeparator, escapeCharacter);
+
103  }
+
+
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + + +
void CommandMessenger.CmdMessenger.Attach (MessengerCallbackFunction newFunction)
+
+inline
+
+ +

Attaches default callback for unsupported commands.

+
Parameters
+ + +
newFunctionThe callback function.
+
+
+
157  {
+
158  _defaultCallback = newFunction;
+
159  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void CommandMessenger.CmdMessenger.Attach (int messageId,
MessengerCallbackFunction newFunction 
)
+
+inline
+
+ +

Attaches default callback for certain Message ID.

+
Parameters
+ + + +
messageIdCommand ID.
newFunctionThe callback function.
+
+
+
165  {
+
166  _callbackList[messageId] = newFunction;
+
167  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + +
void CommandMessenger.CmdMessenger.Dispose ()
+
+inline
+
+ +

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

+
425  {
+
426  Dispose(true);
+
427  }
+
void Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resourc...
Definition: CmdMessenger.cs:424
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
virtual void CommandMessenger.CmdMessenger.Dispose (bool disposing)
+
+inlineprotectedvirtual
+
+ +

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

+
Parameters
+ + +
disposingtrue if resources should be disposed, false if not.
+
+
+
434  {
+
435  if (disposing)
+
436  {
+
437  _controlToInvokeOn = null;
+
438  _communications.NewLineReceived -= NewSerialDataReceived;
+
439  }
+
440  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
void CommandMessenger.CmdMessenger.HandleMessage (ReceivedCommand receivedCommand)
+
+inline
+
+ +

Handle message.

+
Parameters
+ + +
receivedCommandThe received command.
+
+
+ +

References CommandMessenger.ReceivedCommand.CommandId, and CommandMessenger.ReceivedCommand.Ok.

+ +

Referenced by CommandMessenger.CmdMessenger.ProcessLines().

+
232  {
+
233  MessengerCallbackFunction callback = null;
+
234  //var commandId = -1;
+
235  //ReceivedCommand receivedCommand;
+
236  if (receivedCommand.Ok)
+
237  {
+
238  //receivedCommand = new ReceivedCommand(commandString);
+
239  if (_callbackList.ContainsKey(receivedCommand.CommandId))
+
240  {
+
241  callback = _callbackList[receivedCommand.CommandId];
+
242  }
+
243  else
+
244  {
+
245  if (_defaultCallback != null) callback = _defaultCallback;
+
246  }
+
247  }
+
248  else
+
249  {
+
250  // Empty command
+
251  receivedCommand = new ReceivedCommand();
+
252  }
+
253  InvokeCallBack(callback, receivedCommand);
+
254  }
+
delegate void MessengerCallbackFunction(ReceivedCommand receivedCommand)
Definition of the messenger callback function.
+
+
+
+ +
+
+ + + + + + + + +
delegate void CommandMessenger.CmdMessenger.MessengerCallbackFunction (ReceivedCommand receivedCommand)
+
+ +

Definition of the messenger callback function.

+
Parameters
+ + +
receivedCommandThe received command.
+
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void CommandMessenger.CmdMessenger.ProcessLines ()
+
+inline
+
+ +

Process the command lines and invokes callbacks.

+ +

References CommandMessenger.CmdMessenger.CurrentReceivedCommand, CommandMessenger.CmdMessenger.CurrentReceivedLine, CommandMessenger.CmdMessenger.HandleMessage(), and CommandMessenger.CmdMessenger.LastLineTimeStamp.

+
183  {
+
184  bool continueParsing = true;
+
185  while (continueParsing)
+
186  {
+
187  var line = _communications.ReadLine();
+
188  if (line != null)
+
189  {
+
190  CurrentReceivedLine = CleanLine(line);
+ +
192  LastLineTimeStamp = _communications.LastLineTimeStamp;
+
193  InvokeEvent(NewLineReceived);
+ +
195  }
+
196  else
+
197  continueParsing = false;
+
198  }
+
199  }
+
ReceivedCommand CurrentReceivedCommand
Gets or sets the current received command.
Definition: CmdMessenger.cs:62
+
long LastLineTimeStamp
Gets or sets the time stamp of the last command line received.
Definition: CmdMessenger.cs:203
+
String CurrentReceivedLine
Gets or sets the current received command line.
Definition: CmdMessenger.cs:58
+
void HandleMessage(ReceivedCommand receivedCommand)
Handle message.
Definition: CmdMessenger.cs:231
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
ReceivedCommand CommandMessenger.CmdMessenger.SendCommand (int cmdId)
+
+inline
+
+ +

Sends a command.

+
Parameters
+ + +
cmdIdCommand ID.
+
+
+
Returns
.
+ +

Referenced by CommandMessenger.CmdMessenger.SendCommand().

+
262  {
+
263  return SendCommand(cmdId, "");
+
264  }
+
ReceivedCommand SendCommand(int cmdId)
Sends a command.
Definition: CmdMessenger.cs:261
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
ReceivedCommand CommandMessenger.CmdMessenger.SendCommand (int cmdId,
string argument 
)
+
+inline
+
+ +

Sends a command.

+
Parameters
+ + + +
cmdIdCommand ID.
argumentThe command argument.
+
+
+
Returns
.
+ +

References CommandMessenger.CmdMessenger.SendCommand().

+
271  {
+
272  return SendCommand(cmdId, argument, false, 0, 0);
+
273  }
+
ReceivedCommand SendCommand(int cmdId)
Sends a command.
Definition: CmdMessenger.cs:261
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
ReceivedCommand CommandMessenger.CmdMessenger.SendCommand (SendCommand sendCommand)
+
+inline
+
+ +

Sends a command.

+
Parameters
+ + +
sendCommandThe command to sent.
+
+
+
Returns
.
+ +

References CommandMessenger.SendCommand.AckCmdId, CommandMessenger.SendCommand.Arguments, CommandMessenger.SendCommand.CmdId, CommandMessenger.SendCommand.ReqAc, CommandMessenger.CmdMessenger.SendCommand(), and CommandMessenger.SendCommand.Timeout.

+
279  {
+
280  return SendCommand(sendCommand.CmdId, sendCommand.Arguments, sendCommand.ReqAc, sendCommand.AckCmdId,
+
281  sendCommand.Timeout);
+
282  }
+
ReceivedCommand SendCommand(int cmdId)
Sends a command.
Definition: CmdMessenger.cs:261
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ReceivedCommand CommandMessenger.CmdMessenger.SendCommand (int cmdId,
string argument,
bool reqAc,
int ackCmdId,
int timeout 
)
+
+inline
+
+ +

Sends a command.

+
Parameters
+ + + + + + +
cmdIdCommand ID.
argumentThe command argument.
reqActrue to request acknowledge command.
ackCmdIdacknowledgement command ID
timeoutTimeout on acknowlegde command.
+
+
+
Returns
.
+ +

References CommandMessenger.CmdMessenger.SendCommand().

+
292  {
+
293  return SendCommand(cmdId, new[] {argument}, reqAc, ackCmdId, timeout);
+
294  }
+
ReceivedCommand SendCommand(int cmdId)
Sends a command.
Definition: CmdMessenger.cs:261
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ReceivedCommand CommandMessenger.CmdMessenger.SendCommand (int cmdId,
string[] arguments,
bool reqAc,
int ackCmdId,
int timeout 
)
+
+inline
+
+ +

Sends a command.

+
Parameters
+ + + + + + +
cmdIdCommand ID.
argumentsThe arguments.
reqActrue to request acknowledge command.
ackCmdIdacknowledgement command ID
timeoutTimeout on acknowlegde command.
+
+
+
Returns
.
+ +

References CommandMessenger.CmdMessenger.CurrentSentLine, and CommandMessenger.CmdMessenger.PrintLfCr.

+
304  {
+
305  // Disable listening, all callbacks are disabled until after command was sent
+
306 
+
307  lock (_processSerialDataLock)
+
308  {
+
309  _communications.NewLineReceived -= NewSerialDataReceived;
+
310 
+
311  CurrentSentLine = cmdId.ToString(CultureInfo.InvariantCulture);
+
312 
+
313  foreach (var argument in arguments)
+
314  {
+
315  CurrentSentLine += _fieldSeparator + argument;
+
316  }
+
317 
+
318  if (PrintLfCr)
+
319  _communications.WriteLine(CurrentSentLine + _commandSeparator);
+
320  else
+
321  {
+
322  _communications.Write(CurrentSentLine + _commandSeparator);
+
323  }
+
324 
+
325  InvokeEvent(NewLineSent);
+
326 
+
327  ReceivedCommand ackCommand = reqAc ? BlockedTillReply(ackCmdId, timeout) : new ReceivedCommand();
+
328  _communications.NewLineReceived += NewSerialDataReceived;
+
329 
+
330  return ackCommand;
+
331  }
+
332  }
+
bool PrintLfCr
Gets or sets a whether to print a line feed carriage return after each command.
Definition: CmdMessenger.cs:54
+
String CurrentSentLine
Gets or sets the currently sent line.
Definition: CmdMessenger.cs:66
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
void CommandMessenger.CmdMessenger.SetControlToInvokeOn (Control controlToInvokeOn)
+
+inline
+
+ +

Sets a control to invoke on.

+
Parameters
+ + +
controlToInvokeOnThe control to invoke on.
+
+
+
130  {
+
131  _controlToInvokeOn = controlToInvokeOn;
+
132  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + +
bool CommandMessenger.CmdMessenger.StartListening ()
+
+inline
+
+ +

Starts serial port connection and start listening.

+
Returns
true if it succeeds, false if it fails.
+ +

References CommandMessenger.CmdMessenger.LastLineTimeStamp, and CommandMessenger.SerialPortManager.StartListening().

+
144  {
+
145  if (_communications.StartListening())
+
146  {
+
147  // Timestamp of this command is same as time stamp of serial line
+
148  LastLineTimeStamp = _communications.LastLineTimeStamp;
+
149  return true;
+
150  }
+
151  return false;
+
152  }
+
long LastLineTimeStamp
Gets or sets the time stamp of the last command line received.
Definition: CmdMessenger.cs:203
+
bool StartListening()
Connects to a serial port defined through the current settings.
Definition: SerialPortManager.cs:140
+
+
+
+ +
+
+ + + + + +
+ + + + + + + +
bool CommandMessenger.CmdMessenger.StopListening ()
+
+inline
+
+ +

Stop listening and end serial port connection.

+
Returns
true if it succeeds, false if it fails.
+
137  {
+
138  return _communications.StopListening();
+
139  }
+
+
+
+

Property Documentation

+ +
+
+ + + + + +
+ + + + +
ReceivedCommand CommandMessenger.CmdMessenger.CurrentReceivedCommand
+
+getset
+
+ +

Gets or sets the current received command.

+

The current received command.

+ +

Referenced by CommandMessenger.CmdMessenger.ProcessLines().

+ +
+
+ +
+
+ + + + + +
+ + + + +
String CommandMessenger.CmdMessenger.CurrentReceivedLine
+
+getset
+
+ +

Gets or sets the current received command line.

+

The current received line.

+ +

Referenced by CommandMessenger.CmdMessenger.ProcessLines().

+ +
+
+ +
+
+ + + + + +
+ + + + +
String CommandMessenger.CmdMessenger.CurrentSentLine
+
+getset
+
+ +

Gets or sets the currently sent line.

+

The currently sent line.

+ +

Referenced by CommandMessenger.CmdMessenger.SendCommand().

+ +
+
+ +
+
+ + + + + +
+ + + + +
long CommandMessenger.CmdMessenger.LastLineTimeStamp
+
+getset
+
+ +

Gets or sets the time stamp of the last command line received.

+

The last line time stamp.

+ +

Referenced by CommandMessenger.CmdMessenger.ProcessLines(), and CommandMessenger.CmdMessenger.StartListening().

+ +
+
+ +
+
+ + + + + +
+ + + + +
bool CommandMessenger.CmdMessenger.PrintLfCr
+
+getset
+
+ +

Gets or sets a whether to print a line feed carriage return after each command.

+

true if print line feed carriage return, false if not.

+ +

Referenced by CommandMessenger.CmdMessenger.SendCommand().

+ +
+
+
The documentation for this class was generated from the following file:
    +
  • D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CSharp/CommandMessenger/CmdMessenger.cs
  • +
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_cmd_messenger.png b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_cmd_messenger.png new file mode 100644 index 0000000..e770941 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_cmd_messenger.png Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_escaping-members.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_escaping-members.html new file mode 100644 index 0000000..045381b --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_escaping-members.html @@ -0,0 +1,75 @@ + + + + + + +CmdMessenger: Member List + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+
+
CommandMessenger.Escaping Member List
+
+
+ +

This is the complete list of members for CommandMessenger.Escaping, including all inherited members.

+ + + + + + + +
Escape(string input)CommandMessenger.Escapinginlinestatic
EscapeCharacterCommandMessenger.Escapingstatic
EscapeChars(char fieldSeparator, char commandSeparator, char escapeCharacter)CommandMessenger.Escapinginlinestatic
Remove(string input, char removeChar, char escapeChar)CommandMessenger.Escapinginlinestatic
Split(string input, char separator, char escapeCharacter, StringSplitOptions stringSplitOptions)CommandMessenger.Escapinginlinestatic
Unescape(string input)CommandMessenger.Escapinginlinestatic
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_escaping.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_escaping.html new file mode 100644 index 0000000..ab91771 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_escaping.html @@ -0,0 +1,425 @@ + + + + + + +CmdMessenger: CommandMessenger.Escaping Class Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+ +
+
CommandMessenger.Escaping Class Reference
+
+
+ +

Utility class providing escaping functions + More...

+ + + + + + + + + + + + + + + + + +

+Static Public Member Functions

static void EscapeChars (char fieldSeparator, char commandSeparator, char escapeCharacter)
 Sets custom escape characters. More...
 
static string Remove (string input, char removeChar, char escapeChar)
 Removes all occurences of a specific character unless escaped. More...
 
static String[] Split (string input, char separator, char escapeCharacter, StringSplitOptions stringSplitOptions)
 Splits. More...
 
static string Escape (string input)
 Escapes the input string. More...
 
static string Unescape (string input)
 Unescapes the input string. More...
 
+ + + + +

+Properties

static char EscapeCharacter [get]
 Gets the escape character. More...
 
+

Detailed Description

+

Utility class providing escaping functions

+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + + +
static string CommandMessenger.Escaping.Escape (string input)
+
+inlinestatic
+
+ +

Escapes the input string.

+
Parameters
+ + +
inputThe unescaped input string.
+
+
+
Returns
Escaped output string.
+
144  {
+
145  var escapeChars = new[]
+
146  {
+
147  _escapeCharacter.ToString(CultureInfo.InvariantCulture),
+
148  _fieldSeparator.ToString(CultureInfo.InvariantCulture),
+
149  _commandSeparator.ToString(CultureInfo.InvariantCulture),
+
150  "\0"
+
151  };
+
152  input = escapeChars.Aggregate(input,
+
153  (current, escapeChar) =>
+
154  current.Replace(escapeChar, _escapeCharacter + escapeChar));
+
155  return input;
+
156  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static void CommandMessenger.Escaping.EscapeChars (char fieldSeparator,
char commandSeparator,
char escapeCharacter 
)
+
+inlinestatic
+
+ +

Sets custom escape characters.

+
Parameters
+ + + + +
fieldSeparatorThe field separator.
commandSeparatorThe command separator.
escapeCharacterThe escape character.
+
+
+
77  {
+
78  _fieldSeparator = fieldSeparator;
+
79  _commandSeparator = commandSeparator;
+
80  _escapeCharacter = escapeCharacter;
+
81  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static string CommandMessenger.Escaping.Remove (string input,
char removeChar,
char escapeChar 
)
+
+inlinestatic
+
+ +

Removes all occurences of a specific character unless escaped.

+
Parameters
+ + + + +
inputThe input.
removeCharThe character to remove.
escapeCharThe escape character.
+
+
+
Returns
The string with all removeChars removed.
+
89  {
+
90  var output = "";
+
91  var escaped = new IsEscaped();
+
92  for (var i = 0; i < input.Length; i++)
+
93  {
+
94  char inputChar = input[i];
+
95  bool isEscaped = escaped.EscapedChar(inputChar);
+
96  if (inputChar != removeChar || isEscaped)
+
97  {
+
98  output += inputChar;
+
99  }
+
100  }
+
101  return output;
+
102  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
static String [] CommandMessenger.Escaping.Split (string input,
char separator,
char escapeCharacter,
StringSplitOptions stringSplitOptions 
)
+
+inlinestatic
+
+ +

Splits.

+
Parameters
+ + + + + +
inputThe input.
separatorThe separator.
escapeCharacterThe escape character.
stringSplitOptionsOptions for controlling the string split.
+
+
+
Returns
The split string.
+
114  {
+
115  var word = "";
+
116  var result = new List<string>();
+
117  for (var i = 0; i < input.Length; i++)
+
118  {
+
119  var t = input[i];
+
120  if (t == separator)
+
121  {
+
122  result.Add(word);
+
123  word = "";
+
124  }
+
125  else
+
126  {
+
127  if (t == escapeCharacter)
+
128  {
+
129  word += t;
+
130  if (i < input.Length - 1) t = input[++i];
+
131  }
+
132  word += t;
+
133  }
+
134  }
+
135  result.Add(word);
+
136  if (stringSplitOptions == StringSplitOptions.RemoveEmptyEntries) result.RemoveAll(item => item == "");
+
137  return result.ToArray();
+
138  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
static string CommandMessenger.Escaping.Unescape (string input)
+
+inlinestatic
+
+ +

Unescapes the input string.

+
Parameters
+ + +
inputThe escaped input string.
+
+
+
Returns
The unescaped output string.
+
162  {
+
163  string output = "";
+
164  // Move unescaped characters right
+
165  for (var fromChar = 0; fromChar < input.Length; fromChar++)
+
166  {
+
167  if (input[fromChar] == _escapeCharacter)
+
168  {
+
169  fromChar++;
+
170  }
+
171  output += input[fromChar];
+
172  }
+
173  return output;
+
174  }
+
+
+
+

Property Documentation

+ +
+
+ + + + + +
+ + + + +
char CommandMessenger.Escaping.EscapeCharacter
+
+staticget
+
+ +

Gets the escape character.

+

The escape character.

+ +

Referenced by CommandMessenger.IsEscaped.EscapedChar().

+ +
+
+
The documentation for this class was generated from the following file:
    +
  • D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CSharp/CommandMessenger/Escaped.cs
  • +
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_is_escaped-members.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_is_escaped-members.html new file mode 100644 index 0000000..a58604a --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_is_escaped-members.html @@ -0,0 +1,70 @@ + + + + + + +CmdMessenger: Member List + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+
+
CommandMessenger.IsEscaped Member List
+
+
+ +

This is the complete list of members for CommandMessenger.IsEscaped, including all inherited members.

+ + +
EscapedChar(char currChar)CommandMessenger.IsEscapedinline
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_is_escaped.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_is_escaped.html new file mode 100644 index 0000000..d8aa1b1 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_is_escaped.html @@ -0,0 +1,132 @@ + + + + + + +CmdMessenger: CommandMessenger.IsEscaped Class Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+ +
+
CommandMessenger.IsEscaped Class Reference
+
+
+ +

Class for bookkeeping which characters in the stream are escaped. + More...

+ + + + + +

+Public Member Functions

bool EscapedChar (char currChar)
 Returns if the character is escaped. Note create new instance for every independent string More...
 
+

Detailed Description

+

Class for bookkeeping which characters in the stream are escaped.

+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + + +
bool CommandMessenger.IsEscaped.EscapedChar (char currChar)
+
+inline
+
+ +

Returns if the character is escaped. Note create new instance for every independent string

+
Parameters
+ + +
currCharThe currebt character.
+
+
+
Returns
true if the character is escaped, false if not.
+ +

References CommandMessenger.Escaping.EscapeCharacter.

+
43  {
+
44  bool escaped = (_lastChar == Escaping.EscapeCharacter);
+
45  _lastChar = currChar;
+
46 
+
47  // special case: the escape char has been escaped:
+
48  if (_lastChar == Escaping.EscapeCharacter && escaped)
+
49  {
+
50  _lastChar = '\0';
+
51  }
+
52  return escaped;
+
53  }
+
static char EscapeCharacter
Gets the escape character.
Definition: Escaped.cs:68
+
+
+
+
The documentation for this class was generated from the following file:
    +
  • D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CSharp/CommandMessenger/Escaped.cs
  • +
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_received_command-members.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_received_command-members.html new file mode 100644 index 0000000..ecb608c --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_received_command-members.html @@ -0,0 +1,93 @@ + + + + + + +CmdMessenger: Member List + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+
+
CommandMessenger.ReceivedCommand Member List
+
+ + + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_received_command.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_received_command.html new file mode 100644 index 0000000..1da1e5d --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_received_command.html @@ -0,0 +1,1042 @@ + + + + + + +CmdMessenger: CommandMessenger.ReceivedCommand Class Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+ +
+
CommandMessenger.ReceivedCommand Class Reference
+
+
+ +

A command received from CmdMessenger + More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 ReceivedCommand ()
 Default constructor. More...
 
 ReceivedCommand (string[] arguments)
 Constructor. More...
 
bool Next ()
 Fetches the next argument. More...
 
bool Available ()
 returns if a next command is available More...
 
Int16 ReadInt16Arg ()
 Reads the current argument as short value. More...
 
UInt16 ReadUInt16Arg ()
 Reads the current argument as unsigned short value. More...
 
bool ReadBoolArg ()
 Reads the current argument as boolean value. More...
 
Int32 ReadInt32Arg ()
 Reads the current argument as int value. More...
 
UInt32 ReadUInt32Arg ()
 Reads the current argument as unsigned int value. More...
 
Single ReadFloatArg ()
 Reads the current argument as a float value. More...
 
Single ReadDoubleArg ()
 Reads the current argument as a double value. More...
 
String ReadStringArg ()
 Reads the current argument as a string value. More...
 
Single ReadBinFloatArg ()
 Reads the current binary argument as a float value. More...
 
Double ReadBinDoubleArg ()
 Reads the current binary argument as a double value. More...
 
Int16 ReadBinInt16Arg ()
 Reads the current binary argument as a short value. More...
 
UInt16 ReadBinUInt16Arg ()
 Reads the current binary argument as a unsigned short value. More...
 
Int32 ReadBinInt32Arg ()
 Reads the current binary argument as a int value. More...
 
UInt32 ReadBinUInt32Arg ()
 Reads the current binary argument as a unsigned int value. More...
 
String ReadBinStringArg ()
 Reads the current binary argument as a string value. More...
 
bool ReadBinBoolArg ()
 Reads the current binary argument as a boolean value. More...
 
+ + + + + + + + + + + + + +

+Properties

long TimeStamp [get, set]
 Gets or sets the time stamp. More...
 
bool Ok [get]
 Returns whether this is a valid & filled command. More...
 
string this[int index] [get]
 Indexer to get arguments directly. More...
 
int CommandId [get]
 Gets the command ID. More...
 
+

Detailed Description

+

A command received from CmdMessenger

+

Constructor & Destructor Documentation

+ +
+
+ + + + + +
+ + + + + + + +
CommandMessenger.ReceivedCommand.ReceivedCommand ()
+
+inline
+
+ +

Default constructor.

+
39  {
+
40  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
CommandMessenger.ReceivedCommand.ReceivedCommand (string[] arguments)
+
+inline
+
+ +

Constructor.

+
Parameters
+ + +
argumentsAll command arguments, first one is command ID
+
+
+
45  {
+
46  _arguments = arguments;
+
47  }
+
+
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
bool CommandMessenger.ReceivedCommand.Available ()
+
+inline
+
+ +

returns if a next command is available

+
Returns
true if it succeeds, false if it fails.
+ +

References CommandMessenger.ReceivedCommand.Next().

+
103  {
+
104  return Next();
+
105  }
+
bool Next()
Fetches the next argument.
Definition: ReceivedCommand.cs:81
+
+
+
+ +
+
+ + + + + +
+ + + + + + + +
bool CommandMessenger.ReceivedCommand.Next ()
+
+inline
+
+
+ +
+
+ + + + + +
+ + + + + + + +
bool CommandMessenger.ReceivedCommand.ReadBinBoolArg ()
+
+inline
+
+ +

Reads the current binary argument as a boolean value.

+
Returns
The boolean value.
+ +

References CommandMessenger.ReceivedCommand.Next().

+
343  {
+
344  if (Next())
+
345  {
+
346  var current = BinaryConverter.ToByte(_arguments[_parameter]);
+
347  if (current != null)
+
348  {
+
349  _dumped = true;
+
350  return (current != 0);
+
351  }
+
352  }
+
353  return false;
+
354  }
+
bool Next()
Fetches the next argument.
Definition: ReceivedCommand.cs:81
+
+
+
+ +
+
+ + + + + +
+ + + + + + + +
Double CommandMessenger.ReceivedCommand.ReadBinDoubleArg ()
+
+inline
+
+ +

Reads the current binary argument as a double value.

+
Returns
The double value.
+ +

References CommandMessenger.ReceivedCommand.Next().

+
248  {
+
249  if (Next())
+
250  {
+
251  var current = BinaryConverter.ToDouble(_arguments[_parameter]);
+
252  if (current != null)
+
253  {
+
254  _dumped = true;
+
255  return (double) current;
+
256  }
+
257  }
+
258  return 0;
+
259  }
+
bool Next()
Fetches the next argument.
Definition: ReceivedCommand.cs:81
+
+
+
+ +
+
+ + + + + +
+ + + + + + + +
Single CommandMessenger.ReceivedCommand.ReadBinFloatArg ()
+
+inline
+
+ +

Reads the current binary argument as a float value.

+
Returns
The float value.
+ +

References CommandMessenger.ReceivedCommand.Next().

+
232  {
+
233  if (Next())
+
234  {
+
235  var current = BinaryConverter.ToFloat(_arguments[_parameter]);
+
236  if (current != null)
+
237  {
+
238  _dumped = true;
+
239  return (float) current;
+
240  }
+
241  }
+
242  return 0;
+
243  }
+
bool Next()
Fetches the next argument.
Definition: ReceivedCommand.cs:81
+
+
+
+ +
+
+ + + + + +
+ + + + + + + +
Int16 CommandMessenger.ReceivedCommand.ReadBinInt16Arg ()
+
+inline
+
+ +

Reads the current binary argument as a short value.

+
Returns
The short value.
+ +

References CommandMessenger.ReceivedCommand.Next().

+
264  {
+
265  if (Next())
+
266  {
+
267  var current = BinaryConverter.ToInt16(_arguments[_parameter]);
+
268  if (current != null)
+
269  {
+
270  _dumped = true;
+
271  return (Int16) current;
+
272  }
+
273  }
+
274  return 0;
+
275  }
+
bool Next()
Fetches the next argument.
Definition: ReceivedCommand.cs:81
+
+
+
+ +
+
+ + + + + +
+ + + + + + + +
Int32 CommandMessenger.ReceivedCommand.ReadBinInt32Arg ()
+
+inline
+
+ +

Reads the current binary argument as a int value.

+
Returns
The int value.
+ +

References CommandMessenger.ReceivedCommand.Next().

+
296  {
+
297  if (Next())
+
298  {
+
299  var current = BinaryConverter.ToInt32(_arguments[_parameter]);
+
300  if (current != null)
+
301  {
+
302  _dumped = true;
+
303  return (Int32) current;
+
304  }
+
305  }
+
306  return 0;
+
307  }
+
bool Next()
Fetches the next argument.
Definition: ReceivedCommand.cs:81
+
+
+
+ +
+
+ + + + + +
+ + + + + + + +
String CommandMessenger.ReceivedCommand.ReadBinStringArg ()
+
+inline
+
+ +

Reads the current binary argument as a string value.

+
Returns
The string value.
+ +

References CommandMessenger.ReceivedCommand.Next().

+
328  {
+
329  if (Next())
+
330  {
+
331  if (_arguments[_parameter] != null)
+
332  {
+
333  _dumped = true;
+
334  return Escaping.Unescape(_arguments[_parameter]);
+
335  }
+
336  }
+
337  return "";
+
338  }
+
bool Next()
Fetches the next argument.
Definition: ReceivedCommand.cs:81
+
+
+
+ +
+
+ + + + + +
+ + + + + + + +
UInt16 CommandMessenger.ReceivedCommand.ReadBinUInt16Arg ()
+
+inline
+
+ +

Reads the current binary argument as a unsigned short value.

+
Returns
The unsigned short value.
+ +

References CommandMessenger.ReceivedCommand.Next().

+
280  {
+
281  if (Next())
+
282  {
+
283  var current = BinaryConverter.ToUInt16(_arguments[_parameter]);
+
284  if (current != null)
+
285  {
+
286  _dumped = true;
+
287  return (UInt16) current;
+
288  }
+
289  }
+
290  return 0;
+
291  }
+
bool Next()
Fetches the next argument.
Definition: ReceivedCommand.cs:81
+
+
+
+ +
+
+ + + + + +
+ + + + + + + +
UInt32 CommandMessenger.ReceivedCommand.ReadBinUInt32Arg ()
+
+inline
+
+ +

Reads the current binary argument as a unsigned int value.

+
Returns
The unsigned int value.
+ +

References CommandMessenger.ReceivedCommand.Next().

+
312  {
+
313  if (Next())
+
314  {
+
315  var current = BinaryConverter.ToUInt32(_arguments[_parameter]);
+
316  if (current != null)
+
317  {
+
318  _dumped = true;
+
319  return (UInt32) current;
+
320  }
+
321  }
+
322  return 0;
+
323  }
+
bool Next()
Fetches the next argument.
Definition: ReceivedCommand.cs:81
+
+
+
+ +
+
+ + + + + +
+ + + + + + + +
bool CommandMessenger.ReceivedCommand.ReadBoolArg ()
+
+inline
+
+ +

Reads the current argument as boolean value.

+
Returns
The boolean value.
+ +

References CommandMessenger.ReceivedCommand.ReadInt32Arg().

+
144  {
+
145  return (ReadInt32Arg() != 0);
+
146  }
+
Int32 ReadInt32Arg()
Reads the current argument as int value.
Definition: ReceivedCommand.cs:150
+
+
+
+ +
+
+ + + + + +
+ + + + + + + +
Single CommandMessenger.ReceivedCommand.ReadDoubleArg ()
+
+inline
+
+ +

Reads the current argument as a double value.

+
Returns
The unsigned double value.
+ +

References CommandMessenger.ReceivedCommand.Next().

+
199  {
+
200  if (Next())
+
201  {
+
202  Single current;
+
203  if (Single.TryParse(_arguments[_parameter], out current))
+
204  {
+
205  _dumped = true;
+
206  return current;
+
207  }
+
208  }
+
209  return 0;
+
210  }
+
bool Next()
Fetches the next argument.
Definition: ReceivedCommand.cs:81
+
+
+
+ +
+
+ + + + + +
+ + + + + + + +
Single CommandMessenger.ReceivedCommand.ReadFloatArg ()
+
+inline
+
+ +

Reads the current argument as a float value.

+
Returns
The float value.
+ +

References CommandMessenger.ReceivedCommand.Next().

+
183  {
+
184  if (Next())
+
185  {
+
186  Single current;
+
187  if (Single.TryParse(_arguments[_parameter], out current))
+
188  {
+
189  _dumped = true;
+
190  return current;
+
191  }
+
192  }
+
193  return 0;
+
194  }
+
bool Next()
Fetches the next argument.
Definition: ReceivedCommand.cs:81
+
+
+
+ +
+
+ + + + + +
+ + + + + + + +
Int16 CommandMessenger.ReceivedCommand.ReadInt16Arg ()
+
+inline
+
+ +

Reads the current argument as short value.

+
Returns
The short value.
+ +

References CommandMessenger.ReceivedCommand.Next().

+
112  {
+
113  if (Next())
+
114  {
+
115  Int16 current;
+
116  if (Int16.TryParse(_arguments[_parameter], out current))
+
117  {
+
118  _dumped = true;
+
119  return current;
+
120  }
+
121  }
+
122  return 0;
+
123  }
+
bool Next()
Fetches the next argument.
Definition: ReceivedCommand.cs:81
+
+
+
+ +
+
+ + + + + +
+ + + + + + + +
Int32 CommandMessenger.ReceivedCommand.ReadInt32Arg ()
+
+inline
+
+ +

Reads the current argument as int value.

+
Returns
The int value.
+ +

References CommandMessenger.ReceivedCommand.Next().

+ +

Referenced by CommandMessenger.ReceivedCommand.ReadBoolArg().

+
151  {
+
152  if (Next())
+
153  {
+
154  Int32 current;
+
155  if (Int32.TryParse(_arguments[_parameter], out current))
+
156  {
+
157  _dumped = true;
+
158  return current;
+
159  }
+
160  }
+
161  return 0;
+
162  }
+
bool Next()
Fetches the next argument.
Definition: ReceivedCommand.cs:81
+
+
+
+ +
+
+ + + + + +
+ + + + + + + +
String CommandMessenger.ReceivedCommand.ReadStringArg ()
+
+inline
+
+ +

Reads the current argument as a string value.

+
Returns
The string value.
+ +

References CommandMessenger.ReceivedCommand.Next().

+
215  {
+
216  if (Next())
+
217  {
+
218  if (_arguments[_parameter] != null)
+
219  {
+
220  _dumped = true;
+
221  return _arguments[_parameter];
+
222  }
+
223  }
+
224  return "";
+
225  }
+
bool Next()
Fetches the next argument.
Definition: ReceivedCommand.cs:81
+
+
+
+ +
+
+ + + + + +
+ + + + + + + +
UInt16 CommandMessenger.ReceivedCommand.ReadUInt16Arg ()
+
+inline
+
+ +

Reads the current argument as unsigned short value.

+
Returns
The unsigned short value.
+ +

References CommandMessenger.ReceivedCommand.Next().

+
128  {
+
129  if (Next())
+
130  {
+
131  UInt16 current;
+
132  if (UInt16.TryParse(_arguments[_parameter], out current))
+
133  {
+
134  _dumped = true;
+
135  return current;
+
136  }
+
137  }
+
138  return 0;
+
139  }
+
bool Next()
Fetches the next argument.
Definition: ReceivedCommand.cs:81
+
+
+
+ +
+
+ + + + + +
+ + + + + + + +
UInt32 CommandMessenger.ReceivedCommand.ReadUInt32Arg ()
+
+inline
+
+ +

Reads the current argument as unsigned int value.

+
Returns
The unsigned int value.
+ +

References CommandMessenger.ReceivedCommand.Next().

+
167  {
+
168  if (Next())
+
169  {
+
170  UInt32 current;
+
171  if (UInt32.TryParse(_arguments[_parameter], out current))
+
172  {
+
173  _dumped = true;
+
174  return current;
+
175  }
+
176  }
+
177  return 0;
+
178  }
+
bool Next()
Fetches the next argument.
Definition: ReceivedCommand.cs:81
+
+
+
+

Property Documentation

+ +
+
+ + + + + +
+ + + + +
int CommandMessenger.ReceivedCommand.CommandId
+
+get
+
+ +

Gets the command ID.

+

The command ID.

+ +

Referenced by CommandMessenger.CmdMessenger.HandleMessage().

+ +
+
+ +
+
+ + + + + +
+ + + + +
bool CommandMessenger.ReceivedCommand.Ok
+
+get
+
+ +

Returns whether this is a valid & filled command.

+

true if ok, false if not.

+ +

Referenced by CommandMessenger.CmdMessenger.HandleMessage().

+ +
+
+ +
+
+ + + + + +
+ + + + +
string CommandMessenger.ReceivedCommand.this[int index]
+
+get
+
+ +

Indexer to get arguments directly.

+

The indexed item.

+ +
+
+ +
+
+ + + + + +
+ + + + +
long CommandMessenger.ReceivedCommand.TimeStamp
+
+getset
+
+ +

Gets or sets the time stamp.

+

The time stamp.

+ +
+
+
The documentation for this class was generated from the following file:
    +
  • D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CSharp/CommandMessenger/ReceivedCommand.cs
  • +
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_send_command-members.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_send_command-members.html new file mode 100644 index 0000000..74f9048 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_send_command-members.html @@ -0,0 +1,110 @@ + + + + + + +CmdMessenger: Member List + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+
+
CommandMessenger.SendCommand Member List
+
+
+ +

This is the complete list of members for CommandMessenger.SendCommand, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AckCmdIdCommandMessenger.SendCommand
AddArgument(string argument)CommandMessenger.SendCommandinline
AddArgument(Single argument)CommandMessenger.SendCommandinline
AddArgument(Double argument)CommandMessenger.SendCommandinline
AddArgument(Int16 argument)CommandMessenger.SendCommandinline
AddArgument(UInt16 argument)CommandMessenger.SendCommandinline
AddArgument(Int32 argument)CommandMessenger.SendCommandinline
AddArgument(UInt32 argument)CommandMessenger.SendCommandinline
AddArgument(bool argument)CommandMessenger.SendCommandinline
AddArguments(string[] arguments)CommandMessenger.SendCommandinline
AddBinArgument(string argument)CommandMessenger.SendCommandinline
AddBinArgument(Single argument)CommandMessenger.SendCommandinline
AddBinArgument(Double argument)CommandMessenger.SendCommandinline
AddBinArgument(Int16 argument)CommandMessenger.SendCommandinline
AddBinArgument(UInt16 argument)CommandMessenger.SendCommandinline
AddBinArgument(Int32 argument)CommandMessenger.SendCommandinline
AddBinArgument(UInt32 argument)CommandMessenger.SendCommandinline
AddBinArgument(bool argument)CommandMessenger.SendCommandinline
ArgumentsCommandMessenger.SendCommand
CmdIdCommandMessenger.SendCommand
ReqAcCommandMessenger.SendCommand
SendCommand(int cmdId)CommandMessenger.SendCommandinline
SendCommand(int cmdId, string argument)CommandMessenger.SendCommandinline
SendCommand(int cmdId, string[] arguments)CommandMessenger.SendCommandinline
SendCommand(int cmdId, float argument)CommandMessenger.SendCommandinline
SendCommand(int cmdId, double argument)CommandMessenger.SendCommandinline
SendCommand(int cmdId, UInt16 argument)CommandMessenger.SendCommandinline
SendCommand(int cmdId, Int16 argument)CommandMessenger.SendCommandinline
SendCommand(int cmdId, UInt32 argument)CommandMessenger.SendCommandinline
SendCommand(int cmdId, Int32 argument)CommandMessenger.SendCommandinline
SendCommand(int cmdId, bool argument)CommandMessenger.SendCommandinline
SendCommand(int cmdId, int ackCmdId, int timeout)CommandMessenger.SendCommandinline
SendCommand(int cmdId, string argument, int ackCmdId, int timeout)CommandMessenger.SendCommandinline
SendCommand(int cmdId, string[] arguments, int ackCmdId, int timeout)CommandMessenger.SendCommandinline
SendCommand(int cmdId, float argument, int ackCmdId, int timeout)CommandMessenger.SendCommandinline
SendCommand(int cmdId, double argument, int ackCmdId, int timeout)CommandMessenger.SendCommandinline
SendCommand(int cmdId, Int16 argument, int ackCmdId, int timeout)CommandMessenger.SendCommandinline
SendCommand(int cmdId, UInt16 argument, int ackCmdId, int timeout)CommandMessenger.SendCommandinline
SendCommand(int cmdId, Int32 argument, int ackCmdId, int timeout)CommandMessenger.SendCommandinline
SendCommand(int cmdId, UInt32 argument, int ackCmdId, int timeout)CommandMessenger.SendCommandinline
TimeoutCommandMessenger.SendCommand
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_send_command.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_send_command.html new file mode 100644 index 0000000..4cd5e69 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_send_command.html @@ -0,0 +1,1990 @@ + + + + + + +CmdMessenger: CommandMessenger.SendCommand Class Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+ +
+
CommandMessenger.SendCommand Class Reference
+
+
+ +

A command to be send by CmdMessenger + More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 SendCommand (int cmdId)
 Constructor. More...
 
 SendCommand (int cmdId, string argument)
 Constructor. More...
 
 SendCommand (int cmdId, string[] arguments)
 Constructor. More...
 
 SendCommand (int cmdId, float argument)
 Constructor. More...
 
 SendCommand (int cmdId, double argument)
 Constructor. More...
 
 SendCommand (int cmdId, UInt16 argument)
 Constructor. More...
 
 SendCommand (int cmdId, Int16 argument)
 Constructor. More...
 
 SendCommand (int cmdId, UInt32 argument)
 Constructor. More...
 
 SendCommand (int cmdId, Int32 argument)
 Constructor. More...
 
 SendCommand (int cmdId, bool argument)
 Constructor. More...
 
 SendCommand (int cmdId, int ackCmdId, int timeout)
 Constructor. More...
 
 SendCommand (int cmdId, string argument, int ackCmdId, int timeout)
 Constructor. More...
 
 SendCommand (int cmdId, string[] arguments, int ackCmdId, int timeout)
 Constructor. More...
 
 SendCommand (int cmdId, float argument, int ackCmdId, int timeout)
 Constructor. More...
 
 SendCommand (int cmdId, double argument, int ackCmdId, int timeout)
 Constructor. More...
 
 SendCommand (int cmdId, Int16 argument, int ackCmdId, int timeout)
 Constructor. More...
 
 SendCommand (int cmdId, UInt16 argument, int ackCmdId, int timeout)
 Constructor. More...
 
 SendCommand (int cmdId, Int32 argument, int ackCmdId, int timeout)
 Constructor. More...
 
 SendCommand (int cmdId, UInt32 argument, int ackCmdId, int timeout)
 Constructor. More...
 
void AddArgument (string argument)
 Adds a command argument. More...
 
void AddArguments (string[] arguments)
 Adds command arguments. More...
 
void AddArgument (Single argument)
 Adds a command argument. More...
 
void AddArgument (Double argument)
 Adds a command argument. More...
 
void AddArgument (Int16 argument)
 Adds a command argument. More...
 
void AddArgument (UInt16 argument)
 Adds a command argument. More...
 
void AddArgument (Int32 argument)
 Adds a command argument. More...
 
void AddArgument (UInt32 argument)
 Adds a command argument. More...
 
void AddArgument (bool argument)
 Adds a command argument. More...
 
void AddBinArgument (string argument)
 Adds a binary command argument. More...
 
void AddBinArgument (Single argument)
 Adds a binary command argument. More...
 
void AddBinArgument (Double argument)
 Adds a binary command argument. More...
 
void AddBinArgument (Int16 argument)
 Adds a binary command argument. More...
 
void AddBinArgument (UInt16 argument)
 Adds a binary command argument. More...
 
void AddBinArgument (Int32 argument)
 Adds a binary command argument. More...
 
void AddBinArgument (UInt32 argument)
 Adds a binary command argument. More...
 
void AddBinArgument (bool argument)
 Adds a binary command argument. More...
 
+ + + + + + + + + + + + + + + + +

+Properties

int CmdId [get, set]
 Gets or sets the command ID. More...
 
bool ReqAc [get, set]
 Indicates if we want to wait for an acknowlegde command. More...
 
int AckCmdId [get, set]
 Gets or sets the acknowledge command ID. More...
 
int Timeout [get, set]
 Gets or sets the time we want to wait for the acknowledgde command. More...
 
String[] Arguments [get]
 Gets the command arguments. More...
 
+

Detailed Description

+

A command to be send by CmdMessenger

+

Constructor & Destructor Documentation

+ +
+
+ + + + + +
+ + + + + + + + +
CommandMessenger.SendCommand.SendCommand (int cmdId)
+
+inline
+
+ +

Constructor.

+
Parameters
+ + +
cmdIdthe command ID.
+
+
+
59  {
+
60  Init(cmdId, false, 0, 0);
+
61  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
CommandMessenger.SendCommand.SendCommand (int cmdId,
string argument 
)
+
+inline
+
+ +

Constructor.

+
Parameters
+ + + +
cmdIdCommand ID
argumentThe argument.
+
+
+ +

References CommandMessenger.SendCommand.AddArgument().

+
67  {
+
68  Init(cmdId, false, 0, 0);
+
69  AddArgument(argument);
+
70  }
+
void AddArgument(string argument)
Adds a command argument.
Definition: SendCommand.cs:259
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
CommandMessenger.SendCommand.SendCommand (int cmdId,
string[] arguments 
)
+
+inline
+
+ +

Constructor.

+
Parameters
+ + + +
cmdIdCommand ID
argumentsThe arguments.
+
+
+ +

References CommandMessenger.SendCommand.AddArguments().

+
76  {
+
77  Init(cmdId, false, 0, 0);
+
78  AddArguments(arguments);
+
79  }
+
void AddArguments(string[] arguments)
Adds command arguments.
Definition: SendCommand.cs:267
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
CommandMessenger.SendCommand.SendCommand (int cmdId,
float argument 
)
+
+inline
+
+ +

Constructor.

+
Parameters
+ + + +
cmdIdCommand ID
argumentThe argument.
+
+
+ +

References CommandMessenger.SendCommand.AddArgument().

+
85  {
+
86  Init(cmdId, false, 0, 0);
+
87  AddArgument(argument);
+
88  }
+
void AddArgument(string argument)
Adds a command argument.
Definition: SendCommand.cs:259
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
CommandMessenger.SendCommand.SendCommand (int cmdId,
double argument 
)
+
+inline
+
+ +

Constructor.

+
Parameters
+ + + +
cmdIdCommand ID
argumentThe argument.
+
+
+ +

References CommandMessenger.SendCommand.AddArgument().

+
94  {
+
95  Init(cmdId, false, 0, 0);
+
96  AddArgument(argument);
+
97  }
+
void AddArgument(string argument)
Adds a command argument.
Definition: SendCommand.cs:259
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
CommandMessenger.SendCommand.SendCommand (int cmdId,
UInt16 argument 
)
+
+inline
+
+ +

Constructor.

+
Parameters
+ + + +
cmdIdCommand ID
argumentThe argument.
+
+
+ +

References CommandMessenger.SendCommand.AddArgument().

+
103  {
+
104  Init(cmdId, false, 0, 0);
+
105  AddArgument(argument);
+
106  }
+
void AddArgument(string argument)
Adds a command argument.
Definition: SendCommand.cs:259
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
CommandMessenger.SendCommand.SendCommand (int cmdId,
Int16 argument 
)
+
+inline
+
+ +

Constructor.

+
Parameters
+ + + +
cmdIdCommand ID
argumentThe argument.
+
+
+ +

References CommandMessenger.SendCommand.AddArgument().

+
112  {
+
113  Init(cmdId, false, 0, 0);
+
114  AddArgument(argument);
+
115  }
+
void AddArgument(string argument)
Adds a command argument.
Definition: SendCommand.cs:259
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
CommandMessenger.SendCommand.SendCommand (int cmdId,
UInt32 argument 
)
+
+inline
+
+ +

Constructor.

+
Parameters
+ + + +
cmdIdCommand ID
argumentThe argument.
+
+
+ +

References CommandMessenger.SendCommand.AddArgument().

+
121  {
+
122  Init(cmdId, false, 0, 0);
+
123  AddArgument(argument);
+
124  }
+
void AddArgument(string argument)
Adds a command argument.
Definition: SendCommand.cs:259
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
CommandMessenger.SendCommand.SendCommand (int cmdId,
Int32 argument 
)
+
+inline
+
+ +

Constructor.

+
Parameters
+ + + +
cmdIdCommand ID
argumentThe argument.
+
+
+ +

References CommandMessenger.SendCommand.AddArgument().

+
130  {
+
131  Init(cmdId, false, 0, 0);
+
132  AddArgument(argument);
+
133  }
+
void AddArgument(string argument)
Adds a command argument.
Definition: SendCommand.cs:259
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
CommandMessenger.SendCommand.SendCommand (int cmdId,
bool argument 
)
+
+inline
+
+ +

Constructor.

+
Parameters
+ + + +
cmdIdCommand ID
argumentThe argument.
+
+
+ +

References CommandMessenger.SendCommand.AddArgument().

+
139  {
+
140  Init(cmdId, false, 0, 0);
+
141  AddArgument(argument);
+
142  }
+
void AddArgument(string argument)
Adds a command argument.
Definition: SendCommand.cs:259
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
CommandMessenger.SendCommand.SendCommand (int cmdId,
int ackCmdId,
int timeout 
)
+
+inline
+
+ +

Constructor.

+
Parameters
+ + + + +
cmdIdCommand ID
ackCmdIdAcknowlegde command ID.
timeoutThe timeout on waiting for an acknowlegde
+
+
+
149  {
+
150  Init(cmdId, true, ackCmdId, timeout);
+
151  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CommandMessenger.SendCommand.SendCommand (int cmdId,
string argument,
int ackCmdId,
int timeout 
)
+
+inline
+
+ +

Constructor.

+
Parameters
+ + + + + +
cmdIdCommand ID
argumentThe argument.
ackCmdIdAcknowlegde command ID.
timeoutThe timeout on waiting for an acknowlegde
+
+
+ +

References CommandMessenger.SendCommand.AddArgument().

+
159  {
+
160  Init(cmdId, true, ackCmdId, timeout);
+
161  AddArgument(argument);
+
162  }
+
void AddArgument(string argument)
Adds a command argument.
Definition: SendCommand.cs:259
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CommandMessenger.SendCommand.SendCommand (int cmdId,
string[] arguments,
int ackCmdId,
int timeout 
)
+
+inline
+
+ +

Constructor.

+
Parameters
+ + + + + +
cmdIdCommand ID
argumentsThe arguments.
ackCmdIdAcknowlegde command ID.
timeoutThe timeout on waiting for an acknowlegde
+
+
+ +

References CommandMessenger.SendCommand.AddArguments().

+
170  {
+
171  Init(cmdId, true, ackCmdId, timeout);
+
172  AddArguments(arguments);
+
173  }
+
void AddArguments(string[] arguments)
Adds command arguments.
Definition: SendCommand.cs:267
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CommandMessenger.SendCommand.SendCommand (int cmdId,
float argument,
int ackCmdId,
int timeout 
)
+
+inline
+
+ +

Constructor.

+
Parameters
+ + + + + +
cmdIdCommand ID
argumentThe argument.
ackCmdIdAcknowlegde command ID.
timeoutThe timeout on waiting for an acknowlegde
+
+
+ +

References CommandMessenger.SendCommand.AddArgument().

+
181  {
+
182  Init(cmdId, true, ackCmdId, timeout);
+
183  AddArgument(argument);
+
184  }
+
void AddArgument(string argument)
Adds a command argument.
Definition: SendCommand.cs:259
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CommandMessenger.SendCommand.SendCommand (int cmdId,
double argument,
int ackCmdId,
int timeout 
)
+
+inline
+
+ +

Constructor.

+
Parameters
+ + + + + +
cmdIdCommand ID
argumentThe argument.
ackCmdIdAcknowlegde command ID.
timeoutThe timeout on waiting for an acknowlegde
+
+
+ +

References CommandMessenger.SendCommand.AddArgument().

+
192  {
+
193  Init(cmdId, true, ackCmdId, timeout);
+
194  AddArgument(argument);
+
195  }
+
void AddArgument(string argument)
Adds a command argument.
Definition: SendCommand.cs:259
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CommandMessenger.SendCommand.SendCommand (int cmdId,
Int16 argument,
int ackCmdId,
int timeout 
)
+
+inline
+
+ +

Constructor.

+
Parameters
+ + + + + +
cmdIdCommand ID
argumentThe argument.
ackCmdIdAcknowlegde command ID.
timeoutThe timeout on waiting for an acknowlegde
+
+
+ +

References CommandMessenger.SendCommand.AddArgument().

+
203  {
+
204  Init(cmdId, true, ackCmdId, timeout);
+
205  AddArgument(argument);
+
206  }
+
void AddArgument(string argument)
Adds a command argument.
Definition: SendCommand.cs:259
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CommandMessenger.SendCommand.SendCommand (int cmdId,
UInt16 argument,
int ackCmdId,
int timeout 
)
+
+inline
+
+ +

Constructor.

+
Parameters
+ + + + + +
cmdIdCommand ID
argumentThe argument.
ackCmdIdAcknowlegde command ID.
timeoutThe timeout on waiting for an acknowlegde
+
+
+ +

References CommandMessenger.SendCommand.AddArgument().

+
214  {
+
215  Init(cmdId, true, ackCmdId, timeout);
+
216  AddArgument(argument);
+
217  }
+
void AddArgument(string argument)
Adds a command argument.
Definition: SendCommand.cs:259
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CommandMessenger.SendCommand.SendCommand (int cmdId,
Int32 argument,
int ackCmdId,
int timeout 
)
+
+inline
+
+ +

Constructor.

+
Parameters
+ + + + + +
cmdIdCommand ID
argumentThe argument.
ackCmdIdAcknowlegde command ID.
timeoutThe timeout on waiting for an acknowlegde
+
+
+ +

References CommandMessenger.SendCommand.AddArgument().

+
225  {
+
226  Init(cmdId, true, ackCmdId, timeout);
+
227  AddArgument(argument);
+
228  }
+
void AddArgument(string argument)
Adds a command argument.
Definition: SendCommand.cs:259
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CommandMessenger.SendCommand.SendCommand (int cmdId,
UInt32 argument,
int ackCmdId,
int timeout 
)
+
+inline
+
+ +

Constructor.

+
Parameters
+ + + + + +
cmdIdCommand ID
argumentThe argument.
ackCmdIdAcknowlegde command ID.
timeoutThe timeout on waiting for an acknowlegde
+
+
+ +

References CommandMessenger.SendCommand.AddArgument().

+
236  {
+
237  Init(cmdId, true, ackCmdId, timeout);
+
238  AddArgument(argument);
+
239  }
+
void AddArgument(string argument)
Adds a command argument.
Definition: SendCommand.cs:259
+
+
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + + +
void CommandMessenger.SendCommand.AddArgument (string argument)
+
+inline
+
+ +

Adds a command argument.

+
Parameters
+ + +
argumentThe argument.
+
+
+ +

Referenced by CommandMessenger.SendCommand.AddArgument(), and CommandMessenger.SendCommand.SendCommand().

+
260  {
+
261  if (argument != null)
+
262  _arguments.Add(argument);
+
263  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
void CommandMessenger.SendCommand.AddArgument (Single argument)
+
+inline
+
+ +

Adds a command argument.

+
Parameters
+ + +
argumentThe argument.
+
+
+
276  {
+
277  _arguments.Add(argument.ToString(CultureInfo.InvariantCulture));
+
278  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
void CommandMessenger.SendCommand.AddArgument (Double argument)
+
+inline
+
+ +

Adds a command argument.

+
Parameters
+ + +
argumentThe argument.
+
+
+
283  {
+
284  _arguments.Add(argument.ToString(CultureInfo.InvariantCulture));
+
285  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
void CommandMessenger.SendCommand.AddArgument (Int16 argument)
+
+inline
+
+ +

Adds a command argument.

+
Parameters
+ + +
argumentThe argument.
+
+
+
290  {
+
291  _arguments.Add(argument.ToString(CultureInfo.InvariantCulture));
+
292  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
void CommandMessenger.SendCommand.AddArgument (UInt16 argument)
+
+inline
+
+ +

Adds a command argument.

+
Parameters
+ + +
argumentThe argument.
+
+
+
297  {
+
298  _arguments.Add(argument.ToString(CultureInfo.InvariantCulture));
+
299  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
void CommandMessenger.SendCommand.AddArgument (Int32 argument)
+
+inline
+
+ +

Adds a command argument.

+
Parameters
+ + +
argumentThe argument.
+
+
+
304  {
+
305  _arguments.Add(argument.ToString(CultureInfo.InvariantCulture));
+
306  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
void CommandMessenger.SendCommand.AddArgument (UInt32 argument)
+
+inline
+
+ +

Adds a command argument.

+
Parameters
+ + +
argumentThe argument.
+
+
+
311  {
+
312  _arguments.Add(argument.ToString(CultureInfo.InvariantCulture));
+
313  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
void CommandMessenger.SendCommand.AddArgument (bool argument)
+
+inline
+
+ +

Adds a command argument.

+
Parameters
+ + +
argumentThe argument.
+
+
+ +

References CommandMessenger.SendCommand.AddArgument().

+
318  {
+
319  AddArgument((Int32) (argument ? 1 : 0));
+
320  }
+
void AddArgument(string argument)
Adds a command argument.
Definition: SendCommand.cs:259
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
void CommandMessenger.SendCommand.AddArguments (string[] arguments)
+
+inline
+
+ +

Adds command arguments.

+
Parameters
+ + +
argumentsThe arguments.
+
+
+ +

Referenced by CommandMessenger.SendCommand.SendCommand().

+
268  {
+
269  if (arguments != null)
+
270  _arguments.AddRange(arguments);
+
271  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
void CommandMessenger.SendCommand.AddBinArgument (string argument)
+
+inline
+
+ +

Adds a binary command argument.

+
Parameters
+ + +
argumentThe argument.
+
+
+
327  {
+
328  _arguments.Add(Escaping.Escape(argument));
+
329  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
void CommandMessenger.SendCommand.AddBinArgument (Single argument)
+
+inline
+
+ +

Adds a binary command argument.

+
Parameters
+ + +
argumentThe argument.
+
+
+
334  {
+
335  _arguments.Add(BinaryConverter.ToString(argument));
+
336  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
void CommandMessenger.SendCommand.AddBinArgument (Double argument)
+
+inline
+
+ +

Adds a binary command argument.

+
Parameters
+ + +
argumentThe argument.
+
+
+
341  {
+
342  _arguments.Add(BinaryConverter.ToString(argument));
+
343  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
void CommandMessenger.SendCommand.AddBinArgument (Int16 argument)
+
+inline
+
+ +

Adds a binary command argument.

+
Parameters
+ + +
argumentThe argument.
+
+
+
348  {
+
349  _arguments.Add(BinaryConverter.ToString(argument));
+
350  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
void CommandMessenger.SendCommand.AddBinArgument (UInt16 argument)
+
+inline
+
+ +

Adds a binary command argument.

+
Parameters
+ + +
argumentThe argument.
+
+
+
355  {
+
356  _arguments.Add(BinaryConverter.ToString(argument));
+
357  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
void CommandMessenger.SendCommand.AddBinArgument (Int32 argument)
+
+inline
+
+ +

Adds a binary command argument.

+
Parameters
+ + +
argumentThe argument.
+
+
+
362  {
+
363  _arguments.Add(BinaryConverter.ToString(argument));
+
364  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
void CommandMessenger.SendCommand.AddBinArgument (UInt32 argument)
+
+inline
+
+ +

Adds a binary command argument.

+
Parameters
+ + +
argumentThe argument.
+
+
+
369  {
+
370  _arguments.Add(BinaryConverter.ToString(argument));
+
371  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
void CommandMessenger.SendCommand.AddBinArgument (bool argument)
+
+inline
+
+ +

Adds a binary command argument.

+
Parameters
+ + +
argumentThe argument.
+
+
+
376  {
+
377  _arguments.Add(BinaryConverter.ToString(argument ? (byte) 1 : (byte) 0));
+
378  }
+
+
+
+

Property Documentation

+ +
+
+ + + + + +
+ + + + +
int CommandMessenger.SendCommand.AckCmdId
+
+getset
+
+ +

Gets or sets the acknowledge command ID.

+

the acknowledge command ID.

+ +

Referenced by CommandMessenger.CmdMessenger.SendCommand().

+ +
+
+ +
+
+ + + + + +
+ + + + +
String [] CommandMessenger.SendCommand.Arguments
+
+get
+
+ +

Gets the command arguments.

+

The arguments, first one is the command ID

+ +

Referenced by CommandMessenger.CmdMessenger.SendCommand().

+ +
+
+ +
+
+ + + + + +
+ + + + +
int CommandMessenger.SendCommand.CmdId
+
+getset
+
+ +

Gets or sets the command ID.

+

The command ID.

+ +

Referenced by CommandMessenger.CmdMessenger.SendCommand().

+ +
+
+ +
+
+ + + + + +
+ + + + +
bool CommandMessenger.SendCommand.ReqAc
+
+getset
+
+ +

Indicates if we want to wait for an acknowlegde command.

+

true if request acknowledge, false if not.

+ +

Referenced by CommandMessenger.CmdMessenger.SendCommand().

+ +
+
+ +
+
+ + + + + +
+ + + + +
int CommandMessenger.SendCommand.Timeout
+
+getset
+
+ +

Gets or sets the time we want to wait for the acknowledgde command.

+

The timeout on waiting for an acknowlegde

+ +

Referenced by CommandMessenger.CmdMessenger.SendCommand().

+ +
+
+
The documentation for this class was generated from the following file:
    +
  • D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CSharp/CommandMessenger/SendCommand.cs
  • +
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_serial_port_manager-members.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_serial_port_manager-members.html new file mode 100644 index 0000000..5e1d699 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_serial_port_manager-members.html @@ -0,0 +1,91 @@ + + + + + + +CmdMessenger: Member List + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+
+
CommandMessenger.SerialPortManager Member List
+
+
+ +

This is the complete list of members for CommandMessenger.SerialPortManager, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + +
Close()CommandMessenger.SerialPortManagerinline
CurrentSerialSettingsCommandMessenger.SerialPortManager
Dispose()CommandMessenger.SerialPortManagerinline
Dispose(bool disposing)CommandMessenger.SerialPortManagerinlineprotectedvirtual
EolDelimiterCommandMessenger.SerialPortManager
Initialize(char eolSeparator, char escapeCharacter)CommandMessenger.SerialPortManagerinline
IsOpen()CommandMessenger.SerialPortManagerinline
LastLineTimeStampCommandMessenger.SerialPortManager
NewLineReceived (defined in CommandMessenger.SerialPortManager)CommandMessenger.SerialPortManager
Open()CommandMessenger.SerialPortManagerinline
PortExists()CommandMessenger.SerialPortManagerinline
ReadLine()CommandMessenger.SerialPortManagerinline
SerialPortCommandMessenger.SerialPortManager
SerialPortManager()CommandMessenger.SerialPortManagerinline
SerialPortManager(char eolSeparator, char escapeCharacter)CommandMessenger.SerialPortManagerinline
StartListening()CommandMessenger.SerialPortManagerinline
StopListening()CommandMessenger.SerialPortManagerinline
StringEncoder (defined in CommandMessenger.SerialPortManager)CommandMessenger.SerialPortManager
UpdateBaudRateCollection()CommandMessenger.SerialPortManagerinline
Write< T >(T value)CommandMessenger.SerialPortManagerinline
WriteLine(string value)CommandMessenger.SerialPortManagerinline
WriteLine< T >(T value)CommandMessenger.SerialPortManagerinline
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_serial_port_manager.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_serial_port_manager.html new file mode 100644 index 0000000..8f42cf9 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_serial_port_manager.html @@ -0,0 +1,989 @@ + + + + + + +CmdMessenger: CommandMessenger.SerialPortManager Class Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+ +
+
CommandMessenger.SerialPortManager Class Reference
+
+
+ +

Fas Manager for serial port data + More...

+
+Inheritance diagram for CommandMessenger.SerialPortManager:
+
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 SerialPortManager ()
 Default constructor. More...
 
 SerialPortManager (char eolSeparator, char escapeCharacter)
 Constructor. More...
 
void Initialize (char eolSeparator, char escapeCharacter)
 Initializes this object. More...
 
bool StartListening ()
 Connects to a serial port defined through the current settings. More...
 
bool Open ()
 Opens the serial port. More...
 
bool PortExists ()
 Queries if a given port exists. More...
 
bool Close ()
 Closes the serial port. More...
 
bool IsOpen ()
 Query ifthe serial port is open. More...
 
bool StopListening ()
 Stops listening to the serial port. More...
 
void WriteLine (string value)
 Writes a string to the serial port. More...
 
void WriteLine< T > (T value)
 Writes a parameter to the serial port followed by a NewLine. More...
 
void Write< T > (T value)
 Writes a parameter to the serial port. More...
 
bool UpdateBaudRateCollection ()
 Retrieves the possible baud rates for the currently selected serial port. More...
 
string ReadLine ()
 Reads a line from the string buffer. More...
 
void Dispose ()
 Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. More...
 
+ + + +

+Public Attributes

+readonly Encoding StringEncoder = Encoding.GetEncoding("ISO-8859-1")
 
+ + + + +

+Protected Member Functions

virtual void Dispose (bool disposing)
 Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. More...
 
+ + + + + + + + + + + + + +

+Properties

char EolDelimiter [get, set]
 Gets or sets the End-Of-Line delimiter. More...
 
long LastLineTimeStamp [get, set]
 Gets or sets the time stamp of the last received line. More...
 
SerialSettings CurrentSerialSettings [get, set]
 Gets or sets the current serial port settings. More...
 
SerialPort SerialPort [get]
 Gets the serial port. More...
 
+ + + +

+Events

+EventHandler NewLineReceived
 
+

Detailed Description

+

Fas Manager for serial port data

+

Constructor & Destructor Documentation

+ +
+
+ + + + + +
+ + + + + + + +
CommandMessenger.SerialPortManager.SerialPortManager ()
+
+inline
+
+ +

Default constructor.

+ +

References CommandMessenger.SerialPortManager.Initialize().

+
45  {
+
46  Initialize(';', '/');
+
47  }
+
void Initialize(char eolSeparator, char escapeCharacter)
Initializes this object.
Definition: SerialPortManager.cs:66
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
CommandMessenger.SerialPortManager.SerialPortManager (char eolSeparator,
char escapeCharacter 
)
+
+inline
+
+ +

Constructor.

+
Parameters
+ + + +
eolSeparatorThe End-Of-Line separator.
escapeCharacterThe escape character.
+
+
+ +

References CommandMessenger.SerialPortManager.Initialize().

+
53  {
+
54  Initialize(eolSeparator, escapeCharacter);
+
55  }
+
void Initialize(char eolSeparator, char escapeCharacter)
Initializes this object.
Definition: SerialPortManager.cs:66
+
+
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
bool CommandMessenger.SerialPortManager.Close ()
+
+inline
+
+ +

Closes the serial port.

+
Returns
true if it succeeds, false if it fails.
+ +

References CommandMessenger.SerialPortManager.PortExists(), and CommandMessenger.SerialPortManager.SerialPort.

+ +

Referenced by CommandMessenger.SerialPortManager.Dispose(), CommandMessenger.SerialPortManager.StartListening(), CommandMessenger.SerialPortManager.StopListening(), and CommandMessenger.SerialPortManager.UpdateBaudRateCollection().

+
188  {
+
189  try
+
190  {
+
191  if (SerialPort != null && PortExists())
+
192  {
+
193  _serialPort.Close();
+
194  return true;
+
195  }
+
196  }
+
197  catch
+
198  {
+
199  return false;
+
200  }
+
201  return true;
+
202  }
+
SerialPort SerialPort
Gets the serial port.
Definition: SerialPortManager.cs:110
+
bool PortExists()
Queries if a given port exists.
Definition: SerialPortManager.cs:180
+
+
+
+ +
+
+ + + + + +
+ + + + + + + +
void CommandMessenger.SerialPortManager.Dispose ()
+
+inline
+
+ +

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

+
416  {
+
417  Dispose(true);
+
418  }
+
void Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resourc...
Definition: SerialPortManager.cs:415
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
virtual void CommandMessenger.SerialPortManager.Dispose (bool disposing)
+
+inlineprotectedvirtual
+
+ +

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

+
Parameters
+ + +
disposingtrue if resources should be disposed, false if not.
+
+
+ +

References CommandMessenger.SerialPortManager.Close(), and CommandMessenger.SerialPortManager.IsOpen().

+
425  {
+
426  if (disposing)
+
427  {
+
428  _pollBuffer.StopAndWait();
+
429  // Releasing serial port (and other unmanaged objects)
+
430 
+
431  if (IsOpen()) Close();
+
432  _serialPort.Dispose();
+
433  }
+
434  }
+
bool Close()
Closes the serial port.
Definition: SerialPortManager.cs:187
+
bool IsOpen()
Query ifthe serial port is open.
Definition: SerialPortManager.cs:206
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void CommandMessenger.SerialPortManager.Initialize (char eolSeparator,
char escapeCharacter 
)
+
+inline
+
+ +

Initializes this object.

+
Parameters
+ + + +
eolSeparatorThe End-Of-Line separator.
escapeCharacterThe escape character.
+
+
+ +

References CommandMessenger.SerialPortManager.EolDelimiter, and CommandMessenger.SerialSettings.PortNameCollection.

+ +

Referenced by CommandMessenger.SerialPortManager.SerialPortManager().

+
67  {
+
68  // Find installed serial ports on hardware
+
69  _currentSerialSettings.PortNameCollection = SerialPort.GetPortNames();
+
70  _currentSerialSettings.PropertyChanged += CurrentSerialSettingsPropertyChanged;
+
71 
+
72  // If serial ports are found, we select the first one
+
73  if (_currentSerialSettings.PortNameCollection.Length > 0)
+
74  _currentSerialSettings.PortName = _currentSerialSettings.PortNameCollection[0];
+
75  EolDelimiter = eolSeparator;
+
76  _isEscaped = new IsEscaped();
+
77  _pollBuffer = new TimedAction(SerialBufferPollFrequency, SerialPortDataReceived);
+
78  }
+
char EolDelimiter
Gets or sets the End-Of-Line delimiter.
Definition: SerialPortManager.cs:89
+
string[] PortNameCollection
Available ports on the computer
Definition: SerialSettings.cs:123
+
+
+
+ +
+
+ + + + + +
+ + + + + + + +
bool CommandMessenger.SerialPortManager.IsOpen ()
+
+inline
+
+ +

Query ifthe serial port is open.

+
Returns
true if open, false if not.
+ +

References CommandMessenger.SerialPortManager.PortExists().

+ +

Referenced by CommandMessenger.SerialPortManager.Dispose(), and CommandMessenger.SerialPortManager.StartListening().

+
207  {
+
208  try
+
209  {
+
210  return _serialPort != null && PortExists() && _serialPort.IsOpen;
+
211  }
+
212  catch
+
213  {
+
214  return false;
+
215  }
+
216  }
+
bool PortExists()
Queries if a given port exists.
Definition: SerialPortManager.cs:180
+
+
+
+ +
+
+ + + + + +
+ + + + + + + +
bool CommandMessenger.SerialPortManager.Open ()
+
+inline
+
+ +

Opens the serial port.

+
Returns
true if it succeeds, false if it fails.
+ +

References CommandMessenger.SerialPortManager.PortExists(), and CommandMessenger.SerialPortManager.SerialPort.

+ +

Referenced by CommandMessenger.SerialPortManager.StartListening(), and CommandMessenger.SerialPortManager.UpdateBaudRateCollection().

+
162  {
+
163  try
+
164  {
+
165  if (SerialPort != null && PortExists())
+
166  {
+
167  _serialPort.Open();
+
168  return _serialPort.IsOpen;
+
169  }
+
170  }
+
171  catch
+
172  {
+
173  return false;
+
174  }
+
175  return false;
+
176  }
+
SerialPort SerialPort
Gets the serial port.
Definition: SerialPortManager.cs:110
+
bool PortExists()
Queries if a given port exists.
Definition: SerialPortManager.cs:180
+
+
+
+ +
+
+ + + + + +
+ + + + + + + +
bool CommandMessenger.SerialPortManager.PortExists ()
+
+inline
+
+ +

Queries if a given port exists.

+
Returns
true if it succeeds, false if it fails.
+ +

Referenced by CommandMessenger.SerialPortManager.Close(), CommandMessenger.SerialPortManager.IsOpen(), and CommandMessenger.SerialPortManager.Open().

+
181  {
+
182  return SerialPort.GetPortNames().Contains(_serialPort.PortName);
+
183  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + +
string CommandMessenger.SerialPortManager.ReadLine ()
+
+inline
+
+ +

Reads a line from the string buffer.

+
Returns
The read line.
+ +

References CommandMessenger.SerialPortManager.LastLineTimeStamp, and CommandMessenger.TimeUtils.Millis.

+
398  {
+
399  // Force a last update, if update has waited to long
+
400  // This helps if a code was stopped in Serial port reading
+
401  if ((TimeUtils.Millis - LastLineTimeStamp) > 2*SerialBufferPollFrequency)
+
402  {
+
403  ParseLines();
+
404  }
+
405  lock (_lineBuffer)
+
406  {
+
407  if (_lineBuffer.Count == 0) return null;
+
408  return _lineBuffer.Dequeue();
+
409  }
+
410  }
+
long LastLineTimeStamp
Gets or sets the time stamp of the last received line.
Definition: SerialPortManager.cs:93
+
+
+
+ +
+
+ + + + + +
+ + + + + + + +
bool CommandMessenger.SerialPortManager.StartListening ()
+
+inline
+
+ +

Connects to a serial port defined through the current settings.

+
Returns
true if it succeeds, false if it fails.
+ +

References CommandMessenger.SerialSettings.BaudRate, CommandMessenger.SerialPortManager.Close(), CommandMessenger.SerialSettings.DataBits, CommandMessenger.SerialPortManager.IsOpen(), CommandMessenger.SerialPortManager.Open(), CommandMessenger.SerialSettings.Parity, CommandMessenger.SerialSettings.PortName, CommandMessenger.SerialPortManager.SerialPort, and CommandMessenger.SerialSettings.StopBits.

+ +

Referenced by CommandMessenger.CmdMessenger.StartListening().

+
141  {
+
142  // Closing serial port if it is open
+
143 
+
144  if (IsOpen()) Close();
+
145 
+
146  // Setting serial port settings
+
147  _serialPort = new SerialPort(
+
148  _currentSerialSettings.PortName,
+
149  _currentSerialSettings.BaudRate,
+
150  _currentSerialSettings.Parity,
+
151  _currentSerialSettings.DataBits,
+
152  _currentSerialSettings.StopBits);
+
153 
+
154  // Subscribe to event and open serial port for data
+
155  _pollBuffer.Start();
+
156  return Open();
+
157  }
+
Parity Parity
One of the Parity values.
Definition: SerialSettings.cs:78
+
int BaudRate
The baud rate.
Definition: SerialSettings.cs:62
+
StopBits StopBits
One of the StopBits values.
Definition: SerialSettings.cs:108
+
SerialPort SerialPort
Gets the serial port.
Definition: SerialPortManager.cs:110
+
bool Close()
Closes the serial port.
Definition: SerialPortManager.cs:187
+
bool Open()
Opens the serial port.
Definition: SerialPortManager.cs:161
+
int DataBits
The data bits value.
Definition: SerialSettings.cs:93
+
bool IsOpen()
Query ifthe serial port is open.
Definition: SerialPortManager.cs:206
+
string PortName
The port to use (for example, COM1).
Definition: SerialSettings.cs:47
+
+
+
+ +
+
+ + + + + +
+ + + + + + + +
bool CommandMessenger.SerialPortManager.StopListening ()
+
+inline
+
+ +

Stops listening to the serial port.

+
Returns
true if it succeeds, false if it fails.
+ +

References CommandMessenger.SerialPortManager.Close().

+
221  {
+
222  _pollBuffer.StopAndWait();
+
223  return Close();
+
224  }
+
bool Close()
Closes the serial port.
Definition: SerialPortManager.cs:187
+
+
+
+ +
+
+ + + + + +
+ + + + + + + +
bool CommandMessenger.SerialPortManager.UpdateBaudRateCollection ()
+
+inline
+
+ +

Retrieves the possible baud rates for the currently selected serial port.

+
Returns
true if it succeeds, false if it fails.
+ +

References CommandMessenger.SerialPortManager.Close(), CommandMessenger.SerialPortManager.Open(), CommandMessenger.SerialSettings.PortName, and CommandMessenger.SerialPortManager.SerialPort.

+
276  {
+
277  try
+
278  {
+
279  Close();
+
280  _serialPort = new SerialPort(_currentSerialSettings.PortName);
+
281  if (Open())
+
282  {
+
283  var fieldInfo = _serialPort.BaseStream.GetType()
+
284  .GetField("commProp", BindingFlags.Instance | BindingFlags.NonPublic);
+
285  if (fieldInfo != null)
+
286  {
+
287  object p = fieldInfo.GetValue(_serialPort.BaseStream);
+
288  var fieldInfoValue = p.GetType()
+
289  .GetField("dwSettableBaud",
+
290  BindingFlags.Instance | BindingFlags.NonPublic |
+
291  BindingFlags.Public);
+
292  if (fieldInfoValue != null)
+
293  {
+
294  var dwSettableBaud = (Int32) fieldInfoValue.GetValue(p);
+
295  Close();
+
296  _currentSerialSettings.UpdateBaudRateCollection(dwSettableBaud);
+
297  }
+
298  }
+
299  }
+
300  }
+
301  catch
+
302  {
+
303  return false;
+
304  }
+
305  return true;
+
306  }
+
SerialPort SerialPort
Gets the serial port.
Definition: SerialPortManager.cs:110
+
bool Close()
Closes the serial port.
Definition: SerialPortManager.cs:187
+
bool Open()
Opens the serial port.
Definition: SerialPortManager.cs:161
+
string PortName
The port to use (for example, COM1).
Definition: SerialSettings.cs:47
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
void CommandMessenger.SerialPortManager.Write< T > (value)
+
+inline
+
+ +

Writes a parameter to the serial port.

+
Template Parameters
+ + +
TGeneric type parameter.
+
+
+
Parameters
+ + +
valueThe value.
+
+
+
261  {
+
262  var writeString = value.ToString();
+
263  try
+
264  {
+
265  byte[] writeBytes = StringEncoder.GetBytes(writeString);
+
266  _serialPort.Write(writeBytes, 0, writeBytes.Length);
+
267  }
+
268  catch
+
269  {
+
270  }
+
271  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
void CommandMessenger.SerialPortManager.WriteLine (string value)
+
+inline
+
+ +

Writes a string to the serial port.

+
Parameters
+ + +
valueThe string to write.
+
+
+
229  {
+
230  var writeString = value;
+
231  try
+
232  {
+
233  byte[] writeBytes = StringEncoder.GetBytes(writeString + '\n');
+
234  _serialPort.Write(writeBytes, 0, writeBytes.Length);
+
235  }
+
236  catch
+
237  {
+
238  }
+
239  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
void CommandMessenger.SerialPortManager.WriteLine< T > (value)
+
+inline
+
+ +

Writes a parameter to the serial port followed by a NewLine.

+
Template Parameters
+ + +
TGeneric type parameter.
+
+
+
Parameters
+ + +
valueThe value.
+
+
+
245  {
+
246  var writeString = value.ToString();
+
247  try
+
248  {
+
249  byte[] writeBytes = StringEncoder.GetBytes(writeString + '\n');
+
250  _serialPort.Write(writeBytes, 0, writeBytes.Length);
+
251  }
+
252  catch
+
253  {
+
254  }
+
255  }
+
+
+
+

Property Documentation

+ +
+
+ + + + + +
+ + + + +
SerialSettings CommandMessenger.SerialPortManager.CurrentSerialSettings
+
+getset
+
+ +

Gets or sets the current serial port settings.

+

The current serial settings.

+ +
+
+ +
+
+ + + + + +
+ + + + +
char CommandMessenger.SerialPortManager.EolDelimiter
+
+getset
+
+ +

Gets or sets the End-Of-Line delimiter.

+

The End-Of-Line delimiter.

+ +

Referenced by CommandMessenger.SerialPortManager.Initialize().

+ +
+
+ +
+
+ + + + + +
+ + + + +
long CommandMessenger.SerialPortManager.LastLineTimeStamp
+
+getset
+
+ +

Gets or sets the time stamp of the last received line.

+

time stamp of the last received line.

+ +

Referenced by CommandMessenger.SerialPortManager.ReadLine().

+ +
+
+ +
+
+ + + + + +
+ + + + +
SerialPort CommandMessenger.SerialPortManager.SerialPort
+
+get
+
+
+
The documentation for this class was generated from the following file:
    +
  • D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CSharp/CommandMessenger/SerialPortManager.cs
  • +
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_serial_port_manager.png b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_serial_port_manager.png new file mode 100644 index 0000000..2bcbfa3 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_serial_port_manager.png Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_serial_settings-members.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_serial_settings-members.html new file mode 100644 index 0000000..aabfc86 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_serial_settings-members.html @@ -0,0 +1,79 @@ + + + + + + +CmdMessenger: Member List + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+
+
CommandMessenger.SerialSettings Member List
+
+ + + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_serial_settings.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_serial_settings.html new file mode 100644 index 0000000..5ed6dd3 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_serial_settings.html @@ -0,0 +1,412 @@ + + + + + + +CmdMessenger: CommandMessenger.SerialSettings Class Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+ +
+
CommandMessenger.SerialSettings Class Reference
+
+
+ +

Class containing properties related to a serial port + More...

+
+Inheritance diagram for CommandMessenger.SerialSettings:
+
+
+ + + +
+ + + + + +

+Public Member Functions

void UpdateBaudRateCollection (int possibleBaudRates)
 Updates the range of possible baud rates for device More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + +

+Properties

string PortName [get, set]
 The port to use (for example, COM1). More...
 
int BaudRate [get, set]
 The baud rate. More...
 
Parity Parity [get, set]
 One of the Parity values. More...
 
int DataBits [get, set]
 The data bits value. More...
 
StopBits StopBits [get, set]
 One of the StopBits values. More...
 
string[] PortNameCollection [get, set]
 Available ports on the computer More...
 
BindingList< int > BaudRateCollection [get]
 Available baud rates for current serial port More...
 
int[] DataBitsCollection [get, set]
 Available databits setting More...
 
+ + + +

+Events

+PropertyChangedEventHandler PropertyChanged
 
+

Detailed Description

+

Class containing properties related to a serial port

+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + + +
void CommandMessenger.SerialSettings.UpdateBaudRateCollection (int possibleBaudRates)
+
+inline
+
+ +

Updates the range of possible baud rates for device

+
Parameters
+ + +
possibleBaudRatesdwSettableBaud parameter from the COMMPROP Structure
+
+
+
Returns
An updated list of values
+
151  {
+
152  // ReSharper disable InconsistentNaming
+
153  const int BAUD_075 = 0x00000001; // The fifth baud 07
+
154  const int BAUD_110 = 0x00000002;
+
155  const int BAUD_150 = 0x00000008;
+
156  const int BAUD_300 = 0x00000010;
+
157  const int BAUD_600 = 0x00000020;
+
158  const int BAUD_1200 = 0x00000040;
+
159  const int BAUD_1800 = 0x00000080;
+
160  const int BAUD_2400 = 0x00000100;
+
161  const int BAUD_4800 = 0x00000200;
+
162  const int BAUD_7200 = 0x00000400;
+
163  const int BAUD_9600 = 0x00000800;
+
164  const int BAUD_14400 = 0x00001000;
+
165  const int BAUD_19200 = 0x00002000;
+
166  const int BAUD_38400 = 0x00004000;
+
167  const int BAUD_56K = 0x00008000;
+
168  const int BAUD_57600 = 0x00040000;
+
169  const int BAUD_115200 = 0x00020000;
+
170  const int BAUD_128K = 0x00010000;
+
171  // ReSharper restore InconsistentNaming
+
172  _baudRateCollection.Clear();
+
173 
+
174  if ((possibleBaudRates & BAUD_075) > 0)
+
175  _baudRateCollection.Add(75);
+
176  if ((possibleBaudRates & BAUD_110) > 0)
+
177  _baudRateCollection.Add(110);
+
178  if ((possibleBaudRates & BAUD_150) > 0)
+
179  _baudRateCollection.Add(150);
+
180  if ((possibleBaudRates & BAUD_300) > 0)
+
181  _baudRateCollection.Add(300);
+
182  if ((possibleBaudRates & BAUD_600) > 0)
+
183  _baudRateCollection.Add(600);
+
184  if ((possibleBaudRates & BAUD_1200) > 0)
+
185  _baudRateCollection.Add(1200);
+
186  if ((possibleBaudRates & BAUD_1800) > 0)
+
187  _baudRateCollection.Add(1800);
+
188  if ((possibleBaudRates & BAUD_2400) > 0)
+
189  _baudRateCollection.Add(2400);
+
190  if ((possibleBaudRates & BAUD_4800) > 0)
+
191  _baudRateCollection.Add(4800);
+
192  if ((possibleBaudRates & BAUD_7200) > 0)
+
193  _baudRateCollection.Add(7200);
+
194  if ((possibleBaudRates & BAUD_9600) > 0)
+
195  _baudRateCollection.Add(9600);
+
196  if ((possibleBaudRates & BAUD_14400) > 0)
+
197  _baudRateCollection.Add(14400);
+
198  if ((possibleBaudRates & BAUD_19200) > 0)
+
199  _baudRateCollection.Add(19200);
+
200  if ((possibleBaudRates & BAUD_38400) > 0)
+
201  _baudRateCollection.Add(38400);
+
202  if ((possibleBaudRates & BAUD_56K) > 0)
+
203  _baudRateCollection.Add(56000);
+
204  if ((possibleBaudRates & BAUD_57600) > 0)
+
205  _baudRateCollection.Add(57600);
+
206  if ((possibleBaudRates & BAUD_115200) > 0)
+
207  _baudRateCollection.Add(115200);
+
208  if ((possibleBaudRates & BAUD_128K) > 0)
+
209  _baudRateCollection.Add(128000);
+
210 
+
211  SendPropertyChangedEvent("BaudRateCollection");
+
212  }
+
+
+
+

Property Documentation

+ +
+
+ + + + + +
+ + + + +
int CommandMessenger.SerialSettings.BaudRate
+
+getset
+
+ +

The baud rate.

+ +

Referenced by CommandMessenger.SerialPortManager.StartListening().

+ +
+
+ +
+
+ + + + + +
+ + + + +
BindingList<int> CommandMessenger.SerialSettings.BaudRateCollection
+
+get
+
+ +

Available baud rates for current serial port

+ +
+
+ +
+
+ + + + + +
+ + + + +
int CommandMessenger.SerialSettings.DataBits
+
+getset
+
+ +

The data bits value.

+ +

Referenced by CommandMessenger.SerialPortManager.StartListening().

+ +
+
+ +
+
+ + + + + +
+ + + + +
int [] CommandMessenger.SerialSettings.DataBitsCollection
+
+getset
+
+ +

Available databits setting

+ +
+
+ +
+
+ + + + + +
+ + + + +
Parity CommandMessenger.SerialSettings.Parity
+
+getset
+
+ +

One of the Parity values.

+ +

Referenced by CommandMessenger.SerialPortManager.StartListening().

+ +
+
+ +
+
+ + + + + +
+ + + + +
string CommandMessenger.SerialSettings.PortName
+
+getset
+
+
+ +
+
+ + + + + +
+ + + + +
string [] CommandMessenger.SerialSettings.PortNameCollection
+
+getset
+
+ +

Available ports on the computer

+ +

Referenced by CommandMessenger.SerialPortManager.Initialize().

+ +
+
+ +
+
+ + + + + +
+ + + + +
StopBits CommandMessenger.SerialSettings.StopBits
+
+getset
+
+ +

One of the StopBits values.

+ +

Referenced by CommandMessenger.SerialPortManager.StartListening().

+ +
+
+
The documentation for this class was generated from the following file:
    +
  • D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CSharp/CommandMessenger/SerialSettings.cs
  • +
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_serial_settings.png b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_serial_settings.png new file mode 100644 index 0000000..62ce4df --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_serial_settings.png Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_string_utils-members.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_string_utils-members.html new file mode 100644 index 0000000..bc6126a --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_string_utils-members.html @@ -0,0 +1,70 @@ + + + + + + +CmdMessenger: Member List + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+
+
CommandMessenger.StringUtils Member List
+
+
+ +

This is the complete list of members for CommandMessenger.StringUtils, including all inherited members.

+ + +
ConvertEncoding(string input, Encoding fromEncoding, Encoding toEncoding)CommandMessenger.StringUtilsinlinestatic
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_string_utils.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_string_utils.html new file mode 100644 index 0000000..4c0bad4 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_string_utils.html @@ -0,0 +1,142 @@ + + + + + + +CmdMessenger: CommandMessenger.StringUtils Class Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+ +
+
CommandMessenger.StringUtils Class Reference
+
+
+ +

String utilities. + More...

+ + + + + +

+Static Public Member Functions

static string ConvertEncoding (string input, Encoding fromEncoding, Encoding toEncoding)
 Convert string from one codepage to another. More...
 
+

Detailed Description

+

String utilities.

+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static string CommandMessenger.StringUtils.ConvertEncoding (string input,
Encoding fromEncoding,
Encoding toEncoding 
)
+
+inlinestatic
+
+ +

Convert string from one codepage to another.

+
Parameters
+ + + + +
inputThe string.
fromEncodinginput encoding codepage.
toEncodingoutput encoding codepage.
+
+
+
Returns
.
+
35  {
+
36  var byteArray = fromEncoding.GetBytes(input);
+
37  var asciiArray = Encoding.Convert(fromEncoding, toEncoding, byteArray);
+
38  var finalString = toEncoding.GetString(asciiArray);
+
39  return finalString;
+
40  }
+
+
+
+
The documentation for this class was generated from the following file:
    +
  • D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CSharp/CommandMessenger/StringUtils.cs
  • +
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_time_utils-members.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_time_utils-members.html new file mode 100644 index 0000000..73e8dcd --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_time_utils-members.html @@ -0,0 +1,72 @@ + + + + + + +CmdMessenger: Member List + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+
+
CommandMessenger.TimeUtils Member List
+
+
+ +

This is the complete list of members for CommandMessenger.TimeUtils, including all inherited members.

+ + + + +
Jan1St1970 (defined in CommandMessenger.TimeUtils)CommandMessenger.TimeUtilsstatic
MillisCommandMessenger.TimeUtilsstatic
SecondsCommandMessenger.TimeUtilsstatic
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_time_utils.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_time_utils.html new file mode 100644 index 0000000..c93c2ea --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_time_utils.html @@ -0,0 +1,143 @@ + + + + + + +CmdMessenger: CommandMessenger.TimeUtils Class Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+ +
+
CommandMessenger.TimeUtils Class Reference
+
+
+ +

Class to get a timestamp + More...

+ + + + +

+Static Public Attributes

+static DateTime Jan1St1970 = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)
 
+ + + + + + + +

+Properties

static long Millis [get]
 Gets the milliseconds since 1 Jan 1970. More...
 
static long Seconds [get]
 Gets the seconds since 1 Jan 1970. More...
 
+

Detailed Description

+

Class to get a timestamp

+

Property Documentation

+ +
+
+ + + + + +
+ + + + +
long CommandMessenger.TimeUtils.Millis
+
+staticget
+
+ +

Gets the milliseconds since 1 Jan 1970.

+

The milliseconds since 1 Jan 1970.

+ +

Referenced by CommandMessenger.SerialPortManager.ReadLine().

+ +
+
+ +
+
+ + + + + +
+ + + + +
long CommandMessenger.TimeUtils.Seconds
+
+staticget
+
+ +

Gets the seconds since 1 Jan 1970.

+

The seconds since 1 Jan 1970.

+ +
+
+
The documentation for this class was generated from the following file:
    +
  • D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CSharp/CommandMessenger/TimeUtils.cs
  • +
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_timed_action-members.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_timed_action-members.html new file mode 100644 index 0000000..1d737b9 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_timed_action-members.html @@ -0,0 +1,74 @@ + + + + + + +CmdMessenger: Member List + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+
+
CommandMessenger.TimedAction Member List
+
+
+ +

This is the complete list of members for CommandMessenger.TimedAction, including all inherited members.

+ + + + + + +
IsRunningCommandMessenger.TimedAction
Start()CommandMessenger.TimedActioninline
Stop()CommandMessenger.TimedActioninline
StopAndWait()CommandMessenger.TimedActioninline
TimedAction(double interval, Action action)CommandMessenger.TimedActioninline
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_timed_action.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_timed_action.html new file mode 100644 index 0000000..b4443fc --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_command_messenger_1_1_timed_action.html @@ -0,0 +1,273 @@ + + + + + + +CmdMessenger: CommandMessenger.TimedAction Class Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+ +
+
CommandMessenger.TimedAction Class Reference
+
+
+ +

Starts a recurring action with fixed interval If still running at next call, the action is skipped + More...

+ + + + + + + + + + + + + + +

+Public Member Functions

 TimedAction (double interval, Action action)
 Constructor. More...
 
void Start ()
 Start timed actions. More...
 
void Stop ()
 Stop timed actions. More...
 
void StopAndWait ()
 Stop timed actions and wait until running function has finished. More...
 
+ + + + +

+Properties

bool IsRunning [get]
 Returns whether this object is running. More...
 
+

Detailed Description

+

Starts a recurring action with fixed interval If still running at next call, the action is skipped

+

Constructor & Destructor Documentation

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
CommandMessenger.TimedAction.TimedAction (double interval,
Action action 
)
+
+inline
+
+ +

Constructor.

+
Parameters
+ + + +
intervalThe execution interval.
actionThe action to execute.
+
+
+ +

References CommandMessenger.TimedAction.IsRunning.

+
57  {
+
58  _action = action;
+
59  _threadState = new ThreadState {IsRunning = false};
+
60 
+
61 
+
62  _actionTimer = new Timer(interval) {Enabled = false, SynchronizingObject = null};
+
63  _actionTimer.Elapsed += OnActionTimer;
+
64  }
+
bool IsRunning
Returns whether this object is running.
Definition: TimedAction.cs:49
+
+
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
void CommandMessenger.TimedAction.Start ()
+
+inline
+
+ +

Start timed actions.

+
125  {
+
126  // Start interval events
+
127  _actionTimer.Enabled = true;
+
128  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + +
void CommandMessenger.TimedAction.Stop ()
+
+inline
+
+ +

Stop timed actions.

+
132  {
+
133  // Halt new interval events
+
134  _actionTimer.Enabled = false;
+
135  }
+
+
+
+ +
+
+ + + + + +
+ + + + + + + +
void CommandMessenger.TimedAction.StopAndWait ()
+
+inline
+
+ +

Stop timed actions and wait until running function has finished.

+
139  {
+
140  // Halt new interval events
+
141  _actionTimer.Enabled = false;
+
142  while (_threadState.IsRunning)
+
143  {
+
144  }
+
145  }
+
+
+
+

Property Documentation

+ +
+
+ + + + + +
+ + + + +
bool CommandMessenger.TimedAction.IsRunning
+
+get
+
+ +

Returns whether this object is running.

+

true if this object is running, false if not.

+ +

Referenced by CommandMessenger.TimedAction.TimedAction().

+ +
+
+
The documentation for this class was generated from the following file:
    +
  • D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CSharp/CommandMessenger/TimedAction.cs
  • +
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_receive_1_1_program-members.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_receive_1_1_program-members.html new file mode 100644 index 0000000..3295f7a --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_receive_1_1_program-members.html @@ -0,0 +1,69 @@ + + + + + + +CmdMessenger: Member List + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+
+
Receive.Program Member List
+
+
+ +

This is the complete list of members for Receive.Program, including all inherited members.

+ +
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_receive_1_1_program.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_receive_1_1_program.html new file mode 100644 index 0000000..dbe6860 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_receive_1_1_program.html @@ -0,0 +1,71 @@ + + + + + + +CmdMessenger: Receive.Program Class Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+ +
+
Receive.Program Class Reference
+
+
+
The documentation for this class was generated from the following file:
    +
  • D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CSharp/Receive/Program.cs
  • +
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_receive_1_1_receive-members.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_receive_1_1_receive-members.html new file mode 100644 index 0000000..242bdb7 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_receive_1_1_receive-members.html @@ -0,0 +1,73 @@ + + + + + + +CmdMessenger: Member List + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+
+
Receive.Receive Member List
+
+
+ +

This is the complete list of members for Receive.Receive, including all inherited members.

+ + + + + +
Exit() (defined in Receive.Receive)Receive.Receiveinline
Loop() (defined in Receive.Receive)Receive.Receiveinline
RunLoop (defined in Receive.Receive)Receive.Receive
Setup() (defined in Receive.Receive)Receive.Receiveinline
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_receive_1_1_receive.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_receive_1_1_receive.html new file mode 100644 index 0000000..423597c --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_receive_1_1_receive.html @@ -0,0 +1,92 @@ + + + + + + +CmdMessenger: Receive.Receive Class Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+ +
+
Receive.Receive Class Reference
+
+
+ + + + + + + + +

+Public Member Functions

+void Setup ()
 
+void Loop ()
 
+void Exit ()
 
+ + + +

+Properties

+bool RunLoop [get, set]
 
+
The documentation for this class was generated from the following file:
    +
  • D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CSharp/Receive/Receive.cs
  • +
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_1_1_program-members.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_1_1_program-members.html new file mode 100644 index 0000000..84c6a51 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_1_1_program-members.html @@ -0,0 +1,69 @@ + + + + + + +CmdMessenger: Member List + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+
+
SendAndReceive.Program Member List
+
+
+ +

This is the complete list of members for SendAndReceive.Program, including all inherited members.

+ +
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_1_1_program.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_1_1_program.html new file mode 100644 index 0000000..91780dc --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_1_1_program.html @@ -0,0 +1,71 @@ + + + + + + +CmdMessenger: SendAndReceive.Program Class Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+ +
+
SendAndReceive.Program Class Reference
+
+
+
The documentation for this class was generated from the following file:
    +
  • D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CSharp/SendAndReceive/Program.cs
  • +
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_1_1_send_and_receive-members.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_1_1_send_and_receive-members.html new file mode 100644 index 0000000..68e605e --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_1_1_send_and_receive-members.html @@ -0,0 +1,73 @@ + + + + + + +CmdMessenger: Member List + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+
+
SendAndReceive.SendAndReceive Member List
+
+
+ +

This is the complete list of members for SendAndReceive.SendAndReceive, including all inherited members.

+ + + + + +
Exit() (defined in SendAndReceive.SendAndReceive)SendAndReceive.SendAndReceiveinline
Loop() (defined in SendAndReceive.SendAndReceive)SendAndReceive.SendAndReceiveinline
RunLoop (defined in SendAndReceive.SendAndReceive)SendAndReceive.SendAndReceive
Setup() (defined in SendAndReceive.SendAndReceive)SendAndReceive.SendAndReceiveinline
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_1_1_send_and_receive.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_1_1_send_and_receive.html new file mode 100644 index 0000000..36a582e --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_1_1_send_and_receive.html @@ -0,0 +1,92 @@ + + + + + + +CmdMessenger: SendAndReceive.SendAndReceive Class Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+ +
+
SendAndReceive.SendAndReceive Class Reference
+
+
+ + + + + + + + +

+Public Member Functions

+void Setup ()
 
+void Loop ()
 
+void Exit ()
 
+ + + +

+Properties

+bool RunLoop [get, set]
 
+
The documentation for this class was generated from the following file:
    +
  • D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CSharp/SendAndReceive/SendAndReceive.cs
  • +
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_arguments_1_1_program-members.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_arguments_1_1_program-members.html new file mode 100644 index 0000000..7360f08 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_arguments_1_1_program-members.html @@ -0,0 +1,69 @@ + + + + + + +CmdMessenger: Member List + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+
+
SendAndReceiveArguments.Program Member List
+
+
+ +

This is the complete list of members for SendAndReceiveArguments.Program, including all inherited members.

+ +
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_arguments_1_1_program.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_arguments_1_1_program.html new file mode 100644 index 0000000..19eef6c --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_arguments_1_1_program.html @@ -0,0 +1,71 @@ + + + + + + +CmdMessenger: SendAndReceiveArguments.Program Class Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+ +
+
SendAndReceiveArguments.Program Class Reference
+
+
+
The documentation for this class was generated from the following file:
    +
  • D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CSharp/SendAndReceiveArguments/Program.cs
  • +
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_arguments_1_1_send_and_receive_arguments-members.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_arguments_1_1_send_and_receive_arguments-members.html new file mode 100644 index 0000000..b18c834 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_arguments_1_1_send_and_receive_arguments-members.html @@ -0,0 +1,73 @@ + + + + + + +CmdMessenger: Member List + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+
+
SendAndReceiveArguments.SendAndReceiveArguments Member List
+
+ + + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_arguments_1_1_send_and_receive_arguments.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_arguments_1_1_send_and_receive_arguments.html new file mode 100644 index 0000000..fbf5b94 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_arguments_1_1_send_and_receive_arguments.html @@ -0,0 +1,92 @@ + + + + + + +CmdMessenger: SendAndReceiveArguments.SendAndReceiveArguments Class Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+ +
+
SendAndReceiveArguments.SendAndReceiveArguments Class Reference
+
+
+ + + + + + + + +

+Public Member Functions

+void Setup ()
 
+void Loop ()
 
+void Exit ()
 
+ + + +

+Properties

+bool RunLoop [get, set]
 
+
The documentation for this class was generated from the following file:
    +
  • D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CSharp/SendAndReceiveArguments/SendAndReceiveArguments.cs
  • +
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_binary_arguments_1_1_program-members.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_binary_arguments_1_1_program-members.html new file mode 100644 index 0000000..42a60ed --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_binary_arguments_1_1_program-members.html @@ -0,0 +1,69 @@ + + + + + + +CmdMessenger: Member List + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+
+
SendAndReceiveBinaryArguments.Program Member List
+
+
+ +

This is the complete list of members for SendAndReceiveBinaryArguments.Program, including all inherited members.

+ +
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_binary_arguments_1_1_program.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_binary_arguments_1_1_program.html new file mode 100644 index 0000000..dd746eb --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_binary_arguments_1_1_program.html @@ -0,0 +1,71 @@ + + + + + + +CmdMessenger: SendAndReceiveBinaryArguments.Program Class Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+ +
+
SendAndReceiveBinaryArguments.Program Class Reference
+
+
+
The documentation for this class was generated from the following file:
    +
  • D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CSharp/SendAndReceiveBinaryArguments/Program.cs
  • +
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_binary_arguments_1_1_send_and_receive_binary_arguments-members.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_binary_arguments_1_1_send_and_receive_binary_arguments-members.html new file mode 100644 index 0000000..0434a20 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_binary_arguments_1_1_send_and_receive_binary_arguments-members.html @@ -0,0 +1,74 @@ + + + + + + +CmdMessenger: Member List + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+
+
SendAndReceiveBinaryArguments.SendAndReceiveBinaryArguments Member List
+
+ + + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_binary_arguments_1_1_send_and_receive_binary_arguments.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_binary_arguments_1_1_send_and_receive_binary_arguments.html new file mode 100644 index 0000000..da6887f --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/class_send_and_receive_binary_arguments_1_1_send_and_receive_binary_arguments.html @@ -0,0 +1,95 @@ + + + + + + +CmdMessenger: SendAndReceiveBinaryArguments.SendAndReceiveBinaryArguments Class Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + +
+
+ +
+
SendAndReceiveBinaryArguments.SendAndReceiveBinaryArguments Class Reference
+
+
+ + + + + + + + +

+Public Member Functions

+void Setup ()
 
+void Loop ()
 
+void Exit ()
 
+ + + + + +

+Properties

+bool RunLoop [get, set]
 
+static long Millis [get]
 
+
The documentation for this class was generated from the following file:
    +
  • D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CSharp/SendAndReceiveBinaryArguments/SendAndReceiveBinaryArguments.cs
  • +
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/classes.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/classes.html new file mode 100644 index 0000000..30cca82 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/classes.html @@ -0,0 +1,78 @@ + + + + + +CmdMessenger: Class Index + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a messaging library for the Arduino Platform. It has uses the serial port as its transport layer
+
+
+ + + + +
+
+
+
Class Index
+
+
+ + + + + + +
  C  
+
CmdMessenger   
+ +
+ + + + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/closed.png b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/closed.png new file mode 100644 index 0000000..b7d4bd9 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/closed.png Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_03680f297d755c096b0a1ead13ee12b7.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_03680f297d755c096b0a1ead13ee12b7.html new file mode 100644 index 0000000..464f630 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_03680f297d755c096b0a1ead13ee12b7.html @@ -0,0 +1,70 @@ + + + + + + +CmdMessenger: D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/Examples Directory Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + +
+
+
+
Examples Directory Reference
+
+
+ + + + + + + + + + +

+Directories

directory  Receive
 
directory  SendAndReceive
 
directory  SendAndReceiveArguments
 
directory  SendAndReceiveBinaryArguments
 
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_0a22a0ad5e6500f3016c42c7cc18cc11.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_0a22a0ad5e6500f3016c42c7cc18cc11.html new file mode 100644 index 0000000..492b3dd --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_0a22a0ad5e6500f3016c42c7cc18cc11.html @@ -0,0 +1,64 @@ + + + + + + +CmdMessenger: D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/Examples/SendAndReceive Directory Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + +
+
+
+
SendAndReceive Directory Reference
+
+
+ + + + +

+Files

file  SendAndReceive.ino
 
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_0ad25a08476acd4d730789ad16e5c86b.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_0ad25a08476acd4d730789ad16e5c86b.html new file mode 100644 index 0000000..ca1314a --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_0ad25a08476acd4d730789ad16e5c86b.html @@ -0,0 +1,71 @@ + + + + + + +CmdMessenger: D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CSharp/SendAndReceive Directory Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + +
+
+
+
SendAndReceive Directory Reference
+
+
+ + + + +

+Directories

directory  Properties
 
+ + + + + +

+Files

file  Program.cs
 
file  SendAndReceive.cs
 
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_1592ba7515d40cd5ff0647c0ff197723.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_1592ba7515d40cd5ff0647c0ff197723.html new file mode 100644 index 0000000..17eaa6e --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_1592ba7515d40cd5ff0647c0ff197723.html @@ -0,0 +1,66 @@ + + + + + + +CmdMessenger: D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/Documentation/html Directory Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + +
+
+
+
html Directory Reference
+
+
+ + + + + + +

+Files

file  dynsections.js
 
file  jquery.js
 
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_1fb384151ea06aa7871fe40c9d26ba14.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_1fb384151ea06aa7871fe40c9d26ba14.html new file mode 100644 index 0000000..e2cf87b --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_1fb384151ea06aa7871fe40c9d26ba14.html @@ -0,0 +1,71 @@ + + + + + + +CmdMessenger: D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CSharp/SendAndReceiveBinaryArguments Directory Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + +
+
+
+
SendAndReceiveBinaryArguments Directory Reference
+
+
+ + + + +

+Directories

directory  Properties
 
+ + + + + +

+Files

file  Program.cs
 
file  SendAndReceiveBinaryArguments.cs
 
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_2358508cf2cd3f735687a956f2da4c3a.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_2358508cf2cd3f735687a956f2da4c3a.html new file mode 100644 index 0000000..b64b365 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_2358508cf2cd3f735687a956f2da4c3a.html @@ -0,0 +1,72 @@ + + + + + + +CmdMessenger: D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CSharp Directory Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + +
+
+
+
CSharp Directory Reference
+
+
+ + + + + + + + + + + + +

+Directories

directory  CommandMessenger
 
directory  Receive
 
directory  SendAndReceive
 
directory  SendAndReceiveArguments
 
directory  SendAndReceiveBinaryArguments
 
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_2819f7afd95e1465d19d8c6a5220f818.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_2819f7afd95e1465d19d8c6a5220f818.html new file mode 100644 index 0000000..53c6e3e --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_2819f7afd95e1465d19d8c6a5220f818.html @@ -0,0 +1,64 @@ + + + + + + +CmdMessenger: D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CSharp/CommandMessenger/Properties Directory Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + +
+
+
+
Properties Directory Reference
+
+
+ + + + +

+Files

file  AssemblyInfo.cs
 
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_35639b3a232ada4b8408e4446629bc1b.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_35639b3a232ada4b8408e4446629bc1b.html new file mode 100644 index 0000000..38ef070 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_35639b3a232ada4b8408e4446629bc1b.html @@ -0,0 +1,64 @@ + + + + + + +CmdMessenger: D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CSharp/SendAndReceiveBinaryArguments/Properties Directory Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + +
+
+
+
Properties Directory Reference
+
+
+ + + + +

+Files

file  AssemblyInfo.cs
 
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_412756bd98d71f0bca0cf1b6687d9c86.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_412756bd98d71f0bca0cf1b6687d9c86.html new file mode 100644 index 0000000..f4a54f7 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_412756bd98d71f0bca0cf1b6687d9c86.html @@ -0,0 +1,64 @@ + + + + + + +CmdMessenger: D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/Examples/SendAndReceiveArguments Directory Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + +
+
+
+
SendAndReceiveArguments Directory Reference
+
+
+ + + + +

+Files

file  SendAndReceiveArguments.ino
 
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_6b44d98776882498b9dcf08e140e9ef8.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_6b44d98776882498b9dcf08e140e9ef8.html new file mode 100644 index 0000000..2db1991 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_6b44d98776882498b9dcf08e140e9ef8.html @@ -0,0 +1,71 @@ + + + + + + +CmdMessenger: D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CSharp/SendAndReceiveArguments Directory Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + +
+
+
+
SendAndReceiveArguments Directory Reference
+
+
+ + + + +

+Directories

directory  Properties
 
+ + + + + +

+Files

file  Program.cs
 
file  SendAndReceiveArguments.cs
 
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_75b14d76d06908d03174345b6fad22d5.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_75b14d76d06908d03174345b6fad22d5.html new file mode 100644 index 0000000..cd29718 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_75b14d76d06908d03174345b6fad22d5.html @@ -0,0 +1,64 @@ + + + + + + +CmdMessenger: D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/Examples/Receive Directory Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + +
+
+
+
Receive Directory Reference
+
+
+ + + + +

+Files

file  Receive.ino
 
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_817e01fbc65b8124ffc8269121ac53e0.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_817e01fbc65b8124ffc8269121ac53e0.html new file mode 100644 index 0000000..91adefe --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_817e01fbc65b8124ffc8269121ac53e0.html @@ -0,0 +1,71 @@ + + + + + + +CmdMessenger: D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CSharp/Receive Directory Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + +
+
+
+
Receive Directory Reference
+
+
+ + + + +

+Directories

directory  Properties
 
+ + + + + +

+Files

file  Program.cs
 
file  Receive.cs
 
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_b162f6c6566b2048818ebd4ba582b3a5.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_b162f6c6566b2048818ebd4ba582b3a5.html new file mode 100644 index 0000000..0c90f8d --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_b162f6c6566b2048818ebd4ba582b3a5.html @@ -0,0 +1,64 @@ + + + + + + +CmdMessenger: D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CSharp/Receive/Properties Directory Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + +
+
+
+
Properties Directory Reference
+
+
+ + + + +

+Files

file  AssemblyInfo.cs
 
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_c3ac2e328ec47a7b2d1669470805c08f.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_c3ac2e328ec47a7b2d1669470805c08f.html new file mode 100644 index 0000000..b969548 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_c3ac2e328ec47a7b2d1669470805c08f.html @@ -0,0 +1,64 @@ + + + + + + +CmdMessenger: D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CSharp/SendAndReceiveArguments/Properties Directory Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + +
+
+
+
Properties Directory Reference
+
+
+ + + + +

+Files

file  AssemblyInfo.cs
 
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_ce051af3c723b11a691d506f4c0b4a2e.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_ce051af3c723b11a691d506f4c0b4a2e.html new file mode 100644 index 0000000..d1831c1 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_ce051af3c723b11a691d506f4c0b4a2e.html @@ -0,0 +1,64 @@ + + + + + + +CmdMessenger: D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/Documentation/PC Directory Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + +
+
+
+
PC Directory Reference
+
+
+ + + + +

+Directories

directory  html
 
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_d7c88fb44972c09bc5d702c51839da55.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_d7c88fb44972c09bc5d702c51839da55.html new file mode 100644 index 0000000..5c37aee --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_d7c88fb44972c09bc5d702c51839da55.html @@ -0,0 +1,64 @@ + + + + + + +CmdMessenger: D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CSharp/SendAndReceive/Properties Directory Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + +
+
+
+
Properties Directory Reference
+
+
+ + + + +

+Files

file  AssemblyInfo.cs
 
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_e7b82169049e0ac7641346b9a32f66f9.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_e7b82169049e0ac7641346b9a32f66f9.html new file mode 100644 index 0000000..df0602e --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_e7b82169049e0ac7641346b9a32f66f9.html @@ -0,0 +1,87 @@ + + + + + + +CmdMessenger: D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CSharp/CommandMessenger Directory Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + +
+
+
+
CommandMessenger Directory Reference
+
+
+ + + + +

+Directories

directory  Properties
 
+ + + + + + + + + + + + + + + + + + + + + +

+Files

file  BinaryConverter.cs
 
file  CmdMessenger.cs
 
file  Escaped.cs
 
file  ReceivedCommand.cs
 
file  SendCommand.cs
 
file  SerialPortManager.cs
 
file  SerialSettings.cs
 
file  StringUtils.cs
 
file  TimedAction.cs
 
file  TimeUtils.cs
 
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_ea5c6e20fa45e744a26fd38cb27a1fad.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_ea5c6e20fa45e744a26fd38cb27a1fad.html new file mode 100644 index 0000000..ea476d3 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_ea5c6e20fa45e744a26fd38cb27a1fad.html @@ -0,0 +1,64 @@ + + + + + + +CmdMessenger: D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/Examples/SendAndReceiveBinaryArguments Directory Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + +
+
+
+
SendAndReceiveBinaryArguments Directory Reference
+
+
+ + + + +

+Files

file  SendAndReceiveBinaryArguments.ino
 
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_f9dfd35b172a0e2036ace76497fb239b.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_f9dfd35b172a0e2036ace76497fb239b.html new file mode 100644 index 0000000..dbd0cad --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_f9dfd35b172a0e2036ace76497fb239b.html @@ -0,0 +1,66 @@ + + + + + + +CmdMessenger: D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/Documentation Directory Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + +
+
+
+
Documentation Directory Reference
+
+
+ + + + + + +

+Directories

directory  html
 
directory  PC
 
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_fb62facb74a460b0959ac26ee88489cf.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_fb62facb74a460b0959ac26ee88489cf.html new file mode 100644 index 0000000..c8970a5 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dir_fb62facb74a460b0959ac26ee88489cf.html @@ -0,0 +1,66 @@ + + + + + + +CmdMessenger: D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/Documentation/PC/html Directory Reference + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + +
+
+
+
html Directory Reference
+
+
+ + + + + + +

+Files

file  dynsections.js
 
file  jquery.js
 
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/doxygen.css b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/doxygen.css new file mode 100644 index 0000000..cee0d06 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/doxygen.css @@ -0,0 +1,949 @@ +/* The standard CSS for doxygen */ + +body, table, div, p, dl { + font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif; + font-size: 13px; + line-height: 1.3; +} + +/* @group Heading Levels */ + +h1 { + font-size: 150%; +} + +.title { + font-size: 150%; + font-weight: bold; + margin: 10px 2px; +} + +h2 { + font-size: 120%; +} + +h3 { + font-size: 100%; +} + +dt { + font-weight: bold; +} + +div.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; +} + +p.startli, p.startdd, p.starttd { + margin-top: 2px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +p.endtd { + margin-bottom: 2px; +} + +/* @end */ + +caption { + font-weight: bold; +} + +span.legend { + font-size: 70%; + text-align: center; +} + +h3.version { + font-size: 90%; + text-align: center; +} + +div.qindex, div.navtab{ + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; +} + +div.qindex, div.navpath { + width: 100%; + line-height: 140%; +} + +div.navtab { + margin-right: 15px; +} + +/* @group Link Styling */ + +a { + color: #3D578C; + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: #4665A2; +} + +a:hover { + text-decoration: underline; +} + +a.qindex { + font-weight: bold; +} + +a.qindexHL { + font-weight: bold; + background-color: #9CAFD4; + color: #ffffff; + border: 1px double #869DCA; +} + +.contents a.qindexHL:visited { + color: #ffffff; +} + +a.el { + font-weight: bold; +} + +a.elRef { +} + +a.code, a.code:visited { + color: #4665A2; +} + +a.codeRef, a.codeRef:visited { + color: #4665A2; +} + +/* @end */ + +dl.el { + margin-left: -1cm; +} + +.fragment { + font-family: monospace, fixed; + font-size: 105%; +} + +pre.fragment { + border: 1px solid #C4CFE5; + background-color: #FBFCFD; + padding: 4px 6px; + margin: 4px 8px 4px 2px; + overflow: auto; + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; +} + +div.ah { + background-color: black; + font-weight: bold; + color: #ffffff; + margin-bottom: 3px; + margin-top: 3px; + padding: 0.2em; + border: solid thin #333; + border-radius: 0.5em; + -webkit-border-radius: .5em; + -moz-border-radius: .5em; + box-shadow: 2px 2px 3px #999; + -webkit-box-shadow: 2px 2px 3px #999; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); + background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000); +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + font-weight: bold; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +body { + background-color: white; + color: black; + margin: 0; +} + +div.contents { + margin-top: 10px; + margin-left: 8px; + margin-right: 8px; +} + +td.indexkey { + background-color: #EBEFF6; + font-weight: bold; + border: 1px solid #C4CFE5; + margin: 2px 0px 2px 0; + padding: 2px 10px; + white-space: nowrap; + vertical-align: top; +} + +td.indexvalue { + background-color: #EBEFF6; + border: 1px solid #C4CFE5; + padding: 2px 10px; + margin: 2px 0px; +} + +tr.memlist { + background-color: #EEF1F7; +} + +p.formulaDsp { + text-align: center; +} + +img.formulaDsp { + +} + +img.formulaInl { + vertical-align: middle; +} + +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { + border: 0px; +} + +address.footer { + text-align: right; + padding-right: 12px; +} + +img.footer { + border: 0px; + vertical-align: middle; +} + +/* @group Code Colorization */ + +span.keyword { + color: #008000 +} + +span.keywordtype { + color: #604020 +} + +span.keywordflow { + color: #e08000 +} + +span.comment { + color: #800000 +} + +span.preprocessor { + color: #806020 +} + +span.stringliteral { + color: #002080 +} + +span.charliteral { + color: #008080 +} + +span.vhdldigit { + color: #ff00ff +} + +span.vhdlchar { + color: #000000 +} + +span.vhdlkeyword { + color: #700070 +} + +span.vhdllogic { + color: #ff0000 +} + +/* @end */ + +/* +.search { + color: #003399; + font-weight: bold; +} + +form.search { + margin-bottom: 0px; + margin-top: 0px; +} + +input.search { + font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +*/ + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid #A3B4D7; +} + +th.dirtab { + background: #EBEFF6; + font-weight: bold; +} + +hr { + height: 0px; + border: none; + border-top: 1px solid #4A6AAA; +} + +hr.footer { + height: 1px; +} + +/* @group Member Descriptions */ + +table.memberdecls { + border-spacing: 0px; + padding: 0px; +} + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: #F9FAFC; + border: none; + margin: 4px; + padding: 1px 0 0 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: #555; +} + +.memItemLeft, .memItemRight, .memTemplParams { + border-top: 1px solid #C4CFE5; +} + +.memItemLeft, .memTemplItemLeft { + white-space: nowrap; +} + +.memItemRight { + width: 100%; +} + +.memTemplParams { + color: #4665A2; + white-space: nowrap; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtemplate { + font-size: 80%; + color: #4665A2; + font-weight: normal; + margin-left: 9px; +} + +.memnav { + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} + +.mempage { + width: 100%; +} + +.memitem { + padding: 0; + margin-bottom: 10px; + margin-right: 5px; +} + +.memname { + white-space: nowrap; + font-weight: bold; + margin-left: 6px; +} + +.memproto, dl.reflist dt { + border-top: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 0px 6px 0px; + color: #253555; + font-weight: bold; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + /* opera specific markup */ + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + border-top-right-radius: 8px; + border-top-left-radius: 8px; + /* firefox specific markup */ + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + -moz-border-radius-topright: 8px; + -moz-border-radius-topleft: 8px; + /* webkit specific markup */ + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + -webkit-border-top-right-radius: 8px; + -webkit-border-top-left-radius: 8px; + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E8F2; + +} + +.memdoc, dl.reflist dd { + border-bottom: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 2px 5px; + background-color: #FBFCFD; + border-top-width: 0; + /* opera specific markup */ + border-bottom-left-radius: 8px; + border-bottom-right-radius: 8px; + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + /* firefox specific markup */ + -moz-border-radius-bottomleft: 8px; + -moz-border-radius-bottomright: 8px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 60%, #F7F8FB 95%, #EEF1F7); + /* webkit specific markup */ + -webkit-border-bottom-left-radius: 8px; + -webkit-border-bottom-right-radius: 8px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.6,#FFFFFF), color-stop(0.60,#FFFFFF), color-stop(0.95,#F7F8FB), to(#EEF1F7)); +} + +dl.reflist dt { + padding: 5px; +} + +dl.reflist dd { + margin: 0px 0px 10px 0px; + padding: 5px; +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; +} + +.paramname { + color: #602020; + white-space: nowrap; +} +.paramname em { + font-style: normal; +} + +.params, .retval, .exception, .tparams { + border-spacing: 6px 2px; +} + +.params .paramname, .retval .paramname { + font-weight: bold; + vertical-align: top; +} + +.params .paramtype { + font-style: italic; + vertical-align: top; +} + +.params .paramdir { + font-family: "courier new",courier,monospace; + vertical-align: top; +} + + + + +/* @end */ + +/* @group Directory (tree) */ + +/* for the tree view */ + +.ftvtree { + font-family: sans-serif; + margin: 0px; +} + +/* these are for tree view when used as main index */ + +.directory { + font-size: 9pt; + font-weight: bold; + margin: 5px; +} + +.directory h3 { + margin: 0px; + margin-top: 1em; + font-size: 11pt; +} + +/* +The following two styles can be used to replace the root node title +with an image of your choice. Simply uncomment the next two styles, +specify the name of your image and be sure to set 'height' to the +proper pixel height of your image. +*/ + +/* +.directory h3.swap { + height: 61px; + background-repeat: no-repeat; + background-image: url("yourimage.gif"); +} +.directory h3.swap span { + display: none; +} +*/ + +.directory > h3 { + margin-top: 0; +} + +.directory p { + margin: 0px; + white-space: nowrap; +} + +.directory div { + display: none; + margin: 0px; +} + +.directory img { + vertical-align: -30%; +} + +/* these are for tree view when not used as main index */ + +.directory-alt { + font-size: 100%; + font-weight: bold; +} + +.directory-alt h3 { + margin: 0px; + margin-top: 1em; + font-size: 11pt; +} + +.directory-alt > h3 { + margin-top: 0; +} + +.directory-alt p { + margin: 0px; + white-space: nowrap; +} + +.directory-alt div { + display: none; + margin: 0px; +} + +.directory-alt img { + vertical-align: -30%; +} + +/* @end */ + +div.dynheader { + margin-top: 8px; +} + +address { + font-style: normal; + color: #2A3D61; +} + +table.doxtable { + border-collapse:collapse; +} + +table.doxtable td, table.doxtable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; + text-align:left; +} + +table.fieldtable { + width: 100%; + margin-bottom: 10px; + border: 1px solid #A8B8D9; + border-spacing: 0px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); + box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); +} + +.fieldtable td, .fieldtable th { + padding: 3px 7px 2px; +} + +.fieldtable td.fieldtype, .fieldtable td.fieldname { + white-space: nowrap; + border-right: 1px solid #A8B8D9; + border-bottom: 1px solid #A8B8D9; + vertical-align: top; +} + +.fieldtable td.fielddoc { + border-bottom: 1px solid #A8B8D9; + width: 100%; +} + +.fieldtable tr:last-child td { + border-bottom: none; +} + +.fieldtable th { + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E8F2; + font-size: 90%; + color: #253555; + padding-bottom: 4px; + padding-top: 5px; + text-align:left; + -moz-border-radius-topleft: 4px; + -moz-border-radius-topright: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom: 1px solid #A8B8D9; +} + + +.tabsearch { + top: 0px; + left: 10px; + height: 36px; + background-image: url('tab_b.png'); + z-index: 101; + overflow: hidden; + font-size: 13px; +} + +.navpath ul +{ + font-size: 11px; + background-image:url('tab_b.png'); + background-repeat:repeat-x; + height:30px; + line-height:30px; + color:#8AA0CC; + border:solid 1px #C2CDE4; + overflow:hidden; + margin:0px; + padding:0px; +} + +.navpath li +{ + list-style-type:none; + float:left; + padding-left:10px; + padding-right:15px; + background-image:url('bc_s.png'); + background-repeat:no-repeat; + background-position:right; + color:#364D7C; +} + +.navpath li.navelem a +{ + height:32px; + display:block; + text-decoration: none; + outline: none; +} + +.navpath li.navelem a:hover +{ + color:#6884BD; +} + +.navpath li.footer +{ + list-style-type:none; + float:right; + padding-left:10px; + padding-right:15px; + background-image:none; + background-repeat:no-repeat; + background-position:right; + color:#364D7C; + font-size: 8pt; +} + + +div.summary +{ + float: right; + font-size: 8pt; + padding-right: 5px; + width: 50%; + text-align: right; +} + +div.summary a +{ + white-space: nowrap; +} + +div.ingroups +{ + margin-left: 5px; + font-size: 8pt; + padding-left: 5px; + width: 50%; + text-align: left; +} + +div.ingroups a +{ + white-space: nowrap; +} + +div.header +{ + background-image:url('nav_h.png'); + background-repeat:repeat-x; + background-color: #F9FAFC; + margin: 0px; + border-bottom: 1px solid #C4CFE5; +} + +div.headertitle +{ + padding: 5px 5px 5px 7px; +} + +dl +{ + padding: 0 0 0 10px; +} + +dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug +{ + border-left:4px solid; + padding: 0 0 0 6px; +} + +dl.note +{ + border-color: #D0C000; +} + +dl.warning, dl.attention +{ + border-color: #FF0000; +} + +dl.pre, dl.post, dl.invariant +{ + border-color: #00D000; +} + +dl.deprecated +{ + border-color: #505050; +} + +dl.todo +{ + border-color: #00C0E0; +} + +dl.test +{ + border-color: #3030E0; +} + +dl.bug +{ + border-color: #C08050; +} + +#projectlogo +{ + text-align: center; + vertical-align: bottom; + border-collapse: separate; +} + +#projectlogo img +{ + border: 0px none; +} + +#projectname +{ + font: 300% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 2px 0px; +} + +#projectbrief +{ + font: 120% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#projectnumber +{ + font: 50% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#titlearea +{ + padding: 0px; + margin: 0px; + width: 100%; + border-bottom: 1px solid #5373B4; +} + +.image +{ + text-align: center; +} + +.dotgraph +{ + text-align: center; +} + +.mscgraph +{ + text-align: center; +} + +.caption +{ + font-weight: bold; +} + +div.zoom +{ + border: 1px solid #90A5CE; +} + +dl.citelist { + margin-bottom:50px; +} + +dl.citelist dt { + color:#334975; + float:left; + font-weight:bold; + margin-right:10px; + padding:5px; +} + +dl.citelist dd { + margin:2px 0; + padding:5px 0; +} + +@media print +{ + #top { display: none; } + #side-nav { display: none; } + #nav-path { display: none; } + body { overflow:visible; } + h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } + .summary { display: none; } + .memitem { page-break-inside: avoid; } + #doc-content + { + margin-left:0 !important; + height:auto !important; + width:auto !important; + overflow:inherit; + display:inline; + } + pre.fragment + { + overflow: visible; + text-wrap: unrestricted; + white-space: -moz-pre-wrap; /* Moz */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + white-space: pre-wrap; /* CSS3 */ + word-wrap: break-word; /* IE 5.5+ */ + } +} + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/doxygen.png b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/doxygen.png new file mode 100644 index 0000000..635ed52 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/doxygen.png Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dynsections.js b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dynsections.js new file mode 100644 index 0000000..ed092c7 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/dynsections.js @@ -0,0 +1,97 @@ +function toggleVisibility(linkObj) +{ + var base = $(linkObj).attr('id'); + var summary = $('#'+base+'-summary'); + var content = $('#'+base+'-content'); + var trigger = $('#'+base+'-trigger'); + var src=$(trigger).attr('src'); + if (content.is(':visible')===true) { + content.hide(); + summary.show(); + $(linkObj).addClass('closed').removeClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); + } else { + content.show(); + summary.hide(); + $(linkObj).removeClass('closed').addClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); + } + return false; +} + +function updateStripes() +{ + $('table.directory tr'). + removeClass('even').filter(':visible:even').addClass('even'); +} +function toggleLevel(level) +{ + $('table.directory tr').each(function(){ + var l = this.id.split('_').length-1; + var i = $('#img'+this.id.substring(3)); + var a = $('#arr'+this.id.substring(3)); + if (l + + + + +CmdMessenger: File List + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a messaging library for the Arduino Platform. It has uses the serial port as its transport layer
+
+
+ + + + +
+
+
+
File List
+
+
+
Here is a list of all documented files with brief descriptions:
+ +
D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CmdMessenger.h [code]
+
+ + + + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2blank.png b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2blank.png new file mode 100644 index 0000000..63c605b --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2blank.png Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2cl.png b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2cl.png new file mode 100644 index 0000000..132f657 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2cl.png Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2doc.png b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2doc.png new file mode 100644 index 0000000..17edabf --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2doc.png Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2folderclosed.png b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2folderclosed.png new file mode 100644 index 0000000..bb8ab35 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2folderclosed.png Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2folderopen.png b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2folderopen.png new file mode 100644 index 0000000..d6c7f67 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2folderopen.png Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2lastnode.png b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2lastnode.png new file mode 100644 index 0000000..63c605b --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2lastnode.png Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2link.png b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2link.png new file mode 100644 index 0000000..17edabf --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2link.png Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2mlastnode.png b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2mlastnode.png new file mode 100644 index 0000000..0b63f6d --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2mlastnode.png Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2mnode.png b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2mnode.png new file mode 100644 index 0000000..0b63f6d --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2mnode.png Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2mo.png b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2mo.png new file mode 100644 index 0000000..4bfb80f --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2mo.png Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2node.png b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2node.png new file mode 100644 index 0000000..63c605b --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2node.png Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2ns.png b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2ns.png new file mode 100644 index 0000000..72e3d71 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2ns.png Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2plastnode.png b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2plastnode.png new file mode 100644 index 0000000..c6ee22f --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2plastnode.png Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2pnode.png b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2pnode.png new file mode 100644 index 0000000..c6ee22f --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2pnode.png Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2splitbar.png b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2splitbar.png new file mode 100644 index 0000000..fe895f2 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2splitbar.png Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2vertline.png b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2vertline.png new file mode 100644 index 0000000..63c605b --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/ftv2vertline.png Binary files differ diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/functions.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/functions.html new file mode 100644 index 0000000..af90012 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/functions.html @@ -0,0 +1,207 @@ + + + + + +CmdMessenger: Class Members + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a messaging library for the Arduino Platform. It has uses the serial port as its transport layer
+
+
+ + + + + + +
+
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- a -

+ + +

- c -

+ + +

- f -

+ + +

- i -

+ + +

- n -

+ + +

- p -

+ + +

- r -

+ + +

- s -

+ + +

- u -

+
+ + + + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/functions_func.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/functions_func.html new file mode 100644 index 0000000..c93e698 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/functions_func.html @@ -0,0 +1,207 @@ + + + + + +CmdMessenger: Class Members - Functions + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a messaging library for the Arduino Platform. It has uses the serial port as its transport layer
+
+
+ + + + + + +
+
+  + +

- a -

+ + +

- c -

+ + +

- f -

+ + +

- i -

+ + +

- n -

+ + +

- p -

+ + +

- r -

+ + +

- s -

+ + +

- u -

+
+ + + + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/functions_prop.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/functions_prop.html new file mode 100644 index 0000000..57c4dc7 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/functions_prop.html @@ -0,0 +1,225 @@ + + + + + + +CmdMessenger: Class Members - Properties + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + + + +
+
+  + +

- a -

+ + +

- b -

+ + +

- c -

+ + +

- d -

+ + +

- e -

+ + +

- i -

+ + +

- l -

+ + +

- m -

+ + +

- o -

+ + +

- p -

+ + +

- r -

+ + +

- s -

+ + +

- t -

+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/hierarchy.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/hierarchy.html new file mode 100644 index 0000000..7a406f6 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/hierarchy.html @@ -0,0 +1,88 @@ + + + + + + +CmdMessenger: Class Hierarchy + + + + + + +
+
+ + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a serial port messaging library for the Arduino
+
+
+ + + + +
+
+
+
Class Hierarchy
+
+
+
This inheritance list is sorted roughly, but not completely, alphabetically:
+
[detail level 12]
+ + + + + + + + + + + + + + + + + + + + + + +
oCCommandMessenger.BinaryConverter
oCCmdMessenger
oCCommandMessenger.EscapingUtility class providing escaping functions
oCIDisposable
|oCCommandMessenger.CmdMessengerCommand messenger main class
|\CCommandMessenger.SerialPortManagerFas Manager for serial port data
oCINotifyPropertyChanged
|\CCommandMessenger.SerialSettingsClass containing properties related to a serial port
oCCommandMessenger.IsEscapedClass for bookkeeping which characters in the stream are escaped.
oCReceive.Program
oCSendAndReceive.Program
oCSendAndReceiveArguments.Program
oCSendAndReceiveBinaryArguments.Program
oCReceive.Receive
oCCommandMessenger.ReceivedCommandA command received from CmdMessenger
oCSendAndReceive.SendAndReceive
oCSendAndReceiveArguments.SendAndReceiveArguments
oCSendAndReceiveBinaryArguments.SendAndReceiveBinaryArguments
oCCommandMessenger.SendCommandA command to be send by CmdMessenger
oCCommandMessenger.StringUtilsString utilities.
oCCommandMessenger.TimedActionStarts a recurring action with fixed interval If still running at next call, the action is skipped
\CCommandMessenger.TimeUtilsClass to get a timestamp
+
+
+ + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/index.html b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/index.html new file mode 100644 index 0000000..91b6907 --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/index.html @@ -0,0 +1,62 @@ + + + + + +CmdMessenger: Main Page + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
CmdMessenger +  3.0 +
+
CmdMessenger is a messaging library for the Arduino Platform. It has uses the serial port as its transport layer
+
+
+ + + +
+
+
+
CmdMessenger Documentation
+
+
+
+ + + + + + diff --git a/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/jquery.js b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/jquery.js new file mode 100644 index 0000000..90b3a2b --- /dev/null +++ b/Software/Arduino/libraries/Arduino-Libraries/CmdMessenger/Documentation/Arduino/html/jquery.js @@ -0,0 +1,64 @@ +/* + * jQuery JavaScript Library v1.3.2 + * http://jquery.com/ + * + * Copyright (c) 2009 John Resig + * Dual licensed under the MIT and GPL licenses. + * http://docs.jquery.com/License + * + * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) + * Revision: 6246 + */ +(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
","
"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); +/* + * Sizzle CSS Selector Engine - v0.9.3 + * Copyright 2009, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return UT[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="

";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="
";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0) +{I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("
").append(M.responseText.replace(//g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function() +{G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='
';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); + +/* + * jQuery hashchange event - v1.3 - 7/21/2010 + * http://benalman.com/projects/jquery-hashchange-plugin/ + * + * Copyright (c) 2010 "Cowboy" Ben Alman + * Dual licensed under the MIT and GPL licenses. + * http://benalman.com/about/license/ + */ +(function($,e,b){var c="hashchange",h=document,f,g=$.event.special,i=h.documentMode,d="on"+c in e&&(i===b||i>7);function a(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}$.fn[c]=function(j){return j?this.bind(c,j):this.trigger(c)};$.fn[c].delay=50;g[c]=$.extend(g[c],{setup:function(){if(d){return false}$(f.start)},teardown:function(){if(d){return false}$(f.stop)}});f=(function(){var j={},p,m=a(),k=function(q){return q},l=k,o=k;j.start=function(){p||n()};j.stop=function(){p&&clearTimeout(p);p=b};function n(){var r=a(),q=o(m);if(r!==m){l(m=r,q);$(e).trigger(c)}else{if(q!==m){location.href=location.href.replace(/#.*/,"")+q}}p=setTimeout(n,$.fn[c].delay)}$.browser.msie&&!d&&(function(){var q,r;j.start=function(){if(!q){r=$.fn[c].src;r=r&&r+a();q=$('